@shwfed/config 2.9.3 → 2.9.5

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 (172) hide show
  1. package/dist/mcp.mjs +566 -102
  2. package/dist/module.json +1 -1
  3. package/dist/module.mjs +1 -0
  4. package/dist/preview/assets/FieldGroup.vue_vue_type_script_setup_true_lang-BZCeJsQD.js +1 -0
  5. package/dist/preview/assets/badge-muf_N5bh.js +1 -0
  6. package/dist/preview/assets/config-BDWlpbYr.js +1 -0
  7. package/dist/preview/assets/config-BbrX8RJn.js +1 -0
  8. package/dist/preview/assets/config-BeW9pIO6.js +1 -0
  9. package/dist/preview/assets/config-BmmWdZ8T.js +1 -0
  10. package/dist/preview/assets/config-CX1fFOhS.js +1 -0
  11. package/dist/preview/assets/config-CZHJLTaX.js +1 -0
  12. package/dist/preview/assets/config-CoEYHQXh.js +1 -0
  13. package/dist/preview/assets/config-DkiDpKM2.js +1 -0
  14. package/dist/preview/assets/config-DygE8cbP.js +1 -0
  15. package/dist/preview/assets/config-qlTY-CeE.js +1 -0
  16. package/dist/preview/assets/config-r9XM4u1X.js +1 -0
  17. package/dist/preview/assets/definition.vue_vue_type_script_setup_true_lang-BFjgX5YL.js +1 -0
  18. package/dist/preview/assets/{index-CNgUJDgV.js → index-CHKIlDe0.js} +1 -1
  19. package/dist/preview/assets/{index-DZS4TKGX.js → index-CJHF5AcW.js} +217 -186
  20. package/dist/preview/assets/index-OJPhCe6w.js +1 -0
  21. package/dist/preview/assets/index-vPcvbp7e.css +1 -0
  22. package/dist/preview/assets/item-9Thi-zcK.js +1 -0
  23. package/dist/preview/assets/runtime-B2Q3DRbZ.js +1 -0
  24. package/dist/preview/assets/{runtime-Caf4c7Qr.js → runtime-BnExhm-v.js} +1 -1
  25. package/dist/preview/assets/runtime-BrCQ7TVd.js +1 -0
  26. package/dist/preview/assets/runtime-BstyXj1z.js +1 -0
  27. package/dist/preview/assets/runtime-ByhubOtA.js +1 -0
  28. package/dist/preview/assets/runtime-CE6eAbTE.js +1 -0
  29. package/dist/preview/assets/runtime-CdDJ6rEl.js +1 -0
  30. package/dist/preview/assets/runtime-DEHzrByN.js +1 -0
  31. package/dist/preview/assets/runtime-DM9caqw1.js +1 -0
  32. package/dist/preview/assets/{runtime-DNRZcUw_.js → runtime-DkLPBvxW.js} +1 -1
  33. package/dist/preview/index.html +2 -2
  34. package/dist/runtime/components/actions/buttons/2026-04-18/com.shwfed.actions.button.http.request.json/config.d.vue.ts +20 -0
  35. package/dist/runtime/components/actions/buttons/2026-04-18/com.shwfed.actions.button.http.request.json/config.vue.d.ts +20 -0
  36. package/dist/runtime/components/actions/buttons/2026-04-18/com.shwfed.actions.button.http.request.json/schema.d.ts +22 -0
  37. package/dist/runtime/components/actions/buttons/2026-04-18/com.shwfed.actions.button.http.request.json/schema.js +33 -1
  38. package/dist/runtime/components/actions/buttons/2026-04-18/com.shwfed.actions.button.http.request.json.confirm/config.d.vue.ts +20 -0
  39. package/dist/runtime/components/actions/buttons/2026-04-18/com.shwfed.actions.button.http.request.json.confirm/config.vue.d.ts +20 -0
  40. package/dist/runtime/components/actions/buttons/2026-04-18/com.shwfed.actions.button.http.request.json.confirm/schema.d.ts +10 -0
  41. package/dist/runtime/components/actions/buttons/2026-05-15/com.shwfed.actions.button.event.dispatch/config.d.vue.ts +4 -0
  42. package/dist/runtime/components/actions/buttons/2026-05-15/com.shwfed.actions.button.event.dispatch/config.vue.d.ts +4 -0
  43. package/dist/runtime/components/actions/buttons/2026-05-15/com.shwfed.actions.button.event.dispatch/schema.d.ts +2 -0
  44. package/dist/runtime/components/actions/buttons/2026-05-21/com.shwfed.actions.button.http.download/config.d.vue.ts +16 -0
  45. package/dist/runtime/components/actions/buttons/2026-05-21/com.shwfed.actions.button.http.download/config.vue.d.ts +16 -0
  46. package/dist/runtime/components/actions/buttons/2026-05-21/com.shwfed.actions.button.http.download/schema.d.ts +8 -0
  47. package/dist/runtime/components/actions/buttons/2026-05-24/com.shwfed.actions.button.state.write/config.d.vue.ts +4 -0
  48. package/dist/runtime/components/actions/buttons/2026-05-24/com.shwfed.actions.button.state.write/config.vue.d.ts +4 -0
  49. package/dist/runtime/components/actions/buttons/2026-05-24/com.shwfed.actions.button.state.write/schema.d.ts +2 -0
  50. package/dist/runtime/components/actions/buttons/2026-06-08/com.shwfed.actions.button.http.request.json.batch/config.d.vue.ts +51 -0
  51. package/dist/runtime/components/actions/buttons/2026-06-08/com.shwfed.actions.button.http.request.json.batch/config.vue +201 -0
  52. package/dist/runtime/components/actions/buttons/2026-06-08/com.shwfed.actions.button.http.request.json.batch/config.vue.d.ts +51 -0
  53. package/dist/runtime/components/actions/buttons/2026-06-08/com.shwfed.actions.button.http.request.json.batch/runtime.d.vue.ts +8 -0
  54. package/dist/runtime/components/actions/buttons/2026-06-08/com.shwfed.actions.button.http.request.json.batch/runtime.vue +37 -0
  55. package/dist/runtime/components/actions/buttons/2026-06-08/com.shwfed.actions.button.http.request.json.batch/runtime.vue.d.ts +8 -0
  56. package/dist/runtime/components/actions/buttons/2026-06-08/com.shwfed.actions.button.http.request.json.batch/schema.d.ts +30 -0
  57. package/dist/runtime/components/actions/buttons/2026-06-08/com.shwfed.actions.button.http.request.json.batch/schema.js +87 -0
  58. package/dist/runtime/components/actions/components/triggers-field.d.vue.ts +4 -0
  59. package/dist/runtime/components/actions/components/triggers-field.vue +65 -7
  60. package/dist/runtime/components/actions/components/triggers-field.vue.d.ts +4 -0
  61. package/dist/runtime/components/actions/config.vue +68 -1
  62. package/dist/runtime/components/actions/utils/resolve.d.ts +85 -2
  63. package/dist/runtime/components/actions/utils/resolve.js +122 -21
  64. package/dist/runtime/components/app.vue +59 -4
  65. package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.table/config.d.vue.ts +2 -2
  66. package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.table/config.vue.d.ts +2 -2
  67. package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.table/runtime.d.vue.ts +2 -2
  68. package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.table/runtime.vue.d.ts +2 -2
  69. package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.table/schema.d.ts +1 -1
  70. package/dist/runtime/components/config/index.vue +9 -2
  71. package/dist/runtime/components/config/schema.d.ts +6 -10
  72. package/dist/runtime/components/config/schema.js +12 -2
  73. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.daterange/config.d.vue.ts +4 -4
  74. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.daterange/config.vue.d.ts +4 -4
  75. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.datetimerange/config.d.vue.ts +6 -6
  76. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.datetimerange/config.vue.d.ts +6 -6
  77. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.timerange/config.d.vue.ts +2 -2
  78. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.timerange/config.vue.d.ts +2 -2
  79. package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.number/config.d.vue.ts +2 -2
  80. package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.number/config.vue.d.ts +2 -2
  81. package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.numberrange/config.d.vue.ts +2 -2
  82. package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.numberrange/config.vue.d.ts +2 -2
  83. package/dist/runtime/components/form/fields/2026-05-13/com.shwfed.form.field.list/config.d.vue.ts +2 -2
  84. package/dist/runtime/components/form/fields/2026-05-13/com.shwfed.form.field.list/config.vue.d.ts +2 -2
  85. package/dist/runtime/components/form/fields/2026-05-13/com.shwfed.form.field.list/schema.d.ts +1 -1
  86. package/dist/runtime/components/form/fields/2026-05-24/com.shwfed.form.field.monthrange/config.d.vue.ts +4 -4
  87. package/dist/runtime/components/form/fields/2026-05-24/com.shwfed.form.field.monthrange/config.vue.d.ts +4 -4
  88. package/dist/runtime/components/operations/2026-06-09/com.shwfed.operation.alert/config.d.vue.ts +31 -0
  89. package/dist/runtime/components/operations/2026-06-09/com.shwfed.operation.alert/config.vue +89 -0
  90. package/dist/runtime/components/operations/2026-06-09/com.shwfed.operation.alert/config.vue.d.ts +31 -0
  91. package/dist/runtime/components/operations/2026-06-09/com.shwfed.operation.alert/runtime.d.ts +2 -0
  92. package/dist/runtime/components/operations/2026-06-09/com.shwfed.operation.alert/runtime.js +14 -0
  93. package/dist/runtime/components/operations/2026-06-09/com.shwfed.operation.alert/schema.d.ts +21 -0
  94. package/dist/runtime/components/operations/2026-06-09/com.shwfed.operation.alert/schema.js +36 -0
  95. package/dist/runtime/components/operations/utils/resolve.d.ts +48 -0
  96. package/dist/runtime/components/operations/utils/resolve.js +73 -0
  97. package/dist/runtime/components/table/columns/2026-05-13/com.shwfed.table.column.switch/schema.d.ts +2 -0
  98. package/dist/runtime/components/table/columns/2026-05-13/com.shwfed.table.column.switch.remote/schema.d.ts +2 -0
  99. package/dist/runtime/components/table/columns/2026-05-24/com.shwfed.table.column.combobox-single.remote.options-remote/config.d.vue.ts +4 -0
  100. package/dist/runtime/components/table/columns/2026-05-24/com.shwfed.table.column.combobox-single.remote.options-remote/config.vue.d.ts +4 -0
  101. package/dist/runtime/components/table/columns/2026-05-24/com.shwfed.table.column.combobox-single.remote.options-remote/schema.d.ts +2 -0
  102. package/dist/runtime/components/table/columns/2026-05-24/com.shwfed.table.column.combobox-single.remote.options-static/config.d.vue.ts +4 -0
  103. package/dist/runtime/components/table/columns/2026-05-24/com.shwfed.table.column.combobox-single.remote.options-static/config.vue.d.ts +4 -0
  104. package/dist/runtime/components/table/columns/2026-05-24/com.shwfed.table.column.combobox-single.remote.options-static/schema.d.ts +2 -0
  105. package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-remote/config.d.vue.ts +4 -0
  106. package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-remote/config.vue.d.ts +4 -0
  107. package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-remote/schema.d.ts +2 -0
  108. package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-static/config.d.vue.ts +4 -0
  109. package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-static/config.vue.d.ts +4 -0
  110. package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-static/schema.d.ts +2 -0
  111. package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-multi.remote/config.d.vue.ts +4 -0
  112. package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-multi.remote/config.vue.d.ts +4 -0
  113. package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-multi.remote/schema.d.ts +2 -0
  114. package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-single.remote/config.d.vue.ts +4 -0
  115. package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-single.remote/config.vue.d.ts +4 -0
  116. package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-single.remote/schema.d.ts +2 -0
  117. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-multi/config.d.vue.ts +4 -0
  118. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-multi/config.vue.d.ts +4 -0
  119. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-multi/schema.d.ts +4 -0
  120. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-single/config.d.vue.ts +4 -0
  121. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-single/config.vue.d.ts +4 -0
  122. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-single/schema.d.ts +4 -0
  123. package/dist/runtime/components/table/schema.d.ts +2 -2
  124. package/dist/runtime/components/ui/date-picker/DatePickerInput.d.vue.ts +1 -1
  125. package/dist/runtime/components/ui/date-picker/DatePickerInput.vue.d.ts +1 -1
  126. package/dist/runtime/components/ui/date-picker/DatePickerTimeInput.d.vue.ts +1 -1
  127. package/dist/runtime/components/ui/date-picker/DatePickerTimeInput.vue.d.ts +1 -1
  128. package/dist/runtime/components/ui/date-range-picker/DateRangePickerInput.d.vue.ts +1 -1
  129. package/dist/runtime/components/ui/date-range-picker/DateRangePickerInput.vue.d.ts +1 -1
  130. package/dist/runtime/components/ui/date-range-picker/DateRangePickerTimeInput.d.vue.ts +2 -2
  131. package/dist/runtime/components/ui/date-range-picker/DateRangePickerTimeInput.vue.d.ts +2 -2
  132. package/dist/runtime/components/ui/progress/Progress.d.vue.ts +11 -0
  133. package/dist/runtime/components/ui/progress/Progress.vue +32 -0
  134. package/dist/runtime/components/ui/progress/Progress.vue.d.ts +11 -0
  135. package/dist/runtime/components/ui/progress/index.d.ts +1 -0
  136. package/dist/runtime/components/ui/progress/index.js +1 -0
  137. package/dist/runtime/composables/useOverlay.d.ts +35 -0
  138. package/dist/runtime/composables/useOverlay.js +52 -0
  139. package/dist/runtime/share/event-bus.d.ts +24 -2
  140. package/dist/runtime/share/event-bus.js +21 -3
  141. package/dist/runtime/share/interpolate.d.ts +12 -0
  142. package/dist/runtime/share/interpolate.js +18 -0
  143. package/dist/runtime/share/page-target.d.ts +16 -0
  144. package/dist/runtime/share/page-target.js +1 -0
  145. package/dist/runtime/share/schema-meta.d.ts +5 -0
  146. package/dist/runtime/share/schema-meta.js +48 -0
  147. package/dist/runtime/style.css +1 -1
  148. package/dist/runtime/vendor/cel-js/CLAUDE.md +2 -0
  149. package/dist/runtime/vendor/cel-js/PROMPT.md +9 -0
  150. package/dist/runtime/vendor/cel-js/lib/functions.js +8 -0
  151. package/package.json +1 -1
  152. package/dist/preview/assets/badge-CY7N4tzE.js +0 -1
  153. package/dist/preview/assets/config-B6xtqPys.js +0 -1
  154. package/dist/preview/assets/config-BI9O-CMH.js +0 -1
  155. package/dist/preview/assets/config-C9LThFFM.js +0 -1
  156. package/dist/preview/assets/config-CdTo0RnO.js +0 -1
  157. package/dist/preview/assets/config-Ch-uzD4K.js +0 -1
  158. package/dist/preview/assets/config-Cou30eMf.js +0 -1
  159. package/dist/preview/assets/config-CqhZtEzh.js +0 -1
  160. package/dist/preview/assets/config-D0e-dO3Y.js +0 -1
  161. package/dist/preview/assets/config-D2iQ1cHu.js +0 -1
  162. package/dist/preview/assets/definition.vue_vue_type_script_setup_true_lang-8UNFiK_W.js +0 -1
  163. package/dist/preview/assets/index-BTleLwMz.js +0 -1
  164. package/dist/preview/assets/index-COSjWreD.css +0 -1
  165. package/dist/preview/assets/item-Cjwnz068.js +0 -1
  166. package/dist/preview/assets/runtime-BHXxRkau.js +0 -1
  167. package/dist/preview/assets/runtime-BhLcYJQW.js +0 -1
  168. package/dist/preview/assets/runtime-Bi-TAMSI.js +0 -1
  169. package/dist/preview/assets/runtime-Bxhg8fck.js +0 -1
  170. package/dist/preview/assets/runtime-CiHPMpFW.js +0 -1
  171. package/dist/preview/assets/runtime-DLY_TObR.js +0 -1
  172. package/dist/preview/assets/runtime-ncpmo94E.js +0 -1
@@ -152,6 +152,8 @@ export declare function writeSchema(configure: (env: Environment) => void): Sche
152
152
  triggers: Schema.optional<Schema.Array$<Schema.Struct<{
153
153
  target: Schema.refine<string, typeof Schema.String>;
154
154
  operation: Schema.SchemaClass<string, string, never>;
155
+ compatibilityDate: Schema.optional<Schema.SchemaClass<string, string, never>>;
156
+ params: Schema.optional<Schema.SchemaClass<unknown, unknown, never>>;
155
157
  }>>>;
156
158
  }>]>;
157
159
  export declare function schema(configure: (env: Environment) => void): Schema.Struct<{
@@ -267,6 +269,8 @@ export declare function schema(configure: (env: Environment) => void): Schema.St
267
269
  triggers: Schema.optional<Schema.Array$<Schema.Struct<{
268
270
  target: Schema.refine<string, typeof Schema.String>;
269
271
  operation: Schema.SchemaClass<string, string, never>;
272
+ compatibilityDate: Schema.optional<Schema.SchemaClass<string, string, never>>;
273
+ params: Schema.optional<Schema.SchemaClass<unknown, unknown, never>>;
270
274
  }>>>;
271
275
  }>]>, {
272
276
  default: () => {
@@ -164,8 +164,8 @@ export declare function TableConfig(configure: (env: Environment) => void): Sche
164
164
  } | undefined;
165
165
  readonly dataSource?: {
166
166
  readonly data: string;
167
- readonly request?: string | undefined;
168
167
  readonly total?: string | undefined;
168
+ readonly request?: string | undefined;
169
169
  } | undefined;
170
170
  readonly actions?: {
171
171
  readonly size: "default" | "sm" | "xs";
@@ -614,8 +614,8 @@ export declare function createTableConfig(body: Omit<Schema.Schema.Type<ReturnTy
614
614
  } | undefined;
615
615
  dataSource?: {
616
616
  readonly data: string;
617
- readonly request?: string | undefined;
618
617
  readonly total?: string | undefined;
618
+ readonly request?: string | undefined;
619
619
  } | undefined;
620
620
  actions?: {
621
621
  readonly size: "default" | "sm" | "xs";
@@ -24,8 +24,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {
24
24
  "onUpdate:modelValue"?: ((args_0: Date | undefined) => any) | undefined;
25
25
  }>, {
26
26
  size: "sm" | "md" | "lg";
27
- clearIcon: string;
28
27
  clearable: boolean;
28
+ clearIcon: string;
29
29
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
30
30
  declare const _default: typeof __VLS_export;
31
31
  export default _default;
@@ -24,8 +24,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {
24
24
  "onUpdate:modelValue"?: ((args_0: Date | undefined) => any) | undefined;
25
25
  }>, {
26
26
  size: "sm" | "md" | "lg";
27
- clearIcon: string;
28
27
  clearable: boolean;
28
+ clearIcon: string;
29
29
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
30
30
  declare const _default: typeof __VLS_export;
31
31
  export default _default;
@@ -22,8 +22,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {
22
22
  size: "sm" | "md" | "lg";
23
23
  granularity: "hour" | "minute" | "second";
24
24
  hourCycle: 12 | 24;
25
- clearIcon: string;
26
25
  clearable: boolean;
26
+ clearIcon: string;
27
27
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
28
28
  declare const _default: typeof __VLS_export;
29
29
  export default _default;
@@ -22,8 +22,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {
22
22
  size: "sm" | "md" | "lg";
23
23
  granularity: "hour" | "minute" | "second";
24
24
  hourCycle: 12 | 24;
25
- clearIcon: string;
26
25
  clearable: boolean;
26
+ clearIcon: string;
27
27
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
28
28
  declare const _default: typeof __VLS_export;
29
29
  export default _default;
@@ -29,8 +29,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {
29
29
  "onUpdate:endValue"?: ((args_0: Date | undefined) => any) | undefined;
30
30
  }>, {
31
31
  size: "sm" | "md" | "lg";
32
- clearIcon: string;
33
32
  clearable: boolean;
33
+ clearIcon: string;
34
34
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
35
35
  declare const _default: typeof __VLS_export;
36
36
  export default _default;
@@ -29,8 +29,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {
29
29
  "onUpdate:endValue"?: ((args_0: Date | undefined) => any) | undefined;
30
30
  }>, {
31
31
  size: "sm" | "md" | "lg";
32
- clearIcon: string;
33
32
  clearable: boolean;
33
+ clearIcon: string;
34
34
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
35
35
  declare const _default: typeof __VLS_export;
36
36
  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
- rangeSeparatorIcon: string;
30
- clearIcon: string;
31
29
  clearable: boolean;
30
+ clearIcon: string;
31
+ rangeSeparatorIcon: string;
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
- rangeSeparatorIcon: string;
30
- clearIcon: string;
31
29
  clearable: boolean;
30
+ clearIcon: string;
31
+ rangeSeparatorIcon: string;
32
32
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
33
33
  declare const _default: typeof __VLS_export;
34
34
  export default _default;
@@ -0,0 +1,11 @@
1
+ import type { ProgressRootProps } from 'reka-ui';
2
+ import type { HTMLAttributes } from 'vue';
3
+ type __VLS_Props = ProgressRootProps & {
4
+ class?: HTMLAttributes['class'];
5
+ indicatorClass?: HTMLAttributes['class'];
6
+ };
7
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
8
+ modelValue: number | null;
9
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
10
+ declare const _default: typeof __VLS_export;
11
+ export default _default;
@@ -0,0 +1,32 @@
1
+ <script setup>
2
+ import { reactiveOmit } from "@vueuse/core";
3
+ import { ProgressIndicator, ProgressRoot, useForwardProps } from "reka-ui";
4
+ import { cn } from "../../../utils/cn";
5
+ defineOptions({ name: "UiProgress" });
6
+ const props = defineProps({
7
+ modelValue: { type: [Number, null], required: false, default: 0 },
8
+ max: { type: Number, required: false },
9
+ getValueLabel: { type: Function, required: false },
10
+ getValueText: { type: Function, required: false },
11
+ asChild: { type: Boolean, required: false },
12
+ as: { type: null, required: false },
13
+ class: { type: [Boolean, null, String, Object, Array], required: false, skipCheck: true },
14
+ indicatorClass: { type: [Boolean, null, String, Object, Array], required: false, skipCheck: true }
15
+ });
16
+ const delegatedProps = reactiveOmit(props, "class", "indicatorClass");
17
+ const forwarded = useForwardProps(delegatedProps);
18
+ </script>
19
+
20
+ <template>
21
+ <ProgressRoot
22
+ data-slot="progress"
23
+ v-bind="forwarded"
24
+ :class="cn('bg-zinc-200 relative h-2 w-full overflow-hidden rounded-full', props.class)"
25
+ >
26
+ <ProgressIndicator
27
+ data-slot="progress-indicator"
28
+ :class="cn('relative block h-full w-full overflow-hidden transition-transform duration-[660ms] ease-[cubic-bezier(0.65,0,0.35,1)] after:absolute after:inset-0 after:animate-progress after:content-[\'\'] after:bg-[linear-gradient(-45deg,_rgba(255,255,255,0.2)_25%,_transparent_25%,_transparent_50%,_rgba(255,255,255,0.2)_50%,_rgba(255,255,255,0.2)_75%,_transparent_75%,_transparent)] after:bg-[length:30px_30px]', props.indicatorClass ?? 'bg-(--primary)')"
29
+ :style="`transform: translateX(-${100 - (props.modelValue ?? 0)}%);`"
30
+ />
31
+ </ProgressRoot>
32
+ </template>
@@ -0,0 +1,11 @@
1
+ import type { ProgressRootProps } from 'reka-ui';
2
+ import type { HTMLAttributes } from 'vue';
3
+ type __VLS_Props = ProgressRootProps & {
4
+ class?: HTMLAttributes['class'];
5
+ indicatorClass?: HTMLAttributes['class'];
6
+ };
7
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
8
+ modelValue: number | null;
9
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
10
+ declare const _default: typeof __VLS_export;
11
+ export default _default;
@@ -0,0 +1 @@
1
+ export { default as Progress } from './Progress.vue.js';
@@ -0,0 +1 @@
1
+ export { default as Progress } from "./Progress.vue";
@@ -59,10 +59,38 @@ type AlertSession = {
59
59
  pendingResult?: boolean;
60
60
  finalizeScheduled?: boolean;
61
61
  };
62
+ type ProgressSession = {
63
+ progressId: string;
64
+ open: boolean;
65
+ total: number;
66
+ done: number;
67
+ content: string;
68
+ cancellable: boolean;
69
+ cancelled: boolean;
70
+ finished: boolean;
71
+ failed: boolean;
72
+ };
73
+ export type ProgressHandle = Readonly<{
74
+ progressId: string;
75
+ /** Mark one more unit of work done — advances the bar. */
76
+ advance: Effect.Effect<void>;
77
+ /** Replace the dialog's markdown body (re-rendered as counts change). */
78
+ setContent: (content: string) => Effect.Effect<void>;
79
+ /** Whether the user has hit Cancel — poll between units of work. */
80
+ isCancelled: Effect.Effect<boolean>;
81
+ /** Flag that a unit of work failed — turns the bar red for the rest of the run. */
82
+ markFailed: Effect.Effect<void>;
83
+ /**
84
+ * Mark the work done. The dialog stays on screen (showing the final state)
85
+ * until the user closes it — run this from a finalizer so it always fires.
86
+ */
87
+ finish: Effect.Effect<void>;
88
+ }>;
62
89
  interface OverlayRuntime {
63
90
  definitions: Readonly<Record<string, OverlayDefinition>>;
64
91
  sessions: ReadonlyArray<OverlaySession>;
65
92
  alerts: ReadonlyArray<AlertSession>;
93
+ progress: ReadonlyArray<ProgressSession>;
66
94
  topSession: OverlaySession | undefined;
67
95
  registerDefinition: (definition: OverlayDefinition) => void;
68
96
  unregisterDefinition: (definitionId: string, ownerId?: string) => void;
@@ -79,6 +107,13 @@ interface OverlayRuntime {
79
107
  color?: string;
80
108
  }) => Effect.Effect<boolean>;
81
109
  closeAlert: (alertId: string, result: boolean, explicit?: boolean) => Effect.Effect<void>;
110
+ openProgress: (input: {
111
+ total: number;
112
+ cancellable: boolean;
113
+ content: string;
114
+ }) => Effect.Effect<ProgressHandle>;
115
+ cancelProgress: (progressId: string) => void;
116
+ closeProgress: (progressId: string) => void;
82
117
  }
83
118
  export type { OverlayDefinition };
84
119
  export declare function useOverlay(): OverlayRuntime;
@@ -10,6 +10,52 @@ function createOverlayRuntime() {
10
10
  const definitions = reactive({});
11
11
  const sessions = ref([]);
12
12
  const alerts = ref([]);
13
+ const progress = ref([]);
14
+ function openProgress(input) {
15
+ return Effect.sync(() => {
16
+ const progressId = crypto.randomUUID();
17
+ progress.value.push({
18
+ progressId,
19
+ open: true,
20
+ total: input.total,
21
+ done: 0,
22
+ content: input.content,
23
+ cancellable: input.cancellable,
24
+ cancelled: false,
25
+ finished: false,
26
+ failed: false
27
+ });
28
+ const live = progress.value[progress.value.length - 1];
29
+ return {
30
+ progressId,
31
+ advance: Effect.sync(() => {
32
+ live.done += 1;
33
+ }),
34
+ setContent: (content) => Effect.sync(() => {
35
+ live.content = content;
36
+ }),
37
+ isCancelled: Effect.sync(() => live.cancelled),
38
+ markFailed: Effect.sync(() => {
39
+ live.failed = true;
40
+ }),
41
+ finish: Effect.sync(() => {
42
+ live.finished = true;
43
+ })
44
+ };
45
+ });
46
+ }
47
+ function cancelProgress(progressId) {
48
+ const session = progress.value.find((p) => p.progressId === progressId);
49
+ if (session) {
50
+ session.cancelled = true;
51
+ }
52
+ }
53
+ function closeProgress(progressId) {
54
+ const index = progress.value.findIndex((p) => p.progressId === progressId);
55
+ if (index >= 0) {
56
+ progress.value.splice(index, 1);
57
+ }
58
+ }
13
59
  function openAlert(input) {
14
60
  return Effect.gen(function* () {
15
61
  const deferred = yield* Deferred.make();
@@ -192,6 +238,9 @@ function createOverlayRuntime() {
192
238
  get alerts() {
193
239
  return alerts.value;
194
240
  },
241
+ get progress() {
242
+ return progress.value;
243
+ },
195
244
  get topSession() {
196
245
  return sessions.value.at(-1);
197
246
  },
@@ -220,6 +269,9 @@ function createOverlayRuntime() {
220
269
  }),
221
270
  openAlert,
222
271
  closeAlert,
272
+ openProgress,
273
+ cancelProgress,
274
+ closeProgress,
223
275
  finalizeClose
224
276
  };
225
277
  return runtime;
@@ -6,6 +6,13 @@ export type OpRequest = Readonly<{
6
6
  target: string;
7
7
  /** Operation id from that component type's capability manifest. */
8
8
  operation: string;
9
+ /**
10
+ * Configured params for a parameterized operation, carried verbatim from the
11
+ * trigger row to the handler. Absent for param-less ops. The bus does not
12
+ * interpret or resolve these — what they mean, and against which context any
13
+ * CEL/locale in them resolves, is the receiving operation's own concern.
14
+ */
15
+ params?: unknown;
9
16
  }>;
10
17
  /**
11
18
  * The persisted form of a trigger — one stored row addressing an ancestor
@@ -15,6 +22,8 @@ export type OpRequest = Readonly<{
15
22
  export declare const Trigger: Schema.Struct<{
16
23
  target: Schema.refine<string, typeof Schema.String>;
17
24
  operation: Schema.SchemaClass<string, string, never>;
25
+ compatibilityDate: Schema.optional<Schema.SchemaClass<string, string, never>>;
26
+ params: Schema.optional<Schema.SchemaClass<unknown, unknown, never>>;
18
27
  }>;
19
28
  /**
20
29
  * An ordered list of triggers. A button that fires triggers embeds this as
@@ -26,6 +35,8 @@ export declare const Trigger: Schema.Struct<{
26
35
  export declare const Triggers: Schema.Array$<Schema.Struct<{
27
36
  target: Schema.refine<string, typeof Schema.String>;
28
37
  operation: Schema.SchemaClass<string, string, never>;
38
+ compatibilityDate: Schema.optional<Schema.SchemaClass<string, string, never>>;
39
+ params: Schema.optional<Schema.SchemaClass<unknown, unknown, never>>;
29
40
  }>>;
30
41
  /** One stored trigger row. */
31
42
  export type TriggerValue = Schema.Schema.Type<typeof Trigger>;
@@ -41,7 +52,10 @@ export type EventChannel = Readonly<{
41
52
  }>;
42
53
  /**
43
54
  * Operation id → handler, for one operation-exposing instance. Handlers
44
- * return an Effect so the bus can run them serially and in order.
55
+ * return an Effect so the bus can run them serially and in order, and receive
56
+ * the request's `params` (the configured params of a parameterized operation;
57
+ * `undefined` for param-less ops — a handler that ignores the arg is the
58
+ * common case and stays assignable).
45
59
  *
46
60
  * The `void` error channel pins handlers as infallible *failures* — a handler
47
61
  * that hits a recoverable hiccup must swallow/log it internally (mirrors the
@@ -65,7 +79,7 @@ export type EventChannel = Readonly<{
65
79
  * pre-request trigger list, so validation is explicit and configured rather
66
80
  * than an implicit host gate.
67
81
  */
68
- export type OperationHandlers = Readonly<Record<string, () => Effect.Effect<void>>>;
82
+ export type OperationHandlers = Readonly<Record<string, (params?: unknown) => Effect.Effect<void>>>;
69
83
  export declare const EVENT_CHANNEL_KEY: InjectionKey<EventChannel>;
70
84
  /**
71
85
  * Build a channel node for an operation-exposing instance. `dispatch` runs
@@ -105,6 +119,14 @@ export type OperationDescriptor = Readonly<{
105
119
  id: string;
106
120
  name: string;
107
121
  icon?: string;
122
+ /**
123
+ * Present iff this operation is parameterized — the `compatibilityDate` of
124
+ * its operation-block in the operations registry. The trigger editor reads
125
+ * it to know an op carries params: on add it seeds `defaults()` and renders
126
+ * the op's `config.vue`; `id` doubles as the operation-block `type`. Absent
127
+ * for param-less ops (close / validate / refetch).
128
+ */
129
+ compatibilityDate?: string;
108
130
  }>;
109
131
  /** An operation-exposing ancestor instance, as seen by the trigger config UI. */
110
132
  export type EventAncestor = Readonly<{
@@ -6,7 +6,21 @@ export const Trigger = Schema.Struct({
6
6
  }),
7
7
  operation: Schema.String.annotations({
8
8
  description: "\u76EE\u6807\u7EC4\u4EF6\u80FD\u529B\u6E05\u5355\u4E2D\u7684\u64CD\u4F5C ID"
9
- })
9
+ }),
10
+ // Parameterized operations carry their version + configured params on the
11
+ // row. Both are optional and absent for param-less ops (close / validate /
12
+ // refetch), so every pre-existing `{ target, operation }` trigger stays
13
+ // valid — this additive shape is what keeps stored configs loading. `params`
14
+ // is opaque here: it is validated against the *target operation's* own
15
+ // schema (a cross-reference `target → type → operation`) in the trigger
16
+ // editor, not by this row schema, since the schema lives on the host's
17
+ // manifest rather than on the row.
18
+ compatibilityDate: Schema.optional(Schema.String.annotations({
19
+ description: "\u53C2\u6570\u5316\u64CD\u4F5C\u7684\u517C\u5BB9\u6027\u65E5\u671F\uFF1B\u65E0\u53C2\u64CD\u4F5C\u7701\u7565"
20
+ })),
21
+ params: Schema.optional(Schema.Unknown.annotations({
22
+ description: "\u64CD\u4F5C\u53C2\u6570\uFF0C\u6309\u76EE\u6807\u64CD\u4F5C\u7684 schema \u6821\u9A8C"
23
+ }))
10
24
  }).annotations({
11
25
  title: "Trigger",
12
26
  description: "\u4E00\u6761\u5411\u4E0A\u5192\u6CE1\u7684\u64CD\u4F5C\u8BF7\u6C42"
@@ -19,7 +33,7 @@ export const EVENT_CHANNEL_KEY = Symbol("shwfed/event-channel");
19
33
  export function createEventChannel(instanceId, operations, parent) {
20
34
  return {
21
35
  dispatch(request) {
22
- const handled = request.target === instanceId ? operations[request.operation]?.() ?? Effect.void : Effect.void;
36
+ const handled = request.target === instanceId ? operations[request.operation]?.(request.params) ?? Effect.void : Effect.void;
23
37
  return parent ? Effect.andThen(handled, parent.dispatch(request)) : handled;
24
38
  }
25
39
  };
@@ -35,7 +49,11 @@ export function dispatchTriggers(channel, triggers) {
35
49
  if (!channel || !triggers || triggers.length === 0) return Effect.void;
36
50
  return Effect.forEach(
37
51
  triggers,
38
- (trigger) => channel.dispatch({ target: trigger.target, operation: trigger.operation }),
52
+ (trigger) => channel.dispatch({
53
+ target: trigger.target,
54
+ operation: trigger.operation,
55
+ params: trigger.params
56
+ }),
39
57
  { discard: true }
40
58
  );
41
59
  }
@@ -0,0 +1,12 @@
1
+ import { Effect } from 'effect';
2
+ export type CelEvaluator = <T>(expression: string, context?: Record<string, unknown>) => Effect.Effect<T, any>;
3
+ /** Render a CEL result for inline interpolation — objects as JSON, nullish as ''. */
4
+ export declare function stringifyCelResult(value: unknown): string;
5
+ /**
6
+ * Replace every `{{ expr }}` in `source` with the stringified result of
7
+ * evaluating `expr` against `$cel`. A blank `{{}}` renders literally, and an
8
+ * expression that throws is left verbatim so the author sees what failed. The
9
+ * evaluation is synchronous (`Effect.runSync`) — interpolation targets simple
10
+ * display strings, not async work.
11
+ */
12
+ export declare function interpolateMarkdown(source: string, $cel: CelEvaluator, context?: Record<string, unknown>): string;
@@ -0,0 +1,18 @@
1
+ import { Effect } from "effect";
2
+ const INTERPOLATION_RE = /\{\{(.*?)\}\}/gs;
3
+ export function stringifyCelResult(value) {
4
+ if (value === null || value === void 0) return "";
5
+ if (typeof value === "object") return JSON.stringify(value);
6
+ return String(value);
7
+ }
8
+ export function interpolateMarkdown(source, $cel, context) {
9
+ return source.replace(INTERPOLATION_RE, (_, expr) => {
10
+ const trimmed = expr.trim();
11
+ if (trimmed.length === 0) return "{{ }}";
12
+ try {
13
+ return stringifyCelResult(Effect.runSync($cel(trimmed, context)));
14
+ } catch {
15
+ return `{{${expr}}}`;
16
+ }
17
+ });
18
+ }
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Reserved sentinel instance id for the singleton page operation target. The
3
+ * page is the outermost `ShwfedConfig` — there is only ever one per tree, so it
4
+ * needs no stored, per-config id (which would force a migration of every
5
+ * existing page config). The nil UUID can never collide with a block id:
6
+ * `crypto.randomUUID()` always sets version-4 + variant bits, so it never
7
+ * emits all-zeros. It also passes `Schema.UUID`'s lenient hex-layout regex, so
8
+ * stored triggers targeting it decode cleanly.
9
+ *
10
+ * Lives in this dependency-free `share/` leaf rather than `config/schema.ts` so
11
+ * that block schemas which need to synthesize a page-targeted trigger (e.g. an
12
+ * action button's `migrate` rewriting a confirm dialog into an alert op) can
13
+ * reference it without importing `config/schema.ts` — that import would close
14
+ * the `actions → config → block.actions → actions` registry cycle.
15
+ */
16
+ export declare const PAGE_TARGET_ID = "00000000-0000-0000-0000-000000000000";
@@ -0,0 +1 @@
1
+ export const PAGE_TARGET_ID = "00000000-0000-0000-0000-000000000000";
@@ -0,0 +1,5 @@
1
+ import { type Schema } from 'effect';
2
+ type AnySchema = Schema.Schema<any, any, any>;
3
+ export declare function getStructFieldTitle(schema: AnySchema, fieldName: string): string | undefined;
4
+ export declare function getStructFieldDescription(schema: AnySchema, fieldName: string): string | undefined;
5
+ export {};
@@ -0,0 +1,48 @@
1
+ import { Option, SchemaAST } from "effect";
2
+ function getTypeLiteral(ast) {
3
+ switch (ast._tag) {
4
+ case "TypeLiteral":
5
+ return ast;
6
+ case "Transformation":
7
+ return getTypeLiteral(ast.to);
8
+ case "Refinement":
9
+ return getTypeLiteral(ast.from);
10
+ case "Suspend":
11
+ return getTypeLiteral(ast.f());
12
+ default:
13
+ return null;
14
+ }
15
+ }
16
+ function findPropertySignature(schema, fieldName) {
17
+ const tl = getTypeLiteral(schema.ast);
18
+ if (!tl) return null;
19
+ return tl.propertySignatures.find((p) => p.name === fieldName) ?? null;
20
+ }
21
+ function resolveFieldType(ps) {
22
+ const t = ps.type;
23
+ if (t._tag === "Union" && ps.isOptional) {
24
+ const nonUndef = t.types.find((m) => m._tag !== "UndefinedKeyword");
25
+ if (nonUndef) return nonUndef;
26
+ }
27
+ return t;
28
+ }
29
+ function getFieldAnnotation(schema, fieldName, getter) {
30
+ const ps = findPropertySignature(schema, fieldName);
31
+ if (!ps) return void 0;
32
+ const fromPS = getter(ps);
33
+ if (Option.isSome(fromPS)) return fromPS.value;
34
+ const resolved = resolveFieldType(ps);
35
+ const fromResolved = getter(resolved);
36
+ if (Option.isSome(fromResolved)) return fromResolved.value;
37
+ if (resolved !== ps.type) {
38
+ const fromType = getter(ps.type);
39
+ if (Option.isSome(fromType)) return fromType.value;
40
+ }
41
+ return void 0;
42
+ }
43
+ export function getStructFieldTitle(schema, fieldName) {
44
+ return getFieldAnnotation(schema, fieldName, SchemaAST.getTitleAnnotation);
45
+ }
46
+ export function getStructFieldDescription(schema, fieldName) {
47
+ return getFieldAnnotation(schema, fieldName, SchemaAST.getDescriptionAnnotation);
48
+ }
@@ -1 +1 @@
1
- @import "tailwindcss";@plugin "@tailwindcss/typography";@source "components";@utility prose-xs{font-size:.75rem;line-height:1.6666667}@theme{--font-sans:"Noto Sans","Noto Sans SC","Noto Sans JP","sans-serif";--font-mono:"Berkeley Mono","Fira Mono","monospace"}
1
+ @import "tailwindcss";@plugin "@tailwindcss/typography";@source "components";@utility prose-xs{font-size:.75rem;line-height:1.6666667}@theme{--font-sans:"Noto Sans","Noto Sans SC","Noto Sans JP","sans-serif";--font-mono:"Berkeley Mono","Fira Mono","monospace";--animate-progress:progress 1s linear infinite;@keyframes progress{0%{background-position:0 0}to{background-position:30px 30px}}}
@@ -16,6 +16,8 @@ A `range()` built-in has been added (not from upstream) — `range(number, numbe
16
16
 
17
17
  A `list.enumerate(): list<map<string, dyn>>` receiver method has been added (not from upstream, in `functions.ts` beside `list.size()`) — pairs each element with its 0-based index as a plain `{index, value}` record (CEL has no tuple type). It is a plain function, not a macro (no variable binding); the index is a `Decimal` so it stays a CEL `number` for downstream arithmetic. Receiver `list` resolves to `list<dyn>`, so it matches any list.
18
18
 
19
+ A `list.slice(number)` / `list.slice(number, number)` receiver pair has been added (not from upstream, in `functions.ts` beside `list.enumerate()`) — delegates straight to JS `Array.prototype.slice`, so negative indices count from the end (`list.slice(0, -1)` drops the last element) and out-of-range bounds clamp rather than throw. End is exclusive. Fills the gap left by CEL's `list[i]`, which has no negative indexing. Both overloads return `list<dyn>`.
20
+
19
21
  `evaluate` now returns `Effect<T, ParseError | EvaluationError | TypeError>` instead of a plain value. The entire evaluation pipeline is Effect-based — every AST node's `evaluate` function returns an Effect, and sub-expressions are composed via `Effect.gen` / `yield*`. Promise-based async handling has been removed. User-registered functions may return `Effect` values, which are automatically flatMapped into the evaluation pipeline. Import `Effect` from `effect` and use `Effect.runSync` or `Effect.runPromise` to execute the returned Effect.
20
22
 
21
23
  The `homogeneousAggregateLiterals` and `enableOptionalTypes` environment options have been removed. Aggregate data structures (lists, maps) are always heterogeneous — mixed-type literals are inferred as `list<dyn>` or `map<dyn, dyn>`. Optional types (`.?`, `[?]`, `optional.*` helpers) are always enabled.
@@ -139,6 +139,15 @@ items.enumerate().map(e, string(e.index) + ": " + e.value)
139
139
  ```
140
140
  Pairs each element with its 0-based index as `{index, value}` records (CEL has no tuple type). Works on any `list`. Returns `list<map<string, dyn>>`.
141
141
 
142
+ ### List slice
143
+ ```cel
144
+ [10, 20, 30, 40].slice(1) // [20, 30, 40] — from index 1 to end
145
+ [10, 20, 30, 40].slice(1, 3) // [20, 30] — start inclusive, end exclusive
146
+ [10, 20, 30, 40].slice(0, -1) // [10, 20, 30] — drop the last element
147
+ [10, 20, 30, 40].slice(-2) // [30, 40] — keep the last two
148
+ ```
149
+ Mirrors JS `Array.prototype.slice`. Negative indices count from the end (CEL's `list[i]` has no negative indexing). End is exclusive; out-of-range bounds clamp rather than throw. Works on any `list`; returns `list<dyn>`.
150
+
142
151
  ### String methods
143
152
  ```cel
144
153
  "hello".contains("ell") // true
@@ -54,6 +54,14 @@ export function registerFunctions(registry) {
54
54
  "list.enumerate(): list<map<string, dyn>>",
55
55
  (v) => v.map((value, i) => ({ index: Decimal.from(i), value }))
56
56
  );
57
+ functionOverload(
58
+ "list.slice(number): list<dyn>",
59
+ (v, start) => v.slice(toNum(start))
60
+ );
61
+ functionOverload(
62
+ "list.slice(number, number): list<dyn>",
63
+ (v, start, end) => v.slice(toNum(start), toNum(end))
64
+ );
57
65
  functionOverload("bytes(string): bytes", (v) => ByteOpts.fromString(v));
58
66
  functionOverload("bytes(bytes): bytes", identity);
59
67
  functionOverload("number(number): number", (v) => Decimal.from(v));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shwfed/config",
3
- "version": "2.9.3",
3
+ "version": "2.9.5",
4
4
  "description": "Configurable UI for SHWFED",
5
5
  "type": "module",
6
6
  "publishConfig": {
@@ -1 +0,0 @@
1
- import{d as M,G as $,u as z,o as E,w as p,a as f,z as F,c as w,A as x,b as m,_ as y,H as I,I as L,J as N,K as O,L as A,e as t,g as J,f as P,h as g,i as S,j as V,p as G,l as H,k as K,r as T,m as U,s as W,M as D,N as Q,t as R,q as X,v as Y}from"./index-DZS4TKGX.js";const ee=M({name:"ShwfedBlockCardBadge",inheritAttrs:!1,__name:"badge",props:{badge:{}},setup(n){const a=n,{locale:k}=$(),j=W(),o=T(void 0);function i(){return U(j)}const b=t(()=>o.value===void 0?X():Y(o.value)),l=t(()=>D(a.badge.content,k.value)||""),C=t(()=>l.value?Q(l.value,g,{...i(),json:b.value}):""),B=t(()=>{const e=a.badge.show;if(!e)return!0;try{return R(g(e,{...i(),json:b.value}))}catch(r){return console.warn("[shwfed-card-badge] show evaluation failed",r),!0}});async function s(){const e=a.badge.request;if(!e)return;const r=i(),q=J(function*(){const v=yield*P(yield*g(e,r));return S(v)});try{o.value=await V(G(q,H))}catch(v){console.warn("[shwfed-card-badge] fetch failed",v)}}const c=t(()=>!!a.badge.request&&(a.badge.interval??0)>0),_=t(()=>Math.max(1,a.badge.interval??1)*1e3),u=K(),{pause:h,resume:d}=z(()=>{s()},_,{immediate:!1});return E(()=>{s(),c.value&&u.value&&d()}),p(u,e=>{c.value&&(e?(s(),d()):h())}),p(()=>[a.badge.request??"",a.badge.interval??0].join("|"),()=>{s(),c.value&&u.value?d():h()}),(e,r)=>l.value&&B.value?(f(),F(O,{key:0},[n.badge.dot?(f(),w(m(y),x({key:0,variant:n.badge.variant??"default",class:"size-2.5 min-w-0 rounded-full p-0"},e.$attrs),null,16,["variant"])):(f(),w(m(y),x({key:1,variant:n.badge.variant??"default"},e.$attrs),{default:I(()=>[L(m(N),{source:C.value,class:"max-w-none text-inherit [&_*]:text-inherit [&_p]:m-0"},null,8,["source"])]),_:1},16,["variant"]))],64)):A("",!0)}});export{ee as default};
@@ -1 +0,0 @@
1
- import{d as v,Q as S,aD as h,a as V,z as k,I as s,H as l,b as t,U as r,V as u,W as d,X as p,J as m,Y as T,T as f,$ as y,a3 as z,a4 as $}from"./index-DZS4TKGX.js";const w={class:"flex flex-col gap-3"},b=v({name:"ShwfedStateWriteActionConfig",__name:"config",props:{modelValue:{required:!0},modelModifiers:{}},emits:["update:modelValue"],setup(_){const o=S(_,"modelValue"),i=h(()=>{}),c=e=>z(i,e)??e,n=e=>$(i,e);function g(e){const a={...o.value};e.length===0?Reflect.deleteProperty(a,"onSuccess"):a.onSuccess=e,o.value=a}return(e,a)=>(V(),k("div",w,[s(t(f),{orientation:"vertical"},{default:l(()=>[s(t(r),{class:"text-xs text-zinc-500"},u({default:l(()=>[d(" "+p(c("expression")),1)]),_:2},[n("expression")?{name:"tooltip",fn:l(()=>[s(t(m),{source:n("expression"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(t(T),{"model-value":o.value.expression,multiline:"",placeholder:"例:{ invoices: rows, totalAmount: rows.map(r, r.amount).sum() }","result-type":"map",class:"min-h-16","onUpdate:modelValue":a[0]||(a[0]=x=>o.value={...o.value,expression:x})},null,8,["model-value"])]),_:1}),s(t(f),{orientation:"vertical"},{default:l(()=>[s(t(r),{class:"text-xs text-zinc-500"},u({default:l(()=>[d(" "+p(c("onSuccess")),1)]),_:2},[n("onSuccess")?{name:"tooltip",fn:l(()=>[s(t(m),{source:n("onSuccess"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(y,{triggers:o.value.onSuccess??[],"onUpdate:triggers":g},null,8,["triggers"])]),_:1})]))}});export{b as default};
@@ -1 +0,0 @@
1
- import{d as g,Q as d,a3 as u,aA as f,z as m,I as s,H as i,b as r,a as p,U as _,W as v,X as x,$ as h,T,e as V}from"./index-DZS4TKGX.js";const C={class:"flex flex-col gap-3"},$=g({name:"ShwfedEventDispatchActionConfig",__name:"config",props:{modelValue:{required:!0},modelModifiers:{}},emits:["update:modelValue"],setup(l){const t=d(l,"modelValue"),o=u(f(),"triggers")??"触发的操作",n=V(()=>t.value.triggers??[]);function c(a){const e={...t.value};a.length===0?Reflect.deleteProperty(e,"triggers"):e.triggers=a,t.value=e}return(a,e)=>(p(),m("div",C,[s(r(T),{orientation:"vertical"},{default:i(()=>[s(r(_),{class:"text-xs text-zinc-500"},{default:i(()=>[v(x(r(o)),1)]),_:1}),s(h,{triggers:n.value,"onUpdate:triggers":c},null,8,["triggers"])]),_:1})]))}});export{$ as default};
@@ -1 +0,0 @@
1
- import{d as k,Q as w,a5 as R,z as v,I as e,H as a,b as t,S as _,K as F,a2 as H,a as E,U as u,V as c,W as d,X as p,J as f,Y as g,T as m,$ as b,a3 as N,a4 as $}from"./index-DZS4TKGX.js";const j={class:"flex flex-col gap-3"},B={class:"flex items-start gap-2"},D={class:"grid grid-cols-2 gap-3"},q=k({name:"ShwfedHttpRequestActionConfig",__name:"config",props:{modelValue:{required:!0},modelModifiers:{}},emits:["update:modelValue"],setup(h){const l=w(h,"modelValue"),x=R(()=>{}),i=o=>N(x,o)??o,n=o=>$(x,o),S=["onSuccess","onWarning","onError","onInfo"];function z(o){const s={...l.value};o.length===0?delete s.messageExpression:s.messageExpression=o,l.value=s}function T(o){const s={...l.value};o.length===0?delete s.resultExpression:s.resultExpression=o,l.value=s}function y(o,s){const r={...l.value};s.length===0?Reflect.deleteProperty(r,o):r[o]=s,l.value=r}function V(o){const s={...l.value};o.length===0?Reflect.deleteProperty(s,"before"):s.before=o,l.value=s}return(o,s)=>(E(),v("div",j,[e(t(m),{orientation:"vertical"},{default:a(()=>[e(t(u),{class:"text-xs text-zinc-500"},c({default:a(()=>[d(" "+p(i("expression")),1)]),_:2},[n("expression")?{name:"tooltip",fn:a(()=>[e(t(f),{source:n("expression"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),e(t(g),{"model-value":l.value.expression,multiline:"",placeholder:"例:http.post('/api/foo').body({ id: row.id })","result-type":"HttpRequest",class:"min-h-16","onUpdate:modelValue":s[0]||(s[0]=r=>l.value={...l.value,expression:r})},null,8,["model-value"])]),_:1}),e(t(m),{orientation:"vertical"},{default:a(()=>[e(t(u),{class:"text-xs text-zinc-500"},c({default:a(()=>[d(" "+p(i("before")),1)]),_:2},[n("before")?{name:"tooltip",fn:a(()=>[e(t(f),{source:n("before"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),e(b,{triggers:l.value.before??[],"onUpdate:triggers":s[1]||(s[1]=r=>V(r))},null,8,["triggers"])]),_:1}),_("div",B,[e(t(m),{orientation:"vertical",class:"flex-1 basis-0 min-w-0"},{default:a(()=>[e(t(u),{class:"text-xs text-zinc-500"},c({default:a(()=>[d(" "+p(i("messageExpression")),1)]),_:2},[n("messageExpression")?{name:"tooltip",fn:a(()=>[e(t(f),{source:n("messageExpression"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),e(t(g),{"model-value":l.value.messageExpression??"",placeholder:"例:string(json.message)","result-type":"string","extra-vars":{json:{type:"dyn",label:"HTTP 响应体(已解析 JSON)"}},"onUpdate:modelValue":z},null,8,["model-value"])]),_:1}),e(t(m),{orientation:"vertical",class:"flex-1 basis-0 min-w-0"},{default:a(()=>[e(t(u),{class:"text-xs text-zinc-500"},c({default:a(()=>[d(" "+p(i("resultExpression")),1)]),_:2},[n("resultExpression")?{name:"tooltip",fn:a(()=>[e(t(f),{source:n("resultExpression"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),e(t(g),{"model-value":l.value.resultExpression??"",placeholder:"例:json.code == 0 ? 'success' : 'error'","result-type":"string","extra-vars":{json:{type:"dyn",label:"HTTP 响应体(已解析 JSON)"}},"onUpdate:modelValue":T},null,8,["model-value"])]),_:1})]),_("div",D,[(E(),v(F,null,H(S,r=>e(t(m),{key:r,orientation:"vertical",class:"min-w-0"},{default:a(()=>[e(t(u),{class:"text-xs text-zinc-500"},c({default:a(()=>[d(" "+p(i(r)),1)]),_:2},[n(r)?{name:"tooltip",fn:a(()=>[e(t(f),{source:n(r),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),e(b,{triggers:l.value[r]??[],"onUpdate:triggers":U=>y(r,U)},null,8,["triggers","onUpdate:triggers"])]),_:2},1024)),64))])]))}});export{q as default};