@toast-ui/editor 3.0.1 → 3.1.1

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.
Files changed (56) hide show
  1. package/README.md +4 -4
  2. package/dist/esm/i18n/ar.js +63 -0
  3. package/dist/esm/i18n/cs-cz.js +63 -0
  4. package/dist/esm/i18n/de-de.js +63 -0
  5. package/dist/esm/i18n/en-us.js +63 -0
  6. package/dist/esm/i18n/es-es.js +63 -0
  7. package/dist/esm/i18n/fi-fi.js +63 -0
  8. package/dist/esm/i18n/fr-fr.js +63 -0
  9. package/dist/esm/i18n/gl-es.js +63 -0
  10. package/dist/esm/i18n/hr-hr.js +63 -0
  11. package/dist/esm/i18n/i18n.js +223 -0
  12. package/dist/esm/i18n/it-it.js +63 -0
  13. package/dist/esm/i18n/ja-jp.js +63 -0
  14. package/dist/esm/i18n/ko-kr.js +63 -0
  15. package/dist/esm/i18n/nb-no.js +63 -0
  16. package/dist/esm/i18n/nl-nl.js +63 -0
  17. package/dist/esm/i18n/pl-pl.js +63 -0
  18. package/dist/esm/i18n/pt-br.js +63 -0
  19. package/dist/esm/i18n/ru-ru.js +64 -0
  20. package/dist/esm/i18n/sv-se.js +63 -0
  21. package/dist/esm/i18n/tr-tr.js +63 -0
  22. package/dist/esm/i18n/uk-ua.js +63 -0
  23. package/dist/esm/i18n/zh-cn.js +63 -0
  24. package/dist/esm/i18n/zh-tw.js +63 -0
  25. package/dist/esm/index.js +2887 -441
  26. package/dist/esm/indexViewer.js +1659 -293
  27. package/dist/i18n/ar.js +1 -1
  28. package/dist/i18n/cs-cz.js +1 -1
  29. package/dist/i18n/de-de.js +1 -1
  30. package/dist/i18n/es-es.js +1 -1
  31. package/dist/i18n/fi-fi.js +1 -1
  32. package/dist/i18n/fr-fr.js +1 -1
  33. package/dist/i18n/gl-es.js +1 -1
  34. package/dist/i18n/hr-hr.js +1 -1
  35. package/dist/i18n/it-it.js +1 -1
  36. package/dist/i18n/ja-jp.js +1 -1
  37. package/dist/i18n/ko-kr.js +1 -1
  38. package/dist/i18n/nb-no.js +1 -1
  39. package/dist/i18n/nl-nl.js +1 -1
  40. package/dist/i18n/pl-pl.js +1 -1
  41. package/dist/i18n/pt-br.js +1 -1
  42. package/dist/i18n/ru-ru.js +15 -14
  43. package/dist/i18n/sv-se.js +1 -1
  44. package/dist/i18n/tr-tr.js +1 -1
  45. package/dist/i18n/uk-ua.js +1 -1
  46. package/dist/i18n/zh-cn.js +1 -1
  47. package/dist/i18n/zh-tw.js +1 -1
  48. package/dist/toastui-editor-only.css +27 -19
  49. package/dist/toastui-editor-viewer.css +10 -2
  50. package/dist/toastui-editor-viewer.js +1849 -386
  51. package/dist/toastui-editor.css +36 -20
  52. package/dist/toastui-editor.js +2841 -318
  53. package/package.json +10 -1
  54. package/types/editor.d.ts +6 -4
  55. package/types/index.d.ts +4 -3
  56. package/types/toastui-editor-viewer.d.ts +39 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@toast-ui/editor",
3
- "version": "3.0.1",
3
+ "version": "3.1.1",
4
4
  "description": "GFM Markdown Wysiwyg Editor - Productive and Extensible",
5
5
  "keywords": [
6
6
  "nhn",
@@ -24,12 +24,18 @@
24
24
  "import": "./dist/esm/indexViewer.js",
25
25
  "require": "./dist/toastui-editor-viewer.js"
26
26
  },
27
+ "./dist/i18n/*": {
28
+ "import": "./dist/esm/i18n/*.js",
29
+ "require": "./dist/i18n/*.js"
30
+ },
27
31
  "./dist/toastui-editor-viewer": "./dist/toastui-editor-viewer.js",
28
32
  "./dist/toastui-editor.css": "./dist/toastui-editor.css",
29
33
  "./dist/toastui-editor-viewer.css": "./dist/toastui-editor-viewer.css",
34
+ "./dist/toastui-editor-only.css": "./dist/toastui-editor-only.css",
30
35
  "./dist/theme/toastui-editor-dark.css": "./dist/theme/toastui-editor-dark.css",
31
36
  "./toastui-editor.css": "./dist/toastui-editor.css",
32
37
  "./toastui-editor-viewer.css": "./dist/toastui-editor-viewer.css",
38
+ "./toastui-editor-only.css": "./dist/toastui-editor-only.css",
33
39
  "./toastui-editor-dark.css": "./dist/theme/toastui-editor-dark.css"
34
40
  },
35
41
  "types": "types/index.d.ts",
@@ -57,6 +63,7 @@
57
63
  "lint": "eslint .",
58
64
  "test:types": "tsc",
59
65
  "test": "jest --watch",
66
+ "test:ci": "jest",
60
67
  "serve": "snowpack dev",
61
68
  "serve:ie": "webpack serve",
62
69
  "build:i18n": "cross-env webpack --config scripts/webpack.config.i18n.js && webpack --config scripts/webpack.config.i18n.js --env minify",
@@ -70,9 +77,11 @@
70
77
  },
71
78
  "devDependencies": {
72
79
  "@toast-ui/release-notes": "^2.0.1",
80
+ "@types/dompurify": "2.3.1",
73
81
  "cross-env": "^6.0.3"
74
82
  },
75
83
  "dependencies": {
84
+ "dompurify": "^2.3.3",
76
85
  "prosemirror-commands": "^1.1.9",
77
86
  "prosemirror-history": "^1.1.3",
78
87
  "prosemirror-inputrules": "^1.1.3",
package/types/editor.d.ts CHANGED
@@ -158,6 +158,8 @@ export interface EditorOptions {
158
158
  frontMatter?: boolean;
159
159
  widgetRules?: WidgetRule[];
160
160
  theme?: string;
161
+ autofocus?: boolean;
162
+ viewer?: boolean;
161
163
  }
162
164
 
163
165
  interface Slots {
@@ -193,9 +195,9 @@ export class EditorCore {
193
195
 
194
196
  blur(): void;
195
197
 
196
- moveCursorToEnd(): void;
198
+ moveCursorToEnd(focus?: boolean): void;
197
199
 
198
- moveCursorToStart(): void;
200
+ moveCursorToStart(focus?: boolean): void;
199
201
 
200
202
  setMarkdown(markdown: string, cursorToEnd?: boolean): void;
201
203
 
@@ -312,9 +314,9 @@ export interface Base {
312
314
 
313
315
  destroy(): void;
314
316
 
315
- moveCursorToStart(): void;
317
+ moveCursorToStart(focus: boolean): void;
316
318
 
317
- moveCursorToEnd(): void;
319
+ moveCursorToEnd(focus: boolean): void;
318
320
 
319
321
  setScrollTop(top: number): void;
320
322
 
package/types/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- // Type definitions for TOAST UI Editor v3.0.1
1
+ // Type definitions for TOAST UI Editor v3.1.1
2
2
  // TypeScript Version: 4.2.3
3
3
  import {
4
4
  EditorCore,
@@ -22,6 +22,7 @@ import {
22
22
  HTMLMdNodeConvertor,
23
23
  HTMLMdNodeConvertorMap,
24
24
  } from './editor';
25
+ import './toastui-editor-viewer';
25
26
 
26
27
  export {
27
28
  MdNode,
@@ -61,9 +62,9 @@ export {
61
62
  export { Dispatch } from './spec';
62
63
  export { PluginInfo, PluginNodeViews, CommandFn, PluginCommandMap } from './plugin';
63
64
  export { MdLikeNode, HTMLMdNode } from './markdown';
64
- export { Editor, EditorCore };
65
+ export { Editor, EditorCore, Viewer };
65
66
  export default Editor;
66
67
 
67
68
  export declare namespace toastui {
68
- export { EditorCore, Editor, Viewer };
69
+ export { Editor };
69
70
  }
@@ -0,0 +1,39 @@
1
+ declare module '@toast-ui/editor/dist/toastui-editor-viewer' {
2
+ import {
3
+ Viewer,
4
+ ViewerOptions,
5
+ ExtendedAutolinks,
6
+ LinkAttributes,
7
+ Sanitizer,
8
+ EventMap,
9
+ WidgetRuleMap,
10
+ WidgetRule,
11
+ PluginContext,
12
+ I18n,
13
+ CustomHTMLRenderer,
14
+ HTMLMdNodeConvertor,
15
+ HTMLMdNodeConvertorMap,
16
+ PluginInfo,
17
+ PluginNodeViews,
18
+ PluginCommandMap,
19
+ } from '@toast-ui/editor';
20
+
21
+ export {
22
+ ViewerOptions,
23
+ ExtendedAutolinks,
24
+ LinkAttributes,
25
+ Sanitizer,
26
+ EventMap,
27
+ WidgetRuleMap,
28
+ WidgetRule,
29
+ PluginContext,
30
+ I18n,
31
+ CustomHTMLRenderer,
32
+ HTMLMdNodeConvertor,
33
+ HTMLMdNodeConvertorMap,
34
+ PluginInfo,
35
+ PluginNodeViews,
36
+ PluginCommandMap,
37
+ };
38
+ export default Viewer;
39
+ }