slate-angular 1.7.5 → 1.8.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/bundles/slate-angular.umd.js +109 -40
- package/bundles/slate-angular.umd.js.map +1 -1
- package/components/editable/editable.component.d.ts +1 -1
- package/esm2015/components/editable/editable.component.js +10 -14
- package/esm2015/plugins/angular-editor.js +24 -21
- package/esm2015/plugins/with-angular.js +23 -8
- package/esm2015/utils/dom.js +28 -1
- package/esm2015/utils/environment.js +20 -1
- package/fesm2015/slate-angular.js +100 -40
- package/fesm2015/slate-angular.js.map +1 -1
- package/package.json +1 -1
- package/plugins/angular-editor.d.ts +14 -4
- package/utils/dom.d.ts +6 -0
- package/utils/environment.d.ts +6 -0
package/package.json
CHANGED
|
@@ -9,7 +9,9 @@ import { Key } from '../utils/key';
|
|
|
9
9
|
*/
|
|
10
10
|
export interface AngularEditor extends BaseEditor {
|
|
11
11
|
insertData: (data: DataTransfer) => void;
|
|
12
|
-
|
|
12
|
+
insertFragmentData: (data: DataTransfer) => boolean;
|
|
13
|
+
insertTextData: (data: DataTransfer) => boolean;
|
|
14
|
+
setFragmentData: (data: DataTransfer, originEvent?: 'drag' | 'copy' | 'cut') => void;
|
|
13
15
|
deleteCutData: () => void;
|
|
14
16
|
onKeydown: (event: KeyboardEvent) => void;
|
|
15
17
|
onClick: (event: MouseEvent) => void;
|
|
@@ -36,8 +38,8 @@ export declare const AngularEditor: {
|
|
|
36
38
|
*/
|
|
37
39
|
findPath(editor: AngularEditor, node: Node): Path;
|
|
38
40
|
/**
|
|
39
|
-
|
|
40
|
-
|
|
41
|
+
* Find the DOM node that implements DocumentOrShadowRoot for the editor.
|
|
42
|
+
*/
|
|
41
43
|
findDocumentOrShadowRoot(editor: AngularEditor): Document | ShadowRoot;
|
|
42
44
|
/**
|
|
43
45
|
* Check if the editor is focused.
|
|
@@ -73,6 +75,14 @@ export declare const AngularEditor: {
|
|
|
73
75
|
* Insert data from a `DataTransfer` into the editor.
|
|
74
76
|
*/
|
|
75
77
|
insertData(editor: AngularEditor, data: DataTransfer): void;
|
|
78
|
+
/**
|
|
79
|
+
* Insert fragment data from a `DataTransfer` into the editor.
|
|
80
|
+
*/
|
|
81
|
+
insertFragmentData(editor: AngularEditor, data: DataTransfer): boolean;
|
|
82
|
+
/**
|
|
83
|
+
* Insert text data from a `DataTransfer` into the editor.
|
|
84
|
+
*/
|
|
85
|
+
insertTextData(editor: AngularEditor, data: DataTransfer): boolean;
|
|
76
86
|
/**
|
|
77
87
|
* onKeydown hook.
|
|
78
88
|
*/
|
|
@@ -84,7 +94,7 @@ export declare const AngularEditor: {
|
|
|
84
94
|
/**
|
|
85
95
|
* Sets data from the currently selected fragment on a `DataTransfer`.
|
|
86
96
|
*/
|
|
87
|
-
setFragmentData(editor: AngularEditor, data: DataTransfer): void;
|
|
97
|
+
setFragmentData(editor: AngularEditor, data: DataTransfer, originEvent?: 'drag' | 'copy' | 'cut'): void;
|
|
88
98
|
deleteCutData(editor: AngularEditor): void;
|
|
89
99
|
/**
|
|
90
100
|
* Find the native DOM element from a Slate node.
|
package/utils/dom.d.ts
CHANGED
|
@@ -70,3 +70,9 @@ export declare const getEditableChild: (parent: DOMElement, index: number, direc
|
|
|
70
70
|
* The domNode must be attached to the DOM.
|
|
71
71
|
*/
|
|
72
72
|
export declare const getPlainText: (domNode: DOMNode) => string;
|
|
73
|
+
export declare const getSlateFragmentAttribute: (dataTransfer: DataTransfer) => string | void;
|
|
74
|
+
/**
|
|
75
|
+
* Get the x-slate-fragment attribute that exist in text/html data
|
|
76
|
+
* and append it to the DataTransfer object
|
|
77
|
+
*/
|
|
78
|
+
export declare const getClipboardData: (dataTransfer: DataTransfer, clipboardFormatKey?: string) => DataTransfer;
|
package/utils/environment.d.ts
CHANGED
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
export declare const IS_IOS: boolean;
|
|
2
2
|
export declare const IS_APPLE: boolean;
|
|
3
|
+
export declare const IS_ANDROID: boolean;
|
|
3
4
|
export declare const IS_FIREFOX: boolean;
|
|
4
5
|
export declare const IS_SAFARI: boolean;
|
|
5
6
|
export declare const IS_EDGE_LEGACY: boolean;
|
|
6
7
|
export declare const IS_CHROME: boolean;
|
|
7
8
|
export declare const IS_CHROME_LEGACY: boolean;
|
|
9
|
+
export declare const IS_FIREFOX_LEGACY: boolean;
|
|
10
|
+
export declare const IS_QQBROWSER: boolean;
|
|
11
|
+
export declare const IS_UC_MOBILE: boolean;
|
|
12
|
+
export declare const IS_WECHATBROWSER: boolean;
|
|
13
|
+
export declare const HAS_BEFORE_INPUT_SUPPORT: boolean;
|