@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
|
@@ -38,12 +38,14 @@ __export(index_native_exports, {
|
|
|
38
38
|
});
|
|
39
39
|
module.exports = __toCommonJS(index_native_exports);
|
|
40
40
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
41
|
+
var import_react = require("@phosphor-icons/react");
|
|
41
42
|
var import_theme = require("@multiplatform.one/theme");
|
|
42
|
-
var
|
|
43
|
+
var import_react2 = require("react");
|
|
43
44
|
var import_react_native = require("react-native");
|
|
44
45
|
var import_react_native_safe_area_context = require("react-native-safe-area-context");
|
|
45
46
|
var import_theme2 = require("@multiplatform.one/theme");
|
|
46
47
|
var import_tamagui = require("tamagui");
|
|
48
|
+
var import_checkedOnField = require("../shared/checkedOnField.native.js");
|
|
47
49
|
var import_overlayStack = require("../shared/overlayStack.native.js");
|
|
48
50
|
var import_OverlayWindow = require("../shared/OverlayWindow.native.js");
|
|
49
51
|
var import_t = require("../shared/t.native.js");
|
|
@@ -56,7 +58,6 @@ var import_pointAnchor = require("./pointAnchor.native.js");
|
|
|
56
58
|
var import_RegularPanel = require("./RegularPanel.native.js");
|
|
57
59
|
var import_useFloatingPanel = require("./useFloatingPanel.native.js");
|
|
58
60
|
var import_trailingAction = require("./trailingAction.native.js");
|
|
59
|
-
var import_iconEcho = require("./iconEcho.native.js");
|
|
60
61
|
var import_coverRect = require("./coverRect.native.js");
|
|
61
62
|
var import_iconButtonGroupContext = require("../Button/iconButtonGroupContext.native.js");
|
|
62
63
|
var import_useFloatingPanel2 = require("./useFloatingPanel.native.js");
|
|
@@ -91,7 +92,8 @@ function FloatingPanel(param) {
|
|
|
91
92
|
triggerRow,
|
|
92
93
|
triggerEcho = true,
|
|
93
94
|
coverAlign = "start",
|
|
94
|
-
|
|
95
|
+
iconCover = false,
|
|
96
|
+
popUp,
|
|
95
97
|
anchorMode,
|
|
96
98
|
panelWidth = "content",
|
|
97
99
|
sheet,
|
|
@@ -104,7 +106,6 @@ function FloatingPanel(param) {
|
|
|
104
106
|
} = (0, import_theme2.useResolvedKnobs)({
|
|
105
107
|
painted: false
|
|
106
108
|
});
|
|
107
|
-
var triggerSurface = import_theme2.SurfaceContext.useStyledContext();
|
|
108
109
|
var windowZIndex = (0, import_overlayStack.useOverlayZIndex)("sheet");
|
|
109
110
|
var children = /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_iconButtonGroupContext.IconButtonGroupSurfaceContext.Provider, {
|
|
110
111
|
value: null,
|
|
@@ -117,7 +118,7 @@ function FloatingPanel(param) {
|
|
|
117
118
|
var slideTransition = knobProps.motion.slide.transition;
|
|
118
119
|
var enterDuration = (0, import_theme2.motionDurationMs)(slideTransition);
|
|
119
120
|
var scrimDuration = (0, import_theme2.motionDurationMs)(knobProps.motion.scrim.transition);
|
|
120
|
-
var motionDurationRef = (0,
|
|
121
|
+
var motionDurationRef = (0, import_react2.useRef)({
|
|
121
122
|
enterDuration,
|
|
122
123
|
scrimDuration
|
|
123
124
|
});
|
|
@@ -131,18 +132,18 @@ function FloatingPanel(param) {
|
|
|
131
132
|
height: windowHeight
|
|
132
133
|
} = (0, import_react_native.useWindowDimensions)();
|
|
133
134
|
var keyboardInset = (0, import_useKeyboardInset.useKeyboardInset)();
|
|
134
|
-
var safeArea = (_useContext = (0,
|
|
135
|
+
var safeArea = (_useContext = (0, import_react2.useContext)(import_react_native_safe_area_context.SafeAreaInsetsContext)) !== null && _useContext !== void 0 ? _useContext : import_react_native_safe_area_context.initialWindowMetrics === null || import_react_native_safe_area_context.initialWindowMetrics === void 0 ? void 0 : import_react_native_safe_area_context.initialWindowMetrics.insets;
|
|
135
136
|
var topInset = (_ref = safeArea === null || safeArea === void 0 ? void 0 : safeArea.top) !== null && _ref !== void 0 ? _ref : 0;
|
|
136
|
-
var [pressPoint, setPressPoint] = (0,
|
|
137
|
-
var [backdropArmed, setBackdropArmed] = (0,
|
|
138
|
-
var armTimerRef = (0,
|
|
139
|
-
var close = (0,
|
|
137
|
+
var [pressPoint, setPressPoint] = (0, import_react2.useState)(null);
|
|
138
|
+
var [backdropArmed, setBackdropArmed] = (0, import_react2.useState)(false);
|
|
139
|
+
var armTimerRef = (0, import_react2.useRef)(null);
|
|
140
|
+
var close = (0, import_react2.useCallback)(function () {
|
|
140
141
|
return onOpenChange(false);
|
|
141
142
|
}, [onOpenChange]);
|
|
142
|
-
var handleTriggerPress = (0,
|
|
143
|
+
var handleTriggerPress = (0, import_react2.useCallback)(function () {
|
|
143
144
|
if (!disabled) onOpenChange(!open);
|
|
144
145
|
}, [disabled, onOpenChange, open]);
|
|
145
|
-
var handleTriggerLongPress = (0,
|
|
146
|
+
var handleTriggerLongPress = (0, import_react2.useCallback)(function (event) {
|
|
146
147
|
var _ref12;
|
|
147
148
|
if (disabled) return;
|
|
148
149
|
var {
|
|
@@ -156,25 +157,25 @@ function FloatingPanel(param) {
|
|
|
156
157
|
onOpenChange(true);
|
|
157
158
|
}, [disabled, onOpenChange]);
|
|
158
159
|
var isContextMenu = openOn === "contextmenu";
|
|
159
|
-
var triggerOwn = isContextMenu && /* @__PURE__ */(0,
|
|
160
|
+
var triggerOwn = isContextMenu && /* @__PURE__ */(0, import_react2.isValidElement)(trigger) ? trigger.props : void 0;
|
|
160
161
|
var triggerLabel = (_ref1 = (_ref2 = triggerA11y === null || triggerA11y === void 0 ? void 0 : triggerA11y.label) !== null && _ref2 !== void 0 ? _ref2 : triggerOwn === null || triggerOwn === void 0 ? void 0 : triggerOwn["aria-label"]) !== null && _ref1 !== void 0 ? _ref1 : triggerOwn === null || triggerOwn === void 0 ? void 0 : triggerOwn.accessibilityLabel;
|
|
161
162
|
var regular = (0, import_overlaySizeClass.overlaySizeClass)(windowWidth) === "regular";
|
|
162
163
|
var atPoint = isContextMenu && pressPoint !== null && regular;
|
|
163
164
|
var insideOverlay = (0, import_overlayStack.useInsideOverlay)();
|
|
164
|
-
var asMenu = isContextMenu ? compactFace === "menu" : (0, import_compactFace.resolveCompactFace)(compactFace, insideOverlay) === "menu";
|
|
165
|
+
var asMenu = isContextMenu ? compactFace === "menu" : (0, import_compactFace.resolveCompactFace)(compactFace, insideOverlay) === "menu" || popUp != null && regular;
|
|
165
166
|
var asRegular = regular && !asMenu && !isContextMenu && sheet !== true;
|
|
166
167
|
var anchored = asMenu || asRegular;
|
|
167
|
-
var triggerRef = (0,
|
|
168
|
-
var [anchor, setAnchor] = (0,
|
|
168
|
+
var triggerRef = (0, import_react2.useRef)(null);
|
|
169
|
+
var [anchor, setAnchor] = (0, import_react2.useState)(null);
|
|
169
170
|
var groupSurface = (0, import_iconButtonGroupContext.useIconButtonGroupSurface)();
|
|
170
|
-
var [group, setGroup] = (0,
|
|
171
|
-
var [triggerRadius, setTriggerRadius] = (0,
|
|
172
|
-
var reportTriggerRadius = (0,
|
|
171
|
+
var [group, setGroup] = (0, import_react2.useState)(null);
|
|
172
|
+
var [triggerRadius, setTriggerRadius] = (0, import_react2.useState)(null);
|
|
173
|
+
var reportTriggerRadius = (0, import_react2.useCallback)(function (radius) {
|
|
173
174
|
return setTriggerRadius(function (prev) {
|
|
174
175
|
return prev === radius ? prev : radius;
|
|
175
176
|
});
|
|
176
177
|
}, []);
|
|
177
|
-
(0,
|
|
178
|
+
(0, import_react2.useLayoutEffect)(function () {
|
|
178
179
|
if (!anchored || !open) {
|
|
179
180
|
setAnchor(null);
|
|
180
181
|
setGroup(null);
|
|
@@ -199,7 +200,7 @@ function FloatingPanel(param) {
|
|
|
199
200
|
height: 0
|
|
200
201
|
});
|
|
201
202
|
}
|
|
202
|
-
if (
|
|
203
|
+
if (iconCover && anchorMode !== "attach" && groupSurface) {
|
|
203
204
|
setGroup(void 0);
|
|
204
205
|
groupSurface.measure(function (plate) {
|
|
205
206
|
if (live) setGroup(plate);
|
|
@@ -210,8 +211,8 @@ function FloatingPanel(param) {
|
|
|
210
211
|
return function () {
|
|
211
212
|
live = false;
|
|
212
213
|
};
|
|
213
|
-
}, [anchored, open,
|
|
214
|
-
var handleBackdropPress = (0,
|
|
214
|
+
}, [anchored, open, iconCover, anchorMode, groupSurface]);
|
|
215
|
+
var handleBackdropPress = (0, import_react2.useCallback)(function () {
|
|
215
216
|
if (backdropArmed) close();
|
|
216
217
|
}, [backdropArmed, close]);
|
|
217
218
|
var framePadding = contentPadding === "none" ? "$0" : knobProps.panelPadding.padding;
|
|
@@ -219,10 +220,10 @@ function FloatingPanel(param) {
|
|
|
219
220
|
var available = Math.max(0, windowHeight - keyboardInset);
|
|
220
221
|
var maxHeight = Math.max(minSheetHeight, Math.round(Math.min(windowHeight * sheetMaxHeightRatio, available - topInset - backdropStrip)));
|
|
221
222
|
var sheetBottomPadding = keyboardInset > 0 ? 8 : bottomInset;
|
|
222
|
-
var [measuredHeight, setMeasuredHeight] = (0,
|
|
223
|
+
var [measuredHeight, setMeasuredHeight] = (0, import_react2.useState)(0);
|
|
223
224
|
var travel = measuredHeight || maxHeight;
|
|
224
225
|
var isSheet = !!scrollable || !!sheetFill;
|
|
225
|
-
var detents = (0,
|
|
226
|
+
var detents = (0, import_react2.useMemo)(function () {
|
|
226
227
|
if (!isSheet) return [travel];
|
|
227
228
|
var points = [travel, Math.round(travel * mediumDetent)].filter(function (h) {
|
|
228
229
|
return h >= Math.min(minSheetHeight, travel);
|
|
@@ -231,20 +232,20 @@ function FloatingPanel(param) {
|
|
|
231
232
|
return b - a;
|
|
232
233
|
});
|
|
233
234
|
}, [isSheet, travel]);
|
|
234
|
-
var translateY = (0,
|
|
235
|
-
var restRef = (0,
|
|
236
|
-
var travelRef = (0,
|
|
237
|
-
var detentsRef = (0,
|
|
235
|
+
var translateY = (0, import_react2.useRef)(new import_react_native.Animated.Value(1e4)).current;
|
|
236
|
+
var restRef = (0, import_react2.useRef)(1e4);
|
|
237
|
+
var travelRef = (0, import_react2.useRef)(travel);
|
|
238
|
+
var detentsRef = (0, import_react2.useRef)(detents);
|
|
238
239
|
travelRef.current = travel;
|
|
239
240
|
detentsRef.current = detents;
|
|
240
|
-
var presentationRef = (0,
|
|
241
|
-
var activeRef = (0,
|
|
242
|
-
var frameCap = (0,
|
|
243
|
-
var maxHeightRef = (0,
|
|
244
|
-
var restHeightRef = (0,
|
|
245
|
-
var naturalRef = (0,
|
|
246
|
-
var filledRef = (0,
|
|
247
|
-
(0,
|
|
241
|
+
var presentationRef = (0, import_react2.useRef)(0);
|
|
242
|
+
var activeRef = (0, import_react2.useRef)(false);
|
|
243
|
+
var frameCap = (0, import_react2.useRef)(new import_react_native.Animated.Value(maxHeight)).current;
|
|
244
|
+
var maxHeightRef = (0, import_react2.useRef)(maxHeight);
|
|
245
|
+
var restHeightRef = (0, import_react2.useRef)(null);
|
|
246
|
+
var naturalRef = (0, import_react2.useRef)(0);
|
|
247
|
+
var filledRef = (0, import_react2.useRef)(false);
|
|
248
|
+
(0, import_react2.useLayoutEffect)(function () {
|
|
248
249
|
maxHeightRef.current = maxHeight;
|
|
249
250
|
var rest = restHeightRef.current;
|
|
250
251
|
frameCap.setValue(rest === null ? maxHeight : Math.min(maxHeight, rest));
|
|
@@ -252,13 +253,13 @@ function FloatingPanel(param) {
|
|
|
252
253
|
setMeasuredHeight(filledRef.current ? maxHeight : Math.min(naturalRef.current, maxHeight));
|
|
253
254
|
}
|
|
254
255
|
}, [frameCap, maxHeight]);
|
|
255
|
-
var restAt = (0,
|
|
256
|
+
var restAt = (0, import_react2.useCallback)(function (height) {
|
|
256
257
|
restHeightRef.current = height;
|
|
257
258
|
frameCap.setValue(Math.min(maxHeightRef.current, height));
|
|
258
259
|
restRef.current = 0;
|
|
259
260
|
translateY.setValue(0);
|
|
260
261
|
}, [frameCap, translateY]);
|
|
261
|
-
var releaseRest = (0,
|
|
262
|
+
var releaseRest = (0, import_react2.useCallback)(function () {
|
|
262
263
|
var rest = restHeightRef.current;
|
|
263
264
|
if (rest === null) return;
|
|
264
265
|
restHeightRef.current = null;
|
|
@@ -267,7 +268,7 @@ function FloatingPanel(param) {
|
|
|
267
268
|
restRef.current = offset;
|
|
268
269
|
translateY.setValue(offset);
|
|
269
270
|
}, [frameCap, translateY]);
|
|
270
|
-
var settleTo = (0,
|
|
271
|
+
var settleTo = (0, import_react2.useCallback)(function (height) {
|
|
271
272
|
var velocity = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0;
|
|
272
273
|
var presentation = presentationRef.current;
|
|
273
274
|
var toValue = Math.max(0, travelRef.current - height);
|
|
@@ -292,7 +293,7 @@ function FloatingPanel(param) {
|
|
|
292
293
|
if (activeRef.current && presentation === presentationRef.current) restAt(height);
|
|
293
294
|
});
|
|
294
295
|
}, [restAt, translateY, springConfig]);
|
|
295
|
-
var dismiss = (0,
|
|
296
|
+
var dismiss = (0, import_react2.useCallback)(function () {
|
|
296
297
|
var velocity = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 0;
|
|
297
298
|
if (!activeRef.current) return;
|
|
298
299
|
if (!springConfig) {
|
|
@@ -314,7 +315,7 @@ function FloatingPanel(param) {
|
|
|
314
315
|
if (finished && activeRef.current && presentation === presentationRef.current) close();
|
|
315
316
|
});
|
|
316
317
|
}, [close, translateY, springConfig]);
|
|
317
|
-
var panResponder = (0,
|
|
318
|
+
var panResponder = (0, import_react2.useMemo)(function () {
|
|
318
319
|
return import_react_native.PanResponder.create({
|
|
319
320
|
onStartShouldSetPanResponder: function onStartShouldSetPanResponder() {
|
|
320
321
|
return true;
|
|
@@ -383,8 +384,8 @@ function FloatingPanel(param) {
|
|
|
383
384
|
}
|
|
384
385
|
});
|
|
385
386
|
}, [dismiss, releaseRest, settleTo, translateY]);
|
|
386
|
-
var enteredRef = (0,
|
|
387
|
-
var enter = (0,
|
|
387
|
+
var enteredRef = (0, import_react2.useRef)(false);
|
|
388
|
+
var enter = (0, import_react2.useCallback)(function () {
|
|
388
389
|
if (!activeRef.current || enteredRef.current) return;
|
|
389
390
|
var presentation = presentationRef.current;
|
|
390
391
|
enteredRef.current = true;
|
|
@@ -409,7 +410,7 @@ function FloatingPanel(param) {
|
|
|
409
410
|
if (finished && activeRef.current && presentation === presentationRef.current) translateY.setValue(0);
|
|
410
411
|
});
|
|
411
412
|
}, [translateY]);
|
|
412
|
-
(0,
|
|
413
|
+
(0, import_react2.useEffect)(function () {
|
|
413
414
|
presentationRef.current += 1;
|
|
414
415
|
activeRef.current = open;
|
|
415
416
|
restHeightRef.current = null;
|
|
@@ -534,11 +535,11 @@ function FloatingPanel(param) {
|
|
|
534
535
|
right: windowWidth - ((_ref4 = safeArea === null || safeArea === void 0 ? void 0 : safeArea.right) !== null && _ref4 !== void 0 ? _ref4 : 0) - import_useFloatingPanel.panelViewportPadding,
|
|
535
536
|
bottom: windowHeight - Math.max((_ref5 = safeArea === null || safeArea === void 0 ? void 0 : safeArea.bottom) !== null && _ref5 !== void 0 ? _ref5 : 0, keyboardInset) - import_useFloatingPanel.panelViewportPadding
|
|
536
537
|
},
|
|
537
|
-
echo: triggerEcho && !
|
|
538
|
+
echo: triggerEcho && !iconCover && !popUp ? triggerRow !== null && triggerRow !== void 0 ? triggerRow : trigger : null,
|
|
538
539
|
echoLabel: triggerA11y === null || triggerA11y === void 0 ? void 0 : triggerA11y.label,
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
group:
|
|
540
|
+
popUp,
|
|
541
|
+
iconCover: iconCover && anchorMode !== "attach",
|
|
542
|
+
group: iconCover && anchorMode !== "attach" ? group !== null && group !== void 0 ? group : null : null,
|
|
542
543
|
coverAlign: anchorMode === "attach" ? "start" : coverAlign,
|
|
543
544
|
panelWidth,
|
|
544
545
|
triggerRadius: anchorMode === "attach" ? null : triggerRadius,
|
|
@@ -600,7 +601,7 @@ function FloatingPanel(param) {
|
|
|
600
601
|
accessibilityLabel: (0, import_t.t)("Close"),
|
|
601
602
|
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_tamagui.View, {
|
|
602
603
|
flex: 1,
|
|
603
|
-
backgroundColor:
|
|
604
|
+
backgroundColor: import_theme.overlayScrim
|
|
604
605
|
})
|
|
605
606
|
}),
|
|
606
607
|
/*
|
|
@@ -633,6 +634,11 @@ function FloatingPanel(param) {
|
|
|
633
634
|
...knobProps.elevatedSurface,
|
|
634
635
|
borderBottomLeftRadius: 0,
|
|
635
636
|
borderBottomRightRadius: 0,
|
|
637
|
+
// A sheet spans the screen: only its top edge meets the page,
|
|
638
|
+
// so no side border gutters a full-width row (FZ-8557).
|
|
639
|
+
borderLeftWidth: 0,
|
|
640
|
+
borderRightWidth: 0,
|
|
641
|
+
borderBottomWidth: 0,
|
|
636
642
|
maxHeight,
|
|
637
643
|
flexShrink: 1,
|
|
638
644
|
minHeight: 0,
|
|
@@ -641,13 +647,12 @@ function FloatingPanel(param) {
|
|
|
641
647
|
...(sheetFill ? {
|
|
642
648
|
height: maxHeight
|
|
643
649
|
} : void 0),
|
|
644
|
-
paddingTop: "$2",
|
|
645
650
|
paddingBottom: sheetBottomPadding,
|
|
646
651
|
// VoiceOver escape gesture (two-finger Z) dismisses the sheet.
|
|
647
652
|
onAccessibilityEscape: close,
|
|
648
653
|
children: [
|
|
649
654
|
/*
|
|
650
|
-
The grab ZONE, not just the
|
|
655
|
+
The grab ZONE, not just the 5pt pill: a 5pt tall target is
|
|
651
656
|
unhittable. The gesture lives here rather than on the whole
|
|
652
657
|
sheet so it never fights the ScrollView inside it, which is the
|
|
653
658
|
same division iOS uses.
|
|
@@ -657,17 +662,10 @@ function FloatingPanel(param) {
|
|
|
657
662
|
...panResponder.panHandlers,
|
|
658
663
|
accessibilityRole: "adjustable",
|
|
659
664
|
accessibilityLabel: (0, import_t.t)("Drag to resize"),
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
alignItems: "center",
|
|
663
|
-
paddingTop: 4,
|
|
664
|
-
paddingBottom: 12
|
|
665
|
-
},
|
|
665
|
+
testID: "floating-panel-grabber",
|
|
666
|
+
style: import_theme.sheetGrabberZone,
|
|
666
667
|
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_tamagui.View, {
|
|
667
|
-
|
|
668
|
-
height: 4,
|
|
669
|
-
borderRadius: 2,
|
|
670
|
-
backgroundColor: "$color8"
|
|
668
|
+
...import_theme.sheetGrabber
|
|
671
669
|
})
|
|
672
670
|
}), /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_tamagui.YStack, {
|
|
673
671
|
padding: framePadding,
|
|
@@ -677,9 +675,12 @@ function FloatingPanel(param) {
|
|
|
677
675
|
flex: 1,
|
|
678
676
|
minHeight: 0
|
|
679
677
|
} : void 0),
|
|
680
|
-
children: /* @__PURE__ */(0, import_jsx_runtime.
|
|
678
|
+
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_theme2.Surface, {
|
|
681
679
|
size: "$true",
|
|
682
|
-
children:
|
|
680
|
+
children: /* @__PURE__ */(0, import_jsx_runtime.jsxs)(import_echoContext.PanelSheetContext.Provider, {
|
|
681
|
+
value: true,
|
|
682
|
+
children: [header, content]
|
|
683
|
+
})
|
|
683
684
|
})
|
|
684
685
|
})]
|
|
685
686
|
})
|
|
@@ -696,8 +697,8 @@ function TriggerMenuPanel(param) {
|
|
|
696
697
|
bounds,
|
|
697
698
|
echo,
|
|
698
699
|
echoLabel,
|
|
699
|
-
|
|
700
|
-
|
|
700
|
+
popUp,
|
|
701
|
+
iconCover = false,
|
|
701
702
|
group = null,
|
|
702
703
|
coverAlign,
|
|
703
704
|
panelWidth,
|
|
@@ -708,15 +709,19 @@ function TriggerMenuPanel(param) {
|
|
|
708
709
|
onClose,
|
|
709
710
|
children
|
|
710
711
|
} = param;
|
|
711
|
-
var _ref, _ref1, _ref2, _ref3, _ref4, _ref5
|
|
712
|
+
var _ref, _ref1, _ref2, _ref3, _ref4, _ref5;
|
|
712
713
|
var {
|
|
713
714
|
knobProps
|
|
714
715
|
} = (0, import_theme2.useResolvedKnobs)({
|
|
715
716
|
painted: false
|
|
716
717
|
});
|
|
717
|
-
var
|
|
718
|
-
var
|
|
719
|
-
var
|
|
718
|
+
var glyphColor = (0, import_theme2.useGlyphColor)();
|
|
719
|
+
var [size, setSize] = (0, import_react2.useState)(null);
|
|
720
|
+
var [contentHeight, setContentHeight] = (0, import_react2.useState)(null);
|
|
721
|
+
var [scrolled, setScrolled] = (0, import_react2.useState)(null);
|
|
722
|
+
var scrollRef = (0, import_react2.useRef)(null);
|
|
723
|
+
var offsetRef = (0, import_react2.useRef)(0);
|
|
724
|
+
var cover = anchor && iconCover ? (0, import_coverRect.iconCoverRect)(anchor, group) : anchor;
|
|
720
725
|
var room = panelWidth === "screen" && anchor ? {
|
|
721
726
|
...bounds,
|
|
722
727
|
...(0, import_panelWidth.screenBounds)({
|
|
@@ -733,19 +738,79 @@ function TriggerMenuPanel(param) {
|
|
|
733
738
|
echo: echo != null,
|
|
734
739
|
floor: Math.max(import_compactFace.MENU_MIN_WIDTH, (_ref1 = cover === null || cover === void 0 ? void 0 : cover.width) !== null && _ref1 !== void 0 ? _ref1 : 0)
|
|
735
740
|
});
|
|
736
|
-
var
|
|
741
|
+
var borderWidth = Number(knobProps.elevatedSurface.borderWidth) || 0;
|
|
742
|
+
var framePaddingToken = (0, import_tamagui.getTokenValue)(framePadding, "space");
|
|
743
|
+
var framePaddingPx = typeof framePaddingToken === "number" ? framePaddingToken : 0;
|
|
744
|
+
var band = (0, import_checkedOnField.scrollArrowBand)(knobProps.menuRow.minHeight);
|
|
745
|
+
var fit = anchor && (popUp === null || popUp === void 0 ? void 0 : popUp.row) && contentHeight != null ? (0, import_checkedOnField.placeCheckedOnField)({
|
|
746
|
+
fieldTop: anchor.y,
|
|
747
|
+
fieldBottom: anchor.y + anchor.height,
|
|
748
|
+
rowTop: popUp.row.top + framePaddingPx,
|
|
749
|
+
rowHeight: popUp.row.height,
|
|
750
|
+
contentHeight,
|
|
751
|
+
boundsTop: bounds.top + borderWidth,
|
|
752
|
+
boundsBottom: bounds.bottom - borderWidth,
|
|
753
|
+
band
|
|
754
|
+
}) : null;
|
|
755
|
+
var scrollTop = (_ref2 = fit === null || fit === void 0 ? void 0 : fit.scrollTop) !== null && _ref2 !== void 0 ? _ref2 : 0;
|
|
756
|
+
var scrolls = fit != null && contentHeight != null && fit.height < contentHeight;
|
|
757
|
+
var placed = anchor && cover && size && (!popUp || fit) ? (attach ? import_pointAnchor.placeBesideTrigger : import_pointAnchor.placeOverTrigger)({
|
|
737
758
|
trigger: cover,
|
|
738
759
|
width: size.width,
|
|
739
760
|
height: size.height,
|
|
740
761
|
bounds: room,
|
|
741
762
|
rtl: import_react_native.I18nManager.isRTL,
|
|
742
763
|
align: coverAlign,
|
|
743
|
-
pinned:
|
|
764
|
+
pinned: iconCover
|
|
744
765
|
}) : null;
|
|
766
|
+
var placement = placed && fit ? {
|
|
767
|
+
...placed,
|
|
768
|
+
top: fit.top - borderWidth,
|
|
769
|
+
maxHeight: fit.height + 2 * borderWidth
|
|
770
|
+
} : placed;
|
|
771
|
+
(0, import_react2.useLayoutEffect)(function () {
|
|
772
|
+
var _scrollRef_current;
|
|
773
|
+
offsetRef.current = scrollTop;
|
|
774
|
+
if (scrollTop > 0) (_scrollRef_current = scrollRef.current) === null || _scrollRef_current === void 0 ? void 0 : _scrollRef_current.scrollTo({
|
|
775
|
+
y: scrollTop,
|
|
776
|
+
animated: false
|
|
777
|
+
});
|
|
778
|
+
}, [scrollTop]);
|
|
779
|
+
var atRest = {
|
|
780
|
+
up: scrolls && scrollTop > import_checkedOnField.scrollArrowThreshold,
|
|
781
|
+
down: scrolls && fit != null && contentHeight != null && contentHeight - scrollTop - fit.height > import_checkedOnField.scrollArrowThreshold
|
|
782
|
+
};
|
|
783
|
+
var arrows = scrolled !== null && scrolled !== void 0 ? scrolled : atRest;
|
|
784
|
+
var handleScroll = function handleScroll2(event) {
|
|
785
|
+
if (!scrolls) return;
|
|
786
|
+
var {
|
|
787
|
+
contentOffset,
|
|
788
|
+
contentSize,
|
|
789
|
+
layoutMeasurement
|
|
790
|
+
} = event.nativeEvent;
|
|
791
|
+
offsetRef.current = contentOffset.y;
|
|
792
|
+
var up = contentOffset.y > import_checkedOnField.scrollArrowThreshold;
|
|
793
|
+
var down = contentSize.height - contentOffset.y - layoutMeasurement.height > import_checkedOnField.scrollArrowThreshold;
|
|
794
|
+
setScrolled(function (prev) {
|
|
795
|
+
return (prev === null || prev === void 0 ? void 0 : prev.up) === up && (prev === null || prev === void 0 ? void 0 : prev.down) === down ? prev : {
|
|
796
|
+
up,
|
|
797
|
+
down
|
|
798
|
+
};
|
|
799
|
+
});
|
|
800
|
+
};
|
|
801
|
+
var scrollPage = function scrollPage2(direction) {
|
|
802
|
+
var _ref6;
|
|
803
|
+
var _popUp_row, _scrollRef_current;
|
|
804
|
+
if (!fit) return;
|
|
805
|
+
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));
|
|
806
|
+
var next = offsetRef.current + (direction === "up" ? -page : page);
|
|
807
|
+
(_scrollRef_current = scrollRef.current) === null || _scrollRef_current === void 0 ? void 0 : _scrollRef_current.scrollTo({
|
|
808
|
+
y: Math.max(0, next),
|
|
809
|
+
animated: true
|
|
810
|
+
});
|
|
811
|
+
};
|
|
745
812
|
var half = cover ? Math.min(cover.width, cover.height) / 2 : void 0;
|
|
746
|
-
var radius = group != null &&
|
|
747
|
-
var borderWidth = Number(knobProps.elevatedSurface.borderWidth) || 0;
|
|
748
|
-
var echoOverlays = (0, import_iconEcho.iconEchoOverlays)(iconEchoKind, (_ref2 = placement === null || placement === void 0 ? void 0 : placement.up) !== null && _ref2 !== void 0 ? _ref2 : false);
|
|
813
|
+
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;
|
|
749
814
|
var echoShift = anchor && placement ? (0, import_panelWidth.echoOffset)({
|
|
750
815
|
triggerLeft: anchor.x,
|
|
751
816
|
triggerRight: anchor.x + anchor.width,
|
|
@@ -755,6 +820,8 @@ function TriggerMenuPanel(param) {
|
|
|
755
820
|
}) : 0;
|
|
756
821
|
return /* @__PURE__ */(0, import_jsx_runtime.jsxs)(import_react_native.View, {
|
|
757
822
|
style: import_react_native.StyleSheet.absoluteFill,
|
|
823
|
+
testID: "floating-panel-menu-layer",
|
|
824
|
+
accessibilityViewIsModal: true,
|
|
758
825
|
children: [/* @__PURE__ */(0, import_jsx_runtime.jsx)(import_react_native.Pressable, {
|
|
759
826
|
style: import_react_native.StyleSheet.absoluteFill,
|
|
760
827
|
onPress: onBackdropPress,
|
|
@@ -834,86 +901,98 @@ function TriggerMenuPanel(param) {
|
|
|
834
901
|
children: echo
|
|
835
902
|
})
|
|
836
903
|
})
|
|
837
|
-
}) : null, iconEcho != null && anchor && !(placement === null || placement === void 0 ? void 0 : placement.up) && !echoOverlays ? /* @__PURE__ */(0, import_jsx_runtime.jsx)(IconEchoBand, {
|
|
838
|
-
anchor,
|
|
839
|
-
cover: echoCover,
|
|
840
|
-
shift: echoShift,
|
|
841
|
-
borderWidth,
|
|
842
|
-
edge: "top",
|
|
843
|
-
children: iconEcho
|
|
844
904
|
}) : null, /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_react_native.ScrollView, {
|
|
905
|
+
ref: scrollRef,
|
|
845
906
|
style: {
|
|
846
907
|
flexGrow: 0,
|
|
847
908
|
flexShrink: 1
|
|
848
909
|
},
|
|
849
910
|
keyboardShouldPersistTaps: "handled",
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
911
|
+
...(popUp ? {
|
|
912
|
+
contentOffset: {
|
|
913
|
+
x: 0,
|
|
914
|
+
y: scrollTop
|
|
915
|
+
},
|
|
916
|
+
scrollEnabled: scrolls,
|
|
917
|
+
bounces: scrolls,
|
|
918
|
+
onScroll: handleScroll,
|
|
919
|
+
scrollEventThrottle: 16
|
|
920
|
+
} : null),
|
|
921
|
+
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_react_native.View, {
|
|
922
|
+
testID: "floating-panel-menu-content",
|
|
923
|
+
collapsable: false,
|
|
924
|
+
onLayout: popUp ? function (e) {
|
|
925
|
+
return setContentHeight(e.nativeEvent.layout.height);
|
|
926
|
+
} : void 0,
|
|
927
|
+
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_tamagui.YStack, {
|
|
928
|
+
padding: framePadding,
|
|
929
|
+
gap: frameGap,
|
|
861
930
|
children
|
|
862
931
|
})
|
|
863
932
|
})
|
|
864
|
-
}),
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
933
|
+
}), scrolls ? /* @__PURE__ */(0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, {
|
|
934
|
+
children: [/* @__PURE__ */(0, import_jsx_runtime.jsx)(ScrollBand, {
|
|
935
|
+
direction: "up",
|
|
936
|
+
band,
|
|
937
|
+
visible: arrows.up,
|
|
938
|
+
glyphColor,
|
|
939
|
+
onPress: scrollPage
|
|
940
|
+
}), /* @__PURE__ */(0, import_jsx_runtime.jsx)(ScrollBand, {
|
|
941
|
+
direction: "down",
|
|
942
|
+
band,
|
|
943
|
+
visible: arrows.down,
|
|
944
|
+
glyphColor,
|
|
945
|
+
onPress: scrollPage
|
|
946
|
+
})]
|
|
871
947
|
}) : null]
|
|
872
948
|
})
|
|
873
949
|
}))
|
|
874
950
|
})]
|
|
875
951
|
});
|
|
876
952
|
}
|
|
877
|
-
function
|
|
953
|
+
function ScrollBand(param) {
|
|
878
954
|
var {
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
children
|
|
955
|
+
direction,
|
|
956
|
+
band,
|
|
957
|
+
visible,
|
|
958
|
+
glyphColor,
|
|
959
|
+
onPress
|
|
885
960
|
} = param;
|
|
886
|
-
var
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
961
|
+
var {
|
|
962
|
+
knobProps
|
|
963
|
+
} = (0, import_theme2.useResolvedKnobs)({
|
|
964
|
+
painted: false
|
|
965
|
+
});
|
|
966
|
+
var Icon = direction === "up" ? import_react.CaretUpIcon : import_react.CaretDownIcon;
|
|
967
|
+
if (!visible) return null;
|
|
968
|
+
return /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_react_native.Pressable, {
|
|
969
|
+
testID: `floating-panel-scroll-${direction}`,
|
|
970
|
+
onPress: function onPress1() {
|
|
971
|
+
return onPress(direction);
|
|
972
|
+
},
|
|
973
|
+
accessibilityElementsHidden: true,
|
|
974
|
+
importantForAccessibility: "no-hide-descendants",
|
|
975
|
+
style: {
|
|
892
976
|
position: "absolute",
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
height: bandHeight,
|
|
900
|
-
marginHorizontal: -borderWidth,
|
|
901
|
-
...(edge === "top" ? {
|
|
902
|
-
marginTop: -borderWidth
|
|
977
|
+
start: 0,
|
|
978
|
+
end: 0,
|
|
979
|
+
height: band,
|
|
980
|
+
zIndex: 1,
|
|
981
|
+
...(direction === "up" ? {
|
|
982
|
+
top: 0
|
|
903
983
|
} : {
|
|
904
|
-
|
|
984
|
+
bottom: 0
|
|
905
985
|
})
|
|
906
986
|
},
|
|
907
|
-
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
}
|
|
916
|
-
children
|
|
987
|
+
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_tamagui.View, {
|
|
988
|
+
flex: 1,
|
|
989
|
+
alignItems: "center",
|
|
990
|
+
justifyContent: "center",
|
|
991
|
+
backgroundColor: knobProps.elevatedSurface.backgroundColor,
|
|
992
|
+
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(Icon, {
|
|
993
|
+
size: knobProps.controlIcon.width,
|
|
994
|
+
color: glyphColor
|
|
995
|
+
})
|
|
917
996
|
})
|
|
918
997
|
});
|
|
919
998
|
}
|
|
@@ -933,7 +1012,7 @@ function PointPanel(param) {
|
|
|
933
1012
|
} = (0, import_theme2.useResolvedKnobs)({
|
|
934
1013
|
painted: false
|
|
935
1014
|
});
|
|
936
|
-
var [size, setSize] = (0,
|
|
1015
|
+
var [size, setSize] = (0, import_react2.useState)(null);
|
|
937
1016
|
var placement = size ? (0, import_pointAnchor.placeAtPoint)({
|
|
938
1017
|
point,
|
|
939
1018
|
width: size.width,
|
|
@@ -943,6 +1022,8 @@ function PointPanel(param) {
|
|
|
943
1022
|
}) : null;
|
|
944
1023
|
return /* @__PURE__ */(0, import_jsx_runtime.jsxs)(import_react_native.View, {
|
|
945
1024
|
style: import_react_native.StyleSheet.absoluteFill,
|
|
1025
|
+
testID: "floating-panel-point-layer",
|
|
1026
|
+
accessibilityViewIsModal: true,
|
|
946
1027
|
children: [/* @__PURE__ */(0, import_jsx_runtime.jsx)(import_react_native.Pressable, {
|
|
947
1028
|
style: import_react_native.StyleSheet.absoluteFill,
|
|
948
1029
|
onPress: onBackdropPress,
|