@shapesos/clay 0.10.0 → 0.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +60 -0
- package/dist/artifacts.cjs +1467 -0
- package/dist/artifacts.cjs.map +1 -0
- package/dist/artifacts.d.cts +89 -0
- package/dist/artifacts.d.ts +89 -0
- package/dist/artifacts.js +33 -0
- package/dist/blocks.cjs +1418 -68
- package/dist/blocks.cjs.map +1 -1
- package/dist/blocks.css +2 -0
- package/dist/blocks.d.cts +36 -11
- package/dist/blocks.d.ts +36 -11
- package/dist/blocks.js +18 -5
- package/dist/button.d.cts +2 -2
- package/dist/button.d.ts +2 -2
- package/dist/chart.cjs +594 -0
- package/dist/chart.cjs.map +1 -0
- package/dist/chart.d.cts +439 -0
- package/dist/chart.d.ts +439 -0
- package/dist/chart.js +32 -0
- package/dist/chart.js.map +1 -0
- package/dist/chat.cjs +1462 -312
- package/dist/chat.cjs.map +1 -1
- package/dist/chat.d.cts +28 -10
- package/dist/chat.d.ts +28 -10
- package/dist/chat.js +10 -3
- package/dist/{chunk-R3BGPOAM.js → chunk-36CB624W.js} +53 -45
- package/dist/chunk-36CB624W.js.map +1 -0
- package/dist/chunk-4MZZH3WX.js +93 -0
- package/dist/chunk-4MZZH3WX.js.map +1 -0
- package/dist/chunk-AQEJRMRN.js +1 -0
- package/dist/chunk-AQEJRMRN.js.map +1 -0
- package/dist/{chunk-WS4IPADR.js → chunk-FFX3CAOX.js} +41 -109
- package/dist/chunk-FFX3CAOX.js.map +1 -0
- package/dist/chunk-JGMN6W72.js +12 -0
- package/dist/chunk-JGMN6W72.js.map +1 -0
- package/dist/{chunk-27GJUWVN.js → chunk-JJUIBBBU.js} +14 -8
- package/dist/chunk-JJUIBBBU.js.map +1 -0
- package/dist/{chunk-MLCRDVQ2.js → chunk-OBOXCBDL.js} +13 -5
- package/dist/chunk-OBOXCBDL.js.map +1 -0
- package/dist/chunk-P6GUNIAE.js +11 -0
- package/dist/chunk-P6GUNIAE.js.map +1 -0
- package/dist/chunk-QXGYMDIA.js +477 -0
- package/dist/chunk-QXGYMDIA.js.map +1 -0
- package/dist/chunk-Z5JWF24N.js +719 -0
- package/dist/chunk-Z5JWF24N.js.map +1 -0
- package/dist/icon.cjs +12 -4
- package/dist/icon.cjs.map +1 -1
- package/dist/icon.d.cts +19 -6
- package/dist/icon.d.ts +19 -6
- package/dist/icon.js +1 -1
- package/dist/index.cjs +1520 -332
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +7 -4
- package/dist/index.d.ts +7 -4
- package/dist/index.js +58 -25
- package/dist/lottie.d.cts +2 -2
- package/dist/lottie.d.ts +2 -2
- package/dist/table.cjs +142 -0
- package/dist/table.cjs.map +1 -0
- package/dist/table.d.cts +44 -0
- package/dist/table.d.ts +44 -0
- package/dist/table.js +25 -0
- package/dist/table.js.map +1 -0
- package/dist/text-area.d.cts +2 -2
- package/dist/text-area.d.ts +2 -2
- package/dist/types-B2aYk82c.d.cts +29 -0
- package/dist/types-B2aYk82c.d.ts +29 -0
- package/dist/types-C0BvwliI.d.cts +332 -0
- package/dist/types-C5bFH4v3.d.ts +332 -0
- package/dist/types-DCutaXjZ.d.cts +83 -0
- package/dist/types-uPfn67Dc.d.ts +83 -0
- package/dist/utils.cjs +14 -7
- package/dist/utils.cjs.map +1 -1
- package/dist/utils.d.cts +18 -1
- package/dist/utils.d.ts +18 -1
- package/dist/utils.js +6 -4
- package/package.json +41 -4
- package/dist/chunk-27GJUWVN.js.map +0 -1
- package/dist/chunk-MLCRDVQ2.js.map +0 -1
- package/dist/chunk-OKPNST44.js +0 -1
- package/dist/chunk-R3BGPOAM.js.map +0 -1
- package/dist/chunk-WS4IPADR.js.map +0 -1
- package/dist/types-Q9aqd9nq.d.cts +0 -34
- package/dist/types-Q9aqd9nq.d.ts +0 -34
- /package/dist/{chunk-OKPNST44.js.map → artifacts.js.map} +0 -0
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { e as ArtifactType, c as ArtifactService, b as ArtifactRecord, d as ArtifactServiceProps, j as TableArtifactRecord, f as ChartArtifactRecord } from './types-C5bFH4v3.js';
|
|
2
|
+
export { A as ArtifactDataRow, a as ArtifactLabelsMap, B as BarChartConfig, C as ChartArtifactLabels, g as ChartConfig, h as ChartStats, D as DEFAULT_CHART_ARTIFACT_LABELS, i as DEFAULT_TABLE_ARTIFACT_LABELS, L as LineChartConfig, P as PieChartConfig, T as TableArtifactLabels, k as TableColumn, l as TableConfig, m as TableRow, n as TableStats, o as artifactTypes } from './types-C5bFH4v3.js';
|
|
3
|
+
import { ReactNode } from 'react';
|
|
4
|
+
export { C as ChartSeries, a as ChartVariant } from './types-B2aYk82c.js';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Map of artifact services keyed by `artifact.type`.
|
|
8
|
+
*
|
|
9
|
+
* Adding a new artifact type = create a `*-service.ts` file (mirroring `block-services/`), then
|
|
10
|
+
* add one entry here. The block-level dispatcher (`ArtifactRefBlock`) consumes this map to
|
|
11
|
+
* render the concrete component; `artifactToClipboardText` consumes it for the clipboard contract.
|
|
12
|
+
*/
|
|
13
|
+
declare const ArtifactServices: Record<ArtifactType, ArtifactService>;
|
|
14
|
+
/**
|
|
15
|
+
* Returns a clipboard-friendly string for an artifact, delegating to the registered service's
|
|
16
|
+
* `toClipboardText`. Falls back to `[Artifact: <title>]` when the artifact type has no registered
|
|
17
|
+
* service (unknown type) so copy never silently produces an empty string.
|
|
18
|
+
*/
|
|
19
|
+
declare function artifactToClipboardText(artifact: ArtifactRecord): string;
|
|
20
|
+
|
|
21
|
+
/** Props for `ArtifactDownloadButton`. */
|
|
22
|
+
interface ArtifactDownloadButtonProps {
|
|
23
|
+
/**
|
|
24
|
+
* URL to download the artifact's underlying bytes. The button is an `<a href download>` so the
|
|
25
|
+
* browser uses whatever filename the server supplies via `Content-Disposition`. No client-side
|
|
26
|
+
* filename invention.
|
|
27
|
+
*
|
|
28
|
+
* Renders nothing when the URL is not a safe `http(s):` scheme — guards against `javascript:` or
|
|
29
|
+
* `data:` URIs smuggled into `presignedUrl`.
|
|
30
|
+
*/
|
|
31
|
+
href: string;
|
|
32
|
+
/**
|
|
33
|
+
* Tooltip text + `aria-label` for the button. Optional — defaults to `"Download CSV"` so direct
|
|
34
|
+
* consumers don't have to pass anything for the common case. Per-type artifact orchestrators
|
|
35
|
+
* (`<ChartArtifact>`, `<TableArtifact>`) pass a translated value via their own `labels` prop so
|
|
36
|
+
* the button reads in the user's language.
|
|
37
|
+
*/
|
|
38
|
+
label?: string;
|
|
39
|
+
/**
|
|
40
|
+
* Optional callback fired on click — runs alongside the browser's native download navigation
|
|
41
|
+
* (no `preventDefault`). Used for analytics / observability hooks; per-type artifact
|
|
42
|
+
* orchestrators wire this from their `callbacks` prop.
|
|
43
|
+
*/
|
|
44
|
+
onClick?: () => void;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Reusable download button for artifact headers. Anchor-based so the browser handles the download
|
|
48
|
+
* natively (respects `Content-Disposition`, falls back to URL basename). `rel="noopener noreferrer"`
|
|
49
|
+
* defends against `window.opener` leakage if the browser opens the URL instead of downloading.
|
|
50
|
+
*
|
|
51
|
+
* Drop this inside `<ArtifactActions>` in any per-type artifact orchestrator.
|
|
52
|
+
*/
|
|
53
|
+
declare function ArtifactDownloadButton({ href, label, onClick, }: ArtifactDownloadButtonProps): ReactNode;
|
|
54
|
+
/**
|
|
55
|
+
* Returns `true` only for `http:` and `https:` URLs. Rejects `javascript:`, `data:`, and any
|
|
56
|
+
* other scheme that could execute code on click.
|
|
57
|
+
*/
|
|
58
|
+
declare function isSafeDownloadUrl(url: string): boolean;
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Orchestrator for the `table`-typed artifact.
|
|
62
|
+
*
|
|
63
|
+
* Composes the ai-elements chrome primitives (`Artifact`, `ArtifactHeader`, `ArtifactTitle`,
|
|
64
|
+
* `ArtifactActions`, `ArtifactContent`) directly around the table body (`TableArtifactContent`).
|
|
65
|
+
* Download is handled via `ArtifactDownloadButton` — a shared utility component that applies the
|
|
66
|
+
* safe-URL guard and renders nothing for non-http(s) schemes.
|
|
67
|
+
*/
|
|
68
|
+
declare function TableArtifact({ artifact, labels, callbacks }: ArtifactServiceProps<TableArtifactRecord>): ReactNode;
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Orchestrator for the `CHART`-typed artifact.
|
|
72
|
+
*
|
|
73
|
+
* Composes the ai-elements chrome primitives (`Artifact`, `ArtifactHeader`, `ArtifactTitle`,
|
|
74
|
+
* `ArtifactActions`, `ArtifactContent`) directly around the chart body (`ChartArtifactContent`),
|
|
75
|
+
* matching `TableArtifact`'s shape. Loading / error / unavailable / empty states render an inline
|
|
76
|
+
* `StatusMessage`; the ready state delegates to per-variant recharts trees inside
|
|
77
|
+
* `ChartArtifactContent`.
|
|
78
|
+
*
|
|
79
|
+
* The renderer is variant-agnostic at this level — it doesn't know about LINE vs BAR vs PIE.
|
|
80
|
+
* Variant dispatch lives inside `ChartArtifactContent` so the orchestrator can focus on the
|
|
81
|
+
* data lifecycle and the chrome.
|
|
82
|
+
*
|
|
83
|
+
* Labels for action buttons (download, future copy-as-PNG) are pulled from the optional `labels`
|
|
84
|
+
* prop with per-key fallback to `DEFAULT_CHART_ARTIFACT_LABELS`. Consumers translate via their
|
|
85
|
+
* own i18n layer and pass the bag; non-i18n consumers omit it and get English defaults.
|
|
86
|
+
*/
|
|
87
|
+
declare function ChartArtifact({ artifact, labels, callbacks }: ArtifactServiceProps<ChartArtifactRecord>): ReactNode;
|
|
88
|
+
|
|
89
|
+
export { ArtifactDownloadButton, type ArtifactDownloadButtonProps, ArtifactRecord, ArtifactService, ArtifactServiceProps, ArtifactServices, ArtifactType, ChartArtifact, ChartArtifactRecord, TableArtifact, TableArtifactRecord, artifactToClipboardText, isSafeDownloadUrl };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import "./chunk-AQEJRMRN.js";
|
|
2
|
+
import {
|
|
3
|
+
ArtifactDownloadButton,
|
|
4
|
+
ArtifactServices,
|
|
5
|
+
ChartArtifact,
|
|
6
|
+
DEFAULT_CHART_ARTIFACT_LABELS,
|
|
7
|
+
DEFAULT_TABLE_ARTIFACT_LABELS,
|
|
8
|
+
TableArtifact,
|
|
9
|
+
artifactToClipboardText,
|
|
10
|
+
artifactTypes,
|
|
11
|
+
isSafeDownloadUrl
|
|
12
|
+
} from "./chunk-Z5JWF24N.js";
|
|
13
|
+
import "./chunk-QXGYMDIA.js";
|
|
14
|
+
import "./chunk-C77QMQNT.js";
|
|
15
|
+
import "./chunk-SV24ONND.js";
|
|
16
|
+
import "./chunk-4MZZH3WX.js";
|
|
17
|
+
import "./chunk-P6GUNIAE.js";
|
|
18
|
+
import "./chunk-OBOXCBDL.js";
|
|
19
|
+
import "./chunk-OLJIJYB5.js";
|
|
20
|
+
import "./chunk-JF3P66JF.js";
|
|
21
|
+
import "./chunk-5WRI5ZAA.js";
|
|
22
|
+
export {
|
|
23
|
+
ArtifactDownloadButton,
|
|
24
|
+
ArtifactServices,
|
|
25
|
+
ChartArtifact,
|
|
26
|
+
DEFAULT_CHART_ARTIFACT_LABELS,
|
|
27
|
+
DEFAULT_TABLE_ARTIFACT_LABELS,
|
|
28
|
+
TableArtifact,
|
|
29
|
+
artifactToClipboardText,
|
|
30
|
+
artifactTypes,
|
|
31
|
+
isSafeDownloadUrl
|
|
32
|
+
};
|
|
33
|
+
//# sourceMappingURL=artifacts.js.map
|