@nuraly/runtime 0.1.7 → 0.1.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +83 -765
- package/components/ui/components/Event/EventValue/EventValue.ts +13 -8
- package/components/ui/components/ToastContainer/ToastContainer.ts +1 -1
- package/components/ui/components/advanced/AIChat/AIChat.ts +1 -2
- package/components/ui/components/advanced/Collapse/Collapse.ts +5 -2
- package/components/ui/components/advanced/Collections/Collections.ts +2 -2
- package/components/ui/components/advanced/MicroApp/MicroApp.ts +3 -11
- package/components/ui/components/advanced/RefComponent/RefComponent.ts +2 -2
- package/components/ui/components/advanced/RichText/RichText.ts +5 -4
- package/components/ui/components/advanced/RichText/RichTextEditor.ts +0 -167
- package/components/ui/components/base/BaseElement/base-change-detection.ts +1 -5
- package/components/ui/components/base/BaseElement.ts +229 -610
- package/components/ui/components/base/FormRegisterable.ts +83 -0
- package/components/ui/components/base/controllers/DragDropController.ts +175 -0
- package/components/ui/components/base/controllers/ErrorController.ts +180 -0
- package/components/ui/components/base/controllers/EventController.ts +112 -0
- package/components/ui/components/base/controllers/InputHandlerController.ts +298 -0
- package/components/ui/components/base/controllers/SelectionController.ts +323 -0
- package/components/ui/components/base/controllers/StyleHandlerController.ts +286 -0
- package/components/ui/components/base/controllers/index.ts +11 -0
- package/components/ui/components/base/mixins/EditorModeMixin.ts +185 -0
- package/components/ui/components/base/mixins/index.ts +6 -0
- package/components/ui/components/base/types/base-element.types.ts +138 -0
- package/components/ui/components/base/types/index.ts +21 -0
- package/components/ui/components/base/utils/event-debouncer.ts +209 -0
- package/components/ui/components/base/utils/index.ts +11 -0
- package/components/ui/components/base/utils/style-cache.ts +94 -0
- package/components/ui/components/display/BoxModel/BoxModel.ts +177 -116
- package/components/ui/components/display/Code/Code.ts +40 -26
- package/components/ui/components/display/Divider/Divider.ts +2 -2
- package/components/ui/components/display/Icon/Icon.ts +2 -3
- package/components/ui/components/display/Image/Image.ts +72 -46
- package/components/ui/components/display/Tag/Tag.ts +2 -3
- package/components/ui/components/display/Video/Video.ts +91 -31
- package/components/ui/components/inputs/Button/Button.ts +2 -2
- package/components/ui/components/inputs/Checkbox/Checkbox.ts +14 -40
- package/components/ui/components/inputs/ColorPicker/colorpicker.ts +9 -4
- package/components/ui/components/inputs/DatePicker/DatePicker.ts +47 -25
- package/components/ui/components/inputs/Dropdown/Dropdown.ts +2 -2
- package/components/ui/components/inputs/Form/Form.style.ts +26 -0
- package/components/ui/components/inputs/Form/Form.ts +360 -0
- package/components/ui/components/inputs/IconPicker/IconPicker.ts +22 -18
- package/components/ui/components/inputs/InsertDropdown/InsertDropdown.ts +0 -20
- package/components/ui/components/inputs/NumberInput/NumberInput.ts +0 -4
- package/components/ui/components/inputs/RadioButton/Radio-button.ts +17 -13
- package/components/ui/components/inputs/Select/Select.ts +44 -24
- package/components/ui/components/inputs/TextInput/TextInput.ts +15 -9
- package/components/ui/components/inputs/Textarea/Textarea.ts +30 -30
- package/components/ui/components/inputs/UsersDropdown/UsersDropdown.ts +1 -1
- package/components/ui/components/layout/Card/Card.ts +112 -10
- package/components/ui/components/layout/Containers/Container.style.ts +18 -0
- package/components/ui/components/layout/Containers/Container.ts +11 -5
- package/components/ui/components/layout/Grid/Col.style.ts +27 -0
- package/components/ui/components/layout/Grid/Col.ts +213 -0
- package/components/ui/components/layout/Grid/Row.style.ts +73 -0
- package/components/ui/components/layout/Grid/Row.ts +170 -0
- package/components/ui/components/layout/Grid/index.ts +7 -0
- package/components/ui/components/layout/Panel/Panel.ts +2 -2
- package/components/ui/components/layout/Tabs/Tabs.ts +0 -1
- package/components/ui/components/navigation/EmbedURL/EmbedURL.ts +62 -26
- package/components/ui/components/navigation/Link/Link.ts +27 -16
- package/components/ui/components/navigation/Menu/Menu.ts +26 -48
- package/components/ui/components/runtime/MicroApp/MicroApp.ts +7 -147
- package/components/ui/components/runtime/MicroApp/MicroAppDataLoader.ts +6 -2
- package/components/ui/components/studio/FunctionsPanel/FunctionsPanel.ts +484 -0
- package/components/ui/components/studio/FunctionsPanel/index.ts +1 -0
- package/components/ui/components/utility/AccessRoles/AccessRoles.style.ts +242 -0
- package/components/ui/components/utility/AccessRoles/AccessRoles.ts +476 -0
- package/components/ui/components/utility/Border/Border.ts +0 -14
- package/components/ui/components/utility/BorderManager/BorderManager.style.ts +237 -0
- package/components/ui/components/utility/BorderManager/BorderManager.ts +503 -0
- package/components/ui/components/utility/BoxShadow/BoxShadow.ts +0 -16
- package/components/ui/components/utility/Document/Document.ts +54 -25
- package/components/ui/components/utility/Export-Import/Export-Import.ts +8 -7
- package/components/ui/components/utility/Handlers/Handlers.ts +14 -17
- package/components/ui/components/utility/ValidationRules/ValidationRules.ts +440 -0
- package/components/ui/components/wrappers/GenerikWrapper/DragWrapper/DragWrapper.ts +1 -0
- package/components/ui/components/wrappers/GenerikWrapper/GenerikWrapper.ts +1 -24
- package/components/ui/nuraly-ui/src/components/badge/badge.style.ts +4 -3
- package/components/ui/nuraly-ui/src/components/datepicker/datepicker.component.ts +2 -0
- package/components/ui/nuraly-ui/src/components/radio-group/radio-group.component.ts +12 -6
- package/components/ui/nuraly-ui/src/components/radio-group/radio-group.style.ts +23 -0
- package/dist/{index-B4yIOSMd.js → BaseElement-BNBn_IJk.js} +2920 -267
- package/dist/{CodeEditor-YsOapSut.js → CodeEditor-B1gNuvPb.js} +84127 -76319
- package/dist/{CodeEditor-BiNku87K.js → CodeEditor-Cpph-xRc.js} +7 -7
- package/dist/{abap-B2diVmjb.js → abap-D0Neqhq6.js} +91 -1
- package/dist/{apex-3NuJ-nsI.js → apex-B5LhxkeG.js} +18 -1
- package/dist/assets/editor.worker-DcwbJ0PV.js +12 -0
- package/dist/assets/html.worker-BTMxskjR.js +461 -0
- package/dist/assets/json.worker-D3vTGdf_.js +49 -0
- package/dist/assets/ts.worker-BsM1BXac.js +51334 -0
- package/dist/{azcli-XGXuUsMB.js → azcli-BrBH0QTU.js} +1 -1
- package/dist/{bat-B8Vhm634.js → bat-BfzAov64.js} +12 -1
- package/dist/{bicep-Cc8X5S_k.js → bicep-C3bCSWel.js} +1 -1
- package/dist/{cameligo-Bo3wBh9T.js → cameligo-sFL5plcd.js} +13 -1
- package/dist/{clojure-CPoQlpIK.js → clojure-CfeExRz0.js} +14 -1
- package/dist/{coffee-BxvTGz39.js → coffee-Xws5K0WL.js} +11 -1
- package/dist/{cpp-5RpEV7vC.js → cpp-CqOUEpxN.js} +28 -23
- package/dist/{csharp-slXXP3fo.js → csharp-DVLiBOZb.js} +13 -1
- package/dist/{csp-B98p6-gH.js → csp-DVFp9bw5.js} +3 -1
- package/dist/{css-BDsDSAin.js → css-DwARn2R6.js} +8 -1
- package/dist/cssMode-D82-gS78.js +1577 -0
- package/dist/{cypher-Dc4IMouD.js → cypher-uY0Mffat.js} +8 -1
- package/dist/{dart-LhvE3yD2.js → dart-D27H-mX_.js} +18 -1
- package/dist/{dockerfile-CwzplJeZ.js → dockerfile-CmV85WZK.js} +5 -1
- package/dist/{ecl-DxW3FiJi.js → ecl--fKn7yzB.js} +9 -1
- package/dist/{elixir-BI40g7TU.js → elixir-DUhH17ON.js} +87 -1
- package/dist/{flow9-tR2v0bGz.js → flow9-B3Dx2LLe.js} +8 -1
- package/dist/{freemarker2-Bfqhwyij.js → freemarker2-CYRLpyjt.js} +359 -7
- package/dist/{fsharp-BLAma0OT.js → fsharp-SyqBfUAR.js} +14 -1
- package/dist/{go-nYcD3y4Z.js → go-BbMR2tdT.js} +17 -1
- package/dist/{graphql-Dp1cHWmP.js → graphql-DDJE6tIl.js} +17 -1
- package/dist/{handlebars-DCgKNBmn.js → handlebars-R8Efxi60.js} +38 -4
- package/dist/{hcl-6NT8Kbna.js → hcl-YBvpaUqf.js} +13 -1
- package/dist/{html-C6wR7sMB.js → html-czhjovcp.js} +37 -4
- package/dist/htmlMode-DpyKDYYs.js +1587 -0
- package/dist/{ini-BZCOLrEc.js → ini-Ct73dBtM.js} +10 -1
- package/dist/{java-DAMcfJbX.js → java-C_jlkwoG.js} +18 -1
- package/dist/{javascript-D1L5MTmg.js → javascript-DwqkMEdb.js} +3 -2
- package/dist/jsonMode-Cmxxe0W9.js +2002 -0
- package/dist/{julia-CQ46G71H.js → julia-D8WE5U1e.js} +22 -1
- package/dist/{kotlin-CEjVo_6E.js → kotlin-Zy9aq5yB.js} +15 -1
- package/dist/{less-DreV99nP.js → less-sZ0iHtE8.js} +1 -1
- package/dist/{lexon-DBVJhqLb.js → lexon-CsdNL29A.js} +13 -1
- package/dist/{liquid-D_pDYIs1.js → liquid-2spuEcBh.js} +12 -4
- package/dist/{lua-Dcc_j6L-.js → lua-C2YJo0zw.js} +12 -1
- package/dist/{m3-B9SlZL4n.js → m3-CPLP40SG.js} +7 -1
- package/dist/{markdown-CuGw9_MP.js → markdown-B1mf5e0R.js} +34 -1
- package/dist/{mdx-CKsJ3cF4.js → mdx-BjBXyEeR.js} +2 -2
- package/dist/{micro-app-entry-xdTX5-ut.js → micro-app-entry-DYAnCRDo.js} +8132 -9649
- package/dist/micro-app.bundle.js +3 -3
- package/dist/micro-app.js +3565 -6710
- package/dist/{mips-BUWqP-OH.js → mips-DA33BZX1.js} +11 -1
- package/dist/{msdax-DtkouYCg.js → msdax-CCYFIQsP.js} +5 -1
- package/dist/{mysql-IkAsWSmF.js → mysql-hjmIjL-D.js} +11 -3
- package/dist/{objective-c-B2-ronfg.js → objective-c-RRCpEmqC.js} +2 -1
- package/dist/{pascal-Bsnz2eJA.js → pascal-CeV8XfxB.js} +13 -1
- package/dist/{pascaligo-D_sMUn0Q.js → pascaligo-IEEGVJAJ.js} +13 -1
- package/dist/{perl-BPzHt9SS.js → perl-B5-QbHq_.js} +34 -1
- package/dist/{pgsql-DlTJB0PD.js → pgsql-s6kqEJmi.js} +14 -4
- package/dist/{php-Dmq5OjwK.js → php-CWWqzOo8.js} +36 -1
- package/dist/{pla-HJcccrBy.js → pla-FSvb_YP_.js} +13 -1
- package/dist/{postiats-OQn6DKv-.js → postiats-DQdscQXO.js} +370 -1
- package/dist/{powerquery-DKaMYC8w.js → powerquery-CtA5JA1I.js} +7 -1
- package/dist/{powershell-DWeJHik1.js → powershell-DglEq96N.js} +13 -1
- package/dist/{protobuf-CBn_IseU.js → protobuf-BSepub3e.js} +5 -1
- package/dist/{pug-BoRpCINl.js → pug-B1847F4G.js} +16 -1
- package/dist/{python-zPpZYwLF.js → python-DLI1ji08.js} +59 -11
- package/dist/{qsharp-4rGyVZOw.js → qsharp-D4i0Nqg9.js} +28 -3
- package/dist/{r-DsgLhBOb.js → r-cdRigKxa.js} +5 -1
- package/dist/{razor-B_fCUeGX.js → razor-oAnIJsrL.js} +48 -4
- package/dist/{redis-B2fdL4Bg.js → redis-D9MFxvE8.js} +16 -6
- package/dist/{redshift-DoaeyCkH.js → redshift-CmCnsvL-.js} +13 -4
- package/dist/{restructuredtext-D-6OFBY9.js → restructuredtext-CWy8J51t.js} +19 -1
- package/dist/{ruby-D1DD6baV.js → ruby-WP-c36m5.js} +76 -3
- package/dist/runtime.js +34 -45
- package/dist/{rust-DssUV39M.js → rust-Q9FLdYpu.js} +13 -1
- package/dist/{sb-Dmb6tAdv.js → sb-C54-JBGT.js} +12 -1
- package/dist/{scala-Co3ETaym.js → scala-CzbFImc5.js} +24 -1
- package/dist/{scheme-CMrqXTty.js → scheme-BhfDmYN3.js} +1 -1
- package/dist/{scss-DkGudv8Q.js → scss-CEmiBXpS.js} +25 -1
- package/dist/{shell-BHN2BI4L.js → shell-Bmc1VhG0.js} +4 -1
- package/dist/{solidity-b-R-raGB.js → solidity-C9Q2I8Hh.js} +23 -1
- package/dist/{sophia-Y4GjyxNB.js → sophia-jWa1UyKz.js} +16 -1
- package/dist/{sparql-CDAPZb88.js → sparql-CM7jctbc.js} +15 -1
- package/dist/{sql-DkkpPiUq.js → sql-WzihTkbg.js} +42 -1
- package/dist/{st-CSPV91Ej.js → st-6y7_3aup.js} +8 -1
- package/dist/style.css +1 -1
- package/dist/{swift-DdSC5O48.js → swift-k-0zxG_D.js} +4 -1
- package/dist/{systemverilog-CI03XpAv.js → systemverilog-Pnr5_rIP.js} +29 -3
- package/dist/{tcl-B8DayMSI.js → tcl-fNPXval8.js} +7 -1
- package/dist/tsMode-D_PMsbjK.js +976 -0
- package/dist/{twig-B1AUPVB_.js → twig-L2MkztkV.js} +76 -1
- package/dist/{typescript-DrlYcCUn.js → typescript-Bu3ZbtQI.js} +23 -2
- package/dist/typespec-Cqqo-3Pt.js +123 -0
- package/dist/{vb-BIC7ccdG.js → vb-B5YC2xN9.js} +15 -1
- package/dist/{wgsl-C9yjop46.js → wgsl-D9BRtftY.js} +26 -1
- package/dist/{xml-BzP9D0eZ.js → xml-CNSSkPqy.js} +8 -2
- package/dist/{yaml-CT7GOvXu.js → yaml-5RF_PGNe.js} +30 -2
- package/handlers/compiler.ts +196 -16
- package/handlers/context-setup.ts +10 -5
- package/handlers/handler-api-factory.ts +358 -0
- package/handlers/handler-api.ts +379 -0
- package/handlers/handler-executor.ts +25 -5
- package/handlers/handler-scope.ts +398 -0
- package/handlers/index.ts +34 -2
- package/handlers/runtime-api/component-properties.ts +0 -8
- package/handlers/runtime-api/index.ts +1 -1
- package/handlers/runtime-api/toast.ts +1 -1
- package/index.ts +14 -115
- package/micro-app/README.md +10 -10
- package/micro-app/state/MicroAppRuntimeContext.ts +1 -28
- package/micro-app-entry.ts +0 -5
- package/package.json +22 -1
- package/redux/actions/application/index.ts +0 -1
- package/redux/actions/component/addComponentAction.ts +15 -4
- package/redux/actions/component/moveDraggedComponent.ts +1 -2
- package/redux/actions/component/update-component-name.ts +1 -1
- package/redux/actions/component/updateComponentAttributes.ts +7 -2
- package/redux/handlers/functions/build-function-handler.ts +11 -3
- package/redux/handlers/functions/deploy-function-handler.ts +11 -3
- package/redux/handlers/functions/invoke-function-handler.ts +11 -3
- package/redux/handlers/functions/load-functions-handler.ts +2 -1
- package/redux/handlers/functions/update-function-handler.ts +2 -1
- package/redux/store/component/component.interface.ts +8 -2
- package/redux/store/component/store.ts +1 -4
- package/state/runtime-context.ts +1 -23
- package/utils/RuntimeContextHelpers.ts +221 -90
- package/utils/change-detection.ts +125 -1
- package/utils/clipboard-utils.ts +18 -8
- package/utils/component-registry.ts +118 -0
- package/utils/index.ts +14 -1
- package/utils/naming-generator.ts +3 -1
- package/utils/randomness.ts +3 -1
- package/utils/register-components.ts +21 -29
- package/utils/render-util.ts +27 -48
- package/utils/toast.ts +97 -0
- package/vite.config.ts +29 -12
- package/components/ui/components/Event/EventAttribute/EventAttribute.style.ts +0 -11
- package/components/ui/components/Event/EventAttribute/EventAttribute.ts +0 -28
- package/components/ui/components/base/BaseElement/calculateStyles.ts +0 -31
- package/components/ui/components/base/BaseElement/drag-events.helpers.ts +0 -71
- package/components/ui/components/base/BaseElement/execute-event.helpers.ts +0 -45
- package/components/ui/components/base/BaseElement/interactions.helpers.ts +0 -14
- package/components/ui/components/wrappers/ComponentTitle/ComponentTitle.ts +0 -95
- package/components/ui/components/wrappers/GenerikWrapper/ResizeWrapper/ResizeWrapper.style.ts +0 -102
- package/components/ui/components/wrappers/GenerikWrapper/ResizeWrapper/ResizeWrapper.ts +0 -258
- package/components/ui/components/wrappers/PreviewWrapper.ts +0 -28
- package/components/ui/components/wrappers/RectangleSelection/RectangleSelection.ts +0 -154
- package/components/ui/nuraly-ui/packages/common/dist/constants/index.d.ts +0 -2
- package/components/ui/nuraly-ui/packages/common/dist/constants/index.js +0 -2
- package/components/ui/nuraly-ui/packages/common/dist/constants.d.ts +0 -17
- package/components/ui/nuraly-ui/packages/common/dist/constants.js +0 -7
- package/components/ui/nuraly-ui/packages/common/dist/controllers/index.d.ts +0 -2
- package/components/ui/nuraly-ui/packages/common/dist/controllers/index.js +0 -2
- package/components/ui/nuraly-ui/packages/common/dist/controllers.d.ts +0 -21
- package/components/ui/nuraly-ui/packages/common/dist/controllers.js +0 -22
- package/components/ui/nuraly-ui/packages/common/dist/index.d.ts +0 -25
- package/components/ui/nuraly-ui/packages/common/dist/index.js +0 -27
- package/components/ui/nuraly-ui/packages/common/dist/mixins/index.d.ts +0 -2
- package/components/ui/nuraly-ui/packages/common/dist/mixins/index.js +0 -3
- package/components/ui/nuraly-ui/packages/common/dist/mixins.d.ts +0 -26
- package/components/ui/nuraly-ui/packages/common/dist/mixins.js +0 -29
- package/components/ui/nuraly-ui/packages/common/dist/shared/base-mixin.d.ts +0 -42
- package/components/ui/nuraly-ui/packages/common/dist/shared/base-mixin.js +0 -38
- package/components/ui/nuraly-ui/packages/common/dist/shared/constants.d.ts +0 -1
- package/components/ui/nuraly-ui/packages/common/dist/shared/constants.js +0 -2
- package/components/ui/nuraly-ui/packages/common/dist/shared/controllers/dropdown.controller.d.ts +0 -77
- package/components/ui/nuraly-ui/packages/common/dist/shared/controllers/dropdown.controller.js +0 -341
- package/components/ui/nuraly-ui/packages/common/dist/shared/controllers/dropdown.interface.d.ts +0 -37
- package/components/ui/nuraly-ui/packages/common/dist/shared/controllers/dropdown.interface.js +0 -2
- package/components/ui/nuraly-ui/packages/common/dist/shared/controllers/index.d.ts +0 -4
- package/components/ui/nuraly-ui/packages/common/dist/shared/controllers/index.js +0 -4
- package/components/ui/nuraly-ui/packages/common/dist/shared/controllers/theme.controller.d.ts +0 -48
- package/components/ui/nuraly-ui/packages/common/dist/shared/controllers/theme.controller.js +0 -133
- package/components/ui/nuraly-ui/packages/common/dist/shared/dependency-mixin.d.ts +0 -37
- package/components/ui/nuraly-ui/packages/common/dist/shared/dependency-mixin.js +0 -141
- package/components/ui/nuraly-ui/packages/common/dist/shared/event-handler-mixin.d.ts +0 -64
- package/components/ui/nuraly-ui/packages/common/dist/shared/event-handler-mixin.js +0 -95
- package/components/ui/nuraly-ui/packages/common/dist/shared/index.d.ts +0 -13
- package/components/ui/nuraly-ui/packages/common/dist/shared/index.js +0 -17
- package/components/ui/nuraly-ui/packages/common/dist/shared/theme-mixin.d.ts +0 -78
- package/components/ui/nuraly-ui/packages/common/dist/shared/theme-mixin.js +0 -194
- package/components/ui/nuraly-ui/packages/common/dist/shared/themes.d.ts +0 -44
- package/components/ui/nuraly-ui/packages/common/dist/shared/themes.js +0 -85
- package/components/ui/nuraly-ui/packages/common/dist/shared/utils.d.ts +0 -60
- package/components/ui/nuraly-ui/packages/common/dist/shared/utils.js +0 -85
- package/components/ui/nuraly-ui/packages/common/dist/shared/validation.types.d.ts +0 -108
- package/components/ui/nuraly-ui/packages/common/dist/shared/validation.types.js +0 -17
- package/components/ui/nuraly-ui/packages/common/dist/themes/index.d.ts +0 -2
- package/components/ui/nuraly-ui/packages/common/dist/themes/index.js +0 -2
- package/components/ui/nuraly-ui/packages/common/dist/themes.d.ts +0 -22
- package/components/ui/nuraly-ui/packages/common/dist/themes.js +0 -23
- package/components/ui/nuraly-ui/packages/common/dist/utils/index.d.ts +0 -2
- package/components/ui/nuraly-ui/packages/common/dist/utils/index.js +0 -2
- package/components/ui/nuraly-ui/packages/common/dist/utils.d.ts +0 -21
- package/components/ui/nuraly-ui/packages/common/dist/utils.js +0 -22
- package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/LICENSE +0 -15
- package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/README.md +0 -294
- package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/copy/copy-sync.js +0 -171
- package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/copy/copy.js +0 -175
- package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/copy/index.js +0 -7
- package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/empty/index.js +0 -39
- package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/ensure/file.js +0 -66
- package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/ensure/index.js +0 -23
- package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/ensure/link.js +0 -64
- package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/ensure/symlink-paths.js +0 -101
- package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/ensure/symlink-type.js +0 -34
- package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/ensure/symlink.js +0 -67
- package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/fs/index.js +0 -146
- package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/index.js +0 -16
- package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/json/index.js +0 -16
- package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/json/jsonfile.js +0 -11
- package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/json/output-json-sync.js +0 -12
- package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/json/output-json.js +0 -12
- package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/mkdirs/index.js +0 -14
- package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/mkdirs/make-dir.js +0 -27
- package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/mkdirs/utils.js +0 -21
- package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/move/index.js +0 -7
- package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/move/move-sync.js +0 -55
- package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/move/move.js +0 -59
- package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/output-file/index.js +0 -31
- package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/path-exists/index.js +0 -12
- package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/remove/index.js +0 -17
- package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/util/async.js +0 -29
- package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/util/stat.js +0 -159
- package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/util/utimes.js +0 -36
- package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/LICENSE +0 -15
- package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/README.md +0 -294
- package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/copy/copy-sync.js +0 -171
- package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/copy/copy.js +0 -175
- package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/copy/index.js +0 -7
- package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/empty/index.js +0 -39
- package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/ensure/file.js +0 -66
- package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/ensure/index.js +0 -23
- package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/ensure/link.js +0 -64
- package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/ensure/symlink-paths.js +0 -101
- package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/ensure/symlink-type.js +0 -34
- package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/ensure/symlink.js +0 -67
- package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/fs/index.js +0 -146
- package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/index.js +0 -16
- package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/json/index.js +0 -16
- package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/json/jsonfile.js +0 -11
- package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/json/output-json-sync.js +0 -12
- package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/json/output-json.js +0 -12
- package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/mkdirs/index.js +0 -14
- package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/mkdirs/make-dir.js +0 -27
- package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/mkdirs/utils.js +0 -21
- package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/move/index.js +0 -7
- package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/move/move-sync.js +0 -55
- package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/move/move.js +0 -59
- package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/output-file/index.js +0 -31
- package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/path-exists/index.js +0 -12
- package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/remove/index.js +0 -17
- package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/util/async.js +0 -29
- package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/util/stat.js +0 -159
- package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/util/utimes.js +0 -36
- package/dist/SmartAttributeHandler-C4EliaG0.js +0 -153
- package/dist/SmartAttributeHandler-u-ZHGueR.js +0 -193
- package/dist/assets/editor.worker-C_S4Avdt.js +0 -11
- package/dist/assets/html.worker-DfuQASUV.js +0 -458
- package/dist/assets/json.worker-Cucz4wxY.js +0 -42
- package/dist/assets/ts.worker-Dme6S0YK.js +0 -37021
- package/dist/cssMode-CqMQ6Xsa.js +0 -1443
- package/dist/htmlMode-KglxyZXm.js +0 -1453
- package/dist/jsonMode-B3rqxD-b.js +0 -1863
- package/dist/tsMode-DEiq8fQ0.js +0 -800
- package/redux/actions/application/loadApplicationPermissionAction.ts +0 -10
- package/utils/styleUtil.ts +0 -7
|
@@ -0,0 +1,484 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview FunctionsPanel - Studio Functions Management Panel
|
|
3
|
+
* @module Studio/FunctionsPanel
|
|
4
|
+
*
|
|
5
|
+
* @description
|
|
6
|
+
* A dedicated panel component for managing serverless functions in the Studio.
|
|
7
|
+
* Stores functions in global $studio_functions for low-code access.
|
|
8
|
+
* Uses Nuraly UI components (nr-menu, nr-button, nr-icon) for consistent styling.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```html
|
|
12
|
+
* <functions-panel></functions-panel>
|
|
13
|
+
* ```
|
|
14
|
+
*
|
|
15
|
+
* @example Low-code access
|
|
16
|
+
* ```javascript
|
|
17
|
+
* // Access functions from handlers
|
|
18
|
+
* const functions = $studio_functions;
|
|
19
|
+
* const myFunc = functions.find(f => f.name === 'myFunction');
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
|
|
23
|
+
import { LitElement, css, html } from 'lit';
|
|
24
|
+
import { customElement, state } from 'lit/decorators.js';
|
|
25
|
+
import { ExecuteInstance } from '../../../../../state/runtime-context';
|
|
26
|
+
import { openEditorTab, setCurrentEditorTab } from '../../../../../redux/actions/editor';
|
|
27
|
+
import { $editorState, $currentApplication } from '../../../../../redux/store/apps';
|
|
28
|
+
|
|
29
|
+
// Safely import nuraly-ui components
|
|
30
|
+
try {
|
|
31
|
+
await import("@nuralyui/button");
|
|
32
|
+
} catch (error) {
|
|
33
|
+
console.warn('[@nuralyui/button] Package not found or failed to load.');
|
|
34
|
+
}
|
|
35
|
+
try {
|
|
36
|
+
await import("@nuralyui/menu");
|
|
37
|
+
} catch (error) {
|
|
38
|
+
console.warn('[@nuralyui/menu] Package not found or failed to load.');
|
|
39
|
+
}
|
|
40
|
+
try {
|
|
41
|
+
await import("@nuralyui/icon");
|
|
42
|
+
} catch (error) {
|
|
43
|
+
console.warn('[@nuralyui/icon] Package not found or failed to load.');
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
export interface FunctionItem {
|
|
48
|
+
id: number;
|
|
49
|
+
label: string;
|
|
50
|
+
description?: string;
|
|
51
|
+
runtime?: string;
|
|
52
|
+
template?: string;
|
|
53
|
+
handler?: string;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
@customElement('functions-panel')
|
|
58
|
+
export class FunctionsPanel extends LitElement {
|
|
59
|
+
static override styles = css`
|
|
60
|
+
:host {
|
|
61
|
+
display: block;
|
|
62
|
+
height: 100%;
|
|
63
|
+
overflow-y: auto;
|
|
64
|
+
font-family: var(--nuraly-font-family, system-ui, sans-serif);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.panel-container {
|
|
68
|
+
display: flex;
|
|
69
|
+
flex-direction: column;
|
|
70
|
+
height: 100%;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.panel-header {
|
|
74
|
+
display: flex;
|
|
75
|
+
align-items: center;
|
|
76
|
+
justify-content: space-between;
|
|
77
|
+
padding: 8px 12px;
|
|
78
|
+
border-bottom: 1px solid var(--nuraly-border-color, #e0e0e0);
|
|
79
|
+
background: var(--nuraly-panel-header-bg, #fafafa);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.panel-title {
|
|
83
|
+
font-size: 13px;
|
|
84
|
+
font-weight: 500;
|
|
85
|
+
color: var(--nuraly-text-color, #333);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.functions-list {
|
|
89
|
+
flex: 1;
|
|
90
|
+
overflow-y: auto;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
nr-menu {
|
|
94
|
+
--nuraly-menu-width: 100%;
|
|
95
|
+
--nuraly-menu-item-padding: 8px 12px;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
nr-button {
|
|
99
|
+
--nuraly-button-height: 28px;
|
|
100
|
+
--nuraly-button-font-size: 12px;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.empty-state {
|
|
104
|
+
display: flex;
|
|
105
|
+
flex-direction: column;
|
|
106
|
+
align-items: center;
|
|
107
|
+
justify-content: center;
|
|
108
|
+
padding: 40px 20px;
|
|
109
|
+
text-align: center;
|
|
110
|
+
color: var(--nuraly-text-secondary, #888);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.empty-icon {
|
|
114
|
+
font-size: 48px;
|
|
115
|
+
margin-bottom: 16px;
|
|
116
|
+
opacity: 0.5;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
.empty-title {
|
|
120
|
+
font-size: 14px;
|
|
121
|
+
font-weight: 500;
|
|
122
|
+
margin-bottom: 8px;
|
|
123
|
+
color: var(--nuraly-text-color, #333);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
.empty-description {
|
|
127
|
+
font-size: 12px;
|
|
128
|
+
max-width: 200px;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
.loading {
|
|
132
|
+
display: flex;
|
|
133
|
+
align-items: center;
|
|
134
|
+
justify-content: center;
|
|
135
|
+
padding: 40px;
|
|
136
|
+
color: var(--nuraly-text-secondary, #888);
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
.error {
|
|
140
|
+
padding: 16px;
|
|
141
|
+
margin: 8px;
|
|
142
|
+
border-radius: 6px;
|
|
143
|
+
background: #ffebee;
|
|
144
|
+
color: #c62828;
|
|
145
|
+
font-size: 12px;
|
|
146
|
+
}
|
|
147
|
+
`;
|
|
148
|
+
|
|
149
|
+
@state()
|
|
150
|
+
private functions: FunctionItem[] = [];
|
|
151
|
+
|
|
152
|
+
@state()
|
|
153
|
+
private loading = true;
|
|
154
|
+
|
|
155
|
+
@state()
|
|
156
|
+
private error: string | null = null;
|
|
157
|
+
|
|
158
|
+
@state()
|
|
159
|
+
private selectedFunctionId: number | null = null;
|
|
160
|
+
|
|
161
|
+
@state()
|
|
162
|
+
private creating = false;
|
|
163
|
+
|
|
164
|
+
override connectedCallback() {
|
|
165
|
+
super.connectedCallback();
|
|
166
|
+
this.loadFunctions();
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
/**
|
|
170
|
+
* Load functions from API and store in global Vars
|
|
171
|
+
*/
|
|
172
|
+
async loadFunctions() {
|
|
173
|
+
this.loading = true;
|
|
174
|
+
this.error = null;
|
|
175
|
+
|
|
176
|
+
try {
|
|
177
|
+
const currentApp = $currentApplication.get();
|
|
178
|
+
const applicationId = currentApp?.uuid;
|
|
179
|
+
|
|
180
|
+
// Build URL with optional applicationId filter
|
|
181
|
+
let url = '/api/v1/functions';
|
|
182
|
+
if (applicationId) {
|
|
183
|
+
url += `?applicationId=${encodeURIComponent(applicationId)}`;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
const response = await fetch(url, {
|
|
187
|
+
method: 'GET',
|
|
188
|
+
headers: {
|
|
189
|
+
'Content-Type': 'application/json',
|
|
190
|
+
},
|
|
191
|
+
credentials: 'include'
|
|
192
|
+
});
|
|
193
|
+
|
|
194
|
+
if (!response.ok) {
|
|
195
|
+
throw new Error(`HTTP error! status: ${response.status}`);
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
const data = await response.json();
|
|
199
|
+
this.functions = data || [];
|
|
200
|
+
|
|
201
|
+
// Store in global Vars for low-code access
|
|
202
|
+
this.updateGlobalVars();
|
|
203
|
+
|
|
204
|
+
} catch (err) {
|
|
205
|
+
console.error('Error fetching functions:', err);
|
|
206
|
+
this.error = err instanceof Error ? err.message : 'Failed to load functions';
|
|
207
|
+
} finally {
|
|
208
|
+
this.loading = false;
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
/**
|
|
213
|
+
* Update global $studio_functions for low-code access
|
|
214
|
+
*/
|
|
215
|
+
private updateGlobalVars() {
|
|
216
|
+
try {
|
|
217
|
+
// Use VarsProxy for reactive updates (accessible via $studio_functions in handlers)
|
|
218
|
+
ExecuteInstance.VarsProxy.studio_functions = [...this.functions];
|
|
219
|
+
} catch (err) {
|
|
220
|
+
console.warn('Could not update global Vars:', err);
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
/**
|
|
225
|
+
* Fetch the default handler template from GitHub
|
|
226
|
+
*/
|
|
227
|
+
private async fetchDefaultTemplate(): Promise<string> {
|
|
228
|
+
const templateUrl = 'https://raw.githubusercontent.com/Nuralyio/functions-templates/refs/heads/main/v1/deno/2/handler.ts';
|
|
229
|
+
try {
|
|
230
|
+
const response = await fetch(templateUrl);
|
|
231
|
+
if (response.ok) {
|
|
232
|
+
return await response.text();
|
|
233
|
+
}
|
|
234
|
+
} catch (err) {
|
|
235
|
+
console.warn('Failed to fetch template, using default:', err);
|
|
236
|
+
}
|
|
237
|
+
// Fallback default template
|
|
238
|
+
return `export default async function handler(req: Request): Promise<Response> {
|
|
239
|
+
return new Response(JSON.stringify({ message: "Hello from Deno!" }), {
|
|
240
|
+
headers: { "Content-Type": "application/json" }
|
|
241
|
+
});
|
|
242
|
+
}`;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
/**
|
|
246
|
+
* Create a new function
|
|
247
|
+
*/
|
|
248
|
+
async createFunction() {
|
|
249
|
+
this.creating = true;
|
|
250
|
+
|
|
251
|
+
try {
|
|
252
|
+
const currentApp = $currentApplication.get();
|
|
253
|
+
const applicationId = currentApp?.uuid || null;
|
|
254
|
+
|
|
255
|
+
// Fetch default template from GitHub
|
|
256
|
+
const handler = await this.fetchDefaultTemplate();
|
|
257
|
+
|
|
258
|
+
const response = await fetch('/api/v1/functions', {
|
|
259
|
+
method: 'POST',
|
|
260
|
+
headers: {
|
|
261
|
+
'Content-Type': 'application/json',
|
|
262
|
+
},
|
|
263
|
+
credentials: 'include',
|
|
264
|
+
body: JSON.stringify({
|
|
265
|
+
label: `function-${Date.now()}`,
|
|
266
|
+
description: '',
|
|
267
|
+
runtime: 'deno',
|
|
268
|
+
template: 'v1/deno/2',
|
|
269
|
+
handler,
|
|
270
|
+
applicationId
|
|
271
|
+
})
|
|
272
|
+
});
|
|
273
|
+
|
|
274
|
+
if (!response.ok) {
|
|
275
|
+
const errData = await response.json().catch(() => ({}));
|
|
276
|
+
throw new Error(errData.message || `HTTP error! status: ${response.status}`);
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
const newFunction = await response.json();
|
|
280
|
+
this.functions = [...this.functions, newFunction];
|
|
281
|
+
this.updateGlobalVars();
|
|
282
|
+
|
|
283
|
+
// Open the new function in editor
|
|
284
|
+
this.openFunctionInEditor(newFunction);
|
|
285
|
+
|
|
286
|
+
} catch (err) {
|
|
287
|
+
console.error('Error creating function:', err);
|
|
288
|
+
this.error = err instanceof Error ? err.message : 'Failed to create function';
|
|
289
|
+
} finally {
|
|
290
|
+
this.creating = false;
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
/**
|
|
295
|
+
* Delete a function
|
|
296
|
+
*/
|
|
297
|
+
async deleteFunction(funcId: number) {
|
|
298
|
+
const func = this.functions.find(f => f.id === funcId);
|
|
299
|
+
if (!func) return;
|
|
300
|
+
|
|
301
|
+
if (!confirm(`Delete function "${func.label}"?`)) {
|
|
302
|
+
return;
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
try {
|
|
306
|
+
const response = await fetch(`/api/v1/functions/${funcId}`, {
|
|
307
|
+
method: 'DELETE',
|
|
308
|
+
headers: {
|
|
309
|
+
'Content-Type': 'application/json',
|
|
310
|
+
},
|
|
311
|
+
credentials: 'include'
|
|
312
|
+
});
|
|
313
|
+
|
|
314
|
+
if (!response.ok) {
|
|
315
|
+
throw new Error(`HTTP error! status: ${response.status}`);
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
this.functions = this.functions.filter(f => f.id !== funcId);
|
|
319
|
+
this.updateGlobalVars();
|
|
320
|
+
|
|
321
|
+
if (this.selectedFunctionId === funcId) {
|
|
322
|
+
this.selectedFunctionId = null;
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
} catch (err) {
|
|
326
|
+
console.error('Error deleting function:', err);
|
|
327
|
+
this.error = err instanceof Error ? err.message : 'Failed to delete function';
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
/**
|
|
332
|
+
* Open function in editor tab
|
|
333
|
+
*/
|
|
334
|
+
openFunctionInEditor(func: FunctionItem) {
|
|
335
|
+
this.selectedFunctionId = func.id;
|
|
336
|
+
|
|
337
|
+
// Set current function in global Vars for permissions panel and other uses
|
|
338
|
+
ExecuteInstance.VarsProxy.currentFunction = func;
|
|
339
|
+
|
|
340
|
+
try {
|
|
341
|
+
// Check if tab already exists
|
|
342
|
+
const editorState = $editorState.get();
|
|
343
|
+
const tabs = editorState?.tabs || [];
|
|
344
|
+
const existingTab = tabs.find(
|
|
345
|
+
(tab: any) => tab.type === 'function' && tab.id === String(func.id)
|
|
346
|
+
);
|
|
347
|
+
|
|
348
|
+
if (existingTab) {
|
|
349
|
+
// Switch to existing tab
|
|
350
|
+
setCurrentEditorTab(existingTab);
|
|
351
|
+
} else {
|
|
352
|
+
// Open new tab with detail format expected by function-page
|
|
353
|
+
const newTab = {
|
|
354
|
+
id: String(func.id),
|
|
355
|
+
label: func.label || `Function ${func.id}`,
|
|
356
|
+
type: 'function',
|
|
357
|
+
detail: {
|
|
358
|
+
uuid: func.id,
|
|
359
|
+
handler: func.handler || ''
|
|
360
|
+
}
|
|
361
|
+
};
|
|
362
|
+
|
|
363
|
+
openEditorTab(newTab);
|
|
364
|
+
setCurrentEditorTab(newTab);
|
|
365
|
+
}
|
|
366
|
+
} catch (err) {
|
|
367
|
+
console.warn('Could not open editor tab:', err);
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
/**
|
|
372
|
+
* Get icon name based on runtime
|
|
373
|
+
*/
|
|
374
|
+
private getRuntimeIcon(runtime?: string): string {
|
|
375
|
+
const iconMap: Record<string, string> = {
|
|
376
|
+
javascript: 'file-code',
|
|
377
|
+
typescript: 'file-code-2',
|
|
378
|
+
python: 'file-code',
|
|
379
|
+
java: 'coffee',
|
|
380
|
+
go: 'file-code'
|
|
381
|
+
};
|
|
382
|
+
return iconMap[runtime || 'javascript'] || 'function-square';
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
/**
|
|
386
|
+
* Convert functions to menu items format (IMenu interface)
|
|
387
|
+
*/
|
|
388
|
+
private getMenuItems() {
|
|
389
|
+
return this.functions.map(func => ({
|
|
390
|
+
text: func.label || `Function ${func.id}`,
|
|
391
|
+
icon: this.getRuntimeIcon(func.runtime),
|
|
392
|
+
selected: this.selectedFunctionId === func.id,
|
|
393
|
+
menu: {
|
|
394
|
+
icon: 'more-vertical',
|
|
395
|
+
actions: [
|
|
396
|
+
{ label: 'Delete', value: `delete:${func.id}` }
|
|
397
|
+
]
|
|
398
|
+
}
|
|
399
|
+
}));
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
/**
|
|
403
|
+
* Handle menu item click
|
|
404
|
+
*/
|
|
405
|
+
private handleMenuChange(e: CustomEvent) {
|
|
406
|
+
const path = e.detail.path;
|
|
407
|
+
if (path && path.length > 0) {
|
|
408
|
+
const funcIndex = path[0];
|
|
409
|
+
const func = this.functions[funcIndex];
|
|
410
|
+
if (func) {
|
|
411
|
+
this.openFunctionInEditor(func);
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
/**
|
|
417
|
+
* Handle menu action click (delete, etc.)
|
|
418
|
+
*/
|
|
419
|
+
private handleActionClick(e: CustomEvent) {
|
|
420
|
+
const actionValue = e.detail.value;
|
|
421
|
+
if (actionValue && actionValue.startsWith('delete:')) {
|
|
422
|
+
const funcId = parseInt(actionValue.replace('delete:', ''), 10);
|
|
423
|
+
this.deleteFunction(funcId);
|
|
424
|
+
}
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
override render() {
|
|
428
|
+
return html`
|
|
429
|
+
<div class="panel-container">
|
|
430
|
+
<div class="panel-header">
|
|
431
|
+
<span class="panel-title">Functions</span>
|
|
432
|
+
<nr-button
|
|
433
|
+
type="primary"
|
|
434
|
+
size="small"
|
|
435
|
+
iconLeft="plus"
|
|
436
|
+
?loading=${this.creating}
|
|
437
|
+
?disabled=${this.creating}
|
|
438
|
+
@click=${this.createFunction}
|
|
439
|
+
>
|
|
440
|
+
${this.creating ? 'Creating...' : 'New'}
|
|
441
|
+
</nr-button>
|
|
442
|
+
</div>
|
|
443
|
+
|
|
444
|
+
<div class="functions-list">
|
|
445
|
+
${this.loading ? html`
|
|
446
|
+
<div class="loading">Loading functions...</div>
|
|
447
|
+
` : this.error ? html`
|
|
448
|
+
<div class="error">
|
|
449
|
+
${this.error}
|
|
450
|
+
<nr-button
|
|
451
|
+
type="link"
|
|
452
|
+
size="small"
|
|
453
|
+
@click=${this.loadFunctions}
|
|
454
|
+
>
|
|
455
|
+
Retry
|
|
456
|
+
</nr-button>
|
|
457
|
+
</div>
|
|
458
|
+
` : this.functions.length === 0 ? html`
|
|
459
|
+
<div class="empty-state">
|
|
460
|
+
<nr-icon name="function-square" size="xxlarge"></nr-icon>
|
|
461
|
+
<div class="empty-title">No functions yet</div>
|
|
462
|
+
<div class="empty-description">
|
|
463
|
+
Create your first serverless function to get started.
|
|
464
|
+
</div>
|
|
465
|
+
</div>
|
|
466
|
+
` : html`
|
|
467
|
+
<nr-menu
|
|
468
|
+
size="small"
|
|
469
|
+
.items=${this.getMenuItems()}
|
|
470
|
+
@change=${this.handleMenuChange}
|
|
471
|
+
@action-click=${this.handleActionClick}
|
|
472
|
+
></nr-menu>
|
|
473
|
+
`}
|
|
474
|
+
</div>
|
|
475
|
+
</div>
|
|
476
|
+
`;
|
|
477
|
+
}
|
|
478
|
+
}
|
|
479
|
+
|
|
480
|
+
declare global {
|
|
481
|
+
interface HTMLElementTagNameMap {
|
|
482
|
+
'functions-panel': FunctionsPanel;
|
|
483
|
+
}
|
|
484
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { FunctionsPanel } from './FunctionsPanel';
|
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
import { css } from "lit";
|
|
2
|
+
|
|
3
|
+
export const accessRolesStyles = css`
|
|
4
|
+
:host {
|
|
5
|
+
display: block;
|
|
6
|
+
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
|
|
7
|
+
font-size: 12px;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.access-container {
|
|
11
|
+
padding: 8px;
|
|
12
|
+
width: 100%;
|
|
13
|
+
box-sizing: border-box;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.section {
|
|
17
|
+
margin-bottom: 16px;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.section-title {
|
|
21
|
+
font-size: 10px;
|
|
22
|
+
font-weight: 600;
|
|
23
|
+
color: var(--nuraly-text-secondary, #888);
|
|
24
|
+
text-transform: uppercase;
|
|
25
|
+
margin-bottom: 8px;
|
|
26
|
+
letter-spacing: 0.5px;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.access-toggle-row {
|
|
30
|
+
display: flex;
|
|
31
|
+
align-items: center;
|
|
32
|
+
justify-content: space-between;
|
|
33
|
+
padding: 10px 12px;
|
|
34
|
+
background: var(--nuraly-bg-secondary, #f5f5f5);
|
|
35
|
+
border-radius: 6px;
|
|
36
|
+
margin-bottom: 8px;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.access-toggle-row.active {
|
|
40
|
+
background: var(--nuraly-primary-light, #e6f0ff);
|
|
41
|
+
border: 1px solid var(--nuraly-primary, #4a9eff);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.toggle-content {
|
|
45
|
+
flex: 1;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.toggle-label {
|
|
49
|
+
font-size: 12px;
|
|
50
|
+
color: var(--nuraly-text-primary, #333);
|
|
51
|
+
font-weight: 500;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.toggle-description {
|
|
55
|
+
font-size: 10px;
|
|
56
|
+
color: var(--nuraly-text-tertiary, #888);
|
|
57
|
+
margin-top: 2px;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
nr-select.permission-select {
|
|
61
|
+
width: 90px;
|
|
62
|
+
--nuraly-select-height: 26px;
|
|
63
|
+
--nuraly-font-size-select: 10px;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.preset-buttons {
|
|
67
|
+
display: flex;
|
|
68
|
+
flex-wrap: wrap;
|
|
69
|
+
gap: 4px;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.preset-buttons nr-button {
|
|
73
|
+
--nuraly-button-height: 24px;
|
|
74
|
+
--nuraly-button-font-size: 10px;
|
|
75
|
+
--nuraly-button-padding-horizontal: 8px;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.roles-list {
|
|
79
|
+
display: flex;
|
|
80
|
+
flex-direction: column;
|
|
81
|
+
gap: 6px;
|
|
82
|
+
margin-bottom: 12px;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.role-item {
|
|
86
|
+
display: flex;
|
|
87
|
+
align-items: center;
|
|
88
|
+
justify-content: space-between;
|
|
89
|
+
padding: 8px 10px;
|
|
90
|
+
background: var(--nuraly-bg-secondary, #f5f5f5);
|
|
91
|
+
border-radius: 6px;
|
|
92
|
+
border: 1px solid var(--nuraly-border, #e0e0e0);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.role-info {
|
|
96
|
+
display: flex;
|
|
97
|
+
flex-direction: column;
|
|
98
|
+
flex: 1;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.role-header {
|
|
102
|
+
display: flex;
|
|
103
|
+
align-items: center;
|
|
104
|
+
gap: 8px;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.role-name-badge {
|
|
108
|
+
font-size: 11px;
|
|
109
|
+
font-weight: 600;
|
|
110
|
+
padding: 2px 8px;
|
|
111
|
+
border-radius: 4px;
|
|
112
|
+
display: inline-block;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
.role-name-badge.system {
|
|
116
|
+
color: #6b7280;
|
|
117
|
+
background: #f3f4f6;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.role-name-badge.custom {
|
|
121
|
+
color: #059669;
|
|
122
|
+
background: #d1fae5;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.role-type-tag {
|
|
126
|
+
font-size: 9px;
|
|
127
|
+
color: #9ca3af;
|
|
128
|
+
text-transform: uppercase;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
.role-description {
|
|
132
|
+
font-size: 10px;
|
|
133
|
+
color: var(--nuraly-text-tertiary, #888);
|
|
134
|
+
margin-top: 4px;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
.role-actions {
|
|
138
|
+
display: flex;
|
|
139
|
+
align-items: center;
|
|
140
|
+
gap: 8px;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
.empty-state {
|
|
144
|
+
text-align: center;
|
|
145
|
+
padding: 16px;
|
|
146
|
+
color: var(--nuraly-text-tertiary, #888);
|
|
147
|
+
font-size: 11px;
|
|
148
|
+
background: var(--nuraly-bg-secondary, #f5f5f5);
|
|
149
|
+
border-radius: 4px;
|
|
150
|
+
margin-bottom: 12px;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
.divider {
|
|
154
|
+
height: 1px;
|
|
155
|
+
background: var(--nuraly-border, #e0e0e0);
|
|
156
|
+
margin: 16px 0;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
.custom-role-input {
|
|
160
|
+
display: flex;
|
|
161
|
+
gap: 8px;
|
|
162
|
+
margin-top: 8px;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
.custom-role-input nr-input {
|
|
166
|
+
flex: 1;
|
|
167
|
+
--nuraly-spacing-input-height: 28px;
|
|
168
|
+
--nuraly-font-size-input: 11px;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
nr-checkbox {
|
|
172
|
+
--nuraly-checkbox-size: 16px;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
.info-text {
|
|
176
|
+
font-size: 10px;
|
|
177
|
+
color: var(--nuraly-text-tertiary, #888);
|
|
178
|
+
margin-top: 4px;
|
|
179
|
+
line-height: 1.4;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
.info-box {
|
|
183
|
+
padding: 10px 12px;
|
|
184
|
+
background: #fffbeb;
|
|
185
|
+
border: 1px solid #fcd34d;
|
|
186
|
+
border-radius: 6px;
|
|
187
|
+
margin-bottom: 12px;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
.info-box-title {
|
|
191
|
+
font-size: 11px;
|
|
192
|
+
font-weight: 600;
|
|
193
|
+
color: #92400e;
|
|
194
|
+
margin-bottom: 4px;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
.info-box-text {
|
|
198
|
+
font-size: 10px;
|
|
199
|
+
color: #a16207;
|
|
200
|
+
line-height: 1.4;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
.access-summary {
|
|
204
|
+
padding: 10px 12px;
|
|
205
|
+
background: #f0fdf4;
|
|
206
|
+
border: 1px solid #86efac;
|
|
207
|
+
border-radius: 6px;
|
|
208
|
+
margin-bottom: 12px;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
.access-summary-title {
|
|
212
|
+
font-size: 11px;
|
|
213
|
+
font-weight: 600;
|
|
214
|
+
color: #166534;
|
|
215
|
+
margin-bottom: 4px;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
.access-summary-text {
|
|
219
|
+
font-size: 10px;
|
|
220
|
+
color: #15803d;
|
|
221
|
+
line-height: 1.4;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
.select-row {
|
|
225
|
+
display: flex;
|
|
226
|
+
align-items: center;
|
|
227
|
+
gap: 8px;
|
|
228
|
+
margin-bottom: 8px;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
.select-label {
|
|
232
|
+
font-size: 11px;
|
|
233
|
+
color: var(--nuraly-text-secondary, #666);
|
|
234
|
+
min-width: 70px;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
nr-select {
|
|
238
|
+
flex: 1;
|
|
239
|
+
--nuraly-select-height: 28px;
|
|
240
|
+
--nuraly-font-size-select: 11px;
|
|
241
|
+
}
|
|
242
|
+
`;
|