@dropins/tools 0.24.0-alpha3 → 0.24.0-alpha36
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/chunks/initializer.js.map +1 -1
- package/chunks/vcomponent.js.map +1 -1
- package/components.d.ts +1 -0
- package/components.js.map +1 -1
- package/event-bus.d.ts +1 -0
- package/event-bus.js.map +1 -1
- package/fetch-graphql.d.ts +1 -0
- package/fetch-graphql.js.map +1 -1
- package/i18n.d.ts +1 -0
- package/initializer.d.ts +1 -0
- package/lib.d.ts +1 -0
- package/lib.js.map +1 -1
- package/package.json +1 -1
- package/preact-compat.d.ts +1 -0
- package/preact-hooks.d.ts +1 -0
- package/preact-jsx-runtime.d.ts +1 -0
- package/preact.d.ts +1 -0
- package/types/elsie/src/components/Accordion/Accordion.d.ts +26 -0
- package/types/elsie/src/components/Accordion/Accordion.d.ts.map +1 -0
- package/types/elsie/src/components/Accordion/index.d.ts +3 -0
- package/types/elsie/src/components/Accordion/index.d.ts.map +1 -0
- package/types/elsie/src/components/ActionButton/ActionButton.d.ts +11 -0
- package/types/elsie/src/components/ActionButton/ActionButton.d.ts.map +1 -0
- package/types/elsie/src/components/ActionButton/index.d.ts +2 -0
- package/types/elsie/src/components/ActionButton/index.d.ts.map +1 -0
- package/types/elsie/src/components/ActionButtonGroup/ActionButtonGroup.d.ts +20 -0
- package/types/elsie/src/components/ActionButtonGroup/ActionButtonGroup.d.ts.map +1 -0
- package/types/elsie/src/components/ActionButtonGroup/index.d.ts +2 -0
- package/types/elsie/src/components/ActionButtonGroup/index.d.ts.map +1 -0
- package/types/elsie/src/components/AlertBanner/AlertBanner.d.ts +15 -0
- package/types/elsie/src/components/AlertBanner/AlertBanner.d.ts.map +1 -0
- package/types/elsie/src/components/AlertBanner/index.d.ts +3 -0
- package/types/elsie/src/components/AlertBanner/index.d.ts.map +1 -0
- package/types/elsie/src/components/Breadcrumbs/Breadcrumbs.d.ts +9 -0
- package/types/elsie/src/components/Breadcrumbs/Breadcrumbs.d.ts.map +1 -0
- package/types/elsie/src/components/Breadcrumbs/index.d.ts +3 -0
- package/types/elsie/src/components/Breadcrumbs/index.d.ts.map +1 -0
- package/types/elsie/src/components/Button/Button.d.ts +15 -0
- package/types/elsie/src/components/Button/Button.d.ts.map +1 -0
- package/types/elsie/src/components/Button/index.d.ts +3 -0
- package/types/elsie/src/components/Button/index.d.ts.map +1 -0
- package/types/elsie/src/components/Card/Card.d.ts +9 -0
- package/types/elsie/src/components/Card/Card.d.ts.map +1 -0
- package/types/elsie/src/components/Card/index.d.ts +2 -0
- package/types/elsie/src/components/Card/index.d.ts.map +1 -0
- package/types/elsie/src/components/CartItem/CartItem.d.ts +27 -0
- package/types/elsie/src/components/CartItem/CartItem.d.ts.map +1 -0
- package/types/elsie/src/components/CartItem/CartItemSkeleton.d.ts +4 -0
- package/types/elsie/src/components/CartItem/CartItemSkeleton.d.ts.map +1 -0
- package/types/elsie/src/components/CartItem/index.d.ts +4 -0
- package/types/elsie/src/components/CartItem/index.d.ts.map +1 -0
- package/types/elsie/src/components/CartList/CartList.d.ts +7 -0
- package/types/elsie/src/components/CartList/CartList.d.ts.map +1 -0
- package/types/elsie/src/components/CartList/index.d.ts +3 -0
- package/types/elsie/src/components/CartList/index.d.ts.map +1 -0
- package/types/elsie/src/components/Checkbox/Checkbox.d.ts +13 -0
- package/types/elsie/src/components/Checkbox/Checkbox.d.ts.map +1 -0
- package/types/elsie/src/components/Checkbox/index.d.ts +2 -0
- package/types/elsie/src/components/Checkbox/index.d.ts.map +1 -0
- package/types/elsie/src/components/ColorSwatch/ColorSwatch.d.ts +20 -0
- package/types/elsie/src/components/ColorSwatch/ColorSwatch.d.ts.map +1 -0
- package/types/elsie/src/components/ColorSwatch/index.d.ts +3 -0
- package/types/elsie/src/components/ColorSwatch/index.d.ts.map +1 -0
- package/types/elsie/src/components/Divider/Divider.d.ts +8 -0
- package/types/elsie/src/components/Divider/Divider.d.ts.map +1 -0
- package/types/elsie/src/components/Divider/index.d.ts +3 -0
- package/types/elsie/src/components/Divider/index.d.ts.map +1 -0
- package/types/elsie/src/components/Field/Field.d.ts +14 -0
- package/types/elsie/src/components/Field/Field.d.ts.map +1 -0
- package/types/elsie/src/components/Field/index.d.ts +2 -0
- package/types/elsie/src/components/Field/index.d.ts.map +1 -0
- package/types/elsie/src/components/Icon/Icon.d.ts +18 -0
- package/types/elsie/src/components/Icon/Icon.d.ts.map +1 -0
- package/types/elsie/src/components/Icon/index.d.ts +2 -0
- package/types/elsie/src/components/Icon/index.d.ts.map +1 -0
- package/types/elsie/src/components/IllustratedMessage/IllustratedMessage.d.ts +13 -0
- package/types/elsie/src/components/IllustratedMessage/IllustratedMessage.d.ts.map +1 -0
- package/types/elsie/src/components/IllustratedMessage/index.d.ts +3 -0
- package/types/elsie/src/components/IllustratedMessage/index.d.ts.map +1 -0
- package/types/elsie/src/components/Image/Image.d.ts +11 -0
- package/types/elsie/src/components/Image/Image.d.ts.map +1 -0
- package/types/elsie/src/components/Image/index.d.ts +2 -0
- package/types/elsie/src/components/Image/index.d.ts.map +1 -0
- package/types/elsie/src/components/ImageSwatch/ImageSwatch.d.ts +20 -0
- package/types/elsie/src/components/ImageSwatch/ImageSwatch.d.ts.map +1 -0
- package/types/elsie/src/components/ImageSwatch/index.d.ts +3 -0
- package/types/elsie/src/components/ImageSwatch/index.d.ts.map +1 -0
- package/types/elsie/src/components/InLineAlert/InLineAlert.d.ts +17 -0
- package/types/elsie/src/components/InLineAlert/InLineAlert.d.ts.map +1 -0
- package/types/elsie/src/components/InLineAlert/index.d.ts +3 -0
- package/types/elsie/src/components/InLineAlert/index.d.ts.map +1 -0
- package/types/elsie/src/components/Incrementer/Incrementer.d.ts +17 -0
- package/types/elsie/src/components/Incrementer/Incrementer.d.ts.map +1 -0
- package/types/elsie/src/components/Incrementer/index.d.ts +2 -0
- package/types/elsie/src/components/Incrementer/index.d.ts.map +1 -0
- package/types/elsie/src/components/Input/Input.d.ts +19 -0
- package/types/elsie/src/components/Input/Input.d.ts.map +1 -0
- package/types/elsie/src/components/Input/index.d.ts +3 -0
- package/types/elsie/src/components/Input/index.d.ts.map +1 -0
- package/types/elsie/src/components/Modal/Modal.d.ts +15 -0
- package/types/elsie/src/components/Modal/Modal.d.ts.map +1 -0
- package/types/elsie/src/components/Modal/index.d.ts +2 -0
- package/types/elsie/src/components/Modal/index.d.ts.map +1 -0
- package/types/elsie/src/components/Picker/Picker.d.ts +26 -0
- package/types/elsie/src/components/Picker/Picker.d.ts.map +1 -0
- package/types/elsie/src/components/Picker/index.d.ts +2 -0
- package/types/elsie/src/components/Picker/index.d.ts.map +1 -0
- package/types/elsie/src/components/Price/Price.d.ts +17 -0
- package/types/elsie/src/components/Price/Price.d.ts.map +1 -0
- package/types/elsie/src/components/Price/index.d.ts +2 -0
- package/types/elsie/src/components/Price/index.d.ts.map +1 -0
- package/types/elsie/src/components/PriceRange/PriceRange.d.ts +17 -0
- package/types/elsie/src/components/PriceRange/PriceRange.d.ts.map +1 -0
- package/types/elsie/src/components/PriceRange/index.d.ts +3 -0
- package/types/elsie/src/components/PriceRange/index.d.ts.map +1 -0
- package/types/elsie/src/components/PriceSummary/PriceSummary.d.ts +49 -0
- package/types/elsie/src/components/PriceSummary/PriceSummary.d.ts.map +1 -0
- package/types/elsie/src/components/PriceSummary/index.d.ts +3 -0
- package/types/elsie/src/components/PriceSummary/index.d.ts.map +1 -0
- package/types/elsie/src/components/ProgressSpinner/ProgressSpinner.d.ts +14 -0
- package/types/elsie/src/components/ProgressSpinner/ProgressSpinner.d.ts.map +1 -0
- package/types/elsie/src/components/ProgressSpinner/index.d.ts +3 -0
- package/types/elsie/src/components/ProgressSpinner/index.d.ts.map +1 -0
- package/types/elsie/src/components/RadioButton/RadioButton.d.ts +15 -0
- package/types/elsie/src/components/RadioButton/RadioButton.d.ts.map +1 -0
- package/types/elsie/src/components/RadioButton/index.d.ts +3 -0
- package/types/elsie/src/components/RadioButton/index.d.ts.map +1 -0
- package/types/elsie/src/components/Skeleton/Skeleton.d.ts +17 -0
- package/types/elsie/src/components/Skeleton/Skeleton.d.ts.map +1 -0
- package/types/elsie/src/components/Skeleton/index.d.ts +2 -0
- package/types/elsie/src/components/Skeleton/index.d.ts.map +1 -0
- package/types/elsie/src/components/TextSwatch/TextSwatch.d.ts +18 -0
- package/types/elsie/src/components/TextSwatch/TextSwatch.d.ts.map +1 -0
- package/types/elsie/src/components/TextSwatch/index.d.ts +3 -0
- package/types/elsie/src/components/TextSwatch/index.d.ts.map +1 -0
- package/types/elsie/src/components/UIProvider/UIProvider.d.ts +17 -0
- package/types/elsie/src/components/UIProvider/UIProvider.d.ts.map +1 -0
- package/types/elsie/src/components/UIProvider/index.d.ts +2 -0
- package/types/elsie/src/components/UIProvider/index.d.ts.map +1 -0
- package/types/elsie/src/components/index.d.ts +34 -0
- package/types/elsie/src/components/index.d.ts.map +1 -0
- package/types/elsie/src/i18n/en_US.json.d.ts +120 -0
- package/types/elsie/src/i18n/index.d.ts +356 -0
- package/types/elsie/src/i18n/index.d.ts.map +1 -0
- package/types/elsie/src/icons/index.d.ts +35 -0
- package/types/elsie/src/icons/index.d.ts.map +1 -0
- package/types/elsie/src/lib/classes.d.ts +6 -0
- package/types/elsie/src/lib/classes.d.ts.map +1 -0
- package/types/elsie/src/lib/config.d.ts +7 -0
- package/types/elsie/src/lib/config.d.ts.map +1 -0
- package/types/elsie/src/lib/debounce.d.ts +2 -0
- package/types/elsie/src/lib/debounce.d.ts.map +1 -0
- package/types/elsie/src/lib/deepmerge.d.ts +2 -0
- package/types/elsie/src/lib/deepmerge.d.ts.map +1 -0
- package/types/elsie/src/lib/form-values.d.ts +5 -0
- package/types/elsie/src/lib/form-values.d.ts.map +1 -0
- package/types/elsie/src/lib/i18n.d.ts +8 -0
- package/types/elsie/src/lib/i18n.d.ts.map +1 -0
- package/types/elsie/src/lib/image-params-keymap.d.ts +4 -0
- package/types/elsie/src/lib/image-params-keymap.d.ts.map +1 -0
- package/types/elsie/src/lib/index.d.ts +14 -0
- package/types/elsie/src/lib/index.d.ts.map +1 -0
- package/types/elsie/src/lib/initializer.d.ts +70 -0
- package/types/elsie/src/lib/initializer.d.ts.map +1 -0
- package/types/elsie/src/lib/render.d.ts +34 -0
- package/types/elsie/src/lib/render.d.ts.map +1 -0
- package/types/elsie/src/lib/resolve-image.d.ts +10 -0
- package/types/elsie/src/lib/resolve-image.d.ts.map +1 -0
- package/types/elsie/src/lib/slot.d.ts +44 -0
- package/types/elsie/src/lib/slot.d.ts.map +1 -0
- package/types/elsie/src/lib/tests.d.ts +5 -0
- package/types/elsie/src/lib/tests.d.ts.map +1 -0
- package/types/elsie/src/lib/types.d.ts +10 -0
- package/types/elsie/src/lib/types.d.ts.map +1 -0
- package/types/elsie/src/lib/vcomponent.d.ts +9 -0
- package/types/elsie/src/lib/vcomponent.d.ts.map +1 -0
- package/types/event-bus/src/events-catalog.d.ts +16 -0
- package/types/event-bus/src/events-catalog.d.ts.map +1 -0
- package/types/event-bus/src/index.d.ts +46 -0
- package/types/event-bus/src/index.d.ts.map +1 -0
- package/types/fetch-graphql/src/index.d.ts +105 -0
- package/types/fetch-graphql/src/index.d.ts.map +1 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"initializer.js","sources":["../../src/lib/config.ts","../../src/lib/initializer.ts"],"sourcesContent":["export class Config<T> {\n private config: T;\n\n constructor(initialConfig: T) {\n this.config = initialConfig;\n }\n\n getConfig(): T {\n return this.config;\n }\n\n setConfig(newConfig: T): void {\n this.config = newConfig;\n }\n}\n","import { Config, setImageParamsKeyMap } from '@adobe/elsie/lib';\n\ntype Listener = { off(): void };\n\ntype Listeners<T> = (config?: T) => Array<Listener | undefined>;\n\ntype Init<T> = (config?: T) => Promise<void>;\n\ntype Options<T> = { init: Init<T>; listeners: Listeners<T> };\n\nexport class Initializer<T> {\n private _listeners: Listener[] = [];\n listeners: Listeners<T>;\n init: Init<T>;\n config = new Config<T>({} as any);\n\n constructor({ init, listeners }: Options<T>) {\n this.listeners = (config) => {\n // Unbind existing listeners\n this._listeners.forEach((listener) => listener.off());\n // Bind new listeners\n return (this._listeners = listeners(config) as Listener[]);\n };\n\n this.init = (options) => {\n const { imageParamsKeyMap, ...rest } = options as any;\n this.config.setConfig({ ...this.config.getConfig(), ...rest });\n setImageParamsKeyMap(imageParamsKeyMap);\n return init(options);\n };\n }\n}\n\ntype Initializers = [Initializer<any>, { [key: string]: any } | undefined][];\n\nexport class initializers {\n static _initializers: Initializers = [];\n static _mounted: boolean = false;\n static _imageParamsKeyMap: { [key: string]: string } | undefined = undefined;\n\n static register(\n initializer: Initializer<any>,\n options?: { [key: string]: any }\n ) {\n if (initializers._mounted) {\n initializer.listeners?.(options);\n initializer.init?.(options);\n }\n initializers._initializers.push([initializer, options]);\n }\n
|
|
1
|
+
{"version":3,"file":"initializer.js","sources":["../../src/lib/config.ts","../../src/lib/initializer.ts"],"sourcesContent":["export class Config<T> {\n private config: T;\n\n constructor(initialConfig: T) {\n this.config = initialConfig;\n }\n\n getConfig(): T {\n return this.config;\n }\n\n setConfig(newConfig: T): void {\n this.config = newConfig;\n }\n}\n","import { Config, setImageParamsKeyMap } from '@adobe/elsie/lib';\n\ntype Listener = { off(): void };\n\ntype Listeners<T> = (config?: T) => Array<Listener | undefined>;\n\ntype Init<T> = (config?: T) => Promise<void>;\n\ntype Options<T> = { init: Init<T>; listeners: Listeners<T> };\n\n/**\n * The `Initializer` class is responsible for setting up event listeners and initializing a module with the given configuration.\n *\n * @template T - The type of the configuration object.\n * @class\n */\nexport class Initializer<T> {\n private _listeners: Listener[] = [];\n listeners: Listeners<T>;\n init: Init<T>;\n config = new Config<T>({} as any);\n\n /**\n * Creates an instance of Initializer.\n * @param options - The initialization options.\n * @param options.init - A function that initializes the module.\n * @param options.listeners - A function that sets up event listeners.\n */\n constructor({ init, listeners }: Options<T>) {\n this.listeners = (config) => {\n // Unbind existing listeners\n this._listeners.forEach((listener) => listener.off());\n // Bind new listeners\n return (this._listeners = listeners(config) as Listener[]);\n };\n\n this.init = (options) => {\n const { imageParamsKeyMap, ...rest } = options as any;\n this.config.setConfig({ ...this.config.getConfig(), ...rest });\n setImageParamsKeyMap(imageParamsKeyMap);\n return init(options);\n };\n }\n}\n\ntype Initializers = [Initializer<any>, { [key: string]: any } | undefined][];\n\n/**\n * The Initializers class provides methods to register, mount, and configure initializers.\n *\n * @class\n *\n * @method register - Registers a new initializer. If the initializers have already been mounted, it immediately binds the event listeners and initializes the API for the new initializer.\n * @method mount - Mounts all registered initializers. This involves binding the event listeners and initializing the APIs for each initializer, in that order.\n * @method setImageParamKeys - Sets the image parameter keys. These keys are used when initializing the APIs for the initializers.\n */\nexport class initializers {\n static _initializers: Initializers = [];\n static _mounted: boolean = false;\n static _imageParamsKeyMap: { [key: string]: string } | undefined = undefined;\n\n /**\n * Registers a new initializer. If the initializers have already been mounted,it immediately binds the event listeners and initializes the API for the new initializer.\n * @param initializer - The initializer to register.\n * @param options - Optional configuration for the initializer.\n */\n static register(\n initializer: Initializer<any>,\n options?: { [key: string]: any }\n ) {\n if (initializers._mounted) {\n initializer.listeners?.(options);\n initializer.init?.(options);\n }\n initializers._initializers.push([initializer, options]);\n }\n /**\n * Mounts all registered initializers. This involves binding the event listeners and initializing the APIs for each initializer, in that order.\n */\n static mount() {\n initializers._mounted = true;\n // In this specific order\n // 1. Bind events\n initializers._initializers?.forEach(([initializer, options]) => {\n initializer.listeners?.(options);\n });\n\n // 2. Initialize APIs\n initializers._initializers?.forEach(([initializer, options]) => {\n initializer.init?.({\n imageParamsKeyMap: initializers._imageParamsKeyMap,\n ...options,\n });\n });\n }\n /**\n * Sets the image parameter keys. These keys are used when initializing the APIs for the initializers.\n * @param params - The image parameter keys.\n */\n static setImageParamKeys(params: { [key: string]: any }) {\n initializers._imageParamsKeyMap = params;\n }\n}\n"],"names":["Config","constructor","initialConfig","config","getConfig","setConfig","newConfig","Initializer","init","listeners","_listeners","forEach","listener","off","options","imageParamsKeyMap","rest","setImageParamsKeyMap","initializers","register","initializer","_mounted","_initializers","push","mount","_imageParamsKeyMap","setImageParamKeys","params","__publicField"],"mappings":"qNAAO,MAAMA,CAAU,CAGrBC,YAAYC,EAAkB,CAFtBC,EAAAA,eAGN,KAAKA,OAASD,CAChB,CAEAE,WAAe,CACb,OAAO,KAAKD,MACd,CAEAE,UAAUC,EAAoB,CAC5B,KAAKH,OAASG,CAChB,CACF,CCEO,MAAMC,CAAe,CAY1BN,YAAY,CAAEO,KAAAA,EAAMC,UAAAA,CAAAA,EAAyB,CAXrCC,EAAAA,kBAAyB,CAAA,GACjCD,EAAAA,kBACAD,EAAAA,aACAL,EAAAA,cAAS,IAAIH,EAAU,CAAA,CAAU,GAS/B,KAAKS,UAAwBN,IAE3B,KAAKO,WAAWC,QAAsBC,GAAAA,EAASC,KAAK,EAE5C,KAAKH,WAAaD,EAAUN,CAAM,GAG5C,KAAKK,KAAoBM,GAAA,CACjB,KAAA,CAAEC,kBAAAA,EAAmB,GAAGC,CAASF,EAAAA,EACvC,YAAKX,OAAOE,UAAU,CAAE,GAAG,KAAKF,OAAOC,UAAU,EAAG,GAAGY,CAAAA,CAAM,EAC7DC,EAAqBF,CAAiB,EAC/BP,EAAKM,CAAO,CAAA,CAEvB,CACF,CAaO,MAAMI,EAAN,MAAMA,CAAa,CAUxB,OAAOC,SACLC,EACAN,EACA,SACII,EAAaG,YACfD,EAAAA,EAAYX,YAAZW,MAAAA,EAAAA,KAAAA,EAAwBN,IACxBM,EAAAA,EAAYZ,OAAZY,MAAAA,EAAAA,KAAAA,EAAmBN,IAErBI,EAAaI,cAAcC,KAAK,CAACH,EAAaN,CAAO,CAAC,CACxD,CAIA,OAAOU,OAAQ,SACbN,EAAaG,SAAW,IAGxBH,EAAAA,EAAaI,gBAAbJ,MAAAA,EAA4BP,QAAQ,CAAC,CAACS,EAAaN,CAAO,IAAM,QAC9DM,EAAAA,EAAYX,YAAZW,MAAAA,EAAAA,KAAAA,EAAwBN,EAAO,IAIjCI,EAAAA,EAAaI,gBAAbJ,MAAAA,EAA4BP,QAAQ,CAAC,CAACS,EAAaN,CAAO,IAAM,QAC9DM,EAAAA,EAAYZ,OAAZY,MAAAA,EAAAA,KAAAA,EAAmB,CACjBL,kBAAmBG,EAAaO,mBAChC,GAAGX,CAAAA,EACJ,EAEL,CAKA,OAAOY,kBAAkBC,EAAgC,CACvDT,EAAaO,mBAAqBE,CACpC,CACF,EA7CEC,EADWV,EACJI,gBAA8B,CAAA,GACrCM,EAFWV,EAEJG,WAAoB,IAC3BO,EAHWV,EAGJO,sBAHF,IAAMP,EAANI"}
|
package/chunks/vcomponent.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vcomponent.js","sources":["../../src/lib/form-values.ts","../../src/lib/classes.ts","../../../../node_modules/deepmerge/dist/cjs.js","../../src/lib/debounce.ts","../../src/lib/resolve-image.ts","../../src/lib/vcomponent.tsx"],"sourcesContent":["export const getFormValues = (form: HTMLFormElement) => {\n const formData: any = new FormData(form);\n const result = Object.fromEntries(formData);\n return result;\n};\n\nexport const getFormErrors = (form: HTMLFormElement) => {\n const formData: any = new FormData(form);\n\n const data = Object.fromEntries(formData);\n\n const result = Object.entries(data).reduce((result, [key]) => {\n // @ts-ignore\n const field = form.elements[key];\n\n return field?.validationMessage\n ? { ...result, [key]: field.validationMessage }\n : { ...result };\n }, {});\n\n return result;\n};\n","import { JSXInternal } from 'preact/src/jsx';\n\ntype ClassName = string | JSXInternal.SignalLike<string | undefined>;\n\nexport const classes = (\n classes: Array<ClassName | [ClassName, boolean] | undefined>\n) => {\n const result = classes.reduce((result, item) => {\n if (!item) return result;\n\n if (typeof item === 'string') result += ` ${item}`;\n\n if (Array.isArray(item)) {\n const [className, isActive] = item;\n if (className && isActive) {\n result += ` ${className}`;\n }\n }\n\n return result;\n }, '') as string;\n\n return result.trim();\n};\n","'use strict';\n\nvar isMergeableObject = function isMergeableObject(value) {\n\treturn isNonNullObject(value)\n\t\t&& !isSpecial(value)\n};\n\nfunction isNonNullObject(value) {\n\treturn !!value && typeof value === 'object'\n}\n\nfunction isSpecial(value) {\n\tvar stringValue = Object.prototype.toString.call(value);\n\n\treturn stringValue === '[object RegExp]'\n\t\t|| stringValue === '[object Date]'\n\t\t|| isReactElement(value)\n}\n\n// see https://github.com/facebook/react/blob/b5ac963fb791d1298e7f396236383bc955f916c1/src/isomorphic/classic/element/ReactElement.js#L21-L25\nvar canUseSymbol = typeof Symbol === 'function' && Symbol.for;\nvar REACT_ELEMENT_TYPE = canUseSymbol ? Symbol.for('react.element') : 0xeac7;\n\nfunction isReactElement(value) {\n\treturn value.$$typeof === REACT_ELEMENT_TYPE\n}\n\nfunction emptyTarget(val) {\n\treturn Array.isArray(val) ? [] : {}\n}\n\nfunction cloneUnlessOtherwiseSpecified(value, options) {\n\treturn (options.clone !== false && options.isMergeableObject(value))\n\t\t? deepmerge(emptyTarget(value), value, options)\n\t\t: value\n}\n\nfunction defaultArrayMerge(target, source, options) {\n\treturn target.concat(source).map(function(element) {\n\t\treturn cloneUnlessOtherwiseSpecified(element, options)\n\t})\n}\n\nfunction getMergeFunction(key, options) {\n\tif (!options.customMerge) {\n\t\treturn deepmerge\n\t}\n\tvar customMerge = options.customMerge(key);\n\treturn typeof customMerge === 'function' ? customMerge : deepmerge\n}\n\nfunction getEnumerableOwnPropertySymbols(target) {\n\treturn Object.getOwnPropertySymbols\n\t\t? Object.getOwnPropertySymbols(target).filter(function(symbol) {\n\t\t\treturn Object.propertyIsEnumerable.call(target, symbol)\n\t\t})\n\t\t: []\n}\n\nfunction getKeys(target) {\n\treturn Object.keys(target).concat(getEnumerableOwnPropertySymbols(target))\n}\n\nfunction propertyIsOnObject(object, property) {\n\ttry {\n\t\treturn property in object\n\t} catch(_) {\n\t\treturn false\n\t}\n}\n\n// Protects from prototype poisoning and unexpected merging up the prototype chain.\nfunction propertyIsUnsafe(target, key) {\n\treturn propertyIsOnObject(target, key) // Properties are safe to merge if they don't exist in the target yet,\n\t\t&& !(Object.hasOwnProperty.call(target, key) // unsafe if they exist up the prototype chain,\n\t\t\t&& Object.propertyIsEnumerable.call(target, key)) // and also unsafe if they're nonenumerable.\n}\n\nfunction mergeObject(target, source, options) {\n\tvar destination = {};\n\tif (options.isMergeableObject(target)) {\n\t\tgetKeys(target).forEach(function(key) {\n\t\t\tdestination[key] = cloneUnlessOtherwiseSpecified(target[key], options);\n\t\t});\n\t}\n\tgetKeys(source).forEach(function(key) {\n\t\tif (propertyIsUnsafe(target, key)) {\n\t\t\treturn\n\t\t}\n\n\t\tif (propertyIsOnObject(target, key) && options.isMergeableObject(source[key])) {\n\t\t\tdestination[key] = getMergeFunction(key, options)(target[key], source[key], options);\n\t\t} else {\n\t\t\tdestination[key] = cloneUnlessOtherwiseSpecified(source[key], options);\n\t\t}\n\t});\n\treturn destination\n}\n\nfunction deepmerge(target, source, options) {\n\toptions = options || {};\n\toptions.arrayMerge = options.arrayMerge || defaultArrayMerge;\n\toptions.isMergeableObject = options.isMergeableObject || isMergeableObject;\n\t// cloneUnlessOtherwiseSpecified is added to `options` so that custom arrayMerge()\n\t// implementations can use it. The caller may not replace it.\n\toptions.cloneUnlessOtherwiseSpecified = cloneUnlessOtherwiseSpecified;\n\n\tvar sourceIsArray = Array.isArray(source);\n\tvar targetIsArray = Array.isArray(target);\n\tvar sourceAndTargetTypesMatch = sourceIsArray === targetIsArray;\n\n\tif (!sourceAndTargetTypesMatch) {\n\t\treturn cloneUnlessOtherwiseSpecified(source, options)\n\t} else if (sourceIsArray) {\n\t\treturn options.arrayMerge(target, source, options)\n\t} else {\n\t\treturn mergeObject(target, source, options)\n\t}\n}\n\ndeepmerge.all = function deepmergeAll(array, options) {\n\tif (!Array.isArray(array)) {\n\t\tthrow new Error('first argument should be an array')\n\t}\n\n\treturn array.reduce(function(prev, next) {\n\t\treturn deepmerge(prev, next, options)\n\t}, {})\n};\n\nvar deepmerge_1 = deepmerge;\n\nmodule.exports = deepmerge_1;\n","export const debounce = (fn: Function, ms: number) => {\n let timeoutId: ReturnType<typeof setTimeout>;\n return function (this: any, ...args: any[]) {\n clearTimeout(timeoutId);\n timeoutId = setTimeout(() => fn.apply(this, args), ms);\n };\n};\n","import { getImageParamsKeyMap } from '@adobe/elsie/lib/';\n\nconst BREAKPOINTS = {\n medium: 768,\n large: 1024,\n xlarge: 1366,\n xxlarge: 1920,\n};\n\nexport interface ResolveImageUrlOptions {\n width: number;\n height?: number;\n auto?: string;\n quality?: number;\n crop?: boolean;\n fit?: string;\n}\n\nconst resolveImageUrl = (url: string, _opts?: ResolveImageUrlOptions) => {\n const [base, query] = url.split('?');\n const params = new URLSearchParams(query);\n\n const keyMapping = getImageParamsKeyMap();\n\n let opts = {};\n\n if (keyMapping && Object.keys(keyMapping).length > 0 && _opts) {\n opts = Object.entries(_opts).reduce((acc, [key, value]) => {\n const newKey = keyMapping[key];\n if (newKey) {\n acc[newKey] = value;\n }\n return acc;\n }, {} as { [key: string]: any });\n } else {\n opts = {\n auto: 'webp',\n quality: 80,\n crop: false,\n fit: 'cover',\n ..._opts,\n };\n }\n // Append image optimization parameters\n Object.entries(opts).forEach(([key, value]) => {\n if (value !== undefined && value !== null) {\n params.set(key, String(value));\n }\n });\n\n return `${base}?${params.toString()}`;\n};\n\nexport const generateSrcset = (\n imageURL: string,\n options: ResolveImageUrlOptions\n) => {\n if (!imageURL || !options?.width) return;\n\n const generateSrcsetUrl = (options: ResolveImageUrlOptions) => {\n return resolveImageUrl(imageURL, {\n ...options,\n });\n };\n\n return Object.entries(BREAKPOINTS)\n .map(([, value]) => {\n // calculate breakpoints width\n const relativeWidth = (options.width * value) / BREAKPOINTS.xxlarge;\n\n return `${generateSrcsetUrl({\n ...options,\n width: relativeWidth,\n })} ${value}w`;\n })\n .join(',\\n');\n};\n","/*\nADOBE CONFIDENTIAL\nCopyright 2023 Adobe\nAll Rights Reserved.\nNOTICE: All information contained herein is, and remains\nthe property of Adobe and its suppliers, if any. The intellectual\nand technical concepts contained herein are proprietary to Adobe\nand its suppliers and are protected by all applicable intellectual\nproperty laws, including trade secret and copyright laws.\nDissemination of this information or reproduction of this material\nis strictly forbidden unless prior written permission is obtained\nfrom Adobe.\n*/\n\nimport { VNode, ComponentChildren } from 'preact';\nimport { classes } from '.';\n\nexport type VComponentProps = {\n node: VNode | VNode[];\n children?: ComponentChildren;\n [key: string]: any; // allow other unspecified props to be passed without any TS warning\n};\n\nexport function VComponent({ node, ...props }: VComponentProps) {\n if (!node) return null;\n\n if (Array.isArray(node)) {\n return (\n <>\n {node.map((n, key) => (\n <VComponent\n key={key}\n node={n}\n className={props.className}\n {...props}\n />\n ))}\n </>\n );\n }\n\n // @ts-ignore\n props.className = classes([node.props.className, props.className]);\n\n // @ts-ignore\n return <node.type ref={node.ref} key={node.key} {...node.props} {...props} />;\n}\n"],"names":["getFormValues","form","formData","FormData","result","Object","fromEntries","getFormErrors","data","entries","reduce","key","field","elements","validationMessage","classes","item","Array","isArray","className","isActive","trim","isMergeableObject","value","isNonNullObject","isSpecial","stringValue","isReactElement","canUseSymbol","REACT_ELEMENT_TYPE","emptyTarget","val","cloneUnlessOtherwiseSpecified","options","deepmerge","defaultArrayMerge","target","source","element","getMergeFunction","customMerge","getEnumerableOwnPropertySymbols","symbol","getKeys","propertyIsOnObject","object","property","propertyIsUnsafe","mergeObject","destination","sourceIsArray","targetIsArray","sourceAndTargetTypesMatch","array","prev","next","deepmerge_1","cjs","debounce","fn","ms","timeoutId","args","clearTimeout","setTimeout","apply","BREAKPOINTS","medium","large","xlarge","xxlarge","resolveImageUrl","url","_opts","base","query","split","params","URLSearchParams","keyMapping","getImageParamsKeyMap","opts","keys","length","acc","newKey","auto","quality","crop","fit","forEach","set","String","toString","generateSrcset","imageURL","width","generateSrcsetUrl","map","relativeWidth","join","VComponent","node","props","_jsx","_Fragment","children","n","type","ref"],"mappings":"+HAAaA,MAAAA,EAAiBC,GAA0B,CAChDC,MAAAA,EAAgB,IAAIC,SAASF,CAAI,EAEhCG,OADQC,OAAOC,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GAAA,CACb,EACA6E,KAAK;AAAA,CAAK,CACf,ECrDO,SAASC,EAAW,CAAEC,KAAAA,EAAM,GAAGC,CAAuB,EAAG,CAC9D,OAAKD,EAEDrF,MAAMC,QAAQoF,CAAI,EAElBE,EAAAC,EAAA,CAAAC,SACGJ,EAAKJ,IAAI,CAACS,EAAGhG,IACZ6F,EAACH,EAAU,CAETC,KAAMK,EACNxF,UAAWoF,EAAMpF,UAAU,GACvBoF,CAAK,EAHJ5F,CAIN,CACF,CAAA,CACD,GAKAQ,EAAAA,UAAYJ,EAAQ,CAACuF,EAAKC,MAAMpF,UAAWoF,EAAMpF,SAAS,CAAC,EAG1DqF,EAACF,EAAKM,KAAI,CAACC,IAAKP,EAAKO,IAAI,GAAoBP,EAAKC,MAAK,GAAMA,CAAAA,EAA9BD,EAAK3F,GAAiC,GArB1D,IAsBpB","x_google_ignoreList":[2]}
|
|
1
|
+
{"version":3,"file":"vcomponent.js","sources":["../../src/lib/form-values.ts","../../src/lib/classes.ts","../../../../node_modules/deepmerge/dist/cjs.js","../../src/lib/debounce.ts","../../src/lib/resolve-image.ts","../../src/lib/vcomponent.tsx"],"sourcesContent":["export const getFormValues = (form: HTMLFormElement) => {\n const formData: any = new FormData(form);\n const result = Object.fromEntries(formData);\n return result;\n};\n\nexport const getFormErrors = (form: HTMLFormElement) => {\n const formData: any = new FormData(form);\n\n const data = Object.fromEntries(formData);\n\n const result = Object.entries(data).reduce((result, [key]) => {\n // @ts-ignore\n const field = form.elements[key];\n\n return field?.validationMessage\n ? { ...result, [key]: field.validationMessage }\n : { ...result };\n }, {});\n\n return result;\n};\n","// @ts-ignore\nimport { JSXInternal } from 'preact/src/jsx';\n\ntype ClassName = string | JSXInternal.SignalLike<string | undefined>;\n\nexport const classes = (\n classes: Array<ClassName | [ClassName, boolean] | undefined>\n) => {\n const result = classes.reduce((result, item) => {\n if (!item) return result;\n\n if (typeof item === 'string') result += ` ${item}`;\n\n if (Array.isArray(item)) {\n const [className, isActive] = item;\n if (className && isActive) {\n result += ` ${className}`;\n }\n }\n\n return result;\n }, '') as string;\n\n return result.trim();\n};\n","'use strict';\n\nvar isMergeableObject = function isMergeableObject(value) {\n\treturn isNonNullObject(value)\n\t\t&& !isSpecial(value)\n};\n\nfunction isNonNullObject(value) {\n\treturn !!value && typeof value === 'object'\n}\n\nfunction isSpecial(value) {\n\tvar stringValue = Object.prototype.toString.call(value);\n\n\treturn stringValue === '[object RegExp]'\n\t\t|| stringValue === '[object Date]'\n\t\t|| isReactElement(value)\n}\n\n// see https://github.com/facebook/react/blob/b5ac963fb791d1298e7f396236383bc955f916c1/src/isomorphic/classic/element/ReactElement.js#L21-L25\nvar canUseSymbol = typeof Symbol === 'function' && Symbol.for;\nvar REACT_ELEMENT_TYPE = canUseSymbol ? Symbol.for('react.element') : 0xeac7;\n\nfunction isReactElement(value) {\n\treturn value.$$typeof === REACT_ELEMENT_TYPE\n}\n\nfunction emptyTarget(val) {\n\treturn Array.isArray(val) ? [] : {}\n}\n\nfunction cloneUnlessOtherwiseSpecified(value, options) {\n\treturn (options.clone !== false && options.isMergeableObject(value))\n\t\t? deepmerge(emptyTarget(value), value, options)\n\t\t: value\n}\n\nfunction defaultArrayMerge(target, source, options) {\n\treturn target.concat(source).map(function(element) {\n\t\treturn cloneUnlessOtherwiseSpecified(element, options)\n\t})\n}\n\nfunction getMergeFunction(key, options) {\n\tif (!options.customMerge) {\n\t\treturn deepmerge\n\t}\n\tvar customMerge = options.customMerge(key);\n\treturn typeof customMerge === 'function' ? customMerge : deepmerge\n}\n\nfunction getEnumerableOwnPropertySymbols(target) {\n\treturn Object.getOwnPropertySymbols\n\t\t? Object.getOwnPropertySymbols(target).filter(function(symbol) {\n\t\t\treturn Object.propertyIsEnumerable.call(target, symbol)\n\t\t})\n\t\t: []\n}\n\nfunction getKeys(target) {\n\treturn Object.keys(target).concat(getEnumerableOwnPropertySymbols(target))\n}\n\nfunction propertyIsOnObject(object, property) {\n\ttry {\n\t\treturn property in object\n\t} catch(_) {\n\t\treturn false\n\t}\n}\n\n// Protects from prototype poisoning and unexpected merging up the prototype chain.\nfunction propertyIsUnsafe(target, key) {\n\treturn propertyIsOnObject(target, key) // Properties are safe to merge if they don't exist in the target yet,\n\t\t&& !(Object.hasOwnProperty.call(target, key) // unsafe if they exist up the prototype chain,\n\t\t\t&& Object.propertyIsEnumerable.call(target, key)) // and also unsafe if they're nonenumerable.\n}\n\nfunction mergeObject(target, source, options) {\n\tvar destination = {};\n\tif (options.isMergeableObject(target)) {\n\t\tgetKeys(target).forEach(function(key) {\n\t\t\tdestination[key] = cloneUnlessOtherwiseSpecified(target[key], options);\n\t\t});\n\t}\n\tgetKeys(source).forEach(function(key) {\n\t\tif (propertyIsUnsafe(target, key)) {\n\t\t\treturn\n\t\t}\n\n\t\tif (propertyIsOnObject(target, key) && options.isMergeableObject(source[key])) {\n\t\t\tdestination[key] = getMergeFunction(key, options)(target[key], source[key], options);\n\t\t} else {\n\t\t\tdestination[key] = cloneUnlessOtherwiseSpecified(source[key], options);\n\t\t}\n\t});\n\treturn destination\n}\n\nfunction deepmerge(target, source, options) {\n\toptions = options || {};\n\toptions.arrayMerge = options.arrayMerge || defaultArrayMerge;\n\toptions.isMergeableObject = options.isMergeableObject || isMergeableObject;\n\t// cloneUnlessOtherwiseSpecified is added to `options` so that custom arrayMerge()\n\t// implementations can use it. The caller may not replace it.\n\toptions.cloneUnlessOtherwiseSpecified = cloneUnlessOtherwiseSpecified;\n\n\tvar sourceIsArray = Array.isArray(source);\n\tvar targetIsArray = Array.isArray(target);\n\tvar sourceAndTargetTypesMatch = sourceIsArray === targetIsArray;\n\n\tif (!sourceAndTargetTypesMatch) {\n\t\treturn cloneUnlessOtherwiseSpecified(source, options)\n\t} else if (sourceIsArray) {\n\t\treturn options.arrayMerge(target, source, options)\n\t} else {\n\t\treturn mergeObject(target, source, options)\n\t}\n}\n\ndeepmerge.all = function deepmergeAll(array, options) {\n\tif (!Array.isArray(array)) {\n\t\tthrow new Error('first argument should be an array')\n\t}\n\n\treturn array.reduce(function(prev, next) {\n\t\treturn deepmerge(prev, next, options)\n\t}, {})\n};\n\nvar deepmerge_1 = deepmerge;\n\nmodule.exports = deepmerge_1;\n","export const debounce = (fn: Function, ms: number) => {\n let timeoutId: ReturnType<typeof setTimeout>;\n return function (this: any, ...args: any[]) {\n clearTimeout(timeoutId);\n timeoutId = setTimeout(() => fn.apply(this, args), ms);\n };\n};\n","import { getImageParamsKeyMap } from '@adobe/elsie/lib/';\n\nconst BREAKPOINTS = {\n medium: 768,\n large: 1024,\n xlarge: 1366,\n xxlarge: 1920,\n};\n\nexport interface ResolveImageUrlOptions {\n width: number;\n height?: number;\n auto?: string;\n quality?: number;\n crop?: boolean;\n fit?: string;\n}\n\nconst resolveImageUrl = (url: string, _opts?: ResolveImageUrlOptions) => {\n const [base, query] = url.split('?');\n const params = new URLSearchParams(query);\n\n const keyMapping = getImageParamsKeyMap();\n\n let opts = {};\n\n if (keyMapping && Object.keys(keyMapping).length > 0 && _opts) {\n opts = Object.entries(_opts).reduce((acc, [key, value]) => {\n const newKey = keyMapping[key];\n if (newKey) {\n acc[newKey] = value;\n }\n return acc;\n }, {} as { [key: string]: any });\n } else {\n opts = {\n auto: 'webp',\n quality: 80,\n crop: false,\n fit: 'cover',\n ..._opts,\n };\n }\n // Append image optimization parameters\n Object.entries(opts).forEach(([key, value]) => {\n if (value !== undefined && value !== null) {\n params.set(key, String(value));\n }\n });\n\n return `${base}?${params.toString()}`;\n};\n\nexport const generateSrcset = (\n imageURL: string,\n options: ResolveImageUrlOptions\n) => {\n if (!imageURL || !options?.width) return;\n\n const generateSrcsetUrl = (options: ResolveImageUrlOptions) => {\n return resolveImageUrl(imageURL, {\n ...options,\n });\n };\n\n return Object.entries(BREAKPOINTS)\n .map(([, value]) => {\n // calculate breakpoints width\n const relativeWidth = (options.width * value) / BREAKPOINTS.xxlarge;\n\n return `${generateSrcsetUrl({\n ...options,\n width: relativeWidth,\n })} ${value}w`;\n })\n .join(',\\n');\n};\n","/*\nADOBE CONFIDENTIAL\nCopyright 2023 Adobe\nAll Rights Reserved.\nNOTICE: All information contained herein is, and remains\nthe property of Adobe and its suppliers, if any. The intellectual\nand technical concepts contained herein are proprietary to Adobe\nand its suppliers and are protected by all applicable intellectual\nproperty laws, including trade secret and copyright laws.\nDissemination of this information or reproduction of this material\nis strictly forbidden unless prior written permission is obtained\nfrom Adobe.\n*/\n\nimport { VNode, ComponentChildren } from 'preact';\nimport { classes } from '.';\n\nexport type VComponentProps = {\n node: VNode | VNode[];\n children?: ComponentChildren;\n [key: string]: any; // allow other unspecified props to be passed without any TS warning\n};\n\nexport function VComponent({ node, ...props }: VComponentProps) {\n if (!node) return null;\n\n if (Array.isArray(node)) {\n return (\n <>\n {node.map((n, key) => (\n <VComponent\n key={key}\n node={n}\n className={props.className}\n {...props}\n />\n ))}\n </>\n );\n }\n\n // @ts-ignore\n props.className = classes([node.props.className, props.className]);\n\n // @ts-ignore\n return <node.type ref={node.ref} key={node.key} {...node.props} {...props} />;\n}\n"],"names":["getFormValues","form","formData","FormData","result","Object","fromEntries","getFormErrors","data","entries","reduce","key","field","elements","validationMessage","classes","item","Array","isArray","className","isActive","trim","isMergeableObject","value","isNonNullObject","isSpecial","stringValue","isReactElement","canUseSymbol","REACT_ELEMENT_TYPE","emptyTarget","val","cloneUnlessOtherwiseSpecified","options","deepmerge","defaultArrayMerge","target","source","element","getMergeFunction","customMerge","getEnumerableOwnPropertySymbols","symbol","getKeys","propertyIsOnObject","object","property","propertyIsUnsafe","mergeObject","destination","sourceIsArray","targetIsArray","sourceAndTargetTypesMatch","array","prev","next","deepmerge_1","cjs","debounce","fn","ms","timeoutId","args","clearTimeout","setTimeout","apply","BREAKPOINTS","medium","large","xlarge","xxlarge","resolveImageUrl","url","_opts","base","query","split","params","URLSearchParams","keyMapping","getImageParamsKeyMap","opts","keys","length","acc","newKey","auto","quality","crop","fit","forEach","set","String","toString","generateSrcset","imageURL","width","generateSrcsetUrl","map","relativ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