react-native-gtkx 0.3.0-alpha.1 → 0.4.0-alpha.2
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 +1 -1
- package/dist/adw/index.d.ts +3 -2
- package/dist/adw/index.js +21 -4
- package/dist/adw/index.js.map +1 -1
- package/dist/adw/widgets.generated.d.ts +1 -1
- package/dist/adw/widgets.generated.js +2 -2
- package/dist/adw/widgets.generated.js.map +1 -1
- package/dist/animated/create-animated.d.ts +2 -0
- package/dist/animated/create-animated.js +2 -0
- package/dist/animated/create-animated.js.map +1 -1
- package/dist/animated/event.d.ts +15 -0
- package/dist/animated/event.js +80 -0
- package/dist/animated/event.js.map +1 -0
- package/dist/animated/index.d.ts +4 -0
- package/dist/animated/index.js +8 -0
- package/dist/animated/index.js.map +1 -1
- package/dist/animated/spring.d.ts +10 -0
- package/dist/animated/spring.js +20 -6
- package/dist/animated/spring.js.map +1 -1
- package/dist/animated/timing.d.ts +10 -0
- package/dist/animated/timing.js +21 -13
- package/dist/animated/timing.js.map +1 -1
- package/dist/apis/host.gtkx.js +70 -11
- package/dist/apis/host.gtkx.js.map +1 -1
- package/dist/common/navigation-stack.d.ts +6 -3
- package/dist/common/navigation-stack.js +8 -1
- package/dist/common/navigation-stack.js.map +1 -1
- package/dist/common/widget.js +2 -11
- package/dist/common/widget.js.map +1 -1
- package/dist/components/animated.d.ts +1 -0
- package/dist/components/animated.js +28 -4
- package/dist/components/animated.js.map +1 -1
- package/dist/components/app-registry.js +32 -8
- package/dist/components/app-registry.js.map +1 -1
- package/dist/components/request-animation-frame.d.ts +33 -0
- package/dist/components/request-animation-frame.js +83 -0
- package/dist/components/request-animation-frame.js.map +1 -0
- package/dist/components/scroll-view.js +60 -2
- package/dist/components/scroll-view.js.map +1 -1
- package/dist/components/virtualized-list.js +1 -4
- package/dist/components/virtualized-list.js.map +1 -1
- package/dist/dnd/autoscroll.d.ts +44 -0
- package/dist/dnd/autoscroll.js +176 -0
- package/dist/dnd/autoscroll.js.map +1 -0
- package/dist/dnd/grid-order.d.ts +45 -0
- package/dist/dnd/grid-order.js +151 -0
- package/dist/dnd/grid-order.js.map +1 -0
- package/dist/dnd/grid.d.ts +44 -0
- package/dist/dnd/grid.js +397 -0
- package/dist/dnd/grid.js.map +1 -0
- package/dist/dnd/gtk-controllers.d.ts +16 -2
- package/dist/dnd/gtk-controllers.js +23 -3
- package/dist/dnd/gtk-controllers.js.map +1 -1
- package/dist/dnd/index.d.ts +4 -2
- package/dist/dnd/index.js +9 -2
- package/dist/dnd/index.js.map +1 -1
- package/dist/dnd/order-state.d.ts +14 -0
- package/dist/dnd/order-state.js +55 -0
- package/dist/dnd/order-state.js.map +1 -0
- package/dist/dnd/order.d.ts +19 -0
- package/dist/dnd/order.js +19 -0
- package/dist/dnd/order.js.map +1 -1
- package/dist/dnd/sortable.d.ts +29 -4
- package/dist/dnd/sortable.js +308 -115
- package/dist/dnd/sortable.js.map +1 -1
- package/dist/dnd/types.d.ts +236 -14
- package/dist/dnd/types.js +30 -0
- package/dist/dnd/types.js.map +1 -1
- package/dist/gesture-handler-compat/attach-context.d.ts +29 -0
- package/dist/gesture-handler-compat/attach-context.js +90 -0
- package/dist/gesture-handler-compat/attach-context.js.map +1 -0
- package/dist/gesture-handler-compat/detector-runtime.d.ts +14 -3
- package/dist/gesture-handler-compat/detector-runtime.js +15 -5
- package/dist/gesture-handler-compat/detector-runtime.js.map +1 -1
- package/dist/gesture-handler-compat/detector.js +57 -2
- package/dist/gesture-handler-compat/detector.js.map +1 -1
- package/dist/gesture-handler-compat/gesture-state-manager.d.ts +5 -0
- package/dist/gesture-handler-compat/gesture-state-manager.js +77 -0
- package/dist/gesture-handler-compat/gesture-state-manager.js.map +1 -0
- package/dist/gesture-handler-compat/index.d.ts +2 -2
- package/dist/gesture-handler-compat/index.js +38 -33
- package/dist/gesture-handler-compat/index.js.map +1 -1
- package/dist/gesture-handler-compat/recognizer.d.ts +12 -1
- package/dist/gesture-handler-compat/recognizer.js +23 -9
- package/dist/gesture-handler-compat/recognizer.js.map +1 -1
- package/dist/gesture-handler-compat/tag-registry.d.ts +14 -0
- package/dist/gesture-handler-compat/tag-registry.js +19 -0
- package/dist/gesture-handler-compat/tag-registry.js.map +1 -0
- package/dist/globals/index.d.ts +47 -0
- package/dist/globals/index.js +181 -0
- package/dist/globals/index.js.map +1 -0
- package/dist/globals/install.d.ts +1 -0
- package/dist/globals/install.js +14 -0
- package/dist/globals/install.js.map +1 -0
- package/dist/gtkx/bridge/adw-namespace.d.ts +2 -0
- package/dist/gtkx/bridge/adw-namespace.js +26 -0
- package/dist/gtkx/bridge/adw-namespace.js.map +1 -0
- package/dist/gtkx/bridge/adw.d.ts +23 -0
- package/dist/gtkx/bridge/adw.js +93 -0
- package/dist/gtkx/bridge/adw.js.map +1 -0
- package/dist/gtkx/bridge/color-scheme-parse.d.ts +11 -0
- package/dist/gtkx/bridge/color-scheme-parse.js +42 -0
- package/dist/gtkx/bridge/color-scheme-parse.js.map +1 -0
- package/dist/gtkx/bridge/color-scheme-portal.d.ts +24 -0
- package/dist/gtkx/bridge/color-scheme-portal.js +172 -0
- package/dist/gtkx/bridge/color-scheme-portal.js.map +1 -0
- package/dist/gtkx/bridge/core.d.ts +25 -0
- package/dist/gtkx/bridge/core.js +69 -0
- package/dist/gtkx/bridge/core.js.map +1 -0
- package/dist/gtkx/bridge/drag-layer.d.ts +27 -0
- package/dist/gtkx/bridge/drag-layer.js +177 -0
- package/dist/gtkx/bridge/drag-layer.js.map +1 -0
- package/dist/gtkx/bridge/index.d.ts +1 -27
- package/dist/gtkx/bridge/index.js +12 -71
- package/dist/gtkx/bridge/index.js.map +1 -1
- package/dist/gtkx/bridge/widgets.generated.adw.d.ts +1 -0
- package/dist/gtkx/bridge/widgets.generated.adw.js +16 -0
- package/dist/gtkx/bridge/widgets.generated.adw.js.map +1 -0
- package/dist/gtkx/bridge/widgets.generated.d.ts +0 -1
- package/dist/gtkx/bridge/widgets.generated.js +3 -3
- package/dist/gtkx/bridge/widgets.generated.js.map +1 -1
- package/dist/index.js +20 -0
- package/dist/index.js.map +1 -1
- package/dist/mcp/data/generated.d.ts +41 -20
- package/dist/mcp/data/generated.js +46 -20
- package/dist/mcp/data/generated.js.map +1 -1
- package/dist/metro/index.d.ts +1 -0
- package/dist/metro/index.js +12 -0
- package/dist/metro/index.js.map +1 -1
- package/dist/navigation/sidebar.js +2 -45
- package/dist/navigation/sidebar.js.map +1 -1
- package/dist/reanimated-compat/animatable-value.d.ts +158 -0
- package/dist/reanimated-compat/animatable-value.js +316 -0
- package/dist/reanimated-compat/animatable-value.js.map +1 -0
- package/dist/reanimated-compat/animation.d.ts +34 -13
- package/dist/reanimated-compat/animation.js +97 -25
- package/dist/reanimated-compat/animation.js.map +1 -1
- package/dist/reanimated-compat/mutable.js +6 -6
- package/dist/reanimated-compat/mutable.js.map +1 -1
- package/dist/reanimated-compat/updater-animations.js +32 -12
- package/dist/reanimated-compat/updater-animations.js.map +1 -1
- package/dist/runner/host-dev.js +5 -1
- package/dist/runner/host-dev.js.map +1 -1
- package/dist/runner/host.js +9 -1
- package/dist/runner/host.js.map +1 -1
- package/dist/vite/index.js +130 -0
- package/dist/vite/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/gtkx/bridge/theme.d.ts +0 -4
- package/dist/gtkx/bridge/theme.js +0 -5
- package/dist/gtkx/bridge/theme.js.map +0 -1
|
@@ -5,6 +5,7 @@ import { drivenSizeRefusal, SIZE_PROPERTIES, } from "../style/animated-size";
|
|
|
5
5
|
import { DRIVEABLE_COLOR_PROPERTIES, driveableColorsToCss, } from "../style/imperative-css";
|
|
6
6
|
import { StyleSheet } from "../style/index";
|
|
7
7
|
import { createAnimated } from "../animated/index";
|
|
8
|
+
import { GestureAttachContext, mergeGestureHandlers, useGestureAttach, } from "../gesture-handler-compat/attach-context";
|
|
8
9
|
import { createWidgetCss, GtkBox, queueAllocate, setBoxPassthrough, setPointerTarget, setZIndex, } from "../gtkx/bridge/index";
|
|
9
10
|
import { useResponder } from "../responder/use-responder";
|
|
10
11
|
import { applyDrivenSize, releaseDrivenSize } from "./driven-size";
|
|
@@ -513,7 +514,16 @@ const AnimatedView = ({ style, children, onLayout, testID, ref, pointerEvents, a
|
|
|
513
514
|
onLayout,
|
|
514
515
|
});
|
|
515
516
|
useRnContainer(widgetRef, node);
|
|
516
|
-
|
|
517
|
+
// A gesture whose own GestureDetector could not reach a widget directly —
|
|
518
|
+
// its child was an opaque composite that renders this Animated.View but
|
|
519
|
+
// forwards neither a ref nor its own props onto it, react-native-sortables'
|
|
520
|
+
// ItemCell being the confirmed case (gesture-handler-compat/attach-context.ts)
|
|
521
|
+
// — claims this widget instead, through context rather than through the
|
|
522
|
+
// props ItemCell dropped.
|
|
523
|
+
const gestureAttach = useGestureAttach();
|
|
524
|
+
useResponder(widgetRef, gestureAttach
|
|
525
|
+
? mergeGestureHandlers(responderProps, gestureAttach.handlers)
|
|
526
|
+
: responderProps);
|
|
517
527
|
// `animatedProps` LAST, matching `createAnimatedComponent`'s
|
|
518
528
|
// `{ ...rest, ...animatedProps }` — a value produced by the updater is the
|
|
519
529
|
// live one and wins over the static prop. Only the picking mode is read
|
|
@@ -532,8 +542,18 @@ const AnimatedView = ({ style, children, onLayout, testID, ref, pointerEvents, a
|
|
|
532
542
|
setBoxPassthrough(widget, mode === "box-none");
|
|
533
543
|
}, [mode]);
|
|
534
544
|
useImperativeHandle(ref, () => createMeasureHandle(widgetRef, node), [node]);
|
|
545
|
+
// Registers this widget as the fallback gesture's handle — the same
|
|
546
|
+
// `assignHandle` its GestureDetector would have put directly on the ref, had
|
|
547
|
+
// its child forwarded one. A fresh handle rather than reusing the one above:
|
|
548
|
+
// `useImperativeHandle`'s factory only runs when `ref` itself is non-null,
|
|
549
|
+
// which is not the case here (ItemCell passes none), so there is nothing to
|
|
550
|
+
// reuse — and a second handle for the same widget is harmless, `measure.ts`
|
|
551
|
+
// keys by handle identity, not by widget.
|
|
552
|
+
useLayoutEffect(() => {
|
|
553
|
+
gestureAttach?.assignHandle(createMeasureHandle(widgetRef, node));
|
|
554
|
+
}, [gestureAttach, node]);
|
|
535
555
|
useAnimatedBinding(() => widgetRef.current, host, opacity, zIndex, slots, colors, sizes, node);
|
|
536
|
-
return (_jsx(GtkBox, { ref: widgetRef, name: testID, cssClasses: cssClass ? [cssClass] : [], children: _jsx(HostNodeContext.Provider, { value: { engine: host.engine, node, widgetRef }, children: children }) }));
|
|
556
|
+
return (_jsx(GtkBox, { ref: widgetRef, name: testID, cssClasses: cssClass ? [cssClass] : [], children: _jsx(HostNodeContext.Provider, { value: { engine: host.engine, node, widgetRef }, children: _jsx(GestureAttachContext.Provider, { value: null, children: children }) }) }));
|
|
537
557
|
};
|
|
538
558
|
const displayNameOf = (component) => {
|
|
539
559
|
if (typeof component === "string") {
|
|
@@ -649,8 +669,12 @@ export const createAnimatedComponent = (component) => {
|
|
|
649
669
|
* scrolled window through two layers that exist to hide it.
|
|
650
670
|
*
|
|
651
671
|
* Upstream's `Animated.FlatList` mostly exists so `onScroll` can be an
|
|
652
|
-
* `Animated.event`/`useAnimatedScrollHandler
|
|
653
|
-
*
|
|
672
|
+
* `Animated.event`/`useAnimatedScrollHandler` — both work on this platform
|
|
673
|
+
* (../animated/event.ts, ../reanimated-compat/scroll-handler.ts) — which is
|
|
674
|
+
* exactly why the refusal survives without taking that with it: either one
|
|
675
|
+
* still reaches the widget through the plain `FlatList`'s own `onScroll`
|
|
676
|
+
* (forwarded straight to the windowed core's `ScrollView`) or through
|
|
677
|
+
* `Animated.ScrollView`. So this throws where it is used, naming itself and
|
|
654
678
|
* naming the two things that do work.
|
|
655
679
|
*/
|
|
656
680
|
const AnimatedFlatList = () => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"animated.js","sourceRoot":"","sources":["../../src/components/animated.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,mBAAmB,EACnB,eAAe,EACf,MAAM,EACN,QAAQ,GAM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;;;GAcG;AACH,MAAM,gBAAgB,GAAG,GAAU,EAAE;IACnC,MAAM,IAAI,KAAK,CACb,oGAAoG;QAClG,mGAAmG;QACnG,4FAA4F;QAC5F,kFAAkF,CACrF,CAAA;AACH,CAAC,CAAA;AACD,gBAAgB,CAAC,WAAW,GAAG,mBAAmB,CAAA;AAElD;;;;;GAKG;AACH,MAAM,YAAY,GAAG,uBAAuB,CAAC,IAAI,CAAC,CAAA;AAClD,MAAM,aAAa,GAAG,uBAAuB,CAAC,KAAK,CAAC,CAAA;AACpD,MAAM,kBAAkB,GAAG,uBAAuB,CAAC,UAAU,CAAC,CAAA;AAE9D,MAAM,CAAC,MAAM,QAAQ,GAAG;IACtB,GAAG,GAAG;IACN,IAAI,EAAE,YAAY;IAClB,IAAI,EAAE,YAAY;IAClB,KAAK,EAAE,aAAa;IACpB,UAAU,EAAE,kBAAkB;IAC9B,0EAA0E;IAC1E,0EAA0E;IAC1E,uEAAuE;IACvE,eAAe;IACf,QAAQ,EAAE,gBAA6D;IACvE,uBAAuB;CACxB,CAAA;AAED,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA","sourcesContent":["import {\n useImperativeHandle,\n useLayoutEffect,\n useRef,\n useState,\n type ComponentProps,\n type ComponentType,\n type ElementType,\n type ReactNode,\n type Ref,\n} from \"react\"\nimport type { DrivenSize } from \"../layout/driven-size\"\nimport {\n INSET_PROPERTIES,\n insetRefusalReason,\n insetTranslation,\n type InsetProperty,\n} from \"../style/absolute-insets\"\nimport {\n drivenSizeRefusal,\n SIZE_PROPERTIES,\n type SizeProperty,\n} from \"../style/animated-size\"\nimport {\n DRIVEABLE_COLOR_PROPERTIES,\n driveableColorsToCss,\n type DriveableColorProperty,\n} from \"../style/imperative-css\"\nimport { StyleSheet } from \"../style/index\"\nimport { createAnimated } from \"../animated/index\"\nimport type {\n DimensionValue,\n FlatStyle,\n PointerEventsValue,\n StyleProp,\n TransformPart,\n} from \"../contracts\"\nimport {\n createWidgetCss,\n GtkBox,\n queueAllocate,\n setBoxPassthrough,\n setPointerTarget,\n setZIndex,\n type Gtk,\n type WidgetCss,\n} from \"../gtkx/bridge/index\"\nimport type { ResponderProps } from \"../responder/types\"\nimport { useResponder } from \"../responder/use-responder\"\nimport { applyDrivenSize, releaseDrivenSize } from \"./driven-size\"\nimport { glibScheduler } from \"./frame-scheduler\"\nimport { HostNodeContext, useHostNode, type HostNode } from \"./host-node\"\nimport { Image } from \"./image\"\nimport {\n createMeasureHandle,\n widgetForHandle,\n type MeasureHandle,\n} from \"./measure\"\nimport { setStoredTransform } from \"./rect-store\"\nimport { ScrollView } from \"./scroll-view\"\nimport { Text } from \"./text\"\nimport {\n nodeForWidget,\n useLayoutChild,\n useRnContainer,\n type LayoutEvent,\n} from \"./use-layout-child\"\n\nconst api = createAnimated(glibScheduler)\n\n// Interpolations produce suffixed strings (\"45deg\"), so a driven value is\n// not necessarily a number — `rotate` is normally an interpolate() with a\n// deg outputRange.\ntype AnimatedValue = number | string\n\ntype AnimatedNode = {\n addListener(callback: (state: { value: AnimatedValue }) => void): string\n removeListener(id: string): void\n __getValue(): AnimatedValue\n}\n\nconst isAnimatedNode = (value: unknown): value is AnimatedNode =>\n typeof value === \"object\" &&\n value !== null &&\n typeof (value as AnimatedNode).addListener === \"function\" &&\n typeof (value as AnimatedNode).__getValue === \"function\"\n\ntype AnimatedTransformPart = { [key: string]: number | string | AnimatedNode }\n\n// One entry of the style's transform array, kept in source order. The array\n// order IS the composition order in RN, so an animated entry updates its own\n// slot in place instead of being lifted out of the list — that is what makes\n// [{rotate}, {translateX}] compose differently from the reverse, as in RN.\ntype TransformSlot = {\n key: string\n node: AnimatedNode | null\n value: AnimatedValue\n // Set only on a slot DERIVED from an animated inset (`top`/`left`/`right`/\n // `bottom` on a node whose own position is absolute). The slot then carries\n // `sign * (inset - base)`, where `base` is the inset value Yoga was given at\n // the last React commit — see splitAnimated.\n inset?: { base: number; sign: 1 | -1 }\n}\n\nconst toNumber = (value: AnimatedValue): number =>\n typeof value === \"number\" ? value : Number.parseFloat(value)\n\n// What a slot actually writes into the transform array. An ordinary slot\n// writes its value; a derived inset slot writes its offset from the committed\n// base, which is what makes an absolute `top` a translation.\nconst slotValue = (\n slot: TransformSlot,\n value: AnimatedValue,\n): AnimatedValue => {\n if (!slot.inset) {\n return value\n }\n const numeric = toNumber(value)\n // A non-numeric inset (a percentage produced mid-animation) has no offset\n // from a point base. Holding the last position beats jumping to NaN, and\n // the leaf never becomes driveable in the first place unless it starts\n // numeric — see style/absolute-insets.ts and reanimated-compat/style.ts.\n return Number.isFinite(numeric)\n ? slot.inset.sign * (numeric - slot.inset.base)\n : 0\n}\n\n// Stable per-node identity for the effect's dependency key: Animated nodes\n// are objects, and the bindings must be rebuilt when the node behind a slot\n// changes — not on every render that rebuilds an equal-looking array.\nlet nextNodeId = 1\nconst nodeIds = new WeakMap<object, number>()\nconst nodeId = (value: object): number => {\n let id = nodeIds.get(value)\n if (id === undefined) {\n id = nextNodeId++\n nodeIds.set(value, id)\n }\n return id\n}\n\n// Omit, not plain intersection: intersecting would AND the animated transform\n// with FlatStyle's numeric one, rejecting Animated.Value entries.\nexport type AnimatedViewStyle = Omit<\n FlatStyle,\n | \"opacity\"\n | \"zIndex\"\n | \"transform\"\n | DriveableColorProperty\n | InsetProperty\n | SizeProperty\n> & {\n opacity?: number | AnimatedNode\n zIndex?: number | AnimatedNode\n transform?: (TransformPart | AnimatedTransformPart)[]\n} & Partial<Record<DriveableColorProperty, string | AnimatedNode>> &\n Partial<Record<InsetProperty, DimensionValue | AnimatedNode>> &\n Partial<Record<SizeProperty, DimensionValue | AnimatedNode>>\n\n/** What every animated component accepts as `style`, arrays and falsy included. */\nexport type AnimatedStyleProp =\n AnimatedViewStyle | readonly (AnimatedViewStyle | false | null | undefined)[]\n\n// Animated.View is where a PanResponder drag lands in idiomatic RN — the\n// dragged box is animated by definition — so it takes the responder props\n// exactly as View does.\nexport type AnimatedViewProps = ResponderProps & {\n style?: AnimatedStyleProp\n children?: ReactNode\n onLayout?: (event: LayoutEvent) => void\n testID?: string\n // Reanimated's `Animated.View` IS `createAnimatedComponent(View)` upstream,\n // so it takes every View prop — `pointerEvents` included. Dropping it made\n // an invisible full-screen overlay swallow every press underneath it, which\n // is exactly how `react-native-drawer-layout`'s `Overlay` is built\n // (opacity 0 plus `pointerEvents: \"none\"`): the drawer's own edge swipe\n // worked and NOTHING inside the app did.\n pointerEvents?: PointerEventsValue\n // The other half of the same parity gap. `useAnimatedProps` returns an\n // object of current values, and `createAnimatedComponent` already spreads\n // it — but `Animated.View` is written by hand here rather than produced by\n // that factory, so it has to spread it too. Upstream's `Overlay` sets\n // `pointerEvents` through THIS channel, not as a static prop.\n animatedProps?: Record<string, unknown>\n // Same handle a plain View exposes. RN gives every host component the\n // imperative geometry methods, and Reanimated's `useAnimatedRef` +\n // `measure()` is written against an Animated.View having them — without\n // this, measuring an animated view means wrapping it in a plain one.\n ref?: Ref<MeasureHandle>\n}\n\n// One driven colour property. Unlike transforms these do not compose, so each\n// is simply the latest value of its own declaration.\ntype ColorSlot = {\n property: DriveableColorProperty\n node: AnimatedNode\n}\n\n// One driven size. `base` is the value Yoga was given at the last React\n// commit, which is what the rebase moves and what the committed rect the\n// override sits on top of was laid out at.\ntype SizeSlot = {\n property: SizeProperty\n node: AnimatedNode\n base: number\n}\n\n// One warning per inset property per session, like every other channel here.\nconst warnedInsets = new Set<string>()\n\nconst insetTranslationOf = (property: InsetProperty): string =>\n property === \"top\" || property === \"bottom\" ? \"translateY\" : \"translateX\"\n\nconst warnInsetNotTranslatable = (\n property: InsetProperty,\n reason: string | null,\n): void => {\n if (warnedInsets.has(property)) {\n return\n }\n warnedInsets.add(property)\n const isProduction =\n typeof process !== \"undefined\" && process.env.NODE_ENV === \"production\"\n if (isProduction) {\n return\n }\n const spec = insetTranslationOf(property)\n console.warn(\n `react-native-gtkx: an animated \\`${property}\\` cannot be driven here. ` +\n (reason\n ? `The node IS absolutely positioned, but ${reason}, so there is no translation that reproduces it. `\n : \"`top`/`left`/`right`/`bottom` are driven at frame rate only on a node whose own `position` is \" +\n '\"absolute\", where moving it is exactly a translation and touches no sibling. Anything else needs a ' +\n \"Yoga pass over the container plus its commit walk, which costs what the CONTAINER costs (71 µs at \" +\n \"five children, 509 µs at three hundred) against a transform's 0.12 µs. \") +\n `Animate \\`transform: [{ ${spec}: … }]\\` instead. ` +\n \"The value is still applied on the next React render. See docs/api.md.\",\n )\n}\n\n/** @internal Test seam: the warning is once per property per session by design. */\nexport const resetAnimatedInsetWarnings = (): void => {\n warnedInsets.clear()\n}\n\n// Same policy for sizes: once per property per session, and the reason is the\n// actionable part — the rule refuses for one of eight named reasons and each\n// of them has a different fix.\nconst warnedSizes = new Set<string>()\n\nconst warnSizeNotDriveable = (property: SizeProperty, reason: string): void => {\n if (warnedSizes.has(property)) {\n return\n }\n warnedSizes.add(property)\n const isProduction =\n typeof process !== \"undefined\" && process.env.NODE_ENV === \"production\"\n if (isProduction) {\n return\n }\n const scale = property === \"width\" ? \"scaleX\" : \"scaleY\"\n console.warn(\n `react-native-gtkx: an animated \\`${property}\\` cannot be driven here, because ${reason}. ` +\n `\\`width\\`/\\`height\\` run at frame rate only where the change stops at the node that owns it — the ` +\n \"node's own subtree is then re-laid-out pinned to the driven value (7.1 µs for a leaf, 21.7 µs with \" +\n \"wrapped text, the same at five children and at three hundred) and one allocation puts it on screen. \" +\n \"Anything else needs a Yoga pass over the container plus its commit walk, which costs what the \" +\n \"CONTAINER costs: 71 µs at five children, 509 µs at three hundred, against a transform's 0.6 µs. \" +\n `The closest transform is \\`transform: [{ ${scale}: … }]\\`, but it is NOT the same thing — a scale ` +\n \"grows about the view's centre, so the box moves as it grows, and it scales the content with the box \" +\n \"instead of re-laying it out, so text stretches rather than re-wrapping. \" +\n \"The new value is applied on the next React render either way. See docs/api.md.\",\n )\n}\n\n/** @internal Test seam: the warning is once per property per session by design. */\nexport const resetAnimatedSizeWarnings = (): void => {\n warnedSizes.clear()\n}\n\nconst splitAnimated = (\n style: AnimatedStyleProp | false | null | undefined,\n): {\n staticStyle: StyleProp\n opacity: AnimatedNode | null\n zIndex: AnimatedNode | null\n slots: TransformSlot[]\n colors: ColorSlot[]\n sizes: SizeSlot[]\n} => {\n const flat: Record<string, unknown> = {}\n const collect = (\n entry: AnimatedStyleProp | false | null | undefined,\n ): void => {\n if (!entry) {\n return\n }\n if (Array.isArray(entry)) {\n entry.forEach(collect)\n return\n }\n Object.assign(flat, entry)\n }\n collect(style)\n\n let opacity: AnimatedNode | null = null\n let zIndex: AnimatedNode | null = null\n const slots: TransformSlot[] = []\n const colors: ColorSlot[] = []\n const sizes: SizeSlot[] = []\n\n if (isAnimatedNode(flat.opacity)) {\n opacity = flat.opacity\n delete flat.opacity\n }\n // `zIndex` is in `useSortable`'s style object on every frame and changes\n // value about twice per drag. It takes the same door opacity does — one\n // widget-level write, no Yoga, no CSS — so there is nothing to refuse.\n if (isAnimatedNode(flat.zIndex)) {\n zIndex = flat.zIndex\n delete flat.zIndex\n }\n for (const property of DRIVEABLE_COLOR_PROPERTIES) {\n const value = flat[property]\n if (isAnimatedNode(value)) {\n colors.push({ property, node: value })\n // Removed from the static style so the shared class registry never sees\n // a per-frame value: its memoisation stays keyed on styles that change\n // when React renders, which is the only thing it is good at.\n delete flat[property]\n }\n }\n if (Array.isArray(flat.transform)) {\n for (const part of flat.transform as AnimatedTransformPart[]) {\n const key = Object.keys(part)[0]\n if (key === undefined) {\n continue\n }\n const value = part[key]\n slots.push(\n isAnimatedNode(value)\n ? { key, node: value, value: value.__getValue() }\n : { key, node: null, value: value as AnimatedValue },\n )\n }\n // The whole array is owned here from now on, static entries included:\n // leaving them in the style would make useLayoutChild write the same\n // rect-store slot from the other side, and the two would overwrite\n // each other every render.\n delete flat.transform\n }\n\n // Slice 2b: an animated inset on an absolutely positioned node becomes a\n // derived translate. It is the one layout property with an exact transform\n // equivalent, because an out-of-flow node's position affects nothing but\n // where it is drawn — see src/style/absolute-insets.ts for the measured\n // rule and for the configurations where the equivalence does NOT hold.\n //\n // Three things happen here at once, and all three are load-bearing:\n //\n // - THE BASE. The inset's current value is written back into the static\n // style as a plain number, so Yoga is given a real position and the\n // committed rect the parent's allocate reads is the base the offset is\n // measured from. Nothing about the shadow tree changes.\n // - THE REBASE. This runs on every render, so when React commits a layout\n // with a different inset, the base moves and the offset is recomputed\n // against it in the SAME commit — the Yoga write and the offset write\n // are both layout effects, and the engine's flush is a microtask, so GTK\n // never gets a frame in between and there is no jump.\n // - THE ORDER. Derived slots go FIRST. The array's leftmost entry is the\n // outermost matrix (style/transform.ts), so a derived translate is\n // applied to the point LAST — it moves the already-rotated, already-\n // scaled box in the parent's coordinates, exactly as a layout position\n // does. Appending instead would put the user's scale on the OUTSIDE and\n // multiply the offset by it.\n const insetSlots: TransformSlot[] = []\n for (const property of INSET_PROPERTIES) {\n const value = flat[property]\n if (!isAnimatedNode(value)) {\n continue\n }\n const base = toNumber(value.__getValue())\n const translation = Number.isFinite(base)\n ? insetTranslation(flat, property)\n : null\n if (!translation) {\n // Not an equivalence. Resolve to the current value so the static style\n // is at least correct on this render, and keep slice 2's refusal loud.\n flat[property] = Number.isFinite(base) ? base : undefined\n warnInsetNotTranslatable(property, insetRefusalReason(flat, property))\n continue\n }\n flat[property] = base\n insetSlots.push({\n key: translation.transform,\n node: value,\n value: 0,\n inset: { base, sign: translation.sign },\n })\n }\n\n // Slice 3: an animated `width`/`height` where the change is confined to the\n // node that owns it. Unlike an inset this is NOT re-expressed as a\n // transform — there is no transform that reproduces a size change, which\n // docs/research/animated-size.md §6 measured rather than assumed — so the\n // slot carries the property itself and the view layer drives it through a\n // pinned pass over the node's own subtree.\n //\n // THE REBASE, exactly as above and for the same reason: the driven value is\n // written back into the static style as a plain number, so Yoga is given the\n // size the animation is currently showing and the committed rect the\n // override sits on catches up in the SAME commit. Both writes are layout\n // effects and the engine's flush is a microtask, so GTK never gets a frame\n // in between.\n //\n // WHETHER it can be driven is not decided here. The answer depends on the\n // CONTAINER's `flexDirection`, its `alignItems` and where its own size comes\n // from, none of which are in this style object or in this component's props\n // — it is asked of the layout tree in useAnimatedBinding, which is the only\n // place the tree exists.\n for (const property of SIZE_PROPERTIES) {\n const value = flat[property]\n if (!isAnimatedNode(value)) {\n continue\n }\n const base = toNumber(value.__getValue())\n if (!Number.isFinite(base)) {\n // A percentage produced mid-animation has no point base to lay out at.\n // Dropped rather than driven, and the leaf never becomes driveable in\n // the first place unless it starts numeric — reanimated-compat/style.ts.\n flat[property] = undefined\n continue\n }\n flat[property] = base\n sizes.push({ property, node: value, base })\n }\n\n return {\n staticStyle: flat as StyleProp,\n opacity,\n zIndex,\n slots: insetSlots.length > 0 ? [...insetSlots, ...slots] : slots,\n colors,\n sizes,\n }\n}\n\n/**\n * The imperative write path, and the whole of it.\n *\n * Animated values bypass React entirely: listeners write straight to the\n * widget (opacity), to the rect store (the transform applied by the parent's\n * allocate) on top of the engine-committed base rect, and to a CSS provider\n * private to the widget (colours). Animation frames never touch Yoga, and\n * never touch the shared stylesheet.\n *\n * Nothing here is View-specific, which is why it is a hook rather than a\n * paragraph inside `AnimatedView`: it needs the CHILD's widget (for\n * `setOpacity` and the rect store) and its PARENT's (for `queueAllocate`),\n * and any component that can produce those two can be animated. The child is\n * reached through a getter rather than a ref because a wrapper does not own\n * the widget — it reads it back out of whatever handle the wrapped component\n * exposed, which may only exist after that component's own layout effects.\n */\nconst useAnimatedBinding = (\n getWidget: () => Gtk.Widget | null,\n host: HostNode,\n opacity: AnimatedNode | null,\n zIndex: AnimatedNode | null,\n slots: TransformSlot[],\n colors: ColorSlot[],\n sizes: SizeSlot[],\n // Anything else that must force a rebind. `AnimatedView` passes its layout\n // node; the generic wrapper has nothing to add.\n rebindKey?: unknown,\n): void => {\n // The effect reads the slots of the render that (re)armed it; the values\n // inside are then owned by the listeners.\n const slotsRef = useRef<TransformSlot[]>(slots)\n slotsRef.current = slots\n const colorsRef = useRef<ColorSlot[]>(colors)\n colorsRef.current = colors\n const sizesRef = useRef<SizeSlot[]>(sizes)\n sizesRef.current = sizes\n const getWidgetRef = useRef(getWidget)\n getWidgetRef.current = getWidget\n const hostRef = useRef(host)\n hostRef.current = host\n const parentWidgetRef = host.widgetRef\n\n // Rebind on a change of shape (which transforms, in which order), of the\n // node behind an animated entry, or of a static entry's value — not on\n // every render that rebuilds an equal-looking array.\n //\n // A derived inset slot adds its BASE to the key, and that is what makes the\n // rebase happen: React committing a new `top` moves the base, which re-arms\n // this effect in the same commit that gives Yoga the new position.\n const bindingKey =\n (opacity ? `opacity#${nodeId(opacity)}` : \"\") +\n (zIndex ? `zIndex#${nodeId(zIndex)}` : \"\") +\n slots\n .map((slot) => {\n const inset = slot.inset ? `~${slot.inset.sign}:${slot.inset.base}` : \"\"\n return slot.node\n ? `|${slot.key}#${nodeId(slot.node)}${inset}`\n : `|${slot.key}=${String(slot.value)}`\n })\n .join(\"\") +\n colors.map((slot) => `|${slot.property}#${nodeId(slot.node)}`).join(\"\") +\n // The base is in the key for the same reason a derived inset's is: React\n // committing a new size moves it, and re-arming here is what hands the\n // override back to the engine in the same commit that gives Yoga the new\n // value.\n sizes\n .map((slot) => `|${slot.property}#${nodeId(slot.node)}~${slot.base}`)\n .join(\"\")\n\n useLayoutEffect(() => {\n const widget = getWidgetRef.current()\n if (!widget) {\n return\n }\n // Captured for the CLEANUP only: by then the ref may already have been\n // detached, and the container to re-allocate is the one this binding was\n // made against. Every live write below re-reads the ref instead.\n const boundParentWidget = parentWidgetRef.current\n\n // The live transform array, mutated in place: an Animated write must\n // stay one numeric store plus one queued allocation — no React render,\n // no Yoga pass, no allocation per frame beyond the composed matrix.\n //\n // RN transform semantics: this is paint-only. The result goes to the\n // rect store unclamped — the parent's measure ignores children, so a\n // transformed child draws past the boundary over its neighbors without\n // moving a single ancestor.\n const parts = slotsRef.current.map(\n (slot) =>\n ({\n [slot.key]: slot.node\n ? slotValue(slot, slot.node.__getValue())\n : slot.value,\n }) as Record<string, AnimatedValue>,\n )\n\n const flush = (): void => {\n const widget = getWidgetRef.current()\n if (!widget) {\n return\n }\n setStoredTransform(widget, parts as unknown as TransformPart[])\n const parentWidget = parentWidgetRef.current\n if (parentWidget) {\n queueAllocate(parentWidget)\n }\n }\n\n const subscriptions: { node: AnimatedNode; id: string }[] = []\n slotsRef.current.forEach((slot, index) => {\n if (!slot.node) {\n return\n }\n const part = parts[index]!\n subscriptions.push({\n node: slot.node,\n id: slot.node.addListener(({ value }) => {\n part[slot.key] = slotValue(slot, value)\n flush()\n }),\n })\n })\n\n if (opacity) {\n const applyOpacity = (value: AnimatedValue): void => {\n const numeric = typeof value === \"number\" ? value : parseFloat(value)\n getWidgetRef.current()?.setOpacity(Math.min(1, Math.max(0, numeric)))\n }\n subscriptions.push({\n node: opacity,\n id: opacity.addListener(({ value }) => {\n applyOpacity(value)\n }),\n })\n applyOpacity(opacity.__getValue())\n }\n\n // The container's paint and pick order (gtkx/bridge/view-box.ts). The\n // write drops the container's cached order and queues a redraw; nothing\n // is re-measured and nothing is re-allocated, because zIndex changes\n // neither.\n if (zIndex) {\n const applyZIndex = (value: AnimatedValue): void => {\n const widget = getWidgetRef.current()\n if (!widget) {\n return\n }\n const numeric = typeof value === \"number\" ? value : parseFloat(value)\n setZIndex(widget, Number.isFinite(numeric) ? Math.round(numeric) : 0)\n }\n subscriptions.push({\n node: zIndex,\n id: zIndex.addListener(({ value }) => {\n applyZIndex(value)\n }),\n })\n applyZIndex(zIndex.__getValue())\n }\n\n // Colours take the other imperative door: a CSS provider private to this\n // widget, replaced in place. Deliberately NOT the shared class registry —\n // that one memoises by CSS text, so a driven colour would mint a class per\n // frame into a document GTK re-parses whole and that is never pruned\n // (docs/research/animated-colors.md). All driven colours share one\n // provider and one declaration block: two properties animating together\n // are one write, not two.\n const colorSlots = colorsRef.current\n let widgetCss: WidgetCss | null = null\n if (colorSlots.length > 0) {\n const css = createWidgetCss(widget)\n widgetCss = css\n const values: Record<string, unknown> = {}\n const writeColors = (): void => {\n css.set(driveableColorsToCss(values))\n }\n for (const slot of colorSlots) {\n values[slot.property] = slot.node.__getValue()\n subscriptions.push({\n node: slot.node,\n id: slot.node.addListener(({ value }) => {\n values[slot.property] = value\n writeColors()\n }),\n })\n }\n writeColors()\n }\n\n // Sizes take the third door, and it is the only one that runs Yoga.\n //\n // Nothing is written at BIND time on purpose: the render that armed this\n // effect put the current value into the static style, so the engine is\n // already committing exactly this size and an override would be a copy of\n // it. The first write happens when a frame asks for something else.\n const sizeSlots = sizesRef.current\n const drivenWidgets: Gtk.Widget[] = []\n if (sizeSlots.length > 0) {\n const layoutNode = nodeForWidget(widget)\n const driven: DrivenSize = {}\n const driveable = new Set<SizeProperty>()\n let decided = false\n // Deferred to the first frame that actually asks for a new size, and\n // that is not laziness: the rule is asked of the CONTAINER's Yoga node,\n // and on a first mount a container's own layout effects run AFTER its\n // children's — so at bind time the container may still be carrying the\n // defaults rather than its style. By the first frame the tree has been\n // laid out at least once and the answer is the real one.\n const decide = (): void => {\n decided = true\n if (!layoutNode) {\n return\n }\n const context = {\n node: layoutNode,\n rootIsContentSized: hostRef.current.engine.contentSized,\n }\n for (const slot of sizeSlots) {\n const reason = drivenSizeRefusal(context, slot.property)\n if (reason === null) {\n driveable.add(slot.property)\n } else {\n warnSizeNotDriveable(slot.property, reason)\n }\n }\n }\n for (const slot of sizeSlots) {\n subscriptions.push({\n node: slot.node,\n id: slot.node.addListener(({ value }) => {\n const numeric = toNumber(value)\n if (!Number.isFinite(numeric)) {\n return\n }\n if (!decided) {\n decide()\n }\n if (!driveable.has(slot.property) || !layoutNode) {\n return\n }\n driven[slot.property] = numeric\n const target = getWidgetRef.current()\n if (target) {\n applyDrivenSize(\n layoutNode,\n target,\n parentWidgetRef.current,\n driven,\n drivenWidgets,\n )\n }\n }),\n })\n }\n }\n\n flush()\n\n return () => {\n for (const { node: animated, id } of subscriptions) {\n animated.removeListener(id)\n }\n widgetCss?.dispose()\n // Every widget this binding was driving goes back to the rect the\n // engine committed. On a REBASE that is the whole point: the render\n // that re-armed this effect handed Yoga the size the animation is\n // showing, so the committed rect is about to become the driven one and\n // holding an override on top of it would be holding a stale copy.\n if (drivenWidgets.length > 0) {\n releaseDrivenSize(drivenWidgets)\n if (boundParentWidget) {\n queueAllocate(boundParentWidget)\n }\n }\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [bindingKey, rebindKey])\n}\n\nconst AnimatedView = ({\n style,\n children,\n onLayout,\n testID,\n ref,\n pointerEvents,\n animatedProps,\n ...responderProps\n}: AnimatedViewProps) => {\n const widgetRef = useRef<Gtk.Box | null>(null)\n const { staticStyle, opacity, zIndex, slots, colors, sizes } =\n splitAnimated(style)\n\n const { host, node, cssClass } = useLayoutChild(widgetRef, {\n style: staticStyle,\n onLayout,\n })\n useRnContainer(widgetRef, node)\n useResponder(widgetRef, responderProps)\n\n // `animatedProps` LAST, matching `createAnimatedComponent`'s\n // `{ ...rest, ...animatedProps }` — a value produced by the updater is the\n // live one and wins over the static prop. Only the picking mode is read\n // here: a numeric animated prop has no meaning on a View, and the SVG\n // shapes that do take them go through `createAnimatedComponent` already.\n const mode: PointerEventsValue =\n (animatedProps?.pointerEvents as PointerEventsValue | undefined) ??\n pointerEvents ??\n StyleSheet.flatten(staticStyle)?.pointerEvents ??\n \"auto\"\n\n useLayoutEffect(() => {\n const widget = widgetRef.current\n if (!widget) {\n return\n }\n setPointerTarget(widget, mode !== \"none\")\n setBoxPassthrough(widget, mode === \"box-none\")\n }, [mode])\n\n useImperativeHandle(ref, () => createMeasureHandle(widgetRef, node), [node])\n\n useAnimatedBinding(\n () => widgetRef.current,\n host,\n opacity,\n zIndex,\n slots,\n colors,\n sizes,\n node,\n )\n\n return (\n <GtkBox\n ref={widgetRef}\n name={testID}\n cssClasses={cssClass ? [cssClass] : []}\n >\n <HostNodeContext.Provider\n value={{ engine: host.engine, node, widgetRef }}\n >\n {children}\n </HostNodeContext.Provider>\n </GtkBox>\n )\n}\n\n// --- createAnimatedComponent ---------------------------------------------\n\n/** Node-backed props from `useAnimatedProps`, spread onto the wrapped component. */\nexport type AnimatedPropsProp = Record<string, unknown>\n\n/** The props an animated wrapper adds on top of the component's own. */\nexport type AnimatedComponentExtraProps = {\n style?: AnimatedStyleProp\n animatedProps?: AnimatedPropsProp\n}\n\n// `Partial`, as upstream's own `AnimatedProps<Props>` effectively is: a prop\n// supplied through `animatedProps` is invisible to the type system here, so\n// insisting on the wrapped component's required props would reject exactly\n// the call the feature exists for (`<AnimatedCircle animatedProps={{ r }} />`).\nexport type AnimatedComponent<C extends ElementType> = (\n props: Partial<Omit<ComponentProps<C>, \"style\">> &\n AnimatedComponentExtraProps,\n) => ReactNode\n\nconst displayNameOf = (component: unknown): string => {\n if (typeof component === \"string\") {\n return component\n }\n const named = component as { displayName?: string; name?: string }\n return named?.displayName ?? named?.name ?? \"Component\"\n}\n\n// One warning per wrapped component per session — a mapper runs at frame\n// rate, and the name is the actionable part.\nconst warnedWithoutWidget = new Set<string>()\n\nconst warnNoWidget = (name: string): void => {\n if (warnedWithoutWidget.has(name)) {\n return\n }\n warnedWithoutWidget.add(name)\n const isProduction =\n typeof process !== \"undefined\" && process.env.NODE_ENV === \"production\"\n if (!isProduction) {\n console.warn(\n `react-native-gtkx: createAnimatedComponent(${name}) was given an animated \\`opacity\\`, ` +\n \"`transform`, colour or size, but the component exposed no ref carrying a widget, so there is nothing to write \" +\n \"to. Give it a `ref?: Ref<MeasureHandle>` built with the platform's own measure handle, or wrap \" +\n \"it in an `Animated.View`. See docs/api.md.\",\n )\n }\n}\n\n/** @internal Test seam: the warning is once per component per session by design. */\nexport const resetAnimatedComponentWarnings = (): void => {\n warnedWithoutWidget.clear()\n}\n\n/**\n * Wraps a component so its `style`'s `opacity`/`transform` and its\n * `animatedProps` can be driven imperatively — RN's own\n * `Animated.createAnimatedComponent`.\n *\n * IT ADDS NO WIDGET. Wrapping in an `Animated.View` would have been three\n * lines and would have been wrong: an extra box changes flex layout, changes\n * what `measureLayout` is relative to, and changes which widget a parent's\n * allocate walks. That is not a shim, it is a different tree. Instead the\n * wrapper renders the component itself and reaches the widget through the\n * handle the component already exposes (see measure.ts's `widgetOf`), so the\n * rendered output is byte-for-byte what the unwrapped component produces.\n *\n * `animatedProps` are passed straight through as animated NODES rather than\n * resolved to numbers, because the components that take them already accept\n * one: the SVG shapes duck-type an animated node on every numeric geometry\n * and paint prop and subscribe to it themselves (svg/animated-support.ts),\n * redrawing through `queueDraw`. Nothing is resolved here that the receiver\n * can resolve better.\n */\nexport const createAnimatedComponent = <C extends ElementType>(\n component: C,\n): AnimatedComponent<C> => {\n const name = displayNameOf(component)\n\n const AnimatedWrapper = ({\n style,\n animatedProps,\n ref,\n ...rest\n }: AnimatedComponentExtraProps & {\n ref?: Ref<unknown>\n [key: string]: unknown\n }) => {\n // The PARENT's widget, for `queueAllocate` — the wrapper is not a host\n // node itself, so this is the container the wrapped component is laid out\n // by, exactly as it would be without the wrapper.\n const host = useHostNode()\n const handleRef = useRef<unknown>(null)\n const { staticStyle, opacity, zIndex, slots, colors, sizes } =\n splitAnimated(style)\n const driven =\n opacity !== null ||\n zIndex !== null ||\n slots.length > 0 ||\n colors.length > 0 ||\n sizes.length > 0\n\n // Stable identity: a fresh callback ref every render would detach and\n // reattach the wrapped component's handle on every render.\n const forwardedRef = useRef<Ref<unknown> | undefined>(ref)\n forwardedRef.current = ref\n const [assignHandle] = useState(() => (instance: unknown) => {\n handleRef.current = instance\n const target = forwardedRef.current\n if (typeof target === \"function\") {\n target(instance)\n } else if (target) {\n ;(target as { current: unknown }).current = instance\n }\n // No return value: React 19 reads one as a callback-ref cleanup.\n })\n\n useAnimatedBinding(\n () => widgetForHandle(handleRef.current),\n host,\n opacity,\n zIndex,\n slots,\n colors,\n sizes,\n )\n\n // A silent no-op is the failure this repo refuses. Checked after the\n // wrapped component's own layout effects have run, which is where its\n // `useImperativeHandle` publishes the handle.\n useLayoutEffect(() => {\n if (driven && widgetForHandle(handleRef.current) === null) {\n warnNoWidget(name)\n }\n })\n\n const targetProps: Record<string, unknown> = { ...rest, ...animatedProps }\n // Only when there is something to attach: a component that takes no ref\n // (the SVG shapes) would otherwise get one in its rest props.\n if (driven || ref) {\n targetProps.ref = assignHandle\n }\n // Likewise `style`: passing `{}` to a component that has no style prop\n // would push an empty object into whatever collects its rest props.\n if (style !== undefined) {\n targetProps.style = staticStyle\n }\n\n const Target = component as ComponentType<Record<string, unknown>>\n return <Target {...targetProps} />\n }\n AnimatedWrapper.displayName = `Animated(${name})`\n\n return AnimatedWrapper as AnimatedComponent<C>\n}\n\n/**\n * `Animated.FlatList` is deliberately absent, and this is the refusal.\n *\n * FlatList is a COMPOSITE, not a host component: it renders the windowed\n * VirtualizedList core, which renders a ScrollView, which is the only thing\n * in that chain owning a widget. Its ref is a scroll API by contract\n * (`scrollToIndex`/`scrollToItem`/`scrollToOffset`), so there is no handle to\n * read a widget back out of — and giving it one would mean publishing the\n * scrolled window through two layers that exist to hide it.\n *\n * Upstream's `Animated.FlatList` mostly exists so `onScroll` can be an\n * `Animated.event`/`useAnimatedScrollHandler`, and neither of those is\n * implemented here either. So this throws where it is used, naming itself and\n * naming the two things that do work.\n */\nconst AnimatedFlatList = (): never => {\n throw new Error(\n \"react-native-gtkx: `Animated.FlatList` is not implemented. FlatList is a composite — the windowed \" +\n \"core over a ScrollView — and its ref is a scroll API, so there is no host widget for an animated \" +\n \"style to write to. Put the animated style on an `Animated.View` wrapping the list, or use \" +\n \"`Animated.ScrollView` if the list does not need virtualization. See docs/api.md.\",\n )\n}\nAnimatedFlatList.displayName = \"Animated.FlatList\"\n\n/**\n * `Text`, `Image` and `ScrollView` are the generic wrapper over the\n * platform's own components — no subclass, no special case, and no widget\n * added to the tree. They are animatable at all because those three now\n * expose a ref carrying their widget, which is RN parity in its own right.\n */\nconst AnimatedText = createAnimatedComponent(Text)\nconst AnimatedImage = createAnimatedComponent(Image)\nconst AnimatedScrollView = createAnimatedComponent(ScrollView)\n\nexport const Animated = {\n ...api,\n View: AnimatedView,\n Text: AnimatedText,\n Image: AnimatedImage,\n ScrollView: AnimatedScrollView,\n // Typed as taking the props it refuses, so the failure is at RUNTIME with\n // the message above rather than at compile time with \"no overload matches\n // this call\" — an app porting from mobile deserves the sentence, not a\n // type puzzle.\n FlatList: AnimatedFlatList as (props: Record<string, unknown>) => never,\n createAnimatedComponent,\n}\n\nexport { Easing } from \"../animated/index\"\n"]}
|
|
1
|
+
{"version":3,"file":"animated.js","sourceRoot":"","sources":["../../src/components/animated.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,mBAAmB,EACnB,eAAe,EACf,MAAM,EACN,QAAQ,GAMT,MAAM,OAAO,CAAA;AAEd,OAAO,EACL,gBAAgB,EAChB,kBAAkB,EAClB,gBAAgB,GAEjB,MAAM,0BAA0B,CAAA;AACjC,OAAO,EACL,iBAAiB,EACjB,eAAe,GAEhB,MAAM,wBAAwB,CAAA;AAC/B,OAAO,EACL,0BAA0B,EAC1B,oBAAoB,GAErB,MAAM,yBAAyB,CAAA;AAChC,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAC3C,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAQlD,OAAO,EACL,oBAAoB,EACpB,oBAAoB,EACpB,gBAAgB,GACjB,MAAM,0CAA0C,CAAA;AACjD,OAAO,EACL,eAAe,EACf,MAAM,EACN,aAAa,EACb,iBAAiB,EACjB,gBAAgB,EAChB,SAAS,GAGV,MAAM,sBAAsB,CAAA;AAE7B,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAA;AACzD,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAA;AAClE,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AACjD,OAAO,EAAE,eAAe,EAAE,WAAW,EAAiB,MAAM,aAAa,CAAA;AACzE,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAC/B,OAAO,EACL,mBAAmB,EACnB,eAAe,GAEhB,MAAM,WA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AElD;;;;;GAKG;AACH,MAAM,YAAY,GAAG,uBAAuB,CAAC,IAAI,CAAC,CAAA;AAClD,MAAM,aAAa,GAAG,uBAAuB,CAAC,KAAK,CAAC,CAAA;AACpD,MAAM,kBAAkB,GAAG,uBAAuB,CAAC,UAAU,CAAC,CAAA;AAE9D,MAAM,CAAC,MAAM,QAAQ,GAAG;IACtB,GAAG,GAAG;IACN,IAAI,EAAE,YAAY;IAClB,IAAI,EAAE,YAAY;IAClB,KAAK,EAAE,aAAa;IACpB,UAAU,EAAE,kBAAkB;IAC9B,0EAA0E;IAC1E,0EAA0E;IAC1E,uEAAuE;IACvE,eAAe;IACf,QAAQ,EAAE,gBAA6D;IACvE,uBAAuB;CACxB,CAAA;AAED,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA","sourcesContent":["import {\n useImperativeHandle,\n useLayoutEffect,\n useRef,\n useState,\n type ComponentProps,\n type ComponentType,\n type ElementType,\n type ReactNode,\n type Ref,\n} from \"react\"\nimport type { DrivenSize } from \"../layout/driven-size\"\nimport {\n INSET_PROPERTIES,\n insetRefusalReason,\n insetTranslation,\n type InsetProperty,\n} from \"../style/absolute-insets\"\nimport {\n drivenSizeRefusal,\n SIZE_PROPERTIES,\n type SizeProperty,\n} from \"../style/animated-size\"\nimport {\n DRIVEABLE_COLOR_PROPERTIES,\n driveableColorsToCss,\n type DriveableColorProperty,\n} from \"../style/imperative-css\"\nimport { StyleSheet } from \"../style/index\"\nimport { createAnimated } from \"../animated/index\"\nimport type {\n DimensionValue,\n FlatStyle,\n PointerEventsValue,\n StyleProp,\n TransformPart,\n} from \"../contracts\"\nimport {\n GestureAttachContext,\n mergeGestureHandlers,\n useGestureAttach,\n} from \"../gesture-handler-compat/attach-context\"\nimport {\n createWidgetCss,\n GtkBox,\n queueAllocate,\n setBoxPassthrough,\n setPointerTarget,\n setZIndex,\n type Gtk,\n type WidgetCss,\n} from \"../gtkx/bridge/index\"\nimport type { ResponderProps } from \"../responder/types\"\nimport { useResponder } from \"../responder/use-responder\"\nimport { applyDrivenSize, releaseDrivenSize } from \"./driven-size\"\nimport { glibScheduler } from \"./frame-scheduler\"\nimport { HostNodeContext, useHostNode, type HostNode } from \"./host-node\"\nimport { Image } from \"./image\"\nimport {\n createMeasureHandle,\n widgetForHandle,\n type MeasureHandle,\n} from \"./measure\"\nimport { setStoredTransform } from \"./rect-store\"\nimport { ScrollView } from \"./scroll-view\"\nimport { Text } from \"./text\"\nimport {\n nodeForWidget,\n useLayoutChild,\n useRnContainer,\n type LayoutEvent,\n} from \"./use-layout-child\"\n\nconst api = createAnimated(glibScheduler)\n\n// Interpolations produce suffixed strings (\"45deg\"), so a driven value is\n// not necessarily a number — `rotate` is normally an interpolate() with a\n// deg outputRange.\ntype AnimatedValue = number | string\n\ntype AnimatedNode = {\n addListener(callback: (state: { value: AnimatedValue }) => void): string\n removeListener(id: string): void\n __getValue(): AnimatedValue\n}\n\nconst isAnimatedNode = (value: unknown): value is AnimatedNode =>\n typeof value === \"object\" &&\n value !== null &&\n typeof (value as AnimatedNode).addListener === \"function\" &&\n typeof (value as AnimatedNode).__getValue === \"function\"\n\ntype AnimatedTransformPart = { [key: string]: number | string | AnimatedNode }\n\n// One entry of the style's transform array, kept in source order. The array\n// order IS the composition order in RN, so an animated entry updates its own\n// slot in place instead of being lifted out of the list — that is what makes\n// [{rotate}, {translateX}] compose differently from the reverse, as in RN.\ntype TransformSlot = {\n key: string\n node: AnimatedNode | null\n value: AnimatedValue\n // Set only on a slot DERIVED from an animated inset (`top`/`left`/`right`/\n // `bottom` on a node whose own position is absolute). The slot then carries\n // `sign * (inset - base)`, where `base` is the inset value Yoga was given at\n // the last React commit — see splitAnimated.\n inset?: { base: number; sign: 1 | -1 }\n}\n\nconst toNumber = (value: AnimatedValue): number =>\n typeof value === \"number\" ? value : Number.parseFloat(value)\n\n// What a slot actually writes into the transform array. An ordinary slot\n// writes its value; a derived inset slot writes its offset from the committed\n// base, which is what makes an absolute `top` a translation.\nconst slotValue = (\n slot: TransformSlot,\n value: AnimatedValue,\n): AnimatedValue => {\n if (!slot.inset) {\n return value\n }\n const numeric = toNumber(value)\n // A non-numeric inset (a percentage produced mid-animation) has no offset\n // from a point base. Holding the last position beats jumping to NaN, and\n // the leaf never becomes driveable in the first place unless it starts\n // numeric — see style/absolute-insets.ts and reanimated-compat/style.ts.\n return Number.isFinite(numeric)\n ? slot.inset.sign * (numeric - slot.inset.base)\n : 0\n}\n\n// Stable per-node identity for the effect's dependency key: Animated nodes\n// are objects, and the bindings must be rebuilt when the node behind a slot\n// changes — not on every render that rebuilds an equal-looking array.\nlet nextNodeId = 1\nconst nodeIds = new WeakMap<object, number>()\nconst nodeId = (value: object): number => {\n let id = nodeIds.get(value)\n if (id === undefined) {\n id = nextNodeId++\n nodeIds.set(value, id)\n }\n return id\n}\n\n// Omit, not plain intersection: intersecting would AND the animated transform\n// with FlatStyle's numeric one, rejecting Animated.Value entries.\nexport type AnimatedViewStyle = Omit<\n FlatStyle,\n | \"opacity\"\n | \"zIndex\"\n | \"transform\"\n | DriveableColorProperty\n | InsetProperty\n | SizeProperty\n> & {\n opacity?: number | AnimatedNode\n zIndex?: number | AnimatedNode\n transform?: (TransformPart | AnimatedTransformPart)[]\n} & Partial<Record<DriveableColorProperty, string | AnimatedNode>> &\n Partial<Record<InsetProperty, DimensionValue | AnimatedNode>> &\n Partial<Record<SizeProperty, DimensionValue | AnimatedNode>>\n\n/** What every animated component accepts as `style`, arrays and falsy included. */\nexport type AnimatedStyleProp =\n AnimatedViewStyle | readonly (AnimatedViewStyle | false | null | undefined)[]\n\n// Animated.View is where a PanResponder drag lands in idiomatic RN — the\n// dragged box is animated by definition — so it takes the responder props\n// exactly as View does.\nexport type AnimatedViewProps = ResponderProps & {\n style?: AnimatedStyleProp\n children?: ReactNode\n onLayout?: (event: LayoutEvent) => void\n testID?: string\n // Reanimated's `Animated.View` IS `createAnimatedComponent(View)` upstream,\n // so it takes every View prop — `pointerEvents` included. Dropping it made\n // an invisible full-screen overlay swallow every press underneath it, which\n // is exactly how `react-native-drawer-layout`'s `Overlay` is built\n // (opacity 0 plus `pointerEvents: \"none\"`): the drawer's own edge swipe\n // worked and NOTHING inside the app did.\n pointerEvents?: PointerEventsValue\n // The other half of the same parity gap. `useAnimatedProps` returns an\n // object of current values, and `createAnimatedComponent` already spreads\n // it — but `Animated.View` is written by hand here rather than produced by\n // that factory, so it has to spread it too. Upstream's `Overlay` sets\n // `pointerEvents` through THIS channel, not as a static prop.\n animatedProps?: Record<string, unknown>\n // Same handle a plain View exposes. RN gives every host component the\n // imperative geometry methods, and Reanimated's `useAnimatedRef` +\n // `measure()` is written against an Animated.View having them — without\n // this, measuring an animated view means wrapping it in a plain one.\n ref?: Ref<MeasureHandle>\n}\n\n// One driven colour property. Unlike transforms these do not compose, so each\n// is simply the latest value of its own declaration.\ntype ColorSlot = {\n property: DriveableColorProperty\n node: AnimatedNode\n}\n\n// One driven size. `base` is the value Yoga was given at the last React\n// commit, which is what the rebase moves and what the committed rect the\n// override sits on top of was laid out at.\ntype SizeSlot = {\n property: SizeProperty\n node: AnimatedNode\n base: number\n}\n\n// One warning per inset property per session, like every other channel here.\nconst warnedInsets = new Set<string>()\n\nconst insetTranslationOf = (property: InsetProperty): string =>\n property === \"top\" || property === \"bottom\" ? \"translateY\" : \"translateX\"\n\nconst warnInsetNotTranslatable = (\n property: InsetProperty,\n reason: string | null,\n): void => {\n if (warnedInsets.has(property)) {\n return\n }\n warnedInsets.add(property)\n const isProduction =\n typeof process !== \"undefined\" && process.env.NODE_ENV === \"production\"\n if (isProduction) {\n return\n }\n const spec = insetTranslationOf(property)\n console.warn(\n `react-native-gtkx: an animated \\`${property}\\` cannot be driven here. ` +\n (reason\n ? `The node IS absolutely positioned, but ${reason}, so there is no translation that reproduces it. `\n : \"`top`/`left`/`right`/`bottom` are driven at frame rate only on a node whose own `position` is \" +\n '\"absolute\", where moving it is exactly a translation and touches no sibling. Anything else needs a ' +\n \"Yoga pass over the container plus its commit walk, which costs what the CONTAINER costs (71 µs at \" +\n \"five children, 509 µs at three hundred) against a transform's 0.12 µs. \") +\n `Animate \\`transform: [{ ${spec}: … }]\\` instead. ` +\n \"The value is still applied on the next React render. See docs/api.md.\",\n )\n}\n\n/** @internal Test seam: the warning is once per property per session by design. */\nexport const resetAnimatedInsetWarnings = (): void => {\n warnedInsets.clear()\n}\n\n// Same policy for sizes: once per property per session, and the reason is the\n// actionable part — the rule refuses for one of eight named reasons and each\n// of them has a different fix.\nconst warnedSizes = new Set<string>()\n\nconst warnSizeNotDriveable = (property: SizeProperty, reason: string): void => {\n if (warnedSizes.has(property)) {\n return\n }\n warnedSizes.add(property)\n const isProduction =\n typeof process !== \"undefined\" && process.env.NODE_ENV === \"production\"\n if (isProduction) {\n return\n }\n const scale = property === \"width\" ? \"scaleX\" : \"scaleY\"\n console.warn(\n `react-native-gtkx: an animated \\`${property}\\` cannot be driven here, because ${reason}. ` +\n `\\`width\\`/\\`height\\` run at frame rate only where the change stops at the node that owns it — the ` +\n \"node's own subtree is then re-laid-out pinned to the driven value (7.1 µs for a leaf, 21.7 µs with \" +\n \"wrapped text, the same at five children and at three hundred) and one allocation puts it on screen. \" +\n \"Anything else needs a Yoga pass over the container plus its commit walk, which costs what the \" +\n \"CONTAINER costs: 71 µs at five children, 509 µs at three hundred, against a transform's 0.6 µs. \" +\n `The closest transform is \\`transform: [{ ${scale}: … }]\\`, but it is NOT the same thing — a scale ` +\n \"grows about the view's centre, so the box moves as it grows, and it scales the content with the box \" +\n \"instead of re-laying it out, so text stretches rather than re-wrapping. \" +\n \"The new value is applied on the next React render either way. See docs/api.md.\",\n )\n}\n\n/** @internal Test seam: the warning is once per property per session by design. */\nexport const resetAnimatedSizeWarnings = (): void => {\n warnedSizes.clear()\n}\n\nconst splitAnimated = (\n style: AnimatedStyleProp | false | null | undefined,\n): {\n staticStyle: StyleProp\n opacity: AnimatedNode | null\n zIndex: AnimatedNode | null\n slots: TransformSlot[]\n colors: ColorSlot[]\n sizes: SizeSlot[]\n} => {\n const flat: Record<string, unknown> = {}\n const collect = (\n entry: AnimatedStyleProp | false | null | undefined,\n ): void => {\n if (!entry) {\n return\n }\n if (Array.isArray(entry)) {\n entry.forEach(collect)\n return\n }\n Object.assign(flat, entry)\n }\n collect(style)\n\n let opacity: AnimatedNode | null = null\n let zIndex: AnimatedNode | null = null\n const slots: TransformSlot[] = []\n const colors: ColorSlot[] = []\n const sizes: SizeSlot[] = []\n\n if (isAnimatedNode(flat.opacity)) {\n opacity = flat.opacity\n delete flat.opacity\n }\n // `zIndex` is in `useSortable`'s style object on every frame and changes\n // value about twice per drag. It takes the same door opacity does — one\n // widget-level write, no Yoga, no CSS — so there is nothing to refuse.\n if (isAnimatedNode(flat.zIndex)) {\n zIndex = flat.zIndex\n delete flat.zIndex\n }\n for (const property of DRIVEABLE_COLOR_PROPERTIES) {\n const value = flat[property]\n if (isAnimatedNode(value)) {\n colors.push({ property, node: value })\n // Removed from the static style so the shared class registry never sees\n // a per-frame value: its memoisation stays keyed on styles that change\n // when React renders, which is the only thing it is good at.\n delete flat[property]\n }\n }\n if (Array.isArray(flat.transform)) {\n for (const part of flat.transform as AnimatedTransformPart[]) {\n const key = Object.keys(part)[0]\n if (key === undefined) {\n continue\n }\n const value = part[key]\n slots.push(\n isAnimatedNode(value)\n ? { key, node: value, value: value.__getValue() }\n : { key, node: null, value: value as AnimatedValue },\n )\n }\n // The whole array is owned here from now on, static entries included:\n // leaving them in the style would make useLayoutChild write the same\n // rect-store slot from the other side, and the two would overwrite\n // each other every render.\n delete flat.transform\n }\n\n // Slice 2b: an animated inset on an absolutely positioned node becomes a\n // derived translate. It is the one layout property with an exact transform\n // equivalent, because an out-of-flow node's position affects nothing but\n // where it is drawn — see src/style/absolute-insets.ts for the measured\n // rule and for the configurations where the equivalence does NOT hold.\n //\n // Three things happen here at once, and all three are load-bearing:\n //\n // - THE BASE. The inset's current value is written back into the static\n // style as a plain number, so Yoga is given a real position and the\n // committed rect the parent's allocate reads is the base the offset is\n // measured from. Nothing about the shadow tree changes.\n // - THE REBASE. This runs on every render, so when React commits a layout\n // with a different inset, the base moves and the offset is recomputed\n // against it in the SAME commit — the Yoga write and the offset write\n // are both layout effects, and the engine's flush is a microtask, so GTK\n // never gets a frame in between and there is no jump.\n // - THE ORDER. Derived slots go FIRST. The array's leftmost entry is the\n // outermost matrix (style/transform.ts), so a derived translate is\n // applied to the point LAST — it moves the already-rotated, already-\n // scaled box in the parent's coordinates, exactly as a layout position\n // does. Appending instead would put the user's scale on the OUTSIDE and\n // multiply the offset by it.\n const insetSlots: TransformSlot[] = []\n for (const property of INSET_PROPERTIES) {\n const value = flat[property]\n if (!isAnimatedNode(value)) {\n continue\n }\n const base = toNumber(value.__getValue())\n const translation = Number.isFinite(base)\n ? insetTranslation(flat, property)\n : null\n if (!translation) {\n // Not an equivalence. Resolve to the current value so the static style\n // is at least correct on this render, and keep slice 2's refusal loud.\n flat[property] = Number.isFinite(base) ? base : undefined\n warnInsetNotTranslatable(property, insetRefusalReason(flat, property))\n continue\n }\n flat[property] = base\n insetSlots.push({\n key: translation.transform,\n node: value,\n value: 0,\n inset: { base, sign: translation.sign },\n })\n }\n\n // Slice 3: an animated `width`/`height` where the change is confined to the\n // node that owns it. Unlike an inset this is NOT re-expressed as a\n // transform — there is no transform that reproduces a size change, which\n // docs/research/animated-size.md §6 measured rather than assumed — so the\n // slot carries the property itself and the view layer drives it through a\n // pinned pass over the node's own subtree.\n //\n // THE REBASE, exactly as above and for the same reason: the driven value is\n // written back into the static style as a plain number, so Yoga is given the\n // size the animation is currently showing and the committed rect the\n // override sits on catches up in the SAME commit. Both writes are layout\n // effects and the engine's flush is a microtask, so GTK never gets a frame\n // in between.\n //\n // WHETHER it can be driven is not decided here. The answer depends on the\n // CONTAINER's `flexDirection`, its `alignItems` and where its own size comes\n // from, none of which are in this style object or in this component's props\n // — it is asked of the layout tree in useAnimatedBinding, which is the only\n // place the tree exists.\n for (const property of SIZE_PROPERTIES) {\n const value = flat[property]\n if (!isAnimatedNode(value)) {\n continue\n }\n const base = toNumber(value.__getValue())\n if (!Number.isFinite(base)) {\n // A percentage produced mid-animation has no point base to lay out at.\n // Dropped rather than driven, and the leaf never becomes driveable in\n // the first place unless it starts numeric — reanimated-compat/style.ts.\n flat[property] = undefined\n continue\n }\n flat[property] = base\n sizes.push({ property, node: value, base })\n }\n\n return {\n staticStyle: flat as StyleProp,\n opacity,\n zIndex,\n slots: insetSlots.length > 0 ? [...insetSlots, ...slots] : slots,\n colors,\n sizes,\n }\n}\n\n/**\n * The imperative write path, and the whole of it.\n *\n * Animated values bypass React entirely: listeners write straight to the\n * widget (opacity), to the rect store (the transform applied by the parent's\n * allocate) on top of the engine-committed base rect, and to a CSS provider\n * private to the widget (colours). Animation frames never touch Yoga, and\n * never touch the shared stylesheet.\n *\n * Nothing here is View-specific, which is why it is a hook rather than a\n * paragraph inside `AnimatedView`: it needs the CHILD's widget (for\n * `setOpacity` and the rect store) and its PARENT's (for `queueAllocate`),\n * and any component that can produce those two can be animated. The child is\n * reached through a getter rather than a ref because a wrapper does not own\n * the widget — it reads it back out of whatever handle the wrapped component\n * exposed, which may only exist after that component's own layout effects.\n */\nconst useAnimatedBinding = (\n getWidget: () => Gtk.Widget | null,\n host: HostNode,\n opacity: AnimatedNode | null,\n zIndex: AnimatedNode | null,\n slots: TransformSlot[],\n colors: ColorSlot[],\n sizes: SizeSlot[],\n // Anything else that must force a rebind. `AnimatedView` passes its layout\n // node; the generic wrapper has nothing to add.\n rebindKey?: unknown,\n): void => {\n // The effect reads the slots of the render that (re)armed it; the values\n // inside are then owned by the listeners.\n const slotsRef = useRef<TransformSlot[]>(slots)\n slotsRef.current = slots\n const colorsRef = useRef<ColorSlot[]>(colors)\n colorsRef.current = colors\n const sizesRef = useRef<SizeSlot[]>(sizes)\n sizesRef.current = sizes\n const getWidgetRef = useRef(getWidget)\n getWidgetRef.current = getWidget\n const hostRef = useRef(host)\n hostRef.current = host\n const parentWidgetRef = host.widgetRef\n\n // Rebind on a change of shape (which transforms, in which order), of the\n // node behind an animated entry, or of a static entry's value — not on\n // every render that rebuilds an equal-looking array.\n //\n // A derived inset slot adds its BASE to the key, and that is what makes the\n // rebase happen: React committing a new `top` moves the base, which re-arms\n // this effect in the same commit that gives Yoga the new position.\n const bindingKey =\n (opacity ? `opacity#${nodeId(opacity)}` : \"\") +\n (zIndex ? `zIndex#${nodeId(zIndex)}` : \"\") +\n slots\n .map((slot) => {\n const inset = slot.inset ? `~${slot.inset.sign}:${slot.inset.base}` : \"\"\n return slot.node\n ? `|${slot.key}#${nodeId(slot.node)}${inset}`\n : `|${slot.key}=${String(slot.value)}`\n })\n .join(\"\") +\n colors.map((slot) => `|${slot.property}#${nodeId(slot.node)}`).join(\"\") +\n // The base is in the key for the same reason a derived inset's is: React\n // committing a new size moves it, and re-arming here is what hands the\n // override back to the engine in the same commit that gives Yoga the new\n // value.\n sizes\n .map((slot) => `|${slot.property}#${nodeId(slot.node)}~${slot.base}`)\n .join(\"\")\n\n useLayoutEffect(() => {\n const widget = getWidgetRef.current()\n if (!widget) {\n return\n }\n // Captured for the CLEANUP only: by then the ref may already have been\n // detached, and the container to re-allocate is the one this binding was\n // made against. Every live write below re-reads the ref instead.\n const boundParentWidget = parentWidgetRef.current\n\n // The live transform array, mutated in place: an Animated write must\n // stay one numeric store plus one queued allocation — no React render,\n // no Yoga pass, no allocation per frame beyond the composed matrix.\n //\n // RN transform semantics: this is paint-only. The result goes to the\n // rect store unclamped — the parent's measure ignores children, so a\n // transformed child draws past the boundary over its neighbors without\n // moving a single ancestor.\n const parts = slotsRef.current.map(\n (slot) =>\n ({\n [slot.key]: slot.node\n ? slotValue(slot, slot.node.__getValue())\n : slot.value,\n }) as Record<string, AnimatedValue>,\n )\n\n const flush = (): void => {\n const widget = getWidgetRef.current()\n if (!widget) {\n return\n }\n setStoredTransform(widget, parts as unknown as TransformPart[])\n const parentWidget = parentWidgetRef.current\n if (parentWidget) {\n queueAllocate(parentWidget)\n }\n }\n\n const subscriptions: { node: AnimatedNode; id: string }[] = []\n slotsRef.current.forEach((slot, index) => {\n if (!slot.node) {\n return\n }\n const part = parts[index]!\n subscriptions.push({\n node: slot.node,\n id: slot.node.addListener(({ value }) => {\n part[slot.key] = slotValue(slot, value)\n flush()\n }),\n })\n })\n\n if (opacity) {\n const applyOpacity = (value: AnimatedValue): void => {\n const numeric = typeof value === \"number\" ? value : parseFloat(value)\n getWidgetRef.current()?.setOpacity(Math.min(1, Math.max(0, numeric)))\n }\n subscriptions.push({\n node: opacity,\n id: opacity.addListener(({ value }) => {\n applyOpacity(value)\n }),\n })\n applyOpacity(opacity.__getValue())\n }\n\n // The container's paint and pick order (gtkx/bridge/view-box.ts). The\n // write drops the container's cached order and queues a redraw; nothing\n // is re-measured and nothing is re-allocated, because zIndex changes\n // neither.\n if (zIndex) {\n const applyZIndex = (value: AnimatedValue): void => {\n const widget = getWidgetRef.current()\n if (!widget) {\n return\n }\n const numeric = typeof value === \"number\" ? value : parseFloat(value)\n setZIndex(widget, Number.isFinite(numeric) ? Math.round(numeric) : 0)\n }\n subscriptions.push({\n node: zIndex,\n id: zIndex.addListener(({ value }) => {\n applyZIndex(value)\n }),\n })\n applyZIndex(zIndex.__getValue())\n }\n\n // Colours take the other imperative door: a CSS provider private to this\n // widget, replaced in place. Deliberately NOT the shared class registry —\n // that one memoises by CSS text, so a driven colour would mint a class per\n // frame into a document GTK re-parses whole and that is never pruned\n // (docs/research/animated-colors.md). All driven colours share one\n // provider and one declaration block: two properties animating together\n // are one write, not two.\n const colorSlots = colorsRef.current\n let widgetCss: WidgetCss | null = null\n if (colorSlots.length > 0) {\n const css = createWidgetCss(widget)\n widgetCss = css\n const values: Record<string, unknown> = {}\n const writeColors = (): void => {\n css.set(driveableColorsToCss(values))\n }\n for (const slot of colorSlots) {\n values[slot.property] = slot.node.__getValue()\n subscriptions.push({\n node: slot.node,\n id: slot.node.addListener(({ value }) => {\n values[slot.property] = value\n writeColors()\n }),\n })\n }\n writeColors()\n }\n\n // Sizes take the third door, and it is the only one that runs Yoga.\n //\n // Nothing is written at BIND time on purpose: the render that armed this\n // effect put the current value into the static style, so the engine is\n // already committing exactly this size and an override would be a copy of\n // it. The first write happens when a frame asks for something else.\n const sizeSlots = sizesRef.current\n const drivenWidgets: Gtk.Widget[] = []\n if (sizeSlots.length > 0) {\n const layoutNode = nodeForWidget(widget)\n const driven: DrivenSize = {}\n const driveable = new Set<SizeProperty>()\n let decided = false\n // Deferred to the first frame that actually asks for a new size, and\n // that is not laziness: the rule is asked of the CONTAINER's Yoga node,\n // and on a first mount a container's own layout effects run AFTER its\n // children's — so at bind time the container may still be carrying the\n // defaults rather than its style. By the first frame the tree has been\n // laid out at least once and the answer is the real one.\n const decide = (): void => {\n decided = true\n if (!layoutNode) {\n return\n }\n const context = {\n node: layoutNode,\n rootIsContentSized: hostRef.current.engine.contentSized,\n }\n for (const slot of sizeSlots) {\n const reason = drivenSizeRefusal(context, slot.property)\n if (reason === null) {\n driveable.add(slot.property)\n } else {\n warnSizeNotDriveable(slot.property, reason)\n }\n }\n }\n for (const slot of sizeSlots) {\n subscriptions.push({\n node: slot.node,\n id: slot.node.addListener(({ value }) => {\n const numeric = toNumber(value)\n if (!Number.isFinite(numeric)) {\n return\n }\n if (!decided) {\n decide()\n }\n if (!driveable.has(slot.property) || !layoutNode) {\n return\n }\n driven[slot.property] = numeric\n const target = getWidgetRef.current()\n if (target) {\n applyDrivenSize(\n layoutNode,\n target,\n parentWidgetRef.current,\n driven,\n drivenWidgets,\n )\n }\n }),\n })\n }\n }\n\n flush()\n\n return () => {\n for (const { node: animated, id } of subscriptions) {\n animated.removeListener(id)\n }\n widgetCss?.dispose()\n // Every widget this binding was driving goes back to the rect the\n // engine committed. On a REBASE that is the whole point: the render\n // that re-armed this effect handed Yoga the size the animation is\n // showing, so the committed rect is about to become the driven one and\n // holding an override on top of it would be holding a stale copy.\n if (drivenWidgets.length > 0) {\n releaseDrivenSize(drivenWidgets)\n if (boundParentWidget) {\n queueAllocate(boundParentWidget)\n }\n }\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [bindingKey, rebindKey])\n}\n\nconst AnimatedView = ({\n style,\n children,\n onLayout,\n testID,\n ref,\n pointerEvents,\n animatedProps,\n ...responderProps\n}: AnimatedViewProps) => {\n const widgetRef = useRef<Gtk.Box | null>(null)\n const { staticStyle, opacity, zIndex, slots, colors, sizes } =\n splitAnimated(style)\n\n const { host, node, cssClass } = useLayoutChild(widgetRef, {\n style: staticStyle,\n onLayout,\n })\n useRnContainer(widgetRef, node)\n\n // A gesture whose own GestureDetector could not reach a widget directly —\n // its child was an opaque composite that renders this Animated.View but\n // forwards neither a ref nor its own props onto it, react-native-sortables'\n // ItemCell being the confirmed case (gesture-handler-compat/attach-context.ts)\n // — claims this widget instead, through context rather than through the\n // props ItemCell dropped.\n const gestureAttach = useGestureAttach()\n useResponder(\n widgetRef,\n gestureAttach\n ? mergeGestureHandlers(responderProps, gestureAttach.handlers)\n : responderProps,\n )\n\n // `animatedProps` LAST, matching `createAnimatedComponent`'s\n // `{ ...rest, ...animatedProps }` — a value produced by the updater is the\n // live one and wins over the static prop. Only the picking mode is read\n // here: a numeric animated prop has no meaning on a View, and the SVG\n // shapes that do take them go through `createAnimatedComponent` already.\n const mode: PointerEventsValue =\n (animatedProps?.pointerEvents as PointerEventsValue | undefined) ??\n pointerEvents ??\n StyleSheet.flatten(staticStyle)?.pointerEvents ??\n \"auto\"\n\n useLayoutEffect(() => {\n const widget = widgetRef.current\n if (!widget) {\n return\n }\n setPointerTarget(widget, mode !== \"none\")\n setBoxPassthrough(widget, mode === \"box-none\")\n }, [mode])\n\n useImperativeHandle(ref, () => createMeasureHandle(widgetRef, node), [node])\n\n // Registers this widget as the fallback gesture's handle — the same\n // `assignHandle` its GestureDetector would have put directly on the ref, had\n // its child forwarded one. A fresh handle rather than reusing the one above:\n // `useImperativeHandle`'s factory only runs when `ref` itself is non-null,\n // which is not the case here (ItemCell passes none), so there is nothing to\n // reuse — and a second handle for the same widget is harmless, `measure.ts`\n // keys by handle identity, not by widget.\n useLayoutEffect(() => {\n gestureAttach?.assignHandle(createMeasureHandle(widgetRef, node))\n }, [gestureAttach, node])\n\n useAnimatedBinding(\n () => widgetRef.current,\n host,\n opacity,\n zIndex,\n slots,\n colors,\n sizes,\n node,\n )\n\n return (\n <GtkBox\n ref={widgetRef}\n name={testID}\n cssClasses={cssClass ? [cssClass] : []}\n >\n <HostNodeContext.Provider\n value={{ engine: host.engine, node, widgetRef }}\n >\n {/* Claimed here (or never offered at all) either way — a nested\n Animated.View further down must not claim the same gesture again. */}\n <GestureAttachContext.Provider value={null}>\n {children}\n </GestureAttachContext.Provider>\n </HostNodeContext.Provider>\n </GtkBox>\n )\n}\n\n// --- createAnimatedComponent ---------------------------------------------\n\n/** Node-backed props from `useAnimatedProps`, spread onto the wrapped component. */\nexport type AnimatedPropsProp = Record<string, unknown>\n\n/** The props an animated wrapper adds on top of the component's own. */\nexport type AnimatedComponentExtraProps = {\n style?: AnimatedStyleProp\n animatedProps?: AnimatedPropsProp\n}\n\n// `Partial`, as upstream's own `AnimatedProps<Props>` effectively is: a prop\n// supplied through `animatedProps` is invisible to the type system here, so\n// insisting on the wrapped component's required props would reject exactly\n// the call the feature exists for (`<AnimatedCircle animatedProps={{ r }} />`).\nexport type AnimatedComponent<C extends ElementType> = (\n props: Partial<Omit<ComponentProps<C>, \"style\">> &\n AnimatedComponentExtraProps,\n) => ReactNode\n\nconst displayNameOf = (component: unknown): string => {\n if (typeof component === \"string\") {\n return component\n }\n const named = component as { displayName?: string; name?: string }\n return named?.displayName ?? named?.name ?? \"Component\"\n}\n\n// One warning per wrapped component per session — a mapper runs at frame\n// rate, and the name is the actionable part.\nconst warnedWithoutWidget = new Set<string>()\n\nconst warnNoWidget = (name: string): void => {\n if (warnedWithoutWidget.has(name)) {\n return\n }\n warnedWithoutWidget.add(name)\n const isProduction =\n typeof process !== \"undefined\" && process.env.NODE_ENV === \"production\"\n if (!isProduction) {\n console.warn(\n `react-native-gtkx: createAnimatedComponent(${name}) was given an animated \\`opacity\\`, ` +\n \"`transform`, colour or size, but the component exposed no ref carrying a widget, so there is nothing to write \" +\n \"to. Give it a `ref?: Ref<MeasureHandle>` built with the platform's own measure handle, or wrap \" +\n \"it in an `Animated.View`. See docs/api.md.\",\n )\n }\n}\n\n/** @internal Test seam: the warning is once per component per session by design. */\nexport const resetAnimatedComponentWarnings = (): void => {\n warnedWithoutWidget.clear()\n}\n\n/**\n * Wraps a component so its `style`'s `opacity`/`transform` and its\n * `animatedProps` can be driven imperatively — RN's own\n * `Animated.createAnimatedComponent`.\n *\n * IT ADDS NO WIDGET. Wrapping in an `Animated.View` would have been three\n * lines and would have been wrong: an extra box changes flex layout, changes\n * what `measureLayout` is relative to, and changes which widget a parent's\n * allocate walks. That is not a shim, it is a different tree. Instead the\n * wrapper renders the component itself and reaches the widget through the\n * handle the component already exposes (see measure.ts's `widgetOf`), so the\n * rendered output is byte-for-byte what the unwrapped component produces.\n *\n * `animatedProps` are passed straight through as animated NODES rather than\n * resolved to numbers, because the components that take them already accept\n * one: the SVG shapes duck-type an animated node on every numeric geometry\n * and paint prop and subscribe to it themselves (svg/animated-support.ts),\n * redrawing through `queueDraw`. Nothing is resolved here that the receiver\n * can resolve better.\n */\nexport const createAnimatedComponent = <C extends ElementType>(\n component: C,\n): AnimatedComponent<C> => {\n const name = displayNameOf(component)\n\n const AnimatedWrapper = ({\n style,\n animatedProps,\n ref,\n ...rest\n }: AnimatedComponentExtraProps & {\n ref?: Ref<unknown>\n [key: string]: unknown\n }) => {\n // The PARENT's widget, for `queueAllocate` — the wrapper is not a host\n // node itself, so this is the container the wrapped component is laid out\n // by, exactly as it would be without the wrapper.\n const host = useHostNode()\n const handleRef = useRef<unknown>(null)\n const { staticStyle, opacity, zIndex, slots, colors, sizes } =\n splitAnimated(style)\n const driven =\n opacity !== null ||\n zIndex !== null ||\n slots.length > 0 ||\n colors.length > 0 ||\n sizes.length > 0\n\n // Stable identity: a fresh callback ref every render would detach and\n // reattach the wrapped component's handle on every render.\n const forwardedRef = useRef<Ref<unknown> | undefined>(ref)\n forwardedRef.current = ref\n const [assignHandle] = useState(() => (instance: unknown) => {\n handleRef.current = instance\n const target = forwardedRef.current\n if (typeof target === \"function\") {\n target(instance)\n } else if (target) {\n ;(target as { current: unknown }).current = instance\n }\n // No return value: React 19 reads one as a callback-ref cleanup.\n })\n\n useAnimatedBinding(\n () => widgetForHandle(handleRef.current),\n host,\n opacity,\n zIndex,\n slots,\n colors,\n sizes,\n )\n\n // A silent no-op is the failure this repo refuses. Checked after the\n // wrapped component's own layout effects have run, which is where its\n // `useImperativeHandle` publishes the handle.\n useLayoutEffect(() => {\n if (driven && widgetForHandle(handleRef.current) === null) {\n warnNoWidget(name)\n }\n })\n\n const targetProps: Record<string, unknown> = { ...rest, ...animatedProps }\n // Only when there is something to attach: a component that takes no ref\n // (the SVG shapes) would otherwise get one in its rest props.\n if (driven || ref) {\n targetProps.ref = assignHandle\n }\n // Likewise `style`: passing `{}` to a component that has no style prop\n // would push an empty object into whatever collects its rest props.\n if (style !== undefined) {\n targetProps.style = staticStyle\n }\n\n const Target = component as ComponentType<Record<string, unknown>>\n return <Target {...targetProps} />\n }\n AnimatedWrapper.displayName = `Animated(${name})`\n\n return AnimatedWrapper as AnimatedComponent<C>\n}\n\n/**\n * `Animated.FlatList` is deliberately absent, and this is the refusal.\n *\n * FlatList is a COMPOSITE, not a host component: it renders the windowed\n * VirtualizedList core, which renders a ScrollView, which is the only thing\n * in that chain owning a widget. Its ref is a scroll API by contract\n * (`scrollToIndex`/`scrollToItem`/`scrollToOffset`), so there is no handle to\n * read a widget back out of — and giving it one would mean publishing the\n * scrolled window through two layers that exist to hide it.\n *\n * Upstream's `Animated.FlatList` mostly exists so `onScroll` can be an\n * `Animated.event`/`useAnimatedScrollHandler` — both work on this platform\n * (../animated/event.ts, ../reanimated-compat/scroll-handler.ts) — which is\n * exactly why the refusal survives without taking that with it: either one\n * still reaches the widget through the plain `FlatList`'s own `onScroll`\n * (forwarded straight to the windowed core's `ScrollView`) or through\n * `Animated.ScrollView`. So this throws where it is used, naming itself and\n * naming the two things that do work.\n */\nconst AnimatedFlatList = (): never => {\n throw new Error(\n \"react-native-gtkx: `Animated.FlatList` is not implemented. FlatList is a composite — the windowed \" +\n \"core over a ScrollView — and its ref is a scroll API, so there is no host widget for an animated \" +\n \"style to write to. Put the animated style on an `Animated.View` wrapping the list, or use \" +\n \"`Animated.ScrollView` if the list does not need virtualization. See docs/api.md.\",\n )\n}\nAnimatedFlatList.displayName = \"Animated.FlatList\"\n\n/**\n * `Text`, `Image` and `ScrollView` are the generic wrapper over the\n * platform's own components — no subclass, no special case, and no widget\n * added to the tree. They are animatable at all because those three now\n * expose a ref carrying their widget, which is RN parity in its own right.\n */\nconst AnimatedText = createAnimatedComponent(Text)\nconst AnimatedImage = createAnimatedComponent(Image)\nconst AnimatedScrollView = createAnimatedComponent(ScrollView)\n\nexport const Animated = {\n ...api,\n View: AnimatedView,\n Text: AnimatedText,\n Image: AnimatedImage,\n ScrollView: AnimatedScrollView,\n // Typed as taking the props it refuses, so the failure is at RUNTIME with\n // the message above rather than at compile time with \"no overload matches\n // this call\" — an app porting from mobile deserves the sentence, not a\n // type puzzle.\n FlatList: AnimatedFlatList as (props: Record<string, unknown>) => never,\n createAnimatedComponent,\n}\n\nexport { Easing } from \"../animated/index\"\n"]}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useLayoutEffect } from "react";
|
|
3
|
-
import {
|
|
3
|
+
import { warnOnce } from "../style/dev-warning";
|
|
4
|
+
import { adwAvailable, requireAdwJsx } from "../gtkx/bridge/adw";
|
|
5
|
+
import { createRoot, Gtk, GtkApplication, GtkApplicationWindow, quit, } from "../gtkx/bridge/index";
|
|
4
6
|
import { Root } from "./root";
|
|
5
7
|
const registry = new Map();
|
|
6
8
|
// The chrome the running app was started with — read by the navigation
|
|
@@ -69,14 +71,36 @@ export const AppRegistry = {
|
|
|
69
71
|
const width = params.width ?? 800;
|
|
70
72
|
const height = params.height ?? 600;
|
|
71
73
|
const contentChrome = params.chrome === "content";
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
74
|
+
// What chrome: "content" actually gets: AdwApplicationWindow needs Adw
|
|
75
|
+
// itself, so a plain-GTK app (no "Adw-1" in gtkx.config.ts) falls back to
|
|
76
|
+
// exactly the "system" chrome path — same window type, same content
|
|
77
|
+
// wrapper — rather than throwing, per
|
|
78
|
+
// .claude/epics/adw-optional/002.md. The Adw profile is unaffected:
|
|
79
|
+
// adwAvailable() is true there, so useAdwChrome === contentChrome always,
|
|
80
|
+
// and every branch below takes the same route it did before this probe
|
|
81
|
+
// existed.
|
|
82
|
+
const useAdwChrome = contentChrome && adwAvailable();
|
|
83
|
+
activeChrome = useAdwChrome ? "content" : "system";
|
|
84
|
+
if (process.env.NODE_ENV !== "production" && params.breakpoints) {
|
|
85
|
+
if (!contentChrome) {
|
|
86
|
+
console.warn('[react-native-gtkx] breakpoints was passed to runApplication without chrome: "content" — GtkApplicationWindow (the "system" chrome default) has no breakpoints concept, so it is ignored.');
|
|
87
|
+
}
|
|
88
|
+
else if (!useAdwChrome) {
|
|
89
|
+
// Once, not every run: contentChrome apps in a long-lived dev loop
|
|
90
|
+
// (Fast Refresh) would otherwise re-warn on every reload.
|
|
91
|
+
warnOnce("app-registry:breakpoints-no-adw", '[react-native-gtkx] breakpoints was passed to runApplication with chrome: "content", but this app has no "Adw-1" in its gtkx.config.ts `libraries` — falling back to GtkApplicationWindow, which has no breakpoints concept, so it is ignored.');
|
|
92
|
+
}
|
|
77
93
|
}
|
|
78
|
-
const content =
|
|
79
|
-
|
|
94
|
+
const content = useAdwChrome ? (_jsx(ContentChrome, { App: App, initialProps: params.initialProps ?? {} })) : (_jsx(WindowContent, { App: App, initialProps: params.initialProps ?? {}, initialWidth: width, initialHeight: height }));
|
|
95
|
+
// Adw is reached ONLY here, and only when chrome: "content" was actually
|
|
96
|
+
// requested AND this app's codegen store actually has it — chrome:
|
|
97
|
+
// "system" (the default), and a plain-GTK app's chrome: "content", never
|
|
98
|
+
// touch it, which is what lets an app with no Adw-1 declared run at all
|
|
99
|
+
// (see .claude/epics/adw-optional/001.md and 002.md for the fallback).
|
|
100
|
+
const AppWindow = () => useAdwChrome ? ((() => {
|
|
101
|
+
const { AdwApplicationWindow } = requireAdwJsx('chrome: "content"');
|
|
102
|
+
return (_jsx(AdwApplicationWindow, { title: params.title ?? appKey, defaultWidth: width, defaultHeight: height, onCloseRequest: quit, actions: params.windowActions, controllers: params.windowControllers, breakpoints: params.breakpoints, children: content }));
|
|
103
|
+
})()) : (_jsx(GtkApplicationWindow, { title: params.title ?? appKey, defaultWidth: width, defaultHeight: height, onCloseRequest: quit, actions: params.windowActions, controllers: params.windowControllers, children: content }));
|
|
80
104
|
createRoot().render(_jsx(GtkApplication, { actions: params.applicationActions, actionAccels: params.actionAccels, children: _jsx(AppWindow, {}) }));
|
|
81
105
|
},
|
|
82
106
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app-registry.js","sourceRoot":"","sources":["../../src/components/app-registry.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,eAAe,EAAsC,MAAM,OAAO,CAAA;AAC3E,OAAO,EACL,oBAAoB,EACpB,UAAU,EACV,GAAG,EACH,cAAc,EACd,oBAAoB,EACpB,IAAI,GACL,MAAM,sBAAsB,CAAA;AAC7B,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAI7B,MAAM,QAAQ,GAAG,IAAI,GAAG,EAA6B,CAAA;AAErD,uEAAuE;AACvE,0EAA0E;AAC1E,0EAA0E;AAC1E,IAAI,YAAY,GAAgC,IAAI,CAAA;AACpD,MAAM,CAAC,MAAM,eAAe,GAAG,GAAgC,EAAE,CAAC,YAAY,CAAA;AAiE9E,4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AE,GAAG,EACR,YAAY,EAAE,MAAM,CAAC,YAAY,IAAI,EAAE,EACvC,YAAY,EAAE,KAAK,EACnB,aAAa,EAAE,MAAM,GACrB,CACH,CAAA;QAED,MAAM,SAAS,GAAG,GAAG,EAAE,CACrB,aAAa,CAAC,CAAC,CAAC,CACd,KAAC,oBAAoB,IACnB,KAAK,EAAE,MAAM,CAAC,KAAK,IAAI,MAAM,EAC7B,YAAY,EAAE,KAAK,EACnB,aAAa,EAAE,MAAM,EACrB,cAAc,EAAE,IAAI,EACpB,OAAO,EAAE,MAAM,CAAC,aAAa,EAC7B,WAAW,EAAE,MAAM,CAAC,iBAAiB,EACrC,WAAW,EAAE,MAAM,CAAC,WAAW,YAE9B,OAAO,GACa,CACxB,CAAC,CAAC,CAAC,CACF,KAAC,oBAAoB,IACnB,KAAK,EAAE,MAAM,CAAC,KAAK,IAAI,MAAM,EAC7B,YAAY,EAAE,KAAK,EACnB,aAAa,EAAE,MAAM,EACrB,cAAc,EAAE,IAAI,EACpB,OAAO,EAAE,MAAM,CAAC,aAAa,EAC7B,WAAW,EAAE,MAAM,CAAC,iBAAiB,YAEpC,OAAO,GACa,CACxB,CAAA;QAEH,UAAU,EAAE,CAAC,MAAM,CACjB,KAAC,cAAc,IACb,OAAO,EAAE,MAAM,CAAC,kBAAkB,EAClC,YAAY,EAAE,MAAM,CAAC,YAAY,YAEjC,KAAC,SAAS,KAAG,GACE,CAClB,CAAA;IACH,CAAC;CACF,CAAA","sourcesContent":["import { useLayoutEffect, type ComponentType, type ReactNode } from \"react\"\nimport {\n AdwApplicationWindow,\n createRoot,\n Gtk,\n GtkApplication,\n GtkApplicationWindow,\n quit,\n} from \"../gtkx/bridge/index\"\nimport { Root } from \"./root\"\n\ntype ComponentProvider = () => ComponentType<Record<string, unknown>>\n\nconst registry = new Map<string, ComponentProvider>()\n\n// The chrome the running app was started with — read by the navigation\n// dev-mode hint (a HeaderBar page under \"system\" chrome renders a doubled\n// titlebar). null until runApplication ran (test harnesses never set it).\nlet activeChrome: \"system\" | \"content\" | null = null\nexport const getActiveChrome = (): \"system\" | \"content\" | null => activeChrome\n\n// One accelerator binding on the GApplication — the shape GtkApplication's\n// own `actionAccels` prop takes, restated locally so this file needs\n// nothing from @gtkx/react/internal (the \"internal\" subpath is where the\n// real type lives, but nothing else in this package reaches for it).\nexport type ActionAccel = {\n detailedActionName: string\n accels: string[]\n}\n\nexport type RunApplicationParams = {\n initialProps?: Record<string, unknown>\n title?: string\n width?: number\n height?: number\n // Window chrome. \"system\" (default): a GtkApplicationWindow with its own\n // titlebar. \"content\": an AdwApplicationWindow with NO window titlebar —\n // the app's content provides HeaderBars (navigation apps: the page\n // HeaderBar becomes the titlebar, with the window controls in it).\n chrome?: \"system\" | \"content\"\n /**\n * GSimpleAction elements registered on the GApplication itself\n * (\"app.<name>\" — reachable from anywhere, including a Gio.Notification's\n * action buttons, which can only ever target an app-level action).\n *\n * @deprecated Render `<ApplicationActions>` (react-native-gtkx/gtk) inside\n * the app instead. Options render as SIBLINGS of the app tree, so no\n * context of the app's can reach them and the set is fixed for the\n * process's lifetime. Still supported; see docs/api.md.\n */\n applicationActions?: ReactNode\n // Keyboard accelerators bound to actions, at the application level —\n // GtkApplication's own actionAccels prop, unchanged. NOT deprecated with\n // the three ReactNode options below: this is a flat name→keys table with\n // no children and nothing to read from context, and it is deliberately\n // process-wide (an accelerator for an action that is not currently\n // registered simply does nothing). A shortcut that should come and go\n // with a screen is a GtkShortcutController in <WindowControllers>.\n actionAccels?: ActionAccel[]\n /**\n * GSimpleAction elements registered on the window (\"win.<name>\" — what a\n * HeaderBar button's actionName or a GMenu item usually targets).\n *\n * @deprecated Render `<WindowActions>` (react-native-gtkx/gtk) inside the\n * app instead — it can read the app's context and registers/unregisters\n * with the component that declares it. Still supported; see docs/api.md.\n */\n windowActions?: ReactNode\n /**\n * Event controllers attached to the window itself — a\n * GtkShortcutController scoped to the whole window is the common case.\n *\n * @deprecated Render `<WindowControllers>` (react-native-gtkx/gtk) inside\n * the app instead, for the same reasons as `windowActions`. Still\n * supported; see docs/api.md.\n */\n windowControllers?: ReactNode\n // AdwBreakpoint elements, evaluated against the window's own allocated\n // size. Only meaningful under chrome: \"content\" (AdwApplicationWindow) —\n // GtkApplicationWindow has no such concept, so this is ignored (with a\n // dev warning) under the default \"system\" chrome.\n breakpoints?: ReactNode\n}\n\n// RN parity: system \"reduce animations\" hints never auto-stop RN animations\n// (ActivityIndicator keeps spinning; honoring reduce-motion is an explicit\n// opt-in via AccessibilityInfo). Our Animated runs on GLib timers and already\n// ignores the hint, so GTK-internal animations (GtkSpinner, switch slides)\n// must behave the same — otherwise e.g. GNOME under software rendering\n// reports enable-animations=false through the settings portal and spinners\n// freeze while Animated keeps moving.\nlet animationsForced = false\nconst forceEnableAnimations = (): void => {\n if (animationsForced) {\n return\n }\n const settings = Gtk.Settings.getDefault()\n if (!settings) {\n return\n }\n animationsForced = true\n // Application-set GtkSettings values outrank the desktop backend, so a\n // later portal update cannot flip this back.\n settings.gtkEnableAnimations = true\n}\n\n// chrome \"content\": the app component IS the window content (a navigation\n// container whose pages host their own NestedRoots) — no window-level Yoga\n// root in between: the layout root would not allocate foreign GTK children.\nconst ContentChrome = ({\n App,\n initialProps,\n}: {\n App: ComponentType<Record<string, unknown>>\n initialProps: Record<string, unknown>\n}) => {\n useLayoutEffect(() => {\n forceEnableAnimations()\n }, [])\n return <App {...initialProps} />\n}\n\nconst WindowContent = ({\n App,\n initialProps,\n initialWidth,\n initialHeight,\n}: {\n App: ComponentType<Record<string, unknown>>\n initialProps: Record<string, unknown>\n initialWidth: number\n initialHeight: number\n}) => {\n // Settings need an initialized display, and writing them mid-render is\n // unsafe — apply after the window mounts.\n useLayoutEffect(() => {\n forceEnableAnimations()\n }, [])\n\n // The Root is the window's direct child: RnGtkxLayout reports a zero\n // minimum (the window shrinks freely — no ratchet) and adopts the actual\n // content-area allocation as the layout viewport. No scrollable wrapper\n // means a window can never scroll its own root — RN semantics, scrolling\n // stays opt-in via <ScrollView>.\n return (\n <Root\n width={initialWidth}\n height={initialHeight}\n followAllocation\n >\n <App {...initialProps} />\n </Root>\n )\n}\n\nexport const AppRegistry = {\n registerComponent(appKey: string, provider: ComponentProvider): string {\n registry.set(appKey, provider)\n return appKey\n },\n\n getAppKeys(): string[] {\n return [...registry.keys()]\n },\n\n runApplication(appKey: string, params: RunApplicationParams = {}): void {\n const provider = registry.get(appKey)\n if (!provider) {\n throw new Error(\n `AppRegistry: no component registered for \"${appKey}\". ` +\n `Registered: ${[...registry.keys()].join(\", \") || \"(none)\"}`,\n )\n }\n const App = provider()\n const width = params.width ?? 800\n const height = params.height ?? 600\n\n const contentChrome = params.chrome === \"content\"\n activeChrome = contentChrome ? \"content\" : \"system\"\n\n if (\n process.env.NODE_ENV !== \"production\" &&\n params.breakpoints &&\n !contentChrome\n ) {\n console.warn(\n '[react-native-gtkx] breakpoints was passed to runApplication without chrome: \"content\" — GtkApplicationWindow (the \"system\" chrome default) has no breakpoints concept, so it is ignored.',\n )\n }\n\n const content = contentChrome ? (\n <ContentChrome\n App={App}\n initialProps={params.initialProps ?? {}}\n />\n ) : (\n <WindowContent\n App={App}\n initialProps={params.initialProps ?? {}}\n initialWidth={width}\n initialHeight={height}\n />\n )\n\n const AppWindow = () =>\n contentChrome ? (\n <AdwApplicationWindow\n title={params.title ?? appKey}\n defaultWidth={width}\n defaultHeight={height}\n onCloseRequest={quit}\n actions={params.windowActions}\n controllers={params.windowControllers}\n breakpoints={params.breakpoints}\n >\n {content}\n </AdwApplicationWindow>\n ) : (\n <GtkApplicationWindow\n title={params.title ?? appKey}\n defaultWidth={width}\n defaultHeight={height}\n onCloseRequest={quit}\n actions={params.windowActions}\n controllers={params.windowControllers}\n >\n {content}\n </GtkApplicationWindow>\n )\n\n createRoot().render(\n <GtkApplication\n actions={params.applicationActions}\n actionAccels={params.actionAccels}\n >\n <AppWindow />\n </GtkApplication>,\n )\n },\n}\n"]}
|
|
1
|
+
{"version":3,"file":"app-registry.js","s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CAAC,mBAAmB,CAAC,CAAA;YACnE,OAAO,CACL,KAAC,oBAAoB,IACnB,KAAK,EAAE,MAAM,CAAC,KAAK,IAAI,MAAM,EAC7B,YAAY,EAAE,KAAK,EACnB,aAAa,EAAE,MAAM,EACrB,cAAc,EAAE,IAAI,EACpB,OAAO,EAAE,MAAM,CAAC,aAAa,EAC7B,WAAW,EAAE,MAAM,CAAC,iBAAiB,EACrC,WAAW,EAAE,MAAM,CAAC,WAAW,YAE9B,OAAO,GACa,CACxB,CAAA;QACH,CAAC,CAAC,EAAE,CACL,CAAC,CAAC,CAAC,CACF,KAAC,oBAAoB,IACnB,KAAK,EAAE,MAAM,CAAC,KAAK,IAAI,MAAM,EAC7B,YAAY,EAAE,KAAK,EACnB,aAAa,EAAE,MAAM,EACrB,cAAc,EAAE,IAAI,EACpB,OAAO,EAAE,MAAM,CAAC,aAAa,EAC7B,WAAW,EAAE,MAAM,CAAC,iBAAiB,YAEpC,OAAO,GACa,CACxB,CAAA;QAEH,UAAU,EAAE,CAAC,MAAM,CACjB,KAAC,cAAc,IACb,OAAO,EAAE,MAAM,CAAC,kBAAkB,EAClC,YAAY,EAAE,MAAM,CAAC,YAAY,YAEjC,KAAC,SAAS,KAAG,GACE,CAClB,CAAA;IACH,CAAC;CACF,CAAA","sourcesContent":["import { useLayoutEffect, type ComponentType, type ReactNode } from \"react\"\nimport { warnOnce } from \"../style/dev-warning\"\nimport { adwAvailable, requireAdwJsx } from \"../gtkx/bridge/adw\"\nimport {\n createRoot,\n Gtk,\n GtkApplication,\n GtkApplicationWindow,\n quit,\n} from \"../gtkx/bridge/index\"\nimport { Root } from \"./root\"\n\ntype ComponentProvider = () => ComponentType<Record<string, unknown>>\n\nconst registry = new Map<string, ComponentProvider>()\n\n// The chrome the running app was started with — read by the navigation\n// dev-mode hint (a HeaderBar page under \"system\" chrome renders a doubled\n// titlebar). null until runApplication ran (test harnesses never set it).\nlet activeChrome: \"system\" | \"content\" | null = null\nexport const getActiveChrome = (): \"system\" | \"content\" | null => activeChrome\n\n// One accelerator binding on the GApplication — the shape GtkApplication's\n// own `actionAccels` prop takes, restated locally so this file needs\n// nothing from @gtkx/react/internal (the \"internal\" subpath is where the\n// real type lives, but nothing else in this package reaches for it).\nexport type ActionAccel = {\n detailedActionName: string\n accels: string[]\n}\n\nexport type RunApplicationParams = {\n initialProps?: Record<string, unknown>\n title?: string\n width?: number\n height?: number\n // Window chrome. \"system\" (default): a GtkApplicationWindow with its own\n // titlebar. \"content\": an AdwApplicationWindow with NO window titlebar —\n // the app's content provides HeaderBars (navigation apps: the page\n // HeaderBar becomes the titlebar, with the window controls in it).\n // Plain-GTK profile (no \"Adw-1\" in this app's gtkx.config.ts): \"content\"\n // falls back to the same GtkApplicationWindow \"system\" uses — Adw is what\n // makes chrome: \"content\" work, not just this option — see adwAvailable()\n // in .claude/epics/adw-optional/002.md.\n chrome?: \"system\" | \"content\"\n /**\n * GSimpleAction elements registered on the GApplication itself\n * (\"app.<name>\" — reachable from anywhere, including a Gio.Notification's\n * action buttons, which can only ever target an app-level action).\n *\n * @deprecated Render `<ApplicationActions>` (react-native-gtkx/gtk) inside\n * the app instead. Options render as SIBLINGS of the app tree, so no\n * context of the app's can reach them and the set is fixed for the\n * process's lifetime. Still supported; see docs/api.md.\n */\n applicationActions?: ReactNode\n // Keyboard accelerators bound to actions, at the application level —\n // GtkApplication's own actionAccels prop, unchanged. NOT deprecated with\n // the three ReactNode options below: this is a flat name→keys table with\n // no children and nothing to read from context, and it is deliberately\n // process-wide (an accelerator for an action that is not currently\n // registered simply does nothing). A shortcut that should come and go\n // with a screen is a GtkShortcutController in <WindowControllers>.\n actionAccels?: ActionAccel[]\n /**\n * GSimpleAction elements registered on the window (\"win.<name>\" — what a\n * HeaderBar button's actionName or a GMenu item usually targets).\n *\n * @deprecated Render `<WindowActions>` (react-native-gtkx/gtk) inside the\n * app instead — it can read the app's context and registers/unregisters\n * with the component that declares it. Still supported; see docs/api.md.\n */\n windowActions?: ReactNode\n /**\n * Event controllers attached to the window itself — a\n * GtkShortcutController scoped to the whole window is the common case.\n *\n * @deprecated Render `<WindowControllers>` (react-native-gtkx/gtk) inside\n * the app instead, for the same reasons as `windowActions`. Still\n * supported; see docs/api.md.\n */\n windowControllers?: ReactNode\n // AdwBreakpoint elements, evaluated against the window's own allocated\n // size. Only meaningful under chrome: \"content\" WITH Adw actually present\n // (AdwApplicationWindow) — GtkApplicationWindow has no such concept, so\n // this is ignored (with a dev warning) under the default \"system\" chrome,\n // and equally ignored (with a different dev warning, once) when chrome:\n // \"content\" was requested but this app has no \"Adw-1\" declared.\n breakpoints?: ReactNode\n}\n\n// RN parity: system \"reduce animations\" hints never auto-stop RN animations\n// (ActivityIndicator keeps spinning; honoring reduce-motion is an explicit\n// opt-in via AccessibilityInfo). Our Animated runs on GLib timers and already\n// ignores the hint, so GTK-internal animations (GtkSpinner, switch slides)\n// must behave the same — otherwise e.g. GNOME under software rendering\n// reports enable-animations=false through the settings portal and spinners\n// freeze while Animated keeps moving.\nlet animationsForced = false\nconst forceEnableAnimations = (): void => {\n if (animationsForced) {\n return\n }\n const settings = Gtk.Settings.getDefault()\n if (!settings) {\n return\n }\n animationsForced = true\n // Application-set GtkSettings values outrank the desktop backend, so a\n // later portal update cannot flip this back.\n settings.gtkEnableAnimations = true\n}\n\n// chrome \"content\": the app component IS the window content (a navigation\n// container whose pages host their own NestedRoots) — no window-level Yoga\n// root in between: the layout root would not allocate foreign GTK children.\nconst ContentChrome = ({\n App,\n initialProps,\n}: {\n App: ComponentType<Record<string, unknown>>\n initialProps: Record<string, unknown>\n}) => {\n useLayoutEffect(() => {\n forceEnableAnimations()\n }, [])\n return <App {...initialProps} />\n}\n\nconst WindowContent = ({\n App,\n initialProps,\n initialWidth,\n initialHeight,\n}: {\n App: ComponentType<Record<string, unknown>>\n initialProps: Record<string, unknown>\n initialWidth: number\n initialHeight: number\n}) => {\n // Settings need an initialized display, and writing them mid-render is\n // unsafe — apply after the window mounts.\n useLayoutEffect(() => {\n forceEnableAnimations()\n }, [])\n\n // The Root is the window's direct child: RnGtkxLayout reports a zero\n // minimum (the window shrinks freely — no ratchet) and adopts the actual\n // content-area allocation as the layout viewport. No scrollable wrapper\n // means a window can never scroll its own root — RN semantics, scrolling\n // stays opt-in via <ScrollView>.\n return (\n <Root\n width={initialWidth}\n height={initialHeight}\n followAllocation\n >\n <App {...initialProps} />\n </Root>\n )\n}\n\nexport const AppRegistry = {\n registerComponent(appKey: string, provider: ComponentProvider): string {\n registry.set(appKey, provider)\n return appKey\n },\n\n getAppKeys(): string[] {\n return [...registry.keys()]\n },\n\n runApplication(appKey: string, params: RunApplicationParams = {}): void {\n const provider = registry.get(appKey)\n if (!provider) {\n throw new Error(\n `AppRegistry: no component registered for \"${appKey}\". ` +\n `Registered: ${[...registry.keys()].join(\", \") || \"(none)\"}`,\n )\n }\n const App = provider()\n const width = params.width ?? 800\n const height = params.height ?? 600\n\n const contentChrome = params.chrome === \"content\"\n // What chrome: \"content\" actually gets: AdwApplicationWindow needs Adw\n // itself, so a plain-GTK app (no \"Adw-1\" in gtkx.config.ts) falls back to\n // exactly the \"system\" chrome path — same window type, same content\n // wrapper — rather than throwing, per\n // .claude/epics/adw-optional/002.md. The Adw profile is unaffected:\n // adwAvailable() is true there, so useAdwChrome === contentChrome always,\n // and every branch below takes the same route it did before this probe\n // existed.\n const useAdwChrome = contentChrome && adwAvailable()\n activeChrome = useAdwChrome ? \"content\" : \"system\"\n\n if (process.env.NODE_ENV !== \"production\" && params.breakpoints) {\n if (!contentChrome) {\n console.warn(\n '[react-native-gtkx] breakpoints was passed to runApplication without chrome: \"content\" — GtkApplicationWindow (the \"system\" chrome default) has no breakpoints concept, so it is ignored.',\n )\n } else if (!useAdwChrome) {\n // Once, not every run: contentChrome apps in a long-lived dev loop\n // (Fast Refresh) would otherwise re-warn on every reload.\n warnOnce(\n \"app-registry:breakpoints-no-adw\",\n '[react-native-gtkx] breakpoints was passed to runApplication with chrome: \"content\", but this app has no \"Adw-1\" in its gtkx.config.ts `libraries` — falling back to GtkApplicationWindow, which has no breakpoints concept, so it is ignored.',\n )\n }\n }\n\n const content = useAdwChrome ? (\n <ContentChrome\n App={App}\n initialProps={params.initialProps ?? {}}\n />\n ) : (\n <WindowContent\n App={App}\n initialProps={params.initialProps ?? {}}\n initialWidth={width}\n initialHeight={height}\n />\n )\n\n // Adw is reached ONLY here, and only when chrome: \"content\" was actually\n // requested AND this app's codegen store actually has it — chrome:\n // \"system\" (the default), and a plain-GTK app's chrome: \"content\", never\n // touch it, which is what lets an app with no Adw-1 declared run at all\n // (see .claude/epics/adw-optional/001.md and 002.md for the fallback).\n const AppWindow = () =>\n useAdwChrome ? (\n (() => {\n const { AdwApplicationWindow } = requireAdwJsx('chrome: \"content\"')\n return (\n <AdwApplicationWindow\n title={params.title ?? appKey}\n defaultWidth={width}\n defaultHeight={height}\n onCloseRequest={quit}\n actions={params.windowActions}\n controllers={params.windowControllers}\n breakpoints={params.breakpoints}\n >\n {content}\n </AdwApplicationWindow>\n )\n })()\n ) : (\n <GtkApplicationWindow\n title={params.title ?? appKey}\n defaultWidth={width}\n defaultHeight={height}\n onCloseRequest={quit}\n actions={params.windowActions}\n controllers={params.windowControllers}\n >\n {content}\n </GtkApplicationWindow>\n )\n\n createRoot().render(\n <GtkApplication\n actions={params.applicationActions}\n actionAccels={params.actionAccels}\n >\n <AppWindow />\n </GtkApplication>,\n )\n },\n}\n"]}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { FrameScheduler } from "../animated/index";
|
|
2
|
+
declare global {
|
|
3
|
+
function requestAnimationFrame(callback: (time: number) => void): number;
|
|
4
|
+
function cancelAnimationFrame(handle: number | null | undefined): void;
|
|
5
|
+
}
|
|
6
|
+
export type RequestAnimationFrame = (callback: (time: number) => void) => number;
|
|
7
|
+
export type CancelAnimationFrame = (handle: number | null | undefined) => void;
|
|
8
|
+
export type RequestAnimationFramePair = {
|
|
9
|
+
requestAnimationFrame: RequestAnimationFrame;
|
|
10
|
+
cancelAnimationFrame: CancelAnimationFrame;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Pure factory over an injected `FrameScheduler` — the part a test drives
|
|
14
|
+
* directly, without touching `globalThis`. Every request made before a
|
|
15
|
+
* batch flushes lands in that SAME batch and gets the SAME timestamp
|
|
16
|
+
* (rAF's usual "one paint, one time" contract); a request made from inside
|
|
17
|
+
* a running callback is queued fresh and therefore always lands one batch
|
|
18
|
+
* later, because the batch already in flight was taken off `pending` before
|
|
19
|
+
* the first callback in it ran.
|
|
20
|
+
*/
|
|
21
|
+
export declare const createRequestAnimationFrame: (scheduler: FrameScheduler) => RequestAnimationFramePair;
|
|
22
|
+
/**
|
|
23
|
+
* Installs requestAnimationFrame/cancelAnimationFrame as globals, running
|
|
24
|
+
* the batch above off `scheduler`. Called once from the package entry
|
|
25
|
+
* (src/index.ts) with the real `glibScheduler` — every app importing
|
|
26
|
+
* "react-native" (aliased here) pulls it in before any of its own code
|
|
27
|
+
* runs, on both toolchains, the same way InitializeCore would have.
|
|
28
|
+
* Idempotent, because `installed` is module state: re-importing the entry
|
|
29
|
+
* module a second time in the same process must not orphan whatever the
|
|
30
|
+
* first install has already queued behind a fresh, disconnected id
|
|
31
|
+
* namespace.
|
|
32
|
+
*/
|
|
33
|
+
export declare const installGlobalRequestAnimationFrame: (scheduler: FrameScheduler) => void;
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pure factory over an injected `FrameScheduler` — the part a test drives
|
|
3
|
+
* directly, without touching `globalThis`. Every request made before a
|
|
4
|
+
* batch flushes lands in that SAME batch and gets the SAME timestamp
|
|
5
|
+
* (rAF's usual "one paint, one time" contract); a request made from inside
|
|
6
|
+
* a running callback is queued fresh and therefore always lands one batch
|
|
7
|
+
* later, because the batch already in flight was taken off `pending` before
|
|
8
|
+
* the first callback in it ran.
|
|
9
|
+
*/
|
|
10
|
+
export const createRequestAnimationFrame = (scheduler) => {
|
|
11
|
+
let nextHandle = 1;
|
|
12
|
+
let pending = new Map();
|
|
13
|
+
let unbook = null;
|
|
14
|
+
const flush = (time) => {
|
|
15
|
+
unbook = null;
|
|
16
|
+
// Snapshot-then-clear: a callback that re-requests itself — every
|
|
17
|
+
// rAF-driven animation loop does exactly that — must land in the batch
|
|
18
|
+
// that starts empty again below, not in the one currently running.
|
|
19
|
+
const batch = pending;
|
|
20
|
+
pending = new Map();
|
|
21
|
+
for (const callback of batch.values()) {
|
|
22
|
+
try {
|
|
23
|
+
callback(time);
|
|
24
|
+
}
|
|
25
|
+
catch (error) {
|
|
26
|
+
// One throwing callback does not take its siblings down with it:
|
|
27
|
+
// browsers report the exception and keep running the rest of the
|
|
28
|
+
// batch, and RN's own JSTimers wraps each callback in its own
|
|
29
|
+
// try/catch for the same reason. See docs/api.md.
|
|
30
|
+
console.error("[react-native-gtkx] requestAnimationFrame callback threw:", error);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
const requestAnimationFrame = (callback) => {
|
|
35
|
+
const handle = nextHandle++;
|
|
36
|
+
pending.set(handle, callback);
|
|
37
|
+
// Only the FIRST request in an otherwise-empty queue books a frame —
|
|
38
|
+
// every other one rides the booking already pending, so N calls in the
|
|
39
|
+
// same tick cost one scheduler subscription, not N.
|
|
40
|
+
if (unbook === null) {
|
|
41
|
+
unbook = scheduler.schedule(flush);
|
|
42
|
+
}
|
|
43
|
+
return handle;
|
|
44
|
+
};
|
|
45
|
+
const cancelAnimationFrame = (handle) => {
|
|
46
|
+
// `null`/`undefined` — an unset ref, the common cleanup shape — is a
|
|
47
|
+
// silent no-op, the same as an unknown or already-delivered handle.
|
|
48
|
+
if (handle == null) {
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
pending.delete(handle);
|
|
52
|
+
// No idle tick once the last pending callback is gone — mirrors
|
|
53
|
+
// animated/frame-loop.ts's stop(), same reason: a booking held for
|
|
54
|
+
// nothing is a tick nobody asked for.
|
|
55
|
+
if (pending.size === 0 && unbook !== null) {
|
|
56
|
+
unbook();
|
|
57
|
+
unbook = null;
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
return { requestAnimationFrame, cancelAnimationFrame };
|
|
61
|
+
};
|
|
62
|
+
let installed = false;
|
|
63
|
+
/**
|
|
64
|
+
* Installs requestAnimationFrame/cancelAnimationFrame as globals, running
|
|
65
|
+
* the batch above off `scheduler`. Called once from the package entry
|
|
66
|
+
* (src/index.ts) with the real `glibScheduler` — every app importing
|
|
67
|
+
* "react-native" (aliased here) pulls it in before any of its own code
|
|
68
|
+
* runs, on both toolchains, the same way InitializeCore would have.
|
|
69
|
+
* Idempotent, because `installed` is module state: re-importing the entry
|
|
70
|
+
* module a second time in the same process must not orphan whatever the
|
|
71
|
+
* first install has already queued behind a fresh, disconnected id
|
|
72
|
+
* namespace.
|
|
73
|
+
*/
|
|
74
|
+
export const installGlobalRequestAnimationFrame = (scheduler) => {
|
|
75
|
+
if (installed) {
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
installed = true;
|
|
79
|
+
const pair = createRequestAnimationFrame(scheduler);
|
|
80
|
+
globalThis.requestAnimationFrame = pair.requestAnimationFrame;
|
|
81
|
+
globalThis.cancelAnimationFrame = pair.cancelAnimationFrame;
|
|
82
|
+
};
|
|
83
|
+
//# sourceMappingURL=request-animation-frame.js.map
|