@operato/scene-news-ticker 9.0.0-beta.1 → 9.0.0-beta.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/news-ticker-element.d.ts +2 -2
- package/dist/news-ticker-element.js +2 -2
- package/dist/news-ticker-element.js.map +1 -1
- package/dist/news-ticker.d.ts +1 -1
- package/dist/news-ticker.js +9 -5
- package/dist/news-ticker.js.map +1 -1
- package/package.json +5 -4
package/dist/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { default as NewsTicker } from './news-ticker';
|
|
1
|
+
export { default as NewsTicker } from './news-ticker.js';
|
package/dist/index.js
CHANGED
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,kBAAkB,CAAA","sourcesContent":["/*\n * Copyright © 2017 HatioLab Inc. All rights reserved.\n */\n\nexport { default as NewsTicker } from './news-ticker.js'\n"]}
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
* Copyright © HatioLab Inc. All rights reserved.
|
|
3
3
|
*/
|
|
4
4
|
import { __decorate } from "tslib";
|
|
5
|
-
import './news-ticker-horizontal';
|
|
6
|
-
import './news-ticker-vertical';
|
|
5
|
+
import './news-ticker-horizontal.js';
|
|
6
|
+
import './news-ticker-vertical.js';
|
|
7
7
|
import { html, LitElement } from 'lit';
|
|
8
8
|
import { customElement, property } from 'lit/decorators.js';
|
|
9
9
|
let ThingsNewsTicker = class ThingsNewsTicker extends LitElement {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"news-ticker-element.js","sourceRoot":"","sources":["../src/news-ticker-element.ts"],"names":[],"mappings":"AAAA;;GAEG;;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"news-ticker-element.js","sourceRoot":"","sources":["../src/news-ticker-element.ts"],"names":[],"mappings":"AAAA;;GAEG;;AAEH,OAAO,6BAA6B,CAAA;AACpC,OAAO,2BAA2B,CAAA;AAElC,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAA;AACtC,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAG5C,IAAM,gBAAgB,GAAtB,MAAM,gBAAiB,SAAQ,UAAU;IAAzC;;QACe,aAAQ,GAAW,EAAE,CAAA;QACrB,eAAU,GAAW,EAAE,CAAA;QACvB,cAAS,GAAW,EAAE,CAAA;QACtB,aAAQ,GAAW,EAAE,CAAA;QACrB,cAAS,GAAW,EAAE,CAAA;QACrB,cAAS,GAAY,KAAK,CAAA;QAC1B,qBAAgB,GAAY,KAAK,CAAA;QAElC,aAAQ,GAAW,KAAK,CAAA;IA8BtD,CAAC;IA5BC,MAAM;QACJ,OAAO,IAAI,CAAA;QACP,IAAI,CAAC,SAAS,IAAI,UAAU;YAC5B,CAAC,CAAC,IAAI,CAAA;;0BAEY,IAAI,CAAC,QAAQ;2BACZ,IAAI,CAAC,SAAS;kCACP,IAAI,CAAC,gBAAgB;0BAC7B,IAAI,CAAC,QAAQ;;WAE5B;YACH,CAAC,CAAC,IAAI,CAAA;;0BAEY,IAAI,CAAC,QAAQ;2BACZ,IAAI,CAAC,SAAS;kCACP,IAAI,CAAC,gBAAgB;0BAC7B,IAAI,CAAC,QAAQ;;WAE5B;KACN,CAAA;IACH,CAAC;IAED,OAAO;QACL,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,8BAA8B,EAAE,IAAI,CAAC,UAAU,CAAC,CAAA;QACvE,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,4BAA4B,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAA;QACnE,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,6BAA6B,EAAE,IAAI,CAAC,SAAS,CAAC,CAAA;QACrE,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,6BAA6B,EAAE,IAAI,CAAC,SAAS,CAAC,CAAA;IACvE,CAAC;CACF,CAAA;AAtC6B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;kDAAsB;AACrB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;oDAAwB;AACvB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;mDAAuB;AACtB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;kDAAsB;AACrB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;mDAAuB;AACrB;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;mDAA2B;AAC1B;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;0DAAkC;AAClC;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;mDAAsC;AACrC;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;kDAAyB;AATjC,gBAAgB;IADpC,aAAa,CAAC,gBAAgB,CAAC;GACX,gBAAgB,CAuCpC;eAvCoB,gBAAgB","sourcesContent":["/*\n * Copyright © HatioLab Inc. All rights reserved.\n */\n\nimport './news-ticker-horizontal.js'\nimport './news-ticker-vertical.js'\n\nimport { html, LitElement } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\n\n@customElement('ox-news-ticker')\nexport default class ThingsNewsTicker extends LitElement {\n @property({ type: String }) textData: string = ''\n @property({ type: String }) fontFamily: string = ''\n @property({ type: String }) fontColor: string = ''\n @property({ type: String }) fontSize: string = ''\n @property({ type: String }) textAlign: string = ''\n @property({ type: Boolean }) isReverse: boolean = false\n @property({ type: Boolean }) isTextOverflowed: boolean = false\n @property({ type: String }) direction?: 'vertical' | 'horizontal'\n @property({ type: Number }) duration: number = 30000\n\n render() {\n return html`\n ${this.direction == 'vertical'\n ? html`\n <ox-news-ticker-vertical\n .duration=${this.duration}\n .isReverse=${this.isReverse}\n .isTextOverflowed=${this.isTextOverflowed}\n .textData=${this.textData}\n ></ox-news-ticker-vertical>\n `\n : html`\n <ox-news-ticker-horizontal\n .duration=${this.duration}\n .isReverse=${this.isReverse}\n .isTextOverflowed=${this.isTextOverflowed}\n .textData=${this.textData}\n ></ox-news-ticker-horizontal>\n `}\n `\n }\n\n updated() {\n this.style.setProperty('--ox-news-ticker-font-family', this.fontFamily)\n this.style.setProperty('--ox-news-ticker-font-size', this.fontSize)\n this.style.setProperty('--ox-news-ticker-font-color', this.fontColor)\n this.style.setProperty('--ox-news-ticker-text-align', this.textAlign)\n }\n}\n"]}
|
package/dist/news-ticker.d.ts
CHANGED
package/dist/news-ticker.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* Copyright © 2017 HatioLab Inc. All rights reserved.
|
|
3
3
|
*/
|
|
4
|
-
import
|
|
5
|
-
import
|
|
4
|
+
import { __decorate } from "tslib";
|
|
5
|
+
import './news-ticker-element.js';
|
|
6
|
+
import { error, HTMLOverlayElement, sceneComponent } from '@hatiolab/things-scene';
|
|
6
7
|
const NATURE = {
|
|
7
8
|
mutable: false,
|
|
8
9
|
resizable: true,
|
|
@@ -39,7 +40,7 @@ const NATURE = {
|
|
|
39
40
|
],
|
|
40
41
|
help: 'scene/component/news-ticker'
|
|
41
42
|
};
|
|
42
|
-
|
|
43
|
+
let NewsTicker = class NewsTicker extends HTMLOverlayElement {
|
|
43
44
|
get nature() {
|
|
44
45
|
return NATURE;
|
|
45
46
|
}
|
|
@@ -92,6 +93,9 @@ export default class NewsTicker extends HTMLOverlayElement {
|
|
|
92
93
|
document.body.removeChild(span);
|
|
93
94
|
return isOverflowed;
|
|
94
95
|
}
|
|
95
|
-
}
|
|
96
|
-
|
|
96
|
+
};
|
|
97
|
+
NewsTicker = __decorate([
|
|
98
|
+
sceneComponent('news-ticker')
|
|
99
|
+
], NewsTicker);
|
|
100
|
+
export default NewsTicker;
|
|
97
101
|
//# sourceMappingURL=news-ticker.js.map
|
package/dist/news-ticker.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"news-ticker.js","sourceRoot":"","sources":["../src/news-ticker.ts"],"names":[],"mappings":"AAAA;;GAEG
|
|
1
|
+
{"version":3,"file":"news-ticker.js","sourceRoot":"","sources":["../src/news-ticker.ts"],"names":[],"mappings":"AAAA;;GAEG;;AAEH,OAAO,0BAA0B,CAAA;AAEjC,OAAO,EAA8B,KAAK,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAA;AAI9G,MAAM,MAAM,GAAoB;IAC9B,OAAO,EAAE,KAAK;IACd,SAAS,EAAE,IAAI;IACf,SAAS,EAAE,IAAI;IACf,UAAU,EAAE;QACV;YACE,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,WAAW;YAClB,IAAI,EAAE,WAAW;YACjB,QAAQ,EAAE;gBACR,OAAO,EAAE;oBACP;wBACE,OAAO,EAAE,YAAY;wBACrB,KAAK,EAAE,YAAY;qBACpB;oBACD;wBACE,OAAO,EAAE,UAAU;wBACnB,KAAK,EAAE,UAAU;qBAClB;iBACF;aACF;SACF;QACD;YACE,IAAI,EAAE,UAAU;YAChB,KAAK,EAAE,SAAS;YAChB,IAAI,EAAE,SAAS;SAChB;QACD;YACE,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,UAAU;YACjB,IAAI,EAAE,UAAU;YAChB,WAAW,EAAE,SAAS;SACvB;KACF;IACD,IAAI,EAAE,6BAA6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AAA;YAC9C,UAAU,CAAC,QAAQ,GAAG,IAAI,CAAA;QAC5B,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,KAAK,CAAC,CAAC,CAAC,CAAA;QACV,CAAC;IACH,CAAC;IAED,IAAI,gBAAgB;QAClB,IAAI,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC,MAAM,CAAA;QAC3B,IAAI,IAAI,GAAG,QAAQ,CAAC,aAAa,CAAC,MAAM,CAAC,CAAA;QAEzC,aAAa;QACb,IAAI,CAAC,KAAK,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAA;QAC3B,IAAI,CAAC,KAAK,CAAC,QAAQ,GAAG,OAAO,CAAA;QAC7B,IAAI,CAAC,KAAK,CAAC,IAAI,GAAG,OAAO,CAAA;QACzB,IAAI,CAAC,KAAK,CAAC,UAAU,GAAG,MAAM,CAAA;QAE9B,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,IAAI,CAAA;QAE5B,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAA;QAE/B,IAAI,UAAU,GAAG,IAAI,CAAC,qBAAqB,EAAE,CAAA;QAC7C,IAAI,YAAY,GAAG,KAAK,GAAG,UAAU,CAAC,KAAK,CAAA;QAE3C,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAA;QAE/B,OAAO,YAAY,CAAA;IACrB,CAAC;CACF,CAAA;AA9EoB,UAAU;IAD9B,cAAc,CAAC,aAAa,CAAC;GACT,UAAU,CA8E9B;eA9EoB,UAAU","sourcesContent":["/*\n * Copyright © 2017 HatioLab Inc. All rights reserved.\n */\n\nimport './news-ticker-element.js'\n\nimport { Component, ComponentNature, error, HTMLOverlayElement, sceneComponent } from '@hatiolab/things-scene'\n\nimport ThingsNewsTicker from './news-ticker-element.js'\n\nconst NATURE: ComponentNature = {\n mutable: false,\n resizable: true,\n rotatable: true,\n properties: [\n {\n type: 'select',\n label: 'direction',\n name: 'direction',\n property: {\n options: [\n {\n display: 'horizontal',\n value: 'horizontal'\n },\n {\n display: 'vertical',\n value: 'vertical'\n }\n ]\n }\n },\n {\n type: 'checkbox',\n label: 'reverse',\n name: 'reverse'\n },\n {\n type: 'number',\n label: 'duration',\n name: 'duration',\n placeholder: 'seconds'\n }\n ],\n help: 'scene/component/news-ticker'\n}\n\n@sceneComponent('news-ticker')\nexport default class NewsTicker extends HTMLOverlayElement {\n get nature() {\n return NATURE\n }\n\n get hasTextProperty() {\n return true\n }\n\n get tagName() {\n return 'ox-news-ticker'\n }\n\n createElement() {\n super.createElement()\n\n this.setState('text', '#{data}')\n\n var element = this.element\n\n element.style.overflow = 'hidden'\n }\n\n /* component.property => element.property */\n setElementProperties(element: HTMLElement) {\n try {\n var {\n direction = 'horizontal',\n reverse,\n textAlign,\n fontColor = 'black',\n fontSize = 13,\n font,\n duration = 30\n } = this.state\n\n var text = this.text\n\n var isReverse = reverse\n var isTextOverflowed = this.isTextOverflowed\n\n var newsTicker = element as ThingsNewsTicker\n\n newsTicker.direction = direction\n newsTicker.duration = duration * 1000\n newsTicker.fontColor = fontColor\n newsTicker.fontFamily = font\n newsTicker.fontSize = `${fontSize}px`\n newsTicker.textAlign = textAlign\n newsTicker.isReverse = isReverse\n newsTicker.isTextOverflowed = isTextOverflowed\n newsTicker.textData = text\n } catch (e) {\n error(e)\n }\n }\n\n get isTextOverflowed() {\n var { width } = this.bounds\n var span = document.createElement('span')\n\n // @ts-ignore\n span.style.font = this.font\n span.style.position = 'fixed'\n span.style.left = '-100%'\n span.style.visibility = 'none'\n\n span.textContent = this.text\n\n document.body.appendChild(span)\n\n var textBounds = span.getBoundingClientRect()\n var isOverflowed = width < textBounds.width\n\n document.body.removeChild(span)\n\n return isOverflowed\n }\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@operato/scene-news-ticker",
|
|
3
|
-
"version": "9.0.0-beta.
|
|
3
|
+
"version": "9.0.0-beta.15",
|
|
4
|
+
"type": "module",
|
|
4
5
|
"description": "News ticker Component for Things Scene.",
|
|
5
6
|
"license": "MIT",
|
|
6
7
|
"things-scene": true,
|
|
@@ -39,8 +40,8 @@
|
|
|
39
40
|
"@typescript-eslint/parser": "^4.33.0",
|
|
40
41
|
"@web/dev-server": "^0.1.28",
|
|
41
42
|
"concurrently": "^8.0.1",
|
|
42
|
-
"eslint": "^
|
|
43
|
-
"eslint-config-prettier": "^
|
|
43
|
+
"eslint": "^9.18.0",
|
|
44
|
+
"eslint-config-prettier": "^10.0.1",
|
|
44
45
|
"husky": "^8.0.3",
|
|
45
46
|
"lint-staged": "^13.2.2",
|
|
46
47
|
"prettier": "^2.4.1",
|
|
@@ -59,5 +60,5 @@
|
|
|
59
60
|
"prettier --write"
|
|
60
61
|
]
|
|
61
62
|
},
|
|
62
|
-
"gitHead": "
|
|
63
|
+
"gitHead": "3a94a8a9ee8cb8de82ad331cb08b9e48d6625d31"
|
|
63
64
|
}
|