@luck-design-biz/luckda 1.0.2-13 → 1.0.2-14

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 (450) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +40 -40
  3. package/es/components/Builder/index.js +13 -10
  4. package/es/components/LDActions/index.less +70 -70
  5. package/es/components/LdAutoForm/index.js +5 -4
  6. package/es/components/LdCom/index.js +3 -2
  7. package/es/components/LdFormList/index.js +4 -3
  8. package/es/components/LdGrid/index.js +4 -4
  9. package/es/components/LdGridForm/index.js +5 -4
  10. package/es/components/LdGridForm/index.less +7 -7
  11. package/es/components/LdTree/index.less +42 -42
  12. package/es/helper/FromItems.js +64 -5
  13. package/es/helper/action.js +6 -6
  14. package/es/helper/form.js +14 -14
  15. package/es/helper/index.less +7 -7
  16. package/es/helper/ldBuilder.js +5 -4
  17. package/es/helper/ldComBuild.js +16 -11
  18. package/es/locales/zh-CN.js +41 -5
  19. package/es/lowcode/constants/api-url.js +309 -261
  20. package/es/lowcode/constants/event-topics.js +2 -0
  21. package/es/lowcode/constants/index.js +5 -4
  22. package/es/lowcode/engine/meta/components-list.json +12 -6
  23. package/es/lowcode/engine/meta/fielddate.props.default.json +1 -0
  24. package/es/lowcode/engine/meta/fielddate.props.json +48 -0
  25. package/es/lowcode/engine/meta/js-editor/auto-complete.json +35 -30
  26. package/es/lowcode/engine/meta/proxy.props.default.json +15 -0
  27. package/es/lowcode/engine/meta/proxy.props.json +66 -0
  28. package/es/lowcode/engine/provider/ContextProvider/index.js +87 -49
  29. package/es/lowcode/engine/provider/ContextProvider/usePageDataStore.js +49 -43
  30. package/es/lowcode/engine/provider/ContextProvider/usePageVar.js +11 -5
  31. package/es/lowcode/engine/provider/ContextProvider/useTodo.js +2 -4
  32. package/es/lowcode/engine/provider/EventBusProvider.js +14 -4
  33. package/es/lowcode/engine/provider/PageProxyProvider.js +95 -0
  34. package/es/lowcode/engine/provider/RemoteSourceProvider.js +10 -12
  35. package/es/lowcode/engine/tools/dataProcess.js +76 -76
  36. package/es/lowcode/engine/tools/helper.js +25 -1
  37. package/es/lowcode/engine/tools/initDS.js +4 -4
  38. package/es/lowcode/painter/Components.js +2 -2
  39. package/es/lowcode/painter/Design.js +1 -0
  40. package/es/lowcode/painter/DesignOperator.js +129 -27
  41. package/es/lowcode/painter/DesignToolbar.js +88 -173
  42. package/es/lowcode/painter/components/AdvancePanel.js +28 -10
  43. package/es/lowcode/painter/components/Collapse.js +26 -26
  44. package/es/lowcode/painter/components/ColorInput.js +24 -24
  45. package/es/lowcode/painter/components/ListEditor.js +24 -24
  46. package/es/lowcode/painter/components/NumberInput.js +28 -28
  47. package/es/lowcode/painter/components/PanelItem.js +24 -24
  48. package/es/lowcode/painter/components/PopConfirm.js +8 -8
  49. package/es/lowcode/painter/components/PopForm.js +27 -27
  50. package/es/lowcode/painter/components/RuleInput.js +30 -30
  51. package/es/lowcode/painter/components/SortBox.js +22 -22
  52. package/es/lowcode/painter/components/TipIcon.js +12 -4
  53. package/es/lowcode/painter/components/TreeEditor.js +10 -10
  54. package/es/lowcode/painter/components/code-editor/BaseEditor.js +32 -32
  55. package/es/lowcode/painter/components/code-editor/CssEditor.js +25 -25
  56. package/es/lowcode/painter/components/code-editor/FullScreenEditor.js +23 -23
  57. package/es/lowcode/painter/components/code-editor/JSEditor.js +20 -20
  58. package/es/lowcode/painter/components/code-editor/JsonEditor.js +25 -25
  59. package/es/lowcode/painter/components/field-setting/SettingUI.js +56 -4
  60. package/es/lowcode/painter/components/field-setting/index.js +24 -1
  61. package/es/lowcode/painter/components/shortcut-modal/KeyIcon.js +11 -0
  62. package/es/lowcode/painter/components/shortcut-modal/index.js +208 -0
  63. package/es/lowcode/painter/panel-section/BlockEditor/index.js +10 -19
  64. package/es/lowcode/painter/panel-section/BlocksEditor/index.js +4 -1
  65. package/es/lowcode/painter/panel-section/ConditionCheck.js +0 -1
  66. package/es/lowcode/painter/panel-section/DataSetSelector.js +6 -3
  67. package/es/lowcode/painter/panel-section/FieldsSetting.js +1 -1
  68. package/es/lowcode/painter/panel-section/Icon.js +23 -23
  69. package/es/lowcode/painter/panel-section/IconConditionSelector.js +2 -1
  70. package/es/lowcode/painter/panel-section/IconSelector.js +16 -16
  71. package/es/lowcode/painter/panel-section/JSEditor/ToolBar.js +7 -4
  72. package/es/lowcode/painter/panel-section/JSEditor/index.js +15 -5
  73. package/es/lowcode/painter/panel-section/JSEditor/index.less +4 -0
  74. package/es/lowcode/painter/panel-section/LayoutRatio.js +21 -21
  75. package/es/lowcode/painter/panel-section/ProxyLinker.js +137 -0
  76. package/es/lowcode/painter/panel-section/ProxyParams.js +28 -0
  77. package/es/lowcode/painter/panel-section/ProxyParamsSetter.js +240 -0
  78. package/es/lowcode/painter/panel-section/StylePanel/BackGround.js +2 -2
  79. package/es/lowcode/painter/panel-section/StylePanel/Border.js +2 -2
  80. package/es/lowcode/painter/panel-section/StylePanel/BorderRadius.js +2 -2
  81. package/es/lowcode/painter/panel-section/StylePanel/BorderRadiusSelector.js +2 -2
  82. package/es/lowcode/painter/panel-section/StylePanel/BorderSelector.js +2 -2
  83. package/es/lowcode/painter/panel-section/StylePanel/Display.js +2 -2
  84. package/es/lowcode/painter/panel-section/StylePanel/Font.js +2 -2
  85. package/es/lowcode/painter/panel-section/StylePanel/FontEditor.js +2 -2
  86. package/es/lowcode/painter/panel-section/StylePanel/GapSelector.js +2 -2
  87. package/es/lowcode/painter/panel-section/StylePanel/HighLightPanel.js +2 -2
  88. package/es/lowcode/painter/panel-section/StylePanel/HighLigthtSpan.js +2 -2
  89. package/es/lowcode/painter/panel-section/StylePanel/HightLightSvg.js +2 -2
  90. package/es/lowcode/painter/panel-section/StylePanel/MainPanel.js +2 -2
  91. package/es/lowcode/painter/panel-section/StylePanel/Margin.js +2 -2
  92. package/es/lowcode/painter/panel-section/StylePanel/Opacity.js +2 -2
  93. package/es/lowcode/painter/panel-section/StylePanel/Padding.js +2 -2
  94. package/es/lowcode/painter/panel-section/StylePanel/Pointer.js +2 -2
  95. package/es/lowcode/painter/panel-section/StylePanel/Shadow.js +2 -2
  96. package/es/lowcode/painter/panel-section/StylePanel/Size.js +2 -2
  97. package/es/lowcode/painter/panel-section/StylePanel/StyleContext.js +2 -2
  98. package/es/lowcode/painter/panel-section/StylePanel/StyleRow.js +2 -2
  99. package/es/lowcode/painter/panel-section/StylePanel/WidthHeight.js +2 -2
  100. package/es/lowcode/painter/panel-section/StylePanel/index.js +15 -15
  101. package/es/lowcode/painter/style/action-bind-modal.less +104 -104
  102. package/es/lowcode/painter/style/actions-editor.less +15 -15
  103. package/es/lowcode/painter/style/border-editor.less +36 -36
  104. package/es/lowcode/painter/style/border-radius-selector.less +42 -42
  105. package/es/lowcode/painter/style/border-selector.less +39 -39
  106. package/es/lowcode/painter/style/button-type.less +5 -5
  107. package/es/lowcode/painter/style/collapse.less +28 -28
  108. package/es/lowcode/painter/style/color-input.less +19 -19
  109. package/es/lowcode/painter/style/components.less +91 -91
  110. package/es/lowcode/painter/style/design.less +178 -178
  111. package/es/lowcode/painter/style/display.less +17 -17
  112. package/es/lowcode/painter/style/dragdrop.less +56 -56
  113. package/es/lowcode/painter/style/fields-setting.less +25 -25
  114. package/es/lowcode/painter/style/font-editor.less +9 -9
  115. package/es/lowcode/painter/style/fullscreen-editor.less +17 -17
  116. package/es/lowcode/painter/style/history.less +46 -46
  117. package/es/lowcode/painter/style/icon-selector.less +22 -22
  118. package/es/lowcode/painter/style/icon.less +10 -10
  119. package/es/lowcode/painter/style/impexp.less +7 -7
  120. package/es/lowcode/painter/style/index.less +6 -6
  121. package/es/lowcode/painter/style/layout-ratio.less +51 -51
  122. package/es/lowcode/painter/style/list-editor.less +97 -97
  123. package/es/lowcode/painter/style/number-input.less +19 -19
  124. package/es/lowcode/painter/style/outline.less +30 -30
  125. package/es/lowcode/painter/style/page-layout-display.less +27 -27
  126. package/es/lowcode/painter/style/page-vars.less +25 -25
  127. package/es/lowcode/painter/style/panel-attrs.less +47 -47
  128. package/es/lowcode/painter/style/panel-item.less +55 -54
  129. package/es/lowcode/painter/style/panel.less +100 -100
  130. package/es/lowcode/painter/style/pop-confirm.less +17 -17
  131. package/es/lowcode/painter/style/pop-form.less +19 -19
  132. package/es/lowcode/painter/style/radio.less +24 -24
  133. package/es/lowcode/painter/style/ribbon.less +7 -7
  134. package/es/lowcode/painter/style/rule-input.less +12 -12
  135. package/es/lowcode/painter/style/split-display.less +18 -18
  136. package/es/lowcode/painter/style/style-panel.less +37 -37
  137. package/es/lowcode/painter/style/tabitems.less +90 -90
  138. package/es/lowcode/painter/svg/code.svg +3 -3
  139. package/es/lowcode/painter/svg/expect.svg +9 -9
  140. package/es/lowcode/preview/DebugTool.js +78 -0
  141. package/es/lowcode/preview/DebugToolDetail.js +103 -0
  142. package/es/lowcode/preview/index.js +10 -17
  143. package/es/lowcode/preview/useDebugSettings.js +62 -0
  144. package/es/lowcode/view/Canvas.js +5 -1
  145. package/es/lowcode/view/Page.js +8 -3
  146. package/es/lowcode/view/lc-components/Box/index.js +4 -4
  147. package/es/lowcode/view/lc-components/Box/index.less +14 -14
  148. package/es/lowcode/view/lc-components/Box/meta.json +40 -40
  149. package/es/lowcode/view/lc-components/Button/index.js +33 -33
  150. package/es/lowcode/view/lc-components/Button/meta.json +127 -127
  151. package/es/lowcode/view/lc-components/Button/style.less +2 -2
  152. package/es/lowcode/view/lc-components/CardList/index.js +126 -123
  153. package/es/lowcode/view/lc-components/CardList/meta.json +332 -332
  154. package/es/lowcode/view/lc-components/Dialog/index.js +14 -13
  155. package/es/lowcode/view/lc-components/Dialog/index.less +12 -12
  156. package/es/lowcode/view/lc-components/Dialog/meta.json +224 -224
  157. package/es/lowcode/view/lc-components/Drawer/index.js +15 -13
  158. package/es/lowcode/view/lc-components/Drawer/index.less +13 -13
  159. package/es/lowcode/view/lc-components/Drawer/meta.json +242 -242
  160. package/es/lowcode/view/lc-components/FieldColor/meta.json +157 -157
  161. package/es/lowcode/view/lc-components/FieldComplex/meta.json +140 -140
  162. package/es/lowcode/view/lc-components/FieldDate/meta.json +188 -140
  163. package/es/lowcode/view/lc-components/FieldDict/meta.json +138 -138
  164. package/es/lowcode/view/lc-components/FieldEditor/meta.json +137 -137
  165. package/es/lowcode/view/lc-components/FieldGroup/meta.json +166 -166
  166. package/es/lowcode/view/lc-components/FieldNumber/meta.json +143 -143
  167. package/es/lowcode/view/lc-components/FieldRadio/meta.json +115 -115
  168. package/es/lowcode/view/lc-components/FieldRegion/meta.json +121 -121
  169. package/es/lowcode/view/lc-components/FieldSelect/meta.json +152 -152
  170. package/es/lowcode/view/lc-components/FieldString/meta.json +152 -152
  171. package/es/lowcode/view/lc-components/FieldSwitch/meta.json +125 -125
  172. package/es/lowcode/view/lc-components/FieldTextarea/meta.json +143 -143
  173. package/es/lowcode/view/lc-components/FieldUpload/meta.json +165 -165
  174. package/es/lowcode/view/lc-components/FieldUser/meta.json +176 -176
  175. package/es/lowcode/view/lc-components/FieldYear/meta.json +128 -128
  176. package/es/lowcode/view/lc-components/Form/index.js +23 -20
  177. package/es/lowcode/view/lc-components/Form/meta.json +629 -629
  178. package/es/lowcode/view/lc-components/GroupTree/index.js +23 -23
  179. package/es/lowcode/view/lc-components/GroupTree/index.less +11 -11
  180. package/es/lowcode/view/lc-components/GroupTree/meta.json +82 -82
  181. package/es/lowcode/view/lc-components/Iframe/meta.json +31 -31
  182. package/es/lowcode/view/lc-components/ImEx/index.js +25 -25
  183. package/es/lowcode/view/lc-components/ImEx/index.less +7 -7
  184. package/es/lowcode/view/lc-components/ImEx/meta.json +134 -134
  185. package/es/lowcode/view/lc-components/Image/index.less +27 -27
  186. package/es/lowcode/view/lc-components/Image/meta.json +149 -149
  187. package/es/lowcode/view/lc-components/JSX/RuntimeComp.js +4 -4
  188. package/es/lowcode/view/lc-components/JSX/meta.json +29 -29
  189. package/es/lowcode/view/lc-components/Layout/index.js +16 -16
  190. package/es/lowcode/view/lc-components/Layout/index.less +5 -5
  191. package/es/lowcode/view/lc-components/Layout/meta.json +107 -107
  192. package/es/lowcode/view/lc-components/Link/index.less +15 -15
  193. package/es/lowcode/view/lc-components/Link/meta.json +112 -112
  194. package/es/lowcode/view/lc-components/Page/meta.json +61 -61
  195. package/es/lowcode/view/lc-components/PageContent/meta.json +9 -9
  196. package/es/lowcode/view/lc-components/PageFooter/meta.json +9 -9
  197. package/es/lowcode/view/lc-components/PageHeader/meta.json +9 -9
  198. package/es/lowcode/view/lc-components/PageLayout/meta.json +59 -59
  199. package/es/lowcode/view/lc-components/Proxy/FunctionDesign.js +17 -0
  200. package/es/lowcode/view/lc-components/Proxy/FunctionLive.js +23 -0
  201. package/es/lowcode/view/lc-components/Proxy/FunctionPreview.js +23 -0
  202. package/es/lowcode/view/lc-components/Proxy/index.js +42 -0
  203. package/es/lowcode/view/lc-components/Proxy/index.less +5 -0
  204. package/es/lowcode/view/lc-components/Proxy/meta.json +66 -0
  205. package/es/lowcode/view/lc-components/Section/index.less +7 -7
  206. package/es/lowcode/view/lc-components/Section/meta.json +108 -108
  207. package/es/lowcode/view/lc-components/Split/meta.json +53 -53
  208. package/es/lowcode/view/lc-components/Table/index.js +156 -149
  209. package/es/lowcode/view/lc-components/Table/meta.json +443 -443
  210. package/es/lowcode/view/lc-components/Tabs/index.js +23 -23
  211. package/es/lowcode/view/lc-components/Tabs/meta.json +113 -113
  212. package/es/lowcode/view/lc-components/Text/meta.json +56 -56
  213. package/es/lowcode/view/lc-components/Tree/index.js +99 -96
  214. package/es/lowcode/view/lc-components/Tree/index.less +4 -4
  215. package/es/lowcode/view/lc-components/Tree/meta.json +353 -353
  216. package/es/lowcode/view/lc-components/Wrapper.js +7 -1
  217. package/es/lowcode/view/style/canvas.less +5 -5
  218. package/es/lowcode/view/style/loading.less +98 -98
  219. package/es/lowcode/view/style/page.less +7 -7
  220. package/es/upload/FilesWall/index.js +13 -13
  221. package/es/upload/FilesWall/index.less +74 -74
  222. package/es/upload/Form/index.less +7 -7
  223. package/es/upload/FormItem/index.js +15 -15
  224. package/es/utils/form.js +21 -21
  225. package/lib/components/Builder/index.js +13 -10
  226. package/lib/components/LDActions/index.less +70 -70
  227. package/lib/components/LdAutoForm/index.js +3 -2
  228. package/lib/components/LdCom/index.js +3 -2
  229. package/lib/components/LdFormList/index.js +3 -2
  230. package/lib/components/LdGrid/index.js +4 -4
  231. package/lib/components/LdGridForm/index.js +3 -2
  232. package/lib/components/LdGridForm/index.less +7 -7
  233. package/lib/components/LdTree/index.less +42 -42
  234. package/lib/helper/FromItems.js +64 -5
  235. package/lib/helper/action.js +6 -6
  236. package/lib/helper/form.js +14 -14
  237. package/lib/helper/index.less +7 -7
  238. package/lib/helper/ldBuilder.js +4 -4
  239. package/lib/helper/ldComBuild.js +14 -9
  240. package/lib/locales/zh-CN.js +41 -5
  241. package/lib/lowcode/constants/api-url.js +309 -260
  242. package/lib/lowcode/constants/event-topics.js +3 -1
  243. package/lib/lowcode/constants/index.js +6 -5
  244. package/lib/lowcode/engine/meta/components-list.json +12 -6
  245. package/lib/lowcode/engine/meta/fielddate.props.default.json +1 -0
  246. package/lib/lowcode/engine/meta/fielddate.props.json +48 -0
  247. package/lib/lowcode/engine/meta/js-editor/auto-complete.json +35 -30
  248. package/lib/lowcode/engine/meta/proxy.props.default.json +15 -0
  249. package/lib/lowcode/engine/meta/proxy.props.json +66 -0
  250. package/lib/lowcode/engine/provider/ContextProvider/index.js +87 -49
  251. package/lib/lowcode/engine/provider/ContextProvider/usePageDataStore.js +50 -44
  252. package/lib/lowcode/engine/provider/ContextProvider/usePageVar.js +10 -4
  253. package/lib/lowcode/engine/provider/ContextProvider/useTodo.js +1 -3
  254. package/lib/lowcode/engine/provider/EventBusProvider.js +14 -4
  255. package/lib/lowcode/engine/provider/PageProxyProvider.js +103 -0
  256. package/lib/lowcode/engine/provider/RemoteSourceProvider.js +10 -12
  257. package/lib/lowcode/engine/tools/dataProcess.js +76 -76
  258. package/lib/lowcode/engine/tools/helper.js +25 -0
  259. package/lib/lowcode/engine/tools/initDS.js +4 -4
  260. package/lib/lowcode/painter/Components.js +2 -2
  261. package/lib/lowcode/painter/Design.js +1 -0
  262. package/lib/lowcode/painter/DesignOperator.js +126 -24
  263. package/lib/lowcode/painter/DesignToolbar.js +84 -169
  264. package/lib/lowcode/painter/components/AdvancePanel.js +27 -9
  265. package/lib/lowcode/painter/components/Collapse.js +26 -26
  266. package/lib/lowcode/painter/components/ColorInput.js +24 -24
  267. package/lib/lowcode/painter/components/ListEditor.js +24 -24
  268. package/lib/lowcode/painter/components/NumberInput.js +28 -28
  269. package/lib/lowcode/painter/components/PanelItem.js +24 -24
  270. package/lib/lowcode/painter/components/PopConfirm.js +8 -8
  271. package/lib/lowcode/painter/components/PopForm.js +27 -27
  272. package/lib/lowcode/painter/components/RuleInput.js +30 -30
  273. package/lib/lowcode/painter/components/SortBox.js +22 -22
  274. package/lib/lowcode/painter/components/TipIcon.js +12 -4
  275. package/lib/lowcode/painter/components/TreeEditor.js +10 -10
  276. package/lib/lowcode/painter/components/code-editor/BaseEditor.js +32 -32
  277. package/lib/lowcode/painter/components/code-editor/CssEditor.js +25 -25
  278. package/lib/lowcode/painter/components/code-editor/FullScreenEditor.js +23 -23
  279. package/lib/lowcode/painter/components/code-editor/JSEditor.js +20 -20
  280. package/lib/lowcode/painter/components/code-editor/JsonEditor.js +25 -25
  281. package/lib/lowcode/painter/components/field-setting/SettingUI.js +55 -3
  282. package/lib/lowcode/painter/components/field-setting/index.js +24 -1
  283. package/lib/lowcode/painter/components/shortcut-modal/KeyIcon.js +18 -0
  284. package/lib/lowcode/painter/components/shortcut-modal/index.js +215 -0
  285. package/lib/lowcode/painter/panel-section/BlockEditor/index.js +9 -18
  286. package/lib/lowcode/painter/panel-section/BlocksEditor/index.js +4 -1
  287. package/lib/lowcode/painter/panel-section/ConditionCheck.js +0 -1
  288. package/lib/lowcode/painter/panel-section/DataSetSelector.js +6 -3
  289. package/lib/lowcode/painter/panel-section/FieldsSetting.js +1 -1
  290. package/lib/lowcode/painter/panel-section/Icon.js +23 -23
  291. package/lib/lowcode/painter/panel-section/IconConditionSelector.js +2 -1
  292. package/lib/lowcode/painter/panel-section/IconSelector.js +16 -16
  293. package/lib/lowcode/painter/panel-section/JSEditor/ToolBar.js +7 -4
  294. package/lib/lowcode/painter/panel-section/JSEditor/index.js +14 -4
  295. package/lib/lowcode/painter/panel-section/JSEditor/index.less +4 -0
  296. package/lib/lowcode/painter/panel-section/LayoutRatio.js +21 -21
  297. package/lib/lowcode/painter/panel-section/ProxyLinker.js +145 -0
  298. package/lib/lowcode/painter/panel-section/ProxyParams.js +35 -0
  299. package/lib/lowcode/painter/panel-section/ProxyParamsSetter.js +248 -0
  300. package/lib/lowcode/painter/panel-section/StylePanel/BackGround.js +2 -2
  301. package/lib/lowcode/painter/panel-section/StylePanel/Border.js +2 -2
  302. package/lib/lowcode/painter/panel-section/StylePanel/BorderRadius.js +2 -2
  303. package/lib/lowcode/painter/panel-section/StylePanel/BorderRadiusSelector.js +2 -2
  304. package/lib/lowcode/painter/panel-section/StylePanel/BorderSelector.js +2 -2
  305. package/lib/lowcode/painter/panel-section/StylePanel/Display.js +2 -2
  306. package/lib/lowcode/painter/panel-section/StylePanel/Font.js +2 -2
  307. package/lib/lowcode/painter/panel-section/StylePanel/FontEditor.js +2 -2
  308. package/lib/lowcode/painter/panel-section/StylePanel/GapSelector.js +2 -2
  309. package/lib/lowcode/painter/panel-section/StylePanel/HighLightPanel.js +2 -2
  310. package/lib/lowcode/painter/panel-section/StylePanel/HighLigthtSpan.js +2 -2
  311. package/lib/lowcode/painter/panel-section/StylePanel/HightLightSvg.js +2 -2
  312. package/lib/lowcode/painter/panel-section/StylePanel/MainPanel.js +2 -2
  313. package/lib/lowcode/painter/panel-section/StylePanel/Margin.js +2 -2
  314. package/lib/lowcode/painter/panel-section/StylePanel/Opacity.js +2 -2
  315. package/lib/lowcode/painter/panel-section/StylePanel/Padding.js +2 -2
  316. package/lib/lowcode/painter/panel-section/StylePanel/Pointer.js +2 -2
  317. package/lib/lowcode/painter/panel-section/StylePanel/Shadow.js +2 -2
  318. package/lib/lowcode/painter/panel-section/StylePanel/Size.js +2 -2
  319. package/lib/lowcode/painter/panel-section/StylePanel/StyleContext.js +2 -2
  320. package/lib/lowcode/painter/panel-section/StylePanel/StyleRow.js +2 -2
  321. package/lib/lowcode/painter/panel-section/StylePanel/WidthHeight.js +2 -2
  322. package/lib/lowcode/painter/panel-section/StylePanel/index.js +15 -15
  323. package/lib/lowcode/painter/style/action-bind-modal.less +104 -104
  324. package/lib/lowcode/painter/style/actions-editor.less +15 -15
  325. package/lib/lowcode/painter/style/border-editor.less +36 -36
  326. package/lib/lowcode/painter/style/border-radius-selector.less +42 -42
  327. package/lib/lowcode/painter/style/border-selector.less +39 -39
  328. package/lib/lowcode/painter/style/button-type.less +5 -5
  329. package/lib/lowcode/painter/style/collapse.less +28 -28
  330. package/lib/lowcode/painter/style/color-input.less +19 -19
  331. package/lib/lowcode/painter/style/components.less +91 -91
  332. package/lib/lowcode/painter/style/design.less +178 -178
  333. package/lib/lowcode/painter/style/display.less +17 -17
  334. package/lib/lowcode/painter/style/dragdrop.less +56 -56
  335. package/lib/lowcode/painter/style/fields-setting.less +25 -25
  336. package/lib/lowcode/painter/style/font-editor.less +9 -9
  337. package/lib/lowcode/painter/style/fullscreen-editor.less +17 -17
  338. package/lib/lowcode/painter/style/history.less +46 -46
  339. package/lib/lowcode/painter/style/icon-selector.less +22 -22
  340. package/lib/lowcode/painter/style/icon.less +10 -10
  341. package/lib/lowcode/painter/style/impexp.less +7 -7
  342. package/lib/lowcode/painter/style/index.less +6 -6
  343. package/lib/lowcode/painter/style/layout-ratio.less +51 -51
  344. package/lib/lowcode/painter/style/list-editor.less +97 -97
  345. package/lib/lowcode/painter/style/number-input.less +19 -19
  346. package/lib/lowcode/painter/style/outline.less +30 -30
  347. package/lib/lowcode/painter/style/page-layout-display.less +27 -27
  348. package/lib/lowcode/painter/style/page-vars.less +25 -25
  349. package/lib/lowcode/painter/style/panel-attrs.less +47 -47
  350. package/lib/lowcode/painter/style/panel-item.less +55 -54
  351. package/lib/lowcode/painter/style/panel.less +100 -100
  352. package/lib/lowcode/painter/style/pop-confirm.less +17 -17
  353. package/lib/lowcode/painter/style/pop-form.less +19 -19
  354. package/lib/lowcode/painter/style/radio.less +24 -24
  355. package/lib/lowcode/painter/style/ribbon.less +7 -7
  356. package/lib/lowcode/painter/style/rule-input.less +12 -12
  357. package/lib/lowcode/painter/style/split-display.less +18 -18
  358. package/lib/lowcode/painter/style/style-panel.less +37 -37
  359. package/lib/lowcode/painter/style/tabitems.less +90 -90
  360. package/lib/lowcode/painter/svg/code.svg +3 -3
  361. package/lib/lowcode/painter/svg/expect.svg +9 -9
  362. package/lib/lowcode/preview/DebugTool.js +86 -0
  363. package/lib/lowcode/preview/DebugToolDetail.js +111 -0
  364. package/lib/lowcode/preview/index.js +10 -18
  365. package/lib/lowcode/preview/useDebugSettings.js +69 -0
  366. package/lib/lowcode/view/Canvas.js +5 -1
  367. package/lib/lowcode/view/Page.js +8 -3
  368. package/lib/lowcode/view/lc-components/Box/index.js +4 -4
  369. package/lib/lowcode/view/lc-components/Box/index.less +14 -14
  370. package/lib/lowcode/view/lc-components/Box/meta.json +40 -40
  371. package/lib/lowcode/view/lc-components/Button/index.js +33 -33
  372. package/lib/lowcode/view/lc-components/Button/meta.json +127 -127
  373. package/lib/lowcode/view/lc-components/Button/style.less +2 -2
  374. package/lib/lowcode/view/lc-components/CardList/index.js +126 -123
  375. package/lib/lowcode/view/lc-components/CardList/meta.json +332 -332
  376. package/lib/lowcode/view/lc-components/Dialog/index.js +14 -13
  377. package/lib/lowcode/view/lc-components/Dialog/index.less +12 -12
  378. package/lib/lowcode/view/lc-components/Dialog/meta.json +224 -224
  379. package/lib/lowcode/view/lc-components/Drawer/index.js +15 -13
  380. package/lib/lowcode/view/lc-components/Drawer/index.less +13 -13
  381. package/lib/lowcode/view/lc-components/Drawer/meta.json +242 -242
  382. package/lib/lowcode/view/lc-components/FieldColor/meta.json +157 -157
  383. package/lib/lowcode/view/lc-components/FieldComplex/meta.json +140 -140
  384. package/lib/lowcode/view/lc-components/FieldDate/meta.json +188 -140
  385. package/lib/lowcode/view/lc-components/FieldDict/meta.json +138 -138
  386. package/lib/lowcode/view/lc-components/FieldEditor/meta.json +137 -137
  387. package/lib/lowcode/view/lc-components/FieldGroup/meta.json +166 -166
  388. package/lib/lowcode/view/lc-components/FieldNumber/meta.json +143 -143
  389. package/lib/lowcode/view/lc-components/FieldRadio/meta.json +115 -115
  390. package/lib/lowcode/view/lc-components/FieldRegion/meta.json +121 -121
  391. package/lib/lowcode/view/lc-components/FieldSelect/meta.json +152 -152
  392. package/lib/lowcode/view/lc-components/FieldString/meta.json +152 -152
  393. package/lib/lowcode/view/lc-components/FieldSwitch/meta.json +125 -125
  394. package/lib/lowcode/view/lc-components/FieldTextarea/meta.json +143 -143
  395. package/lib/lowcode/view/lc-components/FieldUpload/meta.json +165 -165
  396. package/lib/lowcode/view/lc-components/FieldUser/meta.json +176 -176
  397. package/lib/lowcode/view/lc-components/FieldYear/meta.json +128 -128
  398. package/lib/lowcode/view/lc-components/Form/index.js +23 -20
  399. package/lib/lowcode/view/lc-components/Form/meta.json +629 -629
  400. package/lib/lowcode/view/lc-components/GroupTree/index.js +23 -23
  401. package/lib/lowcode/view/lc-components/GroupTree/index.less +11 -11
  402. package/lib/lowcode/view/lc-components/GroupTree/meta.json +82 -82
  403. package/lib/lowcode/view/lc-components/Iframe/meta.json +31 -31
  404. package/lib/lowcode/view/lc-components/ImEx/index.js +25 -25
  405. package/lib/lowcode/view/lc-components/ImEx/index.less +7 -7
  406. package/lib/lowcode/view/lc-components/ImEx/meta.json +134 -134
  407. package/lib/lowcode/view/lc-components/Image/index.less +27 -27
  408. package/lib/lowcode/view/lc-components/Image/meta.json +149 -149
  409. package/lib/lowcode/view/lc-components/JSX/RuntimeComp.js +4 -4
  410. package/lib/lowcode/view/lc-components/JSX/meta.json +29 -29
  411. package/lib/lowcode/view/lc-components/Layout/index.js +16 -16
  412. package/lib/lowcode/view/lc-components/Layout/index.less +5 -5
  413. package/lib/lowcode/view/lc-components/Layout/meta.json +107 -107
  414. package/lib/lowcode/view/lc-components/Link/index.less +15 -15
  415. package/lib/lowcode/view/lc-components/Link/meta.json +112 -112
  416. package/lib/lowcode/view/lc-components/Page/meta.json +61 -61
  417. package/lib/lowcode/view/lc-components/PageContent/meta.json +9 -9
  418. package/lib/lowcode/view/lc-components/PageFooter/meta.json +9 -9
  419. package/lib/lowcode/view/lc-components/PageHeader/meta.json +9 -9
  420. package/lib/lowcode/view/lc-components/PageLayout/meta.json +59 -59
  421. package/lib/lowcode/view/lc-components/Proxy/FunctionDesign.js +24 -0
  422. package/lib/lowcode/view/lc-components/Proxy/FunctionLive.js +30 -0
  423. package/lib/lowcode/view/lc-components/Proxy/FunctionPreview.js +30 -0
  424. package/lib/lowcode/view/lc-components/Proxy/index.js +50 -0
  425. package/lib/lowcode/view/lc-components/Proxy/index.less +5 -0
  426. package/lib/lowcode/view/lc-components/Proxy/meta.json +66 -0
  427. package/lib/lowcode/view/lc-components/Section/index.less +7 -7
  428. package/lib/lowcode/view/lc-components/Section/meta.json +108 -108
  429. package/lib/lowcode/view/lc-components/Split/meta.json +53 -53
  430. package/lib/lowcode/view/lc-components/Table/index.js +156 -149
  431. package/lib/lowcode/view/lc-components/Table/meta.json +443 -443
  432. package/lib/lowcode/view/lc-components/Tabs/index.js +23 -23
  433. package/lib/lowcode/view/lc-components/Tabs/meta.json +113 -113
  434. package/lib/lowcode/view/lc-components/Text/meta.json +56 -56
  435. package/lib/lowcode/view/lc-components/Tree/index.js +99 -96
  436. package/lib/lowcode/view/lc-components/Tree/index.less +4 -4
  437. package/lib/lowcode/view/lc-components/Tree/meta.json +353 -353
  438. package/lib/lowcode/view/lc-components/Wrapper.js +6 -0
  439. package/lib/lowcode/view/style/canvas.less +5 -5
  440. package/lib/lowcode/view/style/loading.less +98 -98
  441. package/lib/lowcode/view/style/page.less +7 -7
  442. package/lib/upload/FilesWall/index.js +13 -13
  443. package/lib/upload/FilesWall/index.less +74 -74
  444. package/lib/upload/Form/index.less +7 -7
  445. package/lib/upload/FormItem/index.js +15 -15
  446. package/lib/utils/form.js +21 -21
  447. package/lowcode.js +1 -1
  448. package/package.json +175 -175
  449. package/upload.js +1 -1
  450. package/utils.js +1 -1
@@ -7,6 +7,7 @@ import { subscribeWithSelector } from 'zustand/middleware';
7
7
  import { useShallow } from 'zustand/react/shallow';
8
8
  import { isObject, isArray, isNil, isFunction, isString, get, set as _set, unset, assign, forOwn, forEach, omit, debounce } from 'lodash';
9
9
  import isDeepEqual from 'fast-deep-equal';
10
+ import { usePageProxyContext } from "../PageProxyProvider";
10
11
  import { getPathNodesById, findNodeAndParent } from "../../tools/dataProcess";
11
12
  import { LC_BUILDIN_UNIT_KEY } from "../../../constants";
12
13
  var temporalStateCreator = function temporalStateCreator(userSet, userGet, options) {
@@ -141,18 +142,12 @@ var findNode = function findNode(obj, id) {
141
142
  var usePageDataStore = create()(immer(subscribeWithSelector(temporal(function (set) {
142
143
  return {
143
144
  pageData: null,
144
- moduleData: null,
145
145
  needPrompt: false,
146
146
  initialize: function initialize(data) {
147
147
  return set(function (state) {
148
148
  state.pageData = data;
149
149
  });
150
150
  },
151
- initializeModule: function initializeModule(data) {
152
- return set(function (state) {
153
- state.moduleData = data;
154
- });
155
- },
156
151
  reset: function reset(data) {
157
152
  return set(function (state) {
158
153
  state.pageData = data || null;
@@ -258,22 +253,22 @@ export var modifyNode = function modifyNode(id, data) {
258
253
  });
259
254
  };
260
255
 
261
- /**
262
- * 移动页面中的一个节点到另一个位置。
263
- *
264
- * @param {string} sid - 源节点的ID。
265
- * @param {string} tid - 目标节点的ID。
266
- * @param {string} action - 移动类型,可以是 'inside', 'left', 'right' 中的一个。
267
- * @param {string} newid - 新节点的ID,仅在创建新节点时使用。
268
- * @param {Object} json - 新节点的初始属性,仅在创建新节点时使用。
269
- *
270
- * @description
271
- * 此函数会更新页面数据状态,根据提供的动作类型(`action`),将源节点(`sourceNode`)移动到目标节点(`targetNode`)的相应位置。
272
- * - 'inside': 将源节点作为目标节点的子节点。
273
- * - 'left': 将源节点放在目标节点的左边(同一父节点下)。
274
- * - 'right': 将源节点放在目标节点的右边(同一父节点下)。
275
- * 如果 `sid` 是空但提供了 `newid`,则函数会创建一个新的节点。
276
- *
256
+ /**
257
+ * 移动页面中的一个节点到另一个位置。
258
+ *
259
+ * @param {string} sid - 源节点的ID。
260
+ * @param {string} tid - 目标节点的ID。
261
+ * @param {string} action - 移动类型,可以是 'inside', 'left', 'right' 中的一个。
262
+ * @param {string} newid - 新节点的ID,仅在创建新节点时使用。
263
+ * @param {Object} json - 新节点的初始属性,仅在创建新节点时使用。
264
+ *
265
+ * @description
266
+ * 此函数会更新页面数据状态,根据提供的动作类型(`action`),将源节点(`sourceNode`)移动到目标节点(`targetNode`)的相应位置。
267
+ * - 'inside': 将源节点作为目标节点的子节点。
268
+ * - 'left': 将源节点放在目标节点的左边(同一父节点下)。
269
+ * - 'right': 将源节点放在目标节点的右边(同一父节点下)。
270
+ * 如果 `sid` 是空但提供了 `newid`,则函数会创建一个新的节点。
271
+ *
277
272
  */
278
273
  export var moveNode = function moveNode(sid, tid, action, newid, json) {
279
274
  usePageDataStore.setState(function (state) {
@@ -387,30 +382,41 @@ export var useTask = function useTask(type) {
387
382
  }, []);
388
383
  return task;
389
384
  };
390
- export var useGet = function useGet(_) {
391
- var result = usePageDataStore(useShallow(function (state) {
392
- if (isNil(_)) {
393
- return state.pageData;
394
- } else if (isFunction(_)) {
395
- return _(state.pageData);
396
- } else if (isArray(_)) {
397
- return _.map(function (k) {
398
- var _findNode;
399
- return k.includes('.') ? get(state.pageData, k) : (_findNode = findNode(state.pageData, k)) === null || _findNode === void 0 ? void 0 : _findNode.target;
385
+ var getTargetData = function getTargetData(_, source) {
386
+ if (isNil(_)) {
387
+ return source;
388
+ } else if (isFunction(_)) {
389
+ return _(source);
390
+ } else if (isArray(_)) {
391
+ return _.map(function (k) {
392
+ var _findNode;
393
+ return k.includes('.') ? get(source, k) : (_findNode = findNode(source, k)) === null || _findNode === void 0 ? void 0 : _findNode.target;
394
+ });
395
+ } else if (isObject(_) && _.id) {
396
+ var _findNode2;
397
+ var path = _.path;
398
+ var _target = _.id === LC_BUILDIN_UNIT_KEY.PAGE_ROOT ? source : (_findNode2 = findNode(source, _.id)) === null || _findNode2 === void 0 ? void 0 : _findNode2.target;
399
+ if (isNil(path)) {
400
+ return _target;
401
+ } else if (isString(path)) {
402
+ return get(_target, path);
403
+ } else if (isArray(path)) {
404
+ return path.map(function (k) {
405
+ return get(_target, k);
400
406
  });
401
- } else if (isObject(_) && _.id) {
402
- var _findNode2;
403
- var path = _.path;
404
- var _target = _.id === LC_BUILDIN_UNIT_KEY.PAGE_ROOT ? state.pageData : (_findNode2 = findNode(state.pageData, _.id)) === null || _findNode2 === void 0 ? void 0 : _findNode2.target;
405
- return isNil(path) ? _target : get(_target, path);
406
- } else if (isString(_)) {
407
- return get(state.pageData, _);
408
407
  }
409
- }));
410
- return result;
408
+ } else if (isString(_)) {
409
+ return get(state.pageData, _);
410
+ }
411
411
  };
412
- export var getModuleData = function getModuleData() {
413
- return usePageDataStore.getState().moduleData;
412
+ export var useGet = function useGet(_) {
413
+ var ppCtx = usePageProxyContext();
414
+ if (ppCtx !== null && ppCtx !== void 0 && ppCtx.proxyCode) {
415
+ return getTargetData(_, usePageDataStore.getState()[ppCtx.proxyCode]);
416
+ }
417
+ return usePageDataStore(useShallow(function (state) {
418
+ return getTargetData(_, state.pageData);
419
+ }));
414
420
  };
415
421
  export var setNeedPrompt = function setNeedPrompt(_need) {
416
422
  usePageDataStore.setState(function (state) {
@@ -3,18 +3,24 @@ import { useMemoizedFn } from 'ahooks';
3
3
  import { create } from 'zustand';
4
4
  import { immer } from 'zustand/middleware/immer';
5
5
  import { subscribeWithSelector } from 'zustand/middleware';
6
- import { forOwn, isNil, isString, isObject } from 'lodash';
6
+ import { forOwn, isNil, isString, isObject, omit } from 'lodash';
7
7
  export var useStateStore = create()(immer(subscribeWithSelector(function (set) {
8
8
  return {
9
9
  state: {},
10
- initialize: function initialize(init) {
10
+ initialize: function initialize(init, append) {
11
11
  return set(function (store) {
12
- store.state = init;
12
+ if (append) {
13
+ forOwn(init, function (value, key) {
14
+ store.state[key] = value;
15
+ });
16
+ } else {
17
+ store.state = init;
18
+ }
13
19
  });
14
20
  },
15
- clear: function clear() {
21
+ clear: function clear(_vars) {
16
22
  return set(function (store) {
17
- store.state = {};
23
+ store.state = omit(store.state, _vars);
18
24
  });
19
25
  }
20
26
  };
@@ -6,8 +6,7 @@ var _excluded = ["datasetCode"];
6
6
  import { useBoolean, useMemoizedFn } from 'ahooks';
7
7
  import { message } from 'luck-design/antd';
8
8
  import { keys, isNil, isFunction } from 'lodash';
9
- import { getModuleData } from "./usePageDataStore";
10
- import { executeCode } from "../../tools/helper";
9
+ import { executeCode, getLDMetaAttr } from "../../tools/helper";
11
10
  import { fetchCallBehavior } from "../../../constants/api-url";
12
11
  var useTodo = function useTodo() {
13
12
  var _useBoolean = useBoolean(),
@@ -54,8 +53,7 @@ var useTodo = function useTodo() {
54
53
  params = _ref4.params,
55
54
  data = _ref4.data,
56
55
  after = _ref4.after;
57
- var moduleData = getModuleData();
58
- var _moduleCode = moduleCode || moduleData.moduleCode;
56
+ var _moduleCode = moduleCode || getLDMetaAttr('moduleCode');
59
57
  var _dscode = datasetCode || dsCode;
60
58
  if (!_moduleCode || !_dscode) {
61
59
  message.warning('接口重要参数(模块编码或数据集编码)丢失');
@@ -58,7 +58,7 @@ export default (function (_ref) {
58
58
  var _ref4 = _slicedToArray(_ref3, 2),
59
59
  _id = _ref4[0],
60
60
  _subscriber = _ref4[1];
61
- var temp = _subscriber._before ? _subscriber._before(payload) : null;
61
+ var temp = _subscriber._before ? _subscriber._before(payload, _id) : null;
62
62
  if (_subscriber._before && !isPromise(temp)) {
63
63
  console.error('before hook must return a promise');
64
64
  return;
@@ -68,10 +68,10 @@ export default (function (_ref) {
68
68
  if (!flag) return flag;
69
69
  var func = _subscriber._once || _subscriber._on;
70
70
  if (!func) return;
71
- return func(payload);
71
+ return func(payload, _id);
72
72
  }).then(function (flag) {
73
73
  if (flag === false || !_subscriber._after) return;
74
- return _subscriber._after(payload);
74
+ return _subscriber._after(payload, _id);
75
75
  }).finally(function () {
76
76
  if (_subscriber._once) {
77
77
  $unsubscriber(topic, _id);
@@ -85,6 +85,15 @@ export default (function (_ref) {
85
85
  runtime: runtime
86
86
  }, payload));
87
87
  });
88
+ var $publisherOnce = useMemoizedFn(function (topic, payload) {
89
+ return new Promise(function (resolve) {
90
+ event$.emit(_objectSpread({
91
+ topic: topic,
92
+ runtime: runtime
93
+ }, payload));
94
+ $subscriber(topic).once(resolve).watch();
95
+ });
96
+ });
88
97
  var $subscriber = useMemoizedFn(function (topic) {
89
98
  if (!subscriberPool.has(topic)) subscriberPool.set(topic, []);
90
99
  var id = suid();
@@ -104,7 +113,7 @@ export default (function (_ref) {
104
113
  if (!subscriberPool.get(topic).length) {
105
114
  subscriberPool.delete(topic);
106
115
  }
107
- (_subscriber$_off = (_subscriber2 = _subscriber)._off) === null || _subscriber$_off === void 0 || _subscriber$_off.call(_subscriber2);
116
+ (_subscriber$_off = (_subscriber2 = _subscriber)._off) === null || _subscriber$_off === void 0 || _subscriber$_off.call(_subscriber2, _id);
108
117
  _subscriber = null;
109
118
  }
110
119
  });
@@ -113,6 +122,7 @@ export default (function (_ref) {
113
122
  value: {
114
123
  runtime: runtime,
115
124
  $publisher: $publisher,
125
+ $publisherOnce: $publisherOnce,
116
126
  $subscriber: $subscriber,
117
127
  $unsubscriber: $unsubscriber
118
128
  }
@@ -0,0 +1,95 @@
1
+ import React, { createContext, useContext as useReactContext, useEffect } from 'react';
2
+ import { useRequest, useCreation } from 'ahooks';
3
+ import { Empty, Spin } from 'luck-design/antd';
4
+ import { isNil, reduce } from 'lodash';
5
+ import { formatMessage } from '@luck-design-biz/base/utils';
6
+ import { useContext } from "./ContextProvider";
7
+ import usePageDataStore from "./ContextProvider/usePageDataStore";
8
+ import { decompress } from "../tools/dataProcess";
9
+ import { fetchPageData } from "../../constants/api-url";
10
+ export var Context = /*#__PURE__*/createContext(null);
11
+ export var usePageProxyContext = function usePageProxyContext() {
12
+ return useReactContext(Context);
13
+ };
14
+ export default (function (_ref) {
15
+ var children = _ref.children,
16
+ id = _ref.id,
17
+ proxyCode = _ref.proxyCode,
18
+ destroyOnUnmount = _ref.destroyOnUnmount,
19
+ proxyParams = _ref.proxyParams;
20
+ if (isNil(proxyCode)) return /*#__PURE__*/React.createElement(Empty, {
21
+ description: formatMessage({
22
+ id: 'luckda.lowcode.view.lc-component.design.nocode',
23
+ label: '缺少页面代理编码配置'
24
+ })
25
+ });
26
+ var ctx = useContext();
27
+ var _useRequest = useRequest(fetchPageData, {
28
+ defaultParams: [{
29
+ code: proxyCode
30
+ }],
31
+ ready: !usePageDataStore.getState()[proxyCode],
32
+ onFinally: function onFinally() {
33
+ ctx.$publisher(ctx.topics.PAGE_LOAD_MOUNT, {
34
+ proxyCode: proxyCode
35
+ });
36
+ },
37
+ onSuccess: function onSuccess(_ref2) {
38
+ var code = _ref2.code,
39
+ data = _ref2.data,
40
+ list = _ref2.list,
41
+ detail = _ref2.detail;
42
+ if (code === 1) {
43
+ usePageDataStore.setState(function (state) {
44
+ var source = detail[list[0]].source;
45
+ state[proxyCode] = decompress(source);
46
+ });
47
+ }
48
+ }
49
+ }),
50
+ loading = _useRequest.loading;
51
+ useEffect(function () {
52
+ if (usePageDataStore.getState()[proxyCode]) {
53
+ ctx.$publisher(ctx.topics.PAGE_LOAD_MOUNT, {
54
+ proxyCode: proxyCode
55
+ });
56
+ }
57
+ return function () {
58
+ if (destroyOnUnmount) {
59
+ usePageDataStore.setState(function (state) {
60
+ state[proxyCode] = null;
61
+ });
62
+ }
63
+ };
64
+ }, []);
65
+ var _proxyParams = useCreation(function () {
66
+ return reduce(proxyParams, function (ret, param) {
67
+ switch (param.origin) {
68
+ case 'state':
69
+ ret[param.name] = ctx.state[param.value];
70
+ return ret;
71
+ case 'golbal':
72
+ ret[param.name] = ctx.global[param.value];
73
+ return ret;
74
+ case 'url':
75
+ ret[param.name] = ctx.router.getQuery(param.value);
76
+ return ret;
77
+ case 'string':
78
+ case 'num':
79
+ case 'bool':
80
+ default:
81
+ ret[param.name] = param.value;
82
+ return ret;
83
+ }
84
+ }, {});
85
+ }, []);
86
+ return /*#__PURE__*/React.createElement(Context.Provider, {
87
+ value: {
88
+ id: id,
89
+ proxyCode: proxyCode,
90
+ params: _proxyParams
91
+ }
92
+ }, /*#__PURE__*/React.createElement(Spin, {
93
+ spinning: loading
94
+ }, children));
95
+ });
@@ -1,11 +1,13 @@
1
1
  import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
2
  import _regeneratorRuntime from "@babel/runtime/helpers/esm/regeneratorRuntime";
3
+ import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
3
4
  import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
4
5
  import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
5
6
  import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
6
7
  import React, { createContext } from 'react';
7
8
  import { useRequest, useSetState, useAsyncEffect, useMemoizedFn, useCreation, useUnmount } from 'ahooks';
8
9
  import { history } from 'umi';
10
+ import { values } from 'lodash';
9
11
  import launcher from "../launcher";
10
12
  import { LuckDaContext } from "../../../components/Builder";
11
13
  import { doAction as doActionUtils } from "../../../helper/action";
@@ -23,12 +25,10 @@ export default (function (_ref) {
23
25
  var _usePageDataStore = usePageDataStore(function (state) {
24
26
  return {
25
27
  initialize: state.initialize,
26
- initializeModule: state.initializeModule,
27
28
  reset: state.reset
28
29
  };
29
30
  }),
30
31
  initialize = _usePageDataStore.initialize,
31
- initializeModule = _usePageDataStore.initializeModule,
32
32
  reset = _usePageDataStore.reset;
33
33
  var _useTemporalStore = useTemporalStore(function (state) {
34
34
  return {
@@ -70,7 +70,6 @@ export default (function (_ref) {
70
70
  setRemoteSource({
71
71
  module: data
72
72
  });
73
- initializeModule(data);
74
73
  }
75
74
  }
76
75
  }),
@@ -153,7 +152,7 @@ export default (function (_ref) {
153
152
  }),
154
153
  runFetchAllBehaviorExport = _useRequest6.run;
155
154
  useAsyncEffect( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
156
- var fetchPageDataRes, data, list, detail, source;
155
+ var fetchPageDataRes, data, list, detail, source, _pageData;
157
156
  return _regeneratorRuntime().wrap(function _callee$(_context) {
158
157
  while (1) switch (_context.prev = _context.next) {
159
158
  case 0:
@@ -173,16 +172,17 @@ export default (function (_ref) {
173
172
  break;
174
173
  }
175
174
  history.replace('/404');
176
- _context.next = 20;
175
+ _context.next = 21;
177
176
  break;
178
177
  case 9:
179
- source = detail[list[0]].source;
180
178
  setMetaAttrs(META_TAG_NAME, data);
181
- _context.next = 13;
179
+ source = detail[list[0]].source;
180
+ _pageData = decompress(source);
181
+ _context.next = 14;
182
182
  return runFetchModlueData(data.dataModelKey, {
183
- moduleCode: data.moduleCode
183
+ moduleCode: [data.moduleCode].concat(_toConsumableArray(values(_pageData.props.proxy))).join(',')
184
184
  });
185
- case 13:
185
+ case 14:
186
186
  runFetchAllBehaviorImport({
187
187
  behaviorMode: 'IMPORT',
188
188
  moduleCode: data.moduleCode
@@ -197,11 +197,9 @@ export default (function (_ref) {
197
197
  runFetchAllSerials({
198
198
  uid: data.moduleId
199
199
  });
200
- initialize(decompress(source));
200
+ initialize(_pageData);
201
201
  resume();
202
202
  eventBus.$publisher(PAGE_LOAD_MOUNT);
203
- case 20:
204
- ;
205
203
  case 21:
206
204
  case "end":
207
205
  return _context.stop();
@@ -5,10 +5,10 @@ import _typeof from "@babel/runtime/helpers/esm/typeof";
5
5
  import * as LZString from 'lz-string';
6
6
  import { LC_BUILDIN_UNIT_KEY } from "../../constants";
7
7
 
8
- /**
9
- * 数据压缩
10
- * @param {JSON} data
11
- * @returns 加密后的字符串
8
+ /**
9
+ * 数据压缩
10
+ * @param {JSON} data
11
+ * @returns 加密后的字符串
12
12
  */
13
13
  export function compress(data) {
14
14
  // 将对象转换为JSON字符串
@@ -17,10 +17,10 @@ export function compress(data) {
17
17
  return LZString.compressToBase64(jsonString);
18
18
  }
19
19
 
20
- /**
21
- * 数据解压
22
- * @param {string} compressedData
23
- * @returns {json}
20
+ /**
21
+ * 数据解压
22
+ * @param {string} compressedData
23
+ * @returns {json}
24
24
  */
25
25
  export function decompress(compressedData) {
26
26
  // 使用LZ-String解压数据
@@ -29,13 +29,13 @@ export function decompress(compressedData) {
29
29
  return JSON.parse(jsonString);
30
30
  }
31
31
 
32
- /**
33
- * 查找指定ID的节点及其父节点。
34
- *
35
- * @param {string} id - 要查找的节点ID。
36
- * @param {Object} current - 当前遍历的JSON对象。
37
- * @param {Object|null} parent - 当前节点的父节点。
38
- * @returns {{node: Object|null, parent: Object|null}} 查找结果,包含节点和其父节点。
32
+ /**
33
+ * 查找指定ID的节点及其父节点。
34
+ *
35
+ * @param {string} id - 要查找的节点ID。
36
+ * @param {Object} current - 当前遍历的JSON对象。
37
+ * @param {Object|null} parent - 当前节点的父节点。
38
+ * @returns {{node: Object|null, parent: Object|null}} 查找结果,包含节点和其父节点。
39
39
  */
40
40
  export function findNodeAndParent(id, current) {
41
41
  var parent = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
@@ -69,13 +69,13 @@ export function findNodeAndParent(id, current) {
69
69
  };
70
70
  }
71
71
 
72
- /**
73
- * 对指定的JSON结构进行节点的添加、修改或删除操作。
74
- *
75
- * @param {Object} json - 要操作的JSON对象。
76
- * @param {string|null} path - 要操作的节点路径,使用'/'分隔。
77
- * @param {string} id - 操作节点的唯一标识符。
78
- * @param {Object|null} data - 要添加或修改的数据。如果为null,表示删除操作。
72
+ /**
73
+ * 对指定的JSON结构进行节点的添加、修改或删除操作。
74
+ *
75
+ * @param {Object} json - 要操作的JSON对象。
76
+ * @param {string|null} path - 要操作的节点路径,使用'/'分隔。
77
+ * @param {string} id - 操作节点的唯一标识符。
78
+ * @param {Object|null} data - 要添加或修改的数据。如果为null,表示删除操作。
79
79
  */
80
80
  function process(json, path, id, data) {
81
81
  if (!json) {
@@ -141,25 +141,25 @@ function process(json, path, id, data) {
141
141
  }
142
142
  }
143
143
 
144
- /**
145
- * 对指定的JSON结构进行节点的添加操作。
146
- *
147
- * @param {Object} json - 要操作的JSON对象。
148
- * @param {string} parentId - 父节点的唯一标识符。
149
- * @param {string} id - 操作节点的唯一标识符。
150
- * @param {Object|null} data - 要添加或修改的数据。如果为null,表示删除操作。
144
+ /**
145
+ * 对指定的JSON结构进行节点的添加操作。
146
+ *
147
+ * @param {Object} json - 要操作的JSON对象。
148
+ * @param {string} parentId - 父节点的唯一标识符。
149
+ * @param {string} id - 操作节点的唯一标识符。
150
+ * @param {Object|null} data - 要添加或修改的数据。如果为null,表示删除操作。
151
151
  */
152
152
  export function add(json, parentId, id, data) {
153
153
  process(json, getPathById(json, parentId), id, data);
154
154
  }
155
155
 
156
- /**
157
- * 移动指定的节点到另一个节点的指定位置。
158
- *
159
- * @param {Object} json - 要操作的JSON对象。
160
- * @param {string} sid - 被移动的节点id
161
- * @param {string} tid - 目标节点id
162
- * @param {string} action - 'left': 往节点前面插入,'right':往节点后面插,'inside':往节点子节点插
156
+ /**
157
+ * 移动指定的节点到另一个节点的指定位置。
158
+ *
159
+ * @param {Object} json - 要操作的JSON对象。
160
+ * @param {string} sid - 被移动的节点id
161
+ * @param {string} tid - 目标节点id
162
+ * @param {string} action - 'left': 往节点前面插入,'right':往节点后面插,'inside':往节点子节点插
163
163
  */
164
164
  export function move(json, sid, tid, action) {
165
165
  // 验证节点存在性
@@ -215,34 +215,34 @@ export function move(json, sid, tid, action) {
215
215
  }
216
216
  }
217
217
 
218
- /**
219
- * 对指定的JSON结构进行节点的修改操作。
220
- *
221
- * @param {Object} json - 要操作的JSON对象。
222
- * @param {string} id - 操作节点的唯一标识符。
223
- * @param {Object|null} data - 要添加或修改的数据。如果为null,表示删除操作。
218
+ /**
219
+ * 对指定的JSON结构进行节点的修改操作。
220
+ *
221
+ * @param {Object} json - 要操作的JSON对象。
222
+ * @param {string} id - 操作节点的唯一标识符。
223
+ * @param {Object|null} data - 要添加或修改的数据。如果为null,表示删除操作。
224
224
  */
225
225
  export function modifyById(json, id, data) {
226
226
  process(json, null, id, data);
227
227
  }
228
228
 
229
- /**
230
- * 删除指定id的节点。
231
- *
232
- * @param {Object} json - JSON对象。
233
- * @param {string} id - 要删除的节点ID。
229
+ /**
230
+ * 删除指定id的节点。
231
+ *
232
+ * @param {Object} json - JSON对象。
233
+ * @param {string} id - 要删除的节点ID。
234
234
  */
235
235
  export function deleteById(json, id) {
236
236
  process(json, null, id);
237
237
  }
238
238
 
239
- /**
240
- * 根据ID在给定的JSON结构中查找节点的路径。
241
- *
242
- * @param {Object} json - 要搜索的JSON对象。
243
- * @param {string} id - 要查找的节点ID。
244
- * @param {string} currentPath - 当前递归到的路径,用于构建返回的路径字符串。
245
- * @returns {string|null} 如果找到节点,返回节点的路径;否则返回null。
239
+ /**
240
+ * 根据ID在给定的JSON结构中查找节点的路径。
241
+ *
242
+ * @param {Object} json - 要搜索的JSON对象。
243
+ * @param {string} id - 要查找的节点ID。
244
+ * @param {string} currentPath - 当前递归到的路径,用于构建返回的路径字符串。
245
+ * @returns {string|null} 如果找到节点,返回节点的路径;否则返回null。
246
246
  */
247
247
  export function getPathById(json, id) {
248
248
  var currentPath = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
@@ -262,28 +262,28 @@ export function getPathById(json, id) {
262
262
  return null;
263
263
  }
264
264
 
265
- /**
266
- * 在给定的JSON结构中搜索具有特定id的节点,并返回包含该节点及其所有父节点的props属性的路径数组。
267
- *
268
- * @param {Object} data - 待搜索的JSON对象,它代表了一个复杂的树状结构,每个节点都可能有props和children属性。
269
- * @param {string} targetId - 需要找到的目标节点的id。
270
- * @returns {Array<Object>} 一个包含目标节点及其所有父节点的props属性的数组。如果未找到目标节点,则返回空数组。
271
- *
272
- * @example
273
- * const data = {
274
- * props: {
275
- * id: 'page_root',
276
- * type: 'Page',
277
- * name: '页面',
278
- * hasHeder: true,
279
- * hasFooter: true,
280
- * },
281
- * // ...其他节点
282
- * };
283
- *
284
- * const path = getPathNodesById(data, 'form_jknbjkun');
285
- * console.log(path);
286
- * // 输出目标节点及其所有父节点的props属性的数组
265
+ /**
266
+ * 在给定的JSON结构中搜索具有特定id的节点,并返回包含该节点及其所有父节点的props属性的路径数组。
267
+ *
268
+ * @param {Object} data - 待搜索的JSON对象,它代表了一个复杂的树状结构,每个节点都可能有props和children属性。
269
+ * @param {string} targetId - 需要找到的目标节点的id。
270
+ * @returns {Array<Object>} 一个包含目标节点及其所有父节点的props属性的数组。如果未找到目标节点,则返回空数组。
271
+ *
272
+ * @example
273
+ * const data = {
274
+ * props: {
275
+ * id: 'page_root',
276
+ * type: 'Page',
277
+ * name: '页面',
278
+ * hasHeder: true,
279
+ * hasFooter: true,
280
+ * },
281
+ * // ...其他节点
282
+ * };
283
+ *
284
+ * const path = getPathNodesById(data, 'form_jknbjkun');
285
+ * console.log(path);
286
+ * // 输出目标节点及其所有父节点的props属性的数组
287
287
  */
288
288
  export function getPathNodesById(data, targetId) {
289
289
  // 初始化结果数组
@@ -3,7 +3,7 @@ import _construct from "@babel/runtime/helpers/esm/construct";
3
3
  import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
4
4
  import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
5
5
  import _typeof from "@babel/runtime/helpers/esm/typeof";
6
- import { omit, isNil, isString, isArray, has, get } from 'lodash';
6
+ import { omit, isNil, isString, isArray, has, get, cloneDeep, groupBy, keyBy, each } from 'lodash';
7
7
  import postcss from 'postcss';
8
8
  import { META_TAG_NAME } from "../../constants";
9
9
  export function isPromise(value) {
@@ -262,4 +262,28 @@ export function findFirstLeafNode(node) {
262
262
  _iterator2.f();
263
263
  }
264
264
  return null;
265
+ }
266
+ export function dataToTree(data, params) {
267
+ var _ref = params || {},
268
+ _ref$parentKey = _ref.parentKey,
269
+ parentKey = _ref$parentKey === void 0 ? 'parentId' : _ref$parentKey,
270
+ _ref$childKey = _ref.childKey,
271
+ childKey = _ref$childKey === void 0 ? 'children' : _ref$childKey,
272
+ _ref$rootId = _ref.rootId,
273
+ rootId = _ref$rootId === void 0 ? '0' : _ref$rootId,
274
+ _ref$id = _ref.id,
275
+ id = _ref$id === void 0 ? 'id' : _ref$id,
276
+ _ref$stain = _ref.stain,
277
+ stain = _ref$stain === void 0 ? false : _ref$stain;
278
+ var _data = stain ? data : cloneDeep(data);
279
+ var groupedByParents = groupBy(_data, parentKey);
280
+ var itemsById = keyBy(_data, id);
281
+ try {
282
+ each(omit(groupedByParents, rootId), function (children, parentId) {
283
+ itemsById[parentId][childKey] = children;
284
+ });
285
+ } catch (e) {
286
+ console.error('helper.dataToTree error', e);
287
+ }
288
+ return groupedByParents[rootId];
265
289
  }