@nuraly/runtime 0.1.6 → 0.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +83 -765
- package/components/ui/components/Event/EventValue/EventValue.ts +13 -8
- package/components/ui/components/ToastContainer/ToastContainer.ts +1 -1
- package/components/ui/components/advanced/AIChat/AIChat.ts +1 -2
- package/components/ui/components/advanced/Collapse/Collapse.ts +5 -2
- package/components/ui/components/advanced/Collections/Collections.ts +2 -2
- package/components/ui/components/advanced/MicroApp/MicroApp.ts +3 -11
- package/components/ui/components/advanced/RefComponent/RefComponent.ts +2 -2
- package/components/ui/components/advanced/RichText/RichText.ts +5 -4
- package/components/ui/components/advanced/RichText/RichTextEditor.ts +0 -167
- package/components/ui/components/base/BaseElement/base-change-detection.ts +1 -5
- package/components/ui/components/base/BaseElement.ts +229 -610
- package/components/ui/components/base/FormRegisterable.ts +83 -0
- package/components/ui/components/base/controllers/DragDropController.ts +175 -0
- package/components/ui/components/base/controllers/ErrorController.ts +180 -0
- package/components/ui/components/base/controllers/EventController.ts +112 -0
- package/components/ui/components/base/controllers/InputHandlerController.ts +298 -0
- package/components/ui/components/base/controllers/SelectionController.ts +323 -0
- package/components/ui/components/base/controllers/StyleHandlerController.ts +286 -0
- package/components/ui/components/base/controllers/index.ts +11 -0
- package/components/ui/components/base/mixins/EditorModeMixin.ts +185 -0
- package/components/ui/components/base/mixins/index.ts +6 -0
- package/components/ui/components/base/types/base-element.types.ts +138 -0
- package/components/ui/components/base/types/index.ts +21 -0
- package/components/ui/components/base/utils/event-debouncer.ts +209 -0
- package/components/ui/components/base/utils/index.ts +11 -0
- package/components/ui/components/base/utils/style-cache.ts +94 -0
- package/components/ui/components/display/BoxModel/BoxModel.ts +177 -116
- package/components/ui/components/display/Code/Code.ts +40 -26
- package/components/ui/components/display/Divider/Divider.ts +2 -2
- package/components/ui/components/display/Icon/Icon.ts +2 -3
- package/components/ui/components/display/Image/Image.ts +72 -46
- package/components/ui/components/display/Tag/Tag.ts +2 -3
- package/components/ui/components/display/Video/Video.ts +91 -31
- package/components/ui/components/inputs/Button/Button.ts +2 -2
- package/components/ui/components/inputs/Checkbox/Checkbox.ts +14 -40
- package/components/ui/components/inputs/ColorPicker/colorpicker.ts +3 -4
- package/components/ui/components/inputs/DatePicker/DatePicker.ts +47 -25
- package/components/ui/components/inputs/Dropdown/Dropdown.ts +2 -2
- package/components/ui/components/inputs/Form/Form.style.ts +26 -0
- package/components/ui/components/inputs/Form/Form.ts +352 -0
- package/components/ui/components/inputs/IconPicker/IconPicker.ts +22 -18
- package/components/ui/components/inputs/InsertDropdown/InsertDropdown.ts +0 -20
- package/components/ui/components/inputs/NumberInput/NumberInput.ts +0 -4
- package/components/ui/components/inputs/RadioButton/Radio-button.ts +11 -13
- package/components/ui/components/inputs/Select/Select.ts +38 -24
- package/components/ui/components/inputs/TextInput/TextInput.ts +15 -9
- package/components/ui/components/inputs/Textarea/Textarea.ts +30 -30
- package/components/ui/components/inputs/UsersDropdown/UsersDropdown.ts +1 -1
- package/components/ui/components/layout/Card/Card.ts +112 -10
- package/components/ui/components/layout/Containers/Container.style.ts +18 -0
- package/components/ui/components/layout/Containers/Container.ts +11 -5
- package/components/ui/components/layout/Grid/Col.style.ts +27 -0
- package/components/ui/components/layout/Grid/Col.ts +209 -0
- package/components/ui/components/layout/Grid/Row.style.ts +73 -0
- package/components/ui/components/layout/Grid/Row.ts +166 -0
- package/components/ui/components/layout/Grid/index.ts +7 -0
- package/components/ui/components/layout/Panel/Panel.ts +2 -2
- package/components/ui/components/layout/Tabs/Tabs.ts +0 -1
- package/components/ui/components/navigation/EmbedURL/EmbedURL.ts +62 -26
- package/components/ui/components/navigation/Link/Link.ts +27 -16
- package/components/ui/components/navigation/Menu/Menu.ts +26 -48
- package/components/ui/components/runtime/MicroApp/MicroApp.ts +2 -4
- package/components/ui/components/runtime/MicroApp/MicroAppDataLoader.ts +6 -2
- package/components/ui/components/studio/FunctionsPanel/FunctionsPanel.ts +472 -0
- package/components/ui/components/studio/FunctionsPanel/index.ts +1 -0
- package/components/ui/components/utility/AccessRoles/AccessRoles.style.ts +242 -0
- package/components/ui/components/utility/AccessRoles/AccessRoles.ts +476 -0
- package/components/ui/components/utility/Border/Border.ts +0 -14
- package/components/ui/components/utility/BorderManager/BorderManager.style.ts +237 -0
- package/components/ui/components/utility/BorderManager/BorderManager.ts +503 -0
- package/components/ui/components/utility/BoxShadow/BoxShadow.ts +0 -16
- package/components/ui/components/utility/Document/Document.ts +54 -25
- package/components/ui/components/utility/Export-Import/Export-Import.ts +8 -7
- package/components/ui/components/utility/Handlers/Handlers.ts +14 -17
- package/components/ui/components/utility/ValidationRules/ValidationRules.ts +440 -0
- package/components/ui/components/wrappers/GenerikWrapper/DragWrapper/DragWrapper.ts +1 -0
- package/components/ui/components/wrappers/GenerikWrapper/GenerikWrapper.ts +1 -24
- package/components/ui/nuraly-ui/src/components/badge/badge.style.ts +4 -3
- package/components/ui/nuraly-ui/src/components/datepicker/datepicker.component.ts +2 -0
- package/components/ui/nuraly-ui/src/components/radio-group/radio-group.component.ts +12 -6
- package/components/ui/nuraly-ui/src/components/radio-group/radio-group.style.ts +23 -0
- package/dist/{index-B4yIOSMd.js → BaseElement-BNBn_IJk.js} +2920 -267
- package/dist/{CodeEditor-0GwD2UDB.js → CodeEditor-Bf4L2rO_.js} +84127 -76319
- package/dist/{CodeEditor-BiNku87K.js → CodeEditor-Cpph-xRc.js} +7 -7
- package/dist/{abap-B2diVmjb.js → abap-D0Neqhq6.js} +91 -1
- package/dist/{apex-3NuJ-nsI.js → apex-B5LhxkeG.js} +18 -1
- package/dist/assets/editor.worker-DcwbJ0PV.js +12 -0
- package/dist/assets/html.worker-BTMxskjR.js +461 -0
- package/dist/assets/json.worker-D3vTGdf_.js +49 -0
- package/dist/assets/ts.worker-BsM1BXac.js +51334 -0
- package/dist/{azcli-XGXuUsMB.js → azcli-BrBH0QTU.js} +1 -1
- package/dist/{bat-B8Vhm634.js → bat-BfzAov64.js} +12 -1
- package/dist/{bicep-Cc8X5S_k.js → bicep-C3bCSWel.js} +1 -1
- package/dist/{cameligo-Bo3wBh9T.js → cameligo-sFL5plcd.js} +13 -1
- package/dist/{clojure-CPoQlpIK.js → clojure-CfeExRz0.js} +14 -1
- package/dist/{coffee-BxvTGz39.js → coffee-Xws5K0WL.js} +11 -1
- package/dist/{cpp-5RpEV7vC.js → cpp-CqOUEpxN.js} +28 -23
- package/dist/{csharp-slXXP3fo.js → csharp-DVLiBOZb.js} +13 -1
- package/dist/{csp-B98p6-gH.js → csp-DVFp9bw5.js} +3 -1
- package/dist/{css-BDsDSAin.js → css-DwARn2R6.js} +8 -1
- package/dist/cssMode-DMsdy1N0.js +1577 -0
- package/dist/{cypher-Dc4IMouD.js → cypher-uY0Mffat.js} +8 -1
- package/dist/{dart-LhvE3yD2.js → dart-D27H-mX_.js} +18 -1
- package/dist/{dockerfile-CwzplJeZ.js → dockerfile-CmV85WZK.js} +5 -1
- package/dist/{ecl-DxW3FiJi.js → ecl--fKn7yzB.js} +9 -1
- package/dist/{elixir-BI40g7TU.js → elixir-DUhH17ON.js} +87 -1
- package/dist/{flow9-tR2v0bGz.js → flow9-B3Dx2LLe.js} +8 -1
- package/dist/{freemarker2-XzXhMwTc.js → freemarker2-D51H9HYi.js} +359 -7
- package/dist/{fsharp-BLAma0OT.js → fsharp-SyqBfUAR.js} +14 -1
- package/dist/{go-nYcD3y4Z.js → go-BbMR2tdT.js} +17 -1
- package/dist/{graphql-Dp1cHWmP.js → graphql-DDJE6tIl.js} +17 -1
- package/dist/{handlebars-CmrcNfkM.js → handlebars-CF6gdAX4.js} +38 -4
- package/dist/{hcl-6NT8Kbna.js → hcl-YBvpaUqf.js} +13 -1
- package/dist/{html-BsvlsNx5.js → html-c2n_zkM3.js} +37 -4
- package/dist/htmlMode-9IJTuZUh.js +1587 -0
- package/dist/{ini-BZCOLrEc.js → ini-Ct73dBtM.js} +10 -1
- package/dist/{java-DAMcfJbX.js → java-C_jlkwoG.js} +18 -1
- package/dist/{javascript-D-M-tA-x.js → javascript-DhEEBMxD.js} +3 -2
- package/dist/jsonMode-CB6k-4rp.js +2002 -0
- package/dist/{julia-CQ46G71H.js → julia-D8WE5U1e.js} +22 -1
- package/dist/{kotlin-CEjVo_6E.js → kotlin-Zy9aq5yB.js} +15 -1
- package/dist/{less-DreV99nP.js → less-sZ0iHtE8.js} +1 -1
- package/dist/{lexon-DBVJhqLb.js → lexon-CsdNL29A.js} +13 -1
- package/dist/{liquid-_8i5JYO-.js → liquid-CwtPiwnW.js} +12 -4
- package/dist/{lua-Dcc_j6L-.js → lua-C2YJo0zw.js} +12 -1
- package/dist/{m3-B9SlZL4n.js → m3-CPLP40SG.js} +7 -1
- package/dist/{markdown-CuGw9_MP.js → markdown-B1mf5e0R.js} +34 -1
- package/dist/{mdx-CiSJOftS.js → mdx-LewPRYF8.js} +2 -2
- package/dist/{micro-app-entry-BT6Pk6bn.js → micro-app-entry-C3RDIukG.js} +7621 -9067
- package/dist/micro-app.bundle.js +3 -3
- package/dist/micro-app.js +3575 -6621
- 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-DNxbUiJS.js → python-h5Z2g-yl.js} +59 -11
- package/dist/{qsharp-4rGyVZOw.js → qsharp-D4i0Nqg9.js} +28 -3
- package/dist/{r-DsgLhBOb.js → r-cdRigKxa.js} +5 -1
- package/dist/{razor-BFH0wq9s.js → razor-D5ep1Doy.js} +48 -4
- package/dist/{redis-B2fdL4Bg.js → redis-D9MFxvE8.js} +16 -6
- package/dist/{redshift-DoaeyCkH.js → redshift-CmCnsvL-.js} +13 -4
- package/dist/{restructuredtext-D-6OFBY9.js → restructuredtext-CWy8J51t.js} +19 -1
- package/dist/{ruby-D1DD6baV.js → ruby-WP-c36m5.js} +76 -3
- package/dist/runtime.js +34 -45
- package/dist/{rust-DssUV39M.js → rust-Q9FLdYpu.js} +13 -1
- package/dist/{sb-Dmb6tAdv.js → sb-C54-JBGT.js} +12 -1
- package/dist/{scala-Co3ETaym.js → scala-CzbFImc5.js} +24 -1
- package/dist/{scheme-CMrqXTty.js → scheme-BhfDmYN3.js} +1 -1
- package/dist/{scss-DkGudv8Q.js → scss-CEmiBXpS.js} +25 -1
- package/dist/{shell-BHN2BI4L.js → shell-Bmc1VhG0.js} +4 -1
- package/dist/{solidity-b-R-raGB.js → solidity-C9Q2I8Hh.js} +23 -1
- package/dist/{sophia-Y4GjyxNB.js → sophia-jWa1UyKz.js} +16 -1
- package/dist/{sparql-CDAPZb88.js → sparql-CM7jctbc.js} +15 -1
- package/dist/{sql-DkkpPiUq.js → sql-WzihTkbg.js} +42 -1
- package/dist/{st-CSPV91Ej.js → st-6y7_3aup.js} +8 -1
- package/dist/style.css +1 -1
- package/dist/{swift-DdSC5O48.js → swift-k-0zxG_D.js} +4 -1
- package/dist/{systemverilog-CI03XpAv.js → systemverilog-Pnr5_rIP.js} +29 -3
- package/dist/{tcl-B8DayMSI.js → tcl-fNPXval8.js} +7 -1
- package/dist/tsMode-B_6LiBE1.js +976 -0
- package/dist/{twig-B1AUPVB_.js → twig-L2MkztkV.js} +76 -1
- package/dist/{typescript-DFCDgKOy.js → typescript-BBG0jH4p.js} +23 -2
- package/dist/typespec-Cqqo-3Pt.js +123 -0
- package/dist/{vb-BIC7ccdG.js → vb-B5YC2xN9.js} +15 -1
- package/dist/{wgsl-C9yjop46.js → wgsl-D9BRtftY.js} +26 -1
- package/dist/{xml-axhHDYch.js → xml-DgLB7rE6.js} +8 -2
- package/dist/{yaml-fWSpoHsZ.js → yaml-DiI4HpSv.js} +30 -2
- package/handlers/compiler.ts +196 -16
- package/handlers/context-setup.ts +10 -5
- package/handlers/handler-api-factory.ts +358 -0
- package/handlers/handler-api.ts +379 -0
- package/handlers/handler-executor.ts +25 -5
- package/handlers/handler-scope.ts +398 -0
- package/handlers/index.ts +34 -2
- package/handlers/runtime-api/component-properties.ts +0 -8
- package/handlers/runtime-api/index.ts +1 -1
- package/handlers/runtime-api/toast.ts +1 -1
- package/index.ts +14 -115
- package/micro-app/README.md +10 -10
- package/micro-app/state/MicroAppRuntimeContext.ts +1 -28
- package/micro-app-entry.ts +0 -5
- package/package.json +19 -1
- package/redux/actions/application/index.ts +0 -1
- package/redux/actions/component/addComponentAction.ts +15 -4
- package/redux/actions/component/moveDraggedComponent.ts +1 -2
- package/redux/actions/component/update-component-name.ts +1 -1
- package/redux/actions/component/updateComponentAttributes.ts +7 -2
- package/redux/handlers/functions/build-function-handler.ts +11 -3
- package/redux/handlers/functions/deploy-function-handler.ts +11 -3
- package/redux/handlers/functions/invoke-function-handler.ts +11 -3
- package/redux/handlers/functions/load-functions-handler.ts +2 -1
- package/redux/handlers/functions/update-function-handler.ts +2 -1
- package/redux/store/component/component.interface.ts +8 -2
- package/redux/store/component/store.ts +1 -4
- package/state/runtime-context.ts +1 -23
- package/utils/RuntimeContextHelpers.ts +221 -90
- package/utils/change-detection.ts +125 -1
- package/utils/clipboard-utils.ts +18 -8
- package/utils/component-registry.ts +118 -0
- package/utils/index.ts +14 -1
- package/utils/naming-generator.ts +3 -1
- package/utils/randomness.ts +3 -1
- package/utils/register-components.ts +21 -29
- package/utils/render-util.ts +27 -48
- package/utils/toast.ts +97 -0
- package/vite.config.ts +29 -12
- package/components/ui/components/Event/EventAttribute/EventAttribute.style.ts +0 -11
- package/components/ui/components/Event/EventAttribute/EventAttribute.ts +0 -28
- package/components/ui/components/base/BaseElement/calculateStyles.ts +0 -31
- package/components/ui/components/base/BaseElement/drag-events.helpers.ts +0 -71
- package/components/ui/components/base/BaseElement/execute-event.helpers.ts +0 -45
- package/components/ui/components/base/BaseElement/interactions.helpers.ts +0 -14
- package/components/ui/components/wrappers/ComponentTitle/ComponentTitle.ts +0 -95
- package/components/ui/components/wrappers/GenerikWrapper/ResizeWrapper/ResizeWrapper.style.ts +0 -102
- package/components/ui/components/wrappers/GenerikWrapper/ResizeWrapper/ResizeWrapper.ts +0 -258
- package/components/ui/components/wrappers/PreviewWrapper.ts +0 -28
- package/components/ui/components/wrappers/RectangleSelection/RectangleSelection.ts +0 -154
- package/components/ui/nuraly-ui/packages/common/dist/constants/index.d.ts +0 -2
- package/components/ui/nuraly-ui/packages/common/dist/constants/index.js +0 -2
- package/components/ui/nuraly-ui/packages/common/dist/constants.d.ts +0 -17
- package/components/ui/nuraly-ui/packages/common/dist/constants.js +0 -7
- package/components/ui/nuraly-ui/packages/common/dist/controllers/index.d.ts +0 -2
- package/components/ui/nuraly-ui/packages/common/dist/controllers/index.js +0 -2
- package/components/ui/nuraly-ui/packages/common/dist/controllers.d.ts +0 -21
- package/components/ui/nuraly-ui/packages/common/dist/controllers.js +0 -22
- package/components/ui/nuraly-ui/packages/common/dist/index.d.ts +0 -25
- package/components/ui/nuraly-ui/packages/common/dist/index.js +0 -27
- package/components/ui/nuraly-ui/packages/common/dist/mixins/index.d.ts +0 -2
- package/components/ui/nuraly-ui/packages/common/dist/mixins/index.js +0 -3
- package/components/ui/nuraly-ui/packages/common/dist/mixins.d.ts +0 -26
- package/components/ui/nuraly-ui/packages/common/dist/mixins.js +0 -29
- package/components/ui/nuraly-ui/packages/common/dist/shared/base-mixin.d.ts +0 -42
- package/components/ui/nuraly-ui/packages/common/dist/shared/base-mixin.js +0 -38
- package/components/ui/nuraly-ui/packages/common/dist/shared/constants.d.ts +0 -1
- package/components/ui/nuraly-ui/packages/common/dist/shared/constants.js +0 -2
- package/components/ui/nuraly-ui/packages/common/dist/shared/controllers/dropdown.controller.d.ts +0 -77
- package/components/ui/nuraly-ui/packages/common/dist/shared/controllers/dropdown.controller.js +0 -341
- package/components/ui/nuraly-ui/packages/common/dist/shared/controllers/dropdown.interface.d.ts +0 -37
- package/components/ui/nuraly-ui/packages/common/dist/shared/controllers/dropdown.interface.js +0 -2
- package/components/ui/nuraly-ui/packages/common/dist/shared/controllers/index.d.ts +0 -4
- package/components/ui/nuraly-ui/packages/common/dist/shared/controllers/index.js +0 -4
- package/components/ui/nuraly-ui/packages/common/dist/shared/controllers/theme.controller.d.ts +0 -48
- package/components/ui/nuraly-ui/packages/common/dist/shared/controllers/theme.controller.js +0 -133
- package/components/ui/nuraly-ui/packages/common/dist/shared/dependency-mixin.d.ts +0 -37
- package/components/ui/nuraly-ui/packages/common/dist/shared/dependency-mixin.js +0 -141
- package/components/ui/nuraly-ui/packages/common/dist/shared/event-handler-mixin.d.ts +0 -64
- package/components/ui/nuraly-ui/packages/common/dist/shared/event-handler-mixin.js +0 -95
- package/components/ui/nuraly-ui/packages/common/dist/shared/index.d.ts +0 -13
- package/components/ui/nuraly-ui/packages/common/dist/shared/index.js +0 -17
- package/components/ui/nuraly-ui/packages/common/dist/shared/theme-mixin.d.ts +0 -78
- package/components/ui/nuraly-ui/packages/common/dist/shared/theme-mixin.js +0 -194
- package/components/ui/nuraly-ui/packages/common/dist/shared/themes.d.ts +0 -44
- package/components/ui/nuraly-ui/packages/common/dist/shared/themes.js +0 -85
- package/components/ui/nuraly-ui/packages/common/dist/shared/utils.d.ts +0 -60
- package/components/ui/nuraly-ui/packages/common/dist/shared/utils.js +0 -85
- package/components/ui/nuraly-ui/packages/common/dist/shared/validation.types.d.ts +0 -108
- package/components/ui/nuraly-ui/packages/common/dist/shared/validation.types.js +0 -17
- package/components/ui/nuraly-ui/packages/common/dist/themes/index.d.ts +0 -2
- package/components/ui/nuraly-ui/packages/common/dist/themes/index.js +0 -2
- package/components/ui/nuraly-ui/packages/common/dist/themes.d.ts +0 -22
- package/components/ui/nuraly-ui/packages/common/dist/themes.js +0 -23
- package/components/ui/nuraly-ui/packages/common/dist/utils/index.d.ts +0 -2
- package/components/ui/nuraly-ui/packages/common/dist/utils/index.js +0 -2
- package/components/ui/nuraly-ui/packages/common/dist/utils.d.ts +0 -21
- package/components/ui/nuraly-ui/packages/common/dist/utils.js +0 -22
- package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/LICENSE +0 -15
- package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/README.md +0 -294
- package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/copy/copy-sync.js +0 -171
- package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/copy/copy.js +0 -175
- package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/copy/index.js +0 -7
- package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/empty/index.js +0 -39
- package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/ensure/file.js +0 -66
- package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/ensure/index.js +0 -23
- package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/ensure/link.js +0 -64
- package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/ensure/symlink-paths.js +0 -101
- package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/ensure/symlink-type.js +0 -34
- package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/ensure/symlink.js +0 -67
- package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/fs/index.js +0 -146
- package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/index.js +0 -16
- package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/json/index.js +0 -16
- package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/json/jsonfile.js +0 -11
- package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/json/output-json-sync.js +0 -12
- package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/json/output-json.js +0 -12
- package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/mkdirs/index.js +0 -14
- package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/mkdirs/make-dir.js +0 -27
- package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/mkdirs/utils.js +0 -21
- package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/move/index.js +0 -7
- package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/move/move-sync.js +0 -55
- package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/move/move.js +0 -59
- package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/output-file/index.js +0 -31
- package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/path-exists/index.js +0 -12
- package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/remove/index.js +0 -17
- package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/util/async.js +0 -29
- package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/util/stat.js +0 -159
- package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/util/utimes.js +0 -36
- package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/LICENSE +0 -15
- package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/README.md +0 -294
- package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/copy/copy-sync.js +0 -171
- package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/copy/copy.js +0 -175
- package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/copy/index.js +0 -7
- package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/empty/index.js +0 -39
- package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/ensure/file.js +0 -66
- package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/ensure/index.js +0 -23
- package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/ensure/link.js +0 -64
- package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/ensure/symlink-paths.js +0 -101
- package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/ensure/symlink-type.js +0 -34
- package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/ensure/symlink.js +0 -67
- package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/fs/index.js +0 -146
- package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/index.js +0 -16
- package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/json/index.js +0 -16
- package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/json/jsonfile.js +0 -11
- package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/json/output-json-sync.js +0 -12
- package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/json/output-json.js +0 -12
- package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/mkdirs/index.js +0 -14
- package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/mkdirs/make-dir.js +0 -27
- package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/mkdirs/utils.js +0 -21
- package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/move/index.js +0 -7
- package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/move/move-sync.js +0 -55
- package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/move/move.js +0 -59
- package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/output-file/index.js +0 -31
- package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/path-exists/index.js +0 -12
- package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/remove/index.js +0 -17
- package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/util/async.js +0 -29
- package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/util/stat.js +0 -159
- package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/util/utimes.js +0 -36
- package/dist/SmartAttributeHandler-B1UJKlqJ.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-BzqArQ52.js +0 -1443
- package/dist/htmlMode-CmNePjzn.js +0 -1453
- package/dist/jsonMode-CKj6yF-8.js +0 -1863
- package/dist/tsMode-DfXg_Y5Y.js +0 -800
- package/redux/actions/application/loadApplicationPermissionAction.ts +0 -10
- package/utils/styleUtil.ts +0 -7
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { m as r } from "./CodeEditor-
|
|
1
|
+
import { m as r } from "./CodeEditor-Bf4L2rO_.js";
|
|
2
2
|
/*!-----------------------------------------------------------------------------
|
|
3
3
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4
|
-
* Version: 0.
|
|
4
|
+
* Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1)
|
|
5
5
|
* Released under the MIT license
|
|
6
6
|
* https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
|
|
7
7
|
*-----------------------------------------------------------------------------*/
|
|
@@ -44,18 +44,24 @@ var g = {
|
|
|
44
44
|
defaultToken: "",
|
|
45
45
|
tokenPostfix: ".xml",
|
|
46
46
|
ignoreCase: !0,
|
|
47
|
+
// Useful regular expressions
|
|
47
48
|
qualifiedName: /(?:[\w\.\-]+:)?[\w\.\-]+/,
|
|
48
49
|
tokenizer: {
|
|
49
50
|
root: [
|
|
50
51
|
[/[^<&]+/, ""],
|
|
51
52
|
{ include: "@whitespace" },
|
|
53
|
+
// Standard opening tag
|
|
52
54
|
[/(<)(@qualifiedName)/, [{ token: "delimiter" }, { token: "tag", next: "@tag" }]],
|
|
55
|
+
// Standard closing tag
|
|
53
56
|
[
|
|
54
57
|
/(<\/)(@qualifiedName)(\s*)(>)/,
|
|
55
58
|
[{ token: "delimiter" }, { token: "tag" }, "", { token: "delimiter" }]
|
|
56
59
|
],
|
|
60
|
+
// Meta tags - instruction
|
|
57
61
|
[/(<\?)(@qualifiedName)/, [{ token: "delimiter" }, { token: "metatag", next: "@tag" }]],
|
|
62
|
+
// Meta tags - declaration
|
|
58
63
|
[/(<\!)(@qualifiedName)/, [{ token: "delimiter" }, { token: "metatag", next: "@tag" }]],
|
|
64
|
+
// CDATA
|
|
59
65
|
[/<\!\[CDATA\[/, { token: "delimiter.cdata", next: "@cdata" }],
|
|
60
66
|
[/&\w+;/, "string.escape"]
|
|
61
67
|
],
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { m as l } from "./CodeEditor-
|
|
1
|
+
import { m as l } from "./CodeEditor-Bf4L2rO_.js";
|
|
2
2
|
/*!-----------------------------------------------------------------------------
|
|
3
3
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4
|
-
* Version: 0.
|
|
4
|
+
* Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1)
|
|
5
5
|
* Released under the MIT license
|
|
6
6
|
* https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
|
|
7
7
|
*-----------------------------------------------------------------------------*/
|
|
@@ -65,14 +65,18 @@ var p = {
|
|
|
65
65
|
root: [
|
|
66
66
|
{ include: "@whitespace" },
|
|
67
67
|
{ include: "@comment" },
|
|
68
|
+
// Directive
|
|
68
69
|
[/%[^ ]+.*$/, "meta.directive"],
|
|
70
|
+
// Document Markers
|
|
69
71
|
[/---/, "operators.directivesEnd"],
|
|
70
72
|
[/\.{3}/, "operators.documentEnd"],
|
|
73
|
+
// Block Structure Indicators
|
|
71
74
|
[/[-?:](?= )/, "operators"],
|
|
72
75
|
{ include: "@anchor" },
|
|
73
76
|
{ include: "@tagHandle" },
|
|
74
77
|
{ include: "@flowCollections" },
|
|
75
78
|
{ include: "@blockStyle" },
|
|
79
|
+
// Numbers
|
|
76
80
|
[/@numberInteger(?![ \t]*\S+)/, "number"],
|
|
77
81
|
[/@numberFloat(?![ \t]*\S+)/, "number.float"],
|
|
78
82
|
[/@numberOctal(?![ \t]*\S+)/, "number.octal"],
|
|
@@ -80,8 +84,10 @@ var p = {
|
|
|
80
84
|
[/@numberInfinity(?![ \t]*\S+)/, "number.infinity"],
|
|
81
85
|
[/@numberNaN(?![ \t]*\S+)/, "number.nan"],
|
|
82
86
|
[/@numberDate(?![ \t]*\S+)/, "number.date"],
|
|
87
|
+
// Key:Value pair
|
|
83
88
|
[/(".*?"|'.*?'|[^#'"]*?)([ \t]*)(:)( |$)/, ["type", "white", "operators", "white"]],
|
|
84
89
|
{ include: "@flowScalars" },
|
|
90
|
+
// String nodes
|
|
85
91
|
[
|
|
86
92
|
/.+?(?=(\s+#|$))/,
|
|
87
93
|
{
|
|
@@ -92,18 +98,26 @@ var p = {
|
|
|
92
98
|
}
|
|
93
99
|
]
|
|
94
100
|
],
|
|
101
|
+
// Flow Collection: Flow Mapping
|
|
95
102
|
object: [
|
|
96
103
|
{ include: "@whitespace" },
|
|
97
104
|
{ include: "@comment" },
|
|
105
|
+
// Flow Mapping termination
|
|
98
106
|
[/\}/, "@brackets", "@pop"],
|
|
107
|
+
// Flow Mapping delimiter
|
|
99
108
|
[/,/, "delimiter.comma"],
|
|
109
|
+
// Flow Mapping Key:Value delimiter
|
|
100
110
|
[/:(?= )/, "operators"],
|
|
111
|
+
// Flow Mapping Key:Value key
|
|
101
112
|
[/(?:".*?"|'.*?'|[^,\{\[]+?)(?=: )/, "type"],
|
|
113
|
+
// Start Flow Style
|
|
102
114
|
{ include: "@flowCollections" },
|
|
103
115
|
{ include: "@flowScalars" },
|
|
116
|
+
// Scalar Data types
|
|
104
117
|
{ include: "@tagHandle" },
|
|
105
118
|
{ include: "@anchor" },
|
|
106
119
|
{ include: "@flowNumber" },
|
|
120
|
+
// Other value (keyword or string)
|
|
107
121
|
[
|
|
108
122
|
/[^\},]+/,
|
|
109
123
|
{
|
|
@@ -114,16 +128,22 @@ var p = {
|
|
|
114
128
|
}
|
|
115
129
|
]
|
|
116
130
|
],
|
|
131
|
+
// Flow Collection: Flow Sequence
|
|
117
132
|
array: [
|
|
118
133
|
{ include: "@whitespace" },
|
|
119
134
|
{ include: "@comment" },
|
|
135
|
+
// Flow Sequence termination
|
|
120
136
|
[/\]/, "@brackets", "@pop"],
|
|
137
|
+
// Flow Sequence delimiter
|
|
121
138
|
[/,/, "delimiter.comma"],
|
|
139
|
+
// Start Flow Style
|
|
122
140
|
{ include: "@flowCollections" },
|
|
123
141
|
{ include: "@flowScalars" },
|
|
142
|
+
// Scalar Data types
|
|
124
143
|
{ include: "@tagHandle" },
|
|
125
144
|
{ include: "@anchor" },
|
|
126
145
|
{ include: "@flowNumber" },
|
|
146
|
+
// Other value (keyword or string)
|
|
127
147
|
[
|
|
128
148
|
/[^\],]+/,
|
|
129
149
|
{
|
|
@@ -134,7 +154,10 @@ var p = {
|
|
|
134
154
|
}
|
|
135
155
|
]
|
|
136
156
|
],
|
|
157
|
+
// First line of a Block Style
|
|
137
158
|
multiString: [[/^( +).+$/, "string", "@multiStringContinued.$1"]],
|
|
159
|
+
// Further lines of a Block Style
|
|
160
|
+
// Workaround for indentation detection
|
|
138
161
|
multiStringContinued: [
|
|
139
162
|
[
|
|
140
163
|
/^( *).+$/,
|
|
@@ -147,11 +170,14 @@ var p = {
|
|
|
147
170
|
]
|
|
148
171
|
],
|
|
149
172
|
whitespace: [[/[ \t\r\n]+/, "white"]],
|
|
173
|
+
// Only line comments
|
|
150
174
|
comment: [[/#.*$/, "comment"]],
|
|
175
|
+
// Start Flow Collections
|
|
151
176
|
flowCollections: [
|
|
152
177
|
[/\[/, "@brackets", "@array"],
|
|
153
178
|
[/\{/, "@brackets", "@object"]
|
|
154
179
|
],
|
|
180
|
+
// Start Flow Scalars (quoted strings)
|
|
155
181
|
flowScalars: [
|
|
156
182
|
[/"([^"\\]|\\.)*$/, "string.invalid"],
|
|
157
183
|
[/'([^'\\]|\\.)*$/, "string.invalid"],
|
|
@@ -164,7 +190,9 @@ var p = {
|
|
|
164
190
|
[/\\./, "string.escape.invalid"],
|
|
165
191
|
[/"/, "string", "@pop"]
|
|
166
192
|
],
|
|
193
|
+
// Start Block Scalar
|
|
167
194
|
blockStyle: [[/[>|][0-9]*[+-]?$/, "operators", "@multiString"]],
|
|
195
|
+
// Numbers in Flow Collections (terminate with ,]})
|
|
168
196
|
flowNumber: [
|
|
169
197
|
[/@numberInteger(?=[ \t]*[,\]\}])/, "number"],
|
|
170
198
|
[/@numberFloat(?=[ \t]*[,\]\}])/, "number.float"],
|
package/handlers/compiler.ts
CHANGED
|
@@ -43,22 +43,131 @@
|
|
|
43
43
|
*/
|
|
44
44
|
|
|
45
45
|
import { validateHandlerCode } from '../utils/handler-validator';
|
|
46
|
+
import * as acorn from 'acorn';
|
|
47
|
+
|
|
48
|
+
// Re-export createHandlerScope for use in handler-executor
|
|
49
|
+
export { createHandlerScope } from './handler-scope';
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Node types that indicate control flow requiring explicit return.
|
|
53
|
+
*/
|
|
54
|
+
const CONTROL_FLOW_TYPES = new Set([
|
|
55
|
+
'IfStatement',
|
|
56
|
+
'ForStatement',
|
|
57
|
+
'ForInStatement',
|
|
58
|
+
'ForOfStatement',
|
|
59
|
+
'WhileStatement',
|
|
60
|
+
'DoWhileStatement',
|
|
61
|
+
'SwitchStatement',
|
|
62
|
+
'TryStatement',
|
|
63
|
+
'ThrowStatement',
|
|
64
|
+
]);
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Analyzes code AST to determine if implicit return should be added.
|
|
68
|
+
* Uses acorn for proper JavaScript parsing.
|
|
69
|
+
*
|
|
70
|
+
* @param code - Handler code string
|
|
71
|
+
* @returns Analysis result with flags for return and control flow
|
|
72
|
+
*/
|
|
73
|
+
function analyzeCode(code: string): { hasTopLevelReturn: boolean; hasControlFlow: boolean; isMultiStatement: boolean } {
|
|
74
|
+
const trimmed = code.trim();
|
|
75
|
+
|
|
76
|
+
if (!trimmed) {
|
|
77
|
+
return { hasTopLevelReturn: false, hasControlFlow: false, isMultiStatement: false };
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
try {
|
|
81
|
+
// Parse as a script (not module) to allow return statements
|
|
82
|
+
// Wrap in function body to make it valid syntax for parsing
|
|
83
|
+
const wrappedCode = `(function() { ${trimmed} })`;
|
|
84
|
+
const ast = acorn.parse(wrappedCode, {
|
|
85
|
+
ecmaVersion: 'latest',
|
|
86
|
+
sourceType: 'script',
|
|
87
|
+
}) as any;
|
|
88
|
+
|
|
89
|
+
// Get the function body statements
|
|
90
|
+
const funcExpr = ast.body[0].expression;
|
|
91
|
+
const bodyStatements = funcExpr.body.body;
|
|
92
|
+
|
|
93
|
+
let hasTopLevelReturn = false;
|
|
94
|
+
let hasControlFlow = false;
|
|
95
|
+
const isMultiStatement = bodyStatements.length > 1;
|
|
96
|
+
|
|
97
|
+
// Check each top-level statement in the function body
|
|
98
|
+
for (const stmt of bodyStatements) {
|
|
99
|
+
if (stmt.type === 'ReturnStatement') {
|
|
100
|
+
hasTopLevelReturn = true;
|
|
101
|
+
}
|
|
102
|
+
if (CONTROL_FLOW_TYPES.has(stmt.type)) {
|
|
103
|
+
hasControlFlow = true;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
return { hasTopLevelReturn, hasControlFlow, isMultiStatement };
|
|
108
|
+
} catch {
|
|
109
|
+
// If parsing fails, fall back to conservative behavior (no implicit return)
|
|
110
|
+
return { hasTopLevelReturn: true, hasControlFlow: false, isMultiStatement: false };
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* Checks if code needs an implicit return added.
|
|
116
|
+
* Uses AST analysis to properly detect top-level returns vs nested returns in callbacks.
|
|
117
|
+
*
|
|
118
|
+
* @param code - Handler code string
|
|
119
|
+
* @returns true if implicit return should be added
|
|
120
|
+
*/
|
|
121
|
+
function needsImplicitReturn(code: string): boolean {
|
|
122
|
+
const trimmed = code.trim();
|
|
123
|
+
|
|
124
|
+
// If empty, no return needed
|
|
125
|
+
if (!trimmed) return false;
|
|
126
|
+
|
|
127
|
+
const analysis = analyzeCode(trimmed);
|
|
128
|
+
|
|
129
|
+
// If has top-level return statement, don't add another
|
|
130
|
+
if (analysis.hasTopLevelReturn) return false;
|
|
131
|
+
|
|
132
|
+
// If has top-level control flow statements, require explicit return
|
|
133
|
+
if (analysis.hasControlFlow) return false;
|
|
134
|
+
|
|
135
|
+
// Multiple statements require explicit return
|
|
136
|
+
if (analysis.isMultiStatement) return false;
|
|
137
|
+
|
|
138
|
+
// Single expression - add implicit return
|
|
139
|
+
return true;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* Wraps code with implicit return if needed.
|
|
144
|
+
*
|
|
145
|
+
* @param code - Handler code string
|
|
146
|
+
* @returns Code with return statement if needed
|
|
147
|
+
*/
|
|
148
|
+
function wrapWithImplicitReturn(code: string): string {
|
|
149
|
+
if (needsImplicitReturn(code)) {
|
|
150
|
+
const trimmed = code.trim().replace(/;$/, ''); // Remove trailing semicolon
|
|
151
|
+
return `return (${trimmed});`;
|
|
152
|
+
}
|
|
153
|
+
return code;
|
|
154
|
+
}
|
|
46
155
|
|
|
47
156
|
/**
|
|
48
157
|
* Cache storage for compiled handler functions.
|
|
49
|
-
*
|
|
158
|
+
*
|
|
50
159
|
* @description
|
|
51
160
|
* Maps handler code strings to their compiled Function objects.
|
|
52
161
|
* Cache is maintained for the lifetime of the application session.
|
|
53
|
-
*
|
|
162
|
+
*
|
|
54
163
|
* @type {Record<string, Function>}
|
|
55
|
-
*
|
|
164
|
+
*
|
|
56
165
|
* @remarks
|
|
57
166
|
* - Key: Handler code string (exactly as written in component properties)
|
|
58
167
|
* - Value: Compiled JavaScript function with injected parameters
|
|
59
168
|
* - Thread-safe: Single-threaded JavaScript execution model
|
|
60
169
|
* - Memory impact: ~1-2KB per unique handler on average
|
|
61
|
-
*
|
|
170
|
+
*
|
|
62
171
|
* @private
|
|
63
172
|
*/
|
|
64
173
|
const handlerFunctionCache: Record<string, Function> = {};
|
|
@@ -79,14 +188,14 @@ const handlerFunctionCache: Record<string, Function> = {};
|
|
|
79
188
|
* @remarks
|
|
80
189
|
* **Parameter Categories:**
|
|
81
190
|
*
|
|
82
|
-
* 1. **Core Services** (
|
|
191
|
+
* 1. **Core Services** (eventHandler, Components, Editor)
|
|
83
192
|
* 2. **Context Data** (Event, Item, Current, currentPlatform, Values, Apps, Vars)
|
|
84
193
|
* 3. **Variable Functions** (SetVar, GetContextVar, GetVar, SetContextVar)
|
|
85
194
|
* 4. **Component Functions** (GetComponent, GetComponents, AddComponent)
|
|
86
195
|
* 5. **Application Functions** (UpdateApplication, Apps, applications)
|
|
87
196
|
* 6. **Page Functions** (AddPage, UpdatePage, deletePage)
|
|
88
197
|
* 7. **Navigation Functions** (NavigateToUrl, NavigateToHash, NavigateToPage)
|
|
89
|
-
* 8. **Property Update Functions** (updateInput, updateName, updateEvent, updateStyle, updateStyleHandlers
|
|
198
|
+
* 8. **Property Update Functions** (updateInput, updateName, updateEvent, updateStyle, updateStyleHandlers)
|
|
90
199
|
* 9. **Clipboard Functions** (CopyComponentToClipboard, PasteComponentFromClipboard, DeleteComponentAction)
|
|
91
200
|
* 10. **Editor Functions** (openEditorTab, setCurrentEditorTab, TraitCompoentFromSchema)
|
|
92
201
|
* 11. **Function Invocation** (InvokeFunction)
|
|
@@ -118,7 +227,6 @@ const handlerFunctionCache: Record<string, Function> = {};
|
|
|
118
227
|
* ```
|
|
119
228
|
*/
|
|
120
229
|
export const HANDLER_PARAMETERS = [
|
|
121
|
-
"Database",
|
|
122
230
|
"eventHandler",
|
|
123
231
|
"Components",
|
|
124
232
|
"Editor",
|
|
@@ -146,7 +254,6 @@ export const HANDLER_PARAMETERS = [
|
|
|
146
254
|
"context",
|
|
147
255
|
"applications",
|
|
148
256
|
"updateInput",
|
|
149
|
-
"updateInputHandlers",
|
|
150
257
|
"deletePage",
|
|
151
258
|
"CopyComponentToClipboard",
|
|
152
259
|
"PasteComponentFromClipboard",
|
|
@@ -171,6 +278,15 @@ export const HANDLER_PARAMETERS = [
|
|
|
171
278
|
"ShowInfoToast",
|
|
172
279
|
"HideToast",
|
|
173
280
|
"ClearAllToasts",
|
|
281
|
+
"__createScope__", // For transparent variable access
|
|
282
|
+
// Namespaced API object (new clean API)
|
|
283
|
+
"Nav",
|
|
284
|
+
"UI",
|
|
285
|
+
"Component",
|
|
286
|
+
"Data",
|
|
287
|
+
"Page",
|
|
288
|
+
"App",
|
|
289
|
+
"Var",
|
|
174
290
|
] as const;
|
|
175
291
|
|
|
176
292
|
/**
|
|
@@ -254,9 +370,41 @@ export const HANDLER_PARAMETERS = [
|
|
|
254
370
|
* @see {@link executeHandler} for the execution wrapper that calls compiled functions
|
|
255
371
|
* @see {@link HANDLER_PARAMETERS} for the list of available parameters in handler code
|
|
256
372
|
*/
|
|
373
|
+
/**
|
|
374
|
+
* Flag to enable/disable transparent variable access.
|
|
375
|
+
* When enabled, users can write `username = 'John'` instead of `$username = 'John'`.
|
|
376
|
+
*
|
|
377
|
+
* Set to false to use traditional explicit Vars access.
|
|
378
|
+
*/
|
|
379
|
+
let transparentVarsEnabled = true;
|
|
380
|
+
|
|
381
|
+
/**
|
|
382
|
+
* Enable or disable transparent variable access in handlers.
|
|
383
|
+
*
|
|
384
|
+
* When enabled (default), variables like `username` automatically
|
|
385
|
+
* resolve to `$username` for reactive access.
|
|
386
|
+
*
|
|
387
|
+
* @param enabled - Whether to enable transparent variable access
|
|
388
|
+
*/
|
|
389
|
+
export function setTransparentVarsEnabled(enabled: boolean): void {
|
|
390
|
+
transparentVarsEnabled = enabled;
|
|
391
|
+
// Clear cache when mode changes to recompile handlers
|
|
392
|
+
clearHandlerCache();
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
/**
|
|
396
|
+
* Check if transparent variable access is enabled.
|
|
397
|
+
*/
|
|
398
|
+
export function isTransparentVarsEnabled(): boolean {
|
|
399
|
+
return transparentVarsEnabled;
|
|
400
|
+
}
|
|
401
|
+
|
|
257
402
|
export function compileHandlerFunction(code: string): Function {
|
|
403
|
+
// Include mode in cache key to handle mode changes
|
|
404
|
+
const cacheKey = transparentVarsEnabled ? `scope:${code}` : code;
|
|
405
|
+
|
|
258
406
|
// Check cache first for performance
|
|
259
|
-
if (!handlerFunctionCache[
|
|
407
|
+
if (!handlerFunctionCache[cacheKey]) {
|
|
260
408
|
// Validate handler code before compilation
|
|
261
409
|
// This is a safety layer in case validation was bypassed at save time
|
|
262
410
|
const validationResult = validateHandlerCode(code);
|
|
@@ -264,14 +412,46 @@ export function compileHandlerFunction(code: string): Function {
|
|
|
264
412
|
throw new Error(`Handler validation failed: ${validationResult.errors[0]?.message || 'Unknown error'}`);
|
|
265
413
|
}
|
|
266
414
|
|
|
267
|
-
//
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
415
|
+
// Wrap with implicit return if needed (e.g., "$name ?? 'hello'" becomes "return ($name ?? 'hello');")
|
|
416
|
+
const processedCode = wrapWithImplicitReturn(code);
|
|
417
|
+
|
|
418
|
+
if (transparentVarsEnabled) {
|
|
419
|
+
// Compile with transparent variable access using `with` statement
|
|
420
|
+
// The scope proxy routes unknown variables to VarsProxy
|
|
421
|
+
handlerFunctionCache[cacheKey] = new Function(
|
|
422
|
+
...HANDLER_PARAMETERS,
|
|
423
|
+
`
|
|
424
|
+
var __scope__ = __createScope__({
|
|
425
|
+
VarsProxy: Vars,
|
|
426
|
+
parameters: {
|
|
427
|
+
eventHandler: eventHandler, Components, Editor, Event, Item,
|
|
428
|
+
Current, currentPlatform, Values, Apps, Vars, SetVar, GetContextVar,
|
|
429
|
+
UpdateApplication, GetVar, GetComponent, GetComponents, AddComponent,
|
|
430
|
+
SetContextVar, AddPage, TraitCompoentFromSchema, NavigateToUrl,
|
|
431
|
+
NavigateToHash, NavigateToPage, UpdatePage, context, applications,
|
|
432
|
+
updateInput, deletePage, CopyComponentToClipboard, PasteComponentFromClipboard,
|
|
433
|
+
DeleteComponentAction, updateName, updateEvent, updateStyleHandlers,
|
|
434
|
+
EventData, updateStyle, openEditorTab, setCurrentEditorTab, InvokeFunction,
|
|
435
|
+
Utils, console, UploadFile, BrowseFiles, Instance, ShowToast,
|
|
436
|
+
ShowSuccessToast, ShowErrorToast, ShowWarningToast, ShowInfoToast,
|
|
437
|
+
HideToast, ClearAllToasts,
|
|
438
|
+
Nav, UI, Component, Data, Page, App, Var
|
|
439
|
+
}
|
|
440
|
+
});
|
|
441
|
+
with (__scope__) {
|
|
442
|
+
return (function() { ${processedCode} }).apply(this);
|
|
443
|
+
}
|
|
444
|
+
`
|
|
445
|
+
);
|
|
446
|
+
} else {
|
|
447
|
+
// Traditional compilation without scope proxy
|
|
448
|
+
handlerFunctionCache[cacheKey] = new Function(
|
|
449
|
+
...HANDLER_PARAMETERS,
|
|
450
|
+
`return (function() { ${processedCode} }).apply(this);`
|
|
451
|
+
);
|
|
452
|
+
}
|
|
273
453
|
}
|
|
274
|
-
return handlerFunctionCache[
|
|
454
|
+
return handlerFunctionCache[cacheKey];
|
|
275
455
|
}
|
|
276
456
|
|
|
277
457
|
/**
|
|
@@ -229,8 +229,14 @@ export function setupRuntimeContext(context: IRuntimeContext, component: any, Ev
|
|
|
229
229
|
context.Current.style = context.Current.style ?? {};
|
|
230
230
|
|
|
231
231
|
// Create or retrieve style proxy for reactive style updates
|
|
232
|
-
|
|
233
|
-
|
|
232
|
+
// IMPORTANT: Keep reference to original style object BEFORE checking cache
|
|
233
|
+
// This fixes the issue where we were caching proxy -> proxy instead of original -> proxy
|
|
234
|
+
const originalStyle = context.Current.style;
|
|
235
|
+
|
|
236
|
+
if (context.styleProxyCache.has(originalStyle)) {
|
|
237
|
+
context.Current.style = context.styleProxyCache.get(originalStyle);
|
|
238
|
+
} else {
|
|
239
|
+
const newProxy = observe(originalStyle, (target, prop, value) => {
|
|
234
240
|
context.setComponentRuntimeStyleAttribute(
|
|
235
241
|
context.Current.uniqueUUID,
|
|
236
242
|
prop,
|
|
@@ -238,10 +244,9 @@ export function setupRuntimeContext(context: IRuntimeContext, component: any, Ev
|
|
|
238
244
|
);
|
|
239
245
|
});
|
|
240
246
|
|
|
247
|
+
// Cache using original object as key, proxy as value
|
|
248
|
+
context.styleProxyCache.set(originalStyle, newProxy);
|
|
241
249
|
context.Current.style = newProxy;
|
|
242
|
-
context.styleProxyCache.set(context.Current.style, newProxy);
|
|
243
|
-
} else {
|
|
244
|
-
context.Current.style = context.styleProxyCache.get(context.Current.style);
|
|
245
250
|
}
|
|
246
251
|
}
|
|
247
252
|
|