@universityofmaryland/web-model-library 1.1.0 → 1.1.2
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/checks.d.ts +1 -0
- package/dist/attributes/checks.d.ts.map +1 -1
- package/dist/attributes/checks.js +5 -0
- package/dist/attributes/checks.js.map +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 +2 -0
- package/dist/attributes/names.d.ts.map +1 -1
- package/dist/attributes/names.js +2 -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
|
|
|
@@ -109,6 +109,7 @@ declare const isVisual: {
|
|
|
109
109
|
readonly showTime: (props: AttributeElementProps) => boolean;
|
|
110
110
|
readonly sizeLarge: (props: AttributeElementProps) => boolean;
|
|
111
111
|
readonly stickyFirst: (props: AttributeElementProps) => boolean;
|
|
112
|
+
readonly textToggle: (props: AttributeElementProps) => boolean;
|
|
112
113
|
readonly transparent: (props: AttributeElementProps) => boolean;
|
|
113
114
|
};
|
|
114
115
|
declare const getValue: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checks.d.ts","sourceRoot":"","sources":["../../source/attributes/checks.ts"],"names":[],"mappings":"AAkCA,UAAU,qBAAqB;IAE7B,OAAO,EAAE,WAAW,CAAC;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qBAAqB,KAAG,MAAM,GAAG,IAAI;sCAArC,qBAAqB,KAAG,MAAM,GAAG,IAAI;oCAArC,qBAAqB,KAAG,MAAM,GAAG,IAAI;+BAArC,qBAAqB,KAAG,MAAM,GAAG,IAAI;gCAArC,qBAAqB,KAAG,MAAM,GAAG,IAAI;8CAArC,qBAAqB,KAAG,MAAM,GAAG,IAAI;uCAArC,qBAAqB,KAAG,MAAM,GAAG,IAAI;2CAArC,qBAAqB,KAAG,MAAM,GAAG,IAAI;yCAArC,qBAAqB,KAAG,MAAM,GAAG,IAAI;kCAArC,qBAAqB,KAAG,MAAM,GAAG,IAAI;wCAArC,qBAAqB,KAAG,MAAM,GAAG,IAAI;iCAuyBtC,qBAAqB;gCAvyBpB,qBAAqB,KAAG,MAAM,GAAG,IAAI;CAozBlD,CAAC;AAGX,OAAO,EACL,OAAO,EACP,aAAa,EACb,eAAe,EACf,SAAS,EACT,MAAM,EACN,MAAM,EACN,QAAQ,EACR,SAAS,EACT,eAAe,EACf,OAAO,EACP,QAAQ,EACR,QAAQ,GACT,CAAC;AAEF,YAAY,EACV,qBAAqB,EACrB,cAAc,EACd,kBAAkB,EAClB,wBAAwB,GACzB,CAAC"}
|
|
@@ -683,6 +683,11 @@ const isVisual = {
|
|
|
683
683
|
AttributeValues.state.TRUE,
|
|
684
684
|
true
|
|
685
685
|
),
|
|
686
|
+
textToggle: createAttributeCheck(
|
|
687
|
+
AttributeNames.visual.textToggle,
|
|
688
|
+
AttributeValues.state.TRUE,
|
|
689
|
+
true
|
|
690
|
+
),
|
|
686
691
|
transparent: (props) => checkDeprecatedAttribute({
|
|
687
692
|
...props,
|
|
688
693
|
attributeNameOld: AttributeNames.deprecated.visual.VISUAL_TRANSPARENT,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checks.js","sources":["../../source/attributes/checks.ts"],"sourcesContent":["/**\n * Attribute Check Utilities\n *\n * Provides a comprehensive set of functions to check attribute states on HTML elements.\n * These utilities form the foundation of the component attribute system.\n *\n * ## Function Categories:\n *\n * 1. **isTheme**: Theme-related checks (dark, light, gold, maryland)\n * 2. **isVisual**: Visual state checks (aligned, bordered, transparent, etc.)\n * 3. **isDisplay**: Display mode checks (feature, list, promo, etc.)\n * 4. **isLayout**: Layout configuration checks (fixed, hidden, position)\n * 5. **isInfo**: Content type checks (admissions, events, news, etc.)\n * 6. **includesFeature**: Feature flag checks (animation, lazyLoad, etc.)\n * 7. **getValue**: Attribute value getters (url, title, styleProps)\n *\n * ## Naming Convention:\n * - `is*` functions return boolean values\n * - `includes*` functions check for feature presence\n * - `getValue*` functions return string values\n *\n * ## Deprecation Handling:\n * Many functions handle both current (data-*) and deprecated attribute names,\n * logging warnings when deprecated attributes are used.\n */\nimport * as Styles from '@universityofmaryland/web-styles-library';\nimport { AttributeNames } from './names';\nimport { AttributeValues } from './values';\nimport { devWarning } from './errors';\n\n// Types\n/**\n * Properties for attribute checking functions\n */\ninterface AttributeElementProps {\n /** The HTML element to check attributes on */\n element: HTMLElement;\n /** Default value to return if attribute is not found */\n defaultValue?: boolean;\n}\n\ninterface AttributeProps extends AttributeElementProps {\n attributeName: string;\n attributeValue: string;\n}\n\ntype AttributeNullProps = Omit<AttributeProps, 'attributeValue'>;\n\ninterface DeprecatedAttributeProps extends AttributeElementProps {\n attributeNameOld: string;\n attributeNameNew: string;\n attributeValue: string;\n}\n\ninterface ValueGetterConfig {\n currentName: string;\n deprecatedName?: string;\n}\n\n// Core attribute check utilities\n\n/**\n * Checks if an attribute equals a specific value.\n * Returns defaultValue if attribute is not present.\n * Special handling: 'false' string always returns false.\n *\n * @internal\n */\nconst isAttributeTrue = ({\n element,\n attributeName,\n attributeValue,\n defaultValue = false,\n}: AttributeProps): boolean => {\n const value = element.getAttribute(attributeName);\n\n if (value === null) {\n return defaultValue;\n }\n\n if (value === 'false') {\n return false;\n }\n\n return value === attributeValue;\n};\n\nconst isAttributeNotNull = ({\n element,\n attributeName,\n}: AttributeNullProps): boolean => {\n const value = element.getAttribute(attributeName);\n\n if (value === 'true') return true;\n if (value === 'false') return false;\n\n return value !== null;\n};\n\nconst deprecationWarning = ({\n element,\n attributeNameOld,\n attributeNameNew,\n}: {\n element: HTMLElement;\n attributeNameOld: string;\n attributeNameNew: string;\n}) => {\n devWarning(\n `UMD Web Component: ${element.nodeName} - Attribute \"${attributeNameOld}\" is deprecated. ` +\n `Use \"${attributeNameNew}\" instead. This attribute will be removed in version 2.0.`,\n );\n};\n\nconst checkDeprecatedAttribute = (props: DeprecatedAttributeProps): boolean => {\n const {\n element,\n attributeNameOld,\n attributeNameNew,\n attributeValue,\n ...rest\n } = props;\n const isDeprecatedUsed = isAttributeTrue({\n ...rest,\n element,\n attributeName: attributeNameOld,\n attributeValue,\n });\n\n if (isDeprecatedUsed) {\n deprecationWarning(props);\n return true;\n }\n\n return false;\n};\n\nconst createAttributeCheck =\n (attributeName: string, attributeValue: string, defaultValue = false) =>\n (props: AttributeElementProps): boolean =>\n isAttributeTrue({\n ...props,\n attributeName,\n attributeValue,\n defaultValue,\n });\n\nconst createValueGetter = ({\n currentName,\n deprecatedName,\n}: ValueGetterConfig) => {\n return ({ element }: AttributeElementProps): string | null => {\n if (deprecatedName) {\n const deprecatedValue = element.getAttribute(deprecatedName);\n if (deprecatedValue !== null) {\n deprecationWarning({\n element,\n attributeNameOld: deprecatedName,\n attributeNameNew: currentName,\n });\n\n return deprecatedValue;\n }\n }\n\n const value = element.getAttribute(currentName);\n if (value !== null) {\n return value;\n }\n\n return null;\n };\n};\n\n// Value checks with null checks\nconst hasInfo = {\n gifts: (props: AttributeElementProps) =>\n isAttributeNotNull({\n ...props,\n attributeName: AttributeNames.information.gift,\n }),\n search: (props: AttributeElementProps) =>\n isAttributeNotNull({\n ...props,\n attributeName: AttributeNames.information.search,\n }),\n};\n\n// Decoration checks\nconst hasDecoration = {\n line: (props: AttributeElementProps): boolean =>\n checkDeprecatedAttribute({\n ...props,\n attributeNameOld: AttributeNames.deprecated.option.OPTIONAL_HAS_LINE,\n attributeNameNew: AttributeNames.decoration.line,\n attributeValue: '',\n }) ||\n isAttributeNotNull({\n ...props,\n attributeName: AttributeNames.decoration.line,\n }),\n};\n\n// Feature checks\nconst includesFeature = {\n animation: createAttributeCheck(\n AttributeNames.feature.animation,\n AttributeValues.state.TRUE,\n true,\n ),\n imageExpand: createAttributeCheck(\n AttributeNames.feature.imageExpand,\n AttributeValues.state.TRUE,\n true,\n ),\n fullScreenOption: createAttributeCheck(\n AttributeNames.deprecated.feature.FULLSCREEN,\n AttributeValues.state.TRUE,\n true,\n ),\n visualTime: createAttributeCheck(\n AttributeNames.deprecated.feature.SHOW_TIME,\n AttributeValues.state.TRUE,\n true,\n ),\n lazyLoad: (props: AttributeElementProps): boolean =>\n checkDeprecatedAttribute({\n ...props,\n attributeNameOld: AttributeNames.deprecated.feed.FEED_LAZY_LOAD,\n attributeNameNew: AttributeNames.feature.lazyLoad,\n attributeValue: AttributeValues.state.TRUE,\n }) ||\n isAttributeTrue({\n ...props,\n attributeName: AttributeNames.feature.lazyLoad,\n attributeValue: AttributeValues.state.TRUE,\n }),\n} as const;\n\n// Data checks\nconst isData = {\n type: {\n academic: (props: AttributeElementProps): boolean =>\n checkDeprecatedAttribute({\n ...props,\n attributeNameOld: AttributeNames.deprecated.type.TYPE,\n attributeNameNew: AttributeNames.feed.type,\n attributeValue: AttributeValues.data.type.academic,\n }) ||\n isAttributeTrue({\n ...props,\n attributeName: AttributeNames.feed.type,\n attributeValue: AttributeValues.data.type.academic,\n }),\n },\n union: (props: AttributeElementProps): boolean =>\n checkDeprecatedAttribute({\n ...props,\n attributeNameOld: AttributeNames.deprecated.feed.FEED_UNION,\n attributeNameNew: AttributeNames.feed.union,\n attributeValue: AttributeValues.state.TRUE,\n }) ||\n isAttributeTrue({\n ...props,\n attributeName: AttributeNames.feed.union,\n attributeValue: AttributeValues.state.TRUE,\n defaultValue: true,\n }),\n} as const;\n\n// Display checks\nconst isDisplay = {\n block: (props: AttributeElementProps): boolean =>\n checkDeprecatedAttribute({\n ...props,\n attributeNameOld: AttributeNames.deprecated.display.DISPLAY_TYPE,\n attributeNameNew: AttributeNames.display.default,\n attributeValue: AttributeValues.display.block,\n }) ||\n isAttributeTrue({\n ...props,\n attributeName: AttributeNames.display.default,\n attributeValue: AttributeValues.display.block,\n }),\n feature: createAttributeCheck(\n AttributeNames.deprecated.display.DISPLAY,\n AttributeValues.display.feature,\n ),\n featured: (props: AttributeElementProps): boolean =>\n checkDeprecatedAttribute({\n ...props,\n attributeNameOld: AttributeNames.deprecated.type.TYPE,\n attributeNameNew: AttributeNames.display.default,\n attributeValue: AttributeValues.display.featured,\n }) ||\n isAttributeTrue({\n ...props,\n attributeName: AttributeNames.display.default,\n attributeValue: AttributeValues.display.featured,\n }),\n hero: (props: AttributeElementProps): boolean =>\n checkDeprecatedAttribute({\n ...props,\n attributeNameOld: AttributeNames.deprecated.type.TYPE,\n attributeNameNew: AttributeNames.display.default,\n attributeValue: AttributeValues.display.hero,\n }) ||\n isAttributeTrue({\n ...props,\n attributeName: AttributeNames.display.default,\n attributeValue: AttributeValues.display.hero,\n }),\n list: (props: AttributeElementProps): boolean =>\n checkDeprecatedAttribute({\n ...props,\n attributeNameOld: AttributeNames.deprecated.display.DISPLAY,\n attributeNameNew: AttributeNames.display.default,\n attributeValue: AttributeValues.display.list,\n }) ||\n isAttributeTrue({\n ...props,\n attributeName: AttributeNames.display.default,\n attributeValue: AttributeValues.display.list,\n }),\n outline: (props: AttributeElementProps): boolean =>\n checkDeprecatedAttribute({\n ...props,\n attributeNameOld: AttributeNames.deprecated.type.TYPE,\n attributeNameNew: AttributeNames.display.default,\n attributeValue: AttributeValues.type.OUTLINE,\n }) ||\n isAttributeTrue({\n ...props,\n attributeName: AttributeNames.display.default,\n attributeValue: AttributeValues.type.OUTLINE,\n }),\n overlay: (props: AttributeElementProps): boolean =>\n checkDeprecatedAttribute({\n ...props,\n attributeNameOld: AttributeNames.deprecated.type.TYPE,\n attributeNameNew: AttributeNames.display.default,\n attributeValue: AttributeValues.display.overlay,\n }) ||\n isAttributeTrue({\n ...props,\n attributeName: AttributeNames.display.default,\n attributeValue: AttributeValues.display.overlay,\n }),\n promo: createAttributeCheck(\n AttributeNames.deprecated.display.DISPLAY,\n AttributeValues.display.promo,\n ),\n primary: (props: AttributeElementProps): boolean =>\n checkDeprecatedAttribute({\n ...props,\n attributeNameOld: AttributeNames.deprecated.type.TYPE,\n attributeNameNew: AttributeNames.display.default,\n attributeValue: AttributeValues.type.PRIMARY,\n }) ||\n isAttributeTrue({\n ...props,\n attributeName: AttributeNames.display.default,\n attributeValue: AttributeValues.type.PRIMARY,\n }),\n secondary: (props: AttributeElementProps): boolean =>\n checkDeprecatedAttribute({\n ...props,\n attributeNameOld: AttributeNames.deprecated.type.TYPE,\n attributeNameNew: AttributeNames.display.default,\n attributeValue: AttributeValues.type.SECONDARY,\n }) ||\n isAttributeTrue({\n ...props,\n attributeName: AttributeNames.display.default,\n attributeValue: AttributeValues.type.SECONDARY,\n }),\n short: createAttributeCheck(\n AttributeNames.display.default,\n AttributeValues.display.short,\n ),\n standardCentered: (props: AttributeElementProps): boolean =>\n checkDeprecatedAttribute({\n ...props,\n attributeNameOld: AttributeNames.deprecated.type.TYPE,\n attributeNameNew: AttributeNames.display.default,\n attributeValue: AttributeValues.layout.defaultCentered,\n }) ||\n isAttributeTrue({\n ...props,\n attributeName: AttributeNames.deprecated.type.TYPE,\n attributeValue: AttributeValues.layout.defaultCentered,\n }),\n standardInterior: (props: AttributeElementProps): boolean =>\n checkDeprecatedAttribute({\n ...props,\n attributeNameOld: AttributeNames.deprecated.type.TYPE,\n attributeNameNew: AttributeNames.display.default,\n attributeValue: AttributeValues.layout.defaultInterior,\n }) ||\n isAttributeTrue({\n ...props,\n attributeName: AttributeNames.deprecated.type.TYPE,\n attributeValue: AttributeValues.layout.defaultInterior,\n }),\n standardInteriorCentered: (props: AttributeElementProps): boolean =>\n checkDeprecatedAttribute({\n ...props,\n attributeNameOld: AttributeNames.deprecated.type.TYPE,\n attributeNameNew: AttributeNames.display.default,\n attributeValue: AttributeValues.layout.defaultInteriorCentered,\n }) ||\n isAttributeTrue({\n ...props,\n attributeName: AttributeNames.deprecated.type.TYPE,\n attributeValue: AttributeValues.layout.defaultInteriorCentered,\n }),\n statement: (props: AttributeElementProps): boolean =>\n checkDeprecatedAttribute({\n ...props,\n attributeNameOld: AttributeNames.deprecated.display.DISPLAY,\n attributeNameNew: AttributeNames.display.default,\n attributeValue: AttributeValues.display.statement,\n }) ||\n isAttributeTrue({\n ...props,\n attributeName: AttributeNames.display.default,\n attributeValue: AttributeValues.display.statement,\n }),\n sticky: (props: AttributeElementProps): boolean =>\n checkDeprecatedAttribute({\n ...props,\n attributeNameOld: AttributeNames.deprecated.type.TYPE,\n attributeNameNew: AttributeNames.display.default,\n attributeValue: AttributeValues.display.sticky,\n }) ||\n isAttributeTrue({\n ...props,\n attributeName: AttributeNames.display.default,\n attributeValue: AttributeValues.display.sticky,\n }),\n stacked: (props: AttributeElementProps): boolean =>\n checkDeprecatedAttribute({\n ...props,\n attributeNameOld: AttributeNames.deprecated.type.TYPE,\n attributeNameNew: AttributeNames.display.default,\n attributeValue: AttributeValues.display.stacked,\n }) ||\n isAttributeTrue({\n ...props,\n attributeName: AttributeNames.display.default,\n attributeValue: AttributeValues.display.stacked,\n }),\n stackedInteriorDeprecated: createAttributeCheck(\n AttributeNames.deprecated.type.TYPE,\n AttributeValues.layout.stackedInterior,\n ),\n stackedInterior: (props: AttributeElementProps): boolean =>\n checkDeprecatedAttribute({\n ...props,\n attributeNameOld: AttributeNames.deprecated.type.TYPE,\n attributeNameNew: AttributeNames.display.default,\n attributeValue: AttributeValues.layout.stackedInterior,\n }) ||\n isAttributeTrue({\n ...props,\n attributeName: AttributeNames.display.default,\n attributeValue: AttributeValues.layout.stackedInterior,\n }),\n tabular: (props: AttributeElementProps): boolean =>\n checkDeprecatedAttribute({\n ...props,\n attributeNameOld: AttributeNames.deprecated.display.DISPLAY,\n attributeNameNew: AttributeNames.display.default,\n attributeValue: AttributeValues.display.tabular,\n }) ||\n isAttributeTrue({\n ...props,\n attributeName: AttributeNames.display.default,\n attributeValue: AttributeValues.display.tabular,\n }),\n mega: (props: AttributeElementProps): boolean =>\n checkDeprecatedAttribute({\n ...props,\n attributeNameOld: AttributeNames.deprecated.type.DATA_TYPE,\n attributeNameNew: AttributeNames.display.default,\n attributeValue: AttributeValues.display.mega,\n }) ||\n checkDeprecatedAttribute({\n ...props,\n attributeNameOld: AttributeNames.deprecated.type.TYPE,\n attributeNameNew: AttributeNames.display.default,\n attributeValue: AttributeValues.display.mega,\n }) ||\n isAttributeTrue({\n ...props,\n attributeName: AttributeNames.display.default,\n attributeValue: AttributeValues.display.mega,\n }),\n visual: (props: AttributeElementProps): boolean =>\n checkDeprecatedAttribute({\n ...props,\n attributeNameOld: AttributeNames.deprecated.type.DATA_TYPE,\n attributeNameNew: AttributeNames.display.default,\n attributeValue: AttributeValues.display.visual,\n }) ||\n checkDeprecatedAttribute({\n ...props,\n attributeNameOld: AttributeNames.deprecated.type.TYPE,\n attributeNameNew: AttributeNames.display.default,\n attributeValue: AttributeValues.display.visual,\n }) ||\n isAttributeTrue({\n ...props,\n attributeName: AttributeNames.display.default,\n attributeValue: AttributeValues.display.visual,\n }),\n simple: (props: AttributeElementProps): boolean =>\n checkDeprecatedAttribute({\n ...props,\n attributeNameOld: AttributeNames.deprecated.type.DATA_TYPE,\n attributeNameNew: AttributeNames.display.default,\n attributeValue: AttributeValues.display.simple,\n }) ||\n checkDeprecatedAttribute({\n ...props,\n attributeNameOld: AttributeNames.deprecated.type.TYPE,\n attributeNameNew: AttributeNames.display.default,\n attributeValue: AttributeValues.display.simple,\n }) ||\n isAttributeTrue({\n ...props,\n attributeName: AttributeNames.display.default,\n attributeValue: AttributeValues.display.simple,\n }),\n} as const;\n\n// Information checks\nconst isInfo = {\n admissions: createAttributeCheck(\n AttributeNames.information.admissions,\n AttributeValues.state.TRUE,\n ),\n events: createAttributeCheck(\n AttributeNames.information.events,\n AttributeValues.state.TRUE,\n ),\n news: createAttributeCheck(\n AttributeNames.information.news,\n AttributeValues.state.TRUE,\n ),\n schools: createAttributeCheck(\n AttributeNames.information.schools,\n AttributeValues.state.TRUE,\n ),\n searchDomain: createAttributeCheck(\n AttributeNames.information.searchType,\n AttributeValues.search.domain,\n ),\n} as const;\n\n// Layout checks\nconst isLayout = {\n alertOff: createAttributeCheck(\n AttributeNames.layout.alertOff,\n AttributeValues.state.TRUE,\n ),\n alignmentRight: (props: AttributeElementProps): boolean =>\n checkDeprecatedAttribute({\n ...props,\n attributeNameOld: AttributeNames.deprecated.layout.LAYOUT_ALIGNMENT,\n attributeNameNew: AttributeNames.layout.alignment,\n attributeValue: AttributeValues.layout.right,\n }) ||\n isAttributeTrue({\n ...props,\n attributeName: AttributeNames.layout.alignment,\n attributeValue: AttributeValues.layout.right,\n }),\n fixed: (props: AttributeElementProps): boolean =>\n checkDeprecatedAttribute({\n ...props,\n attributeNameOld: AttributeNames.deprecated.layout.LAYOUT_FIXED,\n attributeNameNew: AttributeNames.layout.fixed,\n attributeValue: '',\n }) ||\n isAttributeTrue({\n ...props,\n attributeName: AttributeNames.layout.fixed,\n attributeValue: AttributeValues.state.TRUE,\n }),\n fullImage: createAttributeCheck(\n AttributeNames.deprecated.type.TYPE,\n AttributeValues.layout.fullImage,\n ),\n heightSmall: (props: AttributeElementProps): boolean =>\n isAttributeTrue({\n ...props,\n attributeName: AttributeNames.layout.height,\n attributeValue: AttributeValues.layout.small,\n }),\n hidden: createAttributeCheck(\n AttributeNames.layout.hidden,\n AttributeValues.state.TRUE,\n ),\n image: createAttributeCheck(\n AttributeNames.deprecated.type.TYPE,\n AttributeValues.display.image,\n ),\n imagePositionRight: (props: AttributeElementProps): boolean =>\n checkDeprecatedAttribute({\n ...props,\n attributeNameOld: AttributeNames.deprecated.layout.LAYOUT_IMAGE_POSITION,\n attributeNameNew: AttributeNames.layout.imagePosition,\n attributeValue: AttributeValues.layout.right,\n }) ||\n isAttributeTrue({\n ...props,\n attributeName: AttributeNames.layout.imagePosition,\n attributeValue: AttributeValues.layout.right,\n defaultValue: true,\n }),\n imagePositionLeft: (props: AttributeElementProps): boolean =>\n checkDeprecatedAttribute({\n ...props,\n attributeNameOld: AttributeNames.deprecated.layout.LAYOUT_IMAGE_POSITION,\n attributeNameNew: AttributeNames.layout.imagePosition,\n attributeValue: AttributeValues.layout.left,\n }) ||\n isAttributeTrue({\n ...props,\n attributeName: AttributeNames.layout.imagePosition,\n attributeValue: AttributeValues.layout.left,\n defaultValue: false,\n }),\n imageScaled: (props: AttributeElementProps): boolean =>\n isAttributeTrue({\n ...props,\n attributeName: AttributeNames.layout.imageScaled,\n attributeValue: AttributeValues.state.TRUE,\n defaultValue: true,\n }),\n interior: createAttributeCheck(\n AttributeNames.layout.interior,\n AttributeValues.state.TRUE,\n ),\n lock: createAttributeCheck(\n AttributeNames.layout.lock,\n AttributeValues.state.TRUE,\n ),\n lockFull: createAttributeCheck(\n AttributeNames.layout.lock,\n AttributeValues.layout.large,\n ),\n reverse: (props: AttributeElementProps): boolean =>\n checkDeprecatedAttribute({\n ...props,\n attributeNameOld: AttributeNames.deprecated.layout.DEFAULT,\n attributeNameNew: AttributeNames.layout.reverse,\n attributeValue: AttributeValues.state.TRUE,\n }) ||\n isAttributeTrue({\n ...props,\n attributeName: AttributeNames.layout.reverse,\n attributeValue: AttributeValues.state.TRUE,\n }),\n spaceHorizontalLarge: (props: AttributeElementProps): boolean =>\n isAttributeTrue({\n ...props,\n attributeName: AttributeNames.layout.spaceHorizontal,\n attributeValue: AttributeValues.layout.large,\n }),\n textCentered: (props: AttributeElementProps): boolean =>\n checkDeprecatedAttribute({\n ...props,\n attributeNameOld: AttributeNames.deprecated.visual.VISUAL_TEXT_CENTER,\n attributeNameNew: AttributeNames.layout.text,\n attributeValue: AttributeValues.layout.center,\n }) ||\n isAttributeTrue({\n ...props,\n attributeName: AttributeNames.layout.text,\n attributeValue: AttributeValues.layout.center,\n }),\n} as const;\n\n// Social checks\n\nconst isSharing = {\n email: createAttributeCheck(\n AttributeNames.sharing.email,\n AttributeValues.state.TRUE,\n ),\n print: createAttributeCheck(\n AttributeNames.sharing.print,\n AttributeValues.state.TRUE,\n ),\n} as const;\n\nconst includesSharing = {\n facebook: createAttributeCheck(\n AttributeNames.social.facebook,\n AttributeValues.state.TRUE,\n true,\n ),\n twitter: createAttributeCheck(\n AttributeNames.social.twitter,\n AttributeValues.state.TRUE,\n true,\n ),\n} as const;\n\n// Theme checks\nconst isTheme = {\n dark: (props: AttributeElementProps): boolean =>\n checkDeprecatedAttribute({\n ...props,\n attributeNameOld: AttributeNames.deprecated.theme.THEME_DEPRECATD,\n attributeNameNew: AttributeNames.theme.default,\n attributeValue: AttributeValues.theme.DARK,\n }) ||\n isAttributeTrue({\n ...props,\n attributeName: AttributeNames.theme.default,\n attributeValue: AttributeValues.theme.DARK,\n }),\n gold: (props: AttributeElementProps): boolean =>\n checkDeprecatedAttribute({\n ...props,\n attributeNameOld: AttributeNames.deprecated.theme.THEME_DEPRECATD,\n attributeNameNew: AttributeNames.theme.default,\n attributeValue: AttributeValues.theme.GOLD,\n }) ||\n isAttributeTrue({\n ...props,\n attributeName: AttributeNames.theme.default,\n attributeValue: AttributeValues.theme.GOLD,\n }),\n light: (props: AttributeElementProps): boolean =>\n checkDeprecatedAttribute({\n ...props,\n attributeNameOld: AttributeNames.deprecated.theme.THEME_DEPRECATD,\n attributeNameNew: AttributeNames.theme.default,\n attributeValue: AttributeValues.theme.LIGHT,\n }) ||\n isAttributeTrue({\n ...props,\n attributeName: AttributeNames.theme.default,\n attributeValue: AttributeValues.theme.LIGHT,\n }),\n maryland: (props: AttributeElementProps): boolean =>\n checkDeprecatedAttribute({\n ...props,\n attributeNameOld: AttributeNames.deprecated.theme.THEME_DEPRECATD,\n attributeNameNew: AttributeNames.theme.default,\n attributeValue: AttributeValues.theme.MARYLAND,\n }) ||\n isAttributeTrue({\n ...props,\n attributeName: AttributeNames.theme.default,\n attributeValue: AttributeValues.theme.MARYLAND,\n }),\n} as const;\n\n// Visual checks\nconst isVisual = {\n aligned: (props: AttributeElementProps): boolean =>\n checkDeprecatedAttribute({\n ...props,\n attributeNameOld: AttributeNames.deprecated.visual.VISUAL_ALIGN,\n attributeNameNew: AttributeNames.visual.imageAligned,\n attributeValue: AttributeValues.state.TRUE,\n }) ||\n isAttributeTrue({\n ...props,\n attributeName: AttributeNames.visual.imageAligned,\n attributeValue: AttributeValues.state.TRUE,\n }),\n bordered: (props: AttributeElementProps): boolean =>\n checkDeprecatedAttribute({\n ...props,\n attributeNameOld: AttributeNames.deprecated.visual.VISUAL_BORDER,\n attributeNameNew: AttributeNames.visual.bordered,\n attributeValue: AttributeValues.state.TRUE,\n }) ||\n isAttributeTrue({\n ...props,\n attributeName: AttributeNames.visual.bordered,\n attributeValue: AttributeValues.state.TRUE,\n }),\n campaign: createAttributeCheck(\n AttributeNames.visual.campaign,\n AttributeValues.campaign.forward,\n ),\n icon_seal: (props: AttributeElementProps): boolean =>\n checkDeprecatedAttribute({\n ...props,\n attributeNameOld: AttributeNames.deprecated.visual.VISUAL_HAS_LOGO,\n attributeNameNew: AttributeNames.visual.iconSeal,\n attributeValue: AttributeValues.state.TRUE,\n }) ||\n isAttributeTrue({\n ...props,\n attributeName: AttributeNames.visual.iconSeal,\n attributeValue: AttributeValues.state.TRUE,\n }),\n open: (props: AttributeElementProps): boolean =>\n checkDeprecatedAttribute({\n ...props,\n attributeNameOld: AttributeNames.deprecated.state.STATE_DEPRECATD,\n attributeNameNew: AttributeNames.visual.open,\n attributeValue: AttributeValues.state.OPENED,\n }) ||\n isAttributeTrue({\n ...props,\n attributeName: AttributeNames.visual.open,\n attributeValue: AttributeValues.state.TRUE,\n }),\n play: createAttributeCheck(\n AttributeNames.visual.play,\n AttributeValues.state.TRUE,\n ),\n quote: createAttributeCheck(\n AttributeNames.deprecated.visual.VISUAL_QUOTE,\n AttributeValues.state.TRUE,\n ),\n showIcon: (props: AttributeElementProps): boolean =>\n checkDeprecatedAttribute({\n ...props,\n attributeNameOld: AttributeNames.deprecated.visual.VISUAL_ICON,\n attributeNameNew: AttributeNames.visual.icon,\n attributeValue: AttributeValues.state.TRUE,\n }) ||\n isAttributeTrue({\n ...props,\n attributeName: AttributeNames.visual.icon,\n attributeValue: AttributeValues.state.TRUE,\n }),\n sizeNormal: (props: AttributeElementProps): boolean =>\n checkDeprecatedAttribute({\n ...props,\n attributeNameOld: AttributeNames.deprecated.display.DISPLAY_SIZE,\n attributeNameNew: AttributeNames.visual.size,\n attributeValue: AttributeValues.size.NORMAL,\n }) ||\n isAttributeTrue({\n ...props,\n attributeName: AttributeNames.visual.size,\n attributeValue: AttributeValues.size.NORMAL,\n }),\n showTime: (props: AttributeElementProps): boolean =>\n checkDeprecatedAttribute({\n ...props,\n attributeNameOld: AttributeNames.deprecated.feature.SHOW_TIME,\n attributeNameNew: AttributeNames.visual.time,\n attributeValue: AttributeValues.state.TRUE,\n }) ||\n isAttributeTrue({\n ...props,\n attributeName: AttributeNames.visual.time,\n attributeValue: AttributeValues.state.TRUE,\n defaultValue: true,\n }),\n sizeLarge: (props: AttributeElementProps): boolean =>\n checkDeprecatedAttribute({\n ...props,\n attributeNameOld: AttributeNames.deprecated.display.DISPLAY_SIZE,\n attributeNameNew: AttributeNames.visual.size,\n attributeValue: AttributeValues.size.LARGE,\n }) ||\n checkDeprecatedAttribute({\n ...props,\n attributeNameOld: AttributeNames.deprecated.display.DISPLAY_SIZE,\n attributeNameNew: AttributeNames.visual.size,\n attributeValue: '',\n }) ||\n isAttributeTrue({\n ...props,\n attributeName: AttributeNames.visual.size,\n attributeValue: AttributeValues.size.LARGE,\n }),\n stickyFirst: createAttributeCheck(\n AttributeNames.deprecated.option.OPTIONAL_STICKY_FIRST,\n AttributeValues.state.TRUE,\n true,\n ),\n transparent: (props: AttributeElementProps): boolean =>\n checkDeprecatedAttribute({\n ...props,\n attributeNameOld: AttributeNames.deprecated.visual.VISUAL_TRANSPARENT,\n attributeNameNew: AttributeNames.visual.transparent,\n attributeValue: AttributeValues.state.TRUE,\n }) ||\n isAttributeTrue({\n ...props,\n attributeName: AttributeNames.visual.transparent,\n attributeValue: AttributeValues.state.TRUE,\n }),\n} as const;\n\n// Value getters\nconst getValue = {\n alertUrl: createValueGetter({\n currentName: AttributeNames.information.alertUrl,\n }),\n loadingPriority: createValueGetter({\n currentName: AttributeNames.loading.priority,\n }),\n daysToHide: createValueGetter({\n currentName: AttributeNames.visual.hiddenDays,\n deprecatedName: AttributeNames.deprecated.visual.VISUAL_DAYS_TO_HIDE,\n }),\n feedEntryRemoveIds: createValueGetter({\n currentName: AttributeNames.information.removeIds,\n deprecatedName: AttributeNames.deprecated.feed.FEED_NOT_ENTRIES,\n }),\n feedFilterIds: createValueGetter({\n currentName: AttributeNames.information.filterIds,\n deprecatedName: AttributeNames.deprecated.feed.FEED_CATEGORIES,\n }),\n feedToken: createValueGetter({\n currentName: AttributeNames.information.token,\n deprecatedName: AttributeNames.deprecated.feed.FEED_TOKEN,\n }),\n giftUrl: createValueGetter({\n currentName: AttributeNames.information.gift,\n }),\n id: createValueGetter({\n currentName: AttributeNames.information.id,\n }),\n ids: createValueGetter({\n currentName: AttributeNames.information.ids,\n }),\n layoutColumnCount: createValueGetter({\n currentName: AttributeNames.layout.columnCount,\n deprecatedName: AttributeNames.deprecated.feed.FEED_COLUMN_COUNT,\n }),\n layoutLock: createValueGetter({\n currentName: AttributeNames.layout.lock,\n }),\n layoutRowCount: createValueGetter({\n currentName: AttributeNames.layout.rowCount,\n deprecatedName: AttributeNames.deprecated.feed.FEED_ROW_COUNT,\n }),\n mediaTrained: createValueGetter({\n currentName: AttributeNames.information.mediaTrained,\n }),\n title: createValueGetter({\n currentName: AttributeNames.information.title,\n }),\n topPosition: createValueGetter({\n currentName: AttributeNames.layout.position,\n deprecatedName: AttributeNames.deprecated.layout.LAYOUT_STICKY_TOP,\n }),\n styleProps: (props: AttributeElementProps) => {\n const cssString = createValueGetter({\n ...props,\n currentName: AttributeNames.deprecated.visual.VISUAL_STYLE_PROPS,\n });\n\n if (cssString && typeof cssString === 'string') {\n return Styles.utilities.create.jss.objectFromString(cssString);\n }\n },\n url: createValueGetter({\n currentName: AttributeNames.information.url,\n }),\n} as const;\n\n// Public API\nexport {\n hasInfo,\n hasDecoration,\n includesFeature,\n isDisplay,\n isData,\n isInfo,\n isLayout,\n isSharing,\n includesSharing,\n isTheme,\n isVisual,\n getValue,\n};\n\nexport type {\n AttributeElementProps,\n AttributeProps,\n AttributeNullProps,\n DeprecatedAttributeProps,\n};\n"],"names":[],"mappings":";;;;AAoEA,MAAM,kBAAkB,CAAC;AAAA,EACvB;AAAA,EACA;AAAA,EACA;AAAA,EACA,eAAe;AACjB,MAA+B;AAC7B,QAAM,QAAQ,QAAQ,aAAa,aAAa;AAEhD,MAAI,UAAU,MAAM;AAClB,WAAO;AAAA,EACT;AAEA,MAAI,UAAU,SAAS;AACrB,WAAO;AAAA,EACT;AAEA,SAAO,UAAU;AACnB;AAEA,MAAM,qBAAqB,CAAC;AAAA,EAC1B;AAAA,EACA;AACF,MAAmC;AACjC,QAAM,QAAQ,QAAQ,aAAa,aAAa;AAEhD,MAAI,UAAU,OAAQ,QAAO;AAC7B,MAAI,UAAU,QAAS,QAAO;AAE9B,SAAO,UAAU;AACnB;AAEA,MAAM,qBAAqB,CAAC;AAAA,EAC1B;AAAA,EACA;AAAA,EACA;AACF,MAIM;AACJ;AAAA,IACE,sBAAsB,QAAQ,QAAQ,iBAAiB,gBAAgB,yBAC7D,gBAAgB;AAAA,EAAA;AAE9B;AAEA,MAAM,2BAA2B,CAAC,UAA6C;AAC7E,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,GAAG;AAAA,EAAA,IACD;AACJ,QAAM,mBAAmB,gBAAgB;AAAA,IACvC,GAAG;AAAA,IACH;AAAA,IACA,eAAe;AAAA,IACf;AAAA,EAAA,CACD;A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AAS;AAAA,IAC/D;AAAA,EACF;AAAA,EACA,KAAK,kBAAkB;AAAA,IACrB,aAAa,eAAe,YAAY;AAAA,EAAA,CACzC;AACH;"}
|
|
1
|
+
{"version":3,"file":"checks.js","sources":["../../source/attributes/checks.ts"],"sourcesContent":["/**\n * Attribute Check Utilities\n *\n * Provides a comprehensive set of functions to check attribute states on HTML elements.\n * These utilities form the foundation of the component attribute system.\n *\n * ## Function Categories:\n *\n * 1. **isTheme**: Theme-related checks (dark, light, gold, maryland)\n * 2. **isVisual**: Visual state checks (aligned, bordered, transparent, etc.)\n * 3. **isDisplay**: Display mode checks (feature, list, promo, etc.)\n * 4. **isLayout**: Layout configuration checks (fixed, hidden, position)\n * 5. **isInfo**: Content type checks (admissions, events, news, etc.)\n * 6. **includesFeature**: Feature flag checks (animation, lazyLoad, etc.)\n * 7. **getValue**: Attribute value getters (url, title, styleProps)\n *\n * ## Naming Convention:\n * - `is*` functions return boolean values\n * - `includes*` functions check for feature presence\n * - `getValue*` functions return string values\n *\n * ## Deprecation Handling:\n * Many functions handle both current (data-*) and deprecated attribute names,\n * logging warnings when deprecated attributes are used.\n */\nimport * as Styles from '@universityofmaryland/web-styles-library';\nimport { AttributeNames } from './names';\nimport { AttributeValues } from './values';\nimport { devWarning } from './errors';\n\n// Types\n/**\n * Properties for attribute checking functions\n */\ninterface AttributeElementProps {\n /** The HTML element to check attributes on */\n element: HTMLElement;\n /** Default value to return if attribute is not found */\n defaultValue?: boolean;\n}\n\ninterface AttributeProps extends AttributeElementProps {\n attributeName: string;\n attributeValue: string;\n}\n\ntype AttributeNullProps = Omit<AttributeProps, 'attributeValue'>;\n\ninterface DeprecatedAttributeProps extends AttributeElementProps {\n attributeNameOld: string;\n attributeNameNew: string;\n attributeValue: string;\n}\n\ninterface ValueGetterConfig {\n currentName: string;\n deprecatedName?: string;\n}\n\n// Core attribute check utilities\n\n/**\n * Checks if an attribute equals a specific value.\n * Returns defaultValue if attribute is not present.\n * Special handling: 'false' string always returns false.\n *\n * @internal\n */\nconst isAttributeTrue = ({\n element,\n attributeName,\n attributeValue,\n defaultValue = false,\n}: AttributeProps): boolean => {\n const value = element.getAttribute(attributeName);\n\n if (value === null) {\n return defaultValue;\n }\n\n if (value === 'false') {\n return false;\n }\n\n return value === attributeValue;\n};\n\nconst isAttributeNotNull = ({\n element,\n attributeName,\n}: AttributeNullProps): boolean => {\n const value = element.getAttribute(attributeName);\n\n if (value === 'true') return true;\n if (value === 'false') return false;\n\n return value !== null;\n};\n\nconst deprecationWarning = ({\n element,\n attributeNameOld,\n attributeNameNew,\n}: {\n element: HTMLElement;\n attributeNameOld: string;\n attributeNameNew: string;\n}) => {\n devWarning(\n `UMD Web Component: ${element.nodeName} - Attribute \"${attributeNameOld}\" is deprecated. ` +\n `Use \"${attributeNameNew}\" instead. This attribute will be removed in version 2.0.`,\n );\n};\n\nconst checkDeprecatedAttribute = (props: DeprecatedAttributeProps): boolean => {\n const {\n element,\n attributeNameOld,\n attributeNameNew,\n attributeValue,\n ...rest\n } = props;\n const isDeprecatedUsed = isAttributeTrue({\n ...rest,\n element,\n attributeName: attributeNameOld,\n attributeValue,\n });\n\n if (isDeprecatedUsed) {\n deprecationWarning(props);\n return true;\n }\n\n return false;\n};\n\nconst createAttributeCheck =\n (attributeName: string, attributeValue: string, defaultValue = false) =>\n (props: AttributeElementProps): boolean =>\n isAttributeTrue({\n ...props,\n attributeName,\n attributeValue,\n defaultValue,\n });\n\nconst createValueGetter = ({\n currentName,\n deprecatedName,\n}: ValueGetterConfig) => {\n return ({ element }: AttributeElementProps): string | null => {\n if (deprecatedName) {\n const deprecatedValue = element.getAttribute(deprecatedName);\n if (deprecatedValue !== null) {\n deprecationWarning({\n element,\n attributeNameOld: deprecatedName,\n attributeNameNew: currentName,\n });\n\n return deprecatedValue;\n }\n }\n\n const value = element.getAttribute(currentName);\n if (value !== null) {\n return value;\n }\n\n return null;\n };\n};\n\n// Value checks with null checks\nconst hasInfo = {\n gifts: (props: AttributeElementProps) =>\n isAttributeNotNull({\n ...props,\n attributeName: AttributeNames.information.gift,\n }),\n search: (props: AttributeElementProps) =>\n isAttributeNotNull({\n ...props,\n attributeName: AttributeNames.information.search,\n }),\n};\n\n// Decoration checks\nconst hasDecoration = {\n line: (props: AttributeElementProps): boolean =>\n checkDeprecatedAttribute({\n ...props,\n attributeNameOld: AttributeNames.deprecated.option.OPTIONAL_HAS_LINE,\n attributeNameNew: AttributeNames.decoration.line,\n attributeValue: '',\n }) ||\n isAttributeNotNull({\n ...props,\n attributeName: AttributeNames.decoration.line,\n }),\n};\n\n// Feature checks\nconst includesFeature = {\n animation: createAttributeCheck(\n AttributeNames.feature.animation,\n AttributeValues.state.TRUE,\n true,\n ),\n imageExpand: createAttributeCheck(\n AttributeNames.feature.imageExpand,\n AttributeValues.state.TRUE,\n true,\n ),\n fullScreenOption: createAttributeCheck(\n AttributeNames.deprecated.feature.FULLSCREEN,\n AttributeValues.state.TRUE,\n true,\n ),\n visualTime: createAttributeCheck(\n AttributeNames.deprecated.feature.SHOW_TIME,\n AttributeValues.state.TRUE,\n true,\n ),\n lazyLoad: (props: AttributeElementProps): boolean =>\n checkDeprecatedAttribute({\n ...props,\n attributeNameOld: AttributeNames.deprecated.feed.FEED_LAZY_LOAD,\n attributeNameNew: AttributeNames.feature.lazyLoad,\n attributeValue: AttributeValues.state.TRUE,\n }) ||\n isAttributeTrue({\n ...props,\n attributeName: AttributeNames.feature.lazyLoad,\n attributeValue: AttributeValues.state.TRUE,\n }),\n} as const;\n\n// Data checks\nconst isData = {\n type: {\n academic: (props: AttributeElementProps): boolean =>\n checkDeprecatedAttribute({\n ...props,\n attributeNameOld: AttributeNames.deprecated.type.TYPE,\n attributeNameNew: AttributeNames.feed.type,\n attributeValue: AttributeValues.data.type.academic,\n }) ||\n isAttributeTrue({\n ...props,\n attributeName: AttributeNames.feed.type,\n attributeValue: AttributeValues.data.type.academic,\n }),\n },\n union: (props: AttributeElementProps): boolean =>\n checkDeprecatedAttribute({\n ...props,\n attributeNameOld: AttributeNames.deprecated.feed.FEED_UNION,\n attributeNameNew: AttributeNames.feed.union,\n attributeValue: AttributeValues.state.TRUE,\n }) ||\n isAttributeTrue({\n ...props,\n attributeName: AttributeNames.feed.union,\n attributeValue: AttributeValues.state.TRUE,\n defaultValue: true,\n }),\n} as const;\n\n// Display checks\nconst isDisplay = {\n block: (props: AttributeElementProps): boolean =>\n checkDeprecatedAttribute({\n ...props,\n attributeNameOld: AttributeNames.deprecated.display.DISPLAY_TYPE,\n attributeNameNew: AttributeNames.display.default,\n attributeValue: AttributeValues.display.block,\n }) ||\n isAttributeTrue({\n ...props,\n attributeName: AttributeNames.display.default,\n attributeValue: AttributeValues.display.block,\n }),\n feature: createAttributeCheck(\n AttributeNames.deprecated.display.DISPLAY,\n AttributeValues.display.feature,\n ),\n featured: (props: AttributeElementProps): boolean =>\n checkDeprecatedAttribute({\n ...props,\n attributeNameOld: AttributeNames.deprecated.type.TYPE,\n attributeNameNew: AttributeNames.display.default,\n attributeValue: AttributeValues.display.featured,\n }) ||\n isAttributeTrue({\n ...props,\n attributeName: AttributeNames.display.default,\n attributeValue: AttributeValues.display.featured,\n }),\n hero: (props: AttributeElementProps): boolean =>\n checkDeprecatedAttribute({\n ...props,\n attributeNameOld: AttributeNames.deprecated.type.TYPE,\n attributeNameNew: AttributeNames.display.default,\n attributeValue: AttributeValues.display.hero,\n }) ||\n isAttributeTrue({\n ...props,\n attributeName: AttributeNames.display.default,\n attributeValue: AttributeValues.display.hero,\n }),\n list: (props: AttributeElementProps): boolean =>\n checkDeprecatedAttribute({\n ...props,\n attributeNameOld: AttributeNames.deprecated.display.DISPLAY,\n attributeNameNew: AttributeNames.display.default,\n attributeValue: AttributeValues.display.list,\n }) ||\n isAttributeTrue({\n ...props,\n attributeName: AttributeNames.display.default,\n attributeValue: AttributeValues.display.list,\n }),\n outline: (props: AttributeElementProps): boolean =>\n checkDeprecatedAttribute({\n ...props,\n attributeNameOld: AttributeNames.deprecated.type.TYPE,\n attributeNameNew: AttributeNames.display.default,\n attributeValue: AttributeValues.type.OUTLINE,\n }) ||\n isAttributeTrue({\n ...props,\n attributeName: AttributeNames.display.default,\n attributeValue: AttributeValues.type.OUTLINE,\n }),\n overlay: (props: AttributeElementProps): boolean =>\n checkDeprecatedAttribute({\n ...props,\n attributeNameOld: AttributeNames.deprecated.type.TYPE,\n attributeNameNew: AttributeNames.display.default,\n attributeValue: AttributeValues.display.overlay,\n }) ||\n isAttributeTrue({\n ...props,\n attributeName: AttributeNames.display.default,\n attributeValue: AttributeValues.display.overlay,\n }),\n promo: createAttributeCheck(\n AttributeNames.deprecated.display.DISPLAY,\n AttributeValues.display.promo,\n ),\n primary: (props: AttributeElementProps): boolean =>\n checkDeprecatedAttribute({\n ...props,\n attributeNameOld: AttributeNames.deprecated.type.TYPE,\n attributeNameNew: AttributeNames.display.default,\n attributeValue: AttributeValues.type.PRIMARY,\n }) ||\n isAttributeTrue({\n ...props,\n attributeName: AttributeNames.display.default,\n attributeValue: AttributeValues.type.PRIMARY,\n }),\n secondary: (props: AttributeElementProps): boolean =>\n checkDeprecatedAttribute({\n ...props,\n attributeNameOld: AttributeNames.deprecated.type.TYPE,\n attributeNameNew: AttributeNames.display.default,\n attributeValue: AttributeValues.type.SECONDARY,\n }) ||\n isAttributeTrue({\n ...props,\n attributeName: AttributeNames.display.default,\n attributeValue: AttributeValues.type.SECONDARY,\n }),\n short: createAttributeCheck(\n AttributeNames.display.default,\n AttributeValues.display.short,\n ),\n standardCentered: (props: AttributeElementProps): boolean =>\n checkDeprecatedAttribute({\n ...props,\n attributeNameOld: AttributeNames.deprecated.type.TYPE,\n attributeNameNew: AttributeNames.display.default,\n attributeValue: AttributeValues.layout.defaultCentered,\n }) ||\n isAttributeTrue({\n ...props,\n attributeName: AttributeNames.deprecated.type.TYPE,\n attributeValue: AttributeValues.layout.defaultCentered,\n }),\n standardInterior: (props: AttributeElementProps): boolean =>\n checkDeprecatedAttribute({\n ...props,\n attributeNameOld: AttributeNames.deprecated.type.TYPE,\n attributeNameNew: AttributeNames.display.default,\n attributeValue: AttributeValues.layout.defaultInterior,\n }) ||\n isAttributeTrue({\n ...props,\n attributeName: AttributeNames.deprecated.type.TYPE,\n attributeValue: AttributeValues.layout.defaultInterior,\n }),\n standardInteriorCentered: (props: AttributeElementProps): boolean =>\n checkDeprecatedAttribute({\n ...props,\n attributeNameOld: AttributeNames.deprecated.type.TYPE,\n attributeNameNew: AttributeNames.display.default,\n attributeValue: AttributeValues.layout.defaultInteriorCentered,\n }) ||\n isAttributeTrue({\n ...props,\n attributeName: AttributeNames.deprecated.type.TYPE,\n attributeValue: AttributeValues.layout.defaultInteriorCentered,\n }),\n statement: (props: AttributeElementProps): boolean =>\n checkDeprecatedAttribute({\n ...props,\n attributeNameOld: AttributeNames.deprecated.display.DISPLAY,\n attributeNameNew: AttributeNames.display.default,\n attributeValue: AttributeValues.display.statement,\n }) ||\n isAttributeTrue({\n ...props,\n attributeName: AttributeNames.display.default,\n attributeValue: AttributeValues.display.statement,\n }),\n sticky: (props: AttributeElementProps): boolean =>\n checkDeprecatedAttribute({\n ...props,\n attributeNameOld: AttributeNames.deprecated.type.TYPE,\n attributeNameNew: AttributeNames.display.default,\n attributeValue: AttributeValues.display.sticky,\n }) ||\n isAttributeTrue({\n ...props,\n attributeName: AttributeNames.display.default,\n attributeValue: AttributeValues.display.sticky,\n }),\n stacked: (props: AttributeElementProps): boolean =>\n checkDeprecatedAttribute({\n ...props,\n attributeNameOld: AttributeNames.deprecated.type.TYPE,\n attributeNameNew: AttributeNames.display.default,\n attributeValue: AttributeValues.display.stacked,\n }) ||\n isAttributeTrue({\n ...props,\n attributeName: AttributeNames.display.default,\n attributeValue: AttributeValues.display.stacked,\n }),\n stackedInteriorDeprecated: createAttributeCheck(\n AttributeNames.deprecated.type.TYPE,\n AttributeValues.layout.stackedInterior,\n ),\n stackedInterior: (props: AttributeElementProps): boolean =>\n checkDeprecatedAttribute({\n ...props,\n attributeNameOld: AttributeNames.deprecated.type.TYPE,\n attributeNameNew: AttributeNames.display.default,\n attributeValue: AttributeValues.layout.stackedInterior,\n }) ||\n isAttributeTrue({\n ...props,\n attributeName: AttributeNames.display.default,\n attributeValue: AttributeValues.layout.stackedInterior,\n }),\n tabular: (props: AttributeElementProps): boolean =>\n checkDeprecatedAttribute({\n ...props,\n attributeNameOld: AttributeNames.deprecated.display.DISPLAY,\n attributeNameNew: AttributeNames.display.default,\n attributeValue: AttributeValues.display.tabular,\n }) ||\n isAttributeTrue({\n ...props,\n attributeName: AttributeNames.display.default,\n attributeValue: AttributeValues.display.tabular,\n }),\n mega: (props: AttributeElementProps): boolean =>\n checkDeprecatedAttribute({\n ...props,\n attributeNameOld: AttributeNames.deprecated.type.DATA_TYPE,\n attributeNameNew: AttributeNames.display.default,\n attributeValue: AttributeValues.display.mega,\n }) ||\n checkDeprecatedAttribute({\n ...props,\n attributeNameOld: AttributeNames.deprecated.type.TYPE,\n attributeNameNew: AttributeNames.display.default,\n attributeValue: AttributeValues.display.mega,\n }) ||\n isAttributeTrue({\n ...props,\n attributeName: AttributeNames.display.default,\n attributeValue: AttributeValues.display.mega,\n }),\n visual: (props: AttributeElementProps): boolean =>\n checkDeprecatedAttribute({\n ...props,\n attributeNameOld: AttributeNames.deprecated.type.DATA_TYPE,\n attributeNameNew: AttributeNames.display.default,\n attributeValue: AttributeValues.display.visual,\n }) ||\n checkDeprecatedAttribute({\n ...props,\n attributeNameOld: AttributeNames.deprecated.type.TYPE,\n attributeNameNew: AttributeNames.display.default,\n attributeValue: AttributeValues.display.visual,\n }) ||\n isAttributeTrue({\n ...props,\n attributeName: AttributeNames.display.default,\n attributeValue: AttributeValues.display.visual,\n }),\n simple: (props: AttributeElementProps): boolean =>\n checkDeprecatedAttribute({\n ...props,\n attributeNameOld: AttributeNames.deprecated.type.DATA_TYPE,\n attributeNameNew: AttributeNames.display.default,\n attributeValue: AttributeValues.display.simple,\n }) ||\n checkDeprecatedAttribute({\n ...props,\n attributeNameOld: AttributeNames.deprecated.type.TYPE,\n attributeNameNew: AttributeNames.display.default,\n attributeValue: AttributeValues.display.simple,\n }) ||\n isAttributeTrue({\n ...props,\n attributeName: AttributeNames.display.default,\n attributeValue: AttributeValues.display.simple,\n }),\n} as const;\n\n// Information checks\nconst isInfo = {\n admissions: createAttributeCheck(\n AttributeNames.information.admissions,\n AttributeValues.state.TRUE,\n ),\n events: createAttributeCheck(\n AttributeNames.information.events,\n AttributeValues.state.TRUE,\n ),\n news: createAttributeCheck(\n AttributeNames.information.news,\n AttributeValues.state.TRUE,\n ),\n schools: createAttributeCheck(\n AttributeNames.information.schools,\n AttributeValues.state.TRUE,\n ),\n searchDomain: createAttributeCheck(\n AttributeNames.information.searchType,\n AttributeValues.search.domain,\n ),\n} as const;\n\n// Layout checks\nconst isLayout = {\n alertOff: createAttributeCheck(\n AttributeNames.layout.alertOff,\n AttributeValues.state.TRUE,\n ),\n alignmentRight: (props: AttributeElementProps): boolean =>\n checkDeprecatedAttribute({\n ...props,\n attributeNameOld: AttributeNames.deprecated.layout.LAYOUT_ALIGNMENT,\n attributeNameNew: AttributeNames.layout.alignment,\n attributeValue: AttributeValues.layout.right,\n }) ||\n isAttributeTrue({\n ...props,\n attributeName: AttributeNames.layout.alignment,\n attributeValue: AttributeValues.layout.right,\n }),\n fixed: (props: AttributeElementProps): boolean =>\n checkDeprecatedAttribute({\n ...props,\n attributeNameOld: AttributeNames.deprecated.layout.LAYOUT_FIXED,\n attributeNameNew: AttributeNames.layout.fixed,\n attributeValue: '',\n }) ||\n isAttributeTrue({\n ...props,\n attributeName: AttributeNames.layout.fixed,\n attributeValue: AttributeValues.state.TRUE,\n }),\n fullImage: createAttributeCheck(\n AttributeNames.deprecated.type.TYPE,\n AttributeValues.layout.fullImage,\n ),\n heightSmall: (props: AttributeElementProps): boolean =>\n isAttributeTrue({\n ...props,\n attributeName: AttributeNames.layout.height,\n attributeValue: AttributeValues.layout.small,\n }),\n hidden: createAttributeCheck(\n AttributeNames.layout.hidden,\n AttributeValues.state.TRUE,\n ),\n image: createAttributeCheck(\n AttributeNames.deprecated.type.TYPE,\n AttributeValues.display.image,\n ),\n imagePositionRight: (props: AttributeElementProps): boolean =>\n checkDeprecatedAttribute({\n ...props,\n attributeNameOld: AttributeNames.deprecated.layout.LAYOUT_IMAGE_POSITION,\n attributeNameNew: AttributeNames.layout.imagePosition,\n attributeValue: AttributeValues.layout.right,\n }) ||\n isAttributeTrue({\n ...props,\n attributeName: AttributeNames.layout.imagePosition,\n attributeValue: AttributeValues.layout.right,\n defaultValue: true,\n }),\n imagePositionLeft: (props: AttributeElementProps): boolean =>\n checkDeprecatedAttribute({\n ...props,\n attributeNameOld: AttributeNames.deprecated.layout.LAYOUT_IMAGE_POSITION,\n attributeNameNew: AttributeNames.layout.imagePosition,\n attributeValue: AttributeValues.layout.left,\n }) ||\n isAttributeTrue({\n ...props,\n attributeName: AttributeNames.layout.imagePosition,\n attributeValue: AttributeValues.layout.left,\n defaultValue: false,\n }),\n imageScaled: (props: AttributeElementProps): boolean =>\n isAttributeTrue({\n ...props,\n attributeName: AttributeNames.layout.imageScaled,\n attributeValue: AttributeValues.state.TRUE,\n defaultValue: true,\n }),\n interior: createAttributeCheck(\n AttributeNames.layout.interior,\n AttributeValues.state.TRUE,\n ),\n lock: createAttributeCheck(\n AttributeNames.layout.lock,\n AttributeValues.state.TRUE,\n ),\n lockFull: createAttributeCheck(\n AttributeNames.layout.lock,\n AttributeValues.layout.large,\n ),\n reverse: (props: AttributeElementProps): boolean =>\n checkDeprecatedAttribute({\n ...props,\n attributeNameOld: AttributeNames.deprecated.layout.DEFAULT,\n attributeNameNew: AttributeNames.layout.reverse,\n attributeValue: AttributeValues.state.TRUE,\n }) ||\n isAttributeTrue({\n ...props,\n attributeName: AttributeNames.layout.reverse,\n attributeValue: AttributeValues.state.TRUE,\n }),\n spaceHorizontalLarge: (props: AttributeElementProps): boolean =>\n isAttributeTrue({\n ...props,\n attributeName: AttributeNames.layout.spaceHorizontal,\n attributeValue: AttributeValues.layout.large,\n }),\n textCentered: (props: AttributeElementProps): boolean =>\n checkDeprecatedAttribute({\n ...props,\n attributeNameOld: AttributeNames.deprecated.visual.VISUAL_TEXT_CENTER,\n attributeNameNew: AttributeNames.layout.text,\n attributeValue: AttributeValues.layout.center,\n }) ||\n isAttributeTrue({\n ...props,\n attributeName: AttributeNames.layout.text,\n attributeValue: AttributeValues.layout.center,\n }),\n} as const;\n\n// Social checks\n\nconst isSharing = {\n email: createAttributeCheck(\n AttributeNames.sharing.email,\n AttributeValues.state.TRUE,\n ),\n print: createAttributeCheck(\n AttributeNames.sharing.print,\n AttributeValues.state.TRUE,\n ),\n} as const;\n\nconst includesSharing = {\n facebook: createAttributeCheck(\n AttributeNames.social.facebook,\n AttributeValues.state.TRUE,\n true,\n ),\n twitter: createAttributeCheck(\n AttributeNames.social.twitter,\n AttributeValues.state.TRUE,\n true,\n ),\n} as const;\n\n// Theme checks\nconst isTheme = {\n dark: (props: AttributeElementProps): boolean =>\n checkDeprecatedAttribute({\n ...props,\n attributeNameOld: AttributeNames.deprecated.theme.THEME_DEPRECATD,\n attributeNameNew: AttributeNames.theme.default,\n attributeValue: AttributeValues.theme.DARK,\n }) ||\n isAttributeTrue({\n ...props,\n attributeName: AttributeNames.theme.default,\n attributeValue: AttributeValues.theme.DARK,\n }),\n gold: (props: AttributeElementProps): boolean =>\n checkDeprecatedAttribute({\n ...props,\n attributeNameOld: AttributeNames.deprecated.theme.THEME_DEPRECATD,\n attributeNameNew: AttributeNames.theme.default,\n attributeValue: AttributeValues.theme.GOLD,\n }) ||\n isAttributeTrue({\n ...props,\n attributeName: AttributeNames.theme.default,\n attributeValue: AttributeValues.theme.GOLD,\n }),\n light: (props: AttributeElementProps): boolean =>\n checkDeprecatedAttribute({\n ...props,\n attributeNameOld: AttributeNames.deprecated.theme.THEME_DEPRECATD,\n attributeNameNew: AttributeNames.theme.default,\n attributeValue: AttributeValues.theme.LIGHT,\n }) ||\n isAttributeTrue({\n ...props,\n attributeName: AttributeNames.theme.default,\n attributeValue: AttributeValues.theme.LIGHT,\n }),\n maryland: (props: AttributeElementProps): boolean =>\n checkDeprecatedAttribute({\n ...props,\n attributeNameOld: AttributeNames.deprecated.theme.THEME_DEPRECATD,\n attributeNameNew: AttributeNames.theme.default,\n attributeValue: AttributeValues.theme.MARYLAND,\n }) ||\n isAttributeTrue({\n ...props,\n attributeName: AttributeNames.theme.default,\n attributeValue: AttributeValues.theme.MARYLAND,\n }),\n} as const;\n\n// Visual checks\nconst isVisual = {\n aligned: (props: AttributeElementProps): boolean =>\n checkDeprecatedAttribute({\n ...props,\n attributeNameOld: AttributeNames.deprecated.visual.VISUAL_ALIGN,\n attributeNameNew: AttributeNames.visual.imageAligned,\n attributeValue: AttributeValues.state.TRUE,\n }) ||\n isAttributeTrue({\n ...props,\n attributeName: AttributeNames.visual.imageAligned,\n attributeValue: AttributeValues.state.TRUE,\n }),\n bordered: (props: AttributeElementProps): boolean =>\n checkDeprecatedAttribute({\n ...props,\n attributeNameOld: AttributeNames.deprecated.visual.VISUAL_BORDER,\n attributeNameNew: AttributeNames.visual.bordered,\n attributeValue: AttributeValues.state.TRUE,\n }) ||\n isAttributeTrue({\n ...props,\n attributeName: AttributeNames.visual.bordered,\n attributeValue: AttributeValues.state.TRUE,\n }),\n campaign: createAttributeCheck(\n AttributeNames.visual.campaign,\n AttributeValues.campaign.forward,\n ),\n icon_seal: (props: AttributeElementProps): boolean =>\n checkDeprecatedAttribute({\n ...props,\n attributeNameOld: AttributeNames.deprecated.visual.VISUAL_HAS_LOGO,\n attributeNameNew: AttributeNames.visual.iconSeal,\n attributeValue: AttributeValues.state.TRUE,\n }) ||\n isAttributeTrue({\n ...props,\n attributeName: AttributeNames.visual.iconSeal,\n attributeValue: AttributeValues.state.TRUE,\n }),\n open: (props: AttributeElementProps): boolean =>\n checkDeprecatedAttribute({\n ...props,\n attributeNameOld: AttributeNames.deprecated.state.STATE_DEPRECATD,\n attributeNameNew: AttributeNames.visual.open,\n attributeValue: AttributeValues.state.OPENED,\n }) ||\n isAttributeTrue({\n ...props,\n attributeName: AttributeNames.visual.open,\n attributeValue: AttributeValues.state.TRUE,\n }),\n play: createAttributeCheck(\n AttributeNames.visual.play,\n AttributeValues.state.TRUE,\n ),\n quote: createAttributeCheck(\n AttributeNames.deprecated.visual.VISUAL_QUOTE,\n AttributeValues.state.TRUE,\n ),\n showIcon: (props: AttributeElementProps): boolean =>\n checkDeprecatedAttribute({\n ...props,\n attributeNameOld: AttributeNames.deprecated.visual.VISUAL_ICON,\n attributeNameNew: AttributeNames.visual.icon,\n attributeValue: AttributeValues.state.TRUE,\n }) ||\n isAttributeTrue({\n ...props,\n attributeName: AttributeNames.visual.icon,\n attributeValue: AttributeValues.state.TRUE,\n }),\n sizeNormal: (props: AttributeElementProps): boolean =>\n checkDeprecatedAttribute({\n ...props,\n attributeNameOld: AttributeNames.deprecated.display.DISPLAY_SIZE,\n attributeNameNew: AttributeNames.visual.size,\n attributeValue: AttributeValues.size.NORMAL,\n }) ||\n isAttributeTrue({\n ...props,\n attributeName: AttributeNames.visual.size,\n attributeValue: AttributeValues.size.NORMAL,\n }),\n showTime: (props: AttributeElementProps): boolean =>\n checkDeprecatedAttribute({\n ...props,\n attributeNameOld: AttributeNames.deprecated.feature.SHOW_TIME,\n attributeNameNew: AttributeNames.visual.time,\n attributeValue: AttributeValues.state.TRUE,\n }) ||\n isAttributeTrue({\n ...props,\n attributeName: AttributeNames.visual.time,\n attributeValue: AttributeValues.state.TRUE,\n defaultValue: true,\n }),\n sizeLarge: (props: AttributeElementProps): boolean =>\n checkDeprecatedAttribute({\n ...props,\n attributeNameOld: AttributeNames.deprecated.display.DISPLAY_SIZE,\n attributeNameNew: AttributeNames.visual.size,\n attributeValue: AttributeValues.size.LARGE,\n }) ||\n checkDeprecatedAttribute({\n ...props,\n attributeNameOld: AttributeNames.deprecated.display.DISPLAY_SIZE,\n attributeNameNew: AttributeNames.visual.size,\n attributeValue: '',\n }) ||\n isAttributeTrue({\n ...props,\n attributeName: AttributeNames.visual.size,\n attributeValue: AttributeValues.size.LARGE,\n }),\n stickyFirst: createAttributeCheck(\n AttributeNames.deprecated.option.OPTIONAL_STICKY_FIRST,\n AttributeValues.state.TRUE,\n true,\n ),\n textToggle: createAttributeCheck(\n AttributeNames.visual.textToggle,\n AttributeValues.state.TRUE,\n true,\n ),\n transparent: (props: AttributeElementProps): boolean =>\n checkDeprecatedAttribute({\n ...props,\n attributeNameOld: AttributeNames.deprecated.visual.VISUAL_TRANSPARENT,\n attributeNameNew: AttributeNames.visual.transparent,\n attributeValue: AttributeValues.state.TRUE,\n }) ||\n isAttributeTrue({\n ...props,\n attributeName: AttributeNames.visual.transparent,\n attributeValue: AttributeValues.state.TRUE,\n }),\n} as const;\n\n// Value getters\nconst getValue = {\n alertUrl: createValueGetter({\n currentName: AttributeNames.information.alertUrl,\n }),\n loadingPriority: createValueGetter({\n currentName: AttributeNames.loading.priority,\n }),\n daysToHide: createValueGetter({\n currentName: AttributeNames.visual.hiddenDays,\n deprecatedName: AttributeNames.deprecated.visual.VISUAL_DAYS_TO_HIDE,\n }),\n feedEntryRemoveIds: createValueGetter({\n currentName: AttributeNames.information.removeIds,\n deprecatedName: AttributeNames.deprecated.feed.FEED_NOT_ENTRIES,\n }),\n feedFilterIds: createValueGetter({\n currentName: AttributeNames.information.filterIds,\n deprecatedName: AttributeNames.deprecated.feed.FEED_CATEGORIES,\n }),\n feedToken: createValueGetter({\n currentName: AttributeNames.information.token,\n deprecatedName: AttributeNames.deprecated.feed.FEED_TOKEN,\n }),\n giftUrl: createValueGetter({\n currentName: AttributeNames.information.gift,\n }),\n id: createValueGetter({\n currentName: AttributeNames.information.id,\n }),\n ids: createValueGetter({\n currentName: AttributeNames.information.ids,\n }),\n layoutColumnCount: createValueGetter({\n currentName: AttributeNames.layout.columnCount,\n deprecatedName: AttributeNames.deprecated.feed.FEED_COLUMN_COUNT,\n }),\n layoutLock: createValueGetter({\n currentName: AttributeNames.layout.lock,\n }),\n layoutRowCount: createValueGetter({\n currentName: AttributeNames.layout.rowCount,\n deprecatedName: AttributeNames.deprecated.feed.FEED_ROW_COUNT,\n }),\n mediaTrained: createValueGetter({\n currentName: AttributeNames.information.mediaTrained,\n }),\n title: createValueGetter({\n currentName: AttributeNames.information.title,\n }),\n topPosition: createValueGetter({\n currentName: AttributeNames.layout.position,\n deprecatedName: AttributeNames.deprecated.layout.LAYOUT_STICKY_TOP,\n }),\n styleProps: (props: AttributeElementProps) => {\n const cssString = createValueGetter({\n ...props,\n currentName: AttributeNames.deprecated.visual.VISUAL_STYLE_PROPS,\n });\n\n if (cssString && typeof cssString === 'string') {\n return Styles.utilities.create.jss.objectFromString(cssString);\n }\n },\n url: createValueGetter({\n currentName: AttributeNames.information.url,\n }),\n} as const;\n\n// Public API\nexport {\n hasInfo,\n hasDecoration,\n includesFeature,\n isDisplay,\n isData,\n isInfo,\n isLayout,\n isSharing,\n includesSharing,\n isTheme,\n isVisual,\n getValue,\n};\n\nexport type {\n AttributeElementProps,\n AttributeProps,\n AttributeNullProps,\n DeprecatedAttributeProps,\n};\n"],"names":[],"mappings":";;;;AAoEA,MAAM,kBAAkB,CAAC;AAAA,EACvB;AAAA,EACA;AAAA,EACA;AAAA,EACA,eAAe;AACjB,MAA+B;AAC7B,QAAM,QAAQ,QAAQ,aAAa,aAAa;AAEhD,MAAI,UAAU,MAAM;AAClB,WAAO;AAAA,EACT;AAEA,MAAI,UAAU,SAAS;AACrB,WAAO;AAAA,EACT;AAEA,SAAO,UAAU;AACnB;AAEA,MAAM,qBAAqB,CAAC;AAAA,EAC1B;AAAA,EACA;AACF,MAAmC;AACjC,QAAM,QAAQ,QAAQ,aAAa,aAAa;AAEhD,MAAI,UAAU,OAAQ,QAAO;AAC7B,MAAI,UAAU,QAAS,QAAO;AAE9B,SAAO,UAAU;AACnB;AAEA,MAAM,qBAAqB,CAAC;AAAA,EAC1B;AAAA,EACA;AAAA,EACA;AACF,MAIM;AACJ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AAA,CACzC;AAAA,EACD,OAAO,kBAAkB;AAAA,IACvB,aAAa,eAAe,YAAY;AAAA,EAAA,CACzC;AAAA,EACD,aAAa,kBAAkB;AAAA,IAC7B,aAAa,eAAe,OAAO;AAAA,IACnC,gBAAgB,eAAe,WAAW,OAAO;AAAA,EAAA,CAClD;AAAA,EACD,YAAY,CAAC,UAAiC;AAC5C,UAAM,YAAY,kBAAkB;AAAA,MAClC,GAAG;AAAA,MACH,aAAa,eAAe,WAAW,OAAO;AAAA,IAAA,CAC/C;AAED,QAAI,aAAa,OAAO,cAAc,UAAU;AAC9C,aAAO,OAAO,UAAU,OAAO,IAAI,iBAAiB,SAAS;AAAA,IAC/D;AAAA,EACF;AAAA,EACA,KAAK,kBAAkB;AAAA,IACrB,aAAa,eAAe,YAAY;AAAA,EAAA,CACzC;AACH;"}
|
|
@@ -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,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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B,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,YAAM,eAAe;AAAA,QACnB,OAAO,QAAQ;AAAA,QACf,QAAQ,QAAQ;AAAA,MAAA;AAIlB,eAAS,GAAG;AAGZ,iBAAW,MAAM;AACf,cAAM,cAAc;AAAA,UAClB,OAAO,QAAQ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ACX,UAAU,QAAQ;AAAA,MAAA,CACnB;AAAA,IAAA,IAEH,CAAA;AAAA,IACJ,GAAI,QAAQ,SACR;AAAA,MACE,aAAa;AAAA,QACX,UAAU,QAAQ;AAAA,MAAA,CACnB;AAAA,IAAA,IAEH,CAAA;AAAA,EAAC;AAAA;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
|
+
{"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,QAAI,aAAa,gBAAgB,MAAM,MAAM;AAC3C,YAAM,UAAU,IAAI;AAGpB,YAAM,eAAe;AAAA,QACnB,OAAO,QAAQ;AAAA,QACf,QAAQ,QAAQ;AAAA,MAAA;AAIlB,eAAS,GA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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;"}
|
|
@@ -44,6 +44,7 @@ export declare const AttributeNames: {
|
|
|
44
44
|
interior: string;
|
|
45
45
|
lock: string;
|
|
46
46
|
position: string;
|
|
47
|
+
rerender: string;
|
|
47
48
|
reverse: string;
|
|
48
49
|
rowCount: string;
|
|
49
50
|
spaceHorizontal: string;
|
|
@@ -74,6 +75,7 @@ export declare const AttributeNames: {
|
|
|
74
75
|
play: string;
|
|
75
76
|
size: string;
|
|
76
77
|
time: string;
|
|
78
|
+
textToggle: string;
|
|
77
79
|
transparent: string;
|
|
78
80
|
};
|
|
79
81
|
readonly deprecated: {
|
|
@@ -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":"AAiKA,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",
|
|
@@ -73,6 +74,7 @@ const visual = {
|
|
|
73
74
|
play: "data-visual-play",
|
|
74
75
|
size: "data-visual-size",
|
|
75
76
|
time: "data-visual-time",
|
|
77
|
+
textToggle: "data-visual-text-toggle",
|
|
76
78
|
transparent: "data-visual-transparent"
|
|
77
79
|
};
|
|
78
80
|
const deprecated = {
|
|
@@ -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,cAA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;AAAA,IACN,SAAS;AAAA,IACT,cAAc;AAAA,IACd,kBAAkB;AAAA,IAClB,uBAAuB;AAAA,IACvB,qBAAqB;AAAA,IACrB,mBAAmB;AAAA,EAAA;AAAA,EAErB,OAAO;AAAA,IACL,QAAQ;AAAA,IACR,iBAAiB;AAAA,IACjB,OAAO;AAAA,EAAA;AAAA,EAET,OAAO;AAAA,IACL,iBAAiB;AAAA,EAAA;AAAA,EAEnB,MAAM;AAAA,IACJ,MAAM;AAAA,IACN,WAAW;AAAA,EAAA;AAAA,EAEb,QAAQ;AAAA,IACN,cAAc;AAAA,IACd,eAAe;AAAA,IACf,qBAAqB;AAAA,IACrB,iBAAiB;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 textToggle: 'data-visual-text-toggle',\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,SAA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AS;AAAA,IACT,cAAc;AAAA,IACd,kBAAkB;AAAA,IAClB,uBAAuB;AAAA,IACvB,qBAAqB;AAAA,IACrB,mBAAmB;AAAA,EAAA;AAAA,EAErB,OAAO;AAAA,IACL,QAAQ;AAAA,IACR,iBAAiB;AAAA,IACjB,OAAO;AAAA,EAAA;AAAA,EAET,OAAO;AAAA,IACL,iBAAiB;AAAA,EAAA;AAAA,EAEnB,MAAM;AAAA,IACJ,MAAM;AAAA,IACN,WAAW;AAAA,EAAA;AAAA,EAEb,QAAQ;AAAA,IACN,cAAc;AAAA,IACd,eAAe;AAAA,IACf,qBAAqB;AAAA,IACrB,iBAAiB;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;"}
|
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,oBAAoB,CAAC;AAC/D,OAAO,EAGL,KAAK,oBAAoB,EACzB,KAAK,uBAAuB,EAC7B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAEhE,OAAO,KAAK,EACV,sBAAsB,EAEvB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAEL,KAAK,eAAe,EACrB,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EACV,UAAU,EAGV,oBAAoB,EAGpB,UAAU,EACV,cAAc,EACd,kBAAkB,EAClB,sBAAsB,EACvB,MAAM,WAAW,CAAC;AAenB,KAAK,eAAe,GAAG,sBAAsB,CAAC;AAE9C,UAAU,kBAAkB;IAC1B,cAAc,CAAC,EAAE,CAAC,IAAI,EAAE,WAAW,EAAE,MAAM,EAAE,UAAU,KAAK,IAAI,CAAC;IACjE,eAAe,CAAC,EAAE,CAAC,IAAI,EAAE,WAAW,EAAE,MAAM,EAAE,UAAU,KAAK,IAAI,CAAC;IAClE,aAAa,CAAC,EAAE,CAAC,GAAG,EAAE,UAAU,EAAE,MAAM,EAAE,UAAU,KAAK,IAAI,CAAC;IAC9D,YAAY,CAAC,EAAE,CAAC,GAAG,EAAE,UAAU,EAAE,MA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AO,EACL,mBAAmB,EACnB,eAAe,EACf,aAAa,EACb,KAAK,eAAe,EACpB,KAAK,eAAe,GACrB,CAAC;AAEF,OAAO,EAAE,sBAAsB,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAC7E,YAAY,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,MAAM,WAAW,CAAC;AAE5E,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,qBAAqB,EACrB,oBAAoB,EACpB,uBAAuB,GACxB,MAAM,gBAAgB,CAAC;AACxB,YAAY,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACtD,OAAO,EAAE,0BAA0B,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC"}
|
package/dist/model.js
CHANGED
|
@@ -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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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;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;AAqU1D,SAAQ,gBAAgC,CAAA;AACxC,SAAQ,mCAA4C,IAAA;AAjUlD,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,iBAAiB,YAAY,IAAI,CAAC,SAAS,KAAK,IAAI,KAAK,CAAA;AAChE,UAAM,gBA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