@alloy-js/core 0.9.0 → 0.11.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 (162) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/dist/src/binder.js +33 -2
  3. package/dist/src/code.js +1 -2
  4. package/dist/src/components/Block.js +2 -5
  5. package/dist/src/components/Declaration.js +2 -4
  6. package/dist/src/components/For.d.ts +1 -1
  7. package/dist/src/components/For.d.ts.map +1 -1
  8. package/dist/src/components/For.js +1 -2
  9. package/dist/src/components/Indent.js +2 -4
  10. package/dist/src/components/List.js +2 -5
  11. package/dist/src/components/MemberDeclaration.js +2 -4
  12. package/dist/src/components/MemberName.js +1 -2
  13. package/dist/src/components/MemberScope.js +2 -4
  14. package/dist/src/components/Name.js +1 -2
  15. package/dist/src/components/Output.js +2 -4
  16. package/dist/src/components/Prose.js +1 -2
  17. package/dist/src/components/ReferenceOrContent.d.ts +8 -0
  18. package/dist/src/components/ReferenceOrContent.d.ts.map +1 -0
  19. package/dist/src/components/ReferenceOrContent.js +11 -0
  20. package/dist/src/components/Scope.js +2 -4
  21. package/dist/src/components/Show.js +1 -2
  22. package/dist/src/components/SourceDirectory.js +2 -4
  23. package/dist/src/components/SourceFile.js +2 -5
  24. package/dist/src/components/StatementList.js +2 -4
  25. package/dist/src/components/Switch.d.ts +1 -1
  26. package/dist/src/components/Switch.d.ts.map +1 -1
  27. package/dist/src/components/Switch.js +1 -2
  28. package/dist/src/components/Wrap.js +2 -4
  29. package/dist/src/components/index.d.ts +1 -0
  30. package/dist/src/components/index.d.ts.map +1 -1
  31. package/dist/src/components/index.js +2 -2
  32. package/dist/src/components/stc/index.d.ts +1 -0
  33. package/dist/src/components/stc/index.d.ts.map +1 -1
  34. package/dist/src/components/stc/index.js +2 -2
  35. package/dist/src/components/stc/sti.js +1 -2
  36. package/dist/src/context/assignment.js +1 -2
  37. package/dist/src/context/binder.js +1 -2
  38. package/dist/src/context/declaration.js +1 -2
  39. package/dist/src/context/index.js +1 -2
  40. package/dist/src/context/member-declaration.js +1 -2
  41. package/dist/src/context/member-scope.js +1 -2
  42. package/dist/src/context/name-policy.js +1 -2
  43. package/dist/src/context/scope.js +1 -2
  44. package/dist/src/context/source-directory.js +1 -2
  45. package/dist/src/context/source-file.js +1 -2
  46. package/dist/src/context.js +1 -2
  47. package/dist/src/debug.js +13 -15
  48. package/dist/src/index.browser.js +1 -2
  49. package/dist/src/index.js +1 -2
  50. package/dist/src/jsx-runtime.d.ts +1 -1
  51. package/dist/src/jsx-runtime.d.ts.map +1 -1
  52. package/dist/src/jsx-runtime.js +1 -2
  53. package/dist/src/name-policy.js +1 -2
  54. package/dist/src/refkey.js +1 -2
  55. package/dist/src/render.js +1 -2
  56. package/dist/src/slot.js +1 -2
  57. package/dist/src/stc.js +1 -2
  58. package/dist/src/sti.js +1 -2
  59. package/dist/src/tap.js +1 -2
  60. package/dist/src/tsdoc-metadata.json +1 -1
  61. package/dist/src/utils.js +2 -4
  62. package/dist/src/write-output.browser.js +1 -2
  63. package/dist/src/write-output.js +1 -2
  64. package/dist/test/browser-build.test.js +85 -0
  65. package/dist/test/children.test.js +27 -0
  66. package/dist/test/components/block.test.js +45 -0
  67. package/dist/test/components/declaration.test.js +30 -0
  68. package/dist/test/components/list.test.js +86 -0
  69. package/dist/test/components/prose.test.js +25 -0
  70. package/dist/test/components/reference-or-content.test.d.ts +2 -0
  71. package/dist/test/components/reference-or-content.test.d.ts.map +1 -0
  72. package/dist/test/components/reference-or-content.test.js +149 -0
  73. package/dist/test/components/slot.test.js +134 -0
  74. package/dist/test/components/source-file.test.js +64 -0
  75. package/dist/test/components/wrap.test.js +35 -0
  76. package/dist/test/control-flow/for.test.js +185 -0
  77. package/dist/test/control-flow/match.test.js +67 -0
  78. package/dist/test/control-flow/show.test.js +29 -0
  79. package/dist/test/name-policy.test.js +19 -0
  80. package/dist/test/props-with-defaults.test.js +93 -0
  81. package/dist/test/reactivity/cleanup.test.js +77 -0
  82. package/dist/test/reactivity/memo.test.js +16 -0
  83. package/dist/test/reactivity/ref-rendering.test.js +37 -0
  84. package/dist/test/reactivity/test.test.js +61 -0
  85. package/dist/test/reactivity/untrack.test.js +23 -0
  86. package/dist/test/refkey.test.js +25 -0
  87. package/dist/test/rendering/basic.test.js +96 -0
  88. package/dist/test/rendering/code.test.js +55 -0
  89. package/dist/test/rendering/formatting.test.js +402 -0
  90. package/dist/test/rendering/indent.test.js +90 -0
  91. package/dist/test/rendering/memoization.test.js +25 -0
  92. package/dist/test/rendering/refkeys.test.js +32 -0
  93. package/dist/test/split-props.test.js +77 -0
  94. package/dist/test/stc.test.js +34 -0
  95. package/dist/test/symbols.test.js +504 -0
  96. package/dist/test/utils.test.js +221 -0
  97. package/dist/testing/extend-expect.js +1 -2
  98. package/dist/testing/index.js +1 -2
  99. package/dist/testing/render.js +1 -2
  100. package/dist/tsconfig.tsbuildinfo +1 -1
  101. package/package.json +14 -22
  102. package/src/components/For.tsx +2 -2
  103. package/src/components/ReferenceOrContent.tsx +22 -0
  104. package/src/components/index.tsx +1 -0
  105. package/src/components/stc/index.ts +1 -0
  106. package/src/debug.ts +12 -13
  107. package/src/jsx-runtime.ts +2 -2
  108. package/temp/api.json +208 -7
  109. package/test/components/reference-or-content.test.tsx +138 -0
  110. package/babel.config.cjs +0 -4
  111. package/dist/src/binder.js.map +0 -1
  112. package/dist/src/code.js.map +0 -1
  113. package/dist/src/components/Block.js.map +0 -1
  114. package/dist/src/components/Declaration.js.map +0 -1
  115. package/dist/src/components/For.js.map +0 -1
  116. package/dist/src/components/Indent.js.map +0 -1
  117. package/dist/src/components/List.js.map +0 -1
  118. package/dist/src/components/MemberDeclaration.js.map +0 -1
  119. package/dist/src/components/MemberName.js.map +0 -1
  120. package/dist/src/components/MemberScope.js.map +0 -1
  121. package/dist/src/components/Name.js.map +0 -1
  122. package/dist/src/components/Output.js.map +0 -1
  123. package/dist/src/components/Prose.js.map +0 -1
  124. package/dist/src/components/Scope.js.map +0 -1
  125. package/dist/src/components/Show.js.map +0 -1
  126. package/dist/src/components/SourceDirectory.js.map +0 -1
  127. package/dist/src/components/SourceFile.js.map +0 -1
  128. package/dist/src/components/StatementList.js.map +0 -1
  129. package/dist/src/components/Switch.js.map +0 -1
  130. package/dist/src/components/Wrap.js.map +0 -1
  131. package/dist/src/components/index.js.map +0 -1
  132. package/dist/src/components/stc/index.js.map +0 -1
  133. package/dist/src/components/stc/sti.js.map +0 -1
  134. package/dist/src/context/assignment.js.map +0 -1
  135. package/dist/src/context/binder.js.map +0 -1
  136. package/dist/src/context/declaration.js.map +0 -1
  137. package/dist/src/context/index.js.map +0 -1
  138. package/dist/src/context/member-declaration.js.map +0 -1
  139. package/dist/src/context/member-scope.js.map +0 -1
  140. package/dist/src/context/name-policy.js.map +0 -1
  141. package/dist/src/context/scope.js.map +0 -1
  142. package/dist/src/context/source-directory.js.map +0 -1
  143. package/dist/src/context/source-file.js.map +0 -1
  144. package/dist/src/context.js.map +0 -1
  145. package/dist/src/debug.js.map +0 -1
  146. package/dist/src/index.browser.js.map +0 -1
  147. package/dist/src/index.js.map +0 -1
  148. package/dist/src/jsx-runtime.js.map +0 -1
  149. package/dist/src/name-policy.js.map +0 -1
  150. package/dist/src/refkey.js.map +0 -1
  151. package/dist/src/render.js.map +0 -1
  152. package/dist/src/slot.js.map +0 -1
  153. package/dist/src/stc.js.map +0 -1
  154. package/dist/src/sti.js.map +0 -1
  155. package/dist/src/tap.js.map +0 -1
  156. package/dist/src/utils.js.map +0 -1
  157. package/dist/src/write-output.browser.js.map +0 -1
  158. package/dist/src/write-output.js.map +0 -1
  159. package/dist/testing/extend-expect.js.map +0 -1
  160. package/dist/testing/index.js.map +0 -1
  161. package/dist/testing/render.js.map +0 -1
  162. package/dist/testing/vitest.d.js.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,22 @@
1
1
  # Changelog - @alloy-js/core
2
2
 
3
+ ## 0.11.0
4
+
5
+ ### Bug Fixes
6
+
7
+ - [#91](https://github.com/alloy-framework/alloy/pull/91) `taggedComponent` return type updated to make tag as a required property
8
+ - [#97](https://github.com/alloy-framework/alloy/pull/97) Update `ForCallbackArgs` to handle arrays early, before unions of arrays are distributed. This mitigates a nasty typechecking bug that appears when the type of elements passed to `For` are a union of arrays.
9
+
10
+ ### Features
11
+
12
+ - [#104](https://github.com/alloy-framework/alloy/pull/104) Add new `<ReferenceOrContent />` component
13
+ - [#105](https://github.com/alloy-framework/alloy/pull/105) Updated dependencies
14
+
15
+
16
+ ## 0.10.0
17
+
18
+ No changes, version bump only.
19
+
3
20
  ## 0.9.0
4
21
 
5
22
  ### Features
@@ -9,11 +9,33 @@ import { refkey } from "./refkey.js";
9
9
  */
10
10
  export let OutputSymbolFlags = /*#__PURE__*/function (OutputSymbolFlags) {
11
11
  OutputSymbolFlags[OutputSymbolFlags["None"] = 0] = "None";
12
+ /**
13
+ * The symbol is an instance member container. Symbols with this flag will have a
14
+ * instanceMemberScope property that contains symbols for instance members.
15
+ */
12
16
  OutputSymbolFlags[OutputSymbolFlags["InstanceMemberContainer"] = 1] = "InstanceMemberContainer";
17
+ /**
18
+ * The symbol is a static member container. Symbols with this flag will have a
19
+ * staticMemberScope property that contains symbols for static members.
20
+ */
13
21
  OutputSymbolFlags[OutputSymbolFlags["StaticMemberContainer"] = 2] = "StaticMemberContainer";
22
+ /**
23
+ * Whether this symbol contains members of any kind.
24
+ */
14
25
  OutputSymbolFlags[OutputSymbolFlags["MemberContainer"] = 3] = "MemberContainer";
26
+ /**
27
+ * Whether this symbol is an instance member of another symbol (i.e that it is
28
+ * stored in an instance member scope).
29
+ */
15
30
  OutputSymbolFlags[OutputSymbolFlags["InstanceMember"] = 4] = "InstanceMember";
31
+ /**
32
+ * Whether this symbol is a static member of another symbol (i.e that it is
33
+ * stored in a static member scope).
34
+ */
16
35
  OutputSymbolFlags[OutputSymbolFlags["StaticMember"] = 8] = "StaticMember";
36
+ /**
37
+ * Whether this is an instance member or static member of another symbol.
38
+ */
17
39
  OutputSymbolFlags[OutputSymbolFlags["Member"] = 12] = "Member";
18
40
  return OutputSymbolFlags;
19
41
  }({});
@@ -41,8 +63,18 @@ export let OutputSymbolFlags = /*#__PURE__*/function (OutputSymbolFlags) {
41
63
  */
42
64
  export let OutputScopeFlags = /*#__PURE__*/function (OutputScopeFlags) {
43
65
  OutputScopeFlags[OutputScopeFlags["None"] = 0] = "None";
66
+ /**
67
+ * This scope is a static member scope.
68
+ */
44
69
  OutputScopeFlags[OutputScopeFlags["StaticMemberScope"] = 1] = "StaticMemberScope";
70
+ /**
71
+ * This scope is an instance member scope.
72
+ */
45
73
  OutputScopeFlags[OutputScopeFlags["InstanceMemberScope"] = 2] = "InstanceMemberScope";
74
+ /**
75
+ * This scope is a member scope. Scopes with this flag will have an `owner`
76
+ * property that points to the symbol whose member this scope holds.
77
+ */
46
78
  OutputScopeFlags[OutputScopeFlags["MemberScope"] = 3] = "MemberScope";
47
79
  return OutputScopeFlags;
48
80
  }({});
@@ -573,5 +605,4 @@ export function useDefaultScope(flags = OutputSymbolFlags.None) {
573
605
  return memberScope.staticMembers;
574
606
  }
575
607
  }
576
- }
577
- //# sourceMappingURL=binder.js.map
608
+ }
package/dist/src/code.js CHANGED
@@ -177,5 +177,4 @@ function* childTokens(template, substitutions) {
177
177
  function currentIndent() {
178
178
  return indentStack.at(-1);
179
179
  }
180
- }
181
- //# sourceMappingURL=code.js.map
180
+ }
@@ -1,6 +1,4 @@
1
- import { createIntrinsic as _$createIntrinsic } from "@alloy-js/core/jsx-runtime";
2
- import { createComponent as _$createComponent } from "@alloy-js/core/jsx-runtime";
3
- import { memo as _$memo } from "@alloy-js/core/jsx-runtime";
1
+ import { memo as _$memo, createComponent as _$createComponent, createIntrinsic as _$createIntrinsic } from "@alloy-js/core/jsx-runtime";
4
2
  import { childrenArray, computed, Indent } from "@alloy-js/core";
5
3
  /**
6
4
  * Create an indented block of source text. The block has `opener` text which is
@@ -22,5 +20,4 @@ export function Block(props) {
22
20
  }), _$memo(() => props.closer ?? "}")];
23
21
  }
24
22
  });
25
- }
26
- //# sourceMappingURL=Block.js.map
23
+ }
@@ -1,5 +1,4 @@
1
- import { createComponent as _$createComponent } from "@alloy-js/core/jsx-runtime";
2
- import { memo as _$memo } from "@alloy-js/core/jsx-runtime";
1
+ import { memo as _$memo, createComponent as _$createComponent } from "@alloy-js/core/jsx-runtime";
3
2
  import { useContext } from "../context.js";
4
3
  import { BinderContext } from "../context/binder.js";
5
4
  import { DeclarationContext } from "../context/declaration.js";
@@ -55,5 +54,4 @@ export function Declaration(props) {
55
54
  return props.children;
56
55
  }
57
56
  });
58
- }
59
- //# sourceMappingURL=Declaration.js.map
57
+ }
@@ -1,7 +1,7 @@
1
1
  import { Children } from "@alloy-js/core/jsx-runtime";
2
2
  import { Ref } from "@vue/reactivity";
3
3
  import { BaseListProps } from "./List.jsx";
4
- export type ForCallbackArgs<T> = T extends Ref<infer U> ? ForCallbackArgs<U> : T extends () => infer U ? ForCallbackArgs<U> : T extends (infer U)[] ? [value: U] : T extends Map<infer U, infer V> ? [key: U, value: V] : T extends Set<infer U> ? [value: U] : T extends IterableIterator<infer U> ? [value: U] : [];
4
+ export type ForCallbackArgs<T> = number extends keyof T ? [value: T[number]] : T extends Ref<infer U> ? ForCallbackArgs<U> : T extends () => infer U ? ForCallbackArgs<U> : T extends Map<infer U, infer V> ? [key: U, value: V] : T extends Set<infer U> ? [value: U] : T extends IterableIterator<infer U> ? [value: U] : [];
5
5
  export interface ForProps<T extends ForSupportedCollections | (() => ForSupportedCollections) | Ref<ForSupportedCollections>, U extends Children> extends BaseListProps {
6
6
  /**
7
7
  * The array to iterate over.
@@ -1 +1 @@
1
- {"version":3,"file":"For.d.ts","sourceRoot":"","sources":["../../../src/components/For.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAQ,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAS,GAAG,EAAE,MAAM,iBAAiB,CAAC;AAE7C,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAE3C,MAAM,MAAM,eAAe,CAAC,CAAC,IAC3B,CAAC,SAAS,GAAG,CAAC,MAAM,CAAC,CAAC,GAAG,eAAe,CAAC,CAAC,CAAC,GACzC,CAAC,SAAS,MAAM,MAAM,CAAC,GAAG,eAAe,CAAC,CAAC,CAAC,GAC5C,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,EAAE,GAAG,CAAC,KAAK,EAAE,CAAC,CAAC,GAClC,CAAC,SAAS,GAAG,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,GACpD,CAAC,SAAS,GAAG,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC,CAAC,GACnC,CAAC,SAAS,gBAAgB,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC,CAAC,GAChD,EAAE,CAAC;AAEP,MAAM,WAAW,QAAQ,CACvB,CAAC,SACG,uBAAuB,GACvB,CAAC,MAAM,uBAAuB,CAAC,GAC/B,GAAG,CAAC,uBAAuB,CAAC,EAChC,CAAC,SAAS,QAAQ,CAClB,SAAQ,aAAa;IACrB;;OAEG;IACH,IAAI,EAAE,CAAC,CAAC;IAER;;OAEG;IACH,QAAQ,EAAE,CAAC,GAAG,IAAI,EAAE,CAAC,GAAG,eAAe,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC;IAEjE;;;;OAIG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,MAAM,MAAM,uBAAuB,GAC/B,GAAG,EAAE,GACL,GAAG,CAAC,GAAG,EAAE,GAAG,CAAC,GACb,GAAG,CAAC,GAAG,CAAC,GACR,gBAAgB,CAAC,GAAG,CAAC,CAAC;AAC1B;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,GAAG,CACjB,CAAC,SACG,uBAAuB,GACvB,CAAC,MAAM,uBAAuB,CAAC,GAC/B,GAAG,CAAC,uBAAuB,CAAC,EAChC,CAAC,SAAS,QAAQ,EAClB,KAAK,EAAE,QAAQ,CAAC,CAAC,EAAE,CAAC,CAAC,aAetB"}
1
+ {"version":3,"file":"For.d.ts","sourceRoot":"","sources":["../../../src/components/For.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAQ,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAS,GAAG,EAAE,MAAM,iBAAiB,CAAC;AAE7C,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAE3C,MAAM,MAAM,eAAe,CAAC,CAAC,IAC3B,MAAM,SAAS,MAAM,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,GACzC,CAAC,SAAS,GAAG,CAAC,MAAM,CAAC,CAAC,GAAG,eAAe,CAAC,CAAC,CAAC,GAC3C,CAAC,SAAS,MAAM,MAAM,CAAC,GAAG,eAAe,CAAC,CAAC,CAAC,GAC5C,CAAC,SAAS,GAAG,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,GACpD,CAAC,SAAS,GAAG,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC,CAAC,GACnC,CAAC,SAAS,gBAAgB,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC,CAAC,GAChD,EAAE,CAAC;AAEP,MAAM,WAAW,QAAQ,CACvB,CAAC,SACG,uBAAuB,GACvB,CAAC,MAAM,uBAAuB,CAAC,GAC/B,GAAG,CAAC,uBAAuB,CAAC,EAChC,CAAC,SAAS,QAAQ,CAClB,SAAQ,aAAa;IACrB;;OAEG;IACH,IAAI,EAAE,CAAC,CAAC;IAER;;OAEG;IACH,QAAQ,EAAE,CAAC,GAAG,IAAI,EAAE,CAAC,GAAG,eAAe,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC;IAEjE;;;;OAIG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,MAAM,MAAM,uBAAuB,GAC/B,GAAG,EAAE,GACL,GAAG,CAAC,GAAG,EAAE,GAAG,CAAC,GACb,GAAG,CAAC,GAAG,CAAC,GACR,gBAAgB,CAAC,GAAG,CAAC,CAAC;AAC1B;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,GAAG,CACjB,CAAC,SACG,uBAAuB,GACvB,CAAC,MAAM,uBAAuB,CAAC,GAC/B,GAAG,CAAC,uBAAuB,CAAC,EAChC,CAAC,SAAS,QAAQ,EAClB,KAAK,EAAE,QAAQ,CAAC,CAAC,EAAE,CAAC,CAAC,aAetB"}
@@ -36,5 +36,4 @@ export function For(props) {
36
36
  const maybeRef = props.each;
37
37
  return mapJoin(typeof maybeRef === "function" ? maybeRef : () => isRef(maybeRef) ? maybeRef.value : maybeRef, cb, options);
38
38
  });
39
- }
40
- //# sourceMappingURL=For.js.map
39
+ }
@@ -1,5 +1,4 @@
1
- import { memo as _$memo } from "@alloy-js/core/jsx-runtime";
2
- import { createIntrinsic as _$createIntrinsic } from "@alloy-js/core/jsx-runtime";
1
+ import { createIntrinsic as _$createIntrinsic, memo as _$memo } from "@alloy-js/core/jsx-runtime";
3
2
  /**
4
3
  * Create an indented block of source text. The indented block starts a new line
5
4
  * at the new indentation level and, with `trailingBreak`, ends with a new line
@@ -13,5 +12,4 @@ export function Indent(props) {
13
12
  return [breakElem, _$memo(() => props.children)];
14
13
  }
15
14
  }), _$memo(() => props.trailingBreak && breakElem)];
16
- }
17
- //# sourceMappingURL=Indent.js.map
15
+ }
@@ -1,6 +1,4 @@
1
- import { createComponent as _$createComponent } from "@alloy-js/core/jsx-runtime";
2
- import { mergeProps as _$mergeProps } from "@alloy-js/core/jsx-runtime";
3
- import { memo, splitProps } from "@alloy-js/core/jsx-runtime";
1
+ import { memo, splitProps, mergeProps as _$mergeProps, createComponent as _$createComponent } from "@alloy-js/core/jsx-runtime";
4
2
  import { childrenArray } from "../utils.js";
5
3
  import { For } from "./For.js";
6
4
  /**
@@ -21,5 +19,4 @@ export function List(props) {
21
19
  skipFalsy: true,
22
20
  children: child => child
23
21
  }));
24
- }
25
- //# sourceMappingURL=List.js.map
22
+ }
@@ -1,5 +1,4 @@
1
- import { createComponent as _$createComponent } from "@alloy-js/core/jsx-runtime";
2
- import { memo as _$memo } from "@alloy-js/core/jsx-runtime";
1
+ import { memo as _$memo, createComponent as _$createComponent } from "@alloy-js/core/jsx-runtime";
3
2
  import { OutputSymbolFlags } from "../binder.js";
4
3
  import { useContext } from "../context.js";
5
4
  import { BinderContext } from "../context/binder.js";
@@ -59,5 +58,4 @@ export function MemberDeclaration(props) {
59
58
  return props.children;
60
59
  }
61
60
  });
62
- }
63
- //# sourceMappingURL=MemberDeclaration.js.map
61
+ }
@@ -7,5 +7,4 @@ export function MemberName() {
7
7
  return "(no member declaration context)";
8
8
  }
9
9
  return [_$memo(() => declSymbol.name)];
10
- }
11
- //# sourceMappingURL=MemberName.js.map
10
+ }
@@ -1,5 +1,4 @@
1
- import { createComponent as _$createComponent } from "@alloy-js/core/jsx-runtime";
2
- import { memo as _$memo } from "@alloy-js/core/jsx-runtime";
1
+ import { memo as _$memo, createComponent as _$createComponent } from "@alloy-js/core/jsx-runtime";
3
2
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
4
3
 
5
4
  import { MemberScopeContext } from "../context/member-scope.js";
@@ -26,5 +25,4 @@ export function MemberScope(props) {
26
25
  return props.children;
27
26
  }
28
27
  });
29
- }
30
- //# sourceMappingURL=MemberScope.js.map
28
+ }
@@ -7,5 +7,4 @@ export function Name() {
7
7
  return "";
8
8
  }
9
9
  return [_$memo(() => declSymbol.name)];
10
- }
11
- //# sourceMappingURL=Name.js.map
10
+ }
@@ -1,5 +1,4 @@
1
- import { memo as _$memo } from "@alloy-js/core/jsx-runtime";
2
- import { createComponent as _$createComponent } from "@alloy-js/core/jsx-runtime";
1
+ import { createComponent as _$createComponent, memo as _$memo } from "@alloy-js/core/jsx-runtime";
3
2
  import { createOutputBinder, getSymbolCreator } from "../binder.js";
4
3
  import { BinderContext } from "../context/binder.js";
5
4
  import { NamePolicyContext } from "../context/name-policy.js";
@@ -52,5 +51,4 @@ export function Output(props) {
52
51
  }) : dir)];
53
52
  }
54
53
  });
55
- }
56
- //# sourceMappingURL=Output.js.map
54
+ }
@@ -19,5 +19,4 @@ export function Prose(props) {
19
19
  return brokenChildren.value;
20
20
  }
21
21
  });
22
- }
23
- //# sourceMappingURL=Prose.js.map
22
+ }
@@ -0,0 +1,8 @@
1
+ import { Children } from "@alloy-js/core/jsx-runtime";
2
+ import type { Refkey } from "../refkey.js";
3
+ export interface ReferenceOrContentProps {
4
+ readonly refkey: Refkey;
5
+ readonly children: Children;
6
+ }
7
+ export declare function ReferenceOrContent(props: ReferenceOrContentProps): import("@vue/reactivity").ComputedRef<Children>;
8
+ //# sourceMappingURL=ReferenceOrContent.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ReferenceOrContent.d.ts","sourceRoot":"","sources":["../../../src/components/ReferenceOrContent.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAItD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAE3C,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC;CAC7B;AAED,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,uBAAuB,mDAUhE"}
@@ -0,0 +1,11 @@
1
+ import { computed } from "@vue/reactivity";
2
+ import { useContext } from "../context.js";
3
+ import { BinderContext } from "../context/binder.js";
4
+ export function ReferenceOrContent(props) {
5
+ const binder = useContext(BinderContext);
6
+ if (!binder) {
7
+ throw new Error("Need binder context to create declarations");
8
+ }
9
+ const sym = binder.getSymbolForRefkey(props.refkey);
10
+ return computed(() => sym.value === undefined ? props.children : props.refkey);
11
+ }
@@ -1,5 +1,4 @@
1
- import { createComponent as _$createComponent } from "@alloy-js/core/jsx-runtime";
2
- import { memo as _$memo } from "@alloy-js/core/jsx-runtime";
1
+ import { memo as _$memo, createComponent as _$createComponent } from "@alloy-js/core/jsx-runtime";
3
2
  import { useContext } from "../context.js";
4
3
  import { BinderContext } from "../context/binder.js";
5
4
  import { ScopeContext } from "../context/scope.js";
@@ -37,5 +36,4 @@ export function Scope(props) {
37
36
  return props.children;
38
37
  }
39
38
  });
40
- }
41
- //# sourceMappingURL=Scope.js.map
39
+ }
@@ -1,4 +1,3 @@
1
1
  export function Show(props) {
2
2
  return () => props.when ? props.children : props.fallback;
3
- }
4
- //# sourceMappingURL=Show.js.map
3
+ }
@@ -1,5 +1,4 @@
1
- import { createComponent as _$createComponent } from "@alloy-js/core/jsx-runtime";
2
- import { memo as _$memo } from "@alloy-js/core/jsx-runtime";
1
+ import { memo as _$memo, createComponent as _$createComponent } from "@alloy-js/core/jsx-runtime";
3
2
  import { shallowReactive } from "@vue/reactivity";
4
3
  import { join } from "pathe";
5
4
  import { useContext } from "../context.js";
@@ -35,5 +34,4 @@ function createSourceDirectoryContext(path = "./", parentDir) {
35
34
  parentDir.addContent(context);
36
35
  }
37
36
  return context;
38
- }
39
- //# sourceMappingURL=SourceDirectory.js.map
37
+ }
@@ -1,6 +1,4 @@
1
- import { createComponent as _$createComponent } from "@alloy-js/core/jsx-runtime";
2
- import { createIntrinsic as _$createIntrinsic } from "@alloy-js/core/jsx-runtime";
3
- import { memo as _$memo } from "@alloy-js/core/jsx-runtime";
1
+ import { memo as _$memo, createIntrinsic as _$createIntrinsic, createComponent as _$createComponent } from "@alloy-js/core/jsx-runtime";
4
2
  import { join } from "pathe";
5
3
  import { useContext } from "../context.js";
6
4
  import { SourceDirectoryContext } from "../context/source-directory.js";
@@ -36,5 +34,4 @@ export function SourceFile(props) {
36
34
  }), _$memo(() => props.children)];
37
35
  }
38
36
  });
39
- }
40
- //# sourceMappingURL=SourceFile.js.map
37
+ }
@@ -1,5 +1,4 @@
1
- import { createComponent as _$createComponent } from "@alloy-js/core/jsx-runtime";
2
- import { memo as _$memo } from "@alloy-js/core/jsx-runtime";
1
+ import { memo as _$memo, createComponent as _$createComponent } from "@alloy-js/core/jsx-runtime";
3
2
  import { List } from "@alloy-js/core";
4
3
  /**
5
4
  * Join child elements with semicolons and hardlines.
@@ -13,5 +12,4 @@ export function StatementList(props) {
13
12
  return props.children;
14
13
  }
15
14
  });
16
- }
17
- //# sourceMappingURL=StatementList.js.map
15
+ }
@@ -37,5 +37,5 @@ export declare const matchTag: unique symbol;
37
37
  * The Match component is used inside of a {@link Switch} component to
38
38
  * define conditionally rendered blocks of content.
39
39
  */
40
- export declare const Match: import("@alloy-js/core/jsx-runtime").Component<MatchProps>;
40
+ export declare const Match: import("@alloy-js/core/jsx-runtime").Component<MatchProps> & Required<Pick<import("@alloy-js/core/jsx-runtime").Component<MatchProps>, "tag">>;
41
41
  //# sourceMappingURL=Switch.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Switch.d.ts","sourceRoot":"","sources":["../../../src/components/Switch.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAyB,MAAM,4BAA4B,CAAC;AAG7E,MAAM,WAAW,WAAW;IAC1B,QAAQ,EAAE,QAAQ,CAAC;CACpB;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,MAAM,CAAC,KAAK,EAAE,WAAW,aAaxC;AAED,MAAM,WAAW,UAAU;IACzB;;OAEG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IAEf;;;OAGG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,QAAQ,EAAE,QAAQ,CAAC;CACpB;AAED,eAAO,MAAM,QAAQ,eAAW,CAAC;AAEjC;;;GAGG;AACH,eAAO,MAAM,KAAK,4DAEhB,CAAC"}
1
+ {"version":3,"file":"Switch.d.ts","sourceRoot":"","sources":["../../../src/components/Switch.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAyB,MAAM,4BAA4B,CAAC;AAG7E,MAAM,WAAW,WAAW;IAC1B,QAAQ,EAAE,QAAQ,CAAC;CACpB;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,MAAM,CAAC,KAAK,EAAE,WAAW,aAaxC;AAED,MAAM,WAAW,UAAU;IACzB;;OAEG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IAEf;;;OAGG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,QAAQ,EAAE,QAAQ,CAAC;CACpB;AAED,eAAO,MAAM,QAAQ,eAAW,CAAC;AAEjC;;;GAGG;AACH,eAAO,MAAM,KAAK,gJAEhB,CAAC"}
@@ -37,5 +37,4 @@ export const matchTag = Symbol();
37
37
  */
38
38
  export const Match = taggedComponent(matchTag, props => {
39
39
  return () => props.when ? props.children : undefined;
40
- });
41
- //# sourceMappingURL=Switch.js.map
40
+ });
@@ -1,5 +1,4 @@
1
- import { createComponent as _$createComponent } from "@alloy-js/core/jsx-runtime";
2
- import { mergeProps as _$mergeProps } from "@alloy-js/core/jsx-runtime";
1
+ import { mergeProps as _$mergeProps, createComponent as _$createComponent } from "@alloy-js/core/jsx-runtime";
3
2
  /**
4
3
  * Conditionally wrap the children of this component with the component given to
5
4
  * `with` and passing `props` to it.
@@ -11,5 +10,4 @@ export function Wrap(props) {
11
10
  return props.children;
12
11
  }
13
12
  })) : props.children;
14
- }
15
- //# sourceMappingURL=Wrap.js.map
13
+ }
@@ -9,6 +9,7 @@ export * from "./MemberScope.jsx";
9
9
  export * from "./Name.jsx";
10
10
  export * from "./Output.js";
11
11
  export * from "./Prose.jsx";
12
+ export * from "./ReferenceOrContent.jsx";
12
13
  export * from "./Scope.js";
13
14
  export * from "./Show.jsx";
14
15
  export * from "./SourceDirectory.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/index.tsx"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,kBAAkB,CAAC;AACjC,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,yBAAyB,CAAC;AACxC,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,sBAAsB,CAAC;AACrC,cAAc,iBAAiB,CAAC;AAChC,cAAc,qBAAqB,CAAC;AACpC,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/index.tsx"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,kBAAkB,CAAC;AACjC,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,yBAAyB,CAAC;AACxC,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,0BAA0B,CAAC;AACzC,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,sBAAsB,CAAC;AACrC,cAAc,iBAAiB,CAAC;AAChC,cAAc,qBAAqB,CAAC;AACpC,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC"}
@@ -9,11 +9,11 @@ export * from "./MemberScope.js";
9
9
  export * from "./Name.js";
10
10
  export * from "./Output.js";
11
11
  export * from "./Prose.js";
12
+ export * from "./ReferenceOrContent.js";
12
13
  export * from "./Scope.js";
13
14
  export * from "./Show.js";
14
15
  export * from "./SourceDirectory.js";
15
16
  export * from "./SourceFile.js";
16
17
  export * from "./StatementList.js";
17
18
  export * from "./Switch.js";
18
- export * from "./Wrap.js";
19
- //# sourceMappingURL=index.js.map
19
+ export * from "./Wrap.js";
@@ -17,5 +17,6 @@ export declare const SourceDirectory: import("../../stc.js").StcSignature<base.S
17
17
  export declare const SourceFile: import("../../stc.js").StcSignature<base.SourceFileProps>;
18
18
  export declare const Switch: import("../../stc.js").StcSignature<base.SwitchProps>;
19
19
  export declare const Wrap: <TProps>(props: Omit<base.WrapProps<TProps>, "children"> & Partial<Pick<base.WrapProps<TProps>, "children">>) => import("../../stc.js").StcComponentCreator<base.WrapProps<TProps>>;
20
+ export declare const ReferenceOrContent: import("../../stc.js").StcSignature<base.ReferenceOrContentProps>;
20
21
  export * from "./sti.js";
21
22
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/stc/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,IAAI,MAAM,aAAa,CAAC;AAEpC,eAAO,MAAM,KAAK,sDAAkB,CAAC;AACrC,eAAO,MAAM,WAAW,4DAAwB,CAAC;AACjD,eAAO,MAAM,GAAG,0WAAgB,CAAC;AACjC,eAAO,MAAM,MAAM,uDAAmB,CAAC;AACvC,eAAO,MAAM,IAAI,qDAAiB,CAAC;AACnC,eAAO,MAAM,iBAAiB,kEAA8B,CAAC;AAC7D,eAAO,MAAM,UAAU,yCAAuB,CAAC;AAC/C,eAAO,MAAM,WAAW,4DAAwB,CAAC;AACjD,eAAO,MAAM,IAAI,yCAAiB,CAAC;AACnC,eAAO,MAAM,MAAM,uDAAmB,CAAC;AACvC,eAAO,MAAM,KAAK,iDAAkB,CAAC;AACrC,eAAO,MAAM,KAAK,sDAAkB,CAAC;AACrC,eAAO,MAAM,IAAI,qDAAiB,CAAC;AACnC,eAAO,MAAM,aAAa,8DAA0B,CAAC;AACrD,eAAO,MAAM,eAAe,gEAA4B,CAAC;AACzD,eAAO,MAAM,UAAU,2DAAuB,CAAC;AAC/C,eAAO,MAAM,MAAM,uDAAmB,CAAC;AACvC,eAAO,MAAM,IAAI,qLAAiB,CAAC;AAEnC,cAAc,UAAU,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/stc/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,IAAI,MAAM,aAAa,CAAC;AAEpC,eAAO,MAAM,KAAK,sDAAkB,CAAC;AACrC,eAAO,MAAM,WAAW,4DAAwB,CAAC;AACjD,eAAO,MAAM,GAAG,0WAAgB,CAAC;AACjC,eAAO,MAAM,MAAM,uDAAmB,CAAC;AACvC,eAAO,MAAM,IAAI,qDAAiB,CAAC;AACnC,eAAO,MAAM,iBAAiB,kEAA8B,CAAC;AAC7D,eAAO,MAAM,UAAU,yCAAuB,CAAC;AAC/C,eAAO,MAAM,WAAW,4DAAwB,CAAC;AACjD,eAAO,MAAM,IAAI,yCAAiB,CAAC;AACnC,eAAO,MAAM,MAAM,uDAAmB,CAAC;AACvC,eAAO,MAAM,KAAK,iDAAkB,CAAC;AACrC,eAAO,MAAM,KAAK,sDAAkB,CAAC;AACrC,eAAO,MAAM,IAAI,qDAAiB,CAAC;AACnC,eAAO,MAAM,aAAa,8DAA0B,CAAC;AACrD,eAAO,MAAM,eAAe,gEAA4B,CAAC;AACzD,eAAO,MAAM,UAAU,2DAAuB,CAAC;AAC/C,eAAO,MAAM,MAAM,uDAAmB,CAAC;AACvC,eAAO,MAAM,IAAI,qLAAiB,CAAC;AACnC,eAAO,MAAM,kBAAkB,mEAA+B,CAAC;AAE/D,cAAc,UAAU,CAAC"}
@@ -18,5 +18,5 @@ export const SourceDirectory = stc(base.SourceDirectory);
18
18
  export const SourceFile = stc(base.SourceFile);
19
19
  export const Switch = stc(base.Switch);
20
20
  export const Wrap = stc(base.Wrap);
21
- export * from "./sti.js";
22
- //# sourceMappingURL=index.js.map
21
+ export const ReferenceOrContent = stc(base.ReferenceOrContent);
22
+ export * from "./sti.js";
@@ -6,5 +6,4 @@ export const hbr = sti("hbr");
6
6
  export const sbr = sti("sbr");
7
7
  export const lbr = sti("lbr");
8
8
  export const br = sti("br");
9
- export const dedentToRoot = sti("dedentToRoot");
10
- //# sourceMappingURL=sti.js.map
9
+ export const dedentToRoot = sti("dedentToRoot");
@@ -42,5 +42,4 @@ export function getAssignmentSymbol() {
42
42
  return assignmentContext.target;
43
43
  }
44
44
  return undefined;
45
- }
46
- //# sourceMappingURL=assignment.js.map
45
+ }
@@ -8,5 +8,4 @@ import { createNamedContext, useContext } from "../context.js";
8
8
  export const BinderContext = createNamedContext("Binder");
9
9
  export function useBinder() {
10
10
  return useContext(BinderContext);
11
- }
12
- //# sourceMappingURL=binder.js.map
11
+ }
@@ -1,3 +1,2 @@
1
1
  import { createNamedContext } from "../context.js";
2
- export const DeclarationContext = createNamedContext("Declaration");
3
- //# sourceMappingURL=declaration.js.map
2
+ export const DeclarationContext = createNamedContext("Declaration");
@@ -6,5 +6,4 @@ export * from "./member-scope.js";
6
6
  export * from "./name-policy.js";
7
7
  export * from "./scope.js";
8
8
  export * from "./source-directory.js";
9
- export * from "./source-file.js";
10
- //# sourceMappingURL=index.js.map
9
+ export * from "./source-file.js";
@@ -8,5 +8,4 @@ import { createNamedContext, useContext } from "../context.js";
8
8
  export const MemberDeclarationContext = createNamedContext("MemberDeclaration");
9
9
  export function useMemberDeclaration() {
10
10
  return useContext(MemberDeclarationContext);
11
- }
12
- //# sourceMappingURL=member-declaration.js.map
11
+ }
@@ -8,5 +8,4 @@ import { createNamedContext, useContext } from "../context.js";
8
8
  export const MemberScopeContext = createNamedContext("MemberScope");
9
9
  export function useMemberScope() {
10
10
  return useContext(MemberScopeContext);
11
- }
12
- //# sourceMappingURL=member-scope.js.map
11
+ }
@@ -6,5 +6,4 @@ export const NamePolicyContext = createNamedContext("NamePolicy", {
6
6
  });
7
7
  export function useNamePolicy() {
8
8
  return useContext(NamePolicyContext);
9
- }
10
- //# sourceMappingURL=name-policy.js.map
9
+ }
@@ -2,5 +2,4 @@ import { createNamedContext, useContext } from "../context.js";
2
2
  export const ScopeContext = createNamedContext("Scope");
3
3
  export function useScope() {
4
4
  return useContext(ScopeContext);
5
- }
6
- //# sourceMappingURL=scope.js.map
5
+ }
@@ -1,3 +1,2 @@
1
1
  import { createNamedContext } from "../context.js";
2
- export const SourceDirectoryContext = createNamedContext("SourceDirectory");
3
- //# sourceMappingURL=source-directory.js.map
2
+ export const SourceDirectoryContext = createNamedContext("SourceDirectory");
@@ -1,3 +1,2 @@
1
1
  import { createNamedContext } from "../context.js";
2
- export const SourceFileContext = createNamedContext("SourceFile");
3
- //# sourceMappingURL=source-file.js.map
2
+ export const SourceFileContext = createNamedContext("SourceFile");
@@ -36,5 +36,4 @@ export function createContext(defaultValue, name) {
36
36
  }
37
37
  export function createNamedContext(name, defaultValue) {
38
38
  return createContext(defaultValue, name);
39
- }
40
- //# sourceMappingURL=context.js.map
39
+ }
package/dist/src/debug.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { isReactive } from "@vue/reactivity";
2
- import { Chalk } from "chalk";
3
2
  import Table from "cli-table3";
3
+ import pc from "picocolors";
4
4
  import { contextsByKey } from "./context.js";
5
5
  import { getContext } from "./jsx-runtime.js";
6
6
  const debug = {
@@ -32,11 +32,11 @@ function debugStack() {
32
32
  table.push([{
33
33
  hAlign: "right",
34
34
  content: "props"
35
- }, props && Object.keys(props).length > 0 ? dumpValue(props) : chalk.gray("(none)")]);
35
+ }, props && Object.keys(props).length > 0 ? dumpValue(props) : pc.gray("(none)")]);
36
36
  table.push([{
37
37
  hAlign: "right",
38
38
  content: "contexts"
39
- }, foundContexts.length > 0 ? foundContexts.map(c => printContext(c, true)).join("\n") : chalk.gray("(none)")]);
39
+ }, foundContexts.length > 0 ? foundContexts.map(c => printContext(c, true)).join("\n") : pc.gray("(none)")]);
40
40
  process.stdout.write(table.toString() + "\n\n");
41
41
  foundContexts = [];
42
42
  }
@@ -73,38 +73,37 @@ function findContextOwner(context) {
73
73
  return currentContext?.componentOwner?.component.name ?? "unknown";
74
74
  }
75
75
  globalThis.debug = debug;
76
- const chalk = new Chalk();
77
76
  const style = {
78
77
  value: {
79
78
  primitive(value) {
80
79
  switch (typeof value) {
81
80
  case "string":
82
- return chalk.blue(`"${value}"`);
81
+ return pc.blue(`"${value}"`);
83
82
  case "object":
84
83
  case "undefined":
85
- return chalk.gray(String(value));
84
+ return pc.gray(String(value));
86
85
  default:
87
- return chalk.blue(String(value));
86
+ return pc.blue(String(value));
88
87
  }
89
88
  },
90
89
  symbol(value) {
91
- return chalk.gray(String(value));
90
+ return pc.gray(String(value));
92
91
  }
93
92
  },
94
93
  context: {
95
94
  name(name) {
96
- return chalk.bgGray(` ${chalk.white(name)} `);
95
+ return pc.bgBlack(` ${pc.white(name)} `);
97
96
  }
98
97
  },
99
98
  component: {
100
99
  name(name) {
101
- return chalk.bgBlue(` <${chalk.white(name)}> `);
100
+ return pc.bgBlue(` <${pc.white(name)}> `);
102
101
  }
103
102
  }
104
103
  };
105
104
  function reactiveTag(value) {
106
105
  if (isReactive(value)) {
107
- return " " + chalk.greenBright(`reactive`) + " ";
106
+ return " " + pc.greenBright(`reactive`) + " ";
108
107
  }
109
108
  return "";
110
109
  }
@@ -120,7 +119,7 @@ function dumpValue(value, level = 0) {
120
119
  if (value === null) {
121
120
  return style.value.primitive(null) + reactiveTag(value);
122
121
  } else {
123
- if (level > 0) return chalk.gray(`{ ... }` + reactiveTag(value));
122
+ if (level > 0) return pc.gray(`{ ... }` + reactiveTag(value));
124
123
  const table = kvTable(" ");
125
124
  for (const [key, propValue] of Object.entries(value)) {
126
125
  table.push([{
@@ -130,7 +129,7 @@ function dumpValue(value, level = 0) {
130
129
  return table.toString();
131
130
  }
132
131
  case "function":
133
- return chalk.gray("ƒ ()");
132
+ return pc.gray("ƒ ()");
134
133
  case "undefined":
135
134
  return style.value.primitive(undefined);
136
135
  }
@@ -159,5 +158,4 @@ function kvTable(sep = " ") {
159
158
  "padding-right": 0
160
159
  }
161
160
  });
162
- }
163
- //# sourceMappingURL=debug.js.map
161
+ }
@@ -1,3 +1,2 @@
1
1
  export * from "./index.js"; // Re-export everything
2
- export { writeOutput } from "./write-output.browser.js"; // Override writeOutput for browsers
3
- //# sourceMappingURL=index.browser.js.map
2
+ export { writeOutput } from "./write-output.browser.js"; // Override writeOutput for browsers