@adobe-commerce/elsie 2.0.0 → 2.0.1-alpha-20260728135101
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/.elsie.js +3 -3
- package/CHANGELOG.md +385 -112
- package/LICENSE.md +257 -157
- package/README.md +4 -2
- package/__mocks__/svg.js +3 -3
- package/bin/builders/build/index.js +2 -1
- package/bin/builders/changeset/index.js +1 -1
- package/bin/builders/concurrently/index.js +1 -1
- package/bin/builders/generate/api/index.js +7 -7
- package/bin/builders/generate/component/index.js +8 -8
- package/bin/builders/generate/config/index.js +5 -5
- package/bin/builders/generate/config/templates/elsie.js +1 -1
- package/bin/builders/generate/container/index.js +7 -7
- package/bin/builders/generate/index.js +36 -36
- package/bin/builders/gql/index.js +28 -28
- package/bin/builders/gql/validate.js +116 -105
- package/bin/builders/lint/index.js +1 -1
- package/bin/builders/serve/index.js +1 -1
- package/bin/builders/storybook/index.js +9 -1
- package/bin/builders/types/index.js +1 -2
- package/bin/builders/types/validate-tsconfig.js +5 -5
- package/bin/index.js +12 -6
- package/bin/lib/cli.js +9 -8
- package/bin/lib/resolve-bin.js +9 -0
- package/bin/lib/validate-typeof.js +3 -3
- package/bin/lib/write-file.js +3 -3
- package/bin/lib/write-parent-index.js +4 -4
- package/config/eslint.mjs +2 -1
- package/config/jest.mjs +7 -2
- package/config/plugins/dts-normalize-relative-replacer.cjs +1 -1
- package/config/plugins/dts.mjs +4 -3
- package/config/prettier.json +25 -3
- package/config/setEnvVars.mjs +2 -2
- package/config/storybook/addon.js +5 -5
- package/config/storybook/components/FileTree/FileTree.jsx +4 -4
- package/config/storybook/components/FileTree/index.js +4 -4
- package/config/storybook/components/Flex/Flex.jsx +3 -3
- package/config/storybook/components/Flex/index.js +3 -3
- package/config/storybook/components/OptionsTable/OptionsTable.jsx +3 -3
- package/config/storybook/components/OptionsTable/index.js +4 -4
- package/config/storybook/components/Panel/Panel.tsx +7 -7
- package/config/storybook/components/Panel/index.ts +3 -3
- package/config/storybook/components/Screenshot/Screenshot.jsx +3 -3
- package/config/storybook/components/Screenshot/index.js +4 -4
- package/config/storybook/components/Steps/Steps.jsx +3 -3
- package/config/storybook/components/Steps/index.js +4 -4
- package/config/storybook/components/StoryWrapper/StoryWrapper.jsx +3 -3
- package/config/storybook/components/StoryWrapper/index.js +3 -3
- package/config/storybook/components/Summary/Summary.jsx +3 -3
- package/config/storybook/components/Summary/index.js +3 -3
- package/config/storybook/components/Variants/Variants.jsx +11 -7
- package/config/storybook/components/Variants/index.js +3 -3
- package/config/storybook/manager.js +3 -3
- package/config/storybook/preview.jsx +3 -3
- package/config/storybook/theming/fonts.css +12 -4
- package/config/storybook/theming/preview.css +3 -1
- package/config/storybook/theming/theme.js +3 -3
- package/config/vite.mjs +53 -26
- package/package.json +36 -34
- package/src/components/Accordion/Accordion.css +1 -1
- package/src/components/Accordion/Accordion.stories.tsx +18 -18
- package/src/components/Accordion/Accordion.tsx +12 -8
- package/src/components/Accordion/index.ts +3 -3
- package/src/components/ActionButton/ActionButton.stories.tsx +8 -8
- package/src/components/ActionButton/ActionButton.tsx +7 -5
- package/src/components/ActionButton/index.ts +3 -3
- package/src/components/ActionButtonGroup/ActionButtonGroup.stories.tsx +3 -3
- package/src/components/ActionButtonGroup/ActionButtonGroup.tsx +2 -2
- package/src/components/ActionButtonGroup/index.ts +3 -3
- package/src/components/AlertBanner/AlertBanner.stories.tsx +6 -6
- package/src/components/AlertBanner/AlertBanner.tsx +12 -10
- package/src/components/AlertBanner/index.ts +3 -3
- package/src/components/Breadcrumbs/Breadcrumbs.stories.tsx +14 -14
- package/src/components/Breadcrumbs/Breadcrumbs.tsx +3 -3
- package/src/components/Breadcrumbs/index.ts +3 -3
- package/src/components/Button/Button.mdx +24 -11
- package/src/components/Button/Button.stories.tsx +6 -6
- package/src/components/Button/Button.tsx +7 -8
- package/src/components/Button/index.ts +3 -3
- package/src/components/Card/Card.stories.tsx +6 -6
- package/src/components/Card/Card.tsx +3 -3
- package/src/components/Card/index.ts +3 -3
- package/src/components/CartItem/CartItem.stories.tsx +12 -12
- package/src/components/CartItem/CartItem.tsx +4 -2
- package/src/components/CartItem/CartItemSkeleton.tsx +3 -3
- package/src/components/CartItem/index.ts +3 -3
- package/src/components/CartList/CartList.tsx +3 -3
- package/src/components/CartList/index.ts +3 -3
- package/src/components/Checkbox/Checkbox.stories.tsx +17 -14
- package/src/components/Checkbox/Checkbox.tsx +8 -6
- package/src/components/Checkbox/index.ts +3 -3
- package/src/components/ColorSwatch/ColorSwatch.css +8 -4
- package/src/components/ColorSwatch/ColorSwatch.stories.tsx +6 -6
- package/src/components/ColorSwatch/ColorSwatch.tsx +8 -6
- package/src/components/ColorSwatch/index.ts +3 -3
- package/src/components/ContentGrid/ContentGrid.css +15 -15
- package/src/components/ContentGrid/ContentGrid.stories.tsx +4 -4
- package/src/components/ContentGrid/ContentGrid.tsx +3 -3
- package/src/components/ContentGrid/index.ts +3 -3
- package/src/components/Divider/Divider.stories.tsx +7 -4
- package/src/components/Divider/Divider.tsx +3 -3
- package/src/components/Divider/index.ts +4 -4
- package/src/components/Field/Field.stories.tsx +7 -7
- package/src/components/Field/Field.tsx +4 -2
- package/src/components/Field/index.ts +3 -3
- package/src/components/Header/Header.stories.tsx +9 -10
- package/src/components/Header/Header.tsx +11 -7
- package/src/components/Header/index.ts +3 -3
- package/src/components/Icon/Icon.stories.helpers.jsx +4 -4
- package/src/components/Icon/Icon.stories.tsx +74 -60
- package/src/components/Icon/Icon.tsx +77 -44
- package/src/components/Icon/index.ts +3 -3
- package/src/components/IllustratedMessage/IllustratedMessage.stories.tsx +8 -8
- package/src/components/IllustratedMessage/IllustratedMessage.tsx +7 -5
- package/src/components/IllustratedMessage/index.ts +3 -3
- package/src/components/Image/Image.stories.tsx +3 -3
- package/src/components/Image/Image.tsx +4 -4
- package/src/components/Image/index.ts +3 -3
- package/src/components/ImageSwatch/ImageSwatch.css +8 -4
- package/src/components/ImageSwatch/ImageSwatch.stories.tsx +10 -10
- package/src/components/ImageSwatch/ImageSwatch.tsx +25 -23
- package/src/components/ImageSwatch/index.ts +3 -3
- package/src/components/InLineAlert/InLineAlert.stories.tsx +12 -7
- package/src/components/InLineAlert/InLineAlert.tsx +4 -2
- package/src/components/InLineAlert/index.ts +3 -3
- package/src/components/Incrementer/Incrementer.stories.tsx +9 -9
- package/src/components/Incrementer/Incrementer.tsx +75 -37
- package/src/components/Incrementer/index.ts +3 -3
- package/src/components/Input/Input.css +4 -1
- package/src/components/Input/Input.stories.tsx +5 -5
- package/src/components/Input/Input.tsx +5 -3
- package/src/components/Input/index.ts +3 -3
- package/src/components/InputDate/InputDate.tsx +3 -3
- package/src/components/InputDate/index.ts +3 -3
- package/src/components/InputFile/InputFile.css +16 -16
- package/src/components/InputFile/InputFile.stories.tsx +21 -16
- package/src/components/InputFile/InputFile.tsx +8 -6
- package/src/components/InputFile/index.ts +5 -5
- package/src/components/InputPassword/InputPassword.stories.tsx +4 -4
- package/src/components/InputPassword/InputPassword.tsx +5 -4
- package/src/components/InputPassword/PasswordStatusIndicator/PasswordStatusIndicator.tsx +1 -1
- package/src/components/InputPassword/PasswordStatusIndicator/index.ts +3 -3
- package/src/components/InputPassword/index.ts +3 -3
- package/src/components/Modal/Modal.stories.tsx +27 -16
- package/src/components/Modal/Modal.tsx +10 -11
- package/src/components/Modal/index.ts +3 -3
- package/src/components/MultiSelect/MultiSelect.stories.tsx +15 -15
- package/src/components/MultiSelect/MultiSelect.tsx +15 -15
- package/src/components/Pagination/Pagination.css +1 -1
- package/src/components/Pagination/Pagination.stories.tsx +0 -1
- package/src/components/Pagination/Pagination.tsx +17 -12
- package/src/components/Pagination/PaginationButton.tsx +2 -3
- package/src/components/Pagination/index.ts +3 -3
- package/src/components/Picker/Picker.css +3 -1
- package/src/components/Picker/Picker.stories.tsx +1 -1
- package/src/components/Picker/Picker.tsx +8 -6
- package/src/components/Picker/index.ts +3 -3
- package/src/components/Portal/Portal.stories.tsx +50 -44
- package/src/components/Portal/Portal.tsx +4 -4
- package/src/components/Price/Price.stories.tsx +3 -3
- package/src/components/Price/Price.tsx +4 -2
- package/src/components/Price/index.ts +3 -3
- package/src/components/PriceRange/PriceRange.stories.tsx +3 -3
- package/src/components/PriceRange/PriceRange.tsx +8 -6
- package/src/components/PriceRange/index.ts +3 -3
- package/src/components/ProductItemCard/ProductItemCard.tsx +4 -2
- package/src/components/ProductItemCard/ProductItemCardSkeleton.tsx +16 -16
- package/src/components/ProductItemCard/index.ts +4 -4
- package/src/components/ProgressSpinner/ProgressSpinner.stories.tsx +8 -8
- package/src/components/ProgressSpinner/ProgressSpinner.tsx +7 -5
- package/src/components/ProgressSpinner/index.ts +3 -3
- package/src/components/RadioButton/RadioButton.stories.tsx +1 -1
- package/src/components/RadioButton/RadioButton.tsx +4 -2
- package/src/components/Skeleton/Skeleton.stories.tsx +4 -4
- package/src/components/Skeleton/Skeleton.tsx +11 -7
- package/src/components/Skeleton/index.ts +3 -3
- package/src/components/Table/Table.css +106 -99
- package/src/components/Table/Table.stories.tsx +404 -227
- package/src/components/Table/Table.tsx +11 -7
- package/src/components/Table/index.ts +4 -4
- package/src/components/Tag/Tag.stories.tsx +6 -6
- package/src/components/Tag/Tag.tsx +7 -5
- package/src/components/Tag/index.ts +3 -3
- package/src/components/TextArea/TextArea.css +3 -1
- package/src/components/TextArea/TextArea.stories.tsx +9 -6
- package/src/components/TextArea/TextArea.tsx +3 -3
- package/src/components/TextArea/index.ts +3 -3
- package/src/components/TextSwatch/TextSwatch.css +4 -2
- package/src/components/TextSwatch/TextSwatch.stories.tsx +8 -8
- package/src/components/TextSwatch/TextSwatch.tsx +12 -7
- package/src/components/TextSwatch/index.ts +3 -3
- package/src/components/ToggleButton/ToggleButton.css +6 -2
- package/src/components/ToggleButton/ToggleButton.stories.tsx +10 -6
- package/src/components/ToggleButton/ToggleButton.tsx +8 -3
- package/src/components/ToggleButton/index.ts +3 -3
- package/src/components/UIProvider/UIProvider.css +3 -2
- package/src/components/UIProvider/UIProvider.tsx +11 -7
- package/src/components/UIProvider/debugger.css +5 -6
- package/src/components/UIProvider/index.ts +3 -3
- package/src/docs/API/event-bus.mdx +64 -37
- package/src/docs/API/graphql.mdx +69 -36
- package/src/docs/API/initializer.mdx +58 -35
- package/src/docs/API/render.mdx +45 -32
- package/src/docs/Design/colors.mdx +10 -12
- package/src/docs/Design/grid.mdx +41 -14
- package/src/docs/Design/overview.mdx +20 -4
- package/src/docs/Design/shapes.mdx +8 -7
- package/src/docs/Design/spacing.mdx +3 -1
- package/src/docs/Design/typography.mdx +3 -2
- package/src/docs/Utilities/VComponent.mdx +27 -10
- package/src/docs/Utilities/classList.mdx +7 -5
- package/src/docs/Utilities/debounce.mdx +6 -7
- package/src/docs/Utilities/getCookie.mdx +1 -2
- package/src/docs/Utilities/getFormErrors.mdx +1 -2
- package/src/docs/Utilities/getFormValues.mdx +1 -2
- package/src/docs/Utilities/getPathValue.mdx +2 -4
- package/src/docs/Utilities/links.mdx +16 -7
- package/src/docs/cli-usage.mdx +8 -3
- package/src/docs/components/overview.mdx +14 -4
- package/src/docs/quick-start.mdx +69 -22
- package/src/docs/slots.mdx +74 -37
- package/src/docs/welcome.mdx +13 -4
- package/src/i18n/index.ts +3 -3
- package/src/lib/aem/assets.ts +9 -9
- package/src/lib/aem/configs.ts +16 -8
- package/src/lib/classes.ts +4 -4
- package/src/lib/config.ts +3 -3
- package/src/lib/debounce.ts +3 -3
- package/src/lib/deepmerge.ts +6 -13
- package/src/lib/deviceUtils.ts +3 -3
- package/src/lib/form-values.ts +3 -3
- package/src/lib/get-price-formatter.ts +8 -3
- package/src/lib/i18n.ts +3 -3
- package/src/lib/image-params-keymap.ts +4 -5
- package/src/lib/initializer.ts +11 -12
- package/src/lib/is-number.ts +3 -3
- package/src/lib/locale-config.ts +4 -4
- package/src/lib/render.tsx +14 -8
- package/src/lib/resolve-image.ts +19 -16
- package/src/lib/signals.ts +4 -4
- package/src/lib/slot.tsx +34 -27
- package/src/lib/tests.tsx +6 -8
- package/src/lib/types.ts +3 -3
- package/src/lib/vcomponent.tsx +3 -3
- package/src/shims/importmap.js +3107 -20
- package/static/assets/images/index.ts +3 -3
- package/storybook-stories.js +3 -3
- package/tests/__mocks__/browserMocks.ts +3 -3
- package/tests/__mocks__/fileMocks.ts +3 -3
package/src/lib/slot.tsx
CHANGED
|
@@ -45,10 +45,13 @@ interface SlotElement {
|
|
|
45
45
|
interface PrivateContext<T> {
|
|
46
46
|
_setProps: (s: StateUpdater<{}>) => void;
|
|
47
47
|
_registerMethod: (
|
|
48
|
-
cb: (next: T & DefaultSlotContext<T>, state: State) => void
|
|
48
|
+
cb: (next: T & DefaultSlotContext<T>, state: State) => void,
|
|
49
49
|
) => void;
|
|
50
50
|
// eslint-disable-next-line no-undef
|
|
51
|
-
_htmlElementToVNode: (
|
|
51
|
+
_htmlElementToVNode: (
|
|
52
|
+
element: HTMLElement,
|
|
53
|
+
tag: keyof HTMLElementTagNameMap,
|
|
54
|
+
) => VNode;
|
|
52
55
|
}
|
|
53
56
|
|
|
54
57
|
interface DefaultSlotContext<T> extends PrivateContext<T> {
|
|
@@ -68,11 +71,11 @@ type Context<T> = T & ThisType<DefaultSlotContext<T>>; // NOSONAR
|
|
|
68
71
|
|
|
69
72
|
export type SlotProps<T = any> = (
|
|
70
73
|
ctx: T & DefaultSlotContext<T>,
|
|
71
|
-
element: HTMLDivElement | null
|
|
74
|
+
element: HTMLDivElement | null,
|
|
72
75
|
) => Promise<void> | void;
|
|
73
76
|
|
|
74
77
|
export type SlotMethod<P = any> = (
|
|
75
|
-
callback: (next: unknown, state: State) => P
|
|
78
|
+
callback: (next: unknown, state: State) => P,
|
|
76
79
|
) => void;
|
|
77
80
|
|
|
78
81
|
// Slot Hook
|
|
@@ -84,7 +87,7 @@ export function useSlot<K, V extends HTMLElement>(
|
|
|
84
87
|
children?: ComponentChildren,
|
|
85
88
|
render?: Function,
|
|
86
89
|
// eslint-disable-next-line no-undef
|
|
87
|
-
contentTag: keyof HTMLElementTagNameMap = 'div'
|
|
90
|
+
contentTag: keyof HTMLElementTagNameMap = 'div',
|
|
88
91
|
): [RefObject<V>, Record<string, any>, 'loading' | 'pending' | 'ready'] {
|
|
89
92
|
const slotsQueue = useContext(SlotQueueContext);
|
|
90
93
|
|
|
@@ -111,7 +114,7 @@ export function useSlot<K, V extends HTMLElement>(
|
|
|
111
114
|
setState({ ...state, [key]: value });
|
|
112
115
|
},
|
|
113
116
|
}),
|
|
114
|
-
[_state]
|
|
117
|
+
[_state],
|
|
115
118
|
);
|
|
116
119
|
|
|
117
120
|
/** Internationalization */
|
|
@@ -164,10 +167,10 @@ export function useSlot<K, V extends HTMLElement>(
|
|
|
164
167
|
refElem?.appendChild(elem);
|
|
165
168
|
},
|
|
166
169
|
},
|
|
167
|
-
null
|
|
170
|
+
null,
|
|
168
171
|
);
|
|
169
172
|
},
|
|
170
|
-
[contentTag]
|
|
173
|
+
[contentTag],
|
|
171
174
|
);
|
|
172
175
|
|
|
173
176
|
// @ts-ignore
|
|
@@ -178,13 +181,13 @@ export function useSlot<K, V extends HTMLElement>(
|
|
|
178
181
|
context.getSlotElement = useCallback(
|
|
179
182
|
(key: string) => {
|
|
180
183
|
const element = elementRef.current?.querySelector(
|
|
181
|
-
`[data-slot-key="${key}"]
|
|
184
|
+
`[data-slot-key="${key}"]`,
|
|
182
185
|
);
|
|
183
186
|
|
|
184
187
|
log(
|
|
185
188
|
`🟦 "${name}" Slot getSlotElement: ${key}`,
|
|
186
189
|
elementRef.current?.cloneNode(true),
|
|
187
|
-
element?.cloneNode(true)
|
|
190
|
+
element?.cloneNode(true),
|
|
188
191
|
);
|
|
189
192
|
|
|
190
193
|
if (!element) return;
|
|
@@ -213,7 +216,7 @@ export function useSlot<K, V extends HTMLElement>(
|
|
|
213
216
|
},
|
|
214
217
|
};
|
|
215
218
|
},
|
|
216
|
-
[name]
|
|
219
|
+
[name],
|
|
217
220
|
);
|
|
218
221
|
|
|
219
222
|
// @ts-ignore
|
|
@@ -238,7 +241,7 @@ export function useSlot<K, V extends HTMLElement>(
|
|
|
238
241
|
next._setProps({ children: [children] });
|
|
239
242
|
});
|
|
240
243
|
},
|
|
241
|
-
[_htmlElementToVNode, _registerMethod]
|
|
244
|
+
[_htmlElementToVNode, _registerMethod],
|
|
242
245
|
);
|
|
243
246
|
|
|
244
247
|
// @ts-ignore
|
|
@@ -257,7 +260,7 @@ export function useSlot<K, V extends HTMLElement>(
|
|
|
257
260
|
});
|
|
258
261
|
});
|
|
259
262
|
},
|
|
260
|
-
[_htmlElementToVNode, _registerMethod]
|
|
263
|
+
[_htmlElementToVNode, _registerMethod],
|
|
261
264
|
);
|
|
262
265
|
|
|
263
266
|
// @ts-ignore
|
|
@@ -276,7 +279,7 @@ export function useSlot<K, V extends HTMLElement>(
|
|
|
276
279
|
});
|
|
277
280
|
});
|
|
278
281
|
},
|
|
279
|
-
[_htmlElementToVNode, _registerMethod]
|
|
282
|
+
[_htmlElementToVNode, _registerMethod],
|
|
280
283
|
);
|
|
281
284
|
|
|
282
285
|
// @ts-ignore
|
|
@@ -289,7 +292,7 @@ export function useSlot<K, V extends HTMLElement>(
|
|
|
289
292
|
parent?.insertBefore(elem, elementRef.current?.nextSibling ?? null);
|
|
290
293
|
});
|
|
291
294
|
},
|
|
292
|
-
[_registerMethod]
|
|
295
|
+
[_registerMethod],
|
|
293
296
|
);
|
|
294
297
|
|
|
295
298
|
// @ts-ignore
|
|
@@ -302,7 +305,7 @@ export function useSlot<K, V extends HTMLElement>(
|
|
|
302
305
|
parent?.insertBefore(elem, elementRef.current);
|
|
303
306
|
});
|
|
304
307
|
},
|
|
305
|
-
[_registerMethod]
|
|
308
|
+
[_registerMethod],
|
|
306
309
|
);
|
|
307
310
|
|
|
308
311
|
// @ts-ignore
|
|
@@ -344,7 +347,7 @@ export function useSlot<K, V extends HTMLElement>(
|
|
|
344
347
|
log(`🟩 "${name}" Slot Initialized`);
|
|
345
348
|
await callback(
|
|
346
349
|
context as K & DefaultSlotContext<K>,
|
|
347
|
-
elementRef.current as HTMLDivElement | null
|
|
350
|
+
elementRef.current as HTMLDivElement | null,
|
|
348
351
|
);
|
|
349
352
|
} catch (error) {
|
|
350
353
|
console.error(`Error in "${callback.name}" Slot callback`, error);
|
|
@@ -380,18 +383,18 @@ export function useSlot<K, V extends HTMLElement>(
|
|
|
380
383
|
|
|
381
384
|
/**
|
|
382
385
|
* Recursively processes children elements to conditionally prevent image loading.
|
|
383
|
-
*
|
|
386
|
+
*
|
|
384
387
|
* This function traverses the children tree and modifies img elements to prevent
|
|
385
388
|
* premature loading during slot initialization. When isReady is false, img src
|
|
386
389
|
* attributes are set to empty string to prevent network requests, while preserving
|
|
387
390
|
* the original src in a data attribute for debugging purposes.
|
|
388
|
-
*
|
|
391
|
+
*
|
|
389
392
|
* @param children - The children elements to process (can be any React/Preact children)
|
|
390
393
|
* @param isReady - Whether the slot is ready to load images (true) or should prevent loading (false)
|
|
391
394
|
* @returns Processed children with conditional image src attributes
|
|
392
395
|
*/
|
|
393
396
|
const processChildren = (children: any, isReady: boolean): any => {
|
|
394
|
-
return Children.map(children, child => {
|
|
397
|
+
return Children.map(children, (child) => {
|
|
395
398
|
// Handle text nodes, numbers, etc.
|
|
396
399
|
if (!isValidElement(child)) {
|
|
397
400
|
return child;
|
|
@@ -401,7 +404,7 @@ const processChildren = (children: any, isReady: boolean): any => {
|
|
|
401
404
|
if (child.props.src) {
|
|
402
405
|
return cloneElement(child, {
|
|
403
406
|
...child.props,
|
|
404
|
-
src: isReady ? child.props.src :
|
|
407
|
+
src: isReady ? child.props.src : '',
|
|
405
408
|
// Optionally preserve original src in data attribute for debugging
|
|
406
409
|
'data-original-src': child.props.src,
|
|
407
410
|
});
|
|
@@ -421,8 +424,10 @@ const processChildren = (children: any, isReady: boolean): any => {
|
|
|
421
424
|
};
|
|
422
425
|
|
|
423
426
|
// Slot Component
|
|
424
|
-
interface SlotPropsComponent<T>
|
|
425
|
-
|
|
427
|
+
interface SlotPropsComponent<T> extends Omit<
|
|
428
|
+
HTMLAttributes<HTMLElement>,
|
|
429
|
+
'slot'
|
|
430
|
+
> {
|
|
426
431
|
name: string;
|
|
427
432
|
lazy?: boolean;
|
|
428
433
|
slot?: SlotProps<T>;
|
|
@@ -458,7 +463,7 @@ export function Slot<T>({
|
|
|
458
463
|
slot,
|
|
459
464
|
children,
|
|
460
465
|
render,
|
|
461
|
-
contentTag
|
|
466
|
+
contentTag,
|
|
462
467
|
);
|
|
463
468
|
|
|
464
469
|
useMemo(() => {
|
|
@@ -480,7 +485,7 @@ export function Slot<T>({
|
|
|
480
485
|
ref: elementRef,
|
|
481
486
|
'data-slot': name,
|
|
482
487
|
},
|
|
483
|
-
processChildren(slotProps.children, status === 'ready')
|
|
488
|
+
processChildren(slotProps.children, status === 'ready'),
|
|
484
489
|
);
|
|
485
490
|
}
|
|
486
491
|
|
|
@@ -491,7 +496,9 @@ window.DROPINS = window.DROPINS || {};
|
|
|
491
496
|
|
|
492
497
|
// @ts-ignore
|
|
493
498
|
window.DROPINS.showSlots = async (state) => {
|
|
494
|
-
console.warn(
|
|
499
|
+
console.warn(
|
|
500
|
+
'[Dropins] DROPINS.showSlots() is deprecated. Use DROPINS.showOverlays() instead.',
|
|
501
|
+
);
|
|
495
502
|
// @ts-ignore
|
|
496
503
|
await window.DROPINS.showOverlays?.(state);
|
|
497
504
|
};
|
|
@@ -510,5 +517,5 @@ window.DROPINS.logSlots = async (state) => {
|
|
|
510
517
|
|
|
511
518
|
// @ts-ignore
|
|
512
519
|
window.DROPINS.logSlots(
|
|
513
|
-
window.sessionStorage.getItem('dropin-debugger--log-slots') === 'true'
|
|
520
|
+
window.sessionStorage.getItem('dropin-debugger--log-slots') === 'true',
|
|
514
521
|
);
|
package/src/lib/tests.tsx
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
* Copyright 2024 Adobe
|
|
3
3
|
* All Rights Reserved.
|
|
4
4
|
*
|
|
5
|
-
* NOTICE: Adobe permits you to use, modify, and distribute this
|
|
6
|
-
* file in accordance with the terms of the Adobe license agreement
|
|
7
|
-
* accompanying it.
|
|
5
|
+
* NOTICE: Adobe permits you to use, modify, and distribute this
|
|
6
|
+
* file in accordance with the terms of the Adobe license agreement
|
|
7
|
+
* accompanying it.
|
|
8
8
|
*******************************************************************/
|
|
9
9
|
|
|
10
10
|
import {
|
|
@@ -34,14 +34,12 @@ const langDefinitions = jsonFiles.reduce((acc, file) => {
|
|
|
34
34
|
|
|
35
35
|
export const render = (
|
|
36
36
|
ui: any,
|
|
37
|
-
options?: Omit<RenderOptions, 'queries'
|
|
37
|
+
options?: Omit<RenderOptions, 'queries'>,
|
|
38
38
|
): RenderResult => {
|
|
39
39
|
return originalRender(
|
|
40
40
|
<UIProvider lang={'en_US'} langDefinitions={langDefinitions}>
|
|
41
|
-
<div className="dropin-design">
|
|
42
|
-
{ui}
|
|
43
|
-
</div>
|
|
41
|
+
<div className="dropin-design">{ui}</div>
|
|
44
42
|
</UIProvider>,
|
|
45
|
-
options
|
|
43
|
+
options,
|
|
46
44
|
);
|
|
47
45
|
};
|
package/src/lib/types.ts
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
* Copyright 2024 Adobe
|
|
3
3
|
* All Rights Reserved.
|
|
4
4
|
*
|
|
5
|
-
* NOTICE: Adobe permits you to use, modify, and distribute this
|
|
6
|
-
* file in accordance with the terms of the Adobe license agreement
|
|
7
|
-
* accompanying it.
|
|
5
|
+
* NOTICE: Adobe permits you to use, modify, and distribute this
|
|
6
|
+
* file in accordance with the terms of the Adobe license agreement
|
|
7
|
+
* accompanying it.
|
|
8
8
|
*******************************************************************/
|
|
9
9
|
|
|
10
10
|
import { FunctionComponent } from 'preact';
|
package/src/lib/vcomponent.tsx
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
* Copyright 2024 Adobe
|
|
3
3
|
* All Rights Reserved.
|
|
4
4
|
*
|
|
5
|
-
* NOTICE: Adobe permits you to use, modify, and distribute this
|
|
6
|
-
* file in accordance with the terms of the Adobe license agreement
|
|
7
|
-
* accompanying it.
|
|
5
|
+
* NOTICE: Adobe permits you to use, modify, and distribute this
|
|
6
|
+
* file in accordance with the terms of the Adobe license agreement
|
|
7
|
+
* accompanying it.
|
|
8
8
|
*******************************************************************/
|
|
9
9
|
|
|
10
10
|
import { VNode, ComponentChildren } from 'preact';
|