@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
|
@@ -0,0 +1,286 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file StyleHandlerController.ts
|
|
3
|
+
* @description Controller for processing component style handlers
|
|
4
|
+
* Handles dynamic style resolution, CSS generation, and caching
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import type { ReactiveController } from "lit";
|
|
8
|
+
import { Subscription } from "rxjs";
|
|
9
|
+
import { executeHandler } from "../../../../../handlers/handler-executor";
|
|
10
|
+
import Editor from "../../../../../state/editor";
|
|
11
|
+
import { RuntimeHelpers } from "../../../../../utils/runtime-helpers";
|
|
12
|
+
import { isServer } from "../../../../../utils/envirement";
|
|
13
|
+
import { $runtimeStylescomponentStyleByID } from "../../../../../redux/store/component/store";
|
|
14
|
+
import type { StyleHandlerHost, Disposable } from "../types/base-element.types";
|
|
15
|
+
import { StyleCache, generateStyleCacheKey } from "../utils/style-cache";
|
|
16
|
+
|
|
17
|
+
/** Pseudo-state selectors supported by the style system */
|
|
18
|
+
const PSEUDO_STATES = [":hover", ":focus", ":active", ":disabled"] as const;
|
|
19
|
+
type PseudoState = (typeof PSEUDO_STATES)[number];
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Controller responsible for processing style handlers
|
|
23
|
+
* Extracts style processing logic from BaseElement for better separation of concerns
|
|
24
|
+
*/
|
|
25
|
+
export class StyleHandlerController implements ReactiveController, Disposable {
|
|
26
|
+
private host: StyleHandlerHost;
|
|
27
|
+
private subscription = new Subscription();
|
|
28
|
+
private runtimeStyles: Record<string, any> = {};
|
|
29
|
+
private pseudoStyleCache = new StyleCache(100);
|
|
30
|
+
private isConnected = false;
|
|
31
|
+
|
|
32
|
+
constructor(host: StyleHandlerHost) {
|
|
33
|
+
this.host = host;
|
|
34
|
+
host.addController(this);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
hostConnected(): void {
|
|
38
|
+
this.isConnected = true;
|
|
39
|
+
this.setupSubscriptions();
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
hostDisconnected(): void {
|
|
43
|
+
this.isConnected = false;
|
|
44
|
+
this.dispose();
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Set up subscriptions for runtime style updates
|
|
49
|
+
*/
|
|
50
|
+
private setupSubscriptions(): void {
|
|
51
|
+
// Subscribe to runtime styles from store
|
|
52
|
+
this.subscription.add(
|
|
53
|
+
$runtimeStylescomponentStyleByID(this.host.uniqueUUID).subscribe(
|
|
54
|
+
(styles) => {
|
|
55
|
+
this.runtimeStyles = styles || {};
|
|
56
|
+
this.host.requestUpdate();
|
|
57
|
+
}
|
|
58
|
+
)
|
|
59
|
+
);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Process all style handlers for the component
|
|
64
|
+
*/
|
|
65
|
+
async processStyles(): Promise<void> {
|
|
66
|
+
if (isServer || !this.isConnected) return;
|
|
67
|
+
|
|
68
|
+
const { component } = this.host;
|
|
69
|
+
if (!component?.styleHandlers) {
|
|
70
|
+
this.calculateStyles();
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
// Reset style handler values
|
|
75
|
+
this.host.stylesHandlersValue = {};
|
|
76
|
+
|
|
77
|
+
// Process all style handlers in parallel
|
|
78
|
+
await Promise.all(
|
|
79
|
+
Object.entries(component.styleHandlers).map(([name, style]) =>
|
|
80
|
+
this.processStyleHandler(style as string, name)
|
|
81
|
+
)
|
|
82
|
+
);
|
|
83
|
+
|
|
84
|
+
this.calculateStyles();
|
|
85
|
+
this.host.requestUpdate();
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* Process a single style handler
|
|
90
|
+
*/
|
|
91
|
+
private async processStyleHandler(
|
|
92
|
+
style: string,
|
|
93
|
+
styleName: string
|
|
94
|
+
): Promise<void> {
|
|
95
|
+
if (!style) return;
|
|
96
|
+
|
|
97
|
+
try {
|
|
98
|
+
// Execute handler if it's a dynamic expression
|
|
99
|
+
const value = style.startsWith("return ")
|
|
100
|
+
? executeHandler(this.host.component, style)
|
|
101
|
+
: style;
|
|
102
|
+
|
|
103
|
+
if (value && this.host.stylesHandlersValue[styleName] !== value) {
|
|
104
|
+
this.host.stylesHandlersValue[styleName] = value;
|
|
105
|
+
}
|
|
106
|
+
} catch (error) {
|
|
107
|
+
console.error(`Error processing style handler "${styleName}":`, error);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* Calculate and apply styles to the host element
|
|
113
|
+
*/
|
|
114
|
+
private calculateStyles(): void {
|
|
115
|
+
const { component, inputHandlersValue } = this.host;
|
|
116
|
+
|
|
117
|
+
// Merge component styles with existing calculated styles
|
|
118
|
+
this.host.calculatedStyles = {
|
|
119
|
+
...Editor.getComponentStyles(component),
|
|
120
|
+
...this.host.calculatedStyles,
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
// Apply alignment styles to host element
|
|
124
|
+
const { innerAlignment } = inputHandlersValue;
|
|
125
|
+
const hostStyle = this.host.style;
|
|
126
|
+
|
|
127
|
+
// Reset alignment properties
|
|
128
|
+
hostStyle.removeProperty("align-self");
|
|
129
|
+
hostStyle.removeProperty("margin");
|
|
130
|
+
hostStyle.removeProperty("margin-left");
|
|
131
|
+
|
|
132
|
+
// Apply alignment
|
|
133
|
+
if (innerAlignment === "end") {
|
|
134
|
+
hostStyle.marginLeft = "auto";
|
|
135
|
+
} else if (innerAlignment === "middle") {
|
|
136
|
+
hostStyle.alignSelf = "center";
|
|
137
|
+
hostStyle.margin = "auto";
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
// Apply layout styles
|
|
141
|
+
const { width, flex, cursor } = this.host.calculatedStyles;
|
|
142
|
+
|
|
143
|
+
if (width && RuntimeHelpers.extractUnit(width) === "%") {
|
|
144
|
+
hostStyle.width = width;
|
|
145
|
+
}
|
|
146
|
+
if (flex) {
|
|
147
|
+
hostStyle.flex = flex;
|
|
148
|
+
}
|
|
149
|
+
if (cursor) {
|
|
150
|
+
hostStyle.cursor = cursor;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* Get computed styles for the component
|
|
156
|
+
* Merges multiple style sources: editor styles, handler values, runtime styles
|
|
157
|
+
*/
|
|
158
|
+
getComputedStyles(): Record<string, any> {
|
|
159
|
+
const { component } = this.host;
|
|
160
|
+
const width = Editor.getComponentStyle(component, "width");
|
|
161
|
+
const allStyles = Editor.getComponentStyles(component);
|
|
162
|
+
|
|
163
|
+
// Filter out pseudo-state styles (they're handled via CSS classes)
|
|
164
|
+
const regularStyles = this.filterPseudoStates(allStyles);
|
|
165
|
+
|
|
166
|
+
// Compute final width value
|
|
167
|
+
const computedWidth =
|
|
168
|
+
width === "auto"
|
|
169
|
+
? "auto"
|
|
170
|
+
: RuntimeHelpers.extractUnit(width) === "%"
|
|
171
|
+
? "100%"
|
|
172
|
+
: width ?? "auto";
|
|
173
|
+
|
|
174
|
+
return {
|
|
175
|
+
...regularStyles,
|
|
176
|
+
...this.host.stylesHandlersValue,
|
|
177
|
+
width: computedWidth,
|
|
178
|
+
...this.runtimeStyles,
|
|
179
|
+
};
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
/**
|
|
183
|
+
* Filter out pseudo-state keys from styles object
|
|
184
|
+
*/
|
|
185
|
+
private filterPseudoStates(
|
|
186
|
+
styles: Record<string, any>
|
|
187
|
+
): Record<string, any> {
|
|
188
|
+
return Object.keys(styles)
|
|
189
|
+
.filter((key) => !PSEUDO_STATES.includes(key as PseudoState))
|
|
190
|
+
.reduce((obj, key) => {
|
|
191
|
+
obj[key] = styles[key];
|
|
192
|
+
return obj;
|
|
193
|
+
}, {} as Record<string, any>);
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
/**
|
|
197
|
+
* Generate CSS string for pseudo-state styles
|
|
198
|
+
* Uses caching to avoid regeneration on every render
|
|
199
|
+
*/
|
|
200
|
+
generatePseudoStateCSS(): string {
|
|
201
|
+
const componentStyles = Editor.getComponentStyles(this.host.component);
|
|
202
|
+
const cacheKey = generateStyleCacheKey(
|
|
203
|
+
this.host.component.uuid,
|
|
204
|
+
componentStyles
|
|
205
|
+
);
|
|
206
|
+
|
|
207
|
+
return this.pseudoStyleCache.getOrGenerate(cacheKey, () =>
|
|
208
|
+
this.buildPseudoStateCSS(componentStyles)
|
|
209
|
+
);
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
/**
|
|
213
|
+
* Build CSS string for pseudo-state styles
|
|
214
|
+
*/
|
|
215
|
+
private buildPseudoStateCSS(componentStyles: Record<string, any>): string {
|
|
216
|
+
const uuid = this.host.component.uuid;
|
|
217
|
+
let cssString = "";
|
|
218
|
+
|
|
219
|
+
// Generate base class with regular styles
|
|
220
|
+
const regularStyles = this.filterPseudoStates(componentStyles);
|
|
221
|
+
const baseRules = this.stylesToCSS(regularStyles);
|
|
222
|
+
|
|
223
|
+
if (baseRules) {
|
|
224
|
+
cssString += `.drop-${uuid} {\n${baseRules}}\n`;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
// Generate pseudo-state classes
|
|
228
|
+
for (const pseudoState of PSEUDO_STATES) {
|
|
229
|
+
const stateStyles = componentStyles[pseudoState];
|
|
230
|
+
if (stateStyles && typeof stateStyles === "object") {
|
|
231
|
+
const stateRules = this.stylesToCSS(stateStyles);
|
|
232
|
+
if (stateRules) {
|
|
233
|
+
cssString += `.drop-${uuid}${pseudoState} {\n${stateRules}}\n`;
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
return cssString;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
/**
|
|
242
|
+
* Convert styles object to CSS rule string
|
|
243
|
+
*/
|
|
244
|
+
private stylesToCSS(styles: Record<string, any>): string {
|
|
245
|
+
return Object.entries(styles)
|
|
246
|
+
.filter(([_, value]) => value !== undefined && value !== null)
|
|
247
|
+
.map(([property, value]) => ` ${property}: ${value};`)
|
|
248
|
+
.join("\n");
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
/**
|
|
252
|
+
* Check if component has any pseudo-state styles
|
|
253
|
+
*/
|
|
254
|
+
hasPseudoStateStyles(): boolean {
|
|
255
|
+
const componentStyles = Editor.getComponentStyles(this.host.component);
|
|
256
|
+
return PSEUDO_STATES.some(
|
|
257
|
+
(state) =>
|
|
258
|
+
componentStyles[state] &&
|
|
259
|
+
typeof componentStyles[state] === "object" &&
|
|
260
|
+
Object.keys(componentStyles[state]).length > 0
|
|
261
|
+
);
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
/**
|
|
265
|
+
* Invalidate cached styles for this component
|
|
266
|
+
*/
|
|
267
|
+
invalidateCache(): void {
|
|
268
|
+
// Clear entries for this component
|
|
269
|
+
const componentStyles = Editor.getComponentStyles(this.host.component);
|
|
270
|
+
const cacheKey = generateStyleCacheKey(
|
|
271
|
+
this.host.component.uuid,
|
|
272
|
+
componentStyles
|
|
273
|
+
);
|
|
274
|
+
this.pseudoStyleCache.delete(cacheKey);
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
/**
|
|
278
|
+
* Clean up all resources
|
|
279
|
+
*/
|
|
280
|
+
dispose(): void {
|
|
281
|
+
this.subscription.unsubscribe();
|
|
282
|
+
this.subscription = new Subscription();
|
|
283
|
+
this.pseudoStyleCache.clear();
|
|
284
|
+
this.runtimeStyles = {};
|
|
285
|
+
}
|
|
286
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file controllers/index.ts
|
|
3
|
+
* @description Export all controllers for BaseElement
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
export { InputHandlerController } from "./InputHandlerController";
|
|
7
|
+
export { StyleHandlerController } from "./StyleHandlerController";
|
|
8
|
+
export { EventController } from "./EventController";
|
|
9
|
+
export { SelectionController } from "./SelectionController";
|
|
10
|
+
export { DragDropController } from "./DragDropController";
|
|
11
|
+
export { ErrorController } from "./ErrorController";
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file EditorModeMixin.ts
|
|
3
|
+
* @description Mixin that adds editor-only functionality to BaseElement
|
|
4
|
+
* Encapsulates all editor-mode specific behavior
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import { html, nothing } from "lit";
|
|
8
|
+
import { state } from "lit/decorators.js";
|
|
9
|
+
import type { LitElement, PropertyValues } from "lit";
|
|
10
|
+
import type { Ref } from "lit/directives/ref.js";
|
|
11
|
+
import { SelectionController } from "../controllers/SelectionController";
|
|
12
|
+
import { DragDropController } from "../controllers/DragDropController";
|
|
13
|
+
import { ErrorController } from "../controllers/ErrorController";
|
|
14
|
+
import type { ComponentElement } from "../../../../../redux/store/component/component.interface";
|
|
15
|
+
|
|
16
|
+
type Constructor<T = {}> = new (...args: any[]) => T;
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Interface for base element host that the mixin extends
|
|
20
|
+
*/
|
|
21
|
+
export interface EditorModeHost extends LitElement {
|
|
22
|
+
component: ComponentElement;
|
|
23
|
+
item: any;
|
|
24
|
+
isViewMode: boolean;
|
|
25
|
+
inputRef: Ref<HTMLElement>;
|
|
26
|
+
uniqueUUID: string;
|
|
27
|
+
errors: Record<string, any>;
|
|
28
|
+
callbacks: Record<string, (val: any) => void>;
|
|
29
|
+
inputHandlersValue: Record<string, any>;
|
|
30
|
+
stylesHandlersValue: Record<string, any>;
|
|
31
|
+
calculatedStyles: Record<string, any>;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Mixin that adds editor-mode functionality to a base element class
|
|
36
|
+
* This includes selection, drag-drop, and error display capabilities
|
|
37
|
+
*/
|
|
38
|
+
export function EditorModeMixin<T extends Constructor<EditorModeHost>>(
|
|
39
|
+
superClass: T
|
|
40
|
+
) {
|
|
41
|
+
class EditorModeElement extends superClass {
|
|
42
|
+
// Editor-only state
|
|
43
|
+
@state() currentSelection: string[] = [];
|
|
44
|
+
@state() isDragInitiator = false;
|
|
45
|
+
@state() displayErrorPanel = false;
|
|
46
|
+
@state() isEditable = false;
|
|
47
|
+
@state() hoveredComponent: ComponentElement | null = null;
|
|
48
|
+
@state() closestGenericComponentWrapper: HTMLElement | null = null;
|
|
49
|
+
|
|
50
|
+
// Editor-only controllers
|
|
51
|
+
protected selectionController!: SelectionController;
|
|
52
|
+
protected dragDropController!: DragDropController;
|
|
53
|
+
protected errorController!: ErrorController;
|
|
54
|
+
|
|
55
|
+
constructor(...args: any[]) {
|
|
56
|
+
super(...args);
|
|
57
|
+
|
|
58
|
+
// Initialize controllers with proper host interface
|
|
59
|
+
// Note: Controllers are initialized in connectedCallback when host is ready
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
override connectedCallback(): void {
|
|
63
|
+
super.connectedCallback();
|
|
64
|
+
|
|
65
|
+
if (!this.isViewMode) {
|
|
66
|
+
// Create controllers if they don't exist
|
|
67
|
+
if (!this.selectionController) {
|
|
68
|
+
this.selectionController = new SelectionController(this as any);
|
|
69
|
+
}
|
|
70
|
+
if (!this.dragDropController) {
|
|
71
|
+
this.dragDropController = new DragDropController(this as any);
|
|
72
|
+
}
|
|
73
|
+
if (!this.errorController) {
|
|
74
|
+
this.errorController = new ErrorController(this as any);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
// Activate all editor controllers
|
|
78
|
+
this.selectionController.activate();
|
|
79
|
+
this.dragDropController.activate();
|
|
80
|
+
this.errorController.activate();
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
override disconnectedCallback(): void {
|
|
85
|
+
if (!this.isViewMode) {
|
|
86
|
+
// Deactivate all editor controllers
|
|
87
|
+
this.selectionController?.deactivate();
|
|
88
|
+
this.dragDropController?.deactivate();
|
|
89
|
+
this.errorController?.deactivate();
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
super.disconnectedCallback();
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* Select this component in the editor
|
|
97
|
+
*/
|
|
98
|
+
selectComponent(event?: Event): void {
|
|
99
|
+
if (!this.isViewMode && this.selectionController) {
|
|
100
|
+
this.selectionController.select(event);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* Check if this component is currently selected
|
|
106
|
+
*/
|
|
107
|
+
isSelected(): boolean {
|
|
108
|
+
return this.selectionController?.isSelected() ?? false;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* Check if this component is currently hovered
|
|
113
|
+
*/
|
|
114
|
+
isHovered(): boolean {
|
|
115
|
+
return this.selectionController?.isHovered() ?? false;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* Render error indicator (editor only)
|
|
120
|
+
*/
|
|
121
|
+
renderEditorError() {
|
|
122
|
+
if (this.isViewMode) return nothing;
|
|
123
|
+
return this.errorController?.renderError() ?? nothing;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* Render drag wrappers before content (editor only)
|
|
128
|
+
*/
|
|
129
|
+
renderBeforeDragWrapper() {
|
|
130
|
+
if (this.isViewMode) return nothing;
|
|
131
|
+
|
|
132
|
+
const itemIndex = this.item?.index;
|
|
133
|
+
return this.dragDropController?.renderWrappers(itemIndex) ?? nothing;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* Render drag wrapper after content (editor only)
|
|
138
|
+
*/
|
|
139
|
+
renderAfterDragWrapper() {
|
|
140
|
+
if (this.isViewMode) return nothing;
|
|
141
|
+
return this.dragDropController?.renderAfterWrapper() ?? nothing;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* Render full editor overlay (error + drag wrappers)
|
|
146
|
+
*/
|
|
147
|
+
renderEditorOverlay() {
|
|
148
|
+
if (this.isViewMode) return nothing;
|
|
149
|
+
|
|
150
|
+
const itemIndex = this.item?.index;
|
|
151
|
+
|
|
152
|
+
return html`
|
|
153
|
+
${this.renderEditorError()}
|
|
154
|
+
${[0, undefined].includes(itemIndex)
|
|
155
|
+
? this.renderBeforeDragWrapper()
|
|
156
|
+
: nothing}
|
|
157
|
+
`;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* Check if component has errors
|
|
162
|
+
*/
|
|
163
|
+
hasErrors(): boolean {
|
|
164
|
+
return this.errorController?.hasErrors() ?? false;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
/**
|
|
168
|
+
* Get error summary
|
|
169
|
+
*/
|
|
170
|
+
getErrorSummary(): { count: number; messages: string[] } {
|
|
171
|
+
return (
|
|
172
|
+
this.errorController?.getErrorSummary() ?? { count: 0, messages: [] }
|
|
173
|
+
);
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
return EditorModeElement;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
/**
|
|
181
|
+
* Type helper for classes using the mixin
|
|
182
|
+
*/
|
|
183
|
+
export type EditorModeElementType = InstanceType<
|
|
184
|
+
ReturnType<typeof EditorModeMixin<Constructor<EditorModeHost>>>
|
|
185
|
+
>;
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file base-element.types.ts
|
|
3
|
+
* @description Type definitions for the BaseElement component system
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import type { ReactiveControllerHost } from "lit";
|
|
7
|
+
import type { Ref } from "lit/directives/ref.js";
|
|
8
|
+
import type { ComponentElement } from "../../../../../redux/store/component/component.interface";
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Base host interface for all controllers
|
|
12
|
+
*/
|
|
13
|
+
export interface BaseElementHost extends ReactiveControllerHost {
|
|
14
|
+
component: ComponentElement;
|
|
15
|
+
item: any;
|
|
16
|
+
parentcomponent: ComponentElement;
|
|
17
|
+
isViewMode: boolean;
|
|
18
|
+
uniqueUUID: string;
|
|
19
|
+
inputRef: Ref<HTMLElement>;
|
|
20
|
+
style: CSSStyleDeclaration;
|
|
21
|
+
|
|
22
|
+
// State
|
|
23
|
+
inputHandlersValue: Record<string, any>;
|
|
24
|
+
stylesHandlersValue: Record<string, any>;
|
|
25
|
+
calculatedStyles: Record<string, any>;
|
|
26
|
+
errors: Record<string, any>;
|
|
27
|
+
|
|
28
|
+
// Callbacks registry
|
|
29
|
+
callbacks: Record<string, (val: any) => void>;
|
|
30
|
+
|
|
31
|
+
// Methods
|
|
32
|
+
requestUpdate(): void;
|
|
33
|
+
dispatchEvent(event: Event): boolean;
|
|
34
|
+
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
35
|
+
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
36
|
+
classList: DOMTokenList;
|
|
37
|
+
shadowRoot: ShadowRoot | null;
|
|
38
|
+
|
|
39
|
+
// DOM Element methods
|
|
40
|
+
closest?(selector: string): Element | null;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Host interface for input handler controller
|
|
45
|
+
*/
|
|
46
|
+
export interface InputHandlerHost extends BaseElementHost {
|
|
47
|
+
ExecuteInstance: any;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Host interface for style handler controller
|
|
52
|
+
*/
|
|
53
|
+
export interface StyleHandlerHost extends BaseElementHost {}
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Host interface for event controller
|
|
57
|
+
*/
|
|
58
|
+
export interface EventHandlerHost extends BaseElementHost {}
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Host interface for selection controller
|
|
62
|
+
*/
|
|
63
|
+
export interface SelectionHost extends BaseElementHost {
|
|
64
|
+
currentSelection: string[];
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Host interface for drag-drop controller
|
|
69
|
+
*/
|
|
70
|
+
export interface DragDropHost extends BaseElementHost {
|
|
71
|
+
isDragInitiator: boolean;
|
|
72
|
+
closestGenericComponentWrapper: HTMLElement | null;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Host interface for error controller
|
|
77
|
+
*/
|
|
78
|
+
export interface ErrorHost extends BaseElementHost {
|
|
79
|
+
displayErrorPanel: boolean;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Configuration for input handler processing
|
|
84
|
+
*/
|
|
85
|
+
export interface InputHandlerConfig {
|
|
86
|
+
name: string;
|
|
87
|
+
input: any;
|
|
88
|
+
component: ComponentElement;
|
|
89
|
+
item: any;
|
|
90
|
+
uniqueUUID: string;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* Result of input handler execution
|
|
95
|
+
*/
|
|
96
|
+
export interface InputHandlerResult {
|
|
97
|
+
name: string;
|
|
98
|
+
value: any;
|
|
99
|
+
error?: { message: string };
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Configuration for style handler processing
|
|
104
|
+
*/
|
|
105
|
+
export interface StyleHandlerConfig {
|
|
106
|
+
name: string;
|
|
107
|
+
style: string;
|
|
108
|
+
component: ComponentElement;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* Event execution options
|
|
113
|
+
*/
|
|
114
|
+
export interface EventExecutionOptions {
|
|
115
|
+
eventName: string;
|
|
116
|
+
event?: Event;
|
|
117
|
+
data?: Record<string, any>;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* Drag wrapper position
|
|
122
|
+
*/
|
|
123
|
+
export type DragWrapperPosition = "before" | "after" | "inside";
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* Controller disposal interface
|
|
127
|
+
*/
|
|
128
|
+
export interface Disposable {
|
|
129
|
+
dispose(): void;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* Controller activation interface (for editor-only controllers)
|
|
134
|
+
*/
|
|
135
|
+
export interface Activatable {
|
|
136
|
+
activate(): void;
|
|
137
|
+
deactivate(): void;
|
|
138
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file types/index.ts
|
|
3
|
+
* @description Export all types for BaseElement
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
export type {
|
|
7
|
+
BaseElementHost,
|
|
8
|
+
InputHandlerHost,
|
|
9
|
+
StyleHandlerHost,
|
|
10
|
+
EventHandlerHost,
|
|
11
|
+
SelectionHost,
|
|
12
|
+
DragDropHost,
|
|
13
|
+
ErrorHost,
|
|
14
|
+
InputHandlerConfig,
|
|
15
|
+
InputHandlerResult,
|
|
16
|
+
StyleHandlerConfig,
|
|
17
|
+
EventExecutionOptions,
|
|
18
|
+
DragWrapperPosition,
|
|
19
|
+
Disposable,
|
|
20
|
+
Activatable,
|
|
21
|
+
} from "./base-element.types";
|