@sanity/ui 2.16.24 → 2.16.26
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/_chunks-cjs/_visual-editing.js +29 -29
- package/dist/_chunks-cjs/_visual-editing.js.map +1 -1
- package/dist/_chunks-es/_visual-editing.mjs +29 -29
- package/dist/_chunks-es/_visual-editing.mjs.map +1 -1
- package/dist/_visual-editing.d.mts +12 -21
- package/dist/_visual-editing.d.ts +12 -21
- package/dist/index.d.mts +31 -57
- package/dist/index.d.ts +31 -57
- package/dist/index.js +46 -46
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +47 -47
- package/dist/index.mjs.map +1 -1
- package/dist/theme.d.mts +12 -19
- package/dist/theme.d.ts +12 -19
- package/package.json +5 -5
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { isHTMLElement, isHTMLAnchorElement, isHTMLInputElement, isHTMLButtonElement, isHTMLSelectElement, isHTMLTextAreaElement,
|
|
1
|
+
import { EMPTY_ARRAY, useElementSize, Code, isHTMLElement, isHTMLAnchorElement, isHTMLInputElement, isHTMLButtonElement, isHTMLSelectElement, isHTMLTextAreaElement, Box, _isEnterToClickElement, Card, Text, useArrayProp, EMPTY_RECORD, Button, Stack, Popover, TextInput, useClickOutsideEvent, _responsive, createGlobalScopedContext, Container, Flex, usePortal, useBoundaryElement, useLayer, useGlobalKeyDown, useTheme_v2, usePrefersReducedMotion, Portal, containsOrEqualsElement, Layer, responsivePaddingStyle, responsiveRadiusStyle, Grid, LayerProvider, isRecord, _cardColorStyle, rem } from "./_chunks-es/_visual-editing.mjs";
|
|
2
2
|
import { Arrow, Avatar, AvatarCounter, AvatarStack, Badge, BoundaryElementProvider, Checkbox, ConditionalWrapper, ElementQuery, Heading, Hotkeys, Inline, KBD, Label, Menu, MenuDivider, MenuGroup, MenuItem, PortalProvider, Radio, Select, Spinner, SrOnly, Switch, Tab, TabList, TextArea, ThemeColorProvider, ThemeProvider, Tooltip, TooltipDelayGroupContext, TooltipDelayGroupProvider, VirtualList, _ResizeObserver, _elementSizeObserver, _fillCSSObject, _getArrayProp, _getResponsiveSpace, _isScrollable, createColorTheme, hexToRgb, hslToRgb, multiply, parseColor, responsiveCodeFontStyle, responsiveHeadingFont, responsiveLabelFont, responsiveTextAlignStyle, responsiveTextFont, rgbToHex, rgbToHsl, rgba, screen, studioTheme, useCustomValidity, useMatchMedia, useMediaIndex, usePrefersDark, useRootTheme, useTheme, useTooltipDelayGroup } from "./_chunks-es/_visual-editing.mjs";
|
|
3
3
|
import { jsx, jsxs, Fragment as Fragment$1 } from "react/jsx-runtime";
|
|
4
4
|
import { SpinnerIcon, ChevronDownIcon, CloseIcon, ToggleArrowRightIcon } from "@sanity/icons";
|
|
@@ -7,52 +7,6 @@ import { styled, keyframes, css } from "styled-components";
|
|
|
7
7
|
import { c } from "react-compiler-runtime";
|
|
8
8
|
import { getTheme_v2 } from "@sanity/ui/theme";
|
|
9
9
|
import { motion, AnimatePresence } from "motion/react";
|
|
10
|
-
function _raf(fn) {
|
|
11
|
-
const frameId = requestAnimationFrame(fn);
|
|
12
|
-
return () => {
|
|
13
|
-
cancelAnimationFrame(frameId);
|
|
14
|
-
};
|
|
15
|
-
}
|
|
16
|
-
function _raf2(fn) {
|
|
17
|
-
let innerDispose = null;
|
|
18
|
-
const outerDispose = _raf(() => {
|
|
19
|
-
innerDispose = _raf(fn);
|
|
20
|
-
});
|
|
21
|
-
return () => {
|
|
22
|
-
innerDispose && innerDispose(), outerDispose();
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
function _hasFocus(element) {
|
|
26
|
-
return !!document.activeElement && element.contains(document.activeElement);
|
|
27
|
-
}
|
|
28
|
-
function isFocusable(element) {
|
|
29
|
-
return element.tabIndex > 0 || element.tabIndex === 0 && element.getAttribute("tabIndex") !== null ? !0 : isHTMLAnchorElement(element) ? !!element.href && element.rel !== "ignore" : isHTMLInputElement(element) ? element.type !== "hidden" && element.type !== "file" && !element.disabled : isHTMLButtonElement(element) || isHTMLSelectElement(element) || isHTMLTextAreaElement(element) ? !element.disabled : !1;
|
|
30
|
-
}
|
|
31
|
-
function attemptFocus(element) {
|
|
32
|
-
if (!isFocusable(element))
|
|
33
|
-
return !1;
|
|
34
|
-
try {
|
|
35
|
-
element.focus();
|
|
36
|
-
} catch {
|
|
37
|
-
}
|
|
38
|
-
return document.activeElement === element;
|
|
39
|
-
}
|
|
40
|
-
function focusFirstDescendant(element) {
|
|
41
|
-
for (let i = 0; i < element.childNodes.length; i++) {
|
|
42
|
-
const child = element.childNodes[i];
|
|
43
|
-
if (isHTMLElement(child) && (attemptFocus(child) || focusFirstDescendant(child)))
|
|
44
|
-
return !0;
|
|
45
|
-
}
|
|
46
|
-
return !1;
|
|
47
|
-
}
|
|
48
|
-
function focusLastDescendant(element) {
|
|
49
|
-
for (let i = element.childNodes.length - 1; i >= 0; i--) {
|
|
50
|
-
const child = element.childNodes[i];
|
|
51
|
-
if (isHTMLElement(child) && (attemptFocus(child) || focusLastDescendant(child)))
|
|
52
|
-
return !0;
|
|
53
|
-
}
|
|
54
|
-
return !1;
|
|
55
|
-
}
|
|
56
10
|
function _getElements(element, elementsArg) {
|
|
57
11
|
const ret = [element];
|
|
58
12
|
for (const el of elementsArg)
|
|
@@ -134,6 +88,52 @@ class ErrorBoundary extends Component {
|
|
|
134
88
|
return this.props.children;
|
|
135
89
|
}
|
|
136
90
|
}
|
|
91
|
+
function _raf(fn) {
|
|
92
|
+
const frameId = requestAnimationFrame(fn);
|
|
93
|
+
return () => {
|
|
94
|
+
cancelAnimationFrame(frameId);
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
function _raf2(fn) {
|
|
98
|
+
let innerDispose = null;
|
|
99
|
+
const outerDispose = _raf(() => {
|
|
100
|
+
innerDispose = _raf(fn);
|
|
101
|
+
});
|
|
102
|
+
return () => {
|
|
103
|
+
innerDispose && innerDispose(), outerDispose();
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
function _hasFocus(element) {
|
|
107
|
+
return !!document.activeElement && element.contains(document.activeElement);
|
|
108
|
+
}
|
|
109
|
+
function isFocusable(element) {
|
|
110
|
+
return element.tabIndex > 0 || element.tabIndex === 0 && element.getAttribute("tabIndex") !== null ? !0 : isHTMLAnchorElement(element) ? !!element.href && element.rel !== "ignore" : isHTMLInputElement(element) ? element.type !== "hidden" && element.type !== "file" && !element.disabled : isHTMLButtonElement(element) || isHTMLSelectElement(element) || isHTMLTextAreaElement(element) ? !element.disabled : !1;
|
|
111
|
+
}
|
|
112
|
+
function attemptFocus(element) {
|
|
113
|
+
if (!isFocusable(element))
|
|
114
|
+
return !1;
|
|
115
|
+
try {
|
|
116
|
+
element.focus();
|
|
117
|
+
} catch {
|
|
118
|
+
}
|
|
119
|
+
return document.activeElement === element;
|
|
120
|
+
}
|
|
121
|
+
function focusFirstDescendant(element) {
|
|
122
|
+
for (let i = 0; i < element.childNodes.length; i++) {
|
|
123
|
+
const child = element.childNodes[i];
|
|
124
|
+
if (isHTMLElement(child) && (attemptFocus(child) || focusFirstDescendant(child)))
|
|
125
|
+
return !0;
|
|
126
|
+
}
|
|
127
|
+
return !1;
|
|
128
|
+
}
|
|
129
|
+
function focusLastDescendant(element) {
|
|
130
|
+
for (let i = element.childNodes.length - 1; i >= 0; i--) {
|
|
131
|
+
const child = element.childNodes[i];
|
|
132
|
+
if (isHTMLElement(child) && (attemptFocus(child) || focusLastDescendant(child)))
|
|
133
|
+
return !0;
|
|
134
|
+
}
|
|
135
|
+
return !1;
|
|
136
|
+
}
|
|
137
137
|
const StyledAutocomplete = styled.div.withConfig({
|
|
138
138
|
displayName: "StyledAutocomplete",
|
|
139
139
|
componentId: "sc-1igauft-0"
|