@eifi1/ui-kit 0.53.0 → 0.55.0
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 +96 -82
- package/dist/account/delete-account-setting.d.ts +3 -2
- package/dist/account/delete-account-setting.js.map +1 -1
- package/dist/admin/plan-change.js +2 -2
- package/dist/admin/plan-change.js.map +1 -1
- package/dist/admin/user-roster.d.ts +6 -0
- package/dist/admin/user-roster.js +4 -0
- package/dist/admin/user-roster.js.map +1 -1
- package/dist/auth/auth-errors.d.ts +36 -0
- package/dist/auth/auth-errors.js +20 -0
- package/dist/auth/auth-errors.js.map +1 -1
- package/dist/billing/billing-labels.d.ts +26 -0
- package/dist/billing/billing-labels.js +9 -0
- package/dist/billing/billing-labels.js.map +1 -1
- package/dist/billing/subscription-standing.d.ts +61 -0
- package/dist/billing/subscription-standing.js +51 -0
- package/dist/billing/subscription-standing.js.map +1 -0
- package/dist/billing/usage-meter.d.ts +52 -0
- package/dist/billing/usage-meter.js +52 -0
- package/dist/billing/usage-meter.js.map +1 -0
- package/dist/chart.d.ts +1 -0
- package/dist/chart.js +4 -0
- package/dist/chart.js.map +1 -1
- package/dist/components/alert-banner.js +2 -3
- package/dist/components/alert-banner.js.map +1 -1
- package/dist/components/amount-input.d.ts +2 -1
- package/dist/components/amount-input.js +3 -15
- package/dist/components/amount-input.js.map +1 -1
- package/dist/components/autocomplete.js +2 -2
- package/dist/components/autocomplete.js.map +1 -1
- package/dist/components/bulk-action-bar.js +2 -1
- package/dist/components/bulk-action-bar.js.map +1 -1
- package/dist/components/button.d.ts +35 -1
- package/dist/components/button.js +5 -9
- package/dist/components/button.js.map +1 -1
- package/dist/components/calendar-heatmap.js +6 -4
- package/dist/components/calendar-heatmap.js.map +1 -1
- package/dist/components/camera-button.d.ts +89 -0
- package/dist/components/camera-button.js +122 -0
- package/dist/components/camera-button.js.map +1 -0
- package/dist/components/camera-capture.d.ts +66 -0
- package/dist/components/camera-capture.js +190 -0
- package/dist/components/camera-capture.js.map +1 -0
- package/dist/components/camera-labels.d.ts +20 -0
- package/dist/components/camera-labels.js +15 -0
- package/dist/components/camera-labels.js.map +1 -0
- package/dist/components/chart-edge.d.ts +9 -0
- package/dist/components/chart-edge.js +14 -3
- package/dist/components/chart-edge.js.map +1 -1
- package/dist/components/chart-zoom-core.js +34 -29
- package/dist/components/chart-zoom-core.js.map +1 -1
- package/dist/components/checkbox-group.js +1 -1
- package/dist/components/checkbox-group.js.map +1 -1
- package/dist/components/combobox-core.js +3 -2
- package/dist/components/combobox-core.js.map +1 -1
- package/dist/components/combobox.js +2 -2
- package/dist/components/combobox.js.map +1 -1
- package/dist/components/consent-again-notice-labels.d.ts +25 -0
- package/dist/components/consent-again-notice-labels.js +15 -0
- package/dist/components/consent-again-notice-labels.js.map +1 -0
- package/dist/components/consent-again-notice.d.ts +85 -0
- package/dist/components/consent-again-notice.js +94 -0
- package/dist/components/consent-again-notice.js.map +1 -0
- package/dist/components/country-select.js +2 -7
- package/dist/components/country-select.js.map +1 -1
- package/dist/components/currency-option-list.d.ts +2 -1
- package/dist/components/currency-option-list.js +10 -3
- package/dist/components/currency-option-list.js.map +1 -1
- package/dist/components/currency-select.d.ts +3 -1
- package/dist/components/currency-select.js +2 -2
- package/dist/components/currency-select.js.map +1 -1
- package/dist/components/danger-confirm.d.ts +22 -1
- package/dist/components/danger-confirm.js +52 -30
- package/dist/components/danger-confirm.js.map +1 -1
- package/dist/components/data-table-column-settings.js +2 -2
- package/dist/components/data-table-column-settings.js.map +1 -1
- package/dist/components/data-table-filter-popover.d.ts +2 -1
- package/dist/components/data-table-filter-popover.js +3 -2
- package/dist/components/data-table-filter-popover.js.map +1 -1
- package/dist/components/data-table-filters.d.ts +33 -3
- package/dist/components/data-table-filters.js +6 -4
- package/dist/components/data-table-filters.js.map +1 -1
- package/dist/components/data-table-fit.js.map +1 -1
- package/dist/components/data-table-virtual.js +13 -3
- package/dist/components/data-table-virtual.js.map +1 -1
- package/dist/components/date-field.js +2 -2
- package/dist/components/date-field.js.map +1 -1
- package/dist/components/date-picker.js +2 -2
- package/dist/components/date-picker.js.map +1 -1
- package/dist/components/date-range-picker.js +2 -6
- package/dist/components/date-range-picker.js.map +1 -1
- package/dist/components/dialog-frame.d.ts +5 -1
- package/dist/components/dialog-frame.js +6 -2
- package/dist/components/dialog-frame.js.map +1 -1
- package/dist/components/dropdown.js +7 -3
- package/dist/components/dropdown.js.map +1 -1
- package/dist/components/entity-combobox.js +2 -2
- package/dist/components/entity-combobox.js.map +1 -1
- package/dist/components/field-parts.d.ts +108 -6
- package/dist/components/field-parts.js +59 -6
- package/dist/components/field-parts.js.map +1 -1
- package/dist/components/field-suggestion-labels.d.ts +2 -0
- package/dist/components/field-suggestion-labels.js +10 -0
- package/dist/components/field-suggestion-labels.js.map +1 -0
- package/dist/components/field.js +1 -1
- package/dist/components/field.js.map +1 -1
- package/dist/components/file-button.d.ts +1 -1
- package/dist/components/file-button.js.map +1 -1
- package/dist/components/floating-panel.d.ts +7 -6
- package/dist/components/floating-panel.js +3 -17
- package/dist/components/floating-panel.js.map +1 -1
- package/dist/components/form-actions.d.ts +3 -2
- package/dist/components/form-actions.js.map +1 -1
- package/dist/components/hover-menu.js +3 -2
- package/dist/components/hover-menu.js.map +1 -1
- package/dist/components/icon-button.d.ts +23 -5
- package/dist/components/icon-button.js +6 -8
- package/dist/components/icon-button.js.map +1 -1
- package/dist/components/inline-confirm.js +2 -1
- package/dist/components/inline-confirm.js.map +1 -1
- package/dist/components/inline-entity-combobox.js +2 -2
- package/dist/components/inline-entity-combobox.js.map +1 -1
- package/dist/components/input.js +2 -2
- package/dist/components/input.js.map +1 -1
- package/dist/components/jump-calendar.js +3 -3
- package/dist/components/jump-calendar.js.map +1 -1
- package/dist/components/legal.d.ts +13 -1
- package/dist/components/legal.js +12 -0
- package/dist/components/legal.js.map +1 -1
- package/dist/components/legended-series-chart.d.ts +80 -0
- package/dist/components/legended-series-chart.js +70 -0
- package/dist/components/legended-series-chart.js.map +1 -0
- package/dist/components/lightbox.js +2 -1
- package/dist/components/lightbox.js.map +1 -1
- package/dist/components/mini-calendar.js +16 -7
- package/dist/components/mini-calendar.js.map +1 -1
- package/dist/components/modal.d.ts +48 -0
- package/dist/components/modal.js +26 -6
- package/dist/components/modal.js.map +1 -1
- package/dist/components/month-picker.d.ts +1 -1
- package/dist/components/month-picker.js +6 -6
- package/dist/components/month-picker.js.map +1 -1
- package/dist/components/multi-entity-combobox.js +2 -2
- package/dist/components/multi-entity-combobox.js.map +1 -1
- package/dist/components/multi-select.js +2 -6
- package/dist/components/multi-select.js.map +1 -1
- package/dist/components/number-input.js +2 -2
- package/dist/components/number-input.js.map +1 -1
- package/dist/components/page-header-layout.d.ts +18 -0
- package/dist/components/page-header-layout.js +23 -0
- package/dist/components/page-header-layout.js.map +1 -0
- package/dist/components/page-header-skeleton.d.ts +41 -0
- package/dist/components/page-header-skeleton.js +52 -0
- package/dist/components/page-header-skeleton.js.map +1 -0
- package/dist/components/page-header.js +4 -17
- package/dist/components/page-header.js.map +1 -1
- package/dist/components/popover.js +7 -2
- package/dist/components/popover.js.map +1 -1
- package/dist/components/release-notes-labels.d.ts +16 -0
- package/dist/components/release-notes-labels.js +18 -0
- package/dist/components/release-notes-labels.js.map +1 -0
- package/dist/components/release-notes.d.ts +65 -0
- package/dist/components/release-notes.js +65 -0
- package/dist/components/release-notes.js.map +1 -0
- package/dist/components/select.js +2 -2
- package/dist/components/select.js.map +1 -1
- package/dist/components/series-chart-labels.d.ts +9 -0
- package/dist/components/series-chart-labels.js +3 -1
- package/dist/components/series-chart-labels.js.map +1 -1
- package/dist/components/series-chart.d.ts +5 -0
- package/dist/components/series-chart.js +89 -36
- package/dist/components/series-chart.js.map +1 -1
- package/dist/components/stat-tile.d.ts +21 -2
- package/dist/components/stat-tile.js +4 -2
- package/dist/components/stat-tile.js.map +1 -1
- package/dist/components/toggle-group.js +3 -2
- package/dist/components/toggle-group.js.map +1 -1
- package/dist/components/treemap-layout.js.map +1 -1
- package/dist/components/treemap.d.ts +17 -15
- package/dist/components/treemap.js +167 -85
- package/dist/components/treemap.js.map +1 -1
- package/dist/currencies.d.ts +16 -2
- package/dist/currencies.js +2 -1
- package/dist/currencies.js.map +1 -1
- package/dist/eslint/index.js +1 -1
- package/dist/eslint/role-utilities.d.ts +2 -2
- package/dist/eslint/role-utilities.js.map +1 -1
- package/dist/feedback/feedback-context-labels.js +2 -1
- package/dist/feedback/feedback-context-labels.js.map +1 -1
- package/dist/feedback/feedback-context.d.ts +19 -3
- package/dist/feedback/feedback-context.js +12 -1
- package/dist/feedback/feedback-context.js.map +1 -1
- package/dist/feedback/feedback-diagnostics.d.ts +17 -0
- package/dist/feedback/feedback-diagnostics.js +27 -0
- package/dist/feedback/feedback-diagnostics.js.map +1 -0
- package/dist/feedback/feedback-dialog.d.ts +10 -0
- package/dist/feedback/feedback-dialog.js +6 -4
- package/dist/feedback/feedback-dialog.js.map +1 -1
- package/dist/feedback/feedback-inbox-page.d.ts +260 -0
- package/dist/feedback/feedback-inbox-page.js +207 -0
- package/dist/feedback/feedback-inbox-page.js.map +1 -0
- package/dist/feedback/feedback-record.d.ts +5 -0
- package/dist/feedback/feedback-record.js.map +1 -1
- package/dist/feedback/feedback-row-detail-labels.js +1 -0
- package/dist/feedback/feedback-row-detail-labels.js.map +1 -1
- package/dist/feedback/feedback-row-detail.d.ts +3 -0
- package/dist/feedback/feedback-row-detail.js +3 -0
- package/dist/feedback/feedback-row-detail.js.map +1 -1
- package/dist/feedback/feedback-submit-dialog.d.ts +5 -1
- package/dist/feedback/feedback-submit-dialog.js +15 -3
- package/dist/feedback/feedback-submit-dialog.js.map +1 -1
- package/dist/feedback/feedback-submit.d.ts +30 -2
- package/dist/feedback/feedback-submit.js +5 -2
- package/dist/feedback/feedback-submit.js.map +1 -1
- package/dist/feedback/feedback-vocabulary.js +2 -2
- package/dist/feedback/feedback-vocabulary.js.map +1 -1
- package/dist/feedback.d.ts +1 -0
- package/dist/feedback.js +6 -0
- package/dist/feedback.js.map +1 -1
- package/dist/hooks/use-debounce.d.ts +32 -5
- package/dist/hooks/use-debounce.js +6 -5
- package/dist/hooks/use-debounce.js.map +1 -1
- package/dist/hooks/use-file-picker.d.ts +3 -1
- package/dist/hooks/use-file-picker.js.map +1 -1
- package/dist/hooks/use-focus-trap.d.ts +19 -3
- package/dist/hooks/use-focus-trap.js +15 -5
- package/dist/hooks/use-focus-trap.js.map +1 -1
- package/dist/hooks/use-has-camera.d.ts +36 -0
- package/dist/hooks/use-has-camera.js +53 -0
- package/dist/hooks/use-has-camera.js.map +1 -0
- package/dist/hooks/use-hotkey.js +2 -1
- package/dist/hooks/use-hotkey.js.map +1 -1
- package/dist/hooks/use-overlay-history.d.ts +6 -1
- package/dist/hooks/use-overlay-history.js +10 -2
- package/dist/hooks/use-overlay-history.js.map +1 -1
- package/dist/i18n/defaults.js +11 -1
- package/dist/i18n/defaults.js.map +1 -1
- package/dist/i18n/german.js +78 -4
- package/dist/i18n/german.js.map +1 -1
- package/dist/i18n/kit-labels.d.ts +20 -0
- package/dist/i18n/kit-labels.js.map +1 -1
- package/dist/i18n/locales/en.js +95 -5
- package/dist/i18n/locales/en.js.map +3 -3
- package/dist/i18n/locales/es.js +74 -4
- package/dist/i18n/locales/es.js.map +1 -1
- package/dist/i18n/locales/fr.js +75 -3
- package/dist/i18n/locales/fr.js.map +1 -1
- package/dist/i18n/locales/hu.js +77 -4
- package/dist/i18n/locales/hu.js.map +1 -1
- package/dist/i18n/locales/it.js +77 -4
- package/dist/i18n/locales/it.js.map +1 -1
- package/dist/i18n/locales/zh.js +74 -4
- package/dist/i18n/locales/zh.js.map +1 -1
- package/dist/i18n/review.js +22 -1
- package/dist/i18n/review.js.map +1 -1
- package/dist/index.d.ts +27 -8
- package/dist/index.js +41 -2
- package/dist/index.js.map +1 -1
- package/dist/landing/landing-labels.d.ts +8 -0
- package/dist/landing/landing-labels.js +2 -1
- package/dist/landing/landing-labels.js.map +1 -1
- package/dist/lib/changelog.d.ts +130 -0
- package/dist/lib/changelog.js +137 -0
- package/dist/lib/changelog.js.map +1 -0
- package/dist/lib/clipboard-minus.js +2 -2
- package/dist/lib/clipboard-minus.js.map +1 -1
- package/dist/lib/dates.d.ts +36 -4
- package/dist/lib/dates.js +49 -13
- package/dist/lib/dates.js.map +1 -1
- package/dist/lib/editable-content.d.ts +33 -0
- package/dist/lib/editable-content.js +15 -0
- package/dist/lib/editable-content.js.map +1 -0
- package/dist/lib/focus-left.d.ts +47 -1
- package/dist/lib/focus-left.js +11 -2
- package/dist/lib/focus-left.js.map +1 -1
- package/dist/lib/format.d.ts +37 -2
- package/dist/lib/format.js +25 -1
- package/dist/lib/format.js.map +1 -1
- package/dist/lib/intl-cache.d.ts +4 -2
- package/dist/lib/intl-cache.js.map +1 -1
- package/dist/lib/server-wake.d.ts +49 -9
- package/dist/lib/server-wake.js +25 -14
- package/dist/lib/server-wake.js.map +1 -1
- package/dist/lib/session-refresh.d.ts +53 -0
- package/dist/lib/session-refresh.js +27 -1
- package/dist/lib/session-refresh.js.map +1 -1
- package/dist/lib/translation-review.d.ts +26 -0
- package/dist/lib/translation-review.js +14 -0
- package/dist/lib/translation-review.js.map +1 -1
- package/dist/rhf/fields.js +3 -3
- package/dist/rhf/fields.js.map +1 -1
- package/dist/shell/app-shell.d.ts +25 -1
- package/dist/shell/app-shell.js +3 -1
- package/dist/shell/app-shell.js.map +1 -1
- package/dist/shell/dev-menu.d.ts +3 -0
- package/dist/shell/dev-menu.js +4 -2
- package/dist/shell/dev-menu.js.map +1 -1
- package/dist/shell/held-changes-banner-labels.d.ts +23 -0
- package/dist/shell/held-changes-banner-labels.js +14 -0
- package/dist/shell/held-changes-banner-labels.js.map +1 -0
- package/dist/shell/held-changes-banner.d.ts +75 -0
- package/dist/shell/held-changes-banner.js +106 -0
- package/dist/shell/held-changes-banner.js.map +1 -0
- package/dist/shell/sync-status-indicator.d.ts +27 -12
- package/dist/shell/sync-status-indicator.js +13 -4
- package/dist/shell/sync-status-indicator.js.map +1 -1
- package/dist/shell/top-bar-parts-labels.d.ts +5 -0
- package/dist/shell/top-bar-parts-labels.js +3 -1
- package/dist/shell/top-bar-parts-labels.js.map +1 -1
- package/dist/shell.d.ts +2 -0
- package/dist/shell.js +3 -0
- package/dist/shell.js.map +1 -1
- package/dist/sync/engine.d.ts +11 -2
- package/dist/sync/engine.js +13 -5
- package/dist/sync/engine.js.map +1 -1
- package/dist/sync/hooks.d.ts +3 -2
- package/dist/sync/hooks.js +4 -2
- package/dist/sync/hooks.js.map +1 -1
- package/dist/testing/css-variables.generated.d.ts +2 -2
- package/dist/testing/css-variables.generated.js +1 -1
- package/dist/testing/css-variables.generated.js.map +1 -1
- package/dist/theme/chart-palette.d.ts +18 -0
- package/dist/theme/chart-palette.js +17 -1
- package/dist/theme/chart-palette.js.map +1 -1
- package/dist/theme/contrast-tokens.d.ts +3 -3
- package/dist/theme/contrast-tokens.js.map +1 -1
- package/dist/theme/contrast.d.ts +4 -4
- package/dist/theme/contrast.js.map +1 -1
- package/dist/tour/tour-overlay.js +2 -1
- package/dist/tour/tour-overlay.js.map +1 -1
- package/package.json +5 -9
- package/tokens.css +19 -54
- package/src/account/account-parts.ts +0 -47
- package/src/account/account-settings-labels.ts +0 -240
- package/src/account/account-settings.tsx +0 -698
- package/src/account/data-export-setting-labels.ts +0 -20
- package/src/account/data-export-setting.tsx +0 -200
- package/src/account/delete-account-setting-labels.ts +0 -33
- package/src/account/delete-account-setting.tsx +0 -341
- package/src/account/email-change-setting-labels.ts +0 -31
- package/src/account/email-change-setting.tsx +0 -443
- package/src/account/passkeys-setting.tsx +0 -445
- package/src/account/sessions-setting-labels.ts +0 -24
- package/src/account/sessions-setting.tsx +0 -283
- package/src/admin/admin-action-confirm-labels.ts +0 -19
- package/src/admin/admin-action-confirm.tsx +0 -509
- package/src/admin/admin-action-log-labels.ts +0 -83
- package/src/admin/admin-action-log.tsx +0 -464
- package/src/admin/admin-area-labels.ts +0 -114
- package/src/admin/admin-forbidden.tsx +0 -75
- package/src/admin/admin-overview.tsx +0 -258
- package/src/admin/admin-parts.ts +0 -68
- package/src/admin/admin-sections.tsx +0 -208
- package/src/admin/admin-tool-links.tsx +0 -90
- package/src/admin/invitations-panel-labels.ts +0 -31
- package/src/admin/invitations-panel.tsx +0 -516
- package/src/admin/mail-test-card-labels.ts +0 -19
- package/src/admin/mail-test-card.tsx +0 -189
- package/src/admin/plan-change-labels.ts +0 -5
- package/src/admin/plan-change.tsx +0 -474
- package/src/admin/reviewer-scope-editor-labels.ts +0 -16
- package/src/admin/reviewer-scope-editor.tsx +0 -224
- package/src/admin/role-select-labels.ts +0 -16
- package/src/admin/role-select.tsx +0 -282
- package/src/admin/transfer-ownership-dialog-labels.ts +0 -20
- package/src/admin/transfer-ownership-dialog.tsx +0 -162
- package/src/admin/user-roster-labels.ts +0 -17
- package/src/admin/user-roster.tsx +0 -559
- package/src/auth/accept-invitation-labels.ts +0 -21
- package/src/auth/accept-invitation.tsx +0 -210
- package/src/auth/auth-errors-labels.ts +0 -23
- package/src/auth/auth-errors.ts +0 -370
- package/src/auth/complete-name-dialog-labels.ts +0 -16
- package/src/auth/complete-name-dialog.tsx +0 -253
- package/src/auth/email-tag.ts +0 -75
- package/src/auth/forgot-password-form-labels.ts +0 -20
- package/src/auth/forgot-password-form.tsx +0 -221
- package/src/auth/form-rules.ts +0 -40
- package/src/auth/new-password-fields.tsx +0 -85
- package/src/auth/not-found-page-labels.ts +0 -12
- package/src/auth/not-found-page.tsx +0 -95
- package/src/auth/register-form-labels.ts +0 -31
- package/src/auth/register-form.tsx +0 -456
- package/src/auth/reset-password-form-labels.ts +0 -27
- package/src/auth/reset-password-form.tsx +0 -341
- package/src/auth/sign-in-form-labels.ts +0 -44
- package/src/auth/sign-in-form.tsx +0 -858
- package/src/auth/status-parts.tsx +0 -132
- package/src/auth/verify-email-labels.ts +0 -26
- package/src/auth/verify-email.tsx +0 -445
- package/src/billing/billing-banner.tsx +0 -258
- package/src/billing/billing-labels.ts +0 -381
- package/src/billing/billing-lock.ts +0 -108
- package/src/billing/billing-overview.ts +0 -157
- package/src/billing/billing-standing.ts +0 -80
- package/src/billing/cancel-request.ts +0 -97
- package/src/billing/cancel-subscription.tsx +0 -98
- package/src/billing/checkout-processing.ts +0 -394
- package/src/billing/checkout-return.ts +0 -90
- package/src/billing/pay-page.ts +0 -330
- package/src/billing/plan-card.tsx +0 -562
- package/src/billing/plan-change-labels.ts +0 -66
- package/src/billing/plan-limit-notice.tsx +0 -148
- package/src/billing/plan-limit-toast.tsx +0 -90
- package/src/billing/plan-limit.ts +0 -52
- package/src/billing/plan-price.ts +0 -98
- package/src/billing/plan-switch.tsx +0 -216
- package/src/billing/provider-page.ts +0 -84
- package/src/billing/subscription-actions.tsx +0 -247
- package/src/billing/subscription-status-chip.tsx +0 -95
- package/src/chart.ts +0 -103
- package/src/components/account-chips-labels.ts +0 -16
- package/src/components/account-chips.tsx +0 -474
- package/src/components/alert-banner.tsx +0 -670
- package/src/components/amount-input.tsx +0 -815
- package/src/components/appearance-labels.ts +0 -63
- package/src/components/authed-image-labels.ts +0 -11
- package/src/components/authed-image.tsx +0 -209
- package/src/components/autocomplete.tsx +0 -645
- package/src/components/breadcrumbs-labels.ts +0 -10
- package/src/components/breadcrumbs.tsx +0 -205
- package/src/components/bulk-action-bar-labels.ts +0 -11
- package/src/components/bulk-action-bar.tsx +0 -443
- package/src/components/button-group.tsx +0 -223
- package/src/components/button-look.ts +0 -256
- package/src/components/button.tsx +0 -339
- package/src/components/calculator.tsx +0 -341
- package/src/components/calendar-heatmap-labels.ts +0 -15
- package/src/components/calendar-heatmap.tsx +0 -594
- package/src/components/card.tsx +0 -377
- package/src/components/chart-edge.ts +0 -106
- package/src/components/chart-figure.tsx +0 -35
- package/src/components/chart-height.ts +0 -30
- package/src/components/chart-zoom-core.tsx +0 -627
- package/src/components/chart-zoom.tsx +0 -22
- package/src/components/chart.tsx +0 -554
- package/src/components/checkbox-group.tsx +0 -247
- package/src/components/checkbox.tsx +0 -346
- package/src/components/chip-input.tsx +0 -370
- package/src/components/chip-labels.ts +0 -13
- package/src/components/chip.tsx +0 -843
- package/src/components/choice-card.tsx +0 -544
- package/src/components/column-mapper-labels.ts +0 -38
- package/src/components/column-mapper.tsx +0 -655
- package/src/components/combobox-core.tsx +0 -1321
- package/src/components/combobox-suggestions.tsx +0 -131
- package/src/components/combobox.tsx +0 -716
- package/src/components/confirm-context.ts +0 -7
- package/src/components/confirm-dialog-labels.ts +0 -13
- package/src/components/confirm-dialog.tsx +0 -341
- package/src/components/copy-button-labels.ts +0 -13
- package/src/components/copy-button.tsx +0 -192
- package/src/components/country-select-labels.ts +0 -11
- package/src/components/country-select.tsx +0 -539
- package/src/components/currency-option-list.tsx +0 -180
- package/src/components/currency-select.tsx +0 -341
- package/src/components/danger-confirm-labels.ts +0 -20
- package/src/components/danger-confirm.tsx +0 -934
- package/src/components/data-table-cells.tsx +0 -118
- package/src/components/data-table-column-settings.tsx +0 -198
- package/src/components/data-table-filter-popover.tsx +0 -281
- package/src/components/data-table-filters.ts +0 -287
- package/src/components/data-table-fit.ts +0 -301
- package/src/components/data-table-groups.tsx +0 -288
- package/src/components/data-table-head.tsx +0 -280
- package/src/components/data-table-labels.ts +0 -198
- package/src/components/data-table-leading-row.tsx +0 -58
- package/src/components/data-table-mobile.tsx +0 -1117
- package/src/components/data-table-pagination.tsx +0 -202
- package/src/components/data-table-resize.ts +0 -188
- package/src/components/data-table-row-actions.tsx +0 -302
- package/src/components/data-table-row.tsx +0 -496
- package/src/components/data-table-selection.ts +0 -71
- package/src/components/data-table-shared.tsx +0 -287
- package/src/components/data-table-sort.ts +0 -163
- package/src/components/data-table-virtual.ts +0 -576
- package/src/components/data-table.tsx +0 -2598
- package/src/components/date-field.tsx +0 -684
- package/src/components/date-format-setting.tsx +0 -64
- package/src/components/date-picker.tsx +0 -404
- package/src/components/date-range-picker.tsx +0 -518
- package/src/components/description-list-labels.ts +0 -9
- package/src/components/description-list.tsx +0 -386
- package/src/components/dialog-frame-labels.ts +0 -7
- package/src/components/dialog-frame.tsx +0 -276
- package/src/components/disclosure.tsx +0 -476
- package/src/components/dropdown.tsx +0 -461
- package/src/components/empty-state.tsx +0 -136
- package/src/components/entity-combobox.tsx +0 -422
- package/src/components/error-boundary-labels.ts +0 -20
- package/src/components/error-boundary.tsx +0 -675
- package/src/components/facing-pair.ts +0 -93
- package/src/components/field-base-labels.ts +0 -20
- package/src/components/field-base.tsx +0 -656
- package/src/components/field-parts.tsx +0 -825
- package/src/components/field-strip.tsx +0 -129
- package/src/components/field.tsx +0 -206
- package/src/components/file-button.tsx +0 -295
- package/src/components/file-dropzone.tsx +0 -559
- package/src/components/floating-panel-labels.ts +0 -10
- package/src/components/floating-panel.tsx +0 -828
- package/src/components/focus-ring.ts +0 -16
- package/src/components/form-actions-labels.ts +0 -11
- package/src/components/form-actions.tsx +0 -578
- package/src/components/full-bleed-dialog.tsx +0 -294
- package/src/components/grouped-picker.tsx +0 -184
- package/src/components/help-popover.tsx +0 -117
- package/src/components/hover-menu.tsx +0 -343
- package/src/components/iban-input-labels.ts +0 -14
- package/src/components/iban-input.tsx +0 -236
- package/src/components/icon-button.tsx +0 -959
- package/src/components/icon-picker-labels.ts +0 -13
- package/src/components/icon-picker.tsx +0 -232
- package/src/components/image-grid-labels.ts +0 -11
- package/src/components/image-grid.tsx +0 -202
- package/src/components/inline-confirm.tsx +0 -116
- package/src/components/inline-edit-field-labels.ts +0 -11
- package/src/components/inline-edit-field.tsx +0 -552
- package/src/components/inline-entity-combobox.tsx +0 -849
- package/src/components/input.tsx +0 -394
- package/src/components/jump-calendar.tsx +0 -265
- package/src/components/language-select.tsx +0 -93
- package/src/components/legal-labels.ts +0 -105
- package/src/components/legal-page.tsx +0 -711
- package/src/components/legal.tsx +0 -668
- package/src/components/lightbox-labels.ts +0 -18
- package/src/components/lightbox.tsx +0 -399
- package/src/components/line-items-labels.ts +0 -14
- package/src/components/line-items.tsx +0 -602
- package/src/components/list-labels.ts +0 -12
- package/src/components/list.tsx +0 -870
- package/src/components/loading-state.tsx +0 -78
- package/src/components/measured-grid-labels.ts +0 -25
- package/src/components/measured-grid.tsx +0 -837
- package/src/components/menu-item.tsx +0 -241
- package/src/components/mini-calendar-labels.ts +0 -17
- package/src/components/mini-calendar.tsx +0 -789
- package/src/components/modal.tsx +0 -505
- package/src/components/money-draft.ts +0 -83
- package/src/components/money-field.tsx +0 -76
- package/src/components/month-grid.tsx +0 -229
- package/src/components/month-picker-labels.ts +0 -22
- package/src/components/month-picker.tsx +0 -1087
- package/src/components/multi-entity-combobox.tsx +0 -369
- package/src/components/multi-select.tsx +0 -376
- package/src/components/nav-pills.tsx +0 -198
- package/src/components/number-field.tsx +0 -327
- package/src/components/number-input.tsx +0 -558
- package/src/components/numeric-field.ts +0 -169
- package/src/components/numpad-sheet.tsx +0 -285
- package/src/components/one-time-code-input.tsx +0 -270
- package/src/components/page-contents-labels.ts +0 -9
- package/src/components/page-contents.tsx +0 -282
- package/src/components/page-header-context.ts +0 -8
- package/src/components/page-header.tsx +0 -298
- package/src/components/password-strength-labels.ts +0 -22
- package/src/components/password-strength.tsx +0 -241
- package/src/components/phone-input-labels.ts +0 -10
- package/src/components/phone-input.tsx +0 -282
- package/src/components/picker-sheet.tsx +0 -330
- package/src/components/pie-chart-labels.ts +0 -40
- package/src/components/pie-chart.tsx +0 -480
- package/src/components/popover-labels.ts +0 -14
- package/src/components/popover.tsx +0 -268
- package/src/components/progress-bar-labels.ts +0 -10
- package/src/components/progress-bar.tsx +0 -479
- package/src/components/qr-code.tsx +0 -76
- package/src/components/reauth-dialog-labels.ts +0 -13
- package/src/components/reauth-dialog.tsx +0 -265
- package/src/components/row-actions-labels.ts +0 -12
- package/src/components/row-actions.tsx +0 -795
- package/src/components/scroll-area.tsx +0 -123
- package/src/components/search-field.tsx +0 -192
- package/src/components/select.tsx +0 -294
- package/src/components/separator.tsx +0 -33
- package/src/components/series-chart-axes.ts +0 -342
- package/src/components/series-chart-budget.ts +0 -150
- package/src/components/series-chart-labels.ts +0 -33
- package/src/components/series-chart-thin.ts +0 -180
- package/src/components/series-chart-ticks.ts +0 -194
- package/src/components/series-chart.tsx +0 -1906
- package/src/components/server-wake-labels.ts +0 -11
- package/src/components/server-wake.tsx +0 -129
- package/src/components/settings-fields.tsx +0 -237
- package/src/components/share-card-labels.ts +0 -30
- package/src/components/share-card.tsx +0 -675
- package/src/components/signature-pad-labels.ts +0 -24
- package/src/components/signature-pad.tsx +0 -747
- package/src/components/signed-amount-labels.ts +0 -10
- package/src/components/signed-amount.tsx +0 -336
- package/src/components/skeleton.tsx +0 -80
- package/src/components/slider.tsx +0 -338
- package/src/components/sparkline-labels.ts +0 -14
- package/src/components/sparkline.tsx +0 -322
- package/src/components/spinner.tsx +0 -81
- package/src/components/stat-tile-labels.ts +0 -15
- package/src/components/stat-tile.tsx +0 -725
- package/src/components/status-dot.tsx +0 -170
- package/src/components/swatch-picker-labels.ts +0 -10
- package/src/components/swatch-picker.tsx +0 -283
- package/src/components/swipeable-row.tsx +0 -386
- package/src/components/switch.tsx +0 -273
- package/src/components/table-skeleton.tsx +0 -136
- package/src/components/table.tsx +0 -647
- package/src/components/tabs-labels.ts +0 -13
- package/src/components/tabs.tsx +0 -693
- package/src/components/text-link.tsx +0 -359
- package/src/components/text.tsx +0 -150
- package/src/components/textarea.tsx +0 -330
- package/src/components/tile-radio.tsx +0 -332
- package/src/components/time-input.tsx +0 -121
- package/src/components/toast-labels.ts +0 -12
- package/src/components/toast.tsx +0 -519
- package/src/components/toggle-group.tsx +0 -752
- package/src/components/toggle-legend.tsx +0 -394
- package/src/components/tooltip.tsx +0 -1149
- package/src/components/translation-review-editor.tsx +0 -290
- package/src/components/translation-review-labels.ts +0 -181
- package/src/components/translation-review-parts.tsx +0 -272
- package/src/components/translation-review.tsx +0 -1240
- package/src/components/tree-view.tsx +0 -589
- package/src/components/treemap-labels.ts +0 -47
- package/src/components/treemap-layout.ts +0 -210
- package/src/components/treemap.tsx +0 -1184
- package/src/components/trigger-aria.ts +0 -44
- package/src/components/use-anchor-dir.ts +0 -20
- package/src/components/use-mobile-reveal.ts +0 -62
- package/src/components/use-table-state.ts +0 -753
- package/src/components/user-avatar.tsx +0 -116
- package/src/components/wizard-stepper.tsx +0 -42
- package/src/components/write-lock-labels.ts +0 -10
- package/src/components/write-lock.tsx +0 -253
- package/src/currencies.ts +0 -70
- package/src/data-table.ts +0 -42
- package/src/demo/demo-banner.tsx +0 -153
- package/src/demo/demo-countdown.ts +0 -136
- package/src/demo/demo-ended.tsx +0 -90
- package/src/demo/demo-labels.ts +0 -78
- package/src/demo/demo-session.ts +0 -32
- package/src/demo/demo-start.tsx +0 -156
- package/src/eslint/index.ts +0 -161
- package/src/eslint/role-utilities.generated.ts +0 -146
- package/src/eslint/role-utilities.ts +0 -233
- package/src/feedback/feedback-attachment-download.tsx +0 -77
- package/src/feedback/feedback-attachment-labels.ts +0 -37
- package/src/feedback/feedback-attachment.tsx +0 -1239
- package/src/feedback/feedback-capture.ts +0 -287
- package/src/feedback/feedback-comment-thread.tsx +0 -353
- package/src/feedback/feedback-context-labels.ts +0 -10
- package/src/feedback/feedback-context.tsx +0 -213
- package/src/feedback/feedback-crash.ts +0 -547
- package/src/feedback/feedback-dialog-labels.ts +0 -29
- package/src/feedback/feedback-dialog.tsx +0 -440
- package/src/feedback/feedback-entry-file.tsx +0 -150
- package/src/feedback/feedback-inbox.tsx +0 -552
- package/src/feedback/feedback-labels.ts +0 -144
- package/src/feedback/feedback-menu-labels.ts +0 -12
- package/src/feedback/feedback-menu.tsx +0 -177
- package/src/feedback/feedback-mutation.ts +0 -20
- package/src/feedback/feedback-page-link.ts +0 -90
- package/src/feedback/feedback-public-labels.ts +0 -81
- package/src/feedback/feedback-public-list.tsx +0 -524
- package/src/feedback/feedback-public-switch.tsx +0 -102
- package/src/feedback/feedback-public-types.ts +0 -101
- package/src/feedback/feedback-record.ts +0 -423
- package/src/feedback/feedback-replies-context.ts +0 -9
- package/src/feedback/feedback-replies.tsx +0 -343
- package/src/feedback/feedback-rework-entry-chip.tsx +0 -18
- package/src/feedback/feedback-row-detail-labels.ts +0 -30
- package/src/feedback/feedback-row-detail.tsx +0 -858
- package/src/feedback/feedback-status-undo.ts +0 -109
- package/src/feedback/feedback-submit-dialog.tsx +0 -118
- package/src/feedback/feedback-submit.tsx +0 -237
- package/src/feedback/feedback-swipe.tsx +0 -192
- package/src/feedback/feedback-table-labels.ts +0 -27
- package/src/feedback/feedback-table.tsx +0 -912
- package/src/feedback/feedback-thread-labels.ts +0 -22
- package/src/feedback/feedback-thread-parts-labels.ts +0 -41
- package/src/feedback/feedback-thread.tsx +0 -905
- package/src/feedback/feedback-vocabulary.ts +0 -263
- package/src/feedback/feedback-vote-button.tsx +0 -124
- package/src/feedback.ts +0 -116
- package/src/hooks/use-anchored-panel.ts +0 -396
- package/src/hooks/use-anchored-rect.ts +0 -77
- package/src/hooks/use-announce.ts +0 -85
- package/src/hooks/use-authed-src.ts +0 -167
- package/src/hooks/use-body-scroll-lock.ts +0 -119
- package/src/hooks/use-breakpoint.ts +0 -133
- package/src/hooks/use-close-transition.ts +0 -107
- package/src/hooks/use-copy-to-clipboard.ts +0 -122
- package/src/hooks/use-debounce.ts +0 -114
- package/src/hooks/use-dismiss.ts +0 -371
- package/src/hooks/use-document-title.ts +0 -33
- package/src/hooks/use-file-drop.ts +0 -121
- package/src/hooks/use-file-picker-labels.ts +0 -28
- package/src/hooks/use-file-picker.tsx +0 -359
- package/src/hooks/use-focus-trap.ts +0 -199
- package/src/hooks/use-hotkey.ts +0 -189
- package/src/hooks/use-large-text.ts +0 -41
- package/src/hooks/use-long-press.ts +0 -140
- package/src/hooks/use-media-query.ts +0 -39
- package/src/hooks/use-mounted.ts +0 -39
- package/src/hooks/use-noindex.ts +0 -37
- package/src/hooks/use-overlay-history.ts +0 -714
- package/src/hooks/use-row-swipe.ts +0 -207
- package/src/hooks/use-search-param-state.ts +0 -434
- package/src/hooks/use-windowed-rows.ts +0 -225
- package/src/i18n/defaults.ts +0 -267
- package/src/i18n/german.ts +0 -2057
- package/src/i18n/kit-labels.tsx +0 -1003
- package/src/i18n/languages.ts +0 -349
- package/src/i18n/locales/de-CH.ts +0 -24
- package/src/i18n/locales/en.ts +0 -267
- package/src/i18n/locales/es.ts +0 -1997
- package/src/i18n/locales/fr.ts +0 -2035
- package/src/i18n/locales/hu.ts +0 -2002
- package/src/i18n/locales/it.ts +0 -2012
- package/src/i18n/locales/zh.ts +0 -1910
- package/src/i18n/plurals.ts +0 -86
- package/src/i18n/review.ts +0 -475
- package/src/i18n/shared-labels.ts +0 -138
- package/src/i18n/swiss.ts +0 -29
- package/src/index.ts +0 -1179
- package/src/landing/access.ts +0 -93
- package/src/landing/landing-actions.tsx +0 -97
- package/src/landing/landing-labels.ts +0 -59
- package/src/landing/landing-sections.tsx +0 -341
- package/src/landing/page-seo.ts +0 -261
- package/src/landing/public-header.tsx +0 -121
- package/src/landing/public-page.tsx +0 -106
- package/src/landing/routing.tsx +0 -225
- package/src/lib/broadcast.ts +0 -52
- package/src/lib/calc.ts +0 -323
- package/src/lib/chip-edge-snap.ts +0 -212
- package/src/lib/clipboard-minus.ts +0 -107
- package/src/lib/clipping.ts +0 -34
- package/src/lib/cn.ts +0 -28
- package/src/lib/column-mapping.ts +0 -234
- package/src/lib/countries.ts +0 -91
- package/src/lib/data-attributes.ts +0 -14
- package/src/lib/date-format.ts +0 -227
- package/src/lib/dates.ts +0 -266
- package/src/lib/day-format.ts +0 -96
- package/src/lib/decimal-marks.ts +0 -108
- package/src/lib/describe-failure.ts +0 -18
- package/src/lib/device-settings.ts +0 -147
- package/src/lib/direction.ts +0 -74
- package/src/lib/document-navigation.ts +0 -17
- package/src/lib/document-title.ts +0 -41
- package/src/lib/download.ts +0 -172
- package/src/lib/float-clearance.ts +0 -70
- package/src/lib/floating-stack.ts +0 -70
- package/src/lib/focus-left.ts +0 -156
- package/src/lib/format.ts +0 -522
- package/src/lib/http-status.ts +0 -38
- package/src/lib/iban.ts +0 -251
- package/src/lib/ime.ts +0 -24
- package/src/lib/intl-cache.ts +0 -25
- package/src/lib/iso-day.ts +0 -13
- package/src/lib/lazy-with-fallback.ts +0 -82
- package/src/lib/logger.ts +0 -69
- package/src/lib/minus.ts +0 -50
- package/src/lib/path-pattern.ts +0 -55
- package/src/lib/person-name.ts +0 -155
- package/src/lib/phone.ts +0 -208
- package/src/lib/plain-text.ts +0 -22
- package/src/lib/presence.ts +0 -18
- package/src/lib/qr-encode.ts +0 -444
- package/src/lib/quiet-focus.ts +0 -32
- package/src/lib/reduced-motion.ts +0 -22
- package/src/lib/refs.ts +0 -22
- package/src/lib/round.ts +0 -43
- package/src/lib/safe-storage.ts +0 -119
- package/src/lib/server-wake.ts +0 -315
- package/src/lib/session-refresh.ts +0 -472
- package/src/lib/share-format.ts +0 -18
- package/src/lib/status-tone.ts +0 -43
- package/src/lib/strip-fade.ts +0 -287
- package/src/lib/table-text.ts +0 -554
- package/src/lib/text-case.ts +0 -19
- package/src/lib/text-match.ts +0 -169
- package/src/lib/thenable.ts +0 -19
- package/src/lib/translation-review.ts +0 -717
- package/src/notifications/device-zone-report.ts +0 -67
- package/src/notifications/feedback-notification-types-labels.ts +0 -33
- package/src/notifications/feedback-notification-types.ts +0 -71
- package/src/notifications/notification-bell.tsx +0 -119
- package/src/notifications/notification-inbox.tsx +0 -309
- package/src/notifications/notification-parts.tsx +0 -81
- package/src/notifications/notification-types-setting.tsx +0 -406
- package/src/notifications/notification-types.ts +0 -89
- package/src/notifications/notifications-labels.ts +0 -287
- package/src/notifications/push-device-setting.tsx +0 -230
- package/src/notifications/push-devices-setting.tsx +0 -374
- package/src/notifications/push-worker.ts +0 -168
- package/src/notifications/quiet-hours-setting.tsx +0 -238
- package/src/notifications/unsubscribe-panel.tsx +0 -200
- package/src/notifications/use-push-device.ts +0 -448
- package/src/offline/local-first.ts +0 -100
- package/src/offline/pwa-update-prompt-labels.ts +0 -9
- package/src/offline/pwa-update-prompt.tsx +0 -78
- package/src/offline/query-persistence.ts +0 -391
- package/src/offline/service-worker-updates.ts +0 -81
- package/src/offline/shared-computer-labels.ts +0 -8
- package/src/offline/shared-computer.tsx +0 -87
- package/src/offline/sign-out-pending-dialog-labels.ts +0 -21
- package/src/offline/sign-out-pending-dialog.tsx +0 -135
- package/src/offline.ts +0 -37
- package/src/push-worker.ts +0 -25
- package/src/rhf/fields.tsx +0 -2187
- package/src/rhf/form-core.tsx +0 -324
- package/src/rhf/form.tsx +0 -12
- package/src/rhf/line-items.tsx +0 -135
- package/src/rhf/use-rhf-wizard-step.ts +0 -104
- package/src/rhf.ts +0 -21
- package/src/search/command-palette-labels.ts +0 -16
- package/src/search/command-palette.tsx +0 -624
- package/src/search/global-search-labels.ts +0 -13
- package/src/search/global-search.tsx +0 -660
- package/src/search/search-index.ts +0 -283
- package/src/search/use-command-key.ts +0 -23
- package/src/search.ts +0 -14
- package/src/settings/device-reset-setting-labels.ts +0 -20
- package/src/settings/device-reset-setting.tsx +0 -116
- package/src/settings/settings-card-classes.ts +0 -11
- package/src/settings/settings-catalogue.ts +0 -150
- package/src/settings/settings-context.ts +0 -33
- package/src/settings/settings-heading.tsx +0 -67
- package/src/settings/settings-labels.ts +0 -87
- package/src/settings/settings-layout.tsx +0 -471
- package/src/settings/settings-section.tsx +0 -108
- package/src/settings/use-account-appearance.ts +0 -148
- package/src/settings/use-account-language.ts +0 -146
- package/src/settings/use-settings-focus.ts +0 -128
- package/src/settings/use-settings-route.ts +0 -258
- package/src/shell/account-menu-language.tsx +0 -130
- package/src/shell/account-menu-text-size.tsx +0 -80
- package/src/shell/admin-menu.tsx +0 -183
- package/src/shell/app-shell-labels.ts +0 -11
- package/src/shell/app-shell.tsx +0 -1560
- package/src/shell/auth-layout.tsx +0 -186
- package/src/shell/company-switcher-labels.ts +0 -13
- package/src/shell/company-switcher.tsx +0 -136
- package/src/shell/dev-menu.tsx +0 -257
- package/src/shell/fill-height.tsx +0 -45
- package/src/shell/language-code.ts +0 -5
- package/src/shell/option-switcher-menu.tsx +0 -84
- package/src/shell/sync-status-indicator.tsx +0 -303
- package/src/shell/top-bar-actions.tsx +0 -87
- package/src/shell/top-bar-brand.tsx +0 -78
- package/src/shell/top-bar-parts-labels.ts +0 -148
- package/src/shell/top-bar.tsx +0 -40
- package/src/shell/topbar-action-menu.tsx +0 -567
- package/src/shell/topbar-controls.tsx +0 -269
- package/src/shell/tour-menu.tsx +0 -187
- package/src/shell.ts +0 -108
- package/src/sync/db.ts +0 -129
- package/src/sync/engine.ts +0 -1011
- package/src/sync/hooks.ts +0 -98
- package/src/sync/testing.ts +0 -73
- package/src/sync/wire.ts +0 -61
- package/src/sync.ts +0 -37
- package/src/table-text.ts +0 -8
- package/src/testing/css-variables.generated.ts +0 -112
- package/src/testing/css-variables.ts +0 -189
- package/src/testing/index.ts +0 -29
- package/src/testing/react.ts +0 -58
- package/src/testing/tour.ts +0 -41
- package/src/testing/viewport.ts +0 -357
- package/src/theme/chart-palette.ts +0 -232
- package/src/theme/color.ts +0 -272
- package/src/theme/contrast-tokens.ts +0 -268
- package/src/theme/contrast.ts +0 -250
- package/src/theme/palette-derive.ts +0 -825
- package/src/theme/palette-presets.ts +0 -544
- package/src/theme/palette-store.ts +0 -108
- package/src/theme/text-size.ts +0 -289
- package/src/theme/theme-store.ts +0 -157
- package/src/tour/tour-catalogue-labels.ts +0 -75
- package/src/tour/tour-catalogue.tsx +0 -335
- package/src/tour/tour-dock.ts +0 -134
- package/src/tour/tour-engine.ts +0 -37
- package/src/tour/tour-gates.ts +0 -218
- package/src/tour/tour-guide-button.tsx +0 -64
- package/src/tour/tour-guide-labels.ts +0 -15
- package/src/tour/tour-info.ts +0 -144
- package/src/tour/tour-labels.ts +0 -23
- package/src/tour/tour-overlay.tsx +0 -1170
- package/src/tour/tour.tsx +0 -750
- package/src/tour/use-tour-progress.ts +0 -671
- package/src/tour/use-tour-url-sync.ts +0 -266
- package/src/tour.ts +0 -21
- package/src/vite-env.d.ts +0 -23
- package/src/wizard/stepper-nav.tsx +0 -360
- package/src/wizard/types.ts +0 -275
- package/src/wizard/use-wizard.ts +0 -560
- package/src/wizard/validation.ts +0 -39
- package/src/wizard/wizard-context.tsx +0 -74
- package/src/wizard/wizard-labels.ts +0 -29
- package/src/wizard/wizard-step.tsx +0 -76
- package/src/wizard/wizard-summary.tsx +0 -84
- package/src/wizard.ts +0 -15
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/hooks/use-focus-trap.ts"],"sourcesContent":["import { useEffect, useLayoutEffect, useRef, useState } from \"react\";\nimport { tabStops } from \"../lib/focus-left\";\n\n/**\n * Keep keyboard focus inside an open overlay, and give it back when it closes.\n *\n * Extracted from `Modal`, which was the ONLY component in this package that did any of\n * this. Every other overlay — the full-bleed dialog a phone's row editor opens, the\n * picker sheet, the numpad, the tour card — declared `role=\"dialog\" aria-modal=\"true\"`\n * and then left focus on the page behind it. That is the worst of the two possible\n * bugs: assistive technology hides the page because of `aria-modal`, while the user's\n * focus is still down there in the part that is now hidden, so Tab walks through\n * controls the screen reader refuses to describe.\n *\n * What this does beyond Modal's original copy:\n *\n * - **Recomputes the tabbable list on every Tab**, not once when the overlay opens.\n * These panels have conditionally-rendered contents — a search box that appears\n * once options load, a \"clear\" button that exists only while a filter is set — and\n * a list captured at open time traps focus against elements that have since gone.\n * - **Guards the restore target.** The element focused before opening may have left\n * the DOM by the time the overlay closes (the row that owned the button was\n * filtered away). Calling `.focus()` on a detached node silently drops focus to\n * `<body>`, which for a keyboard user means losing their place in the page\n * entirely. When the target is gone, focus falls back to the nearest thing that\n * still exists rather than to nothing.\n * - **Leaves an app's own autofocus alone** (0.33.1). React honours a child's\n * `autoFocus` while it commits, and this hook's effect runs AFTER that commit, so\n * focusing the container there took focus straight back off the field the app had\n * asked for. See `initialFocus`.\n * - **Nests.** An overlay can open another — a picker inside a dialog. Only the\n * innermost trap handles a keystroke, and closing it hands control back to the one\n * underneath. Innermost is decided by DOM containment rather than by mount order;\n * see the note on `TRAP_ATTR` for why the obvious stack is wrong.\n * `use-overlay-history.ts` reasons about the same nesting problem for the back\n * button; this is the focus half of it.\n */\n\n// The trap's reading of \"a Tab lands here\" is lib/focus-left's `tabStops` — the kit's one\n// copy of the rule since the 0.52 code review (round 0.34 BUG-4's history is there).\n// Re-exported where refactor audit 2026-10-30, DUP-9 put them, for a part that walks Tab\n// over something that is not a trap (the tour's field + card ring).\nexport { firstTabStop, tabStops } from \"../lib/focus-left\";\n\n/**\n * Marks a container whose trap is currently active.\n *\n * \"Which trap is innermost?\" is answered by DOM CONTAINMENT, not by mount order. The\n * obvious implementation — a module-level stack pushed in the effect — is wrong, and\n * wrong in a way that passes a casual reading: React runs CHILD effects before PARENT\n * effects, so a nested overlay pushes first and the outer one ends up on top of the\n * stack, claiming to be innermost. The outer trap then handles the keystroke and wraps\n * focus to its own first element, jumping the user out of the picker they had open.\n *\n * An attribute on the live DOM cannot disagree with the DOM.\n */\nconst TRAP_ATTR = \"data-focus-trap\";\n\nexport interface FocusTrapOptions {\n /** Trap only while this is true. Mount-time `true` is the common case. */\n active?: boolean;\n /** Return focus to whatever had it before the trap engaged. Default `true`. */\n restoreFocus?: boolean;\n /**\n * What to focus when the trap engages. Default is the container itself, which is\n * what `Modal` does and why: focusing the first FIELD pops the software keyboard on\n * a phone the moment a dialog opens, before the user has asked to type.\n * The container needs `tabIndex={-1}` for this to work.\n *\n * `\"container\"` and `\"first\"` both step aside when focus is ALREADY inside the\n * container, on something other than the container itself. That is a child the app\n * focused on purpose — an `autoFocus`, which React honours before this hook's effect\n * runs — and the keyboard it brings up is the one the user was promised. Moving focus\n * off it lost keksdose's create card its amount field the instant it got it, and on a\n * phone the numpad sheet with it, which shows only while the field is focused (live\n * #402). A function is the caller's explicit choice and is always followed.\n */\n initialFocus?: \"container\" | \"first\" | (() => HTMLElement | null);\n}\n\n/** Whatever has focus right now; nothing on the server, where there is no document. */\nfunction focusedElement(): Element | null {\n return typeof document === \"undefined\" ? null : document.activeElement;\n}\n\nexport function useFocusTrap(\n containerRef: React.RefObject<HTMLElement | null>,\n { active = true, restoreFocus = true, initialFocus = \"container\" }: FocusTrapOptions = {},\n): void {\n // Latest-ref so a caller passing an inline `initialFocus` thunk — which every caller\n // will — does not tear the trap down and re-engage it on each render, stealing focus\n // back to the top of the panel mid-interaction. Written in a LAYOUT effect so that\n // the trap's cleanup, which runs after the layout effects of the same commit, reads\n // this render's `active` rather than the last one's — see the cleanup for why.\n const optsRef = useRef({ active, restoreFocus, initialFocus });\n useLayoutEffect(() => {\n optsRef.current = { active, restoreFocus, initialFocus };\n });\n\n // Where focus was BEFORE the trap engaged: the element it is given back to on close.\n //\n // Read DURING the render that turns the trap on, and that timing is the point. React\n // honours a child's `autoFocus` while it commits that render, before any effect runs,\n // so the effect below asking `document.activeElement` would get the child, inside the\n // overlay. Restoring to that on close aimed focus at the dialog that was closing —\n // already out of the DOM, so focus fell to <body> rather than going back to the\n // button that opened it.\n //\n // State adjusted during render (the pattern `Modal` uses for `open`) rather than a\n // ref written there: set once per opening and cleared on release, so a re-render\n // while open cannot replace it with something inside, and StrictMode's second render\n // and second effect both see the same element. `undefined` means \"not captured\";\n // `null` is a capture that found nothing.\n const [opener, setOpener] = useState<Element | null | undefined>(undefined);\n if (active && opener === undefined) setOpener(focusedElement());\n else if (!active && opener !== undefined) setOpener(undefined);\n\n useEffect(() => {\n if (!active) return;\n const container = containerRef.current;\n if (!container) return;\n\n container.setAttribute(TRAP_ATTR, \"\");\n\n /** Is `node` inside a trap nested within this one? */\n const inNestedTrap = (node: Element | null) => {\n if (!node) return false;\n const owner = node.closest(`[${TRAP_ATTR}]`);\n return owner !== null && owner !== container;\n };\n\n const tabbables = () =>\n tabStops(container, { includeSelf: false }).filter(\n // A tabbable inside a NESTED open overlay belongs to that overlay's trap, not\n // to this one — otherwise the outer list spans both panels and Tab from the\n // inner panel's last control wraps to the OUTER panel's first.\n (el) => !inNestedTrap(el),\n );\n\n const { initialFocus: how } = optsRef.current;\n const focused = document.activeElement;\n // A child that already has focus was given it on purpose — see `initialFocus`.\n const childHasFocus = focused !== container && container.contains(focused);\n if (typeof how === \"function\") {\n (how() ?? container).focus();\n } else if (!childHasFocus) {\n (how === \"first\" ? (tabbables()[0] ?? container) : container).focus();\n }\n\n const onKeyDown = (e: KeyboardEvent) => {\n if (e.key !== \"Tab\") return;\n // Only the innermost trap acts. The event bubbles through every ancestor\n // container, so without this an outer dialog and an inner picker both handle one\n // Tab and fight over where focus lands.\n if (inNestedTrap(document.activeElement)) return;\n\n // Recomputed per keystroke — see the note at the top of this file.\n const items = tabbables();\n if (items.length === 0) {\n e.preventDefault();\n container.focus();\n return;\n }\n const first = items[0];\n const last = items[items.length - 1];\n const activeEl = document.activeElement;\n if (e.shiftKey && (activeEl === first || activeEl === container)) {\n e.preventDefault();\n last.focus();\n } else if (!e.shiftKey && activeEl === last) {\n e.preventDefault();\n first.focus();\n }\n };\n\n // On the container, not the document: a portalled child panel (an open dropdown\n // rendered to <body>) is outside this subtree and manages its own focus, which is\n // the behaviour Modal's comment describes and consumers already depend on.\n container.addEventListener(\"keydown\", onKeyDown);\n\n return () => {\n container.removeEventListener(\"keydown\", onKeyDown);\n container.removeAttribute(TRAP_ATTR);\n\n // Only when the trap is really being released: the container has left the page,\n // or `active` has turned false. StrictMode runs this cleanup once more right after\n // mounting, with the overlay still up, and then the effect again — and React does\n // not re-apply `autoFocus` for that second run. Restoring here would pull focus\n // out of the autofocused field for good: live #402 again, in development.\n if (container.isConnected && optsRef.current.active) return;\n if (!optsRef.current.restoreFocus) return;\n // `isConnected` is the whole point: restoring to a node that has been removed\n // sends focus to <body> and the user loses their place entirely. When the\n // original is gone, leave focus where the browser put it rather than moving it\n // somewhere arbitrary — a wrong guess is worse than no move.\n if (opener?.isConnected) (opener as HTMLElement).focus?.();\n };\n }, [active, containerRef, opener]);\n}\n"],"mappings":";AAAA,SAAS,WAAW,iBAAiB,QAAQ,gBAAgB;AAC7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ACtE;AAEA,UAAM,YAAY,CAAC,MAAqB;AACtC,UAAI,EAAE,QAAQ,MAAO;AAIrB,UAAI,aAAa,SAAS,aAAa,EAAG;AAG1C,YAAM,QAAQ,UAAU;AACxB,UAAI,MAAM,WAAW,GAAG;AACtB,UAAE,eAAe;AACjB,kBAAU,MAAM;AAChB;AAAA,MACF;AACA,YAAM,QAAQ,MAAM,CAAC;AACrB,YAAM,OAAO,MAAM,MAAM,SAAS,CAAC;AACnC,YAAM,WAAW,SAAS;AAC1B,UAAI,EAAE,aAAa,aAAa,SAAS,aAAa,YAAY;AAChE,UAAE,eAAe;AACjB,aAAK,MAAM;AAAA,MACb,WAAW,CAAC,EAAE,YAAY,aAAa,MAAM;AAC3C,UAAE,eAAe;AACjB,cAAM,MAAM;AAAA,MACd;AAAA,IACF;AAKA,cAAU,iBAAiB,WAAW,SAAS;AAE/C,WAAO,MAAM;AACX,gBAAU,oBAAoB,WAAW,SAAS;AAClD,gBAAU,gBAAgB,SAAS;AAOnC,UAAI,UAAU,eAAe,QAAQ,QAAQ,OAAQ;AACrD,UAAI,CAAC,QAAQ,QAAQ,aAAc;AAKnC,UAAI,QAAQ,YAAa,CAAC,OAAuB,QAAQ;AAAA,IAC3D;AAAA,EACF,GAAG,CAAC,QAAQ,cAAc,MAAM,CAAC;AACnC;","names":["tabStops"]}
|
|
1
|
+
{"version":3,"sources":["../../src/hooks/use-focus-trap.ts"],"sourcesContent":["import { useEffect, useLayoutEffect, useRef, useState } from \"react\";\nimport { returnFocus, tabStops, tabStopsAround } from \"../lib/focus-left\";\n\n/**\n * Keep keyboard focus inside an open overlay, and give it back when it closes.\n *\n * Extracted from `Modal`, which was the ONLY component in this package that did any of\n * this. Every other overlay — the full-bleed dialog a phone's row editor opens, the\n * picker sheet, the numpad, the tour card — declared `role=\"dialog\" aria-modal=\"true\"`\n * and then left focus on the page behind it. That is the worst of the two possible\n * bugs: assistive technology hides the page because of `aria-modal`, while the user's\n * focus is still down there in the part that is now hidden, so Tab walks through\n * controls the screen reader refuses to describe.\n *\n * What this does beyond Modal's original copy:\n *\n * - **Recomputes the tabbable list on every Tab**, not once when the overlay opens.\n * These panels have conditionally-rendered contents — a search box that appears\n * once options load, a \"clear\" button that exists only while a filter is set — and\n * a list captured at open time traps focus against elements that have since gone.\n * - **Guards the restore target.** The element focused before opening may have left\n * the DOM by the time the overlay closes (the row that owned the button was\n * filtered away). Calling `.focus()` on a detached node silently drops focus to\n * `<body>`, which for a keyboard user means losing their place in the page\n * entirely. When the target is gone, focus falls back to the nearest thing that\n * still exists rather than to nothing — the kit's one rule for it, lib/focus-left's\n * `returnFocus` (0.52 code review 2026-10-31, held to 0.55; see the cleanup). Until\n * then this said so and did not: a gone opener left the focus on `<body>`.\n * - **Leaves an app's own autofocus alone** (0.33.1). React honours a child's\n * `autoFocus` while it commits, and this hook's effect runs AFTER that commit, so\n * focusing the container there took focus straight back off the field the app had\n * asked for. See `initialFocus`.\n * - **Nests.** An overlay can open another — a picker inside a dialog. Only the\n * innermost trap handles a keystroke, and closing it hands control back to the one\n * underneath. Innermost is decided by DOM containment rather than by mount order;\n * see the note on `TRAP_ATTR` for why the obvious stack is wrong.\n * `use-overlay-history.ts` reasons about the same nesting problem for the back\n * button; this is the focus half of it.\n */\n\n// The trap's reading of \"a Tab lands here\" is lib/focus-left's `tabStops` — the kit's one\n// copy of the rule since the 0.52 code review (round 0.34 BUG-4's history is there).\n// Re-exported where refactor audit 2026-10-30, DUP-9 put them, for a part that walks Tab\n// over something that is not a trap (the tour's field + card ring).\nexport { firstTabStop, tabStops } from \"../lib/focus-left\";\n\n/**\n * Marks a container whose trap is currently active.\n *\n * \"Which trap is innermost?\" is answered by DOM CONTAINMENT, not by mount order. The\n * obvious implementation — a module-level stack pushed in the effect — is wrong, and\n * wrong in a way that passes a casual reading: React runs CHILD effects before PARENT\n * effects, so a nested overlay pushes first and the outer one ends up on top of the\n * stack, claiming to be innermost. The outer trap then handles the keystroke and wraps\n * focus to its own first element, jumping the user out of the picker they had open.\n *\n * An attribute on the live DOM cannot disagree with the DOM.\n */\nconst TRAP_ATTR = \"data-focus-trap\";\n\nexport interface FocusTrapOptions {\n /** Trap only while this is true. Mount-time `true` is the common case. */\n active?: boolean;\n /**\n * Give the focus back as the trap is released — the kit's one rule, lib/focus-left's\n * `returnFocus` (0.52 code review 2026-10-31, held to 0.55): only a focus that was lost\n * or is still inside the container is moved; to the {@link opener}, else to what had\n * the focus as the trap engaged, else to the tab stops that stood around that, nearest\n * first; never to `<body>`. Default `true`.\n */\n restoreFocus?: boolean;\n /**\n * The control this overlay was opened from, when it knows it — its trigger. The focus\n * goes back there first, and to what had it as the trap engaged only when the trigger\n * cannot take it. Read as the trap is released. A Popover names its trigger: on Safari\n * (and Firefox on macOS) a click does not focus the button it lands on, so \"what had the\n * focus\" was the page, and the focus fell to `<body>` on close (0.55).\n */\n opener?: () => Element | null;\n /**\n * What to focus when the trap engages. Default is the container itself, which is\n * what `Modal` does and why: focusing the first FIELD pops the software keyboard on\n * a phone the moment a dialog opens, before the user has asked to type.\n * The container needs `tabIndex={-1}` for this to work.\n *\n * `\"container\"` and `\"first\"` both step aside when focus is ALREADY inside the\n * container, on something other than the container itself. That is a child the app\n * focused on purpose — an `autoFocus`, which React honours before this hook's effect\n * runs — and the keyboard it brings up is the one the user was promised. Moving focus\n * off it lost keksdose's create card its amount field the instant it got it, and on a\n * phone the numpad sheet with it, which shows only while the field is focused (live\n * #402). A function is the caller's explicit choice and is always followed.\n */\n initialFocus?: \"container\" | \"first\" | (() => HTMLElement | null);\n}\n\n/** Whatever has focus right now; nothing on the server, where there is no document. */\nfunction focusedElement(): Element | null {\n return typeof document === \"undefined\" ? null : document.activeElement;\n}\n\nexport function useFocusTrap(\n containerRef: React.RefObject<HTMLElement | null>,\n { active = true, restoreFocus = true, initialFocus = \"container\", opener: namedOpener }: FocusTrapOptions = {},\n): void {\n // Latest-ref so a caller passing an inline `initialFocus` thunk — which every caller\n // will — does not tear the trap down and re-engage it on each render, stealing focus\n // back to the top of the panel mid-interaction. Written in a LAYOUT effect so that\n // the trap's cleanup, which runs after the layout effects of the same commit, reads\n // this render's `active` rather than the last one's — see the cleanup for why.\n const optsRef = useRef({ active, restoreFocus, initialFocus, opener: namedOpener });\n useLayoutEffect(() => {\n optsRef.current = { active, restoreFocus, initialFocus, opener: namedOpener };\n });\n\n // Where focus was BEFORE the trap engaged: the element it is given back to on close.\n //\n // Read DURING the render that turns the trap on, and that timing is the point. React\n // honours a child's `autoFocus` while it commits that render, before any effect runs,\n // so the effect below asking `document.activeElement` would get the child, inside the\n // overlay. Restoring to that on close aimed focus at the dialog that was closing —\n // already out of the DOM, so focus fell to <body> rather than going back to the\n // button that opened it.\n //\n // State adjusted during render (the pattern `Modal` uses for `open`) rather than a\n // ref written there: set once per opening and cleared on release, so a re-render\n // while open cannot replace it with something inside, and StrictMode's second render\n // and second effect both see the same element. `undefined` means \"not captured\";\n // `null` is a capture that found nothing.\n const [opener, setOpener] = useState<Element | null | undefined>(undefined);\n if (active && opener === undefined) setOpener(focusedElement());\n else if (!active && opener !== undefined) setOpener(undefined);\n\n useEffect(() => {\n if (!active) return;\n const container = containerRef.current;\n if (!container) return;\n\n container.setAttribute(TRAP_ATTR, \"\");\n\n /** Is `node` inside a trap nested within this one? */\n const inNestedTrap = (node: Element | null) => {\n if (!node) return false;\n const owner = node.closest(`[${TRAP_ATTR}]`);\n return owner !== null && owner !== container;\n };\n\n const tabbables = () =>\n tabStops(container, { includeSelf: false }).filter(\n // A tabbable inside a NESTED open overlay belongs to that overlay's trap, not\n // to this one — otherwise the outer list spans both panels and Tab from the\n // inner panel's last control wraps to the OUTER panel's first.\n (el) => !inNestedTrap(el),\n );\n\n // Where the focus goes if the opener has left by the release (the row that owned it\n // was filtered away, deleted from the dialog it opened): the stops that stood around\n // it, nearest first — after it, then before — as AlertBanner's × reads them. Read\n // NOW, while the opener still has a place in the page to measure from; held by this\n // closure only, so it goes with the trap. Three a side: one that takes the focus is\n // all that is wanted.\n const around: HTMLElement[] = [];\n if (optsRef.current.restoreFocus && opener instanceof Element && opener.isConnected && opener !== document.body) {\n const { after, before } = tabStopsAround(opener, 3);\n for (const stop of [...after, ...before]) if (!container.contains(stop)) around.push(stop);\n }\n\n const { initialFocus: how } = optsRef.current;\n const focused = document.activeElement;\n // A child that already has focus was given it on purpose — see `initialFocus`.\n const childHasFocus = focused !== container && container.contains(focused);\n if (typeof how === \"function\") {\n (how() ?? container).focus();\n } else if (!childHasFocus) {\n (how === \"first\" ? (tabbables()[0] ?? container) : container).focus();\n }\n\n const onKeyDown = (e: KeyboardEvent) => {\n if (e.key !== \"Tab\") return;\n // Only the innermost trap acts. The event bubbles through every ancestor\n // container, so without this an outer dialog and an inner picker both handle one\n // Tab and fight over where focus lands.\n if (inNestedTrap(document.activeElement)) return;\n\n // Recomputed per keystroke — see the note at the top of this file.\n const items = tabbables();\n if (items.length === 0) {\n e.preventDefault();\n container.focus();\n return;\n }\n const first = items[0];\n const last = items[items.length - 1];\n const activeEl = document.activeElement;\n if (e.shiftKey && (activeEl === first || activeEl === container)) {\n e.preventDefault();\n last.focus();\n } else if (!e.shiftKey && activeEl === last) {\n e.preventDefault();\n first.focus();\n }\n };\n\n // On the container, not the document: a portalled child panel (an open dropdown\n // rendered to <body>) is outside this subtree and manages its own focus, which is\n // the behaviour Modal's comment describes and consumers already depend on.\n container.addEventListener(\"keydown\", onKeyDown);\n\n return () => {\n container.removeEventListener(\"keydown\", onKeyDown);\n container.removeAttribute(TRAP_ATTR);\n\n // Only when the trap is really being released: the container has left the page,\n // or `active` has turned false. StrictMode runs this cleanup once more right after\n // mounting, with the overlay still up, and then the effect again — and React does\n // not re-apply `autoFocus` for that second run. Restoring here would pull focus\n // out of the autofocused field for good: live #402 again, in development.\n if (container.isConnected && optsRef.current.active) return;\n if (!optsRef.current.restoreFocus) return;\n // The kit's one rule (lib/focus-left `returnFocus`; 0.52 code review 2026-10-31,\n // held to 0.55), in this, the releasing commit. Only a focus that fell with the\n // panel, or is still in one on its way out, is moved: an app's own `focus()` in\n // `onClose` is kept, where this used to put the opener over it. Then the named\n // trigger, what had the focus as the trap engaged, and the stops that stood around\n // that — where a gone opener used to leave the focus on <body> (\"a wrong guess is\n // worse than no move\"; the header promised the nearest thing that still exists).\n // `isConnected` and the focus are checked for each, as restoring to a removed or a\n // disabled node is the drop to <body> this guards against.\n const named = optsRef.current.opener?.();\n returnFocus({\n opener: named ?? opener,\n fallback: [named ? opener : null, ...around],\n closing: container.isConnected ? container : null,\n });\n };\n }, [active, containerRef, opener]);\n}\n"],"mappings":";AAAA,SAAS,WAAW,iBAAiB,QAAQ,gBAAgB;AAC7D,SAAS,aAAa,UAAU,sBAAsB;AA2CtD,SAAS,cAAc,YAAAA,iBAAgB;AAcvC,MAAM,YAAY;AAuClB,SAAS,iBAAiC;AACxC,SAAO,OAAO,aAAa,cAAc,OAAO,SAAS;AAC3D;AAEO,SAAS,aACd,cACA,EAAE,SAAS,MAAM,eAAe,MAAM,eAAe,aAAa,QAAQ,YAAY,IAAsB,CAAC,GACvG;AAMN,QAAM,UAAU,OAAO,EAAE,QAAQ,cAAc,cAAc,QAAQ,YAAY,CAAC;AAClF,kBAAgB,MAAM;AACpB,YAAQ,UAAU,EAAE,QAAQ,cAAc,cAAc,QAAQ,YAAY;AAAA,EAC9E,CAAC;AAgBD,QAAM,CAAC,QAAQ,SAAS,IAAI,SAAqC,MAAS;AAC1E,MAAI,UAAU,WAAW,OAAW,WAAU,eAAe,CAAC;AAAA,WACrD,CAAC,UAAU,WAAW,OAAW,WAAU,MAAS;AAE7D,YAAU,MAAM;AACd,QAAI,CAAC,OAAQ;AACb,UAAM,YAAY,aAAa;AAC/B,QAAI,CAAC,UAAW;AAEhB,cAAU,aAAa,WAAW,EAAE;AAGpC,UAAM,eAAe,CAAC,SAAyB;AAC7C,UAAI,CAAC,KAAM,QAAO;AAClB,YAAM,QAAQ,KAAK,QAAQ,IAAI,SAAS,GAAG;AAC3C,aAAO,UAAU,QAAQ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AAAA,IACF;AAKA,cAAU,iBAAiB,WAAW,SAAS;AAE/C,WAAO,MAAM;AACX,gBAAU,oBAAoB,WAAW,SAAS;AAClD,gBAAU,gBAAgB,SAAS;AAOnC,UAAI,UAAU,eAAe,QAAQ,QAAQ,OAAQ;AACrD,UAAI,CAAC,QAAQ,QAAQ,aAAc;AAUnC,YAAM,QAAQ,QAAQ,QAAQ,SAAS;AACvC,kBAAY;AAAA,QACV,QAAQ,SAAS;AAAA,QACjB,UAAU,CAAC,QAAQ,SAAS,MAAM,GAAG,MAAM;AAAA,QAC3C,SAAS,UAAU,cAAc,YAAY;AAAA,MAC/C,CAAC;AAAA,IACH;AAAA,EACF,GAAG,CAAC,QAAQ,cAAc,MAAM,CAAC;AACnC;","names":["tabStops"]}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Does this device have a camera to take a photo WITH? keksdose's `useHasCamera`
|
|
3
|
+
* (shared/hooks/use-has-camera.ts:28, live #292 round three: *"If there is no device to
|
|
4
|
+
* take a photo can the take photo button be hidden? … If they do not have a web cam?"*),
|
|
5
|
+
* for every app — kastlan's handover photo buttons offer the camera on a desktop that has
|
|
6
|
+
* none (kastlan reuse audit 2026-11-02, proposal 8).
|
|
7
|
+
*
|
|
8
|
+
* `navigator.mediaDevices.enumerateDevices()` is the only honest answer there is. It
|
|
9
|
+
* reports the PRESENCE of a video input without a permission: the spec hides a device's
|
|
10
|
+
* label and id until the camera is granted, not the device, so counting `videoinput`
|
|
11
|
+
* entries asks the user nothing and opens no prompt. A webcam plugged in later fires
|
|
12
|
+
* `devicechange`, which asks again.
|
|
13
|
+
*
|
|
14
|
+
* **It fails OPEN, as keksdose's does.** Every answer that is not a positive "no" keeps
|
|
15
|
+
* the camera: no `mediaDevices` at all (an insecure context — `http://` on a LAN address
|
|
16
|
+
* is how the apps are developed), an `enumerateDevices` that rejects (a permissions
|
|
17
|
+
* policy), and — the one place this goes further than keksdose — a list with nothing in
|
|
18
|
+
* it whatever its kind: a device with no camera still has a speaker or a microphone to
|
|
19
|
+
* list, so an empty list is a browser declining to say (older WebKit, a hardened
|
|
20
|
+
* privacy mode), not a device without one. Hiding the control that opens the camera
|
|
21
|
+
* because the browser would not say takes the feature away from the phone it is for;
|
|
22
|
+
* showing it on a desktop that cannot use it costs one tap.
|
|
23
|
+
*
|
|
24
|
+
* **Cached**, unlike keksdose's: one answer for the page, shared by every button that
|
|
25
|
+
* asks. The first to mount asks the browser and listens for `devicechange`; the rest
|
|
26
|
+
* read the answer, and a button mounted later starts from it — so a desktop with no
|
|
27
|
+
* webcam does not show "Take photo" for a frame on every page that has the button.
|
|
28
|
+
* When the last one unmounts the listener goes, and the next first mount asks again (a
|
|
29
|
+
* camera may have come or gone in between). Before an answer, on the server and in
|
|
30
|
+
* jsdom (which has no `mediaDevices`), it is `true`.
|
|
31
|
+
*
|
|
32
|
+
* What it does not answer is whether a file input's `capture` will be HONOURED — a
|
|
33
|
+
* desktop Chrome with a webcam reports a video input and then ignores `capture`. That is
|
|
34
|
+
* why {@link CameraButton} opens the camera with `getUserMedia`, not with `capture`.
|
|
35
|
+
*/
|
|
36
|
+
export declare function useHasCamera(): boolean;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useSyncExternalStore } from "react";
|
|
3
|
+
function useHasCamera() {
|
|
4
|
+
return useSyncExternalStore(subscribe, snapshot, serverSnapshot);
|
|
5
|
+
}
|
|
6
|
+
let known;
|
|
7
|
+
const listeners = /* @__PURE__ */ new Set();
|
|
8
|
+
let watched = null;
|
|
9
|
+
function settle(next) {
|
|
10
|
+
if (next === known) return;
|
|
11
|
+
known = next;
|
|
12
|
+
for (const listener of listeners) listener();
|
|
13
|
+
}
|
|
14
|
+
function ask() {
|
|
15
|
+
const media = watched;
|
|
16
|
+
if (!media) return;
|
|
17
|
+
media.enumerateDevices().then(
|
|
18
|
+
(devices) => {
|
|
19
|
+
settle(devices.length === 0 ? void 0 : devices.some((d) => d.kind === "videoinput"));
|
|
20
|
+
},
|
|
21
|
+
// A refusal is not an absence — see "fails open" above.
|
|
22
|
+
() => settle(void 0)
|
|
23
|
+
);
|
|
24
|
+
}
|
|
25
|
+
function subscribe(listener) {
|
|
26
|
+
listeners.add(listener);
|
|
27
|
+
if (listeners.size === 1) {
|
|
28
|
+
const media = typeof navigator === "undefined" ? void 0 : navigator.mediaDevices;
|
|
29
|
+
if (media && typeof media.enumerateDevices === "function") {
|
|
30
|
+
watched = media;
|
|
31
|
+
media.addEventListener?.("devicechange", ask);
|
|
32
|
+
ask();
|
|
33
|
+
} else {
|
|
34
|
+
settle(void 0);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
return () => {
|
|
38
|
+
listeners.delete(listener);
|
|
39
|
+
if (listeners.size > 0 || !watched) return;
|
|
40
|
+
watched.removeEventListener?.("devicechange", ask);
|
|
41
|
+
watched = null;
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
function snapshot() {
|
|
45
|
+
return known ?? true;
|
|
46
|
+
}
|
|
47
|
+
function serverSnapshot() {
|
|
48
|
+
return true;
|
|
49
|
+
}
|
|
50
|
+
export {
|
|
51
|
+
useHasCamera
|
|
52
|
+
};
|
|
53
|
+
//# sourceMappingURL=use-has-camera.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/hooks/use-has-camera.ts"],"sourcesContent":["import { useSyncExternalStore } from \"react\";\n\n/**\n * Does this device have a camera to take a photo WITH? keksdose's `useHasCamera`\n * (shared/hooks/use-has-camera.ts:28, live #292 round three: *\"If there is no device to\n * take a photo can the take photo button be hidden? … If they do not have a web cam?\"*),\n * for every app — kastlan's handover photo buttons offer the camera on a desktop that has\n * none (kastlan reuse audit 2026-11-02, proposal 8).\n *\n * `navigator.mediaDevices.enumerateDevices()` is the only honest answer there is. It\n * reports the PRESENCE of a video input without a permission: the spec hides a device's\n * label and id until the camera is granted, not the device, so counting `videoinput`\n * entries asks the user nothing and opens no prompt. A webcam plugged in later fires\n * `devicechange`, which asks again.\n *\n * **It fails OPEN, as keksdose's does.** Every answer that is not a positive \"no\" keeps\n * the camera: no `mediaDevices` at all (an insecure context — `http://` on a LAN address\n * is how the apps are developed), an `enumerateDevices` that rejects (a permissions\n * policy), and — the one place this goes further than keksdose — a list with nothing in\n * it whatever its kind: a device with no camera still has a speaker or a microphone to\n * list, so an empty list is a browser declining to say (older WebKit, a hardened\n * privacy mode), not a device without one. Hiding the control that opens the camera\n * because the browser would not say takes the feature away from the phone it is for;\n * showing it on a desktop that cannot use it costs one tap.\n *\n * **Cached**, unlike keksdose's: one answer for the page, shared by every button that\n * asks. The first to mount asks the browser and listens for `devicechange`; the rest\n * read the answer, and a button mounted later starts from it — so a desktop with no\n * webcam does not show \"Take photo\" for a frame on every page that has the button.\n * When the last one unmounts the listener goes, and the next first mount asks again (a\n * camera may have come or gone in between). Before an answer, on the server and in\n * jsdom (which has no `mediaDevices`), it is `true`.\n *\n * What it does not answer is whether a file input's `capture` will be HONOURED — a\n * desktop Chrome with a webcam reports a video input and then ignores `capture`. That is\n * why {@link CameraButton} opens the camera with `getUserMedia`, not with `capture`.\n */\nexport function useHasCamera(): boolean {\n return useSyncExternalStore(subscribe, snapshot, serverSnapshot);\n}\n\n/** The last answer: `undefined` until there is one, or when the browser would not say. */\nlet known: boolean | undefined;\nconst listeners = new Set<() => void>();\n/** The `MediaDevices` the `devicechange` listener is on, while anyone listens. */\nlet watched: MediaDevices | null = null;\n\nfunction settle(next: boolean | undefined) {\n if (next === known) return;\n known = next;\n for (const listener of listeners) listener();\n}\n\nfunction ask() {\n const media = watched;\n if (!media) return;\n media.enumerateDevices().then(\n (devices) => {\n // An answer that arrives after the last listener left still counts: it is about\n // the device, and the next mount starts from it.\n settle(devices.length === 0 ? undefined : devices.some((d) => d.kind === \"videoinput\"));\n },\n // A refusal is not an absence — see \"fails open\" above.\n () => settle(undefined),\n );\n}\n\nfunction subscribe(listener: () => void): () => void {\n listeners.add(listener);\n if (listeners.size === 1) {\n const media = typeof navigator === \"undefined\" ? undefined : navigator.mediaDevices;\n if (media && typeof media.enumerateDevices === \"function\") {\n watched = media;\n media.addEventListener?.(\"devicechange\", ask);\n ask();\n } else {\n // Nothing to ask: an unknown, whatever an earlier page (or test) found.\n settle(undefined);\n }\n }\n return () => {\n listeners.delete(listener);\n if (listeners.size > 0 || !watched) return;\n watched.removeEventListener?.(\"devicechange\", ask);\n watched = null;\n };\n}\n\nfunction snapshot(): boolean {\n return known ?? true;\n}\n\nfunction serverSnapshot(): boolean {\n return true;\n}\n"],"mappings":";AAAA,SAAS,4BAA4B;AAqC9B,SAAS,eAAwB;AACtC,SAAO,qBAAqB,WAAW,UAAU,cAAc;AACjE;AAGA,IAAI;AACJ,MAAM,YAAY,oBAAI,IAAgB;AAEtC,IAAI,UAA+B;AAEnC,SAAS,OAAO,MAA2B;AACzC,MAAI,SAAS,MAAO;AACpB,UAAQ;AACR,aAAW,YAAY,UAAW,UAAS;AAC7C;AAEA,SAAS,MAAM;AACb,QAAM,QAAQ;AACd,MAAI,CAAC,MAAO;AACZ,QAAM,iBAAiB,EAAE;AAAA,IACvB,CAAC,YAAY;AAGX,aAAO,QAAQ,WAAW,IAAI,SAAY,QAAQ,KAAK,CAAC,MAAM,EAAE,SAAS,YAAY,CAAC;AAAA,IACxF;AAAA;AAAA,IAEA,MAAM,OAAO,MAAS;AAAA,EACxB;AACF;AAEA,SAAS,UAAU,UAAkC;AACnD,YAAU,IAAI,QAAQ;AACtB,MAAI,UAAU,SAAS,GAAG;AACxB,UAAM,QAAQ,OAAO,cAAc,cAAc,SAAY,UAAU;AACvE,QAAI,SAAS,OAAO,MAAM,qBAAqB,YAAY;AACzD,gBAAU;AACV,YAAM,mBAAmB,gBAAgB,GAAG;AAC5C,UAAI;AAAA,IACN,OAAO;AAEL,aAAO,MAAS;AAAA,IAClB;AAAA,EACF;AACA,SAAO,MAAM;AACX,cAAU,OAAO,QAAQ;AACzB,QAAI,UAAU,OAAO,KAAK,CAAC,QAAS;AACpC,YAAQ,sBAAsB,gBAAgB,GAAG;AACjD,cAAU;AAAA,EACZ;AACF;AAEA,SAAS,WAAoB;AAC3B,SAAO,SAAS;AAClB;AAEA,SAAS,iBAA0B;AACjC,SAAO;AACT;","names":[]}
|
package/dist/hooks/use-hotkey.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { useEffect, useRef } from "react";
|
|
3
|
+
import { isEditableContent } from "../lib/editable-content.js";
|
|
3
4
|
function isApplePlatform() {
|
|
4
5
|
if (typeof navigator === "undefined") return false;
|
|
5
6
|
const nav = navigator;
|
|
@@ -59,7 +60,7 @@ function matchesHotkey(e, combo) {
|
|
|
59
60
|
}
|
|
60
61
|
function isTypingTarget(target) {
|
|
61
62
|
if (!(target instanceof HTMLElement)) return false;
|
|
62
|
-
if (target
|
|
63
|
+
if (isEditableContent(target)) return true;
|
|
63
64
|
if (target instanceof HTMLTextAreaElement || target instanceof HTMLSelectElement) return true;
|
|
64
65
|
if (target instanceof HTMLInputElement) {
|
|
65
66
|
return !["button", "checkbox", "radio", "submit", "reset", "range", "color", "file", "image"].includes(target.type);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/hooks/use-hotkey.ts"],"sourcesContent":["import { useEffect, useRef } from \"react\";\n\n/**\n * A key combination: modifiers and one key, joined by \"+\", case-insensitive —\n * `\"Ctrl+Shift+F\"`, `\"Mod+K\"`, `\"Alt+ArrowUp\"`, `\"Escape\"`, `\"?\"`.\n *\n * Modifiers: `Ctrl` (`Control`), `Meta` (`Cmd`, `Command`), `Shift`, `Alt` (`Option`),\n * and `Mod` — Cmd on Apple platforms, Ctrl everywhere else, the one to use for an\n * app shortcut. The key is `KeyboardEvent.key` (\"f\", \"Enter\", \"ArrowUp\", \"/\"), or a\n * `KeyboardEvent.code` (\"KeyF\", \"Digit1\") when the physical key is what matters.\n * Several combos: pass an array.\n */\nexport type Hotkey = string;\n\nexport interface UseHotkeyOptions {\n /** Off while `false` (default `true`). */\n enabled?: boolean;\n /** Call `preventDefault()` on a match (default `true`): Ctrl+Shift+F must not also\n * open the browser's own dialog. */\n preventDefault?: boolean;\n /** Where to listen. Default `document`. A ref, an element, or `window`. */\n target?: EventTarget | null | { current: EventTarget | null };\n /**\n * Fire while the focus is in a text field, select or contenteditable too. Default\n * `false`: a shortcut must not steal the letters someone is typing. A combo with Ctrl,\n * Meta or Alt is not typing — those still fire unless this is `\"never\"`.\n */\n allowInInputs?: boolean | \"never\";\n /** `keydown` (default) or `keyup`. */\n event?: \"keydown\" | \"keyup\";\n}\n\nexport interface ParsedHotkey {\n ctrl: boolean;\n meta: boolean;\n shift: boolean;\n alt: boolean;\n key: string;\n}\n\n/** Whether this is an Apple platform, where `Mod` means Cmd. */\nexport function isApplePlatform(): boolean {\n if (typeof navigator === \"undefined\") return false;\n const nav = navigator as Navigator & { userAgentData?: { platform?: string } };\n return /mac|iphone|ipad|ipod/i.test(nav.userAgentData?.platform || nav.platform || nav.userAgent);\n}\n\n/** Parse one combo. `apple` decides what `Mod` is. Throws on an empty key. */\nexport function parseHotkey(combo: Hotkey, apple = isApplePlatform()): ParsedHotkey {\n const parts = combo\n .split(\"+\")\n .map((p) => p.trim())\n // \"Ctrl++\" is Ctrl and \"+\": an empty part after a \"+\" is the plus key itself.\n .map((p, i, all) => (p === \"\" && i === all.length - 1 ? \"+\" : p))\n .filter((p) => p !== \"\");\n const out: ParsedHotkey = { ctrl: false, meta: false, shift: false, alt: false, key: \"\" };\n for (const part of parts) {\n switch (part.toLowerCase()) {\n case \"ctrl\":\n case \"control\":\n out.ctrl = true;\n break;\n case \"meta\":\n case \"cmd\":\n case \"command\":\n out.meta = true;\n break;\n case \"mod\":\n if (apple) out.meta = true;\n else out.ctrl = true;\n break;\n case \"shift\":\n out.shift = true;\n break;\n case \"alt\":\n case \"option\":\n out.alt = true;\n break;\n default:\n out.key = part;\n }\n }\n if (!out.key) throw new Error(`useHotkey: \"${combo}\" names no key`);\n return out;\n}\n\nconst KEY_ALIASES: Record<string, string> = {\n esc: \"escape\",\n space: \" \",\n del: \"delete\",\n up: \"arrowup\",\n down: \"arrowdown\",\n left: \"arrowleft\",\n right: \"arrowright\",\n};\n\n/** One letter of a script other than Latin: what a Russian, Greek or Hebrew layout's letter keys type. */\nconst NON_LATIN_LETTER = /^(?!\\p{Script=Latin})\\p{L}$/u;\n\n/** Whether `e` is `combo` — every modifier as named (no more, no fewer), and the key. */\nexport function matchesHotkey(e: KeyboardEvent, combo: ParsedHotkey): boolean {\n if (e.ctrlKey !== combo.ctrl || e.metaKey !== combo.meta || e.altKey !== combo.alt) return false;\n const want = KEY_ALIASES[combo.key.toLowerCase()] ?? combo.key.toLowerCase();\n const key = (e.key ?? \"\").toLowerCase();\n const code = (e.code ?? \"\").toLowerCase();\n // On a non-Latin layout `key` is the local letter — Ctrl+K types \"л\" on a Russian one —\n // so a letter chord never fired there, ⌘K included (0.52 code review, use-hotkey.ts; the\n // hand-written ⌘K listener before 0.52 compared `key` alone and missed it too). The\n // physical key stands in for the letter there, and only there: a Latin layout's letter\n // is wherever it types (Dvorak's K is on QWERTY's V).\n const physical = /^[a-z]$/.test(want) && NON_LATIN_LETTER.test(e.key ?? \"\") && code === `key${want}`;\n if (key !== want && code !== want && !physical) return false;\n // Shift must match exactly for a letter or a named key; for a symbol it is how the\n // symbol is typed (\"?\" is Shift+/ on a US layout, a plain key on others), so an\n // unnamed Shift is not held against it. Space is a named key, not a symbol, though its\n // alias is one character: \"Space\" fired on Shift+Space, the browser's page-up, and\n // cancelled it (0.52 code review, use-hotkey.ts).\n const symbol = want.length === 1 && !/[a-z0-9 ]/.test(want);\n return symbol && !combo.shift ? true : e.shiftKey === combo.shift;\n}\n\n/** Is the focus somewhere that takes typed characters? */\nfunction isTypingTarget(target: EventTarget | null): boolean {\n if (!(target instanceof HTMLElement)) return false;\n if (target.isContentEditable) return true;\n if (target instanceof HTMLTextAreaElement || target instanceof HTMLSelectElement) return true;\n if (target instanceof HTMLInputElement) {\n return ![\"button\", \"checkbox\", \"radio\", \"submit\", \"reset\", \"range\", \"color\", \"file\", \"image\"].includes(target.type);\n }\n return false;\n}\n\n/**\n * Call `handler` when `combo` is pressed — kastlan's feedback button (Ctrl+Shift+F,\n * feedback-button:60) wired it by hand, and so will every next shortcut.\n *\n * - `Mod` is Cmd on a Mac and Ctrl elsewhere, read once per mount.\n * - Modifiers match EXACTLY: `\"Ctrl+K\"` does not fire on Ctrl+Shift+K.\n * - Typing in a field is left alone unless `allowInInputs`, except for a combo with\n * Ctrl / Meta / Alt, which no one types as text.\n * - A key held down fires once, not on every repeat — and its repeats are cancelled as\n * the first press was, or the browser acts on them.\n * - The newest `handler` is always called; changing it does not re-attach the listener.\n *\n * `useCommandKey` (the ⌘K palette hook) is this with `\"Mod+K\"` and `allowInInputs`\n * since 0.52, and FormActions' Ctrl/Cmd+Enter is {@link matchesHotkey} (refactor audit\n * 2026-10-30, DUP-12): one reading of a chord.\n */\nexport function useHotkey(\n combo: Hotkey | ReadonlyArray<Hotkey>,\n handler: (event: KeyboardEvent) => void,\n options: UseHotkeyOptions = {},\n): void {\n const { enabled = true, preventDefault = true, target, allowInInputs = false, event = \"keydown\" } = options;\n const handlerRef = useRef(handler);\n useEffect(() => {\n handlerRef.current = handler;\n });\n const key = typeof combo === \"string\" ? combo : combo.join(\"\\u0000\");\n const targetEl = target && \"current\" in target ? undefined : target;\n const targetRef = target && \"current\" in target ? target : undefined;\n\n useEffect(() => {\n if (!enabled) return;\n const node: EventTarget | null =\n targetRef?.current ?? targetEl ?? (typeof document === \"undefined\" ? null : document);\n if (!node) return;\n const apple = isApplePlatform();\n const parsed = key.split(\"\\u0000\").map((c) => parseHotkey(c, apple));\n const listener = (raw: Event) => {\n const e = raw as KeyboardEvent;\n const hit = parsed.find((p) => matchesHotkey(e, p));\n if (!hit) return;\n if (allowInInputs !== true && isTypingTarget(e.target)) {\n const chorded = hit.ctrl || hit.meta || hit.alt;\n if (allowInInputs === \"never\" || !chorded) return;\n }\n if (preventDefault) e.preventDefault();\n // A held key's repeats are cancelled like its first press, and call nothing. They\n // returned before the `preventDefault` once, so a held Ctrl+K's repeats reached the\n // browser's own Ctrl+K and took the focus out of the palette ⌘K had just opened\n // (0.52 code review, use-hotkey.ts; the hand-written ⌘K listener cancelled them).\n if (e.repeat) return;\n handlerRef.current(e);\n };\n node.addEventListener(event, listener);\n return () => node.removeEventListener(event, listener);\n }, [key, enabled, preventDefault, allowInInputs, event, targetEl, targetRef]);\n}\n"],"mappings":";AAAA,SAAS,WAAW,cAAc;AAyC3B,SAAS,kBAA2B;AACzC,MAAI,OAAO,cAAc,YAAa,QAAO;AAC7C,QAAM,MAAM;AACZ,SAAO,wBAAwB,KAAK,IAAI,eAAe,YAAY,IAAI,YAAY,IAAI,SAAS;AAClG;AAGO,SAAS,YAAY,OAAe,QAAQ,gBAAgB,GAAiB;AAClF,QAAM,QAAQ,MACX,MAAM,GAAG,EACT,IAAI,CAAC,MAAM,EAAE,KAAK,CAAC,EAEnB,IAAI,CAAC,GAAG,GAAG,QAAS,MAAM,MAAM,MAAM,IAAI,SAAS,IAAI,MAAM,CAAE,EAC/D,OAAO,CAAC,MAAM,MAAM,EAAE;AACzB,QAAM,MAAoB,EAAE,MAAM,OAAO,MAAM,OAAO,OAAO,OAAO,KAAK,OAAO,KAAK,GAAG;AACxF,aAAW,QAAQ,OAAO;AACxB,YAAQ,KAAK,YAAY,GAAG;AAAA,MAC1B,KAAK;AAAA,MACL,KAAK;AACH,YAAI,OAAO;AACX;AAAA,MACF,KAAK;AAAA,MACL,KAAK;AAAA,MACL,KAAK;AACH,YAAI,OAAO;AACX;AAAA,MACF,KAAK;AACH,YAAI,MAAO,KAAI,OAAO;AAAA,YACjB,KAAI,OAAO;AAChB;AAAA,MACF,KAAK;AACH,YAAI,QAAQ;AACZ;AAAA,MACF,KAAK;AAAA,MACL,KAAK;AACH,YAAI,MAAM;AACV;AAAA,MACF;AAC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EAAE,UAAU,MAAM,iBAAiB,MAAM,QAAQ,gBAAgB,OAAO,QAAQ,UAAU,IAAI;AACpG,QAAM,aAAa,OAAO,OAAO;AACjC,YAAU,MAAM;AACd,eAAW,UAAU;AAAA,EACvB,CAAC;AACD,QAAM,MAAM,OAAO,UAAU,WAAW,QAAQ,MAAM,KAAK,IAAQ;AACnE,QAAM,WAAW,UAAU,aAAa,SAAS,SAAY;AAC7D,QAAM,YAAY,UAAU,aAAa,SAAS,SAAS;AAE3D,YAAU,MAAM;AACd,QAAI,CAAC,QAAS;AACd,UAAM,OACJ,WAAW,WAAW,aAAa,OAAO,aAAa,cAAc,OAAO;AAC9E,QAAI,CAAC,KAAM;AACX,UAAM,QAAQ,gBAAgB;AAC9B,UAAM,SAAS,IAAI,MAAM,IAAQ,EAAE,IAAI,CAAC,MAAM,YAAY,GAAG,KAAK,CAAC;AACnE,UAAM,WAAW,CAAC,QAAe;AAC/B,YAAM,IAAI;AACV,YAAM,MAAM,OAAO,KAAK,CAAC,MAAM,cAAc,GAAG,CAAC,CAAC;AAClD,UAAI,CAAC,IAAK;AACV,UAAI,kBAAkB,QAAQ,eAAe,EAAE,MAAM,GAAG;AACtD,cAAM,UAAU,IAAI,QAAQ,IAAI,QAAQ,IAAI;AAC5C,YAAI,kBAAkB,WAAW,CAAC,QAAS;AAAA,MAC7C;AACA,UAAI,eAAgB,GAAE,eAAe;AAKrC,UAAI,EAAE,OAAQ;AACd,iBAAW,QAAQ,CAAC;AAAA,IACtB;AACA,SAAK,iBAAiB,OAAO,QAAQ;AACrC,WAAO,MAAM,KAAK,oBAAoB,OAAO,QAAQ;AAAA,EACvD,GAAG,CAAC,KAAK,SAAS,gBAAgB,eAAe,OAAO,UAAU,SAAS,CAAC;AAC9E;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../src/hooks/use-hotkey.ts"],"sourcesContent":["import { useEffect, useRef } from \"react\";\nimport { isEditableContent } from \"../lib/editable-content\";\n\n/**\n * A key combination: modifiers and one key, joined by \"+\", case-insensitive —\n * `\"Ctrl+Shift+F\"`, `\"Mod+K\"`, `\"Alt+ArrowUp\"`, `\"Escape\"`, `\"?\"`.\n *\n * Modifiers: `Ctrl` (`Control`), `Meta` (`Cmd`, `Command`), `Shift`, `Alt` (`Option`),\n * and `Mod` — Cmd on Apple platforms, Ctrl everywhere else, the one to use for an\n * app shortcut. The key is `KeyboardEvent.key` (\"f\", \"Enter\", \"ArrowUp\", \"/\"), or a\n * `KeyboardEvent.code` (\"KeyF\", \"Digit1\") when the physical key is what matters.\n * Several combos: pass an array.\n */\nexport type Hotkey = string;\n\nexport interface UseHotkeyOptions {\n /** Off while `false` (default `true`). */\n enabled?: boolean;\n /** Call `preventDefault()` on a match (default `true`): Ctrl+Shift+F must not also\n * open the browser's own dialog. */\n preventDefault?: boolean;\n /** Where to listen. Default `document`. A ref, an element, or `window`. */\n target?: EventTarget | null | { current: EventTarget | null };\n /**\n * Fire while the focus is in a text field, select or contenteditable too. Default\n * `false`: a shortcut must not steal the letters someone is typing. A combo with Ctrl,\n * Meta or Alt is not typing — those still fire unless this is `\"never\"`.\n */\n allowInInputs?: boolean | \"never\";\n /** `keydown` (default) or `keyup`. */\n event?: \"keydown\" | \"keyup\";\n}\n\nexport interface ParsedHotkey {\n ctrl: boolean;\n meta: boolean;\n shift: boolean;\n alt: boolean;\n key: string;\n}\n\n/** Whether this is an Apple platform, where `Mod` means Cmd. */\nexport function isApplePlatform(): boolean {\n if (typeof navigator === \"undefined\") return false;\n const nav = navigator as Navigator & { userAgentData?: { platform?: string } };\n return /mac|iphone|ipad|ipod/i.test(nav.userAgentData?.platform || nav.platform || nav.userAgent);\n}\n\n/** Parse one combo. `apple` decides what `Mod` is. Throws on an empty key. */\nexport function parseHotkey(combo: Hotkey, apple = isApplePlatform()): ParsedHotkey {\n const parts = combo\n .split(\"+\")\n .map((p) => p.trim())\n // \"Ctrl++\" is Ctrl and \"+\": an empty part after a \"+\" is the plus key itself.\n .map((p, i, all) => (p === \"\" && i === all.length - 1 ? \"+\" : p))\n .filter((p) => p !== \"\");\n const out: ParsedHotkey = { ctrl: false, meta: false, shift: false, alt: false, key: \"\" };\n for (const part of parts) {\n switch (part.toLowerCase()) {\n case \"ctrl\":\n case \"control\":\n out.ctrl = true;\n break;\n case \"meta\":\n case \"cmd\":\n case \"command\":\n out.meta = true;\n break;\n case \"mod\":\n if (apple) out.meta = true;\n else out.ctrl = true;\n break;\n case \"shift\":\n out.shift = true;\n break;\n case \"alt\":\n case \"option\":\n out.alt = true;\n break;\n default:\n out.key = part;\n }\n }\n if (!out.key) throw new Error(`useHotkey: \"${combo}\" names no key`);\n return out;\n}\n\nconst KEY_ALIASES: Record<string, string> = {\n esc: \"escape\",\n space: \" \",\n del: \"delete\",\n up: \"arrowup\",\n down: \"arrowdown\",\n left: \"arrowleft\",\n right: \"arrowright\",\n};\n\n/** One letter of a script other than Latin: what a Russian, Greek or Hebrew layout's letter keys type. */\nconst NON_LATIN_LETTER = /^(?!\\p{Script=Latin})\\p{L}$/u;\n\n/** Whether `e` is `combo` — every modifier as named (no more, no fewer), and the key. */\nexport function matchesHotkey(e: KeyboardEvent, combo: ParsedHotkey): boolean {\n if (e.ctrlKey !== combo.ctrl || e.metaKey !== combo.meta || e.altKey !== combo.alt) return false;\n const want = KEY_ALIASES[combo.key.toLowerCase()] ?? combo.key.toLowerCase();\n const key = (e.key ?? \"\").toLowerCase();\n const code = (e.code ?? \"\").toLowerCase();\n // On a non-Latin layout `key` is the local letter — Ctrl+K types \"л\" on a Russian one —\n // so a letter chord never fired there, ⌘K included (0.52 code review, use-hotkey.ts; the\n // hand-written ⌘K listener before 0.52 compared `key` alone and missed it too). The\n // physical key stands in for the letter there, and only there: a Latin layout's letter\n // is wherever it types (Dvorak's K is on QWERTY's V).\n const physical = /^[a-z]$/.test(want) && NON_LATIN_LETTER.test(e.key ?? \"\") && code === `key${want}`;\n if (key !== want && code !== want && !physical) return false;\n // Shift must match exactly for a letter or a named key; for a symbol it is how the\n // symbol is typed (\"?\" is Shift+/ on a US layout, a plain key on others), so an\n // unnamed Shift is not held against it. Space is a named key, not a symbol, though its\n // alias is one character: \"Space\" fired on Shift+Space, the browser's page-up, and\n // cancelled it (0.52 code review, use-hotkey.ts).\n const symbol = want.length === 1 && !/[a-z0-9 ]/.test(want);\n return symbol && !combo.shift ? true : e.shiftKey === combo.shift;\n}\n\n/** Is the focus somewhere that takes typed characters? Editable content by the kit's one\n * rule (lib/editable-content; written here in 0.54, moved there for the tour, the bulk\n * bar and the clipboard in its follow-up). */\nfunction isTypingTarget(target: EventTarget | null): boolean {\n if (!(target instanceof HTMLElement)) return false;\n if (isEditableContent(target)) return true;\n if (target instanceof HTMLTextAreaElement || target instanceof HTMLSelectElement) return true;\n if (target instanceof HTMLInputElement) {\n return ![\"button\", \"checkbox\", \"radio\", \"submit\", \"reset\", \"range\", \"color\", \"file\", \"image\"].includes(target.type);\n }\n return false;\n}\n\n/**\n * Call `handler` when `combo` is pressed — kastlan's feedback button (Ctrl+Shift+F,\n * feedback-button:60) wired it by hand, and so will every next shortcut.\n *\n * - `Mod` is Cmd on a Mac and Ctrl elsewhere, read once per mount.\n * - Modifiers match EXACTLY: `\"Ctrl+K\"` does not fire on Ctrl+Shift+K.\n * - Typing in a field is left alone unless `allowInInputs`, except for a combo with\n * Ctrl / Meta / Alt, which no one types as text.\n * - A key held down fires once, not on every repeat — and its repeats are cancelled as\n * the first press was, or the browser acts on them.\n * - The newest `handler` is always called; changing it does not re-attach the listener.\n *\n * `useCommandKey` (the ⌘K palette hook) is this with `\"Mod+K\"` and `allowInInputs`\n * since 0.52, and FormActions' Ctrl/Cmd+Enter is {@link matchesHotkey} (refactor audit\n * 2026-10-30, DUP-12): one reading of a chord.\n */\nexport function useHotkey(\n combo: Hotkey | ReadonlyArray<Hotkey>,\n handler: (event: KeyboardEvent) => void,\n options: UseHotkeyOptions = {},\n): void {\n const { enabled = true, preventDefault = true, target, allowInInputs = false, event = \"keydown\" } = options;\n const handlerRef = useRef(handler);\n useEffect(() => {\n handlerRef.current = handler;\n });\n const key = typeof combo === \"string\" ? combo : combo.join(\"\\u0000\");\n const targetEl = target && \"current\" in target ? undefined : target;\n const targetRef = target && \"current\" in target ? target : undefined;\n\n useEffect(() => {\n if (!enabled) return;\n const node: EventTarget | null =\n targetRef?.current ?? targetEl ?? (typeof document === \"undefined\" ? null : document);\n if (!node) return;\n const apple = isApplePlatform();\n const parsed = key.split(\"\\u0000\").map((c) => parseHotkey(c, apple));\n const listener = (raw: Event) => {\n const e = raw as KeyboardEvent;\n const hit = parsed.find((p) => matchesHotkey(e, p));\n if (!hit) return;\n if (allowInInputs !== true && isTypingTarget(e.target)) {\n const chorded = hit.ctrl || hit.meta || hit.alt;\n if (allowInInputs === \"never\" || !chorded) return;\n }\n if (preventDefault) e.preventDefault();\n // A held key's repeats are cancelled like its first press, and call nothing. They\n // returned before the `preventDefault` once, so a held Ctrl+K's repeats reached the\n // browser's own Ctrl+K and took the focus out of the palette ⌘K had just opened\n // (0.52 code review, use-hotkey.ts; the hand-written ⌘K listener cancelled them).\n if (e.repeat) return;\n handlerRef.current(e);\n };\n node.addEventListener(event, listener);\n return () => node.removeEventListener(event, listener);\n }, [key, enabled, preventDefault, allowInInputs, event, targetEl, targetRef]);\n}\n"],"mappings":";AAAA,SAAS,WAAW,cAAc;AAClC,SAAS,yBAAyB;AAyC3B,SAAS,kBAA2B;AACzC,MAAI,OAAO,cAAc,YAAa,QAAO;AAC7C,QAAM,MAAM;AACZ,SAAO,wBAAwB,KAAK,IAAI,eAAe,YAAY,IAAI,YAAY,IAAI,SAAS;AAClG;AAGO,SAAS,YAAY,OAAe,QAAQ,gBAAgB,GAAiB;AAClF,QAAM,QAAQ,MACX,MAAM,GAAG,EACT,IAAI,CAAC,MAAM,EAAE,KAAK,CAAC,EAEnB,IAAI,CAAC,GAAG,GAAG,QAAS,MAAM,MAAM,MAAM,IAAI,SAAS,IAAI,MAAM,CAAE,EAC/D,OAAO,CAAC,MAAM,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AAQ,IAAI,QAAQ,IAAI;AAC5C,YAAI,kBAAkB,WAAW,CAAC,QAAS;AAAA,MAC7C;AACA,UAAI,eAAgB,GAAE,eAAe;AAKrC,UAAI,EAAE,OAAQ;AACd,iBAAW,QAAQ,CAAC;AAAA,IACtB;AACA,SAAK,iBAAiB,OAAO,QAAQ;AACrC,WAAO,MAAM,KAAK,oBAAoB,OAAO,QAAQ;AAAA,EACvD,GAAG,CAAC,KAAK,SAAS,gBAAgB,eAAe,OAAO,UAAU,SAAS,CAAC;AAC9E;","names":[]}
|
|
@@ -8,7 +8,12 @@
|
|
|
8
8
|
* is in flight, DUP-3): Back does not call `onClose`, and the entry the
|
|
9
9
|
* press took is put back, so the overlay still has one for the next
|
|
10
10
|
* Back. Read when Back is pressed. Default false.
|
|
11
|
+
* @param options.onRefused called once for each Back `held` refused, after its entry is
|
|
12
|
+
* put back — how a held `Modal` hears the press it dropped and passes
|
|
13
|
+
* it on as `onDismissRefused("back")` (0.54 follow-up, keksdose
|
|
14
|
+
* recovery-code-pane).
|
|
11
15
|
*/
|
|
12
|
-
export declare function useOverlayHistory(open: boolean, onClose: () => void, { held }?: {
|
|
16
|
+
export declare function useOverlayHistory(open: boolean, onClose: () => void, { held, onRefused }?: {
|
|
13
17
|
held?: boolean;
|
|
18
|
+
onRefused?: () => void;
|
|
14
19
|
}): void;
|
|
@@ -173,6 +173,7 @@ function closeOnPop() {
|
|
|
173
173
|
if (currentSentinel() === top.id) return;
|
|
174
174
|
if (top.held()) {
|
|
175
175
|
putBack(top.id);
|
|
176
|
+
top.refused();
|
|
176
177
|
return;
|
|
177
178
|
}
|
|
178
179
|
stack.pop();
|
|
@@ -211,18 +212,25 @@ function syncGestureListeners() {
|
|
|
211
212
|
for (const type of SEEN_EVENTS) window.removeEventListener(type, noteSeenNowAndLater);
|
|
212
213
|
}
|
|
213
214
|
}
|
|
214
|
-
function useOverlayHistory(open, onClose, { held = false } = {}) {
|
|
215
|
+
function useOverlayHistory(open, onClose, { held = false, onRefused } = {}) {
|
|
215
216
|
const closeRef = useRef(onClose);
|
|
216
217
|
const heldRef = useRef(held);
|
|
218
|
+
const refusedRef = useRef(onRefused);
|
|
217
219
|
useEffect(() => {
|
|
218
220
|
closeRef.current = onClose;
|
|
219
221
|
heldRef.current = held;
|
|
222
|
+
refusedRef.current = onRefused;
|
|
220
223
|
});
|
|
221
224
|
useEffect(() => {
|
|
222
225
|
if (!open || typeof window === "undefined") return;
|
|
223
226
|
ensureListening();
|
|
224
227
|
const id = `overlay-${nextId += 1}`;
|
|
225
|
-
const entry = {
|
|
228
|
+
const entry = {
|
|
229
|
+
id,
|
|
230
|
+
close: () => closeRef.current(),
|
|
231
|
+
held: () => heldRef.current,
|
|
232
|
+
refused: () => refusedRef.current?.()
|
|
233
|
+
};
|
|
226
234
|
stack.push(entry);
|
|
227
235
|
syncGestureListeners();
|
|
228
236
|
const prev = window.history.state;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/hooks/use-overlay-history.ts"],"sourcesContent":["import { useEffect, useRef } from \"react\";\n\n/**\n * Back closes the overlay, not the page (Keksdose feedback #172).\n *\n * On a phone the Back gesture is the universal \"dismiss this\" — so a dialog or a\n * full-screen search surface that ignores it doesn't merely fail to close: the\n * navigation lands somewhere else entirely, and on a route with nothing beneath it\n * that means leaving the app with the overlay still notionally open.\n *\n * The mechanism is one throwaway, SAME-URL history entry pushed while the overlay is\n * up. Back then pops a same-document entry — no route change, no re-render of the\n * page under it — and this hook turns that pop into `onClose()`. Same trick the\n * transactions page already uses for its unsaved-edit trap\n * (`use-soft-leave-guard.ts`); the two coexist because they use different marker\n * keys AND because `handlePop` only claims a pop that actually consumed OUR entry\n * — a foreign sentinel stacked on top of ours pops back ONTO us, and an overlay\n * that closed on that would vanish mid-edit (feedback #424/#426).\n *\n * Not a URL parameter, deliberately. Encoding \"a dialog is open\" in the address bar\n * makes it shareable and restorable, which is wrong for the overlays this covers —\n * nobody wants to send someone a link that opens a confirm dialog — and it would\n * fight the page-owned `?row=` / `f.*` params that ARE meaningful state.\n *\n * ## Ordering\n *\n * The stack is module-level because correctness here is about order ACROSS\n * instances: every mounted overlay hears the same `popstate`, but only the one whose\n * entry was actually popped may close. Overlays nest and unwind last-in-first-out —\n * a dialog opened from a search surface closes before the surface — so the top of\n * this stack is by construction the entry the browser just popped.\n *\n * ## Not undoing a real navigation\n *\n * The cleanup pops our entry when the overlay closes some other way (a button,\n * Escape, a backdrop click) so history doesn't silently accumulate dead entries. It\n * first checks that our marker is still the CURRENT entry: if the user followed a\n * link while the overlay was open, the router has pushed on top of us, and a blind\n * `history.back()` there would undo their navigation.\n *\n * ## Not undoing the owner's own close\n *\n * Nor when the address under the entry changed in the same breath as the close\n * (keksdose dev #584). A page that opens its editor by PUSHING `?row=x` and closes it\n * by REPLACING the clean URL over the top entry rewrites OUR entry — the overlay sits\n * above `?row=x` — and that rewrite is what unmounts the overlay. Going back from there\n * lands on `?row=x` and the router opens the editor that was just closed. See\n * {@link noteAddress}: an address the overlay LIVED THROUGH (a filter the table wrote\n * while its sheet was up) is still unwound, because the user has acted since.\n *\n * ## Not undoing the owner's replaces either\n *\n * An address the overlay lived through is unwound as an ENTRY, never as an address\n * (keksdose live #412). A report that writes each tick of its payee sheet into the query\n * with `setSearchParams(…, { replace: true })` rewrites the overlay's own entry, and the\n * page entry beneath still carries the address from before the sheet opened — so the\n * traversal that took our entry away also took every tick with it. See {@link carryOnto}:\n * whichever way the entry goes (the unwind after a press, or a Back press), the address it\n * last showed is carried onto the entry it lands on, and the router is told.\n *\n * ## The traversal is deferred\n *\n * And it is *scheduled* rather than issued, because `history.go()` lands a task\n * later while everything this module knows is written synchronously. See\n * {@link Unwind}: an overlay opening inside that window adopts the entry instead\n * of stacking a second one on it, which is what makes the hook survive React\n * StrictMode's mount → clean up → mount (steering-design feedback #49).\n */\nconst SENTINEL_KEY = \"__hbUiOverlayHistory\";\n\ninterface OverlayEntry {\n id: string;\n close: () => void;\n /** The overlay refuses to close right now — see the `held` option. */\n held: () => boolean;\n}\n\nconst stack: OverlayEntry[] = [];\n\n/**\n * The sentinels we have PUSHED and not yet unwound, oldest first.\n *\n * The stack above tracks live overlays; this tracks live history entries, and the\n * two come apart in exactly one case — which is the bug this list exists for.\n * Nested overlays that close in the same commit unwind parent-first, so the dialog's\n * cleanup runs while the sheet's entry is still on top of its own. It cannot call\n * `history.back()` there (that would consume the SHEET's entry, and the sheet is\n * about to consume it itself), so its entry was simply abandoned: a husk with no\n * live owner sitting between the user and the page.\n *\n * The user paid for it on the next Back press. It popped the husk, `handlePop` found\n * an empty stack and returned, and nothing visible happened — Back had to be pressed\n * twice to leave the page.\n *\n * So an abandoned entry is recorded as `dead` instead, and whichever overlay DOES\n * get to unwind pays the debt with a single `history.go(-n)`. `href` is what keeps\n * that safe: only dead entries pushed at the address we are still sitting at are\n * unwound, so a router navigation that landed between two sentinels is never\n * reversed on the user's behalf.\n */\ninterface PushedEntry {\n id: string;\n /** The full address of the entry (query and hash included) as of the last time the\n * user acted while it was current — see {@link noteAddress}. */\n href: string;\n /** Its overlay is gone but the entry is not — someone above owes this pop. */\n dead: boolean;\n /** The router's `idx` on this entry when the marker went on — see {@link locate}. */\n idx: number | undefined;\n /** The router's `key` copied from the page entry beneath ours. */\n key: string | undefined;\n /** {@link routeOf} the address the marker was placed at. */\n route: string;\n /** The entry's address as last OBSERVED, after the user's last gesture had run its\n * handlers — what a Back press must carry down (see {@link carryOnto}). `href` is\n * the snapshot BEFORE the gesture, which the owner's-close check needs instead. */\n seen: string;\n}\nconst pushed: PushedEntry[] = [];\n\n/**\n * Entries of ours that a ROUTER NAVIGATION made from inside the overlay has left\n * behind — ours, still in the history, but no longer on top and no longer anyone's.\n *\n * Nothing can take an entry out from under a newer one, so they cannot be unwound;\n * what can be done is to not let the user land on one. A traversal that comes to\n * rest on a buried entry is carried straight on over the whole run of them, in the\n * direction it was going (see `skipBuried`): Back from the new page lands on the page\n * the overlay was opened from, Forward from there lands on the new page, and no press\n * is spent on an entry with nothing on screen for it.\n *\n * `below` / `above` count the buried entries of the same run on either side. The\n * router's `idx` tells the direction apart — except after a REPLACE navigation, when\n * the page above the run shares the run's `idx`; the two keys decide there.\n */\ninterface BuriedEntry {\n idx: number;\n /** The `idx` of the router entry that buried the run: higher after a push, the\n * same after a replace. */\n aboveIdx: number;\n /** The key of the page entry directly beneath the run. */\n belowKey: string | undefined;\n /** The key of the router entry that buried the run, when it did. */\n aboveKey: string | undefined;\n below: number;\n above: number;\n}\nconst buried = new Map<string, BuriedEntry>();\n\n/** The router `{idx, key}` of the entry the last traversal (or burial) left us on —\n * what `skipBuried` compares against to know which way the user was going. */\nlet lastSeen: { idx: number | undefined; key: string | undefined } | null = null;\n\n/** Entries a real Back press already consumed. Their overlay's cleanup still has to\n * run, and it must not mistake \"my entry is not current\" for \"my entry is buried\"\n * — it has no entry left at all. */\nconst consumed = new Set<string>();\n\n/** Pops WE caused (a cleanup unwinding its own entries) — their `popstate` is\n * bookkeeping, not a user gesture, and must not close a second overlay. A\n * `history.go(-n)` traversal fires exactly ONE popstate however far it travels. */\nlet pendingProgrammatic = 0;\nlet listening = false;\n/** Whether the gesture listeners ({@link noteAddress}, {@link noteSeen}) are on — see\n * {@link syncGestureListeners}. */\nlet noting = false;\nlet nextId = 0;\n\n/**\n * The unwind a cleanup has asked for and not yet issued.\n *\n * **`history.go()` is asynchronous and everything above is written\n * synchronously**, which is the seam the whole of this block exists to close.\n * The traversal lands a task later, so an overlay that opens in the *same* tick\n * as one that closed used to push its sentinel on top of the entry that was\n * about to be popped — and the pop then took the NEW entry. The overlay left on\n * screen had no entry of its own (so Back no longer closed it) and the old one\n * stayed behind as a husk between the user and their page.\n *\n * That is not an exotic race. **React StrictMode remounts every effect** — mount,\n * clean up, mount again, all in one commit — so in development *every* dialog\n * anyone opened left a husk behind, the position drifted one entry further from\n * the page on each open, and the Back press that was meant to leave the page was\n * spent on something invisible instead (steering-design feedback #49).\n *\n * So the traversal is deferred by a task, and an overlay mounting inside that\n * window **adopts** the entry instead of pushing a second one (see the effect).\n * Adoption is `replaceState` on an entry that is already there: no traversal, no\n * window in which the count can be wrong, and the StrictMode remount costs\n * exactly nothing.\n */\ninterface Unwind {\n timer: ReturnType<typeof setTimeout>;\n /** The sentinel on the entry to leave — the top of `entries`. */\n id: string;\n href: string;\n /** That entry plus the abandoned ones directly beneath it, oldest first. */\n entries: PushedEntry[];\n}\nlet unwind: Unwind | null = null;\n\n/** Issue the deferred traversal, if the ground has not moved under it.\n *\n * A real Back press or a router navigation during the deferred task leaves us\n * somewhere that is not the entry we meant to leave, and going back from there\n * would take something that is not ours. The entries are then simply forgotten\n * rather than handed back as `dead`: a forgotten entry costs one dead Back\n * press, while an over-counted one costs the user a navigation they did make. */\nfunction runUnwind(): void {\n const job = unwind;\n unwind = null;\n if (!job) return;\n if (currentSentinel() !== job.id || currentHref() !== job.href) {\n // A router navigation landed between the cleanup and this task: the entries\n // are under it (or were replaced by it) rather than simply forgotten.\n if (taggedSentinel() === null) buryUnder(job.entries);\n return;\n }\n const bottom = job.entries[0];\n carry = { href: job.href, idx: bottom.idx, key: bottom.key };\n pendingProgrammatic += 1;\n window.history.go(-job.entries.length);\n}\n\n/** The address an unwind in flight must carry onto the entry it lands on. */\nlet carry: { href: string; idx: number | undefined; key: string | undefined } | null = null;\n\n/**\n * Put `href` — the address the overlay's entry last showed — onto the entry a traversal\n * has just landed on, and tell the router (keksdose live #412).\n *\n * Only the query and the hash can differ: an address naming another page is a\n * navigation, never carried. And only onto the page entry the overlay was opened over,\n * which our push copied the router's `{idx, key}` from — a traversal that came to rest\n * anywhere else is not ours to rewrite.\n *\n * The router heard the traversal land on the OLD address in this same event, so a\n * `replaceState` alone would leave it showing the old query under the new one. A\n * synthetic `popstate` makes it read the address again; both reads happen in one event\n * dispatch, so React commits only the second. Ours absorbs it as programmatic.\n */\nfunction carryOnto(href: string, mark: { idx: number | undefined; key: string | undefined }): void {\n const here = currentHref();\n if (here === href || routeOf(here) !== routeOf(href)) return;\n const now = routerMark();\n if (mark.idx !== undefined && now.idx !== undefined && mark.idx !== now.idx) return;\n if (mark.key !== undefined && now.key !== undefined && mark.key !== now.key) return;\n const state: unknown = window.history.state;\n window.history.replaceState(state, \"\", href);\n pendingProgrammatic += 1;\n window.dispatchEvent(new PopStateEvent(\"popstate\", { state }));\n}\n\nfunction currentHref(): string {\n return typeof window === \"undefined\" ? \"\" : window.location.href;\n}\n\n/** The router's own `{idx, key}` on the current entry, where a router has put them. */\nfunction routerMark(): { idx: number | undefined; key: string | undefined } {\n const state = typeof window !== \"undefined\" ? (window.history.state as unknown) : null;\n if (!state || typeof state !== \"object\") return { idx: undefined, key: undefined };\n const { idx, key } = state as Record<string, unknown>;\n return { idx: typeof idx === \"number\" ? idx : undefined, key: typeof key === \"string\" ? key : undefined };\n}\n\n/**\n * The part of an address that names the PAGE — the query string left out.\n *\n * A `setSearchParams(…, { replace: true })` rewrites the query on the entry the\n * overlay is standing on; that is a wipe to repair, not a move. Anything else changing\n * is a navigation. Under a hash router the page lives in the hash (`#/table?f.q=x`), so\n * a hash that starts with `#/` counts up to its own `?`; an ordinary `#fragment` does\n * not name a page and is left out.\n */\nfunction routeOf(href: string): string {\n try {\n const url = new URL(href);\n const hashRoute = url.hash.startsWith(\"#/\") ? url.hash.split(\"?\")[0] : \"\";\n return url.origin + url.pathname + hashRoute;\n } catch {\n return href;\n }\n}\n\n/**\n * Is the untagged entry we are standing on still `p`'s — merely wiped by the router —\n * or an entry the router NAVIGATED to from inside the overlay?\n *\n * The router's `idx` is the one per-entry fact that separates the two, because it is\n * the one the router itself keeps straight: a replace leaves it as it was, a push adds\n * one. Our own push copies the page's state, so our entry carries the page's `idx` and\n * a router push on top of it carries one more. The key would not do — every replace\n * mints a new one, so the wipe this repair exists for would already fail it. Neither\n * would the address alone: a push to the address we are already at is still a push.\n *\n * `idx` does not see one move, the router REPLACING our entry with a different page\n * (same `idx`), so the page named by the address must also be unchanged. Where there is\n * no `idx` to compare (no router, or one that keeps none) the address is all there is.\n */\nfunction isStillOn(p: PushedEntry): boolean {\n if (routeOf(currentHref()) !== p.route) return false;\n const { idx } = routerMark();\n return idx === undefined || p.idx === undefined || idx === p.idx;\n}\n\n/**\n * The router has navigated while our entries were on top: record which of `records`\n * (ours, oldest first, ending with the top one) it buried and which it replaced, and\n * drop them from `pushed` — none of them can be unwound any more. Returns whether it\n * recognised a navigation at all; when it cannot tell (no router `idx` to go by), it\n * leaves everything as it was and the caller falls back to marking the entry dead.\n */\nfunction buryUnder(records: PushedEntry[]): boolean {\n const top = records[records.length - 1];\n const here = routerMark();\n if (!top || top.idx === undefined || here.idx === undefined) return false;\n let run: PushedEntry[];\n if (here.idx > top.idx) {\n run = [];\n for (let i = records.length - 1; i >= 0 && records[i].idx === top.idx; i -= 1) run.unshift(records[i]);\n } else if (here.idx === top.idx && !isStillOn(top)) {\n // Replaced: the top entry IS the new page now, and gone as ours. Those beneath it\n // are buried under it.\n run = [];\n for (let i = records.length - 2; i >= 0 && records[i].idx === top.idx; i -= 1) run.unshift(records[i]);\n } else {\n return false;\n }\n run.forEach((r, i) => {\n buried.set(r.id, {\n idx: top.idx as number,\n aboveIdx: here.idx as number,\n belowKey: run[0].key,\n aboveKey: here.key,\n below: i,\n above: run.length - 1 - i,\n });\n });\n for (const r of records) forgetPushed(r.id);\n lastSeen = here;\n return true;\n}\n\n/**\n * A traversal came to rest on one of our buried entries: carry it on over the run, the\n * way it was going. Back from above (a higher `idx`, or the very entry that buried us)\n * continues down to the page beneath; Forward from that page continues up. A landing\n * from anywhere this cannot place is left alone — one idle press is the price of not\n * guessing, and a wrong guess would move the user somewhere they did not ask to go.\n */\nfunction skipBuried(from: typeof lastSeen): void {\n const tag = taggedSentinel();\n const rec = tag !== null ? buried.get(tag) : undefined;\n if (!rec || !from || stack.some((e) => e.id === tag)) return;\n let steps = 0;\n if ((from.idx !== undefined && from.idx > rec.idx) || (from.key !== undefined && from.key === rec.aboveKey)) {\n steps = -(rec.below + 1);\n } else if (\n from.idx !== undefined &&\n // Below the run, or level with it when nothing above it is (a push buried it),\n // or level with it and provably the page beneath (a replace buried it). The\n // router's first entry has no key at all, so an absent key is a key here.\n (from.idx < rec.idx || (from.idx === rec.idx && (rec.aboveIdx > rec.idx || from.key === rec.belowKey)))\n ) {\n steps = rec.above + 1;\n }\n if (steps === 0) return;\n pendingProgrammatic += 1;\n window.history.go(steps);\n}\n\nfunction forgetPushed(id: string): void {\n const at = pushed.findIndex((p) => p.id === id);\n if (at >= 0) pushed.splice(at, 1);\n}\n\n/**\n * The sentinel this module believes is on the entry we are standing on.\n *\n * `history.state` is where the tag physically sits, because it is the only\n * per-entry storage a browser has — but it is not this module's storage, so\n * since the 2026-09-22 audit it is no longer read as the last word.\n * The ROUTER owns that object and writes it WHOLE: every\n * `setSearchParams(…, { replace: true })` stamps `{usr, key, idx}` over\n * whatever was there. A `DataTable` with `urlSync` does exactly that, on mount\n * and on every filter change — so an overlay opened from such a table had its\n * tag wiped off the entry it was standing on, and then:\n *\n * * its cleanup read \"not my entry\" and abandoned a live entry as a husk;\n * * the push path below could not find itself in `pushed`, so it discarded\n * every record it had (`splice(0)`) and nothing was ever unwound again;\n * * the StrictMode adoption never matched, so in development every dialog\n * pushed a second entry and the deferred `go(-1)` ate the live one — which\n * is Back no longer closing the overlay at all.\n *\n * So `standing` answers when the tag is gone: a MISSING tag on an entry we have\n * not left is a wipe to repair rather than a verdict. The tag is still read\n * FIRST wherever it is there, because it is the one thing that can see a FOREIGN\n * same-URL entry stacked above ours (feedback #424/#426, below) — module-level\n * bookkeeping cannot, since nobody tells us about someone else's `pushState`.\n */\nlet standing: string | null = null;\n\n/** The tag actually on the current entry, with no repair and no belief. */\nfunction taggedSentinel(): string | null {\n const state = typeof window !== \"undefined\" ? window.history.state : null;\n if (!state || typeof state !== \"object\") return null;\n const id = (state as Record<string, unknown>)[SENTINEL_KEY];\n return typeof id === \"string\" ? id : null;\n}\n\n/** Put our tag back on the current entry, keeping whatever the router has since\n * written there — we are a passenger in that object, not its owner. */\nfunction retag(id: string): void {\n const prev = window.history.state;\n window.history.replaceState({ ...(prev && typeof prev === \"object\" ? prev : {}), [SENTINEL_KEY]: id }, \"\");\n}\n\nfunction currentSentinel(): string | null {\n const tag = taggedSentinel();\n if (tag !== null) {\n standing = tag;\n return tag;\n }\n if (standing === null || typeof window === \"undefined\") return null;\n // Only ever re-stamp an entry we still hold a record for. Without that guard a\n // belief left over from an overlay that is long gone — a tab that has since\n // navigated, a test file that ran another case — would be stamped onto a\n // stranger's entry, and the next cleanup would traverse off it.\n //\n // And only an entry that is still the one the marker was placed on. A row that\n // NAVIGATES (a palette result, a dialog's link) has the router push the new page\n // before the overlay's cleanup runs; that entry carries no tag either, and\n // re-stamping it made the cleanup \"unwind\" the navigation itself — the page\n // changed and changed straight back. See `isStillOn` for how the two are told apart.\n const record = pushed.find((p) => p.id === standing);\n if (!record || !isStillOn(record)) {\n standing = null;\n return null;\n }\n retag(standing);\n return standing;\n}\n\n/**\n * The user is about to act: what the current entry's address is NOW is what the\n * overlay standing on it has lived through.\n *\n * The cleanup needs to tell two same-page query rewrites apart, and the address alone\n * cannot. A `DataTable` with `urlSync` replaces `f.*` over the entry while its filter\n * sheet is up, and the sheet is closed LATER, by a press of its own — that entry is\n * still the sheet's and must be unwound (the audit's drift fix, below). A page whose\n * `?row=` drives the overlay replaces the clean URL over the entry and the overlay\n * unmounts BECAUSE of it (keksdose dev #584) — that entry is the owner's now, and\n * unwinding lands on `?row=` beneath and reopens what was just closed. What separates\n * them is whether the user acted in between: the rewrite that closes an overlay is\n * made by the very press that closes it, so it postdates this snapshot.\n *\n * Capture phase, so the snapshot is taken before any handler of the press runs.\n */\nfunction noteAddress(): void {\n const top = pushed[pushed.length - 1];\n if (!top || top.dead || !stack.some((e) => e.id === top.id)) return;\n const tag = taggedSentinel();\n // Read without `currentSentinel`'s repair: an observation must not write history.\n if (tag === top.id || (tag === null && standing === top.id && isStillOn(top))) {\n top.href = currentHref();\n top.seen = top.href;\n }\n}\n\n/** After the user's gesture has run its handlers: the address its entry now shows —\n * what a Back press must carry down (keksdose live #412). Again a little later, for a\n * handler that writes the address a task after the event. */\nfunction noteSeen(): void {\n const top = pushed[pushed.length - 1];\n if (!top || top.dead || !stack.some((e) => e.id === top.id)) return;\n const tag = taggedSentinel();\n if (tag === top.id || (tag === null && standing === top.id && isStillOn(top))) top.seen = currentHref();\n}\n\nfunction noteSeenNowAndLater(): void {\n noteSeen();\n setTimeout(noteSeen, 0);\n}\n\nfunction handlePop() {\n // A pop MOVES us, so the belief is stale by definition: re-read it from the\n // entry we have landed on before anything below consults it, or the repair in\n // `currentSentinel` would stamp the entry we just left onto the one we are on.\n standing = taggedSentinel();\n const from = lastSeen;\n lastSeen = routerMark();\n if (pendingProgrammatic > 0) {\n pendingProgrammatic -= 1;\n const job = carry;\n carry = null;\n if (job) carryOnto(job.href, job);\n return;\n }\n closeOnPop();\n skipBuried(from);\n}\n\nfunction closeOnPop() {\n // Nothing open → an ordinary navigation, which is none of our business.\n const top = stack[stack.length - 1];\n if (!top) return;\n // We landed back ON the top overlay's own entry, so that entry was NOT what the\n // pop consumed — something stacked ABOVE it was (Keksdose feedback #424/#426).\n // The app layers a second same-URL sentinel of its own on top of ours for the\n // unsaved-edit trap (`use-soft-leave-guard.ts`), and it pops that sentinel every\n // time the form goes back to clean — twice-toggling one field was enough to\n // close the whole dialog. A pop is only ours when the entry we came to rest on\n // is no longer ours: either the layer below (a different overlay's marker) or\n // the plain page entry (none at all).\n if (currentSentinel() === top.id) return;\n // Checked before anything below moves: a held overlay keeps its place and its record.\n if (top.held()) {\n putBack(top.id);\n return;\n }\n stack.pop();\n syncGestureListeners();\n // The browser consumed this entry, so the overlay's own cleanup has nothing left\n // to unwind and nothing to record as owed.\n consumed.add(top.id);\n const record = pushed.find((p) => p.id === top.id);\n forgetPushed(top.id);\n // What the page wrote into the address while we were up stays (#412).\n if (record && !record.dead) carryOnto(record.seen, record);\n top.close();\n}\n\n/**\n * A Back press the top overlay refuses (a busy `Modal`, DUP-3). A popstate cannot be\n * refused — the browser has already left our entry — so the entry is put back: what the\n * page wrote into the address while the overlay was up is carried down first (#412), as\n * for a close, and the same marker is pushed again over it, as the mount pushed it. Left\n * on the page entry, the overlay would stay up with no entry of its own, and the Back\n * after its request would leave the page under it.\n *\n * A push and not `history.go(1)` back onto the old entry: a traversal lands a task later\n * and fires nothing at all if a listener has pushed meanwhile, and a programmatic pop\n * counted for it would then swallow the user's next real Back.\n */\nfunction putBack(id: string): void {\n const record = pushed.find((p) => p.id === id);\n if (record && !record.dead) carryOnto(record.seen, record);\n const prev: unknown = window.history.state;\n window.history.pushState({ ...(prev && typeof prev === \"object\" ? prev : {}), [SENTINEL_KEY]: id }, \"\");\n standing = id;\n // The address the entry shows now is the one the user last acted on: the cleanup's\n // owner's-close check (#584) must not read the carried address as a rewrite.\n if (record) record.href = record.seen = currentHref();\n}\n\n/** `popstate` stays from the first overlay on: a traversal of ours (an unwind, a buried\n * run to skip) lands after the overlay that caused it has gone. */\nfunction ensureListening() {\n if (listening || typeof window === \"undefined\") return;\n window.addEventListener(\"popstate\", handlePop);\n listening = true;\n}\n\nconst SEEN_EVENTS = [\"click\", \"keyup\", \"change\", \"input\"] as const;\n\n/**\n * The gesture listeners, on while an overlay is open and off when the last one closes.\n * Both notes return at once with no overlay up, but the four bubbling ones scheduled a\n * timer for their second look even then — for every click and every keystroke in every\n * field, for the life of the page after its first dialog (refactor audit 2026-10-30,\n * INP-14). Called after each change to `stack`.\n */\nfunction syncGestureListeners(): void {\n const want = stack.length > 0;\n if (want === noting || typeof window === \"undefined\") return;\n noting = want;\n if (want) {\n window.addEventListener(\"pointerdown\", noteAddress, true);\n window.addEventListener(\"keydown\", noteAddress, true);\n for (const type of SEEN_EVENTS) window.addEventListener(type, noteSeenNowAndLater);\n } else {\n window.removeEventListener(\"pointerdown\", noteAddress, true);\n window.removeEventListener(\"keydown\", noteAddress, true);\n for (const type of SEEN_EVENTS) window.removeEventListener(type, noteSeenNowAndLater);\n }\n}\n\n/**\n * Make the platform Back gesture dismiss an overlay.\n *\n * @param open whether the overlay is currently showing. Components that mount\n * only while open (the common case) pass `true`.\n * @param onClose the overlay's own close handler — the same one Escape calls.\n * @param options.held the overlay refuses to close right now (a `Modal` whose request\n * is in flight, DUP-3): Back does not call `onClose`, and the entry the\n * press took is put back, so the overlay still has one for the next\n * Back. Read when Back is pressed. Default false.\n */\nexport function useOverlayHistory(open: boolean, onClose: () => void, { held = false }: { held?: boolean } = {}): void {\n // The listener fires outside React's render, so it reads the latest handler\n // through a ref rather than through the closure the effect captured.\n const closeRef = useRef(onClose);\n const heldRef = useRef(held);\n useEffect(() => {\n closeRef.current = onClose;\n heldRef.current = held;\n });\n\n useEffect(() => {\n if (!open || typeof window === \"undefined\") return;\n ensureListening();\n const id = `overlay-${(nextId += 1)}`;\n const entry: OverlayEntry = { id, close: () => closeRef.current(), held: () => heldRef.current };\n stack.push(entry);\n syncGestureListeners();\n const prev = window.history.state;\n const marked = { ...(prev && typeof prev === \"object\" ? prev : {}), [SENTINEL_KEY]: id };\n // An entry that is on its way out and that we are still standing on is ours\n // to take over: same URL, same slot, only the marker changes. Pushing a\n // second one on top of it is what used to leave a husk on every StrictMode\n // remount — see {@link Unwind}.\n const adopting = unwind && unwind.id === currentSentinel() && unwind.href === currentHref();\n if (adopting && unwind) {\n clearTimeout(unwind.timer);\n const inherited = unwind.entries;\n unwind = null;\n // Preserve react-router's own `{usr,key,idx}` — we only swap the marker,\n // and the entry we are swapping it on is the one the router is already on.\n window.history.replaceState(marked, \"\");\n // The abandoned ones beneath come back owed; ours takes the top slot.\n for (const owed of inherited.slice(0, -1)) pushed.push({ ...owed, dead: true });\n const was = inherited[inherited.length - 1];\n pushed.push({\n id,\n href: currentHref(),\n seen: currentHref(),\n dead: false,\n idx: was.idx,\n key: was.key,\n route: was.route,\n });\n standing = id;\n } else {\n // A push DESTROYS every entry ahead of the one we are on, so anything we\n // still had recorded above our own position is gone. Kept, those would be\n // counted into a later `history.go(-n)` and the overshoot would come out\n // of a navigation the user actually made. Where we cannot tell which of\n // ours are beneath us — we are standing on a plain page entry, or on a\n // husk nobody tracks — none of them can be proven to be, so none survive.\n const under = pushed.findIndex((p) => p.id === currentSentinel());\n pushed.splice(under + 1);\n // Preserve react-router's own `{usr,key,idx}` — we only tack a marker on, and\n // the URL is unchanged, so the router treats popping this as a no-op re-render.\n window.history.pushState(marked, \"\");\n const page = routerMark();\n const at = currentHref();\n pushed.push({ id, href: at, seen: at, dead: false, idx: page.idx, key: page.key, route: routeOf(at) });\n standing = id;\n }\n return () => {\n const at = stack.indexOf(entry);\n if (at >= 0) stack.splice(at, 1);\n syncGestureListeners();\n\n // A Back press already took this entry; there is nothing to unwind or to owe.\n if (consumed.delete(id)) return;\n\n const mine = pushed.findIndex((p) => p.id === id);\n // Still our entry — same page, same router `idx` — but its address is not the one\n // the user last acted on: the owner rewrote it as part of closing us (see\n // {@link noteAddress}). The entry is the owner's page now, and the one beneath is\n // the address it replaced — going back would restore exactly what was closed.\n // Nothing to unwind; forget the record rather than re-stamp a page we left.\n if (mine >= 0 && currentHref() !== pushed[mine].href) {\n const tag = taggedSentinel();\n if (tag === id || (tag === null && standing === id && isStillOn(pushed[mine]))) {\n pushed.splice(mine, 1);\n if (standing === id) standing = null;\n return;\n }\n }\n // Only unwind an entry that is still THE current one. If a router push landed\n // on top of it, going back would undo the user's navigation instead — and if\n // a SIBLING overlay's sentinel landed on top, that overlay is about to unwind\n // and is the one that can take ours with it.\n if (currentSentinel() !== id) {\n // A router navigation from inside the overlay: nothing to unwind — the\n // entries it left beneath the new page are skipped over instead.\n if (mine >= 0 && taggedSentinel() === null && buryUnder(pushed.slice(0, pushed.length))) return;\n if (mine >= 0) pushed[mine].dead = true;\n return;\n }\n\n // Ours plus every abandoned entry lying directly beneath it at this address.\n // One traversal, so one popstate, so one programmatic pop to absorb.\n const here = currentHref();\n let steps = 1;\n while (steps <= mine && pushed[mine - steps].dead && pushed[mine - steps].href === here) {\n steps += 1;\n }\n const leaving = pushed.splice(mine - (steps - 1), steps);\n // Scheduled, not issued: an overlay opening in this same tick takes the\n // entry over instead, which is what makes the hook survive a StrictMode\n // remount. An unwind already waiting is dropped rather than merged — it\n // was the entry ABOVE ours and something has since moved off it, so its\n // count can no longer be proven, and an over-counted traversal costs a\n // navigation the user made while an under-counted one costs one dead Back.\n if (unwind) clearTimeout(unwind.timer);\n unwind = { timer: setTimeout(runUnwind, 0), id, href: here, entries: leaving };\n };\n }, [open]);\n}\n"],"mappings":";AAAA,SAAS,WAAW,cAAc;AAoElC,MAAM,eAAe;AASrB,MAAM,QAAwB,CAAC;AAyC/B,MAAM,SAAwB,CAAC;AA6B/B,MAAM,SAAS,oBAAI,IAAyB;AAI5C,IAAI,WAAwE;AAK5E,MAAM,WAAW,oBAAI,IAAY;AAKjC,IAAI,sBAAsB;AAC1B,IAAI,YAAY;AAGhB,IAAI,SAAS;AACb,IAAI,SAAS;AAiCb,IAAI,SAAwB;AAS5B,SAAS,YAAkB;AACzB,QAAM,MAAM;AACZ,WAAS;AACT,MAAI,CAAC,IAAK;AACV,MAAI,gBAAgB,MAAM,IAAI,MAAM,YAAY,MAAM,IAAI,MAAM;AAG9D,QAAI,eAAe,MAAM,KAAM,WAAU,IAAI,OAAO;AACpD;AAAA,EACF;AACA,QAAM,SAAS,IAAI,QAAQ,CAAC;AAC5B,UAAQ,EAAE,MAAM,IAAI,MAAM,KAAK,OAAO,KAAK,KAAK,OAAO,IAAI;AAC3D,yBAAuB;AACvB,SAAO,QAAQ,GAAG,CAAC,IAAI,QAAQ,MAAM;AACvC;AAGA,IAAI,QAAmF;AAgBvF,SAAS,UAAU,MAAc,MAAkE;AACjG,QAAM,OAAO,YAAY;AACzB,MAAI,SAAS,QAAQ,QAAQ,IAAI,MAAM,QAAQ,IAAI,EAAG;AACtD,QAAM,MAAM,WAAW;AACvB,MAAI,KAAK,QAAQ,UAAa,IAAI,QAAQ,UAAa,KAAK,Q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,OAAO,EAAE,EAAG;AAEzB,YAAM,OAAO,OAAO,UAAU,CAAC,MAAM,EAAE,OAAO,EAAE;AAMhD,UAAI,QAAQ,KAAK,YAAY,MAAM,OAAO,IAAI,EAAE,MAAM;AACpD,cAAM,MAAM,eAAe;AAC3B,YAAI,QAAQ,MAAO,QAAQ,QAAQ,aAAa,MAAM,UAAU,OAAO,IAAI,CAAC,GAAI;AAC9E,iBAAO,OAAO,MAAM,CAAC;AACrB,cAAI,aAAa,GAAI,YAAW;AAChC;AAAA,QACF;AAAA,MACF;AAKA,UAAI,gBAAgB,MAAM,IAAI;AAG5B,YAAI,QAAQ,KAAK,eAAe,MAAM,QAAQ,UAAU,OAAO,MAAM,GAAG,OAAO,MAAM,CAAC,EAAG;AACzF,YAAI,QAAQ,EAAG,QAAO,IAAI,EAAE,OAAO;AACnC;AAAA,MACF;AAIA,YAAM,OAAO,YAAY;AACzB,UAAI,QAAQ;AACZ,aAAO,SAAS,QAAQ,OAAO,OAAO,KAAK,EAAE,QAAQ,OAAO,OAAO,KAAK,EAAE,SAAS,MAAM;AACvF,iBAAS;AAAA,MACX;AACA,YAAM,UAAU,OAAO,OAAO,QAAQ,QAAQ,IAAI,KAAK;AAOvD,UAAI,OAAQ,cAAa,OAAO,KAAK;AACrC,eAAS,EAAE,OAAO,WAAW,WAAW,CAAC,GAAG,IAAI,MAAM,MAAM,SAAS,QAAQ;AAAA,IAC/E;AAAA,EACF,GAAG,CAAC,IAAI,CAAC;AACX;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../src/hooks/use-overlay-history.ts"],"sourcesContent":["import { useEffect, useRef } from \"react\";\n\n/**\n * Back closes the overlay, not the page (Keksdose feedback #172).\n *\n * On a phone the Back gesture is the universal \"dismiss this\" — so a dialog or a\n * full-screen search surface that ignores it doesn't merely fail to close: the\n * navigation lands somewhere else entirely, and on a route with nothing beneath it\n * that means leaving the app with the overlay still notionally open.\n *\n * The mechanism is one throwaway, SAME-URL history entry pushed while the overlay is\n * up. Back then pops a same-document entry — no route change, no re-render of the\n * page under it — and this hook turns that pop into `onClose()`. Same trick the\n * transactions page already uses for its unsaved-edit trap\n * (`use-soft-leave-guard.ts`); the two coexist because they use different marker\n * keys AND because `handlePop` only claims a pop that actually consumed OUR entry\n * — a foreign sentinel stacked on top of ours pops back ONTO us, and an overlay\n * that closed on that would vanish mid-edit (feedback #424/#426).\n *\n * Not a URL parameter, deliberately. Encoding \"a dialog is open\" in the address bar\n * makes it shareable and restorable, which is wrong for the overlays this covers —\n * nobody wants to send someone a link that opens a confirm dialog — and it would\n * fight the page-owned `?row=` / `f.*` params that ARE meaningful state.\n *\n * ## Ordering\n *\n * The stack is module-level because correctness here is about order ACROSS\n * instances: every mounted overlay hears the same `popstate`, but only the one whose\n * entry was actually popped may close. Overlays nest and unwind last-in-first-out —\n * a dialog opened from a search surface closes before the surface — so the top of\n * this stack is by construction the entry the browser just popped.\n *\n * ## Not undoing a real navigation\n *\n * The cleanup pops our entry when the overlay closes some other way (a button,\n * Escape, a backdrop click) so history doesn't silently accumulate dead entries. It\n * first checks that our marker is still the CURRENT entry: if the user followed a\n * link while the overlay was open, the router has pushed on top of us, and a blind\n * `history.back()` there would undo their navigation.\n *\n * ## Not undoing the owner's own close\n *\n * Nor when the address under the entry changed in the same breath as the close\n * (keksdose dev #584). A page that opens its editor by PUSHING `?row=x` and closes it\n * by REPLACING the clean URL over the top entry rewrites OUR entry — the overlay sits\n * above `?row=x` — and that rewrite is what unmounts the overlay. Going back from there\n * lands on `?row=x` and the router opens the editor that was just closed. See\n * {@link noteAddress}: an address the overlay LIVED THROUGH (a filter the table wrote\n * while its sheet was up) is still unwound, because the user has acted since.\n *\n * ## Not undoing the owner's replaces either\n *\n * An address the overlay lived through is unwound as an ENTRY, never as an address\n * (keksdose live #412). A report that writes each tick of its payee sheet into the query\n * with `setSearchParams(…, { replace: true })` rewrites the overlay's own entry, and the\n * page entry beneath still carries the address from before the sheet opened — so the\n * traversal that took our entry away also took every tick with it. See {@link carryOnto}:\n * whichever way the entry goes (the unwind after a press, or a Back press), the address it\n * last showed is carried onto the entry it lands on, and the router is told.\n *\n * ## The traversal is deferred\n *\n * And it is *scheduled* rather than issued, because `history.go()` lands a task\n * later while everything this module knows is written synchronously. See\n * {@link Unwind}: an overlay opening inside that window adopts the entry instead\n * of stacking a second one on it, which is what makes the hook survive React\n * StrictMode's mount → clean up → mount (steering-design feedback #49).\n */\nconst SENTINEL_KEY = \"__hbUiOverlayHistory\";\n\ninterface OverlayEntry {\n id: string;\n close: () => void;\n /** The overlay refuses to close right now — see the `held` option. */\n held: () => boolean;\n /** A Back press `held` refused — see the `onRefused` option. */\n refused: () => void;\n}\n\nconst stack: OverlayEntry[] = [];\n\n/**\n * The sentinels we have PUSHED and not yet unwound, oldest first.\n *\n * The stack above tracks live overlays; this tracks live history entries, and the\n * two come apart in exactly one case — which is the bug this list exists for.\n * Nested overlays that close in the same commit unwind parent-first, so the dialog's\n * cleanup runs while the sheet's entry is still on top of its own. It cannot call\n * `history.back()` there (that would consume the SHEET's entry, and the sheet is\n * about to consume it itself), so its entry was simply abandoned: a husk with no\n * live owner sitting between the user and the page.\n *\n * The user paid for it on the next Back press. It popped the husk, `handlePop` found\n * an empty stack and returned, and nothing visible happened — Back had to be pressed\n * twice to leave the page.\n *\n * So an abandoned entry is recorded as `dead` instead, and whichever overlay DOES\n * get to unwind pays the debt with a single `history.go(-n)`. `href` is what keeps\n * that safe: only dead entries pushed at the address we are still sitting at are\n * unwound, so a router navigation that landed between two sentinels is never\n * reversed on the user's behalf.\n */\ninterface PushedEntry {\n id: string;\n /** The full address of the entry (query and hash included) as of the last time the\n * user acted while it was current — see {@link noteAddress}. */\n href: string;\n /** Its overlay is gone but the entry is not — someone above owes this pop. */\n dead: boolean;\n /** The router's `idx` on this entry when the marker went on — see {@link locate}. */\n idx: number | undefined;\n /** The router's `key` copied from the page entry beneath ours. */\n key: string | undefined;\n /** {@link routeOf} the address the marker was placed at. */\n route: string;\n /** The entry's address as last OBSERVED, after the user's last gesture had run its\n * handlers — what a Back press must carry down (see {@link carryOnto}). `href` is\n * the snapshot BEFORE the gesture, which the owner's-close check needs instead. */\n seen: string;\n}\nconst pushed: PushedEntry[] = [];\n\n/**\n * Entries of ours that a ROUTER NAVIGATION made from inside the overlay has left\n * behind — ours, still in the history, but no longer on top and no longer anyone's.\n *\n * Nothing can take an entry out from under a newer one, so they cannot be unwound;\n * what can be done is to not let the user land on one. A traversal that comes to\n * rest on a buried entry is carried straight on over the whole run of them, in the\n * direction it was going (see `skipBuried`): Back from the new page lands on the page\n * the overlay was opened from, Forward from there lands on the new page, and no press\n * is spent on an entry with nothing on screen for it.\n *\n * `below` / `above` count the buried entries of the same run on either side. The\n * router's `idx` tells the direction apart — except after a REPLACE navigation, when\n * the page above the run shares the run's `idx`; the two keys decide there.\n */\ninterface BuriedEntry {\n idx: number;\n /** The `idx` of the router entry that buried the run: higher after a push, the\n * same after a replace. */\n aboveIdx: number;\n /** The key of the page entry directly beneath the run. */\n belowKey: string | undefined;\n /** The key of the router entry that buried the run, when it did. */\n aboveKey: string | undefined;\n below: number;\n above: number;\n}\nconst buried = new Map<string, BuriedEntry>();\n\n/** The router `{idx, key}` of the entry the last traversal (or burial) left us on —\n * what `skipBuried` compares against to know which way the user was going. */\nlet lastSeen: { idx: number | undefined; key: string | undefined } | null = null;\n\n/** Entries a real Back press already consumed. Their overlay's cleanup still has to\n * run, and it must not mistake \"my entry is not current\" for \"my entry is buried\"\n * — it has no entry left at all. */\nconst consumed = new Set<string>();\n\n/** Pops WE caused (a cleanup unwinding its own entries) — their `popstate` is\n * bookkeeping, not a user gesture, and must not close a second overlay. A\n * `history.go(-n)` traversal fires exactly ONE popstate however far it travels. */\nlet pendingProgrammatic = 0;\nlet listening = false;\n/** Whether the gesture listeners ({@link noteAddress}, {@link noteSeen}) are on — see\n * {@link syncGestureListeners}. */\nlet noting = false;\nlet nextId = 0;\n\n/**\n * The unwind a cleanup has asked for and not yet issued.\n *\n * **`history.go()` is asynchronous and everything above is written\n * synchronously**, which is the seam the whole of this block exists to close.\n * The traversal lands a task later, so an overlay that opens in the *same* tick\n * as one that closed used to push its sentinel on top of the entry that was\n * about to be popped — and the pop then took the NEW entry. The overlay left on\n * screen had no entry of its own (so Back no longer closed it) and the old one\n * stayed behind as a husk between the user and their page.\n *\n * That is not an exotic race. **React StrictMode remounts every effect** — mount,\n * clean up, mount again, all in one commit — so in development *every* dialog\n * anyone opened left a husk behind, the position drifted one entry further from\n * the page on each open, and the Back press that was meant to leave the page was\n * spent on something invisible instead (steering-design feedback #49).\n *\n * So the traversal is deferred by a task, and an overlay mounting inside that\n * window **adopts** the entry instead of pushing a second one (see the effect).\n * Adoption is `replaceState` on an entry that is already there: no traversal, no\n * window in which the count can be wrong, and the StrictMode remount costs\n * exactly nothing.\n */\ninterface Unwind {\n timer: ReturnType<typeof setTimeout>;\n /** The sentinel on the entry to leave — the top of `entries`. */\n id: string;\n href: string;\n /** That entry plus the abandoned ones directly beneath it, oldest first. */\n entries: PushedEntry[];\n}\nlet unwind: Unwind | null = null;\n\n/** Issue the deferred traversal, if the ground has not moved under it.\n *\n * A real Back press or a router navigation during the deferred task leaves us\n * somewhere that is not the entry we meant to leave, and going back from there\n * would take something that is not ours. The entries are then simply forgotten\n * rather than handed back as `dead`: a forgotten entry costs one dead Back\n * press, while an over-counted one costs the user a navigation they did make. */\nfunction runUnwind(): void {\n const job = unwind;\n unwind = null;\n if (!job) return;\n if (currentSentinel() !== job.id || currentHref() !== job.href) {\n // A router navigation landed between the cleanup and this task: the entries\n // are under it (or were replaced by it) rather than simply forgotten.\n if (taggedSentinel() === null) buryUnder(job.entries);\n return;\n }\n const bottom = job.entries[0];\n carry = { href: job.href, idx: bottom.idx, key: bottom.key };\n pendingProgrammatic += 1;\n window.history.go(-job.entries.length);\n}\n\n/** The address an unwind in flight must carry onto the entry it lands on. */\nlet carry: { href: string; idx: number | undefined; key: string | undefined } | null = null;\n\n/**\n * Put `href` — the address the overlay's entry last showed — onto the entry a traversal\n * has just landed on, and tell the router (keksdose live #412).\n *\n * Only the query and the hash can differ: an address naming another page is a\n * navigation, never carried. And only onto the page entry the overlay was opened over,\n * which our push copied the router's `{idx, key}` from — a traversal that came to rest\n * anywhere else is not ours to rewrite.\n *\n * The router heard the traversal land on the OLD address in this same event, so a\n * `replaceState` alone would leave it showing the old query under the new one. A\n * synthetic `popstate` makes it read the address again; both reads happen in one event\n * dispatch, so React commits only the second. Ours absorbs it as programmatic.\n */\nfunction carryOnto(href: string, mark: { idx: number | undefined; key: string | undefined }): void {\n const here = currentHref();\n if (here === href || routeOf(here) !== routeOf(href)) return;\n const now = routerMark();\n if (mark.idx !== undefined && now.idx !== undefined && mark.idx !== now.idx) return;\n if (mark.key !== undefined && now.key !== undefined && mark.key !== now.key) return;\n const state: unknown = window.history.state;\n window.history.replaceState(state, \"\", href);\n pendingProgrammatic += 1;\n window.dispatchEvent(new PopStateEvent(\"popstate\", { state }));\n}\n\nfunction currentHref(): string {\n return typeof window === \"undefined\" ? \"\" : window.location.href;\n}\n\n/** The router's own `{idx, key}` on the current entry, where a router has put them. */\nfunction routerMark(): { idx: number | undefined; key: string | undefined } {\n const state = typeof window !== \"undefined\" ? (window.history.state as unknown) : null;\n if (!state || typeof state !== \"object\") return { idx: undefined, key: undefined };\n const { idx, key } = state as Record<string, unknown>;\n return { idx: typeof idx === \"number\" ? idx : undefined, key: typeof key === \"string\" ? key : undefined };\n}\n\n/**\n * The part of an address that names the PAGE — the query string left out.\n *\n * A `setSearchParams(…, { replace: true })` rewrites the query on the entry the\n * overlay is standing on; that is a wipe to repair, not a move. Anything else changing\n * is a navigation. Under a hash router the page lives in the hash (`#/table?f.q=x`), so\n * a hash that starts with `#/` counts up to its own `?`; an ordinary `#fragment` does\n * not name a page and is left out.\n */\nfunction routeOf(href: string): string {\n try {\n const url = new URL(href);\n const hashRoute = url.hash.startsWith(\"#/\") ? url.hash.split(\"?\")[0] : \"\";\n return url.origin + url.pathname + hashRoute;\n } catch {\n return href;\n }\n}\n\n/**\n * Is the untagged entry we are standing on still `p`'s — merely wiped by the router —\n * or an entry the router NAVIGATED to from inside the overlay?\n *\n * The router's `idx` is the one per-entry fact that separates the two, because it is\n * the one the router itself keeps straight: a replace leaves it as it was, a push adds\n * one. Our own push copies the page's state, so our entry carries the page's `idx` and\n * a router push on top of it carries one more. The key would not do — every replace\n * mints a new one, so the wipe this repair exists for would already fail it. Neither\n * would the address alone: a push to the address we are already at is still a push.\n *\n * `idx` does not see one move, the router REPLACING our entry with a different page\n * (same `idx`), so the page named by the address must also be unchanged. Where there is\n * no `idx` to compare (no router, or one that keeps none) the address is all there is.\n */\nfunction isStillOn(p: PushedEntry): boolean {\n if (routeOf(currentHref()) !== p.route) return false;\n const { idx } = routerMark();\n return idx === undefined || p.idx === undefined || idx === p.idx;\n}\n\n/**\n * The router has navigated while our entries were on top: record which of `records`\n * (ours, oldest first, ending with the top one) it buried and which it replaced, and\n * drop them from `pushed` — none of them can be unwound any more. Returns whether it\n * recognised a navigation at all; when it cannot tell (no router `idx` to go by), it\n * leaves everything as it was and the caller falls back to marking the entry dead.\n */\nfunction buryUnder(records: PushedEntry[]): boolean {\n const top = records[records.length - 1];\n const here = routerMark();\n if (!top || top.idx === undefined || here.idx === undefined) return false;\n let run: PushedEntry[];\n if (here.idx > top.idx) {\n run = [];\n for (let i = records.length - 1; i >= 0 && records[i].idx === top.idx; i -= 1) run.unshift(records[i]);\n } else if (here.idx === top.idx && !isStillOn(top)) {\n // Replaced: the top entry IS the new page now, and gone as ours. Those beneath it\n // are buried under it.\n run = [];\n for (let i = records.length - 2; i >= 0 && records[i].idx === top.idx; i -= 1) run.unshift(records[i]);\n } else {\n return false;\n }\n run.forEach((r, i) => {\n buried.set(r.id, {\n idx: top.idx as number,\n aboveIdx: here.idx as number,\n belowKey: run[0].key,\n aboveKey: here.key,\n below: i,\n above: run.length - 1 - i,\n });\n });\n for (const r of records) forgetPushed(r.id);\n lastSeen = here;\n return true;\n}\n\n/**\n * A traversal came to rest on one of our buried entries: carry it on over the run, the\n * way it was going. Back from above (a higher `idx`, or the very entry that buried us)\n * continues down to the page beneath; Forward from that page continues up. A landing\n * from anywhere this cannot place is left alone — one idle press is the price of not\n * guessing, and a wrong guess would move the user somewhere they did not ask to go.\n */\nfunction skipBuried(from: typeof lastSeen): void {\n const tag = taggedSentinel();\n const rec = tag !== null ? buried.get(tag) : undefined;\n if (!rec || !from || stack.some((e) => e.id === tag)) return;\n let steps = 0;\n if ((from.idx !== undefined && from.idx > rec.idx) || (from.key !== undefined && from.key === rec.aboveKey)) {\n steps = -(rec.below + 1);\n } else if (\n from.idx !== undefined &&\n // Below the run, or level with it when nothing above it is (a push buried it),\n // or level with it and provably the page beneath (a replace buried it). The\n // router's first entry has no key at all, so an absent key is a key here.\n (from.idx < rec.idx || (from.idx === rec.idx && (rec.aboveIdx > rec.idx || from.key === rec.belowKey)))\n ) {\n steps = rec.above + 1;\n }\n if (steps === 0) return;\n pendingProgrammatic += 1;\n window.history.go(steps);\n}\n\nfunction forgetPushed(id: string): void {\n const at = pushed.findIndex((p) => p.id === id);\n if (at >= 0) pushed.splice(at, 1);\n}\n\n/**\n * The sentinel this module believes is on the entry we are standing on.\n *\n * `history.state` is where the tag physically sits, because it is the only\n * per-entry storage a browser has — but it is not this module's storage, so\n * since the 2026-09-22 audit it is no longer read as the last word.\n * The ROUTER owns that object and writes it WHOLE: every\n * `setSearchParams(…, { replace: true })` stamps `{usr, key, idx}` over\n * whatever was there. A `DataTable` with `urlSync` does exactly that, on mount\n * and on every filter change — so an overlay opened from such a table had its\n * tag wiped off the entry it was standing on, and then:\n *\n * * its cleanup read \"not my entry\" and abandoned a live entry as a husk;\n * * the push path below could not find itself in `pushed`, so it discarded\n * every record it had (`splice(0)`) and nothing was ever unwound again;\n * * the StrictMode adoption never matched, so in development every dialog\n * pushed a second entry and the deferred `go(-1)` ate the live one — which\n * is Back no longer closing the overlay at all.\n *\n * So `standing` answers when the tag is gone: a MISSING tag on an entry we have\n * not left is a wipe to repair rather than a verdict. The tag is still read\n * FIRST wherever it is there, because it is the one thing that can see a FOREIGN\n * same-URL entry stacked above ours (feedback #424/#426, below) — module-level\n * bookkeeping cannot, since nobody tells us about someone else's `pushState`.\n */\nlet standing: string | null = null;\n\n/** The tag actually on the current entry, with no repair and no belief. */\nfunction taggedSentinel(): string | null {\n const state = typeof window !== \"undefined\" ? window.history.state : null;\n if (!state || typeof state !== \"object\") return null;\n const id = (state as Record<string, unknown>)[SENTINEL_KEY];\n return typeof id === \"string\" ? id : null;\n}\n\n/** Put our tag back on the current entry, keeping whatever the router has since\n * written there — we are a passenger in that object, not its owner. */\nfunction retag(id: string): void {\n const prev = window.history.state;\n window.history.replaceState({ ...(prev && typeof prev === \"object\" ? prev : {}), [SENTINEL_KEY]: id }, \"\");\n}\n\nfunction currentSentinel(): string | null {\n const tag = taggedSentinel();\n if (tag !== null) {\n standing = tag;\n return tag;\n }\n if (standing === null || typeof window === \"undefined\") return null;\n // Only ever re-stamp an entry we still hold a record for. Without that guard a\n // belief left over from an overlay that is long gone — a tab that has since\n // navigated, a test file that ran another case — would be stamped onto a\n // stranger's entry, and the next cleanup would traverse off it.\n //\n // And only an entry that is still the one the marker was placed on. A row that\n // NAVIGATES (a palette result, a dialog's link) has the router push the new page\n // before the overlay's cleanup runs; that entry carries no tag either, and\n // re-stamping it made the cleanup \"unwind\" the navigation itself — the page\n // changed and changed straight back. See `isStillOn` for how the two are told apart.\n const record = pushed.find((p) => p.id === standing);\n if (!record || !isStillOn(record)) {\n standing = null;\n return null;\n }\n retag(standing);\n return standing;\n}\n\n/**\n * The user is about to act: what the current entry's address is NOW is what the\n * overlay standing on it has lived through.\n *\n * The cleanup needs to tell two same-page query rewrites apart, and the address alone\n * cannot. A `DataTable` with `urlSync` replaces `f.*` over the entry while its filter\n * sheet is up, and the sheet is closed LATER, by a press of its own — that entry is\n * still the sheet's and must be unwound (the audit's drift fix, below). A page whose\n * `?row=` drives the overlay replaces the clean URL over the entry and the overlay\n * unmounts BECAUSE of it (keksdose dev #584) — that entry is the owner's now, and\n * unwinding lands on `?row=` beneath and reopens what was just closed. What separates\n * them is whether the user acted in between: the rewrite that closes an overlay is\n * made by the very press that closes it, so it postdates this snapshot.\n *\n * Capture phase, so the snapshot is taken before any handler of the press runs.\n */\nfunction noteAddress(): void {\n const top = pushed[pushed.length - 1];\n if (!top || top.dead || !stack.some((e) => e.id === top.id)) return;\n const tag = taggedSentinel();\n // Read without `currentSentinel`'s repair: an observation must not write history.\n if (tag === top.id || (tag === null && standing === top.id && isStillOn(top))) {\n top.href = currentHref();\n top.seen = top.href;\n }\n}\n\n/** After the user's gesture has run its handlers: the address its entry now shows —\n * what a Back press must carry down (keksdose live #412). Again a little later, for a\n * handler that writes the address a task after the event. */\nfunction noteSeen(): void {\n const top = pushed[pushed.length - 1];\n if (!top || top.dead || !stack.some((e) => e.id === top.id)) return;\n const tag = taggedSentinel();\n if (tag === top.id || (tag === null && standing === top.id && isStillOn(top))) top.seen = currentHref();\n}\n\nfunction noteSeenNowAndLater(): void {\n noteSeen();\n setTimeout(noteSeen, 0);\n}\n\nfunction handlePop() {\n // A pop MOVES us, so the belief is stale by definition: re-read it from the\n // entry we have landed on before anything below consults it, or the repair in\n // `currentSentinel` would stamp the entry we just left onto the one we are on.\n standing = taggedSentinel();\n const from = lastSeen;\n lastSeen = routerMark();\n if (pendingProgrammatic > 0) {\n pendingProgrammatic -= 1;\n const job = carry;\n carry = null;\n if (job) carryOnto(job.href, job);\n return;\n }\n closeOnPop();\n skipBuried(from);\n}\n\nfunction closeOnPop() {\n // Nothing open → an ordinary navigation, which is none of our business.\n const top = stack[stack.length - 1];\n if (!top) return;\n // We landed back ON the top overlay's own entry, so that entry was NOT what the\n // pop consumed — something stacked ABOVE it was (Keksdose feedback #424/#426).\n // The app layers a second same-URL sentinel of its own on top of ours for the\n // unsaved-edit trap (`use-soft-leave-guard.ts`), and it pops that sentinel every\n // time the form goes back to clean — twice-toggling one field was enough to\n // close the whole dialog. A pop is only ours when the entry we came to rest on\n // is no longer ours: either the layer below (a different overlay's marker) or\n // the plain page entry (none at all).\n if (currentSentinel() === top.id) return;\n // Checked before anything below moves: a held overlay keeps its place and its record.\n if (top.held()) {\n putBack(top.id);\n // Told after the entry is back, so what the overlay does about it (a `Modal`'s\n // `onDismissRefused`) runs on its own entry, not on the page under it.\n top.refused();\n return;\n }\n stack.pop();\n syncGestureListeners();\n // The browser consumed this entry, so the overlay's own cleanup has nothing left\n // to unwind and nothing to record as owed.\n consumed.add(top.id);\n const record = pushed.find((p) => p.id === top.id);\n forgetPushed(top.id);\n // What the page wrote into the address while we were up stays (#412).\n if (record && !record.dead) carryOnto(record.seen, record);\n top.close();\n}\n\n/**\n * A Back press the top overlay refuses (a busy `Modal`, DUP-3). A popstate cannot be\n * refused — the browser has already left our entry — so the entry is put back: what the\n * page wrote into the address while the overlay was up is carried down first (#412), as\n * for a close, and the same marker is pushed again over it, as the mount pushed it. Left\n * on the page entry, the overlay would stay up with no entry of its own, and the Back\n * after its request would leave the page under it.\n *\n * A push and not `history.go(1)` back onto the old entry: a traversal lands a task later\n * and fires nothing at all if a listener has pushed meanwhile, and a programmatic pop\n * counted for it would then swallow the user's next real Back.\n */\nfunction putBack(id: string): void {\n const record = pushed.find((p) => p.id === id);\n if (record && !record.dead) carryOnto(record.seen, record);\n const prev: unknown = window.history.state;\n window.history.pushState({ ...(prev && typeof prev === \"object\" ? prev : {}), [SENTINEL_KEY]: id }, \"\");\n standing = id;\n // The address the entry shows now is the one the user last acted on: the cleanup's\n // owner's-close check (#584) must not read the carried address as a rewrite.\n if (record) record.href = record.seen = currentHref();\n}\n\n/** `popstate` stays from the first overlay on: a traversal of ours (an unwind, a buried\n * run to skip) lands after the overlay that caused it has gone. */\nfunction ensureListening() {\n if (listening || typeof window === \"undefined\") return;\n window.addEventListener(\"popstate\", handlePop);\n listening = true;\n}\n\nconst SEEN_EVENTS = [\"click\", \"keyup\", \"change\", \"input\"] as const;\n\n/**\n * The gesture listeners, on while an overlay is open and off when the last one closes.\n * Both notes return at once with no overlay up, but the four bubbling ones scheduled a\n * timer for their second look even then — for every click and every keystroke in every\n * field, for the life of the page after its first dialog (refactor audit 2026-10-30,\n * INP-14). Called after each change to `stack`.\n */\nfunction syncGestureListeners(): void {\n const want = stack.length > 0;\n if (want === noting || typeof window === \"undefined\") return;\n noting = want;\n if (want) {\n window.addEventListener(\"pointerdown\", noteAddress, true);\n window.addEventListener(\"keydown\", noteAddress, true);\n for (const type of SEEN_EVENTS) window.addEventListener(type, noteSeenNowAndLater);\n } else {\n window.removeEventListener(\"pointerdown\", noteAddress, true);\n window.removeEventListener(\"keydown\", noteAddress, true);\n for (const type of SEEN_EVENTS) window.removeEventListener(type, noteSeenNowAndLater);\n }\n}\n\n/**\n * Make the platform Back gesture dismiss an overlay.\n *\n * @param open whether the overlay is currently showing. Components that mount\n * only while open (the common case) pass `true`.\n * @param onClose the overlay's own close handler — the same one Escape calls.\n * @param options.held the overlay refuses to close right now (a `Modal` whose request\n * is in flight, DUP-3): Back does not call `onClose`, and the entry the\n * press took is put back, so the overlay still has one for the next\n * Back. Read when Back is pressed. Default false.\n * @param options.onRefused called once for each Back `held` refused, after its entry is\n * put back — how a held `Modal` hears the press it dropped and passes\n * it on as `onDismissRefused(\"back\")` (0.54 follow-up, keksdose\n * recovery-code-pane).\n */\nexport function useOverlayHistory(\n open: boolean,\n onClose: () => void,\n { held = false, onRefused }: { held?: boolean; onRefused?: () => void } = {},\n): void {\n // The listener fires outside React's render, so it reads the latest handler\n // through a ref rather than through the closure the effect captured.\n const closeRef = useRef(onClose);\n const heldRef = useRef(held);\n const refusedRef = useRef(onRefused);\n useEffect(() => {\n closeRef.current = onClose;\n heldRef.current = held;\n refusedRef.current = onRefused;\n });\n\n useEffect(() => {\n if (!open || typeof window === \"undefined\") return;\n ensureListening();\n const id = `overlay-${(nextId += 1)}`;\n const entry: OverlayEntry = {\n id,\n close: () => closeRef.current(),\n held: () => heldRef.current,\n refused: () => refusedRef.current?.(),\n };\n stack.push(entry);\n syncGestureListeners();\n const prev = window.history.state;\n const marked = { ...(prev && typeof prev === \"object\" ? prev : {}), [SENTINEL_KEY]: id };\n // An entry that is on its way out and that we are still standing on is ours\n // to take over: same URL, same slot, only the marker changes. Pushing a\n // second one on top of it is what used to leave a husk on every StrictMode\n // remount — see {@link Unwind}.\n const adopting = unwind && unwind.id === currentSentinel() && unwind.href === currentHref();\n if (adopting && unwind) {\n clearTimeout(unwind.timer);\n const inherited = unwind.entries;\n unwind = null;\n // Preserve react-router's own `{usr,key,idx}` — we only swap the marker,\n // and the entry we are swapping it on is the one the router is already on.\n window.history.replaceState(marked, \"\");\n // The abandoned ones beneath come back owed; ours takes the top slot.\n for (const owed of inherited.slice(0, -1)) pushed.push({ ...owed, dead: true });\n const was = inherited[inherited.length - 1];\n pushed.push({\n id,\n href: currentHref(),\n seen: currentHref(),\n dead: false,\n idx: was.idx,\n key: was.key,\n route: was.route,\n });\n standing = id;\n } else {\n // A push DESTROYS every entry ahead of the one we are on, so anything we\n // still had recorded above our own position is gone. Kept, those would be\n // counted into a later `history.go(-n)` and the overshoot would come out\n // of a navigation the user actually made. Where we cannot tell which of\n // ours are beneath us — we are standing on a plain page entry, or on a\n // husk nobody tracks — none of them can be proven to be, so none survive.\n const under = pushed.findIndex((p) => p.id === currentSentinel());\n pushed.splice(under + 1);\n // Preserve react-router's own `{usr,key,idx}` — we only tack a marker on, and\n // the URL is unchanged, so the router treats popping this as a no-op re-render.\n window.history.pushState(marked, \"\");\n const page = routerMark();\n const at = currentHref();\n pushed.push({ id, href: at, seen: at, dead: false, idx: page.idx, key: page.key, route: routeOf(at) });\n standing = id;\n }\n return () => {\n const at = stack.indexOf(entry);\n if (at >= 0) stack.splice(at, 1);\n syncGestureListeners();\n\n // A Back press already took this entry; there is nothing to unwind or to owe.\n if (consumed.delete(id)) return;\n\n const mine = pushed.findIndex((p) => p.id === id);\n // Still our entry — same page, same router `idx` — but its address is not the one\n // the user last acted on: the owner rewrote it as part of closing us (see\n // {@link noteAddress}). The entry is the owner's page now, and the one beneath is\n // the address it replaced — going back would restore exactly what was closed.\n // Nothing to unwind; forget the record rather than re-stamp a page we left.\n if (mine >= 0 && currentHref() !== pushed[mine].href) {\n const tag = taggedSentinel();\n if (tag === id || (tag === null && standing === id && isStillOn(pushed[mine]))) {\n pushed.splice(mine, 1);\n if (standing === id) standing = null;\n return;\n }\n }\n // Only unwind an entry that is still THE current one. If a router push landed\n // on top of it, going back would undo the user's navigation instead — and if\n // a SIBLING overlay's sentinel landed on top, that overlay is about to unwind\n // and is the one that can take ours with it.\n if (currentSentinel() !== id) {\n // A router navigation from inside the overlay: nothing to unwind — the\n // entries it left beneath the new page are skipped over instead.\n if (mine >= 0 && taggedSentinel() === null && buryUnder(pushed.slice(0, pushed.length))) return;\n if (mine >= 0) pushed[mine].dead = true;\n return;\n }\n\n // Ours plus every abandoned entry lying directly beneath it at this address.\n // One traversal, so one popstate, so one programmatic pop to absorb.\n const here = currentHref();\n let steps = 1;\n while (steps <= mine && pushed[mine - steps].dead && pushed[mine - steps].href === here) {\n steps += 1;\n }\n const leaving = pushed.splice(mine - (steps - 1), steps);\n // Scheduled, not issued: an overlay opening in this same tick takes the\n // entry over instead, which is what makes the hook survive a StrictMode\n // remount. An unwind already waiting is dropped rather than merged — it\n // was the entry ABOVE ours and something has since moved off it, so its\n // count can no longer be proven, and an over-counted traversal costs a\n // navigation the user made while an under-counted one costs one dead Back.\n if (unwind) clearTimeout(unwind.timer);\n unwind = { timer: setTimeout(runUnwind, 0), id, href: here, entries: leaving };\n };\n }, [open]);\n}\n"],"mappings":";AAAA,SAAS,WAAW,cAAc;AAoElC,MAAM,eAAe;AAWrB,MAAM,QAAwB,CAAC;AAyC/B,MAAM,SAAwB,CAAC;AA6B/B,MAAM,SAAS,oBAAI,IAAyB;AAI5C,IAAI,WAAwE;AAK5E,MAAM,WAAW,oBAAI,IAAY;AAKjC,IAAI,sBAA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AAU,OAAO,MAAM,GAAG,OAAO,MAAM,CAAC,EAAG;AACzF,YAAI,QAAQ,EAAG,QAAO,IAAI,EAAE,OAAO;AACnC;AAAA,MACF;AAIA,YAAM,OAAO,YAAY;AACzB,UAAI,QAAQ;AACZ,aAAO,SAAS,QAAQ,OAAO,OAAO,KAAK,EAAE,QAAQ,OAAO,OAAO,KAAK,EAAE,SAAS,MAAM;AACvF,iBAAS;AAAA,MACX;AACA,YAAM,UAAU,OAAO,OAAO,QAAQ,QAAQ,IAAI,KAAK;AAOvD,UAAI,OAAQ,cAAa,OAAO,KAAK;AACrC,eAAS,EAAE,OAAO,WAAW,WAAW,CAAC,GAAG,IAAI,MAAM,MAAM,SAAS,QAAQ;AAAA,IAC/E;AAAA,EACF,GAAG,CAAC,IAAI,CAAC;AACX;","names":[]}
|
package/dist/i18n/defaults.js
CHANGED
|
@@ -26,6 +26,7 @@ import { DEFAULT_SWATCH_PICKER_LABELS } from "../components/swatch-picker-labels
|
|
|
26
26
|
import { DEFAULT_ICON_PICKER_LABELS } from "../components/icon-picker-labels.js";
|
|
27
27
|
import { DEFAULT_DIALOG_FRAME_LABELS } from "../components/dialog-frame-labels.js";
|
|
28
28
|
import { DEFAULT_FILE_PICKER_LABELS } from "../hooks/use-file-picker-labels.js";
|
|
29
|
+
import { DEFAULT_CAMERA_LABELS } from "../components/camera-labels.js";
|
|
29
30
|
import { DEFAULT_MEASURED_GRID_LABELS } from "../components/measured-grid-labels.js";
|
|
30
31
|
import { DEFAULT_CONFIRM_DIALOG_LABELS } from "../components/confirm-dialog-labels.js";
|
|
31
32
|
import { DEFAULT_FLOATING_PANEL_LABELS } from "../components/floating-panel-labels.js";
|
|
@@ -101,6 +102,10 @@ import { DEFAULT_SIGN_OUT_PENDING_DIALOG_LABELS } from "../offline/sign-out-pend
|
|
|
101
102
|
import { DEFAULT_PWA_UPDATE_PROMPT_LABELS } from "../offline/pwa-update-prompt-labels.js";
|
|
102
103
|
import { DEFAULT_SHARED_COMPUTER_LABELS } from "../offline/shared-computer-labels.js";
|
|
103
104
|
import { DEFAULT_TOP_BAR_PARTS_LABELS } from "../shell/top-bar-parts-labels.js";
|
|
105
|
+
import { DEFAULT_HELD_CHANGES_BANNER_LABELS } from "../shell/held-changes-banner-labels.js";
|
|
106
|
+
import { DEFAULT_FIELD_SUGGESTION_LABELS } from "../components/field-suggestion-labels.js";
|
|
107
|
+
import { DEFAULT_CONSENT_AGAIN_LABELS } from "../components/consent-again-notice-labels.js";
|
|
108
|
+
import { DEFAULT_RELEASE_NOTES_LABELS } from "../components/release-notes-labels.js";
|
|
104
109
|
import { DEFAULT_SHARE_CARD_LABELS } from "../components/share-card-labels.js";
|
|
105
110
|
import { DEFAULT_REAUTH_DIALOG_LABELS } from "../components/reauth-dialog-labels.js";
|
|
106
111
|
import { DEFAULT_SERVER_WAKE_LABELS } from "../components/server-wake-labels.js";
|
|
@@ -163,6 +168,7 @@ const DEFAULT_UI_KIT_LABELS = {
|
|
|
163
168
|
iconPicker: DEFAULT_ICON_PICKER_LABELS,
|
|
164
169
|
dialogFrame: DEFAULT_DIALOG_FRAME_LABELS,
|
|
165
170
|
filePicker: DEFAULT_FILE_PICKER_LABELS,
|
|
171
|
+
camera: DEFAULT_CAMERA_LABELS,
|
|
166
172
|
measuredGrid: DEFAULT_MEASURED_GRID_LABELS,
|
|
167
173
|
feedbackAttachment: DEFAULT_FEEDBACK_ATTACHMENT_LABELS,
|
|
168
174
|
feedbackDialog: DEFAULT_FEEDBACK_DIALOG_LABELS,
|
|
@@ -245,7 +251,11 @@ const DEFAULT_UI_KIT_LABELS = {
|
|
|
245
251
|
mailTestCard: DEFAULT_MAIL_TEST_CARD_LABELS,
|
|
246
252
|
signOutPending: DEFAULT_SIGN_OUT_PENDING_DIALOG_LABELS,
|
|
247
253
|
pwaUpdate: DEFAULT_PWA_UPDATE_PROMPT_LABELS,
|
|
248
|
-
sharedComputer: DEFAULT_SHARED_COMPUTER_LABELS
|
|
254
|
+
sharedComputer: DEFAULT_SHARED_COMPUTER_LABELS,
|
|
255
|
+
heldChanges: DEFAULT_HELD_CHANGES_BANNER_LABELS,
|
|
256
|
+
fieldSuggestion: DEFAULT_FIELD_SUGGESTION_LABELS,
|
|
257
|
+
consentAgain: DEFAULT_CONSENT_AGAIN_LABELS,
|
|
258
|
+
releaseNotes: DEFAULT_RELEASE_NOTES_LABELS
|
|
249
259
|
};
|
|
250
260
|
export {
|
|
251
261
|
DEFAULT_UI_KIT_LABELS
|