@pixerate/editor-react 0.198.1 → 0.199.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.
|
@@ -6,9 +6,16 @@ export interface PaintEffectsPanelProps {
|
|
|
6
6
|
controller: PaintEditorController;
|
|
7
7
|
className?: string;
|
|
8
8
|
}
|
|
9
|
-
/**
|
|
9
|
+
/**
|
|
10
|
+
* The effects the panel offers: the controller's provider with the painting's authored effects
|
|
11
|
+
* (`controller.effectsCatalog`), following `setEffectsProvider` and saved or removed authored effects.
|
|
12
|
+
*/
|
|
10
13
|
export declare function usePaintEffectsProvider(controller: PaintEditorController): EffectProvider | null;
|
|
11
|
-
/**
|
|
14
|
+
/**
|
|
15
|
+
* Registers the paint effect tools (`set_paper_effect`, `add_effect_layer`, `apply_effect`, …) and
|
|
16
|
+
* the effect authoring tools (`open_effect_authoring`, `save_authored_effect`, the
|
|
17
|
+
* `effect_authoring_*` tools, …) while mounted.
|
|
18
|
+
*/
|
|
12
19
|
export declare function usePaintEffectsTools(registry: ToolRegistry | null | undefined, controller: PaintEditorController, options?: PaintEffectsToolProviderOptions): void;
|
|
13
20
|
/**
|
|
14
21
|
* Provider effects in the paint editor: effect paper (a generator over the sheet, multiplied so
|
|
@@ -6,9 +6,16 @@ export interface PaintEffectsPanelProps {
|
|
|
6
6
|
controller: PaintEditorController;
|
|
7
7
|
className?: string;
|
|
8
8
|
}
|
|
9
|
-
/**
|
|
9
|
+
/**
|
|
10
|
+
* The effects the panel offers: the controller's provider with the painting's authored effects
|
|
11
|
+
* (`controller.effectsCatalog`), following `setEffectsProvider` and saved or removed authored effects.
|
|
12
|
+
*/
|
|
10
13
|
export declare function usePaintEffectsProvider(controller: PaintEditorController): EffectProvider | null;
|
|
11
|
-
/**
|
|
14
|
+
/**
|
|
15
|
+
* Registers the paint effect tools (`set_paper_effect`, `add_effect_layer`, `apply_effect`, …) and
|
|
16
|
+
* the effect authoring tools (`open_effect_authoring`, `save_authored_effect`, the
|
|
17
|
+
* `effect_authoring_*` tools, …) while mounted.
|
|
18
|
+
*/
|
|
12
19
|
export declare function usePaintEffectsTools(registry: ToolRegistry | null | undefined, controller: PaintEditorController, options?: PaintEffectsToolProviderOptions): void;
|
|
13
20
|
/**
|
|
14
21
|
* Provider effects in the paint editor: effect paper (a generator over the sheet, multiplied so
|
|
@@ -4466,10 +4466,16 @@ function EffectParameters({
|
|
|
4466
4466
|
// src/paint-editor/PaintEffectsPanel.tsx
|
|
4467
4467
|
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
4468
4468
|
function usePaintEffectsProvider(controller) {
|
|
4469
|
-
const [provider, setProvider] = (0, import_react31.useState)(controller.
|
|
4469
|
+
const [provider, setProvider] = (0, import_react31.useState)(controller.effectsCatalog);
|
|
4470
4470
|
(0, import_react31.useEffect)(() => {
|
|
4471
|
-
setProvider(controller.
|
|
4472
|
-
|
|
4471
|
+
const sync = () => setProvider(controller.effectsCatalog);
|
|
4472
|
+
sync();
|
|
4473
|
+
const a = controller.effects.subscribe(sync);
|
|
4474
|
+
const b = controller.subscribe(sync);
|
|
4475
|
+
return () => {
|
|
4476
|
+
a();
|
|
4477
|
+
b();
|
|
4478
|
+
};
|
|
4473
4479
|
}, [controller]);
|
|
4474
4480
|
return provider;
|
|
4475
4481
|
}
|
|
@@ -4477,7 +4483,12 @@ function usePaintEffectsTools(registry, controller, options = {}) {
|
|
|
4477
4483
|
const { id, namespace, readOnly, playbackSurface } = options;
|
|
4478
4484
|
(0, import_react31.useEffect)(() => {
|
|
4479
4485
|
if (!registry) return;
|
|
4480
|
-
|
|
4486
|
+
const a = registry.register((0, import_paint_editor18.createPaintEffectsToolProvider)(controller, { id, namespace, readOnly, playbackSurface }));
|
|
4487
|
+
const b = registry.register((0, import_paint_editor18.createPaintEffectAuthoringToolProvider)(controller, { id: id ? `${id}-authoring` : void 0, namespace: namespace === void 0 ? void 0 : namespace && `${namespace}-authoring`, readOnly, playbackSurface }));
|
|
4488
|
+
return () => {
|
|
4489
|
+
a();
|
|
4490
|
+
b();
|
|
4491
|
+
};
|
|
4481
4492
|
}, [registry, controller, id, namespace, readOnly, playbackSurface]);
|
|
4482
4493
|
}
|
|
4483
4494
|
function Controls({ provider, effect, name, values, apply }) {
|
|
@@ -1913,14 +1913,20 @@ import { PaintPresence as PaintPresence2, documentToScreen as documentToScreen2,
|
|
|
1913
1913
|
|
|
1914
1914
|
// src/paint-editor/PaintEffectsPanel.tsx
|
|
1915
1915
|
import { useEffect as useEffect5, useMemo as useMemo7, useRef as useRef6, useState as useState10 } from "react";
|
|
1916
|
-
import { createPaintEffectsToolProvider, PAPER_EFFECT_BLENDS } from "@pixerate/editor/paint-editor";
|
|
1916
|
+
import { createPaintEffectAuthoringToolProvider, createPaintEffectsToolProvider, PAPER_EFFECT_BLENDS } from "@pixerate/editor/paint-editor";
|
|
1917
1917
|
import { pathControlsOf } from "@pixerate/editor/effects";
|
|
1918
1918
|
import { jsx as jsx17, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
1919
1919
|
function usePaintEffectsProvider(controller) {
|
|
1920
|
-
const [provider, setProvider] = useState10(controller.
|
|
1920
|
+
const [provider, setProvider] = useState10(controller.effectsCatalog);
|
|
1921
1921
|
useEffect5(() => {
|
|
1922
|
-
setProvider(controller.
|
|
1923
|
-
|
|
1922
|
+
const sync = () => setProvider(controller.effectsCatalog);
|
|
1923
|
+
sync();
|
|
1924
|
+
const a = controller.effects.subscribe(sync);
|
|
1925
|
+
const b = controller.subscribe(sync);
|
|
1926
|
+
return () => {
|
|
1927
|
+
a();
|
|
1928
|
+
b();
|
|
1929
|
+
};
|
|
1924
1930
|
}, [controller]);
|
|
1925
1931
|
return provider;
|
|
1926
1932
|
}
|
|
@@ -1928,7 +1934,12 @@ function usePaintEffectsTools(registry, controller, options = {}) {
|
|
|
1928
1934
|
const { id, namespace, readOnly, playbackSurface } = options;
|
|
1929
1935
|
useEffect5(() => {
|
|
1930
1936
|
if (!registry) return;
|
|
1931
|
-
|
|
1937
|
+
const a = registry.register(createPaintEffectsToolProvider(controller, { id, namespace, readOnly, playbackSurface }));
|
|
1938
|
+
const b = registry.register(createPaintEffectAuthoringToolProvider(controller, { id: id ? `${id}-authoring` : void 0, namespace: namespace === void 0 ? void 0 : namespace && `${namespace}-authoring`, readOnly, playbackSurface }));
|
|
1939
|
+
return () => {
|
|
1940
|
+
a();
|
|
1941
|
+
b();
|
|
1942
|
+
};
|
|
1932
1943
|
}, [registry, controller, id, namespace, readOnly, playbackSurface]);
|
|
1933
1944
|
}
|
|
1934
1945
|
function Controls({ provider, effect, name, values, apply }) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pixerate/editor-react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.199.0",
|
|
4
4
|
"description": "React bindings and prompt/rich-text components for @pixerate/editor",
|
|
5
5
|
"author": "Pixerate",
|
|
6
6
|
"license": "MIT",
|
|
@@ -283,7 +283,7 @@
|
|
|
283
283
|
"dependencies": {},
|
|
284
284
|
"peerDependencies": {
|
|
285
285
|
"@dagrejs/dagre": "^1.1.8",
|
|
286
|
-
"@pixerate/editor": ">=0.
|
|
286
|
+
"@pixerate/editor": ">=0.289.0 <1.0.0-0",
|
|
287
287
|
"@tiptap/core": "^2.27.3",
|
|
288
288
|
"@tiptap/extension-bubble-menu": "^2.27.3",
|
|
289
289
|
"@tiptap/extension-placeholder": "^2.27.3",
|
|
@@ -334,7 +334,7 @@
|
|
|
334
334
|
"tsup": "^9.0.0",
|
|
335
335
|
"typescript": "^5.7.3",
|
|
336
336
|
"vitest": "^5.1.0",
|
|
337
|
-
"@pixerate/editor": "0.
|
|
337
|
+
"@pixerate/editor": "0.289.0"
|
|
338
338
|
},
|
|
339
339
|
"scripts": {
|
|
340
340
|
"build": "tsup && tsc -p tsconfig.build.json && node ../../scripts/finalize-declarations.mjs dist",
|