@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,141 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright 2023 Nuraly, Laabidi Aymen
|
|
4
|
-
* SPDX-License-Identifier: MIT
|
|
5
|
-
*/
|
|
6
|
-
/**
|
|
7
|
-
* Checks if the current environment is development mode using Lit's development detection
|
|
8
|
-
* @returns boolean indicating if we're in development mode
|
|
9
|
-
*/
|
|
10
|
-
const isDevelopmentMode = () => {
|
|
11
|
-
var _a;
|
|
12
|
-
// Use Lit's built-in development detection
|
|
13
|
-
// Check for Lit development mode indicators
|
|
14
|
-
return (
|
|
15
|
-
// Check if Lit development version is loaded (litElementVersions exists in dev)
|
|
16
|
-
globalThis.litElementVersions !== undefined ||
|
|
17
|
-
// Standard NODE_ENV check
|
|
18
|
-
(typeof process !== 'undefined' && ((_a = process.env) === null || _a === void 0 ? void 0 : _a.NODE_ENV) === 'development') ||
|
|
19
|
-
// Fallback: check for localhost
|
|
20
|
-
(typeof window !== 'undefined' && (window.location.hostname === 'localhost' ||
|
|
21
|
-
window.location.hostname === '127.0.0.1')));
|
|
22
|
-
};
|
|
23
|
-
/**
|
|
24
|
-
* Mixin that adds dependency validation functionality to LitElement components
|
|
25
|
-
*
|
|
26
|
-
* @param superClass - The base class to extend (typically LitElement)
|
|
27
|
-
* @returns Enhanced class with dependency validation capabilities
|
|
28
|
-
*
|
|
29
|
-
* @example
|
|
30
|
-
* ```typescript
|
|
31
|
-
* @customElement('my-component')
|
|
32
|
-
* export class MyComponent extends DependencyValidationMixin(LitElement) {
|
|
33
|
-
* requiredComponents = ['nr-icon', 'hy-tooltip'];
|
|
34
|
-
*
|
|
35
|
-
* override connectedCallback() {
|
|
36
|
-
* super.connectedCallback();
|
|
37
|
-
* this.validateDependencies();
|
|
38
|
-
* }
|
|
39
|
-
* }
|
|
40
|
-
* ```
|
|
41
|
-
*/
|
|
42
|
-
export const DependencyValidationMixin = (superClass) => {
|
|
43
|
-
class DependencyValidationClass extends superClass {
|
|
44
|
-
constructor() {
|
|
45
|
-
super(...arguments);
|
|
46
|
-
/**
|
|
47
|
-
* Array of required component names that must be registered
|
|
48
|
-
* This should be set by the implementing component
|
|
49
|
-
*/
|
|
50
|
-
this.requiredComponents = [];
|
|
51
|
-
}
|
|
52
|
-
/**
|
|
53
|
-
* Validates that all required component dependencies are available
|
|
54
|
-
* Only runs in development mode for performance
|
|
55
|
-
* @throws {Error} When required components are not registered
|
|
56
|
-
*/
|
|
57
|
-
validateDependencies() {
|
|
58
|
-
// Only validate dependencies in development mode
|
|
59
|
-
if (!isDevelopmentMode()) {
|
|
60
|
-
return;
|
|
61
|
-
}
|
|
62
|
-
for (const componentName of this.requiredComponents) {
|
|
63
|
-
if (!this.isComponentAvailable(componentName)) {
|
|
64
|
-
throw new Error(`Required component "${componentName}" is not registered. ` +
|
|
65
|
-
`Please import and register the component before using ${this.tagName.toLowerCase()}. ` +
|
|
66
|
-
`Example: import '@nuralyui/${componentName}';`);
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
/**
|
|
71
|
-
* Validates dependencies with custom error handling
|
|
72
|
-
* Only runs in development mode for performance
|
|
73
|
-
* @param onError - Custom error handler function
|
|
74
|
-
* @returns boolean indicating if all dependencies are available
|
|
75
|
-
*/
|
|
76
|
-
validateDependenciesWithHandler(onError) {
|
|
77
|
-
// Only validate dependencies in development mode
|
|
78
|
-
if (!isDevelopmentMode()) {
|
|
79
|
-
return true; // Assume all dependencies are available in production
|
|
80
|
-
}
|
|
81
|
-
let allAvailable = true;
|
|
82
|
-
for (const componentName of this.requiredComponents) {
|
|
83
|
-
if (!this.isComponentAvailable(componentName)) {
|
|
84
|
-
allAvailable = false;
|
|
85
|
-
const error = new Error(`Required component "${componentName}" is not registered. ` +
|
|
86
|
-
`Please import and register the component before using ${this.tagName.toLowerCase()}.`);
|
|
87
|
-
if (onError) {
|
|
88
|
-
onError(componentName, error);
|
|
89
|
-
}
|
|
90
|
-
else {
|
|
91
|
-
console.error(error.message);
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
return allAvailable;
|
|
96
|
-
}
|
|
97
|
-
/**
|
|
98
|
-
* Checks if a specific component is available
|
|
99
|
-
* @param componentName - The name of the component to check
|
|
100
|
-
* @returns boolean indicating if component is registered
|
|
101
|
-
*/
|
|
102
|
-
isComponentAvailable(componentName) {
|
|
103
|
-
return !!customElements.get(componentName);
|
|
104
|
-
}
|
|
105
|
-
/**
|
|
106
|
-
* Gets a list of missing dependencies
|
|
107
|
-
* @returns Array of component names that are not registered
|
|
108
|
-
*/
|
|
109
|
-
getMissingDependencies() {
|
|
110
|
-
return this.requiredComponents.filter(componentName => !this.isComponentAvailable(componentName));
|
|
111
|
-
}
|
|
112
|
-
/**
|
|
113
|
-
* Checks if all dependencies are available without throwing errors
|
|
114
|
-
* @returns boolean indicating if all dependencies are available
|
|
115
|
-
*/
|
|
116
|
-
areDependenciesAvailable() {
|
|
117
|
-
return this.requiredComponents.every(componentName => this.isComponentAvailable(componentName));
|
|
118
|
-
}
|
|
119
|
-
/**
|
|
120
|
-
* Adds a required component to the dependency list
|
|
121
|
-
* @param componentName - The component name to add
|
|
122
|
-
*/
|
|
123
|
-
addRequiredComponent(componentName) {
|
|
124
|
-
if (!this.requiredComponents.includes(componentName)) {
|
|
125
|
-
this.requiredComponents.push(componentName);
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
/**
|
|
129
|
-
* Removes a required component from the dependency list
|
|
130
|
-
* @param componentName - The component name to remove
|
|
131
|
-
*/
|
|
132
|
-
removeRequiredComponent(componentName) {
|
|
133
|
-
const index = this.requiredComponents.indexOf(componentName);
|
|
134
|
-
if (index > -1) {
|
|
135
|
-
this.requiredComponents.splice(index, 1);
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
return DependencyValidationClass;
|
|
140
|
-
};
|
|
141
|
-
//# sourceMappingURL=dependency-mixin.js.map
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright 2023 Nuraly, Laabidi Aymen
|
|
4
|
-
* SPDX-License-Identifier: MIT
|
|
5
|
-
*/
|
|
6
|
-
import { LitElement } from 'lit';
|
|
7
|
-
declare type Constructor<T = {}> = new (...args: any[]) => T;
|
|
8
|
-
/**
|
|
9
|
-
* Interface for components that support event handling operations
|
|
10
|
-
*/
|
|
11
|
-
export interface EventHandlerCapable {
|
|
12
|
-
/**
|
|
13
|
-
* Dispatch a custom event with consistent structure
|
|
14
|
-
* @param eventName - The name of the event
|
|
15
|
-
* @param detail - The event detail object
|
|
16
|
-
*/
|
|
17
|
-
dispatchCustomEvent(eventName: string, detail: any): void;
|
|
18
|
-
/**
|
|
19
|
-
* Dispatch events with metadata
|
|
20
|
-
*/
|
|
21
|
-
dispatchEventWithMetadata(eventName: string, detail: any): void;
|
|
22
|
-
/**
|
|
23
|
-
* Dispatch input-related events
|
|
24
|
-
*/
|
|
25
|
-
dispatchInputEvent(eventName: string, detail: any): void;
|
|
26
|
-
/**
|
|
27
|
-
* Dispatch focus-related events
|
|
28
|
-
*/
|
|
29
|
-
dispatchFocusEvent(eventName: string, detail: any): void;
|
|
30
|
-
/**
|
|
31
|
-
* Dispatch validation events
|
|
32
|
-
*/
|
|
33
|
-
dispatchValidationEvent(eventName: string, detail: any): void;
|
|
34
|
-
/**
|
|
35
|
-
* Dispatch action events
|
|
36
|
-
*/
|
|
37
|
-
dispatchActionEvent(eventName: string, detail: any): void;
|
|
38
|
-
/**
|
|
39
|
-
* Check if a key is allowed when component is readonly
|
|
40
|
-
*/
|
|
41
|
-
isReadonlyKeyAllowed(keyDownEvent: KeyboardEvent): boolean;
|
|
42
|
-
/**
|
|
43
|
-
* Check if key is an activation key (Enter/Space)
|
|
44
|
-
*/
|
|
45
|
-
isActivationKey(keyDownEvent: KeyboardEvent): boolean;
|
|
46
|
-
}
|
|
47
|
-
/**
|
|
48
|
-
* Mixin that provides standardized event handling capabilities
|
|
49
|
-
*
|
|
50
|
-
* @param superClass - The base class to extend
|
|
51
|
-
* @returns Enhanced class with event handling capabilities
|
|
52
|
-
*
|
|
53
|
-
* @example
|
|
54
|
-
* ```typescript
|
|
55
|
-
* export class MyComponent extends EventHandlerMixin(LitElement) {
|
|
56
|
-
* handleClick() {
|
|
57
|
-
* this.dispatchCustomEvent('my-click', { value: 'test' });
|
|
58
|
-
* }
|
|
59
|
-
* }
|
|
60
|
-
* ```
|
|
61
|
-
*/
|
|
62
|
-
export declare const EventHandlerMixin: <T extends Constructor<LitElement>>(superClass: T) => Constructor<EventHandlerCapable> & T;
|
|
63
|
-
export {};
|
|
64
|
-
//# sourceMappingURL=event-handler-mixin.d.ts.map
|
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright 2023 Nuraly, Laabidi Aymen
|
|
4
|
-
* SPDX-License-Identifier: MIT
|
|
5
|
-
*/
|
|
6
|
-
/**
|
|
7
|
-
* Mixin that provides standardized event handling capabilities
|
|
8
|
-
*
|
|
9
|
-
* @param superClass - The base class to extend
|
|
10
|
-
* @returns Enhanced class with event handling capabilities
|
|
11
|
-
*
|
|
12
|
-
* @example
|
|
13
|
-
* ```typescript
|
|
14
|
-
* export class MyComponent extends EventHandlerMixin(LitElement) {
|
|
15
|
-
* handleClick() {
|
|
16
|
-
* this.dispatchCustomEvent('my-click', { value: 'test' });
|
|
17
|
-
* }
|
|
18
|
-
* }
|
|
19
|
-
* ```
|
|
20
|
-
*/
|
|
21
|
-
export const EventHandlerMixin = (superClass) => {
|
|
22
|
-
class EventHandlerMixinClass extends superClass {
|
|
23
|
-
/**
|
|
24
|
-
* Dispatch a custom event with consistent structure and bubbling
|
|
25
|
-
*/
|
|
26
|
-
dispatchCustomEvent(eventName, detail) {
|
|
27
|
-
this.dispatchEvent(new CustomEvent(eventName, {
|
|
28
|
-
detail,
|
|
29
|
-
bubbles: true,
|
|
30
|
-
composed: true
|
|
31
|
-
}));
|
|
32
|
-
}
|
|
33
|
-
/**
|
|
34
|
-
* Event dispatcher with additional metadata
|
|
35
|
-
* Adds common properties like timestamp and component info
|
|
36
|
-
*/
|
|
37
|
-
dispatchEventWithMetadata(eventName, detail) {
|
|
38
|
-
var _a;
|
|
39
|
-
const eventDetail = Object.assign(Object.assign({}, detail), { timestamp: Date.now(), componentName: ((_a = this.tagName) === null || _a === void 0 ? void 0 : _a.toLowerCase()) || 'unknown' });
|
|
40
|
-
this.dispatchCustomEvent(eventName, eventDetail);
|
|
41
|
-
}
|
|
42
|
-
/**
|
|
43
|
-
* Dispatch input-related events with consistent structure
|
|
44
|
-
* Common pattern for form components
|
|
45
|
-
*/
|
|
46
|
-
dispatchInputEvent(eventName, detail) {
|
|
47
|
-
const inputDetail = Object.assign({ target: detail.target || this, value: detail.value, originalEvent: detail.originalEvent }, detail);
|
|
48
|
-
this.dispatchCustomEvent(eventName, inputDetail);
|
|
49
|
-
}
|
|
50
|
-
/**
|
|
51
|
-
* Dispatch focus-related events with cursor and selection info
|
|
52
|
-
*/
|
|
53
|
-
dispatchFocusEvent(eventName, detail) {
|
|
54
|
-
const focusDetail = Object.assign({ target: detail.target || this, value: detail.value, focused: detail.focused, cursorPosition: detail.cursorPosition, selectedText: detail.selectedText }, detail);
|
|
55
|
-
this.dispatchCustomEvent(eventName, focusDetail);
|
|
56
|
-
}
|
|
57
|
-
/**
|
|
58
|
-
* Dispatch validation events with error information
|
|
59
|
-
*/
|
|
60
|
-
dispatchValidationEvent(eventName, detail) {
|
|
61
|
-
var _a;
|
|
62
|
-
const validationDetail = Object.assign({ target: detail.target || this, value: detail.value, isValid: (_a = detail.isValid) !== null && _a !== void 0 ? _a : false, error: detail.error }, detail);
|
|
63
|
-
this.dispatchCustomEvent(eventName, validationDetail);
|
|
64
|
-
}
|
|
65
|
-
/**
|
|
66
|
-
* Dispatch action events (copy, clear, etc.)
|
|
67
|
-
*/
|
|
68
|
-
dispatchActionEvent(eventName, detail) {
|
|
69
|
-
const actionDetail = Object.assign({ target: detail.target || this, action: detail.action, previousValue: detail.previousValue, newValue: detail.newValue }, detail);
|
|
70
|
-
this.dispatchCustomEvent(eventName, actionDetail);
|
|
71
|
-
}
|
|
72
|
-
/**
|
|
73
|
-
* Standard readonly key filtering - reusable across components
|
|
74
|
-
*/
|
|
75
|
-
isReadonlyKeyAllowed(keyDownEvent) {
|
|
76
|
-
const allowedReadonlyKeys = [
|
|
77
|
-
'Tab', 'Escape', 'ArrowLeft', 'ArrowRight', 'ArrowUp', 'ArrowDown',
|
|
78
|
-
'Home', 'End', 'PageUp', 'PageDown'
|
|
79
|
-
];
|
|
80
|
-
if (keyDownEvent.ctrlKey || keyDownEvent.metaKey) {
|
|
81
|
-
const allowedCombinations = ['KeyA', 'KeyC'];
|
|
82
|
-
return allowedCombinations.includes(keyDownEvent.code);
|
|
83
|
-
}
|
|
84
|
-
return allowedReadonlyKeys.includes(keyDownEvent.key);
|
|
85
|
-
}
|
|
86
|
-
/**
|
|
87
|
-
* Handle common activation keys (Enter/Space)
|
|
88
|
-
*/
|
|
89
|
-
isActivationKey(keyDownEvent) {
|
|
90
|
-
return keyDownEvent.key === 'Enter' || keyDownEvent.key === ' ';
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
return EventHandlerMixinClass;
|
|
94
|
-
};
|
|
95
|
-
//# sourceMappingURL=event-handler-mixin.js.map
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright 2023 Nuraly, Laabidi Aymen
|
|
4
|
-
* SPDX-License-Identifier: MIT
|
|
5
|
-
*/
|
|
6
|
-
export { NuralyUIBaseMixin, BaseMixin, type NuralyUIBaseElement } from './base-mixin.js';
|
|
7
|
-
export { ThemeAwareMixin, type ThemeAware } from './theme-mixin.js';
|
|
8
|
-
export { DependencyValidationMixin, type DependencyAware } from './dependency-mixin.js';
|
|
9
|
-
export { EventHandlerMixin, type EventHandlerCapable } from './event-handler-mixin.js';
|
|
10
|
-
export { throttle, debounce, rafThrottle } from './utils.js';
|
|
11
|
-
export * from './controllers/index.js';
|
|
12
|
-
export * from './validation.types.js';
|
|
13
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright 2023 Nuraly, Laabidi Aymen
|
|
4
|
-
* SPDX-License-Identifier: MIT
|
|
5
|
-
*/
|
|
6
|
-
// Export all shared mixins and utilities
|
|
7
|
-
export { NuralyUIBaseMixin, BaseMixin } from './base-mixin.js';
|
|
8
|
-
export { ThemeAwareMixin } from './theme-mixin.js';
|
|
9
|
-
export { DependencyValidationMixin } from './dependency-mixin.js';
|
|
10
|
-
export { EventHandlerMixin } from './event-handler-mixin.js';
|
|
11
|
-
// Export utility functions
|
|
12
|
-
export { throttle, debounce, rafThrottle } from './utils.js';
|
|
13
|
-
// Export shared controllers
|
|
14
|
-
export * from './controllers/index.js';
|
|
15
|
-
// Export shared validation types
|
|
16
|
-
export * from './validation.types.js';
|
|
17
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright 2023 Nuraly, Laabidi Aymen
|
|
4
|
-
* SPDX-License-Identifier: MIT
|
|
5
|
-
*/
|
|
6
|
-
import { LitElement } from 'lit';
|
|
7
|
-
/**
|
|
8
|
-
* Theme detection and management mixin for Lit components
|
|
9
|
-
* Provides data-theme attribute detection with system fallback
|
|
10
|
-
* Supports multiple design systems (Carbon, Polaris, etc.)
|
|
11
|
-
*/
|
|
12
|
-
export interface ThemeAware {
|
|
13
|
-
currentTheme: string;
|
|
14
|
-
currentDesignSystem: 'carbon' | 'default';
|
|
15
|
-
}
|
|
16
|
-
declare type Constructor<T = {}> = new (...args: any[]) => T;
|
|
17
|
-
/**
|
|
18
|
-
* Mixin that adds theme management functionality to LitElement components
|
|
19
|
-
*
|
|
20
|
-
* @param superClass - The base class to extend (typically LitElement)
|
|
21
|
-
* @returns Enhanced class with theme management capabilities
|
|
22
|
-
*
|
|
23
|
-
* @example
|
|
24
|
-
* ```typescript
|
|
25
|
-
* @customElement('my-component')
|
|
26
|
-
* export class MyComponent extends ThemeAwareMixin(LitElement) {
|
|
27
|
-
* render() {
|
|
28
|
-
* return html`<div data-theme="${this.currentTheme}">Content</div>`;
|
|
29
|
-
* }
|
|
30
|
-
* }
|
|
31
|
-
* ```
|
|
32
|
-
*/
|
|
33
|
-
export declare const ThemeAwareMixin: <T extends Constructor<LitElement>>(superClass: T) => Constructor<ThemeAware> & T;
|
|
34
|
-
/**
|
|
35
|
-
* Standalone theme detection utility function
|
|
36
|
-
* For components that don't want to use the mixin approach
|
|
37
|
-
*
|
|
38
|
-
* @param element - The element to start theme detection from
|
|
39
|
-
* @returns The detected theme ('light' or 'dark')
|
|
40
|
-
*/
|
|
41
|
-
export declare function detectTheme(element: Element): 'light' | 'dark';
|
|
42
|
-
/**
|
|
43
|
-
* Standalone design system detection utility function
|
|
44
|
-
* For components that don't want to use the mixin approach
|
|
45
|
-
*
|
|
46
|
-
* @param element - The element to start detection from
|
|
47
|
-
* @returns The detected design system
|
|
48
|
-
*/
|
|
49
|
-
export declare function detectDesignSystem(element: Element): 'carbon' | 'default';
|
|
50
|
-
/**
|
|
51
|
-
* CSS template literal helper for theme-aware styles
|
|
52
|
-
* Generates CSS with both data-theme selectors and system fallback
|
|
53
|
-
*
|
|
54
|
-
* @param lightThemeVars - CSS custom properties for light theme
|
|
55
|
-
* @param darkThemeVars - CSS custom properties for dark theme
|
|
56
|
-
* @returns CSS template literal
|
|
57
|
-
*
|
|
58
|
-
* @example
|
|
59
|
-
* ```typescript
|
|
60
|
-
* import { css } from 'lit';
|
|
61
|
-
* import { createThemeStyles } from '../shared/theme-mixin.js';
|
|
62
|
-
*
|
|
63
|
-
* const styles = css`
|
|
64
|
-
* ${createThemeStyles(
|
|
65
|
-
* css`--color: black; --bg: white;`,
|
|
66
|
-
* css`--color: white; --bg: black;`
|
|
67
|
-
* )}
|
|
68
|
-
*
|
|
69
|
-
* .content {
|
|
70
|
-
* color: var(--color);
|
|
71
|
-
* background: var(--bg);
|
|
72
|
-
* }
|
|
73
|
-
* `;
|
|
74
|
-
* ```
|
|
75
|
-
*/
|
|
76
|
-
export declare function createThemeStyles(lightThemeVars: any, darkThemeVars: any): string;
|
|
77
|
-
export {};
|
|
78
|
-
//# sourceMappingURL=theme-mixin.d.ts.map
|
|
@@ -1,194 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright 2023 Nuraly, Laabidi Aymen
|
|
4
|
-
* SPDX-License-Identifier: MIT
|
|
5
|
-
*/
|
|
6
|
-
/**
|
|
7
|
-
* Mixin that adds theme management functionality to LitElement components
|
|
8
|
-
*
|
|
9
|
-
* @param superClass - The base class to extend (typically LitElement)
|
|
10
|
-
* @returns Enhanced class with theme management capabilities
|
|
11
|
-
*
|
|
12
|
-
* @example
|
|
13
|
-
* ```typescript
|
|
14
|
-
* @customElement('my-component')
|
|
15
|
-
* export class MyComponent extends ThemeAwareMixin(LitElement) {
|
|
16
|
-
* render() {
|
|
17
|
-
* return html`<div data-theme="${this.currentTheme}">Content</div>`;
|
|
18
|
-
* }
|
|
19
|
-
* }
|
|
20
|
-
* ```
|
|
21
|
-
*/
|
|
22
|
-
export const ThemeAwareMixin = (superClass) => {
|
|
23
|
-
class ThemeAwareClass extends superClass {
|
|
24
|
-
constructor() {
|
|
25
|
-
super(...arguments);
|
|
26
|
-
this.handleSystemThemeChange = () => {
|
|
27
|
-
// Only trigger update if no explicit data-theme is set
|
|
28
|
-
if (!this.closest('[data-theme]') && !document.documentElement.hasAttribute('data-theme')) {
|
|
29
|
-
this.requestUpdate();
|
|
30
|
-
}
|
|
31
|
-
};
|
|
32
|
-
}
|
|
33
|
-
connectedCallback() {
|
|
34
|
-
super.connectedCallback();
|
|
35
|
-
this.setupThemeObserver();
|
|
36
|
-
this.setupDesignSystemObserver();
|
|
37
|
-
this.setupSystemThemeListener();
|
|
38
|
-
}
|
|
39
|
-
disconnectedCallback() {
|
|
40
|
-
var _a, _b, _c;
|
|
41
|
-
super.disconnectedCallback();
|
|
42
|
-
(_a = this.themeObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
|
|
43
|
-
(_b = this.designSystemObserver) === null || _b === void 0 ? void 0 : _b.disconnect();
|
|
44
|
-
(_c = this.mediaQuery) === null || _c === void 0 ? void 0 : _c.removeEventListener('change', this.handleSystemThemeChange);
|
|
45
|
-
}
|
|
46
|
-
/**
|
|
47
|
-
* Gets the current theme by checking data-theme attribute in DOM hierarchy
|
|
48
|
-
* Falls back to system preference if no data-theme is found
|
|
49
|
-
* Now supports all theme variants: light, dark, carbon-light, carbon-dark, default, default-dark
|
|
50
|
-
*/
|
|
51
|
-
get currentTheme() {
|
|
52
|
-
var _a, _b;
|
|
53
|
-
// Check for data-theme attribute starting from this element and going up
|
|
54
|
-
const dataTheme = ((_a = this.closest('[data-theme]')) === null || _a === void 0 ? void 0 : _a.getAttribute('data-theme')) ||
|
|
55
|
-
document.documentElement.getAttribute('data-theme');
|
|
56
|
-
if (dataTheme) {
|
|
57
|
-
return dataTheme;
|
|
58
|
-
}
|
|
59
|
-
// Fallback to system preference
|
|
60
|
-
if ((_b = window.matchMedia) === null || _b === void 0 ? void 0 : _b.call(window, '(prefers-color-scheme: dark)').matches) {
|
|
61
|
-
return 'dark';
|
|
62
|
-
}
|
|
63
|
-
return 'light';
|
|
64
|
-
}
|
|
65
|
-
/**
|
|
66
|
-
* Gets the current design system by checking design-system attribute in DOM hierarchy
|
|
67
|
-
* Falls back to 'carbon' as default
|
|
68
|
-
*/
|
|
69
|
-
get currentDesignSystem() {
|
|
70
|
-
var _a;
|
|
71
|
-
// Check for design-system attribute starting from this element and going up
|
|
72
|
-
const designSystem = ((_a = this.closest('[design-system]')) === null || _a === void 0 ? void 0 : _a.getAttribute('design-system')) ||
|
|
73
|
-
document.documentElement.getAttribute('design-system');
|
|
74
|
-
if (designSystem === 'carbon') {
|
|
75
|
-
return designSystem;
|
|
76
|
-
}
|
|
77
|
-
return 'default';
|
|
78
|
-
}
|
|
79
|
-
setupThemeObserver() {
|
|
80
|
-
// Watch for data-theme changes on document
|
|
81
|
-
this.themeObserver = new MutationObserver(() => {
|
|
82
|
-
this.requestUpdate();
|
|
83
|
-
});
|
|
84
|
-
// Observe document element for data-theme changes
|
|
85
|
-
this.themeObserver.observe(document.documentElement, {
|
|
86
|
-
attributes: true,
|
|
87
|
-
attributeFilter: ['data-theme']
|
|
88
|
-
});
|
|
89
|
-
}
|
|
90
|
-
setupDesignSystemObserver() {
|
|
91
|
-
// Watch for design-system changes on document
|
|
92
|
-
this.designSystemObserver = new MutationObserver(() => {
|
|
93
|
-
this.requestUpdate();
|
|
94
|
-
});
|
|
95
|
-
// Observe document element for design-system changes
|
|
96
|
-
this.designSystemObserver.observe(document.documentElement, {
|
|
97
|
-
attributes: true,
|
|
98
|
-
attributeFilter: ['design-system']
|
|
99
|
-
});
|
|
100
|
-
}
|
|
101
|
-
setupSystemThemeListener() {
|
|
102
|
-
if (window.matchMedia) {
|
|
103
|
-
this.mediaQuery = window.matchMedia('(prefers-color-scheme: dark)');
|
|
104
|
-
this.mediaQuery.addEventListener('change', this.handleSystemThemeChange);
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
return ThemeAwareClass;
|
|
109
|
-
};
|
|
110
|
-
/**
|
|
111
|
-
* Standalone theme detection utility function
|
|
112
|
-
* For components that don't want to use the mixin approach
|
|
113
|
-
*
|
|
114
|
-
* @param element - The element to start theme detection from
|
|
115
|
-
* @returns The detected theme ('light' or 'dark')
|
|
116
|
-
*/
|
|
117
|
-
export function detectTheme(element) {
|
|
118
|
-
var _a, _b;
|
|
119
|
-
// Check for data-theme attribute starting from this element and going up
|
|
120
|
-
const dataTheme = ((_a = element.closest('[data-theme]')) === null || _a === void 0 ? void 0 : _a.getAttribute('data-theme')) ||
|
|
121
|
-
document.documentElement.getAttribute('data-theme');
|
|
122
|
-
if (dataTheme === 'dark' || dataTheme === 'light') {
|
|
123
|
-
return dataTheme;
|
|
124
|
-
}
|
|
125
|
-
// Fallback to system preference
|
|
126
|
-
if ((_b = window.matchMedia) === null || _b === void 0 ? void 0 : _b.call(window, '(prefers-color-scheme: dark)').matches) {
|
|
127
|
-
return 'dark';
|
|
128
|
-
}
|
|
129
|
-
return 'light';
|
|
130
|
-
}
|
|
131
|
-
/**
|
|
132
|
-
* Standalone design system detection utility function
|
|
133
|
-
* For components that don't want to use the mixin approach
|
|
134
|
-
*
|
|
135
|
-
* @param element - The element to start detection from
|
|
136
|
-
* @returns The detected design system
|
|
137
|
-
*/
|
|
138
|
-
export function detectDesignSystem(element) {
|
|
139
|
-
var _a;
|
|
140
|
-
// Check for design-system attribute starting from this element and going up
|
|
141
|
-
const designSystem = ((_a = element.closest('[design-system]')) === null || _a === void 0 ? void 0 : _a.getAttribute('design-system')) ||
|
|
142
|
-
document.documentElement.getAttribute('design-system');
|
|
143
|
-
if (designSystem === 'carbon') {
|
|
144
|
-
return designSystem;
|
|
145
|
-
}
|
|
146
|
-
return 'default';
|
|
147
|
-
}
|
|
148
|
-
/**
|
|
149
|
-
* CSS template literal helper for theme-aware styles
|
|
150
|
-
* Generates CSS with both data-theme selectors and system fallback
|
|
151
|
-
*
|
|
152
|
-
* @param lightThemeVars - CSS custom properties for light theme
|
|
153
|
-
* @param darkThemeVars - CSS custom properties for dark theme
|
|
154
|
-
* @returns CSS template literal
|
|
155
|
-
*
|
|
156
|
-
* @example
|
|
157
|
-
* ```typescript
|
|
158
|
-
* import { css } from 'lit';
|
|
159
|
-
* import { createThemeStyles } from '../shared/theme-mixin.js';
|
|
160
|
-
*
|
|
161
|
-
* const styles = css`
|
|
162
|
-
* ${createThemeStyles(
|
|
163
|
-
* css`--color: black; --bg: white;`,
|
|
164
|
-
* css`--color: white; --bg: black;`
|
|
165
|
-
* )}
|
|
166
|
-
*
|
|
167
|
-
* .content {
|
|
168
|
-
* color: var(--color);
|
|
169
|
-
* background: var(--bg);
|
|
170
|
-
* }
|
|
171
|
-
* `;
|
|
172
|
-
* ```
|
|
173
|
-
*/
|
|
174
|
-
export function createThemeStyles(lightThemeVars, darkThemeVars) {
|
|
175
|
-
return `
|
|
176
|
-
/* Light theme (default) */
|
|
177
|
-
:host {
|
|
178
|
-
${lightThemeVars}
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
/* Dark theme using data-theme attribute */
|
|
182
|
-
:host([data-theme="dark"]) {
|
|
183
|
-
${darkThemeVars}
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
/* System theme fallback for dark preference */
|
|
187
|
-
@media (prefers-color-scheme: dark) {
|
|
188
|
-
:host(:not([data-theme])) {
|
|
189
|
-
${darkThemeVars}
|
|
190
|
-
}
|
|
191
|
-
}
|
|
192
|
-
`;
|
|
193
|
-
}
|
|
194
|
-
//# sourceMappingURL=theme-mixin.js.map
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright 2023 Nuraly, Laabidi Aymen
|
|
4
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
5
|
-
*/
|
|
6
|
-
/**
|
|
7
|
-
* Theme utilities and type definitions
|
|
8
|
-
*
|
|
9
|
-
* NOTE: CSS theme files are in the @nuralyui/themes package
|
|
10
|
-
* This file only contains TypeScript utilities and types
|
|
11
|
-
*/
|
|
12
|
-
export declare const THEME_VARIANTS: {
|
|
13
|
-
readonly 'default-light': "Default Light";
|
|
14
|
-
readonly 'default-dark': "Default Dark";
|
|
15
|
-
readonly 'carbon-light': "Carbon Light";
|
|
16
|
-
readonly 'carbon-dark': "Carbon Dark";
|
|
17
|
-
readonly light: "Default Light";
|
|
18
|
-
readonly dark: "Default Dark";
|
|
19
|
-
};
|
|
20
|
-
export declare type ThemeVariant = keyof typeof THEME_VARIANTS;
|
|
21
|
-
/**
|
|
22
|
-
* Utility function to apply theme to an element
|
|
23
|
-
* @param element - The element to apply the theme to
|
|
24
|
-
* @param theme - The theme variant to apply
|
|
25
|
-
*/
|
|
26
|
-
export declare function applyTheme(element: HTMLElement, theme: ThemeVariant): void;
|
|
27
|
-
/**
|
|
28
|
-
* Utility function to get current theme from an element or its parents
|
|
29
|
-
* @param element - The element to check for theme
|
|
30
|
-
* @returns The current theme variant or null if not found
|
|
31
|
-
*/
|
|
32
|
-
export declare function getCurrentTheme(element: HTMLElement): ThemeVariant | null;
|
|
33
|
-
/**
|
|
34
|
-
* Utility function to toggle between light and dark variants of the same theme
|
|
35
|
-
* @param element - The element to toggle theme on
|
|
36
|
-
*/
|
|
37
|
-
export declare function toggleThemeVariant(element: HTMLElement): void;
|
|
38
|
-
/**
|
|
39
|
-
* Get the theme system name from a theme variant
|
|
40
|
-
* @param theme - The theme variant
|
|
41
|
-
* @returns The theme system name ('carbon' or 'default')
|
|
42
|
-
*/
|
|
43
|
-
export declare function getThemeSystem(theme: ThemeVariant | null): 'carbon' | 'default';
|
|
44
|
-
//# sourceMappingURL=themes.d.ts.map
|