Compare commits

..

26 Commits

Author SHA1 Message Date
e1aebc7db8 1.0.51 2020-12-07 04:07:32 +00:00
97b88d965c fix(core): update 2020-12-07 04:07:32 +00:00
37d343da03 1.0.50 2020-12-07 04:07:03 +00:00
47cb726716 fix(core): update 2020-12-07 04:07:03 +00:00
4220131bc4 1.0.49 2020-11-30 00:50:48 +00:00
edee4fa446 fix(core): update 2020-11-30 00:50:47 +00:00
c2a0fd26e2 1.0.48 2020-11-30 00:45:42 +00:00
693c8ca3f0 fix(core): update 2020-11-30 00:45:41 +00:00
ca58c55a37 1.0.47 2020-11-27 17:09:34 +00:00
79d2be98c5 fix(core): update 2020-11-27 17:09:33 +00:00
7971f48963 1.0.46 2020-11-27 16:49:58 +00:00
a15629a960 fix(core): update 2020-11-27 16:49:57 +00:00
ad5c25d80e 1.0.45 2020-11-27 16:44:35 +00:00
a713d88f27 fix(core): update 2020-11-27 16:44:34 +00:00
100f657e04 1.0.44 2020-11-27 16:40:38 +00:00
46e0b9f9db fix(core): update 2020-11-27 16:40:38 +00:00
64d6379cd2 1.0.43 2020-11-27 15:59:18 +00:00
847733286c fix(core): update 2020-11-27 15:59:18 +00:00
67a037c511 1.0.42 2020-11-26 03:16:19 +00:00
21bcdb2e01 fix(core): update 2020-11-26 03:16:18 +00:00
1743490a26 1.0.41 2020-11-26 02:59:47 +00:00
2f9ec6a700 fix(core): update 2020-11-26 02:59:46 +00:00
3a89888289 1.0.40 2020-11-26 02:56:12 +00:00
98909c61ff fix(core): update 2020-11-26 02:56:11 +00:00
324808dd03 1.0.39 2020-11-26 02:50:50 +00:00
c5eec2ac22 fix(core): update 2020-11-26 02:50:50 +00:00
13 changed files with 1104 additions and 3029 deletions

View File

@ -19,23 +19,35 @@ mirror:
stage: security stage: security
script: script:
- npmci git mirror - npmci git mirror
only:
- tags
tags: tags:
- lossless - lossless
- docker - docker
- notpriv - notpriv
audit: auditProductionDependencies:
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
stage: security
script:
- npmci npm prepare
- npmci command npm install --production --ignore-scripts
- npmci command npm config set registry https://registry.npmjs.org
- npmci command npm audit --audit-level=high --only=prod --production
tags:
- docker
auditDevDependencies:
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
stage: security stage: security
script: script:
- npmci npm prepare - npmci npm prepare
- npmci command npm install --ignore-scripts - npmci command npm install --ignore-scripts
- npmci command npm config set registry https://registry.npmjs.org - npmci command npm config set registry https://registry.npmjs.org
- npmci command npm audit --audit-level=high - npmci command npm audit --audit-level=high --only=dev
tags: tags:
- lossless
- docker - docker
- notpriv allow_failure: true
# ==================== # ====================
# test stage # test stage
@ -50,9 +62,7 @@ testStable:
- npmci npm test - npmci npm test
coverage: /\d+.?\d+?\%\s*coverage/ coverage: /\d+.?\d+?\%\s*coverage/
tags: tags:
- lossless
- docker - docker
- priv
testBuild: testBuild:
stage: test stage: test
@ -63,9 +73,7 @@ testBuild:
- npmci command npm run build - npmci command npm run build
coverage: /\d+.?\d+?\%\s*coverage/ coverage: /\d+.?\d+?\%\s*coverage/
tags: tags:
- lossless
- docker - docker
- notpriv
release: release:
stage: release stage: release
@ -85,6 +93,8 @@ release:
codequality: codequality:
stage: metadata stage: metadata
allow_failure: true allow_failure: true
only:
- tags
script: script:
- npmci command npm install -g tslint typescript - npmci command npm install -g tslint typescript
- npmci npm prepare - npmci npm prepare

View File

@ -15,7 +15,7 @@
"properties": { "properties": {
"projectType": { "projectType": {
"type": "string", "type": "string",
"enum": ["website", "element", "service", "npm"] "enum": ["website", "element", "service", "npm", "wcc"]
} }
} }
} }

View File

@ -9,7 +9,6 @@
content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, height=device-height" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, height=device-height"
/> />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet" />
<style> <style>
body { body {
@ -18,7 +17,8 @@
} }
</style> </style>
<script src="../test/index.ts"></script> <script src="./index.ts"></script>
</head> </head>
<body></body> <body>
</body>
</html> </html>

10
html/index.ts Normal file
View File

@ -0,0 +1,10 @@
// dees tools
import * as deesWccTools from '../ts_web';
import * as deesDomTools from '@designestate/dees-domtools';
// elements and pages
import * as elements from '../test/elements';
import * as pages from '../test/pages';
deesWccTools.setupWccTools(elements as any, pages);
deesDomTools.elementBasic.setup();

View File

@ -1,6 +1,6 @@
{ {
"gitzone": { "gitzone": {
"projectType": "element", "projectType": "wcc",
"module": { "module": {
"githost": "gitlab.com", "githost": "gitlab.com",
"gitscope": "designestate", "gitscope": "designestate",

3934
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
{ {
"name": "@designestate/dees-wcctools", "name": "@designestate/dees-wcctools",
"version": "1.0.38", "version": "1.0.51",
"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",
@ -13,10 +13,11 @@
"author": "Lossless GmbH", "author": "Lossless GmbH",
"license": "UNLICENSED", "license": "UNLICENSED",
"dependencies": { "dependencies": {
"@designestate/dees-domtools": "^1.0.74", "@designestate/dees-domtools": "^1.0.81",
"@designestate/dees-element": "^1.0.9",
"@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.98",
"lit-element": "^2.4.0", "lit-element": "^2.4.0",
"lit-html": "^1.3.0", "lit-html": "^1.3.0",
"typescript": "^4.1.2" "typescript": "^4.1.2"

View File

@ -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>
`; `;
} }
} }

View File

@ -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,17 +72,22 @@ 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}
.warning="${this.warning}" .warning="${this.warning}"
.selectedItem=${this.selectedItem} .selectedItem=${this.selectedItem}
.selectedViewport=${this.selectedViewport}
.selectedTheme=${this.selectedTheme}
@selectedViewport=${(eventArg) => { @selectedViewport=${(eventArg) => {
this.selectedViewport = eventArg.detail; this.selectedViewport = eventArg.detail;
this.performUpdate(); this.performUpdate();
@ -91,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) {
@ -126,19 +138,25 @@ export class WccDashboard extends LitElement {
public async firstUpdated() { public async firstUpdated() {
this.domtools = await plugins.deesDomtools.DomTools.setupDomTools(); this.domtools = await plugins.deesDomtools.DomTools.setupDomTools();
this.domtools.router.on('/:itemType/:itemName/:viewport/:theme', async (routeInfo) => { this.domtools.router.on(
if (routeInfo.params.itemType === 'element') { '/wcctools-route/:itemType/:itemName/:viewport/:theme',
this.selectedType = 'element'; async (routeInfo) => {
this.selectedItem = this.elements[routeInfo.params.itemName]; this.selectedType = routeInfo.params.itemType as TElementType;
} else if (routeInfo.params.itemType === 'page') { this.selectedItemName = routeInfo.params.itemName;
this.selectedType = 'page'; this.selectedViewport = routeInfo.params.viewport as TViewport;
this.selectedItem = this.pages[routeInfo.params.pageName]; this.selectedTheme = routeInfo.params.theme as TTheme;
if (routeInfo.params.itemType === 'element') {
this.selectedItem = this.elements[routeInfo.params.itemName];
} else if (routeInfo.params.itemType === 'page') {
this.selectedItem = this.pages[routeInfo.params.itemName];
}
const domtoolsInstance = await plugins.deesDomtools.elementBasic.setup();
domtoolsInstance.setVirtualViewport(routeInfo.params.viewport as TViewport);
this.selectedTheme === 'bright'
? domtoolsInstance.themeManager.goBright()
: domtoolsInstance.themeManager.goDark();
} }
const domtoolsInstance = await plugins.deesDomtools.elementBasic.setup(); );
domtoolsInstance.setVirtualViewport(routeInfo.params.viewport as TViewport);
this.selectedViewport = routeInfo.params.viewport as TViewport;
this.selectedTheme = routeInfo.params.theme as TTheme;
});
} }
private updating = false; private updating = false;
@ -150,10 +168,8 @@ export class WccDashboard extends LitElement {
await this.domtools.router._handleRouteState(); await this.domtools.router._handleRouteState();
this.updating = true; this.updating = true;
const storeElement = this.selectedItem; const storeElement = this.selectedItem;
setTimeout(async () => { setTimeout(async () => {
this.selectedItem = null; this.selectedItem = null;
setTimeout(async () => { setTimeout(async () => {
this.selectedItem = storeElement; this.selectedItem = storeElement;
setTimeout(() => { setTimeout(() => {
@ -165,10 +181,7 @@ 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}/${ `/wcctools-route/${this.selectedType}/${this.selectedItemName}/${this.selectedViewport}/${this.selectedTheme}`
this.selectedTheme
}`,
0
); );
} }
} }

View File

@ -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;

View File

@ -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}"

View File

@ -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;
@ -44,6 +44,12 @@ export class WccSidebar extends LitElement {
text-align: center; text-align: center;
margin: 20px 5px 5px 5px; margin: 20px 5px 5px 5px;
} }
.heading a {
text-decoration: none;
color: #fff;
}
.subheading { .subheading {
text-align: center; text-align: center;
} }
@ -92,10 +98,10 @@ export class WccSidebar extends LitElement {
</style> </style>
<div class="heading"> <div class="heading">
lele-catalog <a href="https://gitlab.com/designestate/dees-wcctools" target="_blank">wcctools</a>
</div> </div>
<div class="subheading"> <div class="subheading">
Lossless GmbH by Lossless GmbH
</div> </div>
<div class="menu"> <div class="menu">
<h3>Live Websites</h3> <h3>Live Websites</h3>
@ -109,10 +115,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 +137,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 +150,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();
} }
} }

View File

@ -1,7 +1,7 @@
import { WccDashboard } from './elements/wcc-dashboard'; import { WccDashboard } from './elements/wcc-dashboard';
import { LitElement, TemplateResult } from 'lit-element'; import { LitElement, TemplateResult } from 'lit-element';
const setupWccTools = (elementsArg?: { [key: string]: LitElement }, pagesArg?: { [key: string]: TemplateResult }) => { const setupWccTools = (elementsArg?: { [key: string]: LitElement }, pagesArg?: { [key: string]: () => TemplateResult }) => {
let hasRun = false; let hasRun = false;
const runWccToolsSetup = async () => { const runWccToolsSetup = async () => {
if (document.readyState === 'complete' && !hasRun) { if (document.readyState === 'complete' && !hasRun) {