Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

js-draw

Package Overview
Dependencies
Maintainers
1
Versions
119
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

js-draw - npm Package Compare versions

Comparing version 0.0.7 to 0.0.8

dist/src/htmlUtil.d.ts

3

CHANGELOG.md
# 0.0.8
* Map `ctrl+z` to undo, `ctrl+shift+Z` to redo.
# 0.0.7

@@ -3,0 +6,0 @@ * Preserve SVG global attributes when loading/saving images.

4

dist/src/EditorImage.d.ts

@@ -18,4 +18,4 @@ import Editor from './Editor';

new (element: AbstractComponent, applyByFlattening?: boolean): {
readonly "__#679@#element": AbstractComponent;
"__#679@#applyByFlattening": boolean;
readonly "__#2@#element": AbstractComponent;
"__#2@#applyByFlattening": boolean;
apply(editor: Editor): void;

@@ -22,0 +22,0 @@ unapply(editor: Editor): void;

@@ -9,6 +9,6 @@ import { PointerEvtListener, WheelEvt, PointerEvt, EditorNotifier, KeyPressEvent } from '../types';

private group;
abstract onPointerDown(event: PointerEvt): boolean;
abstract onPointerMove(event: PointerEvt): void;
abstract onPointerUp(event: PointerEvt): void;
abstract onGestureCancel(): void;
onPointerDown(_event: PointerEvt): boolean;
onPointerMove(_event: PointerEvt): void;
onPointerUp(_event: PointerEvt): void;
onGestureCancel(): void;
abstract readonly kind: ToolType;

@@ -15,0 +15,0 @@ protected constructor(notifier: EditorNotifier, description: string);

@@ -7,2 +7,3 @@ export interface ToolLocalization {

twoFingerPanZoomTool: string;
undoRedoTool: string;
toolEnabledAnnouncement: (toolName: string) => string;

@@ -9,0 +10,0 @@ toolDisabledAnnouncement: (toolName: string) => string;

@@ -10,3 +10,4 @@ import { InputEvt } from '../types';

Eraser = 3,
PanZoom = 4
PanZoom = 4,
UndoRedoShortcut = 5
}

@@ -13,0 +14,0 @@ export default class ToolController {

@@ -32,2 +32,3 @@ import EventDispatcher from './EventDispatcher';

readonly key: string;
readonly ctrlKey: boolean;
}

@@ -34,0 +35,0 @@ export interface GestureCancelEvt {

@@ -16,3 +16,5 @@ import Editor from './Editor';

redo(): void;
get undoStackSize(): number;
get redoStackSize(): number;
}
export default UndoRedoHistory;

@@ -13,3 +13,3 @@ import { CommandLocalization } from './commands/localization';

new (transform: Mat33): {
readonly "__#678@#inverseTransform": Mat33;
readonly "__#1@#inverseTransform": Mat33;
readonly transform: Mat33;

@@ -16,0 +16,0 @@ apply(editor: Editor): void;

{
"name": "js-draw",
"version": "0.0.7",
"version": "0.0.8",
"description": "Draw pictures using a pen, touchscreen, or mouse! JS-draw is a drawing library for JavaScript and TypeScript. ",

@@ -5,0 +5,0 @@ "main": "dist/src/Editor.js",

@@ -241,2 +241,3 @@

key: evt.key,
ctrlKey: evt.ctrlKey,
})) {

@@ -451,3 +452,2 @@ evt.preventDefault();

result.setAttribute('height', `${rect.h}`);
console.log('res', result);

@@ -454,0 +454,0 @@ // Ensure the image can be identified as an SVG if downloaded.

@@ -8,9 +8,6 @@ /* @jest-environment jsdom */

import Color4 from './Color4';
import Editor from './Editor';
import { RenderingMode } from './Display';
import DummyRenderer from './rendering/DummyRenderer';
import { RenderingStyle } from './rendering/AbstractRenderer';
import createEditor from './testing/createEditor';
const createEditor = () => new Editor(document.body, { renderingMode: RenderingMode.DummyRenderer });
describe('EditorImage', () => {

@@ -17,0 +14,0 @@ const testStroke = new Stroke([

@@ -9,6 +9,7 @@ import { PointerEvtListener, WheelEvt, PointerEvt, EditorNotifier, EditorEventType, KeyPressEvent } from '../types';

public abstract onPointerDown(event: PointerEvt): boolean;
public abstract onPointerMove(event: PointerEvt): void;
public abstract onPointerUp(event: PointerEvt): void;
public abstract onGestureCancel(): void;
public onPointerDown(_event: PointerEvt): boolean { return false; }
public onPointerMove(_event: PointerEvt) { }
public onPointerUp(_event: PointerEvt) { }
public onGestureCancel() { }
public abstract readonly kind: ToolType;

@@ -15,0 +16,0 @@

@@ -8,2 +8,3 @@

twoFingerPanZoomTool: string;
undoRedoTool: string;

@@ -20,2 +21,3 @@ toolEnabledAnnouncement: (toolName: string) => string;

twoFingerPanZoomTool: 'Panning and Zooming',
undoRedoTool: 'Undo/Redo',

@@ -22,0 +24,0 @@ toolEnabledAnnouncement: (toolName) => `${toolName} enabled`,

@@ -11,2 +11,3 @@ import { InputEvtType, InputEvt, EditorEventType } from '../types';

import { ToolLocalization } from './localization';
import UndoRedoShortcut from './UndoRedoShortcut';

@@ -19,2 +20,3 @@ export enum ToolType {

PanZoom,
UndoRedoShortcut,
}

@@ -45,2 +47,3 @@

new PanZoom(editor, PanZoomMode.TwoFingerGestures | PanZoomMode.AnyDevice, localization.twoFingerPanZoomTool),
new UndoRedoShortcut(editor),
];

@@ -47,0 +50,0 @@ primaryTools.forEach(tool => tool.setToolGroup(primaryToolEnabledGroup));

@@ -49,2 +49,3 @@ // Types related to the image editor

readonly key: string;
readonly ctrlKey: boolean;
}

@@ -51,0 +52,0 @@

@@ -59,4 +59,12 @@ import Editor from './Editor';

}
public get undoStackSize(): number {
return this.undoStack.length;
}
public get redoStackSize(): number {
return this.redoStack.length;
}
}
export default UndoRedoHistory;
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc