@shwfed/config 3.0.13 → 3.0.15

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 (122) hide show
  1. package/dist/module.json +1 -1
  2. package/dist/module.mjs +20 -1
  3. package/dist/runtime/components/actions/ai-l1.md +1 -1
  4. package/dist/runtime/components/actions/buttons/2026-05-15/com.shwfed.actions.button.event.dispatch/prompt.md +1 -1
  5. package/dist/runtime/components/actions/buttons/2026-05-21/com.shwfed.actions.button.http.download/schema.d.ts +1 -1
  6. package/dist/runtime/components/actions/buttons/2026-05-21/com.shwfed.actions.button.http.download/schema.js +2 -2
  7. package/dist/runtime/components/actions/buttons/2026-07-13/com.shwfed.actions.button.state.write/prompt.md +1 -1
  8. package/dist/runtime/components/actions/buttons/2026-07-13/com.shwfed.actions.button.state.write/runtime.vue +1 -1
  9. package/dist/runtime/components/actions/buttons/2026-07-13/com.shwfed.actions.button.state.write/schema.d.ts +2 -4
  10. package/dist/runtime/components/actions/buttons/2026-07-13/com.shwfed.actions.button.state.write/schema.js +1 -1
  11. package/dist/runtime/components/actions/components/trigger-row-scope.vue +6 -3
  12. package/dist/runtime/components/actions/utils/steps.d.ts +1 -1
  13. package/dist/runtime/components/config/blocks/2026-07-17/com.shwfed.block.invoice.digital/config.d.vue.ts +2 -0
  14. package/dist/runtime/components/config/blocks/2026-07-17/com.shwfed.block.invoice.digital/config.vue +10 -2
  15. package/dist/runtime/components/config/blocks/2026-07-17/com.shwfed.block.invoice.digital/config.vue.d.ts +2 -0
  16. package/dist/runtime/components/config/blocks/2026-07-17/com.shwfed.block.invoice.digital/runtime.d.vue.ts +2 -0
  17. package/dist/runtime/components/config/blocks/2026-07-17/com.shwfed.block.invoice.digital/runtime.vue.d.ts +2 -0
  18. package/dist/runtime/components/config/blocks/2026-07-17/com.shwfed.block.invoice.digital/schema.d.ts +1 -0
  19. package/dist/runtime/components/config/blocks/2026-07-17/com.shwfed.block.invoice.digital/schema.js +5 -0
  20. package/dist/runtime/components/config/blocks/2026-07-17/com.shwfed.block.invoice.realestate.lease/config.d.vue.ts +96 -0
  21. package/dist/runtime/components/config/blocks/2026-07-17/com.shwfed.block.invoice.realestate.lease/config.vue +385 -0
  22. package/dist/runtime/components/config/blocks/2026-07-17/com.shwfed.block.invoice.realestate.lease/config.vue.d.ts +96 -0
  23. package/dist/runtime/components/config/blocks/2026-07-17/com.shwfed.block.invoice.realestate.lease/items-colgroup.d.vue.ts +3 -0
  24. package/dist/runtime/components/config/blocks/2026-07-17/com.shwfed.block.invoice.realestate.lease/items-colgroup.vue +20 -0
  25. package/dist/runtime/components/config/blocks/2026-07-17/com.shwfed.block.invoice.realestate.lease/items-colgroup.vue.d.ts +3 -0
  26. package/dist/runtime/components/config/blocks/2026-07-17/com.shwfed.block.invoice.realestate.lease/runtime.d.vue.ts +96 -0
  27. package/dist/runtime/components/config/blocks/2026-07-17/com.shwfed.block.invoice.realestate.lease/runtime.vue +177 -0
  28. package/dist/runtime/components/config/blocks/2026-07-17/com.shwfed.block.invoice.realestate.lease/runtime.vue.d.ts +96 -0
  29. package/dist/runtime/components/config/blocks/2026-07-17/com.shwfed.block.invoice.realestate.lease/schema.d.ts +102 -0
  30. package/dist/runtime/components/config/blocks/2026-07-17/com.shwfed.block.invoice.realestate.lease/schema.js +186 -0
  31. package/dist/runtime/components/config/schema.js +2 -2
  32. package/dist/runtime/components/form/fields/2026-04-24/com.shwfed.form.field.combobox.single/config.d.vue.ts +16 -16
  33. package/dist/runtime/components/form/fields/2026-04-24/com.shwfed.form.field.combobox.single/config.vue.d.ts +16 -16
  34. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.daterange/config.d.vue.ts +6 -6
  35. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.daterange/config.vue.d.ts +6 -6
  36. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.datetimerange/config.d.vue.ts +8 -8
  37. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.datetimerange/config.vue.d.ts +8 -8
  38. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.timerange/config.d.vue.ts +2 -2
  39. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.timerange/config.vue.d.ts +2 -2
  40. package/dist/runtime/components/form/fields/2026-05-13/com.shwfed.form.field.combobox.single.remote/config.d.vue.ts +16 -16
  41. package/dist/runtime/components/form/fields/2026-05-13/com.shwfed.form.field.combobox.single.remote/config.vue.d.ts +16 -16
  42. package/dist/runtime/components/form/fields/2026-05-24/com.shwfed.form.field.monthrange/config.d.vue.ts +6 -6
  43. package/dist/runtime/components/form/fields/2026-05-24/com.shwfed.form.field.monthrange/config.vue.d.ts +6 -6
  44. package/dist/runtime/components/form/fields/2026-05-25/com.shwfed.form.field.combobox.multi/config.d.vue.ts +16 -16
  45. package/dist/runtime/components/form/fields/2026-05-25/com.shwfed.form.field.combobox.multi/config.vue.d.ts +16 -16
  46. package/dist/runtime/components/form/fields/2026-06-09/com.shwfed.form.field.upload/prompt.md +1 -1
  47. package/dist/runtime/components/form/fields/2026-07-18/com.shwfed.form.field.richtext/RichTextEditor.d.vue.ts +33 -0
  48. package/dist/runtime/components/form/fields/2026-07-18/com.shwfed.form.field.richtext/RichTextEditor.vue +269 -0
  49. package/dist/runtime/components/form/fields/2026-07-18/com.shwfed.form.field.richtext/RichTextEditor.vue.d.ts +33 -0
  50. package/dist/runtime/components/form/fields/2026-07-18/com.shwfed.form.field.richtext/config.d.vue.ts +107 -0
  51. package/dist/runtime/components/form/fields/2026-07-18/com.shwfed.form.field.richtext/config.vue +370 -0
  52. package/dist/runtime/components/form/fields/2026-07-18/com.shwfed.form.field.richtext/config.vue.d.ts +107 -0
  53. package/dist/runtime/components/form/fields/2026-07-18/com.shwfed.form.field.richtext/extensions.d.ts +27 -0
  54. package/dist/runtime/components/form/fields/2026-07-18/com.shwfed.form.field.richtext/extensions.js +83 -0
  55. package/dist/runtime/components/form/fields/2026-07-18/com.shwfed.form.field.richtext/features.d.ts +21 -0
  56. package/dist/runtime/components/form/fields/2026-07-18/com.shwfed.form.field.richtext/features.js +16 -0
  57. package/dist/runtime/components/form/fields/2026-07-18/com.shwfed.form.field.richtext/indent.d.ts +26 -0
  58. package/dist/runtime/components/form/fields/2026-07-18/com.shwfed.form.field.richtext/indent.js +64 -0
  59. package/dist/runtime/components/form/fields/2026-07-18/com.shwfed.form.field.richtext/prompt.md +33 -0
  60. package/dist/runtime/components/form/fields/2026-07-18/com.shwfed.form.field.richtext/runtime.d.vue.ts +8 -0
  61. package/dist/runtime/components/form/fields/2026-07-18/com.shwfed.form.field.richtext/runtime.vue +121 -0
  62. package/dist/runtime/components/form/fields/2026-07-18/com.shwfed.form.field.richtext/runtime.vue.d.ts +8 -0
  63. package/dist/runtime/components/form/fields/2026-07-18/com.shwfed.form.field.richtext/schema.d.ts +133 -0
  64. package/dist/runtime/components/form/fields/2026-07-18/com.shwfed.form.field.richtext/schema.js +65 -0
  65. package/dist/runtime/components/operations/2026-06-11/com.shwfed.operation.http.request.json/runtime.js +16 -4
  66. package/dist/runtime/components/operations/2026-06-11/com.shwfed.operation.http.request.json/schema.js +10 -3
  67. package/dist/runtime/components/operations/2026-06-15/com.shwfed.operation.http.download/schema.js +2 -2
  68. package/dist/runtime/components/operations/2026-06-15/com.shwfed.operation.navigation/schema.js +1 -1
  69. package/dist/runtime/components/operations/utils/resolve.d.ts +1 -1
  70. package/dist/runtime/components/operations/utils/step-vars.d.ts +16 -4
  71. package/dist/runtime/components/operations/utils/step-vars.js +14 -1
  72. package/dist/runtime/components/table/columns/2026-05-27/com.shwfed.table.column.tree-combobox-multi/config.d.vue.ts +2 -2
  73. package/dist/runtime/components/table/columns/2026-05-27/com.shwfed.table.column.tree-combobox-multi/config.vue.d.ts +2 -2
  74. package/dist/runtime/components/table/columns/2026-05-27/com.shwfed.table.column.tree-combobox-single/config.d.vue.ts +2 -2
  75. package/dist/runtime/components/table/columns/2026-05-27/com.shwfed.table.column.tree-combobox-single/config.vue.d.ts +2 -2
  76. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.tree-combobox-multi/config.d.vue.ts +2 -2
  77. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.tree-combobox-multi/config.vue.d.ts +2 -2
  78. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.tree-combobox-single/config.d.vue.ts +2 -2
  79. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.tree-combobox-single/config.vue.d.ts +2 -2
  80. package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.tree-combobox-multi/config.d.vue.ts +2 -2
  81. package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.tree-combobox-multi/config.vue.d.ts +2 -2
  82. package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.tree-combobox-single/config.d.vue.ts +2 -2
  83. package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.tree-combobox-single/config.vue.d.ts +2 -2
  84. package/dist/runtime/components/table/columns/2026-07-16/com.shwfed.table.column.upload/prompt.md +1 -1
  85. package/dist/runtime/components/table/columns/2026-07-16/com.shwfed.table.column.upload/runtime.vue +8 -2
  86. package/dist/runtime/components/ui/calendar/Calendar.d.vue.ts +8 -4
  87. package/dist/runtime/components/ui/calendar/Calendar.vue +39 -10
  88. package/dist/runtime/components/ui/calendar/Calendar.vue.d.ts +8 -4
  89. package/dist/runtime/components/ui/date-picker/DatePicker.vue +3 -1
  90. package/dist/runtime/components/ui/date-picker/DatePickerDatePanel.vue +6 -0
  91. package/dist/runtime/components/ui/date-picker/DatePickerDateTimePanel.vue +6 -0
  92. package/dist/runtime/components/ui/date-picker/DatePickerInput.d.vue.ts +1 -1
  93. package/dist/runtime/components/ui/date-picker/DatePickerInput.vue +7 -9
  94. package/dist/runtime/components/ui/date-picker/DatePickerInput.vue.d.ts +1 -1
  95. package/dist/runtime/components/ui/date-picker/DatePickerTimeInput.d.vue.ts +1 -1
  96. package/dist/runtime/components/ui/date-picker/DatePickerTimeInput.vue.d.ts +1 -1
  97. package/dist/runtime/components/ui/date-range-picker/DateRangePicker.vue +10 -7
  98. package/dist/runtime/components/ui/date-range-picker/DateRangePickerInput.d.vue.ts +3 -5
  99. package/dist/runtime/components/ui/date-range-picker/DateRangePickerInput.vue +28 -26
  100. package/dist/runtime/components/ui/date-range-picker/DateRangePickerInput.vue.d.ts +3 -5
  101. package/dist/runtime/components/ui/date-range-picker/DateRangePickerTimeInput.d.vue.ts +2 -2
  102. package/dist/runtime/components/ui/date-range-picker/DateRangePickerTimeInput.vue.d.ts +2 -2
  103. package/dist/runtime/components/ui/expression-editor/picker-entries.js +1 -1
  104. package/dist/runtime/components/ui/expression-editor/step-chip-extension.js +1 -1
  105. package/dist/runtime/components/ui/expression-editor/step-refs.js +1 -1
  106. package/dist/runtime/components/ui/range-calendar/RangeCalendar.d.vue.ts +5 -5
  107. package/dist/runtime/components/ui/range-calendar/RangeCalendar.vue +22 -5
  108. package/dist/runtime/components/ui/range-calendar/RangeCalendar.vue.d.ts +5 -5
  109. package/dist/runtime/components/ui/range-calendar/RangeCalendarNextButton.vue +0 -1
  110. package/dist/runtime/components/ui/range-calendar/RangeCalendarPrevButton.vue +0 -1
  111. package/dist/runtime/share/event-bus.d.ts +16 -0
  112. package/dist/runtime/share/event-bus.js +18 -13
  113. package/dist/runtime/share/idempotency-key.d.ts +18 -0
  114. package/dist/runtime/share/idempotency-key.js +9 -0
  115. package/dist/runtime/share/slot-renderer.vue +83 -24
  116. package/dist/runtime/utils/cel-context.d.ts +3 -2
  117. package/dist/runtime/utils/cel-context.js +1 -0
  118. package/dist/runtime/vendor/cel-js/CLAUDE.md +3 -1
  119. package/dist/runtime/vendor/cel-js/PROMPT.md +31 -2
  120. package/dist/runtime/vendor/cel-js/lib/functions.js +28 -1
  121. package/dist/runtime/vendor/cel-js/lib/registry.js +2 -1
  122. package/package.json +8 -1
@@ -129,11 +129,15 @@ function emitRange(start, end) {
129
129
  stringValue.value = next;
130
130
  emits("change", next);
131
131
  }
132
- function setStart(date) {
133
- emitRange(date, endNative.value);
134
- }
135
- function setEnd(date) {
136
- emitRange(startNative.value, date);
132
+ function commitFromInput(start, end) {
133
+ const isRefused = (d) => props.disabledDate?.(nativeToDateValue(d, props.type)) ?? false;
134
+ if (start && isRefused(start)) return;
135
+ if (end && isRefused(end)) return;
136
+ if (start && end && start > end) {
137
+ emitRange(end, start);
138
+ return;
139
+ }
140
+ emitRange(start, end);
137
141
  }
138
142
  function setStartTime(time) {
139
143
  emitRange(time ? timeToNative(time) : void 0, endNative.value);
@@ -250,8 +254,7 @@ function onInputBlur(event, side) {
250
254
  :open="open"
251
255
  :size="props.size"
252
256
  :class="props.inputClass"
253
- @update:start-value="setStart"
254
- @update:end-value="setEnd"
257
+ @commit="commitFromInput"
255
258
  @focus="onInputFocus"
256
259
  @blur="onInputBlur"
257
260
  @clear="clearAll"
@@ -19,18 +19,16 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {
19
19
  clear: () => any;
20
20
  blur: (args_0: FocusEvent, args_1: "end" | "start") => any;
21
21
  focus: (args_0: FocusEvent, args_1: "end" | "start") => any;
22
- "update:startValue": (args_0: Date | undefined) => any;
23
- "update:endValue": (args_0: Date | undefined) => any;
22
+ commit: (args_0: Date | undefined, args_1: Date | undefined) => any;
24
23
  }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
25
24
  onClear?: (() => any) | undefined;
26
25
  onBlur?: ((args_0: FocusEvent, args_1: "end" | "start") => any) | undefined;
27
26
  onFocus?: ((args_0: FocusEvent, args_1: "end" | "start") => any) | undefined;
28
- "onUpdate:startValue"?: ((args_0: Date | undefined) => any) | undefined;
29
- "onUpdate:endValue"?: ((args_0: Date | undefined) => any) | undefined;
27
+ onCommit?: ((args_0: Date | undefined, args_1: Date | undefined) => any) | undefined;
30
28
  }>, {
31
29
  size: "sm" | "md" | "lg";
32
- clearable: boolean;
33
30
  clearIcon: string;
31
+ clearable: boolean;
34
32
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
35
33
  declare const _default: typeof __VLS_export;
36
34
  export default _default;
@@ -1,7 +1,7 @@
1
1
  <script setup>
2
2
  import { Icon } from "@iconify/vue";
3
3
  import { format as formatDate, isValid, parse as parseDate } from "date-fns";
4
- import { computed, ref, watch } from "vue";
4
+ import { computed, nextTick, ref, useTemplateRef, watch } from "vue";
5
5
  import { cn } from "../../../utils/cn";
6
6
  import { InputGroupButton } from "../input-group";
7
7
  defineOptions({ name: "UiDateRangePickerInput", inheritAttrs: false });
@@ -29,7 +29,8 @@ const sizeClass = computed(() => ({
29
29
  const inputTextClass = computed(() => ({ sm: "text-xs", md: "text-sm", lg: "text-base" })[props.size]);
30
30
  const clearButtonSizeClass = computed(() => props.size === "sm" ? "size-4" : "");
31
31
  const clearIconSizeClass = computed(() => props.size === "sm" ? "size-3" : "");
32
- const emits = defineEmits(["update:startValue", "update:endValue", "focus", "blur", "clear"]);
32
+ const emits = defineEmits(["commit", "focus", "blur", "clear"]);
33
+ const rootEl = useTemplateRef("root-el");
33
34
  const startDraft = ref("");
34
35
  const endDraft = ref("");
35
36
  const focusedSide = ref(null);
@@ -53,25 +54,21 @@ watch(
53
54
  },
54
55
  { immediate: true }
55
56
  );
56
- function commit(side) {
57
- const draft = side === "start" ? startDraft : endDraft;
58
- const current = side === "start" ? props.startValue : props.endValue;
59
- const sync = side === "start" ? syncStart : syncEnd;
60
- const text = draft.value.trim();
61
- if (!text) {
62
- if (current !== void 0) {
63
- if (side === "start") emits("update:startValue", void 0);
64
- else emits("update:endValue", void 0);
65
- }
66
- return;
67
- }
68
- const parsed = parseDate(text, props.format, current ?? /* @__PURE__ */ new Date());
69
- if (!isValid(parsed)) {
70
- sync();
71
- return;
72
- }
73
- if (side === "start") emits("update:startValue", parsed);
74
- else emits("update:endValue", parsed);
57
+ function parseDraft(text, fallback) {
58
+ const trimmed = text.trim();
59
+ if (!trimmed) return void 0;
60
+ const parsed = parseDate(trimmed, props.format, fallback ?? /* @__PURE__ */ new Date());
61
+ return isValid(parsed) ? parsed : void 0;
62
+ }
63
+ async function commit() {
64
+ emits(
65
+ "commit",
66
+ parseDraft(startDraft.value, props.startValue),
67
+ parseDraft(endDraft.value, props.endValue)
68
+ );
69
+ await nextTick();
70
+ syncStart();
71
+ syncEnd();
75
72
  }
76
73
  function onFocus(event, side) {
77
74
  focusedSide.value = side;
@@ -79,14 +76,17 @@ function onFocus(event, side) {
79
76
  }
80
77
  function onBlur(event, side) {
81
78
  focusedSide.value = null;
82
- commit(side);
83
79
  emits("blur", event, side);
84
80
  }
81
+ function onFocusOut(event) {
82
+ const next = event.relatedTarget;
83
+ if (next instanceof Node && rootEl.value?.contains(next)) return;
84
+ void commit();
85
+ }
85
86
  function onClear() {
86
87
  startDraft.value = "";
87
88
  endDraft.value = "";
88
- emits("update:startValue", void 0);
89
- emits("update:endValue", void 0);
89
+ emits("commit", void 0, void 0);
90
90
  emits("clear");
91
91
  }
92
92
  const showClear = computed(
@@ -97,6 +97,7 @@ const hasValue = computed(() => props.startValue !== void 0 || props.endValue !=
97
97
 
98
98
  <template>
99
99
  <div
100
+ ref="root-el"
100
101
  v-bind="$attrs"
101
102
  data-slot="date-range-picker-input"
102
103
  :data-disabled="props.disabled ? 'true' : void 0"
@@ -111,6 +112,7 @@ const hasValue = computed(() => props.startValue !== void 0 || props.endValue !=
111
112
  sizeClass,
112
113
  props.class
113
114
  )"
115
+ @focusout="onFocusOut"
114
116
  >
115
117
  <Icon
116
118
  v-if="props.prefixIcon"
@@ -131,7 +133,7 @@ const hasValue = computed(() => props.startValue !== void 0 || props.endValue !=
131
133
  )"
132
134
  @focus="(e) => onFocus(e, 'start')"
133
135
  @blur="(e) => onBlur(e, 'start')"
134
- @keydown.enter.prevent="commit('start')"
136
+ @keydown.enter.prevent="commit()"
135
137
  >
136
138
  <Icon
137
139
  v-if="props.rangeSeparatorIcon"
@@ -153,7 +155,7 @@ const hasValue = computed(() => props.startValue !== void 0 || props.endValue !=
153
155
  )"
154
156
  @focus="(e) => onFocus(e, 'end')"
155
157
  @blur="(e) => onBlur(e, 'end')"
156
- @keydown.enter.prevent="commit('end')"
158
+ @keydown.enter.prevent="commit()"
157
159
  >
158
160
  <InputGroupButton
159
161
  v-if="showClear"
@@ -19,18 +19,16 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {
19
19
  clear: () => any;
20
20
  blur: (args_0: FocusEvent, args_1: "end" | "start") => any;
21
21
  focus: (args_0: FocusEvent, args_1: "end" | "start") => any;
22
- "update:startValue": (args_0: Date | undefined) => any;
23
- "update:endValue": (args_0: Date | undefined) => any;
22
+ commit: (args_0: Date | undefined, args_1: Date | undefined) => any;
24
23
  }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
25
24
  onClear?: (() => any) | undefined;
26
25
  onBlur?: ((args_0: FocusEvent, args_1: "end" | "start") => any) | undefined;
27
26
  onFocus?: ((args_0: FocusEvent, args_1: "end" | "start") => any) | undefined;
28
- "onUpdate:startValue"?: ((args_0: Date | undefined) => any) | undefined;
29
- "onUpdate:endValue"?: ((args_0: Date | undefined) => any) | undefined;
27
+ onCommit?: ((args_0: Date | undefined, args_1: Date | undefined) => any) | undefined;
30
28
  }>, {
31
29
  size: "sm" | "md" | "lg";
32
- clearable: boolean;
33
30
  clearIcon: string;
31
+ clearable: boolean;
34
32
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
35
33
  declare const _default: typeof __VLS_export;
36
34
  export default _default;
@@ -26,9 +26,9 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {
26
26
  size: "sm" | "md" | "lg";
27
27
  granularity: "hour" | "minute" | "second";
28
28
  hourCycle: 12 | 24;
29
- clearable: boolean;
30
- clearIcon: string;
31
29
  rangeSeparatorIcon: string;
30
+ clearIcon: string;
31
+ clearable: boolean;
32
32
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
33
33
  declare const _default: typeof __VLS_export;
34
34
  export default _default;
@@ -26,9 +26,9 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {
26
26
  size: "sm" | "md" | "lg";
27
27
  granularity: "hour" | "minute" | "second";
28
28
  hourCycle: 12 | 24;
29
- clearable: boolean;
30
- clearIcon: string;
31
29
  rangeSeparatorIcon: string;
30
+ clearIcon: string;
31
+ clearable: boolean;
32
32
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
33
33
  declare const _default: typeof __VLS_export;
34
34
  export default _default;
@@ -39,7 +39,7 @@ export function buildStepEntries(roster) {
39
39
  return roster.filter((step) => step.valid).map((step) => ({
40
40
  id: `step:${step.id}`,
41
41
  group: "step",
42
- insert: `${STEPS_VAR}[?${JSON.stringify(step.id)}]`,
42
+ insert: `${STEPS_VAR}[${JSON.stringify(step.id)}]`,
43
43
  display: step.label,
44
44
  label: "\u524D\u5E8F\u6B65\u9AA4",
45
45
  type: "dyn",
@@ -76,7 +76,7 @@ const chipPlugin = ViewPlugin.fromClass(
76
76
  {
77
77
  decorations: (plugin) => plugin.decorations,
78
78
  // Atomic so the caret steps over a chip and Backspace removes the whole
79
- // `steps[?"id"]` at once — matching the scope/selection chips' feel.
79
+ // `steps["id"]` at once — matching the scope/selection chips' feel.
80
80
  provide: (plugin) => EditorView.atomicRanges.of((view) => view.plugin(plugin)?.decorations ?? Decoration.none)
81
81
  }
82
82
  );
@@ -1,6 +1,6 @@
1
1
  import { STEPS_VAR } from "../../../utils/cel-context.js";
2
2
  const STEP_REF_RE = new RegExp(
3
- `(?<![\\w$.])${STEPS_VAR}\\[\\??("(?:[^"\\\\]|\\\\.)*")\\]`,
3
+ `(?<![\\w$.])${STEPS_VAR}\\[("(?:[^"\\\\]|\\\\.)*")\\]`,
4
4
  "g"
5
5
  );
6
6
  export function scanStepRefs(text) {
@@ -1,18 +1,18 @@
1
- import type { RangeCalendarRootProps } from 'reka-ui';
1
+ import type { DateValue, RangeCalendarRootProps } from 'reka-ui';
2
2
  import type { HTMLAttributes } from 'vue';
3
3
  type __VLS_Props = RangeCalendarRootProps & {
4
4
  class?: HTMLAttributes['class'];
5
5
  };
6
6
  declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
7
7
  "update:modelValue": (date: import("reka-ui").DateRange) => any;
8
- "update:placeholder": (date: import("reka-ui").DateValue) => any;
8
+ "update:placeholder": (date: DateValue) => any;
9
9
  "update:validModelValue": (date: import("reka-ui").DateRange) => any;
10
- "update:startValue": (date: import("reka-ui").DateValue | undefined) => any;
10
+ "update:startValue": (date: DateValue | undefined) => any;
11
11
  }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
12
12
  "onUpdate:modelValue"?: ((date: import("reka-ui").DateRange) => any) | undefined;
13
- "onUpdate:placeholder"?: ((date: import("reka-ui").DateValue) => any) | undefined;
13
+ "onUpdate:placeholder"?: ((date: DateValue) => any) | undefined;
14
14
  "onUpdate:validModelValue"?: ((date: import("reka-ui").DateRange) => any) | undefined;
15
- "onUpdate:startValue"?: ((date: import("reka-ui").DateValue | undefined) => any) | undefined;
15
+ "onUpdate:startValue"?: ((date: DateValue | undefined) => any) | undefined;
16
16
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
17
17
  declare const _default: typeof __VLS_export;
18
18
  export default _default;
@@ -1,4 +1,5 @@
1
1
  <script setup>
2
+ import { Icon } from "@iconify/vue";
2
3
  import { reactiveOmit, useNavigatorLanguage } from "@vueuse/core";
3
4
  import { RangeCalendarRoot, useForwardPropsEmits } from "reka-ui";
4
5
  import { computed } from "vue";
@@ -55,12 +56,28 @@ const locale = computed(() => props.locale ?? i18nLocale.value ?? navLocale.lang
55
56
  :locale="locale"
56
57
  >
57
58
  <RangeCalendarHeader>
58
- <RangeCalendarHeading />
59
+ <nav class="w-full flex items-center gap-1 absolute top-1/2 -translate-y-1/2 transform-gpu inset-x-0 justify-between z-10">
60
+ <div class="flex items-center gap-0.5">
61
+ <RangeCalendarPrevButton
62
+ :prev-page="(d) => d.subtract({ years: 1 })"
63
+ data-slot="range-calendar-prev-year-button"
64
+ >
65
+ <Icon icon="fluent:chevron-double-left-20-regular" />
66
+ </RangeCalendarPrevButton>
67
+ <RangeCalendarPrevButton />
68
+ </div>
69
+ <div class="flex items-center gap-0.5">
70
+ <RangeCalendarNextButton />
71
+ <RangeCalendarNextButton
72
+ :next-page="(d) => d.add({ years: 1 })"
73
+ data-slot="range-calendar-next-year-button"
74
+ >
75
+ <Icon icon="fluent:chevron-double-right-20-regular" />
76
+ </RangeCalendarNextButton>
77
+ </div>
78
+ </nav>
59
79
 
60
- <div class="flex items-center gap-1">
61
- <RangeCalendarPrevButton />
62
- <RangeCalendarNextButton />
63
- </div>
80
+ <RangeCalendarHeading />
64
81
  </RangeCalendarHeader>
65
82
 
66
83
  <div class="flex flex-col gap-y-4 mt-4 sm:flex-row sm:gap-x-4 sm:gap-y-0">
@@ -1,18 +1,18 @@
1
- import type { RangeCalendarRootProps } from 'reka-ui';
1
+ import type { DateValue, RangeCalendarRootProps } from 'reka-ui';
2
2
  import type { HTMLAttributes } from 'vue';
3
3
  type __VLS_Props = RangeCalendarRootProps & {
4
4
  class?: HTMLAttributes['class'];
5
5
  };
6
6
  declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
7
7
  "update:modelValue": (date: import("reka-ui").DateRange) => any;
8
- "update:placeholder": (date: import("reka-ui").DateValue) => any;
8
+ "update:placeholder": (date: DateValue) => any;
9
9
  "update:validModelValue": (date: import("reka-ui").DateRange) => any;
10
- "update:startValue": (date: import("reka-ui").DateValue | undefined) => any;
10
+ "update:startValue": (date: DateValue | undefined) => any;
11
11
  }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
12
12
  "onUpdate:modelValue"?: ((date: import("reka-ui").DateRange) => any) | undefined;
13
- "onUpdate:placeholder"?: ((date: import("reka-ui").DateValue) => any) | undefined;
13
+ "onUpdate:placeholder"?: ((date: DateValue) => any) | undefined;
14
14
  "onUpdate:validModelValue"?: ((date: import("reka-ui").DateRange) => any) | undefined;
15
- "onUpdate:startValue"?: ((date: import("reka-ui").DateValue | undefined) => any) | undefined;
15
+ "onUpdate:startValue"?: ((date: DateValue | undefined) => any) | undefined;
16
16
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
17
17
  declare const _default: typeof __VLS_export;
18
18
  export default _default;
@@ -19,7 +19,6 @@ const forwardedProps = useForwardProps(delegatedProps);
19
19
  data-slot="range-calendar-next-button"
20
20
  :class="cn(
21
21
  buttonVariants({ variant: 'ghost' }),
22
- 'absolute right-1',
23
22
  'size-7 bg-transparent p-0 opacity-50 hover:opacity-100',
24
23
  props.class
25
24
  )"
@@ -19,7 +19,6 @@ const forwardedProps = useForwardProps(delegatedProps);
19
19
  data-slot="range-calendar-prev-button"
20
20
  :class="cn(
21
21
  buttonVariants({ variant: 'ghost' }),
22
- 'absolute left-1',
23
22
  'size-7 bg-transparent p-0 opacity-50 hover:opacity-100',
24
23
  props.class
25
24
  )"
@@ -25,6 +25,22 @@ export type ChainStep = Readonly<{
25
25
  * address a later expression could reference it by.
26
26
  */
27
27
  publish: (output: unknown) => void;
28
+ /**
29
+ * This step's idempotency key for THIS run — lazily minted, then memoized.
30
+ *
31
+ * The coordinate is (run × step), not run alone: a chain may hold several
32
+ * request steps hitting different endpoints, and a server that dedupes on
33
+ * the key would answer request 2 with request 1's cached response — silently,
34
+ * with a 200 and a plausible body. Each `ChainStep` is already built per
35
+ * (run, trigger) inside `dispatchTriggers`, so per-instance minting IS that
36
+ * coordinate. Note this needs no `trigger.id`, so unlike `publish` it works
37
+ * on legacy rows too.
38
+ *
39
+ * Memoized so a step that reads the key twice — once into a CEL expression,
40
+ * once onto the request header — sends one value, not two. Lazy so a step
41
+ * that never asks costs nothing.
42
+ */
43
+ idempotencyKey: () => string;
28
44
  }>;
29
45
  /** A descendant button asking an ancestor instance to run an operation. */
30
46
  export type OpRequest = Readonly<{
@@ -1,13 +1,14 @@
1
1
  import { computed, inject, provide, shallowRef } from "vue";
2
2
  import { Effect, Schema } from "effect";
3
+ import { mintIdempotencyKey } from "./idempotency-key.js";
3
4
  export const Trigger = Schema.Struct({
4
5
  // Additive + optional like `compatibilityDate`/`params` below, so every
5
6
  // pre-existing `{ target, operation }` trigger keeps loading. Minted by the
6
7
  // trigger editor on add; it is the address under which this step's output is
7
- // published for later steps (`steps[?"<id>"]`), so it must survive reorders —
8
+ // published for later steps (`steps["<id>"]`), so it must survive reorders —
8
9
  // which the list index, the only other row identity, does not.
9
10
  id: Schema.optional(Schema.UUID.annotations({
10
- description: '\u89E6\u53D1\u884C\u7684\u7A33\u5B9A\u6807\u8BC6\uFF0C\u540E\u7EED\u6B65\u9AA4\u7ECF steps[?"<id>"] \u5F15\u7528\u672C\u6B65\u8F93\u51FA'
11
+ description: '\u89E6\u53D1\u884C\u7684\u7A33\u5B9A\u6807\u8BC6\uFF0C\u540E\u7EED\u6B65\u9AA4\u7ECF steps["<id>"] \u5F15\u7528\u672C\u6B65\u8F93\u51FA'
11
12
  })),
12
13
  target: Schema.UUID.annotations({
13
14
  description: "\u76EE\u6807\u7956\u5148\u5B9E\u4F8B\u7684 ID"
@@ -59,18 +60,22 @@ export function dispatchTriggers(channel, triggers, cel, outputs) {
59
60
  const chainOutputs = outputs ?? {};
60
61
  return Effect.forEach(
61
62
  triggers,
62
- (trigger) => channel.dispatch({
63
- target: trigger.target,
64
- operation: trigger.operation,
65
- params: trigger.params,
66
- cel,
67
- step: {
68
- outputs: () => chainOutputs,
69
- publish: (output) => {
70
- if (trigger.id) chainOutputs[trigger.id] = output;
63
+ (trigger) => {
64
+ let key;
65
+ return channel.dispatch({
66
+ target: trigger.target,
67
+ operation: trigger.operation,
68
+ params: trigger.params,
69
+ cel,
70
+ step: {
71
+ outputs: () => chainOutputs,
72
+ publish: (output) => {
73
+ if (trigger.id) chainOutputs[trigger.id] = output;
74
+ },
75
+ idempotencyKey: () => key ??= mintIdempotencyKey()
71
76
  }
72
- }
73
- }),
77
+ });
78
+ },
74
79
  { discard: true }
75
80
  );
76
81
  });
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Mint a fresh idempotency key — one opaque UUID identifying a single logical
3
+ * request intent, carried to the server as `Idempotency-Key`.
4
+ *
5
+ * `crypto.randomUUID()` is a **secure-context-only** API: on a plain-HTTP LAN
6
+ * deployment it is `undefined`. `crypto.getRandomValues` carries no such
7
+ * restriction, so it backs the fallback — 16 random bytes rendered in the
8
+ * canonical 8-4-4-4-12 layout with the v4 version/variant bits set, because a
9
+ * server that accepts an `Idempotency-Key` commonly validates the shape.
10
+ *
11
+ * `Math.random()` is deliberately NOT a fallback: two tabs seeded alike would
12
+ * mint the same key, and a repeated key silently merges two distinct intents —
13
+ * the exact failure this whole mechanism exists to prevent. If neither crypto
14
+ * API is present we would rather throw than hand out a weak key.
15
+ */
16
+ export declare function mintIdempotencyKey(): string;
17
+ /** The header under which a request carries its idempotency key. */
18
+ export declare const IDEMPOTENCY_KEY_HEADER = "Idempotency-Key";
@@ -0,0 +1,9 @@
1
+ export function mintIdempotencyKey() {
2
+ if (typeof crypto.randomUUID === "function") return crypto.randomUUID();
3
+ const bytes = crypto.getRandomValues(new Uint8Array(16));
4
+ bytes[6] = bytes[6] & 15 | 64;
5
+ bytes[8] = bytes[8] & 63 | 128;
6
+ const hex = Array.from(bytes, (b) => b.toString(16).padStart(2, "0")).join("");
7
+ return `${hex.slice(0, 8)}-${hex.slice(8, 12)}-${hex.slice(12, 16)}-${hex.slice(16, 20)}-${hex.slice(20)}`;
8
+ }
9
+ export const IDEMPOTENCY_KEY_HEADER = "Idempotency-Key";
@@ -14,6 +14,16 @@ const props = defineProps({
14
14
  const emit = defineEmits(["update:slotValue"]);
15
15
  const inherited = injectCELContext();
16
16
  const $cel = (expression, context) => _rawCel(expression, { ...celBindings(inherited), ...context });
17
+ function isHidden(block) {
18
+ const expr = block.hidden;
19
+ if (typeof expr !== "string" || expr.length === 0) return false;
20
+ try {
21
+ return Effect.runSync($cel(expr));
22
+ } catch (err) {
23
+ console.error(`[shwfed-slot-renderer] failed to evaluate hidden for ${block.id}:`, err);
24
+ return false;
25
+ }
26
+ }
17
27
  function pickLayout(sets) {
18
28
  if (sets.length === 0) return void 0;
19
29
  for (const set of sets) {
@@ -40,6 +50,7 @@ const placedBlocks = computed(() => {
40
50
  const block = b;
41
51
  const placement = layout.placements[block.id];
42
52
  if (!placement) continue;
53
+ if (isHidden(block)) continue;
43
54
  const entry = props.findEntry(block.type, block.compatibilityDate);
44
55
  if (!entry) {
45
56
  const key = `${block.type}@${block.compatibilityDate}`;
@@ -53,37 +64,83 @@ const placedBlocks = computed(() => {
53
64
  }
54
65
  return out;
55
66
  });
67
+ const authoredAreas = computed(() => {
68
+ const layout = activeLayout.value?.layout;
69
+ if (!layout) return [];
70
+ const out = [];
71
+ for (const b of props.slotValue.blocks) {
72
+ const block = b;
73
+ const placement = layout.placements[block.id];
74
+ if (!placement) continue;
75
+ if (!props.findEntry(block.type, block.compatibilityDate)) continue;
76
+ out.push(placement.area);
77
+ }
78
+ return out;
79
+ });
80
+ function buildRemap(count, keep) {
81
+ const line = Array.from({ length: count + 2 });
82
+ const keptFlags = [];
83
+ let acc = 1;
84
+ for (let L = 1; L <= count + 1; L++) {
85
+ line[L] = acc;
86
+ if (L <= count) {
87
+ const k = keep(L);
88
+ keptFlags.push(k);
89
+ if (k) acc++;
90
+ }
91
+ }
92
+ return { line, keptFlags, kept: acc - 1 };
93
+ }
94
+ const compaction = computed(() => {
95
+ const l = activeLayout.value?.layout;
96
+ if (!l) return null;
97
+ const authored = authoredAreas.value;
98
+ const visible = placedBlocks.value.map((p) => p.placement.area);
99
+ const coversCol = (a, c) => a[0][0] <= c && c < a[1][0];
100
+ const coversRow = (a, r) => a[0][1] <= r && r < a[1][1];
101
+ const rowCount = l.rows ?? authored.reduce((m, a) => Math.max(m, a[1][1] - 1), 0);
102
+ const grows = Array.from({ length: rowCount }, () => false);
103
+ for (const p of placedBlocks.value) {
104
+ if (!p.entry.metadata?.h?.grow) continue;
105
+ const [[, y1], [, y2]] = p.placement.area;
106
+ const lo = Math.max(1, y1);
107
+ const hi = Math.min(rowCount, y2 - 1);
108
+ for (let r = lo; r <= hi; r++) grows[r - 1] = true;
109
+ }
110
+ const col = buildRemap(l.columns, (c) => visible.some((a) => coversCol(a, c)) || !authored.some((a) => coversCol(a, c)));
111
+ const row = buildRemap(rowCount, (r) => visible.some((a) => coversRow(a, r)) || !authored.some((a) => coversRow(a, r)));
112
+ const rowTemplate = l.rows ? row.keptFlags.map((keep, i) => keep ? grows[i] ? "auto" : "minmax(auto, 1fr)" : null).filter(Boolean).join(" ") : "";
113
+ return {
114
+ colLine: col.line,
115
+ rowLine: row.line,
116
+ keptColumns: Math.max(1, col.kept),
117
+ rowTemplate
118
+ };
119
+ });
56
120
  const gridStyle = computed(() => {
57
121
  const l = activeLayout.value?.layout;
58
- if (!l) return "";
59
- const tracks = (n, min) => `repeat(${n}, minmax(${min}, 1fr))`;
122
+ const comp = compaction.value;
123
+ if (!l || !comp) return "";
124
+ const colTemplate = `repeat(${comp.keptColumns}, minmax(0, 1fr))`;
60
125
  const gap = `calc(${l.gap ?? DEFAULT_GAP} * 0.25rem)`;
61
- const colGap = l.columns > 1 ? `min(${gap}, calc(100% / ${l.columns - 1}))` : gap;
62
- let rowTemplate = "";
63
- if (l.rows) {
64
- const grows = Array.from({ length: l.rows }, () => false);
65
- for (const p of placedBlocks.value) {
66
- if (!p.entry.metadata?.h?.grow) continue;
67
- const [[, y1], [, y2]] = p.placement.area;
68
- const lo = Math.max(1, y1);
69
- const hi = Math.min(l.rows, y2 - 1);
70
- for (let r = lo; r <= hi; r++) grows[r - 1] = true;
71
- }
72
- rowTemplate = grows.map((g) => g ? "auto" : "minmax(auto, 1fr)").join(" ");
73
- }
126
+ const colGap = comp.keptColumns > 1 ? `min(${gap}, calc(100% / ${comp.keptColumns - 1}))` : gap;
74
127
  const parts = [
75
128
  "display: grid",
76
- `grid-template-columns: ${tracks(l.columns, "0")}`,
77
- rowTemplate ? `grid-template-rows: ${rowTemplate}` : "",
129
+ `grid-template-columns: ${colTemplate}`,
130
+ comp.rowTemplate ? `grid-template-rows: ${comp.rowTemplate}` : "",
78
131
  `column-gap: ${colGap}`,
79
132
  `row-gap: ${gap}`,
80
133
  l.style ?? ""
81
134
  ].filter(Boolean);
82
135
  return parts.join("; ");
83
136
  });
84
- function cellStyle(placement) {
137
+ function cellStyle(placement, comp) {
85
138
  const [[x1, y1], [x2, y2]] = placement.area;
86
- const parts = [`grid-column: ${x1} / ${x2}`, `grid-row: ${y1} / ${y2}`, "min-width: 0"];
139
+ const parts = [
140
+ `grid-column: ${comp.colLine[x1]} / ${comp.colLine[x2]}`,
141
+ `grid-row: ${comp.rowLine[y1]} / ${comp.rowLine[y2]}`,
142
+ "min-width: 0"
143
+ ];
87
144
  const h = placement.h && placement.h !== "stretch" ? placement.h : null;
88
145
  const v = placement.v && placement.v !== "stretch" ? placement.v : null;
89
146
  if (h || v) {
@@ -94,14 +151,16 @@ function cellStyle(placement) {
94
151
  }
95
152
  return parts.join("; ");
96
153
  }
97
- const rendered = computed(
98
- () => placedBlocks.value.map((p) => ({
154
+ const rendered = computed(() => {
155
+ const comp = compaction.value;
156
+ if (!comp) return [];
157
+ return placedBlocks.value.map((p) => ({
99
158
  key: p.block.id,
100
- style: cellStyle(p.placement),
159
+ style: cellStyle(p.placement, comp),
101
160
  component: p.entry.runtime,
102
161
  block: p.block
103
- }))
104
- );
162
+ }));
163
+ });
105
164
  function updateBlock(id, next) {
106
165
  const blocks = props.slotValue.blocks.map((b) => b.id === id ? next : b);
107
166
  emit("update:slotValue", { ...props.slotValue, blocks });
@@ -25,6 +25,7 @@ export declare const SCOPE_ADDRESS_VAR = "__scopes__";
25
25
  export declare const SELECTIONS_VAR = "selections";
26
26
  export declare const OPTIONS_VAR = "options";
27
27
  export declare const STEPS_VAR = "steps";
28
+ export declare const IDEMPOTENCY_KEY_VAR = "idempotencyKey";
28
29
  export type ScopeAccessor = Record<string, () => unknown>;
29
30
  export declare function provideCELContext(context: CELContext): void;
30
31
  export declare function injectCELContext(): CELContext;
@@ -123,10 +124,10 @@ export declare function useSelectionRoster(): Ref<ReadonlyArray<SelectionFieldRe
123
124
  * surfaces it. Unlike a selection field a trigger row has no designer-given
124
125
  * name, so `label` is its position —「第 N 步」— computed live from the row's
125
126
  * current index and thus following drag-and-drop reorders for free (the
126
- * persisted reference is `steps[?"<id>"]`; the label is never stored).
127
+ * persisted reference is `steps["<id>"]`; the label is never stored).
127
128
  */
128
129
  export type StepRef = Readonly<{
129
- /** Trigger-row uuid keyed into `steps[?"<id>"]` — the publish address. */
130
+ /** Trigger-row uuid keyed into `steps["<id>"]` — the publish address. */
130
131
  id: string;
131
132
  /** Position label,「第 N 步」, derived from the row's current index. */
132
133
  label: string;
@@ -12,6 +12,7 @@ export const SCOPE_ADDRESS_VAR = "__scopes__";
12
12
  export const SELECTIONS_VAR = "selections";
13
13
  export const OPTIONS_VAR = "options";
14
14
  export const STEPS_VAR = "steps";
15
+ export const IDEMPOTENCY_KEY_VAR = "idempotencyKey";
15
16
  const CEL_CONTEXT_KEY = Symbol("cel-context");
16
17
  export function provideCELContext(context) {
17
18
  const parent = injectLocal(CEL_CONTEXT_KEY, {});