@assistant-ui/react-o11y 0.0.3 → 0.0.5

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/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export * as SpanPrimitive from "./primitives/span/index.js";
1
+ export * as SpanPrimitive from "./primitives/span.js";
2
2
  export { SpanResource } from "./resources/SpanResource.js";
3
3
  export type { SpanData } from "./resources/SpanResource.js";
4
4
  export type { SpanItemState, SpanState } from "./o11y-scope.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,aAAa,mCAA0B;AAEnD,OAAO,EAAE,YAAY,EAAE,oCAAiC;AACxD,YAAY,EAAE,QAAQ,EAAE,oCAAiC;AACzD,YAAY,EAAE,aAAa,EAAE,SAAS,EAAE,wBAAqB;AAE7D,OAAO,EAAE,mBAAmB,EAAE,yCAAsC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,aAAa,6BAA0B;AAEnD,OAAO,EAAE,YAAY,EAAE,oCAAiC;AACxD,YAAY,EAAE,QAAQ,EAAE,oCAAiC;AACzD,YAAY,EAAE,aAAa,EAAE,SAAS,EAAE,wBAAqB;AAE7D,OAAO,EAAE,mBAAmB,EAAE,yCAAsC"}
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- export * as SpanPrimitive from "./primitives/span/index.js";
1
+ export * as SpanPrimitive from "./primitives/span.js";
2
2
  export { SpanResource } from "./resources/SpanResource.js";
3
3
  export { SpanByIndexProvider } from "./context/SpanByIndexProvider.js";
4
4
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,aAAa,mCAA0B;AAEnD,OAAO,EAAE,YAAY,EAAE,oCAAiC;AAIxD,OAAO,EAAE,mBAAmB,EAAE,yCAAsC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,aAAa,6BAA0B;AAEnD,OAAO,EAAE,YAAY,EAAE,oCAAiC;AAIxD,OAAO,EAAE,mBAAmB,EAAE,yCAAsC"}
@@ -1,17 +1,27 @@
1
- import { type ComponentType, type FC } from "react";
1
+ import { type ComponentType, type FC, type ReactNode } from "react";
2
+ import type { SpanState } from "../../o11y-scope.js";
3
+ type SpanChildrenComponentConfig = {
4
+ Span: ComponentType;
5
+ };
2
6
  export declare namespace SpanPrimitiveChildren {
3
7
  type Props = {
4
- components: {
5
- Span: ComponentType;
6
- };
8
+ components: SpanChildrenComponentConfig;
9
+ children?: never;
10
+ } | {
11
+ /** Render function called for each child span. Receives the span. */
12
+ children: (value: {
13
+ span: SpanState;
14
+ }) => ReactNode;
15
+ components?: never;
7
16
  };
8
17
  }
9
18
  export declare namespace SpanPrimitiveChildByIndex {
10
19
  type Props = {
11
20
  index: number;
12
- components: SpanPrimitiveChildren.Props["components"];
21
+ components: SpanChildrenComponentConfig;
13
22
  };
14
23
  }
15
24
  export declare const SpanPrimitiveChildByIndex: FC<SpanPrimitiveChildByIndex.Props>;
16
25
  export declare const SpanPrimitiveChildren: FC<SpanPrimitiveChildren.Props>;
26
+ export {};
17
27
  //# sourceMappingURL=SpanChildren.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"SpanChildren.d.ts","sourceRoot":"","sources":["../../../src/primitives/span/SpanChildren.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,aAAa,EAAE,KAAK,EAAE,EAAiB,MAAM,OAAO,CAAC;AAInE,yBAAiB,qBAAqB,CAAC;IACrC,KAAY,KAAK,GAAG;QAClB,UAAU,EAAE;YACV,IAAI,EAAE,aAAa,CAAC;SACrB,CAAC;KACH,CAAC;CACH;AAED,yBAAiB,yBAAyB,CAAC;IACzC,KAAY,KAAK,GAAG;QAClB,KAAK,EAAE,MAAM,CAAC;QACd,UAAU,EAAE,qBAAqB,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;KACvD,CAAC;CACH;AAED,eAAO,MAAM,yBAAyB,EAAE,EAAE,CAAC,yBAAyB,CAAC,KAAK,CAYvE,CAAC;AAuBJ,eAAO,MAAM,qBAAqB,EAAE,EAAE,CAAC,qBAAqB,CAAC,KAAK,CAGjE,CAAC"}
1
+ {"version":3,"file":"SpanChildren.d.ts","sourceRoot":"","sources":["../../../src/primitives/span/SpanChildren.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,EAAE,EACP,KAAK,SAAS,EAGf,MAAM,OAAO,CAAC;AAEf,OAAO,KAAK,EAAE,SAAS,EAAE,4BAAyB;AAGlD,KAAK,2BAA2B,GAAG;IACjC,IAAI,EAAE,aAAa,CAAC;CACrB,CAAC;AAEF,yBAAiB,qBAAqB,CAAC;IACrC,KAAY,KAAK,GACb;QACE,UAAU,EAAE,2BAA2B,CAAC;QACxC,QAAQ,CAAC,EAAE,KAAK,CAAC;KAClB,GACD;QACE,qEAAqE;QACrE,QAAQ,EAAE,CAAC,KAAK,EAAE;YAAE,IAAI,EAAE,SAAS,CAAA;SAAE,KAAK,SAAS,CAAC;QACpD,UAAU,CAAC,EAAE,KAAK,CAAC;KACpB,CAAC;CACP;AAED,yBAAiB,yBAAyB,CAAC;IACzC,KAAY,KAAK,GAAG;QAClB,KAAK,EAAE,MAAM,CAAC;QACd,UAAU,EAAE,2BAA2B,CAAC;KACzC,CAAC;CACH;AAED,eAAO,MAAM,yBAAyB,EAAE,EAAE,CAAC,yBAAyB,CAAC,KAAK,CAYvE,CAAC;AA2CJ,eAAO,MAAM,qBAAqB,EAAE,EAAE,CAAC,qBAAqB,CAAC,KAAK,CAQjE,CAAC"}
@@ -1,21 +1,35 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- import { memo, useMemo } from "react";
3
- import { useAuiState } from "@assistant-ui/store";
2
+ import { memo, useMemo, } from "react";
3
+ import { RenderChildrenWithAccessor, useAuiState } from "@assistant-ui/store";
4
4
  import { SpanByIndexProvider } from "../../context/SpanByIndexProvider.js";
5
5
  export const SpanPrimitiveChildByIndex = memo(({ index, components }) => {
6
6
  return (_jsx(SpanByIndexProvider, { index: index, children: _jsx(components.Span, {}) }));
7
7
  }, (prev, next) => prev.index === next.index &&
8
8
  prev.components.Span === next.components.Span);
9
9
  SpanPrimitiveChildByIndex.displayName = "SpanPrimitive.ChildByIndex";
10
- const SpanPrimitiveChildrenImpl = ({ components, }) => {
10
+ const SpanPrimitiveChildrenInner = ({ children }) => {
11
11
  const childrenLength = useAuiState((s) => s.span.children.length);
12
- const childElements = useMemo(() => {
12
+ return useMemo(() => {
13
13
  if (childrenLength === 0)
14
14
  return null;
15
- return Array.from({ length: childrenLength }, (_, index) => (_jsx(SpanPrimitiveChildByIndex, { index: index, components: components }, index)));
16
- }, [childrenLength, components]);
17
- return childElements;
15
+ return Array.from({ length: childrenLength }, (_, index) => (_jsx(SpanByIndexProvider, { index: index, children: _jsx(RenderChildrenWithAccessor, { getItemState: (aui) => aui.span().getState(), children: (getItem) => children({
16
+ get span() {
17
+ return getItem();
18
+ },
19
+ }) }) }, index)));
20
+ }, [childrenLength, children]);
18
21
  };
19
- export const SpanPrimitiveChildren = memo(SpanPrimitiveChildrenImpl, (prev, next) => prev.components.Span === next.components.Span);
22
+ const SpanPrimitiveChildrenImpl = ({ components, children, }) => {
23
+ if (components) {
24
+ return (_jsx(SpanPrimitiveChildrenInner, { children: () => _jsx(components.Span, {}) }));
25
+ }
26
+ return _jsx(SpanPrimitiveChildrenInner, { children: children });
27
+ };
28
+ export const SpanPrimitiveChildren = memo(SpanPrimitiveChildrenImpl, (prev, next) => {
29
+ if (prev.children || next.children) {
30
+ return prev.children === next.children;
31
+ }
32
+ return prev.components.Span === next.components.Span;
33
+ });
20
34
  SpanPrimitiveChildren.displayName = "SpanPrimitive.Children";
21
35
  //# sourceMappingURL=SpanChildren.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SpanChildren.js","sourceRoot":"","sources":["../../../src/primitives/span/SpanChildren.tsx"],"names":[],"mappings":";AAAA,OAAO,EAA+B,IAAI,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AACnE,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,mBAAmB,EAAE,6CAA0C;AAiBxE,MAAM,CAAC,MAAM,yBAAyB,GACpC,IAAI,CACF,CAAC,EAAE,KAAK,EAAE,UAAU,EAAE,EAAE,EAAE;IACxB,OAAO,CACL,KAAC,mBAAmB,IAAC,KAAK,EAAE,KAAK,YAC/B,KAAC,UAAU,CAAC,IAAI,KAAG,GACC,CACvB,CAAC;AACJ,CAAC,EACD,CAAC,IAAI,EAAE,IAAI,EAAE,EAAE,CACb,IAAI,CAAC,KAAK,KAAK,IAAI,CAAC,KAAK;IACzB,IAAI,CAAC,UAAU,CAAC,IAAI,KAAK,IAAI,CAAC,UAAU,CAAC,IAAI,CAChD,CAAC;AAEJ,yBAAyB,CAAC,WAAW,GAAG,4BAA4B,CAAC;AAErE,MAAM,yBAAyB,GAAoC,CAAC,EAClE,UAAU,GACX,EAAE,EAAE;IACH,MAAM,cAAc,GAAG,WAAW,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;IAElE,MAAM,aAAa,GAAG,OAAO,CAAC,GAAG,EAAE;QACjC,IAAI,cAAc,KAAK,CAAC;YAAE,OAAO,IAAI,CAAC;QACtC,OAAO,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,cAAc,EAAE,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,CAAC,CAC1D,KAAC,yBAAyB,IAExB,KAAK,EAAE,KAAK,EACZ,UAAU,EAAE,UAAU,IA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AI,CAAC;AACzD,CAAC,CACF,CAAC;AAEF,qBAAqB,CAAC,WAAW,GAAG,wBAAwB,CAAC"}
@@ -0,0 +1,8 @@
1
+ export { SpanPrimitiveRoot as Root } from "./span/SpanRoot.js";
2
+ export { SpanPrimitiveName as Name } from "./span/SpanName.js";
3
+ export { SpanPrimitiveTypeBadge as TypeBadge } from "./span/SpanTypeBadge.js";
4
+ export { SpanPrimitiveStatusIndicator as StatusIndicator } from "./span/SpanStatusIndicator.js";
5
+ export { SpanPrimitiveCollapseToggle as CollapseToggle } from "./span/SpanCollapseToggle.js";
6
+ export { SpanPrimitiveIndent as Indent } from "./span/SpanIndent.js";
7
+ export { SpanPrimitiveChildren as Children } from "./span/SpanChildren.js";
8
+ //# sourceMappingURL=span.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"span.d.ts","sourceRoot":"","sources":["../../src/primitives/span.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,IAAI,IAAI,EAAE,2BAAwB;AAC5D,OAAO,EAAE,iBAAiB,IAAI,IAAI,EAAE,2BAAwB;AAC5D,OAAO,EAAE,sBAAsB,IAAI,SAAS,EAAE,gCAA6B;AAC3E,OAAO,EAAE,4BAA4B,IAAI,eAAe,EAAE,sCAAmC;AAC7F,OAAO,EAAE,2BAA2B,IAAI,cAAc,EAAE,qCAAkC;AAC1F,OAAO,EAAE,mBAAmB,IAAI,MAAM,EAAE,6BAA0B;AAClE,OAAO,EAAE,qBAAqB,IAAI,QAAQ,EAAE,+BAA4B"}
@@ -0,0 +1,8 @@
1
+ export { SpanPrimitiveRoot as Root } from "./span/SpanRoot.js";
2
+ export { SpanPrimitiveName as Name } from "./span/SpanName.js";
3
+ export { SpanPrimitiveTypeBadge as TypeBadge } from "./span/SpanTypeBadge.js";
4
+ export { SpanPrimitiveStatusIndicator as StatusIndicator } from "./span/SpanStatusIndicator.js";
5
+ export { SpanPrimitiveCollapseToggle as CollapseToggle } from "./span/SpanCollapseToggle.js";
6
+ export { SpanPrimitiveIndent as Indent } from "./span/SpanIndent.js";
7
+ export { SpanPrimitiveChildren as Children } from "./span/SpanChildren.js";
8
+ //# sourceMappingURL=span.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"span.js","sourceRoot":"","sources":["../../src/primitives/span.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,IAAI,IAAI,EAAE,2BAAwB;AAC5D,OAAO,EAAE,iBAAiB,IAAI,IAAI,EAAE,2BAAwB;AAC5D,OAAO,EAAE,sBAAsB,IAAI,SAAS,EAAE,gCAA6B;AAC3E,OAAO,EAAE,4BAA4B,IAAI,eAAe,EAAE,sCAAmC;AAC7F,OAAO,EAAE,2BAA2B,IAAI,cAAc,EAAE,qCAAkC;AAC1F,OAAO,EAAE,mBAAmB,IAAI,MAAM,EAAE,6BAA0B;AAClE,OAAO,EAAE,qBAAqB,IAAI,QAAQ,EAAE,+BAA4B"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@assistant-ui/react-o11y",
3
- "version": "0.0.3",
3
+ "version": "0.0.5",
4
4
  "description": "Observability primitives for @assistant-ui",
5
5
  "keywords": [
6
6
  "observability",
@@ -30,8 +30,8 @@
30
30
  "sideEffects": false,
31
31
  "dependencies": {
32
32
  "@radix-ui/react-primitive": "^2.1.4",
33
- "@assistant-ui/store": "0.2.2",
34
- "@assistant-ui/tap": "0.5.2"
33
+ "@assistant-ui/store": "0.2.3",
34
+ "@assistant-ui/tap": "0.5.3"
35
35
  },
36
36
  "peerDependencies": {
37
37
  "@types/react": "*",
@@ -45,7 +45,7 @@
45
45
  "devDependencies": {
46
46
  "@types/react": "^19.2.14",
47
47
  "react": "^19.2.4",
48
- "@assistant-ui/x-buildutils": "0.0.1"
48
+ "@assistant-ui/x-buildutils": "0.0.3"
49
49
  },
50
50
  "publishConfig": {
51
51
  "access": "public",
@@ -1,19 +1,35 @@
1
- import { type ComponentType, type FC, memo, useMemo } from "react";
2
- import { useAuiState } from "@assistant-ui/store";
1
+ import {
2
+ type ComponentType,
3
+ type FC,
4
+ type ReactNode,
5
+ memo,
6
+ useMemo,
7
+ } from "react";
8
+ import { RenderChildrenWithAccessor, useAuiState } from "@assistant-ui/store";
9
+ import type { SpanState } from "../../o11y-scope";
3
10
  import { SpanByIndexProvider } from "../../context/SpanByIndexProvider";
4
11
 
12
+ type SpanChildrenComponentConfig = {
13
+ Span: ComponentType;
14
+ };
15
+
5
16
  export namespace SpanPrimitiveChildren {
6
- export type Props = {
7
- components: {
8
- Span: ComponentType;
9
- };
10
- };
17
+ export type Props =
18
+ | {
19
+ components: SpanChildrenComponentConfig;
20
+ children?: never;
21
+ }
22
+ | {
23
+ /** Render function called for each child span. Receives the span. */
24
+ children: (value: { span: SpanState }) => ReactNode;
25
+ components?: never;
26
+ };
11
27
  }
12
28
 
13
29
  export namespace SpanPrimitiveChildByIndex {
14
30
  export type Props = {
15
31
  index: number;
16
- components: SpanPrimitiveChildren.Props["components"];
32
+ components: SpanChildrenComponentConfig;
17
33
  };
18
34
  }
19
35
 
@@ -33,28 +49,53 @@ export const SpanPrimitiveChildByIndex: FC<SpanPrimitiveChildByIndex.Props> =
33
49
 
34
50
  SpanPrimitiveChildByIndex.displayName = "SpanPrimitive.ChildByIndex";
35
51
 
36
- const SpanPrimitiveChildrenImpl: FC<SpanPrimitiveChildren.Props> = ({
37
- components,
38
- }) => {
52
+ const SpanPrimitiveChildrenInner: FC<{
53
+ children: (value: { span: SpanState }) => ReactNode;
54
+ }> = ({ children }) => {
39
55
  const childrenLength = useAuiState((s) => s.span.children.length);
40
56
 
41
- const childElements = useMemo(() => {
57
+ return useMemo(() => {
42
58
  if (childrenLength === 0) return null;
43
59
  return Array.from({ length: childrenLength }, (_, index) => (
44
- <SpanPrimitiveChildByIndex
45
- key={index}
46
- index={index}
47
- components={components}
48
- />
60
+ <SpanByIndexProvider key={index} index={index}>
61
+ <RenderChildrenWithAccessor
62
+ getItemState={(aui) => aui.span().getState()}
63
+ >
64
+ {(getItem) =>
65
+ children({
66
+ get span() {
67
+ return getItem();
68
+ },
69
+ })
70
+ }
71
+ </RenderChildrenWithAccessor>
72
+ </SpanByIndexProvider>
49
73
  ));
50
- }, [childrenLength, components]);
74
+ }, [childrenLength, children]);
75
+ };
51
76
 
52
- return childElements;
77
+ const SpanPrimitiveChildrenImpl: FC<SpanPrimitiveChildren.Props> = ({
78
+ components,
79
+ children,
80
+ }) => {
81
+ if (components) {
82
+ return (
83
+ <SpanPrimitiveChildrenInner>
84
+ {() => <components.Span />}
85
+ </SpanPrimitiveChildrenInner>
86
+ );
87
+ }
88
+ return <SpanPrimitiveChildrenInner>{children}</SpanPrimitiveChildrenInner>;
53
89
  };
54
90
 
55
91
  export const SpanPrimitiveChildren: FC<SpanPrimitiveChildren.Props> = memo(
56
92
  SpanPrimitiveChildrenImpl,
57
- (prev, next) => prev.components.Span === next.components.Span,
93
+ (prev, next) => {
94
+ if (prev.children || next.children) {
95
+ return prev.children === next.children;
96
+ }
97
+ return prev.components!.Span === next.components!.Span;
98
+ },
58
99
  );
59
100
 
60
101
  SpanPrimitiveChildren.displayName = "SpanPrimitive.Children";
@@ -0,0 +1,7 @@
1
+ export { SpanPrimitiveRoot as Root } from "./span/SpanRoot";
2
+ export { SpanPrimitiveName as Name } from "./span/SpanName";
3
+ export { SpanPrimitiveTypeBadge as TypeBadge } from "./span/SpanTypeBadge";
4
+ export { SpanPrimitiveStatusIndicator as StatusIndicator } from "./span/SpanStatusIndicator";
5
+ export { SpanPrimitiveCollapseToggle as CollapseToggle } from "./span/SpanCollapseToggle";
6
+ export { SpanPrimitiveIndent as Indent } from "./span/SpanIndent";
7
+ export { SpanPrimitiveChildren as Children } from "./span/SpanChildren";
@@ -1,8 +0,0 @@
1
- export { SpanPrimitiveRoot as Root } from "./SpanRoot.js";
2
- export { SpanPrimitiveName as Name } from "./SpanName.js";
3
- export { SpanPrimitiveTypeBadge as TypeBadge } from "./SpanTypeBadge.js";
4
- export { SpanPrimitiveStatusIndicator as StatusIndicator } from "./SpanStatusIndicator.js";
5
- export { SpanPrimitiveCollapseToggle as CollapseToggle } from "./SpanCollapseToggle.js";
6
- export { SpanPrimitiveIndent as Indent } from "./SpanIndent.js";
7
- export { SpanPrimitiveChildren as Children } from "./SpanChildren.js";
8
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/primitives/span/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,IAAI,IAAI,EAAE,sBAAmB;AACvD,OAAO,EAAE,iBAAiB,IAAI,IAAI,EAAE,sBAAmB;AACvD,OAAO,EAAE,sBAAsB,IAAI,SAAS,EAAE,2BAAwB;AACtE,OAAO,EAAE,4BAA4B,IAAI,eAAe,EAAE,iCAA8B;AACxF,OAAO,EAAE,2BAA2B,IAAI,cAAc,EAAE,gCAA6B;AACrF,OAAO,EAAE,mBAAmB,IAAI,MAAM,EAAE,wBAAqB;AAC7D,OAAO,EAAE,qBAAqB,IAAI,QAAQ,EAAE,0BAAuB"}
@@ -1,8 +0,0 @@
1
- export { SpanPrimitiveRoot as Root } from "./SpanRoot.js";
2
- export { SpanPrimitiveName as Name } from "./SpanName.js";
3
- export { SpanPrimitiveTypeBadge as TypeBadge } from "./SpanTypeBadge.js";
4
- export { SpanPrimitiveStatusIndicator as StatusIndicator } from "./SpanStatusIndicator.js";
5
- export { SpanPrimitiveCollapseToggle as CollapseToggle } from "./SpanCollapseToggle.js";
6
- export { SpanPrimitiveIndent as Indent } from "./SpanIndent.js";
7
- export { SpanPrimitiveChildren as Children } from "./SpanChildren.js";
8
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/primitives/span/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,IAAI,IAAI,EAAE,sBAAmB;AACvD,OAAO,EAAE,iBAAiB,IAAI,IAAI,EAAE,sBAAmB;AACvD,OAAO,EAAE,sBAAsB,IAAI,SAAS,EAAE,2BAAwB;AACtE,OAAO,EAAE,4BAA4B,IAAI,eAAe,EAAE,iCAA8B;AACxF,OAAO,EAAE,2BAA2B,IAAI,cAAc,EAAE,gCAA6B;AACrF,OAAO,EAAE,mBAAmB,IAAI,MAAM,EAAE,wBAAqB;AAC7D,OAAO,EAAE,qBAAqB,IAAI,QAAQ,EAAE,0BAAuB"}
@@ -1,7 +0,0 @@
1
- export { SpanPrimitiveRoot as Root } from "./SpanRoot";
2
- export { SpanPrimitiveName as Name } from "./SpanName";
3
- export { SpanPrimitiveTypeBadge as TypeBadge } from "./SpanTypeBadge";
4
- export { SpanPrimitiveStatusIndicator as StatusIndicator } from "./SpanStatusIndicator";
5
- export { SpanPrimitiveCollapseToggle as CollapseToggle } from "./SpanCollapseToggle";
6
- export { SpanPrimitiveIndent as Indent } from "./SpanIndent";
7
- export { SpanPrimitiveChildren as Children } from "./SpanChildren";