@plexui/ui 0.29.0 → 0.31.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 +2 -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 +1 -1
- 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 +1 -3
- package/dist/es/components/Checkbox/Checkbox.js.map +1 -1
- package/dist/es/components/ColorPicker/ColorPicker.js +227 -0
- package/dist/es/components/ColorPicker/ColorPicker.js.map +1 -0
- package/dist/es/components/ColorPicker/ColorWell.js +58 -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 +164 -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 +57 -0
- package/dist/es/components/ContextMenu/shared.js.map +1 -0
- package/dist/es/components/DatePicker/DatePicker.js +4 -2
- package/dist/es/components/DatePicker/DatePicker.js.map +1 -1
- package/dist/es/components/DateRangePicker/DateRangePicker.js.map +1 -1
- package/dist/es/components/Dialog/Dialog.js +118 -24
- 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 +3 -3
- package/dist/es/components/Field/Field.js.map +1 -1
- package/dist/es/components/FieldGroup/FieldGroup.js +4 -2
- 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 +6 -0
- package/dist/es/components/Icon/svg/Eyedropper.js.map +1 -0
- package/dist/es/components/IndexBar/IndexBar.js +164 -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.map +1 -1
- package/dist/es/components/Input/Input.js +2 -2
- package/dist/es/components/Input/Input.js.map +1 -1
- package/dist/es/components/MarkdownEditor/MarkdownEditor.js +142 -1
- package/dist/es/components/MarkdownEditor/MarkdownEditor.js.map +1 -1
- package/dist/es/components/Menu/Menu.js +109 -29
- package/dist/es/components/Menu/Menu.js.map +1 -1
- package/dist/es/components/Page/Page.js +41 -14
- package/dist/es/components/Page/Page.js.map +1 -1
- package/dist/es/components/PageControl/PageControl.js +146 -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 +41 -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 +2 -1
- package/dist/es/components/Popover/Popover.js.map +1 -1
- package/dist/es/components/Select/Select.js +11 -6
- package/dist/es/components/Select/Select.js.map +1 -1
- package/dist/es/components/SelectControl/SelectControl.js +1 -1
- package/dist/es/components/SelectControl/SelectControl.js.map +1 -1
- package/dist/es/components/Sidebar/Sidebar.js +21 -8
- package/dist/es/components/Sidebar/Sidebar.js.map +1 -1
- package/dist/es/components/Slider/Slider.js +43 -8
- package/dist/es/components/Slider/Slider.js.map +1 -1
- package/dist/es/components/Stepper/Stepper.js +114 -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 +321 -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/TabBar/TabBar.js +128 -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 +13 -6
- package/dist/es/components/Tabs/Tabs.js.map +1 -1
- package/dist/es/components/TagInput/TagInput.js +5 -65
- package/dist/es/components/TagInput/TagInput.js.map +1 -1
- package/dist/es/components/Textarea/Textarea.js +1 -1
- package/dist/es/components/Textarea/Textarea.js.map +1 -1
- package/dist/es/components/Tip/Tip.js +106 -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 +22 -9
- 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 +31 -5
- package/dist/es/components/Toolbar/Toolbar.js.map +1 -1
- package/dist/es/components/Toolbar/index.js.map +1 -1
- package/dist/es/hooks/useEscCloseStack.js +10 -3
- package/dist/es/hooks/useEscCloseStack.js.map +1 -1
- package/dist/es/lib/fieldRow.js +7 -1
- 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 +8 -1
- package/dist/types/components/ButtonGroup/index.d.ts +1 -1
- package/dist/types/components/ColorPicker/ColorPicker.d.ts +34 -0
- package/dist/types/components/ColorPicker/ColorWell.d.ts +32 -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 +78 -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 +6 -1
- package/dist/types/components/DateRangePicker/DateRangePicker.d.ts +1 -0
- package/dist/types/components/Dialog/Dialog.d.ts +52 -3
- 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 +11 -2
- package/dist/types/components/FieldGroup/FieldGroup.d.ts +11 -2
- package/dist/types/components/Icon/index.d.ts +1 -0
- package/dist/types/components/Icon/svg/Eyedropper.d.ts +6 -0
- package/dist/types/components/IndexBar/IndexBar.d.ts +35 -0
- package/dist/types/components/IndexBar/index.d.ts +1 -0
- package/dist/types/components/Indicator/LoadingIndicator.d.ts +1 -1
- package/dist/types/components/Menu/Menu.d.ts +79 -10
- package/dist/types/components/Page/Page.d.ts +8 -4
- package/dist/types/components/PageControl/PageControl.d.ts +52 -0
- package/dist/types/components/PageControl/index.d.ts +1 -0
- package/dist/types/components/PhoneLayout/PhoneLayout.d.ts +18 -0
- package/dist/types/components/PhoneLayout/index.d.ts +1 -0
- package/dist/types/components/Select/Select.d.ts +3 -3
- package/dist/types/components/Stepper/Stepper.d.ts +56 -0
- package/dist/types/components/Stepper/index.d.ts +1 -0
- package/dist/types/components/SwipeActions/SwipeActions.d.ts +46 -0
- package/dist/types/components/SwipeActions/index.d.ts +1 -0
- package/dist/types/components/TabBar/TabBar.d.ts +88 -0
- package/dist/types/components/TabBar/index.d.ts +1 -0
- package/dist/types/components/Tip/Tip.d.ts +57 -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 +19 -5
- package/dist/types/components/Toolbar/index.d.ts +1 -1
- package/dist/types/hooks/useEscCloseStack.d.ts +5 -1
- package/dist/types/lib/fieldRow.d.ts +6 -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,6 +1,6 @@
|
|
|
1
1
|
const clamp = (value, minimum, maximum) => Math.max(minimum, Math.min(maximum, value));
|
|
2
2
|
const round = (value) => Math.round(value * 1000) / 1000;
|
|
3
|
-
export function solvePhoneSubmenuPlacement({ boundary, trigger, parent, width, height, paddingTop, direction, }) {
|
|
3
|
+
export function solvePhoneSubmenuPlacement({ boundary, trigger, parent, reference = trigger, width, height, paddingTop, direction, }) {
|
|
4
4
|
if (width <= 0 || height <= 0 || boundary.right <= boundary.left || boundary.bottom <= boundary.top)
|
|
5
5
|
return null;
|
|
6
6
|
// CSS caps the measured panel against this same rectangle. Do not paint an
|
|
@@ -10,10 +10,35 @@ export function solvePhoneSubmenuPlacement({ boundary, trigger, parent, width, h
|
|
|
10
10
|
const left = clamp(direction === "rtl" ? parent.right - width : parent.left, boundary.left, Math.max(boundary.left, boundary.right - width));
|
|
11
11
|
const top = clamp(trigger.top - paddingTop, boundary.top, Math.max(boundary.top, boundary.bottom - height));
|
|
12
12
|
return {
|
|
13
|
-
sideOffset: round(direction === "rtl" ?
|
|
14
|
-
alignOffset: round(top -
|
|
13
|
+
sideOffset: round(direction === "rtl" ? reference.left - width - left : left - reference.right),
|
|
14
|
+
alignOffset: round(top - reference.top),
|
|
15
15
|
};
|
|
16
16
|
}
|
|
17
|
+
/**
|
|
18
|
+
* The boxes of a parent menu and of the row that opened a submenu at rest. While a phone submenu stands over it the
|
|
19
|
+
* parent steps back with the CSS `scale` property (Menu.module.css, iOS-menu IMG_5677), and the submenu keeps the
|
|
20
|
+
* parent's resting box, as the native one does: undo that scale around the parent's transform origin, at whatever
|
|
21
|
+
* value its transition has reached.
|
|
22
|
+
*/
|
|
23
|
+
export function readRestingMenuRects(parent, trigger) {
|
|
24
|
+
const parentRect = parent.getBoundingClientRect();
|
|
25
|
+
const triggerRect = trigger.getBoundingClientRect();
|
|
26
|
+
const view = parent.ownerDocument.defaultView;
|
|
27
|
+
const style = view?.getComputedStyle(parent);
|
|
28
|
+
const scale = Number.parseFloat(style?.scale ?? "");
|
|
29
|
+
if (!style || !Number.isFinite(scale) || scale <= 0 || scale === 1)
|
|
30
|
+
return { parent: parentRect, trigger: triggerRect, reference: triggerRect };
|
|
31
|
+
const [originX = 0, originY = 0] = style.transformOrigin.split(" ").map((value) => Number.parseFloat(value) || 0);
|
|
32
|
+
const x = parentRect.left + originX * scale;
|
|
33
|
+
const y = parentRect.top + originY * scale;
|
|
34
|
+
const rest = (rect) => ({
|
|
35
|
+
left: x + (rect.left - x) / scale,
|
|
36
|
+
top: y + (rect.top - y) / scale,
|
|
37
|
+
right: x + (rect.right - x) / scale,
|
|
38
|
+
bottom: y + (rect.bottom - y) / scale,
|
|
39
|
+
});
|
|
40
|
+
return { parent: rest(parentRect), trigger: rest(triggerRect), reference: triggerRect };
|
|
41
|
+
}
|
|
17
42
|
/** Consume boundary91's resolved footer padding; never subtract the footer again. */
|
|
18
43
|
export function readMenuBoundaryRect(document, boundary) {
|
|
19
44
|
const view = document.defaultView;
|
|
@@ -54,6 +79,9 @@ function visibleText(element, includeHidden = false) {
|
|
|
54
79
|
return "";
|
|
55
80
|
if (["SCRIPT", "STYLE", "TEMPLATE"].includes(element.tagName))
|
|
56
81
|
return "";
|
|
82
|
+
// A row's second line (Sort By over "Manual") is its value, not its name
|
|
83
|
+
if (element.hasAttribute("data-menu-description"))
|
|
84
|
+
return "";
|
|
57
85
|
const style = view.getComputedStyle(element);
|
|
58
86
|
if (!includeHidden && (style.display === "none" || style.visibility === "hidden" || style.visibility === "collapse"))
|
|
59
87
|
return "";
|
|
@@ -135,6 +163,7 @@ export function observePhoneSubmenu(trigger, content, boundary, update) {
|
|
|
135
163
|
return;
|
|
136
164
|
if (!(media?.matches ?? view.innerWidth <= 767)) {
|
|
137
165
|
clearPhone();
|
|
166
|
+
parent.removeAttribute("data-submenu-over");
|
|
138
167
|
update({ mobile: false });
|
|
139
168
|
return;
|
|
140
169
|
}
|
|
@@ -150,10 +179,12 @@ export function observePhoneSubmenu(trigger, content, boundary, update) {
|
|
|
150
179
|
const width = content.offsetWidth;
|
|
151
180
|
const height = content.offsetHeight;
|
|
152
181
|
const hasHeader = !!content.querySelector("[data-submenu-collapse]");
|
|
182
|
+
const resting = readRestingMenuRects(parent, trigger);
|
|
153
183
|
const placement = solvePhoneSubmenuPlacement({
|
|
154
184
|
boundary: available,
|
|
155
|
-
trigger: trigger
|
|
156
|
-
parent: parent
|
|
185
|
+
trigger: resting.trigger,
|
|
186
|
+
parent: resting.parent,
|
|
187
|
+
reference: resting.reference,
|
|
157
188
|
width,
|
|
158
189
|
height,
|
|
159
190
|
paddingTop: Number.parseFloat(style.paddingTop) || 0,
|
|
@@ -173,6 +204,11 @@ export function observePhoneSubmenu(trigger, content, boundary, update) {
|
|
|
173
204
|
content.setAttribute("data-submenu-unavailable", "");
|
|
174
205
|
else
|
|
175
206
|
content.removeAttribute("data-submenu-unavailable");
|
|
207
|
+
// The parent steps back while the submenu stands over it (Menu.module.css), not while it has nowhere to stand
|
|
208
|
+
if (ready)
|
|
209
|
+
parent.setAttribute("data-submenu-over", "");
|
|
210
|
+
else
|
|
211
|
+
parent.removeAttribute("data-submenu-over");
|
|
176
212
|
update({ mobile: true, ready, unavailable, label, ...(placement ?? { sideOffset: 0, alignOffset: 0 }) });
|
|
177
213
|
// A parent's enter transform moves its child trigger without resizing it.
|
|
178
214
|
// Follow only that running transition, not an idle menu forever.
|
|
@@ -212,7 +248,16 @@ export function observePhoneSubmenu(trigger, content, boundary, update) {
|
|
|
212
248
|
view.removeEventListener("resize", schedule);
|
|
213
249
|
view.visualViewport?.removeEventListener("scroll", schedule);
|
|
214
250
|
view.visualViewport?.removeEventListener("resize", schedule);
|
|
215
|
-
// Retained transition nodes keep their last geometry through exit
|
|
251
|
+
// Retained transition nodes keep their last geometry through exit, and a parent that leaves with its submenu
|
|
252
|
+
// leaves stepped back. A choice in the submenu closes it before the whole menu starts to leave, so the parent
|
|
253
|
+
// steps forward a frame later, unless by then it is leaving or another of its submenus stands over it.
|
|
254
|
+
view.requestAnimationFrame(() => {
|
|
255
|
+
if (parent.closest("[data-exiting]") || parent.getAttribute("data-state") === "closed")
|
|
256
|
+
return;
|
|
257
|
+
if (parent.querySelector('[aria-expanded="true"]'))
|
|
258
|
+
return;
|
|
259
|
+
parent.removeAttribute("data-submenu-over");
|
|
260
|
+
});
|
|
216
261
|
},
|
|
217
262
|
};
|
|
218
263
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"menuSubmenuPlacement.js","sourceRoot":"","sources":["../../../src/lib/menuSubmenuPlacement.ts"],"names":[],"mappings":"AASA,MAAM,KAAK,GAAG,CAAC,KAAa,EAAE,OAAe,EAAE,OAAe,EAAE,EAAE,CAChE,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC,CAAA;AAC7C,MAAM,KAAK,GAAG,CAAC,KAAa,EAAE,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,IAAI,CAAC,GAAG,IAAI,CAAA;AAEhE,MAAM,UAAU,0BAA0B,CAAC,EACzC,QAAQ,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,SAAS,GAShE;IACC,IAAI,KAAK,IAAI,CAAC,IAAI,MAAM,IAAI,CAAC,IAAI,QAAQ,CAAC,KAAK,IAAI,QAAQ,CAAC,IAAI,IAAI,QAAQ,CAAC,MAAM,IAAI,QAAQ,CAAC,GAAG;QAAE,OAAO,IAAI,CAAA;IAChH,2EAA2E;IAC3E,+DAA+D;IAC/D,IAAI,KAAK,GAAG,QAAQ,CAAC,KAAK,GAAG,QAAQ,CAAC,IAAI,GAAG,CAAC,IAAI,MAAM,GAAG,QAAQ,CAAC,MAAM,GAAG,QAAQ,CAAC,GAAG,GAAG,CAAC;QAAE,OAAO,IAAI,CAAA;IAC1G,MAAM,IAAI,GAAG,KAAK,CAAC,SAAS,KAAK,KAAK,CAAC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AI,CAAC,oBAAoB,CAAC,KAAK,CAAC,CAAA;YACzD,MAAM,EAAE,UAAU,EAAE,CAAA;YACpB,SAAS,CAAC,UAAU,EAAE,CAAA;YACtB,aAAa,CAAC,UAAU,EAAE,CAAA;YAC1B,KAAK,EAAE,mBAAmB,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAA;YAC7C,IAAI,CAAC,mBAAmB,CAAC,QAAQ,EAAE,QAAQ,EAAE,IAAI,CAAC,CAAA;YAClD,IAAI,CAAC,mBAAmB,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAA;YAC5C,IAAI,CAAC,cAAc,EAAE,mBAAmB,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAA;YAC5D,IAAI,CAAC,cAAc,EAAE,mBAAmB,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAA;YAC5D,mEAAmE;QACrE,CAAC;KACF,CAAA;AACH,CAAC","sourcesContent":["/** Phone submenu geometry; desktop continues to use the primitive's cascade. */\nexport type MenuRect = { left: number; top: number; right: number; bottom: number }\nexport type MenuCollisionPadding = Partial<Record<\"top\" | \"right\" | \"bottom\" | \"left\", number>>\nexport type MenuFloatingBoundary = { collisionBoundary?: HTMLElement; collisionPadding: MenuCollisionPadding }\nexport type PhoneSubmenuPlacement = { sideOffset: number; alignOffset: number }\nexport type PhoneSubmenuState =\n | { mobile: false }\n | ({ mobile: true; ready: boolean; unavailable: boolean; label: string } & PhoneSubmenuPlacement)\n\nconst clamp = (value: number, minimum: number, maximum: number) =>\n Math.max(minimum, Math.min(maximum, value))\nconst round = (value: number) => Math.round(value * 1000) / 1000\n\nexport function solvePhoneSubmenuPlacement({\n boundary, trigger, parent, width, height, paddingTop, direction,\n}: {\n boundary: MenuRect\n trigger: MenuRect\n parent: MenuRect\n width: number\n height: number\n paddingTop: number\n direction: \"ltr\" | \"rtl\"\n}): PhoneSubmenuPlacement | null {\n if (width <= 0 || height <= 0 || boundary.right <= boundary.left || boundary.bottom <= boundary.top) return null\n // CSS caps the measured panel against this same rectangle. Do not paint an\n // oversized panel if that contract has not reached layout yet.\n if (width > boundary.right - boundary.left + 1 || height > boundary.bottom - boundary.top + 1) return null\n const left = clamp(direction === \"rtl\" ? parent.right - width : parent.left, boundary.left, Math.max(boundary.left, boundary.right - width))\n const top = clamp(trigger.top - paddingTop, boundary.top, Math.max(boundary.top, boundary.bottom - height))\n return {\n sideOffset: round(direction === \"rtl\" ? trigger.left - width - left : left - trigger.right),\n alignOffset: round(top - trigger.top),\n }\n}\n\n/** Consume boundary91's resolved footer padding; never subtract the footer again. */\nexport function readMenuBoundaryRect(document: Document, boundary: MenuFloatingBoundary): MenuRect | null {\n const view = document.defaultView\n if (!view) return null\n const viewport = view.visualViewport\n let left = viewport?.offsetLeft ?? 0\n let top = viewport?.offsetTop ?? 0\n let right = left + (viewport?.width ?? document.documentElement.clientWidth)\n let bottom = top + (viewport?.height ?? document.documentElement.clientHeight)\n const element = boundary.collisionBoundary\n if (element?.isConnected && element.ownerDocument === document) {\n const rect = element.getBoundingClientRect()\n const scaleX = element.offsetWidth > 0 ? rect.width / element.offsetWidth : 1\n const scaleY = element.offsetHeight > 0 ? rect.height / element.offsetHeight : 1\n const clientLeft = rect.left + element.clientLeft * scaleX\n const clientTop = rect.top + element.clientTop * scaleY\n left = Math.max(left, clientLeft)\n top = Math.max(top, clientTop)\n right = Math.min(right, clientLeft + element.clientWidth * scaleX)\n bottom = Math.min(bottom, clientTop + element.clientHeight * scaleY)\n }\n const padding = boundary.collisionPadding\n return {\n left: left + (padding.left ?? 0),\n top: top + (padding.top ?? 0),\n right: right - (padding.right ?? 0),\n bottom: bottom - (padding.bottom ?? 0),\n }\n}\n\nconst normalizeLabel = (value: string) => value.replace(/\\s+/g, \" \").trim()\n\nfunction visibleText(element: Element, includeHidden = false): string {\n const view = element.ownerDocument.defaultView\n if (!view) return \"\"\n // Explicit aria-labelledby targets can supply a name while visually hidden.\n if (!includeHidden && (element.hasAttribute(\"hidden\") || element.getAttribute(\"aria-hidden\") === \"true\")) return \"\"\n if ([\"SCRIPT\", \"STYLE\", \"TEMPLATE\"].includes(element.tagName)) return \"\"\n const style = view.getComputedStyle(element)\n if (!includeHidden && (style.display === \"none\" || style.visibility === \"hidden\" || style.visibility === \"collapse\")) return \"\"\n const ownLabel = element.getAttribute(\"aria-label\")\n if (ownLabel?.trim()) return ownLabel\n if (element.tagName === \"IMG\") return element.getAttribute(\"alt\") ?? \"\"\n return Array.from(element.childNodes).map((node) => {\n if (node.nodeType === 3) return node.textContent ?? \"\"\n return node instanceof view.Element ? visibleText(node, includeHidden) : \"\"\n }).join(\"\")\n}\n\nfunction labelReferences(trigger: HTMLElement): Element[] {\n return (trigger.getAttribute(\"aria-labelledby\") ?? \"\").split(/\\s+/).filter(Boolean)\n .map((id) => trigger.ownerDocument.getElementById(id)).filter((element): element is HTMLElement => element !== null)\n}\n\n/** A text snapshot, never a clone of a consumer's rich children or their IDs. */\nexport function readMenuTriggerLabel(trigger: HTMLElement): string {\n const referenced = normalizeLabel(labelReferences(trigger).map((element) => visibleText(element, true)).join(\" \"))\n if (referenced) return referenced\n const labelled = normalizeLabel(trigger.getAttribute(\"aria-label\") ?? \"\")\n if (labelled) return labelled\n return normalizeLabel(visibleText(trigger)) || \"Collapse submenu\"\n}\n\nexport function focusPhoneSubmenuEntry(content: HTMLElement): void {\n const items = Array.from(content.querySelectorAll<HTMLElement>('[role=\"menuitem\"], [role=\"menuitemcheckbox\"], [role=\"menuitemradio\"]'))\n .filter((item) => item.closest('[role=\"menu\"]') === content && !item.hasAttribute(\"data-disabled\") && item.getAttribute(\"aria-disabled\") !== \"true\")\n const target = items.find((item) => !item.hasAttribute(\"data-submenu-collapse\")) ?? items[0]\n target?.focus({ preventScroll: true })\n}\n\nexport function samePhoneSubmenuState(a: PhoneSubmenuState, b: PhoneSubmenuState): boolean {\n return a.mobile === b.mobile && (!a.mobile || !b.mobile ||\n (a.ready === b.ready && a.unavailable === b.unavailable && a.label === b.label && a.sideOffset === b.sideOffset && a.alignOffset === b.alignOffset))\n}\n\n/** Own only these Phone attributes/variables. Primitive focus and dismissal stay intact. */\nexport function observePhoneSubmenu(\n trigger: HTMLElement,\n content: HTMLElement,\n boundary: MenuFloatingBoundary,\n update: (state: PhoneSubmenuState) => void,\n): { refresh: () => void; dispose: () => void } {\n const view = content.ownerDocument.defaultView\n if (!view || trigger.ownerDocument !== content.ownerDocument) return { refresh: () => {}, dispose: () => {} }\n const parent = trigger.closest('[role=\"menu\"]')\n if (!(parent instanceof view.HTMLElement)) return { refresh: () => {}, dispose: () => {} }\n const media = typeof view.matchMedia === \"function\" ? view.matchMedia(\"(max-width: 767px)\") : null\n let disposed = false\n let frame: number | undefined\n let references: Element[] = []\n const setVariable = (name: string, value: number) => {\n const next = `${round(Math.max(0, value))}px`\n if (content.style.getPropertyValue(name) !== next) content.style.setProperty(name, next)\n }\n const clearPhone = () => {\n content.removeAttribute(\"data-submenu-phone\")\n content.removeAttribute(\"data-submenu-positioned\")\n content.removeAttribute(\"data-submenu-unavailable\")\n content.style.removeProperty(\"--menu-phone-max-width\")\n content.style.removeProperty(\"--menu-phone-max-height\")\n }\n const labelObserver = new view.MutationObserver(() => schedule())\n const updateLabelTargets = () => {\n const next = labelReferences(trigger)\n if (next.length === references.length && next.every((element, index) => element === references[index])) return\n references = next\n labelObserver.disconnect()\n for (const element of references) {\n labelObserver.observe(element, { childList: true, characterData: true, subtree: true, attributes: true })\n // A localized label can be replaced while retaining its public ID.\n if (element.parentElement) labelObserver.observe(element.parentElement, { childList: true })\n }\n }\n const refresh = () => {\n if (disposed) return\n if (!(media?.matches ?? view.innerWidth <= 767)) {\n clearPhone()\n update({ mobile: false })\n return\n }\n content.setAttribute(\"data-submenu-phone\", \"\")\n updateLabelTargets()\n const label = readMenuTriggerLabel(trigger)\n const available = readMenuBoundaryRect(content.ownerDocument, boundary)\n if (!available) return\n setVariable(\"--menu-phone-max-width\", available.right - available.left)\n setVariable(\"--menu-phone-max-height\", available.bottom - available.top)\n const style = view.getComputedStyle(content)\n const width = content.offsetWidth\n const height = content.offsetHeight\n const hasHeader = !!content.querySelector(\"[data-submenu-collapse]\")\n const placement = solvePhoneSubmenuPlacement({\n boundary: available,\n trigger: trigger.getBoundingClientRect(),\n parent: parent.getBoundingClientRect(),\n width,\n height,\n paddingTop: Number.parseFloat(style.paddingTop) || 0,\n direction: style.direction === \"rtl\" ? \"rtl\" : \"ltr\",\n })\n // Wait for the header and real geometry, never flash the desktop cascade.\n const ready = !!placement && hasHeader\n // Header/zero-layout are still pending. After the CSS caps and header are\n // present, an empty boundary or measured overflow has no valid placement.\n const emptyBoundary = available.right <= available.left || available.bottom <= available.top\n const unavailable = hasHeader && !placement && (emptyBoundary || (width > 0 && height > 0))\n if (ready) content.setAttribute(\"data-submenu-positioned\", \"\")\n else content.removeAttribute(\"data-submenu-positioned\")\n if (unavailable) content.setAttribute(\"data-submenu-unavailable\", \"\")\n else content.removeAttribute(\"data-submenu-unavailable\")\n update({ mobile: true, ready, unavailable, label, ...(placement ?? { sideOffset: 0, alignOffset: 0 }) })\n // A parent's enter transform moves its child trigger without resizing it.\n // Follow only that running transition, not an idle menu forever.\n if (typeof parent.getAnimations === \"function\" && parent.getAnimations().some((animation) => animation.playState === \"running\")) schedule()\n }\n const schedule = () => {\n if (!disposed && frame === undefined) frame = view.requestAnimationFrame(() => { frame = undefined; refresh() })\n }\n const resize = typeof view.ResizeObserver === \"function\" ? new view.ResizeObserver(schedule) : undefined\n for (const element of [trigger, parent, content, boundary.collisionBoundary]) if (element) resize?.observe(element)\n const mutations = new view.MutationObserver(schedule)\n mutations.observe(trigger, { attributes: true, characterData: true, childList: true, subtree: true })\n mutations.observe(parent, { attributes: true, attributeFilter: [\"class\", \"style\"] })\n if (parent.parentElement) mutations.observe(parent.parentElement, { attributes: true, attributeFilter: [\"class\", \"style\", \"data-entering\", \"data-entering-active\"] })\n media?.addEventListener(\"change\", refresh)\n view.addEventListener(\"scroll\", schedule, true)\n view.addEventListener(\"resize\", schedule)\n view.visualViewport?.addEventListener(\"scroll\", schedule)\n view.visualViewport?.addEventListener(\"resize\", schedule)\n refresh()\n return {\n refresh,\n dispose: () => {\n disposed = true\n if (frame !== undefined) view.cancelAnimationFrame(frame)\n resize?.disconnect()\n mutations.disconnect()\n labelObserver.disconnect()\n media?.removeEventListener(\"change\", refresh)\n view.removeEventListener(\"scroll\", schedule, true)\n view.removeEventListener(\"resize\", schedule)\n view.visualViewport?.removeEventListener(\"scroll\", schedule)\n view.visualViewport?.removeEventListener(\"resize\", schedule)\n // Retained transition nodes keep their last geometry through exit.\n },\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"menuSubmenuPlacement.js","sourceRoot":"","sources":["../../../src/lib/menuSubmenuPlacement.ts"],"names":[],"mappings":"AASA,MAAM,KAAK,GAAG,CAAC,KAAa,EAAE,OAAe,EAAE,OAAe,EAAE,EAAE,CAChE,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC,CAAA;AAC7C,MAAM,KAAK,GAAG,CAAC,KAAa,EAAE,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,IAAI,CAAC,GAAG,IAAI,CAAA;AAEhE,MAAM,UAAU,0BAA0B,CAAC,EACzC,QAAQ,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS,GAAG,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,SAAS,GAWrF;IACC,IAAI,KAAK,IAAI,CAAC,IAAI,MAAM,IAAI,CAAC,IAAI,QAAQ,CAAC,KAAK,IAAI,QAAQ,CAAC,IAAI,IAAI,QAAQ,CAAC,MAAM,IAAI,QAAQ,CAAC,GAAG;QAAE,OAAO,IAAI,CAAA;IAChH,2EAA2E;IAC3E,+DAA+D;IAC/D,IAAI,KAAK,GAAG,QAAQ,CAAC,KAAK,GAAG,QAAQ,CAAC,IAAI,GAAG,CAAC,IAAI,MAAM,GAAG,QA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,mBAAmB,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAA;YAC5D,IAAI,CAAC,cAAc,EAAE,mBAAmB,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAA;YAC5D,6GAA6G;YAC7G,8GAA8G;YAC9G,uGAAuG;YACvG,IAAI,CAAC,qBAAqB,CAAC,GAAG,EAAE;gBAC9B,IAAI,MAAM,CAAC,OAAO,CAAC,gBAAgB,CAAC,IAAI,MAAM,CAAC,YAAY,CAAC,YAAY,CAAC,KAAK,QAAQ;oBAAE,OAAM;gBAC9F,IAAI,MAAM,CAAC,aAAa,CAAC,wBAAwB,CAAC;oBAAE,OAAM;gBAC1D,MAAM,CAAC,eAAe,CAAC,mBAAmB,CAAC,CAAA;YAC7C,CAAC,CAAC,CAAA;QACJ,CAAC;KACF,CAAA;AACH,CAAC","sourcesContent":["/** Phone submenu geometry; desktop continues to use the primitive's cascade. */\nexport type MenuRect = { left: number; top: number; right: number; bottom: number }\nexport type MenuCollisionPadding = Partial<Record<\"top\" | \"right\" | \"bottom\" | \"left\", number>>\nexport type MenuFloatingBoundary = { collisionBoundary?: HTMLElement; collisionPadding: MenuCollisionPadding }\nexport type PhoneSubmenuPlacement = { sideOffset: number; alignOffset: number }\nexport type PhoneSubmenuState =\n | { mobile: false }\n | ({ mobile: true; ready: boolean; unavailable: boolean; label: string } & PhoneSubmenuPlacement)\n\nconst clamp = (value: number, minimum: number, maximum: number) =>\n Math.max(minimum, Math.min(maximum, value))\nconst round = (value: number) => Math.round(value * 1000) / 1000\n\nexport function solvePhoneSubmenuPlacement({\n boundary, trigger, parent, reference = trigger, width, height, paddingTop, direction,\n}: {\n boundary: MenuRect\n trigger: MenuRect\n parent: MenuRect\n /** The row's box as the primitive measures it, when the parent steps back (`readRestingMenuRects`) */\n reference?: MenuRect\n width: number\n height: number\n paddingTop: number\n direction: \"ltr\" | \"rtl\"\n}): PhoneSubmenuPlacement | null {\n if (width <= 0 || height <= 0 || boundary.right <= boundary.left || boundary.bottom <= boundary.top) return null\n // CSS caps the measured panel against this same rectangle. Do not paint an\n // oversized panel if that contract has not reached layout yet.\n if (width > boundary.right - boundary.left + 1 || height > boundary.bottom - boundary.top + 1) return null\n const left = clamp(direction === \"rtl\" ? parent.right - width : parent.left, boundary.left, Math.max(boundary.left, boundary.right - width))\n const top = clamp(trigger.top - paddingTop, boundary.top, Math.max(boundary.top, boundary.bottom - height))\n return {\n sideOffset: round(direction === \"rtl\" ? reference.left - width - left : left - reference.right),\n alignOffset: round(top - reference.top),\n }\n}\n\n/**\n * The boxes of a parent menu and of the row that opened a submenu at rest. While a phone submenu stands over it the\n * parent steps back with the CSS `scale` property (Menu.module.css, iOS-menu IMG_5677), and the submenu keeps the\n * parent's resting box, as the native one does: undo that scale around the parent's transform origin, at whatever\n * value its transition has reached.\n */\nexport function readRestingMenuRects(parent: HTMLElement, trigger: HTMLElement): { parent: MenuRect; trigger: MenuRect; reference: MenuRect } {\n const parentRect = parent.getBoundingClientRect()\n const triggerRect = trigger.getBoundingClientRect()\n const view = parent.ownerDocument.defaultView\n const style = view?.getComputedStyle(parent)\n const scale = Number.parseFloat(style?.scale ?? \"\")\n if (!style || !Number.isFinite(scale) || scale <= 0 || scale === 1) return { parent: parentRect, trigger: triggerRect, reference: triggerRect }\n const [originX = 0, originY = 0] = style.transformOrigin.split(\" \").map((value) => Number.parseFloat(value) || 0)\n const x = parentRect.left + originX * scale\n const y = parentRect.top + originY * scale\n const rest = (rect: MenuRect): MenuRect => ({\n left: x + (rect.left - x) / scale,\n top: y + (rect.top - y) / scale,\n right: x + (rect.right - x) / scale,\n bottom: y + (rect.bottom - y) / scale,\n })\n return { parent: rest(parentRect), trigger: rest(triggerRect), reference: triggerRect }\n}\n\n/** Consume boundary91's resolved footer padding; never subtract the footer again. */\nexport function readMenuBoundaryRect(document: Document, boundary: MenuFloatingBoundary): MenuRect | null {\n const view = document.defaultView\n if (!view) return null\n const viewport = view.visualViewport\n let left = viewport?.offsetLeft ?? 0\n let top = viewport?.offsetTop ?? 0\n let right = left + (viewport?.width ?? document.documentElement.clientWidth)\n let bottom = top + (viewport?.height ?? document.documentElement.clientHeight)\n const element = boundary.collisionBoundary\n if (element?.isConnected && element.ownerDocument === document) {\n const rect = element.getBoundingClientRect()\n const scaleX = element.offsetWidth > 0 ? rect.width / element.offsetWidth : 1\n const scaleY = element.offsetHeight > 0 ? rect.height / element.offsetHeight : 1\n const clientLeft = rect.left + element.clientLeft * scaleX\n const clientTop = rect.top + element.clientTop * scaleY\n left = Math.max(left, clientLeft)\n top = Math.max(top, clientTop)\n right = Math.min(right, clientLeft + element.clientWidth * scaleX)\n bottom = Math.min(bottom, clientTop + element.clientHeight * scaleY)\n }\n const padding = boundary.collisionPadding\n return {\n left: left + (padding.left ?? 0),\n top: top + (padding.top ?? 0),\n right: right - (padding.right ?? 0),\n bottom: bottom - (padding.bottom ?? 0),\n }\n}\n\nconst normalizeLabel = (value: string) => value.replace(/\\s+/g, \" \").trim()\n\nfunction visibleText(element: Element, includeHidden = false): string {\n const view = element.ownerDocument.defaultView\n if (!view) return \"\"\n // Explicit aria-labelledby targets can supply a name while visually hidden.\n if (!includeHidden && (element.hasAttribute(\"hidden\") || element.getAttribute(\"aria-hidden\") === \"true\")) return \"\"\n if ([\"SCRIPT\", \"STYLE\", \"TEMPLATE\"].includes(element.tagName)) return \"\"\n // A row's second line (Sort By over \"Manual\") is its value, not its name\n if (element.hasAttribute(\"data-menu-description\")) return \"\"\n const style = view.getComputedStyle(element)\n if (!includeHidden && (style.display === \"none\" || style.visibility === \"hidden\" || style.visibility === \"collapse\")) return \"\"\n const ownLabel = element.getAttribute(\"aria-label\")\n if (ownLabel?.trim()) return ownLabel\n if (element.tagName === \"IMG\") return element.getAttribute(\"alt\") ?? \"\"\n return Array.from(element.childNodes).map((node) => {\n if (node.nodeType === 3) return node.textContent ?? \"\"\n return node instanceof view.Element ? visibleText(node, includeHidden) : \"\"\n }).join(\"\")\n}\n\nfunction labelReferences(trigger: HTMLElement): Element[] {\n return (trigger.getAttribute(\"aria-labelledby\") ?? \"\").split(/\\s+/).filter(Boolean)\n .map((id) => trigger.ownerDocument.getElementById(id)).filter((element): element is HTMLElement => element !== null)\n}\n\n/** A text snapshot, never a clone of a consumer's rich children or their IDs. */\nexport function readMenuTriggerLabel(trigger: HTMLElement): string {\n const referenced = normalizeLabel(labelReferences(trigger).map((element) => visibleText(element, true)).join(\" \"))\n if (referenced) return referenced\n const labelled = normalizeLabel(trigger.getAttribute(\"aria-label\") ?? \"\")\n if (labelled) return labelled\n return normalizeLabel(visibleText(trigger)) || \"Collapse submenu\"\n}\n\nexport function focusPhoneSubmenuEntry(content: HTMLElement): void {\n const items = Array.from(content.querySelectorAll<HTMLElement>('[role=\"menuitem\"], [role=\"menuitemcheckbox\"], [role=\"menuitemradio\"]'))\n .filter((item) => item.closest('[role=\"menu\"]') === content && !item.hasAttribute(\"data-disabled\") && item.getAttribute(\"aria-disabled\") !== \"true\")\n const target = items.find((item) => !item.hasAttribute(\"data-submenu-collapse\")) ?? items[0]\n target?.focus({ preventScroll: true })\n}\n\nexport function samePhoneSubmenuState(a: PhoneSubmenuState, b: PhoneSubmenuState): boolean {\n return a.mobile === b.mobile && (!a.mobile || !b.mobile ||\n (a.ready === b.ready && a.unavailable === b.unavailable && a.label === b.label && a.sideOffset === b.sideOffset && a.alignOffset === b.alignOffset))\n}\n\n/** Own only these Phone attributes/variables. Primitive focus and dismissal stay intact. */\nexport function observePhoneSubmenu(\n trigger: HTMLElement,\n content: HTMLElement,\n boundary: MenuFloatingBoundary,\n update: (state: PhoneSubmenuState) => void,\n): { refresh: () => void; dispose: () => void } {\n const view = content.ownerDocument.defaultView\n if (!view || trigger.ownerDocument !== content.ownerDocument) return { refresh: () => {}, dispose: () => {} }\n const parent = trigger.closest('[role=\"menu\"]')\n if (!(parent instanceof view.HTMLElement)) return { refresh: () => {}, dispose: () => {} }\n const media = typeof view.matchMedia === \"function\" ? view.matchMedia(\"(max-width: 767px)\") : null\n let disposed = false\n let frame: number | undefined\n let references: Element[] = []\n const setVariable = (name: string, value: number) => {\n const next = `${round(Math.max(0, value))}px`\n if (content.style.getPropertyValue(name) !== next) content.style.setProperty(name, next)\n }\n const clearPhone = () => {\n content.removeAttribute(\"data-submenu-phone\")\n content.removeAttribute(\"data-submenu-positioned\")\n content.removeAttribute(\"data-submenu-unavailable\")\n content.style.removeProperty(\"--menu-phone-max-width\")\n content.style.removeProperty(\"--menu-phone-max-height\")\n }\n const labelObserver = new view.MutationObserver(() => schedule())\n const updateLabelTargets = () => {\n const next = labelReferences(trigger)\n if (next.length === references.length && next.every((element, index) => element === references[index])) return\n references = next\n labelObserver.disconnect()\n for (const element of references) {\n labelObserver.observe(element, { childList: true, characterData: true, subtree: true, attributes: true })\n // A localized label can be replaced while retaining its public ID.\n if (element.parentElement) labelObserver.observe(element.parentElement, { childList: true })\n }\n }\n const refresh = () => {\n if (disposed) return\n if (!(media?.matches ?? view.innerWidth <= 767)) {\n clearPhone()\n parent.removeAttribute(\"data-submenu-over\")\n update({ mobile: false })\n return\n }\n content.setAttribute(\"data-submenu-phone\", \"\")\n updateLabelTargets()\n const label = readMenuTriggerLabel(trigger)\n const available = readMenuBoundaryRect(content.ownerDocument, boundary)\n if (!available) return\n setVariable(\"--menu-phone-max-width\", available.right - available.left)\n setVariable(\"--menu-phone-max-height\", available.bottom - available.top)\n const style = view.getComputedStyle(content)\n const width = content.offsetWidth\n const height = content.offsetHeight\n const hasHeader = !!content.querySelector(\"[data-submenu-collapse]\")\n const resting = readRestingMenuRects(parent, trigger)\n const placement = solvePhoneSubmenuPlacement({\n boundary: available,\n trigger: resting.trigger,\n parent: resting.parent,\n reference: resting.reference,\n width,\n height,\n paddingTop: Number.parseFloat(style.paddingTop) || 0,\n direction: style.direction === \"rtl\" ? \"rtl\" : \"ltr\",\n })\n // Wait for the header and real geometry, never flash the desktop cascade.\n const ready = !!placement && hasHeader\n // Header/zero-layout are still pending. After the CSS caps and header are\n // present, an empty boundary or measured overflow has no valid placement.\n const emptyBoundary = available.right <= available.left || available.bottom <= available.top\n const unavailable = hasHeader && !placement && (emptyBoundary || (width > 0 && height > 0))\n if (ready) content.setAttribute(\"data-submenu-positioned\", \"\")\n else content.removeAttribute(\"data-submenu-positioned\")\n if (unavailable) content.setAttribute(\"data-submenu-unavailable\", \"\")\n else content.removeAttribute(\"data-submenu-unavailable\")\n // The parent steps back while the submenu stands over it (Menu.module.css), not while it has nowhere to stand\n if (ready) parent.setAttribute(\"data-submenu-over\", \"\")\n else parent.removeAttribute(\"data-submenu-over\")\n update({ mobile: true, ready, unavailable, label, ...(placement ?? { sideOffset: 0, alignOffset: 0 }) })\n // A parent's enter transform moves its child trigger without resizing it.\n // Follow only that running transition, not an idle menu forever.\n if (typeof parent.getAnimations === \"function\" && parent.getAnimations().some((animation) => animation.playState === \"running\")) schedule()\n }\n const schedule = () => {\n if (!disposed && frame === undefined) frame = view.requestAnimationFrame(() => { frame = undefined; refresh() })\n }\n const resize = typeof view.ResizeObserver === \"function\" ? new view.ResizeObserver(schedule) : undefined\n for (const element of [trigger, parent, content, boundary.collisionBoundary]) if (element) resize?.observe(element)\n const mutations = new view.MutationObserver(schedule)\n mutations.observe(trigger, { attributes: true, characterData: true, childList: true, subtree: true })\n mutations.observe(parent, { attributes: true, attributeFilter: [\"class\", \"style\"] })\n if (parent.parentElement) mutations.observe(parent.parentElement, { attributes: true, attributeFilter: [\"class\", \"style\", \"data-entering\", \"data-entering-active\"] })\n media?.addEventListener(\"change\", refresh)\n view.addEventListener(\"scroll\", schedule, true)\n view.addEventListener(\"resize\", schedule)\n view.visualViewport?.addEventListener(\"scroll\", schedule)\n view.visualViewport?.addEventListener(\"resize\", schedule)\n refresh()\n return {\n refresh,\n dispose: () => {\n disposed = true\n if (frame !== undefined) view.cancelAnimationFrame(frame)\n resize?.disconnect()\n mutations.disconnect()\n labelObserver.disconnect()\n media?.removeEventListener(\"change\", refresh)\n view.removeEventListener(\"scroll\", schedule, true)\n view.removeEventListener(\"resize\", schedule)\n view.visualViewport?.removeEventListener(\"scroll\", schedule)\n view.visualViewport?.removeEventListener(\"resize\", schedule)\n // Retained transition nodes keep their last geometry through exit, and a parent that leaves with its submenu\n // leaves stepped back. A choice in the submenu closes it before the whole menu starts to leave, so the parent\n // steps forward a frame later, unless by then it is leaving or another of its submenus stands over it.\n view.requestAnimationFrame(() => {\n if (parent.closest(\"[data-exiting]\") || parent.getAttribute(\"data-state\") === \"closed\") return\n if (parent.querySelector('[aria-expanded=\"true\"]')) return\n parent.removeAttribute(\"data-submenu-over\")\n })\n },\n }\n}\n"]}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* On a phone a menu grows out of the control that opens it and covers it, as iOS 26 menus do: the panel's top is the
|
|
3
|
+
* control's top, or its bottom when the menu opens upward, and its aligned edge is the control's edge (iOS-menu
|
|
4
|
+
* IMG_5657 and IMG_5654, the More button of a top bar; IMG_5658, a button of a group; IMG_5649, the value of a form
|
|
5
|
+
* row; IMG_5675 opens upward over its row). It opens toward the larger part of the screen: downward from a control in
|
|
6
|
+
* the upper half, upward from one in the lower half even when it would fit below (IMG_5688, the Icon and List Size
|
|
7
|
+
* row of Files' View Options; IMG_5687, IMG_5689, and IMG_5693 from a bottom bar). Reports the side offset that puts
|
|
8
|
+
* the panel there, minus the control's height, and that side, while the screen is a phone, and `null` on a larger one,
|
|
9
|
+
* where the menu keeps its gap below the control.
|
|
10
|
+
*/
|
|
11
|
+
export function observeMenuTriggerCover(trigger, onChange) {
|
|
12
|
+
const view = trigger.ownerDocument.defaultView;
|
|
13
|
+
if (!view || typeof view.matchMedia !== "function") {
|
|
14
|
+
onChange(null);
|
|
15
|
+
return () => undefined;
|
|
16
|
+
}
|
|
17
|
+
const media = view.matchMedia("(max-width: 767px)");
|
|
18
|
+
let last;
|
|
19
|
+
const measure = () => {
|
|
20
|
+
let cover = null;
|
|
21
|
+
if (media.matches) {
|
|
22
|
+
const rect = trigger.getBoundingClientRect();
|
|
23
|
+
// The visible part of the screen: the layout viewport less a keyboard or a pinch zoom
|
|
24
|
+
const viewport = view.visualViewport;
|
|
25
|
+
const middle = (viewport?.offsetTop ?? 0) + (viewport?.height ?? view.innerHeight) / 2;
|
|
26
|
+
// The layout height: a pressed control may be scaled, and the panel covers its resting box
|
|
27
|
+
cover = { sideOffset: -trigger.offsetHeight, side: rect.top + rect.height / 2 > middle ? "top" : "bottom" };
|
|
28
|
+
}
|
|
29
|
+
const key = cover ? `${cover.sideOffset} ${cover.side}` : "";
|
|
30
|
+
if (key === last)
|
|
31
|
+
return;
|
|
32
|
+
last = key;
|
|
33
|
+
onChange(cover);
|
|
34
|
+
};
|
|
35
|
+
measure();
|
|
36
|
+
const resize = typeof ResizeObserver === "undefined" ? undefined : new ResizeObserver(measure);
|
|
37
|
+
resize?.observe(trigger);
|
|
38
|
+
media.addEventListener?.("change", measure);
|
|
39
|
+
return () => {
|
|
40
|
+
resize?.disconnect();
|
|
41
|
+
media.removeEventListener?.("change", measure);
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* A mouse opens a menu when its button goes down, so on a phone-wide window the menu that covers the trigger is under
|
|
46
|
+
* the pointer when the button comes up, and that release would choose the item there. Cancels the release of the press
|
|
47
|
+
* that opened the menu while it is still over the trigger; a press dragged off the trigger onto an item still chooses
|
|
48
|
+
* it, as a touch dragged through an iOS menu does.
|
|
49
|
+
*/
|
|
50
|
+
export function ignoreReleaseOverTrigger(trigger, pointerId) {
|
|
51
|
+
const view = trigger.ownerDocument.defaultView;
|
|
52
|
+
// Only a phone menu covers its trigger; elsewhere the gap keeps the items clear of the pointer
|
|
53
|
+
if (!view || typeof view.matchMedia !== "function" || !view.matchMedia("(max-width: 767px)").matches)
|
|
54
|
+
return;
|
|
55
|
+
const release = (event) => {
|
|
56
|
+
if (event.pointerId !== pointerId)
|
|
57
|
+
return;
|
|
58
|
+
view.removeEventListener("pointerup", release, true);
|
|
59
|
+
view.removeEventListener("pointercancel", release, true);
|
|
60
|
+
if (event.type !== "pointerup")
|
|
61
|
+
return;
|
|
62
|
+
const rect = trigger.getBoundingClientRect();
|
|
63
|
+
if (event.clientX >= rect.left && event.clientX <= rect.right && event.clientY >= rect.top && event.clientY <= rect.bottom) {
|
|
64
|
+
event.preventDefault();
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
view.addEventListener("pointerup", release, true);
|
|
68
|
+
view.addEventListener("pointercancel", release, true);
|
|
69
|
+
}
|
|
70
|
+
//# sourceMappingURL=menuTriggerCover.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"menuTriggerCover.js","sourceRoot":"","sources":["../../../src/lib/menuTriggerCover.ts"],"names":[],"mappings":"AAGA;;;;;;;;;GASG;AACH,MAAM,UAAU,uBAAuB,CAAC,OAAoB,EAAE,QAAkD;IAC9G,MAAM,IAAI,GAAG,OAAO,CAAC,aAAa,CAAC,WAAW,CAAA;IAC9C,IAAI,CAAC,IAAI,IAAI,OAAO,IAAI,CAAC,UAAU,KAAK,UAAU,EAAE,CAAC;QACnD,QAAQ,CAAC,IAAI,CAAC,CAAA;QACd,OAAO,GAAG,EAAE,CAAC,SAAS,CAAA;IACxB,CAAC;IACD,MAAM,KAAK,GAAG,IAAI,CAAC,UAAU,CAAC,oBAAoB,CAAC,CAAA;IACnD,IAAI,IAAwB,CAAA;IAC5B,MAAM,OAAO,GAAG,GAAG,EAAE;QACnB,IAAI,KAAK,GAA4B,IAAI,CAAA;QACzC,IAAI,KAAK,CAAC,OAAO,EAAE,CAAC;YAClB,MAAM,IAAI,GAAG,OAAO,CAAC,qBAAqB,EAAE,CAAA;YAC5C,sFAAsF;YACtF,MAAM,QAAQ,GAAG,IAAI,CAAC,cAAc,CAAA;YACpC,MAAM,MAAM,GAAG,CAAC,QAAQ,EAAE,SAAS,IAAI,CAAC,CAAC,GAAG,CAAC,QAAQ,EAAE,MAAM,IAAI,IAAI,CAAC,WAAW,CAAC,GAAG,CA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O,GAAG,CAAC,KAAmB,EAAE,EAAE;QACtC,IAAI,KAAK,CAAC,SAAS,KAAK,SAAS;YAAE,OAAM;QACzC,IAAI,CAAC,mBAAmB,CAAC,WAAW,EAAE,OAAO,EAAE,IAAI,CAAC,CAAA;QACpD,IAAI,CAAC,mBAAmB,CAAC,eAAe,EAAE,OAAO,EAAE,IAAI,CAAC,CAAA;QACxD,IAAI,KAAK,CAAC,IAAI,KAAK,WAAW;YAAE,OAAM;QACtC,MAAM,IAAI,GAAG,OAAO,CAAC,qBAAqB,EAAE,CAAA;QAC5C,IAAI,KAAK,CAAC,OAAO,IAAI,IAAI,CAAC,IAAI,IAAI,KAAK,CAAC,OAAO,IAAI,IAAI,CAAC,KAAK,IAAI,KAAK,CAAC,OAAO,IAAI,IAAI,CAAC,GAAG,IAAI,KAAK,CAAC,OAAO,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;YAC3H,KAAK,CAAC,cAAc,EAAE,CAAA;QACxB,CAAC;IACH,CAAC,CAAA;IACD,IAAI,CAAC,gBAAgB,CAAC,WAAW,EAAE,OAAO,EAAE,IAAI,CAAC,CAAA;IACjD,IAAI,CAAC,gBAAgB,CAAC,eAAe,EAAE,OAAO,EAAE,IAAI,CAAC,CAAA;AACvD,CAAC","sourcesContent":["/** Where a phone menu stands over its trigger: the side offset that covers it, and the side it opens to. */\nexport type MenuTriggerCover = { sideOffset: number; side: \"top\" | \"bottom\" }\n\n/**\n * On a phone a menu grows out of the control that opens it and covers it, as iOS 26 menus do: the panel's top is the\n * control's top, or its bottom when the menu opens upward, and its aligned edge is the control's edge (iOS-menu\n * IMG_5657 and IMG_5654, the More button of a top bar; IMG_5658, a button of a group; IMG_5649, the value of a form\n * row; IMG_5675 opens upward over its row). It opens toward the larger part of the screen: downward from a control in\n * the upper half, upward from one in the lower half even when it would fit below (IMG_5688, the Icon and List Size\n * row of Files' View Options; IMG_5687, IMG_5689, and IMG_5693 from a bottom bar). Reports the side offset that puts\n * the panel there, minus the control's height, and that side, while the screen is a phone, and `null` on a larger one,\n * where the menu keeps its gap below the control.\n */\nexport function observeMenuTriggerCover(trigger: HTMLElement, onChange: (cover: MenuTriggerCover | null) => void): () => void {\n const view = trigger.ownerDocument.defaultView\n if (!view || typeof view.matchMedia !== \"function\") {\n onChange(null)\n return () => undefined\n }\n const media = view.matchMedia(\"(max-width: 767px)\")\n let last: string | undefined\n const measure = () => {\n let cover: MenuTriggerCover | null = null\n if (media.matches) {\n const rect = trigger.getBoundingClientRect()\n // The visible part of the screen: the layout viewport less a keyboard or a pinch zoom\n const viewport = view.visualViewport\n const middle = (viewport?.offsetTop ?? 0) + (viewport?.height ?? view.innerHeight) / 2\n // The layout height: a pressed control may be scaled, and the panel covers its resting box\n cover = { sideOffset: -trigger.offsetHeight, side: rect.top + rect.height / 2 > middle ? \"top\" : \"bottom\" }\n }\n const key = cover ? `${cover.sideOffset} ${cover.side}` : \"\"\n if (key === last) return\n last = key\n onChange(cover)\n }\n measure()\n const resize = typeof ResizeObserver === \"undefined\" ? undefined : new ResizeObserver(measure)\n resize?.observe(trigger)\n media.addEventListener?.(\"change\", measure)\n return () => {\n resize?.disconnect()\n media.removeEventListener?.(\"change\", measure)\n }\n}\n\n/**\n * A mouse opens a menu when its button goes down, so on a phone-wide window the menu that covers the trigger is under\n * the pointer when the button comes up, and that release would choose the item there. Cancels the release of the press\n * that opened the menu while it is still over the trigger; a press dragged off the trigger onto an item still chooses\n * it, as a touch dragged through an iOS menu does.\n */\nexport function ignoreReleaseOverTrigger(trigger: HTMLElement, pointerId: number): void {\n const view = trigger.ownerDocument.defaultView\n // Only a phone menu covers its trigger; elsewhere the gap keeps the items clear of the pointer\n if (!view || typeof view.matchMedia !== \"function\" || !view.matchMedia(\"(max-width: 767px)\").matches) return\n const release = (event: PointerEvent) => {\n if (event.pointerId !== pointerId) return\n view.removeEventListener(\"pointerup\", release, true)\n view.removeEventListener(\"pointercancel\", release, true)\n if (event.type !== \"pointerup\") return\n const rect = trigger.getBoundingClientRect()\n if (event.clientX >= rect.left && event.clientX <= rect.right && event.clientY >= rect.top && event.clientY <= rect.bottom) {\n event.preventDefault()\n }\n }\n view.addEventListener(\"pointerup\", release, true)\n view.addEventListener(\"pointercancel\", release, true)\n}\n"]}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The phone layout outside a narrow window (plan 176). The style sheets apply their phone rules (767px and below)
|
|
3
|
+
* inside an element marked `data-plex-layout="phone"` too, at any window width: PhoneLayout marks one, and so does a
|
|
4
|
+
* Dialog with `layout="phone"`. Scripts that change what they do on a phone ask the same question here.
|
|
5
|
+
*/
|
|
6
|
+
export const PHONE_LAYOUT_SCOPE = '[data-plex-layout="phone"]';
|
|
7
|
+
export const PHONE_MEDIA = "(max-width: 767px)";
|
|
8
|
+
/** The window is 767px wide or narrower. */
|
|
9
|
+
export const isPhoneWindow = (view) => {
|
|
10
|
+
if (!view)
|
|
11
|
+
return false;
|
|
12
|
+
return typeof view.matchMedia === "function" ? view.matchMedia(PHONE_MEDIA).matches : view.innerWidth <= 767;
|
|
13
|
+
};
|
|
14
|
+
/** The element is laid out as on a phone: inside a phone layout, or in a window 767px wide or narrower. */
|
|
15
|
+
export const isPhoneLayout = (element) => element.closest(PHONE_LAYOUT_SCOPE) !== null || isPhoneWindow(element.ownerDocument.defaultView);
|
|
16
|
+
//# sourceMappingURL=phoneLayout.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"phoneLayout.js","sourceRoot":"","sources":["../../../src/lib/phoneLayout.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,4BAA4B,CAAA;AAC9D,MAAM,CAAC,MAAM,WAAW,GAAG,oBAAoB,CAAA;AAE/C,4CAA4C;AAC5C,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,IAA+B,EAAW,EAAE;IACxE,IAAI,CAAC,IAAI;QAAE,OAAO,KAAK,CAAA;IACvB,OAAO,OAAO,IAAI,CAAC,UAAU,KAAK,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,UAAU,IAAI,GAAG,CAAA;AAC9G,CAAC,CAAA;AAED,2GAA2G;AAC3G,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,OAAgB,EAAW,EAAE,CACzD,OAAO,CAAC,OAAO,CAAC,kBAAkB,CAAC,KAAK,IAAI,IAAI,aAAa,CAAC,OAAO,CAAC,aAAa,CAAC,WAAW,CAAC,CAAA","sourcesContent":["/**\n * The phone layout outside a narrow window (plan 176). The style sheets apply their phone rules (767px and below)\n * inside an element marked `data-plex-layout=\"phone\"` too, at any window width: PhoneLayout marks one, and so does a\n * Dialog with `layout=\"phone\"`. Scripts that change what they do on a phone ask the same question here.\n */\nexport const PHONE_LAYOUT_SCOPE = '[data-plex-layout=\"phone\"]'\nexport const PHONE_MEDIA = \"(max-width: 767px)\"\n\n/** The window is 767px wide or narrower. */\nexport const isPhoneWindow = (view: Window | null | undefined): boolean => {\n if (!view) return false\n return typeof view.matchMedia === \"function\" ? view.matchMedia(PHONE_MEDIA).matches : view.innerWidth <= 767\n}\n\n/** The element is laid out as on a phone: inside a phone layout, or in a window 767px wide or narrower. */\nexport const isPhoneLayout = (element: Element): boolean =>\n element.closest(PHONE_LAYOUT_SCOPE) !== null || isPhoneWindow(element.ownerDocument.defaultView)\n"]}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export const NO_SCROLL_EDGES = { scrolled: false, contentBelow: false };
|
|
2
|
+
// A trackpad's small settle at either end must not flash a bar's line.
|
|
3
|
+
export const SCROLL_EDGE_SLOP = 4;
|
|
4
|
+
export const scrollEdges = (element) => ({
|
|
5
|
+
scrolled: element.scrollTop > SCROLL_EDGE_SLOP,
|
|
6
|
+
contentBelow: element.scrollHeight - element.clientHeight - element.scrollTop > SCROLL_EDGE_SLOP,
|
|
7
|
+
});
|
|
8
|
+
export const sameScrollEdges = (a, b) => a.scrolled === b.scrolled && a.contentBelow === b.contentBelow;
|
|
9
|
+
/**
|
|
10
|
+
* Reports the scroll edges of `element` now and whenever its scroll offset, its size or the size of its
|
|
11
|
+
* content changes, so a bar can show its line only while content is under it. Returns the cleanup.
|
|
12
|
+
*/
|
|
13
|
+
export const observeScrollEdges = (element, onChange) => {
|
|
14
|
+
const update = () => onChange(scrollEdges(element));
|
|
15
|
+
const resize = typeof ResizeObserver !== "undefined" ? new ResizeObserver(update) : undefined;
|
|
16
|
+
// The content's height decides the scroll range: observe each child, and the new ones as they come.
|
|
17
|
+
const observeContent = () => {
|
|
18
|
+
resize?.disconnect();
|
|
19
|
+
resize?.observe(element, { box: "border-box" });
|
|
20
|
+
for (const child of Array.from(element.children))
|
|
21
|
+
resize?.observe(child, { box: "border-box" });
|
|
22
|
+
update();
|
|
23
|
+
};
|
|
24
|
+
observeContent();
|
|
25
|
+
const children = typeof MutationObserver !== "undefined" ? new MutationObserver(observeContent) : undefined;
|
|
26
|
+
children?.observe(element, { childList: true });
|
|
27
|
+
element.addEventListener("scroll", update, { passive: true });
|
|
28
|
+
return () => {
|
|
29
|
+
resize?.disconnect();
|
|
30
|
+
children?.disconnect();
|
|
31
|
+
element.removeEventListener("scroll", update);
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
//# sourceMappingURL=scrollEdges.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scrollEdges.js","sourceRoot":"","sources":["../../../src/lib/scrollEdges.ts"],"names":[],"mappings":"AAQA,MAAM,CAAC,MAAM,eAAe,GAAgB,EAAE,QAAQ,EAAE,KAAK,EAAE,YAAY,EAAE,KAAK,EAAE,CAAA;AAEpF,uEAAuE;AACvE,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAA;AAEjC,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,OAAoB,EAAe,EAAE,CAAC,CAAC;IACjE,QAAQ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SAAS,EAAE,IAAI,EAAE,CAAC,CAAA;IAC/C,OAAO,CAAC,gBAAgB,CAAC,QAAQ,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAA;IAC7D,OAAO,GAAG,EAAE;QACV,MAAM,EAAE,UAAU,EAAE,CAAA;QACpB,QAAQ,EAAE,UAAU,EAAE,CAAA;QACtB,OAAO,CAAC,mBAAmB,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAA;IAC/C,CAAC,CAAA;AACH,CAAC,CAAA","sourcesContent":["/** Where content lies under the bars of a scroll area. */\nexport type ScrollEdges = {\n /** Content has scrolled under the top bar. */\n scrolled: boolean\n /** Content continues under the bottom bar. */\n contentBelow: boolean\n}\n\nexport const NO_SCROLL_EDGES: ScrollEdges = { scrolled: false, contentBelow: false }\n\n// A trackpad's small settle at either end must not flash a bar's line.\nexport const SCROLL_EDGE_SLOP = 4\n\nexport const scrollEdges = (element: HTMLElement): ScrollEdges => ({\n scrolled: element.scrollTop > SCROLL_EDGE_SLOP,\n contentBelow: element.scrollHeight - element.clientHeight - element.scrollTop > SCROLL_EDGE_SLOP,\n})\n\nexport const sameScrollEdges = (a: ScrollEdges, b: ScrollEdges): boolean =>\n a.scrolled === b.scrolled && a.contentBelow === b.contentBelow\n\n/**\n * Reports the scroll edges of `element` now and whenever its scroll offset, its size or the size of its\n * content changes, so a bar can show its line only while content is under it. Returns the cleanup.\n */\nexport const observeScrollEdges = (element: HTMLElement, onChange: (edges: ScrollEdges) => void): (() => void) => {\n const update = () => onChange(scrollEdges(element))\n const resize = typeof ResizeObserver !== \"undefined\" ? new ResizeObserver(update) : undefined\n // The content's height decides the scroll range: observe each child, and the new ones as they come.\n const observeContent = () => {\n resize?.disconnect()\n resize?.observe(element, { box: \"border-box\" })\n for (const child of Array.from(element.children)) resize?.observe(child, { box: \"border-box\" })\n update()\n }\n observeContent()\n const children = typeof MutationObserver !== \"undefined\" ? new MutationObserver(observeContent) : undefined\n children?.observe(element, { childList: true })\n element.addEventListener(\"scroll\", update, { passive: true })\n return () => {\n resize?.disconnect()\n children?.disconnect()\n element.removeEventListener(\"scroll\", update)\n }\n}\n"]}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The toast region is a layer of its own above any overlay: a press, focus or Escape inside a toast belongs to the
|
|
3
|
+
* toast, never to a Dialog, Popover or Menu under it. Every toast list carries `data-sonner-toaster`.
|
|
4
|
+
*/
|
|
5
|
+
export const inToastRegion = (target) => typeof Element !== "undefined" && target instanceof Element && target.closest("[data-sonner-toaster]") !== null;
|
|
6
|
+
//# sourceMappingURL=toastRegion.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toastRegion.js","sourceRoot":"","sources":["../../../src/lib/toastRegion.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,MAAsC,EAAE,EAAE,CACtE,OAAO,OAAO,KAAK,WAAW,IAAI,MAAM,YAAY,OAAO,IAAI,MAAM,CAAC,OAAO,CAAC,uBAAuB,CAAC,KAAK,IAAI,CAAA","sourcesContent":["/**\n * The toast region is a layer of its own above any overlay: a press, focus or Escape inside a toast belongs to the\n * toast, never to a Dialog, Popover or Menu under it. Every toast list carries `data-sonner-toaster`.\n */\nexport const inToastRegion = (target: EventTarget | null | undefined) =>\n typeof Element !== \"undefined\" && target instanceof Element && target.closest(\"[data-sonner-toaster]\") !== null\n"]}
|
|
@@ -1,16 +1,23 @@
|
|
|
1
1
|
import { type ComponentProps, type HTMLAttributes, type Ref } from "react";
|
|
2
2
|
import { Separator } from "../Separator/index.js";
|
|
3
3
|
export type ButtonGroupOrientation = "horizontal" | "vertical";
|
|
4
|
+
export type ButtonGroupMobileMaterial = "glass" | "flat";
|
|
4
5
|
export type ButtonGroupProps = HTMLAttributes<HTMLDivElement> & {
|
|
5
6
|
/**
|
|
6
7
|
* Direction of the joined buttons.
|
|
7
8
|
* @default "horizontal"
|
|
8
9
|
*/
|
|
9
10
|
orientation?: ButtonGroupOrientation;
|
|
11
|
+
/**
|
|
12
|
+
* Phone surface (below 768px, with touch.css). `"glass"` makes the group one glass capsule, the Button Group
|
|
13
|
+
* of the iOS 27 kit, for controls over the content; a group in a Toolbar is one already. `"flat"` keeps the
|
|
14
|
+
* joined buttons in a Toolbar.
|
|
15
|
+
*/
|
|
16
|
+
mobileMaterial?: ButtonGroupMobileMaterial;
|
|
10
17
|
className?: string;
|
|
11
18
|
ref?: Ref<HTMLDivElement>;
|
|
12
19
|
};
|
|
13
|
-
declare const ButtonGroupRoot: ({ orientation, className, ref, ...restProps }: ButtonGroupProps) => import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
declare const ButtonGroupRoot: ({ orientation, mobileMaterial, className, ref, ...restProps }: ButtonGroupProps) => import("react/jsx-runtime").JSX.Element;
|
|
14
21
|
export type ButtonGroupSeparatorProps = Omit<ComponentProps<typeof Separator>, "orientation"> & {
|
|
15
22
|
/**
|
|
16
23
|
* When omitted, uses `"vertical"`, the axis that looks right between
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { ButtonGroup, type ButtonGroupProps, type ButtonGroupOrientation, type ButtonGroupSeparatorProps, } from "./ButtonGroup.js";
|
|
1
|
+
export { ButtonGroup, type ButtonGroupProps, type ButtonGroupMobileMaterial, type ButtonGroupOrientation, type ButtonGroupSeparatorProps, } from "./ButtonGroup.js";
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { type ColorPickerMode } from "./shared.js";
|
|
2
|
+
export type ColorPickerProps = {
|
|
3
|
+
/** The `id` of the picker. */
|
|
4
|
+
id?: string;
|
|
5
|
+
/** The controlled color, `#rrggbb` or `#rrggbbaa`. Use with `onChange`. */
|
|
6
|
+
value?: string;
|
|
7
|
+
/** The color when it is initially rendered. Use when you do not need to control the color. @default "#000000" */
|
|
8
|
+
defaultValue?: string;
|
|
9
|
+
/** Called with the next color: `#rrggbb`, or `#rrggbbaa` when it is not opaque. */
|
|
10
|
+
onChange?: (value: string) => void;
|
|
11
|
+
/** Shows the Opacity slider, as `supportsAlpha` of the system picker. @default true */
|
|
12
|
+
supportsAlpha?: boolean;
|
|
13
|
+
/** The controlled way to choose a color. Use with `onModeChange`. */
|
|
14
|
+
mode?: ColorPickerMode;
|
|
15
|
+
/** The way to choose a color when the picker is initially rendered. @default "grid" */
|
|
16
|
+
defaultMode?: ColorPickerMode;
|
|
17
|
+
/** Called when another of Grid, Spectrum and Sliders is chosen. */
|
|
18
|
+
onModeChange?: (mode: ColorPickerMode) => void;
|
|
19
|
+
/** The controlled saved colors. Use with `onSwatchesChange`. */
|
|
20
|
+
swatches?: string[];
|
|
21
|
+
/** The saved colors when the picker is initially rendered. @default [] */
|
|
22
|
+
defaultSwatches?: string[];
|
|
23
|
+
/** Called with the saved colors after Add saves the current color or Delete removes one. */
|
|
24
|
+
onSwatchesChange?: (swatches: string[]) => void;
|
|
25
|
+
/** Accessible name of the picker. @default "Colors" */
|
|
26
|
+
"aria-label"?: string;
|
|
27
|
+
/** CSS classes applied to the picker */
|
|
28
|
+
className?: string;
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* The system color picker of iOS 26 (kit Color Picker - iPhone 0:5275): Grid, Spectrum and Sliders, the Opacity
|
|
32
|
+
* slider, and the saved colors with Add. Show it inside a Popover or a Sheet, or use `ColorWell`, which does.
|
|
33
|
+
*/
|
|
34
|
+
export declare function ColorPicker({ id, value: valueProp, defaultValue, onChange, supportsAlpha, mode: modeProp, defaultMode, onModeChange, swatches: swatchesProp, defaultSwatches, onSwatchesChange, "aria-label": ariaLabel, className, }: ColorPickerProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { type ColorPickerProps } from "./ColorPicker.js";
|
|
2
|
+
export type ColorWellProps = Omit<ColorPickerProps, "value" | "defaultValue" | "onChange" | "aria-label" | "className" | "id"> & {
|
|
3
|
+
/** The `id` of the well. */
|
|
4
|
+
id?: string;
|
|
5
|
+
/** The controlled color, `#rrggbb` or `#rrggbbaa`; `null` shows the rainbow well with no color. Use with `onChange`. */
|
|
6
|
+
value?: string | null;
|
|
7
|
+
/** The color when it is initially rendered. Use when you do not need to control the color. @default null */
|
|
8
|
+
defaultValue?: string | null;
|
|
9
|
+
/** Called with the color the picker chose. */
|
|
10
|
+
onChange?: (value: string) => void;
|
|
11
|
+
/** The title of the picker. @default "Colors" */
|
|
12
|
+
title?: string;
|
|
13
|
+
/** Shows the eyedropper in the picker where the browser can pick a color from the screen (EyeDropper API). @default true */
|
|
14
|
+
supportsEyedropper?: boolean;
|
|
15
|
+
/** The kit's Picker Button sizes: `sm` 28px, `lg` 36px. @default "sm" */
|
|
16
|
+
size?: "sm" | "lg";
|
|
17
|
+
/** When `true`, prevents the user from opening the picker. */
|
|
18
|
+
disabled?: boolean;
|
|
19
|
+
/** The name of the well. Submits its color with the owning form. */
|
|
20
|
+
name?: string;
|
|
21
|
+
/** Accessible name of the well. @default "Color" */
|
|
22
|
+
"aria-label"?: string;
|
|
23
|
+
/** The `id` of the visible label of the well. */
|
|
24
|
+
"aria-labelledby"?: string;
|
|
25
|
+
/** CSS classes applied to the well */
|
|
26
|
+
className?: string;
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* A color well, as `UIColorWell`: the kit's Picker Button (5739:34128), a rainbow ring around the chosen color. It
|
|
30
|
+
* opens the color picker, in a Popover from the well, and on a phone in a sheet, as the system picker.
|
|
31
|
+
*/
|
|
32
|
+
export declare function ColorWell({ id, value: valueProp, defaultValue, onChange, title, supportsEyedropper, size, disabled, name, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, className, ...pickerProps }: ColorWellProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/** A color as the picker holds it: channels 0 to 255 and an alpha from 0 to 1. */
|
|
2
|
+
export type Rgba = {
|
|
3
|
+
r: number;
|
|
4
|
+
g: number;
|
|
5
|
+
b: number;
|
|
6
|
+
a: number;
|
|
7
|
+
};
|
|
8
|
+
/** The three ways to choose a color, as the segments of the system picker. */
|
|
9
|
+
export type ColorPickerMode = "grid" | "spectrum" | "sliders";
|
|
10
|
+
export declare const COLOR_PICKER_MODES: readonly {
|
|
11
|
+
value: ColorPickerMode;
|
|
12
|
+
label: string;
|
|
13
|
+
}[];
|
|
14
|
+
/** The kit's Color Grid (515:48178): a row of grays, then nine rows from dark to light, twelve hues across. */
|
|
15
|
+
export declare const COLOR_PICKER_GRID: readonly (readonly string[])[];
|
|
16
|
+
export declare const COLOR_PICKER_GRID_COLUMNS = 12;
|
|
17
|
+
/** Saved colors fill pages of two rows of five, with the Add button after the last one (kit Swatches 515:52724). */
|
|
18
|
+
export declare const COLOR_PICKER_SWATCHES_PER_PAGE = 10;
|
|
19
|
+
export declare const COLOR_PICKER_SWATCHES_PER_ROW = 5;
|
|
20
|
+
/** Reads `#rgb`, `#rgba`, `#rrggbb` or `#rrggbbaa`, in either case; anything else is `null`. */
|
|
21
|
+
export declare function parseColor(input: string | null | undefined): Rgba | null;
|
|
22
|
+
/** `#rrggbb`, or `#rrggbbaa` when the color is not opaque. */
|
|
23
|
+
export declare function formatColor({ r, g, b, a }: Rgba): string;
|
|
24
|
+
/** The six digits the Hex field shows, as the system picker does: upper case, no `#`. */
|
|
25
|
+
export declare const hexDigits: ({ r, g, b }: Rgba) => string;
|
|
26
|
+
/** A CSS color for a fill. */
|
|
27
|
+
export declare const cssColor: ({ r, g, b, a }: Rgba, alpha?: number) => string;
|
|
28
|
+
export declare const sameRgb: (one: Rgba, other: Rgba) => boolean;
|
|
29
|
+
/** Whole percent of opacity, as the Opacity field shows it. */
|
|
30
|
+
export declare const alphaPercent: (a: number) => number;
|
|
31
|
+
/** The grid cell of a color, or -1 when the grid has no such color. */
|
|
32
|
+
export declare const gridIndex: (color: Rgba) => number;
|
|
33
|
+
export declare const gridColor: (index: number) => string;
|
|
34
|
+
/** The cell an arrow key, Home or End moves to from `index`, or `index` itself at an edge. */
|
|
35
|
+
export declare function gridMove(index: number, key: string): number;
|
|
36
|
+
/** The item a key moves to in a list of `count` items (saved colors), or `index` itself. */
|
|
37
|
+
export declare function listMove(index: number, count: number, key: string): number;
|
|
38
|
+
/** Pages of saved colors: the colors and the Add button after them, ten to a page. */
|
|
39
|
+
export declare const swatchPageCount: (count: number) => number;
|
|
40
|
+
/**
|
|
41
|
+
* A point of the spectrum: hue from top to bottom, and from white at the leading edge through the full hue at the
|
|
42
|
+
* middle to black at the trailing edge, as the system picker draws it (UIColorPickerViewController overview image).
|
|
43
|
+
*/
|
|
44
|
+
export type SpectrumPoint = {
|
|
45
|
+
x: number;
|
|
46
|
+
y: number;
|
|
47
|
+
};
|
|
48
|
+
export declare function spectrumColor({ x, y }: SpectrumPoint, alpha: number): Rgba;
|
|
49
|
+
/** Where a color sits on the spectrum; a gray keeps the hue of `previous`, as it has none. */
|
|
50
|
+
export declare function spectrumPoint(color: Rgba, previous?: SpectrumPoint): SpectrumPoint;
|
|
51
|
+
/** The track of the Opacity slider: the color from clear to opaque over the kit's 12% to 88% (515:47434). */
|
|
52
|
+
export declare const opacityTrack: (color: Rgba) => string;
|
|
53
|
+
export type ColorChannel = "r" | "g" | "b";
|
|
54
|
+
export declare const COLOR_PICKER_CHANNELS: readonly {
|
|
55
|
+
channel: ColorChannel;
|
|
56
|
+
label: string;
|
|
57
|
+
}[];
|
|
58
|
+
/** The track of a channel slider: the color with that channel from 0 to 255. */
|
|
59
|
+
export declare const channelTrack: (color: Rgba, channel: ColorChannel) => string;
|
|
60
|
+
/** A number typed in a field, kept within `min` and `max`; text with no number is `null`. */
|
|
61
|
+
export declare function parseNumber(text: string, min: number, max: number): number | null;
|
|
62
|
+
/** The EyeDropper API (Chromium), when the browser has it. */
|
|
63
|
+
type EyeDropperConstructor = new () => {
|
|
64
|
+
open: () => Promise<{
|
|
65
|
+
sRGBHex: string;
|
|
66
|
+
}>;
|
|
67
|
+
};
|
|
68
|
+
export declare function eyeDropper(): EyeDropperConstructor | null;
|
|
69
|
+
export {};
|