silvery 0.21.1 → 0.23.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{Text-BRf-59j2.mjs → Text-Ci6UCSTL.mjs} +46 -46
- package/dist/Text-Ci6UCSTL.mjs.map +1 -0
- package/dist/{ag-BeFC4S2N.mjs → ag-q9lRlKlt.mjs} +42 -19
- package/dist/ag-q9lRlKlt.mjs.map +1 -0
- package/dist/{animation-N8MFybTk.mjs → animation-CZ4x2R7C.mjs} +1 -1
- package/dist/{animation-N8MFybTk.mjs.map → animation-CZ4x2R7C.mjs.map} +1 -1
- package/dist/{ansi-C6Qs1Wn2.mjs → ansi-CLmIMnop.mjs} +1 -1
- package/dist/{ansi-C6Qs1Wn2.mjs.map → ansi-CLmIMnop.mjs.map} +1 -1
- package/dist/{ansi-CBkam1ty.d.mts → ansi-zmNzgkPB.d.mts} +1 -1
- package/dist/{ansi-CBkam1ty.d.mts.map → ansi-zmNzgkPB.d.mts.map} +1 -1
- package/dist/backend-DSiSIc-h.mjs +13396 -0
- package/dist/backend-DSiSIc-h.mjs.map +1 -0
- package/dist/chain-bridge-CkYcMxlq.mjs +4149 -0
- package/dist/chain-bridge-CkYcMxlq.mjs.map +1 -0
- package/dist/{chunk-hT5z_Zn9.mjs → chunk-BEJ448es.mjs} +1 -1
- package/dist/cli-VNqUKlXw.mjs +4 -0
- package/dist/{context-BU5LkkIy.mjs → context-CEhuD1R_.mjs} +1 -1
- package/dist/{context-BU5LkkIy.mjs.map → context-CEhuD1R_.mjs.map} +1 -1
- package/dist/devtools-BF4IMumr.mjs +2 -0
- package/dist/{devtools-9zfhpFyG.mjs → devtools-td2AjFwc.mjs} +5 -4
- package/dist/{devtools-9zfhpFyG.mjs.map → devtools-td2AjFwc.mjs.map} +1 -1
- package/dist/{easing-B0oZKDki.d.mts → easing-C5MrdO7V.d.mts} +1 -1
- package/dist/{easing-B0oZKDki.d.mts.map → easing-C5MrdO7V.d.mts.map} +1 -1
- package/dist/{eta-DGOuC8yU.mjs → eta-BwYWEjfS.mjs} +1 -5
- package/dist/{eta-DGOuC8yU.mjs.map → eta-BwYWEjfS.mjs.map} +1 -1
- package/dist/{flexily-zero-adapter-D6hcFgrH.mjs → flexily-zero-adapter-DktX3HsX.mjs} +1 -1
- package/dist/{flexily-zero-adapter-CEJOcbNp.mjs → flexily-zero-adapter-VoBGHG14.mjs} +1 -1
- package/dist/{flexily-zero-adapter-CEJOcbNp.mjs.map → flexily-zero-adapter-VoBGHG14.mjs.map} +1 -1
- package/dist/hit-registry-D_nxOivS.d.mts +71 -0
- package/dist/hit-registry-D_nxOivS.d.mts.map +1 -0
- package/dist/{image-1nRyKa60.mjs → image-CIF75xMr.mjs} +24 -24
- package/dist/image-CIF75xMr.mjs.map +1 -0
- package/dist/{index-2E1jYgak.d.mts → index-377zdPLP.d.mts} +35 -12
- package/dist/index-377zdPLP.d.mts.map +1 -0
- package/dist/{index-DnuadDNL.d.mts → index-BcSr0RAQ.d.mts} +8590 -11173
- package/dist/index-BcSr0RAQ.d.mts.map +1 -0
- package/dist/{index-Dg1YaeJb.d.mts → index-DLnpxDAm.d.mts} +2 -2
- package/dist/{index-Dg1YaeJb.d.mts.map → index-DLnpxDAm.d.mts.map} +1 -1
- package/dist/{index-Bi4Jdz5g.d.mts → index-DlNmckTq.d.mts} +2 -2
- package/dist/{index-Bi4Jdz5g.d.mts.map → index-DlNmckTq.d.mts.map} +1 -1
- package/dist/index.d.mts +12 -8
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +18 -17
- package/dist/index.mjs.map +1 -1
- package/dist/{layout-engine-Ca_nbtfL.mjs → layout-engine-BgR58vL0.mjs} +3 -3
- package/dist/{layout-engine-Ca_nbtfL.mjs.map → layout-engine-BgR58vL0.mjs.map} +1 -1
- package/dist/{layout-engine-CgsoBRIn.mjs → layout-engine-DNjTha8f.mjs} +1 -1
- package/dist/{layout-signals-Dch2EiCy.mjs → layout-signals-CGYbHmxy.mjs} +2 -2
- package/dist/layout-signals-CGYbHmxy.mjs.map +1 -0
- package/dist/{bound-term-BumfuXXW.d.mts → mouse-events-B2z5tbsL.d.mts} +540 -401
- package/dist/mouse-events-B2z5tbsL.d.mts.map +1 -0
- package/dist/{mouse-events-hnbJZRwK.mjs → mouse-events-WQ2h-uqG.mjs} +14 -6
- package/dist/mouse-events-WQ2h-uqG.mjs.map +1 -0
- package/dist/{multi-progress-Bg4ngK80.d.mts → multi-progress-BaEFfHKP.d.mts} +2 -2
- package/dist/{multi-progress-Bg4ngK80.d.mts.map → multi-progress-BaEFfHKP.d.mts.map} +1 -1
- package/dist/{multi-progress-CaXTuL9G.mjs → multi-progress-zCWHEm9P.mjs} +3 -3
- package/dist/{multi-progress-CaXTuL9G.mjs.map → multi-progress-zCWHEm9P.mjs.map} +1 -1
- package/dist/{node-BiFu8I9Y.mjs → node-CJ3J_rW-.mjs} +4 -4
- package/dist/node-CJ3J_rW-.mjs.map +1 -0
- package/dist/{progress-B_UPy6zk.mjs → progress-6vJ7nxUg.mjs} +4 -4
- package/dist/{progress-B_UPy6zk.mjs.map → progress-6vJ7nxUg.mjs.map} +1 -1
- package/dist/{progress-bar-DmIMPdL0.mjs → progress-bar-BlFNsZL8.mjs} +4 -4
- package/dist/{progress-bar-DmIMPdL0.mjs.map → progress-bar-BlFNsZL8.mjs.map} +1 -1
- package/dist/{reconciler-NBDSEm8k.mjs → reconciler--_-biN23.mjs} +111 -150
- package/dist/reconciler--_-biN23.mjs.map +1 -0
- package/dist/{render-string-BntLj7Xq.mjs → render-string-DaghHpLN.mjs} +1 -1
- package/dist/{render-string-B4h4SmK7.mjs → render-string-DtHZP0cU.mjs} +15 -11
- package/dist/render-string-DtHZP0cU.mjs.map +1 -0
- package/dist/runtime.d.mts +3 -2
- package/dist/runtime.mjs +3 -2
- package/dist/{schemes-DYt2ushj.mjs → schemes-DWQPxXAi.mjs} +2 -2
- package/dist/{schemes-DYt2ushj.mjs.map → schemes-DWQPxXAi.mjs.map} +1 -1
- package/dist/{spinner-Py8_-hn9.mjs → spinner-B50hILqx.mjs} +3 -3
- package/dist/{spinner-Py8_-hn9.mjs.map → spinner-B50hILqx.mjs.map} +1 -1
- package/dist/{spinner-CLgzJ_QF.d.mts → spinner-DN10UfF0.d.mts} +2 -2
- package/dist/{spinner-CLgzJ_QF.d.mts.map → spinner-DN10UfF0.d.mts.map} +1 -1
- package/dist/{src-Oe6x5PrS.mjs → src-B8lf1kiR.mjs} +190 -83
- package/dist/src-B8lf1kiR.mjs.map +1 -0
- package/dist/{src-Dvq-s8iD.mjs → src-BOLdi3WG.mjs} +3 -3
- package/dist/{src-Dvq-s8iD.mjs.map → src-BOLdi3WG.mjs.map} +1 -1
- package/dist/{src-B9S_woYc.mjs → src-BXeTHHlL.mjs} +20289 -23262
- package/dist/src-BXeTHHlL.mjs.map +1 -0
- package/dist/{src-WeA_J4BV.mjs → src-BqeBFB3X.mjs} +90 -47
- package/dist/src-BqeBFB3X.mjs.map +1 -0
- package/dist/{src-CbhWmUnF.mjs → src-DbqcSrhy.mjs} +1400 -1427
- package/dist/src-DbqcSrhy.mjs.map +1 -0
- package/dist/{steps-DYrzCUCK.d.mts → steps-B2kBmFpb.d.mts} +1 -1
- package/dist/{steps-DYrzCUCK.d.mts.map → steps-B2kBmFpb.d.mts.map} +1 -1
- package/dist/{svg-DhxQkz-O.mjs → svg-NmV9dgB9.mjs} +1 -1
- package/dist/{svg-DhxQkz-O.mjs.map → svg-NmV9dgB9.mjs.map} +1 -1
- package/dist/{svg-Hk7lIl4F.d.mts → svg-VUr78l5d.d.mts} +1 -1
- package/dist/{svg-Hk7lIl4F.d.mts.map → svg-VUr78l5d.d.mts.map} +1 -1
- package/dist/term.d.mts +2 -2
- package/dist/term.mjs +3 -3
- package/dist/test.d.mts +673 -0
- package/dist/test.d.mts.map +1 -0
- package/dist/test.mjs +2829 -0
- package/dist/test.mjs.map +1 -0
- package/dist/theme.d.mts +2 -2
- package/dist/theme.d.mts.map +1 -1
- package/dist/theme.mjs +3 -3
- package/dist/{types-Bx-XZNbE.d.mts → types-D_E0FbqA.d.mts} +1 -1
- package/dist/{types-Bx-XZNbE.d.mts.map → types-D_E0FbqA.d.mts.map} +1 -1
- package/dist/ui/animation.d.mts +2 -2
- package/dist/ui/animation.mjs +1 -1
- package/dist/ui/ansi.d.mts +1 -1
- package/dist/ui/ansi.mjs +1 -1
- package/dist/ui/cli.d.mts +3 -3
- package/dist/ui/cli.mjs +5 -5
- package/dist/ui/image.d.mts +1 -1
- package/dist/ui/image.mjs +1 -1
- package/dist/ui/progress.d.mts +4 -4
- package/dist/ui/progress.mjs +4 -4
- package/dist/ui/react.d.mts +1 -1
- package/dist/ui/react.mjs +2 -2
- package/dist/ui/react.mjs.map +1 -1
- package/dist/ui/recording-chrome-react.d.mts +1 -1
- package/dist/ui/recording-chrome-react.mjs +2 -2
- package/dist/ui/recording-chrome.d.mts +1 -1
- package/dist/ui/recording-chrome.mjs +1 -1
- package/dist/ui/utils.mjs +1 -1
- package/dist/ui/wrappers.d.mts +2 -2
- package/dist/ui/wrappers.mjs +1 -1
- package/dist/ui.d.mts +6 -6
- package/dist/ui.mjs +7 -7
- package/dist/{ansi-OYRLxxZQ.mjs → unicode-CxyxVGmB.mjs} +7317 -6909
- package/dist/unicode-CxyxVGmB.mjs.map +1 -0
- package/dist/{useLatest-DC8i7guK.d.mts → useLatest-UOvWy0ZW.d.mts} +2 -2
- package/dist/{useLatest-DC8i7guK.d.mts.map → useLatest-UOvWy0ZW.d.mts.map} +1 -1
- package/dist/{useLayout-BKsQl2Or.mjs → useLayout-D5cE8OCI.mjs} +4 -4
- package/dist/{useLayout-BKsQl2Or.mjs.map → useLayout-D5cE8OCI.mjs.map} +1 -1
- package/dist/{with-text-input-DG4f7JII.d.mts → with-text-input-DLoSCBrm.d.mts} +3 -3
- package/dist/{with-text-input-DG4f7JII.d.mts.map → with-text-input-DLoSCBrm.d.mts.map} +1 -1
- package/dist/wrap-measurer-registration-IV2HtcCd.d.mts +3106 -0
- package/dist/wrap-measurer-registration-IV2HtcCd.d.mts.map +1 -0
- package/dist/{wrapper-D7gNSsgf.mjs → wrapper-CD29afOs.mjs} +17 -37
- package/dist/wrapper-CD29afOs.mjs.map +1 -0
- package/dist/{wrappers-CypAzrMO.mjs → wrappers-CInBJm44.mjs} +6 -6
- package/dist/{wrappers-CypAzrMO.mjs.map → wrappers-CInBJm44.mjs.map} +1 -1
- package/dist/{yoga-adapter-SsEIqMc1.mjs → yoga-adapter-9uab5Qn-.mjs} +2 -2
- package/dist/{yoga-adapter-SsEIqMc1.mjs.map → yoga-adapter-9uab5Qn-.mjs.map} +1 -1
- package/dist/yoga-adapter-yqTl1aXK.mjs +2 -0
- package/package.json +20 -15
- package/dist/Text-BRf-59j2.mjs.map +0 -1
- package/dist/ag-BeFC4S2N.mjs.map +0 -1
- package/dist/ansi-OYRLxxZQ.mjs.map +0 -1
- package/dist/bound-term-BumfuXXW.d.mts.map +0 -1
- package/dist/cli-DG6zsfsS.mjs +0 -4
- package/dist/devtools-nmPUmYU_.mjs +0 -2
- package/dist/image-1nRyKa60.mjs.map +0 -1
- package/dist/index-2E1jYgak.d.mts.map +0 -1
- package/dist/index-DnuadDNL.d.mts.map +0 -1
- package/dist/layout-signals-Dch2EiCy.mjs.map +0 -1
- package/dist/mouse-events-hnbJZRwK.mjs.map +0 -1
- package/dist/node-BiFu8I9Y.mjs.map +0 -1
- package/dist/reconciler-NBDSEm8k.mjs.map +0 -1
- package/dist/render-string-B4h4SmK7.mjs.map +0 -1
- package/dist/src-B9S_woYc.mjs.map +0 -1
- package/dist/src-CbhWmUnF.mjs.map +0 -1
- package/dist/src-Oe6x5PrS.mjs.map +0 -1
- package/dist/src-WeA_J4BV.mjs.map +0 -1
- package/dist/ui/display.d.mts +0 -35
- package/dist/ui/display.d.mts.map +0 -1
- package/dist/ui/display.mjs +0 -123
- package/dist/ui/display.mjs.map +0 -1
- package/dist/ui/input.d.mts +0 -184
- package/dist/ui/input.d.mts.map +0 -1
- package/dist/ui/input.mjs +0 -283
- package/dist/ui/input.mjs.map +0 -1
- package/dist/wrapper-D7gNSsgf.mjs.map +0 -1
- package/dist/yoga-adapter-1ex8r0ws.mjs +0 -2
|
@@ -1,11 +1,113 @@
|
|
|
1
|
-
import { m as syncTextContentSignal } from "./layout-signals-
|
|
2
|
-
import {
|
|
3
|
-
import { O as warnOnce } from "./src-
|
|
4
|
-
import { a as requireCapability, n as getConstants, r as getLayoutEngine } from "./layout-engine-
|
|
5
|
-
import { createContext } from "react";
|
|
1
|
+
import { m as syncTextContentSignal } from "./layout-signals-CGYbHmxy.mjs";
|
|
2
|
+
import { I as wrapText, i as displayWidth, l as getActiveLineHeight, v as isSoftBreakPoint } from "./unicode-CxyxVGmB.mjs";
|
|
3
|
+
import { O as warnOnce } from "./src-B8lf1kiR.mjs";
|
|
4
|
+
import { a as requireCapability, n as getConstants, r as getLayoutEngine } from "./layout-engine-BgR58vL0.mjs";
|
|
6
5
|
import { createLogger } from "loggily";
|
|
6
|
+
import { createContext } from "react";
|
|
7
7
|
import Reconciler from "react-reconciler";
|
|
8
8
|
import { DefaultEventPriority, DiscreteEventPriority, NoEventPriority } from "react-reconciler/constants.js";
|
|
9
|
+
//#region packages/ag/src/epoch.ts
|
|
10
|
+
/**
|
|
11
|
+
* The current render epoch. Incremented after each render pass.
|
|
12
|
+
* Reconciler stamps dirty nodes with this value; render phase checks equality.
|
|
13
|
+
*/
|
|
14
|
+
let renderEpoch = 0;
|
|
15
|
+
/** Get the current render epoch value. */
|
|
16
|
+
function getRenderEpoch() {
|
|
17
|
+
return renderEpoch;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Advance the render epoch. Called once at the end of each render pass.
|
|
21
|
+
* All nodes stamped with the old epoch instantly become "not dirty".
|
|
22
|
+
*/
|
|
23
|
+
function advanceRenderEpoch() {
|
|
24
|
+
renderEpoch++;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Check if an epoch stamp matches the current render epoch (i.e., "is dirty").
|
|
28
|
+
*/
|
|
29
|
+
function isCurrentEpoch(epoch) {
|
|
30
|
+
return epoch === renderEpoch;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Check if a specific dirty bit is set for the current epoch.
|
|
34
|
+
* Returns true if dirtyEpoch matches the current render epoch AND the bit is set.
|
|
35
|
+
*/
|
|
36
|
+
function isDirty(dirtyBits, dirtyEpoch, bit) {
|
|
37
|
+
return dirtyEpoch === renderEpoch && (dirtyBits & bit) !== 0;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Check if ANY dirty bit is set for the current epoch.
|
|
41
|
+
*/
|
|
42
|
+
function isAnyDirty(dirtyBits, dirtyEpoch) {
|
|
43
|
+
return dirtyEpoch === renderEpoch && dirtyBits !== 0;
|
|
44
|
+
}
|
|
45
|
+
//#endregion
|
|
46
|
+
//#region packages/ag-term/src/pipeline/collect-text.ts
|
|
47
|
+
/**
|
|
48
|
+
* Collect plain text from a node tree, applying internal_transform.
|
|
49
|
+
*
|
|
50
|
+
* This is the base traversal used by:
|
|
51
|
+
* - measure-phase.ts (fit-content measurement)
|
|
52
|
+
* - render-text.ts (DOM-level truncation budget)
|
|
53
|
+
*
|
|
54
|
+
* Does NOT filter hidden or display:none nodes — those are handled by
|
|
55
|
+
* the layout engine (display:none gets 0x0 size) or by other phases.
|
|
56
|
+
*/
|
|
57
|
+
function collectPlainText(node) {
|
|
58
|
+
if (node.textContent !== void 0) return node.textContent;
|
|
59
|
+
let result = "";
|
|
60
|
+
for (let i = 0; i < node.children.length; i++) {
|
|
61
|
+
const child = node.children[i];
|
|
62
|
+
let childText = collectPlainText(child);
|
|
63
|
+
if (childText.length > 0 && child.props.internal_transform) childText = child.props.internal_transform(childText, i);
|
|
64
|
+
result += childText;
|
|
65
|
+
}
|
|
66
|
+
return result;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Collect plain text from a node tree, skipping hidden children.
|
|
70
|
+
*
|
|
71
|
+
* Used by the reconciler's Yoga measure function where hidden nodes
|
|
72
|
+
* (from Suspense) must not contribute to measured size.
|
|
73
|
+
*
|
|
74
|
+
* Identical to collectPlainText except for the hidden check.
|
|
75
|
+
*/
|
|
76
|
+
function collectPlainTextSkipHidden(node) {
|
|
77
|
+
if (node.textContent !== void 0) return node.textContent;
|
|
78
|
+
let result = "";
|
|
79
|
+
for (let i = 0; i < node.children.length; i++) {
|
|
80
|
+
const child = node.children[i];
|
|
81
|
+
if (child.hidden) continue;
|
|
82
|
+
let childText = collectPlainTextSkipHidden(child);
|
|
83
|
+
if (childText.length > 0 && child.props.internal_transform) childText = child.props.internal_transform(childText, i);
|
|
84
|
+
result += childText;
|
|
85
|
+
}
|
|
86
|
+
return result;
|
|
87
|
+
}
|
|
88
|
+
//#endregion
|
|
89
|
+
//#region packages/ag-term/src/pipeline/measure-stats.ts
|
|
90
|
+
/**
|
|
91
|
+
* Profiling counters for measure function performance analysis (dev only).
|
|
92
|
+
*
|
|
93
|
+
* Shared between @silvery/ag-react/reconciler/nodes (where measure happens)
|
|
94
|
+
* and @silvery/ag-term/pipeline/layout-phase (where stats are logged).
|
|
95
|
+
*
|
|
96
|
+
* Lives in @silvery/ag-term to keep the @silvery/ag-term barrel React-free.
|
|
97
|
+
*/
|
|
98
|
+
const measureStats = {
|
|
99
|
+
calls: 0,
|
|
100
|
+
cacheHits: 0,
|
|
101
|
+
textCollects: 0,
|
|
102
|
+
displayWidthCalls: 0,
|
|
103
|
+
reset() {
|
|
104
|
+
this.calls = 0;
|
|
105
|
+
this.cacheHits = 0;
|
|
106
|
+
this.textCollects = 0;
|
|
107
|
+
this.displayWidthCalls = 0;
|
|
108
|
+
}
|
|
109
|
+
};
|
|
110
|
+
//#endregion
|
|
9
111
|
//#region packages/ag/src/dirty-tracking.ts
|
|
10
112
|
/**
|
|
11
113
|
* Nodes with any content/style dirty flag. Written by reconciler,
|
|
@@ -59,43 +161,6 @@ function clearDirtyTracking() {
|
|
|
59
161
|
scrollDirtyNodes.clear();
|
|
60
162
|
}
|
|
61
163
|
//#endregion
|
|
62
|
-
//#region packages/ag/src/epoch.ts
|
|
63
|
-
/**
|
|
64
|
-
* The current render epoch. Incremented after each render pass.
|
|
65
|
-
* Reconciler stamps dirty nodes with this value; render phase checks equality.
|
|
66
|
-
*/
|
|
67
|
-
let renderEpoch = 0;
|
|
68
|
-
/** Get the current render epoch value. */
|
|
69
|
-
function getRenderEpoch() {
|
|
70
|
-
return renderEpoch;
|
|
71
|
-
}
|
|
72
|
-
/**
|
|
73
|
-
* Advance the render epoch. Called once at the end of each render pass.
|
|
74
|
-
* All nodes stamped with the old epoch instantly become "not dirty".
|
|
75
|
-
*/
|
|
76
|
-
function advanceRenderEpoch() {
|
|
77
|
-
renderEpoch++;
|
|
78
|
-
}
|
|
79
|
-
/**
|
|
80
|
-
* Check if an epoch stamp matches the current render epoch (i.e., "is dirty").
|
|
81
|
-
*/
|
|
82
|
-
function isCurrentEpoch(epoch) {
|
|
83
|
-
return epoch === renderEpoch;
|
|
84
|
-
}
|
|
85
|
-
/**
|
|
86
|
-
* Check if a specific dirty bit is set for the current epoch.
|
|
87
|
-
* Returns true if dirtyEpoch matches the current render epoch AND the bit is set.
|
|
88
|
-
*/
|
|
89
|
-
function isDirty(dirtyBits, dirtyEpoch, bit) {
|
|
90
|
-
return dirtyEpoch === renderEpoch && (dirtyBits & bit) !== 0;
|
|
91
|
-
}
|
|
92
|
-
/**
|
|
93
|
-
* Check if ANY dirty bit is set for the current epoch.
|
|
94
|
-
*/
|
|
95
|
-
function isAnyDirty(dirtyBits, dirtyEpoch) {
|
|
96
|
-
return dirtyEpoch === renderEpoch && dirtyBits !== 0;
|
|
97
|
-
}
|
|
98
|
-
//#endregion
|
|
99
164
|
//#region packages/scope/src/trace.ts
|
|
100
165
|
/**
|
|
101
166
|
* @silvery/scope/trace — opt-in leak detector for scopes and disposables.
|
|
@@ -220,18 +285,7 @@ function isBrandedHandle(value) {
|
|
|
220
285
|
function defineHandle(kind) {
|
|
221
286
|
Symbol(`silvery.handle:${kind}`);
|
|
222
287
|
return {
|
|
223
|
-
/** Diagnostic label for this handle kind. */
|
|
224
288
|
kind,
|
|
225
|
-
/**
|
|
226
|
-
* Create an opaque, frozen handle that wraps `value` with `dispose`
|
|
227
|
-
* cleanup. The returned value is registered in the module-private
|
|
228
|
-
* `branded` WeakSet so the library can authenticate it later.
|
|
229
|
-
*
|
|
230
|
-
* The handle is `Object.freeze`d before return so callers cannot
|
|
231
|
-
* overwrite `[Symbol.asyncDispose]`, `[Symbol.dispose]`, or any
|
|
232
|
-
* surface property the consuming factory adds via `Object.assign`.
|
|
233
|
-
* Add public surface BEFORE returning from your factory.
|
|
234
|
-
*/
|
|
235
289
|
create(_value, dispose) {
|
|
236
290
|
const handle = Object.create(null);
|
|
237
291
|
let _disposed = false;
|
|
@@ -612,71 +666,6 @@ function reportDisposeError(error, context) {
|
|
|
612
666
|
} catch {}
|
|
613
667
|
}
|
|
614
668
|
//#endregion
|
|
615
|
-
//#region packages/ag-term/src/pipeline/collect-text.ts
|
|
616
|
-
/**
|
|
617
|
-
* Collect plain text from a node tree, applying internal_transform.
|
|
618
|
-
*
|
|
619
|
-
* This is the base traversal used by:
|
|
620
|
-
* - measure-phase.ts (fit-content measurement)
|
|
621
|
-
* - render-text.ts (DOM-level truncation budget)
|
|
622
|
-
*
|
|
623
|
-
* Does NOT filter hidden or display:none nodes — those are handled by
|
|
624
|
-
* the layout engine (display:none gets 0x0 size) or by other phases.
|
|
625
|
-
*/
|
|
626
|
-
function collectPlainText(node) {
|
|
627
|
-
if (node.textContent !== void 0) return node.textContent;
|
|
628
|
-
let result = "";
|
|
629
|
-
for (let i = 0; i < node.children.length; i++) {
|
|
630
|
-
const child = node.children[i];
|
|
631
|
-
let childText = collectPlainText(child);
|
|
632
|
-
if (childText.length > 0 && child.props.internal_transform) childText = child.props.internal_transform(childText, i);
|
|
633
|
-
result += childText;
|
|
634
|
-
}
|
|
635
|
-
return result;
|
|
636
|
-
}
|
|
637
|
-
/**
|
|
638
|
-
* Collect plain text from a node tree, skipping hidden children.
|
|
639
|
-
*
|
|
640
|
-
* Used by the reconciler's Yoga measure function where hidden nodes
|
|
641
|
-
* (from Suspense) must not contribute to measured size.
|
|
642
|
-
*
|
|
643
|
-
* Identical to collectPlainText except for the hidden check.
|
|
644
|
-
*/
|
|
645
|
-
function collectPlainTextSkipHidden(node) {
|
|
646
|
-
if (node.textContent !== void 0) return node.textContent;
|
|
647
|
-
let result = "";
|
|
648
|
-
for (let i = 0; i < node.children.length; i++) {
|
|
649
|
-
const child = node.children[i];
|
|
650
|
-
if (child.hidden) continue;
|
|
651
|
-
let childText = collectPlainTextSkipHidden(child);
|
|
652
|
-
if (childText.length > 0 && child.props.internal_transform) childText = child.props.internal_transform(childText, i);
|
|
653
|
-
result += childText;
|
|
654
|
-
}
|
|
655
|
-
return result;
|
|
656
|
-
}
|
|
657
|
-
//#endregion
|
|
658
|
-
//#region packages/ag-term/src/pipeline/measure-stats.ts
|
|
659
|
-
/**
|
|
660
|
-
* Profiling counters for measure function performance analysis (dev only).
|
|
661
|
-
*
|
|
662
|
-
* Shared between @silvery/ag-react/reconciler/nodes (where measure happens)
|
|
663
|
-
* and @silvery/ag-term/pipeline/layout-phase (where stats are logged).
|
|
664
|
-
*
|
|
665
|
-
* Lives in @silvery/ag-term to keep the @silvery/ag-term barrel React-free.
|
|
666
|
-
*/
|
|
667
|
-
const measureStats = {
|
|
668
|
-
calls: 0,
|
|
669
|
-
cacheHits: 0,
|
|
670
|
-
textCollects: 0,
|
|
671
|
-
displayWidthCalls: 0,
|
|
672
|
-
reset() {
|
|
673
|
-
this.calls = 0;
|
|
674
|
-
this.cacheHits = 0;
|
|
675
|
-
this.textCollects = 0;
|
|
676
|
-
this.displayWidthCalls = 0;
|
|
677
|
-
}
|
|
678
|
-
};
|
|
679
|
-
//#endregion
|
|
680
669
|
//#region packages/ag-react/src/reconciler/helpers.ts
|
|
681
670
|
/**
|
|
682
671
|
* Reconciler Helper Functions
|
|
@@ -762,6 +751,7 @@ const STYLE_PROPS = new Set([
|
|
|
762
751
|
"truncateMarkerColor",
|
|
763
752
|
"backgroundColor",
|
|
764
753
|
"bold",
|
|
754
|
+
"internal_dim",
|
|
765
755
|
"italic",
|
|
766
756
|
"underline",
|
|
767
757
|
"underlineStyle",
|
|
@@ -1963,15 +1953,6 @@ const hostConfig = {
|
|
|
1963
1953
|
waitForCommitToBeReady() {
|
|
1964
1954
|
return null;
|
|
1965
1955
|
},
|
|
1966
|
-
/**
|
|
1967
|
-
* Hide an instance during Suspense.
|
|
1968
|
-
* Called when React needs to hide content while showing a fallback.
|
|
1969
|
-
*
|
|
1970
|
-
* Must set stylePropsDirty (render phase fast-path skip includes stylePropsDirty check),
|
|
1971
|
-
* layoutNode.markDirty() (hiding changes measured content — the layout engine
|
|
1972
|
-
* must recalculate dimensions), and markLayoutAncestorDirty (virtual text nodes
|
|
1973
|
-
* without layoutNode need the nearest layout ancestor dirty).
|
|
1974
|
-
*/
|
|
1975
1956
|
hideInstance(instance) {
|
|
1976
1957
|
instance.hidden = true;
|
|
1977
1958
|
const epoch = getRenderEpoch();
|
|
@@ -1990,13 +1971,6 @@ const hostConfig = {
|
|
|
1990
1971
|
markLayoutAncestorDirty(instance);
|
|
1991
1972
|
markSubtreeDirty(instance);
|
|
1992
1973
|
},
|
|
1993
|
-
/**
|
|
1994
|
-
* Unhide an instance after Suspense resolves.
|
|
1995
|
-
* Called when the suspended content is ready to show.
|
|
1996
|
-
*
|
|
1997
|
-
* Same invalidation as hideInstance — the node's visibility change affects
|
|
1998
|
-
* layout (measured content changes) and paint (content must be re-rendered).
|
|
1999
|
-
*/
|
|
2000
1974
|
unhideInstance(instance, _props) {
|
|
2001
1975
|
instance.hidden = false;
|
|
2002
1976
|
const epoch = getRenderEpoch();
|
|
@@ -2015,13 +1989,6 @@ const hostConfig = {
|
|
|
2015
1989
|
markLayoutAncestorDirty(instance);
|
|
2016
1990
|
markSubtreeDirty(instance);
|
|
2017
1991
|
},
|
|
2018
|
-
/**
|
|
2019
|
-
* Hide a text instance during Suspense.
|
|
2020
|
-
*
|
|
2021
|
-
* Text instances don't have layout nodes. markLayoutAncestorDirty walks up
|
|
2022
|
-
* to the nearest layout ancestor and marks it dirty so the measure function
|
|
2023
|
-
* re-collects descendant text (collectNodeTextContent skips hidden children).
|
|
2024
|
-
*/
|
|
2025
1992
|
hideTextInstance(textInstance) {
|
|
2026
1993
|
textInstance.hidden = true;
|
|
2027
1994
|
const epoch = getRenderEpoch();
|
|
@@ -2039,12 +2006,6 @@ const hostConfig = {
|
|
|
2039
2006
|
markLayoutAncestorDirty(textInstance);
|
|
2040
2007
|
markSubtreeDirty(textInstance);
|
|
2041
2008
|
},
|
|
2042
|
-
/**
|
|
2043
|
-
* Unhide a text instance after Suspense resolves.
|
|
2044
|
-
*
|
|
2045
|
-
* Same invalidation as hideTextInstance — the text content changes when
|
|
2046
|
-
* hidden children become visible again.
|
|
2047
|
-
*/
|
|
2048
2009
|
unhideTextInstance(textInstance, _text) {
|
|
2049
2010
|
textInstance.hidden = false;
|
|
2050
2011
|
const epoch = getRenderEpoch();
|
|
@@ -2118,7 +2079,7 @@ function getContainerRoot(container) {
|
|
|
2118
2079
|
* 1. `createFiberRoot` uses `ConcurrentRoot` (mode 1). React's async
|
|
2119
2080
|
* `updateContainer(null, fiberRoot, ...)` does NOT run layout-effect
|
|
2120
2081
|
* cleanups before returning — useLayoutEffect / useBoxRect /
|
|
2121
|
-
*
|
|
2082
|
+
* signal-effect disposers are scheduled but may not
|
|
2122
2083
|
* fire promptly. That keeps signal subscriptions alive past unmount,
|
|
2123
2084
|
* which keeps the React tree reachable, which keeps the host
|
|
2124
2085
|
* `RenderInstance` reachable. `updateContainerSync` + `flushSyncWork`
|
|
@@ -2173,6 +2134,6 @@ function releaseContainer(container) {
|
|
|
2173
2134
|
}
|
|
2174
2135
|
}
|
|
2175
2136
|
//#endregion
|
|
2176
|
-
export {
|
|
2137
|
+
export { isDirty as C, isCurrentEpoch as S, measureStats as _, releaseContainer as a, getRenderEpoch as b, runWithDiscreteEvent as c, reportDisposeError as d, defineHandle as f, trackContentDirty as g, hasScrollDirty as h, reconciler as i, setContainerNodeLifecycle as l, clearDirtyTracking as m, createFiberRoot as n, unmountFiberRoot as o, finaliseHandle as p, getContainerRoot as r, hostConfig as s, createContainer as t, createScope as u, collectPlainText as v, isAnyDirty as x, advanceRenderEpoch as y };
|
|
2177
2138
|
|
|
2178
|
-
//# sourceMappingURL=reconciler-
|
|
2139
|
+
//# sourceMappingURL=reconciler--_-biN23.mjs.map
|