@plait/core 0.56.0 → 0.56.2

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.
@@ -14,7 +14,7 @@ import { PathRef, PathRefOptions } from './path-ref';
14
14
  import { PlaitNode } from './node';
15
15
  import { Path } from './path';
16
16
  import { PlaitTheme, ThemeColor } from './theme';
17
- import { ClipboardData, WritableClipboardContext } from '../utils';
17
+ import { ClipboardData, WritableClipboardContext, WritableClipboardOperationType } from '../utils';
18
18
  export interface PlaitBoard {
19
19
  viewport: Viewport;
20
20
  children: PlaitElement[];
@@ -39,8 +39,8 @@ export interface PlaitBoard {
39
39
  keyDown: (event: KeyboardEvent) => void;
40
40
  globalKeyDown: (event: KeyboardEvent) => void;
41
41
  keyUp: (event: KeyboardEvent) => void;
42
- buildFragment: (clipboardContext: WritableClipboardContext | null, rectangle: RectangleClient | null, type: 'copy' | 'cut', originData?: PlaitElement[]) => WritableClipboardContext | null;
43
- insertFragment: (clipboardData: ClipboardData | null, targetPoint: Point) => void;
42
+ buildFragment: (clipboardContext: WritableClipboardContext | null, rectangle: RectangleClient | null, operationType: WritableClipboardOperationType, originData?: PlaitElement[]) => WritableClipboardContext | null;
43
+ insertFragment: (clipboardData: ClipboardData | null, targetPoint: Point, operationType?: WritableClipboardOperationType) => void;
44
44
  deleteFragment: (data: PlaitElement[]) => void;
45
45
  getDeletedFragment: (data: PlaitElement[]) => PlaitElement[];
46
46
  getRelatedFragment: (data: PlaitElement[], originData?: PlaitElement[]) => PlaitElement[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plait/core",
3
- "version": "0.56.0",
3
+ "version": "0.56.2",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^17.2.4",
6
6
  "@angular/core": "^17.2.4",
@@ -3,6 +3,12 @@ export declare enum WritableClipboardType {
3
3
  'medias' = "medias",
4
4
  'elements' = "elements"
5
5
  }
6
+ export declare enum WritableClipboardOperationType {
7
+ 'copy' = "copy",
8
+ 'cut' = "cut",
9
+ 'duplicate' = "duplicate",
10
+ 'paste' = "paste"
11
+ }
6
12
  export type WritableClipboardData = PlaitElement[] | any[];
7
13
  export interface WritableClipboardContext {
8
14
  text: string;
@@ -14,4 +20,5 @@ export interface ClipboardData {
14
20
  elements?: PlaitElement[];
15
21
  medias?: any[];
16
22
  text?: string;
23
+ operationType?: WritableClipboardOperationType;
17
24
  }
@@ -1,4 +1,5 @@
1
1
  import { PlaitBoard, PlaitElement, Point } from '../interfaces';
2
+ import { WritableClipboardOperationType } from './clipboard';
2
3
  export declare const deleteFragment: (board: PlaitBoard) => void;
3
- export declare const setFragment: (board: PlaitBoard, type: 'copy' | 'cut', clipboardData: DataTransfer | null) => void;
4
+ export declare const setFragment: (board: PlaitBoard, operationType: WritableClipboardOperationType, clipboardData: DataTransfer | null) => void;
4
5
  export declare const duplicateElements: (board: PlaitBoard, elements?: PlaitElement[], point?: Point) => void;