@shwfed/config 2.9.4 → 2.9.6

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 (153) hide show
  1. package/dist/mcp.mjs +558 -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-B-Cwm94m.js +1 -0
  5. package/dist/preview/assets/badge-nn3uvUrR.js +1 -0
  6. package/dist/preview/assets/config-BNQXbhtM.js +1 -0
  7. package/dist/preview/assets/config-Bg95dd9K.js +1 -0
  8. package/dist/preview/assets/config-C6LousLT.js +1 -0
  9. package/dist/preview/assets/config-CGhV-PCy.js +1 -0
  10. package/dist/preview/assets/config-CUkEZF8G.js +1 -0
  11. package/dist/preview/assets/config-DO77XC7j.js +1 -0
  12. package/dist/preview/assets/config-DbjXscRV.js +1 -0
  13. package/dist/preview/assets/config-DiD-8mMw.js +1 -0
  14. package/dist/preview/assets/config-Dvq_Xh7I.js +1 -0
  15. package/dist/preview/assets/config-d8ZhbBPg.js +1 -0
  16. package/dist/preview/assets/config-e8Li9jh4.js +1 -0
  17. package/dist/preview/assets/definition.vue_vue_type_script_setup_true_lang-DuO-EwWA.js +1 -0
  18. package/dist/preview/assets/{index-cyMSopN_.js → index-Bpap7h0Q.js} +217 -186
  19. package/dist/preview/assets/{index-CHkjJPVP.js → index-DZyYLnIs.js} +1 -1
  20. package/dist/preview/assets/index-jHSCIEVi.js +1 -0
  21. package/dist/preview/assets/index-vPcvbp7e.css +1 -0
  22. package/dist/preview/assets/item-BqnYkxMr.js +1 -0
  23. package/dist/preview/assets/{runtime-Dy1bI4VO.js → runtime-BFAxoqEC.js} +1 -1
  24. package/dist/preview/assets/runtime-BntIEgRD.js +1 -0
  25. package/dist/preview/assets/{runtime-lZLYBBgn.js → runtime-Bu6BEaxq.js} +1 -1
  26. package/dist/preview/assets/runtime-CfdnDil3.js +1 -0
  27. package/dist/preview/assets/runtime-CqoGHW0U.js +1 -0
  28. package/dist/preview/assets/runtime-D6blej8e.js +1 -0
  29. package/dist/preview/assets/runtime-DEsY0ihh.js +1 -0
  30. package/dist/preview/assets/runtime-DrnADq2i.js +1 -0
  31. package/dist/preview/assets/runtime-JW4LSnRF.js +1 -0
  32. package/dist/preview/assets/runtime-U7gyBbWI.js +1 -0
  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-28/com.shwfed.form.field.number/config.d.vue.ts +2 -2
  74. package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.number/config.vue.d.ts +2 -2
  75. package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.numberrange/config.d.vue.ts +2 -2
  76. package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.numberrange/config.vue.d.ts +2 -2
  77. package/dist/runtime/components/form/fields/2026-05-13/com.shwfed.form.field.list/config.d.vue.ts +2 -2
  78. package/dist/runtime/components/form/fields/2026-05-13/com.shwfed.form.field.list/config.vue.d.ts +2 -2
  79. package/dist/runtime/components/form/fields/2026-05-13/com.shwfed.form.field.list/schema.d.ts +1 -1
  80. package/dist/runtime/components/operations/2026-06-09/com.shwfed.operation.alert/config.d.vue.ts +31 -0
  81. package/dist/runtime/components/operations/2026-06-09/com.shwfed.operation.alert/config.vue +89 -0
  82. package/dist/runtime/components/operations/2026-06-09/com.shwfed.operation.alert/config.vue.d.ts +31 -0
  83. package/dist/runtime/components/operations/2026-06-09/com.shwfed.operation.alert/runtime.d.ts +2 -0
  84. package/dist/runtime/components/operations/2026-06-09/com.shwfed.operation.alert/runtime.js +14 -0
  85. package/dist/runtime/components/operations/2026-06-09/com.shwfed.operation.alert/schema.d.ts +21 -0
  86. package/dist/runtime/components/operations/2026-06-09/com.shwfed.operation.alert/schema.js +36 -0
  87. package/dist/runtime/components/operations/utils/resolve.d.ts +48 -0
  88. package/dist/runtime/components/operations/utils/resolve.js +76 -0
  89. package/dist/runtime/components/table/columns/2026-05-13/com.shwfed.table.column.switch/schema.d.ts +2 -0
  90. package/dist/runtime/components/table/columns/2026-05-13/com.shwfed.table.column.switch.remote/schema.d.ts +2 -0
  91. package/dist/runtime/components/table/columns/2026-05-24/com.shwfed.table.column.combobox-single.remote.options-remote/config.d.vue.ts +4 -0
  92. package/dist/runtime/components/table/columns/2026-05-24/com.shwfed.table.column.combobox-single.remote.options-remote/config.vue.d.ts +4 -0
  93. package/dist/runtime/components/table/columns/2026-05-24/com.shwfed.table.column.combobox-single.remote.options-remote/schema.d.ts +2 -0
  94. package/dist/runtime/components/table/columns/2026-05-24/com.shwfed.table.column.combobox-single.remote.options-static/config.d.vue.ts +4 -0
  95. package/dist/runtime/components/table/columns/2026-05-24/com.shwfed.table.column.combobox-single.remote.options-static/config.vue.d.ts +4 -0
  96. package/dist/runtime/components/table/columns/2026-05-24/com.shwfed.table.column.combobox-single.remote.options-static/schema.d.ts +2 -0
  97. package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-remote/config.d.vue.ts +4 -0
  98. package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-remote/config.vue.d.ts +4 -0
  99. package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-remote/schema.d.ts +2 -0
  100. package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-static/config.d.vue.ts +4 -0
  101. package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-static/config.vue.d.ts +4 -0
  102. package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-static/schema.d.ts +2 -0
  103. package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-multi.remote/config.d.vue.ts +4 -0
  104. package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-multi.remote/config.vue.d.ts +4 -0
  105. package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-multi.remote/schema.d.ts +2 -0
  106. package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-single.remote/config.d.vue.ts +4 -0
  107. package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-single.remote/config.vue.d.ts +4 -0
  108. package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-single.remote/schema.d.ts +2 -0
  109. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-multi/config.d.vue.ts +4 -0
  110. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-multi/config.vue.d.ts +4 -0
  111. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-multi/schema.d.ts +4 -0
  112. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-single/config.d.vue.ts +4 -0
  113. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-single/config.vue.d.ts +4 -0
  114. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-single/schema.d.ts +4 -0
  115. package/dist/runtime/components/table/schema.d.ts +2 -2
  116. package/dist/runtime/components/ui/progress/Progress.d.vue.ts +11 -0
  117. package/dist/runtime/components/ui/progress/Progress.vue +32 -0
  118. package/dist/runtime/components/ui/progress/Progress.vue.d.ts +11 -0
  119. package/dist/runtime/components/ui/progress/index.d.ts +1 -0
  120. package/dist/runtime/components/ui/progress/index.js +1 -0
  121. package/dist/runtime/composables/useOverlay.d.ts +35 -0
  122. package/dist/runtime/composables/useOverlay.js +52 -0
  123. package/dist/runtime/share/event-bus.d.ts +24 -2
  124. package/dist/runtime/share/event-bus.js +21 -3
  125. package/dist/runtime/share/interpolate.d.ts +12 -0
  126. package/dist/runtime/share/interpolate.js +18 -0
  127. package/dist/runtime/share/page-target.d.ts +16 -0
  128. package/dist/runtime/share/page-target.js +1 -0
  129. package/dist/runtime/share/schema-meta.d.ts +5 -0
  130. package/dist/runtime/share/schema-meta.js +48 -0
  131. package/dist/runtime/style.css +1 -1
  132. package/package.json +1 -1
  133. package/dist/preview/assets/badge-Nmf0QGvo.js +0 -1
  134. package/dist/preview/assets/config-BuBQPlju.js +0 -1
  135. package/dist/preview/assets/config-CBxDLjqQ.js +0 -1
  136. package/dist/preview/assets/config-CSU0Tuu4.js +0 -1
  137. package/dist/preview/assets/config-Cnu3ZCPF.js +0 -1
  138. package/dist/preview/assets/config-CzBP2y8L.js +0 -1
  139. package/dist/preview/assets/config-nczxdERQ.js +0 -1
  140. package/dist/preview/assets/config-qCPGn6mB.js +0 -1
  141. package/dist/preview/assets/config-vHYVnzyt.js +0 -1
  142. package/dist/preview/assets/config-w2mvI_4h.js +0 -1
  143. package/dist/preview/assets/definition.vue_vue_type_script_setup_true_lang-DqE0YNVF.js +0 -1
  144. package/dist/preview/assets/index-BgvMBKzp.js +0 -1
  145. package/dist/preview/assets/index-COSjWreD.css +0 -1
  146. package/dist/preview/assets/item-DAL4Ui_l.js +0 -1
  147. package/dist/preview/assets/runtime-BcsMOkA2.js +0 -1
  148. package/dist/preview/assets/runtime-BzwoxDCd.js +0 -1
  149. package/dist/preview/assets/runtime-Cu2DKoI0.js +0 -1
  150. package/dist/preview/assets/runtime-Dp0JEFtU.js +0 -1
  151. package/dist/preview/assets/runtime-YE1oXXQN.js +0 -1
  152. package/dist/preview/assets/runtime-YRSxexBQ.js +0 -1
  153. package/dist/preview/assets/runtime-uwt0BxpS.js +0 -1
@@ -3,16 +3,7 @@ import type { Environment } from '../../vendor/cel-js/lib/index.js';
3
3
  import { type LocaleValue } from '../../share/locale.js';
4
4
  export { getStructFieldDescription, getStructFieldTitle } from '../table/utils/schema-meta.js';
5
5
  declare const KIND = "shwfed.component.page";
6
- /**
7
- * Reserved sentinel instance id for the singleton page operation target. The
8
- * page is the outermost `ShwfedConfig` — there is only ever one per tree, so it
9
- * needs no stored, per-config id (which would force a migration of every
10
- * existing page config). The nil UUID can never collide with a block id:
11
- * `crypto.randomUUID()` always sets version-4 + variant bits, so it never
12
- * emits all-zeros. It also passes `Schema.UUID`'s lenient hex-layout regex, so
13
- * stored triggers targeting it decode cleanly.
14
- */
15
- export declare const PAGE_TARGET_ID = "00000000-0000-0000-0000-000000000000";
6
+ export { PAGE_TARGET_ID } from '../../share/page-target.js';
16
7
  /**
17
8
  * Capability manifest — type-level display info plus the operations the page
18
9
  * instance exposes to op-requests bubbled up from its descendants. Mirrors the
@@ -26,6 +17,11 @@ export declare const metadata: {
26
17
  readonly id: "close";
27
18
  readonly name: "关闭标签页";
28
19
  readonly icon: "fluent:dismiss-20-regular";
20
+ }, {
21
+ readonly id: "com.shwfed.operation.alert";
22
+ readonly compatibilityDate: "2026-06-09";
23
+ readonly name: "确认弹窗";
24
+ readonly icon: "fluent:chat-warning-20-regular";
29
25
  }];
30
26
  };
31
27
  export declare function PageConfig(configure: (env: Environment) => void): Schema.Struct<{
@@ -1,15 +1,25 @@
1
1
  import { Schema } from "effect";
2
2
  import { Expression, Slot, defaultSlot } from "../../share/layout.js";
3
3
  import { Locale } from "../../share/locale.js";
4
+ import * as alertOperation from "../operations/2026-06-09/com.shwfed.operation.alert/schema.js";
4
5
  import { blockRef } from "./utils/resolve.js";
5
6
  export { getStructFieldDescription, getStructFieldTitle } from "../table/utils/schema-meta.js";
6
7
  const KIND = "shwfed.component.page";
7
- export const PAGE_TARGET_ID = "00000000-0000-0000-0000-000000000000";
8
+ export { PAGE_TARGET_ID } from "../../share/page-target.js";
8
9
  export const metadata = {
9
10
  name: "\u9875\u9762",
10
11
  icon: "fluent:document-20-regular",
11
12
  operations: [
12
- { id: "close", name: "\u5173\u95ED\u6807\u7B7E\u9875", icon: "fluent:dismiss-20-regular" }
13
+ { id: "close", name: "\u5173\u95ED\u6807\u7B7E\u9875", icon: "fluent:dismiss-20-regular" },
14
+ // Parameterized op: `compatibilityDate` marks it as carrying params, so the
15
+ // trigger editor seeds `defaults()` and renders the alert's `config.vue`.
16
+ // `id` doubles as the operation-block `type`.
17
+ {
18
+ id: alertOperation.type,
19
+ compatibilityDate: alertOperation.compatibilityDate,
20
+ name: alertOperation.metadata.name,
21
+ icon: alertOperation.metadata.icon
22
+ }
13
23
  ]
14
24
  };
15
25
  export function PageConfig(configure) {
@@ -24,6 +24,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
24
24
  }[]] | undefined;
25
25
  readonly required?: string | undefined;
26
26
  readonly displayName?: string | undefined;
27
+ readonly max?: string | undefined;
27
28
  readonly compatibilityDate: "2026-04-28";
28
29
  readonly orientation?: "vertical" | "floating" | undefined;
29
30
  readonly placeholder?: readonly [{
@@ -34,7 +35,6 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
34
35
  readonly message: string;
35
36
  }[]] | undefined;
36
37
  readonly min?: string | undefined;
37
- readonly max?: string | undefined;
38
38
  readonly step?: number | undefined;
39
39
  readonly readonly?: string | undefined;
40
40
  readonly binding?: string | undefined;
@@ -79,6 +79,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
79
79
  }[]] | undefined;
80
80
  readonly required?: string | undefined;
81
81
  readonly displayName?: string | undefined;
82
+ readonly max?: string | undefined;
82
83
  readonly compatibilityDate: "2026-04-28";
83
84
  readonly orientation?: "vertical" | "floating" | undefined;
84
85
  readonly placeholder?: readonly [{
@@ -89,7 +90,6 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
89
90
  readonly message: string;
90
91
  }[]] | undefined;
91
92
  readonly min?: string | undefined;
92
- readonly max?: string | undefined;
93
93
  readonly step?: number | undefined;
94
94
  readonly readonly?: string | undefined;
95
95
  readonly binding?: string | undefined;
@@ -24,6 +24,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
24
24
  }[]] | undefined;
25
25
  readonly required?: string | undefined;
26
26
  readonly displayName?: string | undefined;
27
+ readonly max?: string | undefined;
27
28
  readonly compatibilityDate: "2026-04-28";
28
29
  readonly orientation?: "vertical" | "floating" | undefined;
29
30
  readonly placeholder?: readonly [{
@@ -34,7 +35,6 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
34
35
  readonly message: string;
35
36
  }[]] | undefined;
36
37
  readonly min?: string | undefined;
37
- readonly max?: string | undefined;
38
38
  readonly step?: number | undefined;
39
39
  readonly readonly?: string | undefined;
40
40
  readonly binding?: string | undefined;
@@ -79,6 +79,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
79
79
  }[]] | undefined;
80
80
  readonly required?: string | undefined;
81
81
  readonly displayName?: string | undefined;
82
+ readonly max?: string | undefined;
82
83
  readonly compatibilityDate: "2026-04-28";
83
84
  readonly orientation?: "vertical" | "floating" | undefined;
84
85
  readonly placeholder?: readonly [{
@@ -89,7 +90,6 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
89
90
  readonly message: string;
90
91
  }[]] | undefined;
91
92
  readonly min?: string | undefined;
92
- readonly max?: string | undefined;
93
93
  readonly step?: number | undefined;
94
94
  readonly readonly?: string | undefined;
95
95
  readonly binding?: string | undefined;
@@ -24,10 +24,10 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
24
24
  }[]] | undefined;
25
25
  readonly required?: string | undefined;
26
26
  readonly displayName?: string | undefined;
27
+ readonly max?: string | undefined;
27
28
  readonly compatibilityDate: "2026-04-28";
28
29
  readonly orientation?: "vertical" | "floating" | undefined;
29
30
  readonly min?: string | undefined;
30
- readonly max?: string | undefined;
31
31
  readonly step?: number | undefined;
32
32
  readonly readonly?: string | undefined;
33
33
  readonly binding?: string | readonly [string, string] | undefined;
@@ -87,10 +87,10 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
87
87
  }[]] | undefined;
88
88
  readonly required?: string | undefined;
89
89
  readonly displayName?: string | undefined;
90
+ readonly max?: string | undefined;
90
91
  readonly compatibilityDate: "2026-04-28";
91
92
  readonly orientation?: "vertical" | "floating" | undefined;
92
93
  readonly min?: string | undefined;
93
- readonly max?: string | undefined;
94
94
  readonly step?: number | undefined;
95
95
  readonly readonly?: string | undefined;
96
96
  readonly binding?: string | readonly [string, string] | undefined;
@@ -24,10 +24,10 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
24
24
  }[]] | undefined;
25
25
  readonly required?: string | undefined;
26
26
  readonly displayName?: string | undefined;
27
+ readonly max?: string | undefined;
27
28
  readonly compatibilityDate: "2026-04-28";
28
29
  readonly orientation?: "vertical" | "floating" | undefined;
29
30
  readonly min?: string | undefined;
30
- readonly max?: string | undefined;
31
31
  readonly step?: number | undefined;
32
32
  readonly readonly?: string | undefined;
33
33
  readonly binding?: string | readonly [string, string] | undefined;
@@ -87,10 +87,10 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
87
87
  }[]] | undefined;
88
88
  readonly required?: string | undefined;
89
89
  readonly displayName?: string | undefined;
90
+ readonly max?: string | undefined;
90
91
  readonly compatibilityDate: "2026-04-28";
91
92
  readonly orientation?: "vertical" | "floating" | undefined;
92
93
  readonly min?: string | undefined;
93
- readonly max?: string | undefined;
94
94
  readonly step?: number | undefined;
95
95
  readonly readonly?: string | undefined;
96
96
  readonly binding?: string | readonly [string, string] | undefined;
@@ -31,9 +31,9 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
31
31
  readonly message: string;
32
32
  }[]] | undefined;
33
33
  readonly displayName?: string | undefined;
34
+ readonly max?: number | undefined;
34
35
  readonly compatibilityDate: "2026-05-13";
35
36
  readonly min?: number | undefined;
36
- readonly max?: number | undefined;
37
37
  readonly unit: Readonly<{
38
38
  fields: ReadonlyArray<import("../../../schema.js").FieldValue>;
39
39
  layouts: readonly Readonly<{
@@ -99,9 +99,9 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
99
99
  readonly message: string;
100
100
  }[]] | undefined;
101
101
  readonly displayName?: string | undefined;
102
+ readonly max?: number | undefined;
102
103
  readonly compatibilityDate: "2026-05-13";
103
104
  readonly min?: number | undefined;
104
- readonly max?: number | undefined;
105
105
  readonly unit: Readonly<{
106
106
  fields: ReadonlyArray<import("../../../schema.js").FieldValue>;
107
107
  layouts: readonly Readonly<{
@@ -31,9 +31,9 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
31
31
  readonly message: string;
32
32
  }[]] | undefined;
33
33
  readonly displayName?: string | undefined;
34
+ readonly max?: number | undefined;
34
35
  readonly compatibilityDate: "2026-05-13";
35
36
  readonly min?: number | undefined;
36
- readonly max?: number | undefined;
37
37
  readonly unit: Readonly<{
38
38
  fields: ReadonlyArray<import("../../../schema.js").FieldValue>;
39
39
  layouts: readonly Readonly<{
@@ -99,9 +99,9 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
99
99
  readonly message: string;
100
100
  }[]] | undefined;
101
101
  readonly displayName?: string | undefined;
102
+ readonly max?: number | undefined;
102
103
  readonly compatibilityDate: "2026-05-13";
103
104
  readonly min?: number | undefined;
104
- readonly max?: number | undefined;
105
105
  readonly unit: Readonly<{
106
106
  fields: ReadonlyArray<import("../../../schema.js").FieldValue>;
107
107
  layouts: readonly Readonly<{
@@ -46,9 +46,9 @@ export declare function schema(configure: (env: Environment) => void): Schema.re
46
46
  readonly message: string;
47
47
  }[]] | undefined;
48
48
  readonly displayName?: string | undefined;
49
+ readonly max?: number | undefined;
49
50
  readonly compatibilityDate: "2026-05-13";
50
51
  readonly min?: number | undefined;
51
- readonly max?: number | undefined;
52
52
  readonly unit: Readonly<{
53
53
  fields: ReadonlyArray<import("../../../schema.js").FieldValue>;
54
54
  layouts: ReadonlyArray<import("../../../schema.js").LayoutSetValue>;
@@ -0,0 +1,31 @@
1
+ import { type Value } from './schema.js';
2
+ type __VLS_ModelProps = {
3
+ modelValue: Value;
4
+ };
5
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
6
+ "update:modelValue": (value: {
7
+ readonly icon?: string | undefined;
8
+ readonly color?: string | undefined;
9
+ readonly message: readonly [{
10
+ readonly locale: "zh";
11
+ readonly message: string;
12
+ }, ...{
13
+ readonly locale: "en" | "ja" | "ko";
14
+ readonly message: string;
15
+ }[]];
16
+ }) => any;
17
+ }, string, import("vue").PublicProps, Readonly<__VLS_ModelProps> & Readonly<{
18
+ "onUpdate:modelValue"?: ((value: {
19
+ readonly icon?: string | undefined;
20
+ readonly color?: string | undefined;
21
+ readonly message: readonly [{
22
+ readonly locale: "zh";
23
+ readonly message: string;
24
+ }, ...{
25
+ readonly locale: "en" | "ja" | "ko";
26
+ readonly message: string;
27
+ }[]];
28
+ }) => any) | undefined;
29
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
30
+ declare const _default: typeof __VLS_export;
31
+ export default _default;
@@ -0,0 +1,89 @@
1
+ <script setup>
2
+ import { ColorPicker } from "../../../ui/color-picker";
3
+ import { Field, FieldGroup, FieldLabel } from "../../../ui/field";
4
+ import { IconPicker } from "../../../ui/icon-picker";
5
+ import { Locale as LocaleField } from "../../../ui/locale";
6
+ import { Markdown } from "../../../ui/markdown";
7
+ import { getStructFieldDescription, getStructFieldTitle } from "../../../../share/schema-meta";
8
+ import { schema } from "./schema";
9
+ defineOptions({ name: "ShwfedAlertOperationConfig" });
10
+ const value = defineModel({ type: null, ...{ required: true } });
11
+ const opSchema = schema(() => {
12
+ });
13
+ const fieldTitle = (f) => getStructFieldTitle(opSchema, f) ?? f;
14
+ const fieldDescription = (f) => getStructFieldDescription(opSchema, f);
15
+ function patch(patchValue) {
16
+ const next = { ...value.value, ...patchValue };
17
+ for (const [k, v] of Object.entries(patchValue)) {
18
+ if (v === void 0) Reflect.deleteProperty(next, k);
19
+ }
20
+ value.value = next;
21
+ }
22
+ </script>
23
+
24
+ <template>
25
+ <FieldGroup>
26
+ <Field orientation="vertical">
27
+ <FieldLabel class="text-xs text-zinc-500">
28
+ <template
29
+ v-if="fieldDescription('message')"
30
+ #tooltip
31
+ >
32
+ <Markdown
33
+ :source="fieldDescription('message')"
34
+ block
35
+ class="prose prose-sm prose-zinc"
36
+ />
37
+ </template>
38
+ {{ fieldTitle("message") }}
39
+ </FieldLabel>
40
+ <LocaleField
41
+ markdown
42
+ :model-value="value.message"
43
+ @update:model-value="(v) => patch({ message: v })"
44
+ />
45
+ </Field>
46
+
47
+ <div class="grid grid-cols-2 gap-4">
48
+ <Field orientation="vertical">
49
+ <FieldLabel class="text-xs text-zinc-500">
50
+ <template
51
+ v-if="fieldDescription('icon')"
52
+ #tooltip
53
+ >
54
+ <Markdown
55
+ :source="fieldDescription('icon')"
56
+ block
57
+ class="prose prose-sm prose-zinc"
58
+ />
59
+ </template>
60
+ {{ fieldTitle("icon") }}
61
+ </FieldLabel>
62
+ <IconPicker
63
+ :model-value="value.icon ?? ''"
64
+ @update:model-value="(v) => patch(v.trim() === '' ? { icon: void 0 } : { icon: v })"
65
+ />
66
+ </Field>
67
+
68
+ <Field orientation="vertical">
69
+ <FieldLabel class="text-xs text-zinc-500">
70
+ <template
71
+ v-if="fieldDescription('color')"
72
+ #tooltip
73
+ >
74
+ <Markdown
75
+ :source="fieldDescription('color')"
76
+ block
77
+ class="prose prose-sm prose-zinc"
78
+ />
79
+ </template>
80
+ {{ fieldTitle("color") }}
81
+ </FieldLabel>
82
+ <ColorPicker
83
+ :model-value="value.color ?? ''"
84
+ @update:model-value="(v) => patch(v.trim() === '' ? { color: void 0 } : { color: v })"
85
+ />
86
+ </Field>
87
+ </div>
88
+ </FieldGroup>
89
+ </template>
@@ -0,0 +1,31 @@
1
+ import { type Value } from './schema.js';
2
+ type __VLS_ModelProps = {
3
+ modelValue: Value;
4
+ };
5
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
6
+ "update:modelValue": (value: {
7
+ readonly icon?: string | undefined;
8
+ readonly color?: string | undefined;
9
+ readonly message: readonly [{
10
+ readonly locale: "zh";
11
+ readonly message: string;
12
+ }, ...{
13
+ readonly locale: "en" | "ja" | "ko";
14
+ readonly message: string;
15
+ }[]];
16
+ }) => any;
17
+ }, string, import("vue").PublicProps, Readonly<__VLS_ModelProps> & Readonly<{
18
+ "onUpdate:modelValue"?: ((value: {
19
+ readonly icon?: string | undefined;
20
+ readonly color?: string | undefined;
21
+ readonly message: readonly [{
22
+ readonly locale: "zh";
23
+ readonly message: string;
24
+ }, ...{
25
+ readonly locale: "en" | "ja" | "ko";
26
+ readonly message: string;
27
+ }[]];
28
+ }) => any) | undefined;
29
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
30
+ declare const _default: typeof __VLS_export;
31
+ export default _default;
@@ -0,0 +1,2 @@
1
+ import type { OperationHandler } from '../../utils/resolve.js';
2
+ export declare const handler: OperationHandler;
@@ -0,0 +1,14 @@
1
+ import { Effect } from "effect";
2
+ import { getLocalizedText } from "../../../../share/locale.js";
3
+ import { interpolateMarkdown } from "../../../../share/interpolate.js";
4
+ import { reject } from "../../../../composables/useOverlay.js";
5
+ class AlertCancelled {
6
+ _tag = "AlertCancelled";
7
+ }
8
+ export const handler = (params, ctx) => Effect.gen(function* () {
9
+ const { message, icon, color } = params ?? {};
10
+ const raw = getLocalizedText(message, ctx.locale()) ?? "";
11
+ const content = interpolateMarkdown(raw, ctx.cel);
12
+ const cancelled = yield* reject({ content, icon, color });
13
+ if (cancelled) return yield* Effect.die(new AlertCancelled());
14
+ });
@@ -0,0 +1,21 @@
1
+ import { Schema } from 'effect';
2
+ import type { Environment } from '../../../../vendor/cel-js/lib/index.js';
3
+ export declare const type: "com.shwfed.operation.alert";
4
+ export declare const compatibilityDate: "2026-06-09";
5
+ export declare const metadata: {
6
+ readonly name: "确认弹窗";
7
+ readonly icon: "fluent:chat-warning-20-regular";
8
+ };
9
+ export declare function schema(_configure: (env: Environment) => void): Schema.Struct<{
10
+ message: Schema.TupleType<readonly [Schema.Struct<{
11
+ locale: Schema.Literal<["zh"]>;
12
+ message: Schema.SchemaClass<string, string, never>;
13
+ }>], [Schema.Struct<{
14
+ locale: Schema.Literal<["ja", "en", "ko"]>;
15
+ message: Schema.SchemaClass<string, string, never>;
16
+ }>]>;
17
+ icon: Schema.optional<Schema.SchemaClass<string, string, never>>;
18
+ color: Schema.optional<Schema.SchemaClass<string, string, never>>;
19
+ }>;
20
+ export type Value = Schema.Schema.Type<ReturnType<typeof schema>>;
21
+ export declare function defaults(): Partial<Value>;
@@ -0,0 +1,36 @@
1
+ import { Schema } from "effect";
2
+ import { Locale } from "../../../../share/locale.js";
3
+ import { md } from "../../../../share/markdown.js";
4
+ export const type = "com.shwfed.operation.alert";
5
+ export const compatibilityDate = "2026-06-09";
6
+ export const metadata = {
7
+ name: "\u786E\u8BA4\u5F39\u7A97",
8
+ icon: "fluent:chat-warning-20-regular"
9
+ };
10
+ export function schema(_configure) {
11
+ return Schema.Struct({
12
+ message: Locale.annotations({
13
+ title: "\u786E\u8BA4\u4FE1\u606F",
14
+ description: "\u5F39\u7A97\u786E\u8BA4\u4FE1\u606F\uFF0C\u652F\u6301 `{{ expression }}` \u63D2\u503C"
15
+ }),
16
+ icon: Schema.optional(Schema.String.annotations({
17
+ title: "\u56FE\u6807",
18
+ description: "\u5F39\u7A97\u5185\u7684\u56FE\u6807"
19
+ })),
20
+ color: Schema.optional(Schema.String.annotations({
21
+ title: "\u56FE\u6807\u989C\u8272",
22
+ description: "\u5F39\u7A97\u5185\u56FE\u6807\u7684\u989C\u8272\uFF08\u4EFB\u610F CSS \u989C\u8272\u503C\uFF09"
23
+ }))
24
+ }).annotations({
25
+ title: "AlertOperation",
26
+ description: md`
27
+ 弹出确认弹窗。用户确认则继续执行后续操作;取消则中止本次触发链
28
+ (与表单「校验」未通过同样的中止语义)。
29
+ `
30
+ });
31
+ }
32
+ export function defaults() {
33
+ return {
34
+ message: [{ locale: "zh", message: "" }]
35
+ };
36
+ }
@@ -0,0 +1,48 @@
1
+ import type { Component } from 'vue';
2
+ import type { Effect, Schema } from 'effect';
3
+ import type { Environment } from '../../../vendor/cel-js/lib/index.js';
4
+ import type { CelEvaluator } from '../../../share/interpolate.js';
5
+ import type { OperationHandlers } from '../../../share/event-bus.js';
6
+ type AnySchema = Schema.Schema<any, any, never>;
7
+ type SchemaFactory = (configure: (env: Environment) => void) => AnySchema;
8
+ /** Context a host supplies when wiring operation handlers into its channel. */
9
+ export type OperationContext = Readonly<{
10
+ /** Evaluator for any CEL in an operation's params (host's bindings). */
11
+ cel: CelEvaluator;
12
+ /** Current UI locale, read live (handlers may run long after wiring). */
13
+ locale: () => string;
14
+ }>;
15
+ /**
16
+ * The generic behaviour of a parameterized operation. Infallible on the error
17
+ * channel like every `OperationHandlers` entry; a handler MAY halt the trigger
18
+ * chain via `Effect.die` (the guard shape — e.g. an alert whose user cancels).
19
+ */
20
+ export type OperationHandler = (params: unknown, ctx: OperationContext) => Effect.Effect<void>;
21
+ export type OperationMetadata = Readonly<{
22
+ name: string;
23
+ icon: string;
24
+ }>;
25
+ export type OperationEntry = Readonly<{
26
+ type: string;
27
+ compatibilityDate: string;
28
+ metadata: OperationMetadata;
29
+ schema: SchemaFactory;
30
+ defaults?: () => Record<string, unknown>;
31
+ config: Component;
32
+ handler: OperationHandler;
33
+ }>;
34
+ export declare const OPERATIONS: ReadonlyArray<OperationEntry>;
35
+ export declare function findOperation(type: string, compatibilityDate: string): OperationEntry | undefined;
36
+ /**
37
+ * Build the `OperationHandlers` for a host's `provideEventTarget`, one per
38
+ * parameterized operation the host declares it exposes. Each handler keys on
39
+ * the operation `type` (what the trigger stores as `operation`) and forwards
40
+ * the request's `params` to the registered `handler` with `ctx`. Unknown
41
+ * refs are skipped. Hosts merge the result with any bespoke param-less
42
+ * handlers (e.g. the page's `close`).
43
+ */
44
+ export declare function operationHandlers(exposed: ReadonlyArray<{
45
+ type: string;
46
+ compatibilityDate: string;
47
+ }>, ctx: OperationContext): OperationHandlers;
48
+ export {};
@@ -0,0 +1,76 @@
1
+ import { defineAsyncComponent } from "vue";
2
+ const schemaModules = import.meta.glob(
3
+ "../*/*/schema.{ts,js}",
4
+ { eager: true, exhaustive: true }
5
+ );
6
+ const runtimeModules = import.meta.glob(
7
+ "../*/*/runtime.{ts,js}",
8
+ { eager: true, exhaustive: true }
9
+ );
10
+ const configModuleLoaders = import.meta.glob(
11
+ "../*/*/config.vue",
12
+ { exhaustive: true }
13
+ );
14
+ const configModules = Object.fromEntries(
15
+ Object.entries(configModuleLoaders).map(([path, loader]) => [
16
+ path,
17
+ defineAsyncComponent(loader)
18
+ ])
19
+ );
20
+ const PATH_RE = /\/([^/]+)\/([^/]+)\/schema\.(?:ts|js)$/;
21
+ function findSibling(map, date, type, file) {
22
+ const candidates = file.endsWith(".ts") ? [file, `${file.slice(0, -3)}.js`] : [file];
23
+ for (const candidate of candidates) {
24
+ const suffix = `/${date}/${type}/${candidate}`;
25
+ for (const [key, value] of Object.entries(map)) {
26
+ if (key.endsWith(suffix)) return value;
27
+ }
28
+ }
29
+ throw new Error(`[shwfed-operations] missing ${file} for ${type}@${date}`);
30
+ }
31
+ let cached = null;
32
+ function compute() {
33
+ if (cached) return cached;
34
+ const entries = [];
35
+ for (const [path, mod] of Object.entries(schemaModules)) {
36
+ const match = PATH_RE.exec(path);
37
+ if (!match) throw new Error(`[shwfed-operations] unrecognized schema path: ${path}`);
38
+ const date = match[1];
39
+ const type = match[2];
40
+ if (mod.type !== type) {
41
+ throw new Error(`[shwfed-operations] type "${mod.type}" does not match folder "${type}"`);
42
+ }
43
+ if (mod.compatibilityDate !== date) {
44
+ throw new Error(`[shwfed-operations] compatibilityDate "${mod.compatibilityDate}" does not match folder "${date}"`);
45
+ }
46
+ const runtime = findSibling(runtimeModules, date, type, "runtime.ts");
47
+ entries.push({
48
+ type: mod.type,
49
+ compatibilityDate: mod.compatibilityDate,
50
+ metadata: mod.metadata,
51
+ schema: mod.schema,
52
+ defaults: mod.defaults,
53
+ config: findSibling(configModules, date, type, "config.vue"),
54
+ handler: runtime.handler
55
+ });
56
+ }
57
+ cached = entries;
58
+ return cached;
59
+ }
60
+ export const OPERATIONS = new Proxy([], {
61
+ get(_t, prop, recv) {
62
+ return Reflect.get(compute(), prop, recv);
63
+ }
64
+ });
65
+ export function findOperation(type, compatibilityDate) {
66
+ return compute().find((o) => o.type === type && o.compatibilityDate === compatibilityDate);
67
+ }
68
+ export function operationHandlers(exposed, ctx) {
69
+ const handlers = {};
70
+ for (const { type, compatibilityDate } of exposed) {
71
+ const entry = findOperation(type, compatibilityDate);
72
+ if (!entry) continue;
73
+ handlers[type] = (params) => entry.handler(params, ctx);
74
+ }
75
+ return handlers;
76
+ }
@@ -18,6 +18,8 @@ export declare function schema(configure: (env: Environment) => void): Schema.St
18
18
  triggers: Schema.optional<Schema.Array$<Schema.Struct<{
19
19
  target: Schema.refine<string, typeof Schema.String>;
20
20
  operation: Schema.SchemaClass<string, string, never>;
21
+ compatibilityDate: Schema.optional<Schema.SchemaClass<string, string, never>>;
22
+ params: Schema.optional<Schema.SchemaClass<unknown, unknown, never>>;
21
23
  }>>>;
22
24
  title: Schema.TupleType<readonly [Schema.Struct<{
23
25
  locale: Schema.Literal<["zh"]>;
@@ -18,6 +18,8 @@ export declare function schema(configure: (env: Environment) => void): Schema.St
18
18
  triggers: Schema.optional<Schema.Array$<Schema.Struct<{
19
19
  target: Schema.refine<string, typeof Schema.String>;
20
20
  operation: Schema.SchemaClass<string, string, never>;
21
+ compatibilityDate: Schema.optional<Schema.SchemaClass<string, string, never>>;
22
+ params: Schema.optional<Schema.SchemaClass<unknown, unknown, never>>;
21
23
  }>>>;
22
24
  title: Schema.TupleType<readonly [Schema.Struct<{
23
25
  locale: Schema.Literal<["zh"]>;
@@ -26,6 +26,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
26
26
  }[]] | undefined;
27
27
  readonly compatibilityDate: "2026-05-24";
28
28
  readonly triggers?: readonly {
29
+ readonly params?: unknown;
30
+ readonly compatibilityDate?: string | undefined;
29
31
  readonly target: string;
30
32
  readonly operation: string;
31
33
  }[] | undefined;
@@ -78,6 +80,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
78
80
  }[]] | undefined;
79
81
  readonly compatibilityDate: "2026-05-24";
80
82
  readonly triggers?: readonly {
83
+ readonly params?: unknown;
84
+ readonly compatibilityDate?: string | undefined;
81
85
  readonly target: string;
82
86
  readonly operation: string;
83
87
  }[] | undefined;
@@ -26,6 +26,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
26
26
  }[]] | undefined;
27
27
  readonly compatibilityDate: "2026-05-24";
28
28
  readonly triggers?: readonly {
29
+ readonly params?: unknown;
30
+ readonly compatibilityDate?: string | undefined;
29
31
  readonly target: string;
30
32
  readonly operation: string;
31
33
  }[] | undefined;
@@ -78,6 +80,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
78
80
  }[]] | undefined;
79
81
  readonly compatibilityDate: "2026-05-24";
80
82
  readonly triggers?: readonly {
83
+ readonly params?: unknown;
84
+ readonly compatibilityDate?: string | undefined;
81
85
  readonly target: string;
82
86
  readonly operation: string;
83
87
  }[] | undefined;
@@ -57,6 +57,8 @@ export declare function schema(configure: (env: Environment) => void): Schema.St
57
57
  triggers: Schema.optional<Schema.Array$<Schema.Struct<{
58
58
  target: Schema.refine<string, typeof Schema.String>;
59
59
  operation: Schema.SchemaClass<string, string, never>;
60
+ compatibilityDate: Schema.optional<Schema.SchemaClass<string, string, never>>;
61
+ params: Schema.optional<Schema.SchemaClass<unknown, unknown, never>>;
60
62
  }>>>;
61
63
  title: Schema.TupleType<readonly [Schema.Struct<{
62
64
  locale: Schema.Literal<["zh"]>;