react-native-gtkx 0.1.0-alpha.2 → 0.1.0-alpha.4

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.
Files changed (105) hide show
  1. package/README.md +41 -8
  2. package/dist/animated/create-animated.js +1 -1
  3. package/dist/animated/create-animated.js.map +1 -1
  4. package/dist/animated/index.js +3 -3
  5. package/dist/animated/index.js.map +1 -1
  6. package/dist/apis/back-handler.d.ts +9 -0
  7. package/dist/apis/back-handler.js +30 -0
  8. package/dist/apis/back-handler.js.map +1 -0
  9. package/dist/apis/host.d.ts +7 -1
  10. package/dist/apis/host.gtkx.js +12 -1
  11. package/dist/apis/host.gtkx.js.map +1 -1
  12. package/dist/apis/host.js.map +1 -1
  13. package/dist/apis/i18n-manager.d.ts +14 -0
  14. package/dist/apis/i18n-manager.js +20 -0
  15. package/dist/apis/i18n-manager.js.map +1 -0
  16. package/dist/apis/index.d.ts +17 -0
  17. package/dist/apis/index.js +5 -0
  18. package/dist/apis/index.js.map +1 -1
  19. package/dist/apis/interaction-manager.d.ts +16 -0
  20. package/dist/apis/interaction-manager.js +96 -0
  21. package/dist/apis/interaction-manager.js.map +1 -0
  22. package/dist/apis/linking.d.ts +4 -0
  23. package/dist/apis/linking.js +9 -0
  24. package/dist/apis/linking.js.map +1 -1
  25. package/dist/components/app-registry.d.ts +2 -0
  26. package/dist/components/app-registry.js +19 -2
  27. package/dist/components/app-registry.js.map +1 -1
  28. package/dist/components/flat-list.d.ts +2 -0
  29. package/dist/components/flat-list.js.map +1 -1
  30. package/dist/components/index.d.ts +1 -1
  31. package/dist/components/index.js +1 -1
  32. package/dist/components/index.js.map +1 -1
  33. package/dist/components/modal.d.ts +1 -1
  34. package/dist/components/pressable.js +4 -4
  35. package/dist/components/pressable.js.map +1 -1
  36. package/dist/components/root.d.ts +10 -1
  37. package/dist/components/root.js +39 -1
  38. package/dist/components/root.js.map +1 -1
  39. package/dist/components/scroll-view.js +58 -5
  40. package/dist/components/scroll-view.js.map +1 -1
  41. package/dist/components/text-input.d.ts +1 -0
  42. package/dist/components/text-input.js +34 -5
  43. package/dist/components/text-input.js.map +1 -1
  44. package/dist/components/use-layout-child.d.ts +1 -1
  45. package/dist/components/use-layout-child.js +22 -2
  46. package/dist/components/use-layout-child.js.map +1 -1
  47. package/dist/components/virtualized-list.d.ts +2 -0
  48. package/dist/components/virtualized-list.js +132 -10
  49. package/dist/components/virtualized-list.js.map +1 -1
  50. package/dist/contracts.js +2 -3
  51. package/dist/contracts.js.map +1 -1
  52. package/dist/gtkx/bridge/index.d.ts +4 -2
  53. package/dist/gtkx/bridge/index.js +7 -3
  54. package/dist/gtkx/bridge/index.js.map +1 -1
  55. package/dist/gtkx/bridge/measure.js +5 -0
  56. package/dist/gtkx/bridge/measure.js.map +1 -1
  57. package/dist/gtkx/bridge/theme.js +1 -1
  58. package/dist/gtkx/bridge/theme.js.map +1 -1
  59. package/dist/gtkx/bridge/use-signal.d.ts +2 -0
  60. package/dist/gtkx/bridge/use-signal.js +31 -0
  61. package/dist/gtkx/bridge/use-signal.js.map +1 -0
  62. package/dist/index.d.ts +2 -2
  63. package/dist/index.js +3 -3
  64. package/dist/index.js.map +1 -1
  65. package/dist/layout/engine.d.ts +4 -0
  66. package/dist/layout/engine.js +97 -5
  67. package/dist/layout/engine.js.map +1 -1
  68. package/dist/layout/node.d.ts +1 -1
  69. package/dist/layout/node.js +8 -5
  70. package/dist/layout/node.js.map +1 -1
  71. package/dist/metro/index.js +1 -0
  72. package/dist/metro/index.js.map +1 -1
  73. package/dist/navigation/index.d.ts +44 -0
  74. package/dist/navigation/index.js +216 -0
  75. package/dist/navigation/index.js.map +1 -0
  76. package/dist/navigation/option-warnings.d.ts +2 -0
  77. package/dist/navigation/option-warnings.js +61 -0
  78. package/dist/navigation/option-warnings.js.map +1 -0
  79. package/dist/navigation/sidebar.d.ts +37 -0
  80. package/dist/navigation/sidebar.js +71 -0
  81. package/dist/navigation/sidebar.js.map +1 -0
  82. package/dist/perf.d.ts +9 -0
  83. package/dist/perf.js +156 -0
  84. package/dist/perf.js.map +1 -0
  85. package/dist/runner/host-dev.js +15 -6
  86. package/dist/runner/host-dev.js.map +1 -1
  87. package/dist/runner/host.js +24 -9
  88. package/dist/runner/host.js.map +1 -1
  89. package/dist/runner/index.js +7 -3
  90. package/dist/runner/index.js.map +1 -1
  91. package/dist/style/colors.js +3 -1
  92. package/dist/style/colors.js.map +1 -1
  93. package/dist/style/index.js +2 -2
  94. package/dist/style/index.js.map +1 -1
  95. package/dist/style/registry.gtkx.js +1 -1
  96. package/dist/style/registry.gtkx.js.map +1 -1
  97. package/dist/style/split-style.js +1 -1
  98. package/dist/style/split-style.js.map +1 -1
  99. package/dist/style/text-align.js +1 -1
  100. package/dist/style/text-align.js.map +1 -1
  101. package/dist/vite/index.d.ts +5 -4
  102. package/dist/vite/index.js +42 -7
  103. package/dist/vite/index.js.map +1 -1
  104. package/package.json +18 -10
  105. package/types.d.ts +13 -0
@@ -1 +1 @@
1
- {"version":3,"file":"colors.js","sourceRoot":"","sources":["../../src/style/colors.ts"],"names":[],"mappings":"AAAA,6EAA6E;AAC7E,2EAA2E;AAC3E,EAAE;AACF,6EAA6E;AAC7E,8EAA8E;AAC9E,mEAAmE;AACnE,2EAA2E;AAC3E,mEAAmE;AAEnE,yEAAyE;AACzE,MAAM,YAAY,GAA2B;IAC3C,SAAS,EAAE,SAAS;IACpB,YAAY,EAAE,SAAS;IACvB,IAAI,EAAE,SAAS;IACf,UAAU,EAAE,SAAS;IACrB,KAAK,EAAE,SAAS;IAChB,KAAK,EAAE,SAAS;IAChB,MAAM,EAAE,SAAS;IACjB,KAAK,EAAE,SAAS;IAChB,cAAc,EAAE,SAAS;IACzB,IAAI,EAAE,SAAS;IACf,UAAU,EAAE,SAAS;IACrB,KAAK,EAAE,SAAS;IAChB,SAAS,EAAE,SAAS;IACpB,SAAS,EAAE,SAAS;IACpB,UAAU,EAAE,SAAS;IACrB,SAAS,EAAE,SAA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AG,IAAI,CAAA;YACjB,SAAQ;QACV,CAAC;QACD,MAAM,QAAQ,GAAG,iBAAiB,CAAC,IAAI,CAAC,CAAA;QACxC,UAAU;YACR,UAAU,KAAK,IAAI;gBACjB,CAAC,CAAC,OAAO,QAAQ,GAAG;gBACpB,CAAC,CAAC,OAAO,QAAQ,KAAK,UAAU,GAAG,CAAA;IACzC,CAAC;IACD,OAAO,UAAU,IAAI,EAAE,CAAA;AACzB,CAAC,CAAA","sourcesContent":["// Pure color handling: parses React Native color strings and normalizes them\n// into GTK4 CSS color values. No bridge imports — unit-testable on any OS.\n//\n// Every parseable color is normalized to `rgb(r, g, b)` / `rgba(r, g, b, a)`\n// so the output does not depend on which color syntaxes the GTK CSS parser of\n// a particular version accepts. Two values pass through untouched:\n// - `var(--name[, fallback])` — CSS variables (GTK 4.16+, Adwaita palette)\n// - `@name` — legacy GTK named colors (`@define-color` references)\n\n// CSS Color Module Level 4 named colors (the set React Native supports).\nconst NAMED_COLORS: Record<string, string> = {\n aliceblue: \"#f0f8ff\",\n antiquewhite: \"#faebd7\",\n aqua: \"#00ffff\",\n aquamarine: \"#7fffd4\",\n azure: \"#f0ffff\",\n beige: \"#f5f5dc\",\n bisque: \"#ffe4c4\",\n black: \"#000000\",\n blanchedalmond: \"#ffebcd\",\n blue: \"#0000ff\",\n blueviolet: \"#8a2be2\",\n brown: \"#a52a2a\",\n burlywood: \"#deb887\",\n cadetblue: \"#5f9ea0\",\n chartreuse: \"#7fff00\",\n chocolate: \"#d2691e\",\n coral: \"#ff7f50\",\n cornflowerblue: \"#6495ed\",\n cornsilk: \"#fff8dc\",\n crimson: \"#dc143c\",\n cyan: \"#00ffff\",\n darkblue: \"#00008b\",\n darkcyan: \"#008b8b\",\n darkgoldenrod: \"#b8860b\",\n darkgray: \"#a9a9a9\",\n darkgreen: \"#006400\",\n darkgrey: \"#a9a9a9\",\n darkkhaki: \"#bdb76b\",\n darkmagenta: \"#8b008b\",\n darkolivegreen: \"#556b2f\",\n darkorange: \"#ff8c00\",\n darkorchid: \"#9932cc\",\n darkred: \"#8b0000\",\n darksalmon: \"#e9967a\",\n darkseagreen: \"#8fbc8f\",\n darkslateblue: \"#483d8b\",\n darkslategray: \"#2f4f4f\",\n darkslategrey: \"#2f4f4f\",\n darkturquoise: \"#00ced1\",\n darkviolet: \"#9400d3\",\n deeppink: \"#ff1493\",\n deepskyblue: \"#00bfff\",\n dimgray: \"#696969\",\n dimgrey: \"#696969\",\n dodgerblue: \"#1e90ff\",\n firebrick: \"#b22222\",\n floralwhite: \"#fffaf0\",\n forestgreen: \"#228b22\",\n fuchsia: \"#ff00ff\",\n gainsboro: \"#dcdcdc\",\n ghostwhite: \"#f8f8ff\",\n gold: \"#ffd700\",\n goldenrod: \"#daa520\",\n gray: \"#808080\",\n green: \"#008000\",\n greenyellow: \"#adff2f\",\n grey: \"#808080\",\n honeydew: \"#f0fff0\",\n hotpink: \"#ff69b4\",\n indianred: \"#cd5c5c\",\n indigo: \"#4b0082\",\n ivory: \"#fffff0\",\n khaki: \"#f0e68c\",\n lavender: \"#e6e6fa\",\n lavenderblush: \"#fff0f5\",\n lawngreen: \"#7cfc00\",\n lemonchiffon: \"#fffacd\",\n lightblue: \"#add8e6\",\n lightcoral: \"#f08080\",\n lightcyan: \"#e0ffff\",\n lightgoldenrodyellow: \"#fafad2\",\n lightgray: \"#d3d3d3\",\n lightgreen: \"#90ee90\",\n lightgrey: \"#d3d3d3\",\n lightpink: \"#ffb6c1\",\n lightsalmon: \"#ffa07a\",\n lightseagreen: \"#20b2aa\",\n lightskyblue: \"#87cefa\",\n lightslategray: \"#778899\",\n lightslategrey: \"#778899\",\n lightsteelblue: \"#b0c4de\",\n lightyellow: \"#ffffe0\",\n lime: \"#00ff00\",\n limegreen: \"#32cd32\",\n linen: \"#faf0e6\",\n magenta: \"#ff00ff\",\n maroon: \"#800000\",\n mediumaquamarine: \"#66cdaa\",\n mediumblue: \"#0000cd\",\n mediumorchid: \"#ba55d3\",\n mediumpurple: \"#9370db\",\n mediumseagreen: \"#3cb371\",\n mediumslateblue: \"#7b68ee\",\n mediumspringgreen: \"#00fa9a\",\n mediumturquoise: \"#48d1cc\",\n mediumvioletred: \"#c71585\",\n midnightblue: \"#191970\",\n mintcream: \"#f5fffa\",\n mistyrose: \"#ffe4e1\",\n moccasin: \"#ffe4b5\",\n navajowhite: \"#ffdead\",\n navy: \"#000080\",\n oldlace: \"#fdf5e6\",\n olive: \"#808000\",\n olivedrab: \"#6b8e23\",\n orange: \"#ffa500\",\n orangered: \"#ff4500\",\n orchid: \"#da70d6\",\n palegoldenrod: \"#eee8aa\",\n palegreen: \"#98fb98\",\n paleturquoise: \"#afeeee\",\n palevioletred: \"#db7093\",\n papayawhip: \"#ffefd5\",\n peachpuff: \"#ffdab9\",\n peru: \"#cd853f\",\n pink: \"#ffc0cb\",\n plum: \"#dda0dd\",\n powderblue: \"#b0e0e6\",\n purple: \"#800080\",\n rebeccapurple: \"#663399\",\n red: \"#ff0000\",\n rosybrown: \"#bc8f8f\",\n royalblue: \"#4169e1\",\n saddlebrown: \"#8b4513\",\n salmon: \"#fa8072\",\n sandybrown: \"#f4a460\",\n seagreen: \"#2e8b57\",\n seashell: \"#fff5ee\",\n sienna: \"#a0522d\",\n silver: \"#c0c0c0\",\n skyblue: \"#87ceeb\",\n slateblue: \"#6a5acd\",\n slategray: \"#708090\",\n slategrey: \"#708090\",\n snow: \"#fffafa\",\n springgreen: \"#00ff7f\",\n steelblue: \"#4682b4\",\n tan: \"#d2b48c\",\n teal: \"#008080\",\n thistle: \"#d8bfd8\",\n tomato: \"#ff6347\",\n turquoise: \"#40e0d0\",\n violet: \"#ee82ee\",\n wheat: \"#f5deb3\",\n white: \"#ffffff\",\n whitesmoke: \"#f5f5f5\",\n yellow: \"#ffff00\",\n yellowgreen: \"#9acd32\",\n}\n\ntype Rgba = { r: number; g: number; b: number; a: number }\n\nconst clamp = (value: number, min: number, max: number): number =>\n Math.min(max, Math.max(min, value))\n\nconst formatRgba = ({ r, g, b, a }: Rgba): string => {\n const alpha = Math.round(clamp(a, 0, 1) * 1000) / 1000\n return alpha >= 1\n ? `rgb(${r}, ${g}, ${b})`\n : `rgba(${r}, ${g}, ${b}, ${alpha})`\n}\n\nconst HEX_PATTERN = /^#([0-9a-f]+)$/i\n\nconst hexPair = (digits: string, index: number): number =>\n Number.parseInt(digits.slice(index, index + 2), 16)\n\nconst hexSingle = (digits: string, index: number): number =>\n Number.parseInt(digits.charAt(index).repeat(2), 16)\n\nconst parseHex = (input: string): Rgba | null => {\n const match = HEX_PATTERN.exec(input)\n if (match === null) {\n return null\n }\n const digits = match[1] ?? \"\"\n switch (digits.length) {\n case 3:\n return {\n r: hexSingle(digits, 0),\n g: hexSingle(digits, 1),\n b: hexSingle(digits, 2),\n a: 1,\n }\n case 4:\n return {\n r: hexSingle(digits, 0),\n g: hexSingle(digits, 1),\n b: hexSingle(digits, 2),\n a: hexSingle(digits, 3) / 255,\n }\n case 6:\n return {\n r: hexPair(digits, 0),\n g: hexPair(digits, 2),\n b: hexPair(digits, 4),\n a: 1,\n }\n case 8:\n return {\n r: hexPair(digits, 0),\n g: hexPair(digits, 2),\n b: hexPair(digits, 4),\n a: hexPair(digits, 6) / 255,\n }\n default:\n return null\n }\n}\n\nconst NUMBER_PATTERN = /^[+-]?(?:\\d+\\.?\\d*|\\.\\d+)$/\n\nconst parseNumber = (token: string): number | null =>\n NUMBER_PATTERN.test(token) ? Number.parseFloat(token) : null\n\n// 0-255 integer or percentage → 0-255 integer.\nconst parseRgbChannel = (token: string): number | null => {\n if (token.endsWith(\"%\")) {\n const percent = parseNumber(token.slice(0, -1))\n // (percent * 255) / 100 avoids float drift: 50 * 2.55 === 127.4999...\n return percent === null\n ? null\n : Math.round((clamp(percent, 0, 100) * 255) / 100)\n }\n const value = parseNumber(token)\n return value === null ? null : Math.round(clamp(value, 0, 255))\n}\n\n// 0-1 float or percentage → 0-1 float.\nconst parseAlpha = (token: string): number | null => {\n if (token.endsWith(\"%\")) {\n const percent = parseNumber(token.slice(0, -1))\n return percent === null ? null : clamp(percent / 100, 0, 1)\n }\n const value = parseNumber(token)\n return value === null ? null : clamp(value, 0, 1)\n}\n\nconst parsePercentage = (token: string): number | null => {\n if (!token.endsWith(\"%\")) {\n return null\n }\n const percent = parseNumber(token.slice(0, -1))\n return percent === null ? null : clamp(percent / 100, 0, 1)\n}\n\nconst parseHue = (token: string): number | null => {\n const raw = token.toLowerCase().endsWith(\"deg\") ? token.slice(0, -3) : token\n const degrees = parseNumber(raw)\n return degrees === null ? null : ((degrees % 360) + 360) % 360\n}\n\nconst hslToRgb = (\n h: number,\n s: number,\n l: number,\n): [number, number, number] => {\n const chroma = (1 - Math.abs(2 * l - 1)) * s\n const hh = h / 60\n const x = chroma * (1 - Math.abs((hh % 2) - 1))\n let rgb: [number, number, number] = [0, 0, 0]\n if (hh < 1) {\n rgb = [chroma, x, 0]\n } else if (hh < 2) {\n rgb = [x, chroma, 0]\n } else if (hh < 3) {\n rgb = [0, chroma, x]\n } else if (hh < 4) {\n rgb = [0, x, chroma]\n } else if (hh < 5) {\n rgb = [x, 0, chroma]\n } else {\n rgb = [chroma, 0, x]\n }\n const m = l - chroma / 2\n return [\n Math.round((rgb[0] + m) * 255),\n Math.round((rgb[1] + m) * 255),\n Math.round((rgb[2] + m) * 255),\n ]\n}\n\nconst FUNCTION_PATTERN = /^(rgba?|hsla?)\\(([^()]*)\\)$/i\n\n// Accepts legacy comma syntax and modern space syntax with optional \"/ alpha\".\nconst splitFunctionBody = (body: string): string[] =>\n body\n .replace(/\\//g, \" \")\n .split(/[,\\s]+/)\n .filter((token) => token.length > 0)\n\nconst parseColorFunction = (input: string): Rgba | null => {\n const match = FUNCTION_PATTERN.exec(input)\n if (match === null) {\n return null\n }\n const name = (match[1] ?? \"\").toLowerCase()\n const tokens = splitFunctionBody(match[2] ?? \"\")\n if (tokens.length < 3 || tokens.length > 4) {\n return null\n }\n const alpha = tokens.length === 4 ? parseAlpha(tokens[3] ?? \"\") : 1\n if (alpha === null) {\n return null\n }\n if (name === \"rgb\" || name === \"rgba\") {\n const r = parseRgbChannel(tokens[0] ?? \"\")\n const g = parseRgbChannel(tokens[1] ?? \"\")\n const b = parseRgbChannel(tokens[2] ?? \"\")\n if (r === null || g === null || b === null) {\n return null\n }\n return { r, g, b, a: alpha }\n }\n const h = parseHue(tokens[0] ?? \"\")\n const s = parsePercentage(tokens[1] ?? \"\")\n const l = parsePercentage(tokens[2] ?? \"\")\n if (h === null || s === null || l === null) {\n return null\n }\n const [r, g, b] = hslToRgb(h, s, l)\n return { r, g, b, a: alpha }\n}\n\nconst CSS_VARIABLE_PATTERN = /^var\\(--[\\w-]+.*\\)$/i\nconst GTK_NAMED_COLOR_PATTERN = /^@[A-Za-z_][\\w-]*$/\n\n/**\n * Parses a React Native color string into a GTK4 CSS color value.\n * Returns null for values that cannot be understood.\n */\nexport const parseColor = (value: string): string | null => {\n if (typeof value !== \"string\") {\n return null\n }\n const input = value.trim()\n if (input === \"\") {\n return null\n }\n // Adwaita/custom CSS variable references pass through untouched. The\n // pattern is permissive on purpose: nested var() fallbacks stay valid.\n if (input.toLowerCase().startsWith(\"var(\")) {\n return CSS_VARIABLE_PATTERN.test(input) ? input : null\n }\n if (GTK_NAMED_COLOR_PATTERN.test(input)) {\n return input\n }\n const lower = input.toLowerCase()\n if (lower === \"transparent\") {\n return \"rgba(0, 0, 0, 0)\"\n }\n const named = NAMED_COLORS[lower]\n const rgba = parseHex(named ?? input) ?? parseColorFunction(input)\n return rgba === null ? null : formatRgba(rgba)\n}\n\nconst toCssVariableName = (name: string): string =>\n name.startsWith(\"--\") ? name : `--${name}`\n\n/**\n * React Native's PlatformColor for GTK: references theme colors by name.\n * Names map onto CSS variables (Adwaita exposes its palette as\n * `--accent-bg-color`, `--window-bg-color`, ... since libadwaita 1.6);\n * extra names become var() fallbacks, tried in order. A name starting with\n * \"@\" is a legacy GTK named color (`@define-color`) and terminates the\n * fallback chain, because var() fallbacks cannot resolve further after it.\n *\n * PlatformColor(\"accent-bg-color\") → \"var(--accent-bg-color)\"\n * PlatformColor(\"accent-bg-color\", \"@blue_3\") → \"var(--accent-bg-color, @blue_3)\"\n */\nexport const PlatformColor = (...names: string[]): string => {\n const cleaned = names.map((name) => name.trim()).filter((name) => name !== \"\")\n if (cleaned.length === 0) {\n throw new Error(\"PlatformColor requires at least one color name\")\n }\n let expression: string | null = null\n for (let i = cleaned.length - 1; i >= 0; i -= 1) {\n const name = cleaned[i] ?? \"\"\n if (name.startsWith(\"@\")) {\n // Terminal value: names after it are unreachable fallbacks.\n expression = name\n continue\n }\n const variable = toCssVariableName(name)\n expression =\n expression === null\n ? `var(${variable})`\n : `var(${variable}, ${expression})`\n }\n return expression ?? \"\"\n}\n"]}
1
+ {"version":3,"file":"colors.js","sourceRoot":"","sources":["../../src/style/colors.ts"],"names":[],"mappings":"AAAA,6EAA6E;AAC7E,2EAA2E;AAC3E,EAAE;AACF,6EAA6E;AAC7E,8EAA8E;AAC9E,mEAAmE;AACnE,2EAA2E;AAC3E,mEAAmE;AAEnE,yEAAyE;AACzE,MAAM,YAAY,GAA2B;IAC3C,SAAS,EAAE,SAAS;IACpB,YAAY,EAAE,SAAS;IACvB,IAAI,EAAE,SAAS;IACf,UAAU,EAAE,SAAS;IACrB,KAAK,EAAE,SAAS;IAChB,KAAK,EAAE,SAAS;IAChB,MAAM,EAAE,SAAS;IACjB,KAAK,EAAE,SAAS;IAChB,cAAc,EAAE,SAAS;IACzB,IAAI,EAAE,SAAS;IACf,UAAU,EAAE,SAAS;IACrB,KAAK,EAAE,SAAS;IAChB,SAAS,EAAE,SAAS;IACpB,SAAS,EAAE,SAAS;IACpB,UAAU,EAAE,SAAS;IACrB,SAAS,EAAE,SAAS;IACpB,KAAK,EAAE,SAAS;IAChB,cAAc,EAAE,SAAS;IACzB,QAAQ,EAAE,SAAS;IACnB,OAAO,EAAE,SAAS;IAClB,IAAI,EAAE,SAAS;IACf,QAAQ,EAAE,SAAS;IACnB,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pB,CAAC,CAAC,OAAO,QAAQ,KAAK,UAAU,GAAG,CAAA;IACzC,CAAC;IACD,OAAO,UAAU,IAAI,EAAE,CAAA;AACzB,CAAC,CAAA","sourcesContent":["// Pure color handling: parses React Native color strings and normalizes them\n// into GTK4 CSS color values. No bridge imports — unit-testable on any OS.\n//\n// Every parseable color is normalized to `rgb(r, g, b)` / `rgba(r, g, b, a)`\n// so the output does not depend on which color syntaxes the GTK CSS parser of\n// a particular version accepts. Two values pass through untouched:\n// - `var(--name[, fallback])` — CSS variables (GTK 4.16+, Adwaita palette)\n// - `@name` — legacy GTK named colors (`@define-color` references)\n\n// CSS Color Module Level 4 named colors (the set React Native supports).\nconst NAMED_COLORS: Record<string, string> = {\n aliceblue: \"#f0f8ff\",\n antiquewhite: \"#faebd7\",\n aqua: \"#00ffff\",\n aquamarine: \"#7fffd4\",\n azure: \"#f0ffff\",\n beige: \"#f5f5dc\",\n bisque: \"#ffe4c4\",\n black: \"#000000\",\n blanchedalmond: \"#ffebcd\",\n blue: \"#0000ff\",\n blueviolet: \"#8a2be2\",\n brown: \"#a52a2a\",\n burlywood: \"#deb887\",\n cadetblue: \"#5f9ea0\",\n chartreuse: \"#7fff00\",\n chocolate: \"#d2691e\",\n coral: \"#ff7f50\",\n cornflowerblue: \"#6495ed\",\n cornsilk: \"#fff8dc\",\n crimson: \"#dc143c\",\n cyan: \"#00ffff\",\n darkblue: \"#00008b\",\n darkcyan: \"#008b8b\",\n darkgoldenrod: \"#b8860b\",\n darkgray: \"#a9a9a9\",\n darkgreen: \"#006400\",\n darkgrey: \"#a9a9a9\",\n darkkhaki: \"#bdb76b\",\n darkmagenta: \"#8b008b\",\n darkolivegreen: \"#556b2f\",\n darkorange: \"#ff8c00\",\n darkorchid: \"#9932cc\",\n darkred: \"#8b0000\",\n darksalmon: \"#e9967a\",\n darkseagreen: \"#8fbc8f\",\n darkslateblue: \"#483d8b\",\n darkslategray: \"#2f4f4f\",\n darkslategrey: \"#2f4f4f\",\n darkturquoise: \"#00ced1\",\n darkviolet: \"#9400d3\",\n deeppink: \"#ff1493\",\n deepskyblue: \"#00bfff\",\n dimgray: \"#696969\",\n dimgrey: \"#696969\",\n dodgerblue: \"#1e90ff\",\n firebrick: \"#b22222\",\n floralwhite: \"#fffaf0\",\n forestgreen: \"#228b22\",\n fuchsia: \"#ff00ff\",\n gainsboro: \"#dcdcdc\",\n ghostwhite: \"#f8f8ff\",\n gold: \"#ffd700\",\n goldenrod: \"#daa520\",\n gray: \"#808080\",\n green: \"#008000\",\n greenyellow: \"#adff2f\",\n grey: \"#808080\",\n honeydew: \"#f0fff0\",\n hotpink: \"#ff69b4\",\n indianred: \"#cd5c5c\",\n indigo: \"#4b0082\",\n ivory: \"#fffff0\",\n khaki: \"#f0e68c\",\n lavender: \"#e6e6fa\",\n lavenderblush: \"#fff0f5\",\n lawngreen: \"#7cfc00\",\n lemonchiffon: \"#fffacd\",\n lightblue: \"#add8e6\",\n lightcoral: \"#f08080\",\n lightcyan: \"#e0ffff\",\n lightgoldenrodyellow: \"#fafad2\",\n lightgray: \"#d3d3d3\",\n lightgreen: \"#90ee90\",\n lightgrey: \"#d3d3d3\",\n lightpink: \"#ffb6c1\",\n lightsalmon: \"#ffa07a\",\n lightseagreen: \"#20b2aa\",\n lightskyblue: \"#87cefa\",\n lightslategray: \"#778899\",\n lightslategrey: \"#778899\",\n lightsteelblue: \"#b0c4de\",\n lightyellow: \"#ffffe0\",\n lime: \"#00ff00\",\n limegreen: \"#32cd32\",\n linen: \"#faf0e6\",\n magenta: \"#ff00ff\",\n maroon: \"#800000\",\n mediumaquamarine: \"#66cdaa\",\n mediumblue: \"#0000cd\",\n mediumorchid: \"#ba55d3\",\n mediumpurple: \"#9370db\",\n mediumseagreen: \"#3cb371\",\n mediumslateblue: \"#7b68ee\",\n mediumspringgreen: \"#00fa9a\",\n mediumturquoise: \"#48d1cc\",\n mediumvioletred: \"#c71585\",\n midnightblue: \"#191970\",\n mintcream: \"#f5fffa\",\n mistyrose: \"#ffe4e1\",\n moccasin: \"#ffe4b5\",\n navajowhite: \"#ffdead\",\n navy: \"#000080\",\n oldlace: \"#fdf5e6\",\n olive: \"#808000\",\n olivedrab: \"#6b8e23\",\n orange: \"#ffa500\",\n orangered: \"#ff4500\",\n orchid: \"#da70d6\",\n palegoldenrod: \"#eee8aa\",\n palegreen: \"#98fb98\",\n paleturquoise: \"#afeeee\",\n palevioletred: \"#db7093\",\n papayawhip: \"#ffefd5\",\n peachpuff: \"#ffdab9\",\n peru: \"#cd853f\",\n pink: \"#ffc0cb\",\n plum: \"#dda0dd\",\n powderblue: \"#b0e0e6\",\n purple: \"#800080\",\n rebeccapurple: \"#663399\",\n red: \"#ff0000\",\n rosybrown: \"#bc8f8f\",\n royalblue: \"#4169e1\",\n saddlebrown: \"#8b4513\",\n salmon: \"#fa8072\",\n sandybrown: \"#f4a460\",\n seagreen: \"#2e8b57\",\n seashell: \"#fff5ee\",\n sienna: \"#a0522d\",\n silver: \"#c0c0c0\",\n skyblue: \"#87ceeb\",\n slateblue: \"#6a5acd\",\n slategray: \"#708090\",\n slategrey: \"#708090\",\n snow: \"#fffafa\",\n springgreen: \"#00ff7f\",\n steelblue: \"#4682b4\",\n tan: \"#d2b48c\",\n teal: \"#008080\",\n thistle: \"#d8bfd8\",\n tomato: \"#ff6347\",\n turquoise: \"#40e0d0\",\n violet: \"#ee82ee\",\n wheat: \"#f5deb3\",\n white: \"#ffffff\",\n whitesmoke: \"#f5f5f5\",\n yellow: \"#ffff00\",\n yellowgreen: \"#9acd32\",\n}\n\ntype Rgba = { r: number; g: number; b: number; a: number }\n\nconst clamp = (value: number, min: number, max: number): number =>\n Math.min(max, Math.max(min, value))\n\nconst formatRgba = ({ r, g, b, a }: Rgba): string => {\n const alpha = Math.round(clamp(a, 0, 1) * 1000) / 1000\n return alpha >= 1\n ? `rgb(${r}, ${g}, ${b})`\n : `rgba(${r}, ${g}, ${b}, ${alpha})`\n}\n\nconst HEX_PATTERN = /^#([0-9a-f]+)$/i\n\nconst hexPair = (digits: string, index: number): number =>\n Number.parseInt(digits.slice(index, index + 2), 16)\n\nconst hexSingle = (digits: string, index: number): number =>\n Number.parseInt(digits.charAt(index).repeat(2), 16)\n\nconst parseHex = (input: string): Rgba | null => {\n const match = HEX_PATTERN.exec(input)\n if (match === null) {\n return null\n }\n const digits = match[1] ?? \"\"\n switch (digits.length) {\n case 3:\n return {\n r: hexSingle(digits, 0),\n g: hexSingle(digits, 1),\n b: hexSingle(digits, 2),\n a: 1,\n }\n case 4:\n return {\n r: hexSingle(digits, 0),\n g: hexSingle(digits, 1),\n b: hexSingle(digits, 2),\n a: hexSingle(digits, 3) / 255,\n }\n case 6:\n return {\n r: hexPair(digits, 0),\n g: hexPair(digits, 2),\n b: hexPair(digits, 4),\n a: 1,\n }\n case 8:\n return {\n r: hexPair(digits, 0),\n g: hexPair(digits, 2),\n b: hexPair(digits, 4),\n a: hexPair(digits, 6) / 255,\n }\n default:\n return null\n }\n}\n\nconst NUMBER_PATTERN = /^[+-]?(?:\\d+\\.?\\d*|\\.\\d+)$/\n\nconst parseNumber = (token: string): number | null =>\n NUMBER_PATTERN.test(token) ? Number.parseFloat(token) : null\n\n// 0-255 integer or percentage → 0-255 integer.\nconst parseRgbChannel = (token: string): number | null => {\n if (token.endsWith(\"%\")) {\n const percent = parseNumber(token.slice(0, -1))\n // (percent * 255) / 100 avoids float drift: 50 * 2.55 === 127.4999...\n return percent === null\n ? null\n : Math.round((clamp(percent, 0, 100) * 255) / 100)\n }\n const value = parseNumber(token)\n return value === null ? null : Math.round(clamp(value, 0, 255))\n}\n\n// 0-1 float or percentage → 0-1 float.\nconst parseAlpha = (token: string): number | null => {\n if (token.endsWith(\"%\")) {\n const percent = parseNumber(token.slice(0, -1))\n return percent === null ? null : clamp(percent / 100, 0, 1)\n }\n const value = parseNumber(token)\n return value === null ? null : clamp(value, 0, 1)\n}\n\nconst parsePercentage = (token: string): number | null => {\n if (!token.endsWith(\"%\")) {\n return null\n }\n const percent = parseNumber(token.slice(0, -1))\n return percent === null ? null : clamp(percent / 100, 0, 1)\n}\n\nconst parseHue = (token: string): number | null => {\n const raw = token.toLowerCase().endsWith(\"deg\") ? token.slice(0, -3) : token\n const degrees = parseNumber(raw)\n return degrees === null ? null : ((degrees % 360) + 360) % 360\n}\n\nconst hslToRgb = (\n h: number,\n s: number,\n l: number,\n): [number, number, number] => {\n const chroma = (1 - Math.abs(2 * l - 1)) * s\n const hh = h / 60\n const x = chroma * (1 - Math.abs((hh % 2) - 1))\n // Every branch assigns, so the sextant picks the triple outright — the\n // placeholder initialiser it used to start from was dead.\n let rgb: [number, number, number]\n if (hh < 1) {\n rgb = [chroma, x, 0]\n } else if (hh < 2) {\n rgb = [x, chroma, 0]\n } else if (hh < 3) {\n rgb = [0, chroma, x]\n } else if (hh < 4) {\n rgb = [0, x, chroma]\n } else if (hh < 5) {\n rgb = [x, 0, chroma]\n } else {\n rgb = [chroma, 0, x]\n }\n const m = l - chroma / 2\n return [\n Math.round((rgb[0] + m) * 255),\n Math.round((rgb[1] + m) * 255),\n Math.round((rgb[2] + m) * 255),\n ]\n}\n\nconst FUNCTION_PATTERN = /^(rgba?|hsla?)\\(([^()]*)\\)$/i\n\n// Accepts legacy comma syntax and modern space syntax with optional \"/ alpha\".\nconst splitFunctionBody = (body: string): string[] =>\n body\n .replace(/\\//g, \" \")\n .split(/[,\\s]+/)\n .filter((token) => token.length > 0)\n\nconst parseColorFunction = (input: string): Rgba | null => {\n const match = FUNCTION_PATTERN.exec(input)\n if (match === null) {\n return null\n }\n const name = (match[1] ?? \"\").toLowerCase()\n const tokens = splitFunctionBody(match[2] ?? \"\")\n if (tokens.length < 3 || tokens.length > 4) {\n return null\n }\n const alpha = tokens.length === 4 ? parseAlpha(tokens[3] ?? \"\") : 1\n if (alpha === null) {\n return null\n }\n if (name === \"rgb\" || name === \"rgba\") {\n const r = parseRgbChannel(tokens[0] ?? \"\")\n const g = parseRgbChannel(tokens[1] ?? \"\")\n const b = parseRgbChannel(tokens[2] ?? \"\")\n if (r === null || g === null || b === null) {\n return null\n }\n return { r, g, b, a: alpha }\n }\n const h = parseHue(tokens[0] ?? \"\")\n const s = parsePercentage(tokens[1] ?? \"\")\n const l = parsePercentage(tokens[2] ?? \"\")\n if (h === null || s === null || l === null) {\n return null\n }\n const [r, g, b] = hslToRgb(h, s, l)\n return { r, g, b, a: alpha }\n}\n\nconst CSS_VARIABLE_PATTERN = /^var\\(--[\\w-]+.*\\)$/i\nconst GTK_NAMED_COLOR_PATTERN = /^@[A-Za-z_][\\w-]*$/\n\n/**\n * Parses a React Native color string into a GTK4 CSS color value.\n * Returns null for values that cannot be understood.\n */\nexport const parseColor = (value: string): string | null => {\n if (typeof value !== \"string\") {\n return null\n }\n const input = value.trim()\n if (input === \"\") {\n return null\n }\n // Adwaita/custom CSS variable references pass through untouched. The\n // pattern is permissive on purpose: nested var() fallbacks stay valid.\n if (input.toLowerCase().startsWith(\"var(\")) {\n return CSS_VARIABLE_PATTERN.test(input) ? input : null\n }\n if (GTK_NAMED_COLOR_PATTERN.test(input)) {\n return input\n }\n const lower = input.toLowerCase()\n if (lower === \"transparent\") {\n return \"rgba(0, 0, 0, 0)\"\n }\n const named = NAMED_COLORS[lower]\n const rgba = parseHex(named ?? input) ?? parseColorFunction(input)\n return rgba === null ? null : formatRgba(rgba)\n}\n\nconst toCssVariableName = (name: string): string =>\n name.startsWith(\"--\") ? name : `--${name}`\n\n/**\n * React Native's PlatformColor for GTK: references theme colors by name.\n * Names map onto CSS variables (Adwaita exposes its palette as\n * `--accent-bg-color`, `--window-bg-color`, ... since libadwaita 1.6);\n * extra names become var() fallbacks, tried in order. A name starting with\n * \"@\" is a legacy GTK named color (`@define-color`) and terminates the\n * fallback chain, because var() fallbacks cannot resolve further after it.\n *\n * PlatformColor(\"accent-bg-color\") → \"var(--accent-bg-color)\"\n * PlatformColor(\"accent-bg-color\", \"@blue_3\") → \"var(--accent-bg-color, @blue_3)\"\n */\nexport const PlatformColor = (...names: string[]): string => {\n const cleaned = names.map((name) => name.trim()).filter((name) => name !== \"\")\n if (cleaned.length === 0) {\n throw new Error(\"PlatformColor requires at least one color name\")\n }\n let expression: string | null = null\n for (let i = cleaned.length - 1; i >= 0; i -= 1) {\n const name = cleaned[i] ?? \"\"\n if (name.startsWith(\"@\")) {\n // Terminal value: names after it are unreachable fallbacks.\n expression = name\n continue\n }\n const variable = toCssVariableName(name)\n expression =\n expression === null\n ? `var(${variable})`\n : `var(${variable}, ${expression})`\n }\n return expression ?? \"\"\n}\n"]}
@@ -1,9 +1,9 @@
1
- // Style pipeline (task 005): StyleSheet → flatten → splitStyle →
1
+ // Style pipeline: StyleSheet → flatten → splitStyle →
2
2
  // visualStyleToCss → memoized class registry.
3
3
  //
4
4
  // Everything exported here is pure (no bridge imports) and unit-testable on
5
5
  // any OS. The production registry that talks to the gtkx `css` helper lives
6
- // in ./registry.gtkx.ts and is imported directly by components (006).
6
+ // in ./registry.gtkx.ts and is imported directly by the components.
7
7
  export { parseColor, PlatformColor } from "./colors";
8
8
  export { resetDevWarnings } from "./dev-warning";
9
9
  export { createCssRegistry } from "./registry";
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/style/index.ts"],"names":[],"mappings":"AAAA,iEAAiE;AACjE,8CAA8C;AAC9C,EAAE;AACF,4EAA4E;AAC5E,4EAA4E;AAC5E,sEAAsE;AAEtE,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AACpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAA;AAChD,OAAO,EAAE,iBAAiB,EAAgC,MAAM,YAAY,CAAA;AAC5E,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAC1C,OAAO,EACL,YAAY,EACZ,kBAAkB,EAClB,OAAO,EACP,MAAM,EACN,OAAO,EACP,aAAa,EACb,UAAU,GACX,MAAM,eAAe,CAAA;AACtB,OAAO,EACL,qBAAqB,GAGtB,MAAM,cAAc,CAAA;AACrB,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAA","sourcesContent":["// Style pipeline (task 005): StyleSheet → flatten → splitStyle →\n// visualStyleToCss → memoized class registry.\n//\n// Everything exported here is pure (no bridge imports) and unit-testable on\n// any OS. The production registry that talks to the gtkx `css` helper lives\n// in ./registry.gtkx.ts and is imported directly by components (006).\n\nexport { parseColor, PlatformColor } from \"./colors\"\nexport { resetDevWarnings } from \"./dev-warning\"\nexport { createCssRegistry, type CssFn, type CssRegistry } from \"./registry\"\nexport { splitStyle } from \"./split-style\"\nexport {\n absoluteFill,\n absoluteFillObject,\n compose,\n create,\n flatten,\n hairlineWidth,\n StyleSheet,\n} from \"./style-sheet\"\nexport {\n textAlignToLabelProps,\n type LabelAlignProps,\n type TextAlign,\n} from \"./text-align\"\nexport { visualStyleToCss } from \"./visual-css\"\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/style/index.ts"],"names":[],"mappings":"AAAA,sDAAsD;AACtD,8CAA8C;AAC9C,EAAE;AACF,4EAA4E;AAC5E,4EAA4E;AAC5E,oEAAoE;AAEpE,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AACpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAA;AAChD,OAAO,EAAE,iBAAiB,EAAgC,MAAM,YAAY,CAAA;AAC5E,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAC1C,OAAO,EACL,YAAY,EACZ,kBAAkB,EAClB,OAAO,EACP,MAAM,EACN,OAAO,EACP,aAAa,EACb,UAAU,GACX,MAAM,eAAe,CAAA;AACtB,OAAO,EACL,qBAAqB,GAGtB,MAAM,cAAc,CAAA;AACrB,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAA","sourcesContent":["// Style pipeline: StyleSheet → flatten → splitStyle →\n// visualStyleToCss → memoized class registry.\n//\n// Everything exported here is pure (no bridge imports) and unit-testable on\n// any OS. The production registry that talks to the gtkx `css` helper lives\n// in ./registry.gtkx.ts and is imported directly by the components.\n\nexport { parseColor, PlatformColor } from \"./colors\"\nexport { resetDevWarnings } from \"./dev-warning\"\nexport { createCssRegistry, type CssFn, type CssRegistry } from \"./registry\"\nexport { splitStyle } from \"./split-style\"\nexport {\n absoluteFill,\n absoluteFillObject,\n compose,\n create,\n flatten,\n hairlineWidth,\n StyleSheet,\n} from \"./style-sheet\"\nexport {\n textAlignToLabelProps,\n type LabelAlignProps,\n type TextAlign,\n} from \"./text-align\"\nexport { visualStyleToCss } from \"./visual-css\"\n"]}
@@ -1,5 +1,5 @@
1
1
  // Production adapter — the ONLY style module that touches the bridge.
2
- // Components (task 006) import the default registry from here; everything
2
+ // Components import the default registry from here; everything
3
3
  // else in src/style is pure and must not depend on this file. It is also
4
4
  // deliberately not re-exported from src/style/index.ts so that unit tests
5
5
  // (and any pure consumer) never pull in @gtkx bindings transitively.
@@ -1 +1 @@
1
- {"version":3,"file":"registry.gtkx.js","sourceRoot":"","sources":["../../src/style/registry.gtkx.ts"],"names":[],"mappings":"AAAA,sEAAsE;AACtE,0EAA0E;AAC1E,yEAAyE;AACzE,0EAA0E;AAC1E,qEAAqE;AAErE,OAAO,EAAE,GAAG,EAAE,MAAM,sBAAsB,CAAA;AAC1C,OAAO,EAAE,iBAAiB,EAAoB,MAAM,YAAY,CAAA;AAEhE,MAAM,CAAC,MAAM,kBAAkB,GAAgB,iBAAiB,CAAC,CAAC,OAAO,EAAE,EAAE,CAC3E,GAAG,CAAC,OAAO,CAAC,CACb,CAAA","sourcesContent":["// Production adapter — the ONLY style module that touches the bridge.\n// Components (task 006) import the default registry from here; everything\n// else in src/style is pure and must not depend on this file. It is also\n// deliberately not re-exported from src/style/index.ts so that unit tests\n// (and any pure consumer) never pull in @gtkx bindings transitively.\n\nimport { css } from \"../gtkx/bridge/index\"\nimport { createCssRegistry, type CssRegistry } from \"./registry\"\n\nexport const defaultCssRegistry: CssRegistry = createCssRegistry((cssText) =>\n css(cssText),\n)\n"]}
1
+ {"version":3,"file":"registry.gtkx.js","sourceRoot":"","sources":["../../src/style/registry.gtkx.ts"],"names":[],"mappings":"AAAA,sEAAsE;AACtE,+DAA+D;AAC/D,yEAAyE;AACzE,0EAA0E;AAC1E,qEAAqE;AAErE,OAAO,EAAE,GAAG,EAAE,MAAM,sBAAsB,CAAA;AAC1C,OAAO,EAAE,iBAAiB,EAAoB,MAAM,YAAY,CAAA;AAEhE,MAAM,CAAC,MAAM,kBAAkB,GAAgB,iBAAiB,CAAC,CAAC,OAAO,EAAE,EAAE,CAC3E,GAAG,CAAC,OAAO,CAAC,CACb,CAAA","sourcesContent":["// Production adapter — the ONLY style module that touches the bridge.\n// Components import the default registry from here; everything\n// else in src/style is pure and must not depend on this file. It is also\n// deliberately not re-exported from src/style/index.ts so that unit tests\n// (and any pure consumer) never pull in @gtkx bindings transitively.\n\nimport { css } from \"../gtkx/bridge/index\"\nimport { createCssRegistry, type CssRegistry } from \"./registry\"\n\nexport const defaultCssRegistry: CssRegistry = createCssRegistry((cssText) =>\n css(cssText),\n)\n"]}
@@ -1,5 +1,5 @@
1
1
  // Classifies a flattened style into layout props (consumed by the Yoga
2
- // engine, task 004) and visual props (compiled into GTK CSS). Pure module.
2
+ // engine) and visual props (compiled into GTK CSS). Pure module.
3
3
  import { warnOnce } from "./dev-warning";
4
4
  // Exhaustive over the frozen contract: adding a key to LayoutStyle in
5
5
  // contracts.ts fails compilation here until the key is classified.
@@ -1 +1 @@
1
- {"version":3,"file":"split-style.js","sourceRoot":"","sources":["../../src/style/split-style.ts"],"names":[],"mappings":"AAAA,uEAAuE;AACvE,2EAA2E;AAQ3E,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AAExC,sEAAsE;AACtE,mEAAmE;AACnE,MAAM,WAAW,GAAoC;IACnD,YAAY,EAAE,IAAI;IAClB,UAAU,EAAE,IAAI;IAChB,SAAS,EAAE,IAAI;IACf,WAAW,EAAE,IAAI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// Classifies a flattened style into layout props (consumed by the Yoga\n// engine, task 004) and visual props (compiled into GTK CSS). Pure module.\n\nimport type {\n FlatStyle,\n LayoutStyle,\n SplitStyle,\n VisualStyle,\n} from \"../contracts\"\nimport { warnOnce } from \"./dev-warning\"\n\n// Exhaustive over the frozen contract: adding a key to LayoutStyle in\n// contracts.ts fails compilation here until the key is classified.\nconst LAYOUT_KEYS: Record<keyof LayoutStyle, true> = {\n alignContent: true,\n alignItems: true,\n alignSelf: true,\n aspectRatio: true,\n bottom: true,\n columnGap: true,\n direction: true,\n display: true,\n flex: true,\n flexBasis: true,\n flexDirection: true,\n flexGrow: true,\n flexShrink: true,\n flexWrap: true,\n gap: true,\n height: true,\n justifyContent: true,\n left: true,\n margin: true,\n marginBottom: true,\n marginHorizontal: true,\n marginLeft: true,\n marginRight: true,\n marginTop: true,\n marginVertical: true,\n maxHeight: true,\n maxWidth: true,\n minHeight: true,\n minWidth: true,\n overflow: true,\n padding: true,\n paddingBottom: true,\n paddingHorizontal: true,\n paddingLeft: true,\n paddingRight: true,\n paddingTop: true,\n paddingVertical: true,\n position: true,\n right: true,\n rowGap: true,\n top: true,\n width: true,\n}\n\n// Note: `transform` is visual by contract — it is applied by the layout\n// engine through Fixed.Child matrices, not through CSS, and is passed\n// through here untouched.\nconst VISUAL_KEYS: Record<keyof VisualStyle, true> = {\n backgroundColor: true,\n borderBottomColor: true,\n borderBottomLeftRadius: true,\n borderBottomRightRadius: true,\n borderBottomWidth: true,\n borderColor: true,\n borderLeftColor: true,\n borderLeftWidth: true,\n borderRadius: true,\n borderRightColor: true,\n borderRightWidth: true,\n borderStyle: true,\n borderTopColor: true,\n borderTopLeftRadius: true,\n borderTopRightRadius: true,\n borderTopWidth: true,\n borderWidth: true,\n color: true,\n fontFamily: true,\n fontSize: true,\n fontStyle: true,\n fontWeight: true,\n letterSpacing: true,\n lineHeight: true,\n opacity: true,\n textAlign: true,\n transform: true,\n}\n\n/**\n * Splits a flattened style into { layout, visual }. Unknown properties are\n * ignored with a one-time dev warning per key; undefined values are dropped.\n */\nexport const splitStyle = (flat: FlatStyle): SplitStyle => {\n const layout: LayoutStyle = {}\n const visual: VisualStyle = {}\n for (const [key, value] of Object.entries(flat)) {\n if (value === undefined) {\n continue\n }\n if (Object.hasOwn(LAYOUT_KEYS, key)) {\n ;(layout as Record<string, unknown>)[key] = value\n } else if (Object.hasOwn(VISUAL_KEYS, key)) {\n ;(visual as Record<string, unknown>)[key] = value\n } else {\n warnOnce(\n `unknown-style-prop:${key}`,\n `[react-native-gtkx] Unknown style property \"${key}\" is not supported and will be ignored`,\n )\n }\n }\n return { layout, visual }\n}\n"]}
1
+ {"version":3,"file":"split-style.js","sourceRoot":"","sources":["../../src/style/split-style.ts"],"names":[],"mappings":"AAAA,uEAAuE;AACvE,iEAAiE;AAQjE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AAExC,sEAAsE;AACtE,mEAAmE;AACnE,MAAM,WAAW,GAAoC;IACnD,YAAY,EAAE,IAAI;IAClB,UAAU,EAAE,IAAI;IAChB,SAAS,EAAE,IAAI;IACf,WAAW,EAAE,IAAI;IACjB,MAAM,EAAE,IAAI;IACZ,SAAS,EAAE,IAAI;IACf,SAAS,EAAE,IAAI;IACf,OAAO,EAAE,IAAI;IACb,IAAI,EAAE,IAAI;IACV,SAAS,EAAE,IAAI;IACf,aAAa,EAAE,IAAI;IACnB,QAAQ,EAAE,IAAI;IACd,UAAU,EAAE,IAAI;IAChB,QAAQ,EAAE,IAAI;IACd,GAAG,EAAE,IAAI;IACT,MAAM,EAAE,IAAI;IACZ,cAAc,EAAE,IAAI;IACpB,IAAI,EAAE,IAAI;IACV,MAAM,EAAE,IAAI;IACZ,YAAY,EAAE,IAAI;IAClB,gBAAgB,EAAE,IAAI;IACtB,UAAU,EAAE,IAAI;IAChB,WAAW,EAAE,IAAI;IACjB,SAAS,EAAE,IAAI;IACf,cAAc,EAAE,IAAI;IACpB,SAAS,EAAE,IAAI;IACf,QAAQ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AE,CAAA;IAC9B,MAAM,MAAM,GAAgB,EAAE,CAAA;IAC9B,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC;QAChD,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;YACxB,SAAQ;QACV,CAAC;QACD,IAAI,MAAM,CAAC,MAAM,CAAC,WAAW,EAAE,GAAG,CAAC,EAAE,CAAC;YACpC,CAAC;YAAC,MAAkC,CAAC,GAAG,CAAC,GAAG,KAAK,CAAA;QACnD,CAAC;aAAM,IAAI,MAAM,CAAC,MAAM,CAAC,WAAW,EAAE,GAAG,CAAC,EAAE,CAAC;YAC3C,CAAC;YAAC,MAAkC,CAAC,GAAG,CAAC,GAAG,KAAK,CAAA;QACnD,CAAC;aAAM,CAAC;YACN,QAAQ,CACN,sBAAsB,GAAG,EAAE,EAC3B,+CAA+C,GAAG,wCAAwC,CAC3F,CAAA;QACH,CAAC;IACH,CAAC;IACD,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,CAAA;AAC3B,CAAC,CAAA","sourcesContent":["// Classifies a flattened style into layout props (consumed by the Yoga\n// engine) and visual props (compiled into GTK CSS). Pure module.\n\nimport type {\n FlatStyle,\n LayoutStyle,\n SplitStyle,\n VisualStyle,\n} from \"../contracts\"\nimport { warnOnce } from \"./dev-warning\"\n\n// Exhaustive over the frozen contract: adding a key to LayoutStyle in\n// contracts.ts fails compilation here until the key is classified.\nconst LAYOUT_KEYS: Record<keyof LayoutStyle, true> = {\n alignContent: true,\n alignItems: true,\n alignSelf: true,\n aspectRatio: true,\n bottom: true,\n columnGap: true,\n direction: true,\n display: true,\n flex: true,\n flexBasis: true,\n flexDirection: true,\n flexGrow: true,\n flexShrink: true,\n flexWrap: true,\n gap: true,\n height: true,\n justifyContent: true,\n left: true,\n margin: true,\n marginBottom: true,\n marginHorizontal: true,\n marginLeft: true,\n marginRight: true,\n marginTop: true,\n marginVertical: true,\n maxHeight: true,\n maxWidth: true,\n minHeight: true,\n minWidth: true,\n overflow: true,\n padding: true,\n paddingBottom: true,\n paddingHorizontal: true,\n paddingLeft: true,\n paddingRight: true,\n paddingTop: true,\n paddingVertical: true,\n position: true,\n right: true,\n rowGap: true,\n top: true,\n width: true,\n}\n\n// Note: `transform` is visual by contract — it is applied by the layout\n// engine through Fixed.Child matrices, not through CSS, and is passed\n// through here untouched.\nconst VISUAL_KEYS: Record<keyof VisualStyle, true> = {\n backgroundColor: true,\n borderBottomColor: true,\n borderBottomLeftRadius: true,\n borderBottomRightRadius: true,\n borderBottomWidth: true,\n borderColor: true,\n borderLeftColor: true,\n borderLeftWidth: true,\n borderRadius: true,\n borderRightColor: true,\n borderRightWidth: true,\n borderStyle: true,\n borderTopColor: true,\n borderTopLeftRadius: true,\n borderTopRightRadius: true,\n borderTopWidth: true,\n borderWidth: true,\n color: true,\n fontFamily: true,\n fontSize: true,\n fontStyle: true,\n fontWeight: true,\n letterSpacing: true,\n lineHeight: true,\n opacity: true,\n textAlign: true,\n transform: true,\n}\n\n/**\n * Splits a flattened style into { layout, visual }. Unknown properties are\n * ignored with a one-time dev warning per key; undefined values are dropped.\n */\nexport const splitStyle = (flat: FlatStyle): SplitStyle => {\n const layout: LayoutStyle = {}\n const visual: VisualStyle = {}\n for (const [key, value] of Object.entries(flat)) {\n if (value === undefined) {\n continue\n }\n if (Object.hasOwn(LAYOUT_KEYS, key)) {\n ;(layout as Record<string, unknown>)[key] = value\n } else if (Object.hasOwn(VISUAL_KEYS, key)) {\n ;(visual as Record<string, unknown>)[key] = value\n } else {\n warnOnce(\n `unknown-style-prop:${key}`,\n `[react-native-gtkx] Unknown style property \"${key}\" is not supported and will be ignored`,\n )\n }\n }\n return { layout, visual }\n}\n"]}
@@ -1,5 +1,5 @@
1
1
  // GTK4 CSS has no text-align property, so textAlign never reaches the CSS
2
- // generator: the Text component (006) maps it onto GtkLabel properties with
2
+ // generator: the Text component maps it onto GtkLabel properties with
3
3
  // this pure helper (no bridge imports).
4
4
  //
5
5
  // - xalign positions the whole text block inside the label allocation;
@@ -1 +1 @@
1
- {"version":3,"file":"text-align.js","sourceRoot":"","sources":["../../src/style/text-align.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,4EAA4E;AAC5E,wCAAwC;AACxC,EAAE;AACF,uEAAuE;AACvE,4EAA4E;AAC5E,gDAAgD;AAWhD,MAAM,CAAC,MAAM,qBAAqB,GAAG,CACnC,SAAgC,EACf,EAAE;IACnB,QAAQ,SAAS,EAAE,CAAC;QAClB,KAAK,OAAO;YACV,OAAO,EAAE,MAAM,EAAE,CAAC,EAAE,aAAa,EAAE,OAAO,EAAE,CAAA;QAC9C,KAAK,QAAQ;YACX,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,aAAa,EAAE,QAAQ,EAAE,CAAA;QACjD,KAAK,SAAS;YACZ,OAAO,EAAE,MAAM,EAAE,CAAC,EAAE,aAAa,EAAE,MAAM,EAAE,CAAA;QAC7C,KAAK,MAAM,CAAC;QACZ,KAAK,MAAM,CAAC;QACZ,KAAK,SAAS;YACZ,OAAO,EAAE,MAAM,EAAE,CAAC,EAAE,aAAa,EAAE,MAAM,EAAE,CAAA;IAC/C,CAAC;AACH,CAAC,CAAA","sourcesContent":["// GTK4 CSS has no text-align property, so textAlign never reaches the CSS\n// generator: the Text component (006) maps it onto GtkLabel properties with\n// this pure helper (no bridge imports).\n//\n// - xalign positions the whole text block inside the label allocation;\n// - justification aligns wrapped lines relative to each other (values match\n// Gtk.Justification: left/right/center/fill).\n\nimport type { VisualStyle } from \"../contracts\"\n\nexport type TextAlign = NonNullable<VisualStyle[\"textAlign\"]>\n\nexport type LabelAlignProps = {\n xalign: number\n justification: \"left\" | \"right\" | \"center\" | \"fill\"\n}\n\nexport const textAlignToLabelProps = (\n textAlign: TextAlign | undefined,\n): LabelAlignProps => {\n switch (textAlign) {\n case \"right\":\n return { xalign: 1, justification: \"right\" }\n case \"center\":\n return { xalign: 0.5, justification: \"center\" }\n case \"justify\":\n return { xalign: 0, justification: \"fill\" }\n case \"auto\":\n case \"left\":\n case undefined:\n return { xalign: 0, justification: \"left\" }\n }\n}\n"]}
1
+ {"version":3,"file":"text-align.js","sourceRoot":"","sources":["../../src/style/text-align.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,sEAAsE;AACtE,wCAAwC;AACxC,EAAE;AACF,uEAAuE;AACvE,4EAA4E;AAC5E,gDAAgD;AAWhD,MAAM,CAAC,MAAM,qBAAqB,GAAG,CACnC,SAAgC,EACf,EAAE;IACnB,QAAQ,SAAS,EAAE,CAAC;QAClB,KAAK,OAAO;YACV,OAAO,EAAE,MAAM,EAAE,CAAC,EAAE,aAAa,EAAE,OAAO,EAAE,CAAA;QAC9C,KAAK,QAAQ;YACX,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,aAAa,EAAE,QAAQ,EAAE,CAAA;QACjD,KAAK,SAAS;YACZ,OAAO,EAAE,MAAM,EAAE,CAAC,EAAE,aAAa,EAAE,MAAM,EAAE,CAAA;QAC7C,KAAK,MAAM,CAAC;QACZ,KAAK,MAAM,CAAC;QACZ,KAAK,SAAS;YACZ,OAAO,EAAE,MAAM,EAAE,CAAC,EAAE,aAAa,EAAE,MAAM,EAAE,CAAA;IAC/C,CAAC;AACH,CAAC,CAAA","sourcesContent":["// GTK4 CSS has no text-align property, so textAlign never reaches the CSS\n// generator: the Text component maps it onto GtkLabel properties with\n// this pure helper (no bridge imports).\n//\n// - xalign positions the whole text block inside the label allocation;\n// - justification aligns wrapped lines relative to each other (values match\n// Gtk.Justification: left/right/center/fill).\n\nimport type { VisualStyle } from \"../contracts\"\n\nexport type TextAlign = NonNullable<VisualStyle[\"textAlign\"]>\n\nexport type LabelAlignProps = {\n xalign: number\n justification: \"left\" | \"right\" | \"center\" | \"fill\"\n}\n\nexport const textAlignToLabelProps = (\n textAlign: TextAlign | undefined,\n): LabelAlignProps => {\n switch (textAlign) {\n case \"right\":\n return { xalign: 1, justification: \"right\" }\n case \"center\":\n return { xalign: 0.5, justification: \"center\" }\n case \"justify\":\n return { xalign: 0, justification: \"fill\" }\n case \"auto\":\n case \"left\":\n case undefined:\n return { xalign: 0, justification: \"left\" }\n }\n}\n"]}
@@ -36,10 +36,11 @@ export declare const platformSuffixes: (options?: PlatformResolutionOptions) =>
36
36
  */
37
37
  export declare const platformCandidates: (base: string, options?: PlatformResolutionOptions) => string[];
38
38
  /**
39
- * Metro platform-extension resolution for a single import:
40
- * only extensionless relative (or absolute) specifiers participate; the first
41
- * existing candidate wins; the `?query` suffix is carried over. Returns null
42
- * when the import is out of scope or no platform file exists, handing the
39
+ * Metro platform-extension resolution for a single import: relative (or
40
+ * absolute) specifiers that are extensionless or carry a strippable
41
+ * source extension try platform candidates first; the first existing
42
+ * candidate wins; the `?query` suffix is carried over. Returns null when
43
+ * the import is out of scope or no platform file exists, handing the
43
44
  * import back to the default resolver.
44
45
  */
45
46
  export declare const resolvePlatformSpecifier: (source: string, importer: string | undefined, exists: FileExists, options?: PlatformResolutionOptions) => string | null;
@@ -61,11 +61,18 @@ export const platformCandidates = (base, options = {}) => {
61
61
  ...suffixes.map((suffix) => `${base}/index${suffix}`),
62
62
  ];
63
63
  };
64
+ // Source extensions Metro strips before trying platform variants: an
65
+ // import of "./useLinking.js" (the TS-ESM style react-navigation and most
66
+ // compiled RN libraries use) must still find useLinking.native.tsx /
67
+ // useLinking.native.js — Metro resolves the BASE name platform-first, the
68
+ // literal file is only the fallback.
69
+ const STRIPPABLE_EXTENSIONS = new Set([".js", ".jsx", ".mjs", ".ts", ".tsx"]);
64
70
  /**
65
- * Metro platform-extension resolution for a single import:
66
- * only extensionless relative (or absolute) specifiers participate; the first
67
- * existing candidate wins; the `?query` suffix is carried over. Returns null
68
- * when the import is out of scope or no platform file exists, handing the
71
+ * Metro platform-extension resolution for a single import: relative (or
72
+ * absolute) specifiers that are extensionless or carry a strippable
73
+ * source extension try platform candidates first; the first existing
74
+ * candidate wins; the `?query` suffix is carried over. Returns null when
75
+ * the import is out of scope or no platform file exists, handing the
69
76
  * import back to the default resolver.
70
77
  */
71
78
  export const resolvePlatformSpecifier = (source, importer, exists, options = {}) => {
@@ -76,12 +83,14 @@ export const resolvePlatformSpecifier = (source, importer, exists, options = {})
76
83
  if (!isRelative(specifier) && !isAbsolute(specifier)) {
77
84
  return null;
78
85
  }
79
- if (extname(specifier) !== "") {
86
+ const extension = extname(specifier);
87
+ if (extension !== "" && !STRIPPABLE_EXTENSIONS.has(extension)) {
80
88
  return null;
81
89
  }
82
- const base = isAbsolute(specifier)
90
+ const withExtension = isAbsolute(specifier)
83
91
  ? specifier
84
92
  : resolve(dirname(splitQuery(importer).specifier), specifier);
93
+ const base = extension === "" ? withExtension : withExtension.slice(0, -extension.length);
85
94
  for (const candidate of platformCandidates(base, options)) {
86
95
  if (exists(candidate)) {
87
96
  return candidate + query;
@@ -111,7 +120,33 @@ export const reactNativeGtkx = (options = {}) => ({
111
120
  // codebase Node cannot parse) exists in RN monorepos. noExternal
112
121
  // forces the full plugin resolution, where the alias rewrites the
113
122
  // import to react-native-gtkx.
114
- noExternal: ["react-native-gtkx", "react-native"],
123
+ // @react-navigation must go through the pipeline too: it imports
124
+ // "react-native", and an externalized copy resolves that to the real
125
+ // Flow package (SyntaxError: Unexpected token 'typeof') instead of
126
+ // our alias. Only bites on the dev path — a production build inlines
127
+ // everything anyway.
128
+ noExternal: ["react-native-gtkx", "react-native", /^@react-navigation\//],
129
+ },
130
+ resolve: {
131
+ // RC2-WORKAROUND(runtime-dedupe): see docs/gtkx-rc2-notes.md
132
+ // The gtkx runtime and react are single-instance hosts: when the app
133
+ // and react-native-gtkx resolve them from different node_modules
134
+ // (file:-installed package, nested installs), two bundled copies
135
+ // double-init the runtime and GLib aborts. dedupe pins every copy to
136
+ // the project's own resolution.
137
+ dedupe: [
138
+ "@gtkx/css",
139
+ "@gtkx/gi",
140
+ "@gtkx/jsx",
141
+ "@gtkx/native",
142
+ "@gtkx/react",
143
+ "@gtkx/runtime",
144
+ // react-navigation is context-based: two bundled copies of core
145
+ // fail with "couldn't find a navigation context".
146
+ "@react-navigation/core",
147
+ "@react-navigation/native",
148
+ "react",
149
+ ],
115
150
  },
116
151
  }),
117
152
  async resolveId(source, importer) {
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/vite/index.ts"],"names":[],"mappings":"AAAA,yEAAyE;AACzE,4EAA4E;AAC5E,0EAA0E;AAC1E,2EAA2E;AAC3E,4BAA4B;AAC5B,EAAE;AACF,0EAA0E;AAC1E,4EAA4E;AAC5E,2EAA2E;AAC3E,6CAA6C;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AACpC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAgBjE,MAAM,CAAC,MAAM,iBAAiB,GAAsB,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAA;AACvE,MAAM,CAAC,MAAM,kBAAkB,GAAsB,CAAC,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,CAAC,CAAA;AAE/E,MAAM,YAAY,GAAG,cAAc,CAAA;AACnC,MAAM,iBAAiB,GAAG,mBAAmB,CAAA;AAE7C;;;;GAIG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,MAAc,EAAiB,EAAE;IACxE,IAAI,MAAM,KAAK,YAAY,EAAE,CAAC;QAC5B,OAAO,iBAAiB,CAAA;IAC1B,CAAC;IACD,IAAI,MAAM,CAAC,UAAU,CAAC,GAAG,YAAY,GAAG,CAAC,EAAE,CAAC;QAC1C,OAAO,GAAG,iBAAiB,GAAG,MAAM,CAAC,KAAK,CAAC,YAAY,CAAC,MAAM,CAAC,EAAE,CAAA;IACnE,CAAC;IACD,OAAO,IAAI,CAAA;AACb,CAAC,CAAA;AAED,0EAA0E;AAC1E,MAAM,CAAC,MAAM,UAAU,GAAG,CACxB,MAAc,EACwB,EAAE;I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E,CAAC,CAAC;QACb,GAAG,EAAE;YACH,iEAAiE;YACjE,kEAAkE;YAClE,sDAAsD;YACtD,EAAE;YACF,kEAAkE;YAClE,qEAAqE;YACrE,gEAAgE;YAChE,iEAAiE;YACjE,kEAAkE;YAClE,+BAA+B;YAC/B,UAAU,EAAE,CAAC,mBAAmB,EAAE,cAAc,CAAC;SAClD;KACF,CAAC;IAEF,KAAK,CAAC,SAAS,CAAC,MAAM,EAAE,QAAQ;QAC9B,MAAM,OAAO,GAAG,wBAAwB,CAAC,MAAM,CAAC,CAAA;QAChD,IAAI,OAAO,KAAK,IAAI,EAAE,CAAC;YACrB,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,QAAQ,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAA;YAC1E,OAAO,QAAQ,IAAI,OAAO,CAAA;QAC5B,CAAC;QACD,OAAO,wBAAwB,CAAC,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE,OAAO,CAAC,CAAA;IACxE,CAAC;CACF,CAAC,CAAA;AAEF,eAAe,eAAe,CAAA","sourcesContent":["// react-native-gtkx/vite — makes a gtkx project React Native compatible.\n// The gtkx CLI (dev and build) starts vite with an inline config that never\n// sets `configFile: false`, so vite picks up the project's vite.config.ts\n// from the root and merges it beneath the CLI config; this preset plugs in\n// there as a single plugin.\n//\n// Single self-contained file on purpose: vite loads the config's imported\n// packages with BARE Node, so this subpath (like ./metro and ./runner) must\n// not contain extensionless relative imports — the pure resolution helpers\n// live here rather than in a sibling module.\nimport { existsSync } from \"node:fs\"\nimport { dirname, extname, isAbsolute, resolve } from \"node:path\"\nimport type { Plugin } from \"vite\"\n\n// --- pure resolution logic (unit-tested directly) -----------------------\n\n/** Options shared by the preset factory and the pure resolver helpers. */\nexport type PlatformResolutionOptions = {\n /** Platform suffix priority, most specific first. Default: [\"linux\", \"native\"]. */\n platforms?: readonly string[]\n /** Source extensions tried for every platform suffix. Default: [\"tsx\", \"ts\", \"jsx\", \"js\"]. */\n extensions?: readonly string[]\n}\n\n/** Predicate the plugin injects as fs.existsSync; tests inject fakes. */\nexport type FileExists = (filePath: string) => boolean\n\nexport const DEFAULT_PLATFORMS: readonly string[] = [\"linux\", \"native\"]\nexport const DEFAULT_EXTENSIONS: readonly string[] = [\"tsx\", \"ts\", \"jsx\", \"js\"]\n\nconst REACT_NATIVE = \"react-native\"\nconst REACT_NATIVE_GTKX = \"react-native-gtkx\"\n\n/**\n * Maps `react-native` (and its subpaths) to `react-native-gtkx`.\n * Returns null for every other specifier, including `react-native-gtkx`\n * itself and lookalikes such as `react-native-web`.\n */\nexport const rewriteReactNativeImport = (source: string): string | null => {\n if (source === REACT_NATIVE) {\n return REACT_NATIVE_GTKX\n }\n if (source.startsWith(`${REACT_NATIVE}/`)) {\n return `${REACT_NATIVE_GTKX}${source.slice(REACT_NATIVE.length)}`\n }\n return null\n}\n\n/** Splits a vite specifier into its path part and its `?query` suffix. */\nexport const splitQuery = (\n source: string,\n): { specifier: string; query: string } => {\n const index = source.indexOf(\"?\")\n if (index === -1) {\n return { specifier: source, query: \"\" }\n }\n return { specifier: source.slice(0, index), query: source.slice(index) }\n}\n\nconst isRelative = (specifier: string): boolean =>\n specifier.startsWith(\"./\") || specifier.startsWith(\"../\")\n\n/**\n * Ordered platform suffixes, platform-major: every extension of the first\n * platform is tried before any extension of the next one\n * (`.linux.tsx`, `.linux.ts`, …, `.native.tsx`, …).\n */\nexport const platformSuffixes = (\n options: PlatformResolutionOptions = {},\n): string[] => {\n const platforms = options.platforms ?? DEFAULT_PLATFORMS\n const extensions = options.extensions ?? DEFAULT_EXTENSIONS\n return platforms.flatMap((platform) =>\n extensions.map((extension) => `.${platform}.${extension}`),\n )\n}\n\n/**\n * Candidate file paths for an extensionless base path, in priority order:\n * direct platform files first, then platform index files of a directory —\n * mirroring Metro, which exhausts file resolution before directory resolution.\n * The base file itself is not a candidate: when no platform file exists the\n * plugin bails out and the default resolver picks the base module.\n */\nexport const platformCandidates = (\n base: string,\n options: PlatformResolutionOptions = {},\n): string[] => {\n const suffixes = platformSuffixes(options)\n return [\n ...suffixes.map((suffix) => `${base}${suffix}`),\n ...suffixes.map((suffix) => `${base}/index${suffix}`),\n ]\n}\n\n/**\n * Metro platform-extension resolution for a single import:\n * only extensionless relative (or absolute) specifiers participate; the first\n * existing candidate wins; the `?query` suffix is carried over. Returns null\n * when the import is out of scope or no platform file exists, handing the\n * import back to the default resolver.\n */\nexport const resolvePlatformSpecifier = (\n source: string,\n importer: string | undefined,\n exists: FileExists,\n options: PlatformResolutionOptions = {},\n): string | null => {\n if (importer === undefined || source.startsWith(\"\\0\")) {\n return null\n }\n const { specifier, query } = splitQuery(source)\n if (!isRelative(specifier) && !isAbsolute(specifier)) {\n return null\n }\n if (extname(specifier) !== \"\") {\n return null\n }\n const base = isAbsolute(specifier)\n ? specifier\n : resolve(dirname(splitQuery(importer).specifier), specifier)\n for (const candidate of platformCandidates(base, options)) {\n if (exists(candidate)) {\n return candidate + query\n }\n }\n return null\n}\n\n// --- the vite plugin ----------------------------------------------------\n\nexport type ReactNativeGtkxOptions = PlatformResolutionOptions\n\n/**\n * Vite plugin: aliases `react-native` (and subpaths) to `react-native-gtkx`\n * and resolves Metro-style platform extensions\n * (`.linux.tsx` → `.native.tsx` → base) for extensionless imports.\n */\nexport const reactNativeGtkx = (\n options: ReactNativeGtkxOptions = {},\n): Plugin => ({\n name: \"react-native-gtkx:preset\",\n // Before vite's own resolver and the gtkx CLI plugins: the alias must win\n // over node resolution and platform files must win over the base file.\n enforce: \"pre\",\n\n config: () => ({\n ssr: {\n // `gtkx dev` runs vite with ssr.external: true, which would hand\n // react-native-gtkx straight to node. Keep the package inside the\n // vite pipeline; noExternal wins over external: true.\n //\n // \"react-native\" must be listed too: with ssr.external: true vite\n // externalizes a bare import BEFORE the plugin pipeline whenever the\n // package resolves natively — and the real react-native (a Flow\n // codebase Node cannot parse) exists in RN monorepos. noExternal\n // forces the full plugin resolution, where the alias rewrites the\n // import to react-native-gtkx.\n noExternal: [\"react-native-gtkx\", \"react-native\"],\n },\n }),\n\n async resolveId(source, importer) {\n const aliased = rewriteReactNativeImport(source)\n if (aliased !== null) {\n const resolved = await this.resolve(aliased, importer, { skipSelf: true })\n return resolved ?? aliased\n }\n return resolvePlatformSpecifier(source, importer, existsSync, options)\n },\n})\n\nexport default reactNativeGtkx\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/vite/index.ts"],"names":[],"mappings":"AAAA,yEAAyE;AACzE,4EAA4E;AAC5E,0EAA0E;AAC1E,2EAA2E;AAC3E,4BAA4B;AAC5B,EAAE;AACF,0EAA0E;AAC1E,4EAA4E;AAC5E,2EAA2E;AAC3E,6CAA6C;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AACpC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAgBjE,MAAM,CAAC,MAAM,iBAAiB,GAAsB,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAA;AACvE,MAAM,CAAC,MAAM,kBAAkB,GAAsB,CAAC,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,CAAC,CAAA;AAE/E,MAAM,YAAY,GAAG,cAAc,CAAA;AACnC,MAAM,iBAAiB,GAAG,mBAAmB,CAAA;AAE7C;;;;GAIG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,MAAc,EAAiB,EAAE;IACxE,IAAI,MAAM,KAAK,YAAY,EAAE,CAAC;QAC5B,OAAO,iBAAiB,CAAA;IAC1B,CAAC;IACD,IAAI,MAAM,CAAC,UAAU,CAAC,GAAG,YAAY,GAAG,CAAC,EAAE,CAAC;QAC1C,OAAO,GAAG,iBAAiB,GAAG,MAAM,CAAC,KAAK,CAAC,YAAY,CAAC,MAAM,CAAC,EAAE,CAAA;IACnE,CAAC;IACD,OAAO,IAAI,CAAA;AACb,CAAC,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CAAA;QAChD,IAAI,OAAO,KAAK,IAAI,EAAE,CAAC;YACrB,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,QAAQ,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAA;YAC1E,OAAO,QAAQ,IAAI,OAAO,CAAA;QAC5B,CAAC;QACD,OAAO,wBAAwB,CAAC,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE,OAAO,CAAC,CAAA;IACxE,CAAC;CACF,CAAC,CAAA;AAEF,eAAe,eAAe,CAAA","sourcesContent":["// react-native-gtkx/vite — makes a gtkx project React Native compatible.\n// The gtkx CLI (dev and build) starts vite with an inline config that never\n// sets `configFile: false`, so vite picks up the project's vite.config.ts\n// from the root and merges it beneath the CLI config; this preset plugs in\n// there as a single plugin.\n//\n// Single self-contained file on purpose: vite loads the config's imported\n// packages with BARE Node, so this subpath (like ./metro and ./runner) must\n// not contain extensionless relative imports — the pure resolution helpers\n// live here rather than in a sibling module.\nimport { existsSync } from \"node:fs\"\nimport { dirname, extname, isAbsolute, resolve } from \"node:path\"\nimport type { Plugin } from \"vite\"\n\n// --- pure resolution logic (unit-tested directly) -----------------------\n\n/** Options shared by the preset factory and the pure resolver helpers. */\nexport type PlatformResolutionOptions = {\n /** Platform suffix priority, most specific first. Default: [\"linux\", \"native\"]. */\n platforms?: readonly string[]\n /** Source extensions tried for every platform suffix. Default: [\"tsx\", \"ts\", \"jsx\", \"js\"]. */\n extensions?: readonly string[]\n}\n\n/** Predicate the plugin injects as fs.existsSync; tests inject fakes. */\nexport type FileExists = (filePath: string) => boolean\n\nexport const DEFAULT_PLATFORMS: readonly string[] = [\"linux\", \"native\"]\nexport const DEFAULT_EXTENSIONS: readonly string[] = [\"tsx\", \"ts\", \"jsx\", \"js\"]\n\nconst REACT_NATIVE = \"react-native\"\nconst REACT_NATIVE_GTKX = \"react-native-gtkx\"\n\n/**\n * Maps `react-native` (and its subpaths) to `react-native-gtkx`.\n * Returns null for every other specifier, including `react-native-gtkx`\n * itself and lookalikes such as `react-native-web`.\n */\nexport const rewriteReactNativeImport = (source: string): string | null => {\n if (source === REACT_NATIVE) {\n return REACT_NATIVE_GTKX\n }\n if (source.startsWith(`${REACT_NATIVE}/`)) {\n return `${REACT_NATIVE_GTKX}${source.slice(REACT_NATIVE.length)}`\n }\n return null\n}\n\n/** Splits a vite specifier into its path part and its `?query` suffix. */\nexport const splitQuery = (\n source: string,\n): { specifier: string; query: string } => {\n const index = source.indexOf(\"?\")\n if (index === -1) {\n return { specifier: source, query: \"\" }\n }\n return { specifier: source.slice(0, index), query: source.slice(index) }\n}\n\nconst isRelative = (specifier: string): boolean =>\n specifier.startsWith(\"./\") || specifier.startsWith(\"../\")\n\n/**\n * Ordered platform suffixes, platform-major: every extension of the first\n * platform is tried before any extension of the next one\n * (`.linux.tsx`, `.linux.ts`, …, `.native.tsx`, …).\n */\nexport const platformSuffixes = (\n options: PlatformResolutionOptions = {},\n): string[] => {\n const platforms = options.platforms ?? DEFAULT_PLATFORMS\n const extensions = options.extensions ?? DEFAULT_EXTENSIONS\n return platforms.flatMap((platform) =>\n extensions.map((extension) => `.${platform}.${extension}`),\n )\n}\n\n/**\n * Candidate file paths for an extensionless base path, in priority order:\n * direct platform files first, then platform index files of a directory —\n * mirroring Metro, which exhausts file resolution before directory resolution.\n * The base file itself is not a candidate: when no platform file exists the\n * plugin bails out and the default resolver picks the base module.\n */\nexport const platformCandidates = (\n base: string,\n options: PlatformResolutionOptions = {},\n): string[] => {\n const suffixes = platformSuffixes(options)\n return [\n ...suffixes.map((suffix) => `${base}${suffix}`),\n ...suffixes.map((suffix) => `${base}/index${suffix}`),\n ]\n}\n\n// Source extensions Metro strips before trying platform variants: an\n// import of \"./useLinking.js\" (the TS-ESM style react-navigation and most\n// compiled RN libraries use) must still find useLinking.native.tsx /\n// useLinking.native.js — Metro resolves the BASE name platform-first, the\n// literal file is only the fallback.\nconst STRIPPABLE_EXTENSIONS = new Set([\".js\", \".jsx\", \".mjs\", \".ts\", \".tsx\"])\n\n/**\n * Metro platform-extension resolution for a single import: relative (or\n * absolute) specifiers that are extensionless — or carry a strippable\n * source extension — try platform candidates first; the first existing\n * candidate wins; the `?query` suffix is carried over. Returns null when\n * the import is out of scope or no platform file exists, handing the\n * import back to the default resolver.\n */\nexport const resolvePlatformSpecifier = (\n source: string,\n importer: string | undefined,\n exists: FileExists,\n options: PlatformResolutionOptions = {},\n): string | null => {\n if (importer === undefined || source.startsWith(\"\\0\")) {\n return null\n }\n const { specifier, query } = splitQuery(source)\n if (!isRelative(specifier) && !isAbsolute(specifier)) {\n return null\n }\n const extension = extname(specifier)\n if (extension !== \"\" && !STRIPPABLE_EXTENSIONS.has(extension)) {\n return null\n }\n const withExtension = isAbsolute(specifier)\n ? specifier\n : resolve(dirname(splitQuery(importer).specifier), specifier)\n const base =\n extension === \"\" ? withExtension : withExtension.slice(0, -extension.length)\n for (const candidate of platformCandidates(base, options)) {\n if (exists(candidate)) {\n return candidate + query\n }\n }\n return null\n}\n\n// --- the vite plugin ----------------------------------------------------\n\nexport type ReactNativeGtkxOptions = PlatformResolutionOptions\n\n/**\n * Vite plugin: aliases `react-native` (and subpaths) to `react-native-gtkx`\n * and resolves Metro-style platform extensions\n * (`.linux.tsx` → `.native.tsx` → base) for extensionless imports.\n */\nexport const reactNativeGtkx = (\n options: ReactNativeGtkxOptions = {},\n): Plugin => ({\n name: \"react-native-gtkx:preset\",\n // Before vite's own resolver and the gtkx CLI plugins: the alias must win\n // over node resolution and platform files must win over the base file.\n enforce: \"pre\",\n\n config: () => ({\n ssr: {\n // `gtkx dev` runs vite with ssr.external: true, which would hand\n // react-native-gtkx straight to node. Keep the package inside the\n // vite pipeline; noExternal wins over external: true.\n //\n // \"react-native\" must be listed too: with ssr.external: true vite\n // externalizes a bare import BEFORE the plugin pipeline whenever the\n // package resolves natively — and the real react-native (a Flow\n // codebase Node cannot parse) exists in RN monorepos. noExternal\n // forces the full plugin resolution, where the alias rewrites the\n // import to react-native-gtkx.\n // @react-navigation must go through the pipeline too: it imports\n // \"react-native\", and an externalized copy resolves that to the real\n // Flow package (SyntaxError: Unexpected token 'typeof') instead of\n // our alias. Only bites on the dev path — a production build inlines\n // everything anyway.\n noExternal: [\"react-native-gtkx\", \"react-native\", /^@react-navigation\\//],\n },\n resolve: {\n // RC2-WORKAROUND(runtime-dedupe): see docs/gtkx-rc2-notes.md\n // The gtkx runtime and react are single-instance hosts: when the app\n // and react-native-gtkx resolve them from different node_modules\n // (file:-installed package, nested installs), two bundled copies\n // double-init the runtime and GLib aborts. dedupe pins every copy to\n // the project's own resolution.\n dedupe: [\n \"@gtkx/css\",\n \"@gtkx/gi\",\n \"@gtkx/jsx\",\n \"@gtkx/native\",\n \"@gtkx/react\",\n \"@gtkx/runtime\",\n // react-navigation is context-based: two bundled copies of core\n // fail with \"couldn't find a navigation context\".\n \"@react-navigation/core\",\n \"@react-navigation/native\",\n \"react\",\n ],\n },\n }),\n\n async resolveId(source, importer) {\n const aliased = rewriteReactNativeImport(source)\n if (aliased !== null) {\n const resolved = await this.resolve(aliased, importer, { skipSelf: true })\n return resolved ?? aliased\n }\n return resolvePlatformSpecifier(source, importer, existsSync, options)\n },\n})\n\nexport default reactNativeGtkx\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-gtkx",
3
- "version": "0.1.0-alpha.2",
3
+ "version": "0.1.0-alpha.4",
4
4
  "description": "React Native components and APIs for Linux desktop, rendered as native GTK4 widgets via gtkx",
5
5
  "license": "MIT",
6
6
  "author": "Anton Petrov <anton@itsmepetrov.com>",
@@ -27,7 +27,7 @@
27
27
  "main": "./dist/index.js",
28
28
  "types": "./dist/index.d.ts",
29
29
  "engines": {
30
- "node": ">=22.15"
30
+ "node": ">=24"
31
31
  },
32
32
  "exports": {
33
33
  "./package.json": "./package.json",
@@ -43,6 +43,10 @@
43
43
  "types": "./dist/runner/index.d.ts",
44
44
  "default": "./dist/runner/index.js"
45
45
  },
46
+ "./navigation": {
47
+ "types": "./dist/navigation/index.d.ts",
48
+ "default": "./dist/navigation/index.js"
49
+ },
46
50
  "./vite": {
47
51
  "types": "./dist/vite/index.d.ts",
48
52
  "default": "./dist/vite/index.js"
@@ -58,25 +62,29 @@
58
62
  "watch:dist": "tsc -p tsconfig.build.json --watch --preserveWatchOutput"
59
63
  },
60
64
  "peerDependencies": {
61
- "react": "^19",
65
+ "@react-navigation/native": "^7.0.0",
66
+ "react": "^19.2",
62
67
  "vite": "^7.0.0 || ^8.0.0"
63
68
  },
64
69
  "peerDependenciesMeta": {
70
+ "@react-navigation/native": {
71
+ "optional": true
72
+ },
65
73
  "vite": {
66
74
  "optional": true
67
75
  }
68
76
  },
69
77
  "dependencies": {
70
- "@gtkx/cli": "1.0.0-rc.1",
71
- "@gtkx/config": "1.0.0-rc.1",
72
- "@gtkx/css": "1.0.0-rc.1",
73
- "@gtkx/react": "1.0.0-rc.1",
74
- "@gtkx/runtime": "1.0.0-rc.1",
78
+ "@gtkx/cli": "1.0.0-rc.2",
79
+ "@gtkx/config": "1.0.0-rc.2",
80
+ "@gtkx/css": "1.0.0-rc.2",
81
+ "@gtkx/react": "1.0.0-rc.2",
82
+ "@gtkx/runtime": "1.0.0-rc.2",
75
83
  "yoga-layout": "^3.2.1"
76
84
  },
77
85
  "devDependencies": {
78
- "@gtkx/testing": "1.0.0-rc.1",
79
- "@gtkx/vitest": "1.0.0-rc.1",
86
+ "@gtkx/testing": "1.0.0-rc.2",
87
+ "@gtkx/vitest": "1.0.0-rc.2",
80
88
  "vite": "^8.1.4"
81
89
  },
82
90
  "files": [
package/types.d.ts CHANGED
@@ -38,6 +38,19 @@ declare module "react-native" {
38
38
  default?: T
39
39
  }): T | undefined
40
40
  }
41
+
42
+ // Desktop has a pointer, so Pressable reports hover alongside press —
43
+ // `style={({ pressed, hovered }) => …}` and the children callback, the
44
+ // same shape react-native-web exposes. The stock type only carries
45
+ // `pressed` (mobile has no hover), and interfaces merge, so referencing
46
+ // this module adds the field without touching anything else.
47
+ //
48
+ // OPTIONAL on purpose: an app sharing one component with ios/android
49
+ // gets `undefined` there, and the type should say so — write
50
+ // `hovered && styles.hovered`, which is correct on every platform.
51
+ interface PressableStateCallbackType {
52
+ hovered?: boolean
53
+ }
41
54
  }
42
55
 
43
56
  export {}