react-native-gtkx 0.2.0-alpha.1 → 0.2.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 +11 -2
- package/dist/adw/widgets.generated.d.ts +4 -4
- package/dist/adw/widgets.generated.js +51 -51
- 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/index.d.ts +2 -0
- package/dist/animated/index.js +1 -0
- package/dist/animated/index.js.map +1 -1
- package/dist/animated/value-xy.d.ts +41 -0
- package/dist/animated/value-xy.js +90 -0
- package/dist/animated/value-xy.js.map +1 -0
- package/dist/animated/value.d.ts +9 -0
- package/dist/animated/value.js +30 -2
- package/dist/animated/value.js.map +1 -1
- package/dist/common/icon.d.ts +23 -0
- package/dist/common/icon.js +14 -0
- package/dist/common/icon.js.map +1 -0
- package/dist/common/index.d.ts +2 -0
- package/dist/common/index.js +2 -0
- package/dist/common/index.js.map +1 -1
- package/dist/common/list.d.ts +82 -0
- package/dist/common/list.js +166 -0
- package/dist/common/list.js.map +1 -0
- package/dist/common/widget.d.ts +1 -22
- package/dist/common/widget.js +75 -8
- package/dist/common/widget.js.map +1 -1
- package/dist/components/animated.d.ts +4 -2
- package/dist/components/animated.js +3 -1
- package/dist/components/animated.js.map +1 -1
- package/dist/components/app-registry.d.ts +26 -0
- package/dist/components/app-registry.js.map +1 -1
- package/dist/components/host-node.d.ts +7 -0
- package/dist/components/host-node.js +26 -1
- package/dist/components/host-node.js.map +1 -1
- package/dist/components/index.d.ts +6 -2
- package/dist/components/index.js +2 -1
- package/dist/components/index.js.map +1 -1
- package/dist/components/measure.d.ts +13 -0
- package/dist/components/measure.js +51 -0
- package/dist/components/measure.js.map +1 -0
- package/dist/components/modal.d.ts +1 -1
- package/dist/components/press-event.d.ts +28 -0
- package/dist/components/press-event.js +46 -0
- package/dist/components/press-event.js.map +1 -0
- package/dist/components/pressable.d.ts +2 -6
- package/dist/components/pressable.js +14 -8
- package/dist/components/pressable.js.map +1 -1
- package/dist/components/scroll-view.d.ts +4 -0
- package/dist/components/scroll-view.js +8 -2
- package/dist/components/scroll-view.js.map +1 -1
- package/dist/components/text-input.js +1 -1
- package/dist/components/text-input.js.map +1 -1
- package/dist/components/text.js +25 -1
- package/dist/components/text.js.map +1 -1
- package/dist/components/use-layout-child.js +17 -14
- package/dist/components/use-layout-child.js.map +1 -1
- package/dist/components/view.d.ts +9 -4
- package/dist/components/view.js +8 -2
- package/dist/components/view.js.map +1 -1
- package/dist/contracts.d.ts +19 -3
- package/dist/contracts.js.map +1 -1
- package/dist/gtk/index.d.ts +2 -1
- package/dist/gtk/index.js +8 -1
- package/dist/gtk/index.js.map +1 -1
- package/dist/gtk/widgets.generated.d.ts +14 -14
- package/dist/gtk/widgets.generated.js +101 -102
- package/dist/gtk/widgets.generated.js.map +1 -1
- package/dist/gtk/window-actions.d.ts +77 -0
- package/dist/gtk/window-actions.js +193 -0
- package/dist/gtk/window-actions.js.map +1 -0
- package/dist/gtkx/bridge/geometry.d.ts +15 -0
- package/dist/gtkx/bridge/geometry.js +38 -0
- package/dist/gtkx/bridge/geometry.js.map +1 -0
- package/dist/gtkx/bridge/index.d.ts +2 -0
- package/dist/gtkx/bridge/index.js +7 -2
- package/dist/gtkx/bridge/index.js.map +1 -1
- package/dist/gtkx/bridge/slot-portal.d.ts +12 -0
- package/dist/gtkx/bridge/slot-portal.js +17 -0
- package/dist/gtkx/bridge/slot-portal.js.map +1 -0
- package/dist/gtkx/bridge/svg-node.js +10 -54
- package/dist/gtkx/bridge/svg-node.js.map +1 -1
- package/dist/gtkx/bridge/use-signal.js +2 -2
- package/dist/gtkx/bridge/use-signal.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/mcp/data/generated.d.ts +99 -77
- package/dist/mcp/data/generated.js +107 -76
- package/dist/mcp/data/generated.js.map +1 -1
- package/dist/mcp/server.js +1 -1
- package/dist/mcp/server.js.map +1 -1
- package/dist/navigation/sidebar.d.ts +31 -1
- package/dist/navigation/sidebar.js +12 -2
- package/dist/navigation/sidebar.js.map +1 -1
- package/dist/responder/system.d.ts +27 -0
- package/dist/responder/system.js +184 -0
- package/dist/responder/system.js.map +1 -0
- package/dist/responder/touch-history.d.ts +10 -0
- package/dist/responder/touch-history.js +78 -0
- package/dist/responder/touch-history.js.map +1 -0
- package/dist/responder/types.d.ts +63 -0
- package/dist/responder/types.js +29 -0
- package/dist/responder/types.js.map +1 -0
- package/dist/responder/use-responder.d.ts +12 -0
- package/dist/responder/use-responder.js +98 -0
- package/dist/responder/use-responder.js.map +1 -0
- package/dist/runner/host-dev.js +3 -1
- package/dist/runner/host-dev.js.map +1 -1
- package/dist/runner/host.js +5 -1
- package/dist/runner/host.js.map +1 -1
- package/dist/runner/index.js +1 -1
- package/dist/runner/index.js.map +1 -1
- package/dist/sea/gtkx-config-module.js +1 -1
- package/dist/sea/gtkx-config-module.js.map +1 -1
- package/dist/style/box-shadow.d.ts +7 -0
- package/dist/style/box-shadow.js +197 -0
- package/dist/style/box-shadow.js.map +1 -0
- package/dist/style/index.d.ts +2 -0
- package/dist/style/index.js +2 -0
- package/dist/style/index.js.map +1 -1
- package/dist/style/split-style.d.ts +5 -2
- package/dist/style/split-style.js +31 -3
- package/dist/style/split-style.js.map +1 -1
- package/dist/style/text-decoration.d.ts +15 -0
- package/dist/style/text-decoration.js +26 -0
- package/dist/style/text-decoration.js.map +1 -0
- package/dist/style/visual-css.js +37 -1
- package/dist/style/visual-css.js.map +1 -1
- package/dist/svg/gradient-geometry.js +2 -5
- package/dist/svg/gradient-geometry.js.map +1 -1
- package/dist/testing/index.js.map +1 -1
- package/dist/vendor/react-native/pan-responder.d.ts +102 -0
- package/dist/vendor/react-native/pan-responder.js +196 -0
- package/dist/vendor/react-native/pan-responder.js.map +1 -0
- package/dist/vendor/react-native/touch-history-math.d.ts +18 -0
- package/dist/vendor/react-native/touch-history-math.js +102 -0
- package/dist/vendor/react-native/touch-history-math.js.map +1 -0
- package/dist/vite/index.js +1 -1
- package/dist/vite/index.js.map +1 -1
- package/dist/vitest/index.d.ts +1 -1
- package/dist/vitest/index.js.map +1 -1
- package/package.json +9 -9
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"window-actions.js","sourceRoot":"","sources":["../../src/gtk/window-actions.tsx"],"names":[],"mappings":";AAAA,0EAA0E;AAC1E,EAAE;AACF,sEAAsE;AACtE,2EAA2E;AAC3E,2EAA2E;AAC3E,0EAA0E;AAC1E,4EAA4E;AAC5E,0EAA0E;AAC1E,4BAA4B;AAC5B,EAAE;AACF,2EAA2E;AAC3E,oEAAoE;AACpE,2EAA2E;AAC3E,uEAAuE;AACvE,8CAA8C;AAC9C,EAAE;AACF,4EAA4E;AAC5E,wEAAwE;AACxE,yEAAyE;AACzE,2EAA2E;AAC3E,2EAA2E;AAC3E,mCAAmC;AACnC,OAAO,EACL,aAAa,EACb,WAAW,EACX,UAAU,EACV,OAAO,EACP,MAAM,EACN,oBAAoB,GAGrB,MAAM,OAAO,CAAA;AACd,OAAO,EACL,gBAAgB,EAChB,aAAa,IAAI,gBAAgB,EACjC,cAAc,EACd,eAAe,GAChB,MAAM,sBAAsB,CAAA;AAe7B,MAAM,kBAAkB,GAAG,aAAa,CAAqB,IAAI,CAAC,CAAA;AAOlE,wEAAwE;AACxE,yCAAyC;AACzC,MAAM,aAAa,GAA8C,IAAI,OAAO,EAAE,CAAA;AAE9E,MAAM,QAAQ,GAAG,CAAC,MAAc,EAAE,IAAY,EAAe,EAAE;IAC7D,IAAI,KAAK,GAAG,aAAa,CAAC,GAAG,CAAC,MAAM,CAAC,CAAA;IACrC,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,KAAK,GAAG,IAAI,GAAG,EAAE,CAAA;QACjB,aAAa,CAAC,GAAG,CAAC,MAAM,EAAE,K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AACH,CAAC,CAAA;AAOD;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,EAAE,QAAQ,EAA0B,EAAE,EAAE;IACxE,MAAM,MAAM,GAAG,eAAe,EAAE,CAAA;IAChC,IAAI,MAAM,KAAK,IAAI,EAAE,CAAC;QACpB,OAAO,IAAI,CAAA;IACb,CAAC;IACD,OAAO,gBAAgB,CAAC,QAAQ,EAAE,MAAM,EAAE,aAAa,CAAC,CAAA;AAC1D,CAAC,CAAA","sourcesContent":["// Window and application actions declared IN the app tree, not around it.\n//\n// `AppRegistry.runApplication`'s `windowActions`/`windowControllers`/\n// `applicationActions` options build their children as props of the window\n// AppRegistry creates — SIBLINGS of the app's own tree. Nothing inside the\n// app is above them, so no context of the app's reaches them: a `win.new`\n// action could not read a React context store, and `examples/tasks-nav` had\n// to rewrite its store as a module-level external one before Ctrl+N could\n// see any app state at all.\n//\n// These components invert that. They are portals in React's own sense: the\n// children stay where they are written — inside whatever providers,\n// navigators and screens surround them, with their own state and effects —\n// while the registration lands on the window or the application. Three\n// things follow, and all three are the point:\n//\n// - context works, because the declaration IS a descendant of its provider;\n// - registration is dynamic: an action is added when the component that\n// needs it mounts and removed when it unmounts, so a single screen can\n// own its own actions instead of the process owning all of them forever;\n// - it composes: two unrelated subtrees can each declare their own without\n// meeting in one options object.\nimport {\n createContext,\n useCallback,\n useContext,\n useMemo,\n useRef,\n useSyncExternalStore,\n type ComponentProps,\n type ReactNode,\n} from \"react\"\nimport {\n createSlotPortal,\n GSimpleAction as GtkxSimpleAction,\n useApplication,\n useParentWindow,\n} from \"../gtkx/bridge/index\"\n\n/**\n * The action map an enclosing {@link WindowActions} / {@link ApplicationActions}\n * registers into, plus the GTK prefix its children answer to. Carried through\n * React context, so a `GSimpleAction` nested arbitrarily deep — inside a\n * component of the app's own, not just as a direct child — still finds it.\n */\ntype ActionScope = {\n /** The `Gio.ActionMap` (a window or the application). Registry key, too. */\n target: object\n /** \"win\" or \"app\": what an `actionName` has to say to reach these. */\n prefix: string\n}\n\nconst ActionScopeContext = createContext<ActionScope | null>(null)\n\n// One live claim on one action name. `notify` is the claimant's own\n// useSyncExternalStore callback, so the registry can tell the next in line\n// that the name has come free.\ntype NameClaim = { notify: () => void }\n\n// Claims per action map, in mount order. A WeakMap so a closed window's\n// bookkeeping goes away with the window.\nconst claimsByScope: WeakMap<object, Map<string, NameClaim[]>> = new WeakMap()\n\nconst queueFor = (target: object, name: string): NameClaim[] => {\n let names = claimsByScope.get(target)\n if (!names) {\n names = new Map()\n claimsByScope.set(target, names)\n }\n let queue = names.get(name)\n if (!queue) {\n queue = []\n names.set(name, queue)\n }\n return queue\n}\n\n/**\n * Arbitrates one action name inside one scope, and answers \"may I register?\".\n *\n * FIRST DECLARATION WINS, and a second one is ignored with a development\n * warning. That is not a coin toss between first and last: `Gio.ActionMap`\n * is name-keyed on BOTH ends — `addAction` replaces a same-named action\n * silently, and `removeAction` takes a NAME, not the action object. So with\n * \"last wins\" the first unmount of either declaration removes whatever\n * currently answers to that name, leaving the other one mounted but dead.\n * First-wins is the only order in which release always happens before\n * acquire: the loser never registers at all, and when the winner unmounts\n * (removing its own action, correctly) the next claimant is notified and\n * registers afterwards, in a later commit.\n *\n * The claim queue is an external store, so it is read as one: the claim is\n * made when React subscribes and dropped when it unsubscribes, which is also\n * what puts the hand-off after the departing owner's own deregistration\n * rather than racing it.\n *\n * With no scope (a `GSimpleAction` handed to `<GtkApplicationWindow\n * actions={…}>` directly, the pre-existing path) there is nothing to\n * arbitrate and the action always renders.\n */\nconst useIsNameOwner = (scope: ActionScope | null, name: string): boolean => {\n const claimRef = useRef<NameClaim | null>(null)\n\n const subscribe = useCallback(\n (notify: () => void) => {\n if (scope === null) {\n return () => undefined\n }\n const queue = queueFor(scope.target, name)\n const claim: NameClaim = { notify }\n queue.push(claim)\n claimRef.current = claim\n\n if (queue.length > 1 && process.env.NODE_ENV !== \"production\") {\n console.warn(\n `[react-native-gtkx] the action \"${scope.prefix}.${name}\" is declared by ${queue.length} mounted components at once. ` +\n `The first one to mount stays registered and this one is ignored — GTK removes an action by NAME, so letting the ` +\n `newest win would let whichever declaration unmounts first take the name down with it. Give them distinct names, ` +\n `or move the declaration to one place both can reach.`,\n )\n }\n\n return () => {\n const index = queue.indexOf(claim)\n claimRef.current = null\n if (index === -1) {\n return\n }\n const wasOwner = index === 0\n queue.splice(index, 1)\n if (wasOwner) {\n queue[0]?.notify()\n }\n }\n },\n [scope, name],\n )\n\n const getSnapshot = useCallback(() => {\n if (scope === null) {\n return true\n }\n const claim = claimRef.current\n return claim !== null && queueFor(scope.target, name)[0] === claim\n }, [scope, name])\n\n return useSyncExternalStore(subscribe, getSnapshot)\n}\n\nexport type GSimpleActionProps = ComponentProps<typeof GtkxSimpleAction>\n\n/**\n * A `Gio.SimpleAction`, declared as an element.\n *\n * Identical to gtkx's own element except for one thing: inside\n * {@link WindowActions} or {@link ApplicationActions} it takes part in name\n * arbitration, so two subtrees declaring the same action name produce a\n * warning and a predictable winner instead of a name that the first unmount\n * silently kills. Outside them it renders exactly as before.\n */\nexport const GSimpleAction = (props: GSimpleActionProps) => {\n const scope = useContext(ActionScopeContext)\n const name = typeof props.name === \"string\" ? props.name : \"\"\n const isOwner = useIsNameOwner(scope, name)\n return isOwner ? <GtkxSimpleAction {...props} /> : null\n}\n\nexport type WindowActionsProps = {\n /** `GSimpleAction` elements, or any components that render them. */\n children?: ReactNode\n}\n\n/**\n * Registers its children as actions on the WINDOW — the `win.` prefix a\n * HeaderBar button's `actionName`, a `GMenu` item or an `actionAccels` entry\n * targets.\n *\n * Render it anywhere in the app tree; the children are registered on the\n * window that encloses them and unregistered when this component unmounts.\n *\n * ```tsx\n * const NewTaskAction = () => {\n * const { addTask } = useStore() // an ordinary React context store\n * return (\n * <WindowActions>\n * <GSimpleAction name=\"new\" onActivate={() => addTask()} />\n * </WindowActions>\n * )\n * }\n * ```\n *\n * Inside a `Modal` the enclosing window is the MODAL's window, so the\n * actions belong to it and go away with it — which is usually what a dialog\n * wants, and worth knowing when it is not.\n */\nexport const WindowActions = ({ children }: WindowActionsProps) => {\n const window = useParentWindow()\n const scope = useMemo(\n () => (window === null ? null : { target: window, prefix: \"win\" }),\n [window],\n )\n // Null for exactly one commit: the window object reaches context through\n // state, so the app's first render happens before it is known.\n if (window === null || scope === null) {\n return null\n }\n return (\n <ActionScopeContext.Provider value={scope}>\n {createSlotPortal(children, window, \"actions\")}\n </ActionScopeContext.Provider>\n )\n}\n\nexport type ApplicationActionsProps = {\n /** `GSimpleAction` elements, or any components that render them. */\n children?: ReactNode\n}\n\n/**\n * Registers its children as actions on the APPLICATION — the `app.` prefix.\n *\n * The same component as {@link WindowActions} against a different action\n * map, and the two are not interchangeable: a `Gio.Notification`'s action\n * button can only ever activate an application action, and an application\n * action outlives any one window. Which prefix an `actionName=` has to say\n * is decided by which of the two you write, deliberately — a prop that\n * silently moved every child between prefixes would be a good way to spend\n * an hour wondering why a button is insensitive.\n */\nexport const ApplicationActions = ({ children }: ApplicationActionsProps) => {\n const application = useApplication()\n const scope = useMemo(\n () =>\n application === null ? null : { target: application, prefix: \"app\" },\n [application],\n )\n if (application === null || scope === null) {\n return null\n }\n return (\n <ActionScopeContext.Provider value={scope}>\n {createSlotPortal(children, application, \"actions\")}\n </ActionScopeContext.Provider>\n )\n}\n\nexport type WindowControllersProps = {\n /** `Gtk.EventController` elements — `GtkShortcutController` above all. */\n children?: ReactNode\n}\n\n/**\n * Attaches its children as event controllers on the WINDOW: a\n * `GtkShortcutController` with `scope={Gtk.ShortcutScope.GLOBAL}` is the\n * reason this exists — window-wide keyboard shortcuts, declared by the\n * screen they belong to and gone when it leaves.\n *\n * Deliberately a different component from {@link WindowActions} rather than\n * one that sorts its children: controllers land on the window as a WIDGET\n * (`addController`/`removeController`, keyed by the controller object)\n * while actions land on it as a `Gio.ActionMap` (keyed by name). Different\n * children, different GObject interfaces, and — as the name arbitration\n * above shows — different duplicate semantics. One component sniffing each\n * child's type to pick a slot would fail silently on a wrong child; two\n * components fail at the type level instead.\n */\nexport const WindowControllers = ({ children }: WindowControllersProps) => {\n const window = useParentWindow()\n if (window === null) {\n return null\n }\n return createSlotPortal(children, window, \"controllers\")\n}\n"]}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type * as Gtk from "@gtkx/gi/gtk";
|
|
2
|
+
export type Point = {
|
|
3
|
+
x: number;
|
|
4
|
+
y: number;
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* Translates a point from `widget`'s coordinates into `target`'s.
|
|
8
|
+
* Returns null when the two are not in the same widget hierarchy.
|
|
9
|
+
*/
|
|
10
|
+
export declare const computePointIn: (widget: Gtk.Widget, target: Gtk.Widget, x: number, y: number) => Point | null;
|
|
11
|
+
/**
|
|
12
|
+
* Translates a point from `widget`'s coordinates into its toplevel's — RN's
|
|
13
|
+
* "page" space. Returns null for a widget that is not in a window yet.
|
|
14
|
+
*/
|
|
15
|
+
export declare const computePointInWindow: (widget: Gtk.Widget, x: number, y: number) => Point | null;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
// Widget geometry in foreign coordinate spaces — what RN's measure()/
|
|
2
|
+
// measureInWindow()/measureLayout() and an event's pageX/pageY need.
|
|
3
|
+
//
|
|
4
|
+
// GTK4 folds a widget's allocated position into its transform relative to
|
|
5
|
+
// its parent, so there is no globally meaningful x/y to read off a widget:
|
|
6
|
+
// the position only exists as an answer to "in whose coordinates?".
|
|
7
|
+
// gtk_widget_compute_point() walks that transform chain, which is also why
|
|
8
|
+
// it comes out right inside a scrolled viewport — GtkViewport allocates its
|
|
9
|
+
// child at -adjustment.value, so the scroll offset IS the child's transform.
|
|
10
|
+
//
|
|
11
|
+
// gtk_widget_translate_coordinates() and gtk_widget_get_allocation() do the
|
|
12
|
+
// same job and are deprecated since GTK 4.12; compute_point/compute_bounds
|
|
13
|
+
// are the replacements. Both can legitimately fail (no common ancestor, an
|
|
14
|
+
// unrealized widget, a singular transform) — every helper here returns null
|
|
15
|
+
// rather than a plausible-looking zero.
|
|
16
|
+
import * as Graphene from "@gtkx/gi/graphene";
|
|
17
|
+
// Graphene.Point's constructor takes plain scalars, so it does not hit the
|
|
18
|
+
// nested-boxed-struct crash that Graphene.Rect's does (RC2-WORKAROUND
|
|
19
|
+
// graphene-rect-nested-boxed-props, docs/gtkx-rc2-notes.md) — but alloc+init
|
|
20
|
+
// is the shape already proven in svg-node.ts, so use it here too.
|
|
21
|
+
const point = (x, y) => Graphene.Point.alloc().init(x, y);
|
|
22
|
+
/**
|
|
23
|
+
* Translates a point from `widget`'s coordinates into `target`'s.
|
|
24
|
+
* Returns null when the two are not in the same widget hierarchy.
|
|
25
|
+
*/
|
|
26
|
+
export const computePointIn = (widget, target, x, y) => {
|
|
27
|
+
const [ok, translated] = widget.computePoint(target, point(x, y));
|
|
28
|
+
return ok ? { x: translated.x, y: translated.y } : null;
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* Translates a point from `widget`'s coordinates into its toplevel's — RN's
|
|
32
|
+
* "page" space. Returns null for a widget that is not in a window yet.
|
|
33
|
+
*/
|
|
34
|
+
export const computePointInWindow = (widget, x, y) => {
|
|
35
|
+
const root = widget.getRoot();
|
|
36
|
+
return root ? computePointIn(widget, root, x, y) : null;
|
|
37
|
+
};
|
|
38
|
+
//# sourceMappingURL=geometry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"geometry.js","sourceRoot":"","sources":["../../../src/gtkx/bridge/geometry.ts"],"names":[],"mappings":"AAAA,sEAAsE;AACtE,qEAAqE;AACrE,EAAE;AACF,0EAA0E;AAC1E,2EAA2E;AAC3E,oEAAoE;AACpE,2EAA2E;AAC3E,4EAA4E;AAC5E,6EAA6E;AAC7E,EAAE;AACF,4EAA4E;AAC5E,2EAA2E;AAC3E,2EAA2E;AAC3E,4EAA4E;AAC5E,wCAAwC;AACxC,OAAO,KAAK,QAAQ,MAAM,mBAAmB,CAAA;AAK7C,2EAA2E;AAC3E,sEAAsE;AACtE,6EAA6E;AAC7E,kEAAkE;AAClE,MAAM,KAAK,GAAG,CAAC,CAAS,EAAE,CAAS,EAAkB,EAAE,CACrD,QAAQ,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;AAEnC;;;GAGG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,CAC5B,MAAkB,EAClB,MAAkB,EAClB,CAAS,EACT,CAAS,EACK,EAAE;IAChB,MAAM,CAAC,EAAE,EAAE,UAAU,CAAC,GAAG,MAAM,CAAC,YAAY,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAA;IACjE,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,UAAU,CAAC,CAAC,EAAE,CAAC,EAAE,UAAU,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAA;AACzD,CAAC,CAAA;AAED;;;GAGG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAClC,MAAkB,EAClB,CAAS,EACT,CAAS,EACK,EAAE;IAChB,MAAM,IAAI,GAAG,MAAM,CAAC,OAAO,EAAE,CAAA;IAC7B,OAAO,IAAI,CAAC,CAAC,CAAC,cAAc,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAA;AACzD,CAAC,CAAA","sourcesContent":["// Widget geometry in foreign coordinate spaces — what RN's measure()/\n// measureInWindow()/measureLayout() and an event's pageX/pageY need.\n//\n// GTK4 folds a widget's allocated position into its transform relative to\n// its parent, so there is no globally meaningful x/y to read off a widget:\n// the position only exists as an answer to \"in whose coordinates?\".\n// gtk_widget_compute_point() walks that transform chain, which is also why\n// it comes out right inside a scrolled viewport — GtkViewport allocates its\n// child at -adjustment.value, so the scroll offset IS the child's transform.\n//\n// gtk_widget_translate_coordinates() and gtk_widget_get_allocation() do the\n// same job and are deprecated since GTK 4.12; compute_point/compute_bounds\n// are the replacements. Both can legitimately fail (no common ancestor, an\n// unrealized widget, a singular transform) — every helper here returns null\n// rather than a plausible-looking zero.\nimport * as Graphene from \"@gtkx/gi/graphene\"\nimport type * as Gtk from \"@gtkx/gi/gtk\"\n\nexport type Point = { x: number; y: number }\n\n// Graphene.Point's constructor takes plain scalars, so it does not hit the\n// nested-boxed-struct crash that Graphene.Rect's does (RC2-WORKAROUND\n// graphene-rect-nested-boxed-props, docs/gtkx-rc2-notes.md) — but alloc+init\n// is the shape already proven in svg-node.ts, so use it here too.\nconst point = (x: number, y: number): Graphene.Point =>\n Graphene.Point.alloc().init(x, y)\n\n/**\n * Translates a point from `widget`'s coordinates into `target`'s.\n * Returns null when the two are not in the same widget hierarchy.\n */\nexport const computePointIn = (\n widget: Gtk.Widget,\n target: Gtk.Widget,\n x: number,\n y: number,\n): Point | null => {\n const [ok, translated] = widget.computePoint(target, point(x, y))\n return ok ? { x: translated.x, y: translated.y } : null\n}\n\n/**\n * Translates a point from `widget`'s coordinates into its toplevel's — RN's\n * \"page\" space. Returns null for a widget that is not in a window yet.\n */\nexport const computePointInWindow = (\n widget: Gtk.Widget,\n x: number,\n y: number,\n): Point | null => {\n const root = widget.getRoot()\n return root ? computePointIn(widget, root, x, y) : null\n}\n"]}
|
|
@@ -17,6 +17,8 @@ export { createPortal, createRoot, quit, rootElement, useApplication, useBindSet
|
|
|
17
17
|
export { useSignal } from "./use-signal";
|
|
18
18
|
export { css, cx, injectGlobal } from "@gtkx/css";
|
|
19
19
|
export { createTextProbe, measureWidget, toNumber } from "./measure";
|
|
20
|
+
export { computePointIn, computePointInWindow, type Point } from "./geometry";
|
|
21
|
+
export { createSlotPortal } from "./slot-portal";
|
|
20
22
|
export { getViewBoxComponent, setBoxPassthrough } from "./view-box";
|
|
21
23
|
export { getSvgNodeComponent, getSvgNodeDescriptor, queueSvgRedraw, resolveSvgColor, resolveSvgPaint, setSvgNodeDescriptor, type SvgDefsDescriptor, type SvgGradientUnits, type SvgGroupDescriptor, type SvgLinearGradientDescriptor, type SvgNodeDescriptor, type SvgPaintSpec, type SvgRadialGradientDescriptor, type SvgShapeDescriptor, type SvgStopDescriptor, type SvgSvgDescriptor, } from "./svg-node";
|
|
22
24
|
export { allocateChild, attachRnLayout, detachRnLayout, queueAllocate, queueResize, type RnLayoutHooks, type RnLayoutOrientation, } from "./layout-manager";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// The ONLY module allowed to import @gtkx/* (enforced by eslint no-restricted-imports).
|
|
2
2
|
// gtkx is an RC dependency: when its API moves, this bridge absorbs the change.
|
|
3
3
|
//
|
|
4
|
-
// Caveats baked into this surface (catalogued in docs/gtkx-
|
|
4
|
+
// Caveats baked into this surface (catalogued in docs/gtkx-rc3-notes.md):
|
|
5
5
|
// - 64-bit FFI values arrive as BigInt → normalize with toNumber() at this boundary
|
|
6
6
|
// import-then-export (not `export * as`): the latter is the one syntax the
|
|
7
7
|
// stock @react-native/babel-preset cannot transform — this form keeps
|
|
@@ -54,10 +54,15 @@ export { GtkAdjustment, GtkDragSource, GtkDropTarget, GtkShortcut, GtkShortcutCo
|
|
|
54
54
|
export * from "./widgets.generated";
|
|
55
55
|
export { createPortal, createRoot, quit, rootElement, useApplication, useBindSetting, useParentWindow, useProperty, useSetting, } from "@gtkx/react";
|
|
56
56
|
// useSignal comes from ./use-signal, not @gtkx/react — see the workaround note
|
|
57
|
-
// there (rc.
|
|
57
|
+
// there (rc.3 delivers a stale handler).
|
|
58
58
|
export { useSignal } from "./use-signal";
|
|
59
59
|
export { css, cx, injectGlobal } from "@gtkx/css";
|
|
60
60
|
export { createTextProbe, measureWidget, toNumber } from "./measure";
|
|
61
|
+
export { computePointIn, computePointInWindow } from "./geometry";
|
|
62
|
+
// A portal into a NAMED slot of a remote object (the window's action map,
|
|
63
|
+
// its controllers) rather than into its default child slot — see the file
|
|
64
|
+
// for why gtkx's own createPortal is not enough on its own.
|
|
65
|
+
export { createSlotPortal } from "./slot-portal";
|
|
61
66
|
export { getViewBoxComponent, setBoxPassthrough } from "./view-box";
|
|
62
67
|
export { getSvgNodeComponent, getSvgNodeDescriptor, queueSvgRedraw, resolveSvgColor, resolveSvgPaint, setSvgNodeDescriptor, } from "./svg-node";
|
|
63
68
|
export { allocateChild, attachRnLayout, detachRnLayout, queueAllocate, queueResize, } from "./layout-manager";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/gtkx/bridge/index.ts"],"names":[],"mappings":"AAAA,wFAAwF;AACxF,gFAAgF;AAChF,EAAE;AACF,0EAA0E;AAC1E,oFAAoF;AAEpF,2EAA2E;AAC3E,sEAAsE;AACtE,qDAAqD;AACrD,OAAO,KAAK,GAAG,MAAM,cAAc,CAAA;AACnC,OAAO,KAAK,GAAG,MAAM,cAAc,CAAA;AACnC,OAAO,KAAK,GAAG,MAAM,cAAc,CAAA;AACnC,OAAO,KAAK,IAAI,MAAM,eAAe,CAAA;AACrC,OAAO,KAAK,OAAO,MAAM,kBAAkB,CAAA;AAC3C,OAAO,KAAK,QAAQ,MAAM,mBAAmB,CAAA;AAC7C,OAAO,KAAK,GAAG,MAAM,cAAc,CAAA;AACnC,OAAO,KAAK,GAAG,MAAM,cAAc,CAAA;AACnC,OAAO,KAAK,KAAK,MAAM,gBAAgB,CAAA;AAEvC,OAAO,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,CAAA;AAElE,uEAAuE;AACvE,2EAA2E;AAC3E,2EAA2E;AAC3E,WAAW;AACX,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AAE/D,4EAA4E;AAC5E,6EAA6E;AAC7E,sEAAsE;AACtE,qEAAqE;AACrE,6EAA6E;AAC7E,0EAA0E;AAC1E,4EAA4E;AAC5E,4EAA4E;AAC5E,iCA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AAS,CAAA","sourcesContent":["// The ONLY module allowed to import @gtkx/* (enforced by eslint no-restricted-imports).\n// gtkx is an RC dependency: when its API moves, this bridge absorbs the change.\n//\n// Caveats baked into this surface (catalogued in docs/gtkx-
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/gtkx/bridge/index.ts"],"names":[],"mappings":"AAAA,wFAAwF;AACxF,gFAAgF;AAChF,EAAE;AACF,0EAA0E;AAC1E,oFAAoF;AAEpF,2EAA2E;AAC3E,sEAAsE;AACtE,qDAAqD;AACrD,OAAO,KAAK,GAAG,MAAM,cAAc,CAAA;AACnC,OAAO,KAAK,GAAG,MAAM,cAAc,CAAA;AACnC,OAAO,KAAK,GAAG,MAAM,cAAc,CAAA;AACnC,OAAO,KAAK,IAAI,MAAM,eAAe,CAAA;AACrC,OAAO,KAAK,OAAO,MAAM,kBAAkB,CAAA;AAC3C,OAAO,KAAK,QAAQ,MAAM,mBAAmB,CAAA;AAC7C,OAAO,KAAK,GAAG,MAAM,cAAc,CAAA;AACnC,OAAO,KAAK,GAAG,MAAM,cAAc,CAAA;AACnC,OAAO,KAAK,KAAK,MAAM,gBAAgB,CAAA;AAEvC,OAAO,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,CAAA;AAElE,uEAAuE;AACvE,2EAA2E;AAC3E,2EAA2E;AAC3E,WAAW;AACX,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AAE/D,4EAA4E;AAC5E,6EAA6E;AAC7E,sEAAsE;AACtE,qEAAqE;AACrE,6EAA6E;AAC7E,0EAA0E;AAC1E,4EAA4E;AAC5E,4EAA4E;AAC5E,iCAAiC;AACjC,EAAE;AACF,sDAAsD;AACtD,yEAAyE;AACzE,2EAA2E;AAC3E,yEAAyE;AACzE,0EAA0E;AAC1E,sEAAsE;AACtE,2EAA2E;A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AO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA","sourcesContent":["// The ONLY module allowed to import @gtkx/* (enforced by eslint no-restricted-imports).\n// gtkx is an RC dependency: when its API moves, this bridge absorbs the change.\n//\n// Caveats baked into this surface (catalogued in docs/gtkx-rc3-notes.md):\n// - 64-bit FFI values arrive as BigInt → normalize with toNumber() at this boundary\n\n// import-then-export (not `export * as`): the latter is the one syntax the\n// stock @react-native/babel-preset cannot transform — this form keeps\n// consumer apps on their unmodified RN Babel config.\nimport * as Adw from \"@gtkx/gi/adw\"\nimport * as Gdk from \"@gtkx/gi/gdk\"\nimport * as Gio from \"@gtkx/gi/gio\"\nimport * as GLib from \"@gtkx/gi/glib\"\nimport * as GObject from \"@gtkx/gi/gobject\"\nimport * as Graphene from \"@gtkx/gi/graphene\"\nimport * as Gsk from \"@gtkx/gi/gsk\"\nimport * as Gtk from \"@gtkx/gi/gtk\"\nimport * as Pango from \"@gtkx/gi/pango\"\n\nexport { Adw, Gdk, Gio, GLib, GObject, Graphene, Gsk, Gtk, Pango }\n\n// GtkApplication and GtkGestureClick are not Gtk.Widget subclasses (an\n// application object and an event controller, respectively), so the widget\n// surface generator never sees them — kept here by hand, same as before it\n// existed.\nexport { GtkApplication, GtkGestureClick } from \"@gtkx/jsx/gtk\"\n\n// Auxiliary gtkx JSX elements that are not Gtk.Widget/Adw.Widget subclasses\n// either, same reason as the pair above — scripts/generate-widget-surface.ts\n// only classifies widgets, so these fall into its \"notAWidget\" bucket\n// (see scripts/widget-surface/classification.json) and are otherwise\n// unreachable through react-native-gtkx/gtk or /adw. Every one of these is a\n// real, necessary building block for a real app: actions and menus (Gio),\n// a responsive breakpoint (Adw), a text buffer and an adjustment (the model\n// objects GtkTextView/GtkSpinRow etc. bind to), keyboard shortcuts, and the\n// two drag-and-drop controllers.\n//\n// Adw.Breakpoint specifically: independently verified\n// (`Adw.Breakpoint.prototype instanceof Gtk.Widget === false`, prototype\n// chain bottoms out at plain GObject.Object) — it draws nothing and has no\n// size, it is a declaration (a condition plus a set of property setters)\n// attached to a Window/ApplicationWindow/Dialog/BreakpointBin. Running it\n// through wrapReactNative would give it a Yoga node for a widget that\n// occupies no space: a layout bug, not a convenience. Adw.BreakpointBin (a\n// real widget, the container that scopes breakpoints to a subtree) is\n// wrapped normally in ./widgets.generated instead, and is what\n// createSidebarNavigator's own collapse pairs AdwBreakpoint with (see\n// docs/platform-layer.md, \"Two ways to react to size\").\nexport { GMenu, GSimpleAction } from \"@gtkx/jsx/gio\"\nexport {\n AdwBreakpoint,\n AdwShortcutsItem,\n AdwShortcutsSection,\n AdwToggle,\n} from \"@gtkx/jsx/adw\"\nexport {\n GtkAdjustment,\n GtkDragSource,\n GtkDropTarget,\n GtkShortcut,\n GtkShortcutController,\n GtkTextBuffer,\n} from \"@gtkx/jsx/gtk\"\n\n// The full widget surface — every GTK/Adwaita class gtkx binds that derives\n// Gtk.Widget, raw. src/gtk/widgets.generated and src/adw/widgets.generated\n// wrap most of them with wrapReactNative; this file is where @gtkx/jsx is\n// still allowed to be imported directly (see the eslint carve-out for\n// src/gtkx/bridge/**), so they pull the raw widgets from here rather than\n// from @gtkx/jsx themselves.\nexport * from \"./widgets.generated\"\n\nexport {\n createPortal,\n createRoot,\n quit,\n rootElement,\n useApplication,\n useBindSetting,\n useParentWindow,\n useProperty,\n useSetting,\n type Root,\n type RootElement,\n type SettingsSchema,\n type SettingsSchemaKeys,\n type SettingValue,\n} from \"@gtkx/react\"\n\n// useSignal comes from ./use-signal, not @gtkx/react — see the workaround note\n// there (rc.3 delivers a stale handler).\nexport { useSignal } from \"./use-signal\"\n\nexport { css, cx, injectGlobal } from \"@gtkx/css\"\n\nexport { createTextProbe, measureWidget, toNumber } from \"./measure\"\nexport { computePointIn, computePointInWindow, type Point } from \"./geometry\"\n// A portal into a NAMED slot of a remote object (the window's action map,\n// its controllers) rather than into its default child slot — see the file\n// for why gtkx's own createPortal is not enough on its own.\nexport { createSlotPortal } from \"./slot-portal\"\nexport { getViewBoxComponent, setBoxPassthrough } from \"./view-box\"\nexport {\n getSvgNodeComponent,\n getSvgNodeDescriptor,\n queueSvgRedraw,\n resolveSvgColor,\n resolveSvgPaint,\n setSvgNodeDescriptor,\n type SvgDefsDescriptor,\n type SvgGradientUnits,\n type SvgGroupDescriptor,\n type SvgLinearGradientDescriptor,\n type SvgNodeDescriptor,\n type SvgPaintSpec,\n type SvgRadialGradientDescriptor,\n type SvgShapeDescriptor,\n type SvgStopDescriptor,\n type SvgSvgDescriptor,\n} from \"./svg-node\"\nexport {\n allocateChild,\n attachRnLayout,\n detachRnLayout,\n queueAllocate,\n queueResize,\n type RnLayoutHooks,\n type RnLayoutOrientation,\n} from \"./layout-manager\"\nexport { colorScheme, styleManager } from \"./theme\"\n"]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type * as GObject from "@gtkx/gi/gobject";
|
|
2
|
+
import { type ReactNode } from "react";
|
|
3
|
+
/**
|
|
4
|
+
* A React portal that renders `children` into `target`'s named `slot`
|
|
5
|
+
* instead of into the tree position where it is written — the declarative
|
|
6
|
+
* equivalent of passing `<Target slot={children} />`, for a target the
|
|
7
|
+
* declaring component does not render.
|
|
8
|
+
*
|
|
9
|
+
* The children stay part of the React tree where the portal element sits,
|
|
10
|
+
* so context, state and effects behave exactly as they would in place.
|
|
11
|
+
*/
|
|
12
|
+
export declare const createSlotPortal: (children: ReactNode, target: GObject.Object, slot: string, key?: string) => ReactNode;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { createPortal } from "@gtkx/react";
|
|
2
|
+
import { createElement } from "react";
|
|
3
|
+
// Typed as a component rather than an intrinsic tag: "gtkx:prop" is not in
|
|
4
|
+
// the generated JSX.IntrinsicElements map (it is not a GObject type), so
|
|
5
|
+
// createElement would reject the bare string.
|
|
6
|
+
const PROP_ELEMENT = "gtkx:prop";
|
|
7
|
+
/**
|
|
8
|
+
* A React portal that renders `children` into `target`'s named `slot`
|
|
9
|
+
* instead of into the tree position where it is written — the declarative
|
|
10
|
+
* equivalent of passing `<Target slot={children} />`, for a target the
|
|
11
|
+
* declaring component does not render.
|
|
12
|
+
*
|
|
13
|
+
* The children stay part of the React tree where the portal element sits,
|
|
14
|
+
* so context, state and effects behave exactly as they would in place.
|
|
15
|
+
*/
|
|
16
|
+
export const createSlotPortal = (children, target, slot, key) => createPortal(createElement(PROP_ELEMENT, { propName: slot }, children), target, key);
|
|
17
|
+
//# sourceMappingURL=slot-portal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"slot-portal.js","sourceRoot":"","sources":["../../../src/gtkx/bridge/slot-portal.ts"],"names":[],"mappings":"AAuBA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAC1C,OAAO,EAAE,aAAa,EAA0C,MAAM,OAAO,CAAA;AAE7E,2EAA2E;AAC3E,yEAAyE;AACzE,8CAA8C;AAC9C,MAAM,YAAY,GAAG,WAGnB,CAAA;AAEF;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAC9B,QAAmB,EACnB,MAAsB,EACtB,IAAY,EACZ,GAAY,EACD,EAAE,CACb,YAAY,CACV,aAAa,CAAC,YAAY,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAE,QAAQ,CAAC,EACzD,MAAM,EACN,GAAG,CACJ,CAAA","sourcesContent":["// Rendering children into a NAMED SLOT of an object that is not their parent.\n//\n// gtkx's own `createPortal(children, container)` targets the container's\n// DEFAULT slot — \"children\", the one a widget takes another widget through.\n// Everything else an object can be given declaratively is a named slot\n// reached in JSX by an element-valued PROP: a window's `Gio.ActionMap`\n// (`actions`), the event controllers on a widget (`controllers`), an\n// `AdwApplicationWindow`'s `breakpoints`. Those slots are what the\n// reconciler routes an element-valued prop into — it wraps the prop's value\n// in an internal element that carries the slot name, and that element is\n// what actually places children into the named slot.\n//\n// So a portal whose single child is that internal element lands its children\n// in a named slot of a remote object, which is what `WindowActions` and\n// `WindowControllers` need: declare in the app tree, attach to the window.\n//\n// RC3-WORKAROUND(prop-portal): the internal element's name is spelled out\n// here because @gtkx/react exports it from neither its public entry point\n// nor its `/internal` subpath — only from a deep module path, which this\n// package does not reach into. The bridge is the one module allowed to know\n// a gtkx internal, so the knowledge is confined to this file: if the name\n// ever changes, exactly one line moves. See docs/gtkx-rc3-notes.md.\nimport type * as GObject from \"@gtkx/gi/gobject\"\nimport { createPortal } from \"@gtkx/react\"\nimport { createElement, type FunctionComponent, type ReactNode } from \"react\"\n\n// Typed as a component rather than an intrinsic tag: \"gtkx:prop\" is not in\n// the generated JSX.IntrinsicElements map (it is not a GObject type), so\n// createElement would reject the bare string.\nconst PROP_ELEMENT = \"gtkx:prop\" as unknown as FunctionComponent<{\n propName: string\n children?: ReactNode\n}>\n\n/**\n * A React portal that renders `children` into `target`'s named `slot`\n * instead of into the tree position where it is written — the declarative\n * equivalent of passing `<Target slot={children} />`, for a target the\n * declaring component does not render.\n *\n * The children stay part of the React tree where the portal element sits,\n * so context, state and effects behave exactly as they would in place.\n */\nexport const createSlotPortal = (\n children: ReactNode,\n target: GObject.Object,\n slot: string,\n key?: string,\n): ReactNode =>\n createPortal(\n createElement(PROP_ELEMENT, { propName: slot }, children),\n target,\n key,\n )\n"]}
|
|
@@ -70,48 +70,14 @@ const scaledAlpha = (rgba, factor) => factor >= 1
|
|
|
70
70
|
alpha: rgba.alpha * factor,
|
|
71
71
|
});
|
|
72
72
|
const clamp01 = (value) => Math.max(0, Math.min(1, value));
|
|
73
|
-
|
|
74
|
-
// Writing a Gdk.RGBA into a Gsk.ColorStop's `color` field crashes in the
|
|
75
|
-
// native addon (@gtkx/native)
|
|
76
|
-
// with "Expected an Object for Boxed field write type, got Object" —
|
|
77
|
-
// verified through THREE independent paths, all hitting the same native
|
|
78
|
-
// code: the generated constructor (uses the wrong of two RGBA descriptors,
|
|
79
|
-
// _desc1 instead of the inline _desc2 — a real codegen bug), the property
|
|
80
|
-
// setter (uses the documented-correct _desc2 descriptor and STILL fails,
|
|
81
|
-
// which rules out a simple descriptor mix-up as the whole story), and a
|
|
82
|
-
// bypass that skips ColorStop construction and hands appendLinearGradient a
|
|
83
|
-
// plain {offset, color} object array instead (fails differently, with "No
|
|
84
|
-
// native handle associated with Object" — the array marshaling genuinely
|
|
85
|
-
// requires a native-backed instance per element, so there is no JS-level
|
|
86
|
-
// escape hatch). This is a native-addon bug, not something fixable from
|
|
87
|
-
// application code.
|
|
88
|
-
//
|
|
89
|
-
// Rather than crash every app that uses a gradient, or drop the gradient
|
|
90
|
-
// components from the API while their descriptor-building is fully correct
|
|
91
|
-
// and tested, a stop that fails to construct is treated exactly like a
|
|
92
|
-
// missing gradient reference (see the url(#missing) test): the shape using
|
|
93
|
-
// it simply paints no fill/stroke for that paint, instead of throwing.
|
|
94
|
-
const makeColorStop = (offset, color) => {
|
|
95
|
-
try {
|
|
96
|
-
const stop = new Gsk.ColorStop();
|
|
97
|
-
stop.offset = offset;
|
|
98
|
-
stop.color = color;
|
|
99
|
-
return stop;
|
|
100
|
-
}
|
|
101
|
-
catch {
|
|
102
|
-
return null;
|
|
103
|
-
}
|
|
104
|
-
};
|
|
73
|
+
const makeColorStop = (offset, color) => new Gsk.ColorStop({ offset, color });
|
|
105
74
|
const collectStops = (gradientWidget) => {
|
|
106
75
|
const stops = [];
|
|
107
76
|
let child = gradientWidget.getFirstChild();
|
|
108
77
|
while (child) {
|
|
109
78
|
const descriptor = nodeDescriptors.get(child);
|
|
110
79
|
if (descriptor?.kind === "stop") {
|
|
111
|
-
|
|
112
|
-
if (stop) {
|
|
113
|
-
stops.push(stop);
|
|
114
|
-
}
|
|
80
|
+
stops.push(makeColorStop(descriptor.offset, descriptor.color));
|
|
115
81
|
}
|
|
116
82
|
child = child.getNextSibling();
|
|
117
83
|
}
|
|
@@ -150,16 +116,11 @@ const appendGradient = (snapshot, path, entry, opacity) => {
|
|
|
150
116
|
if (entry.stops.length === 0) {
|
|
151
117
|
return;
|
|
152
118
|
}
|
|
153
|
-
const rescaled = opacity >= 1
|
|
154
|
-
? entry.stops
|
|
155
|
-
: entry.stops
|
|
156
|
-
.map((stop) => makeColorStop(stop.offset, scaledAlpha(stop.color, opacity)))
|
|
157
|
-
.filter((stop) => stop !== null);
|
|
158
119
|
// fillOpacity/strokeOpacity < 1 on a gradient re-builds each stop with a
|
|
159
|
-
// scaled alpha
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
120
|
+
// scaled alpha.
|
|
121
|
+
const stops = opacity >= 1
|
|
122
|
+
? entry.stops
|
|
123
|
+
: entry.stops.map((stop) => makeColorStop(stop.offset, scaledAlpha(stop.color, opacity)));
|
|
163
124
|
const [hasBounds, tightBounds] = path.getBounds();
|
|
164
125
|
const bounds = hasBounds ? tightBounds : Graphene.Rect.zero();
|
|
165
126
|
const box = asBoundingBox(bounds);
|
|
@@ -321,17 +282,12 @@ const ensureRegistered = () => {
|
|
|
321
282
|
}
|
|
322
283
|
const transform = resolveViewBoxTransform(descriptor.viewBox, width, height, descriptor.preserveAspectRatio);
|
|
323
284
|
const gradients = collectGradients(this);
|
|
324
|
-
// RC2-WORKAROUND(graphene-rect-nested-boxed-props) — row in
|
|
325
|
-
// docs/gtkx-rc2-notes.md. `new Graphene.Rect({ origin: new
|
|
326
|
-
// Graphene.Point(...), size: new Graphene.Size(...) })` hits the same
|
|
327
|
-
// native "Expected an Object for Boxed field write type, got Object"
|
|
328
|
-
// as Gsk.ColorStop's `color` field (see makeColorStop below) — Rect
|
|
329
|
-
// has a working escape hatch, `.alloc().init(x, y, w, h)`, that
|
|
330
|
-
// ColorStop does not.
|
|
331
|
-
//
|
|
332
285
|
// SVG clips to the viewport by default (no overflow:visible opt-out
|
|
333
286
|
// in this API — deliberate cut, see epic.md).
|
|
334
|
-
snapshot.pushClip(Graphene.Rect
|
|
287
|
+
snapshot.pushClip(new Graphene.Rect({
|
|
288
|
+
origin: new Graphene.Point({ x: 0, y: 0 }),
|
|
289
|
+
size: new Graphene.Size({ width, height }),
|
|
290
|
+
}));
|
|
335
291
|
snapshot.save();
|
|
336
292
|
snapshot.translate(new Graphene.Point({
|
|
337
293
|
x: transform.translateX,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"svg-node.js","sourceRoot":"","sources":["../../../src/gtkx/bridge/svg-node.ts"],"names":[],"mappings":"AAAA,sEAAsE;AACtE,6EAA6E;AAC7E,4EAA4E;AAC5E,8EAA8E;AAC9E,4EAA4E;AAC5E,4EAA4E;AAC5E,gEAAgE;AAChE,2EAA2E;AAC3E,0EAA0E;AAC1E,oEAAoE;AACpE,sBAAsB;AACtB,EAAE;AACF,qEAAqE;AACrE,6EAA6E;AAC7E,qEAAqE;AACrE,4EAA4E;AAC5E,6EAA6E;AAC7E,4BAA4B;AAC5B,OAAO,KAAK,GAAG,MAAM,cAAc,CAAA;AACnC,OAAO,KAAK,QAAQ,MAAM,mBAAmB,CAAA;AAC7C,OAAO,KAAK,GAAG,MAAM,cAAc,CAAA;AACnC,OAAO,KAAK,GAAG,MAAM,cAAc,CAAA;AACnC,OAAO,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAA;AAC7D,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAA;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAC/C,OAAO,EACL,oBAAoB,EACpB,qBAAqB,GAEtB,MAAM,6BAA6B,CAAA;AAEpC,OAAO,EACL,uBAAuB,GAGxB,MAAM,oBAAoB,CAAA;AA4E3B,MAAM,eAAe,GAAG,IAAI,OAAO,EAAiC,CAAA;AAEpE,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAClC,MAAkB,EAClB,UAA6B,EACvB,EAAE;IACR,eAAe,CAAC,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,CAAA;AACzC,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAClC,MAAkB,EACa,EAAE,CAAC,eAAe,CAAC,GAAG,CAAC,MAAM,CAA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AC,SAAS,CAAC,MAAM,EAAE,SAAS,CAAC,MAAM,CAAC,CAAA;YAClD,YAAY,CAAC,QAAQ,EAAE,IAAI,EAAE,SAAS,CAAC,CAAA;YACvC,QAAQ,CAAC,OAAO,EAAE,CAAA;YAClB,QAAQ,CAAC,GAAG,EAAE,CAAA;QAChB,CAAC;KACF;IACD,oEAAoE;IACpE,+BAA+B;IAC/B,aAAa,CAAC,aAAa,EAAE,EAAE,QAAQ,EAAE,eAAe,EAAE,CAAC,CAAA;IAC3D,kBAAkB,GAAG,aAAa,CAAA;IAClC,OAAO,aAAa,CAAA;AACtB,CAAC,CAAA;AAID,IAAI,SAAS,GAA4B,IAAI,CAAA;AAE7C,MAAM,CAAC,MAAM,mBAAmB,GAAG,GAAqB,EAAE;IACxD,IAAI,SAAS,EAAE,CAAC;QACd,OAAO,SAAS,CAAA;IAClB,CAAC;IACD,gBAAgB,EAAE,CAAA;IAClB,SAAS,GAAG,sBAAsB,CAAC,eAAe,CAAC,CAAA;IACnD,OAAO,SAAS,CAAA;AAClB,CAAC,CAAA;AAED;;qCAEqC;AACrC,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,UAAsB,EAAQ,EAAE;IAC7D,UAAU,CAAC,SAAS,EAAE,CAAA;AACxB,CAAC,CAAA","sourcesContent":["// RnGtkxSvgNode — one GObject class (registerClass, same mechanism as\n// RnGtkxLayout/RnGtkxViewBox) reused for the <Svg> root AND every descendant\n// (<G>, <Path>, <Rect>, ..., <Defs>, <LinearGradient>, <Stop>). Descendants\n// are ordinary GTK children (the reconciler's generic set_parent/insert_after\n// attachment — the same one View relies on) that GTK never snapshots on its\n// own, because nothing ever calls snapshotChild() on them: only the mounted\n// <Svg> instance's snapshot() vfunc actually runs, and it walks\n// getFirstChild()/getNextSibling() itself, reading each node's role from a\n// WeakMap (native wrappers get re-created by the runtime, so per-instance\n// state cannot live on `this` — same reasoning as hooksByManager in\n// layout-manager.ts).\n//\n// `Gtk.Widget.snapshot()` is a real, working vfunc in gtkx's codegen\n// (node_modules/@gtkx/gi/gtk/gtk.js, registerWrapperClass(Widget, ...) lists\n// it with byteOffset 320) even though it is missing from the shipped\n// `gtk.d.ts` — the type generator drops it, the codegen that actually wires\n// vfuncs does not. Verified by reading the generated registry before writing\n// any of this; see epic.md.\nimport * as Gdk from \"@gtkx/gi/gdk\"\nimport * as Graphene from \"@gtkx/gi/graphene\"\nimport * as Gsk from \"@gtkx/gi/gsk\"\nimport * as Gtk from \"@gtkx/gi/gtk\"\nimport { createElementComponent } from \"@gtkx/react/internal\"\nimport { registerClass } from \"@gtkx/runtime\"\nimport { parseColor } from \"../../style/colors\"\nimport {\n resolveGradientPoint,\n resolveGradientRadius,\n type BoundingBox,\n} from \"../../svg/gradient-geometry\"\nimport type { SvgTransformOp } from \"../../svg/transform\"\nimport {\n resolveViewBoxTransform,\n type PreserveAspectRatio,\n type ViewBox,\n} from \"../../svg/view-box\"\n\n// --- descriptors --------------------------------------------------------\n\nexport type SvgPaintSpec =\n { kind: \"color\"; rgba: Gdk.RGBA } | { kind: \"ref\"; id: string }\n\nexport type SvgGradientUnits = \"objectBoundingBox\" | \"userSpaceOnUse\"\n\nexport type SvgSvgDescriptor = {\n kind: \"svg\"\n viewBox: ViewBox | null\n preserveAspectRatio: PreserveAspectRatio\n}\n\nexport type SvgGroupDescriptor = {\n kind: \"g\"\n transformOps: SvgTransformOp[]\n opacity: number\n}\n\nexport type SvgShapeDescriptor = {\n kind: \"shape\"\n path: Gsk.Path | null\n fill: SvgPaintSpec | null\n fillOpacity: number\n fillRule: Gsk.FillRule\n stroke: SvgPaintSpec | null\n strokeOpacity: number\n strokeWidth: number\n strokeLinecap: Gsk.LineCap\n strokeLinejoin: Gsk.LineJoin\n strokeMiterlimit: number\n strokeDasharray: number[] | null\n strokeDashoffset: number\n opacity: number\n}\n\nexport type SvgDefsDescriptor = { kind: \"defs\" }\n\nexport type SvgLinearGradientDescriptor = {\n kind: \"gradient\"\n type: \"linear\"\n id: string\n units: SvgGradientUnits\n x1: number\n y1: number\n x2: number\n y2: number\n}\n\nexport type SvgRadialGradientDescriptor = {\n kind: \"gradient\"\n type: \"radial\"\n id: string\n units: SvgGradientUnits\n cx: number\n cy: number\n r: number\n}\n\nexport type SvgStopDescriptor = {\n kind: \"stop\"\n offset: number\n color: Gdk.RGBA\n}\n\nexport type SvgNodeDescriptor =\n | SvgSvgDescriptor\n | SvgGroupDescriptor\n | SvgShapeDescriptor\n | SvgDefsDescriptor\n | SvgLinearGradientDescriptor\n | SvgRadialGradientDescriptor\n | SvgStopDescriptor\n\nconst nodeDescriptors = new WeakMap<Gtk.Widget, SvgNodeDescriptor>()\n\nexport const setSvgNodeDescriptor = (\n widget: Gtk.Widget,\n descriptor: SvgNodeDescriptor,\n): void => {\n nodeDescriptors.set(widget, descriptor)\n}\n\nexport const getSvgNodeDescriptor = (\n widget: Gtk.Widget,\n): SvgNodeDescriptor | undefined => nodeDescriptors.get(widget)\n\n// --- paint resolution ----------------------------------------------------\n\n// `parseColor` also passes CSS variables (`var(--x)`) and legacy GTK named\n// colors (`@name`) through unchanged, for the CSS-cascade styling path\n// elsewhere in this codebase. Raw Gsk paint nodes have no cascade to resolve\n// those against — deliberate cut (epic.md): SVG fill/stroke only accepts\n// static CSS colors (hex/rgb/hsl/named/transparent), not PlatformColor.\nexport const resolveSvgColor = (spec: string | undefined): Gdk.RGBA | null => {\n if (!spec) {\n return null\n }\n const normalized = parseColor(spec)\n if (\n !normalized ||\n normalized.startsWith(\"var(\") ||\n normalized.startsWith(\"@\")\n ) {\n return null\n }\n const rgba = new Gdk.RGBA()\n return rgba.parse(normalized) ? rgba : null\n}\n\nconst URL_REF_PATTERN = /^url\\(#(.+)\\)$/\n\nexport const resolveSvgPaint = (\n spec: string | undefined,\n): SvgPaintSpec | null => {\n if (!spec || spec === \"none\") {\n return null\n }\n const match = URL_REF_PATTERN.exec(spec.trim())\n if (match) {\n return { kind: \"ref\", id: match[1]! }\n }\n const rgba = resolveSvgColor(spec)\n return rgba ? { kind: \"color\", rgba } : null\n}\n\nconst scaledAlpha = (rgba: Gdk.RGBA, factor: number): Gdk.RGBA =>\n factor >= 1\n ? rgba\n : new Gdk.RGBA({\n red: rgba.red,\n green: rgba.green,\n blue: rgba.blue,\n alpha: rgba.alpha * factor,\n })\n\nconst clamp01 = (value: number): number => Math.max(0, Math.min(1, value))\n\n// --- gradients -------------------------------------------------------------\n\ntype GradientEntry = {\n descriptor: SvgLinearGradientDescriptor | SvgRadialGradientDescriptor\n stops: Gsk.ColorStop[]\n}\n\n// RC2-WORKAROUND(gsk-colorstop-boxed-write) — row in docs/gtkx-rc2-notes.md.\n// Writing a Gdk.RGBA into a Gsk.ColorStop's `color` field crashes in the\n// native addon (@gtkx/native)\n// with \"Expected an Object for Boxed field write type, got Object\" —\n// verified through THREE independent paths, all hitting the same native\n// code: the generated constructor (uses the wrong of two RGBA descriptors,\n// _desc1 instead of the inline _desc2 — a real codegen bug), the property\n// setter (uses the documented-correct _desc2 descriptor and STILL fails,\n// which rules out a simple descriptor mix-up as the whole story), and a\n// bypass that skips ColorStop construction and hands appendLinearGradient a\n// plain {offset, color} object array instead (fails differently, with \"No\n// native handle associated with Object\" — the array marshaling genuinely\n// requires a native-backed instance per element, so there is no JS-level\n// escape hatch). This is a native-addon bug, not something fixable from\n// application code.\n//\n// Rather than crash every app that uses a gradient, or drop the gradient\n// components from the API while their descriptor-building is fully correct\n// and tested, a stop that fails to construct is treated exactly like a\n// missing gradient reference (see the url(#missing) test): the shape using\n// it simply paints no fill/stroke for that paint, instead of throwing.\nconst makeColorStop = (\n offset: number,\n color: Gdk.RGBA,\n): Gsk.ColorStop | null => {\n try {\n const stop = new Gsk.ColorStop()\n stop.offset = offset\n stop.color = color\n return stop\n } catch {\n return null\n }\n}\n\nconst collectStops = (gradientWidget: Gtk.Widget): Gsk.ColorStop[] => {\n const stops: Gsk.ColorStop[] = []\n let child = gradientWidget.getFirstChild()\n while (child) {\n const descriptor = nodeDescriptors.get(child)\n if (descriptor?.kind === \"stop\") {\n const stop = makeColorStop(descriptor.offset, descriptor.color)\n if (stop) {\n stops.push(stop)\n }\n }\n child = child.getNextSibling()\n }\n return stops\n}\n\n// Only DIRECT <Defs> children of <Svg> are scanned (a deliberate simplicity\n// cut — every real react-native-svg example keeps Defs at the top).\nconst collectGradients = (root: Gtk.Widget): Map<string, GradientEntry> => {\n const gradients = new Map<string, GradientEntry>()\n let child = root.getFirstChild()\n while (child) {\n if (nodeDescriptors.get(child)?.kind === \"defs\") {\n let gradientNode = child.getFirstChild()\n while (gradientNode) {\n const descriptor = nodeDescriptors.get(gradientNode)\n if (descriptor?.kind === \"gradient\") {\n gradients.set(descriptor.id, {\n descriptor,\n stops: collectStops(gradientNode),\n })\n }\n gradientNode = gradientNode.getNextSibling()\n }\n }\n child = child.getNextSibling()\n }\n return gradients\n}\n\nconst asBoundingBox = (rect: Graphene.Rect): BoundingBox => ({\n x: rect.origin.x,\n y: rect.origin.y,\n width: rect.size.width,\n height: rect.size.height,\n})\n\nconst appendGradient = (\n snapshot: Gtk.Snapshot,\n path: Gsk.Path,\n entry: GradientEntry,\n opacity: number,\n): void => {\n if (entry.stops.length === 0) {\n return\n }\n const rescaled =\n opacity >= 1\n ? entry.stops\n : entry.stops\n .map((stop) =>\n makeColorStop(stop.offset, scaledAlpha(stop.color, opacity)),\n )\n .filter((stop): stop is Gsk.ColorStop => stop !== null)\n // fillOpacity/strokeOpacity < 1 on a gradient re-builds each stop with a\n // scaled alpha (see makeColorStop's WORKAROUND note); if that rebuild\n // itself fails, fall back to the already-working full-opacity stops\n // rather than losing the gradient entirely over an opacity nuance.\n const stops = rescaled.length > 0 ? rescaled : entry.stops\n const [hasBounds, tightBounds] = path.getBounds()\n const bounds = hasBounds ? tightBounds : Graphene.Rect.zero()\n const box = asBoundingBox(bounds)\n const { descriptor } = entry\n\n if (descriptor.type === \"linear\") {\n const start = resolveGradientPoint(\n box,\n descriptor.x1,\n descriptor.y1,\n descriptor.units,\n )\n const end = resolveGradientPoint(\n box,\n descriptor.x2,\n descriptor.y2,\n descriptor.units,\n )\n snapshot.appendLinearGradient(\n bounds,\n new Graphene.Point(start),\n new Graphene.Point(end),\n stops,\n )\n return\n }\n\n const center = resolveGradientPoint(\n box,\n descriptor.cx,\n descriptor.cy,\n descriptor.units,\n )\n const { hradius, vradius } = resolveGradientRadius(\n box,\n descriptor.r,\n descriptor.units,\n )\n snapshot.appendRadialGradient(\n bounds,\n new Graphene.Point(center),\n hradius,\n vradius,\n 0,\n 1,\n stops,\n )\n}\n\n// --- drawing ---------------------------------------------------------------\n\nconst applyTransformOps = (\n snapshot: Gtk.Snapshot,\n ops: SvgTransformOp[],\n): void => {\n for (const op of ops) {\n switch (op.type) {\n case \"translate\":\n snapshot.translate(new Graphene.Point({ x: op.x, y: op.y }))\n break\n case \"scale\":\n snapshot.scale(op.x, op.y)\n break\n case \"rotate\":\n snapshot.rotate(op.angleDeg)\n break\n case \"matrix\":\n snapshot.transform(\n Gsk.Transform.new().matrix2d(op.a, op.b, op.c, op.d, op.e, op.f),\n )\n break\n }\n }\n}\n\nconst paintFill = (\n snapshot: Gtk.Snapshot,\n path: Gsk.Path,\n paint: SvgPaintSpec,\n opacity: number,\n fillRule: Gsk.FillRule,\n gradients: Map<string, GradientEntry>,\n): void => {\n if (paint.kind === \"color\") {\n snapshot.appendFill(path, fillRule, scaledAlpha(paint.rgba, opacity))\n return\n }\n const gradient = gradients.get(paint.id)\n if (!gradient) {\n // url(#missing-id): SVG renders nothing for that paint, not an error.\n return\n }\n snapshot.pushFill(path, fillRule)\n appendGradient(snapshot, path, gradient, opacity)\n snapshot.pop()\n}\n\nconst paintStroke = (\n snapshot: Gtk.Snapshot,\n path: Gsk.Path,\n shape: SvgShapeDescriptor,\n paint: SvgPaintSpec,\n opacity: number,\n gradients: Map<string, GradientEntry>,\n): void => {\n const stroke = Gsk.Stroke.new(shape.strokeWidth)\n stroke.setLineCap(shape.strokeLinecap)\n stroke.setLineJoin(shape.strokeLinejoin)\n stroke.setMiterLimit(shape.strokeMiterlimit)\n if (shape.strokeDasharray && shape.strokeDasharray.length > 0) {\n stroke.setDash(shape.strokeDasharray)\n stroke.setDashOffset(shape.strokeDashoffset)\n }\n if (paint.kind === \"color\") {\n snapshot.appendStroke(path, stroke, scaledAlpha(paint.rgba, opacity))\n return\n }\n const gradient = gradients.get(paint.id)\n if (!gradient) {\n return\n }\n snapshot.pushStroke(path, stroke)\n appendGradient(snapshot, path, gradient, opacity)\n snapshot.pop()\n}\n\nconst drawShape = (\n snapshot: Gtk.Snapshot,\n shape: SvgShapeDescriptor,\n gradients: Map<string, GradientEntry>,\n): void => {\n const path = shape.path\n if (!path || path.isEmpty()) {\n return\n }\n const groupOpacity = clamp01(shape.opacity)\n const needsGroup = groupOpacity < 1\n if (needsGroup) {\n snapshot.pushOpacity(groupOpacity)\n }\n if (shape.fill) {\n paintFill(\n snapshot,\n path,\n shape.fill,\n clamp01(shape.fillOpacity),\n shape.fillRule,\n gradients,\n )\n }\n if (shape.stroke && shape.strokeWidth > 0) {\n paintStroke(\n snapshot,\n path,\n shape,\n shape.stroke,\n clamp01(shape.strokeOpacity),\n gradients,\n )\n }\n if (needsGroup) {\n snapshot.pop()\n }\n}\n\nconst drawChildren = (\n snapshot: Gtk.Snapshot,\n parent: Gtk.Widget,\n gradients: Map<string, GradientEntry>,\n): void => {\n let child = parent.getFirstChild()\n while (child) {\n drawNode(snapshot, child, gradients)\n child = child.getNextSibling()\n }\n}\n\nconst drawNode = (\n snapshot: Gtk.Snapshot,\n widget: Gtk.Widget,\n gradients: Map<string, GradientEntry>,\n): void => {\n const descriptor = nodeDescriptors.get(widget)\n if (!descriptor) {\n return\n }\n switch (descriptor.kind) {\n case \"shape\":\n drawShape(snapshot, descriptor, gradients)\n return\n case \"g\": {\n const opacity = clamp01(descriptor.opacity)\n const needsOpacity = opacity < 1\n snapshot.save()\n applyTransformOps(snapshot, descriptor.transformOps)\n if (needsOpacity) {\n snapshot.pushOpacity(opacity)\n }\n drawChildren(snapshot, widget, gradients)\n if (needsOpacity) {\n snapshot.pop()\n }\n snapshot.restore()\n return\n }\n // defs/gradient/stop are resources, not paint; a nested <Svg> is not a\n // supported composition (undocumented, no-op rather than a crash).\n case \"defs\":\n case \"gradient\":\n case \"stop\":\n case \"svg\":\n return\n }\n}\n\n// --- widget registration ---------------------------------------------------\n\nlet RnGtkxSvgNodeClass: (new () => Gtk.Widget) | null = null\n\nconst ensureRegistered = (): new () => Gtk.Widget => {\n if (RnGtkxSvgNodeClass) {\n return RnGtkxSvgNodeClass\n }\n\n // Box, not a bare Widget: the reconciler only auto-attaches JSX children\n // (generic set_parent/insert_after) for widget types that carry a\n // registered \"children\" behavior, resolved by walking the GType ancestry\n // chain (@gtkx/react's typeInfoFor/buildTypeInfo). Plain GtkWidget has no\n // such behavior — only concrete container types like Box do — which is\n // also why RnGtkxViewBox (view-box.ts) is a Box subclass, not a bare\n // Widget one. GtkBox's own default BoxLayout then measures/allocates\n // these children, but harmlessly: they report a natural size of 0x0 (no\n // style, no content) and their own snapshot() no-ops for anything that\n // is not the mounted <Svg> root (see below), so nothing is ever\n // double-painted through GTK's normal child-snapshot path.\n class RnGtkxSvgNode extends Gtk.Box {\n // Only ever invoked by GTK on the mounted <Svg> root (nothing calls\n // snapshotChild() on the inert descendant instances). Defensive no-op\n // otherwise, so a stray direct call never throws.\n snapshot(snapshot: Gtk.Snapshot): void {\n const descriptor = nodeDescriptors.get(this)\n if (!descriptor || descriptor.kind !== \"svg\") {\n return\n }\n const width = this.getWidth()\n const height = this.getHeight()\n if (width <= 0 || height <= 0) {\n return\n }\n const transform = resolveViewBoxTransform(\n descriptor.viewBox,\n width,\n height,\n descriptor.preserveAspectRatio,\n )\n const gradients = collectGradients(this)\n // RC2-WORKAROUND(graphene-rect-nested-boxed-props) — row in\n // docs/gtkx-rc2-notes.md. `new Graphene.Rect({ origin: new\n // Graphene.Point(...), size: new Graphene.Size(...) })` hits the same\n // native \"Expected an Object for Boxed field write type, got Object\"\n // as Gsk.ColorStop's `color` field (see makeColorStop below) — Rect\n // has a working escape hatch, `.alloc().init(x, y, w, h)`, that\n // ColorStop does not.\n //\n // SVG clips to the viewport by default (no overflow:visible opt-out\n // in this API — deliberate cut, see epic.md).\n snapshot.pushClip(Graphene.Rect.alloc().init(0, 0, width, height))\n snapshot.save()\n snapshot.translate(\n new Graphene.Point({\n x: transform.translateX,\n y: transform.translateY,\n }),\n )\n snapshot.scale(transform.scaleX, transform.scaleY)\n drawChildren(snapshot, this, gradients)\n snapshot.restore()\n snapshot.pop()\n }\n }\n // Explicit typeName: bundlers minify class names (same reasoning as\n // RnGtkxLayout/RnGtkxViewBox).\n registerClass(RnGtkxSvgNode, { typeName: \"RnGtkxSvgNode\" })\n RnGtkxSvgNodeClass = RnGtkxSvgNode\n return RnGtkxSvgNode\n}\n\ntype SvgNodeComponent = ReturnType<typeof createElementComponent>\n\nlet component: SvgNodeComponent | null = null\n\nexport const getSvgNodeComponent = (): SvgNodeComponent => {\n if (component) {\n return component\n }\n ensureRegistered()\n component = createElementComponent(\"RnGtkxSvgNode\")\n return component\n}\n\n/** Imperative invalidation channel for SVG: paint-only changes (including\n * Animated-driven ones) call this instead of queueAllocate/queueResize —\n * nothing here ever touches Yoga. */\nexport const queueSvgRedraw = (rootWidget: Gtk.Widget): void => {\n rootWidget.queueDraw()\n}\n"]}
|
|
1
|
+
{"version":3,"file":"svg-node.js","sourceRoot":"","sources":["../../../src/gtkx/bridge/svg-node.ts"],"names":[],"mappings":"AAAA,sEAAsE;AACtE,6EAA6E;AAC7E,4EAA4E;AAC5E,8EAA8E;AAC9E,4EAA4E;AAC5E,4EAA4E;AAC5E,gEAAgE;AAChE,2EAA2E;AAC3E,0EAA0E;AAC1E,oEAAoE;AACpE,sBAAsB;AACtB,EAAE;AACF,qEAAqE;AACrE,6EAA6E;AAC7E,qEAAqE;AACrE,4EAA4E;AAC5E,6EAA6E;AAC7E,4BAA4B;AAC5B,OAAO,KAAK,GAAG,MAA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,CAAC,CAAA;YAClD,YAAY,CAAC,QAAQ,EAAE,IAAI,EAAE,SAAS,CAAC,CAAA;YACvC,QAAQ,CAAC,OAAO,EAAE,CAAA;YAClB,QAAQ,CAAC,GAAG,EAAE,CAAA;QAChB,CAAC;KACF;IACD,oEAAoE;IACpE,+BAA+B;IAC/B,aAAa,CAAC,aAAa,EAAE,EAAE,QAAQ,EAAE,eAAe,EAAE,CAAC,CAAA;IAC3D,kBAAkB,GAAG,aAAa,CAAA;IAClC,OAAO,aAAa,CAAA;AACtB,CAAC,CAAA;AAID,IAAI,SAAS,GAA4B,IAAI,CAAA;AAE7C,MAAM,CAAC,MAAM,mBAAmB,GAAG,GAAqB,EAAE;IACxD,IAAI,SAAS,EAAE,CAAC;QACd,OAAO,SAAS,CAAA;IAClB,CAAC;IACD,gBAAgB,EAAE,CAAA;IAClB,SAAS,GAAG,sBAAsB,CAAC,eAAe,CAAC,CAAA;IACnD,OAAO,SAAS,CAAA;AAClB,CAAC,CAAA;AAED;;qCAEqC;AACrC,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,UAAsB,EAAQ,EAAE;IAC7D,UAAU,CAAC,SAAS,EAAE,CAAA;AACxB,CAAC,CAAA","sourcesContent":["// RnGtkxSvgNode — one GObject class (registerClass, same mechanism as\n// RnGtkxLayout/RnGtkxViewBox) reused for the <Svg> root AND every descendant\n// (<G>, <Path>, <Rect>, ..., <Defs>, <LinearGradient>, <Stop>). Descendants\n// are ordinary GTK children (the reconciler's generic set_parent/insert_after\n// attachment — the same one View relies on) that GTK never snapshots on its\n// own, because nothing ever calls snapshotChild() on them: only the mounted\n// <Svg> instance's snapshot() vfunc actually runs, and it walks\n// getFirstChild()/getNextSibling() itself, reading each node's role from a\n// WeakMap (native wrappers get re-created by the runtime, so per-instance\n// state cannot live on `this` — same reasoning as hooksByManager in\n// layout-manager.ts).\n//\n// `Gtk.Widget.snapshot()` is a real, working vfunc in gtkx's codegen\n// (node_modules/@gtkx/gi/gtk/gtk.js, registerWrapperClass(Widget, ...) lists\n// it with byteOffset 320) even though it is missing from the shipped\n// `gtk.d.ts` — the type generator drops it, the codegen that actually wires\n// vfuncs does not. Verified by reading the generated registry before writing\n// any of this; see epic.md.\nimport * as Gdk from \"@gtkx/gi/gdk\"\nimport * as Graphene from \"@gtkx/gi/graphene\"\nimport * as Gsk from \"@gtkx/gi/gsk\"\nimport * as Gtk from \"@gtkx/gi/gtk\"\nimport { createElementComponent } from \"@gtkx/react/internal\"\nimport { registerClass } from \"@gtkx/runtime\"\nimport { parseColor } from \"../../style/colors\"\nimport {\n resolveGradientPoint,\n resolveGradientRadius,\n type BoundingBox,\n} from \"../../svg/gradient-geometry\"\nimport type { SvgTransformOp } from \"../../svg/transform\"\nimport {\n resolveViewBoxTransform,\n type PreserveAspectRatio,\n type ViewBox,\n} from \"../../svg/view-box\"\n\n// --- descriptors --------------------------------------------------------\n\nexport type SvgPaintSpec =\n { kind: \"color\"; rgba: Gdk.RGBA } | { kind: \"ref\"; id: string }\n\nexport type SvgGradientUnits = \"objectBoundingBox\" | \"userSpaceOnUse\"\n\nexport type SvgSvgDescriptor = {\n kind: \"svg\"\n viewBox: ViewBox | null\n preserveAspectRatio: PreserveAspectRatio\n}\n\nexport type SvgGroupDescriptor = {\n kind: \"g\"\n transformOps: SvgTransformOp[]\n opacity: number\n}\n\nexport type SvgShapeDescriptor = {\n kind: \"shape\"\n path: Gsk.Path | null\n fill: SvgPaintSpec | null\n fillOpacity: number\n fillRule: Gsk.FillRule\n stroke: SvgPaintSpec | null\n strokeOpacity: number\n strokeWidth: number\n strokeLinecap: Gsk.LineCap\n strokeLinejoin: Gsk.LineJoin\n strokeMiterlimit: number\n strokeDasharray: number[] | null\n strokeDashoffset: number\n opacity: number\n}\n\nexport type SvgDefsDescriptor = { kind: \"defs\" }\n\nexport type SvgLinearGradientDescriptor = {\n kind: \"gradient\"\n type: \"linear\"\n id: string\n units: SvgGradientUnits\n x1: number\n y1: number\n x2: number\n y2: number\n}\n\nexport type SvgRadialGradientDescriptor = {\n kind: \"gradient\"\n type: \"radial\"\n id: string\n units: SvgGradientUnits\n cx: number\n cy: number\n r: number\n}\n\nexport type SvgStopDescriptor = {\n kind: \"stop\"\n offset: number\n color: Gdk.RGBA\n}\n\nexport type SvgNodeDescriptor =\n | SvgSvgDescriptor\n | SvgGroupDescriptor\n | SvgShapeDescriptor\n | SvgDefsDescriptor\n | SvgLinearGradientDescriptor\n | SvgRadialGradientDescriptor\n | SvgStopDescriptor\n\nconst nodeDescriptors = new WeakMap<Gtk.Widget, SvgNodeDescriptor>()\n\nexport const setSvgNodeDescriptor = (\n widget: Gtk.Widget,\n descriptor: SvgNodeDescriptor,\n): void => {\n nodeDescriptors.set(widget, descriptor)\n}\n\nexport const getSvgNodeDescriptor = (\n widget: Gtk.Widget,\n): SvgNodeDescriptor | undefined => nodeDescriptors.get(widget)\n\n// --- paint resolution ----------------------------------------------------\n\n// `parseColor` also passes CSS variables (`var(--x)`) and legacy GTK named\n// colors (`@name`) through unchanged, for the CSS-cascade styling path\n// elsewhere in this codebase. Raw Gsk paint nodes have no cascade to resolve\n// those against — deliberate cut (epic.md): SVG fill/stroke only accepts\n// static CSS colors (hex/rgb/hsl/named/transparent), not PlatformColor.\nexport const resolveSvgColor = (spec: string | undefined): Gdk.RGBA | null => {\n if (!spec) {\n return null\n }\n const normalized = parseColor(spec)\n if (\n !normalized ||\n normalized.startsWith(\"var(\") ||\n normalized.startsWith(\"@\")\n ) {\n return null\n }\n const rgba = new Gdk.RGBA()\n return rgba.parse(normalized) ? rgba : null\n}\n\nconst URL_REF_PATTERN = /^url\\(#(.+)\\)$/\n\nexport const resolveSvgPaint = (\n spec: string | undefined,\n): SvgPaintSpec | null => {\n if (!spec || spec === \"none\") {\n return null\n }\n const match = URL_REF_PATTERN.exec(spec.trim())\n if (match) {\n return { kind: \"ref\", id: match[1]! }\n }\n const rgba = resolveSvgColor(spec)\n return rgba ? { kind: \"color\", rgba } : null\n}\n\nconst scaledAlpha = (rgba: Gdk.RGBA, factor: number): Gdk.RGBA =>\n factor >= 1\n ? rgba\n : new Gdk.RGBA({\n red: rgba.red,\n green: rgba.green,\n blue: rgba.blue,\n alpha: rgba.alpha * factor,\n })\n\nconst clamp01 = (value: number): number => Math.max(0, Math.min(1, value))\n\n// --- gradients -------------------------------------------------------------\n\ntype GradientEntry = {\n descriptor: SvgLinearGradientDescriptor | SvgRadialGradientDescriptor\n stops: Gsk.ColorStop[]\n}\n\nconst makeColorStop = (offset: number, color: Gdk.RGBA): Gsk.ColorStop =>\n new Gsk.ColorStop({ offset, color })\n\nconst collectStops = (gradientWidget: Gtk.Widget): Gsk.ColorStop[] => {\n const stops: Gsk.ColorStop[] = []\n let child = gradientWidget.getFirstChild()\n while (child) {\n const descriptor = nodeDescriptors.get(child)\n if (descriptor?.kind === \"stop\") {\n stops.push(makeColorStop(descriptor.offset, descriptor.color))\n }\n child = child.getNextSibling()\n }\n return stops\n}\n\n// Only DIRECT <Defs> children of <Svg> are scanned (a deliberate simplicity\n// cut — every real react-native-svg example keeps Defs at the top).\nconst collectGradients = (root: Gtk.Widget): Map<string, GradientEntry> => {\n const gradients = new Map<string, GradientEntry>()\n let child = root.getFirstChild()\n while (child) {\n if (nodeDescriptors.get(child)?.kind === \"defs\") {\n let gradientNode = child.getFirstChild()\n while (gradientNode) {\n const descriptor = nodeDescriptors.get(gradientNode)\n if (descriptor?.kind === \"gradient\") {\n gradients.set(descriptor.id, {\n descriptor,\n stops: collectStops(gradientNode),\n })\n }\n gradientNode = gradientNode.getNextSibling()\n }\n }\n child = child.getNextSibling()\n }\n return gradients\n}\n\nconst asBoundingBox = (rect: Graphene.Rect): BoundingBox => ({\n x: rect.origin.x,\n y: rect.origin.y,\n width: rect.size.width,\n height: rect.size.height,\n})\n\nconst appendGradient = (\n snapshot: Gtk.Snapshot,\n path: Gsk.Path,\n entry: GradientEntry,\n opacity: number,\n): void => {\n if (entry.stops.length === 0) {\n return\n }\n // fillOpacity/strokeOpacity < 1 on a gradient re-builds each stop with a\n // scaled alpha.\n const stops =\n opacity >= 1\n ? entry.stops\n : entry.stops.map((stop) =>\n makeColorStop(stop.offset, scaledAlpha(stop.color, opacity)),\n )\n const [hasBounds, tightBounds] = path.getBounds()\n const bounds = hasBounds ? tightBounds : Graphene.Rect.zero()\n const box = asBoundingBox(bounds)\n const { descriptor } = entry\n\n if (descriptor.type === \"linear\") {\n const start = resolveGradientPoint(\n box,\n descriptor.x1,\n descriptor.y1,\n descriptor.units,\n )\n const end = resolveGradientPoint(\n box,\n descriptor.x2,\n descriptor.y2,\n descriptor.units,\n )\n snapshot.appendLinearGradient(\n bounds,\n new Graphene.Point(start),\n new Graphene.Point(end),\n stops,\n )\n return\n }\n\n const center = resolveGradientPoint(\n box,\n descriptor.cx,\n descriptor.cy,\n descriptor.units,\n )\n const { hradius, vradius } = resolveGradientRadius(\n box,\n descriptor.r,\n descriptor.units,\n )\n snapshot.appendRadialGradient(\n bounds,\n new Graphene.Point(center),\n hradius,\n vradius,\n 0,\n 1,\n stops,\n )\n}\n\n// --- drawing ---------------------------------------------------------------\n\nconst applyTransformOps = (\n snapshot: Gtk.Snapshot,\n ops: SvgTransformOp[],\n): void => {\n for (const op of ops) {\n switch (op.type) {\n case \"translate\":\n snapshot.translate(new Graphene.Point({ x: op.x, y: op.y }))\n break\n case \"scale\":\n snapshot.scale(op.x, op.y)\n break\n case \"rotate\":\n snapshot.rotate(op.angleDeg)\n break\n case \"matrix\":\n snapshot.transform(\n Gsk.Transform.new().matrix2d(op.a, op.b, op.c, op.d, op.e, op.f),\n )\n break\n }\n }\n}\n\nconst paintFill = (\n snapshot: Gtk.Snapshot,\n path: Gsk.Path,\n paint: SvgPaintSpec,\n opacity: number,\n fillRule: Gsk.FillRule,\n gradients: Map<string, GradientEntry>,\n): void => {\n if (paint.kind === \"color\") {\n snapshot.appendFill(path, fillRule, scaledAlpha(paint.rgba, opacity))\n return\n }\n const gradient = gradients.get(paint.id)\n if (!gradient) {\n // url(#missing-id): SVG renders nothing for that paint, not an error.\n return\n }\n snapshot.pushFill(path, fillRule)\n appendGradient(snapshot, path, gradient, opacity)\n snapshot.pop()\n}\n\nconst paintStroke = (\n snapshot: Gtk.Snapshot,\n path: Gsk.Path,\n shape: SvgShapeDescriptor,\n paint: SvgPaintSpec,\n opacity: number,\n gradients: Map<string, GradientEntry>,\n): void => {\n const stroke = Gsk.Stroke.new(shape.strokeWidth)\n stroke.setLineCap(shape.strokeLinecap)\n stroke.setLineJoin(shape.strokeLinejoin)\n stroke.setMiterLimit(shape.strokeMiterlimit)\n if (shape.strokeDasharray && shape.strokeDasharray.length > 0) {\n stroke.setDash(shape.strokeDasharray)\n stroke.setDashOffset(shape.strokeDashoffset)\n }\n if (paint.kind === \"color\") {\n snapshot.appendStroke(path, stroke, scaledAlpha(paint.rgba, opacity))\n return\n }\n const gradient = gradients.get(paint.id)\n if (!gradient) {\n return\n }\n snapshot.pushStroke(path, stroke)\n appendGradient(snapshot, path, gradient, opacity)\n snapshot.pop()\n}\n\nconst drawShape = (\n snapshot: Gtk.Snapshot,\n shape: SvgShapeDescriptor,\n gradients: Map<string, GradientEntry>,\n): void => {\n const path = shape.path\n if (!path || path.isEmpty()) {\n return\n }\n const groupOpacity = clamp01(shape.opacity)\n const needsGroup = groupOpacity < 1\n if (needsGroup) {\n snapshot.pushOpacity(groupOpacity)\n }\n if (shape.fill) {\n paintFill(\n snapshot,\n path,\n shape.fill,\n clamp01(shape.fillOpacity),\n shape.fillRule,\n gradients,\n )\n }\n if (shape.stroke && shape.strokeWidth > 0) {\n paintStroke(\n snapshot,\n path,\n shape,\n shape.stroke,\n clamp01(shape.strokeOpacity),\n gradients,\n )\n }\n if (needsGroup) {\n snapshot.pop()\n }\n}\n\nconst drawChildren = (\n snapshot: Gtk.Snapshot,\n parent: Gtk.Widget,\n gradients: Map<string, GradientEntry>,\n): void => {\n let child = parent.getFirstChild()\n while (child) {\n drawNode(snapshot, child, gradients)\n child = child.getNextSibling()\n }\n}\n\nconst drawNode = (\n snapshot: Gtk.Snapshot,\n widget: Gtk.Widget,\n gradients: Map<string, GradientEntry>,\n): void => {\n const descriptor = nodeDescriptors.get(widget)\n if (!descriptor) {\n return\n }\n switch (descriptor.kind) {\n case \"shape\":\n drawShape(snapshot, descriptor, gradients)\n return\n case \"g\": {\n const opacity = clamp01(descriptor.opacity)\n const needsOpacity = opacity < 1\n snapshot.save()\n applyTransformOps(snapshot, descriptor.transformOps)\n if (needsOpacity) {\n snapshot.pushOpacity(opacity)\n }\n drawChildren(snapshot, widget, gradients)\n if (needsOpacity) {\n snapshot.pop()\n }\n snapshot.restore()\n return\n }\n // defs/gradient/stop are resources, not paint; a nested <Svg> is not a\n // supported composition (undocumented, no-op rather than a crash).\n case \"defs\":\n case \"gradient\":\n case \"stop\":\n case \"svg\":\n return\n }\n}\n\n// --- widget registration ---------------------------------------------------\n\nlet RnGtkxSvgNodeClass: (new () => Gtk.Widget) | null = null\n\nconst ensureRegistered = (): new () => Gtk.Widget => {\n if (RnGtkxSvgNodeClass) {\n return RnGtkxSvgNodeClass\n }\n\n // Box, not a bare Widget: the reconciler only auto-attaches JSX children\n // (generic set_parent/insert_after) for widget types that carry a\n // registered \"children\" behavior, resolved by walking the GType ancestry\n // chain (@gtkx/react's typeInfoFor/buildTypeInfo). Plain GtkWidget has no\n // such behavior — only concrete container types like Box do — which is\n // also why RnGtkxViewBox (view-box.ts) is a Box subclass, not a bare\n // Widget one. GtkBox's own default BoxLayout then measures/allocates\n // these children, but harmlessly: they report a natural size of 0x0 (no\n // style, no content) and their own snapshot() no-ops for anything that\n // is not the mounted <Svg> root (see below), so nothing is ever\n // double-painted through GTK's normal child-snapshot path.\n class RnGtkxSvgNode extends Gtk.Box {\n // Only ever invoked by GTK on the mounted <Svg> root (nothing calls\n // snapshotChild() on the inert descendant instances). Defensive no-op\n // otherwise, so a stray direct call never throws.\n snapshot(snapshot: Gtk.Snapshot): void {\n const descriptor = nodeDescriptors.get(this)\n if (!descriptor || descriptor.kind !== \"svg\") {\n return\n }\n const width = this.getWidth()\n const height = this.getHeight()\n if (width <= 0 || height <= 0) {\n return\n }\n const transform = resolveViewBoxTransform(\n descriptor.viewBox,\n width,\n height,\n descriptor.preserveAspectRatio,\n )\n const gradients = collectGradients(this)\n // SVG clips to the viewport by default (no overflow:visible opt-out\n // in this API — deliberate cut, see epic.md).\n snapshot.pushClip(\n new Graphene.Rect({\n origin: new Graphene.Point({ x: 0, y: 0 }),\n size: new Graphene.Size({ width, height }),\n }),\n )\n snapshot.save()\n snapshot.translate(\n new Graphene.Point({\n x: transform.translateX,\n y: transform.translateY,\n }),\n )\n snapshot.scale(transform.scaleX, transform.scaleY)\n drawChildren(snapshot, this, gradients)\n snapshot.restore()\n snapshot.pop()\n }\n }\n // Explicit typeName: bundlers minify class names (same reasoning as\n // RnGtkxLayout/RnGtkxViewBox).\n registerClass(RnGtkxSvgNode, { typeName: \"RnGtkxSvgNode\" })\n RnGtkxSvgNodeClass = RnGtkxSvgNode\n return RnGtkxSvgNode\n}\n\ntype SvgNodeComponent = ReturnType<typeof createElementComponent>\n\nlet component: SvgNodeComponent | null = null\n\nexport const getSvgNodeComponent = (): SvgNodeComponent => {\n if (component) {\n return component\n }\n ensureRegistered()\n component = createElementComponent(\"RnGtkxSvgNode\")\n return component\n}\n\n/** Imperative invalidation channel for SVG: paint-only changes (including\n * Animated-driven ones) call this instead of queueAllocate/queueResize —\n * nothing here ever touches Yoga. */\nexport const queueSvgRedraw = (rootWidget: Gtk.Widget): void => {\n rootWidget.queueDraw()\n}\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
//
|
|
1
|
+
// RC3-WORKAROUND(use-signal-stale-handler): see docs/gtkx-rc3-notes.md
|
|
2
2
|
// @gtkx/react's useSignal documents that "each emission runs the handler from
|
|
3
3
|
// the latest render", and rc.1 delivered that by pinning the handler in a ref
|
|
4
|
-
// of its own. rc.
|
|
4
|
+
// of its own. rc.3 routes it through React's useEffectEvent instead, and
|
|
5
5
|
// react-reconciler@0.33.0 only refreshes useEffectEvent in
|
|
6
6
|
// commitBeforeMutationEffects for `case 0` (FunctionComponent) — `case 11`
|
|
7
7
|
// (ForwardRef) and `case 15` (SimpleMemoComponent) fall through unrefreshed.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-signal.js","sourceRoot":"","sources":["../../../src/gtkx/bridge/use-signal.ts"],"names":[],"mappings":"AAAA,uEAAuE;AACvE,8EAA8E;AAC9E,8EAA8E;AAC9E,yEAAyE;AACzE,2DAA2D;AAC3D,2EAA2E;AAC3E,6EAA6E;AAC7E,4EAA4E;AAC5E,mEAAmE;AACnE,+DAA+D;AAC/D,4EAA4E;AAC5E,8EAA8E;AAC9E,uEAAuE;AACvE,yEAAyE;AACzE,wEAAwE;AACxE,0EAA0E;AAC1E,EAAE;AACF,8EAA8E;AAC9E,6EAA6E;AAC7E,8EAA8E;AAC9E,+EAA+E;AAC/E,qEAAqE;AACrE,yEAAyE;AACzE,uDAAuD;AACvD,0EAA0E;AAC1E,2EAA2E;AAC3E,uEAAuE;AACvE,0EAA0E;AAC1E,OAAO,EAAE,SAAS,IAAI,aAAa,EAAE,MAAM,aAAa,CAAA;AACxD,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,EAAE,MAAM,OAAO,CAAA;AAI/D,MAAM,CAAC,MAAM,SAAS,GAAyB,CAC7C,MAAM,EACN,MAAM,EACN,OAAO,EACP,OAAO,EACP,EAAE;IACF,4EAA4E;IAC5E,iEAAiE;IACjE,MAAM,MAAM,GAAG,MAAM,CAAa,GAAG,EAAE,CAAC,SAAS,CAAC,CAAA;IAClD,kBAAkB,CAAC,GAAG,EAAE;QACtB,MAAM,CAAC,OAAO,GAAG,OAAgC,CAAA;IACnD,CAAC,CAAC,CAAA;IACF,MAAM,MAAM,GAAG,WAAW,CACxB,CAAC,GAAG,IAAI,EAAE,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC,EACpC,EAAE,CACH,CAAA;IACD,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,MAAmC,EAAE,OAAO,CAAC,CAAA;AAC7E,CAAC,CAAA","sourcesContent":["//
|
|
1
|
+
{"version":3,"file":"use-signal.js","sourceRoot":"","sources":["../../../src/gtkx/bridge/use-signal.ts"],"names":[],"mappings":"AAAA,uEAAuE;AACvE,8EAA8E;AAC9E,8EAA8E;AAC9E,yEAAyE;AACzE,2DAA2D;AAC3D,2EAA2E;AAC3E,6EAA6E;AAC7E,4EAA4E;AAC5E,mEAAmE;AACnE,+DAA+D;AAC/D,4EAA4E;AAC5E,8EAA8E;AAC9E,uEAAuE;AACvE,yEAAyE;AACzE,wEAAwE;AACxE,0EAA0E;AAC1E,EAAE;AACF,8EAA8E;AAC9E,6EAA6E;AAC7E,8EAA8E;AAC9E,+EAA+E;AAC/E,qEAAqE;AACrE,yEAAyE;AACzE,uDAAuD;AACvD,0EAA0E;AAC1E,2EAA2E;AAC3E,uEAAuE;AACvE,0EAA0E;AAC1E,OAAO,EAAE,SAAS,IAAI,aAAa,EAAE,MAAM,aAAa,CAAA;AACxD,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,EAAE,MAAM,OAAO,CAAA;AAI/D,MAAM,CAAC,MAAM,SAAS,GAAyB,CAC7C,MAAM,EACN,MAAM,EACN,OAAO,EACP,OAAO,EACP,EAAE;IACF,4EAA4E;IAC5E,iEAAiE;IACjE,MAAM,MAAM,GAAG,MAAM,CAAa,GAAG,EAAE,CAAC,SAAS,CAAC,CAAA;IAClD,kBAAkB,CAAC,GAAG,EAAE;QACtB,MAAM,CAAC,OAAO,GAAG,OAAgC,CAAA;IACnD,CAAC,CAAC,CAAA;IACF,MAAM,MAAM,GAAG,WAAW,CACxB,CAAC,GAAG,IAAI,EAAE,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC,EACpC,EAAE,CACH,CAAA;IACD,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,MAAmC,EAAE,OAAO,CAAC,CAAA;AAC7E,CAAC,CAAA","sourcesContent":["// RC3-WORKAROUND(use-signal-stale-handler): see docs/gtkx-rc3-notes.md\n// @gtkx/react's useSignal documents that \"each emission runs the handler from\n// the latest render\", and rc.1 delivered that by pinning the handler in a ref\n// of its own. rc.3 routes it through React's useEffectEvent instead, and\n// react-reconciler@0.33.0 only refreshes useEffectEvent in\n// commitBeforeMutationEffects for `case 0` (FunctionComponent) — `case 11`\n// (ForwardRef) and `case 15` (SimpleMemoComponent) fall through unrefreshed.\n// Any useEffectEvent inside a memo or forwardRef component is pinned to its\n// mount closure permanently; this has nothing to do with useSignal\n// specifically (confirmed upstream: gtkx-org/gtkx#467) — plain\n// useEffectEvent called from an Effect fails identically. It reproduced for\n// us because our ScrollView is a forwardRef (components/scroll-view.tsx) with\n// the useSignal calls inside it; tree depth was a coincidence, not the\n// trigger. The consequence is not subtle — the mount-time scroll handler\n// windows a VirtualizedList against the data it saw at mount, so a list\n// whose rows arrive from a fetch renders EMPTY as soon as it is scrolled.\n//\n// Restore the documented contract at the bridge: keep the latest handler in a\n// ref of our own and hand gtkx a stable wrapper (stable so the connection is\n// never re-established, which is what its useEffectEvent was for). The ref is\n// refreshed in an INSERTION effect — the earliest commit phase, ahead of every\n// layout effect, so a signal emitted from one (the list's own scroll\n// corrections) already sees the handler from the render being committed.\n// React fixed the refresh on the 19.3 line (moved into\n// commitMutationEffectsOnFiber, covering `case 0/11/14/15` ahead of child\n// traversal), but there is no stable 0.34.x gtkx release yet and the React\n// canaries pin an exact prerelease peer, so this wrapper stays until a\n// stable React 19.3 ships — not \"when useSignal is fixed\" (see gtkx#467).\nimport { useSignal as useGtkxSignal } from \"@gtkx/react\"\nimport { useCallback, useInsertionEffect, useRef } from \"react\"\n\ntype AnyHandler = (...args: unknown[]) => unknown\n\nexport const useSignal: typeof useGtkxSignal = (\n object,\n signal,\n handler,\n options,\n) => {\n // The handler type is generic in the signal name; the wrapper only forwards\n // arguments, so it crosses that boundary as an untyped callable.\n const latest = useRef<AnyHandler>(() => undefined)\n useInsertionEffect(() => {\n latest.current = handler as unknown as AnyHandler\n })\n const stable = useCallback<AnyHandler>(\n (...args) => latest.current(...args),\n [],\n )\n useGtkxSignal(object, signal, stable as unknown as typeof handler, options)\n}\n"]}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { ActivityIndicator, Animated, AppRegistry, Easing, FlatList, Image, Modal, IntrinsicRoot, NestedRoot, Pressable, Root, SafeAreaView, ScrollView, SectionList, StatusBar, Switch, Text, TextInput, TouchableOpacity, View, type ActivityIndicatorProps, type FlatListProps, type ImageProps, type ImageSource, type LayoutEvent, type ListRenderItemInfo, type ModalProps, type PressableProps, type PressableStateCallbackType, type IntrinsicRootProps, type NestedRootProps, type PressEvent, type RootProps, type RunApplicationParams, type ScrollEvent, type ScrollViewHandle, type ScrollViewProps, type SectionListProps, type SwitchProps, type TextInputProps, type TextProps, type TouchableOpacityProps, type ViewabilityConfig, type ViewProps, type ViewToken, } from "./components/index";
|
|
1
|
+
export { ActivityIndicator, Animated, AppRegistry, Easing, FlatList, Image, Modal, IntrinsicRoot, PanResponder, NestedRoot, Pressable, Root, SafeAreaView, ScrollView, SectionList, StatusBar, Switch, Text, TextInput, TouchableOpacity, View, type ActivityIndicatorProps, type FlatListProps, type GestureResponderEvent, type ImageProps, type ImageSource, type LayoutEvent, type ListRenderItemInfo, type MeasureHandle, type MeasureInWindowOnSuccessCallback, type MeasureLayoutOnSuccessCallback, type MeasureOnSuccessCallback, type ModalProps, type NativeTouch, type PanResponderCallbacks, type PanResponderGestureState, type PanResponderInstance, type PressableProps, type PressableStateCallbackType, type IntrinsicRootProps, type NestedRootProps, type PressEvent, type ResponderProps, type RootProps, type RunApplicationParams, type ScrollEvent, type ScrollViewHandle, type ScrollViewProps, type SectionListProps, type SwitchProps, type TextInputProps, type TextProps, type TouchHistory, type TouchRecord, type TouchableOpacityProps, type ViewabilityConfig, type ViewHandle, type ViewProps, type ViewToken, } from "./components/index";
|
|
2
2
|
export type { FlatListHandle } from "./components/flat-list";
|
|
3
3
|
export { Alert, Appearance, AppState, BackHandler, DevSettings, Dimensions, I18nManager, InteractionManager, Linking, Platform, useColorScheme, useWindowDimensions, type AlertButton, type AlertButtonStyle, type AlertOptions, type AppearancePreferences, type AppStateEvent, type AppStateStatus, type ColorSchemeName, type DimensionKey, type DimensionsPayload, type InteractionPromise, type PlatformSelectSpec, type ScaledSize, } from "./apis/index";
|
|
4
4
|
export { PlatformColor, StyleSheet } from "./style/index";
|
|
5
|
-
export type { DimensionValue, FlatStyle, LayoutStyle, PointerEventsValue, StyleProp, TransformPart, VisualStyle, } from "./contracts";
|
|
5
|
+
export type { BoxShadowValue, DimensionValue, FlatStyle, LayoutStyle, PointerEventsValue, StyleProp, TextDecorationLine, TransformPart, VisualStyle, } from "./contracts";
|
|
6
6
|
export declare const version = "0.1.0";
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Public surface of react-native-gtkx, mirroring the `react-native` module.
|
|
2
2
|
// Components · APIs · StyleSheet, with the Yoga layout engine underneath.
|
|
3
|
-
export { ActivityIndicator, Animated, AppRegistry, Easing, FlatList, Image, Modal, IntrinsicRoot, NestedRoot, Pressable, Root, SafeAreaView, ScrollView, SectionList, StatusBar, Switch, Text, TextInput, TouchableOpacity, View, } from "./components/index";
|
|
3
|
+
export { ActivityIndicator, Animated, AppRegistry, Easing, FlatList, Image, Modal, IntrinsicRoot, PanResponder, NestedRoot, Pressable, Root, SafeAreaView, ScrollView, SectionList, StatusBar, Switch, Text, TextInput, TouchableOpacity, View, } from "./components/index";
|
|
4
4
|
export { Alert, Appearance, AppState, BackHandler, DevSettings, Dimensions, I18nManager, InteractionManager, Linking, Platform, useColorScheme, useWindowDimensions, } from "./apis/index";
|
|
5
5
|
export { PlatformColor, StyleSheet } from "./style/index";
|
|
6
6
|
export const version = "0.1.0";
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAC5E,0EAA0E;AAE1E,OAAO,EACL,iBAAiB,EACjB,QAAQ,EACR,WAAW,EACX,MAAM,EACN,QAAQ,EACR,KAAK,EACL,KAAK,EACL,aAAa,EACb,UAAU,EACV,SAAS,EACT,IAAI,EACJ,YAAY,EACZ,UAAU,EACV,WAAW,EACX,SAAS,EACT,MAAM,EACN,IAAI,EACJ,SAAS,EACT,gBAAgB,EAChB,IAAI,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAC5E,0EAA0E;AAE1E,OAAO,EACL,iBAAiB,EACjB,QAAQ,EACR,WAAW,EACX,MAAM,EACN,QAAQ,EACR,KAAK,EACL,KAAK,EACL,aAAa,EACb,YAAY,EACZ,UAAU,EACV,SAAS,EACT,IAAI,EACJ,YAAY,EACZ,UAAU,EACV,WAAW,EACX,SAAS,EACT,MAAM,EACN,IAAI,EACJ,SAAS,EACT,gBAAgB,EAChB,IAAI,GAuCL,MAAM,oBAAoB,CAAA;AAM3B,OAAO,EACL,KAAK,EACL,UAAU,EACV,QAAQ,EACR,WAAW,EACX,WAAW,EACX,UAAU,EACV,WAAW,EACX,kBAAkB,EAClB,OAAO,EACP,QAAQ,EACR,cAAc,EACd,mBAAmB,GAapB,MAAM,cAAc,CAAA;AAErB,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAczD,MAAM,CAAC,MAAM,OAAO,GAAG,OAAO,CAAA","sourcesContent":["// Public surface of react-native-gtkx, mirroring the `react-native` module.\n// Components · APIs · StyleSheet, with the Yoga layout engine underneath.\n\nexport {\n ActivityIndicator,\n Animated,\n AppRegistry,\n Easing,\n FlatList,\n Image,\n Modal,\n IntrinsicRoot,\n PanResponder,\n NestedRoot,\n Pressable,\n Root,\n SafeAreaView,\n ScrollView,\n SectionList,\n StatusBar,\n Switch,\n Text,\n TextInput,\n TouchableOpacity,\n View,\n type ActivityIndicatorProps,\n type FlatListProps,\n type GestureResponderEvent,\n type ImageProps,\n type ImageSource,\n type LayoutEvent,\n type ListRenderItemInfo,\n type MeasureHandle,\n type MeasureInWindowOnSuccessCallback,\n type MeasureLayoutOnSuccessCallback,\n type MeasureOnSuccessCallback,\n type ModalProps,\n type NativeTouch,\n type PanResponderCallbacks,\n type PanResponderGestureState,\n type PanResponderInstance,\n type PressableProps,\n type PressableStateCallbackType,\n type IntrinsicRootProps,\n type NestedRootProps,\n type PressEvent,\n type ResponderProps,\n type RootProps,\n type RunApplicationParams,\n type ScrollEvent,\n type ScrollViewHandle,\n type ScrollViewProps,\n type SectionListProps,\n type SwitchProps,\n type TextInputProps,\n type TextProps,\n type TouchHistory,\n type TouchRecord,\n type TouchableOpacityProps,\n type ViewabilityConfig,\n type ViewHandle,\n type ViewProps,\n type ViewToken,\n} from \"./components/index\"\n\n// List scroll handle (scrollTo/scrollToEnd/scrollToIndex/scrollToItem/\n// scrollToOffset) — exported straight from the component module.\nexport type { FlatListHandle } from \"./components/flat-list\"\n\nexport {\n Alert,\n Appearance,\n AppState,\n BackHandler,\n DevSettings,\n Dimensions,\n I18nManager,\n InteractionManager,\n Linking,\n Platform,\n useColorScheme,\n useWindowDimensions,\n type AlertButton,\n type AlertButtonStyle,\n type AlertOptions,\n type AppearancePreferences,\n type AppStateEvent,\n type AppStateStatus,\n type ColorSchemeName,\n type DimensionKey,\n type DimensionsPayload,\n type InteractionPromise,\n type PlatformSelectSpec,\n type ScaledSize,\n} from \"./apis/index\"\n\nexport { PlatformColor, StyleSheet } from \"./style/index\"\n\nexport type {\n BoxShadowValue,\n DimensionValue,\n FlatStyle,\n LayoutStyle,\n PointerEventsValue,\n StyleProp,\n TextDecorationLine,\n TransformPart,\n VisualStyle,\n} from \"./contracts\"\n\nexport const version = \"0.1.0\"\n"]}
|