@sixb/app 0.1.12 → 0.1.13
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 +3 -8
- package/dist/agent/activity-label.d.ts.map +1 -1
- package/dist/agent/agent-chat.d.ts +9 -8
- package/dist/agent/agent-chat.d.ts.map +1 -1
- package/dist/agent/agent-panel.d.ts +5 -8
- package/dist/agent/agent-panel.d.ts.map +1 -1
- package/dist/agent/agents-page.d.ts +4 -0
- package/dist/agent/agents-page.d.ts.map +1 -0
- package/dist/agent/artifact-card.d.ts +9 -0
- package/dist/agent/artifact-card.d.ts.map +1 -0
- package/dist/agent/artifact-panel-state.d.ts +16 -0
- package/dist/agent/artifact-panel-state.d.ts.map +1 -0
- package/dist/agent/artifact-panel.d.ts +38 -0
- package/dist/agent/artifact-panel.d.ts.map +1 -0
- package/dist/agent/components/file-attachment-card.d.ts +3 -3
- package/dist/agent/components/file-attachment-card.d.ts.map +1 -1
- package/dist/agent/components/message-parts.d.ts +2 -1
- package/dist/agent/components/message-parts.d.ts.map +1 -1
- package/dist/agent/components/message-view.d.ts +3 -3
- package/dist/agent/components/message-view.d.ts.map +1 -1
- package/dist/agent/components/thread-artifacts-menu.d.ts +8 -0
- package/dist/agent/components/thread-artifacts-menu.d.ts.map +1 -0
- package/dist/agent/hooks/use-agent-conversation.d.ts +3 -4
- package/dist/agent/hooks/use-agent-conversation.d.ts.map +1 -1
- package/dist/agent/i18n/en.d.ts +10 -49
- package/dist/agent/i18n/en.d.ts.map +1 -1
- package/dist/agent/i18n/fr.d.ts.map +1 -1
- package/dist/agent/i18n/index.d.ts +16 -98
- package/dist/agent/i18n/index.d.ts.map +1 -1
- package/dist/agent/parts.d.ts +4 -4
- package/dist/agent/parts.d.ts.map +1 -1
- package/dist/agent/publish-artifact/interpret.d.ts +32 -0
- package/dist/agent/publish-artifact/interpret.d.ts.map +1 -0
- package/dist/agent/publish-artifact/publish-artifact-tool-view.d.ts +9 -0
- package/dist/agent/publish-artifact/publish-artifact-tool-view.d.ts.map +1 -0
- package/dist/agent/publish-artifact/use-live-publishes.d.ts +10 -0
- package/dist/agent/publish-artifact/use-live-publishes.d.ts.map +1 -0
- package/dist/agent/react-router.d.ts +1 -2
- package/dist/agent/react-router.d.ts.map +1 -1
- package/dist/agent/view-file/view-file-tool-view.d.ts +1 -1
- package/dist/agent/view-file/view-file-tool-view.d.ts.map +1 -1
- package/dist/artifacts/artifact-page.d.ts +7 -0
- package/dist/artifacts/artifact-page.d.ts.map +1 -0
- package/dist/artifacts/card-details.d.ts +15 -0
- package/dist/artifacts/card-details.d.ts.map +1 -0
- package/dist/artifacts/card-preview.d.ts +59 -0
- package/dist/artifacts/card-preview.d.ts.map +1 -0
- package/dist/artifacts/copy-feedback.d.ts +6 -0
- package/dist/artifacts/copy-feedback.d.ts.map +1 -0
- package/dist/artifacts/file-size.d.ts +11 -0
- package/dist/artifacts/file-size.d.ts.map +1 -0
- package/dist/artifacts/file-source.d.ts +45 -0
- package/dist/artifacts/file-source.d.ts.map +1 -0
- package/dist/artifacts/file-view.d.ts +9 -0
- package/dist/artifacts/file-view.d.ts.map +1 -0
- package/dist/artifacts/frame.d.ts +45 -0
- package/dist/artifacts/frame.d.ts.map +1 -0
- package/dist/artifacts/gallery.d.ts +6 -0
- package/dist/artifacts/gallery.d.ts.map +1 -0
- package/dist/artifacts/kind-icon.d.ts +8 -0
- package/dist/artifacts/kind-icon.d.ts.map +1 -0
- package/dist/artifacts/markdown-tree.d.ts +22 -0
- package/dist/artifacts/markdown-tree.d.ts.map +1 -0
- package/dist/artifacts/messages.d.ts +301 -0
- package/dist/artifacts/messages.d.ts.map +1 -0
- package/dist/artifacts/queries.d.ts +21 -0
- package/dist/artifacts/queries.d.ts.map +1 -0
- package/dist/artifacts/references/embed-tree.d.ts +17 -0
- package/dist/artifacts/references/embed-tree.d.ts.map +1 -0
- package/dist/artifacts/references/references.d.ts +50 -0
- package/dist/artifacts/references/references.d.ts.map +1 -0
- package/dist/artifacts/renderers/document-tree.d.ts +11 -0
- package/dist/artifacts/renderers/document-tree.d.ts.map +1 -0
- package/dist/artifacts/renderers/document.d.ts +17 -0
- package/dist/artifacts/renderers/document.d.ts.map +1 -0
- package/dist/artifacts/renderers/file.d.ts +10 -0
- package/dist/artifacts/renderers/file.d.ts.map +1 -0
- package/dist/artifacts/renderers/notice.d.ts +12 -0
- package/dist/artifacts/renderers/notice.d.ts.map +1 -0
- package/dist/artifacts/renderers/sheet/chart-data.d.ts +33 -0
- package/dist/artifacts/renderers/sheet/chart-data.d.ts.map +1 -0
- package/dist/artifacts/renderers/sheet/chart.d.ts +15 -0
- package/dist/artifacts/renderers/sheet/chart.d.ts.map +1 -0
- package/dist/artifacts/renderers/sheet/format.d.ts +35 -0
- package/dist/artifacts/renderers/sheet/format.d.ts.map +1 -0
- package/dist/artifacts/renderers/sheet/grid.d.ts +25 -0
- package/dist/artifacts/renderers/sheet/grid.d.ts.map +1 -0
- package/dist/artifacts/renderers/sheet/mini-chart.d.ts +7 -0
- package/dist/artifacts/renderers/sheet/mini-chart.d.ts.map +1 -0
- package/dist/artifacts/renderers/sheet/model.d.ts +29 -0
- package/dist/artifacts/renderers/sheet/model.d.ts.map +1 -0
- package/dist/artifacts/renderers/sheet/selection.d.ts +42 -0
- package/dist/artifacts/renderers/sheet/selection.d.ts.map +1 -0
- package/dist/artifacts/renderers/sheet/sheet.d.ts +17 -0
- package/dist/artifacts/renderers/sheet/sheet.d.ts.map +1 -0
- package/dist/artifacts/renderers/sheet/virtual.d.ts +13 -0
- package/dist/artifacts/renderers/sheet/virtual.d.ts.map +1 -0
- package/dist/artifacts/renderers/sheet/workbook.d.ts +24 -0
- package/dist/artifacts/renderers/sheet/workbook.d.ts.map +1 -0
- package/dist/artifacts/renderers/slides/navigation.d.ts +17 -0
- package/dist/artifacts/renderers/slides/navigation.d.ts.map +1 -0
- package/dist/artifacts/renderers/slides/slides.d.ts +14 -0
- package/dist/artifacts/renderers/slides/slides.d.ts.map +1 -0
- package/dist/artifacts/target.d.ts +29 -0
- package/dist/artifacts/target.d.ts.map +1 -0
- package/dist/artifacts/theme.d.ts +18 -0
- package/dist/artifacts/theme.d.ts.map +1 -0
- package/dist/artifacts/viewer.d.ts +19 -0
- package/dist/artifacts/viewer.d.ts.map +1 -0
- package/dist/{chunk-shmw3f8t.js → chunk-3schcf10.js} +1 -1
- package/dist/chunk-c7gy61rx.js +276 -0
- package/dist/chunk-c7gy61rx.js.map +10 -0
- package/dist/{chunk-48pkffj6.js → chunk-g3f4cm8x.js} +1 -1
- package/dist/{chunk-zcxrt24m.js → chunk-gn3k23q5.js} +3 -2
- package/dist/{chunk-zcxrt24m.js.map → chunk-gn3k23q5.js.map} +3 -3
- package/dist/{chunk-3a99tmwg.js → chunk-ng0hdnrq.js} +10 -3
- package/dist/chunk-ng0hdnrq.js.map +10 -0
- package/dist/{chunk-j97e06rg.js → chunk-xxpdn63v.js} +7224 -2874
- package/dist/chunk-xxpdn63v.js.map +105 -0
- package/dist/codegen.d.ts +2 -0
- package/dist/codegen.d.ts.map +1 -1
- package/dist/createCustomApp.d.ts.map +1 -1
- package/dist/index.d.ts +0 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +34 -31
- package/dist/index.js.map +7 -7
- package/dist/locale-messages.d.ts +2 -0
- package/dist/locale-messages.d.ts.map +1 -1
- package/dist/locale.d.ts +2 -0
- package/dist/locale.d.ts.map +1 -1
- package/dist/locale.js +1 -1
- package/dist/pages/observability/activity/calendar.d.ts +9 -0
- package/dist/pages/observability/activity/calendar.d.ts.map +1 -0
- package/dist/pages/observability/activity/connections.d.ts +7 -0
- package/dist/pages/observability/activity/connections.d.ts.map +1 -0
- package/dist/pages/observability/activity/format.d.ts +11 -0
- package/dist/pages/observability/activity/format.d.ts.map +1 -0
- package/dist/pages/observability/activity/messages.d.ts +231 -0
- package/dist/pages/observability/activity/messages.d.ts.map +1 -0
- package/dist/pages/observability/activity/meta-items.d.ts +10 -0
- package/dist/pages/observability/activity/meta-items.d.ts.map +1 -0
- package/dist/pages/observability/activity/page.d.ts +6 -0
- package/dist/pages/observability/activity/page.d.ts.map +1 -0
- package/dist/pages/observability/activity/period.d.ts +31 -0
- package/dist/pages/observability/activity/period.d.ts.map +1 -0
- package/dist/pages/observability/activity/steps.d.ts +44 -0
- package/dist/pages/observability/activity/steps.d.ts.map +1 -0
- package/dist/pages/observability/activity/timeline.d.ts +36 -0
- package/dist/pages/observability/activity/timeline.d.ts.map +1 -0
- package/dist/pages/observability/activity/users.d.ts +18 -0
- package/dist/pages/observability/activity/users.d.ts.map +1 -0
- package/dist/pages/routes.d.ts +7 -0
- package/dist/pages/routes.d.ts.map +1 -1
- package/dist/pages/section-ui.d.ts +2 -1
- package/dist/pages/section-ui.d.ts.map +1 -1
- package/dist/pages.d.ts +4 -1
- package/dist/pages.d.ts.map +1 -1
- package/dist/pages.js +5852 -3754
- package/dist/pages.js.map +20 -7
- package/dist/sections/catalog.d.ts.map +1 -1
- package/dist/sections/sections.d.ts.map +1 -1
- package/dist/server.js +63 -10
- package/dist/server.js.map +5 -5
- package/dist/shell/search-command.d.ts.map +1 -1
- package/dist/shell/user-menu.d.ts +3 -3
- package/dist/shell/user-menu.d.ts.map +1 -1
- package/package.json +4 -6
- package/src/agent/activity-label.ts +7 -0
- package/src/agent/agent-chat.tsx +29 -18
- package/src/agent/agent-execution-trace.tsx +1 -1
- package/src/agent/agent-panel.tsx +8 -13
- package/src/agent/agent-surface.tsx +4 -4
- package/src/agent/agents-page.ts +7 -0
- package/src/agent/artifact-card.tsx +190 -0
- package/src/agent/artifact-panel-state.ts +38 -0
- package/src/agent/artifact-panel.tsx +320 -0
- package/src/agent/components/file-attachment-card.tsx +13 -14
- package/src/agent/components/message-parts.tsx +30 -5
- package/src/agent/components/message-view.tsx +13 -19
- package/src/agent/components/thread-artifacts-menu.tsx +77 -0
- package/src/agent/i18n/en.ts +16 -58
- package/src/agent/i18n/fr.ts +15 -59
- package/src/agent/parts.ts +6 -6
- package/src/agent/publish-artifact/interpret.ts +110 -0
- package/src/agent/publish-artifact/publish-artifact-tool-view.tsx +62 -0
- package/src/agent/publish-artifact/use-live-publishes.ts +45 -0
- package/src/agent/react-router.tsx +26 -7
- package/src/agent/view-file/view-file-tool-view.tsx +21 -18
- package/src/artifacts/artifact-page.tsx +61 -0
- package/src/artifacts/artifacts.css +172 -0
- package/src/artifacts/card-details.ts +92 -0
- package/src/artifacts/card-preview.tsx +612 -0
- package/src/artifacts/copy-feedback.ts +25 -0
- package/src/artifacts/file-size.ts +24 -0
- package/src/artifacts/file-source.ts +109 -0
- package/src/artifacts/file-view.ts +57 -0
- package/src/artifacts/frame.tsx +288 -0
- package/src/artifacts/gallery.tsx +405 -0
- package/src/artifacts/kind-icon.tsx +23 -0
- package/src/artifacts/markdown-tree.ts +32 -0
- package/src/artifacts/messages.ts +317 -0
- package/src/artifacts/queries.ts +85 -0
- package/src/artifacts/references/embed-tree.ts +86 -0
- package/src/artifacts/references/references.tsx +739 -0
- package/src/artifacts/renderers/document-tree.ts +157 -0
- package/src/artifacts/renderers/document.tsx +334 -0
- package/src/artifacts/renderers/file.tsx +160 -0
- package/src/artifacts/renderers/notice.tsx +38 -0
- package/src/artifacts/renderers/sheet/chart-data.ts +73 -0
- package/src/artifacts/renderers/sheet/chart.tsx +288 -0
- package/src/artifacts/renderers/sheet/format.ts +142 -0
- package/src/artifacts/renderers/sheet/grid.tsx +709 -0
- package/src/artifacts/renderers/sheet/mini-chart.tsx +241 -0
- package/src/artifacts/renderers/sheet/model.ts +136 -0
- package/src/artifacts/renderers/sheet/selection.ts +152 -0
- package/src/artifacts/renderers/sheet/sheet.tsx +471 -0
- package/src/artifacts/renderers/sheet/virtual.ts +49 -0
- package/src/artifacts/renderers/sheet/workbook.ts +57 -0
- package/src/artifacts/renderers/slides/navigation.ts +38 -0
- package/src/artifacts/renderers/slides/slides.tsx +441 -0
- package/src/artifacts/target.ts +76 -0
- package/src/artifacts/theme.ts +29 -0
- package/src/artifacts/viewer.tsx +476 -0
- package/src/build.ts +13 -2
- package/src/codegen.ts +38 -2
- package/src/createCustomApp.ts +21 -1
- package/src/index.ts +0 -5
- package/src/locale-messages.ts +9 -2
- package/src/pages/observability/activity/calendar.tsx +239 -0
- package/src/pages/observability/activity/connections.tsx +144 -0
- package/src/pages/observability/activity/format.ts +49 -0
- package/src/pages/observability/activity/messages.ts +255 -0
- package/src/pages/observability/activity/meta-items.tsx +23 -0
- package/src/pages/observability/activity/page.tsx +605 -0
- package/src/pages/observability/activity/period.ts +63 -0
- package/src/pages/observability/activity/steps.ts +102 -0
- package/src/pages/observability/activity/timeline.tsx +411 -0
- package/src/pages/observability/activity/users.tsx +133 -0
- package/src/pages/observability/messages.ts +2 -2
- package/src/pages/routes.ts +15 -0
- package/src/pages/section-ui.tsx +3 -1
- package/src/pages.ts +4 -1
- package/src/sections/catalog.ts +1 -0
- package/src/sections/sections.tsx +2 -0
- package/src/shell/search-command.tsx +8 -6
- package/src/shell/user-menu.tsx +22 -22
- package/dist/agent/document-preview/classify.d.ts +0 -4
- package/dist/agent/document-preview/classify.d.ts.map +0 -1
- package/dist/agent/document-preview/content-policy.d.ts +0 -10
- package/dist/agent/document-preview/content-policy.d.ts.map +0 -1
- package/dist/agent/document-preview/content.d.ts +0 -26
- package/dist/agent/document-preview/content.d.ts.map +0 -1
- package/dist/agent/document-preview/delimited.d.ts +0 -19
- package/dist/agent/document-preview/delimited.d.ts.map +0 -1
- package/dist/agent/document-preview/document-preview-root.d.ts +0 -24
- package/dist/agent/document-preview/document-preview-root.d.ts.map +0 -1
- package/dist/agent/document-preview/file-size.d.ts +0 -3
- package/dist/agent/document-preview/file-size.d.ts.map +0 -1
- package/dist/agent/document-preview/html.d.ts +0 -9
- package/dist/agent/document-preview/html.d.ts.map +0 -1
- package/dist/agent/document-preview/persistence.d.ts +0 -6
- package/dist/agent/document-preview/persistence.d.ts.map +0 -1
- package/dist/agent/document-preview/presentation.d.ts +0 -3
- package/dist/agent/document-preview/presentation.d.ts.map +0 -1
- package/dist/agent/document-preview/rendering.d.ts +0 -14
- package/dist/agent/document-preview/rendering.d.ts.map +0 -1
- package/dist/agent/document-preview/source.d.ts +0 -13
- package/dist/agent/document-preview/source.d.ts.map +0 -1
- package/dist/agent/document-preview/state.d.ts +0 -27
- package/dist/agent/document-preview/state.d.ts.map +0 -1
- package/dist/agent/document-preview/types.d.ts +0 -33
- package/dist/agent/document-preview/types.d.ts.map +0 -1
- package/dist/agent/workspace.d.ts +0 -11
- package/dist/agent/workspace.d.ts.map +0 -1
- package/dist/chunk-3a99tmwg.js.map +0 -10
- package/dist/chunk-j97e06rg.js.map +0 -80
- package/src/agent/document-preview/classify.ts +0 -55
- package/src/agent/document-preview/content-policy.ts +0 -37
- package/src/agent/document-preview/content.ts +0 -82
- package/src/agent/document-preview/delimited.ts +0 -118
- package/src/agent/document-preview/document-preview-root.tsx +0 -1017
- package/src/agent/document-preview/file-size.ts +0 -26
- package/src/agent/document-preview/html.ts +0 -67
- package/src/agent/document-preview/persistence.ts +0 -115
- package/src/agent/document-preview/presentation.ts +0 -13
- package/src/agent/document-preview/rendering.ts +0 -48
- package/src/agent/document-preview/source.ts +0 -48
- package/src/agent/document-preview/state.ts +0 -77
- package/src/agent/document-preview/types.ts +0 -36
- package/src/agent/workspace.ts +0 -33
- /package/dist/{chunk-shmw3f8t.js.map → chunk-3schcf10.js.map} +0 -0
- /package/dist/{chunk-48pkffj6.js.map → chunk-g3f4cm8x.js.map} +0 -0
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { type CsvTable, type SheetColumnFormat, type WorkbookSheet } from "@sixb/core/artifacts";
|
|
2
|
+
/** One column as the grid draws it. */
|
|
3
|
+
export interface SheetColumn {
|
|
4
|
+
readonly name: string;
|
|
5
|
+
readonly format: SheetColumnFormat;
|
|
6
|
+
readonly numeric: boolean;
|
|
7
|
+
/** Digits after the decimal point: the format's, else as many as the column's values need. */
|
|
8
|
+
readonly decimals: number;
|
|
9
|
+
readonly width: number;
|
|
10
|
+
}
|
|
11
|
+
/** A sheet ready to draw: its columns, and its data rows each as wide as the columns. */
|
|
12
|
+
export interface SheetModel {
|
|
13
|
+
readonly name: string;
|
|
14
|
+
readonly columns: readonly SheetColumn[];
|
|
15
|
+
readonly rows: readonly (readonly string[])[];
|
|
16
|
+
/** Grid rows that stay in view, the header row included. */
|
|
17
|
+
readonly frozenRows: number;
|
|
18
|
+
readonly frozenColumns: number;
|
|
19
|
+
}
|
|
20
|
+
type SheetLayout = Pick<WorkbookSheet, "name" | "frozenRows" | "frozenColumns" | "columns" | "widths">;
|
|
21
|
+
/** A sheet of a workbook, laid out as its workbook says. */
|
|
22
|
+
export declare function sheetModel(sheet: SheetLayout, table: CsvTable): SheetModel;
|
|
23
|
+
/**
|
|
24
|
+
* A plain CSV file as a sheet: a column whose values are all numbers reads as numbers, any other
|
|
25
|
+
* as text, and rows longer than the header add unnamed columns.
|
|
26
|
+
*/
|
|
27
|
+
export declare function fileSheetModel(name: string, table: CsvTable): SheetModel;
|
|
28
|
+
export {};
|
|
29
|
+
//# sourceMappingURL=model.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"model.d.ts","sourceRoot":"","sources":["../../../../src/artifacts/renderers/sheet/model.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,QAAQ,EAGb,KAAK,iBAAiB,EACtB,KAAK,aAAa,EACnB,MAAM,sBAAsB,CAAA;AAE7B,uCAAuC;AACvC,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,MAAM,EAAE,iBAAiB,CAAA;IAClC,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAA;IACzB,8FAA8F;IAC9F,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;IACzB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;CACvB;AAED,yFAAyF;AACzF,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,OAAO,EAAE,SAAS,WAAW,EAAE,CAAA;IACxC,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC,SAAS,MAAM,EAAE,CAAC,EAAE,CAAA;IAC7C,4DAA4D;IAC5D,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;IAC3B,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAA;CAC/B;AAED,KAAK,WAAW,GAAG,IAAI,CACrB,aAAa,EACb,MAAM,GAAG,YAAY,GAAG,eAAe,GAAG,SAAS,GAAG,QAAQ,CAC/D,CAAA;AAED,4DAA4D;AAC5D,wBAAgB,UAAU,CAAC,KAAK,EAAE,WAAW,EAAE,KAAK,EAAE,QAAQ,GAAG,UAAU,CAY1E;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,GAAG,UAAU,CAkBxE"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { SheetModel } from "./model";
|
|
2
|
+
export interface CellPoint {
|
|
3
|
+
readonly row: number;
|
|
4
|
+
readonly column: number;
|
|
5
|
+
}
|
|
6
|
+
export interface CellRange {
|
|
7
|
+
readonly top: number;
|
|
8
|
+
readonly left: number;
|
|
9
|
+
readonly bottom: number;
|
|
10
|
+
readonly right: number;
|
|
11
|
+
}
|
|
12
|
+
export declare function cellRange(anchor: CellPoint, focus: CellPoint): CellRange;
|
|
13
|
+
export declare function inRange(range: CellRange, row: number, column: number): boolean;
|
|
14
|
+
/** `A`, `Z`, `AA`, `AB`… */
|
|
15
|
+
export declare function columnLetter(index: number): string;
|
|
16
|
+
/** `B2`, or `B2:D5` for more than one cell. */
|
|
17
|
+
export declare function rangeLabel(range: CellRange): string;
|
|
18
|
+
export interface RangeStats {
|
|
19
|
+
/** Cells with a value. */
|
|
20
|
+
readonly count: number;
|
|
21
|
+
/** Cells of numeric columns that hold a number; the sum and average are theirs. */
|
|
22
|
+
readonly numericCount: number;
|
|
23
|
+
readonly sum: number;
|
|
24
|
+
readonly average?: number;
|
|
25
|
+
}
|
|
26
|
+
/** What a spreadsheet's status bar says about a selection. Header cells are labels, not values. */
|
|
27
|
+
export declare function rangeStats(range: CellRange, model: SheetModel, order: readonly number[]): RangeStats;
|
|
28
|
+
/** The selection as tab-separated values, the shape every spreadsheet pastes. */
|
|
29
|
+
export declare function rangeTsv(range: CellRange, model: SheetModel, order: readonly number[]): string;
|
|
30
|
+
export type MoveKey = "ArrowUp" | "ArrowDown" | "ArrowLeft" | "ArrowRight" | "Home" | "End";
|
|
31
|
+
/** Where a key moves the focus cell; `jump` goes to the edge, as with Cmd or Ctrl held. */
|
|
32
|
+
export declare function moveFocus(point: CellPoint, key: MoveKey, bounds: {
|
|
33
|
+
readonly rows: number;
|
|
34
|
+
readonly columns: number;
|
|
35
|
+
}, jump?: boolean): CellPoint;
|
|
36
|
+
export type SortDirection = "ascending" | "descending";
|
|
37
|
+
/** The order of the data rows sorted by one column: numbers as numbers, the rest as text. */
|
|
38
|
+
export declare function sortedOrder(model: SheetModel, sort: {
|
|
39
|
+
readonly column: number;
|
|
40
|
+
readonly direction: SortDirection;
|
|
41
|
+
} | null, locale: string): number[];
|
|
42
|
+
//# sourceMappingURL=selection.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"selection.d.ts","sourceRoot":"","sources":["../../../../src/artifacts/renderers/sheet/selection.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AAKzC,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;IACpB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CACxB;AAED,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;IACpB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC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AA;CAAE,EAC3D,IAAI,UAAQ,GACX,SAAS,CAiBX;AAED,MAAM,MAAM,aAAa,GAAG,WAAW,GAAG,YAAY,CAAA;AAEtD,6FAA6F;AAC7F,wBAAgB,WAAW,CACzB,KAAK,EAAE,UAAU,EACjB,IAAI,EAAE;IAAE,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,SAAS,EAAE,aAAa,CAAA;CAAE,GAAG,IAAI,EAC3E,MAAM,EAAE,MAAM,GACb,MAAM,EAAE,CAkBV"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type ArtifactVersion } from "../../queries";
|
|
2
|
+
import type { SheetModel } from "./model";
|
|
3
|
+
/**
|
|
4
|
+
* A sheet artifact as a spreadsheet: a tab per sheet and per chart, a name box with the selection
|
|
5
|
+
* and its column's type, the grid with the sheet's charts beside it, and a status bar that sums
|
|
6
|
+
* what is selected. `part` opens a sheet by name (`Summary`, `Summary!A1:D5`) or a chart
|
|
7
|
+
* (`chart=revenue`).
|
|
8
|
+
*/
|
|
9
|
+
export declare function SheetRenderer({ version, part, }: {
|
|
10
|
+
readonly version: ArtifactVersion;
|
|
11
|
+
readonly part?: string;
|
|
12
|
+
}): import("react").JSX.Element;
|
|
13
|
+
/** One table on its own, as a CSV file shows: the name box, the grid, and the status bar. */
|
|
14
|
+
export declare function SheetTable({ model }: {
|
|
15
|
+
readonly model: SheetModel;
|
|
16
|
+
}): import("react").JSX.Element;
|
|
17
|
+
//# sourceMappingURL=sheet.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sheet.d.ts","sourceRoot":"","sources":["../../../../src/artifacts/renderers/sheet/sheet.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAE,KAAK,eAAe,EAAsB,MAAM,eAAe,CAAA;AAKxE,OAAO,KAAK,EAAe,UAAU,EAAE,MAAM,SAAS,CAAA;AAUtD;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,EAC5B,OAAO,EACP,IAAI,GACL,EAAE;IACD,QAAQ,CAAC,OAAO,EAAE,eAAe,CAAA;IACjC,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CACvB,+BAwBA;AA+KD,6FAA6F;AAC7F,wBAAgB,UAAU,CAAC,EAAE,KAAK,EAAE,EAAE;IAAE,QAAQ,CAAC,KAAK,EAAE,UAAU,CAAA;CAAE,+BAWnE"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/** `offsets[i]` is where item `i` starts; `offsets[n]` is the total. */
|
|
2
|
+
export declare function prefixOffsets(sizes: readonly number[]): number[];
|
|
3
|
+
/** The first and last item, by index, that overlap `[from, to)`, widened by `overscan` items. */
|
|
4
|
+
export declare function visibleSpan(offsets: readonly number[], from: number, to: number, overscan?: number): {
|
|
5
|
+
readonly first: number;
|
|
6
|
+
readonly last: number;
|
|
7
|
+
};
|
|
8
|
+
/** The same window for items of one size, without building offsets for every row. */
|
|
9
|
+
export declare function visibleRowSpan(rowHeight: number, count: number, from: number, to: number, overscan?: number): {
|
|
10
|
+
readonly first: number;
|
|
11
|
+
readonly last: number;
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=virtual.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"virtual.d.ts","sourceRoot":"","sources":["../../../../src/artifacts/renderers/sheet/virtual.ts"],"names":[],"mappings":"AAGA,wEAAwE;AACxE,wBAAgB,aAAa,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,EAAE,CAIhE;AAED,iGAAiG;AACjG,wBAAgB,WAAW,CACzB,OAAO,EAAE,SAAS,MAAM,EAAE,EAC1B,IAAI,EAAE,MAAM,EACZ,EAAE,EAAE,MAAM,EACV,QAAQ,SAAI,GACX;IAAE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAMnD;AAED,qFAAqF;AACrF,wBAAgB,cAAc,CAC5B,SAAS,EAAE,MAAM,EACjB,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,MAAM,EACZ,EAAE,EAAE,MAAM,EACV,QAAQ,SAAI,GACX;IAAE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAKnD"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { type Workbook, type WorkbookSheet } from "@sixb/core/artifacts";
|
|
2
|
+
import type { FileSource } from "../../file-source";
|
|
3
|
+
import { type ArtifactVersion } from "../../queries";
|
|
4
|
+
import { type SheetModel } from "./model";
|
|
5
|
+
/**
|
|
6
|
+
* A sheet artifact's `workbook.json`, parsed once it is read: undefined until then, and null when
|
|
7
|
+
* it cannot be read or does not parse.
|
|
8
|
+
*/
|
|
9
|
+
export declare function useWorkbook(version: ArtifactVersion): {
|
|
10
|
+
readonly workbook: Workbook | null | undefined;
|
|
11
|
+
readonly loading: boolean;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* One sheet of a workbook, read whole from its CSV and laid out as the workbook says. Publishing
|
|
15
|
+
* caps a sheet's file at what the viewer reads; one over it is `tooLarge`, to download instead.
|
|
16
|
+
*/
|
|
17
|
+
export declare function useSheetModel(version: ArtifactVersion, sheet: WorkbookSheet | undefined): {
|
|
18
|
+
readonly model: SheetModel | null;
|
|
19
|
+
/** The sheet's CSV, which downloads as it is. */
|
|
20
|
+
readonly source: FileSource | null;
|
|
21
|
+
readonly loading: boolean;
|
|
22
|
+
readonly tooLarge: boolean;
|
|
23
|
+
};
|
|
24
|
+
//# sourceMappingURL=workbook.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workbook.d.ts","sourceRoot":"","sources":["../../../../src/artifacts/renderers/sheet/workbook.ts"],"names":[],"mappings":"AAAA,OAAO,EAML,KAAK,QAAQ,EACb,KAAK,aAAa,EACnB,MAAM,sBAAsB,CAAA;AAE7B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AACnD,OAAO,EAAE,KAAK,eAAe,EAAkC,MAAM,eAAe,CAAA;AACpF,OAAO,EAAE,KAAK,UAAU,EAAc,MAAM,SAAS,CAAA;AAErD;;;GAGG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,eAAe,GAAG;IACrD,QAAQ,CAAC,QAAQ,EAAE,QAAQ,GAAG,IAAI,GAAG,SAAS,CAAA;IAC9C,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAA;CAC1B,CAQA;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAC3B,OAAO,EAAE,eAAe,EACxB,KAAK,EAAE,aAAa,GAAG,SAAS,GAC/B;IACD,QAAQ,CAAC,KAAK,EAAE,UAAU,GAAG,IAAI,CAAA;IACjC,iDAAiD;IACjD,QAAQ,CAAC,MAAM,EAAE,UAAU,GAAG,IAAI,CAAA;IAClC,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAA;IACzB,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAA;CAC3B,CAYA"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { DeckMode } from "@sixb/core/artifacts";
|
|
2
|
+
/** What a key does to a deck, wherever focus is: in the frame or on the viewer around it. */
|
|
3
|
+
export type DeckAction = {
|
|
4
|
+
readonly type: "goto";
|
|
5
|
+
readonly slide: number;
|
|
6
|
+
} | {
|
|
7
|
+
readonly type: "mode";
|
|
8
|
+
readonly mode: DeckMode;
|
|
9
|
+
};
|
|
10
|
+
export declare function deckKeyAction(key: string, state: {
|
|
11
|
+
readonly slide: number;
|
|
12
|
+
readonly total: number;
|
|
13
|
+
readonly mode: DeckMode;
|
|
14
|
+
}): DeckAction | null;
|
|
15
|
+
/** The slide an address names, as `#4`; the first slide when it names none. */
|
|
16
|
+
export declare function slideFromPart(part: string | undefined, total: number): number;
|
|
17
|
+
//# sourceMappingURL=navigation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"navigation.d.ts","sourceRoot":"","sources":["../../../../src/artifacts/renderers/slides/navigation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AAEpD,6FAA6F;AAC7F,MAAM,MAAM,UAAU,GAClB;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GACjD;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAA;CAAE,CAAA;AAEtD,wBAAgB,aAAa,CAC3B,GAAG,EAAE,MAAM,EACX,KAAK,EAAE;IAAE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAA;CAAE,GACjF,UAAU,GAAG,IAAI,CAqBnB;AAED,+EAA+E;AAC/E,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAG7E"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ArtifactVersion } from "../../queries";
|
|
2
|
+
/**
|
|
3
|
+
* A deck: the current slide on a stage, a filmstrip of every slide under it, and previous and
|
|
4
|
+
* next, overview, and present, where the slide fills the page until Escape. Arrow keys move
|
|
5
|
+
* through it whether focus is in the frame or on the viewer. `part` opens it at a slide (`4`).
|
|
6
|
+
*
|
|
7
|
+
* The deck runs its own scripts in its frame, so its slides and the links it may open are the
|
|
8
|
+
* ones its version recorded at publish, whatever the frame says.
|
|
9
|
+
*/
|
|
10
|
+
export declare function SlidesRenderer({ version, part, }: {
|
|
11
|
+
readonly version: ArtifactVersion;
|
|
12
|
+
readonly part?: string;
|
|
13
|
+
}): import("react").JSX.Element;
|
|
14
|
+
//# sourceMappingURL=slides.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"slides.d.ts","sourceRoot":"","sources":["../../../../src/artifacts/renderers/slides/slides.tsx"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AAMpD;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,EAC7B,OAAO,EACP,IAAI,GACL,EAAE;IACD,QAAQ,CAAC,OAAO,EAAE,eAAe,CAAA;IACjC,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CACvB,+BA4LA"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { FileSource } from "./file-source";
|
|
2
|
+
/** One artifact at a version and part, or a single file such as a message attachment. */
|
|
3
|
+
export type ViewerTarget = ArtifactTarget | FileTarget;
|
|
4
|
+
export interface ArtifactTarget {
|
|
5
|
+
readonly type: "artifact";
|
|
6
|
+
readonly artifactId: string;
|
|
7
|
+
/** Omitted shows the latest version. */
|
|
8
|
+
readonly version?: number;
|
|
9
|
+
/** A section, sheet, or slide to show first. */
|
|
10
|
+
readonly part?: string;
|
|
11
|
+
}
|
|
12
|
+
export interface FileTarget {
|
|
13
|
+
readonly type: "file";
|
|
14
|
+
readonly source: FileSource;
|
|
15
|
+
}
|
|
16
|
+
/** Identity for "is this target the open one". */
|
|
17
|
+
export declare function viewerTargetKey(target: ViewerTarget): string;
|
|
18
|
+
/** Reads `?artifact=&v=&part=`; anything malformed reads as no target. */
|
|
19
|
+
export declare function artifactTargetFromSearch(params: URLSearchParams): ArtifactTarget | null;
|
|
20
|
+
/** Writes a target into `params`, replacing any previous one; null removes it. */
|
|
21
|
+
export declare function withArtifactTarget(params: URLSearchParams, target: ArtifactTarget | null): URLSearchParams;
|
|
22
|
+
/** The target's own page in the app, at its version and part. */
|
|
23
|
+
export declare function artifactTargetHref(target: ArtifactTarget): string;
|
|
24
|
+
/**
|
|
25
|
+
* A link to the target's own page, for people to share: pinned to its version only when that is
|
|
26
|
+
* not the latest, so a link to the current artifact keeps following its new versions.
|
|
27
|
+
*/
|
|
28
|
+
export declare function artifactLink(target: ArtifactTarget, latestVersion: number | undefined, origin: string): string;
|
|
29
|
+
//# sourceMappingURL=target.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"target.d.ts","sourceRoot":"","sources":["../../src/artifacts/target.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAE/C,yFAAyF;AACzF,MAAM,MAAM,YAAY,GAAG,cAAc,GAAG,UAAU,CAAA;AAEtD,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAA;IACzB,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;IAC3B,wCAAwC;IACxC,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAA;IACzB,gDAAgD;IAChD,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CACvB;AAED,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,MAAM,EAAE,UAAU,CAAA;CAC5B;AAED,kDAAkD;AAClD,wBAAgB,eAAe,CAAC,MAAM,EAAE,YAAY,GAAG,MAAM,CAE5D;AAED,0EAA0E;AAC1E,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,eAAe,GAAG,cAAc,GAAG,IAAI,CAWvF;AAED,kFAAkF;AAClF,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,eAAe,EACvB,MAAM,EAAE,cAAc,GAAG,IAAI,GAC5B,eAAe,CAUjB;AAED,iEAAiE;AACjE,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,cAAc,GAAG,MAAM,CAKjE;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAC1B,MAAM,EAAE,cAAc,EACtB,aAAa,EAAE,MAAM,GAAG,SAAS,EACjC,MAAM,EAAE,MAAM,GACb,MAAM,CAIR"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { ArtifactTheme } from "@sixb/core/artifacts";
|
|
2
|
+
import type { CSSProperties } from "react";
|
|
3
|
+
import { type ArtifactVersion } from "./queries";
|
|
4
|
+
export interface ArtifactThemeAttributes {
|
|
5
|
+
/** `dark` or `light` when the artifact pins a mode, so the app's tokens for it apply. */
|
|
6
|
+
readonly className?: string;
|
|
7
|
+
/** The artifact's own token values, which win over the app's inside the artifact. */
|
|
8
|
+
readonly style?: CSSProperties;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* How an artifact's `theme.json` reaches its renderer: a pinned mode as the class the app's tokens
|
|
12
|
+
* key on, and token overrides as custom properties on the artifact's root element. Values were
|
|
13
|
+
* checked at publish and again by the parser, so they cannot leave their property.
|
|
14
|
+
*/
|
|
15
|
+
export declare function artifactThemeAttributes(theme: ArtifactTheme | null): ArtifactThemeAttributes;
|
|
16
|
+
/** The version's theme, for its renderer's root, once its `theme.json` is read. */
|
|
17
|
+
export declare function useArtifactThemeAttributes(version: ArtifactVersion): ArtifactThemeAttributes;
|
|
18
|
+
//# sourceMappingURL=theme.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../src/artifacts/theme.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AACzD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAA;AAC1C,OAAO,EAAE,KAAK,eAAe,EAAoB,MAAM,WAAW,CAAA;AAElE,MAAM,WAAW,uBAAuB;IACtC,yFAAyF;IACzF,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAA;IAC3B,qFAAqF;IACrF,QAAQ,CAAC,KAAK,CAAC,EAAE,aAAa,CAAA;CAC/B;AAED;;;;GAIG;AACH,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,aAAa,GAAG,IAAI,GAAG,uBAAuB,CAO5F;AAED,mFAAmF;AACnF,wBAAgB,0BAA0B,CAAC,OAAO,EAAE,eAAe,GAAG,uBAAuB,CAE5F"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { type ArtifactTarget, type ViewerTarget } from "./target";
|
|
2
|
+
export interface ViewerChrome {
|
|
3
|
+
/** Show a close button that calls this. */
|
|
4
|
+
readonly onClose?: () => void;
|
|
5
|
+
/** Show a back button that calls this, on the full page. */
|
|
6
|
+
readonly onBack?: () => void;
|
|
7
|
+
/** Where "open full page" goes, as a route in the app; omitted on the full page itself. */
|
|
8
|
+
readonly fullPageHref?: string;
|
|
9
|
+
}
|
|
10
|
+
/** An artifact or a file under its header. One viewer serves the panel, the dialog, and the page. */
|
|
11
|
+
export declare function Viewer({ target, onTargetChange, onOpenReference, chrome, className, }: {
|
|
12
|
+
readonly target: ViewerTarget;
|
|
13
|
+
readonly onTargetChange: (target: ViewerTarget) => void;
|
|
14
|
+
/** Opens an artifact this one shows or links to; a host can remember the way back. */
|
|
15
|
+
readonly onOpenReference?: (target: ArtifactTarget) => void;
|
|
16
|
+
readonly chrome?: ViewerChrome;
|
|
17
|
+
readonly className?: string;
|
|
18
|
+
}): import("react").JSX.Element;
|
|
19
|
+
//# sourceMappingURL=viewer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"viewer.d.ts","sourceRoot":"","sources":["../../src/artifacts/viewer.tsx"],"names":[],"mappings":"AAyCA,OAAO,EAAE,KAAK,cAAc,EAAgB,KAAK,YAAY,EAAE,MAAM,UAAU,CAAA;AAE/E,MAAM,WAAW,YAAY;IAC3B,2CAA2C;IAC3C,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;IAC7B,4DAA4D;IAC5D,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,IAAI,CAAA;IAC5B,2FAA2F;IAC3F,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAA;CAC/B;AAED,qGAAqG;AACrG,wBAAgB,MAAM,CAAC,EACrB,MAAM,EACN,cAAc,EACd,eAAgC,EAChC,MAAW,EACX,SAAS,GACV,EAAE;IACD,QAAQ,CAAC,MAAM,EAAE,YAAY,CAAA;IAC7B,QAAQ,CAAC,cAAc,EAAE,CAAC,MAAM,EAAE,YAAY,KAAK,IAAI,CAAA;IACvD,sFAAsF;IACtF,QAAQ,CAAC,eAAe,CAAC,EAAE,CAAC,MAAM,EAAE,cAAc,KAAK,IAAI,CAAA;IAC3D,QAAQ,CAAC,MAAM,CAAC,EAAE,YAAY,CAAA;IAC9B,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAC5B,+BAgBA"}
|
|
@@ -0,0 +1,276 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import {
|
|
3
|
+
chartData,
|
|
4
|
+
latestValue,
|
|
5
|
+
cellFormatter,
|
|
6
|
+
compactFormatter
|
|
7
|
+
} from "./chunk-xxpdn63v.js";
|
|
8
|
+
|
|
9
|
+
// src/artifacts/renderers/sheet/chart.tsx
|
|
10
|
+
import {
|
|
11
|
+
ChartContainer,
|
|
12
|
+
ChartLegend,
|
|
13
|
+
ChartLegendContent,
|
|
14
|
+
ChartTooltip,
|
|
15
|
+
ChartTooltipContent
|
|
16
|
+
} from "@sixb/ui/components";
|
|
17
|
+
import { memo, useMemo } from "react";
|
|
18
|
+
import {
|
|
19
|
+
Area,
|
|
20
|
+
AreaChart,
|
|
21
|
+
Bar,
|
|
22
|
+
BarChart,
|
|
23
|
+
CartesianGrid,
|
|
24
|
+
Cell,
|
|
25
|
+
LabelList,
|
|
26
|
+
Line,
|
|
27
|
+
LineChart,
|
|
28
|
+
Pie,
|
|
29
|
+
PieChart,
|
|
30
|
+
XAxis,
|
|
31
|
+
YAxis
|
|
32
|
+
} from "recharts";
|
|
33
|
+
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
34
|
+
var chart_default = memo(function SheetChart({
|
|
35
|
+
chart,
|
|
36
|
+
model,
|
|
37
|
+
locale
|
|
38
|
+
}) {
|
|
39
|
+
const data = useMemo(() => chartData(chart, model), [chart, model]);
|
|
40
|
+
const config = useMemo(() => Object.fromEntries((data?.series ?? []).map((series) => [
|
|
41
|
+
series.key,
|
|
42
|
+
{ label: series.label, color: series.color }
|
|
43
|
+
])), [data]);
|
|
44
|
+
if (!data)
|
|
45
|
+
return null;
|
|
46
|
+
const [first] = data.series;
|
|
47
|
+
if (!first)
|
|
48
|
+
return null;
|
|
49
|
+
const axis = compactFormatter(first.column, locale);
|
|
50
|
+
const values = Object.fromEntries(data.series.map((series) => [series.key, cellFormatter(series.column, locale)]));
|
|
51
|
+
const formatValue = (value, key) => typeof value === "number" ? values[key]?.(String(value)).text ?? String(value) : String(value);
|
|
52
|
+
const x = cellFormatter(data.x, locale);
|
|
53
|
+
const formatX = (value) => x(String(value)).text;
|
|
54
|
+
const lastIndex = data.rows.length - 1;
|
|
55
|
+
const several = data.series.length > 1;
|
|
56
|
+
const dots = data.rows.length <= 24;
|
|
57
|
+
const labelled = chart.stacked ? data.series.at(-1) : first;
|
|
58
|
+
const latest = latestValue(data, Boolean(chart.stacked));
|
|
59
|
+
const tooltip = /* @__PURE__ */ jsx(ChartTooltip, {
|
|
60
|
+
cursor: chart.type === "bar" ? { fill: "var(--muted)", opacity: 0.6 } : true,
|
|
61
|
+
content: /* @__PURE__ */ jsx(ChartTooltipContent, {
|
|
62
|
+
labelFormatter: (label) => formatX(label),
|
|
63
|
+
formatter: (value, name, item) => /* @__PURE__ */ jsxs("span", {
|
|
64
|
+
className: "flex w-full items-center justify-between gap-4",
|
|
65
|
+
children: [
|
|
66
|
+
/* @__PURE__ */ jsxs("span", {
|
|
67
|
+
className: "flex items-center gap-1.5 text-muted-foreground",
|
|
68
|
+
children: [
|
|
69
|
+
/* @__PURE__ */ jsx("span", {
|
|
70
|
+
className: "size-2 rounded-[2px]",
|
|
71
|
+
style: { background: item.color }
|
|
72
|
+
}),
|
|
73
|
+
config[String(name)]?.label
|
|
74
|
+
]
|
|
75
|
+
}),
|
|
76
|
+
/* @__PURE__ */ jsx("span", {
|
|
77
|
+
className: "font-medium text-foreground tabular-nums",
|
|
78
|
+
children: formatValue(value, String(name))
|
|
79
|
+
})
|
|
80
|
+
]
|
|
81
|
+
})
|
|
82
|
+
})
|
|
83
|
+
});
|
|
84
|
+
const lastLabel = (key) => /* @__PURE__ */ jsx(LabelList, {
|
|
85
|
+
dataKey: key,
|
|
86
|
+
content: (props) => {
|
|
87
|
+
const { index, x, y, width, value } = props;
|
|
88
|
+
if (index !== lastIndex || typeof value !== "number" || latest === null)
|
|
89
|
+
return null;
|
|
90
|
+
const left = Number(x ?? 0) + Number(width ?? 0) / 2;
|
|
91
|
+
return /* @__PURE__ */ jsx("text", {
|
|
92
|
+
x: left,
|
|
93
|
+
y: Number(y ?? 0) - 8,
|
|
94
|
+
textAnchor: "middle",
|
|
95
|
+
className: "fill-foreground text-[11px] font-semibold tabular-nums",
|
|
96
|
+
children: axis(latest)
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
});
|
|
100
|
+
const cartesian = {
|
|
101
|
+
data: data.rows,
|
|
102
|
+
margin: { top: 24, right: 12, bottom: 0, left: 0 },
|
|
103
|
+
accessibilityLayer: true
|
|
104
|
+
};
|
|
105
|
+
const axes = /* @__PURE__ */ jsxs(Fragment, {
|
|
106
|
+
children: [
|
|
107
|
+
/* @__PURE__ */ jsx(CartesianGrid, {
|
|
108
|
+
vertical: false,
|
|
109
|
+
strokeDasharray: "0"
|
|
110
|
+
}),
|
|
111
|
+
/* @__PURE__ */ jsx(XAxis, {
|
|
112
|
+
dataKey: "x",
|
|
113
|
+
tickLine: false,
|
|
114
|
+
axisLine: false,
|
|
115
|
+
tickMargin: 10,
|
|
116
|
+
minTickGap: chart.type === "bar" ? 4 : 16,
|
|
117
|
+
tickFormatter: formatX
|
|
118
|
+
}),
|
|
119
|
+
/* @__PURE__ */ jsx(YAxis, {
|
|
120
|
+
tickLine: false,
|
|
121
|
+
axisLine: false,
|
|
122
|
+
tickMargin: 6,
|
|
123
|
+
width: 56,
|
|
124
|
+
tickFormatter: axis,
|
|
125
|
+
...chart.type === "line" ? { domain: ["auto", "auto"] } : {}
|
|
126
|
+
})
|
|
127
|
+
]
|
|
128
|
+
});
|
|
129
|
+
const legend = several ? /* @__PURE__ */ jsx(ChartLegend, {
|
|
130
|
+
verticalAlign: "top",
|
|
131
|
+
align: "left",
|
|
132
|
+
content: /* @__PURE__ */ jsx(ChartLegendContent, {
|
|
133
|
+
className: "justify-start pb-3"
|
|
134
|
+
})
|
|
135
|
+
}) : null;
|
|
136
|
+
if (chart.type === "pie") {
|
|
137
|
+
const slices = data.rows.flatMap((row, index) => {
|
|
138
|
+
const value = row[first.key];
|
|
139
|
+
return typeof value === "number" && value > 0 ? [{ label: formatX(row.x), value, color: `var(--chart-${index % 5 + 1})` }] : [];
|
|
140
|
+
});
|
|
141
|
+
const total = slices.reduce((sum, slice) => sum + slice.value, 0);
|
|
142
|
+
const share = new Intl.NumberFormat(locale, { style: "percent", maximumFractionDigits: 0 });
|
|
143
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
144
|
+
className: "flex h-full min-h-0 w-full flex-col gap-3",
|
|
145
|
+
children: [
|
|
146
|
+
/* @__PURE__ */ jsx(ChartContainer, {
|
|
147
|
+
config,
|
|
148
|
+
className: "aspect-auto min-h-0 w-full flex-1",
|
|
149
|
+
children: /* @__PURE__ */ jsxs(PieChart, {
|
|
150
|
+
accessibilityLayer: true,
|
|
151
|
+
children: [
|
|
152
|
+
/* @__PURE__ */ jsx(ChartTooltip, {
|
|
153
|
+
content: /* @__PURE__ */ jsx(ChartTooltipContent, {
|
|
154
|
+
hideLabel: true,
|
|
155
|
+
formatter: (value, name) => /* @__PURE__ */ jsxs("span", {
|
|
156
|
+
className: "flex w-full items-center justify-between gap-4",
|
|
157
|
+
children: [
|
|
158
|
+
/* @__PURE__ */ jsx("span", {
|
|
159
|
+
className: "text-muted-foreground",
|
|
160
|
+
children: String(name)
|
|
161
|
+
}),
|
|
162
|
+
/* @__PURE__ */ jsx("span", {
|
|
163
|
+
className: "font-medium text-foreground tabular-nums",
|
|
164
|
+
children: formatValue(value, first.key)
|
|
165
|
+
})
|
|
166
|
+
]
|
|
167
|
+
})
|
|
168
|
+
})
|
|
169
|
+
}),
|
|
170
|
+
/* @__PURE__ */ jsx(Pie, {
|
|
171
|
+
data: slices,
|
|
172
|
+
dataKey: "value",
|
|
173
|
+
nameKey: "label",
|
|
174
|
+
innerRadius: "56%",
|
|
175
|
+
outerRadius: "88%",
|
|
176
|
+
paddingAngle: 1.5,
|
|
177
|
+
strokeWidth: 0,
|
|
178
|
+
isAnimationActive: false,
|
|
179
|
+
children: slices.map((slice, index) => /* @__PURE__ */ jsx(Cell, {
|
|
180
|
+
fill: slice.color
|
|
181
|
+
}, index))
|
|
182
|
+
})
|
|
183
|
+
]
|
|
184
|
+
})
|
|
185
|
+
}),
|
|
186
|
+
/* @__PURE__ */ jsx("ul", {
|
|
187
|
+
className: "mx-auto my-0 grid w-full max-w-sm shrink-0 list-none gap-1.5 p-0 text-xs",
|
|
188
|
+
children: slices.map((slice, index) => /* @__PURE__ */ jsxs("li", {
|
|
189
|
+
className: "flex items-center gap-2",
|
|
190
|
+
children: [
|
|
191
|
+
/* @__PURE__ */ jsx("span", {
|
|
192
|
+
className: "size-2 shrink-0 rounded-[2px]",
|
|
193
|
+
style: { background: slice.color }
|
|
194
|
+
}),
|
|
195
|
+
/* @__PURE__ */ jsx("span", {
|
|
196
|
+
className: "min-w-0 flex-1 truncate text-muted-foreground",
|
|
197
|
+
children: slice.label
|
|
198
|
+
}),
|
|
199
|
+
/* @__PURE__ */ jsx("span", {
|
|
200
|
+
className: "font-medium text-foreground tabular-nums",
|
|
201
|
+
children: formatValue(slice.value, first.key)
|
|
202
|
+
}),
|
|
203
|
+
/* @__PURE__ */ jsx("span", {
|
|
204
|
+
className: "w-9 text-right text-muted-foreground tabular-nums",
|
|
205
|
+
children: share.format(total > 0 ? slice.value / total : 0)
|
|
206
|
+
})
|
|
207
|
+
]
|
|
208
|
+
}, index))
|
|
209
|
+
})
|
|
210
|
+
]
|
|
211
|
+
});
|
|
212
|
+
}
|
|
213
|
+
return /* @__PURE__ */ jsx(ChartContainer, {
|
|
214
|
+
config,
|
|
215
|
+
className: "aspect-auto h-full w-full",
|
|
216
|
+
children: chart.type === "line" ? /* @__PURE__ */ jsxs(LineChart, {
|
|
217
|
+
...cartesian,
|
|
218
|
+
children: [
|
|
219
|
+
axes,
|
|
220
|
+
tooltip,
|
|
221
|
+
legend,
|
|
222
|
+
data.series.map((series) => /* @__PURE__ */ jsx(Line, {
|
|
223
|
+
dataKey: series.key,
|
|
224
|
+
type: "linear",
|
|
225
|
+
stroke: `var(--color-${series.key})`,
|
|
226
|
+
strokeWidth: 2,
|
|
227
|
+
dot: dots ? { r: 2.5, strokeWidth: 0, fill: `var(--color-${series.key})` } : false,
|
|
228
|
+
activeDot: { r: 4 },
|
|
229
|
+
connectNulls: false,
|
|
230
|
+
isAnimationActive: false,
|
|
231
|
+
children: series === labelled ? lastLabel(series.key) : null
|
|
232
|
+
}, series.key))
|
|
233
|
+
]
|
|
234
|
+
}) : chart.type === "area" ? /* @__PURE__ */ jsxs(AreaChart, {
|
|
235
|
+
...cartesian,
|
|
236
|
+
children: [
|
|
237
|
+
axes,
|
|
238
|
+
tooltip,
|
|
239
|
+
legend,
|
|
240
|
+
data.series.map((series) => /* @__PURE__ */ jsx(Area, {
|
|
241
|
+
dataKey: series.key,
|
|
242
|
+
type: "linear",
|
|
243
|
+
stroke: `var(--color-${series.key})`,
|
|
244
|
+
strokeWidth: 2,
|
|
245
|
+
fill: `var(--color-${series.key})`,
|
|
246
|
+
fillOpacity: 0.12,
|
|
247
|
+
isAnimationActive: false,
|
|
248
|
+
...chart.stacked ? { stackId: "stack" } : {},
|
|
249
|
+
children: series === labelled ? lastLabel(series.key) : null
|
|
250
|
+
}, series.key))
|
|
251
|
+
]
|
|
252
|
+
}) : /* @__PURE__ */ jsxs(BarChart, {
|
|
253
|
+
...cartesian,
|
|
254
|
+
barCategoryGap: "22%",
|
|
255
|
+
children: [
|
|
256
|
+
axes,
|
|
257
|
+
tooltip,
|
|
258
|
+
legend,
|
|
259
|
+
data.series.map((series, index) => /* @__PURE__ */ jsx(Bar, {
|
|
260
|
+
dataKey: series.key,
|
|
261
|
+
fill: `var(--color-${series.key})`,
|
|
262
|
+
radius: chart.stacked && index < data.series.length - 1 ? 0 : [4, 4, 0, 0],
|
|
263
|
+
maxBarSize: 56,
|
|
264
|
+
isAnimationActive: false,
|
|
265
|
+
...chart.stacked ? { stackId: "stack" } : {},
|
|
266
|
+
children: series === labelled ? lastLabel(series.key) : null
|
|
267
|
+
}, series.key))
|
|
268
|
+
]
|
|
269
|
+
})
|
|
270
|
+
});
|
|
271
|
+
});
|
|
272
|
+
export {
|
|
273
|
+
chart_default as default
|
|
274
|
+
};
|
|
275
|
+
|
|
276
|
+
//# debugId=7334E965119D457D64756E2164756E21
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/artifacts/renderers/sheet/chart.tsx"],
|
|
4
|
+
"sourcesContent": [
|
|
5
|
+
"import type { WorkbookChart } from \"@sixb/core/artifacts\"\nimport {\n type ChartConfig,\n ChartContainer,\n ChartLegend,\n ChartLegendContent,\n ChartTooltip,\n ChartTooltipContent,\n} from \"@sixb/ui/components\"\nimport { memo, useMemo } from \"react\"\nimport {\n Area,\n AreaChart,\n Bar,\n BarChart,\n CartesianGrid,\n Cell,\n LabelList,\n Line,\n LineChart,\n Pie,\n PieChart,\n XAxis,\n YAxis,\n} from \"recharts\"\nimport { chartData, latestValue } from \"./chart-data\"\nimport { cellFormatter, compactFormatter } from \"./format\"\nimport type { SheetModel } from \"./model\"\n\n/**\n * Every chart in a sheet, drawn by Sixb from the sheet's data: the theme's chart colors, axes and\n * tooltips formatted as the columns are, a legend only when there are several series, and the\n * latest value labelled. Loaded on demand, so a sheet without charts never fetches it, and drawn\n * again only when its data changes: the grid beside it re-renders on every move of the selection.\n */\nexport default memo(function SheetChart({\n chart,\n model,\n locale,\n}: {\n readonly chart: WorkbookChart\n readonly model: SheetModel\n readonly locale: string\n}) {\n const data = useMemo(() => chartData(chart, model), [chart, model])\n const config = useMemo<ChartConfig>(\n () =>\n Object.fromEntries(\n (data?.series ?? []).map((series) => [\n series.key,\n { label: series.label, color: series.color },\n ])\n ),\n [data]\n )\n if (!data) return null\n\n const [first] = data.series\n if (!first) return null\n const axis = compactFormatter(first.column, locale)\n const values = Object.fromEntries(\n data.series.map((series) => [series.key, cellFormatter(series.column, locale)])\n )\n const formatValue = (value: unknown, key: string) =>\n typeof value === \"number\" ? (values[key]?.(String(value)).text ?? String(value)) : String(value)\n const x = cellFormatter(data.x, locale)\n const formatX = (value: unknown) => x(String(value)).text\n const lastIndex = data.rows.length - 1\n const several = data.series.length > 1\n // Straight segments between the values there are; a few points also show as dots.\n const dots = data.rows.length <= 24\n // Stacked series are labelled once, with their total, at the top of the stack.\n const labelled = chart.stacked ? data.series.at(-1) : first\n const latest = latestValue(data, Boolean(chart.stacked))\n\n const tooltip = (\n <ChartTooltip\n cursor={chart.type === \"bar\" ? { fill: \"var(--muted)\", opacity: 0.6 } : true}\n content={\n <ChartTooltipContent\n labelFormatter={(label) => formatX(label)}\n formatter={(value, name, item) => (\n <span className=\"flex w-full items-center justify-between gap-4\">\n <span className=\"flex items-center gap-1.5 text-muted-foreground\">\n <span className=\"size-2 rounded-[2px]\" style={{ background: item.color }} />\n {config[String(name)]?.label}\n </span>\n <span className=\"font-medium text-foreground tabular-nums\">\n {formatValue(value, String(name))}\n </span>\n </span>\n )}\n />\n }\n />\n )\n const lastLabel = (key: string) => (\n <LabelList\n dataKey={key}\n content={(props) => {\n const { index, x, y, width, value } = props as {\n index?: number\n x?: number | string\n y?: number | string\n width?: number | string\n value?: unknown\n }\n if (index !== lastIndex || typeof value !== \"number\" || latest === null) return null\n const left = Number(x ?? 0) + Number(width ?? 0) / 2\n return (\n <text\n x={left}\n y={Number(y ?? 0) - 8}\n textAnchor=\"middle\"\n className=\"fill-foreground text-[11px] font-semibold tabular-nums\"\n >\n {axis(latest)}\n </text>\n )\n }}\n />\n )\n const cartesian = {\n data: data.rows as Record<string, string | number | null>[],\n margin: { top: 24, right: 12, bottom: 0, left: 0 },\n accessibilityLayer: true,\n }\n const axes = (\n <>\n <CartesianGrid vertical={false} strokeDasharray=\"0\" />\n <XAxis\n dataKey=\"x\"\n tickLine={false}\n axisLine={false}\n tickMargin={10}\n minTickGap={chart.type === \"bar\" ? 4 : 16}\n tickFormatter={formatX}\n />\n {/* A line shows change, so its axis fits the values; bars and areas measure from zero. */}\n <YAxis\n tickLine={false}\n axisLine={false}\n tickMargin={6}\n width={56}\n tickFormatter={axis}\n {...(chart.type === \"line\" ? { domain: [\"auto\", \"auto\"] } : {})}\n />\n </>\n )\n const legend = several ? (\n <ChartLegend\n verticalAlign=\"top\"\n align=\"left\"\n content={<ChartLegendContent className=\"justify-start pb-3\" />}\n />\n ) : null\n\n if (chart.type === \"pie\") {\n const slices = data.rows.flatMap((row, index) => {\n const value = row[first.key]\n return typeof value === \"number\" && value > 0\n ? [{ label: formatX(row.x), value, color: `var(--chart-${(index % 5) + 1})` }]\n : []\n })\n const total = slices.reduce((sum, slice) => sum + slice.value, 0)\n const share = new Intl.NumberFormat(locale, { style: \"percent\", maximumFractionDigits: 0 })\n return (\n <div className=\"flex h-full min-h-0 w-full flex-col gap-3\">\n <ChartContainer config={config} className=\"aspect-auto min-h-0 w-full flex-1\">\n <PieChart accessibilityLayer>\n <ChartTooltip\n content={\n <ChartTooltipContent\n hideLabel\n formatter={(value, name) => (\n <span className=\"flex w-full items-center justify-between gap-4\">\n <span className=\"text-muted-foreground\">{String(name)}</span>\n <span className=\"font-medium text-foreground tabular-nums\">\n {formatValue(value, first.key)}\n </span>\n </span>\n )}\n />\n }\n />\n <Pie\n data={slices}\n dataKey=\"value\"\n nameKey=\"label\"\n innerRadius=\"56%\"\n outerRadius=\"88%\"\n paddingAngle={1.5}\n strokeWidth={0}\n isAnimationActive={false}\n >\n {/* By position: two slices can share a label. */}\n {slices.map((slice, index) => (\n <Cell key={index} fill={slice.color} />\n ))}\n </Pie>\n </PieChart>\n </ChartContainer>\n {/* The legend names each slice with its value and share; the chart's colors alone don't. */}\n <ul className=\"mx-auto my-0 grid w-full max-w-sm shrink-0 list-none gap-1.5 p-0 text-xs\">\n {slices.map((slice, index) => (\n <li key={index} className=\"flex items-center gap-2\">\n <span className=\"size-2 shrink-0 rounded-[2px]\" style={{ background: slice.color }} />\n <span className=\"min-w-0 flex-1 truncate text-muted-foreground\">{slice.label}</span>\n <span className=\"font-medium text-foreground tabular-nums\">\n {formatValue(slice.value, first.key)}\n </span>\n <span className=\"w-9 text-right text-muted-foreground tabular-nums\">\n {share.format(total > 0 ? slice.value / total : 0)}\n </span>\n </li>\n ))}\n </ul>\n </div>\n )\n }\n\n return (\n <ChartContainer config={config} className=\"aspect-auto h-full w-full\">\n {chart.type === \"line\" ? (\n <LineChart {...cartesian}>\n {axes}\n {tooltip}\n {legend}\n {data.series.map((series) => (\n <Line\n key={series.key}\n dataKey={series.key}\n type=\"linear\"\n stroke={`var(--color-${series.key})`}\n strokeWidth={2}\n dot={dots ? { r: 2.5, strokeWidth: 0, fill: `var(--color-${series.key})` } : false}\n activeDot={{ r: 4 }}\n connectNulls={false}\n isAnimationActive={false}\n >\n {series === labelled ? lastLabel(series.key) : null}\n </Line>\n ))}\n </LineChart>\n ) : chart.type === \"area\" ? (\n <AreaChart {...cartesian}>\n {axes}\n {tooltip}\n {legend}\n {data.series.map((series) => (\n <Area\n key={series.key}\n dataKey={series.key}\n type=\"linear\"\n stroke={`var(--color-${series.key})`}\n strokeWidth={2}\n fill={`var(--color-${series.key})`}\n fillOpacity={0.12}\n isAnimationActive={false}\n {...(chart.stacked ? { stackId: \"stack\" } : {})}\n >\n {series === labelled ? lastLabel(series.key) : null}\n </Area>\n ))}\n </AreaChart>\n ) : (\n <BarChart {...cartesian} barCategoryGap=\"22%\">\n {axes}\n {tooltip}\n {legend}\n {data.series.map((series, index) => (\n <Bar\n key={series.key}\n dataKey={series.key}\n fill={`var(--color-${series.key})`}\n radius={chart.stacked && index < data.series.length - 1 ? 0 : [4, 4, 0, 0]}\n maxBarSize={56}\n isAnimationActive={false}\n {...(chart.stacked ? { stackId: \"stack\" } : {})}\n >\n {series === labelled ? lastLabel(series.key) : null}\n </Bar>\n ))}\n </BarChart>\n )}\n </ChartContainer>\n )\n})\n"
|
|
6
|
+
],
|
|
7
|
+
"mappings": ";;;;;;;;;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AAyBA,IAAe,qBAAK,SAAS,UAAU;AAAA,EACrC;AAAA,EACA;AAAA,EACA;AAAA,GAKC;AAAA,EACD,MAAM,OAAO,QAAQ,MAAM,UAAU,OAAO,KAAK,GAAG,CAAC,OAAO,KAAK,CAAC;AAAA,EAClE,MAAM,SAAS,QACb,MACE,OAAO,aACJ,MAAM,UAAU,CAAC,GAAG,IAAI,CAAC,WAAW;AAAA,IACnC,OAAO;AAAA,IACP,EAAE,OAAO,OAAO,OAAO,OAAO,OAAO,MAAM;AAAA,EAC7C,CAAC,CACH,GACF,CAAC,IAAI,CACP;AAAA,EACA,IAAI,CAAC;AAAA,IAAM,OAAO;AAAA,EAElB,OAAO,SAAS,KAAK;AAAA,EACrB,IAAI,CAAC;AAAA,IAAO,OAAO;AAAA,EACnB,MAAM,OAAO,iBAAiB,MAAM,QAAQ,MAAM;AAAA,EAClD,MAAM,SAAS,OAAO,YACpB,KAAK,OAAO,IAAI,CAAC,WAAW,CAAC,OAAO,KA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164756E21",
|
|
9
|
+
"names": []
|
|
10
|
+
}
|
|
@@ -58,7 +58,8 @@ var sectionCatalog = [
|
|
|
58
58
|
]
|
|
59
59
|
},
|
|
60
60
|
{ id: "logs", path: "/observability/logs", exportName: "ObservabilityLogsPage" },
|
|
61
|
-
{ id: "ai-usage", path: "/observability/ai-usage", exportName: "ObservabilityAiUsagePage" }
|
|
61
|
+
{ id: "ai-usage", path: "/observability/ai-usage", exportName: "ObservabilityAiUsagePage" },
|
|
62
|
+
{ id: "activity", path: "/observability/activity", exportName: "ObservabilityActivityPage" }
|
|
62
63
|
]
|
|
63
64
|
},
|
|
64
65
|
{
|
|
@@ -145,4 +146,4 @@ var sectionIds = sectionCatalog.map((section) => section.id);
|
|
|
145
146
|
|
|
146
147
|
export { sectionCatalog, sectionIds };
|
|
147
148
|
|
|
148
|
-
//# debugId=
|
|
149
|
+
//# debugId=3F912DE82FC7FCEA64756E2164756E21
|