@codefrydev/svg-engine 0.1.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/README.md +57 -0
- package/dist/chunk-KRCGD3CL.js +2794 -0
- package/dist/editor.cjs +5864 -0
- package/dist/editor.d.cts +77 -0
- package/dist/editor.d.ts +77 -0
- package/dist/editor.js +3060 -0
- package/dist/index.cjs +2829 -0
- package/dist/index.d.cts +28 -0
- package/dist/index.d.ts +28 -0
- package/dist/index.js +24 -0
- package/dist/types-BTYLCn9x.d.cts +100 -0
- package/dist/types-BTYLCn9x.d.ts +100 -0
- package/dist/wc.cjs +1 -0
- package/dist/wc.d.cts +151 -0
- package/dist/wc.d.ts +151 -0
- package/dist/wc.iife.js +354 -0
- package/dist/wc.js +1 -0
- package/package.json +59 -0
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { P as Preset, a as ElementData, T as ToolCategory } from './types-BTYLCn9x.cjs';
|
|
3
|
+
|
|
4
|
+
declare const presets: {
|
|
5
|
+
mechanics: Preset;
|
|
6
|
+
circuit: Preset;
|
|
7
|
+
thermo: Preset;
|
|
8
|
+
optical: Preset;
|
|
9
|
+
magnetism: Preset;
|
|
10
|
+
light: Preset;
|
|
11
|
+
waves: Preset;
|
|
12
|
+
waveOscillation: Preset;
|
|
13
|
+
rotation: Preset;
|
|
14
|
+
graph: Preset;
|
|
15
|
+
electrostatics: Preset;
|
|
16
|
+
chemistry: Preset;
|
|
17
|
+
mechanical: Preset;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
interface EditorProps {
|
|
21
|
+
initialElements?: ElementData[];
|
|
22
|
+
toolCategories?: ToolCategory[];
|
|
23
|
+
preset?: keyof typeof presets;
|
|
24
|
+
/** Enable built-in preset switcher in the header. */
|
|
25
|
+
enablePresetSwitch?: boolean;
|
|
26
|
+
/** Notifies when user selects a different preset from header switcher. */
|
|
27
|
+
onPresetChange?: (preset: keyof typeof presets) => void;
|
|
28
|
+
onChange?: (elements: ElementData[]) => void;
|
|
29
|
+
viewMode?: boolean;
|
|
30
|
+
/** Use full viewport height (default). When false, fills parent (needs parent height). */
|
|
31
|
+
embedded?: boolean;
|
|
32
|
+
/** Override the large title in the header (preset name by default). */
|
|
33
|
+
documentTitle?: string;
|
|
34
|
+
/** Hide the document title row but keep action buttons (useful inside a floating window shell). */
|
|
35
|
+
hideDocumentTitle?: boolean;
|
|
36
|
+
/** Called when user clicks Copy JSON (also copies to clipboard when available). */
|
|
37
|
+
onExport?: (payload: {
|
|
38
|
+
elements: ElementData[];
|
|
39
|
+
json: string;
|
|
40
|
+
}) => void;
|
|
41
|
+
}
|
|
42
|
+
interface EditorRef {
|
|
43
|
+
getData: () => ElementData[];
|
|
44
|
+
setData: (elements: ElementData[]) => void;
|
|
45
|
+
clear: () => void;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
declare const Editor: React.ForwardRefExoticComponent<EditorProps & React.RefAttributes<EditorRef>>;
|
|
49
|
+
|
|
50
|
+
type WindowPosition = "top-left" | "top-right" | "bottom-left" | "bottom-right" | "center";
|
|
51
|
+
type EditorWindowMode = "floating" | "inline";
|
|
52
|
+
interface EditorWindowProps extends EditorProps {
|
|
53
|
+
mode?: EditorWindowMode;
|
|
54
|
+
/** Floating window title (shell bar). */
|
|
55
|
+
title?: string;
|
|
56
|
+
startMinimized?: boolean;
|
|
57
|
+
position?: WindowPosition;
|
|
58
|
+
/** Inline / floating panel size (CSS length). */
|
|
59
|
+
width?: string;
|
|
60
|
+
height?: string;
|
|
61
|
+
/** Fired when the user clicks the shell minimize control (floating mode). */
|
|
62
|
+
onShellMinimize?: () => void;
|
|
63
|
+
/** Fired when the user clicks the shell maximize control (floating mode). */
|
|
64
|
+
onShellMaximize?: () => void;
|
|
65
|
+
/** Fired when the user clicks the shell close control (floating mode). */
|
|
66
|
+
onShellClose?: () => void;
|
|
67
|
+
}
|
|
68
|
+
interface EditorWindowRef extends EditorRef {
|
|
69
|
+
minimize: () => void;
|
|
70
|
+
maximize: () => void;
|
|
71
|
+
restore: () => void;
|
|
72
|
+
close: () => void;
|
|
73
|
+
open: () => void;
|
|
74
|
+
}
|
|
75
|
+
declare const EditorWindow: React.ForwardRefExoticComponent<EditorWindowProps & React.RefAttributes<EditorWindowRef>>;
|
|
76
|
+
|
|
77
|
+
export { Editor, type EditorProps, EditorWindow, type EditorWindowMode, type EditorWindowProps, type EditorWindowRef, Preset, type WindowPosition, presets };
|
package/dist/editor.d.ts
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { P as Preset, a as ElementData, T as ToolCategory } from './types-BTYLCn9x.js';
|
|
3
|
+
|
|
4
|
+
declare const presets: {
|
|
5
|
+
mechanics: Preset;
|
|
6
|
+
circuit: Preset;
|
|
7
|
+
thermo: Preset;
|
|
8
|
+
optical: Preset;
|
|
9
|
+
magnetism: Preset;
|
|
10
|
+
light: Preset;
|
|
11
|
+
waves: Preset;
|
|
12
|
+
waveOscillation: Preset;
|
|
13
|
+
rotation: Preset;
|
|
14
|
+
graph: Preset;
|
|
15
|
+
electrostatics: Preset;
|
|
16
|
+
chemistry: Preset;
|
|
17
|
+
mechanical: Preset;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
interface EditorProps {
|
|
21
|
+
initialElements?: ElementData[];
|
|
22
|
+
toolCategories?: ToolCategory[];
|
|
23
|
+
preset?: keyof typeof presets;
|
|
24
|
+
/** Enable built-in preset switcher in the header. */
|
|
25
|
+
enablePresetSwitch?: boolean;
|
|
26
|
+
/** Notifies when user selects a different preset from header switcher. */
|
|
27
|
+
onPresetChange?: (preset: keyof typeof presets) => void;
|
|
28
|
+
onChange?: (elements: ElementData[]) => void;
|
|
29
|
+
viewMode?: boolean;
|
|
30
|
+
/** Use full viewport height (default). When false, fills parent (needs parent height). */
|
|
31
|
+
embedded?: boolean;
|
|
32
|
+
/** Override the large title in the header (preset name by default). */
|
|
33
|
+
documentTitle?: string;
|
|
34
|
+
/** Hide the document title row but keep action buttons (useful inside a floating window shell). */
|
|
35
|
+
hideDocumentTitle?: boolean;
|
|
36
|
+
/** Called when user clicks Copy JSON (also copies to clipboard when available). */
|
|
37
|
+
onExport?: (payload: {
|
|
38
|
+
elements: ElementData[];
|
|
39
|
+
json: string;
|
|
40
|
+
}) => void;
|
|
41
|
+
}
|
|
42
|
+
interface EditorRef {
|
|
43
|
+
getData: () => ElementData[];
|
|
44
|
+
setData: (elements: ElementData[]) => void;
|
|
45
|
+
clear: () => void;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
declare const Editor: React.ForwardRefExoticComponent<EditorProps & React.RefAttributes<EditorRef>>;
|
|
49
|
+
|
|
50
|
+
type WindowPosition = "top-left" | "top-right" | "bottom-left" | "bottom-right" | "center";
|
|
51
|
+
type EditorWindowMode = "floating" | "inline";
|
|
52
|
+
interface EditorWindowProps extends EditorProps {
|
|
53
|
+
mode?: EditorWindowMode;
|
|
54
|
+
/** Floating window title (shell bar). */
|
|
55
|
+
title?: string;
|
|
56
|
+
startMinimized?: boolean;
|
|
57
|
+
position?: WindowPosition;
|
|
58
|
+
/** Inline / floating panel size (CSS length). */
|
|
59
|
+
width?: string;
|
|
60
|
+
height?: string;
|
|
61
|
+
/** Fired when the user clicks the shell minimize control (floating mode). */
|
|
62
|
+
onShellMinimize?: () => void;
|
|
63
|
+
/** Fired when the user clicks the shell maximize control (floating mode). */
|
|
64
|
+
onShellMaximize?: () => void;
|
|
65
|
+
/** Fired when the user clicks the shell close control (floating mode). */
|
|
66
|
+
onShellClose?: () => void;
|
|
67
|
+
}
|
|
68
|
+
interface EditorWindowRef extends EditorRef {
|
|
69
|
+
minimize: () => void;
|
|
70
|
+
maximize: () => void;
|
|
71
|
+
restore: () => void;
|
|
72
|
+
close: () => void;
|
|
73
|
+
open: () => void;
|
|
74
|
+
}
|
|
75
|
+
declare const EditorWindow: React.ForwardRefExoticComponent<EditorWindowProps & React.RefAttributes<EditorWindowRef>>;
|
|
76
|
+
|
|
77
|
+
export { Editor, type EditorProps, EditorWindow, type EditorWindowMode, type EditorWindowProps, type EditorWindowRef, Preset, type WindowPosition, presets };
|