@shwfed/config 2.3.28 → 2.4.0

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 (146) hide show
  1. package/dist/mcp.mjs +3128 -1272
  2. package/dist/module.json +1 -1
  3. package/dist/preview/assets/{config-CQHS6cZe.js → config-BcQQl4v6.js} +1 -1
  4. package/dist/preview/assets/{config-fvkC2rB8.js → config-BdFIFUa_.js} +1 -1
  5. package/dist/preview/assets/{config-DDfTl9Cs.js → config-Bi9F-Jdh.js} +1 -1
  6. package/dist/preview/assets/{config-CJHPt8Gx.js → config-Bxkq2ZRm.js} +1 -1
  7. package/dist/preview/assets/{config-D0_1yZdF.js → config-C32yfrlg.js} +1 -1
  8. package/dist/preview/assets/{config--PcXQV_r.js → config-CHHX7vhb.js} +1 -1
  9. package/dist/preview/assets/{config-5KVDXgUF.js → config-CZ0f5xdI.js} +1 -1
  10. package/dist/preview/assets/{config-B5avpKJE.js → config-D9xGgFnF.js} +1 -1
  11. package/dist/preview/assets/{config-CNo3isHa.js → config-Ddh8pxIi.js} +1 -1
  12. package/dist/preview/assets/{definition.vue_vue_type_script_setup_true_lang-RM-qDh0R.js → definition.vue_vue_type_script_setup_true_lang-C_cjxvm1.js} +1 -1
  13. package/dist/preview/assets/{index-a2QwAots.css → index-BqOX70Hd.css} +1 -1
  14. package/dist/preview/assets/index-D-VR1i8D.js +659 -0
  15. package/dist/preview/assets/index-ihZGlPdX.js +1 -0
  16. package/dist/preview/assets/{runtime-BPjZQmcY.js → runtime-Bn8mqeDH.js} +1 -1
  17. package/dist/preview/assets/{runtime-DcrzodsN.js → runtime-Cc_Wk3o-.js} +1 -1
  18. package/dist/preview/assets/{runtime-BGTWf-O7.js → runtime-CttAjIgg.js} +1 -1
  19. package/dist/preview/assets/{runtime-Dy4ZmQ-n.js → runtime-Cx4f2UTl.js} +1 -1
  20. package/dist/preview/assets/{runtime-CCbyrqQT.js → runtime-D1dESjXR.js} +1 -1
  21. package/dist/preview/assets/{runtime-C_XX6a0C.js → runtime-DIEP1Xbh.js} +1 -1
  22. package/dist/preview/assets/{runtime-CtqwtTE_.js → runtime-DKceWuBx.js} +1 -1
  23. package/dist/preview/assets/{runtime-Dr_10emf.js → runtime-Dhid9O5c.js} +1 -1
  24. package/dist/preview/assets/{runtime-Bq3fmxeF.js → runtime-YMiqi6WY.js} +1 -1
  25. package/dist/preview/index.html +2 -2
  26. package/dist/runtime/components/block-layout-editor/index.d.vue.ts +10 -2
  27. package/dist/runtime/components/block-layout-editor/index.vue +44 -8
  28. package/dist/runtime/components/block-layout-editor/index.vue.d.ts +10 -2
  29. package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.form/config.d.vue.ts +2 -0
  30. package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.form/config.vue.d.ts +2 -0
  31. package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.form/runtime.d.vue.ts +2 -0
  32. package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.form/runtime.vue.d.ts +2 -0
  33. package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.form/schema.d.ts +2 -0
  34. package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.table/config.d.vue.ts +2 -0
  35. package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.table/config.vue.d.ts +2 -0
  36. package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.table/runtime.d.vue.ts +2 -0
  37. package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.table/runtime.vue.d.ts +2 -0
  38. package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.table/schema.d.ts +3 -0
  39. package/dist/runtime/components/config/config.vue +35 -0
  40. package/dist/runtime/components/config/use-editor.d.ts +11 -1
  41. package/dist/runtime/components/config/use-editor.js +27 -1
  42. package/dist/runtime/components/form/config.vue +32 -0
  43. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.combobox.multi/config.d.vue.ts +163 -0
  44. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.combobox.multi/config.vue +745 -0
  45. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.combobox.multi/config.vue.d.ts +163 -0
  46. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.combobox.multi/runtime.d.vue.ts +8 -0
  47. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.combobox.multi/runtime.vue +383 -0
  48. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.combobox.multi/runtime.vue.d.ts +8 -0
  49. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.combobox.multi/schema.d.ts +264 -0
  50. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.combobox.multi/schema.js +183 -0
  51. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.combobox.single/config.d.vue.ts +163 -0
  52. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.combobox.single/config.vue +745 -0
  53. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.combobox.single/config.vue.d.ts +163 -0
  54. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.combobox.single/runtime.d.vue.ts +8 -0
  55. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.combobox.single/runtime.vue +402 -0
  56. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.combobox.single/runtime.vue.d.ts +8 -0
  57. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.combobox.single/schema.d.ts +264 -0
  58. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.combobox.single/schema.js +209 -0
  59. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.combobox.multi/config.d.vue.ts +129 -0
  60. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.combobox.multi/config.vue +618 -0
  61. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.combobox.multi/config.vue.d.ts +129 -0
  62. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.combobox.multi/runtime.d.vue.ts +8 -0
  63. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.combobox.multi/runtime.vue +501 -0
  64. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.combobox.multi/runtime.vue.d.ts +8 -0
  65. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.combobox.multi/schema.d.ts +99 -0
  66. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.combobox.multi/schema.js +133 -0
  67. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.combobox.single/config.d.vue.ts +127 -0
  68. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.combobox.single/config.vue +550 -0
  69. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.combobox.single/config.vue.d.ts +127 -0
  70. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.combobox.single/runtime.d.vue.ts +8 -0
  71. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.combobox.single/runtime.vue +496 -0
  72. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.combobox.single/runtime.vue.d.ts +8 -0
  73. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.combobox.single/schema.d.ts +96 -0
  74. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.combobox.single/schema.js +125 -0
  75. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.multi/config.d.vue.ts +133 -0
  76. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.multi/config.vue +605 -0
  77. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.multi/config.vue.d.ts +133 -0
  78. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.multi/runtime.d.vue.ts +8 -0
  79. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.multi/runtime.vue +401 -0
  80. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.multi/runtime.vue.d.ts +8 -0
  81. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.multi/schema.d.ts +102 -0
  82. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.multi/schema.js +142 -0
  83. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.single/config.d.vue.ts +131 -0
  84. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.single/config.vue +560 -0
  85. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.single/config.vue.d.ts +131 -0
  86. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.single/runtime.d.vue.ts +8 -0
  87. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.single/runtime.vue +395 -0
  88. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.single/runtime.vue.d.ts +8 -0
  89. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.single/schema.d.ts +96 -0
  90. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.single/schema.js +118 -0
  91. package/dist/runtime/components/form/fields/2026-05-28/tree-combobox-shared.d.ts +35 -0
  92. package/dist/runtime/components/form/fields/2026-05-28/tree-combobox-shared.js +31 -0
  93. package/dist/runtime/components/form/index.vue +7 -5
  94. package/dist/runtime/components/form/schema.d.ts +4 -0
  95. package/dist/runtime/components/form/schema.js +4 -0
  96. package/dist/runtime/components/form/unit-config.vue +45 -1
  97. package/dist/runtime/components/table/columns/2026-04-14/com.shwfed.table.column.select/config.vue +0 -22
  98. package/dist/runtime/components/table/columns/2026-04-14/com.shwfed.table.column.select/header.vue +3 -15
  99. package/dist/runtime/components/table/columns/2026-04-14/com.shwfed.table.column.select/schema.d.ts +0 -1
  100. package/dist/runtime/components/table/columns/2026-04-14/com.shwfed.table.column.select/schema.js +0 -4
  101. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-multi/config.d.vue.ts +183 -0
  102. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-multi/config.vue +931 -0
  103. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-multi/config.vue.d.ts +183 -0
  104. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-multi/runtime.d.vue.ts +9 -0
  105. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-multi/runtime.vue +463 -0
  106. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-multi/runtime.vue.d.ts +9 -0
  107. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-multi/schema.d.ts +283 -0
  108. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-multi/schema.js +275 -0
  109. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-single/config.d.vue.ts +183 -0
  110. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-single/config.vue +931 -0
  111. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-single/config.vue.d.ts +183 -0
  112. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-single/runtime.d.vue.ts +9 -0
  113. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-single/runtime.vue +414 -0
  114. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-single/runtime.vue.d.ts +9 -0
  115. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-single/schema.d.ts +283 -0
  116. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-single/schema.js +275 -0
  117. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.tree-combobox-multi/config.d.vue.ts +133 -0
  118. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.tree-combobox-multi/config.vue +632 -0
  119. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.tree-combobox-multi/config.vue.d.ts +133 -0
  120. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.tree-combobox-multi/runtime.d.vue.ts +9 -0
  121. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.tree-combobox-multi/runtime.vue +461 -0
  122. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.tree-combobox-multi/runtime.vue.d.ts +9 -0
  123. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.tree-combobox-multi/schema.d.ts +93 -0
  124. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.tree-combobox-multi/schema.js +161 -0
  125. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.tree-combobox-single/config.d.vue.ts +131 -0
  126. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.tree-combobox-single/config.vue +563 -0
  127. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.tree-combobox-single/config.vue.d.ts +131 -0
  128. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.tree-combobox-single/runtime.d.vue.ts +9 -0
  129. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.tree-combobox-single/runtime.vue +443 -0
  130. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.tree-combobox-single/runtime.vue.d.ts +9 -0
  131. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.tree-combobox-single/schema.d.ts +90 -0
  132. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.tree-combobox-single/schema.js +153 -0
  133. package/dist/runtime/components/table/columns/2026-05-28/tree-combobox-shared.d.ts +35 -0
  134. package/dist/runtime/components/table/columns/2026-05-28/tree-combobox-shared.js +31 -0
  135. package/dist/runtime/components/table/config.vue +55 -82
  136. package/dist/runtime/components/table/schema.d.ts +4 -0
  137. package/dist/runtime/components/ui/command/CommandItem.d.vue.ts +7 -0
  138. package/dist/runtime/components/ui/command/CommandItem.vue +13 -4
  139. package/dist/runtime/components/ui/command/CommandItem.vue.d.ts +7 -0
  140. package/dist/runtime/share/clipboard.d.ts +26 -0
  141. package/dist/runtime/share/clipboard.js +82 -0
  142. package/dist/runtime/share/layout.d.ts +4 -0
  143. package/dist/runtime/share/layout.js +35 -0
  144. package/package.json +1 -1
  145. package/dist/preview/assets/index-DNd8J9Zv.js +0 -643
  146. package/dist/preview/assets/index-DrIMqXAa.js +0 -1
@@ -0,0 +1 @@
1
+ import{aL as e}from"./index-D-VR1i8D.js";import{aM as r,aN as s,aO as t}from"./index-D-VR1i8D.js";export{r as TableConfig,s as createTableConfig,e as default,t as getColumnTechnicalKey};
@@ -1 +1 @@
1
- import{d as i,ao as f,aq as r,ar as d,e as m,u,ak as l,al as p,am as _,o as g}from"./index-DNd8J9Zv.js";import{_ as h}from"./definition.vue_vue_type_script_setup_true_lang-RM-qDh0R.js";const x=i({name:"ShwfedNavigationActionRuntime",__name:"runtime",props:{buttonId:{},config:{}},setup(e){const t=e,o=_(),c=(n,a)=>l(n,{...p(o),...a}),s=f(()=>r(c(t.config.url),n=>d(()=>{window.open(n,t.config.mode)})));return(n,a)=>(g(),m(h,{"action-id":e.buttonId,effect:u(s)},null,8,["action-id","effect"]))}});export{x as default};
1
+ import{d as i,ao as f,aq as r,ar as d,e as m,u,ak as l,al as p,am as _,o as g}from"./index-D-VR1i8D.js";import{_ as h}from"./definition.vue_vue_type_script_setup_true_lang-C_cjxvm1.js";const x=i({name:"ShwfedNavigationActionRuntime",__name:"runtime",props:{buttonId:{},config:{}},setup(e){const t=e,o=_(),c=(n,a)=>l(n,{...p(o),...a}),s=f(()=>r(c(t.config.url),n=>d(()=>{window.open(n,t.config.mode)})));return(n,a)=>(g(),m(h,{"action-id":e.buttonId,effect:u(s)},null,8,["action-id","effect"]))}});export{x as default};
@@ -1 +1 @@
1
- import{_ as o}from"./definition.vue_vue_type_script_setup_true_lang-RM-qDh0R.js";import{d as s,ao as c,aB as i,e as r,u as f,an as u,o as m}from"./index-DNd8J9Zv.js";const g=s({name:"ShwfedEventDispatchActionRuntime",__name:"runtime",props:{buttonId:{},config:{}},setup(e){const n=e,t=u(),a=c(()=>i(t,n.config.triggers));return(p,d)=>(m(),r(o,{"action-id":e.buttonId,effect:f(a)},null,8,["action-id","effect"]))}});export{g as default};
1
+ import{_ as o}from"./definition.vue_vue_type_script_setup_true_lang-C_cjxvm1.js";import{d as s,ao as c,aB as i,e as r,u as f,an as u,o as m}from"./index-D-VR1i8D.js";const g=s({name:"ShwfedEventDispatchActionRuntime",__name:"runtime",props:{buttonId:{},config:{}},setup(e){const n=e,t=u(),a=c(()=>i(t,n.config.triggers));return(p,d)=>(m(),r(o,{"action-id":e.buttonId,effect:f(a)},null,8,["action-id","effect"]))}});export{g as default};
@@ -1 +1 @@
1
- import{_ as o}from"./definition.vue_vue_type_script_setup_true_lang-RM-qDh0R.js";import{d as n,e as a,u as c,o as f,ap as i}from"./index-DNd8J9Zv.js";const p=n({name:"ShwfedPrototypeActionRuntime",__name:"runtime",props:{buttonId:{},config:{}},setup(e){const t=i;return(r,s)=>(f(),a(o,{"action-id":e.buttonId,effect:c(t)},null,8,["action-id","effect"]))}});export{p as default};
1
+ import{_ as o}from"./definition.vue_vue_type_script_setup_true_lang-C_cjxvm1.js";import{d as n,e as a,u as c,o as f,ap as i}from"./index-D-VR1i8D.js";const p=n({name:"ShwfedPrototypeActionRuntime",__name:"runtime",props:{buttonId:{},config:{}},setup(e){const t=i;return(r,s)=>(f(),a(o,{"action-id":e.buttonId,effect:c(t)},null,8,["action-id","effect"]))}});export{p as default};
@@ -1 +1 @@
1
- import{d as u,ae as l,e as i,u as p,$ as m,o as d,k as f,ag as _,ah as k,ak as g,al as w,am as x}from"./index-DNd8J9Zv.js";const B=u({name:"ShwfedMarkdownItemRuntime",__name:"runtime",props:{config:{}},setup(n){const s=n,{locale:o}=l(),t=x(),c=(e,a)=>g(e,{...w(t),...a}),r=m(()=>{const e=_(s.config.content,o.value)??"";return k(e,c)});return(e,a)=>(d(),i(p(f),{"data-slot":"buttons-markdown",source:r.value,class:"prose prose-sm prose-zinc px-1"},null,8,["source"]))}});export{B as default};
1
+ import{d as u,ae as l,e as i,u as p,$ as m,o as d,k as f,ag as _,ah as k,ak as g,al as w,am as x}from"./index-D-VR1i8D.js";const B=u({name:"ShwfedMarkdownItemRuntime",__name:"runtime",props:{config:{}},setup(n){const s=n,{locale:o}=l(),t=x(),c=(e,a)=>g(e,{...w(t),...a}),r=m(()=>{const e=_(s.config.content,o.value)??"";return k(e,c)});return(e,a)=>(d(),i(p(f),{"data-slot":"buttons-markdown",source:r.value,class:"prose prose-sm prose-zinc px-1"},null,8,["source"]))}});export{B as default};
@@ -1 +1 @@
1
- import{d as l,aE as g,ao as A,aq as y,aB as _,e as h,u as S,ak as b,al as k,an as j,aF as B,o as C,am as E}from"./index-DNd8J9Zv.js";import{_ as F}from"./definition.vue_vue_type_script_setup_true_lang-RM-qDh0R.js";const I=l({name:"ShwfedStateWriteActionRuntime",__name:"runtime",props:{buttonId:{},config:{}},setup(r){const s=r,i=E(),f=(e,t)=>b(e,{...k(i),...t}),n=g(),o=n.kind==="form"&&n.parent?n.parent:n,u=j(),m=B((e,t,a)=>{if(Array.isArray(e[t])&&Array.isArray(a))return e[t]=a,!0});function c(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function p(e,t){return c(e)&&c(t)?m({...t},e):t}const d=A(()=>y(f(s.config.expression),e=>{for(const t of Object.keys(e)){const a=p(o.getAt(t),e[t]);o.setAt(t,a)}return _(u,s.config.onSuccess)}));return(e,t)=>(C(),h(F,{"action-id":r.buttonId,effect:S(d)},null,8,["action-id","effect"]))}});export{I as default};
1
+ import{d as l,aE as g,ao as A,aq as y,aB as _,e as h,u as S,ak as b,al as k,an as j,aF as B,o as C,am as E}from"./index-D-VR1i8D.js";import{_ as F}from"./definition.vue_vue_type_script_setup_true_lang-C_cjxvm1.js";const I=l({name:"ShwfedStateWriteActionRuntime",__name:"runtime",props:{buttonId:{},config:{}},setup(r){const s=r,i=E(),f=(e,t)=>b(e,{...k(i),...t}),n=g(),o=n.kind==="form"&&n.parent?n.parent:n,u=j(),m=B((e,t,a)=>{if(Array.isArray(e[t])&&Array.isArray(a))return e[t]=a,!0});function c(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function p(e,t){return c(e)&&c(t)?m({...t},e):t}const d=A(()=>y(f(s.config.expression),e=>{for(const t of Object.keys(e)){const a=p(o.getAt(t),e[t]);o.setAt(t,a)}return _(u,s.config.onSuccess)}));return(e,t)=>(C(),h(F,{"action-id":r.buttonId,effect:S(d)},null,8,["action-id","effect"]))}});export{I as default};
@@ -1 +1 @@
1
- import{d as r,ao as f,aj as u,e as p,u as g,ak as m,al as l,am as d,an as x,o as E}from"./index-DNd8J9Zv.js";import{_}from"./definition.vue_vue_type_script_setup_true_lang-RM-qDh0R.js";const k=r({name:"ShwfedHttpRequestActionRuntime",__name:"runtime",props:{buttonId:{},config:{}},setup(n){const e=n,t=d(),c=(s,o)=>m(s,{...l(t),...o}),i=x(),a=f(()=>u(e.config.expression,c,{messageExpression:e.config.messageExpression,resultExpression:e.config.resultExpression,channel:i,triggers:{success:e.config.onSuccess,warning:e.config.onWarning,error:e.config.onError,info:e.config.onInfo}}));return(s,o)=>(E(),p(_,{"action-id":n.buttonId,effect:g(a)},null,8,["action-id","effect"]))}});export{k as default};
1
+ import{d as r,ao as f,aj as u,e as p,u as g,ak as m,al as l,am as d,an as x,o as E}from"./index-D-VR1i8D.js";import{_}from"./definition.vue_vue_type_script_setup_true_lang-C_cjxvm1.js";const k=r({name:"ShwfedHttpRequestActionRuntime",__name:"runtime",props:{buttonId:{},config:{}},setup(n){const e=n,t=d(),c=(s,o)=>m(s,{...l(t),...o}),i=x(),a=f(()=>u(e.config.expression,c,{messageExpression:e.config.messageExpression,resultExpression:e.config.resultExpression,channel:i,triggers:{success:e.config.onSuccess,warning:e.config.onWarning,error:e.config.onError,info:e.config.onInfo}}));return(s,o)=>(E(),p(_,{"action-id":n.buttonId,effect:g(a)},null,8,["action-id","effect"]))}});export{k as default};
@@ -1 +1 @@
1
- import{d as _,ao as B,af as E,ar as r,aB as m,aC as S,aD as j,e as k,u as v,ak as x,al as C,an as L,am as b,o as R}from"./index-DNd8J9Zv.js";import{_ as T}from"./definition.vue_vue_type_script_setup_true_lang-RM-qDh0R.js";const q=_({name:"ShwfedHttpDownloadActionRuntime",__name:"runtime",props:{buttonId:{},config:{}},setup(d){const c=d,g=b(),t=(e,n)=>x(e,{...C(g),...n}),l=L(),p=new Set(["success","error","warning","info"]);function f(e){const n=URL.createObjectURL(e),o=document.createElement("a");o.href=n,o.download=e.name,document.body.appendChild(o),o.click(),o.remove(),URL.revokeObjectURL(n)}const y=B(()=>E(function*(){const{template:e,messageExpression:n,resultExpression:o}=c.config,u=yield*t(e.request);if(!e.download){const s=yield*u.file();return yield*r(()=>f(s)),yield*m(l,c.config.onSuccess)}const a={json:yield*u.json()},i=o===void 0?"success":yield*S(t(o,a),s=>p.has(s)?s:"success");if(n!==void 0){const s=yield*t(n,a);yield*r(()=>j[i](s))}if(i==="success"||i==="info"){const h=yield*(yield*t(e.download,a)).file();yield*r(()=>f(h))}const w={success:c.config.onSuccess,warning:c.config.onWarning,error:c.config.onError,info:c.config.onInfo};return yield*m(l,w[i])}));return(e,n)=>(R(),k(T,{"action-id":d.buttonId,effect:v(y)},null,8,["action-id","effect"]))}});export{q as default};
1
+ import{d as _,ao as B,af as E,ar as r,aB as m,aC as S,aD as j,e as k,u as v,ak as x,al as C,an as L,am as b,o as R}from"./index-D-VR1i8D.js";import{_ as T}from"./definition.vue_vue_type_script_setup_true_lang-C_cjxvm1.js";const q=_({name:"ShwfedHttpDownloadActionRuntime",__name:"runtime",props:{buttonId:{},config:{}},setup(d){const c=d,g=b(),t=(e,n)=>x(e,{...C(g),...n}),l=L(),p=new Set(["success","error","warning","info"]);function f(e){const n=URL.createObjectURL(e),o=document.createElement("a");o.href=n,o.download=e.name,document.body.appendChild(o),o.click(),o.remove(),URL.revokeObjectURL(n)}const y=B(()=>E(function*(){const{template:e,messageExpression:n,resultExpression:o}=c.config,u=yield*t(e.request);if(!e.download){const s=yield*u.file();return yield*r(()=>f(s)),yield*m(l,c.config.onSuccess)}const a={json:yield*u.json()},i=o===void 0?"success":yield*S(t(o,a),s=>p.has(s)?s:"success");if(n!==void 0){const s=yield*t(n,a);yield*r(()=>j[i](s))}if(i==="success"||i==="info"){const h=yield*(yield*t(e.download,a)).file();yield*r(()=>f(h))}const w={success:c.config.onSuccess,warning:c.config.onWarning,error:c.config.onError,info:c.config.onInfo};return yield*m(l,w[i])}));return(e,n)=>(R(),k(T,{"action-id":d.buttonId,effect:v(y)},null,8,["action-id","effect"]))}});export{q as default};
@@ -1 +1 @@
1
- import{d as i,ae as x,as as p,af as M,ag as c,at as T,au as N,e as b,w as d,u,a0 as k,a1 as w,an as L,ar as S,o as A,f as I,av as z,g as r,aw as F,ax as H,a7 as V,am as $,ay as f,az as m,aA as j}from"./index-DNd8J9Zv.js";import{_ as K}from"./definition.vue_vue_type_script_setup_true_lang-RM-qDh0R.js";const O=i({name:"ShwfedModalLayoutActionRuntime",__name:"runtime",props:{buttonId:{},config:{},buttonTitle:{}},setup(a){const n=a,{locale:l}=x(),v=e=>{},g=$(),s=w(f,void 0),h=L(),o=k(null),C=p(n.buttonId,{close:()=>S(()=>{o.value?.()})},h),y=i({name:"ModalBoundaryBridge",setup(e,{slots:t}){return H(g),m(j,C),s&&m(f,s),()=>t.default?.()}}),E=(e,t)=>V()?.(e,t),_=M(function*(){const e=c(n.config.modalTitle,l.value)??c(n.buttonTitle,l.value)??"",{modal:t,close:B}=yield*T({title:e,width:n.config.modalWidth});o.value=()=>N(B()),yield*t,o.value=null});return(e,t)=>(A(),b(K,{"action-id":a.buttonId,effect:u(_)},{default:d(()=>[I("div",{style:z(a.config.modalMinHeight?`min-height: ${a.config.modalMinHeight}`:void 0)},[r(u(y),null,{default:d(()=>[r(F,{"slot-value":a.config.slot,configure:v,"find-entry":E},null,8,["slot-value"])]),_:1})],4)]),_:1},8,["action-id","effect"]))}});export{O as default};
1
+ import{d as i,ae as x,as as p,af as M,ag as c,at as T,au as N,e as b,w as d,u,a0 as k,a1 as w,an as L,ar as S,o as A,f as I,av as z,g as r,aw as F,ax as H,a7 as V,am as $,ay as f,az as m,aA as j}from"./index-D-VR1i8D.js";import{_ as K}from"./definition.vue_vue_type_script_setup_true_lang-C_cjxvm1.js";const O=i({name:"ShwfedModalLayoutActionRuntime",__name:"runtime",props:{buttonId:{},config:{},buttonTitle:{}},setup(a){const n=a,{locale:l}=x(),v=e=>{},g=$(),s=w(f,void 0),h=L(),o=k(null),C=p(n.buttonId,{close:()=>S(()=>{o.value?.()})},h),y=i({name:"ModalBoundaryBridge",setup(e,{slots:t}){return H(g),m(j,C),s&&m(f,s),()=>t.default?.()}}),E=(e,t)=>V()?.(e,t),_=M(function*(){const e=c(n.config.modalTitle,l.value)??c(n.buttonTitle,l.value)??"",{modal:t,close:B}=yield*T({title:e,width:n.config.modalWidth});o.value=()=>N(B()),yield*t,o.value=null});return(e,t)=>(A(),b(K,{"action-id":a.buttonId,effect:u(_)},{default:d(()=>[I("div",{style:z(a.config.modalMinHeight?`min-height: ${a.config.modalMinHeight}`:void 0)},[r(u(y),null,{default:d(()=>[r(F,{"slot-value":a.config.slot,configure:v,"find-entry":E},null,8,["slot-value"])]),_:1})],4)]),_:1},8,["action-id","effect"]))}});export{O as default};
@@ -1 +1 @@
1
- import{d as f,ae as u,af as l,ag as g,ah as m,ai as p,aj as d,e as x,u as E,ak as _,al as h,am as k,an as w,o as C}from"./index-DNd8J9Zv.js";import{_ as I}from"./definition.vue_vue_type_script_setup_true_lang-RM-qDh0R.js";const R=f({name:"ShwfedHttpRequestConfirmActionRuntime",__name:"runtime",props:{buttonId:{},config:{}},setup(s){const n=s,{locale:c}=u(),a=k(),t=(e,o)=>_(e,{...h(a),...o}),i=w(),r=l(function*(){const e=g(n.config.markdown,c.value)??"",o=m(e,t);(yield*p({content:o,icon:n.config.icon,color:n.config.color}))||(yield*d(n.config.expression,t,{messageExpression:n.config.messageExpression,resultExpression:n.config.resultExpression,channel:i,triggers:{success:n.config.onSuccess,warning:n.config.onWarning,error:n.config.onError,info:n.config.onInfo}}))});return(e,o)=>(C(),x(I,{"action-id":s.buttonId,effect:E(r)},null,8,["action-id","effect"]))}});export{R as default};
1
+ import{d as f,ae as u,af as l,ag as g,ah as m,ai as p,aj as d,e as x,u as E,ak as _,al as h,am as k,an as w,o as C}from"./index-D-VR1i8D.js";import{_ as I}from"./definition.vue_vue_type_script_setup_true_lang-C_cjxvm1.js";const R=f({name:"ShwfedHttpRequestConfirmActionRuntime",__name:"runtime",props:{buttonId:{},config:{}},setup(s){const n=s,{locale:c}=u(),a=k(),t=(e,o)=>_(e,{...h(a),...o}),i=w(),r=l(function*(){const e=g(n.config.markdown,c.value)??"",o=m(e,t);(yield*p({content:o,icon:n.config.icon,color:n.config.color}))||(yield*d(n.config.expression,t,{messageExpression:n.config.messageExpression,resultExpression:n.config.resultExpression,channel:i,triggers:{success:n.config.onSuccess,warning:n.config.onWarning,error:n.config.onError,info:n.config.onInfo}}))});return(e,o)=>(C(),x(I,{"action-id":s.buttonId,effect:E(r)},null,8,["action-id","effect"]))}});export{R as default};
@@ -10,8 +10,8 @@
10
10
  `--primary`, the primary button variant renders as transparent. */
11
11
  body { --primary: #009689; }
12
12
  </style>
13
- <script type="module" crossorigin src="./assets/index-DNd8J9Zv.js"></script>
14
- <link rel="stylesheet" crossorigin href="./assets/index-a2QwAots.css">
13
+ <script type="module" crossorigin src="./assets/index-D-VR1i8D.js"></script>
14
+ <link rel="stylesheet" crossorigin href="./assets/index-BqOX70Hd.css">
15
15
  </head>
16
16
  <body>
17
17
  <div id="app"></div>
@@ -42,6 +42,10 @@ declare const __VLS_export: <TItem extends {
42
42
  activeIndex?: number;
43
43
  selectedItemIds?: string[];
44
44
  }) & {
45
+ onPaste?: ((target: {
46
+ x: number;
47
+ y: number;
48
+ } | null) => any) | undefined;
45
49
  "onUpdate:modelValue"?: ((value: Readonly<{
46
50
  name: string;
47
51
  media?: string;
@@ -58,6 +62,7 @@ declare const __VLS_export: <TItem extends {
58
62
  "onDrill-down"?: ((itemId: string) => any) | undefined;
59
63
  "onDelete-item"?: ((itemId: string) => any) | undefined;
60
64
  "onDelete-items"?: ((itemIds: string[]) => any) | undefined;
65
+ "onCopy-items"?: ((itemIds: string[]) => any) | undefined;
61
66
  "onUpdate:activeIndex"?: ((value: number) => any) | undefined;
62
67
  "onUpdate:selectedItemIds"?: ((value: string[]) => any) | undefined;
63
68
  }> & (typeof globalThis extends {
@@ -66,14 +71,17 @@ declare const __VLS_export: <TItem extends {
66
71
  expose: (exposed: {}) => void;
67
72
  attrs: any;
68
73
  slots: {};
69
- emit: (((evt: "add-new", entry: Readonly<{
74
+ emit: (((evt: "paste", target: {
75
+ x: number;
76
+ y: number;
77
+ } | null) => void) & ((evt: "add-new", entry: Readonly<{
70
78
  type: string;
71
79
  compatibilityDate: string;
72
80
  name: string;
73
81
  icon: string;
74
82
  }>, options: {
75
83
  silent: boolean;
76
- }) => void) & ((evt: "drill-down", itemId: string) => void) & ((evt: "delete-item", itemId: string) => void) & ((evt: "delete-items", itemIds: string[]) => void)) & (((event: "update:modelValue", value: Readonly<{
84
+ }) => void) & ((evt: "drill-down", itemId: string) => void) & ((evt: "delete-item", itemId: string) => void) & ((evt: "delete-items", itemIds: string[]) => void) & ((evt: "copy-items", itemIds: string[]) => void)) & (((event: "update:modelValue", value: Readonly<{
77
85
  name: string;
78
86
  media?: string;
79
87
  layout: import("../form/schema.js").LayoutValue;
@@ -60,7 +60,7 @@ const props = defineProps({
60
60
  pickerEntries: { type: Array, required: false },
61
61
  canDelete: { type: Boolean, required: false }
62
62
  });
63
- const emit = defineEmits(["add-new", "drill-down", "delete-item", "delete-items"]);
63
+ const emit = defineEmits(["add-new", "drill-down", "delete-item", "delete-items", "copy-items", "paste"]);
64
64
  let pendingAddSilent = false;
65
65
  function captureAddModifiers(e) {
66
66
  pendingAddSilent = e.metaKey || e.ctrlKey;
@@ -234,6 +234,18 @@ const marqueeStyle = computed(() => {
234
234
  transform: `translate3d(${b.x}px, ${b.y}px, 0)`
235
235
  };
236
236
  });
237
+ const pendingPasteCell = ref(null);
238
+ function onPlaneContextMenu(e) {
239
+ const rect = canvasRef.value?.getBoundingClientRect();
240
+ if (!rect) {
241
+ pendingPasteCell.value = null;
242
+ return;
243
+ }
244
+ const s = stepPx.value;
245
+ const x = Math.floor((e.clientX - rect.left - coordinate.value.x) / s) + 1;
246
+ const y = Math.floor((e.clientY - rect.top - coordinate.value.y) / s) + 1;
247
+ pendingPasteCell.value = { x, y };
248
+ }
237
249
  function onPlaneMouseDown(e) {
238
250
  if (e.button !== 0) return;
239
251
  if (isSpaceHeld.value) return;
@@ -791,13 +803,27 @@ function toggleFullscreen() {
791
803
  class="relative overflow-hidden rounded border border-zinc-200 bg-zinc-50 select-none"
792
804
  :class="[isFullscreen ? 'h-screen' : 'h-full']"
793
805
  >
794
- <div
795
- ref="planeRef"
796
- class="absolute inset-0"
797
- :class="[isPanning ? 'cursor-grabbing' : isSpaceHeld ? 'cursor-grab' : '']"
798
- :style="bgStyle"
799
- @mousedown="onPlaneMouseDown"
800
- />
806
+ <ContextMenu>
807
+ <ContextMenuTrigger as-child>
808
+ <div
809
+ ref="planeRef"
810
+ class="absolute inset-0"
811
+ :class="[isPanning ? 'cursor-grabbing' : isSpaceHeld ? 'cursor-grab' : '']"
812
+ :style="bgStyle"
813
+ @mousedown="onPlaneMouseDown"
814
+ @contextmenu="onPlaneContextMenu"
815
+ />
816
+ </ContextMenuTrigger>
817
+ <ContextMenuContent
818
+ class="min-w-auto p-1.5"
819
+ :to="isFullscreen ? canvasRef : null"
820
+ >
821
+ <ContextMenuItem @select="emit('paste', pendingPasteCell)">
822
+ <Icon icon="fluent:clipboard-paste-20-regular" />
823
+ <span>粘贴{{ itemNoun }}</span>
824
+ </ContextMenuItem>
825
+ </ContextMenuContent>
826
+ </ContextMenu>
801
827
 
802
828
  <div
803
829
  v-if="marqueeStyle"
@@ -912,6 +938,11 @@ function toggleFullscreen() {
912
938
  :to="isFullscreen ? canvasRef : null"
913
939
  >
914
940
  <template v-if="selectedItemIds.length > 1 && isSelected(entry.itemId)">
941
+ <ContextMenuItem @select="emit('copy-items', [...selectedItemIds])">
942
+ <Icon icon="fluent:copy-20-regular" />
943
+ <span>复制 ({{ selectedItemIds.length }})</span>
944
+ </ContextMenuItem>
945
+ <ContextMenuSeparator />
915
946
  <ContextMenuRadioGroup
916
947
  :model-value="sharedAlignment('h') ?? ''"
917
948
  class="my-1 flex items-center justify-center gap-0.5"
@@ -1059,6 +1090,11 @@ function toggleFullscreen() {
1059
1090
  </ContextMenuItem>
1060
1091
  </template>
1061
1092
  <template v-else>
1093
+ <ContextMenuItem @select="emit('copy-items', [entry.itemId])">
1094
+ <Icon icon="fluent:copy-20-regular" />
1095
+ <span>复制</span>
1096
+ </ContextMenuItem>
1097
+ <ContextMenuSeparator />
1062
1098
  <ContextMenuRadioGroup
1063
1099
  :model-value="entry.placement.h ?? 'stretch'"
1064
1100
  class="my-1 flex items-center justify-center gap-0.5"
@@ -42,6 +42,10 @@ declare const __VLS_export: <TItem extends {
42
42
  activeIndex?: number;
43
43
  selectedItemIds?: string[];
44
44
  }) & {
45
+ onPaste?: ((target: {
46
+ x: number;
47
+ y: number;
48
+ } | null) => any) | undefined;
45
49
  "onUpdate:modelValue"?: ((value: Readonly<{
46
50
  name: string;
47
51
  media?: string;
@@ -58,6 +62,7 @@ declare const __VLS_export: <TItem extends {
58
62
  "onDrill-down"?: ((itemId: string) => any) | undefined;
59
63
  "onDelete-item"?: ((itemId: string) => any) | undefined;
60
64
  "onDelete-items"?: ((itemIds: string[]) => any) | undefined;
65
+ "onCopy-items"?: ((itemIds: string[]) => any) | undefined;
61
66
  "onUpdate:activeIndex"?: ((value: number) => any) | undefined;
62
67
  "onUpdate:selectedItemIds"?: ((value: string[]) => any) | undefined;
63
68
  }> & (typeof globalThis extends {
@@ -66,14 +71,17 @@ declare const __VLS_export: <TItem extends {
66
71
  expose: (exposed: {}) => void;
67
72
  attrs: any;
68
73
  slots: {};
69
- emit: (((evt: "add-new", entry: Readonly<{
74
+ emit: (((evt: "paste", target: {
75
+ x: number;
76
+ y: number;
77
+ } | null) => void) & ((evt: "add-new", entry: Readonly<{
70
78
  type: string;
71
79
  compatibilityDate: string;
72
80
  name: string;
73
81
  icon: string;
74
82
  }>, options: {
75
83
  silent: boolean;
76
- }) => void) & ((evt: "drill-down", itemId: string) => void) & ((evt: "delete-item", itemId: string) => void) & ((evt: "delete-items", itemIds: string[]) => void)) & (((event: "update:modelValue", value: Readonly<{
84
+ }) => void) & ((evt: "drill-down", itemId: string) => void) & ((evt: "delete-item", itemId: string) => void) & ((evt: "delete-items", itemIds: string[]) => void) & ((evt: "copy-items", itemIds: string[]) => void)) & (((event: "update:modelValue", value: Readonly<{
77
85
  name: string;
78
86
  media?: string;
79
87
  layout: import("../form/schema.js").LayoutValue;
@@ -10,6 +10,7 @@ type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
10
10
  declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
11
11
  "update:modelValue": (value: {
12
12
  readonly form: {
13
+ readonly style?: string | undefined;
13
14
  readonly initial?: {
14
15
  readonly data: string;
15
16
  readonly request?: string | undefined;
@@ -42,6 +43,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
42
43
  }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
43
44
  "onUpdate:modelValue"?: ((value: {
44
45
  readonly form: {
46
+ readonly style?: string | undefined;
45
47
  readonly initial?: {
46
48
  readonly data: string;
47
49
  readonly request?: string | undefined;
@@ -10,6 +10,7 @@ type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
10
10
  declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
11
11
  "update:modelValue": (value: {
12
12
  readonly form: {
13
+ readonly style?: string | undefined;
13
14
  readonly initial?: {
14
15
  readonly data: string;
15
16
  readonly request?: string | undefined;
@@ -42,6 +43,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
42
43
  }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
43
44
  "onUpdate:modelValue"?: ((value: {
44
45
  readonly form: {
46
+ readonly style?: string | undefined;
45
47
  readonly initial?: {
46
48
  readonly data: string;
47
49
  readonly request?: string | undefined;
@@ -12,6 +12,7 @@ type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
12
12
  declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
13
13
  "update:block": (value: {
14
14
  readonly form: {
15
+ readonly style?: string | undefined;
15
16
  readonly initial?: {
16
17
  readonly data: string;
17
18
  readonly request?: string | undefined;
@@ -45,6 +46,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
45
46
  }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
46
47
  "onUpdate:block"?: ((value: {
47
48
  readonly form: {
49
+ readonly style?: string | undefined;
48
50
  readonly initial?: {
49
51
  readonly data: string;
50
52
  readonly request?: string | undefined;
@@ -12,6 +12,7 @@ type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
12
12
  declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
13
13
  "update:block": (value: {
14
14
  readonly form: {
15
+ readonly style?: string | undefined;
15
16
  readonly initial?: {
16
17
  readonly data: string;
17
18
  readonly request?: string | undefined;
@@ -45,6 +46,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
45
46
  }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
46
47
  "onUpdate:block"?: ((value: {
47
48
  readonly form: {
49
+ readonly style?: string | undefined;
48
50
  readonly initial?: {
49
51
  readonly data: string;
50
52
  readonly request?: string | undefined;
@@ -22,6 +22,7 @@ export declare function schema(configure: (env: Environment) => void, _blockRef:
22
22
  type: Schema.tag<"com.shwfed.block.form">;
23
23
  compatibilityDate: Schema.tag<"2026-05-06">;
24
24
  form: Schema.refine<{
25
+ readonly style?: string | undefined;
25
26
  readonly initial?: {
26
27
  readonly data: string;
27
28
  readonly request?: string | undefined;
@@ -88,6 +89,7 @@ export declare function schema(configure: (env: Environment) => void, _blockRef:
88
89
  data: Schema.Schema<string, string, never>;
89
90
  }>>>;
90
91
  readonly: Schema.optional<Schema.Schema<string, string, never>>;
92
+ style: Schema.optional<typeof Schema.String>;
91
93
  }>>;
92
94
  }>;
93
95
  export declare function defaultBody(): Record<string, unknown>;
@@ -35,6 +35,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
35
35
  }[]] | undefined;
36
36
  }[];
37
37
  readonly query?: {
38
+ readonly style?: string | undefined;
38
39
  readonly initial?: {
39
40
  readonly data: string;
40
41
  readonly request?: string | undefined;
@@ -212,6 +213,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
212
213
  }[]] | undefined;
213
214
  }[];
214
215
  readonly query?: {
216
+ readonly style?: string | undefined;
215
217
  readonly initial?: {
216
218
  readonly data: string;
217
219
  readonly request?: string | undefined;
@@ -35,6 +35,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
35
35
  }[]] | undefined;
36
36
  }[];
37
37
  readonly query?: {
38
+ readonly style?: string | undefined;
38
39
  readonly initial?: {
39
40
  readonly data: string;
40
41
  readonly request?: string | undefined;
@@ -212,6 +213,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
212
213
  }[]] | undefined;
213
214
  }[];
214
215
  readonly query?: {
216
+ readonly style?: string | undefined;
215
217
  readonly initial?: {
216
218
  readonly data: string;
217
219
  readonly request?: string | undefined;
@@ -30,6 +30,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
30
30
  }[]] | undefined;
31
31
  }[];
32
32
  readonly query?: {
33
+ readonly style?: string | undefined;
33
34
  readonly initial?: {
34
35
  readonly data: string;
35
36
  readonly request?: string | undefined;
@@ -207,6 +208,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
207
208
  }[]] | undefined;
208
209
  }[];
209
210
  readonly query?: {
211
+ readonly style?: string | undefined;
210
212
  readonly initial?: {
211
213
  readonly data: string;
212
214
  readonly request?: string | undefined;
@@ -30,6 +30,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
30
30
  }[]] | undefined;
31
31
  }[];
32
32
  readonly query?: {
33
+ readonly style?: string | undefined;
33
34
  readonly initial?: {
34
35
  readonly data: string;
35
36
  readonly request?: string | undefined;
@@ -207,6 +208,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
207
208
  }[]] | undefined;
208
209
  }[];
209
210
  readonly query?: {
211
+ readonly style?: string | undefined;
210
212
  readonly initial?: {
211
213
  readonly data: string;
212
214
  readonly request?: string | undefined;
@@ -45,6 +45,7 @@ export declare function schema(configure: (env: Environment) => void, _blockRef:
45
45
  }[]] | undefined;
46
46
  }[];
47
47
  readonly query?: {
48
+ readonly style?: string | undefined;
48
49
  readonly initial?: {
49
50
  readonly data: string;
50
51
  readonly request?: string | undefined;
@@ -349,6 +350,7 @@ export declare function schema(configure: (env: Environment) => void, _blockRef:
349
350
  }, never>>;
350
351
  }>>;
351
352
  query: Schema.optional<Schema.refine<{
353
+ readonly style?: string | undefined;
352
354
  readonly initial?: {
353
355
  readonly data: string;
354
356
  readonly request?: string | undefined;
@@ -415,6 +417,7 @@ export declare function schema(configure: (env: Environment) => void, _blockRef:
415
417
  data: Schema.Schema<string, string, never>;
416
418
  }>>>;
417
419
  readonly: Schema.optional<Schema.Schema<string, string, never>>;
420
+ style: Schema.optional<typeof Schema.String>;
418
421
  }>>>;
419
422
  rowKey: Schema.optional<Schema.Schema<string, string, never>>;
420
423
  cellStyle: Schema.optional<Schema.Schema<string, string, never>>;
@@ -1,6 +1,8 @@
1
1
  <script setup>
2
2
  import { computed, provide, toRef, useTemplateRef } from "vue";
3
3
  import { Icon } from "@iconify/vue";
4
+ import { toast } from "vue-sonner";
5
+ import { readClip, reidFragment, writeClip } from "../../share/clipboard";
4
6
  import BlockLayoutEditor from "../block-layout-editor/index.vue";
5
7
  import LayoutsSidebar from "../block-layout-editor/sidebar.vue";
6
8
  import LayoutMetaStrip from "../block-layout-editor/meta-strip.vue";
@@ -48,6 +50,37 @@ function addBlock(entry, options) {
48
50
  function onDrillDown(id) {
49
51
  props.state.onDrillDown(id);
50
52
  }
53
+ async function copyBlocks(ids) {
54
+ const want = new Set(ids);
55
+ const items = props.state.blocks.value.filter((b) => want.has(b.id));
56
+ if (items.length === 0) return;
57
+ const ls = layouts.value[activeLayoutIndex.value];
58
+ const placements = {};
59
+ if (ls) {
60
+ for (const id of ids) {
61
+ const p = ls.layout.placements[id];
62
+ if (p) placements[id] = p;
63
+ }
64
+ }
65
+ if (!await writeClip("block", items, placements)) {
66
+ toast.error("\u590D\u5236\u5931\u8D25");
67
+ return;
68
+ }
69
+ toast.success(`\u5DF2\u590D\u5236 ${items.length} \u4E2A\u5757`);
70
+ }
71
+ async function pasteBlocks(target) {
72
+ const payload = await readClip();
73
+ if (!payload || payload.surface !== "block") return;
74
+ const { items, placements } = reidFragment(payload.items, payload.placements);
75
+ const pasted = items;
76
+ if (pasted.length === 0) return;
77
+ if (placements && Object.keys(placements).length > 0) {
78
+ props.state.addBlocksWithPlacements(pasted, placements, target);
79
+ } else {
80
+ props.state.addBlocks(pasted);
81
+ }
82
+ toast.success(`\u5DF2\u7C98\u8D34 ${pasted.length} \u4E2A\u5757`);
83
+ }
51
84
  function updateActiveBlock(next) {
52
85
  props.state.updateActiveBlock(next);
53
86
  }
@@ -106,6 +139,8 @@ function findBlockMeta(type, compatibilityDate) {
106
139
  @drill-down="onDrillDown"
107
140
  @delete-item="(id) => props.state.removeBlock(id)"
108
141
  @delete-items="(ids) => props.state.removeBlocks(ids)"
142
+ @copy-items="copyBlocks"
143
+ @paste="pasteBlocks"
109
144
  />
110
145
  </div>
111
146
  </div>
@@ -1,6 +1,6 @@
1
1
  import { type ComputedRef, type Ref, type WritableComputedRef } from 'vue';
2
2
  import type { Environment } from '../../vendor/cel-js/lib/index.js';
3
- import { type LayoutSetValue, type SlotValue } from '../../share/layout.js';
3
+ import { type LayoutSetValue, type PlacementValue, type SlotValue } from '../../share/layout.js';
4
4
  import type { BreadcrumbCrumb, BreadcrumbParentSuffix } from './breadcrumb-extension.js';
5
5
  import { type BlockValue, type PageConfigValue } from './schema.js';
6
6
  import { type BlockEntry } from './utils/resolve.js';
@@ -45,6 +45,11 @@ export interface SlotEditor {
45
45
  addBlock: (entry: PickerEntry, options?: {
46
46
  silent?: boolean;
47
47
  }) => string;
48
+ addBlocks: (blocks: ReadonlyArray<BlockValue>) => void;
49
+ addBlocksWithPlacements: (blocks: ReadonlyArray<BlockValue>, placements: Readonly<Record<string, PlacementValue>>, target: {
50
+ x: number;
51
+ y: number;
52
+ } | null) => void;
48
53
  removeBlock: (id: string) => void;
49
54
  removeBlocks: (ids: ReadonlyArray<string>) => void;
50
55
  updateBlock: (id: string, next: BlockValue) => void;
@@ -80,6 +85,11 @@ export interface ConfigEditorState {
80
85
  addBlock: (entry: PickerEntry, options?: {
81
86
  silent?: boolean;
82
87
  }) => void;
88
+ addBlocks: (blocks: ReadonlyArray<BlockValue>) => void;
89
+ addBlocksWithPlacements: (blocks: ReadonlyArray<BlockValue>, placements: Readonly<Record<string, PlacementValue>>, target: {
90
+ x: number;
91
+ y: number;
92
+ } | null) => void;
83
93
  removeBlock: (id: string) => void;
84
94
  removeBlocks: (ids: ReadonlyArray<string>) => void;
85
95
  updateActiveBlock: (next: BlockValue) => void;
@@ -1,6 +1,6 @@
1
1
  import { Schema } from "effect";
2
2
  import { computed, ref, shallowRef, watch } from "vue";
3
- import { findFreePlacement, normalizeLayoutSet } from "../../share/layout.js";
3
+ import { findFreePlacement, normalizeLayoutSet, placeGroupAt } from "../../share/layout.js";
4
4
  import { PageConfig } from "./schema.js";
5
5
  import { BLOCKS, findBlock } from "./utils/resolve.js";
6
6
  function deepClone(value) {
@@ -106,6 +106,28 @@ export function useSlotEditor(slot, options = {}) {
106
106
  }
107
107
  return id;
108
108
  }
109
+ function addBlocks(newBlocks) {
110
+ if (newBlocks.length === 0) return;
111
+ slot.value = { ...slot.value, blocks: [...slot.value.blocks, ...newBlocks] };
112
+ }
113
+ function addBlocksWithPlacements(newBlocks, placements, target) {
114
+ if (newBlocks.length === 0) return;
115
+ const i = activeLayoutIndex.value;
116
+ const nextLayouts = slot.value.layouts.map((ls, idx) => {
117
+ if (idx !== i) return ls;
118
+ const shifted = placeGroupAt(ls.layout.placements, placements, target ?? { x: 1, y: 1 });
119
+ return normalizeLayoutSet({
120
+ ...ls,
121
+ layout: { ...ls.layout, placements: { ...ls.layout.placements, ...shifted } }
122
+ });
123
+ });
124
+ slot.value = {
125
+ ...slot.value,
126
+ blocks: [...slot.value.blocks, ...newBlocks],
127
+ layouts: nextLayouts
128
+ };
129
+ selectedBlockIds.value = newBlocks.map((b) => b.id);
130
+ }
109
131
  function removeBlock(id) {
110
132
  removeBlocks([id]);
111
133
  }
@@ -154,6 +176,8 @@ export function useSlotEditor(slot, options = {}) {
154
176
  layouts: layoutsAccessor,
155
177
  pickerEntries,
156
178
  addBlock,
179
+ addBlocks,
180
+ addBlocksWithPlacements,
157
181
  removeBlock,
158
182
  removeBlocks,
159
183
  updateBlock,
@@ -375,6 +399,8 @@ export function useConfigEditor(model, options = {}) {
375
399
  popOne,
376
400
  pushBlock,
377
401
  addBlock,
402
+ addBlocks: topSlotEditor.addBlocks,
403
+ addBlocksWithPlacements: topSlotEditor.addBlocksWithPlacements,
378
404
  removeBlock: topSlotEditor.removeBlock,
379
405
  removeBlocks: topSlotEditor.removeBlocks,
380
406
  updateActiveBlock,
@@ -4,6 +4,7 @@ import { provideCELContext } from "../../utils/cel-context";
4
4
  import { ExpressionEditor } from "../ui/expression-editor";
5
5
  import { Field, FieldLabel } from "../ui/field";
6
6
  import { Markdown } from "../ui/markdown";
7
+ import { Textarea } from "../ui/textarea";
7
8
  import {
8
9
  FormConfig,
9
10
  getStructFieldDescription,
@@ -60,6 +61,15 @@ function updateReadonly(value) {
60
61
  config.value = { ...next, readonly: value };
61
62
  }
62
63
  }
64
+ function updateStyle(value) {
65
+ const next = { ...config.value };
66
+ if (value.trim() === "") {
67
+ const { style: _omit, ...rest } = next;
68
+ config.value = rest;
69
+ } else {
70
+ config.value = { ...next, style: value };
71
+ }
72
+ }
63
73
  </script>
64
74
 
65
75
  <template>
@@ -138,6 +148,28 @@ function updateReadonly(value) {
138
148
  @update:model-value="updateReadonly"
139
149
  />
140
150
  </Field>
151
+
152
+ <Field orientation="vertical">
153
+ <FieldLabel class="text-xs text-zinc-500">
154
+ <template
155
+ v-if="generalFieldDescription('style')"
156
+ #tooltip
157
+ >
158
+ <Markdown
159
+ :source="generalFieldDescription('style')"
160
+ block
161
+ class="prose prose-sm prose-zinc"
162
+ />
163
+ </template>
164
+ {{ generalFieldTitle("style") }}
165
+ </FieldLabel>
166
+ <Textarea
167
+ :model-value="config.style ?? ''"
168
+ placeholder="如 max-width: 640px; margin: 0 auto;"
169
+ class="min-h-20 font-mono text-xs"
170
+ @update:model-value="(v) => updateStyle(String(v))"
171
+ />
172
+ </Field>
141
173
  </div>
142
174
  </template>
143
175
  </ShwfedFormUnitConfig>