@bake-native/core 0.0.0 → 0.1.0-rc.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/THIRD_PARTY_NOTICES.txt +548 -0
- package/bake-prelude.js +189 -0
- package/batch-contract.json +21 -0
- package/batch-wire.js +674 -0
- package/compat.json +64 -0
- package/controls.css +108 -0
- package/determinism.js +175 -0
- package/devtools.d.ts +13 -0
- package/devtools.js +73 -0
- package/dialogs.js +59 -0
- package/direct-style.js +105 -0
- package/direct-table.js +261 -0
- package/dist/bake.mjs +2211 -0
- package/dist/build-CMsvCcZ0.mjs +1 -0
- package/dist/build-CkLSZw06.mjs +5514 -0
- package/dist/build-tools-Dxyl6XAf.mjs +80 -0
- package/dist/client-Cm7o6dQd.mjs +17544 -0
- package/dist/compiler.mjs +4 -0
- package/dist/config-B1W8gfZY.mjs +12 -0
- package/dist/dev-Cskd8Hl4.mjs +986 -0
- package/dist/direct-report-Bdda-k_Y.mjs +153 -0
- package/dist/direct-report-Du44nNWl.mjs +1 -0
- package/dist/index.d.mts +176 -0
- package/dist/index.mjs +1 -0
- package/dist/intl-ROnAp2qO.mjs +75 -0
- package/dist/jiti-stub-CKcaShwE.mjs +5 -0
- package/dist/native-views-BuzB9x5H.mjs +7849 -0
- package/dist/octane/package.json +5 -0
- package/dist/package-KkUSMoji.mjs +2784 -0
- package/dist/react/package.json +13 -0
- package/dist/rolldown-runtime-D3KUYPsf.mjs +12 -0
- package/dist/run-D2aPm54a.mjs +6632 -0
- package/dist/scope-8W2aIuQ9.mjs +262 -0
- package/dist/screens/BakeNativeScreen.native.ts +9 -0
- package/dist/screens/package.json +5 -0
- package/dom-exception.js +31 -0
- package/element-api.js +158 -0
- package/first-screen.js +30 -0
- package/fonts/Geist-Italic-Variable.ttf +0 -0
- package/fonts/Geist-Variable.ttf +0 -0
- package/fonts/GeistMono-Italic-Variable.ttf +0 -0
- package/fonts/GeistMono-Variable.ttf +0 -0
- package/fonts/OFL.txt +93 -0
- package/fonts/README.md +27 -0
- package/fonts/geist-italic.css +8 -0
- package/fonts/geist-mono-italic.css +8 -0
- package/fonts/geist-mono.css +8 -0
- package/fonts/geist.css +8 -0
- package/header-icons.json +53 -0
- package/host-runtime.js +508 -0
- package/image-props.js +17 -0
- package/index.d.ts +8 -0
- package/index.js +7 -0
- package/licenses/Apache-2.0.txt +73 -0
- package/locale-entry.d.ts +1 -0
- package/locale-entry.js +1 -0
- package/locale.d.ts +28 -0
- package/locale.js +124 -0
- package/markup-support.js +87 -0
- package/media-element.js +115 -0
- package/native-args-entry.js +2 -0
- package/native-args.d.ts +7 -0
- package/native-args.js +155 -0
- package/native-entry.js +1 -0
- package/native-globals.d.ts +156 -0
- package/native-scenarios.d.ts +17 -0
- package/native-scenarios.js +46 -0
- package/native-support.json +349 -0
- package/native.d.ts +52 -0
- package/native.js +237 -0
- package/package.json +142 -4
- package/page-elements.js +123 -0
- package/runtime-provides.json +412 -0
- package/safe-area.d.ts +1 -0
- package/safe-area.js +44 -0
- package/swift-ui/modifiers.js +164 -0
- package/tab-icons.js +62 -0
- package/templates/create/tabs/AGENTS.md +22 -0
- package/templates/create/tabs/README.md +43 -0
- package/templates/create/tabs/_gitignore +13 -0
- package/templates/create/tabs/android/app/build.gradle.kts +79 -0
- package/templates/create/tabs/android/app/src/main/AndroidManifest.xml +39 -0
- package/templates/create/tabs/android/app/src/main/kotlin/MainActivity.kt +35 -0
- package/templates/create/tabs/android/app/src/main/res/values/themes.xml +8 -0
- package/templates/create/tabs/android/build.gradle.kts +5 -0
- package/templates/create/tabs/android/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/templates/create/tabs/android/gradle/wrapper/gradle-wrapper.properties +9 -0
- package/templates/create/tabs/android/gradle.properties +3 -0
- package/templates/create/tabs/android/gradlew +248 -0
- package/templates/create/tabs/android/settings.gradle.kts +47 -0
- package/templates/create/tabs/bake.config.ts +10 -0
- package/templates/create/tabs/ios/App/App.swift +30 -0
- package/templates/create/tabs/ios/build.sh +23 -0
- package/templates/create/tabs/ios/project.yml +57 -0
- package/templates/create/tabs/macos/Package.swift +24 -0
- package/templates/create/tabs/macos/Sources/__SWIFT_NAME__/App.swift +146 -0
- package/templates/create/tabs/macos/build.sh +4 -0
- package/templates/create/tabs/package.json +23 -0
- package/templates/create/tabs/pnpm-workspace.yaml +6 -0
- package/templates/create/tabs/src/App.tsrx +92 -0
- package/templates/create/tabs/src/App.tsx +67 -0
- package/templates/create/tabs/src/styles.css +32 -0
- package/templates/create/tabs/tsconfig.json +5 -0
- package/templates/create/tabs/windows/Cargo.toml +29 -0
- package/templates/create/tabs/windows/build.rs +9 -0
- package/templates/create/tabs/windows/src/main.rs +52 -0
- package/templates/create/tabs/windows/src/shell.rs +316 -0
- package/templates/module/__NAME__.kt +20 -0
- package/templates/module/__NAME__.native.ts +24 -0
- package/templates/module/__NAME__.swift +25 -0
- package/templates/module/__NAME__.web.ts +13 -0
- package/templates/module/__NAME__Test.kt +26 -0
- package/templates/module/__NAME__Tests.swift +25 -0
- package/templates/module/__SNAKE__.rs +43 -0
- package/text.d.ts +20 -0
- package/text.js +100 -0
- package/transform-entry.js +1 -0
- package/transform.d.ts +15 -0
- package/transform.js +98 -0
- package/tsconfig.native.json +16 -0
- package/ui/scope.js +103 -0
- package/ui/swift.js +106 -0
- package/ui/ui.css +272 -0
- package/view-ref-writer.js +268 -0
- package/view-ref.d.ts +26 -0
- package/view-ref.js +85 -0
- package/views/Video.native.ts +68 -0
- package/views/generated/VideoViewAndroid.h +68 -0
- package/views/generated/VideoViewJSI.h +94 -0
- package/views/generated/VideoViewSpec.kt +113 -0
- package/views/generated/apple/VideoViewJSI/VideoViewJSIApple.cpp +40 -0
- package/views/generated/apple/VideoViewJSI/include/VideoViewJSIApple.h +28 -0
- package/views/generated/apple/VideoViewSpec/VideoViewInterop.swift +39 -0
- package/views/generated/apple/VideoViewSpec/VideoViewSpec.swift +186 -0
- package/views/generated/video_view_spec.rs +189 -0
- package/views.d.ts +24 -0
- package/views.js +45 -0
- package/virtual-window.js +35 -0
- package/visibility.js +75 -0
- package/web-crypto.js +84 -0
- package/web-fetch.js +1071 -0
- package/README.md +0 -3
|
@@ -0,0 +1,349 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$comment": "Fail closed: the one list of what native targets (ios, android, mac, windows) support in markup and JS. Read by `bake build` (markup and global checks), the Rust engine (bake-css-lint checks the first commit against it; bake-core tests compare it with what the core handles) and tools/native-support.mjs (docs/content/docs/reference/support.mdx and native-globals.d.ts). Anything not listed is an error. CSS lives in Rust (native/rust/crates/bake-css/src/support.rs). Edit here, then run `pnpm support-list` (pnpm check fails until you do).",
|
|
3
|
+
"elements": {
|
|
4
|
+
"supported": {
|
|
5
|
+
"a": { "note": "A text container: links do not navigate on native targets (href is an error)." },
|
|
6
|
+
"abbr": {}, "address": {}, "article": {}, "aside": {}, "b": {}, "blockquote": {}, "br": {},
|
|
7
|
+
"button": { "attributes": ["disabled", "type", "value", "name", "popovertarget", "popoverTarget", "popovertargetaction", "popoverTargetAction"],
|
|
8
|
+
"values": { "popovertargetaction": ["toggle", "show", "hide"], "popoverTargetAction": ["toggle", "show", "hide"] } },
|
|
9
|
+
"cite": {}, "code": {}, "dd": {},
|
|
10
|
+
"details": { "attributes": ["open"] },
|
|
11
|
+
"dfn": {},
|
|
12
|
+
"dialog": { "attributes": ["open"], "note": "An open dialog is a platform sheet." },
|
|
13
|
+
"div": {}, "dl": {}, "dt": {}, "em": {}, "figcaption": {}, "figure": {}, "footer": {},
|
|
14
|
+
"form": { "note": "A container only: there is no form submission (handle onClick / onChange)." },
|
|
15
|
+
"h1": {}, "h2": {}, "h3": {}, "h4": {}, "h5": {}, "h6": {}, "header": {}, "hgroup": {}, "hr": {}, "i": {},
|
|
16
|
+
"input": {
|
|
17
|
+
"attributes": ["type", "value", "defaultValue", "checked", "defaultChecked", "disabled", "placeholder", "name", "min", "max", "step",
|
|
18
|
+
"maxlength", "maxLength", "switch", "inputmode", "inputMode", "enterkeyhint", "enterKeyHint", "autocomplete", "autoComplete",
|
|
19
|
+
"autocorrect", "autoCorrect", "autocapitalize", "autoCapitalize", "spellcheck", "spellCheck", "suppressNativeChangeWarning"],
|
|
20
|
+
"values": { "type": ["text", "password", "email", "search", "tel", "url", "number", "checkbox", "radio", "range", "date", "time", "datetime-local", "color"] }
|
|
21
|
+
},
|
|
22
|
+
"kbd": {}, "label": { "attributes": ["for", "htmlFor"] }, "li": {}, "main": {}, "mark": {}, "menu": {},
|
|
23
|
+
"meter": { "attributes": ["value", "min", "max"] },
|
|
24
|
+
"nav": {}, "ol": {},
|
|
25
|
+
"optgroup": { "attributes": ["label", "disabled"] },
|
|
26
|
+
"option": { "attributes": ["value", "selected", "disabled", "label"] },
|
|
27
|
+
"p": {}, "pre": {},
|
|
28
|
+
"progress": { "attributes": ["value", "max"] },
|
|
29
|
+
"samp": {}, "search": {}, "section": {},
|
|
30
|
+
"select": { "attributes": ["value", "defaultValue", "disabled", "name"] },
|
|
31
|
+
"small": {}, "span": {}, "strong": {}, "summary": {},
|
|
32
|
+
"textarea": {
|
|
33
|
+
"attributes": ["value", "defaultValue", "disabled", "placeholder", "name", "rows", "maxlength", "maxLength", "inputmode", "inputMode",
|
|
34
|
+
"enterkeyhint", "enterKeyHint", "autocomplete", "autoComplete", "autocorrect", "autoCorrect", "autocapitalize",
|
|
35
|
+
"autoCapitalize", "spellcheck", "spellCheck", "suppressNativeChangeWarning"]
|
|
36
|
+
},
|
|
37
|
+
"time": {}, "u": {}, "ul": {}, "var": {},
|
|
38
|
+
"svg": { "svg": true }, "g": { "svg": true }, "path": { "svg": true }, "rect": { "svg": true }, "circle": { "svg": true },
|
|
39
|
+
"ellipse": { "svg": true }, "line": { "svg": true }, "polyline": { "svg": true }, "polygon": { "svg": true },
|
|
40
|
+
"img": { "attributes": ["src", "alt", "width", "height", "loading", "decoding"], "values": { "loading": ["eager", "lazy"], "decoding": ["async", "auto", "sync"] },
|
|
41
|
+
"note": "Bundle assets (relative paths, copied and hashed by bake build), data: URLs and http(s) URLs (loaded through the host's fetch transport into the shared memory + disk cache; on Android cleartext http:// follows the app's Network Security Config, HTTPS only by default); PNG, JPEG, WebP, GIF (first frame), SVG." },
|
|
42
|
+
"video": { "attributes": ["src", "poster", "width", "height", "autoplay", "autoPlay", "muted", "loop", "playsinline", "playsInline", "preload"],
|
|
43
|
+
"values": { "preload": ["auto", "metadata", "none", ""] },
|
|
44
|
+
"note": "Played by the platform player (Media Foundation, MediaPlayer, AVPlayer: hardware decoding); size, poster, object-fit / object-position and border-radius clip are the core's, as Chromium lays them out. src: a bundle asset (relative path) or https:. The first screen shows the poster (or the empty box); playback starts after hydration. Ref: play(), pause(), currentTime. No system controls." },
|
|
45
|
+
"defs": { "svg": true }, "symbol": { "svg": true }, "use": { "svg": true, "attributes": ["href", "xlinkHref", "xlink:href"] },
|
|
46
|
+
"linearGradient": { "svg": true, "attributes": ["href", "xlinkHref", "xlink:href"] },
|
|
47
|
+
"radialGradient": { "svg": true, "attributes": ["href", "xlinkHref", "xlink:href"] }, "stop": { "svg": true },
|
|
48
|
+
"clipPath": { "svg": true }, "mask": { "svg": true }, "text": { "svg": true }, "tspan": { "svg": true },
|
|
49
|
+
"title": { "svg": true, "note": "Not drawn, as in browsers." }, "desc": { "svg": true, "note": "Not drawn, as in browsers." },
|
|
50
|
+
"bake-container": { "internal": "View in the React and Octane adapters" },
|
|
51
|
+
"bake-text": { "internal": "Text in the React and Octane adapters" },
|
|
52
|
+
"bake-image": { "attributes": ["src", "alt"], "internal": "Image in the React and Octane adapters" },
|
|
53
|
+
"bake-header": { "attributes": "*", "internal": "Universal UI" },
|
|
54
|
+
"bake-tabbar": { "attributes": "*", "internal": "Universal UI", "targets": ["ios", "mac", "android"] },
|
|
55
|
+
"swiftui-*": { "attributes": "*", "internal": "the SwiftUI adapters", "targets": ["ios", "mac"],
|
|
56
|
+
"kinds": ["host", "vstack", "hstack", "zstack", "group", "spacer", "divider", "scrollview", "glasseffectcontainer",
|
|
57
|
+
"text", "label", "image", "progressview", "button", "toggle", "slider", "picker", "textfield",
|
|
58
|
+
"securefield", "menu", "form", "list", "section", "navigationstack", "toolbaritem", "bakeview",
|
|
59
|
+
"bottomsheet", "tabview", "tab"],
|
|
60
|
+
"unknown": { "why": "the SwiftUI host draws no such component (its registry is the kinds list in native-support.json)",
|
|
61
|
+
"instead": "a component exported by your adapter's ui/swift-ui entry" } }
|
|
62
|
+
},
|
|
63
|
+
"unsupported": {
|
|
64
|
+
"picture": { "why": "images are not drawn on native targets yet", "instead": "an inline <svg>" },
|
|
65
|
+
"source": { "why": "<video> on native targets plays its src attribute only: there is no source selection by type or media query", "instead": "<video src> with one MP4 (H.264 / AAC) every platform player decodes" },
|
|
66
|
+
"track": { "why": "text tracks (captions, subtitles) are not rendered on native targets", "instead": "draw captions yourself from timeupdate (event.target.currentTime)" },
|
|
67
|
+
"bake-video": { "why": "the Video native view (@bake-native/octane/video) became the built-in <video> element", "instead": "<video src poster autoplay muted loop> with onLoadedMetadata / onTimeUpdate / onEnded and ref.play() / pause() / currentTime" },
|
|
68
|
+
"audio": { "why": "<audio> is not supported on native targets (only <video> is)", "instead": "a native audio module" },
|
|
69
|
+
"canvas": { "why": "there is no canvas context on native targets", "instead": "an inline <svg>" },
|
|
70
|
+
"iframe": { "why": "native targets cannot embed documents", "instead": "a native module that opens a web view" },
|
|
71
|
+
"embed": { "why": "native targets cannot embed documents", "instead": "a native module" },
|
|
72
|
+
"object": { "why": "native targets cannot embed documents", "instead": "a native module" },
|
|
73
|
+
"table": { "why": "table layout is not implemented (it would lay out as blocks)", "instead": "display: grid rows" },
|
|
74
|
+
"caption": { "why": "table layout is not implemented", "instead": "display: grid" },
|
|
75
|
+
"thead": { "why": "table layout is not implemented", "instead": "display: grid" },
|
|
76
|
+
"tbody": { "why": "table layout is not implemented", "instead": "display: grid" },
|
|
77
|
+
"tfoot": { "why": "table layout is not implemented", "instead": "display: grid" },
|
|
78
|
+
"tr": { "why": "table layout is not implemented", "instead": "display: grid" },
|
|
79
|
+
"td": { "why": "table layout is not implemented", "instead": "display: grid" },
|
|
80
|
+
"th": { "why": "table layout is not implemented", "instead": "display: grid" },
|
|
81
|
+
"col": { "why": "table layout is not implemented", "instead": "display: grid" },
|
|
82
|
+
"colgroup": { "why": "table layout is not implemented", "instead": "display: grid" },
|
|
83
|
+
"s": { "why": "line-through text decoration is not drawn on native targets", "instead": "a <span> with your own style" },
|
|
84
|
+
"strike": { "why": "line-through text decoration is not drawn on native targets", "instead": "a <span> with your own style" },
|
|
85
|
+
"del": { "why": "line-through text decoration is not drawn on native targets", "instead": "a <span> with your own style" },
|
|
86
|
+
"ins": { "why": "kept for symmetry with <del>; use <u> or a styled <span>", "instead": "<u>" },
|
|
87
|
+
"sub": { "why": "the native user-agent styles give it no vertical-align", "instead": "a <span> with a smaller font-size and vertical-align: sub" },
|
|
88
|
+
"sup": { "why": "the native user-agent styles give it no vertical-align", "instead": "a <span> with a smaller font-size and vertical-align: super" },
|
|
89
|
+
"q": { "why": "quotation marks come from ::before / ::after, which native does not draw", "instead": "write the quotation marks in the text" },
|
|
90
|
+
"fieldset": { "why": "the legend-in-border layout and groove border are not drawn", "instead": "a <div> with a border and a heading" },
|
|
91
|
+
"legend": { "why": "the legend-in-border layout is not drawn", "instead": "a heading" },
|
|
92
|
+
"datalist": { "why": "input suggestions are not shown on native targets", "instead": "a <select>" },
|
|
93
|
+
"output": { "why": "form association is not implemented", "instead": "a <span>" },
|
|
94
|
+
"slot": { "why": "there is no shadow DOM", "instead": "children props" },
|
|
95
|
+
"template": { "why": "there is no DOM to clone templates into", "instead": "a component" },
|
|
96
|
+
"pattern": { "svg": true, "why": "SVG patterns are not drawn", "instead": "a gradient or plain shapes" },
|
|
97
|
+
"filter": { "svg": true, "why": "SVG filters are not drawn", "instead": "plain shapes, gradients or opacity" },
|
|
98
|
+
"marker": { "svg": true, "why": "SVG markers are not drawn", "instead": "draw the arrowheads as shapes" },
|
|
99
|
+
"textPath": { "svg": true, "why": "SVG text on a path is not drawn", "instead": "<text> with x / y positions" },
|
|
100
|
+
"image": { "svg": true, "why": "SVG <image> waits for the image asset pipeline of <img>", "instead": "vector shapes, or an <img> next to the <svg>" },
|
|
101
|
+
"foreignObject": { "svg": true, "why": "SVG foreignObject is not drawn", "instead": "an HTML element over the <svg>" }
|
|
102
|
+
}
|
|
103
|
+
},
|
|
104
|
+
"attributes": {
|
|
105
|
+
"global": ["class", "className", "id", "style", "key", "ref", "hidden", "role", "tabindex", "tabIndex", "inert", "autoFocus", "autofocus",
|
|
106
|
+
"aria-label", "ariaLabel", "aria-hidden", "aria-live", "aria-expanded", "aria-checked", "aria-selected", "aria-disabled", "aria-pressed",
|
|
107
|
+
"aria-labelledby", "aria-describedby", "aria-description", "aria-level", "aria-valuenow", "aria-valuemin", "aria-valuemax",
|
|
108
|
+
"aria-valuetext", "aria-modal", "aria-current", "aria-atomic", "aria-required", "aria-readonly",
|
|
109
|
+
"aria-haspopup", "aria-controls", "aria-busy", "aria-orientation", "aria-activedescendant", "aria-invalid", "aria-errormessage",
|
|
110
|
+
"testID", "testId", "popover", "dir"],
|
|
111
|
+
"prefixes": ["data-"],
|
|
112
|
+
"svg": ["viewBox", "width", "height", "x", "y", "rx", "ry", "cx", "cy", "r", "x1", "y1", "x2", "y2", "d", "points", "fill", "stroke",
|
|
113
|
+
"stroke-width", "strokeWidth", "stroke-linecap", "strokeLinecap", "stroke-linejoin", "strokeLinejoin", "stroke-miterlimit", "strokeMiterlimit",
|
|
114
|
+
"stroke-dasharray", "strokeDasharray", "stroke-dashoffset", "strokeDashoffset", "fill-rule", "fillRule", "fill-opacity", "fillOpacity",
|
|
115
|
+
"stroke-opacity", "strokeOpacity", "opacity", "transform", "preserveAspectRatio", "xmlns", "visibility", "display", "color", "overflow",
|
|
116
|
+
"offset", "stop-color", "stopColor", "stop-opacity", "stopOpacity", "gradientUnits", "gradientTransform", "spreadMethod", "fx", "fy",
|
|
117
|
+
"clip-path", "clipPath", "clip-rule", "clipRule", "clipPathUnits", "mask", "maskUnits", "maskContentUnits", "mask-type", "maskType",
|
|
118
|
+
"font-family", "fontFamily", "font-size", "fontSize", "font-weight", "fontWeight", "font-style", "fontStyle",
|
|
119
|
+
"text-anchor", "textAnchor", "dominant-baseline", "dominantBaseline", "dx", "dy"],
|
|
120
|
+
"values": {
|
|
121
|
+
"popover": ["", "auto", "manual", "hint"],
|
|
122
|
+
"dir": ["ltr", "rtl"],
|
|
123
|
+
"fill-rule": ["nonzero", "evenodd", "inherit"], "fillRule": ["nonzero", "evenodd", "inherit"],
|
|
124
|
+
"clip-rule": ["nonzero", "evenodd", "inherit"], "clipRule": ["nonzero", "evenodd", "inherit"],
|
|
125
|
+
"stroke-linecap": ["butt", "round", "square", "inherit"], "strokeLinecap": ["butt", "round", "square", "inherit"],
|
|
126
|
+
"stroke-linejoin": ["miter", "round", "bevel", "inherit"], "strokeLinejoin": ["miter", "round", "bevel", "inherit"],
|
|
127
|
+
"text-anchor": ["start", "middle", "end", "inherit"], "textAnchor": ["start", "middle", "end", "inherit"],
|
|
128
|
+
"dominant-baseline": ["auto", "alphabetic", "middle", "central", "hanging", "text-before-edge", "text-after-edge", "ideographic", "mathematical", "text-top", "text-bottom", "inherit"],
|
|
129
|
+
"dominantBaseline": ["auto", "alphabetic", "middle", "central", "hanging", "text-before-edge", "text-after-edge", "ideographic", "mathematical", "text-top", "text-bottom", "inherit"],
|
|
130
|
+
"spreadMethod": ["pad", "reflect", "repeat"],
|
|
131
|
+
"gradientUnits": ["userspaceonuse", "objectboundingbox"], "clipPathUnits": ["userspaceonuse", "objectboundingbox"],
|
|
132
|
+
"maskUnits": ["userspaceonuse", "objectboundingbox"], "maskContentUnits": ["userspaceonuse", "objectboundingbox"],
|
|
133
|
+
"mask-type": ["luminance", "alpha"], "maskType": ["luminance", "alpha"],
|
|
134
|
+
"font-style": ["normal", "italic", "oblique"], "fontStyle": ["normal", "italic", "oblique"],
|
|
135
|
+
"role": ["alert", "alertdialog", "article", "banner", "button", "cell", "checkbox", "columnheader", "combobox", "complementary", "contentinfo",
|
|
136
|
+
"dialog", "figure", "form", "generic", "grid", "gridcell", "group", "heading", "img", "image", "link", "list", "listbox", "listitem", "log",
|
|
137
|
+
"main", "menu", "menuitem", "meter", "navigation", "none", "note", "option", "paragraph", "presentation", "progressbar", "radio",
|
|
138
|
+
"radiogroup", "region", "row", "search", "searchbox", "separator", "slider", "spinbutton", "status", "switch", "tab", "table", "tablist",
|
|
139
|
+
"tabpanel", "text", "textbox", "toolbar", "tooltip"],
|
|
140
|
+
"aria-haspopup": ["false", "true", "menu", "listbox", "tree", "grid", "dialog"],
|
|
141
|
+
"aria-busy": ["true", "false"],
|
|
142
|
+
"aria-orientation": ["horizontal", "vertical", "undefined"]
|
|
143
|
+
},
|
|
144
|
+
"valueTargets": {
|
|
145
|
+
"dir": { "rtl": { "targets": ["ios", "mac", "android"], "why": "the text backend of this target shapes paragraphs left to right (the same as `direction: rtl`, css-direction)", "instead": "leave the default (ltr) on this target" } }
|
|
146
|
+
},
|
|
147
|
+
"unsupported": {
|
|
148
|
+
"controls": { "why": "native targets draw no media controls yet: each platform player has its own (AVKit, Media Foundation, Android) and none matches Chromium's, so the same markup would look different on every target", "instead": "your own buttons calling ref.play() / pause() and setting currentTime" },
|
|
149
|
+
"href": { "why": "links do not navigate on native targets: no host opens URLs", "instead": "onClick, opening the URL with a native module; or branch on import.meta.env.BAKE_TARGET === 'web'" },
|
|
150
|
+
"target": { "why": "links do not navigate on native targets", "instead": "onClick with a native module" },
|
|
151
|
+
"rel": { "why": "links do not navigate on native targets", "instead": "onClick with a native module" },
|
|
152
|
+
"lang": { "why": "the document language does not change shaping or :lang() on native targets", "instead": "remove it" },
|
|
153
|
+
"title": { "why": "there are no tooltips on native targets", "instead": "visible text or aria-label" },
|
|
154
|
+
"srcset": { "why": "images are not loaded on native targets", "instead": "an inline <svg>" },
|
|
155
|
+
"readonly": { "why": "read-only text fields are not implemented", "instead": "disabled, or render the value as text" },
|
|
156
|
+
"readOnly": { "why": "read-only text fields are not implemented", "instead": "disabled, or render the value as text" },
|
|
157
|
+
"required": { "why": "there is no form validation on native targets", "instead": "validate in JS" },
|
|
158
|
+
"pattern": { "why": "there is no form validation on native targets", "instead": "validate in JS" },
|
|
159
|
+
"minlength": { "why": "there is no form validation on native targets", "instead": "validate in JS" },
|
|
160
|
+
"minLength": { "why": "there is no form validation on native targets", "instead": "validate in JS" },
|
|
161
|
+
"multiple": { "why": "multi-select lists are not implemented (the select would draw nothing)", "instead": "checkboxes" },
|
|
162
|
+
"size": { "why": "list-box selects are not implemented (the select would draw nothing)", "instead": "radio buttons" },
|
|
163
|
+
"low": { "why": "meter regions are not drawn", "instead": "color the meter with your own CSS" },
|
|
164
|
+
"high": { "why": "meter regions are not drawn", "instead": "color the meter with your own CSS" },
|
|
165
|
+
"optimum": { "why": "meter regions are not drawn", "instead": "color the meter with your own CSS" },
|
|
166
|
+
"contenteditable": { "why": "there is no rich text editing on native targets", "instead": "<textarea>" },
|
|
167
|
+
"contentEditable": { "why": "there is no rich text editing on native targets", "instead": "<textarea>" },
|
|
168
|
+
"draggable": { "why": "drag and drop is not implemented", "instead": "nothing yet" },
|
|
169
|
+
"download": { "why": "there are no downloads on native targets", "instead": "a native module" },
|
|
170
|
+
"filter": { "why": "SVG filters are not drawn", "instead": "plain shapes, gradients or opacity" },
|
|
171
|
+
"marker-start": { "why": "SVG markers are not drawn", "instead": "draw the arrowheads as shapes" },
|
|
172
|
+
"markerStart": { "why": "SVG markers are not drawn", "instead": "draw the arrowheads as shapes" },
|
|
173
|
+
"marker-mid": { "why": "SVG markers are not drawn", "instead": "draw the arrowheads as shapes" },
|
|
174
|
+
"markerMid": { "why": "SVG markers are not drawn", "instead": "draw the arrowheads as shapes" },
|
|
175
|
+
"marker-end": { "why": "SVG markers are not drawn", "instead": "draw the arrowheads as shapes" },
|
|
176
|
+
"markerEnd": { "why": "SVG markers are not drawn", "instead": "draw the arrowheads as shapes" },
|
|
177
|
+
"fr": { "why": "a radial gradient's focal radius is not drawn", "instead": "a focal point (fx, fy) without fr" },
|
|
178
|
+
"textLength": { "why": "SVG text is not stretched to a length", "instead": "a font size that fits" },
|
|
179
|
+
"lengthAdjust": { "why": "SVG text is not stretched to a length", "instead": "a font size that fits" },
|
|
180
|
+
"rotate": { "why": "per-glyph rotation of SVG text is not drawn", "instead": "a transform on the <text>" },
|
|
181
|
+
"paint-order": { "why": "paint-order is not drawn (the fill is always under the stroke)", "instead": "two shapes" },
|
|
182
|
+
"paintOrder": { "why": "paint-order is not drawn (the fill is always under the stroke)", "instead": "two shapes" },
|
|
183
|
+
"vector-effect": { "why": "non-scaling strokes are not drawn", "instead": "a stroke width in the scaled units" },
|
|
184
|
+
"vectorEffect": { "why": "non-scaling strokes are not drawn", "instead": "a stroke width in the scaled units" },
|
|
185
|
+
"shape-rendering": { "why": "SVG shapes are always anti-aliased", "instead": "remove it" },
|
|
186
|
+
"shapeRendering": { "why": "SVG shapes are always anti-aliased", "instead": "remove it" }
|
|
187
|
+
},
|
|
188
|
+
"aria-unsupported": { "why": "the core's semantic tree reads only aria-label, aria-labelledby, aria-describedby, aria-description, aria-hidden, aria-live, aria-atomic, aria-expanded, aria-checked, aria-selected, aria-disabled, aria-pressed, aria-level, aria-valuenow, aria-valuemin, aria-valuemax, aria-valuetext, aria-modal, aria-current, aria-required, aria-readonly, aria-haspopup, aria-controls, aria-busy, aria-orientation, aria-activedescendant, aria-invalid and aria-errormessage", "instead": "one of those" }
|
|
189
|
+
},
|
|
190
|
+
"svg": {
|
|
191
|
+
"$comment": "CSS properties that apply to SVG content but are not drawn. On an SVG element (its style, or an app rule that matches it in the first commit) a value other than none / normal / auto (or a CSS-wide keyword) is a build error. Equal to bake_svg::UNSUPPORTED_CSS_PROPERTIES (bake-core test).",
|
|
192
|
+
"unsupportedCss": ["alignment-baseline", "animation", "baseline-shift", "color-interpolation", "color-interpolation-filters", "filter", "font",
|
|
193
|
+
"font-stretch", "font-variant", "image-rendering", "isolation", "letter-spacing", "marker", "marker-end", "marker-mid",
|
|
194
|
+
"marker-start", "mix-blend-mode", "paint-order", "shape-rendering", "text-decoration", "transform", "transition",
|
|
195
|
+
"vector-effect", "word-spacing", "writing-mode"]
|
|
196
|
+
},
|
|
197
|
+
"events": {
|
|
198
|
+
"supported": {
|
|
199
|
+
"onClick": { "event": "click" },
|
|
200
|
+
"onPress": { "event": "click", "note": "alias of onClick" },
|
|
201
|
+
"onInput": { "event": "input", "elements": ["input", "textarea", "select"] },
|
|
202
|
+
"onChange": { "event": "change", "elements": ["input", "textarea", "select"], "note": "a text field commits (Return or blur); in React, onChange of a text input, textarea or range, date, time or color input is the input event, as React DOM" },
|
|
203
|
+
"onSubmit": { "event": "submit", "elements": ["input", "textarea"], "note": "a text field's commit (Return) when it has no change listener (an Octane onChange; a React text field's onChange is on input)" },
|
|
204
|
+
"onFocus": { "event": "focus", "capture": true, "note": "propagates (React semantics, as the web build): an ancestor hears its descendants' focus. elements focus by Tab / press (the core's focus model)" },
|
|
205
|
+
"onBlur": { "event": "blur", "capture": true, "note": "propagates, as onFocus" },
|
|
206
|
+
"onFocusIn": { "event": "focusin", "capture": true },
|
|
207
|
+
"onFocusOut": { "event": "focusout", "capture": true },
|
|
208
|
+
"onKeyDown": { "event": "keydown", "capture": true, "note": "capture and bubble from the focused element; preventDefault() on Tab stops focus navigation" },
|
|
209
|
+
"onKeyUp": { "event": "keyup", "capture": true },
|
|
210
|
+
"onPointerDown": { "event": "pointerdown", "capture": true, "targets": ["windows", "mac", "ios", "android"], "note": "the core hit-tests (paint order, pointer-events, transforms); event.currentTarget.setPointerCapture(event.pointerId) works" },
|
|
211
|
+
"onPointerMove": { "event": "pointermove", "capture": true, "targets": ["windows", "mac", "ios", "android"] },
|
|
212
|
+
"onPointerUp": { "event": "pointerup", "capture": true, "targets": ["windows", "mac", "ios", "android"] },
|
|
213
|
+
"onPointerCancel": { "event": "pointercancel", "capture": true, "targets": ["windows", "mac", "ios", "android"] },
|
|
214
|
+
"onPointerOver": { "event": "pointerover", "capture": true, "targets": ["windows", "mac", "ios", "android"] },
|
|
215
|
+
"onPointerOut": { "event": "pointerout", "capture": true, "targets": ["windows", "mac", "ios", "android"] },
|
|
216
|
+
"onPointerEnter": { "event": "pointerenter", "targets": ["windows", "mac", "ios", "android"], "note": "the element only (no bubbling)" },
|
|
217
|
+
"onPointerLeave": { "event": "pointerleave", "targets": ["windows", "mac", "ios", "android"], "note": "the element only (no bubbling)" },
|
|
218
|
+
"onGotPointerCapture": { "event": "gotpointercapture", "capture": true, "targets": ["windows", "mac", "ios", "android"] },
|
|
219
|
+
"onLostPointerCapture": { "event": "lostpointercapture", "capture": true, "targets": ["windows", "mac", "ios", "android"] },
|
|
220
|
+
"onContextMenu": { "event": "contextmenu", "capture": true, "targets": ["windows", "mac", "ios", "android"], "note": "a secondary click (on release on Windows), or a touch held 500 ms without moving, as Chromium on Android (its release is no click); native shows no menu of its own" },
|
|
221
|
+
"onWheel": { "event": "wheel", "capture": true, "targets": ["windows", "mac", "android"], "note": "not cancelable: the host scrolls" },
|
|
222
|
+
"onCompositionStart": { "event": "compositionstart", "elements": ["input", "textarea"] },
|
|
223
|
+
"onCompositionUpdate": { "event": "compositionupdate", "elements": ["input", "textarea"] },
|
|
224
|
+
"onCompositionEnd": { "event": "compositionend", "elements": ["input", "textarea"] },
|
|
225
|
+
"onToggle": { "event": "toggle" },
|
|
226
|
+
"onClose": { "event": "close", "elements": ["dialog"] },
|
|
227
|
+
"onParentLayout": { "event": "parentlayout", "elements": ["div", "button", "bake-container"], "note": "BakeNative: the element's rect within its parent after layout" },
|
|
228
|
+
"onLayout": { "event": "layout", "note": "BakeNative: the element's rect after layout" },
|
|
229
|
+
"onScroll": { "event": "scroll", "note": "fired by an overflow: auto / scroll element; event.currentTarget.scrollTop / scrollLeft / clientWidth / clientHeight" },
|
|
230
|
+
"onItemPress": { "event": "itempress", "elements": ["bake-header"] },
|
|
231
|
+
"onTabSelect": { "event": "tabselect", "elements": ["bake-tabbar"] },
|
|
232
|
+
"onLoad": { "event": "load", "elements": ["img"], "note": "The image loaded (its natural size is laid out)" },
|
|
233
|
+
"onError": { "event": "error", "elements": ["img", "video"], "note": "The image failed to load or decode; the video failed to load or play (event.target.error: { code, message })" },
|
|
234
|
+
"onLoadedMetadata": { "event": "loadedmetadata", "elements": ["video"], "note": "duration and videoWidth / videoHeight are known (the natural size is laid out)" },
|
|
235
|
+
"onPlay": { "event": "play", "elements": ["video"], "note": "playback started (play(), autoplay)" },
|
|
236
|
+
"onPause": { "event": "pause", "elements": ["video"], "note": "playback paused (pause(), or the end without loop)" },
|
|
237
|
+
"onEnded": { "event": "ended", "elements": ["video"], "note": "playback reached the end (not while looping)" },
|
|
238
|
+
"onTimeUpdate": { "event": "timeupdate", "elements": ["video"], "note": "the position moved: at most every 250 ms, the last one always arrives (event.target.currentTime)" },
|
|
239
|
+
"onAnimationStart": { "event": "animationstart", "note": "the element only (no bubbling); at the injected clock, for animations that start while the listener is attached" },
|
|
240
|
+
"onAnimationIteration": { "event": "animationiteration", "note": "the element only (no bubbling)" },
|
|
241
|
+
"onAnimationEnd": { "event": "animationend", "note": "the element only (no bubbling); wait for it to unmount after an exit animation" },
|
|
242
|
+
"onTransitionRun": { "event": "transitionrun", "note": "the element only (no bubbling)" },
|
|
243
|
+
"onTransitionStart": { "event": "transitionstart", "note": "the element only (no bubbling)" },
|
|
244
|
+
"onTransitionEnd": { "event": "transitionend", "note": "the element only (no bubbling)" },
|
|
245
|
+
"onTransitionCancel": { "event": "transitioncancel", "note": "the element only (no bubbling); a transition replaced before its end" }
|
|
246
|
+
},
|
|
247
|
+
"unsupported": {
|
|
248
|
+
"onDoubleClick": { "why": "double clicks are not delivered on native targets", "instead": "onClick with your own timing" },
|
|
249
|
+
"onKeyPress": { "why": "keypress is deprecated and not delivered", "instead": "onKeyDown" }
|
|
250
|
+
},
|
|
251
|
+
"unsupportedPrefixes": {
|
|
252
|
+
"onPointer": { "why": "this pointer event is not delivered", "instead": "onPointerDown / Move / Up / Cancel / Over / Out / Enter / Leave" },
|
|
253
|
+
"onMouse": { "why": "mouse compatibility events are not delivered", "instead": "onPointer* (event.pointerType is \"mouse\")" },
|
|
254
|
+
"onTouch": { "why": "touch events are not delivered", "instead": "onPointer* (event.pointerType is \"touch\")" },
|
|
255
|
+
"onDrag": { "why": "drag and drop is not implemented", "instead": "nothing yet" },
|
|
256
|
+
"onDrop": { "why": "drag and drop is not implemented", "instead": "nothing yet" },
|
|
257
|
+
"onAnimation": { "why": "this animation event is not delivered", "instead": "onAnimationStart / Iteration / End" },
|
|
258
|
+
"onTransition": { "why": "this transition event is not delivered", "instead": "onTransitionRun / Start / End / Cancel" },
|
|
259
|
+
"onCopy": { "why": "clipboard events are not delivered", "instead": "a native module" },
|
|
260
|
+
"onCut": { "why": "clipboard events are not delivered", "instead": "a native module" },
|
|
261
|
+
"onPaste": { "why": "clipboard events are not delivered", "instead": "a native module" },
|
|
262
|
+
"onSelect": { "why": "text selection events are not delivered", "instead": "nothing yet" },
|
|
263
|
+
"onBefore": { "why": "beforeinput / beforetoggle are not delivered", "instead": "onInput / onToggle" },
|
|
264
|
+
"onGot": { "why": "pointer capture is not implemented", "instead": "onClick" },
|
|
265
|
+
"onLost": { "why": "pointer capture is not implemented", "instead": "onClick" }
|
|
266
|
+
}
|
|
267
|
+
},
|
|
268
|
+
"element": {
|
|
269
|
+
"$comment": "Element handles (refs, event targets) on native targets: getComputedStyle answers `computedStyle` (bake_core::element::COMPUTED_STYLE_PROPERTIES; the last eight are properties the CSS lint rejects, so always their initial value) and custom properties through getPropertyValue('--name') (env() replaced; requires.globals `custom-properties`) and addEventListener takes `events` (REF_EVENT_TYPES); anything else throws E_UNSUPPORTED. The core's tests check both lists against these.",
|
|
270
|
+
"computedStyle": ["display", "position", "visibility", "opacity", "overflow", "overflowX", "overflowY", "pointerEvents", "zIndex", "transform", "animationName", "animationDuration", "animationDelay", "animationIterationCount", "animationFillMode", "animationDirection", "transitionProperty", "transitionDuration", "transitionDelay", "width", "height", "boxSizing", "direction", "borderTopWidth", "borderRightWidth", "borderBottomWidth", "borderLeftWidth", "paddingTop", "paddingRight", "paddingBottom", "paddingLeft", "translate", "scale", "rotate", "perspective", "containerType", "backdropFilter", "willChange", "contain"],
|
|
271
|
+
"events": ["click", "change", "pointerdown", "pointerup", "pointermove", "pointercancel", "pointerover", "pointerout", "pointerenter", "pointerleave", "gotpointercapture", "lostpointercapture", "mousedown", "mouseup", "mousemove", "mouseover", "mouseout", "mouseenter", "mouseleave", "keydown", "keyup", "focus", "blur", "focusin", "focusout", "wheel", "animationstart", "animationiteration", "animationend", "animationcancel", "transitionrun", "transitionstart", "transitionend", "transitioncancel"]
|
|
272
|
+
},
|
|
273
|
+
"globals": {
|
|
274
|
+
"$comment": "Free identifiers a native bundle may read. `hermes`: what Hermes itself defines (checked against the real VM by tests/fail-closed/hermes-globals). `runtime`: what BakeNative installs (host-runtime.js, the native bridge). `crypto`: the members of `crypto` (web-crypto.js); any other is an error (`crypto.subtle`: global-crypto-subtle). `alert` and `confirm` (dialogs.js) return a Promise: a confirm() result must be awaited or returned (global-confirm-sync), and .then on either throws on the web (global-dialog-then). `typeof X` reads and `globalThis.X` feature tests are always allowed.",
|
|
275
|
+
"hermes": ["NaN", "Infinity", "undefined", "parseInt", "parseFloat", "Object", "Error", "AggregateError", "EvalError", "RangeError",
|
|
276
|
+
"ReferenceError", "SyntaxError", "TypeError", "URIError", "String", "BigInt", "Function", "Number", "Boolean", "Date", "RegExp", "Array",
|
|
277
|
+
"ArrayBuffer", "DataView", "Uint8Array", "Int8Array", "Uint8ClampedArray", "Uint16Array", "Int16Array", "Uint32Array", "Int32Array",
|
|
278
|
+
"Float32Array", "Float64Array", "BigUint64Array", "BigInt64Array", "Set", "Map", "WeakMap", "WeakSet", "FinalizationRegistry",
|
|
279
|
+
"WeakRef", "Symbol", "Proxy", "Math", "JSON", "Reflect", "isNaN", "isFinite", "escape", "unescape", "atob", "btoa", "queueMicrotask",
|
|
280
|
+
"decodeURI", "decodeURIComponent", "encodeURI", "encodeURIComponent", "globalThis", "Promise", "Iterator", "TextEncoder", "TextDecoder",
|
|
281
|
+
"console"],
|
|
282
|
+
"hermesInternal": ["HermesInternal", "print", "eval", "gc", "$SHBuiltin", "HermesAsyncIteratorsInternal", "TimeoutError", "QuitError", "Float16Array"],
|
|
283
|
+
"console": ["log", "debug", "info", "warn", "error"],
|
|
284
|
+
"runtime": ["setTimeout", "setInterval", "clearTimeout", "clearInterval", "requestAnimationFrame", "cancelAnimationFrame", "performance", "native", "getComputedStyle",
|
|
285
|
+
"fetch", "Request", "Response", "Headers", "AbortController", "AbortSignal", "DOMException", "URL", "URLSearchParams", "Blob", "crypto",
|
|
286
|
+
"alert", "confirm"],
|
|
287
|
+
"crypto": ["getRandomValues", "randomUUID"],
|
|
288
|
+
"runtimePrefixes": ["__bake", "__BAKE", "__host"],
|
|
289
|
+
"intl": { "targets": ["ios", "mac", "android", "windows"], "note": "Intl.Collator, Intl.DateTimeFormat, Intl.NumberFormat and Intl.getCanonicalLocales, over the platform's ICU (Foundation on iOS and macOS). Hermes has no Intl.PluralRules, RelativeTimeFormat, ListFormat, DisplayNames, Segmenter, Locale, DurationFormat or supportedValuesOf, and the Intl lint names what to use instead" },
|
|
290
|
+
"unsupported": {
|
|
291
|
+
"document": { "why": "there is no DOM on native targets: only document.activeElement, document.visibilityState, document.hidden, the visibilitychange event, and the class, id, attributes and inline style of document.documentElement and document.body, are supported", "instead": "element handles from refs (getBoundingClientRect, focus, contains, addEventListener); branch on import.meta.env.BAKE_TARGET === 'web' for web-only code" },
|
|
292
|
+
"window": { "why": "there is no DOM window on native targets", "instead": "globalThis, or branch on import.meta.env.BAKE_TARGET === 'web'" },
|
|
293
|
+
"self": { "why": "there is no DOM window on native targets", "instead": "globalThis" },
|
|
294
|
+
"navigator": { "why": "there is no navigator on native targets", "instead": "import.meta.env.BAKE_TARGET, or a native module" },
|
|
295
|
+
"location": { "why": "there is no page URL on native targets", "instead": "read the initial URL from host.props and subscribe to incoming URLs with host.on" },
|
|
296
|
+
"history": { "why": "there is no session history on native targets", "instead": "keep the current screen in component state and handle incoming URLs with host.props and host.on" },
|
|
297
|
+
"localStorage": { "why": "there is no web storage on native targets", "instead": "a native module" },
|
|
298
|
+
"sessionStorage": { "why": "there is no web storage on native targets", "instead": "a native module" },
|
|
299
|
+
"indexedDB": { "why": "there is no web storage on native targets", "instead": "a native module" },
|
|
300
|
+
"XMLHttpRequest": { "why": "there is no XMLHttpRequest on native targets", "instead": "fetch" },
|
|
301
|
+
"WebSocket": { "why": "there is no WebSocket on native targets yet (fetch is supported)", "instead": "fetch polling, or a native module" },
|
|
302
|
+
"EventSource": { "why": "there is no EventSource on native targets", "instead": "a native module" },
|
|
303
|
+
"File": { "why": "there is no File on native targets", "instead": "a native module" },
|
|
304
|
+
"FileReader": { "why": "there is no FileReader on native targets", "instead": "a native module" },
|
|
305
|
+
"FormData": { "why": "there is no FormData on native targets (fetch bodies: string, URLSearchParams, Blob, ArrayBuffer)", "instead": "URLSearchParams or JSON" },
|
|
306
|
+
"crypto.subtle": { "why": "there is no SubtleCrypto on native targets: crypto has only getRandomValues and randomUUID (from the OS random source)", "instead": "a native module, or branch on import.meta.env.BAKE_TARGET" },
|
|
307
|
+
"structuredClone": { "why": "Hermes has no structuredClone", "instead": "JSON.parse(JSON.stringify(x)) or a copy function" },
|
|
308
|
+
"prompt": { "why": "there is no system text-input dialog on every native target (alert and confirm are supported)", "instead": "<dialog> with an <input>" },
|
|
309
|
+
"matchMedia": { "why": "there is no matchMedia on native targets", "instead": "CSS @media" },
|
|
310
|
+
"ResizeObserver": { "why": "there are no DOM observers on native targets", "instead": "onLayout" },
|
|
311
|
+
"IntersectionObserver": { "why": "there are no DOM observers on native targets", "instead": { "react": "List from @bake-native/react", "octane": "VirtualList from @bake-native/octane" } },
|
|
312
|
+
"MutationObserver": { "why": "there are no DOM observers on native targets", "instead": "update component state when the underlying data changes" },
|
|
313
|
+
"Image": { "why": "images are not loaded on native targets", "instead": "nothing yet" },
|
|
314
|
+
"Event": { "why": "there are no DOM events on native targets", "instead": "plain callbacks" },
|
|
315
|
+
"CustomEvent": { "why": "there are no DOM events on native targets", "instead": "plain callbacks" },
|
|
316
|
+
"EventTarget": { "why": "there are no DOM events on native targets", "instead": "plain callbacks" },
|
|
317
|
+
"MessageChannel": { "why": "there are no message channels on native targets", "instead": "queueMicrotask / setTimeout" },
|
|
318
|
+
"setImmediate": { "why": "there is no setImmediate on native targets", "instead": "setTimeout(fn, 0)" },
|
|
319
|
+
"Worker": { "why": "there are no workers on native targets", "instead": "a native module" },
|
|
320
|
+
"process": { "why": "there is no Node.js process on native targets", "instead": "import.meta.env" },
|
|
321
|
+
"Buffer": { "why": "there is no Node.js Buffer on native targets", "instead": "Uint8Array / TextEncoder" },
|
|
322
|
+
"require": { "why": "there is no CommonJS require at run time", "instead": "import" },
|
|
323
|
+
"devicePixelRatio": { "why": "there is no DOM window on native targets", "instead": "CSS @media (resolution)" },
|
|
324
|
+
"innerWidth": { "why": "there is no DOM window on native targets", "instead": "onLayout, or CSS @media" },
|
|
325
|
+
"innerHeight": { "why": "there is no DOM window on native targets", "instead": "onLayout, or CSS @media" },
|
|
326
|
+
"scrollTo": { "why": "there is no DOM window on native targets", "instead": "nothing yet" },
|
|
327
|
+
"open": { "why": "there is no DOM window on native targets", "instead": "<a href>" },
|
|
328
|
+
"print": { "why": "Hermes's print is not a web API", "instead": "console.log" },
|
|
329
|
+
"HermesInternal": { "why": "Hermes internals are not a web API", "instead": "nothing" }
|
|
330
|
+
}
|
|
331
|
+
},
|
|
332
|
+
"modules": {
|
|
333
|
+
"$comment": "The framework's build units of the system modules that were @bake-native/octane subpaths (now registry modules an app adds with bake add; importing the subpath is a build error, src/build.mjs MOVED_MODULES). A bundle that calls one of these names without its own native/<name> links the unit. `targets`: the native targets with a unit. `build`: the module's build unit per host family: apple, the SwiftPM product, the class and its sources; android, the Gradle project, its directory and the class (created with the view's Context); windows, the bake-host-windows cargo feature. An app links a module only when its bundles use it: `bake build` records them in manifest.json `requires.modules` and generates the registration (src/native-link.mjs, `bake native link`).",
|
|
334
|
+
"@bake-native/octane/clipboard": { "native": "Clipboard", "id": "module-clipboard", "targets": ["ios", "mac"], "why": "this target's host does not implement the Clipboard module yet", "instead": "branch on import.meta.env.BAKE_TARGET === 'web' around the call, or register your own native module",
|
|
335
|
+
"build": { "apple": { "product": "BakeNativeModuleClipboard", "class": "ClipboardModule", "sources": "native/modules/clipboard" } } },
|
|
336
|
+
"@bake-native/octane/linking": { "native": "Linking", "id": "module-linking", "targets": ["windows", "ios", "mac"], "why": "this target's host does not implement the Linking module yet (Windows, iOS and macOS do)", "instead": "branch on import.meta.env.BAKE_TARGET === 'web' around the call, or use host.props and host.on for incoming URLs",
|
|
337
|
+
"build": { "apple": { "product": "BakeNativeModuleLinking", "class": "LinkingModule", "sources": "native/modules/linking" }, "windows": { "feature": "module-linking" } } },
|
|
338
|
+
"@bake-native/octane/share": { "native": "Share", "id": "module-share", "targets": ["android", "ios", "mac"], "why": "this target's host does not implement the Share module yet (iOS, macOS and Android do)", "instead": "branch on import.meta.env.BAKE_TARGET === 'web' around the call, or register your own native module",
|
|
339
|
+
"build": { "apple": { "product": "BakeNativeModuleShare", "class": "ShareModule", "sources": "native/modules/share" }, "android": { "project": ":modules-share", "dir": "native/android/modules-share", "class": "dev.bakenative.modules.share.ShareModule" } } }
|
|
340
|
+
},
|
|
341
|
+
"views": {
|
|
342
|
+
"$comment": "Built-in views of @bake-native/core (docs/design/native-views.md): one spec (views/<Name>.native.ts) per view. The web implements every one (a custom element); a native target only where its host implements the spec. A native bundle that keeps a view on any other target is a build error (view-<name>). A view with an \"element\" is the player behind that built-in element (Video: <video>, bake_core::media): no JS component; rendering the element links it. An app declares its own views in native/views/<Name>.native.ts (or the older <Name>.view.json) with their implementations in package.json \"bakenative\": { \"views\": { \"<Name>\": { \"apple\" | \"android\": <path> } } }. `build`: the view's build unit per host family, as for modules: an app links a view only when its bundles use it (manifest.json requires.views, BakeNativeAppViews).",
|
|
343
|
+
"Video": { "spec": "views/Video.native.ts", "element": "video", "id": "view-video", "targets": ["windows", "mac", "ios", "android"], "why": "a target whose host has no player behind <video> (Windows: Media Foundation in a child window; iOS and macOS: AVPlayerLayer over Swift/C++ interop; Android: MediaPlayer on a TextureView through kolibri)", "instead": "branch on import.meta.env.BAKE_TARGET around <video>",
|
|
344
|
+
"build": {
|
|
345
|
+
"windows": { "feature": "view-video" },
|
|
346
|
+
"android": { "project": ":views-video", "dir": "native/android/views-video", "class": "dev.bakenative.views.video.VideoView", "jsi": "../../../packages/core/views/generated", "bridge": "VideoViewAndroid.h", "namespace": "bake::views::video::android" },
|
|
347
|
+
"apple": { "product": "BakeNativeViewVideo", "class": "VideoView", "sources": "native/views/video" } } }
|
|
348
|
+
}
|
|
349
|
+
}
|
package/native.d.ts
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
// Types for `@bake-native/core`. Module members are added by the declarations `bake native types`
|
|
2
|
+
// generates from the host's schema (they augment `NativeModules` / `HostEvents`).
|
|
3
|
+
|
|
4
|
+
/** Installed native modules, augmented by generated declarations. */
|
|
5
|
+
export interface NativeModules {}
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* What a module spec (`<Name>.native.ts`, docs/design/native-module-specs.md) extends:
|
|
9
|
+
* `export interface Clipboard extends NativeModule { readText(): Promise<string | null> }`. The
|
|
10
|
+
* spec also adds the module to `NativeModules` (`declare module '@bake-native/core'`), so
|
|
11
|
+
* `native.Clipboard` is typed; `bake build` generates each host's contract from it.
|
|
12
|
+
*/
|
|
13
|
+
export interface NativeModule {}
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* The base of a native view's spec (`<Name>.native.ts` in native/views): props are optional
|
|
17
|
+
* fields, events `onX(event: T): void`, commands methods returning a Promise
|
|
18
|
+
* (docs/design/native-views.md). Never implemented in JS: `bake native view gen` generates the
|
|
19
|
+
* component and the platform bases from it.
|
|
20
|
+
*/
|
|
21
|
+
export interface NativeView {}
|
|
22
|
+
/** An integer (a JS number with an integer check): Swift `Int`, Kotlin `Long`, Rust `i64` in a spec. */
|
|
23
|
+
export type Int = number;
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* What an event of a spec returns: `onChange(listener: (value: T) => void): Unsubscribe`. Calling it
|
|
27
|
+
* removes that listener (twice does nothing). The native source runs while at least one listener of
|
|
28
|
+
* the event is subscribed, once however many there are.
|
|
29
|
+
*/
|
|
30
|
+
export type Unsubscribe = () => void;
|
|
31
|
+
|
|
32
|
+
/** Host ⇄ JS events by name, augmented by apps: `interface HostEvents { deeplink: string }`. */
|
|
33
|
+
export interface HostEvents {
|
|
34
|
+
[name: string]: unknown;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/** An error thrown (sync) or rejected (async) by a native function. */
|
|
38
|
+
export interface NativeError extends Error {
|
|
39
|
+
code: 'E_ARGUMENT' | 'E_NATIVE' | 'E_UNAVAILABLE' | 'E_UNKNOWN_MODULE' | 'E_UNKNOWN_FUNCTION' | (string & {});
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export declare const native: NativeModules;
|
|
43
|
+
export declare function hasNative(path: string): boolean;
|
|
44
|
+
export declare function registerWebModule<K extends keyof NativeModules>(name: K, impl: Partial<NativeModules[K]>): void;
|
|
45
|
+
export declare function registerWebModule(name: string, impl: Record<string, unknown>): void;
|
|
46
|
+
|
|
47
|
+
export declare const host: {
|
|
48
|
+
on<K extends keyof HostEvents & string>(name: K, handler: (payload: HostEvents[K]) => void): () => void;
|
|
49
|
+
/** Removed: JS -> native goes through a native module the screen registers (`native.<Module>`). */
|
|
50
|
+
emit?: never;
|
|
51
|
+
readonly props: Record<string, unknown>;
|
|
52
|
+
};
|