@assistant-ui/react-o11y 0.0.45 → 0.0.46
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/LICENSE +1 -1
- package/dist/context/SpanByIndexProvider.d.ts +2 -4
- package/dist/context/SpanByIndexProvider.d.ts.map +1 -1
- package/dist/context/SpanByIndexProvider.js.map +1 -1
- package/dist/index.d.ts +6 -5
- package/dist/index.d.ts.map +1 -0
- package/dist/o11y-scope.d.ts +32 -33
- package/dist/o11y-scope.d.ts.map +1 -1
- package/dist/primitives/span/SpanChildren.d.ts +18 -19
- package/dist/primitives/span/SpanChildren.d.ts.map +1 -1
- package/dist/primitives/span/SpanChildren.js +1 -1
- package/dist/primitives/span/SpanChildren.js.map +1 -1
- package/dist/primitives/span/SpanCollapseToggle.d.ts +4 -6
- package/dist/primitives/span/SpanCollapseToggle.d.ts.map +1 -1
- package/dist/primitives/span/SpanCollapseToggle.js +2 -2
- package/dist/primitives/span/SpanCollapseToggle.js.map +1 -1
- package/dist/primitives/span/SpanIndent.d.ts +9 -11
- package/dist/primitives/span/SpanIndent.d.ts.map +1 -1
- package/dist/primitives/span/SpanIndent.js +2 -2
- package/dist/primitives/span/SpanIndent.js.map +1 -1
- package/dist/primitives/span/SpanName.d.ts +4 -6
- package/dist/primitives/span/SpanName.d.ts.map +1 -1
- package/dist/primitives/span/SpanName.js +2 -2
- package/dist/primitives/span/SpanName.js.map +1 -1
- package/dist/primitives/span/SpanRoot.d.ts +4 -6
- package/dist/primitives/span/SpanRoot.d.ts.map +1 -1
- package/dist/primitives/span/SpanRoot.js +2 -2
- package/dist/primitives/span/SpanRoot.js.map +1 -1
- package/dist/primitives/span/SpanStatusIndicator.d.ts +4 -6
- package/dist/primitives/span/SpanStatusIndicator.d.ts.map +1 -1
- package/dist/primitives/span/SpanStatusIndicator.js +2 -2
- package/dist/primitives/span/SpanStatusIndicator.js.map +1 -1
- package/dist/primitives/span/SpanTimeline.d.ts +29 -31
- package/dist/primitives/span/SpanTimeline.d.ts.map +1 -1
- package/dist/primitives/span/SpanTimeline.js +2 -2
- package/dist/primitives/span/SpanTimeline.js.map +1 -1
- package/dist/primitives/span/SpanTypeBadge.d.ts +4 -6
- package/dist/primitives/span/SpanTypeBadge.d.ts.map +1 -1
- package/dist/primitives/span/SpanTypeBadge.js +2 -2
- package/dist/primitives/span/SpanTypeBadge.js.map +1 -1
- package/dist/primitives/span.d.ts +9 -13
- package/dist/primitives/span.d.ts.map +1 -1
- package/dist/resources/SpanResource.d.ts +10 -12
- package/dist/resources/SpanResource.d.ts.map +1 -1
- package/dist/resources/SpanResource.js +1 -1
- package/dist/resources/SpanResource.js.map +1 -1
- package/package.json +9 -6
package/LICENSE
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import { FC, PropsWithChildren } from "react";
|
|
2
|
-
//#region src/context/SpanByIndexProvider.d.ts
|
|
1
|
+
import type { FC, PropsWithChildren } from "react";
|
|
3
2
|
export declare const SpanByIndexProvider: FC<PropsWithChildren<{
|
|
4
|
-
|
|
3
|
+
index: number;
|
|
5
4
|
}>>;
|
|
6
|
-
//#endregion
|
|
7
5
|
//# sourceMappingURL=SpanByIndexProvider.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SpanByIndexProvider.d.ts","
|
|
1
|
+
{"version":3,"file":"SpanByIndexProvider.d.ts","sourceRoot":"","sources":["../../src/context/SpanByIndexProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAGnD,eAAO,MAAM,mBAAmB,EAAE,EAAE,CAAC,iBAAiB,CAAC;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC,CAkBxE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SpanByIndexProvider.js","names":["FC","PropsWithChildren","useAui","AuiConfig","AuiProvider","Derived","SpanByIndexProvider","index","t0","$","_c","children","parentAui","t1","span","source","query","get","child","config","t2"],"sources":["../../src/context/SpanByIndexProvider.tsx"],"sourcesContent":["import type { FC, PropsWithChildren } from \"react\";\nimport { useAui, AuiConfig, AuiProvider, Derived } from \"@assistant-ui/store\";\n\nexport const SpanByIndexProvider: FC<PropsWithChildren<{ index: number }>> = ({\n index,\n children,\n}) => {\n const parentAui = useAui();\n\n const config = AuiConfig({\n span: Derived({\n source: \"span\",\n query: { index },\n get: () => parentAui.span.child({ index }),\n }),\n });\n return (\n <AuiProvider extends={parentAui} config={config}>\n {children}\n </AuiProvider>\n );\n};\n"],"mappings":";;;;AAGA,MAAaM,uBAAgEE,OAAA;CAAA,MAAAC,IAAAC,EAAA,CAAA;CAAC,MAAA,EAAAH,OAAAI,aAAAH;CAI5E,MAAAI,YAAkBV,OAAO;CAAE,IAAAW;CAAA,IAAAJ,EAAA,OAAAF,SAAAE,EAAA,OAAAG,WAAA;EAEZC,KAAAV,UAAU,EAAAW,MACjBT,QAAQ;GAAAU,QACJ;GAAMC,OACP,EAAAT,MAAQ;GAACU,WACLL,UAASE,KAAKI,MAAO,EAAAX,MAAQ,CAAC;EAC3C,CAAC,EACH,CAAC;EAACE,EAAA,KAAAF;EAAAE,EAAA,KAAAG;EAAAH,EAAA,KAAAI;CAAA,OAAAA,KAAAJ,EAAA;CANF,MAAAU,SAAeN;CAMZ,IAAAO;CAAA,IAAAX,EAAA,OAAAE,YAAAF,EAAA,OAAAU,UAAAV,EAAA,OAAAG,WAAA;EAEDQ,KAAA,oBAAC,aAAD;GAAsBR,SAAAA;GAAmBO;GACtCR;EADS,CAAA;EAEEF,EAAA,KAAAE;EAAAF,EAAA,KAAAU;EAAAV,EAAA,KAAAG;EAAAH,EAAA,KAAAW;CAAA,OAAAA,KAAAX,EAAA;CAAA,OAFdW;AAEc"}
|
|
1
|
+
{"version":3,"file":"SpanByIndexProvider.js","names":["FC","PropsWithChildren","useAui","AuiConfig","AuiProvider","Derived","SpanByIndexProvider","index","t0","$","_c","children","parentAui","t1","span","source","query","get","child","config","t2","_c"],"sources":["../../src/context/SpanByIndexProvider.tsx"],"sourcesContent":["import type { FC, PropsWithChildren } from \"react\";\nimport { useAui, AuiConfig, AuiProvider, Derived } from \"@assistant-ui/store\";\n\nexport const SpanByIndexProvider: FC<PropsWithChildren<{ index: number }>> = ({\n index,\n children,\n}) => {\n const parentAui = useAui();\n\n const config = AuiConfig({\n span: Derived({\n source: \"span\",\n query: { index },\n get: () => parentAui.span.child({ index }),\n }),\n });\n return (\n <AuiProvider extends={parentAui} config={config}>\n {children}\n </AuiProvider>\n );\n};\n"],"mappings":";;;;AAGA,MAAaM,uBAAgEE,OAAA;CAAA,MAAAC,IAAAC,EAAA,CAAA;CAAC,MAAA,EAAAH,OAAAI,aAAAH;CAI5E,MAAAI,YAAkBV,OAAO;CAAE,IAAAW;CAAA,IAAAJ,EAAA,OAAAF,SAAAE,EAAA,OAAAG,WAAA;EAEZC,KAAAV,UAAU,EAAAW,MACjBT,QAAQ;GAAAU,QACJ;GAAMC,OACP,EAAAT,MAAQ;GAACU,WACLL,UAASE,KAAKI,MAAO,EAAAX,MAAQ,CAAC;EAC3C,CAAC,EACH,CAAC;EAACE,EAAA,KAAAF;EAAAE,EAAA,KAAAG;EAAAH,EAAA,KAAAI;CAAA,OAAAA,KAAAJ,EAAA;CANF,MAAAU,SAAeN;CAMZ,IAAAO;CAAA,IAAAX,EAAA,OAAAE,YAAAF,EAAA,OAAAU,UAAAV,EAAA,OAAAG,WAAA;EAEDQ,KAAA,oBAAC,aAAD;GAAsBR,SAAAA;GAAmBO;GACtCR;EADS,CAAA;EAEEF,EAAA,KAAAE;EAAAF,EAAA,KAAAU;EAAAV,EAAA,KAAAG;EAAAH,EAAA,KAAAW;CAAA,OAAAA,KAAAX,EAAA;CAAA,OAFdW;AAEc"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
export { SpanByIndexProvider
|
|
1
|
+
export * as SpanPrimitive from "./primitives/span.js";
|
|
2
|
+
export { SpanResource } from "./resources/SpanResource.js";
|
|
3
|
+
export type { SpanData } from "./resources/SpanResource.js";
|
|
4
|
+
export type { SpanItemState, SpanState } from "./o11y-scope.js";
|
|
5
|
+
export { SpanByIndexProvider } from "./context/SpanByIndexProvider.js";
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
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/o11y-scope.d.ts
CHANGED
|
@@ -1,45 +1,44 @@
|
|
|
1
1
|
import "@assistant-ui/store";
|
|
2
|
-
//#region src/o11y-scope.d.ts
|
|
3
2
|
export type SpanItemState = {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
3
|
+
id: string;
|
|
4
|
+
parentSpanId: string | null;
|
|
5
|
+
name: string;
|
|
6
|
+
type: string;
|
|
7
|
+
status: "running" | "completed" | "failed" | "skipped";
|
|
8
|
+
startedAt: number;
|
|
9
|
+
endedAt: number | null;
|
|
10
|
+
latencyMs: number | null;
|
|
11
|
+
depth: number;
|
|
12
|
+
hasChildren: boolean;
|
|
13
|
+
isCollapsed: boolean;
|
|
15
14
|
};
|
|
16
15
|
export type SpanState = SpanItemState & {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
16
|
+
children: SpanItemState[];
|
|
17
|
+
timeRange: {
|
|
18
|
+
min: number;
|
|
19
|
+
max: number;
|
|
20
|
+
};
|
|
22
21
|
};
|
|
23
22
|
type SpanMethods = {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
23
|
+
getState: () => SpanState;
|
|
24
|
+
child: (lookup: SpanMeta["query"]) => SpanMethods;
|
|
25
|
+
toggleCollapse: () => void;
|
|
27
26
|
};
|
|
28
27
|
type SpanMeta = {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
28
|
+
source: "span";
|
|
29
|
+
query: {
|
|
30
|
+
index: number;
|
|
31
|
+
} | {
|
|
32
|
+
key: string;
|
|
33
|
+
};
|
|
35
34
|
};
|
|
36
35
|
declare module "@assistant-ui/store" {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
36
|
+
interface ScopeRegistry {
|
|
37
|
+
span: {
|
|
38
|
+
methods: SpanMethods;
|
|
39
|
+
meta: SpanMeta;
|
|
40
|
+
};
|
|
41
|
+
}
|
|
43
42
|
}
|
|
44
|
-
|
|
43
|
+
export {};
|
|
45
44
|
//# sourceMappingURL=o11y-scope.d.ts.map
|
package/dist/o11y-scope.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"o11y-scope.d.ts","
|
|
1
|
+
{"version":3,"file":"o11y-scope.d.ts","sourceRoot":"","sources":["../src/o11y-scope.ts"],"names":[],"mappings":"AAAA,OAAO,qBAAqB,CAAC;AAE7B,MAAM,MAAM,aAAa,GAAG;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,SAAS,GAAG,WAAW,GAAG,QAAQ,GAAG,SAAS,CAAC;IACvD,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,OAAO,CAAC;IACrB,WAAW,EAAE,OAAO,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG,aAAa,GAAG;IACtC,QAAQ,EAAE,aAAa,EAAE,CAAC;IAC1B,SAAS,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,CAAC;CACzC,CAAC;AAEF,KAAK,WAAW,GAAG;IACjB,QAAQ,EAAE,MAAM,SAAS,CAAC;IAC1B,KAAK,EAAE,CAAC,MAAM,EAAE,QAAQ,CAAC,OAAO,CAAC,KAAK,WAAW,CAAC;IAClD,cAAc,EAAE,MAAM,IAAI,CAAC;CAC5B,CAAC;AAEF,KAAK,QAAQ,GAAG;IACd,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,GAAG;QAAE,GAAG,EAAE,MAAM,CAAA;KAAE,CAAC;CAC5C,CAAC;AAEF,OAAO,QAAQ,qBAAqB,CAAC;IACnC,UAAU,aAAa;QACrB,IAAI,EAAE;YACJ,OAAO,EAAE,WAAW,CAAC;YACrB,IAAI,EAAE,QAAQ,CAAC;SAChB,CAAC;KACH;CACF"}
|
|
@@ -1,28 +1,27 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
//#region src/primitives/span/SpanChildren.d.ts
|
|
1
|
+
import { type ComponentType, type FC, type ReactNode } from "react";
|
|
2
|
+
import type { SpanState } from "../../o11y-scope.js";
|
|
4
3
|
type SpanChildrenComponentConfig = {
|
|
5
|
-
|
|
4
|
+
Span: ComponentType;
|
|
6
5
|
};
|
|
7
6
|
export declare namespace SpanPrimitiveChildren {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
7
|
+
type Props = {
|
|
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;
|
|
16
|
+
};
|
|
18
17
|
}
|
|
19
18
|
export declare namespace SpanPrimitiveChildByIndex {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
19
|
+
type Props = {
|
|
20
|
+
index: number;
|
|
21
|
+
components: SpanChildrenComponentConfig;
|
|
22
|
+
};
|
|
24
23
|
}
|
|
25
24
|
export declare const SpanPrimitiveChildByIndex: FC<SpanPrimitiveChildByIndex.Props>;
|
|
26
25
|
export declare const SpanPrimitiveChildren: FC<SpanPrimitiveChildren.Props>;
|
|
27
|
-
|
|
26
|
+
export {};
|
|
28
27
|
//# sourceMappingURL=SpanChildren.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SpanChildren.d.ts","
|
|
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;AAyCJ,eAAO,MAAM,qBAAqB,EAAE,EAAE,CAAC,qBAAqB,CAAC,KAAK,CAQjE,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { SpanByIndexProvider } from "../../context/SpanByIndexProvider.js";
|
|
2
2
|
import { c } from "@assistant-ui/tap/react-shim/compiler-runtime";
|
|
3
|
-
import { memo, useMemo } from "@assistant-ui/tap/react-shim";
|
|
4
3
|
import { RenderChildrenWithAccessor, useAuiState } from "@assistant-ui/store";
|
|
5
4
|
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
import { memo, useMemo } from "@assistant-ui/tap/react-shim";
|
|
6
6
|
//#region src/primitives/span/SpanChildren.tsx
|
|
7
7
|
const SpanPrimitiveChildByIndex = memo((t0) => {
|
|
8
8
|
const $ = c(5);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SpanChildren.js","names":["ComponentType","FC","ReactNode","memo","useMemo","RenderChildrenWithAccessor","useAuiState","SpanState","SpanByIndexProvider","SpanChildrenComponentConfig","Span","SpanPrimitiveChildren","Props","components","children","value","span","SpanPrimitiveChildByIndex","index","t0","$","_c","t1","t2","prev","next","displayName","SpanPrimitiveChildrenInner","childrenLength","s","length","Array","from","_","aui","getState","getItem","SpanPrimitiveChildrenImpl"],"sources":["../../../src/primitives/span/SpanChildren.tsx"],"sourcesContent":["import {\n type ComponentType,\n type FC,\n type ReactNode,\n memo,\n useMemo,\n} from \"react\";\nimport { RenderChildrenWithAccessor, useAuiState } from \"@assistant-ui/store\";\nimport type { SpanState } from \"../../o11y-scope\";\nimport { SpanByIndexProvider } from \"../../context/SpanByIndexProvider\";\n\ntype SpanChildrenComponentConfig = {\n Span: ComponentType;\n};\n\nexport namespace SpanPrimitiveChildren {\n export type Props =\n | {\n components: SpanChildrenComponentConfig;\n children?: never;\n }\n | {\n /** Render function called for each child span. Receives the span. */\n children: (value: { span: SpanState }) => ReactNode;\n components?: never;\n };\n}\n\nexport namespace SpanPrimitiveChildByIndex {\n export type Props = {\n index: number;\n components: SpanChildrenComponentConfig;\n };\n}\n\nexport const SpanPrimitiveChildByIndex: FC<SpanPrimitiveChildByIndex.Props> =\n memo(\n ({ index, components }) => {\n return (\n <SpanByIndexProvider index={index}>\n <components.Span />\n </SpanByIndexProvider>\n );\n },\n (prev, next) =>\n prev.index === next.index &&\n prev.components.Span === next.components.Span,\n );\n\nSpanPrimitiveChildByIndex.displayName = \"SpanPrimitive.ChildByIndex\";\n\nconst SpanPrimitiveChildrenInner: FC<{\n children: (value: { span: SpanState }) => ReactNode;\n}> = ({ children }) => {\n const childrenLength = useAuiState((s) => s.span.children.length);\n\n return useMemo(() => {\n if (childrenLength === 0) return null;\n return Array.from({ length: childrenLength }, (_, index) => (\n <SpanByIndexProvider key={index} index={index}>\n <RenderChildrenWithAccessor getItemState={(aui) => aui.span.getState()}>\n {(getItem) =>\n children({\n get span() {\n return getItem();\n },\n })\n }\n </RenderChildrenWithAccessor>\n </SpanByIndexProvider>\n ));\n }, [childrenLength, children]);\n};\n\nconst SpanPrimitiveChildrenImpl: FC<SpanPrimitiveChildren.Props> = ({\n components,\n children,\n}) => {\n if (components) {\n return (\n <SpanPrimitiveChildrenInner>\n {() => <components.Span />}\n </SpanPrimitiveChildrenInner>\n );\n }\n return <SpanPrimitiveChildrenInner>{children}</SpanPrimitiveChildrenInner>;\n};\n\nexport const SpanPrimitiveChildren: FC<SpanPrimitiveChildren.Props> = memo(\n SpanPrimitiveChildrenImpl,\n (prev, next) => {\n if (prev.children || next.children) {\n return prev.children === next.children;\n }\n return prev.components!.Span === next.components!.Span;\n },\n);\n\nSpanPrimitiveChildren.displayName = \"SpanPrimitive.Children\";\n"],"mappings":";;;;;;AAmCA,MAAaiB,4BACXd,MACEgB,OAAA;CAAA,MAAAC,IAAAC,EAAA,CAAA;CAAC,MAAA,EAAAH,OAAAL,eAAAM;CAAqB,IAAAG;CAAA,IAAAF,EAAA,OAAAP,WAAAH,MAAA;EAGhBY,KAAA,oBAAA,WAAA,MAAA,CAAA,CAAA;EAAmBF,EAAA,KAAAP,WAAAH;EAAAU,EAAA,KAAAE;CAAA,OAAAA,KAAAF,EAAA;CAAA,IAAAG;CAAA,IAAAH,EAAA,OAAAF,SAAAE,EAAA,OAAAE,IAAA;EADrBC,KAAA,oBAAC,qBAAD;GAA4BL;GAC1BI,UAAAA;EADkB,CAAA;EAEEF,EAAA,KAAAF;EAAAE,EAAA,KAAAE;EAAAF,EAAA,KAAAG;CAAA,OAAAA,KAAAH,EAAA;CAAA,OAFtBG;AAEsB,IAGzBC,MAAMC,SACLD,KAAKN,UAAUO,KAAKP,SACpBM,KAAKX,WAAWH,SAASe,KAAKZ,WAAWH,IAC7C;AAEFO,0BAA0BS,cAAc;AAExC,MAAMC,8BAEA,EAAEb,eAAe;CACrB,MAAMc,iBAAiBtB,aAAauB,MAAMA,EAAEb,KAAKF,SAASgB,MAAM;CAEhE,OAAO1B,cAAc;EACnB,IAAIwB,mBAAmB,GAAG,OAAO;EACjC,OAAOG,MAAMC,KAAK,EAAEF,QAAQF,eAAe,IAAIK,GAAGf,UAChD,oBAAC,qBAAD;GAAwCA;GACtC,UAAA,oBAAC,4BAAD;IAA4B,eAAegB,QAAQA,IAAIlB,KAAKmB,SAAS;IACjEC,WAAAA,YACAtB,SAAS,EACP,IAAIE,OAAO;KACT,OAAOoB,QAAQ;IACjB,EACF,CAAC;GAEuB,CAAA;EACT,GAVKlB,KAUL,CACtB;CACH,GAAG,CAACU,gBAAgBd,QAAQ,CAAC;AAC/B;AAEA,MAAMuB,6BAA6DlB,OAAA;CAAA,MAAAC,IAAAC,EAAA,CAAA;CAAC,MAAA,EAAAR,YAAAC,aAAAK;CAIlE,IAAIN,YAAU;EAAA,IAAAS;EAAA,IAAAF,EAAA,OAAAP,WAAAH,MAAA;GAEVY,KAAA,oBAAC,4BAAD,EAAA,gBACS,oBAAA,WAAA,MAAA,CAAA,CAAA,EADkB,CAAA;GAEEF,EAAA,KAAAP,WAAAH;GAAAU,EAAA,KAAAE;EAAA,OAAAA,KAAAF,EAAA;EAAA,OAF7BE;CAE6B;CAEhC,IAAAA;CAAA,IAAAF,EAAA,OAAAN,UAAA;EACMQ,KAAA,oBAAC,4BAAD,EAA6BR,SAAF,CAAA;EAAwCM,EAAA,KAAAN;EAAAM,EAAA,KAAAE;CAAA,OAAAA,KAAAF,EAAA;CAAA,OAAnEE;AAAmE;AAG5E,MAAaX,wBAAyDR,KACpEkC,4BACCb,MAAMC,SAAS;CACd,IAAID,KAAKV,YAAYW,KAAKX,UACxB,OAAOU,KAAKV,aAAaW,KAAKX;CAEhC,OAAOU,KAAKX,WAAYH,SAASe,KAAKZ,WAAYH;AACpD,CACF;AAEAC,sBAAsBe,cAAc"}
|
|
1
|
+
{"version":3,"file":"SpanChildren.js","names":["ComponentType","FC","ReactNode","memo","useMemo","RenderChildrenWithAccessor","useAuiState","SpanState","SpanByIndexProvider","SpanChildrenComponentConfig","Span","SpanPrimitiveChildren","Props","components","children","value","span","SpanPrimitiveChildByIndex","index","t0","$","_c","t1","t2","prev","next","displayName","SpanPrimitiveChildrenInner","childrenLength","s","length","Array","from","_","aui","getState","getItem","SpanPrimitiveChildrenImpl","_c"],"sources":["../../../src/primitives/span/SpanChildren.tsx"],"sourcesContent":["import {\n type ComponentType,\n type FC,\n type ReactNode,\n memo,\n useMemo,\n} from \"react\";\nimport { RenderChildrenWithAccessor, useAuiState } from \"@assistant-ui/store\";\nimport type { SpanState } from \"../../o11y-scope\";\nimport { SpanByIndexProvider } from \"../../context/SpanByIndexProvider\";\n\ntype SpanChildrenComponentConfig = {\n Span: ComponentType;\n};\n\nexport namespace SpanPrimitiveChildren {\n export type Props =\n | {\n components: SpanChildrenComponentConfig;\n children?: never;\n }\n | {\n /** Render function called for each child span. Receives the span. */\n children: (value: { span: SpanState }) => ReactNode;\n components?: never;\n };\n}\n\nexport namespace SpanPrimitiveChildByIndex {\n export type Props = {\n index: number;\n components: SpanChildrenComponentConfig;\n };\n}\n\nexport const SpanPrimitiveChildByIndex: FC<SpanPrimitiveChildByIndex.Props> =\n memo(\n ({ index, components }) => {\n return (\n <SpanByIndexProvider index={index}>\n <components.Span />\n </SpanByIndexProvider>\n );\n },\n (prev, next) =>\n prev.index === next.index &&\n prev.components.Span === next.components.Span,\n );\n\nSpanPrimitiveChildByIndex.displayName = \"SpanPrimitive.ChildByIndex\";\n\nconst SpanPrimitiveChildrenInner: FC<{\n children: (value: { span: SpanState }) => ReactNode;\n}> = ({ children }) => {\n const childrenLength = useAuiState((s) => s.span.children.length);\n\n return useMemo(() => {\n if (childrenLength === 0) return null;\n return Array.from({ length: childrenLength }, (_, index) => (\n <SpanByIndexProvider key={index} index={index}>\n <RenderChildrenWithAccessor getItemState={(aui) => aui.span.getState()}>\n {(getItem) =>\n children({\n get span() {\n return getItem();\n },\n })\n }\n </RenderChildrenWithAccessor>\n </SpanByIndexProvider>\n ));\n }, [childrenLength, children]);\n};\n\nconst SpanPrimitiveChildrenImpl: FC<SpanPrimitiveChildren.Props> = ({\n components,\n children,\n}) => {\n if (components) {\n return (\n <SpanPrimitiveChildrenInner>\n {() => <components.Span />}\n </SpanPrimitiveChildrenInner>\n );\n }\n return <SpanPrimitiveChildrenInner>{children}</SpanPrimitiveChildrenInner>;\n};\n\nexport const SpanPrimitiveChildren: FC<SpanPrimitiveChildren.Props> = memo(\n SpanPrimitiveChildrenImpl,\n (prev, next) => {\n if (prev.children || next.children) {\n return prev.children === next.children;\n }\n return prev.components!.Span === next.components!.Span;\n },\n);\n\nSpanPrimitiveChildren.displayName = \"SpanPrimitive.Children\";\n"],"mappings":";;;;;;AAmCA,MAAaiB,4BACXd,MACEgB,OAAA;CAAA,MAAAC,IAAAC,EAAA,CAAA;CAAC,MAAA,EAAAH,OAAAL,eAAAM;CAAqB,IAAAG;CAAA,IAAAF,EAAA,OAAAP,WAAAH,MAAA;EAGhBY,KAAA,oBAAA,WAAA,MAAA,CAAA,CAAA;EAAmBF,EAAA,KAAAP,WAAAH;EAAAU,EAAA,KAAAE;CAAA,OAAAA,KAAAF,EAAA;CAAA,IAAAG;CAAA,IAAAH,EAAA,OAAAF,SAAAE,EAAA,OAAAE,IAAA;EADrBC,KAAA,oBAAC,qBAAD;GAA4BL;GAC1BI,UAAAA;EADkB,CAAA;EAEEF,EAAA,KAAAF;EAAAE,EAAA,KAAAE;EAAAF,EAAA,KAAAG;CAAA,OAAAA,KAAAH,EAAA;CAAA,OAFtBG;AAEsB,IAGzBC,MAAMC,SACLD,KAAKN,UAAUO,KAAKP,SACpBM,KAAKX,WAAWH,SAASe,KAAKZ,WAAWH,IAC7C;AAEFO,0BAA0BS,cAAc;AAExC,MAAMC,8BAEA,EAAEb,eAAe;CACrB,MAAMc,iBAAiBtB,aAAauB,MAAMA,EAAEb,KAAKF,SAASgB,MAAM;CAEhE,OAAO1B,cAAc;EACnB,IAAIwB,mBAAmB,GAAG,OAAO;EACjC,OAAOG,MAAMC,KAAK,EAAEF,QAAQF,eAAe,IAAIK,GAAGf,UAChD,oBAAC,qBAAD;GAAwCA;GACtC,UAAA,oBAAC,4BAAD;IAA4B,eAAegB,QAAQA,IAAIlB,KAAKmB,SAAS;IACjEC,WAAAA,YACAtB,SAAS,EACP,IAAIE,OAAO;KACT,OAAOoB,QAAQ;IACjB,EACF,CAAC;GAEuB,CAAA;EACT,GAVKlB,KAUL,CACtB;CACH,GAAG,CAACU,gBAAgBd,QAAQ,CAAC;AAC/B;AAEA,MAAMuB,6BAA6DlB,OAAA;CAAA,MAAAC,IAAAC,EAAA,CAAA;CAAC,MAAA,EAAAR,YAAAC,aAAAK;CAIlE,IAAIN,YAAU;EAAA,IAAAS;EAAA,IAAAF,EAAA,OAAAP,WAAAH,MAAA;GAEVY,KAAA,oBAAC,4BAAD,EAAA,gBACS,oBAAA,WAAA,MAAA,CAAA,CAAA,EADkB,CAAA;GAEEF,EAAA,KAAAP,WAAAH;GAAAU,EAAA,KAAAE;EAAA,OAAAA,KAAAF,EAAA;EAAA,OAF7BE;CAE6B;CAEhC,IAAAA;CAAA,IAAAF,EAAA,OAAAN,UAAA;EACMQ,KAAA,oBAAC,4BAAD,EAA6BR,SAAF,CAAA;EAAwCM,EAAA,KAAAN;EAAAM,EAAA,KAAAE;CAAA,OAAAA,KAAAF,EAAA;CAAA,OAAnEE;AAAmE;AAG5E,MAAaX,wBAAyDR,KACpEkC,4BACCb,MAAMC,SAAS;CACd,IAAID,KAAKV,YAAYW,KAAKX,UACxB,OAAOU,KAAKV,aAAaW,KAAKX;CAEhC,OAAOU,KAAKX,WAAYH,SAASe,KAAKZ,WAAYH;AACpD,CACF;AAEAC,sBAAsBe,cAAc"}
|
|
@@ -1,12 +1,10 @@
|
|
|
1
|
-
import { ComponentPropsWithoutRef, ComponentRef } from "react";
|
|
1
|
+
import { type ComponentPropsWithoutRef, type ComponentRef } from "react";
|
|
2
2
|
import { Primitive } from "@radix-ui/react-primitive";
|
|
3
|
-
//#region src/primitives/span/SpanCollapseToggle.d.ts
|
|
4
3
|
export declare namespace SpanPrimitiveCollapseToggle {
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
type Element = ComponentRef<typeof Primitive.button>;
|
|
5
|
+
type Props = ComponentPropsWithoutRef<typeof Primitive.button>;
|
|
7
6
|
}
|
|
8
7
|
export declare const SpanPrimitiveCollapseToggle: import("react").ForwardRefExoticComponent<Omit<import("react").ClassAttributes<HTMLButtonElement> & import("react").ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
9
|
-
|
|
8
|
+
asChild?: boolean;
|
|
10
9
|
}, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
|
|
11
|
-
//#endregion
|
|
12
10
|
//# sourceMappingURL=SpanCollapseToggle.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SpanCollapseToggle.d.ts","
|
|
1
|
+
{"version":3,"file":"SpanCollapseToggle.d.ts","sourceRoot":"","sources":["../../../src/primitives/span/SpanCollapseToggle.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,wBAAwB,EAC7B,KAAK,YAAY,EAElB,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAGtD,yBAAiB,2BAA2B,CAAC;IAC3C,KAAY,OAAO,GAAG,YAAY,CAAC,OAAO,SAAS,CAAC,MAAM,CAAC,CAAC;IAC5D,KAAY,KAAK,GAAG,wBAAwB,CAAC,OAAO,SAAS,CAAC,MAAM,CAAC,CAAC;CACvE;AAED,eAAO,MAAM,2BAA2B;;6DAuBtC,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { c } from "@assistant-ui/tap/react-shim/compiler-runtime";
|
|
2
|
-
import { forwardRef } from "@assistant-ui/tap/react-shim";
|
|
3
|
-
import { Primitive } from "@radix-ui/react-primitive";
|
|
4
2
|
import { useAui, useAuiState } from "@assistant-ui/store";
|
|
5
3
|
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
import { forwardRef } from "@assistant-ui/tap/react-shim";
|
|
5
|
+
import { Primitive } from "@radix-ui/react-primitive";
|
|
6
6
|
//#region src/primitives/span/SpanCollapseToggle.tsx
|
|
7
7
|
const SpanPrimitiveCollapseToggle = forwardRef((props, ref) => {
|
|
8
8
|
const $ = c(8);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SpanCollapseToggle.js","names":["ComponentPropsWithoutRef","ComponentRef","forwardRef","Primitive","useAui","useAuiState","SpanPrimitiveCollapseToggle","Element","button","Props","props","ref","$","_c","hasChildren","_temp","isCollapsed","_temp2","aui","t0","span","e","stopPropagation","toggleCollapse","onClick","t1","displayName","s","s_0"],"sources":["../../../src/primitives/span/SpanCollapseToggle.tsx"],"sourcesContent":["import {\n type ComponentPropsWithoutRef,\n type ComponentRef,\n forwardRef,\n} from \"react\";\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport { useAui, useAuiState } from \"@assistant-ui/store\";\n\nexport namespace SpanPrimitiveCollapseToggle {\n export type Element = ComponentRef<typeof Primitive.button>;\n export type Props = ComponentPropsWithoutRef<typeof Primitive.button>;\n}\n\nexport const SpanPrimitiveCollapseToggle = forwardRef<\n SpanPrimitiveCollapseToggle.Element,\n SpanPrimitiveCollapseToggle.Props\n>((props, ref) => {\n const hasChildren = useAuiState((s) => s.span.hasChildren);\n const isCollapsed = useAuiState((s) => s.span.isCollapsed);\n const aui = useAui();\n\n if (!hasChildren) return null;\n\n return (\n <Primitive.button\n type=\"button\"\n {...props}\n ref={ref}\n data-collapsed={isCollapsed}\n onClick={(e) => {\n e.stopPropagation();\n aui.span.toggleCollapse();\n props.onClick?.(e);\n }}\n />\n );\n});\n\nSpanPrimitiveCollapseToggle.displayName = \"SpanPrimitive.CollapseToggle\";\n"],"mappings":";;;;;;AAaA,MAAaM,8BAA8BJ,YAGzCQ,OAAAC,QAAA;CAAA,MAAAC,IAAAC,EAAA,CAAA;CACA,MAAAC,cAAoBT,YAAYU,KAAyB;CACzD,MAAAC,cAAoBX,YAAYY,MAAyB;CACzD,MAAAC,MAAYd,OAAO;CAEnB,IAAI,CAACU,aAAW,OAAS;CAAK,IAAAK;CAAA,IAAAP,EAAA,OAAAM,IAAAE,QAAAR,EAAA,OAAAF,OAAA;EAQjBS,MAAAE,MAAA;GACPA,EAACC,gBAAiB;GAClBJ,IAAGE,KAAKG,eAAgB;GACxBb,MAAKc,UAAWH,CAAC;EAAC;EACnBT,EAAA,KAAAM,IAAAE;EAAAR,EAAA,KAAAF;EAAAE,EAAA,KAAAO;CAAA,OAAAA,KAAAP,EAAA;CAAA,IAAAa;CAAA,IAAAb,EAAA,OAAAI,eAAAJ,EAAA,OAAAF,SAAAE,EAAA,OAAAD,OAAAC,EAAA,OAAAO,IAAA;EATHM,KAAA,oBAAA,UAAA,QAAA;GACO,MAAA;GAAQ,GACTf;GACCC;GACWK,kBAAAA;GACP,SAAAG;EAIR,CAAA;EACDP,EAAA,KAAAI;EAAAJ,EAAA,KAAAF;EAAAE,EAAA,KAAAD;EAAAC,EAAA,KAAAO;EAAAP,EAAA,KAAAa;CAAA,OAAAA,KAAAb,EAAA;CAAA,OAVFa;AAUE,CAEL;AAEDnB,4BAA4BoB,cAAc;AAtBxC,SAAAX,MAAAY,GAAA;CAAA,OACuCA,EAACP,KAAKN;AAAY;AADzD,SAAAG,OAAAW,KAAA;CAAA,OAEuCD,IAACP,KAAKJ;AAAY"}
|
|
1
|
+
{"version":3,"file":"SpanCollapseToggle.js","names":["ComponentPropsWithoutRef","ComponentRef","forwardRef","Primitive","useAui","useAuiState","SpanPrimitiveCollapseToggle","Element","button","Props","props","ref","$","_c","hasChildren","_temp","isCollapsed","_temp2","aui","t0","span","e","stopPropagation","toggleCollapse","onClick","t1","displayName","s","s_0","_c"],"sources":["../../../src/primitives/span/SpanCollapseToggle.tsx"],"sourcesContent":["import {\n type ComponentPropsWithoutRef,\n type ComponentRef,\n forwardRef,\n} from \"react\";\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport { useAui, useAuiState } from \"@assistant-ui/store\";\n\nexport namespace SpanPrimitiveCollapseToggle {\n export type Element = ComponentRef<typeof Primitive.button>;\n export type Props = ComponentPropsWithoutRef<typeof Primitive.button>;\n}\n\nexport const SpanPrimitiveCollapseToggle = forwardRef<\n SpanPrimitiveCollapseToggle.Element,\n SpanPrimitiveCollapseToggle.Props\n>((props, ref) => {\n const hasChildren = useAuiState((s) => s.span.hasChildren);\n const isCollapsed = useAuiState((s) => s.span.isCollapsed);\n const aui = useAui();\n\n if (!hasChildren) return null;\n\n return (\n <Primitive.button\n type=\"button\"\n {...props}\n ref={ref}\n data-collapsed={isCollapsed}\n onClick={(e) => {\n e.stopPropagation();\n aui.span.toggleCollapse();\n props.onClick?.(e);\n }}\n />\n );\n});\n\nSpanPrimitiveCollapseToggle.displayName = \"SpanPrimitive.CollapseToggle\";\n"],"mappings":";;;;;;AAaA,MAAaM,8BAA8BJ,YAGzCQ,OAAAC,QAAA;CAAA,MAAAC,IAAAC,EAAA,CAAA;CACA,MAAAC,cAAoBT,YAAYU,KAAyB;CACzD,MAAAC,cAAoBX,YAAYY,MAAyB;CACzD,MAAAC,MAAYd,OAAO;CAEnB,IAAI,CAACU,aAAW,OAAS;CAAK,IAAAK;CAAA,IAAAP,EAAA,OAAAM,IAAAE,QAAAR,EAAA,OAAAF,OAAA;EAQjBS,MAAAE,MAAA;GACPA,EAACC,gBAAiB;GAClBJ,IAAGE,KAAKG,eAAgB;GACxBb,MAAKc,UAAWH,CAAC;EAAC;EACnBT,EAAA,KAAAM,IAAAE;EAAAR,EAAA,KAAAF;EAAAE,EAAA,KAAAO;CAAA,OAAAA,KAAAP,EAAA;CAAA,IAAAa;CAAA,IAAAb,EAAA,OAAAI,eAAAJ,EAAA,OAAAF,SAAAE,EAAA,OAAAD,OAAAC,EAAA,OAAAO,IAAA;EATHM,KAAA,oBAAA,UAAA,QAAA;GACO,MAAA;GAAQ,GACTf;GACCC;GACWK,kBAAAA;GACP,SAAAG;EAIR,CAAA;EACDP,EAAA,KAAAI;EAAAJ,EAAA,KAAAF;EAAAE,EAAA,KAAAD;EAAAC,EAAA,KAAAO;EAAAP,EAAA,KAAAa;CAAA,OAAAA,KAAAb,EAAA;CAAA,OAVFa;AAUE,CAEL;AAEDnB,4BAA4BoB,cAAc;AAtBxC,SAAAX,MAAAY,GAAA;CAAA,OACuCA,EAACP,KAAKN;AAAY;AADzD,SAAAG,OAAAW,KAAA;CAAA,OAEuCD,IAACP,KAAKJ;AAAY"}
|
|
@@ -1,18 +1,16 @@
|
|
|
1
|
-
import { ComponentPropsWithoutRef, ComponentRef } from "react";
|
|
1
|
+
import { type ComponentPropsWithoutRef, type ComponentRef } from "react";
|
|
2
2
|
import { Primitive } from "@radix-ui/react-primitive";
|
|
3
|
-
//#region src/primitives/span/SpanIndent.d.ts
|
|
4
3
|
export declare namespace SpanPrimitiveIndent {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
4
|
+
type Element = ComponentRef<typeof Primitive.div>;
|
|
5
|
+
type Props = ComponentPropsWithoutRef<typeof Primitive.div> & {
|
|
6
|
+
baseIndent?: number;
|
|
7
|
+
indentPerLevel?: number;
|
|
8
|
+
};
|
|
10
9
|
}
|
|
11
10
|
export declare const SpanPrimitiveIndent: import("react").ForwardRefExoticComponent<Omit<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & {
|
|
12
|
-
|
|
11
|
+
asChild?: boolean;
|
|
13
12
|
}, "ref"> & {
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
baseIndent?: number;
|
|
14
|
+
indentPerLevel?: number;
|
|
16
15
|
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
17
|
-
//#endregion
|
|
18
16
|
//# sourceMappingURL=SpanIndent.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SpanIndent.d.ts","
|
|
1
|
+
{"version":3,"file":"SpanIndent.d.ts","sourceRoot":"","sources":["../../../src/primitives/span/SpanIndent.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,wBAAwB,EAC7B,KAAK,YAAY,EAGlB,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAGtD,yBAAiB,mBAAmB,CAAC;IACnC,KAAY,OAAO,GAAG,YAAY,CAAC,OAAO,SAAS,CAAC,GAAG,CAAC,CAAC;IACzD,KAAY,KAAK,GAAG,wBAAwB,CAAC,OAAO,SAAS,CAAC,GAAG,CAAC,GAAG;QACnE,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,cAAc,CAAC,EAAE,MAAM,CAAC;KACzB,CAAC;CACH;AAED,eAAO,MAAM,mBAAmB;;;iBALf,MAAM;qBACF,MAAM;kDA0BzB,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { c } from "@assistant-ui/tap/react-shim/compiler-runtime";
|
|
2
|
-
import { forwardRef } from "@assistant-ui/tap/react-shim";
|
|
3
|
-
import { Primitive } from "@radix-ui/react-primitive";
|
|
4
2
|
import { useAuiState } from "@assistant-ui/store";
|
|
5
3
|
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
import { forwardRef } from "@assistant-ui/tap/react-shim";
|
|
5
|
+
import { Primitive } from "@radix-ui/react-primitive";
|
|
6
6
|
//#region src/primitives/span/SpanIndent.tsx
|
|
7
7
|
const SpanPrimitiveIndent = forwardRef((t0, ref) => {
|
|
8
8
|
const $ = c(13);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SpanIndent.js","names":["ComponentPropsWithoutRef","ComponentRef","forwardRef","useMemo","Primitive","useAuiState","SpanPrimitiveIndent","Element","div","Props","baseIndent","indentPerLevel","t0","ref","$","_c","props","style","t1","t2","undefined","depth","_temp","t3","t4","paddingLeft","mergedStyle","t5","displayName","s","span"],"sources":["../../../src/primitives/span/SpanIndent.tsx"],"sourcesContent":["import {\n type ComponentPropsWithoutRef,\n type ComponentRef,\n forwardRef,\n useMemo,\n} from \"react\";\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport { useAuiState } from \"@assistant-ui/store\";\n\nexport namespace SpanPrimitiveIndent {\n export type Element = ComponentRef<typeof Primitive.div>;\n export type Props = ComponentPropsWithoutRef<typeof Primitive.div> & {\n baseIndent?: number;\n indentPerLevel?: number;\n };\n}\n\nexport const SpanPrimitiveIndent = forwardRef<\n SpanPrimitiveIndent.Element,\n SpanPrimitiveIndent.Props\n>(({ baseIndent = 8, indentPerLevel = 12, style, ...props }, ref) => {\n const depth = useAuiState((s) => s.span.depth);\n\n const mergedStyle = useMemo(\n () => ({\n ...style,\n paddingLeft: baseIndent + depth * indentPerLevel,\n }),\n [style, baseIndent, depth, indentPerLevel],\n );\n\n return (\n <Primitive.div\n {...props}\n ref={ref}\n style={mergedStyle}\n data-span-depth={depth}\n />\n );\n});\n\nSpanPrimitiveIndent.displayName = \"SpanPrimitive.Indent\";\n"],"mappings":";;;;;;AAiBA,MAAaM,sBAAsBJ,YAGjCU,IAAAC,QAAA;CAAA,MAAAC,IAAAC,EAAA,EAAA;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAL,EAAA,OAAAF,IAAA;EAAC,CAAA,CAAAF,YAAAQ,IAAAP,gBAAAQ,IAAAF,OAAA,GAAAD,SAAAJ;EAAwDE,EAAA,KAAAF;EAAAE,EAAA,KAAAE;EAAAF,EAAA,KAAAG;EAAAH,EAAA,KAAAI;EAAAJ,EAAA,KAAAK;CAAA,OAAA;EAAAH,QAAAF,EAAA;EAAAG,QAAAH,EAAA;EAAAI,KAAAJ,EAAA;EAAAK,KAAAL,EAAA;CAAA;CAAtD,MAAAJ,aAAAQ,OAAAE,KAAAA,IAAA,IAAAF;CAAgB,MAAAP,iBAAAQ,OAAAC,KAAAA,IAAA,KAAAD;CACnB,MAAAE,QAAchB,YAAYiB,KAAmB;CAK5B,MAAAC,KAAAb,aAAaW,QAAQV;CAAc,IAAAa;CAAA,IAAAV,EAAA,OAAAG,SAAAH,EAAA,OAAAS,IAAA;EAF3CC,KAAA;GAAA,GACFP;GAAKQ,aACKF;EACf;EAACT,EAAA,KAAAG;EAAAH,EAAA,KAAAS;EAAAT,EAAA,KAAAU;CAAA,OAAAA,KAAAV,EAAA;CAJH,MAAAY,cACSF;CAKP,IAAAG;CAAA,IAAAb,EAAA,OAAAO,SAAAP,EAAA,OAAAY,eAAAZ,EAAA,QAAAE,SAAAF,EAAA,QAAAD,KAAA;EAGAc,KAAA,oBAAA,UAAA,KAAA;GAAA,GACMX;GACCH;GACEa,OAAAA;GACUL,mBAAAA;EAAK,CAAA;EACtBP,EAAA,KAAAO;EAAAP,EAAA,KAAAY;EAAAZ,EAAA,MAAAE;EAAAF,EAAA,MAAAD;EAAAC,EAAA,MAAAa;CAAA,OAAAA,KAAAb,EAAA;CAAA,OALFa;AAKE,CAEL;AAEDrB,oBAAoBsB,cAAc;AArBhC,SAAAN,MAAAO,GAAA;CAAA,OACiCA,EAACC,KAAKT;AAAM"}
|
|
1
|
+
{"version":3,"file":"SpanIndent.js","names":["ComponentPropsWithoutRef","ComponentRef","forwardRef","useMemo","Primitive","useAuiState","SpanPrimitiveIndent","Element","div","Props","baseIndent","indentPerLevel","t0","ref","$","_c","props","style","t1","t2","undefined","depth","_temp","t3","t4","paddingLeft","mergedStyle","t5","displayName","s","span","_c"],"sources":["../../../src/primitives/span/SpanIndent.tsx"],"sourcesContent":["import {\n type ComponentPropsWithoutRef,\n type ComponentRef,\n forwardRef,\n useMemo,\n} from \"react\";\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport { useAuiState } from \"@assistant-ui/store\";\n\nexport namespace SpanPrimitiveIndent {\n export type Element = ComponentRef<typeof Primitive.div>;\n export type Props = ComponentPropsWithoutRef<typeof Primitive.div> & {\n baseIndent?: number;\n indentPerLevel?: number;\n };\n}\n\nexport const SpanPrimitiveIndent = forwardRef<\n SpanPrimitiveIndent.Element,\n SpanPrimitiveIndent.Props\n>(({ baseIndent = 8, indentPerLevel = 12, style, ...props }, ref) => {\n const depth = useAuiState((s) => s.span.depth);\n\n const mergedStyle = useMemo(\n () => ({\n ...style,\n paddingLeft: baseIndent + depth * indentPerLevel,\n }),\n [style, baseIndent, depth, indentPerLevel],\n );\n\n return (\n <Primitive.div\n {...props}\n ref={ref}\n style={mergedStyle}\n data-span-depth={depth}\n />\n );\n});\n\nSpanPrimitiveIndent.displayName = \"SpanPrim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BsB,cAAc;AArBhC,SAAAN,MAAAO,GAAA;CAAA,OACiCA,EAACC,KAAKT;AAAM"}
|
|
@@ -1,12 +1,10 @@
|
|
|
1
|
-
import { ComponentPropsWithoutRef, ComponentRef } from "react";
|
|
1
|
+
import { type ComponentPropsWithoutRef, type ComponentRef } from "react";
|
|
2
2
|
import { Primitive } from "@radix-ui/react-primitive";
|
|
3
|
-
//#region src/primitives/span/SpanName.d.ts
|
|
4
3
|
export declare namespace SpanPrimitiveName {
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
type Element = ComponentRef<typeof Primitive.span>;
|
|
5
|
+
type Props = ComponentPropsWithoutRef<typeof Primitive.span>;
|
|
7
6
|
}
|
|
8
7
|
export declare const SpanPrimitiveName: import("react").ForwardRefExoticComponent<Omit<import("react").ClassAttributes<HTMLSpanElement> & import("react").HTMLAttributes<HTMLSpanElement> & {
|
|
9
|
-
|
|
8
|
+
asChild?: boolean;
|
|
10
9
|
}, "ref"> & import("react").RefAttributes<HTMLSpanElement>>;
|
|
11
|
-
//#endregion
|
|
12
10
|
//# sourceMappingURL=SpanName.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SpanName.d.ts","
|
|
1
|
+
{"version":3,"file":"SpanName.d.ts","sourceRoot":"","sources":["../../../src/primitives/span/SpanName.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,wBAAwB,EAC7B,KAAK,YAAY,EAElB,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAGtD,yBAAiB,iBAAiB,CAAC;IACjC,KAAY,OAAO,GAAG,YAAY,CAAC,OAAO,SAAS,CAAC,IAAI,CAAC,CAAC;IAC1D,KAAY,KAAK,GAAG,wBAAwB,CAAC,OAAO,SAAS,CAAC,IAAI,CAAC,CAAC;CACrE;AAED,eAAO,MAAM,iBAAiB;;2DAW5B,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { c } from "@assistant-ui/tap/react-shim/compiler-runtime";
|
|
2
|
-
import { forwardRef } from "@assistant-ui/tap/react-shim";
|
|
3
|
-
import { Primitive } from "@radix-ui/react-primitive";
|
|
4
2
|
import { useAuiState } from "@assistant-ui/store";
|
|
5
3
|
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
import { forwardRef } from "@assistant-ui/tap/react-shim";
|
|
5
|
+
import { Primitive } from "@radix-ui/react-primitive";
|
|
6
6
|
//#region src/primitives/span/SpanName.tsx
|
|
7
7
|
const SpanPrimitiveName = forwardRef((props, ref) => {
|
|
8
8
|
const $ = c(4);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SpanName.js","names":["ComponentPropsWithoutRef","ComponentRef","forwardRef","Primitive","useAuiState","SpanPrimitiveName","Element","span","Props","props","ref","$","_c","name","_temp","t0","children","t1","displayName","s"],"sources":["../../../src/primitives/span/SpanName.tsx"],"sourcesContent":["import {\n type ComponentPropsWithoutRef,\n type ComponentRef,\n forwardRef,\n} from \"react\";\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport { useAuiState } from \"@assistant-ui/store\";\n\nexport namespace SpanPrimitiveName {\n export type Element = ComponentRef<typeof Primitive.span>;\n export type Props = ComponentPropsWithoutRef<typeof Primitive.span>;\n}\n\nexport const SpanPrimitiveName = forwardRef<\n SpanPrimitiveName.Element,\n SpanPrimitiveName.Props\n>((props, ref) => {\n const name = useAuiState((s) => s.span.name);\n\n return (\n <Primitive.span {...props} ref={ref}>\n {props.children ?? name}\n </Primitive.span>\n );\n});\n\nSpanPrimitiveName.displayName = \"SpanPrimitive.Name\";\n"],"mappings":";;;;;;AAaA,MAAaK,oBAAoBH,YAG/BO,OAAAC,QAAA;CAAA,MAAAC,IAAAC,EAAA,CAAA;CACA,MAAAC,OAAaT,YAAYU,KAAkB;CAItC,MAAAC,KAAAN,MAAKO,YAALH;CAAsB,IAAAI;CAAA,IAAAN,EAAA,OAAAF,SAAAE,EAAA,OAAAD,OAAAC,EAAA,OAAAI,IAAA;EADzBE,KAAA,oBAAA,UAAA,MAAA;GAAA,GAAoBR;GAAYC;GAC7BK,UAAAA;EACH,CAAA;EAAiBJ,EAAA,KAAAF;EAAAE,EAAA,KAAAD;EAAAC,EAAA,KAAAI;EAAAJ,EAAA,KAAAM;CAAA,OAAAA,KAAAN,EAAA;CAAA,OAFjBM;AAEiB,CAEpB;AAEDZ,kBAAkBa,cAAc;AAV9B,SAAAJ,MAAAK,GAAA;CAAA,OACgCA,EAACZ,KAAKM;AAAK"}
|
|
1
|
+
{"version":3,"file":"SpanName.js","names":["ComponentPropsWithoutRef","ComponentRef","forwardRef","Primitive","useAuiState","SpanPrimitiveName","Element","span","Props","props","ref","$","_c","name","_temp","t0","children","t1","displayName","s","_c"],"sources":["../../../src/primitives/span/SpanName.tsx"],"sourcesContent":["import {\n type ComponentPropsWithoutRef,\n type ComponentRef,\n forwardRef,\n} from \"react\";\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport { useAuiState } from \"@assistant-ui/store\";\n\nexport namespace SpanPrimitiveName {\n export type Element = ComponentRef<typeof Primitive.span>;\n export type Props = ComponentPropsWithoutRef<typeof Primitive.span>;\n}\n\nexport const SpanPrimitiveName = forwardRef<\n SpanPrimitiveName.Element,\n SpanPrimitiveName.Props\n>((props, ref) => {\n const name = useAuiState((s) => s.span.name);\n\n return (\n <Primitive.span {...props} ref={ref}>\n {props.children ?? name}\n </Primitive.span>\n );\n});\n\nSpanPrimitiveName.displayName = \"SpanPrimitive.Name\";\n"],"mappings":";;;;;;AAaA,MAAaK,oBAAoBH,YAG/BO,OAAAC,QAAA;CAAA,MAAAC,IAAAC,EAAA,CAAA;CACA,MAAAC,OAAaT,YAAYU,KAAkB;CAItC,MAAAC,KAAAN,MAAKO,YAALH;CAAsB,IAAAI;CAAA,IAAAN,EAAA,OAAAF,SAAAE,EAAA,OAAAD,OAAAC,EAAA,OAAAI,IAAA;EADzBE,KAAA,oBAAA,UAAA,MAAA;GAAA,GAAoBR;GAAYC;GAC7BK,UAAAA;EACH,CAAA;EAAiBJ,EAAA,KAAAF;EAAAE,EAAA,KAAAD;EAAAC,EAAA,KAAAI;EAAAJ,EAAA,KAAAM;CAAA,OAAAA,KAAAN,EAAA;CAAA,OAFjBM;AAEiB,CAEpB;AAEDZ,kBAAkBa,cAAc;AAV9B,SAAAJ,MAAAK,GAAA;CAAA,OACgCA,EAACZ,KAAKM;AAAK"}
|
|
@@ -1,12 +1,10 @@
|
|
|
1
|
-
import { ComponentPropsWithoutRef, ComponentRef } from "react";
|
|
1
|
+
import { type ComponentPropsWithoutRef, type ComponentRef } from "react";
|
|
2
2
|
import { Primitive } from "@radix-ui/react-primitive";
|
|
3
|
-
//#region src/primitives/span/SpanRoot.d.ts
|
|
4
3
|
export declare namespace SpanPrimitiveRoot {
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
type Element = ComponentRef<typeof Primitive.div>;
|
|
5
|
+
type Props = ComponentPropsWithoutRef<typeof Primitive.div>;
|
|
7
6
|
}
|
|
8
7
|
export declare const SpanPrimitiveRoot: import("react").ForwardRefExoticComponent<Omit<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & {
|
|
9
|
-
|
|
8
|
+
asChild?: boolean;
|
|
10
9
|
}, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
11
|
-
//#endregion
|
|
12
10
|
//# sourceMappingURL=SpanRoot.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SpanRoot.d.ts","
|
|
1
|
+
{"version":3,"file":"SpanRoot.d.ts","sourceRoot":"","sources":["../../../src/primitives/span/SpanRoot.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,wBAAwB,EAC7B,KAAK,YAAY,EAElB,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAGtD,yBAAiB,iBAAiB,CAAC;IACjC,KAAY,OAAO,GAAG,YAAY,CAAC,OAAO,SAAS,CAAC,GAAG,CAAC,CAAC;IACzD,KAAY,KAAK,GAAG,wBAAwB,CAAC,OAAO,SAAS,CAAC,GAAG,CAAC,CAAC;CACpE;AAED,eAAO,MAAM,iBAAiB;;0DAqB5B,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { c } from "@assistant-ui/tap/react-shim/compiler-runtime";
|
|
2
|
-
import { forwardRef } from "@assistant-ui/tap/react-shim";
|
|
3
|
-
import { Primitive } from "@radix-ui/react-primitive";
|
|
4
2
|
import { useAuiState } from "@assistant-ui/store";
|
|
5
3
|
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
import { forwardRef } from "@assistant-ui/tap/react-shim";
|
|
5
|
+
import { Primitive } from "@radix-ui/react-primitive";
|
|
6
6
|
//#region src/primitives/span/SpanRoot.tsx
|
|
7
7
|
const SpanPrimitiveRoot = forwardRef((props, ref) => {
|
|
8
8
|
const $ = c(8);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SpanRoot.js","names":["ComponentPropsWithoutRef","ComponentRef","forwardRef","Primitive","useAuiState","SpanPrimitiveRoot","Element","div","Props","props","ref","$","_c","spanId","_temp","status","_temp2","type","_temp3","depth","_temp4","isCollapsed","_temp5","t0","displayName","s","span","id","s_0","s_1","s_2","s_3"],"sources":["../../../src/primitives/span/SpanRoot.tsx"],"sourcesContent":["import {\n type ComponentPropsWithoutRef,\n type ComponentRef,\n forwardRef,\n} from \"react\";\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport { useAuiState } from \"@assistant-ui/store\";\n\nexport namespace SpanPrimitiveRoot {\n export type Element = ComponentRef<typeof Primitive.div>;\n export type Props = ComponentPropsWithoutRef<typeof Primitive.div>;\n}\n\nexport const SpanPrimitiveRoot = forwardRef<\n SpanPrimitiveRoot.Element,\n SpanPrimitiveRoot.Props\n>((props, ref) => {\n const spanId = useAuiState((s) => s.span.id);\n const status = useAuiState((s) => s.span.status);\n const type = useAuiState((s) => s.span.type);\n const depth = useAuiState((s) => s.span.depth);\n const isCollapsed = useAuiState((s) => s.span.isCollapsed);\n\n return (\n <Primitive.div\n {...props}\n ref={ref}\n data-span-id={spanId}\n data-span-status={status}\n data-span-type={type}\n data-span-depth={depth}\n data-collapsed={isCollapsed}\n />\n );\n});\n\nSpanPrimitiveRoot.displayName = \"SpanPrimitive.Root\";\n"],"mappings":";;;;;;AAaA,MAAaK,oBAAoBH,YAG/BO,OAAAC,QAAA;CAAA,MAAAC,IAAAC,EAAA,CAAA;CACA,MAAAC,SAAeT,YAAYU,KAAgB;CAC3C,MAAAC,SAAeX,YAAYY,MAAoB;CAC/C,MAAAC,OAAab,YAAYc,MAAkB;CAC3C,MAAAC,QAAcf,YAAYgB,MAAmB;CAC7C,MAAAC,cAAoBjB,YAAYkB,MAAyB;CAAE,IAAAC;CAAA,IAAAZ,EAAA,OAAAQ,SAAAR,EAAA,OAAAU,eAAAV,EAAA,OAAAF,SAAAE,EAAA,OAAAD,OAAAC,EAAA,OAAAE,UAAAF,EAAA,OAAAI,UAAAJ,EAAA,OAAAM,MAAA;EAGzDM,KAAA,oBAAA,UAAA,KAAA;GAAA,GACMd;GACCC;GACSG,gBAAAA;GACIE,oBAAAA;GACFE,kBAAAA;GACCE,mBAAAA;GACDE,kBAAAA;EAAW,CAAA;EAC3BV,EAAA,KAAAQ;EAAAR,EAAA,KAAAU;EAAAV,EAAA,KAAAF;EAAAE,EAAA,KAAAD;EAAAC,EAAA,KAAAE;EAAAF,EAAA,KAAAI;EAAAJ,EAAA,KAAAM;EAAAN,EAAA,KAAAY;CAAA,OAAAA,KAAAZ,EAAA;CAAA,OARFY;AAQE,CAEL;AAEDlB,kBAAkBmB,cAAc;AApB9B,SAAAV,MAAAW,GAAA;CAAA,OACkCA,EAACC,KAAKC;AAAG;AAD3C,SAAAX,OAAAY,KAAA;CAAA,OAEkCH,IAACC,KAAKX;AAAO;AAF/C,SAAAG,OAAAW,KAAA;CAAA,OAGgCJ,IAACC,KAAKT;AAAK;AAH3C,SAAAG,OAAAU,KAAA;CAAA,OAIiCL,IAACC,KAAKP;AAAM;AAJ7C,SAAAG,OAAAS,KAAA;CAAA,OAKuCN,IAACC,KAAKL;AAAY"}
|
|
1
|
+
{"version":3,"file":"SpanRoot.js","names":["ComponentPropsWithoutRef","ComponentRef","forwardRef","Primitive","useAuiState","SpanPrimitiveRoot","Element","div","Props","props","ref","$","_c","spanId","_temp","status","_temp2","type","_temp3","depth","_temp4","isCollapsed","_temp5","t0","displayName","s","span","id","s_0","s_1","s_2","s_3","_c"],"sources":["../../../src/primitives/span/SpanRoot.tsx"],"sourcesContent":["import {\n type ComponentPropsWithoutRef,\n type ComponentRef,\n forwardRef,\n} from \"react\";\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport { useAuiState } from \"@assistant-ui/store\";\n\nexport namespace SpanPrimitiveRoot {\n export type Element = ComponentRef<typeof Primitive.div>;\n export type Props = ComponentPropsWithoutRef<typeof Primitive.div>;\n}\n\nexport const SpanPrimitiveRoot = forwardRef<\n SpanPrimitiveRoot.Element,\n SpanPrimitiveRoot.Props\n>((props, ref) => {\n const spanId = useAuiState((s) => s.span.id);\n const status = useAuiState((s) => s.span.status);\n const type = useAuiState((s) => s.span.type);\n const depth = useAuiState((s) => s.span.depth);\n const isCollapsed = useAuiState((s) => s.span.isCollapsed);\n\n return (\n <Primitive.div\n {...props}\n ref={ref}\n data-span-id={spanId}\n data-span-status={status}\n data-span-type={type}\n data-span-depth={depth}\n data-collapsed={isCollapsed}\n />\n );\n});\n\nSpanPrimitiveRoot.displayName = \"SpanPrimitive.Root\";\n"],"mappings":";;;;;;AAaA,MAAaK,oBAAoBH,YAG/BO,OAAAC,QAAA;CAAA,MAAAC,IAAAC,EAAA,CAAA;CACA,MAAAC,SAAeT,YAAYU,KAAgB;CAC3C,MAAAC,SAAeX,YAAYY,MAAoB;CAC/C,MAAAC,OAAab,YAAYc,MAAkB;CAC3C,MAAAC,QAAcf,YAAYgB,MAAmB;CAC7C,MAAAC,cAAoBjB,YAAYkB,MAAyB;CAAE,IAAAC;CAAA,IAAAZ,EAAA,OAAAQ,SAAAR,EAAA,OAAAU,eAAAV,EAAA,OAAAF,SAAAE,EAAA,OAAAD,OAAAC,EAAA,OAAAE,UAAAF,EAAA,OAAAI,UAAAJ,EAAA,OAAAM,MAAA;EAGzDM,KAAA,oBAAA,UAAA,KAAA;GAAA,GACMd;GACCC;GACSG,gBAAAA;GACIE,oBAAAA;GACFE,kBAAAA;GACCE,mBAAAA;GACDE,kBAAAA;EAAW,CAAA;EAC3BV,EAAA,KAAAQ;EAAAR,EAAA,KAAAU;EAAAV,EAAA,KAAAF;EAAAE,EAAA,KAAAD;EAAAC,EAAA,KAAAE;EAAAF,EAAA,KAAAI;EAAAJ,EAAA,KAAAM;EAAAN,EAAA,KAAAY;CAAA,OAAAA,KAAAZ,EAAA;CAAA,OARFY;AAQE,CAEL;AAEDlB,kBAAkBmB,cAAc;AApB9B,SAAAV,MAAAW,GAAA;CAAA,OACkCA,EAACC,KAAKC;AAAG;AAD3C,SAAAX,OAAAY,KAAA;CAAA,OAEkCH,IAACC,KAAKX;AAAO;AAF/C,SAAAG,OAAAW,KAAA;CAAA,OAGgCJ,IAACC,KAAKT;AAAK;AAH3C,SAAAG,OAAAU,KAAA;CAAA,OAIiCL,IAACC,KAAKP;AAAM;AAJ7C,SAAAG,OAAAS,KAAA;CAAA,OAKuCN,IAACC,KAAKL;AAAY"}
|
|
@@ -1,12 +1,10 @@
|
|
|
1
|
-
import { ComponentPropsWithoutRef, ComponentRef } from "react";
|
|
1
|
+
import { type ComponentPropsWithoutRef, type ComponentRef } from "react";
|
|
2
2
|
import { Primitive } from "@radix-ui/react-primitive";
|
|
3
|
-
//#region src/primitives/span/SpanStatusIndicator.d.ts
|
|
4
3
|
export declare namespace SpanPrimitiveStatusIndicator {
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
type Element = ComponentRef<typeof Primitive.span>;
|
|
5
|
+
type Props = ComponentPropsWithoutRef<typeof Primitive.span>;
|
|
7
6
|
}
|
|
8
7
|
export declare const SpanPrimitiveStatusIndicator: import("react").ForwardRefExoticComponent<Omit<import("react").ClassAttributes<HTMLSpanElement> & import("react").HTMLAttributes<HTMLSpanElement> & {
|
|
9
|
-
|
|
8
|
+
asChild?: boolean;
|
|
10
9
|
}, "ref"> & import("react").RefAttributes<HTMLSpanElement>>;
|
|
11
|
-
//#endregion
|
|
12
10
|
//# sourceMappingURL=SpanStatusIndicator.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SpanStatusIndicator.d.ts","
|
|
1
|
+
{"version":3,"file":"SpanStatusIndicator.d.ts","sourceRoot":"","sources":["../../../src/primitives/span/SpanStatusIndicator.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,wBAAwB,EAC7B,KAAK,YAAY,EAElB,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAGtD,yBAAiB,4BAA4B,CAAC;IAC5C,KAAY,OAAO,GAAG,YAAY,CAAC,OAAO,SAAS,CAAC,IAAI,CAAC,CAAC;IAC1D,KAAY,KAAK,GAAG,wBAAwB,CAAC,OAAO,SAAS,CAAC,IAAI,CAAC,CAAC;CACrE;AAED,eAAO,MAAM,4BAA4B;;2DAOvC,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { c } from "@assistant-ui/tap/react-shim/compiler-runtime";
|
|
2
|
-
import { forwardRef } from "@assistant-ui/tap/react-shim";
|
|
3
|
-
import { Primitive } from "@radix-ui/react-primitive";
|
|
4
2
|
import { useAuiState } from "@assistant-ui/store";
|
|
5
3
|
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
import { forwardRef } from "@assistant-ui/tap/react-shim";
|
|
5
|
+
import { Primitive } from "@radix-ui/react-primitive";
|
|
6
6
|
//#region src/primitives/span/SpanStatusIndicator.tsx
|
|
7
7
|
const SpanPrimitiveStatusIndicator = forwardRef((props, ref) => {
|
|
8
8
|
const $ = c(4);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SpanStatusIndicator.js","names":["ComponentPropsWithoutRef","ComponentRef","forwardRef","Primitive","useAuiState","SpanPrimitiveStatusIndicator","Element","span","Props","props","ref","$","_c","status","_temp","t0","displayName","s"],"sources":["../../../src/primitives/span/SpanStatusIndicator.tsx"],"sourcesContent":["import {\n type ComponentPropsWithoutRef,\n type ComponentRef,\n forwardRef,\n} from \"react\";\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport { useAuiState } from \"@assistant-ui/store\";\n\nexport namespace SpanPrimitiveStatusIndicator {\n export type Element = ComponentRef<typeof Primitive.span>;\n export type Props = ComponentPropsWithoutRef<typeof Primitive.span>;\n}\n\nexport const SpanPrimitiveStatusIndicator = forwardRef<\n SpanPrimitiveStatusIndicator.Element,\n SpanPrimitiveStatusIndicator.Props\n>((props, ref) => {\n const status = useAuiState((s) => s.span.status);\n\n return <Primitive.span {...props} ref={ref} data-span-status={status} />;\n});\n\nSpanPrimitiveStatusIndicator.displayName = \"SpanPrimitive.StatusIndicator\";\n"],"mappings":";;;;;;AAaA,MAAaK,+BAA+BH,YAG1CO,OAAAC,QAAA;CAAA,MAAAC,IAAAC,EAAA,CAAA;CACA,MAAAC,SAAeT,YAAYU,KAAoB;CAAE,IAAAC;CAAA,IAAAJ,EAAA,OAAAF,SAAAE,EAAA,OAAAD,OAAAC,EAAA,OAAAE,QAAA;EAE1CE,KAAA,oBAAA,UAAA,MAAA;GAAA,GAAoBN;GAAYC;GAAuBG,oBAAAA;EAAM,CAAA;EAAIF,EAAA,KAAAF;EAAAE,EAAA,KAAAD;EAAAC,EAAA,KAAAE;EAAAF,EAAA,KAAAI;CAAA,OAAAA,KAAAJ,EAAA;CAAA,OAAjEI;AAAiE,CACzE;AAEDV,6BAA6BW,cAAc;AANzC,SAAAF,MAAAG,GAAA;CAAA,OACkCA,EAACV,KAAKM;AAAO"}
|
|
1
|
+
{"version":3,"file":"SpanStatusIndicator.js","names":["ComponentPropsWithoutRef","ComponentRef","forwardRef","Primitive","useAuiState","SpanPrimitiveStatusIndicator","Element","span","Props","props","ref","$","_c","status","_temp","t0","displayName","s","_c"],"sources":["../../../src/primitives/span/SpanStatusIndicator.tsx"],"sourcesContent":["import {\n type ComponentPropsWithoutRef,\n type ComponentRef,\n forwardRef,\n} from \"react\";\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport { useAuiState } from \"@assistant-ui/store\";\n\nexport namespace SpanPrimitiveStatusIndicator {\n export type Element = ComponentRef<typeof Primitive.span>;\n export type Props = ComponentPropsWithoutRef<typeof Primitive.span>;\n}\n\nexport const SpanPrimitiveStatusIndicator = forwardRef<\n SpanPrimitiveStatusIndicator.Element,\n SpanPrimitiveStatusIndicator.Props\n>((props, ref) => {\n const status = useAuiState((s) => s.span.status);\n\n return <Primitive.span {...props} ref={ref} data-span-status={status} />;\n});\n\nSpanPrimitiveStatusIndicator.displayName = \"SpanPrimitive.StatusIndicator\";\n"],"mappings":";;;;;;AAaA,MAAaK,+BAA+BH,YAG1CO,OAAAC,QAAA;CAAA,MAAAC,IAAAC,EAAA,CAAA;CACA,MAAAC,SAAeT,YAAYU,KAAoB;CAAE,IAAAC;CAAA,IAAAJ,EAAA,OAAAF,SAAAE,EAAA,OAAAD,OAAAC,EAAA,OAAAE,QAAA;EAE1CE,KAAA,oBAAA,UAAA,MAAA;GAAA,GAAoBN;GAAYC;GAAuBG,oBAAAA;EAAM,CAAA;EAAIF,EAAA,KAAAF;EAAAE,EAAA,KAAAD;EAAAC,EAAA,KAAAE;EAAAF,EAAA,KAAAI;CAAA,OAAAA,KAAAJ,EAAA;CAAA,OAAjEI;AAAiE,CACzE;AAEDV,6BAA6BW,cAAc;AANzC,SAAAF,MAAAG,GAAA;CAAA,OACkCA,EAACV,KAAKM;AAAO"}
|
|
@@ -1,47 +1,45 @@
|
|
|
1
|
-
import { ComponentPropsWithoutRef, ComponentRef } from "react";
|
|
1
|
+
import { type ComponentPropsWithoutRef, type ComponentRef } from "react";
|
|
2
2
|
import { Primitive } from "@radix-ui/react-primitive";
|
|
3
|
-
//#region src/primitives/span/SpanTimeline.d.ts
|
|
4
3
|
export type SpanTimelineRange = {
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
min: number;
|
|
5
|
+
max: number;
|
|
7
6
|
};
|
|
8
7
|
export declare namespace SpanPrimitiveTimeline {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
8
|
+
type Element = ComponentRef<typeof Primitive.div>;
|
|
9
|
+
type Props = ComponentPropsWithoutRef<typeof Primitive.div> & {
|
|
10
|
+
timeRange?: SpanTimelineRange | undefined;
|
|
11
|
+
paddingEnd?: number | undefined;
|
|
12
|
+
};
|
|
14
13
|
}
|
|
15
14
|
export declare const SpanPrimitiveTimeline: import("react").ForwardRefExoticComponent<Omit<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & {
|
|
16
|
-
|
|
15
|
+
asChild?: boolean;
|
|
17
16
|
}, "ref"> & {
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
timeRange?: SpanTimelineRange | undefined;
|
|
18
|
+
paddingEnd?: number | undefined;
|
|
20
19
|
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
21
20
|
export declare namespace SpanPrimitiveTimelineBar {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
21
|
+
type Element = ComponentRef<typeof Primitive.div>;
|
|
22
|
+
type Props = ComponentPropsWithoutRef<typeof Primitive.div> & {
|
|
23
|
+
now?: number | undefined;
|
|
24
|
+
timeRange?: SpanTimelineRange | undefined;
|
|
25
|
+
};
|
|
27
26
|
}
|
|
28
|
-
export declare const getSpanTimelineBarVars: ({ startedAt, endedAt, timeRange, now }: {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
27
|
+
export declare const getSpanTimelineBarVars: ({ startedAt, endedAt, timeRange, now, }: {
|
|
28
|
+
startedAt: number;
|
|
29
|
+
endedAt: number | null;
|
|
30
|
+
timeRange: SpanTimelineRange;
|
|
31
|
+
now?: number | undefined;
|
|
33
32
|
}) => {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
33
|
+
leftPercent: number;
|
|
34
|
+
endPercent: number;
|
|
35
|
+
widthPercent: number;
|
|
36
|
+
durationMs: number;
|
|
37
|
+
effectiveEnd: number;
|
|
39
38
|
};
|
|
40
39
|
export declare const SpanPrimitiveTimelineBar: import("react").ForwardRefExoticComponent<Omit<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & {
|
|
41
|
-
|
|
40
|
+
asChild?: boolean;
|
|
42
41
|
}, "ref"> & {
|
|
43
|
-
|
|
44
|
-
|
|
42
|
+
now?: number | undefined;
|
|
43
|
+
timeRange?: SpanTimelineRange | undefined;
|
|
45
44
|
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
46
|
-
//#endregion
|
|
47
45
|
//# sourceMappingURL=SpanTimeline.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SpanTimeline.d.ts","
|
|
1
|
+
{"version":3,"file":"SpanTimeline.d.ts","sourceRoot":"","sources":["../../../src/primitives/span/SpanTimeline.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,wBAAwB,EAC7B,KAAK,YAAY,EAMlB,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAGtD,MAAM,MAAM,iBAAiB,GAAG;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,CAAC;AA6B7D,yBAAiB,qBAAqB,CAAC;IACrC,KAAY,OAAO,GAAG,YAAY,CAAC,OAAO,SAAS,CAAC,GAAG,CAAC,CAAC;IACzD,KAAY,KAAK,GAAG,wBAAwB,CAAC,OAAO,SAAS,CAAC,GAAG,CAAC,GAAG;QACnE,SAAS,CAAC,EAAE,iBAAiB,GAAG,SAAS,CAAC;QAC1C,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;KACjC,CAAC;CACH;AAED,eAAO,MAAM,qBAAqB;;;gBALlB,iBAAiB,GAAG,SAAS;iBAC5B,MAAM,GAAG,SAAS;kDAkCjC,CAAC;AAIH,yBAAiB,wBAAwB,CAAC;IACxC,KAAY,OAAO,GAAG,YAAY,CAAC,OAAO,SAAS,CAAC,GAAG,CAAC,CAAC;IACzD,KAAY,KAAK,GAAG,wBAAwB,CAAC,OAAO,SAAS,CAAC,GAAG,CAAC,GAAG;QACnE,GAAG,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;QACzB,SAAS,CAAC,EAAE,iBAAiB,GAAG,SAAS,CAAC;KAC3C,CAAC;CACH;AAED,eAAO,MAAM,sBAAsB,GAAI,yCAKpC;IACD,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,SAAS,EAAE,iBAAiB,CAAC;IAC7B,GAAG,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC1B;;;;;;CAkBA,CAAC;AAEF,eAAO,MAAM,wBAAwB;;;UAnC3B,MAAM,GAAG,SAAS;gBACZ,iBAAiB,GAAG,SAAS;kDA0E3C,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { c } from "@assistant-ui/tap/react-shim/compiler-runtime";
|
|
2
|
-
import { createContext, forwardRef, useContext } from "@assistant-ui/tap/react-shim";
|
|
3
|
-
import { Primitive } from "@radix-ui/react-primitive";
|
|
4
2
|
import { useAuiState } from "@assistant-ui/store";
|
|
5
3
|
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
import { createContext, forwardRef, useContext } from "@assistant-ui/tap/react-shim";
|
|
5
|
+
import { Primitive } from "@radix-ui/react-primitive";
|
|
6
6
|
//#region src/primitives/span/SpanTimeline.tsx
|
|
7
7
|
const clampPercent = (value) => Math.min(100, Math.max(0, value));
|
|
8
8
|
const normalizeRange = (range, paddingEnd = 0) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SpanTimeline.js","names":["ComponentPropsWithoutRef","ComponentRef","CSSProperties","createContext","forwardRef","useContext","useMemo","Primitive","useAuiState","SpanTimelineRange","min","max","TimelineCssProperties","clampPercent","value","Math","normalizeRange","range","paddingEnd","duration","safePaddingEnd","SpanTimelineRangeContext","SpanPrimitiveTimeline","Element","div","Props","timeRange","t0","ref","$","_c","children","props","style","t1","undefined","spanTimeRange","_temp","t2","t3","resolvedRange","rangeMs","t4","mergedStyle","t5","t6","displayName","SpanPrimitiveTimelineBar","now","getSpanTimelineBarVars","startedAt","endedAt","effectiveEnd","leftPercent","rawEndPercent","endPercent","widthPercent","durationMs","contextRange","_temp2","_temp3","_temp4","status","_temp5","type","_temp6","vars","position","insetInlineStart","inlineSize","t7","t8","s","span","s_0","s_1","s_2","s_3"],"sources":["../../../src/primitives/span/SpanTimeline.tsx"],"sourcesContent":["import {\n type ComponentPropsWithoutRef,\n type ComponentRef,\n type CSSProperties,\n createContext,\n forwardRef,\n useContext,\n useMemo,\n} from \"react\";\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport { useAuiState } from \"@assistant-ui/store\";\n\nexport type SpanTimelineRange = { min: number; max: number };\n\ntype TimelineCssProperties = CSSProperties & {\n \"--span-timeline-min-ms\"?: number;\n \"--span-timeline-max-ms\"?: number;\n \"--span-timeline-range-ms\"?: number;\n \"--span-timeline-left\"?: string;\n \"--span-timeline-end\"?: string;\n \"--span-timeline-width\"?: string;\n \"--span-timeline-duration-ms\"?: number;\n \"--span-timeline-min-width\"?: string | number;\n};\n\nconst clampPercent = (value: number) => Math.min(100, Math.max(0, value));\n\nconst normalizeRange = (\n range: SpanTimelineRange,\n paddingEnd = 0,\n): SpanTimelineRange => {\n const duration = Math.max(1, range.max - range.min);\n const safePaddingEnd = Math.max(0, paddingEnd);\n return {\n min: range.min,\n max: range.max + duration * safePaddingEnd,\n };\n};\n\nconst SpanTimelineRangeContext = createContext<SpanTimelineRange | null>(null);\n\nexport namespace SpanPrimitiveTimeline {\n export type Element = ComponentRef<typeof Primitive.div>;\n export type Props = ComponentPropsWithoutRef<typeof Primitive.div> & {\n timeRange?: SpanTimelineRange | undefined;\n paddingEnd?: number | undefined;\n };\n}\n\nexport const SpanPrimitiveTimeline = forwardRef<\n SpanPrimitiveTimeline.Element,\n SpanPrimitiveTimeline.Props\n>(({ timeRange, paddingEnd = 0, style, children, ...props }, ref) => {\n const spanTimeRange = useAuiState((s) => s.span.timeRange);\n const resolvedRange = useMemo(\n () => normalizeRange(timeRange ?? spanTimeRange, paddingEnd),\n [timeRange, spanTimeRange, paddingEnd],\n );\n const rangeMs = Math.max(1, resolvedRange.max - resolvedRange.min);\n\n const mergedStyle: TimelineCssProperties = {\n ...style,\n \"--span-timeline-min-ms\": resolvedRange.min,\n \"--span-timeline-max-ms\": resolvedRange.max,\n \"--span-timeline-range-ms\": rangeMs,\n };\n\n return (\n <SpanTimelineRangeContext.Provider value={resolvedRange}>\n <Primitive.div\n {...props}\n ref={ref}\n style={mergedStyle}\n data-span-timeline=\"\"\n >\n {children}\n </Primitive.div>\n </SpanTimelineRangeContext.Provider>\n );\n});\n\nSpanPrimitiveTimeline.displayName = \"SpanPrimitive.Timeline\";\n\nexport namespace SpanPrimitiveTimelineBar {\n export type Element = ComponentRef<typeof Primitive.div>;\n export type Props = ComponentPropsWithoutRef<typeof Primitive.div> & {\n now?: number | undefined;\n timeRange?: SpanTimelineRange | undefined;\n };\n}\n\nexport const getSpanTimelineBarVars = ({\n startedAt,\n endedAt,\n timeRange,\n now,\n}: {\n startedAt: number;\n endedAt: number | null;\n timeRange: SpanTimelineRange;\n now?: number | undefined;\n}) => {\n const rangeMs = Math.max(1, timeRange.max - timeRange.min);\n const effectiveEnd = endedAt ?? now ?? timeRange.max;\n const leftPercent = clampPercent(\n ((startedAt - timeRange.min) / rangeMs) * 100,\n );\n const rawEndPercent = ((effectiveEnd - timeRange.min) / rangeMs) * 100;\n const endPercent = clampPercent(Math.max(leftPercent, rawEndPercent));\n const widthPercent = endPercent - leftPercent;\n const durationMs = Math.max(0, effectiveEnd - startedAt);\n\n return {\n leftPercent,\n endPercent,\n widthPercent,\n durationMs,\n effectiveEnd,\n };\n};\n\nexport const SpanPrimitiveTimelineBar = forwardRef<\n SpanPrimitiveTimelineBar.Element,\n SpanPrimitiveTimelineBar.Props\n>(({ now, timeRange, style, ...props }, ref) => {\n const contextRange = useContext(SpanTimelineRangeContext);\n const spanTimeRange = useAuiState((s) => s.span.timeRange);\n const startedAt = useAuiState((s) => s.span.startedAt);\n const endedAt = useAuiState((s) => s.span.endedAt);\n const status = useAuiState((s) => s.span.status);\n const type = useAuiState((s) => s.span.type);\n\n const vars = getSpanTimelineBarVars({\n startedAt,\n endedAt,\n timeRange: timeRange ?? contextRange ?? spanTimeRange,\n now,\n });\n\n const mergedStyle: TimelineCssProperties = {\n ...style,\n position: \"absolute\",\n insetInlineStart: \"var(--span-timeline-left)\",\n inlineSize:\n \"max(var(--span-timeline-width), var(--span-timeline-min-width, 0px))\",\n \"--span-timeline-left\": `${vars.leftPercent}%`,\n \"--span-timeline-end\": `${vars.endPercent}%`,\n \"--span-timeline-width\": `${vars.widthPercent}%`,\n \"--span-timeline-duration-ms\": vars.durationMs,\n };\n\n return (\n <Primitive.div\n {...props}\n ref={ref}\n style={mergedStyle}\n data-span-status={status}\n data-span-type={type}\n data-span-running={endedAt === null ? \"\" : undefined}\n />\n );\n});\n\nSpanPrimitiveTimelineBar.displayName = \"SpanPrimitive.TimelineBar\";\n"],"mappings":";;;;;;AAyBA,MAAMa,gBAAgBC,UAAkBC,KAAKL,IAAI,KAAKK,KAAKJ,IAAI,GAAGG,KAAK,CAAC;AAExE,MAAME,kBACJC,OACAC,aAAa,MACS;CACtB,MAA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AAiC,OAAAa,GAAA;CAAA,OAEyCA,EAACC,KAAK/C;AAAU;AAFzD,SAAAkC,OAAAc,KAAA;CAAA,OAGqCF,IAACC,KAAKvB;AAAU;AAHrD,SAAAW,OAAAc,KAAA;CAAA,OAImCH,IAACC,KAAKtB;AAAQ;AAJjD,SAAAY,OAAAa,KAAA;CAAA,OAKkCJ,IAACC,KAAKX;AAAO;AAL/C,SAAAG,OAAAY,KAAA;CAAA,OAMgCL,IAACC,KAAKT;AAAK"}
|
|
1
|
+
{"version":3,"file":"SpanTimeline.js","names":["ComponentPropsWithoutRef","ComponentRef","CSSProperties","createContext","forwardRef","useContext","useMemo","Primitive","useAuiState","SpanTimelineRange","min","max","TimelineCssProperties","clampPercent","value","Math","normalizeRange","range","paddingEnd","duration","safePaddingEnd","SpanTimelineRangeContext","SpanPrimitiveTimeline","Element","div","Props","timeRange","t0","ref","$","_c","children","props","style","t1","undefined","spanTimeRange","_temp","t2","t3","resolvedRange","rangeMs","t4","mergedStyle","t5","t6","displayName","SpanPrimitiveTimelineBar","now","getSpanTimelineBarVars","startedAt","endedAt","effectiveEnd","leftPercent","rawEndPercent","endPercent","widthPercent","durationMs","contextRange","_temp2","_temp3","_temp4","status","_temp5","type","_temp6","vars","position","insetInlineStart","inlineSize","t7","t8","s","span","s_0","s_1","s_2","s_3","_c"],"sources":["../../../src/primitives/span/SpanTimeline.tsx"],"sourcesContent":["import {\n type ComponentPropsWithoutRef,\n type ComponentRef,\n type CSSProperties,\n createContext,\n forwardRef,\n useContext,\n useMemo,\n} from \"react\";\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport { useAuiState } from \"@assistant-ui/store\";\n\nexport type SpanTimelineRange = { min: number; max: number };\n\ntype TimelineCssProperties = CSSProperties & {\n \"--span-timeline-min-ms\"?: number;\n \"--span-timeline-max-ms\"?: number;\n \"--span-timeline-range-ms\"?: number;\n \"--span-timeline-left\"?: string;\n \"--span-timeline-end\"?: string;\n \"--span-timeline-width\"?: string;\n \"--span-timeline-duration-ms\"?: number;\n \"--span-timeline-min-width\"?: string | number;\n};\n\nconst clampPercent = (value: number) => Math.min(100, Math.max(0, value));\n\nconst normalizeRange = (\n range: SpanTimelineRange,\n paddingEnd = 0,\n): SpanTimelineRange => {\n const duration = Math.max(1, range.max - range.min);\n const safePaddingEnd = Math.max(0, paddingEnd);\n return {\n min: range.min,\n max: range.max + duration * safePaddingEnd,\n };\n};\n\nconst SpanTimelineRangeContext = createContext<SpanTimelineRange | null>(null);\n\nexport namespace SpanPrimitiveTimeline {\n export type Element = ComponentRef<typeof Primitive.div>;\n export type Props = ComponentPropsWithoutRef<typeof Primitive.div> & {\n timeRange?: SpanTimelineRange | undefined;\n paddingEnd?: number | undefined;\n };\n}\n\nexport const SpanPrimitiveTimeline = forwardRef<\n SpanPrimitiveTimeline.Element,\n SpanPrimitiveTimeline.Props\n>(({ timeRange, paddingEnd = 0, style, children, ...props }, ref) => {\n const spanTimeRange = useAuiState((s) => s.span.timeRange);\n const resolvedRange = useMemo(\n () => normalizeRange(timeRange ?? spanTimeRange, paddingEnd),\n [timeRange, spanTimeRange, paddingEnd],\n );\n const rangeMs = Math.max(1, resolvedRange.max - resolvedRange.min);\n\n const mergedStyle: TimelineCssProperties = {\n ...style,\n \"--span-timeline-min-ms\": resolvedRange.min,\n \"--span-timeline-max-ms\": resolvedRange.max,\n \"--span-timeline-range-ms\": rangeMs,\n };\n\n return (\n <SpanTimelineRangeContext.Provider value={resolvedRange}>\n <Primitive.div\n {...props}\n ref={ref}\n style={mergedStyle}\n data-span-timeline=\"\"\n >\n {children}\n </Primitive.div>\n </SpanTimelineRangeContext.Provider>\n );\n});\n\nSpanPrimitiveTimeline.displayName = \"SpanPrimitive.Timeline\";\n\nexport namespace SpanPrimitiveTimelineBar {\n export type Element = ComponentRef<typeof Primitive.div>;\n export type Props = ComponentPropsWithoutRef<typeof Primitive.div> & {\n now?: number | undefined;\n timeRange?: SpanTimelineRange | undefined;\n };\n}\n\nexport const getSpanTimelineBarVars = ({\n startedAt,\n endedAt,\n timeRange,\n now,\n}: {\n startedAt: number;\n endedAt: number | null;\n timeRange: SpanTimelineRange;\n now?: number | undefined;\n}) => {\n const rangeMs = Math.max(1, timeRange.max - timeRange.min);\n const effectiveEnd = endedAt ?? now ?? timeRange.max;\n const leftPercent = clampPercent(\n ((startedAt - timeRange.min) / rangeMs) * 100,\n );\n const rawEndPercent = ((effectiveEnd - timeRange.min) / rangeMs) * 100;\n const endPercent = clampPercent(Math.max(leftPercent, rawEndPercent));\n const widthPercent = endPercent - leftPercent;\n const durationMs = Math.max(0, effectiveEnd - startedAt);\n\n return {\n leftPercent,\n endPercent,\n widthPercent,\n durationMs,\n effectiveEnd,\n };\n};\n\nexport const SpanPrimitiveTimelineBar = forwardRef<\n SpanPrimitiveTimelineBar.Element,\n SpanPrimitiveTimelineBar.Props\n>(({ now, timeRange, style, ...props }, ref) => {\n const contextRange = useContext(SpanTimelineRangeContext);\n const spanTimeRange = useAuiState((s) => s.span.timeRange);\n const startedAt = useAuiState((s) => s.span.startedAt);\n const endedAt = useAuiState((s) => s.span.endedAt);\n const status = useAuiState((s) => s.span.status);\n const type = useAuiState((s) => s.span.type);\n\n const vars = getSpanTimelineBarVars({\n startedAt,\n endedAt,\n timeRange: timeRange ?? contextRange ?? spanTimeRange,\n now,\n });\n\n const mergedStyle: TimelineCssProperties = {\n ...style,\n position: \"absolute\",\n insetInlineStart: \"var(--span-timeline-left)\",\n inlineSize:\n \"max(var(--span-timeline-width), var(--span-timeline-min-width, 0px))\",\n \"--span-timeline-left\": `${vars.leftPercent}%`,\n \"--span-timeline-end\": `${vars.endPercent}%`,\n \"--span-timeline-width\": `${vars.widthPercent}%`,\n \"--span-timeline-duration-ms\": vars.durationMs,\n };\n\n return (\n <Primitive.div\n {...props}\n ref={ref}\n style={mergedStyle}\n data-span-status={status}\n data-span-type={type}\n data-span-running={endedAt === null ? \"\" : undefined}\n />\n );\n});\n\nSpanPrimitiveTimelineBar.displayName = \"SpanPr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AA,MAAA0C;CAAA,OAAAA,KAAA1C,EAAA;CAAA,OAPF0C;AAOE,CAEL;AAEDxB,yBAAyBD,cAAc;AA/GrC,SAAAT,MAAAmC,GAAA;CAAA,OACyCA,EAACC,KAAK/C;AAAU;AAuEzD,SAAAiC,OAAAa,GAAA;CAAA,OAEyCA,EAACC,KAAK/C;AAAU;AAFzD,SAAAkC,OAAAc,KAAA;CAAA,OAGqCF,IAACC,KAAKvB;AAAU;AAHrD,SAAAW,OAAAc,KAAA;CAAA,OAImCH,IAACC,KAAKtB;AAAQ;AAJjD,SAAAY,OAAAa,KAAA;CAAA,OAKkCJ,IAACC,KAAKX;AAAO;AAL/C,SAAAG,OAAAY,KAAA;CAAA,OAMgCL,IAACC,KAAKT;AAAK"}
|
|
@@ -1,12 +1,10 @@
|
|
|
1
|
-
import { ComponentPropsWithoutRef, ComponentRef } from "react";
|
|
1
|
+
import { type ComponentPropsWithoutRef, type ComponentRef } from "react";
|
|
2
2
|
import { Primitive } from "@radix-ui/react-primitive";
|
|
3
|
-
//#region src/primitives/span/SpanTypeBadge.d.ts
|
|
4
3
|
export declare namespace SpanPrimitiveTypeBadge {
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
type Element = ComponentRef<typeof Primitive.span>;
|
|
5
|
+
type Props = ComponentPropsWithoutRef<typeof Primitive.span>;
|
|
7
6
|
}
|
|
8
7
|
export declare const SpanPrimitiveTypeBadge: import("react").ForwardRefExoticComponent<Omit<import("react").ClassAttributes<HTMLSpanElement> & import("react").HTMLAttributes<HTMLSpanElement> & {
|
|
9
|
-
|
|
8
|
+
asChild?: boolean;
|
|
10
9
|
}, "ref"> & import("react").RefAttributes<HTMLSpanElement>>;
|
|
11
|
-
//#endregion
|
|
12
10
|
//# sourceMappingURL=SpanTypeBadge.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SpanTypeBadge.d.ts","
|
|
1
|
+
{"version":3,"file":"SpanTypeBadge.d.ts","sourceRoot":"","sources":["../../../src/primitives/span/SpanTypeBadge.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,wBAAwB,EAC7B,KAAK,YAAY,EAElB,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAGtD,yBAAiB,sBAAsB,CAAC;IACtC,KAAY,OAAO,GAAG,YAAY,CAAC,OAAO,SAAS,CAAC,IAAI,CAAC,CAAC;IAC1D,KAAY,KAAK,GAAG,wBAAwB,CAAC,OAAO,SAAS,CAAC,IAAI,CAAC,CAAC;CACrE;AAED,eAAO,MAAM,sBAAsB;;2DAWjC,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { c } from "@assistant-ui/tap/react-shim/compiler-runtime";
|
|
2
|
-
import { forwardRef } from "@assistant-ui/tap/react-shim";
|
|
3
|
-
import { Primitive } from "@radix-ui/react-primitive";
|
|
4
2
|
import { useAuiState } from "@assistant-ui/store";
|
|
5
3
|
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
import { forwardRef } from "@assistant-ui/tap/react-shim";
|
|
5
|
+
import { Primitive } from "@radix-ui/react-primitive";
|
|
6
6
|
//#region src/primitives/span/SpanTypeBadge.tsx
|
|
7
7
|
const SpanPrimitiveTypeBadge = forwardRef((props, ref) => {
|
|
8
8
|
const $ = c(5);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SpanTypeBadge.js","names":["ComponentPropsWithoutRef","ComponentRef","forwardRef","Primitive","useAuiState","SpanPrimitiveTypeBadge","Element","span","Props","props","ref","$","_c","type","_temp","t0","children","t1","displayName","s"],"sources":["../../../src/primitives/span/SpanTypeBadge.tsx"],"sourcesContent":["import {\n type ComponentPropsWithoutRef,\n type ComponentRef,\n forwardRef,\n} from \"react\";\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport { useAuiState } from \"@assistant-ui/store\";\n\nexport namespace SpanPrimitiveTypeBadge {\n export type Element = ComponentRef<typeof Primitive.span>;\n export type Props = ComponentPropsWithoutRef<typeof Primitive.span>;\n}\n\nexport const SpanPrimitiveTypeBadge = forwardRef<\n SpanPrimitiveTypeBadge.Element,\n SpanPrimitiveTypeBadge.Props\n>((props, ref) => {\n const type = useAuiState((s) => s.span.type);\n\n return (\n <Primitive.span {...props} ref={ref} data-span-type={type}>\n {props.children ?? type}\n </Primitive.span>\n );\n});\n\nSpanPrimitiveTypeBadge.displayName = \"SpanPrimitive.TypeBadge\";\n"],"mappings":";;;;;;AAaA,MAAaK,yBAAyBH,YAGpCO,OAAAC,QAAA;CAAA,MAAAC,IAAAC,EAAA,CAAA;CACA,MAAAC,OAAaT,YAAYU,KAAkB;CAItC,MAAAC,KAAAN,MAAKO,YAALH;CAAsB,IAAAI;CAAA,IAAAN,EAAA,OAAAF,SAAAE,EAAA,OAAAD,OAAAC,EAAA,OAAAI,MAAAJ,EAAA,OAAAE,MAAA;EADzBI,KAAA,oBAAA,UAAA,MAAA;GAAA,GAAoBR;GAAYC;GAAqBG,kBAAAA;GAClDE,UAAAA;EACH,CAAA;EAAiBJ,EAAA,KAAAF;EAAAE,EAAA,KAAAD;EAAAC,EAAA,KAAAI;EAAAJ,EAAA,KAAAE;EAAAF,EAAA,KAAAM;CAAA,OAAAA,KAAAN,EAAA;CAAA,OAFjBM;AAEiB,CAEpB;AAEDZ,uBAAuBa,cAAc;AAVnC,SAAAJ,MAAAK,GAAA;CAAA,OACgCA,EAACZ,KAAKM;AAAK"}
|
|
1
|
+
{"version":3,"file":"SpanTypeBadge.js","names":["ComponentPropsWithoutRef","ComponentRef","forwardRef","Primitive","useAuiState","SpanPrimitiveTypeBadge","Element","span","Props","props","ref","$","_c","type","_temp","t0","children","t1","displayName","s","_c"],"sources":["../../../src/primitives/span/SpanTypeBadge.tsx"],"sourcesContent":["import {\n type ComponentPropsWithoutRef,\n type ComponentRef,\n forwardRef,\n} from \"react\";\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport { useAuiState } from \"@assistant-ui/store\";\n\nexport namespace SpanPrimitiveTypeBadge {\n export type Element = ComponentRef<typeof Primitive.span>;\n export type Props = ComponentPropsWithoutRef<typeof Primitive.span>;\n}\n\nexport const SpanPrimitiveTypeBadge = forwardRef<\n SpanPrimitiveTypeBadge.Element,\n SpanPrimitiveTypeBadge.Props\n>((props, ref) => {\n const type = useAuiState((s) => s.span.type);\n\n return (\n <Primitive.span {...props} ref={ref} data-span-type={type}>\n {props.children ?? type}\n </Primitive.span>\n );\n});\n\nSpanPrimitiveTypeBadge.displayName = \"SpanPrimitive.TypeBadge\";\n"],"mappings":";;;;;;AAaA,MAAaK,yBAAyBH,YAGpCO,OAAAC,QAAA;CAAA,MAAAC,IAAAC,EAAA,CAAA;CACA,MAAAC,OAAaT,YAAYU,KAAkB;CAItC,MAAAC,KAAAN,MAAKO,YAALH;CAAsB,IAAAI;CAAA,IAAAN,EAAA,OAAAF,SAAAE,EAAA,OAAAD,OAAAC,EAAA,OAAAI,MAAAJ,EAAA,OAAAE,MAAA;EADzBI,KAAA,oBAAA,UAAA,MAAA;GAAA,GAAoBR;GAAYC;GAAqBG,kBAAAA;GAClDE,UAAAA;EACH,CAAA;EAAiBJ,EAAA,KAAAF;EAAAE,EAAA,KAAAD;EAAAC,EAAA,KAAAI;EAAAJ,EAAA,KAAAE;EAAAF,EAAA,KAAAM;CAAA,OAAAA,KAAAN,EAAA;CAAA,OAFjBM;AAEiB,CAEpB;AAEDZ,uBAAuBa,cAAc;AAVnC,SAAAJ,MAAAK,GAAA;CAAA,OACgCA,EAACZ,KAAKM;AAAK"}
|
|
@@ -1,14 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
export { SpanPrimitiveChildByIndex as ChildByIndex, SpanPrimitiveChildren as Children, SpanPrimitiveCollapseToggle as CollapseToggle, SpanPrimitiveIndent as Indent, SpanPrimitiveName as Name, SpanPrimitiveRoot as Root, SpanTimelineRange, SpanPrimitiveStatusIndicator as StatusIndicator, SpanPrimitiveTimeline as Timeline, SpanPrimitiveTimelineBar as TimelineBar, SpanPrimitiveTypeBadge as TypeBadge };
|
|
11
|
-
}
|
|
12
|
-
//#endregion
|
|
13
|
-
export { SpanPrimitiveChildByIndex as ChildByIndex, SpanPrimitiveChildren as Children, SpanPrimitiveCollapseToggle as CollapseToggle, SpanPrimitiveIndent as Indent, SpanPrimitiveName as Name, SpanPrimitiveRoot as Root, type SpanTimelineRange, SpanPrimitiveStatusIndicator as StatusIndicator, SpanPrimitiveTimeline as Timeline, SpanPrimitiveTimelineBar as TimelineBar, SpanPrimitiveTypeBadge as TypeBadge, span_d_exports };
|
|
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
|
+
export { SpanPrimitiveTimeline as Timeline, SpanPrimitiveTimelineBar as TimelineBar, type SpanTimelineRange, } from "./span/SpanTimeline.js";
|
|
9
|
+
export { SpanPrimitiveChildByIndex as ChildByIndex } from "./span/SpanChildren.js";
|
|
14
10
|
//# sourceMappingURL=span.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"span.d.ts","
|
|
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;AACxE,OAAO,EACL,qBAAqB,IAAI,QAAQ,EACjC,wBAAwB,IAAI,WAAW,EACvC,KAAK,iBAAiB,GACvB,+BAA4B;AAC7B,OAAO,EAAE,yBAAyB,IAAI,YAAY,EAAE,+BAA4B"}
|
|
@@ -1,18 +1,16 @@
|
|
|
1
1
|
import "../o11y-scope.js";
|
|
2
|
-
import { ClientOutput } from "@assistant-ui/store";
|
|
3
|
-
//#region src/resources/SpanResource.d.ts
|
|
2
|
+
import { type ClientOutput } from "@assistant-ui/store";
|
|
4
3
|
export type SpanData = {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
4
|
+
id: string;
|
|
5
|
+
parentSpanId: string | null;
|
|
6
|
+
name: string;
|
|
7
|
+
type: string;
|
|
8
|
+
status: "running" | "completed" | "failed" | "skipped";
|
|
9
|
+
startedAt: number;
|
|
10
|
+
endedAt: number | null;
|
|
11
|
+
latencyMs: number | null;
|
|
13
12
|
};
|
|
14
13
|
export declare const SpanResource: import("@assistant-ui/tap").Resource<ClientOutput<"span">, [{
|
|
15
|
-
|
|
14
|
+
spans: SpanData[];
|
|
16
15
|
}]>;
|
|
17
|
-
//#endregion
|
|
18
16
|
//# sourceMappingURL=SpanResource.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SpanResource.d.ts","
|
|
1
|
+
{"version":3,"file":"SpanResource.d.ts","sourceRoot":"","sources":["../../src/resources/SpanResource.tsx"],"names":[],"mappings":"AAAA,0BAAuB;AAIvB,OAAO,EAAmB,KAAK,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAGzE,MAAM,MAAM,QAAQ,GAAG;IACrB,EAAE,EAAE,MAAM,CAAC;IACX,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,SAAS,GAAG,WAAW,GAAG,QAAQ,GAAG,SAAS,CAAC;IACvD,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1B,CAAC;AAoQF,eAAO,MAAM,YAAY;WAlEhB,QAAQ,EAAE;GAkEkC,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { c } from "@assistant-ui/tap/react-shim/compiler-runtime";
|
|
2
|
-
import { useState } from "@assistant-ui/tap/react-shim";
|
|
3
2
|
import { useClientLookup } from "@assistant-ui/store";
|
|
3
|
+
import { useState } from "@assistant-ui/tap/react-shim";
|
|
4
4
|
import { resource, withKey } from "@assistant-ui/tap";
|
|
5
5
|
//#region src/resources/SpanResource.tsx
|
|
6
6
|
function calculateDepth(spanId, parents, cache) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SpanResource.js","names":["useMemo","useState","resource","withKey","useClientLookup","ClientOutput","SpanItemState","SpanState","SpanData","id","parentSpanId","name","type","status","startedAt","endedAt","latencyMs","calculateDepth","spanId","parents","Map","cache","cached","get","undefined","path","current","depth","currentDepth","push","index","length","set","normalizeSpanParents","spanMap","span","values","has","resolved","Set","keys","pathIds","add","enrichSpans","rawSpans","allSpans","timeRange","min","max","depthCache","childrenCount","Infinity","hasChildren","isCollapsed","end","Date","now","buildFlatList","collapsedIds","children","parent","group","sort","a","b","result","stack","roots","pop","kids","useSpanChildResource","onToggleCollapse","state","getState","child","Error","toggleCollapse","SpanChildResource","useSpanResource","t0","$","_c","spans","t1","setCollapsedIds","_temp","t2","visibleSpans","t3","Symbol","for","prev","next","delete","t4","t5","map","lookup","t6","t7","rootState","t8","_temp2","SpanResource"],"sources":["../../src/resources/SpanResource.tsx"],"sourcesContent":["import \"../o11y-scope\";\n\nimport { useMemo, useState } from \"react\";\nimport { resource, withKey } from \"@assistant-ui/tap\";\nimport { useClientLookup, type ClientOutput } from \"@assistant-ui/store\";\nimport type { SpanItemState, SpanState } from \"../o11y-scope\";\n\nexport type SpanData = {\n id: string;\n parentSpanId: string | null;\n name: string;\n type: string;\n status: \"running\" | \"completed\" | \"failed\" | \"skipped\";\n startedAt: number;\n endedAt: number | null;\n latencyMs: number | null;\n};\n\nfunction calculateDepth(\n spanId: string,\n parents: Map<string, string | null>,\n cache: Map<string, number>,\n): number {\n const cached = cache.get(spanId);\n if (cached !== undefined) return cached;\n\n const path: string[] = [];\n let current: string | null = spanId;\n let depth = -1;\n\n while (current !== null) {\n const currentDepth = cache.get(current);\n if (currentDepth !== undefined) {\n depth = currentDepth;\n break;\n }\n\n path.push(current);\n current = parents.get(current) ?? null;\n }\n\n for (let index = path.length - 1; index >= 0; index--) {\n depth += 1;\n cache.set(path[index]!, depth);\n }\n\n return depth;\n}\n\nfunction normalizeSpanParents(\n spanMap: Map<string, SpanData>,\n): Map<string, string | null> {\n const parents = new Map<string, string | null>();\n for (const span of spanMap.values()) {\n parents.set(\n span.id,\n span.parentSpanId && spanMap.has(span.parentSpanId)\n ? span.parentSpanId\n : null,\n );\n }\n\n const resolved = new Set<string>();\n for (const spanId of spanMap.keys()) {\n if (resolved.has(spanId)) continue;\n\n const path: string[] = [];\n const pathIds = new Set<string>();\n let current: string | null = spanId;\n\n while (current !== null && !resolved.has(current)) {\n if (pathIds.has(current)) {\n parents.set(current, null);\n break;\n }\n\n path.push(current);\n pathIds.add(current);\n current = parents.get(current) ?? null;\n }\n\n for (const id of path) resolved.add(id);\n }\n\n return parents;\n}\n\nfunction enrichSpans(rawSpans: SpanData[]): {\n allSpans: Map<string, SpanItemState>;\n parents: Map<string, string | null>;\n timeRange: { min: number; max: number };\n} {\n const spanMap = new Map<string, SpanData>();\n for (const span of rawSpans) {\n spanMap.set(span.id, span);\n }\n\n const parents = normalizeSpanParents(spanMap);\n const depthCache = new Map<string, number>();\n const childrenCount = new Map<string, number>();\n for (const span of rawSpans) {\n const parentSpanId = parents.get(span.id);\n if (parentSpanId) {\n childrenCount.set(\n parentSpanId,\n (childrenCount.get(parentSpanId) ?? 0) + 1,\n );\n }\n }\n\n const allSpans = new Map<string, SpanItemState>();\n let min = Infinity;\n let max = -Infinity;\n\n for (const span of rawSpans) {\n const depth = calculateDepth(span.id, parents, depthCache);\n const hasChildren = (childrenCount.get(span.id) ?? 0) > 0;\n allSpans.set(span.id, {\n ...span,\n parentSpanId: parents.get(span.id) ?? null,\n depth,\n hasChildren,\n isCollapsed: false,\n });\n\n if (span.startedAt < min) min = span.startedAt;\n const end = span.endedAt ?? Date.now();\n if (end > max) max = end;\n }\n\n if (min === Infinity) min = Date.now();\n if (max === -Infinity) max = Date.now();\n if (max === min) max = min + 100;\n\n return { allSpans, parents, timeRange: { min, max } };\n}\n\nfunction buildFlatList(\n allSpans: Map<string, SpanItemState>,\n parents: Map<string, string | null>,\n collapsedIds: Set<string>,\n): SpanItemState[] {\n const children = new Map<string | null, SpanItemState[]>();\n for (const span of allSpans.values()) {\n const parent = parents.get(span.id) ?? null;\n let group = children.get(parent);\n if (!group) {\n group = [];\n children.set(parent, group);\n }\n group.push(span);\n }\n\n for (const group of children.values()) {\n group.sort((a, b) => a.startedAt - b.startedAt);\n }\n\n const result: SpanItemState[] = [];\n const stack: SpanItemState[] = [];\n const roots = children.get(null) ?? [];\n for (let index = roots.length - 1; index >= 0; index--) {\n stack.push(roots[index]!);\n }\n\n while (stack.length > 0) {\n const span = stack.pop()!;\n const isCollapsed = collapsedIds.has(span.id);\n result.push({ ...span, isCollapsed });\n\n if (!isCollapsed) {\n const kids = children.get(span.id) ?? [];\n for (let index = kids.length - 1; index >= 0; index--) {\n stack.push(kids[index]!);\n }\n }\n }\n\n return result;\n}\n\nconst useSpanChildResource = ({\n span,\n timeRange,\n onToggleCollapse,\n}: {\n span: SpanItemState;\n timeRange: { min: number; max: number };\n onToggleCollapse: (spanId: string) => void;\n}): ClientOutput<\"span\"> => {\n const state: SpanState = {\n ...span,\n children: [],\n timeRange,\n };\n return {\n getState: () => state,\n child: () => {\n throw new Error(\"child spans do not have children in flat mode\");\n },\n toggleCollapse: () => {\n onToggleCollapse(span.id);\n },\n };\n};\n\nconst SpanChildResource = resource(useSpanChildResource);\n\nconst useSpanResource = ({\n spans,\n}: {\n spans: SpanData[];\n}): ClientOutput<\"span\"> => {\n const { allSpans, parents, timeRange } = useMemo(\n () => enrichSpans(spans),\n [spans],\n );\n\n const [collapsedIds, setCollapsedIds] = useState<Set<string>>(\n () => new Set(),\n );\n\n const visibleSpans = useMemo(\n () => buildFlatList(allSpans, parents, collapsedIds),\n [allSpans, parents, collapsedIds],\n );\n\n const toggleCollapse = (spanId: string) => {\n setCollapsedIds((prev) => {\n const next = new Set(prev);\n if (next.has(spanId)) {\n next.delete(spanId);\n } else {\n next.add(spanId);\n }\n return next;\n });\n };\n\n const lookup = useClientLookup(\n visibleSpans.map((span) =>\n withKey(\n span.id,\n SpanChildResource({\n span,\n timeRange,\n onToggleCollapse: toggleCollapse,\n }),\n ),\n ),\n );\n\n const rootState: SpanState = {\n id: \"__root__\",\n parentSpanId: null,\n name: \"\",\n type: \"root\",\n status: \"completed\",\n startedAt: timeRange.min,\n endedAt: timeRange.max,\n latencyMs: timeRange.max - timeRange.min,\n depth: -1,\n hasChildren: lookup.state.length > 0,\n isCollapsed: false,\n children: lookup.state,\n timeRange,\n };\n\n return {\n getState: () => rootState,\n child: lookup.get,\n toggleCollapse: () => {\n // Root span collapse is a no-op\n },\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AaE,eAAerG,SAAS4E,eAAe;AArE5B,SAAAO,QAAA;CAAA,uBAWd,IAAI9C,IAAI;AAAC;AAXK,SAAA+D,SAAA,CAAA"}
|
|
1
|
+
{"version":3,"file":"SpanResource.js","names":["useMemo","useState","resource","withKey","useClientLookup","ClientOutput","SpanItemState","SpanState","SpanData","id","parentSpanId","name","type","status","startedAt","endedAt","latencyMs","calculateDepth","spanId","parents","Map","cache","cached","get","undefined","path","current","depth","currentDepth","push","index","length","set","normalizeSpanParents","spanMap","span","values","has","resolved","Set","keys","pathIds","add","enrichSpans","rawSpans","allSpans","timeRange","min","max","depthCache","childrenCount","Infinity","hasChildren","isCollapsed","end","Date","now","buildFlatList","collapsedIds","children","parent","group","sort","a","b","result","stack","roots","pop","kids","useSpanChildResource","onToggleCollapse","state","getState","child","Error","toggleCollapse","SpanChildResource","useSpanResource","t0","$","_c","spans","t1","setCollapsedIds","_temp","t2","visibleSpans","t3","Symbol","for","prev","next","delete","t4","t5","map","lookup","t6","t7","rootState","t8","_temp2","SpanResource","_c"],"sources":["../../src/resources/SpanResource.tsx"],"sourcesContent":["import \"../o11y-scope\";\n\nimport { useMemo, useState } from \"react\";\nimport { resource, withKey } from \"@assistant-ui/tap\";\nimport { useClientLookup, type ClientOutput } from \"@assistant-ui/store\";\nimport type { SpanItemState, SpanState } from \"../o11y-scope\";\n\nexport type SpanData = {\n id: string;\n parentSpanId: string | null;\n name: string;\n type: string;\n status: \"running\" | \"completed\" | \"failed\" | \"skipped\";\n startedAt: number;\n endedAt: number | null;\n latencyMs: number | null;\n};\n\nfunction calculateDepth(\n spanId: string,\n parents: Map<string, string | null>,\n cache: Map<string, number>,\n): number {\n const cached = cache.get(spanId);\n if (cached !== undefined) return cached;\n\n const path: string[] = [];\n let current: string | null = spanId;\n let depth = -1;\n\n while (current !== null) {\n const currentDepth = cache.get(current);\n if (currentDepth !== undefined) {\n depth = currentDepth;\n break;\n }\n\n path.push(current);\n current = parents.get(current) ?? null;\n }\n\n for (let index = path.length - 1; index >= 0; index--) {\n depth += 1;\n cache.set(path[index]!, depth);\n }\n\n return depth;\n}\n\nfunction normalizeSpanParents(\n spanMap: Map<string, SpanData>,\n): Map<string, string | null> {\n const parents = new Map<string, string | null>();\n for (const span of spanMap.values()) {\n parents.set(\n span.id,\n span.parentSpanId && spanMap.has(span.parentSpanId)\n ? span.parentSpanId\n : null,\n );\n }\n\n const resolved = new Set<string>();\n for (const spanId of spanMap.keys()) {\n if (resolved.has(spanId)) continue;\n\n const path: string[] = [];\n const pathIds = new Set<string>();\n let current: string | null = spanId;\n\n while (current !== null && !resolved.has(current)) {\n if (pathIds.has(current)) {\n parents.set(current, null);\n break;\n }\n\n path.push(current);\n pathIds.add(current);\n current = parents.get(current) ?? null;\n }\n\n for (const id of path) resolved.add(id);\n }\n\n return parents;\n}\n\nfunction enrichSpans(rawSpans: SpanData[]): {\n allSpans: Map<string, SpanItemState>;\n parents: Map<string, string | null>;\n timeRange: { min: number; max: number };\n} {\n const spanMap = new Map<string, SpanData>();\n for (const span of rawSpans) {\n spanMap.set(span.id, span);\n }\n\n const parents = normalizeSpanParents(spanMap);\n const depthCache = new Map<string, number>();\n const childrenCount = new Map<string, number>();\n for (const span of rawSpans) {\n const parentSpanId = parents.get(span.id);\n if (parentSpanId) {\n childrenCount.set(\n parentSpanId,\n (childrenCount.get(parentSpanId) ?? 0) + 1,\n );\n }\n }\n\n const allSpans = new Map<string, SpanItemState>();\n let min = Infinity;\n let max = -Infinity;\n\n for (const span of rawSpans) {\n const depth = calculateDepth(span.id, parents, depthCache);\n const hasChildren = (childrenCount.get(span.id) ?? 0) > 0;\n allSpans.set(span.id, {\n ...span,\n parentSpanId: parents.get(span.id) ?? null,\n depth,\n hasChildren,\n isCollapsed: false,\n });\n\n if (span.startedAt < min) min = span.startedAt;\n const end = span.endedAt ?? Date.now();\n if (end > max) max = end;\n }\n\n if (min === Infinity) min = Date.now();\n if (max === -Infinity) max = Date.now();\n if (max === min) max = min + 100;\n\n return { allSpans, parents, timeRange: { min, max } };\n}\n\nfunction buildFlatList(\n allSpans: Map<string, SpanItemState>,\n parents: Map<string, string | null>,\n collapsedIds: Set<string>,\n): SpanItemState[] {\n const children = new Map<string | null, SpanItemState[]>();\n for (const span of allSpans.values()) {\n const parent = parents.get(span.id) ?? null;\n let group = children.get(parent);\n if (!group) {\n group = [];\n children.set(parent, group);\n }\n group.push(span);\n }\n\n for (const group of children.values()) {\n group.sort((a, b) => a.startedAt - b.startedAt);\n }\n\n const result: SpanItemState[] = [];\n const stack: SpanItemState[] = [];\n const roots = children.get(null) ?? [];\n for (let index = roots.length - 1; index >= 0; index--) {\n stack.push(roots[index]!);\n }\n\n while (stack.length > 0) {\n const span = stack.pop()!;\n const isCollapsed = collapsedIds.has(span.id);\n result.push({ ...span, isCollapsed });\n\n if (!isCollapsed) {\n const kids = children.get(span.id) ?? [];\n for (let index = kids.length - 1; index >= 0; index--) {\n stack.push(kids[index]!);\n }\n }\n }\n\n return result;\n}\n\nconst useSpanChildResource = ({\n span,\n timeRange,\n onToggleCollapse,\n}: {\n span: SpanItemState;\n timeRange: { min: number; max: number };\n onToggleCollapse: (spanId: string) => void;\n}): ClientOutput<\"span\"> => {\n const state: SpanState = {\n ...span,\n children: [],\n timeRange,\n };\n return {\n getState: () => state,\n child: () => {\n throw new Error(\"child spans do not have children in flat mode\");\n },\n toggleCollapse: () => {\n onToggleCollapse(span.id);\n },\n };\n};\n\nconst SpanChildResource = resource(useSpanChildResource);\n\nconst useSpanResource = ({\n spans,\n}: {\n spans: SpanData[];\n}): ClientOutput<\"span\"> => {\n const { allSpans, parents, timeRange } = useMemo(\n () => enrichSpans(spans),\n [spans],\n );\n\n const [collapsedIds, setCollapsedIds] = useState<Set<string>>(\n () => new Set(),\n );\n\n const visibleSpans = useMemo(\n () => buildFlatList(allSpans, parents, collapsedIds),\n [allSpans, parents, collapsedIds],\n );\n\n const toggleCollapse = (spanId: string) => {\n setCollapsedIds((prev) => {\n const next = new Set(prev);\n if (next.has(spanId)) {\n next.delete(spanId);\n } else {\n next.add(spanId);\n }\n return next;\n });\n };\n\n const lookup = useClientLookup(\n visibleSpans.map((span) =>\n withKey(\n span.id,\n SpanChildResource({\n span,\n timeRange,\n onToggleCollapse: toggleCollapse,\n }),\n ),\n ),\n );\n\n const rootState: SpanState = {\n id: \"__root__\",\n parentSpanId: null,\n name: \"\",\n type: \"root\",\n status: \"completed\",\n startedAt: timeRange.min,\n endedAt: timeRange.max,\n latencyMs: timeRange.max - timeRange.min,\n depth: -1,\n hasChildren: lookup.state.length > 0,\n isCollapsed: false,\n children: lookup.state,\n timeRange,\n };\n\n return {\n getState: () => rootState,\n child: lookup.get,\n toggleCollapse: () => {\n // Root span collapse is a no-op\n },\n };\n};\n\nexport const SpanResource = resource(useSpanResource);\n"],"mappings":";;;;;AAkBA,SAASiB,eACPC,QACAC,SACAE,OACQ;CACR,MAAMC,SAASD,MAAME,IAAIL,MAAM;CAC/B,IAAII,WAAWE,KAAAA,GAAW,OAAOF;CAEjC,MAAMG,OAAiB,CAAA;CACvB,IAAIC,UAAyBR;CAC7B,IAAIS,QAAQ;CAEZ,OAAOD,YAAY,MAAM;EACvB,MAAME,eAAeP,MAAME,IAAIG,OAAO;EACtC,IAAIE,iBAAiBJ,KAAAA,GAAW;GAC9BG,QAAQC;GACR;EACF;EAEAH,KAAKI,KAAKH,OAAO;EACjBA,UAAUP,QAAQI,IAAIG,OAAO,KAAK;CACpC;CAEA,KAAK,IAAII,QAAQL,KAAKM,SAAS,GAAGD,SAAS,GAAGA,SAAS;EACrDH,SAAS;EACTN,MAAMW,IAAIP,KAAKK,QAASH,KAAK;CAC/B;CAEA,OAAOA;AACT;AAEA,SAASM,qBACPC,SAC4B;CAC5B,MAAMf,0BAAU,IAAIC,IAA2B;CAC/C,KAAK,MAAMe,QAAQD,QAAQE,OAAO,GAChCjB,QAAQa,IACNG,KAAK1B,IACL0B,KAAKzB,gBAAgBwB,QAAQG,IAAIF,KAAKzB,YAAY,IAC9C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AExB;EAGYqD,WAAMC;EAASpB,EAAA,MAAAiB,OAAAzB;EAAAQ,EAAA,MAAAe;EAAAf,EAAA,MAAAkB;EAAAlB,EAAA,MAAAlC;EAAAkC,EAAA,MAAAmB;CAAA,OAAAA,KAAAnB,EAAA;CAAA,IAAAqB;CAAA,IAAArB,EAAA,QAAAiB,OAAA1E,OAAAyD,EAAA,QAAAmB,IAAA;EADpBE,KAAA;GAAA5B,UACK0B;GAAezB,OAClBuB,OAAM1E;GAAIqD,gBACD0B;EAGlB;EAACtB,EAAA,MAAAiB,OAAA1E;EAAAyD,EAAA,MAAAmB;EAAAnB,EAAA,MAAAqB;CAAA,OAAAA,KAAArB,EAAA;CAAA,OANMqB;AAMN;AAGH,MAAaE,eAAerG,SAAS4E,eAAe;AArE5B,SAAAO,QAAA;CAAA,uBAWd,IAAI9C,IAAI;AAAC;AAXK,SAAA+D,SAAA,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@assistant-ui/react-o11y",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.46",
|
|
4
4
|
"description": "Observability primitives for @assistant-ui",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"observability",
|
|
@@ -28,8 +28,8 @@
|
|
|
28
28
|
],
|
|
29
29
|
"sideEffects": false,
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@assistant-ui/store": "^0.3.
|
|
32
|
-
"@assistant-ui/tap": "^0.9.
|
|
31
|
+
"@assistant-ui/store": "^0.3.17",
|
|
32
|
+
"@assistant-ui/tap": "^0.9.21",
|
|
33
33
|
"@radix-ui/react-primitive": "^2.1.10"
|
|
34
34
|
},
|
|
35
35
|
"peerDependencies": {
|
|
@@ -42,12 +42,13 @@
|
|
|
42
42
|
}
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
|
-
"@assistant-ui/x-buildutils": "0.0.
|
|
45
|
+
"@assistant-ui/x-buildutils": "0.0.30",
|
|
46
|
+
"@assistant-ui/x-react18": "0.0.0",
|
|
46
47
|
"@types/react": "^19.3.0",
|
|
47
48
|
"@types/react-dom": "^19.3.0",
|
|
48
49
|
"react": "^19.3.0",
|
|
49
50
|
"react-dom": "^19.3.0",
|
|
50
|
-
"vitest": "^5.0.
|
|
51
|
+
"vitest": "^5.0.3"
|
|
51
52
|
},
|
|
52
53
|
"publishConfig": {
|
|
53
54
|
"access": "public",
|
|
@@ -65,6 +66,8 @@
|
|
|
65
66
|
"scripts": {
|
|
66
67
|
"build": "aui-build",
|
|
67
68
|
"test": "vitest run",
|
|
68
|
-
"typecheck": "tsc --noEmit"
|
|
69
|
+
"typecheck": "tsc --noEmit",
|
|
70
|
+
"test:peer-react18": "vitest run --config vitest.peer-react18.config.ts",
|
|
71
|
+
"test:types:peer-react18": "aui-react18-types"
|
|
69
72
|
}
|
|
70
73
|
}
|