@kanso-labs/kanso-ui 0.44.1 → 0.45.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +59 -7
- package/dist/chip/index.js +24 -4
- package/dist/chip/index.js.map +1 -1
- package/dist/chip/styles.js +13 -5
- package/dist/chip/styles.js.map +1 -1
- package/dist/components/app-bar/index.d.ts +14 -2
- package/dist/components/app-bar/index.js +36 -7
- package/dist/components/app-bar/index.js.map +1 -1
- package/dist/components/autocomplete/index.d.ts +44 -0
- package/dist/components/autocomplete/index.js +44 -0
- package/dist/components/autocomplete/index.js.map +1 -1
- package/dist/components/button/index.d.ts +3 -2
- package/dist/components/button/index.js +53 -59
- package/dist/components/button/index.js.map +1 -1
- package/dist/components/card/index.d.ts +11 -3
- package/dist/components/card/index.js +23 -1
- package/dist/components/card/index.js.map +1 -1
- package/dist/components/checkbox/index.js +65 -58
- package/dist/components/checkbox/index.js.map +1 -1
- package/dist/components/chip/index.d.ts +46 -30
- package/dist/components/chip/index.js +38 -17
- package/dist/components/chip/index.js.map +1 -1
- package/dist/components/chip-group/index.d.ts +5 -2
- package/dist/components/chip-group/index.js +8 -2
- package/dist/components/chip-group/index.js.map +1 -1
- package/dist/components/dialog/index.d.ts +27 -0
- package/dist/components/dialog/index.js +81 -37
- package/dist/components/dialog/index.js.map +1 -1
- package/dist/components/fab/index.d.ts +1 -1
- package/dist/components/fab/index.js.map +1 -1
- package/dist/components/form/index.d.ts +14 -4
- package/dist/components/form/index.js +6 -3
- package/dist/components/form/index.js.map +1 -1
- package/dist/components/icon-button/index.d.ts +15 -1
- package/dist/components/icon-button/index.js +15 -1
- package/dist/components/icon-button/index.js.map +1 -1
- package/dist/components/link/index.d.ts +4 -0
- package/dist/components/link/index.js +4 -0
- package/dist/components/link/index.js.map +1 -1
- package/dist/components/list/index.d.ts +34 -0
- package/dist/components/list/index.js +47 -13
- package/dist/components/list/index.js.map +1 -1
- package/dist/components/list-detail/index.d.ts +34 -1
- package/dist/components/list-detail/index.js +34 -1
- package/dist/components/list-detail/index.js.map +1 -1
- package/dist/components/list-item/index.d.ts +21 -2
- package/dist/components/list-item/index.js +6 -0
- package/dist/components/list-item/index.js.map +1 -1
- package/dist/components/menu/index.d.ts +6 -3
- package/dist/components/menu/index.js +3 -1
- package/dist/components/menu/index.js.map +1 -1
- package/dist/components/meter/index.d.ts +4 -0
- package/dist/components/meter/index.js +4 -0
- package/dist/components/meter/index.js.map +1 -1
- package/dist/components/navigation-bar/index.d.ts +14 -2
- package/dist/components/navigation-bar/index.js +14 -2
- package/dist/components/navigation-bar/index.js.map +1 -1
- package/dist/components/navigation-tree/index.js +2 -9
- package/dist/components/navigation-tree/index.js.map +1 -1
- package/dist/components/number-field/index.d.ts +7 -1
- package/dist/components/number-field/index.js +7 -1
- package/dist/components/number-field/index.js.map +1 -1
- package/dist/components/popover/index.d.ts +15 -1
- package/dist/components/popover/index.js +15 -1
- package/dist/components/popover/index.js.map +1 -1
- package/dist/components/product-icon/index.d.ts +8 -1
- package/dist/components/product-icon/index.js +8 -1
- package/dist/components/product-icon/index.js.map +1 -1
- package/dist/components/progress-indicator/index.d.ts +12 -6
- package/dist/components/progress-indicator/index.js +57 -46
- package/dist/components/progress-indicator/index.js.map +1 -1
- package/dist/components/radio-group/index.d.ts +7 -0
- package/dist/components/radio-group/index.js +23 -14
- package/dist/components/radio-group/index.js.map +1 -1
- package/dist/components/search-field/index.d.ts +13 -4
- package/dist/components/search-field/index.js +10 -4
- package/dist/components/search-field/index.js.map +1 -1
- package/dist/components/search-view/index.d.ts +2 -0
- package/dist/components/search-view/index.js.map +1 -1
- package/dist/components/segmented-button/index.d.ts +1 -1
- package/dist/components/segmented-button/index.js.map +1 -1
- package/dist/components/separator/index.d.ts +31 -6
- package/dist/components/separator/index.js +30 -6
- package/dist/components/separator/index.js.map +1 -1
- package/dist/components/sheet/index.d.ts +96 -37
- package/dist/components/sheet/index.js +420 -136
- package/dist/components/sheet/index.js.map +1 -1
- package/dist/components/snackbar/index.d.ts +8 -1
- package/dist/components/snackbar/index.js +7 -0
- package/dist/components/snackbar/index.js.map +1 -1
- package/dist/components/stack/index.d.ts +21 -5
- package/dist/components/stack/index.js +10 -0
- package/dist/components/stack/index.js.map +1 -1
- package/dist/components/switch/index.d.ts +12 -0
- package/dist/components/switch/index.js +12 -0
- package/dist/components/switch/index.js.map +1 -1
- package/dist/components/text-field/index.d.ts +39 -9
- package/dist/components/text-field/index.js +29 -7
- package/dist/components/text-field/index.js.map +1 -1
- package/dist/components/tree/index.js +11 -15
- package/dist/components/tree/index.js.map +1 -1
- package/dist/hooks/useBottomEdge.js +6 -3
- package/dist/hooks/useBottomEdge.js.map +1 -1
- package/dist/hooks/useRipple.js +216 -192
- package/dist/hooks/useRipple.js.map +1 -1
- package/dist/i18n/index.js +1 -0
- package/dist/i18n/index.js.map +1 -1
- package/dist/i18n/messages.js +34 -0
- package/dist/i18n/messages.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/indicator/styles.js +7 -4
- package/dist/indicator/styles.js.map +1 -1
- package/dist/mark/styles.js +11 -5
- package/dist/mark/styles.js.map +1 -1
- package/dist/react-aria.d.ts +2 -2
- package/dist/row/index.js +90 -62
- package/dist/row/index.js.map +1 -1
- package/dist/row/styles.js +6 -1
- package/dist/row/styles.js.map +1 -1
- package/dist/styles/focus.js.map +1 -1
- package/dist/styles/overlay.js +8 -0
- package/dist/styles/overlay.js.map +1 -1
- package/dist/styles.css +135 -114
- package/dist/theme-scope.d.ts +14 -2
- package/dist/theme-scope.js +12 -0
- package/dist/theme-scope.js.map +1 -1
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useRipple.js","names":["MouseEvent","MouseEventHandler","PointerEvent","PointerEventHandler","ReactNode","stylex","useCallback","useEffect","useMemo","useRef","useState","rippleStyles","motionDurationMs","motionEasing","spacingPx","PADDING","sm","INITIAL_ORIGIN_SCALE","SOFT_EDGE_MINIMUM_SIZE","SOFT_EDGE_CONTAINER_RATIO","surfaceProps","props","surface","RippleState","Holding","Inactive","TouchDelay","WaitingForClick","const","ReleaseHandlers","Element","Omit","RippleEventHandlers","HostElement","onClick","onContextMenu","onPointerCancel","onPointerDown","onPointerLeave","onPointerUp","isTouch","event","pointerType","prefersReducedMotion","window","matchMedia","matches","useRipple","enabled","externalHandlers","endsOnRelease","handlers","t0","t1","t2","$","_c","undefined","t3","pressed","setPressed","rippleRef","state","growAnimation","rippleStartEvent","initialSize","rippleScale","removeDocumentListeners","t4","Symbol","for","isPrimary","startEvent","current","pointerId","isPressPointer","t5","event_0","buttons","shouldReactToEvent","t6","rect","height","width","maxDimension","Math","max","softEdgeSize","size","floor","hypotenuse","hypot","maxRadius","determineRippleSize","t7","rect_0","positionEvent","height_0","left","top","width_0","size_0","endPoint","x","y","origin","clientX","clientY","startPoint","getTranslationCoordinates","t8","target","positionEvent_0","ripple","cancel","parentElement","getBoundingClientRect","rect_1","size_1","endPoint_0","startPoint_0","style","animate","transform","duration","long1","easing","standard","fill","startPressAnimation","t9","animation","elapsed","currentTime","Infinity","medium1","Promise","resolve","setTimeout","endPressAnimation","t10","host","document","ownerDocument","handleEnd","event_1","composedPath","includes","addEventListener","removeEventListener","listenBeyondHost","t11","t12","t13","getState","t14","event_2","target_0","currentTarget","_temp","handlePointerDownAsync","t15","event_3","handlePointerDown","t16","event_4","handlePointerUp","t17","event_5","handlePointerLeave","t18","event_6","handlePointerCancel","t19","event_7","handleClick","t20","handleContextMenu","onClickProp","onContextMenuProp","onPointerCancelProp","onPointerDownProp","onPointerLeaveProp","onPointerUpProp","t21","event_8","t22","event_9","t23","event_10","t24","event_11","t25","event_12","t26","event_13","t27","pointer","t28","t29","press","t30","surface_0","t31","enabledResult","t32","disabledResult","resolve_0","short2","stylex.props","rippleStyles","_c","disabledResult"],"sources":["../../src/hooks/useRipple.tsx"],"sourcesContent":["import type { MouseEvent, MouseEventHandler, PointerEvent, PointerEventHandler, ReactNode } from 'react';\nimport * as stylex from '@stylexjs/stylex';\nimport { useCallback, useEffect, useMemo, useRef, useState } from 'react';\nimport { rippleStyles } from '../styles/ripple';\nimport { motionDurationMs, motionEasing, spacingPx } from '../tokens/values';\n\n// Every timing this file drives is a motion token, spent at the point of use\n// below. They come from tokens/values rather than the StyleX theme because\n// element.animate() and setTimeout both reject a token's var() form, and the\n// same is true of the one geometry token: `PADDING` is added to a radius, and\n// a var() would concatenate rather than add. See src/styles/ripple.ts for the\n// opacity half of the mechanism, whose three timings are deliberately not\n// tokens.\n\n/** How far the ripple grows past the host's corners. `spacing.sm`. */\nconst PADDING = spacingPx.sm;\n\n// The rest are ratios and a pixel floor that no token group covers — spacing\n// is layout rhythm, and nothing in the set holds bare geometric ratios.\nconst INITIAL_ORIGIN_SCALE = 0.2;\nconst SOFT_EDGE_MINIMUM_SIZE = 75;\nconst SOFT_EDGE_CONTAINER_RATIO = 0.35;\n\n// Static input, so this is computed once for every consumer of the module\n// rather than once per component instance.\nconst surfaceProps = stylex.props(rippleStyles.surface);\n\n/**\n * On touch: `Inactive -> TouchDelay -> WaitingForClick -> Inactive`, or\n * `Inactive -> TouchDelay -> Holding -> WaitingForClick -> Inactive` for a\n * held press.\n *\n * On mouse or pen: `Inactive -> WaitingForClick -> Inactive`.\n */\nconst RippleState = {\n /** A touch has been confirmed as a press (held past the touch delay). */\n Holding: 2,\n /** No press in progress. Touch down moves to TouchDelay; mouse/pen down moves to WaitingForClick. */\n Inactive: 0,\n /** Touch down received; waiting to see if it's a tap or a scroll/swipe. */\n TouchDelay: 1,\n /** The press has finished growing; waiting for the click that ends it. */\n WaitingForClick: 3\n} as const;\ntype ReleaseHandlers<HostElement extends Element> = Omit<RippleEventHandlers<HostElement>, 'onClick'>;\ninterface RippleEventHandlers<HostElement extends Element> {\n onClick?: MouseEventHandler<HostElement>;\n onContextMenu?: MouseEventHandler<HostElement>;\n onPointerCancel?: PointerEventHandler<HostElement>;\n onPointerDown?: PointerEventHandler<HostElement>;\n onPointerLeave?: PointerEventHandler<HostElement>;\n onPointerUp?: PointerEventHandler<HostElement>;\n}\ntype RippleState = (typeof RippleState)[keyof typeof RippleState];\nfunction isTouch(event: PointerEvent) {\n return event.pointerType === 'touch';\n}\n\n/**\n * Whether the reader has asked the OS for less motion.\n *\n * Growth is a Web Animations call, which makes it the one animation in the\n * library no `@media (prefers-reduced-motion: reduce)` branch can reach — see\n * src/styles/ripple.ts for the opacity half, which is CSS and carries one.\n *\n * Read at the press rather than once at mount, so a reader who changes the\n * setting is answered by their next press rather than by their next reload.\n * The press already reads layout through `getBoundingClientRect`, which costs\n * more than this does.\n */\nfunction prefersReducedMotion() {\n return window.matchMedia('(prefers-reduced-motion: reduce)').matches;\n}\n\n/**\n * Renders a press ripple that grows from the pointer's position, or from\n * the element's center for a keyboard or other non-pointer activation.\n *\n * Growth runs via the Web Animations API on a single reused element (no\n * per-click DOM nodes to clean up), over a fixed duration independent of how\n * long the element is held — a real press-and-hold keeps the ripple\n * growing until release, while a quick tap is still held visible for a\n * minimum duration so it plays a complete animation rather than a flicker.\n *\n * Merges its own handlers with `externalHandlers` (e.g. a component's own\n * consumer-supplied props — ripple's own run first, then the external\n * ones) and returns `handlers` to spread onto the interactive element and\n * `surface`, the node to render as a child. The host element must\n * establish a positioning context (`position: relative` or similar) so\n * `surface`, which fills it via `inset: 0`, clips to its bounds and\n * inherits its shape. A host can render `surface` in a positioned part of\n * itself instead, and the ripple then grows in that part alone, from where\n * the pointer is over it: a navigation destination draws it in its\n * indicator.\n *\n * Pass `enabled: false` to opt out — no ripple listeners are attached and\n * no surface is rendered, leaving `externalHandlers` and a component's own\n * hover/press state layer (if any) untouched.\n *\n * Pass `endsOnRelease` for a host that never hears its own click: a\n * collection row, whose clicks React Aria's press handling keeps for itself.\n * The press then ends when the pointer is released over the host rather than\n * on the click that would follow, still held for the minimum a short press\n * gets. A keyboard press reaches such a host as no pointer event at all, so\n * it draws no ripple there.\n *\n * `handlers` and `surface` are hand-memoized (not left to build-tool\n * optimization) so a consumer rendering many instances — a list of icon\n * buttons, say — can memoize around them too, and so stability doesn't\n * depend on any particular compiler being configured.\n */\n// A host ending on the release never hears a click, so nothing is taken for\n// one and none is handed back: the handlers are the pointer ones alone, which\n// is also what a collection row's type admits.\nfunction useRipple<HostElement extends Element = Element>(enabled: boolean, externalHandlers: ReleaseHandlers<HostElement>, endsOnRelease: true): {\n handlers: ReleaseHandlers<HostElement>;\n surface: ReactNode;\n};\nfunction useRipple<HostElement extends Element = Element>(enabled?: boolean, externalHandlers?: RippleEventHandlers<HostElement>, endsOnRelease?: false): {\n handlers: RippleEventHandlers<HostElement>;\n surface: ReactNode;\n};\nfunction useRipple<HostElement extends Element = Element>(enabled = true, externalHandlers: RippleEventHandlers<HostElement> = {}, endsOnRelease = false): {\n handlers: RippleEventHandlers<HostElement>;\n surface: ReactNode;\n} {\n const [pressed, setPressed] = useState(false);\n const rippleRef = useRef<HTMLSpanElement>(null);\n const state = useRef<RippleState>(RippleState.Inactive);\n const growAnimation = useRef<Animation | undefined>(undefined);\n const rippleStartEvent = useRef<PointerEvent<HostElement> | undefined>(undefined);\n const initialSize = useRef(0);\n const rippleScale = useRef('1');\n // Removes the listeners a press keeps on its host's document, while one is\n // in flight — see `listenBeyondHost`.\n const removeDocumentListeners = useRef<(() => void) | undefined>(undefined);\n\n // Whether `event` comes from the pointer a press would follow: the primary\n // one, and the one that started the press already in flight, if any.\n const isPressPointer = useCallback((event: PointerEvent<HostElement>) => {\n if (!event.isPrimary) {\n return false;\n }\n const startEvent = rippleStartEvent.current;\n return !startEvent || startEvent.pointerId === event.pointerId;\n }, []);\n const shouldReactToEvent = useCallback((event: PointerEvent<HostElement>) => isPressPointer(event) && (isTouch(event) || event.buttons === 1), [isPressPointer]);\n const determineRippleSize = useCallback((rect: DOMRect) => {\n const {\n height,\n width\n } = rect;\n const maxDimension = Math.max(height, width);\n const softEdgeSize = Math.max(SOFT_EDGE_CONTAINER_RATIO * maxDimension, SOFT_EDGE_MINIMUM_SIZE);\n const size = Math.floor(maxDimension * INITIAL_ORIGIN_SCALE);\n const hypotenuse = Math.hypot(width, height);\n const maxRadius = hypotenuse + PADDING;\n initialSize.current = size;\n rippleScale.current = `${(maxRadius + softEdgeSize) / size}`;\n return `${size}px`;\n }, []);\n const getTranslationCoordinates = useCallback((rect: DOMRect, positionEvent?: PointerEvent<HostElement>) => {\n const {\n height,\n left,\n top,\n width\n } = rect;\n const size = initialSize.current;\n const endPoint = {\n x: (width - size) / 2,\n y: (height - size) / 2\n };\n const origin = positionEvent ? {\n x: positionEvent.clientX - left,\n y: positionEvent.clientY - top\n } : {\n x: width / 2,\n y: height / 2\n };\n const startPoint = {\n x: origin.x - size / 2,\n y: origin.y - size / 2\n };\n return {\n endPoint,\n startPoint\n };\n }, []);\n const startPressAnimation = useCallback((target: HostElement, positionEvent?: PointerEvent<HostElement>) => {\n const ripple = rippleRef.current;\n if (!ripple) {\n return;\n }\n setPressed(true);\n growAnimation.current?.cancel();\n\n // Read once and share: the two helpers below both only need the\n // rect, and a second `getBoundingClientRect()` call back to back with\n // the first would be a redundant layout read.\n //\n // The surface's rect rather than the host's, since the ripple is placed\n // inside the surface. The two are one box wherever the surface fills\n // the host, which is every host but one drawing the surface in a part\n // of itself. Under forced colours the surface is not drawn and has no\n // box, so the host's stands in for a ripple nobody sees.\n const surface = ripple.parentElement?.getBoundingClientRect();\n const rect = surface && (surface.width > 0 || surface.height > 0) ? surface : target.getBoundingClientRect();\n const size = determineRippleSize(rect);\n const {\n endPoint,\n startPoint\n } = getTranslationCoordinates(rect, positionEvent);\n ripple.style.width = size;\n ripple.style.height = size;\n growAnimation.current = ripple.animate({\n transform: [`translate(${startPoint.x}px, ${startPoint.y}px) scale(1)`, `translate(${endPoint.x}px, ${endPoint.y}px) scale(${rippleScale.current})`]\n }, {\n // Growth runs over a fixed duration regardless of how long the\n // press is held, so the token is spent here rather than named as a\n // constant — element.animate() is one of the two places a StyleX\n // token could not have gone.\n //\n // Zeroed rather than skipped under reduced motion, which lands the\n // disc at its full size with the growth never drawn. Skipping the\n // call outright would leave `growAnimation` unset, and the release\n // below reads its `currentTime` to decide whether the press has\n // been visible long enough — so the press would still be shown, and\n // would stop being held for its minimum.\n duration: prefersReducedMotion() ? 0 : motionDurationMs.long1,\n easing: motionEasing.standard,\n fill: 'forwards'\n });\n }, [determineRippleSize, getTranslationCoordinates]);\n const endPressAnimation = useCallback(async () => {\n removeDocumentListeners.current?.();\n removeDocumentListeners.current = undefined;\n rippleStartEvent.current = undefined;\n state.current = RippleState.Inactive;\n const animation = growAnimation.current;\n const elapsed = typeof animation?.currentTime === 'number' ? animation.currentTime : Infinity;\n\n // The floor on how briefly a ripple may be visible, so a quick tap reads\n // as a deliberate ripple rather than a flicker.\n if (elapsed >= motionDurationMs.medium1) {\n setPressed(false);\n return;\n }\n await new Promise(resolve => {\n setTimeout(resolve, motionDurationMs.medium1 - elapsed);\n });\n if (growAnimation.current !== animation) {\n // A newer press started; let it own the pressed state instead.\n return;\n }\n setPressed(false);\n }, []);\n\n // A press can end somewhere other than its host. React Aria's press\n // handling releases the capture a touch takes on its pointerdown, so that a\n // finger can leave the element, and a press that turns into a scroll — or\n // a finger that slides off and lifts — then ends with a pointercancel or\n // pointerup on whatever is under it, which the host never hears. Left to\n // the host's handlers alone, the ripple held at its pressed opacity until\n // the next press on that host finished a cycle.\n //\n // So the press listens on its host's document, in the capture phase, for\n // its own pointer, the way React Aria's own press handling does. An end the\n // host does hear is left to the host's handlers, which run after these.\n const listenBeyondHost = useCallback((host: HostElement, pointerId: number) => {\n removeDocumentListeners.current?.();\n const document = host.ownerDocument;\n const handleEnd = (event: globalThis.PointerEvent) => {\n if (event.pointerId !== pointerId || event.composedPath().includes(host)) {\n return;\n }\n void endPressAnimation();\n };\n document.addEventListener('pointercancel', handleEnd, true);\n document.addEventListener('pointerup', handleEnd, true);\n removeDocumentListeners.current = () => {\n document.removeEventListener('pointercancel', handleEnd, true);\n document.removeEventListener('pointerup', handleEnd, true);\n };\n }, [endPressAnimation]);\n\n // A host unmounted mid-press leaves nothing listening behind it.\n useEffect(() => () => {\n removeDocumentListeners.current?.();\n }, []);\n\n // Reads through a function so a stale narrowing of `state.current` from\n // before the `await` below isn't (incorrectly) carried across it — the\n // ref can change via a different handler while this one is suspended.\n const getState = useCallback(() => state.current, []);\n const handlePointerDownAsync = useCallback(async (event: PointerEvent<HostElement>) => {\n if (!shouldReactToEvent(event)) {\n return;\n }\n rippleStartEvent.current = event;\n const target = event.currentTarget;\n listenBeyondHost(target, event.pointerId);\n if (!isTouch(event)) {\n state.current = RippleState.WaitingForClick;\n startPressAnimation(target, event);\n return;\n }\n\n // Delay so a scroll/swipe starting on the element doesn't flash a\n // ripple — only a held (or quickly released) touch counts as a press.\n state.current = RippleState.TouchDelay;\n await new Promise(resolve => {\n setTimeout(resolve, motionDurationMs.short2);\n });\n if (getState() !== RippleState.TouchDelay) {\n return;\n }\n state.current = RippleState.Holding;\n startPressAnimation(target, event);\n }, [getState, listenBeyondHost, shouldReactToEvent, startPressAnimation]);\n const handlePointerDown = useCallback((event: PointerEvent<HostElement>) => {\n void handlePointerDownAsync(event);\n }, [handlePointerDownAsync]);\n const handlePointerUp = useCallback((event: PointerEvent<HostElement>) => {\n // A mouse or pen release carries no pressed button, so the guard the\n // other handlers share turns it away, which is right while a click\n // follows to end the press. A host ending on the release matches it by\n // its pointer alone.\n if (endsOnRelease && !isTouch(event)) {\n if (isPressPointer(event) && state.current === RippleState.WaitingForClick) {\n void endPressAnimation();\n }\n return;\n }\n if (!shouldReactToEvent(event)) {\n return;\n }\n if (state.current === RippleState.Holding) {\n state.current = RippleState.WaitingForClick;\n } else if (state.current === RippleState.TouchDelay) {\n // Released before the delay elapsed: treat as a completed tap.\n state.current = RippleState.WaitingForClick;\n startPressAnimation(event.currentTarget, rippleStartEvent.current);\n }\n\n // The release is as far as such a host hears, so it is where the\n // press ends — see `endsOnRelease` above.\n if (endsOnRelease && state.current === RippleState.WaitingForClick) {\n void endPressAnimation();\n }\n }, [endPressAnimation, endsOnRelease, isPressPointer, shouldReactToEvent, startPressAnimation]);\n const handlePointerLeave = useCallback((event: PointerEvent<HostElement>) => {\n if (isTouch(event) || !shouldReactToEvent(event)) {\n return;\n }\n if (state.current !== RippleState.Inactive) {\n void endPressAnimation();\n }\n }, [endPressAnimation, shouldReactToEvent]);\n const handlePointerCancel = useCallback((event: PointerEvent<HostElement>) => {\n if (!shouldReactToEvent(event)) {\n return;\n }\n void endPressAnimation();\n }, [endPressAnimation, shouldReactToEvent]);\n const handleClick = useCallback((event: MouseEvent<HostElement>) => {\n if (state.current === RippleState.WaitingForClick) {\n void endPressAnimation();\n return;\n }\n if (state.current === RippleState.Inactive) {\n // No pointerdown preceded this click — keyboard activation, a\n // programmatic `.click()`, or assistive-tech-synthesized activation.\n // Play a complete, centered press immediately.\n startPressAnimation(event.currentTarget);\n void endPressAnimation();\n }\n }, [endPressAnimation, startPressAnimation]);\n const handleContextMenu = useCallback(() => {\n void endPressAnimation();\n }, [endPressAnimation]);\n const {\n onClick: onClickProp,\n onContextMenu: onContextMenuProp,\n onPointerCancel: onPointerCancelProp,\n onPointerDown: onPointerDownProp,\n onPointerLeave: onPointerLeaveProp,\n onPointerUp: onPointerUpProp\n } = externalHandlers;\n const onClick = useCallback((event: MouseEvent<HostElement>) => {\n handleClick(event);\n onClickProp?.(event);\n }, [handleClick, onClickProp]);\n const onContextMenu = useCallback((event: MouseEvent<HostElement>) => {\n handleContextMenu();\n onContextMenuProp?.(event);\n }, [handleContextMenu, onContextMenuProp]);\n const onPointerCancel = useCallback((event: PointerEvent<HostElement>) => {\n handlePointerCancel(event);\n onPointerCancelProp?.(event);\n }, [handlePointerCancel, onPointerCancelProp]);\n const onPointerDown = useCallback((event: PointerEvent<HostElement>) => {\n handlePointerDown(event);\n onPointerDownProp?.(event);\n }, [handlePointerDown, onPointerDownProp]);\n const onPointerLeave = useCallback((event: PointerEvent<HostElement>) => {\n handlePointerLeave(event);\n onPointerLeaveProp?.(event);\n }, [handlePointerLeave, onPointerLeaveProp]);\n const onPointerUp = useCallback((event: PointerEvent<HostElement>) => {\n handlePointerUp(event);\n onPointerUpProp?.(event);\n }, [handlePointerUp, onPointerUpProp]);\n const handlers = useMemo(() => {\n const pointer = {\n onContextMenu,\n onPointerCancel,\n onPointerDown,\n onPointerLeave,\n onPointerUp\n };\n return endsOnRelease ? pointer : {\n onClick,\n ...pointer\n };\n }, [endsOnRelease, onClick, onContextMenu, onPointerCancel, onPointerDown, onPointerLeave, onPointerUp]);\n const surface = useMemo(() => <span aria-hidden=\"true\" {...surfaceProps}>\n <span ref={rippleRef} {...stylex.props(rippleStyles.press, pressed && rippleStyles.pressed)} />\n </span>, [pressed]);\n\n // Two separate memos rather than one branching on `enabled`, so that\n // whichever branch is actually active stays keyed only on its own\n // inputs — the enabled result doesn't get a new identity every time\n // `externalHandlers` does (a component typically passes a fresh object\n // literal each render), and vice versa.\n const enabledResult = useMemo(() => ({\n handlers,\n surface\n }), [handlers, surface]);\n const disabledResult = useMemo(() => ({\n handlers: externalHandlers,\n surface: null\n }), [externalHandlers]);\n return enabled ? enabledResult : disabledResult;\n}\nexport { useRipple };"],"mappings":";;;;;;;;AAeA,MAAMe,UAAUD,UAAUE;AAI1B,MAAMC,uBAAuB;AAC7B,MAAMC,yBAAyB;AAC/B,MAAMC,4BAA4B;AAIlC,MAAMC,eAAef,MAAaM,OAAaW,OAAO;;;;;;;;AAStD,MAAMC,cAAc;;CAElBC,SAAS;;CAETC,UAAU;;CAEVC,YAAY;;CAEZC,iBAAiB;AACnB;AAWA,SAASa,QAAQC,OAAqB;CACpC,OAAOA,MAAMC,gBAAgB;AAC/B;;;;;;;;;;;;;AAcA,SAASC,uBAAuB;CAC9B,OAAOC,OAAOC,WAAW,kCAAkC,CAAC,CAACC;AAC/D;AAkDA,SAAAC,UAAAK,IAAAC,IAAAC,IAAA;CAAA,MAAAC,IAAAC,EAAA,EAAA;CAA0D,MAAAR,UAAAI,OAAAK,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CAAA;EACtF,CAAA;EAAAhJ,EAAA,MAAAgJ;EAAAhJ,EAAA,MAAAkJ;CAAA,OAAAA,MAAAlJ,EAAA;CAFX,MAAAmJ,YAA8BD;CAEN,IAAAE;CAAA,IAAApJ,EAAA,QAAAJ,YAAAI,EAAA,QAAAmJ,WAAA;EAOaC,MAAA;GAAAxJ;GAAA7B,SAEnCA;EACF;EAACiC,EAAA,MAAAJ;EAAAI,EAAA,MAAAmJ;EAAAnJ,EAAA,MAAAoJ;CAAA,OAAAA,MAAApJ,EAAA;CAHD,MAAAqJ,gBAAqCD;CAGZ,IAAAE;CAAA,IAAAtJ,EAAA,QAAAN,kBAAA;EACa4J,MAAA;GAAA1J,UAC1BF;GAAgB3B,SACjB;EACX;EAACiC,EAAA,MAAAN;EAAAM,EAAA,MAAAsJ;CAAA,OAAAA,MAAAtJ,EAAA;CAAuB,OACjBP,UAAA4J,gBAAAE;AAAwC;AAjUjD,SAAA/C,MAAAgD,WAAA;CA8LMrE,WAAWD,WAAS7H,iBAAgBoM,MAAO;AAAC"}
|
|
1
|
+
{"version":3,"file":"useRipple.js","names":["MouseEvent","MouseEventHandler","PointerEvent","PointerEventHandler","ReactNode","stylex","useCallback","useEffect","useMemo","useRef","useState","rippleStyles","motionDurationMs","motionEasing","spacingPx","PADDING","sm","INITIAL_ORIGIN_SCALE","SOFT_EDGE_MINIMUM_SIZE","SOFT_EDGE_CONTAINER_RATIO","surfaceProps","props","surface","RippleState","Holding","Inactive","TouchDelay","WaitingForClick","const","ReleaseHandlers","Element","Omit","RippleEventHandlers","HostElement","onClick","onContextMenu","onPointerCancel","onPointerDown","onPointerLeave","onPointerUp","isTouch","event","pointerType","prefersReducedMotion","window","matchMedia","matches","useRipple","enabled","externalHandlers","endsOnRelease","centred","handlers","play","t0","t1","t2","t3","$","_c","undefined","t4","pressed","setPressed","rippleRef","state","growAnimation","rippleStartEvent","initialSize","rippleScale","removeDocumentListeners","t5","Symbol","for","isPrimary","startEvent","current","pointerId","isPressPointer","t6","event_0","buttons","shouldReactToEvent","t7","rect","height","width","maxDimension","Math","max","softEdgeSize","size","floor","hypotenuse","hypot","maxRadius","determineRippleSize","t8","rect_0","positionEvent","height_0","left","top","width_0","size_0","endPoint","x","y","origin","clientX","clientY","startPoint","getTranslationCoordinates","t9","target","positionEvent_0","ripple","cancel","parentElement","getBoundingClientRect","rect_1","size_1","endPoint_0","startPoint_0","style","animate","transform","duration","long1","easing","standard","fill","startPressAnimation","t10","animation","elapsed","currentTime","Infinity","medium1","Promise","resolve","setTimeout","endPressAnimation","t11","host","document","ownerDocument","handleEnd","event_1","composedPath","includes","addEventListener","removeEventListener","listenBeyondHost","t12","t13","t14","getState","t15","event_2","target_0","currentTarget","_temp","handlePointerDownAsync","t16","event_3","handlePointerDown","t17","event_4","handlePointerUp","t18","event_5","handlePointerLeave","t19","event_6","handlePointerCancel","t20","event_7","handleClick","t21","host_0","t22","handleContextMenu","onClickProp","onContextMenuProp","onPointerCancelProp","onPointerDownProp","onPointerLeaveProp","onPointerUpProp","t23","event_8","t24","event_9","t25","event_10","t26","event_11","t27","event_12","t28","event_13","t29","pointer","t30","t31","press","t32","surface_0","t33","enabledResult","t34","disabledResult","resolve_0","short2","stylex.props","rippleStyles","_c","disabledResult"],"sources":["../../src/hooks/useRipple.tsx"],"sourcesContent":["import type { MouseEvent, MouseEventHandler, PointerEvent, PointerEventHandler, ReactNode } from 'react';\nimport * as stylex from '@stylexjs/stylex';\nimport { useCallback, useEffect, useMemo, useRef, useState } from 'react';\nimport { rippleStyles } from '../styles/ripple';\nimport { motionDurationMs, motionEasing, spacingPx } from '../tokens/values';\n\n// Every timing this file drives is a motion token, spent at the point of use\n// below. They come from tokens/values rather than the StyleX theme because\n// element.animate() and setTimeout both reject a token's var() form, and the\n// same is true of the one geometry token: `PADDING` is added to a radius, and\n// a var() would concatenate rather than add. See src/styles/ripple.ts for the\n// opacity half of the mechanism, whose three timings are deliberately not\n// tokens.\n\n/** How far the ripple grows past the host's corners. `spacing.sm`. */\nconst PADDING = spacingPx.sm;\n\n// The rest are ratios and a pixel floor that no token group covers — spacing\n// is layout rhythm, and nothing in the set holds bare geometric ratios.\nconst INITIAL_ORIGIN_SCALE = 0.2;\nconst SOFT_EDGE_MINIMUM_SIZE = 75;\nconst SOFT_EDGE_CONTAINER_RATIO = 0.35;\n\n// Static input, so this is computed once for every consumer of the module\n// rather than once per component instance.\nconst surfaceProps = stylex.props(rippleStyles.surface);\n\n/**\n * On touch: `Inactive -> TouchDelay -> WaitingForClick -> Inactive`, or\n * `Inactive -> TouchDelay -> Holding -> WaitingForClick -> Inactive` for a\n * held press.\n *\n * On mouse or pen: `Inactive -> WaitingForClick -> Inactive`.\n */\nconst RippleState = {\n /** A touch has been confirmed as a press (held past the touch delay). */\n Holding: 2,\n /** No press in progress. Touch down moves to TouchDelay; mouse/pen down moves to WaitingForClick. */\n Inactive: 0,\n /** Touch down received; waiting to see if it's a tap or a scroll/swipe. */\n TouchDelay: 1,\n /** The press has finished growing; waiting for the click that ends it. */\n WaitingForClick: 3\n} as const;\ntype ReleaseHandlers<HostElement extends Element> = Omit<RippleEventHandlers<HostElement>, 'onClick'>;\ninterface RippleEventHandlers<HostElement extends Element> {\n onClick?: MouseEventHandler<HostElement>;\n onContextMenu?: MouseEventHandler<HostElement>;\n onPointerCancel?: PointerEventHandler<HostElement>;\n onPointerDown?: PointerEventHandler<HostElement>;\n onPointerLeave?: PointerEventHandler<HostElement>;\n onPointerUp?: PointerEventHandler<HostElement>;\n}\ntype RippleState = (typeof RippleState)[keyof typeof RippleState];\nfunction isTouch(event: PointerEvent) {\n return event.pointerType === 'touch';\n}\n\n/**\n * Whether the reader has asked the OS for less motion.\n *\n * Growth is a Web Animations call, which makes it the one animation in the\n * library no `@media (prefers-reduced-motion: reduce)` branch can reach — see\n * src/styles/ripple.ts for the opacity half, which is CSS and carries one.\n *\n * Read at the press rather than once at mount, so a reader who changes the\n * setting is answered by their next press rather than by their next reload.\n * The press already reads layout through `getBoundingClientRect`, which costs\n * more than this does.\n */\nfunction prefersReducedMotion() {\n return window.matchMedia('(prefers-reduced-motion: reduce)').matches;\n}\n\n/**\n * Renders a press ripple that grows from the pointer's position, or from\n * the element's center for a keyboard or other non-pointer activation.\n *\n * Growth runs via the Web Animations API on a single reused element (no\n * per-click DOM nodes to clean up), over a fixed duration independent of how\n * long the element is held — a real press-and-hold keeps the ripple\n * growing until release, while a quick tap is still held visible for a\n * minimum duration so it plays a complete animation rather than a flicker.\n *\n * Merges its own handlers with `externalHandlers` (e.g. a component's own\n * consumer-supplied props — ripple's own run first, then the external\n * ones) and returns `handlers` to spread onto the interactive element and\n * `surface`, the node to render as a child. The host element must\n * establish a positioning context (`position: relative` or similar) so\n * `surface`, which fills it via `inset: 0`, clips to its bounds and\n * inherits its shape. A host can render `surface` in a positioned part of\n * itself instead, and the ripple then grows in that part alone, from where\n * the pointer is over it: a navigation destination draws it in its\n * indicator.\n *\n * Pass `enabled: false` to opt out — no ripple listeners are attached and\n * no surface is rendered, leaving `externalHandlers` and a component's own\n * hover/press state layer (if any) untouched.\n *\n * Pass `endsOnRelease` for a host that never hears its own click: a\n * collection row, whose clicks React Aria's press handling keeps for itself.\n * The press then ends when the pointer is released over the host rather than\n * on the click that would follow, still held for the minimum a short press\n * gets. A keyboard press reaches such a host as no pointer event at all, so\n * it draws no ripple there unless the host plays one.\n *\n * `play` is that: a whole press from the middle of the surface, as a click\n * with no pointer before it plays, for a host that learns of a press some\n * other way. A checkbox calls it for a key, which reaches its input rather\n * than the label its ripple listens on.\n *\n * Pass `centred` for a host whose presses land beside its surface as well as\n * on it: a checkbox, whose label runs the width of its row. Every press then\n * grows from the middle of the surface, as a key's does. Following the\n * pointer, a press at the far end of the label grew from hundreds of pixels\n * away and reached the control only as the growth ended.\n *\n * `handlers`, `play` and `surface` are hand-memoized (not left to build-tool\n * optimization) so a consumer rendering many instances — a list of icon\n * buttons, say — can memoize around them too, and so stability doesn't\n * depend on any particular compiler being configured.\n */\n// A host ending on the release never hears a click, so nothing is taken for\n// one and none is handed back: the handlers are the pointer ones alone, which\n// is also what a collection row's type admits.\nfunction useRipple<HostElement extends Element = Element>(enabled: boolean, externalHandlers: ReleaseHandlers<HostElement>, endsOnRelease: true, centred?: boolean): {\n handlers: ReleaseHandlers<HostElement>;\n play: () => void;\n surface: ReactNode;\n};\nfunction useRipple<HostElement extends Element = Element>(enabled?: boolean, externalHandlers?: RippleEventHandlers<HostElement>, endsOnRelease?: false, centred?: boolean): {\n handlers: RippleEventHandlers<HostElement>;\n play: () => void;\n surface: ReactNode;\n};\nfunction useRipple<HostElement extends Element = Element>(enabled = true, externalHandlers: RippleEventHandlers<HostElement> = {}, endsOnRelease = false, centred = false): {\n handlers: RippleEventHandlers<HostElement>;\n play: () => void;\n surface: ReactNode;\n} {\n const [pressed, setPressed] = useState(false);\n const rippleRef = useRef<HTMLSpanElement>(null);\n const state = useRef<RippleState>(RippleState.Inactive);\n const growAnimation = useRef<Animation | undefined>(undefined);\n const rippleStartEvent = useRef<PointerEvent<HostElement> | undefined>(undefined);\n const initialSize = useRef(0);\n const rippleScale = useRef('1');\n // Removes the listeners a press keeps on its host's document, while one is\n // in flight — see `listenBeyondHost`.\n const removeDocumentListeners = useRef<(() => void) | undefined>(undefined);\n\n // Whether `event` comes from the pointer a press would follow: the primary\n // one, and the one that started the press already in flight, if any.\n const isPressPointer = useCallback((event: PointerEvent<HostElement>) => {\n if (!event.isPrimary) {\n return false;\n }\n const startEvent = rippleStartEvent.current;\n return !startEvent || startEvent.pointerId === event.pointerId;\n }, []);\n const shouldReactToEvent = useCallback((event: PointerEvent<HostElement>) => isPressPointer(event) && (isTouch(event) || event.buttons === 1), [isPressPointer]);\n const determineRippleSize = useCallback((rect: DOMRect) => {\n const {\n height,\n width\n } = rect;\n const maxDimension = Math.max(height, width);\n const softEdgeSize = Math.max(SOFT_EDGE_CONTAINER_RATIO * maxDimension, SOFT_EDGE_MINIMUM_SIZE);\n const size = Math.floor(maxDimension * INITIAL_ORIGIN_SCALE);\n const hypotenuse = Math.hypot(width, height);\n const maxRadius = hypotenuse + PADDING;\n initialSize.current = size;\n rippleScale.current = `${(maxRadius + softEdgeSize) / size}`;\n return `${size}px`;\n }, []);\n const getTranslationCoordinates = useCallback((rect: DOMRect, positionEvent?: PointerEvent<HostElement>) => {\n const {\n height,\n left,\n top,\n width\n } = rect;\n const size = initialSize.current;\n const endPoint = {\n x: (width - size) / 2,\n y: (height - size) / 2\n };\n const origin = positionEvent ? {\n x: positionEvent.clientX - left,\n y: positionEvent.clientY - top\n } : {\n x: width / 2,\n y: height / 2\n };\n const startPoint = {\n x: origin.x - size / 2,\n y: origin.y - size / 2\n };\n return {\n endPoint,\n startPoint\n };\n }, []);\n const startPressAnimation = useCallback((target: Element, positionEvent?: PointerEvent<HostElement>) => {\n const ripple = rippleRef.current;\n if (!ripple) {\n return;\n }\n setPressed(true);\n growAnimation.current?.cancel();\n\n // Read once and share: the two helpers below both only need the\n // rect, and a second `getBoundingClientRect()` call back to back with\n // the first would be a redundant layout read.\n //\n // The surface's rect rather than the host's, since the ripple is placed\n // inside the surface. The two are one box wherever the surface fills\n // the host, which is every host but one drawing the surface in a part\n // of itself. Under forced colours the surface is not drawn and has no\n // box, so the host's stands in for a ripple nobody sees.\n const surface = ripple.parentElement?.getBoundingClientRect();\n const rect = surface && (surface.width > 0 || surface.height > 0) ? surface : target.getBoundingClientRect();\n const size = determineRippleSize(rect);\n const {\n endPoint,\n startPoint\n } = getTranslationCoordinates(rect, centred ? undefined : positionEvent);\n ripple.style.width = size;\n ripple.style.height = size;\n growAnimation.current = ripple.animate({\n transform: [`translate(${startPoint.x}px, ${startPoint.y}px) scale(1)`, `translate(${endPoint.x}px, ${endPoint.y}px) scale(${rippleScale.current})`]\n }, {\n // Growth runs over a fixed duration regardless of how long the\n // press is held, so the token is spent here rather than named as a\n // constant — element.animate() is one of the two places a StyleX\n // token could not have gone.\n //\n // Zeroed rather than skipped under reduced motion, which lands the\n // disc at its full size with the growth never drawn. Skipping the\n // call outright would leave `growAnimation` unset, and the release\n // below reads its `currentTime` to decide whether the press has\n // been visible long enough — so the press would still be shown, and\n // would stop being held for its minimum.\n duration: prefersReducedMotion() ? 0 : motionDurationMs.long1,\n easing: motionEasing.standard,\n fill: 'forwards'\n });\n }, [centred, determineRippleSize, getTranslationCoordinates]);\n const endPressAnimation = useCallback(async () => {\n removeDocumentListeners.current?.();\n removeDocumentListeners.current = undefined;\n rippleStartEvent.current = undefined;\n state.current = RippleState.Inactive;\n const animation = growAnimation.current;\n const elapsed = typeof animation?.currentTime === 'number' ? animation.currentTime : Infinity;\n\n // The floor on how briefly a ripple may be visible, so a quick tap reads\n // as a deliberate ripple rather than a flicker.\n if (elapsed >= motionDurationMs.medium1) {\n setPressed(false);\n return;\n }\n await new Promise(resolve => {\n setTimeout(resolve, motionDurationMs.medium1 - elapsed);\n });\n if (growAnimation.current !== animation) {\n // A newer press started; let it own the pressed state instead.\n return;\n }\n setPressed(false);\n }, []);\n\n // A press can end somewhere other than its host. React Aria's press\n // handling releases the capture a touch takes on its pointerdown, so that a\n // finger can leave the element, and a press that turns into a scroll — or\n // a finger that slides off and lifts — then ends with a pointercancel or\n // pointerup on whatever is under it, which the host never hears. Left to\n // the host's handlers alone, the ripple held at its pressed opacity until\n // the next press on that host finished a cycle.\n //\n // So the press listens on its host's document, in the capture phase, for\n // its own pointer, the way React Aria's own press handling does. An end the\n // host does hear is left to the host's handlers, which run after these.\n const listenBeyondHost = useCallback((host: HostElement, pointerId: number) => {\n removeDocumentListeners.current?.();\n const document = host.ownerDocument;\n const handleEnd = (event: globalThis.PointerEvent) => {\n if (event.pointerId !== pointerId || event.composedPath().includes(host)) {\n return;\n }\n void endPressAnimation();\n };\n document.addEventListener('pointercancel', handleEnd, true);\n document.addEventListener('pointerup', handleEnd, true);\n removeDocumentListeners.current = () => {\n document.removeEventListener('pointercancel', handleEnd, true);\n document.removeEventListener('pointerup', handleEnd, true);\n };\n }, [endPressAnimation]);\n\n // A host unmounted mid-press leaves nothing listening behind it.\n useEffect(() => () => {\n removeDocumentListeners.current?.();\n }, []);\n\n // Reads through a function so a stale narrowing of `state.current` from\n // before the `await` below isn't (incorrectly) carried across it — the\n // ref can change via a different handler while this one is suspended.\n const getState = useCallback(() => state.current, []);\n const handlePointerDownAsync = useCallback(async (event: PointerEvent<HostElement>) => {\n if (!shouldReactToEvent(event)) {\n return;\n }\n rippleStartEvent.current = event;\n const target = event.currentTarget;\n listenBeyondHost(target, event.pointerId);\n if (!isTouch(event)) {\n state.current = RippleState.WaitingForClick;\n startPressAnimation(target, event);\n return;\n }\n\n // Delay so a scroll/swipe starting on the element doesn't flash a\n // ripple — only a held (or quickly released) touch counts as a press.\n state.current = RippleState.TouchDelay;\n await new Promise(resolve => {\n setTimeout(resolve, motionDurationMs.short2);\n });\n if (getState() !== RippleState.TouchDelay) {\n return;\n }\n state.current = RippleState.Holding;\n startPressAnimation(target, event);\n }, [getState, listenBeyondHost, shouldReactToEvent, startPressAnimation]);\n const handlePointerDown = useCallback((event: PointerEvent<HostElement>) => {\n void handlePointerDownAsync(event);\n }, [handlePointerDownAsync]);\n const handlePointerUp = useCallback((event: PointerEvent<HostElement>) => {\n // A mouse or pen release carries no pressed button, so the guard the\n // other handlers share turns it away, which is right while a click\n // follows to end the press. A host ending on the release matches it by\n // its pointer alone.\n if (endsOnRelease && !isTouch(event)) {\n if (isPressPointer(event) && state.current === RippleState.WaitingForClick) {\n void endPressAnimation();\n }\n return;\n }\n if (!shouldReactToEvent(event)) {\n return;\n }\n if (state.current === RippleState.Holding) {\n state.current = RippleState.WaitingForClick;\n } else if (state.current === RippleState.TouchDelay) {\n // Released before the delay elapsed: treat as a completed tap.\n state.current = RippleState.WaitingForClick;\n startPressAnimation(event.currentTarget, rippleStartEvent.current);\n }\n\n // The release is as far as such a host hears, so it is where the\n // press ends — see `endsOnRelease` above.\n if (endsOnRelease && state.current === RippleState.WaitingForClick) {\n void endPressAnimation();\n }\n }, [endPressAnimation, endsOnRelease, isPressPointer, shouldReactToEvent, startPressAnimation]);\n const handlePointerLeave = useCallback((event: PointerEvent<HostElement>) => {\n if (isTouch(event) || !shouldReactToEvent(event)) {\n return;\n }\n if (state.current !== RippleState.Inactive) {\n void endPressAnimation();\n }\n }, [endPressAnimation, shouldReactToEvent]);\n const handlePointerCancel = useCallback((event: PointerEvent<HostElement>) => {\n if (!shouldReactToEvent(event)) {\n return;\n }\n void endPressAnimation();\n }, [endPressAnimation, shouldReactToEvent]);\n const handleClick = useCallback((event: MouseEvent<HostElement>) => {\n if (state.current === RippleState.WaitingForClick) {\n void endPressAnimation();\n return;\n }\n if (state.current === RippleState.Inactive) {\n // No pointerdown preceded this click — keyboard activation, a\n // programmatic `.click()`, or assistive-tech-synthesized activation.\n // Play a complete, centered press immediately.\n startPressAnimation(event.currentTarget);\n void endPressAnimation();\n }\n }, [endPressAnimation, startPressAnimation]);\n\n // The element the surface is rendered in stands in for the host a click\n // would have named. With no surface rendered there is nothing to play, and\n // a press already in flight is left to the pointer that started it.\n const play = useCallback(() => {\n const host = rippleRef.current?.parentElement?.parentElement;\n if (!host || state.current !== RippleState.Inactive) {\n return;\n }\n startPressAnimation(host);\n void endPressAnimation();\n }, [endPressAnimation, startPressAnimation]);\n const handleContextMenu = useCallback(() => {\n void endPressAnimation();\n }, [endPressAnimation]);\n const {\n onClick: onClickProp,\n onContextMenu: onContextMenuProp,\n onPointerCancel: onPointerCancelProp,\n onPointerDown: onPointerDownProp,\n onPointerLeave: onPointerLeaveProp,\n onPointerUp: onPointerUpProp\n } = externalHandlers;\n const onClick = useCallback((event: MouseEvent<HostElement>) => {\n handleClick(event);\n onClickProp?.(event);\n }, [handleClick, onClickProp]);\n const onContextMenu = useCallback((event: MouseEvent<HostElement>) => {\n handleContextMenu();\n onContextMenuProp?.(event);\n }, [handleContextMenu, onContextMenuProp]);\n const onPointerCancel = useCallback((event: PointerEvent<HostElement>) => {\n handlePointerCancel(event);\n onPointerCancelProp?.(event);\n }, [handlePointerCancel, onPointerCancelProp]);\n const onPointerDown = useCallback((event: PointerEvent<HostElement>) => {\n handlePointerDown(event);\n onPointerDownProp?.(event);\n }, [handlePointerDown, onPointerDownProp]);\n const onPointerLeave = useCallback((event: PointerEvent<HostElement>) => {\n handlePointerLeave(event);\n onPointerLeaveProp?.(event);\n }, [handlePointerLeave, onPointerLeaveProp]);\n const onPointerUp = useCallback((event: PointerEvent<HostElement>) => {\n handlePointerUp(event);\n onPointerUpProp?.(event);\n }, [handlePointerUp, onPointerUpProp]);\n const handlers = useMemo(() => {\n const pointer = {\n onContextMenu,\n onPointerCancel,\n onPointerDown,\n onPointerLeave,\n onPointerUp\n };\n return endsOnRelease ? pointer : {\n onClick,\n ...pointer\n };\n }, [endsOnRelease, onClick, onContextMenu, onPointerCancel, onPointerDown, onPointerLeave, onPointerUp]);\n const surface = useMemo(() => <span aria-hidden=\"true\" {...surfaceProps}>\n <span ref={rippleRef} {...stylex.props(rippleStyles.press, pressed && rippleStyles.pressed)} />\n </span>, [pressed]);\n\n // Two separate memos rather than one branching on `enabled`, so that\n // whichever branch is actually active stays keyed only on its own\n // inputs — the enabled result doesn't get a new identity every time\n // `externalHandlers` does (a component typically passes a fresh object\n // literal each render), and vice versa.\n const enabledResult = useMemo(() => ({\n handlers,\n play,\n surface\n }), [handlers, play, surface]);\n const disabledResult = useMemo(() => ({\n handlers: externalHandlers,\n play,\n surface: null\n }), [externalHandlers, play]);\n return enabled ? enabledResult : disabledResult;\n}\nexport { useRipple };"],"mappings":";;;;;;;;AAeA,MAAMe,UAAUD,UAAUE;AAI1B,MAAMC,uBAAuB;AAC7B,MAAMC,yBAAyB;AAC/B,MAAMC,4BAA4B;AAIlC,MAAMC,eAAef,MAAaM,OAAaW,OAAO;;;;;;;;AAStD,MAAMC,cAAc;;CAElBC,SAAS;;CAETC,UAAU;;CAEVC,YAAY;;CAEZC,iBAAiB;AACnB;AAWA,SAASa,QAAQC,OAAqB;CACpC,OAAOA,MAAMC,gBAAgB;AA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,QAAAL,MAAA;EACO6J,MAAA;GAAA9J,UAC1BH;GAAgBI;GAAA/B,SAEjB;EACX;EAACoC,EAAA,MAAAT;EAAAS,EAAA,MAAAL;EAAAK,EAAA,MAAAwJ;CAAA,OAAAA,MAAAxJ,EAAA;CAA6B,OACvBV,UAAAiK,gBAAAE;AAAwC;AAhVjD,SAAAjD,MAAAkD,WAAA;CA+LMvE,WAAWD,WAAShI,iBAAgByM,MAAO;AAAC"}
|
package/dist/i18n/index.js
CHANGED
|
@@ -24,6 +24,7 @@ function messagesFor(locale) {
|
|
|
24
24
|
copied: formatter.format("copied"),
|
|
25
25
|
copy: formatter.format("copy"),
|
|
26
26
|
copySelected: formatter.format("copySelected"),
|
|
27
|
+
dragHandle: formatter.format("dragHandle"),
|
|
27
28
|
enterTime: formatter.format("enterTime"),
|
|
28
29
|
loading: formatter.format("loading"),
|
|
29
30
|
loadingMore: formatter.format("loadingMore"),
|
package/dist/i18n/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["LocalizedStringDictionary","LocalizedStringFormatter","useLocale","MESSAGES","LibraryMessages","back","cancel","carousel","characterLimit","count","characterLimitReached","confirm","copied","copy","copySelected","enterTime","loading","loadingMore","nextSlide","noResults","previousSlide","selectTime","slide","slideLabel","index","dictionary","cache","Map","messagesFor","locale","cached","get","undefined","formatter","numbers","Intl","NumberFormat","rules","PluralRules","messages","format","rule","select","set","useMessages","$","_c","t0","t1","_c"],"sources":["../../src/i18n/index.ts"],"sourcesContent":["import {\n LocalizedStringDictionary,\n LocalizedStringFormatter,\n} from '@internationalized/string'\nimport { useLocale } from 'react-aria-components'\n\nimport { MESSAGES } from './messages'\n\n// The words the library writes itself, in the locale React Aria's\n// I18nProvider sets — the same locale every other name a control announces is\n// written in. Each one stands behind a prop that names it otherwise:\n// `pendingLabel`, a LoadMore's `label`, `copyLabel`, `copiedLabel` and\n// `selectedLabel`, `characterLimitLabel` and `characterLimitReachedLabel
|
|
1
|
+
{"version":3,"file":"index.js","names":["LocalizedStringDictionary","LocalizedStringFormatter","useLocale","MESSAGES","LibraryMessages","back","cancel","carousel","characterLimit","count","characterLimitReached","confirm","copied","copy","copySelected","dragHandle","enterTime","loading","loadingMore","nextSlide","noResults","previousSlide","selectTime","slide","slideLabel","index","dictionary","cache","Map","messagesFor","locale","cached","get","undefined","formatter","numbers","Intl","NumberFormat","rules","PluralRules","messages","format","rule","select","set","useMessages","$","_c","t0","t1","_c"],"sources":["../../src/i18n/index.ts"],"sourcesContent":["import {\n LocalizedStringDictionary,\n LocalizedStringFormatter,\n} from '@internationalized/string'\nimport { useLocale } from 'react-aria-components'\n\nimport { MESSAGES } from './messages'\n\n// The words the library writes itself, in the locale React Aria's\n// I18nProvider sets — the same locale every other name a control announces is\n// written in. Each one stands behind a prop that names it otherwise:\n// `pendingLabel`, a LoadMore's `label`, `copyLabel`, `copiedLabel` and\n// `selectedLabel`, a sheet handle's `aria-label`, `characterLimitLabel` and\n// `characterLimitReachedLabel`, the time picker's `cancelLabel`,\n// `confirmLabel`, `selectTimeLabel` and `enterTimeLabel`, and a collection's\n// `renderEmptyState` for its empty row.\n\ntype LibraryMessages = {\n /** What a search view's back button is called. */\n back: string\n /** The time picker's action that closes it and keeps the time it had. */\n cancel: string\n /** What a carousel calls itself, as its role description. */\n carousel: string\n /** The limit on a field's length, in words, for a count of characters. */\n characterLimit: (count: number) => string\n /** What a field announces once its length reaches its limit. */\n characterLimitReached: string\n /** The time picker's action that closes it and keeps the time picked. */\n confirm: string\n copied: string\n copy: string\n /**\n * What a copy field says when the clipboard refused it and the value has\n * been selected for the reader to copy themselves.\n */\n copySelected: string\n /**\n * What a bottom sheet's drag handle is called, while it is a button that\n * moves the sheet between its snap points.\n */\n dragHandle: string\n /** The time picker's headline while it takes a time typed. */\n enterTime: string\n loading: string\n loadingMore: string\n /** What a carousel's next button is called. */\n nextSlide: string\n /** What a collection says when filtering leaves nothing in it. */\n noResults: string\n /** What a carousel's previous button is called. */\n previousSlide: string\n /** The time picker's headline while it shows the dial. */\n selectTime: string\n /** What a carousel calls one of its slides, as its role description. */\n slide: string\n /** A slide's name: which of how many it is, as \"2 of 6\". */\n slideLabel: (index: number, count: number) => string\n}\n\nconst dictionary = new LocalizedStringDictionary(MESSAGES)\n\n// One set per locale an app renders in, built the first time a component asks\n// for it. Every string but the limit is fixed for its locale, so the set holds\n// them already formatted rather than formatting them on each render.\nconst cache = new Map<string, LibraryMessages>()\n\nfunction messagesFor(locale: string): LibraryMessages {\n const cached = cache.get(locale)\n if (cached !== undefined) {\n return cached\n }\n\n const formatter = new LocalizedStringFormatter(locale, dictionary)\n const numbers = new Intl.NumberFormat(locale)\n const rules = new Intl.PluralRules(locale)\n const messages = {\n back: formatter.format('back'),\n cancel: formatter.format('cancel'),\n carousel: formatter.format('carousel'),\n characterLimit: (count: number) =>\n formatter.format('characterLimit', {\n count: numbers.format(count),\n rule: rules.select(count),\n }),\n characterLimitReached: formatter.format('characterLimitReached'),\n confirm: formatter.format('confirm'),\n copied: formatter.format('copied'),\n copy: formatter.format('copy'),\n copySelected: formatter.format('copySelected'),\n dragHandle: formatter.format('dragHandle'),\n enterTime: formatter.format('enterTime'),\n loading: formatter.format('loading'),\n loadingMore: formatter.format('loadingMore'),\n nextSlide: formatter.format('nextSlide'),\n noResults: formatter.format('noResults'),\n previousSlide: formatter.format('previousSlide'),\n selectTime: formatter.format('selectTime'),\n slide: formatter.format('slide'),\n slideLabel: (index: number, count: number) =>\n formatter.format('slideLabel', {\n count: numbers.format(count),\n index: numbers.format(index),\n }),\n }\n cache.set(locale, messages)\n return messages\n}\n\n/** The library's own words, in the I18nProvider's locale. */\nfunction useMessages(): LibraryMessages {\n return messagesFor(useLocale().locale)\n}\n\nexport type { LibraryMessages }\n\nexport { messagesFor, useMessages }\n"],"mappings":";;;;;AA4DA,MAAM0B,aAAa,IAAI1B,0BAA0BG,QAAQ;AAKzD,MAAMwB,wBAAQ,IAAIC,IAA6B;AAE/C,SA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AAK,cAAA;CAAA,MAAAC,IAAAC,EAAA,CAAA;CACqB,MAAAC,KAAA9C,UAAU;CAAC,IAAA+C;CAAA,IAAAH,EAAA,OAAAE,GAAAlB,QAAA;EAAvBmB,KAAApB,YAAYmB,GAAWlB,MAAO;EAACgB,EAAA,KAAAE,GAAAlB;EAAAgB,EAAA,KAAAG;CAAA,OAAAA,KAAAH,EAAA;CAAA,OAA/BG;AAA+B"}
|
package/dist/i18n/messages.js
CHANGED
|
@@ -30,6 +30,7 @@ const MESSAGES = {
|
|
|
30
30
|
copied: "تم النسخ",
|
|
31
31
|
copy: "نسخ",
|
|
32
32
|
copySelected: "محدد للنسخ",
|
|
33
|
+
dragHandle: "مقبض السحب",
|
|
33
34
|
enterTime: "أدخل الوقت",
|
|
34
35
|
loading: "جارٍ التحميل",
|
|
35
36
|
loadingMore: "جارٍ تحميل المزيد",
|
|
@@ -53,6 +54,7 @@ const MESSAGES = {
|
|
|
53
54
|
copied: "Копирано",
|
|
54
55
|
copy: "Копиране",
|
|
55
56
|
copySelected: "Избрано за копиране",
|
|
57
|
+
dragHandle: "Манипулатор за плъзгане",
|
|
56
58
|
enterTime: "Въведете час",
|
|
57
59
|
loading: "Зареждане",
|
|
58
60
|
loadingMore: "Зареждане на още",
|
|
@@ -78,6 +80,7 @@ const MESSAGES = {
|
|
|
78
80
|
copied: "Zkopírováno",
|
|
79
81
|
copy: "Kopírovat",
|
|
80
82
|
copySelected: "Vybráno ke zkopírování",
|
|
83
|
+
dragHandle: "Úchyt pro přetažení",
|
|
81
84
|
enterTime: "Zadejte čas",
|
|
82
85
|
loading: "Načítání",
|
|
83
86
|
loadingMore: "Načítání dalších",
|
|
@@ -98,6 +101,7 @@ const MESSAGES = {
|
|
|
98
101
|
copied: "Kopieret",
|
|
99
102
|
copy: "Kopiér",
|
|
100
103
|
copySelected: "Markeret til kopiering",
|
|
104
|
+
dragHandle: "Trækhåndtag",
|
|
101
105
|
enterTime: "Angiv tidspunkt",
|
|
102
106
|
loading: "Indlæser",
|
|
103
107
|
loadingMore: "Indlæser flere",
|
|
@@ -118,6 +122,7 @@ const MESSAGES = {
|
|
|
118
122
|
copied: "Kopiert",
|
|
119
123
|
copy: "Kopieren",
|
|
120
124
|
copySelected: "Zum Kopieren markiert",
|
|
125
|
+
dragHandle: "Ziehpunkt",
|
|
121
126
|
enterTime: "Uhrzeit eingeben",
|
|
122
127
|
loading: "Wird geladen",
|
|
123
128
|
loadingMore: "Weitere werden geladen",
|
|
@@ -141,6 +146,7 @@ const MESSAGES = {
|
|
|
141
146
|
copied: "Αντιγράφηκε",
|
|
142
147
|
copy: "Αντιγραφή",
|
|
143
148
|
copySelected: "Επιλέχθηκε για αντιγραφή",
|
|
149
|
+
dragHandle: "Λαβή μεταφοράς",
|
|
144
150
|
enterTime: "Εισαγωγή ώρας",
|
|
145
151
|
loading: "Φόρτωση",
|
|
146
152
|
loadingMore: "Φόρτωση περισσότερων",
|
|
@@ -164,6 +170,7 @@ const MESSAGES = {
|
|
|
164
170
|
copied: "Copied",
|
|
165
171
|
copy: "Copy",
|
|
166
172
|
copySelected: "Selected to copy",
|
|
173
|
+
dragHandle: "Drag handle",
|
|
167
174
|
enterTime: "Enter time",
|
|
168
175
|
loading: "Loading",
|
|
169
176
|
loadingMore: "Loading more",
|
|
@@ -187,6 +194,7 @@ const MESSAGES = {
|
|
|
187
194
|
copied: "Copiado",
|
|
188
195
|
copy: "Copiar",
|
|
189
196
|
copySelected: "Seleccionado para copiar",
|
|
197
|
+
dragHandle: "Controlador de arrastre",
|
|
190
198
|
enterTime: "Introducir hora",
|
|
191
199
|
loading: "Cargando",
|
|
192
200
|
loadingMore: "Cargando más",
|
|
@@ -210,6 +218,7 @@ const MESSAGES = {
|
|
|
210
218
|
copied: "Kopeeritud",
|
|
211
219
|
copy: "Kopeeri",
|
|
212
220
|
copySelected: "Kopeerimiseks valitud",
|
|
221
|
+
dragHandle: "Lohistamispide",
|
|
213
222
|
enterTime: "Sisesta kellaaeg",
|
|
214
223
|
loading: "Laadimine",
|
|
215
224
|
loadingMore: "Laaditakse veel",
|
|
@@ -233,6 +242,7 @@ const MESSAGES = {
|
|
|
233
242
|
copied: "Kopioitu",
|
|
234
243
|
copy: "Kopioi",
|
|
235
244
|
copySelected: "Valittu kopioitavaksi",
|
|
245
|
+
dragHandle: "Vetokahva",
|
|
236
246
|
enterTime: "Anna aika",
|
|
237
247
|
loading: "Ladataan",
|
|
238
248
|
loadingMore: "Ladataan lisää",
|
|
@@ -256,6 +266,7 @@ const MESSAGES = {
|
|
|
256
266
|
copied: "Copié",
|
|
257
267
|
copy: "Copier",
|
|
258
268
|
copySelected: "Sélectionné pour la copie",
|
|
269
|
+
dragHandle: "Poignée de déplacement",
|
|
259
270
|
enterTime: "Saisir l’heure",
|
|
260
271
|
loading: "Chargement",
|
|
261
272
|
loadingMore: "Chargement de la suite",
|
|
@@ -280,6 +291,7 @@ const MESSAGES = {
|
|
|
280
291
|
copied: "הועתק",
|
|
281
292
|
copy: "העתק",
|
|
282
293
|
copySelected: "נבחר להעתקה",
|
|
294
|
+
dragHandle: "ידית גרירה",
|
|
283
295
|
enterTime: "הזנת שעה",
|
|
284
296
|
loading: "טוען",
|
|
285
297
|
loadingMore: "טוען עוד",
|
|
@@ -304,6 +316,7 @@ const MESSAGES = {
|
|
|
304
316
|
copied: "Kopirano",
|
|
305
317
|
copy: "Kopiraj",
|
|
306
318
|
copySelected: "Odabrano za kopiranje",
|
|
319
|
+
dragHandle: "Ručica za povlačenje",
|
|
307
320
|
enterTime: "Unesite vrijeme",
|
|
308
321
|
loading: "Učitavanje",
|
|
309
322
|
loadingMore: "Učitava se još",
|
|
@@ -324,6 +337,7 @@ const MESSAGES = {
|
|
|
324
337
|
copied: "Másolva",
|
|
325
338
|
copy: "Másolás",
|
|
326
339
|
copySelected: "Kijelölve másoláshoz",
|
|
340
|
+
dragHandle: "Húzófogantyú",
|
|
327
341
|
enterTime: "Időpont megadása",
|
|
328
342
|
loading: "Betöltés",
|
|
329
343
|
loadingMore: "Továbbiak betöltése",
|
|
@@ -347,6 +361,7 @@ const MESSAGES = {
|
|
|
347
361
|
copied: "Copiato",
|
|
348
362
|
copy: "Copia",
|
|
349
363
|
copySelected: "Selezionato per la copia",
|
|
364
|
+
dragHandle: "Maniglia di trascinamento",
|
|
350
365
|
enterTime: "Inserisci l’ora",
|
|
351
366
|
loading: "Caricamento",
|
|
352
367
|
loadingMore: "Caricamento di altri elementi",
|
|
@@ -367,6 +382,7 @@ const MESSAGES = {
|
|
|
367
382
|
copied: "コピーしました",
|
|
368
383
|
copy: "コピー",
|
|
369
384
|
copySelected: "コピー用に選択しました",
|
|
385
|
+
dragHandle: "ドラッグハンドル",
|
|
370
386
|
enterTime: "時刻を入力",
|
|
371
387
|
loading: "読み込み中",
|
|
372
388
|
loadingMore: "さらに読み込み中",
|
|
@@ -387,6 +403,7 @@ const MESSAGES = {
|
|
|
387
403
|
copied: "복사됨",
|
|
388
404
|
copy: "복사",
|
|
389
405
|
copySelected: "복사할 수 있게 선택됨",
|
|
406
|
+
dragHandle: "드래그 핸들",
|
|
390
407
|
enterTime: "시간 입력",
|
|
391
408
|
loading: "로드 중",
|
|
392
409
|
loadingMore: "더 로드하는 중",
|
|
@@ -412,6 +429,7 @@ const MESSAGES = {
|
|
|
412
429
|
copied: "Nukopijuota",
|
|
413
430
|
copy: "Kopijuoti",
|
|
414
431
|
copySelected: "Pažymėta kopijuoti",
|
|
432
|
+
dragHandle: "Vilkimo rankenėlė",
|
|
415
433
|
enterTime: "Įveskite laiką",
|
|
416
434
|
loading: "Įkeliama",
|
|
417
435
|
loadingMore: "Įkeliama daugiau",
|
|
@@ -436,6 +454,7 @@ const MESSAGES = {
|
|
|
436
454
|
copied: "Nokopēts",
|
|
437
455
|
copy: "Kopēt",
|
|
438
456
|
copySelected: "Atlasīts kopēšanai",
|
|
457
|
+
dragHandle: "Vilkšanas turis",
|
|
439
458
|
enterTime: "Ievadiet laiku",
|
|
440
459
|
loading: "Notiek ielāde",
|
|
441
460
|
loadingMore: "Notiek papildu ielāde",
|
|
@@ -456,6 +475,7 @@ const MESSAGES = {
|
|
|
456
475
|
copied: "Kopiert",
|
|
457
476
|
copy: "Kopier",
|
|
458
477
|
copySelected: "Merket for kopiering",
|
|
478
|
+
dragHandle: "Drahåndtak",
|
|
459
479
|
enterTime: "Angi klokkeslett",
|
|
460
480
|
loading: "Laster inn",
|
|
461
481
|
loadingMore: "Laster inn flere",
|
|
@@ -479,6 +499,7 @@ const MESSAGES = {
|
|
|
479
499
|
copied: "Gekopieerd",
|
|
480
500
|
copy: "Kopiëren",
|
|
481
501
|
copySelected: "Geselecteerd om te kopiëren",
|
|
502
|
+
dragHandle: "Sleepgreep",
|
|
482
503
|
enterTime: "Tijd invoeren",
|
|
483
504
|
loading: "Laden",
|
|
484
505
|
loadingMore: "Meer laden",
|
|
@@ -504,6 +525,7 @@ const MESSAGES = {
|
|
|
504
525
|
copied: "Skopiowano",
|
|
505
526
|
copy: "Kopiuj",
|
|
506
527
|
copySelected: "Zaznaczono do skopiowania",
|
|
528
|
+
dragHandle: "Uchwyt przeciągania",
|
|
507
529
|
enterTime: "Wpisz godzinę",
|
|
508
530
|
loading: "Ładowanie",
|
|
509
531
|
loadingMore: "Ładowanie kolejnych",
|
|
@@ -527,6 +549,7 @@ const MESSAGES = {
|
|
|
527
549
|
copied: "Copiado",
|
|
528
550
|
copy: "Copiar",
|
|
529
551
|
copySelected: "Selecionado para copiar",
|
|
552
|
+
dragHandle: "Alça de arrastar",
|
|
530
553
|
enterTime: "Digite o horário",
|
|
531
554
|
loading: "Carregando",
|
|
532
555
|
loadingMore: "Carregando mais",
|
|
@@ -550,6 +573,7 @@ const MESSAGES = {
|
|
|
550
573
|
copied: "Copiado",
|
|
551
574
|
copy: "Copiar",
|
|
552
575
|
copySelected: "Selecionado para copiar",
|
|
576
|
+
dragHandle: "Pega para arrastar",
|
|
553
577
|
enterTime: "Introduzir a hora",
|
|
554
578
|
loading: "A carregar",
|
|
555
579
|
loadingMore: "A carregar mais",
|
|
@@ -574,6 +598,7 @@ const MESSAGES = {
|
|
|
574
598
|
copied: "Copiat",
|
|
575
599
|
copy: "Copiați",
|
|
576
600
|
copySelected: "Selectat pentru copiere",
|
|
601
|
+
dragHandle: "Mâner de glisare",
|
|
577
602
|
enterTime: "Introduceți ora",
|
|
578
603
|
loading: "Se încarcă",
|
|
579
604
|
loadingMore: "Se încarcă mai multe",
|
|
@@ -599,6 +624,7 @@ const MESSAGES = {
|
|
|
599
624
|
copied: "Скопировано",
|
|
600
625
|
copy: "Копировать",
|
|
601
626
|
copySelected: "Выделено для копирования",
|
|
627
|
+
dragHandle: "Маркер перемещения",
|
|
602
628
|
enterTime: "Введите время",
|
|
603
629
|
loading: "Загрузка",
|
|
604
630
|
loadingMore: "Загрузка ещё",
|
|
@@ -624,6 +650,7 @@ const MESSAGES = {
|
|
|
624
650
|
copied: "Skopírované",
|
|
625
651
|
copy: "Kopírovať",
|
|
626
652
|
copySelected: "Vybraté na kopírovanie",
|
|
653
|
+
dragHandle: "Úchyt na presunutie",
|
|
627
654
|
enterTime: "Zadajte čas",
|
|
628
655
|
loading: "Načítava sa",
|
|
629
656
|
loadingMore: "Načítavajú sa ďalšie",
|
|
@@ -649,6 +676,7 @@ const MESSAGES = {
|
|
|
649
676
|
copied: "Kopirano",
|
|
650
677
|
copy: "Kopiraj",
|
|
651
678
|
copySelected: "Izbrano za kopiranje",
|
|
679
|
+
dragHandle: "Ročica za vlečenje",
|
|
652
680
|
enterTime: "Vnesite čas",
|
|
653
681
|
loading: "Nalaganje",
|
|
654
682
|
loadingMore: "Nalaganje več",
|
|
@@ -673,6 +701,7 @@ const MESSAGES = {
|
|
|
673
701
|
copied: "Kopirano",
|
|
674
702
|
copy: "Kopiraj",
|
|
675
703
|
copySelected: "Izabrano za kopiranje",
|
|
704
|
+
dragHandle: "Ručica za prevlačenje",
|
|
676
705
|
enterTime: "Unesite vreme",
|
|
677
706
|
loading: "Učitavanje",
|
|
678
707
|
loadingMore: "Učitavanje još",
|
|
@@ -693,6 +722,7 @@ const MESSAGES = {
|
|
|
693
722
|
copied: "Kopierat",
|
|
694
723
|
copy: "Kopiera",
|
|
695
724
|
copySelected: "Markerat för kopiering",
|
|
725
|
+
dragHandle: "Draghandtag",
|
|
696
726
|
enterTime: "Ange tid",
|
|
697
727
|
loading: "Läser in",
|
|
698
728
|
loadingMore: "Läser in fler",
|
|
@@ -713,6 +743,7 @@ const MESSAGES = {
|
|
|
713
743
|
copied: "Kopyalandı",
|
|
714
744
|
copy: "Kopyala",
|
|
715
745
|
copySelected: "Kopyalamak için seçildi",
|
|
746
|
+
dragHandle: "Sürükleme tutamacı",
|
|
716
747
|
enterTime: "Saati girin",
|
|
717
748
|
loading: "Yükleniyor",
|
|
718
749
|
loadingMore: "Daha fazlası yükleniyor",
|
|
@@ -738,6 +769,7 @@ const MESSAGES = {
|
|
|
738
769
|
copied: "Скопійовано",
|
|
739
770
|
copy: "Копіювати",
|
|
740
771
|
copySelected: "Виділено для копіювання",
|
|
772
|
+
dragHandle: "Маркер перетягування",
|
|
741
773
|
enterTime: "Введіть час",
|
|
742
774
|
loading: "Завантаження",
|
|
743
775
|
loadingMore: "Завантаження ще",
|
|
@@ -758,6 +790,7 @@ const MESSAGES = {
|
|
|
758
790
|
copied: "已复制",
|
|
759
791
|
copy: "复制",
|
|
760
792
|
copySelected: "已选中,可复制",
|
|
793
|
+
dragHandle: "拖动手柄",
|
|
761
794
|
enterTime: "输入时间",
|
|
762
795
|
loading: "正在加载",
|
|
763
796
|
loadingMore: "正在加载更多",
|
|
@@ -778,6 +811,7 @@ const MESSAGES = {
|
|
|
778
811
|
copied: "已複製",
|
|
779
812
|
copy: "複製",
|
|
780
813
|
copySelected: "已選取,可複製",
|
|
814
|
+
dragHandle: "拖曳控點",
|
|
781
815
|
enterTime: "輸入時間",
|
|
782
816
|
loading: "正在載入",
|
|
783
817
|
loadingMore: "正在載入更多",
|