@eifi1/ui-kit 0.51.3 → 0.51.5
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 +6 -6
- package/dist/account/account-settings-labels.js.map +1 -1
- package/dist/account/account-settings.js +11 -9
- package/dist/account/account-settings.js.map +1 -1
- package/dist/account/delete-account-setting.js +56 -65
- package/dist/account/delete-account-setting.js.map +1 -1
- package/dist/account/email-change-setting-labels.js.map +1 -1
- package/dist/account/email-change-setting.js.map +1 -1
- package/dist/account/passkeys-setting.js.map +1 -1
- package/dist/account/sessions-setting.js.map +1 -1
- package/dist/admin/admin-action-confirm.js +1 -3
- package/dist/admin/admin-action-confirm.js.map +1 -1
- package/dist/admin/admin-action-log.js.map +1 -1
- package/dist/admin/admin-area-labels.js +4 -1
- package/dist/admin/admin-area-labels.js.map +1 -1
- package/dist/admin/admin-overview.js +19 -11
- package/dist/admin/admin-overview.js.map +1 -1
- package/dist/admin/admin-sections.js.map +1 -1
- package/dist/admin/admin-tool-links.d.ts +1 -1
- package/dist/admin/admin-tool-links.js +7 -1
- package/dist/admin/admin-tool-links.js.map +1 -1
- package/dist/admin/invitations-panel.js +2 -13
- package/dist/admin/invitations-panel.js.map +1 -1
- package/dist/admin/mail-test-card.js.map +1 -1
- package/dist/admin/reviewer-scope-editor.js +4 -11
- package/dist/admin/reviewer-scope-editor.js.map +1 -1
- package/dist/admin/role-select.js.map +1 -1
- package/dist/admin/user-roster.js +1 -9
- package/dist/admin/user-roster.js.map +1 -1
- package/dist/auth/accept-invitation.js.map +1 -1
- package/dist/auth/auth-errors.js.map +1 -1
- package/dist/auth/forgot-password-form.js +23 -31
- package/dist/auth/forgot-password-form.js.map +1 -1
- package/dist/auth/register-form.js.map +1 -1
- package/dist/auth/reset-password-form.js.map +1 -1
- package/dist/auth/sign-in-form.js +13 -5
- package/dist/auth/sign-in-form.js.map +1 -1
- package/dist/auth/verify-email.js +1 -8
- package/dist/auth/verify-email.js.map +1 -1
- package/dist/billing/billing-banner.js.map +1 -1
- package/dist/billing/billing-labels.js.map +1 -1
- package/dist/billing/checkout-processing.js.map +1 -1
- package/dist/billing/plan-card.js +91 -85
- package/dist/billing/plan-card.js.map +1 -1
- package/dist/billing/plan-limit-toast.js.map +1 -1
- package/dist/billing/plan-limit.js.map +1 -1
- package/dist/billing/plan-price.js.map +1 -1
- package/dist/billing/plan-switch.js.map +1 -1
- package/dist/billing/subscription-actions.js.map +1 -1
- package/dist/bin/eifi1-pay-page.mjs +6 -1
- package/dist/components/account-chips.js.map +1 -1
- package/dist/components/alert-banner.js +1 -5
- package/dist/components/alert-banner.js.map +1 -1
- package/dist/components/amount-input.js +29 -12
- package/dist/components/amount-input.js.map +1 -1
- package/dist/components/authed-image.js.map +1 -1
- package/dist/components/autocomplete.js.map +1 -1
- package/dist/components/bulk-action-bar.js +1 -4
- package/dist/components/bulk-action-bar.js.map +1 -1
- package/dist/components/button-group.js.map +1 -1
- package/dist/components/button-look.js.map +1 -1
- package/dist/components/button.js +1 -7
- package/dist/components/button.js.map +1 -1
- package/dist/components/calculator.js +5 -5
- package/dist/components/calculator.js.map +1 -1
- package/dist/components/calendar-heatmap.js +4 -10
- package/dist/components/calendar-heatmap.js.map +1 -1
- package/dist/components/card.js +1 -8
- package/dist/components/card.js.map +1 -1
- package/dist/components/chart-zoom-core.js +3 -17
- package/dist/components/chart-zoom-core.js.map +1 -1
- package/dist/components/chart.d.ts +1 -1
- package/dist/components/chart.js +4 -22
- package/dist/components/chart.js.map +1 -1
- package/dist/components/checkbox-group.js +1 -4
- package/dist/components/checkbox-group.js.map +1 -1
- package/dist/components/chip-input.js +4 -1
- package/dist/components/chip-input.js.map +1 -1
- package/dist/components/chip.js +10 -5
- package/dist/components/chip.js.map +1 -1
- package/dist/components/choice-card.js +58 -74
- package/dist/components/choice-card.js.map +1 -1
- package/dist/components/column-mapper-labels.js.map +1 -1
- package/dist/components/column-mapper.js +167 -227
- package/dist/components/column-mapper.js.map +1 -1
- package/dist/components/combobox-core.js +5 -9
- package/dist/components/combobox-core.js.map +1 -1
- package/dist/components/combobox.js +1 -4
- package/dist/components/combobox.js.map +1 -1
- package/dist/components/confirm-dialog.js.map +1 -1
- package/dist/components/copy-button.js.map +1 -1
- package/dist/components/country-select.d.ts +5 -4
- package/dist/components/country-select.js +3 -19
- package/dist/components/country-select.js.map +1 -1
- package/dist/components/currency-option-list.js +13 -11
- package/dist/components/currency-option-list.js.map +1 -1
- package/dist/components/currency-select.js +1 -6
- package/dist/components/currency-select.js.map +1 -1
- package/dist/components/danger-confirm.js.map +1 -1
- package/dist/components/data-table-cells.js.map +1 -1
- package/dist/components/data-table-column-settings.js.map +1 -1
- package/dist/components/data-table-filter-popover.js +2 -18
- package/dist/components/data-table-filter-popover.js.map +1 -1
- package/dist/components/data-table-filters.js.map +1 -1
- package/dist/components/data-table-fit.js +7 -5
- package/dist/components/data-table-fit.js.map +1 -1
- package/dist/components/data-table-groups.js +3 -1
- package/dist/components/data-table-groups.js.map +1 -1
- package/dist/components/data-table-head.js +49 -57
- package/dist/components/data-table-head.js.map +1 -1
- package/dist/components/data-table-mobile.js +31 -44
- package/dist/components/data-table-mobile.js.map +1 -1
- package/dist/components/data-table-pagination.js.map +1 -1
- package/dist/components/data-table-row-actions.js +19 -16
- package/dist/components/data-table-row-actions.js.map +1 -1
- package/dist/components/data-table-row.js.map +1 -1
- package/dist/components/data-table-shared.js.map +1 -1
- package/dist/components/data-table-sort.js.map +1 -1
- package/dist/components/data-table-virtual.js +4 -1
- package/dist/components/data-table-virtual.js.map +1 -1
- package/dist/components/data-table.d.ts +8 -0
- package/dist/components/data-table.js +30 -39
- package/dist/components/data-table.js.map +1 -1
- package/dist/components/date-picker.js +1 -6
- package/dist/components/date-picker.js.map +1 -1
- package/dist/components/date-range-picker.js.map +1 -1
- package/dist/components/description-list.js +10 -10
- package/dist/components/description-list.js.map +1 -1
- package/dist/components/dialog-frame.js +9 -2
- package/dist/components/dialog-frame.js.map +1 -1
- package/dist/components/disclosure.js +17 -27
- package/dist/components/disclosure.js.map +1 -1
- package/dist/components/dropdown.js +25 -35
- package/dist/components/dropdown.js.map +1 -1
- package/dist/components/empty-state.js.map +1 -1
- package/dist/components/entity-combobox.js.map +1 -1
- package/dist/components/error-boundary.js.map +1 -1
- package/dist/components/field-base.js +5 -5
- package/dist/components/field-base.js.map +1 -1
- package/dist/components/field-parts.d.ts +1 -1
- package/dist/components/field-parts.js +10 -14
- package/dist/components/field-parts.js.map +1 -1
- package/dist/components/field-sync.js +8 -10
- package/dist/components/field-sync.js.map +1 -1
- package/dist/components/file-button.js.map +1 -1
- package/dist/components/file-dropzone.js.map +1 -1
- package/dist/components/floating-panel.js +4 -1
- package/dist/components/floating-panel.js.map +1 -1
- package/dist/components/focus-ring.js.map +1 -1
- package/dist/components/form-actions.js.map +1 -1
- package/dist/components/grouped-picker.js +11 -12
- package/dist/components/grouped-picker.js.map +1 -1
- package/dist/components/hover-menu.js +1 -4
- package/dist/components/hover-menu.js.map +1 -1
- package/dist/components/iban-input-labels.js.map +1 -1
- package/dist/components/icon-button.js +4 -1
- package/dist/components/icon-button.js.map +1 -1
- package/dist/components/icon-picker.js +6 -10
- package/dist/components/icon-picker.js.map +1 -1
- package/dist/components/image-grid.js +41 -50
- package/dist/components/image-grid.js.map +1 -1
- package/dist/components/inline-edit-field.js.map +1 -1
- package/dist/components/inline-entity-combobox.js +6 -12
- package/dist/components/inline-entity-combobox.js.map +1 -1
- package/dist/components/input.js +14 -2
- package/dist/components/input.js.map +1 -1
- package/dist/components/jump-calendar.js +1 -7
- package/dist/components/jump-calendar.js.map +1 -1
- package/dist/components/legal-labels.js +8 -2
- package/dist/components/legal-labels.js.map +1 -1
- package/dist/components/legal-page.d.ts +18 -1
- package/dist/components/legal-page.js +27 -2
- package/dist/components/legal-page.js.map +1 -1
- package/dist/components/legal.d.ts +40 -5
- package/dist/components/legal.js +41 -5
- package/dist/components/legal.js.map +1 -1
- package/dist/components/lightbox.js.map +1 -1
- package/dist/components/line-items.js +26 -36
- package/dist/components/line-items.js.map +1 -1
- package/dist/components/list-labels.js +3 -1
- package/dist/components/list-labels.js.map +1 -1
- package/dist/components/list.d.ts +18 -1
- package/dist/components/list.js +54 -13
- package/dist/components/list.js.map +1 -1
- package/dist/components/measured-grid.js +29 -53
- package/dist/components/measured-grid.js.map +1 -1
- package/dist/components/menu-item.js.map +1 -1
- package/dist/components/mini-calendar.js +13 -31
- package/dist/components/mini-calendar.js.map +1 -1
- package/dist/components/money-field.js.map +1 -1
- package/dist/components/month-picker.js +10 -21
- package/dist/components/month-picker.js.map +1 -1
- package/dist/components/multi-entity-combobox.js +3 -16
- package/dist/components/multi-entity-combobox.js.map +1 -1
- package/dist/components/multi-select.js.map +1 -1
- package/dist/components/nav-pills.js +10 -1
- package/dist/components/nav-pills.js.map +1 -1
- package/dist/components/number-field.js.map +1 -1
- package/dist/components/number-input.js +1 -7
- package/dist/components/number-input.js.map +1 -1
- package/dist/components/numpad-sheet.js +1 -4
- package/dist/components/numpad-sheet.js.map +1 -1
- package/dist/components/one-time-code-input.js +1 -7
- package/dist/components/one-time-code-input.js.map +1 -1
- package/dist/components/page-contents.js +13 -22
- package/dist/components/page-contents.js.map +1 -1
- package/dist/components/page-header.js +1 -11
- package/dist/components/page-header.js.map +1 -1
- package/dist/components/password-strength-labels.js.map +1 -1
- package/dist/components/password-strength.js +2 -8
- package/dist/components/password-strength.js.map +1 -1
- package/dist/components/phone-input.js +42 -57
- package/dist/components/phone-input.js.map +1 -1
- package/dist/components/picker-sheet.js.map +1 -1
- package/dist/components/pie-chart.js +1 -8
- package/dist/components/pie-chart.js.map +1 -1
- package/dist/components/popover.js.map +1 -1
- package/dist/components/progress-bar.js +16 -9
- package/dist/components/progress-bar.js.map +1 -1
- package/dist/components/qr-code.js +1 -8
- package/dist/components/qr-code.js.map +1 -1
- package/dist/components/row-actions.js +5 -1
- package/dist/components/row-actions.js.map +1 -1
- package/dist/components/search-field.js.map +1 -1
- package/dist/components/select.js +28 -38
- package/dist/components/select.js.map +1 -1
- package/dist/components/separator.js +1 -5
- package/dist/components/separator.js.map +1 -1
- package/dist/components/series-chart-axes.js +4 -1
- package/dist/components/series-chart-axes.js.map +1 -1
- package/dist/components/series-chart-budget.js.map +1 -1
- package/dist/components/series-chart-ticks.js.map +1 -1
- package/dist/components/series-chart.js +29 -45
- package/dist/components/series-chart.js.map +1 -1
- package/dist/components/settings-fields.js +21 -17
- package/dist/components/settings-fields.js.map +1 -1
- package/dist/components/share-card.js +4 -9
- package/dist/components/share-card.js.map +1 -1
- package/dist/components/sign-chip.js.map +1 -1
- package/dist/components/signature-pad.js +4 -13
- package/dist/components/signature-pad.js.map +1 -1
- package/dist/components/signed-amount.js +12 -5
- package/dist/components/signed-amount.js.map +1 -1
- package/dist/components/skeleton.js +2 -17
- package/dist/components/skeleton.js.map +1 -1
- package/dist/components/slider.js +13 -36
- package/dist/components/slider.js.map +1 -1
- package/dist/components/sparkline.js.map +1 -1
- package/dist/components/stat-tile.js +14 -10
- package/dist/components/stat-tile.js.map +1 -1
- package/dist/components/swatch-picker.js +14 -4
- package/dist/components/swatch-picker.js.map +1 -1
- package/dist/components/swipeable-row.d.ts +1 -1
- package/dist/components/swipeable-row.js +1 -8
- package/dist/components/swipeable-row.js.map +1 -1
- package/dist/components/table-skeleton.js +4 -1
- package/dist/components/table-skeleton.js.map +1 -1
- package/dist/components/table.js +12 -9
- package/dist/components/table.js.map +1 -1
- package/dist/components/tabs.js +5 -24
- package/dist/components/tabs.js.map +1 -1
- package/dist/components/text-link.js.map +1 -1
- package/dist/components/text.js.map +1 -1
- package/dist/components/tile-radio.js +1 -7
- package/dist/components/tile-radio.js.map +1 -1
- package/dist/components/time-input.js.map +1 -1
- package/dist/components/toast.js.map +1 -1
- package/dist/components/toggle-group.js +6 -1
- package/dist/components/toggle-group.js.map +1 -1
- package/dist/components/toggle-legend.js +2 -11
- package/dist/components/toggle-legend.js.map +1 -1
- package/dist/components/tooltip.js +2 -22
- package/dist/components/tooltip.js.map +1 -1
- package/dist/components/translation-review-editor.js +1 -4
- package/dist/components/translation-review-editor.js.map +1 -1
- package/dist/components/translation-review-parts.d.ts +1 -1
- package/dist/components/translation-review-parts.js +7 -1
- package/dist/components/translation-review-parts.js.map +1 -1
- package/dist/components/translation-review.js +18 -7
- package/dist/components/translation-review.js.map +1 -1
- package/dist/components/tree-view.js +14 -10
- package/dist/components/tree-view.js.map +1 -1
- package/dist/components/treemap.js +1 -13
- package/dist/components/treemap.js.map +1 -1
- package/dist/components/trigger-aria.js.map +1 -1
- package/dist/components/use-table-state.js +14 -11
- package/dist/components/use-table-state.js.map +1 -1
- package/dist/components/user-avatar.js +3 -26
- package/dist/components/user-avatar.js.map +1 -1
- package/dist/demo/demo-start.js +8 -4
- package/dist/demo/demo-start.js.map +1 -1
- package/dist/eslint/index.js +1 -1
- package/dist/feedback/feedback-attachment-labels.js.map +1 -1
- package/dist/feedback/feedback-attachment.js +1 -8
- package/dist/feedback/feedback-attachment.js.map +1 -1
- package/dist/feedback/feedback-capture.d.ts +1 -1
- package/dist/feedback/feedback-capture.js +3 -1
- package/dist/feedback/feedback-capture.js.map +1 -1
- package/dist/feedback/feedback-comment-thread.js +27 -13
- package/dist/feedback/feedback-comment-thread.js.map +1 -1
- package/dist/feedback/feedback-context.js +1 -4
- package/dist/feedback/feedback-context.js.map +1 -1
- package/dist/feedback/feedback-dialog.js.map +1 -1
- package/dist/feedback/feedback-inbox.js.map +1 -1
- package/dist/feedback/feedback-public-list.js +7 -1
- package/dist/feedback/feedback-public-list.js.map +1 -1
- package/dist/feedback/feedback-record.js +1 -5
- package/dist/feedback/feedback-record.js.map +1 -1
- package/dist/feedback/feedback-replies.js +25 -10
- package/dist/feedback/feedback-replies.js.map +1 -1
- package/dist/feedback/feedback-row-detail.js.map +1 -1
- package/dist/feedback/feedback-status-undo.js.map +1 -1
- package/dist/feedback/feedback-submit-dialog.js.map +1 -1
- package/dist/feedback/feedback-table.d.ts +3 -1
- package/dist/feedback/feedback-table.js +22 -5
- package/dist/feedback/feedback-table.js.map +1 -1
- package/dist/feedback/feedback-thread.js +2 -13
- package/dist/feedback/feedback-thread.js.map +1 -1
- package/dist/feedback/feedback-vocabulary.js.map +1 -1
- package/dist/feedback/feedback-vote-button.js.map +1 -1
- package/dist/hooks/use-anchored-rect.js.map +1 -1
- package/dist/hooks/use-document-title.js.map +1 -1
- package/dist/hooks/use-file-drop.js.map +1 -1
- package/dist/hooks/use-file-picker-labels.js.map +1 -1
- package/dist/hooks/use-file-picker.js.map +1 -1
- package/dist/hooks/use-focus-trap.js.map +1 -1
- package/dist/hooks/use-overlay-history.js +10 -5
- package/dist/hooks/use-overlay-history.js.map +1 -1
- package/dist/hooks/use-row-swipe.d.ts +1 -1
- package/dist/hooks/use-row-swipe.js +1 -6
- package/dist/hooks/use-row-swipe.js.map +1 -1
- package/dist/i18n/defaults.js +1 -4
- package/dist/i18n/defaults.js.map +1 -1
- package/dist/i18n/german.js +15 -4
- package/dist/i18n/german.js.map +1 -1
- package/dist/i18n/kit-labels.js +2 -8
- package/dist/i18n/kit-labels.js.map +1 -1
- package/dist/i18n/languages.js.map +1 -1
- package/dist/i18n/locales/en.js +19 -4
- package/dist/i18n/locales/en.js.map +2 -2
- package/dist/i18n/locales/es.js +15 -4
- package/dist/i18n/locales/es.js.map +1 -1
- package/dist/i18n/locales/fr.js +15 -4
- package/dist/i18n/locales/fr.js.map +1 -1
- package/dist/i18n/locales/hu.js +15 -4
- package/dist/i18n/locales/hu.js.map +1 -1
- package/dist/i18n/locales/it.js +15 -4
- package/dist/i18n/locales/it.js.map +1 -1
- package/dist/i18n/locales/zh.js +11 -3
- package/dist/i18n/locales/zh.js.map +1 -1
- package/dist/i18n/plurals.js.map +1 -1
- package/dist/i18n/review.js +15 -7
- package/dist/i18n/review.js.map +1 -1
- package/dist/i18n/shared-labels.js.map +1 -1
- package/dist/index.d.ts +17 -17
- package/dist/index.js +40 -23
- package/dist/index.js.map +1 -1
- package/dist/landing/access.js +1 -4
- package/dist/landing/access.js.map +1 -1
- package/dist/landing/landing-sections.js +35 -38
- package/dist/landing/landing-sections.js.map +1 -1
- package/dist/landing/page-seo.js.map +1 -1
- package/dist/lib/calc.js.map +1 -1
- package/dist/lib/clipboard-minus.js.map +1 -1
- package/dist/lib/dates.js.map +1 -1
- package/dist/lib/decimal-marks.js.map +1 -1
- package/dist/lib/device-settings.js +2 -1
- package/dist/lib/device-settings.js.map +1 -1
- package/dist/lib/direction.js.map +1 -1
- package/dist/lib/iban.js.map +1 -1
- package/dist/lib/logger.js +1 -5
- package/dist/lib/logger.js.map +1 -1
- package/dist/lib/person-name.js.map +1 -1
- package/dist/lib/phone.js.map +1 -1
- package/dist/lib/qr-encode.js +344 -8
- package/dist/lib/qr-encode.js.map +1 -1
- package/dist/lib/session-refresh.js.map +1 -1
- package/dist/lib/table-text.js +15 -3
- package/dist/lib/table-text.js.map +1 -1
- package/dist/lib/text-match.d.ts +20 -0
- package/dist/lib/text-match.js +11 -1
- package/dist/lib/text-match.js.map +1 -1
- package/dist/lib/translation-review.js.map +1 -1
- package/dist/notifications/notification-inbox.js +63 -44
- package/dist/notifications/notification-inbox.js.map +1 -1
- package/dist/notifications/notification-parts.js.map +1 -1
- package/dist/notifications/notification-types-setting.js.map +1 -1
- package/dist/notifications/notifications-labels.js.map +1 -1
- package/dist/notifications/push-device-setting.js +6 -1
- package/dist/notifications/push-device-setting.js.map +1 -1
- package/dist/notifications/push-devices-setting.js.map +1 -1
- package/dist/notifications/push-worker.js.map +1 -1
- package/dist/notifications/quiet-hours-setting.js.map +1 -1
- package/dist/notifications/use-push-device.js +4 -1
- package/dist/notifications/use-push-device.js.map +1 -1
- package/dist/offline/pwa-update-prompt.d.ts +1 -1
- package/dist/offline/pwa-update-prompt.js +7 -1
- package/dist/offline/pwa-update-prompt.js.map +1 -1
- package/dist/offline/query-persistence.js.map +1 -1
- package/dist/offline.d.ts +1 -1
- package/dist/offline.js +6 -1
- package/dist/offline.js.map +1 -1
- package/dist/pay/pay.css +8 -1
- package/dist/rhf/fields.d.ts +1 -2
- package/dist/rhf/fields.js +1 -10
- package/dist/rhf/fields.js.map +1 -1
- package/dist/rhf/form-core.js +1 -4
- package/dist/rhf/form-core.js.map +1 -1
- package/dist/rhf/line-items.js.map +1 -1
- package/dist/rhf/use-rhf-wizard-step.js.map +1 -1
- package/dist/search/command-palette.js +71 -62
- package/dist/search/command-palette.js.map +1 -1
- package/dist/search/global-search.js +34 -5
- package/dist/search/global-search.js.map +1 -1
- package/dist/search/search-index.js.map +1 -1
- package/dist/settings/device-reset-setting.js +1 -6
- package/dist/settings/device-reset-setting.js.map +1 -1
- package/dist/settings/settings-heading.js.map +1 -1
- package/dist/settings/settings-layout.js +9 -20
- package/dist/settings/settings-layout.js.map +1 -1
- package/dist/settings/use-settings-focus.d.ts +7 -0
- package/dist/settings/use-settings-focus.js +2 -0
- package/dist/settings/use-settings-focus.js.map +1 -1
- package/dist/settings/use-settings-route.js.map +1 -1
- package/dist/shell/app-shell.js +62 -31
- package/dist/shell/app-shell.js.map +1 -1
- package/dist/shell/auth-layout.js +1 -10
- package/dist/shell/auth-layout.js.map +1 -1
- package/dist/shell/dev-menu.d.ts +5 -0
- package/dist/shell/dev-menu.js +14 -7
- package/dist/shell/dev-menu.js.map +1 -1
- package/dist/shell/option-switcher-menu.js.map +1 -1
- package/dist/shell/sync-status-indicator.js +7 -6
- package/dist/shell/sync-status-indicator.js.map +1 -1
- package/dist/shell/top-bar-parts-labels.js.map +1 -1
- package/dist/shell/topbar-action-menu.d.ts +14 -1
- package/dist/shell/topbar-action-menu.js +85 -34
- package/dist/shell/topbar-action-menu.js.map +1 -1
- package/dist/shell/topbar-controls.js +1 -10
- package/dist/shell/topbar-controls.js.map +1 -1
- package/dist/shell/tour-menu.js +9 -1
- package/dist/shell/tour-menu.js.map +1 -1
- package/dist/shell.d.ts +1 -1
- package/dist/shell.js +2 -1
- package/dist/shell.js.map +1 -1
- package/dist/sync/db.js.map +1 -1
- package/dist/sync/engine.js +24 -6
- package/dist/sync/engine.js.map +1 -1
- package/dist/sync.d.ts +2 -2
- package/dist/sync.js +7 -1
- package/dist/sync.js.map +1 -1
- package/dist/testing/css-variables.js.map +1 -1
- package/dist/testing/index.d.ts +1 -1
- package/dist/testing/index.js +1 -3
- package/dist/testing/index.js.map +1 -1
- package/dist/testing/react.js.map +1 -1
- package/dist/testing/viewport.js +7 -4
- package/dist/testing/viewport.js.map +1 -1
- package/dist/theme/contrast-tokens.js +13 -2
- package/dist/theme/contrast-tokens.js.map +1 -1
- package/dist/theme/palette-derive.d.ts +1 -1
- package/dist/theme/palette-derive.js +18 -29
- package/dist/theme/palette-derive.js.map +1 -1
- package/dist/theme/palette-presets.js.map +1 -1
- package/dist/theme/palette-store.js.map +1 -1
- package/dist/theme/text-size.js.map +1 -1
- package/dist/theme/theme-store.js +1 -3
- package/dist/theme/theme-store.js.map +1 -1
- package/dist/tour/tour-catalogue.js.map +1 -1
- package/dist/tour/tour-dock.js +5 -1
- package/dist/tour/tour-dock.js.map +1 -1
- package/dist/tour/tour-engine.js +1 -4
- package/dist/tour/tour-engine.js.map +1 -1
- package/dist/tour/tour.js +21 -12
- package/dist/tour/tour.js.map +1 -1
- package/dist/tour/use-tour-progress.js.map +1 -1
- package/dist/tour/use-tour-url-sync.js.map +1 -1
- package/dist/wizard/stepper-nav.js +3 -24
- package/dist/wizard/stepper-nav.js.map +1 -1
- package/dist/wizard/types.js.map +1 -1
- package/dist/wizard/use-wizard.js +24 -28
- package/dist/wizard/use-wizard.js.map +1 -1
- package/dist/wizard/validation.js.map +1 -1
- package/dist/wizard/wizard-context.js.map +1 -1
- package/dist/wizard/wizard-step.d.ts +1 -1
- package/dist/wizard/wizard-step.js +1 -8
- package/dist/wizard/wizard-step.js.map +1 -1
- package/dist/wizard/wizard-summary.js.map +1 -1
- package/package.json +5 -2
- package/src/account/account-settings-labels.ts +1 -2
- package/src/account/account-settings.tsx +11 -17
- package/src/account/delete-account-setting.tsx +1 -6
- package/src/account/email-change-setting-labels.ts +1 -2
- package/src/account/email-change-setting.tsx +3 -1
- package/src/account/passkeys-setting.tsx +1 -3
- package/src/account/sessions-setting.tsx +4 -2
- package/src/admin/admin-action-confirm.tsx +4 -7
- package/src/admin/admin-action-log.tsx +29 -29
- package/src/admin/admin-area-labels.ts +4 -1
- package/src/admin/admin-overview.tsx +8 -2
- package/src/admin/admin-sections.tsx +3 -1
- package/src/admin/admin-tool-links.tsx +7 -1
- package/src/admin/invitations-panel.tsx +5 -11
- package/src/admin/mail-test-card.tsx +1 -2
- package/src/admin/reviewer-scope-editor.tsx +4 -9
- package/src/admin/role-select.tsx +4 -2
- package/src/admin/user-roster.tsx +2 -11
- package/src/auth/accept-invitation.tsx +1 -7
- package/src/auth/auth-errors.ts +1 -6
- package/src/auth/forgot-password-form.tsx +2 -7
- package/src/auth/register-form.tsx +7 -8
- package/src/auth/reset-password-form.tsx +2 -5
- package/src/auth/sign-in-form.tsx +15 -14
- package/src/auth/verify-email.tsx +2 -7
- package/src/billing/billing-banner.tsx +3 -7
- package/src/billing/billing-labels.ts +6 -4
- package/src/billing/checkout-processing.ts +0 -1
- package/src/billing/plan-card.tsx +9 -8
- package/src/billing/plan-limit-toast.tsx +1 -2
- package/src/billing/plan-limit.ts +1 -2
- package/src/billing/plan-price.ts +1 -4
- package/src/billing/plan-switch.tsx +1 -2
- package/src/billing/subscription-actions.tsx +5 -2
- package/src/components/account-chips.tsx +1 -7
- package/src/components/alert-banner.tsx +2 -8
- package/src/components/amount-input.tsx +206 -178
- package/src/components/authed-image.tsx +7 -4
- package/src/components/autocomplete.tsx +7 -9
- package/src/components/bulk-action-bar.tsx +2 -7
- package/src/components/button-group.tsx +1 -2
- package/src/components/button-look.ts +6 -17
- package/src/components/button.tsx +1 -4
- package/src/components/calculator.tsx +6 -9
- package/src/components/calendar-heatmap.tsx +5 -10
- package/src/components/card.tsx +9 -13
- package/src/components/chart-zoom-core.tsx +6 -33
- package/src/components/chart.tsx +8 -31
- package/src/components/checkbox-group.tsx +1 -4
- package/src/components/chip-input.tsx +6 -6
- package/src/components/chip.tsx +14 -26
- package/src/components/choice-card.tsx +4 -18
- package/src/components/column-mapper-labels.ts +3 -10
- package/src/components/column-mapper.tsx +33 -122
- package/src/components/combobox-core.tsx +17 -47
- package/src/components/combobox.tsx +2 -6
- package/src/components/confirm-dialog.tsx +1 -3
- package/src/components/copy-button.tsx +2 -4
- package/src/components/country-select.tsx +9 -21
- package/src/components/currency-option-list.tsx +16 -18
- package/src/components/currency-select.tsx +2 -7
- package/src/components/danger-confirm.tsx +8 -9
- package/src/components/data-table-cells.tsx +1 -2
- package/src/components/data-table-column-settings.tsx +1 -3
- package/src/components/data-table-filter-popover.tsx +5 -19
- package/src/components/data-table-filters.ts +1 -6
- package/src/components/data-table-fit.ts +7 -7
- package/src/components/data-table-groups.tsx +3 -1
- package/src/components/data-table-head.tsx +32 -46
- package/src/components/data-table-mobile.tsx +99 -108
- package/src/components/data-table-pagination.tsx +2 -6
- package/src/components/data-table-row-actions.tsx +25 -24
- package/src/components/data-table-row.tsx +16 -17
- package/src/components/data-table-shared.tsx +10 -16
- package/src/components/data-table-sort.ts +1 -2
- package/src/components/data-table-virtual.ts +9 -4
- package/src/components/data-table.tsx +497 -501
- package/src/components/date-picker.tsx +1 -7
- package/src/components/date-range-picker.tsx +3 -13
- package/src/components/description-list.tsx +7 -13
- package/src/components/dialog-frame.tsx +12 -3
- package/src/components/disclosure.tsx +8 -12
- package/src/components/dropdown.tsx +3 -11
- package/src/components/empty-state.tsx +1 -3
- package/src/components/entity-combobox.tsx +2 -6
- package/src/components/error-boundary.tsx +7 -7
- package/src/components/field-base.tsx +8 -14
- package/src/components/field-parts.tsx +12 -23
- package/src/components/field-sync.tsx +7 -11
- package/src/components/file-button.tsx +7 -3
- package/src/components/file-dropzone.tsx +7 -12
- package/src/components/floating-panel.tsx +44 -51
- package/src/components/focus-ring.ts +1 -2
- package/src/components/form-actions.tsx +1 -4
- package/src/components/grouped-picker.tsx +21 -16
- package/src/components/hover-menu.tsx +1 -4
- package/src/components/iban-input-labels.ts +1 -2
- package/src/components/icon-button.tsx +46 -48
- package/src/components/icon-picker.tsx +9 -20
- package/src/components/image-grid.tsx +1 -6
- package/src/components/inline-edit-field.tsx +1 -5
- package/src/components/inline-entity-combobox.tsx +11 -25
- package/src/components/input.tsx +14 -2
- package/src/components/jump-calendar.tsx +2 -6
- package/src/components/legal-labels.ts +8 -3
- package/src/components/legal-page.tsx +56 -6
- package/src/components/legal.tsx +83 -10
- package/src/components/lightbox.tsx +1 -3
- package/src/components/line-items.tsx +7 -15
- package/src/components/list-labels.ts +2 -0
- package/src/components/list.tsx +81 -27
- package/src/components/measured-grid.tsx +8 -30
- package/src/components/menu-item.tsx +1 -3
- package/src/components/mini-calendar.tsx +129 -159
- package/src/components/money-field.tsx +4 -2
- package/src/components/month-picker.tsx +14 -21
- package/src/components/multi-entity-combobox.tsx +6 -26
- package/src/components/multi-select.tsx +5 -9
- package/src/components/nav-pills.tsx +10 -2
- package/src/components/number-field.tsx +18 -15
- package/src/components/number-input.tsx +3 -19
- package/src/components/numpad-sheet.tsx +9 -13
- package/src/components/one-time-code-input.tsx +6 -11
- package/src/components/page-contents.tsx +2 -9
- package/src/components/page-header.tsx +5 -10
- package/src/components/password-strength-labels.ts +1 -2
- package/src/components/password-strength.tsx +6 -9
- package/src/components/phone-input.tsx +2 -13
- package/src/components/picker-sheet.tsx +2 -5
- package/src/components/pie-chart.tsx +6 -12
- package/src/components/popover.tsx +2 -1
- package/src/components/progress-bar.tsx +16 -25
- package/src/components/qr-code.tsx +2 -9
- package/src/components/row-actions.tsx +9 -1
- package/src/components/search-field.tsx +4 -5
- package/src/components/select.tsx +2 -10
- package/src/components/separator.tsx +1 -5
- package/src/components/series-chart-axes.ts +5 -5
- package/src/components/series-chart-budget.ts +1 -4
- package/src/components/series-chart-ticks.ts +1 -4
- package/src/components/series-chart.tsx +43 -83
- package/src/components/settings-fields.tsx +20 -15
- package/src/components/share-card.tsx +6 -14
- package/src/components/sign-chip.tsx +16 -16
- package/src/components/signature-pad.tsx +21 -13
- package/src/components/signed-amount.tsx +6 -14
- package/src/components/skeleton.tsx +2 -13
- package/src/components/slider.tsx +9 -20
- package/src/components/sparkline.tsx +2 -13
- package/src/components/stat-tile.tsx +13 -24
- package/src/components/swatch-picker.tsx +8 -3
- package/src/components/swipeable-row.tsx +2 -11
- package/src/components/table-skeleton.tsx +4 -1
- package/src/components/table.tsx +12 -8
- package/src/components/tabs.tsx +24 -39
- package/src/components/text-link.tsx +6 -6
- package/src/components/text.tsx +1 -2
- package/src/components/tile-radio.tsx +6 -19
- package/src/components/time-input.tsx +4 -5
- package/src/components/toast.tsx +3 -12
- package/src/components/toggle-group.tsx +9 -9
- package/src/components/toggle-legend.tsx +4 -16
- package/src/components/tooltip.tsx +9 -48
- package/src/components/translation-review-editor.tsx +4 -4
- package/src/components/translation-review-parts.tsx +7 -1
- package/src/components/translation-review.tsx +15 -16
- package/src/components/tree-view.tsx +17 -20
- package/src/components/treemap.tsx +3 -15
- package/src/components/trigger-aria.ts +1 -4
- package/src/components/use-table-state.ts +16 -17
- package/src/components/user-avatar.tsx +4 -21
- package/src/demo/demo-start.tsx +8 -4
- package/src/feedback/feedback-attachment-labels.ts +2 -1
- package/src/feedback/feedback-attachment.tsx +16 -29
- package/src/feedback/feedback-capture.ts +3 -1
- package/src/feedback/feedback-comment-thread.tsx +9 -6
- package/src/feedback/feedback-context.tsx +1 -4
- package/src/feedback/feedback-dialog.tsx +3 -4
- package/src/feedback/feedback-inbox.tsx +3 -9
- package/src/feedback/feedback-public-list.tsx +7 -1
- package/src/feedback/feedback-record.ts +6 -14
- package/src/feedback/feedback-replies.tsx +10 -5
- package/src/feedback/feedback-row-detail.tsx +2 -5
- package/src/feedback/feedback-status-undo.ts +1 -4
- package/src/feedback/feedback-submit-dialog.tsx +4 -4
- package/src/feedback/feedback-table.tsx +29 -9
- package/src/feedback/feedback-thread.tsx +4 -16
- package/src/feedback/feedback-vocabulary.ts +72 -82
- package/src/feedback/feedback-vote-button.tsx +9 -8
- package/src/hooks/use-anchored-rect.ts +1 -4
- package/src/hooks/use-document-title.ts +3 -1
- package/src/hooks/use-file-drop.ts +1 -3
- package/src/hooks/use-file-picker-labels.ts +1 -2
- package/src/hooks/use-file-picker.tsx +1 -5
- package/src/hooks/use-focus-trap.ts +1 -2
- package/src/hooks/use-overlay-history.ts +10 -5
- package/src/hooks/use-row-swipe.ts +1 -6
- package/src/i18n/defaults.ts +1 -4
- package/src/i18n/german.ts +42 -50
- package/src/i18n/kit-labels.tsx +5 -20
- package/src/i18n/languages.ts +2 -8
- package/src/i18n/locales/en.ts +15 -31
- package/src/i18n/locales/es.ts +44 -50
- package/src/i18n/locales/fr.ts +43 -52
- package/src/i18n/locales/hu.ts +35 -38
- package/src/i18n/locales/it.ts +44 -53
- package/src/i18n/locales/zh.ts +23 -33
- package/src/i18n/plurals.ts +4 -1
- package/src/i18n/review.ts +20 -7
- package/src/i18n/shared-labels.ts +1 -2
- package/src/index.ts +107 -32
- package/src/landing/access.ts +2 -7
- package/src/landing/landing-sections.tsx +14 -15
- package/src/landing/page-seo.ts +1 -3
- package/src/lib/calc.ts +4 -1
- package/src/lib/clipboard-minus.ts +4 -1
- package/src/lib/dates.ts +2 -10
- package/src/lib/decimal-marks.ts +1 -3
- package/src/lib/device-settings.ts +2 -1
- package/src/lib/direction.ts +1 -3
- package/src/lib/iban.ts +89 -9
- package/src/lib/logger.ts +1 -5
- package/src/lib/person-name.ts +1 -3
- package/src/lib/phone.ts +5 -8
- package/src/lib/qr-encode.ts +32 -8
- package/src/lib/session-refresh.ts +5 -6
- package/src/lib/table-text.ts +24 -6
- package/src/lib/text-match.ts +43 -1
- package/src/lib/translation-review.ts +1 -3
- package/src/notifications/notification-inbox.tsx +17 -4
- package/src/notifications/notification-parts.tsx +1 -2
- package/src/notifications/notification-types-setting.tsx +19 -18
- package/src/notifications/notifications-labels.ts +1 -2
- package/src/notifications/push-device-setting.tsx +7 -1
- package/src/notifications/push-devices-setting.tsx +7 -3
- package/src/notifications/push-worker.ts +10 -2
- package/src/notifications/quiet-hours-setting.tsx +4 -1
- package/src/notifications/use-push-device.ts +4 -1
- package/src/offline/pwa-update-prompt.tsx +7 -1
- package/src/offline/query-persistence.ts +9 -6
- package/src/offline.ts +6 -1
- package/src/rhf/fields.tsx +50 -19
- package/src/rhf/form-core.tsx +2 -6
- package/src/rhf/line-items.tsx +5 -7
- package/src/rhf/use-rhf-wizard-step.ts +3 -12
- package/src/search/command-palette.tsx +15 -23
- package/src/search/global-search.tsx +38 -8
- package/src/search/search-index.ts +5 -1
- package/src/settings/device-reset-setting.tsx +5 -8
- package/src/settings/settings-heading.tsx +3 -1
- package/src/settings/settings-layout.tsx +6 -13
- package/src/settings/use-settings-focus.ts +8 -0
- package/src/settings/use-settings-route.ts +4 -3
- package/src/shell/app-shell.tsx +48 -24
- package/src/shell/auth-layout.tsx +1 -6
- package/src/shell/dev-menu.tsx +18 -6
- package/src/shell/option-switcher-menu.tsx +1 -3
- package/src/shell/sync-status-indicator.tsx +14 -12
- package/src/shell/top-bar-parts-labels.ts +1 -3
- package/src/shell/topbar-action-menu.tsx +130 -45
- package/src/shell/topbar-controls.tsx +5 -19
- package/src/shell/tour-menu.tsx +9 -1
- package/src/shell.ts +1 -1
- package/src/sync/db.ts +5 -1
- package/src/sync/engine.ts +44 -12
- package/src/sync.ts +16 -2
- package/src/testing/css-variables.ts +1 -2
- package/src/testing/index.ts +1 -6
- package/src/testing/react.ts +1 -2
- package/src/testing/viewport.ts +9 -9
- package/src/theme/contrast-tokens.ts +13 -2
- package/src/theme/palette-derive.ts +24 -50
- package/src/theme/palette-presets.ts +0 -1
- package/src/theme/palette-store.ts +1 -4
- package/src/theme/text-size.ts +1 -1
- package/src/theme/theme-store.ts +2 -6
- package/src/tour/tour-catalogue.tsx +4 -2
- package/src/tour/tour-dock.ts +5 -1
- package/src/tour/tour-engine.ts +2 -6
- package/src/tour/tour.tsx +28 -12
- package/src/tour/use-tour-progress.ts +8 -2
- package/src/tour/use-tour-url-sync.ts +3 -1
- package/src/vite-env.d.ts +1 -4
- package/src/wizard/stepper-nav.tsx +10 -35
- package/src/wizard/types.ts +1 -4
- package/src/wizard/use-wizard.ts +28 -43
- package/src/wizard/validation.ts +1 -5
- package/src/wizard/wizard-context.tsx +2 -6
- package/src/wizard/wizard-step.tsx +1 -8
- package/src/wizard/wizard-summary.tsx +2 -6
- package/tokens.css +393 -152
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/settings/use-settings-focus.ts"],"sourcesContent":["import { useEffect, useRef } from \"react\";\nimport { useLocation, useNavigate } from \"react-router\";\nimport { prefersReducedMotion } from \"../lib/reduced-motion\";\n\n/**\n * The ring a `?focus=` target wears for {@link SETTINGS_FOCUS_MS} — keksdose's\n * `HIGHLIGHT`, in tokens: `--brand` for the ring and the page's own surface for the gap,\n * where keksdose named a slate for the dark theme. A ring rather than a background\n * flash: the destructive cards already own a background tint, and a ring reads the same\n * on every card.\n */\nexport const SETTINGS_FOCUS_RING = [\"ring-2\", \"ring-brand\", \"ring-offset-2\", \"ring-offset-page\"];\n\n/** How long the ring stays (§3.5). */\nexport const SETTINGS_FOCUS_MS = 1800;\n\n/** How long a target that is not on the page yet (a lazy card, a card waiting for its\n * data) is waited for before the hook gives up on it. */\nconst WAIT_MS = 5000;\n\nconst HEADING = \"[data-settings-heading], h1, h2, h3, h4, h5, h6\";\n\n/**\n * `?focus=<anchor>` (docs/settings-harmonization.md §3.5): scroll the card into view, ring\n * it for 1.8 s, move focus to its heading for a screen reader, then remove `focus` — and\n * ONLY `focus` — with a replace, so a reload does not ring it again. Every other\n * parameter stays: a tour's `tour` / `tourStep`, the admin roster's filters (dropping URL\n * parts broke keksdose's tours once, dev#495). The hash and `location.state` stay too.\n *\n * A search hit, ⌘K, a tour and a mail link all arrive this way. `SettingsLayout` calls it\n * for its own page; an app's own page can call it with no argument to act on its URL.\n *\n * `anchor`:\n * - left out: the URL's `focus` parameter;\n * - a string: that anchor (the layout passes the URL's, once its route is canonical);\n * - `null`: nothing to do yet — the layout passes it while the address is about to be\n * replaced, so a removal here cannot undo a redirect there.\n *\n * \"Once its group has rendered\": the effect runs after the commit that mounted the\n * group's cards, so the card is there; a card that mounts later (lazy, or behind its\n * data) is waited for, for a few seconds, before the hook gives up and leaves the URL\n * as it is.\n */\nexport function useSettingsFocus(anchor?: string | null): void {\n const location = useLocation();\n const navigate = useNavigate();\n const target = anchor === undefined ? new URLSearchParams(location.search).get(\"focus\") : anchor;\n // The ring outlives the effect that drew it: removing `focus` from the URL re-runs the\n // effect (and cleans it up) at once, and the ring must still stay its 1.8 s.\n const ring = useRef<{ el: HTMLElement; timer: number } | null>(null);\n\n useEffect(() => {\n if (!target) return;\n const { pathname, search, hash, state } = location;\n\n const land = (el: HTMLElement) => {\n el.scrollIntoView?.({ behavior: prefersReducedMotion() ? \"auto\" : \"smooth\", block: \"center\" });\n\n if (ring.current) {\n window.clearTimeout(ring.current.timer);\n ring.current.el.classList.remove(...SETTINGS_FOCUS_RING);\n }\n el.classList.add(...SETTINGS_FOCUS_RING);\n el.setAttribute(\"data-settings-focus\", \"\");\n const timer = window.setTimeout(() => {\n el.classList.remove(...SETTINGS_FOCUS_RING);\n el.removeAttribute(\"data-settings-focus\");\n if (ring.current?.el === el) ring.current = null;\n }, SETTINGS_FOCUS_MS);\n ring.current = { el, timer };\n\n // The heading, so a screen reader starts at the card's name; the card itself when\n // it has none. `preventScroll`: the smooth scroll above is already on its way.\n const heading = el.querySelector<HTMLElement>(HEADING) ?? el;\n if (!heading.hasAttribute(\"tabindex\")) heading.setAttribute(\"tabindex\", \"-1\");\n heading.focus({ preventScroll: true });\n\n const params = new URLSearchParams(search);\n if (params.get(\"focus\") !== target) return;\n params.delete(\"focus\");\n const rest = params.toString();\n navigate({ pathname, search: rest ? `?${rest}` : \"\", hash }, { replace: true, state });\n };\n\n const found = document.getElementById(target);\n if (found) {\n land(found);\n return;\n }\n const observer = new MutationObserver(() => {\n const el = document.getElementById(target);\n if (!el) return;\n observer.disconnect();\n window.clearTimeout(giveUp);\n land(el);\n });\n observer.observe(document.body, { childList: true, subtree: true });\n const giveUp = window.setTimeout(() => observer.disconnect(), WAIT_MS);\n return () => {\n observer.disconnect();\n window.clearTimeout(giveUp);\n };\n // `location`, a new object per navigation: the same hit picked twice is two\n // navigations, and rings twice.\n }, [target, location, navigate]);\n\n useEffect(\n () => () => {\n const current = ring.current;\n if (!current) return;\n window.clearTimeout(current.timer);\n current.el.classList.remove(...SETTINGS_FOCUS_RING);\n current.el.removeAttribute(\"data-settings-focus\");\n },\n [],\n );\n}\n"],"mappings":";AAAA,SAAS,WAAW,cAAc;AAClC,SAAS,aAAa,mBAAmB;AACzC,SAAS,4BAA4B;AAS9B,MAAM,sBAAsB,CAAC,UAAU,cAAc,iBAAiB,kBAAkB;AAGxF,MAAM,oBAAoB;AAIjC,MAAM,UAAU;AAEhB,MAAM,UAAU;AAuBT,SAAS,iBAAiB,QAA8B;AAC7D,QAAM,WAAW,YAAY;AAC7B,QAAM,WAAW,YAAY;AAC7B,QAAM,SAAS,WAAW,SAAY,IAAI,gBAAgB,SAAS,MAAM,EAAE,IAAI,OAAO,IAAI;AAG1F,QAAM,OAAO,OAAkD,IAAI;AAEnE,YAAU,MAAM;AACd,QAAI,CAAC,OAAQ;AACb,UAAM,EAAE,UAAU,QAAQ,MAAM,MAAM,IAAI;AAE1C,UAAM,OAAO,CAAC,OAAoB;AAChC,SAAG,iBAAiB,EAAE,UAAU,qBAAqB,IAAI,SAAS,UAAU,OAAO,SAAS,CAAC;AAE7F,UAAI,KAAK,SAAS;AAChB,eAAO,aAAa,KAAK,QAAQ,KAAK;AACtC,aAAK,QAAQ,GAAG,UAAU,OAAO,GAAG,mBAAmB;AAAA,MACzD;AACA,SAAG,UAAU,IAAI,GAAG,mBAAmB;AACvC,SAAG,aAAa,uBAAuB,EAAE;A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Aa,QAAQ,KAAK;AACjC,cAAQ,GAAG,UAAU,OAAO,GAAG,mBAAmB;AAClD,cAAQ,GAAG,gBAAgB,qBAAqB;AAAA,IAClD;AAAA,IACA,CAAC;AAAA,EACH;AACF;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../src/settings/use-settings-focus.ts"],"sourcesContent":["import { useEffect, useRef } from \"react\";\nimport { useLocation, useNavigate } from \"react-router\";\nimport { prefersReducedMotion } from \"../lib/reduced-motion\";\n\n/**\n * The ring a `?focus=` target wears for {@link SETTINGS_FOCUS_MS} — keksdose's\n * `HIGHLIGHT`, in tokens: `--brand` for the ring and the page's own surface for the gap,\n * where keksdose named a slate for the dark theme. A ring rather than a background\n * flash: the destructive cards already own a background tint, and a ring reads the same\n * on every card.\n */\nexport const SETTINGS_FOCUS_RING = [\"ring-2\", \"ring-brand\", \"ring-offset-2\", \"ring-offset-page\"];\n\n/** How long the ring stays (§3.5). */\nexport const SETTINGS_FOCUS_MS = 1800;\n\n/** How long a target that is not on the page yet (a lazy card, a card waiting for its\n * data) is waited for before the hook gives up on it. */\nconst WAIT_MS = 5000;\n\nconst HEADING = \"[data-settings-heading], h1, h2, h3, h4, h5, h6\";\n\n/**\n * `?focus=<anchor>` (docs/settings-harmonization.md §3.5): scroll the card into view, ring\n * it for 1.8 s, move focus to its heading for a screen reader, then remove `focus` — and\n * ONLY `focus` — with a replace, so a reload does not ring it again. Every other\n * parameter stays: a tour's `tour` / `tourStep`, the admin roster's filters (dropping URL\n * parts broke keksdose's tours once, dev#495). The hash and `location.state` stay too.\n *\n * A search hit, ⌘K, a tour and a mail link all arrive this way. `SettingsLayout` calls it\n * for its own page; an app's own page can call it with no argument to act on its URL.\n *\n * `anchor`:\n * - left out: the URL's `focus` parameter;\n * - a string: that anchor (the layout passes the URL's, once its route is canonical);\n * - `null`: nothing to do yet — the layout passes it while the address is about to be\n * replaced, so a removal here cannot undo a redirect there.\n *\n * \"Once its group has rendered\": the effect runs after the commit that mounted the\n * group's cards, so the card is there; a card that mounts later (lazy, or behind its\n * data) is waited for, for a few seconds, before the hook gives up and leaves the URL\n * as it is.\n */\nexport function useSettingsFocus(anchor?: string | null): void {\n const location = useLocation();\n const navigate = useNavigate();\n const target = anchor === undefined ? new URLSearchParams(location.search).get(\"focus\") : anchor;\n // The ring outlives the effect that drew it: removing `focus` from the URL re-runs the\n // effect (and cleans it up) at once, and the ring must still stay its 1.8 s.\n const ring = useRef<{ el: HTMLElement; timer: number } | null>(null);\n\n useEffect(() => {\n if (!target) return;\n const { pathname, search, hash, state } = location;\n\n const land = (el: HTMLElement) => {\n el.scrollIntoView?.({ behavior: prefersReducedMotion() ? \"auto\" : \"smooth\", block: \"center\" });\n\n if (ring.current) {\n window.clearTimeout(ring.current.timer);\n ring.current.el.classList.remove(...SETTINGS_FOCUS_RING);\n }\n el.classList.add(...SETTINGS_FOCUS_RING);\n el.setAttribute(\"data-settings-focus\", \"\");\n const timer = window.setTimeout(() => {\n el.classList.remove(...SETTINGS_FOCUS_RING);\n el.removeAttribute(\"data-settings-focus\");\n if (ring.current?.el === el) ring.current = null;\n }, SETTINGS_FOCUS_MS);\n ring.current = { el, timer };\n\n // The heading, so a screen reader starts at the card's name; the card itself when\n // it has none. `preventScroll`: the smooth scroll above is already on its way.\n const heading = el.querySelector<HTMLElement>(HEADING) ?? el;\n if (!heading.hasAttribute(\"tabindex\")) heading.setAttribute(\"tabindex\", \"-1\");\n heading.focus({ preventScroll: true });\n\n const params = new URLSearchParams(search);\n if (params.get(\"focus\") !== target) return;\n params.delete(\"focus\");\n const rest = params.toString();\n navigate({ pathname, search: rest ? `?${rest}` : \"\", hash }, { replace: true, state });\n };\n\n const found = document.getElementById(target);\n if (found) {\n land(found);\n return;\n }\n const observer = new MutationObserver(() => {\n const el = document.getElementById(target);\n if (!el) return;\n observer.disconnect();\n window.clearTimeout(giveUp);\n land(el);\n });\n observer.observe(document.body, { childList: true, subtree: true });\n const giveUp = window.setTimeout(() => observer.disconnect(), WAIT_MS);\n return () => {\n observer.disconnect();\n window.clearTimeout(giveUp);\n };\n // `location`, a new object per navigation: the same hit picked twice is two\n // navigations, and rings twice.\n }, [target, location, navigate]);\n\n useEffect(\n () => () => {\n const current = ring.current;\n if (!current) return;\n window.clearTimeout(current.timer);\n current.el.classList.remove(...SETTINGS_FOCUS_RING);\n current.el.removeAttribute(\"data-settings-focus\");\n },\n [],\n );\n}\n\n/**\n * {@link useSettingsFocus} under a name for any page (0.51.4, keksdose run 89): the hook\n * was always allowed on an app's own pages (keksdose's /reports/matching lands\n * `?focus=matching-unmatched` on a card), but its name said Settings at every such call\n * site. The same function, so the two cannot drift; `useSettingsFocus` stays.\n */\nexport const useFocusParam: typeof useSettingsFocus = useSettingsFocus;\n"],"mappings":";AAAA,SAAS,WAAW,cAAc;AAClC,SAAS,aAAa,mBAAmB;AACzC,SAAS,4BAA4B;AAS9B,MAAM,sBAAsB,CAAC,UAAU,cAAc,iBAAiB,kBAAkB;AAGxF,MAAM,oBAAoB;AAIjC,MAAM,UAAU;AAEhB,MAAM,UAAU;AAuBT,SAAS,iBAAiB,QAA8B;AAC7D,QAAM,WAAW,YAAY;AAC7B,QAAM,WAAW,YAAY;AAC7B,QAAM,SAAS,WAAW,SAAY,IAAI,gBAAgB,SAAS,MAAM,EAAE,IAAI,OAAO,IAAI;AAG1F,QAAM,OAAO,OAAkD,IAAI;AAEnE,YAAU,MAAM;AACd,QAAI,CAAC,OAAQ;AACb,UAAM,EAAE,UAAU,QAAQ,MAAM,MAAM,IAAI;AAE1C,UAAM,OAAO,CAAC,OAAoB;AAChC,SAAG,iBAAiB,EAAE,UAAU,qBAAqB,IAAI,SAAS,UAAU,OAAO,SAAS,CAAC;AAE7F,UAAI,KAAK,SAAS;AAChB,eAAO,aAAa,KAAK,QAAQ,KAAK;AACtC,aAAK,QAAQ,GAAG,UAAU,OAAO,GAAG,mBAAmB;AAAA,MACzD;AACA,SAAG,UAAU,IAAI,GAAG,mBAAmB;AACvC,SAAG,aAAa,uB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AACd,aAAO,aAAa,QAAQ,KAAK;AACjC,cAAQ,GAAG,UAAU,OAAO,GAAG,mBAAmB;AAClD,cAAQ,GAAG,gBAAgB,qBAAqB;AAAA,IAClD;AAAA,IACA,CAAC;AAAA,EACH;AACF;AAQO,MAAM,gBAAyC;","names":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/settings/use-settings-route.ts"],"sourcesContent":["import { useCallback, useEffect, useMemo } from \"react\";\nimport { useLocation, useNavigate } from \"react-router\";\nimport { usePhoneLayout } from \"../hooks/use-breakpoint\";\nimport { normalizeSettingsBase, visibleSettingsGroups } from \"./settings-catalogue\";\nimport type { SettingsEntry, SettingsGroup } from \"./settings-catalogue\";\n\n/**\n * Which layout the settings page is in. `\"auto\"` follows the screen (`usePhoneLayout()`,\n * as `Tabs` does); `\"desktop\"` / `\"phone\"` pin one — for a preview of both side by side,\n * where the window is one width.\n */\nexport type SettingsLayoutMode = \"auto\" | \"desktop\" | \"phone\";\n\nexport interface UseSettingsRouteOptions<G extends string> {\n groups: readonly SettingsGroup<G>[];\n /** The catalogue's entries. Given, a group with no visible entry is hidden (§4.1), and\n * `/settings?focus=<anchor>` finds the anchor's group. */\n entries?: readonly SettingsEntry<G>[];\n /** `/settings` or `/admin`. */\n basePath: string;\n /** The group `/settings` opens on a desktop. Default: the first visible group (§4.1). */\n defaultGroup?: G;\n /** Retired group ids and their successors — `{ overview: \"metrics\" }` — applied with a\n * replace (§3.1, keksdose's admin). */\n aliases?: Readonly<Partial<Record<string, G>>>;\n /** See {@link SettingsLayoutMode}. Default `\"auto\"`. */\n layout?: SettingsLayoutMode;\n}\n\nexport interface SettingsRoute<G extends string> {\n /** The group on screen. `null` on a phone's list (and while there is no visible group). */\n group: G | null;\n /** The segment after the group, owned by a card; `null` without one. */\n sub: string | null;\n /** `?focus=<anchor>`, or `null`. */\n focus: string | null;\n /** Open a group: a PUSH on a phone, so the system back gesture returns to the list; a\n * REPLACE on a desktop, so back leaves settings instead of walking every group looked\n * at (§3.1, keksdose's rule). */\n select: (group: G) => void;\n /** See {@link SettingsLayoutContextValue.selectSub}. */\n selectSub: (sub: string | null) => void;\n /** To the list: `navigate(-1)` when the list is the previous entry, else a replace to\n * the base path — so a deep link from a mail never sends \"back\" out of the app. */\n back: () => void;\n /** The visible groups, in order. */\n groups: SettingsGroup<G>[];\n /** Whether the phone layout is in force. */\n phone: boolean;\n /** Whether this location is about to be replaced (a legacy hash, an alias, an unknown\n * group): what renders meanwhile is already the destination's, but nothing should\n * act on the URL until it is. */\n redirecting: boolean;\n /** Whether the list is the entry before this one (the marker {@link select} and the\n * list's links leave in `location.state`). */\n fromList: boolean;\n}\n\n/**\n * The `location.state` key that says \"the list is the entry before this one\". Written by\n * the phone list's links and {@link SettingsRoute.select}; carried over by every replace\n * the page makes, since a replace does not change what came before.\n */\nexport const SETTINGS_FROM_LIST_STATE = \"eifi1.settings.fromList\";\n\n/** `location.state` with the marker set — for an app's own link to a group page that is\n * opened FROM the list it renders. */\nexport function settingsFromListState(): Record<string, true> {\n return { [SETTINGS_FROM_LIST_STATE]: true };\n}\n\nfunction isFromList(state: unknown): boolean {\n return typeof state === \"object\" && state !== null && (state as Record<string, unknown>)[SETTINGS_FROM_LIST_STATE] === true;\n}\n\nexport interface SettingsLocation {\n pathname: string;\n search: string;\n hash: string;\n}\n\nexport interface SettingsLocationRules<G extends string> {\n basePath: string;\n /** The visible group ids. */\n groups: readonly G[];\n /** The resolved default group, `null` with no visible group. */\n defaultGroup: G | null;\n aliases?: Readonly<Partial<Record<string, G>>>;\n /** Anchor → group, for `/settings?focus=<anchor>` with no group named. */\n anchorGroup?: ReadonlyMap<string, G>;\n phone: boolean;\n}\n\nexport interface SettingsLocationResult<G extends string> {\n group: G | null;\n sub: string | null;\n /** The path (with query) to replace the location with, or `null` when it is already\n * canonical. */\n redirect: string | null;\n}\n\n/**\n * Where a location lands on the settings page — pure, so the rules of §3.1 are testable\n * without a router:\n *\n * - `/settings` → the default group on a desktop (a replace), the list on a phone;\n * - `/settings/<group>[/<sub>]` → that group, the rest of the path as `sub`;\n * - an alias → its successor, with a replace, `sub`, query and hash kept;\n * - an unknown or hidden group → the default group (desktop) or the list (phone), with\n * a replace and the query kept — never a 404, so an old bookmark still lands;\n * - keksdose's legacy `/settings?<query>#<group>[/<sub>]` →\n * `/settings/<group>[/<sub>]?<query>`, the WHOLE query carried (a tour's\n * `tour`/`tourStep` as well as `focus`), then resolved by the rules above;\n * - `/settings?focus=<anchor>` with no group → the anchor's group, where it can ring.\n */\nexport function resolveSettingsLocation<G extends string>(\n location: SettingsLocation,\n rules: SettingsLocationRules<G>,\n): SettingsLocationResult<G> {\n const base = normalizeSettingsBase(rules.basePath);\n const { pathname, search, hash } = location;\n const known = new Set<string>(rules.groups);\n const atBase = pathname === base || pathname === `${base}/` || (base === \"\" && pathname === \"/\");\n\n if (atBase) {\n const legacy = hash.replace(/^#/, \"\").replace(/^\\/+/, \"\");\n if (legacy) {\n // The hash becomes the path; whatever the path then says (an alias, an unknown\n // group) is resolved in the same step, so the history sees one replace.\n const converted = `${base}/${legacy}`;\n const next = resolveSettingsLocation({ pathname: converted, search, hash: \"\" }, rules);\n return { ...next, redirect: next.redirect ?? `${converted}${search}` };\n }\n const anchor = new URLSearchParams(search).get(\"focus\");\n const anchorGroup = anchor ? rules.anchorGroup?.get(anchor) : undefined;\n if (anchorGroup && known.has(anchorGroup)) {\n return { group: anchorGroup, sub: null, redirect: `${base}/${anchorGroup}${search}` };\n }\n if (rules.phone || rules.defaultGroup === null) return { group: null, sub: null, redirect: null };\n return { group: rules.defaultGroup, sub: null, redirect: `${base}/${rules.defaultGroup}${search}` };\n }\n\n if (!pathname.startsWith(`${base}/`)) {\n // Mounted somewhere `basePath` does not name: a misconfiguration, not a link to\n // correct. Show what the base path would, and leave the address alone.\n return { group: rules.phone ? null : rules.defaultGroup, sub: null, redirect: null };\n }\n const rest = pathname.slice(base.length + 1);\n const [segment = \"\", ...subParts] = rest.split(\"/\");\n const sub = subParts.filter(Boolean).join(\"/\") || null;\n if (known.has(segment)) return { group: segment as G, sub, redirect: null };\n\n const successor = rules.aliases?.[segment];\n if (successor !== undefined && known.has(successor)) {\n return {\n group: successor,\n sub,\n redirect: `${base}/${successor}${sub ? `/${sub}` : \"\"}${search}${hash}`,\n };\n }\n\n // Unknown or hidden. The hash is dropped: on the list it would read as a legacy group\n // and send the page round again.\n if (rules.phone || rules.defaultGroup === null) {\n return { group: null, sub: null, redirect: `${base || \"/\"}${search}` };\n }\n return { group: rules.defaultGroup, sub: null, redirect: `${base}/${rules.defaultGroup}${search}` };\n}\n\n/**\n * The settings page's route (docs/settings-harmonization.md §3.1): which group the URL\n * names, and the history rules for moving between groups.\n *\n * The URL IS the selection, as it was in keksdose (where it was the hash): there is no\n * state to keep in step with it, so a deep link, a reload, back and forward all land\n * where the address says. Everything that is not canonical — `/settings` on a desktop, a\n * legacy hash, an alias, an unknown or hidden group — is replaced by its canonical path.\n *\n * **The replace runs on every navigation**, keyed on `location.key`, not once on mount:\n * the router keeps the page mounted across links followed inside the app — keksdose's\n * inbox renders admin-typed URLs, and a push click routes an open window without a\n * reload — so a legacy `/settings#security` arriving while the page is open converts too\n * (§10.1).\n */\nexport function useSettingsRoute<G extends string>(options: UseSettingsRouteOptions<G>): SettingsRoute<G> {\n const { groups, entries, basePath, defaultGroup, aliases, layout = \"auto\" } = options;\n const location = useLocation();\n const navigate = useNavigate();\n const narrow = usePhoneLayout();\n const phone = layout === \"phone\" || (layout === \"auto\" && narrow);\n const base = normalizeSettingsBase(basePath);\n\n const visible = useMemo(() => visibleSettingsGroups(groups, entries), [groups, entries]);\n const anchorGroup = useMemo(() => {\n const map = new Map<string, G>();\n for (const e of entries ?? []) if (e.visible !== false && !map.has(e.anchor)) map.set(e.anchor, e.group);\n return map;\n }, [entries]);\n const ids = visible.map((g) => g.id);\n const fallback =\n defaultGroup !== undefined && ids.includes(defaultGroup) ? defaultGroup : (ids[0] ?? null);\n\n const { group, sub, redirect } = resolveSettingsLocation(location, {\n basePath: base,\n groups: ids,\n defaultGroup: fallback,\n aliases,\n anchorGroup,\n phone,\n });\n\n const { key, state, search } = location;\n useEffect(() => {\n // `state` rides along: the marker describes the entry BEFORE this one, which a\n // replace does not change.\n if (redirect) navigate(redirect, { replace: true, state });\n }, [key, redirect, state, navigate]);\n\n const select = useCallback(\n (next: G) => {\n const to = `${base}/${next}`;\n // From the list, the push marks it, so the group page's back is a real back.\n if (phone) navigate(to, group === null ? { state: settingsFromListState() } : undefined);\n // A new group is a new page: the old one's query (a focus, a roster filter) stays\n // behind, as keksdose's `selectGroup` left it.\n else navigate(to, { replace: true, state });\n },\n [base, phone, group, state, navigate],\n );\n\n const selectSub = useCallback(\n (next: string | null) => {\n if (group === null) return;\n navigate(`${base}/${group}${next ? `/${next}` : \"\"}${search}`, { replace: true, state });\n },\n [base, group, search, state, navigate],\n );\n\n const fromList = isFromList(state);\n const back = useCallback(() => {\n if (fromList) navigate(-1);\n else navigate(base || \"/\", { replace: true });\n }, [fromList, base, navigate]);\n\n return {\n group,\n sub,\n focus: new URLSearchParams(search).get(\"focus\"),\n select,\n selectSub,\n back,\n groups: visible,\n phone,\n redirecting: redirect !== null,\n fromList,\n };\n}\n"],"mappings":";AAAA,SAAS,aAAa,WAAW,eAAe;AAChD,SAAS,aAAa,mBAAmB;AACzC,SAAS,sBAAsB;AAC/B,SAAS,uBAAuB,6BAA6B;AA4DtD,MAAM,2BAA2B;AAIjC,SAAS,wBAA8C;AAC5D,SAAO,EAAE,CAAC,wBAAwB,GAAG,KAAK;AAC5C;AAEA,SAAS,WAAW,OAAyB;AAC3C,SAAO,OAAO,UAAU,YAAY,UAAU,QAAS,MAAkC,wBAAwB,MAAM;AACzH;AA0CO,SAAS,wBACd,UACA,OAC2B;AAC3B,QAAM,OAAO,sBAAsB,MAAM,QAAQ;AACjD,QAAM,EAAE,UAAU,QAAQ,KAAK,IAAI;AACnC,QAAM,QAAQ,IAAI,IAAY,MAAM,MA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ACA,QAAQ;AAAA,IACR;AAAA,IACA,aAAa,aAAa;AAAA,IAC1B;AAAA,EACF;AACF;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../src/settings/use-settings-route.ts"],"sourcesContent":["import { useCallback, useEffect, useMemo } from \"react\";\nimport { useLocation, useNavigate } from \"react-router\";\nimport { usePhoneLayout } from \"../hooks/use-breakpoint\";\nimport { normalizeSettingsBase, visibleSettingsGroups } from \"./settings-catalogue\";\nimport type { SettingsEntry, SettingsGroup } from \"./settings-catalogue\";\n\n/**\n * Which layout the settings page is in. `\"auto\"` follows the screen (`usePhoneLayout()`,\n * as `Tabs` does); `\"desktop\"` / `\"phone\"` pin one — for a preview of both side by side,\n * where the window is one width.\n */\nexport type SettingsLayoutMode = \"auto\" | \"desktop\" | \"phone\";\n\nexport interface UseSettingsRouteOptions<G extends string> {\n groups: readonly SettingsGroup<G>[];\n /** The catalogue's entries. Given, a group with no visible entry is hidden (§4.1), and\n * `/settings?focus=<anchor>` finds the anchor's group. */\n entries?: readonly SettingsEntry<G>[];\n /** `/settings` or `/admin`. */\n basePath: string;\n /** The group `/settings` opens on a desktop. Default: the first visible group (§4.1). */\n defaultGroup?: G;\n /** Retired group ids and their successors — `{ overview: \"metrics\" }` — applied with a\n * replace (§3.1, keksdose's admin). */\n aliases?: Readonly<Partial<Record<string, G>>>;\n /** See {@link SettingsLayoutMode}. Default `\"auto\"`. */\n layout?: SettingsLayoutMode;\n}\n\nexport interface SettingsRoute<G extends string> {\n /** The group on screen. `null` on a phone's list (and while there is no visible group). */\n group: G | null;\n /** The segment after the group, owned by a card; `null` without one. */\n sub: string | null;\n /** `?focus=<anchor>`, or `null`. */\n focus: string | null;\n /** Open a group: a PUSH on a phone, so the system back gesture returns to the list; a\n * REPLACE on a desktop, so back leaves settings instead of walking every group looked\n * at (§3.1, keksdose's rule). */\n select: (group: G) => void;\n /** See {@link SettingsLayoutContextValue.selectSub}. */\n selectSub: (sub: string | null) => void;\n /** To the list: `navigate(-1)` when the list is the previous entry, else a replace to\n * the base path — so a deep link from a mail never sends \"back\" out of the app. */\n back: () => void;\n /** The visible groups, in order. */\n groups: SettingsGroup<G>[];\n /** Whether the phone layout is in force. */\n phone: boolean;\n /** Whether this location is about to be replaced (a legacy hash, an alias, an unknown\n * group): what renders meanwhile is already the destination's, but nothing should\n * act on the URL until it is. */\n redirecting: boolean;\n /** Whether the list is the entry before this one (the marker {@link select} and the\n * list's links leave in `location.state`). */\n fromList: boolean;\n}\n\n/**\n * The `location.state` key that says \"the list is the entry before this one\". Written by\n * the phone list's links and {@link SettingsRoute.select}; carried over by every replace\n * the page makes, since a replace does not change what came before.\n */\nexport const SETTINGS_FROM_LIST_STATE = \"eifi1.settings.fromList\";\n\n/** `location.state` with the marker set — for an app's own link to a group page that is\n * opened FROM the list it renders. */\nexport function settingsFromListState(): Record<string, true> {\n return { [SETTINGS_FROM_LIST_STATE]: true };\n}\n\nfunction isFromList(state: unknown): boolean {\n return (\n typeof state === \"object\" && state !== null && (state as Record<string, unknown>)[SETTINGS_FROM_LIST_STATE] === true\n );\n}\n\nexport interface SettingsLocation {\n pathname: string;\n search: string;\n hash: string;\n}\n\nexport interface SettingsLocationRules<G extends string> {\n basePath: string;\n /** The visible group ids. */\n groups: readonly G[];\n /** The resolved default group, `null` with no visible group. */\n defaultGroup: G | null;\n aliases?: Readonly<Partial<Record<string, G>>>;\n /** Anchor → group, for `/settings?focus=<anchor>` with no group named. */\n anchorGroup?: ReadonlyMap<string, G>;\n phone: boolean;\n}\n\nexport interface SettingsLocationResult<G extends string> {\n group: G | null;\n sub: string | null;\n /** The path (with query) to replace the location with, or `null` when it is already\n * canonical. */\n redirect: string | null;\n}\n\n/**\n * Where a location lands on the settings page — pure, so the rules of §3.1 are testable\n * without a router:\n *\n * - `/settings` → the default group on a desktop (a replace), the list on a phone;\n * - `/settings/<group>[/<sub>]` → that group, the rest of the path as `sub`;\n * - an alias → its successor, with a replace, `sub`, query and hash kept;\n * - an unknown or hidden group → the default group (desktop) or the list (phone), with\n * a replace and the query kept — never a 404, so an old bookmark still lands;\n * - keksdose's legacy `/settings?<query>#<group>[/<sub>]` →\n * `/settings/<group>[/<sub>]?<query>`, the WHOLE query carried (a tour's\n * `tour`/`tourStep` as well as `focus`), then resolved by the rules above;\n * - `/settings?focus=<anchor>` with no group → the anchor's group, where it can ring.\n */\nexport function resolveSettingsLocation<G extends string>(\n location: SettingsLocation,\n rules: SettingsLocationRules<G>,\n): SettingsLocationResult<G> {\n const base = normalizeSettingsBase(rules.basePath);\n const { pathname, search, hash } = location;\n const known = new Set<string>(rules.groups);\n const atBase = pathname === base || pathname === `${base}/` || (base === \"\" && pathname === \"/\");\n\n if (atBase) {\n const legacy = hash.replace(/^#/, \"\").replace(/^\\/+/, \"\");\n if (legacy) {\n // The hash becomes the path; whatever the path then says (an alias, an unknown\n // group) is resolved in the same step, so the history sees one replace.\n const converted = `${base}/${legacy}`;\n const next = resolveSettingsLocation({ pathname: converted, search, hash: \"\" }, rules);\n return { ...next, redirect: next.redirect ?? `${converted}${search}` };\n }\n const anchor = new URLSearchParams(search).get(\"focus\");\n const anchorGroup = anchor ? rules.anchorGroup?.get(anchor) : undefined;\n if (anchorGroup && known.has(anchorGroup)) {\n return { group: anchorGroup, sub: null, redirect: `${base}/${anchorGroup}${search}` };\n }\n if (rules.phone || rules.defaultGroup === null) return { group: null, sub: null, redirect: null };\n return { group: rules.defaultGroup, sub: null, redirect: `${base}/${rules.defaultGroup}${search}` };\n }\n\n if (!pathname.startsWith(`${base}/`)) {\n // Mounted somewhere `basePath` does not name: a misconfiguration, not a link to\n // correct. Show what the base path would, and leave the address alone.\n return { group: rules.phone ? null : rules.defaultGroup, sub: null, redirect: null };\n }\n const rest = pathname.slice(base.length + 1);\n const [segment = \"\", ...subParts] = rest.split(\"/\");\n const sub = subParts.filter(Boolean).join(\"/\") || null;\n if (known.has(segment)) return { group: segment as G, sub, redirect: null };\n\n const successor = rules.aliases?.[segment];\n if (successor !== undefined && known.has(successor)) {\n return {\n group: successor,\n sub,\n redirect: `${base}/${successor}${sub ? `/${sub}` : \"\"}${search}${hash}`,\n };\n }\n\n // Unknown or hidden. The hash is dropped: on the list it would read as a legacy group\n // and send the page round again.\n if (rules.phone || rules.defaultGroup === null) {\n return { group: null, sub: null, redirect: `${base || \"/\"}${search}` };\n }\n return { group: rules.defaultGroup, sub: null, redirect: `${base}/${rules.defaultGroup}${search}` };\n}\n\n/**\n * The settings page's route (docs/settings-harmonization.md §3.1): which group the URL\n * names, and the history rules for moving between groups.\n *\n * The URL IS the selection, as it was in keksdose (where it was the hash): there is no\n * state to keep in step with it, so a deep link, a reload, back and forward all land\n * where the address says. Everything that is not canonical — `/settings` on a desktop, a\n * legacy hash, an alias, an unknown or hidden group — is replaced by its canonical path.\n *\n * **The replace runs on every navigation**, keyed on `location.key`, not once on mount:\n * the router keeps the page mounted across links followed inside the app — keksdose's\n * inbox renders admin-typed URLs, and a push click routes an open window without a\n * reload — so a legacy `/settings#security` arriving while the page is open converts too\n * (§10.1).\n */\nexport function useSettingsRoute<G extends string>(options: UseSettingsRouteOptions<G>): SettingsRoute<G> {\n const { groups, entries, basePath, defaultGroup, aliases, layout = \"auto\" } = options;\n const location = useLocation();\n const navigate = useNavigate();\n const narrow = usePhoneLayout();\n const phone = layout === \"phone\" || (layout === \"auto\" && narrow);\n const base = normalizeSettingsBase(basePath);\n\n const visible = useMemo(() => visibleSettingsGroups(groups, entries), [groups, entries]);\n const anchorGroup = useMemo(() => {\n const map = new Map<string, G>();\n for (const e of entries ?? []) if (e.visible !== false && !map.has(e.anchor)) map.set(e.anchor, e.group);\n return map;\n }, [entries]);\n const ids = visible.map((g) => g.id);\n const fallback = defaultGroup !== undefined && ids.includes(defaultGroup) ? defaultGroup : (ids[0] ?? null);\n\n const { group, sub, redirect } = resolveSettingsLocation(location, {\n basePath: base,\n groups: ids,\n defaultGroup: fallback,\n aliases,\n anchorGroup,\n phone,\n });\n\n const { key, state, search } = location;\n useEffect(() => {\n // `state` rides along: the marker describes the entry BEFORE this one, which a\n // replace does not change.\n if (redirect) navigate(redirect, { replace: true, state });\n }, [key, redirect, state, navigate]);\n\n const select = useCallback(\n (next: G) => {\n const to = `${base}/${next}`;\n // From the list, the push marks it, so the group page's back is a real back.\n if (phone) navigate(to, group === null ? { state: settingsFromListState() } : undefined);\n // A new group is a new page: the old one's query (a focus, a roster filter) stays\n // behind, as keksdose's `selectGroup` left it.\n else navigate(to, { replace: true, state });\n },\n [base, phone, group, state, navigate],\n );\n\n const selectSub = useCallback(\n (next: string | null) => {\n if (group === null) return;\n navigate(`${base}/${group}${next ? `/${next}` : \"\"}${search}`, { replace: true, state });\n },\n [base, group, search, state, navigate],\n );\n\n const fromList = isFromList(state);\n const back = useCallback(() => {\n if (fromList) navigate(-1);\n else navigate(base || \"/\", { replace: true });\n }, [fromList, base, navigate]);\n\n return {\n group,\n sub,\n focus: new URLSearchParams(search).get(\"focus\"),\n select,\n selectSub,\n back,\n groups: visible,\n phone,\n redirecting: redirect !== null,\n fromList,\n };\n}\n"],"mappings":";AAAA,SAAS,aAAa,WAAW,eAAe;AAChD,SAAS,aAAa,mBAAmB;AACzC,SAAS,sBAAsB;AAC/B,SAAS,uBAAuB,6BAA6B;AA4DtD,MAAM,2BAA2B;AAIjC,SAAS,wBAA8C;AAC5D,SAAO,EAAE,CAAC,wBAAwB,GAAG,KAAK;AAC5C;AAEA,SAAS,WAAW,OAAyB;AAC3C,SACE,OAAO,UAAU,YAAY,UAAU,QAAS,MAAkC,wBAAwB,MAAM;AAEpH;AA0CO,SAAS,wBACd,UACA,OAC2B;AAC3B,QAAM,OAAO,sBAAsB,MAAM,QAAQ;AACjD,QAAM,EAAE,UAAU,QAAQ,KAAK,IAAI;AACnC,QAAM,QAAQ,IAAI,IAAY,MAAM,MAAM;AAC1C,QAAM,SAAS,aAAa,QAAQ,aAAa,GAAG,IAAI,OAAQ,SAAS,MAAM,aAAa;AAE5F,MAAI,QAAQ;AACV,UAAM,SAAS,KAAK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+1,16 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
-
import {
|
|
3
|
+
import {
|
|
4
|
+
createContext,
|
|
5
|
+
useCallback,
|
|
6
|
+
useContext,
|
|
7
|
+
useEffect,
|
|
8
|
+
useId,
|
|
9
|
+
useLayoutEffect,
|
|
10
|
+
useMemo,
|
|
11
|
+
useRef,
|
|
12
|
+
useState
|
|
13
|
+
} from "react";
|
|
4
14
|
import { createPortal } from "react-dom";
|
|
5
15
|
import { Link, NavLink, matchPath, useHref, useLocation } from "react-router";
|
|
6
16
|
import { ChevronRight, MoreHorizontal, PanelLeftClose, PanelLeftOpen } from "lucide-react";
|
|
@@ -88,9 +98,7 @@ function useNavHeightVar(ref, shellRef, embedded) {
|
|
|
88
98
|
const node = ref.current;
|
|
89
99
|
const shell = shellRef.current;
|
|
90
100
|
const global = !embedded && !shell?.parentElement?.closest("[data-app-shell]");
|
|
91
|
-
const targets = [shell, global ? document.documentElement : null].filter(
|
|
92
|
-
(el) => el !== null
|
|
93
|
-
);
|
|
101
|
+
const targets = [shell, global ? document.documentElement : null].filter((el) => el !== null);
|
|
94
102
|
const publish = () => {
|
|
95
103
|
const value = `${node ? Math.floor(node.getBoundingClientRect().height) : 0}px`;
|
|
96
104
|
for (const el of targets) el.style.setProperty("--app-nav-h", value);
|
|
@@ -263,30 +271,23 @@ function AppShell({
|
|
|
263
271
|
footer
|
|
264
272
|
] })
|
|
265
273
|
] }),
|
|
266
|
-
/* @__PURE__ */ jsxs(
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
moreNav.length > 0 && /* @__PURE__ */ jsx(MobileMoreCell, { hidden: moreNav, labels: moreLabels })
|
|
284
|
-
]
|
|
285
|
-
}
|
|
286
|
-
)
|
|
287
|
-
]
|
|
288
|
-
}
|
|
289
|
-
)
|
|
274
|
+
/* @__PURE__ */ jsxs("div", { ref: navRef, className: "md:hidden fixed bottom-0 inset-x-0 z-30 border-t border-subtle bg-surface", children: [
|
|
275
|
+
mobileSubNav && /* @__PURE__ */ jsx(MobileSubNav, { nav, layout: mobileSubNavLayout }),
|
|
276
|
+
/* @__PURE__ */ jsxs(
|
|
277
|
+
"nav",
|
|
278
|
+
{
|
|
279
|
+
"data-tour": "nav",
|
|
280
|
+
className: "grid",
|
|
281
|
+
style: { gridTemplateColumns: `repeat(${barNav.length + (moreNav.length ? 1 : 0)}, minmax(0, 1fr))` },
|
|
282
|
+
children: [
|
|
283
|
+
barNav.map(
|
|
284
|
+
(item) => item.items?.length ? /* @__PURE__ */ jsx(MobileGroupCell, { item, labels: moreLabels }, item.to) : /* @__PURE__ */ jsx(MobileNavItem, { item }, item.to)
|
|
285
|
+
),
|
|
286
|
+
moreNav.length > 0 && /* @__PURE__ */ jsx(MobileMoreCell, { hidden: moreNav, labels: moreLabels })
|
|
287
|
+
]
|
|
288
|
+
}
|
|
289
|
+
)
|
|
290
|
+
] })
|
|
290
291
|
]
|
|
291
292
|
}
|
|
292
293
|
) })
|
|
@@ -455,7 +456,17 @@ function MobileGroupCell({
|
|
|
455
456
|
/* @__PURE__ */ jsx(TourAnchor, { to: item.to, dataTour: item.dataTour }),
|
|
456
457
|
pages.filter((sub) => sub.to !== item.to).map((sub) => /* @__PURE__ */ jsx(TourAnchor, { to: sub.to }, sub.to)),
|
|
457
458
|
/* @__PURE__ */ jsx(DialogFrame, { open, onClose: close, title: item.label, closeButton: true, bodyClassName: "space-y-1", children: /* @__PURE__ */ jsxs("ul", { className: "space-y-1", children: [
|
|
458
|
-
!ownPageListed && /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(
|
|
459
|
+
!ownPageListed && /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(
|
|
460
|
+
SheetLink,
|
|
461
|
+
{
|
|
462
|
+
to: item.to,
|
|
463
|
+
end: item.end,
|
|
464
|
+
icon: item.icon,
|
|
465
|
+
label: labels.overview,
|
|
466
|
+
onClick: close,
|
|
467
|
+
level: "entry"
|
|
468
|
+
}
|
|
469
|
+
) }),
|
|
459
470
|
pages.map((sub) => /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(SheetLink, { to: sub.to, end: sub.end, icon: sub.icon, label: sub.label, onClick: close, level: "entry" }) }, sub.to))
|
|
460
471
|
] }) })
|
|
461
472
|
] });
|
|
@@ -508,8 +519,28 @@ function MobileMoreCell({
|
|
|
508
519
|
...(item.items ?? []).map((sub) => /* @__PURE__ */ jsx(TourAnchor, { to: sub.to }, `${item.to} ${sub.to}`))
|
|
509
520
|
]),
|
|
510
521
|
/* @__PURE__ */ jsx(DialogFrame, { open, onClose: close, title: labels.moreTitle, closeButton: true, bodyClassName: "space-y-1", children: /* @__PURE__ */ jsx("ul", { className: "space-y-1", children: hidden.map((item) => /* @__PURE__ */ jsxs("li", { children: [
|
|
511
|
-
/* @__PURE__ */ jsx(
|
|
512
|
-
|
|
522
|
+
/* @__PURE__ */ jsx(
|
|
523
|
+
SheetLink,
|
|
524
|
+
{
|
|
525
|
+
to: item.to,
|
|
526
|
+
end: item.end,
|
|
527
|
+
icon: item.icon,
|
|
528
|
+
label: item.label,
|
|
529
|
+
onClick: close,
|
|
530
|
+
level: "entry"
|
|
531
|
+
}
|
|
532
|
+
),
|
|
533
|
+
!!item.items?.length && /* @__PURE__ */ jsx("ul", { "aria-label": item.label, className: "ms-[1.3rem] mt-0.5 space-y-0.5 border-s border-subtle ps-2", children: item.items.map((sub) => /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(
|
|
534
|
+
SheetLink,
|
|
535
|
+
{
|
|
536
|
+
to: sub.to,
|
|
537
|
+
end: sub.end,
|
|
538
|
+
icon: sub.icon,
|
|
539
|
+
label: sub.label,
|
|
540
|
+
onClick: close,
|
|
541
|
+
level: "page"
|
|
542
|
+
}
|
|
543
|
+
) }, sub.to)) })
|
|
513
544
|
] }, item.to)) }) })
|
|
514
545
|
] });
|
|
515
546
|
}
|