@wix/form-app-builder 1.308.0 → 1.310.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/dist/component/form.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useState as
|
|
3
|
-
import { initI18n as
|
|
4
|
-
import
|
|
5
|
-
import { convertA11yKeysToHtmlFormat as
|
|
6
|
-
import { use as
|
|
7
|
-
import
|
|
8
|
-
import { i18n as
|
|
9
|
-
import { forms as
|
|
10
|
-
import { renameKeysFromSDKRequestToRESTRequest as
|
|
11
|
-
const
|
|
1
|
+
import { jsx as m, jsxs as K, Fragment as V } from "react/jsx-runtime";
|
|
2
|
+
import { useState as f, useRef as q, useEffect as y, forwardRef as L, useMemo as E, Suspense as H } from "react";
|
|
3
|
+
import { initI18n as B, createAsyncMessagesLoader as G, useTranslation as $, I18nextProvider as U } from "@wix/fed-cli-i18next";
|
|
4
|
+
import z from "@wix/form-elements/Form";
|
|
5
|
+
import { convertA11yKeysToHtmlFormat as J } from "@wix/react-component-utils";
|
|
6
|
+
import { use as Q } from "@wix/react-use-promise-polyfill";
|
|
7
|
+
import X from "classnames";
|
|
8
|
+
import { i18n as Y } from "@wix/essentials";
|
|
9
|
+
import { forms as Z } from "@wix/forms";
|
|
10
|
+
import { renameKeysFromSDKRequestToRESTRequest as P } from "@wix/sdk-runtime/rename-all-nested-keys";
|
|
11
|
+
const x = (s, e, t) => {
|
|
12
12
|
const o = s[e];
|
|
13
|
-
return o ? typeof o == "function" ? o() : Promise.resolve(o) : new Promise((
|
|
13
|
+
return o ? typeof o == "function" ? o() : Promise.resolve(o) : new Promise((n, a) => {
|
|
14
14
|
(typeof queueMicrotask == "function" ? queueMicrotask : setTimeout)(
|
|
15
15
|
a.bind(
|
|
16
16
|
null,
|
|
@@ -20,149 +20,181 @@ const b = (s, e, t) => {
|
|
|
20
20
|
)
|
|
21
21
|
);
|
|
22
22
|
});
|
|
23
|
-
},
|
|
23
|
+
}, A = "en", ss = () => {
|
|
24
24
|
try {
|
|
25
|
-
return
|
|
25
|
+
return Y.getLanguage() || A;
|
|
26
26
|
} catch {
|
|
27
|
-
return
|
|
27
|
+
return A;
|
|
28
28
|
}
|
|
29
|
-
},
|
|
30
|
-
const [e] =
|
|
31
|
-
() =>
|
|
32
|
-
locale:
|
|
29
|
+
}, es = ({ useSuspense: s = !1 } = {}) => {
|
|
30
|
+
const [e] = f(
|
|
31
|
+
() => B({
|
|
32
|
+
locale: ss(),
|
|
33
33
|
useSuspense: s,
|
|
34
|
-
asyncMessagesLoader:
|
|
34
|
+
asyncMessagesLoader: G({
|
|
35
35
|
isDev: !1,
|
|
36
|
-
loadMessages: (t) =>
|
|
37
|
-
loadDevMessages: (t) =>
|
|
36
|
+
loadMessages: (t) => x(/* @__PURE__ */ Object.assign({ "../assets/locale/messages_ar.json": () => import("./messages_ar-DGqnlItp.js"), "../assets/locale/messages_bg.json": () => import("./messages_bg-7j2dzD3-.js"), "../assets/locale/messages_ca.json": () => import("./messages_ca-CcO7DMHa.js"), "../assets/locale/messages_cs.json": () => import("./messages_cs-CTVq3E2g.js"), "../assets/locale/messages_da.json": () => import("./messages_da-Aczb870I.js"), "../assets/locale/messages_de.json": () => import("./messages_de-DjOB-J1X.js"), "../assets/locale/messages_el.json": () => import("./messages_el-BpyRDrDi.js"), "../assets/locale/messages_en.json": () => import("./messages_en-gPKIcVqb.js"), "../assets/locale/messages_es.json": () => import("./messages_es-CzzSofdY.js"), "../assets/locale/messages_fi.json": () => import("./messages_fi-CZWvyyeb.js"), "../assets/locale/messages_fr.json": () => import("./messages_fr-Lbq78jBY.js"), "../assets/locale/messages_he.json": () => import("./messages_he-BrE8aCeb.js"), "../assets/locale/messages_hi.json": () => import("./messages_hi-Bzpy21yr.js"), "../assets/locale/messages_hr.json": () => import("./messages_hr-_zq2pEDq.js"), "../assets/locale/messages_hu.json": () => import("./messages_hu-DjiQZ0Iy.js"), "../assets/locale/messages_id.json": () => import("./messages_id-CMa5LD7F.js"), "../assets/locale/messages_it.json": () => import("./messages_it-DINjUlrP.js"), "../assets/locale/messages_ja.json": () => import("./messages_ja-BJadoOMy.js"), "../assets/locale/messages_ko.json": () => import("./messages_ko-C1cqfk2u.js"), "../assets/locale/messages_lt.json": () => import("./messages_lt-ja0KcCq4.js"), "../assets/locale/messages_lv.json": () => import("./messages_lv-N3hgWEFl.js"), "../assets/locale/messages_ms.json": () => import("./messages_ms-DUh0bUzJ.js"), "../assets/locale/messages_nl.json": () => import("./messages_nl-BrYvezRR.js"), "../assets/locale/messages_no.json": () => import("./messages_no-Cfp-Ev4Z.js"), "../assets/locale/messages_pl.json": () => import("./messages_pl-CSHaunjT.js"), "../assets/locale/messages_pt.json": () => import("./messages_pt-CkFjw0sb.js"), "../assets/locale/messages_ro.json": () => import("./messages_ro-C9YzJqCP.js"), "../assets/locale/messages_ru.json": () => import("./messages_ru-4uGVRg29.js"), "../assets/locale/messages_sk.json": () => import("./messages_sk-BhT2Qz0Z.js"), "../assets/locale/messages_sl.json": () => import("./messages_sl-CWn3AJHu.js"), "../assets/locale/messages_sv.json": () => import("./messages_sv-DB2VplkH.js"), "../assets/locale/messages_th.json": () => import("./messages_th-CATSt9Iu.js"), "../assets/locale/messages_tl.json": () => import("./messages_tl-D3-8huQl.js"), "../assets/locale/messages_tr.json": () => import("./messages_tr-CfQPwO3A.js"), "../assets/locale/messages_uk.json": () => import("./messages_uk-BgMP3k3g.js"), "../assets/locale/messages_vi.json": () => import("./messages_vi-CRCNIcd1.js"), "../assets/locale/messages_zh.json": () => import("./messages_zh-7UFJmLYG.js") }), `../assets/locale/messages_${t}.json`, 4),
|
|
37
|
+
loadDevMessages: (t) => x(/* @__PURE__ */ Object.assign({}), `../assets/locale/messages_${t}.dev.json`, 4)
|
|
38
38
|
})
|
|
39
39
|
})
|
|
40
40
|
);
|
|
41
41
|
return e;
|
|
42
|
-
},
|
|
42
|
+
}, os = (s) => ({ name: s }), ts = (s) => `${s.name}:change`, M = (s, e) => {
|
|
43
43
|
window.dispatchEvent(
|
|
44
|
-
new CustomEvent(
|
|
44
|
+
new CustomEvent(ts(s), { detail: e })
|
|
45
45
|
);
|
|
46
|
-
},
|
|
46
|
+
}, as = (s, e, t) => {
|
|
47
47
|
const o = t;
|
|
48
48
|
return (o == null ? void 0 : o.channel) === s.name && o.compId === e && typeof o.patch == "object" && o.patch !== null ? o.patch : void 0;
|
|
49
|
-
},
|
|
49
|
+
}, ns = ({
|
|
50
50
|
channel: s,
|
|
51
51
|
compId: e,
|
|
52
52
|
data: t,
|
|
53
53
|
onChange: o
|
|
54
54
|
}) => {
|
|
55
|
-
const
|
|
56
|
-
return
|
|
55
|
+
const n = JSON.stringify(t), a = q(o);
|
|
56
|
+
return y(() => {
|
|
57
57
|
a.current = o;
|
|
58
|
-
}),
|
|
59
|
-
const
|
|
60
|
-
if (
|
|
58
|
+
}), y(() => (M(s, e), () => M(s, e)), [s, e, n]), y(() => {
|
|
59
|
+
const r = (p) => {
|
|
60
|
+
if (p.origin !== window.origin)
|
|
61
61
|
return;
|
|
62
|
-
const
|
|
63
|
-
|
|
62
|
+
const c = as(s, e, p.data);
|
|
63
|
+
c && a.current(c);
|
|
64
64
|
};
|
|
65
|
-
return window.addEventListener("message",
|
|
66
|
-
}, [s, e]), /* @__PURE__ */
|
|
65
|
+
return window.addEventListener("message", r), () => window.removeEventListener("message", r);
|
|
66
|
+
}, [s, e]), /* @__PURE__ */ m(
|
|
67
67
|
"template",
|
|
68
68
|
{
|
|
69
69
|
"data-channel": s.name,
|
|
70
70
|
"data-comp-id": e,
|
|
71
|
-
"data-widget-data":
|
|
71
|
+
"data-widget-data": n
|
|
72
72
|
}
|
|
73
73
|
);
|
|
74
|
-
},
|
|
74
|
+
}, rs = os(
|
|
75
75
|
"@wix/form-app-builder:form"
|
|
76
|
-
),
|
|
77
|
-
siteWidget:
|
|
78
|
-
fallbackDirection:
|
|
79
|
-
},
|
|
80
|
-
({
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
76
|
+
), I = (s, e) => s.some((t) => t.id === e), is = (s) => (s.steps ?? []).reduce((e, { id: t, name: o }) => (t && e.push({ id: t, name: o ?? void 0 }), e), []), ms = "forms-platform-form", ls = "_siteWidget_1t4bv_1", cs = "_fallbackDirection_1t4bv_17", O = {
|
|
77
|
+
siteWidget: ls,
|
|
78
|
+
fallbackDirection: cs
|
|
79
|
+
}, gs = (s) => Z.getForm(s).then((e) => P(e)), T = L(
|
|
80
|
+
({
|
|
81
|
+
form: s,
|
|
82
|
+
compId: e,
|
|
83
|
+
wix: t,
|
|
84
|
+
elementProps: o,
|
|
85
|
+
state: n,
|
|
86
|
+
closedFormNotice: a,
|
|
87
|
+
closedMessagePlaceholder: r,
|
|
88
|
+
onRevisionChange: p
|
|
89
|
+
}, c) => {
|
|
90
|
+
var k, D, N;
|
|
91
|
+
const { t: j } = $(), i = Q(s), u = !!(a && ((k = i.properties) != null && k.disabled)), S = u && !n, v = !!(r && n === "closed" && !((N = (D = i.disabledFormMessage) == null ? void 0 : D.nodes) != null && N.length)), R = E(
|
|
92
|
+
() => ({
|
|
93
|
+
...i,
|
|
94
|
+
...u && {
|
|
95
|
+
properties: { ...i.properties, disabled: !1 }
|
|
96
|
+
},
|
|
97
|
+
...v && {
|
|
98
|
+
disabledFormMessage: r == null ? void 0 : r(j)
|
|
99
|
+
}
|
|
100
|
+
}),
|
|
101
|
+
[
|
|
102
|
+
i,
|
|
103
|
+
u,
|
|
104
|
+
v,
|
|
105
|
+
r,
|
|
106
|
+
j
|
|
107
|
+
]
|
|
108
|
+
), g = E(() => is(i), [i]), d = i.revision ?? void 0, [h, w] = f({}), [b, F] = f([]), [_, C] = f();
|
|
109
|
+
return y(() => {
|
|
110
|
+
var l;
|
|
111
|
+
_ && !I(g, _) && C((l = g[0]) == null ? void 0 : l.id);
|
|
112
|
+
}, [g, _]), /* @__PURE__ */ K(V, { children: [
|
|
113
|
+
/* @__PURE__ */ m(
|
|
114
|
+
ns,
|
|
88
115
|
{
|
|
89
|
-
channel:
|
|
116
|
+
channel: rs,
|
|
90
117
|
compId: e,
|
|
91
|
-
data: { steps:
|
|
92
|
-
onChange: (
|
|
93
|
-
|
|
118
|
+
data: { steps: g, stepId: _, revision: d },
|
|
119
|
+
onChange: (l) => {
|
|
120
|
+
I(g, l.stepId) && C(l.stepId), l.revision && l.revision !== d && p(l.revision);
|
|
94
121
|
}
|
|
95
122
|
}
|
|
96
123
|
),
|
|
97
|
-
|
|
98
|
-
|
|
124
|
+
S && a,
|
|
125
|
+
/* @__PURE__ */ m(
|
|
126
|
+
z,
|
|
99
127
|
{
|
|
100
|
-
ref:
|
|
101
|
-
className:
|
|
128
|
+
ref: c,
|
|
129
|
+
className: ms,
|
|
102
130
|
compId: e,
|
|
103
|
-
form:
|
|
131
|
+
form: R,
|
|
104
132
|
wix: t,
|
|
105
133
|
elementProps: o,
|
|
106
|
-
state:
|
|
107
|
-
values:
|
|
108
|
-
onChange:
|
|
109
|
-
errors:
|
|
110
|
-
onValidate:
|
|
111
|
-
stepId:
|
|
112
|
-
onStepIdChange:
|
|
134
|
+
state: n,
|
|
135
|
+
values: h,
|
|
136
|
+
onChange: w,
|
|
137
|
+
errors: b,
|
|
138
|
+
onValidate: F,
|
|
139
|
+
stepId: _,
|
|
140
|
+
onStepIdChange: C
|
|
113
141
|
}
|
|
114
142
|
)
|
|
115
143
|
] });
|
|
116
144
|
}
|
|
117
145
|
);
|
|
118
|
-
|
|
119
|
-
const
|
|
146
|
+
T.displayName = "FormViewerHost";
|
|
147
|
+
const W = L(
|
|
120
148
|
({
|
|
121
149
|
id: s,
|
|
122
150
|
className: e,
|
|
123
151
|
formId: t,
|
|
124
152
|
direction: o,
|
|
125
|
-
a11y:
|
|
153
|
+
a11y: n,
|
|
126
154
|
elementProps: a,
|
|
127
|
-
fallback:
|
|
128
|
-
emptyState:
|
|
129
|
-
pendingForm:
|
|
155
|
+
fallback: r = null,
|
|
156
|
+
emptyState: p = null,
|
|
157
|
+
pendingForm: c,
|
|
158
|
+
closedFormNotice: j,
|
|
159
|
+
closedMessagePlaceholder: i,
|
|
130
160
|
errorBoundary: u
|
|
131
|
-
},
|
|
132
|
-
var
|
|
133
|
-
const
|
|
134
|
-
|
|
161
|
+
}, S) => {
|
|
162
|
+
var w, b, F;
|
|
163
|
+
const v = es({ useSuspense: !0 }), [R, g] = f(), d = E(() => t ? gs(t) : c, [t, R, c]), h = /* @__PURE__ */ m(H, { fallback: r, children: s && d ? /* @__PURE__ */ m(
|
|
164
|
+
T,
|
|
135
165
|
{
|
|
136
|
-
ref:
|
|
137
|
-
form:
|
|
166
|
+
ref: S,
|
|
167
|
+
form: d,
|
|
138
168
|
compId: s,
|
|
139
|
-
wix: (
|
|
140
|
-
elementProps: (
|
|
169
|
+
wix: (w = a == null ? void 0 : a.form) == null ? void 0 : w.wix,
|
|
170
|
+
elementProps: (b = a == null ? void 0 : a.form) == null ? void 0 : b.elementProps,
|
|
141
171
|
state: (F = a == null ? void 0 : a.form) == null ? void 0 : F.state,
|
|
142
|
-
|
|
172
|
+
closedFormNotice: j,
|
|
173
|
+
closedMessagePlaceholder: i,
|
|
174
|
+
onRevisionChange: g
|
|
143
175
|
}
|
|
144
|
-
) :
|
|
145
|
-
return /* @__PURE__ */
|
|
176
|
+
) : p });
|
|
177
|
+
return /* @__PURE__ */ m(
|
|
146
178
|
"div",
|
|
147
179
|
{
|
|
148
180
|
id: s,
|
|
149
181
|
dir: o,
|
|
150
|
-
className:
|
|
182
|
+
className: X(
|
|
151
183
|
"form",
|
|
152
|
-
|
|
153
|
-
|
|
184
|
+
O.siteWidget,
|
|
185
|
+
O.fallbackDirection,
|
|
154
186
|
e
|
|
155
187
|
),
|
|
156
|
-
...
|
|
157
|
-
children: /* @__PURE__ */
|
|
188
|
+
...n && J(n),
|
|
189
|
+
children: /* @__PURE__ */ m(U, { i18n: v, children: u ? /* @__PURE__ */ m(u, { resetKey: d, children: h }) : h })
|
|
158
190
|
}
|
|
159
191
|
);
|
|
160
192
|
}
|
|
161
193
|
);
|
|
162
|
-
|
|
163
|
-
const
|
|
164
|
-
|
|
194
|
+
W.displayName = "FormRoot";
|
|
195
|
+
const ys = {}, ps = L((s, e) => /* @__PURE__ */ m(W, { ...s, ref: e }));
|
|
196
|
+
ps.displayName = "Form";
|
|
165
197
|
export {
|
|
166
|
-
|
|
167
|
-
|
|
198
|
+
ps as default,
|
|
199
|
+
ys as defaultProps
|
|
168
200
|
};
|
|
@@ -18,7 +18,7 @@ const e = "test", r = {
|
|
|
18
18
|
"form-picker.form-list.edit-form.button": "Edit",
|
|
19
19
|
"form.loader.create-from-template.progress-1": "Loading form template...",
|
|
20
20
|
"step-switcher.unavailable.retry.button": "Try again",
|
|
21
|
-
"form.empty-state.subtitle": "
|
|
21
|
+
"form.empty-state.subtitle": "Click Edit Form to choose a saved form or create a new one.",
|
|
22
22
|
"form-picker.forms-limit-banner.message": "To create more forms, <1>upgrade your plan.</1>",
|
|
23
23
|
"form-picker.no-forms.subtitle": "Create a form to show it in this widget.",
|
|
24
24
|
"form.loader.create-from-template.progress-4": "Getting form ready...",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wix/form-app-builder",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.310.0",
|
|
4
4
|
"description": "The Wix Forms Form for Builder apps: loads a form by id and renders it with @wix/form-elements/Form",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"files": [
|
|
@@ -45,12 +45,12 @@
|
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
47
|
"@wix/essentials": "^1.0.15",
|
|
48
|
-
"@wix/fed-cli-i18next": "^1.7.
|
|
49
|
-
"@wix/form-elements": "1.
|
|
50
|
-
"@wix/forms": "^1.0.
|
|
51
|
-
"@wix/react-component-utils": "^1.
|
|
48
|
+
"@wix/fed-cli-i18next": "^1.7.4",
|
|
49
|
+
"@wix/form-elements": "1.126.0",
|
|
50
|
+
"@wix/forms": "^1.0.537",
|
|
51
|
+
"@wix/react-component-utils": "^1.15.0",
|
|
52
52
|
"@wix/react-use-promise-polyfill": "^1.2.0",
|
|
53
|
-
"@wix/sdk-runtime": "^1.0.
|
|
53
|
+
"@wix/sdk-runtime": "^1.0.28",
|
|
54
54
|
"classnames": "^2.5.1"
|
|
55
55
|
},
|
|
56
56
|
"devDependencies": {
|
|
@@ -69,30 +69,30 @@
|
|
|
69
69
|
"@typescript/native": "npm:typescript@^7.0.2",
|
|
70
70
|
"@vercel/nft": "^1.11.0",
|
|
71
71
|
"@vitejs/plugin-react": "^4.7.0",
|
|
72
|
-
"@wix/app-extensions": "^1.0.
|
|
72
|
+
"@wix/app-extensions": "^1.0.200",
|
|
73
73
|
"@wix/babel-cli": "^1.20.0",
|
|
74
74
|
"@wix/builder-sandbox": "^1.12.2",
|
|
75
|
-
"@wix/cli": "^1.
|
|
76
|
-
"@wix/component-protocol": "^1.
|
|
77
|
-
"@wix/custom-extensions": "^0.2.
|
|
78
|
-
"@wix/design-system": "^1.
|
|
79
|
-
"@wix/editor": "^1.
|
|
80
|
-
"@wix/editor-react-types": "^1.0.
|
|
75
|
+
"@wix/cli": "^1.2.2",
|
|
76
|
+
"@wix/component-protocol": "^1.254.0",
|
|
77
|
+
"@wix/custom-extensions": "^0.2.28",
|
|
78
|
+
"@wix/design-system": "^1.341.0",
|
|
79
|
+
"@wix/editor": "^1.983.0",
|
|
80
|
+
"@wix/editor-react-types": "^1.0.110",
|
|
81
81
|
"@wix/fed-cli-oxlint": "^1.0.6",
|
|
82
82
|
"@wix/fed-cli-plugin": "^1.0.1",
|
|
83
|
-
"@wix/fed-cli-sled": "^1.0.
|
|
83
|
+
"@wix/fed-cli-sled": "^1.0.40",
|
|
84
84
|
"@wix/fed-cli-vitest": "^1.0.18",
|
|
85
85
|
"@wix/form-viewer": "^3.0.0",
|
|
86
|
-
"@wix/playwright-storybook-plugin": "^1.
|
|
86
|
+
"@wix/playwright-storybook-plugin": "^1.455.0",
|
|
87
87
|
"@wix/react-component-schema": "^1.10.0",
|
|
88
88
|
"@wix/sdk": "^1.21.18",
|
|
89
89
|
"@wix/sdk-types": "^1.17.12",
|
|
90
90
|
"@wix/services-manager": "^1.0.7",
|
|
91
91
|
"@wix/services-manager-react": "^1.0.8",
|
|
92
92
|
"@wix/site-service-editor-context": "^1.0.7",
|
|
93
|
-
"@wix/sled-playwright": "^1.
|
|
94
|
-
"@wix/viewer-playwright-app": "^1.0.
|
|
95
|
-
"@wix/wix-ui-icons-common": "^3.
|
|
93
|
+
"@wix/sled-playwright": "^1.404.0",
|
|
94
|
+
"@wix/viewer-playwright-app": "^1.0.985",
|
|
95
|
+
"@wix/wix-ui-icons-common": "^3.191.2",
|
|
96
96
|
"css.escape": "^1.5.1",
|
|
97
97
|
"oxfmt": "^0.62.0",
|
|
98
98
|
"oxlint": "^1.77.0",
|
|
@@ -134,5 +134,5 @@
|
|
|
134
134
|
]
|
|
135
135
|
}
|
|
136
136
|
},
|
|
137
|
-
"falconPackageHash": "
|
|
137
|
+
"falconPackageHash": "de2c2d3f8e80a42be054ebd6836cab8218862ef998e9a9a1cf29a3e4"
|
|
138
138
|
}
|