@dooboostore/simple-web-component 1.0.23 → 1.0.24
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/README.md +238 -44
- package/dist/cjs/decorators/applyNode.js +129 -34
- package/dist/cjs/decorators/applyNode.js.map +2 -2
- package/dist/cjs/decorators/attribute.js +21 -2
- package/dist/cjs/decorators/attribute.js.map +2 -2
- package/dist/cjs/decorators/changedAttributeHost.js.map +2 -2
- package/dist/cjs/decorators/classList.js +60 -17
- package/dist/cjs/decorators/classList.js.map +2 -2
- package/dist/cjs/decorators/query.js +77 -2
- package/dist/cjs/decorators/query.js.map +2 -2
- package/dist/cjs/decorators/queryAll.js +77 -2
- package/dist/cjs/decorators/queryAll.js.map +2 -2
- package/dist/cjs/decorators/setAttribute.js +4 -4
- package/dist/cjs/decorators/setAttribute.js.map +2 -2
- package/dist/cjs/decorators/style.js +46 -15
- package/dist/cjs/decorators/style.js.map +2 -2
- package/dist/cjs/index.js +4 -4
- package/dist/cjs/index.js.map +2 -2
- package/dist/cjs/utils/Utils.js +140 -1
- package/dist/cjs/utils/Utils.js.map +2 -2
- package/dist/esm/decorators/applyNode.js +129 -34
- package/dist/esm/decorators/applyNode.js.map +2 -2
- package/dist/esm/decorators/attribute.js +21 -2
- package/dist/esm/decorators/attribute.js.map +2 -2
- package/dist/esm/decorators/changedAttributeHost.js.map +2 -2
- package/dist/esm/decorators/classList.js +60 -17
- package/dist/esm/decorators/classList.js.map +2 -2
- package/dist/esm/decorators/query.js +77 -2
- package/dist/esm/decorators/query.js.map +2 -2
- package/dist/esm/decorators/queryAll.js +77 -2
- package/dist/esm/decorators/queryAll.js.map +2 -2
- package/dist/esm/decorators/setAttribute.js +4 -4
- package/dist/esm/decorators/setAttribute.js.map +2 -2
- package/dist/esm/decorators/style.js +46 -15
- package/dist/esm/decorators/style.js.map +2 -2
- package/dist/esm/index.js +4 -4
- package/dist/esm/index.js.map +2 -2
- package/dist/esm/utils/Utils.js +140 -1
- package/dist/esm/utils/Utils.js.map +2 -2
- package/dist/esm-bundle/dooboostore-simple-web-component.esm.js +542 -155
- package/dist/esm-bundle/dooboostore-simple-web-component.esm.js.map +4 -4
- package/dist/types/decorators/applyNode.d.ts +49 -27
- package/dist/types/decorators/applyNode.d.ts.map +1 -1
- package/dist/types/decorators/attribute.d.ts +11 -4
- package/dist/types/decorators/attribute.d.ts.map +1 -1
- package/dist/types/decorators/classList.d.ts +15 -5
- package/dist/types/decorators/classList.d.ts.map +1 -1
- package/dist/types/decorators/query.d.ts +68 -4
- package/dist/types/decorators/query.d.ts.map +1 -1
- package/dist/types/decorators/queryAll.d.ts +70 -1
- package/dist/types/decorators/queryAll.d.ts.map +1 -1
- package/dist/types/decorators/setAttribute.d.ts.map +1 -1
- package/dist/types/decorators/style.d.ts +17 -8
- package/dist/types/decorators/style.d.ts.map +1 -1
- package/dist/types/index.d.ts +1 -2
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/utils/Utils.d.ts +49 -0
- package/dist/types/utils/Utils.d.ts.map +1 -1
- package/dist/umd-bundle/dooboostore-simple-web-component.umd.js +542 -155
- package/dist/umd-bundle/dooboostore-simple-web-component.umd.js.map +4 -4
- package/package.json +3 -3
- package/src/decorators/applyNode.ts +179 -60
- package/src/decorators/attribute.ts +43 -10
- package/src/decorators/changedAttributeHost.ts +1 -1
- package/src/decorators/classList.ts +79 -17
- package/src/decorators/query.ts +147 -5
- package/src/decorators/queryAll.ts +148 -2
- package/src/decorators/setAttribute.ts +6 -5
- package/src/decorators/style.ts +67 -22
- package/src/index.ts +6 -6
- package/src/utils/Utils.ts +144 -0
- package/dist/cjs/utils/TemplateUtils.js +0 -109
- package/dist/cjs/utils/TemplateUtils.js.map +0 -7
- package/dist/esm/utils/TemplateUtils.js +0 -90
- package/dist/esm/utils/TemplateUtils.js.map +0 -7
- package/dist/types/utils/TemplateUtils.d.ts +0 -59
- package/dist/types/utils/TemplateUtils.d.ts.map +0 -1
- package/src/utils/TemplateUtils.ts +0 -92
|
@@ -20,27 +20,40 @@ function createStyleDecorator(action) {
|
|
|
20
20
|
const r = options.root || "auto";
|
|
21
21
|
const hostSet = SwcUtils.getHostSet(this);
|
|
22
22
|
const targetEls = [];
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
23
|
+
const applyRoot = (t) => {
|
|
24
|
+
if (!t || !(t instanceof HTMLElement)) return;
|
|
25
|
+
if (r === "auto") {
|
|
26
|
+
targetEls.push(t);
|
|
27
|
+
} else {
|
|
28
|
+
if (r === "light" || r === "all") targetEls.push(t);
|
|
29
|
+
if ((r === "shadow" || r === "all") && t.shadowRoot) {
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
if (selector === ":parentHost") applyRoot(hostSet.$parentHost);
|
|
34
|
+
else if (selector === ":appHost") applyRoot(hostSet.$appHost);
|
|
35
|
+
else if (selector === ":firstHost") applyRoot(hostSet.$firstHost);
|
|
36
|
+
else if (selector === ":lastHost") applyRoot(hostSet.$lastHost);
|
|
37
|
+
else if (selector === ":firstAppHost") applyRoot(hostSet.$firstAppHost);
|
|
38
|
+
else if (selector === ":lastAppHost") applyRoot(hostSet.$lastAppHost);
|
|
39
|
+
else if (selector === ":hosts") hostSet.$hosts.forEach(applyRoot);
|
|
40
|
+
else if (selector === ":appHosts") hostSet.$appHosts.forEach(applyRoot);
|
|
41
|
+
else if (selector === ":host" || !selector) applyRoot(this);
|
|
42
|
+
else {
|
|
30
43
|
if (r === "shadow") {
|
|
31
44
|
const found = this.shadowRoot?.querySelectorAll(selector);
|
|
32
|
-
if (found) targetEls.push(...found);
|
|
45
|
+
if (found) targetEls.push(...Array.from(found));
|
|
33
46
|
} else if (r === "light") {
|
|
34
47
|
const found = this.querySelectorAll(selector);
|
|
35
|
-
if (found) targetEls.push(...found);
|
|
48
|
+
if (found) targetEls.push(...Array.from(found));
|
|
36
49
|
} else if (r === "all") {
|
|
37
50
|
const sFound = this.shadowRoot?.querySelectorAll(selector);
|
|
38
51
|
const lFound = this.querySelectorAll(selector);
|
|
39
|
-
if (sFound) targetEls.push(...sFound);
|
|
40
|
-
if (lFound) targetEls.push(...lFound);
|
|
52
|
+
if (sFound) targetEls.push(...Array.from(sFound));
|
|
53
|
+
if (lFound) targetEls.push(...Array.from(lFound));
|
|
41
54
|
} else {
|
|
42
55
|
const found = (this.shadowRoot || this).querySelectorAll(selector);
|
|
43
|
-
if (found) targetEls.push(...found);
|
|
56
|
+
if (found) targetEls.push(...Array.from(found));
|
|
44
57
|
}
|
|
45
58
|
}
|
|
46
59
|
targetEls.forEach((targetEl) => {
|
|
@@ -67,11 +80,29 @@ function createStyleDecorator(action) {
|
|
|
67
80
|
};
|
|
68
81
|
}
|
|
69
82
|
const setStyle = (selector, options = {}) => createStyleDecorator("set")(selector, options);
|
|
70
|
-
|
|
83
|
+
function setStyleHost(targetOrOptions, propertyKey, descriptor) {
|
|
84
|
+
if (propertyKey !== void 0) {
|
|
85
|
+
const decorator = createStyleDecorator("set")(":host", {});
|
|
86
|
+
return decorator(targetOrOptions, propertyKey, descriptor);
|
|
87
|
+
}
|
|
88
|
+
return createStyleDecorator("set")(":host", targetOrOptions || {});
|
|
89
|
+
}
|
|
71
90
|
const updateStyle = (selector, options = {}) => createStyleDecorator("update")(selector, options);
|
|
72
|
-
|
|
91
|
+
function updateStyleHost(targetOrOptions, propertyKey, descriptor) {
|
|
92
|
+
if (propertyKey !== void 0) {
|
|
93
|
+
const decorator = createStyleDecorator("update")(":host", {});
|
|
94
|
+
return decorator(targetOrOptions, propertyKey, descriptor);
|
|
95
|
+
}
|
|
96
|
+
return createStyleDecorator("update")(":host", targetOrOptions || {});
|
|
97
|
+
}
|
|
73
98
|
const removeStyle = (selector, options = {}) => createStyleDecorator("remove")(selector, options);
|
|
74
|
-
|
|
99
|
+
function removeStyleHost(targetOrOptions, propertyKey, descriptor) {
|
|
100
|
+
if (propertyKey !== void 0) {
|
|
101
|
+
const decorator = createStyleDecorator("remove")(":host", {});
|
|
102
|
+
return decorator(targetOrOptions, propertyKey, descriptor);
|
|
103
|
+
}
|
|
104
|
+
return createStyleDecorator("remove")(":host", targetOrOptions || {});
|
|
105
|
+
}
|
|
75
106
|
const findAllStyleMetadata = (target) => {
|
|
76
107
|
const result = /* @__PURE__ */ new Map();
|
|
77
108
|
const maps = ReflectUtils.findAllMetadata(STYLE_METADATA_KEY, target);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/decorators/style.ts"],
|
|
4
|
-
"sourcesContent": ["import { ReflectUtils } from '@dooboostore/core';\nimport { ensureInit } from './elementDefine';\nimport { SwcUtils } from '../utils/Utils';\nimport { SwcQueryOptions } from '../types';\n\nexport type StyleAction = 'set' | 'update' | 'remove';\n\nexport interface StyleOptions extends SwcQueryOptions {
|
|
5
|
-
"mappings": "AAAA,SAAS,oBAAoB;AAC7B,SAAS,kBAAkB;AAC3B,SAAS,gBAAgB;
|
|
4
|
+
"sourcesContent": ["import { ReflectUtils } from '@dooboostore/core';\nimport { ensureInit } from './elementDefine';\nimport { SwcUtils } from '../utils/Utils';\nimport { SwcQueryOptions } from '../types';\n\nexport type StyleAction = 'set' | 'update' | 'remove';\n\nexport interface StyleOptions extends SwcQueryOptions {}\n\nexport interface StyleMetadata {\n propertyKey: string | symbol;\n selector: string;\n action: StyleAction;\n options: StyleOptions;\n}\n\nexport const STYLE_METADATA_KEY = Symbol('simple-web-component:style');\n\nfunction createStyleDecorator(action: StyleAction) {\n return (selector: string, options: StyleOptions = {}): MethodDecorator => {\n return (target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor) => {\n const constructor = target.constructor;\n let metaList = ReflectUtils.getOwnMetadata(STYLE_METADATA_KEY, constructor) as Map<string | symbol, StyleMetadata>;\n if (!metaList) {\n metaList = new Map<string | symbol, StyleMetadata>();\n ReflectUtils.defineMetadata(STYLE_METADATA_KEY, metaList, constructor);\n }\n metaList.set(propertyKey, { propertyKey, selector, action, options });\n\n const original = descriptor.value;\n descriptor.value = async function (...args: any[]) {\n ensureInit(this);\n const res = await original.apply(this, args);\n if (res !== undefined) {\n const r = options.root || 'auto';\n const hostSet = SwcUtils.getHostSet(this as any);\n const targetEls: HTMLElement[] = [];\n\n const applyRoot = (t: any) => {\n if (!t || !(t instanceof HTMLElement)) return;\n if (r === 'auto') {\n // Styles belong to the ELEMENT, not the ShadowRoot.\n targetEls.push(t);\n } else {\n if (r === 'light' || r === 'all') targetEls.push(t);\n if ((r === 'shadow' || r === 'all') && t.shadowRoot) {\n // ShadowRoot doesn't have a style property, so we skip it.\n }\n }\n };\n\n if (selector === ':parentHost') applyRoot(hostSet.$parentHost);\n else if (selector === ':appHost') applyRoot(hostSet.$appHost);\n else if (selector === ':firstHost') applyRoot(hostSet.$firstHost);\n else if (selector === ':lastHost') applyRoot(hostSet.$lastHost);\n else if (selector === ':firstAppHost') applyRoot(hostSet.$firstAppHost);\n else if (selector === ':lastAppHost') applyRoot(hostSet.$lastAppHost);\n else if (selector === ':hosts') hostSet.$hosts.forEach(applyRoot);\n else if (selector === ':appHosts') hostSet.$appHosts.forEach(applyRoot);\n else if (selector === ':host' || !selector) applyRoot(this);\n else {\n if (r === 'shadow') {\n const found = this.shadowRoot?.querySelectorAll(selector);\n if (found) targetEls.push(...(Array.from(found) as HTMLElement[]));\n } else if (r === 'light') {\n const found = (this as any).querySelectorAll(selector);\n if (found) targetEls.push(...(Array.from(found) as HTMLElement[]));\n } else if (r === 'all') {\n const sFound = this.shadowRoot?.querySelectorAll(selector);\n const lFound = (this as any).querySelectorAll(selector);\n if (sFound) targetEls.push(...(Array.from(sFound) as HTMLElement[]));\n if (lFound) targetEls.push(...(Array.from(lFound) as HTMLElement[]));\n } else {\n // auto\n const found = (this.shadowRoot || (this as any)).querySelectorAll(selector);\n if (found) targetEls.push(...(Array.from(found) as HTMLElement[]));\n }\n }\n\n targetEls.forEach(targetEl => {\n if (action === 'set') {\n targetEl.style.cssText = '';\n if (typeof res === 'object' && res !== null) {\n Object.assign(targetEl.style, res);\n } else if (typeof res === 'string') {\n targetEl.style.cssText = res;\n }\n } else if (action === 'update') {\n if (typeof res === 'object' && res !== null) {\n Object.assign(targetEl.style, res);\n }\n } else if (action === 'remove') {\n const props = Array.isArray(res) ? res : [res];\n props.forEach(p => targetEl.style.removeProperty(String(p)));\n }\n });\n }\n return res;\n };\n };\n };\n}\n\n/**\n * @setStyle decorator to surgically set styles on a target element (replaces all existing styles).\n * Usage: @setStyle('#box') getStyles() { return { color: 'red', display: 'block' }; }\n * Usage: @setStyle('#box', { root: 'shadow' }) getStyles() { return { color: 'red' }; }\n */\nexport const setStyle = (selector: string, options: StyleOptions = {}) => createStyleDecorator('set')(selector, options);\n\n/**\n * @setStyleHost decorator - simplified version of @setStyle for :host selector.\n * Usage: @setStyleHost setHostStyle() { return { color: 'red' }; }\n * Usage: @setStyleHost() setHostStyle() { return { color: 'red' }; }\n * Usage: @setStyleHost({ ... }) setHostStyle() { return { color: 'red' }; }\n */\nexport function setStyleHost(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): any;\nexport function setStyleHost(): MethodDecorator;\nexport function setStyleHost(options: StyleOptions): MethodDecorator;\nexport function setStyleHost(targetOrOptions?: any, propertyKey?: string | symbol, descriptor?: PropertyDescriptor): any {\n if (propertyKey !== undefined) {\n const decorator = createStyleDecorator('set')(':host', {});\n return decorator(targetOrOptions, propertyKey, descriptor);\n }\n return createStyleDecorator('set')(':host', (targetOrOptions as StyleOptions) || {});\n}\n\n/**\n * @updateStyle decorator to surgically update styles on a target element (merges with existing styles).\n * Usage: @updateStyle('#box') updateStyles() { return { color: 'blue' }; }\n * Usage: @updateStyle('#box', { root: 'shadow' }) updateStyles() { return { color: 'blue' }; }\n */\nexport const updateStyle = (selector: string, options: StyleOptions = {}) => createStyleDecorator('update')(selector, options);\n\n/**\n * @updateStyleHost decorator - simplified version of @updateStyle for :host selector.\n * Usage: @updateStyleHost updateStyles() { return { color: 'blue' }; }\n * Usage: @updateStyleHost() updateStyles() { return { color: 'blue' }; }\n * Usage: @updateStyleHost({ ... }) updateStyles() { return { color: 'blue' }; }\n */\nexport function updateStyleHost(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): any;\nexport function updateStyleHost(): MethodDecorator;\nexport function updateStyleHost(options: StyleOptions): MethodDecorator;\nexport function updateStyleHost(targetOrOptions?: any, propertyKey?: string | symbol, descriptor?: PropertyDescriptor): any {\n if (propertyKey !== undefined) {\n const decorator = createStyleDecorator('update')(':host', {});\n return decorator(targetOrOptions, propertyKey, descriptor);\n }\n return createStyleDecorator('update')(':host', (targetOrOptions as StyleOptions) || {});\n}\n\n/**\n * @removeStyle decorator to surgically remove styles from a target element.\n * Usage: @removeStyle('#box') clearStyles() { return ['color', 'display']; }\n * Usage: @removeStyle('#box', { root: 'shadow' }) clearStyles() { return ['color']; }\n */\nexport const removeStyle = (selector: string, options: StyleOptions = {}) => createStyleDecorator('remove')(selector, options);\n\n/**\n * @removeStyleHost decorator - simplified version of @removeStyle for :host selector.\n * Usage: @removeStyleHost clearStyles() { return ['color']; }\n * Usage: @removeStyleHost() clearStyles() { return ['color']; }\n * Usage: @removeStyleHost({ ... }) clearStyles() { return ['color']; }\n */\nexport function removeStyleHost(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): any;\nexport function removeStyleHost(): MethodDecorator;\nexport function removeStyleHost(options: StyleOptions): MethodDecorator;\nexport function removeStyleHost(targetOrOptions?: any, propertyKey?: string | symbol, descriptor?: PropertyDescriptor): any {\n if (propertyKey !== undefined) {\n const decorator = createStyleDecorator('remove')(':host', {});\n return decorator(targetOrOptions, propertyKey, descriptor);\n }\n return createStyleDecorator('remove')(':host', (targetOrOptions as StyleOptions) || {});\n}\n\nexport const findAllStyleMetadata = (target: any): Map<string | symbol, StyleMetadata> => {\n const result = new Map<string | symbol, StyleMetadata>();\n const maps = ReflectUtils.findAllMetadata<Map<string | symbol, StyleMetadata>>(STYLE_METADATA_KEY, target);\n maps.forEach(map => {\n if (map instanceof Map) {\n map.forEach((v, k) => result.set(k, v));\n }\n });\n return result;\n};\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,oBAAoB;AAC7B,SAAS,kBAAkB;AAC3B,SAAS,gBAAgB;AAclB,MAAM,qBAAqB,OAAO,4BAA4B;AAErE,SAAS,qBAAqB,QAAqB;AACjD,SAAO,CAAC,UAAkB,UAAwB,CAAC,MAAuB;AACxE,WAAO,CAAC,QAAgB,aAA8B,eAAmC;AACvF,YAAM,cAAc,OAAO;AAC3B,UAAI,WAAW,aAAa,eAAe,oBAAoB,WAAW;AAC1E,UAAI,CAAC,UAAU;AACb,mBAAW,oBAAI,IAAoC;AACnD,qBAAa,eAAe,oBAAoB,UAAU,WAAW;AAAA,MACvE;AACA,eAAS,IAAI,aAAa,EAAE,aAAa,UAAU,QAAQ,QAAQ,CAAC;AAEpE,YAAM,WAAW,WAAW;AAC5B,iBAAW,QAAQ,kBAAmB,MAAa;AACjD,mBAAW,IAAI;AACf,cAAM,MAAM,MAAM,SAAS,MAAM,MAAM,IAAI;AAC3C,YAAI,QAAQ,QAAW;AACrB,gBAAM,IAAI,QAAQ,QAAQ;AAC1B,gBAAM,UAAU,SAAS,WAAW,IAAW;AAC/C,gBAAM,YAA2B,CAAC;AAElC,gBAAM,YAAY,CAAC,MAAW;AAC5B,gBAAI,CAAC,KAAK,EAAE,aAAa,aAAc;AACvC,gBAAI,MAAM,QAAQ;AAEhB,wBAAU,KAAK,CAAC;AAAA,YAClB,OAAO;AACL,kBAAI,MAAM,WAAW,MAAM,MAAO,WAAU,KAAK,CAAC;AAClD,mBAAK,MAAM,YAAY,MAAM,UAAU,EAAE,YAAY;AAAA,cAErD;AAAA,YACF;AAAA,UACF;AAEA,cAAI,aAAa,cAAe,WAAU,QAAQ,WAAW;AAAA,mBACpD,aAAa,WAAY,WAAU,QAAQ,QAAQ;A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,YAAY,qBAAqB,QAAQ,EAAE,SAAS,CAAC,CAAC;AAC5D,WAAO,UAAU,iBAAiB,aAAa,UAAU;AAAA,EAC3D;AACA,SAAO,qBAAqB,QAAQ,EAAE,SAAU,mBAAoC,CAAC,CAAC;AACxF;AAEO,MAAM,uBAAuB,CAAC,WAAqD;AACxF,QAAM,SAAS,oBAAI,IAAoC;AACvD,QAAM,OAAO,aAAa,gBAAqD,oBAAoB,MAAM;AACzG,OAAK,QAAQ,SAAO;AAClB,QAAI,eAAe,KAAK;AACtB,UAAI,QAAQ,CAAC,GAAG,MAAM,OAAO,IAAI,GAAG,CAAC,CAAC;AAAA,IACxC;AAAA,EACF,CAAC;AACD,SAAO;AACT;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/esm/index.js
CHANGED
|
@@ -3,15 +3,15 @@ import { registerAllElements } from "./elements/register.js";
|
|
|
3
3
|
export * from "./decorators/index.js";
|
|
4
4
|
export * from "./types.js";
|
|
5
5
|
export * from "./utils/Utils.js";
|
|
6
|
-
export * from "./utils/TemplateUtils.js";
|
|
7
6
|
export * from "./config/config.js";
|
|
8
7
|
var src_default = (w, other) => {
|
|
9
8
|
registerAllElements(w);
|
|
10
9
|
const r = other?.map((fn) => {
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
if (typeof fn === "function") {
|
|
11
|
+
const a = fn(w);
|
|
12
|
+
} else {
|
|
13
|
+
}
|
|
13
14
|
});
|
|
14
|
-
return r ?? [];
|
|
15
15
|
};
|
|
16
16
|
export {
|
|
17
17
|
src_default as default
|
package/dist/esm/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/index.ts"],
|
|
4
|
-
"sourcesContent": ["import 'reflect-metadata';\nimport { registerAllElements } from './elements/register';\nimport {ConstructorType} from \"@dooboostore/core\";\n\n// Decorators\nexport * from './decorators';\n\n// Types\nexport * from './types';\n\n// Utilities\nexport * from './utils/Utils';\
|
|
5
|
-
"mappings": "AAAA,OAAO;AACP,SAAS,2BAA2B;AAIpC,cAAc;AAGd,cAAc;AAGd,cAAc;
|
|
4
|
+
"sourcesContent": ["import 'reflect-metadata';\nimport { registerAllElements } from './elements/register';\nimport {ConstructorType} from \"@dooboostore/core\";\n\n// Decorators\nexport * from './decorators';\n\n// Types\nexport * from './types';\n\n// Utilities\nexport * from './utils/Utils';\n\n// Config\nexport * from './config/config';\n\n// Registration Factory\nexport default (w: Window, other?: (((w: Window) => ConstructorType<any>) | any) []) => {\n registerAllElements(w);\n const r = other?.map(fn => {\n if (typeof fn === 'function') {\n const a = fn(w);\n } else {\n }\n });\n // return r??[];\n};\n"],
|
|
5
|
+
"mappings": "AAAA,OAAO;AACP,SAAS,2BAA2B;AAIpC,cAAc;AAGd,cAAc;AAGd,cAAc;AAGd,cAAc;AAGd,IAAO,cAAQ,CAAC,GAAW,UAA6D;AACtF,sBAAoB,CAAC;AACrB,QAAM,IAAI,OAAO,IAAI,QAAM;AACzB,QAAI,OAAO,OAAO,YAAY;AAC5B,YAAM,IAAI,GAAG,CAAC;AAAA,IAChB,OAAO;AAAA,IACP;AAAA,EACF,CAAC;AAEH;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/esm/utils/Utils.js
CHANGED
|
@@ -1,5 +1,130 @@
|
|
|
1
1
|
import { getElementConfig } from "../decorators/index.js";
|
|
2
2
|
const SWC_NOT_FOUND = Symbol("SWC_NOT_FOUND");
|
|
3
|
+
const htmlFragment = (html, doc) => {
|
|
4
|
+
const d = doc || (typeof document !== "undefined" ? document : void 0);
|
|
5
|
+
if (!d) throw new Error("Document is not available");
|
|
6
|
+
const template = d.createElement("template");
|
|
7
|
+
template.innerHTML = html.trim();
|
|
8
|
+
return template.content;
|
|
9
|
+
};
|
|
10
|
+
const textNode = (text, doc) => {
|
|
11
|
+
const d = doc || (typeof document !== "undefined" ? document : void 0);
|
|
12
|
+
if (!d) throw new Error("Document is not available");
|
|
13
|
+
return d.createTextNode(text !== void 0 && text !== null ? String(text) : "");
|
|
14
|
+
};
|
|
15
|
+
const commentNode = (comment, doc) => {
|
|
16
|
+
const d = doc || (typeof document !== "undefined" ? document : void 0);
|
|
17
|
+
if (!d) throw new Error("Document is not available");
|
|
18
|
+
return d.createComment(comment !== void 0 && comment !== null ? String(comment) : "");
|
|
19
|
+
};
|
|
20
|
+
const createElement = (tagName, options) => {
|
|
21
|
+
const d = options?.doc || (typeof document !== "undefined" ? document : void 0);
|
|
22
|
+
if (!d) throw new Error("Document is not available");
|
|
23
|
+
const el = d.createElement(tagName);
|
|
24
|
+
if (options?.html) el.innerHTML = options.html;
|
|
25
|
+
if (options?.attrs) {
|
|
26
|
+
Object.entries(options.attrs).forEach(([k, v]) => el.setAttribute(k, String(v)));
|
|
27
|
+
}
|
|
28
|
+
return el;
|
|
29
|
+
};
|
|
30
|
+
const htmlDivElement = (html, options) => {
|
|
31
|
+
const d = options?.doc || (typeof document !== "undefined" ? document : void 0);
|
|
32
|
+
if (!d) throw new Error("Document is not available");
|
|
33
|
+
const el = d.createElement("div");
|
|
34
|
+
el.innerHTML = html.trim();
|
|
35
|
+
if (options?.attrs) {
|
|
36
|
+
Object.entries(options.attrs).forEach(([k, v]) => el.setAttribute(k, String(v)));
|
|
37
|
+
}
|
|
38
|
+
return el;
|
|
39
|
+
};
|
|
40
|
+
const htmlSpanElement = (html, options) => {
|
|
41
|
+
const d = options?.doc || (typeof document !== "undefined" ? document : void 0);
|
|
42
|
+
if (!d) throw new Error("Document is not available");
|
|
43
|
+
const el = d.createElement("span");
|
|
44
|
+
el.innerHTML = html.trim();
|
|
45
|
+
if (options?.attrs) {
|
|
46
|
+
Object.entries(options.attrs).forEach(([k, v]) => el.setAttribute(k, String(v)));
|
|
47
|
+
}
|
|
48
|
+
return el;
|
|
49
|
+
};
|
|
50
|
+
const htmlButtonElement = (html, options) => {
|
|
51
|
+
const d = options?.doc || (typeof document !== "undefined" ? document : void 0);
|
|
52
|
+
if (!d) throw new Error("Document is not available");
|
|
53
|
+
const el = d.createElement("button");
|
|
54
|
+
el.innerHTML = html.trim();
|
|
55
|
+
if (options?.attrs) {
|
|
56
|
+
Object.entries(options.attrs).forEach(([k, v]) => el.setAttribute(k, String(v)));
|
|
57
|
+
}
|
|
58
|
+
return el;
|
|
59
|
+
};
|
|
60
|
+
const htmlUlElement = (options) => {
|
|
61
|
+
const d = options?.doc || (typeof document !== "undefined" ? document : void 0);
|
|
62
|
+
if (!d) throw new Error("Document is not available");
|
|
63
|
+
const el = d.createElement("ul");
|
|
64
|
+
if (options?.attrs) {
|
|
65
|
+
Object.entries(options.attrs).forEach(([k, v]) => el.setAttribute(k, String(v)));
|
|
66
|
+
}
|
|
67
|
+
return el;
|
|
68
|
+
};
|
|
69
|
+
const htmlLiElement = (html, options) => {
|
|
70
|
+
const d = options?.doc || (typeof document !== "undefined" ? document : void 0);
|
|
71
|
+
if (!d) throw new Error("Document is not available");
|
|
72
|
+
const el = d.createElement("li");
|
|
73
|
+
el.innerHTML = html.trim();
|
|
74
|
+
if (options?.attrs) {
|
|
75
|
+
Object.entries(options.attrs).forEach(([k, v]) => el.setAttribute(k, String(v)));
|
|
76
|
+
}
|
|
77
|
+
return el;
|
|
78
|
+
};
|
|
79
|
+
const htmlAElement = (html, options) => {
|
|
80
|
+
const d = options?.doc || (typeof document !== "undefined" ? document : void 0);
|
|
81
|
+
if (!d) throw new Error("Document is not available");
|
|
82
|
+
const el = d.createElement("a");
|
|
83
|
+
el.innerHTML = html.trim();
|
|
84
|
+
if (options?.href) el.href = options.href;
|
|
85
|
+
if (options?.attrs) {
|
|
86
|
+
Object.entries(options.attrs).forEach(([k, v]) => el.setAttribute(k, String(v)));
|
|
87
|
+
}
|
|
88
|
+
return el;
|
|
89
|
+
};
|
|
90
|
+
const htmlPElement = (html, options) => {
|
|
91
|
+
const d = options?.doc || (typeof document !== "undefined" ? document : void 0);
|
|
92
|
+
if (!d) throw new Error("Document is not available");
|
|
93
|
+
const el = d.createElement("p");
|
|
94
|
+
el.innerHTML = html.trim();
|
|
95
|
+
if (options?.attrs) {
|
|
96
|
+
Object.entries(options.attrs).forEach(([k, v]) => el.setAttribute(k, String(v)));
|
|
97
|
+
}
|
|
98
|
+
return el;
|
|
99
|
+
};
|
|
100
|
+
const htmlHeadingElement = (level, html, options) => {
|
|
101
|
+
const d = options?.doc || (typeof document !== "undefined" ? document : void 0);
|
|
102
|
+
if (!d) throw new Error("Document is not available");
|
|
103
|
+
const el = d.createElement(`h${level}`);
|
|
104
|
+
el.innerHTML = html.trim();
|
|
105
|
+
if (options?.attrs) {
|
|
106
|
+
Object.entries(options.attrs).forEach(([k, v]) => el.setAttribute(k, String(v)));
|
|
107
|
+
}
|
|
108
|
+
return el;
|
|
109
|
+
};
|
|
110
|
+
const htmlSectionElement = (options) => {
|
|
111
|
+
const d = options?.doc || (typeof document !== "undefined" ? document : void 0);
|
|
112
|
+
if (!d) throw new Error("Document is not available");
|
|
113
|
+
const el = d.createElement("section");
|
|
114
|
+
if (options?.attrs) {
|
|
115
|
+
Object.entries(options.attrs).forEach(([k, v]) => el.setAttribute(k, String(v)));
|
|
116
|
+
}
|
|
117
|
+
return el;
|
|
118
|
+
};
|
|
119
|
+
const htmlArticleElement = (options) => {
|
|
120
|
+
const d = options?.doc || (typeof document !== "undefined" ? document : void 0);
|
|
121
|
+
if (!d) throw new Error("Document is not available");
|
|
122
|
+
const el = d.createElement("article");
|
|
123
|
+
if (options?.attrs) {
|
|
124
|
+
Object.entries(options.attrs).forEach(([k, v]) => el.setAttribute(k, String(v)));
|
|
125
|
+
}
|
|
126
|
+
return el;
|
|
127
|
+
};
|
|
3
128
|
var SwcUtils;
|
|
4
129
|
((SwcUtils2) => {
|
|
5
130
|
SwcUtils2.getHelperSet = (win) => {
|
|
@@ -111,6 +236,20 @@ var SwcUtils;
|
|
|
111
236
|
})(SwcUtils || (SwcUtils = {}));
|
|
112
237
|
export {
|
|
113
238
|
SWC_NOT_FOUND,
|
|
114
|
-
SwcUtils
|
|
239
|
+
SwcUtils,
|
|
240
|
+
commentNode,
|
|
241
|
+
createElement,
|
|
242
|
+
htmlAElement,
|
|
243
|
+
htmlArticleElement,
|
|
244
|
+
htmlButtonElement,
|
|
245
|
+
htmlDivElement,
|
|
246
|
+
htmlFragment,
|
|
247
|
+
htmlHeadingElement,
|
|
248
|
+
htmlLiElement,
|
|
249
|
+
htmlPElement,
|
|
250
|
+
htmlSectionElement,
|
|
251
|
+
htmlSpanElement,
|
|
252
|
+
htmlUlElement,
|
|
253
|
+
textNode
|
|
115
254
|
};
|
|
116
255
|
//# sourceMappingURL=Utils.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/utils/Utils.ts"],
|
|
4
|
-
"sourcesContent": ["import { SwcAppInterface, HostSet, HelperSet, HelperHostSet } from '../types';\nimport {getElementConfig} from \"../decorators\";\n\nexport const SWC_NOT_FOUND = Symbol('SWC_NOT_FOUND');\n\nexport namespace SwcUtils {\n export const getHelperSet = (win: Window): HelperSet => {\n const doc: Document = win.document;\n return {\n $d: doc,\n $w: win,\n $q: (sel: string, root?: Element | Document | ShadowRoot) => (root ?? doc).querySelector(sel),\n $qa: (sel: string, root?: Element | Document | ShadowRoot) => Array.from((root ?? doc).querySelectorAll(sel)) as HTMLElement[],\n $qi: (id: string, root?: Document | ShadowRoot) => (root ?? doc).getElementById(id) as HTMLElement\n } as const;\n };\n\n export const getHelperAndHostSet = (win: Window, el: HTMLElement): HelperHostSet => {\n const helperSet = getHelperSet(win);\n const hostSet = getHostSet(el);\n return {\n ...helperSet,\n ...hostSet\n };\n };\n\n export const getValueByPath = (obj: any, path: string, rootName: string) => {\n if (!obj || !path) return SWC_NOT_FOUND;\n\n const parts = path.split('.');\n let current = obj;\n\n for (const part of parts) {\n if (current === null || current === undefined) return SWC_NOT_FOUND;\n current = current[part];\n }\n return current;\n };\n\n /**\n * Finds the nearest logical SWC host for an element.\n * Checks __swc_host property first, then climbs the DOM tree.\n */\n export const findNearestSwcHost = (el: HTMLElement | Node): HTMLElement | undefined => {\n if ((el as any).__swc_host) return (el as any).__swc_host;\n\n let current: any = el.parentElement || (el.getRootNode?.() as any)?.host;\n const doc = el.ownerDocument;\n const win = doc?.defaultView || ((typeof window !== 'undefined' ? window : undefined) as any);\n while (current && current !== doc && current !== win) {\n if (current.__swc_host) return current.__swc_host;\n if (getElementConfig(current)) return current as HTMLElement;\n current = current.parentElement || (current.getRootNode?.() as any)?.host;\n }\n return undefined;\n };\n\n /**\n * Returns all SWC ancestors (excluding self) in [root, ..., parent] order.\n */\n export const findAllSwcHosts = (el: HTMLElement | Node): HTMLElement[] => {\n const hosts: HTMLElement[] = [];\n let current = findNearestSwcHost(el);\n while (current) {\n hosts.push(current);\n // To find the next ancestor, we must start searching from the PARENT of the found host\n current = findNearestSwcHost(current);\n }\n return hosts.reverse();\n };\n\n export const getHosts = (el: HTMLElement): HTMLElement[] => {\n const ancestors = findAllSwcHosts(el);\n if (getElementConfig(el)) return [...ancestors, el];\n return ancestors;\n };\n\n export const getHost = (el: HTMLElement): HTMLElement | undefined => {\n if (getElementConfig(el)) return el;\n return findNearestSwcHost(el);\n };\n\n export const getAppHosts = (el: HTMLElement): SwcAppInterface[] => {\n const hosts = getHosts(el);\n return hosts.filter(host => host.tagName.toLowerCase() === 'swc-app' || host.getAttribute('is')?.startsWith('swc-app-')) as SwcAppInterface[];\n };\n\n export const getAppHost = (el: HTMLElement): SwcAppInterface | undefined => {\n const appHosts = getAppHosts(el);\n const appHostsWithoutSelf = appHosts.filter(h => h !== el);\n return appHostsWithoutSelf.length > 0 ? appHostsWithoutSelf[appHostsWithoutSelf.length - 1] : undefined;\n };\n\n export const getHostSet = (el: HTMLElement): HostSet => {\n const isSwc = !!getElementConfig(el);\n const ancestors = findAllSwcHosts(el); // [root, ..., parent]\n\n let $host: HTMLElement;\n let $parentHost: HTMLElement | null;\n\n if (isSwc) {\n $host = el;\n $parentHost = ancestors.length > 0 ? ancestors[ancestors.length - 1] : null;\n } else {\n $host = ancestors.length > 0 ? ancestors[ancestors.length - 1] : el;\n $parentHost = ancestors.length > 1 ? ancestors[ancestors.length - 2] : null;\n }\n\n const $hosts = isSwc ? [...ancestors, el] : ancestors;\n const $firstHost = $hosts.length > 0 ? $hosts[0] : null;\n\n // Collect loop contexts\n const loopContext: Record<string, any> = {};\n let curr: any = el;\n const rootEl = el.ownerDocument?.documentElement;\n while (curr && curr !== rootEl) {\n if (curr.__swc_loop_context) {\n Object.assign(loopContext, curr.__swc_loop_context);\n }\n curr = curr.parentElement || (curr.getRootNode() as any).host;\n }\n\n const $appHosts = $hosts.filter(h => h.tagName.toLowerCase() === 'swc-app' || h.getAttribute('is')?.startsWith('swc-app-')) as SwcAppInterface[];\n const $appHost = $appHosts.length > 0 ? ($appHosts[$appHosts.length - 1] === el ? ($appHosts.length > 1 ? $appHosts[$appHosts.length - 2] : null) : $appHosts[$appHosts.length - 1]) : null;\n const $firstAppHost = $appHosts.length > 0 ? $appHosts[0] : null;\n\n return {\n $host,\n $parentHost,\n $hosts,\n $firstHost,\n $lastHost: $parentHost,\n $appHost,\n $appHosts,\n $firstAppHost,\n $lastAppHost: $appHost,\n ...loopContext\n } as any;\n };\n}\n"],
|
|
5
|
-
"mappings": "AACA,SAAQ,wBAAuB;AAExB,MAAM,gBAAgB,OAAO,eAAe;
|
|
4
|
+
"sourcesContent": ["import { SwcAppInterface, HostSet, HelperSet, HelperHostSet } from '../types';\nimport {getElementConfig} from \"../decorators\";\n\nexport const SWC_NOT_FOUND = Symbol('SWC_NOT_FOUND');\n\n// DOM Creation Utilities\nexport const htmlFragment = (html: string, doc?: Document): DocumentFragment => {\n const d = doc || (typeof document !== 'undefined' ? document : undefined);\n if (!d) throw new Error('Document is not available');\n const template = d.createElement('template');\n template.innerHTML = html.trim();\n return template.content;\n};\n\nexport const textNode = (text: string | any, doc?: Document): Text => {\n const d = doc || (typeof document !== 'undefined' ? document : undefined);\n if (!d) throw new Error('Document is not available');\n return d.createTextNode(text !== undefined && text !== null ? String(text) : '');\n};\n\nexport const commentNode = (comment: string | any, doc?: Document): Comment => {\n const d = doc || (typeof document !== 'undefined' ? document : undefined);\n if (!d) throw new Error('Document is not available');\n return d.createComment(comment !== undefined && comment !== null ? String(comment) : '');\n};\n\nexport const createElement = <T extends HTMLElement>(\n tagName: string,\n options?: { html?: string; attrs?: Record<string, any>; doc?: Document }\n): T => {\n const d = options?.doc || (typeof document !== 'undefined' ? document : undefined);\n if (!d) throw new Error('Document is not available');\n const el = d.createElement(tagName) as T;\n if (options?.html) el.innerHTML = options.html;\n if (options?.attrs) {\n Object.entries(options.attrs).forEach(([k, v]) => el.setAttribute(k, String(v)));\n }\n return el;\n};\n\n// Element factory functions\nexport const htmlDivElement = (html: string, options?: { doc?: Document; attrs?: Record<string, any> }): HTMLDivElement => {\n const d = options?.doc || (typeof document !== 'undefined' ? document : undefined);\n if (!d) throw new Error('Document is not available');\n const el = d.createElement('div') as HTMLDivElement;\n el.innerHTML = html.trim();\n if (options?.attrs) {\n Object.entries(options.attrs).forEach(([k, v]) => el.setAttribute(k, String(v)));\n }\n return el;\n};\n\nexport const htmlSpanElement = (html: string, options?: { doc?: Document; attrs?: Record<string, any> }): HTMLSpanElement => {\n const d = options?.doc || (typeof document !== 'undefined' ? document : undefined);\n if (!d) throw new Error('Document is not available');\n const el = d.createElement('span') as HTMLSpanElement;\n el.innerHTML = html.trim();\n if (options?.attrs) {\n Object.entries(options.attrs).forEach(([k, v]) => el.setAttribute(k, String(v)));\n }\n return el;\n};\n\nexport const htmlButtonElement = (html: string, options?: { doc?: Document; attrs?: Record<string, any> }): HTMLButtonElement => {\n const d = options?.doc || (typeof document !== 'undefined' ? document : undefined);\n if (!d) throw new Error('Document is not available');\n const el = d.createElement('button') as HTMLButtonElement;\n el.innerHTML = html.trim();\n if (options?.attrs) {\n Object.entries(options.attrs).forEach(([k, v]) => el.setAttribute(k, String(v)));\n }\n return el;\n};\n\nexport const htmlUlElement = (options?: { doc?: Document; attrs?: Record<string, any> }): HTMLUListElement => {\n const d = options?.doc || (typeof document !== 'undefined' ? document : undefined);\n if (!d) throw new Error('Document is not available');\n const el = d.createElement('ul') as HTMLUListElement;\n if (options?.attrs) {\n Object.entries(options.attrs).forEach(([k, v]) => el.setAttribute(k, String(v)));\n }\n return el;\n};\n\nexport const htmlLiElement = (html: string, options?: { doc?: Document; attrs?: Record<string, any> }): HTMLLIElement => {\n const d = options?.doc || (typeof document !== 'undefined' ? document : undefined);\n if (!d) throw new Error('Document is not available');\n const el = d.createElement('li') as HTMLLIElement;\n el.innerHTML = html.trim();\n if (options?.attrs) {\n Object.entries(options.attrs).forEach(([k, v]) => el.setAttribute(k, String(v)));\n }\n return el;\n};\n\nexport const htmlAElement = (html: string, options?: { href?: string; doc?: Document; attrs?: Record<string, any> }): HTMLAnchorElement => {\n const d = options?.doc || (typeof document !== 'undefined' ? document : undefined);\n if (!d) throw new Error('Document is not available');\n const el = d.createElement('a') as HTMLAnchorElement;\n el.innerHTML = html.trim();\n if (options?.href) el.href = options.href;\n if (options?.attrs) {\n Object.entries(options.attrs).forEach(([k, v]) => el.setAttribute(k, String(v)));\n }\n return el;\n};\n\nexport const htmlPElement = (html: string, options?: { doc?: Document; attrs?: Record<string, any> }): HTMLParagraphElement => {\n const d = options?.doc || (typeof document !== 'undefined' ? document : undefined);\n if (!d) throw new Error('Document is not available');\n const el = d.createElement('p') as HTMLParagraphElement;\n el.innerHTML = html.trim();\n if (options?.attrs) {\n Object.entries(options.attrs).forEach(([k, v]) => el.setAttribute(k, String(v)));\n }\n return el;\n};\n\nexport const htmlHeadingElement = (level: 1 | 2 | 3 | 4 | 5 | 6, html: string, options?: { doc?: Document; attrs?: Record<string, any> }): HTMLHeadingElement => {\n const d = options?.doc || (typeof document !== 'undefined' ? document : undefined);\n if (!d) throw new Error('Document is not available');\n const el = d.createElement(`h${level}`) as HTMLHeadingElement;\n el.innerHTML = html.trim();\n if (options?.attrs) {\n Object.entries(options.attrs).forEach(([k, v]) => el.setAttribute(k, String(v)));\n }\n return el;\n};\n\nexport const htmlSectionElement = (options?: { doc?: Document; attrs?: Record<string, any> }): HTMLElement => {\n const d = options?.doc || (typeof document !== 'undefined' ? document : undefined);\n if (!d) throw new Error('Document is not available');\n const el = d.createElement('section');\n if (options?.attrs) {\n Object.entries(options.attrs).forEach(([k, v]) => el.setAttribute(k, String(v)));\n }\n return el;\n};\n\nexport const htmlArticleElement = (options?: { doc?: Document; attrs?: Record<string, any> }): HTMLElement => {\n const d = options?.doc || (typeof document !== 'undefined' ? document : undefined);\n if (!d) throw new Error('Document is not available');\n const el = d.createElement('article');\n if (options?.attrs) {\n Object.entries(options.attrs).forEach(([k, v]) => el.setAttribute(k, String(v)));\n }\n return el;\n};\n\nexport namespace SwcUtils {\n export const getHelperSet = (win: Window): HelperSet => {\n const doc: Document = win.document;\n return {\n $d: doc,\n $w: win,\n $q: (sel: string, root?: Element | Document | ShadowRoot) => (root ?? doc).querySelector(sel),\n $qa: (sel: string, root?: Element | Document | ShadowRoot) => Array.from((root ?? doc).querySelectorAll(sel)) as HTMLElement[],\n $qi: (id: string, root?: Document | ShadowRoot) => (root ?? doc).getElementById(id) as HTMLElement\n } as const;\n };\n\n export const getHelperAndHostSet = (win: Window, el: HTMLElement): HelperHostSet => {\n const helperSet = getHelperSet(win);\n const hostSet = getHostSet(el);\n return {\n ...helperSet,\n ...hostSet\n };\n };\n\n export const getValueByPath = (obj: any, path: string, rootName: string) => {\n if (!obj || !path) return SWC_NOT_FOUND;\n\n const parts = path.split('.');\n let current = obj;\n\n for (const part of parts) {\n if (current === null || current === undefined) return SWC_NOT_FOUND;\n current = current[part];\n }\n return current;\n };\n\n /**\n * Finds the nearest logical SWC host for an element.\n * Checks __swc_host property first, then climbs the DOM tree.\n */\n export const findNearestSwcHost = (el: HTMLElement | Node): HTMLElement | undefined => {\n if ((el as any).__swc_host) return (el as any).__swc_host;\n\n let current: any = el.parentElement || (el.getRootNode?.() as any)?.host;\n const doc = el.ownerDocument;\n const win = doc?.defaultView || ((typeof window !== 'undefined' ? window : undefined) as any);\n while (current && current !== doc && current !== win) {\n if (current.__swc_host) return current.__swc_host;\n if (getElementConfig(current)) return current as HTMLElement;\n current = current.parentElement || (current.getRootNode?.() as any)?.host;\n }\n return undefined;\n };\n\n /**\n * Returns all SWC ancestors (excluding self) in [root, ..., parent] order.\n */\n export const findAllSwcHosts = (el: HTMLElement | Node): HTMLElement[] => {\n const hosts: HTMLElement[] = [];\n let current = findNearestSwcHost(el);\n while (current) {\n hosts.push(current);\n // To find the next ancestor, we must start searching from the PARENT of the found host\n current = findNearestSwcHost(current);\n }\n return hosts.reverse();\n };\n\n export const getHosts = (el: HTMLElement): HTMLElement[] => {\n const ancestors = findAllSwcHosts(el);\n if (getElementConfig(el)) return [...ancestors, el];\n return ancestors;\n };\n\n export const getHost = (el: HTMLElement): HTMLElement | undefined => {\n if (getElementConfig(el)) return el;\n return findNearestSwcHost(el);\n };\n\n export const getAppHosts = (el: HTMLElement): SwcAppInterface[] => {\n const hosts = getHosts(el);\n return hosts.filter(host => host.tagName.toLowerCase() === 'swc-app' || host.getAttribute('is')?.startsWith('swc-app-')) as SwcAppInterface[];\n };\n\n export const getAppHost = (el: HTMLElement): SwcAppInterface | undefined => {\n const appHosts = getAppHosts(el);\n const appHostsWithoutSelf = appHosts.filter(h => h !== el);\n return appHostsWithoutSelf.length > 0 ? appHostsWithoutSelf[appHostsWithoutSelf.length - 1] : undefined;\n };\n\n export const getHostSet = (el: HTMLElement): HostSet => {\n const isSwc = !!getElementConfig(el);\n const ancestors = findAllSwcHosts(el); // [root, ..., parent]\n\n let $host: HTMLElement;\n let $parentHost: HTMLElement | null;\n\n if (isSwc) {\n $host = el;\n $parentHost = ancestors.length > 0 ? ancestors[ancestors.length - 1] : null;\n } else {\n $host = ancestors.length > 0 ? ancestors[ancestors.length - 1] : el;\n $parentHost = ancestors.length > 1 ? ancestors[ancestors.length - 2] : null;\n }\n\n const $hosts = isSwc ? [...ancestors, el] : ancestors;\n const $firstHost = $hosts.length > 0 ? $hosts[0] : null;\n\n // Collect loop contexts\n const loopContext: Record<string, any> = {};\n let curr: any = el;\n const rootEl = el.ownerDocument?.documentElement;\n while (curr && curr !== rootEl) {\n if (curr.__swc_loop_context) {\n Object.assign(loopContext, curr.__swc_loop_context);\n }\n curr = curr.parentElement || (curr.getRootNode() as any).host;\n }\n\n const $appHosts = $hosts.filter(h => h.tagName.toLowerCase() === 'swc-app' || h.getAttribute('is')?.startsWith('swc-app-')) as SwcAppInterface[];\n const $appHost = $appHosts.length > 0 ? ($appHosts[$appHosts.length - 1] === el ? ($appHosts.length > 1 ? $appHosts[$appHosts.length - 2] : null) : $appHosts[$appHosts.length - 1]) : null;\n const $firstAppHost = $appHosts.length > 0 ? $appHosts[0] : null;\n\n return {\n $host,\n $parentHost,\n $hosts,\n $firstHost,\n $lastHost: $parentHost,\n $appHost,\n $appHosts,\n $firstAppHost,\n $lastAppHost: $appHost,\n ...loopContext\n } as any;\n };\n}\n"],
|
|
5
|
+
"mappings": "AACA,SAAQ,wBAAuB;AAExB,MAAM,gBAAgB,OAAO,eAAe;AAG5C,MAAM,eAAe,CAAC,MAAc,QAAqC;AAC9E,QAAM,IAAI,QAAQ,OAAO,aAAa,cAAc,WAAW;AAC/D,MAAI,CAAC,EAAG,OAAM,IAAI,MAAM,2BAA2B;AACnD,QAAM,WAAW,EAAE,cAAc,UAAU;AAC3C,WAAS,YAAY,KAAK,KAAK;AAC/B,SAAO,SAAS;AAClB;AAEO,MAAM,WAAW,CAAC,MAAoB,QAAyB;AACpE,QAAM,IAAI,QAAQ,OAAO,aAAa,cAAc,WAAW;AAC/D,MAAI,CAAC,EAAG,OAAM,IAAI,MAAM,2BAA2B;AACnD,SAAO,EAAE,eAAe,SAAS,UAAa,SAAS,OAAO,OAAO,IAAI,IAAI,EAAE;AACjF;AAEO,MAAM,cAAc,CAAC,SAAuB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