@databricks/appkit-ui 0.20.1 → 0.20.3
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/CLAUDE.md +5 -13
- package/NOTICE.md +3 -6
- package/README.md +1 -1
- package/dist/cli/commands/plugin/add-resource/add-resource.js.map +1 -1
- package/dist/js/arrow/lazy-arrow.d.ts +8 -0
- package/dist/js/arrow/lazy-arrow.d.ts.map +1 -1
- package/dist/js/arrow/lazy-arrow.js +8 -0
- package/dist/js/arrow/lazy-arrow.js.map +1 -1
- package/dist/react/charts/area/index.d.ts +0 -1
- package/dist/react/charts/area/index.d.ts.map +1 -1
- package/dist/react/charts/area/index.js.map +1 -1
- package/dist/react/charts/bar/index.d.ts +0 -1
- package/dist/react/charts/bar/index.d.ts.map +1 -1
- package/dist/react/charts/bar/index.js.map +1 -1
- package/dist/react/charts/constants.d.ts +1 -3
- package/dist/react/charts/constants.d.ts.map +1 -1
- package/dist/react/charts/constants.js +1 -3
- package/dist/react/charts/constants.js.map +1 -1
- package/dist/react/charts/heatmap/index.d.ts +0 -1
- package/dist/react/charts/heatmap/index.d.ts.map +1 -1
- package/dist/react/charts/heatmap/index.js.map +1 -1
- package/dist/react/charts/index.d.ts +1 -1
- package/dist/react/charts/index.js +1 -1
- package/dist/react/charts/line/index.d.ts +0 -1
- package/dist/react/charts/line/index.d.ts.map +1 -1
- package/dist/react/charts/line/index.js.map +1 -1
- package/dist/react/charts/pie/index.d.ts +0 -1
- package/dist/react/charts/pie/index.d.ts.map +1 -1
- package/dist/react/charts/pie/index.js.map +1 -1
- package/dist/react/charts/radar/index.d.ts +0 -1
- package/dist/react/charts/radar/index.d.ts.map +1 -1
- package/dist/react/charts/radar/index.js.map +1 -1
- package/dist/react/charts/scatter/index.d.ts +0 -1
- package/dist/react/charts/scatter/index.d.ts.map +1 -1
- package/dist/react/charts/scatter/index.js.map +1 -1
- package/dist/react/genie/genie-chat-input.d.ts.map +1 -1
- package/dist/react/genie/genie-chat-input.js.map +1 -1
- package/dist/react/genie/genie-chat-message-list.d.ts.map +1 -1
- package/dist/react/genie/genie-chat-message-list.js.map +1 -1
- package/dist/react/genie/genie-chat-message.d.ts.map +1 -1
- package/dist/react/genie/genie-chat-message.js.map +1 -1
- package/dist/react/genie/genie-query-visualization.d.ts.map +1 -1
- package/dist/react/genie/genie-query-visualization.js.map +1 -1
- package/dist/react/index.d.ts +2 -2
- package/dist/react/index.js +2 -2
- package/dist/schemas/plugin-manifest.generated.d.ts +178 -0
- package/dist/schemas/plugin-manifest.generated.d.ts.map +1 -0
- package/dist/schemas/plugin-manifest.schema.json +2 -0
- package/docs/api/appkit/Interface.CacheConfig.md +1 -1
- package/docs/api/appkit/Interface.PluginManifest.md +104 -6
- package/docs/api/appkit/Interface.ResourceEntry.md +5 -7
- package/docs/api/appkit/Interface.ResourceFieldEntry.md +2 -0
- package/docs/api/appkit/Interface.ResourceRequirement.md +63 -7
- package/docs/api/appkit/Interface.StreamExecutionSettings.md +1 -1
- package/docs/api/appkit/TypeAlias.PluginData.md +2 -0
- package/docs/api/appkit/TypeAlias.ToPlugin.md +2 -0
- package/docs/api/appkit.md +6 -6
- package/docs/plugins/genie.md +8 -0
- package/llms.txt +5 -13
- package/package.json +2 -5
- package/docs/api/appkit-ui/data/AreaChart.md +0 -79
- package/docs/api/appkit-ui/data/BarChart.md +0 -74
- package/docs/api/appkit-ui/data/DonutChart.md +0 -72
- package/docs/api/appkit-ui/data/HeatmapChart.md +0 -91
- package/docs/api/appkit-ui/data/LineChart.md +0 -77
- package/docs/api/appkit-ui/data/PieChart.md +0 -72
- package/docs/api/appkit-ui/data/RadarChart.md +0 -74
- package/docs/api/appkit-ui/data/ScatterChart.md +0 -76
package/CLAUDE.md
CHANGED
|
@@ -79,7 +79,7 @@ npx @databricks/appkit docs <query>
|
|
|
79
79
|
- [Function: getWorkspaceClient()](./docs/api/appkit/Function.getWorkspaceClient.md): Get workspace client from config or SDK default auth chain
|
|
80
80
|
- [Function: isSQLTypeMarker()](./docs/api/appkit/Function.isSQLTypeMarker.md): Type guard to check if a value is a SQL type marker
|
|
81
81
|
- [Interface: BasePluginConfig](./docs/api/appkit/Interface.BasePluginConfig.md): Base configuration interface for AppKit plugins
|
|
82
|
-
- [Interface: CacheConfig](./docs/api/appkit/Interface.CacheConfig.md): Configuration for
|
|
82
|
+
- [Interface: CacheConfig](./docs/api/appkit/Interface.CacheConfig.md): Configuration for the CacheInterceptor. Controls TTL, size limits, storage backend, and probabilistic cleanup.
|
|
83
83
|
- [Interface: DatabaseCredential](./docs/api/appkit/Interface.DatabaseCredential.md): Database credentials with OAuth token for Postgres connection
|
|
84
84
|
- [Interface: GenerateDatabaseCredentialRequest](./docs/api/appkit/Interface.GenerateDatabaseCredentialRequest.md): Request parameters for generating database OAuth credentials
|
|
85
85
|
- [Interface: ITelemetry](./docs/api/appkit/Interface.ITelemetry.md): Plugin-facing interface for OpenTelemetry instrumentation.
|
|
@@ -88,30 +88,22 @@ npx @databricks/appkit docs <query>
|
|
|
88
88
|
- [Interface: RequestedClaims](./docs/api/appkit/Interface.RequestedClaims.md): Optional claims for fine-grained Unity Catalog table permissions
|
|
89
89
|
- [Interface: RequestedResource](./docs/api/appkit/Interface.RequestedResource.md): Resource to request permissions for in Unity Catalog
|
|
90
90
|
- [Interface: ResourceEntry](./docs/api/appkit/Interface.ResourceEntry.md): Internal representation of a resource in the registry.
|
|
91
|
-
- [Interface: ResourceFieldEntry](./docs/api/appkit/Interface.ResourceFieldEntry.md): Defines a single field for a resource. Each field has its own environment variable and optional description.
|
|
91
|
+
- [Interface: ResourceFieldEntry](./docs/api/appkit/Interface.ResourceFieldEntry.md): Defines a single field for a resource. Each field has its own environment variable and optional description. Single-value types use one key (e.g. id); multi-value types (database, secret) use multiple (e.g. instancename, databasename or scope, key).
|
|
92
92
|
- [Interface: ResourceRequirement](./docs/api/appkit/Interface.ResourceRequirement.md): Declares a resource requirement for a plugin.
|
|
93
|
-
- [Interface: StreamExecutionSettings](./docs/api/appkit/Interface.StreamExecutionSettings.md):
|
|
93
|
+
- [Interface: StreamExecutionSettings](./docs/api/appkit/Interface.StreamExecutionSettings.md): Execution settings for streaming endpoints. Extends PluginExecutionSettings with SSE stream configuration.
|
|
94
94
|
- [Interface: TelemetryConfig](./docs/api/appkit/Interface.TelemetryConfig.md): OpenTelemetry configuration for AppKit applications
|
|
95
95
|
- [Interface: ValidationResult](./docs/api/appkit/Interface.ValidationResult.md): Result of validating all registered resources against the environment.
|
|
96
96
|
- [Type Alias: ConfigSchema](./docs/api/appkit/TypeAlias.ConfigSchema.md): Configuration schema definition for plugin config.
|
|
97
97
|
- [Type Alias: IAppRouter](./docs/api/appkit/TypeAlias.IAppRouter.md): Express router type for plugin route registration
|
|
98
|
-
- [Type Alias: PluginData<T, U, N>](./docs/api/appkit/TypeAlias.PluginData.md):
|
|
98
|
+
- [Type Alias: PluginData<T, U, N>](./docs/api/appkit/TypeAlias.PluginData.md): Tuple of plugin class, config, and name. Created by toPlugin() and passed to createApp().
|
|
99
99
|
- [Type Alias: ResourcePermission](./docs/api/appkit/TypeAlias.ResourcePermission.md): Union of all possible permission levels across all resource types.
|
|
100
|
-
- [Type Alias: ToPlugin()<T, U, N>](./docs/api/appkit/TypeAlias.ToPlugin.md):
|
|
100
|
+
- [Type Alias: ToPlugin()<T, U, N>](./docs/api/appkit/TypeAlias.ToPlugin.md): Factory function type returned by toPlugin(). Accepts optional config and returns a PluginData tuple.
|
|
101
101
|
- [Variable: sql](./docs/api/appkit/Variable.sql.md): SQL helper namespace
|
|
102
102
|
|
|
103
103
|
## appkit-ui API reference [collapsed]
|
|
104
104
|
|
|
105
105
|
- [@databricks/appkit-ui](./docs/api/appkit-ui.md): The library provides a set of UI primitives for building Databricks apps in React.
|
|
106
|
-
- [AreaChart](./docs/api/appkit-ui/data/AreaChart.md): Area Chart component for trend visualization with filled areas.
|
|
107
|
-
- [BarChart](./docs/api/appkit-ui/data/BarChart.md): Bar Chart component for categorical comparisons.
|
|
108
106
|
- [DataTable](./docs/api/appkit-ui/data/DataTable.md): Production-ready data table with automatic data fetching and state management
|
|
109
|
-
- [DonutChart](./docs/api/appkit-ui/data/DonutChart.md): Donut Chart component (Pie chart with inner radius).
|
|
110
|
-
- [HeatmapChart](./docs/api/appkit-ui/data/HeatmapChart.md): Heatmap Chart component for matrix-style data visualization.
|
|
111
|
-
- [LineChart](./docs/api/appkit-ui/data/LineChart.md): Line Chart component for time-series and trend visualization.
|
|
112
|
-
- [PieChart](./docs/api/appkit-ui/data/PieChart.md): Pie Chart component for proportional data visualization.
|
|
113
|
-
- [RadarChart](./docs/api/appkit-ui/data/RadarChart.md): Radar Chart component for multi-dimensional data comparison.
|
|
114
|
-
- [ScatterChart](./docs/api/appkit-ui/data/ScatterChart.md): Scatter Chart component for correlation and distribution visualization.
|
|
115
107
|
- [DirectoryList](./docs/api/appkit-ui/files/DirectoryList.md): Card-wrapped directory listing with loading, error, and empty states
|
|
116
108
|
- [FileBreadcrumb](./docs/api/appkit-ui/files/FileBreadcrumb.md): Path-aware breadcrumb navigation built on top of Breadcrumb primitives
|
|
117
109
|
- [FileEntry](./docs/api/appkit-ui/files/FileEntry.md): Single file or directory row with icon, name, size, and selection state
|
package/NOTICE.md
CHANGED
|
@@ -8,7 +8,6 @@ This Software contains code from the following open source projects:
|
|
|
8
8
|
| :--------------- | :---------------- | :----------- | :--------------------------------------------------- |
|
|
9
9
|
| [@ast-grep/napi](https://www.npmjs.com/package/@ast-grep/napi) | 0.37.0 | MIT | https://ast-grep.github.io |
|
|
10
10
|
| [@clack/prompts](https://www.npmjs.com/package/@clack/prompts) | 1.0.1 | MIT | https://github.com/bombshell-dev/clack/tree/main/packages/prompts#readme |
|
|
11
|
-
| [@hookform/resolvers](https://www.npmjs.com/package/@hookform/resolvers) | 5.2.2 | MIT | https://react-hook-form.com |
|
|
12
11
|
| [@opentelemetry/api](https://www.npmjs.com/package/@opentelemetry/api) | 1.9.0 | Apache-2.0 | https://github.com/open-telemetry/opentelemetry-js/tree/main/api |
|
|
13
12
|
| [@opentelemetry/api-logs](https://www.npmjs.com/package/@opentelemetry/api-logs) | 0.208.0 | Apache-2.0 | https://github.com/open-telemetry/opentelemetry-js/tree/main/experimental/packages/api-logs |
|
|
14
13
|
| [@opentelemetry/auto-instrumentations-node](https://www.npmjs.com/package/@opentelemetry/auto-instrumentations-node) | 0.67.2 | Apache-2.0 | https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/packages/auto-instrumentations-node#readme |
|
|
@@ -18,10 +17,11 @@ This Software contains code from the following open source projects:
|
|
|
18
17
|
| [@opentelemetry/instrumentation](https://www.npmjs.com/package/@opentelemetry/instrumentation) | 0.208.0 | Apache-2.0 | https://github.com/open-telemetry/opentelemetry-js/tree/main/experimental/packages/opentelemetry-instrumentation |
|
|
19
18
|
| [@opentelemetry/instrumentation-express](https://www.npmjs.com/package/@opentelemetry/instrumentation-express) | 0.57.0 | Apache-2.0 | https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/packages/instrumentation-express#readme |
|
|
20
19
|
| [@opentelemetry/instrumentation-http](https://www.npmjs.com/package/@opentelemetry/instrumentation-http) | 0.208.0 | Apache-2.0 | https://github.com/open-telemetry/opentelemetry-js/tree/main/experimental/packages/opentelemetry-instrumentation-http |
|
|
21
|
-
| [@opentelemetry/resources](https://www.npmjs.com/package/@opentelemetry/resources) | 2.2.0 | Apache-2.0 | https://github.com/open-telemetry/opentelemetry-js/tree/main/packages/opentelemetry-resources |
|
|
20
|
+
| [@opentelemetry/resources](https://www.npmjs.com/package/@opentelemetry/resources) | 2.2.0, 2.6.0 | Apache-2.0 | https://github.com/open-telemetry/opentelemetry-js/tree/main/packages/opentelemetry-resources |
|
|
22
21
|
| [@opentelemetry/sdk-logs](https://www.npmjs.com/package/@opentelemetry/sdk-logs) | 0.208.0 | Apache-2.0 | https://github.com/open-telemetry/opentelemetry-js/tree/main/experimental/packages/sdk-logs |
|
|
23
22
|
| [@opentelemetry/sdk-metrics](https://www.npmjs.com/package/@opentelemetry/sdk-metrics) | 2.2.0 | Apache-2.0 | https://github.com/open-telemetry/opentelemetry-js/tree/main/packages/sdk-metrics |
|
|
24
23
|
| [@opentelemetry/sdk-node](https://www.npmjs.com/package/@opentelemetry/sdk-node) | 0.208.0 | Apache-2.0 | https://github.com/open-telemetry/opentelemetry-js/tree/main/experimental/packages/opentelemetry-sdk-node |
|
|
24
|
+
| [@opentelemetry/sdk-trace-base](https://www.npmjs.com/package/@opentelemetry/sdk-trace-base) | 2.2.0, 2.6.0 | Apache-2.0 | https://github.com/open-telemetry/opentelemetry-js/tree/main/packages/opentelemetry-sdk-trace-base |
|
|
25
25
|
| [@opentelemetry/semantic-conventions](https://www.npmjs.com/package/@opentelemetry/semantic-conventions) | 1.38.0 | Apache-2.0 | https://github.com/open-telemetry/opentelemetry-js/tree/main/semantic-conventions |
|
|
26
26
|
| [@radix-ui/react-accordion](https://www.npmjs.com/package/@radix-ui/react-accordion) | 1.2.12 | MIT | https://radix-ui.com/primitives |
|
|
27
27
|
| [@radix-ui/react-alert-dialog](https://www.npmjs.com/package/@radix-ui/react-alert-dialog) | 1.1.15 | MIT | https://radix-ui.com/primitives |
|
|
@@ -50,7 +50,6 @@ This Software contains code from the following open source projects:
|
|
|
50
50
|
| [@radix-ui/react-toggle-group](https://www.npmjs.com/package/@radix-ui/react-toggle-group) | 1.1.11 | MIT | https://radix-ui.com/primitives |
|
|
51
51
|
| [@radix-ui/react-tooltip](https://www.npmjs.com/package/@radix-ui/react-tooltip) | 1.2.8 | MIT | https://radix-ui.com/primitives |
|
|
52
52
|
| [@tanstack/react-table](https://www.npmjs.com/package/@tanstack/react-table) | 8.21.3 | MIT | https://tanstack.com/table |
|
|
53
|
-
| [@tanstack/react-virtual](https://www.npmjs.com/package/@tanstack/react-virtual) | 3.13.12 | MIT | https://tanstack.com/virtual |
|
|
54
53
|
| [@types/semver](https://www.npmjs.com/package/@types/semver) | 7.7.1 | MIT | https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/semver |
|
|
55
54
|
| [ajv](https://www.npmjs.com/package/ajv) | 6.12.6, 8.17.1 | MIT | https://ajv.js.org |
|
|
56
55
|
| [ajv-formats](https://www.npmjs.com/package/ajv-formats) | 2.1.1, 3.0.1 | MIT | https://github.com/ajv-validator/ajv-formats#readme |
|
|
@@ -59,8 +58,8 @@ This Software contains code from the following open source projects:
|
|
|
59
58
|
| [clsx](https://www.npmjs.com/package/clsx) | 2.1.1 | MIT | https://github.com/lukeed/clsx#readme |
|
|
60
59
|
| [cmdk](https://www.npmjs.com/package/cmdk) | 1.1.1 | MIT | https://github.com/pacocoursey/cmdk#readme |
|
|
61
60
|
| [commander](https://www.npmjs.com/package/commander) | 2.20.3, 5.1.0, 7.2.0, 8.3.0, 10.0.1, 12.1.0 | MIT | https://github.com/tj/commander.js#readme |
|
|
62
|
-
| [date-fns](https://www.npmjs.com/package/date-fns) | 4.1.0 | MIT | https://github.com/date-fns/date-fns#readme |
|
|
63
61
|
| [dotenv](https://www.npmjs.com/package/dotenv) | 16.6.1 | BSD-2-Clause | https://github.com/motdotla/dotenv#readme |
|
|
62
|
+
| [echarts](https://www.npmjs.com/package/echarts) | 6.0.0 | Apache-2.0 | https://echarts.apache.org |
|
|
64
63
|
| [echarts-for-react](https://www.npmjs.com/package/echarts-for-react) | 3.0.5 | MIT | https://github.com/hustcc/echarts-for-react |
|
|
65
64
|
| [embla-carousel-react](https://www.npmjs.com/package/embla-carousel-react) | 8.6.0 | MIT | https://www.embla-carousel.com |
|
|
66
65
|
| [express](https://www.npmjs.com/package/express) | 4.22.0 | MIT | http://expressjs.com/ |
|
|
@@ -79,6 +78,4 @@ This Software contains code from the following open source projects:
|
|
|
79
78
|
| [tailwind-merge](https://www.npmjs.com/package/tailwind-merge) | 3.4.0 | MIT | https://github.com/dcastil/tailwind-merge |
|
|
80
79
|
| [vaul](https://www.npmjs.com/package/vaul) | 1.1.2 | MIT | https://vaul.emilkowal.ski/ |
|
|
81
80
|
| [ws](https://www.npmjs.com/package/ws) | 7.5.10, 8.18.3 | MIT | https://github.com/websockets/ws |
|
|
82
|
-
| [zod](https://www.npmjs.com/package/zod) | 4.1.13 | MIT | https://zod.dev |
|
|
83
|
-
| [zod-to-ts](https://www.npmjs.com/package/zod-to-ts) | 2.0.0 | MIT | https://github.com/sachinraja/zod-to-ts#readme |
|
|
84
81
|
|
package/README.md
CHANGED
|
@@ -32,10 +32,10 @@ AppKit's power comes from its plugin system. Each plugin adds a focused capabili
|
|
|
32
32
|
### Available now
|
|
33
33
|
|
|
34
34
|
- **Analytics Plugin** — Query your Lakehouse data directly from your app. Define SQL queries as files, execute them against Databricks SQL Warehouses, and get automatic caching, parameterization, and on-behalf-of user execution out of the box. Perfect for building apps that surface insights from your Lakehouse.
|
|
35
|
+
- **Genie Plugin** — Conversational AI interface powered by Databricks AI/BI Genie. Let users ask natural language questions against your data and get answers with automatic chart inference and visualization.
|
|
35
36
|
|
|
36
37
|
### Coming soon
|
|
37
38
|
|
|
38
|
-
- **Genie Plugin** — Conversational AI interface powered by Databricks Genie
|
|
39
39
|
- **Files Plugin** — Browse, upload, and manage files in Unity Catalog Volumes
|
|
40
40
|
- **Lakebase Plugin** — OLTP database operations with automatic OAuth token management
|
|
41
41
|
- ...and this is just the beginning.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"add-resource.js","names":[],"sources":["../../../../../src/cli/commands/plugin/add-resource/add-resource.ts"],"sourcesContent":["import fs from \"node:fs\";\nimport path from \"node:path\";\nimport process from \"node:process\";\nimport { cancel, intro, outro } from \"@clack/prompts\";\nimport { Command } from \"commander\";\nimport { promptOneResource } from \"../create/prompt-resource\";\nimport { humanizeResourceType } from \"../create/resource-defaults\";\nimport { resolveManifestInDir } from \"../manifest-resolve\";\nimport type { PluginManifest } from \"../manifest-types\";\nimport { validateManifest } from \"../validate/validate-manifest\";\n\n/** Extended manifest type that preserves extra JSON fields (e.g. $schema, author, version) for round-trip writes. */\ninterface ManifestWithExtras extends PluginManifest {\n [key: string]: unknown;\n}\n\nasync function runPluginAddResource(options: { path?: string }): Promise<void> {\n intro(\"Add resource to plugin manifest\");\n\n const cwd = process.cwd();\n const pluginDir = path.resolve(cwd, options.path ?? \".\");\n const resolved = resolveManifestInDir(pluginDir, { allowJsManifest: true });\n\n if (!resolved) {\n console.error(\n `No manifest found in ${pluginDir}. This command requires manifest.json (manifest.js cannot be edited in place).`,\n );\n process.exit(1);\n }\n\n if (resolved.type !== \"json\") {\n console.error(\n `Editable manifest not found. add-resource only supports plugin directories that contain manifest.json (found ${path.basename(resolved.path)}).`,\n );\n process.exit(1);\n }\n\n const manifestPath = resolved.path;\n\n let manifest: ManifestWithExtras;\n try {\n const raw = fs.readFileSync(manifestPath, \"utf-8\");\n const parsed = JSON.parse(raw) as unknown;\n const result = validateManifest(parsed);\n if (!result.valid || !result.manifest) {\n console.error(\n \"Invalid manifest. Run `appkit plugin validate` for details.\",\n );\n process.exit(1);\n }\n manifest = parsed as ManifestWithExtras;\n } catch (err) {\n console.error(\n \"Failed to read or parse manifest.json:\",\n err instanceof Error ? err.message : err,\n );\n process.exit(1);\n }\n\n const spec = await promptOneResource();\n if (!spec) {\n cancel(\"Cancelled.\");\n process.exit(0);\n }\n\n const alias = humanizeResourceType(spec.type);\n const entry = {\n type: spec.type,\n alias,\n resourceKey: spec.resourceKey,\n description: spec.description || `Required for ${alias} functionality.`,\n permission: spec.permission,\n fields: spec.fields,\n };\n\n if (spec.required) {\n manifest.resources.required.push(entry);\n } else {\n manifest.resources.optional.push(entry);\n }\n\n fs.writeFileSync(manifestPath, `${JSON.stringify(manifest, null, 2)}\\n`);\n\n outro(\"Resource added.\");\n console.log(\n `\\nAdded ${alias} as ${spec.required ? \"required\" : \"optional\"} to ${path.relative(cwd, manifestPath)}`,\n );\n}\n\nexport const pluginAddResourceCommand = new Command(\"add-resource\")\n .description(\n \"Add a resource requirement to an existing plugin manifest (interactive). Overwrites manifest.json in place.\",\n )\n .option(\n \"-p, --path <dir>\",\n \"Plugin directory containing manifest.json, which will be edited in place (default: .)\",\n )\n .action((opts) =>\n runPluginAddResource(opts).catch((err) => {\n console.error(err);\n process.exit(1);\n }),\n );\n"],"mappings":";;;;;;;;;;;AAgBA,eAAe,qBAAqB,SAA2C;AAC7E,OAAM,kCAAkC;CAExC,MAAM,MAAM,QAAQ,KAAK;CACzB,MAAM,YAAY,KAAK,QAAQ,KAAK,QAAQ,QAAQ,IAAI;CACxD,MAAM,WAAW,qBAAqB,WAAW,EAAE,iBAAiB,MAAM,CAAC;AAE3E,KAAI,CAAC,UAAU;AACb,UAAQ,MACN,wBAAwB,UAAU,gFACnC;AACD,UAAQ,KAAK,EAAE;;AAGjB,KAAI,SAAS,SAAS,QAAQ;AAC5B,UAAQ,MACN,gHAAgH,KAAK,SAAS,SAAS,KAAK,CAAC,IAC9I;AACD,UAAQ,KAAK,EAAE;;CAGjB,MAAM,eAAe,SAAS;CAE9B,IAAI;AACJ,KAAI;EACF,MAAM,MAAM,GAAG,aAAa,cAAc,QAAQ;EAClD,MAAM,SAAS,KAAK,MAAM,IAAI;EAC9B,MAAM,SAAS,iBAAiB,OAAO;AACvC,MAAI,CAAC,OAAO,SAAS,CAAC,OAAO,UAAU;AACrC,WAAQ,MACN,8DACD;AACD,WAAQ,KAAK,EAAE;;AAEjB,aAAW;UACJ,KAAK;AACZ,UAAQ,MACN,0CACA,eAAe,QAAQ,IAAI,UAAU,IACtC;AACD,UAAQ,KAAK,EAAE;;CAGjB,MAAM,OAAO,MAAM,mBAAmB;AACtC,KAAI,CAAC,MAAM;AACT,SAAO,aAAa;AACpB,UAAQ,KAAK,EAAE;;CAGjB,MAAM,QAAQ,qBAAqB,KAAK,KAAK;CAC7C,MAAM,
|
|
1
|
+
{"version":3,"file":"add-resource.js","names":[],"sources":["../../../../../src/cli/commands/plugin/add-resource/add-resource.ts"],"sourcesContent":["import fs from \"node:fs\";\nimport path from \"node:path\";\nimport process from \"node:process\";\nimport { cancel, intro, outro } from \"@clack/prompts\";\nimport { Command } from \"commander\";\nimport { promptOneResource } from \"../create/prompt-resource\";\nimport { humanizeResourceType } from \"../create/resource-defaults\";\nimport { resolveManifestInDir } from \"../manifest-resolve\";\nimport type { PluginManifest, ResourceRequirement } from \"../manifest-types\";\nimport { validateManifest } from \"../validate/validate-manifest\";\n\n/** Extended manifest type that preserves extra JSON fields (e.g. $schema, author, version) for round-trip writes. */\ninterface ManifestWithExtras extends PluginManifest {\n [key: string]: unknown;\n}\n\nasync function runPluginAddResource(options: { path?: string }): Promise<void> {\n intro(\"Add resource to plugin manifest\");\n\n const cwd = process.cwd();\n const pluginDir = path.resolve(cwd, options.path ?? \".\");\n const resolved = resolveManifestInDir(pluginDir, { allowJsManifest: true });\n\n if (!resolved) {\n console.error(\n `No manifest found in ${pluginDir}. This command requires manifest.json (manifest.js cannot be edited in place).`,\n );\n process.exit(1);\n }\n\n if (resolved.type !== \"json\") {\n console.error(\n `Editable manifest not found. add-resource only supports plugin directories that contain manifest.json (found ${path.basename(resolved.path)}).`,\n );\n process.exit(1);\n }\n\n const manifestPath = resolved.path;\n\n let manifest: ManifestWithExtras;\n try {\n const raw = fs.readFileSync(manifestPath, \"utf-8\");\n const parsed = JSON.parse(raw) as unknown;\n const result = validateManifest(parsed);\n if (!result.valid || !result.manifest) {\n console.error(\n \"Invalid manifest. Run `appkit plugin validate` for details.\",\n );\n process.exit(1);\n }\n manifest = parsed as ManifestWithExtras;\n } catch (err) {\n console.error(\n \"Failed to read or parse manifest.json:\",\n err instanceof Error ? err.message : err,\n );\n process.exit(1);\n }\n\n const spec = await promptOneResource();\n if (!spec) {\n cancel(\"Cancelled.\");\n process.exit(0);\n }\n\n const alias = humanizeResourceType(spec.type);\n const entry: ResourceRequirement = {\n // Safe cast: spec.type comes from RESOURCE_TYPE_OPTIONS which reads values\n // from the same JSON schema that generates the ResourceType union.\n type: spec.type as ResourceRequirement[\"type\"],\n alias,\n resourceKey: spec.resourceKey,\n description: spec.description || `Required for ${alias} functionality.`,\n permission: spec.permission,\n fields: spec.fields,\n };\n\n if (spec.required) {\n manifest.resources.required.push(entry);\n } else {\n manifest.resources.optional.push(entry);\n }\n\n fs.writeFileSync(manifestPath, `${JSON.stringify(manifest, null, 2)}\\n`);\n\n outro(\"Resource added.\");\n console.log(\n `\\nAdded ${alias} as ${spec.required ? \"required\" : \"optional\"} to ${path.relative(cwd, manifestPath)}`,\n );\n}\n\nexport const pluginAddResourceCommand = new Command(\"add-resource\")\n .description(\n \"Add a resource requirement to an existing plugin manifest (interactive). Overwrites manifest.json in place.\",\n )\n .option(\n \"-p, --path <dir>\",\n \"Plugin directory containing manifest.json, which will be edited in place (default: .)\",\n )\n .action((opts) =>\n runPluginAddResource(opts).catch((err) => {\n console.error(err);\n process.exit(1);\n }),\n );\n"],"mappings":";;;;;;;;;;;AAgBA,eAAe,qBAAqB,SAA2C;AAC7E,OAAM,kCAAkC;CAExC,MAAM,MAAM,QAAQ,KAAK;CACzB,MAAM,YAAY,KAAK,QAAQ,KAAK,QAAQ,QAAQ,IAAI;CACxD,MAAM,WAAW,qBAAqB,WAAW,EAAE,iBAAiB,MAAM,CAAC;AAE3E,KAAI,CAAC,UAAU;AACb,UAAQ,MACN,wBAAwB,UAAU,gFACnC;AACD,UAAQ,KAAK,EAAE;;AAGjB,KAAI,SAAS,SAAS,QAAQ;AAC5B,UAAQ,MACN,gHAAgH,KAAK,SAAS,SAAS,KAAK,CAAC,IAC9I;AACD,UAAQ,KAAK,EAAE;;CAGjB,MAAM,eAAe,SAAS;CAE9B,IAAI;AACJ,KAAI;EACF,MAAM,MAAM,GAAG,aAAa,cAAc,QAAQ;EAClD,MAAM,SAAS,KAAK,MAAM,IAAI;EAC9B,MAAM,SAAS,iBAAiB,OAAO;AACvC,MAAI,CAAC,OAAO,SAAS,CAAC,OAAO,UAAU;AACrC,WAAQ,MACN,8DACD;AACD,WAAQ,KAAK,EAAE;;AAEjB,aAAW;UACJ,KAAK;AACZ,UAAQ,MACN,0CACA,eAAe,QAAQ,IAAI,UAAU,IACtC;AACD,UAAQ,KAAK,EAAE;;CAGjB,MAAM,OAAO,MAAM,mBAAmB;AACtC,KAAI,CAAC,MAAM;AACT,SAAO,aAAa;AACpB,UAAQ,KAAK,EAAE;;CAGjB,MAAM,QAAQ,qBAAqB,KAAK,KAAK;CAC7C,MAAM,QAA6B;EAGjC,MAAM,KAAK;EACX;EACA,aAAa,KAAK;EAClB,aAAa,KAAK,eAAe,gBAAgB,MAAM;EACvD,YAAY,KAAK;EACjB,QAAQ,KAAK;EACd;AAED,KAAI,KAAK,SACP,UAAS,UAAU,SAAS,KAAK,MAAM;KAEvC,UAAS,UAAU,SAAS,KAAK,MAAM;AAGzC,IAAG,cAAc,cAAc,GAAG,KAAK,UAAU,UAAU,MAAM,EAAE,CAAC,IAAI;AAExE,OAAM,kBAAkB;AACxB,SAAQ,IACN,WAAW,MAAM,MAAM,KAAK,WAAW,aAAa,WAAW,MAAM,KAAK,SAAS,KAAK,aAAa,GACtG;;AAGH,MAAa,2BAA2B,IAAI,QAAQ,eAAe,CAChE,YACC,8GACD,CACA,OACC,oBACA,wFACD,CACA,QAAQ,SACP,qBAAqB,KAAK,CAAC,OAAO,QAAQ;AACxC,SAAQ,MAAM,IAAI;AAClB,SAAQ,KAAK,EAAE;EACf,CACH"}
|
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
import * as apache_arrow0 from "apache-arrow";
|
|
2
2
|
|
|
3
3
|
//#region src/js/arrow/lazy-arrow.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* Lazy loader for Apache Arrow library.
|
|
6
|
+
* The arrow library is substantial (~200KB+ gzipped), so we only load it
|
|
7
|
+
* when Arrow format is actually used.
|
|
8
|
+
*
|
|
9
|
+
* This module caches the import promise to ensure the library is only
|
|
10
|
+
* loaded once, even if multiple components request it simultaneously.
|
|
11
|
+
*/
|
|
4
12
|
/**
|
|
5
13
|
* Lazily loads the Apache Arrow library.
|
|
6
14
|
* Returns cached module if already loaded.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lazy-arrow.d.ts","names":[],"sources":["../../../src/js/arrow/lazy-arrow.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"lazy-arrow.d.ts","names":[],"sources":["../../../src/js/arrow/lazy-arrow.ts"],"mappings":";;;;;;AA0BA;;;;;AAqBA;;;;;;;;;;AAAA,iBArBsB,cAAA,CAAA,GAAkB,OAAA,QAAJ,aAAA;;;;;iBAqBd,oBAAA,CAAA,GAAwB,OAAA"}
|
|
@@ -1,4 +1,12 @@
|
|
|
1
1
|
//#region src/js/arrow/lazy-arrow.ts
|
|
2
|
+
/**
|
|
3
|
+
* Lazy loader for Apache Arrow library.
|
|
4
|
+
* The arrow library is substantial (~200KB+ gzipped), so we only load it
|
|
5
|
+
* when Arrow format is actually used.
|
|
6
|
+
*
|
|
7
|
+
* This module caches the import promise to ensure the library is only
|
|
8
|
+
* loaded once, even if multiple components request it simultaneously.
|
|
9
|
+
*/
|
|
2
10
|
let arrowModulePromise = null;
|
|
3
11
|
/**
|
|
4
12
|
* Lazily loads the Apache Arrow library.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lazy-arrow.js","names":[],"sources":["../../../src/js/arrow/lazy-arrow.ts"],"sourcesContent":["/**\n * Lazy loader for Apache Arrow library.\n * The arrow library is substantial (~200KB+ gzipped), so we only load it\n * when Arrow format is actually used.\n *\n * This module caches the import promise to ensure the library is only\n * loaded once, even if multiple components request it simultaneously.\n */\n\
|
|
1
|
+
{"version":3,"file":"lazy-arrow.js","names":[],"sources":["../../../src/js/arrow/lazy-arrow.ts"],"sourcesContent":["/**\n * Lazy loader for Apache Arrow library.\n * The arrow library is substantial (~200KB+ gzipped), so we only load it\n * when Arrow format is actually used.\n *\n * This module caches the import promise to ensure the library is only\n * loaded once, even if multiple components request it simultaneously.\n */\n\n// ============================================================================\n// Lazy Module Loading\n// ============================================================================\n\n// Cache the import promise to avoid multiple loads\nlet arrowModulePromise: Promise<typeof import(\"apache-arrow\")> | null = null;\n\n/**\n * Lazily loads the Apache Arrow library.\n * Returns cached module if already loaded.\n *\n * @example\n * ```typescript\n * const arrow = await getArrowModule();\n * const table = arrow.tableFromIPC(buffer);\n * ```\n */\nexport async function getArrowModule(): Promise<typeof import(\"apache-arrow\")> {\n if (!arrowModulePromise) {\n arrowModulePromise = import(\"apache-arrow\");\n }\n return arrowModulePromise;\n}\n\n// ============================================================================\n// Cached Type ID Sets\n// ============================================================================\n\n// These are initialized lazily when Arrow is first loaded\nlet temporalTypeIds: Set<number> | null = null;\nlet numericTypeIds: Set<number> | null = null;\nlet stringTypeIds: Set<number> | null = null;\nlet decimalTypeId: number | null = null;\n\n/**\n * Initializes the type ID sets from the Arrow Type enum.\n * Call this after loading the Arrow module.\n */\nexport async function initializeTypeIdSets(): Promise<void> {\n if (temporalTypeIds !== null) return; // Already initialized\n\n const { Type } = await getArrowModule();\n\n temporalTypeIds = new Set([\n Type.Date,\n Type.DateDay,\n Type.DateMillisecond,\n Type.Timestamp,\n Type.TimestampSecond,\n Type.TimestampMillisecond,\n Type.TimestampMicrosecond,\n Type.TimestampNanosecond,\n Type.Time,\n Type.TimeSecond,\n Type.TimeMillisecond,\n Type.TimeMicrosecond,\n Type.TimeNanosecond,\n ]);\n\n numericTypeIds = new Set([\n Type.Int,\n Type.Int8,\n Type.Int16,\n Type.Int32,\n Type.Int64,\n Type.Uint8,\n Type.Uint16,\n Type.Uint32,\n Type.Uint64,\n Type.Float,\n Type.Float16,\n Type.Float32,\n Type.Float64,\n Type.Decimal,\n ]);\n\n stringTypeIds = new Set([Type.Utf8, Type.LargeUtf8]);\n\n decimalTypeId = Type.Decimal;\n}\n\n/**\n * Returns the cached type ID sets.\n * Throws if called before initializeTypeIdSets().\n * This is safe because you can't have a Table without first loading Arrow.\n */\nexport function getTypeIdSets(): {\n temporal: Set<number>;\n numeric: Set<number>;\n string: Set<number>;\n} {\n if (!temporalTypeIds || !numericTypeIds || !stringTypeIds) {\n throw new Error(\n \"Arrow type IDs not initialized. Call initializeTypeIdSets() first.\",\n );\n }\n return {\n temporal: temporalTypeIds,\n numeric: numericTypeIds,\n string: stringTypeIds,\n };\n}\n\n/**\n * Returns the Decimal type ID.\n * Throws if called before initializeTypeIdSets().\n */\nexport function getDecimalTypeId(): number {\n if (decimalTypeId === null) {\n throw new Error(\n \"Arrow type IDs not initialized. Call initializeTypeIdSets() first.\",\n );\n }\n return decimalTypeId;\n}\n"],"mappings":";;;;;;;;;AAcA,IAAI,qBAAoE;;;;;;;;;;;AAYxE,eAAsB,iBAAyD;AAC7E,KAAI,CAAC,mBACH,sBAAqB,OAAO;AAE9B,QAAO;;AAQT,IAAI,kBAAsC;AAC1C,IAAI,iBAAqC;AACzC,IAAI,gBAAoC;AACxC,IAAI,gBAA+B;;;;;AAMnC,eAAsB,uBAAsC;AAC1D,KAAI,oBAAoB,KAAM;CAE9B,MAAM,EAAE,SAAS,MAAM,gBAAgB;AAEvC,mBAAkB,IAAI,IAAI;EACxB,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK;EACN,CAAC;AAEF,kBAAiB,IAAI,IAAI;EACvB,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK;EACN,CAAC;AAEF,iBAAgB,IAAI,IAAI,CAAC,KAAK,MAAM,KAAK,UAAU,CAAC;AAEpD,iBAAgB,KAAK;;;;;;;AAQvB,SAAgB,gBAId;AACA,KAAI,CAAC,mBAAmB,CAAC,kBAAkB,CAAC,cAC1C,OAAM,IAAI,MACR,qEACD;AAEH,QAAO;EACL,UAAU;EACV,SAAS;EACT,QAAQ;EACT;;;;;;AAOH,SAAgB,mBAA2B;AACzC,KAAI,kBAAkB,KACpB,OAAM,IAAI,MACR,qEACD;AAEH,QAAO"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../../../../src/react/charts/area/index.tsx"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../../../../src/react/charts/area/index.tsx"],"mappings":";;;;;;;AAaA;;;;;;cAAa,SAAA;EAAA,QAA4D,cAAA,GAAA,kBAAA,CAAA,GAAA,CAAA,OAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../../src/react/charts/area/index.tsx"],"sourcesContent":["import type { JSX } from \"react\";\nimport { createChart } from \"../create-chart\";\nimport type { AreaChartProps } from \"../types\";\n\n/**\n * Area Chart component for trend visualization with filled areas.\n *\n * **Important:** This component uses Apache ECharts architecture. Configure it via props, not by passing child components.\n *\n * **Best Practice:** Use the built-in data fetching by passing `queryKey` and `parameters` props instead of pre-fetching data with `useAnalyticsQuery`.\n *\n * Supports both query mode (queryKey + parameters) and data mode (static data).\n */\nexport const AreaChart = createChart<AreaChartProps>(\"area\", \"AreaChart\");\n\n// Type-only definition for documentation generation (not used at runtime)\n/**\n * Area Chart component for trend visualization with filled areas.\n *\n * **Important:** This component uses Apache ECharts architecture. Configure it via props, not by passing child components.\n *\n * **Best Practice:** Use the built-in data fetching by passing `queryKey` and `parameters` props instead of pre-fetching data with `useAnalyticsQuery`.\n *\n * Supports both query mode (queryKey + parameters) and data mode (static data).\n */\
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../../src/react/charts/area/index.tsx"],"sourcesContent":["import type { JSX } from \"react\";\nimport { createChart } from \"../create-chart\";\nimport type { AreaChartProps } from \"../types\";\n\n/**\n * Area Chart component for trend visualization with filled areas.\n *\n * **Important:** This component uses Apache ECharts architecture. Configure it via props, not by passing child components.\n *\n * **Best Practice:** Use the built-in data fetching by passing `queryKey` and `parameters` props instead of pre-fetching data with `useAnalyticsQuery`.\n *\n * Supports both query mode (queryKey + parameters) and data mode (static data).\n */\nexport const AreaChart = createChart<AreaChartProps>(\"area\", \"AreaChart\");\n\n// Type-only definition for documentation generation (not used at runtime)\n/**\n * Area Chart component for trend visualization with filled areas.\n *\n * **Important:** This component uses Apache ECharts architecture. Configure it via props, not by passing child components.\n *\n * **Best Practice:** Use the built-in data fetching by passing `queryKey` and `parameters` props instead of pre-fetching data with `useAnalyticsQuery`.\n *\n * Supports both query mode (queryKey + parameters) and data mode (static data).\n */\nfunction _AreaChartDoc(props: AreaChartProps): JSX.Element {\n return AreaChart(props);\n}\n"],"mappings":";;;;;;;;;;;;AAaA,MAAa,YAAY,YAA4B,QAAQ,YAAY"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../../../../src/react/charts/bar/index.tsx"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../../../../src/react/charts/bar/index.tsx"],"mappings":";;;;;;;AAaA;;;;;;cAAa,QAAA;EAAA,QAAwD,aAAA,GAAA,kBAAA,CAAA,GAAA,CAAA,OAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../../src/react/charts/bar/index.tsx"],"sourcesContent":["import type { JSX } from \"react\";\nimport { createChart } from \"../create-chart\";\nimport type { BarChartProps } from \"../types\";\n\n/**\n * Bar Chart component for categorical comparisons.\n *\n * **Important:** This component uses Apache ECharts architecture. Configure it via props, not by passing child components.\n *\n * **Best Practice:** Use the built-in data fetching by passing `queryKey` and `parameters` props instead of pre-fetching data with `useAnalyticsQuery`.\n *\n * Supports both query mode (queryKey + parameters) and data mode (static data).\n */\nexport const BarChart = createChart<BarChartProps>(\"bar\", \"BarChart\");\n\n// Type-only definition for documentation generation (not used at runtime)\n/**\n * Bar Chart component for categorical comparisons.\n *\n * **Important:** This component uses Apache ECharts architecture. Configure it via props, not by passing child components.\n *\n * **Best Practice:** Use the built-in data fetching by passing `queryKey` and `parameters` props instead of pre-fetching data with `useAnalyticsQuery`.\n *\n * Supports both query mode (queryKey + parameters) and data mode (static data).\n */\
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../../src/react/charts/bar/index.tsx"],"sourcesContent":["import type { JSX } from \"react\";\nimport { createChart } from \"../create-chart\";\nimport type { BarChartProps } from \"../types\";\n\n/**\n * Bar Chart component for categorical comparisons.\n *\n * **Important:** This component uses Apache ECharts architecture. Configure it via props, not by passing child components.\n *\n * **Best Practice:** Use the built-in data fetching by passing `queryKey` and `parameters` props instead of pre-fetching data with `useAnalyticsQuery`.\n *\n * Supports both query mode (queryKey + parameters) and data mode (static data).\n */\nexport const BarChart = createChart<BarChartProps>(\"bar\", \"BarChart\");\n\n// Type-only definition for documentation generation (not used at runtime)\n/**\n * Bar Chart component for categorical comparisons.\n *\n * **Important:** This component uses Apache ECharts architecture. Configure it via props, not by passing child components.\n *\n * **Best Practice:** Use the built-in data fetching by passing `queryKey` and `parameters` props instead of pre-fetching data with `useAnalyticsQuery`.\n *\n * Supports both query mode (queryKey + parameters) and data mode (static data).\n */\nfunction _BarChartDoc(props: BarChartProps): JSX.Element {\n return BarChart(props);\n}\n"],"mappings":";;;;;;;;;;;;AAaA,MAAa,WAAW,YAA2B,OAAO,WAAW"}
|
|
@@ -15,8 +15,6 @@ declare const FALLBACK_COLORS_CATEGORICAL: string[];
|
|
|
15
15
|
declare const FALLBACK_COLORS_SEQUENTIAL: string[];
|
|
16
16
|
/** Fallback diverging colors (blue → red) */
|
|
17
17
|
declare const FALLBACK_COLORS_DIVERGING: string[];
|
|
18
|
-
/** Legacy: Fallback colors (aliases to categorical) */
|
|
19
|
-
declare const FALLBACK_COLORS: string[];
|
|
20
18
|
//#endregion
|
|
21
|
-
export { CHART_COLOR_VARS, CHART_COLOR_VARS_CATEGORICAL, CHART_COLOR_VARS_DIVERGING, CHART_COLOR_VARS_SEQUENTIAL,
|
|
19
|
+
export { CHART_COLOR_VARS, CHART_COLOR_VARS_CATEGORICAL, CHART_COLOR_VARS_DIVERGING, CHART_COLOR_VARS_SEQUENTIAL, FALLBACK_COLORS_CATEGORICAL, FALLBACK_COLORS_DIVERGING, FALLBACK_COLORS_SEQUENTIAL };
|
|
22
20
|
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","names":[],"sources":["../../../src/react/charts/constants.ts"],"mappings":";;;;cAgBa,4BAAA;AAAb;AAAA,cAYa,2BAAA;;cAYA,0BAAA;;cAYA,gBAAA;;cAgBA,2BAAA;;cAYA,0BAAA;AAxCb;AAAA,cAoDa,yBAAA
|
|
1
|
+
{"version":3,"file":"constants.d.ts","names":[],"sources":["../../../src/react/charts/constants.ts"],"mappings":";;;;cAgBa,4BAAA;AAAb;AAAA,cAYa,2BAAA;;cAYA,0BAAA;;cAYA,gBAAA;;cAgBA,2BAAA;;cAYA,0BAAA;AAxCb;AAAA,cAoDa,yBAAA"}
|
|
@@ -78,9 +78,7 @@ const FALLBACK_COLORS_DIVERGING = [
|
|
|
78
78
|
"hsla(10, 72%, 50%, 1)",
|
|
79
79
|
"hsla(10, 80%, 40%, 1)"
|
|
80
80
|
];
|
|
81
|
-
/** Legacy: Fallback colors (aliases to categorical) */
|
|
82
|
-
const FALLBACK_COLORS = FALLBACK_COLORS_CATEGORICAL;
|
|
83
81
|
|
|
84
82
|
//#endregion
|
|
85
|
-
export { CHART_COLOR_VARS, CHART_COLOR_VARS_CATEGORICAL, CHART_COLOR_VARS_DIVERGING, CHART_COLOR_VARS_SEQUENTIAL,
|
|
83
|
+
export { CHART_COLOR_VARS, CHART_COLOR_VARS_CATEGORICAL, CHART_COLOR_VARS_DIVERGING, CHART_COLOR_VARS_SEQUENTIAL, FALLBACK_COLORS_CATEGORICAL, FALLBACK_COLORS_DIVERGING, FALLBACK_COLORS_SEQUENTIAL };
|
|
86
84
|
//# sourceMappingURL=constants.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","names":[],"sources":["../../../src/react/charts/constants.ts"],"sourcesContent":["// ============================================================================\n// Shared Constants for Chart Components\n// ============================================================================\n\n// Re-export field patterns from shared constants\nexport {\n DATE_FIELD_PATTERNS,\n METADATA_DATE_PATTERNS,\n NAME_FIELD_PATTERNS,\n} from \"@/js/constants\";\n\n// ============================================================================\n// Chart Color Palettes\n// ============================================================================\n\n/** CSS variable names for categorical chart colors (distinct categories) */\nexport const CHART_COLOR_VARS_CATEGORICAL = [\n \"--chart-cat-1\",\n \"--chart-cat-2\",\n \"--chart-cat-3\",\n \"--chart-cat-4\",\n \"--chart-cat-5\",\n \"--chart-cat-6\",\n \"--chart-cat-7\",\n \"--chart-cat-8\",\n] as const;\n\n/** CSS variable names for sequential chart colors (low → high) */\nexport const CHART_COLOR_VARS_SEQUENTIAL = [\n \"--chart-seq-1\",\n \"--chart-seq-2\",\n \"--chart-seq-3\",\n \"--chart-seq-4\",\n \"--chart-seq-5\",\n \"--chart-seq-6\",\n \"--chart-seq-7\",\n \"--chart-seq-8\",\n] as const;\n\n/** CSS variable names for diverging chart colors (negative ↔ positive) */\nexport const CHART_COLOR_VARS_DIVERGING = [\n \"--chart-div-1\",\n \"--chart-div-2\",\n \"--chart-div-3\",\n \"--chart-div-4\",\n \"--chart-div-5\",\n \"--chart-div-6\",\n \"--chart-div-7\",\n \"--chart-div-8\",\n] as const;\n\n/** Legacy: CSS variable names for chart colors (aliases to categorical) */\nexport const CHART_COLOR_VARS = [\n \"--chart-1\",\n \"--chart-2\",\n \"--chart-3\",\n \"--chart-4\",\n \"--chart-5\",\n \"--chart-6\",\n \"--chart-7\",\n \"--chart-8\",\n] as const;\n\n// ============================================================================\n// Fallback Colors (when CSS variables unavailable)\n// ============================================================================\n\n/** Fallback categorical colors */\nexport const FALLBACK_COLORS_CATEGORICAL = [\n \"hsla(221, 83%, 53%, 1)\", // Blue\n \"hsla(160, 60%, 45%, 1)\", // Teal\n \"hsla(291, 47%, 51%, 1)\", // Purple\n \"hsla(35, 92%, 55%, 1)\", // Amber\n \"hsla(349, 72%, 52%, 1)\", // Rose\n \"hsla(189, 75%, 42%, 1)\", // Cyan\n \"hsla(271, 55%, 60%, 1)\", // Lavender\n \"hsla(142, 55%, 45%, 1)\", // Emerald\n];\n\n/** Fallback sequential colors (light → dark blue) */\nexport const FALLBACK_COLORS_SEQUENTIAL = [\n \"hsla(221, 70%, 94%, 1)\",\n \"hsla(221, 72%, 85%, 1)\",\n \"hsla(221, 74%, 74%, 1)\",\n \"hsla(221, 76%, 63%, 1)\",\n \"hsla(221, 78%, 52%, 1)\",\n \"hsla(221, 80%, 42%, 1)\",\n \"hsla(221, 82%, 32%, 1)\",\n \"hsla(221, 84%, 24%, 1)\",\n];\n\n/** Fallback diverging colors (blue → red) */\nexport const FALLBACK_COLORS_DIVERGING = [\n \"hsla(221, 80%, 35%, 1)\", // Strong negative\n \"hsla(221, 70%, 50%, 1)\",\n \"hsla(221, 55%, 65%, 1)\",\n \"hsla(221, 35%, 82%, 1)\", // Weak negative\n \"hsla(10, 35%, 82%, 1)\", // Weak positive\n \"hsla(10, 60%, 65%, 1)\",\n \"hsla(10, 72%, 50%, 1)\",\n \"hsla(10, 80%, 40%, 1)\", // Strong positive\n];\n
|
|
1
|
+
{"version":3,"file":"constants.js","names":[],"sources":["../../../src/react/charts/constants.ts"],"sourcesContent":["// ============================================================================\n// Shared Constants for Chart Components\n// ============================================================================\n\n// Re-export field patterns from shared constants\nexport {\n DATE_FIELD_PATTERNS,\n METADATA_DATE_PATTERNS,\n NAME_FIELD_PATTERNS,\n} from \"@/js/constants\";\n\n// ============================================================================\n// Chart Color Palettes\n// ============================================================================\n\n/** CSS variable names for categorical chart colors (distinct categories) */\nexport const CHART_COLOR_VARS_CATEGORICAL = [\n \"--chart-cat-1\",\n \"--chart-cat-2\",\n \"--chart-cat-3\",\n \"--chart-cat-4\",\n \"--chart-cat-5\",\n \"--chart-cat-6\",\n \"--chart-cat-7\",\n \"--chart-cat-8\",\n] as const;\n\n/** CSS variable names for sequential chart colors (low → high) */\nexport const CHART_COLOR_VARS_SEQUENTIAL = [\n \"--chart-seq-1\",\n \"--chart-seq-2\",\n \"--chart-seq-3\",\n \"--chart-seq-4\",\n \"--chart-seq-5\",\n \"--chart-seq-6\",\n \"--chart-seq-7\",\n \"--chart-seq-8\",\n] as const;\n\n/** CSS variable names for diverging chart colors (negative ↔ positive) */\nexport const CHART_COLOR_VARS_DIVERGING = [\n \"--chart-div-1\",\n \"--chart-div-2\",\n \"--chart-div-3\",\n \"--chart-div-4\",\n \"--chart-div-5\",\n \"--chart-div-6\",\n \"--chart-div-7\",\n \"--chart-div-8\",\n] as const;\n\n/** Legacy: CSS variable names for chart colors (aliases to categorical) */\nexport const CHART_COLOR_VARS = [\n \"--chart-1\",\n \"--chart-2\",\n \"--chart-3\",\n \"--chart-4\",\n \"--chart-5\",\n \"--chart-6\",\n \"--chart-7\",\n \"--chart-8\",\n] as const;\n\n// ============================================================================\n// Fallback Colors (when CSS variables unavailable)\n// ============================================================================\n\n/** Fallback categorical colors */\nexport const FALLBACK_COLORS_CATEGORICAL = [\n \"hsla(221, 83%, 53%, 1)\", // Blue\n \"hsla(160, 60%, 45%, 1)\", // Teal\n \"hsla(291, 47%, 51%, 1)\", // Purple\n \"hsla(35, 92%, 55%, 1)\", // Amber\n \"hsla(349, 72%, 52%, 1)\", // Rose\n \"hsla(189, 75%, 42%, 1)\", // Cyan\n \"hsla(271, 55%, 60%, 1)\", // Lavender\n \"hsla(142, 55%, 45%, 1)\", // Emerald\n];\n\n/** Fallback sequential colors (light → dark blue) */\nexport const FALLBACK_COLORS_SEQUENTIAL = [\n \"hsla(221, 70%, 94%, 1)\",\n \"hsla(221, 72%, 85%, 1)\",\n \"hsla(221, 74%, 74%, 1)\",\n \"hsla(221, 76%, 63%, 1)\",\n \"hsla(221, 78%, 52%, 1)\",\n \"hsla(221, 80%, 42%, 1)\",\n \"hsla(221, 82%, 32%, 1)\",\n \"hsla(221, 84%, 24%, 1)\",\n];\n\n/** Fallback diverging colors (blue → red) */\nexport const FALLBACK_COLORS_DIVERGING = [\n \"hsla(221, 80%, 35%, 1)\", // Strong negative\n \"hsla(221, 70%, 50%, 1)\",\n \"hsla(221, 55%, 65%, 1)\",\n \"hsla(221, 35%, 82%, 1)\", // Weak negative\n \"hsla(10, 35%, 82%, 1)\", // Weak positive\n \"hsla(10, 60%, 65%, 1)\",\n \"hsla(10, 72%, 50%, 1)\",\n \"hsla(10, 80%, 40%, 1)\", // Strong positive\n];\n"],"mappings":";;;;AAgBA,MAAa,+BAA+B;CAC1C;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACD;;AAGD,MAAa,8BAA8B;CACzC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACD;;AAGD,MAAa,6BAA6B;CACxC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACD;;AAGD,MAAa,mBAAmB;CAC9B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACD;;AAOD,MAAa,8BAA8B;CACzC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACD;;AAGD,MAAa,6BAA6B;CACxC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACD;;AAGD,MAAa,4BAA4B;CACvC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../../../../src/react/charts/heatmap/index.tsx"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../../../../src/react/charts/heatmap/index.tsx"],"mappings":";;;;;;;AAkBA;;;;;;;;;;;cAAa,YAAA;EAAA,QAGZ,iBAAA,GAAA,kBAAA,CAAA,GAAA,CAAA,OAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../../src/react/charts/heatmap/index.tsx"],"sourcesContent":["import type { JSX } from \"react\";\nimport { createChart } from \"../create-chart\";\nimport type { HeatmapChartProps } from \"../types\";\n\n/**\n * Heatmap Chart component for matrix-style data visualization.\n *\n * **Important:** This component uses Apache ECharts architecture. Configure it via props, not by passing child components.\n *\n * **Best Practice:** Use the built-in data fetching by passing `queryKey` and `parameters` props instead of pre-fetching data with `useAnalyticsQuery`.\n *\n * Data should be in \"long format\" with three fields:\n * - xKey: X-axis category (columns)\n * - yAxisKey: Y-axis category (rows)\n * - yKey: The numeric value for each cell\n *\n * Supports both query mode (queryKey + parameters) and data mode (static data).\n */\nexport const HeatmapChart = createChart<HeatmapChartProps>(\n \"heatmap\",\n \"HeatmapChart\",\n);\n\n// Type-only definition for documentation generation (not used at runtime)\n/**\n * Heatmap Chart component for matrix-style data visualization.\n *\n * **Important:** This component uses Apache ECharts architecture. Configure it via props, not by passing child components.\n *\n * **Best Practice:** Use the built-in data fetching by passing `queryKey` and `parameters` props instead of pre-fetching data with `useAnalyticsQuery`.\n *\n * Data should be in \"long format\" with three fields:\n * - xKey: X-axis category (columns)\n * - yAxisKey: Y-axis category (rows)\n * - yKey: The numeric value for each cell\n *\n * Supports both query mode (queryKey + parameters) and data mode (static data).\n */\
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../../src/react/charts/heatmap/index.tsx"],"sourcesContent":["import type { JSX } from \"react\";\nimport { createChart } from \"../create-chart\";\nimport type { HeatmapChartProps } from \"../types\";\n\n/**\n * Heatmap Chart component for matrix-style data visualization.\n *\n * **Important:** This component uses Apache ECharts architecture. Configure it via props, not by passing child components.\n *\n * **Best Practice:** Use the built-in data fetching by passing `queryKey` and `parameters` props instead of pre-fetching data with `useAnalyticsQuery`.\n *\n * Data should be in \"long format\" with three fields:\n * - xKey: X-axis category (columns)\n * - yAxisKey: Y-axis category (rows)\n * - yKey: The numeric value for each cell\n *\n * Supports both query mode (queryKey + parameters) and data mode (static data).\n */\nexport const HeatmapChart = createChart<HeatmapChartProps>(\n \"heatmap\",\n \"HeatmapChart\",\n);\n\n// Type-only definition for documentation generation (not used at runtime)\n/**\n * Heatmap Chart component for matrix-style data visualization.\n *\n * **Important:** This component uses Apache ECharts architecture. Configure it via props, not by passing child components.\n *\n * **Best Practice:** Use the built-in data fetching by passing `queryKey` and `parameters` props instead of pre-fetching data with `useAnalyticsQuery`.\n *\n * Data should be in \"long format\" with three fields:\n * - xKey: X-axis category (columns)\n * - yAxisKey: Y-axis category (rows)\n * - yKey: The numeric value for each cell\n *\n * Supports both query mode (queryKey + parameters) and data mode (static data).\n */\nfunction _HeatmapChartDoc(props: HeatmapChartProps): JSX.Element {\n return HeatmapChart(props);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAkBA,MAAa,eAAe,YAC1B,WACA,eACD"}
|
|
@@ -12,7 +12,7 @@ import { BaseChart, BaseChartProps } from "./base.js";
|
|
|
12
12
|
import { createChart } from "./create-chart.js";
|
|
13
13
|
import { ChartWrapper, ChartWrapperProps } from "./wrapper.js";
|
|
14
14
|
import { NormalizedHeatmapData, normalizeChartData, normalizeHeatmapData } from "./normalize.js";
|
|
15
|
-
import { CHART_COLOR_VARS, CHART_COLOR_VARS_CATEGORICAL, CHART_COLOR_VARS_DIVERGING, CHART_COLOR_VARS_SEQUENTIAL,
|
|
15
|
+
import { CHART_COLOR_VARS, CHART_COLOR_VARS_CATEGORICAL, CHART_COLOR_VARS_DIVERGING, CHART_COLOR_VARS_SEQUENTIAL, FALLBACK_COLORS_CATEGORICAL, FALLBACK_COLORS_DIVERGING, FALLBACK_COLORS_SEQUENTIAL } from "./constants.js";
|
|
16
16
|
import { useAllThemeColors, useThemeColors } from "./theme.js";
|
|
17
17
|
import { createTimeSeriesData, formatLabel, sortTimeSeriesAscending, toChartArray, toChartValue, truncateLabel } from "./utils.js";
|
|
18
18
|
import { CartesianContext, HeatmapContext, OptionBuilderContext, buildCartesianOption, buildHeatmapOption, buildHorizontalBarOption, buildPieOption, buildRadarOption } from "./options.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DATE_FIELD_PATTERNS, METADATA_DATE_PATTERNS, NAME_FIELD_PATTERNS } from "../../js/constants.js";
|
|
2
|
-
import { CHART_COLOR_VARS, CHART_COLOR_VARS_CATEGORICAL, CHART_COLOR_VARS_DIVERGING, CHART_COLOR_VARS_SEQUENTIAL,
|
|
2
|
+
import { CHART_COLOR_VARS, CHART_COLOR_VARS_CATEGORICAL, CHART_COLOR_VARS_DIVERGING, CHART_COLOR_VARS_SEQUENTIAL, FALLBACK_COLORS_CATEGORICAL, FALLBACK_COLORS_DIVERGING, FALLBACK_COLORS_SEQUENTIAL } from "./constants.js";
|
|
3
3
|
import { isArrowTable, isDataProps, isQueryProps } from "./types.js";
|
|
4
4
|
import { createTimeSeriesData, formatLabel, sortTimeSeriesAscending, toChartArray, toChartValue, truncateLabel } from "./utils.js";
|
|
5
5
|
import { normalizeChartData, normalizeHeatmapData } from "./normalize.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../../../../src/react/charts/line/index.tsx"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../../../../src/react/charts/line/index.tsx"],"mappings":";;;;;;;AAaA;;;;;;cAAa,SAAA;EAAA,QAA4D,cAAA,GAAA,kBAAA,CAAA,GAAA,CAAA,OAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../../src/react/charts/line/index.tsx"],"sourcesContent":["import type { JSX } from \"react\";\nimport { createChart } from \"../create-chart\";\nimport type { LineChartProps } from \"../types\";\n\n/**\n * Line Chart component for time-series and trend visualization.\n *\n * **Important:** This component uses Apache ECharts architecture. Configure it via props, not by passing child components.\n *\n * **Best Practice:** Use the built-in data fetching by passing `queryKey` and `parameters` props instead of pre-fetching data with `useAnalyticsQuery`.\n *\n * Supports both query mode (queryKey + parameters) and data mode (static data).\n */\nexport const LineChart = createChart<LineChartProps>(\"line\", \"LineChart\");\n\n// Type-only definition for documentation generation (not used at runtime)\n/**\n * Line Chart component for time-series and trend visualization.\n *\n * **Important:** This component uses Apache ECharts architecture. Configure it via props, not by passing child components.\n *\n * **Best Practice:** Use the built-in data fetching by passing `queryKey` and `parameters` props instead of pre-fetching data with `useAnalyticsQuery`.\n *\n * Supports both query mode (queryKey + parameters) and data mode (static data).\n */\
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../../src/react/charts/line/index.tsx"],"sourcesContent":["import type { JSX } from \"react\";\nimport { createChart } from \"../create-chart\";\nimport type { LineChartProps } from \"../types\";\n\n/**\n * Line Chart component for time-series and trend visualization.\n *\n * **Important:** This component uses Apache ECharts architecture. Configure it via props, not by passing child components.\n *\n * **Best Practice:** Use the built-in data fetching by passing `queryKey` and `parameters` props instead of pre-fetching data with `useAnalyticsQuery`.\n *\n * Supports both query mode (queryKey + parameters) and data mode (static data).\n */\nexport const LineChart = createChart<LineChartProps>(\"line\", \"LineChart\");\n\n// Type-only definition for documentation generation (not used at runtime)\n/**\n * Line Chart component for time-series and trend visualization.\n *\n * **Important:** This component uses Apache ECharts architecture. Configure it via props, not by passing child components.\n *\n * **Best Practice:** Use the built-in data fetching by passing `queryKey` and `parameters` props instead of pre-fetching data with `useAnalyticsQuery`.\n *\n * Supports both query mode (queryKey + parameters) and data mode (static data).\n */\nfunction _LineChartDoc(props: LineChartProps): JSX.Element {\n return LineChart(props);\n}\n"],"mappings":";;;;;;;;;;;;AAaA,MAAa,YAAY,YAA4B,QAAQ,YAAY"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../../../../src/react/charts/pie/index.tsx"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../../../../src/react/charts/pie/index.tsx"],"mappings":";;;;;;;AAaA;;;;;;cAAa,QAAA;EAAA,QAAwD,aAAA,GAAA,kBAAA,CAAA,GAAA,CAAA,OAAA;;;;AAWrE;;;;;;;;cAAa,UAAA;EAAA,QAAgE,eAAA,GAAA,kBAAA,CAAA,GAAA,CAAA,OAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../../src/react/charts/pie/index.tsx"],"sourcesContent":["import type { JSX } from \"react\";\nimport { createChart } from \"../create-chart\";\nimport type { DonutChartProps, PieChartProps } from \"../types\";\n\n/**\n * Pie Chart component for proportional data visualization.\n *\n * **Important:** This component uses Apache ECharts architecture. Configure it via props, not by passing child components.\n *\n * **Best Practice:** Use the built-in data fetching by passing `queryKey` and `parameters` props instead of pre-fetching data with `useAnalyticsQuery`.\n *\n * Supports both query mode (queryKey + parameters) and data mode (static data).\n */\nexport const PieChart = createChart<PieChartProps>(\"pie\", \"PieChart\");\n\n/**\n * Donut Chart component (Pie chart with inner radius).\n *\n * **Important:** This component uses Apache ECharts architecture. Configure it via props, not by passing child components.\n *\n * **Best Practice:** Use the built-in data fetching by passing `queryKey` and `parameters` props instead of pre-fetching data with `useAnalyticsQuery`.\n *\n * Supports both query mode (queryKey + parameters) and data mode (static data).\n */\nexport const DonutChart = createChart<DonutChartProps>(\"donut\", \"DonutChart\");\n\n// Type-only definitions for documentation generation (not used at runtime)\n/**\n * Pie Chart component for proportional data visualization.\n *\n * **Important:** This component uses Apache ECharts architecture. Configure it via props, not by passing child components.\n *\n * **Best Practice:** Use the built-in data fetching by passing `queryKey` and `parameters` props instead of pre-fetching data with `useAnalyticsQuery`.\n *\n * Supports both query mode (queryKey + parameters) and data mode (static data).\n */\
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../../src/react/charts/pie/index.tsx"],"sourcesContent":["import type { JSX } from \"react\";\nimport { createChart } from \"../create-chart\";\nimport type { DonutChartProps, PieChartProps } from \"../types\";\n\n/**\n * Pie Chart component for proportional data visualization.\n *\n * **Important:** This component uses Apache ECharts architecture. Configure it via props, not by passing child components.\n *\n * **Best Practice:** Use the built-in data fetching by passing `queryKey` and `parameters` props instead of pre-fetching data with `useAnalyticsQuery`.\n *\n * Supports both query mode (queryKey + parameters) and data mode (static data).\n */\nexport const PieChart = createChart<PieChartProps>(\"pie\", \"PieChart\");\n\n/**\n * Donut Chart component (Pie chart with inner radius).\n *\n * **Important:** This component uses Apache ECharts architecture. Configure it via props, not by passing child components.\n *\n * **Best Practice:** Use the built-in data fetching by passing `queryKey` and `parameters` props instead of pre-fetching data with `useAnalyticsQuery`.\n *\n * Supports both query mode (queryKey + parameters) and data mode (static data).\n */\nexport const DonutChart = createChart<DonutChartProps>(\"donut\", \"DonutChart\");\n\n// Type-only definitions for documentation generation (not used at runtime)\n/**\n * Pie Chart component for proportional data visualization.\n *\n * **Important:** This component uses Apache ECharts architecture. Configure it via props, not by passing child components.\n *\n * **Best Practice:** Use the built-in data fetching by passing `queryKey` and `parameters` props instead of pre-fetching data with `useAnalyticsQuery`.\n *\n * Supports both query mode (queryKey + parameters) and data mode (static data).\n */\nfunction _PieChartDoc(props: PieChartProps): JSX.Element {\n return PieChart(props);\n}\n\n/**\n * Donut Chart component (Pie chart with inner radius).\n *\n * **Important:** This component uses Apache ECharts architecture. Configure it via props, not by passing child components.\n *\n * **Best Practice:** Use the built-in data fetching by passing `queryKey` and `parameters` props instead of pre-fetching data with `useAnalyticsQuery`.\n *\n * Supports both query mode (queryKey + parameters) and data mode (static data).\n */\nfunction _DonutChartDoc(props: DonutChartProps): JSX.Element {\n return DonutChart(props);\n}\n"],"mappings":";;;;;;;;;;;;AAaA,MAAa,WAAW,YAA2B,OAAO,WAAW;;;;;;;;;;AAWrE,MAAa,aAAa,YAA6B,SAAS,aAAa"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../../../../src/react/charts/radar/index.tsx"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../../../../src/react/charts/radar/index.tsx"],"mappings":";;;;;;;AAaA;;;;;;cAAa,UAAA;EAAA,QAAgE,eAAA,GAAA,kBAAA,CAAA,GAAA,CAAA,OAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../../src/react/charts/radar/index.tsx"],"sourcesContent":["import type { JSX } from \"react\";\nimport { createChart } from \"../create-chart\";\nimport type { RadarChartProps } from \"../types\";\n\n/**\n * Radar Chart component for multi-dimensional data comparison.\n *\n * **Important:** This component uses Apache ECharts architecture. Configure it via props, not by passing child components.\n *\n * **Best Practice:** Use the built-in data fetching by passing `queryKey` and `parameters` props instead of pre-fetching data with `useAnalyticsQuery`.\n *\n * Supports both query mode (queryKey + parameters) and data mode (static data).\n */\nexport const RadarChart = createChart<RadarChartProps>(\"radar\", \"RadarChart\");\n\n// Type-only definition for documentation generation (not used at runtime)\n/**\n * Radar Chart component for multi-dimensional data comparison.\n *\n * **Important:** This component uses Apache ECharts architecture. Configure it via props, not by passing child components.\n *\n * **Best Practice:** Use the built-in data fetching by passing `queryKey` and `parameters` props instead of pre-fetching data with `useAnalyticsQuery`.\n *\n * Supports both query mode (queryKey + parameters) and data mode (static data).\n */\
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../../src/react/charts/radar/index.tsx"],"sourcesContent":["import type { JSX } from \"react\";\nimport { createChart } from \"../create-chart\";\nimport type { RadarChartProps } from \"../types\";\n\n/**\n * Radar Chart component for multi-dimensional data comparison.\n *\n * **Important:** This component uses Apache ECharts architecture. Configure it via props, not by passing child components.\n *\n * **Best Practice:** Use the built-in data fetching by passing `queryKey` and `parameters` props instead of pre-fetching data with `useAnalyticsQuery`.\n *\n * Supports both query mode (queryKey + parameters) and data mode (static data).\n */\nexport const RadarChart = createChart<RadarChartProps>(\"radar\", \"RadarChart\");\n\n// Type-only definition for documentation generation (not used at runtime)\n/**\n * Radar Chart component for multi-dimensional data comparison.\n *\n * **Important:** This component uses Apache ECharts architecture. Configure it via props, not by passing child components.\n *\n * **Best Practice:** Use the built-in data fetching by passing `queryKey` and `parameters` props instead of pre-fetching data with `useAnalyticsQuery`.\n *\n * Supports both query mode (queryKey + parameters) and data mode (static data).\n */\nfunction _RadarChartDoc(props: RadarChartProps): JSX.Element {\n return RadarChart(props);\n}\n"],"mappings":";;;;;;;;;;;;AAaA,MAAa,aAAa,YAA6B,SAAS,aAAa"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../../../../src/react/charts/scatter/index.tsx"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../../../../src/react/charts/scatter/index.tsx"],"mappings":";;;;;;;AAaA;;;;;;cAAa,YAAA;EAAA,QAGZ,iBAAA,GAAA,kBAAA,CAAA,GAAA,CAAA,OAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../../src/react/charts/scatter/index.tsx"],"sourcesContent":["import type { JSX } from \"react\";\nimport { createChart } from \"../create-chart\";\nimport type { ScatterChartProps } from \"../types\";\n\n/**\n * Scatter Chart component for correlation and distribution visualization.\n *\n * **Important:** This component uses Apache ECharts architecture. Configure it via props, not by passing child components.\n *\n * **Best Practice:** Use the built-in data fetching by passing `queryKey` and `parameters` props instead of pre-fetching data with `useAnalyticsQuery`.\n *\n * Supports both query mode (queryKey + parameters) and data mode (static data).\n */\nexport const ScatterChart = createChart<ScatterChartProps>(\n \"scatter\",\n \"ScatterChart\",\n);\n\n// Type-only definition for documentation generation (not used at runtime)\n/**\n * Scatter Chart component for correlation and distribution visualization.\n *\n * **Important:** This component uses Apache ECharts architecture. Configure it via props, not by passing child components.\n *\n * **Best Practice:** Use the built-in data fetching by passing `queryKey` and `parameters` props instead of pre-fetching data with `useAnalyticsQuery`.\n *\n * Supports both query mode (queryKey + parameters) and data mode (static data).\n */\
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../../src/react/charts/scatter/index.tsx"],"sourcesContent":["import type { JSX } from \"react\";\nimport { createChart } from \"../create-chart\";\nimport type { ScatterChartProps } from \"../types\";\n\n/**\n * Scatter Chart component for correlation and distribution visualization.\n *\n * **Important:** This component uses Apache ECharts architecture. Configure it via props, not by passing child components.\n *\n * **Best Practice:** Use the built-in data fetching by passing `queryKey` and `parameters` props instead of pre-fetching data with `useAnalyticsQuery`.\n *\n * Supports both query mode (queryKey + parameters) and data mode (static data).\n */\nexport const ScatterChart = createChart<ScatterChartProps>(\n \"scatter\",\n \"ScatterChart\",\n);\n\n// Type-only definition for documentation generation (not used at runtime)\n/**\n * Scatter Chart component for correlation and distribution visualization.\n *\n * **Important:** This component uses Apache ECharts architecture. Configure it via props, not by passing child components.\n *\n * **Best Practice:** Use the built-in data fetching by passing `queryKey` and `parameters` props instead of pre-fetching data with `useAnalyticsQuery`.\n *\n * Supports both query mode (queryKey + parameters) and data mode (static data).\n */\nfunction _ScatterChartDoc(props: ScatterChartProps): JSX.Element {\n return ScatterChart(props);\n}\n"],"mappings":";;;;;;;;;;;;AAaA,MAAa,eAAe,YAC1B,WACA,eACD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"genie-chat-input.d.ts","names":[],"sources":["../../../src/react/genie/genie-chat-input.tsx"],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"genie-chat-input.d.ts","names":[],"sources":["../../../src/react/genie/genie-chat-input.tsx"],"mappings":";;;UAIU,mBAAA;;EAER,MAAA,GAAS,OAAA;EAFD;EAIR,QAAA;;EAEA,WAAA;EAJA;EAMA,SAAA;AAAA;;iBAIc,cAAA,CAAA;EACd,MAAA;EACA,QAAA;EACA,WAAA;EACA;AAAA,GACC,mBAAA,GAAmB,kBAAA,CAAA,GAAA,CAAA,OAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"genie-chat-input.js","names":[],"sources":["../../../src/react/genie/genie-chat-input.tsx"],"sourcesContent":["import { type KeyboardEvent, useRef, useState } from \"react\";\nimport { cn } from \"../lib/utils\";\nimport { Button } from \"../ui/button\";\n\
|
|
1
|
+
{"version":3,"file":"genie-chat-input.js","names":[],"sources":["../../../src/react/genie/genie-chat-input.tsx"],"sourcesContent":["import { type KeyboardEvent, useRef, useState } from \"react\";\nimport { cn } from \"../lib/utils\";\nimport { Button } from \"../ui/button\";\n\ninterface GenieChatInputProps {\n /** Callback fired when the user submits a message */\n onSend: (content: string) => void;\n /** Disable the input and send button */\n disabled?: boolean;\n /** Placeholder text shown in the textarea */\n placeholder?: string;\n /** Additional CSS class for the container */\n className?: string;\n}\n\n/** Auto-expanding textarea input with a send button for chat messages. Submits on Enter (Shift+Enter for newline). */\nexport function GenieChatInput({\n onSend,\n disabled = false,\n placeholder = \"Ask a question...\",\n className,\n}: GenieChatInputProps) {\n const [value, setValue] = useState(\"\");\n const textareaRef = useRef<HTMLTextAreaElement>(null);\n\n const handleSubmit = () => {\n const trimmed = value.trim();\n if (!trimmed || disabled) return;\n onSend(trimmed);\n setValue(\"\");\n if (textareaRef.current) {\n textareaRef.current.style.height = \"auto\";\n }\n };\n\n const handleKeyDown = (e: KeyboardEvent<HTMLTextAreaElement>) => {\n if (e.key === \"Enter\" && !e.shiftKey) {\n e.preventDefault();\n handleSubmit();\n }\n };\n\n const MAX_HEIGHT = 200;\n\n const handleInput = () => {\n const textarea = textareaRef.current;\n if (textarea) {\n textarea.style.height = \"auto\";\n const clamped = Math.min(textarea.scrollHeight, MAX_HEIGHT);\n textarea.style.height = `${clamped}px`;\n textarea.style.overflowY =\n textarea.scrollHeight > MAX_HEIGHT ? \"auto\" : \"hidden\";\n }\n };\n\n return (\n <div className={cn(\"flex gap-2 p-4 border-t shrink-0\", className)}>\n <textarea\n ref={textareaRef}\n value={value}\n onChange={(e) => setValue(e.target.value)}\n onKeyDown={handleKeyDown}\n onInput={handleInput}\n placeholder={placeholder}\n disabled={disabled}\n rows={1}\n className={cn(\n \"flex-1 resize-none overflow-hidden rounded-md border border-input bg-background px-3 py-2\",\n \"text-sm placeholder:text-muted-foreground\",\n \"focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring\",\n \"disabled:cursor-not-allowed disabled:opacity-50\",\n )}\n />\n <Button\n onClick={handleSubmit}\n disabled={disabled || !value.trim()}\n size=\"default\"\n className=\"self-end\"\n >\n Send\n </Button>\n </div>\n );\n}\n"],"mappings":";;;;;;;AAgBA,SAAgB,eAAe,EAC7B,QACA,WAAW,OACX,cAAc,qBACd,aACsB;CACtB,MAAM,CAAC,OAAO,YAAY,SAAS,GAAG;CACtC,MAAM,cAAc,OAA4B,KAAK;CAErD,MAAM,qBAAqB;EACzB,MAAM,UAAU,MAAM,MAAM;AAC5B,MAAI,CAAC,WAAW,SAAU;AAC1B,SAAO,QAAQ;AACf,WAAS,GAAG;AACZ,MAAI,YAAY,QACd,aAAY,QAAQ,MAAM,SAAS;;CAIvC,MAAM,iBAAiB,MAA0C;AAC/D,MAAI,EAAE,QAAQ,WAAW,CAAC,EAAE,UAAU;AACpC,KAAE,gBAAgB;AAClB,iBAAc;;;CAIlB,MAAM,aAAa;CAEnB,MAAM,oBAAoB;EACxB,MAAM,WAAW,YAAY;AAC7B,MAAI,UAAU;AACZ,YAAS,MAAM,SAAS;GACxB,MAAM,UAAU,KAAK,IAAI,SAAS,cAAc,WAAW;AAC3D,YAAS,MAAM,SAAS,GAAG,QAAQ;AACnC,YAAS,MAAM,YACb,SAAS,eAAe,aAAa,SAAS;;;AAIpD,QACE,qBAAC;EAAI,WAAW,GAAG,oCAAoC,UAAU;aAC/D,oBAAC;GACC,KAAK;GACE;GACP,WAAW,MAAM,SAAS,EAAE,OAAO,MAAM;GACzC,WAAW;GACX,SAAS;GACI;GACH;GACV,MAAM;GACN,WAAW,GACT,6FACA,6CACA,2EACA,kDACD;IACD,EACF,oBAAC;GACC,SAAS;GACT,UAAU,YAAY,CAAC,MAAM,MAAM;GACnC,MAAK;GACL,WAAU;aACX;IAEQ;GACL"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"genie-chat-message-list.d.ts","names":[],"sources":["../../../src/react/genie/genie-chat-message-list.tsx"],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"genie-chat-message-list.d.ts","names":[],"sources":["../../../src/react/genie/genie-chat-message-list.tsx"],"mappings":";;;;UAQU,yBAAA;;EAER,QAAA,EAAU,gBAAA;EAFF;EAIR,MAAA,EAAQ,eAAA;;EAER,SAAA;EAJA;EAMA,eAAA;EAJA;EAMA,mBAAA;AAAA;;iBAkIc,oBAAA,CAAA;EACd,QAAA;EACA,MAAA;EACA,SAAA;EACA,eAAA;EACA;AAAA,GACC,yBAAA,GAAyB,kBAAA,CAAA,GAAA,CAAA,OAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"genie-chat-message-list.js","names":[],"sources":["../../../src/react/genie/genie-chat-message-list.tsx"],"sourcesContent":["import { useEffect, useLayoutEffect, useRef } from \"react\";\nimport { cn } from \"../lib/utils\";\nimport { ScrollArea } from \"../ui/scroll-area\";\nimport { Skeleton } from \"../ui/skeleton\";\nimport { Spinner } from \"../ui/spinner\";\nimport { GenieChatMessage } from \"./genie-chat-message\";\nimport type { GenieChatStatus, GenieMessageItem } from \"./types\";\n\nexport interface GenieChatMessageListProps {\n /** Array of messages to display */\n messages: GenieMessageItem[];\n /** Current chat status (controls loading indicators and skeleton placeholders) */\n status: GenieChatStatus;\n /** Additional CSS class for the scroll area */\n className?: string;\n /** Whether a previous page of older messages exists */\n hasPreviousPage?: boolean;\n /** Callback to fetch the previous page of messages */\n onFetchPreviousPage?: () => void;\n}\n\nconst STATUS_LABELS: Record<string, string> = {\n ASKING_AI: \"Asking AI...\",\n EXECUTING_QUERY: \"Executing query...\",\n FILTERING_RESULTS: \"Filtering results...\",\n COMPLETED: \"Done\",\n};\n\nfunction formatStatus(status: string): string {\n return STATUS_LABELS[status] ?? status.replace(/_/g, \" \").toLowerCase();\n}\n\nfunction getViewport(scrollRef: React.RefObject<HTMLDivElement | null>) {\n return scrollRef.current?.querySelector<HTMLElement>(\n '[data-slot=\"scroll-area-viewport\"]',\n );\n}\n\n/**\n * Manages scroll position: scrolls to bottom on append/initial load,\n * preserves position when older messages are prepended.\n */\nfunction useScrollManagement(\n scrollRef: React.RefObject<HTMLDivElement | null>,\n messages: GenieMessageItem[],\n status: GenieChatStatus,\n) {\n const prevFirstMessageIdRef = useRef<string | null>(null);\n const prevScrollHeightRef = useRef(0);\n const prevMessageCountRef = useRef(0);\n\n // Keep prevScrollHeightRef fresh when async content (images, embeds)\n // changes the viewport height between renders.\n useEffect(() => {\n const viewport = getViewport(scrollRef);\n if (!viewport) return;\n\n const observer = new ResizeObserver(() => {\n prevScrollHeightRef.current = viewport.scrollHeight;\n });\n observer.observe(viewport);\n return () => observer.disconnect();\n }, [scrollRef]);\n\n // biome-ignore lint/correctness/useExhaustiveDependencies: react to message count AND status so prevScrollHeightRef stays accurate when the loading indicator appears/disappears\n useLayoutEffect(() => {\n const viewport = getViewport(scrollRef);\n if (!viewport) return;\n\n const count = messages.length;\n const countChanged = count !== prevMessageCountRef.current;\n prevMessageCountRef.current = count;\n\n // Nothing to do if message count didn't change (e.g. status-only transition)\n if (!countChanged) {\n prevScrollHeightRef.current = viewport.scrollHeight;\n return;\n }\n\n const firstMessageId = messages[0]?.id ?? null;\n const wasPrepend =\n prevFirstMessageIdRef.current !== null &&\n firstMessageId !== prevFirstMessageIdRef.current;\n\n if (wasPrepend && prevScrollHeightRef.current > 0) {\n // Older messages prepended — preserve scroll position\n const delta = viewport.scrollHeight - prevScrollHeightRef.current;\n viewport.scrollTop += delta;\n } else {\n // Messages appended or initial load — scroll to bottom\n viewport.scrollTop = viewport.scrollHeight;\n }\n\n prevFirstMessageIdRef.current = firstMessageId;\n prevScrollHeightRef.current = viewport.scrollHeight;\n }, [messages.length, status]);\n}\n\n/**\n * Observes a sentinel element at the top of the scroll area and triggers\n * `onFetchPreviousPage` when the user scrolls to the top (only if content overflows).\n * Returns a ref to attach to the sentinel element.\n */\nfunction useLoadOlderOnScroll(\n scrollRef: React.RefObject<HTMLDivElement | null>,\n shouldObserve: boolean,\n onFetchPreviousPage?: () => void,\n) {\n const sentinelRef = useRef<HTMLDivElement>(null);\n const onFetchPreviousPageRef = useRef(onFetchPreviousPage);\n onFetchPreviousPageRef.current = onFetchPreviousPage;\n\n useEffect(() => {\n const sentinel = sentinelRef.current;\n const viewport = getViewport(scrollRef);\n if (!sentinel || !viewport || !shouldObserve) return;\n\n // The observer fires synchronously on observe() if the sentinel is\n // already visible. We arm it on the next frame so that synchronous\n // initial fire is ignored, but a real intersection (user genuinely\n // at the top on a short conversation) triggers on subsequent frames.\n let armed = false;\n const frameId = requestAnimationFrame(() => {\n armed = true;\n });\n\n const observer = new IntersectionObserver(\n (entries) => {\n if (!armed) return;\n const isScrollable = viewport.scrollHeight > viewport.clientHeight;\n if (entries[0]?.isIntersecting && isScrollable) {\n onFetchPreviousPageRef.current?.();\n }\n },\n { root: viewport, threshold: 0 },\n );\n\n observer.observe(sentinel);\n return () => {\n cancelAnimationFrame(frameId);\n observer.disconnect();\n };\n }, [scrollRef, shouldObserve]);\n\n return sentinelRef;\n}\n\n/** Scrollable message list that renders Genie chat messages with auto-scroll, skeleton loaders, and a streaming indicator. */\nexport function GenieChatMessageList({\n messages,\n status,\n className,\n hasPreviousPage = false,\n onFetchPreviousPage,\n}: GenieChatMessageListProps) {\n const scrollRef = useRef<HTMLDivElement>(null);\n\n const sentinelRef = useLoadOlderOnScroll(\n scrollRef,\n hasPreviousPage && status !== \"loading-older\",\n onFetchPreviousPage,\n );\n useScrollManagement(scrollRef, messages, status);\n\n const lastMessage = messages[messages.length - 1];\n const showStreamingIndicator =\n status === \"streaming\" &&\n lastMessage?.role === \"assistant\" &&\n lastMessage.id === \"\";\n\n return (\n <ScrollArea ref={scrollRef} className={cn(\"flex-1 min-h-0 p-4\", className)}>\n <div className=\"flex flex-col gap-4\">\n {hasPreviousPage && <div ref={sentinelRef} className=\"h-px\" />}\n\n {status === \"loading-older\" && (\n <div className=\"flex items-center justify-center gap-2 py-2\">\n <Spinner className=\"h-3 w-3\" />\n <span className=\"text-sm text-muted-foreground\">\n Loading older messages...\n </span>\n </div>\n )}\n\n {status === \"loading-history\" && messages.length === 0 && (\n <div className=\"flex flex-col gap-4\">\n <Skeleton className=\"h-12 w-3/4\" />\n <Skeleton className=\"h-20 w-4/5 self-start\" />\n <Skeleton className=\"h-12 w-2/3 self-end\" />\n </div>\n )}\n\n {messages\n .filter(\n (msg) => msg.role !== \"assistant\" || msg.id !== \"\" || msg.content,\n )\n .map((msg) => (\n <GenieChatMessage key={msg.id} message={msg} />\n ))}\n\n {showStreamingIndicator && (\n <div className=\"flex items-center gap-2 text-sm text-muted-foreground px-11\">\n <Spinner className=\"h-3 w-3\" />\n <span>{formatStatus(lastMessage.status)}</span>\n </div>\n )}\n\n {messages.length === 0 && status === \"idle\" && (\n <div className=\"flex items-center justify-center h-full text-muted-foreground text-sm py-12\">\n Start a conversation by typing a question below.\n </div>\n )}\n </div>\n </ScrollArea>\n );\n}\n"],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"genie-chat-message-list.js","names":[],"sources":["../../../src/react/genie/genie-chat-message-list.tsx"],"sourcesContent":["import { useEffect, useLayoutEffect, useRef } from \"react\";\nimport { cn } from \"../lib/utils\";\nimport { ScrollArea } from \"../ui/scroll-area\";\nimport { Skeleton } from \"../ui/skeleton\";\nimport { Spinner } from \"../ui/spinner\";\nimport { GenieChatMessage } from \"./genie-chat-message\";\nimport type { GenieChatStatus, GenieMessageItem } from \"./types\";\n\ninterface GenieChatMessageListProps {\n /** Array of messages to display */\n messages: GenieMessageItem[];\n /** Current chat status (controls loading indicators and skeleton placeholders) */\n status: GenieChatStatus;\n /** Additional CSS class for the scroll area */\n className?: string;\n /** Whether a previous page of older messages exists */\n hasPreviousPage?: boolean;\n /** Callback to fetch the previous page of messages */\n onFetchPreviousPage?: () => void;\n}\n\nconst STATUS_LABELS: Record<string, string> = {\n ASKING_AI: \"Asking AI...\",\n EXECUTING_QUERY: \"Executing query...\",\n FILTERING_RESULTS: \"Filtering results...\",\n COMPLETED: \"Done\",\n};\n\nfunction formatStatus(status: string): string {\n return STATUS_LABELS[status] ?? status.replace(/_/g, \" \").toLowerCase();\n}\n\nfunction getViewport(scrollRef: React.RefObject<HTMLDivElement | null>) {\n return scrollRef.current?.querySelector<HTMLElement>(\n '[data-slot=\"scroll-area-viewport\"]',\n );\n}\n\n/**\n * Manages scroll position: scrolls to bottom on append/initial load,\n * preserves position when older messages are prepended.\n */\nfunction useScrollManagement(\n scrollRef: React.RefObject<HTMLDivElement | null>,\n messages: GenieMessageItem[],\n status: GenieChatStatus,\n) {\n const prevFirstMessageIdRef = useRef<string | null>(null);\n const prevScrollHeightRef = useRef(0);\n const prevMessageCountRef = useRef(0);\n\n // Keep prevScrollHeightRef fresh when async content (images, embeds)\n // changes the viewport height between renders.\n useEffect(() => {\n const viewport = getViewport(scrollRef);\n if (!viewport) return;\n\n const observer = new ResizeObserver(() => {\n prevScrollHeightRef.current = viewport.scrollHeight;\n });\n observer.observe(viewport);\n return () => observer.disconnect();\n }, [scrollRef]);\n\n // biome-ignore lint/correctness/useExhaustiveDependencies: react to message count AND status so prevScrollHeightRef stays accurate when the loading indicator appears/disappears\n useLayoutEffect(() => {\n const viewport = getViewport(scrollRef);\n if (!viewport) return;\n\n const count = messages.length;\n const countChanged = count !== prevMessageCountRef.current;\n prevMessageCountRef.current = count;\n\n // Nothing to do if message count didn't change (e.g. status-only transition)\n if (!countChanged) {\n prevScrollHeightRef.current = viewport.scrollHeight;\n return;\n }\n\n const firstMessageId = messages[0]?.id ?? null;\n const wasPrepend =\n prevFirstMessageIdRef.current !== null &&\n firstMessageId !== prevFirstMessageIdRef.current;\n\n if (wasPrepend && prevScrollHeightRef.current > 0) {\n // Older messages prepended — preserve scroll position\n const delta = viewport.scrollHeight - prevScrollHeightRef.current;\n viewport.scrollTop += delta;\n } else {\n // Messages appended or initial load — scroll to bottom\n viewport.scrollTop = viewport.scrollHeight;\n }\n\n prevFirstMessageIdRef.current = firstMessageId;\n prevScrollHeightRef.current = viewport.scrollHeight;\n }, [messages.length, status]);\n}\n\n/**\n * Observes a sentinel element at the top of the scroll area and triggers\n * `onFetchPreviousPage` when the user scrolls to the top (only if content overflows).\n * Returns a ref to attach to the sentinel element.\n */\nfunction useLoadOlderOnScroll(\n scrollRef: React.RefObject<HTMLDivElement | null>,\n shouldObserve: boolean,\n onFetchPreviousPage?: () => void,\n) {\n const sentinelRef = useRef<HTMLDivElement>(null);\n const onFetchPreviousPageRef = useRef(onFetchPreviousPage);\n onFetchPreviousPageRef.current = onFetchPreviousPage;\n\n useEffect(() => {\n const sentinel = sentinelRef.current;\n const viewport = getViewport(scrollRef);\n if (!sentinel || !viewport || !shouldObserve) return;\n\n // The observer fires synchronously on observe() if the sentinel is\n // already visible. We arm it on the next frame so that synchronous\n // initial fire is ignored, but a real intersection (user genuinely\n // at the top on a short conversation) triggers on subsequent frames.\n let armed = false;\n const frameId = requestAnimationFrame(() => {\n armed = true;\n });\n\n const observer = new IntersectionObserver(\n (entries) => {\n if (!armed) return;\n const isScrollable = viewport.scrollHeight > viewport.clientHeight;\n if (entries[0]?.isIntersecting && isScrollable) {\n onFetchPreviousPageRef.current?.();\n }\n },\n { root: viewport, threshold: 0 },\n );\n\n observer.observe(sentinel);\n return () => {\n cancelAnimationFrame(frameId);\n observer.disconnect();\n };\n }, [scrollRef, shouldObserve]);\n\n return sentinelRef;\n}\n\n/** Scrollable message list that renders Genie chat messages with auto-scroll, skeleton loaders, and a streaming indicator. */\nexport function GenieChatMessageList({\n messages,\n status,\n className,\n hasPreviousPage = false,\n onFetchPreviousPage,\n}: GenieChatMessageListProps) {\n const scrollRef = useRef<HTMLDivElement>(null);\n\n const sentinelRef = useLoadOlderOnScroll(\n scrollRef,\n hasPreviousPage && status !== \"loading-older\",\n onFetchPreviousPage,\n );\n useScrollManagement(scrollRef, messages, status);\n\n const lastMessage = messages[messages.length - 1];\n const showStreamingIndicator =\n status === \"streaming\" &&\n lastMessage?.role === \"assistant\" &&\n lastMessage.id === \"\";\n\n return (\n <ScrollArea ref={scrollRef} className={cn(\"flex-1 min-h-0 p-4\", className)}>\n <div className=\"flex flex-col gap-4\">\n {hasPreviousPage && <div ref={sentinelRef} className=\"h-px\" />}\n\n {status === \"loading-older\" && (\n <div className=\"flex items-center justify-center gap-2 py-2\">\n <Spinner className=\"h-3 w-3\" />\n <span className=\"text-sm text-muted-foreground\">\n Loading older messages...\n </span>\n </div>\n )}\n\n {status === \"loading-history\" && messages.length === 0 && (\n <div className=\"flex flex-col gap-4\">\n <Skeleton className=\"h-12 w-3/4\" />\n <Skeleton className=\"h-20 w-4/5 self-start\" />\n <Skeleton className=\"h-12 w-2/3 self-end\" />\n </div>\n )}\n\n {messages\n .filter(\n (msg) => msg.role !== \"assistant\" || msg.id !== \"\" || msg.content,\n )\n .map((msg) => (\n <GenieChatMessage key={msg.id} message={msg} />\n ))}\n\n {showStreamingIndicator && (\n <div className=\"flex items-center gap-2 text-sm text-muted-foreground px-11\">\n <Spinner className=\"h-3 w-3\" />\n <span>{formatStatus(lastMessage.status)}</span>\n </div>\n )}\n\n {messages.length === 0 && status === \"idle\" && (\n <div className=\"flex items-center justify-center h-full text-muted-foreground text-sm py-12\">\n Start a conversation by typing a question below.\n </div>\n )}\n </div>\n </ScrollArea>\n );\n}\n"],"mappings":"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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"genie-chat-message.d.ts","names":[],"sources":["../../../src/react/genie/genie-chat-message.tsx"],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"genie-chat-message.d.ts","names":[],"sources":["../../../src/react/genie/genie-chat-message.tsx"],"mappings":";;;;UA0BU,qBAAA;;EAER,OAAA,EAAS,gBAAA;EAFD;EAIR,SAAA;AAAA;;iBAQc,gBAAA,CAAA;EACd,OAAA;EACA;AAAA,GACC,qBAAA,GAAqB,kBAAA,CAAA,GAAA,CAAA,OAAA"}
|