@eifi1/ui-kit 0.47.0 → 0.48.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 +5 -3
- package/dist/admin/admin-sections.d.ts +8 -0
- package/dist/admin/admin-sections.js +2 -1
- package/dist/admin/admin-sections.js.map +1 -1
- package/dist/auth/verify-email.d.ts +9 -1
- package/dist/auth/verify-email.js +22 -13
- package/dist/auth/verify-email.js.map +1 -1
- package/dist/components/alert-banner.d.ts +29 -1
- package/dist/components/alert-banner.js +84 -7
- package/dist/components/alert-banner.js.map +1 -1
- package/dist/components/button-look.d.ts +4 -0
- package/dist/components/button-look.js +2 -0
- package/dist/components/button-look.js.map +1 -1
- package/dist/components/combobox-core.js +5 -1
- package/dist/components/combobox-core.js.map +1 -1
- package/dist/components/data-table-column-settings.d.ts +6 -1
- package/dist/components/data-table-column-settings.js +12 -2
- package/dist/components/data-table-column-settings.js.map +1 -1
- package/dist/components/data-table-fit.d.ts +44 -0
- package/dist/components/data-table-fit.js +103 -0
- package/dist/components/data-table-fit.js.map +1 -0
- package/dist/components/data-table-groups.d.ts +95 -0
- package/dist/components/data-table-groups.js +165 -0
- package/dist/components/data-table-groups.js.map +1 -0
- package/dist/components/data-table-head.js +3 -1
- package/dist/components/data-table-head.js.map +1 -1
- package/dist/components/data-table-labels.d.ts +7 -0
- package/dist/components/data-table-labels.js +3 -0
- package/dist/components/data-table-labels.js.map +1 -1
- package/dist/components/data-table-leading-row.d.ts +17 -0
- package/dist/components/data-table-leading-row.js +41 -0
- package/dist/components/data-table-leading-row.js.map +1 -0
- package/dist/components/data-table-resize.js +1 -1
- package/dist/components/data-table-resize.js.map +1 -1
- package/dist/components/data-table.d.ts +78 -2
- package/dist/components/data-table.js +348 -257
- package/dist/components/data-table.js.map +1 -1
- package/dist/components/disclosure.d.ts +3 -1
- package/dist/components/disclosure.js +10 -4
- package/dist/components/disclosure.js.map +1 -1
- package/dist/components/dropdown.js +8 -1
- package/dist/components/dropdown.js.map +1 -1
- package/dist/components/floating-panel.d.ts +14 -1
- package/dist/components/floating-panel.js +7 -2
- package/dist/components/floating-panel.js.map +1 -1
- package/dist/components/hover-menu.js +5 -1
- package/dist/components/hover-menu.js.map +1 -1
- package/dist/components/icon-button.js +2 -1
- package/dist/components/icon-button.js.map +1 -1
- package/dist/components/popover.js +5 -1
- package/dist/components/popover.js.map +1 -1
- package/dist/components/table-skeleton.d.ts +35 -0
- package/dist/components/table-skeleton.js +75 -0
- package/dist/components/table-skeleton.js.map +1 -0
- package/dist/components/tabs.d.ts +10 -12
- package/dist/components/tabs.js +20 -10
- package/dist/components/tabs.js.map +1 -1
- package/dist/components/use-table-state.d.ts +8 -7
- package/dist/components/use-table-state.js +37 -3
- package/dist/components/use-table-state.js.map +1 -1
- package/dist/data-table.d.ts +1 -0
- package/dist/data-table.js.map +1 -1
- package/dist/eslint/index.js +1 -1
- package/dist/feedback/feedback-table.d.ts +5 -0
- package/dist/feedback/feedback-table.js +30 -7
- package/dist/feedback/feedback-table.js.map +1 -1
- package/dist/hooks/use-dismiss.d.ts +30 -1
- package/dist/hooks/use-dismiss.js +30 -2
- package/dist/hooks/use-dismiss.js.map +1 -1
- package/dist/i18n/german.js +6 -1
- package/dist/i18n/german.js.map +1 -1
- package/dist/i18n/kit-labels.d.ts +4 -0
- package/dist/i18n/kit-labels.js.map +1 -1
- package/dist/i18n/locales/en.js +6 -1
- package/dist/i18n/locales/en.js.map +2 -2
- package/dist/i18n/locales/es.js +6 -1
- package/dist/i18n/locales/es.js.map +1 -1
- package/dist/i18n/locales/fr.js +6 -1
- package/dist/i18n/locales/fr.js.map +1 -1
- package/dist/i18n/locales/hu.js +6 -1
- package/dist/i18n/locales/hu.js.map +1 -1
- package/dist/i18n/locales/it.js +6 -1
- package/dist/i18n/locales/it.js.map +1 -1
- package/dist/i18n/locales/zh.js +6 -1
- package/dist/i18n/locales/zh.js.map +1 -1
- package/dist/i18n/shared-labels.js +3 -1
- package/dist/i18n/shared-labels.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/lib/float-clearance.d.ts +8 -0
- package/dist/lib/float-clearance.js +29 -0
- package/dist/lib/float-clearance.js.map +1 -0
- package/dist/settings/settings-catalogue.d.ts +10 -0
- package/dist/settings/settings-catalogue.js.map +1 -1
- package/dist/settings/settings-layout.js +10 -3
- package/dist/settings/settings-layout.js.map +1 -1
- package/dist/shell/app-shell.d.ts +5 -0
- package/dist/shell/app-shell.js +5 -3
- package/dist/shell/app-shell.js.map +1 -1
- package/dist/shell/option-switcher-menu.d.ts +2 -0
- package/dist/shell/option-switcher-menu.js +6 -2
- package/dist/shell/option-switcher-menu.js.map +1 -1
- package/dist/shell/topbar-action-menu.js +2 -1
- package/dist/shell/topbar-action-menu.js.map +1 -1
- package/dist/shell/topbar-controls.js +5 -3
- package/dist/shell/topbar-controls.js.map +1 -1
- package/dist/tour/tour.js +1 -0
- package/dist/tour/tour.js.map +1 -1
- package/package.json +1 -1
- package/src/admin/admin-sections.tsx +8 -0
- package/src/auth/verify-email.tsx +34 -9
- package/src/components/alert-banner.tsx +131 -7
- package/src/components/button-look.ts +6 -0
- package/src/components/combobox-core.tsx +7 -1
- package/src/components/data-table-column-settings.tsx +23 -2
- package/src/components/data-table-fit.ts +187 -0
- package/src/components/data-table-groups.tsx +275 -0
- package/src/components/data-table-head.tsx +4 -1
- package/src/components/data-table-labels.ts +13 -0
- package/src/components/data-table-leading-row.tsx +55 -0
- package/src/components/data-table-resize.ts +2 -1
- package/src/components/data-table.tsx +246 -43
- package/src/components/disclosure.tsx +22 -5
- package/src/components/dropdown.tsx +11 -1
- package/src/components/floating-panel.tsx +24 -1
- package/src/components/hover-menu.tsx +6 -1
- package/src/components/icon-button.tsx +3 -3
- package/src/components/popover.tsx +7 -1
- package/src/components/table-skeleton.tsx +133 -0
- package/src/components/tabs.tsx +67 -37
- package/src/components/use-table-state.ts +54 -3
- package/src/data-table.ts +2 -0
- package/src/feedback/feedback-table.tsx +33 -1
- package/src/hooks/use-dismiss.ts +65 -3
- package/src/i18n/german.ts +5 -0
- package/src/i18n/kit-labels.tsx +4 -0
- package/src/i18n/locales/es.ts +5 -0
- package/src/i18n/locales/fr.ts +5 -0
- package/src/i18n/locales/hu.ts +5 -0
- package/src/i18n/locales/it.ts +5 -0
- package/src/i18n/locales/zh.ts +5 -0
- package/src/i18n/shared-labels.ts +2 -0
- package/src/index.ts +3 -0
- package/src/lib/float-clearance.ts +54 -0
- package/src/settings/settings-catalogue.ts +10 -0
- package/src/settings/settings-layout.tsx +18 -4
- package/src/shell/app-shell.tsx +17 -3
- package/src/shell/option-switcher-menu.tsx +16 -4
- package/src/shell/topbar-action-menu.tsx +22 -10
- package/src/shell/topbar-controls.tsx +18 -12
- package/src/tour/tour.tsx +5 -0
|
@@ -7,6 +7,7 @@ import { toLocalIso } from "../lib/dates.js";
|
|
|
7
7
|
import { EMPTY_FORMATTED_VALUE, formatDate, toDate } from "../lib/format.js";
|
|
8
8
|
import { useKitDateFormatter, useKitLabels, useKitLink, useKitLocale } from "../i18n/kit-labels.js";
|
|
9
9
|
import { Chip } from "../components/chip.js";
|
|
10
|
+
import { Tooltip } from "../components/tooltip.js";
|
|
10
11
|
import { FloatingAction, FloatingActionGroup } from "../components/floating-panel.js";
|
|
11
12
|
import { pickLinkRenderer } from "../components/text-link.js";
|
|
12
13
|
import {
|
|
@@ -145,7 +146,10 @@ function feedbackColumns({
|
|
|
145
146
|
cell: (row) => /* @__PURE__ */ jsx(FeedbackVoteCount, { votes: row.votes ?? void 0 }),
|
|
146
147
|
sortBy: (row) => row.votes ?? 0,
|
|
147
148
|
filter: { type: "number", getValue: (row) => row.votes ?? 0 },
|
|
148
|
-
mobileHidden: true
|
|
149
|
+
mobileHidden: true,
|
|
150
|
+
// Fourth to go (Kurvenschmiede S1, 0.48): with only the first three, Subject was
|
|
151
|
+
// crushed to 24px at 1100px. Still reachable from the Columns panel.
|
|
152
|
+
fitPriority: 4
|
|
149
153
|
}
|
|
150
154
|
] : [];
|
|
151
155
|
return [
|
|
@@ -173,7 +177,10 @@ function feedbackColumns({
|
|
|
173
177
|
type: "select",
|
|
174
178
|
getValue: (row) => row.category,
|
|
175
179
|
options: FEEDBACK_CATEGORY_ORDER.map((value) => ({ value, label: categoryLabels[value] }))
|
|
176
|
-
}
|
|
180
|
+
},
|
|
181
|
+
// Last to go (Kurvenschmiede S1, 0.48), before Subject would drop below 10rem:
|
|
182
|
+
// the open report's Subject section repeats the badge.
|
|
183
|
+
fitPriority: 5
|
|
177
184
|
},
|
|
178
185
|
{
|
|
179
186
|
key: "title",
|
|
@@ -186,12 +193,22 @@ function feedbackColumns({
|
|
|
186
193
|
const env = feedbackEnvironment(row.context);
|
|
187
194
|
return env ? `${row.title} ${labels.environment(env)}` : row.title;
|
|
188
195
|
},
|
|
189
|
-
mobilePrimary: true
|
|
196
|
+
mobilePrimary: true,
|
|
197
|
+
// The rest of the row, one line and an ellipsis (0.48, keksdose live #451: one long
|
|
198
|
+
// crash title pushed Status and the row actions off the edge).
|
|
199
|
+
grow: true
|
|
190
200
|
},
|
|
191
201
|
{
|
|
192
202
|
key: "user",
|
|
193
203
|
header: labels.columnUser,
|
|
194
|
-
|
|
204
|
+
// At most 12rem, one line and an ellipsis, the whole value in the kit's Tooltip (0.48 build
|
|
205
|
+
// review 2, keksdose N2): beside the grow Subject every other cell keeps one line, so
|
|
206
|
+
// an email standing in for a missing name widened the column and cost Votes and
|
|
207
|
+
// Category their room first. The open report shows both in full.
|
|
208
|
+
cell: (row) => {
|
|
209
|
+
const who = feedbackSubmitter(row, labels);
|
|
210
|
+
return /* @__PURE__ */ jsx(Tooltip, { label: who, portal: true, lazy: true, children: /* @__PURE__ */ jsx("span", { className: "block max-w-[12rem] truncate-until-large text-secondary", children: who }) });
|
|
211
|
+
},
|
|
195
212
|
sortBy: (row) => feedbackSubmitter(row, labels),
|
|
196
213
|
// Name AND email, so either finds the person; the erased ones by the placeholder
|
|
197
214
|
// (their context holds no name any more).
|
|
@@ -210,7 +227,9 @@ function feedbackColumns({
|
|
|
210
227
|
},
|
|
211
228
|
sortBy: feedbackSubmitterEmail,
|
|
212
229
|
filterBy: feedbackSubmitterEmail,
|
|
213
|
-
mobileHidden: true
|
|
230
|
+
mobileHidden: true,
|
|
231
|
+
// Second to go when the table is narrow: the open report shows the submitter.
|
|
232
|
+
fitPriority: 2
|
|
214
233
|
},
|
|
215
234
|
{
|
|
216
235
|
key: "url",
|
|
@@ -224,7 +243,9 @@ function feedbackColumns({
|
|
|
224
243
|
cell: (row) => /* @__PURE__ */ jsx(FeedbackPageLinkCell, { context: row.context, openPage: labels.openPage }),
|
|
225
244
|
sortBy: (row) => feedbackPagePath(row.context) ?? "",
|
|
226
245
|
filterBy: (row) => feedbackPagePath(row.context) ?? "",
|
|
227
|
-
mobileHidden: true
|
|
246
|
+
mobileHidden: true,
|
|
247
|
+
// First to go when the table is narrow (0.48): the open report repeats the page.
|
|
248
|
+
fitPriority: 1
|
|
228
249
|
},
|
|
229
250
|
...votesColumn,
|
|
230
251
|
{
|
|
@@ -259,7 +280,9 @@ function feedbackColumns({
|
|
|
259
280
|
cell: (row) => /* @__PURE__ */ jsx(FeedbackDate, { value: row.resolved_at, renderDate }),
|
|
260
281
|
sortBy: (row) => instant(row.resolved_at),
|
|
261
282
|
filter: { type: "date", getValue: (row) => row.resolved_at },
|
|
262
|
-
mobileHidden: true
|
|
283
|
+
mobileHidden: true,
|
|
284
|
+
// Third to go (0.48).
|
|
285
|
+
fitPriority: 3
|
|
263
286
|
}
|
|
264
287
|
];
|
|
265
288
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/feedback/feedback-table.tsx"],"sourcesContent":["import { useMemo } from \"react\";\nimport type { MouseEvent, ReactElement, ReactNode } from \"react\";\nimport { ExternalLink, ThumbsUp } from \"lucide-react\";\nimport { cn } from \"../lib/cn\";\nimport { toLocalIso } from \"../lib/dates\";\nimport { EMPTY_FORMATTED_VALUE, formatDate, toDate } from \"../lib/format\";\nimport { useKitDateFormatter, useKitLabels, useKitLink, useKitLocale, type LabelOverride } from \"../i18n/kit-labels\";\nimport type { KitLinkProps } from \"../i18n/kit-labels\";\nimport { Chip } from \"../components/chip\";\nimport { FloatingAction, FloatingActionGroup } from \"../components/floating-panel\";\nimport type { FloatingCorner } from \"../components/floating-panel\";\nimport { pickLinkRenderer } from \"../components/text-link\";\nimport type { DataTableColumn } from \"../components/data-table\";\nimport {\n FEEDBACK_CATEGORY_ORDER,\n FEEDBACK_STATUS_META,\n FEEDBACK_STATUS_ORDER,\n FeedbackCategoryBadge,\n FeedbackStatusBadge,\n FeedbackStatusTransitions,\n feedbackCategoryRank,\n visibleFeedbackStatuses,\n type FeedbackStatus,\n} from \"./feedback-inbox\";\nimport {\n useFeedbackCategoryLabels,\n useFeedbackStatusLabels,\n type FeedbackCategoryLabels,\n type FeedbackStatusLabels,\n} from \"./feedback-labels\";\nimport { FEEDBACK_AWAITING_STATUSES, feedbackReworkCount, type FeedbackContext, type FeedbackRecord } from \"./feedback-record\";\nimport type { FeedbackStatusChange } from \"./feedback-status-undo\";\nimport { feedbackPageHref, feedbackPagePath } from \"./feedback-row-detail\";\nimport type { CommitScope } from \"../components/write-lock\";\nimport { DEFAULT_FEEDBACK_PAGE_LABELS } from \"./feedback-table-labels\";\nimport { DEFAULT_FEEDBACK_PUBLIC_LABELS } from \"./feedback-public-labels\";\n\n/**\n * The two feedback pages' TABLE — `/feedback` (the admin inbox) and `/my-feedback` (the\n * user's own) — as the kit's parts: §4.3 of the feedback contract\n * (docs/feedback-harmonization.md), lifted from keksdose\n * `frontend/src/features/feedback/feedback-page.tsx` (columns :711–963, the phone card\n * :1038–1065, the awaiting toggle :689–709 and :1086–1101).\n *\n * Until 0.27 each app wrote this table itself, and the three had drifted exactly where a\n * table drifts: kastlan's showed five statuses and no environment, Kurvenschmiede's one\n * page served both audiences, and keksdose's — the canon, argued over a year of feedback\n * items — had a latent bug of its own: its subject cell carries the environment and\n * rework chips \"so a second attempt is marked on every surface at once\" (:760), but the\n * phone card is a `mobileCard`, and `DataTable` never renders the `mobilePrimary` cell\n * when `mobileCard` is set (data-table-mobile.tsx, `cardInner`). Its phone cards showed neither\n * chip. {@link FeedbackMobileCard} draws both itself, from the same\n * {@link FeedbackSubject} the column uses, so the two surfaces cannot part again.\n *\n * What stays the app's: the rows (its API client), who is an admin, the routes and the\n * `/feedback` → `/my-feedback` redirect, the `?row=` deep link and the row detail. What\n * is here: the nine columns ({@link feedbackColumns} / {@link useFeedbackColumns}), the\n * phone card and its day headers ({@link FeedbackMobileCard},\n * {@link feedbackMobileGroupBy}), the phone's \"Only what is waiting for you\" toggle\n * ({@link FeedbackAwaitingToggle}), the empty state ({@link FeedbackEmptyState}) and the\n * `feedbackPage` words. The swipes are `feedbackSwipePlan` (feedback-swipe.tsx), passed\n * by the app because whether the page may write is the app's call.\n */\n\n/* ── Labels ─────────────────────────────────────────────────────────────────── */\n\n/**\n * `feedbackPage` — the words of the two feedback pages (§4.3). The English is keksdose's\n * `en.json` (`feedback.*`, `common.none`); the de-CH canon is noted on each key (keksdose\n * `de-CH.json`, ss never ß).\n */\nexport interface FeedbackPageLabels {\n /** The admin inbox's page title, `/feedback` — the menu's \"Feedback inbox\" (0.40,\n * §10.2 decision 11; \"Feedback\" before). de-CH: \"Feedback-Eingang\" */\n title: string;\n /** The user's own list, `/my-feedback`. de-CH: \"Mein Feedback\" */\n myTitle: string;\n /** Column 1, the id. de-CH: \"#\" */\n columnId: string;\n /** Column 2, when it was filed. de-CH: \"Datum\" */\n columnDate: string;\n /** Column 3. de-CH: \"Kategorie\" */\n columnCategory: string;\n /** Column 4, the title with its chips. de-CH: \"Betreff\" */\n columnSubject: string;\n /** Column 5, who filed it. de-CH: \"Nutzer\" */\n columnUser: string;\n /** Column 6. de-CH: \"E-Mail\" */\n columnEmail: string;\n /** Column 7, the page it was filed from. de-CH: \"URL\" */\n columnUrl: string;\n /** Column 8. de-CH: \"Status\" */\n columnStatus: string;\n /** Column 9, when it was settled. de-CH: \"Erledigt am\" */\n columnResolved: string;\n /** What the URL cell's link does, said before the path to a screen reader.\n * de-CH: \"Seite öffnen\" */\n openPage: string;\n /** The table with nothing to show, on both pages (§7.13) — keksdose's `common.none`.\n * de-CH: \"Keine\" */\n empty: string;\n /** The submitter of a report whose account was erased (`user_id: null`, keksdose live\n * #275). de-CH: \"<gelöschter Nutzer>\" */\n deletedUser: string;\n /** The submitter when neither a name nor an email is known — `id` is `user_id`.\n * de-CH: \"Nutzer #{{id}}\" */\n userFallback: (id: number) => string;\n /** The chip for a report filed from a copy of the app that is not production —\n * `environment` is `context.environment` as filed (\"dev\", \"local\", or the app's own\n * word). Upper-cased like the top bar's environment badge, so the marker the tester saw\n * is the marker triage sees. Guarded: a context is untyped JSON, so a value that is no\n * string (an app calling it with `context.environment` as stored) is printed, never\n * thrown on. de-CH: the same. */\n environment: (environment: string) => string;\n /** The chip for a report sent back for rework — `count` ≥ 1 is how many times\n * (`reworkCount`, keksdose live #331). de-CH: \"Nacharbeit\" / \"Nacharbeit ×{{count}}\" */\n reworkChip: (count: number) => string;\n /** The phone toggle narrowing the inbox to IN_EVALUATION + NEEDS_LIVE_TEST.\n * de-CH: \"Nur was auf Sie wartet\" */\n awaitingFilter: string;\n /** The name of the phone's floating group that holds it. de-CH: \"Feedback-Aktionen\" */\n phoneActions: string;\n}\n\n// Defined in ./feedback-table-labels, which holds no component code (0.34, KS U8).\nexport { DEFAULT_FEEDBACK_PAGE_LABELS };\n\n/** `feedbackPage` resolved: English, then `<UiKitProvider labels>`, then `labels`. The\n * page's title comes from here too: `mine ? labels.myTitle : labels.title`. */\nexport function useFeedbackPageLabels(labels?: LabelOverride<FeedbackPageLabels>): FeedbackPageLabels {\n return useKitLabels(\"feedbackPage\", DEFAULT_FEEDBACK_PAGE_LABELS, labels);\n}\n\n/* ── Reading a row ──────────────────────────────────────────────────────────── */\n\n/** What the table reads off a report — {@link FeedbackRecord}'s fields, so an app's own\n * row type with more of them passes as it is. */\nexport type FeedbackTableRow = Pick<\n FeedbackRecord,\n | \"id\"\n | \"user_id\"\n | \"user_email\"\n | \"title\"\n | \"body\"\n | \"category\"\n | \"status\"\n | \"context\"\n | \"resolved_at\"\n | \"created_at\"\n | \"votes\"\n>;\n\n/** A context value as a trimmed string, or `\"\"` — every key is optional on read (§3.2)\n * and an app's own context type may say `unknown`. */\nfunction text(value: unknown): string {\n return typeof value === \"string\" ? value.trim() : \"\";\n}\n\n/**\n * The environment a report was filed from when it is NOT production, as filed — or\n * `null` (keksdose `environmentLabel`, :142). Production is silent, as the top bar's\n * badge is: the marker earns attention by being rare. A missing value is production too —\n * every row filed before a test copy existed, and crash rows filed before the crash\n * payload carried `environment` (§3.2, §3.6). An unknown value is shown rather than swallowed: an environment\n * nobody recognises is exactly when triage needs to see one.\n */\nexport function feedbackEnvironment(context: FeedbackContext | null | undefined): string | null {\n const env = text(context?.environment);\n return !env || env.toLowerCase() === \"prod\" ? null : env;\n}\n\n/**\n * Who filed a report, as one string (keksdose `submitterLabel`, :163): the display name,\n * else the email, else `userFallback(user_id)`. An erased account (`user_id: null`) is\n * `deletedUser` FIRST, ahead of the context: the server scrubs the name with the account,\n * but a row that somehow kept one must still not go on naming somebody who asked to be\n * forgotten. The joined `user_email` (admin list) is preferred to the context snapshot.\n */\nexport function feedbackSubmitter(\n row: Pick<FeedbackRecord, \"user_id\" | \"user_email\" | \"context\">,\n labels: Pick<FeedbackPageLabels, \"deletedUser\" | \"userFallback\">,\n): string {\n if (row.user_id == null) return labels.deletedUser;\n return (\n text(row.context?.user_display_name) ||\n text(row.user_email) ||\n text(row.context?.user_email) ||\n labels.userFallback(row.user_id)\n );\n}\n\n/**\n * The submitter's email (keksdose `submitterEmail`, :175): the joined `user_email` —\n * authoritative, the display name is self-chosen (feedback #108) — else the context\n * snapshot, which is what `/my-feedback` has (`GET /feedback/my` sends no join). `\"\"`\n * for an erased account, for the reason {@link feedbackSubmitter} gives.\n */\nexport function feedbackSubmitterEmail(row: Pick<FeedbackRecord, \"user_id\" | \"user_email\" | \"context\">): string {\n if (row.user_id == null) return \"\";\n return text(row.user_email) || text(row.context?.user_email);\n}\n\n/** Whether a status is one the phone's awaiting toggle keeps — `FEEDBACK_AWAITING_STATUSES`,\n * the two that wait on the person triaging. `rows.filter((r) => isFeedbackAwaiting(r.status))`. */\nexport function isFeedbackAwaiting(status: FeedbackStatus): boolean {\n return FEEDBACK_AWAITING_STATUSES.includes(status);\n}\n\n/* ── Dates ──────────────────────────────────────────────────────────────────── */\n\n/**\n * How the pages write a date: an ISO timestamp in, one string out. keksdose passes its\n * `useDateCell()` (the app's date-format preference, weekday and all — dev#546), which\n * fits as it is.\n *\n * ONE function for the date column, the resolved column, the phone card and the phone's\n * day headers, so the four cannot disagree (keksdose dev#546 round 3: the header is a\n * string and must say what the card says).\n */\nexport type FeedbackRenderDate = (iso: string) => string;\n\n/** The kit's own date, weekday included: \"Sun, 4 Oct 2026\" / \"So., 4. Okt. 2026\". A date\n * in a column carries its weekday (keksdose's rule, date-cell.tsx). */\nconst FEEDBACK_DATE_STYLE: Intl.DateTimeFormatOptions = {\n weekday: \"short\",\n day: \"numeric\",\n month: \"short\",\n year: \"numeric\",\n};\n\n/**\n * `renderDate` when the app gave one, else the kit's: the `<UiKitProvider formatDate>`\n * when the app set one (called with the LOCAL calendar day and `weekday: true`, as\n * `DateMark` calls it), else `Intl` in the provider's locale with the weekday. An\n * unparseable value is passed through rather than hidden.\n */\nexport function useFeedbackRenderDate(renderDate?: FeedbackRenderDate, locale?: string): FeedbackRenderDate {\n const kitLocale = useKitLocale(locale);\n const fromProvider = useKitDateFormatter();\n return useMemo<FeedbackRenderDate>(() => {\n if (renderDate) return renderDate;\n return (iso) => {\n const date = toDate(iso);\n if (!date) return iso || EMPTY_FORMATTED_VALUE;\n const own = fromProvider\n ? fromProvider(toLocalIso(date), { unit: \"day\", source: \"dateMark\", locale: kitLocale, weekday: true })\n : \"\";\n return own || formatDate(date, FEEDBACK_DATE_STYLE, { locale: kitLocale });\n };\n }, [renderDate, fromProvider, kitLocale]);\n}\n\n/** A date in a cell: `<time>`, nowrap, tabular figures; \"—\" when there is none. */\nfunction FeedbackDate({ value, renderDate }: { value: string | null | undefined; renderDate: FeedbackRenderDate }) {\n if (!value) return <span className=\"text-placeholder\">{EMPTY_FORMATTED_VALUE}</span>;\n return (\n <time dateTime={value} className=\"whitespace-nowrap tabular-nums text-muted\">\n {renderDate(value)}\n </time>\n );\n}\n\n/** An instant for sorting; a value that does not parse sorts with the empty ones. */\nfunction instant(value: string | null | undefined): number | null {\n const ms = value ? Date.parse(value) : NaN;\n return Number.isNaN(ms) ? null : ms;\n}\n\n/* ── The subject: title + environment chip + rework chip ───────────────────── */\n\nexport interface FeedbackSubjectProps {\n /** `replies` (0.40): the chip counts the rework entries, else the body's blocks —\n * {@link feedbackReworkCount}. */\n row: Pick<FeedbackRecord, \"title\" | \"body\" | \"context\"> & Partial<Pick<FeedbackRecord, \"replies\">>;\n /**\n * `false` (default): one line — the title truncates and the chips stay whole, as a\n * table cell wants. `true`: the title wraps and the chips flow after its last word, as\n * the phone card wants (a phone shows the whole title or nothing useful).\n */\n wrap?: boolean;\n /** Over the `feedbackPage` namespace. */\n labels?: LabelOverride<FeedbackPageLabels>;\n className?: string;\n}\n\n/**\n * A report's title with its two chips (§4.3, column 4): the environment when it is not\n * production (keksdose's amber outline, the top bar's environment badge — the marker the\n * tester saw is the marker triage sees) and **Rework** / **Rework ×n** when the author has\n * sent it back (keksdose live #331: *\"have a new category for items in rework\"*, as a fact\n * derived from the body rather than a seventh status).\n *\n * No tooltip on either chip (keksdose dev#523): each already says what it means.\n */\nexport function FeedbackSubject({ row, wrap = false, labels: labelsProp, className }: FeedbackSubjectProps) {\n const labels = useFeedbackPageLabels(labelsProp);\n const env = feedbackEnvironment(row.context);\n const rounds = feedbackReworkCount(row);\n const chipClass = wrap ? \"ms-1.5 align-middle\" : \"shrink-0\";\n const chips = (\n <>\n {env && (\n <Chip size=\"sm\" variant=\"outline\" shape=\"square\" tone=\"warning\" caps className={chipClass} data-feedback-env=\"\">\n {labels.environment(env)}\n </Chip>\n )}\n {rounds > 0 && (\n <Chip size=\"sm\" tone=\"warning\" caps className={chipClass} data-feedback-rework={rounds}>\n {labels.reworkChip(rounds)}\n </Chip>\n )}\n </>\n );\n if (wrap) {\n return (\n <span className={cn(\"min-w-0 font-medium [overflow-wrap:anywhere]\", className)}>\n {row.title}\n {chips}\n </span>\n );\n }\n return (\n <span className={cn(\"inline-flex min-w-0 max-w-full items-center gap-1.5 large:items-start\", className)}>\n {/* One line at Normal; from Large up the title wraps rather than losing its end (text\n size §10.17 — the release sweep's first CI run found it cut on the showcase). */}\n <span className=\"min-w-0 truncate-until-large font-medium\">{row.title}</span>\n {chips}\n </span>\n );\n}\n\n/* ── The URL cell ───────────────────────────────────────────────────────────── */\n\n/**\n * The page a report was filed from, as a link — the cell keksdose's column 7 draws\n * (:850): the path as text, path + query + hash as the `href`, read from `context.url`\n * else `context.route` by the row detail's own readers (`feedbackPagePath` /\n * `feedbackPageHref`, feedback-row-detail.tsx), so the column and the detail link the\n * same page the same way. A real link through the `<UiKitProvider linkComponent>` (the app's router, so it\n * does not reload the app; keksdose's plain `<a>` did), and its click stops at the cell so\n * the row does not open as well.\n *\n * Its name is the path, as on screen, with \"Open page\" said before it — keksdose's\n * `aria-label=\"Open page\"` replaced the path, so a screen reader heard forty identical\n * links down the column.\n */\nfunction FeedbackPageLinkCell({ context, openPage }: { context: FeedbackContext | null; openPage: string }) {\n const kitLink = useKitLink();\n const href = feedbackPageHref(context);\n const path = feedbackPagePath(context);\n if (!href || !path) return <span className=\"text-placeholder\">{EMPTY_FORMATTED_VALUE}</span>;\n const className =\n \"inline-flex min-w-0 max-w-full items-center gap-1 text-secondary hover:text-primary hover:underline\";\n const children = (\n <>\n {/* The space outside the hidden span: a flex container drops it from the layout,\n and the accessible name keeps it (\"Open page /accounts\"). */}\n <span className=\"sr-only\">{openPage}</span>{\" \"}\n <code className=\"min-w-0 truncate text-xs\">{path}</code>\n <ExternalLink className=\"size-3 shrink-0\" aria-hidden />\n </>\n );\n const onClick = (event: MouseEvent<HTMLAnchorElement>) => event.stopPropagation();\n const render = pickLinkRenderer<KitLinkProps>(undefined, kitLink, href);\n return render ? (\n <RenderedLink render={render} href={href} className={className} onClick={onClick}>\n {children}\n </RenderedLink>\n ) : (\n <a href={href} className={className} onClick={onClick}>\n {children}\n </a>\n );\n}\n\n/** The provider's link, drawn by a component declared once (as FloatingAction's). */\nfunction RenderedLink({ render, ...props }: KitLinkProps & { render: (props: KitLinkProps) => ReactElement }) {\n return render(props);\n}\n\n/* ── The columns ────────────────────────────────────────────────────────────── */\n\n/** What {@link feedbackColumns} takes — every word already resolved (see\n * {@link useFeedbackColumns}, which resolves them from the provider). */\nexport interface FeedbackColumnsOptions {\n /** `/my-feedback`. The same nine columns (one page component, §4.3), but the status\n * cell is read-only there whatever `canEdit` says — \"no status or outcome editing\n * there (also for an admin)\". */\n mine?: boolean;\n /** The admin on `/feedback` — the status cell offers its steps. Otherwise it shows them\n * read-only. */\n canEdit: boolean;\n /** The undoable status change, `useFeedbackStatusUndo(update.mutate)` (§4.5) — the\n * same one the row detail and the swipes use. */\n onStatus: FeedbackStatusChange;\n /** See {@link FeedbackRenderDate}. */\n renderDate: FeedbackRenderDate;\n /** The status buttons SAVE when pressed: pass `true` to put them under the page's\n * `WriteLockProvider` (FeedbackStatusTransitions' `commit`). Off by default — a\n * feedback inbox is rarely what an app's lock is about. */\n commit?: CommitScope;\n labels: FeedbackPageLabels;\n statusLabels: FeedbackStatusLabels;\n categoryLabels: FeedbackCategoryLabels;\n /** 0.38 (§9.6): a sortable **Votes** column before Status — `row.votes`, a missing\n * one as 0 — hidden on the phone (the card's chip, {@link FeedbackMobileCardProps.votes},\n * carries it there). Off by default. */\n votes?: boolean;\n /** The Votes header — `feedbackPublic.columnVotes`, so the inbox and the public list\n * say the same ({@link useFeedbackColumns} reads it). Default \"Votes\". */\n votesHeader?: string;\n}\n\n/** The vote count, a quiet chip with the thumb (§9.6) — the Votes cell and the card's. */\nfunction FeedbackVoteCount({ votes, className }: { votes: number | undefined; className?: string }) {\n return (\n <Chip size=\"sm\" className={className} data-feedback-vote-count={votes ?? 0}>\n <ThumbsUp className=\"size-3\" aria-hidden />\n <span className=\"tabular-nums\">{votes ?? 0}</span>\n </Chip>\n );\n}\n\n/** A status's place in the chain, unknown ones last (as `feedbackCategoryRank`). */\nfunction statusRank(status: FeedbackStatus): number {\n const at = FEEDBACK_STATUS_ORDER.indexOf(status);\n return at === -1 ? FEEDBACK_STATUS_ORDER.length : at;\n}\n\n/**\n * The nine columns of §4.3, in the contract's order, for `DataTable` — keksdose's\n * (:711–963) with the contract's changes:\n *\n * | # | key | cell | filter | phone |\n * |---|---|---|---|---|\n * | 1 | `id` | id, mono | number | hidden |\n * | 2 | `date` | `created_at`, weekday ({@link FeedbackRenderDate}) | date | |\n * | 3 | `category` | `FeedbackCategoryBadge`, sorted CRASH first | select, all five | |\n * | 4 | `title` | {@link FeedbackSubject} | text: title + environment | card heading |\n * | 5 | `user` | {@link feedbackSubmitter} | text: name + email, or \"deleted user\" | |\n * | 6 | `email` | {@link feedbackSubmitterEmail} | text | hidden |\n * | 7 | `url` | the page, a link (`noRowLink`) | text: path | hidden |\n * | 8 | `status` | `FeedbackStatusTransitions variant=\"icon\"`, `visibleFeedbackStatuses` | select, chain order | |\n * | 9 | `resolved` | `resolved_at` | date | hidden |\n *\n * - Both select filters list the WHOLE vocabulary in its own order, translated —\n * without `options` the popover lists the bare enum values found in the rows\n * (keksdose feedback #160), and kastlan's first CRASH row would otherwise appear in a\n * filter that never offered it.\n * - The status column owns the status filter, and only it (keksdose live #330's revert:\n * the phone's filter sheet already exposes every column filter).\n * - `/my-feedback` shows the same nine: the Email cell's context fallback exists for it\n * (the admin list's join is absent there, §3.1), and its phone card drops the submitter\n * instead ({@link FeedbackMobileCardProps.showSubmitter}).\n *\n * Pure: hand it resolved words, or use {@link useFeedbackColumns}. Keys are stable, so\n * an app may drop or add a column (`columns.filter((c) => c.key !== \"email\")`).\n */\nexport function feedbackColumns<T extends FeedbackTableRow>({\n mine = false,\n canEdit,\n onStatus,\n renderDate,\n commit,\n labels,\n statusLabels,\n categoryLabels,\n votes = false,\n votesHeader = DEFAULT_FEEDBACK_PUBLIC_LABELS.columnVotes,\n}: FeedbackColumnsOptions): DataTableColumn<T>[] {\n const editable = canEdit && !mine;\n const votesColumn: DataTableColumn<T>[] = votes\n ? [\n {\n key: \"votes\",\n header: votesHeader,\n className: \"whitespace-nowrap\",\n cell: (row) => <FeedbackVoteCount votes={row.votes ?? undefined} />,\n sortBy: (row) => row.votes ?? 0,\n filter: { type: \"number\", getValue: (row) => row.votes ?? 0 },\n mobileHidden: true,\n },\n ]\n : [];\n return [\n {\n key: \"id\",\n header: labels.columnId,\n cell: (row) => <span className=\"font-mono text-xs text-muted\">{row.id}</span>,\n sortBy: (row) => row.id,\n filter: { type: \"number\", getValue: (row) => row.id },\n mobileHidden: true,\n },\n {\n key: \"date\",\n header: labels.columnDate,\n cell: (row) => <FeedbackDate value={row.created_at} renderDate={renderDate} />,\n sortBy: (row) => instant(row.created_at),\n filter: { type: \"date\", getValue: (row) => row.created_at },\n },\n {\n key: \"category\",\n header: labels.columnCategory,\n cell: (row) => <FeedbackCategoryBadge category={row.category} label={categoryLabels[row.category]} />,\n sortBy: (row) => feedbackCategoryRank(row.category),\n filter: {\n type: \"select\",\n getValue: (row) => row.category,\n options: FEEDBACK_CATEGORY_ORDER.map((value) => ({ value, label: categoryLabels[value] })),\n },\n },\n {\n key: \"title\",\n header: labels.columnSubject,\n cell: (row) => <FeedbackSubject row={row} labels={labels} />,\n sortBy: (row) => row.title,\n // Searchable by the environment too, so \"dev\" narrows to the test copy's reports —\n // a chip you can see but not filter by makes you read every row (keksdose :804).\n filterBy: (row) => {\n const env = feedbackEnvironment(row.context);\n return env ? `${row.title} ${labels.environment(env)}` : row.title;\n },\n mobilePrimary: true,\n },\n {\n key: \"user\",\n header: labels.columnUser,\n cell: (row) => <span className=\"text-secondary\">{feedbackSubmitter(row, labels)}</span>,\n sortBy: (row) => feedbackSubmitter(row, labels),\n // Name AND email, so either finds the person; the erased ones by the placeholder\n // (their context holds no name any more).\n filterBy: (row) =>\n row.user_id == null\n ? labels.deletedUser\n : `${feedbackSubmitter(row, labels)} ${feedbackSubmitterEmail(row)}`,\n },\n {\n key: \"email\",\n header: labels.columnEmail,\n // One line, like the URL beside it: keksdose's `break-all` let the browser squeeze\n // the column to its header and broke every address in two (\"user@exam / ple.test\"),\n // which made every row taller. Unbroken, a resized (pinned) column ellipsises it.\n className: \"whitespace-nowrap\",\n cell: (row) => {\n const email = feedbackSubmitterEmail(row);\n return email ? (\n <span className=\"text-secondary\">{email}</span>\n ) : (\n <span className=\"text-placeholder\">{EMPTY_FORMATTED_VALUE}</span>\n );\n },\n sortBy: feedbackSubmitterEmail,\n filterBy: feedbackSubmitterEmail,\n mobileHidden: true,\n },\n {\n key: \"url\",\n header: labels.columnUrl,\n // A cell only ellipsises what it is told not to wrap (keksdose live #348: the path\n // clipped mid-character \"behind the next column\").\n className: \"whitespace-nowrap\",\n // The cell IS a link, so the row's own permalink must never wrap it (keksdose\n // feedback #451: <a> in <a>, and \"open the page\" silently did nothing).\n noRowLink: true,\n cell: (row) => <FeedbackPageLinkCell context={row.context} openPage={labels.openPage} />,\n sortBy: (row) => feedbackPagePath(row.context) ?? \"\",\n filterBy: (row) => feedbackPagePath(row.context) ?? \"\",\n mobileHidden: true,\n },\n ...votesColumn,\n {\n key: \"status\",\n header: labels.columnStatus,\n // A KNOWN width: at most six 28px icon buttons (from IN_PROGRESS or IN_EVALUATION:\n // one step either way and the three off the chain) — keksdose live #348 sized it\n // for five and the sixth pushed the column wider.\n className: \"w-[13.5rem] whitespace-nowrap\",\n cell: (row) => (\n <FeedbackStatusTransitions\n status={row.status}\n statuses={visibleFeedbackStatuses(row.status)}\n canEdit={editable}\n commit={commit}\n onPick={(status) => onStatus(row, status)}\n variant=\"icon\"\n label={(status) => statusLabels[status]}\n />\n ),\n sortBy: (row) => statusRank(row.status),\n filter: {\n type: \"select\",\n getValue: (row) => row.status,\n options: FEEDBACK_STATUS_ORDER.map((value) => ({ value, label: statusLabels[value] })),\n },\n },\n {\n key: \"resolved\",\n header: labels.columnResolved,\n cell: (row) => <FeedbackDate value={row.resolved_at} renderDate={renderDate} />,\n sortBy: (row) => instant(row.resolved_at),\n filter: { type: \"date\", getValue: (row) => row.resolved_at },\n mobileHidden: true,\n },\n ];\n}\n\n/** What {@link useFeedbackColumns} takes: {@link FeedbackColumnsOptions} with the words\n * read from the provider, and `renderDate` optional. */\nexport interface UseFeedbackColumnsOptions\n extends Omit<FeedbackColumnsOptions, \"renderDate\" | \"labels\" | \"statusLabels\" | \"categoryLabels\" | \"votesHeader\"> {\n /** Default: the kit's date with the weekday ({@link useFeedbackRenderDate}). */\n renderDate?: FeedbackRenderDate;\n /** Over the `feedbackPage` namespace. Keep it stable (module scope or memoised): it is\n * a dependency of the memo. */\n labels?: LabelOverride<FeedbackPageLabels>;\n}\n\n/**\n * {@link feedbackColumns} with the `feedbackPage`, `feedbackStatus` and\n * `feedbackCategory` words from the provider, memoised on what it reads — pass\n * `update.mutate` through `useFeedbackStatusUndo` (stable) rather than a fresh function\n * per render, or every row's columns are rebuilt on each render (keksdose :667).\n */\nexport function useFeedbackColumns<T extends FeedbackTableRow>({\n mine,\n canEdit,\n onStatus,\n renderDate: renderDateProp,\n commit,\n votes,\n labels: labelsProp,\n}: UseFeedbackColumnsOptions): DataTableColumn<T>[] {\n const labels = useFeedbackPageLabels(labelsProp);\n const statusLabels = useFeedbackStatusLabels();\n const categoryLabels = useFeedbackCategoryLabels();\n const votesHeader = useKitLabels(\"feedbackPublic\", DEFAULT_FEEDBACK_PUBLIC_LABELS).columnVotes;\n const renderDate = useFeedbackRenderDate(renderDateProp);\n return useMemo(\n () =>\n feedbackColumns<T>({\n mine,\n canEdit,\n onStatus,\n renderDate,\n commit,\n labels,\n statusLabels,\n categoryLabels,\n votes,\n votesHeader,\n }),\n [mine, canEdit, onStatus, renderDate, commit, labels, statusLabels, categoryLabels, votes, votesHeader],\n );\n}\n\n/* ── The phone ──────────────────────────────────────────────────────────────── */\n\n/**\n * The phone list's day headers (keksdose feedback #325: the list \"grouped by date, like\n * the transactions list\"): `DataTable mobileGroupBy={feedbackMobileGroupBy(renderDate)}`.\n *\n * The key IS the header — the same string the card's date says. DataTable groups runs of\n * equal keys, so the rows must come newest first, as `GET /feedback` and\n * `GET /feedback/my` send them (§3.3).\n */\nexport function feedbackMobileGroupBy(\n renderDate: FeedbackRenderDate,\n): (row: Pick<FeedbackRecord, \"created_at\">) => string {\n return (row) => renderDate(row.created_at);\n}\n\nexport interface FeedbackMobileCardProps {\n row: FeedbackTableRow;\n /** Add the submitter after the date — the admin inbox (`canEdit`). On `/my-feedback`\n * every row is the viewer's own and the name would repeat down the list. */\n showSubmitter?: boolean;\n /** See {@link FeedbackRenderDate}; the same function as the columns' and the day\n * headers'. Default: the kit's ({@link useFeedbackRenderDate}). */\n renderDate?: FeedbackRenderDate;\n /** 0.38: the vote count as a chip beside the category — with `useFeedbackColumns`'\n * `votes`, whose column the phone hides. */\n votes?: boolean;\n /** Over the `feedbackPage` namespace. */\n labels?: LabelOverride<FeedbackPageLabels>;\n}\n\n/**\n * One report as a phone card (§4.3; keksdose :1042, feedback #325 rework: *\"compact card\n * instead of a wasteful label/value row per field\"*): the title with its environment and\n * rework chips and the status badge on one line, then the compact category badge, the\n * date and (admin) the submitter beneath.\n *\n * `DataTable mobileCard={(row) => <FeedbackMobileCard row={row} … />}`. It draws the\n * chips itself: with a `mobileCard`, DataTable never renders the `mobilePrimary` cell,\n * which is how keksdose's cards lost them.\n */\nexport function FeedbackMobileCard({\n row,\n showSubmitter = false,\n renderDate: renderDateProp,\n votes = false,\n labels: labelsProp,\n}: FeedbackMobileCardProps) {\n const labels = useFeedbackPageLabels(labelsProp);\n const renderDate = useFeedbackRenderDate(renderDateProp);\n return (\n <div className=\"min-w-0 space-y-1\">\n <div className=\"flex items-start justify-between gap-2\">\n <FeedbackSubject row={row} wrap labels={labels} className=\"flex-1\" />\n {/* The pill the desktop status column draws, so a status is the same colour and\n glyph on both layouts. */}\n <FeedbackStatusBadge status={row.status} className=\"shrink-0\" />\n </div>\n <div className=\"flex min-w-0 flex-wrap items-center gap-x-2 gap-y-0.5 text-xs text-muted\">\n <FeedbackCategoryBadge category={row.category} compact />\n {votes && <FeedbackVoteCount votes={row.votes ?? undefined} />}\n <FeedbackDate value={row.created_at} renderDate={renderDate} />\n {showSubmitter && (\n // The short id form: \"#7\" says enough on a card that has room for little.\n <span className=\"min-w-0 truncate\">\n · {feedbackSubmitter(row, { deletedUser: labels.deletedUser, userFallback: (id) => `#${id}` })}\n </span>\n )}\n </div>\n </div>\n );\n}\n\nexport interface FeedbackAwaitingToggleProps {\n /** Narrowed to what waits on the triager. Page state, not the URL (keksdose :699): a\n * thumb gesture on one screen, not a view worth linking to. */\n pressed: boolean;\n onPressedChange: (pressed: boolean) => void;\n /** Further `FloatingAction`s, after the toggle — the group is what makes them free. */\n children?: ReactNode;\n /** Default `bottom-end`, the register's corner. */\n corner?: FloatingCorner;\n /** Over the group's default distance from the bottom. */\n offset?: string;\n /** On the group. It is `md:hidden` already: the desktop has the status column's\n * filter, the same question asked where there is room for it. */\n className?: string;\n /** Over the `feedbackPage` namespace. */\n labels?: LabelOverride<FeedbackPageLabels>;\n}\n\n/**\n * The phone inbox's one filter button — **\"Only what is waiting for you\"** (§4.3;\n * keksdose live #330 rework: *\"a button that toggles the evaluation items (in evaluation,\n * test when live) as toggle button similar to the show/hide upcoming/scheduled for the tx\n * page\"*).\n *\n * It narrows TO `FEEDBACK_AWAITING_STATUSES` rather than hiding them: after a loop run\n * those ARE the queue — the rows handed back for a verdict — and everything else is\n * history. A `FloatingActionGroup` with one member anyway, in the register's corner and\n * shape (keksdose feedback #58), so a second action costs nothing; the glyph is\n * IN_EVALUATION's own, so the button reads in the vocabulary of the badges it filters on.\n *\n * Admin inbox only: on `/my-feedback` the author is not waiting on their own verdict.\n * The filtering is the page's — `rows.filter((r) => isFeedbackAwaiting(r.status))` —\n * so the table's own filters, sort and URL stay untouched.\n */\nexport function FeedbackAwaitingToggle({\n pressed,\n onPressedChange,\n children,\n corner,\n offset,\n className,\n labels: labelsProp,\n}: FeedbackAwaitingToggleProps) {\n const labels = useFeedbackPageLabels(labelsProp);\n const Icon = FEEDBACK_STATUS_META.IN_EVALUATION.icon;\n return (\n <FloatingActionGroup\n aria-label={labels.phoneActions}\n corner={corner}\n offset={offset}\n className={cn(\"md:hidden\", className)}\n >\n <FloatingAction\n label={labels.awaitingFilter}\n icon={<Icon aria-hidden />}\n pressed={pressed}\n onClick={() => onPressedChange(!pressed)}\n />\n {children}\n </FloatingActionGroup>\n );\n}\n\n/* ── Empty ──────────────────────────────────────────────────────────────────── */\n\nexport interface FeedbackEmptyStateProps {\n /** Over the `feedbackPage` namespace. */\n labels?: LabelOverride<FeedbackPageLabels>;\n}\n\n/**\n * The table with nothing to show (§7.13): the one word **None** / **Keine**, on both\n * pages — keksdose's `empty={t(\"common.none\")}` (`feedback-page.tsx:982`). No hint\n * beneath it: where reports are sent from is the feedback menu's business, and the inbox\n * needs no sentence to say it is empty.\n *\n * For `DataTable empty`, which sits in a centred, muted cell — so no box of its own.\n * keksdose passes it unconditionally, so a filter (or the awaiting toggle) that leaves\n * nothing says \"None\" too: `empty={<FeedbackEmptyState />}`.\n */\nexport function FeedbackEmptyState({ labels: labelsProp }: FeedbackEmptyStateProps) {\n const labels = useFeedbackPageLabels(labelsProp);\n return <span data-feedback-empty=\"\">{labels.empty}</span>;\n}\n"],"mappings":";AA8PqB,SA8CjB,UA9CiB,KA8CjB,YA9CiB;AA9PrB,SAAS,eAAe;AAExB,SAAS,cAAc,gBAAgB;AACvC,SAAS,U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kB,OAAO,IAAI,SAAS,QAAW;AAAA,MAC5D,oBAAC,gBAAa,OAAO,IAAI,YAAY,YAAwB;AAAA,MAC5D;AAAA,MAEC,qBAAC,UAAK,WAAU,oBAAmB;AAAA;AAAA,QAC9B,kBAAkB,KAAK,EAAE,aAAa,OAAO,aAAa,cAAc,CAAC,OAAO,IAAI,EAAE,GAAG,CAAC;AAAA,SAC/F;AAAA,OAEJ;AAAA,KACF;AAEJ;AAoCO,SAAS,uBAAuB;AAAA,EACrC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,QAAQ;AACV,GAAgC;AAC9B,QAAM,SAAS,sBAAsB,UAAU;AAC/C,QAAM,OAAO,qBAAqB,cAAc;AAChD,SACE;AAAA,IAAC;AAAA;AAAA,MACC,cAAY,OAAO;AAAA,MACnB;AAAA,MACA;AAAA,MACA,WAAW,GAAG,aAAa,SAAS;AAAA,MAEpC;AAAA;AAAA,UAAC;AAAA;AAAA,YACC,OAAO,OAAO;AAAA,YACd,MAAM,oBAAC,QAAK,eAAW,MAAC;AAAA,YACxB;AAAA,YACA,SAAS,MAAM,gBAAgB,CAAC,OAAO;AAAA;AAAA,QACzC;AAAA,QACC;AAAA;AAAA;AAAA,EACH;AAEJ;AAmBO,SAAS,mBAAmB,EAAE,QAAQ,WAAW,GAA4B;AAClF,QAAM,SAAS,sBAAsB,UAAU;AAC/C,SAAO,oBAAC,UAAK,uBAAoB,IAAI,iBAAO,OAAM;AACpD;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../src/feedback/feedback-table.tsx"],"sourcesContent":["import { useMemo } from \"react\";\nimport type { MouseEvent, ReactElement, ReactNode } from \"react\";\nimport { ExternalLink, ThumbsUp } from \"lucide-react\";\nimport { cn } from \"../lib/cn\";\nimport { toLocalIso } from \"../lib/dates\";\nimport { EMPTY_FORMATTED_VALUE, formatDate, toDate } from \"../lib/format\";\nimport { useKitDateFormatter, useKitLabels, useKitLink, useKitLocale, type LabelOverride } from \"../i18n/kit-labels\";\nimport type { KitLinkProps } from \"../i18n/kit-labels\";\nimport { Chip } from \"../components/chip\";\nimport { Tooltip } from \"../components/tooltip\";\nimport { FloatingAction, FloatingActionGroup } from \"../components/floating-panel\";\nimport type { FloatingCorner } from \"../components/floating-panel\";\nimport { pickLinkRenderer } from \"../components/text-link\";\nimport type { DataTableColumn } from \"../components/data-table\";\nimport {\n FEEDBACK_CATEGORY_ORDER,\n FEEDBACK_STATUS_META,\n FEEDBACK_STATUS_ORDER,\n FeedbackCategoryBadge,\n FeedbackStatusBadge,\n FeedbackStatusTransitions,\n feedbackCategoryRank,\n visibleFeedbackStatuses,\n type FeedbackStatus,\n} from \"./feedback-inbox\";\nimport {\n useFeedbackCategoryLabels,\n useFeedbackStatusLabels,\n type FeedbackCategoryLabels,\n type FeedbackStatusLabels,\n} from \"./feedback-labels\";\nimport { FEEDBACK_AWAITING_STATUSES, feedbackReworkCount, type FeedbackContext, type FeedbackRecord } from \"./feedback-record\";\nimport type { FeedbackStatusChange } from \"./feedback-status-undo\";\nimport { feedbackPageHref, feedbackPagePath } from \"./feedback-row-detail\";\nimport type { CommitScope } from \"../components/write-lock\";\nimport { DEFAULT_FEEDBACK_PAGE_LABELS } from \"./feedback-table-labels\";\nimport { DEFAULT_FEEDBACK_PUBLIC_LABELS } from \"./feedback-public-labels\";\n\n/**\n * The two feedback pages' TABLE — `/feedback` (the admin inbox) and `/my-feedback` (the\n * user's own) — as the kit's parts: §4.3 of the feedback contract\n * (docs/feedback-harmonization.md), lifted from keksdose\n * `frontend/src/features/feedback/feedback-page.tsx` (columns :711–963, the phone card\n * :1038–1065, the awaiting toggle :689–709 and :1086–1101).\n *\n * Until 0.27 each app wrote this table itself, and the three had drifted exactly where a\n * table drifts: kastlan's showed five statuses and no environment, Kurvenschmiede's one\n * page served both audiences, and keksdose's — the canon, argued over a year of feedback\n * items — had a latent bug of its own: its subject cell carries the environment and\n * rework chips \"so a second attempt is marked on every surface at once\" (:760), but the\n * phone card is a `mobileCard`, and `DataTable` never renders the `mobilePrimary` cell\n * when `mobileCard` is set (data-table-mobile.tsx, `cardInner`). Its phone cards showed neither\n * chip. {@link FeedbackMobileCard} draws both itself, from the same\n * {@link FeedbackSubject} the column uses, so the two surfaces cannot part again.\n *\n * What stays the app's: the rows (its API client), who is an admin, the routes and the\n * `/feedback` → `/my-feedback` redirect, the `?row=` deep link and the row detail. What\n * is here: the nine columns ({@link feedbackColumns} / {@link useFeedbackColumns}), the\n * phone card and its day headers ({@link FeedbackMobileCard},\n * {@link feedbackMobileGroupBy}), the phone's \"Only what is waiting for you\" toggle\n * ({@link FeedbackAwaitingToggle}), the empty state ({@link FeedbackEmptyState}) and the\n * `feedbackPage` words. The swipes are `feedbackSwipePlan` (feedback-swipe.tsx), passed\n * by the app because whether the page may write is the app's call.\n */\n\n/* ── Labels ─────────────────────────────────────────────────────────────────── */\n\n/**\n * `feedbackPage` — the words of the two feedback pages (§4.3). The English is keksdose's\n * `en.json` (`feedback.*`, `common.none`); the de-CH canon is noted on each key (keksdose\n * `de-CH.json`, ss never ß).\n */\nexport interface FeedbackPageLabels {\n /** The admin inbox's page title, `/feedback` — the menu's \"Feedback inbox\" (0.40,\n * §10.2 decision 11; \"Feedback\" before). de-CH: \"Feedback-Eingang\" */\n title: string;\n /** The user's own list, `/my-feedback`. de-CH: \"Mein Feedback\" */\n myTitle: string;\n /** Column 1, the id. de-CH: \"#\" */\n columnId: string;\n /** Column 2, when it was filed. de-CH: \"Datum\" */\n columnDate: string;\n /** Column 3. de-CH: \"Kategorie\" */\n columnCategory: string;\n /** Column 4, the title with its chips. de-CH: \"Betreff\" */\n columnSubject: string;\n /** Column 5, who filed it. de-CH: \"Nutzer\" */\n columnUser: string;\n /** Column 6. de-CH: \"E-Mail\" */\n columnEmail: string;\n /** Column 7, the page it was filed from. de-CH: \"URL\" */\n columnUrl: string;\n /** Column 8. de-CH: \"Status\" */\n columnStatus: string;\n /** Column 9, when it was settled. de-CH: \"Erledigt am\" */\n columnResolved: string;\n /** What the URL cell's link does, said before the path to a screen reader.\n * de-CH: \"Seite öffnen\" */\n openPage: string;\n /** The table with nothing to show, on both pages (§7.13) — keksdose's `common.none`.\n * de-CH: \"Keine\" */\n empty: string;\n /** The submitter of a report whose account was erased (`user_id: null`, keksdose live\n * #275). de-CH: \"<gelöschter Nutzer>\" */\n deletedUser: string;\n /** The submitter when neither a name nor an email is known — `id` is `user_id`.\n * de-CH: \"Nutzer #{{id}}\" */\n userFallback: (id: number) => string;\n /** The chip for a report filed from a copy of the app that is not production —\n * `environment` is `context.environment` as filed (\"dev\", \"local\", or the app's own\n * word). Upper-cased like the top bar's environment badge, so the marker the tester saw\n * is the marker triage sees. Guarded: a context is untyped JSON, so a value that is no\n * string (an app calling it with `context.environment` as stored) is printed, never\n * thrown on. de-CH: the same. */\n environment: (environment: string) => string;\n /** The chip for a report sent back for rework — `count` ≥ 1 is how many times\n * (`reworkCount`, keksdose live #331). de-CH: \"Nacharbeit\" / \"Nacharbeit ×{{count}}\" */\n reworkChip: (count: number) => string;\n /** The phone toggle narrowing the inbox to IN_EVALUATION + NEEDS_LIVE_TEST.\n * de-CH: \"Nur was auf Sie wartet\" */\n awaitingFilter: string;\n /** The name of the phone's floating group that holds it. de-CH: \"Feedback-Aktionen\" */\n phoneActions: string;\n}\n\n// Defined in ./feedback-table-labels, which holds no component code (0.34, KS U8).\nexport { DEFAULT_FEEDBACK_PAGE_LABELS };\n\n/** `feedbackPage` resolved: English, then `<UiKitProvider labels>`, then `labels`. The\n * page's title comes from here too: `mine ? labels.myTitle : labels.title`. */\nexport function useFeedbackPageLabels(labels?: LabelOverride<FeedbackPageLabels>): FeedbackPageLabels {\n return useKitLabels(\"feedbackPage\", DEFAULT_FEEDBACK_PAGE_LABELS, labels);\n}\n\n/* ── Reading a row ──────────────────────────────────────────────────────────── */\n\n/** What the table reads off a report — {@link FeedbackRecord}'s fields, so an app's own\n * row type with more of them passes as it is. */\nexport type FeedbackTableRow = Pick<\n FeedbackRecord,\n | \"id\"\n | \"user_id\"\n | \"user_email\"\n | \"title\"\n | \"body\"\n | \"category\"\n | \"status\"\n | \"context\"\n | \"resolved_at\"\n | \"created_at\"\n | \"votes\"\n>;\n\n/** A context value as a trimmed string, or `\"\"` — every key is optional on read (§3.2)\n * and an app's own context type may say `unknown`. */\nfunction text(value: unknown): string {\n return typeof value === \"string\" ? value.trim() : \"\";\n}\n\n/**\n * The environment a report was filed from when it is NOT production, as filed — or\n * `null` (keksdose `environmentLabel`, :142). Production is silent, as the top bar's\n * badge is: the marker earns attention by being rare. A missing value is production too —\n * every row filed before a test copy existed, and crash rows filed before the crash\n * payload carried `environment` (§3.2, §3.6). An unknown value is shown rather than swallowed: an environment\n * nobody recognises is exactly when triage needs to see one.\n */\nexport function feedbackEnvironment(context: FeedbackContext | null | undefined): string | null {\n const env = text(context?.environment);\n return !env || env.toLowerCase() === \"prod\" ? null : env;\n}\n\n/**\n * Who filed a report, as one string (keksdose `submitterLabel`, :163): the display name,\n * else the email, else `userFallback(user_id)`. An erased account (`user_id: null`) is\n * `deletedUser` FIRST, ahead of the context: the server scrubs the name with the account,\n * but a row that somehow kept one must still not go on naming somebody who asked to be\n * forgotten. The joined `user_email` (admin list) is preferred to the context snapshot.\n */\nexport function feedbackSubmitter(\n row: Pick<FeedbackRecord, \"user_id\" | \"user_email\" | \"context\">,\n labels: Pick<FeedbackPageLabels, \"deletedUser\" | \"userFallback\">,\n): string {\n if (row.user_id == null) return labels.deletedUser;\n return (\n text(row.context?.user_display_name) ||\n text(row.user_email) ||\n text(row.context?.user_email) ||\n labels.userFallback(row.user_id)\n );\n}\n\n/**\n * The submitter's email (keksdose `submitterEmail`, :175): the joined `user_email` —\n * authoritative, the display name is self-chosen (feedback #108) — else the context\n * snapshot, which is what `/my-feedback` has (`GET /feedback/my` sends no join). `\"\"`\n * for an erased account, for the reason {@link feedbackSubmitter} gives.\n */\nexport function feedbackSubmitterEmail(row: Pick<FeedbackRecord, \"user_id\" | \"user_email\" | \"context\">): string {\n if (row.user_id == null) return \"\";\n return text(row.user_email) || text(row.context?.user_email);\n}\n\n/** Whether a status is one the phone's awaiting toggle keeps — `FEEDBACK_AWAITING_STATUSES`,\n * the two that wait on the person triaging. `rows.filter((r) => isFeedbackAwaiting(r.status))`. */\nexport function isFeedbackAwaiting(status: FeedbackStatus): boolean {\n return FEEDBACK_AWAITING_STATUSES.includes(status);\n}\n\n/* ── Dates ──────────────────────────────────────────────────────────────────── */\n\n/**\n * How the pages write a date: an ISO timestamp in, one string out. keksdose passes its\n * `useDateCell()` (the app's date-format preference, weekday and all — dev#546), which\n * fits as it is.\n *\n * ONE function for the date column, the resolved column, the phone card and the phone's\n * day headers, so the four cannot disagree (keksdose dev#546 round 3: the header is a\n * string and must say what the card says).\n */\nexport type FeedbackRenderDate = (iso: string) => string;\n\n/** The kit's own date, weekday included: \"Sun, 4 Oct 2026\" / \"So., 4. Okt. 2026\". A date\n * in a column carries its weekday (keksdose's rule, date-cell.tsx). */\nconst FEEDBACK_DATE_STYLE: Intl.DateTimeFormatOptions = {\n weekday: \"short\",\n day: \"numeric\",\n month: \"short\",\n year: \"numeric\",\n};\n\n/**\n * `renderDate` when the app gave one, else the kit's: the `<UiKitProvider formatDate>`\n * when the app set one (called with the LOCAL calendar day and `weekday: true`, as\n * `DateMark` calls it), else `Intl` in the provider's locale with the weekday. An\n * unparseable value is passed through rather than hidden.\n */\nexport function useFeedbackRenderDate(renderDate?: FeedbackRenderDate, locale?: string): FeedbackRenderDate {\n const kitLocale = useKitLocale(locale);\n const fromProvider = useKitDateFormatter();\n return useMemo<FeedbackRenderDate>(() => {\n if (renderDate) return renderDate;\n return (iso) => {\n const date = toDate(iso);\n if (!date) return iso || EMPTY_FORMATTED_VALUE;\n const own = fromProvider\n ? fromProvider(toLocalIso(date), { unit: \"day\", source: \"dateMark\", locale: kitLocale, weekday: true })\n : \"\";\n return own || formatDate(date, FEEDBACK_DATE_STYLE, { locale: kitLocale });\n };\n }, [renderDate, fromProvider, kitLocale]);\n}\n\n/** A date in a cell: `<time>`, nowrap, tabular figures; \"—\" when there is none. */\nfunction FeedbackDate({ value, renderDate }: { value: string | null | undefined; renderDate: FeedbackRenderDate }) {\n if (!value) return <span className=\"text-placeholder\">{EMPTY_FORMATTED_VALUE}</span>;\n return (\n <time dateTime={value} className=\"whitespace-nowrap tabular-nums text-muted\">\n {renderDate(value)}\n </time>\n );\n}\n\n/** An instant for sorting; a value that does not parse sorts with the empty ones. */\nfunction instant(value: string | null | undefined): number | null {\n const ms = value ? Date.parse(value) : NaN;\n return Number.isNaN(ms) ? null : ms;\n}\n\n/* ── The subject: title + environment chip + rework chip ───────────────────── */\n\nexport interface FeedbackSubjectProps {\n /** `replies` (0.40): the chip counts the rework entries, else the body's blocks —\n * {@link feedbackReworkCount}. */\n row: Pick<FeedbackRecord, \"title\" | \"body\" | \"context\"> & Partial<Pick<FeedbackRecord, \"replies\">>;\n /**\n * `false` (default): one line — the title truncates and the chips stay whole, as a\n * table cell wants. `true`: the title wraps and the chips flow after its last word, as\n * the phone card wants (a phone shows the whole title or nothing useful).\n */\n wrap?: boolean;\n /** Over the `feedbackPage` namespace. */\n labels?: LabelOverride<FeedbackPageLabels>;\n className?: string;\n}\n\n/**\n * A report's title with its two chips (§4.3, column 4): the environment when it is not\n * production (keksdose's amber outline, the top bar's environment badge — the marker the\n * tester saw is the marker triage sees) and **Rework** / **Rework ×n** when the author has\n * sent it back (keksdose live #331: *\"have a new category for items in rework\"*, as a fact\n * derived from the body rather than a seventh status).\n *\n * No tooltip on either chip (keksdose dev#523): each already says what it means.\n */\nexport function FeedbackSubject({ row, wrap = false, labels: labelsProp, className }: FeedbackSubjectProps) {\n const labels = useFeedbackPageLabels(labelsProp);\n const env = feedbackEnvironment(row.context);\n const rounds = feedbackReworkCount(row);\n const chipClass = wrap ? \"ms-1.5 align-middle\" : \"shrink-0\";\n const chips = (\n <>\n {env && (\n <Chip size=\"sm\" variant=\"outline\" shape=\"square\" tone=\"warning\" caps className={chipClass} data-feedback-env=\"\">\n {labels.environment(env)}\n </Chip>\n )}\n {rounds > 0 && (\n <Chip size=\"sm\" tone=\"warning\" caps className={chipClass} data-feedback-rework={rounds}>\n {labels.reworkChip(rounds)}\n </Chip>\n )}\n </>\n );\n if (wrap) {\n return (\n <span className={cn(\"min-w-0 font-medium [overflow-wrap:anywhere]\", className)}>\n {row.title}\n {chips}\n </span>\n );\n }\n return (\n <span className={cn(\"inline-flex min-w-0 max-w-full items-center gap-1.5 large:items-start\", className)}>\n {/* One line at Normal; from Large up the title wraps rather than losing its end (text\n size §10.17 — the release sweep's first CI run found it cut on the showcase). */}\n <span className=\"min-w-0 truncate-until-large font-medium\">{row.title}</span>\n {chips}\n </span>\n );\n}\n\n/* ── The URL cell ───────────────────────────────────────────────────────────── */\n\n/**\n * The page a report was filed from, as a link — the cell keksdose's column 7 draws\n * (:850): the path as text, path + query + hash as the `href`, read from `context.url`\n * else `context.route` by the row detail's own readers (`feedbackPagePath` /\n * `feedbackPageHref`, feedback-row-detail.tsx), so the column and the detail link the\n * same page the same way. A real link through the `<UiKitProvider linkComponent>` (the app's router, so it\n * does not reload the app; keksdose's plain `<a>` did), and its click stops at the cell so\n * the row does not open as well.\n *\n * Its name is the path, as on screen, with \"Open page\" said before it — keksdose's\n * `aria-label=\"Open page\"` replaced the path, so a screen reader heard forty identical\n * links down the column.\n */\nfunction FeedbackPageLinkCell({ context, openPage }: { context: FeedbackContext | null; openPage: string }) {\n const kitLink = useKitLink();\n const href = feedbackPageHref(context);\n const path = feedbackPagePath(context);\n if (!href || !path) return <span className=\"text-placeholder\">{EMPTY_FORMATTED_VALUE}</span>;\n const className =\n \"inline-flex min-w-0 max-w-full items-center gap-1 text-secondary hover:text-primary hover:underline\";\n const children = (\n <>\n {/* The space outside the hidden span: a flex container drops it from the layout,\n and the accessible name keeps it (\"Open page /accounts\"). */}\n <span className=\"sr-only\">{openPage}</span>{\" \"}\n <code className=\"min-w-0 truncate text-xs\">{path}</code>\n <ExternalLink className=\"size-3 shrink-0\" aria-hidden />\n </>\n );\n const onClick = (event: MouseEvent<HTMLAnchorElement>) => event.stopPropagation();\n const render = pickLinkRenderer<KitLinkProps>(undefined, kitLink, href);\n return render ? (\n <RenderedLink render={render} href={href} className={className} onClick={onClick}>\n {children}\n </RenderedLink>\n ) : (\n <a href={href} className={className} onClick={onClick}>\n {children}\n </a>\n );\n}\n\n/** The provider's link, drawn by a component declared once (as FloatingAction's). */\nfunction RenderedLink({ render, ...props }: KitLinkProps & { render: (props: KitLinkProps) => ReactElement }) {\n return render(props);\n}\n\n/* ── The columns ────────────────────────────────────────────────────────────── */\n\n/** What {@link feedbackColumns} takes — every word already resolved (see\n * {@link useFeedbackColumns}, which resolves them from the provider). */\nexport interface FeedbackColumnsOptions {\n /** `/my-feedback`. The same nine columns (one page component, §4.3), but the status\n * cell is read-only there whatever `canEdit` says — \"no status or outcome editing\n * there (also for an admin)\". */\n mine?: boolean;\n /** The admin on `/feedback` — the status cell offers its steps. Otherwise it shows them\n * read-only. */\n canEdit: boolean;\n /** The undoable status change, `useFeedbackStatusUndo(update.mutate)` (§4.5) — the\n * same one the row detail and the swipes use. */\n onStatus: FeedbackStatusChange;\n /** See {@link FeedbackRenderDate}. */\n renderDate: FeedbackRenderDate;\n /** The status buttons SAVE when pressed: pass `true` to put them under the page's\n * `WriteLockProvider` (FeedbackStatusTransitions' `commit`). Off by default — a\n * feedback inbox is rarely what an app's lock is about. */\n commit?: CommitScope;\n labels: FeedbackPageLabels;\n statusLabels: FeedbackStatusLabels;\n categoryLabels: FeedbackCategoryLabels;\n /** 0.38 (§9.6): a sortable **Votes** column before Status — `row.votes`, a missing\n * one as 0 — hidden on the phone (the card's chip, {@link FeedbackMobileCardProps.votes},\n * carries it there). Off by default. */\n votes?: boolean;\n /** The Votes header — `feedbackPublic.columnVotes`, so the inbox and the public list\n * say the same ({@link useFeedbackColumns} reads it). Default \"Votes\". */\n votesHeader?: string;\n}\n\n/** The vote count, a quiet chip with the thumb (§9.6) — the Votes cell and the card's. */\nfunction FeedbackVoteCount({ votes, className }: { votes: number | undefined; className?: string }) {\n return (\n <Chip size=\"sm\" className={className} data-feedback-vote-count={votes ?? 0}>\n <ThumbsUp className=\"size-3\" aria-hidden />\n <span className=\"tabular-nums\">{votes ?? 0}</span>\n </Chip>\n );\n}\n\n/** A status's place in the chain, unknown ones last (as `feedbackCategoryRank`). */\nfunction statusRank(status: FeedbackStatus): number {\n const at = FEEDBACK_STATUS_ORDER.indexOf(status);\n return at === -1 ? FEEDBACK_STATUS_ORDER.length : at;\n}\n\n/**\n * The nine columns of §4.3, in the contract's order, for `DataTable` — keksdose's\n * (:711–963) with the contract's changes:\n *\n * | # | key | cell | filter | phone |\n * |---|---|---|---|---|\n * | 1 | `id` | id, mono | number | hidden |\n * | 2 | `date` | `created_at`, weekday ({@link FeedbackRenderDate}) | date | |\n * | 3 | `category` | `FeedbackCategoryBadge`, sorted CRASH first | select, all five | |\n * | 4 | `title` | {@link FeedbackSubject} | text: title + environment | card heading |\n * | 5 | `user` | {@link feedbackSubmitter} | text: name + email, or \"deleted user\" | |\n * | 6 | `email` | {@link feedbackSubmitterEmail} | text | hidden |\n * | 7 | `url` | the page, a link (`noRowLink`) | text: path | hidden |\n * | 8 | `status` | `FeedbackStatusTransitions variant=\"icon\"`, `visibleFeedbackStatuses` | select, chain order | |\n * | 9 | `resolved` | `resolved_at` | date | hidden |\n *\n * - Both select filters list the WHOLE vocabulary in its own order, translated —\n * without `options` the popover lists the bare enum values found in the rows\n * (keksdose feedback #160), and kastlan's first CRASH row would otherwise appear in a\n * filter that never offered it.\n * - The status column owns the status filter, and only it (keksdose live #330's revert:\n * the phone's filter sheet already exposes every column filter).\n * - Fitted to the table's width (0.48, keksdose live #451): Subject `grow`s and\n * ellipsises, and a narrow table leaves out URL, then Email, then Resolved\n * (`fitPriority` 1–3) — the open report repeats all three — then Votes and Category\n * (4, 5) before Subject would drop below 10rem. Drop the two keys with\n * `{ ...col, grow: undefined, fitPriority: undefined }` for the 0.47 layout.\n * - `/my-feedback` shows the same nine: the Email cell's context fallback exists for it\n * (the admin list's join is absent there, §3.1), and its phone card drops the submitter\n * instead ({@link FeedbackMobileCardProps.showSubmitter}).\n *\n * Pure: hand it resolved words, or use {@link useFeedbackColumns}. Keys are stable, so\n * an app may drop or add a column (`columns.filter((c) => c.key !== \"email\")`).\n */\nexport function feedbackColumns<T extends FeedbackTableRow>({\n mine = false,\n canEdit,\n onStatus,\n renderDate,\n commit,\n labels,\n statusLabels,\n categoryLabels,\n votes = false,\n votesHeader = DEFAULT_FEEDBACK_PUBLIC_LABELS.columnVotes,\n}: FeedbackColumnsOptions): DataTableColumn<T>[] {\n const editable = canEdit && !mine;\n const votesColumn: DataTableColumn<T>[] = votes\n ? [\n {\n key: \"votes\",\n header: votesHeader,\n className: \"whitespace-nowrap\",\n cell: (row) => <FeedbackVoteCount votes={row.votes ?? undefined} />,\n sortBy: (row) => row.votes ?? 0,\n filter: { type: \"number\", getValue: (row) => row.votes ?? 0 },\n mobileHidden: true,\n // Fourth to go (Kurvenschmiede S1, 0.48): with only the first three, Subject was\n // crushed to 24px at 1100px. Still reachable from the Columns panel.\n fitPriority: 4,\n },\n ]\n : [];\n return [\n {\n key: \"id\",\n header: labels.columnId,\n cell: (row) => <span className=\"font-mono text-xs text-muted\">{row.id}</span>,\n sortBy: (row) => row.id,\n filter: { type: \"number\", getValue: (row) => row.id },\n mobileHidden: true,\n },\n {\n key: \"date\",\n header: labels.columnDate,\n cell: (row) => <FeedbackDate value={row.created_at} renderDate={renderDate} />,\n sortBy: (row) => instant(row.created_at),\n filter: { type: \"date\", getValue: (row) => row.created_at },\n },\n {\n key: \"category\",\n header: labels.columnCategory,\n cell: (row) => <FeedbackCategoryBadge category={row.category} label={categoryLabels[row.category]} />,\n sortBy: (row) => feedbackCategoryRank(row.category),\n filter: {\n type: \"select\",\n getValue: (row) => row.category,\n options: FEEDBACK_CATEGORY_ORDER.map((value) => ({ value, label: categoryLabels[value] })),\n },\n // Last to go (Kurvenschmiede S1, 0.48), before Subject would drop below 10rem:\n // the open report's Subject section repeats the badge.\n fitPriority: 5,\n },\n {\n key: \"title\",\n header: labels.columnSubject,\n cell: (row) => <FeedbackSubject row={row} labels={labels} />,\n sortBy: (row) => row.title,\n // Searchable by the environment too, so \"dev\" narrows to the test copy's reports —\n // a chip you can see but not filter by makes you read every row (keksdose :804).\n filterBy: (row) => {\n const env = feedbackEnvironment(row.context);\n return env ? `${row.title} ${labels.environment(env)}` : row.title;\n },\n mobilePrimary: true,\n // The rest of the row, one line and an ellipsis (0.48, keksdose live #451: one long\n // crash title pushed Status and the row actions off the edge).\n grow: true,\n },\n {\n key: \"user\",\n header: labels.columnUser,\n // At most 12rem, one line and an ellipsis, the whole value in the kit's Tooltip (0.48 build\n // review 2, keksdose N2): beside the grow Subject every other cell keeps one line, so\n // an email standing in for a missing name widened the column and cost Votes and\n // Category their room first. The open report shows both in full.\n cell: (row) => {\n const who = feedbackSubmitter(row, labels);\n return (\n <Tooltip label={who} portal lazy>\n <span className=\"block max-w-[12rem] truncate-until-large text-secondary\">{who}</span>\n </Tooltip>\n );\n },\n sortBy: (row) => feedbackSubmitter(row, labels),\n // Name AND email, so either finds the person; the erased ones by the placeholder\n // (their context holds no name any more).\n filterBy: (row) =>\n row.user_id == null\n ? labels.deletedUser\n : `${feedbackSubmitter(row, labels)} ${feedbackSubmitterEmail(row)}`,\n },\n {\n key: \"email\",\n header: labels.columnEmail,\n // One line, like the URL beside it: keksdose's `break-all` let the browser squeeze\n // the column to its header and broke every address in two (\"user@exam / ple.test\"),\n // which made every row taller. Unbroken, a resized (pinned) column ellipsises it.\n className: \"whitespace-nowrap\",\n cell: (row) => {\n const email = feedbackSubmitterEmail(row);\n return email ? (\n <span className=\"text-secondary\">{email}</span>\n ) : (\n <span className=\"text-placeholder\">{EMPTY_FORMATTED_VALUE}</span>\n );\n },\n sortBy: feedbackSubmitterEmail,\n filterBy: feedbackSubmitterEmail,\n mobileHidden: true,\n // Second to go when the table is narrow: the open report shows the submitter.\n fitPriority: 2,\n },\n {\n key: \"url\",\n header: labels.columnUrl,\n // A cell only ellipsises what it is told not to wrap (keksdose live #348: the path\n // clipped mid-character \"behind the next column\").\n className: \"whitespace-nowrap\",\n // The cell IS a link, so the row's own permalink must never wrap it (keksdose\n // feedback #451: <a> in <a>, and \"open the page\" silently did nothing).\n noRowLink: true,\n cell: (row) => <FeedbackPageLinkCell context={row.context} openPage={labels.openPage} />,\n sortBy: (row) => feedbackPagePath(row.context) ?? \"\",\n filterBy: (row) => feedbackPagePath(row.context) ?? \"\",\n mobileHidden: true,\n // First to go when the table is narrow (0.48): the open report repeats the page.\n fitPriority: 1,\n },\n ...votesColumn,\n {\n key: \"status\",\n header: labels.columnStatus,\n // A KNOWN width: at most six 28px icon buttons (from IN_PROGRESS or IN_EVALUATION:\n // one step either way and the three off the chain) — keksdose live #348 sized it\n // for five and the sixth pushed the column wider.\n className: \"w-[13.5rem] whitespace-nowrap\",\n cell: (row) => (\n <FeedbackStatusTransitions\n status={row.status}\n statuses={visibleFeedbackStatuses(row.status)}\n canEdit={editable}\n commit={commit}\n onPick={(status) => onStatus(row, status)}\n variant=\"icon\"\n label={(status) => statusLabels[status]}\n />\n ),\n sortBy: (row) => statusRank(row.status),\n filter: {\n type: \"select\",\n getValue: (row) => row.status,\n options: FEEDBACK_STATUS_ORDER.map((value) => ({ value, label: statusLabels[value] })),\n },\n },\n {\n key: \"resolved\",\n header: labels.columnResolved,\n cell: (row) => <FeedbackDate value={row.resolved_at} renderDate={renderDate} />,\n sortBy: (row) => instant(row.resolved_at),\n filter: { type: \"date\", getValue: (row) => row.resolved_at },\n mobileHidden: true,\n // Third to go (0.48).\n fitPriority: 3,\n },\n ];\n}\n\n/** What {@link useFeedbackColumns} takes: {@link FeedbackColumnsOptions} with the words\n * read from the provider, and `renderDate` optional. */\nexport interface UseFeedbackColumnsOptions\n extends Omit<FeedbackColumnsOptions, \"renderDate\" | \"labels\" | \"statusLabels\" | \"categoryLabels\" | \"votesHeader\"> {\n /** Default: the kit's date with the weekday ({@link useFeedbackRenderDate}). */\n renderDate?: FeedbackRenderDate;\n /** Over the `feedbackPage` namespace. Keep it stable (module scope or memoised): it is\n * a dependency of the memo. */\n labels?: LabelOverride<FeedbackPageLabels>;\n}\n\n/**\n * {@link feedbackColumns} with the `feedbackPage`, `feedbackStatus` and\n * `feedbackCategory` words from the provider, memoised on what it reads — pass\n * `update.mutate` through `useFeedbackStatusUndo` (stable) rather than a fresh function\n * per render, or every row's columns are rebuilt on each render (keksdose :667).\n */\nexport function useFeedbackColumns<T extends FeedbackTableRow>({\n mine,\n canEdit,\n onStatus,\n renderDate: renderDateProp,\n commit,\n votes,\n labels: labelsProp,\n}: UseFeedbackColumnsOptions): DataTableColumn<T>[] {\n const labels = useFeedbackPageLabels(labelsProp);\n const statusLabels = useFeedbackStatusLabels();\n const categoryLabels = useFeedbackCategoryLabels();\n const votesHeader = useKitLabels(\"feedbackPublic\", DEFAULT_FEEDBACK_PUBLIC_LABELS).columnVotes;\n const renderDate = useFeedbackRenderDate(renderDateProp);\n return useMemo(\n () =>\n feedbackColumns<T>({\n mine,\n canEdit,\n onStatus,\n renderDate,\n commit,\n labels,\n statusLabels,\n categoryLabels,\n votes,\n votesHeader,\n }),\n [mine, canEdit, onStatus, renderDate, commit, labels, statusLabels, categoryLabels, votes, votesHeader],\n );\n}\n\n/* ── The phone ──────────────────────────────────────────────────────────────── */\n\n/**\n * The phone list's day headers (keksdose feedback #325: the list \"grouped by date, like\n * the transactions list\"): `DataTable mobileGroupBy={feedbackMobileGroupBy(renderDate)}`.\n *\n * The key IS the header — the same string the card's date says. DataTable groups runs of\n * equal keys, so the rows must come newest first, as `GET /feedback` and\n * `GET /feedback/my` send them (§3.3).\n */\nexport function feedbackMobileGroupBy(\n renderDate: FeedbackRenderDate,\n): (row: Pick<FeedbackRecord, \"created_at\">) => string {\n return (row) => renderDate(row.created_at);\n}\n\nexport interface FeedbackMobileCardProps {\n row: FeedbackTableRow;\n /** Add the submitter after the date — the admin inbox (`canEdit`). On `/my-feedback`\n * every row is the viewer's own and the name would repeat down the list. */\n showSubmitter?: boolean;\n /** See {@link FeedbackRenderDate}; the same function as the columns' and the day\n * headers'. Default: the kit's ({@link useFeedbackRenderDate}). */\n renderDate?: FeedbackRenderDate;\n /** 0.38: the vote count as a chip beside the category — with `useFeedbackColumns`'\n * `votes`, whose column the phone hides. */\n votes?: boolean;\n /** Over the `feedbackPage` namespace. */\n labels?: LabelOverride<FeedbackPageLabels>;\n}\n\n/**\n * One report as a phone card (§4.3; keksdose :1042, feedback #325 rework: *\"compact card\n * instead of a wasteful label/value row per field\"*): the title with its environment and\n * rework chips and the status badge on one line, then the compact category badge, the\n * date and (admin) the submitter beneath.\n *\n * `DataTable mobileCard={(row) => <FeedbackMobileCard row={row} … />}`. It draws the\n * chips itself: with a `mobileCard`, DataTable never renders the `mobilePrimary` cell,\n * which is how keksdose's cards lost them.\n */\nexport function FeedbackMobileCard({\n row,\n showSubmitter = false,\n renderDate: renderDateProp,\n votes = false,\n labels: labelsProp,\n}: FeedbackMobileCardProps) {\n const labels = useFeedbackPageLabels(labelsProp);\n const renderDate = useFeedbackRenderDate(renderDateProp);\n return (\n <div className=\"min-w-0 space-y-1\">\n <div className=\"flex items-start justify-between gap-2\">\n <FeedbackSubject row={row} wrap labels={labels} className=\"flex-1\" />\n {/* The pill the desktop status column draws, so a status is the same colour and\n glyph on both layouts. */}\n <FeedbackStatusBadge status={row.status} className=\"shrink-0\" />\n </div>\n <div className=\"flex min-w-0 flex-wrap items-center gap-x-2 gap-y-0.5 text-xs text-muted\">\n <FeedbackCategoryBadge category={row.category} compact />\n {votes && <FeedbackVoteCount votes={row.votes ?? undefined} />}\n <FeedbackDate value={row.created_at} renderDate={renderDate} />\n {showSubmitter && (\n // The short id form: \"#7\" says enough on a card that has room for little.\n <span className=\"min-w-0 truncate\">\n · {feedbackSubmitter(row, { deletedUser: labels.deletedUser, userFallback: (id) => `#${id}` })}\n </span>\n )}\n </div>\n </div>\n );\n}\n\nexport interface FeedbackAwaitingToggleProps {\n /** Narrowed to what waits on the triager. Page state, not the URL (keksdose :699): a\n * thumb gesture on one screen, not a view worth linking to. */\n pressed: boolean;\n onPressedChange: (pressed: boolean) => void;\n /** Further `FloatingAction`s, after the toggle — the group is what makes them free. */\n children?: ReactNode;\n /** Default `bottom-end`, the register's corner. */\n corner?: FloatingCorner;\n /** Over the group's default distance from the bottom. */\n offset?: string;\n /** On the group. It is `md:hidden` already: the desktop has the status column's\n * filter, the same question asked where there is room for it. */\n className?: string;\n /** Over the `feedbackPage` namespace. */\n labels?: LabelOverride<FeedbackPageLabels>;\n}\n\n/**\n * The phone inbox's one filter button — **\"Only what is waiting for you\"** (§4.3;\n * keksdose live #330 rework: *\"a button that toggles the evaluation items (in evaluation,\n * test when live) as toggle button similar to the show/hide upcoming/scheduled for the tx\n * page\"*).\n *\n * It narrows TO `FEEDBACK_AWAITING_STATUSES` rather than hiding them: after a loop run\n * those ARE the queue — the rows handed back for a verdict — and everything else is\n * history. A `FloatingActionGroup` with one member anyway, in the register's corner and\n * shape (keksdose feedback #58), so a second action costs nothing; the glyph is\n * IN_EVALUATION's own, so the button reads in the vocabulary of the badges it filters on.\n *\n * Admin inbox only: on `/my-feedback` the author is not waiting on their own verdict.\n * The filtering is the page's — `rows.filter((r) => isFeedbackAwaiting(r.status))` —\n * so the table's own filters, sort and URL stay untouched.\n */\nexport function FeedbackAwaitingToggle({\n pressed,\n onPressedChange,\n children,\n corner,\n offset,\n className,\n labels: labelsProp,\n}: FeedbackAwaitingToggleProps) {\n const labels = useFeedbackPageLabels(labelsProp);\n const Icon = FEEDBACK_STATUS_META.IN_EVALUATION.icon;\n return (\n <FloatingActionGroup\n aria-label={labels.phoneActions}\n corner={corner}\n offset={offset}\n className={cn(\"md:hidden\", className)}\n >\n <FloatingAction\n label={labels.awaitingFilter}\n icon={<Icon aria-hidden />}\n pressed={pressed}\n onClick={() => onPressedChange(!pressed)}\n />\n {children}\n </FloatingActionGroup>\n );\n}\n\n/* ── Empty ──────────────────────────────────────────────────────────────────── */\n\nexport interface FeedbackEmptyStateProps {\n /** Over the `feedbackPage` namespace. */\n labels?: LabelOverride<FeedbackPageLabels>;\n}\n\n/**\n * The table with nothing to show (§7.13): the one word **None** / **Keine**, on both\n * pages — keksdose's `empty={t(\"common.none\")}` (`feedback-page.tsx:982`). No hint\n * beneath it: where reports are sent from is the feedback menu's business, and the inbox\n * needs no sentence to say it is empty.\n *\n * For `DataTable empty`, which sits in a centred, muted cell — so no box of its own.\n * keksdose passes it unconditionally, so a filter (or the awaiting toggle) that leaves\n * nothing says \"None\" too: `empty={<FeedbackEmptyState />}`.\n */\nexport function FeedbackEmptyState({ labels: labelsProp }: FeedbackEmptyStateProps) {\n const labels = useFeedbackPageLabels(labelsProp);\n return <span data-feedback-empty=\"\">{labels.empty}</span>;\n}\n"],"mappings":";AA+PqB,SA8CjB,UA9CiB,KA8CjB,YA9CiB;AA/PrB,SAAS,eAAe;AAExB,SAAS,cAAc,gBAAgB;AACvC,SAAS,UAAU;AACnB,SAAS,kBAAkB;AAC3B,SAAS,uBAAuB,YAAY,cAAc;AAC1D,SAAS,qBAAqB,cAAc,YAAY,oBAAwC;AAEhG,SAAS,YAAY;AACrB,SAAS,eAAe;AACxB,SAAS,gBAAgB,2BAA2B;AAEpD,SAAS,wBAAwB;AAEjC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAEK;AACP;AAAA,EACE;AAAA,EACA;AAAA,OAGK;AACP,SAAS,4BAA4B,2BAAsE;AAE3G,SAAS,kBAAkB,wBAAwB;AAEnD,SAAS,oCAAoC;AAC7C,SAAS,sCAAsC;AA8FxC,SAAS,sBAAsB,QAAgE;AACpG,SAAO,aAAa,gBAAgB,8BAA8B,MAAM;AAC1E;AAuBA,SAAS,KAAK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AAAA,SAC/F;AAAA,OAEJ;AAAA,KACF;AAEJ;AAoCO,SAAS,uBAAuB;AAAA,EACrC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,QAAQ;AACV,GAAgC;AAC9B,QAAM,SAAS,sBAAsB,UAAU;AAC/C,QAAM,OAAO,qBAAqB,cAAc;AAChD,SACE;AAAA,IAAC;AAAA;AAAA,MACC,cAAY,OAAO;AAAA,MACnB;AAAA,MACA;AAAA,MACA,WAAW,GAAG,aAAa,SAAS;AAAA,MAEpC;AAAA;AAAA,UAAC;AAAA;AAAA,YACC,OAAO,OAAO;AAAA,YACd,MAAM,oBAAC,QAAK,eAAW,MAAC;AAAA,YACxB;AAAA,YACA,SAAS,MAAM,gBAAgB,CAAC,OAAO;AAAA;AAAA,QACzC;AAAA,QACC;AAAA;AAAA;AAAA,EACH;AAEJ;AAmBO,SAAS,mBAAmB,EAAE,QAAQ,WAAW,GAA4B;AAClF,QAAM,SAAS,sBAAsB,UAAU;AAC/C,SAAO,oBAAC,UAAK,uBAAoB,IAAI,iBAAO,OAAM;AACpD;","names":[]}
|
|
@@ -48,6 +48,18 @@ export declare function runOwnKeyDown<E extends ReactKeyboardEvent>(e: E, handle
|
|
|
48
48
|
* dialog (Wave 2, DUP-1). `handler` is read live, so it need not be memoised.
|
|
49
49
|
*/
|
|
50
50
|
export declare function useEscapeKey(handler: () => void, enabled?: boolean): void;
|
|
51
|
+
/** What an `onPointerDownCapture` hands over: a React event, its press inside. */
|
|
52
|
+
type ReactPress = {
|
|
53
|
+
nativeEvent: Event;
|
|
54
|
+
};
|
|
55
|
+
/**
|
|
56
|
+
* An `onPointerDownCapture` for a panel whose `ref` an outside-click hook watches but
|
|
57
|
+
* whose element the hook's owner does not render — {@link DropdownPanel} and
|
|
58
|
+
* `ComboboxPanel` take `panelRef` from `useDropdown` / `useComboboxCore`. Every press
|
|
59
|
+
* that reaches the panel through the React tree, a portalled list opened inside it
|
|
60
|
+
* included, is marked inside for each hook watching `ref`. See {@link useOutsideClick}.
|
|
61
|
+
*/
|
|
62
|
+
export declare function pressInside(ref: RefObject<HTMLElement | null> | undefined): ((e: ReactPress) => void) | undefined;
|
|
51
63
|
/**
|
|
52
64
|
* Calls `handler` on a press that lands outside every supplied element, while
|
|
53
65
|
* `enabled` — the outside-click-to-close half of the same dismissal story. Pass one
|
|
@@ -55,6 +67,23 @@ export declare function useEscapeKey(handler: () => void, enabled?: boolean): vo
|
|
|
55
67
|
* `handler` are read live, so an inline `[triggerRef, panelRef]` array is fine and
|
|
56
68
|
* won't churn the listener.
|
|
57
69
|
*
|
|
70
|
+
* ## A panel opened from inside is inside (0.48, keksdose dev#623)
|
|
71
|
+
*
|
|
72
|
+
* A CurrencySelect in a Popover: the currency list is portalled to `<body>`, so in the
|
|
73
|
+
* DOM it is outside the popover's panel, and the first press on a currency closed the
|
|
74
|
+
* POPOVER at pointerdown — the list went with it and the choice never landed. The same
|
|
75
|
+
* for a combobox, a menu, a date picker's popover, a dropdown, at any depth.
|
|
76
|
+
*
|
|
77
|
+
* In the React tree the portal is still where it was opened from, and React passes a
|
|
78
|
+
* press up that tree, through portals. So the hook hands back an
|
|
79
|
+
* `onPointerDownCapture`: put it on the element the press should count as inside of —
|
|
80
|
+
* the kit's Popover panel, HoverMenu, DropdownPanel and ComboboxPanel do — and every
|
|
81
|
+
* press that travels through that element in React, portalled panels opened inside it
|
|
82
|
+
* included, is not outside. React's listeners sit on the root and on each portal's
|
|
83
|
+
* container, so they hear the press before this document listener does. No owner chain
|
|
84
|
+
* to keep: depth is free, and an app's own portal inside a kit panel is covered too. A
|
|
85
|
+
* panel the hook's owner does not render takes {@link pressInside} with the watched ref.
|
|
86
|
+
*
|
|
58
87
|
* **`pointerdown`, not `mousedown`** — one event covering mouse, touch and pen.
|
|
59
88
|
* This listened for `mousedown` alone, which on a touch platform is a SYNTHESISED
|
|
60
89
|
* event: the browser emits it for most taps, which is why nothing obviously broke,
|
|
@@ -69,5 +98,5 @@ export declare function useEscapeKey(handler: () => void, enabled?: boolean): vo
|
|
|
69
98
|
* the anchored panels re-measure on scroll precisely because the page moves under
|
|
70
99
|
* them.
|
|
71
100
|
*/
|
|
72
|
-
export declare function useOutsideClick(refs: RefObject<HTMLElement | null> | RefObject<HTMLElement | null>[], handler: () => void, enabled?: boolean): void;
|
|
101
|
+
export declare function useOutsideClick(refs: RefObject<HTMLElement | null> | RefObject<HTMLElement | null>[], handler: () => void, enabled?: boolean): (e: ReactPress) => void;
|
|
73
102
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { useEffect, useRef } from "react";
|
|
2
|
+
import { useCallback, useEffect, useRef } from "react";
|
|
3
3
|
import { isComposing } from "../lib/ime.js";
|
|
4
4
|
const layers = [];
|
|
5
5
|
const claimed = /* @__PURE__ */ new WeakSet();
|
|
@@ -81,16 +81,39 @@ function aboveOwner(e, owner) {
|
|
|
81
81
|
function useEscapeKey(handler, enabled = true) {
|
|
82
82
|
useDismissLayer(enabled, handler);
|
|
83
83
|
}
|
|
84
|
+
const watchers = /* @__PURE__ */ new WeakMap();
|
|
85
|
+
function pressInside(ref) {
|
|
86
|
+
if (!ref) return void 0;
|
|
87
|
+
return (e) => {
|
|
88
|
+
watchers.get(ref)?.forEach((mark) => mark(e.nativeEvent));
|
|
89
|
+
};
|
|
90
|
+
}
|
|
84
91
|
function useOutsideClick(refs, handler, enabled = true) {
|
|
85
92
|
const refsRef = useRef(refs);
|
|
86
93
|
const handlerRef = useRef(handler);
|
|
94
|
+
const insideRef = useRef(null);
|
|
87
95
|
useEffect(() => {
|
|
88
96
|
refsRef.current = refs;
|
|
89
97
|
handlerRef.current = handler;
|
|
90
98
|
});
|
|
99
|
+
const markInside = useCallback((e) => {
|
|
100
|
+
insideRef.current = e.nativeEvent;
|
|
101
|
+
}, []);
|
|
91
102
|
useEffect(() => {
|
|
92
103
|
if (!enabled) return;
|
|
104
|
+
const mark = (press) => {
|
|
105
|
+
insideRef.current = press;
|
|
106
|
+
};
|
|
107
|
+
const watched = Array.isArray(refsRef.current) ? refsRef.current : [refsRef.current];
|
|
108
|
+
for (const r of watched) {
|
|
109
|
+
const set = watchers.get(r) ?? /* @__PURE__ */ new Set();
|
|
110
|
+
set.add(mark);
|
|
111
|
+
watchers.set(r, set);
|
|
112
|
+
}
|
|
93
113
|
const onPointerDown = (e) => {
|
|
114
|
+
const inside = insideRef.current === e;
|
|
115
|
+
insideRef.current = null;
|
|
116
|
+
if (inside) return;
|
|
94
117
|
const target = e.target;
|
|
95
118
|
const list = Array.isArray(refsRef.current) ? refsRef.current : [refsRef.current];
|
|
96
119
|
for (const r of list) {
|
|
@@ -99,11 +122,16 @@ function useOutsideClick(refs, handler, enabled = true) {
|
|
|
99
122
|
handlerRef.current();
|
|
100
123
|
};
|
|
101
124
|
document.addEventListener("pointerdown", onPointerDown);
|
|
102
|
-
return () =>
|
|
125
|
+
return () => {
|
|
126
|
+
document.removeEventListener("pointerdown", onPointerDown);
|
|
127
|
+
for (const r of watched) watchers.get(r)?.delete(mark);
|
|
128
|
+
};
|
|
103
129
|
}, [enabled]);
|
|
130
|
+
return markInside;
|
|
104
131
|
}
|
|
105
132
|
export {
|
|
106
133
|
claimEscape,
|
|
134
|
+
pressInside,
|
|
107
135
|
runOwnKeyDown,
|
|
108
136
|
takeEscape,
|
|
109
137
|
useDismissLayer,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/hooks/use-dismiss.ts"],"sourcesContent":["import { useEffect, useRef } from \"react\";\nimport type { KeyboardEvent as ReactKeyboardEvent, RefObject } from \"react\";\nimport { isComposing } from \"../lib/ime\";\n\n/*\n * # One Escape stack (round 0.34 Wave 2, DUP-1)\n *\n * Escape closes the TOPMOST thing on screen, and only that: a list open in a dialog\n * closes and the dialog stays; the next press closes the dialog.\n *\n * \"Who owns Escape\" used to be decided five ways. The anchored pickers listened on the\n * document; Modal, FullBleedDialog, PickerSheet and Popover closed in their own panel's\n * `onKeyDown` and stopped the key; CommandPalette closed without stopping it. A dialog's\n * handler sits earlier on the key's path than any document listener, so Escape in an\n * open list inside a Modal closed the MODAL and threw the form away (BUG-1, sev 4,\n * kastlan's lease dialog), and HoverMenu, the numpad and a tooltip could not be\n * dismissed inside a dialog at all. And Modal and FullBleedDialog disagreed on when a\n * child had \"claimed\" the key: a ChipInput clearing its draft kept a Modal open and\n * closed a FullBleedDialog.\n *\n * Now every overlay and picker pushes a layer while it is open ({@link useDismissLayer}),\n * last in, first out, the way `use-overlay-history` stacks the Back gesture. One\n * capture-phase listener on the document notes which layer is on top as each Escape\n * goes down — before any handler on the page runs, so a layer that closes on the way\n * cannot pass the key on to the one beneath it. That layer, and only that one, is\n * handed the key:\n *\n * - at the first layer element the key passes on its way back up ({@link takeEscape},\n * which Modal's panel, a picker's search box and the rest call from their\n * `onKeyDown`). The key is stopped there, so nothing around the layers — a\n * FloatingPanel, an app's own panel — closes with it;\n * - or, when focus is in none of them (a hover menu, a tooltip, the numpad over its\n * field, a press on the page), at the document once the key has been everywhere else.\n *\n * Layers stack in the order they OPEN, which is the order their effects run. Two that\n * open in the same commit stack child first — the one case that order gets wrong, and\n * one no overlay in the kit does: each opens on a press, after whatever it sits in.\n *\n * ## Claiming the key: one rule\n *\n * An Escape that means \"undo this step\" is not a dismissal: ChipInput clearing its\n * draft, InlineEditField cancelling its edit, the date picker's month grid going back to\n * the days. Those call {@link claimEscape}, and no layer is handed the key. The only\n * other claim is the layer owner's OWN handler — a dialog's `onKeyDown` prop calling\n * `preventDefault()` on Escape (a busy reauth dialog holding itself open, Kurvenschmiede's\n * gear wizard asking first), through {@link runOwnKeyDown}. A `preventDefault()`\n * anywhere else claims nothing: a search box keeping Chromium from clearing itself\n * must not hold a dialog open (FullBleedDialog's 0.8.0 fix, which Modal never had).\n *\n * The owner's handler hears Escape only while its own layer is on top (0.35, KS). It\n * runs before the stack is asked, so with a tooltip, a hover menu or a list open over\n * the dialog and focus on the panel, the gear wizard asked \"Discard this gear?\" and the\n * tooltip stayed. Now the layer above takes that press, and the next one is the\n * owner's. Every other key reaches the handler as before.\n *\n * A handler that STOPS the key before it reaches a layer element has taken it too —\n * that is the DOM, and it is what the kit's cell editors and confirm buttons do.\n */\n\n/** A layer's handler, read through a ref so the stack holds one stable entry per open. */\ninterface Layer {\n escape: (e: KeyboardEvent) => void;\n}\n\n/** What {@link useDismissLayer} hands back: its layer while open, for\n * {@link runOwnKeyDown} to tell whether that layer is the one on top. */\nexport type DismissLayer = RefObject<Layer | null>;\n\n/** Open layers, oldest first. Module-level, because the order is ACROSS instances. */\nconst layers: Layer[] = [];\n\n/** Escapes a claimant has taken — see {@link claimEscape}. Weak: an event is garbage\n * once its dispatch is over. */\nconst claimed = new WeakSet<Event>();\n\n/** The Escape on its way through the page: the layer that was topmost as it went down,\n * and whether that layer has been handed it yet. */\nlet inFlight: { event: KeyboardEvent; layer: Layer; done: boolean } | null = null;\n\nfunction nativeOf(e: KeyboardEvent | ReactKeyboardEvent): KeyboardEvent {\n return \"nativeEvent\" in e ? e.nativeEvent : e;\n}\n\nfunction onCapture(e: KeyboardEvent): void {\n if (e.key !== \"Escape\") return;\n // An Escape inside an IME composition cancels the composition and nothing else.\n const top = isComposing(e) ? undefined : layers[layers.length - 1];\n inFlight = top ? { event: e, layer: top, done: false } : null;\n}\n\n/** The fallback: no layer element was on the key's path, or none took it. */\nfunction onBubble(e: KeyboardEvent): void {\n handOver(e, false);\n}\n\nfunction handOver(e: KeyboardEvent | ReactKeyboardEvent, stop: boolean): boolean {\n const native = nativeOf(e);\n const flight = inFlight;\n if (native.key !== \"Escape\" || !flight || flight.event !== native || flight.done) return false;\n if (claimed.has(native)) return false;\n flight.done = true;\n // Consumed: a type=\"search\" box does not clear itself as well, and a handler further\n // out that checks `defaultPrevented` (FloatingPanel, an app's own panel) leaves it.\n e.preventDefault();\n if (stop) e.stopPropagation();\n // A layer that closed on the way, by a handler of its own, has had its Escape.\n if (layers.includes(flight.layer)) flight.layer.escape(native);\n return true;\n}\n\nfunction push(layer: Layer): void {\n if (layers.length === 0) {\n document.addEventListener(\"keydown\", onCapture, true);\n document.addEventListener(\"keydown\", onBubble);\n }\n layers.push(layer);\n}\n\nfunction pop(layer: Layer): void {\n const at = layers.indexOf(layer);\n if (at >= 0) layers.splice(at, 1);\n if (layers.length > 0) return;\n document.removeEventListener(\"keydown\", onCapture, true);\n document.removeEventListener(\"keydown\", onBubble);\n inFlight = null;\n}\n\n/**\n * An Escape layer on the stack while `open`: the topmost layer is handed the next\n * Escape and calls `onEscape`, every layer under it waits its turn. A list opened inside\n * a dialog is above the dialog; a popover opened from a list, above the list.\n *\n * Where focus can be INSIDE the layer, its element's `onKeyDown` calls\n * {@link takeEscape} too, so the key stops there — see the module note. `onEscape` is\n * read live, so it need not be memoised; the layer is pushed and popped only when\n * `open` flips. The layer it returns is for the owner's {@link runOwnKeyDown}.\n */\nexport function useDismissLayer(open: boolean, onEscape: (e: KeyboardEvent) => void): DismissLayer {\n const handlerRef = useRef(onEscape);\n const layerRef = useRef<Layer | null>(null);\n // Written in an effect, not during render, so it satisfies react-hooks/refs: a\n // render that React starts and then discards — a transition, a Suspense retry —\n // would otherwise leave this holding a handler from a tree that never committed,\n // and the stack would go on to call it. Keydown events fire after the commit, so\n // the ref is always current by the time one arrives.\n useEffect(() => {\n handlerRef.current = onEscape;\n });\n useEffect(() => {\n if (!open || typeof document === \"undefined\") return;\n const layer: Layer = { escape: (e) => handlerRef.current(e) };\n layerRef.current = layer;\n push(layer);\n return () => {\n pop(layer);\n layerRef.current = null;\n };\n }, [open]);\n return layerRef;\n}\n\n/**\n * For a layer's own element, in its `onKeyDown`: hands an Escape on its way up to the\n * topmost layer — this one, unless something opened over it without taking focus (a\n * tooltip, the numpad) — and stops it here. True when it did; false for any other key,\n * a claimed Escape, or one already handed over.\n */\nexport function takeEscape(e: KeyboardEvent | ReactKeyboardEvent): boolean {\n return handOver(e, true);\n}\n\n/**\n * For an Escape that means \"undo this step\", not \"close\": the key is the caller's, and\n * no layer is handed it. `preventDefault()`s it as well, so a handler further out that\n * checks `defaultPrevented` leaves it alone, as before.\n */\nexport function claimEscape(e: KeyboardEvent | ReactKeyboardEvent): void {\n claimed.add(nativeOf(e));\n e.preventDefault();\n}\n\n/**\n * Runs a layer owner's own key handler — a dialog's `onKeyDown` prop — and turns a\n * `preventDefault()` it makes on Escape into a claim: the one way, beside\n * {@link claimEscape}, to keep a layer open.\n *\n * Given the owner's `layer` (what {@link useDismissLayer} returned), an Escape that went\n * down while another layer was above that one skips the handler: the press is the\n * layer's on top, and the owner hears the next (0.35, KS). Without it, or while the\n * owner's layer is not open, the handler sees every key, as before.\n */\nexport function runOwnKeyDown<E extends ReactKeyboardEvent>(\n e: E,\n handler: ((e: E) => void) | undefined,\n layer?: DismissLayer,\n): void {\n if (!handler) return;\n if (layer && aboveOwner(e, layer.current)) return;\n const before = e.defaultPrevented;\n handler(e);\n if (e.key === \"Escape\" && !before && e.defaultPrevented) claimed.add(nativeOf(e));\n}\n\n/** Whether this Escape went down with a layer above `owner` — the topmost one then was\n * another, and `owner` is on the stack. An Escape the stack did not note (one inside an\n * IME composition) is nobody else's. */\nfunction aboveOwner(e: ReactKeyboardEvent, owner: Layer | null): boolean {\n const flight = inFlight;\n if (e.key !== \"Escape\" || !owner || !flight || flight.event !== nativeOf(e)) return false;\n return flight.layer !== owner && layers.includes(owner);\n}\n\n/**\n * Calls `handler` on an Escape while `enabled` — as an Escape layer. Since 0.34 this is\n * {@link useDismissLayer} with its arguments the other way round: it hears the key only\n * while nothing opened above it, and inside a dialog it no longer loses the key to the\n * dialog (Wave 2, DUP-1). `handler` is read live, so it need not be memoised.\n */\nexport function useEscapeKey(handler: () => void, enabled = true): void {\n useDismissLayer(enabled, handler);\n}\n\n/**\n * Calls `handler` on a press that lands outside every supplied element, while\n * `enabled` — the outside-click-to-close half of the same dismissal story. Pass one\n * ref or several (trigger + panel); a press inside any of them is ignored. Refs and\n * `handler` are read live, so an inline `[triggerRef, panelRef]` array is fine and\n * won't churn the listener.\n *\n * **`pointerdown`, not `mousedown`** — one event covering mouse, touch and pen.\n * This listened for `mousedown` alone, which on a touch platform is a SYNTHESISED\n * event: the browser emits it for most taps, which is why nothing obviously broke,\n * but the synthesis is not guaranteed. A tap that begins a scroll, or one that lands\n * on an element which preventDefaults the touch sequence, may never produce one — and\n * on a phone-first PWA whose pickers, menus and flyouts all dismiss through this hook,\n * inheriting that is worse than choosing it.\n *\n * The one behaviour this changes deliberately: a touch-drag that starts outside an\n * open panel now dismisses it at touch-down, where before it did not dismiss at all\n * (a drag synthesises no mousedown). That matches every other platform surface, and\n * the anchored panels re-measure on scroll precisely because the page moves under\n * them.\n */\nexport function useOutsideClick(\n refs: RefObject<HTMLElement | null> | RefObject<HTMLElement | null>[],\n handler: () => void,\n enabled = true,\n): void {\n const refsRef = useRef(refs);\n const handlerRef = useRef(handler);\n // In an effect rather than during render — see the note in useDismissLayer.\n useEffect(() => {\n refsRef.current = refs;\n handlerRef.current = handler;\n });\n useEffect(() => {\n if (!enabled) return;\n const onPointerDown = (e: Event) => {\n const target = e.target as Node;\n const list = Array.isArray(refsRef.current) ? refsRef.current : [refsRef.current];\n for (const r of list) {\n if (r.current?.contains(target)) return;\n }\n handlerRef.current();\n };\n document.addEventListener(\"pointerdown\", onPointerDown);\n return () => document.removeEventListener(\"pointerdown\", onPointerDown);\n }, [enabled]);\n}\n"],"mappings":";AAAA,SAAS,WAAW,cAAc;AAElC,SAAS,mBAAmB;AAmE5B,MAAM,SAAkB,CAAC;AAIzB,MAAM,UAAU,oBAAI,QAAe;AAInC,IAAI,WAAyE;AAE7E,SAAS,SAAS,GAAsD;AACtE,SAAO,iBAAiB,IAAI,EAAE,cAAc;AAC9C;AAEA,SAAS,UAAU,GAAwB;AACzC,MAAI,EAAE,QAAQ,SAAU;AAExB,QAAM,MAAM,YAAY,CAAC,IAAI,SAAY,OAAO,OAAO,SAAS,CAAC;AACjE,aAAW,MAAM,E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AAS,oBAAoB,eAAe,aAAa;AAAA,EACxE,GAAG,CAAC,OAAO,CAAC;AACd;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../src/hooks/use-dismiss.ts"],"sourcesContent":["import { useCallback, useEffect, useRef } from \"react\";\nimport type { KeyboardEvent as ReactKeyboardEvent, RefObject } from \"react\";\nimport { isComposing } from \"../lib/ime\";\n\n/*\n * # One Escape stack (round 0.34 Wave 2, DUP-1)\n *\n * Escape closes the TOPMOST thing on screen, and only that: a list open in a dialog\n * closes and the dialog stays; the next press closes the dialog.\n *\n * \"Who owns Escape\" used to be decided five ways. The anchored pickers listened on the\n * document; Modal, FullBleedDialog, PickerSheet and Popover closed in their own panel's\n * `onKeyDown` and stopped the key; CommandPalette closed without stopping it. A dialog's\n * handler sits earlier on the key's path than any document listener, so Escape in an\n * open list inside a Modal closed the MODAL and threw the form away (BUG-1, sev 4,\n * kastlan's lease dialog), and HoverMenu, the numpad and a tooltip could not be\n * dismissed inside a dialog at all. And Modal and FullBleedDialog disagreed on when a\n * child had \"claimed\" the key: a ChipInput clearing its draft kept a Modal open and\n * closed a FullBleedDialog.\n *\n * Now every overlay and picker pushes a layer while it is open ({@link useDismissLayer}),\n * last in, first out, the way `use-overlay-history` stacks the Back gesture. One\n * capture-phase listener on the document notes which layer is on top as each Escape\n * goes down — before any handler on the page runs, so a layer that closes on the way\n * cannot pass the key on to the one beneath it. That layer, and only that one, is\n * handed the key:\n *\n * - at the first layer element the key passes on its way back up ({@link takeEscape},\n * which Modal's panel, a picker's search box and the rest call from their\n * `onKeyDown`). The key is stopped there, so nothing around the layers — a\n * FloatingPanel, an app's own panel — closes with it;\n * - or, when focus is in none of them (a hover menu, a tooltip, the numpad over its\n * field, a press on the page), at the document once the key has been everywhere else.\n *\n * Layers stack in the order they OPEN, which is the order their effects run. Two that\n * open in the same commit stack child first — the one case that order gets wrong, and\n * one no overlay in the kit does: each opens on a press, after whatever it sits in.\n *\n * ## Claiming the key: one rule\n *\n * An Escape that means \"undo this step\" is not a dismissal: ChipInput clearing its\n * draft, InlineEditField cancelling its edit, the date picker's month grid going back to\n * the days. Those call {@link claimEscape}, and no layer is handed the key. The only\n * other claim is the layer owner's OWN handler — a dialog's `onKeyDown` prop calling\n * `preventDefault()` on Escape (a busy reauth dialog holding itself open, Kurvenschmiede's\n * gear wizard asking first), through {@link runOwnKeyDown}. A `preventDefault()`\n * anywhere else claims nothing: a search box keeping Chromium from clearing itself\n * must not hold a dialog open (FullBleedDialog's 0.8.0 fix, which Modal never had).\n *\n * The owner's handler hears Escape only while its own layer is on top (0.35, KS). It\n * runs before the stack is asked, so with a tooltip, a hover menu or a list open over\n * the dialog and focus on the panel, the gear wizard asked \"Discard this gear?\" and the\n * tooltip stayed. Now the layer above takes that press, and the next one is the\n * owner's. Every other key reaches the handler as before.\n *\n * A handler that STOPS the key before it reaches a layer element has taken it too —\n * that is the DOM, and it is what the kit's cell editors and confirm buttons do.\n */\n\n/** A layer's handler, read through a ref so the stack holds one stable entry per open. */\ninterface Layer {\n escape: (e: KeyboardEvent) => void;\n}\n\n/** What {@link useDismissLayer} hands back: its layer while open, for\n * {@link runOwnKeyDown} to tell whether that layer is the one on top. */\nexport type DismissLayer = RefObject<Layer | null>;\n\n/** Open layers, oldest first. Module-level, because the order is ACROSS instances. */\nconst layers: Layer[] = [];\n\n/** Escapes a claimant has taken — see {@link claimEscape}. Weak: an event is garbage\n * once its dispatch is over. */\nconst claimed = new WeakSet<Event>();\n\n/** The Escape on its way through the page: the layer that was topmost as it went down,\n * and whether that layer has been handed it yet. */\nlet inFlight: { event: KeyboardEvent; layer: Layer; done: boolean } | null = null;\n\nfunction nativeOf(e: KeyboardEvent | ReactKeyboardEvent): KeyboardEvent {\n return \"nativeEvent\" in e ? e.nativeEvent : e;\n}\n\nfunction onCapture(e: KeyboardEvent): void {\n if (e.key !== \"Escape\") return;\n // An Escape inside an IME composition cancels the composition and nothing else.\n const top = isComposing(e) ? undefined : layers[layers.length - 1];\n inFlight = top ? { event: e, layer: top, done: false } : null;\n}\n\n/** The fallback: no layer element was on the key's path, or none took it. */\nfunction onBubble(e: KeyboardEvent): void {\n handOver(e, false);\n}\n\nfunction handOver(e: KeyboardEvent | ReactKeyboardEvent, stop: boolean): boolean {\n const native = nativeOf(e);\n const flight = inFlight;\n if (native.key !== \"Escape\" || !flight || flight.event !== native || flight.done) return false;\n if (claimed.has(native)) return false;\n flight.done = true;\n // Consumed: a type=\"search\" box does not clear itself as well, and a handler further\n // out that checks `defaultPrevented` (FloatingPanel, an app's own panel) leaves it.\n e.preventDefault();\n if (stop) e.stopPropagation();\n // A layer that closed on the way, by a handler of its own, has had its Escape.\n if (layers.includes(flight.layer)) flight.layer.escape(native);\n return true;\n}\n\nfunction push(layer: Layer): void {\n if (layers.length === 0) {\n document.addEventListener(\"keydown\", onCapture, true);\n document.addEventListener(\"keydown\", onBubble);\n }\n layers.push(layer);\n}\n\nfunction pop(layer: Layer): void {\n const at = layers.indexOf(layer);\n if (at >= 0) layers.splice(at, 1);\n if (layers.length > 0) return;\n document.removeEventListener(\"keydown\", onCapture, true);\n document.removeEventListener(\"keydown\", onBubble);\n inFlight = null;\n}\n\n/**\n * An Escape layer on the stack while `open`: the topmost layer is handed the next\n * Escape and calls `onEscape`, every layer under it waits its turn. A list opened inside\n * a dialog is above the dialog; a popover opened from a list, above the list.\n *\n * Where focus can be INSIDE the layer, its element's `onKeyDown` calls\n * {@link takeEscape} too, so the key stops there — see the module note. `onEscape` is\n * read live, so it need not be memoised; the layer is pushed and popped only when\n * `open` flips. The layer it returns is for the owner's {@link runOwnKeyDown}.\n */\nexport function useDismissLayer(open: boolean, onEscape: (e: KeyboardEvent) => void): DismissLayer {\n const handlerRef = useRef(onEscape);\n const layerRef = useRef<Layer | null>(null);\n // Written in an effect, not during render, so it satisfies react-hooks/refs: a\n // render that React starts and then discards — a transition, a Suspense retry —\n // would otherwise leave this holding a handler from a tree that never committed,\n // and the stack would go on to call it. Keydown events fire after the commit, so\n // the ref is always current by the time one arrives.\n useEffect(() => {\n handlerRef.current = onEscape;\n });\n useEffect(() => {\n if (!open || typeof document === \"undefined\") return;\n const layer: Layer = { escape: (e) => handlerRef.current(e) };\n layerRef.current = layer;\n push(layer);\n return () => {\n pop(layer);\n layerRef.current = null;\n };\n }, [open]);\n return layerRef;\n}\n\n/**\n * For a layer's own element, in its `onKeyDown`: hands an Escape on its way up to the\n * topmost layer — this one, unless something opened over it without taking focus (a\n * tooltip, the numpad) — and stops it here. True when it did; false for any other key,\n * a claimed Escape, or one already handed over.\n */\nexport function takeEscape(e: KeyboardEvent | ReactKeyboardEvent): boolean {\n return handOver(e, true);\n}\n\n/**\n * For an Escape that means \"undo this step\", not \"close\": the key is the caller's, and\n * no layer is handed it. `preventDefault()`s it as well, so a handler further out that\n * checks `defaultPrevented` leaves it alone, as before.\n */\nexport function claimEscape(e: KeyboardEvent | ReactKeyboardEvent): void {\n claimed.add(nativeOf(e));\n e.preventDefault();\n}\n\n/**\n * Runs a layer owner's own key handler — a dialog's `onKeyDown` prop — and turns a\n * `preventDefault()` it makes on Escape into a claim: the one way, beside\n * {@link claimEscape}, to keep a layer open.\n *\n * Given the owner's `layer` (what {@link useDismissLayer} returned), an Escape that went\n * down while another layer was above that one skips the handler: the press is the\n * layer's on top, and the owner hears the next (0.35, KS). Without it, or while the\n * owner's layer is not open, the handler sees every key, as before.\n */\nexport function runOwnKeyDown<E extends ReactKeyboardEvent>(\n e: E,\n handler: ((e: E) => void) | undefined,\n layer?: DismissLayer,\n): void {\n if (!handler) return;\n if (layer && aboveOwner(e, layer.current)) return;\n const before = e.defaultPrevented;\n handler(e);\n if (e.key === \"Escape\" && !before && e.defaultPrevented) claimed.add(nativeOf(e));\n}\n\n/** Whether this Escape went down with a layer above `owner` — the topmost one then was\n * another, and `owner` is on the stack. An Escape the stack did not note (one inside an\n * IME composition) is nobody else's. */\nfunction aboveOwner(e: ReactKeyboardEvent, owner: Layer | null): boolean {\n const flight = inFlight;\n if (e.key !== \"Escape\" || !owner || !flight || flight.event !== nativeOf(e)) return false;\n return flight.layer !== owner && layers.includes(owner);\n}\n\n/**\n * Calls `handler` on an Escape while `enabled` — as an Escape layer. Since 0.34 this is\n * {@link useDismissLayer} with its arguments the other way round: it hears the key only\n * while nothing opened above it, and inside a dialog it no longer loses the key to the\n * dialog (Wave 2, DUP-1). `handler` is read live, so it need not be memoised.\n */\nexport function useEscapeKey(handler: () => void, enabled = true): void {\n useDismissLayer(enabled, handler);\n}\n\n/** Called with each native press an owner's React tree saw — see {@link useOutsideClick}. */\ntype PressMark = (press: Event) => void;\n\n/** The outside-click hooks watching each ref, for {@link pressInside}. */\nconst watchers = new WeakMap<RefObject<HTMLElement | null>, Set<PressMark>>();\n\n/** What an `onPointerDownCapture` hands over: a React event, its press inside. */\ntype ReactPress = { nativeEvent: Event };\n\n/**\n * An `onPointerDownCapture` for a panel whose `ref` an outside-click hook watches but\n * whose element the hook's owner does not render — {@link DropdownPanel} and\n * `ComboboxPanel` take `panelRef` from `useDropdown` / `useComboboxCore`. Every press\n * that reaches the panel through the React tree, a portalled list opened inside it\n * included, is marked inside for each hook watching `ref`. See {@link useOutsideClick}.\n */\nexport function pressInside(ref: RefObject<HTMLElement | null> | undefined): ((e: ReactPress) => void) | undefined {\n if (!ref) return undefined;\n return (e) => {\n watchers.get(ref)?.forEach((mark) => mark(e.nativeEvent));\n };\n}\n\n/**\n * Calls `handler` on a press that lands outside every supplied element, while\n * `enabled` — the outside-click-to-close half of the same dismissal story. Pass one\n * ref or several (trigger + panel); a press inside any of them is ignored. Refs and\n * `handler` are read live, so an inline `[triggerRef, panelRef]` array is fine and\n * won't churn the listener.\n *\n * ## A panel opened from inside is inside (0.48, keksdose dev#623)\n *\n * A CurrencySelect in a Popover: the currency list is portalled to `<body>`, so in the\n * DOM it is outside the popover's panel, and the first press on a currency closed the\n * POPOVER at pointerdown — the list went with it and the choice never landed. The same\n * for a combobox, a menu, a date picker's popover, a dropdown, at any depth.\n *\n * In the React tree the portal is still where it was opened from, and React passes a\n * press up that tree, through portals. So the hook hands back an\n * `onPointerDownCapture`: put it on the element the press should count as inside of —\n * the kit's Popover panel, HoverMenu, DropdownPanel and ComboboxPanel do — and every\n * press that travels through that element in React, portalled panels opened inside it\n * included, is not outside. React's listeners sit on the root and on each portal's\n * container, so they hear the press before this document listener does. No owner chain\n * to keep: depth is free, and an app's own portal inside a kit panel is covered too. A\n * panel the hook's owner does not render takes {@link pressInside} with the watched ref.\n *\n * **`pointerdown`, not `mousedown`** — one event covering mouse, touch and pen.\n * This listened for `mousedown` alone, which on a touch platform is a SYNTHESISED\n * event: the browser emits it for most taps, which is why nothing obviously broke,\n * but the synthesis is not guaranteed. A tap that begins a scroll, or one that lands\n * on an element which preventDefaults the touch sequence, may never produce one — and\n * on a phone-first PWA whose pickers, menus and flyouts all dismiss through this hook,\n * inheriting that is worse than choosing it.\n *\n * The one behaviour this changes deliberately: a touch-drag that starts outside an\n * open panel now dismisses it at touch-down, where before it did not dismiss at all\n * (a drag synthesises no mousedown). That matches every other platform surface, and\n * the anchored panels re-measure on scroll precisely because the page moves under\n * them.\n */\nexport function useOutsideClick(\n refs: RefObject<HTMLElement | null> | RefObject<HTMLElement | null>[],\n handler: () => void,\n enabled = true,\n): (e: ReactPress) => void {\n const refsRef = useRef(refs);\n const handlerRef = useRef(handler);\n // The last press this owner's React tree saw: the one the document listener is about\n // to hear, when it went through a panel the owner marked.\n const insideRef = useRef<Event | null>(null);\n // In an effect rather than during render — see the note in useDismissLayer.\n useEffect(() => {\n refsRef.current = refs;\n handlerRef.current = handler;\n });\n const markInside = useCallback((e: ReactPress) => {\n insideRef.current = e.nativeEvent;\n }, []);\n useEffect(() => {\n if (!enabled) return;\n const mark: PressMark = (press) => {\n insideRef.current = press;\n };\n const watched = Array.isArray(refsRef.current) ? refsRef.current : [refsRef.current];\n for (const r of watched) {\n const set = watchers.get(r) ?? new Set<PressMark>();\n set.add(mark);\n watchers.set(r, set);\n }\n const onPointerDown = (e: Event) => {\n const inside = insideRef.current === e;\n insideRef.current = null;\n if (inside) return;\n const target = e.target as Node;\n const list = Array.isArray(refsRef.current) ? refsRef.current : [refsRef.current];\n for (const r of list) {\n if (r.current?.contains(target)) return;\n }\n handlerRef.current();\n };\n document.addEventListener(\"pointerdown\", onPointerDown);\n return () => {\n document.removeEventListener(\"pointerdown\", onPointerDown);\n for (const r of watched) watchers.get(r)?.delete(mark);\n };\n }, [enabled]);\n return markInside;\n}\n"],"mappings":";AAAA,SAAS,aAAa,WAAW,cAAc;AAE/C,SAAS,mBAAmB;AAmE5B,MAAM,SAAkB,CAAC;AAIzB,MAAM,UAAU,oBAAI,QAAe;AAInC,IAAI,WAAyE;AAE7E,SAAS,SAAS,GAAsD;AACtE,SAAO,iBAAiB,IAAI,EAAE,cAAc;AAC9C;AAEA,SAAS,UAAU,GAAwB;AACzC,MAAI,EAAE,QAAQ,SAAU;AAExB,QAAM,MAAM,YAAY,CAAC,IAAI,SAAY,OAAO,OAAO,SAAS,CAAC;AACjE,aAAW,MAAM,EAAE,OAAO,GAAG,OAAO,KAAK,MAAM,MAAM,IAAI;AAC3D;AAGA,SAAS,SAAS,GAAwB;AACxC,WAAS,GAAG,KAAK;AACnB;AAEA,SAAS,SAAS,GAAuC,MAAwB;AAC/E,QAAM,SAAS,SAAS,CAAC;AACzB,QAAM,SAAS;AACf,MAAI,OAAO,QAAQ,YAAY,CAAC,UAAU,OAAO,UAAU,UAAU,OAAO,KAAM,QAAO;AACzF,MAAI,QAAQ,IAAI,MAAM,EAAG,QAAO;AAChC,SAAO,OAAO;AAGd,IAAE,eAAe;AACjB,MAAI,KAAM,GAAE,gBAAgB;AAE5B,MAAI,OAAO,SAAS,OAAO,KAAK,EAAG,QAAO,MAAM,OAAO,MAAM;AAC7D,SAAO;AACT;AAEA,SAAS,KAAK,OAAoB;AAChC,MAAI,OAAO,WAAW,GAAG;AACvB,aAAS,iBAAiB,WAAW,WAAW,IAAI;AACpD,aAAS,iBAAiB,WAAW,QAAQ;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A,MACnC;AACA,iBAAW,QAAQ;AAAA,IACrB;AACA,aAAS,iBAAiB,eAAe,aAAa;AACtD,WAAO,MAAM;AACX,eAAS,oBAAoB,eAAe,aAAa;AACzD,iBAAW,KAAK,QAAS,UAAS,IAAI,CAAC,GAAG,OAAO,IAAI;AAAA,IACvD;AAAA,EACF,GAAG,CAAC,OAAO,CAAC;AACZ,SAAO;AACT;","names":[]}
|
package/dist/i18n/german.js
CHANGED
|
@@ -304,7 +304,9 @@ function germanLabels(numberLocale) {
|
|
|
304
304
|
fieldValue: (field, value) => `${field}: ${value}`,
|
|
305
305
|
opensInNewTab: "\xF6ffnet in einem neuen Tab",
|
|
306
306
|
aboutField: (field) => `Hilfe zu \u201E${field}\u201C`,
|
|
307
|
-
help: "Hilfe"
|
|
307
|
+
help: "Hilfe",
|
|
308
|
+
showMore: "Mehr",
|
|
309
|
+
showLess: "Weniger"
|
|
308
310
|
},
|
|
309
311
|
dataTable: {
|
|
310
312
|
columns: "Spalten",
|
|
@@ -317,6 +319,7 @@ function germanLabels(numberLocale) {
|
|
|
317
319
|
cancelSelection: "Abbrechen",
|
|
318
320
|
rowDetails: "Details",
|
|
319
321
|
autoSize: "Spaltenbreiten anpassen",
|
|
322
|
+
hiddenForWidth: "aus Platzgr\xFCnden ausgeblendet",
|
|
320
323
|
loading: "Wird geladen\u2026",
|
|
321
324
|
filters: "Filter",
|
|
322
325
|
// Resets every active filter; "Alle löschen" would read as deleting the filters.
|
|
@@ -367,6 +370,8 @@ function germanLabels(numberLocale) {
|
|
|
367
370
|
booleanTrue: "Ja",
|
|
368
371
|
booleanFalse: "Nein",
|
|
369
372
|
booleanUnset: "Nicht festgelegt",
|
|
373
|
+
loadMore: "Mehr laden",
|
|
374
|
+
allLoaded: "Alle Zeilen geladen",
|
|
370
375
|
sortBy: "Sortieren nach",
|
|
371
376
|
sortDefault: "Standardreihenfolge",
|
|
372
377
|
sortAscending: "Aufsteigend",
|