@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.
- 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 +3 -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 +352 -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 +11 -13
- package/components/ui/components/inputs/Select/Select.ts +38 -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 +209 -0
- package/components/ui/components/layout/Grid/Row.style.ts +73 -0
- package/components/ui/components/layout/Grid/Row.ts +166 -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 +472 -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-Bf4L2rO_.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-DMsdy1N0.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-D51H9HYi.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-CF6gdAX4.js} +38 -4
- package/dist/{hcl-6NT8Kbna.js → hcl-YBvpaUqf.js} +13 -1
- package/dist/{html-C6wR7sMB.js → html-c2n_zkM3.js} +37 -4
- package/dist/htmlMode-9IJTuZUh.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-DhEEBMxD.js} +3 -2
- package/dist/jsonMode-CB6k-4rp.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-CwtPiwnW.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-LewPRYF8.js} +2 -2
- package/dist/{micro-app-entry-xdTX5-ut.js → micro-app-entry-C3RDIukG.js} +8082 -9628
- package/dist/micro-app.bundle.js +3 -3
- package/dist/micro-app.js +3585 -6759
- 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-h5Z2g-yl.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-D5ep1Doy.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-B_6LiBE1.js +976 -0
- package/dist/{twig-B1AUPVB_.js → twig-L2MkztkV.js} +76 -1
- package/dist/{typescript-DrlYcCUn.js → typescript-BBG0jH4p.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-DgLB7rE6.js} +8 -2
- package/dist/{yaml-CT7GOvXu.js → yaml-DiI4HpSv.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 +19 -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
|
@@ -1,711 +1,330 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @file
|
|
3
|
-
* @description
|
|
4
|
-
*
|
|
2
|
+
* @file BaseElement.ts
|
|
3
|
+
* @description Refactored base component class using controllers and mixins
|
|
4
|
+
* Clean separation of concerns with improved maintainability
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import { html, LitElement, nothing, type
|
|
7
|
+
import { html, LitElement, nothing, type PropertyValues } from "lit";
|
|
8
8
|
import { property, state } from "lit/decorators.js";
|
|
9
|
-
import { eventDispatcher } from '../../../../utils/change-detection.ts';
|
|
10
|
-
import { executeHandler } from '../../../../handlers/handler-executor';
|
|
11
|
-
import { ExecuteInstance } from '../../../../state/runtime-context';
|
|
12
|
-
import { getNestedAttribute, hasOnlyEmptyObjects } from '../../../../utils/object.utils.ts';
|
|
13
|
-
import Editor from '../../../../state/editor.ts';
|
|
14
|
-
import EditorInstance, { getInitPlatform } from '../../../../state/editor.ts';
|
|
15
9
|
import { createRef, type Ref } from "lit/directives/ref.js";
|
|
16
|
-
import { $hoveredComponent, $runtimeStylescomponentStyleByID } from '../../../../redux/store/component/store.ts';
|
|
17
|
-
import "../wrappers/GenerikWrapper/DragWrapper/DragWrapper.ts";
|
|
18
|
-
import { RuntimeHelpers } from '../../../../utils/runtime-helpers.ts';
|
|
19
|
-
import { setContextMenuEvent } from '../../../../redux/actions/page/setContextMenuEvent.ts';
|
|
20
|
-
import { addlogDebug } from '../../../../redux/actions/debug/store.ts';
|
|
21
|
-
import { $debug } from '../../../../redux/store/debug.ts';
|
|
22
|
-
import { Subscription } from "rxjs";
|
|
23
|
-
import "./BaseElement/handler-component-error.ts";
|
|
24
|
-
import { scrollToTarget, setupHashScroll, traitInputHandler, traitStyleHandler } from "./BaseElement/input-handler.helpers.ts";
|
|
25
|
-
import { calculateStyles } from "./BaseElement/calculateStyles.ts";
|
|
26
|
-
import { handleMouseEnter, handleMouseLeave } from "./BaseElement/interactions.helpers.ts";
|
|
27
|
-
import { handleComponentEvent } from "./BaseElement/execute-event.helpers.ts";
|
|
28
|
-
import type { ComponentElement } from '../../../../redux/store/component/component.interface.ts';
|
|
29
10
|
import { v4 as uuidv4 } from "uuid";
|
|
30
11
|
|
|
12
|
+
// Controllers
|
|
13
|
+
import { InputHandlerController } from "./controllers/InputHandlerController";
|
|
14
|
+
import { StyleHandlerController } from "./controllers/StyleHandlerController";
|
|
15
|
+
import { EventController } from "./controllers/EventController";
|
|
16
|
+
|
|
17
|
+
// Mixins
|
|
18
|
+
import { EditorModeMixin } from "./mixins/EditorModeMixin";
|
|
19
|
+
|
|
20
|
+
// Types and utilities
|
|
21
|
+
import type { ComponentElement } from "../../../../redux/store/component/component.interface";
|
|
22
|
+
import { ExecuteInstance } from "../../../../state/runtime-context";
|
|
23
|
+
import { getInitPlatform } from "../../../../state/editor";
|
|
24
|
+
import { setupHashScroll, scrollToTarget } from "./BaseElement/input-handler.helpers";
|
|
31
25
|
|
|
32
26
|
/**
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
* @extends {LitElement}
|
|
27
|
+
* Core BaseElement without editor-specific functionality
|
|
28
|
+
* This class contains only essential rendering and data processing logic
|
|
37
29
|
*/
|
|
38
|
-
export class
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
30
|
+
export class BaseElementCore extends LitElement {
|
|
31
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
32
|
+
// CORE PROPERTIES
|
|
33
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
34
|
+
|
|
35
|
+
/** Component definition from the editor */
|
|
36
|
+
@property({ type: Object }) component!: ComponentElement;
|
|
37
|
+
|
|
38
|
+
/** Data item for list/loop rendering */
|
|
39
|
+
@property({ type: Object, reflect: true }) item: any;
|
|
40
|
+
|
|
41
|
+
/** Parent component reference */
|
|
42
|
+
@property({ type: Object }) parentcomponent!: ComponentElement;
|
|
43
|
+
|
|
44
|
+
/** View mode flag - disables editor features when true */
|
|
46
45
|
@property({ type: Boolean }) isViewMode = false;
|
|
47
|
-
|
|
48
|
-
/** @state {Object} Values from input handlers */
|
|
49
|
-
@state() inputHandlersValue: any = {};
|
|
50
|
-
|
|
51
|
-
/** @state {Object} Values from style handlers */
|
|
52
|
-
@state() stylesHandlersValue = {};
|
|
53
|
-
|
|
54
|
-
@property({ type: Object }) parentcomponent: ComponentElement;
|
|
55
|
-
|
|
56
|
-
/** @state {Object} Registered callbacks for input handlers */
|
|
57
|
-
@state() callbacks = {};
|
|
58
|
-
|
|
59
|
-
/** @state {boolean} Whether component is in editable state */
|
|
60
|
-
@state() isEditable = false;
|
|
61
|
-
|
|
62
|
-
/** @state {ComponentElement} Currently hovered component */
|
|
63
|
-
@state() hoveredComponent;
|
|
64
|
-
|
|
65
|
-
/** @state {boolean} Whether this component initiated drag */
|
|
66
|
-
@state() isDragInitiator = false;
|
|
67
|
-
|
|
68
|
-
/** @state {HTMLElement} Reference to closest wrapper element */
|
|
69
|
-
@state() closestGenericComponentWrapper;
|
|
70
|
-
|
|
71
|
-
/** @state {ComponentElement} Currently selected component */
|
|
72
|
-
@state() selectedComponent;
|
|
73
|
-
|
|
74
|
-
/** @state {DraggingComponentInfo} Information about dragging state */
|
|
75
|
-
@state() draggingComponentInfo;
|
|
76
|
-
|
|
77
|
-
/** @state {Array} Currently selected components */
|
|
78
|
-
@state() currentSelection = [];
|
|
79
|
-
|
|
80
|
-
/** @state {Object} Calculated component styles */
|
|
81
|
-
@state() calculatedStyles = {};
|
|
82
|
-
|
|
83
|
-
/** @state {boolean} Whether component is connected to DOM */
|
|
84
|
-
@state() isConnected2 = false;
|
|
85
|
-
|
|
86
|
-
/** @state {boolean} Whether to display error panel */
|
|
87
|
-
@state() displayErrorPanel;
|
|
88
|
-
|
|
89
|
-
/** @state {Object} Component errors */
|
|
90
|
-
@state() errors = {};
|
|
91
|
-
|
|
92
|
-
/** @state {Object} Runtime styles */
|
|
93
|
-
@state() runtimeStyles = {};
|
|
94
|
-
|
|
95
|
-
/** @state {Ref<Element>} Reference to main input element */
|
|
96
|
-
@state() inputRef = createRef();
|
|
97
|
-
|
|
98
|
-
/** @type {any} Instance of execution environment */
|
|
99
|
-
ExecuteInstance;
|
|
100
|
-
|
|
101
|
-
/** @type {any} Current platform information */
|
|
102
|
-
currentPlatform;
|
|
103
|
-
|
|
104
|
-
/** @type {Object} Component style definitions */
|
|
105
|
-
componentStyles = {};
|
|
106
|
-
|
|
107
|
-
/** @type {Subscription} RxJS subscription for cleanup */
|
|
108
|
-
private subscription = new Subscription();
|
|
109
|
-
|
|
110
|
-
/** @type {Array} List of event handlers */
|
|
111
|
-
eventsManager = [];
|
|
112
|
-
|
|
113
|
-
uniqueUUID = uuidv4();
|
|
114
|
-
|
|
115
|
-
// Bound event handlers
|
|
116
|
-
/**
|
|
117
|
-
* @type {Function} Bound mouse enter event handler
|
|
118
|
-
* @private
|
|
119
|
-
*/
|
|
120
|
-
private mouseEnterHandlerBound = this.mouseEnterHandler.bind(this);
|
|
121
|
-
|
|
122
|
-
/**
|
|
123
|
-
* @type {Function} Bound mouse leave event handler
|
|
124
|
-
* @private
|
|
125
|
-
*/
|
|
126
|
-
private mouseLeaveHandlerBound = this.mouseLeaveHandler.bind(this);
|
|
127
|
-
|
|
128
|
-
/**
|
|
129
|
-
* @type {Function} Bound drag enter event handler
|
|
130
|
-
* @private
|
|
131
|
-
*/
|
|
132
|
-
private dragEnterHandlerBound = this.dragEnterHandler.bind(this);
|
|
133
|
-
|
|
134
|
-
/**
|
|
135
|
-
* @type {Function} Bound drop event handler
|
|
136
|
-
* @private
|
|
137
|
-
*/
|
|
138
|
-
private dropHandlerBound = this.dropHandler.bind(this);
|
|
139
|
-
|
|
140
|
-
/**
|
|
141
|
-
* @type {Function} Bound drag leave event handler
|
|
142
|
-
* @private
|
|
143
|
-
*/
|
|
144
|
-
private dragLeaveHandlerBound = this.dragLeaveHandler.bind(this);
|
|
145
|
-
|
|
146
|
-
/**
|
|
147
|
-
* @type {Function} Bound context menu event handler
|
|
148
|
-
* @private
|
|
149
|
-
*/
|
|
150
|
-
private onContextMenuBound = this.onContextMenu.bind(this);
|
|
151
|
-
|
|
152
|
-
/**
|
|
153
|
-
* @type {Function} Bound component selection handler
|
|
154
|
-
* @private
|
|
155
|
-
*/
|
|
156
|
-
private selectComponentActionClickBound = (e) => {
|
|
157
|
-
if (!this.isViewMode) {
|
|
158
|
-
this.selectComponentAction(e);
|
|
159
|
-
e.preventDefault();
|
|
160
|
-
e.stopPropagation();
|
|
161
|
-
}
|
|
162
|
-
};
|
|
163
|
-
|
|
164
|
-
/**
|
|
165
|
-
* @type {Function} Hash change handler for scrolling
|
|
166
|
-
*/
|
|
167
|
-
handleHash;
|
|
168
46
|
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
47
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
48
|
+
// STATE
|
|
49
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
50
|
+
|
|
51
|
+
/** Computed values from input handlers */
|
|
52
|
+
@state() inputHandlersValue: Record<string, any> = {};
|
|
53
|
+
|
|
54
|
+
/** Computed values from style handlers */
|
|
55
|
+
@state() stylesHandlersValue: Record<string, any> = {};
|
|
56
|
+
|
|
57
|
+
/** Calculated component styles */
|
|
58
|
+
@state() calculatedStyles: Record<string, any> = {};
|
|
59
|
+
|
|
60
|
+
/** Component errors by input name */
|
|
61
|
+
@state() errors: Record<string, any> = {};
|
|
62
|
+
|
|
63
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
64
|
+
// REFS & IDENTIFIERS
|
|
65
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
66
|
+
|
|
67
|
+
/** Reference to the main rendered element */
|
|
68
|
+
inputRef: Ref<HTMLElement> = createRef();
|
|
69
|
+
|
|
70
|
+
/** Unique instance ID for this component instance */
|
|
71
|
+
readonly uniqueUUID = uuidv4();
|
|
72
|
+
|
|
73
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
74
|
+
// CONTROLLERS
|
|
75
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
76
|
+
|
|
77
|
+
/** Controller for processing input handlers */
|
|
78
|
+
protected inputController: InputHandlerController;
|
|
79
|
+
|
|
80
|
+
/** Controller for processing style handlers */
|
|
81
|
+
protected styleController: StyleHandlerController;
|
|
82
|
+
|
|
83
|
+
/** Controller for executing events */
|
|
84
|
+
protected eventController: EventController;
|
|
85
|
+
|
|
86
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
87
|
+
// CALLBACKS & EXTERNAL INTEGRATION
|
|
88
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
89
|
+
|
|
90
|
+
/** Registry for input value callbacks */
|
|
91
|
+
callbacks: Record<string, (val: any) => void> = {};
|
|
92
|
+
|
|
93
|
+
/** Execution instance for runtime context */
|
|
94
|
+
ExecuteInstance = ExecuteInstance;
|
|
95
|
+
|
|
96
|
+
/** Current platform (desktop/tablet/mobile) */
|
|
97
|
+
currentPlatform: string;
|
|
98
|
+
|
|
99
|
+
/** Component style definitions */
|
|
100
|
+
componentStyles: Record<string, any> = {};
|
|
101
|
+
|
|
102
|
+
/** Hash change handler reference */
|
|
103
|
+
private handleHash: () => void;
|
|
104
|
+
|
|
105
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
106
|
+
// CONSTRUCTOR
|
|
107
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
108
|
+
|
|
172
109
|
constructor() {
|
|
173
110
|
super();
|
|
174
|
-
|
|
111
|
+
|
|
112
|
+
// Initialize platform
|
|
175
113
|
this.currentPlatform = ExecuteInstance.Vars.currentPlatform ?? getInitPlatform();
|
|
176
|
-
|
|
177
|
-
|
|
114
|
+
|
|
115
|
+
// Initialize controllers
|
|
116
|
+
this.inputController = new InputHandlerController(this as any);
|
|
117
|
+
this.styleController = new StyleHandlerController(this as any);
|
|
118
|
+
this.eventController = new EventController(this as any);
|
|
119
|
+
|
|
120
|
+
// Setup hash scroll handler
|
|
121
|
+
this.handleHash = () =>
|
|
122
|
+
setupHashScroll(
|
|
123
|
+
this.inputRef as Ref<HTMLInputElement>,
|
|
124
|
+
this.id,
|
|
125
|
+
() => scrollToTarget(this.inputRef as Ref<HTMLInputElement>)
|
|
126
|
+
);
|
|
178
127
|
}
|
|
179
128
|
|
|
129
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
130
|
+
// CALLBACK REGISTRATION (for child components to react to input changes)
|
|
131
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
132
|
+
|
|
180
133
|
/**
|
|
181
|
-
*
|
|
182
|
-
*
|
|
183
|
-
* @param
|
|
184
|
-
* @param {Function} callback - Callback function to register
|
|
134
|
+
* Register a callback to be invoked when an input value changes
|
|
135
|
+
* @param inputName - Name of the input to watch
|
|
136
|
+
* @param callback - Function to call with new value
|
|
185
137
|
*/
|
|
186
|
-
registerCallback(inputName, callback) {
|
|
138
|
+
registerCallback(inputName: string, callback: (val: any) => void): void {
|
|
187
139
|
this.callbacks[inputName] = callback;
|
|
188
140
|
}
|
|
189
141
|
|
|
190
142
|
/**
|
|
191
|
-
*
|
|
192
|
-
*
|
|
193
|
-
* @param {string} inputName - Name of the input to unregister callback for
|
|
143
|
+
* Unregister a previously registered callback
|
|
144
|
+
* @param inputName - Name of the input callback to remove
|
|
194
145
|
*/
|
|
195
|
-
unregisterCallback(inputName) {
|
|
146
|
+
unregisterCallback(inputName: string): void {
|
|
196
147
|
delete this.callbacks[inputName];
|
|
197
148
|
}
|
|
198
149
|
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
* @param {PropertyValues} _ - Changed properties
|
|
203
|
-
* @protected
|
|
204
|
-
* @override
|
|
205
|
-
*/
|
|
206
|
-
protected firstUpdated(_) {
|
|
207
|
-
super.firstUpdated(_);
|
|
208
|
-
this.isConnected2 = true;
|
|
209
|
-
this.traitInputsHandlers();
|
|
210
|
-
this.traitStylesHandlers();
|
|
211
|
-
|
|
212
|
-
this.handleHash();
|
|
213
|
-
window.addEventListener("hashchange", this.handleHash);
|
|
214
|
-
this.subscription.add(
|
|
215
|
-
eventDispatcher.on("Vars:currentPlatform", () => {
|
|
216
|
-
this.traitInputsHandlers();
|
|
217
|
-
this.traitStylesHandlers();
|
|
218
|
-
})
|
|
219
|
-
)
|
|
220
|
-
|
|
221
|
-
this.subscription.add(
|
|
222
|
-
eventDispatcher.on(`component-input-refresh-request:${this.component.uuid}`, () => {
|
|
223
|
-
this.traitInputsHandlers();
|
|
224
|
-
this.traitStylesHandlers();
|
|
225
|
-
})
|
|
226
|
-
)
|
|
227
|
-
this.subscription.add(
|
|
228
|
-
|
|
229
|
-
eventDispatcher.on("Vars:currentEditingMode", () => {
|
|
230
|
-
const code = getNestedAttribute(this.component, `event.onInit`);
|
|
231
|
-
if (code) executeHandler(this.component, code, {}, { ...this.item });
|
|
232
|
-
}))
|
|
150
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
151
|
+
// LIFECYCLE METHODS
|
|
152
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
233
153
|
|
|
234
|
-
|
|
154
|
+
override connectedCallback(): void {
|
|
155
|
+
super.connectedCallback();
|
|
235
156
|
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
this.errors = {};
|
|
243
|
-
const inputs = Editor.getComponentBreakpointInputs(this.component);
|
|
157
|
+
// Add component class for styling
|
|
158
|
+
if (this.component?.uuid) {
|
|
159
|
+
this.classList.add(`component-${this.component.uuid}`);
|
|
160
|
+
// Add data attribute for iframe preview selection
|
|
161
|
+
this.dataset.componentUuid = this.component.uuid;
|
|
162
|
+
}
|
|
244
163
|
|
|
164
|
+
// Set component metadata
|
|
165
|
+
if (this.component) {
|
|
166
|
+
this.component.uniqueUUID = this.uniqueUUID;
|
|
167
|
+
this.component.parent = this.parentcomponent;
|
|
168
|
+
}
|
|
169
|
+
}
|
|
245
170
|
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
));
|
|
171
|
+
protected override firstUpdated(_changedProperties: PropertyValues): void {
|
|
172
|
+
super.firstUpdated(_changedProperties);
|
|
249
173
|
|
|
174
|
+
// Initial processing
|
|
175
|
+
this.inputController.processInputs();
|
|
176
|
+
this.styleController.processStyles();
|
|
250
177
|
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
178
|
+
// Setup hash-based scrolling
|
|
179
|
+
this.handleHash();
|
|
180
|
+
window.addEventListener("hashchange", this.handleHash);
|
|
254
181
|
}
|
|
255
182
|
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
* @returns {Promise<void>}
|
|
260
|
-
*/
|
|
261
|
-
async traitStylesHandlers() {
|
|
262
|
-
if (this.component?.styleHandlers) {
|
|
263
|
-
this.stylesHandlersValue = {};
|
|
264
|
-
await Promise.all(
|
|
265
|
-
Object.entries(this.component.styleHandlers).map(
|
|
266
|
-
([name, style]) => traitStyleHandler(this, style, name)
|
|
267
|
-
)
|
|
268
|
-
);
|
|
269
|
-
}
|
|
270
|
-
this.calculateStyles();
|
|
271
|
-
}
|
|
183
|
+
override disconnectedCallback(): void {
|
|
184
|
+
// Remove hash change listener (fix memory leak from original)
|
|
185
|
+
window.removeEventListener("hashchange", this.handleHash);
|
|
272
186
|
|
|
273
|
-
|
|
274
|
-
* Calculates and updates component styles
|
|
275
|
-
*
|
|
276
|
-
* @private
|
|
277
|
-
*/
|
|
278
|
-
private calculateStyles() {
|
|
279
|
-
calculateStyles(this);
|
|
187
|
+
super.disconnectedCallback();
|
|
280
188
|
}
|
|
281
189
|
|
|
282
|
-
|
|
283
|
-
* Handles component updates
|
|
284
|
-
*
|
|
285
|
-
* @param {PropertyValueMap<any>} changedProperties - Map of changed properties
|
|
286
|
-
* @override
|
|
287
|
-
*/
|
|
288
|
-
override update(changedProperties) {
|
|
190
|
+
protected override update(changedProperties: PropertyValues): void {
|
|
289
191
|
super.update(changedProperties);
|
|
290
192
|
|
|
291
193
|
if (changedProperties.has("component")) {
|
|
292
|
-
const prev = changedProperties.get("component");
|
|
194
|
+
const prev = changedProperties.get("component") as ComponentElement | undefined;
|
|
293
195
|
const curr = this.component;
|
|
294
196
|
|
|
197
|
+
// Re-run onInit if it changed
|
|
295
198
|
if (prev?.event?.onInit !== curr?.event?.onInit) {
|
|
296
|
-
|
|
199
|
+
this.eventController.executeOnInit();
|
|
297
200
|
}
|
|
298
|
-
this.component.uniqueUUID = this.uniqueUUID;
|
|
299
|
-
this.component.parent = this.parentcomponent;
|
|
300
201
|
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
this.
|
|
304
|
-
|
|
305
|
-
//
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
// Re-process handlers even if UUID hasn't changed
|
|
310
|
-
// This ensures property updates in the studio are reflected
|
|
202
|
+
// Update component metadata
|
|
203
|
+
if (curr) {
|
|
204
|
+
curr.uniqueUUID = this.uniqueUUID;
|
|
205
|
+
curr.parent = this.parentcomponent;
|
|
206
|
+
// Update data attribute for iframe preview selection
|
|
207
|
+
if (curr.uuid) {
|
|
208
|
+
this.dataset.componentUuid = curr.uuid;
|
|
209
|
+
}
|
|
311
210
|
}
|
|
312
|
-
}
|
|
313
|
-
}
|
|
314
211
|
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
* @param {MouseEvent} e - Context menu event
|
|
319
|
-
*/
|
|
320
|
-
onContextMenu(e) {
|
|
321
|
-
if (this.isViewMode) return;
|
|
322
|
-
this.selectComponentAction(e);
|
|
323
|
-
e.preventDefault();
|
|
324
|
-
e.stopPropagation();
|
|
325
|
-
|
|
326
|
-
const rect = this.inputRef.value?.getBoundingClientRect();
|
|
327
|
-
if (rect) {
|
|
328
|
-
Object.assign(e, {
|
|
329
|
-
ComponentTop: rect.top,
|
|
330
|
-
ComponentLeft: rect.left,
|
|
331
|
-
ComponentBottom: rect.bottom,
|
|
332
|
-
ComponentHeight: rect.height,
|
|
333
|
-
});
|
|
334
|
-
setContextMenuEvent(e);
|
|
212
|
+
// Re-process handlers
|
|
213
|
+
this.inputController.processInputsDebounced();
|
|
214
|
+
this.styleController.processStyles();
|
|
335
215
|
}
|
|
336
216
|
}
|
|
337
217
|
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
* @override
|
|
342
|
-
*/
|
|
343
|
-
override async connectedCallback() {
|
|
344
|
-
super.connectedCallback();
|
|
345
|
-
|
|
346
|
-
// Add component-specific class for pseudo-state styling
|
|
347
|
-
if (this.component?.uuid) {
|
|
348
|
-
this.classList.add(`component-${this.component.uuid}`);
|
|
349
|
-
}
|
|
350
|
-
|
|
351
|
-
if(!this.isViewMode) {
|
|
352
|
-
this.subscription.add(
|
|
353
|
-
RuntimeHelpers.createStoreObservable($hoveredComponent).subscribe((hoveredComponent) => {
|
|
354
|
-
this.hoveredComponent = hoveredComponent;
|
|
355
|
-
})
|
|
356
|
-
);
|
|
357
|
-
|
|
358
|
-
this.subscription.add(
|
|
359
|
-
eventDispatcher.on('Vars:selectedComponents', () => {
|
|
360
|
-
this.currentSelection = Array.from(ExecuteInstance.Vars.selectedComponents).map((comppnent :ComponentElement) => comppnent.uuid);
|
|
361
|
-
EditorInstance.currentSelection = this.currentSelection;
|
|
362
|
-
})
|
|
363
|
-
);
|
|
364
|
-
}
|
|
365
|
-
|
|
366
|
-
// Subscribe to runtime styles
|
|
367
|
-
this.subscription.add(
|
|
368
|
-
$runtimeStylescomponentStyleByID(this.uniqueUUID).subscribe((styles) => {
|
|
369
|
-
this.runtimeStyles = styles;
|
|
370
|
-
})
|
|
371
|
-
);
|
|
372
|
-
this.subscription.add(
|
|
373
|
-
eventDispatcher.on(`component:value:set:${this.uniqueUUID}`, () => {
|
|
374
|
-
this.traitInputsHandlers();
|
|
375
|
-
// @todo: activate this when trigger chidlren rending
|
|
376
|
-
this.component.childrenIds?.forEach((childId) => {
|
|
377
|
-
eventDispatcher.emit(`component:request:refresh:${childId}`)
|
|
378
|
-
})
|
|
379
|
-
|
|
380
|
-
}) )
|
|
381
|
-
this.subscription.add(
|
|
382
|
-
eventDispatcher.on(`component:request:refresh:${this.component.uuid}`, () => {
|
|
383
|
-
this.traitInputsHandlers();
|
|
384
|
-
this.component.childrenIds?.forEach((childId) => {
|
|
385
|
-
eventDispatcher.emit(`component:request:refresh:${childId}`)
|
|
386
|
-
})
|
|
387
|
-
})
|
|
388
|
-
)
|
|
389
|
-
// Subscribe to property changes and updates
|
|
390
|
-
this.subscription.add(
|
|
391
|
-
eventDispatcher.on(`component-property-changed:${String(this.component.name)}`, async() => {
|
|
392
|
-
this.traitInputsHandlers();
|
|
393
|
-
this.traitStylesHandlers();
|
|
394
|
-
/** @todo: check for event leak */
|
|
395
|
-
this.component.childrenIds?.forEach((childId) => {
|
|
396
|
-
eventDispatcher.emit(`component:request:refresh:${childId}`)
|
|
397
|
-
})
|
|
398
|
-
})
|
|
399
|
-
);
|
|
400
|
-
|
|
401
|
-
this.subscription.add(
|
|
402
|
-
eventDispatcher.on(`component-updated:${String(this.component.uuid)}`, async () => {
|
|
403
|
-
setTimeout(() => {
|
|
404
|
-
this.traitInputsHandlers();
|
|
405
|
-
this.traitStylesHandlers();
|
|
406
|
-
}, 0);
|
|
407
|
-
})
|
|
408
|
-
);
|
|
409
|
-
|
|
410
|
-
// Set up event listeners
|
|
411
|
-
this.closestGenericComponentWrapper = this.closest('generik-component-wrapper');
|
|
412
|
-
this.eventsManager = [
|
|
413
|
-
["contextmenu", this.onContextMenuBound],
|
|
414
|
-
["mouseenter", this.mouseEnterHandlerBound],
|
|
415
|
-
["mouseleave", this.mouseLeaveHandlerBound],
|
|
416
|
-
["click", this.selectComponentActionClickBound],
|
|
417
|
-
["dragenter", this.dragEnterHandlerBound],
|
|
418
|
-
["drop", this.dropHandlerBound],
|
|
419
|
-
["dragleave", this.dragLeaveHandlerBound],
|
|
420
|
-
];
|
|
421
|
-
|
|
422
|
-
this.eventsManager.forEach(([event, handler]) => this.addEventListener(event, handler));
|
|
423
|
-
|
|
424
|
-
// Subscribe to keydown events
|
|
425
|
-
this.subscription.add(
|
|
426
|
-
eventDispatcher.on("keydown", ({ key, selectedComponents }) => {
|
|
427
|
-
if (key === "Enter" && selectedComponents.length === 1 &&
|
|
428
|
-
this.component.uuid === selectedComponents[0]) {
|
|
429
|
-
this.isEditable = true;
|
|
430
|
-
}
|
|
431
|
-
})
|
|
432
|
-
);
|
|
433
|
-
}
|
|
218
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
219
|
+
// PUBLIC API
|
|
220
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
434
221
|
|
|
435
222
|
/**
|
|
436
|
-
*
|
|
437
|
-
*
|
|
438
|
-
* @
|
|
223
|
+
* Execute a component event handler
|
|
224
|
+
* @param eventName - Name of the event (onClick, onChange, etc.)
|
|
225
|
+
* @param event - Optional DOM event that triggered this
|
|
226
|
+
* @param data - Additional data to pass to the handler
|
|
439
227
|
*/
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
this.subscription.unsubscribe();
|
|
443
|
-
this.isConnected2 = false;
|
|
444
|
-
this.eventsManager.forEach(([event, handler]) => this.removeEventListener(event, handler));
|
|
228
|
+
executeEvent(eventName: string, event?: Event, data: Record<string, any> = {}): void {
|
|
229
|
+
this.eventController.execute(eventName, event, data);
|
|
445
230
|
}
|
|
446
231
|
|
|
447
232
|
/**
|
|
448
|
-
*
|
|
449
|
-
*
|
|
450
|
-
* @private
|
|
233
|
+
* Get computed styles for the component
|
|
234
|
+
* Merges editor styles, handler values, and runtime styles
|
|
451
235
|
*/
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
}
|
|
455
|
-
|
|
456
|
-
/**
|
|
457
|
-
* Handles mouse leave events
|
|
458
|
-
*
|
|
459
|
-
* @private
|
|
460
|
-
*/
|
|
461
|
-
private mouseLeaveHandler() {
|
|
462
|
-
handleMouseLeave(this.isViewMode);
|
|
236
|
+
getStyles(): Record<string, any> {
|
|
237
|
+
return this.styleController.getComputedStyles();
|
|
463
238
|
}
|
|
464
239
|
|
|
465
240
|
/**
|
|
466
|
-
*
|
|
467
|
-
*
|
|
468
|
-
* @param {string} eventType - Type of drag event
|
|
469
|
-
* @private
|
|
241
|
+
* Force reprocessing of input handlers
|
|
470
242
|
*/
|
|
471
|
-
|
|
472
|
-
this.
|
|
473
|
-
wrapper.dispatchEvent(new CustomEvent(eventType, { bubbles: true, composed: true }))
|
|
474
|
-
);
|
|
243
|
+
refreshInputs(): void {
|
|
244
|
+
this.inputController.processInputs();
|
|
475
245
|
}
|
|
476
246
|
|
|
477
247
|
/**
|
|
478
|
-
*
|
|
479
|
-
*
|
|
480
|
-
* @private
|
|
248
|
+
* Force reprocessing of style handlers
|
|
481
249
|
*/
|
|
482
|
-
|
|
483
|
-
this.
|
|
250
|
+
refreshStyles(): void {
|
|
251
|
+
this.styleController.processStyles();
|
|
484
252
|
}
|
|
485
253
|
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
* @private
|
|
490
|
-
*/
|
|
491
|
-
private dropHandler() {
|
|
492
|
-
this.handleDragEvent("drag-leave-component");
|
|
493
|
-
}
|
|
254
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
255
|
+
// RENDERING
|
|
256
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
494
257
|
|
|
495
258
|
/**
|
|
496
|
-
*
|
|
497
|
-
*
|
|
498
|
-
* @private
|
|
259
|
+
* Whether component should be displayed based on display input
|
|
499
260
|
*/
|
|
500
|
-
|
|
501
|
-
this.
|
|
261
|
+
protected get shouldDisplay(): boolean {
|
|
262
|
+
return this.inputHandlersValue?.display !== false;
|
|
502
263
|
}
|
|
503
264
|
|
|
504
265
|
/**
|
|
505
|
-
*
|
|
506
|
-
*
|
|
507
|
-
* @returns {boolean} Whether component should be displayed
|
|
508
|
-
* @protected
|
|
266
|
+
* Render the component content - to be implemented by child classes
|
|
509
267
|
*/
|
|
510
|
-
|
|
511
|
-
return
|
|
268
|
+
renderComponent(): unknown {
|
|
269
|
+
return nothing;
|
|
512
270
|
}
|
|
513
271
|
|
|
514
272
|
/**
|
|
515
|
-
*
|
|
516
|
-
* To be implemented by child classes
|
|
517
|
-
*
|
|
518
|
-
* @returns {unknown}
|
|
273
|
+
* Render pseudo-state styles (hover, focus, active, disabled)
|
|
519
274
|
*/
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
}
|
|
523
|
-
|
|
524
|
-
/**
|
|
525
|
-
* Generates CSS for pseudo-state styles (e.g., :hover, :focus, :active)
|
|
526
|
-
*
|
|
527
|
-
* @returns {string} CSS string with pseudo-selectors
|
|
528
|
-
*/
|
|
529
|
-
generatePseudoStateStyles() {
|
|
530
|
-
const componentStyles = Editor.getComponentStyles(this.component);
|
|
531
|
-
const pseudoStates = [':hover', ':focus', ':active', ':disabled'];
|
|
532
|
-
let cssString = '';
|
|
533
|
-
|
|
534
|
-
// Generate base class with regular styles (non-pseudo-state)
|
|
535
|
-
const regularStyles = Object.keys(componentStyles)
|
|
536
|
-
.filter(key => !pseudoStates.includes(key))
|
|
537
|
-
.reduce((obj, key) => {
|
|
538
|
-
obj[key] = componentStyles[key];
|
|
539
|
-
return obj;
|
|
540
|
-
}, {});
|
|
541
|
-
|
|
542
|
-
const baseStyleRules = Object.entries(regularStyles)
|
|
543
|
-
.map(([property, value]) => ` ${property}: ${value};`)
|
|
544
|
-
.join('\n');
|
|
545
|
-
|
|
546
|
-
if (baseStyleRules) {
|
|
547
|
-
cssString += `.drop-${this.component.uuid} {\n${baseStyleRules}\n}\n`;
|
|
548
|
-
}
|
|
549
|
-
|
|
550
|
-
// Generate pseudo-state classes
|
|
551
|
-
pseudoStates.forEach(pseudoState => {
|
|
552
|
-
if (componentStyles[pseudoState] && typeof componentStyles[pseudoState] === 'object') {
|
|
553
|
-
const pseudoStyles = componentStyles[pseudoState];
|
|
554
|
-
const styleRules = Object.entries(pseudoStyles)
|
|
555
|
-
.map(([property, value]) => ` ${property}: ${value};`)
|
|
556
|
-
.join('\n');
|
|
557
|
-
|
|
558
|
-
if (styleRules) {
|
|
559
|
-
cssString += `.drop-${this.component.uuid}${pseudoState} {\n${styleRules}\n}\n`;
|
|
560
|
-
}
|
|
561
|
-
}
|
|
562
|
-
});
|
|
563
|
-
|
|
564
|
-
return cssString;
|
|
565
|
-
}
|
|
566
|
-
|
|
567
|
-
/**
|
|
568
|
-
* Renders dynamic pseudo-state styles
|
|
569
|
-
*
|
|
570
|
-
* @returns {unknown} Style tag with pseudo-selector CSS
|
|
571
|
-
*/
|
|
572
|
-
renderPseudoStateStyles() {
|
|
573
|
-
const cssString = this.generatePseudoStateStyles();
|
|
574
|
-
|
|
275
|
+
protected renderPseudoStateStyles() {
|
|
276
|
+
const cssString = this.styleController.generatePseudoStateCSS();
|
|
575
277
|
if (!cssString) return nothing;
|
|
576
|
-
|
|
577
278
|
return html`<style>${cssString}</style>`;
|
|
578
279
|
}
|
|
579
280
|
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
*
|
|
583
|
-
* @returns {Object} Component styles
|
|
584
|
-
*/
|
|
585
|
-
getStyles() {
|
|
586
|
-
const width = Editor.getComponentStyle(this.component, "width");
|
|
587
|
-
const allStyles = Editor.getComponentStyles(this.component);
|
|
588
|
-
|
|
589
|
-
// Filter out pseudo-state styles (they're handled via CSS classes)
|
|
590
|
-
const pseudoStates = [':hover', ':focus', ':active', ':disabled'];
|
|
591
|
-
const regularStyles = Object.keys(allStyles)
|
|
592
|
-
.filter(key => !pseudoStates.includes(key))
|
|
593
|
-
.reduce((obj, key) => {
|
|
594
|
-
obj[key] = allStyles[key];
|
|
595
|
-
return obj;
|
|
596
|
-
}, {});
|
|
597
|
-
|
|
598
|
-
return {
|
|
599
|
-
...regularStyles,
|
|
600
|
-
...this.stylesHandlersValue,
|
|
601
|
-
width: width === "auto" ? "auto" :
|
|
602
|
-
RuntimeHelpers.extractUnit(width) === "%" ? "100%" : width ?? "auto",
|
|
603
|
-
...this.runtimeStyles,
|
|
604
|
-
};
|
|
605
|
-
}
|
|
606
|
-
|
|
607
|
-
/**
|
|
608
|
-
* Executes a component event
|
|
609
|
-
*
|
|
610
|
-
* @param {string} eventName - Name of event to execute
|
|
611
|
-
* @param {Event} [event] - DOM event that triggered this
|
|
612
|
-
* @param {any} [data] - Additional data for event
|
|
613
|
-
*/
|
|
614
|
-
executeEvent(eventName, event, data= {}) {
|
|
615
|
-
// if(event?.unique !== this.uniqueUUID && eventName == "onMouseEnter") {
|
|
616
|
-
// return false;
|
|
617
|
-
// }
|
|
618
|
-
handleComponentEvent({
|
|
619
|
-
isViewMode: this.isViewMode,
|
|
620
|
-
component:{ ...this.component, uniqueUUID : this.uniqueUUID},
|
|
621
|
-
item: this.item,
|
|
622
|
-
eventName,
|
|
623
|
-
event,
|
|
624
|
-
data,
|
|
625
|
-
onSelect: this.selectComponentAction.bind(this),
|
|
626
|
-
});
|
|
627
|
-
}
|
|
281
|
+
protected override render() {
|
|
282
|
+
if (!this.shouldDisplay) return nothing;
|
|
628
283
|
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
ExecuteInstance.VarsProxy.selectedComponents = Array.from([this.component]);
|
|
638
|
-
}
|
|
284
|
+
// Update component styles
|
|
285
|
+
this.componentStyles = this.calculatedStyles || {};
|
|
286
|
+
const labelStyleHandlers = this.component?.styleHandlers
|
|
287
|
+
? Object.fromEntries(
|
|
288
|
+
Object.entries(this.component.styleHandlers).filter(([_, value]) => value)
|
|
289
|
+
)
|
|
290
|
+
: {};
|
|
291
|
+
this.componentStyles = { ...this.componentStyles, ...labelStyleHandlers };
|
|
639
292
|
|
|
640
|
-
/**
|
|
641
|
-
* Renders error indicator and panel if component has errors
|
|
642
|
-
*
|
|
643
|
-
* @returns {unknown} Error UI template
|
|
644
|
-
*/
|
|
645
|
-
renderError() {
|
|
646
|
-
const error = $debug.get()?.error?.components?.[this.component.uuid]?.errors;
|
|
647
|
-
if (hasOnlyEmptyObjects(error ?? {})) return nothing;
|
|
648
|
-
|
|
649
293
|
return html`
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
style="position:absolute">
|
|
653
|
-
<nr-icon name="info-circle"
|
|
654
|
-
style="z-index: 1000; --nuraly-icon-width: 20px; --nuraly-icon-height: 25px; --nuraly-icon-color: red; position: absolute;">Error</nr-icon>
|
|
655
|
-
${this.displayErrorPanel ? html`<handler-component-error-block .error=${error}></handler-component-error-block>` : nothing}
|
|
656
|
-
</div>
|
|
294
|
+
${this.renderPseudoStateStyles()}
|
|
295
|
+
${this.renderComponent()}
|
|
657
296
|
`;
|
|
658
297
|
}
|
|
298
|
+
}
|
|
659
299
|
|
|
300
|
+
/**
|
|
301
|
+
* Full BaseElement with editor mode support via mixin
|
|
302
|
+
* This is the default export and main class for all UI components
|
|
303
|
+
*/
|
|
304
|
+
export class BaseElementBlock extends EditorModeMixin(BaseElementCore) {
|
|
660
305
|
/**
|
|
661
|
-
*
|
|
662
|
-
*
|
|
663
|
-
* @returns {unknown} Component template
|
|
664
|
-
* @protected
|
|
665
|
-
* @override
|
|
306
|
+
* Override render to include editor overlays
|
|
666
307
|
*/
|
|
667
|
-
protected render() {
|
|
308
|
+
protected override render() {
|
|
668
309
|
if (!this.shouldDisplay) return nothing;
|
|
669
|
-
|
|
310
|
+
|
|
311
|
+
// Update component styles
|
|
670
312
|
this.componentStyles = this.calculatedStyles || {};
|
|
671
313
|
const labelStyleHandlers = this.component?.styleHandlers
|
|
672
|
-
? Object.fromEntries(
|
|
314
|
+
? Object.fromEntries(
|
|
315
|
+
Object.entries(this.component.styleHandlers).filter(([_, value]) => value)
|
|
316
|
+
)
|
|
673
317
|
: {};
|
|
318
|
+
this.componentStyles = { ...this.componentStyles, ...labelStyleHandlers };
|
|
674
319
|
|
|
675
|
-
this.componentStyles = {...this.componentStyles, ...labelStyleHandlers};
|
|
676
320
|
return html`
|
|
677
321
|
${this.renderPseudoStateStyles()}
|
|
678
|
-
${
|
|
679
|
-
${this.renderError()}
|
|
680
|
-
${[0, undefined].includes(this.item?.index) ? html`
|
|
681
|
-
<component-title
|
|
682
|
-
@click=${(e) => this.executeEvent("onclick", e)}
|
|
683
|
-
@dragInit=${(e) => {
|
|
684
|
-
this.isDragInitiator = e.detail.value;
|
|
685
|
-
this.setAttribute("draggable", "true");
|
|
686
|
-
}}
|
|
687
|
-
@dragend=${() => { this.isDragInitiator = false; }}
|
|
688
|
-
.component=${this.component}
|
|
689
|
-
.selectedComponent=${{ ...this.selectedComponent }}
|
|
690
|
-
.display=${EditorInstance.currentSelection.includes(this.component.uuid)}
|
|
691
|
-
></component-title>
|
|
692
|
-
<resize-wrapper
|
|
693
|
-
.hoveredComponent=${{ ...this.hoveredComponent }}
|
|
694
|
-
.isSelected=${EditorInstance.currentSelection.includes(this.component.uuid)}
|
|
695
|
-
.component=${{ ...this.component }}
|
|
696
|
-
.selectedComponent=${{ ...this.selectedComponent }}
|
|
697
|
-
.inputRef=${this.inputRef}
|
|
698
|
-
style="width: fit-content; height: fit-content;"
|
|
699
|
-
></resize-wrapper>
|
|
700
|
-
<drag-wrapper .where=${"before"} .message=${"Drop before"} .component=${{ ...this.component }}
|
|
701
|
-
.inputRef=${this.inputRef} .isDragInitiator=${this.isDragInitiator}></drag-wrapper>
|
|
702
|
-
` : nothing}
|
|
703
|
-
` : nothing}
|
|
322
|
+
${this.renderEditorOverlay()}
|
|
704
323
|
${this.renderComponent()}
|
|
705
|
-
${
|
|
706
|
-
<drag-wrapper .where=${"after"} .message=${"Drop after"} .component=${{ ...this.component }}
|
|
707
|
-
.inputRef=${this.inputRef} .isDragInitiator=${this.isDragInitiator}></drag-wrapper>
|
|
708
|
-
` : nothing}
|
|
324
|
+
${this.renderAfterDragWrapper()}
|
|
709
325
|
`;
|
|
710
326
|
}
|
|
711
|
-
}
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
// Default export
|
|
330
|
+
export default BaseElementBlock;
|