@dropins/tools 1.4.1-alpha002 → 1.4.1-alpha007
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 +2 -2
- package/chunks/initializer.js.map +1 -1
- package/chunks/locale-config.js +4 -0
- package/chunks/locale-config.js.map +1 -0
- package/components.js +1 -1
- package/components.js.map +1 -1
- package/event-bus.js +1 -1
- package/event-bus.js.map +1 -1
- package/initializer.js +2 -2
- package/lib.js +1 -1
- package/lib.js.map +1 -1
- package/package.json +1 -1
- package/types/elsie/src/components/Price/Price.d.ts +1 -1
- package/types/elsie/src/lib/index.d.ts +1 -0
- package/types/elsie/src/lib/initializer.d.ts +6 -0
- package/types/elsie/src/lib/locale-config.d.ts +10 -0
- package/types/event-bus/src/index.d.ts +15 -2
|
@@ -19,6 +19,7 @@ export * from './types';
|
|
|
19
19
|
export * from './slot';
|
|
20
20
|
export * from './vcomponent';
|
|
21
21
|
export * from './image-params-keymap';
|
|
22
|
+
export * from './locale-config';
|
|
22
23
|
export * from './is-number';
|
|
23
24
|
export * from './deviceUtils';
|
|
24
25
|
export * from './get-path-value';
|
|
@@ -51,6 +51,7 @@ export declare class initializers {
|
|
|
51
51
|
static _imageParamsKeyMap: {
|
|
52
52
|
[key: string]: string;
|
|
53
53
|
} | undefined;
|
|
54
|
+
static _globalLocale: string | undefined;
|
|
54
55
|
/**
|
|
55
56
|
* 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.
|
|
56
57
|
* @param initializer - The initializer to register.
|
|
@@ -76,6 +77,11 @@ export declare class initializers {
|
|
|
76
77
|
static setImageParamKeys(params: {
|
|
77
78
|
[key: string]: any;
|
|
78
79
|
}): void;
|
|
80
|
+
/**
|
|
81
|
+
* Sets the global locale. This locale is used by components that need consistent formatting regardless of the user's browser locale.
|
|
82
|
+
* @param locale - The locale string (e.g., 'en-US', 'es-MX', 'fr-FR').
|
|
83
|
+
*/
|
|
84
|
+
static setGlobalLocale(locale: string): void;
|
|
79
85
|
}
|
|
80
86
|
export {};
|
|
81
87
|
//# sourceMappingURL=initializer.d.ts.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/********************************************************************
|
|
2
|
+
* Copyright 2024 Adobe
|
|
3
|
+
* All Rights Reserved.
|
|
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.
|
|
8
|
+
*******************************************************************/
|
|
9
|
+
export declare const setGlobalLocale: (value: typeof this._locale) => void, getGlobalLocale: () => string | undefined;
|
|
10
|
+
//# sourceMappingURL=locale-config.d.ts.map
|
|
@@ -21,12 +21,21 @@ export declare class events {
|
|
|
21
21
|
payload: any;
|
|
22
22
|
};
|
|
23
23
|
};
|
|
24
|
+
/**
|
|
25
|
+
* Returns a scoped event key.
|
|
26
|
+
* @param scope - The scope to get the event from.
|
|
27
|
+
* @returns - The scoped event key.
|
|
28
|
+
*/
|
|
29
|
+
static _getScopedEvent(scope?: string): <K extends keyof Events>(event: K) => K;
|
|
24
30
|
/**
|
|
25
31
|
* Returns the last payload of the event.
|
|
26
32
|
* @param event – The event to get the last payload from.
|
|
33
|
+
* @param options - Optional configuration for the event.
|
|
27
34
|
* @returns – The last payload of the event.
|
|
28
35
|
*/
|
|
29
|
-
static lastPayload(event:
|
|
36
|
+
static lastPayload<K extends keyof Events>(event: K, options?: {
|
|
37
|
+
scope?: string;
|
|
38
|
+
}): any;
|
|
30
39
|
/**
|
|
31
40
|
* Subscribes to an event.
|
|
32
41
|
* @param event - The event to subscribe to.
|
|
@@ -35,6 +44,7 @@ export declare class events {
|
|
|
35
44
|
*/
|
|
36
45
|
static on<K extends keyof Events>(event: K, handler: (payload: Events[K]) => void, options?: {
|
|
37
46
|
eager?: boolean;
|
|
47
|
+
scope?: string;
|
|
38
48
|
}): {
|
|
39
49
|
off(): void;
|
|
40
50
|
} | undefined;
|
|
@@ -42,8 +52,11 @@ export declare class events {
|
|
|
42
52
|
* Emits an event.
|
|
43
53
|
* @param event - The event to emit.
|
|
44
54
|
* @param payload - The event payload.
|
|
55
|
+
* @param options - Optional configuration for the event.
|
|
45
56
|
*/
|
|
46
|
-
static emit<K extends keyof Events>(event: K, payload: Events[K]
|
|
57
|
+
static emit<K extends keyof Events>(event: K, payload: Events[K], options?: {
|
|
58
|
+
scope?: string;
|
|
59
|
+
}): void;
|
|
47
60
|
/**
|
|
48
61
|
* Enables or disables event logging.
|
|
49
62
|
* @param enabled - Whether to enable or disable event logging.
|