@dropins/tools 0.27.1 → 0.28.0-alpha2
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/vcomponent.js +12 -2
- package/components.js +1 -1
- package/initializer.js +2 -2
- package/lib.js +1 -11
- package/package.json +1 -1
- package/types/elsie/src/components/Header/Header.d.ts +11 -0
- package/types/elsie/src/components/Header/index.d.ts +3 -0
- package/types/elsie/src/components/InputPassword/InputPassword.d.ts +2 -0
- package/types/elsie/src/components/Picker/Picker.d.ts +4 -2
- package/types/elsie/src/components/Tag/Tag.d.ts +8 -0
- package/types/elsie/src/components/Tag/index.d.ts +3 -0
- package/types/elsie/src/components/UIProvider/UIProvider.d.ts +2 -0
- package/types/elsie/src/components/index.d.ts +2 -1
- package/types/elsie/src/i18n/en_US.json.d.ts +5 -1
- package/types/elsie/src/i18n/index.d.ts +12 -0
- package/types/elsie/src/lib/render.d.ts +14 -6
- package/types/elsie/src/lib/slot.d.ts +5 -4
- package/types/elsie/src/components/PriceSummary/PriceSummary.d.ts +0 -49
- package/types/elsie/src/components/PriceSummary/index.d.ts +0 -3
|
@@ -1,26 +1,33 @@
|
|
|
1
1
|
import { VNode } from 'preact';
|
|
2
|
+
import { Signal } from '@preact/signals';
|
|
2
3
|
import { Container } from '.';
|
|
3
4
|
|
|
5
|
+
export declare const SlotQueueContext: import('preact').Context<Signal<Set<string>> | null>;
|
|
6
|
+
type RenderAPI = {
|
|
7
|
+
remove: () => void;
|
|
8
|
+
setProps: (cb: (prev: any) => any) => void;
|
|
9
|
+
};
|
|
4
10
|
/**
|
|
5
11
|
* The `Render` class provides methods to render and unmount components, as well as to render components to a string.
|
|
6
12
|
* @class
|
|
7
13
|
*
|
|
8
14
|
* @property {Function} render - Renders a component to a root element.
|
|
9
|
-
* @property {Function} unmount - Unmounts a component from a root element.
|
|
10
15
|
* @property {Function} toString - Renders a component to a string.
|
|
11
16
|
*/
|
|
12
17
|
export declare class Render {
|
|
13
18
|
private _provider;
|
|
14
19
|
constructor(provider: VNode<any>);
|
|
15
20
|
/**
|
|
16
|
-
* Renders a
|
|
17
|
-
* @param
|
|
18
|
-
* @param props - The
|
|
21
|
+
* Renders a container to a root element.
|
|
22
|
+
* @param Container - The container to render.
|
|
23
|
+
* @param props - The container parameters.
|
|
24
|
+
* @returns A function to render the component to a root element.
|
|
19
25
|
*/
|
|
20
|
-
render<T>(Component: Container<T>, props: T): (rootElement: HTMLElement) => Promise<
|
|
26
|
+
render<T>(Component: Container<T>, props: T): (rootElement: HTMLElement) => Promise<RenderAPI>;
|
|
21
27
|
/**
|
|
22
|
-
*
|
|
28
|
+
* UnRenders a component from a root element.
|
|
23
29
|
* @param rootElement - The root element to unmount the component from.
|
|
30
|
+
* @deprecated Use `remove` method from the returned object of the `mount` method instead.
|
|
24
31
|
*/
|
|
25
32
|
unmount(rootElement: HTMLElement): void;
|
|
26
33
|
/**
|
|
@@ -31,4 +38,5 @@ export declare class Render {
|
|
|
31
38
|
*/
|
|
32
39
|
toString<T>(Component: Container<T>, props: T, options?: T): Promise<string>;
|
|
33
40
|
}
|
|
41
|
+
export {};
|
|
34
42
|
//# sourceMappingURL=render.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { RefObject, VNode } from 'preact';
|
|
1
|
+
import { ComponentChildren, RefObject, VNode } from 'preact';
|
|
2
2
|
import { StateUpdater } from 'preact/hooks';
|
|
3
3
|
import { Lang } from '../i18n';
|
|
4
4
|
import { HTMLAttributes } from 'preact/compat';
|
|
@@ -27,18 +27,19 @@ interface DefaultSlotContext<T> extends PrivateContext<T> {
|
|
|
27
27
|
prependChild: MutateElement;
|
|
28
28
|
appendSibling: MutateElement;
|
|
29
29
|
prependSibling: MutateElement;
|
|
30
|
+
onRender: (cb: (next: T & DefaultSlotContext<T>) => void) => void;
|
|
30
31
|
onChange: (cb: (next: T & DefaultSlotContext<T>) => void) => void;
|
|
31
32
|
}
|
|
32
33
|
type Context<T> = T & ThisType<DefaultSlotContext<T>>;
|
|
33
|
-
export type SlotProps<T = any> = (ctx: T & DefaultSlotContext<T>, element: HTMLDivElement | null) => void;
|
|
34
|
+
export type SlotProps<T = any> = (ctx: T & DefaultSlotContext<T>, element: HTMLDivElement | null) => Promise<void> | void;
|
|
34
35
|
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
|
+
export declare function useSlot<K, V extends HTMLDivElement>(name: string, context?: Context<K>, callback?: SlotProps<K>, children?: ComponentChildren, render?: Function): [RefObject<V>, Record<string, any>];
|
|
36
37
|
interface SlotPropsComponent<T> extends Omit<HTMLAttributes<HTMLDivElement>, 'slot'> {
|
|
37
38
|
name: string;
|
|
38
39
|
slot?: SlotProps<T>;
|
|
39
40
|
context?: Context<T>;
|
|
40
41
|
render?: (props: Record<string, any>) => VNode | VNode[];
|
|
41
42
|
}
|
|
42
|
-
export declare function Slot<T>({ name,
|
|
43
|
+
export declare function Slot<T>({ name, context, slot, children, render, ...props }: Readonly<SlotPropsComponent<T>>): import("preact").JSX.Element;
|
|
43
44
|
export {};
|
|
44
45
|
//# sourceMappingURL=slot.d.ts.map
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import { FunctionComponent, VNode } from 'preact';
|
|
2
|
-
import { HTMLAttributes } from 'preact/compat';
|
|
3
|
-
|
|
4
|
-
export interface PriceSummaryProps extends Omit<HTMLAttributes<HTMLDivElement>, 'loading'> {
|
|
5
|
-
heading: string;
|
|
6
|
-
loading?: boolean;
|
|
7
|
-
total?: {
|
|
8
|
-
price: VNode<HTMLAttributes<HTMLSpanElement>>;
|
|
9
|
-
estimated?: boolean;
|
|
10
|
-
priceWithoutTax?: VNode<HTMLAttributes<HTMLSpanElement>>;
|
|
11
|
-
};
|
|
12
|
-
subTotal?: {
|
|
13
|
-
price: VNode<HTMLAttributes<HTMLSpanElement>>;
|
|
14
|
-
priceExcludingTax?: VNode<HTMLAttributes<HTMLSpanElement>>;
|
|
15
|
-
taxIncluded?: boolean;
|
|
16
|
-
taxExcluded?: boolean;
|
|
17
|
-
zeroTaxSubtotal?: boolean;
|
|
18
|
-
};
|
|
19
|
-
shipping?: {
|
|
20
|
-
price: VNode<HTMLAttributes<HTMLSpanElement>>;
|
|
21
|
-
estimated?: boolean;
|
|
22
|
-
taxIncluded?: boolean;
|
|
23
|
-
taxExcluded?: boolean;
|
|
24
|
-
priceIncludingTax?: VNode<HTMLAttributes<HTMLSpanElement>>;
|
|
25
|
-
priceExcludingTax?: VNode<HTMLAttributes<HTMLSpanElement>>;
|
|
26
|
-
countryField?: VNode<HTMLAttributes<HTMLInputElement>>;
|
|
27
|
-
stateField?: VNode<HTMLAttributes<HTMLInputElement>>;
|
|
28
|
-
zipField?: VNode<HTMLAttributes<HTMLInputElement>>;
|
|
29
|
-
destinationText?: string;
|
|
30
|
-
onEstimate?: (formData: any) => void;
|
|
31
|
-
estimateButton?: VNode<HTMLAttributes<HTMLButtonElement>>;
|
|
32
|
-
};
|
|
33
|
-
taxTotal?: {
|
|
34
|
-
price: VNode<HTMLAttributes<HTMLSpanElement>>;
|
|
35
|
-
estimated?: boolean;
|
|
36
|
-
};
|
|
37
|
-
taxesApplied?: {
|
|
38
|
-
label: string;
|
|
39
|
-
price: VNode<HTMLAttributes<HTMLSpanElement>>;
|
|
40
|
-
}[];
|
|
41
|
-
discounts?: {
|
|
42
|
-
label: string;
|
|
43
|
-
price: VNode<HTMLAttributes<HTMLSpanElement>>;
|
|
44
|
-
caption?: VNode<HTMLAttributes<HTMLDivElement>>;
|
|
45
|
-
}[];
|
|
46
|
-
primaryAction?: VNode<HTMLAttributes<HTMLButtonElement>>;
|
|
47
|
-
}
|
|
48
|
-
export declare const PriceSummary: FunctionComponent<PriceSummaryProps>;
|
|
49
|
-
//# sourceMappingURL=PriceSummary.d.ts.map
|