Compare commits
8 Commits
Author | SHA1 | Date | |
---|---|---|---|
ad5c25d80e | |||
a713d88f27 | |||
100f657e04 | |||
46e0b9f9db | |||
64d6379cd2 | |||
847733286c | |||
67a037c511 | |||
21bcdb2e01 |
@ -1,10 +1,10 @@
|
|||||||
// dees tools
|
// dees tools
|
||||||
import * as deesWccTools from '@designestate/dees-wcctools';
|
import * as deesWccTools from '../ts_web';
|
||||||
import * as deesDomTools from '@designestate/dees-domtools';
|
import * as deesDomTools from '@designestate/dees-domtools';
|
||||||
|
|
||||||
// elements and pages
|
// elements and pages
|
||||||
import * as elements from '../ts_web/elements';
|
import * as elements from '../test/elements';
|
||||||
import * as pages from '../ts_web/pages';
|
import * as pages from '../test/pages';
|
||||||
|
|
||||||
deesWccTools.setupWccTools(elements as any, pages);
|
deesWccTools.setupWccTools(elements as any, pages);
|
||||||
deesDomTools.elementBasic.setup();
|
deesDomTools.elementBasic.setup();
|
||||||
|
11
package-lock.json
generated
11
package-lock.json
generated
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@designestate/dees-wcctools",
|
"name": "@designestate/dees-wcctools",
|
||||||
"version": "1.0.41",
|
"version": "1.0.45",
|
||||||
"lockfileVersion": 1,
|
"lockfileVersion": 1,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
@ -1153,6 +1153,15 @@
|
|||||||
"sweet-scroll": "^4.0.0"
|
"sweet-scroll": "^4.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"@designestate/dees-element": {
|
||||||
|
"version": "1.0.6",
|
||||||
|
"resolved": "https://verdaccio.lossless.one/@designestate%2fdees-element/-/dees-element-1.0.6.tgz",
|
||||||
|
"integrity": "sha512-nYwFrXlDpm85fDDu9IkvrRWartgDabcxs3DDwNLKamd0DmL2EJjYrEpkme7V25gfw9TuwIPXmBcvpKpqrRtNcQ==",
|
||||||
|
"requires": {
|
||||||
|
"@designestate/dees-domtools": "^1.0.70",
|
||||||
|
"lit-element": "^2.4.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
"@gitzone/tsbuild": {
|
"@gitzone/tsbuild": {
|
||||||
"version": "2.1.25",
|
"version": "2.1.25",
|
||||||
"resolved": "https://verdaccio.lossless.one/@gitzone%2ftsbuild/-/tsbuild-2.1.25.tgz",
|
"resolved": "https://verdaccio.lossless.one/@gitzone%2ftsbuild/-/tsbuild-2.1.25.tgz",
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@designestate/dees-wcctools",
|
"name": "@designestate/dees-wcctools",
|
||||||
"version": "1.0.41",
|
"version": "1.0.45",
|
||||||
"private": false,
|
"private": false,
|
||||||
"description": "wcc tools for creating element catalogues",
|
"description": "wcc tools for creating element catalogues",
|
||||||
"main": "dist_ts_web/index.js",
|
"main": "dist_ts_web/index.js",
|
||||||
@ -14,6 +14,7 @@
|
|||||||
"license": "UNLICENSED",
|
"license": "UNLICENSED",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@designestate/dees-domtools": "^1.0.74",
|
"@designestate/dees-domtools": "^1.0.74",
|
||||||
|
"@designestate/dees-element": "^1.0.6",
|
||||||
"@gitzone/tsrun": "^1.2.12",
|
"@gitzone/tsrun": "^1.2.12",
|
||||||
"@pushrocks/smartdelay": "^2.0.10",
|
"@pushrocks/smartdelay": "^2.0.10",
|
||||||
"@pushrocks/smartexpress": "^3.0.97",
|
"@pushrocks/smartexpress": "^3.0.97",
|
||||||
|
@ -1,27 +1,38 @@
|
|||||||
import { LitElement, customElement, TemplateResult, html } from 'lit-element';
|
import { DeesElement, customElement, TemplateResult, html } from '@designestate/dees-element';
|
||||||
|
|
||||||
import * as domtools from '@designestate/dees-domtools';
|
import * as domtools from '@designestate/dees-domtools';
|
||||||
|
|
||||||
@customElement('test-demoelement')
|
@customElement('test-demoelement')
|
||||||
export class TestDemoelement extends LitElement {
|
export class TestDemoelement extends DeesElement {
|
||||||
public static demo = () => html`<test-demoelement></test-demoelement>`;
|
public static demo = () => html`<test-demoelement></test-demoelement>`;
|
||||||
|
|
||||||
public render() {
|
public render() {
|
||||||
return html`
|
return html`
|
||||||
<style>
|
<style>
|
||||||
.maincontainer {
|
.maincontainer, .themeindicator {
|
||||||
display: block;
|
display: block;
|
||||||
background: #fff;
|
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
border-radius: 10px;
|
border-radius: 10px;
|
||||||
|
margin-bottom: 20px;
|
||||||
|
}
|
||||||
|
.maincontainer {
|
||||||
|
color: #fff;
|
||||||
|
background: #000;
|
||||||
|
}
|
||||||
|
.themeindicator {
|
||||||
|
color: ${this.goBright ? '#000' : '#fff'};
|
||||||
|
background: ${this.goBright ? '#fff' : '#000'};
|
||||||
}
|
}
|
||||||
${domtools.breakpoints.cssForPhablet(`
|
${domtools.breakpoints.cssForPhablet(`
|
||||||
.maincontainer {
|
.maincontainer, .themeindicator {
|
||||||
background: #000;
|
border-radius: 50px;
|
||||||
}
|
}
|
||||||
`)}
|
`)}
|
||||||
</style>
|
</style>
|
||||||
<div class="maincontainer">This is a demo element</div>
|
<div class="maincontainer"><slot>This is a demo element</slot></div>
|
||||||
|
<div class="themeindicator">
|
||||||
|
You have selected the ${this.goBright ? 'bright' : 'dark'} theme;
|
||||||
|
</div>
|
||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -20,7 +20,10 @@ export class WccDashboard extends LitElement {
|
|||||||
public selectedType: TElementType;
|
public selectedType: TElementType;
|
||||||
|
|
||||||
@property()
|
@property()
|
||||||
public selectedItem: TemplateResult | LitElement;
|
public selectedItemName: string;
|
||||||
|
|
||||||
|
@property()
|
||||||
|
public selectedItem: (() => TemplateResult) | LitElement;
|
||||||
|
|
||||||
@property()
|
@property()
|
||||||
public selectedViewport: plugins.deesDomtools.breakpoints.TViewport = 'desktop';
|
public selectedViewport: plugins.deesDomtools.breakpoints.TViewport = 'desktop';
|
||||||
@ -29,7 +32,7 @@ export class WccDashboard extends LitElement {
|
|||||||
public selectedTheme: TTheme = 'dark';
|
public selectedTheme: TTheme = 'dark';
|
||||||
|
|
||||||
@property()
|
@property()
|
||||||
public pages: { [key: string]: TemplateResult } = {};
|
public pages: { [key: string]: () => TemplateResult } = {};
|
||||||
|
|
||||||
@property()
|
@property()
|
||||||
public elements: { [key: string]: LitElement } = {};
|
public elements: { [key: string]: LitElement } = {};
|
||||||
@ -39,7 +42,7 @@ export class WccDashboard extends LitElement {
|
|||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
elementsArg?: { [key: string]: LitElement },
|
elementsArg?: { [key: string]: LitElement },
|
||||||
pagesArg?: { [key: string]: TemplateResult }
|
pagesArg?: { [key: string]: () => TemplateResult }
|
||||||
) {
|
) {
|
||||||
super();
|
super();
|
||||||
if (elementsArg) {
|
if (elementsArg) {
|
||||||
@ -56,7 +59,6 @@ export class WccDashboard extends LitElement {
|
|||||||
public render(): TemplateResult {
|
public render(): TemplateResult {
|
||||||
return html`
|
return html`
|
||||||
<style>
|
<style>
|
||||||
@import url('https://fonts.googleapis.com/css?family=Roboto');
|
|
||||||
:host {
|
:host {
|
||||||
font-family: 'Roboto', sans-serif;
|
font-family: 'Roboto', sans-serif;
|
||||||
background: #fcfcfc;
|
background: #fcfcfc;
|
||||||
@ -70,12 +72,15 @@ export class WccDashboard extends LitElement {
|
|||||||
<wcc-sidebar
|
<wcc-sidebar
|
||||||
.dashboardRef=${this}
|
.dashboardRef=${this}
|
||||||
.selectedItem=${this.selectedItem}
|
.selectedItem=${this.selectedItem}
|
||||||
@selectedItem=${(eventArg) => {
|
|
||||||
this.selectedItem = eventArg.detail;
|
|
||||||
}}
|
|
||||||
@selectedType=${(eventArg) => {
|
@selectedType=${(eventArg) => {
|
||||||
this.selectedType = eventArg.detail;
|
this.selectedType = eventArg.detail;
|
||||||
}}
|
}}
|
||||||
|
@selectedItemName=${(eventArg) => {
|
||||||
|
this.selectedItemName = eventArg.detail;
|
||||||
|
}}
|
||||||
|
@selectedItem=${(eventArg) => {
|
||||||
|
this.selectedItem = eventArg.detail;
|
||||||
|
}}
|
||||||
></wcc-sidebar>
|
></wcc-sidebar>
|
||||||
<wcc-properties
|
<wcc-properties
|
||||||
.dashboardRef=${this}
|
.dashboardRef=${this}
|
||||||
@ -93,9 +98,14 @@ export class WccDashboard extends LitElement {
|
|||||||
></wcc-properties>
|
></wcc-properties>
|
||||||
<wcc-frame id="wccFrame" viewport=${this.selectedViewport}>
|
<wcc-frame id="wccFrame" viewport=${this.selectedViewport}>
|
||||||
${(() => {
|
${(() => {
|
||||||
if (this.selectedItem instanceof TemplateResult) {
|
if (this.selectedType === 'page' && this.selectedItem) {
|
||||||
return this.selectedItem;
|
if (typeof this.selectedItem === 'function') {
|
||||||
} else if (this.selectedItem) {
|
return this.selectedItem();
|
||||||
|
} else {
|
||||||
|
console.error('The selected item looks strange:')
|
||||||
|
console.log(this.selectedItem);
|
||||||
|
}
|
||||||
|
} else if (this.selectedType === 'element' && this.selectedItem) {
|
||||||
// console.log(this.selectedItem);
|
// console.log(this.selectedItem);
|
||||||
const anonItem: any = this.selectedItem;
|
const anonItem: any = this.selectedItem;
|
||||||
if (!anonItem.demo) {
|
if (!anonItem.demo) {
|
||||||
@ -134,7 +144,7 @@ export class WccDashboard extends LitElement {
|
|||||||
this.selectedItem = this.elements[routeInfo.params.itemName];
|
this.selectedItem = this.elements[routeInfo.params.itemName];
|
||||||
} else if (routeInfo.params.itemType === 'page') {
|
} else if (routeInfo.params.itemType === 'page') {
|
||||||
this.selectedType = 'page';
|
this.selectedType = 'page';
|
||||||
this.selectedItem = this.pages[routeInfo.params.pageName];
|
this.selectedItem = this.pages[routeInfo.params.itemName];
|
||||||
}
|
}
|
||||||
const domtoolsInstance = await plugins.deesDomtools.elementBasic.setup();
|
const domtoolsInstance = await plugins.deesDomtools.elementBasic.setup();
|
||||||
domtoolsInstance.setVirtualViewport(routeInfo.params.viewport as TViewport);
|
domtoolsInstance.setVirtualViewport(routeInfo.params.viewport as TViewport);
|
||||||
@ -166,10 +176,9 @@ export class WccDashboard extends LitElement {
|
|||||||
|
|
||||||
public buildUrl() {
|
public buildUrl() {
|
||||||
this.domtools.router.pushUrl(
|
this.domtools.router.pushUrl(
|
||||||
`/${this.selectedType}/${(this.selectedItem as any).name}/${this.selectedViewport}/${
|
`/${this.selectedType}/${this.selectedItemName}/${this.selectedViewport}/${
|
||||||
this.selectedTheme
|
this.selectedTheme
|
||||||
}`,
|
}`
|
||||||
0
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -16,7 +16,6 @@ export class WccDefaultElement extends LitElement {
|
|||||||
public render(): TemplateResult {
|
public render(): TemplateResult {
|
||||||
return html`
|
return html`
|
||||||
<style>
|
<style>
|
||||||
@import url('https://fonts.googleapis.com/css?family=Roboto');
|
|
||||||
:host {
|
:host {
|
||||||
font-family: 'Roboto', sans-serif;
|
font-family: 'Roboto', sans-serif;
|
||||||
background: #333;
|
background: #333;
|
||||||
|
@ -130,6 +130,9 @@ export class WccProperties extends LitElement {
|
|||||||
${(() => {
|
${(() => {
|
||||||
if (this.selectedItem && !(this.selectedItem instanceof TemplateResult)) {
|
if (this.selectedItem && !(this.selectedItem instanceof TemplateResult)) {
|
||||||
const anonItem: any = this.selectedItem;
|
const anonItem: any = this.selectedItem;
|
||||||
|
if (!anonItem._classProperties) {
|
||||||
|
return `You have selected a page!`;
|
||||||
|
}
|
||||||
const classProperties: Map<string, any> = anonItem._classProperties;
|
const classProperties: Map<string, any> = anonItem._classProperties;
|
||||||
const returnArray: TemplateResult[] = [];
|
const returnArray: TemplateResult[] = [];
|
||||||
for (const key of classProperties.keys()) {
|
for (const key of classProperties.keys()) {
|
||||||
@ -150,7 +153,7 @@ export class WccProperties extends LitElement {
|
|||||||
this.selectTheme('dark');
|
this.selectTheme('dark');
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
Dark<br /><i class="material-icons">nights_stay</i>
|
Dark<br /><i class="material-icons">brightness_3</i>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
class="button ${this.selectedTheme === 'bright' ? 'selected' : null}"
|
class="button ${this.selectedTheme === 'bright' ? 'selected' : null}"
|
||||||
|
@ -10,7 +10,7 @@ export class WccSidebar extends LitElement {
|
|||||||
public websites: string[] = [];
|
public websites: string[] = [];
|
||||||
|
|
||||||
@property({ attribute: false })
|
@property({ attribute: false })
|
||||||
public selectedItem: LitElement | TemplateResult;
|
public selectedItem: LitElement | (() => TemplateResult);
|
||||||
|
|
||||||
@property({ attribute: false })
|
@property({ attribute: false })
|
||||||
public selectedType: TElementType;
|
public selectedType: TElementType;
|
||||||
@ -92,10 +92,9 @@ export class WccSidebar extends LitElement {
|
|||||||
|
|
||||||
</style>
|
</style>
|
||||||
<div class="heading">
|
<div class="heading">
|
||||||
lele-catalog
|
wcc-tools
|
||||||
</div>
|
</div>
|
||||||
<div class="subheading">
|
<div class="subheading">
|
||||||
Lossless GmbH
|
|
||||||
</div>
|
</div>
|
||||||
<div class="menu">
|
<div class="menu">
|
||||||
<h3>Live Websites</h3>
|
<h3>Live Websites</h3>
|
||||||
@ -109,10 +108,10 @@ export class WccSidebar extends LitElement {
|
|||||||
const item = this.dashboardRef.pages[pageName];
|
const item = this.dashboardRef.pages[pageName];
|
||||||
return html`
|
return html`
|
||||||
<div
|
<div
|
||||||
class="selectOption ${this.selectedItem === item ? 'selected' : console.log('hi')}"
|
class="selectOption ${this.selectedItem === item ? 'selected' : null}"
|
||||||
@click=${async () => {
|
@click=${async () => {
|
||||||
const domtools = await plugins.deesDomtools.DomTools.setupDomTools();
|
const domtools = await plugins.deesDomtools.DomTools.setupDomTools();
|
||||||
this.selectItem('page', item);
|
this.selectItem('page', pageName, item);
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<i class="material-icons">insert_drive_file</i>
|
<i class="material-icons">insert_drive_file</i>
|
||||||
@ -131,7 +130,7 @@ export class WccSidebar extends LitElement {
|
|||||||
class="selectOption ${this.selectedItem === item ? 'selected' : console.log('hi')}"
|
class="selectOption ${this.selectedItem === item ? 'selected' : console.log('hi')}"
|
||||||
@click=${async () => {
|
@click=${async () => {
|
||||||
const domtools = await plugins.deesDomtools.DomTools.setupDomTools();
|
const domtools = await plugins.deesDomtools.DomTools.setupDomTools();
|
||||||
this.selectItem('element', item);
|
this.selectItem('element', elementName, item);
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<i class="material-icons">featured_video</i>
|
<i class="material-icons">featured_video</i>
|
||||||
@ -144,20 +143,28 @@ export class WccSidebar extends LitElement {
|
|||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
|
|
||||||
public selectItem(typeArg: TElementType, itemArg: TemplateResult | LitElement) {
|
public selectItem(typeArg: TElementType, itemNameArg: string, itemArg: (() => TemplateResult) | LitElement) {
|
||||||
console.log('selected item');
|
console.log('selected item');
|
||||||
|
console.log(itemNameArg);
|
||||||
|
console.log(itemArg);
|
||||||
this.selectedItem = itemArg;
|
this.selectedItem = itemArg;
|
||||||
this.selectedType = typeArg;
|
this.selectedType = typeArg;
|
||||||
this.dispatchEvent(
|
|
||||||
new CustomEvent('selectedItem', {
|
|
||||||
detail: itemArg
|
|
||||||
})
|
|
||||||
);
|
|
||||||
this.dispatchEvent(
|
this.dispatchEvent(
|
||||||
new CustomEvent('selectedType', {
|
new CustomEvent('selectedType', {
|
||||||
detail: typeArg
|
detail: typeArg
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
this.dispatchEvent(
|
||||||
|
new CustomEvent('selectedItemName', {
|
||||||
|
detail: itemNameArg
|
||||||
|
})
|
||||||
|
);
|
||||||
|
this.dispatchEvent(
|
||||||
|
new CustomEvent('selectedItem', {
|
||||||
|
detail: itemArg
|
||||||
|
})
|
||||||
|
);
|
||||||
|
|
||||||
this.dashboardRef.buildUrl();
|
this.dashboardRef.buildUrl();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user