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.
Files changed (171) hide show
  1. package/dist/{Text-BRf-59j2.mjs → Text-Ci6UCSTL.mjs} +46 -46
  2. package/dist/Text-Ci6UCSTL.mjs.map +1 -0
  3. package/dist/{ag-BeFC4S2N.mjs → ag-q9lRlKlt.mjs} +42 -19
  4. package/dist/ag-q9lRlKlt.mjs.map +1 -0
  5. package/dist/{animation-N8MFybTk.mjs → animation-CZ4x2R7C.mjs} +1 -1
  6. package/dist/{animation-N8MFybTk.mjs.map → animation-CZ4x2R7C.mjs.map} +1 -1
  7. package/dist/{ansi-C6Qs1Wn2.mjs → ansi-CLmIMnop.mjs} +1 -1
  8. package/dist/{ansi-C6Qs1Wn2.mjs.map → ansi-CLmIMnop.mjs.map} +1 -1
  9. package/dist/{ansi-CBkam1ty.d.mts → ansi-zmNzgkPB.d.mts} +1 -1
  10. package/dist/{ansi-CBkam1ty.d.mts.map → ansi-zmNzgkPB.d.mts.map} +1 -1
  11. package/dist/backend-DSiSIc-h.mjs +13396 -0
  12. package/dist/backend-DSiSIc-h.mjs.map +1 -0
  13. package/dist/chain-bridge-CkYcMxlq.mjs +4149 -0
  14. package/dist/chain-bridge-CkYcMxlq.mjs.map +1 -0
  15. package/dist/{chunk-hT5z_Zn9.mjs → chunk-BEJ448es.mjs} +1 -1
  16. package/dist/cli-VNqUKlXw.mjs +4 -0
  17. package/dist/{context-BU5LkkIy.mjs → context-CEhuD1R_.mjs} +1 -1
  18. package/dist/{context-BU5LkkIy.mjs.map → context-CEhuD1R_.mjs.map} +1 -1
  19. package/dist/devtools-BF4IMumr.mjs +2 -0
  20. package/dist/{devtools-9zfhpFyG.mjs → devtools-td2AjFwc.mjs} +5 -4
  21. package/dist/{devtools-9zfhpFyG.mjs.map → devtools-td2AjFwc.mjs.map} +1 -1
  22. package/dist/{easing-B0oZKDki.d.mts → easing-C5MrdO7V.d.mts} +1 -1
  23. package/dist/{easing-B0oZKDki.d.mts.map → easing-C5MrdO7V.d.mts.map} +1 -1
  24. package/dist/{eta-DGOuC8yU.mjs → eta-BwYWEjfS.mjs} +1 -5
  25. package/dist/{eta-DGOuC8yU.mjs.map → eta-BwYWEjfS.mjs.map} +1 -1
  26. package/dist/{flexily-zero-adapter-D6hcFgrH.mjs → flexily-zero-adapter-DktX3HsX.mjs} +1 -1
  27. package/dist/{flexily-zero-adapter-CEJOcbNp.mjs → flexily-zero-adapter-VoBGHG14.mjs} +1 -1
  28. package/dist/{flexily-zero-adapter-CEJOcbNp.mjs.map → flexily-zero-adapter-VoBGHG14.mjs.map} +1 -1
  29. package/dist/hit-registry-D_nxOivS.d.mts +71 -0
  30. package/dist/hit-registry-D_nxOivS.d.mts.map +1 -0
  31. package/dist/{image-1nRyKa60.mjs → image-CIF75xMr.mjs} +24 -24
  32. package/dist/image-CIF75xMr.mjs.map +1 -0
  33. package/dist/{index-2E1jYgak.d.mts → index-377zdPLP.d.mts} +35 -12
  34. package/dist/index-377zdPLP.d.mts.map +1 -0
  35. package/dist/{index-DnuadDNL.d.mts → index-BcSr0RAQ.d.mts} +8590 -11173
  36. package/dist/index-BcSr0RAQ.d.mts.map +1 -0
  37. package/dist/{index-Dg1YaeJb.d.mts → index-DLnpxDAm.d.mts} +2 -2
  38. package/dist/{index-Dg1YaeJb.d.mts.map → index-DLnpxDAm.d.mts.map} +1 -1
  39. package/dist/{index-Bi4Jdz5g.d.mts → index-DlNmckTq.d.mts} +2 -2
  40. package/dist/{index-Bi4Jdz5g.d.mts.map → index-DlNmckTq.d.mts.map} +1 -1
  41. package/dist/index.d.mts +12 -8
  42. package/dist/index.d.mts.map +1 -1
  43. package/dist/index.mjs +18 -17
  44. package/dist/index.mjs.map +1 -1
  45. package/dist/{layout-engine-Ca_nbtfL.mjs → layout-engine-BgR58vL0.mjs} +3 -3
  46. package/dist/{layout-engine-Ca_nbtfL.mjs.map → layout-engine-BgR58vL0.mjs.map} +1 -1
  47. package/dist/{layout-engine-CgsoBRIn.mjs → layout-engine-DNjTha8f.mjs} +1 -1
  48. package/dist/{layout-signals-Dch2EiCy.mjs → layout-signals-CGYbHmxy.mjs} +2 -2
  49. package/dist/layout-signals-CGYbHmxy.mjs.map +1 -0
  50. package/dist/{bound-term-BumfuXXW.d.mts → mouse-events-B2z5tbsL.d.mts} +540 -401
  51. package/dist/mouse-events-B2z5tbsL.d.mts.map +1 -0
  52. package/dist/{mouse-events-hnbJZRwK.mjs → mouse-events-WQ2h-uqG.mjs} +14 -6
  53. package/dist/mouse-events-WQ2h-uqG.mjs.map +1 -0
  54. package/dist/{multi-progress-Bg4ngK80.d.mts → multi-progress-BaEFfHKP.d.mts} +2 -2
  55. package/dist/{multi-progress-Bg4ngK80.d.mts.map → multi-progress-BaEFfHKP.d.mts.map} +1 -1
  56. package/dist/{multi-progress-CaXTuL9G.mjs → multi-progress-zCWHEm9P.mjs} +3 -3
  57. package/dist/{multi-progress-CaXTuL9G.mjs.map → multi-progress-zCWHEm9P.mjs.map} +1 -1
  58. package/dist/{node-BiFu8I9Y.mjs → node-CJ3J_rW-.mjs} +4 -4
  59. package/dist/node-CJ3J_rW-.mjs.map +1 -0
  60. package/dist/{progress-B_UPy6zk.mjs → progress-6vJ7nxUg.mjs} +4 -4
  61. package/dist/{progress-B_UPy6zk.mjs.map → progress-6vJ7nxUg.mjs.map} +1 -1
  62. package/dist/{progress-bar-DmIMPdL0.mjs → progress-bar-BlFNsZL8.mjs} +4 -4
  63. package/dist/{progress-bar-DmIMPdL0.mjs.map → progress-bar-BlFNsZL8.mjs.map} +1 -1
  64. package/dist/{reconciler-NBDSEm8k.mjs → reconciler--_-biN23.mjs} +111 -150
  65. package/dist/reconciler--_-biN23.mjs.map +1 -0
  66. package/dist/{render-string-BntLj7Xq.mjs → render-string-DaghHpLN.mjs} +1 -1
  67. package/dist/{render-string-B4h4SmK7.mjs → render-string-DtHZP0cU.mjs} +15 -11
  68. package/dist/render-string-DtHZP0cU.mjs.map +1 -0
  69. package/dist/runtime.d.mts +3 -2
  70. package/dist/runtime.mjs +3 -2
  71. package/dist/{schemes-DYt2ushj.mjs → schemes-DWQPxXAi.mjs} +2 -2
  72. package/dist/{schemes-DYt2ushj.mjs.map → schemes-DWQPxXAi.mjs.map} +1 -1
  73. package/dist/{spinner-Py8_-hn9.mjs → spinner-B50hILqx.mjs} +3 -3
  74. package/dist/{spinner-Py8_-hn9.mjs.map → spinner-B50hILqx.mjs.map} +1 -1
  75. package/dist/{spinner-CLgzJ_QF.d.mts → spinner-DN10UfF0.d.mts} +2 -2
  76. package/dist/{spinner-CLgzJ_QF.d.mts.map → spinner-DN10UfF0.d.mts.map} +1 -1
  77. package/dist/{src-Oe6x5PrS.mjs → src-B8lf1kiR.mjs} +190 -83
  78. package/dist/src-B8lf1kiR.mjs.map +1 -0
  79. package/dist/{src-Dvq-s8iD.mjs → src-BOLdi3WG.mjs} +3 -3
  80. package/dist/{src-Dvq-s8iD.mjs.map → src-BOLdi3WG.mjs.map} +1 -1
  81. package/dist/{src-B9S_woYc.mjs → src-BXeTHHlL.mjs} +20289 -23262
  82. package/dist/src-BXeTHHlL.mjs.map +1 -0
  83. package/dist/{src-WeA_J4BV.mjs → src-BqeBFB3X.mjs} +90 -47
  84. package/dist/src-BqeBFB3X.mjs.map +1 -0
  85. package/dist/{src-CbhWmUnF.mjs → src-DbqcSrhy.mjs} +1400 -1427
  86. package/dist/src-DbqcSrhy.mjs.map +1 -0
  87. package/dist/{steps-DYrzCUCK.d.mts → steps-B2kBmFpb.d.mts} +1 -1
  88. package/dist/{steps-DYrzCUCK.d.mts.map → steps-B2kBmFpb.d.mts.map} +1 -1
  89. package/dist/{svg-DhxQkz-O.mjs → svg-NmV9dgB9.mjs} +1 -1
  90. package/dist/{svg-DhxQkz-O.mjs.map → svg-NmV9dgB9.mjs.map} +1 -1
  91. package/dist/{svg-Hk7lIl4F.d.mts → svg-VUr78l5d.d.mts} +1 -1
  92. package/dist/{svg-Hk7lIl4F.d.mts.map → svg-VUr78l5d.d.mts.map} +1 -1
  93. package/dist/term.d.mts +2 -2
  94. package/dist/term.mjs +3 -3
  95. package/dist/test.d.mts +673 -0
  96. package/dist/test.d.mts.map +1 -0
  97. package/dist/test.mjs +2829 -0
  98. package/dist/test.mjs.map +1 -0
  99. package/dist/theme.d.mts +2 -2
  100. package/dist/theme.d.mts.map +1 -1
  101. package/dist/theme.mjs +3 -3
  102. package/dist/{types-Bx-XZNbE.d.mts → types-D_E0FbqA.d.mts} +1 -1
  103. package/dist/{types-Bx-XZNbE.d.mts.map → types-D_E0FbqA.d.mts.map} +1 -1
  104. package/dist/ui/animation.d.mts +2 -2
  105. package/dist/ui/animation.mjs +1 -1
  106. package/dist/ui/ansi.d.mts +1 -1
  107. package/dist/ui/ansi.mjs +1 -1
  108. package/dist/ui/cli.d.mts +3 -3
  109. package/dist/ui/cli.mjs +5 -5
  110. package/dist/ui/image.d.mts +1 -1
  111. package/dist/ui/image.mjs +1 -1
  112. package/dist/ui/progress.d.mts +4 -4
  113. package/dist/ui/progress.mjs +4 -4
  114. package/dist/ui/react.d.mts +1 -1
  115. package/dist/ui/react.mjs +2 -2
  116. package/dist/ui/react.mjs.map +1 -1
  117. package/dist/ui/recording-chrome-react.d.mts +1 -1
  118. package/dist/ui/recording-chrome-react.mjs +2 -2
  119. package/dist/ui/recording-chrome.d.mts +1 -1
  120. package/dist/ui/recording-chrome.mjs +1 -1
  121. package/dist/ui/utils.mjs +1 -1
  122. package/dist/ui/wrappers.d.mts +2 -2
  123. package/dist/ui/wrappers.mjs +1 -1
  124. package/dist/ui.d.mts +6 -6
  125. package/dist/ui.mjs +7 -7
  126. package/dist/{ansi-OYRLxxZQ.mjs → unicode-CxyxVGmB.mjs} +7317 -6909
  127. package/dist/unicode-CxyxVGmB.mjs.map +1 -0
  128. package/dist/{useLatest-DC8i7guK.d.mts → useLatest-UOvWy0ZW.d.mts} +2 -2
  129. package/dist/{useLatest-DC8i7guK.d.mts.map → useLatest-UOvWy0ZW.d.mts.map} +1 -1
  130. package/dist/{useLayout-BKsQl2Or.mjs → useLayout-D5cE8OCI.mjs} +4 -4
  131. package/dist/{useLayout-BKsQl2Or.mjs.map → useLayout-D5cE8OCI.mjs.map} +1 -1
  132. package/dist/{with-text-input-DG4f7JII.d.mts → with-text-input-DLoSCBrm.d.mts} +3 -3
  133. package/dist/{with-text-input-DG4f7JII.d.mts.map → with-text-input-DLoSCBrm.d.mts.map} +1 -1
  134. package/dist/wrap-measurer-registration-IV2HtcCd.d.mts +3106 -0
  135. package/dist/wrap-measurer-registration-IV2HtcCd.d.mts.map +1 -0
  136. package/dist/{wrapper-D7gNSsgf.mjs → wrapper-CD29afOs.mjs} +17 -37
  137. package/dist/wrapper-CD29afOs.mjs.map +1 -0
  138. package/dist/{wrappers-CypAzrMO.mjs → wrappers-CInBJm44.mjs} +6 -6
  139. package/dist/{wrappers-CypAzrMO.mjs.map → wrappers-CInBJm44.mjs.map} +1 -1
  140. package/dist/{yoga-adapter-SsEIqMc1.mjs → yoga-adapter-9uab5Qn-.mjs} +2 -2
  141. package/dist/{yoga-adapter-SsEIqMc1.mjs.map → yoga-adapter-9uab5Qn-.mjs.map} +1 -1
  142. package/dist/yoga-adapter-yqTl1aXK.mjs +2 -0
  143. package/package.json +20 -15
  144. package/dist/Text-BRf-59j2.mjs.map +0 -1
  145. package/dist/ag-BeFC4S2N.mjs.map +0 -1
  146. package/dist/ansi-OYRLxxZQ.mjs.map +0 -1
  147. package/dist/bound-term-BumfuXXW.d.mts.map +0 -1
  148. package/dist/cli-DG6zsfsS.mjs +0 -4
  149. package/dist/devtools-nmPUmYU_.mjs +0 -2
  150. package/dist/image-1nRyKa60.mjs.map +0 -1
  151. package/dist/index-2E1jYgak.d.mts.map +0 -1
  152. package/dist/index-DnuadDNL.d.mts.map +0 -1
  153. package/dist/layout-signals-Dch2EiCy.mjs.map +0 -1
  154. package/dist/mouse-events-hnbJZRwK.mjs.map +0 -1
  155. package/dist/node-BiFu8I9Y.mjs.map +0 -1
  156. package/dist/reconciler-NBDSEm8k.mjs.map +0 -1
  157. package/dist/render-string-B4h4SmK7.mjs.map +0 -1
  158. package/dist/src-B9S_woYc.mjs.map +0 -1
  159. package/dist/src-CbhWmUnF.mjs.map +0 -1
  160. package/dist/src-Oe6x5PrS.mjs.map +0 -1
  161. package/dist/src-WeA_J4BV.mjs.map +0 -1
  162. package/dist/ui/display.d.mts +0 -35
  163. package/dist/ui/display.d.mts.map +0 -1
  164. package/dist/ui/display.mjs +0 -123
  165. package/dist/ui/display.mjs.map +0 -1
  166. package/dist/ui/input.d.mts +0 -184
  167. package/dist/ui/input.d.mts.map +0 -1
  168. package/dist/ui/input.mjs +0 -283
  169. package/dist/ui/input.mjs.map +0 -1
  170. package/dist/wrapper-D7gNSsgf.mjs.map +0 -1
  171. package/dist/yoga-adapter-1ex8r0ws.mjs +0 -2
@@ -1,10 +1,49 @@
1
- import { r as effect } from "./src-WeA_J4BV.mjs";
2
- import { a as NodeContext } from "./context-BU5LkkIy.mjs";
3
- import { o as getLayoutSignals, u as observeLayoutSignal } from "./layout-signals-Dch2EiCy.mjs";
4
- import { o as KNOWN_VARIANTS } from "./src-Oe6x5PrS.mjs";
5
- import { a as defaultDarkTheme } from "./schemes-DYt2ushj.mjs";
1
+ import { r as effect } from "./src-BqeBFB3X.mjs";
2
+ import { o as getLayoutSignals, u as observeLayoutSignal } from "./layout-signals-CGYbHmxy.mjs";
3
+ import { a as KNOWN_VARIANTS } from "./src-B8lf1kiR.mjs";
4
+ import { a as defaultDarkTheme } from "./schemes-DWQPxXAi.mjs";
5
+ import { a as NodeContext } from "./context-CEhuD1R_.mjs";
6
6
  import { createContext, forwardRef, useContext, useImperativeHandle, useLayoutEffect, useRef, useState } from "react";
7
7
  import { jsx } from "react/jsx-runtime";
8
+ //#region packages/ag-react/src/ThemeContext.tsx
9
+ /**
10
+ * ThemeContext — delivers a Theme to the component tree.
11
+ *
12
+ * Wrap your app (or a subtree) in `<ThemeProvider theme={…}>` to make
13
+ * `$token` color props resolve against that theme. Components call
14
+ * `useTheme()` to read the current theme.
15
+ *
16
+ * @example
17
+ * ```tsx
18
+ * import { ThemeProvider, defaultDarkTheme } from '@silvery/ag-react'
19
+ *
20
+ * <ThemeProvider theme={defaultDarkTheme}>
21
+ * <App />
22
+ * </ThemeProvider>
23
+ * ```
24
+ */
25
+ /** @internal Exported for ThemeProvider and Text component — not public API. */
26
+ const ThemeContext = createContext(defaultDarkTheme);
27
+ /**
28
+ * Context that carries scheme detection metadata (name, source, confidence).
29
+ *
30
+ * Separate from ThemeContext because scheme metadata is orthogonal to the
31
+ * theme token bag. Populated by `<ThemeProvider scheme={...}>` when the
32
+ * caller passes detection provenance (e.g. from `runThemed`). Null when
33
+ * no scheme metadata was injected.
34
+ *
35
+ * @internal Exported for ThemeProvider.
36
+ */
37
+ const ActiveSchemeContext = createContext(null);
38
+ /**
39
+ * Read the current theme from context.
40
+ *
41
+ * Returns `defaultDarkTheme` when no `ThemeProvider` is present.
42
+ */
43
+ function useTheme() {
44
+ return useContext(ThemeContext);
45
+ }
46
+ //#endregion
8
47
  //#region packages/ag-react/src/components/Box.tsx
9
48
  /**
10
49
  * Silvery Box Component
@@ -98,45 +137,6 @@ const Box = forwardRef(function Box(props, ref) {
98
137
  });
99
138
  });
100
139
  //#endregion
101
- //#region packages/ag-react/src/ThemeContext.tsx
102
- /**
103
- * ThemeContext — delivers a Theme to the component tree.
104
- *
105
- * Wrap your app (or a subtree) in `<ThemeProvider theme={…}>` to make
106
- * `$token` color props resolve against that theme. Components call
107
- * `useTheme()` to read the current theme.
108
- *
109
- * @example
110
- * ```tsx
111
- * import { ThemeProvider, defaultDarkTheme } from '@silvery/ag-react'
112
- *
113
- * <ThemeProvider theme={defaultDarkTheme}>
114
- * <App />
115
- * </ThemeProvider>
116
- * ```
117
- */
118
- /** @internal Exported for ThemeProvider and Text component — not public API. */
119
- const ThemeContext = createContext(defaultDarkTheme);
120
- /**
121
- * Context that carries scheme detection metadata (name, source, confidence).
122
- *
123
- * Separate from ThemeContext because scheme metadata is orthogonal to the
124
- * theme token bag. Populated by `<ThemeProvider scheme={...}>` when the
125
- * caller passes detection provenance (e.g. from `runThemed`). Null when
126
- * no scheme metadata was injected.
127
- *
128
- * @internal Exported for ThemeProvider.
129
- */
130
- const ActiveSchemeContext = createContext(null);
131
- /**
132
- * Read the current theme from context.
133
- *
134
- * Returns `defaultDarkTheme` when no `ThemeProvider` is present.
135
- */
136
- function useTheme() {
137
- return useContext(ThemeContext);
138
- }
139
- //#endregion
140
140
  //#region packages/ag-react/src/components/Text.tsx
141
141
  /**
142
142
  * Silvery Text Component
@@ -232,6 +232,6 @@ const Text = forwardRef(function Text(props, ref) {
232
232
  });
233
233
  });
234
234
  //#endregion
235
- export { Box as a, useTheme as i, ActiveSchemeContext as n, ThemeContext as r, Text as t };
235
+ export { useTheme as a, ThemeContext as i, Box as n, ActiveSchemeContext as r, Text as t };
236
236
 
237
- //# sourceMappingURL=Text-BRf-59j2.mjs.map
237
+ //# sourceMappingURL=Text-Ci6UCSTL.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Text-Ci6UCSTL.mjs","names":["signalEffect"],"sources":["../packages/ag-react/src/ThemeContext.tsx","../packages/ag-react/src/components/Box.tsx","../packages/ag-react/src/components/Text.tsx"],"sourcesContent":["/**\n * ThemeContext — delivers a Theme to the component tree.\n *\n * Wrap your app (or a subtree) in `<ThemeProvider theme={…}>` to make\n * `$token` color props resolve against that theme. Components call\n * `useTheme()` to read the current theme.\n *\n * @example\n * ```tsx\n * import { ThemeProvider, defaultDarkTheme } from '@silvery/ag-react'\n *\n * <ThemeProvider theme={defaultDarkTheme}>\n * <App />\n * </ThemeProvider>\n * ```\n */\n\nimport { createContext, useContext } from \"react\"\nimport type { Theme, ActiveScheme } from \"@silvery/ansi\"\nimport { defaultDarkTheme } from \"@silvery/theme/schemes\"\n\n// ============================================================================\n// Context\n// ============================================================================\n\n/** @internal Exported for ThemeProvider and Text component — not public API. */\nexport const ThemeContext = createContext<Theme>(defaultDarkTheme)\n\n/**\n * Context that carries scheme detection metadata (name, source, confidence).\n *\n * Separate from ThemeContext because scheme metadata is orthogonal to the\n * theme token bag. Populated by `<ThemeProvider scheme={...}>` when the\n * caller passes detection provenance (e.g. from `runThemed`). Null when\n * no scheme metadata was injected.\n *\n * @internal Exported for ThemeProvider.\n */\nexport const ActiveSchemeContext = createContext<ActiveScheme | null>(null)\n\n// ============================================================================\n// Hook\n// ============================================================================\n\n/**\n * Read the current theme from context.\n *\n * Returns `defaultDarkTheme` when no `ThemeProvider` is present.\n */\nexport function useTheme(): Theme {\n return useContext(ThemeContext)\n}\n","/**\n * Silvery Box Component\n *\n * The primary layout primitive for Silvery. Box is a flexbox container that can hold\n * other Box or Text components. It supports all standard flexbox properties,\n * dimensions, spacing, and borders.\n *\n * Box renders to an 'silvery-box' host element that the reconciler converts to an\n * SilveryNode with an associated Yoga layout node.\n *\n * Box provides NodeContext to its children, enabling useBoxRect/useScrollRect hooks.\n * It also supports forwardRef for imperative access and onLayout for layout callbacks.\n */\n\nimport {\n type ForwardedRef,\n type JSX,\n type ReactNode,\n forwardRef,\n useImperativeHandle,\n useLayoutEffect,\n useRef,\n useState,\n} from \"react\"\nimport { effect as signalEffect } from \"@silvery/signals\"\nimport { NodeContext } from \"../context\"\nimport { getLayoutSignals, observeLayoutSignal } from \"@silvery/ag/layout-signals\"\nimport type { BoxProps as BoxPropsType, AgNode, Rect } from \"@silvery/ag/types\"\n\n// ============================================================================\n// Props\n// ============================================================================\n\nexport interface BoxProps extends BoxPropsType {\n /** Child elements */\n children?: ReactNode\n}\n\n/**\n * Methods exposed via ref on Box component.\n */\nexport interface BoxHandle {\n /** Get the underlying SilveryNode */\n getNode(): AgNode | null\n /** Get the current content-relative layout rect */\n getBoxRect(): Rect | null\n /** Get the current screen-relative layout rect */\n getScrollRect(): Rect | null\n}\n\n// ============================================================================\n// Component\n// ============================================================================\n\n/**\n * Flexbox container component for terminal UIs.\n *\n * Provides NodeContext to children, enabling useBoxRect/useScrollRect hooks.\n * Supports forwardRef for imperative access and onLayout for layout callbacks.\n *\n * @example\n * ```tsx\n * // Basic vertical layout (default)\n * <Box>\n * <Text>Line 1</Text>\n * <Text>Line 2</Text>\n * </Box>\n *\n * // Horizontal layout with spacing\n * <Box flexDirection=\"row\" gap={2}>\n * <Box width={10}><Text>Left</Text></Box>\n * <Box flexGrow={1}><Text>Center</Text></Box>\n * <Box width={10}><Text>Right</Text></Box>\n * </Box>\n *\n * // With border\n * <Box borderStyle=\"single\" borderColor=\"green\" padding={1}>\n * <Text>Boxed content</Text>\n * </Box>\n *\n * // With ref and onLayout\n * const boxRef = useRef<BoxHandle>(null);\n * <Box\n * ref={boxRef}\n * onLayout={(layout) => console.log('Size:', layout.width, layout.height)}\n * >\n * <Text>Content</Text>\n * </Box>\n * ```\n */\nexport const Box = forwardRef(function Box(\n props: BoxProps,\n ref: ForwardedRef<BoxHandle>,\n): JSX.Element {\n const { children, onLayout, ...restProps } = props\n const nodeRef = useRef<AgNode | null>(null)\n const [node, setNode] = useState<AgNode | null>(null)\n\n // Track the last layout we reported to onLayout to avoid duplicate calls\n const lastReportedLayout = useRef<Rect | null>(null)\n\n // After mount, ref points to the SilveryNode. Update state once to provide\n // the node to children via context. Only runs on mount ([] deps).\n useLayoutEffect(() => {\n if (nodeRef.current) {\n setNode(nodeRef.current)\n }\n }, [])\n\n // Wire up onLayout callback - subscribe via layout signals\n useLayoutEffect(() => {\n if (!onLayout || !node) return\n\n const releaseObservation = observeLayoutSignal(node, \"boxRect\")\n const signals = getLayoutSignals(node)\n const onLayoutRef = { current: onLayout }\n onLayoutRef.current = onLayout\n\n const dispose = signalEffect(() => {\n const layout = signals.boxRect()\n if (!layout) return\n\n // Only call onLayout if layout actually changed\n const last = lastReportedLayout.current\n if (\n !last ||\n last.x !== layout.x ||\n last.y !== layout.y ||\n last.width !== layout.width ||\n last.height !== layout.height\n ) {\n lastReportedLayout.current = layout\n onLayoutRef.current(layout)\n }\n })\n\n return () => {\n dispose()\n releaseObservation()\n }\n }, [node, onLayout])\n\n // Expose imperative methods via ref\n useImperativeHandle(\n ref,\n () => ({\n getNode: () => nodeRef.current,\n getBoxRect: () => nodeRef.current?.boxRect ?? null,\n getScrollRect: () => nodeRef.current?.scrollRect ?? null,\n }),\n [],\n )\n\n // Render silvery-box with ref, wrap children in NodeContext\n // The reconciler creates an SilveryNode, ref gives us access to it\n return (\n <silvery-box ref={nodeRef} {...restProps}>\n <NodeContext.Provider value={node}>{children}</NodeContext.Provider>\n </silvery-box>\n )\n})\n","/**\n * Silvery Text Component\n *\n * The primitive for rendering text content in Silvery. Text supports styling\n * (colors, bold, italic, etc.) and text wrapping/truncation modes.\n *\n * Text renders to an 'silvery-text' host element that the reconciler converts\n * to an SilveryNode containing the text content.\n *\n * Supports forwardRef for imperative access to the underlying node.\n */\n\nimport { type ForwardedRef, type JSX, type ReactNode, forwardRef, useContext } from \"react\"\nimport type { AgNode, TextProps as TextPropsType } from \"@silvery/ag/types\"\nimport type { KnownVariant, Theme } from \"@silvery/ansi\"\nimport { KNOWN_VARIANTS } from \"@silvery/ansi\"\nimport { ThemeContext } from \"../ThemeContext\"\n\n// ============================================================================\n// Runtime variant warning — fires once per (theme, variantName) pair.\n// Warns the developer that a variant lookup returned undefined (typo, etc.).\n// Does NOT throw — silent no-op rendering is still the correct behavior.\n// Only fires in development/test (process.env.NODE_ENV !== \"production\").\n// ============================================================================\n\n/** Per-theme set of variant names that have already triggered a warning. */\nconst _warnedVariants = new WeakMap<Theme, Set<string>>()\n\nfunction warnOnce(theme: Theme, variant: string): void {\n if (process.env.NODE_ENV === \"production\") return\n let warned = _warnedVariants.get(theme)\n if (warned === undefined) {\n warned = new Set<string>()\n _warnedVariants.set(theme, warned)\n }\n if (warned.has(variant)) return\n warned.add(variant)\n const known = KNOWN_VARIANTS.join(\", \")\n // eslint-disable-next-line no-console\n console.warn(\n `[silvery] <Text variant=\"${variant}\"> — unknown variant, defaulting to bare. ` +\n `Known: ${known}. ` +\n `Register custom variants via <ThemeProvider tokens={{ variants: { ${variant}: {...} } }}>.`,\n )\n}\n\n// ============================================================================\n// Props\n// ============================================================================\n\nexport interface TextProps extends TextPropsType {\n /** Text content (string, number, or nested Text elements) */\n children?: ReactNode\n /**\n * Typography variant — pulls defaults from `theme.variants[variant]`.\n * Caller props always win over variant values (variant is the *default*).\n *\n * @example\n * ```tsx\n * <Text variant=\"h1\">Title</Text>\n * // → uses theme.variants.h1 as defaults ({ color: \"$fg-accent\", bold: true })\n *\n * <Text variant=\"h1\" color=\"$fg-success\">Done</Text>\n * // → color=\"$fg-success\" wins; bold still comes from variant\n * ```\n */\n variant?: KnownVariant\n}\n\n/**\n * Methods exposed via ref on Text component.\n */\nexport interface TextHandle {\n /** Get the underlying SilveryNode */\n getNode(): AgNode | null\n}\n\n// ============================================================================\n// Component\n// ============================================================================\n\n/**\n * Text rendering component for terminal UIs.\n *\n * Supports forwardRef for imperative access to the underlying node.\n *\n * @example\n * ```tsx\n * // Basic text\n * <Text>Hello, world!</Text>\n *\n * // Colored text\n * <Text color=\"green\">Success!</Text>\n * <Text color=\"#ff6600\">Orange text</Text>\n *\n * // Styled text\n * <Text bold>Important</Text>\n * <Text italic underline>Emphasized</Text>\n *\n * // Combined styles\n * <Text color=\"red\" bold inverse>Alert!</Text>\n *\n * // Nested text with different styles\n * <Text>\n * Normal <Text bold>bold</Text> normal\n * </Text>\n *\n * // Truncation modes\n * <Text wrap=\"truncate\">This long text will be truncated...</Text>\n * <Text wrap=\"truncate-middle\">Long...text</Text>\n *\n * // With ref\n * const textRef = useRef<TextHandle>(null);\n * <Text ref={textRef}>Hello</Text>\n *\n * // With variant — typography presets from theme\n * <Text variant=\"h1\">Page Title</Text>\n * <Text variant=\"body-muted\">Caption text</Text>\n * <Text variant=\"h1\" color=\"$fg-success\">Done</Text> // caller color wins\n * ```\n */\nexport const Text = forwardRef(function Text(\n props: TextProps,\n ref: ForwardedRef<TextHandle>,\n): JSX.Element {\n const { children, variant, ...callerProps } = props\n const theme = useContext(ThemeContext)\n\n // Resolve variant defaults. Variant is the DEFAULT; caller props always win.\n //\n // Merge strategy (three passes):\n // 1. callerProps — base layer: all caller props including undefined values\n // (preserves non-style props like wrap, data-*, etc.)\n // 2. variantDefaults — overwrite only where callerProps was undefined\n // (fills in color/bold/etc when caller didn't specify)\n // 3. definedCallerProps — restore any explicitly provided caller overrides\n // (e.g. color=\"$fg-success\", bold={false} win over variant)\n //\n // Example: `<Text variant=\"h1\">T</Text>` (color not passed → undefined)\n // callerProps = { color: undefined }\n // variantDefaults = { color: \"$fg-accent\", bold: true }\n // definedCallerProps = {} (color=undefined excluded)\n // → { color: \"$fg-accent\", bold: true } ✓\n //\n // Example: `<Text variant=\"h1\" color=\"$fg-success\">T</Text>`\n // callerProps = { color: \"$fg-success\" }\n // variantDefaults = { color: \"$fg-accent\", bold: true }\n // definedCallerProps = { color: \"$fg-success\" }\n // → { color: \"$fg-success\", bold: true } ✓ (caller color wins)\n let styleProps = callerProps\n if (variant != null) {\n const resolved = theme.variants?.[variant]\n if (resolved === undefined) {\n warnOnce(theme, variant)\n }\n const variantDefaults = resolved ?? {}\n const definedCallerProps: Record<string, unknown> = {}\n for (const key of Object.keys(callerProps)) {\n const v = (callerProps as Record<string, unknown>)[key]\n if (v !== undefined) definedCallerProps[key] = v\n }\n styleProps = { ...callerProps, ...variantDefaults, ...definedCallerProps } as typeof callerProps\n }\n\n // For Text, we need to pass the ref through to the host element\n // The reconciler's getPublicInstance will return the SilveryNode\n // We wrap it in a TextHandle for type safety\n return (\n <silvery-text\n ref={(node: AgNode | null) => {\n // Handle both callback refs and RefObjects\n if (typeof ref === \"function\") {\n ref(node ? { getNode: () => node } : null)\n } else if (ref) {\n ref.current = node ? { getNode: () => node } : null\n }\n }}\n {...styleProps}\n >\n {children}\n </silvery-text>\n )\n})\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;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as computed } from "./src-WeA_J4BV.mjs";
2
- import { _ as rectEqual, c as hasObservedLayoutSignal, d as syncDecorationRects, p as syncRectSignals, s as hasLayoutSignals } from "./layout-signals-Dch2EiCy.mjs";
3
- import { _ as isAnyDirty, b as clearDirtyTracking, g as getRenderEpoch, h as advanceRenderEpoch, l as measureStats, u as collectPlainText, v as isCurrentEpoch, x as hasScrollDirty, y as isDirty } from "./reconciler-NBDSEm8k.mjs";
4
- import { $ as isSoftBreakPoint, B as displayWidthAnsi, F as isStrictEnabled, H as fixOsc8AcrossWrappedLines, I as canBreakAnywhere, J as hasAnsi, Jt as DEFAULT_BG, P as isStrictAnyEnabled, Q as isLikelyEmoji, U as fixSgrAcrossWrappedLines, V as ensureEmojiPresentation, W as getActiveLineHeight, Xt as ansi256ToRgb, Yt as TerminalBuffer, _t as wrapText, ct as runWithMeasurer, ft as splitGraphemes, lt as sliceByWidth, nn as createTextFrame, nt as isWordBoundary, pt as splitGraphemesAnsiAware, q as graphemeWidth, rn as isDefaultBg, st as parseAnsiText, tn as createMutableCell, ut as sliceByWidthFromEnd } from "./ansi-OYRLxxZQ.mjs";
5
- import { _ as kittyDeleteAllScrimPlacements, g as cupTo, h as buildScrimPixels, m as backdropPlacementId, p as resolveThemeColor, u as monoAttrsForColorString, v as kittyPlaceAt, y as kittyUploadScrimImage } from "./src-Oe6x5PrS.mjs";
6
- import { t as ansi16DarkTheme } from "./schemes-DYt2ushj.mjs";
7
- import { r as getLayoutEngine } from "./layout-engine-Ca_nbtfL.mjs";
8
- import "./src-Dvq-s8iD.mjs";
1
+ import { i as signal, n as computed } from "./src-BqeBFB3X.mjs";
2
+ import { _ as rectEqual, c as hasObservedLayoutSignal, d as syncDecorationRects, p as syncRectSignals, s as hasLayoutSignals } from "./layout-signals-CGYbHmxy.mjs";
3
+ import { Ct as isStrictEnabled, D as runWithMeasurer, E as parseAnsiText, I as wrapText, M as splitGraphemesAnsiAware, O as sliceByWidth, St as isStrictAnyEnabled, Xt as ansi256ToRgb, Yt as TerminalBuffer, _ as isLikelyEmoji, a as displayWidthAnsi, an as isDefaultBg, c as fixSgrAcrossWrappedLines, f as graphemeWidth, in as createTextFrame, j as splitGraphemes, k as sliceByWidthFromEnd, l as getActiveLineHeight, o as ensureEmojiPresentation, p as hasAnsi, qt as DEFAULT_BG, rn as createMutableCell, s as fixOsc8AcrossWrappedLines, t as canBreakAnywhere, v as isSoftBreakPoint, x as isWordBoundary } from "./unicode-CxyxVGmB.mjs";
4
+ import { _ as kittyDeleteAllScrimPlacements, g as cupTo, h as buildScrimPixels, m as backdropPlacementId, p as resolveThemeColor, u as monoAttrsForColorString, v as kittyPlaceAt, y as kittyUploadScrimImage } from "./src-B8lf1kiR.mjs";
5
+ import { C as isDirty, S as isCurrentEpoch, _ as measureStats, b as getRenderEpoch, h as hasScrollDirty, m as clearDirtyTracking, v as collectPlainText, x as isAnyDirty, y as advanceRenderEpoch } from "./reconciler--_-biN23.mjs";
6
+ import { r as getLayoutEngine } from "./layout-engine-BgR58vL0.mjs";
7
+ import "./src-BOLdi3WG.mjs";
8
+ import { t as ansi16DarkTheme } from "./schemes-DWQPxXAi.mjs";
9
9
  import { createLogger } from "loggily";
10
10
  import { hexToOklch, mixSrgb, oklchToHex, relativeLuminance } from "@silvery/color";
11
11
  import { appendFileSync } from "node:fs";
@@ -2682,7 +2682,7 @@ function getTextStyle(props) {
2682
2682
  else if (typeof props.underline === "string") underlineStyle = props.underline;
2683
2683
  else if (props.underline === true) underlineStyle = "single";
2684
2684
  let bold = props.bold;
2685
- let dim;
2685
+ let dim = props.internal_dim;
2686
2686
  let italic = props.italic;
2687
2687
  let underline = !!props.underline || !!underlineStyle;
2688
2688
  let strikethrough = props.strikethrough;
@@ -4495,22 +4495,44 @@ function clearBgConflictWarnings() {
4495
4495
  */
4496
4496
  function styleToAnsi(style) {
4497
4497
  const parts = [];
4498
+ let bold = style.bold;
4499
+ let dim = style.dim;
4500
+ let italic = style.italic;
4501
+ let underline = style.underline;
4502
+ let underlineStyle = style.underlineStyle;
4503
+ let inverse = style.inverse;
4504
+ let strikethrough = style.strikethrough;
4505
+ if (getActiveColorLevel() === "mono") {
4506
+ const monoAttrs = getTextStyle({
4507
+ color: style.color,
4508
+ backgroundColor: style.backgroundColor
4509
+ }).attrs;
4510
+ if (monoAttrs.bold) bold = true;
4511
+ if (monoAttrs.dim) dim = true;
4512
+ if (monoAttrs.italic) italic = true;
4513
+ if (monoAttrs.underline) {
4514
+ underline = true;
4515
+ if (!underlineStyle) underlineStyle = "single";
4516
+ }
4517
+ if (monoAttrs.inverse) inverse = true;
4518
+ if (monoAttrs.strikethrough) strikethrough = true;
4519
+ }
4498
4520
  if (style.color) {
4499
4521
  const color = parseColor(style.color);
4500
4522
  if (color !== null) if (typeof color === "number") parts.push(`38;5;${color}`);
4501
4523
  else parts.push(`38;2;${color.r};${color.g};${color.b}`);
4502
4524
  }
4503
- if (style.bold) parts.push("1");
4504
- if (style.dim) parts.push("2");
4505
- if (style.italic) parts.push("3");
4506
- if (style.underlineStyle) parts.push({
4525
+ if (bold) parts.push("1");
4526
+ if (dim) parts.push("2");
4527
+ if (italic) parts.push("3");
4528
+ if (underlineStyle) parts.push({
4507
4529
  single: "4:1",
4508
4530
  double: "4:2",
4509
4531
  curly: "4:3",
4510
4532
  dotted: "4:4",
4511
4533
  dashed: "4:5"
4512
- }[style.underlineStyle] ?? "4");
4513
- else if (style.underline) parts.push("4");
4534
+ }[underlineStyle] ?? "4");
4535
+ else if (underline) parts.push("4");
4514
4536
  if (style.underlineColor) {
4515
4537
  const underlineSource = style.underlineColor === "currentColor" || style.underlineColor === "inherit" ? style.color : style.underlineColor;
4516
4538
  if (underlineSource) {
@@ -4519,8 +4541,8 @@ function styleToAnsi(style) {
4519
4541
  else parts.push(`58;2;${ulColor.r};${ulColor.g};${ulColor.b}`);
4520
4542
  }
4521
4543
  }
4522
- if (style.inverse) parts.push("7");
4523
- if (style.strikethrough) parts.push("9");
4544
+ if (inverse) parts.push("7");
4545
+ if (strikethrough) parts.push("9");
4524
4546
  if (style.overline) parts.push("53");
4525
4547
  if (parts.length === 0) return "";
4526
4548
  return `\x1b[${parts.join(";")}m`;
@@ -4554,7 +4576,7 @@ function mergeStyleContext(parent, childProps) {
4554
4576
  color: effectiveChildColor ?? parent.color,
4555
4577
  backgroundColor: childProps.backgroundColor ?? parent.backgroundColor,
4556
4578
  bold: childProps.bold ?? parent.bold,
4557
- dim: parent.dim,
4579
+ dim: childProps.internal_dim ?? parent.dim,
4558
4580
  italic: childProps.italic ?? parent.italic,
4559
4581
  underline: childUnderline ?? parent.underline,
4560
4582
  underlineStyle: childUnderlineStyle ?? parent.underlineStyle,
@@ -5484,6 +5506,7 @@ function renderText(node, buffer, layout, props, nodeState, inheritedBg, inherit
5484
5506
  color: props.color,
5485
5507
  backgroundColor: props.backgroundColor,
5486
5508
  bold: props.bold,
5509
+ dim: props.internal_dim,
5487
5510
  italic: props.italic,
5488
5511
  underline: rootUnderline,
5489
5512
  underlineStyle: rootUnderlineStyle,
@@ -8724,4 +8747,4 @@ function createAg(root, options) {
8724
8747
  //#endregion
8725
8748
  export { printPassHistogram as _, setActiveColorLevel as a, INSTRUMENT as c, assertBoundedConvergence as d, beginConvergenceLoop as f, notePassCommit as g, logPass as h, parseColor as i, MAX_CONVERGENCE_PASSES as l, formatPassRingBreakdown as m, createRenderPostState as n, FRESH_LAYOUT_STRICT_SLUG as o, beginPass as p, hexToRgb$1 as r, markLayoutTreeDirty as s, createAg as t, appendHistogramJson as u, recordPassRing as v, resetPassHistogram as y };
8726
8749
 
8727
- //# sourceMappingURL=ag-BeFC4S2N.mjs.map
8750
+ //# sourceMappingURL=ag-q9lRlKlt.mjs.map