@vef-framework-react/form-editor 2.24.1 → 2.25.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/cjs/editor/canvas/canvas-field.cjs +1 -1
- package/dist/cjs/editor/data-source-apis.cjs +1 -0
- package/dist/cjs/editor/footer/footer.cjs +1 -1
- package/dist/cjs/editor/form-config/form-config-drawer.cjs +1 -1
- package/dist/cjs/editor/form-editor.cjs +1 -1
- package/dist/cjs/editor/host-validation.cjs +1 -0
- package/dist/cjs/editor/issue-location.cjs +1 -0
- package/dist/cjs/editor/preview-runtime-context.cjs +1 -1
- package/dist/cjs/editor/properties/entries/linkage/action-editor.cjs +2 -2
- package/dist/cjs/editor/properties/entries/linkage/condition-editor.cjs +1 -1
- package/dist/cjs/editor/properties/entries/linkage/styles.cjs +1 -1
- package/dist/cjs/editor/properties/entries/options-source/index.cjs +1 -1
- package/dist/cjs/editor/properties/form-data-sources-panel.cjs +1 -1
- package/dist/cjs/editor/properties/option-editors.cjs +1 -1
- package/dist/cjs/editor/properties/remote-option-source-editor.cjs +1 -0
- package/dist/cjs/editor/properties/remote-request-editor.cjs +1 -0
- package/dist/cjs/editor/properties/system-variables-panel.cjs +1 -0
- package/dist/cjs/editor/styles.cjs +1 -1
- package/dist/cjs/editor/toolbar/toolbar.cjs +2 -2
- package/dist/cjs/editor/validation-summary.cjs +1 -1
- package/dist/cjs/engine/linkage/default-evaluator.cjs +1 -1
- package/dist/cjs/engine/linkage/operators.cjs +1 -1
- package/dist/cjs/engine/linkage/scope.cjs +1 -0
- package/dist/cjs/engine/linkage/source-tracking.cjs +1 -1
- package/dist/cjs/engine/linkage/validator.cjs +1 -1
- package/dist/cjs/engine/option-mapping.cjs +1 -0
- package/dist/cjs/engine/schema/edit-ops.cjs +1 -1
- package/dist/cjs/engine/schema/reconcile.cjs +1 -1
- package/dist/cjs/engine/validation.cjs +1 -1
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/render/data-source-context.cjs +1 -1
- package/dist/cjs/render/form-renderer.cjs +1 -1
- package/dist/es/components/button/index.js +1 -1
- package/dist/es/components/checkbox-group-field/index.js +1 -1
- package/dist/es/components/code-editor/code-editor-input.js +1 -1
- package/dist/es/components/code-editor/index.js +1 -1
- package/dist/es/components/containers/index.js +1 -1
- package/dist/es/components/date-field/index.js +1 -1
- package/dist/es/components/display/index.js +1 -1
- package/dist/es/components/field-entries.js +1 -1
- package/dist/es/components/mobile/alert-block.js +1 -1
- package/dist/es/components/mobile/button.js +1 -1
- package/dist/es/components/mobile/checkbox-group.js +1 -1
- package/dist/es/components/mobile/date-adapters.js +1 -1
- package/dist/es/components/mobile/date.js +1 -1
- package/dist/es/components/mobile/daterange.js +1 -1
- package/dist/es/components/mobile/datetime.js +1 -1
- package/dist/es/components/mobile/definitions.js +1 -1
- package/dist/es/components/mobile/divider.js +1 -1
- package/dist/es/components/mobile/input-cell.js +1 -1
- package/dist/es/components/mobile/number.js +1 -1
- package/dist/es/components/mobile/option-group.js +1 -1
- package/dist/es/components/mobile/paragraph.js +1 -1
- package/dist/es/components/mobile/picker-trigger.js +1 -1
- package/dist/es/components/mobile/radio.js +1 -1
- package/dist/es/components/mobile/scope.js +1 -1
- package/dist/es/components/mobile/select.js +1 -1
- package/dist/es/components/mobile/switch.js +1 -1
- package/dist/es/components/mobile/textarea.js +1 -1
- package/dist/es/components/mobile/textfield.js +1 -1
- package/dist/es/components/mobile/theme.js +1 -1
- package/dist/es/components/number-field/index.js +1 -1
- package/dist/es/components/radio-field/index.js +1 -1
- package/dist/es/components/select-field/index.js +1 -1
- package/dist/es/components/switch-field/index.js +1 -1
- package/dist/es/components/textarea-field/index.js +1 -1
- package/dist/es/components/textfield/index.js +1 -1
- package/dist/es/components/upload-field/index.js +1 -1
- package/dist/es/editor/canvas/canvas-field.js +28 -27
- package/dist/es/editor/canvas/canvas.js +1 -1
- package/dist/es/editor/canvas/container-drag-chip.js +1 -1
- package/dist/es/editor/canvas/drop-indicator.js +1 -1
- package/dist/es/editor/canvas/drop-zones.js +1 -1
- package/dist/es/editor/canvas/json-split-view.js +1 -1
- package/dist/es/editor/canvas/mobile-seed-state.js +1 -1
- package/dist/es/editor/canvas/phone-frame.js +1 -1
- package/dist/es/editor/canvas/subform-column-eligibility.js +1 -1
- package/dist/es/editor/canvas/subform-table-cell.js +1 -1
- package/dist/es/editor/canvas/use-scroll-selection-into-view.js +1 -1
- package/dist/es/editor/context-sources.js +1 -1
- package/dist/es/editor/data-source-apis.js +30 -0
- package/dist/es/editor/dnd.js +1 -1
- package/dist/es/editor/editor-layout-context.js +1 -1
- package/dist/es/editor/footer/footer.js +119 -82
- package/dist/es/editor/form-config/form-basics-tab.js +1 -1
- package/dist/es/editor/form-config/form-config-drawer.js +120 -99
- package/dist/es/editor/form-config/linkage-overview.js +1 -1
- package/dist/es/editor/form-config/outline-tab.js +1 -1
- package/dist/es/editor/form-editor.js +113 -105
- package/dist/es/editor/host-validation.js +17 -0
- package/dist/es/editor/issue-location.js +127 -0
- package/dist/es/editor/palette/field-groups.js +1 -1
- package/dist/es/editor/palette/palette-group.js +1 -1
- package/dist/es/editor/palette/palette-item.js +1 -1
- package/dist/es/editor/palette/palette-panel.js +1 -1
- package/dist/es/editor/preview-effects.js +1 -1
- package/dist/es/editor/preview-runtime-context.js +58 -18
- package/dist/es/editor/properties/block-layout-section.js +1 -1
- package/dist/es/editor/properties/container-properties.js +1 -1
- package/dist/es/editor/properties/dynamic-value-editor.js +1 -1
- package/dist/es/editor/properties/entries/built-ins.js +1 -1
- package/dist/es/editor/properties/entries/checkbox-entry.js +1 -1
- package/dist/es/editor/properties/entries/coerce.js +1 -1
- package/dist/es/editor/properties/entries/entry-field.js +1 -1
- package/dist/es/editor/properties/entries/icon-entry.js +1 -1
- package/dist/es/editor/properties/entries/index.js +1 -1
- package/dist/es/editor/properties/entries/key-entry.js +1 -1
- package/dist/es/editor/properties/entries/linkage/action-editor.js +24 -40
- package/dist/es/editor/properties/entries/linkage/actions-editor.js +1 -1
- package/dist/es/editor/properties/entries/linkage/condition-editor.js +13 -12
- package/dist/es/editor/properties/entries/linkage/container-linkage-section.js +1 -1
- package/dist/es/editor/properties/entries/linkage/expression-input.js +1 -1
- package/dist/es/editor/properties/entries/linkage/index.js +1 -1
- package/dist/es/editor/properties/entries/linkage/linkage-rules-entry.js +1 -1
- package/dist/es/editor/properties/entries/linkage/mutators.js +1 -1
- package/dist/es/editor/properties/entries/linkage/options.js +1 -1
- package/dist/es/editor/properties/entries/linkage/rule-diagnostics.js +1 -1
- package/dist/es/editor/properties/entries/linkage/rule-list-editor.js +1 -1
- package/dist/es/editor/properties/entries/linkage/styles.js +42 -49
- package/dist/es/editor/properties/entries/linkage/trigger-editor.js +1 -1
- package/dist/es/editor/properties/entries/linkage/use-linkage-editor-model.js +1 -1
- package/dist/es/editor/properties/entries/linkage/use-stable-options.js +1 -1
- package/dist/es/editor/properties/entries/number-entry.js +1 -1
- package/dist/es/editor/properties/entries/options-source/index.js +7 -6
- package/dist/es/editor/properties/entries/options-source/source-mutators.js +1 -1
- package/dist/es/editor/properties/entries/select-entry.js +1 -1
- package/dist/es/editor/properties/entries/text-entry.js +1 -1
- package/dist/es/editor/properties/form-data-sources-panel.js +44 -36
- package/dist/es/editor/properties/form-linkage-panel.js +1 -1
- package/dist/es/editor/properties/form-variables-panel.js +1 -1
- package/dist/es/editor/properties/option-editors.js +87 -252
- package/dist/es/editor/properties/panel-header.js +1 -1
- package/dist/es/editor/properties/properties-empty.js +1 -1
- package/dist/es/editor/properties/properties-header.js +1 -1
- package/dist/es/editor/properties/properties-panel.js +1 -1
- package/dist/es/editor/properties/properties-provider.js +1 -1
- package/dist/es/editor/properties/properties-tabs.js +1 -1
- package/dist/es/editor/properties/remote-option-source-editor.js +207 -0
- package/dist/es/editor/properties/remote-request-editor.js +357 -0
- package/dist/es/editor/properties/system-variables-panel.js +114 -0
- package/dist/es/editor/properties/use-confirmable-kind-switch.js +1 -1
- package/dist/es/editor/remove-node-confirm.js +1 -1
- package/dist/es/editor/schema-apply.js +1 -1
- package/dist/es/editor/styles.js +6 -6
- package/dist/es/editor/toolbar/notify.js +1 -1
- package/dist/es/editor/toolbar/schema-io.js +1 -1
- package/dist/es/editor/toolbar/toolbar.js +175 -171
- package/dist/es/editor/use-editor-shortcuts.js +1 -1
- package/dist/es/editor/validation-summary.js +130 -48
- package/dist/es/engine/assert-never.js +1 -1
- package/dist/es/engine/conversion/index.js +1 -1
- package/dist/es/engine/data-source-params.js +1 -1
- package/dist/es/engine/ids.js +1 -1
- package/dist/es/engine/keys.js +1 -1
- package/dist/es/engine/linkage/cycle.js +1 -1
- package/dist/es/engine/linkage/default-evaluator.js +38 -27
- package/dist/es/engine/linkage/effects.js +1 -1
- package/dist/es/engine/linkage/evaluator.js +1 -1
- package/dist/es/engine/linkage/index.js +1 -1
- package/dist/es/engine/linkage/operators.js +20 -44
- package/dist/es/engine/linkage/scope.js +84 -0
- package/dist/es/engine/linkage/shape.js +1 -1
- package/dist/es/engine/linkage/source-tracking.js +19 -15
- package/dist/es/engine/linkage/taxonomy.js +1 -1
- package/dist/es/engine/linkage/validator.js +101 -81
- package/dist/es/engine/option-mapping.js +18 -0
- package/dist/es/engine/registry/defaults-mobile.js +1 -1
- package/dist/es/engine/registry/defaults.js +1 -1
- package/dist/es/engine/registry/form-field-registry.js +1 -1
- package/dist/es/engine/schema/column-type.js +1 -1
- package/dist/es/engine/schema/edit-ops.js +84 -83
- package/dist/es/engine/schema/mutate.js +1 -1
- package/dist/es/engine/schema/nodes.js +1 -1
- package/dist/es/engine/schema/permission-bridge.js +1 -1
- package/dist/es/engine/schema/presentation.js +1 -1
- package/dist/es/engine/schema/reconcile.js +55 -51
- package/dist/es/engine/schema/removal-impact.js +1 -1
- package/dist/es/engine/schema/rewrite.js +1 -1
- package/dist/es/engine/schema/validate.js +1 -1
- package/dist/es/engine/schema/walk.js +1 -1
- package/dist/es/engine/validation.js +8 -4
- package/dist/es/icons.js +1 -1
- package/dist/es/index.js +49 -48
- package/dist/es/render/chrome/mobile-chrome.js +1 -1
- package/dist/es/render/chrome/pc-chrome.js +1 -1
- package/dist/es/render/chrome/subform-shell.js +1 -1
- package/dist/es/render/data-source-context.js +44 -43
- package/dist/es/render/data-source-param-scope.js +1 -1
- package/dist/es/render/flex-style.js +1 -1
- package/dist/es/render/form-field.js +1 -1
- package/dist/es/render/form-renderer.js +184 -180
- package/dist/es/render/grid-style.js +1 -1
- package/dist/es/render/parts/field-shell.js +1 -1
- package/dist/es/render/parts/label.js +1 -1
- package/dist/es/render/parts/option-order.js +1 -1
- package/dist/es/render/parts/options-status.js +1 -1
- package/dist/es/render/stack-style.js +1 -1
- package/dist/es/render/subform-columns.js +1 -1
- package/dist/es/render/submit.js +1 -1
- package/dist/es/runtime/effects.js +1 -1
- package/dist/es/runtime/field-write.js +1 -1
- package/dist/es/runtime/resolve-scope-values.js +1 -1
- package/dist/es/runtime/runtime-context.js +1 -1
- package/dist/es/runtime/runtime-state-controller.js +1 -1
- package/dist/es/runtime/stabilize-state-map.js +1 -1
- package/dist/es/store/engine-provider.js +1 -1
- package/dist/es/store/form-store.js +1 -1
- package/dist/es/types/chrome.js +1 -1
- package/dist/es/types/component.js +1 -1
- package/dist/es/types/data-source.js +1 -1
- package/dist/es/types/dynamic-value.js +1 -1
- package/dist/es/types/index.js +1 -1
- package/dist/es/types/linkage.js +1 -1
- package/dist/es/types/properties.js +1 -1
- package/dist/es/types/schema.js +1 -1
- package/dist/types/editor/data-source-apis.d.ts +24 -0
- package/dist/types/editor/form-editor.d.ts +33 -9
- package/dist/types/editor/host-validation.d.ts +20 -0
- package/dist/types/editor/issue-location.d.ts +43 -0
- package/dist/types/editor/preview-runtime-context.d.ts +27 -2
- package/dist/types/editor/properties/entries/linkage/styles.d.ts +0 -1
- package/dist/types/editor/properties/option-editors.d.ts +1 -12
- package/dist/types/editor/properties/remote-option-source-editor.d.ts +15 -0
- package/dist/types/editor/properties/remote-request-editor.d.ts +70 -0
- package/dist/types/editor/properties/system-variables-panel.d.ts +8 -0
- package/dist/types/editor/styles.d.ts +2 -2
- package/dist/types/editor/validation-summary.d.ts +37 -14
- package/dist/types/engine/linkage/scope.d.ts +73 -0
- package/dist/types/engine/linkage/source-tracking.d.ts +3 -3
- package/dist/types/engine/option-mapping.d.ts +9 -0
- package/dist/types/engine/validation.d.ts +27 -8
- package/dist/types/index.d.ts +3 -1
- package/dist/types/render/form-renderer.d.ts +4 -3
- package/dist/types/types/data-source.d.ts +64 -0
- package/dist/types/types/linkage.d.ts +34 -16
- package/package.json +5 -5
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/*! @vef-framework-react/form-editor v2.25.0 made by Venus | 2026-10-13T08:58:25.850Z */
|
|
2
|
+
import { jsx as e } from "@emotion/react/jsx-runtime";
|
|
3
|
+
import { createContext as t, use as n } from "react";
|
|
4
|
+
//#region src/editor/host-validation.tsx
|
|
5
|
+
var r = t(void 0);
|
|
6
|
+
r.displayName = "HostValidationContext";
|
|
7
|
+
function i({ children: t, validate: n }) {
|
|
8
|
+
return /* @__PURE__ */ e(r, {
|
|
9
|
+
value: n,
|
|
10
|
+
children: t
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
function a() {
|
|
14
|
+
return n(r);
|
|
15
|
+
}
|
|
16
|
+
//#endregion
|
|
17
|
+
export { i as HostValidationProvider, a as useHostValidation };
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
/*! @vef-framework-react/form-editor v2.25.0 made by Venus | 2026-10-13T08:58:25.850Z */
|
|
2
|
+
import { findNode as e, nodeLabel as t, scopeEquals as n, walkNodes as r } from "../engine/schema/walk.js";
|
|
3
|
+
import { assertNever as i } from "../engine/assert-never.js";
|
|
4
|
+
import { isKeyedNode as a } from "../engine/keys.js";
|
|
5
|
+
import { useFormEditorStoreApi as o } from "../store/form-store.js";
|
|
6
|
+
import { useCallback as s } from "react";
|
|
7
|
+
//#region src/editor/issue-location.ts
|
|
8
|
+
var c = ["pc", "mobile"], l = /^(?<body>children|tabs|template)\[(?<index>\d+)\]$/, u = /^node\[(?<id>[^\]]+)\]$/, d = /* @__PURE__ */ new Set([
|
|
9
|
+
"",
|
|
10
|
+
"id",
|
|
11
|
+
"version",
|
|
12
|
+
"presentations"
|
|
13
|
+
]);
|
|
14
|
+
function f(e, t) {
|
|
15
|
+
if (e !== void 0) return t === "template" ? e.type === "subform" ? e.template : void 0 : "children" in e && Array.isArray(e.children) ? e.children : void 0;
|
|
16
|
+
}
|
|
17
|
+
function p(e, t) {
|
|
18
|
+
let n, r = e.children;
|
|
19
|
+
for (let e of t) {
|
|
20
|
+
let t = l.exec(e)?.groups;
|
|
21
|
+
if (t === void 0) break;
|
|
22
|
+
let i = Number(t.index);
|
|
23
|
+
if (t.body === "tabs") {
|
|
24
|
+
if (r = n?.type === "tabs" ? n.tabs[i]?.children : void 0, r === void 0) break;
|
|
25
|
+
continue;
|
|
26
|
+
}
|
|
27
|
+
let a = (r ?? f(n, t.body ?? ""))?.[i];
|
|
28
|
+
if (r = void 0, a === void 0) break;
|
|
29
|
+
n = a;
|
|
30
|
+
}
|
|
31
|
+
return n?.id;
|
|
32
|
+
}
|
|
33
|
+
function m(e, t) {
|
|
34
|
+
let i = t.at(-1), o = t.slice(0, -1), s;
|
|
35
|
+
return r(e, (e, t) => {
|
|
36
|
+
s === void 0 && a(e) && e.key === i && n(t, o) && (s = e.id);
|
|
37
|
+
}), s;
|
|
38
|
+
}
|
|
39
|
+
function h(e) {
|
|
40
|
+
return [e, ...c.filter((t) => t !== e)];
|
|
41
|
+
}
|
|
42
|
+
function g(e, t, n) {
|
|
43
|
+
for (let r of h(t)) {
|
|
44
|
+
let t = e.presentations[r], i = t === void 0 ? void 0 : n(t);
|
|
45
|
+
if (i !== void 0) return {
|
|
46
|
+
kind: "node",
|
|
47
|
+
device: r,
|
|
48
|
+
nodeId: i
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
function _(t, n, r) {
|
|
53
|
+
let i = t.split("."), [a = "", o] = i;
|
|
54
|
+
if (a === "presentations" && (o === "pc" || o === "mobile")) {
|
|
55
|
+
let e = n.presentations[o], t = e === void 0 ? void 0 : p(e, i.slice(2));
|
|
56
|
+
return t === void 0 ? void 0 : {
|
|
57
|
+
kind: "node",
|
|
58
|
+
device: o,
|
|
59
|
+
nodeId: t
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
let s = u.exec(a)?.groups?.id;
|
|
63
|
+
if (s !== void 0) return g(n, r, (t) => e(t, s)?.id);
|
|
64
|
+
if (a === "linkage" || a === "schema" && o === "linkage") return {
|
|
65
|
+
kind: "tab",
|
|
66
|
+
tab: "linkage"
|
|
67
|
+
};
|
|
68
|
+
if (/^dataSources(?:\[\d+\])?$/.test(a)) return {
|
|
69
|
+
kind: "tab",
|
|
70
|
+
tab: "dataSources"
|
|
71
|
+
};
|
|
72
|
+
if (/^variables(?:\[\d+\])?$/.test(a)) return {
|
|
73
|
+
kind: "tab",
|
|
74
|
+
tab: "variables"
|
|
75
|
+
};
|
|
76
|
+
if (!d.has(t)) return g(n, r, (e) => m(e, i));
|
|
77
|
+
}
|
|
78
|
+
function v(e) {
|
|
79
|
+
let t = /^[a-z]+\[(?<index>\d+)\]/i.exec(e)?.groups?.index;
|
|
80
|
+
return t === void 0 ? void 0 : Number(t);
|
|
81
|
+
}
|
|
82
|
+
function y(e, t, n) {
|
|
83
|
+
if (n === void 0) return e;
|
|
84
|
+
let r = t[n];
|
|
85
|
+
return r !== void 0 && r.length > 0 ? `${e}「${r}」` : `${e} #${n + 1}`;
|
|
86
|
+
}
|
|
87
|
+
function b(n, r, o) {
|
|
88
|
+
let s = _(n, r, o);
|
|
89
|
+
if (s !== void 0) {
|
|
90
|
+
if (s.kind === "node") {
|
|
91
|
+
let n = r.presentations[s.device], i = n === void 0 ? void 0 : e(n, s.nodeId), o = i === void 0 ? s.nodeId : t(i) ?? (a(i) ? i.key : i.id);
|
|
92
|
+
return s.device === "mobile" ? `移动端 · ${o}` : o;
|
|
93
|
+
}
|
|
94
|
+
switch (s.tab) {
|
|
95
|
+
case "dataSources": return y("数据源", (r.dataSources ?? []).map((e) => e.name), v(n));
|
|
96
|
+
case "variables": return y("变量", (r.variables ?? []).map((e) => e.name), v(n));
|
|
97
|
+
case "linkage": return "表单联动";
|
|
98
|
+
case "outline": return;
|
|
99
|
+
case "form": return;
|
|
100
|
+
default: return i(s.tab);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
function x(e, t) {
|
|
105
|
+
let n = e.getState();
|
|
106
|
+
if (t.kind === "tab") {
|
|
107
|
+
n.setFormConfigTab(t.tab);
|
|
108
|
+
return;
|
|
109
|
+
}
|
|
110
|
+
n.device !== t.device && n.setDevice(t.device), n.selectNode(t.nodeId);
|
|
111
|
+
}
|
|
112
|
+
function S() {
|
|
113
|
+
let e = o();
|
|
114
|
+
return s((t) => {
|
|
115
|
+
let { device: n, schema: r } = e.getState();
|
|
116
|
+
return b(t.path, r, n);
|
|
117
|
+
}, [e]);
|
|
118
|
+
}
|
|
119
|
+
function C() {
|
|
120
|
+
let e = o();
|
|
121
|
+
return s((t) => {
|
|
122
|
+
let { device: n, schema: r } = e.getState(), i = _(t.path, r, n);
|
|
123
|
+
return i === void 0 ? void 0 : () => x(e, i);
|
|
124
|
+
}, [e]);
|
|
125
|
+
}
|
|
126
|
+
//#endregion
|
|
127
|
+
export { b as describeIssueLocation, _ as locateIssue, S as useIssueDescriber, C as useIssueNavigator };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @vef-framework-react/form-editor v2.
|
|
1
|
+
/*! @vef-framework-react/form-editor v2.25.0 made by Venus | 2026-10-13T08:58:25.850Z */
|
|
2
2
|
import { EditorIcon as e } from "../../icons.js";
|
|
3
3
|
import { FIELD_GROUP_LABELS as t } from "./field-groups.js";
|
|
4
4
|
import { PaletteItem as n } from "./palette-item.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @vef-framework-react/form-editor v2.
|
|
1
|
+
/*! @vef-framework-react/form-editor v2.25.0 made by Venus | 2026-10-13T08:58:25.850Z */
|
|
2
2
|
import { EditorIcon as e } from "../../icons.js";
|
|
3
3
|
import { findNode as t, isContainerNode as n } from "../../engine/schema/walk.js";
|
|
4
4
|
import { currentLayer as r } from "../../engine/schema/presentation.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @vef-framework-react/form-editor v2.
|
|
1
|
+
/*! @vef-framework-react/form-editor v2.25.0 made by Venus | 2026-10-13T08:58:25.850Z */
|
|
2
2
|
import { EditorIcon as e } from "../../icons.js";
|
|
3
3
|
import { useFieldRegistry as t } from "../../store/engine-provider.js";
|
|
4
4
|
import { isPaletteVisible as n, useFormEditorStore as r } from "../../store/form-store.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @vef-framework-react/form-editor v2.
|
|
1
|
+
/*! @vef-framework-react/form-editor v2.25.0 made by Venus | 2026-10-13T08:58:25.850Z */
|
|
2
2
|
import { showErrorMessage as e, showInfoMessage as t, showSuccessMessage as n, showWarningMessage as r } from "@vef-framework-react/components";
|
|
3
3
|
//#region src/editor/preview-effects.ts
|
|
4
4
|
var i = {
|
|
@@ -1,25 +1,65 @@
|
|
|
1
|
-
/*! @vef-framework-react/form-editor v2.
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
/*! @vef-framework-react/form-editor v2.25.0 made by Venus | 2026-10-13T08:58:25.850Z */
|
|
2
|
+
import { withContextValues as e } from "../engine/linkage/scope.js";
|
|
3
|
+
import { useContextSources as t } from "./context-sources.js";
|
|
4
|
+
import { jsx as n } from "@emotion/react/jsx-runtime";
|
|
5
|
+
import { createContext as r, use as i, useCallback as a, useMemo as o, useState as s } from "react";
|
|
4
6
|
//#region src/editor/preview-runtime-context.tsx
|
|
5
|
-
var
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
7
|
+
var c = r({});
|
|
8
|
+
c.displayName = "PreviewRuntimeContext";
|
|
9
|
+
var l = r(null);
|
|
10
|
+
l.displayName = "PreviewSamplesContext";
|
|
11
|
+
var u = /* @__PURE__ */ new Map();
|
|
12
|
+
function d() {}
|
|
13
|
+
var f = {
|
|
14
|
+
samples: u,
|
|
15
|
+
setSample: d
|
|
16
|
+
};
|
|
17
|
+
function p(e) {
|
|
18
|
+
try {
|
|
19
|
+
return JSON.parse(e);
|
|
20
|
+
} catch {
|
|
21
|
+
return e;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
function m({ children: r, value: i }) {
|
|
25
|
+
let d = t(), [f, m] = s(u), h = a((e, t) => {
|
|
26
|
+
m((n) => {
|
|
27
|
+
if ((n.get(e) ?? "") === t) return n;
|
|
28
|
+
let r = new Map(n);
|
|
29
|
+
return t.length === 0 ? r.delete(e) : r.set(e, t), r;
|
|
30
|
+
});
|
|
31
|
+
}, []), g = o(() => e(i.evaluationContext, new Map(d.flatMap((e) => {
|
|
32
|
+
let t = f.get(e.key);
|
|
33
|
+
return t === void 0 ? [] : [[e.key, p(t)]];
|
|
34
|
+
}))), [
|
|
35
|
+
i.evaluationContext,
|
|
36
|
+
d,
|
|
37
|
+
f
|
|
38
|
+
]);
|
|
39
|
+
return /* @__PURE__ */ n(c, {
|
|
40
|
+
value: o(() => ({
|
|
41
|
+
dataSourceResolver: i.dataSourceResolver,
|
|
42
|
+
evaluators: i.evaluators,
|
|
43
|
+
evaluationContext: g
|
|
13
44
|
}), [
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
45
|
+
i.dataSourceResolver,
|
|
46
|
+
i.evaluators,
|
|
47
|
+
g
|
|
17
48
|
]),
|
|
18
|
-
children:
|
|
49
|
+
children: /* @__PURE__ */ n(l, {
|
|
50
|
+
value: o(() => ({
|
|
51
|
+
samples: f,
|
|
52
|
+
setSample: h
|
|
53
|
+
}), [f, h]),
|
|
54
|
+
children: r
|
|
55
|
+
})
|
|
19
56
|
});
|
|
20
57
|
}
|
|
21
|
-
function
|
|
22
|
-
return
|
|
58
|
+
function h() {
|
|
59
|
+
return i(c);
|
|
60
|
+
}
|
|
61
|
+
function g() {
|
|
62
|
+
return i(l) ?? f;
|
|
23
63
|
}
|
|
24
64
|
//#endregion
|
|
25
|
-
export {
|
|
65
|
+
export { m as PreviewRuntimeProvider, h as usePreviewRuntime, g as usePreviewSamples };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @vef-framework-react/form-editor v2.
|
|
1
|
+
/*! @vef-framework-react/form-editor v2.25.0 made by Venus | 2026-10-13T08:58:25.850Z */
|
|
2
2
|
import { useFormEditorStoreApi as e } from "../../store/form-store.js";
|
|
3
3
|
import { gridColumnCount as t } from "../../render/grid-style.js";
|
|
4
4
|
import { jsx as n, jsxs as r } from "@emotion/react/jsx-runtime";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @vef-framework-react/form-editor v2.
|
|
1
|
+
/*! @vef-framework-react/form-editor v2.25.0 made by Venus | 2026-10-13T08:58:25.850Z */
|
|
2
2
|
import { EditorIcon as e } from "../../icons.js";
|
|
3
3
|
import "../../types/schema.js";
|
|
4
4
|
import { createId as t } from "../../engine/ids.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @vef-framework-react/form-editor v2.
|
|
1
|
+
/*! @vef-framework-react/form-editor v2.25.0 made by Venus | 2026-10-13T08:58:25.850Z */
|
|
2
2
|
import { coerceToString as e } from "./entries/coerce.js";
|
|
3
3
|
import { ExpressionInput as t } from "./entries/linkage/expression-input.js";
|
|
4
4
|
import { codeEditorWrapperCss as n, valueEditorCss as r } from "./entries/linkage/styles.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @vef-framework-react/form-editor v2.
|
|
1
|
+
/*! @vef-framework-react/form-editor v2.25.0 made by Venus | 2026-10-13T08:58:25.850Z */
|
|
2
2
|
import { CheckboxEntry as e } from "./checkbox-entry.js";
|
|
3
3
|
import { IconEntry as t } from "./icon-entry.js";
|
|
4
4
|
import { KeyEntry as n } from "./key-entry.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @vef-framework-react/form-editor v2.
|
|
1
|
+
/*! @vef-framework-react/form-editor v2.25.0 made by Venus | 2026-10-13T08:58:25.850Z */
|
|
2
2
|
import { jsx as e, jsxs as t } from "@emotion/react/jsx-runtime";
|
|
3
3
|
import { css as n } from "@emotion/react";
|
|
4
4
|
import { Checkbox as r, globalCssVars as i } from "@vef-framework-react/components";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @vef-framework-react/form-editor v2.
|
|
1
|
+
/*! @vef-framework-react/form-editor v2.25.0 made by Venus | 2026-10-13T08:58:25.850Z */
|
|
2
2
|
import { isNullish as e, isString as t } from "@vef-framework-react/shared";
|
|
3
3
|
//#region src/editor/properties/entries/coerce.ts
|
|
4
4
|
function n(n) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @vef-framework-react/form-editor v2.
|
|
1
|
+
/*! @vef-framework-react/form-editor v2.25.0 made by Venus | 2026-10-13T08:58:25.850Z */
|
|
2
2
|
import { jsx as e, jsxs as t } from "@emotion/react/jsx-runtime";
|
|
3
3
|
import { css as n } from "@emotion/react";
|
|
4
4
|
import { globalCssVars as r } from "@vef-framework-react/components";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @vef-framework-react/form-editor v2.
|
|
1
|
+
/*! @vef-framework-react/form-editor v2.25.0 made by Venus | 2026-10-13T08:58:25.850Z */
|
|
2
2
|
import { EntryField as e } from "./entry-field.js";
|
|
3
3
|
import { jsx as t } from "@emotion/react/jsx-runtime";
|
|
4
4
|
import { IconPicker as n } from "@vef-framework-react/components";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @vef-framework-react/form-editor v2.
|
|
1
|
+
/*! @vef-framework-react/form-editor v2.25.0 made by Venus | 2026-10-13T08:58:25.850Z */
|
|
2
2
|
import { LinkageRulesEntry as e } from "./linkage/linkage-rules-entry.js";
|
|
3
3
|
import { CheckboxEntry as t } from "./checkbox-entry.js";
|
|
4
4
|
import { IconEntry as n } from "./icon-entry.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @vef-framework-react/form-editor v2.
|
|
1
|
+
/*! @vef-framework-react/form-editor v2.25.0 made by Venus | 2026-10-13T08:58:25.850Z */
|
|
2
2
|
import { coerceToString as e } from "./coerce.js";
|
|
3
3
|
import { EntryField as t } from "./entry-field.js";
|
|
4
4
|
import { jsx as n } from "@emotion/react/jsx-runtime";
|
|
@@ -1,23 +1,24 @@
|
|
|
1
|
-
/*! @vef-framework-react/form-editor v2.
|
|
1
|
+
/*! @vef-framework-react/form-editor v2.25.0 made by Venus | 2026-10-13T08:58:25.850Z */
|
|
2
2
|
import { EditorIcon as e } from "../../../../icons.js";
|
|
3
3
|
import { sanitizeKey as t } from "../../../../engine/keys.js";
|
|
4
4
|
import { isEffectAction as n } from "../../../../engine/linkage/taxonomy.js";
|
|
5
5
|
import { NO_COMPLETION_SETUP as r } from "./expression-input.js";
|
|
6
|
-
import { actionCardCss as i, actionDeleteCss as a, actionHeaderCss as o, actionRetriggerCss as s, actionRetriggerLabelCss as c,
|
|
7
|
-
import { DynamicValueEditor as
|
|
6
|
+
import { actionCardCss as i, actionDeleteCss as a, actionHeaderCss as o, actionRetriggerCss as s, actionRetriggerLabelCss as c, codeEditorWrapperCss as l, defaultHintCss as u, defaultTextCss as d, selectStyle as f } from "./styles.js";
|
|
7
|
+
import { DynamicValueEditor as p } from "../../dynamic-value-editor.js";
|
|
8
|
+
import { RemoteRequestEditor as m } from "../../remote-request-editor.js";
|
|
8
9
|
import { createActionFor as h } from "./mutators.js";
|
|
9
10
|
import { alertLevelOptions as g, isLinkageActionType as _ } from "./options.js";
|
|
10
11
|
import { Fragment as v, jsx as y, jsxs as b } from "@emotion/react/jsx-runtime";
|
|
11
12
|
import { Button as x, CodeEditor as S, Input as C, Select as w, Switch as T } from "@vef-framework-react/components";
|
|
12
13
|
//#region src/editor/properties/entries/linkage/action-editor.tsx
|
|
13
|
-
var E = ({ action: t, availableActions: r, canRemove: l, dataSourceOptions:
|
|
14
|
+
var E = ({ action: t, availableActions: r, canRemove: l, dataSourceOptions: p, isConditionTrigger: m, targetOptions: g, onChange: v, onRemove: S }) => /* @__PURE__ */ b("div", {
|
|
14
15
|
css: i,
|
|
15
16
|
children: [
|
|
16
17
|
/* @__PURE__ */ b("div", {
|
|
17
18
|
css: o,
|
|
18
19
|
children: [/* @__PURE__ */ y(w, {
|
|
19
20
|
options: r,
|
|
20
|
-
style:
|
|
21
|
+
style: f,
|
|
21
22
|
value: t.type,
|
|
22
23
|
onChange: (e) => {
|
|
23
24
|
if (!_(e)) return;
|
|
@@ -38,19 +39,19 @@ var E = ({ action: t, availableActions: r, canRemove: l, dataSourceOptions: u, i
|
|
|
38
39
|
}),
|
|
39
40
|
/* @__PURE__ */ y(D, {
|
|
40
41
|
action: t,
|
|
41
|
-
dataSourceOptions:
|
|
42
|
+
dataSourceOptions: p,
|
|
42
43
|
targetOptions: g,
|
|
43
44
|
onChange: v
|
|
44
45
|
}),
|
|
45
46
|
m && n(t) && /* @__PURE__ */ b("div", {
|
|
46
47
|
css: s,
|
|
47
48
|
children: [/* @__PURE__ */ b("div", {
|
|
48
|
-
css:
|
|
49
|
+
css: d,
|
|
49
50
|
children: [/* @__PURE__ */ y("span", {
|
|
50
51
|
css: c,
|
|
51
52
|
children: "重复触发"
|
|
52
53
|
}), /* @__PURE__ */ y("span", {
|
|
53
|
-
css:
|
|
54
|
+
css: u,
|
|
54
55
|
children: "条件持续满足期间,依赖字段每次变化都重新触发;关闭(默认)则仅在条件首次满足时触发一次。"
|
|
55
56
|
})]
|
|
56
57
|
}), /* @__PURE__ */ y(T, {
|
|
@@ -74,7 +75,7 @@ var E = ({ action: t, availableActions: r, canRemove: l, dataSourceOptions: u, i
|
|
|
74
75
|
});
|
|
75
76
|
function D({ action: e, dataSourceOptions: n, targetOptions: i, onChange: a }) {
|
|
76
77
|
switch (e.type) {
|
|
77
|
-
case "assign": return /* @__PURE__ */ y(
|
|
78
|
+
case "assign": return /* @__PURE__ */ y(p, {
|
|
78
79
|
expressionPlaceholder: "field.A + field.B",
|
|
79
80
|
literalPlaceholder: "赋值内容",
|
|
80
81
|
value: e.value,
|
|
@@ -86,13 +87,13 @@ function D({ action: e, dataSourceOptions: n, targetOptions: i, onChange: a }) {
|
|
|
86
87
|
case "set_field": return /* @__PURE__ */ b(v, { children: [/* @__PURE__ */ y(w, {
|
|
87
88
|
options: i,
|
|
88
89
|
placeholder: "选择目标字段",
|
|
89
|
-
style:
|
|
90
|
+
style: f,
|
|
90
91
|
value: e.targetKey.length > 0 ? e.targetKey : void 0,
|
|
91
92
|
onChange: (t) => a({
|
|
92
93
|
...e,
|
|
93
94
|
targetKey: String(t)
|
|
94
95
|
})
|
|
95
|
-
}), /* @__PURE__ */ y(
|
|
96
|
+
}), /* @__PURE__ */ y(p, {
|
|
96
97
|
expressionPlaceholder: "field.A",
|
|
97
98
|
literalPlaceholder: "写入的值",
|
|
98
99
|
value: e.value,
|
|
@@ -108,7 +109,7 @@ function D({ action: e, dataSourceOptions: n, targetOptions: i, onChange: a }) {
|
|
|
108
109
|
...e,
|
|
109
110
|
variable: t(n.target.value)
|
|
110
111
|
})
|
|
111
|
-
}), /* @__PURE__ */ y(
|
|
112
|
+
}), /* @__PURE__ */ y(p, {
|
|
112
113
|
expressionPlaceholder: "$vars.count + 1",
|
|
113
114
|
literalPlaceholder: "写入的值",
|
|
114
115
|
value: e.value,
|
|
@@ -121,7 +122,7 @@ function D({ action: e, dataSourceOptions: n, targetOptions: i, onChange: a }) {
|
|
|
121
122
|
notFoundContent: "请先在表单「数据源」中创建",
|
|
122
123
|
options: n,
|
|
123
124
|
placeholder: "选择数据源",
|
|
124
|
-
style:
|
|
125
|
+
style: f,
|
|
125
126
|
value: e.dataSourceId.length > 0 ? e.dataSourceId : void 0,
|
|
126
127
|
onChange: (t) => a({
|
|
127
128
|
...e,
|
|
@@ -130,13 +131,13 @@ function D({ action: e, dataSourceOptions: n, targetOptions: i, onChange: a }) {
|
|
|
130
131
|
});
|
|
131
132
|
case "alert": return /* @__PURE__ */ b(v, { children: [/* @__PURE__ */ y(w, {
|
|
132
133
|
options: g,
|
|
133
|
-
style:
|
|
134
|
+
style: f,
|
|
134
135
|
value: e.level ?? "info",
|
|
135
136
|
onChange: (t) => a({
|
|
136
137
|
...e,
|
|
137
138
|
level: O(t)
|
|
138
139
|
})
|
|
139
|
-
}), /* @__PURE__ */ y(
|
|
140
|
+
}), /* @__PURE__ */ y(p, {
|
|
140
141
|
expressionPlaceholder: "field.name + ' 已保存'",
|
|
141
142
|
literalPlaceholder: "提示内容",
|
|
142
143
|
value: e.message,
|
|
@@ -145,7 +146,7 @@ function D({ action: e, dataSourceOptions: n, targetOptions: i, onChange: a }) {
|
|
|
145
146
|
message: t
|
|
146
147
|
})
|
|
147
148
|
})] });
|
|
148
|
-
case "navigate": return /* @__PURE__ */ y(
|
|
149
|
+
case "navigate": return /* @__PURE__ */ y(p, {
|
|
149
150
|
expressionPlaceholder: "'/orders/' + field.id",
|
|
150
151
|
literalPlaceholder: "目标路径,如 /orders",
|
|
151
152
|
value: e.to,
|
|
@@ -154,32 +155,15 @@ function D({ action: e, dataSourceOptions: n, targetOptions: i, onChange: a }) {
|
|
|
154
155
|
to: t
|
|
155
156
|
})
|
|
156
157
|
});
|
|
157
|
-
case "api_call": return /* @__PURE__ */
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
...e,
|
|
164
|
-
request: {
|
|
165
|
-
...e.request,
|
|
166
|
-
resource: t.target.value
|
|
167
|
-
}
|
|
168
|
-
})
|
|
169
|
-
}), /* @__PURE__ */ y(C, {
|
|
170
|
-
placeholder: "动作 (action)",
|
|
171
|
-
value: e.request.action,
|
|
172
|
-
onChange: (t) => a({
|
|
173
|
-
...e,
|
|
174
|
-
request: {
|
|
175
|
-
...e.request,
|
|
176
|
-
action: t.target.value
|
|
177
|
-
}
|
|
178
|
-
})
|
|
179
|
-
})]
|
|
158
|
+
case "api_call": return /* @__PURE__ */ y(m, {
|
|
159
|
+
request: e.request,
|
|
160
|
+
onChange: (t) => a({
|
|
161
|
+
...e,
|
|
162
|
+
request: t
|
|
163
|
+
})
|
|
180
164
|
});
|
|
181
165
|
case "script": return /* @__PURE__ */ y("div", {
|
|
182
|
-
css:
|
|
166
|
+
css: l,
|
|
183
167
|
children: /* @__PURE__ */ y(S, {
|
|
184
168
|
showLineNumbers: !0,
|
|
185
169
|
basicSetupOptions: r,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @vef-framework-react/form-editor v2.
|
|
1
|
+
/*! @vef-framework-react/form-editor v2.25.0 made by Venus | 2026-10-13T08:58:25.850Z */
|
|
2
2
|
import { EditorIcon as e } from "../../../../icons.js";
|
|
3
3
|
import { actionsListCss as t, addInlineButtonCss as n, sectionCss as r, sectionLabelCss as i } from "./styles.js";
|
|
4
4
|
import { createActionFor as a } from "./mutators.js";
|