@fluid-topics/ft-wc-utils 1.1.50 → 1.1.51
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/build/FtLitElement.d.ts +5 -4
- package/build/FtLitElement.js +11 -11
- package/build/index.d.ts +1 -0
- package/build/index.js +1 -0
- package/package.json +3 -2
package/build/FtLitElement.d.ts
CHANGED
|
@@ -4,16 +4,17 @@ declare const constructorPrototype: unique symbol;
|
|
|
4
4
|
declare const constructorName: unique symbol;
|
|
5
5
|
declare const exportpartsDebouncer: unique symbol;
|
|
6
6
|
export declare class FtLitElement extends ScopedRegistryLitElement {
|
|
7
|
+
exportpartsPrefix?: string;
|
|
8
|
+
exportpartsPrefixes?: string[];
|
|
9
|
+
customStylesheet?: string;
|
|
10
|
+
private adoptedCustomStyleSheet;
|
|
7
11
|
private readonly [constructorPrototype];
|
|
8
12
|
private readonly [constructorName];
|
|
9
13
|
constructor();
|
|
10
14
|
adoptedCallback(): void;
|
|
11
|
-
|
|
12
|
-
exportpartsPrefixes?: string[];
|
|
13
|
-
customStylesheet?: string;
|
|
15
|
+
connectedCallback(): void;
|
|
14
16
|
protected updated(props: PropertyValues): void;
|
|
15
17
|
protected contentAvailableCallback(props: PropertyValues): void;
|
|
16
|
-
private insertCustomStylesheet;
|
|
17
18
|
private [exportpartsDebouncer];
|
|
18
19
|
private scheduleExportpartsUpdate;
|
|
19
20
|
private setExportpartsAttribute;
|
package/build/FtLitElement.js
CHANGED
|
@@ -15,6 +15,7 @@ const exportpartsDebouncer = Symbol("exportpartsDebouncer");
|
|
|
15
15
|
export class FtLitElement extends ScopedRegistryLitElement {
|
|
16
16
|
constructor() {
|
|
17
17
|
super();
|
|
18
|
+
this.adoptedCustomStyleSheet = new CSSStyleSheet();
|
|
18
19
|
this[_a] = new Debouncer(5);
|
|
19
20
|
this[constructorName] = this.constructor.name;
|
|
20
21
|
this[constructorPrototype] = this.constructor.prototype;
|
|
@@ -24,26 +25,25 @@ export class FtLitElement extends ScopedRegistryLitElement {
|
|
|
24
25
|
Object.setPrototypeOf(this, this[constructorPrototype]);
|
|
25
26
|
}
|
|
26
27
|
}
|
|
28
|
+
connectedCallback() {
|
|
29
|
+
super.connectedCallback();
|
|
30
|
+
if (this.shadowRoot && !this.shadowRoot.adoptedStyleSheets.includes(this.adoptedCustomStyleSheet)) {
|
|
31
|
+
this.shadowRoot.adoptedStyleSheets = [...this.shadowRoot.adoptedStyleSheets, this.adoptedCustomStyleSheet];
|
|
32
|
+
}
|
|
33
|
+
}
|
|
27
34
|
updated(props) {
|
|
35
|
+
var _b;
|
|
28
36
|
super.updated(props);
|
|
37
|
+
if (props.has("customStylesheet")) {
|
|
38
|
+
this.adoptedCustomStyleSheet.replace((_b = this.customStylesheet) !== null && _b !== void 0 ? _b : "");
|
|
39
|
+
}
|
|
29
40
|
this.updateComplete.then(() => {
|
|
30
41
|
this.contentAvailableCallback(props);
|
|
31
|
-
this.insertCustomStylesheet();
|
|
32
42
|
this.scheduleExportpartsUpdate();
|
|
33
43
|
});
|
|
34
44
|
}
|
|
35
45
|
contentAvailableCallback(props) {
|
|
36
46
|
}
|
|
37
|
-
insertCustomStylesheet() {
|
|
38
|
-
var _b, _c;
|
|
39
|
-
((_c = (_b = this.shadowRoot) === null || _b === void 0 ? void 0 : _b.querySelectorAll(".ft-lit-element--custom-stylesheet")) !== null && _c !== void 0 ? _c : []).forEach(e => e.remove());
|
|
40
|
-
if (this.customStylesheet) {
|
|
41
|
-
const customStyles = document.createElement("style");
|
|
42
|
-
customStyles.classList.add("ft-lit-element--custom-stylesheet");
|
|
43
|
-
customStyles.innerHTML = this.customStylesheet;
|
|
44
|
-
this.shadowRoot.append(customStyles);
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
47
|
scheduleExportpartsUpdate() {
|
|
48
48
|
var _b, _c, _d;
|
|
49
49
|
if (((_b = this.exportpartsPrefix) === null || _b === void 0 ? void 0 : _b.trim()) || ((_d = (_c = this.exportpartsPrefixes) === null || _c === void 0 ? void 0 : _c.length) !== null && _d !== void 0 ? _d : 0 > 0)) {
|
package/build/index.d.ts
CHANGED
package/build/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluid-topics/ft-wc-utils",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.51",
|
|
4
4
|
"description": "Internal web components tools",
|
|
5
5
|
"author": "Fluid Topics <devtopics@antidot.net>",
|
|
6
6
|
"license": "ISC",
|
|
@@ -20,8 +20,9 @@
|
|
|
20
20
|
"@types/mark.js": "8.11.12",
|
|
21
21
|
"@webcomponents/scoped-custom-element-registry": "0.0.9",
|
|
22
22
|
"composed-offset-position": "^0.0.4",
|
|
23
|
+
"construct-style-sheets-polyfill": "3.1.0",
|
|
23
24
|
"lit": "3.1.0",
|
|
24
25
|
"mark.js": "8.11.1"
|
|
25
26
|
},
|
|
26
|
-
"gitHead": "
|
|
27
|
+
"gitHead": "1dcb93d48e681051070e118dfc7c56aa8b8aa3fa"
|
|
27
28
|
}
|