@ng-native/web 0.8.0 → 0.10.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/dist/browser-engine.d.ts +2 -0
- package/dist/browser-engine.js +32 -0
- package/dist/browser-engine.js.map +1 -1
- package/dist/props.js +12 -0
- package/dist/props.js.map +1 -1
- package/dist/reset-css.d.ts +1 -1
- package/dist/reset-css.js +26 -0
- package/dist/reset-css.js.map +1 -1
- package/dist/reset.css +46 -0
- package/package.json +9 -9
package/dist/browser-engine.d.ts
CHANGED
|
@@ -136,6 +136,8 @@ export declare class BrowserEngine extends HostEngine {
|
|
|
136
136
|
* and the event a paging carousel reads its page from, which never arrived here at all.
|
|
137
137
|
*/
|
|
138
138
|
private wireScroll;
|
|
139
|
+
/** Each field's last reported selection, kept across a swap, which keeps the selection too. */
|
|
140
|
+
private readonly selections;
|
|
139
141
|
private wireTextInput;
|
|
140
142
|
private wireSwitch;
|
|
141
143
|
/**
|
package/dist/browser-engine.js
CHANGED
|
@@ -101,6 +101,7 @@ const ENGINE_EVENTS = new Set([
|
|
|
101
101
|
'topScroll',
|
|
102
102
|
'topEndReached',
|
|
103
103
|
'topSelectionChange',
|
|
104
|
+
'topKeyPress',
|
|
104
105
|
'topMomentumScrollBegin',
|
|
105
106
|
'topMomentumScrollEnd',
|
|
106
107
|
'topTouchStart',
|
|
@@ -389,6 +390,8 @@ export class BrowserEngine extends HostEngine {
|
|
|
389
390
|
this.dispatchEvent(node, 'topMomentumScrollEnd', offsets());
|
|
390
391
|
});
|
|
391
392
|
}
|
|
393
|
+
/** Each field's last reported selection, kept across a swap, which keeps the selection too. */
|
|
394
|
+
selections = new WeakMap();
|
|
392
395
|
wireTextInput(node) {
|
|
393
396
|
const el = node.el;
|
|
394
397
|
const nextCount = () => {
|
|
@@ -399,6 +402,35 @@ export class BrowserEngine extends HostEngine {
|
|
|
399
402
|
el.addEventListener('input', () => {
|
|
400
403
|
this.dispatchEvent(node, 'topChange', { text: el.value, eventCount: nextCount(), target: 0 });
|
|
401
404
|
});
|
|
405
|
+
// `(keyPress)` names a key as a device does: `Backspace`, `Enter`, or the character typed.
|
|
406
|
+
// A device reports only keys that edit the field, so arrows, modifiers and shortcuts send
|
|
407
|
+
// nothing, nor does a key inside an IME composition or one pressed on a read-only field.
|
|
408
|
+
el.addEventListener('keydown', (event) => {
|
|
409
|
+
if (event.isComposing || event.keyCode === 229 || event.metaKey || el.readOnly)
|
|
410
|
+
return;
|
|
411
|
+
if (event.ctrlKey && !event.getModifierState('AltGraph'))
|
|
412
|
+
return;
|
|
413
|
+
const { key } = event;
|
|
414
|
+
if (key !== 'Backspace' && key !== 'Enter' && [...key].length !== 1)
|
|
415
|
+
return;
|
|
416
|
+
this.dispatchEvent(node, 'topKeyPress', {
|
|
417
|
+
key,
|
|
418
|
+
eventCount: this.eventCounts.get(node) ?? 0,
|
|
419
|
+
target: 0,
|
|
420
|
+
});
|
|
421
|
+
});
|
|
422
|
+
// A caret moved by a click, an arrow or typing, and a range selected, each report once.
|
|
423
|
+
const reportSelection = () => {
|
|
424
|
+
const start = el.selectionStart ?? 0;
|
|
425
|
+
const end = el.selectionEnd ?? start;
|
|
426
|
+
if (this.selections.get(node) === `${start}:${end}`)
|
|
427
|
+
return;
|
|
428
|
+
this.selections.set(node, `${start}:${end}`);
|
|
429
|
+
this.dispatchEvent(node, 'topSelectionChange', { selection: { start, end }, target: 0 });
|
|
430
|
+
};
|
|
431
|
+
for (const type of ['selectionchange', 'select', 'input']) {
|
|
432
|
+
el.addEventListener(type, reportSelection);
|
|
433
|
+
}
|
|
402
434
|
el.addEventListener('focus', () => {
|
|
403
435
|
if (el.hasAttribute('data-select-on-focus'))
|
|
404
436
|
el.select();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"browser-engine.js","sourceRoot":"","sources":["../src/browser-engine.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,EACL,aAAa,EACb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AAC,CAAC;QAC/C,CAAC;QACD,IAAI,CAAC,aAAa,CAAC,MAAM,EAAE,iBAAiB,CAAC,OAAO,CAAE,EAAE;YACtD,KAAK,EAAE,KAAK,CAAC,KAAK;YAClB,KAAK,EAAE,KAAK,CAAC,KAAK;YAClB,UAAU,EAAE,KAAK,CAAC,SAAS;SAC5B,CAAC,CAAC;IACL,CAAC;IAEO,aAAa,CAAC,KAAiB,EAAE,OAAgB;QACvD,MAAM,IAAI,GAAG,aAAa,CAAC,KAAK,CAAC,MAAwB,CAAC,CAAC;QAC3D,IAAI,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC;YAAE,OAAO;QAC3C,IAAI,OAAO;YAAE,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC;aAChC,IAAI,IAAI,CAAC,WAAW,KAAK,IAAI;YAAE,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC;QAC5D,IAAI,CAAC,aAAa,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,SAAS,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC,CAAC;IAC5E,CAAC;CACF","sourcesContent":["/**\n * `HostEngine` over real DOM APIs: the browser counterpart to `packages/fabric/src/engine.ts`'s\n * `Engine`.\n *\n * One instance per `mount()` call. It owns the prop/DOM translation (`props.ts`), the element\n * mapping (`elements.ts`), and the responder negotiation (`responder.ts`); this file is mostly\n * the wiring between them and the handful of DOM event listeners the whole tree shares - one\n * `pointerdown`/`pointermove`/`pointerup`/`pointercancel` set on `document` for the responder\n * system, one `focusin`/`focusout` set for `:focus` tracking, because both need to see every\n * node's events rather than each node installing its own (Fabric's own engine is exactly this\n * shape: one `registerEventHandler` callback for the whole tree, not one per view).\n *\n * `dispatchEvent` mirrors `engine.ts`'s method of the same name step for step: run the responder\n * negotiation first, then propagate to whatever `(eventName)` bindings are listening, in the\n * same two-phase order a real touch would arrive in on native.\n */\nimport {\n DIRECT_EVENTS,\n HostEngine,\n SyntheticEvent,\n type ResponderEvent,\n type ResponderHandlers,\n type WindowFrame,\n} from '@ng-native/fabric';\nimport {\n makeAnchorNode,\n makeElementNode,\n makeTextNode,\n nearestNodeOf,\n nodeOf,\n rebindElement,\n type BrowserNode,\n} from './dom-node.ts';\nimport { createDomElement, textFieldLike } from './elements.ts';\nimport { applyProp } from './props.ts';\nimport { ResponderSystem } from './responder.ts';\n\nconst TOUCH_EVENT_NAMES: Record<string, string> = {\n pointerdown: 'topTouchStart',\n pointermove: 'topTouchMove',\n pointerup: 'topTouchEnd',\n pointercancel: 'topTouchCancel',\n};\n\nfunction scrollToEnd(el: HTMLElement, args: readonly unknown[]): void {\n const [animated = true] = args as [boolean?];\n const horizontal = el.scrollWidth > el.clientWidth && el.scrollHeight <= el.clientHeight;\n el.scrollTo(\n horizontal\n ? { left: el.scrollWidth, behavior: animated ? 'smooth' : 'auto' }\n : { top: el.scrollHeight, behavior: animated ? 'smooth' : 'auto' },\n );\n}\n\n/** Focuses `field` with the caret or selection `old` had, as a field swapped in for it. */\nfunction focusLike(field: HTMLInputElement | HTMLTextAreaElement, old: typeof field): void {\n field.focus();\n const { selectionStart, selectionEnd, selectionDirection } = old;\n if (selectionStart === null || selectionEnd === null) return;\n field.setSelectionRange(selectionStart, selectionEnd, selectionDirection ?? undefined);\n}\n\nfunction setTextAndSelection(el: HTMLElement, args: readonly unknown[]): void {\n const [, text, start, end] = args as [number, string | null, number, number];\n const textarea = el as HTMLTextAreaElement;\n if (text !== null && text !== undefined) textarea.value = text;\n if (start !== -1) textarea.setSelectionRange(start, end === -1 ? start : end);\n}\n\n/**\n * View commands, by name. A lookup table for the same reason `props.ts`'s tables are one: it is\n * where a review sees which commands do something and which do not, in one place, rather than\n * spread across a `switch`'s branches.\n *\n * `flashScrollIndicators`, `zoomToRect`, `hotspotUpdate`, `setPressed`, `setNativeRefreshing`:\n * no web equivalent (a browser's scrollbar has no imperative \"flash\", pinch-zoom is not\n * scriptable, and there is no Android ripple to drive) - absent rather than a `noop` entry,\n * because unlike a prop there is no generic fallback for a command name to fall through to; an\n * absent command is already silently ignored below.\n */\nconst COMMANDS: Record<string, (el: HTMLElement, args: readonly unknown[]) => void> = {\n focus: (el) => el.focus(),\n blur: (el) => el.blur(),\n scrollTo: (el, args) => {\n const [x = 0, y = 0, animated = true] = args as [number?, number?, boolean?];\n el.scrollTo({ left: x, top: y, behavior: animated ? 'smooth' : 'auto' });\n },\n scrollToEnd,\n setTextAndSelection,\n // `<switch>` putting back a flip the app refused; the checkbox is what the user clicked.\n setValue: (el, [value]) => {\n (el as HTMLInputElement).checked = value === true;\n },\n};\n\n/**\n * The events this engine owns, which are React Native's rather than the DOM's.\n *\n * Each is either synthesised here from something else - `topLayout` from a `ResizeObserver`,\n * `topTouch*` from pointer events, `topFocus` from `focusin` - or not implemented yet. Either way\n * a handler bound to one expects React Native's `{ nativeEvent }` payload with React Native's own\n * fields in it, so they must not be wired straight to the DOM event of the same name: a\n * `scroll-view`'s `(scroll)` reads `nativeEvent.contentOffset`, and handing it a raw DOM `Event`\n * would turn a binding that quietly does nothing into one that throws on the first scroll.\n *\n * The list is the events `@ng-native/components` actually binds, found by\n * reading their host and template bindings rather than guessed. Anything outside it is a plain\n * DOM event and is bound as one.\n *\n * `topLoad` and `topError` are deliberately *not* here, though an `<image>` binds both. A\n * background image fires neither on its own, so `props.ts` loads the URL with a detached `Image()`\n * and dispatches a real DOM `load` or `error` on the element - which means there is a genuine DOM\n * event of each name to bind, and the general path is the right one. Reserving them was what left\n * a broken image URL blank rather than showing a fallback.\n */\nconst ENGINE_EVENTS = new Set([\n 'topLayout',\n 'topChange',\n 'topContentSizeChange',\n 'topRefresh',\n 'topScroll',\n 'topEndReached',\n 'topSelectionChange',\n 'topMomentumScrollBegin',\n 'topMomentumScrollEnd',\n 'topTouchStart',\n 'topTouchMove',\n 'topTouchEnd',\n 'topTouchCancel',\n 'topFocus',\n 'topBlur',\n 'topPointerEnter',\n 'topPointerLeave',\n]);\n\nexport class BrowserEngine extends HostEngine {\n private readonly document: Document;\n private readonly responders = new ResponderSystem();\n private focusedNode: BrowserNode | null = null;\n /** `TextInput`'s echo protocol: a change count that only ever goes up. One counter per field. */\n private readonly eventCounts = new WeakMap<BrowserNode, number>();\n /** Mount points `wrapRoot` wrapped; see `isRoot`. */\n private readonly roots = new WeakSet<BrowserNode>();\n /**\n * The node each in-progress gesture began on, by `pointerId`, so `pointermove`/`pointerup`\n * resolve to the same node however far the finger has travelled - `setPointerCapture` keeps\n * the browser routing them there; this is what this class trusts instead of re-reading\n * `event.target`. Keyed by `pointerId` rather than holding just one, so two fingers on two\n * different controls (a phone reports multi-touch) do not clobber each other.\n */\n private readonly activeTouches = new Map<number, BrowserNode>();\n /**\n * The element nodes this engine made, and so the only ones its document listeners act for.\n *\n * Every engine listens on the one `document`, and a page can hold several - one per island, or\n * the documentation site's three roots - while `nearestNodeOf` finds a node whichever engine\n * made it. Without this, each engine delivered every focus, blur and touch in any root on the\n * page, so a text field's `(blur)` ran once per island.\n */\n private readonly owned = new WeakSet<BrowserNode>();\n /** Removes the document listeners, once the app they served is gone; see `dispose`. */\n private readonly listening: AbortController;\n\n constructor(document: Document) {\n super();\n this.document = document;\n // The document's own, so the signal is one its `addEventListener` recognises.\n this.listening = new (document.defaultView?.AbortController ?? AbortController)();\n this.installGlobalListeners();\n }\n\n /** Stop listening to the document. `mount` calls this as its app is destroyed. */\n dispose(): void {\n this.listening.abort();\n this.activeTouches.clear();\n }\n\n // --- element creation, called from BrowserRenderer ----------------------------------------\n\n createElementNode(name: string): BrowserNode {\n const el = createDomElement(this.document, name);\n const node = makeElementNode(name, el);\n this.owned.add(node);\n this.wireAlwaysOnListeners(node);\n return node;\n }\n\n createTextNode(value: string): BrowserNode {\n return makeTextNode(this.document.createTextNode(value));\n }\n\n createAnchorNode(): BrowserNode {\n return makeAnchorNode(this.document.createComment(''));\n }\n\n /**\n * Wrap an existing real element - the app's own mount point - as the tree's root node.\n *\n * `ngSkipHydration` is Angular's own opt-out, and true of every tree this engine renders: none\n * is server-rendered, so there is no markup to reuse. With hydration on, Angular reads it on a\n * root component's host element, and without it walks that element's DOM for text markers,\n * which a node is not.\n */\n wrapRoot(el: Element): BrowserNode {\n const node = makeElementNode(el.tagName.toLowerCase(), el);\n el.setAttribute('data-rn', 'root');\n el.setAttribute('ngSkipHydration', '');\n this.roots.add(node);\n this.owned.add(node);\n return node;\n }\n\n /**\n * Whether `node` is a mount point `wrapRoot` wrapped. It belongs to whoever called `mount`, not\n * to the app rendered into it, so the renderer empties it rather than removing it.\n */\n isRoot(node: BrowserNode): boolean {\n return this.roots.has(node);\n }\n\n // --- HostEngine -----------------------------------------------------------------------------\n\n setProp(node: BrowserNode, key: string, value: unknown): void {\n const clear = value === undefined || value === null;\n if (clear) {\n if (!(key in node.props)) return;\n delete node.props[key];\n } else {\n if (node.props[key] === value) return;\n node.props[key] = value;\n }\n if (key === 'multiline' && node.name === 'text-input') this.fieldFor(node, value === true);\n applyProp(node, key, value, clear);\n }\n\n /**\n * A `<textarea>` for a multiline field and an `<input>` for a one-line one, swapped in place when\n * `multiline` arrives, which is after the element was made (see `elements.ts`).\n *\n * The new element takes the old one's attributes (inline style and scoping attributes among\n * them), its value, its focus and its selection, and the engine's own listeners are installed on it again.\n */\n private fieldFor(node: BrowserNode, multiline: boolean): void {\n const old = node.el as HTMLInputElement | HTMLTextAreaElement;\n if ((old.tagName === 'TEXTAREA') === multiline) return;\n const field = textFieldLike(old, multiline);\n // An input strips line breaks from its value, so text set before `multiline` lost them. Taken\n // from the prop again unless the user has typed since.\n const text = node.props['text'];\n if (multiline && text != null && old.value === String(text).replace(/[\\r\\n]/g, '')) {\n field.value = String(text);\n }\n const focused = this.document.activeElement === old;\n this.layoutObservers.get(node)?.disconnect();\n old.replaceWith(field);\n rebindElement(node, field);\n this.wireAlwaysOnListeners(node);\n const optedIn = node.optedIn;\n node.optedIn = null;\n for (const type of optedIn ?? []) this.wireOptIn(node, type);\n for (const key of ['secureTextEntry', 'keyboardType', 'numberOfLines']) {\n if (key in node.props) applyProp(node, key, node.props[key], false);\n }\n if (focused) focusLike(field, old);\n }\n\n /** Each node's `topLayout` observer, so a field swapped for another stops watching the old one. */\n private readonly layoutObservers = new WeakMap<BrowserNode, ResizeObserver>();\n\n setEventListener(\n node: BrowserNode,\n topLevelType: string,\n fn: (event: unknown) => void,\n ): () => void {\n const listeners = (node.listeners ??= new Map());\n let set = listeners.get(topLevelType);\n if (!set) listeners.set(topLevelType, (set = new Set()));\n set.add(fn);\n this.wireOptIn(node, topLevelType);\n return () => set!.delete(fn);\n }\n\n setResponder(node: BrowserNode, handlers: ResponderHandlers): () => void {\n return this.responders.setResponder(node, handlers);\n }\n\n /**\n * Where a node is, relative to the mount root rather than to the viewport.\n *\n * `measureInWindow` on native answers in window coordinates, and the overlay host is a\n * full-screen absolutely positioned view at the window's origin, so the two agree and an\n * anchored overlay can use one as the other. `getBoundingClientRect` answers in *viewport*\n * coordinates, and `<overlay-host>` is absolutely positioned inside the mount root - so\n * those two agree only when the root sits at the top left of an unscrolled viewport.\n *\n * That is true of a full-page app, which is why every popover in the gallery lands correctly\n * and this went unnoticed. It is false in the two cases that matter: an app mounted into a box\n * partway down a page, where every overlay is offset by the box's own position, and a document\n * that scrolls, where the offset changes as you scroll. Subtracting the root's own rect from a\n * viewport-relative one cancels the scroll term as well as the offset, since both rects move\n * together as the page scrolls - so one subtraction fixes both cases at once.\n *\n * `closest`, not `querySelector`: a page can hold more than one mounted root at a time (the\n * documentation site's own home page does, three of them), and `querySelector` always answers\n * the first one in document order regardless of which root's own tree `node` actually lives in.\n * That made every root after the first measure its overlays against someone else's box.\n * `closest` walks up from the node itself, so each root only ever measures against its own.\n */\n measure(node: BrowserNode, into: (frame: WindowFrame) => void): void {\n const el = node.el as Element;\n const rect = el.getBoundingClientRect();\n const root = el.closest('[data-rn-root]');\n const origin = root ? root.getBoundingClientRect() : { x: 0, y: 0 };\n into({ x: rect.x - origin.x, y: rect.y - origin.y, width: rect.width, height: rect.height });\n }\n\n dispatchCommand(node: BrowserNode, name: string, args: readonly unknown[] = []): void {\n COMMANDS[name]?.(node.el as HTMLElement, args);\n }\n\n /**\n * The scoping attribute Angular's emulated encapsulation stamps on `like`, stamped on `node`,\n * or taken off again when `like` is null.\n */\n override adoptScope(node: BrowserNode, like: BrowserNode | null): void {\n const el = node.el as Element;\n for (const name of this.adopted.get(node) ?? []) el.removeAttribute(name);\n const names = like\n ? [...(like.el as Element).attributes]\n .map((attribute) => attribute.name)\n .filter((name) => name.startsWith('_ngcontent-') && !el.hasAttribute(name))\n : [];\n for (const name of names) el.setAttribute(name, '');\n this.adopted.set(node, names);\n }\n\n /** The scoping attributes `adoptScope` added to each node, which it alone takes off. */\n private readonly adopted = new WeakMap<BrowserNode, string[]>();\n\n commit(): boolean {\n // Every write above already reached the DOM synchronously; there is nothing batched to flush.\n return false;\n }\n\n get focused(): BrowserNode | null {\n if (this.focusedNode && !this.isAttached(this.focusedNode)) this.focusedNode = null;\n return this.focusedNode;\n }\n\n private isAttached(node: BrowserNode): boolean {\n return (node.el as Element).isConnected;\n }\n\n /**\n * A `require()`d numeric asset has no web analogue - there is no bundler-provided asset\n * registry this package can read at runtime - so it resolves to nothing rather than a guess.\n * A `{uri}` source, or an array of them, passes through unchanged: `props.ts`'s image handler\n * reads it directly.\n */\n resolveAsset(value: unknown): unknown {\n if (typeof value === 'number') return undefined;\n return value;\n }\n\n /**\n * A colour the app wrote is passed straight through: CSS accepts the same hex/rgb/named\n * strings RN does. `platform-color(...)`'s semantic iOS/Android names have no web colour\n * system to resolve against, so they resolve to nothing rather than to a wrong guess.\n */\n color(value: unknown): unknown {\n if (value === undefined) return undefined;\n if (typeof value === 'object' && value !== null && 'platformColor' in value) return undefined;\n return value;\n }\n\n // --- event dispatch, mirrors engine.ts's `dispatchEvent` -----------------------------------\n\n dispatchEvent(target: BrowserNode, topLevelType: string, nativeEvent: unknown): void {\n const event = new SyntheticEvent(nativeEvent, target) as ResponderEvent & SyntheticEvent;\n if (topLevelType.startsWith('topTouch'))\n this.responders.runResponder(target, topLevelType, event);\n this.propagate(target, topLevelType, event);\n }\n\n /** As on native: a listener that stops the event ends the bubble after its own node. */\n private propagate(target: BrowserNode, topLevelType: string, event: SyntheticEvent): void {\n for (\n let node: BrowserNode | null = target;\n node && !event.isPropagationStopped();\n node = DIRECT_EVENTS.has(topLevelType) ? null : node.parent\n ) {\n const listeners = node.listeners?.get(topLevelType);\n if (listeners) for (const fn of [...listeners]) fn(event);\n }\n }\n\n // --- always-on listeners, installed once per element at creation ---------------------------\n\n private wireAlwaysOnListeners(node: BrowserNode): void {\n if (node.name === 'scroll-view' || node.name === 'virtual-list') this.wireScroll(node);\n if (node.name === 'text-input') this.wireTextInput(node);\n if (node.name === 'switch') this.wireSwitch(node);\n }\n\n /**\n * `scroll` does not bubble, so this is a real per-node listener rather than a document one.\n *\n * `scrollend` is the browser saying the scroll has come to rest, whatever moved it: a wheel's\n * or a trackpad's glide, a flick, or an animated `scrollTo`. That is the moment a device reports\n * as `(momentumScrollEnd)` - iOS sends it after an animated `scrollTo` as well as after a fling -\n * and the event a paging carousel reads its page from, which never arrived here at all.\n */\n private wireScroll(node: BrowserNode): void {\n const el = node.el as HTMLElement;\n const offsets = () => ({\n contentOffset: { x: el.scrollLeft, y: el.scrollTop },\n contentSize: { width: el.scrollWidth, height: el.scrollHeight },\n layoutMeasurement: { width: el.clientWidth, height: el.clientHeight },\n contentInset: { top: 0, left: 0, bottom: 0, right: 0 },\n zoomScale: 1,\n });\n el.addEventListener('scroll', () => {\n this.responders.notifyScroll(node);\n this.dispatchEvent(node, 'topScroll', offsets());\n });\n el.addEventListener('scrollend', () => {\n this.dispatchEvent(node, 'topMomentumScrollEnd', offsets());\n });\n }\n\n private wireTextInput(node: BrowserNode): void {\n const el = node.el as HTMLTextAreaElement;\n const nextCount = () => {\n const count = (this.eventCounts.get(node) ?? 0) + 1;\n this.eventCounts.set(node, count);\n return count;\n };\n el.addEventListener('input', () => {\n this.dispatchEvent(node, 'topChange', { text: el.value, eventCount: nextCount(), target: 0 });\n });\n el.addEventListener('focus', () => {\n if (el.hasAttribute('data-select-on-focus')) el.select();\n });\n el.addEventListener('blur', () => {\n this.dispatchEvent(node, 'topEndEditing', {\n text: el.value,\n eventCount: nextCount(),\n target: 0,\n });\n });\n // `Enter` does what `submitBehavior` says, as on a device: `newline` inserts one, `submit`\n // submits and keeps focus, and `blurAndSubmit` submits and then lets go of the field. The\n // component resolves the default, `blurAndSubmit` on one line and `newline` on many; the\n // fallback here is the same rule, for a field whose binding has not landed yet. An `Enter`\n // that confirms an IME composition belongs to the composition, not to the field.\n el.addEventListener('keydown', (event) => {\n if (event.key !== 'Enter' || event.isComposing) return;\n const behavior =\n node.props['submitBehavior'] ??\n (el.hasAttribute('data-multiline') ? 'newline' : 'blurAndSubmit');\n if (behavior === 'newline') return;\n event.preventDefault();\n this.dispatchEvent(node, 'topSubmitEditing', {\n text: el.value,\n eventCount: nextCount(),\n target: 0,\n });\n if (behavior === 'blurAndSubmit') el.blur();\n });\n }\n\n private wireSwitch(node: BrowserNode): void {\n const el = node.el as HTMLInputElement;\n el.addEventListener('change', () => {\n this.dispatchEvent(node, 'topChange', { value: el.checked, target: 0 });\n });\n }\n\n /**\n * `topLayout` and hover, opted into once per node the first time something listens for them -\n * never torn down again, exactly as `engine.ts`'s own `EVENT_OPT_IN_PROPS` never unsets the\n * native prop it wrote either. A second listener for the same type on the same node (unusual,\n * but not forbidden) shares the one observer rather than getting a duplicate.\n */\n private wireOptIn(node: BrowserNode, topLevelType: string): void {\n const optedIn = (node.optedIn ??= new Set());\n if (optedIn.has(topLevelType)) return;\n optedIn.add(topLevelType);\n\n if (topLevelType === 'topLayout') {\n /*\n * The observer says *when*, and the bounding rect says *how big*. The size deliberately\n * does not come from the entry's `contentBoxSize`, which is what it used to come from.\n *\n * Yoga lays out border-box: a React Native view styled `width: 192` with `padding: 16` and\n * a hairline border is 192 wide, and `onLayout` reports 192. `contentBoxSize` is the CSS\n * *content* box, so the same element in a browser reported 158 - the padding and the border\n * subtracted. Every `(layout)` consumer in the library was therefore being handed a size\n * smaller than its native counterpart by however much padding the element happened to have,\n * and each one used it for something different: an accordion animated to a height that cut\n * its own padding off, and an anchored overlay both centred itself on a width it did not\n * have and decided it had room on a side where it did not, because `fits()` was asked about\n * a shorter card than the one about to be painted.\n *\n * `measure()` in this same file has always answered from `getBoundingClientRect()`, which\n * is the border box - so the engine was reporting two different sizes for one element\n * depending on which way you asked. This is the half that was wrong.\n *\n * `x`/`y` are the other half, and a different frame from `measure()`'s: `engine.ts`'s own\n * doc comment for `measure()` says it plainly - \"`(layout)` reports a frame in the parent's\n * coordinates\" - because a layout tells a view how big it is and where it sits inside\n * whatever it is stacked in, not where it is on screen. Reporting the raw viewport rect here\n * answered a question nothing asked: a consumer that reads `layout.y` as an item's offset\n * within its scrolling parent compares it against a scroll position in that same space, so\n * a viewport-relative `y` was wrong by the scroll container's own position on the page - right only for a scroll view\n * pinned at the top of an unscrolled full-page app, wrong the moment it sits lower on the\n * page or the page itself scrolls. Subtracting the immediate DOM parent's rect - never an\n * anchor comment; `browser-renderer.ts`'s `appendChild`/`insertBefore` only ever set\n * `child.parent` to a node backed by a real element - puts it back in the parent's frame.\n */\n const observer = new ResizeObserver(() => {\n const rect = (node.el as Element).getBoundingClientRect();\n const parent = node.parent?.el as Element | undefined;\n const origin = parent ? parent.getBoundingClientRect() : { x: 0, y: 0 };\n this.dispatchEvent(node, 'topLayout', {\n layout: {\n x: rect.x - origin.x,\n y: rect.y - origin.y,\n width: rect.width,\n height: rect.height,\n },\n });\n });\n observer.observe(node.el as Element);\n this.layoutObservers.set(node, observer);\n return;\n }\n if (topLevelType === 'topPointerEnter' || topLevelType === 'topPointerLeave') {\n const domName = topLevelType === 'topPointerEnter' ? 'pointerenter' : 'pointerleave';\n (node.el as Element).addEventListener(domName, () =>\n this.dispatchEvent(node, topLevelType, {}),\n );\n return;\n }\n\n /*\n * Anything else is an ordinary DOM event, bound for real.\n *\n * Without this, `renderer.listen` put the callback in the node's map and stopped: the map is\n * only ever read by `dispatchEvent`, and nothing dispatches a `topClick`. So `(click)`,\n * `(keydown)`, `(input)` and every other plain binding registered successfully and never\n * fired - including Angular's own `RouterLink`, which is why no link in the gallery navigated\n * and no `(click)` anywhere in an app would have worked.\n *\n * The name maps straight down: DOM event types are lowercase, so `topClick` is `click` and\n * `topKeyDown` is `keydown`.\n *\n * The event reaches the handler raw, not wrapped in `{ nativeEvent }`, because that is what a\n * handler written for a browser expects - `RouterLink` reads `button`, `ctrlKey` and\n * `metaKey` off it and calls `preventDefault` itself. Returning `false` from a binding\n * prevents the default, as it does in any Angular app.\n *\n * Delivered only to this node's own listeners rather than through `propagate`, and that is\n * the subtle half. `propagate` walks this package's retained tree to emulate the bubbling\n * React Native does in JavaScript. The DOM already bubbles, so a click on a child arrives at\n * an ancestor's listener by itself, and running both would call every ancestor handler twice.\n */\n if (ENGINE_EVENTS.has(topLevelType)) return;\n (node.el as Element).addEventListener(topLevelType.slice(3).toLowerCase(), (event) => {\n for (const listener of [...(node.listeners?.get(topLevelType) ?? [])]) {\n if ((listener as (value: unknown) => unknown)(event) === false) event.preventDefault();\n }\n });\n }\n\n // --- document-level listeners, shared by the whole tree ------------------------------------\n\n private installGlobalListeners(): void {\n const on = <K extends keyof DocumentEventMap>(\n type: K,\n listener: (event: DocumentEventMap[K]) => void,\n ): void => this.document.addEventListener(type, listener, { signal: this.listening.signal });\n for (const type of ['pointerdown', 'pointermove', 'pointerup', 'pointercancel'] as const) {\n on(type, (event) => this.onPointer(event, type));\n }\n on('focusin', (event) => this.onFocusChange(event, true));\n on('focusout', (event) => this.onFocusChange(event, false));\n on('keydown', (event) => this.onKey(event, true));\n on('keyup', (event) => this.onKey(event, false));\n }\n\n /** The control a held Space is pressing, released on the matching `keyup`. */\n private keyPress: BrowserNode | null = null;\n\n /**\n * Enter and Space press the focused control, as they press a `<button>`.\n *\n * A pressable is focusable and announces itself as a button, but it presses through the\n * responder negotiation, which only pointer events drove - so a keyboard user could tab to it\n * and do nothing with it. The key becomes the same touch a finger would make, on the control\n * itself, so `pressIn`, `press` and `pressOut` all fire, in order, through the same code.\n *\n * Enter presses on the way down and Space on the way up, which is the browser's own rule for a\n * button; Space is also kept from scrolling the page. A text field and a switch are left alone,\n * because the browser's own control already does the right thing with both keys.\n */\n private onKey(event: KeyboardEvent, down: boolean): void {\n if (event.key !== 'Enter' && event.key !== ' ') return;\n const space = event.key === ' ';\n if (!down) {\n const node = this.keyPress;\n if (!space || !node) return;\n this.keyPress = null;\n this.dispatchEvent(node, 'topTouchEnd', this.keyTouch(node));\n return;\n }\n const node = this.keyTarget(event);\n if (!node) return;\n event.preventDefault();\n if (event.repeat || this.keyPress) return;\n this.dispatchEvent(node, 'topTouchStart', this.keyTouch(node));\n if (space) this.keyPress = node;\n else this.dispatchEvent(node, 'topTouchEnd', this.keyTouch(node));\n }\n\n /** The focused control a key would press, or null where the key belongs to something else. */\n private keyTarget(event: KeyboardEvent): BrowserNode | null {\n if (event.defaultPrevented || event.altKey || event.ctrlKey || event.metaKey) return null;\n const node = nodeOf(event.target as Element | null);\n if (!node || node.name === 'text-input' || node.name === 'switch') return null;\n return this.responders.responds(node) ? node : null;\n }\n\n /** A touch at the control's centre, so nothing downstream mistakes it for a drag. */\n private keyTouch(node: BrowserNode): { pageX: number; pageY: number; identifier: number } {\n const rect = (node.el as Element).getBoundingClientRect();\n return { pageX: rect.x + rect.width / 2, pageY: rect.y + rect.height / 2, identifier: -1 };\n }\n\n private onPointer(event: PointerEvent, domType: keyof typeof TOUCH_EVENT_NAMES): void {\n let target: BrowserNode | undefined;\n if (domType === 'pointerdown') {\n // A right or middle click opens a menu or a tab; only the primary button presses.\n if (event.button > 0) return;\n target = nearestNodeOf(event.target as Element | null) ?? undefined;\n if (!target || !this.owned.has(target)) return;\n this.activeTouches.set(event.pointerId, target);\n // Pins every later event in this gesture to the element the finger actually landed on,\n // regardless of where it wanders - what makes the negotiation's `target` mean the same\n // thing `topTouchMove`/`topTouchEnd` that Fabric's continuous per-finger delivery does.\n (event.target as Element).setPointerCapture?.(event.pointerId);\n } else {\n target = this.activeTouches.get(event.pointerId);\n if (!target) return;\n if (domType === 'pointerup' || domType === 'pointercancel')\n this.activeTouches.delete(event.pointerId);\n }\n this.dispatchEvent(target, TOUCH_EVENT_NAMES[domType]!, {\n pageX: event.pageX,\n pageY: event.pageY,\n identifier: event.pointerId,\n });\n }\n\n private onFocusChange(event: FocusEvent, focused: boolean): void {\n const node = nearestNodeOf(event.target as Element | null);\n if (!node || !this.owned.has(node)) return;\n if (focused) this.focusedNode = node;\n else if (this.focusedNode === node) this.focusedNode = null;\n this.dispatchEvent(node, focused ? 'topFocus' : 'topBlur', { target: 0 });\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"browser-engine.js","sourceRoot":"","sources":["../src/browser-engine.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,EACL,aAAa,EACb,UAAU,EACV,cAAc,GAIf,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,cAAc,EACd,eAAe,EACf,YAAY,EACZ,aAAa,EACb,MAAM,EACN,aAAa,GAEd,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAChE,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAEjD,MAAM,iBAAiB,GAA2B;IAChD,WAAW,EAAE,eAAe;IAC5B,WAAW,EAAE,cAAc;IAC3B,SAAS,EAAE,aAAa;IACxB,aAAa,EAAE,gBAAgB;CAChC,CAAC;AAEF,SAAS,WAAW,CAAC,EAAe,EAAE,IAAwB;IAC5D,MAAM,CAAC,QAAQ,GAAG,IAAI,CAAC,GAAG,IAAkB,CAAC;IAC7C,MAAM,UA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,KAAK,CAAC,MAAwB,CAAC,CAAC;QAC3D,IAAI,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC;YAAE,OAAO;QAC3C,IAAI,OAAO;YAAE,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC;aAChC,IAAI,IAAI,CAAC,WAAW,KAAK,IAAI;YAAE,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC;QAC5D,IAAI,CAAC,aAAa,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,SAAS,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC,CAAC;IAC5E,CAAC;CACF","sourcesContent":["/**\n * `HostEngine` over real DOM APIs: the browser counterpart to `packages/fabric/src/engine.ts`'s\n * `Engine`.\n *\n * One instance per `mount()` call. It owns the prop/DOM translation (`props.ts`), the element\n * mapping (`elements.ts`), and the responder negotiation (`responder.ts`); this file is mostly\n * the wiring between them and the handful of DOM event listeners the whole tree shares - one\n * `pointerdown`/`pointermove`/`pointerup`/`pointercancel` set on `document` for the responder\n * system, one `focusin`/`focusout` set for `:focus` tracking, because both need to see every\n * node's events rather than each node installing its own (Fabric's own engine is exactly this\n * shape: one `registerEventHandler` callback for the whole tree, not one per view).\n *\n * `dispatchEvent` mirrors `engine.ts`'s method of the same name step for step: run the responder\n * negotiation first, then propagate to whatever `(eventName)` bindings are listening, in the\n * same two-phase order a real touch would arrive in on native.\n */\nimport {\n DIRECT_EVENTS,\n HostEngine,\n SyntheticEvent,\n type ResponderEvent,\n type ResponderHandlers,\n type WindowFrame,\n} from '@ng-native/fabric';\nimport {\n makeAnchorNode,\n makeElementNode,\n makeTextNode,\n nearestNodeOf,\n nodeOf,\n rebindElement,\n type BrowserNode,\n} from './dom-node.ts';\nimport { createDomElement, textFieldLike } from './elements.ts';\nimport { applyProp } from './props.ts';\nimport { ResponderSystem } from './responder.ts';\n\nconst TOUCH_EVENT_NAMES: Record<string, string> = {\n pointerdown: 'topTouchStart',\n pointermove: 'topTouchMove',\n pointerup: 'topTouchEnd',\n pointercancel: 'topTouchCancel',\n};\n\nfunction scrollToEnd(el: HTMLElement, args: readonly unknown[]): void {\n const [animated = true] = args as [boolean?];\n const horizontal = el.scrollWidth > el.clientWidth && el.scrollHeight <= el.clientHeight;\n el.scrollTo(\n horizontal\n ? { left: el.scrollWidth, behavior: animated ? 'smooth' : 'auto' }\n : { top: el.scrollHeight, behavior: animated ? 'smooth' : 'auto' },\n );\n}\n\n/** Focuses `field` with the caret or selection `old` had, as a field swapped in for it. */\nfunction focusLike(field: HTMLInputElement | HTMLTextAreaElement, old: typeof field): void {\n field.focus();\n const { selectionStart, selectionEnd, selectionDirection } = old;\n if (selectionStart === null || selectionEnd === null) return;\n field.setSelectionRange(selectionStart, selectionEnd, selectionDirection ?? undefined);\n}\n\nfunction setTextAndSelection(el: HTMLElement, args: readonly unknown[]): void {\n const [, text, start, end] = args as [number, string | null, number, number];\n const textarea = el as HTMLTextAreaElement;\n if (text !== null && text !== undefined) textarea.value = text;\n if (start !== -1) textarea.setSelectionRange(start, end === -1 ? start : end);\n}\n\n/**\n * View commands, by name. A lookup table for the same reason `props.ts`'s tables are one: it is\n * where a review sees which commands do something and which do not, in one place, rather than\n * spread across a `switch`'s branches.\n *\n * `flashScrollIndicators`, `zoomToRect`, `hotspotUpdate`, `setPressed`, `setNativeRefreshing`:\n * no web equivalent (a browser's scrollbar has no imperative \"flash\", pinch-zoom is not\n * scriptable, and there is no Android ripple to drive) - absent rather than a `noop` entry,\n * because unlike a prop there is no generic fallback for a command name to fall through to; an\n * absent command is already silently ignored below.\n */\nconst COMMANDS: Record<string, (el: HTMLElement, args: readonly unknown[]) => void> = {\n focus: (el) => el.focus(),\n blur: (el) => el.blur(),\n scrollTo: (el, args) => {\n const [x = 0, y = 0, animated = true] = args as [number?, number?, boolean?];\n el.scrollTo({ left: x, top: y, behavior: animated ? 'smooth' : 'auto' });\n },\n scrollToEnd,\n setTextAndSelection,\n // `<switch>` putting back a flip the app refused; the checkbox is what the user clicked.\n setValue: (el, [value]) => {\n (el as HTMLInputElement).checked = value === true;\n },\n};\n\n/**\n * The events this engine owns, which are React Native's rather than the DOM's.\n *\n * Each is either synthesised here from something else - `topLayout` from a `ResizeObserver`,\n * `topTouch*` from pointer events, `topFocus` from `focusin` - or not implemented yet. Either way\n * a handler bound to one expects React Native's `{ nativeEvent }` payload with React Native's own\n * fields in it, so they must not be wired straight to the DOM event of the same name: a\n * `scroll-view`'s `(scroll)` reads `nativeEvent.contentOffset`, and handing it a raw DOM `Event`\n * would turn a binding that quietly does nothing into one that throws on the first scroll.\n *\n * The list is the events `@ng-native/components` actually binds, found by\n * reading their host and template bindings rather than guessed. Anything outside it is a plain\n * DOM event and is bound as one.\n *\n * `topLoad` and `topError` are deliberately *not* here, though an `<image>` binds both. A\n * background image fires neither on its own, so `props.ts` loads the URL with a detached `Image()`\n * and dispatches a real DOM `load` or `error` on the element - which means there is a genuine DOM\n * event of each name to bind, and the general path is the right one. Reserving them was what left\n * a broken image URL blank rather than showing a fallback.\n */\nconst ENGINE_EVENTS = new Set([\n 'topLayout',\n 'topChange',\n 'topContentSizeChange',\n 'topRefresh',\n 'topScroll',\n 'topEndReached',\n 'topSelectionChange',\n 'topKeyPress',\n 'topMomentumScrollBegin',\n 'topMomentumScrollEnd',\n 'topTouchStart',\n 'topTouchMove',\n 'topTouchEnd',\n 'topTouchCancel',\n 'topFocus',\n 'topBlur',\n 'topPointerEnter',\n 'topPointerLeave',\n]);\n\nexport class BrowserEngine extends HostEngine {\n private readonly document: Document;\n private readonly responders = new ResponderSystem();\n private focusedNode: BrowserNode | null = null;\n /** `TextInput`'s echo protocol: a change count that only ever goes up. One counter per field. */\n private readonly eventCounts = new WeakMap<BrowserNode, number>();\n /** Mount points `wrapRoot` wrapped; see `isRoot`. */\n private readonly roots = new WeakSet<BrowserNode>();\n /**\n * The node each in-progress gesture began on, by `pointerId`, so `pointermove`/`pointerup`\n * resolve to the same node however far the finger has travelled - `setPointerCapture` keeps\n * the browser routing them there; this is what this class trusts instead of re-reading\n * `event.target`. Keyed by `pointerId` rather than holding just one, so two fingers on two\n * different controls (a phone reports multi-touch) do not clobber each other.\n */\n private readonly activeTouches = new Map<number, BrowserNode>();\n /**\n * The element nodes this engine made, and so the only ones its document listeners act for.\n *\n * Every engine listens on the one `document`, and a page can hold several - one per island, or\n * the documentation site's three roots - while `nearestNodeOf` finds a node whichever engine\n * made it. Without this, each engine delivered every focus, blur and touch in any root on the\n * page, so a text field's `(blur)` ran once per island.\n */\n private readonly owned = new WeakSet<BrowserNode>();\n /** Removes the document listeners, once the app they served is gone; see `dispose`. */\n private readonly listening: AbortController;\n\n constructor(document: Document) {\n super();\n this.document = document;\n // The document's own, so the signal is one its `addEventListener` recognises.\n this.listening = new (document.defaultView?.AbortController ?? AbortController)();\n this.installGlobalListeners();\n }\n\n /** Stop listening to the document. `mount` calls this as its app is destroyed. */\n dispose(): void {\n this.listening.abort();\n this.activeTouches.clear();\n }\n\n // --- element creation, called from BrowserRenderer ----------------------------------------\n\n createElementNode(name: string): BrowserNode {\n const el = createDomElement(this.document, name);\n const node = makeElementNode(name, el);\n this.owned.add(node);\n this.wireAlwaysOnListeners(node);\n return node;\n }\n\n createTextNode(value: string): BrowserNode {\n return makeTextNode(this.document.createTextNode(value));\n }\n\n createAnchorNode(): BrowserNode {\n return makeAnchorNode(this.document.createComment(''));\n }\n\n /**\n * Wrap an existing real element - the app's own mount point - as the tree's root node.\n *\n * `ngSkipHydration` is Angular's own opt-out, and true of every tree this engine renders: none\n * is server-rendered, so there is no markup to reuse. With hydration on, Angular reads it on a\n * root component's host element, and without it walks that element's DOM for text markers,\n * which a node is not.\n */\n wrapRoot(el: Element): BrowserNode {\n const node = makeElementNode(el.tagName.toLowerCase(), el);\n el.setAttribute('data-rn', 'root');\n el.setAttribute('ngSkipHydration', '');\n this.roots.add(node);\n this.owned.add(node);\n return node;\n }\n\n /**\n * Whether `node` is a mount point `wrapRoot` wrapped. It belongs to whoever called `mount`, not\n * to the app rendered into it, so the renderer empties it rather than removing it.\n */\n isRoot(node: BrowserNode): boolean {\n return this.roots.has(node);\n }\n\n // --- HostEngine -----------------------------------------------------------------------------\n\n setProp(node: BrowserNode, key: string, value: unknown): void {\n const clear = value === undefined || value === null;\n if (clear) {\n if (!(key in node.props)) return;\n delete node.props[key];\n } else {\n if (node.props[key] === value) return;\n node.props[key] = value;\n }\n if (key === 'multiline' && node.name === 'text-input') this.fieldFor(node, value === true);\n applyProp(node, key, value, clear);\n }\n\n /**\n * A `<textarea>` for a multiline field and an `<input>` for a one-line one, swapped in place when\n * `multiline` arrives, which is after the element was made (see `elements.ts`).\n *\n * The new element takes the old one's attributes (inline style and scoping attributes among\n * them), its value, its focus and its selection, and the engine's own listeners are installed on it again.\n */\n private fieldFor(node: BrowserNode, multiline: boolean): void {\n const old = node.el as HTMLInputElement | HTMLTextAreaElement;\n if ((old.tagName === 'TEXTAREA') === multiline) return;\n const field = textFieldLike(old, multiline);\n // An input strips line breaks from its value, so text set before `multiline` lost them. Taken\n // from the prop again unless the user has typed since.\n const text = node.props['text'];\n if (multiline && text != null && old.value === String(text).replace(/[\\r\\n]/g, '')) {\n field.value = String(text);\n }\n const focused = this.document.activeElement === old;\n this.layoutObservers.get(node)?.disconnect();\n old.replaceWith(field);\n rebindElement(node, field);\n this.wireAlwaysOnListeners(node);\n const optedIn = node.optedIn;\n node.optedIn = null;\n for (const type of optedIn ?? []) this.wireOptIn(node, type);\n for (const key of ['secureTextEntry', 'keyboardType', 'numberOfLines']) {\n if (key in node.props) applyProp(node, key, node.props[key], false);\n }\n if (focused) focusLike(field, old);\n }\n\n /** Each node's `topLayout` observer, so a field swapped for another stops watching the old one. */\n private readonly layoutObservers = new WeakMap<BrowserNode, ResizeObserver>();\n\n setEventListener(\n node: BrowserNode,\n topLevelType: string,\n fn: (event: unknown) => void,\n ): () => void {\n const listeners = (node.listeners ??= new Map());\n let set = listeners.get(topLevelType);\n if (!set) listeners.set(topLevelType, (set = new Set()));\n set.add(fn);\n this.wireOptIn(node, topLevelType);\n return () => set!.delete(fn);\n }\n\n setResponder(node: BrowserNode, handlers: ResponderHandlers): () => void {\n return this.responders.setResponder(node, handlers);\n }\n\n /**\n * Where a node is, relative to the mount root rather than to the viewport.\n *\n * `measureInWindow` on native answers in window coordinates, and the overlay host is a\n * full-screen absolutely positioned view at the window's origin, so the two agree and an\n * anchored overlay can use one as the other. `getBoundingClientRect` answers in *viewport*\n * coordinates, and `<overlay-host>` is absolutely positioned inside the mount root - so\n * those two agree only when the root sits at the top left of an unscrolled viewport.\n *\n * That is true of a full-page app, which is why every popover in the gallery lands correctly\n * and this went unnoticed. It is false in the two cases that matter: an app mounted into a box\n * partway down a page, where every overlay is offset by the box's own position, and a document\n * that scrolls, where the offset changes as you scroll. Subtracting the root's own rect from a\n * viewport-relative one cancels the scroll term as well as the offset, since both rects move\n * together as the page scrolls - so one subtraction fixes both cases at once.\n *\n * `closest`, not `querySelector`: a page can hold more than one mounted root at a time (the\n * documentation site's own home page does, three of them), and `querySelector` always answers\n * the first one in document order regardless of which root's own tree `node` actually lives in.\n * That made every root after the first measure its overlays against someone else's box.\n * `closest` walks up from the node itself, so each root only ever measures against its own.\n */\n measure(node: BrowserNode, into: (frame: WindowFrame) => void): void {\n const el = node.el as Element;\n const rect = el.getBoundingClientRect();\n const root = el.closest('[data-rn-root]');\n const origin = root ? root.getBoundingClientRect() : { x: 0, y: 0 };\n into({ x: rect.x - origin.x, y: rect.y - origin.y, width: rect.width, height: rect.height });\n }\n\n dispatchCommand(node: BrowserNode, name: string, args: readonly unknown[] = []): void {\n COMMANDS[name]?.(node.el as HTMLElement, args);\n }\n\n /**\n * The scoping attribute Angular's emulated encapsulation stamps on `like`, stamped on `node`,\n * or taken off again when `like` is null.\n */\n override adoptScope(node: BrowserNode, like: BrowserNode | null): void {\n const el = node.el as Element;\n for (const name of this.adopted.get(node) ?? []) el.removeAttribute(name);\n const names = like\n ? [...(like.el as Element).attributes]\n .map((attribute) => attribute.name)\n .filter((name) => name.startsWith('_ngcontent-') && !el.hasAttribute(name))\n : [];\n for (const name of names) el.setAttribute(name, '');\n this.adopted.set(node, names);\n }\n\n /** The scoping attributes `adoptScope` added to each node, which it alone takes off. */\n private readonly adopted = new WeakMap<BrowserNode, string[]>();\n\n commit(): boolean {\n // Every write above already reached the DOM synchronously; there is nothing batched to flush.\n return false;\n }\n\n get focused(): BrowserNode | null {\n if (this.focusedNode && !this.isAttached(this.focusedNode)) this.focusedNode = null;\n return this.focusedNode;\n }\n\n private isAttached(node: BrowserNode): boolean {\n return (node.el as Element).isConnected;\n }\n\n /**\n * A `require()`d numeric asset has no web analogue - there is no bundler-provided asset\n * registry this package can read at runtime - so it resolves to nothing rather than a guess.\n * A `{uri}` source, or an array of them, passes through unchanged: `props.ts`'s image handler\n * reads it directly.\n */\n resolveAsset(value: unknown): unknown {\n if (typeof value === 'number') return undefined;\n return value;\n }\n\n /**\n * A colour the app wrote is passed straight through: CSS accepts the same hex/rgb/named\n * strings RN does. `platform-color(...)`'s semantic iOS/Android names have no web colour\n * system to resolve against, so they resolve to nothing rather than to a wrong guess.\n */\n color(value: unknown): unknown {\n if (value === undefined) return undefined;\n if (typeof value === 'object' && value !== null && 'platformColor' in value) return undefined;\n return value;\n }\n\n // --- event dispatch, mirrors engine.ts's `dispatchEvent` -----------------------------------\n\n dispatchEvent(target: BrowserNode, topLevelType: string, nativeEvent: unknown): void {\n const event = new SyntheticEvent(nativeEvent, target) as ResponderEvent & SyntheticEvent;\n if (topLevelType.startsWith('topTouch'))\n this.responders.runResponder(target, topLevelType, event);\n this.propagate(target, topLevelType, event);\n }\n\n /** As on native: a listener that stops the event ends the bubble after its own node. */\n private propagate(target: BrowserNode, topLevelType: string, event: SyntheticEvent): void {\n for (\n let node: BrowserNode | null = target;\n node && !event.isPropagationStopped();\n node = DIRECT_EVENTS.has(topLevelType) ? null : node.parent\n ) {\n const listeners = node.listeners?.get(topLevelType);\n if (listeners) for (const fn of [...listeners]) fn(event);\n }\n }\n\n // --- always-on listeners, installed once per element at creation ---------------------------\n\n private wireAlwaysOnListeners(node: BrowserNode): void {\n if (node.name === 'scroll-view' || node.name === 'virtual-list') this.wireScroll(node);\n if (node.name === 'text-input') this.wireTextInput(node);\n if (node.name === 'switch') this.wireSwitch(node);\n }\n\n /**\n * `scroll` does not bubble, so this is a real per-node listener rather than a document one.\n *\n * `scrollend` is the browser saying the scroll has come to rest, whatever moved it: a wheel's\n * or a trackpad's glide, a flick, or an animated `scrollTo`. That is the moment a device reports\n * as `(momentumScrollEnd)` - iOS sends it after an animated `scrollTo` as well as after a fling -\n * and the event a paging carousel reads its page from, which never arrived here at all.\n */\n private wireScroll(node: BrowserNode): void {\n const el = node.el as HTMLElement;\n const offsets = () => ({\n contentOffset: { x: el.scrollLeft, y: el.scrollTop },\n contentSize: { width: el.scrollWidth, height: el.scrollHeight },\n layoutMeasurement: { width: el.clientWidth, height: el.clientHeight },\n contentInset: { top: 0, left: 0, bottom: 0, right: 0 },\n zoomScale: 1,\n });\n el.addEventListener('scroll', () => {\n this.responders.notifyScroll(node);\n this.dispatchEvent(node, 'topScroll', offsets());\n });\n el.addEventListener('scrollend', () => {\n this.dispatchEvent(node, 'topMomentumScrollEnd', offsets());\n });\n }\n\n /** Each field's last reported selection, kept across a swap, which keeps the selection too. */\n private readonly selections = new WeakMap<BrowserNode, string>();\n\n private wireTextInput(node: BrowserNode): void {\n const el = node.el as HTMLTextAreaElement;\n const nextCount = () => {\n const count = (this.eventCounts.get(node) ?? 0) + 1;\n this.eventCounts.set(node, count);\n return count;\n };\n el.addEventListener('input', () => {\n this.dispatchEvent(node, 'topChange', { text: el.value, eventCount: nextCount(), target: 0 });\n });\n // `(keyPress)` names a key as a device does: `Backspace`, `Enter`, or the character typed.\n // A device reports only keys that edit the field, so arrows, modifiers and shortcuts send\n // nothing, nor does a key inside an IME composition or one pressed on a read-only field.\n el.addEventListener('keydown', (event) => {\n if (event.isComposing || event.keyCode === 229 || event.metaKey || el.readOnly) return;\n if (event.ctrlKey && !event.getModifierState('AltGraph')) return;\n const { key } = event;\n if (key !== 'Backspace' && key !== 'Enter' && [...key].length !== 1) return;\n this.dispatchEvent(node, 'topKeyPress', {\n key,\n eventCount: this.eventCounts.get(node) ?? 0,\n target: 0,\n });\n });\n // A caret moved by a click, an arrow or typing, and a range selected, each report once.\n const reportSelection = () => {\n const start = el.selectionStart ?? 0;\n const end = el.selectionEnd ?? start;\n if (this.selections.get(node) === `${start}:${end}`) return;\n this.selections.set(node, `${start}:${end}`);\n this.dispatchEvent(node, 'topSelectionChange', { selection: { start, end }, target: 0 });\n };\n for (const type of ['selectionchange', 'select', 'input']) {\n el.addEventListener(type, reportSelection);\n }\n el.addEventListener('focus', () => {\n if (el.hasAttribute('data-select-on-focus')) el.select();\n });\n el.addEventListener('blur', () => {\n this.dispatchEvent(node, 'topEndEditing', {\n text: el.value,\n eventCount: nextCount(),\n target: 0,\n });\n });\n // `Enter` does what `submitBehavior` says, as on a device: `newline` inserts one, `submit`\n // submits and keeps focus, and `blurAndSubmit` submits and then lets go of the field. The\n // component resolves the default, `blurAndSubmit` on one line and `newline` on many; the\n // fallback here is the same rule, for a field whose binding has not landed yet. An `Enter`\n // that confirms an IME composition belongs to the composition, not to the field.\n el.addEventListener('keydown', (event) => {\n if (event.key !== 'Enter' || event.isComposing) return;\n const behavior =\n node.props['submitBehavior'] ??\n (el.hasAttribute('data-multiline') ? 'newline' : 'blurAndSubmit');\n if (behavior === 'newline') return;\n event.preventDefault();\n this.dispatchEvent(node, 'topSubmitEditing', {\n text: el.value,\n eventCount: nextCount(),\n target: 0,\n });\n if (behavior === 'blurAndSubmit') el.blur();\n });\n }\n\n private wireSwitch(node: BrowserNode): void {\n const el = node.el as HTMLInputElement;\n el.addEventListener('change', () => {\n this.dispatchEvent(node, 'topChange', { value: el.checked, target: 0 });\n });\n }\n\n /**\n * `topLayout` and hover, opted into once per node the first time something listens for them -\n * never torn down again, exactly as `engine.ts`'s own `EVENT_OPT_IN_PROPS` never unsets the\n * native prop it wrote either. A second listener for the same type on the same node (unusual,\n * but not forbidden) shares the one observer rather than getting a duplicate.\n */\n private wireOptIn(node: BrowserNode, topLevelType: string): void {\n const optedIn = (node.optedIn ??= new Set());\n if (optedIn.has(topLevelType)) return;\n optedIn.add(topLevelType);\n\n if (topLevelType === 'topLayout') {\n /*\n * The observer says *when*, and the bounding rect says *how big*. The size deliberately\n * does not come from the entry's `contentBoxSize`, which is what it used to come from.\n *\n * Yoga lays out border-box: a React Native view styled `width: 192` with `padding: 16` and\n * a hairline border is 192 wide, and `onLayout` reports 192. `contentBoxSize` is the CSS\n * *content* box, so the same element in a browser reported 158 - the padding and the border\n * subtracted. Every `(layout)` consumer in the library was therefore being handed a size\n * smaller than its native counterpart by however much padding the element happened to have,\n * and each one used it for something different: an accordion animated to a height that cut\n * its own padding off, and an anchored overlay both centred itself on a width it did not\n * have and decided it had room on a side where it did not, because `fits()` was asked about\n * a shorter card than the one about to be painted.\n *\n * `measure()` in this same file has always answered from `getBoundingClientRect()`, which\n * is the border box - so the engine was reporting two different sizes for one element\n * depending on which way you asked. This is the half that was wrong.\n *\n * `x`/`y` are the other half, and a different frame from `measure()`'s: `engine.ts`'s own\n * doc comment for `measure()` says it plainly - \"`(layout)` reports a frame in the parent's\n * coordinates\" - because a layout tells a view how big it is and where it sits inside\n * whatever it is stacked in, not where it is on screen. Reporting the raw viewport rect here\n * answered a question nothing asked: a consumer that reads `layout.y` as an item's offset\n * within its scrolling parent compares it against a scroll position in that same space, so\n * a viewport-relative `y` was wrong by the scroll container's own position on the page - right only for a scroll view\n * pinned at the top of an unscrolled full-page app, wrong the moment it sits lower on the\n * page or the page itself scrolls. Subtracting the immediate DOM parent's rect - never an\n * anchor comment; `browser-renderer.ts`'s `appendChild`/`insertBefore` only ever set\n * `child.parent` to a node backed by a real element - puts it back in the parent's frame.\n */\n const observer = new ResizeObserver(() => {\n const rect = (node.el as Element).getBoundingClientRect();\n const parent = node.parent?.el as Element | undefined;\n const origin = parent ? parent.getBoundingClientRect() : { x: 0, y: 0 };\n this.dispatchEvent(node, 'topLayout', {\n layout: {\n x: rect.x - origin.x,\n y: rect.y - origin.y,\n width: rect.width,\n height: rect.height,\n },\n });\n });\n observer.observe(node.el as Element);\n this.layoutObservers.set(node, observer);\n return;\n }\n if (topLevelType === 'topPointerEnter' || topLevelType === 'topPointerLeave') {\n const domName = topLevelType === 'topPointerEnter' ? 'pointerenter' : 'pointerleave';\n (node.el as Element).addEventListener(domName, () =>\n this.dispatchEvent(node, topLevelType, {}),\n );\n return;\n }\n\n /*\n * Anything else is an ordinary DOM event, bound for real.\n *\n * Without this, `renderer.listen` put the callback in the node's map and stopped: the map is\n * only ever read by `dispatchEvent`, and nothing dispatches a `topClick`. So `(click)`,\n * `(keydown)`, `(input)` and every other plain binding registered successfully and never\n * fired - including Angular's own `RouterLink`, which is why no link in the gallery navigated\n * and no `(click)` anywhere in an app would have worked.\n *\n * The name maps straight down: DOM event types are lowercase, so `topClick` is `click` and\n * `topKeyDown` is `keydown`.\n *\n * The event reaches the handler raw, not wrapped in `{ nativeEvent }`, because that is what a\n * handler written for a browser expects - `RouterLink` reads `button`, `ctrlKey` and\n * `metaKey` off it and calls `preventDefault` itself. Returning `false` from a binding\n * prevents the default, as it does in any Angular app.\n *\n * Delivered only to this node's own listeners rather than through `propagate`, and that is\n * the subtle half. `propagate` walks this package's retained tree to emulate the bubbling\n * React Native does in JavaScript. The DOM already bubbles, so a click on a child arrives at\n * an ancestor's listener by itself, and running both would call every ancestor handler twice.\n */\n if (ENGINE_EVENTS.has(topLevelType)) return;\n (node.el as Element).addEventListener(topLevelType.slice(3).toLowerCase(), (event) => {\n for (const listener of [...(node.listeners?.get(topLevelType) ?? [])]) {\n if ((listener as (value: unknown) => unknown)(event) === false) event.preventDefault();\n }\n });\n }\n\n // --- document-level listeners, shared by the whole tree ------------------------------------\n\n private installGlobalListeners(): void {\n const on = <K extends keyof DocumentEventMap>(\n type: K,\n listener: (event: DocumentEventMap[K]) => void,\n ): void => this.document.addEventListener(type, listener, { signal: this.listening.signal });\n for (const type of ['pointerdown', 'pointermove', 'pointerup', 'pointercancel'] as const) {\n on(type, (event) => this.onPointer(event, type));\n }\n on('focusin', (event) => this.onFocusChange(event, true));\n on('focusout', (event) => this.onFocusChange(event, false));\n on('keydown', (event) => this.onKey(event, true));\n on('keyup', (event) => this.onKey(event, false));\n }\n\n /** The control a held Space is pressing, released on the matching `keyup`. */\n private keyPress: BrowserNode | null = null;\n\n /**\n * Enter and Space press the focused control, as they press a `<button>`.\n *\n * A pressable is focusable and announces itself as a button, but it presses through the\n * responder negotiation, which only pointer events drove - so a keyboard user could tab to it\n * and do nothing with it. The key becomes the same touch a finger would make, on the control\n * itself, so `pressIn`, `press` and `pressOut` all fire, in order, through the same code.\n *\n * Enter presses on the way down and Space on the way up, which is the browser's own rule for a\n * button; Space is also kept from scrolling the page. A text field and a switch are left alone,\n * because the browser's own control already does the right thing with both keys.\n */\n private onKey(event: KeyboardEvent, down: boolean): void {\n if (event.key !== 'Enter' && event.key !== ' ') return;\n const space = event.key === ' ';\n if (!down) {\n const node = this.keyPress;\n if (!space || !node) return;\n this.keyPress = null;\n this.dispatchEvent(node, 'topTouchEnd', this.keyTouch(node));\n return;\n }\n const node = this.keyTarget(event);\n if (!node) return;\n event.preventDefault();\n if (event.repeat || this.keyPress) return;\n this.dispatchEvent(node, 'topTouchStart', this.keyTouch(node));\n if (space) this.keyPress = node;\n else this.dispatchEvent(node, 'topTouchEnd', this.keyTouch(node));\n }\n\n /** The focused control a key would press, or null where the key belongs to something else. */\n private keyTarget(event: KeyboardEvent): BrowserNode | null {\n if (event.defaultPrevented || event.altKey || event.ctrlKey || event.metaKey) return null;\n const node = nodeOf(event.target as Element | null);\n if (!node || node.name === 'text-input' || node.name === 'switch') return null;\n return this.responders.responds(node) ? node : null;\n }\n\n /** A touch at the control's centre, so nothing downstream mistakes it for a drag. */\n private keyTouch(node: BrowserNode): { pageX: number; pageY: number; identifier: number } {\n const rect = (node.el as Element).getBoundingClientRect();\n return { pageX: rect.x + rect.width / 2, pageY: rect.y + rect.height / 2, identifier: -1 };\n }\n\n private onPointer(event: PointerEvent, domType: keyof typeof TOUCH_EVENT_NAMES): void {\n let target: BrowserNode | undefined;\n if (domType === 'pointerdown') {\n // A right or middle click opens a menu or a tab; only the primary button presses.\n if (event.button > 0) return;\n target = nearestNodeOf(event.target as Element | null) ?? undefined;\n if (!target || !this.owned.has(target)) return;\n this.activeTouches.set(event.pointerId, target);\n // Pins every later event in this gesture to the element the finger actually landed on,\n // regardless of where it wanders - what makes the negotiation's `target` mean the same\n // thing `topTouchMove`/`topTouchEnd` that Fabric's continuous per-finger delivery does.\n (event.target as Element).setPointerCapture?.(event.pointerId);\n } else {\n target = this.activeTouches.get(event.pointerId);\n if (!target) return;\n if (domType === 'pointerup' || domType === 'pointercancel')\n this.activeTouches.delete(event.pointerId);\n }\n this.dispatchEvent(target, TOUCH_EVENT_NAMES[domType]!, {\n pageX: event.pageX,\n pageY: event.pageY,\n identifier: event.pointerId,\n });\n }\n\n private onFocusChange(event: FocusEvent, focused: boolean): void {\n const node = nearestNodeOf(event.target as Element | null);\n if (!node || !this.owned.has(node)) return;\n if (focused) this.focusedNode = node;\n else if (this.focusedNode === node) this.focusedNode = null;\n this.dispatchEvent(node, focused ? 'topFocus' : 'topBlur', { target: 0 });\n }\n}\n"]}
|
package/dist/props.js
CHANGED
|
@@ -702,7 +702,19 @@ const SVG_ROOT_HANDLERS = {
|
|
|
702
702
|
const ACTIVITY_INDICATOR_HANDLERS = {
|
|
703
703
|
color: (n, v, c) => setStyleProp(n, 'color', v, c || typeof v !== 'string'),
|
|
704
704
|
};
|
|
705
|
+
/**
|
|
706
|
+
* `text.ts`'s `numberOfLines`, as the attribute and the line count `reset.css` clamps the text
|
|
707
|
+
* with. Neither is written for `0`, which is no limit on a device, as it is when the prop is unset.
|
|
708
|
+
*/
|
|
709
|
+
const TEXT_HANDLERS = {
|
|
710
|
+
numberOfLines: (n, v, c) => {
|
|
711
|
+
const lines = typeof v === 'number' && v > 0 ? v : undefined;
|
|
712
|
+
setOrRemove(n, 'numberoflines', lines, c || lines === undefined);
|
|
713
|
+
setStyleProp(n, '--rn-number-of-lines', lines, c || lines === undefined);
|
|
714
|
+
},
|
|
715
|
+
};
|
|
705
716
|
const BY_ELEMENT = {
|
|
717
|
+
text: TEXT_HANDLERS,
|
|
706
718
|
'activity-indicator': ACTIVITY_INDICATOR_HANDLERS,
|
|
707
719
|
'text-input': TEXT_INPUT_HANDLERS,
|
|
708
720
|
switch: SWITCH_HANDLERS,
|
package/dist/props.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"props.js","sourceRoot":"","sources":["../src/props.ts"],"names":[],"mappings":"AAoCA,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAElD,SAAS,EAAE,CAAC,IAAiB;IAC3B,OAAO,IAAI,CAAC,EAAa,CAAC;AAC5B,CAAC;AAED,SAAS,WAAW,CAAC,IAAiB,EAAE,IAAY,EAAE,KAAc,EAAE,KAAc;IAClF,IAAI,KAAK;QAAE,EAAE,CAAC,IAAI,CAAC,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC;;QACrC,EAAE,CAAC,IAAI,CAAC,CAAC,YAAY,CAAC,IAAI,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;AAClD,CAAC;AAED,SAAS,YAAY,CAAC,IAAiB,EAAE,IAAY,EAAE,KAAc,EAAE,KAAc;IACnF,MAAM,KAAK,GAAI,EAAE,CAAC,IAAI,CAAiB,CAAC,KAAK,CAAC;IAC9C,IAAI,KAAK;QAAE,KAAK,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;;QACjC,KAAK,CAAC,WAAW,CAAC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,iBAAiB;CAC7B,CAAC;AAEF;;;;;;;;GAQG;AACH,MAAM,UAAU,SAAS,CAAC,IAAiB,EAAE,GAAW,EAAE,KAAc,EAAE,KAAc;IACtF,MAAM,cAAc,GAAG,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC;IACpD,MAAM,WAAW,GAAG,kBAAkB,CAAC,GAAG,CAAC,CAAC;IAC5C,IAAI,cAAc,IAAI,WAAW,EAAE,CAAC;QAClC,cAAc,EAAE,CAAC,IAAI,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;QACrC,WAAW,EAAE,CAAC,IAAI,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;QAClC,OAAO;IACT,CAAC;IACD,IAAI,KAAK,EAAE,CAAC;QACV,EAAE,CAAC,IAAI,CAAC,CAAC,eAAe,CAAC,GAAG,CAAC,CAAC;QAC9B,OAAO;IACT,CAAC;IACD,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,OAAO,KAAK,KAAK,SAAS,EAAE,CAAC;QACzF,EAAE,CAAC,IAAI,CAAC,CAAC,YAAY,CAAC,GAAG,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;IAC5C,CAAC;AACH,CAAC","sourcesContent":["/**\n * Every prop `BrowserEngine.setProp` gives a DOM or ARIA meaning to, keyed by prop name and\n * (where two elements use the same prop name differently) by the node's own template name.\n *\n * `packages/components/src/view-base.ts` is the biggest source of these - roughly forty\n * accessibility and identity inputs every host primitive carries - plus a smaller set each of\n * `text-input.ts`, `switch.ts`, `image.ts`, `safe-area-view.ts` and `modal.ts` layers on top for\n * their own element. A lookup table rather than a `switch`, for the same reason the prototype\n * (`examples/web-button/src/browser-engine.ts`) gives: this reads as data instead of control\n * flow, and it is where a review can see, at a glance, what the file's own comments below say in\n * prose - which props got a translated DOM meaning and which did not.\n *\n * ## The fallback for everything not in a table\n *\n * A prop with no handler here does not disappear the way it would if this file's tables were the\n * whole story: `applyProp`'s fallback writes any remaining string, number or boolean prop as a\n * plain attribute under its own name. This is not a guess - it is what a real prop reaches native\n * as too. `engine.ts`'s `Engine.setProp` puts *everything* in `node.props`, unconditionally, and\n * the whole bag is what a commit sends to the native view; native ignores what it does not\n * recognise rather than this package having to know in advance which of Tailwind's compiled\n * `data-*` attribute selectors (`data-slot`, `data-variant`, `data-state`, and whatever a future\n * component invents) a class string will need to match against. The fallback is what makes that\n * true here too, without enumerating every one.\n *\n * What genuinely gets nothing, because a plain attribute could not carry it or would be actively\n * wrong: an object or array prop with no scalar form (`hitSlop`'s insets, `accessibilityActions`,\n * the Android-drawable props), and iOS-only accessibility surfaces with no ARIA equivalent at all\n * (`accessibilityIgnoresInvertColors`, `accessibilityLargeContentTitle`,\n * `accessibilityShowsLargeContentViewer`, `accessibilityRespondsToUserInteraction`) - these last\n * four are strings/booleans that *would* fall through to the generic attribute write and sit\n * inertly in the DOM if not named here, which is harmless but worth being honest about rather\n * than implying they did something. Named in this comment rather than omitted from it, for the\n * reason `host.ts` gives for its own exclusions: a divergence that is not written down is the\n * failure this project cares about.\n */\nimport type { BrowserNode } from './dom-node.ts';\nimport { cssValue, dashCase } from './css-units.ts';\nimport { writeStyleKey } from './native-style.ts';\n\nfunction el(node: BrowserNode): Element {\n return node.el as Element;\n}\n\nfunction setOrRemove(node: BrowserNode, attr: string, value: unknown, clear: boolean): void {\n if (clear) el(node).removeAttribute(attr);\n else el(node).setAttribute(attr, String(value));\n}\n\nfunction setStyleProp(node: BrowserNode, prop: string, value: unknown, clear: boolean): void {\n const style = (el(node) as HTMLElement).style;\n if (clear) style.removeProperty(prop);\n else style.setProperty(prop, cssValue(prop, value));\n}\n\n/**\n * `accessibilityRole`/`role` values with a direct ARIA `role`. Not every RN role has one -\n * `pager`, `scrollview`, `horizontalscrollview`, `webview`, `drawerlayout`, `slidingdrawer`,\n * `keyboardkey` and `text` name platform widgets ARIA has no vocabulary for - those fall through\n * to the literal value, an unrecognised `role` an assistive technology ignores rather than a wrong\n * one it acts on. `element-props.test.ts` holds this list against `view-base.ts`'s own.\n */\nexport const ROLE_MAP: Readonly<Record<string, string>> = {\n none: 'presentation',\n button: 'button',\n togglebutton: 'button',\n link: 'link',\n search: 'searchbox',\n image: 'img',\n adjustable: 'slider',\n imagebutton: 'button',\n header: 'heading',\n // A summary of the screen, as a region with its own name; `contentinfo` is the page's footer.\n summary: 'region',\n alert: 'alert',\n checkbox: 'checkbox',\n combobox: 'combobox',\n menu: 'menu',\n menubar: 'menubar',\n menuitem: 'menuitem',\n progressbar: 'progressbar',\n radio: 'radio',\n radiogroup: 'radiogroup',\n scrollbar: 'scrollbar',\n spinbutton: 'spinbutton',\n switch: 'switch',\n tab: 'tab',\n tabbar: 'tablist',\n tablist: 'tablist',\n timer: 'timer',\n list: 'list',\n toolbar: 'toolbar',\n grid: 'grid',\n viewgroup: 'group',\n iconmenu: 'menu',\n};\n\nfunction applyRole(node: BrowserNode): void {\n // Whichever of the two changed, `role` is the one read where an element has both, as on native.\n const value = node.props['role'] ?? node.props['accessibilityRole'];\n const role = typeof value === 'string' ? (ROLE_MAP[value] ?? value) : undefined;\n setOrRemove(node, 'role', role, role === undefined);\n // Which attribute `checked` goes to depends on the role, and the two arrive in either order.\n const state = node.props['accessibilityState'];\n applyAccessibilityState(node, state, state === undefined || state === null);\n}\n\nfunction applyAccessibilityState(node: BrowserNode, value: unknown, clear: boolean): void {\n const state = clear ? undefined : (value as Record<string, unknown> | undefined);\n setOrRemove(node, 'aria-disabled', state?.['disabled'], state?.['disabled'] !== true);\n setOrRemove(node, 'aria-busy', state?.['busy'], state?.['busy'] !== true);\n setOrRemove(node, 'aria-selected', state?.['selected'], state?.['selected'] === undefined);\n setOrRemove(node, 'aria-expanded', state?.['expanded'], state?.['expanded'] === undefined);\n applyChecked(node, state?.['checked']);\n restorePublishedAria(node, STATE_ARIA);\n}\n\n/**\n * A button is pressed rather than checked: ARIA gives `aria-checked` no meaning on one, so a\n * screen reader said nothing of a checked `togglebutton`, where a device says \"on\".\n */\nfunction applyChecked(node: BrowserNode, checked: unknown): void {\n const pressed = el(node).getAttribute('role') === 'button';\n setOrRemove(node, 'aria-pressed', checked, checked === undefined || !pressed);\n setOrRemove(node, 'aria-checked', checked, checked === undefined || pressed);\n}\n\n/**\n * An aria state `ViewBase` puts back on the node for a native stylesheet, where nothing else\n * carries it. Here the accessibility state, or for `aria-hidden` the hidden props, already writes\n * the real attribute whenever the input is set, so the copy defers to it rather than fight it:\n * `aria-checked` beside the `aria-pressed` a button takes, or `aria-disabled` removed while a\n * disabled pressable still is. With nothing behind it, a raw `[attr.aria-*]` is written as before,\n * and written again once whatever governed it lets go, since that removed the attribute.\n */\nfunction publishedAria(attr: string): Handler {\n return (node, value, clear) => {\n if (!PUBLISHED_ARIA[attr]!(node.props)) setOrRemove(node, attr, value, clear);\n };\n}\n\n/** Writes each raw published attribute in `attrs` that nothing governs any more. */\nfunction restorePublishedAria(node: BrowserNode, attrs: readonly string[]): void {\n for (const attr of attrs) {\n const value = node.props[attr];\n if (value !== undefined && value !== null && !PUBLISHED_ARIA[attr]!(node.props)) {\n el(node).setAttribute(attr, String(value));\n }\n }\n}\n\nfunction inState(key: string): (props: Record<string, unknown>) => boolean {\n return (props) =>\n (props['accessibilityState'] as Record<string, unknown> | undefined)?.[key] !== undefined;\n}\n\n/** Each published aria attribute, and whether something else is writing it at the moment. */\nconst PUBLISHED_ARIA: Readonly<Record<string, (props: Record<string, unknown>) => boolean>> = {\n 'aria-busy': inState('busy'),\n 'aria-checked': inState('checked'),\n 'aria-disabled': inState('disabled'),\n 'aria-expanded': inState('expanded'),\n 'aria-selected': inState('selected'),\n 'aria-hidden': (props) =>\n props['accessibilityElementsHidden'] !== undefined ||\n props['importantForAccessibility'] !== undefined,\n};\n\nconst STATE_ARIA = ['aria-busy', 'aria-checked', 'aria-disabled', 'aria-expanded', 'aria-selected'];\n\nfunction applyAccessibilityValue(node: BrowserNode, value: unknown, clear: boolean): void {\n const v = clear ? undefined : (value as Record<string, unknown> | undefined);\n setOrRemove(node, 'aria-valuemin', v?.['min'], v?.['min'] === undefined);\n setOrRemove(node, 'aria-valuemax', v?.['max'], v?.['max'] === undefined);\n setOrRemove(node, 'aria-valuenow', v?.['now'], v?.['now'] === undefined);\n setOrRemove(node, 'aria-valuetext', v?.['text'], v?.['text'] === undefined);\n}\n\nfunction joinIfArray(value: unknown): unknown {\n return Array.isArray(value) ? value.join(' ') : value;\n}\n\ntype Handler = (node: BrowserNode, value: unknown, clear: boolean) => void;\n\n/** For a prop that genuinely has nothing to do on the web; see the file doc comment. */\nconst noop: Handler = () => {};\n\n/** The keys the last whole `style` object wrote, so the next one can remove what it leaves out. */\nconst writtenStyles = new WeakMap<BrowserNode, Set<string>>();\n\n/**\n * A static `style=\"flex: 1; margin-top: 4px\"`, which Angular writes whole through `setAttribute`,\n * as the object it declares. Parsed by a scratch declaration rather than split on `;` and `:`,\n * because on the web a value can hold both: `url(data:image/png;base64,...)`.\n */\nfunction declarations(node: BrowserNode, css: string): Record<string, string> {\n const scratch = el(node).ownerDocument.createElement('div').style;\n scratch.cssText = css;\n const out: Record<string, string> = {};\n for (const name of Array.from(scratch)) out[name] = scratch.getPropertyValue(name);\n return out;\n}\n\n/**\n * A whole style object as the `style` prop: what `[animatedStyle]` writes each frame. Angular's\n * own `[style]` bindings arrive one key at a time through the renderer's `setStyle` instead, and\n * a static `style` attribute arrives here too, as a string.\n */\nfunction applyStyleObject(node: BrowserNode, value: unknown, clear: boolean): void {\n const style = (el(node) as HTMLElement).style;\n const next = new Set<string>();\n // Kept as the object too, so a later `setStyle` mirrors into declarations rather than a string.\n if (typeof value === 'string') value = node.props['style'] = declarations(node, value);\n if (!clear && typeof value === 'object') {\n const keyed: Record<string, unknown> = {};\n for (const [name, v] of Object.entries(value as Record<string, unknown>)) {\n if (v !== null && v !== undefined) keyed[dashCase(name)] = v;\n }\n for (const key of Object.keys(keyed)) {\n for (const written of writeStyleKey(style, key, keyed)) next.add(written);\n }\n }\n for (const key of writtenStyles.get(node) ?? []) if (!next.has(key)) style.removeProperty(key);\n writtenStyles.set(node, next);\n}\n\n/** `ViewBase`'s own props: identical meaning on every element, whatever it committed as. */\nconst VIEW_BASE_HANDLERS: Record<string, Handler> = {\n style: applyStyleObject,\n accessibilityLabel: (n, v, c) => setOrRemove(n, 'aria-label', v, c),\n accessibilityHint: (n, v, c) => setOrRemove(n, 'aria-description', v, c),\n accessibilityLabelledBy: (n, v, c) => setOrRemove(n, 'aria-labelledby', joinIfArray(v), c),\n accessibilityRole: applyRole,\n role: applyRole,\n accessibilityState: applyAccessibilityState,\n accessibilityValue: applyAccessibilityValue,\n ...Object.fromEntries(Object.keys(PUBLISHED_ARIA).map((attr) => [attr, publishedAria(attr)])),\n accessibilityLiveRegion: (n, v, c) => setOrRemove(n, 'aria-live', v === 'none' ? 'off' : v, c),\n accessibilityElementsHidden: (n, v, c) => {\n setOrRemove(n, 'aria-hidden', v, c || v !== true);\n restorePublishedAria(n, ['aria-hidden']);\n },\n // `no` and `no-hide-descendants` both hide the subtree on the web: ARIA has no way to hide a\n // node from the accessibility tree while keeping its descendants individually reachable, which\n // is the one place `no` and `no-hide-descendants` differ on Android.\n importantForAccessibility: (n, v, c) => {\n const hide = v === 'no' || v === 'no-hide-descendants';\n setOrRemove(n, 'aria-hidden', true, c || !hide);\n restorePublishedAria(n, ['aria-hidden']);\n },\n accessibilityViewIsModal: (n, v, c) => setOrRemove(n, 'aria-modal', v, c || v !== true),\n accessibilityLanguage: (n, v, c) => setOrRemove(n, 'lang', v, c),\n nativeID: (n, v, c) => setOrRemove(n, 'id', v, c),\n id: (n, v, c) => setOrRemove(n, 'id', v, c),\n testID: (n, v, c) => setOrRemove(n, 'data-testid', v, c),\n focusable: (n, v, c) => setOrRemove(n, 'tabindex', v ? '0' : '-1', c),\n pointerEvents: (n, v, c) => {\n // `none` and `auto` map onto the CSS property directly. `box-none` and `box-only` have no\n // exact CSS equivalent - native's version lets a *box* opt out of hit-testing while every\n // descendant keeps receiving touches regardless of its own props; CSS `pointer-events` only\n // has inheritance, which an explicit `auto` on a descendant can override but a plain,\n // untouched descendant cannot escape. Approximated rather than left as a no-op: `box-none`\n // sets `none` on the node itself, `box-only` sets `auto`, which is the more useful default in\n // both directions: a full-window layer that is `box-none` lets touches through to the app\n // under it, and a card inside that sets its own `pointerEvents: 'auto'` opts back in, which\n // is precisely CSS's override rule and needs no web-specific code of its own to work.\n //\n // What this does not do: it does not make an *untouched* descendant of a `box-none` node\n // clickable the way native does automatically - a component that never had to say\n // `pointerEvents=\"auto\"` on native because `box-none` only ever excluded the box itself will\n // need to say so here too. `overlay-host`'s own content is the only place this project has\n // exercised the gap.\n if (v === 'none' || v === 'box-none') setStyleProp(n, 'pointer-events', 'none', c);\n else if (v === 'auto' || v === 'box-only') setStyleProp(n, 'pointer-events', 'auto', c);\n else setStyleProp(n, 'pointer-events', '', true);\n },\n // Object/array props with no scalar form the generic fallback could write, and iOS-only\n // accessibility surfaces with no ARIA equivalent at all. See the file doc comment's second\n // section for why these are named rather than left to fall through.\n hitSlop: noop,\n accessibilityActions: noop,\n nativeBackgroundAndroid: noop,\n nativeForegroundAndroid: noop,\n accessibilityIgnoresInvertColors: noop,\n accessibilityLargeContentTitle: noop,\n accessibilityShowsLargeContentViewer: noop,\n accessibilityRespondsToUserInteraction: noop,\n};\n\n/**\n * A one-line field's `type`: a password while `secureTextEntry` is on, `tel` for a phone keyboard,\n * and `text` otherwise. The other keyboards stay `inputmode` only, which is what picks the\n * on-screen keyboard. In Chromium, `type=\"email\"` throws from `setSelectionRange`, reads null for\n * `selectionStart`, trims the value the app set, and hides the spaces the user types from its\n * value, so `changeText` would report something other than what is on screen. `type=\"url\"` trims\n * the value the app set. `type=\"number\"` has no selection API, and `type=\"search\"` draws a clear\n * button of its own and empties itself on Escape.\n */\nfunction setInputType(n: BrowserNode): void {\n const field = el(n);\n if (field.tagName !== 'INPUT') return;\n const secure = n.props['secureTextEntry'] === true;\n const phone = n.props['keyboardType'] === 'phone-pad';\n (field as HTMLInputElement).type = secure ? 'password' : phone ? 'tel' : 'text';\n}\n\n/** `text-input.ts`'s own props, applied to the `<input>` or `<textarea>` it commits as. */\nconst TEXT_INPUT_HANDLERS: Record<string, Handler> = {\n text: (n, v, c) => {\n const textarea = el(n) as HTMLInputElement | HTMLTextAreaElement;\n const next = c ? '' : String(v);\n // Only when it actually differs: the caret and scroll position reset on every write, even\n // one that sets the value to what it already was, and `TextInput`'s own echo write does\n // exactly that on every keystroke unless this guard is here.\n if (textarea.value !== next) textarea.value = next;\n },\n placeholder: (n, v, c) => setOrRemove(n, 'placeholder', v, c),\n // No inline way to style a pseudo-element, so the colour travels as a custom property and\n // `reset.css` reads it back with `::placeholder`.\n placeholderTextColor: (n, v, c) => setStyleProp(n, '--rn-placeholder-color', v, c),\n keyboardType: (n, v, c) => {\n const map: Record<string, string> = {\n numeric: 'numeric',\n 'number-pad': 'numeric',\n 'decimal-pad': 'decimal',\n 'email-address': 'email',\n 'phone-pad': 'tel',\n url: 'url',\n 'web-search': 'search',\n };\n const mode = typeof v === 'string' ? map[v] : undefined;\n setOrRemove(n, 'inputmode', mode, c || mode === undefined);\n setInputType(n);\n },\n returnKeyType: (n, v, c) => {\n const known = new Set(['done', 'go', 'next', 'search', 'send', 'previous']);\n const hint = typeof v === 'string' && known.has(v) ? v : undefined;\n setOrRemove(n, 'enterkeyhint', hint, c || hint === undefined);\n },\n // A password field where there can be one. A textarea has no password type, so a multiline\n // field masks with the non-standard property, which Firefox does not have.\n secureTextEntry: (n, v, c) => {\n if (el(n).tagName === 'INPUT') setInputType(n);\n else setStyleProp(n, '-webkit-text-security', v ? 'disc' : '', c || !v);\n },\n autoCapitalize: (n, v, c) => setOrRemove(n, 'autocapitalize', v === 'none' ? 'off' : v, c),\n autoCorrect: (n, v, c) => setOrRemove(n, 'autocorrect', v ? 'on' : 'off', c),\n autoFocus: (n, v, c) => {\n if (!c && v) (el(n) as HTMLElement).focus();\n },\n maxLength: (n, v, c) => setOrRemove(n, 'maxlength', v, c),\n multiline: (n, v, c) => setOrRemove(n, 'data-multiline', '', c || v !== true),\n numberOfLines: (n, v, c) => setOrRemove(n, 'rows', v, c || n.props['multiline'] !== true),\n editable: (n, v, c) => {\n (el(n) as HTMLTextAreaElement).readOnly = !c && v === false;\n },\n selection: (n, v, c) => {\n if (c) return;\n const range = v as { start: number; end?: number };\n (el(n) as HTMLTextAreaElement).setSelectionRange(range.start, range.end ?? range.start);\n },\n selectTextOnFocus: (n, v, c) => setOrRemove(n, 'data-select-on-focus', '', c || v !== true),\n textAlign: (n, v, c) => setStyleProp(n, 'text-align', v, c),\n spellCheck: (n, v, c) => setOrRemove(n, 'spellcheck', v ? 'true' : 'false', c),\n autoComplete: (n, v, c) => setOrRemove(n, 'autocomplete', v, c),\n};\n\n/** `switch.ts`'s own props, applied to the `<input type=\"checkbox\">` `elements.ts` creates. */\nconst SWITCH_HANDLERS: Record<string, Handler> = {\n on: (n, v, c) => {\n (el(n) as HTMLInputElement).checked = !c && v === true;\n },\n value: (n, v, c) => {\n (el(n) as HTMLInputElement).checked = !c && v === true;\n },\n disabled: (n, v, c) => {\n (el(n) as HTMLInputElement).disabled = !c && v === true;\n },\n};\n\n/** `image.ts`'s own props. `image` paints with `background-image`; see `elements.ts`. */\nconst IMAGE_HANDLERS: Record<string, Handler> = {\n source: (n, v, c) => {\n const uri = sourceUri(c ? undefined : v);\n setStyleProp(n, 'background-image', uri ? `url(\"${cssEscape(uri)}\")` : '', !uri);\n if (uri) watchImageLoad(n, uri);\n },\n resizeMode: (n, v, c) => {\n const size: Record<string, string> = {\n cover: 'cover',\n contain: 'contain',\n stretch: '100% 100%',\n };\n const mode = typeof v === 'string' ? v : undefined;\n setStyleProp(n, 'background-size', mode ? (size[mode] ?? 'auto') : '', c || !mode);\n setStyleProp(n, 'background-repeat', mode === 'repeat' ? 'repeat' : 'no-repeat', c);\n setStyleProp(n, 'background-position', 'center', c);\n },\n blurRadius: (n, v, c) =>\n setStyleProp(n, 'filter', typeof v === 'number' ? `blur(${v}px)` : '', c),\n /**\n * The picture's own size, which on native is a default the cascade can override. Written as\n * custom properties that `reset.css` reads at the weakest specificity there is, since an inline\n * `width` would beat the app's own classes here exactly as it would on a device.\n */\n intrinsicSize: (n, v, c) => {\n const size = c ? undefined : (v as { width?: unknown; height?: unknown } | undefined);\n const px = (value: unknown) => (typeof value === 'number' ? `${value}px` : '');\n setStyleProp(n, '--rn-intrinsic-width', px(size?.width), !px(size?.width));\n setStyleProp(n, '--rn-intrinsic-height', px(size?.height), !px(size?.height));\n },\n};\n\n/**\n * Says whether a `background-image` loaded, which the property itself will not.\n *\n * An `<image>` paints with `background-image` here (see `elements.ts` for why), and a background\n * fires no `load` or `error` event - only a real `<img>` does. React Native's `Image` reports\n * both, and things depend on it: an avatar-style component that swaps to a fallback when the\n * image errors needs exactly this signal. Without it a broken image URL sat blank forever,\n * showing neither a picture nor a fallback.\n *\n * A detached `Image()` is the standard way to ask. It shares the browser's cache with the\n * background the element is already painting, so this costs a cache lookup rather than a second\n * download.\n *\n * The answer is dispatched as an ordinary DOM event on the element itself, rather than pushed\n * through the engine, so it reaches `(load)` and `(error)` by the same path every other plain\n * binding takes. That is also why `topLoad` and `topError` are not in `browser-engine.ts`'s\n * reserved set: there is a real DOM event of each name here, and it is this one.\n *\n * The uri is remembered so a source that changes mid-flight cannot have its old answer arrive\n * late and overwrite the new one, which is the stale-response guard any fetch needs.\n */\nconst IMAGE_LOADS = new WeakMap<object, string>();\n\nfunction watchImageLoad(node: BrowserNode, uri: string): void {\n IMAGE_LOADS.set(node, uri);\n const el = node.el as Element;\n const view = el.ownerDocument.defaultView;\n if (!view) return;\n const probe = new view.Image();\n const settle = (type: 'load' | 'error') => () => {\n if (IMAGE_LOADS.get(node) === uri) el.dispatchEvent(new view.Event(type));\n };\n probe.addEventListener('load', settle('load'));\n probe.addEventListener('error', settle('error'));\n probe.src = uri;\n}\n\nfunction sourceUri(value: unknown): string | undefined {\n if (!value) return undefined;\n if (typeof value === 'object' && 'uri' in (value as object)) {\n return (value as { uri?: string }).uri;\n }\n if (Array.isArray(value) && value.length > 0) return sourceUri(value[0]);\n return undefined;\n}\n\nfunction cssEscape(value: string): string {\n return value.replace(/[\"\\\\]/g, (c) => `\\\\${c}`);\n}\n\n/**\n * `safe-area-view.ts`'s `edges`/`mode`. Applied on either changing, from both current values,\n * because native takes all four edges together and this follows the same rule (see that file's\n * own `resolvedEdges` comment).\n *\n * `env(safe-area-inset-*)` is the real CSS mechanism for this - a phone with a notch reports a\n * non-zero inset through it, the same number `react-native-safe-area-context` reads on iOS. What\n * is not reproduced: `additive` mode is documented as adding the inset to whatever padding a\n * caller's own class already put there, and there is no way to read that back out of a\n * stylesheet this engine cannot inspect - so `additive` and `maximum` both resolve to `env()`\n * alone here, which is `maximum` against a base of zero. A caller relying on `additive` stacking\n * with its own padding will see less padding on the web than on native.\n */\nconst EDGE_PROP: Record<string, string> = {\n top: 'top',\n right: 'right',\n bottom: 'bottom',\n left: 'left',\n};\n\nfunction applySafeAreaInsets(node: BrowserNode): void {\n const edges = node.props['edges'] as Record<string, string> | undefined;\n const mode = (node.props['mode'] as string | undefined) ?? 'padding';\n const family = mode === 'margin' ? 'margin' : 'padding';\n // The family not in use is cleared too, or switching mode left the old insets behind.\n const other = family === 'margin' ? 'padding' : 'margin';\n for (const edge of Object.keys(EDGE_PROP)) {\n const edgeMode = edges?.[edge];\n const prop = `${family}-${EDGE_PROP[edge]}`;\n setStyleProp(node, `${other}-${EDGE_PROP[edge]}`, '', true);\n if (!edgeMode || edgeMode === 'off') setStyleProp(node, prop, '', true);\n else setStyleProp(node, prop, `env(safe-area-inset-${edge})`, false);\n }\n}\n\nconst SAFE_AREA_HANDLERS: Record<string, Handler> = {\n edges: (n) => applySafeAreaInsets(n),\n mode: (n) => applySafeAreaInsets(n),\n};\n\n/**\n * `modal.ts`'s own props. `visible` defaults to `true` there specifically so a mounted-but-hidden\n * host does not swallow touches over nothing (see that file's doc comment); on the web the same\n * concern is a `hidden` attribute, which `reset.css` gives higher specificity than the layout\n * reset's `display: flex` so it actually hides rather than being immediately overridden by it.\n */\nconst MODAL_HANDLERS: Record<string, Handler> = {\n visible: (n, v, c) => setOrRemove(n, 'hidden', '', c || v !== false),\n transparent: (n, v, c) => setStyleProp(n, 'background-color', 'transparent', c || v !== true),\n};\n\n/**\n * `packages/icons/src/svg-props.ts`'s translation, read back the other way.\n *\n * `fill`/`stroke` arrive as a *brush*, not a colour string: `null` for \"paint nothing\", a real\n * `{type: 0, payload}` object for an actual colour (`payload` already run through\n * `BrowserEngine.color`, which passes a normal CSS colour string straight through), `{type: 2}`\n * for `currentColor`, `{type: 1, brushRef}` for a gradient reference. `strokeLinecap`/\n * `strokeLinejoin`/`fillRule`/`clipRule` arrive as the integers `svg-props.ts` encodes SVG's\n * keywords as - native prop values, not the strings a `<svg-path stroke-linecap=\"round\">` was\n * written with - so the tables below are `svg-props.ts`'s own `LINECAP`/`LINEJOIN`/`FILL_RULE`\n * read backwards. `strokeDasharray` arrives as a string array, already split on commas/whitespace\n * rather than the original string; `matrix` as the six numbers of a 2x3 matrix rather than the\n * `transform` string they came from. All are reconstructed here into the attribute form a browser\n * wants.\n *\n * `propList` gets nothing: it is native prop names this element declared for itself, so that\n * *its* `RNSVGGroup`/`RNSVGPath` inherits nothing it did not ask to inherit - a fake for\n * inheritance real SVG attributes already do on their own, which is the entire reason\n * `svg-props.ts` had to invent it.\n *\n * Geometry (`d`, `cx`, `cy`, `r`, `rx`, `ry`, `x`, `y`, `width`, `height`, `x1`, `y1`, `x2`, `y2`)\n * gets no handler either, on purpose: those prop names are already the SVG attribute names,\n * untouched by `nativeProps`, so `applyProp`'s generic string/number fallback at the bottom of\n * this file writes them correctly with nothing said here.\n */\nfunction brushAttr(value: unknown): string | undefined {\n const brush = value as { type: number; payload?: unknown; brushRef?: string };\n if (brush.type === 2) return 'currentColor';\n if (brush.type === 1) return `url(#${brush.brushRef})`;\n if (brush.type === 0) return typeof brush.payload === 'string' ? brush.payload : undefined;\n return undefined;\n}\n\n/**\n * `fill`/`stroke`. Reads `value` itself rather than the `clear` flag `applyProp` would otherwise\n * pass every other handler, because `clear` alone cannot tell apart the two things a cleared\n * brush prop means: `undefined` (\"never declared - inherit from the ancestor group, same as real\n * SVG's own cascade\") and the brush `null` (\"declared as `none` - paint nothing, even if an\n * ancestor would otherwise supply a paint\"). Only the second needs an attribute written at all.\n * `dom-node.ts`'s `SVG_BRUSH_ELEMENTS` seeding is what makes sure this handler is even reached for\n * a shape's first `fill=\"none\"`/`stroke=\"none\"` - see that file's own doc comment for why a\n * `null` brush needs help getting here in the first place.\n */\nfunction applyBrush(node: BrowserNode, attr: string, value: unknown): void {\n if (value === undefined) {\n el(node).removeAttribute(attr);\n return;\n }\n if (value === null) {\n el(node).setAttribute(attr, 'none');\n return;\n }\n const resolved = brushAttr(value);\n if (resolved === undefined) el(node).removeAttribute(attr);\n else el(node).setAttribute(attr, resolved);\n}\n\nconst LINECAP_KEYWORD: Record<number, string> = { 0: 'butt', 1: 'round', 2: 'square' };\nconst LINEJOIN_KEYWORD: Record<number, string> = { 0: 'miter', 1: 'round', 2: 'bevel' };\nconst FILL_RULE_KEYWORD: Record<number, string> = { 0: 'evenodd', 1: 'nonzero' };\n\nfunction applyKeyword(\n node: BrowserNode,\n attr: string,\n map: Readonly<Record<number, string>>,\n value: unknown,\n clear: boolean,\n): void {\n const resolved = typeof value === 'number' ? map[value] : undefined;\n setOrRemove(node, attr, resolved, clear || resolved === undefined);\n}\n\n/**\n * Every shape `ng-icon.ts` parses out of an icon's markup - `svg-path`, `svg-rect`, `svg-circle`,\n * `svg-line`, plus `svg-g` and `svg-ellipse` - shares this one set of presentation props, the\n * same names `svg-props.ts`'s own `PRESENTATION` table lists.\n */\nconst SVG_PRESENTATION_HANDLERS: Record<string, Handler> = {\n fill: (n, v) => applyBrush(n, 'fill', v),\n stroke: (n, v) => applyBrush(n, 'stroke', v),\n fillOpacity: (n, v, c) => setOrRemove(n, 'fill-opacity', v, c),\n strokeOpacity: (n, v, c) => setOrRemove(n, 'stroke-opacity', v, c),\n strokeWidth: (n, v, c) => setOrRemove(n, 'stroke-width', v, c),\n strokeLinecap: (n, v, c) => applyKeyword(n, 'stroke-linecap', LINECAP_KEYWORD, v, c),\n strokeLinejoin: (n, v, c) => applyKeyword(n, 'stroke-linejoin', LINEJOIN_KEYWORD, v, c),\n fillRule: (n, v, c) => applyKeyword(n, 'fill-rule', FILL_RULE_KEYWORD, v, c),\n clipRule: (n, v, c) => applyKeyword(n, 'clip-rule', FILL_RULE_KEYWORD, v, c),\n strokeDasharray: (n, v, c) => {\n const joined = Array.isArray(v) ? v.join(',') : undefined;\n setOrRemove(n, 'stroke-dasharray', joined, c || joined === undefined);\n },\n strokeDashoffset: (n, v, c) => setOrRemove(n, 'stroke-dashoffset', v, c),\n strokeMiterlimit: (n, v, c) => setOrRemove(n, 'stroke-miterlimit', v, c),\n opacity: (n, v, c) => setOrRemove(n, 'opacity', v, c),\n matrix: (n, v, c) => {\n const matrix = Array.isArray(v) ? `matrix(${v.join(',')})` : undefined;\n setOrRemove(n, 'transform', matrix, c || matrix === undefined);\n },\n propList: noop,\n};\n\n/**\n * A gradient, read back from `svg-props.ts`'s `gradientProps`. Its stops arrive as one flat list,\n * `[offset, colour, offset, colour]`, which is how native takes them, and a browser wants them as\n * `<stop>` children. Its `name` is the `id` a `url(#id)` brush finds it by, and a radial one's\n * two radii are the one `r` it was written with.\n */\nconst SVG_GRADIENT_HANDLERS: Record<string, Handler> = {\n name: (n, v, c) => setOrRemove(n, 'id', v, c),\n gradient: (n, v) => {\n const list = Array.isArray(v) ? v : [];\n const stops: Element[] = [];\n for (let i = 0; i + 1 < list.length; i += 2) {\n const stop = el(n).ownerDocument.createElementNS(el(n).namespaceURI, 'stop');\n stop.setAttribute('offset', String(list[i]));\n stop.setAttribute('stop-color', String(list[i + 1]));\n stops.push(stop);\n }\n el(n).replaceChildren(...stops);\n },\n gradientUnits: (n, v, c) =>\n setOrRemove(n, 'gradientUnits', v === 1 ? 'userSpaceOnUse' : 'objectBoundingBox', c),\n gradientTransform: (n, v, c) => {\n const matrix = Array.isArray(v) ? `matrix(${v.join(',')})` : undefined;\n setOrRemove(n, 'gradientTransform', matrix, c || matrix === undefined);\n },\n rx: (n, v, c) => setOrRemove(n, 'r', v, c),\n ry: noop,\n};\n\n/** The attributes `svg-props.ts`'s `textProps` gathers into the one `font` object native reads. */\nconst FONT_ATTRIBUTES = [\n 'font-size',\n 'font-weight',\n 'font-style',\n 'font-family',\n 'font-variant',\n 'font-stretch',\n 'text-anchor',\n 'text-decoration',\n 'letter-spacing',\n 'word-spacing',\n 'kerning',\n];\n\nconst camelCase = (name: string): string =>\n name.replace(/-([a-z])/g, (_, letter: string) => letter.toUpperCase());\n\n/** A position list, `x: ['0', '9']`, as the attribute it was written as. An empty one is none. */\nconst lengthList =\n (attr: string): Handler =>\n (n, v) => {\n const list = Array.isArray(v) ? v : [];\n setOrRemove(n, attr, list.join(' '), list.length === 0);\n };\n\n/** A `text` or a `tspan`: a shape's paint, with its font, its positions and its characters. */\nconst SVG_TEXT_HANDLERS: Record<string, Handler> = {\n ...SVG_PRESENTATION_HANDLERS,\n font: (n, v) => {\n const font = (v ?? {}) as Record<string, unknown>;\n for (const attr of FONT_ATTRIBUTES) {\n const value = font[camelCase(attr)];\n setOrRemove(n, attr, value, value === undefined || value === null);\n }\n },\n x: lengthList('x'),\n y: lengthList('y'),\n dx: lengthList('dx'),\n dy: lengthList('dy'),\n rotate: lengthList('rotate'),\n content: (n, v, c) => {\n el(n).textContent = c ? '' : String(v);\n },\n};\n\n/**\n * The SVG root's own sizing props - `ng-icon.ts`'s host bindings, none of which go through\n * `svg-props.ts`'s `nativeProps` (they are written directly, not parsed off markup).\n * `minX`/`minY`/`vbWidth`/`vbHeight` build one `viewBox` attribute together, and\n * `align`/`meetOrSlice` build one `preserveAspectRatio` together, so each handler rereads every\n * prop in its group off `node.props` rather than trusting the single value it was called with -\n * the same pattern `applySafeAreaInsets` above uses for `edges`/`mode`, needed for the same\n * reason: Angular commits host bindings one at a time, so whichever of a group changes first would\n * otherwise write an attribute built from the rest still being stale (`undefined`, before their\n * own first commit) or from a previous render's values.\n */\nfunction applySvgViewBox(node: BrowserNode): void {\n const minX = node.props['minX'];\n const minY = node.props['minY'];\n const vbWidth = node.props['vbWidth'];\n const vbHeight = node.props['vbHeight'];\n const complete =\n typeof minX === 'number' &&\n typeof minY === 'number' &&\n typeof vbWidth === 'number' &&\n typeof vbHeight === 'number';\n setOrRemove(\n node,\n 'viewBox',\n complete ? `${minX} ${minY} ${vbWidth} ${vbHeight}` : undefined,\n !complete,\n );\n}\n\n/**\n * `bbWidth`/`bbHeight` are the root's own rendered size in points - `NgIcon`'s `size()` input -\n * kept as real `width`/`height` attributes alongside the `[style]` host binding that sizes the\n * box for layout, so an inspector reading the SVG element in isolation sees the same size CSS is\n * about to give it.\n */\nfunction applySvgSize(node: BrowserNode): void {\n const bbWidth = node.props['bbWidth'];\n const bbHeight = node.props['bbHeight'];\n setOrRemove(node, 'width', bbWidth, typeof bbWidth !== 'number');\n setOrRemove(node, 'height', bbHeight, typeof bbHeight !== 'number');\n}\n\n/**\n * `0`/`1`/`2` are `RNSVGSvgView`'s own encoding of `meet`/`slice`/`none` - see `svg-props.ts`'s\n * `viewBoxProps`, which always sends `0` for both roots today. `slice`/`none` are translated on\n * the chance a future caller sets one directly, not because either root emits them yet; that\n * would be a divergence worth noting if it ever mattered, but nothing in this codebase exercises\n * it.\n */\nconst MEET_OR_SLICE: Record<number, string> = { 0: 'meet', 1: 'slice', 2: 'none' };\n\nfunction applySvgAspectRatio(node: BrowserNode): void {\n const align = node.props['align'];\n const meetOrSlice = node.props['meetOrSlice'];\n if (typeof align !== 'string') {\n el(node).removeAttribute('preserveAspectRatio');\n return;\n }\n const slice = typeof meetOrSlice === 'number' ? (MEET_OR_SLICE[meetOrSlice] ?? 'meet') : 'meet';\n el(node).setAttribute('preserveAspectRatio', `${align} ${slice}`);\n}\n\nconst SVG_ROOT_HANDLERS: Record<string, Handler> = {\n minX: (n) => applySvgViewBox(n),\n minY: (n) => applySvgViewBox(n),\n vbWidth: (n) => applySvgViewBox(n),\n vbHeight: (n) => applySvgViewBox(n),\n bbWidth: (n) => applySvgSize(n),\n bbHeight: (n) => applySvgSize(n),\n align: (n) => applySvgAspectRatio(n),\n meetOrSlice: (n) => applySvgAspectRatio(n),\n // `NgIcon`'s own `[color]` host binding - what a shape's `currentColor` brush (`brushAttr`'s\n // `{type: 2}` case, written as the literal attribute value `currentColor`) resolves against.\n // Real SVG's `currentColor` already means \"this element's computed CSS `color`\", so setting it\n // here as an inline style *is* the whole translation - no downstream shape needs to know the\n // actual value, exactly as native's brush stays unresolved until the view paints.\n color: (n, v, c) => setStyleProp(n, 'color', v, c || typeof v !== 'string'),\n};\n\n/**\n * `activity-indicator.ts`'s colour, as the `color` its spinner in `reset.css` paints with. The\n * spinner is drawn by the stylesheet, and `animating` and `hidesWhenStopped` reach it as the\n * plain attributes the fallback writes.\n */\nconst ACTIVITY_INDICATOR_HANDLERS: Record<string, Handler> = {\n color: (n, v, c) => setStyleProp(n, 'color', v, c || typeof v !== 'string'),\n};\n\nconst BY_ELEMENT: Record<string, Record<string, Handler>> = {\n 'activity-indicator': ACTIVITY_INDICATOR_HANDLERS,\n 'text-input': TEXT_INPUT_HANDLERS,\n switch: SWITCH_HANDLERS,\n image: IMAGE_HANDLERS,\n 'safe-area-view': SAFE_AREA_HANDLERS,\n modal: MODAL_HANDLERS,\n 'svg-g': SVG_PRESENTATION_HANDLERS,\n 'svg-path': SVG_PRESENTATION_HANDLERS,\n 'svg-circle': SVG_PRESENTATION_HANDLERS,\n 'svg-ellipse': SVG_PRESENTATION_HANDLERS,\n 'svg-rect': SVG_PRESENTATION_HANDLERS,\n 'svg-line': SVG_PRESENTATION_HANDLERS,\n 'svg-linear-gradient': SVG_GRADIENT_HANDLERS,\n 'svg-radial-gradient': SVG_GRADIENT_HANDLERS,\n 'svg-text': SVG_TEXT_HANDLERS,\n 'svg-tspan': SVG_TEXT_HANDLERS,\n 'ng-icon': SVG_ROOT_HANDLERS,\n};\n\n/**\n * Apply one prop to its node. `clear` is `value === undefined || value === null`.\n *\n * A key with a handler - either element-specific or from `ViewBase`'s own set - runs exactly\n * that translation. Everything else falls to the generic attribute write the file doc comment\n * describes, which is why a `noop` entry (`hitSlop`, `accessibilityActions`, ...) has to be a\n * real entry rather than an absent one: an absent key falls through and gets written as a raw\n * attribute, a `noop` key is claimed and genuinely does nothing.\n */\nexport function applyProp(node: BrowserNode, key: string, value: unknown, clear: boolean): void {\n const elementHandler = BY_ELEMENT[node.name]?.[key];\n const baseHandler = VIEW_BASE_HANDLERS[key];\n if (elementHandler || baseHandler) {\n elementHandler?.(node, value, clear);\n baseHandler?.(node, value, clear);\n return;\n }\n if (clear) {\n el(node).removeAttribute(key);\n return;\n }\n if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean') {\n el(node).setAttribute(key, String(value));\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"props.js","sourceRoot":"","sources":["../src/props.ts"],"names":[],"mappings":"AAoCA,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAElD,SAAS,EAAE,CAAC,IAAiB;IAC3B,OAAO,IAAI,CAAC,EAAa,CAAC;AAC5B,CAAC;AAED,SAAS,WAAW,CAAC,IAAiB,EAAE,IAAY,EAAE,KAAc,EAAE,KAAc;IAClF,IAAI,KAAK;QAAE,EAAE,CAAC,IAAI,CAAC,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC;;QACrC,EAAE,CAAC,IAAI,CAAC,CAAC,YAAY,CAAC,IAAI,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;AAClD,CAAC;AAED,SAAS,YAAY,CAAC,IAAiB,EAA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C9B,OAAO;IACT,CAAC;IACD,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,OAAO,KAAK,KAAK,SAAS,EAAE,CAAC;QACzF,EAAE,CAAC,IAAI,CAAC,CAAC,YAAY,CAAC,GAAG,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;IAC5C,CAAC;AACH,CAAC","sourcesContent":["/**\n * Every prop `BrowserEngine.setProp` gives a DOM or ARIA meaning to, keyed by prop name and\n * (where two elements use the same prop name differently) by the node's own template name.\n *\n * `packages/components/src/view-base.ts` is the biggest source of these - roughly forty\n * accessibility and identity inputs every host primitive carries - plus a smaller set each of\n * `text-input.ts`, `switch.ts`, `image.ts`, `safe-area-view.ts` and `modal.ts` layers on top for\n * their own element. A lookup table rather than a `switch`, for the same reason the prototype\n * (`examples/web-button/src/browser-engine.ts`) gives: this reads as data instead of control\n * flow, and it is where a review can see, at a glance, what the file's own comments below say in\n * prose - which props got a translated DOM meaning and which did not.\n *\n * ## The fallback for everything not in a table\n *\n * A prop with no handler here does not disappear the way it would if this file's tables were the\n * whole story: `applyProp`'s fallback writes any remaining string, number or boolean prop as a\n * plain attribute under its own name. This is not a guess - it is what a real prop reaches native\n * as too. `engine.ts`'s `Engine.setProp` puts *everything* in `node.props`, unconditionally, and\n * the whole bag is what a commit sends to the native view; native ignores what it does not\n * recognise rather than this package having to know in advance which of Tailwind's compiled\n * `data-*` attribute selectors (`data-slot`, `data-variant`, `data-state`, and whatever a future\n * component invents) a class string will need to match against. The fallback is what makes that\n * true here too, without enumerating every one.\n *\n * What genuinely gets nothing, because a plain attribute could not carry it or would be actively\n * wrong: an object or array prop with no scalar form (`hitSlop`'s insets, `accessibilityActions`,\n * the Android-drawable props), and iOS-only accessibility surfaces with no ARIA equivalent at all\n * (`accessibilityIgnoresInvertColors`, `accessibilityLargeContentTitle`,\n * `accessibilityShowsLargeContentViewer`, `accessibilityRespondsToUserInteraction`) - these last\n * four are strings/booleans that *would* fall through to the generic attribute write and sit\n * inertly in the DOM if not named here, which is harmless but worth being honest about rather\n * than implying they did something. Named in this comment rather than omitted from it, for the\n * reason `host.ts` gives for its own exclusions: a divergence that is not written down is the\n * failure this project cares about.\n */\nimport type { BrowserNode } from './dom-node.ts';\nimport { cssValue, dashCase } from './css-units.ts';\nimport { writeStyleKey } from './native-style.ts';\n\nfunction el(node: BrowserNode): Element {\n return node.el as Element;\n}\n\nfunction setOrRemove(node: BrowserNode, attr: string, value: unknown, clear: boolean): void {\n if (clear) el(node).removeAttribute(attr);\n else el(node).setAttribute(attr, String(value));\n}\n\nfunction setStyleProp(node: BrowserNode, prop: string, value: unknown, clear: boolean): void {\n const style = (el(node) as HTMLElement).style;\n if (clear) style.removeProperty(prop);\n else style.setProperty(prop, cssValue(prop, value));\n}\n\n/**\n * `accessibilityRole`/`role` values with a direct ARIA `role`. Not every RN role has one -\n * `pager`, `scrollview`, `horizontalscrollview`, `webview`, `drawerlayout`, `slidingdrawer`,\n * `keyboardkey` and `text` name platform widgets ARIA has no vocabulary for - those fall through\n * to the literal value, an unrecognised `role` an assistive technology ignores rather than a wrong\n * one it acts on. `element-props.test.ts` holds this list against `view-base.ts`'s own.\n */\nexport const ROLE_MAP: Readonly<Record<string, string>> = {\n none: 'presentation',\n button: 'button',\n togglebutton: 'button',\n link: 'link',\n search: 'searchbox',\n image: 'img',\n adjustable: 'slider',\n imagebutton: 'button',\n header: 'heading',\n // A summary of the screen, as a region with its own name; `contentinfo` is the page's footer.\n summary: 'region',\n alert: 'alert',\n checkbox: 'checkbox',\n combobox: 'combobox',\n menu: 'menu',\n menubar: 'menubar',\n menuitem: 'menuitem',\n progressbar: 'progressbar',\n radio: 'radio',\n radiogroup: 'radiogroup',\n scrollbar: 'scrollbar',\n spinbutton: 'spinbutton',\n switch: 'switch',\n tab: 'tab',\n tabbar: 'tablist',\n tablist: 'tablist',\n timer: 'timer',\n list: 'list',\n toolbar: 'toolbar',\n grid: 'grid',\n viewgroup: 'group',\n iconmenu: 'menu',\n};\n\nfunction applyRole(node: BrowserNode): void {\n // Whichever of the two changed, `role` is the one read where an element has both, as on native.\n const value = node.props['role'] ?? node.props['accessibilityRole'];\n const role = typeof value === 'string' ? (ROLE_MAP[value] ?? value) : undefined;\n setOrRemove(node, 'role', role, role === undefined);\n // Which attribute `checked` goes to depends on the role, and the two arrive in either order.\n const state = node.props['accessibilityState'];\n applyAccessibilityState(node, state, state === undefined || state === null);\n}\n\nfunction applyAccessibilityState(node: BrowserNode, value: unknown, clear: boolean): void {\n const state = clear ? undefined : (value as Record<string, unknown> | undefined);\n setOrRemove(node, 'aria-disabled', state?.['disabled'], state?.['disabled'] !== true);\n setOrRemove(node, 'aria-busy', state?.['busy'], state?.['busy'] !== true);\n setOrRemove(node, 'aria-selected', state?.['selected'], state?.['selected'] === undefined);\n setOrRemove(node, 'aria-expanded', state?.['expanded'], state?.['expanded'] === undefined);\n applyChecked(node, state?.['checked']);\n restorePublishedAria(node, STATE_ARIA);\n}\n\n/**\n * A button is pressed rather than checked: ARIA gives `aria-checked` no meaning on one, so a\n * screen reader said nothing of a checked `togglebutton`, where a device says \"on\".\n */\nfunction applyChecked(node: BrowserNode, checked: unknown): void {\n const pressed = el(node).getAttribute('role') === 'button';\n setOrRemove(node, 'aria-pressed', checked, checked === undefined || !pressed);\n setOrRemove(node, 'aria-checked', checked, checked === undefined || pressed);\n}\n\n/**\n * An aria state `ViewBase` puts back on the node for a native stylesheet, where nothing else\n * carries it. Here the accessibility state, or for `aria-hidden` the hidden props, already writes\n * the real attribute whenever the input is set, so the copy defers to it rather than fight it:\n * `aria-checked` beside the `aria-pressed` a button takes, or `aria-disabled` removed while a\n * disabled pressable still is. With nothing behind it, a raw `[attr.aria-*]` is written as before,\n * and written again once whatever governed it lets go, since that removed the attribute.\n */\nfunction publishedAria(attr: string): Handler {\n return (node, value, clear) => {\n if (!PUBLISHED_ARIA[attr]!(node.props)) setOrRemove(node, attr, value, clear);\n };\n}\n\n/** Writes each raw published attribute in `attrs` that nothing governs any more. */\nfunction restorePublishedAria(node: BrowserNode, attrs: readonly string[]): void {\n for (const attr of attrs) {\n const value = node.props[attr];\n if (value !== undefined && value !== null && !PUBLISHED_ARIA[attr]!(node.props)) {\n el(node).setAttribute(attr, String(value));\n }\n }\n}\n\nfunction inState(key: string): (props: Record<string, unknown>) => boolean {\n return (props) =>\n (props['accessibilityState'] as Record<string, unknown> | undefined)?.[key] !== undefined;\n}\n\n/** Each published aria attribute, and whether something else is writing it at the moment. */\nconst PUBLISHED_ARIA: Readonly<Record<string, (props: Record<string, unknown>) => boolean>> = {\n 'aria-busy': inState('busy'),\n 'aria-checked': inState('checked'),\n 'aria-disabled': inState('disabled'),\n 'aria-expanded': inState('expanded'),\n 'aria-selected': inState('selected'),\n 'aria-hidden': (props) =>\n props['accessibilityElementsHidden'] !== undefined ||\n props['importantForAccessibility'] !== undefined,\n};\n\nconst STATE_ARIA = ['aria-busy', 'aria-checked', 'aria-disabled', 'aria-expanded', 'aria-selected'];\n\nfunction applyAccessibilityValue(node: BrowserNode, value: unknown, clear: boolean): void {\n const v = clear ? undefined : (value as Record<string, unknown> | undefined);\n setOrRemove(node, 'aria-valuemin', v?.['min'], v?.['min'] === undefined);\n setOrRemove(node, 'aria-valuemax', v?.['max'], v?.['max'] === undefined);\n setOrRemove(node, 'aria-valuenow', v?.['now'], v?.['now'] === undefined);\n setOrRemove(node, 'aria-valuetext', v?.['text'], v?.['text'] === undefined);\n}\n\nfunction joinIfArray(value: unknown): unknown {\n return Array.isArray(value) ? value.join(' ') : value;\n}\n\ntype Handler = (node: BrowserNode, value: unknown, clear: boolean) => void;\n\n/** For a prop that genuinely has nothing to do on the web; see the file doc comment. */\nconst noop: Handler = () => {};\n\n/** The keys the last whole `style` object wrote, so the next one can remove what it leaves out. */\nconst writtenStyles = new WeakMap<BrowserNode, Set<string>>();\n\n/**\n * A static `style=\"flex: 1; margin-top: 4px\"`, which Angular writes whole through `setAttribute`,\n * as the object it declares. Parsed by a scratch declaration rather than split on `;` and `:`,\n * because on the web a value can hold both: `url(data:image/png;base64,...)`.\n */\nfunction declarations(node: BrowserNode, css: string): Record<string, string> {\n const scratch = el(node).ownerDocument.createElement('div').style;\n scratch.cssText = css;\n const out: Record<string, string> = {};\n for (const name of Array.from(scratch)) out[name] = scratch.getPropertyValue(name);\n return out;\n}\n\n/**\n * A whole style object as the `style` prop: what `[animatedStyle]` writes each frame. Angular's\n * own `[style]` bindings arrive one key at a time through the renderer's `setStyle` instead, and\n * a static `style` attribute arrives here too, as a string.\n */\nfunction applyStyleObject(node: BrowserNode, value: unknown, clear: boolean): void {\n const style = (el(node) as HTMLElement).style;\n const next = new Set<string>();\n // Kept as the object too, so a later `setStyle` mirrors into declarations rather than a string.\n if (typeof value === 'string') value = node.props['style'] = declarations(node, value);\n if (!clear && typeof value === 'object') {\n const keyed: Record<string, unknown> = {};\n for (const [name, v] of Object.entries(value as Record<string, unknown>)) {\n if (v !== null && v !== undefined) keyed[dashCase(name)] = v;\n }\n for (const key of Object.keys(keyed)) {\n for (const written of writeStyleKey(style, key, keyed)) next.add(written);\n }\n }\n for (const key of writtenStyles.get(node) ?? []) if (!next.has(key)) style.removeProperty(key);\n writtenStyles.set(node, next);\n}\n\n/** `ViewBase`'s own props: identical meaning on every element, whatever it committed as. */\nconst VIEW_BASE_HANDLERS: Record<string, Handler> = {\n style: applyStyleObject,\n accessibilityLabel: (n, v, c) => setOrRemove(n, 'aria-label', v, c),\n accessibilityHint: (n, v, c) => setOrRemove(n, 'aria-description', v, c),\n accessibilityLabelledBy: (n, v, c) => setOrRemove(n, 'aria-labelledby', joinIfArray(v), c),\n accessibilityRole: applyRole,\n role: applyRole,\n accessibilityState: applyAccessibilityState,\n accessibilityValue: applyAccessibilityValue,\n ...Object.fromEntries(Object.keys(PUBLISHED_ARIA).map((attr) => [attr, publishedAria(attr)])),\n accessibilityLiveRegion: (n, v, c) => setOrRemove(n, 'aria-live', v === 'none' ? 'off' : v, c),\n accessibilityElementsHidden: (n, v, c) => {\n setOrRemove(n, 'aria-hidden', v, c || v !== true);\n restorePublishedAria(n, ['aria-hidden']);\n },\n // `no` and `no-hide-descendants` both hide the subtree on the web: ARIA has no way to hide a\n // node from the accessibility tree while keeping its descendants individually reachable, which\n // is the one place `no` and `no-hide-descendants` differ on Android.\n importantForAccessibility: (n, v, c) => {\n const hide = v === 'no' || v === 'no-hide-descendants';\n setOrRemove(n, 'aria-hidden', true, c || !hide);\n restorePublishedAria(n, ['aria-hidden']);\n },\n accessibilityViewIsModal: (n, v, c) => setOrRemove(n, 'aria-modal', v, c || v !== true),\n accessibilityLanguage: (n, v, c) => setOrRemove(n, 'lang', v, c),\n nativeID: (n, v, c) => setOrRemove(n, 'id', v, c),\n id: (n, v, c) => setOrRemove(n, 'id', v, c),\n testID: (n, v, c) => setOrRemove(n, 'data-testid', v, c),\n focusable: (n, v, c) => setOrRemove(n, 'tabindex', v ? '0' : '-1', c),\n pointerEvents: (n, v, c) => {\n // `none` and `auto` map onto the CSS property directly. `box-none` and `box-only` have no\n // exact CSS equivalent - native's version lets a *box* opt out of hit-testing while every\n // descendant keeps receiving touches regardless of its own props; CSS `pointer-events` only\n // has inheritance, which an explicit `auto` on a descendant can override but a plain,\n // untouched descendant cannot escape. Approximated rather than left as a no-op: `box-none`\n // sets `none` on the node itself, `box-only` sets `auto`, which is the more useful default in\n // both directions: a full-window layer that is `box-none` lets touches through to the app\n // under it, and a card inside that sets its own `pointerEvents: 'auto'` opts back in, which\n // is precisely CSS's override rule and needs no web-specific code of its own to work.\n //\n // What this does not do: it does not make an *untouched* descendant of a `box-none` node\n // clickable the way native does automatically - a component that never had to say\n // `pointerEvents=\"auto\"` on native because `box-none` only ever excluded the box itself will\n // need to say so here too. `overlay-host`'s own content is the only place this project has\n // exercised the gap.\n if (v === 'none' || v === 'box-none') setStyleProp(n, 'pointer-events', 'none', c);\n else if (v === 'auto' || v === 'box-only') setStyleProp(n, 'pointer-events', 'auto', c);\n else setStyleProp(n, 'pointer-events', '', true);\n },\n // Object/array props with no scalar form the generic fallback could write, and iOS-only\n // accessibility surfaces with no ARIA equivalent at all. See the file doc comment's second\n // section for why these are named rather than left to fall through.\n hitSlop: noop,\n accessibilityActions: noop,\n nativeBackgroundAndroid: noop,\n nativeForegroundAndroid: noop,\n accessibilityIgnoresInvertColors: noop,\n accessibilityLargeContentTitle: noop,\n accessibilityShowsLargeContentViewer: noop,\n accessibilityRespondsToUserInteraction: noop,\n};\n\n/**\n * A one-line field's `type`: a password while `secureTextEntry` is on, `tel` for a phone keyboard,\n * and `text` otherwise. The other keyboards stay `inputmode` only, which is what picks the\n * on-screen keyboard. In Chromium, `type=\"email\"` throws from `setSelectionRange`, reads null for\n * `selectionStart`, trims the value the app set, and hides the spaces the user types from its\n * value, so `changeText` would report something other than what is on screen. `type=\"url\"` trims\n * the value the app set. `type=\"number\"` has no selection API, and `type=\"search\"` draws a clear\n * button of its own and empties itself on Escape.\n */\nfunction setInputType(n: BrowserNode): void {\n const field = el(n);\n if (field.tagName !== 'INPUT') return;\n const secure = n.props['secureTextEntry'] === true;\n const phone = n.props['keyboardType'] === 'phone-pad';\n (field as HTMLInputElement).type = secure ? 'password' : phone ? 'tel' : 'text';\n}\n\n/** `text-input.ts`'s own props, applied to the `<input>` or `<textarea>` it commits as. */\nconst TEXT_INPUT_HANDLERS: Record<string, Handler> = {\n text: (n, v, c) => {\n const textarea = el(n) as HTMLInputElement | HTMLTextAreaElement;\n const next = c ? '' : String(v);\n // Only when it actually differs: the caret and scroll position reset on every write, even\n // one that sets the value to what it already was, and `TextInput`'s own echo write does\n // exactly that on every keystroke unless this guard is here.\n if (textarea.value !== next) textarea.value = next;\n },\n placeholder: (n, v, c) => setOrRemove(n, 'placeholder', v, c),\n // No inline way to style a pseudo-element, so the colour travels as a custom property and\n // `reset.css` reads it back with `::placeholder`.\n placeholderTextColor: (n, v, c) => setStyleProp(n, '--rn-placeholder-color', v, c),\n keyboardType: (n, v, c) => {\n const map: Record<string, string> = {\n numeric: 'numeric',\n 'number-pad': 'numeric',\n 'decimal-pad': 'decimal',\n 'email-address': 'email',\n 'phone-pad': 'tel',\n url: 'url',\n 'web-search': 'search',\n };\n const mode = typeof v === 'string' ? map[v] : undefined;\n setOrRemove(n, 'inputmode', mode, c || mode === undefined);\n setInputType(n);\n },\n returnKeyType: (n, v, c) => {\n const known = new Set(['done', 'go', 'next', 'search', 'send', 'previous']);\n const hint = typeof v === 'string' && known.has(v) ? v : undefined;\n setOrRemove(n, 'enterkeyhint', hint, c || hint === undefined);\n },\n // A password field where there can be one. A textarea has no password type, so a multiline\n // field masks with the non-standard property, which Firefox does not have.\n secureTextEntry: (n, v, c) => {\n if (el(n).tagName === 'INPUT') setInputType(n);\n else setStyleProp(n, '-webkit-text-security', v ? 'disc' : '', c || !v);\n },\n autoCapitalize: (n, v, c) => setOrRemove(n, 'autocapitalize', v === 'none' ? 'off' : v, c),\n autoCorrect: (n, v, c) => setOrRemove(n, 'autocorrect', v ? 'on' : 'off', c),\n autoFocus: (n, v, c) => {\n if (!c && v) (el(n) as HTMLElement).focus();\n },\n maxLength: (n, v, c) => setOrRemove(n, 'maxlength', v, c),\n multiline: (n, v, c) => setOrRemove(n, 'data-multiline', '', c || v !== true),\n numberOfLines: (n, v, c) => setOrRemove(n, 'rows', v, c || n.props['multiline'] !== true),\n editable: (n, v, c) => {\n (el(n) as HTMLTextAreaElement).readOnly = !c && v === false;\n },\n selection: (n, v, c) => {\n if (c) return;\n const range = v as { start: number; end?: number };\n (el(n) as HTMLTextAreaElement).setSelectionRange(range.start, range.end ?? range.start);\n },\n selectTextOnFocus: (n, v, c) => setOrRemove(n, 'data-select-on-focus', '', c || v !== true),\n textAlign: (n, v, c) => setStyleProp(n, 'text-align', v, c),\n spellCheck: (n, v, c) => setOrRemove(n, 'spellcheck', v ? 'true' : 'false', c),\n autoComplete: (n, v, c) => setOrRemove(n, 'autocomplete', v, c),\n};\n\n/** `switch.ts`'s own props, applied to the `<input type=\"checkbox\">` `elements.ts` creates. */\nconst SWITCH_HANDLERS: Record<string, Handler> = {\n on: (n, v, c) => {\n (el(n) as HTMLInputElement).checked = !c && v === true;\n },\n value: (n, v, c) => {\n (el(n) as HTMLInputElement).checked = !c && v === true;\n },\n disabled: (n, v, c) => {\n (el(n) as HTMLInputElement).disabled = !c && v === true;\n },\n};\n\n/** `image.ts`'s own props. `image` paints with `background-image`; see `elements.ts`. */\nconst IMAGE_HANDLERS: Record<string, Handler> = {\n source: (n, v, c) => {\n const uri = sourceUri(c ? undefined : v);\n setStyleProp(n, 'background-image', uri ? `url(\"${cssEscape(uri)}\")` : '', !uri);\n if (uri) watchImageLoad(n, uri);\n },\n resizeMode: (n, v, c) => {\n const size: Record<string, string> = {\n cover: 'cover',\n contain: 'contain',\n stretch: '100% 100%',\n };\n const mode = typeof v === 'string' ? v : undefined;\n setStyleProp(n, 'background-size', mode ? (size[mode] ?? 'auto') : '', c || !mode);\n setStyleProp(n, 'background-repeat', mode === 'repeat' ? 'repeat' : 'no-repeat', c);\n setStyleProp(n, 'background-position', 'center', c);\n },\n blurRadius: (n, v, c) =>\n setStyleProp(n, 'filter', typeof v === 'number' ? `blur(${v}px)` : '', c),\n /**\n * The picture's own size, which on native is a default the cascade can override. Written as\n * custom properties that `reset.css` reads at the weakest specificity there is, since an inline\n * `width` would beat the app's own classes here exactly as it would on a device.\n */\n intrinsicSize: (n, v, c) => {\n const size = c ? undefined : (v as { width?: unknown; height?: unknown } | undefined);\n const px = (value: unknown) => (typeof value === 'number' ? `${value}px` : '');\n setStyleProp(n, '--rn-intrinsic-width', px(size?.width), !px(size?.width));\n setStyleProp(n, '--rn-intrinsic-height', px(size?.height), !px(size?.height));\n },\n};\n\n/**\n * Says whether a `background-image` loaded, which the property itself will not.\n *\n * An `<image>` paints with `background-image` here (see `elements.ts` for why), and a background\n * fires no `load` or `error` event - only a real `<img>` does. React Native's `Image` reports\n * both, and things depend on it: an avatar-style component that swaps to a fallback when the\n * image errors needs exactly this signal. Without it a broken image URL sat blank forever,\n * showing neither a picture nor a fallback.\n *\n * A detached `Image()` is the standard way to ask. It shares the browser's cache with the\n * background the element is already painting, so this costs a cache lookup rather than a second\n * download.\n *\n * The answer is dispatched as an ordinary DOM event on the element itself, rather than pushed\n * through the engine, so it reaches `(load)` and `(error)` by the same path every other plain\n * binding takes. That is also why `topLoad` and `topError` are not in `browser-engine.ts`'s\n * reserved set: there is a real DOM event of each name here, and it is this one.\n *\n * The uri is remembered so a source that changes mid-flight cannot have its old answer arrive\n * late and overwrite the new one, which is the stale-response guard any fetch needs.\n */\nconst IMAGE_LOADS = new WeakMap<object, string>();\n\nfunction watchImageLoad(node: BrowserNode, uri: string): void {\n IMAGE_LOADS.set(node, uri);\n const el = node.el as Element;\n const view = el.ownerDocument.defaultView;\n if (!view) return;\n const probe = new view.Image();\n const settle = (type: 'load' | 'error') => () => {\n if (IMAGE_LOADS.get(node) === uri) el.dispatchEvent(new view.Event(type));\n };\n probe.addEventListener('load', settle('load'));\n probe.addEventListener('error', settle('error'));\n probe.src = uri;\n}\n\nfunction sourceUri(value: unknown): string | undefined {\n if (!value) return undefined;\n if (typeof value === 'object' && 'uri' in (value as object)) {\n return (value as { uri?: string }).uri;\n }\n if (Array.isArray(value) && value.length > 0) return sourceUri(value[0]);\n return undefined;\n}\n\nfunction cssEscape(value: string): string {\n return value.replace(/[\"\\\\]/g, (c) => `\\\\${c}`);\n}\n\n/**\n * `safe-area-view.ts`'s `edges`/`mode`. Applied on either changing, from both current values,\n * because native takes all four edges together and this follows the same rule (see that file's\n * own `resolvedEdges` comment).\n *\n * `env(safe-area-inset-*)` is the real CSS mechanism for this - a phone with a notch reports a\n * non-zero inset through it, the same number `react-native-safe-area-context` reads on iOS. What\n * is not reproduced: `additive` mode is documented as adding the inset to whatever padding a\n * caller's own class already put there, and there is no way to read that back out of a\n * stylesheet this engine cannot inspect - so `additive` and `maximum` both resolve to `env()`\n * alone here, which is `maximum` against a base of zero. A caller relying on `additive` stacking\n * with its own padding will see less padding on the web than on native.\n */\nconst EDGE_PROP: Record<string, string> = {\n top: 'top',\n right: 'right',\n bottom: 'bottom',\n left: 'left',\n};\n\nfunction applySafeAreaInsets(node: BrowserNode): void {\n const edges = node.props['edges'] as Record<string, string> | undefined;\n const mode = (node.props['mode'] as string | undefined) ?? 'padding';\n const family = mode === 'margin' ? 'margin' : 'padding';\n // The family not in use is cleared too, or switching mode left the old insets behind.\n const other = family === 'margin' ? 'padding' : 'margin';\n for (const edge of Object.keys(EDGE_PROP)) {\n const edgeMode = edges?.[edge];\n const prop = `${family}-${EDGE_PROP[edge]}`;\n setStyleProp(node, `${other}-${EDGE_PROP[edge]}`, '', true);\n if (!edgeMode || edgeMode === 'off') setStyleProp(node, prop, '', true);\n else setStyleProp(node, prop, `env(safe-area-inset-${edge})`, false);\n }\n}\n\nconst SAFE_AREA_HANDLERS: Record<string, Handler> = {\n edges: (n) => applySafeAreaInsets(n),\n mode: (n) => applySafeAreaInsets(n),\n};\n\n/**\n * `modal.ts`'s own props. `visible` defaults to `true` there specifically so a mounted-but-hidden\n * host does not swallow touches over nothing (see that file's doc comment); on the web the same\n * concern is a `hidden` attribute, which `reset.css` gives higher specificity than the layout\n * reset's `display: flex` so it actually hides rather than being immediately overridden by it.\n */\nconst MODAL_HANDLERS: Record<string, Handler> = {\n visible: (n, v, c) => setOrRemove(n, 'hidden', '', c || v !== false),\n transparent: (n, v, c) => setStyleProp(n, 'background-color', 'transparent', c || v !== true),\n};\n\n/**\n * `packages/icons/src/svg-props.ts`'s translation, read back the other way.\n *\n * `fill`/`stroke` arrive as a *brush*, not a colour string: `null` for \"paint nothing\", a real\n * `{type: 0, payload}` object for an actual colour (`payload` already run through\n * `BrowserEngine.color`, which passes a normal CSS colour string straight through), `{type: 2}`\n * for `currentColor`, `{type: 1, brushRef}` for a gradient reference. `strokeLinecap`/\n * `strokeLinejoin`/`fillRule`/`clipRule` arrive as the integers `svg-props.ts` encodes SVG's\n * keywords as - native prop values, not the strings a `<svg-path stroke-linecap=\"round\">` was\n * written with - so the tables below are `svg-props.ts`'s own `LINECAP`/`LINEJOIN`/`FILL_RULE`\n * read backwards. `strokeDasharray` arrives as a string array, already split on commas/whitespace\n * rather than the original string; `matrix` as the six numbers of a 2x3 matrix rather than the\n * `transform` string they came from. All are reconstructed here into the attribute form a browser\n * wants.\n *\n * `propList` gets nothing: it is native prop names this element declared for itself, so that\n * *its* `RNSVGGroup`/`RNSVGPath` inherits nothing it did not ask to inherit - a fake for\n * inheritance real SVG attributes already do on their own, which is the entire reason\n * `svg-props.ts` had to invent it.\n *\n * Geometry (`d`, `cx`, `cy`, `r`, `rx`, `ry`, `x`, `y`, `width`, `height`, `x1`, `y1`, `x2`, `y2`)\n * gets no handler either, on purpose: those prop names are already the SVG attribute names,\n * untouched by `nativeProps`, so `applyProp`'s generic string/number fallback at the bottom of\n * this file writes them correctly with nothing said here.\n */\nfunction brushAttr(value: unknown): string | undefined {\n const brush = value as { type: number; payload?: unknown; brushRef?: string };\n if (brush.type === 2) return 'currentColor';\n if (brush.type === 1) return `url(#${brush.brushRef})`;\n if (brush.type === 0) return typeof brush.payload === 'string' ? brush.payload : undefined;\n return undefined;\n}\n\n/**\n * `fill`/`stroke`. Reads `value` itself rather than the `clear` flag `applyProp` would otherwise\n * pass every other handler, because `clear` alone cannot tell apart the two things a cleared\n * brush prop means: `undefined` (\"never declared - inherit from the ancestor group, same as real\n * SVG's own cascade\") and the brush `null` (\"declared as `none` - paint nothing, even if an\n * ancestor would otherwise supply a paint\"). Only the second needs an attribute written at all.\n * `dom-node.ts`'s `SVG_BRUSH_ELEMENTS` seeding is what makes sure this handler is even reached for\n * a shape's first `fill=\"none\"`/`stroke=\"none\"` - see that file's own doc comment for why a\n * `null` brush needs help getting here in the first place.\n */\nfunction applyBrush(node: BrowserNode, attr: string, value: unknown): void {\n if (value === undefined) {\n el(node).removeAttribute(attr);\n return;\n }\n if (value === null) {\n el(node).setAttribute(attr, 'none');\n return;\n }\n const resolved = brushAttr(value);\n if (resolved === undefined) el(node).removeAttribute(attr);\n else el(node).setAttribute(attr, resolved);\n}\n\nconst LINECAP_KEYWORD: Record<number, string> = { 0: 'butt', 1: 'round', 2: 'square' };\nconst LINEJOIN_KEYWORD: Record<number, string> = { 0: 'miter', 1: 'round', 2: 'bevel' };\nconst FILL_RULE_KEYWORD: Record<number, string> = { 0: 'evenodd', 1: 'nonzero' };\n\nfunction applyKeyword(\n node: BrowserNode,\n attr: string,\n map: Readonly<Record<number, string>>,\n value: unknown,\n clear: boolean,\n): void {\n const resolved = typeof value === 'number' ? map[value] : undefined;\n setOrRemove(node, attr, resolved, clear || resolved === undefined);\n}\n\n/**\n * Every shape `ng-icon.ts` parses out of an icon's markup - `svg-path`, `svg-rect`, `svg-circle`,\n * `svg-line`, plus `svg-g` and `svg-ellipse` - shares this one set of presentation props, the\n * same names `svg-props.ts`'s own `PRESENTATION` table lists.\n */\nconst SVG_PRESENTATION_HANDLERS: Record<string, Handler> = {\n fill: (n, v) => applyBrush(n, 'fill', v),\n stroke: (n, v) => applyBrush(n, 'stroke', v),\n fillOpacity: (n, v, c) => setOrRemove(n, 'fill-opacity', v, c),\n strokeOpacity: (n, v, c) => setOrRemove(n, 'stroke-opacity', v, c),\n strokeWidth: (n, v, c) => setOrRemove(n, 'stroke-width', v, c),\n strokeLinecap: (n, v, c) => applyKeyword(n, 'stroke-linecap', LINECAP_KEYWORD, v, c),\n strokeLinejoin: (n, v, c) => applyKeyword(n, 'stroke-linejoin', LINEJOIN_KEYWORD, v, c),\n fillRule: (n, v, c) => applyKeyword(n, 'fill-rule', FILL_RULE_KEYWORD, v, c),\n clipRule: (n, v, c) => applyKeyword(n, 'clip-rule', FILL_RULE_KEYWORD, v, c),\n strokeDasharray: (n, v, c) => {\n const joined = Array.isArray(v) ? v.join(',') : undefined;\n setOrRemove(n, 'stroke-dasharray', joined, c || joined === undefined);\n },\n strokeDashoffset: (n, v, c) => setOrRemove(n, 'stroke-dashoffset', v, c),\n strokeMiterlimit: (n, v, c) => setOrRemove(n, 'stroke-miterlimit', v, c),\n opacity: (n, v, c) => setOrRemove(n, 'opacity', v, c),\n matrix: (n, v, c) => {\n const matrix = Array.isArray(v) ? `matrix(${v.join(',')})` : undefined;\n setOrRemove(n, 'transform', matrix, c || matrix === undefined);\n },\n propList: noop,\n};\n\n/**\n * A gradient, read back from `svg-props.ts`'s `gradientProps`. Its stops arrive as one flat list,\n * `[offset, colour, offset, colour]`, which is how native takes them, and a browser wants them as\n * `<stop>` children. Its `name` is the `id` a `url(#id)` brush finds it by, and a radial one's\n * two radii are the one `r` it was written with.\n */\nconst SVG_GRADIENT_HANDLERS: Record<string, Handler> = {\n name: (n, v, c) => setOrRemove(n, 'id', v, c),\n gradient: (n, v) => {\n const list = Array.isArray(v) ? v : [];\n const stops: Element[] = [];\n for (let i = 0; i + 1 < list.length; i += 2) {\n const stop = el(n).ownerDocument.createElementNS(el(n).namespaceURI, 'stop');\n stop.setAttribute('offset', String(list[i]));\n stop.setAttribute('stop-color', String(list[i + 1]));\n stops.push(stop);\n }\n el(n).replaceChildren(...stops);\n },\n gradientUnits: (n, v, c) =>\n setOrRemove(n, 'gradientUnits', v === 1 ? 'userSpaceOnUse' : 'objectBoundingBox', c),\n gradientTransform: (n, v, c) => {\n const matrix = Array.isArray(v) ? `matrix(${v.join(',')})` : undefined;\n setOrRemove(n, 'gradientTransform', matrix, c || matrix === undefined);\n },\n rx: (n, v, c) => setOrRemove(n, 'r', v, c),\n ry: noop,\n};\n\n/** The attributes `svg-props.ts`'s `textProps` gathers into the one `font` object native reads. */\nconst FONT_ATTRIBUTES = [\n 'font-size',\n 'font-weight',\n 'font-style',\n 'font-family',\n 'font-variant',\n 'font-stretch',\n 'text-anchor',\n 'text-decoration',\n 'letter-spacing',\n 'word-spacing',\n 'kerning',\n];\n\nconst camelCase = (name: string): string =>\n name.replace(/-([a-z])/g, (_, letter: string) => letter.toUpperCase());\n\n/** A position list, `x: ['0', '9']`, as the attribute it was written as. An empty one is none. */\nconst lengthList =\n (attr: string): Handler =>\n (n, v) => {\n const list = Array.isArray(v) ? v : [];\n setOrRemove(n, attr, list.join(' '), list.length === 0);\n };\n\n/** A `text` or a `tspan`: a shape's paint, with its font, its positions and its characters. */\nconst SVG_TEXT_HANDLERS: Record<string, Handler> = {\n ...SVG_PRESENTATION_HANDLERS,\n font: (n, v) => {\n const font = (v ?? {}) as Record<string, unknown>;\n for (const attr of FONT_ATTRIBUTES) {\n const value = font[camelCase(attr)];\n setOrRemove(n, attr, value, value === undefined || value === null);\n }\n },\n x: lengthList('x'),\n y: lengthList('y'),\n dx: lengthList('dx'),\n dy: lengthList('dy'),\n rotate: lengthList('rotate'),\n content: (n, v, c) => {\n el(n).textContent = c ? '' : String(v);\n },\n};\n\n/**\n * The SVG root's own sizing props - `ng-icon.ts`'s host bindings, none of which go through\n * `svg-props.ts`'s `nativeProps` (they are written directly, not parsed off markup).\n * `minX`/`minY`/`vbWidth`/`vbHeight` build one `viewBox` attribute together, and\n * `align`/`meetOrSlice` build one `preserveAspectRatio` together, so each handler rereads every\n * prop in its group off `node.props` rather than trusting the single value it was called with -\n * the same pattern `applySafeAreaInsets` above uses for `edges`/`mode`, needed for the same\n * reason: Angular commits host bindings one at a time, so whichever of a group changes first would\n * otherwise write an attribute built from the rest still being stale (`undefined`, before their\n * own first commit) or from a previous render's values.\n */\nfunction applySvgViewBox(node: BrowserNode): void {\n const minX = node.props['minX'];\n const minY = node.props['minY'];\n const vbWidth = node.props['vbWidth'];\n const vbHeight = node.props['vbHeight'];\n const complete =\n typeof minX === 'number' &&\n typeof minY === 'number' &&\n typeof vbWidth === 'number' &&\n typeof vbHeight === 'number';\n setOrRemove(\n node,\n 'viewBox',\n complete ? `${minX} ${minY} ${vbWidth} ${vbHeight}` : undefined,\n !complete,\n );\n}\n\n/**\n * `bbWidth`/`bbHeight` are the root's own rendered size in points - `NgIcon`'s `size()` input -\n * kept as real `width`/`height` attributes alongside the `[style]` host binding that sizes the\n * box for layout, so an inspector reading the SVG element in isolation sees the same size CSS is\n * about to give it.\n */\nfunction applySvgSize(node: BrowserNode): void {\n const bbWidth = node.props['bbWidth'];\n const bbHeight = node.props['bbHeight'];\n setOrRemove(node, 'width', bbWidth, typeof bbWidth !== 'number');\n setOrRemove(node, 'height', bbHeight, typeof bbHeight !== 'number');\n}\n\n/**\n * `0`/`1`/`2` are `RNSVGSvgView`'s own encoding of `meet`/`slice`/`none` - see `svg-props.ts`'s\n * `viewBoxProps`, which always sends `0` for both roots today. `slice`/`none` are translated on\n * the chance a future caller sets one directly, not because either root emits them yet; that\n * would be a divergence worth noting if it ever mattered, but nothing in this codebase exercises\n * it.\n */\nconst MEET_OR_SLICE: Record<number, string> = { 0: 'meet', 1: 'slice', 2: 'none' };\n\nfunction applySvgAspectRatio(node: BrowserNode): void {\n const align = node.props['align'];\n const meetOrSlice = node.props['meetOrSlice'];\n if (typeof align !== 'string') {\n el(node).removeAttribute('preserveAspectRatio');\n return;\n }\n const slice = typeof meetOrSlice === 'number' ? (MEET_OR_SLICE[meetOrSlice] ?? 'meet') : 'meet';\n el(node).setAttribute('preserveAspectRatio', `${align} ${slice}`);\n}\n\nconst SVG_ROOT_HANDLERS: Record<string, Handler> = {\n minX: (n) => applySvgViewBox(n),\n minY: (n) => applySvgViewBox(n),\n vbWidth: (n) => applySvgViewBox(n),\n vbHeight: (n) => applySvgViewBox(n),\n bbWidth: (n) => applySvgSize(n),\n bbHeight: (n) => applySvgSize(n),\n align: (n) => applySvgAspectRatio(n),\n meetOrSlice: (n) => applySvgAspectRatio(n),\n // `NgIcon`'s own `[color]` host binding - what a shape's `currentColor` brush (`brushAttr`'s\n // `{type: 2}` case, written as the literal attribute value `currentColor`) resolves against.\n // Real SVG's `currentColor` already means \"this element's computed CSS `color`\", so setting it\n // here as an inline style *is* the whole translation - no downstream shape needs to know the\n // actual value, exactly as native's brush stays unresolved until the view paints.\n color: (n, v, c) => setStyleProp(n, 'color', v, c || typeof v !== 'string'),\n};\n\n/**\n * `activity-indicator.ts`'s colour, as the `color` its spinner in `reset.css` paints with. The\n * spinner is drawn by the stylesheet, and `animating` and `hidesWhenStopped` reach it as the\n * plain attributes the fallback writes.\n */\nconst ACTIVITY_INDICATOR_HANDLERS: Record<string, Handler> = {\n color: (n, v, c) => setStyleProp(n, 'color', v, c || typeof v !== 'string'),\n};\n\n/**\n * `text.ts`'s `numberOfLines`, as the attribute and the line count `reset.css` clamps the text\n * with. Neither is written for `0`, which is no limit on a device, as it is when the prop is unset.\n */\nconst TEXT_HANDLERS: Record<string, Handler> = {\n numberOfLines: (n, v, c) => {\n const lines = typeof v === 'number' && v > 0 ? v : undefined;\n setOrRemove(n, 'numberoflines', lines, c || lines === undefined);\n setStyleProp(n, '--rn-number-of-lines', lines, c || lines === undefined);\n },\n};\n\nconst BY_ELEMENT: Record<string, Record<string, Handler>> = {\n text: TEXT_HANDLERS,\n 'activity-indicator': ACTIVITY_INDICATOR_HANDLERS,\n 'text-input': TEXT_INPUT_HANDLERS,\n switch: SWITCH_HANDLERS,\n image: IMAGE_HANDLERS,\n 'safe-area-view': SAFE_AREA_HANDLERS,\n modal: MODAL_HANDLERS,\n 'svg-g': SVG_PRESENTATION_HANDLERS,\n 'svg-path': SVG_PRESENTATION_HANDLERS,\n 'svg-circle': SVG_PRESENTATION_HANDLERS,\n 'svg-ellipse': SVG_PRESENTATION_HANDLERS,\n 'svg-rect': SVG_PRESENTATION_HANDLERS,\n 'svg-line': SVG_PRESENTATION_HANDLERS,\n 'svg-linear-gradient': SVG_GRADIENT_HANDLERS,\n 'svg-radial-gradient': SVG_GRADIENT_HANDLERS,\n 'svg-text': SVG_TEXT_HANDLERS,\n 'svg-tspan': SVG_TEXT_HANDLERS,\n 'ng-icon': SVG_ROOT_HANDLERS,\n};\n\n/**\n * Apply one prop to its node. `clear` is `value === undefined || value === null`.\n *\n * A key with a handler - either element-specific or from `ViewBase`'s own set - runs exactly\n * that translation. Everything else falls to the generic attribute write the file doc comment\n * describes, which is why a `noop` entry (`hitSlop`, `accessibilityActions`, ...) has to be a\n * real entry rather than an absent one: an absent key falls through and gets written as a raw\n * attribute, a `noop` key is claimed and genuinely does nothing.\n */\nexport function applyProp(node: BrowserNode, key: string, value: unknown, clear: boolean): void {\n const elementHandler = BY_ELEMENT[node.name]?.[key];\n const baseHandler = VIEW_BASE_HANDLERS[key];\n if (elementHandler || baseHandler) {\n elementHandler?.(node, value, clear);\n baseHandler?.(node, value, clear);\n return;\n }\n if (clear) {\n el(node).removeAttribute(key);\n return;\n }\n if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean') {\n el(node).setAttribute(key, String(value));\n }\n}\n"]}
|
package/dist/reset-css.d.ts
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* `.css` only, and the version `mount` actually injects would have gone on shipping the old
|
|
14
14
|
* rules with nothing to say so.
|
|
15
15
|
*/
|
|
16
|
-
export declare const RESET_CSS = "\n[data-rn] {\n box-sizing: border-box;\n position: relative;\n flex-shrink: 0;\n min-width: 0;\n min-height: 0;\n}\n\n[data-rn]:where(:not([data-rn='root'])) {\n border-width: 0;\n border-style: solid;\n border-color: black;\n}\n\nhtml,\nbody {\n height: 100%;\n}\n\n[data-rn-root] {\n height: 100%;\n display: flex;\n flex-direction: column;\n}\n\nbody {\n font-family: var(\n --font-sans,\n system-ui,\n -apple-system,\n 'Segoe UI',\n Roboto,\n 'Helvetica Neue',\n Arial,\n sans-serif\n );\n font-size: 14px;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n}\n\n[data-rn]:not([data-rn='text']):not(\n :where(\n :is(\n [data-rn='span'],\n [data-rn='p'],\n [data-rn='h1'],\n [data-rn='h2'],\n [data-rn='h3'],\n [data-rn='h4'],\n [data-rn='h5'],\n [data-rn='h6'],\n [data-rn='label'],\n [data-rn='strong'],\n [data-rn='b'],\n [data-rn='em'],\n [data-rn='i'],\n [data-rn='u'],\n [data-rn='s'],\n [data-rn='small'],\n [data-rn='code'],\n [data-rn='mark'],\n [data-rn='abbr'],\n [data-rn='cite'],\n [data-rn='time']\n ):not(\n :has(\n [data-rn]:not(\n [data-rn='text'],\n [data-rn='span'],\n [data-rn='p'],\n [data-rn='h1'],\n [data-rn='h2'],\n [data-rn='h3'],\n [data-rn='h4'],\n [data-rn='h5'],\n [data-rn='h6'],\n [data-rn='label'],\n [data-rn='strong'],\n [data-rn='b'],\n [data-rn='em'],\n [data-rn='i'],\n [data-rn='u'],\n [data-rn='s'],\n [data-rn='small'],\n [data-rn='code'],\n [data-rn='mark'],\n [data-rn='abbr'],\n [data-rn='cite'],\n [data-rn='time']\n )\n )\n )\n )\n ) {\n display: flex;\n flex-direction: column;\n align-items: stretch;\n}\n\n[data-rn='text'],\n:where(\n :is(\n [data-rn='span'],\n [data-rn='p'],\n [data-rn='h1'],\n [data-rn='h2'],\n [data-rn='h3'],\n [data-rn='h4'],\n [data-rn='h5'],\n [data-rn='h6'],\n [data-rn='label'],\n [data-rn='strong'],\n [data-rn='b'],\n [data-rn='em'],\n [data-rn='i'],\n [data-rn='u'],\n [data-rn='s'],\n [data-rn='small'],\n [data-rn='code'],\n [data-rn='mark'],\n [data-rn='abbr'],\n [data-rn='cite'],\n [data-rn='time']\n ):not(\n :has(\n [data-rn]:not(\n [data-rn='text'],\n [data-rn='span'],\n [data-rn='p'],\n [data-rn='h1'],\n [data-rn='h2'],\n [data-rn='h3'],\n [data-rn='h4'],\n [data-rn='h5'],\n [data-rn='h6'],\n [data-rn='label'],\n [data-rn='strong'],\n [data-rn='b'],\n [data-rn='em'],\n [data-rn='i'],\n [data-rn='u'],\n [data-rn='s'],\n [data-rn='small'],\n [data-rn='code'],\n [data-rn='mark'],\n [data-rn='abbr'],\n [data-rn='cite'],\n [data-rn='time']\n )\n )\n )\n)[data-rn] {\n display: inline;\n}\n\n:where(h1, h2, h3, h4, h5, h6, p)[data-rn] {\n font-size: inherit;\n font-weight: inherit;\n margin: 0;\n}\n\n:where(ul, ol)[data-rn] {\n list-style: none;\n margin: 0;\n padding: 0;\n}\n\n:where(strong, b)[data-rn] {\n font-weight: bold;\n}\n\n:where(small)[data-rn] {\n font-size: 80%;\n}\n\n:where(code)[data-rn] {\n font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;\n font-size: 1em;\n}\n\n:where(mark)[data-rn] {\n background-color: rgb(255, 255, 0);\n color: rgb(0, 0, 0);\n}\n\n[data-rn='scroll-view'],\n[data-rn='virtual-list'] {\n flex-grow: 1;\n flex-shrink: 1;\n flex-direction: column;\n overflow: auto;\n -webkit-overflow-scrolling: touch;\n}\n\n[data-rn='scroll-view'][flexdirection='row'] {\n flex-direction: row;\n}\n\n[data-rn='scroll-view'][scrollenabled='false'] {\n overflow: hidden;\n}\n\n[data-rn='image'] {\n background-size: cover;\n background-repeat: no-repeat;\n background-position: center;\n}\n\n:where([data-rn='image']) {\n width: var(--rn-intrinsic-width, auto);\n height: var(--rn-intrinsic-height, auto);\n}\n\n:where([data-rn='gesture-root']) {\n flex-grow: 1;\n flex-basis: 0%;\n}\n\n[data-rn='modal'] {\n position: fixed;\n inset: 0;\n z-index: 1000;\n background-color: rgb(0 0 0 / 50%);\n}\n[data-rn='modal'][hidden] {\n display: none;\n}\n\n[data-rn='input-accessory-view'] {\n position: fixed;\n left: 0;\n right: 0;\n bottom: 0;\n}\n\n[data-rn='activity-indicator'] {\n color: #999999;\n}\n[data-rn='activity-indicator']::after {\n content: '';\n box-sizing: border-box;\n flex: 1;\n border: 2px solid currentColor;\n border-right-color: transparent;\n border-radius: 50%;\n animation: rn-activity-indicator 0.8s linear infinite;\n}\n[data-rn='activity-indicator'][animating='false']::after {\n animation-play-state: paused;\n}\n[data-rn='activity-indicator'][animating='false']:not([hideswhenstopped='false'])::after {\n visibility: hidden;\n}\n@keyframes rn-activity-indicator {\n to {\n transform: rotate(360deg);\n }\n}\n\n[data-rn='text-input'] {\n background-color: transparent;\n font: inherit;\n color: inherit;\n letter-spacing: inherit;\n text-transform: inherit;\n margin: 0;\n padding: 0;\n resize: none;\n}\n\n[data-rn='text-input']::placeholder {\n /* A device draws an unset placeholder grey; this is the text colour, faded, on any theme. */\n color: var(--rn-placeholder-color, color-mix(in srgb, currentColor 45%, transparent));\n}\n\n[data-rn='gradient-text'] {\n -webkit-background-clip: text;\n background-clip: text;\n}\n\n[data-rn='gradient-text'] > [data-rn='text'][data-rn] {\n color: transparent;\n}\n\n[data-rn='gradient-text'] > [data-rn='view'][data-rn] {\n display: none;\n}\n";
|
|
16
|
+
export declare const RESET_CSS = "\n[data-rn] {\n box-sizing: border-box;\n position: relative;\n flex-shrink: 0;\n min-width: 0;\n min-height: 0;\n}\n\n[data-rn]:where(:not([data-rn='root'])) {\n border-width: 0;\n border-style: solid;\n border-color: black;\n}\n\nhtml,\nbody {\n height: 100%;\n}\n\n[data-rn-root] {\n height: 100%;\n display: flex;\n flex-direction: column;\n}\n\nbody {\n font-family: var(\n --font-sans,\n system-ui,\n -apple-system,\n 'Segoe UI',\n Roboto,\n 'Helvetica Neue',\n Arial,\n sans-serif\n );\n font-size: 14px;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n}\n\n[data-rn]:not([data-rn='text']):not(\n :where(\n :is(\n [data-rn='span'],\n [data-rn='p'],\n [data-rn='h1'],\n [data-rn='h2'],\n [data-rn='h3'],\n [data-rn='h4'],\n [data-rn='h5'],\n [data-rn='h6'],\n [data-rn='label'],\n [data-rn='strong'],\n [data-rn='b'],\n [data-rn='em'],\n [data-rn='i'],\n [data-rn='u'],\n [data-rn='s'],\n [data-rn='small'],\n [data-rn='code'],\n [data-rn='mark'],\n [data-rn='abbr'],\n [data-rn='cite'],\n [data-rn='time']\n ):not(\n :has(\n [data-rn]:not(\n [data-rn='text'],\n [data-rn='span'],\n [data-rn='p'],\n [data-rn='h1'],\n [data-rn='h2'],\n [data-rn='h3'],\n [data-rn='h4'],\n [data-rn='h5'],\n [data-rn='h6'],\n [data-rn='label'],\n [data-rn='strong'],\n [data-rn='b'],\n [data-rn='em'],\n [data-rn='i'],\n [data-rn='u'],\n [data-rn='s'],\n [data-rn='small'],\n [data-rn='code'],\n [data-rn='mark'],\n [data-rn='abbr'],\n [data-rn='cite'],\n [data-rn='time']\n )\n )\n )\n )\n ) {\n display: flex;\n flex-direction: column;\n align-items: stretch;\n}\n\n[data-rn='text'],\n:where(\n :is(\n [data-rn='span'],\n [data-rn='p'],\n [data-rn='h1'],\n [data-rn='h2'],\n [data-rn='h3'],\n [data-rn='h4'],\n [data-rn='h5'],\n [data-rn='h6'],\n [data-rn='label'],\n [data-rn='strong'],\n [data-rn='b'],\n [data-rn='em'],\n [data-rn='i'],\n [data-rn='u'],\n [data-rn='s'],\n [data-rn='small'],\n [data-rn='code'],\n [data-rn='mark'],\n [data-rn='abbr'],\n [data-rn='cite'],\n [data-rn='time']\n ):not(\n :has(\n [data-rn]:not(\n [data-rn='text'],\n [data-rn='span'],\n [data-rn='p'],\n [data-rn='h1'],\n [data-rn='h2'],\n [data-rn='h3'],\n [data-rn='h4'],\n [data-rn='h5'],\n [data-rn='h6'],\n [data-rn='label'],\n [data-rn='strong'],\n [data-rn='b'],\n [data-rn='em'],\n [data-rn='i'],\n [data-rn='u'],\n [data-rn='s'],\n [data-rn='small'],\n [data-rn='code'],\n [data-rn='mark'],\n [data-rn='abbr'],\n [data-rn='cite'],\n [data-rn='time']\n )\n )\n )\n)[data-rn] {\n display: inline;\n}\n\n:where(h1, h2, h3, h4, h5, h6, p)[data-rn] {\n font-size: inherit;\n font-weight: inherit;\n margin: 0;\n}\n\n:where(ul, ol)[data-rn] {\n list-style: none;\n margin: 0;\n padding: 0;\n}\n\n:where(strong, b)[data-rn] {\n font-weight: bold;\n}\n\n:where(small)[data-rn] {\n font-size: 80%;\n}\n\n:where(code)[data-rn] {\n font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;\n font-size: 1em;\n}\n\n:where(mark)[data-rn] {\n background-color: rgb(255, 255, 0);\n color: rgb(0, 0, 0);\n}\n\n[data-rn='text']:where([numberoflines]:not([data-rn='text'] *)) {\n display: -webkit-box;\n -webkit-box-orient: vertical;\n -webkit-line-clamp: var(--rn-number-of-lines);\n overflow: hidden;\n}\n\n[data-rn='text']:where([numberoflines][ellipsizemode='clip']:not([data-rn='text'] *)) {\n display: block;\n -webkit-line-clamp: none;\n max-height: calc(var(--rn-number-of-lines) * 1lh);\n}\n\n[data-rn='scroll-view'],\n[data-rn='virtual-list'] {\n flex-grow: 1;\n flex-shrink: 1;\n flex-direction: column;\n overflow: auto;\n -webkit-overflow-scrolling: touch;\n}\n\n[data-rn='scroll-view'][flexdirection='row'] {\n flex-direction: row;\n}\n\n[data-rn='scroll-view'][scrollenabled='false'] {\n overflow: hidden;\n}\n\n[data-rn='scroll-view'][pagingenabled='true'] {\n scroll-snap-type: y mandatory;\n}\n\n[data-rn='scroll-view'][pagingenabled='true'][horizontal='true'] {\n scroll-snap-type: x mandatory;\n}\n\n[data-rn='scroll-view'][pagingenabled='true'] > [data-rn='view'] > * {\n scroll-snap-align: start;\n scroll-snap-stop: always;\n}\n\n[data-rn='image'] {\n background-size: cover;\n background-repeat: no-repeat;\n background-position: center;\n}\n\n:where([data-rn='image']) {\n width: var(--rn-intrinsic-width, auto);\n height: var(--rn-intrinsic-height, auto);\n}\n\n:where([data-rn='gesture-root']) {\n flex-grow: 1;\n flex-basis: 0%;\n}\n\n[data-rn='modal'] {\n position: fixed;\n inset: 0;\n z-index: 1000;\n background-color: rgb(0 0 0 / 50%);\n}\n[data-rn='modal'][hidden] {\n display: none;\n}\n\n[data-rn='input-accessory-view'] {\n position: fixed;\n left: 0;\n right: 0;\n bottom: 0;\n}\n\n[data-rn='activity-indicator'] {\n color: #999999;\n}\n[data-rn='activity-indicator']::after {\n content: '';\n box-sizing: border-box;\n flex: 1;\n border: 2px solid currentColor;\n border-right-color: transparent;\n border-radius: 50%;\n animation: rn-activity-indicator 0.8s linear infinite;\n}\n[data-rn='activity-indicator'][animating='false']::after {\n animation-play-state: paused;\n}\n[data-rn='activity-indicator'][animating='false']:not([hideswhenstopped='false'])::after {\n visibility: hidden;\n}\n@keyframes rn-activity-indicator {\n to {\n transform: rotate(360deg);\n }\n}\n\n[data-rn='text-input'] {\n background-color: transparent;\n font: inherit;\n color: inherit;\n letter-spacing: inherit;\n text-transform: inherit;\n margin: 0;\n padding: 0;\n resize: none;\n}\n\n[data-rn='text-input']::placeholder {\n /* A device draws an unset placeholder grey; this is the text colour, faded, on any theme. */\n color: var(--rn-placeholder-color, color-mix(in srgb, currentColor 45%, transparent));\n}\n\n[data-rn='gradient-text'] {\n -webkit-background-clip: text;\n background-clip: text;\n}\n\n[data-rn='gradient-text'] > [data-rn='text'][data-rn] {\n color: transparent;\n}\n\n[data-rn='gradient-text'] > [data-rn='view'][data-rn] {\n display: none;\n}\n";
|
|
17
17
|
/**
|
|
18
18
|
* The reset for an island inside someone else's page: `RESET_CSS` without the two rules that
|
|
19
19
|
* reach outside the island.
|
package/dist/reset-css.js
CHANGED
|
@@ -200,6 +200,19 @@ body {
|
|
|
200
200
|
color: rgb(0, 0, 0);
|
|
201
201
|
}
|
|
202
202
|
|
|
203
|
+
[data-rn='text']:where([numberoflines]:not([data-rn='text'] *)) {
|
|
204
|
+
display: -webkit-box;
|
|
205
|
+
-webkit-box-orient: vertical;
|
|
206
|
+
-webkit-line-clamp: var(--rn-number-of-lines);
|
|
207
|
+
overflow: hidden;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
[data-rn='text']:where([numberoflines][ellipsizemode='clip']:not([data-rn='text'] *)) {
|
|
211
|
+
display: block;
|
|
212
|
+
-webkit-line-clamp: none;
|
|
213
|
+
max-height: calc(var(--rn-number-of-lines) * 1lh);
|
|
214
|
+
}
|
|
215
|
+
|
|
203
216
|
[data-rn='scroll-view'],
|
|
204
217
|
[data-rn='virtual-list'] {
|
|
205
218
|
flex-grow: 1;
|
|
@@ -217,6 +230,19 @@ body {
|
|
|
217
230
|
overflow: hidden;
|
|
218
231
|
}
|
|
219
232
|
|
|
233
|
+
[data-rn='scroll-view'][pagingenabled='true'] {
|
|
234
|
+
scroll-snap-type: y mandatory;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
[data-rn='scroll-view'][pagingenabled='true'][horizontal='true'] {
|
|
238
|
+
scroll-snap-type: x mandatory;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
[data-rn='scroll-view'][pagingenabled='true'] > [data-rn='view'] > * {
|
|
242
|
+
scroll-snap-align: start;
|
|
243
|
+
scroll-snap-stop: always;
|
|
244
|
+
}
|
|
245
|
+
|
|
220
246
|
[data-rn='image'] {
|
|
221
247
|
background-size: cover;
|
|
222
248
|
background-repeat: no-repeat;
|
package/dist/reset-css.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reset-css.js","sourceRoot":"","sources":["../src/reset-css.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG
|
|
1
|
+
{"version":3,"file":"reset-css.js","sourceRoot":"","sources":["../src/reset-css.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2TxB,CAAC;AAEF;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,SAAS,CAAC,OAAO,CAAC,6BAA6B,EAAE,EAAE,CAAC,CAAC,OAAO,CAC1F,iBAAiB,EACjB,oBAAoB,CACrB,CAAC","sourcesContent":["/**\n * `reset.css`'s content, as a string `mount()` can inject with no bundler CSS loader required.\n *\n * A second copy of `reset.css`, because this package ships raw TypeScript with no build step of\n * its own (see `package.json`), so there is nothing here to run a codegen script as part of. A\n * consumer with no CSS loader in their bundler still gets a working stylesheet from\n * `mount({ injectReset: true })` alone, and an app that would rather control ordering against\n * Tailwind imports the `.css` file instead.\n *\n * `reset.css` is the one to read and to edit. This one carries the same rules with the comments\n * stripped, and `reset-parity.test.ts` fails the moment the two disagree about a single\n * declaration - which is not a nicety. The first edit after this file was written landed in the\n * `.css` only, and the version `mount` actually injects would have gone on shipping the old\n * rules with nothing to say so.\n */\nexport const RESET_CSS = `\n[data-rn] {\n box-sizing: border-box;\n position: relative;\n flex-shrink: 0;\n min-width: 0;\n min-height: 0;\n}\n\n[data-rn]:where(:not([data-rn='root'])) {\n border-width: 0;\n border-style: solid;\n border-color: black;\n}\n\nhtml,\nbody {\n height: 100%;\n}\n\n[data-rn-root] {\n height: 100%;\n display: flex;\n flex-direction: column;\n}\n\nbody {\n font-family: var(\n --font-sans,\n system-ui,\n -apple-system,\n 'Segoe UI',\n Roboto,\n 'Helvetica Neue',\n Arial,\n sans-serif\n );\n font-size: 14px;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n}\n\n[data-rn]:not([data-rn='text']):not(\n :where(\n :is(\n [data-rn='span'],\n [data-rn='p'],\n [data-rn='h1'],\n [data-rn='h2'],\n [data-rn='h3'],\n [data-rn='h4'],\n [data-rn='h5'],\n [data-rn='h6'],\n [data-rn='label'],\n [data-rn='strong'],\n [data-rn='b'],\n [data-rn='em'],\n [data-rn='i'],\n [data-rn='u'],\n [data-rn='s'],\n [data-rn='small'],\n [data-rn='code'],\n [data-rn='mark'],\n [data-rn='abbr'],\n [data-rn='cite'],\n [data-rn='time']\n ):not(\n :has(\n [data-rn]:not(\n [data-rn='text'],\n [data-rn='span'],\n [data-rn='p'],\n [data-rn='h1'],\n [data-rn='h2'],\n [data-rn='h3'],\n [data-rn='h4'],\n [data-rn='h5'],\n [data-rn='h6'],\n [data-rn='label'],\n [data-rn='strong'],\n [data-rn='b'],\n [data-rn='em'],\n [data-rn='i'],\n [data-rn='u'],\n [data-rn='s'],\n [data-rn='small'],\n [data-rn='code'],\n [data-rn='mark'],\n [data-rn='abbr'],\n [data-rn='cite'],\n [data-rn='time']\n )\n )\n )\n )\n ) {\n display: flex;\n flex-direction: column;\n align-items: stretch;\n}\n\n[data-rn='text'],\n:where(\n :is(\n [data-rn='span'],\n [data-rn='p'],\n [data-rn='h1'],\n [data-rn='h2'],\n [data-rn='h3'],\n [data-rn='h4'],\n [data-rn='h5'],\n [data-rn='h6'],\n [data-rn='label'],\n [data-rn='strong'],\n [data-rn='b'],\n [data-rn='em'],\n [data-rn='i'],\n [data-rn='u'],\n [data-rn='s'],\n [data-rn='small'],\n [data-rn='code'],\n [data-rn='mark'],\n [data-rn='abbr'],\n [data-rn='cite'],\n [data-rn='time']\n ):not(\n :has(\n [data-rn]:not(\n [data-rn='text'],\n [data-rn='span'],\n [data-rn='p'],\n [data-rn='h1'],\n [data-rn='h2'],\n [data-rn='h3'],\n [data-rn='h4'],\n [data-rn='h5'],\n [data-rn='h6'],\n [data-rn='label'],\n [data-rn='strong'],\n [data-rn='b'],\n [data-rn='em'],\n [data-rn='i'],\n [data-rn='u'],\n [data-rn='s'],\n [data-rn='small'],\n [data-rn='code'],\n [data-rn='mark'],\n [data-rn='abbr'],\n [data-rn='cite'],\n [data-rn='time']\n )\n )\n )\n)[data-rn] {\n display: inline;\n}\n\n:where(h1, h2, h3, h4, h5, h6, p)[data-rn] {\n font-size: inherit;\n font-weight: inherit;\n margin: 0;\n}\n\n:where(ul, ol)[data-rn] {\n list-style: none;\n margin: 0;\n padding: 0;\n}\n\n:where(strong, b)[data-rn] {\n font-weight: bold;\n}\n\n:where(small)[data-rn] {\n font-size: 80%;\n}\n\n:where(code)[data-rn] {\n font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;\n font-size: 1em;\n}\n\n:where(mark)[data-rn] {\n background-color: rgb(255, 255, 0);\n color: rgb(0, 0, 0);\n}\n\n[data-rn='text']:where([numberoflines]:not([data-rn='text'] *)) {\n display: -webkit-box;\n -webkit-box-orient: vertical;\n -webkit-line-clamp: var(--rn-number-of-lines);\n overflow: hidden;\n}\n\n[data-rn='text']:where([numberoflines][ellipsizemode='clip']:not([data-rn='text'] *)) {\n display: block;\n -webkit-line-clamp: none;\n max-height: calc(var(--rn-number-of-lines) * 1lh);\n}\n\n[data-rn='scroll-view'],\n[data-rn='virtual-list'] {\n flex-grow: 1;\n flex-shrink: 1;\n flex-direction: column;\n overflow: auto;\n -webkit-overflow-scrolling: touch;\n}\n\n[data-rn='scroll-view'][flexdirection='row'] {\n flex-direction: row;\n}\n\n[data-rn='scroll-view'][scrollenabled='false'] {\n overflow: hidden;\n}\n\n[data-rn='scroll-view'][pagingenabled='true'] {\n scroll-snap-type: y mandatory;\n}\n\n[data-rn='scroll-view'][pagingenabled='true'][horizontal='true'] {\n scroll-snap-type: x mandatory;\n}\n\n[data-rn='scroll-view'][pagingenabled='true'] > [data-rn='view'] > * {\n scroll-snap-align: start;\n scroll-snap-stop: always;\n}\n\n[data-rn='image'] {\n background-size: cover;\n background-repeat: no-repeat;\n background-position: center;\n}\n\n:where([data-rn='image']) {\n width: var(--rn-intrinsic-width, auto);\n height: var(--rn-intrinsic-height, auto);\n}\n\n:where([data-rn='gesture-root']) {\n flex-grow: 1;\n flex-basis: 0%;\n}\n\n[data-rn='modal'] {\n position: fixed;\n inset: 0;\n z-index: 1000;\n background-color: rgb(0 0 0 / 50%);\n}\n[data-rn='modal'][hidden] {\n display: none;\n}\n\n[data-rn='input-accessory-view'] {\n position: fixed;\n left: 0;\n right: 0;\n bottom: 0;\n}\n\n[data-rn='activity-indicator'] {\n color: #999999;\n}\n[data-rn='activity-indicator']::after {\n content: '';\n box-sizing: border-box;\n flex: 1;\n border: 2px solid currentColor;\n border-right-color: transparent;\n border-radius: 50%;\n animation: rn-activity-indicator 0.8s linear infinite;\n}\n[data-rn='activity-indicator'][animating='false']::after {\n animation-play-state: paused;\n}\n[data-rn='activity-indicator'][animating='false']:not([hideswhenstopped='false'])::after {\n visibility: hidden;\n}\n@keyframes rn-activity-indicator {\n to {\n transform: rotate(360deg);\n }\n}\n\n[data-rn='text-input'] {\n background-color: transparent;\n font: inherit;\n color: inherit;\n letter-spacing: inherit;\n text-transform: inherit;\n margin: 0;\n padding: 0;\n resize: none;\n}\n\n[data-rn='text-input']::placeholder {\n /* A device draws an unset placeholder grey; this is the text colour, faded, on any theme. */\n color: var(--rn-placeholder-color, color-mix(in srgb, currentColor 45%, transparent));\n}\n\n[data-rn='gradient-text'] {\n -webkit-background-clip: text;\n background-clip: text;\n}\n\n[data-rn='gradient-text'] > [data-rn='text'][data-rn] {\n color: transparent;\n}\n\n[data-rn='gradient-text'] > [data-rn='view'][data-rn] {\n display: none;\n}\n`;\n\n/**\n * The reset for an island inside someone else's page: `RESET_CSS` without the two rules that\n * reach outside the island.\n *\n * `html, body { height: 100% }` and `body`'s font are right for a page this package owns, and\n * wrong for a page it is a guest on - they would resize and re-font the host app around the\n * island. So they go, and the font moves onto `[data-rn-root]`, where text inside the island\n * still inherits it. Derived rather than written out, so it cannot drift from `RESET_CSS`.\n */\nexport const ISLAND_RESET_CSS = RESET_CSS.replace(/html,\\s*body\\s*\\{[^}]*\\}\\s*/, '').replace(\n /(^|\\n)body\\s*\\{/,\n '$1[data-rn-root] {',\n);\n"]}
|
package/dist/reset.css
CHANGED
|
@@ -284,6 +284,31 @@ body {
|
|
|
284
284
|
color: rgb(0, 0, 0);
|
|
285
285
|
}
|
|
286
286
|
|
|
287
|
+
/*
|
|
288
|
+
* `text.ts`'s `numberOfLines`, which `props.ts` writes as an attribute and a custom property only
|
|
289
|
+
* while it is above zero. A device cuts the text to that many lines and ends the last in an
|
|
290
|
+
* ellipsis, and a line clamp is the browser's way to say the same. Only on the outermost text, as
|
|
291
|
+
* on a device, where a nested text is a run of its parent's paragraph and has no lines of its own:
|
|
292
|
+
* a nested one clamped would leave the paragraph's flow.
|
|
293
|
+
*
|
|
294
|
+
* `ellipsizeMode` reaches the element as a plain attribute. A line clamp always ends in an
|
|
295
|
+
* ellipsis, so `clip` cuts the box to that many lines' height instead, which a nested run in a
|
|
296
|
+
* larger font can make a little short. `head` and `middle` have nothing in CSS to say them with,
|
|
297
|
+
* and end in an ellipsis at the tail.
|
|
298
|
+
*/
|
|
299
|
+
[data-rn='text']:where([numberoflines]:not([data-rn='text'] *)) {
|
|
300
|
+
display: -webkit-box;
|
|
301
|
+
-webkit-box-orient: vertical;
|
|
302
|
+
-webkit-line-clamp: var(--rn-number-of-lines);
|
|
303
|
+
overflow: hidden;
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
[data-rn='text']:where([numberoflines][ellipsizemode='clip']:not([data-rn='text'] *)) {
|
|
307
|
+
display: block;
|
|
308
|
+
-webkit-line-clamp: none;
|
|
309
|
+
max-height: calc(var(--rn-number-of-lines) * 1lh);
|
|
310
|
+
}
|
|
311
|
+
|
|
287
312
|
/*
|
|
288
313
|
* `ScrollView.js`'s own base style (`engine.ts`'s `DEFAULT_PROPS.ScrollView`): a native scroll
|
|
289
314
|
* view does not clip its content on its own, so without this the content spills straight out of
|
|
@@ -318,6 +343,27 @@ body {
|
|
|
318
343
|
overflow: hidden;
|
|
319
344
|
}
|
|
320
345
|
|
|
346
|
+
/*
|
|
347
|
+
* `pagingEnabled`, read the same way, along the axis `horizontal` names. A device settles on a
|
|
348
|
+
* whole page of the scroll view's own size when the user lets go, and moves at most one page per
|
|
349
|
+
* swipe. CSS snaps to boxes rather than to multiples of a size, so each child of the content view
|
|
350
|
+
* is a page here: the same thing for the usual carousel of page-sized children, and a stop at
|
|
351
|
+
* every child for children of another size. `scrollTo` lands on a page too, where a device goes
|
|
352
|
+
* to the exact offset it was given.
|
|
353
|
+
*/
|
|
354
|
+
[data-rn='scroll-view'][pagingenabled='true'] {
|
|
355
|
+
scroll-snap-type: y mandatory;
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
[data-rn='scroll-view'][pagingenabled='true'][horizontal='true'] {
|
|
359
|
+
scroll-snap-type: x mandatory;
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
[data-rn='scroll-view'][pagingenabled='true'] > [data-rn='view'] > * {
|
|
363
|
+
scroll-snap-align: start;
|
|
364
|
+
scroll-snap-stop: always;
|
|
365
|
+
}
|
|
366
|
+
|
|
321
367
|
/*
|
|
322
368
|
* `Image`'s default `resizeMode`, which is `cover`. `props.ts` paints an image with
|
|
323
369
|
* `background-image` and writes a fit only when `resizeMode` is bound, and `Image` binds it only
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ng-native/web",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.0",
|
|
4
4
|
"description": "A browser host for Angular Native: the same components, rendered into the DOM instead of native views.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"angular",
|
|
@@ -35,9 +35,9 @@
|
|
|
35
35
|
"access": "public"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@ng-native/device": "0.
|
|
39
|
-
"@ng-native/fabric": "0.
|
|
40
|
-
"@oxc-angular/vite": "0.0.
|
|
38
|
+
"@ng-native/device": "0.10.0",
|
|
39
|
+
"@ng-native/fabric": "0.10.0",
|
|
40
|
+
"@oxc-angular/vite": "0.0.40"
|
|
41
41
|
},
|
|
42
42
|
"peerDependencies": {
|
|
43
43
|
"@angular/core": "^22.0.0",
|
|
@@ -53,11 +53,11 @@
|
|
|
53
53
|
"@angular/compiler": "22.2.0",
|
|
54
54
|
"@angular/platform-browser": "22.2.0",
|
|
55
55
|
"@ng-icons/core": "^36.0.0",
|
|
56
|
-
"@ng-native/components": "0.
|
|
57
|
-
"@ng-native/icons": "0.
|
|
58
|
-
"@ng-native/metro": "0.
|
|
59
|
-
"@ng-native/tailwind": "0.
|
|
60
|
-
"@ng-native/testing": "0.
|
|
56
|
+
"@ng-native/components": "0.10.0",
|
|
57
|
+
"@ng-native/icons": "0.10.0",
|
|
58
|
+
"@ng-native/metro": "0.10.0",
|
|
59
|
+
"@ng-native/tailwind": "0.10.0",
|
|
60
|
+
"@ng-native/testing": "0.10.0",
|
|
61
61
|
"@tailwindcss/vite": "^4.3.3",
|
|
62
62
|
"@types/jsdom": "^27.0.0",
|
|
63
63
|
"@vitest/browser": "^5.0.2",
|