@widgetic/canvas 0.5.27 → 0.5.29
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/canvas/Canvas.svelte +166 -4
- package/dist/canvas/Canvas.svelte.d.ts +228 -218
- package/dist/canvas/CanvasToolbar.svelte +6 -3
- package/dist/canvas/CanvasToolbar.svelte.d.ts +66 -60
- package/dist/canvas/ContextMenu.svelte.d.ts +40 -35
- package/dist/canvas/PanZoomPanel.svelte.d.ts +35 -31
- package/dist/canvas/WidgetSelectionLayer.svelte +13 -3
- package/dist/canvas/WidgetSelectionLayer.svelte.d.ts +10 -13
- package/dist/canvas/props-panel/PropsPanel.svelte.d.ts +82 -78
- package/dist/canvas/props-panel/TextPropsICSection.svelte.d.ts +38 -34
- package/dist/components/CanvasBoardPlaceholder.svelte +11 -9
- package/dist/components/CanvasBoardPlaceholder.svelte.d.ts +19 -13
- package/dist/components/Tooltip.svelte.d.ts +30 -19
- package/dist/components/input-controls/ColorIC.svelte.d.ts +24 -20
- package/dist/components/input-controls/FontSelectorIC.svelte.d.ts +19 -15
- package/dist/components/input-controls/SliderUnitIC.svelte.d.ts +26 -22
- package/dist/components/input-controls/TextAlignIC.svelte.d.ts +19 -15
- package/dist/components/input-controls/TextStyleIC.svelte.d.ts +23 -19
- package/package.json +3 -2
|
@@ -1,37 +1,42 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
canPaste?: boolean;
|
|
12
|
-
onCut?: () => void;
|
|
13
|
-
onCopy?: () => void;
|
|
14
|
-
onPaste?: () => void;
|
|
15
|
-
onDuplicate?: () => void;
|
|
16
|
-
onDelete?: () => void;
|
|
17
|
-
onGroup?: () => void;
|
|
18
|
-
onUngroup?: () => void;
|
|
19
|
-
onBringToFront?: () => void;
|
|
20
|
-
onSendToBack?: () => void;
|
|
21
|
-
onBringForward?: () => void;
|
|
22
|
-
onSendBackward?: () => void;
|
|
23
|
-
onSelectAll?: () => void;
|
|
24
|
-
onClose?: () => void;
|
|
1
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
2
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
3
|
+
$$bindings?: Bindings;
|
|
4
|
+
} & Exports;
|
|
5
|
+
(internal: unknown, props: Props & {
|
|
6
|
+
$$events?: Events;
|
|
7
|
+
$$slots?: Slots;
|
|
8
|
+
}): Exports & {
|
|
9
|
+
$set?: any;
|
|
10
|
+
$on?: any;
|
|
25
11
|
};
|
|
26
|
-
|
|
27
|
-
[evt: string]: CustomEvent<any>;
|
|
28
|
-
};
|
|
29
|
-
slots: {};
|
|
30
|
-
};
|
|
31
|
-
export type ContextMenuProps = typeof __propDef.props;
|
|
32
|
-
export type ContextMenuEvents = typeof __propDef.events;
|
|
33
|
-
export type ContextMenuSlots = typeof __propDef.slots;
|
|
34
|
-
export default class ContextMenu extends SvelteComponentTyped<ContextMenuProps, ContextMenuEvents, ContextMenuSlots> {
|
|
35
|
-
get selectionCount(): number;
|
|
12
|
+
z_$$bindings?: Bindings;
|
|
36
13
|
}
|
|
37
|
-
|
|
14
|
+
declare const ContextMenu: $$__sveltets_2_IsomorphicComponent<{
|
|
15
|
+
x?: number;
|
|
16
|
+
y?: number;
|
|
17
|
+
visible?: boolean;
|
|
18
|
+
hasSelection?: boolean;
|
|
19
|
+
selectionCount?: number;
|
|
20
|
+
canGroup?: boolean;
|
|
21
|
+
canUngroup?: boolean;
|
|
22
|
+
canPaste?: boolean;
|
|
23
|
+
onCut?: () => void;
|
|
24
|
+
onCopy?: () => void;
|
|
25
|
+
onPaste?: () => void;
|
|
26
|
+
onDuplicate?: () => void;
|
|
27
|
+
onDelete?: () => void;
|
|
28
|
+
onGroup?: () => void;
|
|
29
|
+
onUngroup?: () => void;
|
|
30
|
+
onBringToFront?: () => void;
|
|
31
|
+
onSendToBack?: () => void;
|
|
32
|
+
onBringForward?: () => void;
|
|
33
|
+
onSendBackward?: () => void;
|
|
34
|
+
onSelectAll?: () => void;
|
|
35
|
+
onClose?: () => void;
|
|
36
|
+
}, {
|
|
37
|
+
[evt: string]: CustomEvent<any>;
|
|
38
|
+
}, {}, {
|
|
39
|
+
selectionCount: number;
|
|
40
|
+
}, string>;
|
|
41
|
+
type ContextMenu = InstanceType<typeof ContextMenu>;
|
|
42
|
+
export default ContextMenu;
|
|
@@ -1,33 +1,37 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
onZoomOut?: () => void;
|
|
12
|
-
onZoomReset?: () => void;
|
|
13
|
-
onZoomFit?: () => void;
|
|
14
|
-
onZoomChange?: (percent: number) => void;
|
|
15
|
-
onGridToggle?: () => void;
|
|
16
|
-
onShortcutsToggle?: () => void;
|
|
17
|
-
shortcutsOpen?: boolean;
|
|
18
|
-
/** Extra view controls (grid, pan, 1:1, fit, shortcuts). Zoom ± / % and save stay available. */ advancedFeatures?: boolean;
|
|
19
|
-
showSaveButton?: boolean;
|
|
20
|
-
hasUnsavedChanges?: boolean;
|
|
21
|
-
onSave?: (() => void) | null;
|
|
1
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
2
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
3
|
+
$$bindings?: Bindings;
|
|
4
|
+
} & Exports;
|
|
5
|
+
(internal: unknown, props: Props & {
|
|
6
|
+
$$events?: Events;
|
|
7
|
+
$$slots?: Slots;
|
|
8
|
+
}): Exports & {
|
|
9
|
+
$set?: any;
|
|
10
|
+
$on?: any;
|
|
22
11
|
};
|
|
23
|
-
|
|
24
|
-
[evt: string]: CustomEvent<any>;
|
|
25
|
-
};
|
|
26
|
-
slots: {};
|
|
27
|
-
};
|
|
28
|
-
export type PanZoomPanelProps = typeof __propDef.props;
|
|
29
|
-
export type PanZoomPanelEvents = typeof __propDef.events;
|
|
30
|
-
export type PanZoomPanelSlots = typeof __propDef.slots;
|
|
31
|
-
export default class PanZoomPanel extends SvelteComponentTyped<PanZoomPanelProps, PanZoomPanelEvents, PanZoomPanelSlots> {
|
|
12
|
+
z_$$bindings?: Bindings;
|
|
32
13
|
}
|
|
33
|
-
|
|
14
|
+
declare const PanZoomPanel: $$__sveltets_2_IsomorphicComponent<{
|
|
15
|
+
class?: string;
|
|
16
|
+
style?: string;
|
|
17
|
+
zoomLevel?: number;
|
|
18
|
+
isPanActive?: boolean;
|
|
19
|
+
showGrid?: boolean;
|
|
20
|
+
onPanToggle?: () => void;
|
|
21
|
+
onZoomIn?: () => void;
|
|
22
|
+
onZoomOut?: () => void;
|
|
23
|
+
onZoomReset?: () => void;
|
|
24
|
+
onZoomFit?: () => void;
|
|
25
|
+
onZoomChange?: (percent: number) => void;
|
|
26
|
+
onGridToggle?: () => void;
|
|
27
|
+
onShortcutsToggle?: () => void;
|
|
28
|
+
shortcutsOpen?: boolean;
|
|
29
|
+
/** Extra view controls (grid, pan, 1:1, fit, shortcuts). Zoom ± / % and save stay available. */ advancedFeatures?: boolean;
|
|
30
|
+
showSaveButton?: boolean;
|
|
31
|
+
hasUnsavedChanges?: boolean;
|
|
32
|
+
onSave?: (() => void) | null;
|
|
33
|
+
}, {
|
|
34
|
+
[evt: string]: CustomEvent<any>;
|
|
35
|
+
}, {}, {}, string>;
|
|
36
|
+
type PanZoomPanel = InstanceType<typeof PanZoomPanel>;
|
|
37
|
+
export default PanZoomPanel;
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
import { Portal } from '@widgetic/design-system';
|
|
5
5
|
import { canvasWarn } from './canvasLogger';
|
|
6
6
|
|
|
7
|
-
let { fabricCanvas, target, class: className = '', style = '' }: { fabricCanvas: Canvas; target: string; class?: string; style?: string } = $props();
|
|
7
|
+
let { fabricCanvas, target, advancedFeatures = true, class: className = '', style = '' }: { fabricCanvas: Canvas; target: string; advancedFeatures?: boolean; class?: string; style?: string } = $props();
|
|
8
8
|
let drawingCanvas: HTMLCanvasElement | null = null;
|
|
9
9
|
function captureDrawingCanvas(node: HTMLCanvasElement) {
|
|
10
10
|
drawingCanvas = node;
|
|
@@ -76,8 +76,8 @@
|
|
|
76
76
|
const retina = fabricCanvas.getRetinaScaling();
|
|
77
77
|
context.setTransform(retina, 0, 0, retina, 0, 0);
|
|
78
78
|
// Red primary stroke is part of the object, not the selection border.
|
|
79
|
-
//
|
|
80
|
-
if ((selected as any)._isPrimaryWidget && selected.strokeWidth) {
|
|
79
|
+
// The simple canvas hides it. Advanced paints it above the HTML preview.
|
|
80
|
+
if (advancedFeatures && (selected as any)._isPrimaryWidget && selected.strokeWidth) {
|
|
81
81
|
context.save();
|
|
82
82
|
context.transform(...fabricCanvas.viewportTransform);
|
|
83
83
|
context.transform(...selected.calcTransformMatrix());
|
|
@@ -93,14 +93,24 @@
|
|
|
93
93
|
// Fabric's internal control geometry (oCoords/controls) isn't on the
|
|
94
94
|
// public FabricObject type; this layer re-renders it as hit regions.
|
|
95
95
|
const sel = selected as any;
|
|
96
|
+
const hiddenWhenSimple = new Set(['ml', 'mr', 'mt', 'mb', 'mtr']);
|
|
96
97
|
controls = Object.entries(sel.oCoords || {}).flatMap(([key, position]: [string, any]) => {
|
|
97
98
|
const control = sel.controls[key];
|
|
99
|
+
if (!advancedFeatures && hiddenWhenSimple.has(key)) return [];
|
|
98
100
|
if (!sel.hasControls || !control?.getVisibility(sel, key)) return [];
|
|
99
101
|
const points = position.corner;
|
|
100
102
|
return [{ key, points: ['tl', 'tr', 'br', 'bl'].map(corner => `${points[corner].x * scaleX},${points[corner].y * scaleY}`).join(' '), cursor: control.cursorStyleHandler({}, control, sel) }];
|
|
101
103
|
});
|
|
102
104
|
}
|
|
103
105
|
|
|
106
|
+
// The board flips Advanced after this layer is already mounted. Repaint once
|
|
107
|
+
// the flag has landed, so a render that raced the prop does not leave the
|
|
108
|
+
// rotate handle or the red stroke up.
|
|
109
|
+
$effect(() => {
|
|
110
|
+
void advancedFeatures;
|
|
111
|
+
if (drawingCanvas) redraw();
|
|
112
|
+
});
|
|
113
|
+
|
|
104
114
|
onMount(() => {
|
|
105
115
|
let animationFrame = 0;
|
|
106
116
|
function scheduleRedraw() {
|
|
@@ -1,14 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import type { Canvas } from 'fabric';
|
|
2
|
+
type $$ComponentProps = {
|
|
3
|
+
fabricCanvas: Canvas;
|
|
4
|
+
target: string;
|
|
5
|
+
advancedFeatures?: boolean;
|
|
6
|
+
class?: string;
|
|
7
|
+
style?: string;
|
|
8
8
|
};
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
export
|
|
12
|
-
export default class WidgetSelectionLayer extends SvelteComponentTyped<WidgetSelectionLayerProps, WidgetSelectionLayerEvents, WidgetSelectionLayerSlots> {
|
|
13
|
-
}
|
|
14
|
-
export {};
|
|
9
|
+
declare const WidgetSelectionLayer: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
10
|
+
type WidgetSelectionLayer = ReturnType<typeof WidgetSelectionLayer>;
|
|
11
|
+
export default WidgetSelectionLayer;
|
|
@@ -1,80 +1,84 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
onRoundnessChange?: (roundness: number) => void;
|
|
12
|
-
onStrokeTypeChange?: (type: "solid" | "dashed" | "dotted") => void;
|
|
13
|
-
onOpacityChange?: (opacity: number) => void;
|
|
14
|
-
onFillOpacityChange?: (opacity: number) => void;
|
|
15
|
-
onGroupFillChange?: (color: string) => void;
|
|
16
|
-
onGroupFillOpacityChange?: (opacity: number) => void;
|
|
17
|
-
onGroupStrokeChange?: (color: string) => void;
|
|
18
|
-
onGroupStrokeWidthChange?: (width: number) => void;
|
|
19
|
-
onGroupStrokeTypeChange?: (type: "solid" | "dashed" | "dotted") => void;
|
|
20
|
-
onBackgroundColorChange?: (color: string) => void;
|
|
21
|
-
onBackgroundOpacityChange?: (opacity: number) => void;
|
|
22
|
-
onFontSizeChange?: (size: number) => void;
|
|
23
|
-
onFontFamilyChange?: (family: string) => void;
|
|
24
|
-
onFontWeightChange?: (weight: "normal" | "bold") => void;
|
|
25
|
-
onFontStyleChange?: (style: "normal" | "italic") => void;
|
|
26
|
-
onUnderlineChange?: (underline: boolean) => void;
|
|
27
|
-
onTextAlignChange?: (align: "left" | "center" | "right") => void;
|
|
28
|
-
onTextPaddingChange?: (padding: number) => void;
|
|
29
|
-
onTextColorChange?: (color: string) => void;
|
|
30
|
-
onFrameLabelChange?: (label: string) => void;
|
|
31
|
-
onFrameLabelFontSizeChange?: (size: number) => void;
|
|
32
|
-
onFrameLabelFontFamilyChange?: (family: string) => void;
|
|
33
|
-
onFrameLabelTextAlignChange?: (align: "left" | "center" | "right") => void;
|
|
34
|
-
onFrameLabelTextColorChange?: (color: string) => void;
|
|
35
|
-
onFrameLabelFontWeightChange?: (weight: "normal" | "bold") => void;
|
|
36
|
-
onFrameLabelFontStyleChange?: (style: "normal" | "italic") => void;
|
|
37
|
-
onFrameLabelUnderlineChange?: (underline: boolean) => void;
|
|
38
|
-
onFrameLabelBackgroundColorChange?: (color: string) => void;
|
|
39
|
-
onTextboxBoxFillChange?: (color: string) => void;
|
|
40
|
-
onTextboxBoxStrokeChange?: (color: string) => void;
|
|
41
|
-
onTextboxBoxStrokeWidthChange?: (width: number) => void;
|
|
42
|
-
onTextboxBoxStrokeTypeChange?: (type: "solid" | "dashed" | "dotted") => void;
|
|
43
|
-
onTextStrokeColorChange?: (color: string) => void;
|
|
44
|
-
onTextStrokeWidthChange?: (width: number) => void;
|
|
45
|
-
onImageUrlLoad?: (url: string) => void;
|
|
46
|
-
onImageSourceChange?: () => void;
|
|
47
|
-
onCapture?: (() => void) | null;
|
|
48
|
-
onConvertToWidget?: (() => void) | null;
|
|
49
|
-
onWidgetClick?: ((widgetId: string) => void) | null;
|
|
50
|
-
onWidgetRename?: ((widgetId: string, newName: string) => void) | null;
|
|
51
|
-
onRefreshScreenshot?: ((widgetId: string) => void) | null;
|
|
52
|
-
onSetAsPrimary?: ((widgetId: string) => void) | null;
|
|
53
|
-
getWidgetName?: ((widgetId: string) => string | null) | null;
|
|
54
|
-
/** Bumped when names change so PropsPanel re-reads getWidgetName. */ widgetNameRevision?: number;
|
|
55
|
-
/** Returns false when the linked widget was deleted or moved off this canvas. */ isWidgetKnown?: ((widgetId: string) => boolean) | null;
|
|
56
|
-
/** Remove the selected orphaned widget shape from the canvas. */ onRemoveOrphanedShape?: (() => void) | null;
|
|
57
|
-
onBringToFront?: () => void;
|
|
58
|
-
onBringForward?: () => void;
|
|
59
|
-
onSendBackward?: () => void;
|
|
60
|
-
onSendToBack?: () => void;
|
|
61
|
-
onAlignLeft?: () => void;
|
|
62
|
-
onAlignCenterH?: () => void;
|
|
63
|
-
onAlignRight?: () => void;
|
|
64
|
-
onAlignTop?: () => void;
|
|
65
|
-
onAlignMiddleV?: () => void;
|
|
66
|
-
onAlignBottom?: () => void;
|
|
67
|
-
onWidthChange?: (width: number) => void;
|
|
68
|
-
onHeightChange?: (height: number) => void;
|
|
1
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
2
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
3
|
+
$$bindings?: Bindings;
|
|
4
|
+
} & Exports;
|
|
5
|
+
(internal: unknown, props: Props & {
|
|
6
|
+
$$events?: Events;
|
|
7
|
+
$$slots?: Slots;
|
|
8
|
+
}): Exports & {
|
|
9
|
+
$set?: any;
|
|
10
|
+
$on?: any;
|
|
69
11
|
};
|
|
70
|
-
|
|
71
|
-
[evt: string]: CustomEvent<any>;
|
|
72
|
-
};
|
|
73
|
-
slots: {};
|
|
74
|
-
};
|
|
75
|
-
export type PropsPanelProps = typeof __propDef.props;
|
|
76
|
-
export type PropsPanelEvents = typeof __propDef.events;
|
|
77
|
-
export type PropsPanelSlots = typeof __propDef.slots;
|
|
78
|
-
export default class PropsPanel extends SvelteComponentTyped<PropsPanelProps, PropsPanelEvents, PropsPanelSlots> {
|
|
12
|
+
z_$$bindings?: Bindings;
|
|
79
13
|
}
|
|
80
|
-
|
|
14
|
+
declare const PropsPanel: $$__sveltets_2_IsomorphicComponent<{
|
|
15
|
+
class?: string;
|
|
16
|
+
style?: string;
|
|
17
|
+
selectedObject?: any;
|
|
18
|
+
wireframeMode?: boolean;
|
|
19
|
+
onFillChange?: (color: string) => void;
|
|
20
|
+
onStrokeChange?: (color: string) => void;
|
|
21
|
+
onStrokeWidthChange?: (width: number) => void;
|
|
22
|
+
onRoundnessChange?: (roundness: number) => void;
|
|
23
|
+
onStrokeTypeChange?: (type: "solid" | "dashed" | "dotted") => void;
|
|
24
|
+
onOpacityChange?: (opacity: number) => void;
|
|
25
|
+
onFillOpacityChange?: (opacity: number) => void;
|
|
26
|
+
onGroupFillChange?: (color: string) => void;
|
|
27
|
+
onGroupFillOpacityChange?: (opacity: number) => void;
|
|
28
|
+
onGroupStrokeChange?: (color: string) => void;
|
|
29
|
+
onGroupStrokeWidthChange?: (width: number) => void;
|
|
30
|
+
onGroupStrokeTypeChange?: (type: "solid" | "dashed" | "dotted") => void;
|
|
31
|
+
onBackgroundColorChange?: (color: string) => void;
|
|
32
|
+
onBackgroundOpacityChange?: (opacity: number) => void;
|
|
33
|
+
onFontSizeChange?: (size: number) => void;
|
|
34
|
+
onFontFamilyChange?: (family: string) => void;
|
|
35
|
+
onFontWeightChange?: (weight: "normal" | "bold") => void;
|
|
36
|
+
onFontStyleChange?: (style: "normal" | "italic") => void;
|
|
37
|
+
onUnderlineChange?: (underline: boolean) => void;
|
|
38
|
+
onTextAlignChange?: (align: "left" | "center" | "right") => void;
|
|
39
|
+
onTextPaddingChange?: (padding: number) => void;
|
|
40
|
+
onTextColorChange?: (color: string) => void;
|
|
41
|
+
onFrameLabelChange?: (label: string) => void;
|
|
42
|
+
onFrameLabelFontSizeChange?: (size: number) => void;
|
|
43
|
+
onFrameLabelFontFamilyChange?: (family: string) => void;
|
|
44
|
+
onFrameLabelTextAlignChange?: (align: "left" | "center" | "right") => void;
|
|
45
|
+
onFrameLabelTextColorChange?: (color: string) => void;
|
|
46
|
+
onFrameLabelFontWeightChange?: (weight: "normal" | "bold") => void;
|
|
47
|
+
onFrameLabelFontStyleChange?: (style: "normal" | "italic") => void;
|
|
48
|
+
onFrameLabelUnderlineChange?: (underline: boolean) => void;
|
|
49
|
+
onFrameLabelBackgroundColorChange?: (color: string) => void;
|
|
50
|
+
onTextboxBoxFillChange?: (color: string) => void;
|
|
51
|
+
onTextboxBoxStrokeChange?: (color: string) => void;
|
|
52
|
+
onTextboxBoxStrokeWidthChange?: (width: number) => void;
|
|
53
|
+
onTextboxBoxStrokeTypeChange?: (type: "solid" | "dashed" | "dotted") => void;
|
|
54
|
+
onTextStrokeColorChange?: (color: string) => void;
|
|
55
|
+
onTextStrokeWidthChange?: (width: number) => void;
|
|
56
|
+
onImageUrlLoad?: (url: string) => void;
|
|
57
|
+
onImageSourceChange?: () => void;
|
|
58
|
+
onCapture?: (() => void) | null;
|
|
59
|
+
onConvertToWidget?: (() => void) | null;
|
|
60
|
+
onWidgetClick?: ((widgetId: string) => void) | null;
|
|
61
|
+
onWidgetRename?: ((widgetId: string, newName: string) => void) | null;
|
|
62
|
+
onRefreshScreenshot?: ((widgetId: string) => void) | null;
|
|
63
|
+
onSetAsPrimary?: ((widgetId: string) => void) | null;
|
|
64
|
+
getWidgetName?: ((widgetId: string) => string | null) | null;
|
|
65
|
+
/** Bumped when names change so PropsPanel re-reads getWidgetName. */ widgetNameRevision?: number;
|
|
66
|
+
/** Returns false when the linked widget was deleted or moved off this canvas. */ isWidgetKnown?: ((widgetId: string) => boolean) | null;
|
|
67
|
+
/** Remove the selected orphaned widget shape from the canvas. */ onRemoveOrphanedShape?: (() => void) | null;
|
|
68
|
+
onBringToFront?: () => void;
|
|
69
|
+
onBringForward?: () => void;
|
|
70
|
+
onSendBackward?: () => void;
|
|
71
|
+
onSendToBack?: () => void;
|
|
72
|
+
onAlignLeft?: () => void;
|
|
73
|
+
onAlignCenterH?: () => void;
|
|
74
|
+
onAlignRight?: () => void;
|
|
75
|
+
onAlignTop?: () => void;
|
|
76
|
+
onAlignMiddleV?: () => void;
|
|
77
|
+
onAlignBottom?: () => void;
|
|
78
|
+
onWidthChange?: (width: number) => void;
|
|
79
|
+
onHeightChange?: (height: number) => void;
|
|
80
|
+
}, {
|
|
81
|
+
[evt: string]: CustomEvent<any>;
|
|
82
|
+
}, {}, {}, string>;
|
|
83
|
+
type PropsPanel = InstanceType<typeof PropsPanel>;
|
|
84
|
+
export default PropsPanel;
|
|
@@ -1,36 +1,40 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
textAlign?: "left" | "center" | "right";
|
|
12
|
-
textColor?: string;
|
|
13
|
-
onFontSizeChange?: (size: number) => void;
|
|
14
|
-
onFontFamilyChange?: (family: string) => void;
|
|
15
|
-
onFontWeightChange?: (weight: "normal" | "bold") => void;
|
|
16
|
-
onFontStyleChange?: (style: "normal" | "italic") => void;
|
|
17
|
-
onUnderlineChange?: (underline: boolean) => void;
|
|
18
|
-
onTextAlignChange?: (align: "left" | "center" | "right") => void;
|
|
19
|
-
onTextColorChange?: (color: string) => void;
|
|
20
|
-
showFontSize?: boolean;
|
|
21
|
-
showFontFamily?: boolean;
|
|
22
|
-
showTextStyle?: boolean;
|
|
23
|
-
showTextAlign?: boolean;
|
|
24
|
-
showTextColor?: boolean;
|
|
1
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
2
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
3
|
+
$$bindings?: Bindings;
|
|
4
|
+
} & Exports;
|
|
5
|
+
(internal: unknown, props: Props & {
|
|
6
|
+
$$events?: Events;
|
|
7
|
+
$$slots?: Slots;
|
|
8
|
+
}): Exports & {
|
|
9
|
+
$set?: any;
|
|
10
|
+
$on?: any;
|
|
25
11
|
};
|
|
26
|
-
|
|
27
|
-
[evt: string]: CustomEvent<any>;
|
|
28
|
-
};
|
|
29
|
-
slots: {};
|
|
30
|
-
};
|
|
31
|
-
export type TextPropsICSectionProps = typeof __propDef.props;
|
|
32
|
-
export type TextPropsICSectionEvents = typeof __propDef.events;
|
|
33
|
-
export type TextPropsICSectionSlots = typeof __propDef.slots;
|
|
34
|
-
export default class TextPropsICSection extends SvelteComponentTyped<TextPropsICSectionProps, TextPropsICSectionEvents, TextPropsICSectionSlots> {
|
|
12
|
+
z_$$bindings?: Bindings;
|
|
35
13
|
}
|
|
36
|
-
|
|
14
|
+
declare const TextPropsICSection: $$__sveltets_2_IsomorphicComponent<{
|
|
15
|
+
class?: string;
|
|
16
|
+
style?: string;
|
|
17
|
+
fontSize?: number;
|
|
18
|
+
fontFamily?: string;
|
|
19
|
+
fontWeight?: "normal" | "bold";
|
|
20
|
+
fontStyle?: "normal" | "italic";
|
|
21
|
+
underline?: boolean;
|
|
22
|
+
textAlign?: "left" | "center" | "right";
|
|
23
|
+
textColor?: string;
|
|
24
|
+
onFontSizeChange?: (size: number) => void;
|
|
25
|
+
onFontFamilyChange?: (family: string) => void;
|
|
26
|
+
onFontWeightChange?: (weight: "normal" | "bold") => void;
|
|
27
|
+
onFontStyleChange?: (style: "normal" | "italic") => void;
|
|
28
|
+
onUnderlineChange?: (underline: boolean) => void;
|
|
29
|
+
onTextAlignChange?: (align: "left" | "center" | "right") => void;
|
|
30
|
+
onTextColorChange?: (color: string) => void;
|
|
31
|
+
showFontSize?: boolean;
|
|
32
|
+
showFontFamily?: boolean;
|
|
33
|
+
showTextStyle?: boolean;
|
|
34
|
+
showTextAlign?: boolean;
|
|
35
|
+
showTextColor?: boolean;
|
|
36
|
+
}, {
|
|
37
|
+
[evt: string]: CustomEvent<any>;
|
|
38
|
+
}, {}, {}, string>;
|
|
39
|
+
type TextPropsICSection = InstanceType<typeof TextPropsICSection>;
|
|
40
|
+
export default TextPropsICSection;
|
|
@@ -13,14 +13,7 @@
|
|
|
13
13
|
* has its board at first paint. The real canvas replaces it with the same
|
|
14
14
|
* surface, so the swap is not visible.
|
|
15
15
|
*/
|
|
16
|
-
|
|
17
|
-
showLoadingLabel = true,
|
|
18
|
-
showSurface = true,
|
|
19
|
-
locale = undefined,
|
|
20
|
-
messages = undefined,
|
|
21
|
-
class: className = '',
|
|
22
|
-
style = ''
|
|
23
|
-
}: {
|
|
16
|
+
interface Props {
|
|
24
17
|
showLoadingLabel?: boolean;
|
|
25
18
|
/** False draws only the loading label, over a board that is already painted. */
|
|
26
19
|
showSurface?: boolean;
|
|
@@ -29,7 +22,16 @@
|
|
|
29
22
|
messages?: Readonly<Record<string, unknown>> | null;
|
|
30
23
|
class?: string;
|
|
31
24
|
style?: string;
|
|
32
|
-
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
let {
|
|
28
|
+
showLoadingLabel = true,
|
|
29
|
+
showSurface = true,
|
|
30
|
+
locale = undefined,
|
|
31
|
+
messages = undefined,
|
|
32
|
+
class: className = '',
|
|
33
|
+
style = ''
|
|
34
|
+
}: Props = $props();
|
|
33
35
|
|
|
34
36
|
// Inside a canvas the root already set the language; on its own, the page passes it.
|
|
35
37
|
// svelte-ignore state_referenced_locally
|
|
@@ -1,16 +1,22 @@
|
|
|
1
|
-
import { SvelteComponentTyped } from "svelte";
|
|
2
1
|
/** Colour of an empty board. Canvas.svelte paints Fabric with the same value. */
|
|
3
2
|
export declare const CANVAS_BOARD_BACKGROUND = "#f0f0f0";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
3
|
+
/**
|
|
4
|
+
* The empty board, drawn without Fabric.
|
|
5
|
+
*
|
|
6
|
+
* A host shows it while the canvas code is still downloading, so the page
|
|
7
|
+
* has its board at first paint. The real canvas replaces it with the same
|
|
8
|
+
* surface, so the swap is not visible.
|
|
9
|
+
*/
|
|
10
|
+
interface Props {
|
|
11
|
+
showLoadingLabel?: boolean;
|
|
12
|
+
/** False draws only the loading label, over a board that is already painted. */
|
|
13
|
+
showSurface?: boolean;
|
|
14
|
+
/** Same as Canvas: give these outside a canvas so the label speaks the page's language. */
|
|
15
|
+
locale?: string | null;
|
|
16
|
+
messages?: Readonly<Record<string, unknown>> | null;
|
|
17
|
+
class?: string;
|
|
18
|
+
style?: string;
|
|
15
19
|
}
|
|
16
|
-
|
|
20
|
+
declare const CanvasBoardPlaceholder: import("svelte").Component<Props, {}, "">;
|
|
21
|
+
type CanvasBoardPlaceholder = ReturnType<typeof CanvasBoardPlaceholder>;
|
|
22
|
+
export default CanvasBoardPlaceholder;
|
|
@@ -1,21 +1,32 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
2
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
3
|
+
$$bindings?: Bindings;
|
|
4
|
+
} & Exports;
|
|
5
|
+
(internal: unknown, props: Props & {
|
|
6
|
+
$$events?: Events;
|
|
7
|
+
$$slots?: Slots;
|
|
8
|
+
}): Exports & {
|
|
9
|
+
$set?: any;
|
|
10
|
+
$on?: any;
|
|
8
11
|
};
|
|
9
|
-
|
|
10
|
-
[evt: string]: CustomEvent<any>;
|
|
11
|
-
};
|
|
12
|
-
slots: {
|
|
13
|
-
default: {};
|
|
14
|
-
};
|
|
15
|
-
};
|
|
16
|
-
export type TooltipProps = typeof __propDef.props;
|
|
17
|
-
export type TooltipEvents = typeof __propDef.events;
|
|
18
|
-
export type TooltipSlots = typeof __propDef.slots;
|
|
19
|
-
export default class Tooltip extends SvelteComponentTyped<TooltipProps, TooltipEvents, TooltipSlots> {
|
|
12
|
+
z_$$bindings?: Bindings;
|
|
20
13
|
}
|
|
21
|
-
|
|
14
|
+
type $$__sveltets_2_PropsWithChildren<Props, Slots> = Props & (Slots extends {
|
|
15
|
+
default: any;
|
|
16
|
+
} ? Props extends Record<string, never> ? any : {
|
|
17
|
+
children?: any;
|
|
18
|
+
} : {});
|
|
19
|
+
declare const Tooltip: $$__sveltets_2_IsomorphicComponent<$$__sveltets_2_PropsWithChildren<{
|
|
20
|
+
text?: string;
|
|
21
|
+
position?: "above" | "below";
|
|
22
|
+
disabled?: boolean;
|
|
23
|
+
offsetY?: number;
|
|
24
|
+
}, {
|
|
25
|
+
default: {};
|
|
26
|
+
}>, {
|
|
27
|
+
[evt: string]: CustomEvent<any>;
|
|
28
|
+
}, {
|
|
29
|
+
default: {};
|
|
30
|
+
}, {}, string>;
|
|
31
|
+
type Tooltip = InstanceType<typeof Tooltip>;
|
|
32
|
+
export default Tooltip;
|
|
@@ -1,22 +1,26 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
2
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
3
|
+
$$bindings?: Bindings;
|
|
4
|
+
} & Exports;
|
|
5
|
+
(internal: unknown, props: Props & {
|
|
6
|
+
$$events?: Events;
|
|
7
|
+
$$slots?: Slots;
|
|
8
|
+
}): Exports & {
|
|
9
|
+
$set?: any;
|
|
10
|
+
$on?: any;
|
|
11
11
|
};
|
|
12
|
-
|
|
13
|
-
[evt: string]: CustomEvent<any>;
|
|
14
|
-
};
|
|
15
|
-
slots: {};
|
|
16
|
-
};
|
|
17
|
-
export type ColorICProps = typeof __propDef.props;
|
|
18
|
-
export type ColorICEvents = typeof __propDef.events;
|
|
19
|
-
export type ColorICSlots = typeof __propDef.slots;
|
|
20
|
-
export default class ColorIC extends SvelteComponentTyped<ColorICProps, ColorICEvents, ColorICSlots> {
|
|
12
|
+
z_$$bindings?: Bindings;
|
|
21
13
|
}
|
|
22
|
-
|
|
14
|
+
declare const ColorIC: $$__sveltets_2_IsomorphicComponent<{
|
|
15
|
+
class?: string;
|
|
16
|
+
style?: string;
|
|
17
|
+
value?: string;
|
|
18
|
+
label?: string | null;
|
|
19
|
+
onChange?: (color: string) => void;
|
|
20
|
+
presets?: string[] | null;
|
|
21
|
+
showPicker?: boolean;
|
|
22
|
+
}, {
|
|
23
|
+
[evt: string]: CustomEvent<any>;
|
|
24
|
+
}, {}, {}, string>;
|
|
25
|
+
type ColorIC = InstanceType<typeof ColorIC>;
|
|
26
|
+
export default ColorIC;
|