@multiplatform.one/forms 7.80.0 → 7.81.1
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/cjs/AdaptivePopup/index.cjs +2 -1
- package/dist/cjs/AdaptivePopup/index.native.js +2 -1
- package/dist/cjs/AdaptivePopup/index.native.js.map +1 -1
- package/dist/cjs/Button/index.cjs +12 -5
- package/dist/cjs/Button/index.native.js +14 -6
- package/dist/cjs/Button/index.native.js.map +1 -1
- package/dist/cjs/FloatingPanel/PanelHeader.cjs +3 -8
- package/dist/cjs/FloatingPanel/PanelHeader.native.js +3 -8
- package/dist/cjs/FloatingPanel/PanelHeader.native.js.map +1 -1
- package/dist/cjs/FloatingPanel/coverRect.cjs +0 -8
- package/dist/cjs/FloatingPanel/coverRect.native.js +0 -8
- package/dist/cjs/FloatingPanel/coverRect.native.js.map +1 -1
- package/dist/cjs/FloatingPanel/echoContext.cjs +5 -27
- package/dist/cjs/FloatingPanel/echoContext.native.js +5 -28
- package/dist/cjs/FloatingPanel/echoContext.native.js.map +1 -1
- package/dist/cjs/FloatingPanel/index.cjs +49 -131
- package/dist/cjs/FloatingPanel/index.native.js +216 -135
- package/dist/cjs/FloatingPanel/index.native.js.map +1 -1
- package/dist/cjs/fields/Combobox/index.cjs +3 -10
- package/dist/cjs/fields/Combobox/index.native.js +3 -10
- package/dist/cjs/fields/Combobox/index.native.js.map +1 -1
- package/dist/cjs/fields/Select/InlineChoices.cjs +4 -8
- package/dist/cjs/fields/Select/InlineChoices.native.js +4 -8
- package/dist/cjs/fields/Select/InlineChoices.native.js.map +1 -1
- package/dist/cjs/fields/Select/index.cjs +65 -201
- package/dist/cjs/fields/Select/index.native.js +74 -209
- package/dist/cjs/fields/Select/index.native.js.map +1 -1
- package/dist/cjs/fields/nativeDateTime/OsDateTimeSheet.cjs +2 -2
- package/dist/cjs/fields/nativeDateTime/OsDateTimeSheet.native.js +2 -2
- package/dist/cjs/fields/nativeDateTime/OsDateTimeSheet.native.js.map +1 -1
- package/dist/cjs/index.cjs +4 -0
- package/dist/cjs/index.native.js +4 -0
- package/dist/cjs/index.native.js.map +1 -1
- package/dist/cjs/shared/CheckGlyph.cjs +40 -0
- package/dist/cjs/shared/CheckGlyph.native.js +44 -0
- package/dist/cjs/shared/CheckGlyph.native.js.map +1 -0
- package/dist/cjs/shared/checkedOnField.cjs +104 -0
- package/dist/cjs/shared/checkedOnField.native.js +117 -0
- package/dist/cjs/shared/checkedOnField.native.js.map +1 -0
- package/dist/cjs/shared/floatingList.cjs +12 -5
- package/dist/cjs/shared/floatingList.native.js +15 -7
- package/dist/cjs/shared/floatingList.native.js.map +1 -1
- package/dist/esm/AdaptivePopup/index.mjs +3 -2
- package/dist/esm/AdaptivePopup/index.mjs.map +1 -1
- package/dist/esm/AdaptivePopup/index.native.js +3 -2
- package/dist/esm/AdaptivePopup/index.native.js.map +1 -1
- package/dist/esm/Button/index.mjs +12 -5
- package/dist/esm/Button/index.mjs.map +1 -1
- package/dist/esm/Button/index.native.js +14 -6
- package/dist/esm/Button/index.native.js.map +1 -1
- package/dist/esm/FloatingPanel/PanelHeader.mjs +3 -8
- package/dist/esm/FloatingPanel/PanelHeader.mjs.map +1 -1
- package/dist/esm/FloatingPanel/PanelHeader.native.js +3 -8
- package/dist/esm/FloatingPanel/PanelHeader.native.js.map +1 -1
- package/dist/esm/FloatingPanel/coverRect.mjs +1 -8
- package/dist/esm/FloatingPanel/coverRect.mjs.map +1 -1
- package/dist/esm/FloatingPanel/coverRect.native.js +1 -8
- package/dist/esm/FloatingPanel/coverRect.native.js.map +1 -1
- package/dist/esm/FloatingPanel/echoContext.mjs +4 -24
- package/dist/esm/FloatingPanel/echoContext.mjs.map +1 -1
- package/dist/esm/FloatingPanel/echoContext.native.js +4 -25
- package/dist/esm/FloatingPanel/echoContext.native.js.map +1 -1
- package/dist/esm/FloatingPanel/index.mjs +53 -135
- package/dist/esm/FloatingPanel/index.mjs.map +1 -1
- package/dist/esm/FloatingPanel/index.native.js +180 -99
- package/dist/esm/FloatingPanel/index.native.js.map +1 -1
- package/dist/esm/fields/Combobox/index.mjs +4 -11
- package/dist/esm/fields/Combobox/index.mjs.map +1 -1
- package/dist/esm/fields/Combobox/index.native.js +4 -11
- package/dist/esm/fields/Combobox/index.native.js.map +1 -1
- package/dist/esm/fields/Select/InlineChoices.mjs +2 -6
- package/dist/esm/fields/Select/InlineChoices.mjs.map +1 -1
- package/dist/esm/fields/Select/InlineChoices.native.js +2 -6
- package/dist/esm/fields/Select/InlineChoices.native.js.map +1 -1
- package/dist/esm/fields/Select/index.mjs +68 -204
- package/dist/esm/fields/Select/index.mjs.map +1 -1
- package/dist/esm/fields/Select/index.native.js +77 -212
- package/dist/esm/fields/Select/index.native.js.map +1 -1
- package/dist/esm/fields/nativeDateTime/OsDateTimeSheet.mjs +3 -3
- package/dist/esm/fields/nativeDateTime/OsDateTimeSheet.mjs.map +1 -1
- package/dist/esm/fields/nativeDateTime/OsDateTimeSheet.native.js +3 -3
- package/dist/esm/fields/nativeDateTime/OsDateTimeSheet.native.js.map +1 -1
- package/dist/esm/index.mjs +3 -1
- package/dist/esm/index.mjs.map +1 -1
- package/dist/esm/index.native.js +3 -1
- package/dist/esm/index.native.js.map +1 -1
- package/dist/esm/shared/CheckGlyph.mjs +15 -0
- package/dist/esm/shared/CheckGlyph.mjs.map +1 -0
- package/dist/esm/shared/CheckGlyph.native.js +16 -0
- package/dist/esm/shared/CheckGlyph.native.js.map +1 -0
- package/dist/esm/shared/checkedOnField.mjs +76 -0
- package/dist/esm/shared/checkedOnField.mjs.map +1 -0
- package/dist/esm/shared/checkedOnField.native.js +86 -0
- package/dist/esm/shared/checkedOnField.native.js.map +1 -0
- package/dist/esm/shared/floatingList.mjs +9 -5
- package/dist/esm/shared/floatingList.mjs.map +1 -1
- package/dist/esm/shared/floatingList.native.js +12 -7
- package/dist/esm/shared/floatingList.native.js.map +1 -1
- package/dist/jsx/AdaptivePopup/index.mjs +3 -2
- package/dist/jsx/AdaptivePopup/index.mjs.map +1 -1
- package/dist/jsx/AdaptivePopup/index.native.js +2 -1
- package/dist/jsx/AdaptivePopup/index.native.js.map +1 -1
- package/dist/jsx/Button/index.mjs +12 -5
- package/dist/jsx/Button/index.mjs.map +1 -1
- package/dist/jsx/Button/index.native.js +14 -6
- package/dist/jsx/Button/index.native.js.map +1 -1
- package/dist/jsx/FloatingPanel/PanelHeader.mjs +3 -8
- package/dist/jsx/FloatingPanel/PanelHeader.mjs.map +1 -1
- package/dist/jsx/FloatingPanel/PanelHeader.native.js +3 -8
- package/dist/jsx/FloatingPanel/PanelHeader.native.js.map +1 -1
- package/dist/jsx/FloatingPanel/coverRect.mjs +1 -8
- package/dist/jsx/FloatingPanel/coverRect.mjs.map +1 -1
- package/dist/jsx/FloatingPanel/coverRect.native.js +0 -8
- package/dist/jsx/FloatingPanel/coverRect.native.js.map +1 -1
- package/dist/jsx/FloatingPanel/echoContext.mjs +4 -24
- package/dist/jsx/FloatingPanel/echoContext.mjs.map +1 -1
- package/dist/jsx/FloatingPanel/echoContext.native.js +5 -28
- package/dist/jsx/FloatingPanel/echoContext.native.js.map +1 -1
- package/dist/jsx/FloatingPanel/index.mjs +53 -135
- package/dist/jsx/FloatingPanel/index.mjs.map +1 -1
- package/dist/jsx/FloatingPanel/index.native.js +216 -135
- package/dist/jsx/FloatingPanel/index.native.js.map +1 -1
- package/dist/jsx/fields/Combobox/index.mjs +4 -11
- package/dist/jsx/fields/Combobox/index.mjs.map +1 -1
- package/dist/jsx/fields/Combobox/index.native.js +3 -10
- package/dist/jsx/fields/Combobox/index.native.js.map +1 -1
- package/dist/jsx/fields/Select/InlineChoices.mjs +2 -6
- package/dist/jsx/fields/Select/InlineChoices.mjs.map +1 -1
- package/dist/jsx/fields/Select/InlineChoices.native.js +4 -8
- package/dist/jsx/fields/Select/InlineChoices.native.js.map +1 -1
- package/dist/jsx/fields/Select/index.mjs +68 -204
- package/dist/jsx/fields/Select/index.mjs.map +1 -1
- package/dist/jsx/fields/Select/index.native.js +74 -209
- package/dist/jsx/fields/Select/index.native.js.map +1 -1
- package/dist/jsx/fields/nativeDateTime/OsDateTimeSheet.mjs +3 -3
- package/dist/jsx/fields/nativeDateTime/OsDateTimeSheet.mjs.map +1 -1
- package/dist/jsx/fields/nativeDateTime/OsDateTimeSheet.native.js +2 -2
- package/dist/jsx/fields/nativeDateTime/OsDateTimeSheet.native.js.map +1 -1
- package/dist/jsx/index.js +3 -1
- package/dist/jsx/index.js.map +1 -1
- package/dist/jsx/index.mjs +3 -1
- package/dist/jsx/index.mjs.map +1 -1
- package/dist/jsx/index.native.js +4 -0
- package/dist/jsx/index.native.js.map +1 -1
- package/dist/jsx/shared/CheckGlyph.mjs +15 -0
- package/dist/jsx/shared/CheckGlyph.mjs.map +1 -0
- package/dist/jsx/shared/CheckGlyph.native.js +44 -0
- package/dist/jsx/shared/CheckGlyph.native.js.map +1 -0
- package/dist/jsx/shared/checkedOnField.mjs +76 -0
- package/dist/jsx/shared/checkedOnField.mjs.map +1 -0
- package/dist/jsx/shared/checkedOnField.native.js +117 -0
- package/dist/jsx/shared/checkedOnField.native.js.map +1 -0
- package/dist/jsx/shared/floatingList.mjs +9 -5
- package/dist/jsx/shared/floatingList.mjs.map +1 -1
- package/dist/jsx/shared/floatingList.native.js +15 -7
- package/dist/jsx/shared/floatingList.native.js.map +1 -1
- package/package.json +8 -8
- package/src/AdaptivePopup/index.tsx +6 -3
- package/src/Button/Button.iconButton.spec.tsx +39 -0
- package/src/Button/index.tsx +20 -8
- package/src/FloatingPanel/FloatingPanel.iconCover.spec.tsx +279 -0
- package/src/FloatingPanel/FloatingPanel.menuFace.native.spec.tsx +78 -69
- package/src/FloatingPanel/FloatingPanel.seamlessCover.spec.tsx +12 -0
- package/src/FloatingPanel/PanelHeader.tsx +4 -12
- package/src/FloatingPanel/coverRect.ts +2 -15
- package/src/FloatingPanel/echoContext.ts +6 -40
- package/src/FloatingPanel/index.native.tsx +209 -144
- package/src/FloatingPanel/index.tsx +71 -187
- package/src/FloatingPanel/pointAnchor.spec.ts +1 -1
- package/src/FloatingPanel/pointAnchor.ts +4 -4
- package/src/FloatingPanel/sheetGrabber.spec.tsx +53 -0
- package/src/fields/Combobox/index.tsx +4 -9
- package/src/fields/Select/InlineChoices.tsx +2 -2
- package/src/fields/Select/Select.containingBlock.spec.tsx +131 -130
- package/src/fields/Select/Select.popUp.native.spec.tsx +276 -0
- package/src/fields/Select/Select.stories.tsx +26 -0
- package/src/fields/Select/index.tsx +84 -255
- package/src/fields/nativeDateTime/OsDateTimeSheet.tsx +3 -3
- package/src/index.ts +2 -1
- package/src/shared/CheckGlyph.tsx +12 -0
- package/src/shared/checkedOnField.ts +116 -0
- package/src/shared/floatingList.spec.tsx +154 -1
- package/src/shared/floatingList.tsx +18 -9
- package/types/AdaptivePopup/index.d.ts.map +1 -1
- package/types/Button/index.d.ts.map +1 -1
- package/types/FloatingPanel/PanelHeader.d.ts +1 -6
- package/types/FloatingPanel/PanelHeader.d.ts.map +1 -1
- package/types/FloatingPanel/coverRect.d.ts +2 -11
- package/types/FloatingPanel/coverRect.d.ts.map +1 -1
- package/types/FloatingPanel/echoContext.d.ts +5 -22
- package/types/FloatingPanel/echoContext.d.ts.map +1 -1
- package/types/FloatingPanel/index.d.ts +22 -9
- package/types/FloatingPanel/index.d.ts.map +1 -1
- package/types/FloatingPanel/index.native.d.ts +8 -1
- package/types/FloatingPanel/index.native.d.ts.map +1 -1
- package/types/FloatingPanel/pointAnchor.d.ts +4 -4
- package/types/fields/Combobox/index.d.ts.map +1 -1
- package/types/fields/Select/index.d.ts.map +1 -1
- package/types/index.d.ts +2 -1
- package/types/index.d.ts.map +1 -1
- package/types/shared/CheckGlyph.d.ts +10 -0
- package/types/shared/CheckGlyph.d.ts.map +1 -0
- package/types/shared/checkedOnField.d.ts +54 -0
- package/types/shared/checkedOnField.d.ts.map +1 -0
- package/types/shared/floatingList.d.ts +5 -2
- package/types/shared/floatingList.d.ts.map +1 -1
- package/dist/cjs/FloatingPanel/iconEcho.cjs +0 -106
- package/dist/cjs/FloatingPanel/iconEcho.native.js +0 -116
- package/dist/cjs/FloatingPanel/iconEcho.native.js.map +0 -1
- package/dist/esm/FloatingPanel/iconEcho.mjs +0 -79
- package/dist/esm/FloatingPanel/iconEcho.mjs.map +0 -1
- package/dist/esm/FloatingPanel/iconEcho.native.js +0 -86
- package/dist/esm/FloatingPanel/iconEcho.native.js.map +0 -1
- package/dist/jsx/FloatingPanel/iconEcho.mjs +0 -79
- package/dist/jsx/FloatingPanel/iconEcho.mjs.map +0 -1
- package/dist/jsx/FloatingPanel/iconEcho.native.js +0 -116
- package/dist/jsx/FloatingPanel/iconEcho.native.js.map +0 -1
- package/src/FloatingPanel/FloatingPanel.iconEcho.spec.tsx +0 -357
- package/src/FloatingPanel/iconEcho.tsx +0 -124
- package/types/FloatingPanel/iconEcho.d.ts +0 -29
- package/types/FloatingPanel/iconEcho.d.ts.map +0 -1
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { CaretDownIcon, CaretUpIcon } from "@phosphor-icons/react";
|
|
3
|
+
import { nativeAnimationConfig, overlayScrim, sheetGrabber, sheetGrabberZone } from "@multiplatform.one/theme";
|
|
3
4
|
import { isValidElement, useCallback, useContext, useEffect, useLayoutEffect, useMemo, useRef, useState } from "react";
|
|
4
5
|
import { Animated, Easing, I18nManager, Modal, PanResponder, Platform, Pressable, ScrollView as RNScrollView, StyleSheet, useWindowDimensions, View as RNView } from "react-native";
|
|
5
6
|
import { SafeAreaInsetsContext, initialWindowMetrics } from "react-native-safe-area-context";
|
|
6
|
-
import { Surface,
|
|
7
|
-
import { View, YStack } from "tamagui";
|
|
7
|
+
import { Surface, useGlyphColor, useResolvedKnobs, motionDurationMs } from "@multiplatform.one/theme";
|
|
8
|
+
import { getTokenValue, View, YStack } from "tamagui";
|
|
9
|
+
import { placeCheckedOnField, scrollArrowBand, scrollArrowThreshold } from "../shared/checkedOnField.native.js";
|
|
8
10
|
import { useInsideOverlay, useOverlayZIndex } from "../shared/overlayStack.native.js";
|
|
9
11
|
import { OverlayWindow } from "../shared/OverlayWindow.native.js";
|
|
10
12
|
import { t } from "../shared/t.native.js";
|
|
@@ -12,13 +14,12 @@ import { overlaySizeClass } from "../shared/overlaySizeClass.native.js";
|
|
|
12
14
|
import { useKeyboardInset } from "../shared/useKeyboardInset.native.js";
|
|
13
15
|
import { MENU_MIN_WIDTH, resolveCompactFace } from "./compactFace.native.js";
|
|
14
16
|
import { echoOffset, panelWidthBox, screenBounds } from "./panelWidth.native.js";
|
|
15
|
-
import {
|
|
17
|
+
import { PanelEchoContext, PanelSheetContext, PanelTriggerRadiusContext } from "./echoContext.native.js";
|
|
16
18
|
import { placeAtPoint, placeBesideTrigger, placeOverTrigger } from "./pointAnchor.native.js";
|
|
17
19
|
import { RegularPanel } from "./RegularPanel.native.js";
|
|
18
20
|
import { panelViewportPadding, resolvePanelWidthMode } from "./useFloatingPanel.native.js";
|
|
19
21
|
import { TrailingActionOverlay, TriggerWithTrailingAction } from "./trailingAction.native.js";
|
|
20
|
-
import {
|
|
21
|
-
import { echoInCover, iconCoverRect } from "./coverRect.native.js";
|
|
22
|
+
import { iconCoverRect } from "./coverRect.native.js";
|
|
22
23
|
import { IconButtonGroupSurfaceContext, useIconButtonGroupSurface } from "../Button/iconButtonGroupContext.native.js";
|
|
23
24
|
import { useFloatingPanel, panelAnimationDuration, panelGrowDuration, panelTransition, panelViewportPadding as panelViewportPadding2 } from "./useFloatingPanel.native.js";
|
|
24
25
|
import { floatingPanelActionProps, isNestedPanelAction } from "./nestedAction.native.js";
|
|
@@ -52,7 +53,8 @@ function FloatingPanel(param) {
|
|
|
52
53
|
triggerRow,
|
|
53
54
|
triggerEcho = true,
|
|
54
55
|
coverAlign = "start",
|
|
55
|
-
|
|
56
|
+
iconCover = false,
|
|
57
|
+
popUp,
|
|
56
58
|
anchorMode,
|
|
57
59
|
panelWidth = "content",
|
|
58
60
|
sheet,
|
|
@@ -65,7 +67,6 @@ function FloatingPanel(param) {
|
|
|
65
67
|
} = useResolvedKnobs({
|
|
66
68
|
painted: false
|
|
67
69
|
});
|
|
68
|
-
var triggerSurface = SurfaceContext.useStyledContext();
|
|
69
70
|
var windowZIndex = useOverlayZIndex("sheet");
|
|
70
71
|
var children = /* @__PURE__ */_jsx(IconButtonGroupSurfaceContext.Provider, {
|
|
71
72
|
value: null,
|
|
@@ -122,7 +123,7 @@ function FloatingPanel(param) {
|
|
|
122
123
|
var regular = overlaySizeClass(windowWidth) === "regular";
|
|
123
124
|
var atPoint = isContextMenu && pressPoint !== null && regular;
|
|
124
125
|
var insideOverlay = useInsideOverlay();
|
|
125
|
-
var asMenu = isContextMenu ? compactFace === "menu" : resolveCompactFace(compactFace, insideOverlay) === "menu";
|
|
126
|
+
var asMenu = isContextMenu ? compactFace === "menu" : resolveCompactFace(compactFace, insideOverlay) === "menu" || popUp != null && regular;
|
|
126
127
|
var asRegular = regular && !asMenu && !isContextMenu && sheet !== true;
|
|
127
128
|
var anchored = asMenu || asRegular;
|
|
128
129
|
var triggerRef = useRef(null);
|
|
@@ -160,7 +161,7 @@ function FloatingPanel(param) {
|
|
|
160
161
|
height: 0
|
|
161
162
|
});
|
|
162
163
|
}
|
|
163
|
-
if (
|
|
164
|
+
if (iconCover && anchorMode !== "attach" && groupSurface) {
|
|
164
165
|
setGroup(void 0);
|
|
165
166
|
groupSurface.measure(function (plate) {
|
|
166
167
|
if (live) setGroup(plate);
|
|
@@ -171,7 +172,7 @@ function FloatingPanel(param) {
|
|
|
171
172
|
return function () {
|
|
172
173
|
live = false;
|
|
173
174
|
};
|
|
174
|
-
}, [anchored, open,
|
|
175
|
+
}, [anchored, open, iconCover, anchorMode, groupSurface]);
|
|
175
176
|
var handleBackdropPress = useCallback(function () {
|
|
176
177
|
if (backdropArmed) close();
|
|
177
178
|
}, [backdropArmed, close]);
|
|
@@ -495,11 +496,11 @@ function FloatingPanel(param) {
|
|
|
495
496
|
right: windowWidth - ((_ref4 = safeArea === null || safeArea === void 0 ? void 0 : safeArea.right) !== null && _ref4 !== void 0 ? _ref4 : 0) - panelViewportPadding,
|
|
496
497
|
bottom: windowHeight - Math.max((_ref5 = safeArea === null || safeArea === void 0 ? void 0 : safeArea.bottom) !== null && _ref5 !== void 0 ? _ref5 : 0, keyboardInset) - panelViewportPadding
|
|
497
498
|
},
|
|
498
|
-
echo: triggerEcho && !
|
|
499
|
+
echo: triggerEcho && !iconCover && !popUp ? triggerRow !== null && triggerRow !== void 0 ? triggerRow : trigger : null,
|
|
499
500
|
echoLabel: triggerA11y === null || triggerA11y === void 0 ? void 0 : triggerA11y.label,
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
group:
|
|
501
|
+
popUp,
|
|
502
|
+
iconCover: iconCover && anchorMode !== "attach",
|
|
503
|
+
group: iconCover && anchorMode !== "attach" ? group !== null && group !== void 0 ? group : null : null,
|
|
503
504
|
coverAlign: anchorMode === "attach" ? "start" : coverAlign,
|
|
504
505
|
panelWidth,
|
|
505
506
|
triggerRadius: anchorMode === "attach" ? null : triggerRadius,
|
|
@@ -561,7 +562,7 @@ function FloatingPanel(param) {
|
|
|
561
562
|
accessibilityLabel: t("Close"),
|
|
562
563
|
children: /* @__PURE__ */_jsx(View, {
|
|
563
564
|
flex: 1,
|
|
564
|
-
backgroundColor:
|
|
565
|
+
backgroundColor: overlayScrim
|
|
565
566
|
})
|
|
566
567
|
}),
|
|
567
568
|
/*
|
|
@@ -594,6 +595,11 @@ function FloatingPanel(param) {
|
|
|
594
595
|
...knobProps.elevatedSurface,
|
|
595
596
|
borderBottomLeftRadius: 0,
|
|
596
597
|
borderBottomRightRadius: 0,
|
|
598
|
+
// A sheet spans the screen: only its top edge meets the page,
|
|
599
|
+
// so no side border gutters a full-width row (FZ-8557).
|
|
600
|
+
borderLeftWidth: 0,
|
|
601
|
+
borderRightWidth: 0,
|
|
602
|
+
borderBottomWidth: 0,
|
|
597
603
|
maxHeight,
|
|
598
604
|
flexShrink: 1,
|
|
599
605
|
minHeight: 0,
|
|
@@ -602,13 +608,12 @@ function FloatingPanel(param) {
|
|
|
602
608
|
...(sheetFill ? {
|
|
603
609
|
height: maxHeight
|
|
604
610
|
} : void 0),
|
|
605
|
-
paddingTop: "$2",
|
|
606
611
|
paddingBottom: sheetBottomPadding,
|
|
607
612
|
// VoiceOver escape gesture (two-finger Z) dismisses the sheet.
|
|
608
613
|
onAccessibilityEscape: close,
|
|
609
614
|
children: [
|
|
610
615
|
/*
|
|
611
|
-
The grab ZONE, not just the
|
|
616
|
+
The grab ZONE, not just the 5pt pill: a 5pt tall target is
|
|
612
617
|
unhittable. The gesture lives here rather than on the whole
|
|
613
618
|
sheet so it never fights the ScrollView inside it, which is the
|
|
614
619
|
same division iOS uses.
|
|
@@ -618,17 +623,10 @@ function FloatingPanel(param) {
|
|
|
618
623
|
...panResponder.panHandlers,
|
|
619
624
|
accessibilityRole: "adjustable",
|
|
620
625
|
accessibilityLabel: t("Drag to resize"),
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
alignItems: "center",
|
|
624
|
-
paddingTop: 4,
|
|
625
|
-
paddingBottom: 12
|
|
626
|
-
},
|
|
626
|
+
testID: "floating-panel-grabber",
|
|
627
|
+
style: sheetGrabberZone,
|
|
627
628
|
children: /* @__PURE__ */_jsx(View, {
|
|
628
|
-
|
|
629
|
-
height: 4,
|
|
630
|
-
borderRadius: 2,
|
|
631
|
-
backgroundColor: "$color8"
|
|
629
|
+
...sheetGrabber
|
|
632
630
|
})
|
|
633
631
|
}), /* @__PURE__ */_jsx(YStack, {
|
|
634
632
|
padding: framePadding,
|
|
@@ -638,9 +636,12 @@ function FloatingPanel(param) {
|
|
|
638
636
|
flex: 1,
|
|
639
637
|
minHeight: 0
|
|
640
638
|
} : void 0),
|
|
641
|
-
children: /* @__PURE__ */
|
|
639
|
+
children: /* @__PURE__ */_jsx(Surface, {
|
|
642
640
|
size: "$true",
|
|
643
|
-
children:
|
|
641
|
+
children: /* @__PURE__ */_jsxs(PanelSheetContext.Provider, {
|
|
642
|
+
value: true,
|
|
643
|
+
children: [header, content]
|
|
644
|
+
})
|
|
644
645
|
})
|
|
645
646
|
})]
|
|
646
647
|
})
|
|
@@ -657,8 +658,8 @@ function TriggerMenuPanel(param) {
|
|
|
657
658
|
bounds,
|
|
658
659
|
echo,
|
|
659
660
|
echoLabel,
|
|
660
|
-
|
|
661
|
-
|
|
661
|
+
popUp,
|
|
662
|
+
iconCover = false,
|
|
662
663
|
group = null,
|
|
663
664
|
coverAlign,
|
|
664
665
|
panelWidth,
|
|
@@ -669,15 +670,19 @@ function TriggerMenuPanel(param) {
|
|
|
669
670
|
onClose,
|
|
670
671
|
children
|
|
671
672
|
} = param;
|
|
672
|
-
var _ref, _ref1, _ref2, _ref3, _ref4, _ref5
|
|
673
|
+
var _ref, _ref1, _ref2, _ref3, _ref4, _ref5;
|
|
673
674
|
var {
|
|
674
675
|
knobProps
|
|
675
676
|
} = useResolvedKnobs({
|
|
676
677
|
painted: false
|
|
677
678
|
});
|
|
679
|
+
var glyphColor = useGlyphColor();
|
|
678
680
|
var [size, setSize] = useState(null);
|
|
679
|
-
var
|
|
680
|
-
var
|
|
681
|
+
var [contentHeight, setContentHeight] = useState(null);
|
|
682
|
+
var [scrolled, setScrolled] = useState(null);
|
|
683
|
+
var scrollRef = useRef(null);
|
|
684
|
+
var offsetRef = useRef(0);
|
|
685
|
+
var cover = anchor && iconCover ? iconCoverRect(anchor, group) : anchor;
|
|
681
686
|
var room = panelWidth === "screen" && anchor ? {
|
|
682
687
|
...bounds,
|
|
683
688
|
...screenBounds({
|
|
@@ -694,19 +699,79 @@ function TriggerMenuPanel(param) {
|
|
|
694
699
|
echo: echo != null,
|
|
695
700
|
floor: Math.max(MENU_MIN_WIDTH, (_ref1 = cover === null || cover === void 0 ? void 0 : cover.width) !== null && _ref1 !== void 0 ? _ref1 : 0)
|
|
696
701
|
});
|
|
697
|
-
var
|
|
702
|
+
var borderWidth = Number(knobProps.elevatedSurface.borderWidth) || 0;
|
|
703
|
+
var framePaddingToken = getTokenValue(framePadding, "space");
|
|
704
|
+
var framePaddingPx = typeof framePaddingToken === "number" ? framePaddingToken : 0;
|
|
705
|
+
var band = scrollArrowBand(knobProps.menuRow.minHeight);
|
|
706
|
+
var fit = anchor && (popUp === null || popUp === void 0 ? void 0 : popUp.row) && contentHeight != null ? placeCheckedOnField({
|
|
707
|
+
fieldTop: anchor.y,
|
|
708
|
+
fieldBottom: anchor.y + anchor.height,
|
|
709
|
+
rowTop: popUp.row.top + framePaddingPx,
|
|
710
|
+
rowHeight: popUp.row.height,
|
|
711
|
+
contentHeight,
|
|
712
|
+
boundsTop: bounds.top + borderWidth,
|
|
713
|
+
boundsBottom: bounds.bottom - borderWidth,
|
|
714
|
+
band
|
|
715
|
+
}) : null;
|
|
716
|
+
var scrollTop = (_ref2 = fit === null || fit === void 0 ? void 0 : fit.scrollTop) !== null && _ref2 !== void 0 ? _ref2 : 0;
|
|
717
|
+
var scrolls = fit != null && contentHeight != null && fit.height < contentHeight;
|
|
718
|
+
var placed = anchor && cover && size && (!popUp || fit) ? (attach ? placeBesideTrigger : placeOverTrigger)({
|
|
698
719
|
trigger: cover,
|
|
699
720
|
width: size.width,
|
|
700
721
|
height: size.height,
|
|
701
722
|
bounds: room,
|
|
702
723
|
rtl: I18nManager.isRTL,
|
|
703
724
|
align: coverAlign,
|
|
704
|
-
pinned:
|
|
725
|
+
pinned: iconCover
|
|
705
726
|
}) : null;
|
|
727
|
+
var placement = placed && fit ? {
|
|
728
|
+
...placed,
|
|
729
|
+
top: fit.top - borderWidth,
|
|
730
|
+
maxHeight: fit.height + 2 * borderWidth
|
|
731
|
+
} : placed;
|
|
732
|
+
useLayoutEffect(function () {
|
|
733
|
+
var _scrollRef_current;
|
|
734
|
+
offsetRef.current = scrollTop;
|
|
735
|
+
if (scrollTop > 0) (_scrollRef_current = scrollRef.current) === null || _scrollRef_current === void 0 ? void 0 : _scrollRef_current.scrollTo({
|
|
736
|
+
y: scrollTop,
|
|
737
|
+
animated: false
|
|
738
|
+
});
|
|
739
|
+
}, [scrollTop]);
|
|
740
|
+
var atRest = {
|
|
741
|
+
up: scrolls && scrollTop > scrollArrowThreshold,
|
|
742
|
+
down: scrolls && fit != null && contentHeight != null && contentHeight - scrollTop - fit.height > scrollArrowThreshold
|
|
743
|
+
};
|
|
744
|
+
var arrows = scrolled !== null && scrolled !== void 0 ? scrolled : atRest;
|
|
745
|
+
var handleScroll = function handleScroll2(event) {
|
|
746
|
+
if (!scrolls) return;
|
|
747
|
+
var {
|
|
748
|
+
contentOffset,
|
|
749
|
+
contentSize,
|
|
750
|
+
layoutMeasurement
|
|
751
|
+
} = event.nativeEvent;
|
|
752
|
+
offsetRef.current = contentOffset.y;
|
|
753
|
+
var up = contentOffset.y > scrollArrowThreshold;
|
|
754
|
+
var down = contentSize.height - contentOffset.y - layoutMeasurement.height > scrollArrowThreshold;
|
|
755
|
+
setScrolled(function (prev) {
|
|
756
|
+
return (prev === null || prev === void 0 ? void 0 : prev.up) === up && (prev === null || prev === void 0 ? void 0 : prev.down) === down ? prev : {
|
|
757
|
+
up,
|
|
758
|
+
down
|
|
759
|
+
};
|
|
760
|
+
});
|
|
761
|
+
};
|
|
762
|
+
var scrollPage = function scrollPage2(direction) {
|
|
763
|
+
var _ref6;
|
|
764
|
+
var _popUp_row, _scrollRef_current;
|
|
765
|
+
if (!fit) return;
|
|
766
|
+
var page = Math.max(band, fit.height - 2 * band - ((_ref6 = popUp === null || popUp === void 0 ? void 0 : (_popUp_row = popUp.row) === null || _popUp_row === void 0 ? void 0 : _popUp_row.height) !== null && _ref6 !== void 0 ? _ref6 : 0));
|
|
767
|
+
var next = offsetRef.current + (direction === "up" ? -page : page);
|
|
768
|
+
(_scrollRef_current = scrollRef.current) === null || _scrollRef_current === void 0 ? void 0 : _scrollRef_current.scrollTo({
|
|
769
|
+
y: Math.max(0, next),
|
|
770
|
+
animated: true
|
|
771
|
+
});
|
|
772
|
+
};
|
|
706
773
|
var half = cover ? Math.min(cover.width, cover.height) / 2 : void 0;
|
|
707
|
-
var radius = group != null &&
|
|
708
|
-
var borderWidth = Number(knobProps.elevatedSurface.borderWidth) || 0;
|
|
709
|
-
var echoOverlays = iconEchoOverlays(iconEchoKind, (_ref2 = placement === null || placement === void 0 ? void 0 : placement.up) !== null && _ref2 !== void 0 ? _ref2 : false);
|
|
774
|
+
var radius = group != null && iconCover ? Math.min(group.radius, half !== null && half !== void 0 ? half : group.radius) : triggerRadius != null && half != null ? Math.min(triggerRadius, half) : coverAlign === "auto" && half ? half : void 0;
|
|
710
775
|
var echoShift = anchor && placement ? echoOffset({
|
|
711
776
|
triggerLeft: anchor.x,
|
|
712
777
|
triggerRight: anchor.x + anchor.width,
|
|
@@ -716,6 +781,8 @@ function TriggerMenuPanel(param) {
|
|
|
716
781
|
}) : 0;
|
|
717
782
|
return /* @__PURE__ */_jsxs(RNView, {
|
|
718
783
|
style: StyleSheet.absoluteFill,
|
|
784
|
+
testID: "floating-panel-menu-layer",
|
|
785
|
+
accessibilityViewIsModal: true,
|
|
719
786
|
children: [/* @__PURE__ */_jsx(Pressable, {
|
|
720
787
|
style: StyleSheet.absoluteFill,
|
|
721
788
|
onPress: onBackdropPress,
|
|
@@ -795,86 +862,98 @@ function TriggerMenuPanel(param) {
|
|
|
795
862
|
children: echo
|
|
796
863
|
})
|
|
797
864
|
})
|
|
798
|
-
}) : null, iconEcho != null && anchor && !(placement === null || placement === void 0 ? void 0 : placement.up) && !echoOverlays ? /* @__PURE__ */_jsx(IconEchoBand, {
|
|
799
|
-
anchor,
|
|
800
|
-
cover: echoCover,
|
|
801
|
-
shift: echoShift,
|
|
802
|
-
borderWidth,
|
|
803
|
-
edge: "top",
|
|
804
|
-
children: iconEcho
|
|
805
865
|
}) : null, /* @__PURE__ */_jsx(RNScrollView, {
|
|
866
|
+
ref: scrollRef,
|
|
806
867
|
style: {
|
|
807
868
|
flexGrow: 0,
|
|
808
869
|
flexShrink: 1
|
|
809
870
|
},
|
|
810
871
|
keyboardShouldPersistTaps: "handled",
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
872
|
+
...(popUp ? {
|
|
873
|
+
contentOffset: {
|
|
874
|
+
x: 0,
|
|
875
|
+
y: scrollTop
|
|
876
|
+
},
|
|
877
|
+
scrollEnabled: scrolls,
|
|
878
|
+
bounces: scrolls,
|
|
879
|
+
onScroll: handleScroll,
|
|
880
|
+
scrollEventThrottle: 16
|
|
881
|
+
} : null),
|
|
882
|
+
children: /* @__PURE__ */_jsx(RNView, {
|
|
883
|
+
testID: "floating-panel-menu-content",
|
|
884
|
+
collapsable: false,
|
|
885
|
+
onLayout: popUp ? function (e) {
|
|
886
|
+
return setContentHeight(e.nativeEvent.layout.height);
|
|
887
|
+
} : void 0,
|
|
888
|
+
children: /* @__PURE__ */_jsx(YStack, {
|
|
889
|
+
padding: framePadding,
|
|
890
|
+
gap: frameGap,
|
|
822
891
|
children
|
|
823
892
|
})
|
|
824
893
|
})
|
|
825
|
-
}),
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
894
|
+
}), scrolls ? /* @__PURE__ */_jsxs(_Fragment, {
|
|
895
|
+
children: [/* @__PURE__ */_jsx(ScrollBand, {
|
|
896
|
+
direction: "up",
|
|
897
|
+
band,
|
|
898
|
+
visible: arrows.up,
|
|
899
|
+
glyphColor,
|
|
900
|
+
onPress: scrollPage
|
|
901
|
+
}), /* @__PURE__ */_jsx(ScrollBand, {
|
|
902
|
+
direction: "down",
|
|
903
|
+
band,
|
|
904
|
+
visible: arrows.down,
|
|
905
|
+
glyphColor,
|
|
906
|
+
onPress: scrollPage
|
|
907
|
+
})]
|
|
832
908
|
}) : null]
|
|
833
909
|
})
|
|
834
910
|
}))
|
|
835
911
|
})]
|
|
836
912
|
});
|
|
837
913
|
}
|
|
838
|
-
function
|
|
914
|
+
function ScrollBand(param) {
|
|
839
915
|
var {
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
children
|
|
916
|
+
direction,
|
|
917
|
+
band,
|
|
918
|
+
visible,
|
|
919
|
+
glyphColor,
|
|
920
|
+
onPress
|
|
846
921
|
} = param;
|
|
847
|
-
var
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
922
|
+
var {
|
|
923
|
+
knobProps
|
|
924
|
+
} = useResolvedKnobs({
|
|
925
|
+
painted: false
|
|
926
|
+
});
|
|
927
|
+
var Icon = direction === "up" ? CaretUpIcon : CaretDownIcon;
|
|
928
|
+
if (!visible) return null;
|
|
929
|
+
return /* @__PURE__ */_jsx(Pressable, {
|
|
930
|
+
testID: `floating-panel-scroll-${direction}`,
|
|
931
|
+
onPress: function onPress1() {
|
|
932
|
+
return onPress(direction);
|
|
933
|
+
},
|
|
934
|
+
accessibilityElementsHidden: true,
|
|
935
|
+
importantForAccessibility: "no-hide-descendants",
|
|
936
|
+
style: {
|
|
853
937
|
position: "absolute",
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
height: bandHeight,
|
|
861
|
-
marginHorizontal: -borderWidth,
|
|
862
|
-
...(edge === "top" ? {
|
|
863
|
-
marginTop: -borderWidth
|
|
938
|
+
start: 0,
|
|
939
|
+
end: 0,
|
|
940
|
+
height: band,
|
|
941
|
+
zIndex: 1,
|
|
942
|
+
...(direction === "up" ? {
|
|
943
|
+
top: 0
|
|
864
944
|
} : {
|
|
865
|
-
|
|
945
|
+
bottom: 0
|
|
866
946
|
})
|
|
867
947
|
},
|
|
868
|
-
children: /* @__PURE__ */_jsx(
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
}
|
|
877
|
-
children
|
|
948
|
+
children: /* @__PURE__ */_jsx(View, {
|
|
949
|
+
flex: 1,
|
|
950
|
+
alignItems: "center",
|
|
951
|
+
justifyContent: "center",
|
|
952
|
+
backgroundColor: knobProps.elevatedSurface.backgroundColor,
|
|
953
|
+
children: /* @__PURE__ */_jsx(Icon, {
|
|
954
|
+
size: knobProps.controlIcon.width,
|
|
955
|
+
color: glyphColor
|
|
956
|
+
})
|
|
878
957
|
})
|
|
879
958
|
});
|
|
880
959
|
}
|
|
@@ -904,6 +983,8 @@ function PointPanel(param) {
|
|
|
904
983
|
}) : null;
|
|
905
984
|
return /* @__PURE__ */_jsxs(RNView, {
|
|
906
985
|
style: StyleSheet.absoluteFill,
|
|
986
|
+
testID: "floating-panel-point-layer",
|
|
987
|
+
accessibilityViewIsModal: true,
|
|
907
988
|
children: [/* @__PURE__ */_jsx(Pressable, {
|
|
908
989
|
style: StyleSheet.absoluteFill,
|
|
909
990
|
onPress: onBackdropPress,
|