@universityofmaryland/web-model-library 1.1.0 → 1.1.1
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 +1 -1
- package/dist/attributes/handler.d.ts +3 -0
- package/dist/attributes/handler.d.ts.map +1 -1
- package/dist/attributes/handler.js +42 -0
- package/dist/attributes/handler.js.map +1 -1
- package/dist/attributes/names.d.ts +1 -0
- package/dist/attributes/names.d.ts.map +1 -1
- package/dist/attributes/names.js +1 -0
- package/dist/attributes/names.js.map +1 -1
- package/dist/model/index.d.ts +2 -4
- package/dist/model/index.d.ts.map +1 -1
- package/dist/model.js +5 -1
- package/dist/model.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @universityofmaryland/web-model-library
|
|
2
2
|
|
|
3
|
-
[](https://www.npmjs.com/package/@universityofmaryland/web-model-library)
|
|
4
4
|
|
|
5
5
|
Core utilities for building web components in the UMD design system. Provides the foundational tools for attribute handling, slot management, component registration, and custom element creation.
|
|
6
6
|
|
|
@@ -13,6 +13,7 @@ export interface AttributeHandlerProps {
|
|
|
13
13
|
}
|
|
14
14
|
export declare const CommonAttributeHandlers: {
|
|
15
15
|
resize: (callback: (element: AttributeElementRef) => void) => AttributeHandlerConfig;
|
|
16
|
+
rerender: (callback: (element: AttributeElementRef) => void) => AttributeHandlerConfig;
|
|
16
17
|
visualShowHide: (options: {
|
|
17
18
|
onShow?: (element: AttributeElementRef) => void;
|
|
18
19
|
onHide?: (element: AttributeElementRef) => void;
|
|
@@ -27,6 +28,7 @@ export declare const handler: {
|
|
|
27
28
|
combine: (...configs: AttributeHandlerConfig[]) => AttributeHandlerConfig[];
|
|
28
29
|
observe: {
|
|
29
30
|
resize: ({ callback, name, }: AttributeHandlerProps) => AttributeHandlerConfig;
|
|
31
|
+
rerender: ({ callback, name, }: AttributeHandlerProps) => AttributeHandlerConfig;
|
|
30
32
|
stateOpen: ({ callback, name, }: AttributeHandlerProps) => AttributeHandlerConfig;
|
|
31
33
|
stateClosed: ({ callback, name, }: AttributeHandlerProps) => AttributeHandlerConfig;
|
|
32
34
|
visuallyHide: ({ callback, name, }: AttributeHandlerProps) => AttributeHandlerConfig;
|
|
@@ -37,6 +39,7 @@ export declare const handler: {
|
|
|
37
39
|
};
|
|
38
40
|
common: {
|
|
39
41
|
resize: (callback: (element: AttributeElementRef) => void) => AttributeHandlerConfig;
|
|
42
|
+
rerender: (callback: (element: AttributeElementRef) => void) => AttributeHandlerConfig;
|
|
40
43
|
visualShowHide: (options: {
|
|
41
44
|
onShow?: (element: AttributeElementRef) => void;
|
|
42
45
|
onHide?: (element: AttributeElementRef) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handler.d.ts","sourceRoot":"","sources":["../../source/attributes/handler.ts"],"names":[],"mappings":"AAmCA,MAAM,WAAW,mBAAmB;IAElC,OAAO,EAAE,WAAW,CAAC;IAErB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;CACnC;AAKD,MAAM,MAAM,iBAAiB,GAAG,CAAC,GAAG,EAAE,mBAAmB,EAAE,IAAI,CAAC,EAAE,GAAG,KAAK,IAAI,CAAC;AAK/E,MAAM,WAAW,sBAAsB;IAErC,IAAI,EAAE,MAAM,CAAC;IAEb,OAAO,EAAE,CACP,GAAG,EAAE,mBAAmB,EACxB,QAAQ,EAAE,MAAM,GAAG,IAAI,EACvB,QAAQ,EAAE,MAAM,GAAG,IAAI,KACpB,IAAI,CAAC;CACX;AAKD,MAAM,WAAW,qBAAqB;IAEpC,QAAQ,EAAE,iBAAiB,CAAC;IAE5B,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;
|
|
1
|
+
{"version":3,"file":"handler.d.ts","sourceRoot":"","sources":["../../source/attributes/handler.ts"],"names":[],"mappings":"AAmCA,MAAM,WAAW,mBAAmB;IAElC,OAAO,EAAE,WAAW,CAAC;IAErB,M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AG,sBAAsB;4CAiB9C,qBAAqB,KAAG,sBAAsB;;;2BAgC5B,CAAC,OAAO,EAAE,mBAAmB,KAAK,IAAI;6BAMpC,CAAC,OAAO,EAAE,mBAAmB,KAAK,IAAI;kCAMjC;YACxB,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,mBAAmB,KAAK,IAAI,CAAC;YAChD,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,mBAAmB,KAAK,IAAI,CAAC;SACjD;gCAqBuB;YACtB,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,mBAAmB,KAAK,IAAI,CAAC;YAChD,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,mBAAmB,KAAK,IAAI,CAAC;SAClD;;;CA+CgD,CAAC"}
|
|
@@ -50,6 +50,43 @@ const resize = ({
|
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
52
|
});
|
|
53
|
+
const rerender = ({
|
|
54
|
+
callback,
|
|
55
|
+
name
|
|
56
|
+
}) => ({
|
|
57
|
+
name: name || AttributeNames.layout.rerender,
|
|
58
|
+
handler: (ref, _, newValue) => {
|
|
59
|
+
if (newValue === AttributeValues.state.TRUE) {
|
|
60
|
+
const element = ref.element;
|
|
61
|
+
const previousSize = {
|
|
62
|
+
width: element.offsetWidth,
|
|
63
|
+
height: element.offsetHeight
|
|
64
|
+
};
|
|
65
|
+
callback(ref);
|
|
66
|
+
setTimeout(() => {
|
|
67
|
+
const currentSize = {
|
|
68
|
+
width: element.offsetWidth,
|
|
69
|
+
height: element.offsetHeight
|
|
70
|
+
};
|
|
71
|
+
element.dispatchEvent(
|
|
72
|
+
new CustomEvent("component:layout-rerender", {
|
|
73
|
+
detail: {
|
|
74
|
+
tagName: element.tagName.toLowerCase(),
|
|
75
|
+
element,
|
|
76
|
+
timestamp: Date.now(),
|
|
77
|
+
previousSize,
|
|
78
|
+
currentSize,
|
|
79
|
+
source: "attribute",
|
|
80
|
+
trigger: AttributeNames.layout.rerender
|
|
81
|
+
},
|
|
82
|
+
bubbles: true,
|
|
83
|
+
composed: true
|
|
84
|
+
})
|
|
85
|
+
);
|
|
86
|
+
}, 100);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
});
|
|
53
90
|
const stateOpen = ({
|
|
54
91
|
callback,
|
|
55
92
|
name
|
|
@@ -134,6 +171,7 @@ const visuallyShow = ({
|
|
|
134
171
|
});
|
|
135
172
|
const observe = {
|
|
136
173
|
resize,
|
|
174
|
+
rerender,
|
|
137
175
|
stateOpen,
|
|
138
176
|
stateClosed,
|
|
139
177
|
visuallyHide,
|
|
@@ -147,6 +185,10 @@ const common = {
|
|
|
147
185
|
* Resize observer for responsive components
|
|
148
186
|
*/
|
|
149
187
|
resize: (callback) => resize({ callback }),
|
|
188
|
+
/**
|
|
189
|
+
* Resize observer for responsive components
|
|
190
|
+
*/
|
|
191
|
+
rerender: (callback) => resize({ callback }),
|
|
150
192
|
/**
|
|
151
193
|
* Visual show/hide handlers for modals and overlays
|
|
152
194
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handler.js","sources":["../../source/attributes/handler.ts"],"sourcesContent":["import { AttributeNames } from './names';\nimport { AttributeValues } from './values';\n\n/**\n * Attribute Handler System\n *\n * Provides reactive attribute observation for web components.\n * Handlers watch for specific attribute changes and execute callbacks.\n *\n * ## Handler Types:\n *\n * 1. **State Transitions**: Watch for specific value changes\n * - e.g., state changing from \"closed\" to \"open\"\n *\n * 2. **Boolean Triggers**: Watch for true/false changes\n * - e.g., resize=\"true\" triggers recalculation\n *\n * 3. **Value Changes**: Watch for any value change\n * - e.g., data-layout-position updates\n *\n * ## Usage Example:\n * ```typescript\n * const attributes = Attributes.handler.combine(\n * Attributes.handler.observe.resize({\n * callback: (element) => element.events?.recalculate()\n * }),\n * Attributes.handler.observe.visuallyOpen({\n * callback: (element) => element.events?.open({ hasAnimation: true })\n * })\n * );\n * ```\n */\n/**\n * Reference to an element with optional event handlers\n */\nexport interface AttributeElementRef {\n /** The HTML element being observed */\n element: HTMLElement;\n /** Optional event handlers attached to the element */\n events?: Record<string, Function>;\n}\n\n/**\n * Callback function type for attribute handlers\n */\nexport type AttributeCallback = (arg: AttributeElementRef, arg2?: any) => void;\n\n/**\n * Configuration for an attribute handler\n */\nexport interface AttributeHandlerConfig {\n /** The attribute name to observe */\n name: string;\n /** Handler function called when the attribute changes */\n handler: (\n ref: AttributeElementRef,\n oldValue: string | null,\n newValue: string | null,\n ) => void;\n}\n\n/**\n * Properties for creating attribute handlers\n */\nexport interface AttributeHandlerProps {\n /** Callback function to execute when attribute changes */\n callback: AttributeCallback;\n /** Optional attribute name override */\n name?: string;\n}\n\n/**\n * Combines multiple attribute handlers for the same attribute name.\n * When multiple handlers target the same attribute, they execute in sequence.\n *\n * @param configs - Array of attribute handler configurations\n * @returns Combined handler configurations\n *\n * @example\n * ```typescript\n * const handlers = combine(\n * handler1, // First to execute\n * handler2 // Second to execute\n * );\n * ```\n */\nconst combine = (\n ...configs: AttributeHandlerConfig[]\n): AttributeHandlerConfig[] => {\n const handlerMap = new Map<\n string,\n ((\n ref: AttributeElementRef,\n oldValue: string | null,\n newValue: string | null,\n ) => void)[]\n >();\n\n configs.forEach((config) => {\n const handlers = handlerMap.get(config.name) || [];\n handlers.push(config.handler);\n handlerMap.set(config.name, handlers);\n });\n\n return Array.from(handlerMap.entries()).map(([name, handlers]) => ({\n name,\n handler: (\n ref: AttributeElementRef,\n oldValue: string | null,\n newValue: string | null,\n ) => {\n handlers.forEach((handler) => handler(ref, oldValue, newValue));\n },\n }));\n};\n\n/**\n * Observes the 'resize' attribute.\n * Triggers callback when resize=\"true\" and dispatches component:resize event.\n * Commonly used to recalculate component dimensions.\n */\nconst resize = ({\n callback,\n name,\n}: AttributeHandlerProps): AttributeHandlerConfig => ({\n name: name || AttributeNames.deprecated.state.RESIZE,\n handler: (ref, _, newValue) => {\n if (newValue === AttributeValues.state.TRUE) {\n const element = ref.element;\n\n // Capture dimensions before resize\n const previousSize = {\n width: element.offsetWidth,\n height: element.offsetHeight,\n };\n\n // Execute resize callback\n callback(ref);\n\n // Dispatch resize event after callback with updated dimensions\n setTimeout(() => {\n const currentSize = {\n width: element.offsetWidth,\n height: element.offsetHeight,\n };\n\n element.dispatchEvent(\n new CustomEvent('component:resize', {\n detail: {\n tagName: element.tagName.toLowerCase(),\n element,\n timestamp: Date.now(),\n previousSize,\n currentSize,\n source: 'attribute',\n },\n bubbles: true,\n composed: true,\n }),\n );\n }, 0);\n }\n },\n});\n\n/**\n * @deprecated Use visuallyOpen instead\n * Observes 'state' attribute transition from \"closed\" to \"open\".\n */\nconst stateOpen = ({\n callback,\n name,\n}: AttributeHandlerProps): AttributeHandlerConfig => ({\n name: name || AttributeNames.deprecated.state.STATE,\n handler: (ref, oldValue, newValue) => {\n if (\n newValue === AttributeValues.state.OPENED &&\n oldValue === AttributeValues.state.CLOSED\n ) {\n callback(ref);\n }\n },\n});\n\n/**\n * @deprecated Use visuallyClosed instead\n * Observes 'state' attribute transition from \"open\" to \"closed\".\n */\nconst stateClosed = ({\n callback,\n name,\n}: AttributeHandlerProps): AttributeHandlerConfig => ({\n name: name || AttributeNames.deprecated.state.STATE,\n handler: (ref, oldValue, newValue) => {\n if (\n newValue === AttributeValues.state.CLOSED &&\n oldValue === AttributeValues.state.OPENED\n ) {\n callback(ref);\n }\n },\n});\n\n/**\n * Observes 'data-visual-open' attribute.\n * Triggers callback when changing from \"true\" to \"false\".\n * Used for closing animations and transitions.\n */\nconst visuallyClosed = ({\n callback,\n name,\n}: AttributeHandlerProps): AttributeHandlerConfig => ({\n name: name || AttributeNames.visual.open,\n handler: (ref, oldValue, newValue) => {\n if (\n newValue === AttributeValues.state.FALSE &&\n oldValue === AttributeValues.state.TRUE\n ) {\n callback(ref);\n }\n },\n});\n\nconst visuallyHide = ({\n callback,\n name,\n}: AttributeHandlerProps): AttributeHandlerConfig => ({\n name: name || AttributeNames.layout.hidden,\n handler: (ref, oldValue, newValue) => {\n if (\n newValue === AttributeValues.state.TRUE &&\n oldValue === AttributeValues.state.FALSE\n ) {\n callback(ref);\n }\n },\n});\n\nconst visuallyOpen = ({\n callback,\n name,\n}: AttributeHandlerProps): AttributeHandlerConfig => ({\n name: name || AttributeNames.visual.open,\n handler: (ref, oldValue, newValue) => {\n if (\n newValue === AttributeValues.state.TRUE &&\n oldValue === AttributeValues.state.FALSE\n ) {\n callback(ref);\n }\n },\n});\n\nconst visuallyPosition = ({\n callback,\n name,\n}: AttributeHandlerProps): AttributeHandlerConfig => ({\n name: name || AttributeNames.layout.position,\n handler: (ref, oldValue, newValue) => {\n if (newValue !== oldValue) {\n const top = newValue ? parseInt(newValue) : null;\n if (top) {\n callback(ref, top);\n } else {\n callback(ref);\n }\n }\n },\n});\n\nconst visuallyShow = ({\n callback,\n name,\n}: AttributeHandlerProps): AttributeHandlerConfig => ({\n name: name || AttributeNames.layout.hidden,\n handler: (ref, oldValue, newValue) => {\n if (\n newValue === AttributeValues.state.FALSE &&\n oldValue === AttributeValues.state.TRUE\n ) {\n callback(ref);\n }\n },\n});\n\nconst observe = {\n resize,\n stateOpen,\n stateClosed,\n visuallyHide,\n visuallyOpen,\n visuallyClosed,\n visuallyPosition,\n visuallyShow,\n};\n\n/**\n * Common attribute handler combinations for standard component behaviors.\n * These pre-configured handlers simplify component implementation.\n */\nconst common = {\n /**\n * Resize observer for responsive components\n */\n resize: (callback: (element: AttributeElementRef) => void) =>\n resize({ callback }),\n\n /**\n * Visual show/hide handlers for modals and overlays\n */\n visualShowHide: (options: {\n onShow?: (element: AttributeElementRef) => void;\n onHide?: (element: AttributeElementRef) => void;\n }) =>\n combine(\n ...(options.onShow\n ? [\n visuallyShow({\n callback: options.onShow,\n }),\n ]\n : []),\n ...(options.onHide\n ? [\n visuallyHide({\n callback: options.onHide,\n }),\n ]\n : []),\n ),\n\n /**\n * Visual open/close handlers for expandable components\n */\n visualToggle: (options: {\n onOpen?: (element: AttributeElementRef) => void;\n onClose?: (element: AttributeElementRef) => void;\n }) =>\n combine(\n ...(options.onOpen\n ? [\n visuallyOpen({\n callback: options.onOpen,\n }),\n ]\n : []),\n ...(options.onClose\n ? [\n visuallyClosed({\n callback: options.onClose,\n }),\n ]\n : []),\n ),\n\n /**\n * Standard accordion handlers with open/close transitions\n */\n accordion: () =>\n combine(\n resize({\n callback: (element) => element.events?.open({ hasAnimation: false }),\n }),\n visuallyOpen({\n callback: (element) => element.events?.open({ hasAnimation: true }),\n }),\n visuallyClosed({\n callback: (element) => element.events?.close({ hasAnimation: true }),\n }),\n // Deprecated handlers for backwards compatibility\n stateClosed({\n callback: (element) => element.events?.close({ hasAnimation: true }),\n }),\n stateOpen({\n callback: (element) => element.events?.open({ hasAnimation: true }),\n }),\n ),\n};\n\n/**\n * @deprecated Use Attributes.handler.common instead\n */\nexport const CommonAttributeHandlers = common;\n\nexport const handler = { combine, observe, common };\n"],"names":["handler"],"mappings":";;AAsFA,MAAM,UAAU,IACX,YAC0B;AAC7B,QAAM,iCAAiB,IAAA;AASvB,UAAQ,QAAQ,CAAC,WAAW;AAC1B,UAAM,WAAW,WAAW,IAAI,OAAO,IAAI,KAAK,CAAA;AAChD,aAAS,KAAK,OAAO,OAAO;AAC5B,eAAW,IAAI,OAAO,MAAM,QAAQ;AAAA,EACtC,CAAC;AAED,SAAO,MAAM,KAAK,WAAW,QAAA,CAAS,EAAE,IAAI,CAAC,CAAC,MAAM,QAAQ,OAAO;AAAA,IACjE;AAAA,IACA,SAAS,CACP,KACA,UACA,aACG;AACH,eAAS,QAAQ,CAACA,aAAYA,SAAQ,KAAK,UAAU,QAAQ,CAAC;AAAA,IAChE;AAAA,EAAA,EACA;AACJ;AAOA,MAAM,SAAS,CAAC;AAAA,EACd;AAAA,EACA;AACF,OAAsD;AAAA,EACpD,MAAM,QAAQ,eAAe,WAAW,MAAM;AAAA,EAC9C,SAAS,CAAC,KAAK,GAAG,aAAa;AAC7B,QAAI,aAAa,gBAAgB,MAAM,MAAM;AAC3C,YAAM,UAAU,IAAI;AAGpB,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OO,MAAM,UAAU,EAAE,SAAS,SAAS,OAAA;"}
|
|
1
|
+
{"version":3,"file":"handler.js","sources":["../../source/attributes/handler.ts"],"sourcesContent":["import { AttributeNames } from './names';\nimport { AttributeValues } from './values';\n\n/**\n * Attribute Handler System\n *\n * Provides reactive attribute observation for web components.\n * Handlers watch for specific attribute changes and execute callbacks.\n *\n * ## Handler Types:\n *\n * 1. **State Transitions**: Watch for specific value changes\n * - e.g., state changing from \"closed\" to \"open\"\n *\n * 2. **Boolean Triggers**: Watch for true/false changes\n * - e.g., resize=\"true\" triggers recalculation\n *\n * 3. **Value Changes**: Watch for any value change\n * - e.g., data-layout-position updates\n *\n * ## Usage Example:\n * ```typescript\n * const attributes = Attributes.handler.combine(\n * Attributes.handler.observe.resize({\n * callback: (element) => element.events?.recalculate()\n * }),\n * Attributes.handler.observe.visuallyOpen({\n * callback: (element) => element.events?.open({ hasAnimation: true })\n * })\n * );\n * ```\n */\n/**\n * Reference to an element with optional event handlers\n */\nexport interface AttributeElementRef {\n /** The HTML element being observed */\n element: HTMLElement;\n /** Optional event handlers attached to the element */\n events?: Record<string, Function>;\n}\n\n/**\n * Callback function type for attribute handlers\n */\nexport type AttributeCallback = (arg: AttributeElementRef, arg2?: any) => void;\n\n/**\n * Configuration for an attribute handler\n */\nexport interface AttributeHandlerConfig {\n /** The attribute name to observe */\n name: string;\n /** Handler function called when the attribute changes */\n handler: (\n ref: AttributeElementRef,\n oldValue: string | null,\n newValue: string | null,\n ) => void;\n}\n\n/**\n * Properties for creating attribute handlers\n */\nexport interface AttributeHandlerProps {\n /** Callback function to execute when attribute changes */\n callback: AttributeCallback;\n /** Optional attribute name override */\n name?: string;\n}\n\n/**\n * Combines multiple attribute handlers for the same attribute name.\n * When multiple handlers target the same attribute, they execute in sequence.\n *\n * @param configs - Array of attribute handler configurations\n * @returns Combined handler configurations\n *\n * @example\n * ```typescript\n * const handlers = combine(\n * handler1, // First to execute\n * handler2 // Second to execute\n * );\n * ```\n */\nconst combine = (\n ...configs: AttributeHandlerConfig[]\n): AttributeHandlerConfig[] => {\n const handlerMap = new Map<\n string,\n ((\n ref: AttributeElementRef,\n oldValue: string | null,\n newValue: string | null,\n ) => void)[]\n >();\n\n configs.forEach((config) => {\n const handlers = handlerMap.get(config.name) || [];\n handlers.push(config.handler);\n handlerMap.set(config.name, handlers);\n });\n\n return Array.from(handlerMap.entries()).map(([name, handlers]) => ({\n name,\n handler: (\n ref: AttributeElementRef,\n oldValue: string | null,\n newValue: string | null,\n ) => {\n handlers.forEach((handler) => handler(ref, oldValue, newValue));\n },\n }));\n};\n\n/**\n * Observes the 'resize' attribute.\n * Triggers callback when resize=\"true\" and dispatches component:resize event.\n * Commonly used to recalculate component dimensions.\n */\nconst resize = ({\n callback,\n name,\n}: AttributeHandlerProps): AttributeHandlerConfig => ({\n name: name || AttributeNames.deprecated.state.RESIZE,\n handler: (ref, _, newValue) => {\n if (newValue === AttributeValues.state.TRUE) {\n const element = ref.element;\n\n // Capture dimensions before resize\n const previousSize = {\n width: element.offsetWidth,\n height: element.offsetHeight,\n };\n\n // Execute resize callback\n callback(ref);\n\n // Dispatch resize event after callback with updated dimensions\n setTimeout(() => {\n const currentSize = {\n width: element.offsetWidth,\n height: element.offsetHeight,\n };\n\n element.dispatchEvent(\n new CustomEvent('component:resize', {\n detail: {\n tagName: element.tagName.toLowerCase(),\n element,\n timestamp: Date.now(),\n previousSize,\n currentSize,\n source: 'attribute',\n },\n bubbles: true,\n composed: true,\n }),\n );\n }, 0);\n }\n },\n});\n\n/**\n * Observes the 'rerender' attribute.\n * Triggers callback when data-layout-rerender=\"true\" and dispatches\n * component:layout-rerender event with previous and current dimensions.\n * Commonly used to recalculate component dimensions after layout changes.\n */\nconst rerender = ({\n callback,\n name,\n}: AttributeHandlerProps): AttributeHandlerConfig => ({\n name: name || AttributeNames.layout.rerender,\n handler: (ref, _, newValue) => {\n if (newValue === AttributeValues.state.TRUE) {\n const element = ref.element;\n\n const previousSize = {\n width: element.offsetWidth,\n height: element.offsetHeight,\n };\n\n callback(ref);\n\n setTimeout(() => {\n const currentSize = {\n width: element.offsetWidth,\n height: element.offsetHeight,\n };\n\n element.dispatchEvent(\n new CustomEvent('component:layout-rerender', {\n detail: {\n tagName: element.tagName.toLowerCase(),\n element,\n timestamp: Date.now(),\n previousSize,\n currentSize,\n source: 'attribute',\n trigger: AttributeNames.layout.rerender,\n },\n bubbles: true,\n composed: true,\n }),\n );\n }, 100);\n }\n },\n});\n\n/**\n * @deprecated Use visuallyOpen instead\n * Observes 'state' attribute transition from \"closed\" to \"open\".\n */\nconst stateOpen = ({\n callback,\n name,\n}: AttributeHandlerProps): AttributeHandlerConfig => ({\n name: name || AttributeNames.deprecated.state.STATE,\n handler: (ref, oldValue, newValue) => {\n if (\n newValue === AttributeValues.state.OPENED &&\n oldValue === AttributeValues.state.CLOSED\n ) {\n callback(ref);\n }\n },\n});\n\n/**\n * @deprecated Use visuallyClosed instead\n * Observes 'state' attribute transition from \"open\" to \"closed\".\n */\nconst stateClosed = ({\n callback,\n name,\n}: AttributeHandlerProps): AttributeHandlerConfig => ({\n name: name || AttributeNames.deprecated.state.STATE,\n handler: (ref, oldValue, newValue) => {\n if (\n newValue === AttributeValues.state.CLOSED &&\n oldValue === AttributeValues.state.OPENED\n ) {\n callback(ref);\n }\n },\n});\n\n/**\n * Observes 'data-visual-open' attribute.\n * Triggers callback when changing from \"true\" to \"false\".\n * Used for closing animations and transitions.\n */\nconst visuallyClosed = ({\n callback,\n name,\n}: AttributeHandlerProps): AttributeHandlerConfig => ({\n name: name || AttributeNames.visual.open,\n handler: (ref, oldValue, newValue) => {\n if (\n newValue === AttributeValues.state.FALSE &&\n oldValue === AttributeValues.state.TRUE\n ) {\n callback(ref);\n }\n },\n});\n\nconst visuallyHide = ({\n callback,\n name,\n}: AttributeHandlerProps): AttributeHandlerConfig => ({\n name: name || AttributeNames.layout.hidden,\n handler: (ref, oldValue, newValue) => {\n if (\n newValue === AttributeValues.state.TRUE &&\n oldValue === AttributeValues.state.FALSE\n ) {\n callback(ref);\n }\n },\n});\n\nconst visuallyOpen = ({\n callback,\n name,\n}: AttributeHandlerProps): AttributeHandlerConfig => ({\n name: name || AttributeNames.visual.open,\n handler: (ref, oldValue, newValue) => {\n if (\n newValue === AttributeValues.state.TRUE &&\n oldValue === AttributeValues.state.FALSE\n ) {\n callback(ref);\n }\n },\n});\n\nconst visuallyPosition = ({\n callback,\n name,\n}: AttributeHandlerProps): AttributeHandlerConfig => ({\n name: name || AttributeNames.layout.position,\n handler: (ref, oldValue, newValue) => {\n if (newValue !== oldValue) {\n const top = newValue ? parseInt(newValue) : null;\n if (top) {\n callback(ref, top);\n } else {\n callback(ref);\n }\n }\n },\n});\n\nconst visuallyShow = ({\n callback,\n name,\n}: AttributeHandlerProps): AttributeHandlerConfig => ({\n name: name || AttributeNames.layout.hidden,\n handler: (ref, oldValue, newValue) => {\n if (\n newValue === AttributeValues.state.FALSE &&\n oldValue === AttributeValues.state.TRUE\n ) {\n callback(ref);\n }\n },\n});\n\nconst observe = {\n resize,\n rerender,\n stateOpen,\n stateClosed,\n visuallyHide,\n visuallyOpen,\n visuallyClosed,\n visuallyPosition,\n visuallyShow,\n};\n\n/**\n * Common attribute handler combinations for standard component behaviors.\n * These pre-configured handlers simplify component implementation.\n */\nconst common = {\n /**\n * Resize observer for responsive components\n */\n resize: (callback: (element: AttributeElementRef) => void) =>\n resize({ callback }),\n\n /**\n * Resize observer for responsive components\n */\n rerender: (callback: (element: AttributeElementRef) => void) =>\n resize({ callback }),\n\n /**\n * Visual show/hide handlers for modals and overlays\n */\n visualShowHide: (options: {\n onShow?: (element: AttributeElementRef) => void;\n onHide?: (element: AttributeElementRef) => void;\n }) =>\n combine(\n ...(options.onShow\n ? [\n visuallyShow({\n callback: options.onShow,\n }),\n ]\n : []),\n ...(options.onHide\n ? [\n visuallyHide({\n callback: options.onHide,\n }),\n ]\n : []),\n ),\n\n /**\n * Visual open/close handlers for expandable components\n */\n visualToggle: (options: {\n onOpen?: (element: AttributeElementRef) => void;\n onClose?: (element: AttributeElementRef) => void;\n }) =>\n combine(\n ...(options.onOpen\n ? [\n visuallyOpen({\n callback: options.onOpen,\n }),\n ]\n : []),\n ...(options.onClose\n ? [\n visuallyClosed({\n callback: options.onClose,\n }),\n ]\n : []),\n ),\n\n /**\n * Standard accordion handlers with open/close transitions\n */\n accordion: () =>\n combine(\n resize({\n callback: (element) => element.events?.open({ hasAnimation: false }),\n }),\n visuallyOpen({\n callback: (element) => element.events?.open({ hasAnimation: true }),\n }),\n visuallyClosed({\n callback: (element) => element.events?.close({ hasAnimation: true }),\n }),\n // Deprecated handlers for backwards compatibility\n stateClosed({\n callback: (element) => element.events?.close({ hasAnimation: true }),\n }),\n stateOpen({\n callback: (element) => element.events?.open({ hasAnimation: true }),\n }),\n ),\n};\n\n/**\n * @deprecated Use Attributes.handler.common instead\n */\nexport const CommonAttributeHandlers = common;\n\nexport const handler = { combine, observe, common };\n"],"names":["handler"],"mappings":";;AAsFA,MAAM,UAAU,IACX,YAC0B;AAC7B,QAAM,iCAAiB,IAAA;AASvB,UAAQ,QAAQ,CAAC,WAAW;AAC1B,UAAM,WAAW,WAAW,IAAI,OAAO,IAAI,KAAK,CAAA;AAChD,aAAS,KAAK,OAAO,OAAO;AAC5B,eAAW,IAAI,OAAO,MAAM,QAAQ;AAAA,EACtC,CAAC;AAED,SAAO,MAAM,KAAK,WAAW,QAAA,CAAS,EAAE,IAAI,CAAC,CAAC,MAAM,QAAQ,OAAO;AAAA,IACjE;AAAA,IACA,SAAS,CACP,KACA,UACA,aACG;AACH,eAAS,QAAQ,CAACA,aAAYA,SAAQ,KAAK,UAAU,QAAQ,CAAC;AAAA,IAChE;AAAA,EAAA,EACA;AACJ;AAOA,MAAM,SAAS,CAAC;AAAA,EACd;AAAA,EACA;AACF,OAAsD;AAAA,EACpD,MAAM,QAAQ,eAAe,WAAW,MAAM;AAAA,EAC9C,SAAS,CAAC,KAAK,GAAG,aAAa;AAC7B,Q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AAAA;AAAA;AAAA,EAMT,cAAc,CAAC,YAIb;AAAA,IACE,GAAI,QAAQ,SACR;AAAA,MACE,aAAa;AAAA,QACX,UAAU,QAAQ;AAAA,MAAA,CACnB;AAAA,IAAA,IAEH,CAAA;AAAA,IACJ,GAAI,QAAQ,UACR;AAAA,MACE,eAAe;AAAA,QACb,UAAU,QAAQ;AAAA,MAAA,CACnB;AAAA,IAAA,IAEH,CAAA;AAAA,EAAC;AAAA;AAAA;AAAA;AAAA,EAMT,WAAW,MACT;AAAA,IACE,OAAO;AAAA,MACL,UAAU,CAAC,YAAY,QAAQ,QAAQ,KAAK,EAAE,cAAc,MAAA,CAAO;AAAA,IAAA,CACpE;AAAA,IACD,aAAa;AAAA,MACX,UAAU,CAAC,YAAY,QAAQ,QAAQ,KAAK,EAAE,cAAc,KAAA,CAAM;AAAA,IAAA,CACnE;AAAA,IACD,eAAe;AAAA,MACb,UAAU,CAAC,YAAY,QAAQ,QAAQ,MAAM,EAAE,cAAc,KAAA,CAAM;AAAA,IAAA,CACpE;AAAA;AAAA,IAED,YAAY;AAAA,MACV,UAAU,CAAC,YAAY,QAAQ,QAAQ,MAAM,EAAE,cAAc,KAAA,CAAM;AAAA,IAAA,CACpE;AAAA,IACD,UAAU;AAAA,MACR,UAAU,CAAC,YAAY,QAAQ,QAAQ,KAAK,EAAE,cAAc,KAAA,CAAM;AAAA,IAAA,CACnE;AAAA,EAAA;AAEP;AAOO,MAAM,UAAU,EAAE,SAAS,SAAS,OAAA;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"names.d.ts","sourceRoot":"","sources":["../../source/attributes/names.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"names.d.ts","sourceRoot":"","sources":["../../source/attributes/names.ts"],"names":[],"mappings":"AAgKA,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAajB,CAAC"}
|
package/dist/attributes/names.js
CHANGED
|
@@ -46,6 +46,7 @@ const layout = {
|
|
|
46
46
|
interior: "data-layout-interior",
|
|
47
47
|
lock: "data-layout-lock",
|
|
48
48
|
position: "data-layout-position",
|
|
49
|
+
rerender: "data-layout-rerender",
|
|
49
50
|
reverse: "data-layout-reverse",
|
|
50
51
|
rowCount: "data-layout-row-count",
|
|
51
52
|
spaceHorizontal: "data-layout-space-horizontal",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"names.js","sources":["../../source/attributes/names.ts"],"sourcesContent":["/**\n * Attribute name constants organized by category.\n *\n * Single-value attributes use a 'default' property for consistency:\n * - display.default = 'data-display'\n * - theme.default = 'data-theme'\n *\n * Multi-value attributes use descriptive property names:\n * - visual.size = 'data-visual-size'\n * - layout.HIDDEN = 'data-layout-hidden'\n */\n\nconst decoration = {\n line: 'data-decoration-line',\n};\n\nconst display = {\n default: 'data-display',\n};\n\nconst feature = {\n animation: 'data-animation',\n lazyLoad: 'data-lazy-load',\n imageExpand: 'data-image-expand',\n};\n\nconst loading = {\n priority: 'data-loading-priority',\n};\n\nconst feed = {\n type: 'data-feed-type',\n union: 'data-union',\n};\n\nconst information = {\n admissions: 'data-admissions',\n alertUrl: 'data-alert-url',\n events: 'data-events',\n filterIds: 'data-filter-group-ids',\n gift: 'data-gift',\n id: 'data-id',\n ids: 'data-ids',\n mediaTrained: 'data-media-trained',\n news: 'data-news',\n removeIds: 'data-remove-entry-ids',\n schools: 'data-schools',\n search: 'data-search',\n searchType: 'data-search-type',\n title: 'data-title',\n token: 'data-token',\n url: 'data-url',\n};\n\nconst layout = {\n alertOff: 'data-alert-off',\n alignment: 'data-layout-alignment',\n columnCount: 'data-layout-column-count',\n fixed: 'data-layout-fixed',\n height: 'data-layout-height',\n hidden: 'data-layout-hidden',\n imageScaled: 'data-layout-image-scaled',\n imagePosition: 'data-layout-image-position',\n interior: 'data-layout-interior',\n lock: 'data-layout-lock',\n position: 'data-layout-position',\n reverse: 'data-layout-reverse',\n rowCount: 'data-layout-row-count',\n spaceHorizontal: 'data-layout-space-horizontal',\n text: 'data-layout-text',\n};\n\nconst sharing = {\n email: 'data-email',\n print: 'data-print',\n};\n\nconst social = {\n facebook: 'data-facebook',\n twitter: 'data-twitter',\n};\n\nconst theme = {\n default: 'data-theme',\n};\n\nconst visual = {\n bordered: 'data-visual-bordered',\n campaign: 'data-visual-campaign',\n imageAligned: 'data-visual-image-aligned',\n icon: 'data-visual-icon',\n iconSeal: 'data-visual-icon-seal',\n hiddenDays: 'data-days-to-hide',\n open: 'data-visual-open',\n play: 'data-visual-play',\n size: 'data-visual-size',\n time: 'data-visual-time',\n transparent: 'data-visual-transparent',\n};\n\n// Deprecated\n\nconst deprecated = {\n feature: {\n FULLSCREEN: 'option-full-screen',\n SHOW_TIME: 'show-time',\n },\n display: {\n DISPLAY_SIZE: 'size',\n DISPLAY_TYPE: 'display-type',\n DISPLAY: 'display',\n },\n feed: {\n FEED_CATEGORIES: 'categories',\n FEED_COLUMN_COUNT: 'show-count',\n FEED_LAZY_LOAD: 'lazyload',\n FEED_NOT_ENTRIES: 'not',\n FEED_ROW_COUNT: 'row-count',\n FEED_TOKEN: 'token',\n FEED_UNION: 'union',\n },\n option: {\n OPTIONAL_HAS_LINE: 'has-line',\n OPTIONAL_HAS_SEPARATOR: 'include-separator',\n OPTIONAL_STICKY_FIRST: 'isStickyFirst',\n },\n layout: {\n DEFAULT: 'layout',\n LAYOUT_FIXED: 'fixed',\n LAYOUT_ALIGNMENT: 'alignment',\n LAYOUT_IMAGE_POSITION: 'image-position',\n LAYOUT_IMAGE_SCALED: 'image-scaled',\n LAYOUT_STICKY_TOP: 'position-top',\n },\n state: {\n RESIZE: 'resize',\n STATE_DEPRECATD: 'state',\n STATE: 'data-state',\n },\n theme: {\n THEME_DEPRECATD: 'theme',\n },\n type: {\n TYPE: 'type',\n DATA_TYPE: 'data-type',\n },\n visual: {\n VISUAL_ALIGN: 'aligned',\n VISUAL_BORDER: 'border',\n VISUAL_DAYS_TO_HIDE: 'days-to-hide',\n VISUAL_HAS_LOGO: 'hasLogo',\n VISUAL_ICON: 'icon',\n VISUAL_TRANSPARENT: 'transparent',\n VISUAL_QUOTE: 'quote',\n VISUAL_TEXT_CENTER: 'text-center',\n VISUAL_STYLE_PROPS: 'styleProps',\n },\n};\n\nexport const AttributeNames = {\n decoration,\n display,\n feature,\n feed,\n information,\n layout,\n loading,\n sharing,\n social,\n theme,\n visual,\n deprecated,\n} as const;\n"],"names":[],"mappings":"AAYA,MAAM,aAAa;AAAA,EACjB,MAAM;AACR;AAEA,MAAM,UAAU;AAAA,EACd,SAAS;AACX;AAEA,MAAM,UAAU;AAAA,EACd,WAAW;AAAA,EACX,UAAU;AAAA,EACV,aAAa;AACf;AAEA,MAAM,UAAU;AAAA,EACd,UAAU;AACZ;AAEA,MAAM,OAAO;AAAA,EACX,MAAM;AAAA,EACN,OAAO;AACT;AAEA,MAAM,cAAc;AAAA,EAClB,YAAY;AAAA,EACZ,UAAU;AAAA,EACV,QAAQ;AAAA,EACR,WAAW;AAAA,EACX,MAAM;AAAA,EACN,IAAI;AAAA,EACJ,KAAK;AAAA,EACL,cAAc;AAAA,EACd,MAAM;AAAA,EACN,WAAW;AAAA,EACX,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,YAAY;AAAA,EACZ,OAAO;AAAA,EACP,OAAO;AAAA,EACP,KAAK;AACP;AAEA,MAAM,SAAS;AAAA,EACb,UAAU;AAAA,EACV,WAAW;AAAA,EACX,aAAa;AAAA,EACb,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,aAAa;AAAA,EACb,eAAe;AAAA,EACf,UAAU;AAAA,EACV,MAAM;AAAA,EACN,UAAU;AAAA,EACV,SAAS;AAAA,EACT,UAAU;AAAA,EACV,iBAAiB;AAAA,EACjB,MAAM;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AAAA,IACjB,aAAa;AAAA,IACb,oBAAoB;AAAA,IACpB,cAAc;AAAA,IACd,oBAAoB;AAAA,IACpB,oBAAoB;AAAA,EAAA;AAExB;AAEO,MAAM,iBAAiB;AAAA,EAC5B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;"}
|
|
1
|
+
{"version":3,"file":"names.js","sources":["../../source/attributes/names.ts"],"sourcesContent":["/**\n * Attribute name constants organized by category.\n *\n * Single-value attributes use a 'default' property for consistency:\n * - display.default = 'data-display'\n * - theme.default = 'data-theme'\n *\n * Multi-value attributes use descriptive property names:\n * - visual.size = 'data-visual-size'\n * - layout.HIDDEN = 'data-layout-hidden'\n */\n\nconst decoration = {\n line: 'data-decoration-line',\n};\n\nconst display = {\n default: 'data-display',\n};\n\nconst feature = {\n animation: 'data-animation',\n lazyLoad: 'data-lazy-load',\n imageExpand: 'data-image-expand',\n};\n\nconst loading = {\n priority: 'data-loading-priority',\n};\n\nconst feed = {\n type: 'data-feed-type',\n union: 'data-union',\n};\n\nconst information = {\n admissions: 'data-admissions',\n alertUrl: 'data-alert-url',\n events: 'data-events',\n filterIds: 'data-filter-group-ids',\n gift: 'data-gift',\n id: 'data-id',\n ids: 'data-ids',\n mediaTrained: 'data-media-trained',\n news: 'data-news',\n removeIds: 'data-remove-entry-ids',\n schools: 'data-schools',\n search: 'data-search',\n searchType: 'data-search-type',\n title: 'data-title',\n token: 'data-token',\n url: 'data-url',\n};\n\nconst layout = {\n alertOff: 'data-alert-off',\n alignment: 'data-layout-alignment',\n columnCount: 'data-layout-column-count',\n fixed: 'data-layout-fixed',\n height: 'data-layout-height',\n hidden: 'data-layout-hidden',\n imageScaled: 'data-layout-image-scaled',\n imagePosition: 'data-layout-image-position',\n interior: 'data-layout-interior',\n lock: 'data-layout-lock',\n position: 'data-layout-position',\n rerender: 'data-layout-rerender',\n reverse: 'data-layout-reverse',\n rowCount: 'data-layout-row-count',\n spaceHorizontal: 'data-layout-space-horizontal',\n text: 'data-layout-text',\n};\n\nconst sharing = {\n email: 'data-email',\n print: 'data-print',\n};\n\nconst social = {\n facebook: 'data-facebook',\n twitter: 'data-twitter',\n};\n\nconst theme = {\n default: 'data-theme',\n};\n\nconst visual = {\n bordered: 'data-visual-bordered',\n campaign: 'data-visual-campaign',\n imageAligned: 'data-visual-image-aligned',\n icon: 'data-visual-icon',\n iconSeal: 'data-visual-icon-seal',\n hiddenDays: 'data-days-to-hide',\n open: 'data-visual-open',\n play: 'data-visual-play',\n size: 'data-visual-size',\n time: 'data-visual-time',\n transparent: 'data-visual-transparent',\n};\n\n// Deprecated\n\nconst deprecated = {\n feature: {\n FULLSCREEN: 'option-full-screen',\n SHOW_TIME: 'show-time',\n },\n display: {\n DISPLAY_SIZE: 'size',\n DISPLAY_TYPE: 'display-type',\n DISPLAY: 'display',\n },\n feed: {\n FEED_CATEGORIES: 'categories',\n FEED_COLUMN_COUNT: 'show-count',\n FEED_LAZY_LOAD: 'lazyload',\n FEED_NOT_ENTRIES: 'not',\n FEED_ROW_COUNT: 'row-count',\n FEED_TOKEN: 'token',\n FEED_UNION: 'union',\n },\n option: {\n OPTIONAL_HAS_LINE: 'has-line',\n OPTIONAL_HAS_SEPARATOR: 'include-separator',\n OPTIONAL_STICKY_FIRST: 'isStickyFirst',\n },\n layout: {\n DEFAULT: 'layout',\n LAYOUT_FIXED: 'fixed',\n LAYOUT_ALIGNMENT: 'alignment',\n LAYOUT_IMAGE_POSITION: 'image-position',\n LAYOUT_IMAGE_SCALED: 'image-scaled',\n LAYOUT_STICKY_TOP: 'position-top',\n },\n state: {\n RESIZE: 'resize',\n STATE_DEPRECATD: 'state',\n STATE: 'data-state',\n },\n theme: {\n THEME_DEPRECATD: 'theme',\n },\n type: {\n TYPE: 'type',\n DATA_TYPE: 'data-type',\n },\n visual: {\n VISUAL_ALIGN: 'aligned',\n VISUAL_BORDER: 'border',\n VISUAL_DAYS_TO_HIDE: 'days-to-hide',\n VISUAL_HAS_LOGO: 'hasLogo',\n VISUAL_ICON: 'icon',\n VISUAL_TRANSPARENT: 'transparent',\n VISUAL_QUOTE: 'quote',\n VISUAL_TEXT_CENTER: 'text-center',\n VISUAL_STYLE_PROPS: 'styleProps',\n },\n};\n\nexport const AttributeNames = {\n decoration,\n display,\n feature,\n feed,\n information,\n layout,\n loading,\n sharing,\n social,\n theme,\n visual,\n deprecated,\n} as const;\n"],"names":[],"mappings":"AAYA,MAAM,aAAa;AAAA,EACjB,MAAM;AACR;AAEA,MAAM,UAAU;AAAA,EACd,SAAS;AACX;AAEA,MAAM,UAAU;AAAA,EACd,WAAW;AAAA,EACX,UAAU;AAAA,EACV,aAAa;AACf;AAEA,MAAM,UAAU;AAAA,EACd,UAAU;AACZ;AAEA,MAAM,OAAO;AAAA,EACX,MAAM;AAAA,EACN,OAAO;AACT;AAEA,MAAM,cAAc;AAAA,EAClB,YAAY;AAAA,EACZ,UAAU;AAAA,EACV,QAAQ;AAAA,EACR,WAAW;AAAA,EACX,MAAM;AAAA,EACN,IAAI;AAAA,EACJ,KAAK;AAAA,EACL,cAAc;AAAA,EACd,MAAM;AAAA,EACN,WAAW;AAAA,EACX,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,YAAY;AAAA,EACZ,OAAO;AAAA,EACP,OAAO;AAAA,EACP,KAAK;AACP;AAEA,MAAM,SAAS;AAAA,EACb,UAAU;AAAA,EACV,WAAW;AAAA,EACX,aAAa;AAAA,EACb,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,aAAa;AAAA,EACb,eAAe;AAAA,EACf,UAAU;AAAA,EACV,MAAM;AAAA,EACN,UAAU;AAAA,EACV,UAAU;AAAA,EACV,SAAS;AAAA,EACT,UAAU;AAAA,EACV,iBAAiB;AAAA,EACjB,MAAM;AACR;AAEA,MAAM,UAAU;AAAA,EACd,OAAO;AAAA,EACP,OAAO;A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AA,IACd,oBAAoB;AAAA,IACpB,oBAAoB;AAAA,EAAA;AAExB;AAEO,MAAM,iBAAiB;AAAA,EAC5B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;"}
|
package/dist/model/index.d.ts
CHANGED
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import { Logger } from '../utilities/debug';
|
|
2
2
|
import { ReactiveAttributeMap, ResolvedAttributeConfig } from '../attributes/config';
|
|
3
3
|
import { ChangeDetector } from '../attributes/change-detection';
|
|
4
|
+
import { AttributeHandlerConfig } from '../attributes/handler';
|
|
4
5
|
import { RegisterOptions } from './registration';
|
|
5
6
|
import { SlotConfig, ComponentEventDetail, ElementRef, PropertyValues, ReactiveController, ReactiveControllerHost } from '../_types';
|
|
6
|
-
|
|
7
|
-
name: string;
|
|
8
|
-
handler: (element: ElementRef, oldValue: string, newValue: string) => void;
|
|
9
|
-
}
|
|
7
|
+
type AttributeConfig = AttributeHandlerConfig;
|
|
10
8
|
interface ComponentLifecycle {
|
|
11
9
|
firstConnected?: (host: HTMLElement, shadow: ShadowRoot) => void;
|
|
12
10
|
willFirstUpdate?: (host: HTMLElement, shadow: ShadowRoot) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../source/model/index.ts"],"names":[],"mappings":"AAsCA,OAAO,EAAgB,KAAK,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC/D,OAAO,EAGL,KAAK,oBAAoB,EACzB,KAAK,uBAAuB,EAC7B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../source/model/index.ts"],"names":[],"mappings":"AAsCA,OAAO,EAAgB,KAAK,MAAM,EAAE,MAAM,oBAAo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GED
|
@@ -172,7 +172,11 @@ class BaseComponent extends HTMLElement {
|
|
|
172
172
|
(attr) => attr.name === name
|
|
173
173
|
)?.handler;
|
|
174
174
|
if (handler) {
|
|
175
|
-
handler(
|
|
175
|
+
handler(
|
|
176
|
+
this.elementRef,
|
|
177
|
+
oldValue,
|
|
178
|
+
newValue
|
|
179
|
+
);
|
|
176
180
|
}
|
|
177
181
|
}
|
|
178
182
|
if (!this._isReflecting) {
|
package/dist/model.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model.js","sources":["../source/model/index.ts"],"sourcesContent":["/**\n * Custom Element Model System\n *\n * Provides a base class and utilities for creating web components with:\n * - Shadow DOM encapsulation\n * - Attribute observation and handling\n * - Slot validation\n * - Lifecycle management\n * - Error handling\n *\n * ## Key Features:\n *\n * 1. **Attribute Handling**: Automatic observation and callback execution\n * 2. **Slot Validation**: Required slots, deprecated warnings, element type checking\n * 3. **Lifecycle Hooks**: beforeConnect, afterConnect, onReady\n * 4. **Error Management**: Centralized error handling with custom events\n *\n * ## Usage:\n * ```typescript\n * const element = createCustomElement({\n * tagName: 'my-component',\n * slots: {\n * headline: { required: true, allowedElements: ['h2', 'h3'] },\n * content: { allowedElements: ['div', 'p'] }\n * },\n * attributes: [{\n * name: 'theme',\n * handler: (ref, oldValue, newValue) => {\n * // Handle theme change\n * }\n * }],\n * createComponent: (host) => {\n * // Create and return component\n * }\n * });\n * ```\n */\nimport { stylesTemplate } from '../utilities/styles';\nimport { createLogger, type Logger } from '../utilities/debug';\nimport {\n resolveAttributeConfigs,\n defineObservedAttributes,\n type ReactiveAttributeMap,\n type ResolvedAttributeConfig,\n} from '../attributes/config';\nimport { ChangeDetector } from '../attributes/change-detection';\nimport { AttributeTypeError, AttributeValidationError } from '../attributes/errors';\nimport { UpdateScheduler } from './update-cycle';\nimport {\n registerComponent,\n type RegisterOptions,\n} from './registration';\nimport type {\n SlotConfig,\n SlotValidationError,\n SlotValidationResult,\n ComponentEventDetail,\n ComponentReadyDetail,\n ComponentErrorDetail,\n ElementRef,\n PropertyValues,\n ReactiveController,\n ReactiveControllerHost,\n} from '../_types';\nimport {\n validateAllSlots,\n validateSlotElements,\n} from '../slots/slot-validation';\nimport {\n createSlotchangeHandler,\n type SlotchangeEvent,\n} from '../slots/slot-events';\nimport {\n querySlottedElements,\n querySlottedElement,\n hasSlottedContent,\n} from '../slots/slot-query';\n\ninterface AttributeConfig {\n name: string;\n handler: (element: ElementRef, oldValue: string, newValue: string) => void;\n}\n\ninterface ComponentLifecycle {\n firstConnected?: (host: HTMLElement, shadow: ShadowRoot) => void;\n willFirstUpdate?: (host: HTMLElement, shadow: ShadowRoot) => void;\n beforeConnect?: (ref: ElementRef, shadow: ShadowRoot) => void;\n afterConnect?: (ref: ElementRef, shadow: ShadowRoot) => void;\n onReady?: (ref: ElementRef, shadow: ShadowRoot) => void;\n willUpdate?: (host: HTMLElement, changedProperties: PropertyValues) => void;\n update?: (host: HTMLElement, changedProperties: PropertyValues) => void;\n updated?: (host: HTMLElement, changedProperties: PropertyValues) => void;\n}\n\ninterface ComponentConfig extends ComponentLifecycle {\n tagName: string;\n attributes?: AttributeConfig[];\n reactiveAttributes?: ReactiveAttributeMap;\n slots?: Record<string, SlotConfig>;\n createComponent: (host: HTMLElement) => ElementRef;\n}\n\n// Store the config on the constructor itself\nconst ComponentConfig = (config: ComponentConfig) => {\n return function <T extends typeof BaseComponent>(constructor: T) {\n constructor.componentConfig = config;\n return constructor;\n };\n};\n\n/**\n * Base class for all web components created by the Model system.\n * Extends HTMLElement with shadow DOM support, attribute observation,\n * slot validation, and lifecycle management.\n *\n * @internal This class is not meant to be extended directly.\n * Use `createCustomElement` to create components.\n */\nclass BaseComponent extends HTMLElement implements ReactiveControllerHost {\n static componentConfig: ComponentConfig;\n\n protected shadow: ShadowRoot;\n protected elementRef: ElementRef | null = null;\n protected config: ComponentConfig;\n protected _logger: Logger;\n\n protected _resolvedReactiveAttrs: ResolvedAttributeConfig[] = [];\n protected _changeDetector: ChangeDetector = new ChangeDetector();\n protected _reactiveValues: Map<string, unknown> = new Map();\n private _isReflecting = false;\n private _hasConnected = false;\n private _hasFirstUpdated = false;\n private _updateScheduler: UpdateScheduler;\n private _changedProperties: PropertyValues = new Map();\n private _isUpdating = false;\n private _pendingPreUpgrade: Map<string, unknown> | null = null;\n\n constructor() {\n super();\n\n const constructor = this.constructor as typeof BaseComponent;\n this.config = constructor.componentConfig;\n\n if (!this.config) {\n throw new Error(\n 'Component config not found. Did you forget to use the @Component decorator?',\n );\n }\n\n this._logger = createLogger(this.config.tagName);\n this._updateScheduler = new UpdateScheduler(() => this._performUpdate());\n this.shadow = this.attachShadow({ mode: 'open' });\n this.validateConfig();\n this.setupReactiveAttributes();\n }\n\n static get observedAttributes(): string[] {\n const handlerNames =\n this.componentConfig?.attributes?.map((attr) => attr.name) || [];\n const reactiveNames = this.componentConfig?.reactiveAttributes\n ? defineObservedAttributes(this.componentConfig.reactiveAttributes)\n : [];\n return [...new Set([...handlerNames, ...reactiveNames])];\n }\n\n connectedCallback(): void {\n try {\n this.applyPreUpgradeProperties();\n if (!this._hasConnected) {\n this._hasConnected = true;\n this.executeFirstConnected();\n }\n this.initializeComponent();\n } catch (error) {\n this.handleError('Failed to initialize component', error);\n }\n }\n\n disconnectedCallback(): void {\n this.cleanup();\n }\n\n attributeChangedCallback(\n name: string,\n oldValue: string,\n newValue: string,\n ): void {\n if (oldValue === newValue) return;\n\n try {\n this.handleAttributeChange(name, oldValue, newValue);\n } catch (error) {\n this.handleError(`Failed to handle attribute change: ${name}`, error);\n }\n }\n\n protected initializeComponent(): void {\n try {\n this.validateSlots();\n\n if (!this._hasFirstUpdated) {\n this._hasFirstUpdated = true;\n this.executeWillFirstUpdate();\n }\n\n const componentRef = this.config.createComponent(this);\n\n if (!componentRef || !componentRef.element) {\n throw new Error(\n 'Component creation failed: Invalid component reference',\n );\n }\n\n this.elementRef = componentRef;\n this.setupShadowDom(componentRef);\n this.setupSlotObservers();\n this.notifyControllers('hostConnected');\n\n if (this._changedProperties.size > 0) {\n this._updateScheduler.schedule();\n }\n\n this.afterInit();\n } catch (error) {\n this.handleError('Failed to initialize component', error);\n }\n }\n\n protected setupShadowDom(component: ElementRef): void {\n this.shadow.appendChild(\n stylesTemplate({ styles: component.styles || '' }).content.cloneNode(true),\n );\n this.shadow.appendChild(component.element);\n }\n\n protected validateConfig(): void {\n const requiredFields: (keyof ComponentConfig)[] = [\n 'tagName',\n 'createComponent',\n ];\n\n requiredFields.forEach((field) => {\n if (!this.config[field]) {\n throw new Error(`Missing required config field: ${field}`);\n }\n });\n\n if (this.config.attributes) {\n this.config.attributes.forEach((attr) => {\n if (!attr.name || !attr.handler) {\n throw new Error(\n 'Invalid attribute config: requires name and handler',\n );\n }\n });\n }\n }\n\n protected async afterInit(): Promise<void> {\n if (!this.elementRef) {\n this.handleError('Cannot initialize - missing element reference', null);\n return;\n }\n\n await this.executeLifecycleCallbacks();\n\n // Dispatch umdComponent:ready event after all lifecycle callbacks complete\n this.dispatchComponentEvent<ComponentReadyDetail>('umdComponent:ready', {\n shadowRoot: this.shadow,\n ref: this.elementRef,\n });\n }\n\n protected handleAttributeChange(\n name: string,\n oldValue: string,\n newValue: string,\n ): void {\n // Existing handler system\n if (this.elementRef) {\n const handler = this.config.attributes?.find(\n (attr) => attr.name === name,\n )?.handler;\n\n if (handler) {\n handler(this.elementRef, oldValue, newValue);\n }\n }\n\n // Reactive attribute system — update property from attribute\n if (!this._isReflecting) {\n const resolved = this._resolvedReactiveAttrs.find(\n (r) => r.attributeName === name,\n );\n if (resolved) {\n let converted: unknown;\n try {\n converted = resolved.converter.fromAttribute(newValue, name);\n } catch (err) {\n throw new AttributeTypeError(\n name,\n resolved.type ?? 'unknown',\n newValue,\n this.config.tagName,\n );\n }\n const value =\n converted !== undefined ? converted : resolved.defaultValue;\n\n if (value !== undefined && resolved.validate) {\n const error = resolved.validate(value);\n if (error) {\n throw new AttributeValidationError(name, error, this.config.tagName);\n }\n }\n\n // Capture old value before write\n const oldValue = this._reactiveValues.get(resolved.propertyName);\n const equalityOverride = resolved.hasChanged\n ? (prev: unknown, next: unknown) => !resolved.hasChanged!(next, prev)\n : undefined;\n const changed = this._changeDetector.set(resolved.propertyName, value, equalityOverride);\n\n // Write directly to avoid reflection loop\n this._reactiveValues.set(resolved.propertyName, value);\n\n if (changed) {\n if (resolved.onChange) {\n resolved.onChange(this, value, oldValue);\n }\n this.requestUpdate(resolved.propertyName, oldValue);\n }\n }\n }\n }\n\n /**\n * Capture a property value set on the instance before upgrade.\n * Deletes the instance property so the class accessor takes precedence,\n * then returns the captured value for re-application.\n */\n private capturePreUpgradeProperty(propertyName: string): { value: unknown; captured: boolean } {\n if (this.hasOwnProperty(propertyName)) {\n const value = (this as any)[propertyName];\n delete (this as any)[propertyName];\n return { value, captured: true };\n }\n return { value: undefined, captured: false };\n }\n\n /**\n * Apply pre-upgrade property values through reactive setters.\n * Called in connectedCallback after all attributeChangedCallback\n * calls have completed during upgrade.\n */\n private applyPreUpgradeProperties(): void {\n if (!this._pendingPreUpgrade) return;\n const pending = this._pendingPreUpgrade;\n this._pendingPreUpgrade = null;\n for (const [propertyName, value] of pending) {\n (this as any)[propertyName] = value;\n }\n }\n\n protected setupReactiveAttributes(): void {\n if (!this.config.reactiveAttributes) return;\n\n this._resolvedReactiveAttrs = resolveAttributeConfigs(\n this.config.reactiveAttributes,\n );\n\n for (const resolved of this._resolvedReactiveAttrs) {\n const { propertyName, defaultValue } = resolved;\n\n // Capture pre-upgrade instance property before defining accessor\n const preUpgrade = this.capturePreUpgradeProperty(propertyName);\n\n // Seed the initial value from the attribute (if present) or default\n if (resolved.attributeName !== false) {\n const raw = this.getAttribute(resolved.attributeName);\n if (raw !== null) {\n const converted = resolved.converter.fromAttribute(\n raw,\n resolved.attributeName,\n );\n this._reactiveValues.set(\n propertyName,\n converted !== undefined ? converted : defaultValue,\n );\n } else if (defaultValue !== undefined) {\n this._reactiveValues.set(propertyName, defaultValue);\n }\n } else if (defaultValue !== undefined) {\n this._reactiveValues.set(propertyName, defaultValue);\n }\n\n // Install property accessor on the instance\n Object.defineProperty(this, propertyName, {\n get: () => this._reactiveValues.get(propertyName),\n set: (value: unknown) => {\n if (value !== undefined && resolved.validate) {\n const error = resolved.validate(value);\n if (error) {\n const attrName =\n resolved.attributeName !== false\n ? resolved.attributeName\n : propertyName;\n throw new AttributeValidationError(attrName, error, this.config.tagName);\n }\n }\n\n const oldValue = this._reactiveValues.get(propertyName);\n const equalityOverride = resolved.hasChanged\n ? (prev: unknown, next: unknown) => !resolved.hasChanged!(next, prev)\n : undefined;\n const changed = this._changeDetector.set(propertyName, value, equalityOverride);\n if (!changed) return;\n\n this._reactiveValues.set(propertyName, value);\n\n // Reflect to attribute if configured\n if (resolved.reflect && resolved.attributeName !== false) {\n this._isReflecting = true;\n try {\n const attrValue = resolved.converter.toAttribute(value);\n if (attrValue === null) {\n this.removeAttribute(resolved.attributeName);\n } else {\n this.setAttribute(resolved.attributeName, attrValue);\n }\n } finally {\n this._isReflecting = false;\n }\n }\n\n if (resolved.onChange) {\n resolved.onChange(this, value, oldValue);\n }\n\n this.requestUpdate(propertyName, oldValue);\n },\n configurable: true,\n enumerable: true,\n });\n\n // Defer pre-upgrade value re-application to connectedCallback\n // so it runs after attributeChangedCallback during upgrade\n if (preUpgrade.captured) {\n if (!this._pendingPreUpgrade) {\n this._pendingPreUpgrade = new Map();\n }\n this._pendingPreUpgrade.set(propertyName, preUpgrade.value);\n }\n }\n }\n\n private _slotCleanups: (() => void)[] = [];\n private _controllers: Set<ReactiveController> = new Set();\n\n addController(controller: ReactiveController): void {\n this._controllers.add(controller);\n if (this.isConnected && this.elementRef) {\n controller.hostConnected?.();\n }\n }\n\n removeController(controller: ReactiveController): void {\n this._controllers.delete(controller);\n }\n\n requestUpdate(name?: string, oldValue?: unknown): void {\n if (name !== undefined && !this._changedProperties.has(name)) {\n this._changedProperties.set(name, oldValue);\n }\n if (!this._hasConnected) return;\n this._updateScheduler.schedule();\n }\n\n get updateComplete(): Promise<boolean> {\n return this._updateScheduler.updateComplete;\n }\n\n protected willUpdate(_changedProperties: PropertyValues): void {\n this.config.willUpdate?.(this, _changedProperties);\n }\n\n protected update(_changedProperties: PropertyValues): void {\n this.config.update?.(this, _changedProperties);\n }\n\n protected updated(_changedProperties: PropertyValues): void {\n this.config.updated?.(this, _changedProperties);\n }\n\n private _performUpdate(): boolean {\n if (this._isUpdating) return true;\n this._isUpdating = true;\n\n const changedProperties = this._changedProperties;\n this._changedProperties = new Map();\n\n try {\n for (const controller of this._controllers) {\n controller.hostUpdate?.();\n }\n this.willUpdate(changedProperties);\n this.update(changedProperties);\n this.updated(changedProperties);\n for (const controller of this._controllers) {\n controller.hostUpdated?.();\n }\n return true;\n } catch (error) {\n this.handleError('Error during update cycle', error);\n return false;\n } finally {\n this._isUpdating = false;\n }\n }\n\n private notifyControllers(method: 'hostConnected' | 'hostDisconnected'): void {\n for (const controller of this._controllers) {\n try {\n controller[method]?.();\n } catch (error) {\n this.handleError(`Controller ${method} failed`, error);\n }\n }\n }\n\n querySlot(slotName?: string, selector?: string): Element[] {\n return querySlottedElements(this, slotName, { selector, flatten: true });\n }\n\n querySlotElement<T extends Element = Element>(\n slotName?: string,\n selector?: string,\n ): T | null {\n return querySlottedElement<T>(this, slotName, selector);\n }\n\n hasSlotContent(slotName?: string): boolean {\n return hasSlottedContent(this, slotName);\n }\n\n protected cleanup(): void {\n this.notifyControllers('hostDisconnected');\n for (const fn of this._slotCleanups) fn();\n this._slotCleanups = [];\n this.elementRef = null;\n }\n\n /**\n * Helper method to dispatch component events with consistent structure\n */\n protected dispatchComponentEvent<T extends ComponentEventDetail>(\n eventName: string,\n detail: Omit<T, 'tagName' | 'element' | 'timestamp'>,\n ): void {\n const fullDetail = {\n ...detail,\n tagName: this.config.tagName,\n element: this,\n timestamp: Date.now(),\n } as unknown as T;\n\n this.dispatchEvent(\n new CustomEvent<T>(eventName, {\n detail: fullDetail,\n bubbles: true,\n composed: true,\n }),\n );\n }\n\n protected handleError(message: string, error: unknown): void {\n this._logger.error(message, error);\n\n // Determine error type based on component state and message\n const errorType = this.elementRef\n ? 'runtime'\n : message.toLowerCase().includes('validation')\n ? 'validation'\n : 'initialization';\n\n this.dispatchComponentEvent<ComponentErrorDetail>('umdComponent:error', {\n type: errorType,\n message,\n details: error,\n });\n }\n\n private validateSlots(): void {\n if (!this.config.slots) return;\n\n const result = validateAllSlots(this, this.config.slots);\n this.reportSlotErrors(result);\n }\n\n private reportSlotErrors(result: SlotValidationResult): void {\n if (result.isValid) return;\n\n this.handleError('Slot validation failed', result.errors);\n\n if (result.errors.length === 1) {\n this._logger.warn(result.errors[0].message);\n } else {\n this._logger.group(`${result.errors.length} slot validation warnings`);\n for (const error of result.errors) {\n this._logger.warn(error.message);\n }\n this._logger.groupEnd();\n }\n }\n\n private setupSlotObservers(): void {\n if (!this.config.slots) return;\n\n const configKeys = Object.keys(this.config.slots);\n const kebabToConfig = new Map<string, { key: string; config: SlotConfig }>();\n for (const key of configKeys) {\n const kebab = key\n .replace(/[A-Z]/g, (letter) => `-${letter.toLowerCase()}`)\n .replace(/^-/, '');\n kebabToConfig.set(kebab, { key, config: this.config.slots[key] });\n }\n\n const handler = createSlotchangeHandler(\n this,\n (event: SlotchangeEvent) => {\n const slotName = event.slotName ?? '';\n const entry = kebabToConfig.get(slotName);\n if (!entry) return;\n\n const result = validateSlotElements(entry.key, event.elements, entry.config);\n this.reportSlotErrors(result);\n },\n { flatten: true },\n );\n\n handler.connect();\n this._slotCleanups.push(() => handler.disconnect());\n }\n\n private async executeLifecycleCallbacks(): Promise<void> {\n const lifecycleMethods = [\n 'beforeConnect',\n 'afterConnect',\n 'onReady',\n ] as const;\n\n for (const method of lifecycleMethods) {\n await this.executeCallback(method);\n }\n }\n\n private async executeCallback(name: 'beforeConnect' | 'afterConnect' | 'onReady'): Promise<void> {\n const callback = this.config[name];\n\n if (!callback) {\n return;\n }\n\n try {\n await Promise.resolve(callback(this.elementRef!, this.shadow));\n } catch (error) {\n this.handleError(`Failed to execute ${name} callback`, error);\n }\n }\n\n public getRef(): ElementRef | null {\n return this.elementRef;\n }\n\n public getShadowRoot(): ShadowRoot {\n return this.shadow;\n }\n\n private executeFirstConnected(): void {\n try {\n if (this.config.firstConnected) {\n this.config.firstConnected(this, this.shadow);\n }\n this.firstConnected();\n } catch (error) {\n this.handleError('Failed to execute firstConnected hook', error);\n }\n }\n\n protected firstConnected(): void {\n // No-op. Override in subclasses.\n }\n\n private executeWillFirstUpdate(): void {\n try {\n if (this.config.willFirstUpdate) {\n this.config.willFirstUpdate(this, this.shadow);\n }\n this.willFirstUpdate();\n } catch (error) {\n this.handleError('Failed to execute willFirstUpdate hook', error);\n }\n }\n\n protected willFirstUpdate(): void {\n // No-op. Override in subclasses.\n }\n}\n\n/**\n * Factory function to create a custom element class.\n *\n * @param config - Component configuration including tagName, slots, attributes, and lifecycle hooks\n * @returns Custom element class that extends BaseComponent\n *\n * @example\n * ```typescript\n * export default () => {\n * Register.registerWebComponent({\n * name: tagName,\n * element: createCustomElement({\n * tagName,\n * slots,\n * attributes,\n * createComponent\n * })\n * });\n * };\n * ```\n */\nconst createCustomElement = (config: ComponentConfig): typeof BaseComponent => {\n @ComponentConfig(config)\n class Component extends BaseComponent {\n constructor() {\n super();\n }\n }\n\n return Component;\n};\n\n/**\n * Convenience factory that combines `createCustomElement` and `registerComponent`\n * into a single call, eliminating tagName duplication.\n *\n * @param config - Component configuration (same as `createCustomElement`)\n * @param options - Registration options (same as `registerComponent`)\n * @returns A registration function (`ComponentRegistration`)\n *\n * @example\n * ```typescript\n * export const MyComponent: ComponentRegistration = Model.defineComponent({\n * tagName: 'umd-my-component',\n * slots,\n * createComponent,\n * }, { eager: false });\n * ```\n */\nconst defineComponent = (\n config: ComponentConfig,\n options?: RegisterOptions,\n): (() => void) => {\n let element: ReturnType<typeof createCustomElement> | null = null;\n return () => {\n if (!element) {\n element = createCustomElement(config);\n }\n registerComponent(config.tagName, element, options);\n };\n};\n\nexport {\n createCustomElement,\n defineComponent,\n BaseComponent,\n type ComponentConfig,\n type AttributeConfig,\n};\n\nexport { IntersectionController, MediaQueryController } from './controllers';\nexport type { ReactiveController, ReactiveControllerHost } from '../_types';\n\nexport {\n registerComponent,\n registerComponents,\n isComponentRegistered,\n whenComponentDefined,\n getComponentConstructor,\n} from './registration';\nexport type { RegisterOptions } from './registration';\nexport { ComponentRegistrationError, BatchRegistrationError } from './errors';\n"],"names":["oldValue"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuGA,MAAM,kBAAkB,CAAC,WAA4B;AACnD,SAAO,SAA0C,aAAgB;AAC/D,gBAAY,kBAAkB;AAC9B,WAAO;AAAA,EACT;AACF;AAUA,MAAM,sBAAsB,YAA8C;AAAA,EAmBxE,cAAc;AACZ,UAAA;AAhBF,SAAU,aAAgC;AAI1C,SAAU,yBAAoD,CAAA;AAC9D,SAAU,kBAAkC,IAAI,eAAA;AAChD,SAAU,sCAA4C,IAAA;AACtD,SAAQ,gBAAgB;AACxB,SAAQ,gBAAgB;AACxB,SAAQ,mBAAmB;AAE3B,SAAQ,yCAAyC,IAAA;AACjD,SAAQ,cAAc;AACtB,SAAQ,qBAAkD;AAiU1D,SAAQ,gBAAgC,CAAA;AACxC,SAAQ,mCAA4C,IAAA;AA7TlD,UAAM,cAAc,KAAK;AACzB,SAAK,SAAS,YAAY;AAE1B,QAAI,CAAC,KAAK,QAAQ;AAChB,YAAM,IAAI;AAAA,QACR;AAAA,MAAA;AAAA,IAEJ;AAEA,SAAK,UAAU,aAAa,KAAK,OAAO,OAAO;AAC/C,SAAK,mBAAmB,IAAI,gBAAgB,MAAM,KAAK,gBAAgB;AACvE,SAAK,SAAS,KAAK,aAAa,EAAE,MAAM,QAAQ;AAChD,SAAK,eAAA;AACL,SAAK,wBAAA;AAAA,EACP;AAAA,EAEA,WAAW,qBAA+B;AACxC,UAAM,eACJ,KAAK,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;AACF,UAAI,KAAK,OAAO,gBAAgB;AAC9B,aAAK,OAAO,eAAe,MAAM,KAAK,MAAM;AAAA,MAC9C;AACA,WAAK,eAAA;AAAA,IACP,SAAS,OAAO;AACd,WAAK,YAAY,yCAAyC,KAAK;AAAA,IACjE;AAAA,EACF;AAAA,EAEU,iBAAuB;AAAA,EAEjC;AAAA,EAEQ,yBAA+B;AACrC,QAAI;AACF,UAAI,KAAK,OAAO,iBAAiB;AAC/B,aAAK,OAAO,gBAAgB,MAAM,KAAK,MAAM;AAAA,MAC/C;AACA,WAAK,gBAAA;AAAA,IACP,SAAS,OAAO;AACd,WAAK,YAAY,0CAA0C,KAAK;AAAA,IAClE;AAAA,EACF;AAAA,EAEU,kBAAwB;AAAA,EAElC;AACF;AAuBA,MAAM,sBAAsB,CAAC,WAAkD;AA1tB/E,MAAA,uBAAA,OAAA;AA2tBE,0BAAA,CAAC,gBAAgB,MAAM,CAAA;AAAA,EACvB,MAAM,mBAAkB,KAAA,eAAc;AAAA,IACpC,cAAc;AACZ,YAAA;AAAA,IACF;AAAA,EAAA;AAHF,UAAA,iBAAA,EAAA;AAAM,cAAN,yCADA,uBACM,SAAA;AAAN,oBAAA,OAAA,GAAM,SAAA;AAMN,SAAO;AACT;AAmBA,MAAM,kBAAkB,CACtB,QACA,YACiB;AACjB,MAAI,UAAyD;AAC7D,SAAO,MAAM;AACX,QAAI,CAAC,SAAS;AACZ,gBAAU,oBAAoB,MAAM;AAAA,IACtC;AACA,sBAAkB,OAAO,SAAS,SAAS,OAAO;AAAA,EACpD;AACF;"}
|
|
1
|
+
{"version":3,"file":"model.js","sources":["../source/model/index.ts"],"sourcesContent":["/**\n * Custom Element Model System\n *\n * Provides a base class and utilities for creating web components with:\n * - Shadow DOM encapsulation\n * - Attribute observation and handling\n * - Slot validation\n * - Lifecycle management\n * - Error handling\n *\n * ## Key Features:\n *\n * 1. **Attribute Handling**: Automatic observation and callback execution\n * 2. **Slot Validation**: Required slots, deprecated warnings, element type checking\n * 3. **Lifecycle Hooks**: beforeConnect, afterConnect, onReady\n * 4. **Error Management**: Centralized error handling with custom events\n *\n * ## Usage:\n * ```typescript\n * const element = createCustomElement({\n * tagName: 'my-component',\n * slots: {\n * headline: { required: true, allowedElements: ['h2', 'h3'] },\n * content: { allowedElements: ['div', 'p'] }\n * },\n * attributes: [{\n * name: 'theme',\n * handler: (ref, oldValue, newValue) => {\n * // Handle theme change\n * }\n * }],\n * createComponent: (host) => {\n * // Create and return component\n * }\n * });\n * ```\n */\nimport { stylesTemplate } from '../utilities/styles';\nimport { createLogger, type Logger } from '../utilities/debug';\nimport {\n resolveAttributeConfigs,\n defineObservedAttributes,\n type ReactiveAttributeMap,\n type ResolvedAttributeConfig,\n} from '../attributes/config';\nimport { ChangeDetector } from '../attributes/change-detection';\nimport { AttributeTypeError, AttributeValidationError } from '../attributes/errors';\nimport type {\n AttributeHandlerConfig,\n AttributeElementRef,\n} from '../attributes/handler';\nimport { UpdateScheduler } from './update-cycle';\nimport {\n registerComponent,\n type RegisterOptions,\n} from './registration';\nimport type {\n SlotConfig,\n SlotValidationError,\n SlotValidationResult,\n ComponentEventDetail,\n ComponentReadyDetail,\n ComponentErrorDetail,\n ElementRef,\n PropertyValues,\n ReactiveController,\n ReactiveControllerHost,\n} from '../_types';\nimport {\n validateAllSlots,\n validateSlotElements,\n} from '../slots/slot-validation';\nimport {\n createSlotchangeHandler,\n type SlotchangeEvent,\n} from '../slots/slot-events';\nimport {\n querySlottedElements,\n querySlottedElement,\n hasSlottedContent,\n} from '../slots/slot-query';\n\ntype AttributeConfig = AttributeHandlerConfig;\n\ninterface ComponentLifecycle {\n firstConnected?: (host: HTMLElement, shadow: ShadowRoot) => void;\n willFirstUpdate?: (host: HTMLElement, shadow: ShadowRoot) => void;\n beforeConnect?: (ref: ElementRef, shadow: ShadowRoot) => void;\n afterConnect?: (ref: ElementRef, shadow: ShadowRoot) => void;\n onReady?: (ref: ElementRef, shadow: ShadowRoot) => void;\n willUpdate?: (host: HTMLElement, changedProperties: PropertyValues) => void;\n update?: (host: HTMLElement, changedProperties: PropertyValues) => void;\n updated?: (host: HTMLElement, changedProperties: PropertyValues) => void;\n}\n\ninterface ComponentConfig extends ComponentLifecycle {\n tagName: string;\n attributes?: AttributeConfig[];\n reactiveAttributes?: ReactiveAttributeMap;\n slots?: Record<string, SlotConfig>;\n createComponent: (host: HTMLElement) => ElementRef;\n}\n\n// Store the config on the constructor itself\nconst ComponentConfig = (config: ComponentConfig) => {\n return function <T extends typeof BaseComponent>(constructor: T) {\n constructor.componentConfig = config;\n return constructor;\n };\n};\n\n/**\n * Base class for all web components created by the Model system.\n * Extends HTMLElement with shadow DOM support, attribute observation,\n * slot validation, and lifecycle management.\n *\n * @internal This class is not meant to be extended directly.\n * Use `createCustomElement` to create components.\n */\nclass BaseComponent extends HTMLElement implements ReactiveControllerHost {\n static componentConfig: ComponentConfig;\n\n protected shadow: ShadowRoot;\n protected elementRef: ElementRef | null = null;\n protected config: ComponentConfig;\n protected _logger: Logger;\n\n protected _resolvedReactiveAttrs: ResolvedAttributeConfig[] = [];\n protected _changeDetector: ChangeDetector = new ChangeDetector();\n protected _reactiveValues: Map<string, unknown> = new Map();\n private _isReflecting = false;\n private _hasConnected = false;\n private _hasFirstUpdated = false;\n private _updateScheduler: UpdateScheduler;\n private _changedProperties: PropertyValues = new Map();\n private _isUpdating = false;\n private _pendingPreUpgrade: Map<string, unknown> | null = null;\n\n constructor() {\n super();\n\n const constructor = this.constructor as typeof BaseComponent;\n this.config = constructor.componentConfig;\n\n if (!this.config) {\n throw new Error(\n 'Component config not found. Did you forget to use the @Component decorator?',\n );\n }\n\n this._logger = createLogger(this.config.tagName);\n this._updateScheduler = new UpdateScheduler(() => this._performUpdate());\n this.shadow = this.attachShadow({ mode: 'open' });\n this.validateConfig();\n this.setupReactiveAttributes();\n }\n\n static get observedAttributes(): string[] {\n const handlerNames =\n this.componentConfig?.attributes?.map((attr) => attr.name) || [];\n const reactiveNames = this.componentConfig?.reactiveAttributes\n ? defineObservedAttributes(this.componentConfig.reactiveAttributes)\n : [];\n return [...new Set([...handlerNames, ...reactiveNames])];\n }\n\n connectedCallback(): void {\n try {\n this.applyPreUpgradeProperties();\n if (!this._hasConnected) {\n this._hasConnected = true;\n this.executeFirstConnected();\n }\n this.initializeComponent();\n } catch (error) {\n this.handleError('Failed to initialize component', error);\n }\n }\n\n disconnectedCallback(): void {\n this.cleanup();\n }\n\n attributeChangedCallback(\n name: string,\n oldValue: string,\n newValue: string,\n ): void {\n if (oldValue === newValue) return;\n\n try {\n this.handleAttributeChange(name, oldValue, newValue);\n } catch (error) {\n this.handleError(`Failed to handle attribute change: ${name}`, error);\n }\n }\n\n protected initializeComponent(): void {\n try {\n this.validateSlots();\n\n if (!this._hasFirstUpdated) {\n this._hasFirstUpdated = true;\n this.executeWillFirstUpdate();\n }\n\n const componentRef = this.config.createComponent(this);\n\n if (!componentRef || !componentRef.element) {\n throw new Error(\n 'Component creation failed: Invalid component reference',\n );\n }\n\n this.elementRef = componentRef;\n this.setupShadowDom(componentRef);\n this.setupSlotObservers();\n this.notifyControllers('hostConnected');\n\n if (this._changedProperties.size > 0) {\n this._updateScheduler.schedule();\n }\n\n this.afterInit();\n } catch (error) {\n this.handleError('Failed to initialize component', error);\n }\n }\n\n protected setupShadowDom(component: ElementRef): void {\n this.shadow.appendChild(\n stylesTemplate({ styles: component.styles || '' }).content.cloneNode(true),\n );\n this.shadow.appendChild(component.element);\n }\n\n protected validateConfig(): void {\n const requiredFields: (keyof ComponentConfig)[] = [\n 'tagName',\n 'createComponent',\n ];\n\n requiredFields.forEach((field) => {\n if (!this.config[field]) {\n throw new Error(`Missing required config field: ${field}`);\n }\n });\n\n if (this.config.attributes) {\n this.config.attributes.forEach((attr) => {\n if (!attr.name || !attr.handler) {\n throw new Error(\n 'Invalid attribute config: requires name and handler',\n );\n }\n });\n }\n }\n\n protected async afterInit(): Promise<void> {\n if (!this.elementRef) {\n this.handleError('Cannot initialize - missing element reference', null);\n return;\n }\n\n await this.executeLifecycleCallbacks();\n\n // Dispatch umdComponent:ready event after all lifecycle callbacks complete\n this.dispatchComponentEvent<ComponentReadyDetail>('umdComponent:ready', {\n shadowRoot: this.shadow,\n ref: this.elementRef,\n });\n }\n\n protected handleAttributeChange(\n name: string,\n oldValue: string,\n newValue: string,\n ): void {\n // Existing handler system\n if (this.elementRef) {\n const handler = this.config.attributes?.find(\n (attr) => attr.name === name,\n )?.handler;\n\n if (handler) {\n handler(\n this.elementRef as unknown as AttributeElementRef,\n oldValue,\n newValue,\n );\n }\n }\n\n // Reactive attribute system — update property from attribute\n if (!this._isReflecting) {\n const resolved = this._resolvedReactiveAttrs.find(\n (r) => r.attributeName === name,\n );\n if (resolved) {\n let converted: unknown;\n try {\n converted = resolved.converter.fromAttribute(newValue, name);\n } catch (err) {\n throw new AttributeTypeError(\n name,\n resolved.type ?? 'unknown',\n newValue,\n this.config.tagName,\n );\n }\n const value =\n converted !== undefined ? converted : resolved.defaultValue;\n\n if (value !== undefined && resolved.validate) {\n const error = resolved.validate(value);\n if (error) {\n throw new AttributeValidationError(name, error, this.config.tagName);\n }\n }\n\n // Capture old value before write\n const oldValue = this._reactiveValues.get(resolved.propertyName);\n const equalityOverride = resolved.hasChanged\n ? (prev: unknown, next: unknown) => !resolved.hasChanged!(next, prev)\n : undefined;\n const changed = this._changeDetector.set(resolved.propertyName, value, equalityOverride);\n\n // Write directly to avoid reflection loop\n this._reactiveValues.set(resolved.propertyName, value);\n\n if (changed) {\n if (resolved.onChange) {\n resolved.onChange(this, value, oldValue);\n }\n this.requestUpdate(resolved.propertyName, oldValue);\n }\n }\n }\n }\n\n /**\n * Capture a property value set on the instance before upgrade.\n * Deletes the instance property so the class accessor takes precedence,\n * then returns the captured value for re-application.\n */\n private capturePreUpgradeProperty(propertyName: string): { value: unknown; captured: boolean } {\n if (this.hasOwnProperty(propertyName)) {\n const value = (this as any)[propertyName];\n delete (this as any)[propertyName];\n return { value, captured: true };\n }\n return { value: undefined, captured: false };\n }\n\n /**\n * Apply pre-upgrade property values through reactive setters.\n * Called in connectedCallback after all attributeChangedCallback\n * calls have completed during upgrade.\n */\n private applyPreUpgradeProperties(): void {\n if (!this._pendingPreUpgrade) return;\n const pending = this._pendingPreUpgrade;\n this._pendingPreUpgrade = null;\n for (const [propertyName, value] of pending) {\n (this as any)[propertyName] = value;\n }\n }\n\n protected setupReactiveAttributes(): void {\n if (!this.config.reactiveAttributes) return;\n\n this._resolvedReactiveAttrs = resolveAttributeConfigs(\n this.config.reactiveAttributes,\n );\n\n for (const resolved of this._resolvedReactiveAttrs) {\n const { propertyName, defaultValue } = resolved;\n\n // Capture pre-upgrade instance property before defining accessor\n const preUpgrade = this.capturePreUpgradeProperty(propertyName);\n\n // Seed the initial value from the attribute (if present) or default\n if (resolved.attributeName !== false) {\n const raw = this.getAttribute(resolved.attributeName);\n if (raw !== null) {\n const converted = resolved.converter.fromAttribute(\n raw,\n resolved.attributeName,\n );\n this._reactiveValues.set(\n propertyName,\n converted !== undefined ? converted : defaultValue,\n );\n } else if (defaultValue !== undefined) {\n this._reactiveValues.set(propertyName, defaultValue);\n }\n } else if (defaultValue !== undefined) {\n this._reactiveValues.set(propertyName, defaultValue);\n }\n\n // Install property accessor on the instance\n Object.defineProperty(this, propertyName, {\n get: () => this._reactiveValues.get(propertyName),\n set: (value: unknown) => {\n if (value !== undefined && resolved.validate) {\n const error = resolved.validate(value);\n if (error) {\n const attrName =\n resolved.attributeName !== false\n ? resolved.attributeName\n : propertyName;\n throw new AttributeValidationError(attrName, error, this.config.tagName);\n }\n }\n\n const oldValue = this._reactiveValues.get(propertyName);\n const equalityOverride = resolved.hasChanged\n ? (prev: unknown, next: unknown) => !resolved.hasChanged!(next, prev)\n : undefined;\n const changed = this._changeDetector.set(propertyName, value, equalityOverride);\n if (!changed) return;\n\n this._reactiveValues.set(propertyName, value);\n\n // Reflect to attribute if configured\n if (resolved.reflect && resolved.attributeName !== false) {\n this._isReflecting = true;\n try {\n const attrValue = resolved.converter.toAttribute(value);\n if (attrValue === null) {\n this.removeAttribute(resolved.attributeName);\n } else {\n this.setAttribute(resolved.attributeName, attrValue);\n }\n } finally {\n this._isReflecting = false;\n }\n }\n\n if (resolved.onChange) {\n resolved.onChange(this, value, oldValue);\n }\n\n this.requestUpdate(propertyName, oldValue);\n },\n configurable: true,\n enumerable: true,\n });\n\n // Defer pre-upgrade value re-application to connectedCallback\n // so it runs after attributeChangedCallback during upgrade\n if (preUpgrade.captured) {\n if (!this._pendingPreUpgrade) {\n this._pendingPreUpgrade = new Map();\n }\n this._pendingPreUpgrade.set(propertyName, preUpgrade.value);\n }\n }\n }\n\n private _slotCleanups: (() => void)[] = [];\n private _controllers: Set<ReactiveController> = new Set();\n\n addController(controller: ReactiveController): void {\n this._controllers.add(controller);\n if (this.isConnected && this.elementRef) {\n controller.hostConnected?.();\n }\n }\n\n removeController(controller: ReactiveController): void {\n this._controllers.delete(controller);\n }\n\n requestUpdate(name?: string, oldValue?: unknown): void {\n if (name !== undefined && !this._changedProperties.has(name)) {\n this._changedProperties.set(name, oldValue);\n }\n if (!this._hasConnected) return;\n this._updateScheduler.schedule();\n }\n\n get updateComplete(): Promise<boolean> {\n return this._updateScheduler.updateComplete;\n }\n\n protected willUpdate(_changedProperties: PropertyValues): void {\n this.config.willUpdate?.(this, _changedProperties);\n }\n\n protected update(_changedProperties: PropertyValues): void {\n this.config.update?.(this, _changedProperties);\n }\n\n protected updated(_changedProperties: PropertyValues): void {\n this.config.updated?.(this, _changedProperties);\n }\n\n private _performUpdate(): boolean {\n if (this._isUpdating) return true;\n this._isUpdating = true;\n\n const changedProperties = this._changedProperties;\n this._changedProperties = new Map();\n\n try {\n for (const controller of this._controllers) {\n controller.hostUpdate?.();\n }\n this.willUpdate(changedProperties);\n this.update(changedProperties);\n this.updated(changedProperties);\n for (const controller of this._controllers) {\n controller.hostUpdated?.();\n }\n return true;\n } catch (error) {\n this.handleError('Error during update cycle', error);\n return false;\n } finally {\n this._isUpdating = false;\n }\n }\n\n private notifyControllers(method: 'hostConnected' | 'hostDisconnected'): void {\n for (const controller of this._controllers) {\n try {\n controller[method]?.();\n } catch (error) {\n this.handleError(`Controller ${method} failed`, error);\n }\n }\n }\n\n querySlot(slotName?: string, selector?: string): Element[] {\n return querySlottedElements(this, slotName, { selector, flatten: true });\n }\n\n querySlotElement<T extends Element = Element>(\n slotName?: string,\n selector?: string,\n ): T | null {\n return querySlottedElement<T>(this, slotName, selector);\n }\n\n hasSlotContent(slotName?: string): boolean {\n return hasSlottedContent(this, slotName);\n }\n\n protected cleanup(): void {\n this.notifyControllers('hostDisconnected');\n for (const fn of this._slotCleanups) fn();\n this._slotCleanups = [];\n this.elementRef = null;\n }\n\n /**\n * Helper method to dispatch component events with consistent structure\n */\n protected dispatchComponentEvent<T extends ComponentEventDetail>(\n eventName: string,\n detail: Omit<T, 'tagName' | 'element' | 'timestamp'>,\n ): void {\n const fullDetail = {\n ...detail,\n tagName: this.config.tagName,\n element: this,\n timestamp: Date.now(),\n } as unknown as T;\n\n this.dispatchEvent(\n new CustomEvent<T>(eventName, {\n detail: fullDetail,\n bubbles: true,\n composed: true,\n }),\n );\n }\n\n protected handleError(message: string, error: unknown): void {\n this._logger.error(message, error);\n\n // Determine error type based on component state and message\n const errorType = this.elementRef\n ? 'runtime'\n : message.toLowerCase().includes('validation')\n ? 'validation'\n : 'initialization';\n\n this.dispatchComponentEvent<ComponentErrorDetail>('umdComponent:error', {\n type: errorType,\n message,\n details: error,\n });\n }\n\n private validateSlots(): void {\n if (!this.config.slots) return;\n\n const result = validateAllSlots(this, this.config.slots);\n this.reportSlotErrors(result);\n }\n\n private reportSlotErrors(result: SlotValidationResult): void {\n if (result.isValid) return;\n\n this.handleError('Slot validation failed', result.errors);\n\n if (result.errors.length === 1) {\n this._logger.warn(result.errors[0].message);\n } else {\n this._logger.group(`${result.errors.length} slot validation warnings`);\n for (const error of result.errors) {\n this._logger.warn(error.message);\n }\n this._logger.groupEnd();\n }\n }\n\n private setupSlotObservers(): void {\n if (!this.config.slots) return;\n\n const configKeys = Object.keys(this.config.slots);\n const kebabToConfig = new Map<string, { key: string; config: SlotConfig }>();\n for (const key of configKeys) {\n const kebab = key\n .replace(/[A-Z]/g, (letter) => `-${letter.toLowerCase()}`)\n .replace(/^-/, '');\n kebabToConfig.set(kebab, { key, config: this.config.slots[key] });\n }\n\n const handler = createSlotchangeHandler(\n this,\n (event: SlotchangeEvent) => {\n const slotName = event.slotName ?? '';\n const entry = kebabToConfig.get(slotName);\n if (!entry) return;\n\n const result = validateSlotElements(entry.key, event.elements, entry.config);\n this.reportSlotErrors(result);\n },\n { flatten: true },\n );\n\n handler.connect();\n this._slotCleanups.push(() => handler.disconnect());\n }\n\n private async executeLifecycleCallbacks(): Promise<void> {\n const lifecycleMethods = [\n 'beforeConnect',\n 'afterConnect',\n 'onReady',\n ] as const;\n\n for (const method of lifecycleMethods) {\n await this.executeCallback(method);\n }\n }\n\n private async executeCallback(name: 'beforeConnect' | 'afterConnect' | 'onReady'): Promise<void> {\n const callback = this.config[name];\n\n if (!callback) {\n return;\n }\n\n try {\n await Promise.resolve(callback(this.elementRef!, this.shadow));\n } catch (error) {\n this.handleError(`Failed to execute ${name} callback`, error);\n }\n }\n\n public getRef(): ElementRef | null {\n return this.elementRef;\n }\n\n public getShadowRoot(): ShadowRoot {\n return this.shadow;\n }\n\n private executeFirstConnected(): void {\n try {\n if (this.config.firstConnected) {\n this.config.firstConnected(this, this.shadow);\n }\n this.firstConnected();\n } catch (error) {\n this.handleError('Failed to execute firstConnected hook', error);\n }\n }\n\n protected firstConnected(): void {\n // No-op. Override in subclasses.\n }\n\n private executeWillFirstUpdate(): void {\n try {\n if (this.config.willFirstUpdate) {\n this.config.willFirstUpdate(this, this.shadow);\n }\n this.willFirstUpdate();\n } catch (error) {\n this.handleError('Failed to execute willFirstUpdate hook', error);\n }\n }\n\n protected willFirstUpdate(): void {\n // No-op. Override in subclasses.\n }\n}\n\n/**\n * Factory function to create a custom element class.\n *\n * @param config - Component configuration including tagName, slots, attributes, and lifecycle hooks\n * @returns Custom element class that extends BaseComponent\n *\n * @example\n * ```typescript\n * export default () => {\n * Register.registerWebComponent({\n * name: tagName,\n * element: createCustomElement({\n * tagName,\n * slots,\n * attributes,\n * createComponent\n * })\n * });\n * };\n * ```\n */\nconst createCustomElement = (config: ComponentConfig): typeof BaseComponent => {\n @ComponentConfig(config)\n class Component extends BaseComponent {\n constructor() {\n super();\n }\n }\n\n return Component;\n};\n\n/**\n * Convenience factory that combines `createCustomElement` and `registerComponent`\n * into a single call, eliminating tagName duplication.\n *\n * @param config - Component configuration (same as `createCustomElement`)\n * @param options - Registration options (same as `registerComponent`)\n * @returns A registration function (`ComponentRegistration`)\n *\n * @example\n * ```typescript\n * export const MyComponent: ComponentRegistration = Model.defineComponent({\n * tagName: 'umd-my-component',\n * slots,\n * createComponent,\n * }, { eager: false });\n * ```\n */\nconst defineComponent = (\n config: ComponentConfig,\n options?: RegisterOptions,\n): (() => void) => {\n let element: ReturnType<typeof createCustomElement> | null = null;\n return () => {\n if (!element) {\n element = createCustomElement(config);\n }\n registerComponent(config.tagName, element, options);\n };\n};\n\nexport {\n createCustomElement,\n defineComponent,\n BaseComponent,\n type ComponentConfig,\n type AttributeConfig,\n};\n\nexport { IntersectionController, MediaQueryController } from './controllers';\nexport type { ReactiveController, ReactiveControllerHost } from '../_types';\n\nexport {\n registerComponent,\n registerComponents,\n isComponentRegistered,\n whenComponentDefined,\n getComponentConstructor,\n} from './registration';\nexport type { RegisterOptions } from './registration';\nexport { ComponentRegistrationError, BatchRegistrationError } from './errors';\n"],"names":["oldValue"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwGA,MAAM,kBAAkB,CAAC,WAA4B;AACnD,SAAO,SAA0C,aAAgB;AAC/D,gBAAY,kBAAkB;AAC9B,WAAO;AAAA,EACT;AACF;AAUA,MAAM,sBAAsB,YAA8C;AAAA,EAmBxE,cAAc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