@edsis/angular 22.1.3 → 22.2.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/LICENSE +21 -0
- package/README.md +87 -399
- package/SECURITY.md +18 -0
- package/SUPPORT.md +15 -0
- package/chart/README.md +272 -0
- package/component/README.md +89 -0
- package/component/accordion/README.md +195 -0
- package/component/alert/README.md +184 -0
- package/component/alert-dialog/README.md +255 -0
- package/component/aspect-ratio/README.md +116 -0
- package/component/avatar/README.md +182 -0
- package/component/badge/README.md +143 -0
- package/component/breadcrumb/README.md +223 -0
- package/component/button/README.md +141 -0
- package/component/button-group/README.md +214 -0
- package/component/calendar/README.md +125 -0
- package/component/card/README.md +232 -0
- package/component/carousel/README.md +276 -0
- package/component/checkbox/README.md +153 -0
- package/component/collapsible/README.md +216 -0
- package/component/combobox/README.md +202 -0
- package/component/command/README.md +287 -0
- package/component/composer/README.md +241 -0
- package/component/context-menu/README.md +268 -0
- package/component/date-picker/README.md +202 -0
- package/component/dialog/README.md +276 -0
- package/component/drawer/README.md +146 -0
- package/component/dropdown-menu/README.md +336 -0
- package/component/editor/README.md +152 -0
- package/component/empty/README.md +193 -0
- package/component/form/README.md +216 -0
- package/component/hover-card/README.md +150 -0
- package/component/icon/README.md +52 -0
- package/component/input/README.md +160 -0
- package/component/input-group/README.md +245 -0
- package/component/input-otp/README.md +331 -0
- package/component/item/README.md +254 -0
- package/component/kanban/README.md +81 -0
- package/component/kbd/README.md +141 -0
- package/component/label/README.md +137 -0
- package/component/menubar/README.md +270 -0
- package/component/native-select/README.md +176 -0
- package/component/navigation-menu/README.md +165 -0
- package/component/pagination/README.md +151 -0
- package/component/pillbox/README.md +68 -0
- package/component/popover/README.md +54 -0
- package/component/progress/README.md +160 -0
- package/component/radio/README.md +212 -0
- package/component/resizable/README.md +178 -0
- package/component/scroll-area/README.md +150 -0
- package/component/select/README.md +228 -0
- package/component/separator/README.md +175 -0
- package/component/sheet/README.md +190 -0
- package/component/skeleton/README.md +158 -0
- package/component/slider/README.md +207 -0
- package/component/spinner/README.md +160 -0
- package/component/switch/README.md +170 -0
- package/component/table/README.md +292 -0
- package/component/tabs/README.md +220 -0
- package/component/textarea/README.md +169 -0
- package/component/timeline/README.md +94 -0
- package/component/toast/README.md +173 -0
- package/component/toggle/README.md +133 -0
- package/component/toggle-group/README.md +234 -0
- package/component/tooltip/README.md +230 -0
- package/fesm2022/edsis-angular-chart-area.mjs +508 -0
- package/fesm2022/edsis-angular-chart-bar.mjs +946 -0
- package/fesm2022/edsis-angular-chart-core.mjs +1282 -0
- package/fesm2022/edsis-angular-chart-line.mjs +544 -0
- package/fesm2022/edsis-angular-chart-pie.mjs +524 -0
- package/fesm2022/edsis-angular-chart-primitives.mjs +1647 -0
- package/fesm2022/edsis-angular-chart-radar.mjs +693 -0
- package/fesm2022/edsis-angular-chart-radial.mjs +542 -0
- package/fesm2022/edsis-angular-chart-scatter.mjs +486 -0
- package/fesm2022/edsis-angular-chart.mjs +3 -0
- package/fesm2022/edsis-angular-component-accordion.mjs +513 -0
- package/fesm2022/edsis-angular-component-alert-dialog.mjs +1001 -0
- package/fesm2022/edsis-angular-component-alert.mjs +268 -0
- package/fesm2022/edsis-angular-component-aspect-ratio.mjs +80 -0
- package/fesm2022/edsis-angular-component-avatar.mjs +410 -0
- package/fesm2022/edsis-angular-component-badge.mjs +111 -0
- package/fesm2022/edsis-angular-component-breadcrumb.mjs +464 -0
- package/fesm2022/edsis-angular-component-button-group.mjs +252 -0
- package/fesm2022/edsis-angular-component-button.mjs +155 -0
- package/fesm2022/edsis-angular-component-calendar.mjs +835 -0
- package/fesm2022/edsis-angular-component-card.mjs +460 -0
- package/fesm2022/edsis-angular-component-carousel.mjs +700 -0
- package/fesm2022/edsis-angular-component-checkbox.mjs +398 -0
- package/fesm2022/edsis-angular-component-collapsible.mjs +305 -0
- package/fesm2022/edsis-angular-component-combobox.mjs +544 -0
- package/fesm2022/edsis-angular-component-command.mjs +815 -0
- package/fesm2022/edsis-angular-component-composer.mjs +840 -0
- package/fesm2022/edsis-angular-component-context-menu.mjs +197 -0
- package/fesm2022/edsis-angular-component-date-picker.mjs +798 -0
- package/fesm2022/edsis-angular-component-dialog.mjs +798 -0
- package/fesm2022/edsis-angular-component-drawer.mjs +2 -0
- package/fesm2022/edsis-angular-component-dropdown-menu.mjs +1259 -0
- package/fesm2022/edsis-angular-component-editor.mjs +1000 -0
- package/fesm2022/edsis-angular-component-empty.mjs +351 -0
- package/fesm2022/edsis-angular-component-form.mjs +821 -0
- package/fesm2022/edsis-angular-component-hover-card.mjs +486 -0
- package/fesm2022/edsis-angular-component-icon.mjs +253 -0
- package/fesm2022/edsis-angular-component-input-group.mjs +453 -0
- package/fesm2022/edsis-angular-component-input-otp.mjs +957 -0
- package/fesm2022/edsis-angular-component-input.mjs +87 -0
- package/fesm2022/edsis-angular-component-item.mjs +720 -0
- package/fesm2022/edsis-angular-component-kanban.mjs +812 -0
- package/fesm2022/edsis-angular-component-kbd.mjs +124 -0
- package/fesm2022/edsis-angular-component-label.mjs +82 -0
- package/fesm2022/edsis-angular-component-menubar.mjs +481 -0
- package/fesm2022/edsis-angular-component-native-select.mjs +168 -0
- package/fesm2022/edsis-angular-component-navigation-menu.mjs +685 -0
- package/fesm2022/edsis-angular-component-pagination.mjs +425 -0
- package/fesm2022/edsis-angular-component-pillbox.mjs +1679 -0
- package/fesm2022/edsis-angular-component-popover.mjs +292 -0
- package/fesm2022/edsis-angular-component-progress.mjs +184 -0
- package/fesm2022/edsis-angular-component-radio.mjs +491 -0
- package/fesm2022/edsis-angular-component-resizable.mjs +703 -0
- package/fesm2022/edsis-angular-component-scroll-area.mjs +133 -0
- package/fesm2022/edsis-angular-component-segmented-control.mjs +408 -0
- package/fesm2022/edsis-angular-component-select.mjs +743 -0
- package/fesm2022/edsis-angular-component-separator.mjs +102 -0
- package/fesm2022/edsis-angular-component-sheet.mjs +874 -0
- package/fesm2022/edsis-angular-component-skeleton.mjs +62 -0
- package/fesm2022/edsis-angular-component-slider.mjs +676 -0
- package/fesm2022/edsis-angular-component-spinner.mjs +157 -0
- package/fesm2022/edsis-angular-component-switch.mjs +361 -0
- package/fesm2022/edsis-angular-component-table.mjs +446 -0
- package/fesm2022/edsis-angular-component-tabs.mjs +592 -0
- package/fesm2022/edsis-angular-component-textarea.mjs +85 -0
- package/fesm2022/edsis-angular-component-timeline.mjs +619 -0
- package/fesm2022/edsis-angular-component-toast.mjs +231 -0
- package/fesm2022/edsis-angular-component-toggle-group.mjs +579 -0
- package/fesm2022/edsis-angular-component-toggle.mjs +189 -0
- package/fesm2022/edsis-angular-component-tooltip.mjs +804 -0
- package/fesm2022/edsis-angular-component-utils-core.mjs +181 -0
- package/fesm2022/edsis-angular-component-utils-overlay.mjs +54 -0
- package/fesm2022/edsis-angular-component-utils-scale.mjs +76 -0
- package/fesm2022/edsis-angular-component-utils.mjs +2 -0
- package/fesm2022/edsis-angular-component.mjs +0 -0
- package/fesm2022/edsis-angular-navigation-core.mjs +15 -0
- package/fesm2022/edsis-angular-navigation-icon.mjs +35 -0
- package/fesm2022/edsis-angular-navigation-navigation-badge-count.component-BWWWaUgy.mjs +234 -0
- package/fesm2022/edsis-angular-navigation-navigation-dockbar-menu.component-Bx2bxTID.mjs +834 -0
- package/fesm2022/edsis-angular-navigation-navigation-entry-grid.component-Duzt1ffz.mjs +823 -0
- package/fesm2022/edsis-angular-navigation-navigation-flyout-menu.component-cJ8Q1vM6.mjs +670 -0
- package/fesm2022/edsis-angular-navigation-navigation-horizontal.component-CDQ1wt2_.mjs +689 -0
- package/fesm2022/edsis-angular-navigation-navigation-item.component-C1VzerJp.mjs +1522 -0
- package/fesm2022/edsis-angular-navigation-navigation-list.component-BPYLfrID.mjs +346 -0
- package/fesm2022/edsis-angular-navigation-service.mjs +558 -0
- package/fesm2022/edsis-angular-navigation-types.mjs +151 -0
- package/fesm2022/edsis-angular-navigation.mjs +3338 -0
- package/fesm2022/edsis-angular-sdk.mjs +100 -0
- package/fesm2022/edsis-angular-theme-component-settings.mjs +1877 -0
- package/fesm2022/edsis-angular-theme-layout-services.mjs +252 -0
- package/fesm2022/edsis-angular-theme-layout-types.mjs +45 -0
- package/fesm2022/edsis-angular-theme-layout-wrapper.mjs +2568 -0
- package/fesm2022/edsis-angular-theme-layout.mjs +1089 -0
- package/fesm2022/edsis-angular-theme-page-core.mjs +315 -0
- package/fesm2022/edsis-angular-theme-page-filter.mjs +409 -0
- package/fesm2022/edsis-angular-theme-page-overview.mjs +88 -0
- package/fesm2022/edsis-angular-theme-page-root.mjs +693 -0
- package/fesm2022/edsis-angular-theme-page-side.mjs +342 -0
- package/fesm2022/edsis-angular-theme-page-slots.mjs +258 -0
- package/fesm2022/edsis-angular-theme-page.mjs +7 -0
- package/fesm2022/edsis-angular-theme-shell-services.mjs +231 -0
- package/fesm2022/edsis-angular-theme-shell-types.mjs +102 -0
- package/fesm2022/edsis-angular-theme-shell.mjs +1352 -0
- package/fesm2022/edsis-angular-theme-styles.mjs +572 -0
- package/fesm2022/edsis-angular-theme.mjs +0 -0
- package/fesm2022/edsis-angular.mjs +5 -8
- package/navigation/README.md +576 -0
- package/package.json +477 -52
- package/sdk/README.md +212 -0
- package/sdk/schematics/collection.json +20 -0
- package/sdk/schematics/init/index.js +83 -0
- package/sdk/schematics/init/schema.json +19 -0
- package/sdk/schematics/ng-add/index.js +147 -0
- package/sdk/schematics/ng-add/schema.json +14 -0
- package/sdk/schematics/package.json +3 -0
- package/sdk/schematics/sdk/index.js +175 -0
- package/sdk/schematics/sdk/schema.json +19 -0
- package/sdk/sdk.config.example.json +24 -0
- package/sdk/src/config/loader.js +43 -0
- package/sdk/src/config/schema.js +59 -0
- package/sdk/src/emit/client.js +251 -0
- package/sdk/src/emit/metadata.js +310 -0
- package/sdk/src/emit/models.js +104 -0
- package/sdk/src/emit/navigation.js +56 -0
- package/sdk/src/emit/operations.js +118 -0
- package/sdk/src/emit/public-api.js +54 -0
- package/sdk/src/emit/services.js +110 -0
- package/sdk/src/engine.js +67 -0
- package/sdk/src/layout/per-domain.js +360 -0
- package/sdk/src/package.json +3 -0
- package/sdk/src/parser/bundle.js +25 -0
- package/sdk/src/parser/ir.js +429 -0
- package/sdk/src/parser/types.js +7 -0
- package/sdk/src/render/template.js +152 -0
- package/sdk/src/writer/index.js +286 -0
- package/theme/README.md +120 -0
- package/theme/component/settings/README.md +154 -0
- package/theme/layout/README.md +604 -0
- package/theme/page/README.md +505 -0
- package/theme/shell/README.md +344 -0
- package/theme/styles/README.md +202 -0
- package/theme/styles/css/base/components.css +577 -0
- package/theme/styles/css/base/index.css +14 -0
- package/theme/styles/css/base/package.css +9 -0
- package/theme/styles/css/base/prefers-dark.css +86 -0
- package/theme/styles/css/base/print.css +62 -0
- package/theme/styles/css/base/status.css +38 -0
- package/theme/styles/css/base/tailwind.css +208 -0
- package/theme/styles/css/base/theme.css +353 -0
- package/theme/styles/css/base/tokens.css +388 -0
- package/theme/styles/css/color/amber.css +72 -0
- package/theme/styles/css/color/blue.css +72 -0
- package/theme/styles/css/color/brand.css +38 -0
- package/theme/styles/css/color/cyan.css +72 -0
- package/theme/styles/css/color/emerald.css +72 -0
- package/theme/styles/css/color/fuchsia.css +72 -0
- package/theme/styles/css/color/green.css +72 -0
- package/theme/styles/css/color/index.css +19 -0
- package/theme/styles/css/color/indigo.css +72 -0
- package/theme/styles/css/color/lime.css +72 -0
- package/theme/styles/css/color/orange.css +72 -0
- package/theme/styles/css/color/pink.css +72 -0
- package/theme/styles/css/color/purple.css +72 -0
- package/theme/styles/css/color/red.css +72 -0
- package/theme/styles/css/color/rose.css +72 -0
- package/theme/styles/css/color/sky.css +72 -0
- package/theme/styles/css/color/teal.css +72 -0
- package/theme/styles/css/color/violet.css +72 -0
- package/theme/styles/css/color/yellow.css +72 -0
- package/theme/styles/css/fonts.css +85 -0
- package/theme/styles/css/index.css +18 -0
- package/theme/styles/css/neutral/gray.css +63 -0
- package/theme/styles/css/neutral/index.css +11 -0
- package/theme/styles/css/neutral/mauve.css +63 -0
- package/theme/styles/css/neutral/mist.css +63 -0
- package/theme/styles/css/neutral/neutral.css +63 -0
- package/theme/styles/css/neutral/olive.css +63 -0
- package/theme/styles/css/neutral/slate.css +63 -0
- package/theme/styles/css/neutral/stone.css +63 -0
- package/theme/styles/css/neutral/taupe.css +63 -0
- package/theme/styles/css/neutral/zinc.css +63 -0
- package/theme/styles/css/radius/index.css +30 -0
- package/theme/styles/css/space/index.css +20 -0
- package/types/edsis-angular-chart-area.d.ts +139 -0
- package/types/edsis-angular-chart-bar.d.ts +291 -0
- package/types/edsis-angular-chart-core.d.ts +822 -0
- package/types/edsis-angular-chart-line.d.ts +148 -0
- package/types/edsis-angular-chart-pie.d.ts +202 -0
- package/types/edsis-angular-chart-primitives.d.ts +360 -0
- package/types/edsis-angular-chart-radar.d.ts +198 -0
- package/types/edsis-angular-chart-radial.d.ts +187 -0
- package/types/edsis-angular-chart-scatter.d.ts +181 -0
- package/types/edsis-angular-chart.d.ts +3 -0
- package/types/edsis-angular-component-accordion.d.ts +139 -0
- package/types/edsis-angular-component-alert-dialog.d.ts +288 -0
- package/types/edsis-angular-component-alert.d.ts +72 -0
- package/types/edsis-angular-component-aspect-ratio.d.ts +20 -0
- package/types/edsis-angular-component-avatar.d.ts +111 -0
- package/types/edsis-angular-component-badge.d.ts +36 -0
- package/types/edsis-angular-component-breadcrumb.d.ts +85 -0
- package/types/edsis-angular-component-button-group.d.ts +50 -0
- package/types/edsis-angular-component-button.d.ts +44 -0
- package/types/edsis-angular-component-calendar.d.ts +150 -0
- package/types/edsis-angular-component-card.d.ts +123 -0
- package/types/edsis-angular-component-carousel.d.ts +155 -0
- package/types/edsis-angular-component-checkbox.d.ts +100 -0
- package/types/edsis-angular-component-collapsible.d.ts +68 -0
- package/types/edsis-angular-component-combobox.d.ts +105 -0
- package/types/edsis-angular-component-command.d.ts +215 -0
- package/types/edsis-angular-component-composer.d.ts +190 -0
- package/types/edsis-angular-component-context-menu.d.ts +64 -0
- package/types/edsis-angular-component-date-picker.d.ts +199 -0
- package/types/edsis-angular-component-dialog.d.ts +231 -0
- package/types/edsis-angular-component-drawer.d.ts +2 -0
- package/types/edsis-angular-component-dropdown-menu.d.ts +370 -0
- package/types/edsis-angular-component-editor.d.ts +234 -0
- package/types/edsis-angular-component-empty.d.ts +85 -0
- package/types/edsis-angular-component-form.d.ts +223 -0
- package/types/edsis-angular-component-hover-card.d.ts +133 -0
- package/types/edsis-angular-component-icon.d.ts +90 -0
- package/types/edsis-angular-component-input-group.d.ts +98 -0
- package/types/edsis-angular-component-input-otp.d.ts +249 -0
- package/types/edsis-angular-component-input.d.ts +31 -0
- package/types/edsis-angular-component-item.d.ts +169 -0
- package/types/edsis-angular-component-kanban.d.ts +165 -0
- package/types/edsis-angular-component-kbd.d.ts +25 -0
- package/types/edsis-angular-component-label.d.ts +19 -0
- package/types/edsis-angular-component-menubar.d.ts +123 -0
- package/types/edsis-angular-component-native-select.d.ts +39 -0
- package/types/edsis-angular-component-navigation-menu.d.ts +163 -0
- package/types/edsis-angular-component-pagination.d.ts +83 -0
- package/types/edsis-angular-component-pillbox.d.ts +380 -0
- package/types/edsis-angular-component-popover.d.ts +96 -0
- package/types/edsis-angular-component-progress.d.ts +45 -0
- package/types/edsis-angular-component-radio.d.ts +137 -0
- package/types/edsis-angular-component-resizable.d.ts +166 -0
- package/types/edsis-angular-component-scroll-area.d.ts +37 -0
- package/types/edsis-angular-component-segmented-control.d.ts +102 -0
- package/types/edsis-angular-component-select.d.ts +138 -0
- package/types/edsis-angular-component-separator.d.ts +26 -0
- package/types/edsis-angular-component-sheet.d.ts +240 -0
- package/types/edsis-angular-component-skeleton.d.ts +13 -0
- package/types/edsis-angular-component-slider.d.ts +148 -0
- package/types/edsis-angular-component-spinner.d.ts +31 -0
- package/types/edsis-angular-component-switch.d.ts +101 -0
- package/types/edsis-angular-component-table.d.ts +109 -0
- package/types/edsis-angular-component-tabs.d.ts +183 -0
- package/types/edsis-angular-component-textarea.d.ts +27 -0
- package/types/edsis-angular-component-timeline.d.ts +146 -0
- package/types/edsis-angular-component-toast.d.ts +60 -0
- package/types/edsis-angular-component-toggle-group.d.ts +161 -0
- package/types/edsis-angular-component-toggle.d.ts +47 -0
- package/types/edsis-angular-component-tooltip.d.ts +233 -0
- package/types/edsis-angular-component-utils-core.d.ts +175 -0
- package/types/edsis-angular-component-utils-overlay.d.ts +17 -0
- package/types/edsis-angular-component-utils-scale.d.ts +27 -0
- package/types/edsis-angular-component-utils.d.ts +2 -0
- package/types/edsis-angular-component.d.ts +1 -0
- package/types/edsis-angular-navigation-core.d.ts +55 -0
- package/types/edsis-angular-navigation-icon.d.ts +9 -0
- package/types/edsis-angular-navigation-service.d.ts +121 -0
- package/types/edsis-angular-navigation-types.d.ts +185 -0
- package/types/edsis-angular-navigation.d.ts +862 -0
- package/types/edsis-angular-sdk.d.ts +87 -0
- package/types/edsis-angular-theme-component-settings.d.ts +205 -0
- package/types/edsis-angular-theme-layout-services.d.ts +143 -0
- package/types/edsis-angular-theme-layout-types.d.ts +36 -0
- package/types/edsis-angular-theme-layout-wrapper.d.ts +670 -0
- package/types/edsis-angular-theme-layout.d.ts +218 -0
- package/types/edsis-angular-theme-page-core.d.ts +151 -0
- package/types/edsis-angular-theme-page-filter.d.ts +127 -0
- package/types/edsis-angular-theme-page-overview.d.ts +28 -0
- package/types/edsis-angular-theme-page-root.d.ts +172 -0
- package/types/edsis-angular-theme-page-side.d.ts +90 -0
- package/types/edsis-angular-theme-page-slots.d.ts +61 -0
- package/types/edsis-angular-theme-page.d.ts +7 -0
- package/types/edsis-angular-theme-shell-services.d.ts +188 -0
- package/types/edsis-angular-theme-shell-types.d.ts +102 -0
- package/types/edsis-angular-theme-shell.d.ts +178 -0
- package/types/edsis-angular-theme-styles.d.ts +295 -0
- package/types/edsis-angular-theme.d.ts +1 -0
- package/types/edsis-angular.d.ts +5 -2
- package/fesm2022/edsis-angular-block-shell.mjs +0 -1329
- package/fesm2022/edsis-angular-block-shell.mjs.map +0 -1
- package/fesm2022/edsis-angular-block-themes.mjs +0 -1007
- package/fesm2022/edsis-angular-block-themes.mjs.map +0 -1
- package/fesm2022/edsis-angular-module-auth.mjs +0 -2582
- package/fesm2022/edsis-angular-module-auth.mjs.map +0 -1
- package/fesm2022/edsis-angular-platform-mfe.mjs +0 -329
- package/fesm2022/edsis-angular-platform-mfe.mjs.map +0 -1
- package/fesm2022/edsis-angular-services-runtime.mjs +0 -385
- package/fesm2022/edsis-angular-services-runtime.mjs.map +0 -1
- package/fesm2022/edsis-angular.mjs.map +0 -1
- package/types/edsis-angular-block-shell.d.ts +0 -190
- package/types/edsis-angular-block-themes.d.ts +0 -94
- package/types/edsis-angular-module-auth.d.ts +0 -533
- package/types/edsis-angular-platform-mfe.d.ts +0 -126
- package/types/edsis-angular-services-runtime.d.ts +0 -118
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import { DestroyRef, InjectionToken, PLATFORM_ID, Service, computed, inject, makeEnvironmentProviders, signal } from "@angular/core";
|
|
3
|
+
import { SHELL_COLOR_STORAGE_KEY, SHELL_DEFAULT_COLOR, SHELL_DEFAULT_FRAME, SHELL_DEFAULT_MODE, SHELL_DEFAULT_WINDOW_STATE, SHELL_DEVICE_STORAGE_KEY, SHELL_FRAME_STORAGE_KEY, SHELL_MODE_STORAGE_KEY, defaultShellDeviceForMode, isShellColor, isShellDevice, isShellFrame, isShellMode, normalizeShellDevice } from "@edsis/angular/theme/shell/types";
|
|
4
|
+
import { isPlatformBrowser } from "@angular/common";
|
|
5
|
+
import { globalLocalStorage } from "@edsis/angular/component/utils/core";
|
|
6
|
+
const SHELL_WINDOW_BRIDGE = new InjectionToken("SHELL_WINDOW_BRIDGE");
|
|
7
|
+
const WEB_SHELL_WINDOW_BRIDGE = {
|
|
8
|
+
platform: "web",
|
|
9
|
+
device: () => null,
|
|
10
|
+
snapshot: () => ({
|
|
11
|
+
state: SHELL_DEFAULT_WINDOW_STATE,
|
|
12
|
+
focused: true
|
|
13
|
+
}),
|
|
14
|
+
minimize: () => void 0,
|
|
15
|
+
toggleMaximize: () => void 0,
|
|
16
|
+
close: () => void 0
|
|
17
|
+
};
|
|
18
|
+
function provideShellWindowBridge(bridge) {
|
|
19
|
+
return makeEnvironmentProviders([typeof bridge === "function" ? {
|
|
20
|
+
provide: SHELL_WINDOW_BRIDGE,
|
|
21
|
+
useFactory: bridge
|
|
22
|
+
} : {
|
|
23
|
+
provide: SHELL_WINDOW_BRIDGE,
|
|
24
|
+
useValue: bridge
|
|
25
|
+
}]);
|
|
26
|
+
}
|
|
27
|
+
function isTauriRuntime() {
|
|
28
|
+
const scope = globalThis;
|
|
29
|
+
return scope.__TAURI__ !== void 0 || scope.__TAURI_INTERNALS__ !== void 0;
|
|
30
|
+
}
|
|
31
|
+
function createTauriShellWindowBridge(options = {}) {
|
|
32
|
+
const resolveWindow = options.currentWindow ?? defaultCurrentWindow;
|
|
33
|
+
const resolvePlatform = options.platform ?? defaultPlatform;
|
|
34
|
+
const withWindow = async (command) => {
|
|
35
|
+
const handle = await resolveWindow();
|
|
36
|
+
if (handle) await command(handle);
|
|
37
|
+
};
|
|
38
|
+
return {
|
|
39
|
+
platform: "tauri",
|
|
40
|
+
async device() {
|
|
41
|
+
try {
|
|
42
|
+
return normalizeShellDevice(await resolvePlatform());
|
|
43
|
+
} catch {
|
|
44
|
+
return null;
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
async snapshot() {
|
|
48
|
+
const handle = await resolveWindow();
|
|
49
|
+
if (!handle) return {
|
|
50
|
+
state: "normal",
|
|
51
|
+
focused: true
|
|
52
|
+
};
|
|
53
|
+
const [fullscreen, maximized, focused] = await Promise.all([
|
|
54
|
+
handle.isFullscreen(),
|
|
55
|
+
handle.isMaximized(),
|
|
56
|
+
handle.isFocused?.() ?? Promise.resolve(true)
|
|
57
|
+
]);
|
|
58
|
+
return {
|
|
59
|
+
state: fullscreen ? "fullscreen" : maximized ? "maximized" : "normal",
|
|
60
|
+
focused
|
|
61
|
+
};
|
|
62
|
+
},
|
|
63
|
+
minimize: () => withWindow((handle) => handle.minimize()),
|
|
64
|
+
toggleMaximize: () => withWindow((handle) => handle.toggleMaximize()),
|
|
65
|
+
close: () => withWindow((handle) => handle.close()),
|
|
66
|
+
startDragging: () => withWindow((handle) => handle.startDragging()),
|
|
67
|
+
async watch(onChange) {
|
|
68
|
+
const handle = await resolveWindow();
|
|
69
|
+
if (!handle) return () => void 0;
|
|
70
|
+
const unsubscribes = await Promise.all([handle.onResized?.(onChange) ?? Promise.resolve(void 0), handle.onFocusChanged?.(onChange) ?? Promise.resolve(void 0)]);
|
|
71
|
+
return () => {
|
|
72
|
+
for (const unsubscribe of unsubscribes) unsubscribe?.();
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
function provideTauriShellWindowBridge(options = {}) {
|
|
78
|
+
return provideShellWindowBridge(() => createTauriShellWindowBridge(options));
|
|
79
|
+
}
|
|
80
|
+
function tauriGlobal() {
|
|
81
|
+
return globalThis.__TAURI__ ?? null;
|
|
82
|
+
}
|
|
83
|
+
function defaultCurrentWindow() {
|
|
84
|
+
return tauriGlobal()?.window?.getCurrentWindow?.() ?? null;
|
|
85
|
+
}
|
|
86
|
+
function defaultPlatform() {
|
|
87
|
+
const fromPlugin = tauriGlobal()?.os?.platform?.();
|
|
88
|
+
if (fromPlugin !== void 0) return fromPlugin;
|
|
89
|
+
const navigatorRef = globalThis.navigator;
|
|
90
|
+
return navigatorRef?.userAgent ?? navigatorRef?.platform ?? "";
|
|
91
|
+
}
|
|
92
|
+
var ShellService = class ShellService {
|
|
93
|
+
platformId = inject(PLATFORM_ID);
|
|
94
|
+
storage = globalLocalStorage(isPlatformBrowser(this.platformId));
|
|
95
|
+
destroyRef = inject(DestroyRef);
|
|
96
|
+
bridge = inject(SHELL_WINDOW_BRIDGE, { optional: true }) ?? WEB_SHELL_WINDOW_BRIDGE;
|
|
97
|
+
platform = this.bridge.platform;
|
|
98
|
+
isDesktopRuntime = this.bridge.platform !== "web";
|
|
99
|
+
modeState = signal(this.storedMode(), ...ngDevMode ? [{ debugName: "modeState" }] : /* istanbul ignore next */ []);
|
|
100
|
+
deviceState = signal(this.storedDevice(), ...ngDevMode ? [{ debugName: "deviceState" }] : /* istanbul ignore next */ []);
|
|
101
|
+
colorState = signal(this.storedColor(), ...ngDevMode ? [{ debugName: "colorState" }] : /* istanbul ignore next */ []);
|
|
102
|
+
frameState = signal(this.storedFrame(), ...ngDevMode ? [{ debugName: "frameState" }] : /* istanbul ignore next */ []);
|
|
103
|
+
reportedDeviceState = signal(null, ...ngDevMode ? [{ debugName: "reportedDeviceState" }] : /* istanbul ignore next */ []);
|
|
104
|
+
windowStateState = signal(SHELL_DEFAULT_WINDOW_STATE, ...ngDevMode ? [{ debugName: "windowStateState" }] : /* istanbul ignore next */ []);
|
|
105
|
+
focusedState = signal(true, ...ngDevMode ? [{ debugName: "focusedState" }] : /* istanbul ignore next */ []);
|
|
106
|
+
mode = this.modeState.asReadonly();
|
|
107
|
+
device = computed(() => this.deviceState() ?? this.reportedDeviceState() ?? defaultShellDeviceForMode(this.modeState()), ...ngDevMode ? [{ debugName: "device" }] : /* istanbul ignore next */ []);
|
|
108
|
+
color = this.colorState.asReadonly();
|
|
109
|
+
frame = this.frameState.asReadonly();
|
|
110
|
+
windowState = this.windowStateState.asReadonly();
|
|
111
|
+
focused = this.focusedState.asReadonly();
|
|
112
|
+
isMaximized = computed(() => this.windowStateState() === "maximized", ...ngDevMode ? [{ debugName: "isMaximized" }] : /* istanbul ignore next */ []);
|
|
113
|
+
isFullscreen = computed(() => this.windowStateState() === "fullscreen", ...ngDevMode ? [{ debugName: "isFullscreen" }] : /* istanbul ignore next */ []);
|
|
114
|
+
constructor() {
|
|
115
|
+
if (!isPlatformBrowser(this.platformId)) return;
|
|
116
|
+
this.sync();
|
|
117
|
+
this.watchWindow();
|
|
118
|
+
}
|
|
119
|
+
setMode(mode, options = {}) {
|
|
120
|
+
this.modeState.set(mode);
|
|
121
|
+
if (options.persist !== false) this.storage.write(SHELL_MODE_STORAGE_KEY, mode);
|
|
122
|
+
}
|
|
123
|
+
setDevice(device, options = {}) {
|
|
124
|
+
this.deviceState.set(device);
|
|
125
|
+
if (options.persist !== false) this.storage.write(SHELL_DEVICE_STORAGE_KEY, device);
|
|
126
|
+
}
|
|
127
|
+
setColor(color, options = {}) {
|
|
128
|
+
this.colorState.set(color);
|
|
129
|
+
if (options.persist !== false) this.storage.write(SHELL_COLOR_STORAGE_KEY, color);
|
|
130
|
+
}
|
|
131
|
+
setFrame(frame, options = {}) {
|
|
132
|
+
this.frameState.set(frame);
|
|
133
|
+
if (options.persist !== false) this.storage.write(SHELL_FRAME_STORAGE_KEY, frame);
|
|
134
|
+
}
|
|
135
|
+
registerMode(mode) {
|
|
136
|
+
if (!isShellMode(this.storage.read(SHELL_MODE_STORAGE_KEY))) this.setMode(mode, { persist: false });
|
|
137
|
+
}
|
|
138
|
+
registerDevice(device) {
|
|
139
|
+
if (!isShellDevice(this.storage.read(SHELL_DEVICE_STORAGE_KEY))) this.setDevice(device, { persist: false });
|
|
140
|
+
}
|
|
141
|
+
registerColor(color) {
|
|
142
|
+
if (!isShellColor(this.storage.read(SHELL_COLOR_STORAGE_KEY))) this.setColor(color, { persist: false });
|
|
143
|
+
}
|
|
144
|
+
registerFrame(frame) {
|
|
145
|
+
if (!isShellFrame(this.storage.read(SHELL_FRAME_STORAGE_KEY))) this.setFrame(frame, { persist: false });
|
|
146
|
+
}
|
|
147
|
+
async sync() {
|
|
148
|
+
try {
|
|
149
|
+
const [device, snapshot] = await Promise.all([this.bridge.device(), this.bridge.snapshot()]);
|
|
150
|
+
this.reportedDeviceState.set(device);
|
|
151
|
+
this.windowStateState.set(snapshot.state);
|
|
152
|
+
this.focusedState.set(snapshot.focused);
|
|
153
|
+
} catch {}
|
|
154
|
+
}
|
|
155
|
+
async minimize() {
|
|
156
|
+
await this.command(() => this.bridge.minimize());
|
|
157
|
+
}
|
|
158
|
+
async toggleMaximize() {
|
|
159
|
+
await this.command(() => this.bridge.toggleMaximize());
|
|
160
|
+
}
|
|
161
|
+
async close() {
|
|
162
|
+
await this.command(() => this.bridge.close(), { resync: false });
|
|
163
|
+
}
|
|
164
|
+
async startDragging() {
|
|
165
|
+
await this.command(() => this.bridge.startDragging?.(), { resync: false });
|
|
166
|
+
}
|
|
167
|
+
async command(run, options = {}) {
|
|
168
|
+
try {
|
|
169
|
+
await run();
|
|
170
|
+
} catch {
|
|
171
|
+
return;
|
|
172
|
+
}
|
|
173
|
+
if (options.resync !== false) await this.sync();
|
|
174
|
+
}
|
|
175
|
+
async watchWindow() {
|
|
176
|
+
const watch = this.bridge.watch;
|
|
177
|
+
if (!watch) return;
|
|
178
|
+
let unsubscribe;
|
|
179
|
+
let destroyed = false;
|
|
180
|
+
this.destroyRef.onDestroy(() => {
|
|
181
|
+
destroyed = true;
|
|
182
|
+
unsubscribe?.();
|
|
183
|
+
});
|
|
184
|
+
try {
|
|
185
|
+
unsubscribe = await watch.call(this.bridge, () => void this.sync());
|
|
186
|
+
} catch {
|
|
187
|
+
return;
|
|
188
|
+
}
|
|
189
|
+
if (destroyed) unsubscribe();
|
|
190
|
+
}
|
|
191
|
+
storedMode() {
|
|
192
|
+
const stored = this.storage.read(SHELL_MODE_STORAGE_KEY);
|
|
193
|
+
if (isShellMode(stored)) return stored;
|
|
194
|
+
return this.isDesktopRuntime ? "desktop" : SHELL_DEFAULT_MODE;
|
|
195
|
+
}
|
|
196
|
+
storedDevice() {
|
|
197
|
+
const stored = this.storage.read(SHELL_DEVICE_STORAGE_KEY);
|
|
198
|
+
return isShellDevice(stored) ? stored : null;
|
|
199
|
+
}
|
|
200
|
+
storedColor() {
|
|
201
|
+
const stored = this.storage.read(SHELL_COLOR_STORAGE_KEY);
|
|
202
|
+
return isShellColor(stored) ? stored : SHELL_DEFAULT_COLOR;
|
|
203
|
+
}
|
|
204
|
+
storedFrame() {
|
|
205
|
+
const stored = this.storage.read(SHELL_FRAME_STORAGE_KEY);
|
|
206
|
+
return isShellFrame(stored) ? stored : SHELL_DEFAULT_FRAME;
|
|
207
|
+
}
|
|
208
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
209
|
+
minVersion: "12.0.0",
|
|
210
|
+
version: "22.2.3",
|
|
211
|
+
ngImport: i0,
|
|
212
|
+
type: ShellService,
|
|
213
|
+
deps: [],
|
|
214
|
+
target: i0.ɵɵFactoryTarget.Service
|
|
215
|
+
});
|
|
216
|
+
static ɵprov = i0.ɵɵngDeclareService({
|
|
217
|
+
minVersion: "22.0.0",
|
|
218
|
+
version: "22.2.3",
|
|
219
|
+
ngImport: i0,
|
|
220
|
+
type: ShellService
|
|
221
|
+
});
|
|
222
|
+
};
|
|
223
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
224
|
+
minVersion: "12.0.0",
|
|
225
|
+
version: "22.2.3",
|
|
226
|
+
ngImport: i0,
|
|
227
|
+
type: ShellService,
|
|
228
|
+
decorators: [{ type: Service }],
|
|
229
|
+
ctorParameters: () => []
|
|
230
|
+
});
|
|
231
|
+
export { SHELL_WINDOW_BRIDGE, ShellService, WEB_SHELL_WINDOW_BRIDGE, createTauriShellWindowBridge, isTauriRuntime, provideShellWindowBridge, provideTauriShellWindowBridge };
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
const SHELL_MODES = [
|
|
2
|
+
"web",
|
|
3
|
+
"desktop",
|
|
4
|
+
"tablet",
|
|
5
|
+
"mobile"
|
|
6
|
+
];
|
|
7
|
+
const SHELL_DEVICES = [
|
|
8
|
+
"browser",
|
|
9
|
+
"macos",
|
|
10
|
+
"windows",
|
|
11
|
+
"linux",
|
|
12
|
+
"ipad",
|
|
13
|
+
"android",
|
|
14
|
+
"ios"
|
|
15
|
+
];
|
|
16
|
+
const SHELL_COLORS = ["sync", "default"];
|
|
17
|
+
const SHELL_FRAMES = ["classic", "modern"];
|
|
18
|
+
const SHELL_PLATFORMS = [
|
|
19
|
+
"web",
|
|
20
|
+
"tauri",
|
|
21
|
+
"electron",
|
|
22
|
+
"custom"
|
|
23
|
+
];
|
|
24
|
+
const SHELL_WINDOW_STATES = [
|
|
25
|
+
"normal",
|
|
26
|
+
"maximized",
|
|
27
|
+
"fullscreen"
|
|
28
|
+
];
|
|
29
|
+
const SHELL_DEFAULT_MODE = "web";
|
|
30
|
+
const SHELL_DEFAULT_DEVICE = "browser";
|
|
31
|
+
const SHELL_DEFAULT_COLOR = "sync";
|
|
32
|
+
const SHELL_DEFAULT_FRAME = "classic";
|
|
33
|
+
const SHELL_DEFAULT_PLATFORM = "web";
|
|
34
|
+
const SHELL_DEFAULT_WINDOW_STATE = "normal";
|
|
35
|
+
const SHELL_MODE_STORAGE_KEY = "shell-mode";
|
|
36
|
+
const SHELL_DEVICE_STORAGE_KEY = "shell-device";
|
|
37
|
+
const SHELL_COLOR_STORAGE_KEY = "shell-color";
|
|
38
|
+
const SHELL_FRAME_STORAGE_KEY = "shell-frame";
|
|
39
|
+
const SHELL_MODE_DEVICES = {
|
|
40
|
+
web: ["browser"],
|
|
41
|
+
desktop: [
|
|
42
|
+
"macos",
|
|
43
|
+
"windows",
|
|
44
|
+
"linux"
|
|
45
|
+
],
|
|
46
|
+
tablet: ["ipad", "android"],
|
|
47
|
+
mobile: ["ios", "android"]
|
|
48
|
+
};
|
|
49
|
+
function isShellMode(value) {
|
|
50
|
+
return typeof value === "string" && SHELL_MODES.includes(value);
|
|
51
|
+
}
|
|
52
|
+
function isShellDevice(value) {
|
|
53
|
+
return typeof value === "string" && SHELL_DEVICES.includes(value);
|
|
54
|
+
}
|
|
55
|
+
function isShellColor(value) {
|
|
56
|
+
return typeof value === "string" && SHELL_COLORS.includes(value);
|
|
57
|
+
}
|
|
58
|
+
function isShellFrame(value) {
|
|
59
|
+
return typeof value === "string" && SHELL_FRAMES.includes(value);
|
|
60
|
+
}
|
|
61
|
+
function isShellPlatform(value) {
|
|
62
|
+
return typeof value === "string" && SHELL_PLATFORMS.includes(value);
|
|
63
|
+
}
|
|
64
|
+
function isShellWindowState(value) {
|
|
65
|
+
return typeof value === "string" && SHELL_WINDOW_STATES.includes(value);
|
|
66
|
+
}
|
|
67
|
+
function normalizeShellMode(value) {
|
|
68
|
+
return isShellMode(value) ? value : "web";
|
|
69
|
+
}
|
|
70
|
+
function normalizeShellColor(value) {
|
|
71
|
+
return isShellColor(value) ? value : SHELL_DEFAULT_COLOR;
|
|
72
|
+
}
|
|
73
|
+
function normalizeShellFrame(value) {
|
|
74
|
+
return isShellFrame(value) ? value : SHELL_DEFAULT_FRAME;
|
|
75
|
+
}
|
|
76
|
+
function resolveShellFrameForMode(mode, frame) {
|
|
77
|
+
return mode === "desktop" ? normalizeShellFrame(frame) : SHELL_DEFAULT_FRAME;
|
|
78
|
+
}
|
|
79
|
+
function shellDevicesForMode(mode) {
|
|
80
|
+
return SHELL_MODE_DEVICES[mode];
|
|
81
|
+
}
|
|
82
|
+
function defaultShellDeviceForMode(mode) {
|
|
83
|
+
return SHELL_MODE_DEVICES[mode][0];
|
|
84
|
+
}
|
|
85
|
+
function isShellDeviceForMode(mode, device) {
|
|
86
|
+
return SHELL_MODE_DEVICES[mode].includes(device);
|
|
87
|
+
}
|
|
88
|
+
function resolveShellDeviceForMode(mode, device) {
|
|
89
|
+
return isShellDevice(device) && isShellDeviceForMode(mode, device) ? device : defaultShellDeviceForMode(mode);
|
|
90
|
+
}
|
|
91
|
+
function normalizeShellDevice(value) {
|
|
92
|
+
if (!value) return null;
|
|
93
|
+
const token = value.toLowerCase();
|
|
94
|
+
if (token.includes("ipad")) return "ipad";
|
|
95
|
+
if (token.includes("iphone") || token.includes("ipod") || token === "ios") return "ios";
|
|
96
|
+
if (token.includes("android")) return "android";
|
|
97
|
+
if (token.includes("mac") || token === "darwin") return "macos";
|
|
98
|
+
if (token.includes("win")) return "windows";
|
|
99
|
+
if (token.includes("linux") || token.includes("x11")) return "linux";
|
|
100
|
+
return null;
|
|
101
|
+
}
|
|
102
|
+
export { SHELL_COLORS, SHELL_COLOR_STORAGE_KEY, SHELL_DEFAULT_COLOR, SHELL_DEFAULT_DEVICE, SHELL_DEFAULT_FRAME, SHELL_DEFAULT_MODE, SHELL_DEFAULT_PLATFORM, SHELL_DEFAULT_WINDOW_STATE, SHELL_DEVICES, SHELL_DEVICE_STORAGE_KEY, SHELL_FRAMES, SHELL_FRAME_STORAGE_KEY, SHELL_MODES, SHELL_MODE_DEVICES, SHELL_MODE_STORAGE_KEY, SHELL_PLATFORMS, SHELL_WINDOW_STATES, defaultShellDeviceForMode, isShellColor, isShellDevice, isShellDeviceForMode, isShellFrame, isShellMode, isShellPlatform, isShellWindowState, normalizeShellColor, normalizeShellDevice, normalizeShellFrame, normalizeShellMode, resolveShellDeviceForMode, resolveShellFrameForMode, shellDevicesForMode };
|