@pixerate/editor-svelte 0.36.0 → 0.38.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/vector/VectorBlendControls.svelte +69 -0
- package/dist/vector/VectorBlendControls.svelte.d.ts +8 -0
- package/dist/vector/VectorBlendControls.svelte.d.ts.map +1 -0
- package/dist/vector/VectorCanvas.svelte +30 -0
- package/dist/vector/VectorCanvas.svelte.d.ts.map +1 -1
- package/dist/vector/VectorToolbar.svelte +10 -1
- package/dist/vector/VectorToolbar.svelte.d.ts +5 -0
- package/dist/vector/VectorToolbar.svelte.d.ts.map +1 -1
- package/dist/vector/VectorWidthPointEditor.svelte +99 -0
- package/dist/vector/VectorWidthPointEditor.svelte.d.ts +14 -0
- package/dist/vector/VectorWidthPointEditor.svelte.d.ts.map +1 -0
- package/dist/vector/index.d.ts +1 -0
- package/dist/vector/index.d.ts.map +1 -1
- package/dist/vector/index.js +1 -0
- package/package.json +2 -2
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import {
|
|
3
|
+
VECTOR_BLEND_SPACINGS,
|
|
4
|
+
VECTOR_BLEND_SPACING_LABELS,
|
|
5
|
+
applyVectorBlendOptions,
|
|
6
|
+
getVectorBlendControls,
|
|
7
|
+
type VectorBlendSpacing,
|
|
8
|
+
type VectorEditorController
|
|
9
|
+
} from '@pixerate/editor/vector';
|
|
10
|
+
import { vectorStateOf } from './subscribe.svelte.js';
|
|
11
|
+
import { vectorButtonClass } from './styles.js';
|
|
12
|
+
|
|
13
|
+
/** Blend buttons and options: they edit the selected blends and the options new blends get. */
|
|
14
|
+
let { controller }: { controller: VectorEditorController } = $props();
|
|
15
|
+
|
|
16
|
+
const store = vectorStateOf(() => controller);
|
|
17
|
+
const blend = $derived(getVectorBlendControls(store.current));
|
|
18
|
+
const o = $derived(blend.options);
|
|
19
|
+
const selected = $derived(blend.ids.length > 0);
|
|
20
|
+
</script>
|
|
21
|
+
|
|
22
|
+
<div class="ml-1 flex items-center gap-1" role="group" aria-label="Blend" data-vector-blend-controls="">
|
|
23
|
+
<button type="button" data-vector-blend-action="make" class={vectorButtonClass} title="Make Blend" aria-label="Make Blend" disabled={!blend.canBlend} onclick={() => controller.blend()}>⧓</button>
|
|
24
|
+
<select
|
|
25
|
+
aria-label="Blend spacing"
|
|
26
|
+
class="h-7 rounded border border-border bg-background px-1 text-xs"
|
|
27
|
+
value={o.spacing}
|
|
28
|
+
onchange={(e) => applyVectorBlendOptions(controller, { spacing: e.currentTarget.value as VectorBlendSpacing })}
|
|
29
|
+
>
|
|
30
|
+
{#each VECTOR_BLEND_SPACINGS as sp (sp)}
|
|
31
|
+
<option value={sp}>{VECTOR_BLEND_SPACING_LABELS[sp]}</option>
|
|
32
|
+
{/each}
|
|
33
|
+
</select>
|
|
34
|
+
{#if o.spacing !== 'smoothColor'}
|
|
35
|
+
<input
|
|
36
|
+
type="number"
|
|
37
|
+
min={o.spacing === 'steps' ? 1 : 0.5}
|
|
38
|
+
step="1"
|
|
39
|
+
aria-label={o.spacing === 'steps' ? 'Blend steps' : 'Blend distance'}
|
|
40
|
+
class="h-7 w-16 rounded border border-border bg-background px-1.5 text-xs"
|
|
41
|
+
value={o.spacing === 'steps' ? o.steps : o.distance}
|
|
42
|
+
oninput={(e) => {
|
|
43
|
+
const n = parseFloat(e.currentTarget.value);
|
|
44
|
+
if (!Number.isFinite(n) || n <= 0) return;
|
|
45
|
+
applyVectorBlendOptions(controller, o.spacing === 'steps' ? { steps: n } : { distance: n });
|
|
46
|
+
}}
|
|
47
|
+
/>
|
|
48
|
+
{/if}
|
|
49
|
+
<button
|
|
50
|
+
type="button"
|
|
51
|
+
data-vector-blend-action="orient"
|
|
52
|
+
class={vectorButtonClass}
|
|
53
|
+
aria-pressed={o.orientToSpine}
|
|
54
|
+
title="Orient steps to the spine"
|
|
55
|
+
aria-label="Orient to spine"
|
|
56
|
+
onclick={() => applyVectorBlendOptions(controller, { orientToSpine: !o.orientToSpine })}>⤿</button
|
|
57
|
+
>
|
|
58
|
+
<button
|
|
59
|
+
type="button"
|
|
60
|
+
data-vector-blend-action="spine"
|
|
61
|
+
class={vectorButtonClass}
|
|
62
|
+
title="Replace Spine (select a blend and a path)"
|
|
63
|
+
aria-label="Replace Spine"
|
|
64
|
+
disabled={!blend.canReplaceSpine}
|
|
65
|
+
onclick={() => controller.replaceBlendSpine()}>⌇</button
|
|
66
|
+
>
|
|
67
|
+
<button type="button" data-vector-blend-action="expand" class={vectorButtonClass} title="Expand Blend" aria-label="Expand Blend" disabled={!selected} onclick={() => controller.expandBlend()}>⧉</button>
|
|
68
|
+
<button type="button" data-vector-blend-action="release" class={vectorButtonClass} title="Release Blend" aria-label="Release Blend" disabled={!selected} onclick={() => controller.releaseBlend()}>⧄</button>
|
|
69
|
+
</div>
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type VectorEditorController } from '@pixerate/editor/vector';
|
|
2
|
+
type $$ComponentProps = {
|
|
3
|
+
controller: VectorEditorController;
|
|
4
|
+
};
|
|
5
|
+
declare const VectorBlendControls: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
6
|
+
type VectorBlendControls = ReturnType<typeof VectorBlendControls>;
|
|
7
|
+
export default VectorBlendControls;
|
|
8
|
+
//# sourceMappingURL=VectorBlendControls.svelte.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VectorBlendControls.svelte.d.ts","sourceRoot":"","sources":["../../src/vector/VectorBlendControls.svelte.ts"],"names":[],"mappings":"AAGA,OAAO,EAMH,KAAK,sBAAsB,EAC5B,MAAM,yBAAyB,CAAC;AAIlC,KAAK,gBAAgB,GAAI;IAAE,UAAU,EAAE,sBAAsB,CAAA;CAAE,CAAC;AAqCjE,QAAA,MAAM,mBAAmB,sDAAwC,CAAC;AAClE,KAAK,mBAAmB,GAAG,UAAU,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAClE,eAAe,mBAAmB,CAAC"}
|
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
} from '@pixerate/editor/vector';
|
|
18
18
|
import VectorGradientDefs from './VectorGradientDefs.svelte';
|
|
19
19
|
import VectorSceneNodes from './VectorSceneNodes.svelte';
|
|
20
|
+
import VectorWidthPointEditor from './VectorWidthPointEditor.svelte';
|
|
20
21
|
import { vectorStateOf } from './subscribe.svelte.js';
|
|
21
22
|
|
|
22
23
|
interface Props {
|
|
@@ -54,6 +55,8 @@
|
|
|
54
55
|
const scene = $derived(getVectorSceneRenderData(view, { idPrefix }));
|
|
55
56
|
const overlay = $derived(getVectorOverlayRenderData(view));
|
|
56
57
|
const box = $derived(overlay.selectionBox);
|
|
58
|
+
const edit = $derived(view.widthPointEdit);
|
|
59
|
+
const editAt = $derived(edit ? { x: edit.point.x * view.viewport.zoom + view.viewport.x, y: edit.point.y * view.viewport.zoom + view.viewport.y } : null);
|
|
57
60
|
const closing = $derived(view.tool === 'pen' ? overlay.anchors.find((a) => a.closes && a.hovered) : undefined);
|
|
58
61
|
const hs = THEME.transformHandleSize;
|
|
59
62
|
const as = THEME.anchorSize;
|
|
@@ -225,6 +228,25 @@
|
|
|
225
228
|
<circle cx={w.x} cy={w.y} r={1.5} fill={accentColor} />
|
|
226
229
|
</g>
|
|
227
230
|
{/each}
|
|
231
|
+
{#each overlay.blend.spines as sp (sp.id)}
|
|
232
|
+
<g data-vector-blend-spine={sp.id} data-replaced={sp.replaced || undefined}>
|
|
233
|
+
<path d={sp.d} fill="none" stroke={accentColor} stroke-dasharray="4 3" />
|
|
234
|
+
{#each sp.keys as k, i (i)}
|
|
235
|
+
<circle cx={k.x} cy={k.y} r={THEME.handleRadius} fill={THEME.handleFill} stroke={accentColor} />
|
|
236
|
+
{/each}
|
|
237
|
+
</g>
|
|
238
|
+
{/each}
|
|
239
|
+
{#if overlay.blend.start}
|
|
240
|
+
<g data-vector-blend-start="">
|
|
241
|
+
<path d={overlay.blend.start.d} fill="none" stroke={accentColor} stroke-width="2" />
|
|
242
|
+
{#if overlay.blend.start.anchor}
|
|
243
|
+
<circle cx={overlay.blend.start.anchor.x} cy={overlay.blend.start.anchor.y} r={THEME.handleRadius + 1} fill={accentColor} />
|
|
244
|
+
{/if}
|
|
245
|
+
</g>
|
|
246
|
+
{/if}
|
|
247
|
+
{#each overlay.blend.anchors as a, i (i)}
|
|
248
|
+
<rect data-vector-blend-anchor={i} x={a.x - as / 2} y={a.y - as / 2} width={as} height={as} fill={a.hovered ? accentColor : THEME.handleFill} stroke={accentColor} />
|
|
249
|
+
{/each}
|
|
228
250
|
{#if overlay.widthSpot}
|
|
229
251
|
<g data-vector-width-spot="">
|
|
230
252
|
<line x1={overlay.widthSpot.left.x} y1={overlay.widthSpot.left.y} x2={overlay.widthSpot.right.x} y2={overlay.widthSpot.right.y} stroke={accentColor} stroke-dasharray="3 2" />
|
|
@@ -337,4 +359,12 @@
|
|
|
337
359
|
<text data-vector-status="" x="8" y="100%" dy="-8" font-size="11" fill={accentColor} style="font-family:system-ui,sans-serif">{overlay.status}</text>
|
|
338
360
|
{/if}
|
|
339
361
|
</g>
|
|
362
|
+
{#if edit && editAt}
|
|
363
|
+
<!-- Width Point Edit (double-click with the width tool), beside the point. -->
|
|
364
|
+
<foreignObject data-vector-width-point-edit="" x={editAt.x + 12} y={editAt.y + 12} width="180" height="140" style="overflow:visible">
|
|
365
|
+
{#key `${edit.nodeId}:${edit.index}:${edit.t}`}
|
|
366
|
+
<VectorWidthPointEditor {controller} {edit} {accentColor} />
|
|
367
|
+
{/key}
|
|
368
|
+
</foreignObject>
|
|
369
|
+
{/if}
|
|
340
370
|
</svg>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VectorCanvas.svelte.d.ts","sourceRoot":"","sources":["../../src/vector/VectorCanvas.svelte.ts"],"names":[],"mappings":"AAQA,OAAO,EAQH,KAAK,sBAAsB,EAC5B,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"VectorCanvas.svelte.d.ts","sourceRoot":"","sources":["../../src/vector/VectorCanvas.svelte.ts"],"names":[],"mappings":"AAQA,OAAO,EAQH,KAAK,sBAAsB,EAC5B,MAAM,yBAAyB,CAAC;AAOjC,UAAU,KAAK;IACb,UAAU,EAAE,sBAAsB,CAAC;IACnC,mFAAmF;IACnF,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,0EAA0E;IAC1E,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,gDAAgD;IAChD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,4CAA4C;IAC5C,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,yDAAyD;IACzD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,kDAAkD;IAClD,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAqQH,QAAA,MAAM,YAAY,2CAAwC,CAAC;AAC3D,KAAK,YAAY,GAAG,UAAU,CAAC,OAAO,YAAY,CAAC,CAAC;AACpD,eAAe,YAAY,CAAC"}
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
} from '@pixerate/editor/vector';
|
|
14
14
|
import { vectorStateOf } from './subscribe.svelte.js';
|
|
15
15
|
import { vectorButtonClass } from './styles.js';
|
|
16
|
+
import VectorBlendControls from './VectorBlendControls.svelte';
|
|
16
17
|
|
|
17
18
|
interface Props {
|
|
18
19
|
controller: VectorEditorController;
|
|
@@ -30,10 +31,15 @@
|
|
|
30
31
|
* those tools are active (default `true`).
|
|
31
32
|
*/
|
|
32
33
|
showPathEdit?: boolean;
|
|
34
|
+
/**
|
|
35
|
+
* Blend: Make Blend, spacing (steps, distance or smooth colour), steps / distance, orient to
|
|
36
|
+
* spine, Replace Spine, Expand and Release (default `true`).
|
|
37
|
+
*/
|
|
38
|
+
showBlend?: boolean;
|
|
33
39
|
class?: string;
|
|
34
40
|
}
|
|
35
41
|
|
|
36
|
-
let { controller, tools = VECTOR_TOOLS, showHistory = true, showArrange = true, showSnap = true, showPathEdit = true, class: className = '' }: Props = $props();
|
|
42
|
+
let { controller, tools = VECTOR_TOOLS, showHistory = true, showArrange = true, showSnap = true, showPathEdit = true, showBlend = true, class: className = '' }: Props = $props();
|
|
37
43
|
|
|
38
44
|
const snapTitle = 'Snap to objects';
|
|
39
45
|
const modKey = typeof navigator !== 'undefined' && /Mac|iPhone|iPad/.test(navigator.platform ?? '') ? '⌘' : 'Ctrl';
|
|
@@ -182,6 +188,9 @@
|
|
|
182
188
|
{/if}
|
|
183
189
|
</div>
|
|
184
190
|
{/if}
|
|
191
|
+
{#if showBlend}
|
|
192
|
+
<VectorBlendControls {controller} />
|
|
193
|
+
{/if}
|
|
185
194
|
{#if showArrange}
|
|
186
195
|
<div class="ml-1 flex items-center gap-1" role="group" aria-label="Combine">
|
|
187
196
|
{#each combine as item (item.title)}{@render action(item)}{/each}
|
|
@@ -15,6 +15,11 @@ interface Props {
|
|
|
15
15
|
* those tools are active (default `true`).
|
|
16
16
|
*/
|
|
17
17
|
showPathEdit?: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Blend: Make Blend, spacing (steps, distance or smooth colour), steps / distance, orient to
|
|
20
|
+
* spine, Replace Spine, Expand and Release (default `true`).
|
|
21
|
+
*/
|
|
22
|
+
showBlend?: boolean;
|
|
18
23
|
class?: string;
|
|
19
24
|
}
|
|
20
25
|
declare const VectorToolbar: import("svelte").Component<Props, {}, "">;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VectorToolbar.svelte.d.ts","sourceRoot":"","sources":["../../src/vector/VectorToolbar.svelte.ts"],"names":[],"mappings":"AAGA,OAAO,EASH,KAAK,sBAAsB,EAC3B,KAAK,UAAU,EAChB,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"VectorToolbar.svelte.d.ts","sourceRoot":"","sources":["../../src/vector/VectorToolbar.svelte.ts"],"names":[],"mappings":"AAGA,OAAO,EASH,KAAK,sBAAsB,EAC3B,KAAK,UAAU,EAChB,MAAM,yBAAyB,CAAC;AAMjC,UAAU,KAAK;IACb,UAAU,EAAE,sBAAsB,CAAC;IACnC,oCAAoC;IACpC,KAAK,CAAC,EAAE,SAAS,UAAU,EAAE,CAAC;IAC9B,4CAA4C;IAC5C,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,8EAA8E;IAC9E,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,4CAA4C;IAC5C,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;;OAIG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AA0HH,QAAA,MAAM,aAAa,2CAAwC,CAAC;AAC5D,KAAK,aAAa,GAAG,UAAU,CAAC,OAAO,aAAa,CAAC,CAAC;AACtD,eAAe,aAAa,CAAC"}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
Width Point Edit: the position (percent along the path) and the left / right side widths
|
|
3
|
+
(document units) of the width point a width-tool double-click opened. Apply (or Enter) sets
|
|
4
|
+
them with `commitWidthPointEdit`; Cancel or Escape closes it. `<VectorCanvas>` shows it next
|
|
5
|
+
to the point; use it on its own to place it elsewhere.
|
|
6
|
+
-->
|
|
7
|
+
<script lang="ts">
|
|
8
|
+
import { VECTOR_OVERLAY_THEME as THEME, type VectorEditorController, type VectorWidthPointEdit } from '@pixerate/editor/vector';
|
|
9
|
+
|
|
10
|
+
interface Props {
|
|
11
|
+
controller: VectorEditorController;
|
|
12
|
+
/** The point being edited (`state.widthPointEdit`). */
|
|
13
|
+
edit: VectorWidthPointEdit;
|
|
14
|
+
/** Accent colour of the Apply button (default sky blue). */
|
|
15
|
+
accentColor?: string;
|
|
16
|
+
class?: string;
|
|
17
|
+
style?: string;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
let { controller, edit, accentColor = THEME.accent, class: className = '', style = '' }: Props = $props();
|
|
21
|
+
|
|
22
|
+
const round = (v: number, digits: number) => String(Math.round(v * 10 ** digits) / 10 ** digits);
|
|
23
|
+
// The fields start from the point; the canvas re-keys the editor when it opens on another one.
|
|
24
|
+
// svelte-ignore state_referenced_locally
|
|
25
|
+
let position = $state<string | number | null>(round(edit.t * 100, 2));
|
|
26
|
+
// svelte-ignore state_referenced_locally
|
|
27
|
+
let left = $state<string | number | null>(round(edit.left, 3));
|
|
28
|
+
// svelte-ignore state_referenced_locally
|
|
29
|
+
let right = $state<string | number | null>(round(edit.right, 3));
|
|
30
|
+
let form: HTMLFormElement | undefined = $state();
|
|
31
|
+
|
|
32
|
+
const num = (v: unknown) => (String(v ?? '').trim() !== '' && Number.isFinite(Number(v)) ? Number(v) : undefined);
|
|
33
|
+
|
|
34
|
+
// Hand the keyboard back to the canvas around it.
|
|
35
|
+
function refocus() {
|
|
36
|
+
(form?.closest('svg') as SVGSVGElement | null)?.focus?.({ preventScroll: true });
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
function close() {
|
|
40
|
+
refocus();
|
|
41
|
+
controller.closeWidthPointEdit();
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
function apply(e: SubmitEvent) {
|
|
45
|
+
e.preventDefault();
|
|
46
|
+
const t = num(position);
|
|
47
|
+
refocus();
|
|
48
|
+
controller.commitWidthPointEdit({ t: t === undefined ? undefined : Math.min(Math.max(t, 0), 100) / 100, left: num(left), right: num(right) });
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
function onKeyDown(e: KeyboardEvent) {
|
|
52
|
+
e.stopPropagation();
|
|
53
|
+
if (e.key === 'Escape') {
|
|
54
|
+
e.preventDefault();
|
|
55
|
+
close();
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
const stop = (e: Event) => e.stopPropagation();
|
|
60
|
+
const fieldStyle = 'display:flex;align-items:center;justify-content:space-between;gap:6px';
|
|
61
|
+
const inputStyle = 'width:72px;font:inherit;padding:1px 4px';
|
|
62
|
+
</script>
|
|
63
|
+
|
|
64
|
+
<!-- Keep the canvas from treating clicks, keys and clipboard use in here as editing gestures. -->
|
|
65
|
+
<!-- svelte-ignore a11y_no_noninteractive_element_interactions -->
|
|
66
|
+
<form
|
|
67
|
+
bind:this={form}
|
|
68
|
+
data-vector-width-point-editor=""
|
|
69
|
+
aria-label="Width point"
|
|
70
|
+
class={className}
|
|
71
|
+
style="display:grid;gap:4px;padding:8px;background:#ffffff;border:1px solid rgba(0,0,0,0.15);border-radius:6px;box-shadow:0 2px 8px rgba(0,0,0,0.15);font:12px system-ui,sans-serif;color:#18181b;{style}"
|
|
72
|
+
onpointerdown={stop}
|
|
73
|
+
onpointermove={stop}
|
|
74
|
+
onpointerup={stop}
|
|
75
|
+
ondblclick={stop}
|
|
76
|
+
oncopy={stop}
|
|
77
|
+
oncut={stop}
|
|
78
|
+
onpaste={stop}
|
|
79
|
+
onkeydown={onKeyDown}
|
|
80
|
+
onsubmit={apply}
|
|
81
|
+
>
|
|
82
|
+
<label style={fieldStyle}>
|
|
83
|
+
Position %
|
|
84
|
+
<!-- svelte-ignore a11y_autofocus -->
|
|
85
|
+
<input aria-label="Width point position" type="number" min="0" max="100" step="any" bind:value={position} style={inputStyle} autofocus />
|
|
86
|
+
</label>
|
|
87
|
+
<label style={fieldStyle}>
|
|
88
|
+
Left
|
|
89
|
+
<input aria-label="Width point left side" type="number" min="0" step="any" bind:value={left} style={inputStyle} />
|
|
90
|
+
</label>
|
|
91
|
+
<label style={fieldStyle}>
|
|
92
|
+
Right
|
|
93
|
+
<input aria-label="Width point right side" type="number" min="0" step="any" bind:value={right} style={inputStyle} />
|
|
94
|
+
</label>
|
|
95
|
+
<div style="display:flex;justify-content:flex-end;gap:4px;margin-top:2px">
|
|
96
|
+
<button type="button" onclick={close}>Cancel</button>
|
|
97
|
+
<button type="submit" style="background:{accentColor};color:#ffffff;border:none;border-radius:4px;padding:2px 8px">{edit.index === null ? 'Add' : 'Apply'}</button>
|
|
98
|
+
</div>
|
|
99
|
+
</form>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type VectorEditorController, type VectorWidthPointEdit } from '@pixerate/editor/vector';
|
|
2
|
+
interface Props {
|
|
3
|
+
controller: VectorEditorController;
|
|
4
|
+
/** The point being edited (`state.widthPointEdit`). */
|
|
5
|
+
edit: VectorWidthPointEdit;
|
|
6
|
+
/** Accent colour of the Apply button (default sky blue). */
|
|
7
|
+
accentColor?: string;
|
|
8
|
+
class?: string;
|
|
9
|
+
style?: string;
|
|
10
|
+
}
|
|
11
|
+
declare const VectorWidthPointEditor: import("svelte").Component<Props, {}, "">;
|
|
12
|
+
type VectorWidthPointEditor = ReturnType<typeof VectorWidthPointEditor>;
|
|
13
|
+
export default VectorWidthPointEditor;
|
|
14
|
+
//# sourceMappingURL=VectorWidthPointEditor.svelte.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VectorWidthPointEditor.svelte.d.ts","sourceRoot":"","sources":["../../src/vector/VectorWidthPointEditor.svelte.ts"],"names":[],"mappings":"AAGA,OAAO,EAAiC,KAAK,sBAAsB,EAAE,KAAK,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAG9H,UAAU,KAAK;IACb,UAAU,EAAE,sBAAsB,CAAC;IACnC,uDAAuD;IACvD,IAAI,EAAE,oBAAoB,CAAC;IAC3B,4DAA4D;IAC5D,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AA0EH,QAAA,MAAM,sBAAsB,2CAAwC,CAAC;AACrE,KAAK,sBAAsB,GAAG,UAAU,CAAC,OAAO,sBAAsB,CAAC,CAAC;AACxE,eAAe,sBAAsB,CAAC"}
|
package/dist/vector/index.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import type VectorCanvasComponent from "./VectorCanvas.svelte";
|
|
|
3
3
|
import type VectorEditorComponent from "./VectorEditor.svelte";
|
|
4
4
|
export { default as VectorEditor } from "./VectorEditor.svelte";
|
|
5
5
|
export { default as VectorCanvas } from "./VectorCanvas.svelte";
|
|
6
|
+
export { default as VectorWidthPointEditor } from "./VectorWidthPointEditor.svelte";
|
|
6
7
|
export { default as VectorToolbar } from "./VectorToolbar.svelte";
|
|
7
8
|
export { default as VectorStylePanel } from "./VectorStylePanel.svelte";
|
|
8
9
|
export { default as VectorSceneNodes } from "./VectorSceneNodes.svelte";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/vector/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AAC7C,OAAO,KAAK,qBAAqB,MAAM,uBAAuB,CAAC;AAC/D,OAAO,KAAK,qBAAqB,MAAM,uBAAuB,CAAC;AAE/D,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAChE,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAChE,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAClE,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AACxE,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AACxE,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AAC5E,cAAc,gCAAgC,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,cAAc,aAAa,CAAC;AAE5B,MAAM,MAAM,iBAAiB,GAAG,cAAc,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAC7E,MAAM,MAAM,iBAAiB,GAAG,cAAc,CAAC,OAAO,qBAAqB,CAAC,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/vector/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AAC7C,OAAO,KAAK,qBAAqB,MAAM,uBAAuB,CAAC;AAC/D,OAAO,KAAK,qBAAqB,MAAM,uBAAuB,CAAC;AAE/D,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAChE,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAChE,OAAO,EAAE,OAAO,IAAI,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AACpF,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAClE,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AACxE,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AACxE,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AAC5E,cAAc,gCAAgC,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,cAAc,aAAa,CAAC;AAE5B,MAAM,MAAM,iBAAiB,GAAG,cAAc,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAC7E,MAAM,MAAM,iBAAiB,GAAG,cAAc,CAAC,OAAO,qBAAqB,CAAC,CAAC"}
|
package/dist/vector/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export { default as VectorEditor } from "./VectorEditor.svelte";
|
|
2
2
|
export { default as VectorCanvas } from "./VectorCanvas.svelte";
|
|
3
|
+
export { default as VectorWidthPointEditor } from "./VectorWidthPointEditor.svelte";
|
|
3
4
|
export { default as VectorToolbar } from "./VectorToolbar.svelte";
|
|
4
5
|
export { default as VectorStylePanel } from "./VectorStylePanel.svelte";
|
|
5
6
|
export { default as VectorSceneNodes } from "./VectorSceneNodes.svelte";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pixerate/editor-svelte",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.38.0",
|
|
4
4
|
"description": "Svelte bindings and prompt/rich-text components for @pixerate/editor",
|
|
5
5
|
"author": "Pixerate",
|
|
6
6
|
"license": "MIT",
|
|
@@ -107,7 +107,7 @@
|
|
|
107
107
|
"@tiptap/extension-bubble-menu": "^2.11.5",
|
|
108
108
|
"@tiptap/extension-placeholder": "^2.11.5",
|
|
109
109
|
"@tiptap/starter-kit": "^2.11.5",
|
|
110
|
-
"@pixerate/editor": "0.
|
|
110
|
+
"@pixerate/editor": "0.41.0"
|
|
111
111
|
},
|
|
112
112
|
"peerDependencies": {
|
|
113
113
|
"@dagrejs/dagre": "^1.1.4",
|