@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
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Convert locale from Magento standard to react-intl BCP 47 language tag
|
|
3
|
+
*
|
|
4
|
+
* @param {string} locale - A locale (e.g. `fr_FR`).
|
|
5
|
+
* @returns {string} A BCP 47 language tag (e.g. `fr-FR`).
|
|
6
|
+
*/
|
|
7
|
+
export declare const toLanguageTag: (locale: string) => string;
|
|
8
|
+
//# sourceMappingURL=i18n.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"i18n.d.ts","sourceRoot":"","sources":["../../../../src/lib/i18n.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,eAAO,MAAM,aAAa,WAAY,MAAM,WAE3C,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"image-params-keymap.d.ts","sourceRoot":"","sources":["../../../../src/lib/image-params-keymap.ts"],"names":[],"mappings":"AAuBA,eAAO,MAAgB,oBAAoB,UAVrB,OAAO,IAAI,CAAC,IAAI,WAUe,oBAAoB;;aACpD,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export * from './form-values';
|
|
2
|
+
export * from './classes';
|
|
3
|
+
export * from './deepmerge';
|
|
4
|
+
export * from './debounce';
|
|
5
|
+
export * from './resolve-image';
|
|
6
|
+
export * from './render';
|
|
7
|
+
export * from './i18n';
|
|
8
|
+
export * from './initializer';
|
|
9
|
+
export * from './config';
|
|
10
|
+
export * from './types';
|
|
11
|
+
export * from './slot';
|
|
12
|
+
export * from './vcomponent';
|
|
13
|
+
export * from './image-params-keymap';
|
|
14
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/index.ts"],"names":[],"mappings":"AAAA,cAAc,8BAA8B,CAAC;AAC7C,cAAc,0BAA0B,CAAC;AACzC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,yBAAyB,CAAC;AACxC,cAAc,uBAAuB,CAAC;AACtC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,yBAAyB,CAAC;AACxC,cAAc,wBAAwB,CAAC;AACvC,cAAc,uBAAuB,CAAC;AACtC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,sCAAsC,CAAC"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { Config } from '.';
|
|
2
|
+
|
|
3
|
+
type Listener = {
|
|
4
|
+
off(): void;
|
|
5
|
+
};
|
|
6
|
+
type Listeners<T> = (config?: T) => Array<Listener | undefined>;
|
|
7
|
+
type Init<T> = (config?: T) => Promise<void>;
|
|
8
|
+
type Options<T> = {
|
|
9
|
+
init: Init<T>;
|
|
10
|
+
listeners: Listeners<T>;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* The `Initializer` class is responsible for setting up event listeners and initializing a module with the given configuration.
|
|
14
|
+
*
|
|
15
|
+
* @template T - The type of the configuration object.
|
|
16
|
+
* @class
|
|
17
|
+
*/
|
|
18
|
+
export declare class Initializer<T> {
|
|
19
|
+
private _listeners;
|
|
20
|
+
listeners: Listeners<T>;
|
|
21
|
+
init: Init<T>;
|
|
22
|
+
config: Config<T>;
|
|
23
|
+
/**
|
|
24
|
+
* Creates an instance of Initializer.
|
|
25
|
+
* @param options - The initialization options.
|
|
26
|
+
* @param options.init - A function that initializes the module.
|
|
27
|
+
* @param options.listeners - A function that sets up event listeners.
|
|
28
|
+
*/
|
|
29
|
+
constructor({ init, listeners }: Options<T>);
|
|
30
|
+
}
|
|
31
|
+
type Initializers = [Initializer<any>, {
|
|
32
|
+
[key: string]: any;
|
|
33
|
+
} | undefined][];
|
|
34
|
+
/**
|
|
35
|
+
* The Initializers class provides methods to register, mount, and configure initializers.
|
|
36
|
+
*
|
|
37
|
+
* @class
|
|
38
|
+
*
|
|
39
|
+
* @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.
|
|
40
|
+
* @method mount - Mounts all registered initializers. This involves binding the event listeners and initializing the APIs for each initializer, in that order.
|
|
41
|
+
* @method setImageParamKeys - Sets the image parameter keys. These keys are used when initializing the APIs for the initializers.
|
|
42
|
+
*/
|
|
43
|
+
export declare class initializers {
|
|
44
|
+
static _initializers: Initializers;
|
|
45
|
+
static _mounted: boolean;
|
|
46
|
+
static _imageParamsKeyMap: {
|
|
47
|
+
[key: string]: string;
|
|
48
|
+
} | undefined;
|
|
49
|
+
/**
|
|
50
|
+
* 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.
|
|
51
|
+
* @param initializer - The initializer to register.
|
|
52
|
+
* @param options - Optional configuration for the initializer.
|
|
53
|
+
*/
|
|
54
|
+
static register(initializer: Initializer<any>, options?: {
|
|
55
|
+
[key: string]: any;
|
|
56
|
+
}): void;
|
|
57
|
+
/**
|
|
58
|
+
* Mounts all registered initializers. This involves binding the event listeners and initializing the APIs for each initializer, in that order.
|
|
59
|
+
*/
|
|
60
|
+
static mount(): void;
|
|
61
|
+
/**
|
|
62
|
+
* Sets the image parameter keys. These keys are used when initializing the APIs for the initializers.
|
|
63
|
+
* @param params - The image parameter keys.
|
|
64
|
+
*/
|
|
65
|
+
static setImageParamKeys(params: {
|
|
66
|
+
[key: string]: any;
|
|
67
|
+
}): void;
|
|
68
|
+
}
|
|
69
|
+
export {};
|
|
70
|
+
//# sourceMappingURL=initializer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"initializer.d.ts","sourceRoot":"","sources":["../../../../src/lib/initializer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAwB,MAAM,kBAAkB,CAAC;AAEhE,KAAK,QAAQ,GAAG;IAAE,GAAG,IAAI,IAAI,CAAA;CAAE,CAAC;AAEhC,KAAK,SAAS,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,KAAK,KAAK,CAAC,QAAQ,GAAG,SAAS,CAAC,CAAC;AAEhE,KAAK,IAAI,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;AAE7C,KAAK,OAAO,CAAC,CAAC,IAAI;IAAE,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC;IAAC,SAAS,EAAE,SAAS,CAAC,CAAC,CAAC,CAAA;CAAE,CAAC;AAE7D;;;;;GAKG;AACH,qBAAa,WAAW,CAAC,CAAC;IACxB,OAAO,CAAC,UAAU,CAAkB;IACpC,SAAS,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC;IACxB,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC;IACd,MAAM,YAA4B;IAElC;;;;;OAKG;gBACS,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,OAAO,CAAC,CAAC,CAAC;CAe5C;AAED,KAAK,YAAY,GAAG,CAAC,WAAW,CAAC,GAAG,CAAC,EAAE;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;CAAE,GAAG,SAAS,CAAC,EAAE,CAAC;AAE7E;;;;;;;;GAQG;AACH,qBAAa,YAAY;IACvB,MAAM,CAAC,aAAa,EAAE,YAAY,CAAM;IACxC,MAAM,CAAC,QAAQ,EAAE,OAAO,CAAS;IACjC,MAAM,CAAC,kBAAkB,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,GAAG,SAAS,CAAa;IAE7E;;;;OAIG;IACH,MAAM,CAAC,QAAQ,CACb,WAAW,EAAE,WAAW,CAAC,GAAG,CAAC,EAC7B,OAAO,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE;IAQlC;;OAEG;IACH,MAAM,CAAC,KAAK;IAgBZ;;;OAGG;IACH,MAAM,CAAC,iBAAiB,CAAC,MAAM,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE;CAGxD"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { VNode } from 'preact';
|
|
2
|
+
import { Container } from '.';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* The `Render` class provides methods to render and unmount components, as well as to render components to a string.
|
|
6
|
+
* @class
|
|
7
|
+
*
|
|
8
|
+
* @property {Function} render - Renders a component to a root element.
|
|
9
|
+
* @property {Function} unmount - Unmounts a component from a root element.
|
|
10
|
+
* @property {Function} toString - Renders a component to a string.
|
|
11
|
+
*/
|
|
12
|
+
export declare class Render {
|
|
13
|
+
private _provider;
|
|
14
|
+
constructor(provider: VNode<any>);
|
|
15
|
+
/**
|
|
16
|
+
* Renders a component to a root element.
|
|
17
|
+
* @param Component - The component to render.
|
|
18
|
+
* @param props - The component props.
|
|
19
|
+
*/
|
|
20
|
+
render<T>(Component: Container<T>, props: T): (rootElement: HTMLElement) => Promise<void>;
|
|
21
|
+
/**
|
|
22
|
+
* Unmounts a component from a root element.
|
|
23
|
+
* @param rootElement - The root element to unmount the component from.
|
|
24
|
+
*/
|
|
25
|
+
unmount(rootElement: HTMLElement): void;
|
|
26
|
+
/**
|
|
27
|
+
* Renders a component to a string.
|
|
28
|
+
* @param Component - The component to render.
|
|
29
|
+
* @param props - The component props.
|
|
30
|
+
* @param options - Optional rendering options.
|
|
31
|
+
*/
|
|
32
|
+
toString<T>(Component: Container<T>, props: T, options?: T): Promise<string>;
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=render.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"render.d.ts","sourceRoot":"","sources":["../../../../src/lib/render.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAU,KAAK,EAAE,MAAM,QAAQ,CAAC;AAEvC,OAAO,EAAE,SAAS,EAAc,MAAM,kBAAkB,CAAC;AAEzD;;;;;;;GAOG;AACH,qBAAa,MAAM;IACjB,OAAO,CAAC,SAAS,CAAa;gBAElB,QAAQ,EAAE,KAAK,CAAC,GAAG,CAAC;IAIhC;;;;OAIG;IAEH,MAAM,CAAC,CAAC,EAAE,SAAS,EAAE,SAAS,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,iBACd,WAAW;IAexC;;;OAGG;IACH,OAAO,CAAC,WAAW,EAAE,WAAW;IAMhC;;;;;OAKG;IAEG,QAAQ,CAAC,CAAC,EAAE,SAAS,EAAE,SAAS,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,OAAO,CAAC,EAAE,CAAC;CAajE"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export interface ResolveImageUrlOptions {
|
|
2
|
+
width: number;
|
|
3
|
+
height?: number;
|
|
4
|
+
auto?: string;
|
|
5
|
+
quality?: number;
|
|
6
|
+
crop?: boolean;
|
|
7
|
+
fit?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare const generateSrcset: (imageURL: string, options: ResolveImageUrlOptions) => string | undefined;
|
|
10
|
+
//# sourceMappingURL=resolve-image.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolve-image.d.ts","sourceRoot":"","sources":["../../../../src/lib/resolve-image.ts"],"names":[],"mappings":"AASA,MAAM,WAAW,sBAAsB;IACrC,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAqCD,eAAO,MAAM,cAAc,aACf,MAAM,WACP,sBAAsB,uBAqBhC,CAAC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { RefObject, VNode } from 'preact';
|
|
2
|
+
import { StateUpdater } from 'preact/hooks';
|
|
3
|
+
import { Lang } from '../i18n';
|
|
4
|
+
import { HTMLAttributes } from 'preact/compat';
|
|
5
|
+
|
|
6
|
+
type MutateElement = (elem: HTMLElement) => void;
|
|
7
|
+
interface State {
|
|
8
|
+
get: (key: string) => void;
|
|
9
|
+
set: (key: string, value: any) => void;
|
|
10
|
+
}
|
|
11
|
+
interface SlotElement {
|
|
12
|
+
appendChild: MutateElement;
|
|
13
|
+
prependChild: MutateElement;
|
|
14
|
+
appendSibling: MutateElement;
|
|
15
|
+
prependSibling: MutateElement;
|
|
16
|
+
}
|
|
17
|
+
interface PrivateContext<T> {
|
|
18
|
+
_setProps: (s: StateUpdater<{}>) => void;
|
|
19
|
+
_registerMethod: (cb: (next: T & DefaultSlotContext<T>, state: State) => void) => void;
|
|
20
|
+
_htmlElementToVNode: (element: HTMLElement) => VNode;
|
|
21
|
+
}
|
|
22
|
+
interface DefaultSlotContext<T> extends PrivateContext<T> {
|
|
23
|
+
dictionary: Lang;
|
|
24
|
+
getSlotElement: (key: string) => SlotElement;
|
|
25
|
+
replaceWith: MutateElement;
|
|
26
|
+
appendChild: MutateElement;
|
|
27
|
+
prependChild: MutateElement;
|
|
28
|
+
appendSibling: MutateElement;
|
|
29
|
+
prependSibling: MutateElement;
|
|
30
|
+
onChange: (cb: (next: T & DefaultSlotContext<T>) => void) => void;
|
|
31
|
+
}
|
|
32
|
+
type Context<T> = T & ThisType<DefaultSlotContext<T>>;
|
|
33
|
+
export type SlotProps<T = any> = (ctx: T & DefaultSlotContext<T>, element: HTMLDivElement | null) => void;
|
|
34
|
+
export type SlotMethod<P = any> = (callback: (next: unknown, state: State) => P) => void;
|
|
35
|
+
export declare function useSlot<K, V extends HTMLDivElement>(context?: Context<K>, callback?: SlotProps<K>, render?: Function): [RefObject<V>, Record<string, any>];
|
|
36
|
+
interface SlotPropsComponent<T> extends Omit<HTMLAttributes<HTMLDivElement>, 'slot'> {
|
|
37
|
+
name: string;
|
|
38
|
+
slot?: SlotProps<T>;
|
|
39
|
+
context?: Context<T>;
|
|
40
|
+
render?: (props: Record<string, any>) => VNode | VNode[];
|
|
41
|
+
}
|
|
42
|
+
export declare function Slot<T>({ name, slot, context, children, render, ...props }: Readonly<SlotPropsComponent<T>>): import("preact").JSX.Element;
|
|
43
|
+
export {};
|
|
44
|
+
//# sourceMappingURL=slot.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"slot.d.ts","sourceRoot":"","sources":["../../../../src/lib/slot.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAC1C,OAAO,EACL,YAAY,EAOb,MAAM,cAAc,CAAC;AACtB,OAAO,EAAe,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAE/C,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ourceRoot":"","sources":["../../../../src/lib/tests.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,aAAa,EACb,YAAY,EACb,MAAM,yBAAyB,CAAC;AAMjC,cAAc,yBAAyB,CAAC;AAexC,eAAO,MAAM,MAAM,OACb,GAAG,YACG,KAAK,aAAa,EAAE,SAAS,CAAC,KACvC,YAOF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/lib/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,QAAQ,CAAC;AAE3C,MAAM,MAAM,SAAS,CAAC,CAAC,EAAE,CAAC,GAAG;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;CAAE,IAAI,iBAAiB,CACtE,CAAC,GAAG;IAAE,WAAW,CAAC,EAAE,CAAC,CAAA;CAAE,CACxB,GAAG;IACF,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,OAAO,CAAC,CAAC,CAAC,CAAC;CAC3C,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { VNode, ComponentChildren } from 'preact';
|
|
2
|
+
|
|
3
|
+
export type VComponentProps = {
|
|
4
|
+
node: VNode | VNode[];
|
|
5
|
+
children?: ComponentChildren;
|
|
6
|
+
[key: string]: any;
|
|
7
|
+
};
|
|
8
|
+
export declare function VComponent({ node, ...props }: VComponentProps): import("preact").JSX.Element | null;
|
|
9
|
+
//# sourceMappingURL=vcomponent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vcomponent.d.ts","sourceRoot":"","sources":["../../../../src/lib/vcomponent.tsx"],"names":[],"mappings":"AAcA,OAAO,EAAE,KAAK,EAAE,iBAAiB,EAAE,MAAM,QAAQ,CAAC;AAGlD,MAAM,MAAM,eAAe,GAAG;IAC5B,IAAI,EAAE,KAAK,GAAG,KAAK,EAAE,CAAC;IACtB,QAAQ,CAAC,EAAE,iBAAiB,CAAC;IAC7B,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACpB,CAAC;AAEF,wBAAgB,UAAU,CAAC,EAAE,IAAI,EAAE,GAAG,KAAK,EAAE,EAAE,eAAe,uCAuB7D"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export interface Events {
|
|
2
|
+
authenticated: boolean;
|
|
3
|
+
locale: string;
|
|
4
|
+
'cart/data': Cart | null;
|
|
5
|
+
}
|
|
6
|
+
export interface Cart {
|
|
7
|
+
id: string;
|
|
8
|
+
totalQuantity: number;
|
|
9
|
+
items: Array<{
|
|
10
|
+
uid: string;
|
|
11
|
+
quantity: number;
|
|
12
|
+
sku: string;
|
|
13
|
+
name: string;
|
|
14
|
+
}>;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=events-catalog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"events-catalog.d.ts","sourceRoot":"","sources":["../../../../types/event-bus/src/events-catalog.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,MAAM;IACrB,aAAa,EAAE,OAAO,CAAC;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,IAAI,GAAG,IAAI,CAAC;CAC1B;AAGD,MAAM,WAAW,IAAI;IACnB,EAAE,EAAE,MAAM,CAAC;IACX,aAAa,EAAE,MAAM,CAAC;IACtB,KAAK,EAAE,KAAK,CAAC;QACX,GAAG,EAAE,MAAM,CAAC;QACZ,QAAQ,EAAE,MAAM,CAAC;QACjB,GAAG,EAAE,MAAM,CAAC;QACZ,IAAI,EAAE,MAAM,CAAC;KACd,CAAC,CAAC;CACJ"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { Events } from './events-catalog';
|
|
2
|
+
|
|
3
|
+
export * from './events-catalog';
|
|
4
|
+
/**
|
|
5
|
+
* The `events` class provides static methods for event handling.
|
|
6
|
+
* It allows subscribing to events, emitting events, and enabling or disabling event logging.
|
|
7
|
+
*
|
|
8
|
+
* @class
|
|
9
|
+
* @extends {Events}
|
|
10
|
+
*
|
|
11
|
+
* @property {Function} on - Subscribes to an event.
|
|
12
|
+
* @property {Function} emit - Emits an event.
|
|
13
|
+
* @property {Function} enableLogger - Enables or disables event logging.
|
|
14
|
+
*/
|
|
15
|
+
export declare class events {
|
|
16
|
+
static _identifier: string;
|
|
17
|
+
static _logger: BroadcastChannel | null;
|
|
18
|
+
static _lastEvent: {
|
|
19
|
+
[key: string]: {
|
|
20
|
+
payload: any;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* Subscribes to an event.
|
|
25
|
+
* @param event - The event to subscribe to.
|
|
26
|
+
* @param handler - The event handler.
|
|
27
|
+
* @param options - Optional configuration for the event handler.
|
|
28
|
+
*/
|
|
29
|
+
static on<K extends keyof Events>(event: K, handler: (payload: Events[K]) => void, options?: {
|
|
30
|
+
eager?: boolean;
|
|
31
|
+
}): {
|
|
32
|
+
off(): void;
|
|
33
|
+
} | undefined;
|
|
34
|
+
/**
|
|
35
|
+
* Emits an event.
|
|
36
|
+
* @param event - The event to emit.
|
|
37
|
+
* @param payload - The event payload.
|
|
38
|
+
*/
|
|
39
|
+
static emit<K extends keyof Events>(event: K, payload: Events[K]): void;
|
|
40
|
+
/**
|
|
41
|
+
* Enables or disables event logging.
|
|
42
|
+
* @param enabled - Whether to enable or disable event logging.
|
|
43
|
+
*/
|
|
44
|
+
static enableLogger(enabled: boolean): void;
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../types/event-bus/src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAE1C,cAAc,kBAAkB,CAAC;AAIjC;;;;;;;;;;GAUG;AACH,qBAAa,MAAM;IACjB,MAAM,CAAC,WAAW,SAAQ;IAE1B,MAAM,CAAC,OAAO,EAAE,gBAAgB,GAAG,IAAI,CAAQ;IAE/C,MAAM,CAAC,UAAU,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG;YAAE,OAAO,EAAE,GAAG,CAAA;SAAE,CAAA;KAAE,CAAM;IAE5D;;;;;OAKG;IACH,MAAM,CAAC,EAAE,CAAC,CAAC,SAAS,MAAM,MAAM,EAC9B,KAAK,EAAE,CAAC,EACR,OAAO,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC,KAAK,IAAI,EACrC,OAAO,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,OAAO,CAAA;KAAE;;;IAoC/B;;;;OAIG;IAEH,MAAM,CAAC,IAAI,CAAC,CAAC,SAAS,MAAM,MAAM,EAAE,KAAK,EAAE,CAAC,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC;IAehE;;;OAGG;IACH,MAAM,CAAC,YAAY,CAAC,OAAO,EAAE,OAAO;CA0BrC"}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
export type Header = {
|
|
2
|
+
[key: string]: string | null;
|
|
3
|
+
};
|
|
4
|
+
export type FetchOptions = {
|
|
5
|
+
method?: 'GET' | 'POST';
|
|
6
|
+
variables?: {
|
|
7
|
+
[key: string]: any;
|
|
8
|
+
};
|
|
9
|
+
signal?: AbortSignal;
|
|
10
|
+
cache?: 'default' | 'no-store' | 'reload' | 'no-cache' | 'force-cache' | 'only-if-cached';
|
|
11
|
+
};
|
|
12
|
+
export type FetchQueryError = Array<{
|
|
13
|
+
message: string;
|
|
14
|
+
extensions: {
|
|
15
|
+
category: string;
|
|
16
|
+
};
|
|
17
|
+
}>;
|
|
18
|
+
declare class FetchGraphQLMesh {
|
|
19
|
+
_endpoint?: string;
|
|
20
|
+
get endpoint(): string | undefined;
|
|
21
|
+
get fetchGraphQlHeaders(): Header | undefined;
|
|
22
|
+
_fetchGraphQlHeaders: Header | undefined;
|
|
23
|
+
/**
|
|
24
|
+
* Sets the GraphQL endpoint.
|
|
25
|
+
* @param endpoint - The GraphQL endpoint.
|
|
26
|
+
*/
|
|
27
|
+
setEndpoint(endpoint: string): void;
|
|
28
|
+
/**
|
|
29
|
+
* Sets the GraphQL headers.
|
|
30
|
+
* @param key - The key of the header.
|
|
31
|
+
* @param value - The value of the header.
|
|
32
|
+
*/
|
|
33
|
+
setFetchGraphQlHeader(key: string, value: string | null): void;
|
|
34
|
+
/**
|
|
35
|
+
* Removes a specific GraphQL header.
|
|
36
|
+
* @param key - The key of the header.
|
|
37
|
+
*/
|
|
38
|
+
removeFetchGraphQlHeader(key: string): void;
|
|
39
|
+
/**
|
|
40
|
+
* Sets the GraphQL headers.
|
|
41
|
+
* @param header - The header object.
|
|
42
|
+
*/
|
|
43
|
+
setFetchGraphQlHeaders(header: Header): void;
|
|
44
|
+
/**
|
|
45
|
+
* Fetches GraphQL data.
|
|
46
|
+
* @param query - The GraphQL query.
|
|
47
|
+
* @param options - Optional configuration for the fetch request.
|
|
48
|
+
* @returns
|
|
49
|
+
*/
|
|
50
|
+
fetchGraphQl<T = any>(query: string, options?: FetchOptions): Promise<{
|
|
51
|
+
errors?: FetchQueryError;
|
|
52
|
+
data: T;
|
|
53
|
+
}>;
|
|
54
|
+
/**
|
|
55
|
+
* Gets the configuration.
|
|
56
|
+
*/
|
|
57
|
+
getConfig(): {
|
|
58
|
+
endpoint: string | undefined;
|
|
59
|
+
fetchGraphQlHeaders: Header | undefined;
|
|
60
|
+
};
|
|
61
|
+
getMethods(): {
|
|
62
|
+
setEndpoint: (endpoint: string) => void;
|
|
63
|
+
setFetchGraphQlHeader: (key: string, value: string | null) => void;
|
|
64
|
+
removeFetchGraphQlHeader: (key: string) => void;
|
|
65
|
+
setFetchGraphQlHeaders: (header: Header) => void;
|
|
66
|
+
fetchGraphQl: <T = any>(query: string, options?: FetchOptions | undefined) => Promise<{
|
|
67
|
+
errors?: FetchQueryError | undefined;
|
|
68
|
+
data: T;
|
|
69
|
+
}>;
|
|
70
|
+
getConfig: () => {
|
|
71
|
+
endpoint: string | undefined;
|
|
72
|
+
fetchGraphQlHeaders: Header | undefined;
|
|
73
|
+
};
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* `FetchGraphQL` is a class that extends `FetchGraphQLMesh`.
|
|
78
|
+
* It provides methods to get the GraphQL endpoint and headers.
|
|
79
|
+
*
|
|
80
|
+
* @class
|
|
81
|
+
*
|
|
82
|
+
*/
|
|
83
|
+
export declare class FetchGraphQL extends FetchGraphQLMesh {
|
|
84
|
+
get endpoint(): string | undefined;
|
|
85
|
+
get fetchGraphQlHeaders(): Header;
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Exports several methods from the `mesh` object.
|
|
89
|
+
*
|
|
90
|
+
* @property {Function} setEndpoint - Sets the GraphQL endpoint.
|
|
91
|
+
* @property {Function} setFetchGraphQlHeaders - Sets the GraphQL headers.
|
|
92
|
+
* @property {Function} setFetchGraphQlHeader - Sets a specific GraphQL header.
|
|
93
|
+
* @property {Function} removeFetchGraphQlHeader - Removes a specific GraphQL header.
|
|
94
|
+
* @property {Function} fetchGraphQl - Fetches GraphQL data.
|
|
95
|
+
* @property {Function} getConfig - Gets the configuration.
|
|
96
|
+
*/
|
|
97
|
+
export declare const setEndpoint: (endpoint: string) => void, setFetchGraphQlHeaders: (header: Header) => void, setFetchGraphQlHeader: (key: string, value: string | null) => void, removeFetchGraphQlHeader: (key: string) => void, fetchGraphQl: <T = any>(query: string, options?: FetchOptions) => Promise<{
|
|
98
|
+
errors?: FetchQueryError | undefined;
|
|
99
|
+
data: T;
|
|
100
|
+
}>, getConfig: () => {
|
|
101
|
+
endpoint: string | undefined;
|
|
102
|
+
fetchGraphQlHeaders: Header | undefined;
|
|
103
|
+
};
|
|
104
|
+
export {};
|
|
105
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version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