@tamagui/dom 0.0.0-bootstrap.0 → 3.0.0-beta.643.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.
Files changed (93) hide show
  1. package/dist/cjs/events.cjs +17 -0
  2. package/dist/cjs/events.native.cjs +19 -0
  3. package/dist/cjs/events.native.js +21 -0
  4. package/dist/cjs/events.native.js.map +1 -0
  5. package/dist/cjs/index.cjs +26 -0
  6. package/dist/cjs/index.native.cjs +28 -0
  7. package/dist/cjs/index.native.js +30 -0
  8. package/dist/cjs/index.native.js.map +1 -0
  9. package/dist/cjs/props.cjs +17 -0
  10. package/dist/cjs/props.native.cjs +19 -0
  11. package/dist/cjs/props.native.js +21 -0
  12. package/dist/cjs/props.native.js.map +1 -0
  13. package/dist/cjs/tables/attributes.cjs +850 -0
  14. package/dist/cjs/tables/attributes.native.cjs +862 -0
  15. package/dist/cjs/tables/attributes.native.js +864 -0
  16. package/dist/cjs/tables/attributes.native.js.map +1 -0
  17. package/dist/cjs/tables/compatibility.cjs +338 -0
  18. package/dist/cjs/tables/compatibility.native.cjs +340 -0
  19. package/dist/cjs/tables/compatibility.native.js +342 -0
  20. package/dist/cjs/tables/compatibility.native.js.map +1 -0
  21. package/dist/cjs/tables/events.cjs +169 -0
  22. package/dist/cjs/tables/events.native.cjs +175 -0
  23. package/dist/cjs/tables/events.native.js +177 -0
  24. package/dist/cjs/tables/events.native.js.map +1 -0
  25. package/dist/cjs/tables/nativeBacking.cjs +133 -0
  26. package/dist/cjs/tables/nativeBacking.native.cjs +135 -0
  27. package/dist/cjs/tables/nativeBacking.native.js +137 -0
  28. package/dist/cjs/tables/nativeBacking.native.js.map +1 -0
  29. package/dist/cjs/tables/tags.cjs +576 -0
  30. package/dist/cjs/tables/tags.native.cjs +578 -0
  31. package/dist/cjs/tables/tags.native.js +580 -0
  32. package/dist/cjs/tables/tags.native.js.map +1 -0
  33. package/dist/cjs/tables/types.cjs +17 -0
  34. package/dist/cjs/tables/types.native.cjs +19 -0
  35. package/dist/cjs/tables/types.native.js +21 -0
  36. package/dist/cjs/tables/types.native.js.map +1 -0
  37. package/dist/esm/events.mjs +0 -0
  38. package/dist/esm/events.native.js +0 -0
  39. package/dist/esm/index.mjs +15 -0
  40. package/dist/esm/index.native.js +15 -0
  41. package/dist/esm/props.mjs +0 -0
  42. package/dist/esm/props.native.js +0 -0
  43. package/dist/esm/tables/attributes.mjs +821 -0
  44. package/dist/esm/tables/attributes.mjs.map +1 -0
  45. package/dist/esm/tables/attributes.native.js +831 -0
  46. package/dist/esm/tables/attributes.native.js.map +1 -0
  47. package/dist/esm/tables/compatibility.mjs +314 -0
  48. package/dist/esm/tables/compatibility.mjs.map +1 -0
  49. package/dist/esm/tables/compatibility.native.js +314 -0
  50. package/dist/esm/tables/compatibility.native.js.map +1 -0
  51. package/dist/esm/tables/events.mjs +145 -0
  52. package/dist/esm/tables/events.mjs.map +1 -0
  53. package/dist/esm/tables/events.native.js +149 -0
  54. package/dist/esm/tables/events.native.js.map +1 -0
  55. package/dist/esm/tables/nativeBacking.mjs +106 -0
  56. package/dist/esm/tables/nativeBacking.mjs.map +1 -0
  57. package/dist/esm/tables/nativeBacking.native.js +106 -0
  58. package/dist/esm/tables/nativeBacking.native.js.map +1 -0
  59. package/dist/esm/tables/tags.mjs +550 -0
  60. package/dist/esm/tables/tags.mjs.map +1 -0
  61. package/dist/esm/tables/tags.native.js +550 -0
  62. package/dist/esm/tables/tags.native.js.map +1 -0
  63. package/dist/esm/tables/types.mjs +0 -0
  64. package/dist/esm/tables/types.native.js +0 -0
  65. package/package.json +57 -7
  66. package/src/events.ts +58 -0
  67. package/src/index.ts +19 -0
  68. package/src/props.ts +699 -0
  69. package/src/tables/attributes.ts +863 -0
  70. package/src/tables/compatibility.ts +360 -0
  71. package/src/tables/events.ts +176 -0
  72. package/src/tables/nativeBacking.ts +132 -0
  73. package/src/tables/tags.ts +557 -0
  74. package/src/tables/types.ts +202 -0
  75. package/types/events.d.ts +58 -0
  76. package/types/events.d.ts.map +11 -0
  77. package/types/index.d.ts +20 -0
  78. package/types/index.d.ts.map +11 -0
  79. package/types/props.d.ts +499 -0
  80. package/types/props.d.ts.map +11 -0
  81. package/types/tables/attributes.d.ts +21 -0
  82. package/types/tables/attributes.d.ts.map +11 -0
  83. package/types/tables/compatibility.d.ts +28 -0
  84. package/types/tables/compatibility.d.ts.map +11 -0
  85. package/types/tables/events.d.ts +5 -0
  86. package/types/tables/events.d.ts.map +11 -0
  87. package/types/tables/nativeBacking.d.ts +28 -0
  88. package/types/tables/nativeBacking.d.ts.map +11 -0
  89. package/types/tables/tags.d.ts +36 -0
  90. package/types/tables/tags.d.ts.map +11 -0
  91. package/types/tables/types.d.ts +135 -0
  92. package/types/tables/types.d.ts.map +11 -0
  93. package/README.md +0 -1
@@ -0,0 +1,28 @@
1
+ import type { CompatibilityRow } from "./types";
2
+ /**
3
+ * Every deliberate difference between the Tamagui DOM contract and the pinned
4
+ * React Strict DOM release.
5
+ *
6
+ * The conformance test walks the RSD snapshot against the tables and requires
7
+ * the keys claimed here to be exactly the differences it finds: an unclaimed
8
+ * difference and a claim that is no longer a difference both fail. So this file
9
+ * cannot drift in either direction, and refreshing the pin
10
+ * (`bun scripts/extract-rsd-snapshot.ts`) surfaces whatever changed as a test
11
+ * failure naming the exact key. Every key is spelled out for the same reason
12
+ * — a pattern would quietly absorb the next element that starts differing.
13
+ *
14
+ * Style keys are `<platform>.<tag>.<property>`. Prop and event keys are the
15
+ * prop name. A key belongs to exactly one row.
16
+ */
17
+ /**
18
+ * The pinned reference. The conformance test asserts this matches the snapshot,
19
+ * so refreshing the pin without updating this line fails.
20
+ */
21
+ export declare const RSD_REFERENCE: Readonly<{
22
+ version: string;
23
+ commit: string;
24
+ date: string;
25
+ }>;
26
+ export declare const COMPATIBILITY: readonly CompatibilityRow[];
27
+
28
+ //# sourceMappingURL=compatibility.d.ts.map
@@ -0,0 +1,11 @@
1
+ {
2
+ "mappings": "AAAA,cAAc,wBAAwB;;;;;;;;;;;;;;;;;;;;AAsBtC,OAAO,cAAM,eAAe,SAAS;CACnC;CACA;CACA;;AAOF,OAAO,cAAM,wBAAwB",
3
+ "names": [],
4
+ "sources": [
5
+ "src/tables/compatibility.ts"
6
+ ],
7
+ "version": 3,
8
+ "sourcesContent": [
9
+ "import type { CompatibilityRow } from './types'\n\n/**\n * Every deliberate difference between the Tamagui DOM contract and the pinned\n * React Strict DOM release.\n *\n * The conformance test walks the RSD snapshot against the tables and requires\n * the keys claimed here to be exactly the differences it finds: an unclaimed\n * difference and a claim that is no longer a difference both fail. So this file\n * cannot drift in either direction, and refreshing the pin\n * (`bun scripts/extract-rsd-snapshot.ts`) surfaces whatever changed as a test\n * failure naming the exact key. Every key is spelled out for the same reason\n * — a pattern would quietly absorb the next element that starts differing.\n *\n * Style keys are `<platform>.<tag>.<property>`. Prop and event keys are the\n * prop name. A key belongs to exactly one row.\n */\n\n/**\n * The pinned reference. The conformance test asserts this matches the snapshot,\n * so refreshing the pin without updating this line fails.\n */\nexport const RSD_REFERENCE: Readonly<{\n version: string\n commit: string\n date: string\n}> = {\n version: '0.0.55',\n commit: 'c877f5c19b141e25c089d993b4cc584e669b6e39',\n date: '2026-06-23',\n}\n\nexport const COMPATIBILITY: readonly CompatibilityRow[] = [\n {\n area: 'tag',\n subject: 'html.select, html.option, html.optgroup',\n keys: [],\n rsd: 'renders a view and text elements on native with no menu behaviour, and documents the tags as unsupported there',\n tamagui: 'native build error naming the tag',\n reason:\n 'an element that renders but cannot open, select or report a value is a silent approximation, which the DOM contract rules out',\n },\n {\n area: 'tag',\n subject: 'html.form, html.fieldset',\n keys: [],\n rsd: 'documents form as unsupported on native',\n tamagui: 'renders as a native container, with no submission, validation or reset',\n reason:\n 'the layout and accessibility of the container are correct on native; only submission is missing, and that is documented per prop',\n },\n {\n area: 'prop',\n subject: 'autoCapitalize, enterKeyHint, inputMode, spellCheck',\n keys: ['autoCapitalize', 'enterKeyHint', 'inputMode', 'spellCheck'],\n rsd: 'declared on every element, forwarded only by the text-entry factory',\n tamagui: 'declared on input and textarea only',\n reason:\n 'they have no effect anywhere else on either platform, so the narrower type is the honest one',\n },\n {\n area: 'prop',\n subject: 'spellCheck on native',\n keys: [],\n rsd: 'documented as unsupported',\n tamagui: 'forwarded to the text-entry control, ios only',\n reason:\n 'react native implements spellCheck on TextInput for ios; the RSD table predates it and its own runtime forwards the prop',\n },\n {\n area: 'prop',\n subject: 'aria-describedby',\n keys: [],\n rsd: 'documented as polyfilled on native, but its runtime does not map it',\n tamagui: 'web only, with a note pointing at aria-label',\n reason:\n 'react native has no described-by relationship, so the table follows the runtime rather than the documentation',\n },\n {\n area: 'prop',\n subject: 'data-*',\n keys: ['data-*'],\n rsd: 'allows any data- prefixed prop at runtime but types none of them',\n tamagui: 'one data-* row, so the generated interfaces admit the whole prefix',\n reason:\n 'the runtime already accepts them; leaving them untyped only means authors reach for a cast',\n },\n {\n area: 'prop',\n subject: 'data-layoutconformance',\n keys: ['data-layoutconformance'],\n rsd: 'opts an element subtree into W3C layout conformance on native',\n tamagui: 'not part of the contract',\n reason:\n 'it is an escape hatch for a specific react native migration, not a DOM prop, and DOM mode targets one layout model',\n },\n {\n area: 'prop',\n subject: 'selected on html.option',\n keys: ['selected'],\n rsd: 'allowlisted, but not declared by its option props type',\n tamagui: 'not part of the contract',\n reason:\n 'react warns on it and steers to value or defaultValue on the select, and select has no native rendering anyway',\n },\n {\n area: 'prop',\n subject: 'children on a void or text-only element',\n keys: [],\n rsd: 'types children as a react node on every element, including br, hr, img, input, textarea and option',\n tamagui:\n 'types it as never on the five void elements and as string or number inside an option, from the content model in the tag table',\n reason:\n 'the compiler already reports this nesting as a build error, and the same rule stated in the types reports it in the editor instead of at build time',\n },\n {\n area: 'event',\n subject: 'onSelectionChange',\n keys: ['onSelectionChange'],\n rsd: 'allowlisted and typed on input and textarea, then warned about as unsupported',\n tamagui:\n 'not part of the contract; the selection cache behind the ref polyfill stays internal',\n reason:\n 'it is not a React DOM prop, so it does nothing on web and warns on native: no platform supports it',\n },\n {\n area: 'event',\n subject: 'onMouseMove',\n keys: [],\n rsd: 'allowed on the strict surface but omitted from the native prop forwarding path',\n tamagui: 'native diagnostic pointing at onPointerMove',\n reason:\n 'a handler that is silently dropped is worse than a build error naming the supported cross-platform spelling; the other mouse events and onScroll match the upstream native host passthrough',\n },\n {\n area: 'event',\n subject: 'onClick on native',\n keys: [],\n rsd: 'documented as unsupported, polyfilled in its runtime through the press event',\n tamagui: 'polyfilled through the press event, documented as a polyfill',\n reason:\n 'the polyfill is real and useful; the payload subset it can fill in is documented instead of denied',\n },\n {\n area: 'style',\n subject: 'inline reset spelling',\n keys: [\n // the thirteen tags RSD gives its inline reset on web\n 'web.a.textAlign',\n 'web.a.textDecoration',\n 'web.a.textDecorationLine',\n 'web.b.textAlign',\n 'web.b.textDecoration',\n 'web.b.textDecorationLine',\n 'web.bdi.textAlign',\n 'web.bdi.textDecoration',\n 'web.bdi.textDecorationLine',\n 'web.bdo.textAlign',\n 'web.bdo.textDecoration',\n 'web.bdo.textDecorationLine',\n 'web.code.textAlign',\n 'web.code.textDecoration',\n 'web.code.textDecorationLine',\n 'web.em.textAlign',\n 'web.em.textDecoration',\n 'web.em.textDecorationLine',\n 'web.i.textAlign',\n 'web.i.textDecoration',\n 'web.i.textDecorationLine',\n 'web.label.textAlign',\n 'web.label.textDecoration',\n 'web.label.textDecorationLine',\n 'web.mark.textAlign',\n 'web.mark.textDecoration',\n 'web.mark.textDecorationLine',\n 'web.span.textAlign',\n 'web.span.textDecoration',\n 'web.span.textDecorationLine',\n 'web.strong.textAlign',\n 'web.strong.textDecoration',\n 'web.strong.textDecorationLine',\n 'web.sub.textAlign',\n 'web.sub.textDecoration',\n 'web.sub.textDecorationLine',\n 'web.sup.textAlign',\n 'web.sup.textDecoration',\n 'web.sup.textDecorationLine',\n ],\n rsd: 'resets inline elements with textDecoration: none and textAlign: inherit',\n tamagui: 'resets with textDecorationLine: none and leaves textAlign alone',\n reason:\n 'textDecorationLine is the one spelling that means the same thing on both platforms, and textAlign already inherits, so declaring it changes nothing',\n },\n {\n area: 'style',\n subject: 'element defaults RSD leaves to the browser on web',\n keys: [\n // br, del, ins, kbd, optgroup, option, s and u get no RSD web styles at all\n 'web.br.margin',\n 'web.br.padding',\n 'web.br.textDecorationLine',\n 'web.del.margin',\n 'web.del.padding',\n 'web.del.textDecorationLine',\n 'web.ins.margin',\n 'web.ins.padding',\n 'web.ins.textDecorationLine',\n 'web.kbd.fontFamily',\n 'web.kbd.fontSize',\n 'web.kbd.margin',\n 'web.kbd.padding',\n 'web.kbd.textDecorationLine',\n 'web.optgroup.margin',\n 'web.optgroup.padding',\n 'web.option.margin',\n 'web.option.padding',\n 'web.s.margin',\n 'web.s.padding',\n 'web.s.textDecorationLine',\n 'web.u.margin',\n 'web.u.padding',\n 'web.u.textDecorationLine',\n // and the rest lean on the browser stylesheet for their one decoration\n 'web.b.fontWeight',\n 'web.em.fontStyle',\n 'web.h1.fontWeight',\n 'web.h2.fontWeight',\n 'web.h3.fontWeight',\n 'web.h4.fontWeight',\n 'web.h5.fontWeight',\n 'web.h6.fontWeight',\n 'web.i.fontStyle',\n 'web.mark.backgroundColor',\n 'web.mark.color',\n ],\n rsd: 'applies no default styles at all to br, del, ins, kbd, optgroup, option, s and u on web, and relies on the browser stylesheet for the bold, italic, monospace, strike, underline and highlight of every other tag',\n tamagui: 'applies the same element defaults on both platforms',\n reason:\n 'one source has to render the same on web and native, which it cannot if half the defaults come from a browser stylesheet a css reset is free to remove',\n },\n {\n area: 'style',\n subject: 'html.a default styles',\n keys: ['native.a.color', 'native.a.textDecorationLine'],\n rsd: 'strips the underline on web and adds blue plus underline on native, so one source renders differently per platform',\n tamagui: 'applies the same inline reset on both platforms and adds no link colour',\n reason:\n 'cross-platform parity is the point of the shared fixture, and a hardcoded link colour cannot follow a theme',\n },\n {\n area: 'style',\n subject: 'monospace font family',\n keys: [\n 'web.code.fontFamily',\n 'web.pre.fontFamily',\n 'native.code.fontFamily',\n 'native.kbd.fontFamily',\n 'native.pre.fontFamily',\n ],\n rsd: 'writes monospace, \"monospace\" on web to cancel the browser size quirk, and picks Menlo on ios',\n tamagui:\n 'writes monospace on both platforms and cancels the size quirk with fontSize: 1em instead',\n reason:\n 'the duplicated family name only exists to defeat the size quirk, which 1em does directly; the font family itself belongs to the theme, not to the tag',\n },\n {\n area: 'style',\n subject: 'overflow on html.code',\n keys: ['web.code.overflow'],\n rsd: 'shares one rule between code and pre, so inline code gets overflow: auto too',\n tamagui: 'scrolls pre only',\n reason: 'overflow does nothing on an inline element',\n },\n {\n area: 'style',\n subject: 'web css properties a Tamagui style prop cannot express',\n keys: [\n 'web.a.wordWrap',\n 'web.b.wordWrap',\n 'web.bdi.wordWrap',\n 'web.bdo.wordWrap',\n 'web.code.wordWrap',\n 'web.em.wordWrap',\n 'web.h1.wordWrap',\n 'web.h2.wordWrap',\n 'web.h3.wordWrap',\n 'web.h4.wordWrap',\n 'web.h5.wordWrap',\n 'web.h6.wordWrap',\n 'web.i.wordWrap',\n 'web.label.wordWrap',\n 'web.mark.wordWrap',\n 'web.span.wordWrap',\n 'web.strong.wordWrap',\n 'web.sub.wordWrap',\n 'web.sup.wordWrap',\n 'web.ol.listStyle',\n 'web.ul.listStyle',\n 'web.textarea.resize',\n ],\n rsd: 'sets overflow-wrap on inline text and headings, list-style: none on ol and ul, and resize: vertical on a textarea, all as plain stylex rules',\n tamagui: 'sets none of the three',\n reason:\n 'Tamagui resolves none of these three property names, and an unresolved style prop does not quietly do nothing — it reaches the element as an attribute, which is a react warning and still no styling. list-style has no visible consequence anyway, because every view-backed element carries `.is_View { display: flex }`, so an li is never display: list-item and no marker is generated. The other two are cosmetic and web-only. Closing this means teaching the style pipeline the three properties, not working around it here',\n },\n {\n area: 'style',\n subject: 'html.img sizing',\n keys: [\n 'web.img.aspectRatio',\n 'web.img.objectFit',\n 'web.img.margin',\n 'web.img.padding',\n 'web.img.textDecorationLine',\n ],\n rsd: 'derives the aspect ratio from the width and height attributes with attr(), which only lands in recent chromium, and gives img no inline reset',\n tamagui:\n 'sets objectFit, resets img like any other inline element, and lets the compiler turn the width and height props into an aspect ratio on native',\n reason:\n 'a css feature one engine supports cannot be the cross-platform contract, and the props are known at build time anyway; the inline reset still matters because an img inside an anchor otherwise inherits its underline',\n },\n {\n area: 'style',\n subject: 'universal native element defaults',\n keys: ['native.br.boxSizing', 'native.br.position', 'native.hr.boxSizing'],\n rsd: 'skips the shared native reset on br, and overrides boxSizing to border-box on hr',\n tamagui: 'applies the same native element defaults to every tag',\n reason:\n 'br is not special, and neither override changes what renders: hr has no border or padding for border-box to measure differently',\n },\n {\n area: 'behavior',\n subject: 'invalid nesting',\n keys: [],\n rsd: 'reports nothing at build time; an invalid tree fails at runtime on native',\n tamagui:\n 'compile diagnostic for statically knowable invalid nesting, from the content model in the tag table',\n reason:\n 'the compiler already classifies every tag, so the error belongs at build time where the source is',\n },\n {\n area: 'behavior',\n subject: 'children as a render function',\n keys: [],\n rsd: 'supports a function child that receives the resolved native props',\n tamagui: 'not part of the contract',\n reason:\n 'it exposes the native prop shape as public api and blocks compile-time literal-text wrapping',\n },\n {\n area: 'ref',\n subject: 'native element ref',\n keys: [],\n rsd: 'wraps every ref-ed host node in an Object.create view adding nodeName, viewport-scaled metrics and the tag polyfills',\n tamagui:\n 'wraps only ref-ed hosts in a stable Object.create facade adding nodeName, tagName, image complete, text-entry selection APIs, bound host methods and viewport-scaled geometry',\n reason:\n 'the compiler supplies the semantic tag only on the ref path, preserving the zero-allocation common path; the viewport provider scales synchronous DOM-shaped lengths and getBoundingClientRect while native measure methods remain bound to the host instance',\n },\n]\n"
10
+ ]
11
+ }
@@ -0,0 +1,5 @@
1
+ import type { EventRow } from "./types";
2
+ export declare const EVENTS: Readonly<Record<string, EventRow>>;
3
+ export declare const EVENT_NAMES: readonly string[];
4
+
5
+ //# sourceMappingURL=events.d.ts.map
@@ -0,0 +1,11 @@
1
+ {
2
+ "mappings": "AAAA,cAAc,gBAAyB;AAoCvC,OAAO,cAAM,QAAQ,SAAS,eAAe;AA2I7C,OAAO,cAAM",
3
+ "names": [],
4
+ "sources": [
5
+ "src/tables/events.ts"
6
+ ],
7
+ "version": 3,
8
+ "sourcesContent": [
9
+ "import type { EventRow, TagName } from './types'\n\n/**\n * The event table: every event prop in the Tamagui DOM contract.\n *\n * Capture-phase props are deliberately absent. React Strict DOM excludes them\n * from the strict surface and DOM mode follows: a capture listener needs the\n * event target api on the platforms that have one.\n *\n * `payload` names the handler argument type the prop-interface generator emits.\n * `unknown` marks a pass-through handler whose event shape differs per platform,\n * so nothing may be promised about it cross-platform.\n */\n\nconst TEXT_ENTRY: readonly TagName[] = ['input', 'textarea']\nconst FORM_CONTROLS: readonly TagName[] = ['input', 'select', 'textarea']\n\n/** react native carries these pointer, mouse and scroll events on host views */\nconst nativeHost = (nativeProp: string): EventRow => ({\n tags: '*',\n payload: 'unknown',\n nativeProp,\n web: 'host',\n native: 'host',\n})\n\n/** web-only events with no react native equivalent at all */\nconst webOnly = (note: string): EventRow => ({\n tags: '*',\n payload: 'unknown',\n nativeProp: null,\n web: 'host',\n native: 'none',\n note,\n})\n\nexport const EVENTS: Readonly<Record<string, EventRow>> = {\n // pointer and touch\n onPointerCancel: nativeHost('onPointerCancel'),\n onPointerDown: nativeHost('onPointerDown'),\n onPointerEnter: nativeHost('onPointerEnter'),\n onPointerLeave: nativeHost('onPointerLeave'),\n onPointerMove: nativeHost('onPointerMove'),\n onPointerOut: nativeHost('onPointerOut'),\n onPointerOver: nativeHost('onPointerOver'),\n onPointerUp: nativeHost('onPointerUp'),\n onGotPointerCapture: nativeHost('onGotPointerCapture'),\n onLostPointerCapture: nativeHost('onLostPointerCapture'),\n onTouchCancel: nativeHost('onTouchCancel'),\n onTouchEnd: nativeHost('onTouchEnd'),\n onTouchMove: nativeHost('onTouchMove'),\n onTouchStart: nativeHost('onTouchStart'),\n\n // press\n onClick: {\n tags: '*',\n payload: 'DOMClickEvent',\n nativeProp: 'onPress',\n web: 'host',\n native: 'polyfill',\n note: 'native builds the click payload from the press event; preventDefault and stopPropagation are no-ops because there is nothing to cancel',\n },\n onAuxClick: webOnly('native has no secondary pointer button'),\n onContextMenu: webOnly('native has no context menu event; use a long press'),\n\n // focus\n onBlur: {\n tags: '*',\n payload: 'unknown',\n nativeProp: 'onBlur',\n web: 'host',\n native: 'polyfill',\n note: 'native focus events only fire on elements that can hold focus, which is text entry and pressable elements',\n },\n onFocus: {\n tags: '*',\n payload: 'unknown',\n nativeProp: 'onFocus',\n web: 'host',\n native: 'polyfill',\n note: 'native focus events only fire on elements that can hold focus, which is text entry and pressable elements',\n },\n onFocusIn: webOnly('native has no bubbling focus event; use onFocus'),\n onFocusOut: webOnly('native has no bubbling blur event; use onBlur'),\n\n // keyboard\n onKeyDown: {\n tags: '*',\n payload: 'DOMKeyEvent',\n nativeProp: 'onKeyPress',\n web: 'host',\n native: 'polyfill',\n note: 'native only reports key presses inside a text-entry control, and reports the submit key as Enter',\n },\n onKeyUp: webOnly('react native reports key presses, not key releases'),\n\n // clipboard\n onCopy: webOnly('native has no clipboard events'),\n onCut: webOnly('native has no clipboard events'),\n onPaste: webOnly('native has no clipboard events'),\n\n // document and viewport\n onFullscreenChange: webOnly('fullscreen is a browser api'),\n onFullscreenError: webOnly('fullscreen is a browser api'),\n onScroll: nativeHost('onScroll'),\n onWheel: webOnly('native has no wheel input'),\n\n // React Native desktop carries the mouse subset that React Strict DOM forwards.\n onMouseDown: nativeHost('onMouseDown'),\n onMouseEnter: nativeHost('onMouseEnter'),\n onMouseLeave: nativeHost('onMouseLeave'),\n onMouseMove: webOnly('use onPointerMove for cross-platform pointer input'),\n onMouseOut: nativeHost('onMouseOut'),\n onMouseOver: nativeHost('onMouseOver'),\n onMouseUp: nativeHost('onMouseUp'),\n\n // image\n onError: {\n tags: ['img'],\n payload: 'DOMImageErrorEvent',\n nativeProp: 'onError',\n web: 'host',\n native: 'polyfill',\n },\n onLoad: {\n tags: ['img'],\n payload: 'DOMImageLoadEvent',\n nativeProp: 'onLoad',\n web: 'host',\n native: 'polyfill',\n note: 'native reports naturalWidth and naturalHeight from the decoded source',\n },\n\n // form controls\n onChange: {\n tags: FORM_CONTROLS,\n payload: 'DOMChangeEvent',\n nativeProp: 'onChange',\n web: 'host',\n native: 'polyfill',\n note: 'native fires on every keystroke like onInput, because there is no commit-on-blur change event',\n },\n onInput: {\n tags: FORM_CONTROLS,\n payload: 'DOMInputEvent',\n nativeProp: 'onChange',\n web: 'host',\n native: 'polyfill',\n },\n onBeforeInput: {\n tags: FORM_CONTROLS,\n payload: 'unknown',\n nativeProp: null,\n web: 'host',\n native: 'none',\n note: 'native text entry reports changes only after they are applied',\n },\n onInvalid: {\n tags: FORM_CONTROLS,\n payload: 'unknown',\n nativeProp: null,\n web: 'host',\n native: 'none',\n note: 'native has no form validation',\n },\n onSelect: {\n tags: FORM_CONTROLS,\n payload: 'unknown',\n nativeProp: null,\n web: 'host',\n native: 'none',\n note: 'read the selection through the element ref instead',\n },\n}\n\nexport const EVENT_NAMES: readonly string[] = Object.keys(EVENTS)\n"
10
+ ]
11
+ }
@@ -0,0 +1,28 @@
1
+ import type { DefaultStyle, NativeBacking, NativeBackingRow } from "./types";
2
+ /**
3
+ * The native backing table: what each tag becomes after the DOM compiler runs.
4
+ *
5
+ * On native the compiler is required. Tag classification, primitive injection
6
+ * and literal-text wrapping are build-time structural rewrites, so there is no
7
+ * runtime child scan and no untransformed fallback: a missing compiler is a
8
+ * native build failure.
9
+ *
10
+ * The block and flex constants below are the browser layout defaults React
11
+ * Native does not have. The COMPILER applies them while flattening styles —
12
+ * they depend on the parent's resolved display, which the compiler resolves
13
+ * statically (same-module parent) or by the defined block-flow boundary rule
14
+ * (component root). Static primitives stay hook-free; compiler-marked refs,
15
+ * inherited text and dynamic style() clauses enter narrow runtime paths. See
16
+ * `contract.ts` and plans/v3-dom-native-lowering-design.md.
17
+ */
18
+ /** the module the compiler injects primitive imports from */
19
+ export declare const NATIVE_PRIMITIVE_MODULE = "@tamagui/core/dom";
20
+ export declare const NATIVE_BACKING: Readonly<Record<NativeBacking, NativeBackingRow>>;
21
+ /** browser defaults every element has and react native does not */
22
+ export declare const NATIVE_ELEMENT_DEFAULTS: DefaultStyle;
23
+ /** what `display: block` means once emulated on native */
24
+ export declare const NATIVE_BLOCK_DEFAULTS: DefaultStyle;
25
+ /** what an authored `display: flex` means on native, matching css defaults */
26
+ export declare const NATIVE_FLEX_DEFAULTS: DefaultStyle;
27
+
28
+ //# sourceMappingURL=nativeBacking.d.ts.map
@@ -0,0 +1,11 @@
1
+ {
2
+ "mappings": "AAAA,cAAc,cAAc,eAAe,wBAAiC;;;;;;;;;;;;;;;;;;AAoB5E,OAAO,cAAM,0BAA0B;AAsDvC,OAAO,cAAM,gBAAgB,SAAS,OAAO,eAAe;;AAgC5D,OAAO,cAAM,yBAAyB;;AAMtC,OAAO,cAAM,uBAAuB;;AAWpC,OAAO,cAAM,sBAAsB",
3
+ "names": [],
4
+ "sources": [
5
+ "src/tables/nativeBacking.ts"
6
+ ],
7
+ "version": 3,
8
+ "sourcesContent": [
9
+ "import type { DefaultStyle, NativeBacking, NativeBackingRow, TagName } from './types'\n\n/**\n * The native backing table: what each tag becomes after the DOM compiler runs.\n *\n * On native the compiler is required. Tag classification, primitive injection\n * and literal-text wrapping are build-time structural rewrites, so there is no\n * runtime child scan and no untransformed fallback: a missing compiler is a\n * native build failure.\n *\n * The block and flex constants below are the browser layout defaults React\n * Native does not have. The COMPILER applies them while flattening styles —\n * they depend on the parent's resolved display, which the compiler resolves\n * statically (same-module parent) or by the defined block-flow boundary rule\n * (component root). Static primitives stay hook-free; compiler-marked refs,\n * inherited text and dynamic style() clauses enter narrow runtime paths. See\n * `contract.ts` and plans/v3-dom-native-lowering-design.md.\n */\n\n/** the module the compiler injects primitive imports from */\nexport const NATIVE_PRIMITIVE_MODULE = '@tamagui/core/dom'\n\nconst VIEW_TAGS: readonly TagName[] = [\n 'article',\n 'aside',\n 'blockquote',\n 'button',\n 'div',\n 'fieldset',\n 'footer',\n 'form',\n 'header',\n 'hr',\n 'li',\n 'main',\n 'nav',\n 'ol',\n 'optgroup',\n 'section',\n 'select',\n 'ul',\n]\n\nconst TEXT_TAGS: readonly TagName[] = [\n 'a',\n 'b',\n 'bdi',\n 'bdo',\n 'br',\n 'code',\n 'del',\n 'em',\n 'h1',\n 'h2',\n 'h3',\n 'h4',\n 'h5',\n 'h6',\n 'i',\n 'ins',\n 'kbd',\n 'label',\n 'mark',\n 'option',\n 'p',\n 'pre',\n 's',\n 'span',\n 'strong',\n 'sub',\n 'sup',\n 'u',\n]\n\nexport const NATIVE_BACKING: Readonly<Record<NativeBacking, NativeBackingRow>> = {\n view: {\n primitive: 'DOMView',\n host: 'View',\n tags: VIEW_TAGS,\n wrapsLiteralText: true,\n note: 'a direct literal string or number child is wrapped in DOMText at compile time, because a native view cannot render raw text',\n },\n text: {\n primitive: 'DOMText',\n host: 'Text',\n tags: TEXT_TAGS,\n wrapsLiteralText: false,\n note: 'inherits text styles from the nearest DOMText ancestor, and renders raw text directly',\n },\n image: {\n primitive: 'DOMImage',\n host: 'Image',\n tags: ['img'],\n wrapsLiteralText: false,\n note: 'width and height props become an aspect ratio so layout matches the browser before the image loads',\n },\n textinput: {\n primitive: 'DOMTextInput',\n host: 'TextInput',\n tags: ['input', 'textarea'],\n wrapsLiteralText: false,\n note: 'textarea sets multiline, and rows becomes numberOfLines',\n },\n}\n\n/** browser defaults every element has and react native does not */\nexport const NATIVE_ELEMENT_DEFAULTS: DefaultStyle = {\n boxSizing: 'content-box',\n position: 'static',\n}\n\n/** what `display: block` means once emulated on native */\nexport const NATIVE_BLOCK_DEFAULTS: DefaultStyle = {\n alignItems: 'stretch',\n display: 'flex',\n flexBasis: 'auto',\n flexDirection: 'column',\n flexShrink: 0,\n flexWrap: 'nowrap',\n justifyContent: 'flex-start',\n}\n\n/** what an authored `display: flex` means on native, matching css defaults */\nexport const NATIVE_FLEX_DEFAULTS: DefaultStyle = {\n alignContent: 'stretch',\n alignItems: 'stretch',\n flexBasis: 'auto',\n flexDirection: 'row',\n flexShrink: 1,\n flexWrap: 'nowrap',\n justifyContent: 'flex-start',\n}\n"
10
+ ]
11
+ }
@@ -0,0 +1,36 @@
1
+ import type { DefaultStyle, TagName, TagRow } from "./types";
2
+ /**
3
+ * The tag table: the 49 elements of the Tamagui DOM contract.
4
+ *
5
+ * `display` and `backing` are independent columns. `p` is a block element
6
+ * backed by a native Text, `button` is inline-block backed by a native View.
7
+ * The compiler reads `backing` to inject primitives and `content` to report
8
+ * invalid nesting; the runtime reads the defaults to build each element.
9
+ *
10
+ * Element defaults follow React Strict DOM's resets: an explicit, equal
11
+ * starting point on both platforms instead of the browser default stylesheet on
12
+ * web and nothing on native. Differences from RSD are in `compatibility.ts`.
13
+ */
14
+ /**
15
+ * Undoes the browser default stylesheet, keyed by `display`, before any tag
16
+ * default. Web only: react native has no default stylesheet to undo, so every
17
+ * key here would be a no-op that still costs a style lookup per element.
18
+ */
19
+ export declare const DISPLAY_WEB_RESET: Readonly<Record<TagRow["display"], DefaultStyle>>;
20
+ export declare const TAGS: Readonly<Record<TagName, TagRow>>;
21
+ /**
22
+ * Web-only defaults: undoing a browser default, or a property with no
23
+ * cross-platform spelling. `fontSize: 1em` cancels the browser's smaller
24
+ * default size for monospace text, which is the whole reason the browser
25
+ * renders `code`, `kbd` and `pre` at a different size from their surroundings.
26
+ *
27
+ * Everything here has to be a style property Tamagui actually resolves. A key
28
+ * Tamagui does not know is not a silent no-op — it falls through to the element
29
+ * as an attribute, which is a react warning and no styling. `list-style`,
30
+ * `resize` and `overflow-wrap` are all in that category today, which is why
31
+ * they are absent and recorded in `compatibility.ts` instead.
32
+ */
33
+ export declare const TAG_WEB_DEFAULTS: Readonly<Partial<Record<TagName, DefaultStyle>>>;
34
+ export declare const TAG_NAMES: readonly TagName[];
35
+
36
+ //# sourceMappingURL=tags.d.ts.map
@@ -0,0 +1,11 @@
1
+ {
2
+ "mappings": "AAAA,cAAc,cAAc,SAAS,cAAc;;;;;;;;;;;;;;;;;;AAoBnD,OAAO,cAAM,mBAAmB,SAAS,OAAO,OAAO,YAAY;AAenE,OAAO,cAAM,MAAM,SAAS,OAAO,SAAS;;;;;;;;;;;;;AAigB5C,OAAO,cAAM,kBAAkB,SAAS,QAAQ,OAAO,SAAS;AAQhE,OAAO,cAAM,oBAAoB",
3
+ "names": [],
4
+ "sources": [
5
+ "src/tables/tags.ts"
6
+ ],
7
+ "version": 3,
8
+ "sourcesContent": [
9
+ "import type { DefaultStyle, TagName, TagRow } from './types'\n\n/**\n * The tag table: the 49 elements of the Tamagui DOM contract.\n *\n * `display` and `backing` are independent columns. `p` is a block element\n * backed by a native Text, `button` is inline-block backed by a native View.\n * The compiler reads `backing` to inject primitives and `content` to report\n * invalid nesting; the runtime reads the defaults to build each element.\n *\n * Element defaults follow React Strict DOM's resets: an explicit, equal\n * starting point on both platforms instead of the browser default stylesheet on\n * web and nothing on native. Differences from RSD are in `compatibility.ts`.\n */\n\n/**\n * Undoes the browser default stylesheet, keyed by `display`, before any tag\n * default. Web only: react native has no default stylesheet to undo, so every\n * key here would be a no-op that still costs a style lookup per element.\n */\nexport const DISPLAY_WEB_RESET: Readonly<Record<TagRow['display'], DefaultStyle>> = {\n block: { margin: 0, padding: 0 },\n inline: { margin: 0, padding: 0, textDecorationLine: 'none' },\n 'inline-block': { margin: 0, padding: 0, borderStyle: 'solid' },\n}\n\nconst MONOSPACE: DefaultStyle = { fontFamily: 'monospace' }\nconst HEADING: DefaultStyle = { fontSize: '1.5rem', fontWeight: 'bold' }\n\nconst NO_FORM_SUBMISSION =\n 'renders as a container on native; there is no form submission, validation or reset'\n\nconst NO_NATIVE_PICKER =\n 'native has no menu-based select control, so this tag is a native build error'\n\nexport const TAGS: Readonly<Record<TagName, TagRow>> = {\n a: {\n display: 'inline',\n content: 'phrasing',\n backing: 'text',\n role: 'link',\n element: 'HTMLAnchorElement',\n props: 'anchor',\n web: 'host',\n native: 'polyfill',\n note: 'native has no navigation for href, target, rel, download or referrerPolicy',\n },\n article: {\n display: 'block',\n content: 'flow',\n backing: 'view',\n element: 'HTMLElement',\n props: 'common',\n web: 'host',\n native: 'polyfill',\n },\n aside: {\n display: 'block',\n content: 'flow',\n backing: 'view',\n element: 'HTMLElement',\n props: 'common',\n web: 'host',\n native: 'polyfill',\n },\n b: {\n display: 'inline',\n content: 'phrasing',\n backing: 'text',\n element: 'HTMLElement',\n props: 'common',\n defaults: { fontWeight: 'bold' },\n web: 'host',\n native: 'polyfill',\n },\n bdi: {\n display: 'inline',\n content: 'phrasing',\n backing: 'text',\n element: 'HTMLElement',\n props: 'common',\n web: 'host',\n native: 'polyfill',\n note: 'native has no bidirectional isolation; the text renders in the inherited direction',\n },\n bdo: {\n display: 'inline',\n content: 'phrasing',\n backing: 'text',\n element: 'HTMLElement',\n props: 'common',\n web: 'host',\n native: 'polyfill',\n note: 'native honours dir as a writing direction but does not override embedded bidi runs',\n },\n blockquote: {\n display: 'block',\n content: 'flow',\n backing: 'view',\n element: 'HTMLQuoteElement',\n props: 'common',\n web: 'host',\n native: 'polyfill',\n },\n br: {\n display: 'inline',\n content: 'void',\n backing: 'text',\n element: 'HTMLBRElement',\n props: 'common',\n web: 'host',\n native: 'polyfill',\n },\n button: {\n display: 'inline-block',\n content: 'flow',\n backing: 'view',\n role: 'button',\n element: 'HTMLButtonElement',\n props: 'button',\n defaults: { borderWidth: 1 },\n web: 'host',\n native: 'polyfill',\n note: 'html restricts button content to phrasing; the native backing is a view, so block children are allowed',\n },\n code: {\n display: 'inline',\n content: 'phrasing',\n backing: 'text',\n element: 'HTMLElement',\n props: 'common',\n defaults: MONOSPACE,\n web: 'host',\n native: 'polyfill',\n },\n del: {\n display: 'inline',\n content: 'phrasing',\n backing: 'text',\n element: 'HTMLModElement',\n props: 'common',\n defaults: { textDecorationLine: 'line-through' },\n web: 'host',\n native: 'polyfill',\n },\n div: {\n display: 'block',\n content: 'flow',\n backing: 'view',\n element: 'HTMLDivElement',\n props: 'common',\n web: 'host',\n native: 'polyfill',\n },\n em: {\n display: 'inline',\n content: 'phrasing',\n backing: 'text',\n element: 'HTMLElement',\n props: 'common',\n defaults: { fontStyle: 'italic' },\n web: 'host',\n native: 'polyfill',\n },\n fieldset: {\n display: 'block',\n content: 'flow',\n backing: 'view',\n element: 'HTMLFieldSetElement',\n props: 'common',\n web: 'host',\n native: 'polyfill',\n note: NO_FORM_SUBMISSION,\n },\n footer: {\n display: 'block',\n content: 'flow',\n backing: 'view',\n element: 'HTMLElement',\n props: 'common',\n web: 'host',\n native: 'polyfill',\n },\n form: {\n display: 'block',\n content: 'flow',\n backing: 'view',\n element: 'HTMLFormElement',\n props: 'common',\n web: 'host',\n native: 'polyfill',\n note: NO_FORM_SUBMISSION,\n },\n h1: {\n display: 'block',\n content: 'phrasing',\n backing: 'text',\n role: 'heading',\n element: 'HTMLHeadingElement',\n props: 'common',\n defaults: HEADING,\n web: 'host',\n native: 'polyfill',\n },\n h2: {\n display: 'block',\n content: 'phrasing',\n backing: 'text',\n role: 'heading',\n element: 'HTMLHeadingElement',\n props: 'common',\n defaults: HEADING,\n web: 'host',\n native: 'polyfill',\n },\n h3: {\n display: 'block',\n content: 'phrasing',\n backing: 'text',\n role: 'heading',\n element: 'HTMLHeadingElement',\n props: 'common',\n defaults: HEADING,\n web: 'host',\n native: 'polyfill',\n },\n h4: {\n display: 'block',\n content: 'phrasing',\n backing: 'text',\n role: 'heading',\n element: 'HTMLHeadingElement',\n props: 'common',\n defaults: HEADING,\n web: 'host',\n native: 'polyfill',\n },\n h5: {\n display: 'block',\n content: 'phrasing',\n backing: 'text',\n role: 'heading',\n element: 'HTMLHeadingElement',\n props: 'common',\n defaults: HEADING,\n web: 'host',\n native: 'polyfill',\n },\n h6: {\n display: 'block',\n content: 'phrasing',\n backing: 'text',\n role: 'heading',\n element: 'HTMLHeadingElement',\n props: 'common',\n defaults: HEADING,\n web: 'host',\n native: 'polyfill',\n },\n header: {\n display: 'block',\n content: 'flow',\n backing: 'view',\n role: 'header',\n element: 'HTMLElement',\n props: 'common',\n web: 'host',\n native: 'polyfill',\n },\n hr: {\n display: 'block',\n content: 'void',\n backing: 'view',\n element: 'HTMLHRElement',\n props: 'common',\n defaults: { backgroundColor: 'black', height: 1 },\n web: 'host',\n native: 'polyfill',\n },\n i: {\n display: 'inline',\n content: 'phrasing',\n backing: 'text',\n element: 'HTMLElement',\n props: 'common',\n defaults: { fontStyle: 'italic' },\n web: 'host',\n native: 'polyfill',\n },\n img: {\n display: 'inline',\n content: 'void',\n backing: 'image',\n element: 'HTMLImageElement',\n props: 'image',\n defaults: { objectFit: 'fill' },\n web: 'host',\n native: 'polyfill',\n note: 'width and height props set an aspect ratio on native, where images have no intrinsic layout size until they load',\n },\n input: {\n display: 'inline-block',\n content: 'void',\n backing: 'textinput',\n element: 'HTMLInputElement',\n props: 'input',\n defaults: { borderWidth: 1 },\n web: 'host',\n native: 'polyfill',\n note: 'native supports the text-like input types only; checkbox, color, date, datetime-local, file, month, radio, range, time and week are a native build error',\n },\n ins: {\n display: 'inline',\n content: 'phrasing',\n backing: 'text',\n element: 'HTMLModElement',\n props: 'common',\n defaults: { textDecorationLine: 'underline' },\n web: 'host',\n native: 'polyfill',\n },\n kbd: {\n display: 'inline',\n content: 'phrasing',\n backing: 'text',\n element: 'HTMLElement',\n props: 'common',\n defaults: MONOSPACE,\n web: 'host',\n native: 'polyfill',\n },\n label: {\n display: 'inline',\n content: 'phrasing',\n backing: 'text',\n element: 'HTMLLabelElement',\n props: 'label',\n web: 'host',\n native: 'polyfill',\n note: 'native has no label association, so `for` does not focus or activate its control',\n },\n li: {\n display: 'block',\n content: 'flow',\n backing: 'view',\n role: 'listitem',\n element: 'HTMLLIElement',\n props: 'listitem',\n web: 'host',\n native: 'polyfill',\n note: 'list markers and the `value` counter are not rendered on either platform, matching the list-style reset',\n },\n main: {\n display: 'block',\n content: 'flow',\n backing: 'view',\n element: 'HTMLElement',\n props: 'common',\n web: 'host',\n native: 'polyfill',\n },\n mark: {\n display: 'inline',\n content: 'phrasing',\n backing: 'text',\n element: 'HTMLElement',\n props: 'common',\n defaults: { backgroundColor: 'yellow', color: 'black' },\n web: 'host',\n native: 'polyfill',\n },\n nav: {\n display: 'block',\n content: 'flow',\n backing: 'view',\n element: 'HTMLElement',\n props: 'common',\n web: 'host',\n native: 'polyfill',\n },\n ol: {\n display: 'block',\n content: 'tags',\n childTags: ['li'],\n backing: 'view',\n role: 'list',\n element: 'HTMLOListElement',\n props: 'common',\n web: 'host',\n native: 'polyfill',\n },\n optgroup: {\n display: 'block',\n content: 'tags',\n childTags: ['option'],\n backing: 'view',\n element: 'HTMLOptGroupElement',\n props: 'optgroup',\n web: 'host',\n native: 'none',\n note: NO_NATIVE_PICKER,\n },\n option: {\n display: 'block',\n content: 'text',\n backing: 'text',\n element: 'HTMLOptionElement',\n props: 'option',\n web: 'host',\n native: 'none',\n note: NO_NATIVE_PICKER,\n },\n p: {\n display: 'block',\n content: 'phrasing',\n backing: 'text',\n element: 'HTMLParagraphElement',\n props: 'common',\n web: 'host',\n native: 'polyfill',\n },\n pre: {\n display: 'block',\n content: 'phrasing',\n backing: 'text',\n element: 'HTMLPreElement',\n props: 'common',\n defaults: MONOSPACE,\n web: 'host',\n native: 'polyfill',\n note: 'native preserves whitespace in text but has no scroll container, so long lines wrap instead of scrolling',\n },\n s: {\n display: 'inline',\n content: 'phrasing',\n backing: 'text',\n element: 'HTMLElement',\n props: 'common',\n defaults: { textDecorationLine: 'line-through' },\n web: 'host',\n native: 'polyfill',\n },\n section: {\n display: 'block',\n content: 'flow',\n backing: 'view',\n element: 'HTMLElement',\n props: 'common',\n web: 'host',\n native: 'polyfill',\n },\n select: {\n display: 'inline-block',\n content: 'tags',\n childTags: ['optgroup', 'option'],\n backing: 'view',\n element: 'HTMLSelectElement',\n props: 'select',\n web: 'host',\n native: 'none',\n note: NO_NATIVE_PICKER,\n },\n span: {\n display: 'inline',\n content: 'phrasing',\n backing: 'text',\n element: 'HTMLSpanElement',\n props: 'common',\n web: 'host',\n native: 'polyfill',\n },\n strong: {\n display: 'inline',\n content: 'phrasing',\n backing: 'text',\n element: 'HTMLElement',\n props: 'common',\n defaults: { fontWeight: 'bold' },\n web: 'host',\n native: 'polyfill',\n },\n sub: {\n display: 'inline',\n content: 'phrasing',\n backing: 'text',\n element: 'HTMLElement',\n props: 'common',\n web: 'host',\n native: 'polyfill',\n note: 'native has no vertical-align, so subscript text sits on the baseline',\n },\n sup: {\n display: 'inline',\n content: 'phrasing',\n backing: 'text',\n element: 'HTMLElement',\n props: 'common',\n web: 'host',\n native: 'polyfill',\n note: 'native has no vertical-align, so superscript text sits on the baseline',\n },\n textarea: {\n display: 'inline-block',\n content: 'void',\n backing: 'textinput',\n element: 'HTMLTextAreaElement',\n props: 'textarea',\n defaults: { borderWidth: 1 },\n nativeDefaults: { verticalAlign: 'top' },\n web: 'host',\n native: 'polyfill',\n note: 'the value comes from value or defaultValue; children are a build error on both platforms',\n },\n u: {\n display: 'inline',\n content: 'phrasing',\n backing: 'text',\n element: 'HTMLElement',\n props: 'common',\n defaults: { textDecorationLine: 'underline' },\n web: 'host',\n native: 'polyfill',\n },\n ul: {\n display: 'block',\n content: 'tags',\n childTags: ['li'],\n backing: 'view',\n role: 'list',\n element: 'HTMLUListElement',\n props: 'common',\n web: 'host',\n native: 'polyfill',\n },\n}\n\n/**\n * Web-only defaults: undoing a browser default, or a property with no\n * cross-platform spelling. `fontSize: 1em` cancels the browser's smaller\n * default size for monospace text, which is the whole reason the browser\n * renders `code`, `kbd` and `pre` at a different size from their surroundings.\n *\n * Everything here has to be a style property Tamagui actually resolves. A key\n * Tamagui does not know is not a silent no-op — it falls through to the element\n * as an attribute, which is a react warning and no styling. `list-style`,\n * `resize` and `overflow-wrap` are all in that category today, which is why\n * they are absent and recorded in `compatibility.ts` instead.\n */\nexport const TAG_WEB_DEFAULTS: Readonly<Partial<Record<TagName, DefaultStyle>>> = {\n code: { fontSize: '1em' },\n hr: { borderStyle: 'none', borderWidth: 0, boxSizing: 'border-box' },\n img: { height: 'auto', maxWidth: '100%' },\n kbd: { fontSize: '1em' },\n pre: { fontSize: '1em', overflow: 'auto' },\n}\n\nexport const TAG_NAMES: readonly TagName[] = Object.keys(TAGS) as TagName[]\n"
10
+ ]
11
+ }
@@ -0,0 +1,135 @@
1
+ /**
2
+ * Row types for the Tamagui DOM contract tables.
3
+ *
4
+ * The tables are the source of truth for the whole DOM lane: the compiler reads
5
+ * them to classify tags, validate props and nesting, and inject native
6
+ * primitives; the runtime reads them for element defaults and native mapping;
7
+ * the type generator reads them to emit the strict prop interfaces.
8
+ *
9
+ * React Strict DOM is the semantic reference and conformance oracle for these
10
+ * tables (see `rsd-snapshot.json` and `compatibility.ts`), never a dependency.
11
+ */
12
+ /** every tag in the DOM contract, matching the 49 elements RSD exposes */
13
+ export type TagName = "a" | "article" | "aside" | "b" | "bdi" | "bdo" | "blockquote" | "br" | "button" | "code" | "del" | "div" | "em" | "fieldset" | "footer" | "form" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "header" | "hr" | "i" | "img" | "input" | "ins" | "kbd" | "label" | "li" | "main" | "mark" | "nav" | "ol" | "optgroup" | "option" | "p" | "pre" | "s" | "section" | "select" | "span" | "strong" | "sub" | "sup" | "textarea" | "u" | "ul";
14
+ /** native primitive a tag lowers to, injected by the compiler */
15
+ export type NativeBacking = "view" | "text" | "image" | "textinput";
16
+ /**
17
+ * How much of a feature survives on a platform.
18
+ *
19
+ * - `host`: the platform primitive implements it, we forward the value
20
+ * - `polyfill`: we implement it in the DOM layer on top of the primitive
21
+ * - `none`: unsupported, and using it is a compile diagnostic
22
+ */
23
+ export type Support = "host" | "polyfill" | "none";
24
+ /**
25
+ * What a tag may contain, driving the compile-time nesting diagnostic.
26
+ *
27
+ * - `flow`: block or phrasing children
28
+ * - `phrasing`: phrasing children only, so a block child is an error
29
+ * - `text`: text children only
30
+ * - `void`: no children at all
31
+ * - `tags`: only the tags in `childTags`
32
+ */
33
+ export type ContentModel = "flow" | "phrasing" | "text" | "void" | "tags";
34
+ /** the generated props interface a tag uses */
35
+ export type PropsGroup = "common" | "anchor" | "button" | "image" | "input" | "label" | "listitem" | "optgroup" | "option" | "select" | "textarea";
36
+ /** a style record expressed in Tamagui style-prop terms, valid on both platforms */
37
+ export type DefaultStyle = Readonly<Record<string, string | number>>;
38
+ export type TagRow = {
39
+ /** css display from the browser default stylesheet; native emulates it */
40
+ display: "block" | "inline" | "inline-block";
41
+ content: ContentModel;
42
+ /** the only permitted children, when `content` is `tags` */
43
+ childTags?: readonly TagName[];
44
+ backing: NativeBacking;
45
+ /** implicit aria role the browser gives the tag, applied explicitly on native */
46
+ role?: string;
47
+ /** dom interface a ref resolves to */
48
+ element: string;
49
+ props: PropsGroup;
50
+ /** element defaults applied on both platforms, before author styles */
51
+ defaults?: DefaultStyle;
52
+ /** extra defaults native needs to reach the same result as the browser */
53
+ nativeDefaults?: DefaultStyle;
54
+ web: Support;
55
+ native: Support;
56
+ /** why support is limited, surfaced verbatim by the compiler diagnostic */
57
+ note?: string;
58
+ };
59
+ /** which tags accept a prop: `*` for all of them */
60
+ export type PropTags = "*" | readonly TagName[];
61
+ export type AttributeRow = {
62
+ /**
63
+ * - `aria`: an `aria-*` accessibility prop
64
+ * - `global`: an html prop every tag accepts
65
+ * - `element`: an html prop specific to some tags
66
+ * - `data`: `data-*` passthrough
67
+ * - `frontend`: supplied by the styling frontend, not generated as an attribute
68
+ * - `react`: a React prop with no html attribute behind it
69
+ */
70
+ group: "aria" | "global" | "element" | "data" | "frontend" | "react";
71
+ tags: PropTags;
72
+ /** typescript source for the generated prop type, for every tag `perTag` omits */
73
+ type?: string;
74
+ /**
75
+ * Per-tag overrides, for props that genuinely differ by element: `type` on a
76
+ * button is not `type` on an input, and the `value` counter note is about
77
+ * `li` alone. Every tag the row accepts has to end up with a type, from here
78
+ * or from `type`; an override with no `type` just narrows the note.
79
+ */
80
+ perTag?: Readonly<Partial<Record<TagName, {
81
+ type?: string;
82
+ note?: string;
83
+ }>>>;
84
+ /** react native prop this lowers to, null when nothing carries it */
85
+ nativeProp: string | null;
86
+ web: Support;
87
+ native: Support;
88
+ note?: string;
89
+ };
90
+ export type EventRow = {
91
+ tags: PropTags;
92
+ /**
93
+ * typescript source for the handler argument. Opaque handlers receive the raw
94
+ * platform event, which differs per platform, so they take `unknown`.
95
+ */
96
+ payload: string;
97
+ /** react native prop this lowers to, null when nothing carries it */
98
+ nativeProp: string | null;
99
+ web: Support;
100
+ native: Support;
101
+ note?: string;
102
+ };
103
+ export type NativeBackingRow = {
104
+ /** primitive exported from `@tamagui/dom/native`, injected by the compiler */
105
+ primitive: string;
106
+ /** react native host component the primitive renders */
107
+ host: string;
108
+ /** tags this backing serves */
109
+ tags: readonly TagName[];
110
+ /** direct literal string children are wrapped at compile time for these */
111
+ wrapsLiteralText: boolean;
112
+ note: string;
113
+ };
114
+ /** an intentional difference from the pinned React Strict DOM reference */
115
+ export type CompatibilityRow = {
116
+ area: "tag" | "prop" | "event" | "style" | "ref" | "behavior";
117
+ /** what differs, spelled as it appears in source */
118
+ subject: string;
119
+ /**
120
+ * The identifiers the conformance test matches this row against: prop names
121
+ * for `prop` and `event`, tag names for `tag`, `tag.styleKey` for `style`
122
+ * (`web.` or `native.` prefixed). The test fails on any difference from the
123
+ * RSD snapshot that no row claims, and on any key no longer different, so a
124
+ * row cannot silently go stale. Empty for a difference with no identifier the
125
+ * snapshot can see, which the snapshot therefore cannot check.
126
+ */
127
+ keys: readonly string[];
128
+ /** what the pinned RSD release does */
129
+ rsd: string;
130
+ /** what Tamagui DOM does */
131
+ tamagui: string;
132
+ reason: string;
133
+ };
134
+
135
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1,11 @@
1
+ {
2
+ "mappings": ";;;;;;;;;;;;AAaA,YAAY,UACR,MACA,YACA,UACA,MACA,QACA,QACA,eACA,OACA,WACA,SACA,QACA,QACA,OACA,aACA,WACA,SACA,OACA,OACA,OACA,OACA,OACA,OACA,WACA,OACA,MACA,QACA,UACA,QACA,QACA,UACA,OACA,SACA,SACA,QACA,OACA,aACA,WACA,MACA,QACA,MACA,YACA,WACA,SACA,WACA,QACA,QACA,aACA,MACA;;AAGJ,YAAY,gBAAgB,SAAS,SAAS,UAAU;;;;;;;;AASxD,YAAY,UAAU,SAAS,aAAa;;;;;;;;;;AAW5C,YAAY,eAAe,SAAS,aAAa,SAAS,SAAS;;AAGnE,YAAY,aACR,WACA,WACA,WACA,UACA,UACA,UACA,aACA,aACA,WACA,WACA;;AAGJ,YAAY,eAAe,SAAS;AAEpC,YAAY,SAAS;;CAEnB,SAAS,UAAU,WAAW;CAC9B,SAAS;;CAET,qBAAqB;CACrB,SAAS;;CAET;;CAEA;CACA,OAAO;;CAEP,WAAW;;CAEX,iBAAiB;CACjB,KAAK;CACL,QAAQ;;CAER;;;AAIF,YAAY,WAAW,eAAe;AAEtC,YAAY,eAAe;;;;;;;;;CASzB,OAAO,SAAS,WAAW,YAAY,SAAS,aAAa;CAC7D,MAAM;;CAEN;;;;;;;CAOA,SAAS,SAAS,QAAQ,OAAO,SAAS;EAAE;EAAe;;;CAE3D;CACA,KAAK;CACL,QAAQ;CACR;;AAGF,YAAY,WAAW;CACrB,MAAM;;;;;CAKN;;CAEA;CACA,KAAK;CACL,QAAQ;CACR;;AAGF,YAAY,mBAAmB;;CAE7B;;CAEA;;CAEA,eAAe;;CAEf;CACA;;;AAIF,YAAY,mBAAmB;CAC7B,MAAM,QAAQ,SAAS,UAAU,UAAU,QAAQ;;CAEnD;;;;;;;;;CASA;;CAEA;;CAEA;CACA",
3
+ "names": [],
4
+ "sources": [
5
+ "src/tables/types.ts"
6
+ ],
7
+ "version": 3,
8
+ "sourcesContent": [
9
+ "/**\n * Row types for the Tamagui DOM contract tables.\n *\n * The tables are the source of truth for the whole DOM lane: the compiler reads\n * them to classify tags, validate props and nesting, and inject native\n * primitives; the runtime reads them for element defaults and native mapping;\n * the type generator reads them to emit the strict prop interfaces.\n *\n * React Strict DOM is the semantic reference and conformance oracle for these\n * tables (see `rsd-snapshot.json` and `compatibility.ts`), never a dependency.\n */\n\n/** every tag in the DOM contract, matching the 49 elements RSD exposes */\nexport type TagName =\n | 'a'\n | 'article'\n | 'aside'\n | 'b'\n | 'bdi'\n | 'bdo'\n | 'blockquote'\n | 'br'\n | 'button'\n | 'code'\n | 'del'\n | 'div'\n | 'em'\n | 'fieldset'\n | 'footer'\n | 'form'\n | 'h1'\n | 'h2'\n | 'h3'\n | 'h4'\n | 'h5'\n | 'h6'\n | 'header'\n | 'hr'\n | 'i'\n | 'img'\n | 'input'\n | 'ins'\n | 'kbd'\n | 'label'\n | 'li'\n | 'main'\n | 'mark'\n | 'nav'\n | 'ol'\n | 'optgroup'\n | 'option'\n | 'p'\n | 'pre'\n | 's'\n | 'section'\n | 'select'\n | 'span'\n | 'strong'\n | 'sub'\n | 'sup'\n | 'textarea'\n | 'u'\n | 'ul'\n\n/** native primitive a tag lowers to, injected by the compiler */\nexport type NativeBacking = 'view' | 'text' | 'image' | 'textinput'\n\n/**\n * How much of a feature survives on a platform.\n *\n * - `host`: the platform primitive implements it, we forward the value\n * - `polyfill`: we implement it in the DOM layer on top of the primitive\n * - `none`: unsupported, and using it is a compile diagnostic\n */\nexport type Support = 'host' | 'polyfill' | 'none'\n\n/**\n * What a tag may contain, driving the compile-time nesting diagnostic.\n *\n * - `flow`: block or phrasing children\n * - `phrasing`: phrasing children only, so a block child is an error\n * - `text`: text children only\n * - `void`: no children at all\n * - `tags`: only the tags in `childTags`\n */\nexport type ContentModel = 'flow' | 'phrasing' | 'text' | 'void' | 'tags'\n\n/** the generated props interface a tag uses */\nexport type PropsGroup =\n | 'common'\n | 'anchor'\n | 'button'\n | 'image'\n | 'input'\n | 'label'\n | 'listitem'\n | 'optgroup'\n | 'option'\n | 'select'\n | 'textarea'\n\n/** a style record expressed in Tamagui style-prop terms, valid on both platforms */\nexport type DefaultStyle = Readonly<Record<string, string | number>>\n\nexport type TagRow = {\n /** css display from the browser default stylesheet; native emulates it */\n display: 'block' | 'inline' | 'inline-block'\n content: ContentModel\n /** the only permitted children, when `content` is `tags` */\n childTags?: readonly TagName[]\n backing: NativeBacking\n /** implicit aria role the browser gives the tag, applied explicitly on native */\n role?: string\n /** dom interface a ref resolves to */\n element: string\n props: PropsGroup\n /** element defaults applied on both platforms, before author styles */\n defaults?: DefaultStyle\n /** extra defaults native needs to reach the same result as the browser */\n nativeDefaults?: DefaultStyle\n web: Support\n native: Support\n /** why support is limited, surfaced verbatim by the compiler diagnostic */\n note?: string\n}\n\n/** which tags accept a prop: `*` for all of them */\nexport type PropTags = '*' | readonly TagName[]\n\nexport type AttributeRow = {\n /**\n * - `aria`: an `aria-*` accessibility prop\n * - `global`: an html prop every tag accepts\n * - `element`: an html prop specific to some tags\n * - `data`: `data-*` passthrough\n * - `frontend`: supplied by the styling frontend, not generated as an attribute\n * - `react`: a React prop with no html attribute behind it\n */\n group: 'aria' | 'global' | 'element' | 'data' | 'frontend' | 'react'\n tags: PropTags\n /** typescript source for the generated prop type, for every tag `perTag` omits */\n type?: string\n /**\n * Per-tag overrides, for props that genuinely differ by element: `type` on a\n * button is not `type` on an input, and the `value` counter note is about\n * `li` alone. Every tag the row accepts has to end up with a type, from here\n * or from `type`; an override with no `type` just narrows the note.\n */\n perTag?: Readonly<Partial<Record<TagName, { type?: string; note?: string }>>>\n /** react native prop this lowers to, null when nothing carries it */\n nativeProp: string | null\n web: Support\n native: Support\n note?: string\n}\n\nexport type EventRow = {\n tags: PropTags\n /**\n * typescript source for the handler argument. Opaque handlers receive the raw\n * platform event, which differs per platform, so they take `unknown`.\n */\n payload: string\n /** react native prop this lowers to, null when nothing carries it */\n nativeProp: string | null\n web: Support\n native: Support\n note?: string\n}\n\nexport type NativeBackingRow = {\n /** primitive exported from `@tamagui/dom/native`, injected by the compiler */\n primitive: string\n /** react native host component the primitive renders */\n host: string\n /** tags this backing serves */\n tags: readonly TagName[]\n /** direct literal string children are wrapped at compile time for these */\n wrapsLiteralText: boolean\n note: string\n}\n\n/** an intentional difference from the pinned React Strict DOM reference */\nexport type CompatibilityRow = {\n area: 'tag' | 'prop' | 'event' | 'style' | 'ref' | 'behavior'\n /** what differs, spelled as it appears in source */\n subject: string\n /**\n * The identifiers the conformance test matches this row against: prop names\n * for `prop` and `event`, tag names for `tag`, `tag.styleKey` for `style`\n * (`web.` or `native.` prefixed). The test fails on any difference from the\n * RSD snapshot that no row claims, and on any key no longer different, so a\n * row cannot silently go stale. Empty for a difference with no identifier the\n * snapshot can see, which the snapshot therefore cannot check.\n */\n keys: readonly string[]\n /** what the pinned RSD release does */\n rsd: string\n /** what Tamagui DOM does */\n tamagui: string\n reason: string\n}\n"
10
+ ]
11
+ }
package/README.md DELETED
@@ -1 +0,0 @@
1
- # @tamagui/dom