@ones-editor/editor 0.0.3-beta.71 → 0.0.3-beta.73

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/types.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { Embed, Box, i18n, OnesEditor, OnesEditorUser, OnesEditorUserPermission, OnesEditorBlockHook, OnesEditorCommandProvider, LogLevel } from '../@ones-editor/core';
1
+ import { Embed, Box, i18n, OnesEditor, OnesEditorUser, OnesEditorUserPermission, OnesEditorBlockHook, OnesEditorCommandProvider, LogLevel, ShortcutRecords } from '../@ones-editor/core';
2
2
  import { DrawIoOptions } from '../@ones-editor/drawio-embed';
3
3
  import { MermaidEmbedOptions } from '../@ones-editor/graph-embed';
4
4
  import { ImageOptions } from '../@ones-editor/image-embed';
@@ -56,6 +56,7 @@ export interface CreateOnesEditorOptions {
56
56
  blockHooks?: OnesEditorBlockHook[];
57
57
  commandProviders?: OnesEditorCommandProvider[];
58
58
  };
59
+ shortcuts?: ShortcutRecords[];
59
60
  componentsOptions?: EditorComponentOptions;
60
61
  }
61
62
  export interface CreateLocalEditorOptions {
@@ -64,7 +65,7 @@ export interface CreateLocalEditorOptions {
64
65
  scrollContainer?: HTMLElement;
65
66
  components?: {
66
67
  embeds?: Embed[];
67
- blockHooks: OnesEditorBlockHook[];
68
+ blockHooks?: OnesEditorBlockHook[];
68
69
  };
69
70
  serverUrl?: string;
70
71
  enableComments?: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ones-editor/editor",
3
- "version": "0.0.3-beta.71",
3
+ "version": "0.0.3-beta.73",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -12,8 +12,6 @@
12
12
  "blueimp-md5": "^2.19.0",
13
13
  "buffer": "^6.0.3",
14
14
  "css-color-converter": "^2.0.0",
15
- "cypress": "^12.3.0",
16
- "cypress-real-events": "^1.7.6",
17
15
  "docx": "^7.2.0",
18
16
  "dom-to-image": "^2.6.0",
19
17
  "events": "^3.3.0",
@@ -38,7 +36,6 @@
38
36
  "markmap-view": "0.2.2",
39
37
  "mermaid": "^9.1.0",
40
38
  "mime-db": "^1.52.0",
41
- "minimist": "^1.2.7",
42
39
  "nanoid": "^3.2.0",
43
40
  "ot-json1": "^1.0.2",
44
41
  "plantuml-encoder": "^1.4.0",
@@ -1,25 +0,0 @@
1
- /// <reference types="cypress" />
2
- /// <reference types="cypress" />
3
- declare namespace Cypress {
4
- interface Chainable {
5
- getBlocksByType: (blockType: string) => Chainable<Element>;
6
- clearAllNoteByKeyboard: () => void;
7
- getBlockContent: () => Chainable<Element>;
8
- getBlockContentByBlockId: (blockId: string) => Chainable<Element>;
9
- cacheBlock: (blockType: string, block: BlockCache) => Chainable<JQuery>;
10
- createHeadingByShortcut: (blockId: string, level: number, title: string) => Chainable<Element>;
11
- getMenuItemByDataId: (dataId: string) => Chainable<Element>;
12
- clickBlockMenuButton: (dataId: string) => Chainable<JQuery>;
13
- getBlockMenuButton: (dataId: string) => Chainable<JQuery>;
14
- checkTextStyle: (blockId: string, checkSpanIndex: number, expectedClassValue: string, expectedTextValue: string) => Chainable<JQuery>;
15
- checkTextColer: (blockId: string, checkSpanIndex: number, expectedClassValue: string, expectBlockAttr: string, expectBlockAttrValue: string, expectedTextValue: string) => Chainable<JQuery>;
16
- checkHeadingStyle: (blockId: string, expectBlockAttr: string, expectBlockAttrValue: string) => Chainable<JQuery>;
17
- }
18
- }
19
- interface BlockCache {
20
- TitleBlockId: string;
21
- BlockCacheMap: Map<string, string[]>;
22
- setBlock(blockType: string, blockId: string): void;
23
- getLastBlockId(blockType: string): string;
24
- setTitleBlockId(blockId: string): void;
25
- }
@@ -1 +0,0 @@
1
- import './commands';
@@ -1,3 +0,0 @@
1
- /// <reference types="cypress" />
2
- declare const _default: Cypress.ConfigOptions<any>;
3
- export default _default;
@@ -1,13 +0,0 @@
1
- {
2
- "name": "@ones-editor/e2e",
3
- "private": "true",
4
- "version": "1.0.0",
5
- "main": "index.ts",
6
- "license": "MIT",
7
- "scripts": {
8
- "test": "cypress open",
9
- "e2e-headless": "node ./scripts/e2e-run-tests.js",
10
- "test-mobile": "cypress open --config viewportWidth=390,viewportHeight=844"
11
- },
12
- "types": "src/index.d.ts"
13
- }
@@ -1,17 +0,0 @@
1
- import { BaseAssertion } from '../data';
2
- declare class Item {
3
- id: string;
4
- name: string;
5
- shortcut: string;
6
- constructor(id: string, name: string, shortcut: string);
7
- }
8
- export declare const items: Map<string, Item>;
9
- export declare class BlockMenuCase {
10
- /**
11
- * howToOpen : clickToOpen | shortcutToOpen:default
12
- * @returns null
13
- */
14
- checkBlockMenuItem: (howToOpen: string, block: string) => () => void;
15
- checkBlockMenuButton: (button: string, assertData: BaseAssertion) => () => void;
16
- }
17
- export {};
@@ -1 +0,0 @@
1
- import 'cypress-real-events';
@@ -1,131 +0,0 @@
1
- export declare class BlockCache {
2
- TitleBlockId: string;
3
- BlockCacheMap: Map<string, string[]>;
4
- constructor();
5
- setBlock(blockType: string, blockId: string): Map<string, string[]>;
6
- getLastBlockId(blockType: string): string;
7
- setTitleBlockId(blockId: string): void;
8
- }
9
- export declare class BaseAssertion {
10
- }
11
- export declare class TestHeadingStyleData extends BaseAssertion {
12
- key: string;
13
- inputStr: string;
14
- expected: string;
15
- expectedPlaceholder: string;
16
- constructor(key: string, inputStr: string, expected: string, expectedPlaceholder: string);
17
- }
18
- export declare class CheckBlockData extends BaseAssertion {
19
- expectBlockAttr: string;
20
- expectBlockAttrValue: string;
21
- constructor(expectBlockAttr: string, expectBlockAttrValue: string);
22
- }
23
- export declare class CheckTextStyleData extends BaseAssertion {
24
- checkSpanIndex: number;
25
- expectedClassValue: string;
26
- expectedTextValue: string;
27
- constructor(checkSpanIndex: number, expectedClassValue: string, expectedTextValue: string);
28
- }
29
- export declare class TestTextStyleData extends CheckTextStyleData {
30
- inputStr: string;
31
- constructor(inputStr: string, checkSpanIndex: number, expectedClassValue: string, expectedTextValue: string);
32
- }
33
- export declare class CheckTextColerData extends CheckTextStyleData {
34
- attr: string;
35
- attrValue: string;
36
- constructor(attr: string, attrValue: string, checkSpanIndex: number, expectedClassValue: string, expectedTextValue: string);
37
- }
38
- export declare const docTestBlockStyle = "block-style";
39
- export declare const blockCache: BlockCache;
40
- export declare const TEXT_BLOCK_ATTRIBUTE: {
41
- PLACE_HOLDER: {
42
- KEY: string;
43
- DEFAULT: string;
44
- HEADING1: string;
45
- HEADING2: string;
46
- HEADING3: string;
47
- HEADING4: string;
48
- HEADING5: string;
49
- HEADING6: string;
50
- HEADING7: string;
51
- HEADING8: string;
52
- };
53
- STYLE_HEADING: {
54
- KEY: string;
55
- };
56
- STYLE_QUOTE: {
57
- QUOTECLASSNAME: string;
58
- };
59
- STYLE_ALIGN: {
60
- ALIGN: string;
61
- };
62
- STYLE_COLER: {
63
- TC_COLER: string;
64
- BC_CLOER: string;
65
- };
66
- STYLE_TEXT: {
67
- BoldStyleClass: string;
68
- BoldAndItalicStyleClass: string;
69
- ItalicStyleClass: string;
70
- CodeStyleClass: string;
71
- StrikeThrough: string;
72
- SubscriptCLass: string;
73
- SuperscriptClass: string;
74
- };
75
- };
76
- export declare const LIST_BLOCK_ATTRIBUTE: {
77
- PLACE_HOLDER: {
78
- KEY: string;
79
- LIST: string;
80
- };
81
- LEVEL: string;
82
- START: string;
83
- GROUP_ID: string;
84
- LISTTYPE: string;
85
- VALUE: {
86
- LISTTYPE_ORDERED: string;
87
- LISTTYPE_UNORDERED: string;
88
- LISTTYPE_CHECKED: string;
89
- LISTTYPE_UNCHECKED: string;
90
- };
91
- };
92
- export declare const CODE_BLOCK_ATTRIBUTE: {
93
- DATA_LANGUAGE: string;
94
- LANGUAGE_PLAIN: string;
95
- LANGUAGE_GOLANG: string;
96
- LANGUAGE_JAVA: string;
97
- LANGUAGE_JAVASCRIPT: string;
98
- LANGUAGE_HTML_XML: string;
99
- };
100
- export declare const EMBED_BLOCK_ATTRIBUTE: {
101
- HR: {
102
- TYPE: string;
103
- CLASS: string;
104
- };
105
- MERMAID: {
106
- TYPE: string;
107
- EMPTY_TIPS: string;
108
- EMPTY_REPLACE: string;
109
- ARIA_EXPANDED: string;
110
- IMAGE_CLASS: string;
111
- };
112
- PLANTUML: {
113
- TYPE: string;
114
- EMPTY_TIPS: string;
115
- EMPTY_REPLACE: string;
116
- ARIA_EXPANDED: string;
117
- IMAGE_CLASS: string;
118
- };
119
- TOC: {
120
- TYPE: string;
121
- CONTAINER_CLASS: string;
122
- EMPTY_REPLACE: string;
123
- EMPTY_CLASS: string;
124
- };
125
- };
126
- export declare class TocNode {
127
- children: TocNode[];
128
- title: string;
129
- level: number;
130
- block: string;
131
- }
@@ -1,10 +0,0 @@
1
- import { TestHeadingStyleData, TestTextStyleData } from '../data';
2
- export declare class ShortcutCase {
3
- testHeadingStyleShortcut: (data: TestHeadingStyleData) => () => void;
4
- testShortcutMethod: (data: TestTextStyleData) => () => void;
5
- testQuoteBlockStyleShortcut: () => () => void;
6
- testEmberStyleBrShortcut: () => () => void;
7
- testEmberStyleMermaidPlantumlShortcut: (input: string, embedType: string, emptyReplace: string) => () => void;
8
- testListBlockStyleShortcut: (input: string, expected: string, start: number, level: number) => () => void;
9
- testCodeBlockShortcut: (input: string, expected: string) => () => void;
10
- }
@@ -1 +0,0 @@
1
- import 'cypress-real-events';
@@ -1,8 +0,0 @@
1
- import 'cypress-real-events';
2
- export declare class ListCase {
3
- OrderListCreate: () => () => void;
4
- OrderListAddLevel: () => () => void;
5
- OrderListFirstNodeAddLevel: () => () => void;
6
- OrderListSoluction4: () => () => void;
7
- OrderListPalceholder: () => () => void;
8
- }
@@ -1 +0,0 @@
1
- import 'cypress-real-events';
@@ -1,5 +0,0 @@
1
- import { TocNode } from '../data';
2
- export declare class TocCase {
3
- empty: (input: string) => () => void;
4
- notempty: (input: string, tocNode: TocNode[]) => () => void;
5
- }
@@ -1 +0,0 @@
1
- import 'cypress-real-events';