react-native-gtkx 0.1.0-alpha.3 → 0.2.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +41 -3
- package/dist/adw/index.d.ts +3 -0
- package/dist/adw/index.js +41 -0
- package/dist/adw/index.js.map +1 -0
- package/dist/adw/widgets.generated.d.ts +63 -0
- package/dist/adw/widgets.generated.js +125 -0
- package/dist/adw/widgets.generated.js.map +1 -0
- package/dist/animated/create-animated.js +1 -1
- package/dist/animated/create-animated.js.map +1 -1
- package/dist/animated/index.js +3 -3
- package/dist/animated/index.js.map +1 -1
- package/dist/common/content.d.ts +69 -0
- package/dist/common/content.js +84 -0
- package/dist/common/content.js.map +1 -0
- package/dist/common/index.d.ts +3 -0
- package/dist/common/index.js +19 -0
- package/dist/common/index.js.map +1 -0
- package/dist/common/navigation-stack.d.ts +84 -0
- package/dist/common/navigation-stack.js +313 -0
- package/dist/common/navigation-stack.js.map +1 -0
- package/dist/common/widget.d.ts +83 -0
- package/dist/common/widget.js +142 -0
- package/dist/common/widget.js.map +1 -0
- package/dist/components/animated.d.ts +3 -2
- package/dist/components/animated.js +85 -66
- package/dist/components/animated.js.map +1 -1
- package/dist/components/app-registry.d.ts +10 -1
- package/dist/components/app-registry.js +8 -3
- package/dist/components/app-registry.js.map +1 -1
- package/dist/components/pressable.js +109 -16
- package/dist/components/pressable.js.map +1 -1
- package/dist/components/rect-store.d.ts +11 -1
- package/dist/components/rect-store.js +27 -3
- package/dist/components/rect-store.js.map +1 -1
- package/dist/components/svg/animated-support.d.ts +19 -0
- package/dist/components/svg/animated-support.js +64 -0
- package/dist/components/svg/animated-support.js.map +1 -0
- package/dist/components/svg/context.d.ts +8 -0
- package/dist/components/svg/context.js +15 -0
- package/dist/components/svg/context.js.map +1 -0
- package/dist/components/svg/gradients.d.ts +31 -0
- package/dist/components/svg/gradients.js +93 -0
- package/dist/components/svg/gradients.js.map +1 -0
- package/dist/components/svg/group.d.ts +8 -0
- package/dist/components/svg/group.js +30 -0
- package/dist/components/svg/group.js.map +1 -0
- package/dist/components/svg/index.d.ts +6 -0
- package/dist/components/svg/index.js +5 -0
- package/dist/components/svg/index.js.map +1 -0
- package/dist/components/svg/node.d.ts +7 -0
- package/dist/components/svg/node.js +7 -0
- package/dist/components/svg/node.js.map +1 -0
- package/dist/components/svg/paint.d.ts +24 -0
- package/dist/components/svg/paint.js +57 -0
- package/dist/components/svg/paint.js.map +1 -0
- package/dist/components/svg/shapes.d.ts +47 -0
- package/dist/components/svg/shapes.js +51 -0
- package/dist/components/svg/shapes.js.map +1 -0
- package/dist/components/svg/svg.d.ts +14 -0
- package/dist/components/svg/svg.js +48 -0
- package/dist/components/svg/svg.js.map +1 -0
- package/dist/components/svg/use-shape-node.d.ts +12 -0
- package/dist/components/svg/use-shape-node.js +52 -0
- package/dist/components/svg/use-shape-node.js.map +1 -0
- package/dist/components/text-input.js +3 -2
- package/dist/components/text-input.js.map +1 -1
- package/dist/components/text.js +11 -2
- package/dist/components/text.js.map +1 -1
- package/dist/components/use-layout-child.js +47 -4
- package/dist/components/use-layout-child.js.map +1 -1
- package/dist/contracts.d.ts +12 -1
- package/dist/contracts.js +2 -3
- package/dist/contracts.js.map +1 -1
- package/dist/gtk/index.d.ts +6 -0
- package/dist/gtk/index.js +39 -0
- package/dist/gtk/index.js.map +1 -0
- package/dist/gtk/widgets.generated.d.ts +103 -0
- package/dist/gtk/widgets.generated.js +206 -0
- package/dist/gtk/widgets.generated.js.map +1 -0
- package/dist/gtkx/bridge/index.d.ts +9 -4
- package/dist/gtkx/bridge/index.js +41 -5
- package/dist/gtkx/bridge/index.js.map +1 -1
- package/dist/gtkx/bridge/layout-manager.d.ts +2 -1
- package/dist/gtkx/bridge/layout-manager.js +31 -9
- package/dist/gtkx/bridge/layout-manager.js.map +1 -1
- package/dist/gtkx/bridge/svg-node.d.ts +79 -0
- package/dist/gtkx/bridge/svg-node.js +367 -0
- package/dist/gtkx/bridge/svg-node.js.map +1 -0
- package/dist/gtkx/bridge/theme.js +1 -1
- package/dist/gtkx/bridge/theme.js.map +1 -1
- package/dist/gtkx/bridge/use-signal.js +21 -10
- package/dist/gtkx/bridge/use-signal.js.map +1 -1
- package/dist/gtkx/bridge/widgets.generated.d.ts +2 -0
- package/dist/gtkx/bridge/widgets.generated.js +14 -0
- package/dist/gtkx/bridge/widgets.generated.js.map +1 -0
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/mcp/bin.d.ts +2 -0
- package/dist/mcp/bin.js +17 -0
- package/dist/mcp/bin.js.map +1 -0
- package/dist/mcp/data/generated.d.ts +1282 -0
- package/dist/mcp/data/generated.js +1148 -0
- package/dist/mcp/data/generated.js.map +1 -0
- package/dist/mcp/index.d.ts +5 -0
- package/dist/mcp/index.js +9 -0
- package/dist/mcp/index.js.map +1 -0
- package/dist/mcp/list.d.ts +4 -0
- package/dist/mcp/list.js +56 -0
- package/dist/mcp/list.js.map +1 -0
- package/dist/mcp/resolve.d.ts +55 -0
- package/dist/mcp/resolve.js +151 -0
- package/dist/mcp/resolve.js.map +1 -0
- package/dist/mcp/search.d.ts +13 -0
- package/dist/mcp/search.js +48 -0
- package/dist/mcp/search.js.map +1 -0
- package/dist/mcp/server.d.ts +7 -0
- package/dist/mcp/server.js +135 -0
- package/dist/mcp/server.js.map +1 -0
- package/dist/mcp/tool.d.ts +21 -0
- package/dist/mcp/tool.js +36 -0
- package/dist/mcp/tool.js.map +1 -0
- package/dist/metro/index.js +10 -0
- package/dist/metro/index.js.map +1 -1
- package/dist/navigation/index.d.ts +50 -13
- package/dist/navigation/index.js +183 -148
- package/dist/navigation/index.js.map +1 -1
- package/dist/navigation/option-warnings.js +9 -1
- package/dist/navigation/option-warnings.js.map +1 -1
- package/dist/navigation/sidebar.d.ts +177 -9
- package/dist/navigation/sidebar.js +284 -10
- package/dist/navigation/sidebar.js.map +1 -1
- package/dist/runner/index.d.ts +22 -2
- package/dist/runner/index.js +163 -12
- package/dist/runner/index.js.map +1 -1
- package/dist/sea/assemble.d.ts +29 -0
- package/dist/sea/assemble.js +129 -0
- package/dist/sea/assemble.js.map +1 -0
- package/dist/sea/bundle.d.ts +61 -0
- package/dist/sea/bundle.js +202 -0
- package/dist/sea/bundle.js.map +1 -0
- package/dist/sea/gtkx-config-module.d.ts +18 -0
- package/dist/sea/gtkx-config-module.js +67 -0
- package/dist/sea/gtkx-config-module.js.map +1 -0
- package/dist/sea/native-shim.d.ts +40 -0
- package/dist/sea/native-shim.js +121 -0
- package/dist/sea/native-shim.js.map +1 -0
- package/dist/sea/react-anchor-plugin.d.ts +2 -0
- package/dist/sea/react-anchor-plugin.js +30 -0
- package/dist/sea/react-anchor-plugin.js.map +1 -0
- package/dist/style/colors.js +3 -1
- package/dist/style/colors.js.map +1 -1
- package/dist/style/index.d.ts +1 -0
- package/dist/style/index.js +3 -2
- package/dist/style/index.js.map +1 -1
- package/dist/style/registry.gtkx.js +1 -1
- package/dist/style/registry.gtkx.js.map +1 -1
- package/dist/style/split-style.js +3 -3
- package/dist/style/split-style.js.map +1 -1
- package/dist/style/text-align.js +1 -1
- package/dist/style/text-align.js.map +1 -1
- package/dist/style/transform.d.ts +22 -0
- package/dist/style/transform.js +137 -0
- package/dist/style/transform.js.map +1 -0
- package/dist/style/visual-css.js +3 -2
- package/dist/style/visual-css.js.map +1 -1
- package/dist/svg/geometry.d.ts +19 -0
- package/dist/svg/geometry.js +80 -0
- package/dist/svg/geometry.js.map +1 -0
- package/dist/svg/gradient-geometry.d.ts +15 -0
- package/dist/svg/gradient-geometry.js +18 -0
- package/dist/svg/gradient-geometry.js.map +1 -0
- package/dist/svg/transform.d.ts +22 -0
- package/dist/svg/transform.js +74 -0
- package/dist/svg/transform.js.map +1 -0
- package/dist/svg/view-box.d.ts +34 -0
- package/dist/svg/view-box.js +108 -0
- package/dist/svg/view-box.js.map +1 -0
- package/dist/svg-compat/index.d.ts +1 -0
- package/dist/svg-compat/index.js +16 -0
- package/dist/svg-compat/index.js.map +1 -0
- package/dist/testing/index.d.ts +14 -0
- package/dist/testing/index.js +14 -0
- package/dist/testing/index.js.map +1 -0
- package/dist/vite/index.d.ts +7 -3
- package/dist/vite/index.js +16 -3
- package/dist/vite/index.js.map +1 -1
- package/dist/vitest/index.d.ts +52 -0
- package/dist/vitest/index.js +58 -0
- package/dist/vitest/index.js.map +1 -0
- package/dist/vitest/setup.d.ts +4 -0
- package/dist/vitest/setup.js +22 -0
- package/dist/vitest/setup.js.map +1 -0
- package/package.json +47 -8
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"text.js","sourceRoot":"","sources":["../../src/components/text.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,eAAe,EACf,OAAO,EACP,MAAM,EACN,QAAQ,GAET,MAAM,OAAO,CAAA;AACd,OAAO,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAA;AAEtD,OAAO,EACL,eAAe,EACf,GAAG,EACH,QAAQ,EACR,aAAa,EACb,KAAK,GACN,MAAM,sBAAsB,CAAA;AAC7B,OAAO,EAAE,cAAc,EAAoB,MAAM,oBAAoB,CAAA;AAUrE,MAAM,eAAe,GAAG,CAAC,QAAmB,EAAU,EAAE;IACtD,IAAI,QAAQ,KAAK,IAAI,IAAI,QAAQ,KAAK,SAAS,IAAI,QAAQ,KAAK,KAAK,EAAE,CAAC;QACtE,OAAO,EAAE,CAAA;IACX,CAAC;IACD,IAAI,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC;QAC5B,OAAO,QAAQ,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;IAC/C,CAAC;IACD,OAAO,MAAM,CAAC,QAAQ,CAAC,CAAA;AACzB,CAAC,CAAA;AAED,MAAM,aAAa,GAAG;IACpB,IAAI,EAAE,GAAG,CAAC,aAAa,CAAC,IAAI;IAC5B,KAAK,EAAE,GAAG,CAAC,aAAa,CAAC,KAAK;IAC9B,MAAM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AAA;IAEhD,MAAM,KAAK,GAAG,qBAAqB,CAAC,IAAI,CAAC,SAAS,CAAC,CAAA;IAEnD,OAAO,CACL,KAAC,QAAQ,IACP,GAAG,EAAE,SAAS,EACd,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,IAAI,EACX,IAAI,QACJ,MAAM,EAAE,KAAK,CAAC,MAAM,EACpB,MAAM,EAAE,CAAC,EACT,OAAO,EAAE,aAAa,CAAC,KAAK,CAAC,aAAa,CAAC,EAC3C,KAAK,EAAE,aAAa;QACpB,qEAAqE;QACrE,sEAAsE;QACtE,kEAAkE;QAClE,qEAAqE;QACrE,SAAS,EACP,aAAa,KAAK,SAAS;YACzB,CAAC,CAAC,KAAK,CAAC,aAAa,CAAC,GAAG;YACzB,CAAC,CAAC,KAAK,CAAC,aAAa,CAAC,IAAI,EAE9B,UAAU,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,EAAE,GACtC,CACH,CAAA;AACH,CAAC,CAAA","sourcesContent":["import {\n useLayoutEffect,\n useMemo,\n useRef,\n useState,\n type ReactNode,\n} from \"react\"\nimport { textAlignToLabelProps } from \"../style/index\"\nimport type { MeasureFn, StyleProp } from \"../contracts\"\nimport {\n createTextProbe,\n Gtk,\n GtkLabel,\n measureWidget,\n Pango,\n} from \"../gtkx/bridge/index\"\nimport { useLayoutChild, type LayoutEvent } from \"./use-layout-child\"\n\nexport type TextProps = {\n style?: StyleProp\n onLayout?: (event: LayoutEvent) => void\n numberOfLines?: number\n children?: ReactNode\n testID?: string\n}\n\nconst flattenToString = (children: ReactNode): string => {\n if (children === null || children === undefined || children === false) {\n return \"\"\n }\n if (Array.isArray(children)) {\n return children.map(flattenToString).join(\"\")\n }\n return String(children)\n}\n\nconst JUSTIFICATION = {\n left: Gtk.Justification.LEFT,\n right: Gtk.Justification.RIGHT,\n center: Gtk.Justification.CENTER,\n fill: Gtk.Justification.FILL,\n} as const\n\n// Text is a measured Yoga leaf: an offscreen probe label (with the same CSS\n// class, so fonts match) feeds Pango metrics into the layout engine; the\n// visible GtkLabel is positioned by the commit hook like any other widget.\nexport const Text = ({\n style,\n onLayout,\n numberOfLines,\n children,\n testID,\n}: TextProps) => {\n const widgetRef = useRef<Gtk.Label | null>(null)\n const text = flattenToString(children)\n\n // useState lazy init — see the note in use-layout-child.ts (React Compiler).\n const [probe] = useState<Gtk.Label>(() => createTextProbe())\n\n const lastProbeClass = useRef<string | null>(null)\n\n // GTK collapses wrap+ellipsize labels to a single line unless `lines` is\n // set explicitly — remember how many lines the probe wrapped into, the\n // layout callback pushes it onto the visible label.\n const measuredLines = useRef(1)\n\n const measure = useMemo<MeasureFn>(() => {\n return (width, widthMode) => {\n const { minimum, natural } = measureWidget(probe, \"horizontal\")\n // Floor at the probe's own minimum width, not at 1: gtk_widget_measure()\n // clamps a height-for-width query up to the widget's minimum before\n // computing regardless of what we pass (logging \"Trying to measure\n // GtkLabel for width of N, but it needs at least M\" while doing it), so\n // asking for anything below `minimum` was never honored — the height\n // below was already being computed at `minimum`, not at our `used`.\n // Clamping here ourselves gets the same height GTK would give us\n // anyway, keeps the returned width consistent with it, and drops the\n // warning as a side effect rather than the goal.\n const used =\n widthMode === \"undefined\"\n ? natural\n : Math.min(natural, Math.max(minimum, Math.floor(width)))\n const height = measureWidget(probe, \"vertical\", used).natural\n const singleLine = measureWidget(probe, \"vertical\", natural).natural\n measuredLines.current =\n singleLine > 0 ? Math.max(1, Math.round(height / singleLine)) : 1\n return { width: used, height }\n }\n // The probe is stable; re-measure is triggered via markDirty below.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [])\n\n const layoutWithLines = useMemo(\n () => (event: LayoutEvent) => {\n const label = widgetRef.current\n if (label) {\n label.setLines(numberOfLines ?? measuredLines.current)\n }\n onLayout?.(event)\n },\n [numberOfLines, onLayout],\n )\n\n const { node, cssClass, flat } = useLayoutChild(widgetRef, {\n style,\n onLayout: layoutWithLines,\n measure,\n })\n\n // RN text clips to its box: an under-allocated GtkLabel would otherwise\n // paint its full text past the allocation (spike finding). Containers keep\n // overflow VISIBLE (paint-overflow); the text leaf clips.\n useLayoutEffect(() => {\n widgetRef.current?.setOverflow(Gtk.Overflow.HIDDEN)\n }, [])\n\n // Keep the probe in sync with everything that affects metrics, then\n // invalidate the Yoga leaf so the next pass re-measures.\n useLayoutEffect(() => {\n probe.setText(text)\n if (numberOfLines !== undefined) {\n probe.setLines(numberOfLines)\n probe.setEllipsize(Pango.EllipsizeMode.END)\n } else {\n probe.setLines(-1)\n probe.setEllipsize(Pango.EllipsizeMode.NONE)\n }\n if (lastProbeClass.current !== cssClass) {\n if (lastProbeClass.current) {\n probe.removeCssClass(lastProbeClass.current)\n }\n if (cssClass) {\n probe.addCssClass(cssClass)\n }\n lastProbeClass.current = cssClass\n }\n node.markDirty()\n }, [probe, node, text, numberOfLines, cssClass])\n\n const align = textAlignToLabelProps(flat.textAlign)\n\n return (\n <GtkLabel\n ref={widgetRef}\n name={testID}\n label={text}\n wrap\n xalign={align.xalign}\n yalign={0}\n justify={JUSTIFICATION[align.justification]}\n lines={numberOfLines}\n // RN semantics: the ellipsis is opt-in via numberOfLines. Plain text\n // wraps naturally; an unbreakable word wider than the rect just clips\n // (overflow HIDDEN above) — the layout manager allocates the rect\n // regardless of the label's own minimum, so nothing pushes siblings.\n ellipsize={\n numberOfLines !== undefined\n ? Pango.EllipsizeMode.END\n : Pango.EllipsizeMode.NONE\n }\n cssClasses={cssClass ? [cssClass] : []}\n />\n )\n}\n"]}
|
|
@@ -4,7 +4,7 @@ import { defaultCssRegistry } from "../style/registry.gtkx";
|
|
|
4
4
|
import { allocateChild, attachRnLayout, detachRnLayout, measureWidget, queueAllocate, queueResize, } from "../gtkx/bridge/index";
|
|
5
5
|
import { perfAddTime, perfBurst, perfCount, perfEnabled, perfNow, } from "../perf";
|
|
6
6
|
import { useHostNode } from "./host-node";
|
|
7
|
-
import { deferDuringAllocate, getStoredOffset, getStoredRect, setStoredRect, } from "./rect-store";
|
|
7
|
+
import { deferDuringAllocate, getStoredOffset, getStoredRect, setStoredRect, setStoredTransform, } from "./rect-store";
|
|
8
8
|
// Perf: sizeAllocate recurses synchronously into child containers, so a
|
|
9
9
|
// naive per-pass timer double-counts nested passes. Track depth and time
|
|
10
10
|
// only the outermost (top-level) allocate — that is the real wall time GTK
|
|
@@ -32,6 +32,25 @@ export const useLayoutChild = (widgetRef, options) => {
|
|
|
32
32
|
node.setStyle(JSON.parse(layoutKey));
|
|
33
33
|
}, [node, layoutKey]);
|
|
34
34
|
const cssClass = defaultCssRegistry.getClassName(visual);
|
|
35
|
+
// RN transforms are visual only: the widget keeps the box Yoga gave it, so
|
|
36
|
+
// a transform never touches the shadow tree — it only asks the parent
|
|
37
|
+
// container to run its allocate hook again. Keyed on the serialized array
|
|
38
|
+
// so a re-render with the same transform costs nothing.
|
|
39
|
+
// (Animated.View owns its own transform and strips it from the static
|
|
40
|
+
// style before it gets here, so the two writers never race.)
|
|
41
|
+
const transformKey = JSON.stringify(visual.transform ?? null);
|
|
42
|
+
useLayoutEffect(() => {
|
|
43
|
+
const widget = widgetRef.current;
|
|
44
|
+
if (!widget) {
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
setStoredTransform(widget, JSON.parse(transformKey));
|
|
48
|
+
const parentWidget = host.widgetRef.current;
|
|
49
|
+
if (parentWidget) {
|
|
50
|
+
queueAllocate(parentWidget);
|
|
51
|
+
}
|
|
52
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
53
|
+
}, [transformKey]);
|
|
35
54
|
useLayoutEffect(() => {
|
|
36
55
|
const parent = host.node;
|
|
37
56
|
// The reconciler has already attached our widget in JSX order, so its
|
|
@@ -59,6 +78,26 @@ export const useLayoutChild = (widgetRef, options) => {
|
|
|
59
78
|
return;
|
|
60
79
|
}
|
|
61
80
|
const previous = getStoredRect(widget);
|
|
81
|
+
// A commit does not imply a change. The engine filters unchanged nodes
|
|
82
|
+
// out of the walk, EXCEPT nodes carrying a measure function — every
|
|
83
|
+
// Text leaf, every intrinsic widget — which it must still visit. Those
|
|
84
|
+
// then arrive here with the rect they already have, and queueing an
|
|
85
|
+
// allocation for them makes GTK re-allocate and re-snapshot the whole
|
|
86
|
+
// container for nothing.
|
|
87
|
+
//
|
|
88
|
+
// The cost of that is not academic: it scales with children × painted
|
|
89
|
+
// area. Measured on a 500-row list, maximized, windowSize 11 — 801
|
|
90
|
+
// live nodes — the frame average was 40.4 ms against 15.7 ms windowed,
|
|
91
|
+
// while neither 777 nodes in a small window nor 205 nodes maximized
|
|
92
|
+
// cost anything. Only the product hurts, and this is where we inflate
|
|
93
|
+
// the first factor.
|
|
94
|
+
if (previous &&
|
|
95
|
+
previous.x === rect.x &&
|
|
96
|
+
previous.y === rect.y &&
|
|
97
|
+
previous.width === rect.width &&
|
|
98
|
+
previous.height === rect.height) {
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
62
101
|
setStoredRect(widget, rect);
|
|
63
102
|
const sizeChanged = !previous ||
|
|
64
103
|
previous.width !== rect.width ||
|
|
@@ -102,10 +141,14 @@ export const useLayoutChild = (widgetRef, options) => {
|
|
|
102
141
|
if (!widget) {
|
|
103
142
|
return { width: 0, height: 0 };
|
|
104
143
|
}
|
|
105
|
-
const natural = measureWidget(widget, "horizontal")
|
|
144
|
+
const { minimum, natural } = measureWidget(widget, "horizontal");
|
|
145
|
+
// Floor at the widget's own minimum width, not at 1 — see the same
|
|
146
|
+
// clamp in text.tsx's measure for why: gtk_widget_measure() enforces
|
|
147
|
+
// this floor internally regardless of what we request (warning while
|
|
148
|
+
// it does), so anything below `minimum` was never actually honored.
|
|
106
149
|
const used = widthMode === "undefined"
|
|
107
150
|
? natural
|
|
108
|
-
: Math.min(natural, Math.max(
|
|
151
|
+
: Math.min(natural, Math.max(minimum, Math.floor(width)));
|
|
109
152
|
return {
|
|
110
153
|
width: used,
|
|
111
154
|
height: measureWidget(widget, "vertical", used).natural,
|
|
@@ -171,7 +214,7 @@ export const useRnContainer = (widgetRef, node, options) => {
|
|
|
171
214
|
const rect = getStoredRect(child);
|
|
172
215
|
if (rect) {
|
|
173
216
|
const offset = getStoredOffset(child);
|
|
174
|
-
allocateChild(child, rect.x + offset.dx, rect.y + offset.dy, rect.width, rect.height);
|
|
217
|
+
allocateChild(child, rect.x + offset.dx, rect.y + offset.dy, rect.width, rect.height, offset.matrix);
|
|
175
218
|
children += 1;
|
|
176
219
|
}
|
|
177
220
|
child = child.getNextSibling();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-layout-child.js","sourceRoot":"","sources":["../../src/components/use-layout-child.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,EAAE,QAAQ,EAAkB,MAAM,OAAO,CAAA;AAEzE,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AACvD,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAA;AAQ3D,OAAO,EACL,aAAa,EACb,cAAc,EACd,cAAc,EACd,aAAa,EACb,aAAa,EACb,WAAW,GAEZ,MAAM,sBAAsB,CAAA;AAC7B,OAAO,EACL,WAAW,EACX,SAAS,EACT,SAAS,EACT,WAAW,EACX,OAAO,GACR,MAAM,SAAS,CAAA;AAChB,OAAO,EAAE,WAAW,EAAiB,MAAM,aAAa,CAAA;AACxD,OAAO,EACL,mBAAmB,EACnB,eAAe,EACf,aAAa,EACb,aAAa,GACd,MAAM,cAAc,CAAA;AAQrB,wEAAwE;AACxE,yEAAyE;AACzE,2EAA2E;AAC3E,2CAA2C;AAC3C,IAAI,cAAc,GAAG,CAAC,CAAA;AAoBtB,2EAA2E;AAC3E,2EAA2E;AAC3E,2EAA2E;AAC3E,sEAAsE;AACtE,MAAM,CAAC,MAAM,cAAc,GAAG,CAC5B,SAAuC,EACvC,OAA2B,EACd,EAAE;IACf,MAAM,IAAI,GAAG,WAAW,EAAE,CAAA;IAE1B,yEAAyE;IACzE,wEAAwE;I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e,CAAC,KAAK,CAAC,CAAA;wBACrC,aAAa,CACX,KAAK,EACL,IAAI,CAAC,CAAC,GAAG,MAAM,CAAC,EAAE,EAClB,IAAI,CAAC,CAAC,GAAG,MAAM,CAAC,EAAE,EAClB,IAAI,CAAC,KAAK,EACV,IAAI,CAAC,MAAM,CACZ,CAAA;wBACD,QAAQ,IAAI,CAAC,CAAA;oBACf,CAAC;oBACD,KAAK,GAAG,KAAK,CAAC,cAAc,EAAE,CAAA;gBAChC,CAAC;gBACD,cAAc,IAAI,CAAC,CAAA;gBACnB,IAAI,WAAW,EAAE,CAAC;oBAChB,SAAS,CAAC,eAAe,CAAC,CAAA;oBAC1B,SAAS,CAAC,gBAAgB,EAAE,QAAQ,CAAC,CAAA;oBACrC,IAAI,cAAc,KAAK,CAAC,EAAE,CAAC;wBACzB,MAAM,OAAO,GAAG,OAAO,EAAE,GAAG,KAAK,CAAA;wBACjC,WAAW,CAAC,cAAc,EAAE,OAAO,CAAC,CAAA;wBACpC,SAAS,CAAC,qBAAqB,EAAE,OAAO,CAAC,CAAA;oBAC3C,CAAC;gBACH,CAAC;YACH,CAAC;SACF,CAAC,CAAA;QACF,OAAO,GAAG,EAAE;YACV,cAAc,CAAC,MAAM,CAAC,CAAA;QACxB,CAAC,CAAA;QACD,uDAAuD;IACzD,CAAC,EAAE,EAAE,CAAC,CAAA;AACR,CAAC,CAAA","sourcesContent":["import { useLayoutEffect, useRef, useState, type RefObject } from \"react\"\nimport type { LayoutNode } from \"../layout/index\"\nimport { splitStyle, StyleSheet } from \"../style/index\"\nimport { defaultCssRegistry } from \"../style/registry.gtkx\"\nimport type {\n LayoutStyle,\n MeasureFn,\n Rect,\n StyleProp,\n VisualStyle,\n} from \"../contracts\"\nimport {\n allocateChild,\n attachRnLayout,\n detachRnLayout,\n measureWidget,\n queueAllocate,\n queueResize,\n type Gtk,\n} from \"../gtkx/bridge/index\"\nimport {\n perfAddTime,\n perfBurst,\n perfCount,\n perfEnabled,\n perfNow,\n} from \"../perf\"\nimport { useHostNode, type HostNode } from \"./host-node\"\nimport {\n deferDuringAllocate,\n getStoredOffset,\n getStoredRect,\n setStoredRect,\n} from \"./rect-store\"\n\nexport type LayoutEvent = {\n nativeEvent: {\n layout: { x: number; y: number; width: number; height: number }\n }\n}\n\n// Perf: sizeAllocate recurses synchronously into child containers, so a\n// naive per-pass timer double-counts nested passes. Track depth and time\n// only the outermost (top-level) allocate — that is the real wall time GTK\n// spends in OUR layout code for the frame.\nlet perfAllocDepth = 0\n\nexport type LayoutChildOptions = {\n style: StyleProp | undefined\n onLayout: ((event: LayoutEvent) => void) | undefined\n measure?: MeasureFn\n // Leaves with intrinsic GTK sizes (Entry, Switch, Spinner) measure their\n // own widget so Yoga reserves exactly what the theme will draw.\n measureFromWidget?: boolean\n extraLayout?: LayoutStyle\n}\n\nexport type LayoutChild = {\n host: HostNode\n node: LayoutNode\n flat: ReturnType<typeof StyleSheet.flatten>\n visual: VisualStyle\n cssClass: string | null\n}\n\n// Shared plumbing for every leaf/container component: owns one LayoutNode,\n// keeps it in the parent's shadow tree for the component lifetime, applies\n// the layout half of the style and commits Yoga rects into the rect store,\n// where the parent container's RnGtkxLayout allocate() picks them up.\nexport const useLayoutChild = (\n widgetRef: RefObject<Gtk.Widget | null>,\n options: LayoutChildOptions,\n): LayoutChild => {\n const host = useHostNode()\n\n // useState's lazy initializer is guaranteed once-per-instance even under\n // the React Compiler — a lazy ref here got its creation memoized ACROSS\n // component instances, sharing one Yoga node and double-freeing it.\n const [node] = useState<LayoutNode>(() => host.engine.createNode())\n\n const flat = StyleSheet.flatten(options.style)\n const { layout, visual } = splitStyle(flat)\n const effectiveLayout = options.extraLayout\n ? { ...layout, ...options.extraLayout }\n : layout\n\n // Re-apply layout style only when it actually changed (keyed effect) —\n // setStyle dirties the whole tree.\n const layoutKey = JSON.stringify(effectiveLayout)\n useLayoutEffect(() => {\n node.setStyle(JSON.parse(layoutKey) as LayoutStyle)\n }, [node, layoutKey])\n\n const cssClass = defaultCssRegistry.getClassName(visual)\n\n useLayoutEffect(() => {\n const parent = host.node\n // The reconciler has already attached our widget in JSX order, so its\n // sibling position is the correct Yoga index — this keeps the shadow tree\n // ordered even for mid-list mounts (conditional children, list inserts).\n const widget = widgetRef.current\n const parentWidget = host.widgetRef.current\n let index = parent.children.length\n if (widget && parentWidget) {\n let position = 0\n let sibling = parentWidget.getFirstChild()\n while (sibling !== null && sibling !== widget) {\n position += 1\n sibling = sibling.getNextSibling()\n }\n if (sibling === widget) {\n index = Math.min(position, parent.children.length)\n }\n }\n parent.insertChild(node, index)\n node.setCommit((rect: Rect) => {\n const widget = widgetRef.current\n const parentWidget = host.widgetRef.current\n if (!widget || !parentWidget) {\n return\n }\n const previous = getStoredRect(widget)\n setStoredRect(widget, rect)\n const sizeChanged =\n !previous ||\n previous.width !== rect.width ||\n previous.height !== rect.height\n const queue = (): void => {\n if (sizeChanged) {\n // A size change invalidates this widget's cached measure (nested\n // managers, ScrolledWindow ranges) and re-allocates the ancestors.\n queueResize(widget)\n } else {\n // Pure move: the parent just needs another allocation pass. GTK\n // dedupes queued allocates, so per-child calls batch into one.\n queueAllocate(parentWidget)\n }\n }\n if (!deferDuringAllocate(widget, queue)) {\n queue()\n }\n })\n return () => {\n node.setCommit(null)\n parent.removeChild(node)\n node.free()\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [])\n\n const onLayout = options.onLayout\n useLayoutEffect(() => {\n node.setOnLayout(\n onLayout\n ? (rect: Rect) => {\n onLayout({ nativeEvent: { layout: rect } })\n }\n : null,\n )\n }, [node, onLayout])\n\n // The explicit return type keeps the inner params contextually typed: with a\n // bare lazy initializer TS may match the outer arrow against MeasureFn\n // itself (useState accepts S | () => S) and drop the context.\n const [widgetMeasure] = useState<MeasureFn>(\n (): MeasureFn => (width, widthMode) => {\n const widget = widgetRef.current\n if (!widget) {\n return { width: 0, height: 0 }\n }\n const natural = measureWidget(widget, \"horizontal\").natural\n const used =\n widthMode === \"undefined\"\n ? natural\n : Math.min(natural, Math.max(1, Math.floor(width)))\n return {\n width: used,\n height: measureWidget(widget, \"vertical\", used).natural,\n }\n },\n )\n const measure =\n options.measure ?? (options.measureFromWidget ? widgetMeasure : undefined)\n useLayoutEffect(() => {\n if (!measure) {\n return\n }\n node.setMeasureFn(measure)\n // Widgets measured before their window is mapped report zero (no realized\n // theme context yet, unlike offscreen probes) and Yoga caches it —\n // invalidate once the widget actually maps.\n const widget = widgetRef.current\n const remeasure = (): void => {\n node.markDirty()\n }\n if (options.measureFromWidget && widget) {\n widget.on(\"map\", remeasure)\n }\n return () => {\n if (options.measureFromWidget && widget) {\n widget.off(\"map\", remeasure)\n }\n // Cleared by free() on unmount; explicit unset only when measure is\n // removed while mounted.\n node.setMeasureFn(null)\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [node, measure])\n\n return { host, node, flat, visual, cssClass }\n}\n\nexport type RnContainerOptions = {\n // Overrides the default engine-rect measure (the window root reports 0 so\n // the window can shrink freely below the current content size; the\n // intrinsic root measures its content through Yoga, honoring forSize for\n // height-for-width).\n measure?: (orientation: \"horizontal\" | \"vertical\", forSize: number) => number\n // Runs before children are placed — the window root syncs the engine\n // viewport to the actual allocation here.\n beforeAllocate?: (width: number, height: number) => void\n}\n\n// Containers (Root, View, Animated.View, ScrollView content) drive their GTK\n// side with an RnGtkxLayout: measure() reports the engine rect of `node`\n// (minimum == natural — GTK minimums of children never leak upward), and\n// allocate() places every child widget at exactly its stored engine rect\n// plus the Animated offset.\nexport const useRnContainer = (\n widgetRef: RefObject<Gtk.Widget | null>,\n node: LayoutNode,\n options?: RnContainerOptions,\n): void => {\n const optionsRef = useRef<RnContainerOptions | undefined>(options)\n optionsRef.current = options\n useLayoutEffect(() => {\n const widget = widgetRef.current\n if (!widget) {\n return\n }\n attachRnLayout(widget, {\n measure: (orientation, forSize) => {\n const custom = optionsRef.current?.measure\n if (custom) {\n return custom(orientation, forSize)\n }\n const rect = node.getRect()\n return Math.round(\n (orientation === \"horizontal\" ? rect?.width : rect?.height) ?? 0,\n )\n },\n allocate: (width, height) => {\n const start = perfEnabled ? perfNow() : 0\n perfAllocDepth += 1\n optionsRef.current?.beforeAllocate?.(width, height)\n let child = widget.getFirstChild()\n let children = 0\n while (child) {\n const rect = getStoredRect(child)\n if (rect) {\n const offset = getStoredOffset(child)\n allocateChild(\n child,\n rect.x + offset.dx,\n rect.y + offset.dy,\n rect.width,\n rect.height,\n )\n children += 1\n }\n child = child.getNextSibling()\n }\n perfAllocDepth -= 1\n if (perfEnabled) {\n perfCount(\"gtk.allocPass\")\n perfCount(\"gtk.allocChild\", children)\n if (perfAllocDepth === 0) {\n const elapsed = perfNow() - start\n perfAddTime(\"gtk.allocTop\", elapsed)\n perfBurst(\"gtk.allocMsPerFrame\", elapsed)\n }\n }\n },\n })\n return () => {\n detachRnLayout(widget)\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [])\n}\n"]}
|
|
1
|
+
{"version":3,"file":"use-layout-child.js","sourceRoot":"","sources":["../../src/components/use-layout-child.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,EAAE,QAAQ,EAAkB,MAAM,OAAO,CAAA;AAEzE,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AACvD,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAA;AAS3D,OAAO,EACL,aAAa,EACb,cAAc,EACd,cAAc,EACd,aAAa,EACb,aAAa,EACb,WAAW,GAEZ,MAAM,sBAAsB,CAAA;AAC7B,OAAO,EACL,WAAW,EACX,SAAS,EACT,SAAS,EACT,WAAW,EACX,OAAO,GACR,MAAM,SAAS,CAAA;AAChB,OAAO,EAAE,WAAW,EAAiB,MAAM,aAAa,CAAA;AACxD,OAAO,EACL,mBAAmB,EACnB,eAAe,EACf,aAAa,EACb,aAAa,EACb,kBAAkB,GACnB,MAAM,cAAc,CAAA;AAQrB,wEAAwE;AACxE,yEAAyE;AACzE,2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AAA;gBAChB,OAAO,KAAK,EAAE,CAAC;oBACb,MAAM,IAAI,GAAG,aAAa,CAAC,KAAK,CAAC,CAAA;oBACjC,IAAI,IAAI,EAAE,CAAC;wBACT,MAAM,MAAM,GAAG,eAAe,CAAC,KAAK,CAAC,CAAA;wBACrC,aAAa,CACX,KAAK,EACL,IAAI,CAAC,CAAC,GAAG,MAAM,CAAC,EAAE,EAClB,IAAI,CAAC,CAAC,GAAG,MAAM,CAAC,EAAE,EAClB,IAAI,CAAC,KAAK,EACV,IAAI,CAAC,MAAM,EACX,MAAM,CAAC,MAAM,CACd,CAAA;wBACD,QAAQ,IAAI,CAAC,CAAA;oBACf,CAAC;oBACD,KAAK,GAAG,KAAK,CAAC,cAAc,EAAE,CAAA;gBAChC,CAAC;gBACD,cAAc,IAAI,CAAC,CAAA;gBACnB,IAAI,WAAW,EAAE,CAAC;oBAChB,SAAS,CAAC,eAAe,CAAC,CAAA;oBAC1B,SAAS,CAAC,gBAAgB,EAAE,QAAQ,CAAC,CAAA;oBACrC,IAAI,cAAc,KAAK,CAAC,EAAE,CAAC;wBACzB,MAAM,OAAO,GAAG,OAAO,EAAE,GAAG,KAAK,CAAA;wBACjC,WAAW,CAAC,cAAc,EAAE,OAAO,CAAC,CAAA;wBACpC,SAAS,CAAC,qBAAqB,EAAE,OAAO,CAAC,CAAA;oBAC3C,CAAC;gBACH,CAAC;YACH,CAAC;SACF,CAAC,CAAA;QACF,OAAO,GAAG,EAAE;YACV,cAAc,CAAC,MAAM,CAAC,CAAA;QACxB,CAAC,CAAA;QACD,uDAAuD;IACzD,CAAC,EAAE,EAAE,CAAC,CAAA;AACR,CAAC,CAAA","sourcesContent":["import { useLayoutEffect, useRef, useState, type RefObject } from \"react\"\nimport type { LayoutNode } from \"../layout/index\"\nimport { splitStyle, StyleSheet } from \"../style/index\"\nimport { defaultCssRegistry } from \"../style/registry.gtkx\"\nimport type {\n LayoutStyle,\n MeasureFn,\n Rect,\n StyleProp,\n TransformPart,\n VisualStyle,\n} from \"../contracts\"\nimport {\n allocateChild,\n attachRnLayout,\n detachRnLayout,\n measureWidget,\n queueAllocate,\n queueResize,\n type Gtk,\n} from \"../gtkx/bridge/index\"\nimport {\n perfAddTime,\n perfBurst,\n perfCount,\n perfEnabled,\n perfNow,\n} from \"../perf\"\nimport { useHostNode, type HostNode } from \"./host-node\"\nimport {\n deferDuringAllocate,\n getStoredOffset,\n getStoredRect,\n setStoredRect,\n setStoredTransform,\n} from \"./rect-store\"\n\nexport type LayoutEvent = {\n nativeEvent: {\n layout: { x: number; y: number; width: number; height: number }\n }\n}\n\n// Perf: sizeAllocate recurses synchronously into child containers, so a\n// naive per-pass timer double-counts nested passes. Track depth and time\n// only the outermost (top-level) allocate — that is the real wall time GTK\n// spends in OUR layout code for the frame.\nlet perfAllocDepth = 0\n\nexport type LayoutChildOptions = {\n style: StyleProp | undefined\n onLayout: ((event: LayoutEvent) => void) | undefined\n measure?: MeasureFn\n // Leaves with intrinsic GTK sizes (Entry, Switch, Spinner) measure their\n // own widget so Yoga reserves exactly what the theme will draw.\n measureFromWidget?: boolean\n extraLayout?: LayoutStyle\n}\n\nexport type LayoutChild = {\n host: HostNode\n node: LayoutNode\n flat: ReturnType<typeof StyleSheet.flatten>\n visual: VisualStyle\n cssClass: string | null\n}\n\n// Shared plumbing for every leaf/container component: owns one LayoutNode,\n// keeps it in the parent's shadow tree for the component lifetime, applies\n// the layout half of the style and commits Yoga rects into the rect store,\n// where the parent container's RnGtkxLayout allocate() picks them up.\nexport const useLayoutChild = (\n widgetRef: RefObject<Gtk.Widget | null>,\n options: LayoutChildOptions,\n): LayoutChild => {\n const host = useHostNode()\n\n // useState's lazy initializer is guaranteed once-per-instance even under\n // the React Compiler — a lazy ref here got its creation memoized ACROSS\n // component instances, sharing one Yoga node and double-freeing it.\n const [node] = useState<LayoutNode>(() => host.engine.createNode())\n\n const flat = StyleSheet.flatten(options.style)\n const { layout, visual } = splitStyle(flat)\n const effectiveLayout = options.extraLayout\n ? { ...layout, ...options.extraLayout }\n : layout\n\n // Re-apply layout style only when it actually changed (keyed effect) —\n // setStyle dirties the whole tree.\n const layoutKey = JSON.stringify(effectiveLayout)\n useLayoutEffect(() => {\n node.setStyle(JSON.parse(layoutKey) as LayoutStyle)\n }, [node, layoutKey])\n\n const cssClass = defaultCssRegistry.getClassName(visual)\n\n // RN transforms are visual only: the widget keeps the box Yoga gave it, so\n // a transform never touches the shadow tree — it only asks the parent\n // container to run its allocate hook again. Keyed on the serialized array\n // so a re-render with the same transform costs nothing.\n // (Animated.View owns its own transform and strips it from the static\n // style before it gets here, so the two writers never race.)\n const transformKey = JSON.stringify(visual.transform ?? null)\n useLayoutEffect(() => {\n const widget = widgetRef.current\n if (!widget) {\n return\n }\n setStoredTransform(widget, JSON.parse(transformKey) as TransformPart[])\n const parentWidget = host.widgetRef.current\n if (parentWidget) {\n queueAllocate(parentWidget)\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [transformKey])\n\n useLayoutEffect(() => {\n const parent = host.node\n // The reconciler has already attached our widget in JSX order, so its\n // sibling position is the correct Yoga index — this keeps the shadow tree\n // ordered even for mid-list mounts (conditional children, list inserts).\n const widget = widgetRef.current\n const parentWidget = host.widgetRef.current\n let index = parent.children.length\n if (widget && parentWidget) {\n let position = 0\n let sibling = parentWidget.getFirstChild()\n while (sibling !== null && sibling !== widget) {\n position += 1\n sibling = sibling.getNextSibling()\n }\n if (sibling === widget) {\n index = Math.min(position, parent.children.length)\n }\n }\n parent.insertChild(node, index)\n node.setCommit((rect: Rect) => {\n const widget = widgetRef.current\n const parentWidget = host.widgetRef.current\n if (!widget || !parentWidget) {\n return\n }\n const previous = getStoredRect(widget)\n // A commit does not imply a change. The engine filters unchanged nodes\n // out of the walk, EXCEPT nodes carrying a measure function — every\n // Text leaf, every intrinsic widget — which it must still visit. Those\n // then arrive here with the rect they already have, and queueing an\n // allocation for them makes GTK re-allocate and re-snapshot the whole\n // container for nothing.\n //\n // The cost of that is not academic: it scales with children × painted\n // area. Measured on a 500-row list, maximized, windowSize 11 — 801\n // live nodes — the frame average was 40.4 ms against 15.7 ms windowed,\n // while neither 777 nodes in a small window nor 205 nodes maximized\n // cost anything. Only the product hurts, and this is where we inflate\n // the first factor.\n if (\n previous &&\n previous.x === rect.x &&\n previous.y === rect.y &&\n previous.width === rect.width &&\n previous.height === rect.height\n ) {\n return\n }\n setStoredRect(widget, rect)\n const sizeChanged =\n !previous ||\n previous.width !== rect.width ||\n previous.height !== rect.height\n const queue = (): void => {\n if (sizeChanged) {\n // A size change invalidates this widget's cached measure (nested\n // managers, ScrolledWindow ranges) and re-allocates the ancestors.\n queueResize(widget)\n } else {\n // Pure move: the parent just needs another allocation pass. GTK\n // dedupes queued allocates, so per-child calls batch into one.\n queueAllocate(parentWidget)\n }\n }\n if (!deferDuringAllocate(widget, queue)) {\n queue()\n }\n })\n return () => {\n node.setCommit(null)\n parent.removeChild(node)\n node.free()\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [])\n\n const onLayout = options.onLayout\n useLayoutEffect(() => {\n node.setOnLayout(\n onLayout\n ? (rect: Rect) => {\n onLayout({ nativeEvent: { layout: rect } })\n }\n : null,\n )\n }, [node, onLayout])\n\n // The explicit return type keeps the inner params contextually typed: with a\n // bare lazy initializer TS may match the outer arrow against MeasureFn\n // itself (useState accepts S | () => S) and drop the context.\n const [widgetMeasure] = useState<MeasureFn>(\n (): MeasureFn => (width, widthMode) => {\n const widget = widgetRef.current\n if (!widget) {\n return { width: 0, height: 0 }\n }\n const { minimum, natural } = measureWidget(widget, \"horizontal\")\n // Floor at the widget's own minimum width, not at 1 — see the same\n // clamp in text.tsx's measure for why: gtk_widget_measure() enforces\n // this floor internally regardless of what we request (warning while\n // it does), so anything below `minimum` was never actually honored.\n const used =\n widthMode === \"undefined\"\n ? natural\n : Math.min(natural, Math.max(minimum, Math.floor(width)))\n return {\n width: used,\n height: measureWidget(widget, \"vertical\", used).natural,\n }\n },\n )\n const measure =\n options.measure ?? (options.measureFromWidget ? widgetMeasure : undefined)\n useLayoutEffect(() => {\n if (!measure) {\n return\n }\n node.setMeasureFn(measure)\n // Widgets measured before their window is mapped report zero (no realized\n // theme context yet, unlike offscreen probes) and Yoga caches it —\n // invalidate once the widget actually maps.\n const widget = widgetRef.current\n const remeasure = (): void => {\n node.markDirty()\n }\n if (options.measureFromWidget && widget) {\n widget.on(\"map\", remeasure)\n }\n return () => {\n if (options.measureFromWidget && widget) {\n widget.off(\"map\", remeasure)\n }\n // Cleared by free() on unmount; explicit unset only when measure is\n // removed while mounted.\n node.setMeasureFn(null)\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [node, measure])\n\n return { host, node, flat, visual, cssClass }\n}\n\nexport type RnContainerOptions = {\n // Overrides the default engine-rect measure (the window root reports 0 so\n // the window can shrink freely below the current content size; the\n // intrinsic root measures its content through Yoga, honoring forSize for\n // height-for-width).\n measure?: (orientation: \"horizontal\" | \"vertical\", forSize: number) => number\n // Runs before children are placed — the window root syncs the engine\n // viewport to the actual allocation here.\n beforeAllocate?: (width: number, height: number) => void\n}\n\n// Containers (Root, View, Animated.View, ScrollView content) drive their GTK\n// side with an RnGtkxLayout: measure() reports the engine rect of `node`\n// (minimum == natural — GTK minimums of children never leak upward), and\n// allocate() places every child widget at exactly its stored engine rect\n// plus the Animated offset.\nexport const useRnContainer = (\n widgetRef: RefObject<Gtk.Widget | null>,\n node: LayoutNode,\n options?: RnContainerOptions,\n): void => {\n const optionsRef = useRef<RnContainerOptions | undefined>(options)\n optionsRef.current = options\n useLayoutEffect(() => {\n const widget = widgetRef.current\n if (!widget) {\n return\n }\n attachRnLayout(widget, {\n measure: (orientation, forSize) => {\n const custom = optionsRef.current?.measure\n if (custom) {\n return custom(orientation, forSize)\n }\n const rect = node.getRect()\n return Math.round(\n (orientation === \"horizontal\" ? rect?.width : rect?.height) ?? 0,\n )\n },\n allocate: (width, height) => {\n const start = perfEnabled ? perfNow() : 0\n perfAllocDepth += 1\n optionsRef.current?.beforeAllocate?.(width, height)\n let child = widget.getFirstChild()\n let children = 0\n while (child) {\n const rect = getStoredRect(child)\n if (rect) {\n const offset = getStoredOffset(child)\n allocateChild(\n child,\n rect.x + offset.dx,\n rect.y + offset.dy,\n rect.width,\n rect.height,\n offset.matrix,\n )\n children += 1\n }\n child = child.getNextSibling()\n }\n perfAllocDepth -= 1\n if (perfEnabled) {\n perfCount(\"gtk.allocPass\")\n perfCount(\"gtk.allocChild\", children)\n if (perfAllocDepth === 0) {\n const elapsed = perfNow() - start\n perfAddTime(\"gtk.allocTop\", elapsed)\n perfBurst(\"gtk.allocMsPerFrame\", elapsed)\n }\n }\n },\n })\n return () => {\n detachRnLayout(widget)\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [])\n}\n"]}
|
package/dist/contracts.d.ts
CHANGED
|
@@ -44,6 +44,7 @@ export type LayoutStyle = Partial<{
|
|
|
44
44
|
top: DimensionValue;
|
|
45
45
|
width: DimensionValue;
|
|
46
46
|
}>;
|
|
47
|
+
export type Angle = `${number}deg` | `${number}rad`;
|
|
47
48
|
export type TransformPart = {
|
|
48
49
|
translateX: number;
|
|
49
50
|
} | {
|
|
@@ -55,7 +56,17 @@ export type TransformPart = {
|
|
|
55
56
|
} | {
|
|
56
57
|
scaleY: number;
|
|
57
58
|
} | {
|
|
58
|
-
rotate:
|
|
59
|
+
rotate: Angle;
|
|
60
|
+
} | {
|
|
61
|
+
rotateZ: Angle;
|
|
62
|
+
};
|
|
63
|
+
export type Transform2D = {
|
|
64
|
+
xx: number;
|
|
65
|
+
yx: number;
|
|
66
|
+
xy: number;
|
|
67
|
+
yy: number;
|
|
68
|
+
dx: number;
|
|
69
|
+
dy: number;
|
|
59
70
|
};
|
|
60
71
|
export type VisualStyle = Partial<{
|
|
61
72
|
backgroundColor: string;
|
package/dist/contracts.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
// Shared contracts between the layout engine
|
|
2
|
-
//
|
|
3
|
-
// FROZEN during parallel development: changes go through the orchestrator only.
|
|
1
|
+
// Shared contracts between the layout engine, the style system, the API
|
|
2
|
+
// modules and the components — the one module every layer may import.
|
|
4
3
|
export {};
|
|
5
4
|
//# sourceMappingURL=contracts.js.map
|
package/dist/contracts.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contracts.js","sourceRoot":"","sources":["../src/contracts.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"contracts.js","sourceRoot":"","sources":["../src/contracts.ts"],"names":[],"mappings":"AAAA,wEAAwE;AACxE,sEAAsE","sourcesContent":["// Shared contracts between the layout engine, the style system, the API\n// modules and the components — the one module every layer may import.\n\n// --- style ------------------------------------------------------------------\n\nexport type DimensionValue = number | `${number}%` | \"auto\"\n\nexport type FlexAlignType =\n \"flex-start\" | \"flex-end\" | \"center\" | \"stretch\" | \"baseline\"\n\n// Layout-affecting props: classified by the style system, consumed by the\n// layout engine, which maps them onto Yoga node setters.\nexport type LayoutStyle = Partial<{\n alignContent:\n | \"flex-start\"\n | \"flex-end\"\n | \"center\"\n | \"stretch\"\n | \"space-between\"\n | \"space-around\"\n alignItems: FlexAlignType\n alignSelf: \"auto\" | FlexAlignType\n aspectRatio: number | string\n bottom: DimensionValue\n columnGap: number\n direction: \"inherit\" | \"ltr\" | \"rtl\"\n display: \"none\" | \"flex\"\n flex: number\n flexBasis: DimensionValue\n flexDirection: \"row\" | \"row-reverse\" | \"column\" | \"column-reverse\"\n flexGrow: number\n flexShrink: number\n flexWrap: \"wrap\" | \"nowrap\" | \"wrap-reverse\"\n gap: number\n height: DimensionValue\n justifyContent:\n | \"flex-start\"\n | \"flex-end\"\n | \"center\"\n | \"space-between\"\n | \"space-around\"\n | \"space-evenly\"\n left: DimensionValue\n margin: DimensionValue\n marginBottom: DimensionValue\n marginHorizontal: DimensionValue\n marginLeft: DimensionValue\n marginRight: DimensionValue\n marginTop: DimensionValue\n marginVertical: DimensionValue\n maxHeight: DimensionValue\n maxWidth: DimensionValue\n minHeight: DimensionValue\n minWidth: DimensionValue\n overflow: \"visible\" | \"hidden\" | \"scroll\"\n padding: DimensionValue\n paddingBottom: DimensionValue\n paddingHorizontal: DimensionValue\n paddingLeft: DimensionValue\n paddingRight: DimensionValue\n paddingTop: DimensionValue\n paddingVertical: DimensionValue\n position: \"absolute\" | \"relative\" | \"static\"\n right: DimensionValue\n rowGap: number\n top: DimensionValue\n width: DimensionValue\n}>\n\nexport type Angle = `${number}deg` | `${number}rad`\n\nexport type TransformPart =\n | { translateX: number }\n | { translateY: number }\n | { scale: number }\n | { scaleX: number }\n | { scaleY: number }\n | { rotate: Angle }\n // RN's 2D alias for `rotate` (rotation about the Z axis).\n | { rotateZ: Angle }\n\n// A 2D affine transform in the component order GSK and cairo use:\n// x' = xx * x + xy * y + dx\n// y' = yx * x + yy * y + dy\n// This is exactly the argument order of gsk_transform_matrix2d(), so a\n// composed TransformPart[] reaches GTK in a single FFI call.\nexport type Transform2D = {\n xx: number\n yx: number\n xy: number\n yy: number\n dx: number\n dy: number\n}\n\n// Visual props: classified by the style system, compiled into GTK CSS\n// classes via the bridge `css` helper. Text-specific props apply to <Text>.\nexport type VisualStyle = Partial<{\n backgroundColor: string\n borderBottomColor: string\n borderBottomLeftRadius: number\n borderBottomRightRadius: number\n borderBottomWidth: number\n borderColor: string\n borderLeftColor: string\n borderLeftWidth: number\n borderRadius: number\n borderRightColor: string\n borderRightWidth: number\n borderStyle: \"solid\" | \"dotted\" | \"dashed\"\n borderTopColor: string\n borderTopLeftRadius: number\n borderTopRightRadius: number\n borderTopWidth: number\n borderWidth: number\n color: string\n fontFamily: string\n fontSize: number\n fontStyle: \"normal\" | \"italic\"\n fontWeight:\n | \"normal\"\n | \"bold\"\n | \"100\"\n | \"200\"\n | \"300\"\n | \"400\"\n | \"500\"\n | \"600\"\n | \"700\"\n | \"800\"\n | \"900\"\n letterSpacing: number\n lineHeight: number\n opacity: number\n // NOT emitted to CSS (no such GTK CSS property): the Text component applies\n // it via label props using the pure style/text-align helper.\n textAlign: \"auto\" | \"left\" | \"right\" | \"center\" | \"justify\"\n // NOT emitted to CSS (GTK4 has no widget `transform` property): composed\n // into a Transform2D by style/transform.ts and applied as the GskTransform\n // of the child's allocation by the container's layout manager.\n transform: TransformPart[]\n}>\n\n// RN pointerEvents (also allowed in styles since RN 0.71); behavioral, so\n// it belongs to neither the layout nor the visual bucket — splitStyle\n// ignores it and View reads it from the flattened style.\nexport type PointerEventsValue = \"auto\" | \"none\" | \"box-none\" | \"box-only\"\n\nexport type FlatStyle = LayoutStyle &\n VisualStyle & {\n pointerEvents?: PointerEventsValue\n }\n\n// Style prop as components accept it: single object, array (with falsy holes).\nexport type StyleProp<T = FlatStyle> =\n T | null | undefined | false | ReadonlyArray<StyleProp<T>>\n\n// Result of classifying a flattened style (produced by the style system):\nexport type SplitStyle = {\n layout: LayoutStyle\n visual: VisualStyle\n}\n\n// --- layout engine ----------------------------------------------------------\n\nexport type Rect = {\n x: number\n y: number\n width: number\n height: number\n}\n\nexport type MeasureConstraintMode = \"undefined\" | \"exactly\" | \"at-most\"\n\nexport type MeasureSize = { width: number; height: number }\n\n// Measure callback for leaf nodes (text, images): implemented by components\n// using bridge probes; called by the engine during Yoga layout passes.\nexport type MeasureFn = (\n width: number,\n widthMode: MeasureConstraintMode,\n height: number,\n heightMode: MeasureConstraintMode,\n) => MeasureSize\n\n// Handle the layout engine gives every mounted component.\nexport interface LayoutNodeApi {\n setStyle(style: LayoutStyle): void\n setMeasureFn(measure: MeasureFn | null): void\n markDirty(): void\n getRect(): Rect | null\n setOnLayout(callback: ((rect: Rect) => void) | null): void\n}\n\n// --- subscriptions ----------------------------------------------------------\n\nexport type SubscriptionHandle = { remove(): void }\n"]}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export * from "./widgets.generated";
|
|
2
|
+
export { Gdk, Gio, GLib, GObject, Gtk, Pango } from "../gtkx/bridge/index";
|
|
3
|
+
export { GMenu, GSimpleAction, GtkAdjustment, GtkDragSource, GtkDropTarget, GtkShortcut, GtkShortcutController, GtkTextBuffer, } from "../gtkx/bridge/index";
|
|
4
|
+
export { useBindSetting, useSetting, type SettingsSchema, type SettingsSchemaKeys, type SettingValue, } from "../gtkx/bridge/index";
|
|
5
|
+
export { css, cx, injectGlobal } from "../gtkx/bridge/index";
|
|
6
|
+
export { quit, useApplication, useParentWindow } from "../gtkx/bridge/index";
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
// The full GTK widget surface lives in a generated file: every Gtk.Widget
|
|
2
|
+
// subclass gtkx binds, wrapped so React Native drives it. See
|
|
3
|
+
// scripts/generate-widget-surface.ts and
|
|
4
|
+
// scripts/widget-surface/classification.json for how the list is derived.
|
|
5
|
+
export * from "./widgets.generated";
|
|
6
|
+
// The GTK namespaces themselves, exported as values because they carry both
|
|
7
|
+
// the enums you need at runtime — `hscrollbarPolicy={Gtk.PolicyType.NEVER}` —
|
|
8
|
+
// and the types you need for refs.
|
|
9
|
+
export { Gdk, Gio, GLib, GObject, Gtk, Pango } from "../gtkx/bridge/index";
|
|
10
|
+
// Auxiliary JSX elements that are not Gtk.Widget subclasses, so the
|
|
11
|
+
// generated widget surface above never sees them — real building blocks a
|
|
12
|
+
// non-trivial app still needs: actions and menus (Gio, used through
|
|
13
|
+
// `Gtk.Application`/`Gtk.ApplicationWindow`), a text buffer and an
|
|
14
|
+
// adjustment (the model objects `GtkTextView`/`GtkSpinRow`-style widgets
|
|
15
|
+
// bind to), keyboard shortcuts, and the two drag-and-drop controllers. See
|
|
16
|
+
// docs/platform-layer.md "Unwrapped by necessity".
|
|
17
|
+
export { GMenu, GSimpleAction, GtkAdjustment, GtkDragSource, GtkDropTarget, GtkShortcut, GtkShortcutController, GtkTextBuffer, } from "../gtkx/bridge/index";
|
|
18
|
+
// GSettings: reads and writes backed by a compiled `.gschema.xml` schema.
|
|
19
|
+
// `useSetting`/`useBindSetting` come straight from @gtkx/react; loading a
|
|
20
|
+
// `.gschema.xml` file into the `SettingsSchema` object they expect is a
|
|
21
|
+
// build-time concern (see docs/platform-layer.md).
|
|
22
|
+
export { useBindSetting, useSetting, } from "../gtkx/bridge/index";
|
|
23
|
+
// @gtkx/css — a real GTK CSS class from a tagged template, the same
|
|
24
|
+
// mechanism the style prop's visual half uses under the hood. Re-exported
|
|
25
|
+
// here rather than left to a direct @gtkx/css dependency for the same
|
|
26
|
+
// reason the namespaces above are: one subpath for the whole gtkx toolkit
|
|
27
|
+
// surface, not just Gtk.Widget subclasses. `GObject` above is exported
|
|
28
|
+
// mainly for `GObject.Value` — constructing a boxed value is required by
|
|
29
|
+
// APIs like `Adw.Breakpoint.addSetter`, which reject a bare JS primitive
|
|
30
|
+
// (see docs/platform-layer.md, "Two ways to react to size").
|
|
31
|
+
export { css, cx, injectGlobal } from "../gtkx/bridge/index";
|
|
32
|
+
// The window and application AppRegistry itself sits on: useParentWindow
|
|
33
|
+
// reaches the Gtk.Window ancestor (for anything not modeled by a prop —
|
|
34
|
+
// e.g. binding a GSettings key to its own defaultWidth/defaultHeight),
|
|
35
|
+
// useApplication reaches the Adw.Application (e.g. to send a
|
|
36
|
+
// Gio.Notification), quit tears the whole app down programmatically (the
|
|
37
|
+
// same function AppRegistry wires to a window's own close button).
|
|
38
|
+
export { quit, useApplication, useParentWindow } from "../gtkx/bridge/index";
|
|
39
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/gtk/index.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,8DAA8D;AAC9D,yCAAyC;AACzC,0EAA0E;AAC1E,cAAc,qBAAqB,CAAA;AAEnC,4EAA4E;AAC5E,8EAA8E;AAC9E,mCAAmC;AACnC,OAAO,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAA;AAE1E,oEAAoE;AACpE,0EAA0E;AAC1E,oEAAoE;AACpE,mEAAmE;AACnE,yEAAyE;AACzE,2EAA2E;AAC3E,mDAAmD;AACnD,OAAO,EACL,KAAK,EACL,aAAa,EACb,aAAa,EACb,aAAa,EACb,aAAa,EACb,WAAW,EACX,qBAAqB,EACrB,aAAa,GACd,MAAM,sBAAsB,CAAA;AAE7B,0EAA0E;AAC1E,0EAA0E;AAC1E,wEAAwE;AACxE,mDAAmD;AACnD,OAAO,EACL,cAAc,EACd,UAAU,GAIX,MAAM,sBAAsB,CAAA;AAE7B,oEAAoE;AACpE,0EAA0E;AAC1E,sEAAsE;AACtE,0EAA0E;AAC1E,uEAAuE;AACvE,yEAAyE;AACzE,yEAAyE;AACzE,6DAA6D;AAC7D,OAAO,EAAE,GAAG,EAAE,EAAE,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AAE5D,yEAAyE;AACzE,wEAAwE;AACxE,uEAAuE;AACvE,6DAA6D;AAC7D,yEAAyE;AACzE,mEAAmE;AACnE,OAAO,EAAE,IAAI,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA","sourcesContent":["// The full GTK widget surface lives in a generated file: every Gtk.Widget\n// subclass gtkx binds, wrapped so React Native drives it. See\n// scripts/generate-widget-surface.ts and\n// scripts/widget-surface/classification.json for how the list is derived.\nexport * from \"./widgets.generated\"\n\n// The GTK namespaces themselves, exported as values because they carry both\n// the enums you need at runtime — `hscrollbarPolicy={Gtk.PolicyType.NEVER}` —\n// and the types you need for refs.\nexport { Gdk, Gio, GLib, GObject, Gtk, Pango } from \"../gtkx/bridge/index\"\n\n// Auxiliary JSX elements that are not Gtk.Widget subclasses, so the\n// generated widget surface above never sees them — real building blocks a\n// non-trivial app still needs: actions and menus (Gio, used through\n// `Gtk.Application`/`Gtk.ApplicationWindow`), a text buffer and an\n// adjustment (the model objects `GtkTextView`/`GtkSpinRow`-style widgets\n// bind to), keyboard shortcuts, and the two drag-and-drop controllers. See\n// docs/platform-layer.md \"Unwrapped by necessity\".\nexport {\n GMenu,\n GSimpleAction,\n GtkAdjustment,\n GtkDragSource,\n GtkDropTarget,\n GtkShortcut,\n GtkShortcutController,\n GtkTextBuffer,\n} from \"../gtkx/bridge/index\"\n\n// GSettings: reads and writes backed by a compiled `.gschema.xml` schema.\n// `useSetting`/`useBindSetting` come straight from @gtkx/react; loading a\n// `.gschema.xml` file into the `SettingsSchema` object they expect is a\n// build-time concern (see docs/platform-layer.md).\nexport {\n useBindSetting,\n useSetting,\n type SettingsSchema,\n type SettingsSchemaKeys,\n type SettingValue,\n} from \"../gtkx/bridge/index\"\n\n// @gtkx/css — a real GTK CSS class from a tagged template, the same\n// mechanism the style prop's visual half uses under the hood. Re-exported\n// here rather than left to a direct @gtkx/css dependency for the same\n// reason the namespaces above are: one subpath for the whole gtkx toolkit\n// surface, not just Gtk.Widget subclasses. `GObject` above is exported\n// mainly for `GObject.Value` — constructing a boxed value is required by\n// APIs like `Adw.Breakpoint.addSetter`, which reject a bare JS primitive\n// (see docs/platform-layer.md, \"Two ways to react to size\").\nexport { css, cx, injectGlobal } from \"../gtkx/bridge/index\"\n\n// The window and application AppRegistry itself sits on: useParentWindow\n// reaches the Gtk.Window ancestor (for anything not modeled by a prop —\n// e.g. binding a GSettings key to its own defaultWidth/defaultHeight),\n// useApplication reaches the Adw.Application (e.g. to send a\n// Gio.Notification), quit tears the whole app down programmatically (the\n// same function AppRegistry wires to a window's own close button).\nexport { quit, useApplication, useParentWindow } from \"../gtkx/bridge/index\"\n"]}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
export declare const GtkActionBar: React.ComponentType<import("@gtkx/jsx/gtk").GtkActionBarProps<import("@gtkx/gi/gtk").ActionBar> & import("../common").ReactNativeLayoutProps>;
|
|
2
|
+
export declare const GtkAppChooserButton: React.ComponentType<import("@gtkx/jsx/gtk").GtkAppChooserButtonProps<import("@gtkx/gi/gtk").AppChooserButton> & import("../common").ReactNativeLayoutProps>;
|
|
3
|
+
export declare const GtkAppChooserWidget: React.ComponentType<import("@gtkx/jsx/gtk").GtkAppChooserWidgetProps<import("@gtkx/gi/gtk").AppChooserWidget> & import("../common").ReactNativeLayoutProps>;
|
|
4
|
+
export declare const GtkAspectFrame: React.ComponentType<import("@gtkx/jsx/gtk").GtkAspectFrameProps<import("@gtkx/gi/gtk").AspectFrame> & import("../common").ReactNativeLayoutProps>;
|
|
5
|
+
export declare const GtkBox: React.ComponentType<import("@gtkx/jsx/gtk").GtkBoxProps<import("@gtkx/gi/gtk").Box> & import("../common").ReactNativeLayoutProps>;
|
|
6
|
+
export declare const GtkButton: React.ComponentType<import("@gtkx/jsx/gtk").GtkButtonProps<import("@gtkx/gi/gtk").Button> & import("../common").ReactNativeLayoutProps>;
|
|
7
|
+
export declare const GtkCalendar: React.ComponentType<import("@gtkx/jsx/gtk").GtkCalendarProps<import("@gtkx/gi/gtk").Calendar> & import("../common").ReactNativeLayoutProps>;
|
|
8
|
+
export declare const GtkCellView: React.ComponentType<import("@gtkx/jsx/gtk").GtkCellViewProps<import("@gtkx/gi/gtk").CellView> & import("../common").ReactNativeLayoutProps>;
|
|
9
|
+
export declare const GtkCenterBox: React.ComponentType<import("@gtkx/jsx/gtk").GtkCenterBoxProps<import("@gtkx/gi/gtk").CenterBox> & import("../common").ReactNativeLayoutProps>;
|
|
10
|
+
export declare const GtkCheckButton: React.ComponentType<import("@gtkx/jsx/gtk").GtkCheckButtonProps<import("@gtkx/gi/gtk").CheckButton> & import("../common").ReactNativeLayoutProps>;
|
|
11
|
+
export declare const GtkColorButton: React.ComponentType<import("@gtkx/jsx/gtk").GtkColorButtonProps<import("@gtkx/gi/gtk").ColorButton> & import("../common").ReactNativeLayoutProps>;
|
|
12
|
+
export declare const GtkColorChooserWidget: React.ComponentType<import("@gtkx/jsx/gtk").GtkColorChooserWidgetProps<import("@gtkx/gi/gtk").ColorChooserWidget> & import("../common").ReactNativeLayoutProps>;
|
|
13
|
+
export declare const GtkColorDialogButton: React.ComponentType<import("@gtkx/jsx/gtk").GtkColorDialogButtonProps<import("@gtkx/gi/gtk").ColorDialogButton> & import("../common").ReactNativeLayoutProps>;
|
|
14
|
+
export declare const GtkColumnView: React.ComponentType<import("@gtkx/jsx/gtk").GtkColumnViewProps<import("@gtkx/gi/gtk").ColumnView> & import("../common").ReactNativeLayoutProps>;
|
|
15
|
+
export declare const GtkComboBox: React.ComponentType<import("@gtkx/jsx/gtk").GtkComboBoxProps<import("@gtkx/gi/gtk").ComboBox> & import("../common").ReactNativeLayoutProps>;
|
|
16
|
+
export declare const GtkComboBoxText: React.ComponentType<import("@gtkx/jsx/gtk").GtkComboBoxTextProps<import("@gtkx/gi/gtk").ComboBoxText> & import("../common").ReactNativeLayoutProps>;
|
|
17
|
+
export declare const GtkDragIcon: React.ComponentType<import("@gtkx/jsx/gtk").GtkDragIconProps<import("@gtkx/gi/gtk").DragIcon> & import("../common").ReactNativeLayoutProps>;
|
|
18
|
+
export declare const GtkDrawingArea: React.ComponentType<import("@gtkx/jsx/gtk").GtkDrawingAreaProps<import("@gtkx/gi/gtk").DrawingArea> & import("../common").ReactNativeLayoutProps>;
|
|
19
|
+
export declare const GtkDropDown: React.ComponentType<import("@gtkx/jsx/gtk").GtkDropDownProps<import("@gtkx/gi/gtk").DropDown> & import("../common").ReactNativeLayoutProps>;
|
|
20
|
+
export declare const GtkEditableLabel: React.ComponentType<import("@gtkx/jsx/gtk").GtkEditableLabelProps<import("@gtkx/gi/gtk").EditableLabel> & import("../common").ReactNativeLayoutProps>;
|
|
21
|
+
export declare const GtkEmojiChooser: React.ComponentType<import("@gtkx/jsx/gtk").GtkEmojiChooserProps<import("@gtkx/gi/gtk").EmojiChooser> & import("../common").ReactNativeLayoutProps>;
|
|
22
|
+
export declare const GtkEntry: React.ComponentType<import("@gtkx/jsx/gtk").GtkEntryProps<import("@gtkx/gi/gtk").Entry> & import("../common").ReactNativeLayoutProps>;
|
|
23
|
+
export declare const GtkExpander: React.ComponentType<import("@gtkx/jsx/gtk").GtkExpanderProps<import("@gtkx/gi/gtk").Expander> & import("../common").ReactNativeLayoutProps>;
|
|
24
|
+
export declare const GtkFileChooserWidget: React.ComponentType<import("@gtkx/jsx/gtk").GtkFileChooserWidgetProps<import("@gtkx/gi/gtk").FileChooserWidget> & import("../common").ReactNativeLayoutProps>;
|
|
25
|
+
export declare const GtkFixed: React.ComponentType<import("@gtkx/jsx/gtk").GtkFixedProps<import("@gtkx/gi/gtk").Fixed> & import("../common").ReactNativeLayoutProps>;
|
|
26
|
+
export declare const GtkFlowBox: React.ComponentType<import("@gtkx/jsx/gtk").GtkFlowBoxProps<import("@gtkx/gi/gtk").FlowBox> & import("../common").ReactNativeLayoutProps>;
|
|
27
|
+
export declare const GtkFontButton: React.ComponentType<import("@gtkx/jsx/gtk").GtkFontButtonProps<import("@gtkx/gi/gtk").FontButton> & import("../common").ReactNativeLayoutProps>;
|
|
28
|
+
export declare const GtkFontChooserWidget: React.ComponentType<import("@gtkx/jsx/gtk").GtkFontChooserWidgetProps<import("@gtkx/gi/gtk").FontChooserWidget> & import("../common").ReactNativeLayoutProps>;
|
|
29
|
+
export declare const GtkFontDialogButton: React.ComponentType<import("@gtkx/jsx/gtk").GtkFontDialogButtonProps<import("@gtkx/gi/gtk").FontDialogButton> & import("../common").ReactNativeLayoutProps>;
|
|
30
|
+
export declare const GtkFrame: React.ComponentType<import("@gtkx/jsx/gtk").GtkFrameProps<import("@gtkx/gi/gtk").Frame> & import("../common").ReactNativeLayoutProps>;
|
|
31
|
+
export declare const GtkGLArea: React.ComponentType<import("@gtkx/jsx/gtk").GtkGLAreaProps<import("@gtkx/gi/gtk").GLArea> & import("../common").ReactNativeLayoutProps>;
|
|
32
|
+
export declare const GtkGraphicsOffload: React.ComponentType<import("@gtkx/jsx/gtk").GtkGraphicsOffloadProps<import("@gtkx/gi/gtk").GraphicsOffload> & import("../common").ReactNativeLayoutProps>;
|
|
33
|
+
export declare const GtkGrid: React.ComponentType<import("@gtkx/jsx/gtk").GtkGridProps<import("@gtkx/gi/gtk").Grid> & import("../common").ReactNativeLayoutProps>;
|
|
34
|
+
export declare const GtkGridView: React.ComponentType<import("@gtkx/jsx/gtk").GtkGridViewProps<import("@gtkx/gi/gtk").GridView> & import("../common").ReactNativeLayoutProps>;
|
|
35
|
+
export declare const GtkHeaderBar: React.ComponentType<import("@gtkx/jsx/gtk").GtkHeaderBarProps<import("@gtkx/gi/gtk").HeaderBar> & import("../common").ReactNativeLayoutProps>;
|
|
36
|
+
export declare const GtkIconView: React.ComponentType<import("@gtkx/jsx/gtk").GtkIconViewProps<import("@gtkx/gi/gtk").IconView> & import("../common").ReactNativeLayoutProps>;
|
|
37
|
+
export declare const GtkImage: React.ComponentType<import("@gtkx/jsx/gtk").GtkImageProps<import("@gtkx/gi/gtk").Image> & import("../common").ReactNativeLayoutProps>;
|
|
38
|
+
export declare const GtkInfoBar: React.ComponentType<import("@gtkx/jsx/gtk").GtkInfoBarProps<import("@gtkx/gi/gtk").InfoBar> & import("../common").ReactNativeLayoutProps>;
|
|
39
|
+
export declare const GtkInscription: React.ComponentType<import("@gtkx/jsx/gtk").GtkInscriptionProps<import("@gtkx/gi/gtk").Inscription> & import("../common").ReactNativeLayoutProps>;
|
|
40
|
+
export declare const GtkLabel: React.ComponentType<import("@gtkx/jsx/gtk").GtkLabelProps<import("@gtkx/gi/gtk").Label> & import("../common").ReactNativeLayoutProps>;
|
|
41
|
+
export declare const GtkLevelBar: React.ComponentType<import("@gtkx/jsx/gtk").GtkLevelBarProps<import("@gtkx/gi/gtk").LevelBar> & import("../common").ReactNativeLayoutProps>;
|
|
42
|
+
export declare const GtkLinkButton: React.ComponentType<import("@gtkx/jsx/gtk").GtkLinkButtonProps<import("@gtkx/gi/gtk").LinkButton> & import("../common").ReactNativeLayoutProps>;
|
|
43
|
+
export declare const GtkListBox: React.ComponentType<import("@gtkx/jsx/gtk").GtkListBoxProps<import("@gtkx/gi/gtk").ListBox> & import("../common").ReactNativeLayoutProps>;
|
|
44
|
+
export declare const GtkListView: React.ComponentType<import("@gtkx/jsx/gtk").GtkListViewProps<import("@gtkx/gi/gtk").ListView> & import("../common").ReactNativeLayoutProps>;
|
|
45
|
+
export declare const GtkLockButton: React.ComponentType<import("@gtkx/jsx/gtk").GtkLockButtonProps<import("@gtkx/gi/gtk").LockButton> & import("../common").ReactNativeLayoutProps>;
|
|
46
|
+
export declare const GtkMediaControls: React.ComponentType<import("@gtkx/jsx/gtk").GtkMediaControlsProps<import("@gtkx/gi/gtk").MediaControls> & import("../common").ReactNativeLayoutProps>;
|
|
47
|
+
export declare const GtkMenuButton: React.ComponentType<import("@gtkx/jsx/gtk").GtkMenuButtonProps<import("@gtkx/gi/gtk").MenuButton> & import("../common").ReactNativeLayoutProps>;
|
|
48
|
+
export declare const GtkNotebook: React.ComponentType<import("@gtkx/jsx/gtk").GtkNotebookProps<import("@gtkx/gi/gtk").Notebook> & import("../common").ReactNativeLayoutProps>;
|
|
49
|
+
export declare const GtkOverlay: React.ComponentType<import("@gtkx/jsx/gtk").GtkOverlayProps<import("@gtkx/gi/gtk").Overlay> & import("../common").ReactNativeLayoutProps>;
|
|
50
|
+
export declare const GtkPaned: React.ComponentType<import("@gtkx/jsx/gtk").GtkPanedProps<import("@gtkx/gi/gtk").Paned> & import("../common").ReactNativeLayoutProps>;
|
|
51
|
+
export declare const GtkPasswordEntry: React.ComponentType<import("@gtkx/jsx/gtk").GtkPasswordEntryProps<import("@gtkx/gi/gtk").PasswordEntry> & import("../common").ReactNativeLayoutProps>;
|
|
52
|
+
export declare const GtkPicture: React.ComponentType<import("@gtkx/jsx/gtk").GtkPictureProps<import("@gtkx/gi/gtk").Picture> & import("../common").ReactNativeLayoutProps>;
|
|
53
|
+
export declare const GtkPopover: React.ComponentType<import("@gtkx/jsx/gtk").GtkPopoverProps<import("@gtkx/gi/gtk").Popover> & import("../common").ReactNativeLayoutProps>;
|
|
54
|
+
export declare const GtkPopoverBin: React.ComponentType<import("@gtkx/jsx/gtk").GtkPopoverBinProps<import("@gtkx/gi/gtk").PopoverBin> & import("../common").ReactNativeLayoutProps>;
|
|
55
|
+
export declare const GtkPopoverMenu: React.ComponentType<import("@gtkx/jsx/gtk").GtkPopoverMenuProps<import("@gtkx/gi/gtk").PopoverMenu> & import("../common").ReactNativeLayoutProps>;
|
|
56
|
+
export declare const GtkPopoverMenuBar: React.ComponentType<import("@gtkx/jsx/gtk").GtkPopoverMenuBarProps<import("@gtkx/gi/gtk").PopoverMenuBar> & import("../common").ReactNativeLayoutProps>;
|
|
57
|
+
export declare const GtkProgressBar: React.ComponentType<import("@gtkx/jsx/gtk").GtkProgressBarProps<import("@gtkx/gi/gtk").ProgressBar> & import("../common").ReactNativeLayoutProps>;
|
|
58
|
+
export declare const GtkRange: React.ComponentType<import("@gtkx/jsx/gtk").GtkRangeProps<import("@gtkx/gi/gtk").Range> & import("../common").ReactNativeLayoutProps>;
|
|
59
|
+
export declare const GtkRevealer: React.ComponentType<import("@gtkx/jsx/gtk").GtkRevealerProps<import("@gtkx/gi/gtk").Revealer> & import("../common").ReactNativeLayoutProps>;
|
|
60
|
+
export declare const GtkScale: React.ComponentType<import("@gtkx/jsx/gtk").GtkScaleProps<import("@gtkx/gi/gtk").Scale> & import("../common").ReactNativeLayoutProps>;
|
|
61
|
+
export declare const GtkScaleButton: React.ComponentType<import("@gtkx/jsx/gtk").GtkScaleButtonProps<import("@gtkx/gi/gtk").ScaleButton> & import("../common").ReactNativeLayoutProps>;
|
|
62
|
+
export declare const GtkScrollbar: React.ComponentType<import("@gtkx/jsx/gtk").GtkScrollbarProps<import("@gtkx/gi/gtk").Scrollbar> & import("../common").ReactNativeLayoutProps>;
|
|
63
|
+
export declare const GtkScrolledWindow: React.ComponentType<import("@gtkx/jsx/gtk").GtkScrolledWindowProps<import("@gtkx/gi/gtk").ScrolledWindow> & import("../common").ReactNativeLayoutProps>;
|
|
64
|
+
export declare const GtkSearchBar: React.ComponentType<import("@gtkx/jsx/gtk").GtkSearchBarProps<import("@gtkx/gi/gtk").SearchBar> & import("../common").ReactNativeLayoutProps>;
|
|
65
|
+
export declare const GtkSearchEntry: React.ComponentType<import("@gtkx/jsx/gtk").GtkSearchEntryProps<import("@gtkx/gi/gtk").SearchEntry> & import("../common").ReactNativeLayoutProps>;
|
|
66
|
+
export declare const GtkSeparator: React.ComponentType<import("@gtkx/jsx/gtk").GtkSeparatorProps<import("@gtkx/gi/gtk").Separator> & import("../common").ReactNativeLayoutProps>;
|
|
67
|
+
export declare const GtkShortcutLabel: React.ComponentType<import("@gtkx/jsx/gtk").GtkShortcutLabelProps<import("@gtkx/gi/gtk").ShortcutLabel> & import("../common").ReactNativeLayoutProps>;
|
|
68
|
+
export declare const GtkShortcutsGroup: React.ComponentType<import("@gtkx/jsx/gtk").GtkShortcutsGroupProps<import("@gtkx/gi/gtk").ShortcutsGroup> & import("../common").ReactNativeLayoutProps>;
|
|
69
|
+
export declare const GtkShortcutsSection: React.ComponentType<import("@gtkx/jsx/gtk").GtkShortcutsSectionProps<import("@gtkx/gi/gtk").ShortcutsSection> & import("../common").ReactNativeLayoutProps>;
|
|
70
|
+
export declare const GtkShortcutsShortcut: React.ComponentType<import("@gtkx/jsx/gtk").GtkShortcutsShortcutProps<import("@gtkx/gi/gtk").ShortcutsShortcut> & import("../common").ReactNativeLayoutProps>;
|
|
71
|
+
export declare const GtkSpinButton: React.ComponentType<import("@gtkx/jsx/gtk").GtkSpinButtonProps<import("@gtkx/gi/gtk").SpinButton> & import("../common").ReactNativeLayoutProps>;
|
|
72
|
+
export declare const GtkSpinner: React.ComponentType<import("@gtkx/jsx/gtk").GtkSpinnerProps<import("@gtkx/gi/gtk").Spinner> & import("../common").ReactNativeLayoutProps>;
|
|
73
|
+
export declare const GtkStack: React.ComponentType<import("@gtkx/jsx/gtk").GtkStackProps<import("@gtkx/gi/gtk").Stack> & import("../common").ReactNativeLayoutProps>;
|
|
74
|
+
export declare const GtkStackSidebar: React.ComponentType<import("@gtkx/jsx/gtk").GtkStackSidebarProps<import("@gtkx/gi/gtk").StackSidebar> & import("../common").ReactNativeLayoutProps>;
|
|
75
|
+
export declare const GtkStackSwitcher: React.ComponentType<import("@gtkx/jsx/gtk").GtkStackSwitcherProps<import("@gtkx/gi/gtk").StackSwitcher> & import("../common").ReactNativeLayoutProps>;
|
|
76
|
+
export declare const GtkStatusbar: React.ComponentType<import("@gtkx/jsx/gtk").GtkStatusbarProps<import("@gtkx/gi/gtk").Statusbar> & import("../common").ReactNativeLayoutProps>;
|
|
77
|
+
export declare const GtkSwitch: React.ComponentType<import("@gtkx/jsx/gtk").GtkSwitchProps<import("@gtkx/gi/gtk").Switch> & import("../common").ReactNativeLayoutProps>;
|
|
78
|
+
export declare const GtkText: React.ComponentType<import("@gtkx/jsx/gtk").GtkTextProps<import("@gtkx/gi/gtk").Text> & import("../common").ReactNativeLayoutProps>;
|
|
79
|
+
export declare const GtkTextView: React.ComponentType<import("@gtkx/jsx/gtk").GtkTextViewProps<import("@gtkx/gi/gtk").TextView> & import("../common").ReactNativeLayoutProps>;
|
|
80
|
+
export declare const GtkToggleButton: React.ComponentType<import("@gtkx/jsx/gtk").GtkToggleButtonProps<import("@gtkx/gi/gtk").ToggleButton> & import("../common").ReactNativeLayoutProps>;
|
|
81
|
+
export declare const GtkTreeExpander: React.ComponentType<import("@gtkx/jsx/gtk").GtkTreeExpanderProps<import("@gtkx/gi/gtk").TreeExpander> & import("../common").ReactNativeLayoutProps>;
|
|
82
|
+
export declare const GtkTreeView: React.ComponentType<import("@gtkx/jsx/gtk").GtkTreeViewProps<import("@gtkx/gi/gtk").TreeView> & import("../common").ReactNativeLayoutProps>;
|
|
83
|
+
export declare const GtkVideo: React.ComponentType<import("@gtkx/jsx/gtk").GtkVideoProps<import("@gtkx/gi/gtk").Video> & import("../common").ReactNativeLayoutProps>;
|
|
84
|
+
export declare const GtkViewport: React.ComponentType<import("@gtkx/jsx/gtk").GtkViewportProps<import("@gtkx/gi/gtk").Viewport> & import("../common").ReactNativeLayoutProps>;
|
|
85
|
+
export declare const GtkVolumeButton: React.ComponentType<import("@gtkx/jsx/gtk").GtkVolumeButtonProps<import("@gtkx/gi/gtk").VolumeButton> & import("../common").ReactNativeLayoutProps>;
|
|
86
|
+
export declare const GtkWindowControls: React.ComponentType<import("@gtkx/jsx/gtk").GtkWindowControlsProps<import("@gtkx/gi/gtk").WindowControls> & import("../common").ReactNativeLayoutProps>;
|
|
87
|
+
export declare const GtkWindowHandle: React.ComponentType<import("@gtkx/jsx/gtk").GtkWindowHandleProps<import("@gtkx/gi/gtk").WindowHandle> & import("../common").ReactNativeLayoutProps>;
|
|
88
|
+
export { GtkAboutDialog, // toplevel (derives Gtk.Window)
|
|
89
|
+
GtkAppChooserDialog, // toplevel (derives Gtk.Window)
|
|
90
|
+
GtkApplicationWindow, // toplevel (derives Gtk.Window)
|
|
91
|
+
GtkAssistant, // toplevel (derives Gtk.Window)
|
|
92
|
+
GtkColorChooserDialog, // toplevel (derives Gtk.Window)
|
|
93
|
+
GtkDialog, // toplevel (derives Gtk.Window)
|
|
94
|
+
GtkFileChooserDialog, // toplevel (derives Gtk.Window)
|
|
95
|
+
GtkFlowBoxChild, // child-only (derives Gtk.FlowBoxChild)
|
|
96
|
+
GtkFontChooserDialog, // toplevel (derives Gtk.Window)
|
|
97
|
+
GtkListBoxRow, // child-only (derives Gtk.ListBoxRow)
|
|
98
|
+
GtkMessageDialog, // toplevel (derives Gtk.Window)
|
|
99
|
+
GtkPageSetupUnixDialog, // toplevel (derives Gtk.Window)
|
|
100
|
+
GtkPrintUnixDialog, // toplevel (derives Gtk.Window)
|
|
101
|
+
GtkShortcutsWindow, // toplevel (derives Gtk.Window)
|
|
102
|
+
GtkWindow, } from "../gtkx/bridge/widgets.generated";
|
|
103
|
+
export declare const GTK_WRAPPED_WIDGET_NAMES: readonly ["GtkActionBar", "GtkAppChooserButton", "GtkAppChooserWidget", "GtkAspectFrame", "GtkBox", "GtkButton", "GtkCalendar", "GtkCellView", "GtkCenterBox", "GtkCheckButton", "GtkColorButton", "GtkColorChooserWidget", "GtkColorDialogButton", "GtkColumnView", "GtkComboBox", "GtkComboBoxText", "GtkDragIcon", "GtkDrawingArea", "GtkDropDown", "GtkEditableLabel", "GtkEmojiChooser", "GtkEntry", "GtkExpander", "GtkFileChooserWidget", "GtkFixed", "GtkFlowBox", "GtkFontButton", "GtkFontChooserWidget", "GtkFontDialogButton", "GtkFrame", "GtkGLArea", "GtkGraphicsOffload", "GtkGrid", "GtkGridView", "GtkHeaderBar", "GtkIconView", "GtkImage", "GtkInfoBar", "GtkInscription", "GtkLabel", "GtkLevelBar", "GtkLinkButton", "GtkListBox", "GtkListView", "GtkLockButton", "GtkMediaControls", "GtkMenuButton", "GtkNotebook", "GtkOverlay", "GtkPaned", "GtkPasswordEntry", "GtkPicture", "GtkPopover", "GtkPopoverBin", "GtkPopoverMenu", "GtkPopoverMenuBar", "GtkProgressBar", "GtkRange", "GtkRevealer", "GtkScale", "GtkScaleButton", "GtkScrollbar", "GtkScrolledWindow", "GtkSearchBar", "GtkSearchEntry", "GtkSeparator", "GtkShortcutLabel", "GtkShortcutsGroup", "GtkShortcutsSection", "GtkShortcutsShortcut", "GtkSpinButton", "GtkSpinner", "GtkStack", "GtkStackSidebar", "GtkStackSwitcher", "GtkStatusbar", "GtkSwitch", "GtkText", "GtkTextView", "GtkToggleButton", "GtkTreeExpander", "GtkTreeView", "GtkVideo", "GtkViewport", "GtkVolumeButton", "GtkWindowControls", "GtkWindowHandle"];
|