@nuraly/runtime 0.1.7 → 0.1.9
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.
- package/README.md +83 -765
- package/components/ui/components/Event/EventValue/EventValue.ts +13 -8
- package/components/ui/components/ToastContainer/ToastContainer.ts +1 -1
- package/components/ui/components/advanced/AIChat/AIChat.ts +1 -2
- package/components/ui/components/advanced/Collapse/Collapse.ts +5 -2
- package/components/ui/components/advanced/Collections/Collections.ts +2 -2
- package/components/ui/components/advanced/MicroApp/MicroApp.ts +3 -11
- package/components/ui/components/advanced/RefComponent/RefComponent.ts +2 -2
- package/components/ui/components/advanced/RichText/RichText.ts +5 -4
- package/components/ui/components/advanced/RichText/RichTextEditor.ts +0 -167
- package/components/ui/components/base/BaseElement/base-change-detection.ts +1 -5
- package/components/ui/components/base/BaseElement.ts +229 -610
- package/components/ui/components/base/FormRegisterable.ts +83 -0
- package/components/ui/components/base/controllers/DragDropController.ts +175 -0
- package/components/ui/components/base/controllers/ErrorController.ts +180 -0
- package/components/ui/components/base/controllers/EventController.ts +112 -0
- package/components/ui/components/base/controllers/InputHandlerController.ts +298 -0
- package/components/ui/components/base/controllers/SelectionController.ts +323 -0
- package/components/ui/components/base/controllers/StyleHandlerController.ts +286 -0
- package/components/ui/components/base/controllers/index.ts +11 -0
- package/components/ui/components/base/mixins/EditorModeMixin.ts +185 -0
- package/components/ui/components/base/mixins/index.ts +6 -0
- package/components/ui/components/base/types/base-element.types.ts +138 -0
- package/components/ui/components/base/types/index.ts +21 -0
- package/components/ui/components/base/utils/event-debouncer.ts +209 -0
- package/components/ui/components/base/utils/index.ts +11 -0
- package/components/ui/components/base/utils/style-cache.ts +94 -0
- package/components/ui/components/display/BoxModel/BoxModel.ts +177 -116
- package/components/ui/components/display/Code/Code.ts +40 -26
- package/components/ui/components/display/Divider/Divider.ts +2 -2
- package/components/ui/components/display/Icon/Icon.ts +2 -3
- package/components/ui/components/display/Image/Image.ts +72 -46
- package/components/ui/components/display/Tag/Tag.ts +2 -3
- package/components/ui/components/display/Video/Video.ts +91 -31
- package/components/ui/components/inputs/Button/Button.ts +2 -2
- package/components/ui/components/inputs/Checkbox/Checkbox.ts +14 -40
- package/components/ui/components/inputs/ColorPicker/colorpicker.ts +9 -4
- package/components/ui/components/inputs/DatePicker/DatePicker.ts +47 -25
- package/components/ui/components/inputs/Dropdown/Dropdown.ts +2 -2
- package/components/ui/components/inputs/Form/Form.style.ts +26 -0
- package/components/ui/components/inputs/Form/Form.ts +360 -0
- package/components/ui/components/inputs/IconPicker/IconPicker.ts +22 -18
- package/components/ui/components/inputs/InsertDropdown/InsertDropdown.ts +0 -20
- package/components/ui/components/inputs/NumberInput/NumberInput.ts +0 -4
- package/components/ui/components/inputs/RadioButton/Radio-button.ts +17 -13
- package/components/ui/components/inputs/Select/Select.ts +44 -24
- package/components/ui/components/inputs/TextInput/TextInput.ts +15 -9
- package/components/ui/components/inputs/Textarea/Textarea.ts +30 -30
- package/components/ui/components/inputs/UsersDropdown/UsersDropdown.ts +1 -1
- package/components/ui/components/layout/Card/Card.ts +112 -10
- package/components/ui/components/layout/Containers/Container.style.ts +18 -0
- package/components/ui/components/layout/Containers/Container.ts +11 -5
- package/components/ui/components/layout/Grid/Col.style.ts +27 -0
- package/components/ui/components/layout/Grid/Col.ts +213 -0
- package/components/ui/components/layout/Grid/Row.style.ts +73 -0
- package/components/ui/components/layout/Grid/Row.ts +170 -0
- package/components/ui/components/layout/Grid/index.ts +7 -0
- package/components/ui/components/layout/Panel/Panel.ts +2 -2
- package/components/ui/components/layout/Tabs/Tabs.ts +0 -1
- package/components/ui/components/navigation/EmbedURL/EmbedURL.ts +62 -26
- package/components/ui/components/navigation/Link/Link.ts +27 -16
- package/components/ui/components/navigation/Menu/Menu.ts +26 -48
- package/components/ui/components/runtime/MicroApp/MicroApp.ts +7 -147
- package/components/ui/components/runtime/MicroApp/MicroAppDataLoader.ts +6 -2
- package/components/ui/components/studio/FunctionsPanel/FunctionsPanel.ts +484 -0
- package/components/ui/components/studio/FunctionsPanel/index.ts +1 -0
- package/components/ui/components/utility/AccessRoles/AccessRoles.style.ts +242 -0
- package/components/ui/components/utility/AccessRoles/AccessRoles.ts +476 -0
- package/components/ui/components/utility/Border/Border.ts +0 -14
- package/components/ui/components/utility/BorderManager/BorderManager.style.ts +237 -0
- package/components/ui/components/utility/BorderManager/BorderManager.ts +503 -0
- package/components/ui/components/utility/BoxShadow/BoxShadow.ts +0 -16
- package/components/ui/components/utility/Document/Document.ts +54 -25
- package/components/ui/components/utility/Export-Import/Export-Import.ts +8 -7
- package/components/ui/components/utility/Handlers/Handlers.ts +14 -17
- package/components/ui/components/utility/ValidationRules/ValidationRules.ts +440 -0
- package/components/ui/components/wrappers/GenerikWrapper/DragWrapper/DragWrapper.ts +1 -0
- package/components/ui/components/wrappers/GenerikWrapper/GenerikWrapper.ts +1 -24
- package/components/ui/nuraly-ui/src/components/badge/badge.style.ts +4 -3
- package/components/ui/nuraly-ui/src/components/datepicker/datepicker.component.ts +2 -0
- package/components/ui/nuraly-ui/src/components/radio-group/radio-group.component.ts +12 -6
- package/components/ui/nuraly-ui/src/components/radio-group/radio-group.style.ts +23 -0
- package/dist/{index-B4yIOSMd.js → BaseElement-BNBn_IJk.js} +2920 -267
- package/dist/{CodeEditor-YsOapSut.js → CodeEditor-B1gNuvPb.js} +84127 -76319
- package/dist/{CodeEditor-BiNku87K.js → CodeEditor-Cpph-xRc.js} +7 -7
- package/dist/{abap-B2diVmjb.js → abap-D0Neqhq6.js} +91 -1
- package/dist/{apex-3NuJ-nsI.js → apex-B5LhxkeG.js} +18 -1
- package/dist/assets/editor.worker-DcwbJ0PV.js +12 -0
- package/dist/assets/html.worker-BTMxskjR.js +461 -0
- package/dist/assets/json.worker-D3vTGdf_.js +49 -0
- package/dist/assets/ts.worker-BsM1BXac.js +51334 -0
- package/dist/{azcli-XGXuUsMB.js → azcli-BrBH0QTU.js} +1 -1
- package/dist/{bat-B8Vhm634.js → bat-BfzAov64.js} +12 -1
- package/dist/{bicep-Cc8X5S_k.js → bicep-C3bCSWel.js} +1 -1
- package/dist/{cameligo-Bo3wBh9T.js → cameligo-sFL5plcd.js} +13 -1
- package/dist/{clojure-CPoQlpIK.js → clojure-CfeExRz0.js} +14 -1
- package/dist/{coffee-BxvTGz39.js → coffee-Xws5K0WL.js} +11 -1
- package/dist/{cpp-5RpEV7vC.js → cpp-CqOUEpxN.js} +28 -23
- package/dist/{csharp-slXXP3fo.js → csharp-DVLiBOZb.js} +13 -1
- package/dist/{csp-B98p6-gH.js → csp-DVFp9bw5.js} +3 -1
- package/dist/{css-BDsDSAin.js → css-DwARn2R6.js} +8 -1
- package/dist/cssMode-D82-gS78.js +1577 -0
- package/dist/{cypher-Dc4IMouD.js → cypher-uY0Mffat.js} +8 -1
- package/dist/{dart-LhvE3yD2.js → dart-D27H-mX_.js} +18 -1
- package/dist/{dockerfile-CwzplJeZ.js → dockerfile-CmV85WZK.js} +5 -1
- package/dist/{ecl-DxW3FiJi.js → ecl--fKn7yzB.js} +9 -1
- package/dist/{elixir-BI40g7TU.js → elixir-DUhH17ON.js} +87 -1
- package/dist/{flow9-tR2v0bGz.js → flow9-B3Dx2LLe.js} +8 -1
- package/dist/{freemarker2-Bfqhwyij.js → freemarker2-CYRLpyjt.js} +359 -7
- package/dist/{fsharp-BLAma0OT.js → fsharp-SyqBfUAR.js} +14 -1
- package/dist/{go-nYcD3y4Z.js → go-BbMR2tdT.js} +17 -1
- package/dist/{graphql-Dp1cHWmP.js → graphql-DDJE6tIl.js} +17 -1
- package/dist/{handlebars-DCgKNBmn.js → handlebars-R8Efxi60.js} +38 -4
- package/dist/{hcl-6NT8Kbna.js → hcl-YBvpaUqf.js} +13 -1
- package/dist/{html-C6wR7sMB.js → html-czhjovcp.js} +37 -4
- package/dist/htmlMode-DpyKDYYs.js +1587 -0
- package/dist/{ini-BZCOLrEc.js → ini-Ct73dBtM.js} +10 -1
- package/dist/{java-DAMcfJbX.js → java-C_jlkwoG.js} +18 -1
- package/dist/{javascript-D1L5MTmg.js → javascript-DwqkMEdb.js} +3 -2
- package/dist/jsonMode-Cmxxe0W9.js +2002 -0
- package/dist/{julia-CQ46G71H.js → julia-D8WE5U1e.js} +22 -1
- package/dist/{kotlin-CEjVo_6E.js → kotlin-Zy9aq5yB.js} +15 -1
- package/dist/{less-DreV99nP.js → less-sZ0iHtE8.js} +1 -1
- package/dist/{lexon-DBVJhqLb.js → lexon-CsdNL29A.js} +13 -1
- package/dist/{liquid-D_pDYIs1.js → liquid-2spuEcBh.js} +12 -4
- package/dist/{lua-Dcc_j6L-.js → lua-C2YJo0zw.js} +12 -1
- package/dist/{m3-B9SlZL4n.js → m3-CPLP40SG.js} +7 -1
- package/dist/{markdown-CuGw9_MP.js → markdown-B1mf5e0R.js} +34 -1
- package/dist/{mdx-CKsJ3cF4.js → mdx-BjBXyEeR.js} +2 -2
- package/dist/{micro-app-entry-xdTX5-ut.js → micro-app-entry-DYAnCRDo.js} +8132 -9649
- package/dist/micro-app.bundle.js +3 -3
- package/dist/micro-app.js +3565 -6710
- package/dist/{mips-BUWqP-OH.js → mips-DA33BZX1.js} +11 -1
- package/dist/{msdax-DtkouYCg.js → msdax-CCYFIQsP.js} +5 -1
- package/dist/{mysql-IkAsWSmF.js → mysql-hjmIjL-D.js} +11 -3
- package/dist/{objective-c-B2-ronfg.js → objective-c-RRCpEmqC.js} +2 -1
- package/dist/{pascal-Bsnz2eJA.js → pascal-CeV8XfxB.js} +13 -1
- package/dist/{pascaligo-D_sMUn0Q.js → pascaligo-IEEGVJAJ.js} +13 -1
- package/dist/{perl-BPzHt9SS.js → perl-B5-QbHq_.js} +34 -1
- package/dist/{pgsql-DlTJB0PD.js → pgsql-s6kqEJmi.js} +14 -4
- package/dist/{php-Dmq5OjwK.js → php-CWWqzOo8.js} +36 -1
- package/dist/{pla-HJcccrBy.js → pla-FSvb_YP_.js} +13 -1
- package/dist/{postiats-OQn6DKv-.js → postiats-DQdscQXO.js} +370 -1
- package/dist/{powerquery-DKaMYC8w.js → powerquery-CtA5JA1I.js} +7 -1
- package/dist/{powershell-DWeJHik1.js → powershell-DglEq96N.js} +13 -1
- package/dist/{protobuf-CBn_IseU.js → protobuf-BSepub3e.js} +5 -1
- package/dist/{pug-BoRpCINl.js → pug-B1847F4G.js} +16 -1
- package/dist/{python-zPpZYwLF.js → python-DLI1ji08.js} +59 -11
- package/dist/{qsharp-4rGyVZOw.js → qsharp-D4i0Nqg9.js} +28 -3
- package/dist/{r-DsgLhBOb.js → r-cdRigKxa.js} +5 -1
- package/dist/{razor-B_fCUeGX.js → razor-oAnIJsrL.js} +48 -4
- package/dist/{redis-B2fdL4Bg.js → redis-D9MFxvE8.js} +16 -6
- package/dist/{redshift-DoaeyCkH.js → redshift-CmCnsvL-.js} +13 -4
- package/dist/{restructuredtext-D-6OFBY9.js → restructuredtext-CWy8J51t.js} +19 -1
- package/dist/{ruby-D1DD6baV.js → ruby-WP-c36m5.js} +76 -3
- package/dist/runtime.js +34 -45
- package/dist/{rust-DssUV39M.js → rust-Q9FLdYpu.js} +13 -1
- package/dist/{sb-Dmb6tAdv.js → sb-C54-JBGT.js} +12 -1
- package/dist/{scala-Co3ETaym.js → scala-CzbFImc5.js} +24 -1
- package/dist/{scheme-CMrqXTty.js → scheme-BhfDmYN3.js} +1 -1
- package/dist/{scss-DkGudv8Q.js → scss-CEmiBXpS.js} +25 -1
- package/dist/{shell-BHN2BI4L.js → shell-Bmc1VhG0.js} +4 -1
- package/dist/{solidity-b-R-raGB.js → solidity-C9Q2I8Hh.js} +23 -1
- package/dist/{sophia-Y4GjyxNB.js → sophia-jWa1UyKz.js} +16 -1
- package/dist/{sparql-CDAPZb88.js → sparql-CM7jctbc.js} +15 -1
- package/dist/{sql-DkkpPiUq.js → sql-WzihTkbg.js} +42 -1
- package/dist/{st-CSPV91Ej.js → st-6y7_3aup.js} +8 -1
- package/dist/style.css +1 -1
- package/dist/{swift-DdSC5O48.js → swift-k-0zxG_D.js} +4 -1
- package/dist/{systemverilog-CI03XpAv.js → systemverilog-Pnr5_rIP.js} +29 -3
- package/dist/{tcl-B8DayMSI.js → tcl-fNPXval8.js} +7 -1
- package/dist/tsMode-D_PMsbjK.js +976 -0
- package/dist/{twig-B1AUPVB_.js → twig-L2MkztkV.js} +76 -1
- package/dist/{typescript-DrlYcCUn.js → typescript-Bu3ZbtQI.js} +23 -2
- package/dist/typespec-Cqqo-3Pt.js +123 -0
- package/dist/{vb-BIC7ccdG.js → vb-B5YC2xN9.js} +15 -1
- package/dist/{wgsl-C9yjop46.js → wgsl-D9BRtftY.js} +26 -1
- package/dist/{xml-BzP9D0eZ.js → xml-CNSSkPqy.js} +8 -2
- package/dist/{yaml-CT7GOvXu.js → yaml-5RF_PGNe.js} +30 -2
- package/handlers/compiler.ts +196 -16
- package/handlers/context-setup.ts +10 -5
- package/handlers/handler-api-factory.ts +358 -0
- package/handlers/handler-api.ts +379 -0
- package/handlers/handler-executor.ts +25 -5
- package/handlers/handler-scope.ts +398 -0
- package/handlers/index.ts +34 -2
- package/handlers/runtime-api/component-properties.ts +0 -8
- package/handlers/runtime-api/index.ts +1 -1
- package/handlers/runtime-api/toast.ts +1 -1
- package/index.ts +14 -115
- package/micro-app/README.md +10 -10
- package/micro-app/state/MicroAppRuntimeContext.ts +1 -28
- package/micro-app-entry.ts +0 -5
- package/package.json +22 -1
- package/redux/actions/application/index.ts +0 -1
- package/redux/actions/component/addComponentAction.ts +15 -4
- package/redux/actions/component/moveDraggedComponent.ts +1 -2
- package/redux/actions/component/update-component-name.ts +1 -1
- package/redux/actions/component/updateComponentAttributes.ts +7 -2
- package/redux/handlers/functions/build-function-handler.ts +11 -3
- package/redux/handlers/functions/deploy-function-handler.ts +11 -3
- package/redux/handlers/functions/invoke-function-handler.ts +11 -3
- package/redux/handlers/functions/load-functions-handler.ts +2 -1
- package/redux/handlers/functions/update-function-handler.ts +2 -1
- package/redux/store/component/component.interface.ts +8 -2
- package/redux/store/component/store.ts +1 -4
- package/state/runtime-context.ts +1 -23
- package/utils/RuntimeContextHelpers.ts +221 -90
- package/utils/change-detection.ts +125 -1
- package/utils/clipboard-utils.ts +18 -8
- package/utils/component-registry.ts +118 -0
- package/utils/index.ts +14 -1
- package/utils/naming-generator.ts +3 -1
- package/utils/randomness.ts +3 -1
- package/utils/register-components.ts +21 -29
- package/utils/render-util.ts +27 -48
- package/utils/toast.ts +97 -0
- package/vite.config.ts +29 -12
- package/components/ui/components/Event/EventAttribute/EventAttribute.style.ts +0 -11
- package/components/ui/components/Event/EventAttribute/EventAttribute.ts +0 -28
- package/components/ui/components/base/BaseElement/calculateStyles.ts +0 -31
- package/components/ui/components/base/BaseElement/drag-events.helpers.ts +0 -71
- package/components/ui/components/base/BaseElement/execute-event.helpers.ts +0 -45
- package/components/ui/components/base/BaseElement/interactions.helpers.ts +0 -14
- package/components/ui/components/wrappers/ComponentTitle/ComponentTitle.ts +0 -95
- package/components/ui/components/wrappers/GenerikWrapper/ResizeWrapper/ResizeWrapper.style.ts +0 -102
- package/components/ui/components/wrappers/GenerikWrapper/ResizeWrapper/ResizeWrapper.ts +0 -258
- package/components/ui/components/wrappers/PreviewWrapper.ts +0 -28
- package/components/ui/components/wrappers/RectangleSelection/RectangleSelection.ts +0 -154
- package/components/ui/nuraly-ui/packages/common/dist/constants/index.d.ts +0 -2
- package/components/ui/nuraly-ui/packages/common/dist/constants/index.js +0 -2
- package/components/ui/nuraly-ui/packages/common/dist/constants.d.ts +0 -17
- package/components/ui/nuraly-ui/packages/common/dist/constants.js +0 -7
- package/components/ui/nuraly-ui/packages/common/dist/controllers/index.d.ts +0 -2
- package/components/ui/nuraly-ui/packages/common/dist/controllers/index.js +0 -2
- package/components/ui/nuraly-ui/packages/common/dist/controllers.d.ts +0 -21
- package/components/ui/nuraly-ui/packages/common/dist/controllers.js +0 -22
- package/components/ui/nuraly-ui/packages/common/dist/index.d.ts +0 -25
- package/components/ui/nuraly-ui/packages/common/dist/index.js +0 -27
- package/components/ui/nuraly-ui/packages/common/dist/mixins/index.d.ts +0 -2
- package/components/ui/nuraly-ui/packages/common/dist/mixins/index.js +0 -3
- package/components/ui/nuraly-ui/packages/common/dist/mixins.d.ts +0 -26
- package/components/ui/nuraly-ui/packages/common/dist/mixins.js +0 -29
- package/components/ui/nuraly-ui/packages/common/dist/shared/base-mixin.d.ts +0 -42
- package/components/ui/nuraly-ui/packages/common/dist/shared/base-mixin.js +0 -38
- package/components/ui/nuraly-ui/packages/common/dist/shared/constants.d.ts +0 -1
- package/components/ui/nuraly-ui/packages/common/dist/shared/constants.js +0 -2
- package/components/ui/nuraly-ui/packages/common/dist/shared/controllers/dropdown.controller.d.ts +0 -77
- package/components/ui/nuraly-ui/packages/common/dist/shared/controllers/dropdown.controller.js +0 -341
- package/components/ui/nuraly-ui/packages/common/dist/shared/controllers/dropdown.interface.d.ts +0 -37
- package/components/ui/nuraly-ui/packages/common/dist/shared/controllers/dropdown.interface.js +0 -2
- package/components/ui/nuraly-ui/packages/common/dist/shared/controllers/index.d.ts +0 -4
- package/components/ui/nuraly-ui/packages/common/dist/shared/controllers/index.js +0 -4
- package/components/ui/nuraly-ui/packages/common/dist/shared/controllers/theme.controller.d.ts +0 -48
- package/components/ui/nuraly-ui/packages/common/dist/shared/controllers/theme.controller.js +0 -133
- package/components/ui/nuraly-ui/packages/common/dist/shared/dependency-mixin.d.ts +0 -37
- package/components/ui/nuraly-ui/packages/common/dist/shared/dependency-mixin.js +0 -141
- package/components/ui/nuraly-ui/packages/common/dist/shared/event-handler-mixin.d.ts +0 -64
- package/components/ui/nuraly-ui/packages/common/dist/shared/event-handler-mixin.js +0 -95
- package/components/ui/nuraly-ui/packages/common/dist/shared/index.d.ts +0 -13
- package/components/ui/nuraly-ui/packages/common/dist/shared/index.js +0 -17
- package/components/ui/nuraly-ui/packages/common/dist/shared/theme-mixin.d.ts +0 -78
- package/components/ui/nuraly-ui/packages/common/dist/shared/theme-mixin.js +0 -194
- package/components/ui/nuraly-ui/packages/common/dist/shared/themes.d.ts +0 -44
- package/components/ui/nuraly-ui/packages/common/dist/shared/themes.js +0 -85
- package/components/ui/nuraly-ui/packages/common/dist/shared/utils.d.ts +0 -60
- package/components/ui/nuraly-ui/packages/common/dist/shared/utils.js +0 -85
- package/components/ui/nuraly-ui/packages/common/dist/shared/validation.types.d.ts +0 -108
- package/components/ui/nuraly-ui/packages/common/dist/shared/validation.types.js +0 -17
- package/components/ui/nuraly-ui/packages/common/dist/themes/index.d.ts +0 -2
- package/components/ui/nuraly-ui/packages/common/dist/themes/index.js +0 -2
- package/components/ui/nuraly-ui/packages/common/dist/themes.d.ts +0 -22
- package/components/ui/nuraly-ui/packages/common/dist/themes.js +0 -23
- package/components/ui/nuraly-ui/packages/common/dist/utils/index.d.ts +0 -2
- package/components/ui/nuraly-ui/packages/common/dist/utils/index.js +0 -2
- package/components/ui/nuraly-ui/packages/common/dist/utils.d.ts +0 -21
- package/components/ui/nuraly-ui/packages/common/dist/utils.js +0 -22
- package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/LICENSE +0 -15
- package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/README.md +0 -294
- package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/copy/copy-sync.js +0 -171
- package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/copy/copy.js +0 -175
- package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/copy/index.js +0 -7
- package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/empty/index.js +0 -39
- package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/ensure/file.js +0 -66
- package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/ensure/index.js +0 -23
- package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/ensure/link.js +0 -64
- package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/ensure/symlink-paths.js +0 -101
- package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/ensure/symlink-type.js +0 -34
- package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/ensure/symlink.js +0 -67
- package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/fs/index.js +0 -146
- package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/index.js +0 -16
- package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/json/index.js +0 -16
- package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/json/jsonfile.js +0 -11
- package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/json/output-json-sync.js +0 -12
- package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/json/output-json.js +0 -12
- package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/mkdirs/index.js +0 -14
- package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/mkdirs/make-dir.js +0 -27
- package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/mkdirs/utils.js +0 -21
- package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/move/index.js +0 -7
- package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/move/move-sync.js +0 -55
- package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/move/move.js +0 -59
- package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/output-file/index.js +0 -31
- package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/path-exists/index.js +0 -12
- package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/remove/index.js +0 -17
- package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/util/async.js +0 -29
- package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/util/stat.js +0 -159
- package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/util/utimes.js +0 -36
- package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/LICENSE +0 -15
- package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/README.md +0 -294
- package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/copy/copy-sync.js +0 -171
- package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/copy/copy.js +0 -175
- package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/copy/index.js +0 -7
- package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/empty/index.js +0 -39
- package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/ensure/file.js +0 -66
- package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/ensure/index.js +0 -23
- package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/ensure/link.js +0 -64
- package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/ensure/symlink-paths.js +0 -101
- package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/ensure/symlink-type.js +0 -34
- package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/ensure/symlink.js +0 -67
- package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/fs/index.js +0 -146
- package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/index.js +0 -16
- package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/json/index.js +0 -16
- package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/json/jsonfile.js +0 -11
- package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/json/output-json-sync.js +0 -12
- package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/json/output-json.js +0 -12
- package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/mkdirs/index.js +0 -14
- package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/mkdirs/make-dir.js +0 -27
- package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/mkdirs/utils.js +0 -21
- package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/move/index.js +0 -7
- package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/move/move-sync.js +0 -55
- package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/move/move.js +0 -59
- package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/output-file/index.js +0 -31
- package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/path-exists/index.js +0 -12
- package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/remove/index.js +0 -17
- package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/util/async.js +0 -29
- package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/util/stat.js +0 -159
- package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/util/utimes.js +0 -36
- package/dist/SmartAttributeHandler-C4EliaG0.js +0 -153
- package/dist/SmartAttributeHandler-u-ZHGueR.js +0 -193
- package/dist/assets/editor.worker-C_S4Avdt.js +0 -11
- package/dist/assets/html.worker-DfuQASUV.js +0 -458
- package/dist/assets/json.worker-Cucz4wxY.js +0 -42
- package/dist/assets/ts.worker-Dme6S0YK.js +0 -37021
- package/dist/cssMode-CqMQ6Xsa.js +0 -1443
- package/dist/htmlMode-KglxyZXm.js +0 -1453
- package/dist/jsonMode-B3rqxD-b.js +0 -1863
- package/dist/tsMode-DEiq8fQ0.js +0 -800
- package/redux/actions/application/loadApplicationPermissionAction.ts +0 -10
- package/utils/styleUtil.ts +0 -7
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file FormRegisterable.ts
|
|
3
|
+
* @description Mixin for input blocks that need to register with parent forms.
|
|
4
|
+
* This enables form field discovery across Shadow DOM boundaries.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import { LitElement } from "lit";
|
|
8
|
+
|
|
9
|
+
export interface FormRegisterableElement extends LitElement {
|
|
10
|
+
inputHandlersValue?: any;
|
|
11
|
+
inputRef?: { value: HTMLElement | null };
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Dispatches a field registration event to the parent form-block.
|
|
16
|
+
* Uses composed: true to cross Shadow DOM boundaries.
|
|
17
|
+
*/
|
|
18
|
+
export function registerWithParentForm(
|
|
19
|
+
element: FormRegisterableElement,
|
|
20
|
+
nrElement: HTMLElement | null
|
|
21
|
+
): void {
|
|
22
|
+
const name = element.inputHandlersValue?.name;
|
|
23
|
+
|
|
24
|
+
if (!name || !nrElement) {
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
element.dispatchEvent(new CustomEvent('nr-field-register', {
|
|
29
|
+
bubbles: true,
|
|
30
|
+
composed: true,
|
|
31
|
+
detail: {
|
|
32
|
+
element: nrElement,
|
|
33
|
+
name: name,
|
|
34
|
+
blockElement: element
|
|
35
|
+
}
|
|
36
|
+
}));
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Dispatches a field unregistration event to the parent form-block.
|
|
41
|
+
*/
|
|
42
|
+
export function unregisterFromParentForm(
|
|
43
|
+
element: FormRegisterableElement
|
|
44
|
+
): void {
|
|
45
|
+
const name = element.inputHandlersValue?.name;
|
|
46
|
+
|
|
47
|
+
if (!name) {
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
element.dispatchEvent(new CustomEvent('nr-field-unregister', {
|
|
52
|
+
bubbles: true,
|
|
53
|
+
composed: true,
|
|
54
|
+
detail: {
|
|
55
|
+
name: name,
|
|
56
|
+
blockElement: element
|
|
57
|
+
}
|
|
58
|
+
}));
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Dispatches a field value change event to the parent form-block.
|
|
63
|
+
*/
|
|
64
|
+
export function notifyFieldValueChange(
|
|
65
|
+
element: FormRegisterableElement,
|
|
66
|
+
value: any
|
|
67
|
+
): void {
|
|
68
|
+
const name = element.inputHandlersValue?.name;
|
|
69
|
+
|
|
70
|
+
if (!name) {
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
element.dispatchEvent(new CustomEvent('nr-field-value-change', {
|
|
75
|
+
bubbles: true,
|
|
76
|
+
composed: true,
|
|
77
|
+
detail: {
|
|
78
|
+
name: name,
|
|
79
|
+
value: value,
|
|
80
|
+
blockElement: element
|
|
81
|
+
}
|
|
82
|
+
}));
|
|
83
|
+
}
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file DragDropController.ts
|
|
3
|
+
* @description Controller for handling drag and drop interactions in editor mode
|
|
4
|
+
* Manages drag wrappers and drop zone indicators
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import type { ReactiveController } from "lit";
|
|
8
|
+
import { html, nothing } from "lit";
|
|
9
|
+
import type { DragDropHost, Disposable, Activatable, DragWrapperPosition } from "../types/base-element.types";
|
|
10
|
+
|
|
11
|
+
// Import drag wrapper component
|
|
12
|
+
import "../../wrappers/GenerikWrapper/DragWrapper/DragWrapper";
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Controller responsible for drag and drop functionality
|
|
16
|
+
* Only active in editor mode (not view mode)
|
|
17
|
+
*/
|
|
18
|
+
export class DragDropController implements ReactiveController, Disposable, Activatable {
|
|
19
|
+
private host: DragDropHost;
|
|
20
|
+
private isActive = false;
|
|
21
|
+
|
|
22
|
+
// Bound event handlers for proper cleanup
|
|
23
|
+
private boundDragEnter: (e: DragEvent) => void;
|
|
24
|
+
private boundDrop: (e: DragEvent) => void;
|
|
25
|
+
private boundDragLeave: (e: DragEvent) => void;
|
|
26
|
+
|
|
27
|
+
constructor(host: DragDropHost) {
|
|
28
|
+
this.host = host;
|
|
29
|
+
host.addController(this);
|
|
30
|
+
|
|
31
|
+
// Bind handlers
|
|
32
|
+
this.boundDragEnter = this.handleDragEnter.bind(this);
|
|
33
|
+
this.boundDrop = this.handleDrop.bind(this);
|
|
34
|
+
this.boundDragLeave = this.handleDragLeave.bind(this);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
hostConnected(): void {
|
|
38
|
+
// Controller is activated separately via activate()
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
hostDisconnected(): void {
|
|
42
|
+
this.deactivate();
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Activate drag-drop controller (editor mode only)
|
|
47
|
+
*/
|
|
48
|
+
activate(): void {
|
|
49
|
+
if (this.isActive || this.host.isViewMode) return;
|
|
50
|
+
this.isActive = true;
|
|
51
|
+
|
|
52
|
+
// Find closest wrapper
|
|
53
|
+
this.host.closestGenericComponentWrapper = this.host.closest?.(
|
|
54
|
+
"generik-component-wrapper"
|
|
55
|
+
) as HTMLElement | null;
|
|
56
|
+
|
|
57
|
+
// Add DOM event listeners
|
|
58
|
+
this.host.addEventListener("dragenter", this.boundDragEnter);
|
|
59
|
+
this.host.addEventListener("drop", this.boundDrop);
|
|
60
|
+
this.host.addEventListener("dragleave", this.boundDragLeave);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Deactivate drag-drop controller
|
|
65
|
+
*/
|
|
66
|
+
deactivate(): void {
|
|
67
|
+
if (!this.isActive) return;
|
|
68
|
+
this.isActive = false;
|
|
69
|
+
|
|
70
|
+
// Remove DOM event listeners
|
|
71
|
+
this.host.removeEventListener("dragenter", this.boundDragEnter);
|
|
72
|
+
this.host.removeEventListener("drop", this.boundDrop);
|
|
73
|
+
this.host.removeEventListener("dragleave", this.boundDragLeave);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Handle drag enter event
|
|
78
|
+
*/
|
|
79
|
+
private handleDragEnter(_e: DragEvent): void {
|
|
80
|
+
this.notifyDragWrappers("drag-over-component");
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Handle drop event
|
|
85
|
+
*/
|
|
86
|
+
private handleDrop(_e: DragEvent): void {
|
|
87
|
+
this.notifyDragWrappers("drag-leave-component");
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Handle drag leave event
|
|
92
|
+
*/
|
|
93
|
+
private handleDragLeave(_e: DragEvent): void {
|
|
94
|
+
this.notifyDragWrappers("drag-leave-component");
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Notify drag wrappers of drag events
|
|
99
|
+
*/
|
|
100
|
+
private notifyDragWrappers(eventType: string): void {
|
|
101
|
+
const wrappers = this.host.shadowRoot?.querySelectorAll("drag-wrapper");
|
|
102
|
+
wrappers?.forEach((wrapper) => {
|
|
103
|
+
wrapper.dispatchEvent(
|
|
104
|
+
new CustomEvent(eventType, {
|
|
105
|
+
bubbles: true,
|
|
106
|
+
composed: true,
|
|
107
|
+
})
|
|
108
|
+
);
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* Render drag wrappers for editor mode
|
|
114
|
+
*/
|
|
115
|
+
renderWrappers(itemIndex?: number) {
|
|
116
|
+
if (!this.isActive) return nothing;
|
|
117
|
+
|
|
118
|
+
const { component, inputRef, isDragInitiator } = this.host;
|
|
119
|
+
const componentData = { ...component };
|
|
120
|
+
|
|
121
|
+
return html`
|
|
122
|
+
${[0, undefined].includes(itemIndex)
|
|
123
|
+
? html`
|
|
124
|
+
<drag-wrapper
|
|
125
|
+
.where=${"before" as DragWrapperPosition}
|
|
126
|
+
.message=${"Drop before"}
|
|
127
|
+
.component=${componentData}
|
|
128
|
+
.inputRef=${inputRef}
|
|
129
|
+
.isDragInitiator=${isDragInitiator}
|
|
130
|
+
></drag-wrapper>
|
|
131
|
+
`
|
|
132
|
+
: nothing}
|
|
133
|
+
`;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* Render after drag wrapper
|
|
138
|
+
*/
|
|
139
|
+
renderAfterWrapper() {
|
|
140
|
+
if (!this.isActive) return nothing;
|
|
141
|
+
|
|
142
|
+
const { component, inputRef, isDragInitiator } = this.host;
|
|
143
|
+
|
|
144
|
+
return html`
|
|
145
|
+
<drag-wrapper
|
|
146
|
+
.where=${"after" as DragWrapperPosition}
|
|
147
|
+
.message=${"Drop after"}
|
|
148
|
+
.component=${{ ...component }}
|
|
149
|
+
.inputRef=${inputRef}
|
|
150
|
+
.isDragInitiator=${isDragInitiator}
|
|
151
|
+
></drag-wrapper>
|
|
152
|
+
`;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* Set drag initiator state
|
|
157
|
+
*/
|
|
158
|
+
setDragInitiator(isInitiator: boolean): void {
|
|
159
|
+
this.host.isDragInitiator = isInitiator;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
/**
|
|
163
|
+
* Check if this component is the drag initiator
|
|
164
|
+
*/
|
|
165
|
+
isDragInitiator(): boolean {
|
|
166
|
+
return this.host.isDragInitiator;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
/**
|
|
170
|
+
* Clean up all resources
|
|
171
|
+
*/
|
|
172
|
+
dispose(): void {
|
|
173
|
+
this.deactivate();
|
|
174
|
+
}
|
|
175
|
+
}
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file ErrorController.ts
|
|
3
|
+
* @description Controller for managing and displaying component errors
|
|
4
|
+
* Handles error tracking, display, and user interactions
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import type { ReactiveController } from "lit";
|
|
8
|
+
import { html, nothing } from "lit";
|
|
9
|
+
import { $debug } from "../../../../../redux/store/debug";
|
|
10
|
+
import { hasOnlyEmptyObjects } from "../../../../../utils/object.utils";
|
|
11
|
+
import type { ErrorHost, Disposable, Activatable } from "../types/base-element.types";
|
|
12
|
+
|
|
13
|
+
// Import error display component
|
|
14
|
+
import "../BaseElement/handler-component-error";
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Controller responsible for error management and display
|
|
18
|
+
* Only active in editor mode (not view mode)
|
|
19
|
+
*/
|
|
20
|
+
export class ErrorController implements ReactiveController, Disposable, Activatable {
|
|
21
|
+
private host: ErrorHost;
|
|
22
|
+
private isActive = false;
|
|
23
|
+
|
|
24
|
+
constructor(host: ErrorHost) {
|
|
25
|
+
this.host = host;
|
|
26
|
+
host.addController(this);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
hostConnected(): void {
|
|
30
|
+
// Controller is activated separately via activate()
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
hostDisconnected(): void {
|
|
34
|
+
this.deactivate();
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Activate error controller (editor mode only)
|
|
39
|
+
*/
|
|
40
|
+
activate(): void {
|
|
41
|
+
if (this.isActive || this.host.isViewMode) return;
|
|
42
|
+
this.isActive = true;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Deactivate error controller
|
|
47
|
+
*/
|
|
48
|
+
deactivate(): void {
|
|
49
|
+
if (!this.isActive) return;
|
|
50
|
+
this.isActive = false;
|
|
51
|
+
this.host.displayErrorPanel = false;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Get current component errors from debug store
|
|
56
|
+
*/
|
|
57
|
+
getErrors(): Record<string, any> | null {
|
|
58
|
+
const debugState = $debug.get();
|
|
59
|
+
return debugState?.error?.components?.[this.host.component.uuid]?.errors ?? null;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Check if component has any errors
|
|
64
|
+
*/
|
|
65
|
+
hasErrors(): boolean {
|
|
66
|
+
const errors = this.getErrors();
|
|
67
|
+
return errors !== null && !hasOnlyEmptyObjects(errors);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Show error panel
|
|
72
|
+
*/
|
|
73
|
+
showPanel(): void {
|
|
74
|
+
this.host.displayErrorPanel = true;
|
|
75
|
+
this.host.requestUpdate();
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Hide error panel
|
|
80
|
+
*/
|
|
81
|
+
hidePanel(): void {
|
|
82
|
+
this.host.displayErrorPanel = false;
|
|
83
|
+
this.host.requestUpdate();
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* Toggle error panel visibility
|
|
88
|
+
*/
|
|
89
|
+
togglePanel(): void {
|
|
90
|
+
this.host.displayErrorPanel = !this.host.displayErrorPanel;
|
|
91
|
+
this.host.requestUpdate();
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Render error indicator and panel
|
|
96
|
+
*/
|
|
97
|
+
renderError() {
|
|
98
|
+
if (!this.isActive) return nothing;
|
|
99
|
+
|
|
100
|
+
const errors = this.getErrors();
|
|
101
|
+
if (!errors || hasOnlyEmptyObjects(errors)) return nothing;
|
|
102
|
+
|
|
103
|
+
return html`
|
|
104
|
+
<div
|
|
105
|
+
@mouseenter=${() => this.showPanel()}
|
|
106
|
+
@mouseleave=${() => this.hidePanel()}
|
|
107
|
+
style="position: absolute; z-index: 1000;"
|
|
108
|
+
>
|
|
109
|
+
<nr-icon
|
|
110
|
+
name="info-circle"
|
|
111
|
+
style="
|
|
112
|
+
z-index: 1000;
|
|
113
|
+
--nuraly-icon-width: 20px;
|
|
114
|
+
--nuraly-icon-height: 25px;
|
|
115
|
+
--nuraly-icon-color: red;
|
|
116
|
+
position: absolute;
|
|
117
|
+
cursor: pointer;
|
|
118
|
+
"
|
|
119
|
+
>
|
|
120
|
+
Error
|
|
121
|
+
</nr-icon>
|
|
122
|
+
${this.host.displayErrorPanel
|
|
123
|
+
? html`
|
|
124
|
+
<handler-component-error-block
|
|
125
|
+
.error=${errors}
|
|
126
|
+
></handler-component-error-block>
|
|
127
|
+
`
|
|
128
|
+
: nothing}
|
|
129
|
+
</div>
|
|
130
|
+
`;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* Get error summary for display
|
|
135
|
+
*/
|
|
136
|
+
getErrorSummary(): { count: number; messages: string[] } {
|
|
137
|
+
const errors = this.getErrors();
|
|
138
|
+
if (!errors) return { count: 0, messages: [] };
|
|
139
|
+
|
|
140
|
+
const messages: string[] = [];
|
|
141
|
+
let count = 0;
|
|
142
|
+
|
|
143
|
+
for (const [key, value] of Object.entries(errors)) {
|
|
144
|
+
if (value && typeof value === "object" && "error" in value) {
|
|
145
|
+
count++;
|
|
146
|
+
messages.push(`${key}: ${value.error}`);
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
return { count, messages };
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* Clear all errors for this component
|
|
155
|
+
*/
|
|
156
|
+
clearErrors(): void {
|
|
157
|
+
this.host.errors = {};
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* Add an error for a specific input
|
|
162
|
+
*/
|
|
163
|
+
addError(inputName: string, message: string): void {
|
|
164
|
+
this.host.errors[inputName] = { error: message };
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
/**
|
|
168
|
+
* Remove an error for a specific input
|
|
169
|
+
*/
|
|
170
|
+
removeError(inputName: string): void {
|
|
171
|
+
delete this.host.errors[inputName];
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
/**
|
|
175
|
+
* Clean up all resources
|
|
176
|
+
*/
|
|
177
|
+
dispose(): void {
|
|
178
|
+
this.deactivate();
|
|
179
|
+
}
|
|
180
|
+
}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file EventController.ts
|
|
3
|
+
* @description Controller for handling component event execution
|
|
4
|
+
* Manages event dispatching and handler execution
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import type { ReactiveController } from "lit";
|
|
8
|
+
import { getNestedAttribute } from "../../../../../utils/object.utils";
|
|
9
|
+
import { executeHandler } from "../../../../../state/runtime-context";
|
|
10
|
+
import type { EventHandlerHost, Disposable, EventExecutionOptions } from "../types/base-element.types";
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Controller responsible for component event handling
|
|
14
|
+
* Extracts event execution logic from BaseElement for better separation of concerns
|
|
15
|
+
*/
|
|
16
|
+
export class EventController implements ReactiveController, Disposable {
|
|
17
|
+
private host: EventHandlerHost;
|
|
18
|
+
private isConnected = false;
|
|
19
|
+
|
|
20
|
+
constructor(host: EventHandlerHost) {
|
|
21
|
+
this.host = host;
|
|
22
|
+
host.addController(this);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
hostConnected(): void {
|
|
26
|
+
this.isConnected = true;
|
|
27
|
+
this.executeOnInit();
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
hostDisconnected(): void {
|
|
31
|
+
this.isConnected = false;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Execute the onInit event handler if present
|
|
36
|
+
*/
|
|
37
|
+
executeOnInit(): void {
|
|
38
|
+
const code = getNestedAttribute(this.host.component, "event.onInit");
|
|
39
|
+
if (code) {
|
|
40
|
+
try {
|
|
41
|
+
executeHandler(
|
|
42
|
+
this.host.component,
|
|
43
|
+
code,
|
|
44
|
+
{},
|
|
45
|
+
{ ...this.host.item }
|
|
46
|
+
);
|
|
47
|
+
} catch (error) {
|
|
48
|
+
console.error("Error executing onInit handler:", error);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Execute a component event handler
|
|
55
|
+
*/
|
|
56
|
+
execute(eventName: string, event?: Event, data: Record<string, any> = {}): void {
|
|
57
|
+
if (!this.isConnected) return;
|
|
58
|
+
|
|
59
|
+
const { component, item, uniqueUUID } = this.host;
|
|
60
|
+
const code = component.event?.[eventName];
|
|
61
|
+
|
|
62
|
+
if (!code) return;
|
|
63
|
+
|
|
64
|
+
try {
|
|
65
|
+
const eventData = {
|
|
66
|
+
...data,
|
|
67
|
+
event,
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
executeHandler(
|
|
71
|
+
{ ...component, uniqueUUID },
|
|
72
|
+
getNestedAttribute(component, `event.${eventName}`),
|
|
73
|
+
eventData,
|
|
74
|
+
item
|
|
75
|
+
);
|
|
76
|
+
} catch (error) {
|
|
77
|
+
console.error(`Error executing event "${eventName}":`, error);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Execute multiple events in sequence
|
|
83
|
+
*/
|
|
84
|
+
executeMultiple(events: EventExecutionOptions[]): void {
|
|
85
|
+
for (const { eventName, event, data } of events) {
|
|
86
|
+
this.execute(eventName, event, data);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Check if component has a specific event handler
|
|
92
|
+
*/
|
|
93
|
+
hasEventHandler(eventName: string): boolean {
|
|
94
|
+
return !!this.host.component.event?.[eventName];
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Get list of all event handler names
|
|
99
|
+
*/
|
|
100
|
+
getEventHandlerNames(): string[] {
|
|
101
|
+
const events = this.host.component.event;
|
|
102
|
+
if (!events) return [];
|
|
103
|
+
return Object.keys(events).filter((key) => !!events[key]);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Clean up resources
|
|
108
|
+
*/
|
|
109
|
+
dispose(): void {
|
|
110
|
+
this.isConnected = false;
|
|
111
|
+
}
|
|
112
|
+
}
|