@owlmeans/web-panel 0.1.18-rc.9 → 0.1.18
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 +510 -143
- package/THIRD-PARTY-NOTICES.txt +24 -0
- package/agent-meta/manifest.json +163 -4
- package/agent-meta/skills/web-panel/SKILL.md +136 -83
- package/agent-meta/skills/web-panel/parts/consent.md +114 -0
- package/agent-meta/skills/web-panel/parts/editor.md +47 -0
- package/agent-meta/skills/web-panel/parts/forms.md +85 -0
- package/agent-meta/skills/web-panel/parts/navigation.md +203 -0
- package/agent-meta/skills/web-panel/parts/picker.md +164 -0
- package/agent-meta/skills/web-panel/parts/reload.md +46 -0
- package/agent-meta/skills/web-panel/parts/sign-in.md +65 -0
- package/agent-meta/skills/web-panel/parts/theme.md +74 -0
- package/build/@/components/ui/alert-dialog.d.ts +15 -0
- package/build/@/components/ui/alert-dialog.d.ts.map +1 -0
- package/build/@/components/ui/alert-dialog.js +39 -0
- package/build/@/components/ui/alert-dialog.js.map +1 -0
- package/build/@/components/ui/alert.js +1 -1
- package/build/@/components/ui/alert.js.map +1 -1
- package/build/@/components/ui/button.js +1 -1
- package/build/@/components/ui/button.js.map +1 -1
- package/build/@/components/ui/card.js +1 -1
- package/build/@/components/ui/card.js.map +1 -1
- package/build/@/components/ui/input.js +1 -1
- package/build/@/components/ui/input.js.map +1 -1
- package/build/@/components/ui/label.js +1 -1
- package/build/@/components/ui/label.js.map +1 -1
- package/build/@/components/ui/navigation-menu.js +1 -1
- package/build/@/components/ui/navigation-menu.js.map +1 -1
- package/build/@/components/ui/popover.d.ts +8 -0
- package/build/@/components/ui/popover.d.ts.map +1 -0
- package/build/@/components/ui/popover.js +17 -0
- package/build/@/components/ui/popover.js.map +1 -0
- package/build/@/components/ui/progress.js +1 -1
- package/build/@/components/ui/progress.js.map +1 -1
- package/build/@/components/ui/separator.js +1 -1
- package/build/@/components/ui/separator.js.map +1 -1
- package/build/@/components/ui/sheet.d.ts +15 -0
- package/build/@/components/ui/sheet.d.ts.map +1 -0
- package/build/@/components/ui/sheet.js +40 -0
- package/build/@/components/ui/sheet.js.map +1 -0
- package/build/auth/context.d.ts.map +1 -1
- package/build/auth/context.js +0 -1
- package/build/auth/context.js.map +1 -1
- package/build/auth/entrypoints.d.ts +10 -0
- package/build/auth/entrypoints.d.ts.map +1 -0
- package/build/auth/entrypoints.js +4 -0
- package/build/auth/entrypoints.js.map +1 -0
- package/build/auth/exports.d.ts +4 -4
- package/build/auth/exports.d.ts.map +1 -1
- package/build/auth/exports.js +3 -3
- package/build/auth/exports.js.map +1 -1
- package/build/auth/modules.d.ts +1 -1
- package/build/auth/modules.d.ts.map +1 -1
- package/build/auth/plugins/basic-ed25519.js +4 -4
- package/build/auth/plugins/basic-ed25519.js.map +1 -1
- package/build/auth/plugins/re-captcha.js +3 -3
- package/build/auth/plugins/re-captcha.js.map +1 -1
- package/build/auth/plugins/tunnel-consumer.js +1 -1
- package/build/auth/plugins/tunnel-consumer.js.map +1 -1
- package/build/components/block.js +2 -2
- package/build/components/block.js.map +1 -1
- package/build/components/consts.local.d.ts +14 -0
- package/build/components/consts.local.d.ts.map +1 -0
- package/build/components/consts.local.js +26 -0
- package/build/components/consts.local.js.map +1 -0
- package/build/components/footer/component.d.ts +19 -1
- package/build/components/footer/component.d.ts.map +1 -1
- package/build/components/footer/component.js +38 -11
- package/build/components/footer/component.js.map +1 -1
- package/build/components/footer/credit.d.ts +27 -0
- package/build/components/footer/credit.d.ts.map +1 -0
- package/build/components/footer/credit.js +42 -0
- package/build/components/footer/credit.js.map +1 -0
- package/build/components/footer/index.d.ts +1 -0
- package/build/components/footer/index.d.ts.map +1 -1
- package/build/components/footer/index.js +1 -0
- package/build/components/footer/index.js.map +1 -1
- package/build/components/footer/types.d.ts +22 -1
- package/build/components/footer/types.d.ts.map +1 -1
- package/build/components/form/button/component.d.ts.map +1 -1
- package/build/components/form/button/component.js +5 -3
- package/build/components/form/button/component.js.map +1 -1
- package/build/components/form/component.js +2 -2
- package/build/components/form/component.js.map +1 -1
- package/build/components/form/text/component.js +2 -2
- package/build/components/form/text/component.js.map +1 -1
- package/build/components/helper.d.ts.map +1 -1
- package/build/components/helper.js +1 -12
- package/build/components/helper.js.map +1 -1
- package/build/components/index.d.ts +4 -0
- package/build/components/index.d.ts.map +1 -1
- package/build/components/index.js +4 -0
- package/build/components/index.js.map +1 -1
- package/build/components/link.js +3 -3
- package/build/components/link.js.map +1 -1
- package/build/components/login/append.d.ts +15 -0
- package/build/components/login/append.d.ts.map +1 -0
- package/build/components/login/append.js +26 -0
- package/build/components/login/append.js.map +1 -0
- package/build/components/login/consts.d.ts +3 -0
- package/build/components/login/consts.d.ts.map +1 -0
- package/build/components/login/consts.js +3 -0
- package/build/components/login/consts.js.map +1 -0
- package/build/components/login/consts.local.d.ts +4 -0
- package/build/components/login/consts.local.d.ts.map +1 -0
- package/build/components/login/consts.local.js +8 -0
- package/build/components/login/consts.local.js.map +1 -0
- package/build/components/login/credit.d.ts +12 -0
- package/build/components/login/credit.d.ts.map +1 -0
- package/build/components/login/credit.js +18 -0
- package/build/components/login/credit.js.map +1 -0
- package/build/components/login/i18n/be.json +10 -0
- package/build/components/login/i18n/de.json +10 -0
- package/build/components/login/i18n/en.json +10 -0
- package/build/components/login/i18n/es.json +10 -0
- package/build/components/login/i18n/fr.json +10 -0
- package/build/components/login/i18n/pl.json +10 -0
- package/build/components/login/i18n/ru.json +10 -0
- package/build/components/login/i18n/uk.json +10 -0
- package/build/components/login/i18n.d.ts +2 -0
- package/build/components/login/i18n.d.ts.map +1 -0
- package/build/components/login/i18n.js +28 -0
- package/build/components/login/i18n.js.map +1 -0
- package/build/components/login/icons.d.ts +14 -0
- package/build/components/login/icons.d.ts.map +1 -0
- package/build/components/login/icons.js +29 -0
- package/build/components/login/icons.js.map +1 -0
- package/build/components/login/index.d.ts +11 -0
- package/build/components/login/index.d.ts.map +1 -0
- package/build/components/login/index.js +10 -0
- package/build/components/login/index.js.map +1 -0
- package/build/components/login/notify.d.ts +18 -0
- package/build/components/login/notify.d.ts.map +1 -0
- package/build/components/login/notify.js +41 -0
- package/build/components/login/notify.js.map +1 -0
- package/build/components/login/provider.d.ts +20 -0
- package/build/components/login/provider.d.ts.map +1 -0
- package/build/components/login/provider.js +31 -0
- package/build/components/login/provider.js.map +1 -0
- package/build/components/login/screen.d.ts +24 -0
- package/build/components/login/screen.d.ts.map +1 -0
- package/build/components/login/screen.js +92 -0
- package/build/components/login/screen.js.map +1 -0
- package/build/components/login/terms.d.ts +19 -0
- package/build/components/login/terms.d.ts.map +1 -0
- package/build/components/login/terms.js +32 -0
- package/build/components/login/terms.js.map +1 -0
- package/build/components/login/types.d.ts +28 -0
- package/build/components/login/types.d.ts.map +1 -0
- package/build/components/login/types.js +2 -0
- package/build/components/login/types.js.map +1 -0
- package/build/components/nav/consts.local.d.ts +41 -0
- package/build/components/nav/consts.local.d.ts.map +1 -0
- package/build/components/nav/consts.local.js +60 -0
- package/build/components/nav/consts.local.js.map +1 -0
- package/build/components/nav/index.d.ts +1 -0
- package/build/components/nav/index.d.ts.map +1 -1
- package/build/components/nav/index.js +1 -0
- package/build/components/nav/index.js.map +1 -1
- package/build/components/nav/layout.d.ts +9 -2
- package/build/components/nav/layout.d.ts.map +1 -1
- package/build/components/nav/layout.js +48 -7
- package/build/components/nav/layout.js.map +1 -1
- package/build/components/nav/mobile.d.ts +21 -0
- package/build/components/nav/mobile.d.ts.map +1 -0
- package/build/components/nav/mobile.js +55 -0
- package/build/components/nav/mobile.js.map +1 -0
- package/build/components/nav/side.d.ts.map +1 -1
- package/build/components/nav/side.js +10 -10
- package/build/components/nav/side.js.map +1 -1
- package/build/components/nav/top.d.ts.map +1 -1
- package/build/components/nav/top.js +12 -8
- package/build/components/nav/top.js.map +1 -1
- package/build/components/nav/types.d.ts +64 -1
- package/build/components/nav/types.d.ts.map +1 -1
- package/build/components/nav/viewport.d.ts +3 -0
- package/build/components/nav/viewport.d.ts.map +1 -0
- package/build/components/nav/viewport.js +14 -0
- package/build/components/nav/viewport.js.map +1 -0
- package/build/components/panel-app/component.d.ts.map +1 -1
- package/build/components/panel-app/component.js +4 -3
- package/build/components/panel-app/component.js.map +1 -1
- package/build/components/picker/color-picker.d.ts +9 -0
- package/build/components/picker/color-picker.d.ts.map +1 -0
- package/build/components/picker/color-picker.js +9 -0
- package/build/components/picker/color-picker.js.map +1 -0
- package/build/components/picker/consts.local.d.ts +76 -0
- package/build/components/picker/consts.local.d.ts.map +1 -0
- package/build/components/picker/consts.local.js +214 -0
- package/build/components/picker/consts.local.js.map +1 -0
- package/build/components/picker/dot.d.ts +8 -0
- package/build/components/picker/dot.d.ts.map +1 -0
- package/build/components/picker/dot.js +10 -0
- package/build/components/picker/dot.js.map +1 -0
- package/build/components/picker/grid.d.ts +17 -0
- package/build/components/picker/grid.d.ts.map +1 -0
- package/build/components/picker/grid.js +73 -0
- package/build/components/picker/grid.js.map +1 -0
- package/build/components/picker/i18n/be.json +60 -0
- package/build/components/picker/i18n/de.json +60 -0
- package/build/components/picker/i18n/en.json +60 -0
- package/build/components/picker/i18n/es.json +60 -0
- package/build/components/picker/i18n/fr.json +60 -0
- package/build/components/picker/i18n/pl.json +60 -0
- package/build/components/picker/i18n/ru.json +60 -0
- package/build/components/picker/i18n/uk.json +60 -0
- package/build/components/picker/i18n.d.ts +2 -0
- package/build/components/picker/i18n.d.ts.map +1 -0
- package/build/components/picker/i18n.js +18 -0
- package/build/components/picker/i18n.js.map +1 -0
- package/build/components/picker/icon-color-picker.d.ts +14 -0
- package/build/components/picker/icon-color-picker.d.ts.map +1 -0
- package/build/components/picker/icon-color-picker.js +15 -0
- package/build/components/picker/icon-color-picker.js.map +1 -0
- package/build/components/picker/icon-picker.d.ts +8 -0
- package/build/components/picker/icon-picker.d.ts.map +1 -0
- package/build/components/picker/icon-picker.js +8 -0
- package/build/components/picker/icon-picker.js.map +1 -0
- package/build/components/picker/index.d.ts +11 -0
- package/build/components/picker/index.d.ts.map +1 -0
- package/build/components/picker/index.js +10 -0
- package/build/components/picker/index.js.map +1 -0
- package/build/components/picker/panel.d.ts +9 -0
- package/build/components/picker/panel.d.ts.map +1 -0
- package/build/components/picker/panel.js +23 -0
- package/build/components/picker/panel.js.map +1 -0
- package/build/components/picker/root.d.ts +13 -0
- package/build/components/picker/root.d.ts.map +1 -0
- package/build/components/picker/root.js +55 -0
- package/build/components/picker/root.js.map +1 -0
- package/build/components/picker/roving.d.ts +8 -0
- package/build/components/picker/roving.d.ts.map +1 -0
- package/build/components/picker/roving.js +62 -0
- package/build/components/picker/roving.js.map +1 -0
- package/build/components/picker/surface.d.ts +18 -0
- package/build/components/picker/surface.d.ts.map +1 -0
- package/build/components/picker/surface.js +36 -0
- package/build/components/picker/surface.js.map +1 -0
- package/build/components/picker/swatches/custom.d.ts +10 -0
- package/build/components/picker/swatches/custom.d.ts.map +1 -0
- package/build/components/picker/swatches/custom.js +65 -0
- package/build/components/picker/swatches/custom.js.map +1 -0
- package/build/components/picker/swatches.d.ts +16 -0
- package/build/components/picker/swatches.d.ts.map +1 -0
- package/build/components/picker/swatches.js +35 -0
- package/build/components/picker/swatches.js.map +1 -0
- package/build/components/picker/text.d.ts +5 -0
- package/build/components/picker/text.d.ts.map +1 -0
- package/build/components/picker/text.js +29 -0
- package/build/components/picker/text.js.map +1 -0
- package/build/components/picker/tile.d.ts +11 -0
- package/build/components/picker/tile.d.ts.map +1 -0
- package/build/components/picker/tile.js +19 -0
- package/build/components/picker/tile.js.map +1 -0
- package/build/components/picker/translate.d.ts +9 -0
- package/build/components/picker/translate.d.ts.map +1 -0
- package/build/components/picker/translate.js +13 -0
- package/build/components/picker/translate.js.map +1 -0
- package/build/components/picker/trigger.d.ts +12 -0
- package/build/components/picker/trigger.d.ts.map +1 -0
- package/build/components/picker/trigger.js +29 -0
- package/build/components/picker/trigger.js.map +1 -0
- package/build/components/picker/types.d.ts +114 -0
- package/build/components/picker/types.d.ts.map +1 -0
- package/build/components/picker/types.js +2 -0
- package/build/components/picker/types.js.map +1 -0
- package/build/components/picker/types.local.d.ts +143 -0
- package/build/components/picker/types.local.d.ts.map +1 -0
- package/build/components/picker/types.local.js +2 -0
- package/build/components/picker/types.local.js.map +1 -0
- package/build/components/scheme/consts.local.d.ts +8 -0
- package/build/components/scheme/consts.local.d.ts.map +1 -0
- package/build/components/scheme/consts.local.js +13 -0
- package/build/components/scheme/consts.local.js.map +1 -0
- package/build/components/scheme/hook.d.ts +16 -0
- package/build/components/scheme/hook.d.ts.map +1 -0
- package/build/components/scheme/hook.js +52 -0
- package/build/components/scheme/hook.js.map +1 -0
- package/build/components/scheme/index.d.ts +4 -0
- package/build/components/scheme/index.d.ts.map +1 -0
- package/build/components/scheme/index.js +3 -0
- package/build/components/scheme/index.js.map +1 -0
- package/build/components/scheme/toggle.d.ts +14 -0
- package/build/components/scheme/toggle.d.ts.map +1 -0
- package/build/components/scheme/toggle.js +24 -0
- package/build/components/scheme/toggle.js.map +1 -0
- package/build/components/scheme/types.d.ts +21 -0
- package/build/components/scheme/types.d.ts.map +1 -0
- package/build/components/scheme/types.js +2 -0
- package/build/components/scheme/types.js.map +1 -0
- package/build/components/socket/i18n/be.json +9 -0
- package/build/components/socket/i18n/de.json +9 -0
- package/build/components/socket/i18n/en.json +9 -0
- package/build/components/socket/i18n/es.json +9 -0
- package/build/components/socket/i18n/fr.json +9 -0
- package/build/components/socket/i18n/pl.json +9 -0
- package/build/components/socket/i18n/ru.json +9 -0
- package/build/components/socket/i18n/uk.json +9 -0
- package/build/components/socket/i18n.d.ts +2 -0
- package/build/components/socket/i18n.d.ts.map +1 -0
- package/build/components/socket/i18n.js +18 -0
- package/build/components/socket/i18n.js.map +1 -0
- package/build/components/socket/index.d.ts +3 -0
- package/build/components/socket/index.d.ts.map +1 -0
- package/build/components/socket/index.js +3 -0
- package/build/components/socket/index.js.map +1 -0
- package/build/components/socket/reload-dialog.d.ts +22 -0
- package/build/components/socket/reload-dialog.d.ts.map +1 -0
- package/build/components/socket/reload-dialog.js +34 -0
- package/build/components/socket/reload-dialog.js.map +1 -0
- package/build/components/status.js +1 -1
- package/build/components/status.js.map +1 -1
- package/build/components/text.d.ts.map +1 -1
- package/build/components/text.js +2 -13
- package/build/components/text.js.map +1 -1
- package/build/components/toaster.d.ts +16 -0
- package/build/components/toaster.d.ts.map +1 -0
- package/build/components/toaster.js +52 -0
- package/build/components/toaster.js.map +1 -0
- package/build/components/uploader/consts.local.d.ts +4 -0
- package/build/components/uploader/consts.local.d.ts.map +1 -0
- package/build/components/uploader/consts.local.js +6 -0
- package/build/components/uploader/consts.local.js.map +1 -0
- package/build/components/uploader/image.d.ts.map +1 -1
- package/build/components/uploader/image.js +2 -6
- package/build/components/uploader/image.js.map +1 -1
- package/build/consent/component.d.ts +27 -0
- package/build/consent/component.d.ts.map +1 -0
- package/build/consent/component.js +60 -0
- package/build/consent/component.js.map +1 -0
- package/build/consent/consts.d.ts +2 -0
- package/build/consent/consts.d.ts.map +1 -0
- package/build/consent/consts.js +2 -0
- package/build/consent/consts.js.map +1 -0
- package/build/consent/consts.local.d.ts +9 -0
- package/build/consent/consts.local.d.ts.map +1 -0
- package/build/consent/consts.local.js +9 -0
- package/build/consent/consts.local.js.map +1 -0
- package/build/consent/geo.d.ts +17 -0
- package/build/consent/geo.d.ts.map +1 -0
- package/build/consent/geo.js +19 -0
- package/build/consent/geo.js.map +1 -0
- package/build/consent/index.d.ts +11 -0
- package/build/consent/index.d.ts.map +1 -0
- package/build/consent/index.js +9 -0
- package/build/consent/index.js.map +1 -0
- package/build/consent/language.d.ts +12 -0
- package/build/consent/language.d.ts.map +1 -0
- package/build/consent/language.js +11 -0
- package/build/consent/language.js.map +1 -0
- package/build/consent/menu-widget.d.ts +13 -0
- package/build/consent/menu-widget.d.ts.map +1 -0
- package/build/consent/menu-widget.js +20 -0
- package/build/consent/menu-widget.js.map +1 -0
- package/build/consent/presence.d.ts +30 -0
- package/build/consent/presence.d.ts.map +1 -0
- package/build/consent/presence.js +40 -0
- package/build/consent/presence.js.map +1 -0
- package/build/consent/service.d.ts +18 -0
- package/build/consent/service.d.ts.map +1 -0
- package/build/consent/service.js +53 -0
- package/build/consent/service.js.map +1 -0
- package/build/consent/translate.d.ts +14 -0
- package/build/consent/translate.d.ts.map +1 -0
- package/build/consent/translate.js +28 -0
- package/build/consent/translate.js.map +1 -0
- package/build/consent/types.d.ts +39 -0
- package/build/consent/types.d.ts.map +1 -0
- package/build/consent/types.js +2 -0
- package/build/consent/types.js.map +1 -0
- package/build/consent/types.local.d.ts +6 -0
- package/build/consent/types.local.d.ts.map +1 -0
- package/build/consent/types.local.js +2 -0
- package/build/consent/types.local.js.map +1 -0
- package/build/context.d.ts.map +1 -1
- package/build/context.js +10 -0
- package/build/context.js.map +1 -1
- package/build/editor/component.d.ts +4 -0
- package/build/editor/component.d.ts.map +1 -0
- package/build/editor/component.js +103 -0
- package/build/editor/component.js.map +1 -0
- package/build/editor/consts.local.d.ts +6 -0
- package/build/editor/consts.local.d.ts.map +1 -0
- package/build/editor/consts.local.js +58 -0
- package/build/editor/consts.local.js.map +1 -0
- package/build/editor/index.d.ts +3 -0
- package/build/editor/index.d.ts.map +1 -0
- package/build/editor/index.js +2 -0
- package/build/editor/index.js.map +1 -0
- package/build/editor/types.d.ts +24 -0
- package/build/editor/types.d.ts.map +1 -0
- package/build/editor/types.js +2 -0
- package/build/editor/types.js.map +1 -0
- package/build/entrypoints.d.ts +8 -0
- package/build/entrypoints.d.ts.map +1 -0
- package/build/entrypoints.js +4 -0
- package/build/entrypoints.js.map +1 -0
- package/build/exports.d.ts +6 -5
- package/build/exports.d.ts.map +1 -1
- package/build/exports.js +5 -5
- package/build/exports.js.map +1 -1
- package/build/index.d.ts +1 -1
- package/build/index.d.ts.map +1 -1
- package/build/index.js +1 -1
- package/build/index.js.map +1 -1
- package/build/main.d.ts +1 -4
- package/build/main.d.ts.map +1 -1
- package/build/main.js.map +1 -1
- package/build/modules.d.ts +1 -1
- package/build/modules.d.ts.map +1 -1
- package/build/permission/i18n/be.json +13 -0
- package/build/permission/i18n/de.json +13 -0
- package/build/permission/i18n/en.json +13 -0
- package/build/permission/i18n/es.json +13 -0
- package/build/permission/i18n/fr.json +13 -0
- package/build/permission/i18n/pl.json +13 -0
- package/build/permission/i18n/ru.json +13 -0
- package/build/permission/i18n/uk.json +13 -0
- package/build/permission/i18n.d.ts +2 -0
- package/build/permission/i18n.d.ts.map +1 -0
- package/build/permission/i18n.js +13 -0
- package/build/permission/i18n.js.map +1 -0
- package/build/permission/index.d.ts +6 -0
- package/build/permission/index.d.ts.map +1 -0
- package/build/permission/index.js +27 -0
- package/build/permission/index.js.map +1 -0
- package/build/permission/toast.d.ts +5 -0
- package/build/permission/toast.d.ts.map +1 -0
- package/build/permission/toast.js +8 -0
- package/build/permission/toast.js.map +1 -0
- package/build/permission/types.d.ts +6 -0
- package/build/permission/types.d.ts.map +1 -0
- package/build/permission/types.js +2 -0
- package/build/permission/types.js.map +1 -0
- package/build/picker/icons/consts.d.ts +9 -0
- package/build/picker/icons/consts.d.ts.map +1 -0
- package/build/picker/icons/consts.js +264 -0
- package/build/picker/icons/consts.js.map +1 -0
- package/build/picker/icons/types.d.ts +18 -0
- package/build/picker/icons/types.d.ts.map +1 -0
- package/build/picker/icons/types.js +2 -0
- package/build/picker/icons/types.js.map +1 -0
- package/build/picker/icons.d.ts +4 -0
- package/build/picker/icons.d.ts.map +1 -0
- package/build/picker/icons.js +54 -0
- package/build/picker/icons.js.map +1 -0
- package/build/picker/index.d.ts +11 -0
- package/build/picker/index.d.ts.map +1 -0
- package/build/picker/index.js +10 -0
- package/build/picker/index.js.map +1 -0
- package/build/picker/utils/color/types.d.ts +35 -0
- package/build/picker/utils/color/types.d.ts.map +1 -0
- package/build/picker/utils/color/types.js +2 -0
- package/build/picker/utils/color/types.js.map +1 -0
- package/build/picker/utils/color.d.ts +4 -0
- package/build/picker/utils/color.d.ts.map +1 -0
- package/build/picker/utils/color.js +96 -0
- package/build/picker/utils/color.js.map +1 -0
- package/build/picker/vocabulary/consts.d.ts +26 -0
- package/build/picker/vocabulary/consts.d.ts.map +1 -0
- package/build/picker/vocabulary/consts.js +336 -0
- package/build/picker/vocabulary/consts.js.map +1 -0
- package/build/picker/vocabulary/types.d.ts +67 -0
- package/build/picker/vocabulary/types.d.ts.map +1 -0
- package/build/picker/vocabulary/types.js +2 -0
- package/build/picker/vocabulary/types.js.map +1 -0
- package/build/picker/vocabulary.d.ts +11 -0
- package/build/picker/vocabulary.d.ts.map +1 -0
- package/build/picker/vocabulary.js +83 -0
- package/build/picker/vocabulary.js.map +1 -0
- package/build/scheme/consts.d.ts +8 -0
- package/build/scheme/consts.d.ts.map +1 -0
- package/build/scheme/consts.js +8 -0
- package/build/scheme/consts.js.map +1 -0
- package/build/scheme/index.d.ts +4 -0
- package/build/scheme/index.d.ts.map +1 -0
- package/build/scheme/index.js +3 -0
- package/build/scheme/index.js.map +1 -0
- package/build/scheme/scheme.d.ts +16 -0
- package/build/scheme/scheme.d.ts.map +1 -0
- package/build/scheme/scheme.js +58 -0
- package/build/scheme/scheme.js.map +1 -0
- package/build/scheme/types.d.ts +30 -0
- package/build/scheme/types.d.ts.map +1 -0
- package/build/scheme/types.js +2 -0
- package/build/scheme/types.js.map +1 -0
- package/build/types.d.ts +18 -2
- package/build/types.d.ts.map +1 -1
- package/package.json +107 -52
- package/src/@/components/ui/alert-dialog.tsx +156 -0
- package/src/@/components/ui/alert.tsx +1 -1
- package/src/@/components/ui/button.tsx +1 -1
- package/src/@/components/ui/card.tsx +1 -1
- package/src/@/components/ui/input.tsx +1 -1
- package/src/@/components/ui/label.tsx +1 -1
- package/src/@/components/ui/navigation-menu.tsx +1 -1
- package/src/@/components/ui/popover.tsx +47 -0
- package/src/@/components/ui/progress.tsx +1 -1
- package/src/@/components/ui/separator.tsx +1 -1
- package/src/@/components/ui/sheet.tsx +142 -0
- package/src/auth/context.ts +0 -2
- package/src/auth/entrypoints.ts +5 -0
- package/src/auth/exports.ts +4 -4
- package/src/auth/plugins/basic-ed25519.tsx +4 -4
- package/src/auth/plugins/re-captcha.tsx +3 -3
- package/src/auth/plugins/tunnel-consumer.tsx +1 -1
- package/src/components/block.tsx +2 -2
- package/src/components/consts.local.ts +29 -0
- package/src/components/footer/component.tsx +58 -16
- package/src/components/footer/credit.tsx +61 -0
- package/src/components/footer/index.ts +1 -0
- package/src/components/footer/types.ts +22 -1
- package/src/components/form/button/component.tsx +7 -4
- package/src/components/form/component.tsx +2 -2
- package/src/components/form/text/component.tsx +2 -2
- package/src/components/helper.ts +1 -13
- package/src/components/index.ts +4 -0
- package/src/components/link.tsx +3 -3
- package/src/components/login/append.ts +34 -0
- package/src/components/login/consts.local.ts +10 -0
- package/src/components/login/consts.ts +2 -0
- package/src/components/login/credit.tsx +33 -0
- package/src/components/login/i18n/be.json +10 -0
- package/src/components/login/i18n/de.json +10 -0
- package/src/components/login/i18n/en.json +10 -0
- package/src/components/login/i18n/es.json +10 -0
- package/src/components/login/i18n/fr.json +10 -0
- package/src/components/login/i18n/pl.json +10 -0
- package/src/components/login/i18n/ru.json +10 -0
- package/src/components/login/i18n/uk.json +10 -0
- package/src/components/login/i18n.ts +29 -0
- package/src/components/login/icons.tsx +39 -0
- package/src/components/login/index.ts +11 -0
- package/src/components/login/notify.ts +48 -0
- package/src/components/login/provider.tsx +57 -0
- package/src/components/login/screen.tsx +178 -0
- package/src/components/login/terms.tsx +75 -0
- package/src/components/login/types.ts +30 -0
- package/src/components/nav/consts.local.ts +64 -0
- package/src/components/nav/index.ts +1 -0
- package/src/components/nav/layout.tsx +184 -26
- package/src/components/nav/mobile.tsx +165 -0
- package/src/components/nav/side.tsx +43 -27
- package/src/components/nav/top.tsx +44 -22
- package/src/components/nav/types.ts +65 -2
- package/src/components/nav/viewport.ts +16 -0
- package/src/components/panel-app/component.tsx +9 -1
- package/src/components/picker/color-picker.tsx +15 -0
- package/src/components/picker/consts.local.ts +267 -0
- package/src/components/picker/dot.tsx +21 -0
- package/src/components/picker/grid.tsx +138 -0
- package/src/components/picker/i18n/be.json +60 -0
- package/src/components/picker/i18n/de.json +60 -0
- package/src/components/picker/i18n/en.json +60 -0
- package/src/components/picker/i18n/es.json +60 -0
- package/src/components/picker/i18n/fr.json +60 -0
- package/src/components/picker/i18n/pl.json +60 -0
- package/src/components/picker/i18n/ru.json +60 -0
- package/src/components/picker/i18n/uk.json +60 -0
- package/src/components/picker/i18n.ts +19 -0
- package/src/components/picker/icon-color-picker.tsx +25 -0
- package/src/components/picker/icon-picker.tsx +13 -0
- package/src/components/picker/index.ts +11 -0
- package/src/components/picker/panel.tsx +61 -0
- package/src/components/picker/root.tsx +81 -0
- package/src/components/picker/roving.ts +70 -0
- package/src/components/picker/surface.tsx +62 -0
- package/src/components/picker/swatches/custom.tsx +110 -0
- package/src/components/picker/swatches.tsx +67 -0
- package/src/components/picker/text.ts +46 -0
- package/src/components/picker/tile.tsx +35 -0
- package/src/components/picker/translate.ts +15 -0
- package/src/components/picker/trigger.tsx +54 -0
- package/src/components/picker/types.local.ts +154 -0
- package/src/components/picker/types.ts +125 -0
- package/src/components/scheme/consts.local.ts +13 -0
- package/src/components/scheme/hook.ts +62 -0
- package/src/components/scheme/index.ts +4 -0
- package/src/components/scheme/toggle.tsx +32 -0
- package/src/components/scheme/types.ts +23 -0
- package/src/components/socket/i18n/be.json +9 -0
- package/src/components/socket/i18n/de.json +9 -0
- package/src/components/socket/i18n/en.json +9 -0
- package/src/components/socket/i18n/es.json +9 -0
- package/src/components/socket/i18n/fr.json +9 -0
- package/src/components/socket/i18n/pl.json +9 -0
- package/src/components/socket/i18n/ru.json +9 -0
- package/src/components/socket/i18n/uk.json +9 -0
- package/src/components/socket/i18n.ts +19 -0
- package/src/components/socket/index.ts +2 -0
- package/src/components/socket/reload-dialog.tsx +61 -0
- package/src/components/status.tsx +1 -1
- package/src/components/text.tsx +2 -14
- package/src/components/toaster.tsx +65 -0
- package/src/components/uploader/consts.local.ts +7 -0
- package/src/components/uploader/image.tsx +2 -6
- package/src/consent/component.tsx +84 -0
- package/src/consent/consts.local.ts +10 -0
- package/src/consent/consts.ts +1 -0
- package/src/consent/geo.ts +26 -0
- package/src/consent/index.ts +24 -0
- package/src/consent/language.ts +12 -0
- package/src/consent/menu-widget.tsx +22 -0
- package/src/consent/presence.ts +45 -0
- package/src/consent/service.ts +75 -0
- package/src/consent/translate.ts +31 -0
- package/src/consent/types.local.ts +6 -0
- package/src/consent/types.ts +43 -0
- package/src/context.ts +12 -0
- package/src/editor/component.tsx +172 -0
- package/src/editor/consts.local.ts +62 -0
- package/src/editor/index.ts +2 -0
- package/src/editor/types.ts +24 -0
- package/src/entrypoints.ts +5 -0
- package/src/exports.ts +6 -5
- package/src/index.ts +1 -1
- package/src/main.tsx +2 -6
- package/src/permission/i18n/be.json +13 -0
- package/src/permission/i18n/de.json +13 -0
- package/src/permission/i18n/en.json +13 -0
- package/src/permission/i18n/es.json +13 -0
- package/src/permission/i18n/fr.json +13 -0
- package/src/permission/i18n/pl.json +13 -0
- package/src/permission/i18n/ru.json +13 -0
- package/src/permission/i18n/uk.json +13 -0
- package/src/permission/i18n.ts +13 -0
- package/src/permission/index.ts +27 -0
- package/src/permission/toast.tsx +20 -0
- package/src/permission/types.ts +5 -0
- package/src/picker/icons/consts.ts +309 -0
- package/src/picker/icons/types.ts +18 -0
- package/src/picker/icons.ts +70 -0
- package/src/picker/index.ts +11 -0
- package/src/picker/utils/color/types.ts +37 -0
- package/src/picker/utils/color.ts +119 -0
- package/src/picker/vocabulary/consts.ts +347 -0
- package/src/picker/vocabulary/types.ts +72 -0
- package/src/picker/vocabulary.ts +111 -0
- package/src/scheme/consts.ts +8 -0
- package/src/scheme/index.ts +3 -0
- package/src/scheme/scheme.ts +66 -0
- package/src/scheme/types.ts +30 -0
- package/src/types.ts +19 -2
- package/tests/consent-language.spec.ts +31 -0
- package/tests/consent.spec.ts +112 -0
- package/tests/context.ts +4 -0
- package/tests/editor.spec.ts +58 -0
- package/tests/harness/editor.tsx +32 -0
- package/tests/harness/index.html +1 -0
- package/tests/harness/lazy-screen.tsx +9 -0
- package/tests/harness/mount.tsx +370 -29
- package/tests/harness/picker.tsx +110 -0
- package/tests/lazy.spec.ts +104 -0
- package/tests/login-provider.spec.ts +114 -0
- package/tests/login.spec.ts +447 -0
- package/tests/nav.spec.ts +449 -3
- package/tests/package-boundary.spec.ts +19 -0
- package/tests/picker-shots.spec.ts +174 -0
- package/tests/picker-vocabulary.spec.ts +217 -0
- package/tests/picker.spec.ts +333 -0
- package/tests/scheme.spec.ts +149 -0
- package/tests/smoke.spec.ts +2 -2
- package/tests/socket-dialog.spec.ts +154 -0
- package/tests/toaster.spec.ts +59 -0
- package/zz-tw.d.mts +2 -0
- package/zz-tw.d.mts.map +1 -0
- package/build/.gitkeep +0 -0
- package/src/auth/modules.ts +0 -5
- package/src/modules.ts +0 -5
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"title": "Дзеянне адхілена",
|
|
3
|
+
"description": "Сервер адхіліў дзеянне паводле бягучых правіл доступу. Калі вы чакалі доступу, звярніцеся да адміністратара.",
|
|
4
|
+
"technical-details": "Тэхнічныя падрабязнасці",
|
|
5
|
+
"endpoint": "Канцавы пункт",
|
|
6
|
+
"status": "Статус",
|
|
7
|
+
"incident": "Ідэнтыфікатар інцыдэнту",
|
|
8
|
+
"area-title": "Доступ забаронены",
|
|
9
|
+
"area-description": "Ваш уліковы запіс не можа адкрыць гэты раздзел. Калі вы чакалі доступу, звярніцеся да адміністратара.",
|
|
10
|
+
"area": "Раздзел",
|
|
11
|
+
"required-permissions": "Патрэбныя дазволы",
|
|
12
|
+
"logout": "Выйсці"
|
|
13
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"title": "Aktion verweigert",
|
|
3
|
+
"description": "Der Server hat diese Aktion gemäß den aktuellen Berechtigungen verweigert. Wenn Sie Zugriff erwartet haben, fragen Sie eine Administratorin oder einen Administrator.",
|
|
4
|
+
"technical-details": "Technische Details",
|
|
5
|
+
"endpoint": "Endpunkt",
|
|
6
|
+
"status": "Status",
|
|
7
|
+
"incident": "Vorfall-ID",
|
|
8
|
+
"area-title": "Zugriff verweigert",
|
|
9
|
+
"area-description": "Ihr Konto kann diesen Bereich nicht öffnen. Wenn Sie Zugriff erwartet haben, wenden Sie sich an die Administration.",
|
|
10
|
+
"area": "Bereich",
|
|
11
|
+
"required-permissions": "Erforderliche Berechtigungen",
|
|
12
|
+
"logout": "Abmelden"
|
|
13
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"title": "Action denied",
|
|
3
|
+
"description": "The server denied this action under the current permission rules. If you expected access, ask an administrator.",
|
|
4
|
+
"technical-details": "Technical details",
|
|
5
|
+
"endpoint": "Endpoint",
|
|
6
|
+
"status": "Status",
|
|
7
|
+
"incident": "Incident ID",
|
|
8
|
+
"area-title": "Access denied",
|
|
9
|
+
"area-description": "Your account cannot open this area. Ask an administrator if you expected access.",
|
|
10
|
+
"area": "Area",
|
|
11
|
+
"required-permissions": "Required permissions",
|
|
12
|
+
"logout": "Log out"
|
|
13
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"title": "Acción denegada",
|
|
3
|
+
"description": "El servidor denegó esta acción según las reglas de permisos actuales. Si esperaba tener acceso, consulte a un administrador.",
|
|
4
|
+
"technical-details": "Detalles técnicos",
|
|
5
|
+
"endpoint": "Punto de acceso",
|
|
6
|
+
"status": "Estado",
|
|
7
|
+
"incident": "ID del incidente",
|
|
8
|
+
"area-title": "Acceso denegado",
|
|
9
|
+
"area-description": "Su cuenta no puede abrir esta sección. Si esperaba tener acceso, consulte a un administrador.",
|
|
10
|
+
"area": "Sección",
|
|
11
|
+
"required-permissions": "Permisos necesarios",
|
|
12
|
+
"logout": "Cerrar sesión"
|
|
13
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"title": "Action refusée",
|
|
3
|
+
"description": "Le serveur a refusé cette action selon les autorisations actuelles. Si vous pensiez avoir accès, contactez un administrateur.",
|
|
4
|
+
"technical-details": "Détails techniques",
|
|
5
|
+
"endpoint": "Point de terminaison",
|
|
6
|
+
"status": "Statut",
|
|
7
|
+
"incident": "ID de l’incident",
|
|
8
|
+
"area-title": "Accès refusé",
|
|
9
|
+
"area-description": "Votre compte ne peut pas ouvrir cette section. Si vous pensiez avoir accès, contactez un administrateur.",
|
|
10
|
+
"area": "Section",
|
|
11
|
+
"required-permissions": "Autorisations requises",
|
|
12
|
+
"logout": "Se déconnecter"
|
|
13
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"title": "Działanie odrzucone",
|
|
3
|
+
"description": "Serwer odrzucił to działanie zgodnie z obecnymi uprawnieniami. Jeśli oczekujesz dostępu, skontaktuj się z administratorem.",
|
|
4
|
+
"technical-details": "Szczegóły techniczne",
|
|
5
|
+
"endpoint": "Punkt końcowy",
|
|
6
|
+
"status": "Status",
|
|
7
|
+
"incident": "Identyfikator incydentu",
|
|
8
|
+
"area-title": "Odmowa dostępu",
|
|
9
|
+
"area-description": "Twoje konto nie może otworzyć tego obszaru. Jeśli oczekujesz dostępu, skontaktuj się z administratorem.",
|
|
10
|
+
"area": "Obszar",
|
|
11
|
+
"required-permissions": "Wymagane uprawnienia",
|
|
12
|
+
"logout": "Wyloguj się"
|
|
13
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"title": "Действие отклонено",
|
|
3
|
+
"description": "Сервер отклонил действие согласно текущим правилам доступа. Если вам нужен доступ, обратитесь к администратору.",
|
|
4
|
+
"technical-details": "Технические подробности",
|
|
5
|
+
"endpoint": "Конечная точка",
|
|
6
|
+
"status": "Статус",
|
|
7
|
+
"incident": "Идентификатор инцидента",
|
|
8
|
+
"area-title": "Доступ запрещён",
|
|
9
|
+
"area-description": "Ваша учётная запись не может открыть этот раздел. Если вам нужен доступ, обратитесь к администратору.",
|
|
10
|
+
"area": "Раздел",
|
|
11
|
+
"required-permissions": "Необходимые разрешения",
|
|
12
|
+
"logout": "Выйти"
|
|
13
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"title": "Дію відхилено",
|
|
3
|
+
"description": "Сервер відхилив цю дію згідно з поточними правилами доступу. Якщо ви очікували доступу, зверніться до адміністратора.",
|
|
4
|
+
"technical-details": "Технічні подробиці",
|
|
5
|
+
"endpoint": "Кінцева точка",
|
|
6
|
+
"status": "Статус",
|
|
7
|
+
"incident": "Ідентифікатор інциденту",
|
|
8
|
+
"area-title": "Доступ заборонено",
|
|
9
|
+
"area-description": "Ваш обліковий запис не може відкрити цей розділ. Якщо ви очікували доступу, зверніться до адміністратора.",
|
|
10
|
+
"area": "Розділ",
|
|
11
|
+
"required-permissions": "Потрібні дозволи",
|
|
12
|
+
"logout": "Вийти"
|
|
13
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { i18nHelper } from '@owlmeans/i18n'
|
|
2
|
+
import en from './i18n/en.json'
|
|
3
|
+
import pl from './i18n/pl.json'
|
|
4
|
+
import ru from './i18n/ru.json'
|
|
5
|
+
import be from './i18n/be.json'
|
|
6
|
+
import uk from './i18n/uk.json'
|
|
7
|
+
import es from './i18n/es.json'
|
|
8
|
+
import de from './i18n/de.json'
|
|
9
|
+
import fr from './i18n/fr.json'
|
|
10
|
+
|
|
11
|
+
for (const [language, chunk] of Object.entries({ en, pl, ru, be, uk, es, de, fr })) {
|
|
12
|
+
i18nHelper.addI18nLib(language, 'permission-denied', chunk)
|
|
13
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import './i18n.js'
|
|
2
|
+
import { createElement } from 'react'
|
|
3
|
+
import { toast } from 'sonner'
|
|
4
|
+
import type { BasicContext } from '@owlmeans/context'
|
|
5
|
+
import { ensureEntrypointFailureService } from '@owlmeans/client-entrypoint'
|
|
6
|
+
import { apiStatusHelper } from '@owlmeans/api/status'
|
|
7
|
+
import { PermissionDeniedToast } from './toast.js'
|
|
8
|
+
|
|
9
|
+
export { PermissionDeniedToast } from './toast.js'
|
|
10
|
+
|
|
11
|
+
/** Opt-in adapter for the context's entrypoint failures; mount one Toaster in the app shell. */
|
|
12
|
+
export const appendPermissionDeniedToast = <T extends BasicContext<any>>(context: T): T => {
|
|
13
|
+
const seen = new Map<string, number>()
|
|
14
|
+
ensureEntrypointFailureService(context).registerPlugin({
|
|
15
|
+
alias: 'web-panel:permission-denied-toast',
|
|
16
|
+
onFailure: ({ alias, error }) => {
|
|
17
|
+
if (!apiStatusHelper.isAccessDenied(error)) return
|
|
18
|
+
const now = Date.now()
|
|
19
|
+
if (now - (seen.get(alias) ?? 0) < 2000) return
|
|
20
|
+
seen.set(alias, now)
|
|
21
|
+
toast.warning(createElement(PermissionDeniedToast, {
|
|
22
|
+
alias, status: apiStatusHelper.httpStatusOf(error), incidentId: apiStatusHelper.incidentIdOf(error),
|
|
23
|
+
}))
|
|
24
|
+
},
|
|
25
|
+
})
|
|
26
|
+
return context
|
|
27
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { FC } from 'react'
|
|
2
|
+
import { useI18nLib } from '@owlmeans/client-i18n'
|
|
3
|
+
import type { PermissionDeniedToastProps } from './types.js'
|
|
4
|
+
|
|
5
|
+
/** A refusal is actionable context for the user, with diagnostics outside the explanation. */
|
|
6
|
+
export const PermissionDeniedToast: FC<PermissionDeniedToastProps> = ({ alias, status, incidentId }) => {
|
|
7
|
+
const t = useI18nLib('permission-denied')
|
|
8
|
+
return <div className="space-y-2 max-w-sm text-sm">
|
|
9
|
+
<p className="font-semibold">{t('title')}</p>
|
|
10
|
+
<p>{t('description')}</p>
|
|
11
|
+
<details className="text-xs">
|
|
12
|
+
<summary className="cursor-pointer">{t('technical-details')}</summary>
|
|
13
|
+
<dl className="mt-2 grid grid-cols-[auto_1fr] gap-x-2 break-all">
|
|
14
|
+
<dt>{t('endpoint')}</dt><dd>{alias}</dd>
|
|
15
|
+
{status != null && <><dt>{t('status')}</dt><dd>{status}</dd></>}
|
|
16
|
+
{incidentId != null && <><dt>{t('incident')}</dt><dd>{incidentId}</dd></>}
|
|
17
|
+
</dl>
|
|
18
|
+
</details>
|
|
19
|
+
</div>
|
|
20
|
+
}
|
|
@@ -0,0 +1,309 @@
|
|
|
1
|
+
import type { LucideIcon } from 'lucide-react'
|
|
2
|
+
import {
|
|
3
|
+
BriefcaseIcon, FolderIcon, FolderOpenIcon, FolderKanbanIcon, FileIcon, FileTextIcon,
|
|
4
|
+
FilesIcon, ClipboardListIcon, ClipboardCheckIcon, ListChecksIcon, ListTodoIcon, SquareCheckIcon,
|
|
5
|
+
KanbanIcon, CalendarIcon, CalendarCheckIcon, CalendarDaysIcon, CalendarClockIcon, ClockIcon,
|
|
6
|
+
TimerIcon, HourglassIcon, TargetIcon, FlagIcon, MilestoneIcon, RocketIcon,
|
|
7
|
+
LightbulbIcon, BookOpenIcon, NotebookPenIcon, PresentationIcon, LayersIcon, LayoutGridIcon,
|
|
8
|
+
WorkflowIcon, GoalIcon, TrophyIcon, AwardIcon, PenLineIcon, ArchiveIcon,
|
|
9
|
+
PaperclipIcon, UserIcon, UserRoundIcon, UserRoundCheckIcon, UserRoundPlusIcon, UserCheckIcon,
|
|
10
|
+
UserPlusIcon, UsersIcon, UsersRoundIcon, ContactIcon, IdCardIcon, HandshakeIcon,
|
|
11
|
+
PersonStandingIcon, AccessibilityIcon, FaceSlightlySmilingIcon, HeartHandshakeIcon, GraduationCapIcon, UserCogIcon,
|
|
12
|
+
CrownIcon, HandIcon, ThumbsUpIcon, MailIcon, MailOpenIcon, InboxIcon,
|
|
13
|
+
SendIcon, MessageSquareIcon, MessageCircleIcon, MessagesSquareIcon, PhoneIcon, PhoneCallIcon,
|
|
14
|
+
MegaphoneIcon, BellIcon, BellRingIcon, AtSignIcon, HeadsetIcon, VideoIcon,
|
|
15
|
+
MicIcon, Share2Icon, ReplyIcon, LanguagesIcon, NewspaperIcon, ShoppingCartIcon,
|
|
16
|
+
ShoppingBagIcon, StoreIcon, ReceiptIcon, CreditCardIcon, WalletIcon, BanknoteIcon,
|
|
17
|
+
CoinsIcon, PiggyBankIcon, DollarSignIcon, EuroIcon, PercentIcon, TagIcon,
|
|
18
|
+
TagsIcon, TicketIcon, GiftIcon, PackageIcon, BadgePercentIcon, TrendingUpIcon,
|
|
19
|
+
TrendingDownIcon, ScaleIcon, LandmarkIcon, CalculatorIcon, HandCoinsIcon, ChartLineIcon,
|
|
20
|
+
ChartColumnIcon, ChartPieIcon, WrenchIcon, HammerIcon, SettingsIcon, CogIcon,
|
|
21
|
+
SlidersHorizontalIcon, FunnelIcon, TruckIcon, WarehouseIcon, FactoryIcon, ContainerIcon,
|
|
22
|
+
BoxesIcon, PackageCheckIcon, RouteIcon, GaugeIcon, ActivityIcon, SirenIcon,
|
|
23
|
+
ShieldIcon, ShieldCheckIcon, LockIcon, KeyIcon, HardHatIcon, ConstructionIcon,
|
|
24
|
+
RecycleIcon, StampIcon, BuildingIcon, BuildingComplexIcon, HouseIcon, HotelIcon,
|
|
25
|
+
SchoolIcon, HospitalIcon, MapIcon, MapPinIcon, MapPinnedIcon, GlobeIcon,
|
|
26
|
+
EarthIcon, CompassIcon, NavigationIcon, PlaneIcon, CarIcon, BusIcon,
|
|
27
|
+
TrainFrontIcon, ShipIcon, BikeIcon, MountainIcon, CodeIcon, TerminalIcon,
|
|
28
|
+
ServerIcon, DatabaseIcon, CloudIcon, CpuIcon, MonitorIcon, LaptopIcon,
|
|
29
|
+
SmartphoneIcon, TabletIcon, WifiIcon, BluetoothIcon, PlugIcon, HardDriveIcon,
|
|
30
|
+
GitBranchIcon, GitPullRequestIcon, BotIcon, BrainIcon, PuzzleIcon, BlocksIcon,
|
|
31
|
+
BugIcon, WebhookIcon, LinkIcon, QrCodeIcon, KeyboardIcon, PrinterIcon,
|
|
32
|
+
CircleIcon, CircleCheckIcon, CircleXIcon, CircleAlertIcon, CircleQuestionMarkIcon, CirclePauseIcon,
|
|
33
|
+
CirclePlayIcon, CircleDotIcon, CircleDashedIcon, TriangleAlertIcon, OctagonAlertIcon, InfoIcon,
|
|
34
|
+
BanIcon, CheckIcon, XIcon, LoaderIcon, RefreshCwIcon, EyeIcon,
|
|
35
|
+
EyeOffIcon, FlameIcon, ZapIcon, SparklesIcon, StarIcon, HeartIcon,
|
|
36
|
+
ThumbsDownIcon, BadgeCheckIcon, ShieldAlertIcon, BookmarkIcon, PinIcon, BookIcon,
|
|
37
|
+
PenIcon, PencilIcon, PaletteIcon, BrushIcon, CameraIcon, ImageIcon,
|
|
38
|
+
MusicIcon, HeadphonesIcon, Gamepad2Icon, UmbrellaIcon, ShirtIcon, WatchIcon,
|
|
39
|
+
CoffeeIcon, UtensilsIcon, LampIcon, ArmchairIcon, BedIcon, ScissorsIcon,
|
|
40
|
+
RulerIcon, TrashIcon, BoxIcon, MagnetIcon, FlaskConicalIcon, MicroscopeIcon,
|
|
41
|
+
StethoscopeIcon, PillIcon, DumbbellIcon, LeafIcon, TreePineIcon, TreesIcon,
|
|
42
|
+
FlowerIcon, Flower2Icon, SproutIcon, SunIcon, MoonIcon, CloudRainIcon,
|
|
43
|
+
CloudSunIcon, SnowflakeIcon, DropletIcon, WavesHorizontalIcon, WindIcon, MountainSnowIcon,
|
|
44
|
+
BirdIcon, FishIcon, CatIcon, DogIcon, PawPrintIcon, FeatherIcon,
|
|
45
|
+
AppleIcon, CarrotIcon,
|
|
46
|
+
} from 'lucide-react'
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Every catalogue icon by its stored name, each a statically imported lucide component — so a
|
|
50
|
+
* bundler keeps exactly these and nothing else, and a target bundle needs no dynamic import. Never
|
|
51
|
+
* `dynamicIconImports`, `DynamicIcon` or a namespace import: each pulls the whole set (~2,100 icons).
|
|
52
|
+
* Keys equal `PICKER_ICON_NAMES` (`tests/picker-vocabulary.spec.ts`).
|
|
53
|
+
*/
|
|
54
|
+
export const PICKER_ICONS: Readonly<Record<string, LucideIcon>> = Object.freeze({
|
|
55
|
+
'briefcase': BriefcaseIcon,
|
|
56
|
+
'folder': FolderIcon,
|
|
57
|
+
'folder-open': FolderOpenIcon,
|
|
58
|
+
'folder-kanban': FolderKanbanIcon,
|
|
59
|
+
'file': FileIcon,
|
|
60
|
+
'file-text': FileTextIcon,
|
|
61
|
+
'files': FilesIcon,
|
|
62
|
+
'clipboard-list': ClipboardListIcon,
|
|
63
|
+
'clipboard-check': ClipboardCheckIcon,
|
|
64
|
+
'list-checks': ListChecksIcon,
|
|
65
|
+
'list-todo': ListTodoIcon,
|
|
66
|
+
'square-check': SquareCheckIcon,
|
|
67
|
+
'kanban': KanbanIcon,
|
|
68
|
+
'calendar': CalendarIcon,
|
|
69
|
+
'calendar-check': CalendarCheckIcon,
|
|
70
|
+
'calendar-days': CalendarDaysIcon,
|
|
71
|
+
'calendar-clock': CalendarClockIcon,
|
|
72
|
+
'clock': ClockIcon,
|
|
73
|
+
'timer': TimerIcon,
|
|
74
|
+
'hourglass': HourglassIcon,
|
|
75
|
+
'target': TargetIcon,
|
|
76
|
+
'flag': FlagIcon,
|
|
77
|
+
'milestone': MilestoneIcon,
|
|
78
|
+
'rocket': RocketIcon,
|
|
79
|
+
'lightbulb': LightbulbIcon,
|
|
80
|
+
'book-open': BookOpenIcon,
|
|
81
|
+
'notebook-pen': NotebookPenIcon,
|
|
82
|
+
'presentation': PresentationIcon,
|
|
83
|
+
'layers': LayersIcon,
|
|
84
|
+
'layout-grid': LayoutGridIcon,
|
|
85
|
+
'workflow': WorkflowIcon,
|
|
86
|
+
'goal': GoalIcon,
|
|
87
|
+
'trophy': TrophyIcon,
|
|
88
|
+
'award': AwardIcon,
|
|
89
|
+
'pen-line': PenLineIcon,
|
|
90
|
+
'archive': ArchiveIcon,
|
|
91
|
+
'paperclip': PaperclipIcon,
|
|
92
|
+
'user': UserIcon,
|
|
93
|
+
'user-round': UserRoundIcon,
|
|
94
|
+
'user-round-check': UserRoundCheckIcon,
|
|
95
|
+
'user-round-plus': UserRoundPlusIcon,
|
|
96
|
+
'user-check': UserCheckIcon,
|
|
97
|
+
'user-plus': UserPlusIcon,
|
|
98
|
+
'users': UsersIcon,
|
|
99
|
+
'users-round': UsersRoundIcon,
|
|
100
|
+
'contact': ContactIcon,
|
|
101
|
+
'id-card': IdCardIcon,
|
|
102
|
+
'handshake': HandshakeIcon,
|
|
103
|
+
'person-standing': PersonStandingIcon,
|
|
104
|
+
'accessibility': AccessibilityIcon,
|
|
105
|
+
'face-slightly-smiling': FaceSlightlySmilingIcon,
|
|
106
|
+
'heart-handshake': HeartHandshakeIcon,
|
|
107
|
+
'graduation-cap': GraduationCapIcon,
|
|
108
|
+
'user-cog': UserCogIcon,
|
|
109
|
+
'crown': CrownIcon,
|
|
110
|
+
'hand': HandIcon,
|
|
111
|
+
'thumbs-up': ThumbsUpIcon,
|
|
112
|
+
'mail': MailIcon,
|
|
113
|
+
'mail-open': MailOpenIcon,
|
|
114
|
+
'inbox': InboxIcon,
|
|
115
|
+
'send': SendIcon,
|
|
116
|
+
'message-square': MessageSquareIcon,
|
|
117
|
+
'message-circle': MessageCircleIcon,
|
|
118
|
+
'messages-square': MessagesSquareIcon,
|
|
119
|
+
'phone': PhoneIcon,
|
|
120
|
+
'phone-call': PhoneCallIcon,
|
|
121
|
+
'megaphone': MegaphoneIcon,
|
|
122
|
+
'bell': BellIcon,
|
|
123
|
+
'bell-ring': BellRingIcon,
|
|
124
|
+
'at-sign': AtSignIcon,
|
|
125
|
+
'headset': HeadsetIcon,
|
|
126
|
+
'video': VideoIcon,
|
|
127
|
+
'mic': MicIcon,
|
|
128
|
+
'share-2': Share2Icon,
|
|
129
|
+
'reply': ReplyIcon,
|
|
130
|
+
'languages': LanguagesIcon,
|
|
131
|
+
'newspaper': NewspaperIcon,
|
|
132
|
+
'shopping-cart': ShoppingCartIcon,
|
|
133
|
+
'shopping-bag': ShoppingBagIcon,
|
|
134
|
+
'store': StoreIcon,
|
|
135
|
+
'receipt': ReceiptIcon,
|
|
136
|
+
'credit-card': CreditCardIcon,
|
|
137
|
+
'wallet': WalletIcon,
|
|
138
|
+
'banknote': BanknoteIcon,
|
|
139
|
+
'coins': CoinsIcon,
|
|
140
|
+
'piggy-bank': PiggyBankIcon,
|
|
141
|
+
'dollar-sign': DollarSignIcon,
|
|
142
|
+
'euro': EuroIcon,
|
|
143
|
+
'percent': PercentIcon,
|
|
144
|
+
'tag': TagIcon,
|
|
145
|
+
'tags': TagsIcon,
|
|
146
|
+
'ticket': TicketIcon,
|
|
147
|
+
'gift': GiftIcon,
|
|
148
|
+
'package': PackageIcon,
|
|
149
|
+
'badge-percent': BadgePercentIcon,
|
|
150
|
+
'trending-up': TrendingUpIcon,
|
|
151
|
+
'trending-down': TrendingDownIcon,
|
|
152
|
+
'scale': ScaleIcon,
|
|
153
|
+
'landmark': LandmarkIcon,
|
|
154
|
+
'calculator': CalculatorIcon,
|
|
155
|
+
'hand-coins': HandCoinsIcon,
|
|
156
|
+
'chart-line': ChartLineIcon,
|
|
157
|
+
'chart-column': ChartColumnIcon,
|
|
158
|
+
'chart-pie': ChartPieIcon,
|
|
159
|
+
'wrench': WrenchIcon,
|
|
160
|
+
'hammer': HammerIcon,
|
|
161
|
+
'settings': SettingsIcon,
|
|
162
|
+
'cog': CogIcon,
|
|
163
|
+
'sliders-horizontal': SlidersHorizontalIcon,
|
|
164
|
+
'funnel': FunnelIcon,
|
|
165
|
+
'truck': TruckIcon,
|
|
166
|
+
'warehouse': WarehouseIcon,
|
|
167
|
+
'factory': FactoryIcon,
|
|
168
|
+
'container': ContainerIcon,
|
|
169
|
+
'boxes': BoxesIcon,
|
|
170
|
+
'package-check': PackageCheckIcon,
|
|
171
|
+
'route': RouteIcon,
|
|
172
|
+
'gauge': GaugeIcon,
|
|
173
|
+
'activity': ActivityIcon,
|
|
174
|
+
'siren': SirenIcon,
|
|
175
|
+
'shield': ShieldIcon,
|
|
176
|
+
'shield-check': ShieldCheckIcon,
|
|
177
|
+
'lock': LockIcon,
|
|
178
|
+
'key': KeyIcon,
|
|
179
|
+
'hard-hat': HardHatIcon,
|
|
180
|
+
'construction': ConstructionIcon,
|
|
181
|
+
'recycle': RecycleIcon,
|
|
182
|
+
'stamp': StampIcon,
|
|
183
|
+
'building': BuildingIcon,
|
|
184
|
+
'building-complex': BuildingComplexIcon,
|
|
185
|
+
'house': HouseIcon,
|
|
186
|
+
'hotel': HotelIcon,
|
|
187
|
+
'school': SchoolIcon,
|
|
188
|
+
'hospital': HospitalIcon,
|
|
189
|
+
'map': MapIcon,
|
|
190
|
+
'map-pin': MapPinIcon,
|
|
191
|
+
'map-pinned': MapPinnedIcon,
|
|
192
|
+
'globe': GlobeIcon,
|
|
193
|
+
'earth': EarthIcon,
|
|
194
|
+
'compass': CompassIcon,
|
|
195
|
+
'navigation': NavigationIcon,
|
|
196
|
+
'plane': PlaneIcon,
|
|
197
|
+
'car': CarIcon,
|
|
198
|
+
'bus': BusIcon,
|
|
199
|
+
'train-front': TrainFrontIcon,
|
|
200
|
+
'ship': ShipIcon,
|
|
201
|
+
'bike': BikeIcon,
|
|
202
|
+
'mountain': MountainIcon,
|
|
203
|
+
'code': CodeIcon,
|
|
204
|
+
'terminal': TerminalIcon,
|
|
205
|
+
'server': ServerIcon,
|
|
206
|
+
'database': DatabaseIcon,
|
|
207
|
+
'cloud': CloudIcon,
|
|
208
|
+
'cpu': CpuIcon,
|
|
209
|
+
'monitor': MonitorIcon,
|
|
210
|
+
'laptop': LaptopIcon,
|
|
211
|
+
'smartphone': SmartphoneIcon,
|
|
212
|
+
'tablet': TabletIcon,
|
|
213
|
+
'wifi': WifiIcon,
|
|
214
|
+
'bluetooth': BluetoothIcon,
|
|
215
|
+
'plug': PlugIcon,
|
|
216
|
+
'hard-drive': HardDriveIcon,
|
|
217
|
+
'git-branch': GitBranchIcon,
|
|
218
|
+
'git-pull-request': GitPullRequestIcon,
|
|
219
|
+
'bot': BotIcon,
|
|
220
|
+
'brain': BrainIcon,
|
|
221
|
+
'puzzle': PuzzleIcon,
|
|
222
|
+
'blocks': BlocksIcon,
|
|
223
|
+
'bug': BugIcon,
|
|
224
|
+
'webhook': WebhookIcon,
|
|
225
|
+
'link': LinkIcon,
|
|
226
|
+
'qr-code': QrCodeIcon,
|
|
227
|
+
'keyboard': KeyboardIcon,
|
|
228
|
+
'printer': PrinterIcon,
|
|
229
|
+
'circle': CircleIcon,
|
|
230
|
+
'circle-check': CircleCheckIcon,
|
|
231
|
+
'circle-x': CircleXIcon,
|
|
232
|
+
'circle-alert': CircleAlertIcon,
|
|
233
|
+
'circle-question-mark': CircleQuestionMarkIcon,
|
|
234
|
+
'circle-pause': CirclePauseIcon,
|
|
235
|
+
'circle-play': CirclePlayIcon,
|
|
236
|
+
'circle-dot': CircleDotIcon,
|
|
237
|
+
'circle-dashed': CircleDashedIcon,
|
|
238
|
+
'triangle-alert': TriangleAlertIcon,
|
|
239
|
+
'octagon-alert': OctagonAlertIcon,
|
|
240
|
+
'info': InfoIcon,
|
|
241
|
+
'ban': BanIcon,
|
|
242
|
+
'check': CheckIcon,
|
|
243
|
+
'x': XIcon,
|
|
244
|
+
'loader': LoaderIcon,
|
|
245
|
+
'refresh-cw': RefreshCwIcon,
|
|
246
|
+
'eye': EyeIcon,
|
|
247
|
+
'eye-off': EyeOffIcon,
|
|
248
|
+
'flame': FlameIcon,
|
|
249
|
+
'zap': ZapIcon,
|
|
250
|
+
'sparkles': SparklesIcon,
|
|
251
|
+
'star': StarIcon,
|
|
252
|
+
'heart': HeartIcon,
|
|
253
|
+
'thumbs-down': ThumbsDownIcon,
|
|
254
|
+
'badge-check': BadgeCheckIcon,
|
|
255
|
+
'shield-alert': ShieldAlertIcon,
|
|
256
|
+
'bookmark': BookmarkIcon,
|
|
257
|
+
'pin': PinIcon,
|
|
258
|
+
'book': BookIcon,
|
|
259
|
+
'pen': PenIcon,
|
|
260
|
+
'pencil': PencilIcon,
|
|
261
|
+
'palette': PaletteIcon,
|
|
262
|
+
'brush': BrushIcon,
|
|
263
|
+
'camera': CameraIcon,
|
|
264
|
+
'image': ImageIcon,
|
|
265
|
+
'music': MusicIcon,
|
|
266
|
+
'headphones': HeadphonesIcon,
|
|
267
|
+
'gamepad-2': Gamepad2Icon,
|
|
268
|
+
'umbrella': UmbrellaIcon,
|
|
269
|
+
'shirt': ShirtIcon,
|
|
270
|
+
'watch': WatchIcon,
|
|
271
|
+
'coffee': CoffeeIcon,
|
|
272
|
+
'utensils': UtensilsIcon,
|
|
273
|
+
'lamp': LampIcon,
|
|
274
|
+
'armchair': ArmchairIcon,
|
|
275
|
+
'bed': BedIcon,
|
|
276
|
+
'scissors': ScissorsIcon,
|
|
277
|
+
'ruler': RulerIcon,
|
|
278
|
+
'trash': TrashIcon,
|
|
279
|
+
'box': BoxIcon,
|
|
280
|
+
'magnet': MagnetIcon,
|
|
281
|
+
'flask-conical': FlaskConicalIcon,
|
|
282
|
+
'microscope': MicroscopeIcon,
|
|
283
|
+
'stethoscope': StethoscopeIcon,
|
|
284
|
+
'pill': PillIcon,
|
|
285
|
+
'dumbbell': DumbbellIcon,
|
|
286
|
+
'leaf': LeafIcon,
|
|
287
|
+
'tree-pine': TreePineIcon,
|
|
288
|
+
'trees': TreesIcon,
|
|
289
|
+
'flower': FlowerIcon,
|
|
290
|
+
'flower-2': Flower2Icon,
|
|
291
|
+
'sprout': SproutIcon,
|
|
292
|
+
'sun': SunIcon,
|
|
293
|
+
'moon': MoonIcon,
|
|
294
|
+
'cloud-rain': CloudRainIcon,
|
|
295
|
+
'cloud-sun': CloudSunIcon,
|
|
296
|
+
'snowflake': SnowflakeIcon,
|
|
297
|
+
'droplet': DropletIcon,
|
|
298
|
+
'waves-horizontal': WavesHorizontalIcon,
|
|
299
|
+
'wind': WindIcon,
|
|
300
|
+
'mountain-snow': MountainSnowIcon,
|
|
301
|
+
'bird': BirdIcon,
|
|
302
|
+
'fish': FishIcon,
|
|
303
|
+
'cat': CatIcon,
|
|
304
|
+
'dog': DogIcon,
|
|
305
|
+
'paw-print': PawPrintIcon,
|
|
306
|
+
'feather': FeatherIcon,
|
|
307
|
+
'apple': AppleIcon,
|
|
308
|
+
'carrot': CarrotIcon,
|
|
309
|
+
})
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { LucideIcon } from 'lucide-react'
|
|
2
|
+
import type { PickerIconCategory, PickerIconEntry } from '../vocabulary/types.js'
|
|
3
|
+
|
|
4
|
+
/** Looks icons up and searches the catalogue. */
|
|
5
|
+
export interface PickerIconHelper {
|
|
6
|
+
/** The component for a stored name; unknown, empty or absent → the fallback icon (`circle`). */
|
|
7
|
+
iconOf: (name?: string | null) => LucideIcon
|
|
8
|
+
/** Whether a value names a catalogue icon. */
|
|
9
|
+
has: (name: unknown) => name is string
|
|
10
|
+
/**
|
|
11
|
+
* Catalogue entries matching a query — every word must start a word of the name, a search word or
|
|
12
|
+
* the category; the closest names first. An empty query lists them all. `names` narrows the
|
|
13
|
+
* catalogue and sets the order (an application's own icon list).
|
|
14
|
+
*/
|
|
15
|
+
search: (query: string, names?: readonly string[]) => PickerIconEntry[]
|
|
16
|
+
/** The entries of one category, in catalogue order (or `names`' order). */
|
|
17
|
+
byCategory: (category: PickerIconCategory, names?: readonly string[]) => PickerIconEntry[]
|
|
18
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import type { LucideIcon } from 'lucide-react'
|
|
2
|
+
import { PICKER_ICONS } from './icons/consts.js'
|
|
3
|
+
import type { PickerIconHelper } from './icons/types.js'
|
|
4
|
+
import { PICKER_FALLBACK_ICON, PICKER_ICON_ENTRIES } from './vocabulary/consts.js'
|
|
5
|
+
import type { PickerIconCategory, PickerIconEntry } from './vocabulary/types.js'
|
|
6
|
+
|
|
7
|
+
export const createPickerIconHelper = (): PickerIconHelper => {
|
|
8
|
+
const wordsOf = (text: string): string[] => text.toLowerCase().split(/[\s,-]+/).filter(word => word !== '')
|
|
9
|
+
const byName = new Map(PICKER_ICON_ENTRIES.map(entry => [entry.name, entry]))
|
|
10
|
+
// Each entry's words split once: its name's and its search words'.
|
|
11
|
+
const words = new Map(PICKER_ICON_ENTRIES.map(entry => [entry.name, {
|
|
12
|
+
name: wordsOf(entry.name), search: entry.keywords.flatMap(wordsOf),
|
|
13
|
+
}]))
|
|
14
|
+
const fallback = PICKER_ICONS[PICKER_FALLBACK_ICON]
|
|
15
|
+
|
|
16
|
+
const has = (name: unknown): name is string =>
|
|
17
|
+
typeof name === 'string' && Object.prototype.hasOwnProperty.call(PICKER_ICONS, name)
|
|
18
|
+
|
|
19
|
+
const iconOf = (name?: string | null): LucideIcon => has(name) ? PICKER_ICONS[name] : fallback
|
|
20
|
+
|
|
21
|
+
const scope = (names?: readonly string[]): PickerIconEntry[] => names == null
|
|
22
|
+
? [...PICKER_ICON_ENTRIES]
|
|
23
|
+
: names.flatMap(name => {
|
|
24
|
+
const entry = byName.get(name)
|
|
25
|
+
|
|
26
|
+
return entry != null ? [entry] : []
|
|
27
|
+
})
|
|
28
|
+
|
|
29
|
+
/** 0 exact name, 1 name prefix, 2 a name word, 3 a search word, 4 the category; -1 no match. */
|
|
30
|
+
const rank = (entry: PickerIconEntry, query: string, terms: string[]): number => {
|
|
31
|
+
if (entry.name === query) {
|
|
32
|
+
return 0
|
|
33
|
+
}
|
|
34
|
+
const own = words.get(entry.name) ?? { name: [], search: [] }
|
|
35
|
+
const starts = (pool: string[]) => terms.every(term => pool.some(word => word.startsWith(term)))
|
|
36
|
+
if (!starts([...own.name, ...own.search, entry.category])) {
|
|
37
|
+
return -1
|
|
38
|
+
}
|
|
39
|
+
if (entry.name.startsWith(query.replace(/\s+/g, '-'))) {
|
|
40
|
+
return 1
|
|
41
|
+
}
|
|
42
|
+
if (starts(own.name)) {
|
|
43
|
+
return 2
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
return starts([...own.name, ...own.search]) ? 3 : 4
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
const search = (query: string, names?: readonly string[]): PickerIconEntry[] => {
|
|
50
|
+
const entries = scope(names)
|
|
51
|
+
const normalized = query.trim().toLowerCase().replace(/\s+/g, ' ')
|
|
52
|
+
if (normalized === '') {
|
|
53
|
+
return entries
|
|
54
|
+
}
|
|
55
|
+
const terms = wordsOf(normalized)
|
|
56
|
+
|
|
57
|
+
return entries
|
|
58
|
+
.map((entry, order) => ({ entry, order, score: rank(entry, normalized, terms) }))
|
|
59
|
+
.filter(hit => hit.score >= 0)
|
|
60
|
+
.sort((a, b) => a.score - b.score || a.order - b.order)
|
|
61
|
+
.map(hit => hit.entry)
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
const byCategory = (category: PickerIconCategory, names?: readonly string[]): PickerIconEntry[] =>
|
|
65
|
+
scope(names).filter(entry => entry.category === category)
|
|
66
|
+
|
|
67
|
+
return { iconOf, has, search, byCategory }
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export const pickerIconHelper = createPickerIconHelper()
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `@owlmeans/web-panel/picker` — the standard icon + colour picker and the parts it is made of,
|
|
3
|
+
* plus everything of `./picker/vocabulary`. Not re-exported by the package root: only a bundle that
|
|
4
|
+
* imports this subpath carries the icon catalogue.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
export * from './vocabulary.js'
|
|
8
|
+
export { PICKER_ICONS } from './icons/consts.js'
|
|
9
|
+
export { pickerIconHelper, createPickerIconHelper } from './icons.js'
|
|
10
|
+
export type * from './icons/types.js'
|
|
11
|
+
export * from '../components/picker/index.js'
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/** An sRGB colour, each channel 0..1. */
|
|
2
|
+
export interface Rgb {
|
|
3
|
+
r: number
|
|
4
|
+
g: number
|
|
5
|
+
b: number
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
/** A colour in OKLCH: lightness 0..1, chroma, hue in radians. */
|
|
9
|
+
export interface Oklch {
|
|
10
|
+
l: number
|
|
11
|
+
c: number
|
|
12
|
+
h: number
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/** The four mode-dependent values a custom colour needs, each a lowercase `#rrggbb`. */
|
|
16
|
+
export interface DerivedColor {
|
|
17
|
+
ink: string
|
|
18
|
+
soft: string
|
|
19
|
+
inkDark: string
|
|
20
|
+
softDark: string
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/** Colour arithmetic for custom colours: parsing, WCAG contrast and OKLCH with gamut fitting. */
|
|
24
|
+
export interface ColorUtils {
|
|
25
|
+
/** A six-digit `#rrggbb` (any case) → channels; anything else → `null`. */
|
|
26
|
+
parse: (hex: string) => Rgb | null
|
|
27
|
+
/** Channels → lowercase `#rrggbb`, clamped and rounded. */
|
|
28
|
+
hex: (rgb: Rgb) => string
|
|
29
|
+
/** WCAG 2 contrast ratio of two six-digit hex colours, 1..21. */
|
|
30
|
+
contrast: (a: string, b: string) => number
|
|
31
|
+
/**
|
|
32
|
+
* The ink and ground a custom colour renders with in both modes: grounds in the colour's hue,
|
|
33
|
+
* inks moved only as far in lightness as it takes to keep 4.5:1 on the ground and on the page
|
|
34
|
+
* (white, black). A colour that already reads well keeps its own value as the light ink.
|
|
35
|
+
*/
|
|
36
|
+
derive: (hex: string) => DerivedColor
|
|
37
|
+
}
|