@nuraly/runtime 0.1.7 → 0.1.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +83 -765
- package/components/ui/components/Event/EventValue/EventValue.ts +13 -8
- package/components/ui/components/ToastContainer/ToastContainer.ts +1 -1
- package/components/ui/components/advanced/AIChat/AIChat.ts +1 -2
- package/components/ui/components/advanced/Collapse/Collapse.ts +5 -2
- package/components/ui/components/advanced/Collections/Collections.ts +2 -2
- package/components/ui/components/advanced/MicroApp/MicroApp.ts +3 -11
- package/components/ui/components/advanced/RefComponent/RefComponent.ts +2 -2
- package/components/ui/components/advanced/RichText/RichText.ts +5 -4
- package/components/ui/components/advanced/RichText/RichTextEditor.ts +0 -167
- package/components/ui/components/base/BaseElement/base-change-detection.ts +1 -5
- package/components/ui/components/base/BaseElement.ts +229 -610
- package/components/ui/components/base/FormRegisterable.ts +83 -0
- package/components/ui/components/base/controllers/DragDropController.ts +175 -0
- package/components/ui/components/base/controllers/ErrorController.ts +180 -0
- package/components/ui/components/base/controllers/EventController.ts +112 -0
- package/components/ui/components/base/controllers/InputHandlerController.ts +298 -0
- package/components/ui/components/base/controllers/SelectionController.ts +323 -0
- package/components/ui/components/base/controllers/StyleHandlerController.ts +286 -0
- package/components/ui/components/base/controllers/index.ts +11 -0
- package/components/ui/components/base/mixins/EditorModeMixin.ts +185 -0
- package/components/ui/components/base/mixins/index.ts +6 -0
- package/components/ui/components/base/types/base-element.types.ts +138 -0
- package/components/ui/components/base/types/index.ts +21 -0
- package/components/ui/components/base/utils/event-debouncer.ts +209 -0
- package/components/ui/components/base/utils/index.ts +11 -0
- package/components/ui/components/base/utils/style-cache.ts +94 -0
- package/components/ui/components/display/BoxModel/BoxModel.ts +177 -116
- package/components/ui/components/display/Code/Code.ts +40 -26
- package/components/ui/components/display/Divider/Divider.ts +2 -2
- package/components/ui/components/display/Icon/Icon.ts +2 -3
- package/components/ui/components/display/Image/Image.ts +72 -46
- package/components/ui/components/display/Tag/Tag.ts +2 -3
- package/components/ui/components/display/Video/Video.ts +91 -31
- package/components/ui/components/inputs/Button/Button.ts +2 -2
- package/components/ui/components/inputs/Checkbox/Checkbox.ts +14 -40
- package/components/ui/components/inputs/ColorPicker/colorpicker.ts +9 -4
- package/components/ui/components/inputs/DatePicker/DatePicker.ts +47 -25
- package/components/ui/components/inputs/Dropdown/Dropdown.ts +2 -2
- package/components/ui/components/inputs/Form/Form.style.ts +26 -0
- package/components/ui/components/inputs/Form/Form.ts +360 -0
- package/components/ui/components/inputs/IconPicker/IconPicker.ts +22 -18
- package/components/ui/components/inputs/InsertDropdown/InsertDropdown.ts +0 -20
- package/components/ui/components/inputs/NumberInput/NumberInput.ts +0 -4
- package/components/ui/components/inputs/RadioButton/Radio-button.ts +17 -13
- package/components/ui/components/inputs/Select/Select.ts +44 -24
- package/components/ui/components/inputs/TextInput/TextInput.ts +15 -9
- package/components/ui/components/inputs/Textarea/Textarea.ts +30 -30
- package/components/ui/components/inputs/UsersDropdown/UsersDropdown.ts +1 -1
- package/components/ui/components/layout/Card/Card.ts +112 -10
- package/components/ui/components/layout/Containers/Container.style.ts +18 -0
- package/components/ui/components/layout/Containers/Container.ts +11 -5
- package/components/ui/components/layout/Grid/Col.style.ts +27 -0
- package/components/ui/components/layout/Grid/Col.ts +213 -0
- package/components/ui/components/layout/Grid/Row.style.ts +73 -0
- package/components/ui/components/layout/Grid/Row.ts +170 -0
- package/components/ui/components/layout/Grid/index.ts +7 -0
- package/components/ui/components/layout/Panel/Panel.ts +2 -2
- package/components/ui/components/layout/Tabs/Tabs.ts +0 -1
- package/components/ui/components/navigation/EmbedURL/EmbedURL.ts +62 -26
- package/components/ui/components/navigation/Link/Link.ts +27 -16
- package/components/ui/components/navigation/Menu/Menu.ts +26 -48
- package/components/ui/components/runtime/MicroApp/MicroApp.ts +7 -147
- package/components/ui/components/runtime/MicroApp/MicroAppDataLoader.ts +6 -2
- package/components/ui/components/studio/FunctionsPanel/FunctionsPanel.ts +484 -0
- package/components/ui/components/studio/FunctionsPanel/index.ts +1 -0
- package/components/ui/components/utility/AccessRoles/AccessRoles.style.ts +242 -0
- package/components/ui/components/utility/AccessRoles/AccessRoles.ts +476 -0
- package/components/ui/components/utility/Border/Border.ts +0 -14
- package/components/ui/components/utility/BorderManager/BorderManager.style.ts +237 -0
- package/components/ui/components/utility/BorderManager/BorderManager.ts +503 -0
- package/components/ui/components/utility/BoxShadow/BoxShadow.ts +0 -16
- package/components/ui/components/utility/Document/Document.ts +54 -25
- package/components/ui/components/utility/Export-Import/Export-Import.ts +8 -7
- package/components/ui/components/utility/Handlers/Handlers.ts +14 -17
- package/components/ui/components/utility/ValidationRules/ValidationRules.ts +440 -0
- package/components/ui/components/wrappers/GenerikWrapper/DragWrapper/DragWrapper.ts +1 -0
- package/components/ui/components/wrappers/GenerikWrapper/GenerikWrapper.ts +1 -24
- package/components/ui/nuraly-ui/src/components/badge/badge.style.ts +4 -3
- package/components/ui/nuraly-ui/src/components/datepicker/datepicker.component.ts +2 -0
- package/components/ui/nuraly-ui/src/components/radio-group/radio-group.component.ts +12 -6
- package/components/ui/nuraly-ui/src/components/radio-group/radio-group.style.ts +23 -0
- package/dist/{index-B4yIOSMd.js → BaseElement-BNBn_IJk.js} +2920 -267
- package/dist/{CodeEditor-YsOapSut.js → CodeEditor-B1gNuvPb.js} +84127 -76319
- package/dist/{CodeEditor-BiNku87K.js → CodeEditor-Cpph-xRc.js} +7 -7
- package/dist/{abap-B2diVmjb.js → abap-D0Neqhq6.js} +91 -1
- package/dist/{apex-3NuJ-nsI.js → apex-B5LhxkeG.js} +18 -1
- package/dist/assets/editor.worker-DcwbJ0PV.js +12 -0
- package/dist/assets/html.worker-BTMxskjR.js +461 -0
- package/dist/assets/json.worker-D3vTGdf_.js +49 -0
- package/dist/assets/ts.worker-BsM1BXac.js +51334 -0
- package/dist/{azcli-XGXuUsMB.js → azcli-BrBH0QTU.js} +1 -1
- package/dist/{bat-B8Vhm634.js → bat-BfzAov64.js} +12 -1
- package/dist/{bicep-Cc8X5S_k.js → bicep-C3bCSWel.js} +1 -1
- package/dist/{cameligo-Bo3wBh9T.js → cameligo-sFL5plcd.js} +13 -1
- package/dist/{clojure-CPoQlpIK.js → clojure-CfeExRz0.js} +14 -1
- package/dist/{coffee-BxvTGz39.js → coffee-Xws5K0WL.js} +11 -1
- package/dist/{cpp-5RpEV7vC.js → cpp-CqOUEpxN.js} +28 -23
- package/dist/{csharp-slXXP3fo.js → csharp-DVLiBOZb.js} +13 -1
- package/dist/{csp-B98p6-gH.js → csp-DVFp9bw5.js} +3 -1
- package/dist/{css-BDsDSAin.js → css-DwARn2R6.js} +8 -1
- package/dist/cssMode-D82-gS78.js +1577 -0
- package/dist/{cypher-Dc4IMouD.js → cypher-uY0Mffat.js} +8 -1
- package/dist/{dart-LhvE3yD2.js → dart-D27H-mX_.js} +18 -1
- package/dist/{dockerfile-CwzplJeZ.js → dockerfile-CmV85WZK.js} +5 -1
- package/dist/{ecl-DxW3FiJi.js → ecl--fKn7yzB.js} +9 -1
- package/dist/{elixir-BI40g7TU.js → elixir-DUhH17ON.js} +87 -1
- package/dist/{flow9-tR2v0bGz.js → flow9-B3Dx2LLe.js} +8 -1
- package/dist/{freemarker2-Bfqhwyij.js → freemarker2-CYRLpyjt.js} +359 -7
- package/dist/{fsharp-BLAma0OT.js → fsharp-SyqBfUAR.js} +14 -1
- package/dist/{go-nYcD3y4Z.js → go-BbMR2tdT.js} +17 -1
- package/dist/{graphql-Dp1cHWmP.js → graphql-DDJE6tIl.js} +17 -1
- package/dist/{handlebars-DCgKNBmn.js → handlebars-R8Efxi60.js} +38 -4
- package/dist/{hcl-6NT8Kbna.js → hcl-YBvpaUqf.js} +13 -1
- package/dist/{html-C6wR7sMB.js → html-czhjovcp.js} +37 -4
- package/dist/htmlMode-DpyKDYYs.js +1587 -0
- package/dist/{ini-BZCOLrEc.js → ini-Ct73dBtM.js} +10 -1
- package/dist/{java-DAMcfJbX.js → java-C_jlkwoG.js} +18 -1
- package/dist/{javascript-D1L5MTmg.js → javascript-DwqkMEdb.js} +3 -2
- package/dist/jsonMode-Cmxxe0W9.js +2002 -0
- package/dist/{julia-CQ46G71H.js → julia-D8WE5U1e.js} +22 -1
- package/dist/{kotlin-CEjVo_6E.js → kotlin-Zy9aq5yB.js} +15 -1
- package/dist/{less-DreV99nP.js → less-sZ0iHtE8.js} +1 -1
- package/dist/{lexon-DBVJhqLb.js → lexon-CsdNL29A.js} +13 -1
- package/dist/{liquid-D_pDYIs1.js → liquid-2spuEcBh.js} +12 -4
- package/dist/{lua-Dcc_j6L-.js → lua-C2YJo0zw.js} +12 -1
- package/dist/{m3-B9SlZL4n.js → m3-CPLP40SG.js} +7 -1
- package/dist/{markdown-CuGw9_MP.js → markdown-B1mf5e0R.js} +34 -1
- package/dist/{mdx-CKsJ3cF4.js → mdx-BjBXyEeR.js} +2 -2
- package/dist/{micro-app-entry-xdTX5-ut.js → micro-app-entry-DYAnCRDo.js} +8132 -9649
- package/dist/micro-app.bundle.js +3 -3
- package/dist/micro-app.js +3565 -6710
- package/dist/{mips-BUWqP-OH.js → mips-DA33BZX1.js} +11 -1
- package/dist/{msdax-DtkouYCg.js → msdax-CCYFIQsP.js} +5 -1
- package/dist/{mysql-IkAsWSmF.js → mysql-hjmIjL-D.js} +11 -3
- package/dist/{objective-c-B2-ronfg.js → objective-c-RRCpEmqC.js} +2 -1
- package/dist/{pascal-Bsnz2eJA.js → pascal-CeV8XfxB.js} +13 -1
- package/dist/{pascaligo-D_sMUn0Q.js → pascaligo-IEEGVJAJ.js} +13 -1
- package/dist/{perl-BPzHt9SS.js → perl-B5-QbHq_.js} +34 -1
- package/dist/{pgsql-DlTJB0PD.js → pgsql-s6kqEJmi.js} +14 -4
- package/dist/{php-Dmq5OjwK.js → php-CWWqzOo8.js} +36 -1
- package/dist/{pla-HJcccrBy.js → pla-FSvb_YP_.js} +13 -1
- package/dist/{postiats-OQn6DKv-.js → postiats-DQdscQXO.js} +370 -1
- package/dist/{powerquery-DKaMYC8w.js → powerquery-CtA5JA1I.js} +7 -1
- package/dist/{powershell-DWeJHik1.js → powershell-DglEq96N.js} +13 -1
- package/dist/{protobuf-CBn_IseU.js → protobuf-BSepub3e.js} +5 -1
- package/dist/{pug-BoRpCINl.js → pug-B1847F4G.js} +16 -1
- package/dist/{python-zPpZYwLF.js → python-DLI1ji08.js} +59 -11
- package/dist/{qsharp-4rGyVZOw.js → qsharp-D4i0Nqg9.js} +28 -3
- package/dist/{r-DsgLhBOb.js → r-cdRigKxa.js} +5 -1
- package/dist/{razor-B_fCUeGX.js → razor-oAnIJsrL.js} +48 -4
- package/dist/{redis-B2fdL4Bg.js → redis-D9MFxvE8.js} +16 -6
- package/dist/{redshift-DoaeyCkH.js → redshift-CmCnsvL-.js} +13 -4
- package/dist/{restructuredtext-D-6OFBY9.js → restructuredtext-CWy8J51t.js} +19 -1
- package/dist/{ruby-D1DD6baV.js → ruby-WP-c36m5.js} +76 -3
- package/dist/runtime.js +34 -45
- package/dist/{rust-DssUV39M.js → rust-Q9FLdYpu.js} +13 -1
- package/dist/{sb-Dmb6tAdv.js → sb-C54-JBGT.js} +12 -1
- package/dist/{scala-Co3ETaym.js → scala-CzbFImc5.js} +24 -1
- package/dist/{scheme-CMrqXTty.js → scheme-BhfDmYN3.js} +1 -1
- package/dist/{scss-DkGudv8Q.js → scss-CEmiBXpS.js} +25 -1
- package/dist/{shell-BHN2BI4L.js → shell-Bmc1VhG0.js} +4 -1
- package/dist/{solidity-b-R-raGB.js → solidity-C9Q2I8Hh.js} +23 -1
- package/dist/{sophia-Y4GjyxNB.js → sophia-jWa1UyKz.js} +16 -1
- package/dist/{sparql-CDAPZb88.js → sparql-CM7jctbc.js} +15 -1
- package/dist/{sql-DkkpPiUq.js → sql-WzihTkbg.js} +42 -1
- package/dist/{st-CSPV91Ej.js → st-6y7_3aup.js} +8 -1
- package/dist/style.css +1 -1
- package/dist/{swift-DdSC5O48.js → swift-k-0zxG_D.js} +4 -1
- package/dist/{systemverilog-CI03XpAv.js → systemverilog-Pnr5_rIP.js} +29 -3
- package/dist/{tcl-B8DayMSI.js → tcl-fNPXval8.js} +7 -1
- package/dist/tsMode-D_PMsbjK.js +976 -0
- package/dist/{twig-B1AUPVB_.js → twig-L2MkztkV.js} +76 -1
- package/dist/{typescript-DrlYcCUn.js → typescript-Bu3ZbtQI.js} +23 -2
- package/dist/typespec-Cqqo-3Pt.js +123 -0
- package/dist/{vb-BIC7ccdG.js → vb-B5YC2xN9.js} +15 -1
- package/dist/{wgsl-C9yjop46.js → wgsl-D9BRtftY.js} +26 -1
- package/dist/{xml-BzP9D0eZ.js → xml-CNSSkPqy.js} +8 -2
- package/dist/{yaml-CT7GOvXu.js → yaml-5RF_PGNe.js} +30 -2
- package/handlers/compiler.ts +196 -16
- package/handlers/context-setup.ts +10 -5
- package/handlers/handler-api-factory.ts +358 -0
- package/handlers/handler-api.ts +379 -0
- package/handlers/handler-executor.ts +25 -5
- package/handlers/handler-scope.ts +398 -0
- package/handlers/index.ts +34 -2
- package/handlers/runtime-api/component-properties.ts +0 -8
- package/handlers/runtime-api/index.ts +1 -1
- package/handlers/runtime-api/toast.ts +1 -1
- package/index.ts +14 -115
- package/micro-app/README.md +10 -10
- package/micro-app/state/MicroAppRuntimeContext.ts +1 -28
- package/micro-app-entry.ts +0 -5
- package/package.json +22 -1
- package/redux/actions/application/index.ts +0 -1
- package/redux/actions/component/addComponentAction.ts +15 -4
- package/redux/actions/component/moveDraggedComponent.ts +1 -2
- package/redux/actions/component/update-component-name.ts +1 -1
- package/redux/actions/component/updateComponentAttributes.ts +7 -2
- package/redux/handlers/functions/build-function-handler.ts +11 -3
- package/redux/handlers/functions/deploy-function-handler.ts +11 -3
- package/redux/handlers/functions/invoke-function-handler.ts +11 -3
- package/redux/handlers/functions/load-functions-handler.ts +2 -1
- package/redux/handlers/functions/update-function-handler.ts +2 -1
- package/redux/store/component/component.interface.ts +8 -2
- package/redux/store/component/store.ts +1 -4
- package/state/runtime-context.ts +1 -23
- package/utils/RuntimeContextHelpers.ts +221 -90
- package/utils/change-detection.ts +125 -1
- package/utils/clipboard-utils.ts +18 -8
- package/utils/component-registry.ts +118 -0
- package/utils/index.ts +14 -1
- package/utils/naming-generator.ts +3 -1
- package/utils/randomness.ts +3 -1
- package/utils/register-components.ts +21 -29
- package/utils/render-util.ts +27 -48
- package/utils/toast.ts +97 -0
- package/vite.config.ts +29 -12
- package/components/ui/components/Event/EventAttribute/EventAttribute.style.ts +0 -11
- package/components/ui/components/Event/EventAttribute/EventAttribute.ts +0 -28
- package/components/ui/components/base/BaseElement/calculateStyles.ts +0 -31
- package/components/ui/components/base/BaseElement/drag-events.helpers.ts +0 -71
- package/components/ui/components/base/BaseElement/execute-event.helpers.ts +0 -45
- package/components/ui/components/base/BaseElement/interactions.helpers.ts +0 -14
- package/components/ui/components/wrappers/ComponentTitle/ComponentTitle.ts +0 -95
- package/components/ui/components/wrappers/GenerikWrapper/ResizeWrapper/ResizeWrapper.style.ts +0 -102
- package/components/ui/components/wrappers/GenerikWrapper/ResizeWrapper/ResizeWrapper.ts +0 -258
- package/components/ui/components/wrappers/PreviewWrapper.ts +0 -28
- package/components/ui/components/wrappers/RectangleSelection/RectangleSelection.ts +0 -154
- package/components/ui/nuraly-ui/packages/common/dist/constants/index.d.ts +0 -2
- package/components/ui/nuraly-ui/packages/common/dist/constants/index.js +0 -2
- package/components/ui/nuraly-ui/packages/common/dist/constants.d.ts +0 -17
- package/components/ui/nuraly-ui/packages/common/dist/constants.js +0 -7
- package/components/ui/nuraly-ui/packages/common/dist/controllers/index.d.ts +0 -2
- package/components/ui/nuraly-ui/packages/common/dist/controllers/index.js +0 -2
- package/components/ui/nuraly-ui/packages/common/dist/controllers.d.ts +0 -21
- package/components/ui/nuraly-ui/packages/common/dist/controllers.js +0 -22
- package/components/ui/nuraly-ui/packages/common/dist/index.d.ts +0 -25
- package/components/ui/nuraly-ui/packages/common/dist/index.js +0 -27
- package/components/ui/nuraly-ui/packages/common/dist/mixins/index.d.ts +0 -2
- package/components/ui/nuraly-ui/packages/common/dist/mixins/index.js +0 -3
- package/components/ui/nuraly-ui/packages/common/dist/mixins.d.ts +0 -26
- package/components/ui/nuraly-ui/packages/common/dist/mixins.js +0 -29
- package/components/ui/nuraly-ui/packages/common/dist/shared/base-mixin.d.ts +0 -42
- package/components/ui/nuraly-ui/packages/common/dist/shared/base-mixin.js +0 -38
- package/components/ui/nuraly-ui/packages/common/dist/shared/constants.d.ts +0 -1
- package/components/ui/nuraly-ui/packages/common/dist/shared/constants.js +0 -2
- package/components/ui/nuraly-ui/packages/common/dist/shared/controllers/dropdown.controller.d.ts +0 -77
- package/components/ui/nuraly-ui/packages/common/dist/shared/controllers/dropdown.controller.js +0 -341
- package/components/ui/nuraly-ui/packages/common/dist/shared/controllers/dropdown.interface.d.ts +0 -37
- package/components/ui/nuraly-ui/packages/common/dist/shared/controllers/dropdown.interface.js +0 -2
- package/components/ui/nuraly-ui/packages/common/dist/shared/controllers/index.d.ts +0 -4
- package/components/ui/nuraly-ui/packages/common/dist/shared/controllers/index.js +0 -4
- package/components/ui/nuraly-ui/packages/common/dist/shared/controllers/theme.controller.d.ts +0 -48
- package/components/ui/nuraly-ui/packages/common/dist/shared/controllers/theme.controller.js +0 -133
- package/components/ui/nuraly-ui/packages/common/dist/shared/dependency-mixin.d.ts +0 -37
- package/components/ui/nuraly-ui/packages/common/dist/shared/dependency-mixin.js +0 -141
- package/components/ui/nuraly-ui/packages/common/dist/shared/event-handler-mixin.d.ts +0 -64
- package/components/ui/nuraly-ui/packages/common/dist/shared/event-handler-mixin.js +0 -95
- package/components/ui/nuraly-ui/packages/common/dist/shared/index.d.ts +0 -13
- package/components/ui/nuraly-ui/packages/common/dist/shared/index.js +0 -17
- package/components/ui/nuraly-ui/packages/common/dist/shared/theme-mixin.d.ts +0 -78
- package/components/ui/nuraly-ui/packages/common/dist/shared/theme-mixin.js +0 -194
- package/components/ui/nuraly-ui/packages/common/dist/shared/themes.d.ts +0 -44
- package/components/ui/nuraly-ui/packages/common/dist/shared/themes.js +0 -85
- package/components/ui/nuraly-ui/packages/common/dist/shared/utils.d.ts +0 -60
- package/components/ui/nuraly-ui/packages/common/dist/shared/utils.js +0 -85
- package/components/ui/nuraly-ui/packages/common/dist/shared/validation.types.d.ts +0 -108
- package/components/ui/nuraly-ui/packages/common/dist/shared/validation.types.js +0 -17
- package/components/ui/nuraly-ui/packages/common/dist/themes/index.d.ts +0 -2
- package/components/ui/nuraly-ui/packages/common/dist/themes/index.js +0 -2
- package/components/ui/nuraly-ui/packages/common/dist/themes.d.ts +0 -22
- package/components/ui/nuraly-ui/packages/common/dist/themes.js +0 -23
- package/components/ui/nuraly-ui/packages/common/dist/utils/index.d.ts +0 -2
- package/components/ui/nuraly-ui/packages/common/dist/utils/index.js +0 -2
- package/components/ui/nuraly-ui/packages/common/dist/utils.d.ts +0 -21
- package/components/ui/nuraly-ui/packages/common/dist/utils.js +0 -22
- package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/LICENSE +0 -15
- package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/README.md +0 -294
- package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/copy/copy-sync.js +0 -171
- package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/copy/copy.js +0 -175
- package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/copy/index.js +0 -7
- package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/empty/index.js +0 -39
- package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/ensure/file.js +0 -66
- package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/ensure/index.js +0 -23
- package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/ensure/link.js +0 -64
- package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/ensure/symlink-paths.js +0 -101
- package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/ensure/symlink-type.js +0 -34
- package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/ensure/symlink.js +0 -67
- package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/fs/index.js +0 -146
- package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/index.js +0 -16
- package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/json/index.js +0 -16
- package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/json/jsonfile.js +0 -11
- package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/json/output-json-sync.js +0 -12
- package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/json/output-json.js +0 -12
- package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/mkdirs/index.js +0 -14
- package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/mkdirs/make-dir.js +0 -27
- package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/mkdirs/utils.js +0 -21
- package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/move/index.js +0 -7
- package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/move/move-sync.js +0 -55
- package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/move/move.js +0 -59
- package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/output-file/index.js +0 -31
- package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/path-exists/index.js +0 -12
- package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/remove/index.js +0 -17
- package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/util/async.js +0 -29
- package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/util/stat.js +0 -159
- package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/util/utimes.js +0 -36
- package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/LICENSE +0 -15
- package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/README.md +0 -294
- package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/copy/copy-sync.js +0 -171
- package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/copy/copy.js +0 -175
- package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/copy/index.js +0 -7
- package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/empty/index.js +0 -39
- package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/ensure/file.js +0 -66
- package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/ensure/index.js +0 -23
- package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/ensure/link.js +0 -64
- package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/ensure/symlink-paths.js +0 -101
- package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/ensure/symlink-type.js +0 -34
- package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/ensure/symlink.js +0 -67
- package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/fs/index.js +0 -146
- package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/index.js +0 -16
- package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/json/index.js +0 -16
- package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/json/jsonfile.js +0 -11
- package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/json/output-json-sync.js +0 -12
- package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/json/output-json.js +0 -12
- package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/mkdirs/index.js +0 -14
- package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/mkdirs/make-dir.js +0 -27
- package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/mkdirs/utils.js +0 -21
- package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/move/index.js +0 -7
- package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/move/move-sync.js +0 -55
- package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/move/move.js +0 -59
- package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/output-file/index.js +0 -31
- package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/path-exists/index.js +0 -12
- package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/remove/index.js +0 -17
- package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/util/async.js +0 -29
- package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/util/stat.js +0 -159
- package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/util/utimes.js +0 -36
- package/dist/SmartAttributeHandler-C4EliaG0.js +0 -153
- package/dist/SmartAttributeHandler-u-ZHGueR.js +0 -193
- package/dist/assets/editor.worker-C_S4Avdt.js +0 -11
- package/dist/assets/html.worker-DfuQASUV.js +0 -458
- package/dist/assets/json.worker-Cucz4wxY.js +0 -42
- package/dist/assets/ts.worker-Dme6S0YK.js +0 -37021
- package/dist/cssMode-CqMQ6Xsa.js +0 -1443
- package/dist/htmlMode-KglxyZXm.js +0 -1453
- package/dist/jsonMode-B3rqxD-b.js +0 -1863
- package/dist/tsMode-DEiq8fQ0.js +0 -800
- package/redux/actions/application/loadApplicationPermissionAction.ts +0 -10
- package/utils/styleUtil.ts +0 -7
|
@@ -0,0 +1,298 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file InputHandlerController.ts
|
|
3
|
+
* @description Controller for processing component input handlers
|
|
4
|
+
* Handles dynamic input resolution, caching, and debouncing
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import type { ReactiveController } from "lit";
|
|
8
|
+
import { Subscription } from "rxjs";
|
|
9
|
+
import { eventDispatcher } from "../../../../../utils/change-detection";
|
|
10
|
+
import { executeHandler } from "../../../../../handlers/handler-executor";
|
|
11
|
+
import Editor from "../../../../../state/editor";
|
|
12
|
+
import EditorInstance from "../../../../../state/editor";
|
|
13
|
+
import { RuntimeHelpers } from "../../../../../utils/runtime-helpers";
|
|
14
|
+
import { getNestedAttribute } from "../../../../../utils/object.utils";
|
|
15
|
+
import { isServer } from "../../../../../utils/envirement";
|
|
16
|
+
import { addlogDebug } from "../../../../../redux/actions/debug/store";
|
|
17
|
+
import type { InputHandlerHost, Disposable } from "../types/base-element.types";
|
|
18
|
+
import { EventDebouncer, ExecutionGuard, ChildRefreshBatcher } from "../utils/event-debouncer";
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Controller responsible for processing input handlers
|
|
22
|
+
* Extracts input processing logic from BaseElement for better separation of concerns
|
|
23
|
+
*/
|
|
24
|
+
export class InputHandlerController implements ReactiveController, Disposable {
|
|
25
|
+
private host: InputHandlerHost;
|
|
26
|
+
private subscription = new Subscription();
|
|
27
|
+
private debouncer = new EventDebouncer(16);
|
|
28
|
+
private executionGuard = new ExecutionGuard();
|
|
29
|
+
private childRefreshBatcher: ChildRefreshBatcher;
|
|
30
|
+
private isConnected = false;
|
|
31
|
+
|
|
32
|
+
constructor(host: InputHandlerHost) {
|
|
33
|
+
this.host = host;
|
|
34
|
+
host.addController(this);
|
|
35
|
+
|
|
36
|
+
// Set up child refresh batcher
|
|
37
|
+
this.childRefreshBatcher = new ChildRefreshBatcher((childId) => {
|
|
38
|
+
eventDispatcher.emit(`component:request:refresh:${childId}`);
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
hostConnected(): void {
|
|
43
|
+
this.isConnected = true;
|
|
44
|
+
this.setupEventListeners();
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
hostDisconnected(): void {
|
|
48
|
+
this.isConnected = false;
|
|
49
|
+
this.dispose();
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Set up all event listeners for input refresh triggers
|
|
54
|
+
*/
|
|
55
|
+
private setupEventListeners(): void {
|
|
56
|
+
const { component, uniqueUUID } = this.host;
|
|
57
|
+
|
|
58
|
+
// Platform change - reprocess all inputs
|
|
59
|
+
this.subscription.add(
|
|
60
|
+
eventDispatcher.on("Vars:currentPlatform", () => {
|
|
61
|
+
this.processInputsDebounced();
|
|
62
|
+
})
|
|
63
|
+
);
|
|
64
|
+
|
|
65
|
+
// Component-specific input refresh request
|
|
66
|
+
this.subscription.add(
|
|
67
|
+
eventDispatcher.on(
|
|
68
|
+
`component-input-refresh-request:${component.uuid}`,
|
|
69
|
+
() => {
|
|
70
|
+
this.processInputsDebounced();
|
|
71
|
+
}
|
|
72
|
+
)
|
|
73
|
+
);
|
|
74
|
+
|
|
75
|
+
// Value set events
|
|
76
|
+
this.subscription.add(
|
|
77
|
+
eventDispatcher.on(`component:value:set:${uniqueUUID}`, () => {
|
|
78
|
+
this.processInputsDebounced();
|
|
79
|
+
this.queueChildRefresh();
|
|
80
|
+
})
|
|
81
|
+
);
|
|
82
|
+
|
|
83
|
+
// Component request refresh
|
|
84
|
+
this.subscription.add(
|
|
85
|
+
eventDispatcher.on(`component:request:refresh:${component.uuid}`, () => {
|
|
86
|
+
this.processInputsDebounced();
|
|
87
|
+
this.queueChildRefresh();
|
|
88
|
+
})
|
|
89
|
+
);
|
|
90
|
+
|
|
91
|
+
// Property changed event
|
|
92
|
+
this.subscription.add(
|
|
93
|
+
eventDispatcher.on(
|
|
94
|
+
`component-property-changed:${String(component.name)}`,
|
|
95
|
+
() => {
|
|
96
|
+
this.processInputsDebounced();
|
|
97
|
+
this.queueChildRefresh();
|
|
98
|
+
}
|
|
99
|
+
)
|
|
100
|
+
);
|
|
101
|
+
|
|
102
|
+
// Component updated event
|
|
103
|
+
this.subscription.add(
|
|
104
|
+
eventDispatcher.on(`component-updated:${String(component.uuid)}`, () => {
|
|
105
|
+
this.debouncer.debounce("component-updated", () => {
|
|
106
|
+
this.processInputs();
|
|
107
|
+
}, 0); // Use setTimeout(0) to defer to next tick
|
|
108
|
+
})
|
|
109
|
+
);
|
|
110
|
+
|
|
111
|
+
// Editing mode change - re-run onInit
|
|
112
|
+
this.subscription.add(
|
|
113
|
+
eventDispatcher.on("Vars:currentEditingMode", () => {
|
|
114
|
+
this.executeOnInit();
|
|
115
|
+
})
|
|
116
|
+
);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* Queue child refresh with batching to prevent event storms
|
|
121
|
+
*/
|
|
122
|
+
private queueChildRefresh(): void {
|
|
123
|
+
const childIds = this.host.component.childrenIds;
|
|
124
|
+
if (childIds?.length) {
|
|
125
|
+
this.childRefreshBatcher.queueChildren(childIds);
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* Execute onInit handler if present
|
|
131
|
+
*/
|
|
132
|
+
private executeOnInit(): void {
|
|
133
|
+
const code = getNestedAttribute(this.host.component, "event.onInit");
|
|
134
|
+
if (code) {
|
|
135
|
+
executeHandler(this.host.component, code, {}, { ...this.host.item });
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* Process inputs with debouncing
|
|
141
|
+
*/
|
|
142
|
+
processInputsDebounced(): void {
|
|
143
|
+
this.debouncer.debounce("process-inputs", () => {
|
|
144
|
+
this.processInputs();
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
* Process all component inputs
|
|
150
|
+
*/
|
|
151
|
+
async processInputs(): Promise<void> {
|
|
152
|
+
if (isServer || !this.isConnected) return;
|
|
153
|
+
|
|
154
|
+
// Reset errors for this processing cycle
|
|
155
|
+
this.host.errors = {};
|
|
156
|
+
|
|
157
|
+
const inputs = Editor.getComponentBreakpointInputs(this.host.component);
|
|
158
|
+
if (!inputs) return;
|
|
159
|
+
|
|
160
|
+
// Process all inputs in parallel
|
|
161
|
+
await Promise.all(
|
|
162
|
+
Object.keys(inputs).map((name) =>
|
|
163
|
+
this.processInput(inputs[name], name)
|
|
164
|
+
)
|
|
165
|
+
);
|
|
166
|
+
|
|
167
|
+
// Log debug info
|
|
168
|
+
addlogDebug({
|
|
169
|
+
errors: {
|
|
170
|
+
component: {
|
|
171
|
+
...this.host.component,
|
|
172
|
+
errors: { ...this.host.errors },
|
|
173
|
+
},
|
|
174
|
+
},
|
|
175
|
+
});
|
|
176
|
+
|
|
177
|
+
// Trigger re-render
|
|
178
|
+
this.host.requestUpdate();
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
/**
|
|
182
|
+
* Process a single input handler
|
|
183
|
+
*/
|
|
184
|
+
private async processInput(input: any, inputName: string): Promise<void> {
|
|
185
|
+
if (!input) return;
|
|
186
|
+
|
|
187
|
+
const { component, item, inputHandlersValue, callbacks, errors, uniqueUUID } =
|
|
188
|
+
this.host;
|
|
189
|
+
const handlerKey = `${component.uuid || component.name}:${inputName}`;
|
|
190
|
+
|
|
191
|
+
// Use execution guard to prevent re-entrant execution
|
|
192
|
+
const result = await this.executionGuard.guard(handlerKey, async () => {
|
|
193
|
+
return this.executeInputHandler(input, inputName);
|
|
194
|
+
});
|
|
195
|
+
|
|
196
|
+
if (result === undefined) {
|
|
197
|
+
// Handler was already executing, skip
|
|
198
|
+
return;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
// Update state if value changed
|
|
202
|
+
if (inputHandlersValue[inputName] !== result.value) {
|
|
203
|
+
inputHandlersValue[inputName] = result.value;
|
|
204
|
+
|
|
205
|
+
// Update properties proxy
|
|
206
|
+
const proxy =
|
|
207
|
+
(this.host.ExecuteInstance.PropertiesProxy[component.name] ??= {});
|
|
208
|
+
proxy[inputName] = result.value;
|
|
209
|
+
|
|
210
|
+
// Call registered callback
|
|
211
|
+
callbacks[inputName]?.(result.value);
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
// Track errors
|
|
215
|
+
if (result.error) {
|
|
216
|
+
errors[inputName] = { error: result.error.message };
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
/**
|
|
221
|
+
* Execute input handler and return result
|
|
222
|
+
*/
|
|
223
|
+
private async executeInputHandler(
|
|
224
|
+
input: any,
|
|
225
|
+
inputName: string
|
|
226
|
+
): Promise<{ value: any; error?: { message: string } }> {
|
|
227
|
+
const { component, item, uniqueUUID } = this.host;
|
|
228
|
+
|
|
229
|
+
// Execute handler if input type is "handler"
|
|
230
|
+
if (input.type === "handler") {
|
|
231
|
+
try {
|
|
232
|
+
const code = input.value;
|
|
233
|
+
if (code) {
|
|
234
|
+
const fn = executeHandler(
|
|
235
|
+
{ ...component, uniqueUUID },
|
|
236
|
+
code,
|
|
237
|
+
undefined,
|
|
238
|
+
{ ...item }
|
|
239
|
+
);
|
|
240
|
+
const result = RuntimeHelpers.isPromise(fn) ? await fn : fn;
|
|
241
|
+
return { value: result };
|
|
242
|
+
}
|
|
243
|
+
return { value: undefined };
|
|
244
|
+
} catch (error: any) {
|
|
245
|
+
this.logHandlerError(inputName, input.value, error, "input");
|
|
246
|
+
return { value: undefined, error: { message: error.message } };
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
// Static value
|
|
251
|
+
return { value: input.value };
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
/**
|
|
255
|
+
* Log handler execution error to console
|
|
256
|
+
*/
|
|
257
|
+
private logHandlerError(
|
|
258
|
+
inputName: string,
|
|
259
|
+
code: string,
|
|
260
|
+
error: Error,
|
|
261
|
+
source: "inputHandlers" | "input"
|
|
262
|
+
): void {
|
|
263
|
+
try {
|
|
264
|
+
const { component } = this.host;
|
|
265
|
+
EditorInstance.Console.log(
|
|
266
|
+
`<i style="cursor:pointer" data-uuid="${component.uuid}" data-application_uuid="${component.application_id}"><b>${component.name}</b></i> > ${source} > ${inputName} | component uuid > ${component.uuid}`
|
|
267
|
+
);
|
|
268
|
+
EditorInstance.Console.log(this.formatCodeWithError(code, error));
|
|
269
|
+
} catch (logError) {
|
|
270
|
+
console.error("Error logging handler error:", logError);
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
/**
|
|
275
|
+
* Format code with error highlighting
|
|
276
|
+
*/
|
|
277
|
+
private formatCodeWithError(code: string, error: Error): string {
|
|
278
|
+
// Simplified error formatting - can be expanded
|
|
279
|
+
const lines = code?.split("\n") || [];
|
|
280
|
+
let result = "Code:\n";
|
|
281
|
+
lines.forEach((line, i) => {
|
|
282
|
+
result += `${(i + 1).toString().padStart(3, " ")}| ${line}\n`;
|
|
283
|
+
});
|
|
284
|
+
result += `\nError: ${error.name}: ${error.message}`;
|
|
285
|
+
return result;
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
/**
|
|
289
|
+
* Clean up all resources
|
|
290
|
+
*/
|
|
291
|
+
dispose(): void {
|
|
292
|
+
this.subscription.unsubscribe();
|
|
293
|
+
this.subscription = new Subscription();
|
|
294
|
+
this.debouncer.cancelAll();
|
|
295
|
+
this.executionGuard.clear();
|
|
296
|
+
this.childRefreshBatcher.cancel();
|
|
297
|
+
}
|
|
298
|
+
}
|
|
@@ -0,0 +1,323 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file SelectionController.ts
|
|
3
|
+
* @description Controller for handling component selection in editor mode
|
|
4
|
+
* Manages selection state, keyboard navigation, and hover interactions
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import type { ReactiveController } from "lit";
|
|
8
|
+
import { Subscription } from "rxjs";
|
|
9
|
+
import { eventDispatcher } from "../../../../../utils/change-detection";
|
|
10
|
+
import { ExecuteInstance } from "../../../../../state/runtime-context";
|
|
11
|
+
import EditorInstance from "../../../../../state/editor";
|
|
12
|
+
import { RuntimeHelpers } from "../../../../../utils/runtime-helpers";
|
|
13
|
+
import { $hoveredComponent } from "../../../../../redux/store/component/store";
|
|
14
|
+
import { $resizing } from "../../../../../redux/store/apps";
|
|
15
|
+
import { setContextMenuEvent } from "../../../../../redux/actions/page/setContextMenuEvent";
|
|
16
|
+
import type { SelectionHost, Disposable, Activatable } from "../types/base-element.types";
|
|
17
|
+
import type { ComponentElement } from "../../../../../redux/store/component/component.interface";
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Controller responsible for component selection and hover state
|
|
21
|
+
* Only active in editor mode (not view mode)
|
|
22
|
+
*/
|
|
23
|
+
export class SelectionController implements ReactiveController, Disposable, Activatable {
|
|
24
|
+
private host: SelectionHost;
|
|
25
|
+
private subscription = new Subscription();
|
|
26
|
+
private isActive = false;
|
|
27
|
+
private hoveredComponent: ComponentElement | null = null;
|
|
28
|
+
private isEditable = false;
|
|
29
|
+
|
|
30
|
+
// Bound event handlers for proper cleanup
|
|
31
|
+
private boundMouseEnter: (e: MouseEvent) => void;
|
|
32
|
+
private boundMouseLeave: (e: MouseEvent) => void;
|
|
33
|
+
private boundClick: (e: MouseEvent) => void;
|
|
34
|
+
private boundContextMenu: (e: MouseEvent) => void;
|
|
35
|
+
|
|
36
|
+
constructor(host: SelectionHost) {
|
|
37
|
+
this.host = host;
|
|
38
|
+
host.addController(this);
|
|
39
|
+
|
|
40
|
+
// Bind handlers
|
|
41
|
+
this.boundMouseEnter = this.handleMouseEnter.bind(this);
|
|
42
|
+
this.boundMouseLeave = this.handleMouseLeave.bind(this);
|
|
43
|
+
this.boundClick = this.handleClick.bind(this);
|
|
44
|
+
this.boundContextMenu = this.handleContextMenu.bind(this);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
hostConnected(): void {
|
|
48
|
+
// Controller is activated separately via activate()
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
hostDisconnected(): void {
|
|
52
|
+
this.deactivate();
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Activate selection controller (editor mode only)
|
|
57
|
+
*/
|
|
58
|
+
activate(): void {
|
|
59
|
+
if (this.isActive || this.host.isViewMode) return;
|
|
60
|
+
this.isActive = true;
|
|
61
|
+
|
|
62
|
+
// Add DOM event listeners
|
|
63
|
+
this.host.addEventListener("mouseenter", this.boundMouseEnter);
|
|
64
|
+
this.host.addEventListener("mouseleave", this.boundMouseLeave);
|
|
65
|
+
this.host.addEventListener("click", this.boundClick);
|
|
66
|
+
this.host.addEventListener("contextmenu", this.boundContextMenu);
|
|
67
|
+
|
|
68
|
+
// Subscribe to store changes
|
|
69
|
+
this.setupSubscriptions();
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Deactivate selection controller
|
|
74
|
+
*/
|
|
75
|
+
deactivate(): void {
|
|
76
|
+
if (!this.isActive) return;
|
|
77
|
+
this.isActive = false;
|
|
78
|
+
|
|
79
|
+
// Remove DOM event listeners
|
|
80
|
+
this.host.removeEventListener("mouseenter", this.boundMouseEnter);
|
|
81
|
+
this.host.removeEventListener("mouseleave", this.boundMouseLeave);
|
|
82
|
+
this.host.removeEventListener("click", this.boundClick);
|
|
83
|
+
this.host.removeEventListener("contextmenu", this.boundContextMenu);
|
|
84
|
+
|
|
85
|
+
// Clean up subscriptions
|
|
86
|
+
this.subscription.unsubscribe();
|
|
87
|
+
this.subscription = new Subscription();
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Set up store subscriptions
|
|
92
|
+
*/
|
|
93
|
+
private setupSubscriptions(): void {
|
|
94
|
+
// Hover component store
|
|
95
|
+
this.subscription.add(
|
|
96
|
+
RuntimeHelpers.createStoreObservable($hoveredComponent).subscribe(
|
|
97
|
+
(hoveredComponent) => {
|
|
98
|
+
this.hoveredComponent = hoveredComponent;
|
|
99
|
+
}
|
|
100
|
+
)
|
|
101
|
+
);
|
|
102
|
+
|
|
103
|
+
// Selection changes
|
|
104
|
+
this.subscription.add(
|
|
105
|
+
eventDispatcher.on("Vars:selectedComponents", () => {
|
|
106
|
+
this.handleSelectionChange();
|
|
107
|
+
})
|
|
108
|
+
);
|
|
109
|
+
|
|
110
|
+
// Keyboard events
|
|
111
|
+
this.subscription.add(
|
|
112
|
+
eventDispatcher.on("keydown", ({ key, selectedComponents }) => {
|
|
113
|
+
this.handleKeydown(key, selectedComponents);
|
|
114
|
+
})
|
|
115
|
+
);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* Handle selection change events
|
|
120
|
+
*/
|
|
121
|
+
private handleSelectionChange(): void {
|
|
122
|
+
const selectedComponents = ExecuteInstance.Vars.selectedComponents;
|
|
123
|
+
this.host.currentSelection = Array.from(selectedComponents).map(
|
|
124
|
+
(component: ComponentElement) => component.uuid
|
|
125
|
+
);
|
|
126
|
+
EditorInstance.currentSelection = this.host.currentSelection;
|
|
127
|
+
|
|
128
|
+
// Check if this component is selected
|
|
129
|
+
const isSelected =
|
|
130
|
+
selectedComponents.length === 1 &&
|
|
131
|
+
selectedComponents[0]?.uuid === this.host.component.uuid;
|
|
132
|
+
|
|
133
|
+
if (isSelected) {
|
|
134
|
+
this.scrollIntoViewIfNeeded();
|
|
135
|
+
this.emitSelectionEvent();
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* Scroll component into view if not visible
|
|
141
|
+
*/
|
|
142
|
+
private scrollIntoViewIfNeeded(): void {
|
|
143
|
+
requestAnimationFrame(() => {
|
|
144
|
+
const element = this.host.inputRef.value;
|
|
145
|
+
if (!element) return;
|
|
146
|
+
|
|
147
|
+
const rect = element.getBoundingClientRect();
|
|
148
|
+
const isInViewport =
|
|
149
|
+
rect.top >= 0 &&
|
|
150
|
+
rect.left >= 0 &&
|
|
151
|
+
rect.bottom <= (window.innerHeight || document.documentElement.clientHeight) &&
|
|
152
|
+
rect.right <= (window.innerWidth || document.documentElement.clientWidth);
|
|
153
|
+
|
|
154
|
+
if (!isInViewport) {
|
|
155
|
+
element.scrollIntoView({
|
|
156
|
+
behavior: "smooth",
|
|
157
|
+
block: "center",
|
|
158
|
+
inline: "nearest",
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* Emit component selected custom event
|
|
166
|
+
*/
|
|
167
|
+
private emitSelectionEvent(): void {
|
|
168
|
+
requestAnimationFrame(() => {
|
|
169
|
+
this.host.dispatchEvent(
|
|
170
|
+
new CustomEvent("component-selected", {
|
|
171
|
+
detail: {
|
|
172
|
+
component: this.host.component,
|
|
173
|
+
elementRef: this.host.inputRef,
|
|
174
|
+
},
|
|
175
|
+
bubbles: true,
|
|
176
|
+
composed: true,
|
|
177
|
+
})
|
|
178
|
+
);
|
|
179
|
+
});
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
/**
|
|
183
|
+
* Handle keydown events
|
|
184
|
+
*/
|
|
185
|
+
private handleKeydown(key: string, selectedComponents: string[]): void {
|
|
186
|
+
if (
|
|
187
|
+
key === "Enter" &&
|
|
188
|
+
selectedComponents.length === 1 &&
|
|
189
|
+
this.host.component.uuid === selectedComponents[0]
|
|
190
|
+
) {
|
|
191
|
+
this.isEditable = true;
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
/**
|
|
196
|
+
* Handle mouse enter event
|
|
197
|
+
*/
|
|
198
|
+
private handleMouseEnter(_e: MouseEvent): void {
|
|
199
|
+
// Don't trigger hover when resizing
|
|
200
|
+
if ($resizing.get()) return;
|
|
201
|
+
|
|
202
|
+
// Emit hover event
|
|
203
|
+
this.host.dispatchEvent(
|
|
204
|
+
new CustomEvent("component-hovered", {
|
|
205
|
+
detail: {
|
|
206
|
+
component: this.host.component,
|
|
207
|
+
elementRef: this.host.inputRef,
|
|
208
|
+
},
|
|
209
|
+
bubbles: true,
|
|
210
|
+
composed: true,
|
|
211
|
+
})
|
|
212
|
+
);
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
/**
|
|
216
|
+
* Handle mouse leave event
|
|
217
|
+
*/
|
|
218
|
+
private handleMouseLeave(_e: MouseEvent): void {
|
|
219
|
+
// Don't trigger hover clear when resizing
|
|
220
|
+
if ($resizing.get()) return;
|
|
221
|
+
|
|
222
|
+
// Emit hover clear event
|
|
223
|
+
this.host.dispatchEvent(
|
|
224
|
+
new CustomEvent("component-hovered", {
|
|
225
|
+
detail: {
|
|
226
|
+
component: null,
|
|
227
|
+
elementRef: null,
|
|
228
|
+
},
|
|
229
|
+
bubbles: true,
|
|
230
|
+
composed: true,
|
|
231
|
+
})
|
|
232
|
+
);
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
/**
|
|
236
|
+
* Handle click event for selection
|
|
237
|
+
*/
|
|
238
|
+
private handleClick(e: MouseEvent): void {
|
|
239
|
+
e.preventDefault();
|
|
240
|
+
e.stopPropagation();
|
|
241
|
+
this.select(e);
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
/**
|
|
245
|
+
* Handle context menu event
|
|
246
|
+
*/
|
|
247
|
+
private handleContextMenu(e: MouseEvent): void {
|
|
248
|
+
e.preventDefault();
|
|
249
|
+
e.stopPropagation();
|
|
250
|
+
|
|
251
|
+
this.select(e);
|
|
252
|
+
|
|
253
|
+
const rect = this.host.inputRef.value?.getBoundingClientRect();
|
|
254
|
+
if (rect) {
|
|
255
|
+
Object.assign(e, {
|
|
256
|
+
ComponentTop: rect.top,
|
|
257
|
+
ComponentLeft: rect.left,
|
|
258
|
+
ComponentBottom: rect.bottom,
|
|
259
|
+
ComponentHeight: rect.height,
|
|
260
|
+
});
|
|
261
|
+
setContextMenuEvent(e);
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
/**
|
|
266
|
+
* Select this component
|
|
267
|
+
*/
|
|
268
|
+
select(_e?: Event): void {
|
|
269
|
+
const { component } = this.host;
|
|
270
|
+
|
|
271
|
+
// Update selection state
|
|
272
|
+
this.host.currentSelection = [component.uuid];
|
|
273
|
+
EditorInstance.currentSelection = [component.uuid];
|
|
274
|
+
ExecuteInstance.VarsProxy.selectedComponents = [component];
|
|
275
|
+
|
|
276
|
+
// Emit selection event
|
|
277
|
+
this.host.dispatchEvent(
|
|
278
|
+
new CustomEvent("component-selected", {
|
|
279
|
+
detail: {
|
|
280
|
+
component: component,
|
|
281
|
+
elementRef: this.host.inputRef,
|
|
282
|
+
},
|
|
283
|
+
bubbles: true,
|
|
284
|
+
composed: true,
|
|
285
|
+
})
|
|
286
|
+
);
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
/**
|
|
290
|
+
* Check if this component is currently selected
|
|
291
|
+
*/
|
|
292
|
+
isSelected(): boolean {
|
|
293
|
+
return this.host.currentSelection.includes(this.host.component.uuid);
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
/**
|
|
297
|
+
* Check if this component is currently hovered
|
|
298
|
+
*/
|
|
299
|
+
isHovered(): boolean {
|
|
300
|
+
return this.hoveredComponent?.uuid === this.host.component.uuid;
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
/**
|
|
304
|
+
* Check if component is in editable mode
|
|
305
|
+
*/
|
|
306
|
+
getIsEditable(): boolean {
|
|
307
|
+
return this.isEditable;
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
/**
|
|
311
|
+
* Set editable mode
|
|
312
|
+
*/
|
|
313
|
+
setEditable(editable: boolean): void {
|
|
314
|
+
this.isEditable = editable;
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
/**
|
|
318
|
+
* Clean up all resources
|
|
319
|
+
*/
|
|
320
|
+
dispose(): void {
|
|
321
|
+
this.deactivate();
|
|
322
|
+
}
|
|
323
|
+
}
|