@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,125 @@
|
|
|
1
|
+
import type { CSSProperties } from 'react'
|
|
2
|
+
import type { PickerColor } from '../../picker/vocabulary/types.js'
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Resolves a picker string: the key (`done`, `colors.indigo`, `categories.work` …) and the English
|
|
6
|
+
* text to show without a translation. `usePickerTranslate()` gives one reading the packaged
|
|
7
|
+
* eight-language bundle; without one the parts render English.
|
|
8
|
+
*/
|
|
9
|
+
export interface PickerTranslate { (key: string, fallback: string): string }
|
|
10
|
+
|
|
11
|
+
/** Where a picker opens: `auto` — a popover from 768px up, a bottom sheet below (decided when it opens). */
|
|
12
|
+
export type PickerSurfaceChoice = 'auto' | 'popover' | 'sheet'
|
|
13
|
+
|
|
14
|
+
/** What the three pickers share. */
|
|
15
|
+
export interface PickerBaseProps {
|
|
16
|
+
/** The trigger's accessible name and the surface's title. */
|
|
17
|
+
label?: string
|
|
18
|
+
/** The trigger's text while nothing is chosen. */
|
|
19
|
+
placeholder?: string
|
|
20
|
+
disabled?: boolean
|
|
21
|
+
surface?: PickerSurfaceChoice
|
|
22
|
+
/** Strings; English without it. Never an implicit i18n read — the parts render without a provider. */
|
|
23
|
+
translate?: PickerTranslate
|
|
24
|
+
/** Merged over the trigger's classes. */
|
|
25
|
+
className?: string
|
|
26
|
+
/** Lands on the trigger button, so a `<label htmlFor>` names it. */
|
|
27
|
+
id?: string
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/** A stored mark: a palette key or `#rrggbb`, and a kebab-case lucide name. Either may be missing. */
|
|
31
|
+
export interface IconColorValue {
|
|
32
|
+
icon?: string | null
|
|
33
|
+
color?: string | null
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/** What `IconColorPicker` emits: both halves as they now stand; an unset half stays `undefined`, never `null`. */
|
|
37
|
+
export interface IconColorChange {
|
|
38
|
+
icon?: string
|
|
39
|
+
color?: string
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export interface IconColorPickerProps extends PickerBaseProps {
|
|
43
|
+
value?: IconColorValue | null
|
|
44
|
+
onChange: (next: IconColorChange) => void
|
|
45
|
+
/** The palette offered; default the 24 colours. */
|
|
46
|
+
colors?: readonly PickerColor[]
|
|
47
|
+
/** Narrows the icon catalogue (and orders it). */
|
|
48
|
+
icons?: readonly string[]
|
|
49
|
+
/** Adds the full colour wheel and a hex field; the value is then a palette key or `#rrggbb`. */
|
|
50
|
+
customColors?: boolean
|
|
51
|
+
/** `button` (default) — tile, names and a chevron; `tile` — the tile alone. */
|
|
52
|
+
trigger?: 'button' | 'tile'
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export interface IconPickerProps extends PickerBaseProps {
|
|
56
|
+
value?: string | null
|
|
57
|
+
onChange: (icon: string) => void
|
|
58
|
+
/** The colour the icons are tinted in. */
|
|
59
|
+
color?: string | null
|
|
60
|
+
colors?: readonly PickerColor[]
|
|
61
|
+
icons?: readonly string[]
|
|
62
|
+
trigger?: 'button' | 'tile'
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export interface ColorPickerProps extends PickerBaseProps {
|
|
66
|
+
value?: string | null
|
|
67
|
+
onChange: (color: string) => void
|
|
68
|
+
colors?: readonly PickerColor[]
|
|
69
|
+
customColors?: boolean
|
|
70
|
+
/** `button` (default) — dot, name and a chevron; `dot` — the dot alone. */
|
|
71
|
+
trigger?: 'button' | 'dot'
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/** The swatch grid on its own, for a dialog or sheet the application already owns. */
|
|
75
|
+
export interface ColorSwatchesProps {
|
|
76
|
+
value?: string | null
|
|
77
|
+
onChange: (color: string) => void
|
|
78
|
+
colors?: readonly PickerColor[]
|
|
79
|
+
customColors?: boolean
|
|
80
|
+
translate?: PickerTranslate
|
|
81
|
+
/** The group's accessible name; default "Colour". */
|
|
82
|
+
label?: string
|
|
83
|
+
className?: string
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/** The searchable icon grid on its own, for a dialog or sheet the application already owns. */
|
|
87
|
+
export interface IconGridProps {
|
|
88
|
+
value?: string | null
|
|
89
|
+
onChange: (icon: string) => void
|
|
90
|
+
/** The colour the icons are tinted in. */
|
|
91
|
+
color?: string | null
|
|
92
|
+
colors?: readonly PickerColor[]
|
|
93
|
+
icons?: readonly string[]
|
|
94
|
+
translate?: PickerTranslate
|
|
95
|
+
/** The grid's accessible name; default "Icon". */
|
|
96
|
+
label?: string
|
|
97
|
+
className?: string
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
export type PickerTileSize = 'xs' | 'sm' | 'md' | 'lg'
|
|
101
|
+
|
|
102
|
+
/** A stored mark rendered: the icon in the colour's ink on its ground (`tile`), or the ink alone (`plain`). */
|
|
103
|
+
export interface IconTileProps {
|
|
104
|
+
icon?: string | null
|
|
105
|
+
color?: string | null
|
|
106
|
+
colors?: readonly PickerColor[]
|
|
107
|
+
size?: PickerTileSize
|
|
108
|
+
variant?: 'tile' | 'plain'
|
|
109
|
+
/** Present — an image with this name; absent — decorative (`aria-hidden`). */
|
|
110
|
+
label?: string
|
|
111
|
+
className?: string
|
|
112
|
+
style?: CSSProperties
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
export type PickerDotSize = 'xs' | 'sm' | 'md'
|
|
116
|
+
|
|
117
|
+
/** A stored colour rendered as a dot in its ink. */
|
|
118
|
+
export interface ColorDotProps {
|
|
119
|
+
color?: string | null
|
|
120
|
+
colors?: readonly PickerColor[]
|
|
121
|
+
size?: PickerDotSize
|
|
122
|
+
/** Present — an image with this name; absent — decorative (`aria-hidden`). */
|
|
123
|
+
label?: string
|
|
124
|
+
className?: string
|
|
125
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export const DARK_QUERY = '(prefers-color-scheme: dark)'
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* A 44px round target in the page's own tokens — muted at rest, the foreground on hover — with
|
|
5
|
+
* the 3px ring every interactive element shows on keyboard focus. No fill, border, gradient or
|
|
6
|
+
* shadow: it sits in a footer's bottom row beside the credit and must read as part of it.
|
|
7
|
+
*/
|
|
8
|
+
export const TOGGLE = [
|
|
9
|
+
'inline-flex size-11 shrink-0 cursor-pointer items-center justify-center rounded-full',
|
|
10
|
+
'bg-transparent text-muted-foreground transition-colors hover:text-foreground',
|
|
11
|
+
'outline-none focus-visible:ring-[3px] focus-visible:ring-ring focus-visible:ring-offset-2',
|
|
12
|
+
'focus-visible:ring-offset-background',
|
|
13
|
+
].join(' ')
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { useCallback, useEffect, useState } from 'react'
|
|
2
|
+
import { colorSchemeHelper } from '../../scheme/scheme.js'
|
|
3
|
+
import { COLOR_SCHEME_EVENT, COLOR_SCHEME_KEY } from '../../scheme/consts.js'
|
|
4
|
+
import type { ColorSchemeChoice } from '../../scheme/types.js'
|
|
5
|
+
import type { ColorSchemeModel } from './types.js'
|
|
6
|
+
import { DARK_QUERY } from './consts.local.js'
|
|
7
|
+
|
|
8
|
+
const systemDark = (): boolean =>
|
|
9
|
+
typeof window !== 'undefined' && typeof window.matchMedia === 'function'
|
|
10
|
+
&& window.matchMedia(DARK_QUERY).matches
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* The page's colour scheme, and the way to choose one.
|
|
14
|
+
*
|
|
15
|
+
* Both halves are read synchronously on the first render — the stored choice from storage, the
|
|
16
|
+
* system preference from `matchMedia` — so a toggle never renders the wrong icon for a frame.
|
|
17
|
+
* Afterwards it follows three sources: `applyColorScheme` anywhere in this document (its event),
|
|
18
|
+
* another tab changing the stored key (`storage`), and the operating system switching while no
|
|
19
|
+
* choice is stored.
|
|
20
|
+
*
|
|
21
|
+
* Mounting also re-applies a stored choice's class. The head bootstrap has normally done that
|
|
22
|
+
* before the first paint; an application without it still ends up on the right scheme, one frame
|
|
23
|
+
* late rather than never.
|
|
24
|
+
*/
|
|
25
|
+
export const useColorScheme = (): ColorSchemeModel => {
|
|
26
|
+
const [choice, setState] = useState<ColorSchemeChoice | null>(colorSchemeHelper.readColorScheme)
|
|
27
|
+
const [dark, setDark] = useState<boolean>(systemDark)
|
|
28
|
+
|
|
29
|
+
useEffect(() => {
|
|
30
|
+
const stored = colorSchemeHelper.readColorScheme()
|
|
31
|
+
if (stored != null) {
|
|
32
|
+
colorSchemeHelper.setColorSchemeClass(stored)
|
|
33
|
+
}
|
|
34
|
+
setState(stored)
|
|
35
|
+
|
|
36
|
+
const onChoice = () => setState(colorSchemeHelper.readColorScheme())
|
|
37
|
+
const onStorage = (event: StorageEvent) => {
|
|
38
|
+
if (event.key === COLOR_SCHEME_KEY || event.key == null) {
|
|
39
|
+
const next = colorSchemeHelper.readColorScheme()
|
|
40
|
+
colorSchemeHelper.setColorSchemeClass(next)
|
|
41
|
+
setState(next)
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
window.addEventListener(COLOR_SCHEME_EVENT, onChoice)
|
|
45
|
+
window.addEventListener('storage', onStorage)
|
|
46
|
+
|
|
47
|
+
const media = typeof window.matchMedia === 'function' ? window.matchMedia(DARK_QUERY) : null
|
|
48
|
+
const onSystem = () => setDark(media?.matches === true)
|
|
49
|
+
media?.addEventListener('change', onSystem)
|
|
50
|
+
onSystem()
|
|
51
|
+
|
|
52
|
+
return () => {
|
|
53
|
+
window.removeEventListener(COLOR_SCHEME_EVENT, onChoice)
|
|
54
|
+
window.removeEventListener('storage', onStorage)
|
|
55
|
+
media?.removeEventListener('change', onSystem)
|
|
56
|
+
}
|
|
57
|
+
}, [])
|
|
58
|
+
|
|
59
|
+
const setChoice = useCallback((next: ColorSchemeChoice | null) => colorSchemeHelper.applyColorScheme(next), [])
|
|
60
|
+
|
|
61
|
+
return { scheme: choice ?? (dark ? 'dark' : 'light'), choice, setChoice }
|
|
62
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { FC } from 'react'
|
|
2
|
+
import { Moon, Sun } from 'lucide-react'
|
|
3
|
+
import { cn } from '../../@/lib/utils.js'
|
|
4
|
+
import { useColorScheme } from './hook.js'
|
|
5
|
+
import type { ThemeToggleProps } from './types.js'
|
|
6
|
+
import { TOGGLE } from './consts.local.js'
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* The light/dark switcher.
|
|
10
|
+
*
|
|
11
|
+
* It flips the RESOLVED scheme, not the stored choice: on a system that prefers dark and with no
|
|
12
|
+
* choice stored, the page is dark, so the first press means "light" — a toggle keyed on the
|
|
13
|
+
* choice alone would answer that press with "dark", which changes nothing the visitor can see.
|
|
14
|
+
* The icon is the scheme the page is in (a sun while light, a moon while dark), chosen in script
|
|
15
|
+
* from the same state rather than by a `dark:` variant, so it is right whatever the app's CSS
|
|
16
|
+
* calls dark. The accessible name says what pressing does, from `labels` or the English default.
|
|
17
|
+
*/
|
|
18
|
+
export const ThemeToggle: FC<ThemeToggleProps> = ({ labels, className, style }) => {
|
|
19
|
+
const { scheme, setChoice } = useColorScheme()
|
|
20
|
+
const dark = scheme === 'dark'
|
|
21
|
+
const label = dark
|
|
22
|
+
? labels?.toLight ?? 'Switch to light mode'
|
|
23
|
+
: labels?.toDark ?? 'Switch to dark mode'
|
|
24
|
+
|
|
25
|
+
return <button
|
|
26
|
+
type="button" data-theme-toggle data-scheme={scheme} aria-label={label} title={label}
|
|
27
|
+
onClick={() => setChoice(dark ? 'light' : 'dark')}
|
|
28
|
+
className={cn(TOGGLE, className)} style={style}
|
|
29
|
+
>
|
|
30
|
+
{dark ? <Moon className="size-5" aria-hidden="true" /> : <Sun className="size-5" aria-hidden="true" />}
|
|
31
|
+
</button>
|
|
32
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { ColorSchemeChoice } from '../../scheme/types.js'
|
|
2
|
+
import type { StyledProps } from '../types.js'
|
|
3
|
+
|
|
4
|
+
export interface ColorSchemeModel {
|
|
5
|
+
/** What the page is showing: the stored choice, or the operating system's preference. */
|
|
6
|
+
scheme: 'light' | 'dark'
|
|
7
|
+
/** The visitor's explicit choice, or `null` while the page follows the operating system. */
|
|
8
|
+
choice: ColorSchemeChoice | null
|
|
9
|
+
/** Choose — `null` clears the choice and hands the page back to the operating system. */
|
|
10
|
+
setChoice: (choice: ColorSchemeChoice | null) => void
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/** The toggle's accessible names — what pressing it DOES. English defaults when absent. */
|
|
14
|
+
export interface ThemeToggleLabels {
|
|
15
|
+
/** Shown while the page is dark. Default "Switch to light mode". */
|
|
16
|
+
toLight?: string
|
|
17
|
+
/** Shown while the page is light. Default "Switch to dark mode". */
|
|
18
|
+
toDark?: string
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export interface ThemeToggleProps extends StyledProps {
|
|
22
|
+
labels?: ThemeToggleLabels
|
|
23
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
{
|
|
2
|
+
"reload": {
|
|
3
|
+
"title": "Злучэнне страчана",
|
|
4
|
+
"description": "Не ўдалося аднавіць злучэнне пасля некалькіх спробаў. Паспрабуйце яшчэ раз або перазагрузіце старонку, каб працягнуць.",
|
|
5
|
+
"action": "Перазагрузіць старонку",
|
|
6
|
+
"retry": "Паспрабаваць яшчэ раз",
|
|
7
|
+
"retrying": "Паўторнае падключэнне…"
|
|
8
|
+
}
|
|
9
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
{
|
|
2
|
+
"reload": {
|
|
3
|
+
"title": "Verbindung verloren",
|
|
4
|
+
"description": "Die Verbindung konnte nach mehreren Versuchen nicht wiederhergestellt werden. Versuche es erneut oder lade die Seite neu, um fortzufahren.",
|
|
5
|
+
"action": "Seite neu laden",
|
|
6
|
+
"retry": "Erneut versuchen",
|
|
7
|
+
"retrying": "Verbindung wird wiederhergestellt…"
|
|
8
|
+
}
|
|
9
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
{
|
|
2
|
+
"reload": {
|
|
3
|
+
"title": "Conexión perdida",
|
|
4
|
+
"description": "No se pudo restablecer la conexión tras varios intentos. Vuelve a intentarlo o recarga la página para continuar.",
|
|
5
|
+
"action": "Recargar página",
|
|
6
|
+
"retry": "Reintentar",
|
|
7
|
+
"retrying": "Reconectando…"
|
|
8
|
+
}
|
|
9
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
{
|
|
2
|
+
"reload": {
|
|
3
|
+
"title": "Connexion perdue",
|
|
4
|
+
"description": "Nous n’avons pas pu rétablir la connexion après plusieurs tentatives. Réessayez ou actualisez la page pour continuer.",
|
|
5
|
+
"action": "Actualiser la page",
|
|
6
|
+
"retry": "Réessayer",
|
|
7
|
+
"retrying": "Reconnexion…"
|
|
8
|
+
}
|
|
9
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
{
|
|
2
|
+
"reload": {
|
|
3
|
+
"title": "Utracono połączenie",
|
|
4
|
+
"description": "Nie udało się przywrócić połączenia mimo kilku prób. Spróbuj ponownie lub odśwież stronę, aby kontynuować.",
|
|
5
|
+
"action": "Odśwież stronę",
|
|
6
|
+
"retry": "Spróbuj ponownie",
|
|
7
|
+
"retrying": "Ponowne łączenie…"
|
|
8
|
+
}
|
|
9
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
{
|
|
2
|
+
"reload": {
|
|
3
|
+
"title": "Соединение потеряно",
|
|
4
|
+
"description": "Не удалось восстановить соединение после нескольких попыток. Попробуйте снова или перезагрузите страницу, чтобы продолжить.",
|
|
5
|
+
"action": "Перезагрузить страницу",
|
|
6
|
+
"retry": "Попробовать снова",
|
|
7
|
+
"retrying": "Переподключение…"
|
|
8
|
+
}
|
|
9
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
{
|
|
2
|
+
"reload": {
|
|
3
|
+
"title": "З'єднання втрачено",
|
|
4
|
+
"description": "Не вдалося відновити з'єднання після кількох спроб. Спробуйте ще раз або перезавантажте сторінку, щоб продовжити.",
|
|
5
|
+
"action": "Перезавантажити сторінку",
|
|
6
|
+
"retry": "Спробувати ще раз",
|
|
7
|
+
"retrying": "Перепідключення…"
|
|
8
|
+
}
|
|
9
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { i18nHelper } from '@owlmeans/i18n'
|
|
2
|
+
|
|
3
|
+
import en from './i18n/en.json' with { type: 'json' }
|
|
4
|
+
import pl from './i18n/pl.json' with { type: 'json' }
|
|
5
|
+
import ru from './i18n/ru.json' with { type: 'json' }
|
|
6
|
+
import be from './i18n/be.json' with { type: 'json' }
|
|
7
|
+
import uk from './i18n/uk.json' with { type: 'json' }
|
|
8
|
+
import es from './i18n/es.json' with { type: 'json' }
|
|
9
|
+
import de from './i18n/de.json' with { type: 'json' }
|
|
10
|
+
import fr from './i18n/fr.json' with { type: 'json' }
|
|
11
|
+
|
|
12
|
+
i18nHelper.addI18nLib('en', 'socket', en)
|
|
13
|
+
i18nHelper.addI18nLib('pl', 'socket', pl)
|
|
14
|
+
i18nHelper.addI18nLib('ru', 'socket', ru)
|
|
15
|
+
i18nHelper.addI18nLib('be', 'socket', be)
|
|
16
|
+
i18nHelper.addI18nLib('uk', 'socket', uk)
|
|
17
|
+
i18nHelper.addI18nLib('es', 'socket', es)
|
|
18
|
+
i18nHelper.addI18nLib('de', 'socket', de)
|
|
19
|
+
i18nHelper.addI18nLib('fr', 'socket', fr)
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import type { FC } from 'react'
|
|
2
|
+
import { useSocketRetry, useSocketStatus } from '@owlmeans/client-socket'
|
|
3
|
+
import { useI18nLib } from '@owlmeans/client-i18n'
|
|
4
|
+
import {
|
|
5
|
+
AlertDialog, AlertDialogAction, AlertDialogContent, AlertDialogDescription,
|
|
6
|
+
AlertDialogFooter, AlertDialogHeader, AlertDialogTitle
|
|
7
|
+
} from '../../@/components/ui/alert-dialog.js'
|
|
8
|
+
import { Button } from '../../@/components/ui/button.js'
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* A global, blocking "connection lost" prompt — opt in per app with `cfg.socket.reloadDialog`.
|
|
12
|
+
*
|
|
13
|
+
* Mount it once, above the router (`PanelApp` does), exactly like `PanelCookieConsent`: a dialog
|
|
14
|
+
* mounted inside a route is torn down on every navigation, and this one is meant to survive them
|
|
15
|
+
* all. It opens the moment `useSocketStatus()` reports `'lost'` — every `ws()`/`useWs()`
|
|
16
|
+
* connection in the app has exhausted its own retry budget (10 minutes by default).
|
|
17
|
+
*
|
|
18
|
+
* Two exits: "Try again" revives every lost connection (`useSocketRetry()`), and the dialog stays
|
|
19
|
+
* up showing progress until they are back online — or offers both buttons again if they are lost
|
|
20
|
+
* again. "Reload page" is the fallback that always works. The status service also retries by
|
|
21
|
+
* itself when the tab or window becomes active, so a socket that died in a background tab is
|
|
22
|
+
* usually back before anyone has to press anything.
|
|
23
|
+
*
|
|
24
|
+
* Non-dismissible on two levels: Radix's `AlertDialogContent` (unlike its plain `Dialog` sibling)
|
|
25
|
+
* never treats an outside click as a request to close, so there is no `onPointerDownOutside` to
|
|
26
|
+
* override in the first place — and `open` is passed with no `onOpenChange` at all, so even the
|
|
27
|
+
* Escape key it does listen for (blocked below anyway) has no handler to call.
|
|
28
|
+
*/
|
|
29
|
+
export const SocketReloadDialog: FC = () => {
|
|
30
|
+
const status = useSocketStatus()
|
|
31
|
+
const { retry, retrying } = useSocketRetry()
|
|
32
|
+
const t = useI18nLib('socket', 'reload')
|
|
33
|
+
const open = status === 'lost' || (retrying && status === 'reconnecting')
|
|
34
|
+
// Closing still animates the content out — keep the retry in its busy state until it is gone.
|
|
35
|
+
const busy = retrying || !open
|
|
36
|
+
|
|
37
|
+
return <AlertDialog open={open}>
|
|
38
|
+
<AlertDialogContent
|
|
39
|
+
data-socket-reload-dialog
|
|
40
|
+
onEscapeKeyDown={event => event.preventDefault()}
|
|
41
|
+
>
|
|
42
|
+
<AlertDialogHeader>
|
|
43
|
+
<AlertDialogTitle>{t('title')}</AlertDialogTitle>
|
|
44
|
+
<AlertDialogDescription>{t('description')}</AlertDialogDescription>
|
|
45
|
+
</AlertDialogHeader>
|
|
46
|
+
<AlertDialogFooter>
|
|
47
|
+
<Button variant="outline" data-socket-reload-action onClick={() => window.location.reload()}>
|
|
48
|
+
{t('action')}
|
|
49
|
+
</Button>
|
|
50
|
+
<AlertDialogAction
|
|
51
|
+
data-socket-retry-action
|
|
52
|
+
disabled={busy}
|
|
53
|
+
aria-busy={busy}
|
|
54
|
+
onClick={retry}
|
|
55
|
+
>
|
|
56
|
+
{busy ? t('retrying') : t('retry')}
|
|
57
|
+
</AlertDialogAction>
|
|
58
|
+
</AlertDialogFooter>
|
|
59
|
+
</AlertDialogContent>
|
|
60
|
+
</AlertDialog>
|
|
61
|
+
}
|
|
@@ -3,7 +3,7 @@ import { useMemo } from 'react'
|
|
|
3
3
|
import type { StatusProps } from './types.js'
|
|
4
4
|
import { usePanelI18n } from '@owlmeans/client-panel'
|
|
5
5
|
import { ResilientError } from '@owlmeans/error'
|
|
6
|
-
import { Alert, AlertDescription } from '
|
|
6
|
+
import { Alert, AlertDescription } from '../@/components/ui/alert.js'
|
|
7
7
|
|
|
8
8
|
const prepareMessage = (msg: string) => msg.replace(/:/g, '.')
|
|
9
9
|
|
package/src/components/text.tsx
CHANGED
|
@@ -1,20 +1,8 @@
|
|
|
1
1
|
import { usePanelI18n } from '@owlmeans/client-panel'
|
|
2
2
|
import type { FC, JSX } from 'react'
|
|
3
3
|
import type { TextProps, TextVariant } from './types.js'
|
|
4
|
-
import { cn } from '
|
|
5
|
-
|
|
6
|
-
const variantClasses: Record<TextVariant, string> = {
|
|
7
|
-
h1: 'scroll-m-20 text-4xl font-extrabold tracking-tight',
|
|
8
|
-
h2: 'scroll-m-20 text-3xl font-semibold tracking-tight',
|
|
9
|
-
h3: 'scroll-m-20 text-2xl font-semibold tracking-tight',
|
|
10
|
-
h4: 'scroll-m-20 text-xl font-semibold tracking-tight',
|
|
11
|
-
p: 'leading-7',
|
|
12
|
-
lead: 'text-xl text-muted-foreground',
|
|
13
|
-
large: 'text-lg font-semibold',
|
|
14
|
-
small: 'text-sm font-medium leading-none',
|
|
15
|
-
muted: 'text-sm text-muted-foreground',
|
|
16
|
-
blockquote: 'mt-6 border-l-2 pl-6 italic',
|
|
17
|
-
}
|
|
4
|
+
import { cn } from '../@/lib/utils.js'
|
|
5
|
+
import { variantClasses } from './consts.local.js'
|
|
18
6
|
|
|
19
7
|
const variantTag = (variant: TextVariant, nested: boolean): keyof JSX.IntrinsicElements => {
|
|
20
8
|
if (nested) return 'span'
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { type CSSProperties, type FC, useEffect, useState } from 'react'
|
|
2
|
+
import { Toaster as Sonner, type ToasterProps } from 'sonner'
|
|
3
|
+
import { cn } from '../@/lib/utils.js'
|
|
4
|
+
import { DARK_CLASS } from './consts.local.js'
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Follow whatever puts `.dark` on the document element.
|
|
8
|
+
*
|
|
9
|
+
* The panel's Tailwind theme switches on that class (`@custom-variant dark (&:is(.dark *))`),
|
|
10
|
+
* and every OwlMeans app drives it from something different — `next-themes` with
|
|
11
|
+
* `attribute="class"`, the owl theme provider, or nothing at all. Reading the class rather than a
|
|
12
|
+
* provider's hook means this component follows all three and depends on none of them: a package
|
|
13
|
+
* that imported `next-themes` would force it on every consumer of `@owlmeans/web-panel`, and a
|
|
14
|
+
* second copy of a theme provider is its own class of bug.
|
|
15
|
+
*
|
|
16
|
+
* `'system'` is the answer before the first paint and whenever nothing sets the class — sonner
|
|
17
|
+
* resolves it from `prefers-color-scheme`, which is what an app with no toggle means by it.
|
|
18
|
+
*/
|
|
19
|
+
const useDocumentTheme = (): ToasterProps['theme'] => {
|
|
20
|
+
const [theme, setTheme] = useState<ToasterProps['theme']>('system')
|
|
21
|
+
|
|
22
|
+
useEffect(() => {
|
|
23
|
+
const root = document.documentElement
|
|
24
|
+
const read = () => setTheme(root.classList.contains(DARK_CLASS) ? 'dark' : 'system')
|
|
25
|
+
read()
|
|
26
|
+
const observer = new MutationObserver(read)
|
|
27
|
+
observer.observe(root, { attributes: true, attributeFilter: ['class'] })
|
|
28
|
+
|
|
29
|
+
return () => observer.disconnect()
|
|
30
|
+
}, [])
|
|
31
|
+
|
|
32
|
+
return theme
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* The application's toast surface — mount it ONCE, in the layout.
|
|
37
|
+
*
|
|
38
|
+
* `toast()` from `sonner` is a module-global store, so a second mounted `Toaster` renders every
|
|
39
|
+
* message twice and no mounted `Toaster` renders none of them at all with nothing reported. The
|
|
40
|
+
* layout is therefore the only place this belongs.
|
|
41
|
+
*
|
|
42
|
+
* Colours come from the app's own theme tokens rather than sonner's palette: the CSS variables
|
|
43
|
+
* below are what its stylesheet paints with, so a toast follows `--popover` the way every other
|
|
44
|
+
* floating surface in the app does. A caller's `style` is merged OVER them, so an app that has to
|
|
45
|
+
* shift or recolour the stack keeps the rest.
|
|
46
|
+
*/
|
|
47
|
+
export const Toaster: FC<ToasterProps> = ({ style, theme, className, ...props }) => {
|
|
48
|
+
const detected = useDocumentTheme()
|
|
49
|
+
|
|
50
|
+
return <Sonner
|
|
51
|
+
theme={theme ?? detected}
|
|
52
|
+
className={cn('toaster group', className)}
|
|
53
|
+
richColors
|
|
54
|
+
closeButton
|
|
55
|
+
duration={5000}
|
|
56
|
+
position="top-right"
|
|
57
|
+
style={{
|
|
58
|
+
'--normal-bg': 'var(--popover)',
|
|
59
|
+
'--normal-text': 'var(--popover-foreground)',
|
|
60
|
+
'--normal-border': 'var(--border)',
|
|
61
|
+
...(style ?? {})
|
|
62
|
+
} as CSSProperties}
|
|
63
|
+
{...props}
|
|
64
|
+
/>
|
|
65
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
// Tailwind responsive sizes — mirrors the previous MUI breakpoint object.
|
|
2
|
+
// xs: 60/65px md: 120/125px lg: 200/205px
|
|
3
|
+
export const wrapperClasses = 'w-[65px] h-[65px] md:w-[125px] md:h-[125px] lg:w-[205px] lg:h-[205px]'
|
|
4
|
+
|
|
5
|
+
export const previewClasses = 'max-w-[60px] max-h-[60px] md:max-w-[120px] md:max-h-[120px] lg:max-w-[200px] lg:max-h-[200px]'
|
|
6
|
+
|
|
7
|
+
export const iconClasses = 'size-[60px] md:size-[120px] lg:size-[200px] text-primary'
|
|
@@ -2,13 +2,9 @@ import type { FC } from 'react'
|
|
|
2
2
|
import { ImageUploader as Uploader } from '@owlmeans/web-client'
|
|
3
3
|
import { ImagePlus } from 'lucide-react'
|
|
4
4
|
import type { ImageUploaderProps } from './types.js'
|
|
5
|
-
import { cn } from '
|
|
5
|
+
import { cn } from '../../@/lib/utils.js'
|
|
6
|
+
import { iconClasses, previewClasses, wrapperClasses } from './consts.local.js'
|
|
6
7
|
|
|
7
|
-
// Tailwind responsive sizes — mirrors the previous MUI breakpoint object.
|
|
8
|
-
// xs: 60/65px md: 120/125px lg: 200/205px
|
|
9
|
-
const wrapperClasses = 'w-[65px] h-[65px] md:w-[125px] md:h-[125px] lg:w-[205px] lg:h-[205px]'
|
|
10
|
-
const previewClasses = 'max-w-[60px] max-h-[60px] md:max-w-[120px] md:max-h-[120px] lg:max-w-[200px] lg:max-h-[200px]'
|
|
11
|
-
const iconClasses = 'size-[60px] md:size-[120px] lg:size-[200px] text-primary'
|
|
12
8
|
|
|
13
9
|
export const ImageUploader: FC<ImageUploaderProps> = ({ Root, rootProps, previewUrl, ...others }) => {
|
|
14
10
|
const DefaultRoot: FC<any> = ({ children, className, ...rest }) => (
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import type { FC } from 'react'
|
|
2
|
+
import {
|
|
3
|
+
CookieConsent, CookiePolicy, type ConsentGeoOptions, type CookieConsentProps, type CookiePolicyProps,
|
|
4
|
+
} from '@owlmeans/web-consent'
|
|
5
|
+
import { useLanguage } from '@owlmeans/client-i18n'
|
|
6
|
+
import { useContext } from '../context.js'
|
|
7
|
+
import type { AppConfig, AppContext } from '../types.js'
|
|
8
|
+
import { useConsentTranslate } from './translate.js'
|
|
9
|
+
import { useConsentWidgetPresent } from './presence.js'
|
|
10
|
+
import type { ConsentGeoPluginAppend, ConsentWidgetServiceAppend } from './types.js'
|
|
11
|
+
import { _localeParity } from './consts.local.js'
|
|
12
|
+
import type { BoundCookieConsentProps } from './types.local.js'
|
|
13
|
+
|
|
14
|
+
const BoundCookieConsent: FC<BoundCookieConsentProps> = ({ menuPresent, ...props }) => {
|
|
15
|
+
const [lng] = useLanguage()
|
|
16
|
+
const locale = props.locale ?? lng
|
|
17
|
+
const translate = useConsentTranslate(locale, props.translate)
|
|
18
|
+
|
|
19
|
+
return <CookieConsent
|
|
20
|
+
{...props}
|
|
21
|
+
locale={locale}
|
|
22
|
+
translate={translate}
|
|
23
|
+
noReopenButton={props.noReopenButton ?? menuPresent}
|
|
24
|
+
/>
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const MenuAwareCookieConsent: FC<CookieConsentProps> = props =>
|
|
28
|
+
<BoundCookieConsent {...props} menuPresent={useConsentWidgetPresent()} />
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* The geo gate in force: the prop, else `cfg.cookieConsent.geo`, else — when the application
|
|
32
|
+
* appended a locator of its own — the gate with nothing but that locator.
|
|
33
|
+
*/
|
|
34
|
+
const geoOf = (
|
|
35
|
+
prop: ConsentGeoOptions | undefined, context: AppContext<AppConfig> & Partial<ConsentGeoPluginAppend>
|
|
36
|
+
): ConsentGeoOptions | undefined =>
|
|
37
|
+
prop ?? context.cfg.cookieConsent?.geo ?? (typeof context.consentGeo === 'function' ? {} : undefined)
|
|
38
|
+
|
|
39
|
+
void _localeParity
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* The consent dialog, bound to this application's language and translations.
|
|
43
|
+
*
|
|
44
|
+
* `@owlmeans/web-consent` deliberately knows nothing about OwlMeans i18n — one of its consumers is
|
|
45
|
+
* an Astro site with none — so this is where the two meet.
|
|
46
|
+
*
|
|
47
|
+
* Also hides the floating re-open button whenever a host menu declares, through
|
|
48
|
+
* `useConsentMenuPresence()`, that it offers a `PanelConsentMenuWidget` row (a collapsed dropdown,
|
|
49
|
+
* a footer "Cookie settings" control) — an explicit `noReopenButton` from the caller always wins;
|
|
50
|
+
* only the default `undefined` falls through to this computed presence.
|
|
51
|
+
*
|
|
52
|
+
* The presence read needs `appendConsentWidgetService(context)`, and an application mounting the
|
|
53
|
+
* dialog on its own has no reason to call it. Without the service the dialog is exactly the plain
|
|
54
|
+
* bound dialog, floating button included — never a presence read against a state resource that
|
|
55
|
+
* was never registered, which throws inside render and blanks the whole application. The choice is
|
|
56
|
+
* made by component TYPE, because it is fixed for the context's lifetime: a service is appended
|
|
57
|
+
* while the context is built, before anything renders.
|
|
58
|
+
*/
|
|
59
|
+
export const PanelCookieConsent: FC<CookieConsentProps> = props => {
|
|
60
|
+
const context = useContext<
|
|
61
|
+
AppConfig, AppContext<AppConfig> & Partial<ConsentWidgetServiceAppend & ConsentGeoPluginAppend>
|
|
62
|
+
>()
|
|
63
|
+
const mode = props.mode ?? context.cfg.cookieConsent?.mode
|
|
64
|
+
const geo = geoOf(props.geo, context)
|
|
65
|
+
const bound = { ...props, ...(mode != null ? { mode } : {}), ...(geo != null ? { geo } : {}) }
|
|
66
|
+
|
|
67
|
+
return typeof context.consentWidget === 'function'
|
|
68
|
+
? <MenuAwareCookieConsent {...bound} />
|
|
69
|
+
: <BoundCookieConsent {...bound} />
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* The cookie-policy page, bound like the dialog — and told about the geo gate the same way, so it
|
|
74
|
+
* states the regional rule exactly when the dialog applies it.
|
|
75
|
+
*/
|
|
76
|
+
export const PanelCookiePolicy: FC<CookiePolicyProps> = props => {
|
|
77
|
+
const context = useContext<AppConfig, AppContext<AppConfig> & Partial<ConsentGeoPluginAppend>>()
|
|
78
|
+
const [lng] = useLanguage()
|
|
79
|
+
const locale = props.locale ?? lng
|
|
80
|
+
const translate = useConsentTranslate(locale, props.translate)
|
|
81
|
+
const geo = geoOf(props.geo, context)
|
|
82
|
+
|
|
83
|
+
return <CookiePolicy {...props} {...(geo != null ? { geo } : {})} locale={locale} translate={translate} />
|
|
84
|
+
}
|