@hjmds/design-contracts 1.47.0 → 1.49.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/dist/card.d.ts +5 -0
- package/dist/card.d.ts.map +1 -1
- package/dist/card.js +3 -0
- package/dist/card.js.map +1 -1
- package/dist/catalog.d.ts +56 -18
- package/dist/catalog.d.ts.map +1 -1
- package/dist/catalog.js +15 -11
- package/dist/catalog.js.map +1 -1
- package/dist/component-recipes.d.ts +5 -1
- package/dist/component-recipes.d.ts.map +1 -1
- package/dist/component-recipes.js +4 -2
- package/dist/component-recipes.js.map +1 -1
- package/dist/data-table.d.ts +12 -0
- package/dist/data-table.d.ts.map +1 -1
- package/dist/data-table.js +2 -0
- package/dist/data-table.js.map +1 -1
- package/dist/drawing-editor.d.ts +96 -0
- package/dist/drawing-editor.d.ts.map +1 -0
- package/dist/drawing-editor.js +43 -0
- package/dist/drawing-editor.js.map +1 -0
- package/dist/share-sheet.d.ts +115 -0
- package/dist/share-sheet.d.ts.map +1 -0
- package/dist/share-sheet.js +62 -0
- package/dist/share-sheet.js.map +1 -0
- package/dist/timeline.d.ts +7 -0
- package/dist/timeline.d.ts.map +1 -1
- package/dist/timeline.js +7 -0
- package/dist/timeline.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/version.js.map +1 -1
- package/docs/dialog.md +2 -3
- package/docs/drawing-editor.md +14 -0
- package/docs/generated/component-maturity.md +13 -12
- package/docs/generated/renderer-evidence.json +122 -22
- package/docs/generated/renderer-evidence.md +18 -16
- package/docs/generated/showcase-manifest.json +70 -19
- package/docs/optional-adapters.md +21 -5
- package/docs/stable-core.md +37 -0
- package/docs/timeline.md +13 -0
- package/docs/usage/README.md +13 -11
- package/docs/usage/components/badge.md +10 -1
- package/docs/usage/components/card.md +1 -0
- package/docs/usage/components/data-table.md +2 -0
- package/docs/usage/components/dialog.md +3 -3
- package/docs/usage/components/drawing-editor.md +133 -0
- package/docs/usage/components/follow-list-screen.md +3 -3
- package/docs/usage/components/image-choice-group.md +1 -1
- package/docs/usage/components/share-sheet.md +139 -0
- package/docs/usage/components/shared-transition-element.md +1 -1
- package/docs/usage/components/sheet.md +13 -1
- package/docs/usage/components/timeline.md +27 -3
- package/docs/usage/compositions/interaction-adapters.md +2 -2
- package/docs/usage/compositions/optional-adapters.md +2 -2
- package/docs/usage/screens/common-follow-list.md +3 -3
- package/package.json +12 -1
package/dist/data-table.d.ts
CHANGED
|
@@ -384,6 +384,18 @@ export declare const dataTableFamilyRecipe: {
|
|
|
384
384
|
alpha?: number;
|
|
385
385
|
}>;
|
|
386
386
|
};
|
|
387
|
+
readonly currentPeriod: {
|
|
388
|
+
readonly background: Readonly<{
|
|
389
|
+
source: "theme";
|
|
390
|
+
key: "surfaceSelected";
|
|
391
|
+
alpha?: number;
|
|
392
|
+
}>;
|
|
393
|
+
readonly color: Readonly<{
|
|
394
|
+
source: "theme";
|
|
395
|
+
key: "text";
|
|
396
|
+
alpha?: number;
|
|
397
|
+
}>;
|
|
398
|
+
};
|
|
387
399
|
};
|
|
388
400
|
export type LineScoreTeam = Readonly<{
|
|
389
401
|
id: string;
|
package/dist/data-table.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data-table.d.ts","sourceRoot":"","sources":["../src/data-table.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,oBAAoB,EAEpB,aAAa,EACb,aAAa,EACb,wBAAwB,EACzB,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAsD,KAAK,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAGxG,MAAM,MAAM,cAAc,GAAG,OAAO,GAAG,QAAQ,GAAG,KAAK,CAAC;AAExD,MAAM,MAAM,yBAAyB,CAAC,GAAG,SAAS,aAAa,GAAG,aAAa,IAAI,QAAQ,CAAC;IAC1F,EAAE,EAAE,GAAG,CAAC;IACR,2EAA2E;IAC3E,MAAM,EAAE,MAAM,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ipe = {
|
|
|
367
367
|
* canvas-colored selected row read as a white gap that split the table (2026-10-17 review E17).
|
|
368
368
|
*/
|
|
369
369
|
highlight: { background: semanticColors.surface.brand },
|
|
370
|
+
// 2026-10-26: current inning follows category selection; my-team emphasis retains its brand role.
|
|
371
|
+
currentPeriod: { background: semanticColors.selection.background, color: semanticColors.selection.content },
|
|
370
372
|
};
|
|
371
373
|
/**
|
|
372
374
|
* Period columns are padded to `minPeriods` (9 innings) and extend for extra innings; totals follow.
|
package/dist/data-table.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data-table.js","sourceRoot":"","sources":["../src/data-table.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,UAAU,EAAuB,MAAM,uBAAuB,CAAC;AAQrF,OAAO,EAAE,sBAAsB,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAC1F,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,EAA0C,MAAM,kBAAkB,CAAC;AACxG,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAwBtD,MAAM,CAAC,MAAM,uBAAuB,GAAG;IACrC,KAAK,EAAE,OAAO;IACd,QAAQ,EAAE,KAAK;CAC0D,CAAC;AAE5E,SAAS,cAAc,CAAC,KAAa,EAAE,KAAa;IAClD,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC3D,MAAM,IAAI,SAAS,CAAC,aAAa,KAAK,oBAAoB,CAAC,CAAC;IAC9D,CAAC;AACH,CAAC;AAED,MAAM,UAAU,wBAAwB,CACtC,OAAkD;IAElD,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACzB,MAAM,IAAI,SAAS,CAAC,4CAA4C,CAAC,CAAC;IACpE,CAAC;IACD,MAAM,GAAG,GAAG,IAAI,GAAG,EAAO,CAAC;IAC3B,KAA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IAAI,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC;QAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,KAAK,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC;IAC1J,MAAM,MAAM,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAC5E,4FAA4F;IAC5F,MAAM,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,GAAG,IAAI,GAAG,KAAK,CAAC;IAClH,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,GAAG,GAAG,EAAE,KAAK,GAAG,GAAG,CAAC,EAAE,CAAC;AAChF,CAAC","sourcesContent":["import { accentColor, themeColor, type ColorReference } from \"./color-references.js\";\nimport type {\n AsyncCollectionState,\n BehaviorContract,\n CheckboxState,\n CollectionKey,\n CollectionSelectionModel,\n} from \"./behaviors.js\";\nimport { collectionItemContract, focusIndicatorContract } from \"./component-contracts.js\";\nimport { control, fontWeight, spacing, type FontWeightValue, type TextVariant } from \"./foundations.js\";\nimport { semanticColors } from \"./semantic-colors.js\";\n\nexport type DataTableAlign = \"start\" | \"center\" | \"end\";\n\nexport type DataTableColumnDescriptor<Key extends CollectionKey = CollectionKey> = Readonly<{\n id: Key;\n /** Visible column header text; also the columnheader's accessible name. */\n header: string;\n align?: DataTableAlign;\n sortable?: boolean;\n /** Layout hint only (px or flex-basis); renderers may ignore or clamp it. */\n width?: number;\n /**\n * First press sorts descending (TanStack Table `sortDescFirst`). Stat tables read \"highest first\";\n * lower-is-better columns (ERA, rank) leave it false. Added 2026-10-14 with the Native renderer.\n */\n sortDescFirst?: boolean;\n /**\n * Keeps the column visible while the others scroll horizontally (AG Grid / TanStack column\n * pinning, start edge only). Only a leading run of pinned columns is honored.\n */\n pinned?: \"start\";\n}>;\n\nexport const dataTableColumnDefaults = {\n align: \"start\",\n sortable: false,\n} as const satisfies Readonly<{ align: DataTableAlign; sortable: boolean }>;\n\nfunction assertNonEmpty(value: string, field: string): void {\n if (typeof value !== \"string\" || value.trim().length === 0) {\n throw new TypeError(`DataTable ${field} must not be empty`);\n }\n}\n\nexport function validateDataTableColumns<Key extends CollectionKey>(\n columns: readonly DataTableColumnDescriptor<Key>[],\n): void {\n if (columns.length === 0) {\n throw new TypeError(\"DataTable must declare at least one column\");\n }\n const ids = new Set<Key>();\n for (const column of columns) {\n assertNonEmpty(column.id, \"column id\");\n if (ids.has(column.id)) {\n throw new TypeError(`Duplicate DataTable column id: ${column.id}`);\n }\n ids.add(column.id);\n assertNonEmpty(column.header, `column \"${column.id}\" header`);\n if (column.width !== undefined && (!Number.isFinite(column.width) || column.width <= 0)) {\n throw new RangeError(`DataTable column \"${column.id}\" width must be a positive finite number`);\n }\n }\n}\n\n/**\n * Row identity and selection deliberately do NOT reuse `CollectionItemDescriptor`\n * verbatim: a table row has no single visible `label`/`textValue` the way a\n * Menu or Select item does — its \"content\" is however many columns the\n * product renders per row. Only the parts of the Collection base contract\n * that are genuinely row-shaped (`CollectionKey` identity, `disabled`) apply.\n */\nexport type DataTableRowDescriptor<Key extends CollectionKey = CollectionKey> = Readonly<{\n id: Key;\n disabled?: boolean;\n /** Sub-row nesting (TanStack `depth`): 1 indents a substitute under a starter. 0–3. */\n depth?: number;\n}>;\n\nexport function validateDataTableRows<Key extends CollectionKey>(\n rows: readonly DataTableRowDescriptor<Key>[],\n): void {\n const ids = new Set<Key>();\n for (const row of rows) {\n assertNonEmpty(row.id, \"row id\");\n if (ids.has(row.id)) {\n throw new TypeError(`Duplicate DataTable row id: ${row.id}`);\n }\n ids.add(row.id);\n if (row.depth !== undefined && (!Number.isInteger(row.depth) || row.depth < 0 || row.depth > 3)) {\n throw new RangeError(`DataTable row \"${String(row.id)}\" depth must be an integer from 0 to 3`);\n }\n }\n}\n\n/** Row selection is the unmodified Collection base contract — no DataTable-only selection shape. */\nexport type DataTableSelection<Key extends CollectionKey = CollectionKey> =\n CollectionSelectionModel<Key>;\n\n/**\n * Header \"select all\" state as the same tri-state `CheckboxState` the\n * selection column's checkbox already renders (check/dash), instead of a new\n * `\"none\" | \"some\" | \"all\"` enum the recipe would have to translate again.\n * Disabled rows are excluded from both the denominator and the count.\n */\nexport function resolveDataTableSelectAllState<Key extends CollectionKey>(\n rows: readonly DataTableRowDescriptor<Key>[],\n selectedKeys: ReadonlySet<Key>,\n): CheckboxState {\n const selectable = rows.filter((row) => !row.disabled);\n if (selectable.length === 0) return false;\n const selectedCount = selectable.filter((row) => selectedKeys.has(row.id)).length;\n if (selectedCount === 0) return false;\n if (selectedCount === selectable.length) return true;\n return \"mixed\";\n}\n\n/**\n * Values are the literal `aria-sort` vocabulary (minus `\"none\"`, which is\n * `null`) so the Web renderer passes them through without a translation\n * table — the same \"pass the platform value through\" choice Slider makes\n * for `valueText`.\n */\nexport type DataTableSortDirection = \"ascending\" | \"descending\";\n\nexport type DataTableSortState<Key extends CollectionKey = CollectionKey> = Readonly<{\n columnId: Key;\n direction: DataTableSortDirection;\n}> | null;\n\nexport type DataTableSortCycle = \"two-state\" | \"three-state\";\n\nexport const dataTableDefaults = {\n sortCycle: \"three-state\",\n} as const satisfies Readonly<{ sortCycle: DataTableSortCycle }>;\n\nexport function validateDataTableSortState<Key extends CollectionKey>(\n state: DataTableSortState<Key>,\n columns: readonly DataTableColumnDescriptor<Key>[],\n): void {\n if (state === null) return;\n if (state.direction !== \"ascending\" && state.direction !== \"descending\") {\n throw new TypeError(`Unsupported DataTable sort direction: ${String(state.direction)}`);\n }\n const column = columns.find((candidate) => candidate.id === state.columnId);\n if (!column) {\n throw new TypeError(`DataTable sort references unknown column id: ${String(state.columnId)}`);\n }\n if (!column.sortable) {\n throw new TypeError(`DataTable column \"${String(state.columnId)}\" is not sortable`);\n }\n}\n\n/**\n * Pure toggle: does not read or write product data. The product still owns\n * actually re-sorting rows (Combobox's local/external filtering split is the\n * same boundary — HJM judges intent, never executes the data operation).\n */\nexport function getNextDataTableSortState<Key extends CollectionKey>(\n current: DataTableSortState<Key>,\n columnId: Key,\n cycle: DataTableSortCycle = dataTableDefaults.sortCycle,\n firstDirection: DataTableSortDirection = \"ascending\",\n): DataTableSortState<Key> {\n const second: DataTableSortDirection = firstDirection === \"ascending\" ? \"descending\" : \"ascending\";\n if (current === null || current.columnId !== columnId) {\n return { columnId, direction: firstDirection };\n }\n if (current.direction === firstDirection) {\n return { columnId, direction: second };\n }\n return cycle === \"three-state\" ? null : { columnId, direction: firstDirection };\n}\n\n/** The first direction a column's header applies, from `sortDescFirst`. */\nexport function dataTableFirstSortDirection(column: Pick<DataTableColumnDescriptor, \"sortDescFirst\">): DataTableSortDirection {\n return column.sortDescFirst ? \"descending\" : \"ascending\";\n}\n\nexport type DataTableSortValue = number | string | null | undefined;\n\n/**\n * Sort key for a displayed cell string: \"0.340\", \".340\", \"36 ⅓\", \"13.5억\", \"61.0%\" → numbers;\n * text such as \"7승0무3패\" or names stay strings; \"—\", \"-\" and \"\" are missing.\n */\nexport function toDataTableSortValue(value: unknown): DataTableSortValue {\n if (value === null || value === undefined) return null;\n if (typeof value === \"number\") return Number.isFinite(value) ? value : null;\n const text = String(value).trim();\n if (!text || text === \"—\" || text === \"-\" || text === \"–\") return null;\n // Two or more letters (any script) mean a label, not a number with a unit.\n if (/\\p{L}.*\\p{L}/u.test(text.replace(/[⅓⅔]/g, \"\"))) return text;\n const number = Number.parseFloat(text.replace(/[^0-9.+-]/g, \"\"));\n return Number.isFinite(number) ? number : text;\n}\n\n/**\n * Pure comparison: numbers numerically, strings with `localeCompare`, numbers before strings.\n * Missing values are not compared here; `sortDataTableRows` always sinks them.\n */\nexport function compareDataTableValues(a: Exclude<DataTableSortValue, null | undefined>, b: Exclude<DataTableSortValue, null | undefined>, locale?: string): number {\n if (typeof a === \"number\" && typeof b === \"number\") return a - b;\n if (typeof a === \"number\") return -1;\n if (typeof b === \"number\") return 1;\n return a.localeCompare(b, locale);\n}\n\n/**\n * Optional row-model helper (TanStack `getSortedRowModel` with `sortUndefined: \"last\"`): stable,\n * missing values always last in both directions. 1.20 left all sorting to products; Yajalal and\n * other stat tables reimplemented the same rules, so the shared helper exists now. Products with\n * server-side sorting keep calling `getNextDataTableSortState` only.\n */\nexport function sortDataTableRows<Row, Key extends CollectionKey>(\n rows: readonly Row[],\n sort: DataTableSortState<Key>,\n getValue: (row: Row, columnId: Key) => DataTableSortValue,\n options: Readonly<{ locale?: string }> = {},\n): Row[] {\n const indexed = rows.map((row, index) => ({ row, index }));\n if (!sort) return indexed.map(item => item.row);\n const sign = sort.direction === \"ascending\" ? 1 : -1;\n return indexed.sort((x, y) => {\n const a = getValue(x.row, sort.columnId), b = getValue(y.row, sort.columnId);\n const missingA = a === null || a === undefined, missingB = b === null || b === undefined;\n if (missingA || missingB) return missingA === missingB ? x.index - y.index : missingA ? 1 : -1;\n return sign * compareDataTableValues(a, b, options.locale) || x.index - y.index;\n }).map(item => item.row);\n}\n\n/** Leading pinned columns (only an unbroken run from the start is pinned). */\nexport function splitPinnedDataTableColumns<Column extends Pick<DataTableColumnDescriptor, \"pinned\">>(columns: readonly Column[]): Readonly<{ pinned: readonly Column[]; scrolling: readonly Column[] }> {\n let count = 0;\n while (count < columns.length && columns[count]!.pinned === \"start\") count++;\n return { pinned: columns.slice(0, count), scrolling: columns.slice(count) };\n}\n\n/** The whole table's row-loading status — the unmodified Collection base async contract. */\nexport type DataTableAsyncState = AsyncCollectionState;\n\nexport type DataTableDensity = \"compact\" | \"regular\";\n\n/**\n * Reuses `collectionItemContract`'s hover/selected/focus tokens instead of a\n * second set of row-interaction colors — Menu, Select, and DataTable rows\n * stay one visual vocabulary.\n */\nexport const dataTableRecipe = {\n slots: [\n \"root\",\n \"header\",\n \"headerCell\",\n \"sortButton\",\n \"sortIcon\",\n \"row\",\n \"cell\",\n \"selectionCell\",\n \"emptyState\",\n \"errorState\",\n ] as const,\n defaults: { density: \"regular\" },\n density: {\n compact: { paddingVertical: spacing.xs, paddingHorizontal: spacing.sm },\n regular: { paddingVertical: spacing.sm, paddingHorizontal: spacing.md },\n },\n header: {\n background: semanticColors.canvas,\n color: semanticColors.content.secondary,\n textVariant: \"label\",\n fontWeight: fontWeight.medium,\n borderBottom: semanticColors.border.default,\n },\n row: {\n borderBottom: semanticColors.border.subtle,\n hoverBackground: collectionItemContract.highlightedBackground,\n selectedBackground: collectionItemContract.selectedBackground,\n },\n cell: {\n color: semanticColors.content.body,\n textVariant: \"body\",\n },\n sortButton: {\n minTarget: control.minTouchTarget,\n color: semanticColors.content.secondary,\n activeColor: semanticColors.content.brand,\n },\n selectionCell: {\n width: control.minTouchTarget,\n },\n emptyState: {\n color: semanticColors.content.secondary,\n textVariant: \"body\",\n },\n errorState: {\n color: semanticColors.content.danger,\n textVariant: \"body\",\n },\n states: {\n focus: focusIndicatorContract,\n },\n} as const satisfies {\n slots: readonly [\n \"root\",\n \"header\",\n \"headerCell\",\n \"sortButton\",\n \"sortIcon\",\n \"row\",\n \"cell\",\n \"selectionCell\",\n \"emptyState\",\n \"errorState\",\n ];\n defaults: { density: DataTableDensity };\n density: Record<DataTableDensity, { paddingVertical: number; paddingHorizontal: number }>;\n header: {\n background: ColorReference;\n color: ColorReference;\n textVariant: TextVariant;\n fontWeight: FontWeightValue;\n borderBottom: ColorReference;\n };\n row: {\n borderBottom: ColorReference;\n hoverBackground: ColorReference;\n selectedBackground: ColorReference;\n };\n cell: { color: ColorReference; textVariant: TextVariant };\n sortButton: { minTarget: number; color: ColorReference; activeColor: ColorReference };\n selectionCell: { width: number };\n emptyState: { color: ColorReference; textVariant: TextVariant };\n errorState: { color: ColorReference; textVariant: TextVariant };\n states: { focus: typeof focusIndicatorContract };\n};\n\nexport const dataTableFamilyScenarios = [\n \"header-groups-span-contiguous-leaf-columns-and-pad-ungrouped-columns\",\n \"row-groups-insert-a-section-label-before-their-rows\",\n \"cell-tone-and-heat-are-product-decided-semantic-emphasis\",\n \"percentile-rank-flips-for-lower-is-better-stats-and-ties-take-the-midpoint\",\n \"bounded-height-tables-keep-the-header-fixed-while-the-body-scrolls\",\n \"line-score-pads-to-nine-periods-and-extends-for-extra-periods\",\n \"matrix-diagonal-is-a-blank-self-cell\",\n \"comparison-bars-favor-the-better-side-even-when-lower-is-better\",\n] as const;\n\n/**\n * No roving-tabindex grid keyboard navigation (arrow keys between cells):\n * no product using this contract has measured demand for full ARIA-grid\n * traversal, and it is a materially bigger accessibility surface than a\n * sortable header button plus native checkbox/radio tab stops.\n */\nexport const dataTableBehavior = {\n controlled: [\"selection\"],\n inputs: [\"columns\", \"rows\", \"sortState\", \"asyncState\"],\n events: [\"onSortChange\"],\n configuration: { sortCycle: [\"two-state\", \"three-state\"] },\n defaults: dataTableDefaults,\n stateAxes: {\n value: [\"selected\"],\n content: [\"idle\", \"loading\", \"loadingMore\", \"empty\", \"error\"],\n },\n web: {\n roles: [\"table\", \"row\", \"columnheader\", \"cell\", \"button\", \"checkbox\", \"radio\"],\n keyboard: [\"Tab\", \"Enter\", \"Space\"],\n focus: \"native\",\n },\n native: { roles: [\"button\", \"header\"], states: [\"selected\"], actions: [\"activate\"] },\n scenarios: [\n \"sort-desc-first-columns-start-descending-and-cycle-back\",\n \"missing-values-sink-to-the-bottom-in-both-directions\",\n \"pinned-start-columns-stay-visible-while-the-rest-scrolls\",\n \"row-selection-reuses-the-shared-collection-selection-model-unchanged\",\n \"select-all-reuses-the-shared-tri-state-checkbox-value\",\n \"async-state-reuses-the-shared-collection-async-state-unchanged\",\n \"sortable-header-is-a-button-inside-the-columnheader-not-the-header-itself\",\n \"sort-direction-values-pass-through-to-aria-sort-without-translation\",\n \"disabled-rows-are-excluded-from-select-all-accounting\",\n \"pagination-or-load-more-is-composed-beneath-the-table-not-owned-by-it\",\n \"row-expansion-is-not-owned-here-compose-the-disclosure-group-contract-per-row\",\n \"a-data-cell-exposes-at-most-one-focusable-control\",\n \"no-roving-tabindex-grid-navigation-is-implied\",\n ...dataTableFamilyScenarios,\n ],\n} as const satisfies BehaviorContract;\n\n/* ------------------------------------------------------------------------------------------------\n * Table family, 2026-10-14 (user request: research table libraries and absorb several table types).\n * Concepts re-derived, nothing vendored:\n * - column header groups (TanStack Table `getHeaderGroups`, AG Grid column groups),\n * - row groups with a section label and indented sub-rows (AG Grid row grouping, TanStack expanding),\n * - conditional cell tone and percentile heat (AG Grid `cellClassRules`/cellStyle heatmaps,\n * Baseball Savant percentile color: deeper red toward the best, deeper blue toward the worst),\n * - a vertically bounded body with a fixed header (react-native-sticky-table, CSS sticky headers),\n * - sports layouts that products kept hand-building: line score (period columns + totals, MLB/ESPN),\n * cross-table matrix (head-to-head records), and two-sided comparison rows (ESPN matchup).\n * ---------------------------------------------------------------------------------------------- */\n\n/** One header band above leaf columns. Columns not listed in any group get an empty placeholder cell. */\nexport type DataTableColumnGroup<Key extends CollectionKey = CollectionKey> = Readonly<{\n id: string;\n header: string;\n columns: readonly Key[];\n}>;\n\nexport type DataTableHeaderBand = Readonly<{ id: string; header: string | null; span: number; columnIds: readonly string[] }>;\n\n/**\n * Resolves group bands over the given (already pinned-split) column order. A group must cover a\n * contiguous run; columns outside every group become placeholder bands so leaf widths still line up.\n */\nexport function resolveDataTableHeaderBands<Key extends CollectionKey>(\n columns: readonly Pick<DataTableColumnDescriptor<Key>, \"id\">[],\n groups: readonly DataTableColumnGroup<Key>[],\n): DataTableHeaderBand[] {\n const owner = new Map<Key, DataTableColumnGroup<Key>>();\n for (const group of groups) {\n assertNonEmpty(group.id, \"column group id\");\n assertNonEmpty(group.header, `column group \"${group.id}\" header`);\n for (const id of group.columns) {\n if (owner.has(id)) throw new TypeError(`DataTable column \"${String(id)}\" belongs to two groups`);\n owner.set(id, group);\n }\n }\n const bands: { id: string; header: string | null; columnIds: string[] }[] = [];\n for (const column of columns) {\n const group = owner.get(column.id) ?? null;\n const last = bands.at(-1);\n if (group && last && last.id === group.id) { last.columnIds.push(column.id); continue; }\n if (group && bands.some((band) => band.id === group.id)) throw new TypeError(`DataTable column group \"${group.id}\" must be contiguous`);\n bands.push({ id: group ? group.id : `placeholder-${column.id}`, header: group ? group.header : null, columnIds: [column.id] });\n }\n return bands.map((band) => ({ ...band, span: band.columnIds.length }));\n}\n\n/** Labeled row section (e.g. 선발 / 교체, 동부 / 서부). Rows not in any group render first, ungrouped. */\nexport type DataTableRowGroup<Key extends CollectionKey = CollectionKey> = Readonly<{\n id: string;\n label: string;\n rows: readonly Key[];\n}>;\n\nexport type DataTableBodyItem<Key extends CollectionKey = CollectionKey> =\n | Readonly<{ kind: \"group\"; id: string; label: string }>\n | Readonly<{ kind: \"row\"; id: Key }>;\n\n/** Flattens rows + groups into the body order renderers draw. Unknown or duplicated ids throw. */\nexport function resolveDataTableBody<Key extends CollectionKey>(\n rows: readonly DataTableRowDescriptor<Key>[],\n groups: readonly DataTableRowGroup<Key>[] = [],\n): DataTableBodyItem<Key>[] {\n if (groups.length === 0) return rows.map((row) => ({ kind: \"row\", id: row.id }));\n const known = new Set(rows.map((row) => row.id)), placed = new Set<Key>();\n const grouped: DataTableBodyItem<Key>[] = [];\n for (const group of groups) {\n assertNonEmpty(group.id, \"row group id\");\n assertNonEmpty(group.label, `row group \"${group.id}\" label`);\n grouped.push({ kind: \"group\", id: group.id, label: group.label });\n for (const id of group.rows) {\n if (!known.has(id)) throw new TypeError(`DataTable row group \"${group.id}\" references unknown row id: ${String(id)}`);\n if (placed.has(id)) throw new TypeError(`DataTable row \"${String(id)}\" belongs to two row groups`);\n placed.add(id);\n grouped.push({ kind: \"row\", id });\n }\n }\n const loose: DataTableBodyItem<Key>[] = rows.filter((row) => !placed.has(row.id)).map((row) => ({ kind: \"row\", id: row.id }));\n return [...loose, ...grouped];\n}\n\n/**\n * Semantic cell emphasis, decided by the product per cell (AG Grid cellClassRules):\n * `leader` marks a league/table best, `positive`/`negative` a direction, `muted` a non-qualifying value.\n */\nexport type DataTableCellTone = \"leader\" | \"positive\" | \"negative\" | \"muted\";\n\n/** Percentile heat (Savant): `high` side toward the best values, `low` toward the worst; strength 1–3. */\nexport type DataTableCellHeat = Readonly<{ side: \"high\" | \"low\"; strength: 1 | 2 | 3 }>;\n\n/**\n * Percentile rank (0–100, best = 100) of `value` among `sample`. `lowerIsBetter` flips ERA-style stats.\n * Ties take the midpoint rank, missing values return null. A one-value sample is the 50th percentile.\n */\nexport function percentileRank(value: number | null | undefined, sample: readonly (number | null | undefined)[], options: Readonly<{ lowerIsBetter?: boolean }> = {}): number | null {\n if (value === null || value === undefined || !Number.isFinite(value)) return null;\n const values = sample.filter((item): item is number => item !== null && item !== undefined && Number.isFinite(item));\n if (values.length <= 1) return 50;\n let below = 0, equal = 0;\n for (const item of values) {\n const better = options.lowerIsBetter ? item > value : item < value;\n if (item === value) equal++;\n else if (better) below++;\n }\n return Math.round(((below + (equal - 1) / 2) / (values.length - 1)) * 100);\n}\n\n/** Maps a percentile to heat: ≥90/≥75/≥60 high, ≤10/≤25/≤40 low, the middle stays neutral (null). */\nexport function percentileHeat(percentile: number | null): DataTableCellHeat | null {\n if (percentile === null) return null;\n if (percentile >= 90) return { side: \"high\", strength: 3 };\n if (percentile >= 75) return { side: \"high\", strength: 2 };\n if (percentile >= 60) return { side: \"high\", strength: 1 };\n if (percentile <= 10) return { side: \"low\", strength: 3 };\n if (percentile <= 25) return { side: \"low\", strength: 2 };\n if (percentile <= 40) return { side: \"low\", strength: 1 };\n return null;\n}\n\nexport const dataTableFamilyRecipe = {\n /** Heat background alpha per strength, over the high/low base colors. */\n heatAlpha: { 1: 0.14, 2: 0.26, 3: 0.42 },\n heat: { high: themeColor(\"danger\"), low: accentColor(\"info\") },\n tone: {\n leader: { color: semanticColors.content.primary, fontWeight: fontWeight.medium },\n positive: { color: themeColor(\"danger\"), fontWeight: fontWeight.medium },\n negative: { color: accentColor(\"info\"), fontWeight: fontWeight.medium },\n muted: { color: semanticColors.content.tertiary, fontWeight: fontWeight.regular },\n },\n groupRow: { background: semanticColors.surface.sunken, color: semanticColors.content.secondary, textVariant: \"label\" as TextVariant },\n /** Indent per sub-row depth level (substitutes under a starter, players under a team). */\n depthIndent: spacing.md,\n headerBand: { color: semanticColors.content.secondary, borderBottom: semanticColors.border.subtle },\n /**\n * Live period (LineScore) and \"my team\" row (MatrixTable). These tables sit on the surface tone, where DataTable's\n * canvas-colored selected row read as a white gap that split the table (2026-10-17 review E17).\n */\n highlight: { background: semanticColors.surface.brand },\n} as const;\n\n/* ---------------------------------------------- Line score ------------------------------------- */\n\nexport type LineScoreTeam = Readonly<{\n id: string;\n name: string;\n /** Runs per period; null = not played yet, \"X\" = home team did not bat in the last inning. */\n periods: readonly (number | \"X\" | null)[];\n /** Totals in display order, e.g. { R: 5, H: 9, E: 0, B: 4 }. */\n totals: Readonly<Record<string, number | null>>;\n}>;\n\nexport type LineScoreColumn = Readonly<{ id: string; header: string; kind: \"period\" | \"total\" }>;\n\n/**\n * Period columns are padded to `minPeriods` (9 innings) and extend for extra innings; totals follow.\n * The current period (live game) is reported so renderers can highlight it.\n */\nexport function resolveLineScore(teams: readonly LineScoreTeam[], options: Readonly<{ minPeriods?: number; totals: readonly string[]; currentPeriod?: number | null }>): Readonly<{ columns: LineScoreColumn[]; currentPeriod: number | null; leaderId: string | null }> {\n if (teams.length < 2) throw new TypeError(\"LineScore needs at least two teams\");\n const ids = new Set<string>();\n for (const team of teams) {\n assertNonEmpty(team.id, \"line score team id\");\n if (ids.has(team.id)) throw new TypeError(`Duplicate LineScore team id: ${team.id}`);\n ids.add(team.id);\n }\n const played = Math.max(...teams.map((team) => team.periods.length));\n const count = Math.max(options.minPeriods ?? 9, played);\n const columns: LineScoreColumn[] = Array.from({ length: count }, (_, i) => ({ id: `p${i + 1}`, header: String(i + 1), kind: \"period\" }));\n for (const total of options.totals) columns.push({ id: `t-${total}`, header: total, kind: \"total\" });\n const runs = options.totals[0];\n let leaderId: string | null = null;\n if (runs) {\n const scores = teams.map((team) => ({ id: team.id, value: team.totals[runs] ?? null }));\n const best = Math.max(...scores.map((score) => score.value ?? -Infinity));\n const leaders = scores.filter((score) => score.value === best && Number.isFinite(best));\n leaderId = leaders.length === 1 ? leaders[0]!.id : null;\n }\n const current = options.currentPeriod ?? null;\n return { columns, currentPeriod: current !== null && current >= 1 && current <= count ? current : null, leaderId };\n}\n\nexport function formatLineScoreCell(value: number | \"X\" | null | undefined): string {\n return value === null || value === undefined ? \"\" : String(value);\n}\n\n/* ---------------------------------------------- Matrix table ----------------------------------- */\n\nexport type MatrixCell = Readonly<{ label: string; tone?: DataTableCellTone | null; heat?: DataTableCellHeat | null }>;\n\n/**\n * Square cross table (team × team head-to-head). Rows and columns share one id list; the diagonal is\n * a self cell and renders blank. `getCell(row, column)` returns null for no record.\n */\nexport function resolveMatrix<Key extends string>(ids: readonly Key[], getCell: (row: Key, column: Key) => MatrixCell | null): readonly (readonly (MatrixCell | \"self\" | null)[])[] {\n if (new Set(ids).size !== ids.length) throw new TypeError(\"Matrix ids must be unique\");\n return ids.map((row) => ids.map((column) => (row === column ? \"self\" : getCell(row, column))));\n}\n\n/* ---------------------------------------------- Comparison table ------------------------------- */\n\nexport type ComparisonRow = Readonly<{\n id: string;\n label: string;\n values: readonly [number | null, number | null];\n /** Display strings; defaults to String(value). */\n display?: readonly [string, string];\n lowerIsBetter?: boolean;\n}>;\n\n/** Which side wins a row (null on ties/missing), and each side's bar share of the pair (0–1). */\nexport function resolveComparisonRow(row: ComparisonRow): Readonly<{ winner: 0 | 1 | null; shares: readonly [number, number] }> {\n const [a, b] = row.values;\n if (a === null || b === null || !Number.isFinite(a) || !Number.isFinite(b)) return { winner: null, shares: [a === null ? 0 : 0.5, b === null ? 0 : 0.5] };\n const winner = a === b ? null : (row.lowerIsBetter ? a < b : a > b) ? 0 : 1;\n // Lower-is-better rows invert the magnitudes so the better side still draws the longer bar.\n const left = Math.abs(row.lowerIsBetter ? b : a), right = Math.abs(row.lowerIsBetter ? a : b), sum = left + right;\n return { winner, shares: sum === 0 ? [0.5, 0.5] : [left / sum, right / sum] };\n}\n\n"]}
|
|
1
|
+
{"version":3,"file":"data-table.js","sourceRoot":"","sources":["../src/data-table.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,UAAU,EAAuB,MAAM,uBAAuB,CAAC;AAQrF,OAAO,EAAE,sBAAsB,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAC1F,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,EAA0C,MAAM,kBAAkB,CAAC;AACxG,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAwBtD,MAAM,CAAC,MAAM,uBAAuB,GAAG;IACrC,KAAK,EAAE,OAAO;IACd,QAAQ,EAAE,KAAK;CAC0D,CAAC;AAE5E,SAAS,cAAc,CAAC,KAAa,EAAE,KAAa;IAClD,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC3D,MAAM,IAAI,SAAS,CAAC,aAAa,KAAK,oBAAoB,CAAC,C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IAAI,GAAG,KAAK,CAAC;IAClH,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,GAAG,GAAG,EAAE,KAAK,GAAG,GAAG,CAAC,EAAE,CAAC;AAChF,CAAC","sourcesContent":["import { accentColor, themeColor, type ColorReference } from \"./color-references.js\";\nimport type {\n AsyncCollectionState,\n BehaviorContract,\n CheckboxState,\n CollectionKey,\n CollectionSelectionModel,\n} from \"./behaviors.js\";\nimport { collectionItemContract, focusIndicatorContract } from \"./component-contracts.js\";\nimport { control, fontWeight, spacing, type FontWeightValue, type TextVariant } from \"./foundations.js\";\nimport { semanticColors } from \"./semantic-colors.js\";\n\nexport type DataTableAlign = \"start\" | \"center\" | \"end\";\n\nexport type DataTableColumnDescriptor<Key extends CollectionKey = CollectionKey> = Readonly<{\n id: Key;\n /** Visible column header text; also the columnheader's accessible name. */\n header: string;\n align?: DataTableAlign;\n sortable?: boolean;\n /** Layout hint only (px or flex-basis); renderers may ignore or clamp it. */\n width?: number;\n /**\n * First press sorts descending (TanStack Table `sortDescFirst`). Stat tables read \"highest first\";\n * lower-is-better columns (ERA, rank) leave it false. Added 2026-10-14 with the Native renderer.\n */\n sortDescFirst?: boolean;\n /**\n * Keeps the column visible while the others scroll horizontally (AG Grid / TanStack column\n * pinning, start edge only). Only a leading run of pinned columns is honored.\n */\n pinned?: \"start\";\n}>;\n\nexport const dataTableColumnDefaults = {\n align: \"start\",\n sortable: false,\n} as const satisfies Readonly<{ align: DataTableAlign; sortable: boolean }>;\n\nfunction assertNonEmpty(value: string, field: string): void {\n if (typeof value !== \"string\" || value.trim().length === 0) {\n throw new TypeError(`DataTable ${field} must not be empty`);\n }\n}\n\nexport function validateDataTableColumns<Key extends CollectionKey>(\n columns: readonly DataTableColumnDescriptor<Key>[],\n): void {\n if (columns.length === 0) {\n throw new TypeError(\"DataTable must declare at least one column\");\n }\n const ids = new Set<Key>();\n for (const column of columns) {\n assertNonEmpty(column.id, \"column id\");\n if (ids.has(column.id)) {\n throw new TypeError(`Duplicate DataTable column id: ${column.id}`);\n }\n ids.add(column.id);\n assertNonEmpty(column.header, `column \"${column.id}\" header`);\n if (column.width !== undefined && (!Number.isFinite(column.width) || column.width <= 0)) {\n throw new RangeError(`DataTable column \"${column.id}\" width must be a positive finite number`);\n }\n }\n}\n\n/**\n * Row identity and selection deliberately do NOT reuse `CollectionItemDescriptor`\n * verbatim: a table row has no single visible `label`/`textValue` the way a\n * Menu or Select item does — its \"content\" is however many columns the\n * product renders per row. Only the parts of the Collection base contract\n * that are genuinely row-shaped (`CollectionKey` identity, `disabled`) apply.\n */\nexport type DataTableRowDescriptor<Key extends CollectionKey = CollectionKey> = Readonly<{\n id: Key;\n disabled?: boolean;\n /** Sub-row nesting (TanStack `depth`): 1 indents a substitute under a starter. 0–3. */\n depth?: number;\n}>;\n\nexport function validateDataTableRows<Key extends CollectionKey>(\n rows: readonly DataTableRowDescriptor<Key>[],\n): void {\n const ids = new Set<Key>();\n for (const row of rows) {\n assertNonEmpty(row.id, \"row id\");\n if (ids.has(row.id)) {\n throw new TypeError(`Duplicate DataTable row id: ${row.id}`);\n }\n ids.add(row.id);\n if (row.depth !== undefined && (!Number.isInteger(row.depth) || row.depth < 0 || row.depth > 3)) {\n throw new RangeError(`DataTable row \"${String(row.id)}\" depth must be an integer from 0 to 3`);\n }\n }\n}\n\n/** Row selection is the unmodified Collection base contract — no DataTable-only selection shape. */\nexport type DataTableSelection<Key extends CollectionKey = CollectionKey> =\n CollectionSelectionModel<Key>;\n\n/**\n * Header \"select all\" state as the same tri-state `CheckboxState` the\n * selection column's checkbox already renders (check/dash), instead of a new\n * `\"none\" | \"some\" | \"all\"` enum the recipe would have to translate again.\n * Disabled rows are excluded from both the denominator and the count.\n */\nexport function resolveDataTableSelectAllState<Key extends CollectionKey>(\n rows: readonly DataTableRowDescriptor<Key>[],\n selectedKeys: ReadonlySet<Key>,\n): CheckboxState {\n const selectable = rows.filter((row) => !row.disabled);\n if (selectable.length === 0) return false;\n const selectedCount = selectable.filter((row) => selectedKeys.has(row.id)).length;\n if (selectedCount === 0) return false;\n if (selectedCount === selectable.length) return true;\n return \"mixed\";\n}\n\n/**\n * Values are the literal `aria-sort` vocabulary (minus `\"none\"`, which is\n * `null`) so the Web renderer passes them through without a translation\n * table — the same \"pass the platform value through\" choice Slider makes\n * for `valueText`.\n */\nexport type DataTableSortDirection = \"ascending\" | \"descending\";\n\nexport type DataTableSortState<Key extends CollectionKey = CollectionKey> = Readonly<{\n columnId: Key;\n direction: DataTableSortDirection;\n}> | null;\n\nexport type DataTableSortCycle = \"two-state\" | \"three-state\";\n\nexport const dataTableDefaults = {\n sortCycle: \"three-state\",\n} as const satisfies Readonly<{ sortCycle: DataTableSortCycle }>;\n\nexport function validateDataTableSortState<Key extends CollectionKey>(\n state: DataTableSortState<Key>,\n columns: readonly DataTableColumnDescriptor<Key>[],\n): void {\n if (state === null) return;\n if (state.direction !== \"ascending\" && state.direction !== \"descending\") {\n throw new TypeError(`Unsupported DataTable sort direction: ${String(state.direction)}`);\n }\n const column = columns.find((candidate) => candidate.id === state.columnId);\n if (!column) {\n throw new TypeError(`DataTable sort references unknown column id: ${String(state.columnId)}`);\n }\n if (!column.sortable) {\n throw new TypeError(`DataTable column \"${String(state.columnId)}\" is not sortable`);\n }\n}\n\n/**\n * Pure toggle: does not read or write product data. The product still owns\n * actually re-sorting rows (Combobox's local/external filtering split is the\n * same boundary — HJM judges intent, never executes the data operation).\n */\nexport function getNextDataTableSortState<Key extends CollectionKey>(\n current: DataTableSortState<Key>,\n columnId: Key,\n cycle: DataTableSortCycle = dataTableDefaults.sortCycle,\n firstDirection: DataTableSortDirection = \"ascending\",\n): DataTableSortState<Key> {\n const second: DataTableSortDirection = firstDirection === \"ascending\" ? \"descending\" : \"ascending\";\n if (current === null || current.columnId !== columnId) {\n return { columnId, direction: firstDirection };\n }\n if (current.direction === firstDirection) {\n return { columnId, direction: second };\n }\n return cycle === \"three-state\" ? null : { columnId, direction: firstDirection };\n}\n\n/** The first direction a column's header applies, from `sortDescFirst`. */\nexport function dataTableFirstSortDirection(column: Pick<DataTableColumnDescriptor, \"sortDescFirst\">): DataTableSortDirection {\n return column.sortDescFirst ? \"descending\" : \"ascending\";\n}\n\nexport type DataTableSortValue = number | string | null | undefined;\n\n/**\n * Sort key for a displayed cell string: \"0.340\", \".340\", \"36 ⅓\", \"13.5억\", \"61.0%\" → numbers;\n * text such as \"7승0무3패\" or names stay strings; \"—\", \"-\" and \"\" are missing.\n */\nexport function toDataTableSortValue(value: unknown): DataTableSortValue {\n if (value === null || value === undefined) return null;\n if (typeof value === \"number\") return Number.isFinite(value) ? value : null;\n const text = String(value).trim();\n if (!text || text === \"—\" || text === \"-\" || text === \"–\") return null;\n // Two or more letters (any script) mean a label, not a number with a unit.\n if (/\\p{L}.*\\p{L}/u.test(text.replace(/[⅓⅔]/g, \"\"))) return text;\n const number = Number.parseFloat(text.replace(/[^0-9.+-]/g, \"\"));\n return Number.isFinite(number) ? number : text;\n}\n\n/**\n * Pure comparison: numbers numerically, strings with `localeCompare`, numbers before strings.\n * Missing values are not compared here; `sortDataTableRows` always sinks them.\n */\nexport function compareDataTableValues(a: Exclude<DataTableSortValue, null | undefined>, b: Exclude<DataTableSortValue, null | undefined>, locale?: string): number {\n if (typeof a === \"number\" && typeof b === \"number\") return a - b;\n if (typeof a === \"number\") return -1;\n if (typeof b === \"number\") return 1;\n return a.localeCompare(b, locale);\n}\n\n/**\n * Optional row-model helper (TanStack `getSortedRowModel` with `sortUndefined: \"last\"`): stable,\n * missing values always last in both directions. 1.20 left all sorting to products; Yajalal and\n * other stat tables reimplemented the same rules, so the shared helper exists now. Products with\n * server-side sorting keep calling `getNextDataTableSortState` only.\n */\nexport function sortDataTableRows<Row, Key extends CollectionKey>(\n rows: readonly Row[],\n sort: DataTableSortState<Key>,\n getValue: (row: Row, columnId: Key) => DataTableSortValue,\n options: Readonly<{ locale?: string }> = {},\n): Row[] {\n const indexed = rows.map((row, index) => ({ row, index }));\n if (!sort) return indexed.map(item => item.row);\n const sign = sort.direction === \"ascending\" ? 1 : -1;\n return indexed.sort((x, y) => {\n const a = getValue(x.row, sort.columnId), b = getValue(y.row, sort.columnId);\n const missingA = a === null || a === undefined, missingB = b === null || b === undefined;\n if (missingA || missingB) return missingA === missingB ? x.index - y.index : missingA ? 1 : -1;\n return sign * compareDataTableValues(a, b, options.locale) || x.index - y.index;\n }).map(item => item.row);\n}\n\n/** Leading pinned columns (only an unbroken run from the start is pinned). */\nexport function splitPinnedDataTableColumns<Column extends Pick<DataTableColumnDescriptor, \"pinned\">>(columns: readonly Column[]): Readonly<{ pinned: readonly Column[]; scrolling: readonly Column[] }> {\n let count = 0;\n while (count < columns.length && columns[count]!.pinned === \"start\") count++;\n return { pinned: columns.slice(0, count), scrolling: columns.slice(count) };\n}\n\n/** The whole table's row-loading status — the unmodified Collection base async contract. */\nexport type DataTableAsyncState = AsyncCollectionState;\n\nexport type DataTableDensity = \"compact\" | \"regular\";\n\n/**\n * Reuses `collectionItemContract`'s hover/selected/focus tokens instead of a\n * second set of row-interaction colors — Menu, Select, and DataTable rows\n * stay one visual vocabulary.\n */\nexport const dataTableRecipe = {\n slots: [\n \"root\",\n \"header\",\n \"headerCell\",\n \"sortButton\",\n \"sortIcon\",\n \"row\",\n \"cell\",\n \"selectionCell\",\n \"emptyState\",\n \"errorState\",\n ] as const,\n defaults: { density: \"regular\" },\n density: {\n compact: { paddingVertical: spacing.xs, paddingHorizontal: spacing.sm },\n regular: { paddingVertical: spacing.sm, paddingHorizontal: spacing.md },\n },\n header: {\n background: semanticColors.canvas,\n color: semanticColors.content.secondary,\n textVariant: \"label\",\n fontWeight: fontWeight.medium,\n borderBottom: semanticColors.border.default,\n },\n row: {\n borderBottom: semanticColors.border.subtle,\n hoverBackground: collectionItemContract.highlightedBackground,\n selectedBackground: collectionItemContract.selectedBackground,\n },\n cell: {\n color: semanticColors.content.body,\n textVariant: \"body\",\n },\n sortButton: {\n minTarget: control.minTouchTarget,\n color: semanticColors.content.secondary,\n activeColor: semanticColors.content.brand,\n },\n selectionCell: {\n width: control.minTouchTarget,\n },\n emptyState: {\n color: semanticColors.content.secondary,\n textVariant: \"body\",\n },\n errorState: {\n color: semanticColors.content.danger,\n textVariant: \"body\",\n },\n states: {\n focus: focusIndicatorContract,\n },\n} as const satisfies {\n slots: readonly [\n \"root\",\n \"header\",\n \"headerCell\",\n \"sortButton\",\n \"sortIcon\",\n \"row\",\n \"cell\",\n \"selectionCell\",\n \"emptyState\",\n \"errorState\",\n ];\n defaults: { density: DataTableDensity };\n density: Record<DataTableDensity, { paddingVertical: number; paddingHorizontal: number }>;\n header: {\n background: ColorReference;\n color: ColorReference;\n textVariant: TextVariant;\n fontWeight: FontWeightValue;\n borderBottom: ColorReference;\n };\n row: {\n borderBottom: ColorReference;\n hoverBackground: ColorReference;\n selectedBackground: ColorReference;\n };\n cell: { color: ColorReference; textVariant: TextVariant };\n sortButton: { minTarget: number; color: ColorReference; activeColor: ColorReference };\n selectionCell: { width: number };\n emptyState: { color: ColorReference; textVariant: TextVariant };\n errorState: { color: ColorReference; textVariant: TextVariant };\n states: { focus: typeof focusIndicatorContract };\n};\n\nexport const dataTableFamilyScenarios = [\n \"header-groups-span-contiguous-leaf-columns-and-pad-ungrouped-columns\",\n \"row-groups-insert-a-section-label-before-their-rows\",\n \"cell-tone-and-heat-are-product-decided-semantic-emphasis\",\n \"percentile-rank-flips-for-lower-is-better-stats-and-ties-take-the-midpoint\",\n \"bounded-height-tables-keep-the-header-fixed-while-the-body-scrolls\",\n \"line-score-pads-to-nine-periods-and-extends-for-extra-periods\",\n \"matrix-diagonal-is-a-blank-self-cell\",\n \"comparison-bars-favor-the-better-side-even-when-lower-is-better\",\n] as const;\n\n/**\n * No roving-tabindex grid keyboard navigation (arrow keys between cells):\n * no product using this contract has measured demand for full ARIA-grid\n * traversal, and it is a materially bigger accessibility surface than a\n * sortable header button plus native checkbox/radio tab stops.\n */\nexport const dataTableBehavior = {\n controlled: [\"selection\"],\n inputs: [\"columns\", \"rows\", \"sortState\", \"asyncState\"],\n events: [\"onSortChange\"],\n configuration: { sortCycle: [\"two-state\", \"three-state\"] },\n defaults: dataTableDefaults,\n stateAxes: {\n value: [\"selected\"],\n content: [\"idle\", \"loading\", \"loadingMore\", \"empty\", \"error\"],\n },\n web: {\n roles: [\"table\", \"row\", \"columnheader\", \"cell\", \"button\", \"checkbox\", \"radio\"],\n keyboard: [\"Tab\", \"Enter\", \"Space\"],\n focus: \"native\",\n },\n native: { roles: [\"button\", \"header\"], states: [\"selected\"], actions: [\"activate\"] },\n scenarios: [\n \"sort-desc-first-columns-start-descending-and-cycle-back\",\n \"missing-values-sink-to-the-bottom-in-both-directions\",\n \"pinned-start-columns-stay-visible-while-the-rest-scrolls\",\n \"row-selection-reuses-the-shared-collection-selection-model-unchanged\",\n \"select-all-reuses-the-shared-tri-state-checkbox-value\",\n \"async-state-reuses-the-shared-collection-async-state-unchanged\",\n \"sortable-header-is-a-button-inside-the-columnheader-not-the-header-itself\",\n \"sort-direction-values-pass-through-to-aria-sort-without-translation\",\n \"disabled-rows-are-excluded-from-select-all-accounting\",\n \"pagination-or-load-more-is-composed-beneath-the-table-not-owned-by-it\",\n \"row-expansion-is-not-owned-here-compose-the-disclosure-group-contract-per-row\",\n \"a-data-cell-exposes-at-most-one-focusable-control\",\n \"no-roving-tabindex-grid-navigation-is-implied\",\n ...dataTableFamilyScenarios,\n ],\n} as const satisfies BehaviorContract;\n\n/* ------------------------------------------------------------------------------------------------\n * Table family, 2026-10-14 (user request: research table libraries and absorb several table types).\n * Concepts re-derived, nothing vendored:\n * - column header groups (TanStack Table `getHeaderGroups`, AG Grid column groups),\n * - row groups with a section label and indented sub-rows (AG Grid row grouping, TanStack expanding),\n * - conditional cell tone and percentile heat (AG Grid `cellClassRules`/cellStyle heatmaps,\n * Baseball Savant percentile color: deeper red toward the best, deeper blue toward the worst),\n * - a vertically bounded body with a fixed header (react-native-sticky-table, CSS sticky headers),\n * - sports layouts that products kept hand-building: line score (period columns + totals, MLB/ESPN),\n * cross-table matrix (head-to-head records), and two-sided comparison rows (ESPN matchup).\n * ---------------------------------------------------------------------------------------------- */\n\n/** One header band above leaf columns. Columns not listed in any group get an empty placeholder cell. */\nexport type DataTableColumnGroup<Key extends CollectionKey = CollectionKey> = Readonly<{\n id: string;\n header: string;\n columns: readonly Key[];\n}>;\n\nexport type DataTableHeaderBand = Readonly<{ id: string; header: string | null; span: number; columnIds: readonly string[] }>;\n\n/**\n * Resolves group bands over the given (already pinned-split) column order. A group must cover a\n * contiguous run; columns outside every group become placeholder bands so leaf widths still line up.\n */\nexport function resolveDataTableHeaderBands<Key extends CollectionKey>(\n columns: readonly Pick<DataTableColumnDescriptor<Key>, \"id\">[],\n groups: readonly DataTableColumnGroup<Key>[],\n): DataTableHeaderBand[] {\n const owner = new Map<Key, DataTableColumnGroup<Key>>();\n for (const group of groups) {\n assertNonEmpty(group.id, \"column group id\");\n assertNonEmpty(group.header, `column group \"${group.id}\" header`);\n for (const id of group.columns) {\n if (owner.has(id)) throw new TypeError(`DataTable column \"${String(id)}\" belongs to two groups`);\n owner.set(id, group);\n }\n }\n const bands: { id: string; header: string | null; columnIds: string[] }[] = [];\n for (const column of columns) {\n const group = owner.get(column.id) ?? null;\n const last = bands.at(-1);\n if (group && last && last.id === group.id) { last.columnIds.push(column.id); continue; }\n if (group && bands.some((band) => band.id === group.id)) throw new TypeError(`DataTable column group \"${group.id}\" must be contiguous`);\n bands.push({ id: group ? group.id : `placeholder-${column.id}`, header: group ? group.header : null, columnIds: [column.id] });\n }\n return bands.map((band) => ({ ...band, span: band.columnIds.length }));\n}\n\n/** Labeled row section (e.g. 선발 / 교체, 동부 / 서부). Rows not in any group render first, ungrouped. */\nexport type DataTableRowGroup<Key extends CollectionKey = CollectionKey> = Readonly<{\n id: string;\n label: string;\n rows: readonly Key[];\n}>;\n\nexport type DataTableBodyItem<Key extends CollectionKey = CollectionKey> =\n | Readonly<{ kind: \"group\"; id: string; label: string }>\n | Readonly<{ kind: \"row\"; id: Key }>;\n\n/** Flattens rows + groups into the body order renderers draw. Unknown or duplicated ids throw. */\nexport function resolveDataTableBody<Key extends CollectionKey>(\n rows: readonly DataTableRowDescriptor<Key>[],\n groups: readonly DataTableRowGroup<Key>[] = [],\n): DataTableBodyItem<Key>[] {\n if (groups.length === 0) return rows.map((row) => ({ kind: \"row\", id: row.id }));\n const known = new Set(rows.map((row) => row.id)), placed = new Set<Key>();\n const grouped: DataTableBodyItem<Key>[] = [];\n for (const group of groups) {\n assertNonEmpty(group.id, \"row group id\");\n assertNonEmpty(group.label, `row group \"${group.id}\" label`);\n grouped.push({ kind: \"group\", id: group.id, label: group.label });\n for (const id of group.rows) {\n if (!known.has(id)) throw new TypeError(`DataTable row group \"${group.id}\" references unknown row id: ${String(id)}`);\n if (placed.has(id)) throw new TypeError(`DataTable row \"${String(id)}\" belongs to two row groups`);\n placed.add(id);\n grouped.push({ kind: \"row\", id });\n }\n }\n const loose: DataTableBodyItem<Key>[] = rows.filter((row) => !placed.has(row.id)).map((row) => ({ kind: \"row\", id: row.id }));\n return [...loose, ...grouped];\n}\n\n/**\n * Semantic cell emphasis, decided by the product per cell (AG Grid cellClassRules):\n * `leader` marks a league/table best, `positive`/`negative` a direction, `muted` a non-qualifying value.\n */\nexport type DataTableCellTone = \"leader\" | \"positive\" | \"negative\" | \"muted\";\n\n/** Percentile heat (Savant): `high` side toward the best values, `low` toward the worst; strength 1–3. */\nexport type DataTableCellHeat = Readonly<{ side: \"high\" | \"low\"; strength: 1 | 2 | 3 }>;\n\n/**\n * Percentile rank (0–100, best = 100) of `value` among `sample`. `lowerIsBetter` flips ERA-style stats.\n * Ties take the midpoint rank, missing values return null. A one-value sample is the 50th percentile.\n */\nexport function percentileRank(value: number | null | undefined, sample: readonly (number | null | undefined)[], options: Readonly<{ lowerIsBetter?: boolean }> = {}): number | null {\n if (value === null || value === undefined || !Number.isFinite(value)) return null;\n const values = sample.filter((item): item is number => item !== null && item !== undefined && Number.isFinite(item));\n if (values.length <= 1) return 50;\n let below = 0, equal = 0;\n for (const item of values) {\n const better = options.lowerIsBetter ? item > value : item < value;\n if (item === value) equal++;\n else if (better) below++;\n }\n return Math.round(((below + (equal - 1) / 2) / (values.length - 1)) * 100);\n}\n\n/** Maps a percentile to heat: ≥90/≥75/≥60 high, ≤10/≤25/≤40 low, the middle stays neutral (null). */\nexport function percentileHeat(percentile: number | null): DataTableCellHeat | null {\n if (percentile === null) return null;\n if (percentile >= 90) return { side: \"high\", strength: 3 };\n if (percentile >= 75) return { side: \"high\", strength: 2 };\n if (percentile >= 60) return { side: \"high\", strength: 1 };\n if (percentile <= 10) return { side: \"low\", strength: 3 };\n if (percentile <= 25) return { side: \"low\", strength: 2 };\n if (percentile <= 40) return { side: \"low\", strength: 1 };\n return null;\n}\n\nexport const dataTableFamilyRecipe = {\n /** Heat background alpha per strength, over the high/low base colors. */\n heatAlpha: { 1: 0.14, 2: 0.26, 3: 0.42 },\n heat: { high: themeColor(\"danger\"), low: accentColor(\"info\") },\n tone: {\n leader: { color: semanticColors.content.primary, fontWeight: fontWeight.medium },\n positive: { color: themeColor(\"danger\"), fontWeight: fontWeight.medium },\n negative: { color: accentColor(\"info\"), fontWeight: fontWeight.medium },\n muted: { color: semanticColors.content.tertiary, fontWeight: fontWeight.regular },\n },\n groupRow: { background: semanticColors.surface.sunken, color: semanticColors.content.secondary, textVariant: \"label\" as TextVariant },\n /** Indent per sub-row depth level (substitutes under a starter, players under a team). */\n depthIndent: spacing.md,\n headerBand: { color: semanticColors.content.secondary, borderBottom: semanticColors.border.subtle },\n /**\n * Live period (LineScore) and \"my team\" row (MatrixTable). These tables sit on the surface tone, where DataTable's\n * canvas-colored selected row read as a white gap that split the table (2026-10-17 review E17).\n */\n highlight: { background: semanticColors.surface.brand },\n // 2026-10-26: current inning follows category selection; my-team emphasis retains its brand role.\n currentPeriod: { background: semanticColors.selection.background, color: semanticColors.selection.content },\n} as const;\n\n/* ---------------------------------------------- Line score ------------------------------------- */\n\nexport type LineScoreTeam = Readonly<{\n id: string;\n name: string;\n /** Runs per period; null = not played yet, \"X\" = home team did not bat in the last inning. */\n periods: readonly (number | \"X\" | null)[];\n /** Totals in display order, e.g. { R: 5, H: 9, E: 0, B: 4 }. */\n totals: Readonly<Record<string, number | null>>;\n}>;\n\nexport type LineScoreColumn = Readonly<{ id: string; header: string; kind: \"period\" | \"total\" }>;\n\n/**\n * Period columns are padded to `minPeriods` (9 innings) and extend for extra innings; totals follow.\n * The current period (live game) is reported so renderers can highlight it.\n */\nexport function resolveLineScore(teams: readonly LineScoreTeam[], options: Readonly<{ minPeriods?: number; totals: readonly string[]; currentPeriod?: number | null }>): Readonly<{ columns: LineScoreColumn[]; currentPeriod: number | null; leaderId: string | null }> {\n if (teams.length < 2) throw new TypeError(\"LineScore needs at least two teams\");\n const ids = new Set<string>();\n for (const team of teams) {\n assertNonEmpty(team.id, \"line score team id\");\n if (ids.has(team.id)) throw new TypeError(`Duplicate LineScore team id: ${team.id}`);\n ids.add(team.id);\n }\n const played = Math.max(...teams.map((team) => team.periods.length));\n const count = Math.max(options.minPeriods ?? 9, played);\n const columns: LineScoreColumn[] = Array.from({ length: count }, (_, i) => ({ id: `p${i + 1}`, header: String(i + 1), kind: \"period\" }));\n for (const total of options.totals) columns.push({ id: `t-${total}`, header: total, kind: \"total\" });\n const runs = options.totals[0];\n let leaderId: string | null = null;\n if (runs) {\n const scores = teams.map((team) => ({ id: team.id, value: team.totals[runs] ?? null }));\n const best = Math.max(...scores.map((score) => score.value ?? -Infinity));\n const leaders = scores.filter((score) => score.value === best && Number.isFinite(best));\n leaderId = leaders.length === 1 ? leaders[0]!.id : null;\n }\n const current = options.currentPeriod ?? null;\n return { columns, currentPeriod: current !== null && current >= 1 && current <= count ? current : null, leaderId };\n}\n\nexport function formatLineScoreCell(value: number | \"X\" | null | undefined): string {\n return value === null || value === undefined ? \"\" : String(value);\n}\n\n/* ---------------------------------------------- Matrix table ----------------------------------- */\n\nexport type MatrixCell = Readonly<{ label: string; tone?: DataTableCellTone | null; heat?: DataTableCellHeat | null }>;\n\n/**\n * Square cross table (team × team head-to-head). Rows and columns share one id list; the diagonal is\n * a self cell and renders blank. `getCell(row, column)` returns null for no record.\n */\nexport function resolveMatrix<Key extends string>(ids: readonly Key[], getCell: (row: Key, column: Key) => MatrixCell | null): readonly (readonly (MatrixCell | \"self\" | null)[])[] {\n if (new Set(ids).size !== ids.length) throw new TypeError(\"Matrix ids must be unique\");\n return ids.map((row) => ids.map((column) => (row === column ? \"self\" : getCell(row, column))));\n}\n\n/* ---------------------------------------------- Comparison table ------------------------------- */\n\nexport type ComparisonRow = Readonly<{\n id: string;\n label: string;\n values: readonly [number | null, number | null];\n /** Display strings; defaults to String(value). */\n display?: readonly [string, string];\n lowerIsBetter?: boolean;\n}>;\n\n/** Which side wins a row (null on ties/missing), and each side's bar share of the pair (0–1). */\nexport function resolveComparisonRow(row: ComparisonRow): Readonly<{ winner: 0 | 1 | null; shares: readonly [number, number] }> {\n const [a, b] = row.values;\n if (a === null || b === null || !Number.isFinite(a) || !Number.isFinite(b)) return { winner: null, shares: [a === null ? 0 : 0.5, b === null ? 0 : 0.5] };\n const winner = a === b ? null : (row.lowerIsBetter ? a < b : a > b) ? 0 : 1;\n // Lower-is-better rows invert the magnitudes so the better side still draws the longer bar.\n const left = Math.abs(row.lowerIsBetter ? b : a), right = Math.abs(row.lowerIsBetter ? a : b), sum = left + right;\n return { winner, shares: sum === 0 ? [0.5, 0.5] : [left / sum, right / sum] };\n}\n\n"]}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
export declare const DRAWING_INK_COLORS: readonly ["#333d4b", "#ffffff", "#e03131", "#f08c00", "#ffd43b", "#087f5b", "#3f66a5", "#7048e8", "#9c4668", "#f783ac", "#8d6e63", "#868e96"];
|
|
2
|
+
/** Default background. The person can change it; the chosen background is part of the saved photo. */
|
|
3
|
+
export declare const DRAWING_PAPER = "#fffaf2";
|
|
4
|
+
/** Background presets: the default paper, light tints that keep ink readable, and one dark ground for light ink. */
|
|
5
|
+
export declare const DRAWING_BACKGROUND_COLORS: readonly ["#fffaf2", "#ffffff", "#f1f3f5", "#ffe3e3", "#ffdeeb", "#fff3bf", "#d3f9d8", "#c5f6fa", "#d0ebff", "#e5dbff", "#333d4b"];
|
|
6
|
+
/**
|
|
7
|
+
* An eraser stroke has no colour of its own: it paints whatever the background is when drawn, so changing the
|
|
8
|
+
* background after erasing never leaves old-paper stripes (2026-10-25, background colour added).
|
|
9
|
+
*/
|
|
10
|
+
export type DrawingStroke = Readonly<{
|
|
11
|
+
width: number;
|
|
12
|
+
points: readonly [number, number][];
|
|
13
|
+
} & ({
|
|
14
|
+
color: string;
|
|
15
|
+
erase?: never;
|
|
16
|
+
} | {
|
|
17
|
+
erase: true;
|
|
18
|
+
color?: never;
|
|
19
|
+
})>;
|
|
20
|
+
export declare function drawingStrokeColor(stroke: DrawingStroke, background: string): string;
|
|
21
|
+
/** Something worth saving: an ink stroke, or a background other than the default paper. */
|
|
22
|
+
export declare function drawingHasContent(strokes: readonly DrawingStroke[], background: string): boolean;
|
|
23
|
+
export declare function drawingInkPath(stroke: DrawingStroke): string;
|
|
24
|
+
export type DrawingHistory = Readonly<{
|
|
25
|
+
past: readonly (readonly DrawingStroke[])[];
|
|
26
|
+
present: readonly DrawingStroke[];
|
|
27
|
+
future: readonly (readonly DrawingStroke[])[];
|
|
28
|
+
}>;
|
|
29
|
+
export type DrawingAction = Readonly<{
|
|
30
|
+
type: 'add';
|
|
31
|
+
stroke: DrawingStroke;
|
|
32
|
+
}> | Readonly<{
|
|
33
|
+
type: 'undo' | 'redo' | 'clear';
|
|
34
|
+
}>;
|
|
35
|
+
export declare const emptyDrawing: DrawingHistory;
|
|
36
|
+
/** A stroke, including an eraser, is one undo step. Clearing can also be undone. */
|
|
37
|
+
export declare function drawingReducer(state: DrawingHistory, action: DrawingAction): DrawingHistory;
|
|
38
|
+
/**
|
|
39
|
+
* One-row colour strip for the drawing toolbar: colours the person picked from the full picker this session come
|
|
40
|
+
* first (newest first, at most four), then the presets. Recent colours are not stored; the drawing itself is.
|
|
41
|
+
*/
|
|
42
|
+
export declare function drawingQuickColors(recent: readonly string[]): readonly string[];
|
|
43
|
+
/** Shared editor geometry; the 400px cap leaves tools visible on phone-sized hosts. */
|
|
44
|
+
export declare const drawingEditorRecipe: {
|
|
45
|
+
readonly maxCanvas: 400;
|
|
46
|
+
readonly minCanvas: 160;
|
|
47
|
+
readonly gap: 12;
|
|
48
|
+
readonly radius: 16;
|
|
49
|
+
readonly sizePreviewMs: 700;
|
|
50
|
+
readonly brush: {
|
|
51
|
+
readonly min: 2;
|
|
52
|
+
readonly max: 32;
|
|
53
|
+
readonly step: 2;
|
|
54
|
+
readonly initial: 12;
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
export type DrawingImage = Readonly<{
|
|
58
|
+
base64: string;
|
|
59
|
+
mimeType: 'image/png' | 'image/jpeg';
|
|
60
|
+
}>;
|
|
61
|
+
export type DrawingEditorLabels = Readonly<{
|
|
62
|
+
title: string;
|
|
63
|
+
save: string;
|
|
64
|
+
close: string;
|
|
65
|
+
cancel: string;
|
|
66
|
+
failed: string;
|
|
67
|
+
pen: string;
|
|
68
|
+
eraser: string;
|
|
69
|
+
undo: string;
|
|
70
|
+
redo: string;
|
|
71
|
+
clear: string;
|
|
72
|
+
width: string;
|
|
73
|
+
moreColors: string;
|
|
74
|
+
penColor: string;
|
|
75
|
+
background: string;
|
|
76
|
+
backgroundPresets: string;
|
|
77
|
+
hex: string;
|
|
78
|
+
hue: string;
|
|
79
|
+
saturation: string;
|
|
80
|
+
brightness: string;
|
|
81
|
+
opacity: string;
|
|
82
|
+
invalidColor: string;
|
|
83
|
+
discardTitle: string;
|
|
84
|
+
discardBody: string;
|
|
85
|
+
discardConfirm: string;
|
|
86
|
+
}>;
|
|
87
|
+
/** Upload, account identity and navigation stay in the product. Reject on failure to retain the drawing. */
|
|
88
|
+
export type DrawingEditorProps = Readonly<{
|
|
89
|
+
labels: DrawingEditorLabels;
|
|
90
|
+
onSave(image: DrawingImage): Promise<void>;
|
|
91
|
+
onCancel(): void;
|
|
92
|
+
cropPreview?: 'circle' | 'none';
|
|
93
|
+
safeAreaBottom?: number;
|
|
94
|
+
testID?: string;
|
|
95
|
+
}>;
|
|
96
|
+
//# sourceMappingURL=drawing-editor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"drawing-editor.d.ts","sourceRoot":"","sources":["../src/drawing-editor.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,kBAAkB,+IAAgJ,CAAC;AAChL,sGAAsG;AACtG,eAAO,MAAM,aAAa,YAAY,CAAC;AACvC,oHAAoH;AACpH,eAAO,MAAM,yBAAyB,oIAAqI,CAAC;AAC5K;;;GAGG;AACH,MAAM,MAAM,aAAa,GAAG,QAAQ,CAAC;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,CAAA;CAAE,GAAG,CAAC;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,KAAK,CAAA;CAAE,GAAG;IAAE,KAAK,EAAE,IAAI,CAAC;IAAC,KAAK,CAAC,EAAE,KAAK,CAAA;CAAE,CAAC,CAAC,CAAC;AACnK,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM,CAEpF;AACD,2FAA2F;AAC3F,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,SAAS,aAAa,EAAE,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAEhG;AACD,wBAAgB,cAAc,CAAC,MAAM,EAAE,aAAa,GAAG,MAAM,CAE5D;AAED,MAAM,MAAM,cAAc,GAAG,QA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,CAAC;IACtF,UAAU,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAC;IAAC,iBAAiB,EAAE,MAAM,CAAC;IACpF,GAAG,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,MAAM,CAAC;IACxG,YAAY,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAC;IAAC,cAAc,EAAE,MAAM,CAAC;CACnE,CAAC,CAAC;AACH,4GAA4G;AAC5G,MAAM,MAAM,kBAAkB,GAAG,QAAQ,CAAC;IACxC,MAAM,EAAE,mBAAmB,CAAC;IAC5B,MAAM,CAAC,KAAK,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC3C,QAAQ,IAAI,IAAI,CAAC;IACjB,WAAW,CAAC,EAAE,QAAQ,GAAG,MAAM,CAAC;IAChC,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
export const DRAWING_INK_COLORS = ['#333d4b', '#ffffff', '#e03131', '#f08c00', '#ffd43b', '#087f5b', '#3f66a5', '#7048e8', '#9c4668', '#f783ac', '#8d6e63', '#868e96'];
|
|
2
|
+
/** Default background. The person can change it; the chosen background is part of the saved photo. */
|
|
3
|
+
export const DRAWING_PAPER = '#fffaf2';
|
|
4
|
+
/** Background presets: the default paper, light tints that keep ink readable, and one dark ground for light ink. */
|
|
5
|
+
export const DRAWING_BACKGROUND_COLORS = ['#fffaf2', '#ffffff', '#f1f3f5', '#ffe3e3', '#ffdeeb', '#fff3bf', '#d3f9d8', '#c5f6fa', '#d0ebff', '#e5dbff', '#333d4b'];
|
|
6
|
+
export function drawingStrokeColor(stroke, background) {
|
|
7
|
+
return stroke.erase ? background : stroke.color;
|
|
8
|
+
}
|
|
9
|
+
/** Something worth saving: an ink stroke, or a background other than the default paper. */
|
|
10
|
+
export function drawingHasContent(strokes, background) {
|
|
11
|
+
return background !== DRAWING_PAPER || strokes.some(stroke => !stroke.erase);
|
|
12
|
+
}
|
|
13
|
+
export function drawingInkPath(stroke) {
|
|
14
|
+
return stroke.points.map(([x, y], i) => `${i ? 'L' : 'M'}${x.toFixed(1)},${y.toFixed(1)}`).join(' ') + (stroke.points.length === 1 ? ' l0.1,0.1' : '');
|
|
15
|
+
}
|
|
16
|
+
export const emptyDrawing = { past: [], present: [], future: [] };
|
|
17
|
+
/** A stroke, including an eraser, is one undo step. Clearing can also be undone. */
|
|
18
|
+
export function drawingReducer(state, action) {
|
|
19
|
+
if (action.type === 'undo') {
|
|
20
|
+
const previous = state.past.at(-1);
|
|
21
|
+
return previous ? { past: state.past.slice(0, -1), present: previous, future: [state.present, ...state.future] } : state;
|
|
22
|
+
}
|
|
23
|
+
if (action.type === 'redo') {
|
|
24
|
+
const next = state.future[0];
|
|
25
|
+
return next ? { past: [...state.past, state.present], present: next, future: state.future.slice(1) } : state;
|
|
26
|
+
}
|
|
27
|
+
if (action.type === 'clear' && !state.present.length)
|
|
28
|
+
return state;
|
|
29
|
+
return { past: [...state.past, state.present], present: action.type === 'add' ? [...state.present, action.stroke] : [], future: [] };
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* One-row colour strip for the drawing toolbar: colours the person picked from the full picker this session come
|
|
33
|
+
* first (newest first, at most four), then the presets. Recent colours are not stored; the drawing itself is.
|
|
34
|
+
*/
|
|
35
|
+
export function drawingQuickColors(recent) {
|
|
36
|
+
return [...new Set([...recent.slice(0, 4), ...DRAWING_INK_COLORS])];
|
|
37
|
+
}
|
|
38
|
+
/** Shared editor geometry; the 400px cap leaves tools visible on phone-sized hosts. */
|
|
39
|
+
export const drawingEditorRecipe = {
|
|
40
|
+
maxCanvas: 400, minCanvas: 160, gap: 12, radius: 16, sizePreviewMs: 700,
|
|
41
|
+
brush: { min: 2, max: 32, step: 2, initial: 12 },
|
|
42
|
+
};
|
|
43
|
+
//# sourceMappingURL=drawing-editor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"drawing-editor.js","sourceRoot":"","sources":["../src/drawing-editor.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,CAAU,CAAC;AAChL,sGAAsG;AACtG,MAAM,CAAC,MAAM,aAAa,GAAG,SAAS,CAAC;AACvC,oHAAoH;AACpH,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,CAAU,CAAC;AAM5K,MAAM,UAAU,kBAAkB,CAAC,MAAqB,EAAE,UAAkB;IAC1E,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC;AAClD,CAAC;AACD,2FAA2F;AAC3F,MAAM,UAAU,iBAAiB,CAAC,OAAiC,EAAE,UAAkB;IACrF,OAAO,UAAU,KAAK,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AAC/E,CAAC;AACD,MAAM,UAAU,cAAc,CAAC,MAAqB;IAClD,OAAO,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,GAAG,C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C,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC;IAC/G,CAAC;IACD,IAAI,MAAM,CAAC,IAAI,KAAK,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM;QAAE,OAAO,KAAK,CAAC;IACnE,OAAO,EAAE,IAAI,EAAE,CAAC,GAAG,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,OAAO,CAAC,EAAE,OAAO,EAAE,MAAM,CAAC,IAAI,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC;AACvI,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,kBAAkB,CAAC,MAAyB;IAC1D,OAAO,CAAC,GAAG,IAAI,GAAG,CAAC,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,GAAG,kBAAkB,CAAC,CAAC,CAAC,CAAC;AACtE,CAAC;AAED,uFAAuF;AACvF,MAAM,CAAC,MAAM,mBAAmB,GAAG;IACjC,SAAS,EAAE,GAAG,EAAE,SAAS,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,aAAa,EAAE,GAAG;IACvE,KAAK,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE;CACxC,CAAC","sourcesContent":["export const DRAWING_INK_COLORS = ['#333d4b', '#ffffff', '#e03131', '#f08c00', '#ffd43b', '#087f5b', '#3f66a5', '#7048e8', '#9c4668', '#f783ac', '#8d6e63', '#868e96'] as const;\n/** Default background. The person can change it; the chosen background is part of the saved photo. */\nexport const DRAWING_PAPER = '#fffaf2';\n/** Background presets: the default paper, light tints that keep ink readable, and one dark ground for light ink. */\nexport const DRAWING_BACKGROUND_COLORS = ['#fffaf2', '#ffffff', '#f1f3f5', '#ffe3e3', '#ffdeeb', '#fff3bf', '#d3f9d8', '#c5f6fa', '#d0ebff', '#e5dbff', '#333d4b'] as const;\n/**\n * An eraser stroke has no colour of its own: it paints whatever the background is when drawn, so changing the\n * background after erasing never leaves old-paper stripes (2026-10-25, background colour added).\n */\nexport type DrawingStroke = Readonly<{ width: number; points: readonly [number, number][] } & ({ color: string; erase?: never } | { erase: true; color?: never })>;\nexport function drawingStrokeColor(stroke: DrawingStroke, background: string): string {\n return stroke.erase ? background : stroke.color;\n}\n/** Something worth saving: an ink stroke, or a background other than the default paper. */\nexport function drawingHasContent(strokes: readonly DrawingStroke[], background: string): boolean {\n return background !== DRAWING_PAPER || strokes.some(stroke => !stroke.erase);\n}\nexport function drawingInkPath(stroke: DrawingStroke): string {\n return stroke.points.map(([x, y], i) => `${i ? 'L' : 'M'}${x.toFixed(1)},${y.toFixed(1)}`).join(' ') + (stroke.points.length === 1 ? ' l0.1,0.1' : '');\n}\n\nexport type DrawingHistory = Readonly<{\n past: readonly (readonly DrawingStroke[])[];\n present: readonly DrawingStroke[];\n future: readonly (readonly DrawingStroke[])[];\n}>;\nexport type DrawingAction = Readonly<{ type: 'add'; stroke: DrawingStroke }> | Readonly<{ type: 'undo' | 'redo' | 'clear' }>;\nexport const emptyDrawing: DrawingHistory = { past: [], present: [], future: [] };\n/** A stroke, including an eraser, is one undo step. Clearing can also be undone. */\nexport function drawingReducer(state: DrawingHistory, action: DrawingAction): DrawingHistory {\n if (action.type === 'undo') {\n const previous = state.past.at(-1);\n return previous ? { past: state.past.slice(0, -1), present: previous, future: [state.present, ...state.future] } : state;\n }\n if (action.type === 'redo') {\n const next = state.future[0];\n return next ? { past: [...state.past, state.present], present: next, future: state.future.slice(1) } : state;\n }\n if (action.type === 'clear' && !state.present.length) return state;\n return { past: [...state.past, state.present], present: action.type === 'add' ? [...state.present, action.stroke] : [], future: [] };\n}\n\n/**\n * One-row colour strip for the drawing toolbar: colours the person picked from the full picker this session come\n * first (newest first, at most four), then the presets. Recent colours are not stored; the drawing itself is.\n */\nexport function drawingQuickColors(recent: readonly string[]): readonly string[] {\n return [...new Set([...recent.slice(0, 4), ...DRAWING_INK_COLORS])];\n}\n\n/** Shared editor geometry; the 400px cap leaves tools visible on phone-sized hosts. */\nexport const drawingEditorRecipe = {\n maxCanvas: 400, minCanvas: 160, gap: 12, radius: 16, sizePreviewMs: 700,\n brush: { min: 2, max: 32, step: 2, initial: 12 },\n} as const;\nexport type DrawingImage = Readonly<{ base64: string; mimeType: 'image/png' | 'image/jpeg' }>;\nexport type DrawingEditorLabels = Readonly<{\n title: string; save: string; close: string; cancel: string; failed: string;\n pen: string; eraser: string; undo: string; redo: string; clear: string; width: string;\n moreColors: string; penColor: string; background: string; backgroundPresets: string;\n hex: string; hue: string; saturation: string; brightness: string; opacity: string; invalidColor: string;\n discardTitle: string; discardBody: string; discardConfirm: string;\n}>;\n/** Upload, account identity and navigation stay in the product. Reject on failure to retain the drawing. */\nexport type DrawingEditorProps = Readonly<{\n labels: DrawingEditorLabels;\n onSave(image: DrawingImage): Promise<void>;\n onCancel(): void;\n cropPreview?: 'circle' | 'none';\n safeAreaBottom?: number;\n testID?: string;\n}>;\n"]}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import { type ImageChoiceItemDescriptor } from "./image-choice.js";
|
|
2
|
+
/**
|
|
3
|
+
* Sharing one link (2026-10-26 user request "번뚝 공유 그대로 공통화"): BurnTok's Web and Native share sheets are the
|
|
4
|
+
* reference. One Sheet offers in-app recipients (optional) plus two external actions — copy link and the OS share
|
|
5
|
+
* sheet. The product owns the link, the recipient data and the delivery; HJM owns the layout, selection, in-flight
|
|
6
|
+
* guards and the honest feedback (the OS share sheet only proves it opened, never that anything was delivered).
|
|
7
|
+
*/
|
|
8
|
+
export type ShareSheetRecipientDescriptor = ImageChoiceItemDescriptor;
|
|
9
|
+
/** Where the recipient list is: the product fetches it, the sheet shows the matching state. */
|
|
10
|
+
export type ShareSheetRecipientStatus = "ready" | "loading" | "error";
|
|
11
|
+
/**
|
|
12
|
+
* What `onSend` reports back. `sentIds` are the requested ids the product delivered; every other requested id stays
|
|
13
|
+
* selected so the user can retry only those (a partial batch must not resend the delivered ones). `error` is the
|
|
14
|
+
* product's localized reason for the failures; without it the sheet shows `labels.sendFailed`.
|
|
15
|
+
*/
|
|
16
|
+
export type ShareSheetSendResult = Readonly<{
|
|
17
|
+
sentIds: readonly string[];
|
|
18
|
+
error?: string;
|
|
19
|
+
}>;
|
|
20
|
+
/** Payload for the OS share sheet. */
|
|
21
|
+
export type ShareSheetShareContent = Readonly<{
|
|
22
|
+
url: string;
|
|
23
|
+
title?: string;
|
|
24
|
+
text?: string;
|
|
25
|
+
}>;
|
|
26
|
+
/**
|
|
27
|
+
* How the OS share sheet closed. `completed` means the user picked a target, not that it was delivered; `dismissed`
|
|
28
|
+
* means they backed out (Web `AbortError`, iOS `dismissedAction`). Android always reports `completed`.
|
|
29
|
+
*/
|
|
30
|
+
export type ShareSheetSystemShareOutcome = "completed" | "dismissed";
|
|
31
|
+
/** Localized copy for the sheet chrome and the external actions. The renderer invents none. */
|
|
32
|
+
export type ShareSheetLabels = Readonly<{
|
|
33
|
+
/** Accessible name of the Sheet close action. */
|
|
34
|
+
close: string;
|
|
35
|
+
copyLink: string;
|
|
36
|
+
systemShare: string;
|
|
37
|
+
/** Announced (polite) after the link reached the clipboard. */
|
|
38
|
+
linkCopied: string;
|
|
39
|
+
/** Shown when copying or opening the OS share sheet failed. */
|
|
40
|
+
actionFailed: string;
|
|
41
|
+
}>;
|
|
42
|
+
/** Localized copy for the recipient section. */
|
|
43
|
+
export type ShareSheetRecipientLabels = Readonly<{
|
|
44
|
+
/** Accessible name of the recipient group (e.g. "Choose who to send to"). */
|
|
45
|
+
group: string;
|
|
46
|
+
/** Search field name and placeholder. */
|
|
47
|
+
search: string;
|
|
48
|
+
clearSearch: string;
|
|
49
|
+
loading: string;
|
|
50
|
+
loadFailed: string;
|
|
51
|
+
retry: string;
|
|
52
|
+
/** No recipients at all. */
|
|
53
|
+
empty: string;
|
|
54
|
+
/** Recipients exist but none match the search. */
|
|
55
|
+
noResults: string;
|
|
56
|
+
/** Item description of an already-sent recipient. */
|
|
57
|
+
sent: string;
|
|
58
|
+
/** Send failure without a product reason. */
|
|
59
|
+
sendFailed: string;
|
|
60
|
+
/** Footer action, e.g. `count => \`Send to ${count}\``. */
|
|
61
|
+
send: (count: number) => string;
|
|
62
|
+
}>;
|
|
63
|
+
export declare const shareSheetRecipe: {
|
|
64
|
+
/** The picker scrolls in a tall sheet; external actions alone keep the sheet at its content height. */
|
|
65
|
+
readonly size: {
|
|
66
|
+
recipients: "large";
|
|
67
|
+
externalOnly: "auto";
|
|
68
|
+
};
|
|
69
|
+
/** Body regions (notices, search, list) and footer rows (send button above the action row). */
|
|
70
|
+
readonly bodyGap: "md";
|
|
71
|
+
readonly footerGap: "xs";
|
|
72
|
+
/** Two round external actions centred in one row, each with its caption below (BurnTok 1.28 share footer). */
|
|
73
|
+
readonly actionGap: "xxxl";
|
|
74
|
+
readonly actionCaptionGap: "xs";
|
|
75
|
+
readonly actionButton: {
|
|
76
|
+
readonly tone: "secondary";
|
|
77
|
+
readonly size: "large";
|
|
78
|
+
};
|
|
79
|
+
readonly actionCaptionVariant: "caption";
|
|
80
|
+
readonly sendButton: {
|
|
81
|
+
readonly tone: "primary";
|
|
82
|
+
readonly size: "large";
|
|
83
|
+
};
|
|
84
|
+
/**
|
|
85
|
+
* Recipients are picked by face and name. Two name lines: a 12-character nickname ends near six Hangul glyphs on
|
|
86
|
+
* one 80-wide caption line (BurnTok share recipients, 2026-10-18).
|
|
87
|
+
*/
|
|
88
|
+
readonly picker: {
|
|
89
|
+
readonly showItemLabels: true;
|
|
90
|
+
readonly itemLabelLines: 2;
|
|
91
|
+
};
|
|
92
|
+
};
|
|
93
|
+
export declare function validateShareSheet(input: Readonly<{
|
|
94
|
+
title: string;
|
|
95
|
+
link: string;
|
|
96
|
+
labels: ShareSheetLabels;
|
|
97
|
+
}>): void;
|
|
98
|
+
/** Recipients the sheet shows for a search: every item for a blank query, else label matches (locale lower case). */
|
|
99
|
+
export declare function filterShareSheetRecipients<Item extends ShareSheetRecipientDescriptor>(items: readonly Item[], query: string): readonly Item[];
|
|
100
|
+
/** Validates the full recipient list (unique ids, localized labels) the same way the picker does. */
|
|
101
|
+
export declare function validateShareSheetRecipients(items: readonly ShareSheetRecipientDescriptor[]): void;
|
|
102
|
+
/**
|
|
103
|
+
* Splits one send attempt into delivered and failed ids. A product reporting an id it was not asked to send is a bug
|
|
104
|
+
* (it would mark someone as sent who never was), so it throws instead of being ignored.
|
|
105
|
+
*/
|
|
106
|
+
export declare function resolveShareSheetSendOutcome(requested: readonly string[], result: ShareSheetSendResult): Readonly<{
|
|
107
|
+
sent: readonly string[];
|
|
108
|
+
failed: readonly string[];
|
|
109
|
+
}>;
|
|
110
|
+
/**
|
|
111
|
+
* The picker value: the user's selection plus every already-sent recipient, which stays checked and locked so it
|
|
112
|
+
* cannot be sent twice.
|
|
113
|
+
*/
|
|
114
|
+
export declare function resolveShareSheetPickerValue(selected: readonly string[], sent: ReadonlySet<string>, visibleIds: readonly string[]): string[];
|
|
115
|
+
//# sourceMappingURL=share-sheet.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"share-sheet.d.ts","sourceRoot":"","sources":["../src/share-sheet.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4B,KAAK,yBAAyB,EAAkC,MAAM,mBAAmB,CAAC;AAM7H;;;;;GAKG;AACH,MAAM,MAAM,6BAA6B,GAAG,yBAAyB,CAAC;AAEtE,+FAA+F;AAC/F,MAAM,MAAM,yBAAyB,GAAG,OAAO,GAAG,SAAS,GAAG,OAAO,CAAC;AAEtE;;;;GAIG;AACH,MAAM,MAAM,oBAAoB,GAAG,QAAQ,CAAC;IAAE,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;IAAC,KAA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