@shwfed/config 2.9.8 → 2.9.10

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 (144) hide show
  1. package/dist/mcp.mjs +8 -0
  2. package/dist/module.json +1 -1
  3. package/dist/preview/assets/{FieldGroup.vue_vue_type_script_setup_true_lang-ByKzTJkK.js → FieldGroup.vue_vue_type_script_setup_true_lang-B_lv0Qb4.js} +1 -1
  4. package/dist/preview/assets/badge-DkCzSREV.js +1 -0
  5. package/dist/preview/assets/config-9Ny1em1E.js +1 -0
  6. package/dist/preview/assets/config-BO6oZNCA.js +1 -0
  7. package/dist/preview/assets/config-BQZZzdBi.js +1 -0
  8. package/dist/preview/assets/config-BzUZdTRZ.js +1 -0
  9. package/dist/preview/assets/config-CJYUWHSt.js +1 -0
  10. package/dist/preview/assets/config-CLszlI7X.js +1 -0
  11. package/dist/preview/assets/config-CfTdhIiz.js +1 -0
  12. package/dist/preview/assets/config-DG9kUyIX.js +1 -0
  13. package/dist/preview/assets/{config-DyqhZSFe.js → config-DcOjw4Ib.js} +1 -1
  14. package/dist/preview/assets/config-DnxWfe-p.js +1 -0
  15. package/dist/preview/assets/config-IAY_3DyY.js +1 -0
  16. package/dist/preview/assets/{config-B8qH4_4x.js → config-y0whCdxg.js} +1 -1
  17. package/dist/preview/assets/definition.vue_vue_type_script_setup_true_lang-D6Dl1HG7.js +1 -0
  18. package/dist/preview/assets/{index-CWJ_W3Gk.js → index-BxEz7F0S.js} +1 -1
  19. package/dist/preview/assets/{index-C1wWjgLL.js → index-CEpio2Ai.js} +206 -189
  20. package/dist/preview/assets/index-DEk1Sey_.css +1 -0
  21. package/dist/preview/assets/index-eXjRNljQ.js +1 -0
  22. package/dist/preview/assets/item-BgY4KzDy.js +1 -0
  23. package/dist/preview/assets/runtime--G6ZYJWm.js +1 -0
  24. package/dist/preview/assets/runtime-74HxxB_6.js +1 -0
  25. package/dist/preview/assets/runtime-B0yAZrhv.js +1 -0
  26. package/dist/preview/assets/runtime-B1vIYtF_.js +1 -0
  27. package/dist/preview/assets/runtime-BrfrrA2a.js +1 -0
  28. package/dist/preview/assets/runtime-BweDVL2G.js +1 -0
  29. package/dist/preview/assets/runtime-C9L73GlB.js +1 -0
  30. package/dist/preview/assets/runtime-DIHeE12q.js +1 -0
  31. package/dist/preview/assets/runtime-DNCNcjrA.js +1 -0
  32. package/dist/preview/assets/runtime-ObPbN32X.js +1 -0
  33. package/dist/preview/assets/schema-meta-dmADcmVf.js +1 -0
  34. package/dist/preview/index.html +2 -2
  35. package/dist/runtime/components/actions/buttons/2026-04-18/com.shwfed.actions.button.http.request.json/config.d.vue.ts +10 -0
  36. package/dist/runtime/components/actions/buttons/2026-04-18/com.shwfed.actions.button.http.request.json/config.vue.d.ts +10 -0
  37. package/dist/runtime/components/actions/buttons/2026-04-18/com.shwfed.actions.button.http.request.json/schema.d.ts +5 -0
  38. package/dist/runtime/components/actions/buttons/2026-04-18/com.shwfed.actions.button.http.request.json.confirm/config.d.vue.ts +10 -0
  39. package/dist/runtime/components/actions/buttons/2026-04-18/com.shwfed.actions.button.http.request.json.confirm/config.vue.d.ts +10 -0
  40. package/dist/runtime/components/actions/buttons/2026-04-18/com.shwfed.actions.button.http.request.json.confirm/schema.d.ts +5 -0
  41. package/dist/runtime/components/actions/buttons/2026-05-15/com.shwfed.actions.button.event.dispatch/config.d.vue.ts +2 -0
  42. package/dist/runtime/components/actions/buttons/2026-05-15/com.shwfed.actions.button.event.dispatch/config.vue.d.ts +2 -0
  43. package/dist/runtime/components/actions/buttons/2026-05-15/com.shwfed.actions.button.event.dispatch/schema.d.ts +1 -0
  44. package/dist/runtime/components/actions/buttons/2026-05-21/com.shwfed.actions.button.http.download/config.d.vue.ts +8 -0
  45. package/dist/runtime/components/actions/buttons/2026-05-21/com.shwfed.actions.button.http.download/config.vue.d.ts +8 -0
  46. package/dist/runtime/components/actions/buttons/2026-05-21/com.shwfed.actions.button.http.download/schema.d.ts +4 -0
  47. package/dist/runtime/components/actions/buttons/2026-05-24/com.shwfed.actions.button.state.write/config.d.vue.ts +2 -0
  48. package/dist/runtime/components/actions/buttons/2026-05-24/com.shwfed.actions.button.state.write/config.vue.d.ts +2 -0
  49. package/dist/runtime/components/actions/buttons/2026-05-24/com.shwfed.actions.button.state.write/schema.d.ts +1 -0
  50. package/dist/runtime/components/actions/buttons/2026-06-08/com.shwfed.actions.button.http.request.json.batch/config.d.vue.ts +2 -0
  51. package/dist/runtime/components/actions/buttons/2026-06-08/com.shwfed.actions.button.http.request.json.batch/config.vue.d.ts +2 -0
  52. package/dist/runtime/components/actions/buttons/2026-06-08/com.shwfed.actions.button.http.request.json.batch/schema.d.ts +1 -0
  53. package/dist/runtime/components/actions/components/trigger-row-scope.d.vue.ts +17 -0
  54. package/dist/runtime/components/actions/components/trigger-row-scope.vue +15 -0
  55. package/dist/runtime/components/actions/components/trigger-row-scope.vue.d.ts +17 -0
  56. package/dist/runtime/components/actions/components/triggers-field.d.vue.ts +2 -0
  57. package/dist/runtime/components/actions/components/triggers-field.vue +29 -7
  58. package/dist/runtime/components/actions/components/triggers-field.vue.d.ts +2 -0
  59. package/dist/runtime/components/config/index.vue +5 -1
  60. package/dist/runtime/components/config/schema.d.ts +5 -0
  61. package/dist/runtime/components/config/schema.js +10 -0
  62. package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.number/config.d.vue.ts +8 -8
  63. package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.number/config.vue.d.ts +8 -8
  64. package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.numberrange/config.d.vue.ts +8 -8
  65. package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.numberrange/config.vue.d.ts +8 -8
  66. package/dist/runtime/components/operations/2026-06-11/com.shwfed.operation.http.request.json/config.d.vue.ts +33 -0
  67. package/dist/runtime/components/operations/2026-06-11/com.shwfed.operation.http.request.json/config.vue +130 -0
  68. package/dist/runtime/components/operations/2026-06-11/com.shwfed.operation.http.request.json/config.vue.d.ts +33 -0
  69. package/dist/runtime/components/operations/2026-06-11/com.shwfed.operation.http.request.json/runtime.d.ts +2 -0
  70. package/dist/runtime/components/operations/2026-06-11/com.shwfed.operation.http.request.json/runtime.js +55 -0
  71. package/dist/runtime/components/operations/2026-06-11/com.shwfed.operation.http.request.json/schema.d.ts +23 -0
  72. package/dist/runtime/components/operations/2026-06-11/com.shwfed.operation.http.request.json/schema.js +79 -0
  73. package/dist/runtime/components/operations/utils/resolve.d.ts +16 -1
  74. package/dist/runtime/components/operations/utils/resolve.js +1 -1
  75. package/dist/runtime/components/operations/utils/step-vars.d.ts +22 -0
  76. package/dist/runtime/components/operations/utils/step-vars.js +12 -0
  77. package/dist/runtime/components/table/columns/2026-04-14/com.shwfed.table.column.markdown/runtime.vue +1 -1
  78. package/dist/runtime/components/table/columns/2026-05-13/com.shwfed.table.column.switch/schema.d.ts +1 -0
  79. package/dist/runtime/components/table/columns/2026-05-13/com.shwfed.table.column.switch.remote/schema.d.ts +1 -0
  80. package/dist/runtime/components/table/columns/2026-05-24/com.shwfed.table.column.combobox-single.remote.options-remote/config.d.vue.ts +4 -2
  81. package/dist/runtime/components/table/columns/2026-05-24/com.shwfed.table.column.combobox-single.remote.options-remote/config.vue.d.ts +4 -2
  82. package/dist/runtime/components/table/columns/2026-05-24/com.shwfed.table.column.combobox-single.remote.options-remote/schema.d.ts +1 -0
  83. package/dist/runtime/components/table/columns/2026-05-24/com.shwfed.table.column.combobox-single.remote.options-static/config.d.vue.ts +4 -2
  84. package/dist/runtime/components/table/columns/2026-05-24/com.shwfed.table.column.combobox-single.remote.options-static/config.vue.d.ts +4 -2
  85. package/dist/runtime/components/table/columns/2026-05-24/com.shwfed.table.column.combobox-single.remote.options-static/schema.d.ts +1 -0
  86. package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-remote/config.d.vue.ts +4 -2
  87. package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-remote/config.vue.d.ts +4 -2
  88. package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-remote/schema.d.ts +1 -0
  89. package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-static/config.d.vue.ts +4 -2
  90. package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-static/config.vue.d.ts +4 -2
  91. package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-static/schema.d.ts +1 -0
  92. package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-multi.remote/config.d.vue.ts +4 -2
  93. package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-multi.remote/config.vue.d.ts +4 -2
  94. package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-multi.remote/schema.d.ts +1 -0
  95. package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-single.remote/config.d.vue.ts +4 -2
  96. package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-single.remote/config.vue.d.ts +4 -2
  97. package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-single.remote/schema.d.ts +1 -0
  98. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-multi/config.d.vue.ts +4 -2
  99. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-multi/config.vue.d.ts +4 -2
  100. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-multi/schema.d.ts +2 -0
  101. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-single/config.d.vue.ts +4 -2
  102. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-single/config.vue.d.ts +4 -2
  103. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-single/schema.d.ts +2 -0
  104. package/dist/runtime/components/ui/expression-editor/CodeMirrorInput.d.vue.ts +2 -0
  105. package/dist/runtime/components/ui/expression-editor/CodeMirrorInput.vue +9 -1
  106. package/dist/runtime/components/ui/expression-editor/CodeMirrorInput.vue.d.ts +2 -0
  107. package/dist/runtime/components/ui/expression-editor/ExpressionEditor.d.vue.ts +2 -2
  108. package/dist/runtime/components/ui/expression-editor/ExpressionEditor.vue +33 -4
  109. package/dist/runtime/components/ui/expression-editor/ExpressionEditor.vue.d.ts +2 -2
  110. package/dist/runtime/components/ui/expression-editor/picker-entries.d.ts +3 -2
  111. package/dist/runtime/components/ui/expression-editor/picker-entries.js +13 -2
  112. package/dist/runtime/components/ui/expression-editor/step-chip-extension.d.ts +5 -0
  113. package/dist/runtime/components/ui/expression-editor/step-chip-extension.js +132 -0
  114. package/dist/runtime/components/ui/expression-editor/step-refs.d.ts +17 -0
  115. package/dist/runtime/components/ui/expression-editor/step-refs.js +29 -0
  116. package/dist/runtime/share/event-bus.d.ts +34 -1
  117. package/dist/runtime/share/event-bus.js +28 -11
  118. package/dist/runtime/utils/cel-context.d.ts +35 -0
  119. package/dist/runtime/utils/cel-context.js +8 -0
  120. package/package.json +1 -1
  121. package/dist/preview/assets/badge-Dq4c6LC9.js +0 -1
  122. package/dist/preview/assets/config-BBGDw3Em.js +0 -1
  123. package/dist/preview/assets/config-C32gE_z0.js +0 -1
  124. package/dist/preview/assets/config-COfUny1G.js +0 -1
  125. package/dist/preview/assets/config-CVPTjqGi.js +0 -1
  126. package/dist/preview/assets/config-CgdFXkLJ.js +0 -1
  127. package/dist/preview/assets/config-DNr8rSLw.js +0 -1
  128. package/dist/preview/assets/config-DVEOLj6d.js +0 -1
  129. package/dist/preview/assets/config-DpRJqJ1d.js +0 -1
  130. package/dist/preview/assets/config-Dvqs3X3R.js +0 -1
  131. package/dist/preview/assets/definition.vue_vue_type_script_setup_true_lang-B0MHEyHj.js +0 -1
  132. package/dist/preview/assets/index-Br3FtCu2.js +0 -1
  133. package/dist/preview/assets/index-C1h9lV52.css +0 -1
  134. package/dist/preview/assets/item-Bp81qizC.js +0 -1
  135. package/dist/preview/assets/runtime-AHwg8SCY.js +0 -1
  136. package/dist/preview/assets/runtime-BHWdj0nM.js +0 -1
  137. package/dist/preview/assets/runtime-Be6zYys6.js +0 -1
  138. package/dist/preview/assets/runtime-CKj3_07G.js +0 -1
  139. package/dist/preview/assets/runtime-CVIZYrHD.js +0 -1
  140. package/dist/preview/assets/runtime-C_F9tcxh.js +0 -1
  141. package/dist/preview/assets/runtime-DNHuKamx.js +0 -1
  142. package/dist/preview/assets/runtime-DambLtyb.js +0 -1
  143. package/dist/preview/assets/runtime-DqkDOQp2.js +0 -1
  144. package/dist/preview/assets/runtime-UVi5ssie.js +0 -1
@@ -1,6 +1,31 @@
1
1
  import { Effect, Schema } from 'effect';
2
2
  import type { InjectionKey, Ref } from 'vue';
3
3
  import type { CelEvaluator } from './interpolate.js';
4
+ /**
5
+ * One trigger row's window onto its chain run — the channel through which a
6
+ * later step reads what earlier steps published (the CEL `steps` variable) and
7
+ * a publishing operation (e.g. the HTTP request op) deposits its own output.
8
+ *
9
+ * Scoped to ONE `dispatchTriggers` run: the outputs map is minted per run, so
10
+ * two clicks of the same button never see each other's responses. Sequential
11
+ * execution (triggers run serially, in list order) is what makes a plain
12
+ * mutable map safe here — unlike the reactive selections registry there is no
13
+ * concurrent reader to notify, so no shallowRef/dedup machinery.
14
+ */
15
+ export type ChainStep = Readonly<{
16
+ /**
17
+ * Outputs published by the steps that already ran in this chain, keyed by
18
+ * their trigger-row `id`. A thunk (not a snapshot) so a handler that defers
19
+ * evaluation still reads the map as of its own turn.
20
+ */
21
+ outputs: () => Readonly<Record<string, unknown>>;
22
+ /**
23
+ * Publish this step's output for later steps to read. A no-op when the
24
+ * trigger row carries no persisted `id` (a legacy row) — there is then no
25
+ * address a later expression could reference it by.
26
+ */
27
+ publish: (output: unknown) => void;
28
+ }>;
4
29
  /** A descendant button asking an ancestor instance to run an operation. */
5
30
  export type OpRequest = Readonly<{
6
31
  /** Instance id of the ancestor that should handle this request. */
@@ -25,6 +50,12 @@ export type OpRequest = Readonly<{
25
50
  * its host's own evaluator.
26
51
  */
27
52
  cel?: CelEvaluator;
53
+ /**
54
+ * This request's window onto its chain run — read earlier steps' outputs,
55
+ * publish your own. Stamped by `dispatchTriggers`; absent when the request
56
+ * was dispatched outside a trigger chain.
57
+ */
58
+ step?: ChainStep;
28
59
  }>;
29
60
  /**
30
61
  * The persisted form of a trigger — one stored row addressing an ancestor
@@ -32,6 +63,7 @@ export type OpRequest = Readonly<{
32
63
  * `OpRequest`.
33
64
  */
34
65
  export declare const Trigger: Schema.Struct<{
66
+ id: Schema.optional<Schema.refine<string, typeof Schema.String>>;
35
67
  target: Schema.refine<string, typeof Schema.String>;
36
68
  operation: Schema.SchemaClass<string, string, never>;
37
69
  compatibilityDate: Schema.optional<Schema.SchemaClass<string, string, never>>;
@@ -45,6 +77,7 @@ export declare const Trigger: Schema.Struct<{
45
77
  * fire, is decided by the button type. List order is execution order.
46
78
  */
47
79
  export declare const Triggers: Schema.Array$<Schema.Struct<{
80
+ id: Schema.optional<Schema.refine<string, typeof Schema.String>>;
48
81
  target: Schema.refine<string, typeof Schema.String>;
49
82
  operation: Schema.SchemaClass<string, string, never>;
50
83
  compatibilityDate: Schema.optional<Schema.SchemaClass<string, string, never>>;
@@ -91,7 +124,7 @@ export type EventChannel = Readonly<{
91
124
  * pre-request trigger list, so validation is explicit and configured rather
92
125
  * than an implicit host gate.
93
126
  */
94
- export type OperationHandlers = Readonly<Record<string, (params?: unknown, cel?: CelEvaluator) => Effect.Effect<void>>>;
127
+ export type OperationHandlers = Readonly<Record<string, (params?: unknown, cel?: CelEvaluator, step?: ChainStep) => Effect.Effect<void>>>;
95
128
  export declare const EVENT_CHANNEL_KEY: InjectionKey<EventChannel>;
96
129
  /**
97
130
  * Build a channel node for an operation-exposing instance. `dispatch` runs
@@ -1,6 +1,14 @@
1
1
  import { computed, inject, provide, shallowRef } from "vue";
2
2
  import { Effect, Schema } from "effect";
3
3
  export const Trigger = Schema.Struct({
4
+ // Additive + optional like `compatibilityDate`/`params` below, so every
5
+ // pre-existing `{ target, operation }` trigger keeps loading. Minted by the
6
+ // 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
+ // which the list index, the only other row identity, does not.
9
+ 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
+ })),
4
12
  target: Schema.UUID.annotations({
5
13
  description: "\u76EE\u6807\u7956\u5148\u5B9E\u4F8B\u7684 ID"
6
14
  }),
@@ -33,7 +41,7 @@ export const EVENT_CHANNEL_KEY = Symbol("shwfed/event-channel");
33
41
  export function createEventChannel(instanceId, operations, parent) {
34
42
  return {
35
43
  dispatch(request) {
36
- const handled = request.target === instanceId ? operations[request.operation]?.(request.params, request.cel) ?? Effect.void : Effect.void;
44
+ const handled = request.target === instanceId ? operations[request.operation]?.(request.params, request.cel, request.step) ?? Effect.void : Effect.void;
37
45
  return parent ? Effect.andThen(handled, parent.dispatch(request)) : handled;
38
46
  }
39
47
  };
@@ -47,16 +55,25 @@ export function useEventChannel() {
47
55
  }
48
56
  export function dispatchTriggers(channel, triggers, cel) {
49
57
  if (!channel || !triggers || triggers.length === 0) return Effect.void;
50
- return Effect.forEach(
51
- triggers,
52
- (trigger) => channel.dispatch({
53
- target: trigger.target,
54
- operation: trigger.operation,
55
- params: trigger.params,
56
- cel
57
- }),
58
- { discard: true }
59
- );
58
+ return Effect.suspend(() => {
59
+ const outputs = {};
60
+ return Effect.forEach(
61
+ triggers,
62
+ (trigger) => channel.dispatch({
63
+ target: trigger.target,
64
+ operation: trigger.operation,
65
+ params: trigger.params,
66
+ cel,
67
+ step: {
68
+ outputs: () => outputs,
69
+ publish: (output) => {
70
+ if (trigger.id) outputs[trigger.id] = output;
71
+ }
72
+ }
73
+ }),
74
+ { discard: true }
75
+ );
76
+ });
60
77
  }
61
78
  const EVENT_ANCESTRY_KEY = Symbol("shwfed/event-ancestry");
62
79
  export function provideEventAncestor(ancestor) {
@@ -8,6 +8,7 @@ export type CELVar = {
8
8
  export type CELContext = Record<string, CELVar>;
9
9
  export declare const SCOPE_ADDRESS_VAR = "__scopes__";
10
10
  export declare const SELECTIONS_VAR = "selections";
11
+ export declare const STEPS_VAR = "steps";
11
12
  export type ScopeAccessor = Record<string, () => unknown>;
12
13
  export declare function provideCELContext(context: CELContext): void;
13
14
  export declare function injectCELContext(): CELContext;
@@ -65,4 +66,38 @@ export declare function provideSelectionRoster(roster: Ref<ReadonlyArray<Selecti
65
66
  * sits outside any form (a table column expression, a standalone editor).
66
67
  */
67
68
  export declare function useSelectionRoster(): Ref<ReadonlyArray<SelectionFieldRef>>;
69
+ /**
70
+ * One referenceable step of the trigger chain being edited, as the picker/chip
71
+ * surfaces it. Unlike a selection field a trigger row has no designer-given
72
+ * name, so `label` is its position —「第 N 步」— computed live from the row's
73
+ * current index and thus following drag-and-drop reorders for free (the
74
+ * persisted reference is `steps["<id>"]`; the label is never stored).
75
+ */
76
+ export type StepRef = Readonly<{
77
+ /** Trigger-row uuid keyed into `steps["<id>"]` — the publish address. */
78
+ id: string;
79
+ /** Position label,「第 N 步」, derived from the row's current index. */
80
+ label: string;
81
+ /**
82
+ * Whether the step is referenceable from the editing row — i.e. it runs
83
+ * BEFORE it. A step dragged after its referrer stays in the roster (so its
84
+ * chip keeps the friendly label) but flips invalid, which the chip renders
85
+ * as a warning instead of the dangling-uuid fallback.
86
+ */
87
+ valid: boolean;
88
+ /** What the step publishes (the op's `metadata.output`), for picker hover. */
89
+ description?: string;
90
+ }>;
91
+ /**
92
+ * Advertise the referenceable chain steps to the ExpressionEditors of ONE
93
+ * trigger row's param editor. Per-row (each row sees a different roster —
94
+ * earlier rows valid, later ones not), so it is provided by a per-row wrapper
95
+ * in the trigger editor, not once by a host like the selection roster.
96
+ */
97
+ export declare function provideStepRoster(roster: Ref<ReadonlyArray<StepRef>>): void;
98
+ /**
99
+ * The chain steps referenceable from the current editing position, or empty
100
+ * when the editor sits outside a trigger row's param editor.
101
+ */
102
+ export declare function useStepRoster(): Ref<ReadonlyArray<StepRef>>;
68
103
  export declare function celBindings(context: CELContext): Record<string, unknown>;
@@ -2,6 +2,7 @@ import { computed, inject, provide, shallowRef } from "vue";
2
2
  import { injectLocal, provideLocal } from "@vueuse/core";
3
3
  export const SCOPE_ADDRESS_VAR = "__scopes__";
4
4
  export const SELECTIONS_VAR = "selections";
5
+ export const STEPS_VAR = "steps";
5
6
  const CEL_CONTEXT_KEY = Symbol("cel-context");
6
7
  export function provideCELContext(context) {
7
8
  const parent = injectLocal(CEL_CONTEXT_KEY, {});
@@ -54,6 +55,13 @@ export function provideSelectionRoster(roster) {
54
55
  export function useSelectionRoster() {
55
56
  return inject(SELECTION_ROSTER_KEY, void 0) ?? shallowRef([]);
56
57
  }
58
+ const STEP_ROSTER_KEY = Symbol("cel-step-roster");
59
+ export function provideStepRoster(roster) {
60
+ provide(STEP_ROSTER_KEY, roster);
61
+ }
62
+ export function useStepRoster() {
63
+ return inject(STEP_ROSTER_KEY, void 0) ?? shallowRef([]);
64
+ }
57
65
  export function celBindings(context) {
58
66
  const out = {};
59
67
  for (const [name, entry] of Object.entries(context)) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shwfed/config",
3
- "version": "2.9.8",
3
+ "version": "2.9.10",
4
4
  "description": "Configurable UI for SHWFED",
5
5
  "type": "module",
6
6
  "publishConfig": {
@@ -1 +0,0 @@
1
- import{d as _,W as $,q as E,r as F,v as p,o as f,P as z,c as w,Q as x,e as m,X as y,w as I,b as L,k as O,Y as P,Z as A,z as t,A as J,B as N,C as g,D as S,E as V,F as W,G as D,H as G,y as H,I as K,K as Q,$ as T,a0 as U,L as X,J as Y,M as Z}from"./index-C1wWjgLL.js";const ee=_({name:"ShwfedBlockCardBadge",inheritAttrs:!1,__name:"badge",props:{badge:{}},setup(n){const a=n,{locale:k}=$(),C=Q(),o=H(void 0);function i(){return K(C)}const b=t(()=>o.value===void 0?Y():Z(o.value)),c=t(()=>T(a.badge.content,k.value)||""),j=t(()=>c.value?U(c.value,g,{...i(),json:b.value}):""),B=t(()=>{const e=a.badge.show;if(!e)return!0;try{return X(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(),M=J(function*(){const v=yield*N(yield*g(e,r));return S(v)});try{o.value=await V(W(M,D))}catch(v){console.warn("[shwfed-card-badge] fetch failed",v)}}const l=t(()=>!!a.badge.request&&(a.badge.interval??0)>0),q=t(()=>Math.max(1,a.badge.interval??1)*1e3),u=G(),{pause:h,resume:d}=E(()=>{s()},q,{immediate:!1});return F(()=>{s(),l.value&&u.value&&d()}),p(u,e=>{l.value&&(e?(s(),d()):h())}),p(()=>[a.badge.request??"",a.badge.interval??0].join("|"),()=>{s(),l.value&&u.value?d():h()}),(e,r)=>c.value&&B.value?(f(),z(P,{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(O),{source:j.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,u as S,aH as h,P as k,b as s,w as l,e as t,o as V,f as r,h as u,j as d,t as p,k as m,a2 as w,_ as f,a3 as y,a5 as T,a6 as z}from"./index-C1wWjgLL.js";const $={class:"flex flex-col gap-3"},C=v({name:"ShwfedStateWriteActionConfig",__name:"config",props:{modelValue:{required:!0},modelModifiers:{}},emits:["update:modelValue"],setup(_){const o=S(_,"modelValue"),i=h(()=>{}),c=e=>T(i,e)??e,n=e=>z(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",$,[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(w),{"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{C as default};
@@ -1 +0,0 @@
1
- import{d as w,u as U,a9 as R,P as v,b as e,w as a,e as t,m as _,Y as j,a4 as F,o as E,f as u,h as c,j as d,t as p,k as f,a2 as g,_ as m,a3 as b,a5 as N,a6 as P}from"./index-C1wWjgLL.js";const B={class:"flex flex-col gap-3"},D={class:"flex items-start gap-2"},H={class:"grid grid-cols-2 gap-3"},q=w({name:"ShwfedHttpRequestActionConfig",__name:"config",props:{modelValue:{required:!0},modelModifiers:{}},emits:["update:modelValue"],setup(h){const l=U(h,"modelValue"),x=R(()=>{}),i=o=>N(x,o)??o,n=o=>P(x,o),S=["onSuccess","onWarning","onError","onInfo"];function y(o){const s={...l.value};o.length===0?delete s.messageExpression:s.messageExpression=o,l.value=s}function z(o){const s={...l.value};o.length===0?delete s.resultExpression:s.resultExpression=o,l.value=s}function T(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",B,[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",D,[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":y},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":z},null,8,["model-value"])]),_:1})]),_("div",H,[(E(),v(j,null,F(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":k=>T(r,k)},null,8,["triggers","onUpdate:triggers"])]),_:2},1024)),64))])]))}});export{q as default};
@@ -1 +0,0 @@
1
- import{d as $,u as b,ai as S,P as m,b as e,w as l,e as a,o as f,f as _,h as v,j as u,t as r,k as p,a2 as V,_ as x,aj as h,ak as w,al as y,am as z,Y as D,a4 as N,an as T,a5 as C,a6 as F}from"./index-C1wWjgLL.js";const M={class:"flex flex-col gap-3"},j=$({name:"ShwfedNavigationActionConfig",__name:"config",props:{modelValue:{required:!0},modelModifiers:{}},emits:["update:modelValue"],setup(g){const t=b(g,"modelValue"),c=S(()=>{}),d=o=>C(c,o)??o,n=o=>F(c,o),k=[{value:"_self",label:"当前页面打开"},{value:"_blank",label:"新页面打开"}];return(o,i)=>(f(),m("div",M,[e(a(x),{orientation:"vertical"},{default:l(()=>[e(a(_),{class:"text-xs text-zinc-500"},v({default:l(()=>[u(" "+r(d("url")),1)]),_:2},[n("url")?{name:"tooltip",fn:l(()=>[e(a(p),{source:n("url"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),e(a(V),{"model-value":t.value.url??"",placeholder:"例:'/detail/' + string(row.id)","result-type":"string",multiline:"",class:"min-h-10","onUpdate:modelValue":i[0]||(i[0]=s=>t.value={...t.value,url:s})},null,8,["model-value"])]),_:1}),e(a(x),{orientation:"vertical"},{default:l(()=>[e(a(_),{class:"text-xs text-zinc-500"},v({default:l(()=>[u(" "+r(d("mode")),1)]),_:2},[n("mode")?{name:"tooltip",fn:l(()=>[e(a(p),{source:n("mode"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),e(a(h),{"model-value":t.value.mode??"_self","onUpdate:modelValue":i[1]||(i[1]=s=>t.value={...t.value,mode:s})},{default:l(()=>[e(a(w),{class:"w-full"},{default:l(()=>[e(a(y))]),_:1}),e(a(z),null,{default:l(()=>[(f(),m(D,null,N(k,s=>e(a(T),{key:s.value,value:s.value},{default:l(()=>[u(r(s.label),1)]),_:2},1032,["value"])),64))]),_:1})]),_:1},8,["model-value"])]),_:1})]))}});export{j as default};
@@ -1 +0,0 @@
1
- import{d as V,u as T,a1 as U,c as $,w as l,e as s,o as b,m as x,b as e,_ as u,f as d,h as p,j as m,t as f,k as v,a2 as _,l as j,a3 as z,n as B,p as F,P as N,Y as C,a4 as D,a5 as H,a6 as P}from"./index-C1wWjgLL.js";import{_ as R}from"./FieldGroup.vue_vue_type_script_setup_true_lang-ByKzTJkK.js";const h={class:"grid grid-cols-2 gap-4"},q={class:"grid grid-cols-2 gap-4"},L={class:"flex items-start gap-2"},O={class:"grid grid-cols-2 gap-3"},M=V({name:"ShwfedHttpRequestConfirmActionConfig",__name:"config",props:{modelValue:{required:!0},modelModifiers:{}},emits:["update:modelValue"],setup(E){const n=T(E,"modelValue"),k=U(()=>{}),i=r=>H(k,r)??r,a=r=>P(k,r);function c(r){const t={...n.value,...r};for(const[o,g]of Object.entries(r))g===void 0&&Reflect.deleteProperty(t,o);n.value=t}const w=["onSuccess","onWarning","onError","onInfo"];function y(r,t){c({[r]:t.length===0?void 0:t})}function S(r){c({before:r.length===0?void 0:r})}return(r,t)=>(b(),$(s(R),null,{default:l(()=>[x("div",h,[e(s(u),{orientation:"vertical"},{default:l(()=>[e(s(d),{class:"text-xs text-zinc-500"},p({default:l(()=>[m(" "+f(i("expression")),1)]),_:2},[a("expression")?{name:"tooltip",fn:l(()=>[e(s(v),{source:a("expression"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),e(s(_),{"model-value":n.value.expression,multiline:"",placeholder:"例:http.post('/api/foo').body({ id: row.id })","result-type":"HttpRequest",class:"min-h-16","onUpdate:modelValue":t[0]||(t[0]=o=>c({expression:o}))},null,8,["model-value"])]),_:1}),e(s(u),{orientation:"vertical"},{default:l(()=>[e(s(d),{class:"text-xs text-zinc-500"},p({default:l(()=>[m(" "+f(i("markdown")),1)]),_:2},[a("markdown")?{name:"tooltip",fn:l(()=>[e(s(v),{source:a("markdown"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),e(s(j),{markdown:"","model-value":n.value.markdown,"onUpdate:modelValue":t[1]||(t[1]=o=>c({markdown:o}))},null,8,["model-value"])]),_:1})]),e(s(u),{orientation:"vertical"},{default:l(()=>[e(s(d),{class:"text-xs text-zinc-500"},p({default:l(()=>[m(" "+f(i("before")),1)]),_:2},[a("before")?{name:"tooltip",fn:l(()=>[e(s(v),{source:a("before"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),e(z,{triggers:n.value.before??[],"onUpdate:triggers":t[2]||(t[2]=o=>S(o))},null,8,["triggers"])]),_:1}),x("div",q,[e(s(u),{orientation:"vertical"},{default:l(()=>[e(s(d),{class:"text-xs text-zinc-500"},p({default:l(()=>[m(" "+f(i("icon")),1)]),_:2},[a("icon")?{name:"tooltip",fn:l(()=>[e(s(v),{source:a("icon"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),e(s(B),{"model-value":n.value.icon??"","onUpdate:modelValue":t[3]||(t[3]=o=>c(o.trim()===""?{icon:void 0}:{icon:o}))},null,8,["model-value"])]),_:1}),e(s(u),{orientation:"vertical"},{default:l(()=>[e(s(d),{class:"text-xs text-zinc-500"},p({default:l(()=>[m(" "+f(i("color")),1)]),_:2},[a("color")?{name:"tooltip",fn:l(()=>[e(s(v),{source:a("color"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),e(s(F),{"model-value":n.value.color??"","onUpdate:modelValue":t[4]||(t[4]=o=>c(o.trim()===""?{color:void 0}:{color:o}))},null,8,["model-value"])]),_:1})]),x("div",L,[e(s(u),{orientation:"vertical",class:"flex-1 basis-0 min-w-0"},{default:l(()=>[e(s(d),{class:"text-xs text-zinc-500"},p({default:l(()=>[m(" "+f(i("messageExpression")),1)]),_:2},[a("messageExpression")?{name:"tooltip",fn:l(()=>[e(s(v),{source:a("messageExpression"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),e(s(_),{"model-value":n.value.messageExpression??"",placeholder:"例:string(json.message)","result-type":"string","extra-vars":{json:{type:"dyn",label:"HTTP 响应体(已解析 JSON)"}},"onUpdate:modelValue":t[5]||(t[5]=o=>c({messageExpression:o===""?void 0:o}))},null,8,["model-value"])]),_:1}),e(s(u),{orientation:"vertical",class:"flex-1 basis-0 min-w-0"},{default:l(()=>[e(s(d),{class:"text-xs text-zinc-500"},p({default:l(()=>[m(" "+f(i("resultExpression")),1)]),_:2},[a("resultExpression")?{name:"tooltip",fn:l(()=>[e(s(v),{source:a("resultExpression"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),e(s(_),{"model-value":n.value.resultExpression??"",placeholder:"例:json.code == 0 ? 'success' : 'error'","result-type":"string","extra-vars":{json:{type:"dyn",label:"HTTP 响应体(已解析 JSON)"}},"onUpdate:modelValue":t[6]||(t[6]=o=>c({resultExpression:o===""?void 0:o}))},null,8,["model-value"])]),_:1})]),x("div",O,[(b(),N(C,null,D(w,o=>e(s(u),{key:o,orientation:"vertical",class:"min-w-0"},{default:l(()=>[e(s(d),{class:"text-xs text-zinc-500"},p({default:l(()=>[m(" "+f(i(o)),1)]),_:2},[a(o)?{name:"tooltip",fn:l(()=>[e(s(v),{source:a(o),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),e(z,{triggers:n.value[o]??[],"onUpdate:triggers":g=>y(o,g)},null,8,["triggers","onUpdate:triggers"])]),_:2},1024)),64))])]),_:1}))}});export{M as default};
@@ -1 +0,0 @@
1
- import{i as m,g as T,a as V,d as $,u as w,s as z,o as U,c as b,w as l,b as a,e as n,_ as p,f as v,h as _,j as g,t as y,k as x,l as A,m as D,n as F,p as B}from"./index-C1wWjgLL.js";import{_ as C}from"./FieldGroup.vue_vue_type_script_setup_true_lang-ByKzTJkK.js";function f(e){switch(e._tag){case"TypeLiteral":return e;case"Transformation":return f(e.to);case"Refinement":return f(e.from);case"Suspend":return f(e.f());default:return null}}function N(e,o){const s=f(e.ast);return s?s.propertySignatures.find(t=>t.name===o)??null:null}function O(e){const o=e.type;if(o._tag==="Union"&&e.isOptional){const s=o.types.find(t=>t._tag!=="UndefinedKeyword");if(s)return s}return o}function k(e,o,s){const t=N(e,o);if(!t)return;const c=s(t);if(m(c))return c.value;const d=O(t),i=s(d);if(m(i))return i.value;if(d!==t.type){const r=s(t.type);if(m(r))return r.value}}function P(e,o){return k(e,o,T)}function R(e,o){return k(e,o,V)}const h={class:"grid grid-cols-2 gap-4"},M=$({name:"ShwfedAlertOperationConfig",__name:"config",props:{modelValue:{required:!0},modelModifiers:{}},emits:["update:modelValue"],setup(e){const o=w(e,"modelValue"),s=z(),t=i=>P(s,i)??i,c=i=>R(s,i);function d(i){const r={...o.value,...i};for(const[u,S]of Object.entries(i))S===void 0&&Reflect.deleteProperty(r,u);o.value=r}return(i,r)=>(U(),b(n(C),null,{default:l(()=>[a(n(p),{orientation:"vertical"},{default:l(()=>[a(n(v),{class:"text-xs text-zinc-500"},_({default:l(()=>[g(" "+y(t("message")),1)]),_:2},[c("message")?{name:"tooltip",fn:l(()=>[a(n(x),{source:c("message"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),a(n(A),{markdown:"","model-value":o.value.message,"onUpdate:modelValue":r[0]||(r[0]=u=>d({message:u}))},null,8,["model-value"])]),_:1}),D("div",h,[a(n(p),{orientation:"vertical"},{default:l(()=>[a(n(v),{class:"text-xs text-zinc-500"},_({default:l(()=>[g(" "+y(t("icon")),1)]),_:2},[c("icon")?{name:"tooltip",fn:l(()=>[a(n(x),{source:c("icon"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),a(n(F),{"model-value":o.value.icon??"","onUpdate:modelValue":r[1]||(r[1]=u=>d(u.trim()===""?{icon:void 0}:{icon:u}))},null,8,["model-value"])]),_:1}),a(n(p),{orientation:"vertical"},{default:l(()=>[a(n(v),{class:"text-xs text-zinc-500"},_({default:l(()=>[g(" "+y(t("color")),1)]),_:2},[c("color")?{name:"tooltip",fn:l(()=>[a(n(x),{source:c("color"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),a(n(B),{"model-value":o.value.color??"","onUpdate:modelValue":r[2]||(r[2]=u=>d(u.trim()===""?{color:void 0}:{color:u}))},null,8,["model-value"])]),_:1})])]),_:1}))}});export{M as default};
@@ -1 +0,0 @@
1
- import{d as T,u as y,aF as U,P as z,m as x,b as t,w as n,e as s,Y as D,a4 as F,o as V,f as i,j as u,k as c,a2 as d,_ as p,aG as g,h as f,t as _,a3 as C,a5 as H,a6 as L,z as S}from"./index-C1wWjgLL.js";const N={class:"flex flex-col gap-3"},$={class:"grid grid-cols-2 gap-3"},B={class:"flex items-start gap-2"},M={class:"grid grid-cols-2 gap-3"},I=T({name:"ShwfedHttpDownloadActionConfig",__name:"config",props:{modelValue:{required:!0},modelModifiers:{}},emits:["update:modelValue"],setup(j){const l=y(j,"modelValue"),E=U(()=>{}),m=a=>H(E,a)??a,r=a=>L(E,a),q=["onSuccess","onWarning","onError","onInfo"],h=S({get:()=>l.value.template?.request??"",set:a=>{l.value={...l.value,template:{...l.value.template,request:a}}}}),w=S({get:()=>l.value.template?.download??"",set:a=>{const e=l.value.template??{request:""};if(a.length===0){const{download:o,...v}=e;l.value={...l.value,template:v}}else l.value={...l.value,template:{...e,download:a}}}});function b(a){const e={...l.value};a.length===0?delete e.messageExpression:e.messageExpression=a,l.value=e}function k(a){const e={...l.value};a.length===0?delete e.resultExpression:e.resultExpression=a,l.value=e}function R(a,e){const o={...l.value};e.length===0?Reflect.deleteProperty(o,a):o[a]=e,l.value=o}return(a,e)=>(V(),z("div",N,[x("div",$,[t(s(p),{orientation:"vertical"},{default:n(()=>[t(s(i),{class:"text-xs text-zinc-500"},{tooltip:n(()=>[t(s(c),{source:r("template")??"返回 `HttpRequest` 的 CEL 表达式;未配置「下载请求」时直接下载其响应",block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),default:n(()=>[e[2]||(e[2]=u(" 请求 ",-1))]),_:1}),t(s(d),{"model-value":h.value,multiline:"",placeholder:"例:http.get('https://api.example.com/files/123')","result-type":"HttpRequest",class:"min-h-16","onUpdate:modelValue":e[0]||(e[0]=o=>h.value=o)},null,8,["model-value"])]),_:1}),t(s(p),{orientation:"vertical"},{default:n(()=>[t(s(i),{class:"text-xs text-zinc-500"},{tooltip:n(()=>[t(s(c),{source:"可选的第二步:用第一步响应 `json` 中的凭据构造真正的下载请求,例如 `json.data.key`",block:"",class:"prose prose-sm prose-zinc"})]),default:n(()=>[e[3]||(e[3]=u(" 下载请求 ",-1))]),_:1}),t(s(d),{"model-value":w.value,multiline:"",placeholder:"例:http.get('https://api.example.com/download').query('key', json.data.key)","result-type":"HttpRequest","extra-vars":{json:s(g)},class:"min-h-16","onUpdate:modelValue":e[1]||(e[1]=o=>w.value=o)},null,8,["model-value","extra-vars"])]),_:1})]),x("div",B,[t(s(p),{orientation:"vertical",class:"flex-1 basis-0 min-w-0"},{default:n(()=>[t(s(i),{class:"text-xs text-zinc-500"},f({default:n(()=>[u(" "+_(m("messageExpression")),1)]),_:2},[r("messageExpression")?{name:"tooltip",fn:n(()=>[t(s(c),{source:r("messageExpression"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),t(s(d),{"model-value":l.value.messageExpression??"",placeholder:"例:string(json.message)","result-type":"string","extra-vars":{json:s(g)},"onUpdate:modelValue":b},null,8,["model-value","extra-vars"])]),_:1}),t(s(p),{orientation:"vertical",class:"flex-1 basis-0 min-w-0"},{default:n(()=>[t(s(i),{class:"text-xs text-zinc-500"},f({default:n(()=>[u(" "+_(m("resultExpression")),1)]),_:2},[r("resultExpression")?{name:"tooltip",fn:n(()=>[t(s(c),{source:r("resultExpression"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),t(s(d),{"model-value":l.value.resultExpression??"",placeholder:"例:json.code == 0 ? 'success' : 'error'","result-type":"string","extra-vars":{json:s(g)},"onUpdate:modelValue":k},null,8,["model-value","extra-vars"])]),_:1})]),x("div",M,[(V(),z(D,null,F(q,o=>t(s(p),{key:o,orientation:"vertical",class:"min-w-0"},{default:n(()=>[t(s(i),{class:"text-xs text-zinc-500"},f({default:n(()=>[u(" "+_(m(o)),1)]),_:2},[r(o)?{name:"tooltip",fn:n(()=>[t(s(c),{source:r(o),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),t(C,{triggers:l.value[o]??[],"onUpdate:triggers":v=>R(o,v)},null,8,["triggers","onUpdate:triggers"])]),_:2},1024)),64))])]))}});export{I as default};
@@ -1 +0,0 @@
1
- import{d as x,u as k,b7 as g,P as S,b as e,w as l,e as a,o as V,f as r,h as m,j as d,t as f,k as p,az as w,_,l as z,a5 as $,a6 as b}from"./index-C1wWjgLL.js";const h={class:"flex flex-col gap-4"},C=x({name:"ShwfedMarkdownItemConfig",__name:"config",props:{modelValue:{required:!0},modelModifiers:{}},emits:["update:modelValue"],setup(v){const t=k(v,"modelValue"),c=g(),u=o=>$(c,o)??o,s=o=>b(c,o);return(o,n)=>(V(),S("div",h,[e(a(_),{orientation:"vertical"},{default:l(()=>[e(a(r),{class:"text-xs text-zinc-500"},m({default:l(()=>[d(" "+f(u("name")),1)]),_:2},[s("name")?{name:"tooltip",fn:l(()=>[e(a(p),{source:s("name"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),e(a(w),{"model-value":t.value.name,placeholder:"仅用于编辑器内识别","onUpdate:modelValue":n[0]||(n[0]=i=>t.value={...t.value,name:String(i)})},null,8,["model-value"])]),_:1}),e(a(_),{orientation:"vertical"},{default:l(()=>[e(a(r),{class:"text-xs text-zinc-500"},m({default:l(()=>[d(" "+f(u("content")),1)]),_:2},[s("content")?{name:"tooltip",fn:l(()=>[e(a(p),{source:s("content"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),e(a(z),{markdown:"",multiline:"","model-value":t.value.content,"onUpdate:modelValue":n[1]||(n[1]=i=>t.value={...t.value,content:i})},null,8,["model-value"])]),_:1})]))}});export{C as default};
@@ -1 +0,0 @@
1
- import{d as y,u as z,aI as V,o as O,P as S,b as s,w as a,e as o,f as i,h as u,j as c,t as d,k as p,a2 as x,_ as m,m as _,a3 as T,l as U,aJ as $,a5 as j,a6 as B}from"./index-C1wWjgLL.js";const N={class:"flex flex-col gap-3"},C={class:"grid grid-cols-2 gap-3 items-start"},M={class:"flex items-start gap-2"},D=y({name:"ShwfedHttpRequestBatchActionConfig",__name:"config",props:{modelValue:{required:!0},modelModifiers:{}},emits:["update:modelValue"],setup(g){const t=z(g,"modelValue"),v=V(()=>{}),r=l=>j(v,l)??l,n=l=>B(v,l);function k(l){const e={...t.value};l.length===0?delete e.messageExpression:e.messageExpression=l,t.value=e}function E(l){const e={...t.value};l.length===0?delete e.resultExpression:e.resultExpression=l,t.value=e}function b(l){const e={...t.value};l.length===0?Reflect.deleteProperty(e,"before"):e.before=l,t.value=e}function h(l){const e={...t.value};!l||l.length===0?delete e.markdown:e.markdown=l,t.value=e}function w(l){const e={...t.value};l?e.continueOnError=!0:delete e.continueOnError,t.value=e}return(l,e)=>(O(),S("div",N,[s(o(m),{orientation:"vertical"},{default:a(()=>[s(o(i),{class:"text-xs text-zinc-500"},u({default:a(()=>[c(" "+d(r("expression")),1)]),_:2},[n("expression")?{name:"tooltip",fn:a(()=>[s(o(p),{source:n("expression"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(o(x),{"model-value":t.value.expression,multiline:"",placeholder:"例:range(1, 10).map(i, http.post('/api/foo').body({ id: i }))","result-type":"list",class:"min-h-16","onUpdate:modelValue":e[0]||(e[0]=f=>t.value={...t.value,expression:f})},null,8,["model-value"])]),_:1}),_("div",C,[s(o(m),{orientation:"vertical",class:"min-w-0"},{default:a(()=>[s(o(i),{class:"text-xs text-zinc-500"},u({default:a(()=>[c(" "+d(r("before")),1)]),_:2},[n("before")?{name:"tooltip",fn:a(()=>[s(o(p),{source:n("before"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(T,{triggers:t.value.before??[],"onUpdate:triggers":e[1]||(e[1]=f=>b(f))},null,8,["triggers"])]),_:1}),s(o(m),{orientation:"vertical",class:"min-w-0"},{default:a(()=>[s(o(i),{class:"text-xs text-zinc-500"},u({default:a(()=>[c(" "+d(r("markdown")),1)]),_:2},[n("markdown")?{name:"tooltip",fn:a(()=>[s(o(p),{source:n("markdown"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(o(U),{markdown:"","model-value":t.value.markdown,"onUpdate:modelValue":h},null,8,["model-value"])]),_:1})]),s(o(m),{orientation:"horizontal"},{default:a(()=>[s(o(i),{class:"text-xs text-zinc-500"},u({default:a(()=>[c(" "+d(r("continueOnError")),1)]),_:2},[n("continueOnError")?{name:"tooltip",fn:a(()=>[s(o(p),{source:n("continueOnError"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(o($),{"model-value":t.value.continueOnError??!1,"onUpdate:modelValue":w},null,8,["model-value"])]),_:1}),_("div",M,[s(o(m),{orientation:"vertical",class:"flex-1 basis-0 min-w-0"},{default:a(()=>[s(o(i),{class:"text-xs text-zinc-500"},u({default:a(()=>[c(" "+d(r("messageExpression")),1)]),_:2},[n("messageExpression")?{name:"tooltip",fn:a(()=>[s(o(p),{source:n("messageExpression"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(o(x),{"model-value":t.value.messageExpression??"",placeholder:"例:string(jsons.size()) + ' 条已处理'","result-type":"string","extra-vars":{jsons:{type:"list",label:"HTTP 响应体列表(已解析 JSON,仅成功项)"}},"onUpdate:modelValue":k},null,8,["model-value"])]),_:1}),s(o(m),{orientation:"vertical",class:"flex-1 basis-0 min-w-0"},{default:a(()=>[s(o(i),{class:"text-xs text-zinc-500"},u({default:a(()=>[c(" "+d(r("resultExpression")),1)]),_:2},[n("resultExpression")?{name:"tooltip",fn:a(()=>[s(o(p),{source:n("resultExpression"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(o(x),{"model-value":t.value.resultExpression??"",placeholder:"例:json.code == 0","result-type":"bool","extra-vars":{json:{type:"dyn",label:"HTTP 响应体(已解析 JSON),当前这一条响应"}},"onUpdate:modelValue":E},null,8,["model-value"])]),_:1})])]))}});export{D as default};
@@ -1 +0,0 @@
1
- import{d as Q,u as ee,ao as le,ap as te,v as I,aq as A,P as v,c as F,b as n,w as s,e as l,ar as ae,Z as oe,Y as H,as as ne,t as p,m as c,at as R,au as W,av as se,z as x,y as ie,O,o as d,aw as h,ax as j,ad as K,ay as Y,f as B,h as b,j as _,k as L,l as de,_ as U,az as q,a5 as ue,a6 as ve,aA as ce,aB as re,aC as me,aD as fe}from"./index-C1wWjgLL.js";const pe={key:0,class:"flex min-h-96 items-center justify-center p-8 text-sm text-zinc-400"},xe={key:1},ke={key:2,class:"p-6 text-sm text-red-500"},ye={key:2,class:"flex flex-col gap-4"},ge={class:"grid grid-cols-2 gap-4"},Ie={key:0,class:"flex gap-2 min-h-96"},Be={class:"flex w-56 shrink-0 flex-col"},be={class:"flex flex-1 flex-col gap-2"},_e={class:"flex-1"},Le={key:1,class:"flex flex-col gap-2"},Ue={class:"h-96"},De=Q({name:"ShwfedModalLayoutActionConfig",__name:"config",props:se({configure:{type:Function}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(V){const i=ee(V,"modelValue"),P=V,D=x(()=>P.configure??(()=>{})),E=le(()=>{}),k=a=>ue(E,a)??a,r=a=>ve(E,a),X=x({get:()=>i.value.slot??ce(),set:a=>{i.value={...i.value,slot:a}}}),t=te(X,{configure:D.value});function Z(a){i.value={...i.value,modalTitle:a}}function T(a,e){const o=e.trim(),g={...i.value};o.length===0?Reflect.deleteProperty(g,a):g[a]=o,i.value=g}function z(){const a=t.layouts.value;t.layouts.value=[...a,{name:"新布局",layout:{columns:1,placements:{}}}],t.activeLayoutIndex.value=a.length}function M(a,e){t.addBlock(a,e)}function S(a){t.removeBlock(a)}function w(a){t.removeBlocks(a)}const u=ie(null),m=x(()=>{const a=u.value;return a?t.blocks.value.find(e=>e.id===a)??null:null}),C=x(()=>{const a=m.value;return a?re()?.(a.type,a.compatibilityDate)??null:null});function $(a){u.value=a}function G(){u.value=null}I(()=>t.blocks.value.map(a=>a.id),a=>{const e=u.value;e&&!a.includes(e)&&(u.value=null)});function J(a){const e=u.value;e&&t.updateBlock(e,a)}const N=O(me,null);if(N){const a=N.add();I(m,e=>{e?(a.label.value=t.getBlockLabel(e),a.back.value=G):(a.label.value=null,a.back.value=null)},{immediate:!0}),A(()=>{a.dispose()})}const f=O(fe,null),y=x(()=>f?.target.value??null);return I(u,a=>{f?.drilled&&(f.drilled.value=!!a)},{immediate:!0}),A(()=>{f?.drilled&&(f.drilled.value=!1)}),(a,e)=>(d(),v(H,null,[y.value&&!u.value?(d(),F(ae,{key:0,to:y.value},[n(l(j),{class:"flex-1"},{default:s(()=>[n(h,{"model-value":l(t).layouts.value,"active-index":l(t).activeLayoutIndex.value,"onUpdate:modelValue":e[0]||(e[0]=o=>{l(t).layouts.value=o}),"onUpdate:activeIndex":e[1]||(e[1]=o=>{l(t).activeLayoutIndex.value=o})},null,8,["model-value","active-index"])]),_:1}),n(l(Y),{variant:"ghost",size:"sm",onClick:e[2]||(e[2]=o=>z())},{default:s(()=>[n(l(K),{icon:"fluent:add-20-regular",class:"size-4"}),e[17]||(e[17]=c("span",null,"新增布局",-1))]),_:1})],8,["to"])):oe("",!0),u.value?(d(),v(H,{key:1},[m.value?C.value?(d(),v("div",xe,[(d(),F(ne(C.value.config),{"model-value":m.value,configure:D.value,"onUpdate:modelValue":e[3]||(e[3]=o=>J(o))},null,8,["model-value","configure"]))])):(d(),v("div",ke," 未注册的块类型:"+p(m.value.type)+"@"+p(m.value.compatibilityDate),1)):(d(),v("div",pe," 块已不存在 "))],64)):(d(),v("div",ye,[n(l(U),{orientation:"vertical"},{default:s(()=>[n(l(B),{class:"text-xs text-zinc-500"},b({default:s(()=>[_(" "+p(k("modalTitle")),1)]),_:2},[r("modalTitle")?{name:"tooltip",fn:s(()=>[n(l(L),{source:r("modalTitle"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),n(l(de),{markdown:"","model-value":i.value.modalTitle,"translate-hint":k("modalTitle"),"onUpdate:modelValue":Z},null,8,["model-value","translate-hint"])]),_:1}),c("div",ge,[n(l(U),{orientation:"vertical"},{default:s(()=>[n(l(B),{class:"text-xs text-zinc-500"},b({default:s(()=>[_(" "+p(k("modalWidth")),1)]),_:2},[r("modalWidth")?{name:"tooltip",fn:s(()=>[n(l(L),{source:r("modalWidth"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),n(l(q),{"model-value":i.value.modalWidth??"",placeholder:"例:720px / 60vw","onUpdate:modelValue":e[4]||(e[4]=o=>T("modalWidth",String(o)))},null,8,["model-value"])]),_:1}),n(l(U),{orientation:"vertical"},{default:s(()=>[n(l(B),{class:"text-xs text-zinc-500"},b({default:s(()=>[_(" "+p(k("modalMinHeight")),1)]),_:2},[r("modalMinHeight")?{name:"tooltip",fn:s(()=>[n(l(L),{source:r("modalMinHeight"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),n(l(q),{"model-value":i.value.modalMinHeight??"",placeholder:"例:400px / 60vh","onUpdate:modelValue":e[5]||(e[5]=o=>T("modalMinHeight",String(o)))},null,8,["model-value"])]),_:1})]),y.value?(d(),v("div",Le,[n(R,{"model-value":l(t).layouts.value,index:l(t).activeLayoutIndex.value,"onUpdate:modelValue":e[13]||(e[13]=o=>{l(t).layouts.value=o})},null,8,["model-value","index"]),c("div",Ue,[n(W,{"model-value":l(t).layouts.value,"active-index":l(t).activeLayoutIndex.value,"selected-item-ids":l(t).selectedBlockIds.value,items:l(t).blocks.value,"find-entry":l(t).findBlockMeta,"get-item-label":l(t).getBlockLabel,"picker-entries":l(t).pickerEntries.value,"can-delete":!0,"item-noun":"块","onUpdate:modelValue":e[14]||(e[14]=o=>{l(t).layouts.value=o}),"onUpdate:activeIndex":e[15]||(e[15]=o=>{l(t).activeLayoutIndex.value=o}),"onUpdate:selectedItemIds":e[16]||(e[16]=o=>{l(t).selectedBlockIds.value=o}),onAddNew:M,onDrillDown:$,onDeleteItem:S,onDeleteItems:w},null,8,["model-value","active-index","selected-item-ids","items","find-entry","get-item-label","picker-entries"])])])):(d(),v("div",Ie,[c("div",Be,[n(l(j),{class:"flex-1"},{default:s(()=>[n(h,{"model-value":l(t).layouts.value,"active-index":l(t).activeLayoutIndex.value,"onUpdate:modelValue":e[6]||(e[6]=o=>{l(t).layouts.value=o}),"onUpdate:activeIndex":e[7]||(e[7]=o=>{l(t).activeLayoutIndex.value=o})},null,8,["model-value","active-index"])]),_:1}),n(l(Y),{variant:"ghost",size:"sm",onClick:e[8]||(e[8]=o=>z())},{default:s(()=>[n(l(K),{icon:"fluent:add-20-regular",class:"size-4"}),e[18]||(e[18]=c("span",null,"新增布局",-1))]),_:1})]),c("div",be,[n(R,{"model-value":l(t).layouts.value,index:l(t).activeLayoutIndex.value,"onUpdate:modelValue":e[9]||(e[9]=o=>{l(t).layouts.value=o})},null,8,["model-value","index"]),c("div",_e,[n(W,{"model-value":l(t).layouts.value,"active-index":l(t).activeLayoutIndex.value,"selected-item-ids":l(t).selectedBlockIds.value,items:l(t).blocks.value,"find-entry":l(t).findBlockMeta,"get-item-label":l(t).getBlockLabel,"picker-entries":l(t).pickerEntries.value,"can-delete":!0,"item-noun":"块","onUpdate:modelValue":e[10]||(e[10]=o=>{l(t).layouts.value=o}),"onUpdate:activeIndex":e[11]||(e[11]=o=>{l(t).activeLayoutIndex.value=o}),"onUpdate:selectedItemIds":e[12]||(e[12]=o=>{l(t).selectedBlockIds.value=o}),onAddNew:M,onDrillDown:$,onDeleteItem:S,onDeleteItems:w},null,8,["model-value","active-index","selected-item-ids","items","find-entry","get-item-label","picker-entries"])])])]))]))],64))}});export{De as default};
@@ -1 +0,0 @@
1
- import{d as f,b4 as u,r as m,b5 as p,aq as g,Z as l,O as I,b6 as y}from"./index-C1wWjgLL.js";const w=f({name:"ShwfedActionDefinition",inheritAttrs:!1,__name:"definition",props:{actionId:{},effect:{}},setup(r){const n=r,c=u(),t=I(y,void 0),i=crypto.randomUUID(),a=import.meta.dev;let e,s=!1;function d(){!a||s||(s=!0,console.warn("[shwfed-action-definition] must be used inside <shwfed-actions>."))}function o(){if(!t){d();return}e&&e!==n.actionId&&t.unregisterAction(e,i),t.registerAction({ownerId:i,actionId:n.actionId,effect:n.effect,render:c.default}),e=n.actionId}return o(),m(()=>{o()}),p(()=>{o()}),g(()=>{!t||!e||t.unregisterAction(e,i)}),(A,_)=>l("",!0)}});export{w as _};
@@ -1 +0,0 @@
1
- import{b8 as e}from"./index-C1wWjgLL.js";import{b9 as f,ba as r,bb as s}from"./index-C1wWjgLL.js";export{f as TableConfig,r as createTableConfig,e as default,s as getColumnTechnicalKey};