@vef-framework-react/form-editor 2.9.0 → 2.10.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.
Files changed (217) hide show
  1. package/dist/cjs/editor/canvas/canvas-field.cjs +1 -1
  2. package/dist/cjs/editor/canvas/canvas.cjs +1 -1
  3. package/dist/cjs/editor/canvas/container-drag-chip.cjs +1 -0
  4. package/dist/cjs/editor/canvas/use-scroll-selection-into-view.cjs +1 -0
  5. package/dist/cjs/editor/dnd.cjs +1 -1
  6. package/dist/cjs/editor/form-editor.cjs +1 -1
  7. package/dist/cjs/editor/properties/block-layout-section.cjs +1 -1
  8. package/dist/cjs/editor/properties/option-editors.cjs +1 -1
  9. package/dist/cjs/editor/properties/properties-panel.cjs +1 -1
  10. package/dist/cjs/engine/linkage/evaluator.cjs +1 -1
  11. package/dist/cjs/engine/linkage/index.cjs +1 -1
  12. package/dist/cjs/engine/linkage/operators.cjs +1 -1
  13. package/dist/cjs/engine/schema/edit-ops.cjs +1 -1
  14. package/dist/cjs/engine/schema/validate.cjs +1 -1
  15. package/dist/cjs/engine/validation.cjs +1 -1
  16. package/dist/cjs/index.cjs +1 -1
  17. package/dist/cjs/render/form-renderer.cjs +1 -1
  18. package/dist/cjs/render/stack-style.cjs +1 -1
  19. package/dist/cjs/render/submit.cjs +1 -1
  20. package/dist/cjs/runtime/effects.cjs +1 -1
  21. package/dist/cjs/runtime/field-write.cjs +1 -0
  22. package/dist/cjs/runtime/runtime-state-controller.cjs +1 -1
  23. package/dist/cjs/store/form-store.cjs +1 -1
  24. package/dist/es/components/button/index.js +1 -1
  25. package/dist/es/components/checkbox-group-field/index.js +1 -1
  26. package/dist/es/components/code-editor/code-editor-input.js +1 -1
  27. package/dist/es/components/code-editor/index.js +1 -1
  28. package/dist/es/components/containers/index.js +1 -1
  29. package/dist/es/components/date-field/index.js +1 -1
  30. package/dist/es/components/display/index.js +1 -1
  31. package/dist/es/components/field-entries.js +1 -1
  32. package/dist/es/components/mobile/alert-block.js +1 -1
  33. package/dist/es/components/mobile/button.js +1 -1
  34. package/dist/es/components/mobile/checkbox-group.js +1 -1
  35. package/dist/es/components/mobile/date-adapters.js +1 -1
  36. package/dist/es/components/mobile/date.js +1 -1
  37. package/dist/es/components/mobile/daterange.js +1 -1
  38. package/dist/es/components/mobile/datetime.js +1 -1
  39. package/dist/es/components/mobile/definitions.js +1 -1
  40. package/dist/es/components/mobile/divider.js +1 -1
  41. package/dist/es/components/mobile/input-cell.js +1 -1
  42. package/dist/es/components/mobile/number.js +1 -1
  43. package/dist/es/components/mobile/option-group.js +1 -1
  44. package/dist/es/components/mobile/paragraph.js +1 -1
  45. package/dist/es/components/mobile/picker-trigger.js +1 -1
  46. package/dist/es/components/mobile/radio.js +1 -1
  47. package/dist/es/components/mobile/scope.js +1 -1
  48. package/dist/es/components/mobile/select.js +1 -1
  49. package/dist/es/components/mobile/switch.js +1 -1
  50. package/dist/es/components/mobile/textarea.js +1 -1
  51. package/dist/es/components/mobile/textfield.js +1 -1
  52. package/dist/es/components/mobile/theme.js +1 -1
  53. package/dist/es/components/number-field/index.js +1 -1
  54. package/dist/es/components/radio-field/index.js +1 -1
  55. package/dist/es/components/select-field/index.js +1 -1
  56. package/dist/es/components/switch-field/index.js +1 -1
  57. package/dist/es/components/textarea-field/index.js +1 -1
  58. package/dist/es/components/textfield/index.js +1 -1
  59. package/dist/es/editor/canvas/canvas-field.js +95 -93
  60. package/dist/es/editor/canvas/canvas.js +242 -235
  61. package/dist/es/editor/canvas/container-drag-chip.js +91 -0
  62. package/dist/es/editor/canvas/drop-indicator.js +1 -1
  63. package/dist/es/editor/canvas/drop-zones.js +1 -1
  64. package/dist/es/editor/canvas/json-split-view.js +1 -1
  65. package/dist/es/editor/canvas/mobile-seed-state.js +1 -1
  66. package/dist/es/editor/canvas/phone-frame.js +1 -1
  67. package/dist/es/editor/canvas/subform-column-eligibility.js +1 -1
  68. package/dist/es/editor/canvas/subform-table-cell.js +1 -1
  69. package/dist/es/editor/canvas/use-scroll-selection-into-view.js +15 -0
  70. package/dist/es/editor/context-sources.js +1 -1
  71. package/dist/es/editor/dnd.js +7 -4
  72. package/dist/es/editor/editor-layout-context.js +1 -1
  73. package/dist/es/editor/footer/footer.js +1 -1
  74. package/dist/es/editor/form-config/form-basics-tab.js +1 -1
  75. package/dist/es/editor/form-config/form-config-drawer.js +1 -1
  76. package/dist/es/editor/form-config/linkage-overview.js +1 -1
  77. package/dist/es/editor/form-config/outline-tab.js +1 -1
  78. package/dist/es/editor/form-editor.js +104 -93
  79. package/dist/es/editor/palette/field-groups.js +1 -1
  80. package/dist/es/editor/palette/palette-group.js +1 -1
  81. package/dist/es/editor/palette/palette-item.js +1 -1
  82. package/dist/es/editor/palette/palette-panel.js +1 -1
  83. package/dist/es/editor/preview-effects.js +1 -1
  84. package/dist/es/editor/preview-runtime-context.js +1 -1
  85. package/dist/es/editor/properties/block-layout-section.js +156 -49
  86. package/dist/es/editor/properties/container-properties.js +1 -1
  87. package/dist/es/editor/properties/entries/built-ins.js +1 -1
  88. package/dist/es/editor/properties/entries/checkbox-entry.js +1 -1
  89. package/dist/es/editor/properties/entries/coerce.js +1 -1
  90. package/dist/es/editor/properties/entries/entry-field.js +1 -1
  91. package/dist/es/editor/properties/entries/icon-entry.js +1 -1
  92. package/dist/es/editor/properties/entries/index.js +1 -1
  93. package/dist/es/editor/properties/entries/key-entry.js +1 -1
  94. package/dist/es/editor/properties/entries/linkage/action-editor.js +1 -1
  95. package/dist/es/editor/properties/entries/linkage/actions-editor.js +1 -1
  96. package/dist/es/editor/properties/entries/linkage/condition-editor.js +1 -1
  97. package/dist/es/editor/properties/entries/linkage/container-linkage-section.js +1 -1
  98. package/dist/es/editor/properties/entries/linkage/expression-input.js +1 -1
  99. package/dist/es/editor/properties/entries/linkage/index.js +1 -1
  100. package/dist/es/editor/properties/entries/linkage/linkage-rules-entry.js +1 -1
  101. package/dist/es/editor/properties/entries/linkage/mutators.js +1 -1
  102. package/dist/es/editor/properties/entries/linkage/options.js +1 -1
  103. package/dist/es/editor/properties/entries/linkage/rule-diagnostics.js +1 -1
  104. package/dist/es/editor/properties/entries/linkage/rule-list-editor.js +1 -1
  105. package/dist/es/editor/properties/entries/linkage/styles.js +1 -1
  106. package/dist/es/editor/properties/entries/linkage/trigger-editor.js +1 -1
  107. package/dist/es/editor/properties/entries/linkage/use-linkage-editor-model.js +1 -1
  108. package/dist/es/editor/properties/entries/linkage/use-stable-options.js +1 -1
  109. package/dist/es/editor/properties/entries/number-entry.js +1 -1
  110. package/dist/es/editor/properties/entries/options-source/index.js +1 -1
  111. package/dist/es/editor/properties/entries/options-source/source-mutators.js +1 -1
  112. package/dist/es/editor/properties/entries/select-entry.js +1 -1
  113. package/dist/es/editor/properties/entries/text-entry.js +1 -1
  114. package/dist/es/editor/properties/form-data-sources-panel.js +1 -1
  115. package/dist/es/editor/properties/form-linkage-panel.js +1 -1
  116. package/dist/es/editor/properties/form-variables-panel.js +1 -1
  117. package/dist/es/editor/properties/option-editors.js +142 -86
  118. package/dist/es/editor/properties/panel-header.js +1 -1
  119. package/dist/es/editor/properties/properties-empty.js +1 -1
  120. package/dist/es/editor/properties/properties-header.js +1 -1
  121. package/dist/es/editor/properties/properties-panel.js +18 -18
  122. package/dist/es/editor/properties/properties-provider.js +1 -1
  123. package/dist/es/editor/properties/properties-tabs.js +1 -1
  124. package/dist/es/editor/properties/use-confirmable-kind-switch.js +1 -1
  125. package/dist/es/editor/remove-node-confirm.js +1 -1
  126. package/dist/es/editor/schema-apply.js +1 -1
  127. package/dist/es/editor/styles.js +1 -1
  128. package/dist/es/editor/toolbar/notify.js +1 -1
  129. package/dist/es/editor/toolbar/schema-io.js +1 -1
  130. package/dist/es/editor/toolbar/toolbar.js +1 -1
  131. package/dist/es/editor/use-editor-shortcuts.js +1 -1
  132. package/dist/es/editor/validation-summary.js +1 -1
  133. package/dist/es/engine/assert-never.js +1 -1
  134. package/dist/es/engine/conversion/index.js +1 -1
  135. package/dist/es/engine/ids.js +1 -1
  136. package/dist/es/engine/keys.js +1 -1
  137. package/dist/es/engine/linkage/cycle.js +1 -1
  138. package/dist/es/engine/linkage/default-evaluator.js +1 -1
  139. package/dist/es/engine/linkage/effects.js +1 -1
  140. package/dist/es/engine/linkage/evaluator.js +58 -40
  141. package/dist/es/engine/linkage/index.js +6 -6
  142. package/dist/es/engine/linkage/operators.js +2 -2
  143. package/dist/es/engine/linkage/source-tracking.js +1 -1
  144. package/dist/es/engine/linkage/taxonomy.js +1 -1
  145. package/dist/es/engine/linkage/validator.js +1 -1
  146. package/dist/es/engine/registry/defaults-mobile.js +1 -1
  147. package/dist/es/engine/registry/defaults.js +1 -1
  148. package/dist/es/engine/registry/form-field-registry.js +1 -1
  149. package/dist/es/engine/schema/column-type.js +1 -1
  150. package/dist/es/engine/schema/edit-ops.js +79 -58
  151. package/dist/es/engine/schema/mutate.js +1 -1
  152. package/dist/es/engine/schema/nodes.js +1 -1
  153. package/dist/es/engine/schema/permission-bridge.js +1 -1
  154. package/dist/es/engine/schema/presentation.js +1 -1
  155. package/dist/es/engine/schema/reconcile.js +1 -1
  156. package/dist/es/engine/schema/removal-impact.js +1 -1
  157. package/dist/es/engine/schema/rewrite.js +1 -1
  158. package/dist/es/engine/schema/validate.js +25 -3
  159. package/dist/es/engine/schema/walk.js +1 -1
  160. package/dist/es/engine/validation.js +2 -1
  161. package/dist/es/icons.js +1 -1
  162. package/dist/es/index.js +20 -19
  163. package/dist/es/render/chrome/mobile-chrome.js +1 -1
  164. package/dist/es/render/chrome/pc-chrome.js +1 -1
  165. package/dist/es/render/chrome/subform-shell.js +1 -1
  166. package/dist/es/render/data-source-context.js +0 -0
  167. package/dist/es/render/flex-style.js +1 -1
  168. package/dist/es/render/form-field.js +1 -1
  169. package/dist/es/render/form-renderer.js +269 -236
  170. package/dist/es/render/grid-style.js +1 -1
  171. package/dist/es/render/parts/field-shell.js +1 -1
  172. package/dist/es/render/parts/label.js +1 -1
  173. package/dist/es/render/parts/options-status.js +1 -1
  174. package/dist/es/render/stack-style.js +18 -2
  175. package/dist/es/render/subform-columns.js +1 -1
  176. package/dist/es/render/submit.js +44 -32
  177. package/dist/es/runtime/effects.js +56 -50
  178. package/dist/es/runtime/field-write.js +17 -0
  179. package/dist/es/runtime/resolve-scope-values.js +1 -1
  180. package/dist/es/runtime/runtime-context.js +1 -1
  181. package/dist/es/runtime/runtime-state-controller.js +70 -63
  182. package/dist/es/runtime/stabilize-state-map.js +1 -1
  183. package/dist/es/store/engine-provider.js +1 -1
  184. package/dist/es/store/form-store.js +68 -61
  185. package/dist/es/types/chrome.js +1 -1
  186. package/dist/es/types/component.js +1 -1
  187. package/dist/es/types/data-source.js +1 -1
  188. package/dist/es/types/index.js +1 -1
  189. package/dist/es/types/linkage.js +1 -1
  190. package/dist/es/types/properties.js +1 -1
  191. package/dist/es/types/schema.js +1 -1
  192. package/dist/types/editor/canvas/container-drag-chip.d.ts +12 -0
  193. package/dist/types/editor/canvas/container-drag-chip.test.d.ts +1 -0
  194. package/dist/types/editor/canvas/use-scroll-selection-into-view.d.ts +21 -0
  195. package/dist/types/editor/canvas/use-scroll-selection-into-view.test.d.ts +1 -0
  196. package/dist/types/editor/dnd.d.ts +21 -1
  197. package/dist/types/editor/properties/block-layout-section.d.ts +6 -5
  198. package/dist/types/editor/properties/block-layout-section.test.d.ts +1 -0
  199. package/dist/types/editor/properties/option-editors.d.ts +13 -0
  200. package/dist/types/editor/properties/properties-panel.d.ts +2 -2
  201. package/dist/types/engine/linkage/evaluator.d.ts +25 -1
  202. package/dist/types/engine/linkage/index.d.ts +1 -1
  203. package/dist/types/engine/linkage/operators.d.ts +13 -5
  204. package/dist/types/engine/schema/edit-ops.d.ts +12 -1
  205. package/dist/types/engine/validation.d.ts +1 -1
  206. package/dist/types/index.d.ts +1 -1
  207. package/dist/types/render/form-renderer.d.ts +27 -1
  208. package/dist/types/render/form-renderer.field-permissions.test.d.ts +1 -0
  209. package/dist/types/render/stack-style.d.ts +14 -1
  210. package/dist/types/render/submit.d.ts +26 -4
  211. package/dist/types/runtime/effects.d.ts +11 -1
  212. package/dist/types/runtime/field-write.d.ts +37 -0
  213. package/dist/types/runtime/runtime-state-controller.d.ts +3 -2
  214. package/dist/types/store/form-store.d.ts +9 -1
  215. package/dist/types/types/linkage.d.ts +16 -0
  216. package/dist/types/types/schema.d.ts +33 -0
  217. package/package.json +5 -5
@@ -1,4 +1,4 @@
1
- /*! @vef-framework-react/form-editor v2.9.0 made by Venus | 2026-07-07T06:22:20.341Z */
1
+ /*! @vef-framework-react/form-editor v2.10.0 made by Venus | 2026-07-13T07:28:24.093Z */
2
2
  import "../types/schema.js";
3
3
  function e(e) {
4
4
  let t = e.columns ?? 2;
@@ -1,4 +1,4 @@
1
- /*! @vef-framework-react/form-editor v2.9.0 made by Venus | 2026-07-07T06:22:20.341Z */
1
+ /*! @vef-framework-react/form-editor v2.10.0 made by Venus | 2026-07-13T07:28:24.093Z */
2
2
  import { Label as e } from "./label.js";
3
3
  import { Fragment as t, jsx as n, jsxs as r } from "@emotion/react/jsx-runtime";
4
4
  import { css as i } from "@emotion/react";
@@ -1,4 +1,4 @@
1
- /*! @vef-framework-react/form-editor v2.9.0 made by Venus | 2026-07-07T06:22:20.341Z */
1
+ /*! @vef-framework-react/form-editor v2.10.0 made by Venus | 2026-07-13T07:28:24.093Z */
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.9.0 made by Venus | 2026-07-07T06:22:20.341Z */
1
+ /*! @vef-framework-react/form-editor v2.10.0 made by Venus | 2026-07-13T07:28:24.093Z */
2
2
  import { errorTextCss as e, helperTextCss as t } from "./field-shell.js";
3
3
  import { jsx as n } from "@emotion/react/jsx-runtime";
4
4
  //#region src/render/parts/options-status.tsx
@@ -1,4 +1,4 @@
1
- /*! @vef-framework-react/form-editor v2.9.0 made by Venus | 2026-07-07T06:22:20.341Z */
1
+ /*! @vef-framework-react/form-editor v2.10.0 made by Venus | 2026-07-13T07:28:24.093Z */
2
2
  import { DEFAULT_GAP_SCALE as e } from "../types/schema.js";
3
3
  //#region src/render/stack-style.ts
4
4
  var t = {
@@ -9,5 +9,21 @@ var t = {
9
9
  function r(e, n) {
10
10
  return e === void 0 ? n : t[e];
11
11
  }
12
+ var i = {
13
+ start: { marginInlineEnd: "auto" },
14
+ center: { marginInline: "auto" },
15
+ end: { marginInlineStart: "auto" }
16
+ };
17
+ function a(e) {
18
+ return e === void 0 ? void 0 : `${e.value}${e.unit}`;
19
+ }
20
+ function o(e) {
21
+ return {
22
+ width: e.width === void 0 ? "100%" : a(e.width),
23
+ minWidth: a(e.minWidth),
24
+ maxWidth: a(e.maxWidth),
25
+ ...e.align !== void 0 && i[e.align]
26
+ };
27
+ }
12
28
  //#endregion
13
- export { n as DEFAULT_STACK_GAP, t as GAP_SCALE_PX, r as resolveStackGap };
29
+ export { n as DEFAULT_STACK_GAP, t as GAP_SCALE_PX, r as resolveStackGap, o as stackSlotStyle };
@@ -1,4 +1,4 @@
1
- /*! @vef-framework-react/form-editor v2.9.0 made by Venus | 2026-07-07T06:22:20.341Z */
1
+ /*! @vef-framework-react/form-editor v2.10.0 made by Venus | 2026-07-13T07:28:24.093Z */
2
2
  import { isContainerNode as e } from "../engine/schema/walk.js";
3
3
  import { isKeyedField as t, isValidatableField as n } from "../engine/keys.js";
4
4
  import { validateKeyedFieldValue as r } from "./submit.js";
@@ -1,12 +1,13 @@
1
- /*! @vef-framework-react/form-editor v2.9.0 made by Venus | 2026-07-07T06:22:20.341Z */
1
+ /*! @vef-framework-react/form-editor v2.10.0 made by Venus | 2026-07-13T07:28:24.093Z */
2
2
  import { containerBodies as e } from "../engine/schema/nodes.js";
3
3
  import { isContainerNode as t, walkNodes as n } from "../engine/schema/walk.js";
4
4
  import { isKeyedNode as r, isValidatableField as i } from "../engine/keys.js";
5
5
  import { isEmptyRuntimeValue as a } from "../engine/linkage/operators.js";
6
- import { deriveDefaultValues as o, evaluateLinkage as s } from "../engine/linkage/evaluator.js";
7
- import { resolveScopeValues as c } from "../runtime/resolve-scope-values.js";
6
+ import { deriveDefaultValues as o, evaluateLinkage as s, getFieldPermission as c, isWritableFieldPermission as l } from "../engine/linkage/evaluator.js";
7
+ import { resolveScopeValues as u } from "../runtime/resolve-scope-values.js";
8
8
  //#region src/render/submit.ts
9
- function l(n, i, a, o) {
9
+ var d = "此项为必填";
10
+ function f(n, i, a, o) {
10
11
  function c(n, l, u) {
11
12
  for (let d of n) {
12
13
  let n = s(d, i, a), f = l || n.hidden, p = u || n.disabled;
@@ -19,85 +20,96 @@ function l(n, i, a, o) {
19
20
  }
20
21
  c(n, !1, !1);
21
22
  }
22
- function u(e) {
23
+ function p(e) {
23
24
  let t = {
24
25
  evaluators: e.evaluators,
25
- evaluationContext: e.evaluationContext
26
+ evaluationContext: e.evaluationContext,
27
+ fieldPermissions: e.fieldPermissions
26
28
  }, n = {};
27
- return l(e.blocks, e.values, t, (t, r) => {
28
- if (!r.hidden) if (t.type === "subform") {
29
+ return f(e.blocks, e.values, t, (t, r) => {
30
+ if (!r.hidden && l(c(e.fieldPermissions, t.key))) if (t.type === "subform") {
29
31
  let r = e.values[t.key], i = Array.isArray(r) ? r : [];
30
- n[t.key] = i.map((n) => u({
32
+ n[t.key] = i.map((n) => p({
31
33
  blocks: t.template,
32
34
  evaluators: e.evaluators,
33
35
  evaluationContext: e.evaluationContext,
34
- values: b(n)
36
+ values: C(n)
35
37
  }));
36
38
  } else n[t.key] = e.values[t.key];
37
39
  }), n;
38
40
  }
39
- function d(e) {
41
+ function m(e) {
40
42
  let t = {};
41
43
  if (e.disabled) return t;
42
44
  let n = {
43
45
  evaluators: e.evaluators,
44
- evaluationContext: e.evaluationContext
46
+ evaluationContext: e.evaluationContext,
47
+ fieldPermissions: e.fieldPermissions
45
48
  };
46
- return f(e.blocks, e.values, e.namePrefix, n, t), t;
49
+ return h(e.blocks, e.values, e.namePrefix, n, t), t;
47
50
  }
48
- function f(e, t, n, r, i) {
49
- l(e, t, r, (e, a) => {
51
+ function h(e, t, n, r, i) {
52
+ f(e, t, r, (e, a) => {
50
53
  if (a.hidden || a.disabled) return;
51
54
  if (e.type === "subform") {
52
- let a = t[e.key], o = Array.isArray(a) ? a : [];
53
- for (let [t, a] of o.entries()) f(e.template, b(a), `${n}${e.key}[${t}].`, r, i);
55
+ let o = t[e.key], s = Array.isArray(o) ? o : [];
56
+ if (a.own.required && s.length === 0) {
57
+ i[`${n}${e.key}`] = d;
58
+ return;
59
+ }
60
+ let c = {
61
+ ...r,
62
+ fieldPermissions: void 0
63
+ };
64
+ for (let [t, r] of s.entries()) h(e.template, C(r), `${n}${e.key}[${t}].`, c, i);
54
65
  return;
55
66
  }
56
- let o = m(e, h(e, a.own), t[e.key]);
67
+ let o = _(e, v(e, a.own), t[e.key]);
57
68
  o !== void 0 && (i[`${n}${e.key}`] = o);
58
69
  });
59
70
  }
60
- function p(e) {
71
+ function g(e) {
61
72
  if (e.disabled) return;
62
- let t = c(e.values, e.namePrefix), n = s(e.field, t, {
73
+ let t = u(e.values, e.namePrefix), n = s(e.field, t, {
63
74
  evaluators: e.evaluators,
64
- evaluationContext: e.evaluationContext
75
+ evaluationContext: e.evaluationContext,
76
+ fieldPermissions: e.fieldPermissions
65
77
  });
66
- if (!(n.hidden || n.disabled)) return m(e.field, h(e.field, n), e.value);
78
+ if (!(n.hidden || n.disabled)) return _(e.field, v(e.field, n), e.value);
67
79
  }
68
- function m(e, t, n) {
69
- return t && a(n) ? "此项为必填" : a(n) ? void 0 : g(e, n);
80
+ function _(e, t, n) {
81
+ return t && a(n) ? d : a(n) ? void 0 : y(e, n);
70
82
  }
71
- function h(e, t) {
83
+ function v(e, t) {
72
84
  return i(e) && e.validate?.required === !0 || t.required;
73
85
  }
74
- function g(e, t) {
86
+ function y(e, t) {
75
87
  if (!i(e) || !e.validate) return;
76
88
  let { max: n, maxLength: r, message: a, min: o, minLength: s, pattern: c } = e.validate;
77
89
  if (typeof t == "string") {
78
90
  if (s !== void 0 && t.length < s) return a ?? `最少 ${s} 个字符`;
79
91
  if (r !== void 0 && t.length > r) return a ?? `最多 ${r} 个字符`;
80
- if (c !== void 0 && c.length > 0 && !_(c, t)) return a ?? "格式不正确";
92
+ if (c !== void 0 && c.length > 0 && !b(c, t)) return a ?? "格式不正确";
81
93
  }
82
94
  if (typeof t == "number") {
83
95
  if (o !== void 0 && t < o) return a ?? `不能小于 ${o}`;
84
96
  if (n !== void 0 && t > n) return a ?? `不能大于 ${n}`;
85
97
  }
86
98
  }
87
- function _(e, t) {
99
+ function b(e, t) {
88
100
  try {
89
101
  return new RegExp(e).test(t);
90
102
  } catch {
91
103
  return !0;
92
104
  }
93
105
  }
94
- function v(e) {
106
+ function x(e) {
95
107
  return o({
96
108
  id: e.id,
97
109
  children: e.template
98
110
  });
99
111
  }
100
- function y(e) {
112
+ function S(e) {
101
113
  let i = [];
102
114
  return n(e, (e, n) => {
103
115
  if (t(e) && !r(e)) return;
@@ -105,8 +117,8 @@ function y(e) {
105
117
  i.push(r(e) ? `${a}:${e.key}` : a);
106
118
  }), `${e.id}:${i.join("|")}`;
107
119
  }
108
- function b(e) {
120
+ function C(e) {
109
121
  return typeof e == "object" && e ? e : {};
110
122
  }
111
123
  //#endregion
112
- export { v as blankSubformRow, y as buildRuntimeFormId, d as collectSubmitErrors, u as filterSubmitValues, h as isRuntimeRequired, g as validateFieldConstraints, m as validateKeyedFieldValue, p as validateRuntimeField };
124
+ export { x as blankSubformRow, S as buildRuntimeFormId, m as collectSubmitErrors, p as filterSubmitValues, v as isRuntimeRequired, y as validateFieldConstraints, _ as validateKeyedFieldValue, g as validateRuntimeField };
@@ -1,41 +1,43 @@
1
- /*! @vef-framework-react/form-editor v2.9.0 made by Venus | 2026-07-07T06:22:20.341Z */
1
+ /*! @vef-framework-react/form-editor v2.10.0 made by Venus | 2026-07-13T07:28:24.093Z */
2
2
  import "../engine/assert-never.js";
3
3
  import { resolveLinkageEvaluators as e } from "../engine/linkage/default-evaluator.js";
4
4
  import { resolveActionValue as t } from "../engine/linkage/evaluator.js";
5
5
  import { collectConditionEffectRules as n, evaluateConditionEffectTruths as r } from "../engine/linkage/effects.js";
6
- import { resolveScopeValues as i } from "./resolve-scope-values.js";
7
- import { jsx as a } from "@emotion/react/jsx-runtime";
8
- import { createContext as o, use as s, useCallback as c, useEffect as l, useMemo as u, useRef as d } from "react";
9
- import { isDeepEqual as f } from "@vef-framework-react/shared";
10
- var p = o(() => {});
11
- p.displayName = "RunEffectsContext";
12
- function m() {
13
- return s(p);
6
+ import { writeFieldValue as i } from "./field-write.js";
7
+ import { resolveScopeValues as a } from "./resolve-scope-values.js";
8
+ import { jsx as o } from "@emotion/react/jsx-runtime";
9
+ import { createContext as s, use as c, useCallback as l, useEffect as u, useMemo as d, useRef as f } from "react";
10
+ import { isDeepEqual as p } from "@vef-framework-react/shared";
11
+ var m = s(() => {});
12
+ m.displayName = "RunEffectsContext";
13
+ function h() {
14
+ return c(m);
14
15
  }
15
- function h({ children: e, run: t }) {
16
- return /* @__PURE__ */ a(p, {
16
+ function g({ children: e, run: t }) {
17
+ return /* @__PURE__ */ o(m, {
17
18
  value: t,
18
19
  children: e
19
20
  });
20
21
  }
21
- async function g(e) {
22
- let n = i(e.form.store.state.values, e.prefix), r = {
22
+ async function _(e) {
23
+ let n = a(e.form.store.state.values, e.prefix), r = {
23
24
  values: n,
24
25
  resolveValue: (r) => t(r, n, e.evaluators, e.evaluationContext)
25
- }, a = [];
26
- for (let t of e.actions) _(t, e, r, a);
27
- await Promise.all(a);
26
+ }, i = [];
27
+ for (let t of e.actions) v(t, e, r, i);
28
+ await Promise.all(i);
28
29
  }
29
- function _(e, t, n, r) {
30
+ function v(e, t, n, r) {
30
31
  switch (e.type) {
31
- case "set_field": {
32
- let r = `${t.prefix}${e.targetKey}`, i = n.resolveValue(e.value);
33
- f(t.form.getFieldValue(r), i) || t.form.setFieldValue(r, i, {
34
- dontRunListeners: !0,
35
- dontUpdateMeta: !0
32
+ case "set_field":
33
+ i({
34
+ fieldPermissions: t.fieldPermissions,
35
+ form: t.form,
36
+ key: e.targetKey,
37
+ prefix: t.prefix,
38
+ value: n.resolveValue(e.value)
36
39
  });
37
40
  return;
38
- }
39
41
  case "set_variable":
40
42
  t.sinks.setVariable(e.variable, n.resolveValue(e.value));
41
43
  return;
@@ -62,52 +64,56 @@ function _(e, t, n, r) {
62
64
  default:
63
65
  }
64
66
  }
65
- function v(t) {
66
- return t.actions.length === 0 ? Promise.resolve() : g({
67
+ function y(t) {
68
+ return t.actions.length === 0 ? Promise.resolve() : _({
67
69
  actions: t.actions,
68
70
  evaluators: e(t.evaluators),
69
71
  evaluationContext: t.evaluationContext,
72
+ fieldPermissions: t.fieldPermissions,
70
73
  form: t.form,
71
74
  prefix: "",
72
75
  sinks: t.sinks
73
76
  });
74
77
  }
75
- function y(e, t) {
78
+ function b(e, t) {
76
79
  return e.length === 0 ? null : e.map((e) => t[e]);
77
80
  }
78
- function b(t) {
79
- let { evaluators: i, evaluationContext: a, form: o, prefix: s, schema: p, sinks: m, values: h } = t, _ = u(() => e(i), [i]), v = u(() => n(p), [p]), b = d(null), x = d(null), S = d(null), C = d(v);
80
- C.current !== v && (C.current = v, b.current = null, x.current = null);
81
- let w = d(a);
82
- w.current = a;
83
- let T = c((e) => {
84
- e.length > 0 && g({
81
+ function x(t) {
82
+ let { evaluators: i, evaluationContext: a, fieldPermissions: o, form: s, prefix: c, schema: m, sinks: h, values: g } = t, v = d(() => e(i), [i]), y = d(() => n(m), [m]), x = f(null), S = f(null), C = f(null), w = f(y);
83
+ w.current !== y && (w.current = y, x.current = null, S.current = null);
84
+ let T = f(a);
85
+ T.current = a;
86
+ let E = f(o);
87
+ E.current = o;
88
+ let D = l((e) => {
89
+ e.length > 0 && _({
85
90
  actions: e,
86
- evaluators: _,
87
- evaluationContext: w.current,
88
- form: o,
89
- prefix: s,
90
- sinks: m
91
+ evaluators: v,
92
+ evaluationContext: T.current,
93
+ fieldPermissions: E.current,
94
+ form: s,
95
+ prefix: c,
96
+ sinks: h
91
97
  }).catch((e) => {
92
98
  console.error("[form-editor] effect action failed:", e);
93
99
  });
94
100
  }, [
95
- _,
96
- o,
101
+ v,
97
102
  s,
98
- m
103
+ c,
104
+ h
99
105
  ]);
100
- return l(() => {
101
- if (v.length === 0) return;
102
- let e = r(v, h, _, a), t = v.map((e) => e.alwaysActions.length > 0 ? y(e.sourceKeys, h) : null), n = b.current, i = x.current, o = S.current;
103
- if (b.current = e, x.current = t, S.current = h, n) for (let [r, a] of v.entries()) e[r] && (n[r] ? a.alwaysActions.length > 0 && (t[r] === null ? h !== o : !f(t[r], i?.[r])) && T(a.alwaysActions) : T(a.actions));
106
+ return u(() => {
107
+ if (y.length === 0) return;
108
+ let e = r(y, g, v, a), t = y.map((e) => e.alwaysActions.length > 0 ? b(e.sourceKeys, g) : null), n = x.current, i = S.current, o = C.current;
109
+ if (x.current = e, S.current = t, C.current = g, n) for (let [r, a] of y.entries()) e[r] && (n[r] ? a.alwaysActions.length > 0 && (t[r] === null ? g !== o : !p(t[r], i?.[r])) && D(a.alwaysActions) : D(a.actions));
104
110
  }, [
105
- h,
111
+ g,
112
+ y,
106
113
  v,
107
- _,
108
114
  a,
109
- T
110
- ]), T;
115
+ D
116
+ ]), D;
111
117
  }
112
118
  //#endregion
113
- export { h as EffectDispatchProvider, v as dispatchFormEffects, m as useEffectDispatch, b as useScopeEffects };
119
+ export { g as EffectDispatchProvider, y as dispatchFormEffects, h as useEffectDispatch, x as useScopeEffects };
@@ -0,0 +1,17 @@
1
+ /*! @vef-framework-react/form-editor v2.10.0 made by Venus | 2026-07-13T07:28:24.093Z */
2
+ import { getFieldPermission as e, isWritableFieldPermission as t } from "../engine/linkage/evaluator.js";
3
+ import { isDeepEqual as n } from "@vef-framework-react/shared";
4
+ //#region src/runtime/field-write.ts
5
+ function r(r) {
6
+ if (!t(e(r.fieldPermissions, i(r.key)))) return;
7
+ let a = `${r.prefix}${r.key}`;
8
+ n(r.form.getFieldValue(a), r.value) || r.form.setFieldValue(a, r.value, {
9
+ dontRunListeners: !0,
10
+ dontUpdateMeta: !0
11
+ });
12
+ }
13
+ function i(e) {
14
+ return e.match(/[^.[\]]+/)?.[0] ?? e;
15
+ }
16
+ //#endregion
17
+ export { r as writeFieldValue };
@@ -1,4 +1,4 @@
1
- /*! @vef-framework-react/form-editor v2.9.0 made by Venus | 2026-07-07T06:22:20.341Z */
1
+ /*! @vef-framework-react/form-editor v2.10.0 made by Venus | 2026-07-13T07:28:24.093Z */
2
2
  //#region src/runtime/resolve-scope-values.ts
3
3
  function e(e, t) {
4
4
  if (t === "") return e;
@@ -1,4 +1,4 @@
1
- /*! @vef-framework-react/form-editor v2.9.0 made by Venus | 2026-07-07T06:22:20.341Z */
1
+ /*! @vef-framework-react/form-editor v2.10.0 made by Venus | 2026-07-13T07:28:24.093Z */
2
2
  import { emptyRuntimeState as e } from "../engine/linkage/evaluator.js";
3
3
  import { createContextWithSelector as t } from "@vef-framework-react/core";
4
4
  //#region src/runtime/runtime-context.tsx
@@ -1,99 +1,106 @@
1
- /*! @vef-framework-react/form-editor v2.9.0 made by Venus | 2026-07-07T06:22:20.341Z */
1
+ /*! @vef-framework-react/form-editor v2.10.0 made by Venus | 2026-07-13T07:28:24.093Z */
2
2
  import { isRootScope as e, walkFields as t } from "../engine/schema/walk.js";
3
3
  import { isKeyedField as n } from "../engine/keys.js";
4
4
  import { evaluateRuntimeStates as r } from "../engine/linkage/evaluator.js";
5
- import { resolveScopeValues as i } from "./resolve-scope-values.js";
6
- import { EffectDispatchProvider as a, useScopeEffects as o } from "./effects.js";
7
- import { RuntimeStateContextProvider as s } from "./runtime-context.js";
8
- import { stabilizeStateMap as c } from "./stabilize-state-map.js";
9
- import { jsx as l } from "@emotion/react/jsx-runtime";
10
- import { useFormStore as u } from "@vef-framework-react/components";
11
- import { useEffect as d, useRef as f } from "react";
12
- import { isDeepEqual as p } from "@vef-framework-react/shared";
5
+ import { writeFieldValue as i } from "./field-write.js";
6
+ import { resolveScopeValues as a } from "./resolve-scope-values.js";
7
+ import { EffectDispatchProvider as o, useScopeEffects as s } from "./effects.js";
8
+ import { RuntimeStateContextProvider as c } from "./runtime-context.js";
9
+ import { stabilizeStateMap as l } from "./stabilize-state-map.js";
10
+ import { jsx as u } from "@emotion/react/jsx-runtime";
11
+ import { useFormStore as d } from "@vef-framework-react/components";
12
+ import { useEffect as f, useRef as p } from "react";
13
+ import { isDeepEqual as m } from "@vef-framework-react/shared";
13
14
  //#region src/runtime/runtime-state-controller.tsx
14
- function m({ children: e, evaluators: t, evaluationContext: n, form: i, prefix: u, schema: p, sinks: m, values: h }) {
15
- let g = f(void 0), v = r(p, h, {
15
+ function h({ children: e, evaluators: t, evaluationContext: n, fieldPermissions: i, form: a, prefix: d, schema: m, sinks: h, values: g }) {
16
+ let _ = p(void 0), y = r(m, g, {
16
17
  evaluators: t,
17
- evaluationContext: n
18
- }), y = c(g.current, v);
19
- g.current = y;
20
- let b = f(null);
21
- (b.current === null || b.current.schema !== p) && (b.current = {
22
- schema: p,
18
+ evaluationContext: n,
19
+ fieldPermissions: i
20
+ }), b = l(_.current, y);
21
+ _.current = b;
22
+ let x = p(null);
23
+ (x.current === null || x.current.schema !== m) && (x.current = {
24
+ schema: m,
23
25
  applied: /* @__PURE__ */ new Map()
24
26
  });
25
- let x = b.current.applied, S = o({
27
+ let S = x.current.applied, C = s({
26
28
  evaluators: t,
27
29
  evaluationContext: n,
28
- form: i,
29
- prefix: u,
30
- schema: p,
31
- sinks: m,
32
- values: h
30
+ fieldPermissions: i,
31
+ form: a,
32
+ prefix: d,
33
+ schema: m,
34
+ sinks: h,
35
+ values: g
33
36
  });
34
- return d(() => {
35
- _({
36
- appliedAssignedValues: x,
37
- form: i,
38
- prefix: u,
39
- schema: p,
40
- stateMap: y
37
+ return f(() => {
38
+ v({
39
+ appliedAssignedValues: S,
40
+ fieldPermissions: i,
41
+ form: a,
42
+ prefix: d,
43
+ schema: m,
44
+ stateMap: b
41
45
  });
42
46
  }, [
43
- x,
47
+ S,
44
48
  i,
45
- u,
46
- p,
47
- y
48
- ]), /* @__PURE__ */ l(s, {
49
- value: y,
50
- children: /* @__PURE__ */ l(a, {
51
- run: S,
49
+ a,
50
+ d,
51
+ m,
52
+ b
53
+ ]), /* @__PURE__ */ u(c, {
54
+ value: b,
55
+ children: /* @__PURE__ */ u(o, {
56
+ run: C,
52
57
  children: e
53
58
  })
54
59
  });
55
60
  }
56
- function h({ children: e, evaluators: t, evaluationContext: n, form: r, schema: i, sinks: a }) {
57
- return /* @__PURE__ */ l(m, {
61
+ function g({ children: e, evaluators: t, evaluationContext: n, fieldPermissions: r, form: i, schema: a, sinks: o }) {
62
+ return /* @__PURE__ */ u(h, {
58
63
  evaluationContext: n,
59
64
  evaluators: t,
60
- form: r,
65
+ fieldPermissions: r,
66
+ form: i,
61
67
  prefix: "",
62
- schema: i,
63
- sinks: a,
64
- values: u(r.store, (e) => e.values),
68
+ schema: a,
69
+ sinks: o,
70
+ values: d(i.store, (e) => e.values),
65
71
  children: e
66
72
  });
67
73
  }
68
- function g({ children: e, evaluators: t, evaluationContext: n, form: r, prefix: a, sinks: o, templateSchema: s }) {
69
- return /* @__PURE__ */ l(m, {
74
+ function _({ children: e, evaluators: t, evaluationContext: n, form: r, prefix: i, sinks: o, templateSchema: s }) {
75
+ return /* @__PURE__ */ u(h, {
70
76
  evaluationContext: n,
71
77
  evaluators: t,
78
+ fieldPermissions: void 0,
72
79
  form: r,
73
- prefix: a,
80
+ prefix: i,
74
81
  schema: s,
75
82
  sinks: o,
76
- values: u(r.store, (e) => i(e.values, a), p),
83
+ values: d(r.store, (e) => a(e.values, i), m),
77
84
  children: e
78
85
  });
79
86
  }
80
- function _(r) {
81
- let i = [];
82
- if (t(r.schema, (t, a) => {
83
- if (!e(a) || !n(t)) return;
87
+ function v(r) {
88
+ let a = [];
89
+ t(r.schema, (t, i) => {
90
+ if (!e(i) || !n(t)) return;
84
91
  let o = r.stateMap[t.id];
85
- if (!o?.assigned || r.appliedAssignedValues.has(t.id) && Object.is(r.appliedAssignedValues.get(t.id), o.assignedValue)) return;
86
- r.appliedAssignedValues.set(t.id, o.assignedValue);
87
- let s = `${r.prefix}${t.key}`;
88
- p(r.form.getFieldValue(s), o.assignedValue) || i.push({
89
- name: s,
92
+ o?.assigned && (r.appliedAssignedValues.has(t.id) && Object.is(r.appliedAssignedValues.get(t.id), o.assignedValue) || (r.appliedAssignedValues.set(t.id, o.assignedValue), !m(r.form.getFieldValue(`${r.prefix}${t.key}`), o.assignedValue) && a.push({
93
+ key: t.key,
90
94
  value: o.assignedValue
91
- });
92
- }), i.length !== 0) for (let e of i) r.form.setFieldValue(e.name, e.value, {
93
- dontRunListeners: !0,
94
- dontUpdateMeta: !0,
95
- dontValidate: !1
95
+ })));
96
+ });
97
+ for (let e of a) i({
98
+ fieldPermissions: r.fieldPermissions,
99
+ form: r.form,
100
+ key: e.key,
101
+ prefix: r.prefix,
102
+ value: e.value
96
103
  });
97
104
  }
98
105
  //#endregion
99
- export { h as RuntimeStateController, g as SubformRowController };
106
+ export { g as RuntimeStateController, _ as SubformRowController };
@@ -1,4 +1,4 @@
1
- /*! @vef-framework-react/form-editor v2.9.0 made by Venus | 2026-07-07T06:22:20.341Z */
1
+ /*! @vef-framework-react/form-editor v2.10.0 made by Venus | 2026-07-13T07:28:24.093Z */
2
2
  import { isDeepEqual as e } from "@vef-framework-react/shared";
3
3
  //#region src/runtime/stabilize-state-map.ts
4
4
  function t(t, n) {
@@ -1,4 +1,4 @@
1
- /*! @vef-framework-react/form-editor v2.9.0 made by Venus | 2026-07-07T06:22:20.341Z */
1
+ /*! @vef-framework-react/form-editor v2.10.0 made by Venus | 2026-07-13T07:28:24.093Z */
2
2
  import { jsx as e } from "@emotion/react/jsx-runtime";
3
3
  import { createContext as t, use as n, useCallback as r, useSyncExternalStore as i } from "react";
4
4
  //#region src/store/engine-provider.tsx