@plexui/vue 0.9.0 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/es/components/Alert/Alert.js +6 -2
- package/dist/es/components/Alert/Alert.js.map +1 -1
- package/dist/es/components/Avatar/Avatar.js +3 -1
- package/dist/es/components/Avatar/Avatar.js.map +1 -1
- package/dist/es/components/ButtonGroup/ButtonGroup.js +7 -0
- package/dist/es/components/ButtonGroup/ButtonGroup.js.map +1 -1
- package/dist/es/components/ButtonGroup/index.js.map +1 -1
- package/dist/es/components/Checkbox/Checkbox.js +5 -6
- package/dist/es/components/Checkbox/Checkbox.js.map +1 -1
- package/dist/es/components/ColorPicker/ColorPicker.js +476 -0
- package/dist/es/components/ColorPicker/ColorPicker.js.map +1 -0
- package/dist/es/components/ColorPicker/ColorWell.js +186 -0
- package/dist/es/components/ColorPicker/ColorWell.js.map +1 -0
- package/dist/es/components/ColorPicker/index.js +3 -0
- package/dist/es/components/ColorPicker/index.js.map +1 -0
- package/dist/es/components/ColorPicker/shared.js +132 -0
- package/dist/es/components/ColorPicker/shared.js.map +1 -0
- package/dist/es/components/ContextMenu/ContextMenu.js +223 -0
- package/dist/es/components/ContextMenu/ContextMenu.js.map +1 -0
- package/dist/es/components/ContextMenu/index.js +2 -0
- package/dist/es/components/ContextMenu/index.js.map +1 -0
- package/dist/es/components/ContextMenu/shared.js +58 -0
- package/dist/es/components/ContextMenu/shared.js.map +1 -0
- package/dist/es/components/DatePicker/DatePicker.js +19 -3
- package/dist/es/components/DatePicker/DatePicker.js.map +1 -1
- package/dist/es/components/DateRangePicker/DateRangePicker.js +1 -1
- package/dist/es/components/DateRangePicker/DateRangePicker.js.map +1 -1
- package/dist/es/components/Dialog/Dialog.js +245 -25
- package/dist/es/components/Dialog/Dialog.js.map +1 -1
- package/dist/es/components/Dialog/dialogSteps.js +85 -0
- package/dist/es/components/Dialog/dialogSteps.js.map +1 -0
- package/dist/es/components/Dialog/dialogViewport.js +74 -0
- package/dist/es/components/Dialog/dialogViewport.js.map +1 -0
- package/dist/es/components/Dialog/index.js +1 -1
- package/dist/es/components/Dialog/index.js.map +1 -1
- package/dist/es/components/Dialog/sheetDrag.js +2 -1
- package/dist/es/components/Dialog/sheetDrag.js.map +1 -1
- package/dist/es/components/Field/Field.js +11 -3
- package/dist/es/components/Field/Field.js.map +1 -1
- package/dist/es/components/FieldGroup/FieldGroup.js +12 -1
- package/dist/es/components/FieldGroup/FieldGroup.js.map +1 -1
- package/dist/es/components/FloatingLabelInput/FloatingLabelInput.js +2 -2
- package/dist/es/components/FloatingLabelInput/FloatingLabelInput.js.map +1 -1
- package/dist/es/components/Icon/index.js +1 -0
- package/dist/es/components/Icon/index.js.map +1 -1
- package/dist/es/components/Icon/svg/Eyedropper.js +10 -0
- package/dist/es/components/Icon/svg/Eyedropper.js.map +1 -0
- package/dist/es/components/IndexBar/IndexBar.js +215 -0
- package/dist/es/components/IndexBar/IndexBar.js.map +1 -0
- package/dist/es/components/IndexBar/index.js +2 -0
- package/dist/es/components/IndexBar/index.js.map +1 -0
- package/dist/es/components/Indicator/LoadingIndicator.js +1 -1
- package/dist/es/components/Indicator/LoadingIndicator.js.map +1 -1
- package/dist/es/components/Input/Input.js +3 -2
- package/dist/es/components/Input/Input.js.map +1 -1
- package/dist/es/components/MarkdownEditor/MarkdownEditor.js +149 -1
- package/dist/es/components/MarkdownEditor/MarkdownEditor.js.map +1 -1
- package/dist/es/components/Menu/Menu.js +206 -33
- package/dist/es/components/Menu/Menu.js.map +1 -1
- package/dist/es/components/Menu/index.js +1 -1
- package/dist/es/components/Menu/index.js.map +1 -1
- package/dist/es/components/Page/Page.js +43 -11
- package/dist/es/components/Page/Page.js.map +1 -1
- package/dist/es/components/PageControl/PageControl.js +210 -0
- package/dist/es/components/PageControl/PageControl.js.map +1 -0
- package/dist/es/components/PageControl/index.js +2 -0
- package/dist/es/components/PageControl/index.js.map +1 -0
- package/dist/es/components/PhoneLayout/PhoneLayout.js +50 -0
- package/dist/es/components/PhoneLayout/PhoneLayout.js.map +1 -0
- package/dist/es/components/PhoneLayout/index.js +2 -0
- package/dist/es/components/PhoneLayout/index.js.map +1 -0
- package/dist/es/components/Popover/Popover.js +5 -1
- package/dist/es/components/Popover/Popover.js.map +1 -1
- package/dist/es/components/Popover/deferredPointerDownOutside.js +59 -4
- package/dist/es/components/Popover/deferredPointerDownOutside.js.map +1 -1
- package/dist/es/components/Select/Select.js +18 -11
- package/dist/es/components/Select/Select.js.map +1 -1
- package/dist/es/components/SelectControl/SelectControl.js +1 -0
- package/dist/es/components/SelectControl/SelectControl.js.map +1 -1
- package/dist/es/components/Sidebar/Sidebar.js +21 -6
- package/dist/es/components/Sidebar/Sidebar.js.map +1 -1
- package/dist/es/components/Slider/Slider.js +44 -9
- package/dist/es/components/Slider/Slider.js.map +1 -1
- package/dist/es/components/Stepper/Stepper.js +195 -0
- package/dist/es/components/Stepper/Stepper.js.map +1 -0
- package/dist/es/components/Stepper/index.js +2 -0
- package/dist/es/components/Stepper/index.js.map +1 -0
- package/dist/es/components/SwipeActions/SwipeActions.js +374 -0
- package/dist/es/components/SwipeActions/SwipeActions.js.map +1 -0
- package/dist/es/components/SwipeActions/index.js +2 -0
- package/dist/es/components/SwipeActions/index.js.map +1 -0
- package/dist/es/components/Switch/Switch.js +3 -1
- package/dist/es/components/Switch/Switch.js.map +1 -1
- package/dist/es/components/TabBar/TabBar.js +205 -0
- package/dist/es/components/TabBar/TabBar.js.map +1 -0
- package/dist/es/components/TabBar/index.js +2 -0
- package/dist/es/components/TabBar/index.js.map +1 -0
- package/dist/es/components/Tabs/Tabs.js +10 -2
- package/dist/es/components/Tabs/Tabs.js.map +1 -1
- package/dist/es/components/TagInput/TagInput.js +3 -46
- package/dist/es/components/TagInput/TagInput.js.map +1 -1
- package/dist/es/components/Textarea/Textarea.js +2 -0
- package/dist/es/components/Textarea/Textarea.js.map +1 -1
- package/dist/es/components/Tip/Tip.js +276 -0
- package/dist/es/components/Tip/Tip.js.map +1 -0
- package/dist/es/components/Tip/index.js +2 -0
- package/dist/es/components/Tip/index.js.map +1 -0
- package/dist/es/components/Toast/ToastRenderer.js +30 -13
- package/dist/es/components/Toast/ToastRenderer.js.map +1 -1
- package/dist/es/components/Toast/Toaster.js +17 -6
- package/dist/es/components/Toast/Toaster.js.map +1 -1
- package/dist/es/components/Toast/toastLifecycle.js +113 -1
- package/dist/es/components/Toast/toastLifecycle.js.map +1 -1
- package/dist/es/components/Toolbar/Toolbar.js +37 -6
- package/dist/es/components/Toolbar/Toolbar.js.map +1 -1
- package/dist/es/components/Toolbar/index.js.map +1 -1
- package/dist/es/components/Tooltip/slot.js +3 -3
- package/dist/es/components/Tooltip/slot.js.map +1 -1
- package/dist/es/composables/useEscCloseStack.js +8 -4
- package/dist/es/composables/useEscCloseStack.js.map +1 -1
- package/dist/es/lib/fieldRow.js +15 -2
- package/dist/es/lib/fieldRow.js.map +1 -1
- package/dist/es/lib/floatingBoundary.js +3 -1
- package/dist/es/lib/floatingBoundary.js.map +1 -1
- package/dist/es/lib/helpers.js +21 -0
- package/dist/es/lib/helpers.js.map +1 -1
- package/dist/es/lib/menuSubmenuPlacement.js +51 -6
- package/dist/es/lib/menuSubmenuPlacement.js.map +1 -1
- package/dist/es/lib/menuTriggerCover.js +70 -0
- package/dist/es/lib/menuTriggerCover.js.map +1 -0
- package/dist/es/lib/phoneLayout.js +16 -0
- package/dist/es/lib/phoneLayout.js.map +1 -0
- package/dist/es/lib/scrollEdges.js +34 -0
- package/dist/es/lib/scrollEdges.js.map +1 -0
- package/dist/es/lib/toastRegion.js +6 -0
- package/dist/es/lib/toastRegion.js.map +1 -0
- package/dist/types/components/ButtonGroup/ButtonGroup.d.ts +13 -0
- package/dist/types/components/ButtonGroup/index.d.ts +1 -1
- package/dist/types/components/ColorPicker/ColorPicker.d.ts +244 -0
- package/dist/types/components/ColorPicker/ColorWell.d.ts +334 -0
- package/dist/types/components/ColorPicker/index.d.ts +3 -0
- package/dist/types/components/ColorPicker/shared.d.ts +69 -0
- package/dist/types/components/ContextMenu/ContextMenu.d.ts +128 -0
- package/dist/types/components/ContextMenu/index.d.ts +1 -0
- package/dist/types/components/ContextMenu/shared.d.ts +51 -0
- package/dist/types/components/DatePicker/DatePicker.d.ts +24 -4
- package/dist/types/components/DateRangePicker/DateRangePicker.d.ts +4 -4
- package/dist/types/components/Dialog/Dialog.d.ts +100 -4
- package/dist/types/components/Dialog/dialogSteps.d.ts +10 -0
- package/dist/types/components/Dialog/dialogViewport.d.ts +1 -0
- package/dist/types/components/Dialog/index.d.ts +1 -1
- package/dist/types/components/Field/Field.d.ts +21 -2
- package/dist/types/components/FieldGroup/FieldGroup.d.ts +18 -1
- package/dist/types/components/Icon/index.d.ts +1 -0
- package/dist/types/components/Icon/svg/Eyedropper.d.ts +3 -0
- package/dist/types/components/IndexBar/IndexBar.d.ts +112 -0
- package/dist/types/components/IndexBar/index.d.ts +1 -0
- package/dist/types/components/Indicator/LoadingIndicator.d.ts +2 -2
- package/dist/types/components/Menu/Menu.d.ts +153 -40
- package/dist/types/components/Menu/index.d.ts +1 -1
- package/dist/types/components/Page/Page.d.ts +13 -5
- package/dist/types/components/PageControl/PageControl.d.ts +216 -0
- package/dist/types/components/PageControl/index.d.ts +1 -0
- package/dist/types/components/PhoneLayout/PhoneLayout.d.ts +21 -0
- package/dist/types/components/PhoneLayout/index.d.ts +1 -0
- package/dist/types/components/Popover/deferredPointerDownOutside.d.ts +1 -1
- package/dist/types/components/Select/Select.d.ts +6 -6
- package/dist/types/components/Stepper/Stepper.d.ts +338 -0
- package/dist/types/components/Stepper/index.d.ts +1 -0
- package/dist/types/components/SwipeActions/SwipeActions.d.ts +135 -0
- package/dist/types/components/SwipeActions/index.d.ts +1 -0
- package/dist/types/components/TabBar/TabBar.d.ts +405 -0
- package/dist/types/components/TabBar/index.d.ts +1 -0
- package/dist/types/components/Tip/Tip.d.ts +146 -0
- package/dist/types/components/Tip/index.d.ts +1 -0
- package/dist/types/components/Toast/toastLifecycle.d.ts +34 -0
- package/dist/types/components/Toolbar/Toolbar.d.ts +26 -9
- package/dist/types/components/Toolbar/index.d.ts +1 -1
- package/dist/types/components/Tooltip/CopyTooltip.d.ts +1 -1
- package/dist/types/composables/useEscCloseStack.d.ts +2 -2
- package/dist/types/lib/fieldRow.d.ts +5 -0
- package/dist/types/lib/helpers.d.ts +6 -0
- package/dist/types/lib/menuSubmenuPlacement.d.ts +14 -1
- package/dist/types/lib/menuTriggerCover.d.ts +23 -0
- package/dist/types/lib/phoneLayout.d.ts +11 -0
- package/dist/types/lib/scrollEdges.d.ts +16 -0
- package/dist/types/lib/toastRegion.d.ts +5 -0
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toastLifecycle.js","sourceRoot":"","sources":["../../../../src/components/Toast/toastLifecycle.ts"],"names":[],"mappings":"AASA,MAAM,aAAa,GAAG,GAAG,CAAA;AAEzB,MAAM,OAAO,cAAc;IAgBL;IAAgD;IAfpE,OAAO,GAAoB,EAAE,CAAA;IAC7B,MAAM,GAAgB,EAAE,QAAQ,EAAE,YAAY,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG,EAAE,EAAE,EAAE,aAAa,EAAE,CAAC,EAAE,CAAA;IACnF,SAAS,GAAG,IAAI,GAAG,EAAc,CAAA;IACjC,QAAQ,GAAG,CAAC,CAAA;IACZ,GAAG,GAAoB,IAAI,CAAA;IAC3B,MAAM,GAAG,KAAK,CAAA;IACd,OAAO,GAAG,KAAK,CAAA;IACf,OAAO,GAAG,KAAK,CAAA;IACf,OAAO,CAAU;IACjB,aAAa,GAAuB,IAAI,CAAA;IACxC,KAAK,GAAG,IAAI,GAAG,EAAwB,CAAA;IACvC,KAAK,GAAG,IAAI,GAAG,EAAyB,CAAA;IACxC,UAAU,GAAG,IAAI,GAAG,EAAc,CAAA;IAClC,eAAe,GAAG,EAAE,CAAA;IAE5B,YAAoB,YAAsC,EAAU,MAAsD;QAA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,CAAC,CAAC,CAAC,KAAK,IAAI,QAAQ,CAAA;YACpF,KAAK,CAAC,GAAG,MAAM,IAAI,IAAI,EAAE,CAAC,GAAG,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,GAAG,IAAI,IAAI,CAAC,CAAC,CAAC,IAAI,CAAA;QAC5E,CAAC;IACH,CAAC;IACD,OAAO,KAAK,CAAA;AACd,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,GAAyB,EAAE,EAAE;IAC7D,MAAM,SAAS,GAAG,GAAG,EAAE,eAAe,CAAC,YAAY,CAAC,KAAK,CAAC,CAAA;IAC1D,IAAI,SAAS,KAAK,KAAK,IAAI,SAAS,KAAK,KAAK;QAAE,OAAO,SAAS,CAAA;IAChE,OAAO,GAAG,EAAE,WAAW,EAAE,gBAAgB,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC,SAAS,KAAK,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAA;AACpG,CAAC,CAAA","sourcesContent":["/** Framework-independent lifecycle, mirrored in the Vue/React packages so neither\n * published port depends on the other framework. Vendor stores remain public. */\nexport type ToastId = string | number\nexport type Position = \"top-left\" | \"top-center\" | \"top-right\" | \"bottom-left\" | \"bottom-center\" | \"bottom-right\"\nexport type Direction = \"top\" | \"bottom\" | \"left\" | \"right\"\ntype ToastData = { id: ToastId; toasterId?: string; position?: Position; duration?: number; type?: string; dismissible?: boolean }\nexport type ToastConfig = { id?: string; position: Position; duration: number; gap: number; visibleToasts: number; expand?: boolean; swipeDirections?: Direction[] }\nexport type ToastEntry<T> = { toast: T; removed: boolean; detached?: boolean; mounted: boolean; height: number; x: number; y: number; swiping: boolean; swipeOut?: \"up\" | \"down\" | \"left\" | \"right\"; remaining: number; started?: number; timer?: ReturnType<typeof setTimeout>; exitTimer?: ReturnType<typeof setTimeout>; mountTimer?: ReturnType<typeof setTimeout>; exitOffset: number }\ntype Gesture = { id: ToastId; pointerId: number; x: number; y: number; started: number; axis?: \"x\" | \"y\" }\nconst EXIT_DURATION = 200\n\nexport class ToastLifecycle<T extends ToastData> {\n entries: ToastEntry<T>[] = []\n config: ToastConfig = { position: \"top-center\", duration: 3000, gap: 14, visibleToasts: 3 }\n private listeners = new Set<() => void>()\n private revision = 0\n private doc: Document | null = null\n private hidden = false\n private hovered = false\n private focused = false\n private gesture?: Gesture\n private previousFocus: HTMLElement | null = null\n private nodes = new Map<ToastId, HTMLElement>()\n private lists = new Map<Position, HTMLElement>()\n private suppressed = new Map<ToastId, T>()\n private lastPointerType = \"\"\n\n constructor(private dismissStore: (id: ToastId) => unknown, private notify: (reason: \"dismiss\" | \"auto\", toast: T) => void) {}\n subscribe = (listener: () => void) => { this.listeners.add(listener); return () => { this.listeners.delete(listener) } }\n snapshot = () => this.revision\n private emit() { this.revision++; this.listeners.forEach((listener) => listener()) }\n get expanded() { return this.hovered || this.focused }\n get paused() { return this.expanded || Boolean(this.gesture) || this.hidden }\n connect(doc: Document) { this.doc = doc; this.hidden = doc.hidden; doc.addEventListener(\"visibilitychange\", this.visibility); this.refreshTimers() }\n private visibility = () => { this.hidden = Boolean(this.doc?.hidden); this.refreshTimers(); this.emit() }\n disconnect() {\n this.doc?.removeEventListener(\"visibilitychange\", this.visibility)\n for (const entry of this.entries) { clearTimeout(entry.timer); clearTimeout(entry.exitTimer); clearTimeout(entry.mountTimer); entry.timer = undefined; entry.started = undefined }\n this.doc = null\n this.gesture = undefined\n this.hovered = false\n this.focused = false\n this.previousFocus = null\n }\n sync(toasts: T[], config: ToastConfig) {\n const oldDuration = this.config.duration\n this.config = config\n const incoming = toasts.filter((toast) => config.id ? toast.toasterId === config.id : !toast.toasterId)\n const present = new Set(incoming.map((toast) => toast.id))\n for (const entry of this.entries) if (!present.has(entry.toast.id) && !entry.removed) this.close(entry.toast.id, toasts.some((toast) => toast.id === entry.toast.id) ? \"detach\" : \"external\")\n const ordered: ToastEntry<T>[] = []\n for (const toast of incoming) {\n if (this.suppressed.get(toast.id) === toast) continue\n let entry = this.entries.find((item) => item.toast.id === toast.id)\n if (!entry) {\n entry = { toast, removed: false, mounted: false, height: 0, x: 0, y: 0, swiping: false, remaining: toast.duration || config.duration, exitOffset: 0 }\n const mountedEntry = entry\n entry.mountTimer = setTimeout(() => { mountedEntry.mounted = true; this.emit() }, 0)\n } else if (entry.toast !== toast || entry.detached) {\n const restart = entry.removed || entry.toast.type !== toast.type || entry.toast.duration !== toast.duration\n entry.toast = toast\n entry.detached = false\n // Same-id updates restart the current budget; only an actual pause\n // subtracts elapsed time (the public Sonner store/update contract).\n clearTimeout(entry.timer); entry.timer = undefined; entry.started = undefined\n if (restart) {\n clearTimeout(entry.exitTimer); this.pause(entry); entry.removed = false; entry.swipeOut = undefined\n entry.remaining = toast.duration || config.duration\n }\n }\n if (this.gesture?.id === toast.id && (toast.type === \"loading\" || toast.dismissible === false)) { this.gesture = undefined; entry.swiping = false; entry.x = 0; entry.y = 0 }\n if (oldDuration !== config.duration && !toast.duration) { this.pause(entry); entry.remaining = config.duration }\n ordered.push(entry)\n }\n this.entries = [...ordered, ...this.entries.filter((entry) => entry.removed && !present.has(entry.toast.id))]\n for (const id of this.suppressed.keys()) if (!present.has(id)) this.suppressed.delete(id)\n this.refreshTimers()\n this.emit()\n }\n private pause(entry: ToastEntry<T>) {\n if (entry.started !== undefined) entry.remaining = Math.max(0, entry.remaining - (Date.now() - entry.started))\n clearTimeout(entry.timer); entry.timer = undefined; entry.started = undefined\n }\n private refreshTimers() {\n for (const entry of this.entries) {\n if (entry.removed || this.paused || entry.toast.type === \"loading\" || entry.remaining === Infinity) { this.pause(entry); continue }\n if (entry.timer !== undefined) continue\n entry.started = Date.now()\n entry.timer = setTimeout(() => this.close(entry.toast.id, \"auto\"), Math.max(0, entry.remaining))\n }\n }\n position(entry: ToastEntry<T>) { return entry.toast.position ?? this.config.position }\n at(position: Position) { return this.entries.filter((entry) => this.position(entry) === position) }\n offset(entry: ToastEntry<T>) {\n if (entry.removed) return entry.exitOffset\n const siblings = this.at(this.position(entry)).filter((item) => !item.removed)\n return siblings.slice(0, siblings.indexOf(entry)).reduce((sum, item) => sum + item.height + this.config.gap, 0)\n }\n setNode(id: ToastId, node: HTMLElement | null) { if (node) this.nodes.set(id, node); else this.nodes.delete(id) }\n setList(position: Position, node: HTMLElement | null) { if (node) this.lists.set(position, node); else this.lists.delete(position) }\n measure(id: ToastId, height: number) { const entry = this.entries.find((item) => item.toast.id === id); if (entry && entry.height !== height) { entry.height = height; this.emit() } }\n close(id: ToastId, reason: \"dismiss\" | \"auto\" | \"action\" | \"external\" | \"detach\") {\n const entry = this.entries.find((item) => item.toast.id === id)\n if (!entry || entry.removed || reason === \"dismiss\" && (entry.toast.dismissible === false || entry.toast.type === \"loading\")) return\n entry.exitOffset = this.offset(entry)\n entry.removed = true\n entry.detached = reason === \"detach\"\n this.pause(entry)\n if (this.gesture?.id === id) this.gesture = undefined\n entry.swiping = false\n if (reason === \"dismiss\" || reason === \"auto\" || reason === \"external\") this.notify(reason === \"external\" ? \"dismiss\" : reason, entry.toast)\n const node = this.nodes.get(id)\n if (node?.contains(this.doc?.activeElement ?? null)) this.restoreFocus()\n entry.exitTimer = setTimeout(() => {\n if (reason !== \"detach\") this.suppressed.set(id, entry.toast)\n this.entries = this.entries.filter((item) => item !== entry)\n if (reason !== \"external\" && reason !== \"detach\") this.dismissStore(id)\n this.emit()\n }, EXIT_DURATION)\n this.refreshTimers(); this.emit()\n }\n private ownsFocus(target: EventTarget | null) { return target instanceof Node && [...this.lists.values()].some((list) => list.contains(target)) }\n focusIn(event: FocusEvent) {\n if (!this.focused && event.relatedTarget instanceof HTMLElement && !this.ownsFocus(event.relatedTarget)) this.previousFocus = event.relatedTarget\n this.focused = true; this.refreshTimers(); this.emit()\n }\n focusOut(event: FocusEvent) {\n if (this.ownsFocus(event.relatedTarget)) return\n this.focused = false\n // An intentional move to another control owns focus. Never bounce through the opener.\n if (event.relatedTarget instanceof HTMLElement) this.previousFocus = null\n this.refreshTimers(); this.emit()\n }\n private restoreFocus() {\n const previous = this.previousFocus\n this.previousFocus = null; this.focused = false\n if (previous?.isConnected) previous.focus({ preventScroll: true })\n }\n keyDown(event: KeyboardEvent, hotkey: string[]) {\n if (hotkey.length && hotkey.every((key) => key === event.code || (key === \"altKey\" && event.altKey) || (key === \"ctrlKey\" && event.ctrlKey) || (key === \"metaKey\" && event.metaKey) || (key === \"shiftKey\" && event.shiftKey))) {\n const list = this.lists.values().next().value\n if (list) { event.preventDefault(); list.focus({ preventScroll: true }) }\n } else if (event.key === \"Escape\" && this.ownsFocus(this.doc?.activeElement ?? null)) {\n this.hovered = false; this.restoreFocus(); this.refreshTimers(); this.emit()\n }\n }\n pointerEnter(event: PointerEvent) { this.lastPointerType = event.pointerType; this.hover(event.pointerType !== \"touch\") }\n hover(value: boolean) {\n if (value && (this.lastPointerType === \"touch\" || this.doc?.documentElement.dataset.input === \"touch\" || this.doc?.defaultView?.matchMedia?.(\"(hover: none) and (pointer: coarse)\").matches)) return\n this.hovered = value; this.refreshTimers(); this.emit()\n }\n pointerDown(id: ToastId, event: PointerEvent) {\n this.lastPointerType = event.pointerType\n if (event.pointerType === \"touch\" && this.hovered) { this.hovered = false; this.refreshTimers(); this.emit() }\n const entry = this.entries.find((item) => item.toast.id === id)\n if (this.gesture || !entry || entry.removed || event.button !== 0 || entry.toast.type === \"loading\" || entry.toast.dismissible === false) return\n if (event.target instanceof Element && event.target.closest(\"button, a, input, textarea, select, [contenteditable='true']\")) return\n this.gesture = { id, pointerId: event.pointerId, x: event.clientX, y: event.clientY, started: Date.now() }\n entry.swiping = true\n this.nodes.get(id)?.setPointerCapture?.(event.pointerId)\n this.refreshTimers(); this.emit()\n }\n pointerMove(id: ToastId, event: PointerEvent) {\n const gesture = this.gesture\n const entry = this.entries.find((item) => item.toast.id === id)\n if (!gesture || gesture.id !== id || gesture.pointerId !== event.pointerId || !entry) return\n if (this.doc?.getSelection()?.toString()) return\n const dx = event.clientX - gesture.x, dy = event.clientY - gesture.y\n if (!gesture.axis && Math.max(Math.abs(dx), Math.abs(dy)) > 1) gesture.axis = Math.abs(dx) > Math.abs(dy) ? \"x\" : \"y\"\n const [vertical, horizontal] = this.position(entry).split(\"-\")\n const allowed = this.config.swipeDirections ?? [vertical, horizontal]\n entry.x = gesture.axis === \"x\" && allowed.includes(dx > 0 ? \"right\" : \"left\") ? dx : 0\n entry.y = gesture.axis === \"y\" && allowed.includes(dy > 0 ? \"bottom\" : \"top\") ? dy : 0\n this.emit()\n }\n pointerEnd(id: ToastId, event: PointerEvent, cancelled = false) {\n const gesture = this.gesture\n const entry = this.entries.find((item) => item.toast.id === id)\n if (!gesture || gesture.id !== id || gesture.pointerId !== event.pointerId || !entry) return\n const distance = Math.max(Math.abs(entry.x), Math.abs(entry.y))\n this.gesture = undefined; entry.swiping = false\n if (!cancelled && (distance >= 45 || distance > 3 && distance / Math.max(1, Date.now() - gesture.started) > 0.11)) {\n entry.swipeOut = entry.x ? entry.x > 0 ? \"right\" : \"left\" : entry.y > 0 ? \"down\" : \"up\"\n this.close(id, \"dismiss\")\n } else { entry.x = 0; entry.y = 0 }\n this.refreshTimers(); this.emit()\n }\n}\n\nexport type Offset = number | string | Partial<Record<\"top\" | \"right\" | \"bottom\" | \"left\", number | string>>\nexport const offsetStyles = (offset: Offset | undefined, mobileOffset: Offset | undefined) => {\n const style: Record<string, string> = {}\n for (const [prefix, value, fallback] of [[\"--offset\", offset, \"32px\"], [\"--mobile-offset\", mobileOffset, \"16px\"]] as const) {\n for (const edge of [\"top\", \"right\", \"bottom\", \"left\"] as const) {\n const size = typeof value === \"object\" ? value[edge] ?? fallback : value ?? fallback\n style[`${prefix}-${edge}`] = typeof size === \"number\" ? `${size}px` : size\n }\n }\n return style\n}\n\nexport const documentDirection = (doc: Document | undefined) => {\n const direction = doc?.documentElement.getAttribute(\"dir\")\n if (direction === \"ltr\" || direction === \"rtl\") return direction\n return doc?.defaultView?.getComputedStyle(doc.documentElement).direction === \"rtl\" ? \"rtl\" : \"ltr\"\n}\n"]}
|
|
1
|
+
{"version":3,"file":"toastLifecycle.js","sourceRoot":"","sources":["../../../../src/components/Toast/toastLifecycle.ts"],"names":[],"mappings":"AASA,MAAM,aAAa,GAAG,GAAG,CAAA;AACzB,qFAAqF;AACrF,MAAM,iBAAiB,GAAG,IAAI,CAAA;AAE9B,MAAM,OAAO,cAAc;IAwBL;IAAgD;IAvBpE,OAAO,GAAoB,EAAE,CAAA;IAC7B,MAAM,GAAgB,EAAE,QAAQ,EAAE,YAAY,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG,EAAE,EAAE,EAAE,aAAa,EAAE,CAAC,EAAE,CAAA;IACnF,SAAS,GAAG,IAAI,GAAG,EAAc,CAAA;IACjC,QAAQ,GAAG,CAAC,CAAA;IACZ,GAAG,GAAoB,IAAI,CAAA;IAC3B,MAAM,GAAG,KAAK,CAAA;IACd,OAAO,GAAG,KAAK,CAAA;IACf,OAAO,GAAG,KAAK,CAAA;IACf,OAAO,CAAU;IACjB,aAAa,GAAuB,IAAI,CAAA;IACxC,KAAK,GAAG,IAAI,GAAG,EAAwB,CAAA;IACvC,KAAK,GAAG,IAAI,GAAG,EAAyB,CAAA;IACxC,UAAU,GAAG,IAAI,GAAG,EAAc,CAAA;IAClC,eAAe,GAAG,EAAE,CAAA;IACpB,MAAM,GAAuB,IAAI,CAAA;IACjC,UAAU,GAAkE,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,CAAA;IAC7G,SAAS,GAAG,IAAI,GAAG,EAAmB,CAAA;IAC9C,qGAAqG;IAC7F,SAAS,GAAG,IAAI,GAAG,EAAW,CAAA;IAC9B,cAAc,GAAG,IAAI,GAAG,EAAiC,CAAA;IACzD,OAAO,GAAG,IAAI,GAAG,EAAiD,CAAA;IAClE,UAAU,CAAgC;IAElD,YAAoB,YAAsC,EAAU,MAAsD;QAAtG,iBAAY,GAAZ,YAAY,CAA0B;QAAU,WAAM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GAAG,IAAI,IAAI,CAAC,CAAC,CAAC,IAAI,CAAA;QAC5E,CAAC;IACH,CAAC;IACD,OAAO,KAAK,CAAA;AACd,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,GAAyB,EAAE,EAAE;IAC7D,MAAM,SAAS,GAAG,GAAG,EAAE,eAAe,CAAC,YAAY,CAAC,KAAK,CAAC,CAAA;IAC1D,IAAI,SAAS,KAAK,KAAK,IAAI,SAAS,KAAK,KAAK;QAAE,OAAO,SAAS,CAAA;IAChE,OAAO,GAAG,EAAE,WAAW,EAAE,gBAAgB,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC,SAAS,KAAK,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAA;AACpG,CAAC,CAAA","sourcesContent":["/** Framework-independent lifecycle, mirrored in the Vue/React packages so neither\n * published port depends on the other framework. Vendor stores remain public. */\nexport type ToastId = string | number\nexport type Position = \"top-left\" | \"top-center\" | \"top-right\" | \"bottom-left\" | \"bottom-center\" | \"bottom-right\"\nexport type Direction = \"top\" | \"bottom\" | \"left\" | \"right\"\ntype ToastData = { id: ToastId; toasterId?: string; position?: Position; duration?: number; type?: string; dismissible?: boolean }\nexport type ToastConfig = { id?: string; position: Position; duration: number; gap: number; visibleToasts: number; expand?: boolean; swipeDirections?: Direction[] }\nexport type ToastEntry<T> = { toast: T; removed: boolean; detached?: boolean; mounted: boolean; height: number; x: number; y: number; swiping: boolean; swipeOut?: \"up\" | \"down\" | \"left\" | \"right\"; remaining: number; started?: number; timer?: ReturnType<typeof setTimeout>; exitTimer?: ReturnType<typeof setTimeout>; mountTimer?: ReturnType<typeof setTimeout>; exitOffset: number }\ntype Gesture = { id: ToastId; pointerId: number; x: number; y: number; started: number; axis?: \"x\" | \"y\" }\nconst EXIT_DURATION = 200\n/** How long an announced line stays in the polite region before it leaves the DOM */\nconst ANNOUNCE_DURATION = 7000\n\nexport class ToastLifecycle<T extends ToastData> {\n entries: ToastEntry<T>[] = []\n config: ToastConfig = { position: \"top-center\", duration: 3000, gap: 14, visibleToasts: 3 }\n private listeners = new Set<() => void>()\n private revision = 0\n private doc: Document | null = null\n private hidden = false\n private hovered = false\n private focused = false\n private gesture?: Gesture\n private previousFocus: HTMLElement | null = null\n private nodes = new Map<ToastId, HTMLElement>()\n private lists = new Map<Position, HTMLElement>()\n private suppressed = new Map<ToastId, T>()\n private lastPointerType = \"\"\n private region: HTMLElement | null = null\n private announcers: { polite: HTMLElement | null; assertive: HTMLElement | null } = { polite: null, assertive: null }\n private announced = new Map<ToastId, string>()\n /** Alerts read by the assertive announcer: shown behind the stack, their own role could not speak */\n private assertive = new Set<ToastId>()\n private announceTimers = new Set<ReturnType<typeof setTimeout>>()\n private pending = new Map<ToastId, { text: string; assertive: boolean }>()\n private flushTimer?: ReturnType<typeof setTimeout>\n\n constructor(private dismissStore: (id: ToastId) => unknown, private notify: (reason: \"dismiss\" | \"auto\", toast: T) => void) {}\n subscribe = (listener: () => void) => { this.listeners.add(listener); return () => { this.listeners.delete(listener) } }\n snapshot = () => this.revision\n private emit() { this.revision++; this.listeners.forEach((listener) => listener()) }\n get expanded() { return this.hovered || this.focused }\n get paused() { return this.expanded || Boolean(this.gesture) || this.hidden }\n connect(doc: Document) {\n this.doc = doc; this.hidden = doc.hidden\n doc.addEventListener(\"visibilitychange\", this.visibility)\n for (const type of ISOLATED_EVENTS) doc.addEventListener(type, this.isolate)\n this.refreshTimers()\n }\n private visibility = () => { this.hidden = Boolean(this.doc?.hidden); this.refreshTimers(); this.emit() }\n /* The region is a layer of its own, above any modal. A modal layer (Radix, Reka) listens on the\n document for focus and presses outside it: it would pull focus back out of a toast and close\n on a press of its close or action. This listener, added when the Toaster mounts and so before a\n Dialog opens, runs after the framework's own (React delegates to its root, Vue binds to the\n element) and stops the ones added after it, only while a modal layer has turned the page's\n pointer events off: then nothing under the toast should hear it. Without a modal, a Popover a\n custom toast opened still hears a press elsewhere in the toast. */\n private isolate = (event: Event) => {\n const region = this.region\n if (!region || this.doc?.body.style.pointerEvents !== \"none\") return\n const related = event.type === \"focusout\" ? (event as FocusEvent).relatedTarget : null\n if (event.target instanceof Node && region.contains(event.target) || related instanceof Node && region.contains(related)) event.stopImmediatePropagation()\n }\n setRegion(node: HTMLElement | null) { this.region = node }\n setAnnouncer(kind: \"polite\" | \"assertive\", node: HTMLElement | null) { this.announcers[kind] = node }\n /** An error that waits to be closed interrupts as an alert; every other toast is read politely. */\n alert(entry: ToastEntry<T>) { return entry.toast.type === \"error\" && (entry.toast.duration || this.config.duration) === Infinity }\n /** Whether a toast's content carries role=\"alert\": an alert, unless it came in behind the stack and the assertive announcer read it. */\n alertRole(entry: ToastEntry<T>, custom: boolean) { return !custom && this.alert(entry) && !this.assertive.has(entry.toast.id) }\n private visible(entry: ToastEntry<T>) { return this.at(this.position(entry)).indexOf(entry) < this.config.visibleToasts }\n /** Reads a toast's words once, and again only when they change (a promise that settles, a custom toast's own state). */\n speak(id: ToastId, node: HTMLElement, custom: boolean) {\n const entry = this.entries.find((item) => item.toast.id === id)\n if (!entry || entry.removed) return\n const text = toastText(node)\n const alert = this.alert(entry) && !custom\n // An alert speaks at once, never also politely: words still waiting to be read politely are read as the alert\n if (alert && this.pending.get(id)?.assertive === false) { this.pending.delete(id); this.announced.delete(id) }\n if (!text || this.announced.get(id) === text) return\n this.announced.set(id, text)\n // A shown alert reads itself by its role; one that came in behind the stack (inert, aria-hidden) cannot\n if (alert && this.visible(entry) && !this.assertive.has(id)) return\n this.pending.set(id, { text, assertive: alert })\n // Its content then drops role=\"alert\", so it does not speak again once the stack brings it forward\n if (alert && !this.assertive.has(id)) { this.assertive.add(id); this.emit() }\n // Toasts shown together are read together, the oldest first, whichever framework renders them first\n if (this.flushTimer === undefined) this.flushTimer = setTimeout(this.flush, 0)\n }\n private flush = () => {\n this.flushTimer = undefined\n const order = this.entries.map((entry) => entry.toast.id).reverse()\n const lines = [...this.pending].sort(([a], [b]) => order.indexOf(a) - order.indexOf(b))\n this.pending.clear()\n for (const [, { text, assertive }] of lines) {\n const node = this.announcers[assertive ? \"assertive\" : \"polite\"]\n if (!node) continue\n const line = node.ownerDocument.createElement(\"div\")\n line.textContent = text\n node.append(line)\n const timer = setTimeout(() => { line.remove(); this.announceTimers.delete(timer) }, ANNOUNCE_DURATION)\n this.announceTimers.add(timer)\n }\n }\n disconnect() {\n this.doc?.removeEventListener(\"visibilitychange\", this.visibility)\n for (const type of ISOLATED_EVENTS) this.doc?.removeEventListener(type, this.isolate)\n for (const timer of this.announceTimers) clearTimeout(timer)\n clearTimeout(this.flushTimer); this.flushTimer = undefined\n this.announceTimers.clear()\n this.announced.clear()\n this.assertive.clear()\n this.pending.clear()\n this.announcers.polite?.replaceChildren()\n this.announcers.assertive?.replaceChildren()\n for (const entry of this.entries) { clearTimeout(entry.timer); clearTimeout(entry.exitTimer); clearTimeout(entry.mountTimer); entry.timer = undefined; entry.started = undefined }\n this.doc = null\n this.gesture = undefined\n this.hovered = false\n this.focused = false\n this.previousFocus = null\n }\n sync(toasts: T[], config: ToastConfig) {\n const oldDuration = this.config.duration\n this.config = config\n const incoming = toasts.filter((toast) => config.id ? toast.toasterId === config.id : !toast.toasterId)\n const present = new Set(incoming.map((toast) => toast.id))\n for (const entry of this.entries) if (!present.has(entry.toast.id) && !entry.removed) this.close(entry.toast.id, toasts.some((toast) => toast.id === entry.toast.id) ? \"detach\" : \"external\")\n const ordered: ToastEntry<T>[] = []\n for (const toast of incoming) {\n if (this.suppressed.get(toast.id) === toast) continue\n let entry = this.entries.find((item) => item.toast.id === toast.id)\n if (!entry) {\n entry = { toast, removed: false, mounted: false, height: 0, x: 0, y: 0, swiping: false, remaining: toast.duration || config.duration, exitOffset: 0 }\n const mountedEntry = entry\n entry.mountTimer = setTimeout(() => { mountedEntry.mounted = true; this.emit() }, 0)\n } else if (entry.toast !== toast || entry.detached) {\n const restart = entry.removed || entry.toast.type !== toast.type || entry.toast.duration !== toast.duration\n entry.toast = toast\n entry.detached = false\n // Same-id updates restart the current budget; only an actual pause\n // subtracts elapsed time (the public Sonner store/update contract).\n clearTimeout(entry.timer); entry.timer = undefined; entry.started = undefined\n if (restart) {\n clearTimeout(entry.exitTimer); this.pause(entry); entry.removed = false; entry.swipeOut = undefined\n entry.remaining = toast.duration || config.duration\n }\n }\n if (this.gesture?.id === toast.id && (toast.type === \"loading\" || toast.dismissible === false)) { this.gesture = undefined; entry.swiping = false; entry.x = 0; entry.y = 0 }\n if (oldDuration !== config.duration && !toast.duration) { this.pause(entry); entry.remaining = config.duration }\n ordered.push(entry)\n }\n this.entries = [...ordered, ...this.entries.filter((entry) => entry.removed && !present.has(entry.toast.id))]\n for (const id of this.suppressed.keys()) if (!present.has(id)) this.suppressed.delete(id)\n this.refreshTimers()\n this.emit()\n }\n private pause(entry: ToastEntry<T>) {\n if (entry.started !== undefined) entry.remaining = Math.max(0, entry.remaining - (Date.now() - entry.started))\n clearTimeout(entry.timer); entry.timer = undefined; entry.started = undefined\n }\n private refreshTimers() {\n for (const entry of this.entries) {\n if (entry.removed || this.paused || entry.toast.type === \"loading\" || entry.remaining === Infinity) { this.pause(entry); continue }\n if (entry.timer !== undefined) continue\n entry.started = Date.now()\n entry.timer = setTimeout(() => this.close(entry.toast.id, \"auto\"), Math.max(0, entry.remaining))\n }\n }\n position(entry: ToastEntry<T>) { return entry.toast.position ?? this.config.position }\n at(position: Position) { return this.entries.filter((entry) => this.position(entry) === position) }\n offset(entry: ToastEntry<T>) {\n if (entry.removed) return entry.exitOffset\n const siblings = this.at(this.position(entry)).filter((item) => !item.removed)\n return siblings.slice(0, siblings.indexOf(entry)).reduce((sum, item) => sum + item.height + this.config.gap, 0)\n }\n setNode(id: ToastId, node: HTMLElement | null) { if (node) this.nodes.set(id, node); else this.nodes.delete(id) }\n setList(position: Position, node: HTMLElement | null) { if (node) this.lists.set(position, node); else this.lists.delete(position) }\n measure(id: ToastId, height: number) { const entry = this.entries.find((item) => item.toast.id === id); if (entry && entry.height !== height) { entry.height = height; this.emit() } }\n close(id: ToastId, reason: \"dismiss\" | \"auto\" | \"action\" | \"external\" | \"detach\") {\n const entry = this.entries.find((item) => item.toast.id === id)\n if (!entry || entry.removed || reason === \"dismiss\" && (entry.toast.dismissible === false || entry.toast.type === \"loading\")) return\n entry.exitOffset = this.offset(entry)\n entry.removed = true\n this.announced.delete(id)\n this.assertive.delete(id)\n this.pending.delete(id)\n entry.detached = reason === \"detach\"\n this.pause(entry)\n if (this.gesture?.id === id) this.gesture = undefined\n entry.swiping = false\n if (reason === \"dismiss\" || reason === \"auto\" || reason === \"external\") this.notify(reason === \"external\" ? \"dismiss\" : reason, entry.toast)\n const node = this.nodes.get(id)\n if (node?.contains(this.doc?.activeElement ?? null)) this.restoreFocus()\n entry.exitTimer = setTimeout(() => {\n if (reason !== \"detach\") this.suppressed.set(id, entry.toast)\n this.entries = this.entries.filter((item) => item !== entry)\n if (reason !== \"external\" && reason !== \"detach\") this.dismissStore(id)\n this.emit()\n }, EXIT_DURATION)\n this.refreshTimers(); this.emit()\n }\n private ownsFocus(target: EventTarget | null) { return target instanceof Node && [...this.lists.values()].some((list) => list.contains(target)) }\n focusIn(event: FocusEvent) {\n if (!this.focused && event.relatedTarget instanceof HTMLElement && !this.ownsFocus(event.relatedTarget)) this.previousFocus = event.relatedTarget\n this.focused = true; this.refreshTimers(); this.emit()\n }\n focusOut(event: FocusEvent) {\n if (this.ownsFocus(event.relatedTarget)) return\n this.focused = false\n // An intentional move to another control owns focus. Never bounce through the opener.\n if (event.relatedTarget instanceof HTMLElement) this.previousFocus = null\n this.refreshTimers(); this.emit()\n }\n private restoreFocus() {\n const previous = this.previousFocus\n this.previousFocus = null; this.focused = false\n if (previous?.isConnected) previous.focus({ preventScroll: true })\n }\n keyDown(event: KeyboardEvent, hotkey: string[]) {\n if (hotkey.length && hotkey.every((key) => key === event.code || (key === \"altKey\" && event.altKey) || (key === \"ctrlKey\" && event.ctrlKey) || (key === \"metaKey\" && event.metaKey) || (key === \"shiftKey\" && event.shiftKey))) {\n const list = this.lists.values().next().value\n if (list) { event.preventDefault(); list.focus({ preventScroll: true }) }\n } else if (event.key === \"Escape\" && this.ownsFocus(this.doc?.activeElement ?? null)) {\n this.hovered = false; this.restoreFocus(); this.refreshTimers(); this.emit()\n }\n }\n pointerEnter(event: PointerEvent) { this.lastPointerType = event.pointerType; this.hover(event.pointerType !== \"touch\") }\n hover(value: boolean) {\n if (value && (this.lastPointerType === \"touch\" || this.doc?.documentElement.dataset.input === \"touch\" || this.doc?.defaultView?.matchMedia?.(\"(hover: none) and (pointer: coarse)\").matches)) return\n this.hovered = value; this.refreshTimers(); this.emit()\n }\n pointerDown(id: ToastId, event: PointerEvent) {\n this.lastPointerType = event.pointerType\n if (event.pointerType === \"touch\" && this.hovered) { this.hovered = false; this.refreshTimers(); this.emit() }\n const entry = this.entries.find((item) => item.toast.id === id)\n if (this.gesture || !entry || entry.removed || event.button !== 0 || entry.toast.type === \"loading\" || entry.toast.dismissible === false) return\n if (event.target instanceof Element && event.target.closest(\"button, a, input, textarea, select, [contenteditable='true']\")) return\n this.gesture = { id, pointerId: event.pointerId, x: event.clientX, y: event.clientY, started: Date.now() }\n entry.swiping = true\n this.nodes.get(id)?.setPointerCapture?.(event.pointerId)\n this.refreshTimers(); this.emit()\n }\n pointerMove(id: ToastId, event: PointerEvent) {\n const gesture = this.gesture\n const entry = this.entries.find((item) => item.toast.id === id)\n if (!gesture || gesture.id !== id || gesture.pointerId !== event.pointerId || !entry) return\n if (this.doc?.getSelection()?.toString()) return\n const dx = event.clientX - gesture.x, dy = event.clientY - gesture.y\n if (!gesture.axis && Math.max(Math.abs(dx), Math.abs(dy)) > 1) gesture.axis = Math.abs(dx) > Math.abs(dy) ? \"x\" : \"y\"\n const [vertical, horizontal] = this.position(entry).split(\"-\")\n const allowed = this.config.swipeDirections ?? [vertical, horizontal]\n entry.x = gesture.axis === \"x\" && allowed.includes(dx > 0 ? \"right\" : \"left\") ? dx : 0\n entry.y = gesture.axis === \"y\" && allowed.includes(dy > 0 ? \"bottom\" : \"top\") ? dy : 0\n this.emit()\n }\n pointerEnd(id: ToastId, event: PointerEvent, cancelled = false) {\n const gesture = this.gesture\n const entry = this.entries.find((item) => item.toast.id === id)\n if (!gesture || gesture.id !== id || gesture.pointerId !== event.pointerId || !entry) return\n const distance = Math.max(Math.abs(entry.x), Math.abs(entry.y))\n this.gesture = undefined; entry.swiping = false\n if (!cancelled && (distance >= 45 || distance > 3 && distance / Math.max(1, Date.now() - gesture.started) > 0.11)) {\n entry.swipeOut = entry.x ? entry.x > 0 ? \"right\" : \"left\" : entry.y > 0 ? \"down\" : \"up\"\n this.close(id, \"dismiss\")\n } else { entry.x = 0; entry.y = 0 }\n this.refreshTimers(); this.emit()\n }\n}\n\nconst ISOLATED_EVENTS = [\"focusin\", \"focusout\", \"pointerdown\"] as const\n\n/** The words a toast says: its title and description, or a custom toast's text. */\nexport const toastText = (node: HTMLElement) => {\n const words = (element: Element | null | undefined) => element?.textContent?.replace(/\\s+/g, \" \").trim() ?? \"\"\n if (!node.querySelector(\"[data-content]\")) return words(node)\n const title = words(node.querySelector(\"[data-title]\"))\n const description = words(node.querySelector(\"[data-description]\"))\n if (!title || !description) return title || description\n return `${/[.!?…:;。!?]$/u.test(title) ? title : `${title}.`} ${description}`\n}\n\n/** Hides the polite announcer from sight, not from a screen reader. */\nexport const announcerStyle = { position: \"absolute\", width: \"1px\", height: \"1px\", margin: \"-1px\", padding: \"0\", overflow: \"hidden\", clip: \"rect(0 0 0 0)\", clipPath: \"inset(50%)\", whiteSpace: \"nowrap\", border: \"0\" } as const\n\nexport type Offset = number | string | Partial<Record<\"top\" | \"right\" | \"bottom\" | \"left\", number | string>>\nexport const offsetStyles = (offset: Offset | undefined, mobileOffset: Offset | undefined) => {\n const style: Record<string, string> = {}\n for (const [prefix, value, fallback] of [[\"--offset\", offset, \"32px\"], [\"--mobile-offset\", mobileOffset, \"16px\"]] as const) {\n for (const edge of [\"top\", \"right\", \"bottom\", \"left\"] as const) {\n const size = typeof value === \"object\" ? value[edge] ?? fallback : value ?? fallback\n style[`${prefix}-${edge}`] = typeof size === \"number\" ? `${size}px` : size\n }\n }\n return style\n}\n\nexport const documentDirection = (doc: Document | undefined) => {\n const direction = doc?.documentElement.getAttribute(\"dir\")\n if (direction === \"ltr\" || direction === \"rtl\") return direction\n return doc?.defaultView?.getComputedStyle(doc.documentElement).direction === \"rtl\" ? \"rtl\" : \"ltr\"\n}\n"]}
|
|
@@ -1,6 +1,22 @@
|
|
|
1
|
-
import { defineComponent, h, inject, onBeforeUnmount, onMounted, ref, } from "vue";
|
|
1
|
+
import { computed, defineComponent, h, inject, onBeforeUnmount, onMounted, provide, ref, } from "vue";
|
|
2
2
|
import s from "@plexui/styles/components/Toolbar/Toolbar.module.css";
|
|
3
3
|
export const TOOLBAR_HOST = Symbol("ToolbarHost");
|
|
4
|
+
// The title style of the top bar, which a large title on a page needs to show itself inline once scrolled.
|
|
5
|
+
const TOOLBAR_TITLE_STYLE = Symbol("ToolbarTitleStyle");
|
|
6
|
+
/**
|
|
7
|
+
* A large title on a page scrolls up with the content under the row of controls; the row shows the
|
|
8
|
+
* title inline once it has gone. The distance it travels (the gap above it and its height) goes to
|
|
9
|
+
* `--toolbar-large-title-travel`, in pixels as a number, as the page's `--page-scroll-y` is.
|
|
10
|
+
*/
|
|
11
|
+
function measureLargeTitle(bar) {
|
|
12
|
+
if (bar.dataset.titleStyle !== "large")
|
|
13
|
+
return;
|
|
14
|
+
const heading = Array.from(bar.children).find((child) => child instanceof HTMLElement && child.classList.contains(s.Heading));
|
|
15
|
+
if (!heading)
|
|
16
|
+
return;
|
|
17
|
+
const gap = Number.parseFloat(getComputedStyle(bar).rowGap) || 0;
|
|
18
|
+
bar.style.setProperty("--toolbar-large-title-travel", String(heading.offsetHeight + gap));
|
|
19
|
+
}
|
|
4
20
|
const ToolbarComponent = defineComponent({
|
|
5
21
|
name: "Toolbar",
|
|
6
22
|
props: {
|
|
@@ -10,11 +26,12 @@ const ToolbarComponent = defineComponent({
|
|
|
10
26
|
titleStyle: { type: String, default: "inline" },
|
|
11
27
|
/** Alignment of an inline title. Compact and large titles always start at the leading edge. @default "center" */
|
|
12
28
|
titleAlign: { type: String, default: "center" },
|
|
13
|
-
/** @default "
|
|
14
|
-
background: { type: String, default:
|
|
29
|
+
/** How the bar meets the content scrolled under it on a phone. @default "glass" at the top, "soft" at the bottom */
|
|
30
|
+
background: { type: String, default: undefined },
|
|
15
31
|
},
|
|
16
32
|
setup(props, { slots }) {
|
|
17
33
|
const host = inject(TOOLBAR_HOST, null);
|
|
34
|
+
provide(TOOLBAR_TITLE_STYLE, computed(() => (props.placement === "top" ? props.titleStyle : undefined)));
|
|
18
35
|
const element = ref(null);
|
|
19
36
|
let observer;
|
|
20
37
|
let reported;
|
|
@@ -29,6 +46,7 @@ const ToolbarComponent = defineComponent({
|
|
|
29
46
|
setHeight(reported, undefined);
|
|
30
47
|
reported = props.placement;
|
|
31
48
|
setHeight(props.placement, bar.offsetHeight || undefined);
|
|
49
|
+
measureLargeTitle(bar);
|
|
32
50
|
};
|
|
33
51
|
update();
|
|
34
52
|
observer = typeof ResizeObserver !== "undefined" ? new ResizeObserver(update) : undefined;
|
|
@@ -46,9 +64,10 @@ const ToolbarComponent = defineComponent({
|
|
|
46
64
|
"data-placement": props.placement,
|
|
47
65
|
"data-title-style": props.placement === "top" ? props.titleStyle : undefined,
|
|
48
66
|
"data-title-align": props.placement === "top" ? props.titleAlign : undefined,
|
|
49
|
-
"data-background": props.background,
|
|
67
|
+
"data-background": props.background === "edge" ? "soft" : (props.background ?? (props.placement === "bottom" ? "soft" : "glass")),
|
|
50
68
|
"data-host": host?.kind,
|
|
51
69
|
"data-scrolled": props.placement === "top" && host?.scrolled?.value ? "" : undefined,
|
|
70
|
+
"data-content-below": props.placement === "bottom" && host?.contentBelow?.value ? "" : undefined,
|
|
52
71
|
}, slots.default?.());
|
|
53
72
|
},
|
|
54
73
|
});
|
|
@@ -95,12 +114,24 @@ export const ToolbarTitle = defineComponent({
|
|
|
95
114
|
},
|
|
96
115
|
setup(props, { slots, attrs }) {
|
|
97
116
|
const host = inject(TOOLBAR_HOST, null);
|
|
117
|
+
const titleStyle = inject(TOOLBAR_TITLE_STYLE, null);
|
|
98
118
|
return () => {
|
|
119
|
+
// An empty subtitle, from the prop or a slot that renders nothing, leaves the title on one line, as in React.
|
|
120
|
+
const present = (value) => (Array.isArray(value) ? value.length > 0 : value != null && value !== "");
|
|
99
121
|
const subtitle = slots.subtitle?.() ?? props.subtitle;
|
|
100
|
-
|
|
122
|
+
const heading = h("div", { "class": s.Heading, "aria-hidden": host?.kind === "dialog" ? "true" : undefined }, [
|
|
101
123
|
h(props.as, { ...attrs, class: [s.Title, attrs.class] }, slots.default?.()),
|
|
102
|
-
subtitle
|
|
124
|
+
present(subtitle) ? h("p", { class: s.Subtitle }, subtitle) : null,
|
|
103
125
|
]);
|
|
126
|
+
if (titleStyle?.value !== "large" || host?.kind !== "page")
|
|
127
|
+
return heading;
|
|
128
|
+
// The inline copy the row of controls shows once the large title has scrolled under it. A subtitle stays
|
|
129
|
+
// as a second line, as in the inline title (iOS 26 kit Toolbar - Top - iPhone, Title 2 Line).
|
|
130
|
+
const copySubtitle = slots.subtitle?.() ?? props.subtitle;
|
|
131
|
+
const copy = present(copySubtitle)
|
|
132
|
+
? [h("span", { class: s.CollapsedLine }, slots.default?.()), h("span", { class: s.CollapsedSubtitle }, copySubtitle)]
|
|
133
|
+
: slots.default?.();
|
|
134
|
+
return [heading, h("span", { "class": s.CollapsedTitle, "aria-hidden": "true" }, copy)];
|
|
104
135
|
};
|
|
105
136
|
},
|
|
106
137
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Toolbar.js","sourceRoot":"","sources":["../../../../src/components/Toolbar/Toolbar.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,CAAC,EACD,MAAM,EACN,eAAe,EACf,SAAS,EACT,G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\nimport s from \"@plexui/styles/components/Toolbar/Toolbar.module.css\"\n\n// Vue port of packages/ui/src/components/Toolbar/Toolbar.tsx. Exports are flat\n// (`ToolbarLeading` for `Toolbar.Leading`, ...).\n\nexport type ToolbarPlacement = \"top\" | \"bottom\"\n/** Title layouts of the phone top bar. */\nexport type ToolbarTitleStyle = \"inline\" | \"large\" | \"compact-large\" | \"compact-medium\"\nexport type ToolbarTitleAlign = \"center\" | \"start\"\n/** `\"edge\"` fades the canvas over content scrolled under the bar; `\"solid\"` fills the bar. */\nexport type ToolbarBackground = \"edge\" | \"solid\"\n\n/**\n * A surface that places phone toolbars: `Page` puts the top bar over its content\n * and reserves the space; `Dialog` puts it under the Sheet's grabber.\n */\nexport type ToolbarHost = {\n kind: \"page\" | \"dialog\"\n setHeight?: (placement: ToolbarPlacement, height: number | undefined) => void\n /** Content has scrolled under the top bar, so its glass casts a shadow. */\n scrolled?: Ref<boolean>\n}\n\nexport const TOOLBAR_HOST: InjectionKey<ToolbarHost> = Symbol(\"ToolbarHost\")\n\nconst ToolbarComponent = defineComponent({\n name: \"Toolbar\",\n props: {\n /** @default \"top\" */\n placement: { type: String as PropType<ToolbarPlacement>, default: \"top\" },\n /** Layout of `ToolbarTitle` in a top bar. @default \"inline\" */\n titleStyle: { type: String as PropType<ToolbarTitleStyle>, default: \"inline\" },\n /** Alignment of an inline title. Compact and large titles always start at the leading edge. @default \"center\" */\n titleAlign: { type: String as PropType<ToolbarTitleAlign>, default: \"center\" },\n /** @default \"edge\" */\n background: { type: String as PropType<ToolbarBackground>, default: \"edge\" },\n },\n setup(props, { slots }) {\n const host = inject(TOOLBAR_HOST, null)\n const element = ref<HTMLElement | null>(null)\n let observer: ResizeObserver | undefined\n let reported: ToolbarPlacement | undefined\n onMounted(() => {\n const bar = element.value\n const setHeight = host?.setHeight\n if (!bar || !setHeight) return\n // A desktop layout hides the bar; its height then leaves the host's own header in charge.\n const update = () => {\n if (reported && reported !== props.placement) setHeight(reported, undefined)\n reported = props.placement\n setHeight(props.placement, bar.offsetHeight || undefined)\n }\n update()\n observer = typeof ResizeObserver !== \"undefined\" ? new ResizeObserver(update) : undefined\n observer?.observe(bar, { box: \"border-box\" })\n })\n onBeforeUnmount(() => {\n observer?.disconnect()\n if (reported) host?.setHeight?.(reported, undefined)\n })\n return () => h(\"div\", {\n \"ref\": element,\n \"class\": s.Toolbar,\n \"data-toolbar\": \"\",\n \"data-placement\": props.placement,\n \"data-title-style\": props.placement === \"top\" ? props.titleStyle : undefined,\n \"data-title-align\": props.placement === \"top\" ? props.titleAlign : undefined,\n \"data-background\": props.background,\n \"data-host\": host?.kind,\n \"data-scrolled\": props.placement === \"top\" && host?.scrolled?.value ? \"\" : undefined,\n }, slots.default?.())\n },\n})\n\n/** Props of `Toolbar`. */\nexport type ToolbarProps = {\n placement?: ToolbarPlacement\n titleStyle?: ToolbarTitleStyle\n titleAlign?: ToolbarTitleAlign\n background?: ToolbarBackground\n} & HTMLAttributes\n\n/** A phone toolbar, top or bottom. It never renders at the desktop breakpoint. */\nexport const Toolbar = ToolbarComponent as typeof ToolbarComponent & { new (): { $props: ToolbarProps } }\n\nfunction part(name: string, className: string, role?: string) {\n return defineComponent({\n name,\n setup(_, { slots }) {\n return () => h(\"div\", { class: className, role }, slots.default?.())\n },\n })\n}\n\n/** Items at the leading edge (React `Toolbar.Leading`). */\nexport const ToolbarLeading = part(\"ToolbarLeading\", s.Leading)\n/** Items at the trailing edge (React `Toolbar.Trailing`). */\nexport const ToolbarTrailing = part(\"ToolbarTrailing\", s.Trailing)\n/** Buttons that share one capsule (React `Toolbar.Group`). */\nexport const ToolbarGroup = part(\"ToolbarGroup\", s.Group, \"group\")\n\n/** Custom middle content: a search field, a segmented control or a single centered action (React `Toolbar.Content`). */\nexport const ToolbarContent = defineComponent({\n name: \"ToolbarContent\",\n props: {\n /** Stretch between the leading and trailing items, as a search field does. */\n fill: { type: Boolean, default: false },\n },\n setup(props, { slots }) {\n return () => h(\"div\", { \"class\": s.Content, \"data-fill\": props.fill ? \"\" : undefined }, slots.default?.())\n },\n})\n\n/** The bar title, with an optional second line (React `Toolbar.Title`). */\nexport const ToolbarTitle = defineComponent({\n name: \"ToolbarTitle\",\n inheritAttrs: false,\n props: {\n /** A second, smaller line below the title. The `subtitle` slot takes precedence. */\n subtitle: { type: String, default: undefined },\n /**\n * Heading level. In a Dialog the dialog's own title names the Sheet, so the bar title is hidden\n * from assistive technology there.\n * @default \"h1\"\n */\n as: { type: String as PropType<\"h1\" | \"h2\" | \"h3\">, default: \"h1\" },\n },\n setup(props, { slots, attrs }) {\n const host = inject(TOOLBAR_HOST, null)\n return () => {\n const subtitle = slots.subtitle?.() ?? props.subtitle\n return h(\"div\", { \"class\": s.Heading, \"aria-hidden\": host?.kind === \"dialog\" ? \"true\" : undefined }, [\n h(props.as, { ...attrs, class: [s.Title, attrs.class] }, slots.default?.()),\n subtitle != null && subtitle !== \"\" ? h(\"p\", { class: s.Subtitle }, subtitle) : null,\n ])\n }\n },\n})\n"]}
|
|
1
|
+
{"version":3,"file":"Toolbar.js","sourceRoot":"","sources":["../../../../src/components/Toolbar/Toolbar.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EACR,eAAe,EACf,CAAC,EACD,MAAM,EACN,eAAe,EACf,SAAS,EACT,OAAO,EACP,GAAG,GAMJ,MAAM,KAAK,CAAA;AACZ,OAAO,CAAC,MAAM,sDAAsD,CAAA;AAqCpE,MAAM,CAAC,MAAM,YAAY,GAA8B,MAAM,CAAC,aAAa,CAAC,CAAA;AAE5E,2GAA2G;AAC3G,MAAM,mBAAmB,GAA6D,MAAM,CAAC,mBAAmB,CAAC,CAAA;AAEjH;;;;GAIG;AACH,SAAS,iBAAiB,CAAC,GAAgB;IACzC,IAAI,GAAG,CAAC,OAAO,CAAC,UAAU,KAAK,OAAO;QAAE,OAAM;IAC9C,MAAM,OAAO,GAAG,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC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,CAAC,CAAC,MAAM,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC,aAAa,EAAE,EAAE,KAAK,CAAC,OAAO,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC,iBAAiB,EAAE,EAAE,YAAY,CAAC,CAAC;gBACrH,CAAC,CAAC,KAAK,CAAC,OAAO,EAAE,EAAE,CAAA;YACrB,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,OAAO,EAAE,CAAC,CAAC,cAAc,EAAE,aAAa,EAAE,MAAM,EAAE,EAAE,IAAI,CAAC,CAAC,CAAA;QACzF,CAAC,CAAA;IACH,CAAC;CACF,CAAC,CAAA","sourcesContent":["import {\n computed,\n defineComponent,\n h,\n inject,\n onBeforeUnmount,\n onMounted,\n provide,\n ref,\n type ComputedRef,\n type HTMLAttributes,\n type InjectionKey,\n type PropType,\n type Ref,\n} from \"vue\"\nimport s from \"@plexui/styles/components/Toolbar/Toolbar.module.css\"\n\n// Vue port of packages/ui/src/components/Toolbar/Toolbar.tsx. Exports are flat\n// (`ToolbarLeading` for `Toolbar.Leading`, ...).\n\nexport type ToolbarPlacement = \"top\" | \"bottom\"\n/** Title layouts of the phone top bar. */\nexport type ToolbarTitleStyle = \"inline\" | \"large\" | \"compact-large\" | \"compact-medium\"\nexport type ToolbarTitleAlign = \"center\" | \"start\"\n/**\n * How a bar meets the content scrolled under it, after the scroll edge effect of iOS 26:\n * - `\"soft\"` (the default of a bottom bar): at the top, the canvas color covers the content under the bar's controls and fades out past them, over a\n * light blur; at the bottom of a page the content stays clear under and around the controls, as on native iOS 26,\n * and a Sheet's bottom bar fades its content into the panel\n * - `\"hard\"`: an opaque bar of the canvas color with a line once content is under it\n * - `\"glass\"` (the default of a top bar): a translucent, blurred bar with a hairline, shown once content is under it\n * - `\"solid\"`: an opaque bar of the canvas color without a line\n */\nexport type BarBackground = \"soft\" | \"hard\" | \"glass\" | \"solid\"\n/** `\"edge\"` is the earlier name of `\"soft\"`. */\nexport type ToolbarBackground = BarBackground | \"edge\"\n\n/**\n * A surface that places phone toolbars: `Page` puts the top bar over its content\n * and reserves the space; `Dialog` puts it under the Sheet's grabber.\n */\nexport type ToolbarHost = {\n kind: \"page\" | \"dialog\"\n setHeight?: (placement: ToolbarPlacement, height: number | undefined) => void\n /** Content has scrolled under the top bar, so its glass casts a shadow and a hard or glass bar shows its line. */\n scrolled?: Ref<boolean>\n /** Content continues under the bottom bar, so a hard or glass bar shows its line. */\n contentBelow?: Ref<boolean>\n /** Calls the listener with the content's scroll offset on every scroll; returns the unsubscribe. A TabBar minimizes with it. */\n subscribeScroll?: (listener: (scrollTop: number) => void) => () => void\n}\n\nexport const TOOLBAR_HOST: InjectionKey<ToolbarHost> = Symbol(\"ToolbarHost\")\n\n// The title style of the top bar, which a large title on a page needs to show itself inline once scrolled.\nconst TOOLBAR_TITLE_STYLE: InjectionKey<ComputedRef<ToolbarTitleStyle | undefined>> = Symbol(\"ToolbarTitleStyle\")\n\n/**\n * A large title on a page scrolls up with the content under the row of controls; the row shows the\n * title inline once it has gone. The distance it travels (the gap above it and its height) goes to\n * `--toolbar-large-title-travel`, in pixels as a number, as the page's `--page-scroll-y` is.\n */\nfunction measureLargeTitle(bar: HTMLElement) {\n if (bar.dataset.titleStyle !== \"large\") return\n const heading = Array.from(bar.children).find((child): child is HTMLElement => child instanceof HTMLElement && child.classList.contains(s.Heading))\n if (!heading) return\n const gap = Number.parseFloat(getComputedStyle(bar).rowGap) || 0\n bar.style.setProperty(\"--toolbar-large-title-travel\", String(heading.offsetHeight + gap))\n}\n\nconst ToolbarComponent = defineComponent({\n name: \"Toolbar\",\n props: {\n /** @default \"top\" */\n placement: { type: String as PropType<ToolbarPlacement>, default: \"top\" },\n /** Layout of `ToolbarTitle` in a top bar. @default \"inline\" */\n titleStyle: { type: String as PropType<ToolbarTitleStyle>, default: \"inline\" },\n /** Alignment of an inline title. Compact and large titles always start at the leading edge. @default \"center\" */\n titleAlign: { type: String as PropType<ToolbarTitleAlign>, default: \"center\" },\n /** How the bar meets the content scrolled under it on a phone. @default \"glass\" at the top, \"soft\" at the bottom */\n background: { type: String as PropType<ToolbarBackground>, default: undefined },\n },\n setup(props, { slots }) {\n const host = inject(TOOLBAR_HOST, null)\n provide(TOOLBAR_TITLE_STYLE, computed(() => (props.placement === \"top\" ? props.titleStyle : undefined)))\n const element = ref<HTMLElement | null>(null)\n let observer: ResizeObserver | undefined\n let reported: ToolbarPlacement | undefined\n onMounted(() => {\n const bar = element.value\n const setHeight = host?.setHeight\n if (!bar || !setHeight) return\n // A desktop layout hides the bar; its height then leaves the host's own header in charge.\n const update = () => {\n if (reported && reported !== props.placement) setHeight(reported, undefined)\n reported = props.placement\n setHeight(props.placement, bar.offsetHeight || undefined)\n measureLargeTitle(bar)\n }\n update()\n observer = typeof ResizeObserver !== \"undefined\" ? new ResizeObserver(update) : undefined\n observer?.observe(bar, { box: \"border-box\" })\n })\n onBeforeUnmount(() => {\n observer?.disconnect()\n if (reported) host?.setHeight?.(reported, undefined)\n })\n return () => h(\"div\", {\n \"ref\": element,\n \"class\": s.Toolbar,\n \"data-toolbar\": \"\",\n \"data-placement\": props.placement,\n \"data-title-style\": props.placement === \"top\" ? props.titleStyle : undefined,\n \"data-title-align\": props.placement === \"top\" ? props.titleAlign : undefined,\n \"data-background\": props.background === \"edge\" ? \"soft\" : (props.background ?? (props.placement === \"bottom\" ? \"soft\" : \"glass\")),\n \"data-host\": host?.kind,\n \"data-scrolled\": props.placement === \"top\" && host?.scrolled?.value ? \"\" : undefined,\n \"data-content-below\": props.placement === \"bottom\" && host?.contentBelow?.value ? \"\" : undefined,\n }, slots.default?.())\n },\n})\n\n/** Props of `Toolbar`. */\nexport type ToolbarProps = {\n placement?: ToolbarPlacement\n titleStyle?: ToolbarTitleStyle\n titleAlign?: ToolbarTitleAlign\n /** How the bar meets the content scrolled under it on a phone. @default \"glass\" at the top, \"soft\" at the bottom */\n background?: ToolbarBackground\n} & HTMLAttributes\n\n/** A phone toolbar, top or bottom. It never renders at the desktop breakpoint. */\nexport const Toolbar = ToolbarComponent as typeof ToolbarComponent & { new (): { $props: ToolbarProps } }\n\nfunction part(name: string, className: string, role?: string) {\n return defineComponent({\n name,\n setup(_, { slots }) {\n return () => h(\"div\", { class: className, role }, slots.default?.())\n },\n })\n}\n\n/** Items at the leading edge (React `Toolbar.Leading`). */\nexport const ToolbarLeading = part(\"ToolbarLeading\", s.Leading)\n/** Items at the trailing edge (React `Toolbar.Trailing`). */\nexport const ToolbarTrailing = part(\"ToolbarTrailing\", s.Trailing)\n/** Buttons that share one capsule (React `Toolbar.Group`). */\nexport const ToolbarGroup = part(\"ToolbarGroup\", s.Group, \"group\")\n\n/** Custom middle content: a search field, a segmented control or a single centered action (React `Toolbar.Content`). */\nexport const ToolbarContent = defineComponent({\n name: \"ToolbarContent\",\n props: {\n /** Stretch between the leading and trailing items, as a search field does. */\n fill: { type: Boolean, default: false },\n },\n setup(props, { slots }) {\n return () => h(\"div\", { \"class\": s.Content, \"data-fill\": props.fill ? \"\" : undefined }, slots.default?.())\n },\n})\n\n/** The bar title, with an optional second line (React `Toolbar.Title`). */\nexport const ToolbarTitle = defineComponent({\n name: \"ToolbarTitle\",\n inheritAttrs: false,\n props: {\n /** A second, smaller line below the title. The `subtitle` slot takes precedence. */\n subtitle: { type: String, default: undefined },\n /**\n * Heading level. In a Dialog the dialog's own title names the Sheet, so the bar title is hidden\n * from assistive technology there.\n * @default \"h1\"\n */\n as: { type: String as PropType<\"h1\" | \"h2\" | \"h3\">, default: \"h1\" },\n },\n setup(props, { slots, attrs }) {\n const host = inject(TOOLBAR_HOST, null)\n const titleStyle = inject(TOOLBAR_TITLE_STYLE, null)\n return () => {\n // An empty subtitle, from the prop or a slot that renders nothing, leaves the title on one line, as in React.\n const present = (value: unknown) => (Array.isArray(value) ? value.length > 0 : value != null && value !== \"\")\n const subtitle = slots.subtitle?.() ?? props.subtitle\n const heading = h(\"div\", { \"class\": s.Heading, \"aria-hidden\": host?.kind === \"dialog\" ? \"true\" : undefined }, [\n h(props.as, { ...attrs, class: [s.Title, attrs.class] }, slots.default?.()),\n present(subtitle) ? h(\"p\", { class: s.Subtitle }, subtitle) : null,\n ])\n if (titleStyle?.value !== \"large\" || host?.kind !== \"page\") return heading\n // The inline copy the row of controls shows once the large title has scrolled under it. A subtitle stays\n // as a second line, as in the inline title (iOS 26 kit Toolbar - Top - iPhone, Title 2 Line).\n const copySubtitle = slots.subtitle?.() ?? props.subtitle\n const copy = present(copySubtitle)\n ? [h(\"span\", { class: s.CollapsedLine }, slots.default?.()), h(\"span\", { class: s.CollapsedSubtitle }, copySubtitle)]\n : slots.default?.()\n return [heading, h(\"span\", { \"class\": s.CollapsedTitle, \"aria-hidden\": \"true\" }, copy)]\n }\n },\n})\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/Toolbar/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,EACP,cAAc,EACd,YAAY,EACZ,cAAc,EACd,YAAY,EACZ,eAAe,EACf,YAAY,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/Toolbar/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,EACP,cAAc,EACd,YAAY,EACZ,cAAc,EACd,YAAY,EACZ,eAAe,EACf,YAAY,GAQb,MAAM,cAAc,CAAA","sourcesContent":["export {\n Toolbar,\n ToolbarContent,\n ToolbarGroup,\n ToolbarLeading,\n ToolbarTitle,\n ToolbarTrailing,\n TOOLBAR_HOST,\n type BarBackground,\n type ToolbarBackground,\n type ToolbarHost,\n type ToolbarPlacement,\n type ToolbarProps,\n type ToolbarTitleAlign,\n type ToolbarTitleStyle,\n} from \"./Toolbar.js\"\n"]}
|
|
@@ -40,7 +40,6 @@ export const firstElementChild = (nodes) => {
|
|
|
40
40
|
if (first?.type !== Text)
|
|
41
41
|
return first;
|
|
42
42
|
if (isDev) {
|
|
43
|
-
// eslint-disable-next-line no-console
|
|
44
43
|
console.warn("[plexui] Slot failed to slot onto its children. Expected a single element or component child, not text.");
|
|
45
44
|
}
|
|
46
45
|
return undefined;
|
|
@@ -68,8 +67,9 @@ export const mergeSlotProps = (child, slotProps) => {
|
|
|
68
67
|
const merged = { ...slotProps };
|
|
69
68
|
for (const [key, childValue] of Object.entries(child.props ?? {})) {
|
|
70
69
|
const slotValue = slotProps[key];
|
|
71
|
-
if (isHandler(key) && slotValue != null
|
|
72
|
-
|
|
70
|
+
if (isHandler(key) && slotValue != null) {
|
|
71
|
+
// As Radix's Slot: the child's handler runs first, and a child without one keeps the slot's.
|
|
72
|
+
merged[key] = childValue == null ? slotValue : [...toHandlers(childValue), ...toHandlers(slotValue)];
|
|
73
73
|
}
|
|
74
74
|
else if (key === "class" || key === "style") {
|
|
75
75
|
merged[key] = [slotValue, childValue];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"slot.js","sourceRoot":"","sources":["../../../../src/components/Tooltip/slot.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,UAAU,EAAuC,MAAM,KAAK,CAAA;AAC9F,OAAO,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAA;AAUhD,MAAM,SAAS,GAAG,CAAC,GAAW,EAAE,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;AAEvD,MAAM,UAAU,GAAG,CAAC,KAAc,EAAa,EAAE,CAC/C,KAAK,IAAI,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,KAAgB,CAAC,CAAA;AAE5F;;;GAGG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAC/B,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G,CAAC,GAAG,UAAU,IAAI,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,GAAG,UAAU,CAAC,UAAU,CAAC,EAAE,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC,CAAA;QACtG,CAAC;aAAM,IAAI,GAAG,KAAK,OAAO,IAAI,GAAG,KAAK,OAAO,EAAE,CAAC;YAC9C,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,SAAS,EAAE,UAAU,CAAC,CAAA;QACvC,CAAC;aAAM,IAAI,GAAG,KAAK,kBAAkB,EAAE,CAAC;YACtC,MAAM,CAAC,GAAG,CAAC,GAAG,qBAAqB,CAAC,UAAU,EAAE,SAAS,CAAC,CAAA;QAC5D,CAAC;aAAM,CAAC;YACN,MAAM,CAAC,GAAG,CAAC,GAAG,UAAU,CAAA;QAC1B,CAAC;IACH,CAAC;IAED,wEAAwE;IACxE,OAAO,UAAU,CAAC,EAAE,GAAG,KAAK,EAAE,KAAK,EAAE,EAAE,EAAW,EAAE,MAAM,CAAC,CAAA;AAC7D,CAAC,CAAA","sourcesContent":["import { Comment, Fragment, Text, cloneVNode, type VNode, type VNodeArrayChildren } from \"vue\"\nimport { isDev } from \"../../lib/environment.js\"\n\n// Internal: Radix's `asChild` / `Slot` merge for slot vnodes, shared by the\n// Tooltip and Popover triggers. Reka's slot merges the other way round (its\n// handlers run first and cannot be cancelled), so the triggers merge their\n// props onto the child themselves before Reka's parts see it.\n\ntype Handler = (...args: never[]) => unknown\ntype Props = Record<string, unknown>\n\nconst isHandler = (key: string) => /^on[A-Z]/.test(key)\n\nconst toHandlers = (value: unknown): Handler[] =>\n value == null ? [] : Array.isArray(value) ? value.flatMap(toHandlers) : [value as Handler]\n\n/**\n * Radix's `composeEventHandlers`: runs the caller's handler(s), then `ours`\n * unless one of them called `preventDefault()`.\n */\nexport const composeEventHandlers =\n <E extends Event>(theirs: unknown, ours: (event: E) => void) =>\n (event: E) => {\n for (const handler of toHandlers(theirs)) (handler as (event: E) => unknown)(event)\n if (!event.defaultPrevented) ours(event)\n }\n\nconst isWhitespaceText = (node: VNode) => node.type === Text && !String(node.children ?? \"\").trim()\n\nconst flatten = (nodes: VNodeArrayChildren, out: VNode[]) => {\n for (const node of nodes) {\n if (node == null || typeof node === \"boolean\") continue\n if (Array.isArray(node)) flatten(node, out)\n else if (typeof node !== \"object\") out.push({ type: Text, children: String(node) } as VNode)\n else if (node.type === Fragment && Array.isArray(node.children)) flatten(node.children, out)\n else if (node.type !== Comment && !isWhitespaceText(node)) out.push(node)\n }\n return out\n}\n\n/** Slot content without fragments, comments and whitespace-only text. */\nexport const flattenSlot = (nodes: VNodeArrayChildren | undefined) => flatten(nodes ?? [], [])\n\n/**\n * The element a Radix slot clones: the first child, when it is an element or\n * a component. React's Slot throws for a text child (radix-ui 1.8); this\n * renders nothing instead and warns in development.\n */\nexport const firstElementChild = (nodes: VNodeArrayChildren | undefined): VNode | undefined => {\n const [first] = flattenSlot(nodes)\n if (first?.type !== Text) return first\n if (isDev) {\n console.warn(\n \"[plexui] Slot failed to slot onto its children. Expected a single element or component child, not text.\",\n )\n }\n return undefined\n}\n\n/** Radix's `concatAriaDescribedby`: the ids of every value, once each, in order. */\nexport const concatAriaDescribedby = (...values: unknown[]) => {\n const ids = new Set<string>()\n for (const value of values) {\n if (typeof value !== \"string\") continue\n for (const id of value.trim().split(/\\s+/)) {\n if (id) ids.add(id)\n }\n }\n return ids.size > 0 ? Array.from(ids).join(\" \") : undefined\n}\n\n/**\n * Clones `child` with `slotProps` merged in the way Radix's Slot does it: the\n * child's own props win, classes are joined (slot first), styles are merged\n * (child last), `aria-describedby` ids are joined (child first, radix-ui 1.8)\n * and handlers both run, the child's first.\n */\nexport const mergeSlotProps = (child: VNode, slotProps: Props): VNode => {\n const merged: Props = { ...slotProps }\n\n for (const [key, childValue] of Object.entries(child.props ?? {})) {\n const slotValue = slotProps[key]\n\n if (isHandler(key) && slotValue != null) {\n // As Radix's Slot: the child's handler runs first, and a child without one keeps the slot's.\n merged[key] = childValue == null ? slotValue : [...toHandlers(childValue), ...toHandlers(slotValue)]\n } else if (key === \"class\" || key === \"style\") {\n merged[key] = [slotValue, childValue]\n } else if (key === \"aria-describedby\") {\n merged[key] = concatAriaDescribedby(childValue, slotValue)\n } else {\n merged[key] = childValue\n }\n }\n\n // Start from empty props so the child's own values are not merged twice\n return cloneVNode({ ...child, props: {} } as VNode, merged)\n}\n"]}
|
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
import { onBeforeUnmount, onMounted, toValue, watch } from "vue";
|
|
2
|
+
import { inToastRegion } from "../lib/toastRegion.js";
|
|
2
3
|
let handlers = [];
|
|
3
4
|
let listenerBound = false;
|
|
4
5
|
const handleKeyDown = (evt) => {
|
|
5
6
|
if (evt.key === "Escape") {
|
|
6
7
|
// Attempt to call the first handler in the stack, if it exists
|
|
7
8
|
const [firstHandler] = handlers;
|
|
8
|
-
|
|
9
|
+
// Escape in a toast returns focus to where it came from (the toast's own handler); it closes nothing under
|
|
10
|
+
// the toast, only what the toast itself opened
|
|
11
|
+
if (firstHandler && (firstHandler.fromToast || !inToastRegion(evt.target))) {
|
|
9
12
|
evt.preventDefault();
|
|
10
|
-
firstHandler.callback();
|
|
13
|
+
firstHandler.callback(evt);
|
|
11
14
|
}
|
|
12
15
|
}
|
|
13
16
|
};
|
|
@@ -23,11 +26,11 @@ const managerListener = () => {
|
|
|
23
26
|
};
|
|
24
27
|
/**
|
|
25
28
|
* Escape closes the most recently registered listener first, so nested
|
|
26
|
-
* overlays close one at a time.
|
|
29
|
+
* overlays close one at a time. The callback gets the key event, already prevented.
|
|
27
30
|
*/
|
|
28
31
|
export const useEscCloseStack = (listening, cb) => {
|
|
29
32
|
const id = Symbol("esc-close");
|
|
30
|
-
const handler = { id, callback: cb };
|
|
33
|
+
const handler = { id, callback: cb, fromToast: false };
|
|
31
34
|
const unregister = () => {
|
|
32
35
|
handlers = handlers.filter((h) => h.id !== id);
|
|
33
36
|
managerListener();
|
|
@@ -38,6 +41,7 @@ export const useEscCloseStack = (listening, cb) => {
|
|
|
38
41
|
unregister();
|
|
39
42
|
if (!isListening)
|
|
40
43
|
return;
|
|
44
|
+
handler.fromToast = inToastRegion(document.activeElement);
|
|
41
45
|
handlers.unshift(handler);
|
|
42
46
|
managerListener();
|
|
43
47
|
}, { immediate: true });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useEscCloseStack.js","sourceRoot":"","sources":["../../../src/composables/useEscCloseStack.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAyB,MAAM,KAAK,CAAA;
|
|
1
|
+
{"version":3,"file":"useEscCloseStack.js","sourceRoot":"","sources":["../../../src/composables/useEscCloseStack.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAyB,MAAM,KAAK,CAAA;AACvF,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAA;AASrD,IAAI,QAAQ,GAAc,EAAE,CAAA;AAC5B,IAAI,aAAa,GAAG,KAAK,CAAA;AAEzB,MAAM,aAAa,GAAG,CAAC,GAAkB,EAAE,EAAE;IAC3C,IAAI,GAAG,CAAC,GAAG,KAAK,QAAQ,EAAE,CAAC;QACzB,+DAA+D;QAC/D,MAAM,CAAC,YAAY,CAAC,GAAG,QAAQ,CAAA;QAE/B,2GAA2G;QAC3G,+CAA+C;QAC/C,IAAI,YAAY,IAAI,CAAC,YAAY,CAAC,SAAS,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC;YAC3E,GAAG,CAAC,cAAc,EAAE,CAAA;YACpB,YAAY,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAA;QAC5B,CAAC;IACH,CAAC;AACH,CAAC,CAAA;AAED,MAAM,eAAe,GAAG,GAAG,EAAE;IAC3B,IAAI,QAAQ,CAAC,MAAM,GA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Ae,CAAC,UAAU,CAAC,CAAA;AAC7B,CAAC,CAAA","sourcesContent":["import { onBeforeUnmount, onMounted, toValue, watch, type MaybeRefOrGetter } from \"vue\"\nimport { inToastRegion } from \"../lib/toastRegion.js\"\n\ntype Handler = {\n id: symbol\n callback: (event: KeyboardEvent) => void\n /** Opened from a toast (a Popover in a custom toast): Escape in the toast closes it */\n fromToast: boolean\n}\n\nlet handlers: Handler[] = []\nlet listenerBound = false\n\nconst handleKeyDown = (evt: KeyboardEvent) => {\n if (evt.key === \"Escape\") {\n // Attempt to call the first handler in the stack, if it exists\n const [firstHandler] = handlers\n\n // Escape in a toast returns focus to where it came from (the toast's own handler); it closes nothing under\n // the toast, only what the toast itself opened\n if (firstHandler && (firstHandler.fromToast || !inToastRegion(evt.target))) {\n evt.preventDefault()\n firstHandler.callback(evt)\n }\n }\n}\n\nconst managerListener = () => {\n if (handlers.length > 0 && !listenerBound) {\n document.body.addEventListener(\"keydown\", handleKeyDown)\n listenerBound = true\n } else if (handlers.length === 0 && listenerBound) {\n document.body.removeEventListener(\"keydown\", handleKeyDown)\n listenerBound = false\n }\n}\n\n/**\n * Escape closes the most recently registered listener first, so nested\n * overlays close one at a time. The callback gets the key event, already prevented.\n */\nexport const useEscCloseStack = (listening: MaybeRefOrGetter<boolean>, cb: (event: KeyboardEvent) => void) => {\n const id = Symbol(\"esc-close\")\n const handler: Handler = { id, callback: cb, fromToast: false }\n const unregister = () => {\n handlers = handlers.filter((h) => h.id !== id)\n managerListener()\n }\n\n // Register on mount, like React's effect: nothing global happens during SSR\n onMounted(() => {\n watch(\n () => toValue(listening),\n (isListening) => {\n unregister()\n if (!isListening) return\n handler.fromToast = inToastRegion(document.activeElement)\n handlers.unshift(handler)\n managerListener()\n },\n { immediate: true },\n )\n })\n\n onBeforeUnmount(unregister)\n}\n"]}
|
package/dist/es/lib/fieldRow.js
CHANGED
|
@@ -7,9 +7,22 @@ import { computed, inject, provide } from "vue";
|
|
|
7
7
|
*/
|
|
8
8
|
const FieldRowKey = Symbol("PlexUIFieldRow");
|
|
9
9
|
export const provideFieldRow = (inRow) => provide(FieldRowKey, computed(inRow));
|
|
10
|
+
/** True when the control ends a `Field row`. */
|
|
11
|
+
export const useFieldRow = () => {
|
|
12
|
+
const inRow = inject(FieldRowKey, null);
|
|
13
|
+
return computed(() => inRow?.value ?? false);
|
|
14
|
+
};
|
|
15
|
+
/** True in a `FieldGroup columns`, where every value starts at one column. */
|
|
16
|
+
const FieldColumnsKey = Symbol("PlexUIFieldColumns");
|
|
17
|
+
export const provideFieldColumns = (columns) => provide(FieldColumnsKey, computed(columns));
|
|
18
|
+
/** True when the control's value starts at the column of a `FieldGroup columns`. */
|
|
19
|
+
export const useFieldColumns = () => {
|
|
20
|
+
const columns = inject(FieldColumnsKey, null);
|
|
21
|
+
return computed(() => columns?.value ?? false);
|
|
22
|
+
};
|
|
10
23
|
/** The control's own `pill`, or else the shape of its row. */
|
|
11
24
|
export const useFieldRowPill = (pill) => {
|
|
12
|
-
const inRow =
|
|
13
|
-
return computed(() => pill() ?? inRow
|
|
25
|
+
const inRow = useFieldRow();
|
|
26
|
+
return computed(() => pill() ?? inRow.value);
|
|
14
27
|
};
|
|
15
28
|
//# sourceMappingURL=fieldRow.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fieldRow.js","sourceRoot":"","sources":["../../../src/lib/fieldRow.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAuC,MAAM,KAAK,CAAA;AAEpF,+CAA+C;AAE/C;;;;GAIG;AACH,MAAM,WAAW,GAAuC,MAAM,CAAC,gBAAgB,CAAC,CAAA;AAEhF,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,KAAoB,EAAE,EAAE,CAAC,OAAO,CAAC,WAAW,EAAE,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAA;AAE9F,
|
|
1
|
+
{"version":3,"file":"fieldRow.js","sourceRoot":"","sources":["../../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cesContent":["import { computed, inject, provide, type ComputedRef, type InjectionKey } from \"vue\"\n\n// Vue port of packages/ui/src/lib/fieldRow.ts.\n\n/**\n * True in a `Field row` whose control ends the row. It stands there beside\n * buttons and tags, so it takes their shape; a field with its label above stays\n * rounded.\n */\nconst FieldRowKey: InjectionKey<ComputedRef<boolean>> = Symbol(\"PlexUIFieldRow\")\n\nexport const provideFieldRow = (inRow: () => boolean) => provide(FieldRowKey, computed(inRow))\n\n/** True when the control ends a `Field row`. */\nexport const useFieldRow = () => {\n const inRow = inject(FieldRowKey, null)\n return computed(() => inRow?.value ?? false)\n}\n\n/** True in a `FieldGroup columns`, where every value starts at one column. */\nconst FieldColumnsKey: InjectionKey<ComputedRef<boolean>> = Symbol(\"PlexUIFieldColumns\")\n\nexport const provideFieldColumns = (columns: () => boolean) => provide(FieldColumnsKey, computed(columns))\n\n/** True when the control's value starts at the column of a `FieldGroup columns`. */\nexport const useFieldColumns = () => {\n const columns = inject(FieldColumnsKey, null)\n return computed(() => columns?.value ?? false)\n}\n\n/** The control's own `pill`, or else the shape of its row. */\nexport const useFieldRowPill = (pill: () => boolean | undefined) => {\n const inRow = useFieldRow()\n return computed(() => pill() ?? inRow.value)\n}\n"]}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { PHONE_LAYOUT_SCOPE } from './phoneLayout.js';
|
|
1
2
|
export function readFloatingFooterInset(root, footer) {
|
|
2
3
|
const view = root.ownerDocument.defaultView;
|
|
3
4
|
if (!view ||
|
|
@@ -41,7 +42,8 @@ export function observeFloatingFooter(root, footer, onChange) {
|
|
|
41
42
|
const start = () => {
|
|
42
43
|
stopMobile?.();
|
|
43
44
|
stopMobile = undefined;
|
|
44
|
-
|
|
45
|
+
// A phone layout keeps its phone geometry at any window width
|
|
46
|
+
if (!media.matches && !root.closest(PHONE_LAYOUT_SCOPE)) {
|
|
45
47
|
onChange(null);
|
|
46
48
|
return;
|
|
47
49
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"floatingBoundary.js","sourceRoot":"","sources":["../../../src/lib/floatingBoundary.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"floatingBoundary.js","sourceRoot":"","sources":["../../../src/lib/floatingBoundary.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAItD,MAAM,UAAU,uBAAuB,CACnC,IAAiB,EACjB,MAAmB;IAEnB,MAAM,IAAI,GAAG,IAAI,CAAC,aAAa,CAAC,WAAW,CAAC;IAC5C,IACI,CAAC,IAAI;QACL,CAAC,IAAI,CAAC,WAAW;QACjB,CAAC,MAAM,CAAC,WAAW;QACnB,MAAM,CAAC,aAAa,KAAK,IAAI,CAAC,aAAa;QAE3C,OAAO,IAAI,CAAC;IAChB,MAAM,QAAQ,GAAG,IAAI,CAAC,qBAAqB,EAAE,CAAC;IAC9C,MAAM,UAAU,GAAG,MAAM,CAAC,qBAAqB,EAAE,CAAC;IAClD,MAAM,WAAW,GAAG,IAAI,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAC;IAClD,IACI,QAAQ,CAAC,MAAM,IAAI,CAAC;QACpB,UAAU,CAAC,MAAM,IAAI,CAAC;QACtB,MAAM,CAAC,MAAM;QACb,WAAW,CAAC,UAAU,KAAK,QAAQ;QACnC,WAAW,CAAC,UAAU,KAAK,UAAU;QAErC,OAAO,IAAI,CAAC;IAEhB,MAAM,QAAQ,GAAG,IAAI,CAAC,cAAc,CAAC;IACrC,MAAM,WAAW,GAAG,QAAQ,EAAE,SAAS,IAAI,CAAC,CAAC;IAC7C,MAAM,cAAc,GAChB,WAAW,GAAG,CAAC,QAAQ,EAAE,MAAM,IAAI,IAAI,CAAC,aAAa,CAAC,eAAe,CAAC,YAAY,CAAC,CAAC;IACxF,8EAA8E;IAC9E,MAAM,KAAK,GAAG,IAAI,CAAC,YAAY,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,MAAM,GAAG,IAAI,CAAC,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AAE,gBAAgB,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;QAC1D,OAAO,EAAE,CAAC;QACV,UAAU,GAAG,GAAG,EAAE;YACd,IAAI,KAAK,KAAK,SAAS;gBAAE,IAAI,CAAC,oBAAoB,CAAC,KAAK,CAAC,CAAC;YAC1D,MAAM,EAAE,UAAU,EAAE,CAAC;YACrB,UAAU,CAAC,UAAU,EAAE,CAAC;YACxB,IAAI,CAAC,mBAAmB,CAAC,QAAQ,EAAE,QAAQ,EAAE,IAAI,CAAC,CAAC;YACnD,IAAI,CAAC,mBAAmB,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;YAC7C,IAAI,CAAC,cAAc,EAAE,mBAAmB,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;YAC7D,IAAI,CAAC,cAAc,EAAE,mBAAmB,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;QACjE,CAAC,CAAC;IACN,CAAC,CAAC;IACF,KAAK,CAAC,gBAAgB,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;IACxC,KAAK,EAAE,CAAC;IACR,OAAO,GAAG,EAAE;QACR,KAAK,CAAC,mBAAmB,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;QAC3C,UAAU,EAAE,EAAE,CAAC;IACnB,CAAC,CAAC;AACN,CAAC;AAED,MAAM,UAAU,uBAAuB,CAAC,CAAsB,EAAE,CAAsB;IAClF,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,KAAK,CAAC,CAAC,QAAQ,IAAI,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,MAAM,CAAC,CAAC;AACzF,CAAC","sourcesContent":["import { PHONE_LAYOUT_SCOPE } from './phoneLayout.js';\n/** Geometry shared by anchored menus in a Page or Dialog with pinned actions. */\nexport type FloatingFooterInset = { boundary: HTMLElement; bottom: number } | null;\n\nexport function readFloatingFooterInset(\n root: HTMLElement,\n footer: HTMLElement,\n): FloatingFooterInset {\n const view = root.ownerDocument.defaultView;\n if (\n !view ||\n !root.isConnected ||\n !footer.isConnected ||\n footer.ownerDocument !== root.ownerDocument\n )\n return null;\n const rootRect = root.getBoundingClientRect();\n const footerRect = footer.getBoundingClientRect();\n const footerStyle = view.getComputedStyle(footer);\n if (\n rootRect.height <= 0 ||\n footerRect.height <= 0 ||\n footer.hidden ||\n footerStyle.visibility === 'hidden' ||\n footerStyle.visibility === 'collapse'\n )\n return null;\n\n const viewport = view.visualViewport;\n const viewportTop = viewport?.offsetTop ?? 0;\n const viewportBottom =\n viewportTop + (viewport?.height ?? root.ownerDocument.documentElement.clientHeight);\n // Popper clips against the element's client box, excluding its bottom border.\n const scale = root.offsetHeight > 0 ? rootRect.height / root.offsetHeight : 1;\n const rootBottom =\n rootRect.bottom -\n Math.max(0, root.offsetHeight - root.clientHeight - root.clientTop) * scale;\n const visibleTop = Math.max(rootRect.top + root.clientTop * scale, viewportTop);\n const visibleBottom = Math.min(rootBottom, viewportBottom);\n if (visibleBottom <= visibleTop || footerRect.bottom <= visibleTop) return null;\n\n // Clip first, then reserve only the footer portion inside the visible area.\n // A keyboard can clip the Page below its footer; subtracting its full height\n // in that case would unnecessarily shrink the menu a second time.\n const bottom = Math.ceil(Math.max(0, visibleBottom - Math.max(visibleTop, footerRect.top)));\n return { boundary: root, bottom };\n}\n\n/** Observe only for the lifetime of an open popup, and only on Phone. */\nexport function observeFloatingFooter(\n root: HTMLElement,\n footer: HTMLElement,\n onChange: (value: FloatingFooterInset) => void,\n): () => void {\n const view = root.ownerDocument.defaultView;\n if (!view || typeof view.matchMedia !== 'function') return () => undefined;\n const media = view.matchMedia('(max-width: 767px)');\n let stopMobile: (() => void) | undefined;\n const start = () => {\n stopMobile?.();\n stopMobile = undefined;\n // A phone layout keeps its phone geometry at any window width\n if (!media.matches && !root.closest(PHONE_LAYOUT_SCOPE)) {\n onChange(null);\n return;\n }\n let frame: number | undefined;\n const measure = () => {\n frame = undefined;\n onChange(readFloatingFooterInset(root, footer));\n };\n const schedule = () => {\n frame ??= view.requestAnimationFrame(measure);\n };\n const resize =\n typeof ResizeObserver !== 'undefined' ? new ResizeObserver(schedule) : undefined;\n resize?.observe(root, { box: 'border-box' });\n resize?.observe(footer, { box: 'border-box' });\n const visibility = new MutationObserver(schedule);\n visibility.observe(footer, {\n attributes: true,\n attributeFilter: ['hidden', 'class', 'style'],\n });\n view.addEventListener('scroll', schedule, true);\n view.addEventListener('resize', schedule);\n view.visualViewport?.addEventListener('scroll', schedule);\n view.visualViewport?.addEventListener('resize', schedule);\n measure();\n stopMobile = () => {\n if (frame !== undefined) view.cancelAnimationFrame(frame);\n resize?.disconnect();\n visibility.disconnect();\n view.removeEventListener('scroll', schedule, true);\n view.removeEventListener('resize', schedule);\n view.visualViewport?.removeEventListener('scroll', schedule);\n view.visualViewport?.removeEventListener('resize', schedule);\n };\n };\n media.addEventListener('change', start);\n start();\n return () => {\n media.removeEventListener('change', start);\n stopMobile?.();\n };\n}\n\nexport function sameFloatingFooterInset(a: FloatingFooterInset, b: FloatingFooterInset): boolean {\n return a === b || (!!a && !!b && a.boundary === b.boundary && a.bottom === b.bottom);\n}\n"]}
|
package/dist/es/lib/helpers.js
CHANGED
|
@@ -97,6 +97,27 @@ export const toFilterProperty = ({ blur } = {}) => {
|
|
|
97
97
|
};
|
|
98
98
|
/** The `data-*` attributes among a component's props, to pass on to its element. */
|
|
99
99
|
export const dataAttributes = (props) => Object.fromEntries(Object.entries(props).filter(([key]) => key.startsWith("data-")));
|
|
100
|
+
/**
|
|
101
|
+
* A copy of a key event that a handler can cancel. An event that reaches the Escape stack is already prevented, so
|
|
102
|
+
* its own `defaultPrevented` cannot tell whether an owner's handler asked to keep the overlay open. The copy keeps
|
|
103
|
+
* the key, the modifiers and the target.
|
|
104
|
+
*/
|
|
105
|
+
export const cancelableKeyCopy = (event) => {
|
|
106
|
+
const copy = new KeyboardEvent(event.type, {
|
|
107
|
+
key: event.key,
|
|
108
|
+
code: event.code,
|
|
109
|
+
location: event.location,
|
|
110
|
+
repeat: event.repeat,
|
|
111
|
+
isComposing: event.isComposing,
|
|
112
|
+
ctrlKey: event.ctrlKey,
|
|
113
|
+
shiftKey: event.shiftKey,
|
|
114
|
+
altKey: event.altKey,
|
|
115
|
+
metaKey: event.metaKey,
|
|
116
|
+
cancelable: true,
|
|
117
|
+
});
|
|
118
|
+
Object.defineProperty(copy, "target", { value: event.target });
|
|
119
|
+
return copy;
|
|
120
|
+
};
|
|
100
121
|
export const preventDefaultHandler = (evt) => {
|
|
101
122
|
evt.preventDefault();
|
|
102
123
|
};
|