@wetransform/vue 1.5.5 → 1.7.0
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/README.md +13 -5
- package/dist/index.d.mts +4 -5
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -27,6 +27,12 @@ const config: WeTransformConfig = {
|
|
|
27
27
|
customerId: 'your_customer_id',
|
|
28
28
|
signature: 'your_signed_token',
|
|
29
29
|
},
|
|
30
|
+
// Optional brand colors; primary also colors the loading spinner. See @wetransform/core docs.
|
|
31
|
+
customization: {
|
|
32
|
+
colors: {
|
|
33
|
+
primary: '#7c3aed',
|
|
34
|
+
},
|
|
35
|
+
},
|
|
30
36
|
}
|
|
31
37
|
|
|
32
38
|
const onSuccessSubmit: WeTransformSdkProps['onSuccessSubmit'] = ({
|
|
@@ -68,8 +74,8 @@ Emits:
|
|
|
68
74
|
- `close`
|
|
69
75
|
- `destroy`
|
|
70
76
|
- `onReady`
|
|
71
|
-
- `successSubmit` → `(payload: { customerId: string; templateHandle: string; fileUrl: string; signature: string })`
|
|
72
|
-
- `error` → `(payload: { code: string; message: string })`
|
|
77
|
+
- `successSubmit` → `(payload: { customerId: string; templateHandle: string; fileUrl: string; signature: string; userFileName: string })`
|
|
78
|
+
- `error` → `(payload: { code: string; message: string; stack?: string })`
|
|
73
79
|
|
|
74
80
|
## Composable usage
|
|
75
81
|
|
|
@@ -84,7 +90,7 @@ const { open, close, destroy, setLocale, isOpen, weTransformInstance, on } = use
|
|
|
84
90
|
},
|
|
85
91
|
})
|
|
86
92
|
|
|
87
|
-
on('successSubmit', ({ customerId, templateHandle, fileUrl, signature }) => {
|
|
93
|
+
on('successSubmit', ({ customerId, templateHandle, fileUrl, signature, userFileName }) => {
|
|
88
94
|
// Handle post-submit
|
|
89
95
|
})
|
|
90
96
|
|
|
@@ -97,7 +103,7 @@ console.log(isOpen.value)
|
|
|
97
103
|
console.log(weTransformInstance.value)
|
|
98
104
|
```
|
|
99
105
|
|
|
100
|
-
`useWeTransform(config)` accepts a plain config object, a `Ref<WeTransformConfig>`, or a getter `() => WeTransformConfig`.
|
|
106
|
+
`useWeTransform(config)` accepts a plain config object, a `Ref<WeTransformConfig>`, or a getter `() => WeTransformConfig`.
|
|
101
107
|
|
|
102
108
|
`useWeTransform(config)` returns:
|
|
103
109
|
|
|
@@ -121,12 +127,14 @@ And re-exports these symbols from `@wetransform/core`:
|
|
|
121
127
|
- `WeTransformConfig`
|
|
122
128
|
- `WeTransformEventMap`
|
|
123
129
|
- `WeTransformInstance`
|
|
130
|
+
- `WeTransformInitialLocations`
|
|
131
|
+
- `WeTransformSDKCustomization`
|
|
124
132
|
- `SupportedLocales`
|
|
125
133
|
|
|
126
134
|
## Notes
|
|
127
135
|
|
|
128
136
|
- Wrapper lifecycle behavior forwards to core and does not modify core semantics.
|
|
129
137
|
- Component: `config` is used at instantiation time. For structural config changes, remount with a Vue `:key`.
|
|
130
|
-
- Composable: `config` is
|
|
138
|
+
- Composable: `config` is read at instantiation time. For structural config changes, call `destroy()` and re-invoke `useWeTransform` (or use a Vue `:key` on the parent).
|
|
131
139
|
- The component forces the SDK `mountElement` internally; do not pass `mountElement` in `config`.
|
|
132
140
|
- The `locale` prop (component) and `setLocale` (composable) can be called at any time, including before or while the SDK is open.
|
package/dist/index.d.mts
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import { SupportedLocales, SupportedLocales as SupportedLocales$1, WeTransformConfig, WeTransformConfig as WeTransformConfig$1, WeTransformEventMap, WeTransformEventMap as WeTransformEventMap$1, WeTransformInitialLocations, WeTransformInstance, createWeTransform } from "@wetransform/core";
|
|
2
|
-
import * as _$vue from "vue";
|
|
1
|
+
import { SupportedLocales, SupportedLocales as SupportedLocales$1, WeTransformConfig, WeTransformConfig as WeTransformConfig$1, WeTransformEventMap, WeTransformEventMap as WeTransformEventMap$1, WeTransformInitialLocations, WeTransformInstance, WeTransformSDKCustomization, __WeTransformSdkInternalChildMethods, __WeTransformSdkInternalEventMap, createWeTransform } from "@wetransform/core";
|
|
3
2
|
import { ComponentOptionsMixin, DefineComponent, MaybeRefOrGetter } from "vue";
|
|
4
3
|
|
|
5
4
|
//#region src/composables.d.ts
|
|
6
5
|
declare const useWeTransform: (config: MaybeRefOrGetter<WeTransformConfig$1>) => {
|
|
7
|
-
weTransformInstance: Readonly<
|
|
6
|
+
weTransformInstance: Readonly<import("vue").Ref<{
|
|
8
7
|
readonly open: () => Promise<void>;
|
|
9
8
|
readonly close: () => Promise<void>;
|
|
10
9
|
readonly destroy: () => Promise<void>;
|
|
@@ -17,7 +16,7 @@ declare const useWeTransform: (config: MaybeRefOrGetter<WeTransformConfig$1>) =>
|
|
|
17
16
|
readonly setLocale: (locale: SupportedLocales$1) => Promise<void>;
|
|
18
17
|
readonly on: <K extends keyof WeTransformEventMap$1>(event: K, handler: WeTransformEventMap$1[K]) => () => void;
|
|
19
18
|
} | null>>;
|
|
20
|
-
isOpen: Readonly<
|
|
19
|
+
isOpen: Readonly<import("vue").Ref<boolean, boolean>>;
|
|
21
20
|
open: () => Promise<void>;
|
|
22
21
|
close: () => Promise<void>;
|
|
23
22
|
destroy: () => Promise<void>;
|
|
@@ -46,4 +45,4 @@ type WeTransformSdkType = DefineComponent<WeTransformSdkComponentProps, {}, {},
|
|
|
46
45
|
declare const WeTransformSdk: WeTransformSdkType;
|
|
47
46
|
type WeTransformSdkProps = InstanceType<typeof WeTransformSdk>['$props'];
|
|
48
47
|
//#endregion
|
|
49
|
-
export { type SupportedLocales, type WeTransformConfig, type WeTransformEventMap, type WeTransformInitialLocations, type WeTransformInstance, WeTransformSdk, type WeTransformSdkProps, createWeTransform, useWeTransform };
|
|
48
|
+
export { type SupportedLocales, type WeTransformConfig, type WeTransformEventMap, type WeTransformInitialLocations, type WeTransformInstance, type WeTransformSDKCustomization, WeTransformSdk, type WeTransformSdkProps, type __WeTransformSdkInternalChildMethods, type __WeTransformSdkInternalEventMap, createWeTransform, useWeTransform };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wetransform/vue",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.7.0",
|
|
4
4
|
"homepage": "https://wetransform.com",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"files": [
|
|
@@ -14,17 +14,17 @@
|
|
|
14
14
|
"access": "public"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"vue": "^3.5.
|
|
18
|
-
"@wetransform/core": "1.
|
|
17
|
+
"vue": "^3.5.38",
|
|
18
|
+
"@wetransform/core": "1.7.0"
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|
|
21
21
|
"@types/node": "^24.12.0",
|
|
22
22
|
"@vitejs/plugin-vue": "^6.0.7",
|
|
23
|
-
"@vue/test-utils": "^2.4.
|
|
23
|
+
"@vue/test-utils": "^2.4.11",
|
|
24
24
|
"jsdom": "^29.1.1",
|
|
25
25
|
"typescript": "^6.0.3",
|
|
26
|
-
"vite": "npm:@voidzero-dev/vite-plus-core@0.1
|
|
27
|
-
"vite-plus": "
|
|
26
|
+
"vite": "npm:@voidzero-dev/vite-plus-core@0.2.1",
|
|
27
|
+
"vite-plus": "0.2.1"
|
|
28
28
|
},
|
|
29
29
|
"scripts": {
|
|
30
30
|
"build": "VITE_MODE=production vp pack",
|