@kingkoo1985/ink 6.6.6
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/build/colorize.d.ts +4 -0
- package/build/colorize.js +59 -0
- package/build/colorize.js.map +1 -0
- package/build/components/AccessibilityContext.d.ts +3 -0
- package/build/components/AccessibilityContext.js +5 -0
- package/build/components/AccessibilityContext.js.map +1 -0
- package/build/components/App.d.ts +68 -0
- package/build/components/App.js +290 -0
- package/build/components/App.js.map +1 -0
- package/build/components/AppContext.d.ts +52 -0
- package/build/components/AppContext.js +16 -0
- package/build/components/AppContext.js.map +1 -0
- package/build/components/BackgroundContext.d.ts +4 -0
- package/build/components/BackgroundContext.js +3 -0
- package/build/components/BackgroundContext.js.map +1 -0
- package/build/components/Box.d.ts +171 -0
- package/build/components/Box.js +40 -0
- package/build/components/Box.js.map +1 -0
- package/build/components/ErrorOverview.d.ts +6 -0
- package/build/components/ErrorOverview.js +84 -0
- package/build/components/ErrorOverview.js.map +1 -0
- package/build/components/FocusContext.d.ts +16 -0
- package/build/components/FocusContext.js +16 -0
- package/build/components/FocusContext.js.map +1 -0
- package/build/components/Newline.d.ts +13 -0
- package/build/components/Newline.js +8 -0
- package/build/components/Newline.js.map +1 -0
- package/build/components/Spacer.d.ts +7 -0
- package/build/components/Spacer.js +11 -0
- package/build/components/Spacer.js.map +1 -0
- package/build/components/Static.d.ts +24 -0
- package/build/components/Static.js +29 -0
- package/build/components/Static.js.map +1 -0
- package/build/components/StaticRender.d.ts +8 -0
- package/build/components/StaticRender.js +19 -0
- package/build/components/StaticRender.js.map +1 -0
- package/build/components/StderrContext.d.ts +15 -0
- package/build/components/StderrContext.js +12 -0
- package/build/components/StderrContext.js.map +1 -0
- package/build/components/StdinContext.d.ts +22 -0
- package/build/components/StdinContext.js +16 -0
- package/build/components/StdinContext.js.map +1 -0
- package/build/components/StdoutContext.d.ts +15 -0
- package/build/components/StdoutContext.js +12 -0
- package/build/components/StdoutContext.js.map +1 -0
- package/build/components/Text.d.ts +63 -0
- package/build/components/Text.js +50 -0
- package/build/components/Text.js.map +1 -0
- package/build/components/Transform.d.ts +16 -0
- package/build/components/Transform.js +15 -0
- package/build/components/Transform.js.map +1 -0
- package/build/data-limited-lru-map.d.ts +20 -0
- package/build/data-limited-lru-map.js +65 -0
- package/build/data-limited-lru-map.js.map +1 -0
- package/build/debug-log.d.ts +2 -0
- package/build/debug-log.js +44 -0
- package/build/debug-log.js.map +1 -0
- package/build/devtools-window-polyfill.d.ts +1 -0
- package/build/devtools-window-polyfill.js +65 -0
- package/build/devtools-window-polyfill.js.map +1 -0
- package/build/devtools.d.ts +1 -0
- package/build/devtools.js +8 -0
- package/build/devtools.js.map +1 -0
- package/build/dom.d.ts +114 -0
- package/build/dom.js +169 -0
- package/build/dom.js.map +1 -0
- package/build/get-max-width.d.ts +3 -0
- package/build/get-max-width.js +10 -0
- package/build/get-max-width.js.map +1 -0
- package/build/hooks/use-app.d.ts +5 -0
- package/build/hooks/use-app.js +8 -0
- package/build/hooks/use-app.js.map +1 -0
- package/build/hooks/use-focus-manager.d.ts +28 -0
- package/build/hooks/use-focus-manager.js +17 -0
- package/build/hooks/use-focus-manager.js.map +1 -0
- package/build/hooks/use-focus.d.ts +29 -0
- package/build/hooks/use-focus.js +42 -0
- package/build/hooks/use-focus.js.map +1 -0
- package/build/hooks/use-input.d.ts +93 -0
- package/build/hooks/use-input.js +92 -0
- package/build/hooks/use-input.js.map +1 -0
- package/build/hooks/use-is-screen-reader-enabled.d.ts +5 -0
- package/build/hooks/use-is-screen-reader-enabled.js +11 -0
- package/build/hooks/use-is-screen-reader-enabled.js.map +1 -0
- package/build/hooks/use-stderr.d.ts +5 -0
- package/build/hooks/use-stderr.js +8 -0
- package/build/hooks/use-stderr.js.map +1 -0
- package/build/hooks/use-stdin.d.ts +5 -0
- package/build/hooks/use-stdin.js +8 -0
- package/build/hooks/use-stdin.js.map +1 -0
- package/build/hooks/use-stdout.d.ts +5 -0
- package/build/hooks/use-stdout.js +8 -0
- package/build/hooks/use-stdout.js.map +1 -0
- package/build/index.d.ts +38 -0
- package/build/index.js +27 -0
- package/build/index.js.map +1 -0
- package/build/ink.d.ts +110 -0
- package/build/ink.js +576 -0
- package/build/ink.js.map +1 -0
- package/build/instances.d.ts +3 -0
- package/build/instances.js +8 -0
- package/build/instances.js.map +1 -0
- package/build/layout.d.ts +18 -0
- package/build/layout.js +54 -0
- package/build/layout.js.map +1 -0
- package/build/log-update.d.ts +28 -0
- package/build/log-update.js +529 -0
- package/build/log-update.js.map +1 -0
- package/build/measure-element.d.ts +119 -0
- package/build/measure-element.js +825 -0
- package/build/measure-element.js.map +1 -0
- package/build/measure-text.d.ts +50 -0
- package/build/measure-text.js +237 -0
- package/build/measure-text.js.map +1 -0
- package/build/output.d.ts +242 -0
- package/build/output.js +607 -0
- package/build/output.js.map +1 -0
- package/build/parse-keypress.d.ts +14 -0
- package/build/parse-keypress.js +225 -0
- package/build/parse-keypress.js.map +1 -0
- package/build/reconciler.d.ts +4 -0
- package/build/reconciler.js +326 -0
- package/build/reconciler.js.map +1 -0
- package/build/render-background.d.ts +4 -0
- package/build/render-background.js +37 -0
- package/build/render-background.js.map +1 -0
- package/build/render-border.d.ts +4 -0
- package/build/render-border.js +81 -0
- package/build/render-border.js.map +1 -0
- package/build/render-cached.d.ts +18 -0
- package/build/render-cached.js +66 -0
- package/build/render-cached.js.map +1 -0
- package/build/render-container.d.ts +27 -0
- package/build/render-container.js +169 -0
- package/build/render-container.js.map +1 -0
- package/build/render-node-to-output.d.ts +32 -0
- package/build/render-node-to-output.js +177 -0
- package/build/render-node-to-output.js.map +1 -0
- package/build/render-screen-reader.d.ts +5 -0
- package/build/render-screen-reader.js +54 -0
- package/build/render-screen-reader.js.map +1 -0
- package/build/render-scrollbar.d.ts +23 -0
- package/build/render-scrollbar.js +70 -0
- package/build/render-scrollbar.js.map +1 -0
- package/build/render-sticky.d.ts +53 -0
- package/build/render-sticky.js +317 -0
- package/build/render-sticky.js.map +1 -0
- package/build/render-text-node.d.ts +20 -0
- package/build/render-text-node.js +155 -0
- package/build/render-text-node.js.map +1 -0
- package/build/render.d.ts +165 -0
- package/build/render.js +60 -0
- package/build/render.js.map +1 -0
- package/build/renderer.d.ts +24 -0
- package/build/renderer.js +292 -0
- package/build/renderer.js.map +1 -0
- package/build/replay.d.ts +59 -0
- package/build/replay.js +128 -0
- package/build/replay.js.map +1 -0
- package/build/resize-observer.d.ts +24 -0
- package/build/resize-observer.js +102 -0
- package/build/resize-observer.js.map +1 -0
- package/build/scroll.d.ts +11 -0
- package/build/scroll.js +123 -0
- package/build/scroll.js.map +1 -0
- package/build/selection.d.ts +52 -0
- package/build/selection.js +359 -0
- package/build/selection.js.map +1 -0
- package/build/serialization.d.ts +25 -0
- package/build/serialization.js +224 -0
- package/build/serialization.js.map +1 -0
- package/build/squash-text-nodes.d.ts +16 -0
- package/build/squash-text-nodes.js +58 -0
- package/build/squash-text-nodes.js.map +1 -0
- package/build/styled-line.d.ts +58 -0
- package/build/styled-line.js +629 -0
- package/build/styled-line.js.map +1 -0
- package/build/styles.d.ts +286 -0
- package/build/styles.js +257 -0
- package/build/styles.js.map +1 -0
- package/build/terminal-buffer.d.ts +57 -0
- package/build/terminal-buffer.js +507 -0
- package/build/terminal-buffer.js.map +1 -0
- package/build/text-wrap.d.ts +12 -0
- package/build/text-wrap.js +154 -0
- package/build/text-wrap.js.map +1 -0
- package/build/tokenize.d.ts +47 -0
- package/build/tokenize.js +419 -0
- package/build/tokenize.js.map +1 -0
- package/build/vertical-gap.d.ts +17 -0
- package/build/vertical-gap.js +20 -0
- package/build/vertical-gap.js.map +1 -0
- package/build/worker/animation-controller.d.ts +72 -0
- package/build/worker/animation-controller.js +128 -0
- package/build/worker/animation-controller.js.map +1 -0
- package/build/worker/ansi-utils.d.ts +16 -0
- package/build/worker/ansi-utils.js +40 -0
- package/build/worker/ansi-utils.js.map +1 -0
- package/build/worker/canvas.d.ts +49 -0
- package/build/worker/canvas.js +90 -0
- package/build/worker/canvas.js.map +1 -0
- package/build/worker/compositor.d.ts +33 -0
- package/build/worker/compositor.js +308 -0
- package/build/worker/compositor.js.map +1 -0
- package/build/worker/platform.d.ts +15 -0
- package/build/worker/platform.js +19 -0
- package/build/worker/platform.js.map +1 -0
- package/build/worker/render-worker.d.ts +112 -0
- package/build/worker/render-worker.js +944 -0
- package/build/worker/render-worker.js.map +1 -0
- package/build/worker/scene-manager.d.ts +26 -0
- package/build/worker/scene-manager.js +109 -0
- package/build/worker/scene-manager.js.map +1 -0
- package/build/worker/scroll-optimizer.d.ts +32 -0
- package/build/worker/scroll-optimizer.js +110 -0
- package/build/worker/scroll-optimizer.js.map +1 -0
- package/build/worker/terminal-writer.d.ts +116 -0
- package/build/worker/terminal-writer.js +708 -0
- package/build/worker/terminal-writer.js.map +1 -0
- package/build/worker/worker-entry.d.ts +6 -0
- package/build/worker/worker-entry.js +130 -0
- package/build/worker/worker-entry.js.map +1 -0
- package/license +9 -0
- package/package.json +208 -0
- package/readme.md +2353 -0
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import cliBoxes from 'cli-boxes';
|
|
2
|
+
import chalk from 'chalk';
|
|
3
|
+
import colorize from './colorize.js';
|
|
4
|
+
const renderBorder = (x, y, node, output) => {
|
|
5
|
+
if (node.style.borderStyle) {
|
|
6
|
+
const width = node.yogaNode.getComputedWidth();
|
|
7
|
+
const height = node.yogaNode.getComputedHeight();
|
|
8
|
+
const box = typeof node.style.borderStyle === 'string'
|
|
9
|
+
? cliBoxes[node.style.borderStyle]
|
|
10
|
+
: node.style.borderStyle;
|
|
11
|
+
const topBorderColor = node.style.borderTopColor ?? node.style.borderColor;
|
|
12
|
+
const bottomBorderColor = node.style.borderBottomColor ?? node.style.borderColor;
|
|
13
|
+
const leftBorderColor = node.style.borderLeftColor ?? node.style.borderColor;
|
|
14
|
+
const rightBorderColor = node.style.borderRightColor ?? node.style.borderColor;
|
|
15
|
+
const dimTopBorderColor = node.style.borderTopDimColor ?? node.style.borderDimColor;
|
|
16
|
+
const dimBottomBorderColor = node.style.borderBottomDimColor ?? node.style.borderDimColor;
|
|
17
|
+
const dimLeftBorderColor = node.style.borderLeftDimColor ?? node.style.borderDimColor;
|
|
18
|
+
const dimRightBorderColor = node.style.borderRightDimColor ?? node.style.borderDimColor;
|
|
19
|
+
const showTopBorder = node.style.borderTop !== false;
|
|
20
|
+
const showBottomBorder = node.style.borderBottom !== false;
|
|
21
|
+
const showLeftBorder = node.style.borderLeft !== false;
|
|
22
|
+
const showRightBorder = node.style.borderRight !== false;
|
|
23
|
+
const contentWidth = width - (showLeftBorder ? 1 : 0) - (showRightBorder ? 1 : 0);
|
|
24
|
+
let topBorder = showTopBorder
|
|
25
|
+
? colorize((showLeftBorder ? box.topLeft : '') +
|
|
26
|
+
box.top.repeat(contentWidth) +
|
|
27
|
+
(showRightBorder ? box.topRight : ''), topBorderColor, 'foreground')
|
|
28
|
+
: undefined;
|
|
29
|
+
if (showTopBorder && dimTopBorderColor) {
|
|
30
|
+
topBorder = chalk.dim(topBorder);
|
|
31
|
+
}
|
|
32
|
+
let verticalBorderHeight = height;
|
|
33
|
+
if (showTopBorder) {
|
|
34
|
+
verticalBorderHeight -= 1;
|
|
35
|
+
}
|
|
36
|
+
if (showBottomBorder) {
|
|
37
|
+
verticalBorderHeight -= 1;
|
|
38
|
+
}
|
|
39
|
+
let leftBorder = (colorize(box.left, leftBorderColor, 'foreground') + '\n').repeat(verticalBorderHeight);
|
|
40
|
+
if (dimLeftBorderColor) {
|
|
41
|
+
leftBorder = chalk.dim(leftBorder);
|
|
42
|
+
}
|
|
43
|
+
let rightBorder = (colorize(box.right, rightBorderColor, 'foreground') + '\n').repeat(verticalBorderHeight);
|
|
44
|
+
if (dimRightBorderColor) {
|
|
45
|
+
rightBorder = chalk.dim(rightBorder);
|
|
46
|
+
}
|
|
47
|
+
let bottomBorder = showBottomBorder
|
|
48
|
+
? colorize((showLeftBorder ? box.bottomLeft : '') +
|
|
49
|
+
box.bottom.repeat(contentWidth) +
|
|
50
|
+
(showRightBorder ? box.bottomRight : ''), bottomBorderColor, 'foreground')
|
|
51
|
+
: undefined;
|
|
52
|
+
if (showBottomBorder && dimBottomBorderColor) {
|
|
53
|
+
bottomBorder = chalk.dim(bottomBorder);
|
|
54
|
+
}
|
|
55
|
+
const offsetY = showTopBorder ? 1 : 0;
|
|
56
|
+
if (topBorder) {
|
|
57
|
+
output.write(x, y, topBorder, { transformers: [] });
|
|
58
|
+
}
|
|
59
|
+
if (showLeftBorder) {
|
|
60
|
+
for (const [index, line] of leftBorder.split('\n').entries()) {
|
|
61
|
+
output.write(x, y + offsetY + index, line, {
|
|
62
|
+
transformers: [],
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
if (showRightBorder) {
|
|
67
|
+
for (const [index, line] of rightBorder.split('\n').entries()) {
|
|
68
|
+
output.write(x + width - 1, y + offsetY + index, line, {
|
|
69
|
+
transformers: [],
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
if (bottomBorder) {
|
|
74
|
+
output.write(x, y + height - 1, bottomBorder, {
|
|
75
|
+
transformers: [],
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
export default renderBorder;
|
|
81
|
+
//# sourceMappingURL=render-border.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"render-border.js","sourceRoot":"","sources":["../src/render-border.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,WAAW,CAAC;AACjC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,QAAQ,MAAM,eAAe,CAAC;AAIrC,MAAM,YAAY,GAAG,CACpB,CAAS,EACT,CAAS,EACT,IAAa,EACb,MAAc,EACP,EAAE;IACT,IAAI,IAAI,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC;QAC5B,MAAM,KAAK,GAAG,IAAI,CAA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AAE;iBAChB,CAAC,CAAC;YACJ,CAAC;QACF,CAAC;QAED,IAAI,eAAe,EAAE,CAAC;YACrB,KAAK,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC,IAAI,WAAW,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC;gBAC/D,MAAM,CAAC,KAAK,CAAC,CAAC,GAAG,KAAK,GAAG,CAAC,EAAE,CAAC,GAAG,OAAO,GAAG,KAAK,EAAE,IAAI,EAAE;oBACtD,YAAY,EAAE,EAAE;iBAChB,CAAC,CAAC;YACJ,CAAC;QACF,CAAC;QAED,IAAI,YAAY,EAAE,CAAC;YAClB,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,GAAG,MAAM,GAAG,CAAC,EAAE,YAAY,EAAE;gBAC7C,YAAY,EAAE,EAAE;aAChB,CAAC,CAAC;QACJ,CAAC;IACF,CAAC;AACF,CAAC,CAAC;AAEF,eAAe,YAAY,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import { type DOMElement, type DOMNode } from './dom.js';
|
|
7
|
+
import type Output from './output.js';
|
|
8
|
+
import { type StyledLine } from './styled-line.js';
|
|
9
|
+
export declare function handleCachedRenderNode(node: DOMElement, output: Output, options: {
|
|
10
|
+
x: number;
|
|
11
|
+
y: number;
|
|
12
|
+
selectionMap?: Map<DOMNode, {
|
|
13
|
+
start: number;
|
|
14
|
+
end: number;
|
|
15
|
+
}>;
|
|
16
|
+
selectionStyle?: (line: StyledLine, index: number) => void;
|
|
17
|
+
trackSelection?: boolean;
|
|
18
|
+
}): void;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import { toStyledCharacters } from './measure-text.js';
|
|
7
|
+
export function handleCachedRenderNode(node, output, options) {
|
|
8
|
+
const { x, y, selectionMap, selectionStyle } = options;
|
|
9
|
+
let handledSelection = false;
|
|
10
|
+
if (selectionMap && selectionMap.has(node) && node.cachedRender) {
|
|
11
|
+
const range = selectionMap.get(node);
|
|
12
|
+
const clonedRegionObj = {
|
|
13
|
+
...node.cachedRender,
|
|
14
|
+
lines: node.cachedRender.lines.map(line => line.clone()),
|
|
15
|
+
selectableSpans: node.cachedRender.selectableSpans.map(span => ({
|
|
16
|
+
...span,
|
|
17
|
+
})),
|
|
18
|
+
stickyHeaders: (node.cachedRender.cachedStickyHeaders ?? []).map(header => ({
|
|
19
|
+
...header,
|
|
20
|
+
})),
|
|
21
|
+
children: node.cachedRender.children.map(child => ({ ...child })),
|
|
22
|
+
};
|
|
23
|
+
const spans = clonedRegionObj.selectableSpans;
|
|
24
|
+
spans.sort((a, b) => (a.y === b.y ? a.startX - b.startX : a.y - b.y));
|
|
25
|
+
let currentOffset = 0;
|
|
26
|
+
let currentY = spans[0]?.y ?? 0;
|
|
27
|
+
let currentX = spans[0]?.startX ?? 0;
|
|
28
|
+
for (const span of spans) {
|
|
29
|
+
if (span.y > currentY) {
|
|
30
|
+
currentOffset += span.y - currentY;
|
|
31
|
+
currentX = 0;
|
|
32
|
+
currentY = span.y;
|
|
33
|
+
}
|
|
34
|
+
if (span.startX > currentX) {
|
|
35
|
+
currentOffset += span.startX - currentX;
|
|
36
|
+
currentX = span.startX;
|
|
37
|
+
}
|
|
38
|
+
let spanCharX = span.startX;
|
|
39
|
+
const styledChars = toStyledCharacters(span.text);
|
|
40
|
+
for (const char of styledChars) {
|
|
41
|
+
const charLen = char.value.length;
|
|
42
|
+
const charWidth = char.fullWidth ? 2 : 1;
|
|
43
|
+
if (currentOffset >= range.start && currentOffset < range.end) {
|
|
44
|
+
const line = clonedRegionObj.lines[span.y];
|
|
45
|
+
if (line && spanCharX < line.length) {
|
|
46
|
+
if (selectionStyle) {
|
|
47
|
+
selectionStyle(line, spanCharX);
|
|
48
|
+
}
|
|
49
|
+
else {
|
|
50
|
+
line.setInverted(spanCharX, true);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
currentOffset += charLen;
|
|
55
|
+
spanCharX += charWidth;
|
|
56
|
+
}
|
|
57
|
+
currentX = span.endX;
|
|
58
|
+
}
|
|
59
|
+
output.addRegionTree(clonedRegionObj, x, y);
|
|
60
|
+
handledSelection = true;
|
|
61
|
+
}
|
|
62
|
+
if (!handledSelection && node.cachedRender) {
|
|
63
|
+
output.addRegionTree(node.cachedRender, x, y);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
//# sourceMappingURL=render-cached.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"render-cached.js","sourceRoot":"","sources":["../src/render-cached.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,EAAC,kBAAkB,EAAC,MAAM,mBAAmB,CAAC;AAGrD,MAAM,UAAU,sBAAsB,CACrC,IAAgB,EAChB,MAAc,EACd,OAMC;IAED,MAAM,EAAC,CAAC,EAAE,CAAC,EAAE,YAAY,EAAE,cAAc,EAAC,GAAG,OAAO,CAAC;IACrD,IAAI,gBAAgB,GAAG,KAAK,CAAC;IAE7B,IAAI,YAAY,IAAI,YAAY,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,YAAY,EAAE,CAAC;QACjE,MAAM,KAAK,GAAG,YAAY,CAAC,GAAG,CAAC,IAAI,CAAE,CAAC;QACtC,MAAM,eAAe,GAAG;YACvB,GAAG,IAAI,CAAC,YAAY;YACpB,KAAK,EAAE,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC;YACxD,eAAe,EAAE,IAAI,CAAC,YAAY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E,CAAC,CAAC,CAAC;IAC/C,CAAC;AACF,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import { type StyledLine } from './styled-line.js';
|
|
7
|
+
import { type DOMElement, type DOMNode } from './dom.js';
|
|
8
|
+
import type Output from './output.js';
|
|
9
|
+
import { type OutputTransformer } from './render-node-to-output.js';
|
|
10
|
+
export declare function handleContainerNode(node: DOMElement, output: Output, options: {
|
|
11
|
+
x: number;
|
|
12
|
+
y: number;
|
|
13
|
+
width: number;
|
|
14
|
+
height: number;
|
|
15
|
+
newTransformers: OutputTransformer[];
|
|
16
|
+
skipStaticElements: boolean;
|
|
17
|
+
isStickyRender: boolean;
|
|
18
|
+
skipStickyHeaders: boolean;
|
|
19
|
+
selectionMap?: Map<DOMNode, {
|
|
20
|
+
start: number;
|
|
21
|
+
end: number;
|
|
22
|
+
}>;
|
|
23
|
+
selectionStyle?: (line: StyledLine, index: number) => void;
|
|
24
|
+
absoluteOffsetX: number;
|
|
25
|
+
absoluteOffsetY: number;
|
|
26
|
+
trackSelection?: boolean;
|
|
27
|
+
}): void;
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import Yoga from 'yoga-layout';
|
|
7
|
+
import renderBackground from './render-background.js';
|
|
8
|
+
import renderBorder from './render-border.js';
|
|
9
|
+
import renderNodeToOutput from './render-node-to-output.js';
|
|
10
|
+
import { getScrollTop, getScrollLeft, getScrollHeight, getScrollWidth, } from './scroll.js';
|
|
11
|
+
import { getStickyDescendants, identifyActiveStickyNodes, renderActiveStickyNodes, } from './render-sticky.js';
|
|
12
|
+
export function handleContainerNode(node, output, options) {
|
|
13
|
+
const { x, y, width, height, newTransformers, skipStaticElements, isStickyRender, skipStickyHeaders, selectionMap, selectionStyle, absoluteOffsetX, absoluteOffsetY, trackSelection, } = options;
|
|
14
|
+
const { yogaNode } = node;
|
|
15
|
+
if (!yogaNode)
|
|
16
|
+
return;
|
|
17
|
+
let clipped = false;
|
|
18
|
+
let childrenOffsetY = y;
|
|
19
|
+
let childrenOffsetX = x;
|
|
20
|
+
const activeStickyNodes = [];
|
|
21
|
+
let verticallyScrollable = false;
|
|
22
|
+
let horizontallyScrollable = false;
|
|
23
|
+
if (node.nodeName === 'ink-box') {
|
|
24
|
+
renderBackground(x, y, node, output);
|
|
25
|
+
renderBorder(x, y, node, output);
|
|
26
|
+
const overflow = node.style.overflow ?? 'visible';
|
|
27
|
+
const overflowX = node.style.overflowX ?? overflow;
|
|
28
|
+
const overflowY = node.style.overflowY ?? overflow;
|
|
29
|
+
verticallyScrollable = overflowY === 'scroll';
|
|
30
|
+
horizontallyScrollable = overflowX === 'scroll';
|
|
31
|
+
if (verticallyScrollable) {
|
|
32
|
+
childrenOffsetY -= getScrollTop(node);
|
|
33
|
+
const stickyNodes = getStickyDescendants(node);
|
|
34
|
+
if (stickyNodes.length > 0) {
|
|
35
|
+
const scrollTop = getScrollTop(node) + yogaNode.getComputedBorder(Yoga.EDGE_TOP);
|
|
36
|
+
const clientHeight = node.internal_scrollState?.clientHeight ?? 0;
|
|
37
|
+
const viewportBottom = scrollTop + clientHeight;
|
|
38
|
+
activeStickyNodes.push(...identifyActiveStickyNodes(stickyNodes, node, scrollTop, viewportBottom));
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
if (horizontallyScrollable) {
|
|
42
|
+
childrenOffsetX -= getScrollLeft(node);
|
|
43
|
+
}
|
|
44
|
+
const clipHorizontally = overflowX === 'hidden' || overflowX === 'scroll';
|
|
45
|
+
const clipVertically = overflowY === 'hidden' || overflowY === 'scroll';
|
|
46
|
+
if (clipHorizontally || clipVertically) {
|
|
47
|
+
const x1 = clipHorizontally
|
|
48
|
+
? absoluteOffsetX + yogaNode.getComputedBorder(Yoga.EDGE_LEFT)
|
|
49
|
+
: undefined;
|
|
50
|
+
const x2 = clipHorizontally
|
|
51
|
+
? absoluteOffsetX +
|
|
52
|
+
yogaNode.getComputedWidth() -
|
|
53
|
+
yogaNode.getComputedBorder(Yoga.EDGE_RIGHT)
|
|
54
|
+
: undefined;
|
|
55
|
+
const y1 = clipVertically
|
|
56
|
+
? absoluteOffsetY + yogaNode.getComputedBorder(Yoga.EDGE_TOP)
|
|
57
|
+
: undefined;
|
|
58
|
+
const y2 = clipVertically
|
|
59
|
+
? absoluteOffsetY +
|
|
60
|
+
yogaNode.getComputedHeight() -
|
|
61
|
+
yogaNode.getComputedBorder(Yoga.EDGE_BOTTOM)
|
|
62
|
+
: undefined;
|
|
63
|
+
if (verticallyScrollable || horizontallyScrollable) {
|
|
64
|
+
const scrollHeight = getScrollHeight(node);
|
|
65
|
+
const scrollWidth = getScrollWidth(node);
|
|
66
|
+
const scrollTop = getScrollTop(node);
|
|
67
|
+
const scrollLeft = getScrollLeft(node);
|
|
68
|
+
const borderLeft = yogaNode.getComputedBorder(Yoga.EDGE_LEFT);
|
|
69
|
+
const borderTop = yogaNode.getComputedBorder(Yoga.EDGE_TOP);
|
|
70
|
+
const borderBottom = yogaNode.getComputedBorder(Yoga.EDGE_BOTTOM);
|
|
71
|
+
let marginRight = 0;
|
|
72
|
+
let marginBottom = 0;
|
|
73
|
+
if (!clipHorizontally) {
|
|
74
|
+
marginRight = yogaNode.getComputedBorder(Yoga.EDGE_RIGHT);
|
|
75
|
+
}
|
|
76
|
+
if (!clipVertically) {
|
|
77
|
+
marginBottom = yogaNode.getComputedBorder(Yoga.EDGE_BOTTOM);
|
|
78
|
+
}
|
|
79
|
+
output.startChildRegion({
|
|
80
|
+
id: node.internalId,
|
|
81
|
+
x: x + borderLeft,
|
|
82
|
+
y: y + borderTop,
|
|
83
|
+
width: (x2 ?? absoluteOffsetX + width) -
|
|
84
|
+
(x1 ?? absoluteOffsetX + borderLeft),
|
|
85
|
+
height: (y2 ?? absoluteOffsetY + height) -
|
|
86
|
+
(y1 ?? absoluteOffsetY + borderTop),
|
|
87
|
+
isScrollable: true,
|
|
88
|
+
isVerticallyScrollable: verticallyScrollable,
|
|
89
|
+
isHorizontallyScrollable: horizontallyScrollable,
|
|
90
|
+
scrollState: {
|
|
91
|
+
scrollTop,
|
|
92
|
+
scrollLeft,
|
|
93
|
+
scrollHeight,
|
|
94
|
+
scrollWidth,
|
|
95
|
+
},
|
|
96
|
+
scrollbarVisible: node.internalScrollbar ?? true,
|
|
97
|
+
overflowToBackbuffer: node.style.overflowToBackbuffer,
|
|
98
|
+
marginRight,
|
|
99
|
+
marginBottom,
|
|
100
|
+
scrollbarThumbColor: node.style.scrollbarThumbColor,
|
|
101
|
+
backgroundColor: node.style.backgroundColor,
|
|
102
|
+
opaque: node.internalOpaque,
|
|
103
|
+
nodeId: node.internalId,
|
|
104
|
+
stableScrollback: node.style.stableScrollback,
|
|
105
|
+
borderTop,
|
|
106
|
+
borderBottom,
|
|
107
|
+
});
|
|
108
|
+
const childOffsetX = -borderLeft;
|
|
109
|
+
const childOffsetY = -borderTop;
|
|
110
|
+
for (const childNode of node.childNodes) {
|
|
111
|
+
renderNodeToOutput(childNode, output, {
|
|
112
|
+
offsetX: childOffsetX,
|
|
113
|
+
offsetY: childOffsetY,
|
|
114
|
+
absoluteOffsetX: absoluteOffsetX - scrollLeft,
|
|
115
|
+
absoluteOffsetY: absoluteOffsetY - scrollTop,
|
|
116
|
+
transformers: newTransformers,
|
|
117
|
+
skipStaticElements,
|
|
118
|
+
isStickyRender,
|
|
119
|
+
skipStickyHeaders: false,
|
|
120
|
+
selectionMap,
|
|
121
|
+
selectionStyle,
|
|
122
|
+
trackSelection,
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
renderActiveStickyNodes(activeStickyNodes, node, output, {
|
|
126
|
+
x,
|
|
127
|
+
y,
|
|
128
|
+
newTransformers,
|
|
129
|
+
skipStaticElements,
|
|
130
|
+
selectionMap,
|
|
131
|
+
selectionStyle,
|
|
132
|
+
trackSelection,
|
|
133
|
+
});
|
|
134
|
+
output.endChildRegion();
|
|
135
|
+
}
|
|
136
|
+
output.clip({
|
|
137
|
+
x1,
|
|
138
|
+
x2,
|
|
139
|
+
y1,
|
|
140
|
+
y2,
|
|
141
|
+
});
|
|
142
|
+
clipped = true;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
if (node.nodeName === 'ink-root' ||
|
|
146
|
+
node.nodeName === 'ink-box') {
|
|
147
|
+
if (!(verticallyScrollable || horizontallyScrollable)) {
|
|
148
|
+
for (const childNode of node.childNodes) {
|
|
149
|
+
renderNodeToOutput(childNode, output, {
|
|
150
|
+
offsetX: childrenOffsetX,
|
|
151
|
+
offsetY: childrenOffsetY,
|
|
152
|
+
absoluteOffsetX,
|
|
153
|
+
absoluteOffsetY,
|
|
154
|
+
transformers: newTransformers,
|
|
155
|
+
skipStaticElements,
|
|
156
|
+
isStickyRender,
|
|
157
|
+
skipStickyHeaders,
|
|
158
|
+
selectionMap,
|
|
159
|
+
selectionStyle,
|
|
160
|
+
trackSelection,
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
if (clipped) {
|
|
165
|
+
output.unclip();
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
//# sourceMappingURL=render-container.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"render-container.js","sourceRoot":"","sources":["../src/render-container.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,IAAI,MAAM,aAAa,CAAC;AAI/B,OAAO,gBAAgB,MAAM,wBAAwB,CAAC;AACtD,OAAO,YAAY,MAAM,oBAAoB,CAAC;AAC9C,OAAO,kBAEN,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACN,YAAY,EACZ,aAAa,EACb,eAA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,YAAY;wBACZ,cAAc;wBACd,cAAc;qBACd,CAAC,CAAC;gBACJ,CAAC;gBAED,uBAAuB,CAAC,iBAAiB,EAAE,IAAI,EAAE,MAAM,EAAE;oBACxD,CAAC;oBACD,CAAC;oBACD,eAAe;oBACf,kBAAkB;oBAClB,YAAY;oBACZ,cAAc;oBACd,cAAc;iBACd,CAAC,CAAC;gBAEH,MAAM,CAAC,cAAc,EAAE,CAAC;YACzB,CAAC;YAED,MAAM,CAAC,IAAI,CAAC;gBACX,EAAE;gBACF,EAAE;gBACF,EAAE;gBACF,EAAE;aACF,CAAC,CAAC;YACH,OAAO,GAAG,IAAI,CAAC;QAChB,CAAC;IACF,CAAC;IAED,IACE,IAAI,CAAC,QAAmB,KAAK,UAAU;QACvC,IAAI,CAAC,QAAmB,KAAK,SAAS,EACtC,CAAC;QACF,IAAI,CAAC,CAAC,oBAAoB,IAAI,sBAAsB,CAAC,EAAE,CAAC;YACvD,KAAK,MAAM,SAAS,IAAI,IAAI,CAAC,UAAU,EAAE,CAAC;gBACzC,kBAAkB,CAAC,SAAuB,EAAE,MAAM,EAAE;oBACnD,OAAO,EAAE,eAAe;oBACxB,OAAO,EAAE,eAAe;oBACxB,eAAe;oBACf,eAAe;oBACf,YAAY,EAAE,eAAe;oBAC7B,kBAAkB;oBAClB,cAAc;oBACd,iBAAiB;oBACjB,YAAY;oBACZ,cAAc;oBACd,cAAc;iBACd,CAAC,CAAC;YACJ,CAAC;QACF,CAAC;QAED,IAAI,OAAO,EAAE,CAAC;YACb,MAAM,CAAC,MAAM,EAAE,CAAC;QACjB,CAAC;IACF,CAAC;AACF,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { type StyledLine } from './styled-line.js';
|
|
2
|
+
import { type DOMElement, type DOMNode } from './dom.js';
|
|
3
|
+
import Output from './output.js';
|
|
4
|
+
export type OutputTransformer = (s: string, index: number) => string;
|
|
5
|
+
export declare const renderToStatic: (node: DOMElement, options?: {
|
|
6
|
+
calculateLayout?: boolean;
|
|
7
|
+
skipStaticElements?: boolean;
|
|
8
|
+
isStickyRender?: boolean;
|
|
9
|
+
selectionMap?: Map<DOMNode, {
|
|
10
|
+
start: number;
|
|
11
|
+
end: number;
|
|
12
|
+
}>;
|
|
13
|
+
selectionStyle?: (line: StyledLine, index: number) => void;
|
|
14
|
+
trackSelection?: boolean;
|
|
15
|
+
}) => void;
|
|
16
|
+
declare function renderNodeToOutput(node: DOMElement, output: Output, options: {
|
|
17
|
+
offsetX?: number;
|
|
18
|
+
offsetY?: number;
|
|
19
|
+
absoluteOffsetX?: number;
|
|
20
|
+
absoluteOffsetY?: number;
|
|
21
|
+
transformers?: OutputTransformer[];
|
|
22
|
+
skipStaticElements: boolean;
|
|
23
|
+
isStickyRender?: boolean;
|
|
24
|
+
skipStickyHeaders?: boolean;
|
|
25
|
+
selectionMap?: Map<DOMNode, {
|
|
26
|
+
start: number;
|
|
27
|
+
end: number;
|
|
28
|
+
}>;
|
|
29
|
+
selectionStyle?: (line: StyledLine, index: number) => void;
|
|
30
|
+
trackSelection?: boolean;
|
|
31
|
+
}): void;
|
|
32
|
+
export default renderNodeToOutput;
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
import Yoga from 'yoga-layout';
|
|
2
|
+
import { setCachedRender, } from './dom.js';
|
|
3
|
+
import Output, { isRectIntersectingClip, extractSelectableText, } from './output.js';
|
|
4
|
+
import { handleTextNode } from './render-text-node.js';
|
|
5
|
+
import { renderStickyNode, getStickyDescendants } from './render-sticky.js';
|
|
6
|
+
import { handleContainerNode } from './render-container.js';
|
|
7
|
+
import { handleCachedRenderNode } from './render-cached.js';
|
|
8
|
+
import { getRelativeLeft, getRelativeTop } from './measure-element.js';
|
|
9
|
+
import { triggerResizeObservers } from './resize-observer.js';
|
|
10
|
+
export const renderToStatic = (node, options = {}) => {
|
|
11
|
+
if (options.calculateLayout && node.yogaNode) {
|
|
12
|
+
node.yogaNode.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR);
|
|
13
|
+
}
|
|
14
|
+
// Cache dimensions of the static tree before we render it out and cache/destroy its Yoga children
|
|
15
|
+
triggerResizeObservers(node, true);
|
|
16
|
+
const width = node.yogaNode?.getComputedWidth() ?? 0;
|
|
17
|
+
const height = node.yogaNode?.getComputedHeight() ?? 0;
|
|
18
|
+
const stickyNodes = getStickyDescendants(node);
|
|
19
|
+
const cachedStickyHeaders = [];
|
|
20
|
+
for (const { node: stickyNode } of stickyNodes) {
|
|
21
|
+
const { naturalLines, stuckLines, naturalHeight, maxHeaderHeight } = renderStickyNode(stickyNode, {
|
|
22
|
+
skipStaticElements: options.skipStaticElements ?? false,
|
|
23
|
+
selectionMap: options.selectionMap,
|
|
24
|
+
selectionStyle: options.selectionStyle,
|
|
25
|
+
trackSelection: options.trackSelection,
|
|
26
|
+
});
|
|
27
|
+
const parent = stickyNode.parentNode;
|
|
28
|
+
const parentYogaNode = parent?.yogaNode;
|
|
29
|
+
const currentBorderTop = node.yogaNode?.getComputedBorder(Yoga.EDGE_TOP) ?? 0;
|
|
30
|
+
const naturalRow = getRelativeTop(stickyNode, node) ?? 0 - currentBorderTop;
|
|
31
|
+
const stickyType = stickyNode.internalSticky === 'bottom' ? 'bottom' : 'top';
|
|
32
|
+
const headerObj = {
|
|
33
|
+
nodeId: stickyNode.internalId,
|
|
34
|
+
lines: naturalLines,
|
|
35
|
+
stuckLines,
|
|
36
|
+
styledOutput: stuckLines ?? naturalLines,
|
|
37
|
+
x: getRelativeLeft(stickyNode, node) ??
|
|
38
|
+
0 - (node.yogaNode?.getComputedBorder(Yoga.EDGE_LEFT) ?? 0),
|
|
39
|
+
y: getRelativeTop(stickyNode, node) ?? 0 - currentBorderTop,
|
|
40
|
+
naturalRow,
|
|
41
|
+
startRow: naturalRow,
|
|
42
|
+
endRow: naturalRow + naturalHeight,
|
|
43
|
+
scrollContainerId: -1,
|
|
44
|
+
isStuckOnly: true,
|
|
45
|
+
relativeX: getRelativeLeft(stickyNode, node) ??
|
|
46
|
+
0 - (node.yogaNode?.getComputedBorder(Yoga.EDGE_LEFT) ?? 0),
|
|
47
|
+
relativeY: getRelativeTop(stickyNode, node) ?? 0 - currentBorderTop,
|
|
48
|
+
height: maxHeaderHeight,
|
|
49
|
+
type: stickyType,
|
|
50
|
+
parentRelativeTop: parent
|
|
51
|
+
? (getRelativeTop(parent, node) ?? 0 - currentBorderTop)
|
|
52
|
+
: 0,
|
|
53
|
+
parentHeight: parentYogaNode
|
|
54
|
+
? parentYogaNode.getComputedHeight()
|
|
55
|
+
: Number.MAX_SAFE_INTEGER,
|
|
56
|
+
parentBorderTop: parentYogaNode
|
|
57
|
+
? parentYogaNode.getComputedBorder(Yoga.EDGE_TOP)
|
|
58
|
+
: 0,
|
|
59
|
+
parentBorderBottom: parentYogaNode
|
|
60
|
+
? parentYogaNode.getComputedBorder(Yoga.EDGE_BOTTOM)
|
|
61
|
+
: 0,
|
|
62
|
+
node: stickyNode,
|
|
63
|
+
};
|
|
64
|
+
cachedStickyHeaders.push(headerObj);
|
|
65
|
+
}
|
|
66
|
+
const staticOutput = new Output({
|
|
67
|
+
width,
|
|
68
|
+
height,
|
|
69
|
+
id: node.internalId,
|
|
70
|
+
trackSelection: options.trackSelection,
|
|
71
|
+
});
|
|
72
|
+
for (const childNode of node.childNodes) {
|
|
73
|
+
renderNodeToOutput(childNode, staticOutput, {
|
|
74
|
+
offsetX: 0,
|
|
75
|
+
offsetY: 0,
|
|
76
|
+
transformers: undefined,
|
|
77
|
+
skipStaticElements: options.skipStaticElements ?? false,
|
|
78
|
+
isStickyRender: options.isStickyRender,
|
|
79
|
+
selectionMap: options.selectionMap,
|
|
80
|
+
selectionStyle: options.selectionStyle,
|
|
81
|
+
trackSelection: options.trackSelection,
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
const rootRegion = staticOutput.get();
|
|
85
|
+
rootRegion.cachedStickyHeaders = cachedStickyHeaders;
|
|
86
|
+
if (options.trackSelection) {
|
|
87
|
+
rootRegion.selectableText = extractSelectableText(rootRegion.selectableSpans);
|
|
88
|
+
}
|
|
89
|
+
setCachedRender(node, rootRegion);
|
|
90
|
+
};
|
|
91
|
+
// After nodes are laid out, render each to output object, which later gets rendered to terminal
|
|
92
|
+
function renderNodeToOutput(node, output, options) {
|
|
93
|
+
const { offsetX = 0, offsetY = 0, absoluteOffsetX = 0, absoluteOffsetY = 0, transformers = [], skipStaticElements, isStickyRender = false, skipStickyHeaders = false, selectionMap, selectionStyle, trackSelection, } = options;
|
|
94
|
+
if (skipStaticElements && node.internal_static) {
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
if (node.internalStickyAlternate && !isStickyRender) {
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
const { yogaNode } = node;
|
|
101
|
+
if (yogaNode) {
|
|
102
|
+
if (yogaNode.getDisplay() === Yoga.DISPLAY_NONE) {
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
// Left and top positions in Yoga are relative to their parent node
|
|
106
|
+
const x = offsetX + yogaNode.getComputedLeft();
|
|
107
|
+
const y = offsetY + yogaNode.getComputedTop();
|
|
108
|
+
// Absolute screen coordinates (for clipping/visibility check)
|
|
109
|
+
const absX = absoluteOffsetX + yogaNode.getComputedLeft();
|
|
110
|
+
const absY = absoluteOffsetY + yogaNode.getComputedTop();
|
|
111
|
+
const width = yogaNode.getComputedWidth();
|
|
112
|
+
const height = yogaNode.getComputedHeight();
|
|
113
|
+
const clip = output.getCurrentClip();
|
|
114
|
+
if (clip) {
|
|
115
|
+
const absoluteNodeLeft = absX;
|
|
116
|
+
const absoluteNodeRight = absoluteNodeLeft + width;
|
|
117
|
+
const absoluteNodeTop = absY;
|
|
118
|
+
const absoluteNodeBottom = absoluteNodeTop + height;
|
|
119
|
+
const isVisible = isRectIntersectingClip({
|
|
120
|
+
x1: absoluteNodeLeft,
|
|
121
|
+
y1: absoluteNodeTop,
|
|
122
|
+
x2: absoluteNodeRight,
|
|
123
|
+
y2: absoluteNodeBottom,
|
|
124
|
+
}, clip);
|
|
125
|
+
if (!isVisible) {
|
|
126
|
+
return;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
// Transformers are functions that transform final text output of each component
|
|
130
|
+
// See Output class for logic that applies transformers
|
|
131
|
+
let newTransformers = transformers;
|
|
132
|
+
if (typeof node.internal_transform === 'function') {
|
|
133
|
+
newTransformers = [node.internal_transform, ...transformers];
|
|
134
|
+
}
|
|
135
|
+
if (node.nodeName === 'ink-static-render' && !node.cachedRender) {
|
|
136
|
+
return;
|
|
137
|
+
}
|
|
138
|
+
if (node.cachedRender) {
|
|
139
|
+
handleCachedRenderNode(node, output, {
|
|
140
|
+
x,
|
|
141
|
+
y,
|
|
142
|
+
selectionMap,
|
|
143
|
+
selectionStyle,
|
|
144
|
+
trackSelection,
|
|
145
|
+
});
|
|
146
|
+
return;
|
|
147
|
+
}
|
|
148
|
+
if (node.nodeName === 'ink-text') {
|
|
149
|
+
handleTextNode(node, output, {
|
|
150
|
+
x,
|
|
151
|
+
y,
|
|
152
|
+
newTransformers,
|
|
153
|
+
selectionMap,
|
|
154
|
+
selectionStyle,
|
|
155
|
+
trackSelection,
|
|
156
|
+
});
|
|
157
|
+
return;
|
|
158
|
+
}
|
|
159
|
+
handleContainerNode(node, output, {
|
|
160
|
+
x,
|
|
161
|
+
y,
|
|
162
|
+
width,
|
|
163
|
+
height,
|
|
164
|
+
newTransformers,
|
|
165
|
+
skipStaticElements,
|
|
166
|
+
isStickyRender,
|
|
167
|
+
skipStickyHeaders,
|
|
168
|
+
selectionMap,
|
|
169
|
+
selectionStyle,
|
|
170
|
+
absoluteOffsetX: absX,
|
|
171
|
+
absoluteOffsetY: absY,
|
|
172
|
+
trackSelection,
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
export default renderNodeToOutput;
|
|
177
|
+
//# sourceMappingURL=render-node-to-output.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"render-node-to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