@quirekit/ui 0.0.3 → 0.1.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.
Files changed (104) hide show
  1. package/LICENSE.md +1 -1
  2. package/THIRD_PARTY_NOTICES.md +1 -1
  3. package/dist/{catalog-AqWLE58Z.mjs → catalog-TxH_u9wJ.mjs} +318 -276
  4. package/dist/catalog-TxH_u9wJ.mjs.map +1 -0
  5. package/dist/{chat-BSVF78Hu.mjs → chat-CDuOfk3d.mjs} +222 -141
  6. package/dist/chat-CDuOfk3d.mjs.map +1 -0
  7. package/dist/chat.d.mts +2 -2
  8. package/dist/chat.mjs +1 -1
  9. package/dist/{code-block-pXaSN9eY.mjs → code-block-5fEEwwMN.mjs} +2 -2
  10. package/dist/{code-block-pXaSN9eY.mjs.map → code-block-5fEEwwMN.mjs.map} +1 -1
  11. package/dist/{html-sandbox-CMsenGYi.mjs → html-sandbox-BJeg9mHs.mjs} +2 -2
  12. package/dist/{html-sandbox-CMsenGYi.mjs.map → html-sandbox-BJeg9mHs.mjs.map} +1 -1
  13. package/dist/html-sandbox.mjs +1 -1
  14. package/dist/{index-Bf9CudSF.d.mts → index-BOSlg0Xl.d.mts} +212 -142
  15. package/dist/index-BOSlg0Xl.d.mts.map +1 -0
  16. package/dist/{index-DZc5z5s2.d.mts → index-CtgUjd_A.d.mts} +3 -2
  17. package/dist/index-CtgUjd_A.d.mts.map +1 -0
  18. package/dist/index.d.mts +2 -2
  19. package/dist/index.mjs +21 -4
  20. package/dist/index.mjs.map +1 -1
  21. package/dist/{model-D4-FbKXY.mjs → model-DvNHVLwg.mjs} +3 -3
  22. package/dist/{model-D4-FbKXY.mjs.map → model-DvNHVLwg.mjs.map} +1 -1
  23. package/dist/{resolve-BwTfY4PS.mjs → resolve-DlCNcx0Q.mjs} +2 -2
  24. package/dist/{resolve-BwTfY4PS.mjs.map → resolve-DlCNcx0Q.mjs.map} +1 -1
  25. package/dist/vue.d.mts +509 -458
  26. package/dist/vue.d.mts.map +1 -1
  27. package/dist/vue.mjs +3288 -2830
  28. package/dist/vue.mjs.map +1 -1
  29. package/package.json +11 -4
  30. package/src/components/chat/composer/types.ts +2 -0
  31. package/src/components/chat/message-part/types.ts +3 -1
  32. package/src/components/chat/reasoning/types.ts +1 -1
  33. package/src/components/chat/tool/types.ts +1 -1
  34. package/src/components/edit-bar/index.ts +1 -0
  35. package/src/components/edit-bar/types.ts +24 -0
  36. package/src/components/icon/custom/indicators.ts +1 -0
  37. package/src/components/icon/custom/insert.ts +3 -1
  38. package/src/components/icon/metadata.ts +12 -0
  39. package/src/components/index.ts +1 -0
  40. package/src/components/kbd/index.ts +1 -0
  41. package/src/components/kbd/platform.test.ts +16 -0
  42. package/src/components/kbd/platform.ts +16 -0
  43. package/src/components/toolbar/index.ts +1 -0
  44. package/src/components/toolbar/types.ts +8 -0
  45. package/src/locale/components/chat.ts +9 -7
  46. package/src/locale/components/edit-bar.ts +15 -0
  47. package/src/locale/components/icon-catalog/en.ts +3 -0
  48. package/src/locale/components/icon-catalog/zh-hans.ts +3 -0
  49. package/src/locale/packs/en.ts +2 -0
  50. package/src/locale/packs/zh-cn.ts +2 -0
  51. package/src/locale/types.ts +3 -0
  52. package/src/vue/action-menu/directory.vue +0 -7
  53. package/src/vue/block-handle/block-handle.test.ts +5 -0
  54. package/src/vue/block-handle/block-handle.vue +4 -11
  55. package/src/vue/block-handle/index.ts +1 -1
  56. package/src/vue/block-handle/presentation.ts +4 -0
  57. package/src/vue/chat/composer/composer.test.ts +11 -2
  58. package/src/vue/chat/composer/composer.vue +15 -3
  59. package/src/vue/chat/composer-submit/composer-submit.test.ts +5 -1
  60. package/src/vue/chat/composer-submit/composer-submit.vue +1 -1
  61. package/src/vue/chat/confirmation/confirmation.vue +3 -2
  62. package/src/vue/chat/locale.test.ts +2 -2
  63. package/src/vue/chat/message/message.test.ts +1 -1
  64. package/src/vue/chat/message/message.vue +8 -3
  65. package/src/vue/chat/message-actions/message-actions.vue +1 -1
  66. package/src/vue/chat/message-list/message-list.test.ts +2 -2
  67. package/src/vue/chat/message-list/message-list.vue +2 -2
  68. package/src/vue/chat/message-list/types.ts +2 -0
  69. package/src/vue/chat/message-list/use-scroll.test.ts +7 -1
  70. package/src/vue/chat/message-list/use-scroll.ts +12 -9
  71. package/src/vue/chat/message-part/message-part.test.ts +1 -1
  72. package/src/vue/chat/message-part/message-part.vue +2 -3
  73. package/src/vue/chat/shared/disclosure.vue +1 -1
  74. package/src/vue/chat/shared/part-actions.ts +1 -1
  75. package/src/vue/chat/shared/state-icon.ts +2 -1
  76. package/src/vue/combobox/async-value.test.ts +49 -0
  77. package/src/vue/combobox/use-combobox-model.ts +3 -1
  78. package/src/vue/component-styles.test.ts +17 -0
  79. package/src/vue/edit-bar/edit-bar.test.ts +125 -0
  80. package/src/vue/edit-bar/edit-bar.vue +108 -0
  81. package/src/vue/edit-bar/index.ts +2 -0
  82. package/src/vue/edit-bar/types.ts +21 -0
  83. package/src/vue/index.ts +1 -0
  84. package/src/vue/menu/items/disabled-submenu.test.ts +24 -0
  85. package/src/vue/menu/items/items.test.ts +29 -0
  86. package/src/vue/menu/items/items.vue +6 -0
  87. package/src/vue/menu/menu-group.vue +11 -2
  88. package/src/vue/splitter/splitter.test.ts +18 -0
  89. package/src/vue/splitter/splitter.vue +5 -2
  90. package/src/vue/task-panel/root.vue +0 -8
  91. package/src/vue/toolbar/context.ts +5 -2
  92. package/src/vue/toolbar/items/control.vue +9 -1
  93. package/src/vue/toolbar/items/sheet-entries.ts +52 -0
  94. package/src/vue/toolbar/items/sheet.test.ts +61 -0
  95. package/src/vue/toolbar/items/sheet.vue +78 -0
  96. package/src/vue/toolbar/presentation/mobile.test.ts +14 -0
  97. package/src/vue/toolbar/presentation/visibility.ts +38 -0
  98. package/src/vue/toolbar/toolbar.vue +8 -3
  99. package/src/vue/toolbar/types.ts +3 -1
  100. package/dist/catalog-AqWLE58Z.mjs.map +0 -1
  101. package/dist/chat-BSVF78Hu.mjs.map +0 -1
  102. package/dist/index-Bf9CudSF.d.mts.map +0 -1
  103. package/dist/index-DZc5z5s2.d.mts.map +0 -1
  104. package/dist/style.css +0 -37
@@ -1 +1 @@
1
- {"version":3,"file":"model-D4-FbKXY.mjs","names":["threshold"],"sources":["../src/theme/variables/references.ts","../src/components/toolbar/collapse.ts","../src/components/toolbar/navigation.ts","../src/components/toolbar/span.ts","../src/color-palette/presets.ts","../src/components/comment-rail/layout.ts","../src/components/color-picker/color.ts","../src/components/file-upload/messages.ts","../src/components/emoji-picker/catalog.ts","../src/components/emoji-picker/search.ts","../src/components/selection-handles/drag/hold.ts","../src/components/selection-handles/drag/controller.ts","../src/components/selection-handles/dom/handles.ts","../src/components/selection-handles/mount.ts","../src/components/selection-gesture/session/controller.ts","../src/components/selection-gesture/mount.ts","../src/components/table-size-picker/model.ts"],"sourcesContent":["import type { QuireKitTheme } from \"../types\";\nimport {\n themeCssVariableNames,\n type QuireKitThemeCssVariableName\n} from \"./names\";\n\n/** Semantic theme references consumed by UnoCSS and component-token compilers. */\ntype CssReferences<T> = T extends string | number\n ? string\n : { readonly [Key in keyof T]: CssReferences<T[Key]> };\n\n/** CSS-reference projection of every semantic theme value consumed by styling adapters. */\nexport type QuireKitThemeVariableReferences = CssReferences<\n Pick<QuireKitTheme, \"color\" | \"typography\" | \"spacing\" | \"radius\" | \"borderWidth\" | \"elevation\" | \"motion\" | \"opacity\" | \"layer\" | \"control\">\n>;\n\n/** Complete semantic variable references consumed by UnoCSS and component tokens. */\nexport const themeVariableReferences: QuireKitThemeVariableReferences = Object.freeze({\n color: Object.freeze({\n surface: mapSurfaceReferences(),\n text: mapTextReferences(),\n icon: mapIconReferences(),\n border: mapBorderReferences(),\n action: mapActionReferences(),\n info: mapFeedbackReferences(\"info\"),\n success: mapFeedbackReferences(\"success\"),\n warning: mapFeedbackReferences(\"warning\"),\n danger: mapFeedbackReferences(\"danger\"),\n selection: Object.freeze({\n document: reference(themeCssVariableNames.color.selection.document),\n remote: reference(themeCssVariableNames.color.selection.remote),\n dropTarget: reference(themeCssVariableNames.color.selection.dropTarget)\n })\n }),\n typography: mapTypographyReferences(),\n spacing: mapFlatReferences(themeCssVariableNames.spacing),\n radius: mapFlatReferences(themeCssVariableNames.radius),\n borderWidth: mapFlatReferences(themeCssVariableNames.borderWidth),\n elevation: mapFlatReferences(themeCssVariableNames.elevation),\n motion: mapFlatReferences(themeCssVariableNames.motion),\n opacity: mapFlatReferences(themeCssVariableNames.opacity),\n layer: mapFlatReferences(themeCssVariableNames.layer),\n control: mapFlatReferences(themeCssVariableNames.control)\n});\n\n/**\n * Creates one CSS variable reference from an already-declared name.\n *\n * @param name - Declared semantic CSS custom-property name.\n * @returns CSS var reference.\n */\nfunction reference(name: QuireKitThemeCssVariableName): string {\n return `var(${name})`;\n}\n\n/**\n * Projects declared surface variable names into CSS references.\n *\n * @returns Immutable surface references from the explicit contract.\n */\nfunction mapSurfaceReferences(): QuireKitThemeVariableReferences[\"color\"][\"surface\"] {\n const name = themeCssVariableNames.color.surface;\n return Object.freeze({\n transparent: reference(name.transparent),\n workspace: reference(name.workspace), page: reference(name.page), chrome: reference(name.chrome),\n subtle: reference(name.subtle), raised: reference(name.raised), overlay: reference(name.overlay),\n inverse: reference(name.inverse),\n hover: reference(name.hover), pressed: reference(name.pressed), selected: reference(name.selected),\n disabled: reference(name.disabled), scrim: reference(name.scrim)\n });\n}\n\n/**\n * Projects declared text variable names into CSS references.\n *\n * @returns Immutable text references from the explicit contract.\n */\nfunction mapTextReferences(): QuireKitThemeVariableReferences[\"color\"][\"text\"] {\n const name = themeCssVariableNames.color.text;\n return Object.freeze({\n primary: reference(name.primary), secondary: reference(name.secondary), tertiary: reference(name.tertiary),\n muted: reference(name.muted), placeholder: reference(name.placeholder),\n accent: reference(name.accent), disabled: reference(name.disabled), inverse: reference(name.inverse), onAccent: reference(name.onAccent)\n });\n}\n\n/**\n * Projects declared icon variable names into CSS references.\n *\n * @returns Immutable icon references from the explicit contract.\n */\nfunction mapIconReferences(): QuireKitThemeVariableReferences[\"color\"][\"icon\"] {\n const name = themeCssVariableNames.color.icon;\n return Object.freeze({\n primary: reference(name.primary), secondary: reference(name.secondary), disabled: reference(name.disabled),\n onAccent: reference(name.onAccent)\n });\n}\n\n/**\n * Projects declared boundary variable names into CSS references.\n *\n * @returns Immutable boundary references from the explicit contract.\n */\nfunction mapBorderReferences(): QuireKitThemeVariableReferences[\"color\"][\"border\"] {\n const name = themeCssVariableNames.color.border;\n return Object.freeze({\n subtle: reference(name.subtle), default: reference(name.default), strong: reference(name.strong),\n focus: reference(name.focus), disabled: reference(name.disabled)\n });\n}\n\n/**\n * Projects declared action variable names into CSS references.\n *\n * @returns Immutable action references from the explicit contract.\n */\nfunction mapActionReferences(): QuireKitThemeVariableReferences[\"color\"][\"action\"] {\n const name = themeCssVariableNames.color.action;\n return Object.freeze({\n primary: reference(name.primary), text: reference(name.text), hover: reference(name.hover), pressed: reference(name.pressed),\n soft: reference(name.soft), softHover: reference(name.softHover), softPressed: reference(name.softPressed),\n foreground: reference(name.foreground)\n });\n}\n\n/**\n * Creates references for one declared feedback family.\n *\n * @param family - Approved feedback family.\n * @returns Immutable semantic feedback references.\n */\nfunction mapFeedbackReferences(\n family: \"info\" | \"success\" | \"warning\" | \"danger\"\n): QuireKitThemeVariableReferences[\"color\"][\"info\"] {\n const name = themeCssVariableNames.color[family];\n return Object.freeze({\n surface: reference(name.surface), hoverSurface: reference(name.hoverSurface), pressedSurface: reference(name.pressedSurface),\n border: reference(name.border), text: reference(name.text), foreground: reference(name.foreground),\n solid: reference(name.solid), onSolid: reference(name.onSolid)\n });\n}\n\n/** @returns Semantic typography references backed by explicit variable names. */\nfunction mapTypographyReferences(): QuireKitThemeVariableReferences[\"typography\"] {\n const names = themeCssVariableNames.typography;\n return Object.freeze({\n display: mapFlatReferences(names.display), pageTitle: mapFlatReferences(names.pageTitle),\n sectionTitle: mapFlatReferences(names.sectionTitle), heading: mapFlatReferences(names.heading),\n body: mapFlatReferences(names.body), control: mapFlatReferences(names.control),\n compact: mapFlatReferences(names.compact), helper: mapFlatReferences(names.helper), code: mapFlatReferences(names.code)\n });\n}\n\n/**\n * Converts one explicit variable-name group into same-shaped CSS references.\n *\n * @param names - Approved variable names.\n * @returns Same-shaped CSS variable references.\n */\nfunction mapFlatReferences<T extends Readonly<Record<string, QuireKitThemeCssVariableName>>>(names: T): { readonly [Key in keyof T]: string } {\n return Object.freeze(Object.fromEntries(Object.entries(names).map(([key, name]) => [key, reference(name)]))) as { readonly [Key in keyof T]: string };\n}\n","import type { QuireKitToolbarCollapseUnit } from \"./types\";\n\n/**\n * Resolves how many leading units stay visible when trailing units collapse into a \"more\" control.\n *\n * Advances already include gaps, so the row's width is their sum. Once the row overflows, the\n * \"more\" control's advance is reserved and a separator is never left as the last visible unit.\n *\n * @param units - Units in display order with their measured advances.\n * @param available - Inline size available for the row.\n * @param moreAdvance - Inline size of the \"more\" control plus the gap before it.\n * @returns Number of leading units that remain visible.\n */\nexport function resolveQuireKitToolbarVisibleUnits(\n units: readonly QuireKitToolbarCollapseUnit[],\n available: number,\n moreAdvance: number\n): number {\n const total = units.reduce((sum, unit) => sum + unit.advance, 0);\n if (total <= available + 0.5) return units.length;\n const budget = available - moreAdvance;\n let used = 0;\n let count = 0;\n for (const unit of units) {\n if (used + unit.advance > budget) break;\n used += unit.advance;\n count += 1;\n }\n while (count > 0 && units[count - 1]!.separator) count -= 1;\n return count;\n}\n","import type {\n QuireKitToolbarNavigationOptions,\n QuireKitToolbarRovingItem\n} from \"./types\";\n\n/**\n * Resolves the single enabled toolbar item that owns the initial Tab stop.\n *\n * @param items - DOM-ordered toolbar items.\n * @param preferredId - Item that previously owned the Tab stop.\n * @returns Stable enabled item id, or undefined when every item is disabled.\n */\nexport function resolveToolbarTabStop(\n items: readonly QuireKitToolbarRovingItem[],\n preferredId?: string\n): string | undefined {\n const preferred = items.find(\n (item) => item.id === preferredId && item.disabled !== true\n );\n return preferred?.id ?? items.find((item) => item.disabled !== true)?.id;\n}\n\n/**\n * Resolves a toolbar-owned keyboard movement while skipping disabled controls.\n *\n * Home and End always reach the first and last enabled item. Horizontal arrows\n * mirror in RTL, while vertical toolbars own ArrowUp and ArrowDown.\n *\n * @param items - DOM-ordered toolbar items.\n * @param currentId - Item that dispatched the keyboard event.\n * @param key - Native KeyboardEvent key value.\n * @param options - Orientation, direction, and edge-loop policy.\n * @returns Target item id, or undefined when the toolbar does not own the key.\n */\nexport function resolveToolbarNavigationTarget(\n items: readonly QuireKitToolbarRovingItem[],\n currentId: string,\n key: string,\n options: QuireKitToolbarNavigationOptions\n): string | undefined {\n const enabledItems = items.filter((item) => item.disabled !== true);\n if (enabledItems.length === 0) return undefined;\n if (key === \"Home\") return enabledItems[0]?.id;\n if (key === \"End\") return enabledItems.at(-1)?.id;\n\n const movement = resolveMovement(key, options);\n if (movement === undefined) return undefined;\n const currentIndex = enabledItems.findIndex((item) => item.id === currentId);\n const startIndex = currentIndex < 0 ? 0 : currentIndex;\n const candidate = startIndex + movement;\n if (candidate >= 0 && candidate < enabledItems.length) {\n return enabledItems[candidate]?.id;\n }\n if (options.loop === false) return enabledItems[startIndex]?.id;\n return movement > 0 ? enabledItems[0]?.id : enabledItems.at(-1)?.id;\n}\n\n/**\n * Maps an owned arrow key to previous or next movement.\n *\n * @param key - Native KeyboardEvent key value.\n * @param options - Toolbar orientation and text direction.\n * @returns Negative or positive movement, or undefined for an unowned key.\n */\nfunction resolveMovement(\n key: string,\n options: QuireKitToolbarNavigationOptions\n): -1 | 1 | undefined {\n if (options.orientation === \"vertical\") {\n if (key === \"ArrowUp\") return -1;\n if (key === \"ArrowDown\") return 1;\n return undefined;\n }\n const direction = options.direction ?? \"ltr\";\n if (key === \"ArrowLeft\") return direction === \"rtl\" ? 1 : -1;\n if (key === \"ArrowRight\") return direction === \"rtl\" ? -1 : 1;\n return undefined;\n}\n","import type { QuireKitToolbarEntry } from \"./types\";\n\n/** Width of an icon control with a disclosure indicator or a split disclosure. */\nconst indicatedIconSpan = 1.5;\n\n/**\n * Resolves an entry's width in toolbar units.\n *\n * One unit is an icon action. Icon controls that also show a disclosure\n * indicator, and icon split buttons, take one and a half units. Entries with\n * visible text, custom controls, groups, and separators keep their natural width\n * unless they declare a span.\n *\n * @param entry - Toolbar entry.\n * @returns Span in units, or null for natural width.\n */\nexport function resolveQuireKitToolbarEntrySpan(entry: QuireKitToolbarEntry): number | null {\n if (entry.span !== undefined) return entry.span > 0 ? entry.span : null;\n const kind = entry.kind ?? \"action\";\n if (kind === \"separator\" || kind === \"group\" || kind === \"custom\" || kind === \"selector\") return null;\n const hasIcon = entry.icon !== undefined || entry.iconData !== undefined;\n if (!hasIcon || entry.text !== undefined) return null;\n if (kind === \"split\") return indicatedIconSpan;\n if (kind === \"menu\") return entry.trigger !== \"disclosure\" ? null : entry.indicator === false ? 1 : indicatedIconSpan;\n if (kind === \"disclosure\") return entry.indicator === true ? indicatedIconSpan : 1;\n return 1;\n}\n\n/**\n * Sums the unit widths of entries whose spans resolve.\n *\n * @param entries - Row entries.\n * @returns Total units, ignoring hidden and natural-width entries.\n */\nexport function sumQuireKitToolbarSpans(entries: readonly QuireKitToolbarEntry[]): number {\n return entries.reduce((total, entry) => {\n if (entry.hidden === true) return total;\n if (entry.kind === \"group\") return total + sumQuireKitToolbarSpans(entry.children ?? []);\n return total + (resolveQuireKitToolbarEntrySpan(entry) ?? 0);\n }, 0);\n}\n","/** Stable document-color rows shared by product and contextual authoring. */\nexport const quireDocumentColorRows = Object.freeze([\n [\"#FFFFFF\", \"#0F172A\", \"#E5484D\", \"#F76B15\", \"#F5B942\", \"#46A758\", \"#12A594\", \"#3E63DD\", \"#8E4EC6\", \"#D6409F\"],\n [\"#A1A1AA\", \"#3B4A66\", \"#E46A6E\", \"#F28C4B\", \"#E8C15C\", \"#65B867\", \"#47B8AB\", \"#5472D4\", \"#9A64C8\", \"#D65A9E\"],\n [\"#C7C9CE\", \"#707B91\", \"#E99699\", \"#F5B67F\", \"#F2D98B\", \"#94CD93\", \"#81CFC5\", \"#89A0E4\", \"#B590DC\", \"#E18BBC\"],\n [\"#E1E2E5\", \"#A0A8B7\", \"#F3C0C2\", \"#FAD7B9\", \"#F8E9BA\", \"#C2E5C1\", \"#B9E6E0\", \"#C0CDF0\", \"#D5C4EA\", \"#EEC3DA\"],\n [\"#71717A\", \"#25314A\", \"#CD2B31\", \"#D94F0B\", \"#CEA11D\", \"#2A7E3B\", \"#0E7C72\", \"#3451B2\", \"#6E3CBC\", \"#AB2B7D\"],\n [\"#52525B\", \"#1E293B\", \"#B91C1C\", \"#C2410C\", \"#A16207\", \"#237B4B\", \"#0F766E\", \"#1D4ED8\", \"#6D28D9\", \"#9D174D\"],\n [\"#27272A\", \"#111827\", \"#7F1D1D\", \"#7C2D12\", \"#713F12\", \"#14532D\", \"#134E4A\", \"#1E3A8A\", \"#4C1D95\", \"#701A4B\"]\n] as const);\n","import type { QuireKitCommentAnchorProjection, QuireKitCommentCardGeometry, QuireKitCommentRailLayout } from './types';\n\n/**\n * Converts a viewport anchor into a rail coordinate. Anchor and rail share one scroll owner,\n * so their difference stays the same while the document scrolls.\n * @param input - Current viewport geometry.\n * @returns Anchor top relative to the comment-list origin.\n */\nexport function projectQuireCommentAnchor(input: QuireKitCommentAnchorProjection): number {\n return finite(input.anchorClientY) - finite(input.railClientY);\n}\n\n/**\n * Places cards in document order with one forward pass: each card sits at its anchor\n * unless that would overlap the previous card, in which case it is pushed down.\n * @param cards - Measured cards in document-anchor order.\n * @param documentHeight - Rail height available through the document bottom.\n * @param minimumGap - Separation between adjacent cards.\n * @returns Card tops and overflow state.\n */\nexport function layoutQuireCommentRail(cards: readonly QuireKitCommentCardGeometry[], documentHeight: number, minimumGap = 12): QuireKitCommentRailLayout {\n const floor = nonNegative(documentHeight), gap = nonNegative(minimumGap), cardTops: number[] = [];\n let bottom = 0;\n for (const [index, card] of cards.entries()) {\n const top = Math.max(nonNegative(card.anchorTop), index === 0 ? 0 : bottom + gap);\n cardTops.push(top);\n bottom = top + nonNegative(card.cardHeight);\n }\n const stackBottom = cards.length ? bottom : 0;\n return { cardTops, stackBottom, railHeight: Math.max(floor, stackBottom), hasDocumentOverflow: stackBottom > floor };\n}\n\n/** @param value - Browser or caller supplied CSS-pixel value. @returns The value, or zero when not finite. */\nfunction finite(value: number): number { return Number.isFinite(value) ? value : 0; }\n\n/** @param value - Browser or caller supplied CSS-pixel dimension. @returns A finite non-negative value. */\nfunction nonNegative(value: number): number { return Math.max(0, finite(value)); }\n","import type { Color } from \"@ark-ui/vue/color-picker\";\nimport { parseColor } from \"@ark-ui/vue/color-picker\";\n\n/** QuireKit Color Picker 的安全回退颜色。 */\nexport const quireColorPickerFallbackValue = \"#1677FF\";\n\n/**\n * 把 CSS 颜色字符串解析为 Ark/Zag Color,并为无效输入提供稳定回退。\n *\n * @param value - 调用方提供的 CSS 颜色字符串。\n * @param fallback - 输入无效时使用的 CSS 颜色字符串。\n * @returns 可交给 Ark Color Picker machine 的颜色对象。\n */\nexport function parseQuireColor(\n value: string | undefined,\n fallback = quireColorPickerFallbackValue\n): Color {\n try {\n return parseColor(value ?? fallback);\n } catch {\n return parseColor(fallback);\n }\n}\n\n/**\n * 把 Ark/Zag Color 投影为稳定的 HEX/HEXA 公共值。\n *\n * @param color - Ark Color Picker machine 返回的颜色对象。\n * @returns 不透明颜色使用 HEX,透明颜色使用 HEXA 的 CSS 字符串。\n */\nexport function serializeQuireColor(color: Color): string {\n return color.getChannelValue(\"alpha\") >= 1\n ? color.toString(\"hex\").toUpperCase()\n : color.toString(\"hexa\").toUpperCase();\n}\n","import { quireKitDefaultLocale } from '../../locale/resolve';\nimport type { Messages as QuireKitFileUploadMessages } from '../../locale/components/file-upload';\n\n/** Formats public validation codes without dropping custom validation messages.\n * @param errors - Current file's validation codes.\n * @param messages - FileUpload text of the active language; defaults to Chinese.\n * @returns Deduplicated readable feedback.\n */\nexport function getQuireKitFileUploadErrorMessage(errors: readonly string[], messages: QuireKitFileUploadMessages = quireKitDefaultLocale.messages.fileUpload): string {\n return [...new Set(errors.map(error => messages.errors[error] ?? error))].join(messages.errorSeparator);\n}\n","import { en, type Messages as QuireKitEmojiPickerMessages } from \"../../locale/components/emoji-picker\";\nimport { quireKitBuiltInLocales, quireKitDefaultLocale } from \"../../locale/resolve\";\nimport type { QuireKitEmojiGroup, QuireKitEmojiItem } from \"./types\";\n\n// A curated, replaceable Unicode catalog. These are characters, not external assets;\n// names and group labels come from the language packs.\nconst rows = [\n [\"faces\", \"smile\", [\n \"😀\", \"😃\", \"😄\", \"😁\", \"😆\", \"😅\", \"😂\", \"🤣\", \"🙂\", \"🙃\", \"😉\", \"😊\", \"🥰\", \"😍\", \"🤩\", \"😘\", \"😋\", \"😎\", \"🥳\", \"🤔\", \"🤗\",\n \"🤭\", \"🤫\", \"🤐\", \"😐\", \"🙄\", \"😴\", \"🥱\", \"😢\", \"😭\", \"😱\", \"😡\", \"🥺\", \"😷\", \"🤒\", \"🤯\", \"👋\", \"👌\", \"✌️\", \"👍\", \"👎\", \"👏\",\n \"🙌\", \"🙏\", \"🤝\", \"💪\", \"👀\", \"🧑‍💻\"\n ]],\n [\"nature\", \"pawPrint\", [\n \"🐶\", \"🐱\", \"🐼\", \"🐻\", \"🦊\", \"🐰\", \"🐸\", \"🐵\", \"🐔\", \"🐧\", \"🦋\", \"🐝\", \"🐢\", \"🐬\", \"🐳\", \"🦄\", \"🌱\", \"🌿\", \"🌳\", \"🌸\", \"🌻\",\n \"🌹\", \"☀️\", \"🌙\", \"⭐\", \"🌈\", \"🔥\", \"❄️\"\n ]],\n [\"food\", \"utensils\", [\n \"🍎\", \"🍊\", \"🍋\", \"🍌\", \"🍉\", \"🍇\", \"🍓\", \"🍑\", \"🥑\", \"🥕\", \"🍞\", \"🥐\", \"🍔\", \"🍟\", \"🍕\", \"🍜\", \"🍚\", \"🥟\", \"🍣\", \"🎂\", \"🍰\",\n \"🍩\", \"🍪\", \"🍫\", \"☕\", \"🍵\", \"🧋\", \"🥂\"\n ]],\n [\"travel\", \"car\", [\n \"🚗\", \"🚕\", \"🚌\", \"🚲\", \"🚆\", \"🚄\", \"✈️\", \"🚀\", \"🚢\", \"🏠\", \"🏢\", \"🏫\", \"🏥\", \"🏕️\", \"🏖️\", \"🏔️\", \"🗺️\", \"🌏\", \"🧭\", \"🌅\"\n ]],\n [\"activities\", \"volleyball\", [\n \"🎉\", \"🎊\", \"🎈\", \"🎁\", \"🏆\", \"🥇\", \"🎯\", \"⚽\", \"🏀\", \"🏐\", \"🎾\", \"🏓\", \"🎮\", \"🧩\", \"🎨\", \"🎵\", \"🎸\", \"🎹\", \"🎬\", \"🎤\"\n ]],\n [\"objects\", \"lightbulb\", [\n \"💡\", \"📌\", \"📅\", \"⏰\", \"⌛\", \"💻\", \"⌨️\", \"📱\", \"📷\", \"🔍\", \"📚\", \"📝\", \"✏️\", \"📎\", \"📁\", \"📊\", \"🔔\", \"📣\", \"🔒\", \"🔑\",\n \"🔧\", \"⚙️\", \"🔗\", \"🧪\"\n ]],\n [\"symbols\", \"heart\", [\n \"❤️\", \"🧡\", \"💛\", \"💚\", \"💙\", \"💜\", \"🤍\", \"💔\", \"✅\", \"❌\", \"⚠️\", \"🚫\", \"❗\", \"❓\", \"💯\", \"✨\", \"♻️\", \"➕\", \"➖\", \"➡️\",\n \"⬅️\", \"⬆️\", \"⬇️\", \"🔄\"\n ]],\n] as const;\n\n/**\n * @param messages - EmojiPicker text of the active language; defaults to Chinese.\n * @returns Fresh, ordered category declarations.\n */\nexport function createQuireEmojiGroups(\n messages: QuireKitEmojiPickerMessages = quireKitDefaultLocale.messages.emojiPicker\n): readonly QuireKitEmojiGroup[] {\n return rows.map(([value, icon]) => ({ value, label: messages.groups[value] ?? en.groups[value], icon }));\n}\n\n/**\n * Builds the default catalog; names of every built-in language stay searchable.\n * @param messages - EmojiPicker text of the active language; defaults to Chinese.\n * @returns The replaceable default Unicode catalog.\n */\nexport function createQuireEmojiCatalog(\n messages: QuireKitEmojiPickerMessages = quireKitDefaultLocale.messages.emojiPicker\n): readonly QuireKitEmojiItem[] {\n const builtIn = quireKitBuiltInLocales.map(locale => locale.messages.emojiPicker.names);\n return rows.flatMap(([group, , values]) => values.map(value => {\n const label = messages.names[value] ?? en.names[value] ?? value;\n const keywords = [...new Set([label, ...builtIn.flatMap(names => names[value] ?? [])])];\n return { value, group, label, keywords };\n }));\n}\n","import type { QuireKitEmojiItem } from \"./types\";\n\n/** @param items - Host or default catalog. @param query - Unicode, label or shortcode query. @param group - Optional category. @returns Stable filtered values, never modifying host data. */\nexport function filterQuireEmojis(items: readonly QuireKitEmojiItem[], query: string, group?: string): readonly QuireKitEmojiItem[] {\n const terms = query.normalize(\"NFKC\").toLocaleLowerCase().replace(/:/gu, \"\").trim().split(/\\s+/u).filter(Boolean);\n const seen = new Set<string>();\n return items.filter(item => {\n if (!item.value || seen.has(item.value)) return false;\n seen.add(item.value);\n if (!terms.length) return !group || item.group === group;\n const searchable = [item.value, item.label, ...(item.keywords ?? [])].join(\" \").normalize(\"NFKC\").toLocaleLowerCase();\n return terms.every(term => searchable.includes(term));\n });\n}\n\n/** @param items - Admitted catalog. @param recent - Host-owned recent Unicode values. @returns Deduplicated recent items without inventing missing labels. */\nexport function resolveQuireRecentEmojis(items: readonly QuireKitEmojiItem[], recent: readonly string[]): readonly QuireKitEmojiItem[] {\n const lookup = new Map(items.map(item => [item.value, item]));\n return [...new Set(recent)].flatMap(value => lookup.get(value) ?? []);\n}\n","import type { QuireKitSelectionHandlePoint } from '../types';\nimport type { SelectionHandleHold, SelectionHandleHoldOptions } from './types';\n\n/** @param value - Configured threshold. @param fallback - Default threshold. @returns A finite nonnegative value. */\nfunction threshold(value: number | undefined, fallback: number): number {\n return value !== undefined && Number.isFinite(value) && value >= 0 ? value : fallback;\n}\n\n/**\n * Separates immediate caret movement from holding that caret to extend a range.\n * @param options - Timer ports and readiness notification, without a second frame scheduler.\n * @returns Recognition state owned by the existing captured drag.\n */\nexport function createSelectionHandleHold(options: SelectionHandleHoldOptions): SelectionHandleHold {\n let phase: 'idle' | 'pending' | 'moving' | 'ready' | 'selecting' = 'idle';\n let origin: QuireKitSelectionHandlePoint = { x: 0, y: 0 };\n let timer: number | null = null;\n let tolerance = 8;\n /** Clears delayed recognition before releasing or replacing pointer ownership. */\n function clear(): void {\n if (timer !== null) options.cancelDelay(timer);\n timer = null;\n phase = 'idle';\n }\n return {\n /** @param detail - Stable endpoint and raw grab point. @param settings - Per-press thresholds. */\n begin(detail, settings) {\n clear();\n if (detail.handle !== 'caret') return;\n origin = detail.pointer;\n tolerance = threshold(settings.movementThreshold, 8);\n phase = 'pending';\n timer = options.delay(() => {\n timer = null;\n if (phase !== 'pending') return;\n phase = 'ready';\n options.onReady();\n }, threshold(settings.longPressDelay, 450));\n },\n /** @param point - Raw client point. @returns False while waiting within the allowed jitter. */\n move(point) {\n if (phase !== 'pending' && phase !== 'ready') return true;\n if (Math.hypot(point.x - origin.x, point.y - origin.y) <= tolerance) return false;\n if (timer !== null) options.cancelDelay(timer);\n timer = null;\n phase = phase === 'ready' ? 'selecting' : 'moving';\n return true;\n },\n /** @returns Whether this pointer owns long-press selection. */\n selecting: () => phase === 'ready' || phase === 'selecting',\n /** @returns Whether release should report idle long-press actions. */\n stationary: () => phase === 'ready',\n clear\n };\n}\n","import type { QuireKitSelectionHandleDrag, QuireKitSelectionHandleEndReason, QuireKitSelectionHandlePoint } from '../types';\nimport type { SelectionHandleDragController, SelectionHandleDragOptions } from './types';\nimport { createSelectionHandleHold } from './hold';\n\n/**\n * Coalesces raw input without delaying the final release or retaining stale work.\n * @param options - Host scheduler and notifications.\n * @returns One explicitly cancellable pointer session.\n */\nexport function createSelectionHandleDrag(options: SelectionHandleDragOptions): SelectionHandleDragController {\n let active: QuireKitSelectionHandleDrag | null = null;\n let offset = { x: 0, y: 0 };\n let pending: QuireKitSelectionHandlePoint | null = null;\n let frame: number | null = null;\n let generation = 0;\n const hold = createSelectionHandleHold({\n delay: options.delay, cancelDelay: options.cancelDelay,\n onReady: () => { if (active) options.onLongPressStart(active); }\n });\n\n /** Drops stale samples before cancellation or a synchronous final flush. */\n function clear(): void {\n if (frame !== null) options.cancelFrame(frame);\n frame = null;\n pending = null;\n }\n /** @param point - Latest raw client point, never a local overlay coordinate. */\n function deliver(point: QuireKitSelectionHandlePoint): void {\n if (!active) return;\n active = { ...active, pointer: point, point: { x: point.x - offset.x, y: point.y - offset.y } };\n options.onMove(active);\n }\n /** Consumes only the most recent complete sample for this presentation frame. */\n function flush(): void {\n frame = null;\n const point = pending;\n pending = null;\n if (point) deliver(point);\n }\n /** @param reason - Completion cause, with state detached before notifying consumers. */\n function finish(reason: QuireKitSelectionHandleEndReason): void {\n clear();\n const previous = active;\n active = null;\n hold.clear();\n generation++;\n if (previous) options.onEnd({ ...previous, reason });\n }\n return {\n /** @param detail - Initial client sample. @param settings - Caret hold thresholds. @returns Whether acquisition survived callbacks. */\n begin(detail, settings = {}) {\n if (active) return false;\n active = detail;\n offset = { x: detail.pointer.x - detail.point.x, y: detail.pointer.y - detail.point.y };\n hold.begin(detail, settings);\n options.onStart(detail);\n return active !== null;\n },\n /** @param pointerId - Input owner. @param point - Raw client sample. */\n move(pointerId, point) {\n if (active?.pointerId !== pointerId) return;\n if (!hold.move(point)) return;\n pending = point;\n if (frame === null) frame = options.schedule(flush);\n },\n /** @param pointerId - Input owner. @param point - Actual pointerup client sample. */\n release(pointerId, point) {\n if (active?.pointerId !== pointerId) return;\n hold.move(point);\n if (hold.stationary()) { finish('long-press'); return; }\n const version = generation;\n clear();\n deliver(point);\n // A consumer may cancel or replace the session while accepting this final input.\n if (active && generation === version) finish('release');\n },\n /** @param reason - Cancellation cause. */\n cancel: finish,\n /** @returns Whether the caret has entered long-press selection. */\n selecting: hold.selecting,\n /** @returns Current delivered input, without exposing pending raw events. */\n current: () => active\n };\n}\n","import { quireKitDefaultLocale } from '../../../locale/resolve';\nimport type { QuireKitSelectionHandle, QuireKitSelectionHandlesProps } from '../types';\nimport type { SelectionHandleElements, SelectionHandlePresentation } from './types';\n\n/** Stable DOM order; changing range direction never replaces the captured button. */\nexport const selectionHandleIds = ['caret', 'anchor', 'focus'] as const;\n\n/** @param doc - Owning document. @param id - Stable endpoint. @returns Permanent handle anatomy. */\nexport function createHandle(doc: Document, id: QuireKitSelectionHandle): SelectionHandleElements {\n const root = doc.createElement('div');\n root.className = 'qk-selection-handles__endpoint';\n root.dataset.handle = id;\n const stem = doc.createElement('span');\n stem.className = 'qk-selection-handles__stem';\n stem.setAttribute('aria-hidden', 'true');\n const button = doc.createElement('button');\n button.type = 'button';\n button.className = 'qk-selection-handles__grip';\n button.setAttribute('aria-keyshortcuts', 'ArrowLeft ArrowRight ArrowUp ArrowDown');\n const knob = doc.createElement('span');\n knob.className = 'qk-selection-handles__knob';\n knob.setAttribute('aria-hidden', 'true');\n button.append(knob);\n const marker = doc.createElement('span');\n marker.className = 'qk-selection-handles__marker';\n marker.setAttribute('aria-hidden', 'true');\n root.append(stem, marker, button);\n return { root, stem, button };\n}\n\n/**\n * Resolves visibility and visual side without interpreting document positions.\n * @param state - Current host projection.\n * @param id - Stable endpoint identity.\n * @returns A valid visible endpoint, or null.\n */\nexport function getHandlePresentation(state: QuireKitSelectionHandlesProps, id: QuireKitSelectionHandle): SelectionHandlePresentation | null {\n const value = state.selection;\n if (!value || (value.type === 'caret') !== (id === 'caret')) return null;\n const geometry = value.type === 'caret' ? value.caret : value[id as 'anchor' | 'focus'];\n if (!geometry || ![geometry.x, geometry.y, geometry.height].every(Number.isFinite) || geometry.height <= 0) return null;\n const side = value.type === 'range' && ((id === 'anchor') !== !!value.backward) ? 'start' : 'end';\n const labels = state.messages ?? quireKitDefaultLocale.messages.selectionHandles;\n return { geometry, side: state.selecting && id === 'focus' ? 'end' : side, boundary: id === 'caret' ? 'caret' : side, label: labels[id === 'caret' ? 'caret' : side] };\n}\n\n/**\n * Allows only a held caret to become a range without losing its captured input.\n * @param previous - Previously accepted host projection.\n * @param next - Next host projection.\n * @param handle - Stable captured endpoint.\n * @param selecting - Whether this caret owns a recognized long press.\n * @returns Whether the new geometry can continue the same gesture.\n */\nexport function canContinueHandleDrag(previous: QuireKitSelectionHandlesProps, next: QuireKitSelectionHandlesProps, handle: QuireKitSelectionHandle, selecting: boolean): boolean {\n if (next.disabled) return false;\n const promotesCaret = selecting && handle === 'caret' && next.selection?.type === 'range';\n if (previous.selection?.type !== next.selection?.type && !promotesCaret) return false;\n return getHandlePresentation(next, promotesCaret ? 'focus' : handle) !== null;\n}\n\n/** @param nodes - Permanent anatomy. @param value - Valid geometry, or hidden. @param disabled - Interaction gate. */\nexport function renderHandle(nodes: SelectionHandleElements, value: SelectionHandlePresentation | null, disabled: boolean): void {\n nodes.root.hidden = !value;\n nodes.button.disabled = disabled || !value;\n if (!value) return;\n nodes.root.dataset.side = value.side;\n nodes.root.dataset.boundary = value.boundary;\n nodes.root.style.left = `${value.geometry.x}px`;\n nodes.root.style.top = `${value.geometry.y}px`;\n nodes.root.style.height = `${value.geometry.height}px`;\n nodes.button.setAttribute('aria-label', value.label);\n}\n","import { trackQuireKitInputModality } from '../control/modality';\nimport { createSelectionHandleDrag } from './drag/controller';\nimport { canContinueHandleDrag, createHandle, getHandlePresentation, renderHandle, selectionHandleIds } from './dom/handles';\nimport type { CreateQuireSelectionHandlesOptions, QuireKitSelectionHandle, QuireKitSelectionHandlesProps, QuireSelectionHandlesController } from './types';\n\n/**\n * Creates a controlled cursor/range overlay without importing an editor or framework.\n * @param options - Initial geometry, owning document and host callbacks.\n * @returns Stable DOM, update, cancellation and teardown methods.\n */\nexport function createQuireSelectionHandles(options: CreateQuireSelectionHandlesOptions): QuireSelectionHandlesController {\n const doc = options.ownerDocument;\n const win = doc.defaultView!;\n if (!win) throw new Error('Selection handles require a document with a window.');\n trackQuireKitInputModality(doc);\n const root = doc.createElement('div');\n root.className = 'qk-selection-handles';\n const nodes = { caret: createHandle(doc, 'caret'), anchor: createHandle(doc, 'anchor'), focus: createHandle(doc, 'focus') };\n let state: QuireKitSelectionHandlesProps = options;\n let destroyed = false;\n\n const drag = createSelectionHandleDrag({\n delay: (callback, ms) => win.setTimeout(callback, ms),\n cancelDelay: id => win.clearTimeout(id),\n schedule: callback => win.requestAnimationFrame(callback),\n cancelFrame: id => win.cancelAnimationFrame(id),\n onStart(detail) {\n root.dataset.dragging = '';\n nodes[detail.handle].root.dataset.dragging = '';\n listen(true);\n options.onDragStart?.(detail);\n },\n onMove: detail => options.onDrag?.(detail),\n onLongPressStart(detail) {\n render();\n options.onLongPressStart?.(detail);\n },\n onEnd(detail) {\n // Detach listeners and capture before invoking a consumer that may unmount or start anew.\n listen(false);\n delete root.dataset.dragging;\n const node = nodes[detail.handle];\n delete node.root.dataset.dragging;\n if (root.hasPointerCapture(detail.pointerId)) root.releasePointerCapture(detail.pointerId);\n render();\n options.onDragEnd?.(detail);\n if (!destroyed && detail.reason === 'release') options.onSelectionComplete?.(detail);\n if (!destroyed && detail.reason === 'long-press') options.onLongPress?.(detail);\n }\n });\n\n /** @param event - Browser input. @returns Whether this instance owns the pointer. */\n function owns(event: PointerEvent): boolean { return drag.current()?.pointerId === event.pointerId; }\n /** @param event - Claimed input that must not reach the editor's pointer handlers. */\n function consume(event: Event): void { event.preventDefault(); event.stopPropagation(); }\n /** @param event - Touch defaults are independent of PointerEvent cancellation. */\n function nativeTouch(event: TouchEvent): void {\n if (!destroyed && !state.disabled && state.selection) consume(event);\n }\n /** @param event - A touch menu may target text underneath the temporarily transparent grip. */\n function nativeContextMenu(event: MouseEvent): void {\n const current = drag.current();\n if (current?.pointerType !== 'touch') return;\n if ('pointerType' in event && event.pointerType && event.pointerType !== 'touch') return;\n if ('pointerId' in event && typeof event.pointerId === 'number' && event.pointerId > 0 && event.pointerId !== current.pointerId) return;\n consume(event);\n }\n /** @param event - Raw input; no DOM measurement occurs in this hot path. */\n function move(event: PointerEvent): void {\n if (!owns(event)) return;\n consume(event);\n drag.move(event.pointerId, { x: event.clientX, y: event.clientY });\n }\n /** @param event - Actual final pointer sample, flushed before capture is released. */\n function release(event: PointerEvent): void {\n if (!owns(event)) return;\n consume(event);\n drag.release(event.pointerId, { x: event.clientX, y: event.clientY });\n }\n /** @param event - OS cancellation, which must not apply an unaccepted coordinate. */\n function cancelPointer(event: PointerEvent): void { if (owns(event)) drag.cancel('cancel'); }\n /** Cancels when the browser window loses interaction ownership. */\n function blur(): void { drag.cancel('blur'); }\n /** Cancels suspended pages so there is no delayed input after returning. */\n function visibility(): void { if (doc.hidden) blur(); }\n /** @param event - Escape reaches the active session even while editor focus is retained. */\n function escape(event: KeyboardEvent): void {\n if (event.key !== 'Escape') return;\n consume(event);\n drag.cancel('escape');\n }\n /** @param active - Install listeners only for the lifetime of a claimed gesture. */\n function listen(active: boolean): void {\n const method = active ? 'addEventListener' : 'removeEventListener';\n win[method]('pointermove', move as EventListener, true);\n win[method]('pointerup', release as EventListener, true);\n win[method]('pointercancel', cancelPointer as EventListener, true);\n win[method]('contextmenu', nativeContextMenu as EventListener, true);\n win[method]('keydown', escape as EventListener, true);\n win[method]('blur', blur);\n doc[method]('visibilitychange', visibility);\n }\n /** @param id - Stable handle. @param event - Pointer acquisition at the grip. */\n function begin(id: QuireKitSelectionHandle, event: PointerEvent): void {\n if (destroyed || state.disabled || drag.current() || event.button !== 0 || !event.isPrimary || !getHandlePresentation(state, id)) return;\n consume(event);\n const node = nodes[id];\n // Measure the actual CSS-scaled line once; keeping the grab offset prevents a first-frame jump.\n const rect = node.stem.getBoundingClientRect();\n // The overlay survives caret-to-range projection; a hidden caret button cannot keep capture.\n try { root.setPointerCapture(event.pointerId); }\n catch { return; } // An already cancelled native pointer cannot own a new drag.\n drag.begin({\n handle: id, pointerId: event.pointerId, pointerType: event.pointerType,\n point: { x: rect.left + rect.width / 2, y: rect.top + rect.height / 2 },\n pointer: { x: event.clientX, y: event.clientY }\n }, state);\n }\n /** @param id - Endpoint receiving a physical arrow. @param event - Keyboard input. */\n function nudge(id: QuireKitSelectionHandle, event: KeyboardEvent): void {\n if (state.disabled || event.altKey || event.ctrlKey || event.metaKey || !getHandlePresentation(state, id)) return;\n const direction = ({ ArrowLeft: 'left', ArrowRight: 'right', ArrowUp: 'up', ArrowDown: 'down' } as const)[event.key as 'ArrowLeft'];\n if (!direction) return;\n consume(event);\n options.onNudge?.({ handle: id, direction, accelerated: event.shiftKey });\n }\n /** Reprojects bounded presentation without rebuilding captured or focused nodes. */\n function render(): void {\n const projection = { ...state, selecting: !!state.selecting || drag.selecting() };\n root.dataset.selecting = String(projection.selecting);\n for (const id of selectionHandleIds) renderHandle(nodes[id], getHandlePresentation(projection, id), !!state.disabled);\n }\n\n root.onlostpointercapture = event => { if (owns(event)) drag.cancel('capture-lost'); };\n root.onclick = consume;\n root.oncontextmenu = consume;\n // Cancel the original touch before the browser schedules its callout. Keep\n // listeners on the stable overlay across the caret-to-range projection.\n root.addEventListener('touchstart', nativeTouch, { passive: false });\n root.addEventListener('touchmove', nativeTouch, { passive: false });\n for (const id of selectionHandleIds) {\n const node = nodes[id];\n node.button.onpointerdown = event => begin(id, event);\n node.button.onkeydown = event => nudge(id, event);\n node.button.onclick = consume;\n node.button.oncontextmenu = consume;\n node.button.ondragstart = consume;\n root.append(node.root);\n }\n render();\n return {\n element: root,\n /** @param next - Complete controlled geometry and accessibility state. */\n update(next) {\n if (destroyed) return;\n const current = drag.current();\n const canContinue = !current || canContinueHandleDrag(state, next, current.handle, drag.selecting());\n state = next;\n if (!canContinue) {\n drag.cancel(next.disabled ? 'disabled' : 'selection-change');\n }\n render();\n },\n /** Cancels a stale host document target without reverting accepted host state. */\n cancel() { drag.cancel('cancel'); },\n /** Tears down capture, scheduling, listeners and the three permanent nodes. */\n destroy() {\n if (destroyed) return;\n destroyed = true;\n drag.cancel('destroy');\n root.onlostpointercapture = null;\n root.onclick = null;\n root.oncontextmenu = null;\n root.removeEventListener('touchstart', nativeTouch);\n root.removeEventListener('touchmove', nativeTouch);\n for (const { button } of Object.values(nodes)) {\n button.onpointerdown = button.onkeydown = null;\n button.onclick = button.oncontextmenu = button.ondragstart = null;\n }\n root.remove();\n }\n };\n}\n","import type { QuireKitSelectionGestureDetail } from '../types';\nimport type { QuireKitSelectionHandlePoint } from '../../selection-handles/types';\nimport type { SelectionGestureSession, SelectionGestureSessionOptions } from './types';\n\n/** @param value - Configured threshold. @param fallback - Default value. @returns Finite nonnegative threshold. */\nfunction threshold(value: number | undefined, fallback: number): number {\n return value !== undefined && Number.isFinite(value) && value >= 0 ? value : fallback;\n}\n\n/**\n * Separates native scroll candidates, accepted holds and frame-coalesced selection gestures.\n * @param options - Time ports and semantic callbacks.\n * @returns Explicit recognition lifecycle.\n */\nexport function createSelectionGestureSession(options: SelectionGestureSessionOptions): SelectionGestureSession {\n let phase: ReturnType<SelectionGestureSession['phase']> = 'idle';\n let current: QuireKitSelectionGestureDetail | null = null;\n let pending: QuireKitSelectionHandlePoint | null = null;\n let timer: number | null = null;\n let frame: number | null = null;\n let tolerance = 8;\n let generation = 0;\n /** Clears all deferred work before handing ownership back to the host. */\n function clear(): void {\n if (timer !== null) options.cancelDelay(timer);\n if (frame !== null) options.cancelFrame(frame);\n timer = frame = null;\n pending = null;\n }\n /** Flushes the most recent pointer while preserving the original long-press anchor. */\n function flush(): void {\n frame = null;\n if (!current || !pending || phase !== 'dragging') return;\n current = { ...current, point: pending };\n pending = null;\n options.onSelectionChange?.(current);\n }\n /** @param reason - Why input was abandoned; pending scroll candidates remain silent. */\n function cancel(reason: Parameters<SelectionGestureSession['cancel']>[0]): void {\n clear();\n const accepted = phase === 'pressed' || phase === 'dragging';\n const previous = current;\n phase = 'idle';\n current = null;\n generation++;\n if (accepted && previous) options.onCancel?.({ ...previous, reason });\n }\n /** @param id - Input owner. @param point - Latest client point. */\n function move(id: number, point: QuireKitSelectionHandlePoint): void {\n if (!current || current.pointerId !== id) return;\n const distance = Math.hypot(point.x - current.origin.x, point.y - current.origin.y);\n if (phase === 'pending') { if (distance > tolerance) cancel('movement'); return; }\n if (phase === 'pressed') {\n if (distance <= tolerance) return;\n phase = 'dragging';\n options.onSelectionStart?.({ ...current, point });\n }\n if (phase !== 'dragging') return;\n pending = point;\n if (frame === null) frame = options.frame(flush);\n }\n return {\n /** @returns Current recognition phase. */\n phase: () => phase,\n /** @returns Last delivered sample. */\n current: () => current,\n /** @param detail - Initial client coordinates. @param props - Current recognition thresholds. */\n begin(detail, props) {\n if (current) { cancel('multitouch'); return; }\n if (props.disabled || !(props.pointerTypes ?? ['touch', 'pen']).includes(detail.pointerType)) return;\n current = detail;\n phase = 'pending';\n tolerance = threshold(props.movementThreshold, 8);\n timer = options.delay(() => {\n timer = null;\n if (phase !== 'pending' || !current) return;\n phase = 'pressed';\n options.onLongPressStart?.(current);\n }, threshold(props.longPressDelay, 450));\n },\n move,\n /** @param id - Input owner. @param point - Actual release position. */\n release(id, point) {\n if (!current || current.pointerId !== id) return;\n const version = generation;\n move(id, point);\n if (!current || generation !== version) return;\n if (phase === 'dragging') {\n if (frame !== null) options.cancelFrame(frame);\n pending = point;\n flush();\n }\n if (!current || generation !== version) return;\n const detail = { ...current, point };\n const completed = phase;\n clear();\n current = null;\n phase = 'idle';\n generation++;\n if (completed === 'pressed') options.onLongPress?.(detail);\n if (completed === 'dragging') options.onSelectionComplete?.(detail);\n },\n cancel\n };\n}\n","import { createSelectionGestureSession } from './session/controller';\nimport type { CreateQuireSelectionGestureOptions, QuireKitSelectionGestureProps, QuireSelectionGestureController } from './types';\n\n/**\n * Binds optional surface long-press selection while yielding ordinary touch scrolling.\n * @param options - Explicit surface, recognition settings and semantic callbacks.\n * @returns Update and teardown lifecycle; no editor or menu ownership is acquired.\n */\nexport function createQuireSelectionGesture(options: CreateQuireSelectionGestureOptions): QuireSelectionGestureController {\n const target = options.target;\n const doc = target.ownerDocument;\n const win = doc.defaultView!;\n if (!win) throw new Error('Selection gestures require a document with a window.');\n const hadClass = target.classList.contains('qk-selection-gesture');\n target.classList.add('qk-selection-gesture');\n let props: QuireKitSelectionGestureProps = options;\n let destroyed = false;\n let suppressClick = false;\n const session = createSelectionGestureSession({\n delay: (callback, delay) => win.setTimeout(callback, delay), cancelDelay: id => win.clearTimeout(id),\n frame: callback => win.requestAnimationFrame(callback), cancelFrame: id => win.cancelAnimationFrame(id),\n onLongPressStart(detail) { suppressClick = true; options.onLongPressStart?.(detail); },\n onLongPress(detail) { listen(false); options.onLongPress?.(detail); },\n onSelectionStart: detail => options.onSelectionStart?.(detail),\n onSelectionChange: detail => options.onSelectionChange?.(detail),\n onSelectionComplete(detail) { listen(false); options.onSelectionComplete?.(detail); },\n onCancel(detail) { listen(false); options.onCancel?.(detail); }\n });\n /** @returns Whether scrolling belongs to an accepted hold or drag. */\n function accepted(): boolean { return session.phase() === 'pressed' || session.phase() === 'dragging'; }\n /** @param event - Claimed input. */\n function consume(event: Event): void { event.preventDefault(); event.stopPropagation(); }\n /** @param event - Initial surface input; native controls and nested owners keep their gestures. */\n function down(event: PointerEvent): void {\n suppressClick = false;\n if (destroyed || props.disabled || event.button !== 0 || !event.isPrimary || options.ignore?.(event)) return;\n const origin = event.composedPath().find(entry => entry instanceof win.Element) as Element | undefined;\n const control = origin?.closest('button, input, textarea, select, a[href], [role=\"button\"], [contenteditable], .qk-selection-handles, .qk-selection-gesture');\n if (control && control !== target) return;\n const point = { x: event.clientX, y: event.clientY };\n session.begin({ pointerId: event.pointerId, pointerType: event.pointerType, origin: point, point }, props);\n if (session.current()) listen(true);\n }\n /** @param event - Raw pointer sample; waiting motion yields to native scrolling. */\n function move(event: PointerEvent): void {\n if (session.current()?.pointerId !== event.pointerId) return;\n if (accepted()) consume(event);\n session.move(event.pointerId, { x: event.clientX, y: event.clientY });\n if (!session.current()) listen(false);\n }\n /** @param event - Final point; pending ordinary taps remain available to the host. */\n function up(event: PointerEvent): void {\n if (session.current()?.pointerId !== event.pointerId) return;\n if (accepted()) consume(event);\n session.release(event.pointerId, { x: event.clientX, y: event.clientY });\n if (!session.current()) listen(false);\n }\n /** @param event - Native scroll cancellation or another interrupted pointer. */\n function cancelPointer(event: PointerEvent): void {\n if (session.current()?.pointerId !== event.pointerId) return;\n session.cancel('cancel');\n listen(false);\n }\n /** @param event - A second pointer yields the gesture to the browser. */\n function anotherPointer(event: PointerEvent): void {\n if (session.current()?.pointerId === event.pointerId) return;\n session.cancel('multitouch');\n listen(false);\n }\n /** @param event - Only an accepted hold may prevent the first native scroll movement. */\n function touchMove(event: TouchEvent): void { if (accepted() && event.cancelable) event.preventDefault(); }\n /** @param event - Native context menu generated by a claimed touch/pen hold. */\n function context(event: MouseEvent): void { if (session.current() || suppressClick) consume(event); }\n /** @param event - One compatibility click following a long press, never a new physical click. */\n function click(event: MouseEvent): void {\n if (suppressClick && event.detail !== 0) { suppressClick = false; consume(event); }\n }\n /** Cancels when the window loses input ownership. */\n function blur(): void { session.cancel('blur'); listen(false); }\n /** Cancels hidden pages to prevent delayed recognition after returning. */\n function visibility(): void { if (doc.hidden) blur(); }\n /** Cancels pre-hold scrolling; accepted host autoscroll remains supported. */\n function scroll(): void { if (session.phase() === 'pending') { session.cancel('scroll'); listen(false); } }\n /** @param event - Explicit keyboard cancellation. */\n function escape(event: KeyboardEvent): void {\n if (event.key !== 'Escape') return;\n if (accepted()) consume(event);\n session.cancel('escape');\n listen(false);\n }\n /** @param active - Candidate-scoped listeners, removed even when scrolling cancels silently. */\n function listen(active: boolean): void {\n const method = active ? 'addEventListener' : 'removeEventListener';\n win[method]('pointermove', move as EventListener, true);\n win[method]('pointerup', up as EventListener, true);\n win[method]('pointercancel', cancelPointer as EventListener, true);\n win[method]('pointerdown', anotherPointer as EventListener, true);\n win[method]('keydown', escape as EventListener, true);\n win[method]('scroll', scroll, true);\n win[method]('blur', blur);\n doc[method]('visibilitychange', visibility);\n target[method]('touchmove', touchMove as EventListener, { passive: false });\n }\n target.addEventListener('pointerdown', down);\n target.addEventListener('contextmenu', context);\n target.addEventListener('click', click, true);\n return {\n /** @param next - Recognition configuration; a live gesture keeps its original thresholds. */\n update(next) {\n if (destroyed) return;\n props = next;\n if (props.disabled) { session.cancel('disabled'); listen(false); }\n },\n /** Drops a gesture whose host document target is no longer valid. */\n cancel() { session.cancel('cancel'); listen(false); },\n /** Releases listeners, timeouts, frames and the class owned by this binding. */\n destroy() {\n if (destroyed) return;\n destroyed = true;\n session.cancel('destroy');\n listen(false);\n target.removeEventListener('pointerdown', down);\n target.removeEventListener('contextmenu', context);\n target.removeEventListener('click', click, true);\n if (!hadClass) target.classList.remove('qk-selection-gesture');\n }\n };\n}\n","import type { QuireTableSize, TableGridKey } from \"./types\";\n\n/** Fixed quick-grid dimensions matching the admitted desktop interaction. */\nexport const tableQuickGridSize: QuireTableSize = Object.freeze({\n rowCount: 8,\n columnCount: 10\n});\n\n/**\n * Reports whether one grid cell belongs to the active rectangular selection.\n *\n * @param cell - One-based cell coordinates.\n * @param active - One-based active rectangle endpoint.\n * @returns Whether the cell is inside the highlighted rectangle.\n */\nexport function isTableGridCellHighlighted(\n cell: QuireTableSize,\n active: QuireTableSize\n): boolean {\n return cell.rowCount <= active.rowCount\n && cell.columnCount <= active.columnCount;\n}\n\n/**\n * Moves one quick-grid tuple while preserving the admitted grid bounds.\n *\n * @param selection - Current one-based selection tuple.\n * @param key - Navigation key to interpret.\n * @param accelerated - Whether Home or End jumps across both axes.\n * @returns New clamped selection tuple.\n */\nexport function moveTableGridSelection(\n selection: QuireTableSize,\n key: TableGridKey,\n accelerated = false\n): QuireTableSize {\n const current = clampTableGridSelection(selection);\n if (accelerated && key === \"Home\") return { rowCount: 1, columnCount: 1 };\n if (accelerated && key === \"End\") return tableQuickGridSize;\n\n switch (key) {\n case \"ArrowDown\":\n return clampTableGridSelection({\n ...current,\n rowCount: current.rowCount + 1\n });\n case \"ArrowLeft\":\n return clampTableGridSelection({\n ...current,\n columnCount: current.columnCount - 1\n });\n case \"ArrowRight\":\n return clampTableGridSelection({\n ...current,\n columnCount: current.columnCount + 1\n });\n case \"ArrowUp\":\n return clampTableGridSelection({\n ...current,\n rowCount: current.rowCount - 1\n });\n case \"End\":\n return { ...current, columnCount: tableQuickGridSize.columnCount };\n case \"Home\":\n return { ...current, columnCount: 1 };\n }\n}\n\n/**\n * Normalizes one pair of custom-size input drafts.\n *\n * @param rowCount - Draft row count.\n * @param columnCount - Draft column count.\n * @param maximum - Largest accepted dimension.\n * @returns Complete validated tuple, or null when either draft is invalid.\n */\nexport function normalizeTableSize(\n rowCount: number | null,\n columnCount: number | null,\n maximum = 63\n): QuireTableSize | null {\n return isDimension(rowCount, maximum)\n && isDimension(columnCount, maximum)\n ? { rowCount, columnCount }\n : null;\n}\n\n/**\n * Clamps arbitrary numeric coordinates to the fixed quick-grid rectangle.\n *\n * @param selection - Candidate row/column tuple.\n * @returns Tuple inside the one-based quick-grid bounds.\n */\nfunction clampTableGridSelection(\n selection: QuireTableSize\n): QuireTableSize {\n return {\n rowCount: Math.min(\n Math.max(1, selection.rowCount),\n tableQuickGridSize.rowCount\n ),\n columnCount: Math.min(\n Math.max(1, selection.columnCount),\n tableQuickGridSize.columnCount\n )\n };\n}\n\n/** @param value - Draft dimension. @param maximum - Inclusive bound. @returns Whether the draft is admissible. */\nfunction isDimension(value: number | null, maximum: number): value is number {\n return value !== null && Number.isInteger(value) && value >= 1 && value <= maximum;\n}\n"],"mappings":";;;;;AAiBA,MAAa,0BAA2D,OAAO,OAAO;CACpF,OAAO,OAAO,OAAO;EACnB,SAAS,qBAAqB;EAC9B,MAAM,kBAAkB;EACxB,MAAM,kBAAkB;EACxB,QAAQ,oBAAoB;EAC5B,QAAQ,oBAAoB;EAC5B,MAAM,sBAAsB,MAAM;EAClC,SAAS,sBAAsB,SAAS;EACxC,SAAS,sBAAsB,SAAS;EACxC,QAAQ,sBAAsB,QAAQ;EACtC,WAAW,OAAO,OAAO;GACvB,UAAU,UAAU,sBAAsB,MAAM,UAAU,QAAQ;GAClE,QAAQ,UAAU,sBAAsB,MAAM,UAAU,MAAM;GAC9D,YAAY,UAAU,sBAAsB,MAAM,UAAU,UAAU;EACxE,CAA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;;;;;;AAUA,SAAgB,uBACd,WACA,KACA,cAAc,OACE;CAChB,MAAM,UAAU,wBAAwB,SAAS;CACjD,IAAI,eAAe,QAAQ,QAAQ,OAAO;EAAE,UAAU;EAAG,aAAa;CAAE;CACxE,IAAI,eAAe,QAAQ,OAAO,OAAO;CAEzC,QAAQ,KAAR;EACE,KAAK,aACH,OAAO,wBAAwB;GAC7B,GAAG;GACH,UAAU,QAAQ,WAAW;EAC/B,CAAC;EACH,KAAK,aACH,OAAO,wBAAwB;GAC7B,GAAG;GACH,aAAa,QAAQ,cAAc;EACrC,CAAC;EACH,KAAK,cACH,OAAO,wBAAwB;GAC7B,GAAG;GACH,aAAa,QAAQ,cAAc;EACrC,CAAC;EACH,KAAK,WACH,OAAO,wBAAwB;GAC7B,GAAG;GACH,UAAU,QAAQ,WAAW;EAC/B,CAAC;EACH,KAAK,OACH,OAAO;GAAE,GAAG;GAAS,aAAa,mBAAmB;EAAY;EACnE,KAAK,QACH,OAAO;GAAE,GAAG;GAAS,aAAa;EAAE;CACxC;AACF;;;;;;;;;AAUA,SAAgB,mBACd,UACA,aACA,UAAU,IACa;CACvB,OAAO,YAAY,UAAU,OAAO,KAC/B,YAAY,aAAa,OAAO,IACjC;EAAE;EAAU;CAAY,IACxB;AACN;;;;;;;AAQA,SAAS,wBACP,WACgB;CAChB,OAAO;EACL,UAAU,KAAK,IACb,KAAK,IAAI,GAAG,UAAU,QAAQ,GAC9B,mBAAmB,QACrB;EACA,aAAa,KAAK,IAChB,KAAK,IAAI,GAAG,UAAU,WAAW,GACjC,mBAAmB,WACrB;CACF;AACF;;AAGA,SAAS,YAAY,OAAsB,SAAkC;CAC3E,OAAO,UAAU,QAAQ,OAAO,UAAU,KAAK,KAAK,SAAS,KAAK,SAAS;AAC7E"}
1
+ {"version":3,"file":"model-DvNHVLwg.mjs","names":["threshold"],"sources":["../src/theme/variables/references.ts","../src/components/toolbar/collapse.ts","../src/components/toolbar/navigation.ts","../src/components/toolbar/span.ts","../src/color-palette/presets.ts","../src/components/comment-rail/layout.ts","../src/components/color-picker/color.ts","../src/components/file-upload/messages.ts","../src/components/emoji-picker/catalog.ts","../src/components/emoji-picker/search.ts","../src/components/selection-handles/drag/hold.ts","../src/components/selection-handles/drag/controller.ts","../src/components/selection-handles/dom/handles.ts","../src/components/selection-handles/mount.ts","../src/components/selection-gesture/session/controller.ts","../src/components/selection-gesture/mount.ts","../src/components/table-size-picker/model.ts"],"sourcesContent":["import type { QuireKitTheme } from \"../types\";\nimport {\n themeCssVariableNames,\n type QuireKitThemeCssVariableName\n} from \"./names\";\n\n/** Semantic theme references consumed by UnoCSS and component-token compilers. */\ntype CssReferences<T> = T extends string | number\n ? string\n : { readonly [Key in keyof T]: CssReferences<T[Key]> };\n\n/** CSS-reference projection of every semantic theme value consumed by styling adapters. */\nexport type QuireKitThemeVariableReferences = CssReferences<\n Pick<QuireKitTheme, \"color\" | \"typography\" | \"spacing\" | \"radius\" | \"borderWidth\" | \"elevation\" | \"motion\" | \"opacity\" | \"layer\" | \"control\">\n>;\n\n/** Complete semantic variable references consumed by UnoCSS and component tokens. */\nexport const themeVariableReferences: QuireKitThemeVariableReferences = Object.freeze({\n color: Object.freeze({\n surface: mapSurfaceReferences(),\n text: mapTextReferences(),\n icon: mapIconReferences(),\n border: mapBorderReferences(),\n action: mapActionReferences(),\n info: mapFeedbackReferences(\"info\"),\n success: mapFeedbackReferences(\"success\"),\n warning: mapFeedbackReferences(\"warning\"),\n danger: mapFeedbackReferences(\"danger\"),\n selection: Object.freeze({\n document: reference(themeCssVariableNames.color.selection.document),\n remote: reference(themeCssVariableNames.color.selection.remote),\n dropTarget: reference(themeCssVariableNames.color.selection.dropTarget)\n })\n }),\n typography: mapTypographyReferences(),\n spacing: mapFlatReferences(themeCssVariableNames.spacing),\n radius: mapFlatReferences(themeCssVariableNames.radius),\n borderWidth: mapFlatReferences(themeCssVariableNames.borderWidth),\n elevation: mapFlatReferences(themeCssVariableNames.elevation),\n motion: mapFlatReferences(themeCssVariableNames.motion),\n opacity: mapFlatReferences(themeCssVariableNames.opacity),\n layer: mapFlatReferences(themeCssVariableNames.layer),\n control: mapFlatReferences(themeCssVariableNames.control)\n});\n\n/**\n * Creates one CSS variable reference from an already-declared name.\n *\n * @param name - Declared semantic CSS custom-property name.\n * @returns CSS var reference.\n */\nfunction reference(name: QuireKitThemeCssVariableName): string {\n return `var(${name})`;\n}\n\n/**\n * Projects declared surface variable names into CSS references.\n *\n * @returns Immutable surface references from the explicit contract.\n */\nfunction mapSurfaceReferences(): QuireKitThemeVariableReferences[\"color\"][\"surface\"] {\n const name = themeCssVariableNames.color.surface;\n return Object.freeze({\n transparent: reference(name.transparent),\n workspace: reference(name.workspace), page: reference(name.page), chrome: reference(name.chrome),\n subtle: reference(name.subtle), raised: reference(name.raised), overlay: reference(name.overlay),\n inverse: reference(name.inverse),\n hover: reference(name.hover), pressed: reference(name.pressed), selected: reference(name.selected),\n disabled: reference(name.disabled), scrim: reference(name.scrim)\n });\n}\n\n/**\n * Projects declared text variable names into CSS references.\n *\n * @returns Immutable text references from the explicit contract.\n */\nfunction mapTextReferences(): QuireKitThemeVariableReferences[\"color\"][\"text\"] {\n const name = themeCssVariableNames.color.text;\n return Object.freeze({\n primary: reference(name.primary), secondary: reference(name.secondary), tertiary: reference(name.tertiary),\n muted: reference(name.muted), placeholder: reference(name.placeholder),\n accent: reference(name.accent), disabled: reference(name.disabled), inverse: reference(name.inverse), onAccent: reference(name.onAccent)\n });\n}\n\n/**\n * Projects declared icon variable names into CSS references.\n *\n * @returns Immutable icon references from the explicit contract.\n */\nfunction mapIconReferences(): QuireKitThemeVariableReferences[\"color\"][\"icon\"] {\n const name = themeCssVariableNames.color.icon;\n return Object.freeze({\n primary: reference(name.primary), secondary: reference(name.secondary), disabled: reference(name.disabled),\n onAccent: reference(name.onAccent)\n });\n}\n\n/**\n * Projects declared boundary variable names into CSS references.\n *\n * @returns Immutable boundary references from the explicit contract.\n */\nfunction mapBorderReferences(): QuireKitThemeVariableReferences[\"color\"][\"border\"] {\n const name = themeCssVariableNames.color.border;\n return Object.freeze({\n subtle: reference(name.subtle), default: reference(name.default), strong: reference(name.strong),\n focus: reference(name.focus), disabled: reference(name.disabled)\n });\n}\n\n/**\n * Projects declared action variable names into CSS references.\n *\n * @returns Immutable action references from the explicit contract.\n */\nfunction mapActionReferences(): QuireKitThemeVariableReferences[\"color\"][\"action\"] {\n const name = themeCssVariableNames.color.action;\n return Object.freeze({\n primary: reference(name.primary), text: reference(name.text), hover: reference(name.hover), pressed: reference(name.pressed),\n soft: reference(name.soft), softHover: reference(name.softHover), softPressed: reference(name.softPressed),\n foreground: reference(name.foreground)\n });\n}\n\n/**\n * Creates references for one declared feedback family.\n *\n * @param family - Approved feedback family.\n * @returns Immutable semantic feedback references.\n */\nfunction mapFeedbackReferences(\n family: \"info\" | \"success\" | \"warning\" | \"danger\"\n): QuireKitThemeVariableReferences[\"color\"][\"info\"] {\n const name = themeCssVariableNames.color[family];\n return Object.freeze({\n surface: reference(name.surface), hoverSurface: reference(name.hoverSurface), pressedSurface: reference(name.pressedSurface),\n border: reference(name.border), text: reference(name.text), foreground: reference(name.foreground),\n solid: reference(name.solid), onSolid: reference(name.onSolid)\n });\n}\n\n/** @returns Semantic typography references backed by explicit variable names. */\nfunction mapTypographyReferences(): QuireKitThemeVariableReferences[\"typography\"] {\n const names = themeCssVariableNames.typography;\n return Object.freeze({\n display: mapFlatReferences(names.display), pageTitle: mapFlatReferences(names.pageTitle),\n sectionTitle: mapFlatReferences(names.sectionTitle), heading: mapFlatReferences(names.heading),\n body: mapFlatReferences(names.body), control: mapFlatReferences(names.control),\n compact: mapFlatReferences(names.compact), helper: mapFlatReferences(names.helper), code: mapFlatReferences(names.code)\n });\n}\n\n/**\n * Converts one explicit variable-name group into same-shaped CSS references.\n *\n * @param names - Approved variable names.\n * @returns Same-shaped CSS variable references.\n */\nfunction mapFlatReferences<T extends Readonly<Record<string, QuireKitThemeCssVariableName>>>(names: T): { readonly [Key in keyof T]: string } {\n return Object.freeze(Object.fromEntries(Object.entries(names).map(([key, name]) => [key, reference(name)]))) as { readonly [Key in keyof T]: string };\n}\n","import type { QuireKitToolbarCollapseUnit } from \"./types\";\n\n/**\n * Resolves how many leading units stay visible when trailing units collapse into a \"more\" control.\n *\n * Advances already include gaps, so the row's width is their sum. Once the row overflows, the\n * \"more\" control's advance is reserved and a separator is never left as the last visible unit.\n *\n * @param units - Units in display order with their measured advances.\n * @param available - Inline size available for the row.\n * @param moreAdvance - Inline size of the \"more\" control plus the gap before it.\n * @returns Number of leading units that remain visible.\n */\nexport function resolveQuireKitToolbarVisibleUnits(\n units: readonly QuireKitToolbarCollapseUnit[],\n available: number,\n moreAdvance: number\n): number {\n const total = units.reduce((sum, unit) => sum + unit.advance, 0);\n if (total <= available + 0.5) return units.length;\n const budget = available - moreAdvance;\n let used = 0;\n let count = 0;\n for (const unit of units) {\n if (used + unit.advance > budget) break;\n used += unit.advance;\n count += 1;\n }\n while (count > 0 && units[count - 1]!.separator) count -= 1;\n return count;\n}\n","import type {\n QuireKitToolbarNavigationOptions,\n QuireKitToolbarRovingItem\n} from \"./types\";\n\n/**\n * Resolves the single enabled toolbar item that owns the initial Tab stop.\n *\n * @param items - DOM-ordered toolbar items.\n * @param preferredId - Item that previously owned the Tab stop.\n * @returns Stable enabled item id, or undefined when every item is disabled.\n */\nexport function resolveToolbarTabStop(\n items: readonly QuireKitToolbarRovingItem[],\n preferredId?: string\n): string | undefined {\n const preferred = items.find(\n (item) => item.id === preferredId && item.disabled !== true\n );\n return preferred?.id ?? items.find((item) => item.disabled !== true)?.id;\n}\n\n/**\n * Resolves a toolbar-owned keyboard movement while skipping disabled controls.\n *\n * Home and End always reach the first and last enabled item. Horizontal arrows\n * mirror in RTL, while vertical toolbars own ArrowUp and ArrowDown.\n *\n * @param items - DOM-ordered toolbar items.\n * @param currentId - Item that dispatched the keyboard event.\n * @param key - Native KeyboardEvent key value.\n * @param options - Orientation, direction, and edge-loop policy.\n * @returns Target item id, or undefined when the toolbar does not own the key.\n */\nexport function resolveToolbarNavigationTarget(\n items: readonly QuireKitToolbarRovingItem[],\n currentId: string,\n key: string,\n options: QuireKitToolbarNavigationOptions\n): string | undefined {\n const enabledItems = items.filter((item) => item.disabled !== true);\n if (enabledItems.length === 0) return undefined;\n if (key === \"Home\") return enabledItems[0]?.id;\n if (key === \"End\") return enabledItems.at(-1)?.id;\n\n const movement = resolveMovement(key, options);\n if (movement === undefined) return undefined;\n const currentIndex = enabledItems.findIndex((item) => item.id === currentId);\n const startIndex = currentIndex < 0 ? 0 : currentIndex;\n const candidate = startIndex + movement;\n if (candidate >= 0 && candidate < enabledItems.length) {\n return enabledItems[candidate]?.id;\n }\n if (options.loop === false) return enabledItems[startIndex]?.id;\n return movement > 0 ? enabledItems[0]?.id : enabledItems.at(-1)?.id;\n}\n\n/**\n * Maps an owned arrow key to previous or next movement.\n *\n * @param key - Native KeyboardEvent key value.\n * @param options - Toolbar orientation and text direction.\n * @returns Negative or positive movement, or undefined for an unowned key.\n */\nfunction resolveMovement(\n key: string,\n options: QuireKitToolbarNavigationOptions\n): -1 | 1 | undefined {\n if (options.orientation === \"vertical\") {\n if (key === \"ArrowUp\") return -1;\n if (key === \"ArrowDown\") return 1;\n return undefined;\n }\n const direction = options.direction ?? \"ltr\";\n if (key === \"ArrowLeft\") return direction === \"rtl\" ? 1 : -1;\n if (key === \"ArrowRight\") return direction === \"rtl\" ? -1 : 1;\n return undefined;\n}\n","import type { QuireKitToolbarEntry } from \"./types\";\n\n/** Width of an icon control with a disclosure indicator or a split disclosure. */\nconst indicatedIconSpan = 1.5;\n\n/**\n * Resolves an entry's width in toolbar units.\n *\n * One unit is an icon action. Icon controls that also show a disclosure\n * indicator, and icon split buttons, take one and a half units. Entries with\n * visible text, custom controls, groups, and separators keep their natural width\n * unless they declare a span.\n *\n * @param entry - Toolbar entry.\n * @returns Span in units, or null for natural width.\n */\nexport function resolveQuireKitToolbarEntrySpan(entry: QuireKitToolbarEntry): number | null {\n if (entry.span !== undefined) return entry.span > 0 ? entry.span : null;\n const kind = entry.kind ?? \"action\";\n if (kind === \"separator\" || kind === \"group\" || kind === \"custom\" || kind === \"selector\") return null;\n const hasIcon = entry.icon !== undefined || entry.iconData !== undefined;\n if (!hasIcon || entry.text !== undefined) return null;\n if (kind === \"split\") return indicatedIconSpan;\n if (kind === \"menu\") return entry.trigger !== \"disclosure\" ? null : entry.indicator === false ? 1 : indicatedIconSpan;\n if (kind === \"disclosure\") return entry.indicator === true ? indicatedIconSpan : 1;\n return 1;\n}\n\n/**\n * Sums the unit widths of entries whose spans resolve.\n *\n * @param entries - Row entries.\n * @returns Total units, ignoring hidden and natural-width entries.\n */\nexport function sumQuireKitToolbarSpans(entries: readonly QuireKitToolbarEntry[]): number {\n return entries.reduce((total, entry) => {\n if (entry.hidden === true) return total;\n if (entry.kind === \"group\") return total + sumQuireKitToolbarSpans(entry.children ?? []);\n return total + (resolveQuireKitToolbarEntrySpan(entry) ?? 0);\n }, 0);\n}\n","/** Stable document-color rows shared by product and contextual authoring. */\nexport const quireDocumentColorRows = Object.freeze([\n [\"#FFFFFF\", \"#0F172A\", \"#E5484D\", \"#F76B15\", \"#F5B942\", \"#46A758\", \"#12A594\", \"#3E63DD\", \"#8E4EC6\", \"#D6409F\"],\n [\"#A1A1AA\", \"#3B4A66\", \"#E46A6E\", \"#F28C4B\", \"#E8C15C\", \"#65B867\", \"#47B8AB\", \"#5472D4\", \"#9A64C8\", \"#D65A9E\"],\n [\"#C7C9CE\", \"#707B91\", \"#E99699\", \"#F5B67F\", \"#F2D98B\", \"#94CD93\", \"#81CFC5\", \"#89A0E4\", \"#B590DC\", \"#E18BBC\"],\n [\"#E1E2E5\", \"#A0A8B7\", \"#F3C0C2\", \"#FAD7B9\", \"#F8E9BA\", \"#C2E5C1\", \"#B9E6E0\", \"#C0CDF0\", \"#D5C4EA\", \"#EEC3DA\"],\n [\"#71717A\", \"#25314A\", \"#CD2B31\", \"#D94F0B\", \"#CEA11D\", \"#2A7E3B\", \"#0E7C72\", \"#3451B2\", \"#6E3CBC\", \"#AB2B7D\"],\n [\"#52525B\", \"#1E293B\", \"#B91C1C\", \"#C2410C\", \"#A16207\", \"#237B4B\", \"#0F766E\", \"#1D4ED8\", \"#6D28D9\", \"#9D174D\"],\n [\"#27272A\", \"#111827\", \"#7F1D1D\", \"#7C2D12\", \"#713F12\", \"#14532D\", \"#134E4A\", \"#1E3A8A\", \"#4C1D95\", \"#701A4B\"]\n] as const);\n","import type { QuireKitCommentAnchorProjection, QuireKitCommentCardGeometry, QuireKitCommentRailLayout } from './types';\n\n/**\n * Converts a viewport anchor into a rail coordinate. Anchor and rail share one scroll owner,\n * so their difference stays the same while the document scrolls.\n * @param input - Current viewport geometry.\n * @returns Anchor top relative to the comment-list origin.\n */\nexport function projectQuireCommentAnchor(input: QuireKitCommentAnchorProjection): number {\n return finite(input.anchorClientY) - finite(input.railClientY);\n}\n\n/**\n * Places cards in document order with one forward pass: each card sits at its anchor\n * unless that would overlap the previous card, in which case it is pushed down.\n * @param cards - Measured cards in document-anchor order.\n * @param documentHeight - Rail height available through the document bottom.\n * @param minimumGap - Separation between adjacent cards.\n * @returns Card tops and overflow state.\n */\nexport function layoutQuireCommentRail(cards: readonly QuireKitCommentCardGeometry[], documentHeight: number, minimumGap = 12): QuireKitCommentRailLayout {\n const floor = nonNegative(documentHeight), gap = nonNegative(minimumGap), cardTops: number[] = [];\n let bottom = 0;\n for (const [index, card] of cards.entries()) {\n const top = Math.max(nonNegative(card.anchorTop), index === 0 ? 0 : bottom + gap);\n cardTops.push(top);\n bottom = top + nonNegative(card.cardHeight);\n }\n const stackBottom = cards.length ? bottom : 0;\n return { cardTops, stackBottom, railHeight: Math.max(floor, stackBottom), hasDocumentOverflow: stackBottom > floor };\n}\n\n/** @param value - Browser or caller supplied CSS-pixel value. @returns The value, or zero when not finite. */\nfunction finite(value: number): number { return Number.isFinite(value) ? value : 0; }\n\n/** @param value - Browser or caller supplied CSS-pixel dimension. @returns A finite non-negative value. */\nfunction nonNegative(value: number): number { return Math.max(0, finite(value)); }\n","import type { Color } from \"@ark-ui/vue/color-picker\";\nimport { parseColor } from \"@ark-ui/vue/color-picker\";\n\n/** QuireKit Color Picker 的安全回退颜色。 */\nexport const quireColorPickerFallbackValue = \"#1677FF\";\n\n/**\n * 把 CSS 颜色字符串解析为 Ark/Zag Color,并为无效输入提供稳定回退。\n *\n * @param value - 调用方提供的 CSS 颜色字符串。\n * @param fallback - 输入无效时使用的 CSS 颜色字符串。\n * @returns 可交给 Ark Color Picker machine 的颜色对象。\n */\nexport function parseQuireColor(\n value: string | undefined,\n fallback = quireColorPickerFallbackValue\n): Color {\n try {\n return parseColor(value ?? fallback);\n } catch {\n return parseColor(fallback);\n }\n}\n\n/**\n * 把 Ark/Zag Color 投影为稳定的 HEX/HEXA 公共值。\n *\n * @param color - Ark Color Picker machine 返回的颜色对象。\n * @returns 不透明颜色使用 HEX,透明颜色使用 HEXA 的 CSS 字符串。\n */\nexport function serializeQuireColor(color: Color): string {\n return color.getChannelValue(\"alpha\") >= 1\n ? color.toString(\"hex\").toUpperCase()\n : color.toString(\"hexa\").toUpperCase();\n}\n","import { quireKitDefaultLocale } from '../../locale/resolve';\nimport type { Messages as QuireKitFileUploadMessages } from '../../locale/components/file-upload';\n\n/** Formats public validation codes without dropping custom validation messages.\n * @param errors - Current file's validation codes.\n * @param messages - FileUpload text of the active language; defaults to Chinese.\n * @returns Deduplicated readable feedback.\n */\nexport function getQuireKitFileUploadErrorMessage(errors: readonly string[], messages: QuireKitFileUploadMessages = quireKitDefaultLocale.messages.fileUpload): string {\n return [...new Set(errors.map(error => messages.errors[error] ?? error))].join(messages.errorSeparator);\n}\n","import { en, type Messages as QuireKitEmojiPickerMessages } from \"../../locale/components/emoji-picker\";\nimport { quireKitBuiltInLocales, quireKitDefaultLocale } from \"../../locale/resolve\";\nimport type { QuireKitEmojiGroup, QuireKitEmojiItem } from \"./types\";\n\n// A curated, replaceable Unicode catalog. These are characters, not external assets;\n// names and group labels come from the language packs.\nconst rows = [\n [\"faces\", \"smile\", [\n \"😀\", \"😃\", \"😄\", \"😁\", \"😆\", \"😅\", \"😂\", \"🤣\", \"🙂\", \"🙃\", \"😉\", \"😊\", \"🥰\", \"😍\", \"🤩\", \"😘\", \"😋\", \"😎\", \"🥳\", \"🤔\", \"🤗\",\n \"🤭\", \"🤫\", \"🤐\", \"😐\", \"🙄\", \"😴\", \"🥱\", \"😢\", \"😭\", \"😱\", \"😡\", \"🥺\", \"😷\", \"🤒\", \"🤯\", \"👋\", \"👌\", \"✌️\", \"👍\", \"👎\", \"👏\",\n \"🙌\", \"🙏\", \"🤝\", \"💪\", \"👀\", \"🧑‍💻\"\n ]],\n [\"nature\", \"pawPrint\", [\n \"🐶\", \"🐱\", \"🐼\", \"🐻\", \"🦊\", \"🐰\", \"🐸\", \"🐵\", \"🐔\", \"🐧\", \"🦋\", \"🐝\", \"🐢\", \"🐬\", \"🐳\", \"🦄\", \"🌱\", \"🌿\", \"🌳\", \"🌸\", \"🌻\",\n \"🌹\", \"☀️\", \"🌙\", \"⭐\", \"🌈\", \"🔥\", \"❄️\"\n ]],\n [\"food\", \"utensils\", [\n \"🍎\", \"🍊\", \"🍋\", \"🍌\", \"🍉\", \"🍇\", \"🍓\", \"🍑\", \"🥑\", \"🥕\", \"🍞\", \"🥐\", \"🍔\", \"🍟\", \"🍕\", \"🍜\", \"🍚\", \"🥟\", \"🍣\", \"🎂\", \"🍰\",\n \"🍩\", \"🍪\", \"🍫\", \"☕\", \"🍵\", \"🧋\", \"🥂\"\n ]],\n [\"travel\", \"car\", [\n \"🚗\", \"🚕\", \"🚌\", \"🚲\", \"🚆\", \"🚄\", \"✈️\", \"🚀\", \"🚢\", \"🏠\", \"🏢\", \"🏫\", \"🏥\", \"🏕️\", \"🏖️\", \"🏔️\", \"🗺️\", \"🌏\", \"🧭\", \"🌅\"\n ]],\n [\"activities\", \"volleyball\", [\n \"🎉\", \"🎊\", \"🎈\", \"🎁\", \"🏆\", \"🥇\", \"🎯\", \"⚽\", \"🏀\", \"🏐\", \"🎾\", \"🏓\", \"🎮\", \"🧩\", \"🎨\", \"🎵\", \"🎸\", \"🎹\", \"🎬\", \"🎤\"\n ]],\n [\"objects\", \"lightbulb\", [\n \"💡\", \"📌\", \"📅\", \"⏰\", \"⌛\", \"💻\", \"⌨️\", \"📱\", \"📷\", \"🔍\", \"📚\", \"📝\", \"✏️\", \"📎\", \"📁\", \"📊\", \"🔔\", \"📣\", \"🔒\", \"🔑\",\n \"🔧\", \"⚙️\", \"🔗\", \"🧪\"\n ]],\n [\"symbols\", \"heart\", [\n \"❤️\", \"🧡\", \"💛\", \"💚\", \"💙\", \"💜\", \"🤍\", \"💔\", \"✅\", \"❌\", \"⚠️\", \"🚫\", \"❗\", \"❓\", \"💯\", \"✨\", \"♻️\", \"➕\", \"➖\", \"➡️\",\n \"⬅️\", \"⬆️\", \"⬇️\", \"🔄\"\n ]],\n] as const;\n\n/**\n * @param messages - EmojiPicker text of the active language; defaults to Chinese.\n * @returns Fresh, ordered category declarations.\n */\nexport function createQuireEmojiGroups(\n messages: QuireKitEmojiPickerMessages = quireKitDefaultLocale.messages.emojiPicker\n): readonly QuireKitEmojiGroup[] {\n return rows.map(([value, icon]) => ({ value, label: messages.groups[value] ?? en.groups[value], icon }));\n}\n\n/**\n * Builds the default catalog; names of every built-in language stay searchable.\n * @param messages - EmojiPicker text of the active language; defaults to Chinese.\n * @returns The replaceable default Unicode catalog.\n */\nexport function createQuireEmojiCatalog(\n messages: QuireKitEmojiPickerMessages = quireKitDefaultLocale.messages.emojiPicker\n): readonly QuireKitEmojiItem[] {\n const builtIn = quireKitBuiltInLocales.map(locale => locale.messages.emojiPicker.names);\n return rows.flatMap(([group, , values]) => values.map(value => {\n const label = messages.names[value] ?? en.names[value] ?? value;\n const keywords = [...new Set([label, ...builtIn.flatMap(names => names[value] ?? [])])];\n return { value, group, label, keywords };\n }));\n}\n","import type { QuireKitEmojiItem } from \"./types\";\n\n/** @param items - Host or default catalog. @param query - Unicode, label or shortcode query. @param group - Optional category. @returns Stable filtered values, never modifying host data. */\nexport function filterQuireEmojis(items: readonly QuireKitEmojiItem[], query: string, group?: string): readonly QuireKitEmojiItem[] {\n const terms = query.normalize(\"NFKC\").toLocaleLowerCase().replace(/:/gu, \"\").trim().split(/\\s+/u).filter(Boolean);\n const seen = new Set<string>();\n return items.filter(item => {\n if (!item.value || seen.has(item.value)) return false;\n seen.add(item.value);\n if (!terms.length) return !group || item.group === group;\n const searchable = [item.value, item.label, ...(item.keywords ?? [])].join(\" \").normalize(\"NFKC\").toLocaleLowerCase();\n return terms.every(term => searchable.includes(term));\n });\n}\n\n/** @param items - Admitted catalog. @param recent - Host-owned recent Unicode values. @returns Deduplicated recent items without inventing missing labels. */\nexport function resolveQuireRecentEmojis(items: readonly QuireKitEmojiItem[], recent: readonly string[]): readonly QuireKitEmojiItem[] {\n const lookup = new Map(items.map(item => [item.value, item]));\n return [...new Set(recent)].flatMap(value => lookup.get(value) ?? []);\n}\n","import type { QuireKitSelectionHandlePoint } from '../types';\nimport type { SelectionHandleHold, SelectionHandleHoldOptions } from './types';\n\n/** @param value - Configured threshold. @param fallback - Default threshold. @returns A finite nonnegative value. */\nfunction threshold(value: number | undefined, fallback: number): number {\n return value !== undefined && Number.isFinite(value) && value >= 0 ? value : fallback;\n}\n\n/**\n * Separates immediate caret movement from holding that caret to extend a range.\n * @param options - Timer ports and readiness notification, without a second frame scheduler.\n * @returns Recognition state owned by the existing captured drag.\n */\nexport function createSelectionHandleHold(options: SelectionHandleHoldOptions): SelectionHandleHold {\n let phase: 'idle' | 'pending' | 'moving' | 'ready' | 'selecting' = 'idle';\n let origin: QuireKitSelectionHandlePoint = { x: 0, y: 0 };\n let timer: number | null = null;\n let tolerance = 8;\n /** Clears delayed recognition before releasing or replacing pointer ownership. */\n function clear(): void {\n if (timer !== null) options.cancelDelay(timer);\n timer = null;\n phase = 'idle';\n }\n return {\n /** @param detail - Stable endpoint and raw grab point. @param settings - Per-press thresholds. */\n begin(detail, settings) {\n clear();\n if (detail.handle !== 'caret') return;\n origin = detail.pointer;\n tolerance = threshold(settings.movementThreshold, 8);\n phase = 'pending';\n timer = options.delay(() => {\n timer = null;\n if (phase !== 'pending') return;\n phase = 'ready';\n options.onReady();\n }, threshold(settings.longPressDelay, 450));\n },\n /** @param point - Raw client point. @returns False while waiting within the allowed jitter. */\n move(point) {\n if (phase !== 'pending' && phase !== 'ready') return true;\n if (Math.hypot(point.x - origin.x, point.y - origin.y) <= tolerance) return false;\n if (timer !== null) options.cancelDelay(timer);\n timer = null;\n phase = phase === 'ready' ? 'selecting' : 'moving';\n return true;\n },\n /** @returns Whether this pointer owns long-press selection. */\n selecting: () => phase === 'ready' || phase === 'selecting',\n /** @returns Whether release should report idle long-press actions. */\n stationary: () => phase === 'ready',\n clear\n };\n}\n","import type { QuireKitSelectionHandleDrag, QuireKitSelectionHandleEndReason, QuireKitSelectionHandlePoint } from '../types';\nimport type { SelectionHandleDragController, SelectionHandleDragOptions } from './types';\nimport { createSelectionHandleHold } from './hold';\n\n/**\n * Coalesces raw input without delaying the final release or retaining stale work.\n * @param options - Host scheduler and notifications.\n * @returns One explicitly cancellable pointer session.\n */\nexport function createSelectionHandleDrag(options: SelectionHandleDragOptions): SelectionHandleDragController {\n let active: QuireKitSelectionHandleDrag | null = null;\n let offset = { x: 0, y: 0 };\n let pending: QuireKitSelectionHandlePoint | null = null;\n let frame: number | null = null;\n let generation = 0;\n const hold = createSelectionHandleHold({\n delay: options.delay, cancelDelay: options.cancelDelay,\n onReady: () => { if (active) options.onLongPressStart(active); }\n });\n\n /** Drops stale samples before cancellation or a synchronous final flush. */\n function clear(): void {\n if (frame !== null) options.cancelFrame(frame);\n frame = null;\n pending = null;\n }\n /** @param point - Latest raw client point, never a local overlay coordinate. */\n function deliver(point: QuireKitSelectionHandlePoint): void {\n if (!active) return;\n active = { ...active, pointer: point, point: { x: point.x - offset.x, y: point.y - offset.y } };\n options.onMove(active);\n }\n /** Consumes only the most recent complete sample for this presentation frame. */\n function flush(): void {\n frame = null;\n const point = pending;\n pending = null;\n if (point) deliver(point);\n }\n /** @param reason - Completion cause, with state detached before notifying consumers. */\n function finish(reason: QuireKitSelectionHandleEndReason): void {\n clear();\n const previous = active;\n active = null;\n hold.clear();\n generation++;\n if (previous) options.onEnd({ ...previous, reason });\n }\n return {\n /** @param detail - Initial client sample. @param settings - Caret hold thresholds. @returns Whether acquisition survived callbacks. */\n begin(detail, settings = {}) {\n if (active) return false;\n active = detail;\n offset = { x: detail.pointer.x - detail.point.x, y: detail.pointer.y - detail.point.y };\n hold.begin(detail, settings);\n options.onStart(detail);\n return active !== null;\n },\n /** @param pointerId - Input owner. @param point - Raw client sample. */\n move(pointerId, point) {\n if (active?.pointerId !== pointerId) return;\n if (!hold.move(point)) return;\n pending = point;\n if (frame === null) frame = options.schedule(flush);\n },\n /** @param pointerId - Input owner. @param point - Actual pointerup client sample. */\n release(pointerId, point) {\n if (active?.pointerId !== pointerId) return;\n hold.move(point);\n if (hold.stationary()) { finish('long-press'); return; }\n const version = generation;\n clear();\n deliver(point);\n // A consumer may cancel or replace the session while accepting this final input.\n if (active && generation === version) finish('release');\n },\n /** @param reason - Cancellation cause. */\n cancel: finish,\n /** @returns Whether the caret has entered long-press selection. */\n selecting: hold.selecting,\n /** @returns Current delivered input, without exposing pending raw events. */\n current: () => active\n };\n}\n","import { quireKitDefaultLocale } from '../../../locale/resolve';\nimport type { QuireKitSelectionHandle, QuireKitSelectionHandlesProps } from '../types';\nimport type { SelectionHandleElements, SelectionHandlePresentation } from './types';\n\n/** Stable DOM order; changing range direction never replaces the captured button. */\nexport const selectionHandleIds = ['caret', 'anchor', 'focus'] as const;\n\n/** @param doc - Owning document. @param id - Stable endpoint. @returns Permanent handle anatomy. */\nexport function createHandle(doc: Document, id: QuireKitSelectionHandle): SelectionHandleElements {\n const root = doc.createElement('div');\n root.className = 'qk-selection-handles__endpoint';\n root.dataset.handle = id;\n const stem = doc.createElement('span');\n stem.className = 'qk-selection-handles__stem';\n stem.setAttribute('aria-hidden', 'true');\n const button = doc.createElement('button');\n button.type = 'button';\n button.className = 'qk-selection-handles__grip';\n button.setAttribute('aria-keyshortcuts', 'ArrowLeft ArrowRight ArrowUp ArrowDown');\n const knob = doc.createElement('span');\n knob.className = 'qk-selection-handles__knob';\n knob.setAttribute('aria-hidden', 'true');\n button.append(knob);\n const marker = doc.createElement('span');\n marker.className = 'qk-selection-handles__marker';\n marker.setAttribute('aria-hidden', 'true');\n root.append(stem, marker, button);\n return { root, stem, button };\n}\n\n/**\n * Resolves visibility and visual side without interpreting document positions.\n * @param state - Current host projection.\n * @param id - Stable endpoint identity.\n * @returns A valid visible endpoint, or null.\n */\nexport function getHandlePresentation(state: QuireKitSelectionHandlesProps, id: QuireKitSelectionHandle): SelectionHandlePresentation | null {\n const value = state.selection;\n if (!value || (value.type === 'caret') !== (id === 'caret')) return null;\n const geometry = value.type === 'caret' ? value.caret : value[id as 'anchor' | 'focus'];\n if (!geometry || ![geometry.x, geometry.y, geometry.height].every(Number.isFinite) || geometry.height <= 0) return null;\n const side = value.type === 'range' && ((id === 'anchor') !== !!value.backward) ? 'start' : 'end';\n const labels = state.messages ?? quireKitDefaultLocale.messages.selectionHandles;\n return { geometry, side: state.selecting && id === 'focus' ? 'end' : side, boundary: id === 'caret' ? 'caret' : side, label: labels[id === 'caret' ? 'caret' : side] };\n}\n\n/**\n * Allows only a held caret to become a range without losing its captured input.\n * @param previous - Previously accepted host projection.\n * @param next - Next host projection.\n * @param handle - Stable captured endpoint.\n * @param selecting - Whether this caret owns a recognized long press.\n * @returns Whether the new geometry can continue the same gesture.\n */\nexport function canContinueHandleDrag(previous: QuireKitSelectionHandlesProps, next: QuireKitSelectionHandlesProps, handle: QuireKitSelectionHandle, selecting: boolean): boolean {\n if (next.disabled) return false;\n const promotesCaret = selecting && handle === 'caret' && next.selection?.type === 'range';\n if (previous.selection?.type !== next.selection?.type && !promotesCaret) return false;\n return getHandlePresentation(next, promotesCaret ? 'focus' : handle) !== null;\n}\n\n/** @param nodes - Permanent anatomy. @param value - Valid geometry, or hidden. @param disabled - Interaction gate. */\nexport function renderHandle(nodes: SelectionHandleElements, value: SelectionHandlePresentation | null, disabled: boolean): void {\n nodes.root.hidden = !value;\n nodes.button.disabled = disabled || !value;\n if (!value) return;\n nodes.root.dataset.side = value.side;\n nodes.root.dataset.boundary = value.boundary;\n nodes.root.style.left = `${value.geometry.x}px`;\n nodes.root.style.top = `${value.geometry.y}px`;\n nodes.root.style.height = `${value.geometry.height}px`;\n nodes.button.setAttribute('aria-label', value.label);\n}\n","import { trackQuireKitInputModality } from '../control/modality';\nimport { createSelectionHandleDrag } from './drag/controller';\nimport { canContinueHandleDrag, createHandle, getHandlePresentation, renderHandle, selectionHandleIds } from './dom/handles';\nimport type { CreateQuireSelectionHandlesOptions, QuireKitSelectionHandle, QuireKitSelectionHandlesProps, QuireSelectionHandlesController } from './types';\n\n/**\n * Creates a controlled cursor/range overlay without importing an editor or framework.\n * @param options - Initial geometry, owning document and host callbacks.\n * @returns Stable DOM, update, cancellation and teardown methods.\n */\nexport function createQuireSelectionHandles(options: CreateQuireSelectionHandlesOptions): QuireSelectionHandlesController {\n const doc = options.ownerDocument;\n const win = doc.defaultView!;\n if (!win) throw new Error('Selection handles require a document with a window.');\n trackQuireKitInputModality(doc);\n const root = doc.createElement('div');\n root.className = 'qk-selection-handles';\n const nodes = { caret: createHandle(doc, 'caret'), anchor: createHandle(doc, 'anchor'), focus: createHandle(doc, 'focus') };\n let state: QuireKitSelectionHandlesProps = options;\n let destroyed = false;\n\n const drag = createSelectionHandleDrag({\n delay: (callback, ms) => win.setTimeout(callback, ms),\n cancelDelay: id => win.clearTimeout(id),\n schedule: callback => win.requestAnimationFrame(callback),\n cancelFrame: id => win.cancelAnimationFrame(id),\n onStart(detail) {\n root.dataset.dragging = '';\n nodes[detail.handle].root.dataset.dragging = '';\n listen(true);\n options.onDragStart?.(detail);\n },\n onMove: detail => options.onDrag?.(detail),\n onLongPressStart(detail) {\n render();\n options.onLongPressStart?.(detail);\n },\n onEnd(detail) {\n // Detach listeners and capture before invoking a consumer that may unmount or start anew.\n listen(false);\n delete root.dataset.dragging;\n const node = nodes[detail.handle];\n delete node.root.dataset.dragging;\n if (root.hasPointerCapture(detail.pointerId)) root.releasePointerCapture(detail.pointerId);\n render();\n options.onDragEnd?.(detail);\n if (!destroyed && detail.reason === 'release') options.onSelectionComplete?.(detail);\n if (!destroyed && detail.reason === 'long-press') options.onLongPress?.(detail);\n }\n });\n\n /** @param event - Browser input. @returns Whether this instance owns the pointer. */\n function owns(event: PointerEvent): boolean { return drag.current()?.pointerId === event.pointerId; }\n /** @param event - Claimed input that must not reach the editor's pointer handlers. */\n function consume(event: Event): void { event.preventDefault(); event.stopPropagation(); }\n /** @param event - Touch defaults are independent of PointerEvent cancellation. */\n function nativeTouch(event: TouchEvent): void {\n if (!destroyed && !state.disabled && state.selection) consume(event);\n }\n /** @param event - A touch menu may target text underneath the temporarily transparent grip. */\n function nativeContextMenu(event: MouseEvent): void {\n const current = drag.current();\n if (current?.pointerType !== 'touch') return;\n if ('pointerType' in event && event.pointerType && event.pointerType !== 'touch') return;\n if ('pointerId' in event && typeof event.pointerId === 'number' && event.pointerId > 0 && event.pointerId !== current.pointerId) return;\n consume(event);\n }\n /** @param event - Raw input; no DOM measurement occurs in this hot path. */\n function move(event: PointerEvent): void {\n if (!owns(event)) return;\n consume(event);\n drag.move(event.pointerId, { x: event.clientX, y: event.clientY });\n }\n /** @param event - Actual final pointer sample, flushed before capture is released. */\n function release(event: PointerEvent): void {\n if (!owns(event)) return;\n consume(event);\n drag.release(event.pointerId, { x: event.clientX, y: event.clientY });\n }\n /** @param event - OS cancellation, which must not apply an unaccepted coordinate. */\n function cancelPointer(event: PointerEvent): void { if (owns(event)) drag.cancel('cancel'); }\n /** Cancels when the browser window loses interaction ownership. */\n function blur(): void { drag.cancel('blur'); }\n /** Cancels suspended pages so there is no delayed input after returning. */\n function visibility(): void { if (doc.hidden) blur(); }\n /** @param event - Escape reaches the active session even while editor focus is retained. */\n function escape(event: KeyboardEvent): void {\n if (event.key !== 'Escape') return;\n consume(event);\n drag.cancel('escape');\n }\n /** @param active - Install listeners only for the lifetime of a claimed gesture. */\n function listen(active: boolean): void {\n const method = active ? 'addEventListener' : 'removeEventListener';\n win[method]('pointermove', move as EventListener, true);\n win[method]('pointerup', release as EventListener, true);\n win[method]('pointercancel', cancelPointer as EventListener, true);\n win[method]('contextmenu', nativeContextMenu as EventListener, true);\n win[method]('keydown', escape as EventListener, true);\n win[method]('blur', blur);\n doc[method]('visibilitychange', visibility);\n }\n /** @param id - Stable handle. @param event - Pointer acquisition at the grip. */\n function begin(id: QuireKitSelectionHandle, event: PointerEvent): void {\n if (destroyed || state.disabled || drag.current() || event.button !== 0 || !event.isPrimary || !getHandlePresentation(state, id)) return;\n consume(event);\n const node = nodes[id];\n // Measure the actual CSS-scaled line once; keeping the grab offset prevents a first-frame jump.\n const rect = node.stem.getBoundingClientRect();\n // The overlay survives caret-to-range projection; a hidden caret button cannot keep capture.\n try { root.setPointerCapture(event.pointerId); }\n catch { return; } // An already cancelled native pointer cannot own a new drag.\n drag.begin({\n handle: id, pointerId: event.pointerId, pointerType: event.pointerType,\n point: { x: rect.left + rect.width / 2, y: rect.top + rect.height / 2 },\n pointer: { x: event.clientX, y: event.clientY }\n }, state);\n }\n /** @param id - Endpoint receiving a physical arrow. @param event - Keyboard input. */\n function nudge(id: QuireKitSelectionHandle, event: KeyboardEvent): void {\n if (state.disabled || event.altKey || event.ctrlKey || event.metaKey || !getHandlePresentation(state, id)) return;\n const direction = ({ ArrowLeft: 'left', ArrowRight: 'right', ArrowUp: 'up', ArrowDown: 'down' } as const)[event.key as 'ArrowLeft'];\n if (!direction) return;\n consume(event);\n options.onNudge?.({ handle: id, direction, accelerated: event.shiftKey });\n }\n /** Reprojects bounded presentation without rebuilding captured or focused nodes. */\n function render(): void {\n const projection = { ...state, selecting: !!state.selecting || drag.selecting() };\n root.dataset.selecting = String(projection.selecting);\n for (const id of selectionHandleIds) renderHandle(nodes[id], getHandlePresentation(projection, id), !!state.disabled);\n }\n\n root.onlostpointercapture = event => { if (owns(event)) drag.cancel('capture-lost'); };\n root.onclick = consume;\n root.oncontextmenu = consume;\n // Cancel the original touch before the browser schedules its callout. Keep\n // listeners on the stable overlay across the caret-to-range projection.\n root.addEventListener('touchstart', nativeTouch, { passive: false });\n root.addEventListener('touchmove', nativeTouch, { passive: false });\n for (const id of selectionHandleIds) {\n const node = nodes[id];\n node.button.onpointerdown = event => begin(id, event);\n node.button.onkeydown = event => nudge(id, event);\n node.button.onclick = consume;\n node.button.oncontextmenu = consume;\n node.button.ondragstart = consume;\n root.append(node.root);\n }\n render();\n return {\n element: root,\n /** @param next - Complete controlled geometry and accessibility state. */\n update(next) {\n if (destroyed) return;\n const current = drag.current();\n const canContinue = !current || canContinueHandleDrag(state, next, current.handle, drag.selecting());\n state = next;\n if (!canContinue) {\n drag.cancel(next.disabled ? 'disabled' : 'selection-change');\n }\n render();\n },\n /** Cancels a stale host document target without reverting accepted host state. */\n cancel() { drag.cancel('cancel'); },\n /** Tears down capture, scheduling, listeners and the three permanent nodes. */\n destroy() {\n if (destroyed) return;\n destroyed = true;\n drag.cancel('destroy');\n root.onlostpointercapture = null;\n root.onclick = null;\n root.oncontextmenu = null;\n root.removeEventListener('touchstart', nativeTouch);\n root.removeEventListener('touchmove', nativeTouch);\n for (const { button } of Object.values(nodes)) {\n button.onpointerdown = button.onkeydown = null;\n button.onclick = button.oncontextmenu = button.ondragstart = null;\n }\n root.remove();\n }\n };\n}\n","import type { QuireKitSelectionGestureDetail } from '../types';\nimport type { QuireKitSelectionHandlePoint } from '../../selection-handles/types';\nimport type { SelectionGestureSession, SelectionGestureSessionOptions } from './types';\n\n/** @param value - Configured threshold. @param fallback - Default value. @returns Finite nonnegative threshold. */\nfunction threshold(value: number | undefined, fallback: number): number {\n return value !== undefined && Number.isFinite(value) && value >= 0 ? value : fallback;\n}\n\n/**\n * Separates native scroll candidates, accepted holds and frame-coalesced selection gestures.\n * @param options - Time ports and semantic callbacks.\n * @returns Explicit recognition lifecycle.\n */\nexport function createSelectionGestureSession(options: SelectionGestureSessionOptions): SelectionGestureSession {\n let phase: ReturnType<SelectionGestureSession['phase']> = 'idle';\n let current: QuireKitSelectionGestureDetail | null = null;\n let pending: QuireKitSelectionHandlePoint | null = null;\n let timer: number | null = null;\n let frame: number | null = null;\n let tolerance = 8;\n let generation = 0;\n /** Clears all deferred work before handing ownership back to the host. */\n function clear(): void {\n if (timer !== null) options.cancelDelay(timer);\n if (frame !== null) options.cancelFrame(frame);\n timer = frame = null;\n pending = null;\n }\n /** Flushes the most recent pointer while preserving the original long-press anchor. */\n function flush(): void {\n frame = null;\n if (!current || !pending || phase !== 'dragging') return;\n current = { ...current, point: pending };\n pending = null;\n options.onSelectionChange?.(current);\n }\n /** @param reason - Why input was abandoned; pending scroll candidates remain silent. */\n function cancel(reason: Parameters<SelectionGestureSession['cancel']>[0]): void {\n clear();\n const accepted = phase === 'pressed' || phase === 'dragging';\n const previous = current;\n phase = 'idle';\n current = null;\n generation++;\n if (accepted && previous) options.onCancel?.({ ...previous, reason });\n }\n /** @param id - Input owner. @param point - Latest client point. */\n function move(id: number, point: QuireKitSelectionHandlePoint): void {\n if (!current || current.pointerId !== id) return;\n const distance = Math.hypot(point.x - current.origin.x, point.y - current.origin.y);\n if (phase === 'pending') { if (distance > tolerance) cancel('movement'); return; }\n if (phase === 'pressed') {\n if (distance <= tolerance) return;\n phase = 'dragging';\n options.onSelectionStart?.({ ...current, point });\n }\n if (phase !== 'dragging') return;\n pending = point;\n if (frame === null) frame = options.frame(flush);\n }\n return {\n /** @returns Current recognition phase. */\n phase: () => phase,\n /** @returns Last delivered sample. */\n current: () => current,\n /** @param detail - Initial client coordinates. @param props - Current recognition thresholds. */\n begin(detail, props) {\n if (current) { cancel('multitouch'); return; }\n if (props.disabled || !(props.pointerTypes ?? ['touch', 'pen']).includes(detail.pointerType)) return;\n current = detail;\n phase = 'pending';\n tolerance = threshold(props.movementThreshold, 8);\n timer = options.delay(() => {\n timer = null;\n if (phase !== 'pending' || !current) return;\n phase = 'pressed';\n options.onLongPressStart?.(current);\n }, threshold(props.longPressDelay, 450));\n },\n move,\n /** @param id - Input owner. @param point - Actual release position. */\n release(id, point) {\n if (!current || current.pointerId !== id) return;\n const version = generation;\n move(id, point);\n if (!current || generation !== version) return;\n if (phase === 'dragging') {\n if (frame !== null) options.cancelFrame(frame);\n pending = point;\n flush();\n }\n if (!current || generation !== version) return;\n const detail = { ...current, point };\n const completed = phase;\n clear();\n current = null;\n phase = 'idle';\n generation++;\n if (completed === 'pressed') options.onLongPress?.(detail);\n if (completed === 'dragging') options.onSelectionComplete?.(detail);\n },\n cancel\n };\n}\n","import { createSelectionGestureSession } from './session/controller';\nimport type { CreateQuireSelectionGestureOptions, QuireKitSelectionGestureProps, QuireSelectionGestureController } from './types';\n\n/**\n * Binds optional surface long-press selection while yielding ordinary touch scrolling.\n * @param options - Explicit surface, recognition settings and semantic callbacks.\n * @returns Update and teardown lifecycle; no editor or menu ownership is acquired.\n */\nexport function createQuireSelectionGesture(options: CreateQuireSelectionGestureOptions): QuireSelectionGestureController {\n const target = options.target;\n const doc = target.ownerDocument;\n const win = doc.defaultView!;\n if (!win) throw new Error('Selection gestures require a document with a window.');\n const hadClass = target.classList.contains('qk-selection-gesture');\n target.classList.add('qk-selection-gesture');\n let props: QuireKitSelectionGestureProps = options;\n let destroyed = false;\n let suppressClick = false;\n const session = createSelectionGestureSession({\n delay: (callback, delay) => win.setTimeout(callback, delay), cancelDelay: id => win.clearTimeout(id),\n frame: callback => win.requestAnimationFrame(callback), cancelFrame: id => win.cancelAnimationFrame(id),\n onLongPressStart(detail) { suppressClick = true; options.onLongPressStart?.(detail); },\n onLongPress(detail) { listen(false); options.onLongPress?.(detail); },\n onSelectionStart: detail => options.onSelectionStart?.(detail),\n onSelectionChange: detail => options.onSelectionChange?.(detail),\n onSelectionComplete(detail) { listen(false); options.onSelectionComplete?.(detail); },\n onCancel(detail) { listen(false); options.onCancel?.(detail); }\n });\n /** @returns Whether scrolling belongs to an accepted hold or drag. */\n function accepted(): boolean { return session.phase() === 'pressed' || session.phase() === 'dragging'; }\n /** @param event - Claimed input. */\n function consume(event: Event): void { event.preventDefault(); event.stopPropagation(); }\n /** @param event - Initial surface input; native controls and nested owners keep their gestures. */\n function down(event: PointerEvent): void {\n suppressClick = false;\n if (destroyed || props.disabled || event.button !== 0 || !event.isPrimary || options.ignore?.(event)) return;\n const origin = event.composedPath().find(entry => entry instanceof win.Element) as Element | undefined;\n const control = origin?.closest('button, input, textarea, select, a[href], [role=\"button\"], [contenteditable], .qk-selection-handles, .qk-selection-gesture');\n if (control && control !== target) return;\n const point = { x: event.clientX, y: event.clientY };\n session.begin({ pointerId: event.pointerId, pointerType: event.pointerType, origin: point, point }, props);\n if (session.current()) listen(true);\n }\n /** @param event - Raw pointer sample; waiting motion yields to native scrolling. */\n function move(event: PointerEvent): void {\n if (session.current()?.pointerId !== event.pointerId) return;\n if (accepted()) consume(event);\n session.move(event.pointerId, { x: event.clientX, y: event.clientY });\n if (!session.current()) listen(false);\n }\n /** @param event - Final point; pending ordinary taps remain available to the host. */\n function up(event: PointerEvent): void {\n if (session.current()?.pointerId !== event.pointerId) return;\n if (accepted()) consume(event);\n session.release(event.pointerId, { x: event.clientX, y: event.clientY });\n if (!session.current()) listen(false);\n }\n /** @param event - Native scroll cancellation or another interrupted pointer. */\n function cancelPointer(event: PointerEvent): void {\n if (session.current()?.pointerId !== event.pointerId) return;\n session.cancel('cancel');\n listen(false);\n }\n /** @param event - A second pointer yields the gesture to the browser. */\n function anotherPointer(event: PointerEvent): void {\n if (session.current()?.pointerId === event.pointerId) return;\n session.cancel('multitouch');\n listen(false);\n }\n /** @param event - Only an accepted hold may prevent the first native scroll movement. */\n function touchMove(event: TouchEvent): void { if (accepted() && event.cancelable) event.preventDefault(); }\n /** @param event - Native context menu generated by a claimed touch/pen hold. */\n function context(event: MouseEvent): void { if (session.current() || suppressClick) consume(event); }\n /** @param event - One compatibility click following a long press, never a new physical click. */\n function click(event: MouseEvent): void {\n if (suppressClick && event.detail !== 0) { suppressClick = false; consume(event); }\n }\n /** Cancels when the window loses input ownership. */\n function blur(): void { session.cancel('blur'); listen(false); }\n /** Cancels hidden pages to prevent delayed recognition after returning. */\n function visibility(): void { if (doc.hidden) blur(); }\n /** Cancels pre-hold scrolling; accepted host autoscroll remains supported. */\n function scroll(): void { if (session.phase() === 'pending') { session.cancel('scroll'); listen(false); } }\n /** @param event - Explicit keyboard cancellation. */\n function escape(event: KeyboardEvent): void {\n if (event.key !== 'Escape') return;\n if (accepted()) consume(event);\n session.cancel('escape');\n listen(false);\n }\n /** @param active - Candidate-scoped listeners, removed even when scrolling cancels silently. */\n function listen(active: boolean): void {\n const method = active ? 'addEventListener' : 'removeEventListener';\n win[method]('pointermove', move as EventListener, true);\n win[method]('pointerup', up as EventListener, true);\n win[method]('pointercancel', cancelPointer as EventListener, true);\n win[method]('pointerdown', anotherPointer as EventListener, true);\n win[method]('keydown', escape as EventListener, true);\n win[method]('scroll', scroll, true);\n win[method]('blur', blur);\n doc[method]('visibilitychange', visibility);\n target[method]('touchmove', touchMove as EventListener, { passive: false });\n }\n target.addEventListener('pointerdown', down);\n target.addEventListener('contextmenu', context);\n target.addEventListener('click', click, true);\n return {\n /** @param next - Recognition configuration; a live gesture keeps its original thresholds. */\n update(next) {\n if (destroyed) return;\n props = next;\n if (props.disabled) { session.cancel('disabled'); listen(false); }\n },\n /** Drops a gesture whose host document target is no longer valid. */\n cancel() { session.cancel('cancel'); listen(false); },\n /** Releases listeners, timeouts, frames and the class owned by this binding. */\n destroy() {\n if (destroyed) return;\n destroyed = true;\n session.cancel('destroy');\n listen(false);\n target.removeEventListener('pointerdown', down);\n target.removeEventListener('contextmenu', context);\n target.removeEventListener('click', click, true);\n if (!hadClass) target.classList.remove('qk-selection-gesture');\n }\n };\n}\n","import type { QuireTableSize, TableGridKey } from \"./types\";\n\n/** Fixed quick-grid dimensions matching the admitted desktop interaction. */\nexport const tableQuickGridSize: QuireTableSize = Object.freeze({\n rowCount: 8,\n columnCount: 10\n});\n\n/**\n * Reports whether one grid cell belongs to the active rectangular selection.\n *\n * @param cell - One-based cell coordinates.\n * @param active - One-based active rectangle endpoint.\n * @returns Whether the cell is inside the highlighted rectangle.\n */\nexport function isTableGridCellHighlighted(\n cell: QuireTableSize,\n active: QuireTableSize\n): boolean {\n return cell.rowCount <= active.rowCount\n && cell.columnCount <= active.columnCount;\n}\n\n/**\n * Moves one quick-grid tuple while preserving the admitted grid bounds.\n *\n * @param selection - Current one-based selection tuple.\n * @param key - Navigation key to interpret.\n * @param accelerated - Whether Home or End jumps across both axes.\n * @returns New clamped selection tuple.\n */\nexport function moveTableGridSelection(\n selection: QuireTableSize,\n key: TableGridKey,\n accelerated = false\n): QuireTableSize {\n const current = clampTableGridSelection(selection);\n if (accelerated && key === \"Home\") return { rowCount: 1, columnCount: 1 };\n if (accelerated && key === \"End\") return tableQuickGridSize;\n\n switch (key) {\n case \"ArrowDown\":\n return clampTableGridSelection({\n ...current,\n rowCount: current.rowCount + 1\n });\n case \"ArrowLeft\":\n return clampTableGridSelection({\n ...current,\n columnCount: current.columnCount - 1\n });\n case \"ArrowRight\":\n return clampTableGridSelection({\n ...current,\n columnCount: current.columnCount + 1\n });\n case \"ArrowUp\":\n return clampTableGridSelection({\n ...current,\n rowCount: current.rowCount - 1\n });\n case \"End\":\n return { ...current, columnCount: tableQuickGridSize.columnCount };\n case \"Home\":\n return { ...current, columnCount: 1 };\n }\n}\n\n/**\n * Normalizes one pair of custom-size input drafts.\n *\n * @param rowCount - Draft row count.\n * @param columnCount - Draft column count.\n * @param maximum - Largest accepted dimension.\n * @returns Complete validated tuple, or null when either draft is invalid.\n */\nexport function normalizeTableSize(\n rowCount: number | null,\n columnCount: number | null,\n maximum = 63\n): QuireTableSize | null {\n return isDimension(rowCount, maximum)\n && isDimension(columnCount, maximum)\n ? { rowCount, columnCount }\n : null;\n}\n\n/**\n * Clamps arbitrary numeric coordinates to the fixed quick-grid rectangle.\n *\n * @param selection - Candidate row/column tuple.\n * @returns Tuple inside the one-based quick-grid bounds.\n */\nfunction clampTableGridSelection(\n selection: QuireTableSize\n): QuireTableSize {\n return {\n rowCount: Math.min(\n Math.max(1, selection.rowCount),\n tableQuickGridSize.rowCount\n ),\n columnCount: Math.min(\n Math.max(1, selection.columnCount),\n tableQuickGridSize.columnCount\n )\n };\n}\n\n/** @param value - Draft dimension. @param maximum - Inclusive bound. @returns Whether the draft is admissible. */\nfunction isDimension(value: number | null, maximum: number): value is number {\n return value !== null && Number.isInteger(value) && value >= 1 && value <= maximum;\n}\n"],"mappings":";;;;;AAiBA,MAAa,0BAA2D,OAAO,OAAO;CACpF,OAAO,OAAO,OAAO;EACnB,SAAS,qBAAqB;EAC9B,MAAM,kBAAkB;EACxB,MAAM,kBAAkB;EACxB,QAAQ,oBAAoB;EAC5B,QAAQ,oBAAoB;EAC5B,MAAM,sBAAsB,MAAM;EAClC,SAAS,sBAAsB,SAAS;EACxC,SAAS,sBAAsB,SAAS;EACxC,QAAQ,sBAAsB,QAAQ;EACtC,WAAW,OAAO,OAAO;GACvB,UAAU,UAAU,sBAAsB,MAAM,UAAU,QAAQ;GAClE,QAAQ,UAAU,sBAAsB,MAAM,UAAU,MAAM;GAC9D,YAAY,UAAU,sBAAsB,MAAM,UAAU,UAAU;EACxE,CAAC;CACH,CAAC;CACD,YAAY,wBAAwB;CACpC,SAAS,kBAAkB,sBAAsB,OAAO;CACxD,QAAQ,kBAAkB,sBAAsB,MAAM;CACtD,aAAa,kBAAkB,sBAAsB,WAAW;CAChE,WAAW,kBAAkB,sBAAsB,SAAS;CAC5D,QAAQ,kBAAkB,sBAAsB,MAAM;CACtD,SAAS,kBAAkB,sBAAsB,OAAO;CACxD,OAAO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AU,QAAQ,WAAW;EAC/B,CAAC;EACH,KAAK,aACH,OAAO,wBAAwB;GAC7B,GAAG;GACH,aAAa,QAAQ,cAAc;EACrC,CAAC;EACH,KAAK,cACH,OAAO,wBAAwB;GAC7B,GAAG;GACH,aAAa,QAAQ,cAAc;EACrC,CAAC;EACH,KAAK,WACH,OAAO,wBAAwB;GAC7B,GAAG;GACH,UAAU,QAAQ,WAAW;EAC/B,CAAC;EACH,KAAK,OACH,OAAO;GAAE,GAAG;GAAS,aAAa,mBAAmB;EAAY;EACnE,KAAK,QACH,OAAO;GAAE,GAAG;GAAS,aAAa;EAAE;CACxC;AACF;;;;;;;;;AAUA,SAAgB,mBACd,UACA,aACA,UAAU,IACa;CACvB,OAAO,YAAY,UAAU,OAAO,KAC/B,YAAY,aAAa,OAAO,IACjC;EAAE;EAAU;CAAY,IACxB;AACN;;;;;;;AAQA,SAAS,wBACP,WACgB;CAChB,OAAO;EACL,UAAU,KAAK,IACb,KAAK,IAAI,GAAG,UAAU,QAAQ,GAC9B,mBAAmB,QACrB;EACA,aAAa,KAAK,IAChB,KAAK,IAAI,GAAG,UAAU,WAAW,GACjC,mBAAmB,WACrB;CACF;AACF;;AAGA,SAAS,YAAY,OAAsB,SAAkC;CAC3E,OAAO,UAAU,QAAQ,OAAO,UAAU,KAAK,KAAK,SAAS,KAAK,SAAS;AAC7E"}
@@ -1,4 +1,4 @@
1
- import { A as quireContrastRatio, P as createThemeCssVariables, k as parseQuireHexColor } from "./catalog-AqWLE58Z.mjs";
1
+ import { A as quireContrastRatio, P as createThemeCssVariables, k as parseQuireHexColor } from "./catalog-TxH_u9wJ.mjs";
2
2
  //#region src/components/toggle-group/create.ts
3
3
  /**
4
4
  * Derives group layout from existing semantic roles; child controls keep their own sizes.
@@ -1528,4 +1528,4 @@ function resolveQuireKitFileIdentity(file) {
1528
1528
  //#endregion
1529
1529
  export { createBadgeTokens as A, createToggleGroupTokens as B, buttonCssVariableNames as C, createTableCssVariables as D, trackQuireKitInputModality as E, createKbdCssVariables as F, createKbdTokens as I, createCheckboxGroupCssVariables as L, createTagTokens as M, createSkeletonCssVariables as N, createTableTokens as O, createSkeletonTokens as P, createCheckboxGroupTokens as R, createButtonCssVariables as S, quireKitControlSizes as T, createPopoverTokens as _, createTooltipTokens as a, menuCssVariableNames as b, resolveTooltipContent as c, createToolbarTokens as d, createSegmentedCssVariables as f, popoverCssVariableNames as g, createPopoverCssVariables as h, tooltipCssVariableNames as i, createTagCssVariables as j, createBadgeCssVariables as k, createToolbarCssVariables as l, createSegmentedTokens as m, createUiThemeCssVariables as n, defaultTooltipCloseDelay as o, segmentedCssVariableNames as p, createTooltipCssVariables as r, defaultTooltipOpenDelay as s, resolveQuireKitFileIdentity as t, toolbarCssVariableNames as u, menuVariableReferences as v, createButtonTokens as w, createMenuTokens as x, createMenuCssVariables as y, createToggleGroupCssVariables as z };
1530
1530
 
1531
- //# sourceMappingURL=resolve-BwTfY4PS.mjs.map
1531
+ //# sourceMappingURL=resolve-DlCNcx0Q.mjs.map