@markup-canvas/core 1.0.3 → 1.0.4
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/index.d.ts +1 -0
- package/dist/lib/config/presets/editor-preset.d.ts +2 -0
- package/dist/lib/config/presets/index.d.ts +1 -0
- package/dist/markup-canvas.cjs.js +49 -1
- package/dist/markup-canvas.esm.js +49 -2
- package/dist/markup-canvas.umd.js +1 -1
- package/package.json +1 -1
- package/src/index.ts +1 -0
- package/src/lib/config/presets/editor-preset.ts +56 -0
- package/src/lib/config/presets/index.ts +1 -0
package/dist/index.d.ts
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
|
+
export { EDITOR_PRESET } from "./lib/config/presets";
|
|
1
2
|
export { MarkupCanvas, MarkupCanvas as default } from "./lib/MarkupCanvas.js";
|
|
2
3
|
export type { BaseCanvas, Canvas, CanvasBounds, CanvasOptions, GestureInfo, MarkupCanvasConfig, MarkupCanvasEvents, MouseDragControls, Point, RulerCanvas, RulerOptions, RulerSystem, TouchState, Transform, ZoomBoundaryOptions, ZoomBoundaryResult, } from "./types/index.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { EDITOR_PRESET } from "./editor-preset.js";
|
|
@@ -1,12 +1,59 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Markup Canvas
|
|
3
3
|
* High-performance markup canvas with zoom and pan capabilities
|
|
4
|
-
* @version 1.0.
|
|
4
|
+
* @version 1.0.4
|
|
5
5
|
*/
|
|
6
6
|
'use strict';
|
|
7
7
|
|
|
8
8
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
9
9
|
|
|
10
|
+
const EDITOR_PRESET = {
|
|
11
|
+
// Canvas dimensions
|
|
12
|
+
width: 4000,
|
|
13
|
+
height: 4000,
|
|
14
|
+
enableAcceleration: true,
|
|
15
|
+
// Interaction controls
|
|
16
|
+
enableZoom: true,
|
|
17
|
+
enablePan: true,
|
|
18
|
+
enableTouch: true,
|
|
19
|
+
enableKeyboard: false,
|
|
20
|
+
limitKeyboardEventsToCanvas: false,
|
|
21
|
+
// Zoom behavior
|
|
22
|
+
zoomSpeed: 1.5,
|
|
23
|
+
minZoom: 0.05,
|
|
24
|
+
maxZoom: 80,
|
|
25
|
+
enableTransition: false,
|
|
26
|
+
transitionDuration: 0.2,
|
|
27
|
+
enableAdaptiveSpeed: true,
|
|
28
|
+
// Pan behavior
|
|
29
|
+
enableLeftDrag: true,
|
|
30
|
+
enableMiddleDrag: true,
|
|
31
|
+
requireSpaceForMouseDrag: true,
|
|
32
|
+
// Keyboard behavior
|
|
33
|
+
keyboardPanStep: 50,
|
|
34
|
+
keyboardFastMultiplier: 20,
|
|
35
|
+
keyboardZoomStep: 0.2,
|
|
36
|
+
// Click-to-zoom
|
|
37
|
+
enableClickToZoom: true,
|
|
38
|
+
clickZoomLevel: 1.0,
|
|
39
|
+
requireOptionForClickZoom: true,
|
|
40
|
+
// Visual elements
|
|
41
|
+
enableRulers: true,
|
|
42
|
+
enableGrid: false,
|
|
43
|
+
gridColor: "rgba(0, 123, 255, 0.1)",
|
|
44
|
+
// Ruler styling
|
|
45
|
+
rulerBackgroundColor: "rgba(255, 255, 255, 0.4)",
|
|
46
|
+
rulerBorderColor: "#ddd",
|
|
47
|
+
rulerTextColor: "oklch(70.5% 0.015 286.067)",
|
|
48
|
+
rulerMajorTickColor: "oklch(87.1% 0.006 286.286)",
|
|
49
|
+
rulerMinorTickColor: "oklch(92% 0.004 286.32)",
|
|
50
|
+
rulerFontSize: 8,
|
|
51
|
+
rulerFontFamily: "Monaco, Menlo, monospace",
|
|
52
|
+
rulerUnits: "px",
|
|
53
|
+
// Callbacks
|
|
54
|
+
onTransformUpdate: () => { },
|
|
55
|
+
};
|
|
56
|
+
|
|
10
57
|
// Default transform values
|
|
11
58
|
const DEFAULT_ZOOM = 1.0;
|
|
12
59
|
// Validation thresholds
|
|
@@ -1996,5 +2043,6 @@ class MarkupCanvas {
|
|
|
1996
2043
|
}
|
|
1997
2044
|
}
|
|
1998
2045
|
|
|
2046
|
+
exports.EDITOR_PRESET = EDITOR_PRESET;
|
|
1999
2047
|
exports.MarkupCanvas = MarkupCanvas;
|
|
2000
2048
|
exports.default = MarkupCanvas;
|
|
@@ -1,8 +1,55 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Markup Canvas
|
|
3
3
|
* High-performance markup canvas with zoom and pan capabilities
|
|
4
|
-
* @version 1.0.
|
|
4
|
+
* @version 1.0.4
|
|
5
5
|
*/
|
|
6
|
+
const EDITOR_PRESET = {
|
|
7
|
+
// Canvas dimensions
|
|
8
|
+
width: 4000,
|
|
9
|
+
height: 4000,
|
|
10
|
+
enableAcceleration: true,
|
|
11
|
+
// Interaction controls
|
|
12
|
+
enableZoom: true,
|
|
13
|
+
enablePan: true,
|
|
14
|
+
enableTouch: true,
|
|
15
|
+
enableKeyboard: false,
|
|
16
|
+
limitKeyboardEventsToCanvas: false,
|
|
17
|
+
// Zoom behavior
|
|
18
|
+
zoomSpeed: 1.5,
|
|
19
|
+
minZoom: 0.05,
|
|
20
|
+
maxZoom: 80,
|
|
21
|
+
enableTransition: false,
|
|
22
|
+
transitionDuration: 0.2,
|
|
23
|
+
enableAdaptiveSpeed: true,
|
|
24
|
+
// Pan behavior
|
|
25
|
+
enableLeftDrag: true,
|
|
26
|
+
enableMiddleDrag: true,
|
|
27
|
+
requireSpaceForMouseDrag: true,
|
|
28
|
+
// Keyboard behavior
|
|
29
|
+
keyboardPanStep: 50,
|
|
30
|
+
keyboardFastMultiplier: 20,
|
|
31
|
+
keyboardZoomStep: 0.2,
|
|
32
|
+
// Click-to-zoom
|
|
33
|
+
enableClickToZoom: true,
|
|
34
|
+
clickZoomLevel: 1.0,
|
|
35
|
+
requireOptionForClickZoom: true,
|
|
36
|
+
// Visual elements
|
|
37
|
+
enableRulers: true,
|
|
38
|
+
enableGrid: false,
|
|
39
|
+
gridColor: "rgba(0, 123, 255, 0.1)",
|
|
40
|
+
// Ruler styling
|
|
41
|
+
rulerBackgroundColor: "rgba(255, 255, 255, 0.4)",
|
|
42
|
+
rulerBorderColor: "#ddd",
|
|
43
|
+
rulerTextColor: "oklch(70.5% 0.015 286.067)",
|
|
44
|
+
rulerMajorTickColor: "oklch(87.1% 0.006 286.286)",
|
|
45
|
+
rulerMinorTickColor: "oklch(92% 0.004 286.32)",
|
|
46
|
+
rulerFontSize: 8,
|
|
47
|
+
rulerFontFamily: "Monaco, Menlo, monospace",
|
|
48
|
+
rulerUnits: "px",
|
|
49
|
+
// Callbacks
|
|
50
|
+
onTransformUpdate: () => { },
|
|
51
|
+
};
|
|
52
|
+
|
|
6
53
|
// Default transform values
|
|
7
54
|
const DEFAULT_ZOOM = 1.0;
|
|
8
55
|
// Validation thresholds
|
|
@@ -1992,4 +2039,4 @@ class MarkupCanvas {
|
|
|
1992
2039
|
}
|
|
1993
2040
|
}
|
|
1994
2041
|
|
|
1995
|
-
export { MarkupCanvas, MarkupCanvas as default };
|
|
2042
|
+
export { EDITOR_PRESET, MarkupCanvas, MarkupCanvas as default };
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import type { MarkupCanvasConfig } from "@/types";
|
|
2
|
+
|
|
3
|
+
export const EDITOR_PRESET: Required<MarkupCanvasConfig> = {
|
|
4
|
+
// Canvas dimensions
|
|
5
|
+
width: 4000,
|
|
6
|
+
height: 4000,
|
|
7
|
+
enableAcceleration: true,
|
|
8
|
+
|
|
9
|
+
// Interaction controls
|
|
10
|
+
enableZoom: true,
|
|
11
|
+
enablePan: true,
|
|
12
|
+
enableTouch: true,
|
|
13
|
+
enableKeyboard: false,
|
|
14
|
+
limitKeyboardEventsToCanvas: false,
|
|
15
|
+
|
|
16
|
+
// Zoom behavior
|
|
17
|
+
zoomSpeed: 1.5,
|
|
18
|
+
minZoom: 0.05,
|
|
19
|
+
maxZoom: 80,
|
|
20
|
+
enableTransition: false,
|
|
21
|
+
transitionDuration: 0.2,
|
|
22
|
+
enableAdaptiveSpeed: true,
|
|
23
|
+
|
|
24
|
+
// Pan behavior
|
|
25
|
+
enableLeftDrag: true,
|
|
26
|
+
enableMiddleDrag: true,
|
|
27
|
+
requireSpaceForMouseDrag: true,
|
|
28
|
+
|
|
29
|
+
// Keyboard behavior
|
|
30
|
+
keyboardPanStep: 50,
|
|
31
|
+
keyboardFastMultiplier: 20,
|
|
32
|
+
keyboardZoomStep: 0.2,
|
|
33
|
+
|
|
34
|
+
// Click-to-zoom
|
|
35
|
+
enableClickToZoom: true,
|
|
36
|
+
clickZoomLevel: 1.0,
|
|
37
|
+
requireOptionForClickZoom: true,
|
|
38
|
+
|
|
39
|
+
// Visual elements
|
|
40
|
+
enableRulers: true,
|
|
41
|
+
enableGrid: false,
|
|
42
|
+
gridColor: "rgba(0, 123, 255, 0.1)",
|
|
43
|
+
|
|
44
|
+
// Ruler styling
|
|
45
|
+
rulerBackgroundColor: "rgba(255, 255, 255, 0.4)",
|
|
46
|
+
rulerBorderColor: "#ddd",
|
|
47
|
+
rulerTextColor: "oklch(70.5% 0.015 286.067)",
|
|
48
|
+
rulerMajorTickColor: "oklch(87.1% 0.006 286.286)",
|
|
49
|
+
rulerMinorTickColor: "oklch(92% 0.004 286.32)",
|
|
50
|
+
rulerFontSize: 8,
|
|
51
|
+
rulerFontFamily: "Monaco, Menlo, monospace",
|
|
52
|
+
rulerUnits: "px",
|
|
53
|
+
|
|
54
|
+
// Callbacks
|
|
55
|
+
onTransformUpdate: () => {},
|
|
56
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { EDITOR_PRESET } from "./editor-preset.js";
|