@shwfed/config 2.10.4 → 2.10.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (162) hide show
  1. package/dist/mcp.mjs +1574 -1315
  2. package/dist/module.json +1 -1
  3. package/dist/preview/assets/{FieldGroup.vue_vue_type_script_setup_true_lang-DIjsktfi.js → FieldGroup.vue_vue_type_script_setup_true_lang-D-COryaS.js} +1 -1
  4. package/dist/preview/assets/{badge-Cr6_n00S.js → badge-Sb01O_E2.js} +1 -1
  5. package/dist/preview/assets/{config-B2rtOFE1.js → config-99L3dMcP.js} +1 -1
  6. package/dist/preview/assets/{config-DF4u2WzQ.js → config-BgJWNJ-L.js} +1 -1
  7. package/dist/preview/assets/{config-CwbWyadd.js → config-BjSI3yTw.js} +1 -1
  8. package/dist/preview/assets/{config-Bu-ffrDi.js → config-BzMW9qCl.js} +1 -1
  9. package/dist/preview/assets/{config-BjUIO7Ps.js → config-CEM0BCax.js} +1 -1
  10. package/dist/preview/assets/{config-CSauYxAG.js → config-CtKXZjQl.js} +1 -1
  11. package/dist/preview/assets/{config-CNY70agP.js → config-CyRpAiSg.js} +1 -1
  12. package/dist/preview/assets/{config-CrA5lAMB.js → config-Cz3VQcLY.js} +1 -1
  13. package/dist/preview/assets/{config-hXHOfKvD.js → config-D6BiWm3q.js} +1 -1
  14. package/dist/preview/assets/{config-DpcMlGoM.js → config-DA1Knc1V.js} +1 -1
  15. package/dist/preview/assets/{config-Dx9AeOjb.js → config-DGBuMIqU.js} +1 -1
  16. package/dist/preview/assets/{config-1VGYa1Zb.js → config-DK0wxXG_.js} +1 -1
  17. package/dist/preview/assets/{config-BemROLz0.js → config-Du8kzY9H.js} +1 -1
  18. package/dist/preview/assets/{config-DTDFg08z.js → config-n4AGAnL-.js} +1 -1
  19. package/dist/preview/assets/{definition.vue_vue_type_script_setup_true_lang-v2AaUd8i.js → definition.vue_vue_type_script_setup_true_lang-BtOF0dda.js} +1 -1
  20. package/dist/preview/assets/{index-BzWZj-hV.js → index-BOnw60vg.js} +1 -1
  21. package/dist/preview/assets/index-BZlqSG2R.js +763 -0
  22. package/dist/preview/assets/index-D3Az3yzR.css +1 -0
  23. package/dist/preview/assets/index-Rj5bF6fM.js +1 -0
  24. package/dist/preview/assets/{item-B_QcL62I.js → item-D7avZRKo.js} +1 -1
  25. package/dist/preview/assets/{runtime-BbiAwZZ9.js → runtime-BWlX7BAG.js} +1 -1
  26. package/dist/preview/assets/{runtime-DUMSbsqb.js → runtime-Bek88ifk.js} +1 -1
  27. package/dist/preview/assets/{runtime-hClBh8tp.js → runtime-C9kOkTYc.js} +1 -1
  28. package/dist/preview/assets/{runtime-BRg0jxiK.js → runtime-CSrgcLuC.js} +1 -1
  29. package/dist/preview/assets/{runtime-CKoLdM68.js → runtime-CWTz9Iy4.js} +1 -1
  30. package/dist/preview/assets/{runtime-Cfup01hl.js → runtime-D-HZWcV-.js} +1 -1
  31. package/dist/preview/assets/{runtime-D-MaRCSg.js → runtime-DMsPs0Pz.js} +1 -1
  32. package/dist/preview/assets/{runtime-Cu_C4Joj.js → runtime-DOqVHcvv.js} +1 -1
  33. package/dist/preview/assets/{runtime-CZ6uHCIE.js → runtime-Dhl0NpTL.js} +1 -1
  34. package/dist/preview/assets/{runtime-Cd79TXff.js → runtime-Dxb1-gUN.js} +1 -1
  35. package/dist/preview/assets/{schema-meta-BACRMkVo.js → schema-meta-DXS0vi6v.js} +1 -1
  36. package/dist/preview/index.html +2 -2
  37. package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.table/schema.d.ts +1 -0
  38. package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.table/schema.js +5 -1
  39. package/dist/runtime/components/config/blocks/2026-06-17/com.shwfed.block.tree.single/config.d.vue.ts +223 -0
  40. package/dist/runtime/components/config/blocks/2026-06-17/com.shwfed.block.tree.single/config.vue +496 -0
  41. package/dist/runtime/components/config/blocks/2026-06-17/com.shwfed.block.tree.single/config.vue.d.ts +223 -0
  42. package/dist/runtime/components/config/blocks/2026-06-17/com.shwfed.block.tree.single/node-actions.d.vue.ts +10 -0
  43. package/dist/runtime/components/config/blocks/2026-06-17/com.shwfed.block.tree.single/node-actions.vue +25 -0
  44. package/dist/runtime/components/config/blocks/2026-06-17/com.shwfed.block.tree.single/node-actions.vue.d.ts +10 -0
  45. package/dist/runtime/components/config/blocks/2026-06-17/com.shwfed.block.tree.single/runtime.d.vue.ts +228 -0
  46. package/dist/runtime/components/config/blocks/2026-06-17/com.shwfed.block.tree.single/runtime.vue +355 -0
  47. package/dist/runtime/components/config/blocks/2026-06-17/com.shwfed.block.tree.single/runtime.vue.d.ts +228 -0
  48. package/dist/runtime/components/config/blocks/2026-06-17/com.shwfed.block.tree.single/schema.d.ts +227 -0
  49. package/dist/runtime/components/config/blocks/2026-06-17/com.shwfed.block.tree.single/schema.js +130 -0
  50. package/dist/runtime/components/config/utils/resolve.d.ts +16 -0
  51. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.daterange/config.d.vue.ts +4 -4
  52. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.daterange/config.vue.d.ts +4 -4
  53. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.datetimerange/config.d.vue.ts +6 -6
  54. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.datetimerange/config.vue.d.ts +6 -6
  55. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.timerange/config.d.vue.ts +2 -2
  56. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.timerange/config.vue.d.ts +2 -2
  57. package/dist/runtime/components/form/fields/2026-05-23/com.shwfed.form.field.tree.multi/config.d.vue.ts +22 -22
  58. package/dist/runtime/components/form/fields/2026-05-23/com.shwfed.form.field.tree.multi/config.vue.d.ts +22 -22
  59. package/dist/runtime/components/form/fields/2026-05-23/com.shwfed.form.field.tree.multi/schema.js +2 -1
  60. package/dist/runtime/components/form/fields/2026-05-24/com.shwfed.form.field.monthrange/config.d.vue.ts +4 -4
  61. package/dist/runtime/components/form/fields/2026-05-24/com.shwfed.form.field.monthrange/config.vue.d.ts +4 -4
  62. package/dist/runtime/components/form/fields/2026-05-26/com.shwfed.form.field.tree.combobox.multi/config.d.vue.ts +22 -22
  63. package/dist/runtime/components/form/fields/2026-05-26/com.shwfed.form.field.tree.combobox.multi/config.vue.d.ts +22 -22
  64. package/dist/runtime/components/form/fields/2026-05-26/com.shwfed.form.field.tree.combobox.multi/schema.js +2 -1
  65. package/dist/runtime/components/form/fields/2026-05-26/com.shwfed.form.field.tree.combobox.single/config.d.vue.ts +22 -22
  66. package/dist/runtime/components/form/fields/2026-05-26/com.shwfed.form.field.tree.combobox.single/config.vue.d.ts +22 -22
  67. package/dist/runtime/components/form/fields/2026-05-26/com.shwfed.form.field.tree.combobox.single/schema.js +2 -1
  68. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.combobox.multi/config.d.vue.ts +22 -22
  69. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.combobox.multi/config.vue.d.ts +22 -22
  70. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.combobox.multi/schema.js +2 -1
  71. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.combobox.single/config.d.vue.ts +22 -22
  72. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.combobox.single/config.vue.d.ts +22 -22
  73. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.combobox.single/schema.js +2 -1
  74. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.multi/config.d.vue.ts +22 -22
  75. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.multi/config.vue.d.ts +22 -22
  76. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.multi/schema.js +2 -1
  77. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.single/config.d.vue.ts +22 -22
  78. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.single/config.vue.d.ts +22 -22
  79. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.single/schema.js +2 -1
  80. package/dist/runtime/components/table/columns/2026-04-14/com.shwfed.table.column.select/runtime.vue +3 -3
  81. package/dist/runtime/components/table/columns/2026-04-14/com.shwfed.table.column.text/runtime.vue +54 -2
  82. package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.combobox-single/config.d.vue.ts +2 -2
  83. package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.combobox-single/config.vue.d.ts +2 -2
  84. package/dist/runtime/components/table/columns/2026-05-24/com.shwfed.table.column.combobox-single.remote.options-remote/config.d.vue.ts +4 -4
  85. package/dist/runtime/components/table/columns/2026-05-24/com.shwfed.table.column.combobox-single.remote.options-remote/config.vue.d.ts +4 -4
  86. package/dist/runtime/components/table/columns/2026-05-24/com.shwfed.table.column.combobox-single.remote.options-static/config.d.vue.ts +4 -4
  87. package/dist/runtime/components/table/columns/2026-05-24/com.shwfed.table.column.combobox-single.remote.options-static/config.vue.d.ts +4 -4
  88. package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi/config.d.vue.ts +2 -2
  89. package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi/config.vue.d.ts +2 -2
  90. package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-remote/config.d.vue.ts +4 -4
  91. package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-remote/config.vue.d.ts +4 -4
  92. package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-static/config.d.vue.ts +4 -4
  93. package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-static/config.vue.d.ts +4 -4
  94. package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-multi/config.d.vue.ts +2 -2
  95. package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-multi/config.vue.d.ts +2 -2
  96. package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-multi.remote/config.d.vue.ts +4 -4
  97. package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-multi.remote/config.vue.d.ts +4 -4
  98. package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-single/config.d.vue.ts +2 -2
  99. package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-single/config.vue.d.ts +2 -2
  100. package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-single.remote/config.d.vue.ts +4 -4
  101. package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-single.remote/config.vue.d.ts +4 -4
  102. package/dist/runtime/components/table/columns/2026-05-27/com.shwfed.table.column.tree-combobox-multi/config.d.vue.ts +2 -2
  103. package/dist/runtime/components/table/columns/2026-05-27/com.shwfed.table.column.tree-combobox-multi/config.vue.d.ts +2 -2
  104. package/dist/runtime/components/table/columns/2026-05-27/com.shwfed.table.column.tree-combobox-multi/schema.js +2 -1
  105. package/dist/runtime/components/table/columns/2026-05-27/com.shwfed.table.column.tree-combobox-single/config.d.vue.ts +2 -2
  106. package/dist/runtime/components/table/columns/2026-05-27/com.shwfed.table.column.tree-combobox-single/config.vue.d.ts +2 -2
  107. package/dist/runtime/components/table/columns/2026-05-27/com.shwfed.table.column.tree-combobox-single/schema.js +2 -1
  108. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-multi/config.d.vue.ts +4 -4
  109. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-multi/config.vue.d.ts +4 -4
  110. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-single/config.d.vue.ts +4 -4
  111. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-single/config.vue.d.ts +4 -4
  112. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.tree-combobox-multi/config.d.vue.ts +2 -2
  113. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.tree-combobox-multi/config.vue.d.ts +2 -2
  114. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.tree-combobox-multi/schema.js +2 -1
  115. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.tree-combobox-single/config.d.vue.ts +2 -2
  116. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.tree-combobox-single/config.vue.d.ts +2 -2
  117. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.tree-combobox-single/schema.js +2 -1
  118. package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.combobox-multi/config.d.vue.ts +4 -4
  119. package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.combobox-multi/config.vue.d.ts +4 -4
  120. package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.combobox-single/config.d.vue.ts +4 -4
  121. package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.combobox-single/config.vue.d.ts +4 -4
  122. package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.tree-combobox-multi/config.d.vue.ts +2 -2
  123. package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.tree-combobox-multi/config.vue.d.ts +2 -2
  124. package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.tree-combobox-multi/schema.js +2 -1
  125. package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.tree-combobox-single/config.d.vue.ts +2 -2
  126. package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.tree-combobox-single/config.vue.d.ts +2 -2
  127. package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.tree-combobox-single/schema.js +2 -1
  128. package/dist/runtime/components/table/columns/2026-06-17/com.shwfed.table.column.date-input/config.d.vue.ts +10 -0
  129. package/dist/runtime/components/table/columns/2026-06-17/com.shwfed.table.column.date-input/config.vue +543 -0
  130. package/dist/runtime/components/table/columns/2026-06-17/com.shwfed.table.column.date-input/config.vue.d.ts +10 -0
  131. package/dist/runtime/components/table/columns/2026-06-17/com.shwfed.table.column.date-input/runtime.d.vue.ts +9 -0
  132. package/dist/runtime/components/table/columns/2026-06-17/com.shwfed.table.column.date-input/runtime.vue +110 -0
  133. package/dist/runtime/components/table/columns/2026-06-17/com.shwfed.table.column.date-input/runtime.vue.d.ts +9 -0
  134. package/dist/runtime/components/table/columns/2026-06-17/com.shwfed.table.column.date-input/schema.d.ts +76 -0
  135. package/dist/runtime/components/table/columns/2026-06-17/com.shwfed.table.column.date-input/schema.js +89 -0
  136. package/dist/runtime/components/ui/date-picker/DatePickerInput.d.vue.ts +1 -1
  137. package/dist/runtime/components/ui/date-picker/DatePickerInput.vue.d.ts +1 -1
  138. package/dist/runtime/components/ui/date-picker/DatePickerTimeInput.d.vue.ts +1 -1
  139. package/dist/runtime/components/ui/date-picker/DatePickerTimeInput.vue.d.ts +1 -1
  140. package/dist/runtime/components/ui/date-range-picker/DateRangePickerInput.d.vue.ts +1 -1
  141. package/dist/runtime/components/ui/date-range-picker/DateRangePickerInput.vue.d.ts +1 -1
  142. package/dist/runtime/components/ui/date-range-picker/DateRangePickerTimeInput.d.vue.ts +2 -2
  143. package/dist/runtime/components/ui/date-range-picker/DateRangePickerTimeInput.vue.d.ts +2 -2
  144. package/dist/runtime/components/ui/tree/Tree.d.vue.ts +13 -0
  145. package/dist/runtime/components/ui/tree/Tree.vue +8 -1
  146. package/dist/runtime/components/ui/tree/Tree.vue.d.ts +13 -0
  147. package/dist/runtime/components/ui/tree/TreeNode.d.vue.ts +2 -0
  148. package/dist/runtime/components/ui/tree/TreeNode.vue +5 -2
  149. package/dist/runtime/components/ui/tree/TreeNode.vue.d.ts +2 -0
  150. package/dist/runtime/share/slot-renderer.d.vue.ts +5 -0
  151. package/dist/runtime/share/slot-renderer.vue +43 -28
  152. package/dist/runtime/share/slot-renderer.vue.d.ts +5 -0
  153. package/dist/runtime/share/tree-node-var.d.ts +25 -0
  154. package/dist/runtime/share/tree-node-var.js +10 -0
  155. package/dist/runtime/vendor/cel-js/CLAUDE.md +1 -1
  156. package/dist/runtime/vendor/cel-js/PROMPT.md +6 -0
  157. package/dist/runtime/vendor/cel-js/lib/http-builtins.d.ts +0 -14
  158. package/dist/runtime/vendor/cel-js/lib/http-builtins.js +17 -0
  159. package/package.json +1 -1
  160. package/dist/preview/assets/index-BDbNnENM.js +0 -1
  161. package/dist/preview/assets/index-ButPJaOR.css +0 -1
  162. package/dist/preview/assets/index-E3_P6Fhz.js +0 -761
@@ -0,0 +1,355 @@
1
+ <script setup>
2
+ import { Icon } from "@iconify/vue";
3
+ import { Effect, Fiber, Option } from "effect";
4
+ import { Fetch } from "fx-fetch";
5
+ import { computed, ref, shallowRef, watch } from "vue";
6
+ import { useI18n } from "vue-i18n";
7
+ import { fetchJsonOption } from "../../../../../share/request";
8
+ import { provideEventTarget } from "../../../../../share/event-bus";
9
+ import { cel as _rawCel } from "../../../../../utils/cel";
10
+ import { celBindings, injectCELContext } from "../../../../../utils/cel-context";
11
+ import { publishSelection } from "../../../../../utils/selections-registry";
12
+ import { getLocalizedText } from "../../../../../share/locale";
13
+ import { InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput } from "../../../../ui/input-group";
14
+ import { Field, FieldLabel } from "../../../../ui/field";
15
+ import { Markdown } from "../../../../ui/markdown";
16
+ import { Skeleton } from "../../../../ui/skeleton";
17
+ import { Tree as UiTree } from "../../../../ui/tree";
18
+ import { interpolateMarkdown } from "../../../../table/utils/runtime";
19
+ import NodeActions from "./node-actions.vue";
20
+ defineOptions({ name: "ShwfedBlockTreeSingleRuntime" });
21
+ const block = defineModel("block", { type: null, ...{ required: true } });
22
+ defineProps({
23
+ configure: { type: Function, required: false }
24
+ });
25
+ const { locale, t } = useI18n({
26
+ inheritLocale: true,
27
+ messages: {
28
+ zh: {
29
+ "tree-single-search-label": "\u641C\u7D22",
30
+ "tree-single-search-clear": "\u6E05\u9664\u641C\u7D22",
31
+ "tree-single-load-error": "\u52A0\u8F7D\u5931\u8D25",
32
+ "tree-single-empty": "\u65E0\u53EF\u9009\u9879"
33
+ },
34
+ en: {
35
+ "tree-single-search-label": "Search",
36
+ "tree-single-search-clear": "Clear search",
37
+ "tree-single-load-error": "Failed to load",
38
+ "tree-single-empty": "No options"
39
+ },
40
+ ja: {
41
+ "tree-single-search-label": "\u691C\u7D22",
42
+ "tree-single-search-clear": "\u691C\u7D22\u3092\u30AF\u30EA\u30A2",
43
+ "tree-single-load-error": "\u8AAD\u307F\u8FBC\u307F\u306B\u5931\u6557\u3057\u307E\u3057\u305F",
44
+ "tree-single-empty": "\u9078\u629E\u80A2\u306A\u3057"
45
+ }
46
+ }
47
+ });
48
+ const inherited = injectCELContext();
49
+ const $cel = (expression, context) => _rawCel(expression, { ...celBindings(inherited), ...context });
50
+ const styleValue = computed(() => {
51
+ const expr = block.value.style;
52
+ if (!expr) return void 0;
53
+ try {
54
+ const r = Effect.runSync($cel(expr, {}));
55
+ if (r == null) return void 0;
56
+ if (typeof r === "string") return r;
57
+ if (typeof r === "object") return r;
58
+ return String(r);
59
+ } catch {
60
+ return void 0;
61
+ }
62
+ });
63
+ const model = ref(void 0);
64
+ const roots = ref([]);
65
+ const loading = ref(false);
66
+ const fetchError = ref(null);
67
+ async function fetchTree() {
68
+ const dataSource = block.value.dataSource;
69
+ if (!dataSource) {
70
+ roots.value = [];
71
+ return;
72
+ }
73
+ const effect = Effect.gen(function* () {
74
+ let jsonOpt = Option.none();
75
+ if (dataSource.request) {
76
+ jsonOpt = yield* fetchJsonOption(yield* $cel(dataSource.request, {}));
77
+ }
78
+ const dataRaw = yield* $cel(dataSource.data, { json: jsonOpt });
79
+ return Array.isArray(dataRaw) ? dataRaw : [];
80
+ });
81
+ const program = Effect.gen(function* () {
82
+ const showMaskFiber = yield* Effect.fork(
83
+ Effect.sync(() => {
84
+ loading.value = true;
85
+ }).pipe(Effect.delay("30 millis"))
86
+ );
87
+ return yield* Effect.ensuring(effect, Fiber.interrupt(showMaskFiber));
88
+ }).pipe(
89
+ Effect.ensuring(Effect.sync(() => {
90
+ loading.value = false;
91
+ }))
92
+ );
93
+ try {
94
+ const result = await Effect.runPromise(Effect.provide(program, Fetch.layer));
95
+ roots.value = result;
96
+ fetchError.value = null;
97
+ } catch (e) {
98
+ console.warn("[shwfed-block] tree dataSource fetch failed", e);
99
+ fetchError.value = e;
100
+ }
101
+ }
102
+ watch(
103
+ () => [block.value.dataSource?.request, block.value.dataSource?.data],
104
+ () => {
105
+ void fetchTree();
106
+ },
107
+ { immediate: true }
108
+ );
109
+ provideEventTarget(block.value.id, {
110
+ "refresh": () => Effect.promise(fetchTree),
111
+ "clear-selection": () => Effect.sync(() => {
112
+ model.value = void 0;
113
+ })
114
+ });
115
+ function nodeCtx(node) {
116
+ return { node };
117
+ }
118
+ function getKey(node) {
119
+ try {
120
+ const v = Effect.runSync($cel(block.value.nodeKey, nodeCtx(node)));
121
+ return String(v);
122
+ } catch (err) {
123
+ console.error(`[shwfed-block] failed to evaluate nodeKey for ${block.value.id}:`, err);
124
+ return "";
125
+ }
126
+ }
127
+ function getChildren(node) {
128
+ let raw;
129
+ try {
130
+ raw = Effect.runSync($cel(block.value.nodeChildren, nodeCtx(node)));
131
+ } catch (err) {
132
+ console.error(`[shwfed-block] failed to evaluate nodeChildren for ${block.value.id}:`, err);
133
+ return void 0;
134
+ }
135
+ if (raw == null) return void 0;
136
+ if (!Array.isArray(raw)) return void 0;
137
+ if (raw.length === 0) return void 0;
138
+ return raw;
139
+ }
140
+ function nodeSelectable(node, _depth) {
141
+ const expr = block.value.nodeSelectable;
142
+ if (!expr) return true;
143
+ try {
144
+ return Effect.runSync($cel(expr, nodeCtx(node)));
145
+ } catch (err) {
146
+ console.error(`[shwfed-block] failed to evaluate nodeSelectable for ${block.value.id}:`, err);
147
+ return false;
148
+ }
149
+ }
150
+ function safeInterpolate(tpl, node) {
151
+ try {
152
+ return interpolateMarkdown(tpl, $cel, { node });
153
+ } catch (err) {
154
+ console.error(`[shwfed-block] failed to interpolate node text for ${block.value.id}:`, err);
155
+ return tpl;
156
+ }
157
+ }
158
+ function nodeLabelText(node) {
159
+ const tpl = getLocalizedText(block.value.nodeLabel, locale.value) ?? "";
160
+ return tpl ? safeInterpolate(tpl, node) : "";
161
+ }
162
+ function nodeTooltipText(node) {
163
+ if (!block.value.nodeTooltip) return void 0;
164
+ const tpl = getLocalizedText(block.value.nodeTooltip, locale.value);
165
+ if (!tpl) return void 0;
166
+ return safeInterpolate(tpl, node);
167
+ }
168
+ const initialExpanded = computed(() => {
169
+ if (!block.value.expandAll) return [];
170
+ const out = [];
171
+ const stack = [...roots.value];
172
+ while (stack.length) {
173
+ const n = stack.pop();
174
+ const kids = getChildren(n);
175
+ if (kids && kids.length) {
176
+ out.push(getKey(n));
177
+ stack.push(...kids);
178
+ }
179
+ }
180
+ return out;
181
+ });
182
+ const filterQuery = ref("");
183
+ function evalKeywords(node) {
184
+ const expr = block.value.filter?.keywords;
185
+ if (!expr) return [];
186
+ try {
187
+ const raw = Effect.runSync($cel(expr, nodeCtx(node)));
188
+ if (!Array.isArray(raw)) return [];
189
+ return raw.map((v) => String(v));
190
+ } catch {
191
+ return [];
192
+ }
193
+ }
194
+ const searchCorpus = shallowRef(/* @__PURE__ */ new Map());
195
+ watch(
196
+ () => [
197
+ roots.value,
198
+ locale.value,
199
+ block.value.nodeLabel,
200
+ block.value.filter?.keywords
201
+ ],
202
+ () => {
203
+ const map = /* @__PURE__ */ new Map();
204
+ const stack = [...roots.value];
205
+ while (stack.length) {
206
+ const n = stack.pop();
207
+ const label = nodeLabelText(n).trim().toLowerCase();
208
+ const kw = evalKeywords(n).map((k) => k.trim().toLowerCase()).join("\n");
209
+ map.set(getKey(n), kw ? `${label}
210
+ ${kw}` : label);
211
+ const kids = getChildren(n);
212
+ if (kids && kids.length) stack.push(...kids);
213
+ }
214
+ searchCorpus.value = map;
215
+ },
216
+ { immediate: true }
217
+ );
218
+ function filterPredicate(node, query) {
219
+ const q = query.trim().toLowerCase();
220
+ if (!q) return true;
221
+ const hay = searchCorpus.value.get(getKey(node));
222
+ if (hay !== void 0) return hay.includes(q);
223
+ return nodeLabelText(node).trim().toLowerCase().includes(q);
224
+ }
225
+ const filterLabelText = computed(() => {
226
+ const localized = block.value.filter?.label ? getLocalizedText(block.value.filter.label, locale.value) : void 0;
227
+ return localized && localized.length > 0 ? localized : t("tree-single-search-label");
228
+ });
229
+ const selectedNode = computed(() => {
230
+ const selected = model.value;
231
+ if (selected == null) return void 0;
232
+ const stack = [...roots.value];
233
+ while (stack.length) {
234
+ const n = stack.pop();
235
+ if (getKey(n) === selected) return n;
236
+ const kids = getChildren(n);
237
+ if (kids && kids.length) stack.push(...kids);
238
+ }
239
+ return void 0;
240
+ });
241
+ publishSelection(
242
+ block.value.id,
243
+ () => selectedNode.value,
244
+ { identity: (node) => getKey(node), raw: (node) => node }
245
+ );
246
+ const hasNodeActions = computed(() => block.value.nodeActions.items.length > 0);
247
+ </script>
248
+
249
+ <template>
250
+ <div
251
+ data-slot="block-tree-single"
252
+ class="flex h-full flex-col gap-2"
253
+ :style="styleValue"
254
+ >
255
+ <Field
256
+ v-if="block.filter?.enabled"
257
+ orientation="floating"
258
+ >
259
+ <FieldLabel>{{ filterLabelText }}</FieldLabel>
260
+ <InputGroup>
261
+ <InputGroupAddon align="inline-start">
262
+ <Icon icon="lucide:search" />
263
+ </InputGroupAddon>
264
+ <InputGroupInput v-model="filterQuery" />
265
+ <InputGroupAddon
266
+ v-if="filterQuery.length > 0"
267
+ align="inline-end"
268
+ >
269
+ <InputGroupButton
270
+ size="icon-xs"
271
+ :aria-label="t('tree-single-search-clear')"
272
+ @click="filterQuery = ''"
273
+ >
274
+ <Icon icon="lucide:x" />
275
+ </InputGroupButton>
276
+ </InputGroupAddon>
277
+ </InputGroup>
278
+ </Field>
279
+
280
+ <div
281
+ v-if="fetchError && roots.length === 0"
282
+ class="py-1.5 text-sm text-red-500"
283
+ >
284
+ {{ t("tree-single-load-error") }}
285
+ </div>
286
+ <div
287
+ v-else-if="loading && roots.length === 0"
288
+ class="flex flex-col gap-1.5 py-1"
289
+ aria-busy="true"
290
+ >
291
+ <Skeleton class="h-6 w-2/3" />
292
+ <Skeleton class="h-6 w-1/2" />
293
+ <Skeleton class="h-6 w-3/5" />
294
+ <Skeleton class="h-6 w-2/5" />
295
+ </div>
296
+
297
+ <UiTree
298
+ v-else
299
+ v-model="model"
300
+ :roots="roots"
301
+ :get-key="getKey"
302
+ :get-children="getChildren"
303
+ selection-mode="single"
304
+ select-cursor="default"
305
+ single-toggle
306
+ :selectable="nodeSelectable"
307
+ :filter-predicate="filterPredicate"
308
+ :filter-query="filterQuery"
309
+ :initial-expanded="initialExpanded"
310
+ class="min-h-0 flex-1 overflow-auto"
311
+ >
312
+ <template #node="{ node }">
313
+ <!-- Selection is conveyed solely by the row highlight (UiTree paints
314
+ the selected row's background) — no explicit radio glyph. -->
315
+ <span class="flex flex-col gap-0.5">
316
+ <Markdown
317
+ :source="nodeLabelText(node)"
318
+ class="prose prose-sm prose-zinc text-zinc-700"
319
+ />
320
+ <Markdown
321
+ v-if="nodeTooltipText(node)"
322
+ :source="nodeTooltipText(node)"
323
+ block
324
+ class="prose prose-xs prose-zinc text-zinc-400"
325
+ />
326
+ </span>
327
+ </template>
328
+
329
+ <template
330
+ v-if="hasNodeActions"
331
+ #actions="{ node }"
332
+ >
333
+ <!-- Hover/focus-revealed: hidden by default, fades in when the row
334
+ (which carries `group`) is hovered or an action button is focused.
335
+ `pointer-events-none` while hidden so the invisible buttons don't
336
+ swallow row clicks. -->
337
+ <span
338
+ class="opacity-0 transition-opacity duration-150 group-hover:opacity-100 group-hover:pointer-events-auto focus-within:opacity-100 focus-within:pointer-events-auto pointer-events-none"
339
+ >
340
+ <NodeActions
341
+ :node="node"
342
+ :config="block.nodeActions"
343
+ :configure="configure"
344
+ />
345
+ </span>
346
+ </template>
347
+
348
+ <template #empty>
349
+ <div class="py-1.5 text-sm text-zinc-400">
350
+ {{ t("tree-single-empty") }}
351
+ </div>
352
+ </template>
353
+ </UiTree>
354
+ </div>
355
+ </template>
@@ -0,0 +1,228 @@
1
+ import type { Environment } from '../../../../../vendor/cel-js/lib/index.js';
2
+ import type { Value } from './schema.js';
3
+ type __VLS_Props = {
4
+ configure?: (env: Environment) => void;
5
+ };
6
+ type __VLS_ModelProps = {
7
+ 'block': Value;
8
+ };
9
+ type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
10
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
11
+ "update:block": (value: {
12
+ readonly filter?: {
13
+ readonly label?: readonly [{
14
+ readonly locale: "zh";
15
+ readonly message: string;
16
+ }, ...{
17
+ readonly locale: "en" | "ja" | "ko";
18
+ readonly message: string;
19
+ }[]] | undefined;
20
+ readonly enabled: boolean;
21
+ readonly keywords?: string | undefined;
22
+ } | undefined;
23
+ readonly type: "com.shwfed.block.tree.single";
24
+ readonly style?: string | undefined;
25
+ readonly id: string;
26
+ readonly compatibilityDate: "2026-06-17";
27
+ readonly dataSource: {
28
+ readonly data: string;
29
+ readonly request?: string | undefined;
30
+ };
31
+ readonly nodeKey: string;
32
+ readonly nodeChildren: string;
33
+ readonly nodeLabel: readonly [{
34
+ readonly locale: "zh";
35
+ readonly message: string;
36
+ }, ...{
37
+ readonly locale: "en" | "ja" | "ko";
38
+ readonly message: string;
39
+ }[]];
40
+ readonly nodeTooltip?: readonly [{
41
+ readonly locale: "zh";
42
+ readonly message: string;
43
+ }, ...{
44
+ readonly locale: "en" | "ja" | "ko";
45
+ readonly message: string;
46
+ }[]] | undefined;
47
+ readonly nodeSelectable?: string | undefined;
48
+ readonly expandAll: boolean;
49
+ readonly nodeActions: {
50
+ readonly size: "default" | "sm" | "xs";
51
+ readonly style?: string | undefined;
52
+ readonly gap: number;
53
+ readonly kind: "shwfed.component.action";
54
+ readonly items: readonly (import("../../../../actions/schema.js").RegistryItemValue | {
55
+ readonly disabled?: string | undefined;
56
+ readonly id: string;
57
+ readonly title: readonly [{
58
+ readonly locale: "zh";
59
+ readonly message: string;
60
+ }, ...{
61
+ readonly locale: "en" | "ja" | "ko";
62
+ readonly message: string;
63
+ }[]];
64
+ readonly icon?: string | undefined;
65
+ readonly hidden?: string | undefined;
66
+ readonly tooltip?: readonly [{
67
+ readonly locale: "zh";
68
+ readonly message: string;
69
+ }, ...{
70
+ readonly locale: "en" | "ja" | "ko";
71
+ readonly message: string;
72
+ }[]] | undefined;
73
+ readonly variant?: "default" | "link" | "destructive" | "primary" | "ghost" | undefined;
74
+ readonly action?: any;
75
+ readonly groupId: string;
76
+ readonly hideTitle?: boolean | undefined;
77
+ } | {
78
+ readonly id: string;
79
+ readonly title: readonly [{
80
+ readonly locale: "zh";
81
+ readonly message: string;
82
+ }, ...{
83
+ readonly locale: "en" | "ja" | "ko";
84
+ readonly message: string;
85
+ }[]];
86
+ readonly icon?: string | undefined;
87
+ readonly items: readonly (import("../../../../actions/schema.js").RegistrySubItemValue | {
88
+ readonly disabled?: string | undefined;
89
+ readonly id: string;
90
+ readonly title: readonly [{
91
+ readonly locale: "zh";
92
+ readonly message: string;
93
+ }, ...{
94
+ readonly locale: "en" | "ja" | "ko";
95
+ readonly message: string;
96
+ }[]];
97
+ readonly icon?: string | undefined;
98
+ readonly hidden?: string | undefined;
99
+ readonly tooltip?: readonly [{
100
+ readonly locale: "zh";
101
+ readonly message: string;
102
+ }, ...{
103
+ readonly locale: "en" | "ja" | "ko";
104
+ readonly message: string;
105
+ }[]] | undefined;
106
+ readonly variant?: "default" | "link" | "destructive" | "primary" | "ghost" | undefined;
107
+ readonly action?: any;
108
+ })[];
109
+ readonly groupId: string;
110
+ readonly hideTitle?: boolean | undefined;
111
+ })[];
112
+ readonly groups: readonly {
113
+ readonly id: string;
114
+ readonly variant?: "default" | "link" | "destructive" | "primary" | "ghost" | undefined;
115
+ }[];
116
+ };
117
+ }) => any;
118
+ }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
119
+ "onUpdate:block"?: ((value: {
120
+ readonly filter?: {
121
+ readonly label?: readonly [{
122
+ readonly locale: "zh";
123
+ readonly message: string;
124
+ }, ...{
125
+ readonly locale: "en" | "ja" | "ko";
126
+ readonly message: string;
127
+ }[]] | undefined;
128
+ readonly enabled: boolean;
129
+ readonly keywords?: string | undefined;
130
+ } | undefined;
131
+ readonly type: "com.shwfed.block.tree.single";
132
+ readonly style?: string | undefined;
133
+ readonly id: string;
134
+ readonly compatibilityDate: "2026-06-17";
135
+ readonly dataSource: {
136
+ readonly data: string;
137
+ readonly request?: string | undefined;
138
+ };
139
+ readonly nodeKey: string;
140
+ readonly nodeChildren: string;
141
+ readonly nodeLabel: readonly [{
142
+ readonly locale: "zh";
143
+ readonly message: string;
144
+ }, ...{
145
+ readonly locale: "en" | "ja" | "ko";
146
+ readonly message: string;
147
+ }[]];
148
+ readonly nodeTooltip?: readonly [{
149
+ readonly locale: "zh";
150
+ readonly message: string;
151
+ }, ...{
152
+ readonly locale: "en" | "ja" | "ko";
153
+ readonly message: string;
154
+ }[]] | undefined;
155
+ readonly nodeSelectable?: string | undefined;
156
+ readonly expandAll: boolean;
157
+ readonly nodeActions: {
158
+ readonly size: "default" | "sm" | "xs";
159
+ readonly style?: string | undefined;
160
+ readonly gap: number;
161
+ readonly kind: "shwfed.component.action";
162
+ readonly items: readonly (import("../../../../actions/schema.js").RegistryItemValue | {
163
+ readonly disabled?: string | undefined;
164
+ readonly id: string;
165
+ readonly title: readonly [{
166
+ readonly locale: "zh";
167
+ readonly message: string;
168
+ }, ...{
169
+ readonly locale: "en" | "ja" | "ko";
170
+ readonly message: string;
171
+ }[]];
172
+ readonly icon?: string | undefined;
173
+ readonly hidden?: string | undefined;
174
+ readonly tooltip?: readonly [{
175
+ readonly locale: "zh";
176
+ readonly message: string;
177
+ }, ...{
178
+ readonly locale: "en" | "ja" | "ko";
179
+ readonly message: string;
180
+ }[]] | undefined;
181
+ readonly variant?: "default" | "link" | "destructive" | "primary" | "ghost" | undefined;
182
+ readonly action?: any;
183
+ readonly groupId: string;
184
+ readonly hideTitle?: boolean | undefined;
185
+ } | {
186
+ readonly id: string;
187
+ readonly title: readonly [{
188
+ readonly locale: "zh";
189
+ readonly message: string;
190
+ }, ...{
191
+ readonly locale: "en" | "ja" | "ko";
192
+ readonly message: string;
193
+ }[]];
194
+ readonly icon?: string | undefined;
195
+ readonly items: readonly (import("../../../../actions/schema.js").RegistrySubItemValue | {
196
+ readonly disabled?: string | undefined;
197
+ readonly id: string;
198
+ readonly title: readonly [{
199
+ readonly locale: "zh";
200
+ readonly message: string;
201
+ }, ...{
202
+ readonly locale: "en" | "ja" | "ko";
203
+ readonly message: string;
204
+ }[]];
205
+ readonly icon?: string | undefined;
206
+ readonly hidden?: string | undefined;
207
+ readonly tooltip?: readonly [{
208
+ readonly locale: "zh";
209
+ readonly message: string;
210
+ }, ...{
211
+ readonly locale: "en" | "ja" | "ko";
212
+ readonly message: string;
213
+ }[]] | undefined;
214
+ readonly variant?: "default" | "link" | "destructive" | "primary" | "ghost" | undefined;
215
+ readonly action?: any;
216
+ })[];
217
+ readonly groupId: string;
218
+ readonly hideTitle?: boolean | undefined;
219
+ })[];
220
+ readonly groups: readonly {
221
+ readonly id: string;
222
+ readonly variant?: "default" | "link" | "destructive" | "primary" | "ghost" | undefined;
223
+ }[];
224
+ };
225
+ }) => any) | undefined;
226
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
227
+ declare const _default: typeof __VLS_export;
228
+ export default _default;