@dooboostore/simple-web-component 1.0.43 → 1.0.44
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 +298 -49
- package/dist/cjs/SwcAppEngine.js +3 -1
- package/dist/cjs/SwcAppEngine.js.map +2 -2
- package/dist/cjs/decorators/addEventListener.js.map +2 -2
- package/dist/cjs/decorators/applyAttribute.js +30 -28
- package/dist/cjs/decorators/applyAttribute.js.map +2 -2
- package/dist/cjs/decorators/applyClass.js +57 -21
- package/dist/cjs/decorators/applyClass.js.map +3 -3
- package/dist/cjs/decorators/applyNode.js +165 -105
- package/dist/cjs/decorators/applyNode.js.map +2 -2
- package/dist/cjs/decorators/applyProperty.js +11 -28
- package/dist/cjs/decorators/applyProperty.js.map +2 -2
- package/dist/cjs/decorators/applyStyle.js +39 -15
- package/dist/cjs/decorators/applyStyle.js.map +3 -3
- package/dist/cjs/decorators/{changedAttributeThis.js → changedAttribute.js} +6 -6
- package/dist/cjs/decorators/changedAttribute.js.map +7 -0
- package/dist/cjs/decorators/elementDefine.js +37 -6
- package/dist/cjs/decorators/elementDefine.js.map +3 -3
- package/dist/cjs/decorators/emitCustomEvent.js +56 -42
- package/dist/cjs/decorators/emitCustomEvent.js.map +2 -2
- package/dist/cjs/decorators/index.js +1 -1
- package/dist/cjs/decorators/index.js.map +2 -2
- package/dist/cjs/decorators/publishSwcAppMessage.js +5 -5
- package/dist/cjs/decorators/publishSwcAppMessage.js.map +3 -3
- package/dist/cjs/decorators/query.js +96 -145
- package/dist/cjs/decorators/query.js.map +3 -3
- package/dist/cjs/decorators/queryAll.js +104 -131
- package/dist/cjs/decorators/queryAll.js.map +3 -3
- package/dist/cjs/decorators/subscribeSwcAppMessageWhileConnected.js +2 -0
- package/dist/cjs/decorators/subscribeSwcAppMessageWhileConnected.js.map +2 -2
- package/dist/cjs/decorators/subscribeSwcAppRouteChangeWhileConnected.js +2 -0
- package/dist/cjs/decorators/subscribeSwcAppRouteChangeWhileConnected.js.map +2 -2
- package/dist/cjs/elements/SwcAppMixin.js +17 -2
- package/dist/cjs/elements/SwcAppMixin.js.map +2 -2
- package/dist/cjs/examples/RxJSOperatorsExample.js +285 -0
- package/dist/cjs/examples/RxJSOperatorsExample.js.map +7 -0
- package/dist/cjs/index.js +1 -0
- package/dist/cjs/index.js.map +2 -2
- package/dist/cjs/router/ElementRouter.js +4 -0
- package/dist/cjs/router/ElementRouter.js.map +2 -2
- package/dist/esm/SwcAppEngine.js +3 -1
- package/dist/esm/SwcAppEngine.js.map +2 -2
- package/dist/esm/decorators/addEventListener.js.map +2 -2
- package/dist/esm/decorators/applyAttribute.js +30 -28
- package/dist/esm/decorators/applyAttribute.js.map +2 -2
- package/dist/esm/decorators/applyClass.js +57 -21
- package/dist/esm/decorators/applyClass.js.map +3 -3
- package/dist/esm/decorators/applyNode.js +165 -105
- package/dist/esm/decorators/applyNode.js.map +2 -2
- package/dist/esm/decorators/applyProperty.js +11 -28
- package/dist/esm/decorators/applyProperty.js.map +2 -2
- package/dist/esm/decorators/applyStyle.js +39 -15
- package/dist/esm/decorators/applyStyle.js.map +3 -3
- package/dist/esm/decorators/{changedAttributeThis.js → changedAttribute.js} +3 -3
- package/dist/esm/decorators/changedAttribute.js.map +7 -0
- package/dist/esm/decorators/elementDefine.js +35 -4
- package/dist/esm/decorators/elementDefine.js.map +2 -2
- package/dist/esm/decorators/emitCustomEvent.js +56 -42
- package/dist/esm/decorators/emitCustomEvent.js.map +2 -2
- package/dist/esm/decorators/index.js +1 -1
- package/dist/esm/decorators/index.js.map +1 -1
- package/dist/esm/decorators/publishSwcAppMessage.js +5 -5
- package/dist/esm/decorators/publishSwcAppMessage.js.map +3 -3
- package/dist/esm/decorators/query.js +96 -145
- package/dist/esm/decorators/query.js.map +3 -3
- package/dist/esm/decorators/queryAll.js +104 -131
- package/dist/esm/decorators/queryAll.js.map +3 -3
- package/dist/esm/decorators/subscribeSwcAppMessageWhileConnected.js +2 -0
- package/dist/esm/decorators/subscribeSwcAppMessageWhileConnected.js.map +2 -2
- package/dist/esm/decorators/subscribeSwcAppRouteChangeWhileConnected.js +2 -0
- package/dist/esm/decorators/subscribeSwcAppRouteChangeWhileConnected.js.map +2 -2
- package/dist/esm/elements/SwcAppMixin.js +18 -3
- package/dist/esm/elements/SwcAppMixin.js.map +2 -2
- package/dist/esm/examples/RxJSOperatorsExample.js +266 -0
- package/dist/esm/examples/RxJSOperatorsExample.js.map +7 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/index.js.map +2 -2
- package/dist/esm/router/ElementRouter.js +4 -0
- package/dist/esm/router/ElementRouter.js.map +2 -2
- package/dist/esm-bundle/dooboostore-simple-web-component.esm.js +759 -512
- package/dist/esm-bundle/dooboostore-simple-web-component.esm.js.map +4 -4
- package/dist/types/SwcAppEngine.d.ts.map +1 -1
- package/dist/types/decorators/addEventListener.d.ts +17 -14
- package/dist/types/decorators/addEventListener.d.ts.map +1 -1
- package/dist/types/decorators/applyAttribute.d.ts +35 -20
- package/dist/types/decorators/applyAttribute.d.ts.map +1 -1
- package/dist/types/decorators/applyClass.d.ts +16 -36
- package/dist/types/decorators/applyClass.d.ts.map +1 -1
- package/dist/types/decorators/applyNode.d.ts +172 -30
- package/dist/types/decorators/applyNode.d.ts.map +1 -1
- package/dist/types/decorators/applyProperty.d.ts +27 -18
- package/dist/types/decorators/applyProperty.d.ts.map +1 -1
- package/dist/types/decorators/applyStyle.d.ts +7 -7
- package/dist/types/decorators/applyStyle.d.ts.map +1 -1
- package/dist/types/decorators/{changedAttributeThis.d.ts → changedAttribute.d.ts} +2 -2
- package/dist/types/decorators/changedAttribute.d.ts.map +1 -0
- package/dist/types/decorators/elementDefine.d.ts.map +1 -1
- package/dist/types/decorators/emitCustomEvent.d.ts +3 -10
- package/dist/types/decorators/emitCustomEvent.d.ts.map +1 -1
- package/dist/types/decorators/index.d.ts +1 -1
- package/dist/types/decorators/index.d.ts.map +1 -1
- package/dist/types/decorators/publishSwcAppMessage.d.ts +1 -1
- package/dist/types/decorators/publishSwcAppMessage.d.ts.map +1 -1
- package/dist/types/decorators/query.d.ts +3 -26
- package/dist/types/decorators/query.d.ts.map +1 -1
- package/dist/types/decorators/queryAll.d.ts +3 -20
- package/dist/types/decorators/queryAll.d.ts.map +1 -1
- package/dist/types/decorators/subscribeSwcAppMessageWhileConnected.d.ts +1 -0
- package/dist/types/decorators/subscribeSwcAppMessageWhileConnected.d.ts.map +1 -1
- package/dist/types/decorators/subscribeSwcAppRouteChangeWhileConnected.d.ts +2 -0
- package/dist/types/decorators/subscribeSwcAppRouteChangeWhileConnected.d.ts.map +1 -1
- package/dist/types/elements/SwcAppMixin.d.ts +4 -4
- package/dist/types/elements/SwcAppMixin.d.ts.map +1 -1
- package/dist/types/examples/RxJSOperatorsExample.d.ts +94 -0
- package/dist/types/examples/RxJSOperatorsExample.d.ts.map +1 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/router/ElementRouter.d.ts.map +1 -1
- package/dist/umd-bundle/dooboostore-simple-web-component.umd.js +759 -512
- package/dist/umd-bundle/dooboostore-simple-web-component.umd.js.map +4 -4
- package/package.json +3 -3
- package/src/SwcAppEngine.ts +3 -1
- package/src/decorators/addEventListener.ts +28 -24
- package/src/decorators/applyAttribute.ts +109 -63
- package/src/decorators/applyClass.ts +89 -15
- package/src/decorators/applyNode.ts +357 -100
- package/src/decorators/applyProperty.ts +42 -63
- package/src/decorators/applyStyle.ts +59 -11
- package/src/decorators/{changedAttributeThis.ts → changedAttribute.ts} +1 -1
- package/src/decorators/elementDefine.ts +47 -4
- package/src/decorators/emitCustomEvent.ts +44 -36
- package/src/decorators/index.ts +1 -1
- package/src/decorators/publishSwcAppMessage.ts +1 -1
- package/src/decorators/query.ts +90 -159
- package/src/decorators/queryAll.ts +92 -134
- package/src/decorators/subscribeSwcAppMessageWhileConnected.ts +1 -0
- package/src/decorators/subscribeSwcAppRouteChangeWhileConnected.ts +3 -1
- package/src/elements/SwcAppMixin.ts +43 -24
- package/src/examples/RxJSOperatorsExample.ts +279 -0
- package/src/index.ts +2 -0
- package/src/router/ElementRouter.ts +4 -0
- package/dist/cjs/decorators/changedAttributeThis.js.map +0 -7
- package/dist/esm/decorators/changedAttributeThis.js.map +0 -7
- package/dist/types/decorators/changedAttributeThis.d.ts.map +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/decorators/queryAll.ts"],
|
|
4
|
-
"sourcesContent": ["import { ReflectUtils } from '@dooboostore/core';\nimport { getElementConfig, ensureInit } from './elementDefine';\nimport { SwcUtils } from '../utils/Utils';\nimport { SpecialSelector, SwcQueryOptions, HelperHostSet } from '../types';\n\nexport interface QueryAllMetadata {\n propertyKey: string | symbol;\n selector: string;\n options: SwcQueryOptions;\n}\n\nexport const QUERY_ALL_METADATA_KEY = Symbol.for('simple-web-component:query-all');\n\nexport function queryAll(target:
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;AAAA
|
|
6
|
-
"names": []
|
|
4
|
+
"sourcesContent": ["import { ReflectUtils } from '@dooboostore/core';\nimport { getElementConfig, ensureInit } from './elementDefine';\nimport { SwcUtils } from '../utils/Utils';\nimport { SpecialSelector, SwcQueryOptions, HelperHostSet } from '../types';\n\nexport interface QueryAllMetadata {\n propertyKey: string | symbol;\n selector: string;\n options: SwcQueryOptions;\n}\n\nexport const QUERY_ALL_METADATA_KEY = Symbol.for('simple-web-component:query-all');\n\nexport function queryAll(target: Object, propertyKey: string | symbol, descriptor?: PropertyDescriptor): PropertyDescriptor | void;\nexport function queryAll(selector: string, options?: SwcQueryOptions): PropertyDecorator;\nexport function queryAll(options?: SwcQueryOptions): PropertyDecorator;\n/**\n * @queryAll decorator to inject a list of elements into a class property.\n */\nexport function queryAll(selectorOrTarget?: string | Object, optionsOrPropertyKey?: SwcQueryOptions | string | symbol, descriptor?: PropertyDescriptor): any {\n // Bare decorator: @queryAll\n if (descriptor !== undefined && (typeof optionsOrPropertyKey === 'string' || typeof optionsOrPropertyKey === 'symbol')) {\n throw new Error(`@queryAll decorator cannot be used on methods. (Method: ${String(optionsOrPropertyKey)})`);\n }\n // With selector\n if (typeof selectorOrTarget === 'string') {\n return (targetObj: Object, propertyKey: string | symbol, descriptor?: never): void => {\n if (descriptor !== undefined) {\n throw new Error(`@queryAll decorator cannot be used on methods. (Method: ${String(propertyKey)})`);\n }\n\n const constructor = targetObj.constructor;\n let queries = ReflectUtils.getMetadata<QueryAllMetadata[]>(QUERY_ALL_METADATA_KEY, constructor);\n if (!queries) {\n queries = [];\n ReflectUtils.defineMetadata(QUERY_ALL_METADATA_KEY, queries, constructor);\n }\n queries.push({ propertyKey, selector: selectorOrTarget, options: optionsOrPropertyKey as SwcQueryOptions || {} });\n\n Object.defineProperty(targetObj, propertyKey, {\n get(this: HTMLElement) {\n ensureInit(this);\n const selector = selectorOrTarget;\n\n const r = (optionsOrPropertyKey as SwcQueryOptions)?.root || 'auto';\n const applyRoot = (t: any): any[] => {\n if (!t) return [];\n const items = Array.isArray(t) ? t : [t];\n const results: any[] = [];\n items.forEach(it => {\n if (!(it instanceof HTMLElement)) {\n results.push(it);\n return;\n }\n if (r === 'auto') results.push(it.shadowRoot || it);\n else {\n if (r === 'light' || r === 'all') results.push(it);\n if ((r === 'shadow' || r === 'all') && it.shadowRoot) results.push(it.shadowRoot);\n }\n });\n return results;\n };\n\n // --- Special Selectors: HostSet ---\n const hostSet = SwcUtils.getHostSet(this);\n if (selector === '$hosts') return applyRoot(hostSet.$hosts);\n if (selector === '$appHosts') return applyRoot(hostSet.$appHosts);\n if (selector === '$host') return applyRoot(hostSet.$host);\n if (selector === '$parentHost') return applyRoot(hostSet.$parentHost);\n if (selector === '$appHost') return applyRoot(hostSet.$appHost);\n if (selector === '$firstHost') return applyRoot(hostSet.$firstHost);\n if (selector === '$lastHost') return applyRoot(hostSet.$lastHost);\n if (selector === '$firstAppHost') return applyRoot(hostSet.$firstAppHost);\n if (selector === '$lastAppHost') return applyRoot(hostSet.$lastAppHost);\n\n // --- Special Selectors: Env ---\n const config = getElementConfig(this);\n const win = config?.window || window;\n if (selector === '$window') return [win];\n if (selector === '$document') return [win.document];\n if (selector === '$this') return applyRoot(this);\n\n // --- Standard Selectors ---\n if (r === 'shadow') return this.shadowRoot ? Array.from(this.shadowRoot.querySelectorAll(selector)) : [];\n if (r === 'light') return Array.from(this.querySelectorAll(selector));\n if (r === 'all') {\n const sNodes = this.shadowRoot ? Array.from(this.shadowRoot.querySelectorAll(selector)) : [];\n const lNodes = Array.from(this.querySelectorAll(selector));\n return [...sNodes, ...lNodes];\n }\n const root = this.shadowRoot || this;\n return Array.from(root.querySelectorAll(selector));\n },\n set(this: HTMLElement, nv: any) {\n ensureInit(this);\n if (nv === null || nv === undefined || (Array.isArray(nv) && nv.length === 0)) {\n const selector = selectorOrTarget;\n if (selector.startsWith('$') && selector !== '$this') return;\n\n const r = (optionsOrPropertyKey as SwcQueryOptions)?.root || 'auto';\n let targets: (Element | Node)[] = [];\n if (r === 'shadow') targets = this.shadowRoot ? Array.from(this.shadowRoot.querySelectorAll(selector)) : [];\n else if (r === 'light') targets = Array.from(this.querySelectorAll(selector));\n else if (r === 'all') {\n const sNodes = this.shadowRoot ? Array.from(this.shadowRoot.querySelectorAll(selector)) : [];\n const lNodes = Array.from(this.querySelectorAll(selector));\n targets = [...sNodes, ...lNodes];\n } else {\n targets = Array.from((this.shadowRoot || this).querySelectorAll(selector));\n }\n targets.forEach(t => (t as Element).remove());\n }\n },\n enumerable: true,\n configurable: true\n });\n };\n }\n // Without selector (defaults to $this)\n return queryAll('$this', selectorOrTarget as SwcQueryOptions);\n}\n\nexport const getQueryAllMetadata = (target: any): QueryAllMetadata[] | undefined => {\n const constructor = target instanceof Function ? target : target.constructor;\n return ReflectUtils.getMetadata(QUERY_ALL_METADATA_KEY, constructor);\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;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;QACnD;QACA,IAAuB,IAAO;AAC5B,+CAAW,IAAI;AACf,cAAI,OAAO,QAAQ,OAAO,UAAc,MAAM,QAAQ,EAAE,KAAK,GAAG,WAAW,GAAI;AAC7E,kBAAM,WAAW;AACjB,gBAAI,SAAS,WAAW,GAAG,KAAK,aAAa;AAAS;AAEtD,kBAAM,IAAK,sBAA0C,QAAQ;AAC7D,gBAAI,UAA8B,CAAA;AAClC,gBAAI,MAAM;AAAU,wBAAU,KAAK,aAAa,MAAM,KAAK,KAAK,WAAW,iBAAiB,QAAQ,CAAC,IAAI,CAAA;qBAChG,MAAM;AAAS,wBAAU,MAAM,KAAK,KAAK,iBAAiB,QAAQ,CAAC;qBACnE,MAAM,OAAO;AACpB,oBAAM,SAAS,KAAK,aAAa,MAAM,KAAK,KAAK,WAAW,iBAAiB,QAAQ,CAAC,IAAI,CAAA;AAC1F,oBAAM,SAAS,MAAM,KAAK,KAAK,iBAAiB,QAAQ,CAAC;AACzD,wBAAU,CAAC,GAAG,QAAQ,GAAG,MAAM;YACjC,OAAO;AACL,wBAAU,MAAM,MAAM,KAAK,cAAc,MAAM,iBAAiB,QAAQ,CAAC;YAC3E;AACA,oBAAQ,QAAQ,OAAM,EAAc,OAAM,CAAE;UAC9C;QACF;QACA,YAAY;QACZ,cAAc;OACf;IACH;EACF;AAEA,SAAO,SAAS,SAAS,gBAAmC;AAC9D;AAEO,MAAM,sBAAsB,CAAC,WAA+C;AACjF,QAAM,cAAc,kBAAkB,WAAW,SAAS,OAAO;AACjE,SAAO,yBAAa,YAAY,wBAAwB,WAAW;AACrE;",
|
|
6
|
+
"names": ["descriptor"]
|
|
7
7
|
}
|
|
@@ -19,6 +19,7 @@ var subscribeSwcAppMessageWhileConnected_exports = {};
|
|
|
19
19
|
__export(subscribeSwcAppMessageWhileConnected_exports, {
|
|
20
20
|
SUBSCRIBE_SWC_APP_MESSAGE_WHILE_CONNECTED_METADATA_KEY: () => SUBSCRIBE_SWC_APP_MESSAGE_WHILE_CONNECTED_METADATA_KEY,
|
|
21
21
|
getSubscribeSwcAppMessageWhileConnectedMetadata: () => getSubscribeSwcAppMessageWhileConnectedMetadata,
|
|
22
|
+
receiveMessage: () => receiveMessage,
|
|
22
23
|
subscribeSwcAppMessageWhileConnected: () => subscribeSwcAppMessageWhileConnected
|
|
23
24
|
});
|
|
24
25
|
module.exports = __toCommonJS(subscribeSwcAppMessageWhileConnected_exports);
|
|
@@ -55,6 +56,7 @@ function subscribeSwcAppMessageWhileConnected(targetOrMessageTypeOrOptions, opti
|
|
|
55
56
|
}
|
|
56
57
|
return createSubscribeSwcAppMessageWhileConnected(options, messageType);
|
|
57
58
|
}
|
|
59
|
+
const receiveMessage = subscribeSwcAppMessageWhileConnected;
|
|
58
60
|
const getSubscribeSwcAppMessageWhileConnectedMetadata = (target) => {
|
|
59
61
|
const constructor = target instanceof Function ? target : target.constructor;
|
|
60
62
|
return import_core.ReflectUtils.getOwnMetadata(SUBSCRIBE_SWC_APP_MESSAGE_WHILE_CONNECTED_METADATA_KEY, constructor);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/decorators/subscribeSwcAppMessageWhileConnected.ts"],
|
|
4
|
-
"sourcesContent": ["import { ReflectUtils } from '@dooboostore/core';\nimport { SwcAppMessage, SpecialSelector, SwcQueryOptions, HelperHostSet } from '../types';\n\nexport const SUBSCRIBE_SWC_APP_MESSAGE_WHILE_CONNECTED_METADATA_KEY = Symbol.for('simple-web-component:subscribe-swc-app-message-while-connected');\n\nexport interface SwcAppMessageSubscriberMetadata {\n propertyKey: string | symbol;\n messageType?: string;\n filter?: (message: SwcAppMessage, currentThis: any) => boolean;\n}\n\nexport interface SwcAppMessageOptions {\n filter?: (message: SwcAppMessage, currentThis: any) => boolean;\n}\n\nfunction createSubscribeSwcAppMessageWhileConnected(options?: SwcAppMessageOptions, messageType?: string): MethodDecorator {\n return (target: Object, propertyKey: string | symbol, descriptor?: PropertyDescriptor) => {\n const filter = options?.filter;\n\n const constructor = target.constructor;\n let list = ReflectUtils.getOwnMetadata(SUBSCRIBE_SWC_APP_MESSAGE_WHILE_CONNECTED_METADATA_KEY, constructor) as SwcAppMessageSubscriberMetadata[];\n if (!list) {\n list = [];\n ReflectUtils.defineMetadata(SUBSCRIBE_SWC_APP_MESSAGE_WHILE_CONNECTED_METADATA_KEY, list, constructor);\n }\n list.push({ propertyKey, messageType, filter });\n \n return descriptor;\n };\n}\n\n// \uC624\uBC84\uB85C\uB4DC \uC2DC\uADF8\uB2C8\uCC98 - \uC9C1\uC811 \uC0AC\uC6A9 (\uAD04\uD638 \uC5C6\uC74C)\nexport function subscribeSwcAppMessageWhileConnected(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): PropertyDescriptor | void;\n// \uC624\uBC84\uB85C\uB4DC \uC2DC\uADF8\uB2C8\uCC98 - \uD568\uC218 \uD638\uCD9C (\uAD04\uD638 \uC788\uC74C) - \uBA54\uC2DC\uC9C0 \uD0C0\uC785\uB9CC\nexport function subscribeSwcAppMessageWhileConnected(messageType: string): MethodDecorator;\n// \uC624\uBC84\uB85C\uB4DC \uC2DC\uADF8\uB2C8\uCC98 - \uD568\uC218 \uD638\uCD9C (\uAD04\uD638 \uC788\uC74C) - \uC635\uC158\uB9CC\nexport function subscribeSwcAppMessageWhileConnected(options: SwcAppMessageOptions): MethodDecorator;\n// \uC624\uBC84\uB85C\uB4DC \uC2DC\uADF8\uB2C8\uCC98 - \uD568\uC218 \uD638\uCD9C (\uAD04\uD638 \uC788\uC74C) - \uBA54\uC2DC\uC9C0 \uD0C0\uC785 + \uC635\uC158\nexport function subscribeSwcAppMessageWhileConnected(messageType: string, options: SwcAppMessageOptions): MethodDecorator;\n\nexport function subscribeSwcAppMessageWhileConnected(targetOrMessageTypeOrOptions?: any, optionsOrPropertyKey?: any, descriptor?: PropertyDescriptor): any {\n // \uC9C1\uC811 \uB370\uCF54\uB808\uC774\uD130\uB85C \uC0AC\uC6A9\uB41C \uACBD\uC6B0 (\uAD04\uD638 \uC5C6\uC74C): @subscribeSwcAppMessageWhileConnected\n if (targetOrMessageTypeOrOptions && typeof targetOrMessageTypeOrOptions === 'object' && \n optionsOrPropertyKey && (typeof optionsOrPropertyKey === 'string' || typeof optionsOrPropertyKey === 'symbol') &&\n descriptor) {\n const target = targetOrMessageTypeOrOptions;\n const propertyKey = optionsOrPropertyKey;\n return createSubscribeSwcAppMessageWhileConnected({})(target, propertyKey, descriptor);\n }\n\n // \uD568\uC218\uB85C \uD638\uCD9C\uB41C \uACBD\uC6B0 (\uAD04\uD638 \uC788\uC74C)\n let messageType: string | undefined;\n let options: SwcAppMessageOptions = {};\n\n if (typeof targetOrMessageTypeOrOptions === 'string') {\n // \uBA54\uC2DC\uC9C0 \uD0C0\uC785 \uC804\uB2EC: @subscribeSwcAppMessageWhileConnected('messageType') \uB610\uB294 @subscribeSwcAppMessageWhileConnected('messageType', options)\n messageType = targetOrMessageTypeOrOptions;\n if (optionsOrPropertyKey && typeof optionsOrPropertyKey === 'object') {\n options = optionsOrPropertyKey;\n }\n } else if (targetOrMessageTypeOrOptions && typeof targetOrMessageTypeOrOptions === 'object') {\n // \uC635\uC158\uB9CC \uC804\uB2EC: @subscribeSwcAppMessageWhileConnected({ filter: ... })\n options = targetOrMessageTypeOrOptions;\n }\n\n return createSubscribeSwcAppMessageWhileConnected(options, messageType);\n}\n\n// Helper function to retrieve message subscribers metadata\nexport const getSubscribeSwcAppMessageWhileConnectedMetadata = (target: any): SwcAppMessageSubscriberMetadata[] | undefined => {\n const constructor = target instanceof Function ? target : target.constructor;\n return ReflectUtils.getOwnMetadata(SUBSCRIBE_SWC_APP_MESSAGE_WHILE_CONNECTED_METADATA_KEY, constructor);\n};\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAA6B;AAGtB,MAAM,yDAAyD,OAAO,IAAI,gEAAgE;AAYjJ,SAAS,2CAA2C,SAAgC,aAAuC;AACzH,SAAO,CAAC,QAAgB,aAA8B,eAAoC;AACxF,UAAM,SAAS,SAAS;AAExB,UAAM,cAAc,OAAO;AAC3B,QAAI,OAAO,yBAAa,eAAe,wDAAwD,WAAW;AAC1G,QAAI,CAAC,MAAM;AACT,aAAO,CAAC;AACR,+BAAa,eAAe,wDAAwD,MAAM,WAAW;AAAA,IACvG;AACA,SAAK,KAAK,EAAE,aAAa,aAAa,OAAO,CAAC;AAE9C,WAAO;AAAA,EACT;AACF;AAWO,SAAS,qCAAqC,8BAAoC,sBAA4B,YAAsC;AAEzJ,MAAI,gCAAgC,OAAO,iCAAiC,YACxE,yBAAyB,OAAO,yBAAyB,YAAY,OAAO,yBAAyB,aACrG,YAAY;AACd,UAAM,SAAS;AACf,UAAM,cAAc;AACpB,WAAO,2CAA2C,CAAC,CAAC,EAAE,QAAQ,aAAa,UAAU;AAAA,EACvF;AAGA,MAAI;AACJ,MAAI,UAAgC,CAAC;AAErC,MAAI,OAAO,iCAAiC,UAAU;AAEpD,kBAAc;AACd,QAAI,wBAAwB,OAAO,yBAAyB,UAAU;AACpE,gBAAU;AAAA,IACZ;AAAA,EACF,WAAW,gCAAgC,OAAO,iCAAiC,UAAU;AAE3F,cAAU;AAAA,EACZ;AAEA,SAAO,2CAA2C,SAAS,WAAW;AACxE;
|
|
4
|
+
"sourcesContent": ["import { ReflectUtils } from '@dooboostore/core';\nimport { SwcAppMessage, SpecialSelector, SwcQueryOptions, HelperHostSet } from '../types';\n\nexport const SUBSCRIBE_SWC_APP_MESSAGE_WHILE_CONNECTED_METADATA_KEY = Symbol.for('simple-web-component:subscribe-swc-app-message-while-connected');\n\nexport interface SwcAppMessageSubscriberMetadata {\n propertyKey: string | symbol;\n messageType?: string;\n filter?: (message: SwcAppMessage, currentThis: any) => boolean;\n}\n\nexport interface SwcAppMessageOptions {\n filter?: (message: SwcAppMessage, currentThis: any) => boolean;\n}\n\nfunction createSubscribeSwcAppMessageWhileConnected(options?: SwcAppMessageOptions, messageType?: string): MethodDecorator {\n return (target: Object, propertyKey: string | symbol, descriptor?: PropertyDescriptor) => {\n const filter = options?.filter;\n\n const constructor = target.constructor;\n let list = ReflectUtils.getOwnMetadata(SUBSCRIBE_SWC_APP_MESSAGE_WHILE_CONNECTED_METADATA_KEY, constructor) as SwcAppMessageSubscriberMetadata[];\n if (!list) {\n list = [];\n ReflectUtils.defineMetadata(SUBSCRIBE_SWC_APP_MESSAGE_WHILE_CONNECTED_METADATA_KEY, list, constructor);\n }\n list.push({ propertyKey, messageType, filter });\n \n return descriptor;\n };\n}\n\n// \uC624\uBC84\uB85C\uB4DC \uC2DC\uADF8\uB2C8\uCC98 - \uC9C1\uC811 \uC0AC\uC6A9 (\uAD04\uD638 \uC5C6\uC74C)\nexport function subscribeSwcAppMessageWhileConnected(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): PropertyDescriptor | void;\n// \uC624\uBC84\uB85C\uB4DC \uC2DC\uADF8\uB2C8\uCC98 - \uD568\uC218 \uD638\uCD9C (\uAD04\uD638 \uC788\uC74C) - \uBA54\uC2DC\uC9C0 \uD0C0\uC785\uB9CC\nexport function subscribeSwcAppMessageWhileConnected(messageType: string): MethodDecorator;\n// \uC624\uBC84\uB85C\uB4DC \uC2DC\uADF8\uB2C8\uCC98 - \uD568\uC218 \uD638\uCD9C (\uAD04\uD638 \uC788\uC74C) - \uC635\uC158\uB9CC\nexport function subscribeSwcAppMessageWhileConnected(options: SwcAppMessageOptions): MethodDecorator;\n// \uC624\uBC84\uB85C\uB4DC \uC2DC\uADF8\uB2C8\uCC98 - \uD568\uC218 \uD638\uCD9C (\uAD04\uD638 \uC788\uC74C) - \uBA54\uC2DC\uC9C0 \uD0C0\uC785 + \uC635\uC158\nexport function subscribeSwcAppMessageWhileConnected(messageType: string, options: SwcAppMessageOptions): MethodDecorator;\n\nexport function subscribeSwcAppMessageWhileConnected(targetOrMessageTypeOrOptions?: any, optionsOrPropertyKey?: any, descriptor?: PropertyDescriptor): any {\n // \uC9C1\uC811 \uB370\uCF54\uB808\uC774\uD130\uB85C \uC0AC\uC6A9\uB41C \uACBD\uC6B0 (\uAD04\uD638 \uC5C6\uC74C): @subscribeSwcAppMessageWhileConnected\n if (targetOrMessageTypeOrOptions && typeof targetOrMessageTypeOrOptions === 'object' && \n optionsOrPropertyKey && (typeof optionsOrPropertyKey === 'string' || typeof optionsOrPropertyKey === 'symbol') &&\n descriptor) {\n const target = targetOrMessageTypeOrOptions;\n const propertyKey = optionsOrPropertyKey;\n return createSubscribeSwcAppMessageWhileConnected({})(target, propertyKey, descriptor);\n }\n\n // \uD568\uC218\uB85C \uD638\uCD9C\uB41C \uACBD\uC6B0 (\uAD04\uD638 \uC788\uC74C)\n let messageType: string | undefined;\n let options: SwcAppMessageOptions = {};\n\n if (typeof targetOrMessageTypeOrOptions === 'string') {\n // \uBA54\uC2DC\uC9C0 \uD0C0\uC785 \uC804\uB2EC: @subscribeSwcAppMessageWhileConnected('messageType') \uB610\uB294 @subscribeSwcAppMessageWhileConnected('messageType', options)\n messageType = targetOrMessageTypeOrOptions;\n if (optionsOrPropertyKey && typeof optionsOrPropertyKey === 'object') {\n options = optionsOrPropertyKey;\n }\n } else if (targetOrMessageTypeOrOptions && typeof targetOrMessageTypeOrOptions === 'object') {\n // \uC635\uC158\uB9CC \uC804\uB2EC: @subscribeSwcAppMessageWhileConnected({ filter: ... })\n options = targetOrMessageTypeOrOptions;\n }\n\n return createSubscribeSwcAppMessageWhileConnected(options, messageType);\n}\n\nexport const receiveMessage = subscribeSwcAppMessageWhileConnected;\n// Helper function to retrieve message subscribers metadata\nexport const getSubscribeSwcAppMessageWhileConnectedMetadata = (target: any): SwcAppMessageSubscriberMetadata[] | undefined => {\n const constructor = target instanceof Function ? target : target.constructor;\n return ReflectUtils.getOwnMetadata(SUBSCRIBE_SWC_APP_MESSAGE_WHILE_CONNECTED_METADATA_KEY, constructor);\n};\n"],
|
|
5
|
+
"mapp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|
18
18
|
var subscribeSwcAppRouteChangeWhileConnected_exports = {};
|
|
19
19
|
__export(subscribeSwcAppRouteChangeWhileConnected_exports, {
|
|
20
20
|
SUBSCRIBE_SWC_APP_ROUTE_CHANGE_WHILE_CONNECTED_METADATA_KEY: () => SUBSCRIBE_SWC_APP_ROUTE_CHANGE_WHILE_CONNECTED_METADATA_KEY,
|
|
21
|
+
changedRoute: () => changedRoute,
|
|
21
22
|
getSubscribeSwcAppRouteChangeWhileConnectedMetadata: () => getSubscribeSwcAppRouteChangeWhileConnectedMetadata,
|
|
22
23
|
subscribeSwcAppRouteChangeWhileConnected: () => subscribeSwcAppRouteChangeWhileConnected
|
|
23
24
|
});
|
|
@@ -58,6 +59,7 @@ function subscribeSwcAppRouteChangeWhileConnected(targetOrOptions, propertyKeyOr
|
|
|
58
59
|
}
|
|
59
60
|
return createSubscribeSwcAppRouteChangeWhileConnected(options);
|
|
60
61
|
}
|
|
62
|
+
const changedRoute = subscribeSwcAppRouteChangeWhileConnected;
|
|
61
63
|
const getSubscribeSwcAppRouteChangeWhileConnectedMetadata = (target) => {
|
|
62
64
|
const constructor = target instanceof Function ? target : target.constructor;
|
|
63
65
|
const results = import_core.ReflectUtils.getOwnMetadata(SUBSCRIBE_SWC_APP_ROUTE_CHANGE_WHILE_CONNECTED_METADATA_KEY, constructor);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/decorators/subscribeSwcAppRouteChangeWhileConnected.ts"],
|
|
4
|
-
"sourcesContent": ["import {ReflectUtils} from '@dooboostore/core';\nimport {Router} from '@dooboostore/core-web';\nimport {HelperHostSet} from '../types';\n\nexport const SUBSCRIBE_SWC_APP_ROUTE_CHANGE_WHILE_CONNECTED_METADATA_KEY = Symbol.for('simple-web-component:subscribe-swc-app-route-change-while-connected');\n\nexport type RoutePathType = string | string[] | ((currentThis: any) => string | string[]);\n\nexport interface SwcAppRouteChangeSubscriberMetadata {\n propertyKey: string | symbol;\n options?: SwcAppRouteChangeOptions;\n}\n\nexport interface SwcAppRouteChangeOptions {\n path?: RoutePathType;\n filter?: (router: Router, meta: {currentThis: any
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAA2B;AAIpB,MAAM,8DAA8D,OAAO,IAAI,qEAAqE;
|
|
4
|
+
"sourcesContent": ["import {ReflectUtils} from '@dooboostore/core';\nimport {Router} from '@dooboostore/core-web';\nimport {HelperHostSet} from '../types';\n\nexport const SUBSCRIBE_SWC_APP_ROUTE_CHANGE_WHILE_CONNECTED_METADATA_KEY = Symbol.for('simple-web-component:subscribe-swc-app-route-change-while-connected');\n\nexport type RoutePathType = string | string[] | ((currentThis: any) => string | string[]);\n\nexport interface SwcAppRouteChangeSubscriberMetadata {\n propertyKey: string | symbol;\n options?: SwcAppRouteChangeOptions;\n}\n\nexport interface SwcAppRouteChangeOptions {\n path?: RoutePathType;\n filter?: (router: Router, meta: { currentThis: any; helper: HelperHostSet }) => boolean;\n order?: number;\n valueKey?: symbol | string;\n}\n\nfunction createSubscribeSwcAppRouteChangeWhileConnected(options?: SwcAppRouteChangeOptions): MethodDecorator {\n return (target: Object, propertyKey: string | symbol, descriptor?: PropertyDescriptor) => {\n const pathPattern = options?.path;\n const filter = options?.filter;\n\n const constructor = target.constructor;\n let list = ReflectUtils.getOwnMetadata(SUBSCRIBE_SWC_APP_ROUTE_CHANGE_WHILE_CONNECTED_METADATA_KEY, constructor) as SwcAppRouteChangeSubscriberMetadata[];\n if (!list) {\n list = [];\n ReflectUtils.defineMetadata(SUBSCRIBE_SWC_APP_ROUTE_CHANGE_WHILE_CONNECTED_METADATA_KEY, list, constructor);\n }\n list.push({ propertyKey, options });\n\n return descriptor;\n };\n}\n\n// \uC624\uBC84\uB85C\uB4DC \uC2DC\uADF8\uB2C8\uCC98 - \uC9C1\uC811 \uC0AC\uC6A9 (\uAD04\uD638 \uC5C6\uC74C)\nexport function subscribeSwcAppRouteChangeWhileConnected(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): PropertyDescriptor | void;\n// \uC624\uBC84\uB85C\uB4DC \uC2DC\uADF8\uB2C8\uCC98 - \uD568\uC218 \uD638\uCD9C (\uAD04\uD638 \uC788\uC74C)\nexport function subscribeSwcAppRouteChangeWhileConnected(): MethodDecorator;\nexport function subscribeSwcAppRouteChangeWhileConnected(pathPattern: RoutePathType): MethodDecorator;\nexport function subscribeSwcAppRouteChangeWhileConnected(pathPattern: RoutePathType, config: Omit<SwcAppRouteChangeOptions, 'path'>): MethodDecorator;\nexport function subscribeSwcAppRouteChangeWhileConnected(options: SwcAppRouteChangeOptions): MethodDecorator;\n\n// \uC2E4\uC81C \uAD6C\uD604 (\uC774\uC911 \uBAA8\uB4DC)\nexport function subscribeSwcAppRouteChangeWhileConnected(targetOrOptions?: any, propertyKeyOrConfig?: any, descriptor?: PropertyDescriptor): any {\n // \uC9C1\uC811 \uB370\uCF54\uB808\uC774\uD130\uB85C \uC0AC\uC6A9\uB41C \uACBD\uC6B0 (\uAD04\uD638 \uC5C6\uC74C): @subscribeSwcAppRouteChangeWhileConnected\n // propertyKey\uAC00 string | symbol\uC774\uACE0 descriptor\uAC00 \uC788\uC73C\uBA74 \uC9C1\uC811 \uC0AC\uC6A9\n if (propertyKeyOrConfig && (typeof propertyKeyOrConfig === 'string' || typeof propertyKeyOrConfig === 'symbol')) {\n return createSubscribeSwcAppRouteChangeWhileConnected({})(targetOrOptions, propertyKeyOrConfig, descriptor);\n }\n\n // \uD568\uC218\uB85C \uD638\uCD9C\uB41C \uACBD\uC6B0 (\uAD04\uD638 \uC788\uC74C): @subscribeSwcAppRouteChangeWhileConnected() / @subscribeSwcAppRouteChangeWhileConnected('/path')\n let options: SwcAppRouteChangeOptions = {};\n\n if (Array.isArray(targetOrOptions)) {\n // \uBC30\uC5F4: @subscribeSwcAppRouteChangeWhileConnected(['/path1', '/path2'])\n // \uB610\uB294: @subscribeSwcAppRouteChangeWhileConnected(['/path1', '/path2'], { order: 1 })\n options.path = targetOrOptions;\n if (propertyKeyOrConfig && typeof propertyKeyOrConfig === 'object') {\n options = { ...options, ...propertyKeyOrConfig };\n }\n } else if (typeof targetOrOptions === 'string' || typeof targetOrOptions === 'function') {\n // \uBB38\uC790\uC5F4 \uB610\uB294 \uD568\uC218: @subscribeSwcAppRouteChangeWhileConnected('/path')\n // \uB610\uB294: @subscribeSwcAppRouteChangeWhileConnected('/path', { order: 1 })\n options.path = targetOrOptions;\n if (propertyKeyOrConfig && typeof propertyKeyOrConfig === 'object') {\n options = { ...options, ...propertyKeyOrConfig };\n }\n } else if (targetOrOptions && typeof targetOrOptions === 'object') {\n // \uAC1D\uCCB4: @subscribeSwcAppRouteChangeWhileConnected({ path: '/path', filter: ..., order: 1 })\n options = targetOrOptions;\n }\n\n return createSubscribeSwcAppRouteChangeWhileConnected(options);\n}\nexport const changedRoute = subscribeSwcAppRouteChangeWhileConnected;\n\n// Helper function to retrieve route change subscribers metadata\nexport const getSubscribeSwcAppRouteChangeWhileConnectedMetadata = (target: any): SwcAppRouteChangeSubscriberMetadata[] => {\n const constructor = target instanceof Function ? target : target.constructor;\n const results = ReflectUtils.getOwnMetadata(SUBSCRIBE_SWC_APP_ROUTE_CHANGE_WHILE_CONNECTED_METADATA_KEY, constructor);\n if (!results) return [];\n \n // Sort by order (default 0 if not specified)\n return [...results].sort((a, b) => (a.options?.order ?? 0) - (b.options?.order ?? 0));\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAA2B;AAIpB,MAAM,8DAA8D,OAAO,IAAI,qEAAqE;AAgB3J,SAAS,+CAA+C,SAAqD;AAC3G,SAAO,CAAC,QAAgB,aAA8B,eAAoC;AACxF,UAAM,cAAc,SAAS;AAC7B,UAAM,SAAS,SAAS;AAExB,UAAM,cAAc,OAAO;AA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
91
|
const methodName = metadata.propertyKey;
|
|
92
92
|
let pathPattern = metadata.options?.path;
|
|
93
93
|
const filter = metadata.options?.filter;
|
|
94
|
+
const extractValue = (v) => {
|
|
95
|
+
const keyToUse = metadata.options?.valueKey ?? import_decorators.SUBSCRIBE_SWC_APP_ROUTE_CHANGE_WHILE_CONNECTED_METADATA_KEY;
|
|
96
|
+
if (v && typeof v === "object" && keyToUse in v) {
|
|
97
|
+
return v[keyToUse];
|
|
98
|
+
}
|
|
99
|
+
return v;
|
|
100
|
+
};
|
|
94
101
|
if (typeof pathPattern === "function") {
|
|
95
102
|
pathPattern = pathPattern(instance);
|
|
96
103
|
}
|
|
@@ -115,7 +122,7 @@ function SwcAppMixin(Base) {
|
|
|
115
122
|
const hostSet = import_Utils.SwcUtils.getHelperAndHostSet(this.config.window, this);
|
|
116
123
|
const filterPassed = !filter || filter(this.router, { helper: hostSet, currentThis: instance });
|
|
117
124
|
if (pathMatched && filterPassed && instance[methodName]) {
|
|
118
|
-
const result = await instance[methodName]({ ...re, pathData });
|
|
125
|
+
const result = extractValue(await instance[methodName]({ ...re, pathData }));
|
|
119
126
|
if (result !== void 0 && result !== null) {
|
|
120
127
|
break;
|
|
121
128
|
}
|
|
@@ -230,7 +237,15 @@ function SwcAppMixin(Base) {
|
|
|
230
237
|
context: this,
|
|
231
238
|
args: import_Utils.SwcUtils.getHelperAndHostSet(win, this)
|
|
232
239
|
});
|
|
233
|
-
|
|
240
|
+
if (userConfig instanceof Promise) {
|
|
241
|
+
userConfig.then((resolvedConfig) => {
|
|
242
|
+
this.connect(resolvedConfig);
|
|
243
|
+
}).catch((e) => {
|
|
244
|
+
console.error("[SWC-MIXIN] Script execution failed:", e);
|
|
245
|
+
});
|
|
246
|
+
} else {
|
|
247
|
+
this.connect(userConfig);
|
|
248
|
+
}
|
|
234
249
|
} catch (e) {
|
|
235
250
|
console.error("[SWC-MIXIN] Script execution failed:", e);
|
|
236
251
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/elements/SwcAppMixin.ts"],
|
|
4
|
-
"sourcesContent": ["import {SwcAppInterface, SwcAppMessage} from \"../types\";\nimport {findAllLifecycleMetadata, getSubscribeSwcAppMessageWhileConnectedMetadata, getSubscribeSwcAppRouteChangeWhileConnectedMetadata, ON_CONNECTED_SWC_APP_METADATA_KEY} from \"../decorators\";\nimport {SwcAppEngine, SwcAttributeConfigType, SwcConfigType} from \"../SwcAppEngine\";\nimport {debounceTimeIntervalLock, FunctionUtils, Subscription} from \"@dooboostore/core\";\nimport {RouterEventType} from \"@dooboostore/core-web\";\nimport {SwcUtils} from \"../utils/Utils\";\n\nexport const isSSR = (i: HTMLElement) => {\n return i.hasAttribute('swc-use-ssr');\n}\nexport const setSSRAttribute = (i: HTMLElement) => {\n i.setAttribute('swc-use-ssr', (i as any)._swcId ?? '');\n}\nexport const removeSSRAttribute = (i: HTMLElement) => {\n i.removeAttribute('swc-use-ssr');\n}\n\n/**\n * SwcAppMixin: SwcApp \uAE30\uB2A5\uC744 \uBAA8\uB4E0 HTMLElement\uC5D0 \uCD94\uAC00\uD560 \uC218 \uC788\uB294 Mixin\n * \n * \uC0AC\uC6A9 \uC608:\n * @elementDefine('custom-app', { window: w })\n * class CustomApp extends SwcAppMixin(w.HTMLElement) implements SwcAppInterface {\n * // \uCD94\uAC00 \uAE30\uB2A5 \uAD6C\uD604\n * }\n */\nexport function SwcAppMixin<T extends { new(...args: any[]): HTMLElement }>(Base: T) {\n return class SwcAppMixinClass extends Base implements SwcAppInterface {\n __swc_engine = new SwcAppEngine(this as any);\n _swc_connected_instance = new Set<any>();\n _routerSubscription?: Subscription;\n _lastRouterEvent?: RouterEventType;\n _routeChangeInvocations = 0;\n _connectedInvocations = 0;\n\n _childrenRouteChangedInterval: any;\n _childrenConnectedDoneInterval: any;\n\n /**\n * Safari is \uC18D\uC131 \uCC98\uB9AC\n * Safari polyfill\uC5D0\uC11C\uB294 \uC790\uC2DD\uBD80\uD130 \uB9CC\uB4E4\uC5B4\uC9C0\uACE0 \uBD80\uBAA8\uAC00 \uB9CC\uB4E4\uC5B4\uC9C0\uBBC0\uB85C\n * \uBD80\uBAA8\uAC00 \uC790\uC2DD\uB4E4\uC744 \uAC15\uC81C\uB85C \uB4F1\uB85D\uD574\uC8FC\uB294 \uD615\uD0DC\uB85C \uCC98\uB9AC\n */\n _connected_safari_and_standby = [];\n\n constructor(...args: any[]) {\n super(...args);\n console.log('[SWC-APP-MIXIN] constructor')\n }\n\n get simpleApplication() {\n return this.__swc_engine.simpleApplication;\n }\n\n get config() {\n return this.__swc_engine?.config;\n }\n\n get router() {\n return this.__swc_engine?.router;\n }\n\n async _invokeRouteChangeSubscribers(instance: HTMLElement, re: RouterEventType) {\n if (instance.isConnected === false) return;\n\n this._routeChangeInvocations++;\n\n if (this._childrenRouteChangedInterval) {\n this.config.window.clearInterval(this._childrenRouteChangedInterval);\n }\n const intervalConfig = {setInterval: this.config.window.setInterval.bind(this.config.window), clearInterval: this.config.window.clearInterval.bind(this.config.window)};\n this._childrenRouteChangedInterval = debounceTimeIntervalLock(\n () => this._routeChangeInvocations === 0,\n () => {\n this._childrenRouteChangedInterval = null;\n this.config.onChildrenRouteChanged?.(re, this)\n },\n this.config?.childrenConnectedDoneCheckIntervalTime ?? 30,\n intervalConfig\n );\n\n try {\n const routeChangeSubscribers = getSubscribeSwcAppRouteChangeWhileConnectedMetadata(instance);\n if (routeChangeSubscribers.length > 0) {\n console.log('[SWC-MIXIN] Route change subscribers found')\n \n // Subscribers are already sorted by order from getSubscribeSwcAppRouteChangeWhileConnectedMetadata\n // Execute subscribers in order, stop if one returns a value\n for (const metadata of routeChangeSubscribers) {\n const methodName = metadata.propertyKey;\n let pathPattern = metadata.options?.path as any;\n const filter = metadata.options?.filter;\n\n if (typeof pathPattern === 'function') {\n pathPattern = (pathPattern as Function)(instance);\n }\n\n let pathMatched = false;\n let pathData: any = null;\n\n if (!pathPattern) {\n pathMatched = true;\n pathData = {};\n } else if (Array.isArray(pathPattern)) {\n for (const pattern of pathPattern) {\n const data = SwcUtils.parsePathPattern(pattern, re.path || '/');\n if (data !== null) {\n pathMatched = true;\n pathData = data;\n break;\n }\n }\n } else {\n pathData = SwcUtils.parsePathPattern(pathPattern, re.path || '/');\n pathMatched = pathData !== null;\n }\n\n const hostSet = SwcUtils.getHelperAndHostSet(this.config.window, this);\n const filterPassed = !filter || filter(this.router!, {helper:hostSet, currentThis:instance});\n\n if (pathMatched && filterPassed && instance[methodName]) {\n const result = await instance[methodName]({...re, pathData: pathData});\n // If handler returns a value, stop propagation to next handlers\n if (result !== undefined && result !== null) {\n break;\n }\n }\n }\n }\n } finally {\n if (this.config?.ssr) {\n setSSRAttribute(instance);\n } else {\n removeSSRAttribute(instance);\n }\n this._routeChangeInvocations = Math.max(0, this._routeChangeInvocations - 1);\n }\n }\n\n async _connected(instance: HTMLElement, option?: { noIncrements: boolean }) {\n if (instance) {\n if (!this.simpleApplication && !this.config) {\n this._connected_safari_and_standby.push(instance);\n return;\n }\n\n this.config.onConnectedChildBefore?.(instance);\n if (!option?.noIncrements) {\n this._connectedInvocations++;\n }\n this._swc_connected_instance.add(instance);\n\n const connectedSwcAppCallBacks = findAllLifecycleMetadata(instance, ON_CONNECTED_SWC_APP_METADATA_KEY);\n for (let connectedSwcAppCallBack of connectedSwcAppCallBacks) {\n await (instance as any)?._invokeLifecycleMethod?.(connectedSwcAppCallBack.propertyKey);\n }\n\n if (this._childrenConnectedDoneInterval) {\n this.config.window.clearInterval(this._childrenConnectedDoneInterval);\n }\n const intervalConfig = {setInterval: this.config.window.setInterval.bind(this.config.window), clearInterval: this.config.window.clearInterval.bind(this.config.window)};\n this._childrenConnectedDoneInterval = debounceTimeIntervalLock(\n () => this._connectedInvocations === 0,\n () => {\n this._childrenConnectedDoneInterval = null;\n this.config.onChildrenConnectedDone?.(this)\n },\n this.config?.childrenConnectedDoneCheckIntervalTime ?? 30,\n intervalConfig\n );\n\n if (this.simpleApplication) {\n try {\n if (this.router && this._lastRouterEvent) {\n await this._invokeRouteChangeSubscribers(instance, this._lastRouterEvent!);\n }\n } catch (e) {\n throw e;\n }\n }\n\n if (this.config?.ssr) {\n setSSRAttribute(instance);\n } else {\n removeSSRAttribute(instance);\n }\n }\n\n this.config.onConnectedChildAfter?.(instance);\n return this;\n }\n\n async _connectedDone(instance: any) {\n try {\n // \uB0B4\uBD80 \uC5F0\uACB0 \uCC98\uB9AC \uB85C\uC9C1\n } finally {\n this._connectedInvocations = Math.max(0, this._connectedInvocations - 1);\n }\n }\n\n _disconnected(instance: any) {\n if (instance) {\n this._swc_connected_instance.delete(instance);\n this.config?.onDisconnectedChildAfter?.(instance);\n }\n }\n\n async _handleRouteChange(route: RouterEventType) {\n this._lastRouterEvent = route;\n const swcConnectedInstance = Array.from(this._swc_connected_instance);\n const ps = swcConnectedInstance.map((instance: any) => this._invokeRouteChangeSubscribers(instance, route));\n await Promise.allSettled(ps);\n }\n\n async connect(config?: SwcAttributeConfigType) {\n console.log('[SWC-MIXIN] connect')\n const swcConfig = {\n routeType: 'element',\n window: config?.window,\n ...config\n } as SwcConfigType;\n\n await this.__swc_engine.connect(swcConfig);\n\n // Safari is \uC18D\uC131 \uCC98\uB9AC\n this._connected_safari_and_standby.forEach((instance: any) => {\n this._connected(instance, {noIncrements: true});\n });\n\n // \uB77C\uC6B0\uD130 \uBCC0\uACBD \uAD6C\uB3C5\n if (!this._routerSubscription && this.router) {\n const config = this.__swc_engine.config;\n\n this._routerSubscription = this.router.observable.subscribe(async (route: RouterEventType) => {\n console.log('[SWC-MIXIN] Router event received:', route.triggerPoint);\n if (route.triggerPoint === 'end') {\n await this._handleRouteChange(route);\n }\n });\n\n if (config?.path) {\n console.log('[DEBUG] Navigating to initial path:', config.path);\n }\n }\n }\n\n connectedCallback() {\n // \uBD80\uBAA8 \uD074\uB798\uC2A4\uC758 connectedCallback \uD638\uCD9C\n // @ts-ignore\n super.connectedCallback?.();\n\n const configStr = this.getAttribute('swc-get-application-config');\n const win = this.ownerDocument?.defaultView || window;\n if (configStr && win) {\n try {\n const userConfig = FunctionUtils.executeReturn({\n script: configStr,\n context: this,\n args: SwcUtils.getHelperAndHostSet(win, this)\n });\n this.connect(userConfig);\n } catch (e) {\n console.error('[SWC-MIXIN] Script execution failed:', e);\n }\n }\n\n this._connected(this);\n this.__swc_engine?.config?.onConnected?.(this);\n this._connectedDone(this);\n }\n\n disconnectedCallback() {\n // \uBD80\uBAA8 \uD074\uB798\uC2A4\uC758 disconnectedCallback \uD638\uCD9C\n // @ts-ignore\n super.disconnectedCallback?.();\n \n this._routerSubscription?.unsubscribe();\n this._routerSubscription = undefined;\n this._lastRouterEvent = undefined;\n this.__swc_engine.disconnect();\n this.__swc_engine?.config?.onDisconnected?.(this);\n this._disconnected(this);\n }\n\n async routing(path: string) {\n await this.router?.go(path);\n }\n\n back(): void {\n this.router?.back();\n }\n\n forward(): void {\n this.router?.forward();\n }\n\n reload(): void {\n this.router?.reload();\n }\n\n publishMessage(message: SwcAppMessage): void {\n this._swc_connected_instance.forEach((instance: any) => {\n this._invokeMessageSubscribers(instance, message);\n });\n }\n\n _invokeMessageSubscribers(instance: any, message: SwcAppMessage) {\n const messageSubscribers = getSubscribeSwcAppMessageWhileConnectedMetadata(instance);\n if (messageSubscribers && Array.isArray(messageSubscribers)) {\n messageSubscribers.forEach(metadata => {\n const methodName = metadata.propertyKey;\n const messageType = metadata.messageType;\n const filter = metadata.filter;\n\n let typeMatched = false;\n if (!messageType) {\n typeMatched = true;\n } else if (message.type === messageType) {\n typeMatched = true;\n }\n\n let filterMatched = true;\n if (filter && typeMatched) {\n filterMatched = filter(message, instance);\n }\n\n if (typeMatched && filterMatched && typeof instance[methodName] === 'function') {\n instance[methodName](message);\n }\n });\n }\n }\n };\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,
|
|
4
|
+
"sourcesContent": ["import { SwcAppInterface, SwcAppMessage } from '../types';\nimport { APPLY_NODE_METADATA_KEY, findAllLifecycleMetadata, getSubscribeSwcAppMessageWhileConnectedMetadata, getSubscribeSwcAppRouteChangeWhileConnectedMetadata, ON_CONNECTED_SWC_APP_METADATA_KEY, SUBSCRIBE_SWC_APP_ROUTE_CHANGE_WHILE_CONNECTED_METADATA_KEY } from '../decorators';\nimport { SwcAppEngine, SwcAttributeConfigType, SwcConfigType } from '../SwcAppEngine';\nimport { debounceTimeIntervalLock, FunctionUtils, Subscription } from '@dooboostore/core';\nimport { RouterEventType } from '@dooboostore/core-web';\nimport { SwcUtils } from '../utils/Utils';\n\nexport const isSSR = (i: HTMLElement) => {\n return i.hasAttribute('swc-use-ssr');\n};\nexport const setSSRAttribute = (i: HTMLElement) => {\n i.setAttribute('swc-use-ssr', (i as any)._swcId ?? '');\n};\nexport const removeSSRAttribute = (i: HTMLElement) => {\n i.removeAttribute('swc-use-ssr');\n};\n\n/**\n * SwcAppMixin: SwcApp \uAE30\uB2A5\uC744 \uBAA8\uB4E0 HTMLElement\uC5D0 \uCD94\uAC00\uD560 \uC218 \uC788\uB294 Mixin\n *\n * \uC0AC\uC6A9 \uC608:\n * @elementDefine('custom-app', { window: w })\n * class CustomApp extends SwcAppMixin(w.HTMLElement) implements SwcAppInterface {\n * // \uCD94\uAC00 \uAE30\uB2A5 \uAD6C\uD604\n * }\n */\nexport function SwcAppMixin<T extends { new (...args: any[]): HTMLElement }>(Base: T) {\n return class SwcAppMixinClass extends Base implements SwcAppInterface {\n __swc_engine = new SwcAppEngine(this as any);\n _swc_connected_instance = new Set<any>();\n _routerSubscription?: Subscription;\n _lastRouterEvent?: RouterEventType;\n _routeChangeInvocations = 0;\n _connectedInvocations = 0;\n\n _childrenRouteChangedInterval: any;\n _childrenConnectedDoneInterval: any;\n\n /**\n * Safari is \uC18D\uC131 \uCC98\uB9AC\n * Safari polyfill\uC5D0\uC11C\uB294 \uC790\uC2DD\uBD80\uD130 \uB9CC\uB4E4\uC5B4\uC9C0\uACE0 \uBD80\uBAA8\uAC00 \uB9CC\uB4E4\uC5B4\uC9C0\uBBC0\uB85C\n * \uBD80\uBAA8\uAC00 \uC790\uC2DD\uB4E4\uC744 \uAC15\uC81C\uB85C \uB4F1\uB85D\uD574\uC8FC\uB294 \uD615\uD0DC\uB85C \uCC98\uB9AC\n */\n _connected_safari_and_standby = [];\n\n constructor(...args: any[]) {\n super(...args);\n console.log('[SWC-APP-MIXIN] constructor');\n }\n\n get simpleApplication() {\n return this.__swc_engine.simpleApplication;\n }\n\n get config() {\n return this.__swc_engine?.config;\n }\n\n get router() {\n return this.__swc_engine?.router;\n }\n\n async _invokeRouteChangeSubscribers(instance: HTMLElement, re: RouterEventType) {\n if (instance.isConnected === false) return;\n\n this._routeChangeInvocations++;\n\n if (this._childrenRouteChangedInterval) {\n this.config.window.clearInterval(this._childrenRouteChangedInterval);\n }\n const intervalConfig = { setInterval: this.config.window.setInterval.bind(this.config.window), clearInterval: this.config.window.clearInterval.bind(this.config.window) };\n this._childrenRouteChangedInterval = debounceTimeIntervalLock(\n () => this._routeChangeInvocations === 0,\n () => {\n this._childrenRouteChangedInterval = null;\n this.config.onChildrenRouteChanged?.(re, this);\n },\n this.config?.childrenConnectedDoneCheckIntervalTime ?? 30,\n intervalConfig\n );\n\n try {\n const routeChangeSubscribers = getSubscribeSwcAppRouteChangeWhileConnectedMetadata(instance);\n\n if (routeChangeSubscribers.length > 0) {\n console.log('[SWC-MIXIN] Route change subscribers found');\n\n // Subscribers are already sorted by order from getSubscribeSwcAppRouteChangeWhileConnectedMetadata\n // Execute subscribers in order, stop if one returns a value\n for (const metadata of routeChangeSubscribers) {\n const methodName = metadata.propertyKey;\n let pathPattern = metadata.options?.path as any;\n const filter = metadata.options?.filter;\n const extractValue = (v: any) => {\n const keyToUse = metadata.options?.valueKey ?? SUBSCRIBE_SWC_APP_ROUTE_CHANGE_WHILE_CONNECTED_METADATA_KEY;\n if (v && typeof v === 'object' && keyToUse in v) {\n return v[keyToUse];\n }\n return v;\n };\n\n if (typeof pathPattern === 'function') {\n pathPattern = (pathPattern as Function)(instance);\n }\n\n let pathMatched = false;\n let pathData: any = null;\n\n if (!pathPattern) {\n pathMatched = true;\n pathData = {};\n } else if (Array.isArray(pathPattern)) {\n for (const pattern of pathPattern) {\n const data = SwcUtils.parsePathPattern(pattern, re.path || '/');\n if (data !== null) {\n pathMatched = true;\n pathData = data;\n break;\n }\n }\n } else {\n pathData = SwcUtils.parsePathPattern(pathPattern, re.path || '/');\n pathMatched = pathData !== null;\n }\n\n const hostSet = SwcUtils.getHelperAndHostSet(this.config.window, this);\n const filterPassed = !filter || filter(this.router!, { helper: hostSet, currentThis: instance });\n\n if (pathMatched && filterPassed && instance[methodName]) {\n const result = extractValue(await instance[methodName]({ ...re, pathData: pathData }));\n // if (typeof result === 'object'\n // If handler returns a value, stop propagation to next handlers\n if (result !== undefined && result !== null) {\n break;\n }\n }\n }\n }\n } finally {\n if (this.config?.ssr) {\n setSSRAttribute(instance);\n } else {\n removeSSRAttribute(instance);\n }\n this._routeChangeInvocations = Math.max(0, this._routeChangeInvocations - 1);\n }\n }\n\n async _connected(instance: HTMLElement, option?: { noIncrements: boolean }) {\n if (instance) {\n if (!this.simpleApplication && !this.config) {\n this._connected_safari_and_standby.push(instance);\n return;\n }\n\n this.config.onConnectedChildBefore?.(instance);\n if (!option?.noIncrements) {\n this._connectedInvocations++;\n }\n this._swc_connected_instance.add(instance);\n\n const connectedSwcAppCallBacks = findAllLifecycleMetadata(instance, ON_CONNECTED_SWC_APP_METADATA_KEY);\n for (let connectedSwcAppCallBack of connectedSwcAppCallBacks) {\n await (instance as any)?._invokeLifecycleMethod?.(connectedSwcAppCallBack.propertyKey);\n }\n\n if (this._childrenConnectedDoneInterval) {\n this.config.window.clearInterval(this._childrenConnectedDoneInterval);\n }\n const intervalConfig = { setInterval: this.config.window.setInterval.bind(this.config.window), clearInterval: this.config.window.clearInterval.bind(this.config.window) };\n this._childrenConnectedDoneInterval = debounceTimeIntervalLock(\n () => this._connectedInvocations === 0,\n () => {\n this._childrenConnectedDoneInterval = null;\n this.config.onChildrenConnectedDone?.(this);\n },\n this.config?.childrenConnectedDoneCheckIntervalTime ?? 30,\n intervalConfig\n );\n\n if (this.simpleApplication) {\n try {\n if (this.router && this._lastRouterEvent) {\n await this._invokeRouteChangeSubscribers(instance, this._lastRouterEvent!);\n }\n } catch (e) {\n throw e;\n }\n }\n\n if (this.config?.ssr) {\n setSSRAttribute(instance);\n } else {\n removeSSRAttribute(instance);\n }\n }\n\n this.config.onConnectedChildAfter?.(instance);\n return this;\n }\n\n async _connectedDone(instance: any) {\n try {\n // \uB0B4\uBD80 \uC5F0\uACB0 \uCC98\uB9AC \uB85C\uC9C1\n } finally {\n this._connectedInvocations = Math.max(0, this._connectedInvocations - 1);\n }\n }\n\n _disconnected(instance: any) {\n if (instance) {\n this._swc_connected_instance.delete(instance);\n this.config?.onDisconnectedChildAfter?.(instance);\n }\n }\n\n async _handleRouteChange(route: RouterEventType) {\n this._lastRouterEvent = route;\n const swcConnectedInstance = Array.from(this._swc_connected_instance);\n const ps = swcConnectedInstance.map((instance: any) => this._invokeRouteChangeSubscribers(instance, route));\n await Promise.allSettled(ps);\n }\n\n async connect(config?: SwcAttributeConfigType) {\n console.log('[SWC-MIXIN] connect');\n const swcConfig = {\n routeType: 'element',\n window: config?.window,\n ...config\n } as SwcConfigType;\n\n await this.__swc_engine.connect(swcConfig);\n\n // Safari is \uC18D\uC131 \uCC98\uB9AC\n this._connected_safari_and_standby.forEach((instance: any) => {\n this._connected(instance, { noIncrements: true });\n });\n\n // \uB77C\uC6B0\uD130 \uBCC0\uACBD \uAD6C\uB3C5\n if (!this._routerSubscription && this.router) {\n const config = this.__swc_engine.config;\n\n this._routerSubscription = this.router.observable.subscribe(async (route: RouterEventType) => {\n console.log('[SWC-MIXIN] Router event received:', route.triggerPoint);\n if (route.triggerPoint === 'end') {\n await this._handleRouteChange(route);\n }\n });\n\n if (config?.path) {\n console.log('[DEBUG] Navigating to initial path:', config.path);\n }\n }\n }\n\n connectedCallback() {\n // \uBD80\uBAA8 \uD074\uB798\uC2A4\uC758 connectedCallback \uD638\uCD9C\n // @ts-ignore\n super.connectedCallback?.();\n\n const configStr = this.getAttribute('swc-get-application-config');\n const win = this.ownerDocument?.defaultView || window;\n if (configStr && win) {\n try {\n const userConfig = FunctionUtils.executeReturn({\n script: configStr,\n context: this,\n args: SwcUtils.getHelperAndHostSet(win, this)\n });\n if (userConfig instanceof Promise) {\n userConfig\n .then(resolvedConfig => {\n this.connect(resolvedConfig);\n })\n .catch(e => {\n console.error('[SWC-MIXIN] Script execution failed:', e);\n });\n } else {\n this.connect(userConfig);\n }\n } catch (e) {\n console.error('[SWC-MIXIN] Script execution failed:', e);\n }\n }\n\n this._connected(this);\n this.__swc_engine?.config?.onConnected?.(this);\n this._connectedDone(this);\n }\n\n disconnectedCallback() {\n // \uBD80\uBAA8 \uD074\uB798\uC2A4\uC758 disconnectedCallback \uD638\uCD9C\n // @ts-ignore\n super.disconnectedCallback?.();\n\n this._routerSubscription?.unsubscribe();\n this._routerSubscription = undefined;\n this._lastRouterEvent = undefined;\n this.__swc_engine.disconnect();\n this.__swc_engine?.config?.onDisconnected?.(this);\n this._disconnected(this);\n }\n\n async routing(path: string) {\n await this.router?.go(path);\n }\n\n back(): void {\n this.router?.back();\n }\n\n forward(): void {\n this.router?.forward();\n }\n\n reload(): void {\n this.router?.reload();\n }\n\n publishMessage(message: SwcAppMessage): void {\n this._swc_connected_instance.forEach((instance: any) => {\n this._invokeMessageSubscribers(instance, message);\n });\n }\n\n _invokeMessageSubscribers(instance: any, message: SwcAppMessage) {\n const messageSubscribers = getSubscribeSwcAppMessageWhileConnectedMetadata(instance);\n if (messageSubscribers && Array.isArray(messageSubscribers)) {\n messageSubscribers.forEach(metadata => {\n const methodName = metadata.propertyKey;\n const messageType = metadata.messageType;\n const filter = metadata.filter;\n\n let typeMatched = false;\n if (!messageType) {\n typeMatched = true;\n } else if (message.type === messageType) {\n typeMatched = true;\n }\n\n let filterMatched = true;\n if (filter && typeMatched) {\n filterMatched = filter(message, instance);\n }\n\n if (typeMatched && filterMatched && typeof instance[methodName] === 'function') {\n instance[methodName](message);\n }\n });\n }\n }\n };\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,wBAAwQ;AACxQ,0BAAoE;AACpE,kBAAsE;AAEtE,mBAAyB;AAElB,MAAM,QAAQ,CAAC,MAAmB;AACvC,SAAO,EAAE,aAAa,aAAa;AACrC;AACO,MAAM,kBAAkB,CAAC,MAAmB;AACjD,IAAE,aAAa,eAAgB,EAAU,UAAU,EAAE;AACvD;AACO,MAAM,qBAAqB,CAAC,MAAmB;AACpD,IAAE,gBAAgB,aAAa;AACjC;AAWO,SAAS,YAA6D,MAAS;AACpF,SAAO,MAAM,yBAAyB,KAAgC;AAAA,IAkBpE,eAAe,MAAa;AAC1B,YAAM,GAAG,IAAI;AAlBf,0CAAe,IAAI,iCAAa,IAAW;AAC3C,qDAA0B,oBAAI,IAAS;AACvC;AACA;AACA,qDAA0B;AAC1B,mDAAwB;AAExB;AACA;AAOA;AAAA;AAAA;AAAA;AAAA;AAAA,2DAAgC,CAAC;AAI/B,cAAQ,IAAI,6BAA6B;AAAA,IAC3C;AAAA,IAEA,IAAI,oBAAoB;AACtB,aAAO,KAAK,aAAa;AAAA,IAC3B;AAAA,IAEA,IAAI,SAAS;AACX,aAAO,KAAK,cAAc;AAAA,IAC5B;AAAA,IAEA,IAAI,SAAS;AACX,aAAO,KAAK,cAAc;AAAA,IAC5B;AAAA,IAEA,MAAM,8BAA8B,UAAuB,IAAqB;AAC9E,UAAI,SAAS,gBAAgB,MAAO;AAEpC,WAAK;AAEL,UAAI,KAAK,+BAA+B;AACtC,aAAK,OAAO,OAAO,cAAc,KAAK,6BAA6B;AA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.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var RxJSOperatorsExample_exports = {};
|
|
19
|
+
__export(RxJSOperatorsExample_exports, {
|
|
20
|
+
AutoSaveEditor: () => AutoSaveEditor,
|
|
21
|
+
FormInput: () => FormInput,
|
|
22
|
+
InfiniteScroll: () => InfiniteScroll,
|
|
23
|
+
KeyboardHandler: () => KeyboardHandler,
|
|
24
|
+
LengthTracker: () => LengthTracker,
|
|
25
|
+
MouseTracker: () => MouseTracker,
|
|
26
|
+
ResponsiveLayout: () => ResponsiveLayout,
|
|
27
|
+
SearchComponent: () => SearchComponent
|
|
28
|
+
});
|
|
29
|
+
module.exports = __toCommonJS(RxJSOperatorsExample_exports);
|
|
30
|
+
var import_decorators = require("../decorators");
|
|
31
|
+
var __decorate = function(decorators, target, key, desc) {
|
|
32
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
33
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
34
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
35
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
36
|
+
};
|
|
37
|
+
var __metadata = function(k, v) {
|
|
38
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
39
|
+
};
|
|
40
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
41
|
+
let SearchComponent = class SearchComponent2 extends HTMLElement {
|
|
42
|
+
constructor() {
|
|
43
|
+
super(...arguments);
|
|
44
|
+
this.results = [];
|
|
45
|
+
}
|
|
46
|
+
async onSearchInput(event) {
|
|
47
|
+
const input = event.target;
|
|
48
|
+
const query = input.value.trim();
|
|
49
|
+
if (query.length > 2) {
|
|
50
|
+
try {
|
|
51
|
+
const response = await fetch(`/api/search?q=${encodeURIComponent(query)}`);
|
|
52
|
+
this.results = await response.json();
|
|
53
|
+
this.renderResults();
|
|
54
|
+
} catch (error) {
|
|
55
|
+
console.error("Search failed:", error);
|
|
56
|
+
}
|
|
57
|
+
} else {
|
|
58
|
+
this.results = [];
|
|
59
|
+
this.renderResults();
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
renderResults() {
|
|
63
|
+
console.log("Rendering results:", this.results);
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
__decorate([
|
|
67
|
+
(0, import_decorators.addEventListener)("$this", "input", { debounceTime: 1e3 }),
|
|
68
|
+
__metadata("design:type", Function),
|
|
69
|
+
__metadata("design:paramtypes", [typeof (_a = typeof Event !== "undefined" && Event) === "function" ? _a : Object]),
|
|
70
|
+
__metadata("design:returntype", Promise)
|
|
71
|
+
], SearchComponent.prototype, "onSearchInput", null);
|
|
72
|
+
SearchComponent = __decorate([
|
|
73
|
+
(0, import_decorators.elementDefine)("search-component")
|
|
74
|
+
], SearchComponent);
|
|
75
|
+
let ResponsiveLayout = class ResponsiveLayout2 extends HTMLElement {
|
|
76
|
+
onWindowResize(event) {
|
|
77
|
+
const width = window.innerWidth;
|
|
78
|
+
const height = window.innerHeight;
|
|
79
|
+
console.log(`Window resized to: ${width}x${height}`);
|
|
80
|
+
this.updateLayout(width, height);
|
|
81
|
+
}
|
|
82
|
+
updateLayout(width, height) {
|
|
83
|
+
if (width < 768) {
|
|
84
|
+
this.classList.add("mobile");
|
|
85
|
+
this.classList.remove("desktop");
|
|
86
|
+
} else {
|
|
87
|
+
this.classList.add("desktop");
|
|
88
|
+
this.classList.remove("mobile");
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
};
|
|
92
|
+
__decorate([
|
|
93
|
+
(0, import_decorators.addEventListener)("$window", "resize", { throttleTime: 250 }),
|
|
94
|
+
__metadata("design:type", Function),
|
|
95
|
+
__metadata("design:paramtypes", [typeof (_b = typeof Event !== "undefined" && Event) === "function" ? _b : Object]),
|
|
96
|
+
__metadata("design:returntype", void 0)
|
|
97
|
+
], ResponsiveLayout.prototype, "onWindowResize", null);
|
|
98
|
+
ResponsiveLayout = __decorate([
|
|
99
|
+
(0, import_decorators.elementDefine)("responsive-layout")
|
|
100
|
+
], ResponsiveLayout);
|
|
101
|
+
let FormInput = class FormInput2 extends HTMLElement {
|
|
102
|
+
onFormInput(event) {
|
|
103
|
+
const input = event.target;
|
|
104
|
+
const fieldName = input.name;
|
|
105
|
+
const value = input.value;
|
|
106
|
+
console.log(`Validating ${fieldName}: ${value}`);
|
|
107
|
+
this.validateField(fieldName, value);
|
|
108
|
+
}
|
|
109
|
+
validateField(name, value) {
|
|
110
|
+
const isValid = value.length > 0;
|
|
111
|
+
console.log(`Field ${name} is ${isValid ? "valid" : "invalid"}`);
|
|
112
|
+
}
|
|
113
|
+
};
|
|
114
|
+
__decorate([
|
|
115
|
+
(0, import_decorators.addEventListener)("$this", "input", {
|
|
116
|
+
debounceTime: 300,
|
|
117
|
+
distinctUntilChanged: true
|
|
118
|
+
}),
|
|
119
|
+
__metadata("design:type", Function),
|
|
120
|
+
__metadata("design:paramtypes", [typeof (_c = typeof Event !== "undefined" && Event) === "function" ? _c : Object]),
|
|
121
|
+
__metadata("design:returntype", void 0)
|
|
122
|
+
], FormInput.prototype, "onFormInput", null);
|
|
123
|
+
FormInput = __decorate([
|
|
124
|
+
(0, import_decorators.elementDefine)("form-input")
|
|
125
|
+
], FormInput);
|
|
126
|
+
let InfiniteScroll = class InfiniteScroll2 extends HTMLElement {
|
|
127
|
+
constructor() {
|
|
128
|
+
super(...arguments);
|
|
129
|
+
this.isLoading = false;
|
|
130
|
+
}
|
|
131
|
+
onScroll(event) {
|
|
132
|
+
if (this.isLoading)
|
|
133
|
+
return;
|
|
134
|
+
if (this.isNearBottom()) {
|
|
135
|
+
console.log("Near bottom, loading more content...");
|
|
136
|
+
this.loadMoreContent();
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
isNearBottom() {
|
|
140
|
+
const scrollTop = window.scrollY;
|
|
141
|
+
const windowHeight = window.innerHeight;
|
|
142
|
+
const documentHeight = document.documentElement.scrollHeight;
|
|
143
|
+
return scrollTop + windowHeight >= documentHeight - 500;
|
|
144
|
+
}
|
|
145
|
+
async loadMoreContent() {
|
|
146
|
+
this.isLoading = true;
|
|
147
|
+
try {
|
|
148
|
+
await new Promise((resolve) => setTimeout(resolve, 1e3));
|
|
149
|
+
console.log("Content loaded");
|
|
150
|
+
} finally {
|
|
151
|
+
this.isLoading = false;
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
};
|
|
155
|
+
__decorate([
|
|
156
|
+
(0, import_decorators.addEventListener)("$window", "scroll", { throttleTime: 100 }),
|
|
157
|
+
__metadata("design:type", Function),
|
|
158
|
+
__metadata("design:paramtypes", [typeof (_d = typeof Event !== "undefined" && Event) === "function" ? _d : Object]),
|
|
159
|
+
__metadata("design:returntype", void 0)
|
|
160
|
+
], InfiniteScroll.prototype, "onScroll", null);
|
|
161
|
+
InfiniteScroll = __decorate([
|
|
162
|
+
(0, import_decorators.elementDefine)("infinite-scroll")
|
|
163
|
+
], InfiniteScroll);
|
|
164
|
+
let LengthTracker = class LengthTracker2 extends HTMLElement {
|
|
165
|
+
onInputChange(event) {
|
|
166
|
+
const input = event.target;
|
|
167
|
+
const length = input.value.length;
|
|
168
|
+
console.log(`Input length changed to: ${length}`);
|
|
169
|
+
this.updateLengthDisplay(length);
|
|
170
|
+
}
|
|
171
|
+
updateLengthDisplay(length) {
|
|
172
|
+
const display = this.querySelector(".length-display");
|
|
173
|
+
if (display) {
|
|
174
|
+
display.textContent = `${length} characters`;
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
};
|
|
178
|
+
__decorate([
|
|
179
|
+
(0, import_decorators.addEventListener)("$this", "input", {
|
|
180
|
+
distinctUntilChanged: (prev, curr) => {
|
|
181
|
+
return prev?.length === curr?.length;
|
|
182
|
+
}
|
|
183
|
+
}),
|
|
184
|
+
__metadata("design:type", Function),
|
|
185
|
+
__metadata("design:paramtypes", [typeof (_e = typeof Event !== "undefined" && Event) === "function" ? _e : Object]),
|
|
186
|
+
__metadata("design:returntype", void 0)
|
|
187
|
+
], LengthTracker.prototype, "onInputChange", null);
|
|
188
|
+
LengthTracker = __decorate([
|
|
189
|
+
(0, import_decorators.elementDefine)("length-tracker")
|
|
190
|
+
], LengthTracker);
|
|
191
|
+
let AutoSaveEditor = class AutoSaveEditor2 extends HTMLElement {
|
|
192
|
+
constructor() {
|
|
193
|
+
super(...arguments);
|
|
194
|
+
this.lastSavedContent = "";
|
|
195
|
+
}
|
|
196
|
+
async onContentChange(event) {
|
|
197
|
+
const textarea = event.target;
|
|
198
|
+
const content = textarea.value;
|
|
199
|
+
if (content !== this.lastSavedContent) {
|
|
200
|
+
console.log("Auto-saving content...");
|
|
201
|
+
await this.saveContent(content);
|
|
202
|
+
this.lastSavedContent = content;
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
async saveContent(content) {
|
|
206
|
+
try {
|
|
207
|
+
const response = await fetch("/api/save", {
|
|
208
|
+
method: "POST",
|
|
209
|
+
headers: { "Content-Type": "application/json" },
|
|
210
|
+
body: JSON.stringify({ content })
|
|
211
|
+
});
|
|
212
|
+
if (response.ok) {
|
|
213
|
+
console.log("Content saved successfully");
|
|
214
|
+
this.showSaveIndicator();
|
|
215
|
+
}
|
|
216
|
+
} catch (error) {
|
|
217
|
+
console.error("Save failed:", error);
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
showSaveIndicator() {
|
|
221
|
+
const indicator = this.querySelector(".save-indicator");
|
|
222
|
+
if (indicator) {
|
|
223
|
+
indicator.classList.add("show");
|
|
224
|
+
setTimeout(() => indicator.classList.remove("show"), 2e3);
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
};
|
|
228
|
+
__decorate([
|
|
229
|
+
(0, import_decorators.addEventListener)("$this", "input", {
|
|
230
|
+
debounceTime: 2e3,
|
|
231
|
+
distinctUntilChanged: (prev, curr) => {
|
|
232
|
+
return prev === curr;
|
|
233
|
+
}
|
|
234
|
+
}),
|
|
235
|
+
__metadata("design:type", Function),
|
|
236
|
+
__metadata("design:paramtypes", [typeof (_f = typeof Event !== "undefined" && Event) === "function" ? _f : Object]),
|
|
237
|
+
__metadata("design:returntype", Promise)
|
|
238
|
+
], AutoSaveEditor.prototype, "onContentChange", null);
|
|
239
|
+
AutoSaveEditor = __decorate([
|
|
240
|
+
(0, import_decorators.elementDefine)("auto-save-editor")
|
|
241
|
+
], AutoSaveEditor);
|
|
242
|
+
let KeyboardHandler = class KeyboardHandler2 extends HTMLElement {
|
|
243
|
+
onSaveShortcut(event) {
|
|
244
|
+
event.preventDefault();
|
|
245
|
+
console.log("Save shortcut triggered");
|
|
246
|
+
this.handleSave();
|
|
247
|
+
}
|
|
248
|
+
handleSave() {
|
|
249
|
+
console.log("Saving...");
|
|
250
|
+
}
|
|
251
|
+
};
|
|
252
|
+
__decorate([
|
|
253
|
+
(0, import_decorators.addEventListener)("$document", "keydown", {
|
|
254
|
+
throttleTime: 500,
|
|
255
|
+
filter: (event) => {
|
|
256
|
+
return (event.ctrlKey || event.metaKey) && event.key === "s";
|
|
257
|
+
}
|
|
258
|
+
}),
|
|
259
|
+
__metadata("design:type", Function),
|
|
260
|
+
__metadata("design:paramtypes", [typeof (_g = typeof KeyboardEvent !== "undefined" && KeyboardEvent) === "function" ? _g : Object]),
|
|
261
|
+
__metadata("design:returntype", void 0)
|
|
262
|
+
], KeyboardHandler.prototype, "onSaveShortcut", null);
|
|
263
|
+
KeyboardHandler = __decorate([
|
|
264
|
+
(0, import_decorators.elementDefine)("keyboard-handler")
|
|
265
|
+
], KeyboardHandler);
|
|
266
|
+
let MouseTracker = class MouseTracker2 extends HTMLElement {
|
|
267
|
+
onMouseMove(event) {
|
|
268
|
+
const x = event.clientX;
|
|
269
|
+
const y = event.clientY;
|
|
270
|
+
this.updateCursorPosition(x, y);
|
|
271
|
+
}
|
|
272
|
+
updateCursorPosition(x, y) {
|
|
273
|
+
console.log(`Cursor at: ${x}, ${y}`);
|
|
274
|
+
}
|
|
275
|
+
};
|
|
276
|
+
__decorate([
|
|
277
|
+
(0, import_decorators.addEventListener)("$document", "mousemove", { throttleTime: 100 }),
|
|
278
|
+
__metadata("design:type", Function),
|
|
279
|
+
__metadata("design:paramtypes", [typeof (_h = typeof MouseEvent !== "undefined" && MouseEvent) === "function" ? _h : Object]),
|
|
280
|
+
__metadata("design:returntype", void 0)
|
|
281
|
+
], MouseTracker.prototype, "onMouseMove", null);
|
|
282
|
+
MouseTracker = __decorate([
|
|
283
|
+
(0, import_decorators.elementDefine)("mouse-tracker")
|
|
284
|
+
], MouseTracker);
|
|
285
|
+
//# sourceMappingURL=RxJSOperatorsExample.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/examples/RxJSOperatorsExample.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * Example: Using RxJS-like Operators with @addEventListener\n * \n * This example demonstrates how to use debounceTime, throttleTime, and distinctUntilChanged\n * operators with the @addEventListener decorator.\n */\n\nimport { elementDefine, addEventListener } from '../decorators';\n\n/**\n * Example 1: Search Component with Debounce\n * \n * Waits 1 second after user stops typing before performing search.\n * Prevents excessive API calls during typing.\n */\n@elementDefine('search-component')\nexport class SearchComponent extends HTMLElement {\n private results: any[] = [];\n\n @addEventListener('$this', 'input', { debounceTime: 1000 })\n async onSearchInput(event: Event) {\n const input = event.target as HTMLInputElement;\n const query = input.value.trim();\n\n if (query.length > 2) {\n try {\n // Simulate API call\n const response = await fetch(`/api/search?q=${encodeURIComponent(query)}`);\n this.results = await response.json();\n this.renderResults();\n } catch (error) {\n console.error('Search failed:', error);\n }\n } else {\n this.results = [];\n this.renderResults();\n }\n }\n\n private renderResults() {\n // Render search results\n console.log('Rendering results:', this.results);\n }\n}\n\n/**\n * Example 2: Window Resize Handler with Throttle\n * \n * Recalculates layout at most 4 times per second (every 250ms).\n * Prevents performance issues from excessive resize calculations.\n */\n@elementDefine('responsive-layout')\nexport class ResponsiveLayout extends HTMLElement {\n @addEventListener('$window', 'resize', { throttleTime: 250 })\n onWindowResize(event: Event) {\n const width = window.innerWidth;\n const height = window.innerHeight;\n\n console.log(`Window resized to: ${width}x${height}`);\n this.updateLayout(width, height);\n }\n\n private updateLayout(width: number, height: number) {\n // Update layout based on new dimensions\n if (width < 768) {\n this.classList.add('mobile');\n this.classList.remove('desktop');\n } else {\n this.classList.add('desktop');\n this.classList.remove('mobile');\n }\n }\n}\n\n/**\n * Example 3: Form Input with Debounce + Distinct\n * \n * Validates field only when:\n * 1. User stops typing (debounce 300ms)\n * 2. AND the value actually changed (distinct)\n */\n@elementDefine('form-input')\nexport class FormInput extends HTMLElement {\n @addEventListener('$this', 'input', {\n debounceTime: 300,\n distinctUntilChanged: true\n })\n onFormInput(event: Event) {\n const input = event.target as HTMLInputElement;\n const fieldName = input.name;\n const value = input.value;\n\n console.log(`Validating ${fieldName}: ${value}`);\n this.validateField(fieldName, value);\n }\n\n private validateField(name: string, value: string) {\n // Perform validation\n const isValid = value.length > 0;\n console.log(`Field ${name} is ${isValid ? 'valid' : 'invalid'}`);\n }\n}\n\n/**\n * Example 4: Scroll Event with Throttle\n * \n * Checks if user scrolled to bottom at most 10 times per second.\n * Prevents excessive \"load more\" API calls.\n */\n@elementDefine('infinite-scroll')\nexport class InfiniteScroll extends HTMLElement {\n private isLoading = false;\n\n @addEventListener('$window', 'scroll', { throttleTime: 100 })\n onScroll(event: Event) {\n if (this.isLoading) return;\n\n if (this.isNearBottom()) {\n console.log('Near bottom, loading more content...');\n this.loadMoreContent();\n }\n }\n\n private isNearBottom(): boolean {\n const scrollTop = window.scrollY;\n const windowHeight = window.innerHeight;\n const documentHeight = document.documentElement.scrollHeight;\n\n return scrollTop + windowHeight >= documentHeight - 500;\n }\n\n private async loadMoreContent() {\n this.isLoading = true;\n try {\n // Simulate API call\n await new Promise(resolve => setTimeout(resolve, 1000));\n console.log('Content loaded');\n } finally {\n this.isLoading = false;\n }\n }\n}\n\n/**\n * Example 5: Custom Comparison with Distinct\n * \n * Only fires when the input value length changes.\n * Ignores changes that don't affect the length.\n */\n@elementDefine('length-tracker')\nexport class LengthTracker extends HTMLElement {\n @addEventListener('$this', 'input', {\n distinctUntilChanged: (prev: any, curr: any) => {\n // Only consider it changed if the length differs\n return prev?.length === curr?.length;\n }\n })\n onInputChange(event: Event) {\n const input = event.target as HTMLInputElement;\n const length = input.value.length;\n\n console.log(`Input length changed to: ${length}`);\n this.updateLengthDisplay(length);\n }\n\n private updateLengthDisplay(length: number) {\n // Update UI with new length\n const display = this.querySelector('.length-display');\n if (display) {\n display.textContent = `${length} characters`;\n }\n }\n}\n\n/**\n * Example 6: Complex Scenario - Auto-save with Multiple Operators\n * \n * Combines debounce and distinct for intelligent auto-save:\n * - Waits 2 seconds after user stops typing\n * - Only saves if content actually changed\n * - Prevents unnecessary save operations\n */\n@elementDefine('auto-save-editor')\nexport class AutoSaveEditor extends HTMLElement {\n private lastSavedContent = '';\n\n @addEventListener('$this', 'input', {\n debounceTime: 2000,\n distinctUntilChanged: (prev: any, curr: any) => {\n // Consider changed if the content is different\n return prev === curr;\n }\n })\n async onContentChange(event: Event) {\n const textarea = event.target as HTMLTextAreaElement;\n const content = textarea.value;\n\n if (content !== this.lastSavedContent) {\n console.log('Auto-saving content...');\n await this.saveContent(content);\n this.lastSavedContent = content;\n }\n }\n\n private async saveContent(content: string) {\n try {\n // Simulate API call\n const response = await fetch('/api/save', {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify({ content })\n });\n\n if (response.ok) {\n console.log('Content saved successfully');\n this.showSaveIndicator();\n }\n } catch (error) {\n console.error('Save failed:', error);\n }\n }\n\n private showSaveIndicator() {\n const indicator = this.querySelector('.save-indicator');\n if (indicator) {\n indicator.classList.add('show');\n setTimeout(() => indicator.classList.remove('show'), 2000);\n }\n }\n}\n\n/**\n * Example 7: Keyboard Shortcut Handler with Throttle\n * \n * Prevents rapid repeated execution of keyboard shortcuts.\n */\n@elementDefine('keyboard-handler')\nexport class KeyboardHandler extends HTMLElement {\n @addEventListener('$document', 'keydown', {\n throttleTime: 500,\n filter: (event: KeyboardEvent) => {\n // Only handle Ctrl+S or Cmd+S\n return (event.ctrlKey || event.metaKey) && event.key === 's';\n }\n })\n onSaveShortcut(event: KeyboardEvent) {\n event.preventDefault();\n console.log('Save shortcut triggered');\n this.handleSave();\n }\n\n private handleSave() {\n // Handle save operation\n console.log('Saving...');\n }\n}\n\n/**\n * Example 8: Mouse Move Tracking with Throttle\n * \n * Tracks mouse position at most 10 times per second.\n * Useful for analytics or interactive features.\n */\n@elementDefine('mouse-tracker')\nexport class MouseTracker extends HTMLElement {\n @addEventListener('$document', 'mousemove', { throttleTime: 100 })\n onMouseMove(event: MouseEvent) {\n const x = event.clientX;\n const y = event.clientY;\n\n // Update cursor position indicator\n this.updateCursorPosition(x, y);\n }\n\n private updateCursorPosition(x: number, y: number) {\n // Update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