@assistant-ui/react-o11y 0.0.14 → 0.0.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_virtual/_rolldown/runtime.js +13 -0
- package/dist/context/SpanByIndexProvider.d.ts +7 -3
- package/dist/context/SpanByIndexProvider.d.ts.map +1 -1
- package/dist/context/SpanByIndexProvider.js +16 -12
- package/dist/context/SpanByIndexProvider.js.map +1 -1
- package/dist/index.d.ts +5 -6
- package/dist/index.js +4 -4
- package/dist/o11y-scope.d.ts +36 -35
- package/dist/o11y-scope.d.ts.map +1 -1
- package/dist/o11y-scope.js +0 -1
- package/dist/primitives/span/SpanChildren.d.ts +24 -22
- package/dist/primitives/span/SpanChildren.d.ts.map +1 -1
- package/dist/primitives/span/SpanChildren.js +32 -27
- package/dist/primitives/span/SpanChildren.js.map +1 -1
- package/dist/primitives/span/SpanCollapseToggle.d.ts +10 -6
- package/dist/primitives/span/SpanCollapseToggle.d.ts.map +1 -1
- package/dist/primitives/span/SpanCollapseToggle.js +22 -13
- package/dist/primitives/span/SpanCollapseToggle.js.map +1 -1
- package/dist/primitives/span/SpanIndent.d.ts +15 -11
- package/dist/primitives/span/SpanIndent.d.ts.map +1 -1
- package/dist/primitives/span/SpanIndent.js +23 -9
- package/dist/primitives/span/SpanIndent.js.map +1 -1
- package/dist/primitives/span/SpanName.d.ts +10 -6
- package/dist/primitives/span/SpanName.d.ts.map +1 -1
- package/dist/primitives/span/SpanName.js +13 -5
- package/dist/primitives/span/SpanName.js.map +1 -1
- package/dist/primitives/span/SpanRoot.d.ts +10 -6
- package/dist/primitives/span/SpanRoot.d.ts.map +1 -1
- package/dist/primitives/span/SpanRoot.js +21 -9
- package/dist/primitives/span/SpanRoot.js.map +1 -1
- package/dist/primitives/span/SpanStatusIndicator.d.ts +10 -6
- package/dist/primitives/span/SpanStatusIndicator.d.ts.map +1 -1
- package/dist/primitives/span/SpanStatusIndicator.js +13 -5
- package/dist/primitives/span/SpanStatusIndicator.js.map +1 -1
- package/dist/primitives/span/SpanTypeBadge.d.ts +10 -6
- package/dist/primitives/span/SpanTypeBadge.d.ts.map +1 -1
- package/dist/primitives/span/SpanTypeBadge.js +14 -5
- package/dist/primitives/span/SpanTypeBadge.js.map +1 -1
- package/dist/primitives/span.d.ts +14 -7
- package/dist/primitives/span.d.ts.map +1 -1
- package/dist/primitives/span.js +21 -7
- package/dist/primitives/span.js.map +1 -1
- package/dist/resources/SpanResource.d.ts +17 -14
- package/dist/resources/SpanResource.d.ts.map +1 -1
- package/dist/resources/SpanResource.js +127 -129
- package/dist/resources/SpanResource.js.map +1 -1
- package/package.json +6 -6
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/o11y-scope.js.map +0 -1
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
//#region \0rolldown/runtime.js
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __exportAll = (all, no_symbols) => {
|
|
4
|
+
let target = {};
|
|
5
|
+
for (var name in all) __defProp(target, name, {
|
|
6
|
+
get: all[name],
|
|
7
|
+
enumerable: true
|
|
8
|
+
});
|
|
9
|
+
if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
|
|
10
|
+
return target;
|
|
11
|
+
};
|
|
12
|
+
//#endregion
|
|
13
|
+
export { __exportAll };
|
|
@@ -1,5 +1,9 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { FC, PropsWithChildren } from "react";
|
|
2
|
+
|
|
3
|
+
//#region src/context/SpanByIndexProvider.d.ts
|
|
4
|
+
declare const SpanByIndexProvider: FC<PropsWithChildren<{
|
|
5
|
+
index: number;
|
|
4
6
|
}>>;
|
|
7
|
+
//#endregion
|
|
8
|
+
export { SpanByIndexProvider };
|
|
5
9
|
//# sourceMappingURL=SpanByIndexProvider.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SpanByIndexProvider.d.ts","
|
|
1
|
+
{"version":3,"file":"SpanByIndexProvider.d.ts","names":[],"sources":["../../src/context/SpanByIndexProvider.tsx"],"mappings":";;;cAGa,mBAAA,EAAqB,EAAE,CAAC,iBAAA;EAAoB,KAAA;AAAA"}
|
|
@@ -1,14 +1,18 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
import { AuiProvider, Derived, useAui } from "@assistant-ui/store";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
//#region src/context/SpanByIndexProvider.tsx
|
|
4
|
+
const SpanByIndexProvider = ({ index, children }) => {
|
|
5
|
+
const parentAui = useAui();
|
|
6
|
+
return /* @__PURE__ */ jsx(AuiProvider, {
|
|
7
|
+
value: useAui({ span: Derived({
|
|
8
|
+
source: "span",
|
|
9
|
+
query: { index },
|
|
10
|
+
get: () => parentAui.span().child({ index })
|
|
11
|
+
}) }),
|
|
12
|
+
children
|
|
13
|
+
});
|
|
13
14
|
};
|
|
15
|
+
//#endregion
|
|
16
|
+
export { SpanByIndexProvider };
|
|
17
|
+
|
|
14
18
|
//# sourceMappingURL=SpanByIndexProvider.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SpanByIndexProvider.js","
|
|
1
|
+
{"version":3,"file":"SpanByIndexProvider.js","names":[],"sources":["../../src/context/SpanByIndexProvider.tsx"],"sourcesContent":["import type { FC, PropsWithChildren } from \"react\";\nimport { useAui, 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 aui = useAui({\n span: Derived({\n source: \"span\",\n query: { index },\n get: () => parentAui.span().child({ index }),\n }),\n });\n\n return <AuiProvider value={aui}>{children}</AuiProvider>;\n};\n"],"mappings":";;;AAGA,MAAa,uBAAiE,EAC5E,OACA,eACI;CACJ,MAAM,YAAY,OAAO;CAUzB,OAAO,oBAAC,aAAD;EAAa,OARR,OAAO,EACjB,MAAM,QAAQ;GACZ,QAAQ;GACR,OAAO,EAAE,MAAM;GACf,WAAW,UAAU,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC;EAC7C,CAAC,EACH,CAE6B;EAAI;CAAsB,CAAA;AACzD"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
export { SpanByIndexProvider
|
|
6
|
-
//# sourceMappingURL=index.d.ts.map
|
|
1
|
+
import { SpanByIndexProvider } from "./context/SpanByIndexProvider.js";
|
|
2
|
+
import { SpanItemState, SpanState } from "./o11y-scope.js";
|
|
3
|
+
import { span_d_exports } from "./primitives/span.js";
|
|
4
|
+
import { SpanData, SpanResource } from "./resources/SpanResource.js";
|
|
5
|
+
export { SpanByIndexProvider, type SpanData, type SpanItemState, span_d_exports as SpanPrimitive, SpanResource, type SpanState };
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { SpanByIndexProvider } from "./context/SpanByIndexProvider.js";
|
|
2
|
+
import { span_exports } from "./primitives/span.js";
|
|
3
|
+
import { SpanResource } from "./resources/SpanResource.js";
|
|
4
|
+
export { SpanByIndexProvider, span_exports as SpanPrimitive, SpanResource };
|
package/dist/o11y-scope.d.ts
CHANGED
|
@@ -1,44 +1,45 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
1
|
+
//#region src/o11y-scope.d.ts
|
|
2
|
+
type SpanItemState = {
|
|
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;
|
|
14
14
|
};
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
15
|
+
type SpanState = SpanItemState & {
|
|
16
|
+
children: SpanItemState[];
|
|
17
|
+
timeRange: {
|
|
18
|
+
min: number;
|
|
19
|
+
max: number;
|
|
20
|
+
};
|
|
21
21
|
};
|
|
22
22
|
type SpanMethods = {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
23
|
+
getState: () => SpanState;
|
|
24
|
+
child: (lookup: SpanMeta["query"]) => SpanMethods;
|
|
25
|
+
toggleCollapse: () => void;
|
|
26
26
|
};
|
|
27
27
|
type SpanMeta = {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
28
|
+
source: "span";
|
|
29
|
+
query: {
|
|
30
|
+
index: number;
|
|
31
|
+
} | {
|
|
32
|
+
key: string;
|
|
33
|
+
};
|
|
34
34
|
};
|
|
35
35
|
declare module "@assistant-ui/store" {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
36
|
+
interface ScopeRegistry {
|
|
37
|
+
span: {
|
|
38
|
+
methods: SpanMethods;
|
|
39
|
+
meta: SpanMeta;
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
42
|
}
|
|
43
|
-
|
|
43
|
+
//#endregion
|
|
44
|
+
export { SpanItemState, SpanState };
|
|
44
45
|
//# 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","names":[],"sources":["../src/o11y-scope.ts"],"mappings":";KAEY,aAAA;EACV,EAAA;EACA,YAAA;EACA,IAAA;EACA,IAAA;EACA,MAAA;EACA,SAAA;EACA,OAAA;EACA,SAAA;EACA,KAAA;EACA,WAAA;EACA,WAAA;AAAA;AAAA,KAGU,SAAA,GAAY,aAAA;EACtB,QAAA,EAAU,aAAa;EACvB,SAAA;IAAa,GAAA;IAAa,GAAA;EAAA;AAAA;AAAA,KAGvB,WAAA;EACH,QAAA,QAAgB,SAAA;EAChB,KAAA,GAAQ,MAAA,EAAQ,QAAA,cAAsB,WAAA;EACtC,cAAA;AAAA;AAAA,KAGG,QAAA;EACH,MAAA;EACA,KAAA;IAAS,KAAA;EAAA;IAAoB,GAAA;EAAA;AAAA;AAAA;EAAA,UAInB,aAAA;IACR,IAAA;MACE,OAAA,EAAS,WAAA;MACT,IAAA,EAAM,QAAQ;IAAA;EAAA;AAAA"}
|
package/dist/o11y-scope.js
CHANGED
|
@@ -1,27 +1,29 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
1
|
+
import { SpanState } from "../../o11y-scope.js";
|
|
2
|
+
import { ComponentType, FC, ReactNode } from "react";
|
|
3
|
+
|
|
4
|
+
//#region src/primitives/span/SpanChildren.d.ts
|
|
3
5
|
type SpanChildrenComponentConfig = {
|
|
4
|
-
|
|
6
|
+
Span: ComponentType;
|
|
5
7
|
};
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
};
|
|
8
|
+
declare namespace SpanPrimitiveChildren {
|
|
9
|
+
type Props = {
|
|
10
|
+
components: SpanChildrenComponentConfig;
|
|
11
|
+
children?: never;
|
|
12
|
+
} | {
|
|
13
|
+
/** Render function called for each child span. Receives the span. */children: (value: {
|
|
14
|
+
span: SpanState;
|
|
15
|
+
}) => ReactNode;
|
|
16
|
+
components?: never;
|
|
17
|
+
};
|
|
17
18
|
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
19
|
+
declare namespace SpanPrimitiveChildByIndex {
|
|
20
|
+
type Props = {
|
|
21
|
+
index: number;
|
|
22
|
+
components: SpanChildrenComponentConfig;
|
|
23
|
+
};
|
|
23
24
|
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
declare const SpanPrimitiveChildByIndex: FC<SpanPrimitiveChildByIndex.Props>;
|
|
26
|
+
declare const SpanPrimitiveChildren: FC<SpanPrimitiveChildren.Props>;
|
|
27
|
+
//#endregion
|
|
28
|
+
export { SpanPrimitiveChildByIndex, SpanPrimitiveChildren };
|
|
27
29
|
//# sourceMappingURL=SpanChildren.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SpanChildren.d.ts","
|
|
1
|
+
{"version":3,"file":"SpanChildren.d.ts","names":[],"sources":["../../../src/primitives/span/SpanChildren.tsx"],"mappings":";;;;KAWK,2BAAA;EACH,IAAA,EAAM,aAAa;AAAA;AAAA,kBAGJ,qBAAA;EAAA,KACH,KAAA;IAEN,UAAA,EAAY,2BAAA;IACZ,QAAA;EAAA;IAJ8B,qEAQ9B,QAAA,GAAW,KAAA;MAAS,IAAA,EAAM,SAAA;IAAA,MAAgB,SAAA;IAC1C,UAAA;EAAA;AAAA;AAAA,kBAIS,yBAAA;EAAA,KACH,KAAA;IACV,KAAA;IACA,UAAA,EAAY,2BAA2B;EAAA;AAAA;AAAA,cAI9B,yBAAA,EAA2B,EAAE,CAAC,yBAAA,CAA0B,KAAA;AAAA,cAuDxD,qBAAA,EAAuB,EAAE,CAAC,qBAAA,CAAsB,KAAA"}
|
|
@@ -1,35 +1,40 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { memo, useMemo, } from "react";
|
|
3
|
-
import { RenderChildrenWithAccessor, useAuiState } from "@assistant-ui/store";
|
|
4
1
|
import { SpanByIndexProvider } from "../../context/SpanByIndexProvider.js";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
2
|
+
import { memo, useMemo } from "react";
|
|
3
|
+
import { RenderChildrenWithAccessor, useAuiState } from "@assistant-ui/store";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
//#region src/primitives/span/SpanChildren.tsx
|
|
6
|
+
const SpanPrimitiveChildByIndex = memo(({ index, components }) => {
|
|
7
|
+
return /* @__PURE__ */ jsx(SpanByIndexProvider, {
|
|
8
|
+
index,
|
|
9
|
+
children: /* @__PURE__ */ jsx(components.Span, {})
|
|
10
|
+
});
|
|
11
|
+
}, (prev, next) => prev.index === next.index && prev.components.Span === next.components.Span);
|
|
9
12
|
SpanPrimitiveChildByIndex.displayName = "SpanPrimitive.ChildByIndex";
|
|
10
13
|
const SpanPrimitiveChildrenInner = ({ children }) => {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
14
|
+
const childrenLength = useAuiState((s) => s.span.children.length);
|
|
15
|
+
return useMemo(() => {
|
|
16
|
+
if (childrenLength === 0) return null;
|
|
17
|
+
return Array.from({ length: childrenLength }, (_, index) => /* @__PURE__ */ jsx(SpanByIndexProvider, {
|
|
18
|
+
index,
|
|
19
|
+
children: /* @__PURE__ */ jsx(RenderChildrenWithAccessor, {
|
|
20
|
+
getItemState: (aui) => aui.span().getState(),
|
|
21
|
+
children: (getItem) => children({ get span() {
|
|
22
|
+
return getItem();
|
|
23
|
+
} })
|
|
24
|
+
})
|
|
25
|
+
}, index));
|
|
26
|
+
}, [childrenLength, children]);
|
|
21
27
|
};
|
|
22
|
-
const SpanPrimitiveChildrenImpl = ({ components, children
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
}
|
|
26
|
-
return _jsx(SpanPrimitiveChildrenInner, { children: children });
|
|
28
|
+
const SpanPrimitiveChildrenImpl = ({ components, children }) => {
|
|
29
|
+
if (components) return /* @__PURE__ */ jsx(SpanPrimitiveChildrenInner, { children: () => /* @__PURE__ */ jsx(components.Span, {}) });
|
|
30
|
+
return /* @__PURE__ */ jsx(SpanPrimitiveChildrenInner, { children });
|
|
27
31
|
};
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
}
|
|
32
|
-
return prev.components.Span === next.components.Span;
|
|
32
|
+
const SpanPrimitiveChildren = memo(SpanPrimitiveChildrenImpl, (prev, next) => {
|
|
33
|
+
if (prev.children || next.children) return prev.children === next.children;
|
|
34
|
+
return prev.components.Span === next.components.Span;
|
|
33
35
|
});
|
|
34
36
|
SpanPrimitiveChildren.displayName = "SpanPrimitive.Children";
|
|
37
|
+
//#endregion
|
|
38
|
+
export { SpanPrimitiveChildByIndex, SpanPrimitiveChildren };
|
|
39
|
+
|
|
35
40
|
//# sourceMappingURL=SpanChildren.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SpanChildren.js","
|
|
1
|
+
{"version":3,"file":"SpanChildren.js","names":[],"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\n getItemState={(aui) => aui.span().getState()}\n >\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,MAAa,4BACX,MACG,EAAE,OAAO,iBAAiB;CACzB,OACE,oBAAC,qBAAD;EAA4B;YAC1B,oBAAC,WAAW,MAAZ,CAAkB,CAAA;CACC,CAAA;AAEzB,IACC,MAAM,SACL,KAAK,UAAU,KAAK,SACpB,KAAK,WAAW,SAAS,KAAK,WAAW,IAC7C;AAEF,0BAA0B,cAAc;AAExC,MAAM,8BAEA,EAAE,eAAe;CACrB,MAAM,iBAAiB,aAAa,MAAM,EAAE,KAAK,SAAS,MAAM;CAEhE,OAAO,cAAc;EACnB,IAAI,mBAAmB,GAAG,OAAO;EACjC,OAAO,MAAM,KAAK,EAAE,QAAQ,eAAe,IAAI,GAAG,UAChD,oBAAC,qBAAD;GAAwC;aACtC,oBAAC,4BAAD;IACE,eAAe,QAAQ,IAAI,KAAK,EAAE,SAAS;eAEzC,YACA,SAAS,EACP,IAAI,OAAO;KACT,OAAO,QAAQ;IACjB,EACF,CAAC;GAEuB,CAAA;EACT,GAZK,KAYL,CACtB;CACH,GAAG,CAAC,gBAAgB,QAAQ,CAAC;AAC/B;AAEA,MAAM,6BAA8D,EAClE,YACA,eACI;CACJ,IAAI,YACF,OACE,oBAAC,4BAAD,EAAA,gBACS,oBAAC,WAAW,MAAZ,CAAkB,CAAA,EACC,CAAA;CAGhC,OAAO,oBAAC,4BAAD,EAA6B,SAAqC,CAAA;AAC3E;AAEA,MAAa,wBAAyD,KACpE,4BACC,MAAM,SAAS;CACd,IAAI,KAAK,YAAY,KAAK,UACxB,OAAO,KAAK,aAAa,KAAK;CAEhC,OAAO,KAAK,WAAY,SAAS,KAAK,WAAY;AACpD,CACF;AAEA,sBAAsB,cAAc"}
|
|
@@ -1,10 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ComponentPropsWithoutRef, ComponentRef } from "react";
|
|
2
2
|
import { Primitive } from "@radix-ui/react-primitive";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
|
|
4
|
+
//#region src/primitives/span/SpanCollapseToggle.d.ts
|
|
5
|
+
declare namespace SpanPrimitiveCollapseToggle {
|
|
6
|
+
type Element = ComponentRef<typeof Primitive.button>;
|
|
7
|
+
type Props = ComponentPropsWithoutRef<typeof Primitive.button>;
|
|
6
8
|
}
|
|
7
|
-
|
|
8
|
-
|
|
9
|
+
declare const SpanPrimitiveCollapseToggle: import("react").ForwardRefExoticComponent<Omit<import("react").ClassAttributes<HTMLButtonElement> & import("react").ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
10
|
+
asChild?: boolean;
|
|
9
11
|
}, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
|
|
12
|
+
//#endregion
|
|
13
|
+
export { SpanPrimitiveCollapseToggle };
|
|
10
14
|
//# sourceMappingURL=SpanCollapseToggle.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SpanCollapseToggle.d.ts","
|
|
1
|
+
{"version":3,"file":"SpanCollapseToggle.d.ts","names":[],"sources":["../../../src/primitives/span/SpanCollapseToggle.tsx"],"mappings":";;;;kBAQiB,2BAAA;EAAA,KACH,OAAA,GAAU,YAAA,QAAoB,SAAA,CAAU,MAAA;EAAA,KACxC,KAAA,GAAQ,wBAAA,QAAgC,SAAA,CAAU,MAAA;AAAA;AAAA,cAGnD,2BAAA,kBAA2B,yBAAA,CAAA,IAAA,iBAAA,eAAA,CAAA,iBAAA,oBAAA,oBAAA,CAAA,iBAAA"}
|
|
@@ -1,18 +1,27 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { forwardRef, } from "react";
|
|
1
|
+
import { forwardRef } from "react";
|
|
3
2
|
import { Primitive } from "@radix-ui/react-primitive";
|
|
4
3
|
import { useAui, useAuiState } from "@assistant-ui/store";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
//#region src/primitives/span/SpanCollapseToggle.tsx
|
|
6
|
+
const SpanPrimitiveCollapseToggle = forwardRef((props, ref) => {
|
|
7
|
+
const hasChildren = useAuiState((s) => s.span.hasChildren);
|
|
8
|
+
const isCollapsed = useAuiState((s) => s.span.isCollapsed);
|
|
9
|
+
const aui = useAui();
|
|
10
|
+
if (!hasChildren) return null;
|
|
11
|
+
return /* @__PURE__ */ jsx(Primitive.button, {
|
|
12
|
+
type: "button",
|
|
13
|
+
...props,
|
|
14
|
+
ref,
|
|
15
|
+
"data-collapsed": isCollapsed,
|
|
16
|
+
onClick: (e) => {
|
|
17
|
+
e.stopPropagation();
|
|
18
|
+
aui.span().toggleCollapse();
|
|
19
|
+
props.onClick?.(e);
|
|
20
|
+
}
|
|
21
|
+
});
|
|
16
22
|
});
|
|
17
23
|
SpanPrimitiveCollapseToggle.displayName = "SpanPrimitive.CollapseToggle";
|
|
24
|
+
//#endregion
|
|
25
|
+
export { SpanPrimitiveCollapseToggle };
|
|
26
|
+
|
|
18
27
|
//# sourceMappingURL=SpanCollapseToggle.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SpanCollapseToggle.js","
|
|
1
|
+
{"version":3,"file":"SpanCollapseToggle.js","names":[],"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,MAAa,8BAA8B,YAGxC,OAAO,QAAQ;CAChB,MAAM,cAAc,aAAa,MAAM,EAAE,KAAK,WAAW;CACzD,MAAM,cAAc,aAAa,MAAM,EAAE,KAAK,WAAW;CACzD,MAAM,MAAM,OAAO;CAEnB,IAAI,CAAC,aAAa,OAAO;CAEzB,OACE,oBAAC,UAAU,QAAX;EACE,MAAK;EACL,GAAI;EACC;EACL,kBAAgB;EAChB,UAAU,MAAM;GACd,EAAE,gBAAgB;GAClB,IAAI,KAAK,EAAE,eAAe;GAC1B,MAAM,UAAU,CAAC;EACnB;CACD,CAAA;AAEL,CAAC;AAED,4BAA4B,cAAc"}
|
|
@@ -1,16 +1,20 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ComponentPropsWithoutRef, ComponentRef } from "react";
|
|
2
2
|
import { Primitive } from "@radix-ui/react-primitive";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
};
|
|
9
|
-
}
|
|
10
|
-
export declare const SpanPrimitiveIndent: import("react").ForwardRefExoticComponent<Omit<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & {
|
|
11
|
-
asChild?: boolean;
|
|
12
|
-
}, "ref"> & {
|
|
3
|
+
|
|
4
|
+
//#region src/primitives/span/SpanIndent.d.ts
|
|
5
|
+
declare namespace SpanPrimitiveIndent {
|
|
6
|
+
type Element = ComponentRef<typeof Primitive.div>;
|
|
7
|
+
type Props = ComponentPropsWithoutRef<typeof Primitive.div> & {
|
|
13
8
|
baseIndent?: number;
|
|
14
9
|
indentPerLevel?: number;
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
declare const SpanPrimitiveIndent: import("react").ForwardRefExoticComponent<Omit<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & {
|
|
13
|
+
asChild?: boolean;
|
|
14
|
+
}, "ref"> & {
|
|
15
|
+
baseIndent?: number;
|
|
16
|
+
indentPerLevel?: number;
|
|
15
17
|
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
18
|
+
//#endregion
|
|
19
|
+
export { SpanPrimitiveIndent };
|
|
16
20
|
//# sourceMappingURL=SpanIndent.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SpanIndent.d.ts","
|
|
1
|
+
{"version":3,"file":"SpanIndent.d.ts","names":[],"sources":["../../../src/primitives/span/SpanIndent.tsx"],"mappings":";;;;kBASiB,mBAAA;EAAA,KACH,OAAA,GAAU,YAAA,QAAoB,SAAA,CAAU,GAAA;EAAA,KACxC,KAAA,GAAQ,wBAAA,QAAgC,SAAA,CAAU,GAAA;IAC5D,UAAA;IACA,cAAA;EAAA;AAAA;AAAA,cAIS,mBAAA,kBAAmB,yBAAA,CAAA,IAAA,iBAAA,eAAA,CAAA,cAAA,oBAAA,cAAA,CAAA,cAAA"}
|
|
@@ -1,14 +1,28 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { forwardRef, useMemo, } from "react";
|
|
1
|
+
import { forwardRef, useMemo } from "react";
|
|
3
2
|
import { Primitive } from "@radix-ui/react-primitive";
|
|
4
3
|
import { useAuiState } from "@assistant-ui/store";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
//#region src/primitives/span/SpanIndent.tsx
|
|
6
|
+
const SpanPrimitiveIndent = forwardRef(({ baseIndent = 8, indentPerLevel = 12, style, ...props }, ref) => {
|
|
7
|
+
const depth = useAuiState((s) => s.span.depth);
|
|
8
|
+
const mergedStyle = useMemo(() => ({
|
|
9
|
+
...style,
|
|
10
|
+
paddingLeft: baseIndent + depth * indentPerLevel
|
|
11
|
+
}), [
|
|
12
|
+
style,
|
|
13
|
+
baseIndent,
|
|
14
|
+
depth,
|
|
15
|
+
indentPerLevel
|
|
16
|
+
]);
|
|
17
|
+
return /* @__PURE__ */ jsx(Primitive.div, {
|
|
18
|
+
...props,
|
|
19
|
+
ref,
|
|
20
|
+
style: mergedStyle,
|
|
21
|
+
"data-span-depth": depth
|
|
22
|
+
});
|
|
12
23
|
});
|
|
13
24
|
SpanPrimitiveIndent.displayName = "SpanPrimitive.Indent";
|
|
25
|
+
//#endregion
|
|
26
|
+
export { SpanPrimitiveIndent };
|
|
27
|
+
|
|
14
28
|
//# sourceMappingURL=SpanIndent.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SpanIndent.js","
|
|
1
|
+
{"version":3,"file":"SpanIndent.js","names":[],"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,MAAa,sBAAsB,YAGhC,EAAE,aAAa,GAAG,iBAAiB,IAAI,OAAO,GAAG,SAAS,QAAQ;CACnE,MAAM,QAAQ,aAAa,MAAM,EAAE,KAAK,KAAK;CAE7C,MAAM,cAAc,eACX;EACL,GAAG;EACH,aAAa,aAAa,QAAQ;CACpC,IACA;EAAC;EAAO;EAAY;EAAO;CAAc,CAC3C;CAEA,OACE,oBAAC,UAAU,KAAX;EACE,GAAI;EACC;EACL,OAAO;EACP,mBAAiB;CAClB,CAAA;AAEL,CAAC;AAED,oBAAoB,cAAc"}
|
|
@@ -1,10 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ComponentPropsWithoutRef, ComponentRef } from "react";
|
|
2
2
|
import { Primitive } from "@radix-ui/react-primitive";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
|
|
4
|
+
//#region src/primitives/span/SpanName.d.ts
|
|
5
|
+
declare namespace SpanPrimitiveName {
|
|
6
|
+
type Element = ComponentRef<typeof Primitive.span>;
|
|
7
|
+
type Props = ComponentPropsWithoutRef<typeof Primitive.span>;
|
|
6
8
|
}
|
|
7
|
-
|
|
8
|
-
|
|
9
|
+
declare const SpanPrimitiveName: import("react").ForwardRefExoticComponent<Omit<import("react").ClassAttributes<HTMLSpanElement> & import("react").HTMLAttributes<HTMLSpanElement> & {
|
|
10
|
+
asChild?: boolean;
|
|
9
11
|
}, "ref"> & import("react").RefAttributes<HTMLSpanElement>>;
|
|
12
|
+
//#endregion
|
|
13
|
+
export { SpanPrimitiveName };
|
|
10
14
|
//# sourceMappingURL=SpanName.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SpanName.d.ts","
|
|
1
|
+
{"version":3,"file":"SpanName.d.ts","names":[],"sources":["../../../src/primitives/span/SpanName.tsx"],"mappings":";;;;kBAQiB,iBAAA;EAAA,KACH,OAAA,GAAU,YAAA,QAAoB,SAAA,CAAU,IAAA;EAAA,KACxC,KAAA,GAAQ,wBAAA,QAAgC,SAAA,CAAU,IAAA;AAAA;AAAA,cAGnD,iBAAA,kBAAiB,yBAAA,CAAA,IAAA,iBAAA,eAAA,CAAA,eAAA,oBAAA,cAAA,CAAA,eAAA"}
|
|
@@ -1,10 +1,18 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { forwardRef, } from "react";
|
|
1
|
+
import { forwardRef } from "react";
|
|
3
2
|
import { Primitive } from "@radix-ui/react-primitive";
|
|
4
3
|
import { useAuiState } from "@assistant-ui/store";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
//#region src/primitives/span/SpanName.tsx
|
|
6
|
+
const SpanPrimitiveName = forwardRef((props, ref) => {
|
|
7
|
+
const name = useAuiState((s) => s.span.name);
|
|
8
|
+
return /* @__PURE__ */ jsx(Primitive.span, {
|
|
9
|
+
...props,
|
|
10
|
+
ref,
|
|
11
|
+
children: props.children ?? name
|
|
12
|
+
});
|
|
8
13
|
});
|
|
9
14
|
SpanPrimitiveName.displayName = "SpanPrimitive.Name";
|
|
15
|
+
//#endregion
|
|
16
|
+
export { SpanPrimitiveName };
|
|
17
|
+
|
|
10
18
|
//# sourceMappingURL=SpanName.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SpanName.js","
|
|
1
|
+
{"version":3,"file":"SpanName.js","names":[],"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,MAAa,oBAAoB,YAG9B,OAAO,QAAQ;CAChB,MAAM,OAAO,aAAa,MAAM,EAAE,KAAK,IAAI;CAE3C,OACE,oBAAC,UAAU,MAAX;EAAgB,GAAI;EAAY;YAC7B,MAAM,YAAY;CACL,CAAA;AAEpB,CAAC;AAED,kBAAkB,cAAc"}
|
|
@@ -1,10 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ComponentPropsWithoutRef, ComponentRef } from "react";
|
|
2
2
|
import { Primitive } from "@radix-ui/react-primitive";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
|
|
4
|
+
//#region src/primitives/span/SpanRoot.d.ts
|
|
5
|
+
declare namespace SpanPrimitiveRoot {
|
|
6
|
+
type Element = ComponentRef<typeof Primitive.div>;
|
|
7
|
+
type Props = ComponentPropsWithoutRef<typeof Primitive.div>;
|
|
6
8
|
}
|
|
7
|
-
|
|
8
|
-
|
|
9
|
+
declare const SpanPrimitiveRoot: import("react").ForwardRefExoticComponent<Omit<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & {
|
|
10
|
+
asChild?: boolean;
|
|
9
11
|
}, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
12
|
+
//#endregion
|
|
13
|
+
export { SpanPrimitiveRoot };
|
|
10
14
|
//# sourceMappingURL=SpanRoot.d.ts.map
|