@pixerate/editor-svelte 0.68.0 → 0.69.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/image-editor/ImageEditor.svelte +21 -6
- package/dist/image-editor/ImageEditor.svelte.d.ts.map +1 -1
- package/dist/image-editor/LayersPanel.svelte +56 -2
- package/dist/image-editor/LayersPanel.svelte.d.ts +4 -0
- package/dist/image-editor/LayersPanel.svelte.d.ts.map +1 -1
- package/dist/image-editor/SelectionOptionsBar.svelte +12 -0
- package/dist/image-editor/SelectionOptionsBar.svelte.d.ts.map +1 -1
- package/dist/image-editor/imageEditorState.svelte.d.ts +5 -3
- package/dist/image-editor/imageEditorState.svelte.d.ts.map +1 -1
- package/dist/image-editor/imageEditorState.svelte.js +6 -4
- package/package.json +2 -2
|
@@ -93,6 +93,9 @@
|
|
|
93
93
|
let isInpainting = $state(false);
|
|
94
94
|
let aiError = $state<string | null>(null);
|
|
95
95
|
let aiSuccess = $state<string | null>(null);
|
|
96
|
+
/** Where AI results go: by layer count (auto), a new layer / mask, or replacing the Background. */
|
|
97
|
+
let aiTarget = $state<'auto' | 'new-layer' | 'replace'>('auto');
|
|
98
|
+
const aiOptions = $derived(aiTarget === 'auto' ? {} : { target: aiTarget });
|
|
96
99
|
|
|
97
100
|
const effectiveOnInpaint = $derived(onInpaint || aiHooks?.onInpaint);
|
|
98
101
|
const effectiveOnRemoveBg = $derived(onRemoveBackground || aiHooks?.onRemoveBackground);
|
|
@@ -106,12 +109,12 @@
|
|
|
106
109
|
aiSuccess = null;
|
|
107
110
|
isRemovingBg = true;
|
|
108
111
|
try {
|
|
109
|
-
// AI hooks work
|
|
110
|
-
//
|
|
111
|
-
const imageDataUrl = await editor.
|
|
112
|
+
// AI hooks work in natural pixels (no crop or rotation): the source when the result replaces
|
|
113
|
+
// it, the composite of the layers when the result becomes a layer or mask.
|
|
114
|
+
const imageDataUrl = await editor.controller.toAIInputDataURL(aiOptions);
|
|
112
115
|
const result = await effectiveOnRemoveBg({ imageDataUrl });
|
|
113
116
|
if (typeof result === 'string') {
|
|
114
|
-
await editor.applyBackgroundRemovedImage(result);
|
|
117
|
+
await editor.applyBackgroundRemovedImage(result, aiOptions);
|
|
115
118
|
aiSuccess = 'Background removed successfully!';
|
|
116
119
|
} else {
|
|
117
120
|
aiSuccess = 'Background removal complete.';
|
|
@@ -137,7 +140,7 @@
|
|
|
137
140
|
isInpainting = true;
|
|
138
141
|
try {
|
|
139
142
|
// Source image and mask share natural image space so they line up exactly.
|
|
140
|
-
const imageDataUrl = await editor.
|
|
143
|
+
const imageDataUrl = await editor.controller.toAIInputDataURL(aiOptions);
|
|
141
144
|
const maskDataUrl = await editor.toMaskDataURL({
|
|
142
145
|
useAnnotations: inpaintMaskMode === 'annotations',
|
|
143
146
|
useCrop: inpaintMaskMode === 'crop',
|
|
@@ -149,7 +152,7 @@
|
|
|
149
152
|
cropBox: inpaintMaskMode === 'crop' ? editor.state.crop : null,
|
|
150
153
|
});
|
|
151
154
|
if (typeof result === 'string') {
|
|
152
|
-
await editor.applyInpaintedImage(result);
|
|
155
|
+
await editor.applyInpaintedImage(result, aiOptions);
|
|
153
156
|
aiSuccess = 'Inpainting applied successfully!';
|
|
154
157
|
} else {
|
|
155
158
|
aiSuccess = 'Inpainting complete.';
|
|
@@ -1339,6 +1342,18 @@
|
|
|
1339
1342
|
<!-- TAB 5: AI TOOLS / INPAINTING & BACKGROUND REMOVAL -->
|
|
1340
1343
|
{#if activeTab === 'ai'}
|
|
1341
1344
|
<div class="flex flex-col gap-4 text-xs">
|
|
1345
|
+
<label class="flex items-center justify-between gap-2 text-slate-300">
|
|
1346
|
+
<span>Results go to</span>
|
|
1347
|
+
<select
|
|
1348
|
+
aria-label="AI result target"
|
|
1349
|
+
bind:value={aiTarget}
|
|
1350
|
+
class="bg-slate-800 border border-slate-700 rounded px-1.5 py-1"
|
|
1351
|
+
>
|
|
1352
|
+
<option value="auto">{editor.controller.isMultiLayer ? 'Auto (new layer)' : 'Auto (replace image)'}</option>
|
|
1353
|
+
<option value="new-layer">New layer / mask</option>
|
|
1354
|
+
<option value="replace">Replace image</option>
|
|
1355
|
+
</select>
|
|
1356
|
+
</label>
|
|
1342
1357
|
<!-- Background Removal Section -->
|
|
1343
1358
|
<div class="p-3 rounded-lg bg-slate-950/60 border border-slate-800 flex flex-col gap-2.5">
|
|
1344
1359
|
<div class="flex items-center justify-between">
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ImageEditor.svelte.d.ts","sourceRoot":"","sources":["../../src/image-editor/ImageEditor.svelte.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAIR,aAAa,EAGb,WAAW,EACX,oBAAoB,EACpB,kBAAkB,EAClB,cAAc,EACf,MAAM,+BAA+B,CAAC;AA0BzC,OAAO,EAA6B,KAAK,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AAGjG,UAAU,KAAK;IACb,MAAM,CAAC,EAAE,mBAAmB,CAAC;IAC7B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B,SAAS,CAAC,EAAE,WAAW,CAAC;IACxB,kBAAkB,CAAC,EAAE,oBAAoB,CAAC;IAC1C,OAAO,CAAC,EAAE,kBAAkB,CAAC;IAC7B,GAAG,CAAC,EAAE,cAAc,CAAC;CACtB;
|
|
1
|
+
{"version":3,"file":"ImageEditor.svelte.d.ts","sourceRoot":"","sources":["../../src/image-editor/ImageEditor.svelte.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAIR,aAAa,EAGb,WAAW,EACX,oBAAoB,EACpB,kBAAkB,EAClB,cAAc,EACf,MAAM,+BAA+B,CAAC;AA0BzC,OAAO,EAA6B,KAAK,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AAGjG,UAAU,KAAK;IACb,MAAM,CAAC,EAAE,mBAAmB,CAAC;IAC7B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B,SAAS,CAAC,EAAE,WAAW,CAAC;IACxB,kBAAkB,CAAC,EAAE,oBAAoB,CAAC;IAC1C,OAAO,CAAC,EAAE,kBAAkB,CAAC;IAC7B,GAAG,CAAC,EAAE,cAAc,CAAC;CACtB;AAupCH,QAAA,MAAM,WAAW,2CAAwC,CAAC;AAC1D,KAAK,WAAW,GAAG,UAAU,CAAC,OAAO,WAAW,CAAC,CAAC;AAClD,eAAe,WAAW,CAAC"}
|
|
@@ -1,16 +1,31 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import type { ImageEditorController, ImageLayer, LayerMenuAction, LayerPanelRow, PixelBuffer } from '@pixerate/editor/image-editor';
|
|
3
|
-
import {
|
|
3
|
+
import {
|
|
4
|
+
BLEND_MODES,
|
|
5
|
+
PSD_FILE_ACCEPT,
|
|
6
|
+
downloadPsd,
|
|
7
|
+
dropPlacement,
|
|
8
|
+
dropZone,
|
|
9
|
+
layerBadge,
|
|
10
|
+
layerMenu,
|
|
11
|
+
layerPanelRows,
|
|
12
|
+
openPsdFile,
|
|
13
|
+
runLayerMenuAction,
|
|
14
|
+
} from '@pixerate/editor/image-editor';
|
|
4
15
|
import { untrack } from 'svelte';
|
|
5
16
|
|
|
6
17
|
interface Props {
|
|
7
18
|
controller: ImageEditorController;
|
|
8
19
|
/** Thumbnail size in px (default 32). */
|
|
9
20
|
thumbnailSize?: number;
|
|
21
|
+
/** Show Open PSD / Export PSD (default true). */
|
|
22
|
+
psd?: boolean;
|
|
23
|
+
/** Base name of exported PSD files (default `image`). */
|
|
24
|
+
psdFileName?: string;
|
|
10
25
|
class?: string;
|
|
11
26
|
}
|
|
12
27
|
|
|
13
|
-
let { controller, thumbnailSize = 32, class: className = '' }: Props = $props();
|
|
28
|
+
let { controller, thumbnailSize = 32, psd = true, psdFileName = 'image', class: className = '' }: Props = $props();
|
|
14
29
|
|
|
15
30
|
let tick = $state(0);
|
|
16
31
|
$effect(() => {
|
|
@@ -36,6 +51,25 @@
|
|
|
36
51
|
let renaming = $state<string | null>(null);
|
|
37
52
|
let menu = $state<{ x: number; y: number } | null>(null);
|
|
38
53
|
let dragId = $state<string | null>(null);
|
|
54
|
+
/** Warnings of the last PSD open or export. */
|
|
55
|
+
let psdNotes = $state<string[]>([]);
|
|
56
|
+
let fileInput = $state<HTMLInputElement | null>(null);
|
|
57
|
+
|
|
58
|
+
async function psdTask(fn: () => Promise<string[]>) {
|
|
59
|
+
try {
|
|
60
|
+
error = null;
|
|
61
|
+
psdNotes = await fn();
|
|
62
|
+
} catch (err) {
|
|
63
|
+
error = err instanceof Error ? err.message : String(err);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
function onPsdFile(e: Event) {
|
|
68
|
+
const input = e.currentTarget as HTMLInputElement;
|
|
69
|
+
const file = input.files?.[0];
|
|
70
|
+
input.value = '';
|
|
71
|
+
if (file) psdTask(() => openPsdFile(controller, file));
|
|
72
|
+
}
|
|
39
73
|
/** Whether the next slider change records an undo step (the first of a drag does, the rest replace it). */
|
|
40
74
|
let commitNext = true;
|
|
41
75
|
|
|
@@ -127,7 +161,27 @@
|
|
|
127
161
|
const r = (e.currentTarget as HTMLElement).getBoundingClientRect();
|
|
128
162
|
menu = menu ? null : { x: r.left, y: r.bottom };
|
|
129
163
|
}}>⋯</button>
|
|
164
|
+
{#if psd}
|
|
165
|
+
<button type="button" class={iconButton} onclick={() => fileInput?.click()}>Open PSD…</button>
|
|
166
|
+
<button type="button" class={iconButton} onclick={() => psdTask(async () => (await downloadPsd(controller, psdFileName)).warnings)}>Export PSD</button>
|
|
167
|
+
<input
|
|
168
|
+
bind:this={fileInput}
|
|
169
|
+
type="file"
|
|
170
|
+
accept={PSD_FILE_ACCEPT}
|
|
171
|
+
class="hidden"
|
|
172
|
+
data-testid="psd-file-input"
|
|
173
|
+
aria-label="Open a PSD file"
|
|
174
|
+
onchange={onPsdFile} />
|
|
175
|
+
{/if}
|
|
130
176
|
</div>
|
|
177
|
+
{#if psdNotes.length > 0}
|
|
178
|
+
<ul class="rounded bg-amber-900/30 text-amber-200 px-2 py-1 space-y-0.5" data-testid="psd-warnings" aria-label="PSD warnings">
|
|
179
|
+
{#each psdNotes as n (n)}
|
|
180
|
+
<li>{n}</li>
|
|
181
|
+
{/each}
|
|
182
|
+
<li><button type="button" class="underline" onclick={() => (psdNotes = [])}>Dismiss</button></li>
|
|
183
|
+
</ul>
|
|
184
|
+
{/if}
|
|
131
185
|
|
|
132
186
|
{#if snapshot.active}
|
|
133
187
|
{@const active = snapshot.active}
|
|
@@ -3,6 +3,10 @@ interface Props {
|
|
|
3
3
|
controller: ImageEditorController;
|
|
4
4
|
/** Thumbnail size in px (default 32). */
|
|
5
5
|
thumbnailSize?: number;
|
|
6
|
+
/** Show Open PSD / Export PSD (default true). */
|
|
7
|
+
psd?: boolean;
|
|
8
|
+
/** Base name of exported PSD files (default `image`). */
|
|
9
|
+
psdFileName?: string;
|
|
6
10
|
class?: string;
|
|
7
11
|
}
|
|
8
12
|
declare const LayersPanel: import("svelte").Component<Props, {}, "">;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LayersPanel.svelte.d.ts","sourceRoot":"","sources":["../../src/image-editor/LayersPanel.svelte.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,qBAAqB,EAA2D,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"LayersPanel.svelte.d.ts","sourceRoot":"","sources":["../../src/image-editor/LayersPanel.svelte.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,qBAAqB,EAA2D,MAAM,+BAA+B,CAAC;AAgBlI,UAAU,KAAK;IACb,UAAU,EAAE,qBAAqB,CAAC;IAClC,yCAAyC;IACzC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,iDAAiD;IACjD,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,yDAAyD;IACzD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAsQH,QAAA,MAAM,WAAW,2CAAwC,CAAC;AAC1D,KAAK,WAAW,GAAG,UAAU,CAAC,OAAO,WAAW,CAAC,CAAC;AAClD,eAAe,WAAW,CAAC"}
|
|
@@ -101,6 +101,18 @@
|
|
|
101
101
|
<input type="checkbox" checked={options.sampleMerged} onchange={(e) => set({ sampleMerged: (e.currentTarget as HTMLInputElement).checked })} />
|
|
102
102
|
Sample adjusted image
|
|
103
103
|
</label>
|
|
104
|
+
<label class="flex items-center gap-2 text-slate-300">
|
|
105
|
+
Sample
|
|
106
|
+
<select
|
|
107
|
+
aria-label="Sample from"
|
|
108
|
+
value={options.sample ?? 'composite'}
|
|
109
|
+
onchange={(e) => set({ sample: (e.currentTarget as HTMLSelectElement).value as 'composite' | 'active-layer' })}
|
|
110
|
+
class="bg-slate-800 border border-slate-700 rounded px-1 py-0.5"
|
|
111
|
+
>
|
|
112
|
+
<option value="composite">All layers</option>
|
|
113
|
+
<option value="active-layer">Active layer</option>
|
|
114
|
+
</select>
|
|
115
|
+
</label>
|
|
104
116
|
</div>
|
|
105
117
|
{/if}
|
|
106
118
|
<label class="flex items-center gap-2 text-slate-300">
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectionOptionsBar.svelte.d.ts","sourceRoot":"","sources":["../../src/image-editor/SelectionOptionsBar.svelte.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACR,qBAAqB,EACrB,aAAa,EAEb,oBAAoB,EACrB,MAAM,+BAA+B,CAAC;AAUvC,UAAU,KAAK;IACb,UAAU,EAAE,qBAAqB,CAAC;IAClC,OAAO,EAAE,oBAAoB,CAAC;IAC9B,eAAe,EAAE,CAAC,IAAI,EAAE,oBAAoB,KAAK,IAAI,CAAC;IACtD,gFAAgF;IAChF,SAAS,CAAC,EAAE,aAAa,GAAG,IAAI,CAAC;IACjC,mFAAmF;IACnF,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;
|
|
1
|
+
{"version":3,"file":"SelectionOptionsBar.svelte.d.ts","sourceRoot":"","sources":["../../src/image-editor/SelectionOptionsBar.svelte.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACR,qBAAqB,EACrB,aAAa,EAEb,oBAAoB,EACrB,MAAM,+BAA+B,CAAC;AAUvC,UAAU,KAAK;IACb,UAAU,EAAE,qBAAqB,CAAC;IAClC,OAAO,EAAE,oBAAoB,CAAC;IAC9B,eAAe,EAAE,CAAC,IAAI,EAAE,oBAAoB,KAAK,IAAI,CAAC;IACtD,gFAAgF;IAChF,SAAS,CAAC,EAAE,aAAa,GAAG,IAAI,CAAC;IACjC,mFAAmF;IACnF,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AA4GH,QAAA,MAAM,mBAAmB,2CAAwC,CAAC;AAClE,KAAK,mBAAmB,GAAG,UAAU,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAClE,eAAe,mBAAmB,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ImageEditorController, type ImageEditorFit, type ImageEditorOptions, type ImageEditorState, type ImageEditorTool, type CropBox, type AspectRatio, type ImageAdjustments, type DepthMaskOptions, type Annotation, type CreateAnnotationPayload, type ExportOptions, type SerializedImageEditorState, type ImagePoint, type AdjustmentKind, type AdjustmentLayerInit, type AdjustmentLayerUpdate, type ImageHistogram } from '@pixerate/editor/image-editor';
|
|
1
|
+
import { ImageEditorController, type ImageEditorFit, type ImageEditorOptions, type ImageEditorState, type ImageEditorTool, type CropBox, type AspectRatio, type ImageAdjustments, type DepthMaskOptions, type Annotation, type CreateAnnotationPayload, type ExportOptions, type SerializedImageEditorState, type AIResultOptions, type ImagePoint, type AdjustmentKind, type AdjustmentLayerInit, type AdjustmentLayerUpdate, type ImageHistogram } from '@pixerate/editor/image-editor';
|
|
2
2
|
export declare function createReactiveImageEditor(options?: ImageEditorOptions): {
|
|
3
3
|
readonly controller: ImageEditorController;
|
|
4
4
|
readonly state: ImageEditorState;
|
|
@@ -55,8 +55,10 @@ export declare function createReactiveImageEditor(options?: ImageEditorOptions):
|
|
|
55
55
|
useCrop?: boolean;
|
|
56
56
|
}): Promise<string>;
|
|
57
57
|
toSourceDataURL(opts?: Pick<ExportOptions, "format" | "quality">): Promise<string>;
|
|
58
|
-
|
|
59
|
-
|
|
58
|
+
/** In documents with several layers (or `target: 'new-layer'`) the result goes to a new layer. */
|
|
59
|
+
applyInpaintedImage(newDataUrl: string, options?: AIResultOptions): Promise<string | void>;
|
|
60
|
+
/** In documents with several layers (or `target: 'new-layer'`) the result's alpha masks the active layer. */
|
|
61
|
+
applyBackgroundRemovedImage(newDataUrl: string, options?: AIResultOptions): Promise<string | void>;
|
|
60
62
|
/** Stops syncing controller state; call when the editor is no longer used. */
|
|
61
63
|
destroy(): void;
|
|
62
64
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"imageEditorState.svelte.d.ts","sourceRoot":"","sources":["../../src/image-editor/imageEditorState.svelte.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qBAAqB,EACrB,KAAK,cAAc,EACnB,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,EACrB,KAAK,eAAe,EACpB,KAAK,OAAO,EACZ,KAAK,WAAW,EAChB,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EACrB,KAAK,UAAU,EACf,KAAK,uBAAuB,EAC5B,KAAK,aAAa,EAClB,K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6GAA6G;4CACrE,MAAM,YAAY,eAAe;IAGzE,8EAA8E;;EAMjF;AAED,MAAM,MAAM,mBAAmB,GAAG,UAAU,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAE/E,6GAA6G;AAC7G,wBAAgB,oBAAoB,CAAC,UAAU,EAAE,qBAAqB;;;EAarE"}
|
|
@@ -156,11 +156,13 @@ export function createReactiveImageEditor(options = {}) {
|
|
|
156
156
|
toSourceDataURL(opts) {
|
|
157
157
|
return controller.toSourceDataURL(opts);
|
|
158
158
|
},
|
|
159
|
-
|
|
160
|
-
|
|
159
|
+
/** In documents with several layers (or `target: 'new-layer'`) the result goes to a new layer. */
|
|
160
|
+
applyInpaintedImage(newDataUrl, options) {
|
|
161
|
+
return controller.applyInpaintedImage(newDataUrl, options);
|
|
161
162
|
},
|
|
162
|
-
|
|
163
|
-
|
|
163
|
+
/** In documents with several layers (or `target: 'new-layer'`) the result's alpha masks the active layer. */
|
|
164
|
+
applyBackgroundRemovedImage(newDataUrl, options) {
|
|
165
|
+
return controller.applyBackgroundRemovedImage(newDataUrl, options);
|
|
164
166
|
},
|
|
165
167
|
/** Stops syncing controller state; call when the editor is no longer used. */
|
|
166
168
|
destroy() {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pixerate/editor-svelte",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.69.0",
|
|
4
4
|
"description": "Svelte bindings and prompt/rich-text components for @pixerate/editor",
|
|
5
5
|
"author": "Pixerate",
|
|
6
6
|
"license": "MIT",
|
|
@@ -131,7 +131,7 @@
|
|
|
131
131
|
"@tiptap/extension-bubble-menu": "^2.11.5",
|
|
132
132
|
"@tiptap/extension-placeholder": "^2.11.5",
|
|
133
133
|
"@tiptap/starter-kit": "^2.11.5",
|
|
134
|
-
"@pixerate/editor": "0.
|
|
134
|
+
"@pixerate/editor": "0.90.0"
|
|
135
135
|
},
|
|
136
136
|
"peerDependencies": {
|
|
137
137
|
"@dagrejs/dagre": "^1.1.4",
|