@assistant-ui/react-o11y 0.0.14 → 0.0.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. package/dist/_virtual/_rolldown/runtime.js +13 -0
  2. package/dist/context/SpanByIndexProvider.d.ts +7 -3
  3. package/dist/context/SpanByIndexProvider.d.ts.map +1 -1
  4. package/dist/context/SpanByIndexProvider.js +16 -12
  5. package/dist/context/SpanByIndexProvider.js.map +1 -1
  6. package/dist/index.d.ts +5 -6
  7. package/dist/index.js +4 -4
  8. package/dist/o11y-scope.d.ts +36 -35
  9. package/dist/o11y-scope.d.ts.map +1 -1
  10. package/dist/o11y-scope.js +0 -1
  11. package/dist/primitives/span/SpanChildren.d.ts +24 -22
  12. package/dist/primitives/span/SpanChildren.d.ts.map +1 -1
  13. package/dist/primitives/span/SpanChildren.js +32 -27
  14. package/dist/primitives/span/SpanChildren.js.map +1 -1
  15. package/dist/primitives/span/SpanCollapseToggle.d.ts +10 -6
  16. package/dist/primitives/span/SpanCollapseToggle.d.ts.map +1 -1
  17. package/dist/primitives/span/SpanCollapseToggle.js +22 -13
  18. package/dist/primitives/span/SpanCollapseToggle.js.map +1 -1
  19. package/dist/primitives/span/SpanIndent.d.ts +15 -11
  20. package/dist/primitives/span/SpanIndent.d.ts.map +1 -1
  21. package/dist/primitives/span/SpanIndent.js +23 -9
  22. package/dist/primitives/span/SpanIndent.js.map +1 -1
  23. package/dist/primitives/span/SpanName.d.ts +10 -6
  24. package/dist/primitives/span/SpanName.d.ts.map +1 -1
  25. package/dist/primitives/span/SpanName.js +13 -5
  26. package/dist/primitives/span/SpanName.js.map +1 -1
  27. package/dist/primitives/span/SpanRoot.d.ts +10 -6
  28. package/dist/primitives/span/SpanRoot.d.ts.map +1 -1
  29. package/dist/primitives/span/SpanRoot.js +21 -9
  30. package/dist/primitives/span/SpanRoot.js.map +1 -1
  31. package/dist/primitives/span/SpanStatusIndicator.d.ts +10 -6
  32. package/dist/primitives/span/SpanStatusIndicator.d.ts.map +1 -1
  33. package/dist/primitives/span/SpanStatusIndicator.js +13 -5
  34. package/dist/primitives/span/SpanStatusIndicator.js.map +1 -1
  35. package/dist/primitives/span/SpanTypeBadge.d.ts +10 -6
  36. package/dist/primitives/span/SpanTypeBadge.d.ts.map +1 -1
  37. package/dist/primitives/span/SpanTypeBadge.js +14 -5
  38. package/dist/primitives/span/SpanTypeBadge.js.map +1 -1
  39. package/dist/primitives/span.d.ts +14 -7
  40. package/dist/primitives/span.d.ts.map +1 -1
  41. package/dist/primitives/span.js +21 -7
  42. package/dist/primitives/span.js.map +1 -1
  43. package/dist/resources/SpanResource.d.ts +17 -14
  44. package/dist/resources/SpanResource.d.ts.map +1 -1
  45. package/dist/resources/SpanResource.js +127 -129
  46. package/dist/resources/SpanResource.js.map +1 -1
  47. package/package.json +6 -6
  48. package/dist/index.d.ts.map +0 -1
  49. package/dist/index.js.map +0 -1
  50. 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 type { FC, PropsWithChildren } from "react";
2
- export declare const SpanByIndexProvider: FC<PropsWithChildren<{
3
- index: number;
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","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,CAexE,CAAC"}
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 { jsx as _jsx } from "react/jsx-runtime";
2
- import { useAui, AuiProvider, Derived } from "@assistant-ui/store";
3
- export const SpanByIndexProvider = ({ index, children, }) => {
4
- const parentAui = useAui();
5
- const aui = useAui({
6
- span: Derived({
7
- source: "span",
8
- query: { index },
9
- get: () => parentAui.span().child({ index }),
10
- }),
11
- });
12
- return _jsx(AuiProvider, { value: aui, children: children });
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","sourceRoot":"","sources":["../../src/context/SpanByIndexProvider.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAEnE,MAAM,CAAC,MAAM,mBAAmB,GAA6C,CAAC,EAC5E,KAAK,EACL,QAAQ,GACT,EAAE,EAAE;IACH,MAAM,SAAS,GAAG,MAAM,EAAE,CAAC;IAE3B,MAAM,GAAG,GAAG,MAAM,CAAC;QACjB,IAAI,EAAE,OAAO,CAAC;YACZ,MAAM,EAAE,MAAM;YACd,KAAK,EAAE,EAAE,KAAK,EAAE;YAChB,GAAG,EAAE,GAAG,EAAE,CAAC,SAAS,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,EAAE,KAAK,EAAE,CAAC;SAC7C,CAAC;KACH,CAAC,CAAC;IAEH,OAAO,KAAC,WAAW,IAAC,KAAK,EAAE,GAAG,YAAG,QAAQ,GAAe,CAAC;AAC3D,CAAC,CAAC"}
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
- 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
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
- export * as SpanPrimitive from "./primitives/span.js";
2
- export { SpanResource } from "./resources/SpanResource.js";
3
- export { SpanByIndexProvider } from "./context/SpanByIndexProvider.js";
4
- //# sourceMappingURL=index.js.map
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 };
@@ -1,44 +1,45 @@
1
- import "@assistant-ui/store";
2
- export 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;
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
- export type SpanState = SpanItemState & {
16
- children: SpanItemState[];
17
- timeRange: {
18
- min: number;
19
- max: number;
20
- };
15
+ type SpanState = SpanItemState & {
16
+ children: SpanItemState[];
17
+ timeRange: {
18
+ min: number;
19
+ max: number;
20
+ };
21
21
  };
22
22
  type SpanMethods = {
23
- getState: () => SpanState;
24
- child: (lookup: SpanMeta["query"]) => SpanMethods;
25
- toggleCollapse: () => void;
23
+ getState: () => SpanState;
24
+ child: (lookup: SpanMeta["query"]) => SpanMethods;
25
+ toggleCollapse: () => void;
26
26
  };
27
27
  type SpanMeta = {
28
- source: "span";
29
- query: {
30
- index: number;
31
- } | {
32
- key: string;
33
- };
28
+ source: "span";
29
+ query: {
30
+ index: number;
31
+ } | {
32
+ key: string;
33
+ };
34
34
  };
35
35
  declare module "@assistant-ui/store" {
36
- interface ScopeRegistry {
37
- span: {
38
- methods: SpanMethods;
39
- meta: SpanMeta;
40
- };
41
- }
36
+ interface ScopeRegistry {
37
+ span: {
38
+ methods: SpanMethods;
39
+ meta: SpanMeta;
40
+ };
41
+ }
42
42
  }
43
- export {};
43
+ //#endregion
44
+ export { SpanItemState, SpanState };
44
45
  //# sourceMappingURL=o11y-scope.d.ts.map
@@ -1 +1 @@
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;QA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ui/store";
2
- //# sourceMappingURL=o11y-scope.js.map
@@ -1,27 +1,29 @@
1
- import { type ComponentType, type FC, type ReactNode } from "react";
2
- import type { SpanState } from "../../o11y-scope.js";
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
- Span: ComponentType;
6
+ Span: ComponentType;
5
7
  };
6
- export declare namespace SpanPrimitiveChildren {
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
- };
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
- export declare namespace SpanPrimitiveChildByIndex {
19
- type Props = {
20
- index: number;
21
- components: SpanChildrenComponentConfig;
22
- };
19
+ declare namespace SpanPrimitiveChildByIndex {
20
+ type Props = {
21
+ index: number;
22
+ components: SpanChildrenComponentConfig;
23
+ };
23
24
  }
24
- export declare const SpanPrimitiveChildByIndex: FC<SpanPrimitiveChildByIndex.Props>;
25
- export declare const SpanPrimitiveChildren: FC<SpanPrimitiveChildren.Props>;
26
- export {};
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","sourceRoot":"","sources":["../../../src/primitives/span/SpanChildren.tsx"],"names":[],"mappings":"AAAA,OAA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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
- export const SpanPrimitiveChildByIndex = memo(({ index, components }) => {
6
- return (_jsx(SpanByIndexProvider, { index: index, children: _jsx(components.Span, {}) }));
7
- }, (prev, next) => prev.index === next.index &&
8
- prev.components.Span === next.components.Span);
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
- const childrenLength = useAuiState((s) => s.span.children.length);
12
- return useMemo(() => {
13
- if (childrenLength === 0)
14
- return null;
15
- return Array.from({ length: childrenLength }, (_, index) => (_jsx(SpanByIndexProvider, { index: index, children: _jsx(RenderChildrenWithAccessor, { getItemState: (aui) => aui.span().getState(), children: (getItem) => children({
16
- get span() {
17
- return getItem();
18
- },
19
- }) }) }, index)));
20
- }, [childrenLength, children]);
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
- if (components) {
24
- return (_jsx(SpanPrimitiveChildrenInner, { children: () => _jsx(components.Span, {}) }));
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
- export const SpanPrimitiveChildren = memo(SpanPrimitiveChildrenImpl, (prev, next) => {
29
- if (prev.children || next.children) {
30
- return prev.children === next.children;
31
- }
32
- return prev.components.Span === next.components.Span;
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","sourceRoot":"","sources":["../../../src/primitives/span/SpanChildren.tsx"],"names":[],"mappings":";AAAA,OAAO,EAIL,IAAI,EACJ,OAAO,GACR,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,0BAA0B,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAE9E,OAAO,EAAE,mBAAmB,EAAE,6CAA0C;AA0BxE,MAAM,CAAC,MAAM,yBAAyB,GACpC,IAAI,CACF,CAAC,EAAE,KAAK,EAAE,UAAU,EAAE,EAAE,EAAE;IACxB,OAAO,CACL,KAAC,mBAAmB,IAAC,KAAK,EAAE,KAAK,YA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AC,KAAC,UAAU,CAAC,IAAI,KAAG,GACC,CAC9B,CAAC;IACJ,CAAC;IACD,OAAO,KAAC,0BAA0B,cAAE,QAAQ,GAA8B,CAAC;AAC7E,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,qBAAqB,GAAoC,IAAI,CACxE,yBAAyB,EACzB,CAAC,IAAI,EAAE,IAAI,EAAE,EAAE;IACb,IAAI,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;QACnC,OAAO,IAAI,CAAC,QAAQ,KAAK,IAAI,CAAC,QAAQ,CAAC;IACzC,CAAC;IACD,OAAO,IAAI,CAAC,UAAW,CAAC,IAAI,KAAK,IAAI,CAAC,UAAW,CAAC,IAAI,CAAC;AACzD,CAAC,CACF,CAAC;AAEF,qBAAqB,CAAC,WAAW,GAAG,wBAAwB,CAAC"}
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 { type ComponentPropsWithoutRef, type ComponentRef } from "react";
1
+ import { ComponentPropsWithoutRef, ComponentRef } from "react";
2
2
  import { Primitive } from "@radix-ui/react-primitive";
3
- export declare namespace SpanPrimitiveCollapseToggle {
4
- type Element = ComponentRef<typeof Primitive.button>;
5
- type Props = ComponentPropsWithoutRef<typeof Primitive.button>;
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
- export declare const SpanPrimitiveCollapseToggle: import("react").ForwardRefExoticComponent<Omit<import("react").ClassAttributes<HTMLButtonElement> & import("react").ButtonHTMLAttributes<HTMLButtonElement> & {
8
- asChild?: boolean;
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","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
+ {"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 { jsx as _jsx } from "react/jsx-runtime";
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
- export const SpanPrimitiveCollapseToggle = forwardRef((props, ref) => {
6
- const hasChildren = useAuiState((s) => s.span.hasChildren);
7
- const isCollapsed = useAuiState((s) => s.span.isCollapsed);
8
- const aui = useAui();
9
- if (!hasChildren)
10
- return null;
11
- return (_jsx(Primitive.button, { type: "button", ...props, ref: ref, "data-collapsed": isCollapsed, onClick: (e) => {
12
- e.stopPropagation();
13
- aui.span().toggleCollapse();
14
- props.onClick?.(e);
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","sourceRoot":"","sources":["../../../src/primitives/span/SpanCollapseToggle.tsx"],"names":[],"mappings":";AAAA,OAAO,EAGL,UAAU,GACX,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACtD,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAO1D,MAAM,CAAC,MAAM,2BAA2B,GAAG,UAAU,CAGnD,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;IACf,MAAM,WAAW,GAAG,WAAW,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;IAC3D,MAAM,WAAW,GAAG,WAAW,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;IAC3D,MAAM,GAAG,GAAG,MAAM,EAAE,CAAC;IAErB,IAAI,CAAC,WAAW;QAAE,OAAO,IAAI,CAAC;IAE9B,OAAO,CACL,KAAC,SAAS,CAAC,MAAM,IACf,IAAI,EAAC,QAAQ,KACT,KAAK,EACT,GAAG,EAAE,GAAG,oBACQ,WAAW,EAC3B,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE;YACb,CAAC,CAAC,eAAe,EAAE,CAAC;YACpB,GAAG,CAAC,IAAI,EAAE,CAAC,cAAc,EAAE,CAAC;YAC5B,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC;QACrB,CAAC,GACD,CACH,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,2BAA2B,CAAC,WAAW,GAAG,8BAA8B,CAAC"}
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 { type ComponentPropsWithoutRef, type ComponentRef } from "react";
1
+ import { ComponentPropsWithoutRef, ComponentRef } from "react";
2
2
  import { Primitive } from "@radix-ui/react-primitive";
3
- export declare namespace SpanPrimitiveIndent {
4
- type Element = ComponentRef<typeof Primitive.div>;
5
- type Props = ComponentPropsWithoutRef<typeof Primitive.div> & {
6
- baseIndent?: number;
7
- indentPerLevel?: number;
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","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
+ {"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 { jsx as _jsx } from "react/jsx-runtime";
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
- export const SpanPrimitiveIndent = forwardRef(({ baseIndent = 8, indentPerLevel = 12, style, ...props }, ref) => {
6
- const depth = useAuiState((s) => s.span.depth);
7
- const mergedStyle = useMemo(() => ({
8
- ...style,
9
- paddingLeft: baseIndent + depth * indentPerLevel,
10
- }), [style, baseIndent, depth, indentPerLevel]);
11
- return (_jsx(Primitive.div, { ...props, ref: ref, style: mergedStyle, "data-span-depth": depth }));
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","sourceRoot":"","sources":["../../../src/primitives/span/SpanIndent.tsx"],"names":[],"mappings":";AAAA,OAAO,EAGL,UAAU,EACV,OAAO,GACR,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAUlD,MAAM,CAAC,MAAM,mBAAmB,GAAG,UAAU,CAG3C,CAAC,EAAE,UAAU,GAAG,CAAC,EAAE,cAAc,GAAG,EAAE,EAAE,KAAK,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE;IAClE,MAAM,KAAK,GAAG,WAAW,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAE/C,MAAM,WAAW,GAAG,OAAO,CACzB,GAAG,EAAE,CAAC,CAAC;QACL,GAAG,KAAK;QACR,WAAW,EAAE,UAAU,GAAG,KAAK,GAAG,cAAc;KACjD,CAAC,EACF,CAAC,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,cAAc,CAAC,CAC3C,CAAC;IAEF,OAAO,CACL,KAAC,SAAS,CAAC,GAAG,OACR,KAAK,EACT,GAAG,EAAE,GAAG,EACR,KAAK,EAAE,WAAW,qBACD,KAAK,GACtB,CACH,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,mBAAmB,CAAC,WAAW,GAAG,sBAAsB,CAAC"}
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 { type ComponentPropsWithoutRef, type ComponentRef } from "react";
1
+ import { ComponentPropsWithoutRef, ComponentRef } from "react";
2
2
  import { Primitive } from "@radix-ui/react-primitive";
3
- export declare namespace SpanPrimitiveName {
4
- type Element = ComponentRef<typeof Primitive.span>;
5
- type Props = ComponentPropsWithoutRef<typeof Primitive.span>;
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
- export declare const SpanPrimitiveName: import("react").ForwardRefExoticComponent<Omit<import("react").ClassAttributes<HTMLSpanElement> & import("react").HTMLAttributes<HTMLSpanElement> & {
8
- asChild?: boolean;
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","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
+ {"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 { jsx as _jsx } from "react/jsx-runtime";
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
- export const SpanPrimitiveName = forwardRef((props, ref) => {
6
- const name = useAuiState((s) => s.span.name);
7
- return (_jsx(Primitive.span, { ...props, ref: ref, children: props.children ?? name }));
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","sourceRoot":"","sources":["../../../src/primitives/span/SpanName.tsx"],"names":[],"mappings":";AAAA,OAAO,EAGL,UAAU,GACX,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAOlD,MAAM,CAAC,MAAM,iBAAiB,GAAG,UAAU,CAGzC,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;IACf,MAAM,IAAI,GAAG,WAAW,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAE7C,OAAO,CACL,KAAC,SAAS,CAAC,IAAI,OAAK,KAAK,EAAE,GAAG,EAAE,GAAG,YAChC,KAAK,CAAC,QAAQ,IAAI,IAAI,GACR,CAClB,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,iBAAiB,CAAC,WAAW,GAAG,oBAAoB,CAAC"}
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 { type ComponentPropsWithoutRef, type ComponentRef } from "react";
1
+ import { ComponentPropsWithoutRef, ComponentRef } from "react";
2
2
  import { Primitive } from "@radix-ui/react-primitive";
3
- export declare namespace SpanPrimitiveRoot {
4
- type Element = ComponentRef<typeof Primitive.div>;
5
- type Props = ComponentPropsWithoutRef<typeof Primitive.div>;
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
- export declare const SpanPrimitiveRoot: import("react").ForwardRefExoticComponent<Omit<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & {
8
- asChild?: boolean;
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