@trycourier/react-designer 0.0.8 → 0.0.9
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/dist/cjs/index.js +41 -41
- package/dist/cjs/index.js.map +4 -4
- package/dist/components/Providers/Providers.types.d.ts +2 -2
- package/dist/components/Providers/TemplateProvider.d.ts +12 -14
- package/dist/components/Providers/store.d.ts +0 -10
- package/dist/components/Providers/useBrandActions.d.ts +2 -3
- package/dist/components/Providers/useTemplateActions.d.ts +2 -3
- package/dist/esm/index.js +41 -41
- package/dist/esm/index.js.map +4 -4
- package/package.json +1 -1
|
@@ -6,10 +6,10 @@ export interface BasicProviderProps {
|
|
|
6
6
|
token: string;
|
|
7
7
|
}
|
|
8
8
|
export interface ImageUploadConfig {
|
|
9
|
-
file:
|
|
9
|
+
file: Blob;
|
|
10
10
|
onProgress?: (progress: number) => void;
|
|
11
11
|
}
|
|
12
12
|
export interface ImageUploadResponse {
|
|
13
13
|
url: string;
|
|
14
14
|
}
|
|
15
|
-
export type UploadImageFunction = (config: ImageUploadConfig) => Promise<ImageUploadResponse
|
|
15
|
+
export type UploadImageFunction = ((file: Blob) => Promise<string>) | ((file: File) => Promise<string>) | ((config: ImageUploadConfig) => Promise<ImageUploadResponse>);
|
|
@@ -1,20 +1,18 @@
|
|
|
1
|
-
import { createStore } from "jotai";
|
|
2
1
|
import type { BasicProviderProps, UploadImageFunction } from "./Providers.types";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
2
|
+
export declare const useTemplateStore: () => {
|
|
3
|
+
store: {
|
|
4
|
+
get: <Value>(atom: import("jotai").Atom<Value>) => Value;
|
|
5
|
+
set: <Value, Args extends unknown[], Result>(atom: import("jotai").WritableAtom<Value, Args, Result>, ...args: Args) => Result;
|
|
6
|
+
sub: (atom: import("jotai").Atom<unknown>, listener: () => void) => () => void;
|
|
7
|
+
} | ({
|
|
8
|
+
get: <Value>(atom: import("jotai").Atom<Value>) => Value;
|
|
9
|
+
set: <Value, Args extends unknown[], Result>(atom: import("jotai").WritableAtom<Value, Args, Result>, ...args: Args) => Result;
|
|
10
|
+
sub: (atom: import("jotai").Atom<unknown>, listener: () => void) => () => void;
|
|
11
|
+
} & import("jotai/vanilla/store").INTERNAL_DevStoreRev4);
|
|
12
|
+
};
|
|
13
|
+
export declare const useUploadImage: () => UploadImageFunction | null;
|
|
14
14
|
type TemplateProviderProps = BasicProviderProps & {
|
|
15
15
|
templateId: string;
|
|
16
|
-
getTemplate?: (actions: TemplateActions) => Promise<void>;
|
|
17
|
-
saveTemplate?: (actions: TemplateActions, options?: MessageRouting) => Promise<void>;
|
|
18
16
|
uploadImage?: UploadImageFunction;
|
|
19
17
|
};
|
|
20
18
|
export declare const TemplateProvider: import("react").NamedExoticComponent<TemplateProviderProps>;
|
|
@@ -123,13 +123,3 @@ export interface TemplateActions {
|
|
|
123
123
|
createCustomError: (message: string, details?: Record<string, unknown>) => TemplateError;
|
|
124
124
|
convertLegacyError: (error: string | TemplateError) => TemplateError;
|
|
125
125
|
}
|
|
126
|
-
export declare const getTemplateOverrideAtom: import("jotai").PrimitiveAtom<((options?: {
|
|
127
|
-
includeBrand?: boolean;
|
|
128
|
-
}) => Promise<void>) | null> & {
|
|
129
|
-
init: ((options?: {
|
|
130
|
-
includeBrand?: boolean;
|
|
131
|
-
}) => Promise<void>) | null;
|
|
132
|
-
};
|
|
133
|
-
export declare const saveTemplateOverrideAtom: import("jotai").PrimitiveAtom<((actions: TemplateActions, options?: MessageRouting) => Promise<void>) | null> & {
|
|
134
|
-
init: ((actions: TemplateActions, options?: MessageRouting) => Promise<void>) | null;
|
|
135
|
-
};
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { type TemplateError } from "@/lib/utils/errors";
|
|
2
|
-
import { type MessageRouting } from "./store";
|
|
3
2
|
export declare function useBrandActions(): {
|
|
4
3
|
getTemplate: (options?: {
|
|
5
4
|
includeBrand?: boolean;
|
|
6
|
-
}) => Promise<void>;
|
|
7
|
-
saveTemplate: (
|
|
5
|
+
} | undefined) => Promise<void>;
|
|
6
|
+
saveTemplate: (routing?: import("./store").MessageRouting | undefined) => Promise<any>;
|
|
8
7
|
saveBrand: (settings?: Record<string, unknown> | undefined) => Promise<any>;
|
|
9
8
|
publishBrand: () => Promise<any>;
|
|
10
9
|
isTemplateLoading: boolean | null;
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { type TemplateError } from "@/lib/utils/errors";
|
|
2
|
-
import { type MessageRouting } from "./store";
|
|
3
2
|
export declare function useTemplateActions(): {
|
|
4
3
|
getTemplate: (options?: {
|
|
5
4
|
includeBrand?: boolean;
|
|
6
|
-
}) => Promise<void>;
|
|
7
|
-
saveTemplate: (
|
|
5
|
+
} | undefined) => Promise<void>;
|
|
6
|
+
saveTemplate: (routing?: import("./store").MessageRouting | undefined) => Promise<any>;
|
|
8
7
|
publishTemplate: () => Promise<any>;
|
|
9
8
|
isTemplateLoading: boolean | null;
|
|
10
9
|
setIsTemplateLoading: (args_0: boolean | ((prev: boolean | null) => boolean | null) | null) => void;
|