@skopon-cool/form-sdk 0.1.1 → 0.1.3
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 +47 -11
- package/dist/adapter/a2uiAdapter.d.ts.map +1 -1
- package/dist/adapter/formFileAccept.d.ts.map +1 -1
- package/dist/adapter/formSchema.d.ts +1 -0
- package/dist/adapter/formSchema.d.ts.map +1 -1
- package/dist/catalog/a2uiCustomCatalog.d.ts.map +1 -1
- package/dist/catalog/useSkoponBoundField.d.ts +2 -0
- package/dist/catalog/useSkoponBoundField.d.ts.map +1 -1
- package/dist/client/formClient.d.ts.map +1 -1
- package/dist/components/AskUserFormCard.d.ts +3 -1
- package/dist/components/AskUserFormCard.d.ts.map +1 -1
- package/dist/components/SkoponA2uiStreamRenderer.d.ts.map +1 -1
- package/dist/components/SkoponA2uiStreamRenderer.test.d.ts +2 -0
- package/dist/components/SkoponA2uiStreamRenderer.test.d.ts.map +1 -0
- package/dist/components/SkoponFormRenderer.d.ts.map +1 -1
- package/dist/form-sdk.css +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +941 -706
- package/dist/submit/buildCurlStatement.d.ts +8 -0
- package/dist/submit/buildCurlStatement.d.ts.map +1 -1
- package/dist/submit/intersectPayloadBlocksWithForm.d.ts +26 -0
- package/dist/submit/intersectPayloadBlocksWithForm.d.ts.map +1 -0
- package/dist/submit/submitFormJson.d.ts.map +1 -1
- package/package.json +11 -6
- package/src/adapter/a2uiAdapter.test.ts +68 -0
- package/src/adapter/a2uiAdapter.ts +7 -3
- package/src/adapter/formFileAccept.test.ts +53 -0
- package/src/adapter/formFileAccept.ts +11 -2
- package/src/adapter/formSchema.test.ts +35 -0
- package/src/adapter/formSchema.ts +5 -1
- package/src/catalog/a2uiCustomCatalog.tsx +28 -5
- package/src/catalog/textFieldPreview.test.tsx +1 -1
- package/src/catalog/useSkoponBoundField.test.ts +62 -0
- package/src/catalog/useSkoponBoundField.ts +10 -1
- package/src/client/formClient.test.ts +83 -0
- package/src/client/formClient.ts +10 -2
- package/src/components/AskUserFormCard.tsx +136 -58
- package/src/components/SkoponA2uiStreamRenderer.test.ts +62 -0
- package/src/components/SkoponA2uiStreamRenderer.test.tsx +79 -0
- package/src/components/SkoponA2uiStreamRenderer.tsx +96 -15
- package/src/components/SkoponFormRenderer.tsx +10 -7
- package/src/index.ts +11 -2
- package/src/styles/index.css +5 -0
- package/src/submit/buildCurlStatement.ts +49 -0
- package/src/submit/intersectPayloadBlocksWithForm.ts +175 -0
- package/src/submit/submit.test.ts +170 -10
- package/src/submit/submitFormJson.ts +20 -1
- package/dist/submit/intersectPayloadWithForm.d.ts +0 -17
- package/dist/submit/intersectPayloadWithForm.d.ts.map +0 -1
- package/src/submit/intersectPayloadWithForm.ts +0 -54
package/dist/index.js
CHANGED
|
@@ -1,37 +1,37 @@
|
|
|
1
1
|
import './form-sdk.css';
|
|
2
|
-
import { jsx as
|
|
3
|
-
import { createContext as
|
|
4
|
-
import { Catalog as
|
|
5
|
-
import { injectBasicCatalogStyles as
|
|
6
|
-
import { basicCatalog as
|
|
7
|
-
import { injectStyles as
|
|
8
|
-
import { z as
|
|
9
|
-
import { Typography as
|
|
10
|
-
import
|
|
11
|
-
import { FileTextOutlined as
|
|
12
|
-
const
|
|
2
|
+
import { jsx as s, jsxs as M, Fragment as Ie } from "react/jsx-runtime";
|
|
3
|
+
import { createContext as We, useContext as Ze, useCallback as ie, useSyncExternalStore as Qe, forwardRef as et, useEffect as _, useRef as w, useMemo as N, useImperativeHandle as tt, useState as O } from "react";
|
|
4
|
+
import { Catalog as rt, MessageProcessor as Pe } from "@a2ui/web_core/v0_9";
|
|
5
|
+
import { injectBasicCatalogStyles as we } from "@a2ui/web_core/v0_9/basic_catalog";
|
|
6
|
+
import { basicCatalog as Z, createBinderlessComponentImplementation as E, A2uiSurface as Ne } from "@a2ui/react/v0_9";
|
|
7
|
+
import { injectStyles as _e } from "@a2ui/react/styles";
|
|
8
|
+
import { z as m } from "zod";
|
|
9
|
+
import { Typography as R, Select as ue, Checkbox as nt, Radio as ot, Switch as at, TimePicker as it, DatePicker as lt, Upload as le, Input as ce, InputNumber as ct, Tooltip as Q, Tag as pe, Button as Fe, Spin as st } from "antd";
|
|
10
|
+
import Te from "dayjs";
|
|
11
|
+
import { FileTextOutlined as ut, FileExcelOutlined as pt, FileOutlined as Oe, PictureOutlined as dt, SoundOutlined as mt, VideoCameraOutlined as ft } from "@ant-design/icons";
|
|
12
|
+
const en = "v0.9", ht = [
|
|
13
13
|
"huge",
|
|
14
14
|
"large",
|
|
15
15
|
"medium",
|
|
16
16
|
"small",
|
|
17
17
|
"icon"
|
|
18
18
|
];
|
|
19
|
-
function
|
|
19
|
+
function de(e) {
|
|
20
20
|
return e === "image" || e === "video" || e === "audio";
|
|
21
21
|
}
|
|
22
|
-
function
|
|
22
|
+
function ve(e) {
|
|
23
23
|
return e === "heading" || e === "paragraph";
|
|
24
24
|
}
|
|
25
|
-
function
|
|
26
|
-
return !
|
|
25
|
+
function F(e) {
|
|
26
|
+
return !ve(e) && !de(e);
|
|
27
27
|
}
|
|
28
|
-
function
|
|
28
|
+
function vt() {
|
|
29
29
|
if (typeof crypto < "u" && typeof crypto.randomUUID == "function")
|
|
30
30
|
return crypto.randomUUID();
|
|
31
31
|
if (typeof crypto < "u" && typeof crypto.getRandomValues == "function") {
|
|
32
32
|
const e = new Uint8Array(16);
|
|
33
33
|
crypto.getRandomValues(e), e[6] = e[6] & 15 | 64, e[8] = e[8] & 63 | 128;
|
|
34
|
-
const t = Array.from(e, (
|
|
34
|
+
const t = Array.from(e, (r) => r.toString(16).padStart(2, "0")).join("");
|
|
35
35
|
return `${t.slice(0, 8)}-${t.slice(8, 12)}-${t.slice(12, 16)}-${t.slice(16, 20)}-${t.slice(20)}`;
|
|
36
36
|
}
|
|
37
37
|
return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (e) => {
|
|
@@ -39,30 +39,11 @@ function Ze() {
|
|
|
39
39
|
return (e === "x" ? t : t & 3 | 8).toString(16);
|
|
40
40
|
});
|
|
41
41
|
}
|
|
42
|
-
function
|
|
43
|
-
const t =
|
|
42
|
+
function H(e) {
|
|
43
|
+
const t = vt().replace(/-/g, "").slice(0, 8);
|
|
44
44
|
return `${e}${t}`;
|
|
45
45
|
}
|
|
46
|
-
|
|
47
|
-
return typeof e == "string" && Je.includes(e) ? e : "medium";
|
|
48
|
-
}
|
|
49
|
-
function Qe(e, t) {
|
|
50
|
-
var o;
|
|
51
|
-
const n = Math.max(1, t);
|
|
52
|
-
let r = [];
|
|
53
|
-
return Array.isArray(e.mediaUrls) ? r = e.mediaUrls.map((i) => String(i).trim()) : (o = e.mediaUrl) != null && o.trim() && (r = [e.mediaUrl.trim()]), r.length === 0 ? [""] : r.slice(0, n);
|
|
54
|
-
}
|
|
55
|
-
function et(e) {
|
|
56
|
-
var t;
|
|
57
|
-
return Array.isArray(e.mediaUrls) ? e.mediaUrls.map((n) => n.trim()).filter(Boolean) : (t = e.mediaUrl) != null && t.trim() ? [e.mediaUrl.trim()] : [];
|
|
58
|
-
}
|
|
59
|
-
function tt(e) {
|
|
60
|
-
return `form-media-size-${F(e)}`;
|
|
61
|
-
}
|
|
62
|
-
function nt(e) {
|
|
63
|
-
return `form-media-preview form-media-list ${tt(e)}`;
|
|
64
|
-
}
|
|
65
|
-
const fe = [
|
|
46
|
+
const Ve = [
|
|
66
47
|
{ value: "image/*", label: "图片" },
|
|
67
48
|
{ value: "video/*", label: "视频" },
|
|
68
49
|
{ value: "audio/*", label: "音频" },
|
|
@@ -73,7 +54,7 @@ const fe = [
|
|
|
73
54
|
{ value: "text/plain", label: "纯文本" },
|
|
74
55
|
{ value: "application/zip", label: "ZIP 压缩包" },
|
|
75
56
|
{ value: "application/x-rar-compressed", label: "RAR 压缩包" }
|
|
76
|
-
],
|
|
57
|
+
], yt = {
|
|
77
58
|
"image/*": ["image/*"],
|
|
78
59
|
"video/*": ["video/*"],
|
|
79
60
|
"audio/*": ["audio/*"],
|
|
@@ -93,7 +74,7 @@ const fe = [
|
|
|
93
74
|
"text/plain": ["text/plain"],
|
|
94
75
|
"application/zip": ["application/zip"],
|
|
95
76
|
"application/x-rar-compressed": ["application/x-rar-compressed"]
|
|
96
|
-
},
|
|
77
|
+
}, gt = {
|
|
97
78
|
"image/*": [".jpg", ".jpeg", ".png", ".gif", ".webp", ".svg"],
|
|
98
79
|
"video/*": [".mp4", ".mov", ".avi", ".webm"],
|
|
99
80
|
"audio/*": [".mp3", ".wav", ".ogg", ".m4a"],
|
|
@@ -104,14 +85,14 @@ const fe = [
|
|
|
104
85
|
"text/plain": [".txt"],
|
|
105
86
|
"application/zip": [".zip", ".7z"],
|
|
106
87
|
"application/x-rar-compressed": [".rar"]
|
|
107
|
-
},
|
|
88
|
+
}, bt = {
|
|
108
89
|
"application/msword": "office/word",
|
|
109
90
|
"application/vnd.openxmlformats-officedocument.wordprocessingml.document": "office/word",
|
|
110
91
|
"application/vnd.ms-excel": "office/excel",
|
|
111
92
|
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": "office/excel",
|
|
112
93
|
"application/vnd.ms-powerpoint": "office/ppt",
|
|
113
94
|
"application/vnd.openxmlformats-officedocument.presentationml.presentation": "office/ppt"
|
|
114
|
-
},
|
|
95
|
+
}, ye = [
|
|
115
96
|
{ value: ".jpg", label: ".jpg" },
|
|
116
97
|
{ value: ".jpeg", label: ".jpeg" },
|
|
117
98
|
{ value: ".png", label: ".png" },
|
|
@@ -137,107 +118,134 @@ const fe = [
|
|
|
137
118
|
{ value: ".zip", label: ".zip" },
|
|
138
119
|
{ value: ".rar", label: ".rar" },
|
|
139
120
|
{ value: ".7z", label: ".7z" }
|
|
140
|
-
],
|
|
141
|
-
|
|
142
|
-
),
|
|
143
|
-
|
|
144
|
-
),
|
|
145
|
-
|
|
121
|
+
], xt = Object.fromEntries(
|
|
122
|
+
Ve.map((e) => [e.value, e.label])
|
|
123
|
+
), St = Object.fromEntries(
|
|
124
|
+
ye.map((e) => [e.value, e.label])
|
|
125
|
+
), kt = new Set(Ve.map((e) => e.value)), At = new Set(
|
|
126
|
+
ye.map((e) => e.value)
|
|
127
|
+
);
|
|
128
|
+
function Tt(e) {
|
|
146
129
|
const t = e.trim();
|
|
147
|
-
return t ?
|
|
130
|
+
return t ? kt.has(t) ? t : bt[t] ?? null : null;
|
|
148
131
|
}
|
|
149
|
-
function
|
|
132
|
+
function Ct(e) {
|
|
150
133
|
return Array.isArray(e) ? e.map((t) => {
|
|
151
|
-
const
|
|
152
|
-
return
|
|
134
|
+
const r = t.trim().toLowerCase();
|
|
135
|
+
return r ? r.startsWith(".") ? r : `.${r}` : "";
|
|
153
136
|
}).filter(Boolean) : [];
|
|
154
137
|
}
|
|
155
|
-
function
|
|
138
|
+
function Y(e) {
|
|
156
139
|
if (!Array.isArray(e)) return [];
|
|
157
|
-
const t = [],
|
|
158
|
-
for (const
|
|
159
|
-
const o =
|
|
160
|
-
o && !
|
|
140
|
+
const t = [], r = /* @__PURE__ */ new Set();
|
|
141
|
+
for (const n of e) {
|
|
142
|
+
const o = Tt(n);
|
|
143
|
+
o && !r.has(o) && (r.add(o), t.push(o));
|
|
161
144
|
}
|
|
162
145
|
return t;
|
|
163
146
|
}
|
|
164
|
-
function
|
|
165
|
-
const t =
|
|
166
|
-
for (const
|
|
167
|
-
|
|
168
|
-
return
|
|
147
|
+
function Mt(e) {
|
|
148
|
+
const t = Y(e), r = [];
|
|
149
|
+
for (const n of t)
|
|
150
|
+
r.push(...yt[n] ?? [n]);
|
|
151
|
+
return r;
|
|
169
152
|
}
|
|
170
|
-
function
|
|
171
|
-
const t =
|
|
153
|
+
function Et(e) {
|
|
154
|
+
const t = Y(e);
|
|
172
155
|
if (t.length === 0) return [];
|
|
173
|
-
const
|
|
174
|
-
for (const
|
|
175
|
-
for (const o of
|
|
176
|
-
|
|
177
|
-
return
|
|
178
|
-
}
|
|
179
|
-
function
|
|
180
|
-
const n =
|
|
181
|
-
|
|
156
|
+
const r = /* @__PURE__ */ new Set();
|
|
157
|
+
for (const n of t)
|
|
158
|
+
for (const o of gt[n] ?? [])
|
|
159
|
+
r.add(o);
|
|
160
|
+
return ye.filter((n) => r.has(n.value));
|
|
161
|
+
}
|
|
162
|
+
function ge(e, t) {
|
|
163
|
+
const r = Ct(t), n = Y(e);
|
|
164
|
+
if (n.length === 0)
|
|
165
|
+
return r.filter((i) => At.has(i));
|
|
166
|
+
const o = new Set(
|
|
167
|
+
Et(n).map((i) => i.value)
|
|
182
168
|
);
|
|
183
|
-
return
|
|
169
|
+
return r.filter((i) => o.has(i));
|
|
184
170
|
}
|
|
185
|
-
function
|
|
186
|
-
const
|
|
171
|
+
function It(e, t) {
|
|
172
|
+
const r = Mt(e), n = ge(e, t), o = [...r, ...n];
|
|
187
173
|
return o.length > 0 ? o.join(",") : void 0;
|
|
188
174
|
}
|
|
189
|
-
function
|
|
190
|
-
const
|
|
191
|
-
|
|
175
|
+
function Pt(e, t) {
|
|
176
|
+
const r = Y(e), n = ge(
|
|
177
|
+
r,
|
|
192
178
|
t
|
|
193
179
|
), o = [
|
|
194
|
-
...
|
|
195
|
-
...
|
|
180
|
+
...r.map((i) => xt[i] ?? i),
|
|
181
|
+
...n.map((i) => St[i] ?? i)
|
|
196
182
|
];
|
|
197
183
|
return o.length === 0 ? null : o.join("、");
|
|
198
184
|
}
|
|
199
|
-
const
|
|
185
|
+
const wt = [
|
|
200
186
|
"video",
|
|
201
187
|
"audio",
|
|
202
188
|
"image",
|
|
203
189
|
"file",
|
|
204
190
|
"spreadsheet",
|
|
205
191
|
"document"
|
|
206
|
-
],
|
|
207
|
-
function
|
|
208
|
-
return e &&
|
|
192
|
+
], Nt = new Set(wt);
|
|
193
|
+
function _t(e) {
|
|
194
|
+
return e && Nt.has(e) ? e : "file";
|
|
195
|
+
}
|
|
196
|
+
function J(e) {
|
|
197
|
+
return typeof e == "string" && ht.includes(e) ? e : "medium";
|
|
198
|
+
}
|
|
199
|
+
function Ft(e, t) {
|
|
200
|
+
var o;
|
|
201
|
+
const r = Math.max(1, t);
|
|
202
|
+
let n = [];
|
|
203
|
+
return Array.isArray(e.mediaUrls) ? n = e.mediaUrls.map((i) => String(i).trim()) : (o = e.mediaUrl) != null && o.trim() && (n = [e.mediaUrl.trim()]), n.length === 0 ? [""] : n.slice(0, r);
|
|
204
|
+
}
|
|
205
|
+
function Ot(e) {
|
|
206
|
+
var t;
|
|
207
|
+
return Array.isArray(e.mediaUrls) ? e.mediaUrls.map((r) => r.trim()).filter(Boolean) : (t = e.mediaUrl) != null && t.trim() ? [e.mediaUrl.trim()] : [];
|
|
208
|
+
}
|
|
209
|
+
function Vt(e) {
|
|
210
|
+
return `form-media-size-${J(e)}`;
|
|
211
|
+
}
|
|
212
|
+
function Bt(e) {
|
|
213
|
+
return `form-media-preview form-media-list ${Vt(e)}`;
|
|
214
|
+
}
|
|
215
|
+
const jt = 10;
|
|
216
|
+
function be(e) {
|
|
217
|
+
return e === !0 || e === "true";
|
|
209
218
|
}
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
return Number.isFinite(n) ? Math.max(0, Math.floor(n)) : t;
|
|
219
|
+
function Ce(e, t = 1) {
|
|
220
|
+
const r = typeof e == "number" ? e : Number(e);
|
|
221
|
+
return Number.isFinite(r) ? Math.max(0, Math.floor(r)) : t;
|
|
214
222
|
}
|
|
215
|
-
function
|
|
223
|
+
function Lt(e, t) {
|
|
216
224
|
if (t !== void 0)
|
|
217
|
-
return e === "toggle" ? t
|
|
225
|
+
return e === "toggle" ? be(t) : e === "multiselect" || e === "checkbox" ? Array.isArray(t) ? t.map(String) : typeof t == "string" && t ? [t] : [] : typeof t == "boolean" ? t ? "true" : "false" : Array.isArray(t) ? t.map(String) : String(t);
|
|
218
226
|
}
|
|
219
|
-
function
|
|
220
|
-
var
|
|
221
|
-
const t =
|
|
227
|
+
function zt(e) {
|
|
228
|
+
var n, o;
|
|
229
|
+
const t = Y(e.fileAcceptTypes), r = e.type;
|
|
222
230
|
return {
|
|
223
|
-
id: ((
|
|
224
|
-
type:
|
|
231
|
+
id: ((n = e.id) == null ? void 0 : n.trim()) || H("block-"),
|
|
232
|
+
type: r,
|
|
225
233
|
name: ((o = e.name) == null ? void 0 : o.trim()) || void 0,
|
|
226
234
|
label: e.label ?? "",
|
|
227
235
|
placeholder: e.placeholder ?? "",
|
|
228
236
|
help: e.help ?? "",
|
|
229
237
|
required: e.required === !0,
|
|
230
|
-
mediaUrls:
|
|
231
|
-
mediaSize:
|
|
238
|
+
mediaUrls: de(r) ? Ft(e, jt) : void 0,
|
|
239
|
+
mediaSize: de(r) ? J(e.mediaSize) : void 0,
|
|
232
240
|
fileAcceptTypes: t,
|
|
233
|
-
fileAcceptExtensions:
|
|
241
|
+
fileAcceptExtensions: ge(
|
|
234
242
|
t,
|
|
235
243
|
e.fileAcceptExtensions
|
|
236
244
|
),
|
|
237
|
-
filePlaceholderIcon:
|
|
238
|
-
fileMinCount:
|
|
239
|
-
fileMaxCount:
|
|
240
|
-
defaultValue:
|
|
245
|
+
filePlaceholderIcon: _t(e.filePlaceholderIcon),
|
|
246
|
+
fileMinCount: r === "file" ? Ce(e.fileMinCount, 1) : void 0,
|
|
247
|
+
fileMaxCount: r === "file" ? Ce(e.fileMaxCount, 1) : void 0,
|
|
248
|
+
defaultValue: Lt(r, e.defaultValue),
|
|
241
249
|
options: Array.isArray(e.options) ? e.options.map((i, a) => {
|
|
242
250
|
var l, c;
|
|
243
251
|
return {
|
|
@@ -247,7 +255,7 @@ function xt(e) {
|
|
|
247
255
|
}) : void 0
|
|
248
256
|
};
|
|
249
257
|
}
|
|
250
|
-
function
|
|
258
|
+
function ee(e) {
|
|
251
259
|
return {
|
|
252
260
|
title: e.title ?? "",
|
|
253
261
|
description: e.description ?? "",
|
|
@@ -255,50 +263,50 @@ function R(e) {
|
|
|
255
263
|
jsonSchema: e.jsonSchema ?? {}
|
|
256
264
|
};
|
|
257
265
|
}
|
|
258
|
-
function
|
|
266
|
+
function B(e) {
|
|
259
267
|
if (!e || !Array.isArray(e.blocks))
|
|
260
|
-
return
|
|
261
|
-
const t = e.blocks.map(
|
|
262
|
-
return
|
|
268
|
+
return ee({ title: "", description: "", blocks: [], jsonSchema: {} });
|
|
269
|
+
const t = e.blocks.map(zt);
|
|
270
|
+
return ee({
|
|
263
271
|
title: typeof e.title == "string" ? e.title : "",
|
|
264
272
|
description: typeof e.description == "string" ? e.description : "",
|
|
265
273
|
blocks: t,
|
|
266
274
|
jsonSchema: {}
|
|
267
275
|
});
|
|
268
276
|
}
|
|
269
|
-
const
|
|
270
|
-
function
|
|
277
|
+
const te = "root", me = "__title__", fe = "__desc__", Be = "^[^@\\s]+@[^@\\s]+\\.[^@\\s]+$";
|
|
278
|
+
function Ut(e) {
|
|
271
279
|
return `/${e}`;
|
|
272
280
|
}
|
|
273
|
-
function
|
|
281
|
+
function $t(e) {
|
|
274
282
|
return e && typeof e == "object" && "path" in e ? String(e.path ?? "").replace(/^\//, "") : "";
|
|
275
283
|
}
|
|
276
|
-
function
|
|
284
|
+
function S(e) {
|
|
277
285
|
if (typeof e == "string") return e;
|
|
278
286
|
}
|
|
279
|
-
function
|
|
280
|
-
const t = e.id ||
|
|
287
|
+
function Rt(e) {
|
|
288
|
+
const t = e.id || H("a2-"), r = e.type === "video" ? "video" : e.type === "audio" ? "audio" : "image";
|
|
281
289
|
return {
|
|
282
290
|
id: t,
|
|
283
291
|
component: "SkoponMedia",
|
|
284
|
-
mediaType:
|
|
285
|
-
urls:
|
|
286
|
-
mediaSize:
|
|
292
|
+
mediaType: r,
|
|
293
|
+
urls: Ot(e),
|
|
294
|
+
mediaSize: J(e.mediaSize),
|
|
287
295
|
label: e.label ?? "",
|
|
288
296
|
help: e.help ?? "",
|
|
289
297
|
placeholder: e.placeholder ?? ""
|
|
290
298
|
};
|
|
291
299
|
}
|
|
292
|
-
function
|
|
300
|
+
function Dt(e) {
|
|
293
301
|
if (Array.isArray(e.urls))
|
|
294
|
-
return e.urls.map((
|
|
295
|
-
const t =
|
|
302
|
+
return e.urls.map((r) => String(r).trim()).filter(Boolean);
|
|
303
|
+
const t = S(e.url);
|
|
296
304
|
return t != null && t.trim() ? [t.trim()] : [];
|
|
297
305
|
}
|
|
298
|
-
function
|
|
299
|
-
const
|
|
306
|
+
function K(e, t, r) {
|
|
307
|
+
const n = typeof e.id == "string" ? e.id : H("block-"), o = Dt(e), i = S(e.label) ?? S(e.description) ?? r, a = S(e.help), l = S(e.placeholder), c = J(e.mediaSize);
|
|
300
308
|
return {
|
|
301
|
-
id:
|
|
309
|
+
id: n,
|
|
302
310
|
type: t,
|
|
303
311
|
label: i,
|
|
304
312
|
...a ? { help: a } : {},
|
|
@@ -307,34 +315,35 @@ function D(e, t, n) {
|
|
|
307
315
|
mediaUrls: o.length > 0 ? o : [""]
|
|
308
316
|
};
|
|
309
317
|
}
|
|
310
|
-
function
|
|
318
|
+
function Ht(e) {
|
|
311
319
|
switch (e.type) {
|
|
312
320
|
case "toggle":
|
|
313
|
-
return
|
|
321
|
+
return be(e.defaultValue);
|
|
314
322
|
case "multiselect":
|
|
315
323
|
case "checkbox":
|
|
324
|
+
return Array.isArray(e.defaultValue) ? e.defaultValue : typeof e.defaultValue == "string" && e.defaultValue ? [e.defaultValue] : [];
|
|
316
325
|
case "select":
|
|
317
326
|
case "radio":
|
|
318
|
-
return Array.isArray(e.defaultValue) ? e.defaultValue : typeof e.defaultValue == "string"
|
|
327
|
+
return Array.isArray(e.defaultValue) ? e.defaultValue[0] ?? "" : typeof e.defaultValue == "string" ? e.defaultValue : "";
|
|
319
328
|
default:
|
|
320
329
|
return typeof e.defaultValue == "string" ? e.defaultValue : "";
|
|
321
330
|
}
|
|
322
331
|
}
|
|
323
|
-
function
|
|
332
|
+
function Yt(e) {
|
|
324
333
|
var l;
|
|
325
|
-
const t = e.id ||
|
|
334
|
+
const t = e.id || H("a2-"), r = e.label ?? "", n = ((l = e.name) == null ? void 0 : l.trim()) || "", o = n ? Ut(n) : void 0, i = (e.options ?? []).map((c) => ({ label: c.label, value: c.value })), a = (c) => n ? { node: c, dataKey: n, dataValue: Ht(e) } : { node: c };
|
|
326
335
|
switch (e.type) {
|
|
327
336
|
case "heading":
|
|
328
|
-
return { node: { id: t, component: "Text", text:
|
|
337
|
+
return { node: { id: t, component: "Text", text: r, variant: "h3" } };
|
|
329
338
|
case "paragraph":
|
|
330
|
-
return { node: { id: t, component: "Text", text:
|
|
339
|
+
return { node: { id: t, component: "Text", text: r, variant: "body" } };
|
|
331
340
|
case "text":
|
|
332
341
|
case "tel":
|
|
333
342
|
case "url":
|
|
334
343
|
return a({
|
|
335
344
|
id: t,
|
|
336
345
|
component: "TextField",
|
|
337
|
-
label:
|
|
346
|
+
label: r,
|
|
338
347
|
variant: "shortText",
|
|
339
348
|
...e.placeholder ? { placeholder: e.placeholder } : {},
|
|
340
349
|
value: { path: o }
|
|
@@ -343,9 +352,9 @@ function It(e) {
|
|
|
343
352
|
return a({
|
|
344
353
|
id: t,
|
|
345
354
|
component: "TextField",
|
|
346
|
-
label:
|
|
355
|
+
label: r,
|
|
347
356
|
variant: "shortText",
|
|
348
|
-
validationRegexp:
|
|
357
|
+
validationRegexp: Be,
|
|
349
358
|
...e.placeholder ? { placeholder: e.placeholder } : {},
|
|
350
359
|
value: { path: o }
|
|
351
360
|
});
|
|
@@ -353,7 +362,7 @@ function It(e) {
|
|
|
353
362
|
return a({
|
|
354
363
|
id: t,
|
|
355
364
|
component: "TextField",
|
|
356
|
-
label:
|
|
365
|
+
label: r,
|
|
357
366
|
variant: "longText",
|
|
358
367
|
...e.placeholder ? { placeholder: e.placeholder } : {},
|
|
359
368
|
value: { path: o }
|
|
@@ -362,7 +371,7 @@ function It(e) {
|
|
|
362
371
|
return a({
|
|
363
372
|
id: t,
|
|
364
373
|
component: "TextField",
|
|
365
|
-
label:
|
|
374
|
+
label: r,
|
|
366
375
|
variant: "number",
|
|
367
376
|
...e.placeholder ? { placeholder: e.placeholder } : {},
|
|
368
377
|
value: { path: o }
|
|
@@ -371,7 +380,7 @@ function It(e) {
|
|
|
371
380
|
return a({
|
|
372
381
|
id: t,
|
|
373
382
|
component: "SkoponSelect",
|
|
374
|
-
label:
|
|
383
|
+
label: r,
|
|
375
384
|
mode: "single",
|
|
376
385
|
placeholder: e.placeholder ?? "",
|
|
377
386
|
options: i,
|
|
@@ -381,7 +390,7 @@ function It(e) {
|
|
|
381
390
|
return a({
|
|
382
391
|
id: t,
|
|
383
392
|
component: "ChoicePicker",
|
|
384
|
-
label:
|
|
393
|
+
label: r,
|
|
385
394
|
variant: "mutuallyExclusive",
|
|
386
395
|
skoponPickerType: "radio",
|
|
387
396
|
options: i,
|
|
@@ -391,7 +400,7 @@ function It(e) {
|
|
|
391
400
|
return a({
|
|
392
401
|
id: t,
|
|
393
402
|
component: "SkoponSelect",
|
|
394
|
-
label:
|
|
403
|
+
label: r,
|
|
395
404
|
mode: "multiple",
|
|
396
405
|
placeholder: e.placeholder ?? "",
|
|
397
406
|
options: i,
|
|
@@ -401,19 +410,19 @@ function It(e) {
|
|
|
401
410
|
return a({
|
|
402
411
|
id: t,
|
|
403
412
|
component: "ChoicePicker",
|
|
404
|
-
label:
|
|
413
|
+
label: r,
|
|
405
414
|
variant: "multipleSelection",
|
|
406
415
|
skoponPickerType: "checkbox",
|
|
407
416
|
options: i,
|
|
408
417
|
value: { path: o }
|
|
409
418
|
});
|
|
410
419
|
case "toggle":
|
|
411
|
-
return a({ id: t, component: "CheckBox", label:
|
|
420
|
+
return a({ id: t, component: "CheckBox", label: r, value: { path: o } });
|
|
412
421
|
case "datetime":
|
|
413
422
|
return a({
|
|
414
423
|
id: t,
|
|
415
424
|
component: "DateTimeInput",
|
|
416
|
-
label:
|
|
425
|
+
label: r,
|
|
417
426
|
enableDate: !0,
|
|
418
427
|
enableTime: !0,
|
|
419
428
|
placeholder: e.placeholder ?? "",
|
|
@@ -423,7 +432,7 @@ function It(e) {
|
|
|
423
432
|
return a({
|
|
424
433
|
id: t,
|
|
425
434
|
component: "DateTimeInput",
|
|
426
|
-
label:
|
|
435
|
+
label: r,
|
|
427
436
|
enableTime: !0,
|
|
428
437
|
placeholder: e.placeholder ?? "",
|
|
429
438
|
value: { path: o }
|
|
@@ -431,12 +440,12 @@ function It(e) {
|
|
|
431
440
|
case "image":
|
|
432
441
|
case "video":
|
|
433
442
|
case "audio":
|
|
434
|
-
return { node:
|
|
443
|
+
return { node: Rt(e) };
|
|
435
444
|
case "file":
|
|
436
445
|
return a({
|
|
437
446
|
id: t,
|
|
438
447
|
component: "FileUpload",
|
|
439
|
-
label:
|
|
448
|
+
label: r,
|
|
440
449
|
accept: (e.fileAcceptExtensions ?? []).join(","),
|
|
441
450
|
fileAcceptTypes: e.fileAcceptTypes ?? [],
|
|
442
451
|
filePlaceholderIcon: e.filePlaceholderIcon ?? "document",
|
|
@@ -448,54 +457,54 @@ function It(e) {
|
|
|
448
457
|
return { node: null };
|
|
449
458
|
}
|
|
450
459
|
}
|
|
451
|
-
function
|
|
460
|
+
function he(e) {
|
|
452
461
|
if (!e || !Array.isArray(e.components) || e.components.length === 0) return !0;
|
|
453
|
-
const t = e.components.find((
|
|
462
|
+
const t = e.components.find((n) => n.id === te);
|
|
454
463
|
if (!t) return e.components.length === 0;
|
|
455
|
-
const
|
|
456
|
-
return !Array.isArray(
|
|
457
|
-
}
|
|
458
|
-
function
|
|
459
|
-
const
|
|
460
|
-
i && a && (
|
|
461
|
-
for (const
|
|
462
|
-
const { node:
|
|
463
|
-
|
|
464
|
+
const r = t.children;
|
|
465
|
+
return !Array.isArray(r) || r.length === 0;
|
|
466
|
+
}
|
|
467
|
+
function je(e, t) {
|
|
468
|
+
const r = [], n = [], o = {}, i = (t == null ? void 0 : t.includeHeader) !== !1, a = (e.title ?? "").trim(), l = (e.description ?? "").trim();
|
|
469
|
+
i && a && (r.push({ id: me, component: "Text", text: a, variant: "h2" }), n.push(me)), i && l && (r.push({ id: fe, component: "Text", text: l, variant: "body" }), n.push(fe));
|
|
470
|
+
for (const f of e.blocks ?? []) {
|
|
471
|
+
const { node: d, dataKey: p, dataValue: y } = Yt(f);
|
|
472
|
+
d && (r.push(d), n.push(d.id), p && (o[p] = y));
|
|
464
473
|
}
|
|
465
|
-
|
|
466
|
-
const c = { root:
|
|
467
|
-
return
|
|
474
|
+
r.unshift({ id: te, component: "Column", children: n });
|
|
475
|
+
const c = { root: te, components: r, dataModel: o }, u = t == null ? void 0 : t.styleId;
|
|
476
|
+
return u !== void 0 && (c.surfaceProperties = { styleId: u ?? null }), c;
|
|
468
477
|
}
|
|
469
|
-
function
|
|
478
|
+
function Jt(e) {
|
|
470
479
|
const t = /* @__PURE__ */ new Map();
|
|
471
|
-
for (const
|
|
472
|
-
|
|
480
|
+
for (const r of e.components ?? [])
|
|
481
|
+
r && typeof r.id == "string" && t.set(r.id, r);
|
|
473
482
|
return t;
|
|
474
483
|
}
|
|
475
|
-
function
|
|
484
|
+
function se(e) {
|
|
476
485
|
const t = e.options;
|
|
477
|
-
return Array.isArray(t) ? t.map((
|
|
478
|
-
if (!
|
|
479
|
-
const
|
|
486
|
+
return Array.isArray(t) ? t.map((r) => {
|
|
487
|
+
if (!r || typeof r != "object") return null;
|
|
488
|
+
const n = r;
|
|
480
489
|
return {
|
|
481
|
-
value: String(
|
|
482
|
-
label: String(
|
|
490
|
+
value: String(n.value ?? n.label ?? ""),
|
|
491
|
+
label: String(n.label ?? n.value ?? "")
|
|
483
492
|
};
|
|
484
|
-
}).filter((
|
|
493
|
+
}).filter((r) => !!r) : [];
|
|
485
494
|
}
|
|
486
|
-
function
|
|
487
|
-
const t = typeof e.id == "string" ? e.id :
|
|
488
|
-
switch (
|
|
495
|
+
function Gt(e) {
|
|
496
|
+
const t = typeof e.id == "string" ? e.id : H("block-"), r = String(e.component ?? ""), n = S(e.label) ?? S(e.text) ?? "", o = $t(e.value), i = (a) => ({ id: t, type: a, label: n });
|
|
497
|
+
switch (r) {
|
|
489
498
|
case "Text": {
|
|
490
499
|
const a = String(e.variant ?? "body"), l = /^h[1-6]$/i.test(a) || a === "title" || a === "subtitle";
|
|
491
|
-
return { id: t, type: l ? "heading" : "paragraph", label:
|
|
500
|
+
return { id: t, type: l ? "heading" : "paragraph", label: n };
|
|
492
501
|
}
|
|
493
502
|
case "TextField": {
|
|
494
503
|
const a = String(e.variant ?? "shortText");
|
|
495
504
|
let l = "text";
|
|
496
|
-
a === "longText" ? l = "textarea" : a === "number" ? l = "number" :
|
|
497
|
-
const c = { ...i(l), name: o },
|
|
498
|
-
return
|
|
505
|
+
a === "longText" ? l = "textarea" : a === "number" ? l = "number" : S(e.validationRegexp) === Be && (l = "email");
|
|
506
|
+
const c = { ...i(l), name: o }, u = S(e.placeholder);
|
|
507
|
+
return u && (c.placeholder = u), c;
|
|
499
508
|
}
|
|
500
509
|
case "CheckBox":
|
|
501
510
|
return { ...i("toggle"), name: o };
|
|
@@ -503,178 +512,295 @@ function Mt(e) {
|
|
|
503
512
|
const l = String(e.mode ?? "single") === "multiple" ? "multiselect" : "select", c = {
|
|
504
513
|
...i(l),
|
|
505
514
|
name: o,
|
|
506
|
-
options:
|
|
507
|
-
},
|
|
508
|
-
return
|
|
515
|
+
options: se(e)
|
|
516
|
+
}, u = S(e.placeholder);
|
|
517
|
+
return u && (c.placeholder = u), c;
|
|
509
518
|
}
|
|
510
519
|
case "ChoicePicker": {
|
|
511
|
-
const a =
|
|
520
|
+
const a = S(e.skoponPickerType);
|
|
512
521
|
if (a === "select" || a === "multiselect" || a === "radio" || a === "checkbox") {
|
|
513
|
-
const
|
|
522
|
+
const u = {
|
|
514
523
|
...i(a),
|
|
515
524
|
name: o,
|
|
516
|
-
options:
|
|
517
|
-
},
|
|
518
|
-
return
|
|
525
|
+
options: se(e)
|
|
526
|
+
}, f = S(e.placeholder);
|
|
527
|
+
return f && (u.placeholder = f), u;
|
|
519
528
|
}
|
|
520
529
|
const c = String(e.variant ?? "mutuallyExclusive") === "multipleSelection" ? "checkbox" : "radio";
|
|
521
|
-
return { ...i(c), name: o, options:
|
|
530
|
+
return { ...i(c), name: o, options: se(e) };
|
|
522
531
|
}
|
|
523
532
|
case "DateTimeInput": {
|
|
524
|
-
const a = e.enableDate === !0, l = e.enableTime === !0,
|
|
525
|
-
return
|
|
533
|
+
const a = e.enableDate === !0, l = e.enableTime === !0, u = { ...i(!a && l ? "time" : "datetime"), name: o }, f = S(e.placeholder);
|
|
534
|
+
return f && (u.placeholder = f), u;
|
|
526
535
|
}
|
|
527
536
|
case "SkoponMedia": {
|
|
528
537
|
const a = String(e.mediaType ?? "image");
|
|
529
|
-
return
|
|
538
|
+
return K(e, a === "video" ? "video" : a === "audio" ? "audio" : "image", n);
|
|
530
539
|
}
|
|
531
540
|
case "Image":
|
|
532
|
-
return
|
|
541
|
+
return K(e, "image", n);
|
|
533
542
|
case "Video":
|
|
534
|
-
return
|
|
543
|
+
return K(e, "video", n);
|
|
535
544
|
case "AudioPlayer":
|
|
536
|
-
return
|
|
545
|
+
return K(e, "audio", n);
|
|
537
546
|
case "FileUpload": {
|
|
538
|
-
const a =
|
|
547
|
+
const a = S(e.accept) ?? "", l = { ...i("file"), name: o };
|
|
539
548
|
return a && (l.fileAcceptExtensions = a.split(",").map((c) => c.trim()).filter(Boolean)), Array.isArray(e.fileAcceptTypes) && (l.fileAcceptTypes = e.fileAcceptTypes.map(String)), typeof e.filePlaceholderIcon == "string" && (l.filePlaceholderIcon = e.filePlaceholderIcon), typeof e.minCount == "number" && (l.fileMinCount = e.minCount), typeof e.maxCount == "number" && (l.fileMaxCount = e.maxCount), l;
|
|
540
549
|
}
|
|
541
550
|
default:
|
|
542
551
|
return null;
|
|
543
552
|
}
|
|
544
553
|
}
|
|
545
|
-
function
|
|
546
|
-
if (
|
|
547
|
-
|
|
554
|
+
function Le(e, t, r, n) {
|
|
555
|
+
if (r.has(e)) return;
|
|
556
|
+
r.add(e);
|
|
548
557
|
const o = t.get(e);
|
|
549
558
|
if (!o) return;
|
|
550
559
|
const i = String(o.component ?? "");
|
|
551
560
|
if ((i === "Column" || i === "Row") && Array.isArray(o.children)) {
|
|
552
561
|
for (const a of o.children)
|
|
553
|
-
typeof a == "string" &&
|
|
562
|
+
typeof a == "string" && Le(a, t, r, n);
|
|
554
563
|
return;
|
|
555
564
|
}
|
|
556
|
-
|
|
565
|
+
n.push(o);
|
|
557
566
|
}
|
|
558
|
-
function
|
|
567
|
+
function Xt(e) {
|
|
559
568
|
if (!e || !Array.isArray(e.components))
|
|
560
|
-
return
|
|
561
|
-
const t =
|
|
562
|
-
|
|
563
|
-
let
|
|
569
|
+
return ee({ title: "", description: "", blocks: [], jsonSchema: {} });
|
|
570
|
+
const t = Jt(e), r = [];
|
|
571
|
+
Le(e.root ?? te, t, /* @__PURE__ */ new Set(), r);
|
|
572
|
+
let n = "", o = "";
|
|
564
573
|
const i = [];
|
|
565
|
-
for (const a of
|
|
566
|
-
if (a.id ===
|
|
567
|
-
|
|
574
|
+
for (const a of r) {
|
|
575
|
+
if (a.id === me) {
|
|
576
|
+
n = S(a.text) ?? n;
|
|
568
577
|
continue;
|
|
569
578
|
}
|
|
570
|
-
if (a.id ===
|
|
571
|
-
o =
|
|
579
|
+
if (a.id === fe) {
|
|
580
|
+
o = S(a.text) ?? o;
|
|
572
581
|
continue;
|
|
573
582
|
}
|
|
574
|
-
const l =
|
|
583
|
+
const l = Gt(a);
|
|
575
584
|
l && i.push(l);
|
|
576
585
|
}
|
|
577
|
-
return
|
|
586
|
+
return ee({ title: n, description: o, blocks: i, jsonSchema: {} });
|
|
578
587
|
}
|
|
579
|
-
function
|
|
580
|
-
const { surfaceId:
|
|
581
|
-
{ version: "v0.9", createSurface: { surfaceId:
|
|
588
|
+
function qt(e, t) {
|
|
589
|
+
const { surfaceId: r, catalogId: n } = t, o = [
|
|
590
|
+
{ version: "v0.9", createSurface: { surfaceId: r, catalogId: n } },
|
|
582
591
|
{
|
|
583
592
|
version: "v0.9",
|
|
584
|
-
updateComponents: { surfaceId:
|
|
593
|
+
updateComponents: { surfaceId: r, components: e.components }
|
|
585
594
|
}
|
|
586
595
|
];
|
|
587
596
|
return e.dataModel && Object.keys(e.dataModel).length > 0 && o.push({
|
|
588
597
|
version: "v0.9",
|
|
589
|
-
updateDataModel: { surfaceId:
|
|
598
|
+
updateDataModel: { surfaceId: r, path: "/", value: e.dataModel }
|
|
590
599
|
}), o;
|
|
591
600
|
}
|
|
592
|
-
function
|
|
601
|
+
function ze(e) {
|
|
593
602
|
return !!e && typeof e == "object" && !Array.isArray(e) && Array.isArray(e.components);
|
|
594
603
|
}
|
|
595
|
-
function
|
|
604
|
+
function Kt(e, t) {
|
|
596
605
|
if (!e || typeof e != "object") return null;
|
|
597
|
-
const
|
|
598
|
-
if (
|
|
599
|
-
const o = Array.isArray(
|
|
606
|
+
const r = e, n = ze(r.a2ui) ? r.a2ui : void 0;
|
|
607
|
+
if (n && !he(n)) return n;
|
|
608
|
+
const o = Array.isArray(r.blocks) ? r.blocks : [];
|
|
600
609
|
if (o.length === 0) return null;
|
|
601
|
-
const i =
|
|
602
|
-
title: typeof
|
|
603
|
-
description: typeof
|
|
610
|
+
const i = B({
|
|
611
|
+
title: typeof r.title == "string" ? r.title : "",
|
|
612
|
+
description: typeof r.description == "string" ? r.description : "",
|
|
604
613
|
blocks: o
|
|
605
|
-
}), a =
|
|
606
|
-
return
|
|
614
|
+
}), a = je(i, t);
|
|
615
|
+
return he(a) ? null : a;
|
|
607
616
|
}
|
|
608
|
-
function
|
|
609
|
-
return
|
|
617
|
+
function Wt(e, t, r) {
|
|
618
|
+
return je(
|
|
610
619
|
{
|
|
611
620
|
title: e.title,
|
|
612
621
|
description: e.description,
|
|
613
622
|
blocks: t
|
|
614
623
|
},
|
|
615
|
-
|
|
624
|
+
r
|
|
616
625
|
);
|
|
617
626
|
}
|
|
618
|
-
function
|
|
627
|
+
function Zt(e) {
|
|
619
628
|
if (!e || typeof e != "object" || Array.isArray(e))
|
|
620
629
|
return;
|
|
621
630
|
const t = e;
|
|
622
|
-
return !(Array.isArray(t.blocks) && t.blocks.length > 0) &&
|
|
631
|
+
return !(Array.isArray(t.blocks) && t.blocks.length > 0) && ze(t.a2ui) ? Xt(t.a2ui) : B({
|
|
623
632
|
title: typeof t.title == "string" ? t.title : "",
|
|
624
633
|
description: typeof t.description == "string" ? t.description : "",
|
|
625
634
|
blocks: Array.isArray(t.blocks) ? t.blocks : []
|
|
626
635
|
});
|
|
627
636
|
}
|
|
628
|
-
function
|
|
629
|
-
const
|
|
630
|
-
if (!
|
|
637
|
+
function Qt(e, t, r) {
|
|
638
|
+
const n = e.model.surfacesMap.get(t);
|
|
639
|
+
if (!n) return {};
|
|
631
640
|
const o = {};
|
|
632
|
-
for (const i of
|
|
641
|
+
for (const i of r) {
|
|
633
642
|
const a = i.trim();
|
|
634
|
-
a && (o[a] =
|
|
643
|
+
a && (o[a] = n.dataModel.get(`/${a}`));
|
|
635
644
|
}
|
|
636
645
|
return o;
|
|
637
646
|
}
|
|
638
|
-
function
|
|
647
|
+
function Ue(e) {
|
|
639
648
|
return e.replace(/'/g, "'\\''");
|
|
640
649
|
}
|
|
641
|
-
function
|
|
642
|
-
const
|
|
650
|
+
function er(e, t) {
|
|
651
|
+
const r = (t ?? "").trim() || "<callback_url>", n = JSON.stringify(e ?? {}, null, 2);
|
|
652
|
+
return [
|
|
653
|
+
`curl -X POST '${r}' \\`,
|
|
654
|
+
" -H 'Content-Type: application/json' \\",
|
|
655
|
+
` -d '${Ue(n)}'`
|
|
656
|
+
].join(`
|
|
657
|
+
`);
|
|
658
|
+
}
|
|
659
|
+
function Me(e, t, r) {
|
|
660
|
+
return ` ${JSON.stringify(e)}: ${JSON.stringify(t)}${r ? "," : ""}`;
|
|
661
|
+
}
|
|
662
|
+
function tr(e, t) {
|
|
663
|
+
const r = ["{"], n = Object.entries(e), o = Object.entries(t);
|
|
664
|
+
return n.forEach(([i, a], l) => {
|
|
665
|
+
const c = l < n.length - 1 || o.length > 0;
|
|
666
|
+
r.push(Me(i, a, c));
|
|
667
|
+
}), o.length > 0 && (r.push(" // 额外字段(未在卡片展示)"), o.forEach(([i, a], l) => {
|
|
668
|
+
r.push(Me(i, a, l < o.length - 1));
|
|
669
|
+
})), r.push("}"), r.join(`
|
|
670
|
+
`);
|
|
671
|
+
}
|
|
672
|
+
function rr({
|
|
673
|
+
cardValues: e,
|
|
674
|
+
extraValues: t = {},
|
|
675
|
+
callbackUrl: r
|
|
676
|
+
}) {
|
|
677
|
+
const n = (r ?? "").trim() || "<callback_url>", o = tr(e, t);
|
|
643
678
|
return [
|
|
644
679
|
`curl -X POST '${n}' \\`,
|
|
645
680
|
" -H 'Content-Type: application/json' \\",
|
|
646
|
-
` -d '${
|
|
681
|
+
` -d '${Ue(o)}'`
|
|
647
682
|
].join(`
|
|
648
683
|
`);
|
|
649
684
|
}
|
|
650
|
-
function
|
|
651
|
-
return
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
685
|
+
function nr(e) {
|
|
686
|
+
return B({
|
|
687
|
+
title: "",
|
|
688
|
+
description: "",
|
|
689
|
+
blocks: [e]
|
|
690
|
+
}).blocks[0];
|
|
691
|
+
}
|
|
692
|
+
function or(e, t) {
|
|
693
|
+
var o, i;
|
|
694
|
+
const r = /* @__PURE__ */ new Map();
|
|
695
|
+
for (const a of t) {
|
|
696
|
+
const l = (o = a.name) == null ? void 0 : o.trim();
|
|
697
|
+
l && r.set(l, a);
|
|
698
|
+
}
|
|
699
|
+
const n = [];
|
|
700
|
+
for (const a of e.blocks) {
|
|
701
|
+
if (ve(a.type)) {
|
|
702
|
+
n.push(nr(a));
|
|
703
|
+
continue;
|
|
663
704
|
}
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
705
|
+
if (!F(a.type)) continue;
|
|
706
|
+
const l = (i = a.name) == null ? void 0 : i.trim();
|
|
707
|
+
if (!l) continue;
|
|
708
|
+
const c = r.get(l);
|
|
709
|
+
c && n.push(c);
|
|
710
|
+
}
|
|
711
|
+
return n;
|
|
712
|
+
}
|
|
713
|
+
function ar(e, t) {
|
|
714
|
+
var n;
|
|
715
|
+
const r = {
|
|
716
|
+
...e,
|
|
717
|
+
name: ((n = e.name) == null ? void 0 : n.trim()) || t.name
|
|
718
|
+
};
|
|
719
|
+
return t.defaultValue !== void 0 && (r.defaultValue = t.defaultValue), B({
|
|
720
|
+
title: "",
|
|
721
|
+
description: "",
|
|
722
|
+
blocks: [r]
|
|
723
|
+
}).blocks[0];
|
|
724
|
+
}
|
|
725
|
+
function ir(e) {
|
|
726
|
+
if (!e || typeof e != "object" || Array.isArray(e)) return null;
|
|
727
|
+
const t = e;
|
|
728
|
+
return Array.isArray(t.blocks) ? B({
|
|
729
|
+
title: typeof t.title == "string" ? t.title : "",
|
|
730
|
+
description: typeof t.description == "string" ? t.description : "",
|
|
731
|
+
blocks: t.blocks
|
|
732
|
+
}) : null;
|
|
733
|
+
}
|
|
734
|
+
function lr(e, t) {
|
|
735
|
+
var i, a, l, c, u, f;
|
|
736
|
+
const r = /* @__PURE__ */ new Map();
|
|
737
|
+
for (const d of (t == null ? void 0 : t.blocks) ?? [])
|
|
738
|
+
F(d.type) && ((i = d.name) != null && i.trim()) && r.set(d.name.trim(), d);
|
|
739
|
+
const n = [], o = [];
|
|
740
|
+
for (const d of e.blocks) {
|
|
741
|
+
if (!F(d.type)) continue;
|
|
742
|
+
const p = (a = d.name) == null ? void 0 : a.trim();
|
|
743
|
+
if (!p) continue;
|
|
744
|
+
const y = r.get(p);
|
|
745
|
+
y ? n.push(ar(y, d)) : o.push(
|
|
746
|
+
B({
|
|
747
|
+
title: "",
|
|
748
|
+
description: "",
|
|
749
|
+
blocks: [d]
|
|
750
|
+
}).blocks[0]
|
|
751
|
+
);
|
|
752
|
+
}
|
|
753
|
+
return {
|
|
754
|
+
matchedBlocks: n,
|
|
755
|
+
extraBlocks: o,
|
|
756
|
+
renderBlocks: or(e, n),
|
|
757
|
+
title: ((l = e.title) == null ? void 0 : l.trim()) || ((c = t == null ? void 0 : t.title) == null ? void 0 : c.trim()) || "",
|
|
758
|
+
description: ((u = e.description) == null ? void 0 : u.trim()) || ((f = t == null ? void 0 : t.description) == null ? void 0 : f.trim()) || ""
|
|
759
|
+
};
|
|
760
|
+
}
|
|
761
|
+
function cr(e) {
|
|
762
|
+
const { type: t, defaultValue: r } = e;
|
|
763
|
+
return r !== void 0 ? t === "toggle" ? r === !0 || r === "true" : t === "multiselect" || t === "checkbox" ? Array.isArray(r) ? r.map(String) : typeof r == "string" && r ? [r] : [] : r : t === "toggle" ? !1 : t === "multiselect" || t === "checkbox" ? [] : t === "number" ? null : "";
|
|
764
|
+
}
|
|
765
|
+
function sr(e) {
|
|
766
|
+
var r;
|
|
767
|
+
const t = {};
|
|
768
|
+
for (const n of e) {
|
|
769
|
+
if (!F(n.type)) continue;
|
|
770
|
+
const o = (r = n.name) == null ? void 0 : r.trim();
|
|
771
|
+
o && (t[o] = cr(n));
|
|
772
|
+
}
|
|
773
|
+
return t;
|
|
774
|
+
}
|
|
775
|
+
function ur(e) {
|
|
776
|
+
return e.blocks.some(
|
|
777
|
+
(t) => {
|
|
778
|
+
var r;
|
|
779
|
+
return F(t.type) && !!((r = t.name) != null && r.trim());
|
|
780
|
+
}
|
|
781
|
+
);
|
|
782
|
+
}
|
|
783
|
+
function pr(e) {
|
|
784
|
+
return e.blocks.filter((t) => {
|
|
785
|
+
var r;
|
|
786
|
+
return ve(t.type) ? !0 : F(t.type) && !!((r = t.name) != null && r.trim());
|
|
787
|
+
});
|
|
788
|
+
}
|
|
789
|
+
function dr(e) {
|
|
790
|
+
return e.blocks.filter((t) => {
|
|
791
|
+
var r;
|
|
792
|
+
return F(t.type) && ((r = t.name) == null ? void 0 : r.trim());
|
|
793
|
+
}).map((t) => t.name.trim());
|
|
794
|
+
}
|
|
795
|
+
async function mr(e, t, r) {
|
|
796
|
+
const n = e.trim();
|
|
797
|
+
if (!n)
|
|
672
798
|
throw new Error("callback_url 为空");
|
|
673
|
-
const i = await ((
|
|
799
|
+
const i = await ((r == null ? void 0 : r.fetch) ?? fetch)(n, {
|
|
674
800
|
method: "POST",
|
|
675
801
|
headers: {
|
|
676
802
|
"Content-Type": "application/json",
|
|
677
|
-
...(
|
|
803
|
+
...(r == null ? void 0 : r.headers) ?? {}
|
|
678
804
|
},
|
|
679
805
|
body: JSON.stringify(t ?? {})
|
|
680
806
|
});
|
|
@@ -693,19 +819,39 @@ async function Vt(e, t, n) {
|
|
|
693
819
|
}
|
|
694
820
|
return { ok: i.ok, status: i.status, body: a };
|
|
695
821
|
}
|
|
696
|
-
async function
|
|
697
|
-
|
|
822
|
+
async function $e(e) {
|
|
823
|
+
var r;
|
|
824
|
+
if (typeof navigator < "u" && ((r = navigator.clipboard) != null && r.writeText)) {
|
|
825
|
+
await navigator.clipboard.writeText(e);
|
|
826
|
+
return;
|
|
827
|
+
}
|
|
828
|
+
if (typeof document > "u")
|
|
829
|
+
throw new Error("clipboard unavailable");
|
|
830
|
+
const t = document.createElement("textarea");
|
|
831
|
+
t.value = e, t.setAttribute("readonly", ""), t.style.position = "fixed", t.style.left = "-9999px", document.body.appendChild(t), t.select();
|
|
832
|
+
try {
|
|
833
|
+
if (!document.execCommand("copy")) throw new Error("execCommand copy failed");
|
|
834
|
+
} finally {
|
|
835
|
+
document.body.removeChild(t);
|
|
836
|
+
}
|
|
698
837
|
}
|
|
699
|
-
async function
|
|
700
|
-
|
|
838
|
+
async function fr(e) {
|
|
839
|
+
let t;
|
|
840
|
+
try {
|
|
841
|
+
t = await e.json();
|
|
842
|
+
} catch {
|
|
843
|
+
throw new Error(`响应非 JSON (${e.status})`);
|
|
844
|
+
}
|
|
701
845
|
if (!e.ok || t.success === !1)
|
|
702
846
|
throw new Error(t.message || `请求失败 (${e.status})`);
|
|
847
|
+
if (t.data === void 0 || t.data === null)
|
|
848
|
+
throw new Error(t.message || `响应缺少 data (${e.status})`);
|
|
703
849
|
return t.data;
|
|
704
850
|
}
|
|
705
|
-
function
|
|
706
|
-
const t = (e.baseUrl ?? "/api/v1").replace(/\/$/, ""),
|
|
851
|
+
function tn(e = {}) {
|
|
852
|
+
const t = (e.baseUrl ?? "/api/v1").replace(/\/$/, ""), r = e.detailPath ?? "/dev/form/detail", n = e.fetch ?? fetch;
|
|
707
853
|
async function o(i) {
|
|
708
|
-
var
|
|
854
|
+
var d;
|
|
709
855
|
const a = new URLSearchParams();
|
|
710
856
|
if (i.formId !== void 0)
|
|
711
857
|
a.set("form_id", String(i.formId));
|
|
@@ -713,84 +859,89 @@ function In(e = {}) {
|
|
|
713
859
|
a.set("form_unique_id", i.formUniqueId);
|
|
714
860
|
else
|
|
715
861
|
throw new Error("form_id 或 form_unique_id 至少传一个");
|
|
716
|
-
const l = await ((
|
|
862
|
+
const l = await ((d = e.getHeaders) == null ? void 0 : d.call(e)) ?? {}, c = await n(`${t}${r}?${a.toString()}`, {
|
|
717
863
|
method: "GET",
|
|
718
864
|
headers: l
|
|
719
|
-
}),
|
|
865
|
+
}), u = await fr(c), f = Zt(u.form_definition);
|
|
720
866
|
return {
|
|
721
|
-
formUniqueId:
|
|
722
|
-
formId:
|
|
723
|
-
disabled:
|
|
724
|
-
formDefinition:
|
|
725
|
-
a2ui:
|
|
867
|
+
formUniqueId: u.form_unique_id,
|
|
868
|
+
formId: u.form_id,
|
|
869
|
+
disabled: u.disabled === 1,
|
|
870
|
+
formDefinition: f,
|
|
871
|
+
a2ui: Kt(u.form_definition) ?? void 0
|
|
726
872
|
};
|
|
727
873
|
}
|
|
728
874
|
return { fetchDetail: o };
|
|
729
875
|
}
|
|
730
|
-
const
|
|
731
|
-
video:
|
|
732
|
-
audio:
|
|
733
|
-
image:
|
|
734
|
-
file:
|
|
735
|
-
spreadsheet:
|
|
736
|
-
document:
|
|
876
|
+
const hr = {
|
|
877
|
+
video: ft,
|
|
878
|
+
audio: mt,
|
|
879
|
+
image: dt,
|
|
880
|
+
file: Oe,
|
|
881
|
+
spreadsheet: pt,
|
|
882
|
+
document: ut
|
|
737
883
|
};
|
|
738
|
-
function
|
|
884
|
+
function vr({
|
|
739
885
|
type: e,
|
|
740
886
|
size: t = 40,
|
|
741
|
-
className:
|
|
887
|
+
className: r
|
|
742
888
|
}) {
|
|
743
|
-
const
|
|
744
|
-
return /* @__PURE__ */
|
|
745
|
-
|
|
889
|
+
const n = hr[e] ?? Oe;
|
|
890
|
+
return /* @__PURE__ */ s(
|
|
891
|
+
n,
|
|
746
892
|
{
|
|
747
|
-
className:
|
|
893
|
+
className: r ?? "skopon-form-file-placeholder-icon",
|
|
748
894
|
style: { fontSize: t, color: "var(--color-primary, #1677ff)" },
|
|
749
895
|
"aria-hidden": !0
|
|
750
896
|
}
|
|
751
897
|
);
|
|
752
898
|
}
|
|
753
|
-
const
|
|
754
|
-
function
|
|
899
|
+
const Re = We({ interactive: !0 });
|
|
900
|
+
function De({
|
|
755
901
|
interactive: e,
|
|
756
902
|
children: t
|
|
757
903
|
}) {
|
|
758
|
-
return /* @__PURE__ */
|
|
904
|
+
return /* @__PURE__ */ s(Re.Provider, { value: { interactive: e }, children: t });
|
|
759
905
|
}
|
|
760
|
-
function
|
|
761
|
-
return
|
|
906
|
+
function j() {
|
|
907
|
+
return Ze(Re);
|
|
762
908
|
}
|
|
763
|
-
function
|
|
909
|
+
function He(e) {
|
|
764
910
|
return e && typeof e == "object" && "path" in e && String(e.path ?? "").trim() || null;
|
|
765
911
|
}
|
|
766
|
-
function
|
|
767
|
-
const
|
|
768
|
-
|
|
769
|
-
|
|
912
|
+
function Ee(e, t = "value") {
|
|
913
|
+
const n = e.componentModel.properties[t];
|
|
914
|
+
if (!(!He(n) || n === void 0))
|
|
915
|
+
return e.dataContext.resolveDynamicValue(n);
|
|
916
|
+
}
|
|
917
|
+
function L(e, t = "value") {
|
|
918
|
+
const n = e.componentModel.properties[t], o = He(n), i = ie(
|
|
919
|
+
(u) => {
|
|
920
|
+
if (!o || n === void 0) return () => {
|
|
770
921
|
};
|
|
771
|
-
const
|
|
772
|
-
return () =>
|
|
922
|
+
const f = e.dataContext.subscribeDynamicValue(n, () => u());
|
|
923
|
+
return () => f.unsubscribe();
|
|
773
924
|
},
|
|
774
|
-
[e,
|
|
775
|
-
), a =
|
|
776
|
-
if (!(!o ||
|
|
777
|
-
return e.dataContext.resolveDynamicValue(
|
|
778
|
-
}, [e,
|
|
779
|
-
(
|
|
780
|
-
!o || !
|
|
925
|
+
[e, n, o]
|
|
926
|
+
), a = ie(() => {
|
|
927
|
+
if (!(!o || n === void 0))
|
|
928
|
+
return e.dataContext.resolveDynamicValue(n);
|
|
929
|
+
}, [e, n, o]), l = Qe(i, a, a), c = ie(
|
|
930
|
+
(u) => {
|
|
931
|
+
!o || !n || typeof n != "object" || !("path" in n) || e.dataContext.set(String(n.path), u);
|
|
781
932
|
},
|
|
782
|
-
[e,
|
|
933
|
+
[e, n, o]
|
|
783
934
|
);
|
|
784
935
|
return { value: l, setValue: c, hasBinding: !!o };
|
|
785
936
|
}
|
|
786
|
-
function
|
|
937
|
+
function D(e) {
|
|
787
938
|
if (typeof e == "string") return e || void 0;
|
|
788
939
|
if (typeof e == "number") return String(e);
|
|
789
940
|
}
|
|
790
|
-
function
|
|
941
|
+
function V(e) {
|
|
791
942
|
return Array.isArray(e) ? e.map(String) : typeof e == "string" && e ? [e] : [];
|
|
792
943
|
}
|
|
793
|
-
const
|
|
944
|
+
const Ye = "skopon-form-v0_9", yr = /* @__PURE__ */ new Set([
|
|
794
945
|
"SkoponMedia",
|
|
795
946
|
"SkoponSelect",
|
|
796
947
|
"Image",
|
|
@@ -802,110 +953,110 @@ const Ce = "skopon-form-v0_9", $t = /* @__PURE__ */ new Set([
|
|
|
802
953
|
"FileUpload",
|
|
803
954
|
"TextField",
|
|
804
955
|
"Text"
|
|
805
|
-
]),
|
|
806
|
-
function
|
|
807
|
-
const t = [...
|
|
956
|
+
]), gr = /* @__PURE__ */ new Set(["h1", "h2", "h3", "h4", "h5", "caption"]);
|
|
957
|
+
function G(e) {
|
|
958
|
+
const t = [...Z.components.values()].find((r) => r.name === e);
|
|
808
959
|
if (!t) throw new Error(`Missing basic catalog component: ${e}`);
|
|
809
960
|
return t.schema;
|
|
810
961
|
}
|
|
811
|
-
function
|
|
962
|
+
function g(e) {
|
|
812
963
|
return typeof e == "string" ? e : "";
|
|
813
964
|
}
|
|
814
|
-
function
|
|
965
|
+
function Je(e) {
|
|
815
966
|
return Array.isArray(e) ? e.map((t) => {
|
|
816
967
|
if (!t || typeof t != "object") return null;
|
|
817
|
-
const
|
|
818
|
-
return { value:
|
|
968
|
+
const r = t, n = String(r.value ?? r.label ?? ""), o = String(r.label ?? r.value ?? "");
|
|
969
|
+
return { value: n, label: o };
|
|
819
970
|
}).filter((t) => !!t) : [];
|
|
820
971
|
}
|
|
821
|
-
function
|
|
972
|
+
function re({
|
|
822
973
|
mediaType: e,
|
|
823
974
|
urls: t,
|
|
824
|
-
mediaSize:
|
|
825
|
-
label:
|
|
975
|
+
mediaSize: r,
|
|
976
|
+
label: n,
|
|
826
977
|
help: o,
|
|
827
978
|
placeholder: i
|
|
828
979
|
}) {
|
|
829
|
-
const a =
|
|
830
|
-
return /* @__PURE__ */
|
|
831
|
-
a ? /* @__PURE__ */
|
|
832
|
-
t.length === 0 ? /* @__PURE__ */
|
|
980
|
+
const a = n == null ? void 0 : n.trim(), l = o == null ? void 0 : o.trim(), c = Bt(r), u = (i == null ? void 0 : i.trim()) || (e === "image" ? "未设置图片 URL" : e === "video" ? "未设置视频 URL" : "未设置音频 URL");
|
|
981
|
+
return /* @__PURE__ */ M("div", { className: "form-block-preview", children: [
|
|
982
|
+
a ? /* @__PURE__ */ s("div", { className: "form-block-preview-label", children: a }) : null,
|
|
983
|
+
t.length === 0 ? /* @__PURE__ */ s("div", { className: "form-media-preview form-media-preview--empty", children: u }) : /* @__PURE__ */ s("div", { className: c, children: t.map((f, d) => e === "image" ? /* @__PURE__ */ s(
|
|
833
984
|
"img",
|
|
834
985
|
{
|
|
835
|
-
src:
|
|
986
|
+
src: f,
|
|
836
987
|
alt: a || "图片",
|
|
837
988
|
className: "form-media-item"
|
|
838
989
|
},
|
|
839
|
-
`media-${
|
|
840
|
-
) : e === "video" ? /* @__PURE__ */
|
|
990
|
+
`media-${d}`
|
|
991
|
+
) : e === "video" ? /* @__PURE__ */ s(
|
|
841
992
|
"video",
|
|
842
993
|
{
|
|
843
|
-
src:
|
|
994
|
+
src: f,
|
|
844
995
|
controls: !0,
|
|
845
996
|
className: "form-media-item"
|
|
846
997
|
},
|
|
847
|
-
`media-${
|
|
848
|
-
) : /* @__PURE__ */
|
|
998
|
+
`media-${d}`
|
|
999
|
+
) : /* @__PURE__ */ s(
|
|
849
1000
|
"audio",
|
|
850
1001
|
{
|
|
851
|
-
src:
|
|
1002
|
+
src: f,
|
|
852
1003
|
controls: !0,
|
|
853
1004
|
className: "form-media-item form-media-item--audio"
|
|
854
1005
|
},
|
|
855
|
-
`media-${
|
|
1006
|
+
`media-${d}`
|
|
856
1007
|
)) }),
|
|
857
|
-
l ? /* @__PURE__ */
|
|
1008
|
+
l ? /* @__PURE__ */ s(R.Text, { type: "secondary", className: "form-block-preview-help", children: l }) : null
|
|
858
1009
|
] });
|
|
859
1010
|
}
|
|
860
|
-
function
|
|
861
|
-
const
|
|
1011
|
+
function ne(e, t) {
|
|
1012
|
+
const r = Array.isArray(e.urls) ? e.urls.map((n) => String(n).trim()).filter(Boolean) : g(e.url).trim() ? [g(e.url).trim()] : [];
|
|
862
1013
|
return {
|
|
863
1014
|
mediaType: t,
|
|
864
|
-
urls:
|
|
865
|
-
mediaSize:
|
|
866
|
-
label:
|
|
867
|
-
help:
|
|
868
|
-
placeholder:
|
|
1015
|
+
urls: r,
|
|
1016
|
+
mediaSize: J(e.mediaSize),
|
|
1017
|
+
label: g(e.label) || g(e.description),
|
|
1018
|
+
help: g(e.help),
|
|
1019
|
+
placeholder: g(e.placeholder)
|
|
869
1020
|
};
|
|
870
1021
|
}
|
|
871
|
-
const
|
|
1022
|
+
const br = {
|
|
872
1023
|
name: "SkoponMedia",
|
|
873
|
-
schema:
|
|
874
|
-
mediaType:
|
|
875
|
-
urls:
|
|
876
|
-
mediaSize:
|
|
877
|
-
label:
|
|
878
|
-
help:
|
|
879
|
-
placeholder:
|
|
1024
|
+
schema: m.object({
|
|
1025
|
+
mediaType: m.any().optional(),
|
|
1026
|
+
urls: m.any().optional(),
|
|
1027
|
+
mediaSize: m.any().optional(),
|
|
1028
|
+
label: m.any().optional(),
|
|
1029
|
+
help: m.any().optional(),
|
|
1030
|
+
placeholder: m.any().optional()
|
|
880
1031
|
}).passthrough()
|
|
881
|
-
},
|
|
882
|
-
const t = e.componentModel.properties,
|
|
883
|
-
return /* @__PURE__ */
|
|
884
|
-
}),
|
|
885
|
-
{ name: "Image", schema:
|
|
886
|
-
({ context: e }) => /* @__PURE__ */
|
|
887
|
-
),
|
|
888
|
-
{ name: "Video", schema:
|
|
889
|
-
({ context: e }) => /* @__PURE__ */
|
|
890
|
-
),
|
|
891
|
-
{ name: "AudioPlayer", schema:
|
|
892
|
-
({ context: e }) => /* @__PURE__ */
|
|
893
|
-
),
|
|
1032
|
+
}, xr = E(br, ({ context: e }) => {
|
|
1033
|
+
const t = e.componentModel.properties, r = g(t.mediaType);
|
|
1034
|
+
return /* @__PURE__ */ s(re, { ...ne(t, r === "video" ? "video" : r === "audio" ? "audio" : "image") });
|
|
1035
|
+
}), Sr = E(
|
|
1036
|
+
{ name: "Image", schema: G("Image") },
|
|
1037
|
+
({ context: e }) => /* @__PURE__ */ s(re, { ...ne(e.componentModel.properties, "image") })
|
|
1038
|
+
), kr = E(
|
|
1039
|
+
{ name: "Video", schema: G("Video") },
|
|
1040
|
+
({ context: e }) => /* @__PURE__ */ s(re, { ...ne(e.componentModel.properties, "video") })
|
|
1041
|
+
), Ar = E(
|
|
1042
|
+
{ name: "AudioPlayer", schema: G("AudioPlayer") },
|
|
1043
|
+
({ context: e }) => /* @__PURE__ */ s(re, { ...ne(e.componentModel.properties, "audio") })
|
|
1044
|
+
), Tr = {
|
|
894
1045
|
name: "SkoponSelect",
|
|
895
|
-
schema:
|
|
896
|
-
label:
|
|
897
|
-
mode:
|
|
898
|
-
placeholder:
|
|
899
|
-
options:
|
|
900
|
-
value:
|
|
1046
|
+
schema: m.object({
|
|
1047
|
+
label: m.any().optional(),
|
|
1048
|
+
mode: m.any().optional(),
|
|
1049
|
+
placeholder: m.any().optional(),
|
|
1050
|
+
options: m.any().optional(),
|
|
1051
|
+
value: m.any().optional()
|
|
901
1052
|
}).passthrough()
|
|
902
1053
|
};
|
|
903
|
-
function
|
|
904
|
-
const { interactive: t } =
|
|
905
|
-
return /* @__PURE__ */
|
|
906
|
-
i ? /* @__PURE__ */
|
|
907
|
-
/* @__PURE__ */
|
|
908
|
-
|
|
1054
|
+
function Cr({ context: e }) {
|
|
1055
|
+
const { interactive: t } = j(), { value: r, setValue: n } = L(e), o = e.componentModel.properties, i = g(o.label), a = g(o.placeholder), l = Je(o.options), c = g(o.mode) === "multiple";
|
|
1056
|
+
return /* @__PURE__ */ M("div", { className: "form-block-preview", children: [
|
|
1057
|
+
i ? /* @__PURE__ */ s("div", { className: "form-block-preview-label", children: i }) : null,
|
|
1058
|
+
/* @__PURE__ */ s(
|
|
1059
|
+
ue,
|
|
909
1060
|
{
|
|
910
1061
|
mode: c ? "multiple" : void 0,
|
|
911
1062
|
disabled: !t,
|
|
@@ -914,34 +1065,34 @@ function Wt({ context: e }) {
|
|
|
914
1065
|
style: { width: "100%" },
|
|
915
1066
|
placeholder: a || (c ? "请选择多项" : "请选择"),
|
|
916
1067
|
options: l,
|
|
917
|
-
value: c ?
|
|
918
|
-
onChange: (
|
|
1068
|
+
value: c ? V(r) : D(r),
|
|
1069
|
+
onChange: (u) => n(c ? u ?? [] : u ?? "")
|
|
919
1070
|
}
|
|
920
1071
|
)
|
|
921
1072
|
] });
|
|
922
1073
|
}
|
|
923
|
-
const
|
|
924
|
-
|
|
925
|
-
|
|
1074
|
+
const Mr = E(
|
|
1075
|
+
Tr,
|
|
1076
|
+
Cr
|
|
926
1077
|
);
|
|
927
|
-
function
|
|
928
|
-
const { interactive: t } =
|
|
929
|
-
return /* @__PURE__ */
|
|
930
|
-
i ? /* @__PURE__ */
|
|
931
|
-
|
|
932
|
-
|
|
1078
|
+
function Er({ context: e }) {
|
|
1079
|
+
const { interactive: t } = j(), { value: r, setValue: n } = L(e), o = e.componentModel.properties, i = g(o.label), a = g(o.variant) || "mutuallyExclusive", l = g(o.skoponPickerType), c = g(o.placeholder), u = Je(o.options), d = l === "select" || l === "multiselect" || l === "radio" || l === "checkbox" ? l : a === "multipleSelection" ? "checkbox" : "radio";
|
|
1080
|
+
return /* @__PURE__ */ M("div", { className: "form-block-preview", children: [
|
|
1081
|
+
i ? /* @__PURE__ */ s("div", { className: "form-block-preview-label", children: i }) : null,
|
|
1082
|
+
d === "select" ? /* @__PURE__ */ s(
|
|
1083
|
+
ue,
|
|
933
1084
|
{
|
|
934
1085
|
disabled: !t,
|
|
935
1086
|
allowClear: !0,
|
|
936
1087
|
className: "form-block-preview-control",
|
|
937
1088
|
style: { width: "100%" },
|
|
938
1089
|
placeholder: c || "请选择",
|
|
939
|
-
options:
|
|
940
|
-
value:
|
|
941
|
-
onChange: (
|
|
1090
|
+
options: u,
|
|
1091
|
+
value: D(r),
|
|
1092
|
+
onChange: (p) => n(p ?? "")
|
|
942
1093
|
}
|
|
943
|
-
) :
|
|
944
|
-
|
|
1094
|
+
) : d === "multiselect" ? /* @__PURE__ */ s(
|
|
1095
|
+
ue,
|
|
945
1096
|
{
|
|
946
1097
|
mode: "multiple",
|
|
947
1098
|
disabled: !t,
|
|
@@ -949,480 +1100,564 @@ function Qt({ context: e }) {
|
|
|
949
1100
|
className: "form-block-preview-control",
|
|
950
1101
|
style: { width: "100%" },
|
|
951
1102
|
placeholder: c || "请选择多项",
|
|
952
|
-
options:
|
|
953
|
-
value:
|
|
954
|
-
onChange: (
|
|
1103
|
+
options: u,
|
|
1104
|
+
value: V(r),
|
|
1105
|
+
onChange: (p) => n(p ?? [])
|
|
955
1106
|
}
|
|
956
|
-
) :
|
|
957
|
-
|
|
1107
|
+
) : d === "checkbox" ? /* @__PURE__ */ s(
|
|
1108
|
+
nt.Group,
|
|
958
1109
|
{
|
|
959
1110
|
disabled: !t,
|
|
960
1111
|
className: "form-block-preview-control",
|
|
961
|
-
options:
|
|
962
|
-
value:
|
|
963
|
-
onChange: (
|
|
1112
|
+
options: u,
|
|
1113
|
+
value: V(r),
|
|
1114
|
+
onChange: (p) => n(p)
|
|
964
1115
|
}
|
|
965
|
-
) : /* @__PURE__ */
|
|
966
|
-
|
|
1116
|
+
) : /* @__PURE__ */ s(
|
|
1117
|
+
ot.Group,
|
|
967
1118
|
{
|
|
968
1119
|
disabled: !t,
|
|
969
1120
|
className: "form-block-preview-control",
|
|
970
|
-
options:
|
|
971
|
-
value:
|
|
972
|
-
onChange: (
|
|
1121
|
+
options: u,
|
|
1122
|
+
value: D(r),
|
|
1123
|
+
onChange: (p) => n(p.target.value)
|
|
973
1124
|
}
|
|
974
1125
|
)
|
|
975
1126
|
] });
|
|
976
1127
|
}
|
|
977
|
-
const
|
|
1128
|
+
const Ir = E(
|
|
978
1129
|
{
|
|
979
1130
|
name: "ChoicePicker",
|
|
980
|
-
schema:
|
|
981
|
-
label:
|
|
982
|
-
variant:
|
|
983
|
-
options:
|
|
984
|
-
value:
|
|
985
|
-
skoponPickerType:
|
|
986
|
-
placeholder:
|
|
1131
|
+
schema: m.object({
|
|
1132
|
+
label: m.any().optional(),
|
|
1133
|
+
variant: m.any().optional(),
|
|
1134
|
+
options: m.any().optional(),
|
|
1135
|
+
value: m.any().optional(),
|
|
1136
|
+
skoponPickerType: m.any().optional(),
|
|
1137
|
+
placeholder: m.any().optional()
|
|
987
1138
|
}).passthrough()
|
|
988
1139
|
},
|
|
989
|
-
|
|
1140
|
+
Er
|
|
990
1141
|
);
|
|
991
|
-
function
|
|
992
|
-
const { interactive: t } =
|
|
993
|
-
return /* @__PURE__ */
|
|
994
|
-
i ? /* @__PURE__ */
|
|
995
|
-
/* @__PURE__ */
|
|
996
|
-
|
|
1142
|
+
function Pr({ context: e }) {
|
|
1143
|
+
const { interactive: t } = j(), { value: r, setValue: n } = L(e), o = e.componentModel.properties, i = g(o.label);
|
|
1144
|
+
return /* @__PURE__ */ M("div", { className: "form-block-preview", children: [
|
|
1145
|
+
i ? /* @__PURE__ */ s("div", { className: "form-block-preview-label", children: i }) : null,
|
|
1146
|
+
/* @__PURE__ */ s(
|
|
1147
|
+
at,
|
|
997
1148
|
{
|
|
998
1149
|
disabled: !t,
|
|
999
1150
|
className: "form-block-preview-control",
|
|
1000
|
-
checked:
|
|
1001
|
-
onChange: (a) =>
|
|
1151
|
+
checked: be(r),
|
|
1152
|
+
onChange: (a) => n(a)
|
|
1002
1153
|
}
|
|
1003
1154
|
)
|
|
1004
1155
|
] });
|
|
1005
1156
|
}
|
|
1006
|
-
const
|
|
1007
|
-
{ name: "CheckBox", schema:
|
|
1008
|
-
|
|
1157
|
+
const wr = E(
|
|
1158
|
+
{ name: "CheckBox", schema: G("CheckBox") },
|
|
1159
|
+
Pr
|
|
1009
1160
|
);
|
|
1010
|
-
function
|
|
1011
|
-
const
|
|
1012
|
-
if (!
|
|
1013
|
-
if (!t &&
|
|
1014
|
-
const i =
|
|
1161
|
+
function Nr(e, t, r) {
|
|
1162
|
+
const n = D(e);
|
|
1163
|
+
if (!n) return;
|
|
1164
|
+
if (!t && r) {
|
|
1165
|
+
const i = Te(n, "HH:mm", !0);
|
|
1015
1166
|
return i.isValid() ? i : void 0;
|
|
1016
1167
|
}
|
|
1017
|
-
const o =
|
|
1168
|
+
const o = Te(n);
|
|
1018
1169
|
return o.isValid() ? o : void 0;
|
|
1019
1170
|
}
|
|
1020
|
-
function
|
|
1021
|
-
const { interactive: t } =
|
|
1022
|
-
if (!
|
|
1023
|
-
|
|
1171
|
+
function _r({ context: e }) {
|
|
1172
|
+
const { interactive: t } = j(), { value: r, setValue: n } = L(e), o = e.componentModel.properties, i = g(o.label), a = g(o.placeholder), l = o.enableDate === !0, c = o.enableTime === !0, u = Nr(r, l, c), f = (d) => {
|
|
1173
|
+
if (!d) {
|
|
1174
|
+
n("");
|
|
1024
1175
|
return;
|
|
1025
1176
|
}
|
|
1026
1177
|
if (!l && c) {
|
|
1027
|
-
|
|
1178
|
+
n(d.format("HH:mm"));
|
|
1028
1179
|
return;
|
|
1029
1180
|
}
|
|
1030
1181
|
if (l && c) {
|
|
1031
|
-
|
|
1182
|
+
n(d.format("YYYY-MM-DDTHH:mm"));
|
|
1032
1183
|
return;
|
|
1033
1184
|
}
|
|
1034
|
-
|
|
1185
|
+
n(d.format("YYYY-MM-DD"));
|
|
1035
1186
|
};
|
|
1036
|
-
return /* @__PURE__ */
|
|
1037
|
-
i ? /* @__PURE__ */
|
|
1038
|
-
!l && c ? /* @__PURE__ */
|
|
1039
|
-
|
|
1187
|
+
return /* @__PURE__ */ M("div", { className: "form-block-preview", children: [
|
|
1188
|
+
i ? /* @__PURE__ */ s("div", { className: "form-block-preview-label", children: i }) : null,
|
|
1189
|
+
!l && c ? /* @__PURE__ */ s(
|
|
1190
|
+
it,
|
|
1040
1191
|
{
|
|
1041
1192
|
disabled: !t,
|
|
1042
1193
|
className: "form-block-preview-control",
|
|
1043
1194
|
style: { width: "100%" },
|
|
1044
1195
|
placeholder: a || "选择时间",
|
|
1045
|
-
value:
|
|
1046
|
-
onChange:
|
|
1196
|
+
value: u,
|
|
1197
|
+
onChange: f
|
|
1047
1198
|
}
|
|
1048
|
-
) : /* @__PURE__ */
|
|
1049
|
-
|
|
1199
|
+
) : /* @__PURE__ */ s(
|
|
1200
|
+
lt,
|
|
1050
1201
|
{
|
|
1051
1202
|
showTime: l && c,
|
|
1052
1203
|
disabled: !t,
|
|
1053
1204
|
className: "form-block-preview-control",
|
|
1054
1205
|
style: { width: "100%" },
|
|
1055
1206
|
placeholder: a || (l && c ? "选择日期时间" : "选择日期"),
|
|
1056
|
-
value:
|
|
1057
|
-
onChange:
|
|
1207
|
+
value: u,
|
|
1208
|
+
onChange: f
|
|
1058
1209
|
}
|
|
1059
1210
|
)
|
|
1060
1211
|
] });
|
|
1061
1212
|
}
|
|
1062
|
-
const
|
|
1213
|
+
const Fr = E(
|
|
1063
1214
|
{
|
|
1064
1215
|
name: "DateTimeInput",
|
|
1065
|
-
schema:
|
|
1066
|
-
label:
|
|
1067
|
-
enableDate:
|
|
1068
|
-
enableTime:
|
|
1069
|
-
placeholder:
|
|
1070
|
-
value:
|
|
1071
|
-
min:
|
|
1072
|
-
max:
|
|
1216
|
+
schema: m.object({
|
|
1217
|
+
label: m.any().optional(),
|
|
1218
|
+
enableDate: m.any().optional(),
|
|
1219
|
+
enableTime: m.any().optional(),
|
|
1220
|
+
placeholder: m.any().optional(),
|
|
1221
|
+
value: m.any().optional(),
|
|
1222
|
+
min: m.any().optional(),
|
|
1223
|
+
max: m.any().optional()
|
|
1073
1224
|
}).passthrough()
|
|
1074
1225
|
},
|
|
1075
|
-
|
|
1076
|
-
),
|
|
1226
|
+
_r
|
|
1227
|
+
), Or = {
|
|
1077
1228
|
name: "FileUpload",
|
|
1078
|
-
schema:
|
|
1079
|
-
label:
|
|
1080
|
-
accept:
|
|
1081
|
-
fileAcceptTypes:
|
|
1082
|
-
filePlaceholderIcon:
|
|
1083
|
-
minCount:
|
|
1084
|
-
maxCount:
|
|
1085
|
-
value:
|
|
1229
|
+
schema: m.object({
|
|
1230
|
+
label: m.any().optional(),
|
|
1231
|
+
accept: m.any().optional(),
|
|
1232
|
+
fileAcceptTypes: m.any().optional(),
|
|
1233
|
+
filePlaceholderIcon: m.any().optional(),
|
|
1234
|
+
minCount: m.any().optional(),
|
|
1235
|
+
maxCount: m.any().optional(),
|
|
1236
|
+
value: m.any().optional()
|
|
1086
1237
|
}).passthrough()
|
|
1087
1238
|
};
|
|
1088
|
-
function
|
|
1089
|
-
const { interactive: t } =
|
|
1239
|
+
function Vr({ context: e }) {
|
|
1240
|
+
const { interactive: t } = j(), { value: r, setValue: n } = L(e), o = e.componentModel.properties, i = g(o.label), a = g(o.accept), l = Array.isArray(o.fileAcceptTypes) ? o.fileAcceptTypes.map(String) : void 0, c = a ? a.split(",").map((x) => x.trim()).filter(Boolean) : void 0, u = Pt(l, c), f = typeof o.filePlaceholderIcon == "string" && ["video", "audio", "image", "file", "spreadsheet", "document"].includes(
|
|
1090
1241
|
o.filePlaceholderIcon
|
|
1091
|
-
) ? o.filePlaceholderIcon : "document",
|
|
1092
|
-
return /* @__PURE__ */
|
|
1093
|
-
i ? /* @__PURE__ */
|
|
1094
|
-
/* @__PURE__ */
|
|
1095
|
-
|
|
1242
|
+
) ? o.filePlaceholderIcon : "document", d = typeof o.minCount == "number" ? Math.max(0, o.minCount) : 0, p = typeof o.maxCount == "number" ? o.maxCount : 1, y = p > 0, k = V(r), T = y && k.length >= p, h = k.length < d;
|
|
1243
|
+
return /* @__PURE__ */ M("div", { className: "form-block-preview", children: [
|
|
1244
|
+
i ? /* @__PURE__ */ s("div", { className: "form-block-preview-label", children: i }) : null,
|
|
1245
|
+
/* @__PURE__ */ M(
|
|
1246
|
+
le.Dragger,
|
|
1096
1247
|
{
|
|
1097
|
-
disabled: !t,
|
|
1098
|
-
accept:
|
|
1248
|
+
disabled: !t || T,
|
|
1249
|
+
accept: It(l, c),
|
|
1099
1250
|
className: "form-file-upload-preview",
|
|
1100
|
-
showUploadList: t &&
|
|
1101
|
-
fileList: t ?
|
|
1102
|
-
uid: `${
|
|
1103
|
-
name:
|
|
1251
|
+
showUploadList: t && k.length > 0,
|
|
1252
|
+
fileList: t ? k.map((x, v) => ({
|
|
1253
|
+
uid: `${v}-${x}`,
|
|
1254
|
+
name: x,
|
|
1104
1255
|
status: "done"
|
|
1105
1256
|
})) : [],
|
|
1106
|
-
beforeUpload: (
|
|
1107
|
-
if (!t) return
|
|
1108
|
-
const
|
|
1109
|
-
|
|
1257
|
+
beforeUpload: (x) => {
|
|
1258
|
+
if (!t) return le.LIST_IGNORE;
|
|
1259
|
+
const v = V(Ee(e));
|
|
1260
|
+
if (y && v.length >= p) return le.LIST_IGNORE;
|
|
1261
|
+
const b = y ? [...v, x.name].slice(0, p) : [...v, x.name];
|
|
1262
|
+
return n(b), !1;
|
|
1110
1263
|
},
|
|
1111
|
-
onRemove: (
|
|
1112
|
-
|
|
1264
|
+
onRemove: (x) => {
|
|
1265
|
+
const v = V(Ee(e)), b = /^(\d+)-/.exec(x.uid ?? ""), z = b ? Number(b[1]) : -1, I = z >= 0 && z < v.length ? v.filter((P, X) => X !== z) : v.filter((P) => P !== x.name);
|
|
1266
|
+
if (I.length < d) return !1;
|
|
1267
|
+
n(I);
|
|
1113
1268
|
},
|
|
1114
1269
|
children: [
|
|
1115
|
-
/* @__PURE__ */
|
|
1116
|
-
/* @__PURE__ */
|
|
1270
|
+
/* @__PURE__ */ s("p", { className: "form-file-upload-preview-icon", children: /* @__PURE__ */ s(vr, { type: f, size: 40 }) }),
|
|
1271
|
+
/* @__PURE__ */ s("p", { className: "form-file-upload-preview-text", children: "点击或拖拽文件到此处上传" })
|
|
1117
1272
|
]
|
|
1118
1273
|
}
|
|
1119
1274
|
),
|
|
1120
|
-
/* @__PURE__ */
|
|
1275
|
+
/* @__PURE__ */ M(R.Text, { type: "secondary", className: "form-block-preview-help", children: [
|
|
1121
1276
|
"允许:",
|
|
1122
|
-
|
|
1277
|
+
u ?? "全部类型",
|
|
1278
|
+
d > 0 ? `;至少 ${d} 个文件` : "",
|
|
1279
|
+
y ? `;最多 ${p} 个文件` : "",
|
|
1280
|
+
h && t ? `(当前 ${k.length} 个,未达下限)` : ""
|
|
1123
1281
|
] })
|
|
1124
1282
|
] });
|
|
1125
1283
|
}
|
|
1126
|
-
const
|
|
1127
|
-
|
|
1128
|
-
|
|
1284
|
+
const Br = E(
|
|
1285
|
+
Or,
|
|
1286
|
+
Vr
|
|
1129
1287
|
);
|
|
1130
|
-
function
|
|
1131
|
-
const { interactive: t } =
|
|
1132
|
-
let
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1288
|
+
function jr({ context: e }) {
|
|
1289
|
+
const { interactive: t } = j(), { value: r, setValue: n } = L(e), o = e.componentModel.properties, i = g(o.label), a = g(o.placeholder), l = g(o.variant) || "shortText", c = D(r) ?? "", u = !t, f = "form-block-preview-control";
|
|
1290
|
+
let d;
|
|
1291
|
+
if (l === "longText")
|
|
1292
|
+
d = /* @__PURE__ */ s(
|
|
1293
|
+
ce.TextArea,
|
|
1294
|
+
{
|
|
1295
|
+
disabled: u,
|
|
1296
|
+
className: f,
|
|
1297
|
+
placeholder: a || "长文本回答...",
|
|
1298
|
+
autoSize: { minRows: 2, maxRows: 6 },
|
|
1299
|
+
value: c,
|
|
1300
|
+
onChange: (p) => n(p.target.value)
|
|
1301
|
+
}
|
|
1302
|
+
);
|
|
1303
|
+
else if (l === "number") {
|
|
1304
|
+
const p = c && Number.isFinite(Number(c)) ? Number(c) : void 0;
|
|
1305
|
+
d = /* @__PURE__ */ s(
|
|
1306
|
+
ct,
|
|
1307
|
+
{
|
|
1308
|
+
disabled: u,
|
|
1309
|
+
className: f,
|
|
1310
|
+
style: { width: "100%" },
|
|
1311
|
+
placeholder: a || "数字",
|
|
1312
|
+
value: p,
|
|
1313
|
+
onChange: (y) => n(y == null ? "" : String(y))
|
|
1314
|
+
}
|
|
1315
|
+
);
|
|
1316
|
+
} else l === "obscured" ? d = /* @__PURE__ */ s(
|
|
1317
|
+
ce.Password,
|
|
1155
1318
|
{
|
|
1156
|
-
disabled:
|
|
1157
|
-
className:
|
|
1319
|
+
disabled: u,
|
|
1320
|
+
className: f,
|
|
1158
1321
|
placeholder: a,
|
|
1159
1322
|
value: c,
|
|
1160
|
-
onChange: (
|
|
1323
|
+
onChange: (p) => n(p.target.value)
|
|
1161
1324
|
}
|
|
1162
|
-
) :
|
|
1163
|
-
|
|
1325
|
+
) : d = /* @__PURE__ */ s(
|
|
1326
|
+
ce,
|
|
1164
1327
|
{
|
|
1165
|
-
disabled:
|
|
1166
|
-
className:
|
|
1328
|
+
disabled: u,
|
|
1329
|
+
className: f,
|
|
1167
1330
|
placeholder: a,
|
|
1168
1331
|
value: c,
|
|
1169
|
-
onChange: (
|
|
1332
|
+
onChange: (p) => n(p.target.value)
|
|
1170
1333
|
}
|
|
1171
|
-
)
|
|
1172
|
-
|
|
1173
|
-
|
|
1334
|
+
);
|
|
1335
|
+
return /* @__PURE__ */ M("div", { className: "form-block-preview", children: [
|
|
1336
|
+
i ? /* @__PURE__ */ s("div", { className: "form-block-preview-label", children: i }) : null,
|
|
1337
|
+
d
|
|
1174
1338
|
] });
|
|
1175
1339
|
}
|
|
1176
|
-
const
|
|
1340
|
+
const Lr = E(
|
|
1177
1341
|
{
|
|
1178
1342
|
name: "TextField",
|
|
1179
|
-
schema:
|
|
1180
|
-
label:
|
|
1181
|
-
variant:
|
|
1182
|
-
placeholder:
|
|
1183
|
-
validationRegexp:
|
|
1184
|
-
value:
|
|
1343
|
+
schema: m.object({
|
|
1344
|
+
label: m.any().optional(),
|
|
1345
|
+
variant: m.any().optional(),
|
|
1346
|
+
placeholder: m.any().optional(),
|
|
1347
|
+
validationRegexp: m.any().optional(),
|
|
1348
|
+
value: m.any().optional()
|
|
1185
1349
|
}).passthrough()
|
|
1186
1350
|
},
|
|
1187
|
-
|
|
1351
|
+
jr
|
|
1188
1352
|
);
|
|
1189
|
-
function
|
|
1190
|
-
const t = e.componentModel.properties,
|
|
1191
|
-
return
|
|
1353
|
+
function zr({ context: e }) {
|
|
1354
|
+
const t = e.componentModel.properties, r = g(t.text), n = g(t.variant) || "body";
|
|
1355
|
+
return gr.has(n) ? n === "caption" ? /* @__PURE__ */ s(R.Text, { type: "secondary", className: "form-block-preview-paragraph", children: /* @__PURE__ */ s("em", { children: r }) }) : /* @__PURE__ */ s(n, { className: "form-block-preview-heading", children: r }) : /* @__PURE__ */ s(R.Paragraph, { className: "form-block-preview-paragraph", children: r });
|
|
1192
1356
|
}
|
|
1193
|
-
const
|
|
1194
|
-
{ name: "Text", schema:
|
|
1195
|
-
|
|
1357
|
+
const Ur = E(
|
|
1358
|
+
{ name: "Text", schema: G("Text") },
|
|
1359
|
+
zr
|
|
1196
1360
|
);
|
|
1197
|
-
function
|
|
1361
|
+
function Ge() {
|
|
1198
1362
|
const t = [
|
|
1199
|
-
...[...
|
|
1200
|
-
(
|
|
1363
|
+
...[...Z.components.values()].filter(
|
|
1364
|
+
(n) => !yr.has(n.name)
|
|
1201
1365
|
),
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
],
|
|
1214
|
-
return new
|
|
1215
|
-
}
|
|
1216
|
-
const
|
|
1366
|
+
xr,
|
|
1367
|
+
Mr,
|
|
1368
|
+
Sr,
|
|
1369
|
+
kr,
|
|
1370
|
+
Ar,
|
|
1371
|
+
Ir,
|
|
1372
|
+
wr,
|
|
1373
|
+
Fr,
|
|
1374
|
+
Br,
|
|
1375
|
+
Lr,
|
|
1376
|
+
Ur
|
|
1377
|
+
], r = [...Z.functions.values()];
|
|
1378
|
+
return new rt(Ye, t, r, Z.themeSchema);
|
|
1379
|
+
}
|
|
1380
|
+
const $r = et(
|
|
1217
1381
|
function({
|
|
1218
1382
|
doc: t,
|
|
1219
|
-
surfaceId:
|
|
1220
|
-
emptyHint:
|
|
1383
|
+
surfaceId: r = "skopon-form",
|
|
1384
|
+
emptyHint: n = null,
|
|
1221
1385
|
interactive: o = !0,
|
|
1222
1386
|
fieldNames: i = []
|
|
1223
1387
|
}, a) {
|
|
1224
|
-
|
|
1225
|
-
|
|
1388
|
+
_(() => {
|
|
1389
|
+
_e(), we();
|
|
1226
1390
|
}, []);
|
|
1227
|
-
const l =
|
|
1391
|
+
const l = w(null), c = w(i);
|
|
1228
1392
|
c.current = i;
|
|
1229
|
-
const
|
|
1230
|
-
if (
|
|
1231
|
-
return
|
|
1393
|
+
const u = N(() => {
|
|
1394
|
+
if (he(t))
|
|
1395
|
+
return { surfaces: [], processor: null };
|
|
1232
1396
|
try {
|
|
1233
|
-
const
|
|
1234
|
-
surfaceId:
|
|
1235
|
-
catalogId:
|
|
1397
|
+
const p = new Pe([Ge()]), y = qt(t, {
|
|
1398
|
+
surfaceId: r,
|
|
1399
|
+
catalogId: Ye
|
|
1236
1400
|
});
|
|
1237
|
-
return
|
|
1238
|
-
|
|
1239
|
-
|
|
1401
|
+
return p.processMessages(y), {
|
|
1402
|
+
surfaces: Array.from(p.model.surfacesMap.values()),
|
|
1403
|
+
processor: p
|
|
1404
|
+
};
|
|
1405
|
+
} catch (p) {
|
|
1406
|
+
return console.error("[SkoponFormRenderer] 渲染 A2UI surface 失败", p), { surfaces: [], processor: null };
|
|
1240
1407
|
}
|
|
1241
|
-
}, [t,
|
|
1242
|
-
return
|
|
1408
|
+
}, [t, r]), { surfaces: f, processor: d } = u;
|
|
1409
|
+
return l.current = d, tt(
|
|
1243
1410
|
a,
|
|
1244
1411
|
() => ({
|
|
1245
|
-
getValues(
|
|
1246
|
-
const
|
|
1247
|
-
if (!
|
|
1248
|
-
const
|
|
1249
|
-
return
|
|
1412
|
+
getValues(p) {
|
|
1413
|
+
const y = l.current;
|
|
1414
|
+
if (!y) return {};
|
|
1415
|
+
const k = (p ?? c.current).map((T) => T.trim()).filter(Boolean);
|
|
1416
|
+
return Qt(y, r, k);
|
|
1250
1417
|
}
|
|
1251
1418
|
}),
|
|
1252
|
-
[
|
|
1253
|
-
),
|
|
1419
|
+
[r]
|
|
1420
|
+
), f.length === 0 ? /* @__PURE__ */ s(Ie, { children: n }) : /* @__PURE__ */ s(De, { interactive: o, children: /* @__PURE__ */ s("div", { className: "a2ui-surface a2ui-container", children: f.map((p) => /* @__PURE__ */ s(Ne, { surface: p }, p.id)) }) });
|
|
1254
1421
|
}
|
|
1255
1422
|
);
|
|
1256
|
-
function
|
|
1423
|
+
function W() {
|
|
1424
|
+
return new Pe([Ge()]);
|
|
1425
|
+
}
|
|
1426
|
+
function rn({
|
|
1257
1427
|
messages: e,
|
|
1258
1428
|
surfaceId: t = "skopon-form-stream",
|
|
1259
|
-
emptyHint:
|
|
1260
|
-
interactive:
|
|
1429
|
+
emptyHint: r = null,
|
|
1430
|
+
interactive: n = !0
|
|
1261
1431
|
}) {
|
|
1262
|
-
|
|
1263
|
-
|
|
1432
|
+
_(() => {
|
|
1433
|
+
_e(), we();
|
|
1264
1434
|
}, []);
|
|
1265
|
-
const o =
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1435
|
+
const o = w(W()), i = w(0), a = w(!0), l = w(t), [c, u] = O(() => o.current), [f, d] = O(
|
|
1436
|
+
() => Array.from(o.current.model.surfacesMap.values())
|
|
1437
|
+
);
|
|
1438
|
+
return _(() => (a.current = !0, () => {
|
|
1439
|
+
a.current = !1;
|
|
1440
|
+
}), []), _(() => {
|
|
1441
|
+
o.current = c;
|
|
1442
|
+
}, [c]), _(() => {
|
|
1443
|
+
const p = () => {
|
|
1444
|
+
a.current && d(Array.from(c.model.surfacesMap.values()));
|
|
1445
|
+
}, y = c.onSurfaceCreated(p), k = c.onSurfaceDeleted(p);
|
|
1271
1446
|
return () => {
|
|
1272
|
-
|
|
1447
|
+
y.unsubscribe(), k.unsubscribe();
|
|
1273
1448
|
};
|
|
1274
|
-
}, [
|
|
1275
|
-
|
|
1276
|
-
const
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1449
|
+
}, [c]), _(() => {
|
|
1450
|
+
let p = !1;
|
|
1451
|
+
const y = l.current !== t;
|
|
1452
|
+
if (l.current = t, y) {
|
|
1453
|
+
const h = W();
|
|
1454
|
+
return o.current = h, i.current = 0, Array.isArray(e) && e.length > 0 ? (h.processMessages(e), i.current = e.length, p || (u(h), d(Array.from(h.model.surfacesMap.values())))) : p || (u(h), d([])), () => {
|
|
1455
|
+
p = !0;
|
|
1456
|
+
};
|
|
1457
|
+
}
|
|
1458
|
+
if (!Array.isArray(e) || e.length === 0) {
|
|
1459
|
+
if (i.current > 0) {
|
|
1460
|
+
const h = W();
|
|
1461
|
+
o.current = h, i.current = 0, p || (u(h), d([]));
|
|
1462
|
+
}
|
|
1463
|
+
return () => {
|
|
1464
|
+
p = !0;
|
|
1465
|
+
};
|
|
1466
|
+
}
|
|
1467
|
+
const k = o.current;
|
|
1468
|
+
if (e.length < i.current) {
|
|
1469
|
+
const h = W();
|
|
1470
|
+
return o.current = h, i.current = 0, h.processMessages(e), i.current = e.length, p || (u(h), d(Array.from(h.model.surfacesMap.values()))), () => {
|
|
1471
|
+
p = !0;
|
|
1472
|
+
};
|
|
1473
|
+
}
|
|
1474
|
+
const T = e.slice(i.current);
|
|
1475
|
+
return T.length === 0 ? () => {
|
|
1476
|
+
p = !0;
|
|
1477
|
+
} : (k.processMessages(T), i.current = e.length, p || d(Array.from(k.model.surfacesMap.values())), () => {
|
|
1478
|
+
p = !0;
|
|
1479
|
+
});
|
|
1480
|
+
}, [e, t]), f.length === 0 ? /* @__PURE__ */ s(Ie, { children: r }) : /* @__PURE__ */ s(De, { interactive: n, children: /* @__PURE__ */ s("div", { className: "a2ui-surface a2ui-container", children: f.map((p) => /* @__PURE__ */ s(Ne, { surface: p }, p.id)) }) });
|
|
1481
|
+
}
|
|
1482
|
+
function Rr({
|
|
1281
1483
|
payload: e,
|
|
1282
1484
|
callbackUrl: t,
|
|
1283
|
-
title:
|
|
1284
|
-
unpublishedFormId:
|
|
1485
|
+
title: r,
|
|
1486
|
+
unpublishedFormId: n,
|
|
1285
1487
|
incompleteFormId: o,
|
|
1286
1488
|
onNotify: i
|
|
1287
1489
|
}) {
|
|
1288
|
-
const a =
|
|
1289
|
-
() =>
|
|
1490
|
+
const a = N(
|
|
1491
|
+
() => er(e, t),
|
|
1290
1492
|
[e, t]
|
|
1291
1493
|
);
|
|
1292
1494
|
async function l() {
|
|
1293
1495
|
try {
|
|
1294
|
-
await
|
|
1496
|
+
await $e(a), i == null || i("success", "已复制到剪贴板");
|
|
1295
1497
|
} catch {
|
|
1296
1498
|
i == null || i("error", "复制失败");
|
|
1297
1499
|
}
|
|
1298
1500
|
}
|
|
1299
|
-
return /* @__PURE__ */
|
|
1300
|
-
/* @__PURE__ */
|
|
1301
|
-
/* @__PURE__ */
|
|
1302
|
-
/* @__PURE__ */
|
|
1303
|
-
|
|
1304
|
-
o ? /* @__PURE__ */
|
|
1501
|
+
return /* @__PURE__ */ M("div", { className: "ask-user-curl-card", children: [
|
|
1502
|
+
/* @__PURE__ */ M("div", { className: "ask-user-curl-card-header", children: [
|
|
1503
|
+
/* @__PURE__ */ M("div", { className: "ask-user-curl-card-header-title", children: [
|
|
1504
|
+
/* @__PURE__ */ s(R.Text, { type: "secondary", children: r ?? "curl 命令" }),
|
|
1505
|
+
n ? /* @__PURE__ */ s(Q, { title: n, children: /* @__PURE__ */ s(pe, { className: "ask-user-curl-unpublished-tag", children: "卡片 ID 未发布" }) }) : null,
|
|
1506
|
+
o ? /* @__PURE__ */ s(Q, { title: o, children: /* @__PURE__ */ s(pe, { className: "ask-user-curl-incomplete-tag", children: "卡片 ID 待补足" }) }) : null
|
|
1305
1507
|
] }),
|
|
1306
|
-
/* @__PURE__ */
|
|
1508
|
+
/* @__PURE__ */ s(Fe, { size: "small", type: "text", onClick: () => void l(), children: "复制" })
|
|
1307
1509
|
] }),
|
|
1308
|
-
/* @__PURE__ */
|
|
1510
|
+
/* @__PURE__ */ s("pre", { className: "skopon-form-curl-json", children: a })
|
|
1309
1511
|
] });
|
|
1310
1512
|
}
|
|
1311
|
-
function
|
|
1513
|
+
function Dr(e, t) {
|
|
1514
|
+
if (t && typeof t == "object" && t !== null && "message" in t) {
|
|
1515
|
+
const r = t.message;
|
|
1516
|
+
if (typeof r == "string" && r.trim())
|
|
1517
|
+
return `提交失败 (${e}): ${r.trim()}`;
|
|
1518
|
+
}
|
|
1519
|
+
return typeof t == "string" && t.trim() ? `提交失败 (${e}): ${t.trim()}` : `提交失败 (${e})`;
|
|
1520
|
+
}
|
|
1521
|
+
function nn({
|
|
1312
1522
|
payload: e,
|
|
1313
1523
|
formUniqueId: t,
|
|
1314
|
-
callbackUrl:
|
|
1315
|
-
submitMode:
|
|
1524
|
+
callbackUrl: r,
|
|
1525
|
+
submitMode: n = "curl",
|
|
1316
1526
|
fetchFormDetail: o,
|
|
1317
1527
|
onNotify: i
|
|
1318
1528
|
}) {
|
|
1319
|
-
const [a, l] =
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1529
|
+
const [a, l] = O(null), [c, u] = O(!1), [f, d] = O(!0), [p, y] = O(!1), k = w(null), T = w(!0), h = w(i);
|
|
1530
|
+
h.current = i;
|
|
1531
|
+
const x = (t == null ? void 0 : t.trim()) ?? "";
|
|
1532
|
+
_(() => (T.current = !0, () => {
|
|
1533
|
+
T.current = !1;
|
|
1534
|
+
}), []), _(() => {
|
|
1535
|
+
let A = !1;
|
|
1536
|
+
return x ? (d(!0), u(!1), o({ formUniqueId: x }).then((C) => {
|
|
1537
|
+
A || (u(!!C.disabled), l(C.formDefinition ?? null));
|
|
1538
|
+
}).catch((C) => {
|
|
1539
|
+
var U;
|
|
1540
|
+
if (!A) {
|
|
1541
|
+
u(!1), l(null);
|
|
1542
|
+
const q = C instanceof Error ? C.message : "获取表单定义失败";
|
|
1543
|
+
(U = h.current) == null || U.call(h, "error", q);
|
|
1544
|
+
}
|
|
1326
1545
|
}).finally(() => {
|
|
1327
|
-
|
|
1546
|
+
A || d(!1);
|
|
1328
1547
|
}), () => {
|
|
1329
|
-
|
|
1330
|
-
}
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
return
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1548
|
+
A = !0;
|
|
1549
|
+
}) : (d(!1), u(!1), l(null), () => {
|
|
1550
|
+
A = !0;
|
|
1551
|
+
});
|
|
1552
|
+
}, [x, o]);
|
|
1553
|
+
const v = N(() => ir(e), [e]), b = N(() => v ? lr(v, a ?? void 0) : null, [v, a]), z = (b == null ? void 0 : b.matchedBlocks) ?? [], I = !!(v && ur(v) && z.length === 0), P = N(() => b && b.renderBlocks.length > 0 ? b.renderBlocks : I && v ? pr(v) : [], [b, I, v]), X = N(
|
|
1554
|
+
() => I ? {} : sr((b == null ? void 0 : b.extraBlocks) ?? []),
|
|
1555
|
+
[I, b]
|
|
1556
|
+
), xe = N(() => I && v ? dr(v) : P.filter((A) => {
|
|
1557
|
+
var C;
|
|
1558
|
+
return (C = A.name) == null ? void 0 : C.trim();
|
|
1559
|
+
}).map((A) => A.name.trim()), [I, v, P]), Xe = N(() => {
|
|
1560
|
+
if (P.length === 0) return null;
|
|
1561
|
+
const A = (b == null ? void 0 : b.title) ?? (v == null ? void 0 : v.title) ?? "", C = (b == null ? void 0 : b.description) ?? (v == null ? void 0 : v.description) ?? "";
|
|
1562
|
+
return Wt({ title: A, description: C }, P);
|
|
1563
|
+
}, [b, v, P]), qe = x ? `ask-user-${x}` : "ask-user-payload";
|
|
1564
|
+
if (f)
|
|
1565
|
+
return /* @__PURE__ */ s("div", { className: "ask-user-form-card", children: /* @__PURE__ */ s(st, { size: "small" }) });
|
|
1566
|
+
if (!v || P.length === 0)
|
|
1567
|
+
return /* @__PURE__ */ s(
|
|
1568
|
+
Rr,
|
|
1347
1569
|
{
|
|
1348
1570
|
payload: e,
|
|
1349
|
-
callbackUrl:
|
|
1350
|
-
unpublishedFormId: c ?
|
|
1571
|
+
callbackUrl: r,
|
|
1572
|
+
unpublishedFormId: c && x ? x : void 0,
|
|
1351
1573
|
onNotify: i
|
|
1352
1574
|
}
|
|
1353
1575
|
);
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
if (r === "post") {
|
|
1359
|
-
const ee = (n ?? "").trim();
|
|
1360
|
-
if (!ee) {
|
|
1361
|
-
i == null || i("error", "callback_url 为空,无法提交");
|
|
1362
|
-
return;
|
|
1363
|
-
}
|
|
1576
|
+
async function Ke() {
|
|
1577
|
+
var A, C, U, q, Se, ke;
|
|
1578
|
+
if (!p) {
|
|
1579
|
+
y(!0);
|
|
1364
1580
|
try {
|
|
1365
|
-
const
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1581
|
+
const $ = ((A = k.current) == null ? void 0 : A.getValues(xe)) ?? {}, oe = { ...$, ...X };
|
|
1582
|
+
if (n === "post") {
|
|
1583
|
+
const Ae = (r ?? "").trim();
|
|
1584
|
+
if (!Ae) {
|
|
1585
|
+
(C = h.current) == null || C.call(h, "error", "callback_url 为空,无法提交");
|
|
1586
|
+
return;
|
|
1587
|
+
}
|
|
1588
|
+
const ae = await mr(Ae, oe);
|
|
1589
|
+
if (!T.current) return;
|
|
1590
|
+
ae.ok ? (U = h.current) == null || U.call(h, "success", "提交成功") : (q = h.current) == null || q.call(h, "error", Dr(ae.status, ae.body));
|
|
1591
|
+
return;
|
|
1592
|
+
}
|
|
1593
|
+
if (await $e(
|
|
1594
|
+
rr({ cardValues: $, extraValues: X, callbackUrl: r })
|
|
1595
|
+
), !T.current) return;
|
|
1596
|
+
(Se = h.current) == null || Se.call(h, "success", "已复制 curl 到剪贴板");
|
|
1597
|
+
} catch ($) {
|
|
1598
|
+
if (!T.current) return;
|
|
1599
|
+
const oe = $ instanceof Error ? $.message : "复制失败";
|
|
1600
|
+
(ke = h.current) == null || ke.call(h, "error", oe);
|
|
1601
|
+
} finally {
|
|
1602
|
+
T.current && y(!1);
|
|
1370
1603
|
}
|
|
1371
|
-
return;
|
|
1372
|
-
}
|
|
1373
|
-
try {
|
|
1374
|
-
await Te(Se(g, n)), i == null || i("success", "已复制 curl 到剪贴板");
|
|
1375
|
-
} catch {
|
|
1376
|
-
i == null || i("error", "复制失败");
|
|
1377
1604
|
}
|
|
1378
1605
|
}
|
|
1379
|
-
return /* @__PURE__ */
|
|
1380
|
-
/* @__PURE__ */
|
|
1381
|
-
|
|
1606
|
+
return /* @__PURE__ */ M("div", { className: "ask-user-form-card", children: [
|
|
1607
|
+
c && x ? /* @__PURE__ */ s("div", { className: "ask-user-form-card-status", children: /* @__PURE__ */ s(Q, { title: x, children: /* @__PURE__ */ s(pe, { className: "ask-user-curl-unpublished-tag", children: "卡片 ID 未发布" }) }) }) : null,
|
|
1608
|
+
/* @__PURE__ */ s(
|
|
1609
|
+
$r,
|
|
1382
1610
|
{
|
|
1383
|
-
ref:
|
|
1384
|
-
doc:
|
|
1385
|
-
surfaceId:
|
|
1386
|
-
fieldNames:
|
|
1611
|
+
ref: k,
|
|
1612
|
+
doc: Xe,
|
|
1613
|
+
surfaceId: qe,
|
|
1614
|
+
fieldNames: xe,
|
|
1387
1615
|
interactive: !0
|
|
1388
1616
|
}
|
|
1389
1617
|
),
|
|
1390
|
-
/* @__PURE__ */
|
|
1391
|
-
|
|
1392
|
-
ie,
|
|
1618
|
+
/* @__PURE__ */ s("div", { className: "ask-user-form-actions", children: /* @__PURE__ */ s(Q, { title: n === "curl" ? "点击复制 curl" : "提交 JSON 到 callback_url", children: /* @__PURE__ */ s(
|
|
1619
|
+
Fe,
|
|
1393
1620
|
{
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1621
|
+
type: "primary",
|
|
1622
|
+
size: "small",
|
|
1623
|
+
loading: p,
|
|
1624
|
+
disabled: p,
|
|
1625
|
+
onClick: () => void Ke(),
|
|
1626
|
+
children: "提交"
|
|
1399
1627
|
}
|
|
1400
|
-
)
|
|
1628
|
+
) }) })
|
|
1401
1629
|
] });
|
|
1402
1630
|
}
|
|
1403
1631
|
export {
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1632
|
+
en as A2UI_PROTOCOL_VERSION,
|
|
1633
|
+
nn as AskUserFormCard,
|
|
1634
|
+
Rr as CurlSubmitBlock,
|
|
1635
|
+
ht as FORM_MEDIA_SIZES,
|
|
1636
|
+
rn as SkoponA2uiStreamRenderer,
|
|
1637
|
+
$r as SkoponFormRenderer,
|
|
1638
|
+
Xt as a2uiToBlocks,
|
|
1639
|
+
je as blocksToA2ui,
|
|
1640
|
+
tr as buildAskUserCurlBodyJson,
|
|
1641
|
+
rr as buildAskUserCurlStatement,
|
|
1642
|
+
Wt as buildAskUserSurface,
|
|
1643
|
+
er as buildCurlStatement,
|
|
1644
|
+
$e as copyTextToClipboard,
|
|
1645
|
+
tn as createFormClient,
|
|
1646
|
+
sr as extractExtraBlockValues,
|
|
1647
|
+
Qt as extractSurfaceValues,
|
|
1648
|
+
dr as getPayloadInputFieldNames,
|
|
1649
|
+
pr as getPayloadRenderableBlocks,
|
|
1650
|
+
lr as intersectPayloadBlocksWithForm,
|
|
1651
|
+
he as isA2uiSurfaceEmpty,
|
|
1652
|
+
F as isInputBlockType,
|
|
1653
|
+
ve as isLayoutBlockType,
|
|
1654
|
+
de as isMediaBlockType,
|
|
1655
|
+
Zt as mapFormDefinitionFromDto,
|
|
1656
|
+
B as normalizeFormDefinition,
|
|
1657
|
+
ir as parsePayloadBlocksJson,
|
|
1658
|
+
ur as payloadHasInputBlocks,
|
|
1659
|
+
Kt as resolveSurfaceFromFormDefinition,
|
|
1660
|
+
mr as submitFormJson,
|
|
1661
|
+
qt as surfaceDocToMessages,
|
|
1662
|
+
ee as syncFormDefinition
|
|
1428
1663
|
};
|