@fieldnotes/core 0.2.1 → 0.2.3
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.cjs +6 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +6 -1
- package/dist/index.js.map +1 -1
- package/package.json +18 -1
package/dist/index.d.cts
CHANGED
|
@@ -365,6 +365,7 @@ declare class Viewport {
|
|
|
365
365
|
private hitTestWorld;
|
|
366
366
|
private startInteracting;
|
|
367
367
|
stopInteracting(): void;
|
|
368
|
+
private onInteractNodePointerDown;
|
|
368
369
|
private onInteractKeyDown;
|
|
369
370
|
private onInteractPointerDown;
|
|
370
371
|
private onDragOver;
|
|
@@ -614,6 +615,6 @@ declare class ImageTool implements Tool {
|
|
|
614
615
|
onPointerUp(state: PointerState, ctx: ToolContext): void;
|
|
615
616
|
}
|
|
616
617
|
|
|
617
|
-
declare const VERSION = "0.2.
|
|
618
|
+
declare const VERSION = "0.2.3";
|
|
618
619
|
|
|
619
620
|
export { AddElementCommand, type ArrowElement, ArrowTool, type ArrowToolOptions, AutoSave, type AutoSaveOptions, Background, type BackgroundOptions, type BackgroundPattern, BatchCommand, type Bounds, Camera, type CameraOptions, type CanvasElement, type CanvasState, type Command, ElementRenderer, ElementStore, type ElementType, type ElementUpdateEvent, EraserTool, type EraserToolOptions, EventBus, HandTool, HistoryRecorder, HistoryStack, type HistoryStackOptions, type HtmlElement, type ImageElement, ImageTool, type ImageToolOptions, InputHandler, NoteEditor, type NoteElement, NoteTool, type NoteToolOptions, PencilTool, type PencilToolOptions, type Point, type PointerState, RemoveElementCommand, SelectTool, type Size, type StrokeElement, type StrokePoint, type Tool, type ToolContext, ToolManager, type ToolName, UpdateElementCommand, VERSION, Viewport, type ViewportOptions, createArrow, createHtmlElement, createId, createImage, createNote, createStroke, exportState, getArrowBounds, getArrowControlPoint, getArrowMidpoint, getArrowTangentAngle, getBendFromPoint, isNearBezier, parseState };
|
package/dist/index.d.ts
CHANGED
|
@@ -365,6 +365,7 @@ declare class Viewport {
|
|
|
365
365
|
private hitTestWorld;
|
|
366
366
|
private startInteracting;
|
|
367
367
|
stopInteracting(): void;
|
|
368
|
+
private onInteractNodePointerDown;
|
|
368
369
|
private onInteractKeyDown;
|
|
369
370
|
private onInteractPointerDown;
|
|
370
371
|
private onDragOver;
|
|
@@ -614,6 +615,6 @@ declare class ImageTool implements Tool {
|
|
|
614
615
|
onPointerUp(state: PointerState, ctx: ToolContext): void;
|
|
615
616
|
}
|
|
616
617
|
|
|
617
|
-
declare const VERSION = "0.2.
|
|
618
|
+
declare const VERSION = "0.2.3";
|
|
618
619
|
|
|
619
620
|
export { AddElementCommand, type ArrowElement, ArrowTool, type ArrowToolOptions, AutoSave, type AutoSaveOptions, Background, type BackgroundOptions, type BackgroundPattern, BatchCommand, type Bounds, Camera, type CameraOptions, type CanvasElement, type CanvasState, type Command, ElementRenderer, ElementStore, type ElementType, type ElementUpdateEvent, EraserTool, type EraserToolOptions, EventBus, HandTool, HistoryRecorder, HistoryStack, type HistoryStackOptions, type HtmlElement, type ImageElement, ImageTool, type ImageToolOptions, InputHandler, NoteEditor, type NoteElement, NoteTool, type NoteToolOptions, PencilTool, type PencilToolOptions, type Point, type PointerState, RemoveElementCommand, SelectTool, type Size, type StrokeElement, type StrokePoint, type Tool, type ToolContext, ToolManager, type ToolName, UpdateElementCommand, VERSION, Viewport, type ViewportOptions, createArrow, createHtmlElement, createId, createImage, createNote, createStroke, exportState, getArrowBounds, getArrowControlPoint, getArrowMidpoint, getArrowTangentAngle, getBendFromPoint, isNearBezier, parseState };
|
package/dist/index.js
CHANGED
|
@@ -1444,6 +1444,7 @@ var Viewport = class {
|
|
|
1444
1444
|
if (!node) return;
|
|
1445
1445
|
this.interactingElementId = id;
|
|
1446
1446
|
node.style.pointerEvents = "auto";
|
|
1447
|
+
node.addEventListener("pointerdown", this.onInteractNodePointerDown);
|
|
1447
1448
|
window.addEventListener("keydown", this.onInteractKeyDown);
|
|
1448
1449
|
window.addEventListener("pointerdown", this.onInteractPointerDown);
|
|
1449
1450
|
}
|
|
@@ -1452,11 +1453,15 @@ var Viewport = class {
|
|
|
1452
1453
|
const node = this.domNodes.get(this.interactingElementId);
|
|
1453
1454
|
if (node) {
|
|
1454
1455
|
node.style.pointerEvents = "none";
|
|
1456
|
+
node.removeEventListener("pointerdown", this.onInteractNodePointerDown);
|
|
1455
1457
|
}
|
|
1456
1458
|
this.interactingElementId = null;
|
|
1457
1459
|
window.removeEventListener("keydown", this.onInteractKeyDown);
|
|
1458
1460
|
window.removeEventListener("pointerdown", this.onInteractPointerDown);
|
|
1459
1461
|
}
|
|
1462
|
+
onInteractNodePointerDown = (e) => {
|
|
1463
|
+
e.stopPropagation();
|
|
1464
|
+
};
|
|
1460
1465
|
onInteractKeyDown = (e) => {
|
|
1461
1466
|
if (e.key === "Escape") {
|
|
1462
1467
|
this.stopInteracting();
|
|
@@ -2357,7 +2362,7 @@ var ImageTool = class {
|
|
|
2357
2362
|
};
|
|
2358
2363
|
|
|
2359
2364
|
// src/index.ts
|
|
2360
|
-
var VERSION = "0.2.
|
|
2365
|
+
var VERSION = "0.2.3";
|
|
2361
2366
|
export {
|
|
2362
2367
|
AddElementCommand,
|
|
2363
2368
|
ArrowTool,
|