@astryxdesign/core 0.7.7-canary.bf14580 → 0.7.7-canary.c19ca12
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/AlertDialog/AlertDialog.d.ts +4 -1
- package/dist/AlertDialog/AlertDialog.d.ts.map +1 -1
- package/dist/AlertDialog/AlertDialog.js +36 -6
- package/dist/BottomSheet/BottomSheet.d.ts.map +1 -1
- package/dist/BottomSheet/BottomSheet.js +76 -6
- package/dist/BottomSheet/BottomSheetPanel.d.ts.map +1 -1
- package/dist/BottomSheet/BottomSheetPanel.js +23 -4
- package/dist/BottomSheet/bottomSheetStack.d.ts.map +1 -1
- package/dist/BottomSheet/bottomSheetStack.js +5 -4
- package/dist/BottomSheet/useSheetGestures.d.ts.map +1 -1
- package/dist/BottomSheet/useSheetGestures.js +3 -1
- package/dist/Button/Button.d.ts.map +1 -1
- package/dist/Button/Button.js +47 -3
- package/dist/CheckboxInput/CheckboxInput.d.ts.map +1 -1
- package/dist/CheckboxInput/CheckboxInput.js +13 -2
- package/dist/ComplexSelector/ComplexSelector.d.ts +4 -1
- package/dist/ComplexSelector/ComplexSelector.d.ts.map +1 -1
- package/dist/ComplexSelector/ComplexSelector.js +14 -4
- package/dist/ContextMenu/ContextMenu.js +2 -2
- package/dist/DateInput/MonthScroller.d.ts.map +1 -1
- package/dist/DateInput/MonthScroller.js +13 -27
- package/dist/DateInput/Wheel.d.ts.map +1 -1
- package/dist/DateInput/Wheel.js +22 -41
- package/dist/Dialog/Dialog.d.ts.map +1 -1
- package/dist/Dialog/Dialog.js +7 -31
- package/dist/Field/Field.js +2 -2
- package/dist/HoverCard/HoverCard.d.ts +4 -3
- package/dist/HoverCard/HoverCard.d.ts.map +1 -1
- package/dist/HoverCard/HoverCard.js +27 -2
- package/dist/HoverCard/useHoverCard.d.ts +5 -4
- package/dist/HoverCard/useHoverCard.d.ts.map +1 -1
- package/dist/HoverCard/useHoverCard.js +17 -31
- package/dist/Icon/Icon.d.ts +5 -1
- package/dist/Icon/Icon.d.ts.map +1 -1
- package/dist/Icon/Icon.js +5 -2
- package/dist/Layer/layerAnimations.stylex.d.ts +7 -8
- package/dist/Layer/layerAnimations.stylex.d.ts.map +1 -1
- package/dist/Layer/layerAnimations.stylex.js +25 -20
- package/dist/Layer/usePressPin.d.ts +17 -5
- package/dist/Layer/usePressPin.d.ts.map +1 -1
- package/dist/Layer/usePressPin.js +62 -12
- package/dist/Lightbox/Lightbox.d.ts.map +1 -1
- package/dist/Lightbox/Lightbox.js +18 -0
- package/dist/PowerSearch/PowerSearch.d.ts +36 -3
- package/dist/PowerSearch/PowerSearch.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearch.js +522 -269
- package/dist/PowerSearch/PowerSearchBottomSheet.d.ts +100 -0
- package/dist/PowerSearch/PowerSearchBottomSheet.d.ts.map +1 -0
- package/dist/PowerSearch/PowerSearchBottomSheet.js +1913 -0
- package/dist/PowerSearch/PowerSearchEditPopover.d.ts +32 -1
- package/dist/PowerSearch/PowerSearchEditPopover.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearchEditPopover.js +17 -6
- package/dist/PowerSearch/PowerSearchValueEditor.d.ts +38 -3
- package/dist/PowerSearch/PowerSearchValueEditor.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearchValueEditor.js +170 -61
- package/dist/PowerSearch/formatFilterValue.d.ts +7 -0
- package/dist/PowerSearch/formatFilterValue.d.ts.map +1 -1
- package/dist/PowerSearch/formatFilterValue.js +11 -1
- package/dist/PowerSearch/formatTokenValue.d.ts +28 -0
- package/dist/PowerSearch/formatTokenValue.d.ts.map +1 -0
- package/dist/PowerSearch/formatTokenValue.js +160 -0
- package/dist/PowerSearch/powerSearchSheetUtils.d.ts +65 -0
- package/dist/PowerSearch/powerSearchSheetUtils.d.ts.map +1 -0
- package/dist/PowerSearch/powerSearchSheetUtils.js +168 -0
- package/dist/RadioList/RadioList.d.ts.map +1 -1
- package/dist/RadioList/RadioList.js +3 -2
- package/dist/RadioList/RadioListItem.d.ts +1 -1
- package/dist/RadioList/RadioListItem.d.ts.map +1 -1
- package/dist/RadioList/RadioListItem.js +5 -3
- package/dist/SegmentedControl/useSegmentedSelectionMotion.d.ts.map +1 -1
- package/dist/SegmentedControl/useSegmentedSelectionMotion.js +3 -3
- package/dist/Slider/sliderTouchController.js +2 -2
- package/dist/Spinner/Spinner.d.ts +1 -1
- package/dist/Spinner/Spinner.d.ts.map +1 -1
- package/dist/Spinner/Spinner.js +60 -58
- package/dist/Switch/useSwitchTouch.js +4 -4
- package/dist/Table/BaseTable.d.ts.map +1 -1
- package/dist/Table/BaseTable.js +29 -8
- package/dist/TextInput/TextInput.d.ts +2 -2
- package/dist/TextInput/TextInput.d.ts.map +1 -1
- package/dist/TextInput/TextInput.js +10 -7
- package/dist/Toast/Toast.d.ts +11 -1
- package/dist/Toast/Toast.d.ts.map +1 -1
- package/dist/Toast/Toast.js +25 -15
- package/dist/Toast/ToastViewport.d.ts.map +1 -1
- package/dist/Toast/ToastViewport.js +94 -34
- package/dist/Toast/types.d.ts +9 -3
- package/dist/Toast/types.d.ts.map +1 -1
- package/dist/Token/Token.d.ts +2 -2
- package/dist/Token/Token.d.ts.map +1 -1
- package/dist/Token/Token.js +12 -4
- package/dist/Token/TokenNamingContext.d.ts +14 -0
- package/dist/Token/TokenNamingContext.d.ts.map +1 -0
- package/dist/Token/TokenNamingContext.js +23 -0
- package/dist/Tooltip/useTooltip.d.ts +19 -1
- package/dist/Tooltip/useTooltip.d.ts.map +1 -1
- package/dist/Tooltip/useTooltip.js +34 -53
- package/dist/Typeahead/TypeaheadItem.d.ts +2 -1
- package/dist/Typeahead/TypeaheadItem.d.ts.map +1 -1
- package/dist/animator/createAnimator.d.ts +98 -0
- package/dist/animator/createAnimator.d.ts.map +1 -0
- package/dist/animator/createAnimator.js +259 -0
- package/dist/astryx.css +22 -6
- package/dist/gestures/GestureHost.d.ts +27 -1
- package/dist/gestures/GestureHost.d.ts.map +1 -1
- package/dist/gestures/GestureHost.js +90 -8
- package/dist/gestures/PressTracker.d.ts.map +1 -1
- package/dist/gestures/PressTracker.js +4 -3
- package/dist/hooks/actionGroupTracker.d.ts +4 -1
- package/dist/hooks/actionGroupTracker.d.ts.map +1 -1
- package/dist/hooks/actionGroupTracker.js +13 -3
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.js +1 -0
- package/dist/hooks/pressGroupContext.d.ts +6 -0
- package/dist/hooks/pressGroupContext.d.ts.map +1 -0
- package/dist/hooks/pressGroupContext.js +20 -0
- package/dist/hooks/useActionGroupTracking.d.ts +53 -0
- package/dist/hooks/useActionGroupTracking.d.ts.map +1 -0
- package/dist/hooks/useActionGroupTracking.js +174 -0
- package/dist/hooks/useAnimator.d.ts +41 -0
- package/dist/hooks/useAnimator.d.ts.map +1 -0
- package/dist/hooks/useAnimator.js +70 -0
- package/dist/hooks/useAttachment.d.ts +1 -1
- package/dist/hooks/useAttachment.js +1 -1
- package/dist/hooks/useInputStatusIcon.d.ts +1 -1
- package/dist/hooks/useInputStatusIcon.d.ts.map +1 -1
- package/dist/hooks/useInputStatusIcon.js +2 -2
- package/dist/hooks/useLongPress.d.ts +6 -2
- package/dist/hooks/useLongPress.d.ts.map +1 -1
- package/dist/hooks/useLongPress.js +95 -15
- package/dist/hooks/useMenuPress.d.ts.map +1 -1
- package/dist/hooks/useMenuPress.js +4 -2
- package/dist/i18n/generated-english/PowerSearch/PowerSearchBottomSheet.generated.d.ts +8 -0
- package/dist/i18n/generated-english/PowerSearch/PowerSearchBottomSheet.generated.d.ts.map +1 -0
- package/dist/i18n/generated-english/PowerSearch/PowerSearchBottomSheet.generated.js +42 -0
- package/dist/i18n/generated-english/PowerSearch/PowerSearchValueEditor.generated.d.ts.map +1 -1
- package/dist/i18n/generated-english/PowerSearch/PowerSearchValueEditor.generated.js +6 -0
- package/dist/i18n/generated-english/PowerSearch/formatTokenValue.generated.d.ts +8 -0
- package/dist/i18n/generated-english/PowerSearch/formatTokenValue.generated.d.ts.map +1 -0
- package/dist/i18n/generated-english/PowerSearch/formatTokenValue.generated.js +14 -0
- package/dist/i18n/generated-locales/en.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/en.generated.js +30 -0
- package/dist/i18n/generated-locales/pseudo.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/pseudo.generated.js +30 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -0
- package/dist/internal/indicatorPress.stylex.d.ts +20 -0
- package/dist/internal/indicatorPress.stylex.d.ts.map +1 -0
- package/dist/internal/indicatorPress.stylex.js +26 -0
- package/dist/motion/animator.d.ts +14 -14
- package/dist/motion/animator.d.ts.map +1 -1
- package/dist/motion/animator.js +41 -18
- package/dist/motion/reducedMotion.d.ts +24 -0
- package/dist/motion/reducedMotion.d.ts.map +1 -1
- package/dist/motion/reducedMotion.js +78 -1
- package/dist/motion/uikit/alert.d.ts +41 -0
- package/dist/motion/uikit/alert.d.ts.map +1 -0
- package/dist/motion/uikit/alert.js +43 -0
- package/dist/privateAttributes/pressGroupItem.stylex.d.ts +15 -0
- package/dist/privateAttributes/pressGroupItem.stylex.d.ts.map +1 -0
- package/dist/privateAttributes/pressGroupItem.stylex.js +23 -0
- package/dist/utils/clickGuard.d.ts +8 -1
- package/dist/utils/clickGuard.d.ts.map +1 -1
- package/dist/utils/clickGuard.js +24 -1
- package/dist/utils/dateParser.d.ts.map +1 -1
- package/dist/utils/dateParser.js +12 -0
- package/dist/utils/focusReturn.d.ts +15 -0
- package/dist/utils/focusReturn.d.ts.map +1 -1
- package/dist/utils/focusReturn.js +28 -0
- package/dist/utils/interactionOverlay.stylex.d.ts +3 -2
- package/dist/utils/interactionOverlay.stylex.d.ts.map +1 -1
- package/dist/utils/interactionOverlay.stylex.js +3 -2
- package/dist/utils/pressFeedback.d.ts.map +1 -1
- package/dist/utils/pressFeedback.js +19 -6
- package/dist/utils/triggerFocus.d.ts +36 -0
- package/dist/utils/triggerFocus.d.ts.map +1 -0
- package/dist/utils/triggerFocus.js +65 -0
- package/locales/en.json +120 -0
- package/locales/pseudo.json +90 -0
- package/package.json +9 -4
- package/src/AlertDialog/AlertDialog.doc.mjs +2 -2
- package/src/AlertDialog/AlertDialog.tsx +37 -5
- package/src/BottomSheet/BottomSheet.tsx +85 -5
- package/src/BottomSheet/BottomSheetPanel.tsx +40 -5
- package/src/BottomSheet/bottomSheetStack.ts +8 -4
- package/src/BottomSheet/useSheetGestures.ts +3 -1
- package/src/Button/Button.tsx +63 -5
- package/src/CheckboxInput/CheckboxInput.doc.mjs +18 -0
- package/src/CheckboxInput/CheckboxInput.tsx +36 -9
- package/src/ComplexSelector/ComplexSelector.tsx +20 -5
- package/src/ContextMenu/ContextMenu.tsx +2 -2
- package/src/DateInput/MonthScroller.tsx +18 -22
- package/src/DateInput/Wheel.tsx +30 -32
- package/src/Dialog/Dialog.tsx +10 -31
- package/src/Field/Field.tsx +2 -2
- package/src/HoverCard/HoverCard.doc.mjs +4 -2
- package/src/HoverCard/HoverCard.tsx +35 -4
- package/src/HoverCard/useHoverCard.doc.mjs +178 -36
- package/src/HoverCard/useHoverCard.tsx +46 -52
- package/src/Icon/Icon.doc.mjs +49 -8
- package/src/Icon/Icon.tsx +15 -7
- package/src/Layer/layerAnimations.stylex.ts +24 -16
- package/src/Layer/usePressPin.ts +81 -15
- package/src/Lightbox/Lightbox.tsx +18 -0
- package/src/PowerSearch/PowerSearch.doc.mjs +54 -5
- package/src/PowerSearch/PowerSearch.tsx +734 -288
- package/src/PowerSearch/PowerSearchBottomSheet.tsx +2515 -0
- package/src/PowerSearch/PowerSearchEditPopover.tsx +28 -6
- package/src/PowerSearch/PowerSearchValueEditor.tsx +203 -38
- package/src/PowerSearch/formatFilterValue.ts +18 -1
- package/src/PowerSearch/formatTokenValue.ts +215 -0
- package/src/PowerSearch/powerSearchSheetUtils.ts +224 -0
- package/src/RadioList/RadioList.tsx +3 -2
- package/src/RadioList/RadioListItem.tsx +5 -3
- package/src/SegmentedControl/useSegmentedSelectionMotion.ts +6 -3
- package/src/Slider/sliderTouchController.ts +2 -2
- package/src/Spinner/Spinner.tsx +77 -63
- package/src/Switch/useSwitchTouch.ts +4 -4
- package/src/Table/BaseTable.tsx +46 -12
- package/src/TextInput/TextInput.tsx +11 -10
- package/src/Toast/Toast.doc.mjs +4 -3
- package/src/Toast/Toast.tsx +52 -32
- package/src/Toast/ToastViewport.tsx +121 -35
- package/src/Toast/types.ts +9 -3
- package/src/Token/Token.tsx +13 -4
- package/src/Token/TokenNamingContext.ts +28 -0
- package/src/Tooltip/useTooltip.doc.mjs +24 -0
- package/src/Tooltip/useTooltip.tsx +61 -56
- package/src/Typeahead/TypeaheadItem.doc.mjs +6 -3
- package/src/Typeahead/TypeaheadItem.tsx +2 -1
- package/src/animator/createAnimator.doc.mjs +153 -0
- package/src/animator/createAnimator.ts +324 -0
- package/src/gestures/GestureHost.ts +105 -10
- package/src/gestures/PressTracker.ts +4 -3
- package/src/gestures/README.md +7 -1
- package/src/hooks/actionGroupTracker.ts +20 -5
- package/src/hooks/index.ts +2 -0
- package/src/hooks/pressGroupContext.ts +21 -0
- package/src/hooks/useActionGroupTracking.ts +224 -0
- package/src/hooks/useAnimator.doc.mjs +109 -0
- package/src/hooks/useAnimator.ts +67 -0
- package/src/hooks/useAttachment.ts +1 -1
- package/src/hooks/useInputStatusIcon.tsx +3 -2
- package/src/hooks/useLongPress.doc.mjs +2 -2
- package/src/hooks/useLongPress.ts +136 -15
- package/src/hooks/useMenuPress.ts +8 -2
- package/src/i18n/generated-english/PowerSearch/PowerSearchBottomSheet.generated.ts +43 -0
- package/src/i18n/generated-english/PowerSearch/PowerSearchValueEditor.generated.ts +6 -0
- package/src/i18n/generated-english/PowerSearch/formatTokenValue.generated.ts +15 -0
- package/src/i18n/generated-locales/en.generated.ts +41 -0
- package/src/i18n/generated-locales/pseudo.generated.ts +42 -0
- package/src/index.ts +13 -0
- package/src/internal/indicatorPress.stylex.ts +24 -0
- package/src/motion/README.md +8 -5
- package/src/motion/animator.ts +61 -29
- package/src/motion/reducedMotion.ts +79 -1
- package/src/motion/uikit/alert.ts +43 -0
- package/src/privateAttributes/pressGroupItem.stylex.ts +23 -0
- package/src/utils/clickGuard.ts +37 -1
- package/src/utils/dateParser.ts +16 -0
- package/src/utils/focusReturn.ts +30 -0
- package/src/utils/interactionOverlay.stylex.ts +3 -2
- package/src/utils/pressFeedback.ts +19 -6
- package/src/utils/triggerFocus.ts +80 -0
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
/** @type {import('@astryxdesign/cli/authoring').HookDoc} */
|
|
4
|
+
export const docs = {
|
|
5
|
+
name: 'useAnimator',
|
|
6
|
+
displayName: 'useAnimator',
|
|
7
|
+
keywords: [
|
|
8
|
+
'animate',
|
|
9
|
+
'animation',
|
|
10
|
+
'animator',
|
|
11
|
+
'spring',
|
|
12
|
+
'decay',
|
|
13
|
+
'momentum',
|
|
14
|
+
'fling',
|
|
15
|
+
'motion',
|
|
16
|
+
'transform',
|
|
17
|
+
'opacity',
|
|
18
|
+
'drag',
|
|
19
|
+
'card',
|
|
20
|
+
],
|
|
21
|
+
params: [
|
|
22
|
+
{
|
|
23
|
+
name: 'ref',
|
|
24
|
+
type: 'RefObject<HTMLElement | null>',
|
|
25
|
+
description:
|
|
26
|
+
'The ref of the one element to animate, the same ref you pass to the element: another hook, such as a gesture hook, can take it too, so a drag and an animation share one element. After every render the animator follows the element behind it. When the element unmounts its motion stops and its values return to rest, so a remount starts at rest, and so does a node that replaces it. Before the element mounts, and while it is unmounted, every call does nothing and `animate` and `decay` resolve at once.',
|
|
27
|
+
required: true,
|
|
28
|
+
},
|
|
29
|
+
],
|
|
30
|
+
returns: [
|
|
31
|
+
{
|
|
32
|
+
name: 'animator',
|
|
33
|
+
type: 'AnimatorHandle',
|
|
34
|
+
description:
|
|
35
|
+
"The element's animator, the same object on every render: `animate(target, {velocity?})` springs channels to a target on the state-change motion Astryx's components use, `decay(velocity)` coasts them from a release velocity, `set(values)` jumps them, `get()` and `getVelocity()` read them, and `stop()` halts them. The channels are `x` and `y` (px), `scale` (1 at the element's size), `rotate` (degrees) and `opacity` (0 to 1). `animate` and `decay` return a promise that resolves when the motion ends. Calling it never re-renders the component. Calls before the ref attaches do nothing and resolve at once.",
|
|
36
|
+
},
|
|
37
|
+
],
|
|
38
|
+
usage: {
|
|
39
|
+
description:
|
|
40
|
+
"Animates one element with the motion Astryx's own components use. Call `animator.animate` to spring an element to new values on the state-change motion, `animator.decay` to fling it with the momentum of a released scroll view, and `animator.set` to move it directly, so a card can follow a finger, snap back and be thrown away. To animate an area's layout as its items change, use `useAnimatedLayout`; for what a component already animates, such as a sheet's detents or a carousel's snapping, use the component's own props. Outside React, use `createAnimator`.",
|
|
41
|
+
bestPractices: [
|
|
42
|
+
{
|
|
43
|
+
guidance: true,
|
|
44
|
+
description:
|
|
45
|
+
'Call the animator from event handlers and effects: it lives outside render, so animating never re-renders the component.',
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
guidance: true,
|
|
49
|
+
description:
|
|
50
|
+
'Start every `animate` that follows a drag with the release velocity, so the element carries on as it was thrown.',
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
guidance: true,
|
|
54
|
+
description:
|
|
55
|
+
'Reach every state an animation shows without the animation too: a key, a button or a menu item that calls the same code.',
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
guidance: false,
|
|
59
|
+
description:
|
|
60
|
+
'Keep the animated values in React state: read them with `animator.get()` when you need them.',
|
|
61
|
+
},
|
|
62
|
+
],
|
|
63
|
+
accessibility: [
|
|
64
|
+
{
|
|
65
|
+
name: 'Keyboard and assistive technology',
|
|
66
|
+
category: 'Keyboard',
|
|
67
|
+
description:
|
|
68
|
+
'An animator moves an element; it adds no way to act. Give every action an animation stands for a control a keyboard and a screen reader can reach, such as a button that discards a card, and have it call `animate`, which Reduce Motion turns into a fade in place. Keep `decay` for a throw the person made: Reduce Motion keeps the momentum of a coast, as it continues that throw. Keep focus on an element that stays on screen: move it before you fling its element away.',
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
name: 'Reduce Motion',
|
|
72
|
+
category: 'Content',
|
|
73
|
+
criterion: '2.3.3 Animation from Interactions',
|
|
74
|
+
description:
|
|
75
|
+
'When the person asks for reduced motion, every call is planned for them. On a touch screen a move or a scale becomes a short opacity cross-fade: the element fades out where it was and fades back in where it lands. With a mouse it lands at once. A decay of `x` and `y` keeps its momentum, as it continues the throw the person made; a decay of `scale`, `rotate` or `opacity` is planned like a move. No option turns this off.',
|
|
76
|
+
},
|
|
77
|
+
],
|
|
78
|
+
},
|
|
79
|
+
relatedHooks: ['useAnimatedLayout'],
|
|
80
|
+
importPath: '@astryxdesign/core/hooks',
|
|
81
|
+
category: 'interaction',
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
/** @type {import('@astryxdesign/cli/authoring').HookTranslationDoc} */
|
|
85
|
+
export const docsDense = {
|
|
86
|
+
description:
|
|
87
|
+
"Animates the element behind ref (x, y, scale, rotate, opacity) with Astryx's motion; returns the animator.",
|
|
88
|
+
paramDescriptions: {
|
|
89
|
+
ref: 'The element ref; share it with a gesture hook to drag and animate one element.',
|
|
90
|
+
},
|
|
91
|
+
returnDescriptions: {
|
|
92
|
+
animator:
|
|
93
|
+
'animate(target, {velocity?}), decay(velocity), set, get, getVelocity, stop; stable, never re-renders.',
|
|
94
|
+
},
|
|
95
|
+
usage: {
|
|
96
|
+
description:
|
|
97
|
+
'Spring with animate, fling with decay, follow a finger with set. Reduce Motion: a cross-fade on touch, at once with a mouse; decay keeps its momentum.',
|
|
98
|
+
bestPractices: [
|
|
99
|
+
{
|
|
100
|
+
guidance: true,
|
|
101
|
+
description: 'Pass the release velocity to animate after a drag.',
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
guidance: false,
|
|
105
|
+
description: 'Keep animated values in state; read animator.get().',
|
|
106
|
+
},
|
|
107
|
+
],
|
|
108
|
+
},
|
|
109
|
+
};
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
'use client';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* @file useAnimator.ts
|
|
7
|
+
* @input React (useState), the element ref the caller owns, the public
|
|
8
|
+
* animator factory (animator/createAnimator.ts) and useAttachment
|
|
9
|
+
* @output Exports `useAnimator(ref)`: the public animator for the element
|
|
10
|
+
* behind `ref`
|
|
11
|
+
* @position Public hook, exported from `@astryxdesign/core/hooks`. A thin
|
|
12
|
+
* wrapper over `createAnimator` with no behavior of its own.
|
|
13
|
+
*
|
|
14
|
+
* SYNC: When modified, update:
|
|
15
|
+
* - /packages/core/src/hooks/useAnimator.test.tsx
|
|
16
|
+
* - /packages/core/src/hooks/useAnimator.doc.mjs
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
import {useState, type RefObject} from 'react';
|
|
20
|
+
import {
|
|
21
|
+
createAttachableAnimator,
|
|
22
|
+
type AnimatorHandle,
|
|
23
|
+
} from '../animator/createAnimator';
|
|
24
|
+
import {useAttachment} from './useAttachment';
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Animates the element behind `ref` with the motion Core uses. Call
|
|
28
|
+
* `animate`, `decay`, `set`, `get`, `getVelocity` or `stop` on the returned
|
|
29
|
+
* animator from event handlers and effects. Pass the same `ref` to a gesture
|
|
30
|
+
* hook to drag and animate one element.
|
|
31
|
+
*
|
|
32
|
+
* The hook makes the animator once, and animating never re-renders the
|
|
33
|
+
* component. After each commit, the animator follows the element behind
|
|
34
|
+
* `ref`, also a node that replaces it. An unmount stops running motion and
|
|
35
|
+
* drops the values. A remount, or a node that replaces the element, starts
|
|
36
|
+
* at rest. While no element is attached, every call does nothing, and
|
|
37
|
+
* `animate` and `decay` resolve at once.
|
|
38
|
+
*
|
|
39
|
+
* @example
|
|
40
|
+
* ```
|
|
41
|
+
* const ref = useRef<HTMLDivElement>(null);
|
|
42
|
+
* const animator = useAnimator(ref);
|
|
43
|
+
* return (
|
|
44
|
+
* <div ref={ref} onClick={() => animator.animate({scale: 1.2})}>
|
|
45
|
+
* Card
|
|
46
|
+
* </div>
|
|
47
|
+
* );
|
|
48
|
+
* ```
|
|
49
|
+
*/
|
|
50
|
+
export function useAnimator(
|
|
51
|
+
ref: RefObject<HTMLElement | null>,
|
|
52
|
+
): AnimatorHandle {
|
|
53
|
+
const [{handle, attach}] = useState(() => {
|
|
54
|
+
const {animator, attach: attachElement} = createAttachableAnimator();
|
|
55
|
+
// The handle without `destroy`: the hook owns the element's lifetime.
|
|
56
|
+
const {destroy: _destroy, ...handle} = animator;
|
|
57
|
+
return {
|
|
58
|
+
handle,
|
|
59
|
+
attach: (element: HTMLElement) => {
|
|
60
|
+
attachElement(element);
|
|
61
|
+
return () => attachElement(null);
|
|
62
|
+
},
|
|
63
|
+
};
|
|
64
|
+
});
|
|
65
|
+
useAttachment(ref, attach, null);
|
|
66
|
+
return handle;
|
|
67
|
+
}
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* @output Exports useAttachment and useAttachmentPair (two elements): they keep
|
|
10
10
|
* the attach function bound to the nodes the refs hold across commits
|
|
11
11
|
* @position Internal React helper, not in hooks/index.ts: the one attach and
|
|
12
|
-
* release lifecycle of the gesture hooks
|
|
12
|
+
* release lifecycle of the gesture hooks, the pager and useAnimator
|
|
13
13
|
*
|
|
14
14
|
* SYNC: When modified, update gestures/__tests__/useGestureRecognizer.test.tsx,
|
|
15
15
|
* gestures/__tests__/useFingerScroll.test.tsx and
|
|
@@ -15,9 +15,10 @@
|
|
|
15
15
|
import {useCallback, useEffect, useState} from 'react';
|
|
16
16
|
import type {ReactNode} from 'react';
|
|
17
17
|
import * as stylex from '@stylexjs/stylex';
|
|
18
|
-
import {Icon, type
|
|
18
|
+
import {Icon, type IconSize} from '../Icon/Icon';
|
|
19
|
+
import type {IconName} from '../Icon/globalIconRegistry';
|
|
19
20
|
import type {InputStatus, InputStatusType} from '../Field/types';
|
|
20
|
-
import {useTooltip} from '../Tooltip';
|
|
21
|
+
import {useTooltip} from '../Tooltip/useTooltip';
|
|
21
22
|
import {radiusVars} from '../theme/tokens.stylex';
|
|
22
23
|
import {themeProps} from '../utils/themeProps';
|
|
23
24
|
import {focusOutlineStyles} from '../utils/focusOutline.stylex';
|
|
@@ -59,7 +59,7 @@ export const docs = {
|
|
|
59
59
|
],
|
|
60
60
|
usage: {
|
|
61
61
|
description:
|
|
62
|
-
'Detects a single-finger press-and-hold and reports where it happened, so touch users can reach affordances that a pointer gets from right-click. iOS Safari never synthesizes a contextmenu event on long-press, which makes this the only touch route into a cursor-positioned surface such as ContextMenu. The press cancels on movement, lift, multi-touch or unmount.',
|
|
62
|
+
'Detects a single-finger press-and-hold and reports where it happened, so touch users can reach affordances that a pointer gets from right-click. iOS Safari never synthesizes a contextmenu event on long-press, which makes this the only touch route into a cursor-positioned surface such as ContextMenu. The press cancels on movement, lift, multi-touch or unmount. The hold is timed on the touch events\u2019 own timestamps: when a busy page handles the lift late, a finger held for the full delay still reports its long press, before the lift acts.',
|
|
63
63
|
bestPractices: [
|
|
64
64
|
{
|
|
65
65
|
guidance: true,
|
|
@@ -102,7 +102,7 @@ export const docsDense = {
|
|
|
102
102
|
},
|
|
103
103
|
usage: {
|
|
104
104
|
description:
|
|
105
|
-
|
|
105
|
+
"Touch press-and-hold for affordances a pointer reaches by right-click (e.g. ContextMenu). Reports the point so the surface opens under the finger. Timed on the touch events' timestamps: a busy page delays the report, never drops it.",
|
|
106
106
|
bestPractices: [
|
|
107
107
|
{
|
|
108
108
|
guidance: true,
|
|
@@ -25,6 +25,11 @@
|
|
|
25
25
|
// its tolerance as a distance, as UIKit does. This hook measures it on each
|
|
26
26
|
// axis. The context menu's own movement allowance is a guess and is not
|
|
27
27
|
// measured yet (AST-094).
|
|
28
|
+
//
|
|
29
|
+
// The hold is a deadline on the touch events' timestamps, on the clock of the
|
|
30
|
+
// touch's own window. A busy main thread can delay the timer past the
|
|
31
|
+
// deadline. A touch stamped after the deadline then reports the press before
|
|
32
|
+
// it acts.
|
|
28
33
|
|
|
29
34
|
import {useCallback, useEffect, useRef} from 'react';
|
|
30
35
|
import {
|
|
@@ -37,6 +42,41 @@ import {
|
|
|
37
42
|
const DEFAULT_DELAY_MS = LONG_PRESS_DURATION_MS;
|
|
38
43
|
const DEFAULT_MOVE_CANCEL_PX = LONG_PRESS_ALLOWABLE_MOVEMENT_PX;
|
|
39
44
|
|
|
45
|
+
/** The part of a window's performance timeline a press reads. */
|
|
46
|
+
type EventClock = Pick<Performance, 'now'>;
|
|
47
|
+
|
|
48
|
+
function clockOf(e: React.TouchEvent): EventClock | null {
|
|
49
|
+
const view = e.view as unknown as {performance?: EventClock} | null;
|
|
50
|
+
return (
|
|
51
|
+
view?.performance ??
|
|
52
|
+
(typeof performance === 'undefined' ? null : performance)
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* An event's time on its window's clock. jsdom stamps events with
|
|
58
|
+
* `Date.now()`. The hook reads the age of such a stamp on that clock, so a
|
|
59
|
+
* frozen system time keeps the hold's length. A stamp nearer `Date.now()` than
|
|
60
|
+
* the window's clock is that kind of stamp.
|
|
61
|
+
*/
|
|
62
|
+
function timeOn(
|
|
63
|
+
clock: EventClock | null,
|
|
64
|
+
timeStamp: number | undefined,
|
|
65
|
+
): number | undefined {
|
|
66
|
+
// A stamp of 0 means the event carries no time, so the hold falls back to
|
|
67
|
+
// the full delay on the page's timer.
|
|
68
|
+
if (timeStamp == null || !Number.isFinite(timeStamp) || timeStamp <= 0) {
|
|
69
|
+
return undefined;
|
|
70
|
+
}
|
|
71
|
+
if (
|
|
72
|
+
clock != null &&
|
|
73
|
+
Math.abs(Date.now() - timeStamp) < Math.abs(clock.now() - timeStamp)
|
|
74
|
+
) {
|
|
75
|
+
return clock.now() - (Date.now() - timeStamp);
|
|
76
|
+
}
|
|
77
|
+
return timeStamp;
|
|
78
|
+
}
|
|
79
|
+
|
|
40
80
|
export interface UseLongPressOptions {
|
|
41
81
|
/** Fired with the touch start point once the press is held for `delayMs`. */
|
|
42
82
|
onLongPress: (point: {x: number; y: number}) => void;
|
|
@@ -59,8 +99,12 @@ export interface LongPressTolerance {
|
|
|
59
99
|
export interface UseLongPressHandlers {
|
|
60
100
|
onTouchStart: (e: React.TouchEvent) => void;
|
|
61
101
|
onTouchMove: (e: React.TouchEvent) => void;
|
|
62
|
-
|
|
63
|
-
|
|
102
|
+
/**
|
|
103
|
+
* The lift. Pass the event, so a press it is stamped past (its timer held
|
|
104
|
+
* back by a busy page) still reports first. Spreading the handlers does.
|
|
105
|
+
*/
|
|
106
|
+
onTouchEnd: (e?: React.TouchEvent) => void;
|
|
107
|
+
onTouchCancel: (e?: React.TouchEvent) => void;
|
|
64
108
|
/**
|
|
65
109
|
* Begin detection at a point, for a caller driving this from its own
|
|
66
110
|
* pointer events rather than the touch handlers above.
|
|
@@ -118,6 +162,9 @@ export function useLongPressDetector(
|
|
|
118
162
|
|
|
119
163
|
const timerRef = useRef<ReturnType<typeof setTimeout> | null>(null);
|
|
120
164
|
const startRef = useRef<{x: number; y: number} | null>(null);
|
|
165
|
+
// The pending press's deadline and clock, when it started from a touch.
|
|
166
|
+
const deadlineRef = useRef<number | null>(null);
|
|
167
|
+
const clockRef = useRef<EventClock | null>(null);
|
|
121
168
|
// The press in progress's tolerance, when its caller chose one at start.
|
|
122
169
|
const pressToleranceRef = useRef<LongPressTolerance | null>(null);
|
|
123
170
|
// Keep the latest callback without re-creating handlers on every render.
|
|
@@ -130,10 +177,39 @@ export function useLongPressDetector(
|
|
|
130
177
|
timerRef.current = null;
|
|
131
178
|
}
|
|
132
179
|
startRef.current = null;
|
|
180
|
+
deadlineRef.current = null;
|
|
181
|
+
clockRef.current = null;
|
|
133
182
|
}, []);
|
|
134
183
|
|
|
135
|
-
const
|
|
136
|
-
|
|
184
|
+
const fire = useCallback(() => {
|
|
185
|
+
const from = startRef.current;
|
|
186
|
+
if (from == null) {
|
|
187
|
+
return;
|
|
188
|
+
}
|
|
189
|
+
clear();
|
|
190
|
+
onLongPressRef.current({x: from.x, y: from.y});
|
|
191
|
+
}, [clear]);
|
|
192
|
+
|
|
193
|
+
// A touch stamped at or past the deadline: the finger was down for the
|
|
194
|
+
// whole delay, so the press reports before the touch acts.
|
|
195
|
+
const fireIfDue = useCallback(
|
|
196
|
+
(e: React.TouchEvent | undefined) => {
|
|
197
|
+
const deadline = deadlineRef.current;
|
|
198
|
+
const eventTime =
|
|
199
|
+
e == null ? undefined : timeOn(clockRef.current, e.timeStamp);
|
|
200
|
+
if (deadline != null && eventTime != null && eventTime >= deadline) {
|
|
201
|
+
fire();
|
|
202
|
+
}
|
|
203
|
+
},
|
|
204
|
+
[fire],
|
|
205
|
+
);
|
|
206
|
+
|
|
207
|
+
const begin = useCallback(
|
|
208
|
+
(
|
|
209
|
+
point: {x: number; y: number},
|
|
210
|
+
tolerance: LongPressTolerance | undefined,
|
|
211
|
+
started: {at: number; clock: EventClock} | undefined,
|
|
212
|
+
) => {
|
|
137
213
|
if (disabled) {
|
|
138
214
|
return;
|
|
139
215
|
}
|
|
@@ -142,15 +218,40 @@ export function useLongPressDetector(
|
|
|
142
218
|
clear();
|
|
143
219
|
startRef.current = {x: point.x, y: point.y};
|
|
144
220
|
pressToleranceRef.current = tolerance ?? null;
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
221
|
+
const clock = started?.clock ?? null;
|
|
222
|
+
const deadline = started == null ? null : started.at + delayMs;
|
|
223
|
+
clockRef.current = clock;
|
|
224
|
+
deadlineRef.current = deadline;
|
|
225
|
+
// Wait only for the rest of the hold, so a touch handled late does not
|
|
226
|
+
// lengthen it, and never past the delay.
|
|
227
|
+
const remaining =
|
|
228
|
+
clock == null || deadline == null
|
|
229
|
+
? delayMs
|
|
230
|
+
: Math.min(delayMs, Math.max(0, deadline - clock.now()));
|
|
231
|
+
// A late timer yields to queued input once, so a lift stamped before
|
|
232
|
+
// the deadline still cancels the press. The gesture arena does the same.
|
|
233
|
+
const run = (mayYield: boolean) => {
|
|
234
|
+
timerRef.current = null;
|
|
235
|
+
if (
|
|
236
|
+
mayYield &&
|
|
237
|
+
clock != null &&
|
|
238
|
+
deadline != null &&
|
|
239
|
+
clock.now() > deadline
|
|
240
|
+
) {
|
|
241
|
+
timerRef.current = setTimeout(() => run(false), 0);
|
|
148
242
|
return;
|
|
149
243
|
}
|
|
150
|
-
|
|
151
|
-
}
|
|
244
|
+
fire();
|
|
245
|
+
};
|
|
246
|
+
timerRef.current = setTimeout(() => run(true), remaining);
|
|
152
247
|
},
|
|
153
|
-
[disabled, delayMs, clear],
|
|
248
|
+
[disabled, delayMs, clear, fire],
|
|
249
|
+
);
|
|
250
|
+
|
|
251
|
+
const start = useCallback(
|
|
252
|
+
(point: {x: number; y: number}, tolerance?: LongPressTolerance) =>
|
|
253
|
+
begin(point, tolerance, undefined),
|
|
254
|
+
[begin],
|
|
154
255
|
);
|
|
155
256
|
|
|
156
257
|
const moveTo = useCallback(
|
|
@@ -179,17 +280,29 @@ export function useLongPressDetector(
|
|
|
179
280
|
return;
|
|
180
281
|
}
|
|
181
282
|
if (e.touches.length !== 1) {
|
|
283
|
+
// A second finger ends the press, unless the press was already due.
|
|
284
|
+
fireIfDue(e);
|
|
182
285
|
clear();
|
|
183
286
|
return;
|
|
184
287
|
}
|
|
185
288
|
const touch = e.touches[0];
|
|
186
|
-
|
|
289
|
+
const clock = clockOf(e);
|
|
290
|
+
const at = timeOn(clock, e.timeStamp);
|
|
291
|
+
begin(
|
|
292
|
+
{x: touch.clientX, y: touch.clientY},
|
|
293
|
+
undefined,
|
|
294
|
+
clock == null || at == null ? undefined : {at, clock},
|
|
295
|
+
);
|
|
187
296
|
},
|
|
188
|
-
[disabled, clear,
|
|
297
|
+
[disabled, clear, begin, fireIfDue],
|
|
189
298
|
);
|
|
190
299
|
|
|
191
300
|
const onTouchMove = useCallback(
|
|
192
301
|
(e: React.TouchEvent) => {
|
|
302
|
+
if (startRef.current == null) {
|
|
303
|
+
return;
|
|
304
|
+
}
|
|
305
|
+
fireIfDue(e);
|
|
193
306
|
if (startRef.current == null) {
|
|
194
307
|
return;
|
|
195
308
|
}
|
|
@@ -200,7 +313,15 @@ export function useLongPressDetector(
|
|
|
200
313
|
const touch = e.touches[0];
|
|
201
314
|
moveTo({x: touch.clientX, y: touch.clientY});
|
|
202
315
|
},
|
|
203
|
-
[clear, moveTo],
|
|
316
|
+
[clear, moveTo, fireIfDue],
|
|
317
|
+
);
|
|
318
|
+
|
|
319
|
+
const onTouchEnd = useCallback(
|
|
320
|
+
(e?: React.TouchEvent) => {
|
|
321
|
+
fireIfDue(e);
|
|
322
|
+
clear();
|
|
323
|
+
},
|
|
324
|
+
[clear, fireIfDue],
|
|
204
325
|
);
|
|
205
326
|
|
|
206
327
|
useEffect(() => clear, [clear]);
|
|
@@ -208,8 +329,8 @@ export function useLongPressDetector(
|
|
|
208
329
|
return {
|
|
209
330
|
onTouchStart,
|
|
210
331
|
onTouchMove,
|
|
211
|
-
onTouchEnd
|
|
212
|
-
onTouchCancel:
|
|
332
|
+
onTouchEnd,
|
|
333
|
+
onTouchCancel: onTouchEnd,
|
|
213
334
|
start,
|
|
214
335
|
moveTo,
|
|
215
336
|
cancel: clear,
|
|
@@ -483,7 +483,10 @@ export function useMenuPress(options: UseMenuPressOptions): UseMenuPressReturn {
|
|
|
483
483
|
// Detach before acting: the activation usually closes the menu.
|
|
484
484
|
endGesture();
|
|
485
485
|
// Once armed, the one swallower stays installed.
|
|
486
|
-
armClickGuard(doc, {
|
|
486
|
+
armClickGuard(doc, {
|
|
487
|
+
staysInstalled: true,
|
|
488
|
+
cancelsTouchEnd: native?.pointerType === 'touch',
|
|
489
|
+
});
|
|
487
490
|
if (native != null) {
|
|
488
491
|
activate(effect.row, native);
|
|
489
492
|
}
|
|
@@ -492,7 +495,10 @@ export function useMenuPress(options: UseMenuPressOptions): UseMenuPressReturn {
|
|
|
492
495
|
case 'settle': {
|
|
493
496
|
endGesture();
|
|
494
497
|
if (effect.stray) {
|
|
495
|
-
armClickGuard(doc, {
|
|
498
|
+
armClickGuard(doc, {
|
|
499
|
+
staysInstalled: true,
|
|
500
|
+
cancelsTouchEnd: native?.pointerType === 'touch',
|
|
501
|
+
});
|
|
496
502
|
}
|
|
497
503
|
if (effect.dismiss) {
|
|
498
504
|
optionsRef.current.onDismiss?.();
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @generated by scripts/generate-i18n-runtime.mjs from packages/core/locales/en.json,
|
|
5
|
+
* holding the English for the catalog keys named in packages/core/src/PowerSearch/PowerSearchBottomSheet.tsx.
|
|
6
|
+
* Do not edit by hand. Run `pnpm generate:i18n-runtime` instead.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
const english: Readonly<Record<string, string>> = {
|
|
10
|
+
"@astryx.powersearch.allFiltersRemoved": "All filters removed",
|
|
11
|
+
"@astryx.powersearch.editableFiltersRemoved": "Editable filters removed",
|
|
12
|
+
"@astryx.powersearch.editor.apply": "Apply",
|
|
13
|
+
"@astryx.powersearch.editor.cancel": "Cancel",
|
|
14
|
+
"@astryx.powersearch.editor.operator": "Operator",
|
|
15
|
+
"@astryx.powersearch.sheet.addFilter": "Add filter",
|
|
16
|
+
"@astryx.powersearch.sheet.clearAll": "Clear all",
|
|
17
|
+
"@astryx.powersearch.sheet.clearAllCancel": "Keep filters",
|
|
18
|
+
"@astryx.powersearch.sheet.clearAllConfirm": "Clear filters",
|
|
19
|
+
"@astryx.powersearch.sheet.clearAllDescription": "This removes all editable filters from this search.",
|
|
20
|
+
"@astryx.powersearch.sheet.clearAllTitle": "Clear all filters?",
|
|
21
|
+
"@astryx.powersearch.sheet.done": "Done",
|
|
22
|
+
"@astryx.powersearch.sheet.editableFiltersClearedWithCount": "Editable filters removed. {resultCount}",
|
|
23
|
+
"@astryx.powersearch.sheet.fieldOperator": "{field} {operator}",
|
|
24
|
+
"@astryx.powersearch.sheet.filterUnavailable": "This filter is no longer available",
|
|
25
|
+
"@astryx.powersearch.sheet.filtersClearedWithCount": "All filters removed. {resultCount}",
|
|
26
|
+
"@astryx.powersearch.sheet.filtersTitle": "Filters",
|
|
27
|
+
"@astryx.powersearch.sheet.labelValue": "{label} {value}",
|
|
28
|
+
"@astryx.powersearch.sheet.noFilters": "No filters applied",
|
|
29
|
+
"@astryx.powersearch.sheet.noFiltersDescription": "Add a filter to narrow your results and find what you need faster.",
|
|
30
|
+
"@astryx.powersearch.sheet.noMatchingFields": "No filters match your search",
|
|
31
|
+
"@astryx.powersearch.sheet.noResults": "No results found",
|
|
32
|
+
"@astryx.powersearch.sheet.removeFilter": "Remove {field} filter",
|
|
33
|
+
"@astryx.powersearch.sheet.search": "Search",
|
|
34
|
+
"@astryx.powersearch.sheet.searchFields": "Search filters",
|
|
35
|
+
"@astryx.powersearch.sheet.searchFieldsPlaceholder": "Search filters…",
|
|
36
|
+
"@astryx.powersearch.sheet.searchResults": "Search results",
|
|
37
|
+
"@astryx.powersearch.sheet.tryDifferentSearch": "Try a different search.",
|
|
38
|
+
"@astryx.powersearch.sheet.ungroupedFields": "General",
|
|
39
|
+
"@astryx.tokenizer.tokenAdded": "Added {label}",
|
|
40
|
+
"@astryx.tokenizer.tokenRemoved": "Removed {label}"
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
export default english;
|
|
@@ -7,6 +7,12 @@
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
const english: Readonly<Record<string, string>> = {
|
|
10
|
+
"@astryx.powersearch.sheet.relativeDaysAgo": "{count, number} {count, plural, one {day} other {days}} ago",
|
|
11
|
+
"@astryx.powersearch.sheet.relativeDaysFromNow": "{count, number} {count, plural, one {day} other {days}} from now",
|
|
12
|
+
"@astryx.powersearch.sheet.relativeMonthsAgo": "{count, number} {count, plural, one {month} other {months}} ago",
|
|
13
|
+
"@astryx.powersearch.sheet.relativeMonthsFromNow": "{count, number} {count, plural, one {month} other {months}} from now",
|
|
14
|
+
"@astryx.powersearch.sheet.relativeWeeksAgo": "{count, number} {count, plural, one {week} other {weeks}} ago",
|
|
15
|
+
"@astryx.powersearch.sheet.relativeWeeksFromNow": "{count, number} {count, plural, one {week} other {weeks}} from now",
|
|
10
16
|
"@astryx.powersearch.valueEditor.addValuesPlaceholder": "Add values…",
|
|
11
17
|
"@astryx.powersearch.valueEditor.date": "Date",
|
|
12
18
|
"@astryx.powersearch.valueEditor.dateRange": "date range",
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @generated by scripts/generate-i18n-runtime.mjs from packages/core/locales/en.json,
|
|
5
|
+
* holding the English for the catalog keys named in packages/core/src/PowerSearch/formatTokenValue.ts.
|
|
6
|
+
* Do not edit by hand. Run `pnpm generate:i18n-runtime` instead.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
const english: Readonly<Record<string, string>> = {
|
|
10
|
+
"@astryx.powersearch.valueEditor.dateRange": "date range",
|
|
11
|
+
"@astryx.powersearch.valueEditor.filtersCount": "{count, number} {count, plural, one {filter} other {filters}}",
|
|
12
|
+
"@astryx.powersearch.valueEditor.itemsCount": "{count, number} {count, plural, one {item} other {items}}"
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export default english;
|
|
@@ -78,6 +78,47 @@ const runtimeCatalog: Readonly<Record<string, string>> = {
|
|
|
78
78
|
'{count, number} {count, plural, one {filter} other {filters}}',
|
|
79
79
|
'@astryx.powersearch.resultCount':
|
|
80
80
|
'{count, number} {count, plural, one {result} other {results}}',
|
|
81
|
+
'@astryx.powersearch.sheet.filtersTitle': 'Filters',
|
|
82
|
+
'@astryx.powersearch.sheet.addFilter': 'Add filter',
|
|
83
|
+
'@astryx.powersearch.sheet.noFilters': 'No filters applied',
|
|
84
|
+
'@astryx.powersearch.sheet.noFiltersDescription':
|
|
85
|
+
'Add a filter to narrow your results and find what you need faster.',
|
|
86
|
+
'@astryx.powersearch.sheet.clearAll': 'Clear all',
|
|
87
|
+
'@astryx.powersearch.sheet.clearAllTitle': 'Clear all filters?',
|
|
88
|
+
'@astryx.powersearch.sheet.clearAllDescription':
|
|
89
|
+
'This removes all editable filters from this search.',
|
|
90
|
+
'@astryx.powersearch.sheet.clearAllConfirm': 'Clear filters',
|
|
91
|
+
'@astryx.powersearch.sheet.clearAllCancel': 'Keep filters',
|
|
92
|
+
'@astryx.powersearch.sheet.done': 'Done',
|
|
93
|
+
'@astryx.powersearch.sheet.search': 'Search',
|
|
94
|
+
'@astryx.powersearch.sheet.searchResults': 'Search results',
|
|
95
|
+
'@astryx.powersearch.sheet.searchFields': 'Search filters',
|
|
96
|
+
'@astryx.powersearch.sheet.searchFieldsPlaceholder': 'Search filters…',
|
|
97
|
+
'@astryx.powersearch.sheet.ungroupedFields': 'General',
|
|
98
|
+
'@astryx.powersearch.sheet.noMatchingFields': 'No filters match your search',
|
|
99
|
+
'@astryx.powersearch.sheet.tryDifferentSearch': 'Try a different search.',
|
|
100
|
+
'@astryx.powersearch.sheet.noResults': 'No results found',
|
|
101
|
+
'@astryx.powersearch.sheet.filterUnavailable':
|
|
102
|
+
'This filter is no longer available',
|
|
103
|
+
'@astryx.powersearch.sheet.removeFilter': 'Remove {field} filter',
|
|
104
|
+
'@astryx.powersearch.sheet.relativeDaysAgo':
|
|
105
|
+
'{count, number} {count, plural, one {day} other {days}} ago',
|
|
106
|
+
'@astryx.powersearch.sheet.relativeDaysFromNow':
|
|
107
|
+
'{count, number} {count, plural, one {day} other {days}} from now',
|
|
108
|
+
'@astryx.powersearch.sheet.relativeWeeksAgo':
|
|
109
|
+
'{count, number} {count, plural, one {week} other {weeks}} ago',
|
|
110
|
+
'@astryx.powersearch.sheet.relativeWeeksFromNow':
|
|
111
|
+
'{count, number} {count, plural, one {week} other {weeks}} from now',
|
|
112
|
+
'@astryx.powersearch.sheet.relativeMonthsAgo':
|
|
113
|
+
'{count, number} {count, plural, one {month} other {months}} ago',
|
|
114
|
+
'@astryx.powersearch.sheet.relativeMonthsFromNow':
|
|
115
|
+
'{count, number} {count, plural, one {month} other {months}} from now',
|
|
116
|
+
'@astryx.powersearch.sheet.fieldOperator': '{field} {operator}',
|
|
117
|
+
'@astryx.powersearch.sheet.labelValue': '{label} {value}',
|
|
118
|
+
'@astryx.powersearch.sheet.filtersClearedWithCount':
|
|
119
|
+
'All filters removed. {resultCount}',
|
|
120
|
+
'@astryx.powersearch.sheet.editableFiltersClearedWithCount':
|
|
121
|
+
'Editable filters removed. {resultCount}',
|
|
81
122
|
'@astryx.alertDialog.cancel': 'Cancel',
|
|
82
123
|
'@astryx.appShell.mobileNavigation': 'Mobile navigation',
|
|
83
124
|
'@astryx.appShell.skipToContent': 'Skip to content',
|
|
@@ -80,6 +80,48 @@ const runtimeCatalog: Readonly<Record<string, string>> = {
|
|
|
80
80
|
'⟦{count, number} {count, plural, one {filter} other {filters}}⟧',
|
|
81
81
|
'@astryx.powersearch.resultCount':
|
|
82
82
|
'⟦{count, number} {count, plural, one {result} other {results}}⟧',
|
|
83
|
+
'@astryx.powersearch.sheet.filtersTitle': '⟦Ƒíłţéřš⟧',
|
|
84
|
+
'@astryx.powersearch.sheet.addFilter': '⟦Àðð ƒíłţéř⟧',
|
|
85
|
+
'@astryx.powersearch.sheet.noFilters': '⟦Ñó ƒíłţéřš àþþłíéð⟧',
|
|
86
|
+
'@astryx.powersearch.sheet.noFiltersDescription':
|
|
87
|
+
'⟦Àðð à ƒíłţéř ţó ñàřřóŵ ýóúř řéšúłţš àñð ƒíñð ŵĥàţ ýóú ñééð ƒàšţéř.⟧',
|
|
88
|
+
'@astryx.powersearch.sheet.clearAll': '⟦Çłéàř àłł⟧',
|
|
89
|
+
'@astryx.powersearch.sheet.clearAllTitle': '⟦Çłéàř àłł ƒíłţéřš?⟧',
|
|
90
|
+
'@astryx.powersearch.sheet.clearAllDescription':
|
|
91
|
+
'⟦Ţĥíš řéɱóṽéš àłł éðíţàƀłé ƒíłţéřš ƒřóɱ ţĥíš šéàřçĥ.⟧',
|
|
92
|
+
'@astryx.powersearch.sheet.clearAllConfirm': '⟦Çłéàř ƒíłţéřš⟧',
|
|
93
|
+
'@astryx.powersearch.sheet.clearAllCancel': '⟦Ķééþ ƒíłţéřš⟧',
|
|
94
|
+
'@astryx.powersearch.sheet.done': '⟦Ðóñé⟧',
|
|
95
|
+
'@astryx.powersearch.sheet.search': '⟦Šéàřçĥ⟧',
|
|
96
|
+
'@astryx.powersearch.sheet.searchResults': '⟦Šéàřçĥ řéšúłţš⟧',
|
|
97
|
+
'@astryx.powersearch.sheet.searchFields': '⟦Šéàřçĥ ƒíłţéřš⟧',
|
|
98
|
+
'@astryx.powersearch.sheet.searchFieldsPlaceholder': '⟦Šéàřçĥ ƒíłţéřš…⟧',
|
|
99
|
+
'@astryx.powersearch.sheet.ungroupedFields': '⟦Ĝéñéřàł⟧',
|
|
100
|
+
'@astryx.powersearch.sheet.noMatchingFields':
|
|
101
|
+
'⟦Ñó ƒíłţéřš ɱàţçĥ ýóúř šéàřçĥ⟧',
|
|
102
|
+
'@astryx.powersearch.sheet.tryDifferentSearch': '⟦Ţřý à ð탃éřéñţ šéàřçĥ.⟧',
|
|
103
|
+
'@astryx.powersearch.sheet.noResults': '⟦Ñó řéšúłţš ƒóúñð⟧',
|
|
104
|
+
'@astryx.powersearch.sheet.filterUnavailable':
|
|
105
|
+
'⟦Ţĥíš ƒíłţéř íš ñó łóñĝéř àṽàíłàƀłé⟧',
|
|
106
|
+
'@astryx.powersearch.sheet.removeFilter': '⟦Řéɱóṽé {field} ƒíłţéř⟧',
|
|
107
|
+
'@astryx.powersearch.sheet.relativeDaysAgo':
|
|
108
|
+
'⟦{count, number} {count, plural, one {day} other {days}} àĝó⟧',
|
|
109
|
+
'@astryx.powersearch.sheet.relativeDaysFromNow':
|
|
110
|
+
'⟦{count, number} {count, plural, one {day} other {days}} ƒřóɱ ñóŵ⟧',
|
|
111
|
+
'@astryx.powersearch.sheet.relativeWeeksAgo':
|
|
112
|
+
'⟦{count, number} {count, plural, one {week} other {weeks}} àĝó⟧',
|
|
113
|
+
'@astryx.powersearch.sheet.relativeWeeksFromNow':
|
|
114
|
+
'⟦{count, number} {count, plural, one {week} other {weeks}} ƒřóɱ ñóŵ⟧',
|
|
115
|
+
'@astryx.powersearch.sheet.relativeMonthsAgo':
|
|
116
|
+
'⟦{count, number} {count, plural, one {month} other {months}} àĝó⟧',
|
|
117
|
+
'@astryx.powersearch.sheet.relativeMonthsFromNow':
|
|
118
|
+
'⟦{count, number} {count, plural, one {month} other {months}} ƒřóɱ ñóŵ⟧',
|
|
119
|
+
'@astryx.powersearch.sheet.fieldOperator': '⟦{field} {operator}⟧',
|
|
120
|
+
'@astryx.powersearch.sheet.labelValue': '⟦{label} {value}⟧',
|
|
121
|
+
'@astryx.powersearch.sheet.filtersClearedWithCount':
|
|
122
|
+
'⟦Àłł ƒíłţéřš řéɱóṽéð. {resultCount}⟧',
|
|
123
|
+
'@astryx.powersearch.sheet.editableFiltersClearedWithCount':
|
|
124
|
+
'⟦Éðíţàƀłé ƒíłţéřš řéɱóṽéð. {resultCount}⟧',
|
|
83
125
|
'@astryx.alertDialog.cancel': '⟦Çàñçéł⟧',
|
|
84
126
|
'@astryx.appShell.mobileNavigation': '⟦Ṁóƀíłé ñàṽíĝàţíóñ⟧',
|
|
85
127
|
'@astryx.appShell.skipToContent': '⟦Šķíþ ţó çóñţéñţ⟧',
|
package/src/index.ts
CHANGED
|
@@ -173,6 +173,19 @@ export * from './Outline';
|
|
|
173
173
|
// Overflow list
|
|
174
174
|
export * from './OverflowList';
|
|
175
175
|
|
|
176
|
+
// Animating one element: from the package root only, since one API has one
|
|
177
|
+
// entry. Its hook ships from './hooks'.
|
|
178
|
+
export {
|
|
179
|
+
createAnimator,
|
|
180
|
+
type Animator,
|
|
181
|
+
type AnimatorAnimateOptions,
|
|
182
|
+
type AnimatorChannel,
|
|
183
|
+
type AnimatorDecayVelocity,
|
|
184
|
+
type AnimatorHandle,
|
|
185
|
+
type AnimatorSnapshot,
|
|
186
|
+
type AnimatorValues,
|
|
187
|
+
} from './animator/createAnimator';
|
|
188
|
+
|
|
176
189
|
// Hooks
|
|
177
190
|
export * from './hooks';
|
|
178
191
|
|