@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
|
@@ -22,6 +22,59 @@ import deepEqual from 'fast-deep-equal';
|
|
|
22
22
|
import { eventDispatcher } from './change-detection';
|
|
23
23
|
import type { ComponentElement } from '../redux/store/component/component.interface';
|
|
24
24
|
|
|
25
|
+
// ============================================================================
|
|
26
|
+
// Helper Functions (extracted to reduce duplication)
|
|
27
|
+
// ============================================================================
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Safely compare two values for equality, handling proxy objects.
|
|
31
|
+
*/
|
|
32
|
+
function safeDeepEqual(oldValue: any, newValue: any): boolean {
|
|
33
|
+
try {
|
|
34
|
+
return deepEqual(oldValue, newValue);
|
|
35
|
+
} catch {
|
|
36
|
+
// If deepEqual fails (e.g., comparing proxies), assume values are different
|
|
37
|
+
return false;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Build a scoped event name with optional prefix.
|
|
43
|
+
*/
|
|
44
|
+
function buildEventName(eventPrefix: string, eventType: string, suffix?: string): string {
|
|
45
|
+
const base = eventPrefix ? `${eventPrefix}:${eventType}` : eventType;
|
|
46
|
+
return suffix ? `${base}:${suffix}` : base;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Emit property change events to all listeners.
|
|
51
|
+
*/
|
|
52
|
+
function emitToListeners(
|
|
53
|
+
listeners: Set<string>,
|
|
54
|
+
eventPrefix: string,
|
|
55
|
+
prop: string,
|
|
56
|
+
data: Record<string, any>
|
|
57
|
+
): void {
|
|
58
|
+
listeners.forEach((componentName: string) => {
|
|
59
|
+
const eventName = buildEventName(eventPrefix, 'component-property-changed', componentName);
|
|
60
|
+
eventDispatcher.emit(eventName, { prop, ...data });
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Emit scope-specific event if scope is provided.
|
|
66
|
+
*/
|
|
67
|
+
function emitScopeEvent(
|
|
68
|
+
scope: string | undefined,
|
|
69
|
+
eventPrefix: string,
|
|
70
|
+
propPath: string,
|
|
71
|
+
data: Record<string, any>
|
|
72
|
+
): void {
|
|
73
|
+
if (!scope) return;
|
|
74
|
+
const eventName = buildEventName(eventPrefix, scope, propPath);
|
|
75
|
+
eventDispatcher.emit(eventName, data);
|
|
76
|
+
}
|
|
77
|
+
|
|
25
78
|
/**
|
|
26
79
|
* Configuration for reactive proxy creation
|
|
27
80
|
*/
|
|
@@ -41,8 +94,6 @@ export interface ReactiveProxyConfig {
|
|
|
41
94
|
/** Callback when property changes */
|
|
42
95
|
onPropertyChange: (prop: string, value: any, listeners: Set<string>) => void;
|
|
43
96
|
|
|
44
|
-
/** Optional debug mode */
|
|
45
|
-
debug?: boolean;
|
|
46
97
|
}
|
|
47
98
|
|
|
48
99
|
/**
|
|
@@ -110,7 +161,7 @@ export class RuntimeContextHelpers {
|
|
|
110
161
|
target: T,
|
|
111
162
|
config: ReactiveProxyConfig
|
|
112
163
|
): T {
|
|
113
|
-
const { eventPrefix, scope, listeners, current, onPropertyChange
|
|
164
|
+
const { eventPrefix, scope, listeners, current, onPropertyChange } = config;
|
|
114
165
|
|
|
115
166
|
if (typeof target !== 'object' || target === null) {
|
|
116
167
|
return target;
|
|
@@ -118,11 +169,6 @@ export class RuntimeContextHelpers {
|
|
|
118
169
|
|
|
119
170
|
return new Proxy(target, {
|
|
120
171
|
get(proxyTarget, prop, receiver) {
|
|
121
|
-
if (debug) {
|
|
122
|
-
const prefix = eventPrefix ? `[${eventPrefix}]` : '[Global]';
|
|
123
|
-
console.log(`${prefix} Accessing property '${String(prop)}'`);
|
|
124
|
-
}
|
|
125
|
-
|
|
126
172
|
const value = Reflect.get(proxyTarget, prop, receiver);
|
|
127
173
|
|
|
128
174
|
// Track listener for this property
|
|
@@ -134,14 +180,22 @@ export class RuntimeContextHelpers {
|
|
|
134
180
|
listeners[String(prop)].add(current.name);
|
|
135
181
|
}
|
|
136
182
|
|
|
137
|
-
// Create nested proxy for object values
|
|
138
|
-
if (typeof value === 'object' && value !== null) {
|
|
183
|
+
// Create nested proxy for object values (non-arrays)
|
|
184
|
+
if (typeof value === 'object' && value !== null && !Array.isArray(value)) {
|
|
139
185
|
return RuntimeContextHelpers.createNestedProxy(value, {
|
|
140
186
|
...config,
|
|
141
187
|
parentProp: String(prop)
|
|
142
188
|
});
|
|
143
189
|
}
|
|
144
190
|
|
|
191
|
+
// Create array proxy for array values
|
|
192
|
+
if (Array.isArray(value)) {
|
|
193
|
+
return RuntimeContextHelpers.createArrayProxy(value, {
|
|
194
|
+
...config,
|
|
195
|
+
parentProp: String(prop)
|
|
196
|
+
});
|
|
197
|
+
}
|
|
198
|
+
|
|
145
199
|
return value;
|
|
146
200
|
},
|
|
147
201
|
|
|
@@ -149,45 +203,18 @@ export class RuntimeContextHelpers {
|
|
|
149
203
|
const oldValue = proxyTarget[prop as keyof T];
|
|
150
204
|
|
|
151
205
|
// Guard: Don't emit events if value hasn't changed
|
|
152
|
-
|
|
153
|
-
let valuesEqual = false;
|
|
154
|
-
try {
|
|
155
|
-
valuesEqual = deepEqual(oldValue, value);
|
|
156
|
-
} catch (e) {
|
|
157
|
-
// If deepEqual fails (e.g., comparing proxies), assume values are different
|
|
158
|
-
valuesEqual = false;
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
if (valuesEqual) {
|
|
206
|
+
if (safeDeepEqual(oldValue, value)) {
|
|
162
207
|
return true;
|
|
163
208
|
}
|
|
164
209
|
|
|
165
210
|
const result = Reflect.set(proxyTarget, prop, value, receiver);
|
|
166
211
|
|
|
167
|
-
if (debug) {
|
|
168
|
-
const prefix = eventPrefix ? `[${eventPrefix}]` : '[Global]';
|
|
169
|
-
console.log(`${prefix} Setting property '${String(prop)}' to '${value}'`);
|
|
170
|
-
}
|
|
171
|
-
|
|
172
212
|
// Emit property change events
|
|
173
213
|
const propListeners = listeners[String(prop)] || new Set<string>();
|
|
174
214
|
onPropertyChange(String(prop), value, propListeners);
|
|
175
215
|
|
|
176
216
|
// Emit scope-specific event if scope is provided
|
|
177
|
-
|
|
178
|
-
const eventName = eventPrefix
|
|
179
|
-
? `${eventPrefix}:${scope}:${String(prop)}`
|
|
180
|
-
: `${scope}:${String(prop)}`;
|
|
181
|
-
|
|
182
|
-
if (debug || (scope === 'Vars' && String(prop) === 'selectedComponents')) {
|
|
183
|
-
console.log(`[RuntimeContextHelpers] Emitting event: ${eventName}`, { value, ctx: current });
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
eventDispatcher.emit(eventName, {
|
|
187
|
-
value,
|
|
188
|
-
ctx: current // IMPORTANT: Include ctx for scope events (e.g., Vars:selectedComponents)
|
|
189
|
-
});
|
|
190
|
-
}
|
|
217
|
+
emitScopeEvent(scope, eventPrefix, String(prop), { value, ctx: current });
|
|
191
218
|
|
|
192
219
|
return result;
|
|
193
220
|
}
|
|
@@ -208,83 +235,187 @@ export class RuntimeContextHelpers {
|
|
|
208
235
|
target: T,
|
|
209
236
|
config: NestedProxyConfig
|
|
210
237
|
): T {
|
|
211
|
-
const { eventPrefix, scope, listeners, current, parentProp
|
|
238
|
+
const { eventPrefix, scope, listeners, current, parentProp } = config;
|
|
212
239
|
|
|
213
240
|
return new Proxy(target, {
|
|
241
|
+
get(proxyTarget, prop, receiver) {
|
|
242
|
+
const value = Reflect.get(proxyTarget, prop, receiver);
|
|
243
|
+
|
|
244
|
+
// Track listener for nested property access
|
|
245
|
+
const nestedPropKey = `${parentProp}.${String(prop)}`;
|
|
246
|
+
if (!listeners[nestedPropKey]) {
|
|
247
|
+
listeners[nestedPropKey] = new Set<string>();
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
if (current.name) {
|
|
251
|
+
listeners[nestedPropKey].add(current.name);
|
|
252
|
+
// Also add to parent property listeners for coarse-grained tracking
|
|
253
|
+
if (!listeners[parentProp]) {
|
|
254
|
+
listeners[parentProp] = new Set<string>();
|
|
255
|
+
}
|
|
256
|
+
listeners[parentProp].add(current.name);
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
// Recursively proxy deeper nested objects
|
|
260
|
+
if (typeof value === 'object' && value !== null && !Array.isArray(value)) {
|
|
261
|
+
return RuntimeContextHelpers.createNestedProxy(value, {
|
|
262
|
+
...config,
|
|
263
|
+
parentProp: nestedPropKey
|
|
264
|
+
});
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
// Handle arrays with mutation tracking
|
|
268
|
+
if (Array.isArray(value)) {
|
|
269
|
+
return RuntimeContextHelpers.createArrayProxy(value, {
|
|
270
|
+
...config,
|
|
271
|
+
parentProp: nestedPropKey
|
|
272
|
+
});
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
return value;
|
|
276
|
+
},
|
|
277
|
+
|
|
214
278
|
set(proxyTarget, prop, value, receiver) {
|
|
215
279
|
const oldValue = proxyTarget[prop as keyof T];
|
|
216
280
|
const result = Reflect.set(proxyTarget, prop, value, receiver);
|
|
217
281
|
|
|
218
|
-
if (
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
);
|
|
223
|
-
}
|
|
282
|
+
if (!safeDeepEqual(oldValue, value)) {
|
|
283
|
+
// Emit to parent property listeners
|
|
284
|
+
const parentListeners = listeners[parentProp] || new Set<string>();
|
|
285
|
+
emitToListeners(parentListeners, eventPrefix, parentProp, { value, ctx: current });
|
|
224
286
|
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
287
|
+
// Emit nested scope event if scope is provided
|
|
288
|
+
emitScopeEvent(scope, eventPrefix, `${parentProp}.${String(prop)}`, {
|
|
289
|
+
prop,
|
|
290
|
+
value,
|
|
291
|
+
oldValue,
|
|
292
|
+
parent: parentProp
|
|
293
|
+
});
|
|
232
294
|
}
|
|
233
295
|
|
|
234
|
-
|
|
235
|
-
|
|
296
|
+
return result;
|
|
297
|
+
},
|
|
298
|
+
|
|
299
|
+
deleteProperty(proxyTarget, prop) {
|
|
300
|
+
const result = Reflect.deleteProperty(proxyTarget, prop);
|
|
301
|
+
|
|
302
|
+
if (result) {
|
|
236
303
|
const parentListeners = listeners[parentProp] || new Set<string>();
|
|
237
|
-
parentListeners
|
|
238
|
-
|
|
239
|
-
? `${eventPrefix}:component-property-changed:${componentName}`
|
|
240
|
-
: `component-property-changed:${componentName}`;
|
|
304
|
+
emitToListeners(parentListeners, eventPrefix, parentProp, { ctx: current });
|
|
305
|
+
}
|
|
241
306
|
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
307
|
+
return result;
|
|
308
|
+
}
|
|
309
|
+
});
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
/**
|
|
313
|
+
* Create a proxy for arrays that tracks mutation methods.
|
|
314
|
+
*
|
|
315
|
+
* Arrays need special handling because methods like push, pop, splice
|
|
316
|
+
* mutate the array without triggering the set trap.
|
|
317
|
+
*
|
|
318
|
+
* @param target - Array to wrap
|
|
319
|
+
* @param config - Configuration including parent property name
|
|
320
|
+
* @returns Reactive proxy for array
|
|
321
|
+
*/
|
|
322
|
+
private static createArrayProxy<T>(
|
|
323
|
+
target: T[],
|
|
324
|
+
config: NestedProxyConfig
|
|
325
|
+
): T[] {
|
|
326
|
+
const { eventPrefix, scope, listeners, current, parentProp } = config;
|
|
327
|
+
|
|
328
|
+
// Array mutation methods that need to trigger updates
|
|
329
|
+
const mutationMethods = new Set(['push', 'pop', 'shift', 'unshift', 'splice', 'sort', 'reverse', 'fill', 'copyWithin']);
|
|
330
|
+
|
|
331
|
+
return new Proxy(target, {
|
|
332
|
+
get(proxyTarget, prop, receiver) {
|
|
333
|
+
const value = Reflect.get(proxyTarget, prop, receiver);
|
|
334
|
+
|
|
335
|
+
// Track access for dependency collection
|
|
336
|
+
if (current.name) {
|
|
337
|
+
if (!listeners[parentProp]) {
|
|
338
|
+
listeners[parentProp] = new Set<string>();
|
|
339
|
+
}
|
|
340
|
+
listeners[parentProp].add(current.name);
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
// Intercept mutation methods
|
|
344
|
+
if (typeof prop === 'string' && mutationMethods.has(prop) && typeof value === 'function') {
|
|
345
|
+
return function (this: T[], ...args: any[]) {
|
|
346
|
+
const oldArray = [...proxyTarget]; // Snapshot for comparison
|
|
347
|
+
const result = value.apply(proxyTarget, args);
|
|
348
|
+
|
|
349
|
+
// Emit change event after mutation
|
|
350
|
+
const parentListeners = listeners[parentProp] || new Set<string>();
|
|
351
|
+
emitToListeners(parentListeners, eventPrefix, parentProp, {
|
|
352
|
+
value: proxyTarget,
|
|
353
|
+
oldValue: oldArray,
|
|
354
|
+
mutation: prop,
|
|
245
355
|
ctx: current
|
|
246
356
|
});
|
|
247
|
-
});
|
|
248
357
|
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
:
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
358
|
+
// Emit scope event if scope is provided
|
|
359
|
+
emitScopeEvent(scope, eventPrefix, parentProp, {
|
|
360
|
+
prop: parentProp,
|
|
361
|
+
value: proxyTarget,
|
|
362
|
+
oldValue: oldArray,
|
|
363
|
+
mutation: prop
|
|
364
|
+
});
|
|
365
|
+
|
|
366
|
+
return result;
|
|
367
|
+
};
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
// Proxy nested objects/arrays within the array
|
|
371
|
+
if (typeof value === 'object' && value !== null) {
|
|
372
|
+
const indexKey = `${parentProp}[${String(prop)}]`;
|
|
373
|
+
if (Array.isArray(value)) {
|
|
374
|
+
return RuntimeContextHelpers.createArrayProxy(value, {
|
|
375
|
+
...config,
|
|
376
|
+
parentProp: indexKey
|
|
260
377
|
});
|
|
261
378
|
}
|
|
379
|
+
return RuntimeContextHelpers.createNestedProxy(value, {
|
|
380
|
+
...config,
|
|
381
|
+
parentProp: indexKey
|
|
382
|
+
});
|
|
262
383
|
}
|
|
263
384
|
|
|
264
|
-
return
|
|
385
|
+
return value;
|
|
265
386
|
},
|
|
266
387
|
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
388
|
+
set(proxyTarget, prop, value, receiver) {
|
|
389
|
+
const oldValue = proxyTarget[prop as any];
|
|
390
|
+
const result = Reflect.set(proxyTarget, prop, value, receiver);
|
|
391
|
+
|
|
392
|
+
if (!safeDeepEqual(oldValue, value)) {
|
|
393
|
+
// Emit to parent property listeners
|
|
394
|
+
const parentListeners = listeners[parentProp] || new Set<string>();
|
|
395
|
+
emitToListeners(parentListeners, eventPrefix, parentProp, {
|
|
396
|
+
value: proxyTarget,
|
|
397
|
+
index: prop,
|
|
398
|
+
ctx: current
|
|
399
|
+
});
|
|
400
|
+
|
|
401
|
+
// Emit scope event if scope is provided
|
|
402
|
+
emitScopeEvent(scope, eventPrefix, parentProp, {
|
|
403
|
+
prop: parentProp,
|
|
404
|
+
value: proxyTarget,
|
|
405
|
+
index: prop,
|
|
406
|
+
oldValue
|
|
407
|
+
});
|
|
271
408
|
}
|
|
272
409
|
|
|
410
|
+
return result;
|
|
411
|
+
},
|
|
412
|
+
|
|
413
|
+
deleteProperty(proxyTarget, prop) {
|
|
273
414
|
const result = Reflect.deleteProperty(proxyTarget, prop);
|
|
274
415
|
|
|
275
416
|
if (result) {
|
|
276
|
-
// Emit to parent property listeners
|
|
277
417
|
const parentListeners = listeners[parentProp] || new Set<string>();
|
|
278
|
-
parentListeners
|
|
279
|
-
const eventName = eventPrefix
|
|
280
|
-
? `${eventPrefix}:component-property-changed:${componentName}`
|
|
281
|
-
: `component-property-changed:${componentName}`;
|
|
282
|
-
|
|
283
|
-
eventDispatcher.emit(eventName, {
|
|
284
|
-
prop: parentProp,
|
|
285
|
-
ctx: current
|
|
286
|
-
});
|
|
287
|
-
});
|
|
418
|
+
emitToListeners(parentListeners, eventPrefix, parentProp, { ctx: current });
|
|
288
419
|
}
|
|
289
420
|
|
|
290
421
|
return result;
|
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
import { Subject, Observable, Subscription } from 'rxjs';
|
|
2
2
|
import { share } from 'rxjs/operators';
|
|
3
3
|
|
|
4
|
+
/**
|
|
5
|
+
* Pending event for batched emission
|
|
6
|
+
*/
|
|
7
|
+
interface PendingEvent {
|
|
8
|
+
event: string;
|
|
9
|
+
data: any;
|
|
10
|
+
}
|
|
11
|
+
|
|
4
12
|
class EventDispatcher {
|
|
5
13
|
private static instance: EventDispatcher;
|
|
6
14
|
private subjects: { [key: string]: Subject<any> } = {};
|
|
@@ -9,6 +17,21 @@ class EventDispatcher {
|
|
|
9
17
|
private globalEventSubject = new Subject<{ eventName: string; data: any }>();
|
|
10
18
|
public readonly allEvents$: Observable<{ eventName: string; data: any }>;
|
|
11
19
|
|
|
20
|
+
// Batching state
|
|
21
|
+
private readonly pendingEvents: Map<string, PendingEvent> = new Map();
|
|
22
|
+
private batchScheduled: boolean = false;
|
|
23
|
+
private batchingEnabled: boolean = true;
|
|
24
|
+
|
|
25
|
+
// Events that should always be batched (high-frequency property changes)
|
|
26
|
+
private readonly batchableEventPatterns: RegExp[] = [
|
|
27
|
+
/^component-property-changed:/,
|
|
28
|
+
/^microapp:.*:component-property-changed:/,
|
|
29
|
+
/^Vars:/,
|
|
30
|
+
/^microapp:.*:Vars:/,
|
|
31
|
+
/^component:value:set:/,
|
|
32
|
+
/^microapp:.*:component-instance-changed:/
|
|
33
|
+
];
|
|
34
|
+
|
|
12
35
|
private constructor() {
|
|
13
36
|
this.allEvents$ = this.globalEventSubject.asObservable().pipe(share());
|
|
14
37
|
}
|
|
@@ -49,10 +72,111 @@ class EventDispatcher {
|
|
|
49
72
|
}
|
|
50
73
|
}
|
|
51
74
|
|
|
52
|
-
|
|
75
|
+
/**
|
|
76
|
+
* Check if an event should be batched based on patterns
|
|
77
|
+
*/
|
|
78
|
+
private shouldBatch(event: string): boolean {
|
|
79
|
+
if (!this.batchingEnabled) return false;
|
|
80
|
+
return this.batchableEventPatterns.some(pattern => pattern.test(event));
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Flush all pending batched events
|
|
85
|
+
*/
|
|
86
|
+
private flushBatch(): void {
|
|
87
|
+
// Process all pending events
|
|
88
|
+
const events = Array.from(this.pendingEvents.values());
|
|
89
|
+
this.pendingEvents.clear();
|
|
90
|
+
|
|
91
|
+
// Emit all batched events
|
|
92
|
+
for (const { event, data } of events) {
|
|
93
|
+
this.emitImmediate(event, data);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
// Reset flag after emissions complete.
|
|
97
|
+
// If handlers added new events during emission, they would have been
|
|
98
|
+
// added to pendingEvents but no microtask scheduled (batchScheduled was true).
|
|
99
|
+
// Check and schedule if needed.
|
|
100
|
+
this.batchScheduled = false;
|
|
101
|
+
if (this.pendingEvents.size > 0) {
|
|
102
|
+
this.batchScheduled = true;
|
|
103
|
+
queueMicrotask(() => this.flushBatch());
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* Emit an event immediately without batching
|
|
109
|
+
*/
|
|
110
|
+
private emitImmediate(event: string, data?: any): void {
|
|
53
111
|
this.getSubject(event).next(data);
|
|
54
112
|
this.globalEventSubject.next({ eventName: event, data });
|
|
55
113
|
}
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* Emit an event, with automatic batching for high-frequency events.
|
|
117
|
+
*
|
|
118
|
+
* For events matching batchable patterns (property changes, variable updates),
|
|
119
|
+
* multiple rapid emissions are coalesced into a single microtask.
|
|
120
|
+
*
|
|
121
|
+
* This prevents UI jank when many properties are updated in quick succession.
|
|
122
|
+
*
|
|
123
|
+
* @param event - Event name
|
|
124
|
+
* @param data - Event data
|
|
125
|
+
*/
|
|
126
|
+
public emit(event: string, data?: any): void {
|
|
127
|
+
// Check if this event should be batched
|
|
128
|
+
if (this.shouldBatch(event)) {
|
|
129
|
+
// Store/overwrite pending event (last value wins for same event)
|
|
130
|
+
this.pendingEvents.set(event, { event, data });
|
|
131
|
+
|
|
132
|
+
// Schedule batch flush if not already scheduled
|
|
133
|
+
if (!this.batchScheduled) {
|
|
134
|
+
this.batchScheduled = true;
|
|
135
|
+
queueMicrotask(() => this.flushBatch());
|
|
136
|
+
}
|
|
137
|
+
} else {
|
|
138
|
+
// Emit immediately for non-batchable events
|
|
139
|
+
this.emitImmediate(event, data);
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* Force immediate emission, bypassing batching.
|
|
145
|
+
* Use this when you need synchronous event delivery.
|
|
146
|
+
*
|
|
147
|
+
* @param event - Event name
|
|
148
|
+
* @param data - Event data
|
|
149
|
+
*/
|
|
150
|
+
public emitSync(event: string, data?: any): void {
|
|
151
|
+
this.emitImmediate(event, data);
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* Enable or disable batching globally.
|
|
156
|
+
* Useful for debugging or when synchronous updates are required.
|
|
157
|
+
*
|
|
158
|
+
* @param enabled - Whether batching should be enabled
|
|
159
|
+
*/
|
|
160
|
+
public setBatchingEnabled(enabled: boolean): void {
|
|
161
|
+
this.batchingEnabled = enabled;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* Check if batching is currently enabled
|
|
166
|
+
*/
|
|
167
|
+
public isBatchingEnabled(): boolean {
|
|
168
|
+
return this.batchingEnabled;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
* Manually flush any pending batched events.
|
|
173
|
+
* Useful when you need to force updates before an operation.
|
|
174
|
+
*/
|
|
175
|
+
public flushPendingEvents(): void {
|
|
176
|
+
if (this.pendingEvents.size > 0) {
|
|
177
|
+
this.flushBatch();
|
|
178
|
+
}
|
|
179
|
+
}
|
|
56
180
|
}
|
|
57
181
|
|
|
58
182
|
export const eventDispatcher = EventDispatcher.getInstance();
|
package/utils/clipboard-utils.ts
CHANGED
|
@@ -71,13 +71,21 @@ export function generateNuralyClipboardStructure(component, childrenComponents)
|
|
|
71
71
|
function transformSchemaWithNewUUIDs(schema) {
|
|
72
72
|
const uuidMap = new Map();
|
|
73
73
|
|
|
74
|
-
|
|
74
|
+
|
|
75
|
+
// Function to generate a cryptographically secure UUID v4
|
|
75
76
|
function generateUUID() {
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
77
|
+
// Use native crypto.randomUUID if available (modern browsers)
|
|
78
|
+
if (crypto.randomUUID) {
|
|
79
|
+
return crypto.randomUUID();
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
// Fallback using crypto.getRandomValues (wider browser support)
|
|
83
|
+
const bytes = crypto.getRandomValues(new Uint8Array(16));
|
|
84
|
+
bytes[6] = (bytes[6] & 0x0f) | 0x40; // Version 4
|
|
85
|
+
bytes[8] = (bytes[8] & 0x3f) | 0x80; // Variant 10
|
|
86
|
+
|
|
87
|
+
const hex = Array.from(bytes, byte => byte.toString(16).padStart(2, '0')).join('');
|
|
88
|
+
return `${hex.slice(0, 8)}-${hex.slice(8, 12)}-${hex.slice(12, 16)}-${hex.slice(16, 20)}-${hex.slice(20)}`;
|
|
81
89
|
}
|
|
82
90
|
|
|
83
91
|
// Generate a new UUID for each component and store the old -> new UUID mapping
|
|
@@ -91,8 +99,10 @@ function transformSchemaWithNewUUIDs(schema) {
|
|
|
91
99
|
schema.components.forEach(component => {
|
|
92
100
|
component.childrenIds = component.childrenIds.map(oldUUID => uuidMap.get(oldUUID) || oldUUID);
|
|
93
101
|
|
|
94
|
-
//
|
|
95
|
-
|
|
102
|
+
// Generate a cryptographically secure random suffix
|
|
103
|
+
const randomBytes = crypto.getRandomValues(new Uint8Array(2));
|
|
104
|
+
const suffix = Array.from(randomBytes, byte => byte.toString(36)).join('').substring(0, 4);
|
|
105
|
+
component.name += `_${suffix}`;
|
|
96
106
|
});
|
|
97
107
|
|
|
98
108
|
return schema;
|