@ng-native/fabric 0.16.0 → 0.17.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"grid.js","sourceRoot":"","sources":["../src/grid.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAyEH,MAAM,IAAI,GAAY,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;AACvC,+FAA+F;AAC/F,MAAM,GAAG,GAAG,IAAI,CAAC;AAEjB,MAAM,EAAE,GAAG,CAAC,KAAyB,EAAU,EAAE,CAAC,MAAM,CAAC,UAAU,CAAC,KAAK,IAAI,EAAE,CAAC,IAAI,CAAC,CAAC;AACtF,MAAM,MAAM,GAAG,CAAC,KAAyB,EAAE,EAAE,CAAC,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,MAAM,CAAC;AAEtF;;;GAGG;AACH,SAAS,MAAM,CAAC,KAAyB,EAAE,KAAyB;IAClE,IAAI,MAAM,CAAC,KAAK,CAAC;QAAE,OAAO,SAAS,CAAC;IACpC,MAAM,KAAK,GAAG,oCAAoC,CAAC,IAAI,CAAC,KAAM,CAAC,CAAC;IAChE,IAAI,KAAK;QAAE,OAAO,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,GAAG,KAAK,GAAG,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IAChG,OAAO,iBAAiB,CAAC,IAAI,CAAC,KAAM,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;AAChE,CAAC;AAED,cAAc;AAEd,qGAAqG;AACrG,SAAS,MAAM,CAAC,IAAY,EAAE,SAAS,GAAG,GAAG;IAC3C,MAAM,GAAG,GAAa,EAAE,CAAC;IACzB,IAAI,KAAK,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AC","sourcesContent":["/**\n * CSS Grid, as a function from a container's style and its items to where each item goes.\n *\n * It follows CSS Grid Layout Level 1: placement (8.5), track sizing (11.3 to 11.8) and alignment\n * (10). It knows nothing about Yoga or a device. Whatever lays the items out says how big each\n * one's content is through `measure`, and gets back a rectangle for each against the container's\n * content box.\n *\n * Not here: subgrid, last-baseline alignment (read as start), and right-to-left columns.\n */\n\nexport type Style = Readonly<Record<string, string>>;\n\nexport interface GridItem {\n /** The item's style, with every shorthand spread over its sides. */\n readonly style: Style;\n /**\n * The item's border box with its content at its narrowest (`min`), at its widest (`max`), or\n * at a given width.\n */\n measure(width: 'min' | 'max' | number): { width: number; height: number };\n /**\n * How far under the item's top edge its baseline is, at a given width: the first line of its\n * text, or its bottom edge where it has none. Only how items differ is read, so it may be\n * counted from anywhere. Without it an item aligned to a baseline sits at the start.\n */\n baseline?(width: number): number;\n /**\n * The item's padding and border across and down: what no size takes its border box under, and\n * what a size is written without where its `box-sizing` is `content-box`.\n */\n readonly frame?: { readonly width: number; readonly height: number };\n}\n\nexport interface Rect {\n left: number;\n top: number;\n width: number;\n height: number;\n}\n\nexport interface GridLayout {\n /** The content box: what was available, or what the tracks came to where nothing was. */\n width: number;\n height: number;\n /** What the tracks and gaps come to, which is more than the box when they overflow. */\n usedWidth: number;\n usedHeight: number;\n /** A rectangle per item, against the content box. */\n items: Rect[];\n /**\n * The grid lines an out-of-flow child's placement names, as the edges of what it is placed\n * against: each a distance from the content box's left or top edge, and nothing where the\n * side is `auto`, or a line the grid has not got, which is the container's padding edge.\n */\n area(style: Style): Edges;\n}\n\nexport interface Edges {\n left?: number;\n right?: number;\n top?: number;\n bottom?: number;\n}\n\ntype Breadth =\n | { kind: 'length'; px: number }\n | { kind: 'fr'; factor: number }\n | { kind: 'auto' | 'min-content' | 'max-content' }\n | { kind: 'fit-content'; limit: number };\n\ninterface Track {\n min: Breadth;\n max: Breadth;\n base: number;\n limit: number;\n /** A growth limit that was infinite until an item's min-content set it. */\n growable: boolean;\n /** An `auto-fit` track, which collapses when nothing is placed in it. */\n autoFit: boolean;\n}\n\nconst AUTO: Breadth = { kind: 'auto' };\n/** The most tracks a repeat makes and the furthest line an item names: a grid stays finite. */\nconst CAP = 1000;\n\nconst px = (value: string | undefined): number => Number.parseFloat(value ?? '') || 0;\nconst isAuto = (value: string | undefined) => value === undefined || value === 'auto';\n\n/**\n * A length, or a percentage of `whole`, or nothing when it is `auto` or cannot be known yet. A\n * percentage may have points added, `50% + 20px`, as a content box's share has its frame.\n */\nfunction length(value: string | undefined, whole: number | undefined): number | undefined {\n if (isAuto(value)) return undefined;\n const share = /^(-?[\\d.]+)%(?: \\+ (-?[\\d.]+)px)?$/.exec(value!);\n if (share) return whole === undefined ? undefined : (px(share[1]) / 100) * whole + px(share[2]);\n return /^-?[\\d.]+(px)?$/.test(value!) ? px(value) : undefined;\n}\n\n// Track lists\n\n/** A track list's words and its `[line names]`, each kept together, as is a function's arguments. */\nfunction tokens(list: string, separator = ' '): string[] {\n const out: string[] = [];\n let depth = 0;\n let word = '';\n for (const char of list) {\n if (char === '(' || char === '[') depth += 1;\n if (char === ')' || char === ']') depth -= 1;\n if (char === separator && depth === 0) {\n out.push(word);\n word = '';\n } else {\n word += char;\n }\n }\n out.push(word);\n return out.map((each) => each.trim()).filter(Boolean);\n}\n\n/** A track list's words, with its line names dropped. */\nconst words = (list: string, separator = ' '): string[] =>\n tokens(list, separator).filter((each) => !each.startsWith('['));\n\nfunction breadth(word: string, whole: number | undefined): Breadth {\n if (word === 'min-content' || word === 'max-content') return { kind: word };\n if (word.endsWith('fr')) return { kind: 'fr', factor: px(word) };\n const size = length(word, whole);\n return size === undefined ? AUTO : { kind: 'length', px: size };\n}\n\nfunction track(word: string, whole: number | undefined, autoFit = false): Track {\n const args = /^([a-z-]+)\\((.*)\\)$/.exec(word);\n let min = breadth(word, whole);\n let max = min;\n if (args?.[1] === 'minmax') {\n const [low, high] = words(args[2]!, ',');\n min = breadth(low!, whole);\n max = breadth(high!, whole);\n } else if (args?.[1] === 'fit-content') {\n min = AUTO;\n max = { kind: 'fit-content', limit: length(args[2], whole) ?? Infinity };\n }\n // A flexible minimum is no minimum: the track is as small as its content allows.\n if (min.kind === 'fr') min = AUTO;\n return { min, max, base: 0, limit: 0, growable: false, autoFit };\n}\n\n/** What a track is sure to take: its fixed maximum, or failing that its fixed minimum. */\nconst fixedSize = (each: Track): number =>\n each.max.kind === 'length' ? each.max.px : each.min.kind === 'length' ? each.min.px : 0;\n\n/** How many times an `auto-fill` or `auto-fit` list repeats in `whole` without overflowing. */\nfunction repetitions(\n repeated: Track[],\n others: number,\n otherSize: number,\n whole: number | undefined,\n gap: number,\n): number {\n if (whole === undefined) return 1;\n // Each repeat a point at the least, as CSS Grid 7.2.3.2 has it, so one of tracks with no fixed\n // size, `minmax(0, 1fr)`, comes to an end: a point wide each, as many as fit.\n const size = Math.max(\n repeated.reduce((sum, each) => sum + fixedSize(each), 0),\n 1,\n );\n let count = 1;\n const total = (n: number) => otherSize + n * size + (others + n * repeated.length - 1) * gap;\n while (count < CAP && total(count + 1) <= whole) count += 1;\n return count;\n}\n\n/** The lines a name is given to, each counted from the first explicit line, which is 0. */\ntype LineNames = Map<string, number[]>;\n\nconst nameLine = (names: LineNames, name: string, at: number) =>\n names.set(name, [...(names.get(name) ?? []), at]);\n\n/** A track of a list, or the names written before one: `[a b]`. */\ntype Cell = Track | string[];\nconst cells = (list: string, whole: number | undefined, autoFit = false): Cell[] =>\n tokens(list).map((word) =>\n word.startsWith('[') ? words(word.slice(1, -1)) : track(word, whole, autoFit),\n );\nconst tracksOf = (all: Cell[]): Track[] =>\n all.filter((each): each is Track => !Array.isArray(each));\n\n/** A `grid-template-columns` or `grid-template-rows` value as tracks, and the names of its lines. */\nfunction template(\n list: string | undefined,\n whole: number | undefined,\n gap: number,\n): { tracks: Track[]; names: LineNames } {\n const names: LineNames = new Map();\n const tracks: Track[] = [];\n if (!list || list === 'none') return { tracks, names };\n const parts = tokens(list).map((word) => {\n const repeat = /^repeat\\(\\s*([^,]+),(.*)\\)$/.exec(word);\n if (!repeat) return { count: 1 as number | 'auto', cells: cells(word, whole) };\n const count = repeat[1]!.trim();\n const auto = count === 'auto-fill' || count === 'auto-fit';\n return {\n count: auto ? ('auto' as const) : Math.min(Number(count), CAP),\n cells: cells(repeat[2]!, whole, count === 'auto-fit'),\n };\n });\n const fixed = parts.filter((part) => part.count !== 'auto');\n const size = (part: (typeof parts)[number]) =>\n tracksOf(part.cells).reduce((sum, each) => sum + fixedSize(each), 0);\n const others = fixed.reduce(\n (sum, part) => sum + (part.count as number) * tracksOf(part.cells).length,\n 0,\n );\n const otherSize = fixed.reduce((sum, part) => sum + (part.count as number) * size(part), 0);\n for (const part of parts) {\n const count =\n part.count === 'auto'\n ? repetitions(tracksOf(part.cells), others, otherSize, whole, gap)\n : part.count;\n for (let i = 0; i < count; i++) {\n for (const cell of part.cells) {\n if (Array.isArray(cell)) for (const name of cell) nameLine(names, name, tracks.length);\n else tracks.push({ ...cell });\n }\n }\n }\n return { tracks, names };\n}\n\n/**\n * `grid-template-areas`: how many tracks its rows of names make on each axis, and the lines\n * each area gives a name to, `head-start` and `head-end`, which is what an item is placed by.\n */\nfunction templateAreas(text: string | undefined) {\n const columns: LineNames = new Map();\n const rows: LineNames = new Map();\n const grid = [...(text ?? '').matchAll(/([\"'])(.*?)\\1/g)].map((row) => words(row[2]!));\n const edges = new Map<string, { left: number; right: number; top: number; bottom: number }>();\n grid.forEach((row, y) =>\n row.forEach((name, x) => {\n if (name.startsWith('.')) return;\n const at = edges.get(name) ?? { left: x, right: x, top: y, bottom: y };\n edges.set(name, {\n left: Math.min(at.left, x),\n right: Math.max(at.right, x),\n top: Math.min(at.top, y),\n bottom: Math.max(at.bottom, y),\n });\n }),\n );\n for (const [name, at] of edges) {\n nameLine(columns, `${name}-start`, at.left);\n nameLine(columns, `${name}-end`, at.right + 1);\n nameLine(rows, `${name}-start`, at.top);\n nameLine(rows, `${name}-end`, at.bottom + 1);\n }\n return {\n columns,\n rows,\n across: Math.max(0, ...grid.map((row) => row.length)),\n down: grid.length,\n };\n}\n\n/** The names of a track list's lines and of the areas over it, as one. */\nfunction allNames(lines: LineNames, areas: LineNames): LineNames {\n const out: LineNames = new Map(lines);\n for (const [name, at] of areas) out.set(name, [...(out.get(name) ?? []), ...at]);\n return out;\n}\n\n// Placement\n\ninterface Span {\n /** The first track, counted from the first explicit one, or nothing for auto placement. */\n start?: number;\n span: number;\n}\n\ninterface Line {\n line?: number;\n span?: number;\n}\n\n/**\n * One side of a placement. A name is the line an area starts or ends at on that side, `head`\n * for `head-start`, or failing that a line of that name: the first, or the one counted to. A\n * name no line has is the first line past the `explicit` tracks, as every line out there has it.\n */\nfunction line(\n value: string | undefined,\n names: LineNames,\n edge: 'start' | 'end',\n explicit: number,\n): Line {\n const text = (value ?? 'auto').trim();\n const span = /^span\\s+(\\d+)$/.exec(text);\n if (span) return { span: Math.min(Number(span[1]), CAP) };\n if (/^-?\\d+$/.test(text)) {\n return Number(text) === 0 ? {} : { line: Math.max(Math.min(Number(text), CAP), -CAP) };\n }\n const named = /^([A-Za-z_][\\w-]*)(?:\\s+(-?\\d+))?$/.exec(text);\n if (!named || text === 'auto') return {};\n const at = namedLine(names, named[1]!, named[2], edge);\n if (at !== undefined) return { line: at + 1 };\n return { line: Number(named[2] ?? 1) > 0 ? explicit + 2 : -(explicit + 2) };\n}\n\n/** The line a name says: an area's edge on that side, or the line of that name counted to. */\nfunction namedLine(names: LineNames, name: string, count: string | undefined, edge: string) {\n const lines = (count === undefined ? names.get(`${name}-${edge}`) : undefined) ?? names.get(name);\n const nth = Number(count ?? 1);\n return nth > 0 ? lines?.[nth - 1] : lines?.at(nth);\n}\n\nconst isName = (value: string | undefined) => /^[A-Za-z_]/.test(value ?? '') && value !== 'auto';\n\n/**\n * `grid-area` as its four sides, each `auto` unless written: a name alone is the area of that\n * name, so it stands for the sides left out too.\n */\nfunction areaSides(style: Style) {\n const [rowStart, columnStart, rowEnd, columnEnd] = (style['grid-area'] ?? '')\n .split('/')\n .map((each) => each.trim() || undefined);\n const column = columnStart ?? (isName(rowStart) ? rowStart : undefined);\n return {\n row: [rowStart, rowEnd ?? (isName(rowStart) ? rowStart : undefined)],\n column: [column, columnEnd ?? (isName(column) ? column : undefined)],\n };\n}\n\n/** The two sides an item's `grid-column` or `grid-row` is written as, each with its longhand. */\nfunction sides(style: Style, axis: 'column' | 'row'): [string | undefined, string | undefined] {\n const [first, second] = style[`grid-${axis}`]?.split('/') ?? areaSides(style)[axis];\n // One name is both sides of it, `content` for `content-start / content-end`.\n const both = isName(first?.trim()) ? first : undefined;\n return [style[`grid-${axis}-start`] ?? first, style[`grid-${axis}-end`] ?? second ?? both];\n}\n\n/** An item's `grid-column` or `grid-row`, and its `-start` and `-end`, as a span of tracks. */\nfunction span(style: Style, axis: 'column' | 'row', explicit: number, names: LineNames): Span {\n const [first, last] = sides(style, axis);\n const start = line(first, names, 'start', explicit);\n const end = line(last, names, 'end', explicit);\n const index = (n: number) => (n > 0 ? n - 1 : explicit + 1 + n);\n if (start.line !== undefined && end.line !== undefined) {\n const [a, b] = [index(start.line), index(end.line)].sort((x, y) => x - y) as [number, number];\n return { start: a, span: Math.max(b - a, 1) };\n }\n if (start.line !== undefined) return { start: index(start.line), span: end.span ?? 1 };\n if (end.line !== undefined) {\n const size = start.span ?? 1;\n return { start: index(end.line) - size, span: size };\n }\n return { span: start.span ?? end.span ?? 1 };\n}\n\n/**\n * The tracks an out-of-flow child's placement names on one axis: the one its start line is\n * before and the one its end line is after, each nothing where it is `auto` or names no line\n * the grid has. A span is counted from the line on the other side, and is `auto` without one.\n */\nfunction namedTracks(\n style: Style,\n axis: 'column' | 'row',\n grid: { explicit: number; before: number; count: number; names: LineNames },\n): { start?: number; end?: number } {\n const [first, last] = sides(style, axis);\n const start = line(first, grid.names, 'start', grid.explicit);\n const end = line(last, grid.names, 'end', grid.explicit);\n const index = (n: number) => (n > 0 ? n - 1 : grid.explicit + 1 + n) + grid.before;\n let [from, to] = spanned(\n start.line === undefined ? undefined : index(start.line),\n end.line === undefined ? undefined : index(end.line),\n start.span,\n end.span,\n );\n // Written the wrong way round they are swapped, and the same line twice is only a start.\n if (from !== undefined && to !== undefined && from > to) [from, to] = [to, from];\n if (from === to) to = undefined;\n const known = (at: number | undefined) =>\n at !== undefined && at >= 0 && at <= grid.count ? at : undefined;\n return { start: known(from), end: known(to) };\n}\n\n/** Two lines, each counted from the other where it is a span and the other is a line. */\nfunction spanned(\n from: number | undefined,\n to: number | undefined,\n before: number | undefined,\n after: number | undefined,\n): [number | undefined, number | undefined] {\n if (from === undefined && to !== undefined && before) return [to - before, to];\n if (to === undefined && from !== undefined && after) return [from, from + after];\n return [from, to];\n}\n\ninterface Placed {\n column: number;\n row: number;\n columns: number;\n rows: number;\n}\n\ninterface Placement {\n items: Placed[];\n columns: number;\n rows: number;\n /** Implicit tracks before the first explicit one. */\n before: { columns: number; rows: number };\n}\n\n/**\n * The auto-placement algorithm, along whichever axis the grid fills first. `minor` is the axis\n * with a fixed number of tracks, columns in a row flow, and `major` the one that grows.\n */\nfunction autoPlace(\n spans: { major: Span; minor: Span }[],\n explicitMinor: number,\n dense: boolean,\n): { major: number; minor: number }[] {\n let minorCount = Math.max(\n explicitMinor,\n 1,\n ...spans.map(({ minor }) => (minor.start ?? 0) + minor.span),\n );\n const taken = new Set<string>();\n const free = (major: number, minor: number, each: { major: Span; minor: Span }) => {\n for (let i = major; i < major + each.major.span; i++) {\n for (let j = minor; j < minor + each.minor.span; j++)\n if (taken.has(`${i},${j}`)) return false;\n }\n return true;\n };\n const out: { major: number; minor: number }[] = [];\n const take = (index: number, major: number, minor: number) => {\n const each = spans[index]!;\n for (let i = major; i < major + each.major.span; i++) {\n for (let j = minor; j < minor + each.minor.span; j++) taken.add(`${i},${j}`);\n }\n minorCount = Math.max(minorCount, minor + each.minor.span);\n out[index] = { major, minor };\n };\n\n spans.forEach((each, i) => {\n if (each.major.start !== undefined && each.minor.start !== undefined) {\n take(i, each.major.start, each.minor.start);\n }\n });\n // Locked to a line of the major axis: the first room along it, after its earlier items.\n const along = new Map<number, number>();\n spans.forEach((each, i) => {\n if (each.major.start === undefined || each.minor.start !== undefined) return;\n let minor = dense ? 0 : (along.get(each.major.start) ?? 0);\n while (!free(each.major.start, minor, each)) minor += 1;\n along.set(each.major.start, minor + each.minor.span);\n take(i, each.major.start, minor);\n });\n const cursor = { major: 0, minor: 0 };\n spans.forEach((each, i) => {\n if (each.major.start !== undefined) return;\n if (dense) Object.assign(cursor, { major: 0, minor: 0 });\n if (each.minor.start !== undefined) {\n if (each.minor.start < cursor.minor) cursor.major += 1;\n cursor.minor = each.minor.start;\n while (!free(cursor.major, cursor.minor, each)) cursor.major += 1;\n } else {\n while (\n cursor.minor + each.minor.span > minorCount ||\n !free(cursor.major, cursor.minor, each)\n ) {\n cursor.minor += 1;\n if (cursor.minor + each.minor.span > minorCount) {\n cursor.major += 1;\n cursor.minor = 0;\n }\n }\n }\n take(i, cursor.major, cursor.minor);\n });\n return out;\n}\n\nfunction place(\n styles: Style[],\n container: Style,\n explicit: { columns: number; rows: number },\n names: { columns: LineNames; rows: LineNames },\n): Placement {\n const flow = container['grid-auto-flow'] ?? 'row';\n const byColumn = flow.includes('column');\n const all = styles.map((style) => ({\n column: span(style, 'column', explicit.columns, names.columns),\n row: span(style, 'row', explicit.rows, names.rows),\n }));\n // A line before the first explicit one starts an implicit track there: count from it instead.\n const before = {\n columns: Math.max(0, ...all.map(({ column }) => -(column.start ?? 0))),\n rows: Math.max(0, ...all.map(({ row }) => -(row.start ?? 0))),\n };\n for (const each of all) {\n if (each.column.start !== undefined) each.column.start += before.columns;\n if (each.row.start !== undefined) each.row.start += before.rows;\n }\n const spans = all.map((each) =>\n byColumn ? { major: each.column, minor: each.row } : { major: each.row, minor: each.column },\n );\n const explicitMinor = byColumn ? explicit.rows + before.rows : explicit.columns + before.columns;\n const cells = autoPlace(spans, explicitMinor, flow.includes('dense'));\n const items = cells.map((cell, i) => ({\n column: byColumn ? cell.major : cell.minor,\n row: byColumn ? cell.minor : cell.major,\n columns: all[i]!.column.span,\n rows: all[i]!.row.span,\n }));\n return {\n items,\n before,\n columns: Math.max(explicit.columns + before.columns, ...items.map((i) => i.column + i.columns)),\n rows: Math.max(explicit.rows + before.rows, ...items.map((i) => i.row + i.rows)),\n };\n}\n\n/** The explicit tracks, with implicit ones from `grid-auto-*` before and after them. */\nfunction withImplicit(\n explicit: Track[],\n auto: string | undefined,\n whole: number | undefined,\n before: number,\n count: number,\n): Track[] {\n const pattern = words(auto ?? 'auto');\n const implicit = (index: number) => track(pattern.at(index % pattern.length)!, whole);\n const leading = Array.from({ length: before }, (_, i) => implicit(-(before - i)));\n const after = Math.max(count - before - explicit.length, 0);\n return [...leading, ...explicit, ...Array.from({ length: after }, (_, i) => implicit(i))];\n}\n\n// Track sizing\n\n/** An item on one axis: the tracks it spans, and what its content asks of them. */\ninterface Contribution {\n start: number;\n span: number;\n /** Its size with its content at its narrowest, at its widest, and the least it will take. */\n min: number;\n max: number;\n minimum: number;\n}\n\nconst intrinsic = (each: Breadth) => each.kind !== 'length' && each.kind !== 'fr';\nconst flexible = (each: Track) => each.max.kind === 'fr';\nconst sum = (values: number[]) => values.reduce((a, b) => a + b, 0);\n\nfunction initialise(tracks: Track[]): void {\n for (const each of tracks) {\n each.base = each.min.kind === 'length' ? each.min.px : 0;\n each.limit = each.max.kind === 'length' ? Math.max(each.max.px, each.base) : Infinity;\n each.growable = false;\n }\n}\n\n/** An item in one track sets that track's size by itself. */\nfunction sizeFromSingle(each: Track, item: Contribution): void {\n if (each.min.kind === 'min-content') each.base = Math.max(each.base, item.min);\n else if (each.min.kind === 'max-content') each.base = Math.max(each.base, item.max);\n else if (each.min.kind === 'auto') each.base = Math.max(each.base, item.minimum);\n const limit = each.limit === Infinity ? 0 : each.limit;\n if (each.max.kind === 'min-content') each.limit = Math.max(limit, item.min);\n else if (each.max.kind === 'fit-content') {\n each.limit = Math.max(limit, Math.min(item.max, Math.max(each.max.limit, item.minimum)));\n } else if (intrinsic(each.max)) each.limit = Math.max(limit, item.max);\n each.limit = Math.max(each.limit, each.base);\n}\n\n/**\n * Share `space` over `tracks`, each up to its `room`, an equal part at a time (11.5.1), and\n * answer how much each takes. What is left once all are full goes to `beyond`. Flexible tracks\n * share by their flex factors instead, when those come to something.\n */\nfunction share(space: number, tracks: Track[], room: (each: Track) => number, beyond: Track[]) {\n const factors = tracks.every(flexible)\n ? tracks.map((each) => (each.max as { factor: number }).factor)\n : [];\n const weighted = sum(factors) > 0;\n const weight = (each: Track) => (weighted ? factors[tracks.indexOf(each)]! : 1);\n const taken = new Map<Track, number>(tracks.map((each) => [each, 0]));\n let open = tracks.filter((each) => room(each) > 0 && weight(each) > 0);\n let left = space;\n while (left > 1e-9 && open.length) {\n const whole = sum(open.map(weight));\n const parts = open.map((each) => (left * weight(each)) / whole);\n open.forEach((each, i) => {\n const take = Math.min(parts[i]!, room(each) - taken.get(each)!);\n taken.set(each, taken.get(each)! + take);\n left -= take;\n });\n open = open.filter((each) => room(each) - taken.get(each)! > 1e-9);\n }\n if (left > 1e-9 && beyond.length) {\n for (const each of beyond) taken.set(each, (taken.get(each) ?? 0) + left / beyond.length);\n }\n return taken;\n}\n\ninterface Phase {\n /** Which tracks the items' space goes to. */\n affects: (each: Track) => boolean;\n /** Which size of the item has to fit. */\n size: (item: Contribution) => number;\n /** Growing base sizes, or growth limits. */\n target: 'base' | 'limit';\n /** Which tracks take what is left once every one is at its limit. */\n beyond: (each: Track) => boolean;\n}\n\nconst PHASES: Phase[] = [\n {\n affects: (t) => intrinsic(t.min),\n size: (item) => item.minimum,\n target: 'base',\n beyond: (t) => intrinsic(t.max),\n },\n {\n affects: (t) => t.min.kind === 'min-content' || t.min.kind === 'max-content',\n size: (item) => item.min,\n target: 'base',\n beyond: (t) => t.max.kind === 'min-content' || t.max.kind === 'max-content',\n },\n {\n affects: (t) => t.min.kind === 'max-content',\n size: (item) => item.max,\n target: 'base',\n beyond: (t) => t.max.kind === 'max-content',\n },\n {\n affects: (t) => intrinsic(t.max),\n size: (item) => item.min,\n target: 'limit',\n beyond: () => true,\n },\n {\n affects: (t) => ['auto', 'max-content', 'fit-content'].includes(t.max.kind),\n size: (item) => item.max,\n target: 'limit',\n beyond: () => true,\n },\n];\n\n/** One phase of 11.5 for a group of items: grow the affected tracks to fit each item. */\nfunction grow(\n tracks: Track[],\n items: Contribution[],\n gap: number,\n phase: Phase,\n only?: (t: Track) => boolean,\n) {\n const planned = new Map<Track, number>();\n const current = (each: Track) =>\n phase.target === 'base' ? each.base : each.limit === Infinity ? each.base : each.limit;\n for (const item of items) {\n const spanned = tracks.slice(item.start, item.start + item.span);\n const affected = spanned.filter((each) => phase.affects(each) && (only?.(each) ?? true));\n if (!affected.length) continue;\n const space = phase.size(item) - sum(spanned.map(current)) - gap * (item.span - 1);\n if (space <= 0) continue;\n const room = (each: Track) => {\n if (phase.target === 'base') return each.limit - each.base;\n return each.limit === Infinity || each.growable ? Infinity : 0;\n };\n const beyond = affected.filter(phase.beyond);\n const taken = share(space, affected, room, beyond.length ? beyond : affected);\n for (const [each, amount] of taken) planned.set(each, Math.max(planned.get(each) ?? 0, amount));\n }\n for (const [each, amount] of planned) {\n if (phase.target === 'base') {\n each.base += amount;\n } else {\n each.growable = each.limit === Infinity;\n each.limit = (each.limit === Infinity ? each.base : each.limit) + amount;\n }\n }\n}\n\nfunction growAll(\n tracks: Track[],\n items: Contribution[],\n gap: number,\n only?: (t: Track) => boolean,\n) {\n for (const phase of PHASES) {\n if (only && phase.target === 'limit') continue;\n grow(tracks, items, gap, phase, only);\n if (phase.target === 'base')\n for (const each of tracks) each.limit = Math.max(each.limit, each.base);\n }\n}\n\n/** 11.5: size each track to the items in it, the items in one track first. */\nfunction resolveIntrinsic(tracks: Track[], items: Contribution[], gap: number): void {\n const crossesFlexible = (item: Contribution) =>\n tracks.slice(item.start, item.start + item.span).some(flexible);\n const rigid = items.filter((item) => !crossesFlexible(item));\n for (const item of rigid.filter((each) => each.span === 1))\n sizeFromSingle(tracks[item.start]!, item);\n const sizes = [...new Set(rigid.map((item) => item.span))]\n .filter((n) => n > 1)\n .sort((a, b) => a - b);\n for (const size of sizes) {\n growAll(\n tracks,\n rigid.filter((item) => item.span === size),\n gap,\n );\n }\n growAll(tracks, items.filter(crossesFlexible), gap, flexible);\n for (const each of tracks) {\n if (each.max.kind === 'fit-content') {\n each.limit = Math.min(each.limit, Math.max(each.max.limit, each.base));\n }\n if (each.limit === Infinity) each.limit = each.base;\n }\n}\n\n/** 11.7.1: the size of one `fr` that fills `space` over these tracks. */\nfunction fraction(tracks: Track[], space: number): number {\n const rigid = new Set(tracks.filter((each) => !flexible(each)));\n for (;;) {\n const left = space - sum([...rigid].map((each) => each.base));\n const factors = sum(\n tracks\n .filter((each) => !rigid.has(each))\n .map((each) => (each.max as { factor: number }).factor),\n );\n const size = left / Math.max(factors, 1);\n const short = tracks.find(\n (each) => !rigid.has(each) && size * (each.max as { factor: number }).factor < each.base,\n );\n if (!short) return size;\n rigid.add(short);\n }\n}\n\nfunction expandFlexible(\n tracks: Track[],\n items: Contribution[],\n gap: number,\n available: number | undefined,\n) {\n const flex = tracks.filter(flexible);\n if (!flex.length) return;\n const factor = (each: Track) => (each.max as { factor: number }).factor;\n const gaps = gap * (tracks.length - 1);\n let size: number;\n if (available !== undefined) {\n size = fraction(tracks, available - gaps);\n } else {\n size = Math.max(0, ...flex.map((each) => each.base / Math.max(factor(each), 1)));\n for (const item of items) {\n const spanned = tracks.slice(item.start, item.start + item.span);\n if (spanned.some(flexible)) {\n size = Math.max(size, fraction(spanned, item.max - gap * (item.span - 1)));\n }\n }\n }\n for (const each of flex) each.base = Math.max(each.base, size * factor(each));\n}\n\n/** Sizes on `tracks` for these items, in `available` room or in as much as the content wants. */\nfunction sizeTracks(\n tracks: Track[],\n items: Contribution[],\n gap: number,\n available: number | undefined,\n stretch: boolean,\n): void {\n initialise(tracks);\n resolveIntrinsic(tracks, items, gap);\n const free = () =>\n (available ?? Infinity) - sum(tracks.map((each) => each.base)) - gap * (tracks.length - 1);\n // 11.6: grow every track towards its growth limit with what is free.\n if (available === undefined) {\n for (const each of tracks) each.base = each.limit;\n } else if (free() > 0) {\n const taken = share(free(), tracks, (each) => each.limit - each.base, []);\n for (const [each, amount] of taken) each.base += amount;\n }\n expandFlexible(tracks, items, gap, available);\n // 11.8: `auto` tracks take what is still free.\n const autos = tracks.filter((each) => each.max.kind === 'auto');\n if (stretch && available !== undefined && free() > 0 && autos.length) {\n const part = free() / autos.length;\n for (const each of autos) each.base += part;\n }\n}\n\n// Alignment\n\n/** The last word of an alignment value, with `flex-` and `self-` read as the plain keyword. */\nfunction alignment(value: string | undefined, fallback: string): string {\n const word = (value ?? fallback)\n .trim()\n .split(/\\s+/)\n .at(-1)!\n .replace(/^(flex|self)-/, '');\n return word === 'normal' || word === 'auto' ? fallback : word;\n}\n\n/** `safe` keeps what overflows at the start, where it can still be scrolled to. */\nconst isSafe = (value: string | undefined) => /^\\s*safe\\b/.test(value ?? '');\n\n/** What is free around and between `count` tracks, for a content-distribution keyword. */\nfunction distribute(\n align: string,\n free: number,\n count: number,\n): { offset: number; between: number } {\n if (align === 'end') return { offset: free, between: 0 };\n if (align === 'center') return { offset: free / 2, between: 0 };\n if (free <= 0 || !count) return { offset: 0, between: 0 };\n if (align === 'space-between' && count > 1) return { offset: 0, between: free / (count - 1) };\n if (align === 'space-around') return { offset: free / count / 2, between: free / count };\n if (align === 'space-evenly') return { offset: free / (count + 1), between: free / (count + 1) };\n return { offset: 0, between: 0 };\n}\n\n/** Where each track starts, with what is free shared out as `justify-content` or `align-content` say. */\nfunction positions(\n tracks: Track[],\n gap: number,\n available: number | undefined,\n value: string | undefined,\n) {\n const live = tracks.filter((each) => !each.collapsed);\n const used = sum(live.map((each) => each.base)) + gap * Math.max(live.length - 1, 0);\n const free = available === undefined ? 0 : available - used;\n const align = isSafe(value) && free < 0 ? 'start' : alignment(value, 'start');\n const { offset, between } = distribute(align, free, live.length);\n const starts: number[] = [];\n let at = offset;\n for (const each of tracks) {\n starts.push(at);\n if (!each.collapsed) at += each.base + gap + between;\n }\n return { starts, used, between };\n}\n\ninterface Track {\n collapsed?: boolean;\n}\n\n/** An `auto-fit` track nothing is placed in takes no room, and neither does its gap. */\nfunction collapseEmpty(tracks: Track[], items: { start: number; span: number }[]): void {\n tracks.forEach((each, i) => {\n each.collapsed =\n each.autoFit && !items.some((item) => item.start <= i && i < item.start + item.span);\n if (each.collapsed)\n Object.assign(each, { min: { kind: 'length', px: 0 }, max: { kind: 'length', px: 0 } });\n });\n}\n\n/** How far into its room an item starts: pushed by an `auto` margin, or by its alignment. */\nfunction leading(\n free: number,\n self: { align: string; safe: boolean },\n autoStart: boolean,\n autoEnd: boolean,\n) {\n if (autoStart) return Math.max(free, 0) / (autoEnd ? 2 : 1);\n if (autoEnd || (self.safe && free < 0)) return 0;\n if (self.align === 'end') return free;\n return self.align === 'center' ? free / 2 : 0;\n}\n\n/** One axis of an item in its area: its size, and where its border box starts. */\nfunction inArea(\n style: Style,\n axis: { size: string; start: string; end: string },\n area: { start: number; size: number; inline: number },\n self: { align: string; safe: boolean },\n natural: (room: number) => number,\n): { start: number; size: number } {\n const marginStart = style[`margin-${axis.start}`];\n const marginEnd = style[`margin-${axis.end}`];\n // A percentage margin is of the area's width, on either axis.\n const before = length(marginStart, area.inline) ?? 0;\n const margins = before + (length(marginEnd, area.inline) ?? 0);\n const autoMargin = marginStart === 'auto' || marginEnd === 'auto';\n const room = area.size - margins;\n let size = length(style[axis.size], area.size);\n if (size === undefined) size = self.align === 'stretch' && !autoMargin ? room : natural(room);\n size = Math.min(size, length(style[`max-${axis.size}`], area.size) ?? Infinity);\n size = Math.max(size, length(style[`min-${axis.size}`], area.size) ?? 0, 0);\n const lead = leading(room - size, self, marginStart === 'auto', marginEnd === 'auto');\n return { start: area.start + before + lead, size };\n}\n\n// The whole grid\n\nconst X = { size: 'width', start: 'left', end: 'right' };\nconst Y = { size: 'height', start: 'top', end: 'bottom' };\n\n/**\n * What an item's content asks of the tracks on one axis, margins included. A percentage margin\n * is of the width of the item's area, which `inline` is once the columns are sized: down the\n * rows. Across the columns it is not known yet, and is none.\n */\nfunction contribution(\n style: Style,\n axis: typeof X,\n at: { start: number; span: number },\n content: { min: () => number; max: () => number },\n inline?: number,\n): Contribution {\n const fixed = length(style[axis.size], undefined);\n const low = length(style[`min-${axis.size}`], undefined);\n const high = length(style[`max-${axis.size}`], undefined) ?? Infinity;\n // The content is measured only when a track asks for it, and never for a size already set.\n const clamp = (value: () => number) => Math.max(Math.min(fixed ?? value(), high), low ?? 0);\n const margins =\n (length(style[`margin-${axis.start}`], inline) ?? 0) +\n (length(style[`margin-${axis.end}`], inline) ?? 0);\n // The least it can be: its own size where it has one, and otherwise its minimum, which is 0\n // and not `auto` for a view (as `@ng-native/web`'s reset makes it in a browser), so an item\n // with no size of its own is never held to its content's.\n const minimum = fixed === undefined ? Math.min(low ?? 0, high) : clamp(() => fixed);\n return {\n ...at,\n get min() {\n return clamp(content.min) + margins;\n },\n get max() {\n return clamp(content.max) + margins;\n },\n minimum: minimum + margins,\n };\n}\n\n/**\n * How far down each item aligned to a baseline is moved so that the baselines of those that\n * start in one row line up: under the one whose baseline is furthest down. The move is added to\n * the item's top margin, so its row is as tall as the moved items need.\n *\n * ponytail: `last baseline` sits at the start, and so does an item with a percentage or `auto`\n * top margin. An item spanning rows is aligned in the row it starts in.\n */\nfunction baselineShifts(\n container: Style,\n items: readonly GridItem[],\n rows: readonly { start: number }[],\n widthOf: (index: number) => number,\n): number[] {\n const groups = new Map<number, number[]>();\n items.forEach((item, i) => {\n const own = item.style['align-self'];\n const value = isAuto(own) || own === 'normal' ? container['align-items'] : own;\n const margin = item.style['margin-top'];\n if (!item.baseline || !/^(first\\s+)?baseline$/.test(value?.trim() ?? '')) return;\n if (margin !== undefined && length(margin, undefined) === undefined) return;\n groups.set(rows[i]!.start, [...(groups.get(rows[i]!.start) ?? []), i]);\n });\n const shifts = items.map(() => 0);\n for (const group of groups.values()) {\n const above = group.map(\n (i) => px(items[i]!.style['margin-top']) + items[i]!.baseline!(widthOf(i)),\n );\n const lowest = Math.max(...above);\n group.forEach((i, at) => (shifts[i] = lowest - above[at]!));\n }\n return shifts;\n}\n\n/** `aspect-ratio` as width over height: `2`, or `16 / 9`. Nothing for `auto` or none. */\nfunction ratioOf(value: string | undefined): number | undefined {\n const [width, height = '1'] = (value ?? '').split('/').map((each) => Number.parseFloat(each));\n const ratio = Number(width) / Number(height);\n return Number.isFinite(ratio) && ratio > 0 ? ratio : undefined;\n}\n\n/** The width an item's ratio and its own height make, where it has that height and no width. */\nfunction ratioWidth(style: Style): number | undefined {\n const ratio = ratioOf(style['aspect-ratio']);\n const height = length(style['height'], undefined);\n return ratio && height !== undefined && isAuto(style['width']) ? height * ratio : undefined;\n}\n\n/**\n * An item with every size in its style that of its border box, as the layout reads them: one\n * written of its content has its padding and border added, and the least it may be is no less\n * than those, as a box with `min-width: 0` is in a browser.\n * A percentage of the content box is the share of the area with the frame added: see `length`.\n */\nfunction asBorderBox(item: GridItem): GridItem {\n const frame = item.frame;\n if (!frame || (!frame.width && !frame.height)) return item;\n const style: Record<string, string> = { ...item.style };\n const content = style['box-sizing'] === 'content-box';\n framed(style, 'width', frame.width, content);\n framed(style, 'height', frame.height, content);\n return { ...item, style };\n}\n\n/** One axis of `asBorderBox`: `add` is the item's padding and border along it. */\nfunction framed(style: Record<string, string>, axis: string, add: number, content: boolean): void {\n const least = style[`min-${axis}`];\n // A share of the area is known once the area is: a floor is left to the frame added to it.\n if (least === undefined || !least.endsWith('%')) {\n const own = length(least, undefined) ?? 0;\n style[`min-${axis}`] = `${Math.max(content ? own + add : own, add)}px`;\n }\n for (const key of [axis, `max-${axis}`, ...(least?.endsWith('%') ? [`min-${axis}`] : [])]) {\n const value = style[key];\n if (!content || value === undefined) continue;\n if (value.endsWith('%')) style[key] = `${value} + ${add}px`;\n else {\n const points = length(value, undefined);\n if (points !== undefined) style[key] = `${points + add}px`;\n }\n }\n}\n\nfunction gapOf(style: Style, axis: 'row' | 'column', whole: number | undefined): number {\n const [row, column = row] = (style['gap'] ?? '').split(/\\s+/);\n return length(style[`${axis}-gap`] ?? (axis === 'row' ? row : column), whole) ?? 0;\n}\n\nconst usesPercent = (style: Style, axis: 'row' | 'column') =>\n [`grid-template-${axis}s`, `grid-auto-${axis}s`, `${axis}-gap`, 'gap'].some((property) =>\n style[property]?.includes('%'),\n );\n\nfunction solve(\n style: Style,\n given: readonly GridItem[],\n width?: number,\n height?: number,\n): GridLayout {\n // An item with a ratio and a height of its own is as wide as the two make it.\n const items = given.map(asBorderBox).map((item) => {\n const wide = ratioWidth(item.style);\n return wide === undefined ? item : { ...item, style: { ...item.style, width: `${wide}px` } };\n });\n const columnGap = gapOf(style, 'column', width);\n const rowGap = gapOf(style, 'row', height);\n const listedColumns = template(style['grid-template-columns'], width, columnGap);\n const listedRows = template(style['grid-template-rows'], height, rowGap);\n const explicitColumns = listedColumns.tracks;\n const explicitRows = listedRows.tracks;\n // Areas make tracks of their own where the lists have fewer, sized as implicit ones are.\n const areas = templateAreas(style['grid-template-areas']);\n const explicit = {\n columns: Math.max(explicitColumns.length, areas.across),\n rows: Math.max(explicitRows.length, areas.down),\n };\n const names = {\n columns: allNames(listedColumns.names, areas.columns),\n rows: allNames(listedRows.names, areas.rows),\n };\n const placement = place(\n items.map((item) => item.style),\n style,\n explicit,\n names,\n );\n const { before } = placement;\n const columns = withImplicit(\n explicitColumns,\n style['grid-auto-columns'],\n width,\n before.columns,\n placement.columns,\n );\n const rows = withImplicit(\n explicitRows,\n style['grid-auto-rows'],\n height,\n before.rows,\n placement.rows,\n );\n const across = placement.items.map((each) => ({ start: each.column, span: each.columns }));\n const down = placement.items.map((each) => ({ start: each.row, span: each.rows }));\n collapseEmpty(columns, across);\n collapseEmpty(rows, down);\n\n const justifyContent = alignment(style['justify-content'], 'stretch');\n sizeTracks(\n columns,\n items.map((item, i) =>\n contribution(item.style, X, across[i]!, {\n min: () => item.measure('min').width,\n max: () => item.measure('max').width,\n }),\n ),\n columnGap,\n width,\n justifyContent === 'stretch',\n );\n const x = positions(columns, columnGap, width, style['justify-content']);\n const area = (\n starts: number[],\n tracks: Track[],\n at: { start: number; span: number },\n gap: number,\n ) => {\n const live = tracks.slice(at.start, at.start + at.span).filter((each) => !each.collapsed);\n return {\n start: starts[at.start]!,\n size: sum(live.map((each) => each.base)) + gap * Math.max(live.length - 1, 0),\n };\n };\n const selfAlign = (item: GridItem, axis: 'justify' | 'align') => {\n const value = item.style[`${axis}-self`];\n const own = isAuto(value) || value === 'normal' ? style[`${axis}-items`] : value;\n return { align: alignment(own, 'stretch'), safe: isSafe(own) };\n };\n const columnAreas = items.map((_, i) =>\n area(x.starts, columns, across[i]!, columnGap + x.between),\n );\n const horizontal = items.map((item, i) =>\n inArea(\n item.style,\n X,\n { ...columnAreas[i]!, inline: columnAreas[i]!.size },\n selfAlign(item, 'justify'),\n (room) => Math.min(item.measure('max').width, Math.max(item.measure('min').width, room)),\n ),\n );\n\n // An item with a ratio and no height of its own is as tall as its width makes it, and is not\n // stretched: held to a minimum or a maximum height, its width follows where it had none.\n const tall = items.map((item, i) => {\n const ratio = ratioOf(item.style['aspect-ratio']);\n if (!ratio || !isAuto(item.style['height'])) return undefined;\n const wanted = horizontal[i]!.size / ratio;\n const height = Math.max(\n Math.min(wanted, length(item.style['max-height'], undefined) ?? Infinity),\n length(item.style['min-height'], undefined) ?? 0,\n );\n if (height !== wanted && isAuto(item.style['width'])) horizontal[i]!.size = height * ratio;\n return height;\n });\n const lifted = baselineShifts(style, items, down, (i) => horizontal[i]!.size);\n const upright = items.map((item, i) => ({\n ...item.style,\n ...(tall[i] === undefined ? {} : { height: `${tall[i]}px` }),\n ...(lifted[i] ? { 'margin-top': `${px(item.style['margin-top']) + lifted[i]!}px` } : {}),\n }));\n const heights = items.map((item, i) => () => tall[i] ?? item.measure(horizontal[i]!.size).height);\n sizeTracks(\n rows,\n items.map((_, i) =>\n contribution(\n upright[i]!,\n Y,\n down[i]!,\n { min: heights[i]!, max: heights[i]! },\n columnAreas[i]!.size,\n ),\n ),\n rowGap,\n height,\n alignment(style['align-content'], 'stretch') === 'stretch',\n );\n const y = positions(rows, rowGap, height, style['align-content']);\n const vertical = items.map((item, i) =>\n inArea(\n upright[i]!,\n Y,\n { ...area(y.starts, rows, down[i]!, rowGap + y.between), inline: columnAreas[i]!.size },\n selfAlign(item, 'align'),\n heights[i]!,\n ),\n );\n /** Where a line is: the start of the track after it, or the end of the one before it. */\n const edge = (\n starts: number[],\n tracks: Track[],\n at: number | undefined,\n side: 'start' | 'end',\n ) => {\n if (at === undefined) return undefined;\n if (side === 'start' && at < tracks.length) return starts[at]!;\n const last = tracks[at - 1];\n // A grid with no tracks still has its first line, at the content box's edge.\n return last ? starts[at - 1]! + (last.collapsed ? 0 : last.base) : 0;\n };\n return {\n width: width ?? x.used,\n height: height ?? y.used,\n usedWidth: x.used,\n usedHeight: y.used,\n items: items.map((_, i) => ({\n left: horizontal[i]!.start,\n top: vertical[i]!.start,\n width: horizontal[i]!.size,\n height: vertical[i]!.size,\n })),\n area(child) {\n const across = namedTracks(child, 'column', {\n explicit: explicit.columns,\n before: before.columns,\n count: columns.length,\n names: names.columns,\n });\n const down = namedTracks(child, 'row', {\n explicit: explicit.rows,\n before: before.rows,\n count: rows.length,\n names: names.rows,\n });\n return {\n left: edge(x.starts, columns, across.start, 'start'),\n right: edge(x.starts, columns, across.end, 'end'),\n top: edge(y.starts, rows, down.start, 'start'),\n bottom: edge(y.starts, rows, down.end, 'end'),\n };\n },\n };\n}\n\n/**\n * Lay a grid out in a content box of `width` by `height`. A side left out is as big as the tracks\n * come to, and a percentage along it is of that size, resolved by a second pass.\n */\nexport function layOutGrid(\n style: Style,\n items: readonly GridItem[],\n available: { width?: number; height?: number } = {},\n): GridLayout {\n if (style['direction'] !== 'rtl') return leftToRight(style, items, available);\n // Right to left is left to right in a mirror: swap each item's sides, and flip what comes out.\n const flip = (value: string | undefined) =>\n value?.replace(/\\b(left|right)\\b/, (side) => (side === 'left' ? 'right' : 'left'));\n const mirrored = items.map((item) => ({\n ...item,\n style: Object.fromEntries(\n Object.entries(item.style).map(([property, value]) => [flip(property)!, value]),\n ),\n }));\n const layout = leftToRight(style, mirrored, available);\n for (const rect of layout.items) rect.left = layout.width - rect.left - rect.width;\n const mirror = (at: number | undefined) => (at === undefined ? undefined : layout.width - at);\n return {\n ...layout,\n area(child) {\n const { left, right, top, bottom } = layout.area(child);\n return { left: mirror(right), right: mirror(left), top, bottom };\n },\n };\n}\n\nfunction leftToRight(\n style: Style,\n items: readonly GridItem[],\n available: { width?: number; height?: number },\n): GridLayout {\n const first = solve(style, items, available.width, available.height);\n const again = {\n width: available.width ?? (usesPercent(style, 'column') ? first.width : undefined),\n height: available.height ?? (usesPercent(style, 'row') ? first.height : undefined),\n };\n if (again.width === available.width && again.height === available.height) return first;\n return solve(style, items, again.width, again.height);\n}\n"]}
package/dist/host.d.ts CHANGED
@@ -30,7 +30,7 @@ import type { ResponderHandlers, WindowFrame } from './engine.ts';
30
30
  /** What a host node has to be able to answer. `EngineNode` and a DOM element both can. */
31
31
  export interface HostNode {
32
32
  /** `element` or `text`, so a caller can tell a node from the words inside it. */
33
- readonly kind: string;
33
+ readonly nodeKind: string;
34
34
  /**
35
35
  * The props the host is holding for this node.
36
36
  *
@@ -38,9 +38,9 @@ export interface HostNode {
38
38
  * directive consumes has to stop being an attribute the host writes through.
39
39
  */
40
40
  props: Record<string, unknown>;
41
- /** The text, when `kind` is `text`. Empty otherwise. */
42
- text: string;
43
- children: readonly HostNode[];
41
+ /** The text, when `nodeKind` is `text`. Empty otherwise. */
42
+ nodeText: string;
43
+ childList: readonly HostNode[];
44
44
  parent: HostNode | null;
45
45
  /**
46
46
  * Set by `claimHost` from every host primitive's constructor, so a host can tell an element a
@@ -58,7 +58,7 @@ export interface HostNode {
58
58
  * runs once per element on screen. A host whose nodes cannot carry it leaves it out, and the
59
59
  * primitive injects as before.
60
60
  */
61
- readonly host?: HostEngine;
61
+ readonly engine?: HostEngine;
62
62
  }
63
63
  /** Something that writes its node's props once it has its inputs. See `HostEngine.settle`. */
64
64
  export interface Settling {
@@ -111,6 +111,12 @@ export declare abstract class HostEngine {
111
111
  * styles.
112
112
  */
113
113
  adoptScope(_node: HostNode, _like: HostNode | null): void;
114
+ /**
115
+ * Keep the drag now under way from the page until the last finger lifts, as a browser does for
116
+ * a `touchmove` a listener prevented the default of. A host whose page a browser scrolls leaves
117
+ * it out.
118
+ */
119
+ keepDrag?(node: HostNode): void;
114
120
  /**
115
121
  * Take the user to a node: a text input gets the cursor, and anything else is brought on
116
122
  * screen. What a DOM element's own `focus()` does, for code that calls it on an element.
package/dist/host.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"host.js","sourceRoot":"","sources":["../src/host.ts"],"names":[],"mappings":"AA4EA;;;;;GAKG;AACH,MAAM,OAAgB,UAAU;IAwB9B;;;;;;;;OAQG;IACH,MAAM,CAAC,MAAgB;QACrB,cAAc,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,WAAW,EAAE,CAAC,CAAC;IAC7C,CAAC;IAED;;;OAGG;IACH,SAAS,CAAC,KAAe,IAAS,CAAC;IAEnC;;;;;OAKG;IACH,UAAU,CAAC,KAAe,EAAE,KAAsB,IAAS,CAAC;IAE5D;;;OAGG;IACH,KAAK,CAAC,KAAe,IAAS,CAAC;IAE/B;;;OAGG;IACH,MAAM,CAAC,KAAe,EAAE,QAAsD,IAAS,CAAC;IAExF,+FAA+F;IAC/F,IAAI,YAAY;QACd,OAAO,KAAK,CAAC;IACf,CAAC;IAED;;;OAGG;IACH,aAAa,CACX,KAAe,EACf,OAAiB,EACjB,KAAiB,EACjB,MAAmB,EACnB,QAAqC;QAErC,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;;;OAIG;IACH,YAAY,CACV,KAAe,EACf,OAAiB,EACjB,KAAgB,EAChB,SAAyB,EACzB,MAAmB,EACnB,QAAqC,EACrC,MAAsB;QAEtB,OAAO,IAAI,CAAC;IACd,CAAC;CACF","sourcesContent":["/**\n * The contract the shared packages actually depend on, rather than the Fabric implementation.\n *\n * `@ng-native/components` is meant to be renderer-agnostic: it describes a view and a press,\n * and leaves the drawing to a host. In practice they were coupled to Fabric twice over - `inject(Engine)`, which is a concrete\n * class whose constructor wants a `FabricUIManager`, and `EngineNode`, which is a Fabric tree\n * node. A web prototype could only satisfy both by casting a hand-written object through\n * `as unknown as Engine`, which typechecks and tells you nothing.\n *\n * So this is the seam, measured rather than guessed: every `engine.*` call and every `node.*`\n * field those three packages actually make, and nothing else. `Engine` implements `HostEngine` and\n * `EngineNode` extends `HostNode`, so nothing about the native path changes; a browser host\n * implements the same two and needs no cast.\n *\n * It lives in this package because everything already imports from here and importing it costs a\n * web build nothing - the Fabric bindings are reached lazily, through a global the browser does\n * not have. If that stops being true, moving these two declarations to a package of their own is\n * mechanical: nothing here refers to Fabric.\n *\n * ## What is deliberately not in it\n *\n * `tagOf` and `shadowNodeOf` hand out Fabric's own handles, for Reanimated worklets and\n * react-native-gesture-handler. The three components that use them - `worklet-style`,\n * `worklet-scroll` and `native-gesture` - inject the concrete `Engine` and are native-only by\n * nature, which is the honest place to draw that line rather than pretending a browser could\n * answer.\n */\nimport type {\n DrivenProperty,\n EventFeed,\n ScrollAxis,\n ScrollDrive,\n ScrollRange,\n StaticTransform,\n} from './native-drive.ts';\nimport type { ResponderHandlers, WindowFrame } from './engine.ts';\n\n/** What a host node has to be able to answer. `EngineNode` and a DOM element both can. */\nexport interface HostNode {\n /** `element` or `text`, so a caller can tell a node from the words inside it. */\n readonly kind: string;\n /**\n * The props the host is holding for this node.\n *\n * A real bag rather than an accessor, because `ViewBase` deletes from it: an input that a\n * directive consumes has to stop being an attribute the host writes through.\n */\n props: Record<string, unknown>;\n /** The text, when `kind` is `text`. Empty otherwise. */\n text: string;\n children: readonly HostNode[];\n parent: HostNode | null;\n /**\n * Set by `claimHost` from every host primitive's constructor, so a host can tell an element a\n * component owns from a bare one somebody wrote by hand.\n *\n * Part of the contract rather than a Fabric detail, because the shared packages are what set\n * it: `ViewBase`'s constructor calls `claimHost` on every element it hosts. What a host does\n * with it is its own business - Fabric warns about an unclaimed primitive name, and a browser\n * has nothing to warn about.\n */\n claimed?: true;\n /**\n * The engine that made this node, when the host can say. A primitive reads it rather than\n * injecting `HostEngine`, because that lookup walks every element injector up to the root and\n * runs once per element on screen. A host whose nodes cannot carry it leaves it out, and the\n * primitive injects as before.\n */\n readonly host?: HostEngine;\n}\n\n/** Something that writes its node's props once it has its inputs. See `HostEngine.settle`. */\nexport interface Settling {\n settleProps(): void;\n}\n\n/**\n * What a host has to be able to do.\n *\n * An abstract class rather than an interface plus an `InjectionToken`, because Angular can inject\n * an abstract class directly and the alternative is two names for one thing.\n */\nexport abstract class HostEngine {\n /** Write a prop. `undefined` and `null` both clear it, which is how native says \"default\". */\n abstract setProp(node: HostNode, key: string, value: unknown): void;\n /** Listen for one of the host's own events. Returns its own teardown. */\n abstract setEventListener(\n node: HostNode,\n topLevelType: string,\n fn: (event: unknown) => void,\n ): () => void;\n /** Claim gestures on a node, through whatever arbitration the host has. */\n abstract setResponder(node: HostNode, handlers: ResponderHandlers): () => void;\n /** Where the node is on screen, asynchronously, because native answers on its own thread. */\n abstract measure(node: HostNode, into: (frame: WindowFrame) => void): void;\n /** Tell a native view to do something imperative: scroll, focus, blur. */\n abstract dispatchCommand(node: HostNode, name: string, args?: readonly unknown[]): void;\n /** Flush pending work. Native batches; a browser may not need to. */\n abstract commit(): boolean;\n /** The node holding focus, or null. Verified to still be attached before it is handed back. */\n abstract get focused(): HostNode | null;\n /** Turn whatever an app passed as an image source into what the host wants. */\n abstract resolveAsset(value: unknown): unknown;\n /** Turn a colour the app wrote into whatever the host draws with. */\n abstract color(value: unknown): unknown;\n\n /**\n * Call `target.settleProps()` before the next commit, once the element's static inputs are set.\n *\n * A host primitive writes its props from `ngOnChanges` and `ngOnInit`, which run in its parent\n * view's update pass. A parent that detaches itself before its first check never has one, so\n * without this its pressables would take no press and carry no role or `testID`, where on the\n * web a listener and an attribute are there from creation. The default settles in a microtask,\n * for a host with no commit of its own to hang it on.\n */\n settle(target: Settling): void {\n queueMicrotask(() => target.settleProps());\n }\n\n /**\n * Measure a node again from what native now holds for it, in a commit of its own. For a host\n * that measures when content changes, as a browser does, there is nothing to do.\n */\n remeasure(_node: HostNode): void {}\n\n /**\n * Style `node` as an element of the template `like` is written in, rather than of the one that\n * created it, or as its own again when `like` is null: the content view a scroll view makes for\n * its children, which the app styles through a class of its own and so from its own component\n * styles.\n */\n adoptScope(_node: HostNode, _like: HostNode | null): void {}\n\n /**\n * Take the user to a node: a text input gets the cursor, and anything else is brought on\n * screen. What a DOM element's own `focus()` does, for code that calls it on an element.\n */\n focus(_node: HostNode): void {}\n\n /**\n * Scroll whatever the node is in just far enough to show all of it; `visibleBottom` is where in\n * the window the visible area ends, when something such as the keyboard covers its bottom.\n */\n reveal(_node: HostNode, _options?: { visibleBottom?: number; margin?: number }): void {}\n\n /** Whether `driveByScroll` moves views on the native side. A host without it moves nothing. */\n get drivesScroll(): boolean {\n return false;\n }\n\n /**\n * Move `view` by `scroll`'s offset along `axis` on the native side, through `range`, keeping\n * `statics` in its transform. Null when the host cannot, and the caller moves the view itself.\n */\n driveByScroll(\n _view: HostNode,\n _scroll: HostNode,\n _axis: ScrollAxis,\n _range: ScrollRange,\n _statics?: readonly StaticTransform[],\n ): ScrollDrive | null {\n return null;\n }\n\n /**\n * Move `view` by a value `source`'s native events carry, such as a keyboard's height, on the\n * native side, plus `shift` when one is given, which `ScrollDrive.shift` changes. Null when the\n * host cannot. See `driveByScroll`.\n */\n driveByEvent(\n _view: HostNode,\n _source: HostNode,\n _feed: EventFeed,\n _property: DrivenProperty,\n _range: ScrollRange,\n _statics?: readonly StaticTransform[],\n _shift?: number | null,\n ): ScrollDrive | null {\n return null;\n }\n}\n"]}
1
+ {"version":3,"file":"host.js","sourceRoot":"","sources":["../src/host.ts"],"names":[],"mappings":"AA4EA;;;;;GAKG;AACH,MAAM,OAAgB,UAAU;IAwB9B;;;;;;;;OAQG;IACH,MAAM,CAAC,MAAgB;QACrB,cAAc,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,WAAW,EAAE,CAAC,CAAC;IAC7C,CAAC;IAED;;;OAGG;IACH,SAAS,CAAC,KAAe,IAAS,CAAC;IAEnC;;;;;OAKG;IACH,UAAU,CAAC,KAAe,EAAE,KAAsB,IAAS,CAAC;IAS5D;;;OAGG;IACH,KAAK,CAAC,KAAe,IAAS,CAAC;IAE/B;;;OAGG;IACH,MAAM,CAAC,KAAe,EAAE,QAAsD,IAAS,CAAC;IAExF,+FAA+F;IAC/F,IAAI,YAAY;QACd,OAAO,KAAK,CAAC;IACf,CAAC;IAED;;;OAGG;IACH,aAAa,CACX,KAAe,EACf,OAAiB,EACjB,KAAiB,EACjB,MAAmB,EACnB,QAAqC;QAErC,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;;;OAIG;IACH,YAAY,CACV,KAAe,EACf,OAAiB,EACjB,KAAgB,EAChB,SAAyB,EACzB,MAAmB,EACnB,QAAqC,EACrC,MAAsB;QAEtB,OAAO,IAAI,CAAC;IACd,CAAC;CACF","sourcesContent":["/**\n * The contract the shared packages actually depend on, rather than the Fabric implementation.\n *\n * `@ng-native/components` is meant to be renderer-agnostic: it describes a view and a press,\n * and leaves the drawing to a host. In practice they were coupled to Fabric twice over - `inject(Engine)`, which is a concrete\n * class whose constructor wants a `FabricUIManager`, and `EngineNode`, which is a Fabric tree\n * node. A web prototype could only satisfy both by casting a hand-written object through\n * `as unknown as Engine`, which typechecks and tells you nothing.\n *\n * So this is the seam, measured rather than guessed: every `engine.*` call and every `node.*`\n * field those three packages actually make, and nothing else. `Engine` implements `HostEngine` and\n * `EngineNode` extends `HostNode`, so nothing about the native path changes; a browser host\n * implements the same two and needs no cast.\n *\n * It lives in this package because everything already imports from here and importing it costs a\n * web build nothing - the Fabric bindings are reached lazily, through a global the browser does\n * not have. If that stops being true, moving these two declarations to a package of their own is\n * mechanical: nothing here refers to Fabric.\n *\n * ## What is deliberately not in it\n *\n * `tagOf` and `shadowNodeOf` hand out Fabric's own handles, for Reanimated worklets and\n * react-native-gesture-handler. The three components that use them - `worklet-style`,\n * `worklet-scroll` and `native-gesture` - inject the concrete `Engine` and are native-only by\n * nature, which is the honest place to draw that line rather than pretending a browser could\n * answer.\n */\nimport type {\n DrivenProperty,\n EventFeed,\n ScrollAxis,\n ScrollDrive,\n ScrollRange,\n StaticTransform,\n} from './native-drive.ts';\nimport type { ResponderHandlers, WindowFrame } from './engine.ts';\n\n/** What a host node has to be able to answer. `EngineNode` and a DOM element both can. */\nexport interface HostNode {\n /** `element` or `text`, so a caller can tell a node from the words inside it. */\n readonly nodeKind: string;\n /**\n * The props the host is holding for this node.\n *\n * A real bag rather than an accessor, because `ViewBase` deletes from it: an input that a\n * directive consumes has to stop being an attribute the host writes through.\n */\n props: Record<string, unknown>;\n /** The text, when `nodeKind` is `text`. Empty otherwise. */\n nodeText: string;\n childList: readonly HostNode[];\n parent: HostNode | null;\n /**\n * Set by `claimHost` from every host primitive's constructor, so a host can tell an element a\n * component owns from a bare one somebody wrote by hand.\n *\n * Part of the contract rather than a Fabric detail, because the shared packages are what set\n * it: `ViewBase`'s constructor calls `claimHost` on every element it hosts. What a host does\n * with it is its own business - Fabric warns about an unclaimed primitive name, and a browser\n * has nothing to warn about.\n */\n claimed?: true;\n /**\n * The engine that made this node, when the host can say. A primitive reads it rather than\n * injecting `HostEngine`, because that lookup walks every element injector up to the root and\n * runs once per element on screen. A host whose nodes cannot carry it leaves it out, and the\n * primitive injects as before.\n */\n readonly engine?: HostEngine;\n}\n\n/** Something that writes its node's props once it has its inputs. See `HostEngine.settle`. */\nexport interface Settling {\n settleProps(): void;\n}\n\n/**\n * What a host has to be able to do.\n *\n * An abstract class rather than an interface plus an `InjectionToken`, because Angular can inject\n * an abstract class directly and the alternative is two names for one thing.\n */\nexport abstract class HostEngine {\n /** Write a prop. `undefined` and `null` both clear it, which is how native says \"default\". */\n abstract setProp(node: HostNode, key: string, value: unknown): void;\n /** Listen for one of the host's own events. Returns its own teardown. */\n abstract setEventListener(\n node: HostNode,\n topLevelType: string,\n fn: (event: unknown) => void,\n ): () => void;\n /** Claim gestures on a node, through whatever arbitration the host has. */\n abstract setResponder(node: HostNode, handlers: ResponderHandlers): () => void;\n /** Where the node is on screen, asynchronously, because native answers on its own thread. */\n abstract measure(node: HostNode, into: (frame: WindowFrame) => void): void;\n /** Tell a native view to do something imperative: scroll, focus, blur. */\n abstract dispatchCommand(node: HostNode, name: string, args?: readonly unknown[]): void;\n /** Flush pending work. Native batches; a browser may not need to. */\n abstract commit(): boolean;\n /** The node holding focus, or null. Verified to still be attached before it is handed back. */\n abstract get focused(): HostNode | null;\n /** Turn whatever an app passed as an image source into what the host wants. */\n abstract resolveAsset(value: unknown): unknown;\n /** Turn a colour the app wrote into whatever the host draws with. */\n abstract color(value: unknown): unknown;\n\n /**\n * Call `target.settleProps()` before the next commit, once the element's static inputs are set.\n *\n * A host primitive writes its props from `ngOnChanges` and `ngOnInit`, which run in its parent\n * view's update pass. A parent that detaches itself before its first check never has one, so\n * without this its pressables would take no press and carry no role or `testID`, where on the\n * web a listener and an attribute are there from creation. The default settles in a microtask,\n * for a host with no commit of its own to hang it on.\n */\n settle(target: Settling): void {\n queueMicrotask(() => target.settleProps());\n }\n\n /**\n * Measure a node again from what native now holds for it, in a commit of its own. For a host\n * that measures when content changes, as a browser does, there is nothing to do.\n */\n remeasure(_node: HostNode): void {}\n\n /**\n * Style `node` as an element of the template `like` is written in, rather than of the one that\n * created it, or as its own again when `like` is null: the content view a scroll view makes for\n * its children, which the app styles through a class of its own and so from its own component\n * styles.\n */\n adoptScope(_node: HostNode, _like: HostNode | null): void {}\n\n /**\n * Keep the drag now under way from the page until the last finger lifts, as a browser does for\n * a `touchmove` a listener prevented the default of. A host whose page a browser scrolls leaves\n * it out.\n */\n keepDrag?(node: HostNode): void;\n\n /**\n * Take the user to a node: a text input gets the cursor, and anything else is brought on\n * screen. What a DOM element's own `focus()` does, for code that calls it on an element.\n */\n focus(_node: HostNode): void {}\n\n /**\n * Scroll whatever the node is in just far enough to show all of it; `visibleBottom` is where in\n * the window the visible area ends, when something such as the keyboard covers its bottom.\n */\n reveal(_node: HostNode, _options?: { visibleBottom?: number; margin?: number }): void {}\n\n /** Whether `driveByScroll` moves views on the native side. A host without it moves nothing. */\n get drivesScroll(): boolean {\n return false;\n }\n\n /**\n * Move `view` by `scroll`'s offset along `axis` on the native side, through `range`, keeping\n * `statics` in its transform. Null when the host cannot, and the caller moves the view itself.\n */\n driveByScroll(\n _view: HostNode,\n _scroll: HostNode,\n _axis: ScrollAxis,\n _range: ScrollRange,\n _statics?: readonly StaticTransform[],\n ): ScrollDrive | null {\n return null;\n }\n\n /**\n * Move `view` by a value `source`'s native events carry, such as a keyboard's height, on the\n * native side, plus `shift` when one is given, which `ScrollDrive.shift` changes. Null when the\n * host cannot. See `driveByScroll`.\n */\n driveByEvent(\n _view: HostNode,\n _source: HostNode,\n _feed: EventFeed,\n _property: DrivenProperty,\n _range: ScrollRange,\n _statics?: readonly StaticTransform[],\n _shift?: number | null,\n ): ScrollDrive | null {\n return null;\n }\n}\n"]}
package/dist/index.d.ts CHANGED
@@ -10,16 +10,19 @@
10
10
  * framework-agnostic as the rest of the engine. The build-time half of CSS is a different
11
11
  * animal and lives in `@ng-native/metro`.
12
12
  */
13
- export { StyleResolver, matches, styleSheetOf, type AttributeTest, type Combinator, type Compound, type Conditions, type DeferredDeclaration, type GradientTemplate, type HslChannel, type MediaCondition, type NthTest, type RuleIndex, type StyleCache, type StyleRule, type StyleSheet, type StyleTarget, type TokenKind, type TokenValue, } from './css.ts';
13
+ export { StyleResolver, boundDeclaration, matches, styleSheetOf, type AttributeTest, type Combinator, type ComplexSelector, type Compound, type Conditions, type DeferredDeclaration, type GradientTemplate, type HasTest, type HslChannel, type MediaCondition, type NthTest, type RelativeSelector, type RuleIndex, type StyleCache, type StyleRule, type StyleSheet, type StyleTarget, type TokenKind, type TokenValue, } from './css.ts';
14
14
  export { ELEMENT_STYLES, ELEMENT_STYLES_CSS } from './element-styles.ts';
15
15
  export { EngineIntersectionObserver, installDeferTriggers } from './defer-triggers.ts';
16
16
  export { installNodeGlobal } from './node-global.ts';
17
+ export { nextFrame } from './next-frame.ts';
17
18
  export { faceName, registeredFaces } from './font-faces.ts';
18
- export { firstFamily } from './inline-token.ts';
19
- export { DIRECT_EVENTS, Engine, SyntheticEvent, claimHost, keepNativeView, declareNativeProps, fontsLoading, fontsRegistered, fontsSettled, markComponentHost, nativePlatform, onFontsRegistered, onFontsSettled, registerHoist, registerPlatformComponents, registerViewName, type PlatformViewName, type ViewNameOptions, type PostScriptNames, viewNameOf, type EngineNode, type EngineOptions, type EngineStats, type FabricNode, type FabricNodeSet, type FabricUIManager, type HoistOptions, type NativeSyntheticEvent, type NodeKind, type ResponderEvent, type ResponderHandlers, type TouchPayload, type ViewNameNode, type WindowFrame, } from './engine.ts';
19
+ export { firstFamily, tokenFromValue } from './inline-token.ts';
20
+ export { layOutGrid, type Edges, type GridItem, type GridLayout, type Rect } from './grid.ts';
21
+ export { isBlockContainer, planFlow, type FlowKey, type FlowPlan, type FlowTree } from './flow.ts';
22
+ export { DIRECT_EVENTS, Engine, SyntheticEvent, claimHost, extendNodes, keepNativeView, declareNativeProps, fontsLoading, fontsRegistered, fontsSettled, markComponentHost, scrollsOverflow, nativePlatform, onFontsRegistered, onFontsSettled, registerHoist, registerPlatformComponents, registerViewName, registeredViewName, type PlatformViewName, type ViewNameOptions, type PostScriptNames, viewNameOf, type EngineNode, type EngineOptions, type EngineStats, type FabricNode, type FabricNodeSet, type FabricUIManager, type HoistOptions, type NativeSyntheticEvent, type NodeKind, type ResponderEvent, type ResponderHandlers, type TouchPayload, type ViewNameNode, type WindowFrame, } from './engine.ts';
20
23
  export { reportUnboundFormsInput, type NamedHostNode } from './forms-inputs.ts';
21
24
  export { HostEngine, type HostNode, type Settling } from './host.ts';
22
25
  export { getFabricUIManager } from './fabric.ts';
23
26
  export { pinnedRange, type DrivenProperty, type EventFeed, type NativeAnimated, type ScrollAxis, type ScrollDrive, type ScrollRange, type StaticTransform, } from './native-drive.ts';
24
- export { bezier, interpolate, redirect, sample, settled, step, tracksOf, tween, type AnimationSpec, type Keyframe, type RunningAnimation, type Transition, type TransitionSpec, } from './transition.ts';
27
+ export { bezier, interpolate, isNamedColor, parseColor, redirect, sample, settled, step, tracksOf, tween, type AnimationSpec, type Keyframe, type RunningAnimation, type Transition, type TransitionSpec, } from './transition.ts';
25
28
  export { backgroundLayers, type BackgroundLayers } from './background-layers.ts';
package/dist/index.js CHANGED
@@ -10,17 +10,20 @@
10
10
  * framework-agnostic as the rest of the engine. The build-time half of CSS is a different
11
11
  * animal and lives in `@ng-native/metro`.
12
12
  */
13
- export { StyleResolver, matches, styleSheetOf, } from "./css.js";
13
+ export { StyleResolver, boundDeclaration, matches, styleSheetOf, } from "./css.js";
14
14
  export { ELEMENT_STYLES, ELEMENT_STYLES_CSS } from "./element-styles.js";
15
15
  export { EngineIntersectionObserver, installDeferTriggers } from "./defer-triggers.js";
16
16
  export { installNodeGlobal } from "./node-global.js";
17
+ export { nextFrame } from "./next-frame.js";
17
18
  export { faceName, registeredFaces } from "./font-faces.js";
18
- export { firstFamily } from "./inline-token.js";
19
- export { DIRECT_EVENTS, Engine, SyntheticEvent, claimHost, keepNativeView, declareNativeProps, fontsLoading, fontsRegistered, fontsSettled, markComponentHost, nativePlatform, onFontsRegistered, onFontsSettled, registerHoist, registerPlatformComponents, registerViewName, viewNameOf, } from "./engine.js";
19
+ export { firstFamily, tokenFromValue } from "./inline-token.js";
20
+ export { layOutGrid } from "./grid.js";
21
+ export { isBlockContainer, planFlow } from "./flow.js";
22
+ export { DIRECT_EVENTS, Engine, SyntheticEvent, claimHost, extendNodes, keepNativeView, declareNativeProps, fontsLoading, fontsRegistered, fontsSettled, markComponentHost, scrollsOverflow, nativePlatform, onFontsRegistered, onFontsSettled, registerHoist, registerPlatformComponents, registerViewName, registeredViewName, viewNameOf, } from "./engine.js";
20
23
  export { reportUnboundFormsInput } from "./forms-inputs.js";
21
24
  export { HostEngine } from "./host.js";
22
25
  export { getFabricUIManager } from "./fabric.js";
23
26
  export { pinnedRange, } from "./native-drive.js";
24
- export { bezier, interpolate, redirect, sample, settled, step, tracksOf, tween, } from "./transition.js";
27
+ export { bezier, interpolate, isNamedColor, parseColor, redirect, sample, settled, step, tracksOf, tween, } from "./transition.js";
25
28
  export { backgroundLayers } from "./background-layers.js";
26
29
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,EACL,aAAa,EACb,OAAO,EACP,YAAY,GAiBb,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACzE,OAAO,EAAE,0BAA0B,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AACvF,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAC5D,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EACL,aAAa,EACb,MAAM,EACN,cAAc,EACd,SAAS,EACT,cAAc,EACd,kBAAkB,EAClB,YAAY,EACZ,eAAe,EACf,YAAY,EACZ,iBAAiB,EACjB,cAAc,EACd,iBAAiB,EACjB,cAAc,EACd,aAAa,EACb,0BAA0B,EAC1B,gBAAgB,EAIhB,UAAU,GAeX,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,uBAAuB,EAAsB,MAAM,mBAAmB,CAAC;AAChF,OAAO,EAAE,UAAU,EAAgC,MAAM,WAAW,CAAC;AACrE,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EACL,WAAW,GAQZ,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,MAAM,EACN,WAAW,EACX,QAAQ,EACR,MAAM,EACN,OAAO,EACP,IAAI,EACJ,QAAQ,EACR,KAAK,GAMN,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,gBAAgB,EAAyB,MAAM,wBAAwB,CAAC","sourcesContent":["/**\n * The engine's public surface.\n *\n * Nothing here imports Angular, and nothing here may start to: the engine stays\n * framework-agnostic (see docs/ARCHITECTURE.md), which is what keeps the commit logic testable without Angular in\n * the loop and a second adapter possible later.\n *\n * The CSS runtime lives here rather than in a package of its own because the cascade is driven\n * from the commit walk - the resolver runs per node, per tick - and because it is as\n * framework-agnostic as the rest of the engine. The build-time half of CSS is a different\n * animal and lives in `@ng-native/metro`.\n */\nexport {\n StyleResolver,\n matches,\n styleSheetOf,\n type AttributeTest,\n type Combinator,\n type Compound,\n type Conditions,\n type DeferredDeclaration,\n type GradientTemplate,\n type HslChannel,\n type MediaCondition,\n type NthTest,\n type RuleIndex,\n type StyleCache,\n type StyleRule,\n type StyleSheet,\n type StyleTarget,\n type TokenKind,\n type TokenValue,\n} from './css.ts';\nexport { ELEMENT_STYLES, ELEMENT_STYLES_CSS } from './element-styles.ts';\nexport { EngineIntersectionObserver, installDeferTriggers } from './defer-triggers.ts';\nexport { installNodeGlobal } from './node-global.ts';\nexport { faceName, registeredFaces } from './font-faces.ts';\nexport { firstFamily } from './inline-token.ts';\nexport {\n DIRECT_EVENTS,\n Engine,\n SyntheticEvent,\n claimHost,\n keepNativeView,\n declareNativeProps,\n fontsLoading,\n fontsRegistered,\n fontsSettled,\n markComponentHost,\n nativePlatform,\n onFontsRegistered,\n onFontsSettled,\n registerHoist,\n registerPlatformComponents,\n registerViewName,\n type PlatformViewName,\n type ViewNameOptions,\n type PostScriptNames,\n viewNameOf,\n type EngineNode,\n type EngineOptions,\n type EngineStats,\n type FabricNode,\n type FabricNodeSet,\n type FabricUIManager,\n type HoistOptions,\n type NativeSyntheticEvent,\n type NodeKind,\n type ResponderEvent,\n type ResponderHandlers,\n type TouchPayload,\n type ViewNameNode,\n type WindowFrame,\n} from './engine.ts';\nexport { reportUnboundFormsInput, type NamedHostNode } from './forms-inputs.ts';\nexport { HostEngine, type HostNode, type Settling } from './host.ts';\nexport { getFabricUIManager } from './fabric.ts';\nexport {\n pinnedRange,\n type DrivenProperty,\n type EventFeed,\n type NativeAnimated,\n type ScrollAxis,\n type ScrollDrive,\n type ScrollRange,\n type StaticTransform,\n} from './native-drive.ts';\nexport {\n bezier,\n interpolate,\n redirect,\n sample,\n settled,\n step,\n tracksOf,\n tween,\n type AnimationSpec,\n type Keyframe,\n type RunningAnimation,\n type Transition,\n type TransitionSpec,\n} from './transition.ts';\nexport { backgroundLayers, type BackgroundLayers } from './background-layers.ts';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,EACL,aAAa,EACb,gBAAgB,EAChB,OAAO,EACP,YAAY,GAoBb,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACzE,OAAO,EAAE,0BAA0B,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AACvF,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAC5D,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAChE,OAAO,EAAE,UAAU,EAAyD,MAAM,WAAW,CAAC;AAC9F,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAA8C,MAAM,WAAW,CAAC;AACnG,OAAO,EACL,aAAa,EACb,MAAM,EACN,cAAc,EACd,SAAS,EACT,WAAW,EACX,cAAc,EACd,kBAAkB,EAClB,YAAY,EACZ,eAAe,EACf,YAAY,EACZ,iBAAiB,EACjB,eAAe,EACf,cAAc,EACd,iBAAiB,EACjB,cAAc,EACd,aAAa,EACb,0BAA0B,EAC1B,gBAAgB,EAChB,kBAAkB,EAIlB,UAAU,GAeX,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,uBAAuB,EAAsB,MAAM,mBAAmB,CAAC;AAChF,OAAO,EAAE,UAAU,EAAgC,MAAM,WAAW,CAAC;AACrE,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EACL,WAAW,GAQZ,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,MAAM,EACN,WAAW,EACX,YAAY,EACZ,UAAU,EACV,QAAQ,EACR,MAAM,EACN,OAAO,EACP,IAAI,EACJ,QAAQ,EACR,KAAK,GAMN,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,gBAAgB,EAAyB,MAAM,wBAAwB,CAAC","sourcesContent":["/**\n * The engine's public surface.\n *\n * Nothing here imports Angular, and nothing here may start to: the engine stays\n * framework-agnostic (see docs/ARCHITECTURE.md), which is what keeps the commit logic testable without Angular in\n * the loop and a second adapter possible later.\n *\n * The CSS runtime lives here rather than in a package of its own because the cascade is driven\n * from the commit walk - the resolver runs per node, per tick - and because it is as\n * framework-agnostic as the rest of the engine. The build-time half of CSS is a different\n * animal and lives in `@ng-native/metro`.\n */\nexport {\n StyleResolver,\n boundDeclaration,\n matches,\n styleSheetOf,\n type AttributeTest,\n type Combinator,\n type ComplexSelector,\n type Compound,\n type Conditions,\n type DeferredDeclaration,\n type GradientTemplate,\n type HasTest,\n type HslChannel,\n type MediaCondition,\n type NthTest,\n type RelativeSelector,\n type RuleIndex,\n type StyleCache,\n type StyleRule,\n type StyleSheet,\n type StyleTarget,\n type TokenKind,\n type TokenValue,\n} from './css.ts';\nexport { ELEMENT_STYLES, ELEMENT_STYLES_CSS } from './element-styles.ts';\nexport { EngineIntersectionObserver, installDeferTriggers } from './defer-triggers.ts';\nexport { installNodeGlobal } from './node-global.ts';\nexport { nextFrame } from './next-frame.ts';\nexport { faceName, registeredFaces } from './font-faces.ts';\nexport { firstFamily, tokenFromValue } from './inline-token.ts';\nexport { layOutGrid, type Edges, type GridItem, type GridLayout, type Rect } from './grid.ts';\nexport { isBlockContainer, planFlow, type FlowKey, type FlowPlan, type FlowTree } from './flow.ts';\nexport {\n DIRECT_EVENTS,\n Engine,\n SyntheticEvent,\n claimHost,\n extendNodes,\n keepNativeView,\n declareNativeProps,\n fontsLoading,\n fontsRegistered,\n fontsSettled,\n markComponentHost,\n scrollsOverflow,\n nativePlatform,\n onFontsRegistered,\n onFontsSettled,\n registerHoist,\n registerPlatformComponents,\n registerViewName,\n registeredViewName,\n type PlatformViewName,\n type ViewNameOptions,\n type PostScriptNames,\n viewNameOf,\n type EngineNode,\n type EngineOptions,\n type EngineStats,\n type FabricNode,\n type FabricNodeSet,\n type FabricUIManager,\n type HoistOptions,\n type NativeSyntheticEvent,\n type NodeKind,\n type ResponderEvent,\n type ResponderHandlers,\n type TouchPayload,\n type ViewNameNode,\n type WindowFrame,\n} from './engine.ts';\nexport { reportUnboundFormsInput, type NamedHostNode } from './forms-inputs.ts';\nexport { HostEngine, type HostNode, type Settling } from './host.ts';\nexport { getFabricUIManager } from './fabric.ts';\nexport {\n pinnedRange,\n type DrivenProperty,\n type EventFeed,\n type NativeAnimated,\n type ScrollAxis,\n type ScrollDrive,\n type ScrollRange,\n type StaticTransform,\n} from './native-drive.ts';\nexport {\n bezier,\n interpolate,\n isNamedColor,\n parseColor,\n redirect,\n sample,\n settled,\n step,\n tracksOf,\n tween,\n type AnimationSpec,\n type Keyframe,\n type RunningAnimation,\n type Transition,\n type TransitionSpec,\n} from './transition.ts';\nexport { backgroundLayers, type BackgroundLayers } from './background-layers.ts';\n"]}
@@ -63,6 +63,22 @@ export interface ScrollDrive {
63
63
  shift(amount: number): void;
64
64
  stop(): void;
65
65
  }
66
+ /**
67
+ * A transform entry native applies after a drive's translate: an amount, or a node of another
68
+ * graph's that native moves, such as a transition's along its clock.
69
+ */
70
+ export type FollowingTransform = {
71
+ readonly property: string;
72
+ readonly value: number;
73
+ } | {
74
+ readonly property: string;
75
+ readonly node: number;
76
+ };
77
+ /** A drive whose transform after its translate can change. */
78
+ export interface ComposedDrive extends ScrollDrive {
79
+ /** Have native apply these after the translate, in place of what it applied after it before. */
80
+ follow(entries: readonly FollowingTransform[]): void;
81
+ }
66
82
  /**
67
83
  * Told of each view a graph is connected to, with the props it sets there. Once a graph has set
68
84
  * a view's `transform` or `opacity`, React Native lets no commit change it again: iOS skips both
@@ -115,7 +131,7 @@ export declare class NativeScrollDriver {
115
131
  * null before, which is why the connection may wait for a commit: `connect` is tried again by
116
132
  * `afterCommit` until both views exist.
117
133
  */
118
- drive(view: object, source: object, feed: EventFeed, property: DrivenProperty, range: ScrollRange, statics: readonly StaticTransform[], tagOf: (node: object) => number | null, shift?: number | null): ScrollDrive;
134
+ drive(view: object, source: object, feed: EventFeed, property: DrivenProperty, range: ScrollRange, statics: readonly StaticTransform[], tagOf: (node: object) => number | null, shift?: number | null): ComposedDrive;
119
135
  /**
120
136
  * Play a view's opacity and transform by a scroll: each channel an interpolation from the
121
137
  * offset, as `scroll-animation.ts` lays a `@keyframes` animation along it. `update` rebuilds
@@ -132,14 +148,25 @@ export declare class NativeScrollDriver {
132
148
  * of the last iteration; `stop` lets the view go, and stops an animation still playing.
133
149
  *
134
150
  * Null where the native module cannot start an animation, and the caller plays it itself.
151
+ *
152
+ * With `lend`, the transform is not set on the view: its entries are handed to `lend` once
153
+ * built, for a graph that sets the view's transform already to apply, and `lend` is told null
154
+ * before they go.
135
155
  */
136
156
  play(view: object, channels: DrivenChannels, timing: {
137
157
  frames: readonly number[];
138
158
  toValue: number;
139
159
  iterations: number;
140
- }, tagOf: (node: object) => number | null, ended: () => void): {
160
+ }, tagOf: (node: object) => number | null, ended: () => void, lend?: (entries: readonly FollowingTransform[] | null) => void): {
141
161
  stop(): void;
142
162
  } | null;
163
+ /**
164
+ * The nodes for what `play` plays: a transform handed to `lend` is set by another graph, and
165
+ * with nothing else to set the view has no props node.
166
+ */
167
+ private buildPlayed;
168
+ /** An interpolation from `value`, clamped at both ends, noted in `made`. */
169
+ private interpolation;
143
170
  /** The nodes for a set of channels, connected to the view; the props node first. */
144
171
  private buildChannels;
145
172
  private dropChannels;