@nuraly/runtime 0.1.7 → 0.1.8

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 (349) hide show
  1. package/README.md +83 -765
  2. package/components/ui/components/Event/EventValue/EventValue.ts +13 -8
  3. package/components/ui/components/ToastContainer/ToastContainer.ts +1 -1
  4. package/components/ui/components/advanced/AIChat/AIChat.ts +1 -2
  5. package/components/ui/components/advanced/Collapse/Collapse.ts +5 -2
  6. package/components/ui/components/advanced/Collections/Collections.ts +2 -2
  7. package/components/ui/components/advanced/MicroApp/MicroApp.ts +3 -11
  8. package/components/ui/components/advanced/RefComponent/RefComponent.ts +2 -2
  9. package/components/ui/components/advanced/RichText/RichText.ts +5 -4
  10. package/components/ui/components/advanced/RichText/RichTextEditor.ts +0 -167
  11. package/components/ui/components/base/BaseElement/base-change-detection.ts +1 -5
  12. package/components/ui/components/base/BaseElement.ts +229 -610
  13. package/components/ui/components/base/FormRegisterable.ts +83 -0
  14. package/components/ui/components/base/controllers/DragDropController.ts +175 -0
  15. package/components/ui/components/base/controllers/ErrorController.ts +180 -0
  16. package/components/ui/components/base/controllers/EventController.ts +112 -0
  17. package/components/ui/components/base/controllers/InputHandlerController.ts +298 -0
  18. package/components/ui/components/base/controllers/SelectionController.ts +323 -0
  19. package/components/ui/components/base/controllers/StyleHandlerController.ts +286 -0
  20. package/components/ui/components/base/controllers/index.ts +11 -0
  21. package/components/ui/components/base/mixins/EditorModeMixin.ts +185 -0
  22. package/components/ui/components/base/mixins/index.ts +6 -0
  23. package/components/ui/components/base/types/base-element.types.ts +138 -0
  24. package/components/ui/components/base/types/index.ts +21 -0
  25. package/components/ui/components/base/utils/event-debouncer.ts +209 -0
  26. package/components/ui/components/base/utils/index.ts +11 -0
  27. package/components/ui/components/base/utils/style-cache.ts +94 -0
  28. package/components/ui/components/display/BoxModel/BoxModel.ts +177 -116
  29. package/components/ui/components/display/Code/Code.ts +40 -26
  30. package/components/ui/components/display/Divider/Divider.ts +2 -2
  31. package/components/ui/components/display/Icon/Icon.ts +2 -3
  32. package/components/ui/components/display/Image/Image.ts +72 -46
  33. package/components/ui/components/display/Tag/Tag.ts +2 -3
  34. package/components/ui/components/display/Video/Video.ts +91 -31
  35. package/components/ui/components/inputs/Button/Button.ts +2 -2
  36. package/components/ui/components/inputs/Checkbox/Checkbox.ts +14 -40
  37. package/components/ui/components/inputs/ColorPicker/colorpicker.ts +3 -4
  38. package/components/ui/components/inputs/DatePicker/DatePicker.ts +47 -25
  39. package/components/ui/components/inputs/Dropdown/Dropdown.ts +2 -2
  40. package/components/ui/components/inputs/Form/Form.style.ts +26 -0
  41. package/components/ui/components/inputs/Form/Form.ts +352 -0
  42. package/components/ui/components/inputs/IconPicker/IconPicker.ts +22 -18
  43. package/components/ui/components/inputs/InsertDropdown/InsertDropdown.ts +0 -20
  44. package/components/ui/components/inputs/NumberInput/NumberInput.ts +0 -4
  45. package/components/ui/components/inputs/RadioButton/Radio-button.ts +11 -13
  46. package/components/ui/components/inputs/Select/Select.ts +38 -24
  47. package/components/ui/components/inputs/TextInput/TextInput.ts +15 -9
  48. package/components/ui/components/inputs/Textarea/Textarea.ts +30 -30
  49. package/components/ui/components/inputs/UsersDropdown/UsersDropdown.ts +1 -1
  50. package/components/ui/components/layout/Card/Card.ts +112 -10
  51. package/components/ui/components/layout/Containers/Container.style.ts +18 -0
  52. package/components/ui/components/layout/Containers/Container.ts +11 -5
  53. package/components/ui/components/layout/Grid/Col.style.ts +27 -0
  54. package/components/ui/components/layout/Grid/Col.ts +209 -0
  55. package/components/ui/components/layout/Grid/Row.style.ts +73 -0
  56. package/components/ui/components/layout/Grid/Row.ts +166 -0
  57. package/components/ui/components/layout/Grid/index.ts +7 -0
  58. package/components/ui/components/layout/Panel/Panel.ts +2 -2
  59. package/components/ui/components/layout/Tabs/Tabs.ts +0 -1
  60. package/components/ui/components/navigation/EmbedURL/EmbedURL.ts +62 -26
  61. package/components/ui/components/navigation/Link/Link.ts +27 -16
  62. package/components/ui/components/navigation/Menu/Menu.ts +26 -48
  63. package/components/ui/components/runtime/MicroApp/MicroApp.ts +7 -147
  64. package/components/ui/components/runtime/MicroApp/MicroAppDataLoader.ts +6 -2
  65. package/components/ui/components/studio/FunctionsPanel/FunctionsPanel.ts +472 -0
  66. package/components/ui/components/studio/FunctionsPanel/index.ts +1 -0
  67. package/components/ui/components/utility/AccessRoles/AccessRoles.style.ts +242 -0
  68. package/components/ui/components/utility/AccessRoles/AccessRoles.ts +476 -0
  69. package/components/ui/components/utility/Border/Border.ts +0 -14
  70. package/components/ui/components/utility/BorderManager/BorderManager.style.ts +237 -0
  71. package/components/ui/components/utility/BorderManager/BorderManager.ts +503 -0
  72. package/components/ui/components/utility/BoxShadow/BoxShadow.ts +0 -16
  73. package/components/ui/components/utility/Document/Document.ts +54 -25
  74. package/components/ui/components/utility/Export-Import/Export-Import.ts +8 -7
  75. package/components/ui/components/utility/Handlers/Handlers.ts +14 -17
  76. package/components/ui/components/utility/ValidationRules/ValidationRules.ts +440 -0
  77. package/components/ui/components/wrappers/GenerikWrapper/DragWrapper/DragWrapper.ts +1 -0
  78. package/components/ui/components/wrappers/GenerikWrapper/GenerikWrapper.ts +1 -24
  79. package/components/ui/nuraly-ui/src/components/badge/badge.style.ts +4 -3
  80. package/components/ui/nuraly-ui/src/components/datepicker/datepicker.component.ts +2 -0
  81. package/components/ui/nuraly-ui/src/components/radio-group/radio-group.component.ts +12 -6
  82. package/components/ui/nuraly-ui/src/components/radio-group/radio-group.style.ts +23 -0
  83. package/dist/{index-B4yIOSMd.js → BaseElement-BNBn_IJk.js} +2920 -267
  84. package/dist/{CodeEditor-YsOapSut.js → CodeEditor-Bf4L2rO_.js} +84127 -76319
  85. package/dist/{CodeEditor-BiNku87K.js → CodeEditor-Cpph-xRc.js} +7 -7
  86. package/dist/{abap-B2diVmjb.js → abap-D0Neqhq6.js} +91 -1
  87. package/dist/{apex-3NuJ-nsI.js → apex-B5LhxkeG.js} +18 -1
  88. package/dist/assets/editor.worker-DcwbJ0PV.js +12 -0
  89. package/dist/assets/html.worker-BTMxskjR.js +461 -0
  90. package/dist/assets/json.worker-D3vTGdf_.js +49 -0
  91. package/dist/assets/ts.worker-BsM1BXac.js +51334 -0
  92. package/dist/{azcli-XGXuUsMB.js → azcli-BrBH0QTU.js} +1 -1
  93. package/dist/{bat-B8Vhm634.js → bat-BfzAov64.js} +12 -1
  94. package/dist/{bicep-Cc8X5S_k.js → bicep-C3bCSWel.js} +1 -1
  95. package/dist/{cameligo-Bo3wBh9T.js → cameligo-sFL5plcd.js} +13 -1
  96. package/dist/{clojure-CPoQlpIK.js → clojure-CfeExRz0.js} +14 -1
  97. package/dist/{coffee-BxvTGz39.js → coffee-Xws5K0WL.js} +11 -1
  98. package/dist/{cpp-5RpEV7vC.js → cpp-CqOUEpxN.js} +28 -23
  99. package/dist/{csharp-slXXP3fo.js → csharp-DVLiBOZb.js} +13 -1
  100. package/dist/{csp-B98p6-gH.js → csp-DVFp9bw5.js} +3 -1
  101. package/dist/{css-BDsDSAin.js → css-DwARn2R6.js} +8 -1
  102. package/dist/cssMode-DMsdy1N0.js +1577 -0
  103. package/dist/{cypher-Dc4IMouD.js → cypher-uY0Mffat.js} +8 -1
  104. package/dist/{dart-LhvE3yD2.js → dart-D27H-mX_.js} +18 -1
  105. package/dist/{dockerfile-CwzplJeZ.js → dockerfile-CmV85WZK.js} +5 -1
  106. package/dist/{ecl-DxW3FiJi.js → ecl--fKn7yzB.js} +9 -1
  107. package/dist/{elixir-BI40g7TU.js → elixir-DUhH17ON.js} +87 -1
  108. package/dist/{flow9-tR2v0bGz.js → flow9-B3Dx2LLe.js} +8 -1
  109. package/dist/{freemarker2-Bfqhwyij.js → freemarker2-D51H9HYi.js} +359 -7
  110. package/dist/{fsharp-BLAma0OT.js → fsharp-SyqBfUAR.js} +14 -1
  111. package/dist/{go-nYcD3y4Z.js → go-BbMR2tdT.js} +17 -1
  112. package/dist/{graphql-Dp1cHWmP.js → graphql-DDJE6tIl.js} +17 -1
  113. package/dist/{handlebars-DCgKNBmn.js → handlebars-CF6gdAX4.js} +38 -4
  114. package/dist/{hcl-6NT8Kbna.js → hcl-YBvpaUqf.js} +13 -1
  115. package/dist/{html-C6wR7sMB.js → html-c2n_zkM3.js} +37 -4
  116. package/dist/htmlMode-9IJTuZUh.js +1587 -0
  117. package/dist/{ini-BZCOLrEc.js → ini-Ct73dBtM.js} +10 -1
  118. package/dist/{java-DAMcfJbX.js → java-C_jlkwoG.js} +18 -1
  119. package/dist/{javascript-D1L5MTmg.js → javascript-DhEEBMxD.js} +3 -2
  120. package/dist/jsonMode-CB6k-4rp.js +2002 -0
  121. package/dist/{julia-CQ46G71H.js → julia-D8WE5U1e.js} +22 -1
  122. package/dist/{kotlin-CEjVo_6E.js → kotlin-Zy9aq5yB.js} +15 -1
  123. package/dist/{less-DreV99nP.js → less-sZ0iHtE8.js} +1 -1
  124. package/dist/{lexon-DBVJhqLb.js → lexon-CsdNL29A.js} +13 -1
  125. package/dist/{liquid-D_pDYIs1.js → liquid-CwtPiwnW.js} +12 -4
  126. package/dist/{lua-Dcc_j6L-.js → lua-C2YJo0zw.js} +12 -1
  127. package/dist/{m3-B9SlZL4n.js → m3-CPLP40SG.js} +7 -1
  128. package/dist/{markdown-CuGw9_MP.js → markdown-B1mf5e0R.js} +34 -1
  129. package/dist/{mdx-CKsJ3cF4.js → mdx-LewPRYF8.js} +2 -2
  130. package/dist/{micro-app-entry-xdTX5-ut.js → micro-app-entry-C3RDIukG.js} +8082 -9628
  131. package/dist/micro-app.bundle.js +3 -3
  132. package/dist/micro-app.js +3585 -6759
  133. package/dist/{mips-BUWqP-OH.js → mips-DA33BZX1.js} +11 -1
  134. package/dist/{msdax-DtkouYCg.js → msdax-CCYFIQsP.js} +5 -1
  135. package/dist/{mysql-IkAsWSmF.js → mysql-hjmIjL-D.js} +11 -3
  136. package/dist/{objective-c-B2-ronfg.js → objective-c-RRCpEmqC.js} +2 -1
  137. package/dist/{pascal-Bsnz2eJA.js → pascal-CeV8XfxB.js} +13 -1
  138. package/dist/{pascaligo-D_sMUn0Q.js → pascaligo-IEEGVJAJ.js} +13 -1
  139. package/dist/{perl-BPzHt9SS.js → perl-B5-QbHq_.js} +34 -1
  140. package/dist/{pgsql-DlTJB0PD.js → pgsql-s6kqEJmi.js} +14 -4
  141. package/dist/{php-Dmq5OjwK.js → php-CWWqzOo8.js} +36 -1
  142. package/dist/{pla-HJcccrBy.js → pla-FSvb_YP_.js} +13 -1
  143. package/dist/{postiats-OQn6DKv-.js → postiats-DQdscQXO.js} +370 -1
  144. package/dist/{powerquery-DKaMYC8w.js → powerquery-CtA5JA1I.js} +7 -1
  145. package/dist/{powershell-DWeJHik1.js → powershell-DglEq96N.js} +13 -1
  146. package/dist/{protobuf-CBn_IseU.js → protobuf-BSepub3e.js} +5 -1
  147. package/dist/{pug-BoRpCINl.js → pug-B1847F4G.js} +16 -1
  148. package/dist/{python-zPpZYwLF.js → python-h5Z2g-yl.js} +59 -11
  149. package/dist/{qsharp-4rGyVZOw.js → qsharp-D4i0Nqg9.js} +28 -3
  150. package/dist/{r-DsgLhBOb.js → r-cdRigKxa.js} +5 -1
  151. package/dist/{razor-B_fCUeGX.js → razor-D5ep1Doy.js} +48 -4
  152. package/dist/{redis-B2fdL4Bg.js → redis-D9MFxvE8.js} +16 -6
  153. package/dist/{redshift-DoaeyCkH.js → redshift-CmCnsvL-.js} +13 -4
  154. package/dist/{restructuredtext-D-6OFBY9.js → restructuredtext-CWy8J51t.js} +19 -1
  155. package/dist/{ruby-D1DD6baV.js → ruby-WP-c36m5.js} +76 -3
  156. package/dist/runtime.js +34 -45
  157. package/dist/{rust-DssUV39M.js → rust-Q9FLdYpu.js} +13 -1
  158. package/dist/{sb-Dmb6tAdv.js → sb-C54-JBGT.js} +12 -1
  159. package/dist/{scala-Co3ETaym.js → scala-CzbFImc5.js} +24 -1
  160. package/dist/{scheme-CMrqXTty.js → scheme-BhfDmYN3.js} +1 -1
  161. package/dist/{scss-DkGudv8Q.js → scss-CEmiBXpS.js} +25 -1
  162. package/dist/{shell-BHN2BI4L.js → shell-Bmc1VhG0.js} +4 -1
  163. package/dist/{solidity-b-R-raGB.js → solidity-C9Q2I8Hh.js} +23 -1
  164. package/dist/{sophia-Y4GjyxNB.js → sophia-jWa1UyKz.js} +16 -1
  165. package/dist/{sparql-CDAPZb88.js → sparql-CM7jctbc.js} +15 -1
  166. package/dist/{sql-DkkpPiUq.js → sql-WzihTkbg.js} +42 -1
  167. package/dist/{st-CSPV91Ej.js → st-6y7_3aup.js} +8 -1
  168. package/dist/style.css +1 -1
  169. package/dist/{swift-DdSC5O48.js → swift-k-0zxG_D.js} +4 -1
  170. package/dist/{systemverilog-CI03XpAv.js → systemverilog-Pnr5_rIP.js} +29 -3
  171. package/dist/{tcl-B8DayMSI.js → tcl-fNPXval8.js} +7 -1
  172. package/dist/tsMode-B_6LiBE1.js +976 -0
  173. package/dist/{twig-B1AUPVB_.js → twig-L2MkztkV.js} +76 -1
  174. package/dist/{typescript-DrlYcCUn.js → typescript-BBG0jH4p.js} +23 -2
  175. package/dist/typespec-Cqqo-3Pt.js +123 -0
  176. package/dist/{vb-BIC7ccdG.js → vb-B5YC2xN9.js} +15 -1
  177. package/dist/{wgsl-C9yjop46.js → wgsl-D9BRtftY.js} +26 -1
  178. package/dist/{xml-BzP9D0eZ.js → xml-DgLB7rE6.js} +8 -2
  179. package/dist/{yaml-CT7GOvXu.js → yaml-DiI4HpSv.js} +30 -2
  180. package/handlers/compiler.ts +196 -16
  181. package/handlers/context-setup.ts +10 -5
  182. package/handlers/handler-api-factory.ts +358 -0
  183. package/handlers/handler-api.ts +379 -0
  184. package/handlers/handler-executor.ts +25 -5
  185. package/handlers/handler-scope.ts +398 -0
  186. package/handlers/index.ts +34 -2
  187. package/handlers/runtime-api/component-properties.ts +0 -8
  188. package/handlers/runtime-api/index.ts +1 -1
  189. package/handlers/runtime-api/toast.ts +1 -1
  190. package/index.ts +14 -115
  191. package/micro-app/README.md +10 -10
  192. package/micro-app/state/MicroAppRuntimeContext.ts +1 -28
  193. package/micro-app-entry.ts +0 -5
  194. package/package.json +19 -1
  195. package/redux/actions/application/index.ts +0 -1
  196. package/redux/actions/component/addComponentAction.ts +15 -4
  197. package/redux/actions/component/moveDraggedComponent.ts +1 -2
  198. package/redux/actions/component/update-component-name.ts +1 -1
  199. package/redux/actions/component/updateComponentAttributes.ts +7 -2
  200. package/redux/handlers/functions/build-function-handler.ts +11 -3
  201. package/redux/handlers/functions/deploy-function-handler.ts +11 -3
  202. package/redux/handlers/functions/invoke-function-handler.ts +11 -3
  203. package/redux/handlers/functions/load-functions-handler.ts +2 -1
  204. package/redux/handlers/functions/update-function-handler.ts +2 -1
  205. package/redux/store/component/component.interface.ts +8 -2
  206. package/redux/store/component/store.ts +1 -4
  207. package/state/runtime-context.ts +1 -23
  208. package/utils/RuntimeContextHelpers.ts +221 -90
  209. package/utils/change-detection.ts +125 -1
  210. package/utils/clipboard-utils.ts +18 -8
  211. package/utils/component-registry.ts +118 -0
  212. package/utils/index.ts +14 -1
  213. package/utils/naming-generator.ts +3 -1
  214. package/utils/randomness.ts +3 -1
  215. package/utils/register-components.ts +21 -29
  216. package/utils/render-util.ts +27 -48
  217. package/utils/toast.ts +97 -0
  218. package/vite.config.ts +29 -12
  219. package/components/ui/components/Event/EventAttribute/EventAttribute.style.ts +0 -11
  220. package/components/ui/components/Event/EventAttribute/EventAttribute.ts +0 -28
  221. package/components/ui/components/base/BaseElement/calculateStyles.ts +0 -31
  222. package/components/ui/components/base/BaseElement/drag-events.helpers.ts +0 -71
  223. package/components/ui/components/base/BaseElement/execute-event.helpers.ts +0 -45
  224. package/components/ui/components/base/BaseElement/interactions.helpers.ts +0 -14
  225. package/components/ui/components/wrappers/ComponentTitle/ComponentTitle.ts +0 -95
  226. package/components/ui/components/wrappers/GenerikWrapper/ResizeWrapper/ResizeWrapper.style.ts +0 -102
  227. package/components/ui/components/wrappers/GenerikWrapper/ResizeWrapper/ResizeWrapper.ts +0 -258
  228. package/components/ui/components/wrappers/PreviewWrapper.ts +0 -28
  229. package/components/ui/components/wrappers/RectangleSelection/RectangleSelection.ts +0 -154
  230. package/components/ui/nuraly-ui/packages/common/dist/constants/index.d.ts +0 -2
  231. package/components/ui/nuraly-ui/packages/common/dist/constants/index.js +0 -2
  232. package/components/ui/nuraly-ui/packages/common/dist/constants.d.ts +0 -17
  233. package/components/ui/nuraly-ui/packages/common/dist/constants.js +0 -7
  234. package/components/ui/nuraly-ui/packages/common/dist/controllers/index.d.ts +0 -2
  235. package/components/ui/nuraly-ui/packages/common/dist/controllers/index.js +0 -2
  236. package/components/ui/nuraly-ui/packages/common/dist/controllers.d.ts +0 -21
  237. package/components/ui/nuraly-ui/packages/common/dist/controllers.js +0 -22
  238. package/components/ui/nuraly-ui/packages/common/dist/index.d.ts +0 -25
  239. package/components/ui/nuraly-ui/packages/common/dist/index.js +0 -27
  240. package/components/ui/nuraly-ui/packages/common/dist/mixins/index.d.ts +0 -2
  241. package/components/ui/nuraly-ui/packages/common/dist/mixins/index.js +0 -3
  242. package/components/ui/nuraly-ui/packages/common/dist/mixins.d.ts +0 -26
  243. package/components/ui/nuraly-ui/packages/common/dist/mixins.js +0 -29
  244. package/components/ui/nuraly-ui/packages/common/dist/shared/base-mixin.d.ts +0 -42
  245. package/components/ui/nuraly-ui/packages/common/dist/shared/base-mixin.js +0 -38
  246. package/components/ui/nuraly-ui/packages/common/dist/shared/constants.d.ts +0 -1
  247. package/components/ui/nuraly-ui/packages/common/dist/shared/constants.js +0 -2
  248. package/components/ui/nuraly-ui/packages/common/dist/shared/controllers/dropdown.controller.d.ts +0 -77
  249. package/components/ui/nuraly-ui/packages/common/dist/shared/controllers/dropdown.controller.js +0 -341
  250. package/components/ui/nuraly-ui/packages/common/dist/shared/controllers/dropdown.interface.d.ts +0 -37
  251. package/components/ui/nuraly-ui/packages/common/dist/shared/controllers/dropdown.interface.js +0 -2
  252. package/components/ui/nuraly-ui/packages/common/dist/shared/controllers/index.d.ts +0 -4
  253. package/components/ui/nuraly-ui/packages/common/dist/shared/controllers/index.js +0 -4
  254. package/components/ui/nuraly-ui/packages/common/dist/shared/controllers/theme.controller.d.ts +0 -48
  255. package/components/ui/nuraly-ui/packages/common/dist/shared/controllers/theme.controller.js +0 -133
  256. package/components/ui/nuraly-ui/packages/common/dist/shared/dependency-mixin.d.ts +0 -37
  257. package/components/ui/nuraly-ui/packages/common/dist/shared/dependency-mixin.js +0 -141
  258. package/components/ui/nuraly-ui/packages/common/dist/shared/event-handler-mixin.d.ts +0 -64
  259. package/components/ui/nuraly-ui/packages/common/dist/shared/event-handler-mixin.js +0 -95
  260. package/components/ui/nuraly-ui/packages/common/dist/shared/index.d.ts +0 -13
  261. package/components/ui/nuraly-ui/packages/common/dist/shared/index.js +0 -17
  262. package/components/ui/nuraly-ui/packages/common/dist/shared/theme-mixin.d.ts +0 -78
  263. package/components/ui/nuraly-ui/packages/common/dist/shared/theme-mixin.js +0 -194
  264. package/components/ui/nuraly-ui/packages/common/dist/shared/themes.d.ts +0 -44
  265. package/components/ui/nuraly-ui/packages/common/dist/shared/themes.js +0 -85
  266. package/components/ui/nuraly-ui/packages/common/dist/shared/utils.d.ts +0 -60
  267. package/components/ui/nuraly-ui/packages/common/dist/shared/utils.js +0 -85
  268. package/components/ui/nuraly-ui/packages/common/dist/shared/validation.types.d.ts +0 -108
  269. package/components/ui/nuraly-ui/packages/common/dist/shared/validation.types.js +0 -17
  270. package/components/ui/nuraly-ui/packages/common/dist/themes/index.d.ts +0 -2
  271. package/components/ui/nuraly-ui/packages/common/dist/themes/index.js +0 -2
  272. package/components/ui/nuraly-ui/packages/common/dist/themes.d.ts +0 -22
  273. package/components/ui/nuraly-ui/packages/common/dist/themes.js +0 -23
  274. package/components/ui/nuraly-ui/packages/common/dist/utils/index.d.ts +0 -2
  275. package/components/ui/nuraly-ui/packages/common/dist/utils/index.js +0 -2
  276. package/components/ui/nuraly-ui/packages/common/dist/utils.d.ts +0 -21
  277. package/components/ui/nuraly-ui/packages/common/dist/utils.js +0 -22
  278. package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/LICENSE +0 -15
  279. package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/README.md +0 -294
  280. package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/copy/copy-sync.js +0 -171
  281. package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/copy/copy.js +0 -175
  282. package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/copy/index.js +0 -7
  283. package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/empty/index.js +0 -39
  284. package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/ensure/file.js +0 -66
  285. package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/ensure/index.js +0 -23
  286. package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/ensure/link.js +0 -64
  287. package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/ensure/symlink-paths.js +0 -101
  288. package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/ensure/symlink-type.js +0 -34
  289. package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/ensure/symlink.js +0 -67
  290. package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/fs/index.js +0 -146
  291. package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/index.js +0 -16
  292. package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/json/index.js +0 -16
  293. package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/json/jsonfile.js +0 -11
  294. package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/json/output-json-sync.js +0 -12
  295. package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/json/output-json.js +0 -12
  296. package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/mkdirs/index.js +0 -14
  297. package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/mkdirs/make-dir.js +0 -27
  298. package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/mkdirs/utils.js +0 -21
  299. package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/move/index.js +0 -7
  300. package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/move/move-sync.js +0 -55
  301. package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/move/move.js +0 -59
  302. package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/output-file/index.js +0 -31
  303. package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/path-exists/index.js +0 -12
  304. package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/remove/index.js +0 -17
  305. package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/util/async.js +0 -29
  306. package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/util/stat.js +0 -159
  307. package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/util/utimes.js +0 -36
  308. package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/LICENSE +0 -15
  309. package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/README.md +0 -294
  310. package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/copy/copy-sync.js +0 -171
  311. package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/copy/copy.js +0 -175
  312. package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/copy/index.js +0 -7
  313. package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/empty/index.js +0 -39
  314. package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/ensure/file.js +0 -66
  315. package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/ensure/index.js +0 -23
  316. package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/ensure/link.js +0 -64
  317. package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/ensure/symlink-paths.js +0 -101
  318. package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/ensure/symlink-type.js +0 -34
  319. package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/ensure/symlink.js +0 -67
  320. package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/fs/index.js +0 -146
  321. package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/index.js +0 -16
  322. package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/json/index.js +0 -16
  323. package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/json/jsonfile.js +0 -11
  324. package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/json/output-json-sync.js +0 -12
  325. package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/json/output-json.js +0 -12
  326. package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/mkdirs/index.js +0 -14
  327. package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/mkdirs/make-dir.js +0 -27
  328. package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/mkdirs/utils.js +0 -21
  329. package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/move/index.js +0 -7
  330. package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/move/move-sync.js +0 -55
  331. package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/move/move.js +0 -59
  332. package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/output-file/index.js +0 -31
  333. package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/path-exists/index.js +0 -12
  334. package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/remove/index.js +0 -17
  335. package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/util/async.js +0 -29
  336. package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/util/stat.js +0 -159
  337. package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/util/utimes.js +0 -36
  338. package/dist/SmartAttributeHandler-C4EliaG0.js +0 -153
  339. package/dist/SmartAttributeHandler-u-ZHGueR.js +0 -193
  340. package/dist/assets/editor.worker-C_S4Avdt.js +0 -11
  341. package/dist/assets/html.worker-DfuQASUV.js +0 -458
  342. package/dist/assets/json.worker-Cucz4wxY.js +0 -42
  343. package/dist/assets/ts.worker-Dme6S0YK.js +0 -37021
  344. package/dist/cssMode-CqMQ6Xsa.js +0 -1443
  345. package/dist/htmlMode-KglxyZXm.js +0 -1453
  346. package/dist/jsonMode-B3rqxD-b.js +0 -1863
  347. package/dist/tsMode-DEiq8fQ0.js +0 -800
  348. package/redux/actions/application/loadApplicationPermissionAction.ts +0 -10
  349. package/utils/styleUtil.ts +0 -7
@@ -0,0 +1,503 @@
1
+ import type { ComponentElement } from '../../../../../redux/store/component/component.interface.ts';
2
+ import { BaseElementBlock } from '../../base/BaseElement';
3
+ import { html } from "lit";
4
+ import { customElement, property, state } from "lit/decorators.js";
5
+ import { borderManagerStyles } from './BorderManager.style.ts';
6
+
7
+ // Border configuration interface
8
+ interface BorderConfig {
9
+ width: number;
10
+ style: string;
11
+ color: string;
12
+ unit: string;
13
+ }
14
+
15
+ interface BorderSides {
16
+ all: boolean;
17
+ top: boolean;
18
+ right: boolean;
19
+ bottom: boolean;
20
+ left: boolean;
21
+ }
22
+
23
+ interface BorderRadius {
24
+ topLeft: number;
25
+ topRight: number;
26
+ bottomLeft: number;
27
+ bottomRight: number;
28
+ unit: string;
29
+ linked: boolean;
30
+ }
31
+
32
+ interface BorderState {
33
+ sides: BorderSides;
34
+ config: BorderConfig;
35
+ radius: BorderRadius;
36
+ individualConfigs: {
37
+ top: BorderConfig;
38
+ right: BorderConfig;
39
+ bottom: BorderConfig;
40
+ left: BorderConfig;
41
+ };
42
+ }
43
+
44
+ // Border style options
45
+ const BORDER_STYLES = [
46
+ { label: 'Solid', value: 'solid' },
47
+ { label: 'Dashed', value: 'dashed' },
48
+ { label: 'Dotted', value: 'dotted' },
49
+ { label: 'Double', value: 'double' },
50
+ { label: 'Groove', value: 'groove' },
51
+ { label: 'Ridge', value: 'ridge' },
52
+ { label: 'Inset', value: 'inset' },
53
+ { label: 'Outset', value: 'outset' },
54
+ { label: 'None', value: 'none' },
55
+ ];
56
+
57
+ // Border presets
58
+ const BORDER_PRESETS = {
59
+ none: (): Partial<BorderState> => ({
60
+ config: { width: 0, style: 'none', color: '#000000', unit: 'px' },
61
+ sides: { all: true, top: false, right: false, bottom: false, left: false }
62
+ }),
63
+ thin: (): Partial<BorderState> => ({
64
+ config: { width: 1, style: 'solid', color: '#d9d9d9', unit: 'px' },
65
+ sides: { all: true, top: false, right: false, bottom: false, left: false }
66
+ }),
67
+ medium: (): Partial<BorderState> => ({
68
+ config: { width: 2, style: 'solid', color: '#d9d9d9', unit: 'px' },
69
+ sides: { all: true, top: false, right: false, bottom: false, left: false }
70
+ }),
71
+ thick: (): Partial<BorderState> => ({
72
+ config: { width: 3, style: 'solid', color: '#d9d9d9', unit: 'px' },
73
+ sides: { all: true, top: false, right: false, bottom: false, left: false }
74
+ }),
75
+ accent: (): Partial<BorderState> => ({
76
+ config: { width: 2, style: 'solid', color: '#1890ff', unit: 'px' },
77
+ sides: { all: true, top: false, right: false, bottom: false, left: false }
78
+ }),
79
+ dashed: (): Partial<BorderState> => ({
80
+ config: { width: 1, style: 'dashed', color: '#d9d9d9', unit: 'px' },
81
+ sides: { all: true, top: false, right: false, bottom: false, left: false }
82
+ }),
83
+ };
84
+
85
+ type BorderPresetKey = keyof typeof BORDER_PRESETS;
86
+
87
+ @customElement("border-manager-display")
88
+ export class BorderManagerDisplay extends BaseElementBlock {
89
+ static override styles = [borderManagerStyles];
90
+
91
+ @property({ type: Object })
92
+ component: ComponentElement;
93
+
94
+ @state()
95
+ private borderState: BorderState = {
96
+ sides: { all: true, top: false, right: false, bottom: false, left: false },
97
+ config: { width: 0, style: 'none', color: '#000000', unit: 'px' },
98
+ radius: { topLeft: 0, topRight: 0, bottomLeft: 0, bottomRight: 0, unit: 'px', linked: true },
99
+ individualConfigs: {
100
+ top: { width: 1, style: 'solid', color: '#d9d9d9', unit: 'px' },
101
+ right: { width: 1, style: 'solid', color: '#d9d9d9', unit: 'px' },
102
+ bottom: { width: 1, style: 'solid', color: '#d9d9d9', unit: 'px' },
103
+ left: { width: 1, style: 'solid', color: '#d9d9d9', unit: 'px' },
104
+ }
105
+ };
106
+
107
+ private isInitialized = false;
108
+ private lastInitializedState: string | null = null;
109
+
110
+ private emitBorderChange(property: string, value: any) {
111
+ this.executeEvent("onChange", new CustomEvent('change'), {
112
+ property,
113
+ type: 'style',
114
+ value,
115
+ });
116
+ }
117
+
118
+ private getCurrentState(): string {
119
+ const handlers = this.inputHandlersValue;
120
+ return handlers?.currentState || handlers?.value?.currentState || 'default';
121
+ }
122
+
123
+ private getBorderFromHandlers(): BorderState {
124
+ const handlers = this.inputHandlersValue;
125
+ const style = handlers?.value?.style || handlers?.style || {};
126
+
127
+ // Parse existing border values
128
+ const parseBorder = (borderStr: string): BorderConfig => {
129
+ if (!borderStr || borderStr === 'none') {
130
+ return { width: 0, style: 'none', color: '#000000', unit: 'px' };
131
+ }
132
+ const parts = borderStr.split(' ');
133
+ const widthMatch = parts[0]?.match(/^(\d+)(px|em|rem|%)?$/);
134
+ return {
135
+ width: widthMatch ? parseInt(widthMatch[1]) : 0,
136
+ style: parts[1] || 'solid',
137
+ color: parts[2] || '#000000',
138
+ unit: widthMatch?.[2] || 'px'
139
+ };
140
+ };
141
+
142
+ const parseRadius = (radiusStr: string): number => {
143
+ if (!radiusStr) return 0;
144
+ const match = radiusStr.match(/^(\d+)/);
145
+ return match ? parseInt(match[1]) : 0;
146
+ };
147
+
148
+ // Determine active sides
149
+ const hasBorder = !!style.border && style.border !== 'none';
150
+ const hasTop = !!style['border-top'] && style['border-top'] !== 'none';
151
+ const hasRight = !!style['border-right'] && style['border-right'] !== 'none';
152
+ const hasBottom = !!style['border-bottom'] && style['border-bottom'] !== 'none';
153
+ const hasLeft = !!style['border-left'] && style['border-left'] !== 'none';
154
+
155
+ const mainConfig = parseBorder(style.border || style['border-top'] || style['border-right'] || style['border-bottom'] || style['border-left'] || '');
156
+
157
+ // Parse radius values and determine if they should be linked
158
+ const topLeft = parseRadius(style['border-top-left-radius']);
159
+ const topRight = parseRadius(style['border-top-right-radius']);
160
+ const bottomLeft = parseRadius(style['border-bottom-left-radius']);
161
+ const bottomRight = parseRadius(style['border-bottom-right-radius']);
162
+ const allRadiusEqual = topLeft === topRight && topLeft === bottomLeft && topLeft === bottomRight;
163
+
164
+ return {
165
+ sides: {
166
+ all: hasBorder,
167
+ top: hasTop,
168
+ right: hasRight,
169
+ bottom: hasBottom,
170
+ left: hasLeft,
171
+ },
172
+ config: mainConfig,
173
+ radius: {
174
+ topLeft,
175
+ topRight,
176
+ bottomLeft,
177
+ bottomRight,
178
+ unit: 'px',
179
+ linked: allRadiusEqual
180
+ },
181
+ individualConfigs: {
182
+ top: parseBorder(style['border-top']),
183
+ right: parseBorder(style['border-right']),
184
+ bottom: parseBorder(style['border-bottom']),
185
+ left: parseBorder(style['border-left']),
186
+ }
187
+ };
188
+ }
189
+
190
+ private applyPreset(presetKey: BorderPresetKey) {
191
+ const preset = BORDER_PRESETS[presetKey]();
192
+ if (preset.config) {
193
+ this.borderState = { ...this.borderState, ...preset };
194
+ }
195
+ this.emitAllBorderChanges();
196
+ this.requestUpdate();
197
+ }
198
+
199
+ private toggleSide(side: keyof BorderSides) {
200
+ if (side === 'all') {
201
+ this.borderState.sides = {
202
+ all: true,
203
+ top: false,
204
+ right: false,
205
+ bottom: false,
206
+ left: false,
207
+ };
208
+ } else {
209
+ this.borderState.sides = {
210
+ ...this.borderState.sides,
211
+ all: false,
212
+ [side]: !this.borderState.sides[side],
213
+ };
214
+ }
215
+ this.emitAllBorderChanges();
216
+ this.requestUpdate();
217
+ }
218
+
219
+ private updateConfig(key: keyof BorderConfig, value: any) {
220
+ this.borderState.config = { ...this.borderState.config, [key]: value };
221
+ this.emitAllBorderChanges();
222
+ this.requestUpdate();
223
+ }
224
+
225
+ private updateRadius(corner: keyof Omit<BorderRadius, 'unit' | 'linked'>, value: number) {
226
+ if (this.borderState.radius.linked) {
227
+ this.borderState.radius = {
228
+ ...this.borderState.radius,
229
+ topLeft: value,
230
+ topRight: value,
231
+ bottomLeft: value,
232
+ bottomRight: value,
233
+ };
234
+ } else {
235
+ this.borderState.radius = { ...this.borderState.radius, [corner]: value };
236
+ }
237
+ this.emitRadiusChanges();
238
+ this.requestUpdate();
239
+ }
240
+
241
+ private toggleRadiusLink() {
242
+ this.borderState.radius.linked = !this.borderState.radius.linked;
243
+ if (this.borderState.radius.linked) {
244
+ // Sync all to topLeft value
245
+ const val = this.borderState.radius.topLeft;
246
+ this.borderState.radius = {
247
+ ...this.borderState.radius,
248
+ topRight: val,
249
+ bottomLeft: val,
250
+ bottomRight: val,
251
+ };
252
+ this.emitRadiusChanges();
253
+ }
254
+ this.requestUpdate();
255
+ }
256
+
257
+ private formatBorder(config: BorderConfig): string {
258
+ if (config.style === 'none' || config.width === 0) {
259
+ return 'none';
260
+ }
261
+ return `${config.width}${config.unit} ${config.style} ${config.color}`;
262
+ }
263
+
264
+ private emitAllBorderChanges() {
265
+ const { sides, config } = this.borderState;
266
+ const borderValue = this.formatBorder(config);
267
+
268
+ if (sides.all) {
269
+ this.emitBorderChange('border', borderValue);
270
+ // Clear individual sides
271
+ this.emitBorderChange('border-top', undefined);
272
+ this.emitBorderChange('border-right', undefined);
273
+ this.emitBorderChange('border-bottom', undefined);
274
+ this.emitBorderChange('border-left', undefined);
275
+ } else {
276
+ this.emitBorderChange('border', undefined);
277
+ this.emitBorderChange('border-top', sides.top ? borderValue : undefined);
278
+ this.emitBorderChange('border-right', sides.right ? borderValue : undefined);
279
+ this.emitBorderChange('border-bottom', sides.bottom ? borderValue : undefined);
280
+ this.emitBorderChange('border-left', sides.left ? borderValue : undefined);
281
+ }
282
+ }
283
+
284
+ private emitRadiusChanges() {
285
+ const { radius } = this.borderState;
286
+ this.emitBorderChange('border-top-left-radius', `${radius.topLeft}${radius.unit}`);
287
+ this.emitBorderChange('border-top-right-radius', `${radius.topRight}${radius.unit}`);
288
+ this.emitBorderChange('border-bottom-left-radius', `${radius.bottomLeft}${radius.unit}`);
289
+ this.emitBorderChange('border-bottom-right-radius', `${radius.bottomRight}${radius.unit}`);
290
+ }
291
+
292
+ private handleColorChange(e: CustomEvent) {
293
+ this.updateConfig('color', e.detail.value);
294
+ }
295
+
296
+ private getStateLabel(state: string): string {
297
+ const labels: Record<string, string> = {
298
+ 'default': 'Default',
299
+ ':hover': 'Hover',
300
+ ':focus': 'Focus',
301
+ ':active': 'Active',
302
+ ':disabled': 'Disabled'
303
+ };
304
+ return labels[state] || state;
305
+ }
306
+
307
+ private renderStateIndicator() {
308
+ const currentState = this.getCurrentState();
309
+ if (currentState === 'default') return null;
310
+
311
+ return html`
312
+ <div class="state-indicator">
313
+ Editing: <span class="state-badge">${this.getStateLabel(currentState)}</span>
314
+ </div>
315
+ `;
316
+ }
317
+
318
+ private renderPresetButtons() {
319
+ return html`
320
+ <div class="section">
321
+ <div class="section-title">Border Presets</div>
322
+ <div class="preset-buttons">
323
+ <nr-button dashed size="small" @click=${() => this.applyPreset('none')}>none</nr-button>
324
+ <nr-button dashed size="small" @click=${() => this.applyPreset('thin')}>thin</nr-button>
325
+ <nr-button dashed size="small" @click=${() => this.applyPreset('medium')}>medium</nr-button>
326
+ <nr-button dashed size="small" @click=${() => this.applyPreset('thick')}>thick</nr-button>
327
+ <nr-button dashed size="small" @click=${() => this.applyPreset('accent')}>accent</nr-button>
328
+ <nr-button dashed size="small" @click=${() => this.applyPreset('dashed')}>dashed</nr-button>
329
+ </div>
330
+ </div>
331
+ `;
332
+ }
333
+
334
+ private renderBorderConfig() {
335
+ const { sides, config } = this.borderState;
336
+
337
+ return html`
338
+ <div class="section">
339
+ <div class="section-title">Border Style</div>
340
+ <div class="config-panel">
341
+ <div class="config-header">
342
+ <span class="config-title">Sides</span>
343
+ <div class="side-toggles">
344
+ <span class="side-toggle ${sides.all ? 'active' : ''}" @click=${() => this.toggleSide('all')}>ALL</span>
345
+ <span class="side-toggle ${sides.top ? 'active' : ''}" @click=${() => this.toggleSide('top')}>T</span>
346
+ <span class="side-toggle ${sides.right ? 'active' : ''}" @click=${() => this.toggleSide('right')}>R</span>
347
+ <span class="side-toggle ${sides.bottom ? 'active' : ''}" @click=${() => this.toggleSide('bottom')}>B</span>
348
+ <span class="side-toggle ${sides.left ? 'active' : ''}" @click=${() => this.toggleSide('left')}>L</span>
349
+ </div>
350
+ </div>
351
+
352
+ <div class="config-row">
353
+ <span class="config-label">Width</span>
354
+ <div class="config-input">
355
+ <nr-input
356
+ class="width-input"
357
+ type="number"
358
+ size="small"
359
+ .value=${String(config.width)}
360
+ @nr-input=${(e: CustomEvent) => this.updateConfig('width', parseInt(e.detail?.value) || 0)}
361
+ ></nr-input>
362
+ <span style="font-size: 10px; color: #888;">px</span>
363
+ </div>
364
+ </div>
365
+
366
+ <div class="config-row">
367
+ <span class="config-label">Style</span>
368
+ <div class="config-input">
369
+ <nr-select
370
+ size="small"
371
+ .value=${config.style}
372
+ .options=${BORDER_STYLES}
373
+ @nr-change=${(e: CustomEvent) => this.updateConfig('style', e.detail?.value?.value || e.detail?.value || 'solid')}
374
+ ></nr-select>
375
+ </div>
376
+ </div>
377
+
378
+ <div class="config-row">
379
+ <span class="config-label">Color</span>
380
+ <div class="config-input">
381
+ <nr-color-picker
382
+ .color=${config.color}
383
+ @color-changed=${this.handleColorChange}
384
+ ></nr-color-picker>
385
+ <nr-input
386
+ size="small"
387
+ .value=${config.color}
388
+ @nr-input=${(e: CustomEvent) => this.updateConfig('color', e.detail?.value || '#000000')}
389
+ ></nr-input>
390
+ </div>
391
+ </div>
392
+
393
+ <!-- Preview -->
394
+ <div class="preview-box" style="
395
+ border: ${this.formatBorder(config)};
396
+ border-radius: ${this.borderState.radius.topLeft}${this.borderState.radius.unit};
397
+ "></div>
398
+ </div>
399
+ </div>
400
+ `;
401
+ }
402
+
403
+ private renderRadiusConfig() {
404
+ const { radius } = this.borderState;
405
+
406
+ return html`
407
+ <div class="section radius-section">
408
+ <div class="section-title">Border Radius</div>
409
+ <div class="config-panel">
410
+ <div class="link-toggle ${radius.linked ? 'linked' : ''}" @click=${() => this.toggleRadiusLink()}>
411
+ <nr-icon name=${radius.linked ? 'link' : 'disconnect'}></nr-icon>
412
+ <span>${radius.linked ? 'Linked' : 'Individual'}</span>
413
+ </div>
414
+
415
+ ${radius.linked ? html`
416
+ <div class="config-row">
417
+ <span class="config-label">All</span>
418
+ <div class="config-input">
419
+ <nr-input
420
+ class="width-input"
421
+ type="number"
422
+ size="small"
423
+ .value=${String(radius.topLeft)}
424
+ @nr-input=${(e: CustomEvent) => this.updateRadius('topLeft', parseInt(e.detail?.value) || 0)}
425
+ ></nr-input>
426
+ <span style="font-size: 10px; color: #888;">px</span>
427
+ </div>
428
+ </div>
429
+ ` : html`
430
+ <div class="radius-grid">
431
+ <div class="radius-item">
432
+ <span class="radius-label">TL</span>
433
+ <nr-input
434
+ class="radius-input"
435
+ type="number"
436
+ size="small"
437
+ .value=${String(radius.topLeft)}
438
+ @nr-input=${(e: CustomEvent) => this.updateRadius('topLeft', parseInt(e.detail?.value) || 0)}
439
+ ></nr-input>
440
+ </div>
441
+ <div class="radius-item">
442
+ <span class="radius-label">TR</span>
443
+ <nr-input
444
+ class="radius-input"
445
+ type="number"
446
+ size="small"
447
+ .value=${String(radius.topRight)}
448
+ @nr-input=${(e: CustomEvent) => this.updateRadius('topRight', parseInt(e.detail?.value) || 0)}
449
+ ></nr-input>
450
+ </div>
451
+ <div class="radius-item">
452
+ <span class="radius-label">BL</span>
453
+ <nr-input
454
+ class="radius-input"
455
+ type="number"
456
+ size="small"
457
+ .value=${String(radius.bottomLeft)}
458
+ @nr-input=${(e: CustomEvent) => this.updateRadius('bottomLeft', parseInt(e.detail?.value) || 0)}
459
+ ></nr-input>
460
+ </div>
461
+ <div class="radius-item">
462
+ <span class="radius-label">BR</span>
463
+ <nr-input
464
+ class="radius-input"
465
+ type="number"
466
+ size="small"
467
+ .value=${String(radius.bottomRight)}
468
+ @nr-input=${(e: CustomEvent) => this.updateRadius('bottomRight', parseInt(e.detail?.value) || 0)}
469
+ ></nr-input>
470
+ </div>
471
+ </div>
472
+ `}
473
+ </div>
474
+ </div>
475
+ `;
476
+ }
477
+
478
+ override renderComponent() {
479
+ // Only initialize from handlers once we have data, or when state changes
480
+ const handlers = this.inputHandlersValue;
481
+ const hasHandlerData = handlers?.value?.style || handlers?.style;
482
+ const currentState = this.getCurrentState();
483
+
484
+ // Re-initialize when state changes (e.g., default -> hover)
485
+ const stateChanged = this.lastInitializedState !== null && this.lastInitializedState !== currentState;
486
+
487
+ if ((!this.isInitialized || stateChanged) && hasHandlerData) {
488
+ this.borderState = this.getBorderFromHandlers();
489
+ this.isInitialized = true;
490
+ this.lastInitializedState = currentState;
491
+ }
492
+
493
+ return html`
494
+ <div class="border-container">
495
+ ${this.renderStateIndicator()}
496
+ ${this.renderPresetButtons()}
497
+ <div class="divider"></div>
498
+ ${this.renderBorderConfig()}
499
+ ${this.renderRadiusConfig()}
500
+ </div>
501
+ `;
502
+ }
503
+ }
@@ -5,20 +5,6 @@ import { BaseElementBlock } from '../../base/BaseElement';
5
5
  import { executeHandler } from '../../../../../state/runtime-context';
6
6
  import { getNestedAttribute } from '../../../../../utils/object.utils.ts';
7
7
 
8
- // Safely import @nuralyui/checkbox
9
- try {
10
- await import("@nuralyui/checkbox");
11
- } catch (error) {
12
- console.warn('[@nuralyui/checkbox] Package not found or failed to load.');
13
- }
14
- // Safely import @nuralyui/slider-input
15
- try {
16
- await import("@nuralyui/slider-input");
17
- } catch (error) {
18
- console.warn('[@nuralyui/slider-input] Package not found or failed to load.');
19
- }
20
-
21
-
22
8
  function debounce(func, wait = 100) {
23
9
  let timeout;
24
10
  return function(...args) {
@@ -91,10 +77,8 @@ export class AttributeBoxShadowValue extends BaseElementBlock {
91
77
  });
92
78
 
93
79
  boxShadow() {
94
- return
95
80
  const shadowBox = ` ${this.horizontalValue}px ${this.verticalValue}px ${this.blurValue}px ${this.spreadValue}px ${this.colorValue} ${this.insetValue ? "inset" : ""}`;
96
81
  if (this.component.event.boxShadowChanged) {
97
-
98
82
  const fn = executeHandler(this.component, getNestedAttribute(this.component, `event.boxShadowChanged`), {
99
83
  value: shadowBox
100
84
  });
@@ -1,4 +1,4 @@
1
- import { html, nothing } from "lit";
1
+ import { html, css, nothing } from "lit";
2
2
  import { customElement, property } from "lit/decorators.js";
3
3
  import { type ComponentElement } from '../../../../../redux/store/component/component.interface.ts';
4
4
  import { BaseElementBlock } from "../../base/BaseElement.ts";
@@ -12,41 +12,70 @@ try {
12
12
  console.warn('[@nuralyui/document] Package not found or failed to load.');
13
13
  }
14
14
 
15
-
16
-
17
15
  @customElement("document-block")
18
- export class ImageBlock extends BaseElementBlock {
16
+ export class DocumentBlock extends BaseElementBlock {
17
+ static styles = [css`
18
+ .document-placeholder {
19
+ display: flex;
20
+ flex-direction: column;
21
+ align-items: center;
22
+ justify-content: center;
23
+ color: #64748b;
24
+ min-height: 200px;
25
+ border-radius: 8px;
26
+ border: 2px dashed #cbd5e1;
27
+ gap: 12px;
28
+ }
29
+ .document-placeholder nr-icon {
30
+ --nuraly-icon-size: 48px;
31
+ }
32
+ `];
33
+
19
34
  @property({ type: Object })
20
35
  component: ComponentElement;
21
- isDarkMode: boolean;
22
-
23
-
24
36
 
25
37
  renderComponent() {
26
-
27
38
  const documentStyles = this.getStyles() || {};
28
39
  const documentStyleHandlers = this.component?.styleHandlers ? Object.fromEntries(
29
40
  Object.entries(this.component?.styleHandlers).filter(([key, value]) => value)) : {};
30
- const documentSrc = this.isDarkMode
31
- ? this.inputHandlersValue.darkSrc ?? this.inputHandlersValue.src
32
- : this.inputHandlersValue.src;
41
+
42
+ const src = this.inputHandlersValue?.src;
43
+ const type = this.inputHandlersValue?.type ?? 'pdf';
44
+ const previewable = this.inputHandlersValue?.previewable ?? false;
45
+
46
+ // Show placeholder when no document source
47
+ if (!src) {
48
+ return html`
49
+ <div
50
+ ${ref(this.inputRef)}
51
+ class="document-placeholder"
52
+ style=${styleMap({
53
+ ...this.getStyles(),
54
+ width: documentStyleHandlers?.width || documentStyles?.width || '100%',
55
+ height: documentStyleHandlers?.height || documentStyles?.height || '200px',
56
+ })}
57
+ @click=${(e: MouseEvent) => this.executeEvent("onClick", e)}
58
+ >
59
+ <nr-icon name="file-text"></nr-icon>
60
+ <nr-label>No document source</nr-label>
61
+ </div>
62
+ `;
63
+ }
64
+
33
65
  return html`
34
66
  <nr-document-viewer
35
- ${ref(this.inputRef)}
36
- @click=${(e: MouseEvent) => {
37
- this.executeEvent("onClick", e);
38
- }}
39
- style=${
40
- styleMap({
67
+ ${ref(this.inputRef)}
68
+ style=${styleMap({
41
69
  ...this.getStyles(),
42
- },
43
-
44
- )
45
- }
46
- .src=${documentSrc ?? nothing}
47
- .previewable=${this.inputHandlersValue.previewable ?? nothing}
48
- .width=${documentStyleHandlers?.width ? documentStyleHandlers.width : documentStyles?.width}
49
- .height=${documentStyleHandlers?.height ? documentStyleHandlers?.height : documentStyles?.height}
70
+ })}
71
+ .src=${src}
72
+ .type=${type}
73
+ .previewable=${previewable}
74
+ .width=${documentStyleHandlers?.width || documentStyles?.width}
75
+ .height=${documentStyleHandlers?.height || documentStyles?.height}
76
+ @click=${(e: MouseEvent) => this.executeEvent("onClick", e)}
77
+ @load=${(e: Event) => this.executeEvent("onLoad", e, { src })}
78
+ @error=${(e: Event) => this.executeEvent("onError", e, { src, error: 'Failed to load document' })}
50
79
  >
51
80
  </nr-document-viewer>
52
81
  `;
@@ -17,13 +17,15 @@ export class ExportImportBlock extends BaseElementBlock {
17
17
  const {
18
18
  detail: { value },
19
19
  } = event;
20
- console.log(`${type} code changed:`, value);
20
+ // Code change can be handled here if needed
21
21
  }
22
22
 
23
23
  copyToClipboard(content: string) {
24
- navigator.clipboard.writeText(content).then(() => {
25
- console.log("Content copied to clipboard:", content);
26
- });
24
+ navigator.clipboard.writeText(content);
25
+ }
26
+
27
+ handleImportConfirm(type: string) {
28
+ // Import confirmation can be handled here
27
29
  }
28
30
 
29
31
  downloadContent(content: string, fileName: string) {
@@ -36,7 +38,7 @@ export class ExportImportBlock extends BaseElementBlock {
36
38
  URL.revokeObjectURL(url);
37
39
  }
38
40
 
39
- override async firstUpdated(): Promise<void> {}
41
+ override firstUpdated() {}
40
42
 
41
43
  renderDropdown(templateContent: string, buttonLabel: string, type: string) {
42
44
  const isExport = type === "export";
@@ -61,7 +63,7 @@ export class ExportImportBlock extends BaseElementBlock {
61
63
  </nr-button>
62
64
  `
63
65
  : nothing}
64
- ${isExport ? nothing : html` <nr-button @click=${() => console.log(`${type} confirmed`)}>
66
+ ${isExport ? nothing : html` <nr-button @click=${() => this.handleImportConfirm(type)}>
65
67
  Confirm Import
66
68
  </nr-button>`}
67
69
 
@@ -91,7 +93,6 @@ export class ExportImportBlock extends BaseElementBlock {
91
93
  });
92
94
 
93
95
  this.exportCode = JSON.stringify(components, null, 2);
94
- console.log("Exported UUIDs as JSON:", this.exportCode);
95
96
  });
96
97
  }}>
97
98
  ${buttonLabel}