@pixerate/editor-svelte 0.46.0 → 0.47.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ToolRegistry } from "@pixerate/editor/tools";
|
|
2
|
-
import { ChartController, ChartDirector, ChartPresence, type ChartScene, type ChartToolProviderOptions, type ChartActionResult, type ChartCommandOptions, type ChartControllerOptions, type ChartSelection, type ChartSpecPatch, type ChartState, type ChartType } from "@pixerate/editor/chart";
|
|
2
|
+
import { ChartController, ChartDirector, ChartPresence, type OfficeChartToolProviderOptions, type ChartScene, type ChartToolProviderOptions, type ChartActionResult, type ChartCommandOptions, type ChartControllerOptions, type ChartSelection, type ChartSpecPatch, type ChartState, type ChartType } from "@pixerate/editor/chart";
|
|
3
3
|
export interface SvelteChartEditor {
|
|
4
4
|
readonly controller: ChartController;
|
|
5
5
|
/** The controller's state (reactive). */
|
|
@@ -46,6 +46,12 @@ export type ChartToolProviderHookOptions = Omit<ChartToolProviderOptions, "raste
|
|
|
46
46
|
* browser, `render_chart { format: "png" }` works out of the box (`createChartRasterizer`).
|
|
47
47
|
*/
|
|
48
48
|
export declare function useChartToolProvider(registry: ToolRegistry | null | undefined | (() => ToolRegistry | null | undefined), controller: ChartController, options?: ChartToolProviderHookOptions): void;
|
|
49
|
+
/**
|
|
50
|
+
* Registers the Office-file chart tools (`createOfficeChartToolProvider`: `list_file_charts`,
|
|
51
|
+
* `get_file_chart`, and `load_file_chart` with a `controller`) for the lifetime of the calling
|
|
52
|
+
* component. Pass a getter to follow a changing registry.
|
|
53
|
+
*/
|
|
54
|
+
export declare function useOfficeChartToolProvider(registry: ToolRegistry | null | undefined | (() => ToolRegistry | null | undefined), options?: OfficeChartToolProviderOptions): void;
|
|
49
55
|
/**
|
|
50
56
|
* A `ChartPresence` and `ChartDirector` for a chart: pass `presence` and `sceneRef` to
|
|
51
57
|
* `ChartCanvas`, and `director` to `useChartToolProvider` so agent edits are acted out with a
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createChartEditor.svelte.d.ts","sourceRoot":"","sources":["../../src/chart/createChartEditor.svelte.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EACL,eAAe,EACf,aAAa,EACb,aAAa,EAKb,KAAK,UAAU,EACf,KAAK,wBAAwB,EAC7B,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EACxB,KAAK,sBAAsB,EAC3B,KAAK,cAAc,EACnB,KAAK,cAAc,EACnB,KAAK,UAAU,EACf,KAAK,SAAS,EACf,MAAM,wBAAwB,CAAC;AAEhC,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,UAAU,EAAE,eAAe,CAAC;IACrC,yCAAyC;IACzC,QAAQ,CAAC,KAAK,EAAE,UAAU,CAAC;IAC3B,6CAA6C;IAC7C,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC,MAAM,CAAC,CAAC;IAClC,kDAAkD;IAClD,QAAQ,CAAC,SAAS,EAAE,cAAc,GAAG,IAAI,CAAC;IAC1C,MAAM,CAAC,KAAK,EAAE,cAAc,GAAG,iBAAiB,CAAC;IACjD,OAAO,CAAC,IAAI,EAAE,SAAS,GAAG,iBAAiB,CAAC;IAC5C,QAAQ,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,iBAAiB,CAAC;IAC7E,MAAM,CAAC,SAAS,EAAE,cAAc,GAAG,IAAI,GAAG,IAAI,CAAC;IAC/C,IAAI,IAAI,IAAI,CAAC;IACb,IAAI,IAAI,IAAI,CAAC;IACb,yCAAyC;IACzC,OAAO,IAAI,IAAI,CAAC;CACjB;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,mBAAmB,GAAE,eAAe,GAAG,sBAA2B,GAAG,iBAAiB,CAyBvH;AAED,0FAA0F;AAC1F,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AAE,GAAG,GAAG,MAAM,IAAI,CAAC;CAClC;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAC9B,QAAQ,EAAE,kBAAkB,GAAG,IAAI,GAAG,SAAS,GAAG,CAAC,MAAM,kBAAkB,GAAG,IAAI,GAAG,SAAS,CAAC,EAC/F,UAAU,EAAE,eAAe,EAC3B,OAAO,GAAE,mBAAwB,GAChC,IAAI,CAMN;AAED,0HAA0H;AAC1H,MAAM,MAAM,4BAA4B,GAAG,IAAI,CAAC,wBAAwB,EAAE,WAAW,CAAC,GAAG;IAAE,SAAS,CAAC,EAAE,wBAAwB,CAAC,WAAW,CAAC,GAAG,KAAK,CAAA;CAAE,CAAC;AAEvJ;;;;GAIG;AACH,wBAAgB,oBAAoB,CAClC,QAAQ,EAAE,YAAY,GAAG,IAAI,GAAG,SAAS,GAAG,CAAC,MAAM,YAAY,GAAG,IAAI,GAAG,SAAS,CAAC,EACnF,UAAU,EAAE,eAAe,EAC3B,OAAO,GAAE,4BAAiC,GACzC,IAAI,CAON;AAED;;;;GAIG;AACH,wBAAgB,0BAA0B,CACxC,QAAQ,EAAE,YAAY,GAAG,IAAI,GAAG,SAAS,GAAG,CAAC,MAAM,YAAY,GAAG,IAAI,GAAG,SAAS,CAAC,EACnF,OAAO,GAAE,8BAAmC,GAC3C,IAAI,CAMN;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,UAAU,EAAE,eAAe,EAAE,OAAO,GAAE;IAAE,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAA;CAAO;;;;iBAC9G,UAAU,GAAG,IAAI;;EAK7C"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { untrack } from "svelte";
|
|
2
|
-
import { ChartController, ChartDirector, ChartPresence, createChartCommands, createChartRasterizer, createChartToolProvider, layoutChart, } from "@pixerate/editor/chart";
|
|
2
|
+
import { ChartController, ChartDirector, ChartPresence, createChartCommands, createChartRasterizer, createChartToolProvider, createOfficeChartToolProvider, layoutChart, } from "@pixerate/editor/chart";
|
|
3
3
|
/**
|
|
4
4
|
* Svelte 5 rune: subscribes to a `ChartController` (or creates one from options) and
|
|
5
5
|
* exposes its state reactively with bound actions.
|
|
@@ -73,6 +73,19 @@ export function useChartToolProvider(registry, controller, options = {}) {
|
|
|
73
73
|
return target.register(createChartToolProvider(controller, { ...rest, rasterize: rasterize === false ? undefined : (rasterize ?? createChartRasterizer()) }));
|
|
74
74
|
});
|
|
75
75
|
}
|
|
76
|
+
/**
|
|
77
|
+
* Registers the Office-file chart tools (`createOfficeChartToolProvider`: `list_file_charts`,
|
|
78
|
+
* `get_file_chart`, and `load_file_chart` with a `controller`) for the lifetime of the calling
|
|
79
|
+
* component. Pass a getter to follow a changing registry.
|
|
80
|
+
*/
|
|
81
|
+
export function useOfficeChartToolProvider(registry, options = {}) {
|
|
82
|
+
$effect(() => {
|
|
83
|
+
const target = typeof registry === "function" ? registry() : registry;
|
|
84
|
+
if (!target)
|
|
85
|
+
return;
|
|
86
|
+
return target.register(createOfficeChartToolProvider(untrack(() => options)));
|
|
87
|
+
});
|
|
88
|
+
}
|
|
76
89
|
/**
|
|
77
90
|
* A `ChartPresence` and `ChartDirector` for a chart: pass `presence` and `sceneRef` to
|
|
78
91
|
* `ChartCanvas`, and `director` to `useChartToolProvider` so agent edits are acted out with a
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pixerate/editor-svelte",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.47.0",
|
|
4
4
|
"description": "Svelte bindings and prompt/rich-text components for @pixerate/editor",
|
|
5
5
|
"author": "Pixerate",
|
|
6
6
|
"license": "MIT",
|
|
@@ -115,7 +115,7 @@
|
|
|
115
115
|
"@tiptap/extension-bubble-menu": "^2.11.5",
|
|
116
116
|
"@tiptap/extension-placeholder": "^2.11.5",
|
|
117
117
|
"@tiptap/starter-kit": "^2.11.5",
|
|
118
|
-
"@pixerate/editor": "0.
|
|
118
|
+
"@pixerate/editor": "0.52.0"
|
|
119
119
|
},
|
|
120
120
|
"peerDependencies": {
|
|
121
121
|
"@dagrejs/dagre": "^1.1.4",
|