assui 2.0.51 → 2.0.55
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/es/rich-text-editor/index.d.ts +0 -1
- package/es/rich-text-editor/index.js +2 -1
- package/es/rich-text-editor/plugins/code/index.d.ts +2 -1
- package/es/rich-text-editor/plugins/code/index.js +83 -7
- package/lib/rich-text-editor/index.d.ts +0 -1
- package/lib/rich-text-editor/index.js +2 -1
- package/lib/rich-text-editor/plugins/code/index.d.ts +2 -1
- package/lib/rich-text-editor/plugins/code/index.js +95 -7
- package/package.json +4 -4
- package/es/rich-text-editor/plugins/code/plugin.d.ts +0 -1
- package/es/rich-text-editor/plugins/code/plugin.js +0 -96
- package/lib/rich-text-editor/plugins/code/plugin.d.ts +0 -1
- package/lib/rich-text-editor/plugins/code/plugin.js +0 -96
|
@@ -19,7 +19,6 @@ import 'tinymce/plugins/nonbreaking';
|
|
|
19
19
|
import 'tinymce/plugins/table';
|
|
20
20
|
import 'tinymce/plugins/template';
|
|
21
21
|
import 'tinymce/plugins/help';
|
|
22
|
-
import './plugins/code';
|
|
23
22
|
export declare type RichTextEditorProps = IAllProps;
|
|
24
23
|
declare const defaultPlugins: string[];
|
|
25
24
|
declare const defaultToolbar: string;
|
|
@@ -53,9 +53,10 @@ import 'tinymce/plugins/nonbreaking';
|
|
|
53
53
|
import 'tinymce/plugins/table';
|
|
54
54
|
import 'tinymce/plugins/template';
|
|
55
55
|
import 'tinymce/plugins/help';
|
|
56
|
-
import './plugins/code';
|
|
56
|
+
import initCodePlugin from './plugins/code';
|
|
57
57
|
import zhCN from './lang/zh_CN';
|
|
58
58
|
tinymce.addI18n('zh_CN', zhCN);
|
|
59
|
+
initCodePlugin();
|
|
59
60
|
var defaultPlugins = ['autolink lists link image charmap anchor', 'searchreplace code fullscreen', 'insertdatetime media table help wordcount'];
|
|
60
61
|
var defaultToolbar = 'undo redo | formatselect | ' + 'code bold italic color fontcolor backcolor | alignleft aligncenter ' + 'alignright alignjustify table | image bullist numlist outdent indent | ' + 'removeformat | help';
|
|
61
62
|
var defaultInit = {
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
declare function initCodePlugin(): void;
|
|
2
|
+
export default initCodePlugin;
|
|
@@ -1,7 +1,83 @@
|
|
|
1
|
-
//
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
import tinymce from 'tinymce/tinymce';
|
|
3
|
+
var global = tinymce.util.Tools.resolve('tinymce.PluginManager');
|
|
4
|
+
|
|
5
|
+
var setContent = function setContent(editor, html) {
|
|
6
|
+
editor.focus();
|
|
7
|
+
editor.undoManager.transact(function () {
|
|
8
|
+
editor.setContent(html);
|
|
9
|
+
});
|
|
10
|
+
editor.selection.setCursorLocation();
|
|
11
|
+
editor.nodeChanged();
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
var getContent = function getContent(editor) {
|
|
15
|
+
return editor.getContent({
|
|
16
|
+
source_view: true
|
|
17
|
+
});
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
var open = function open(editor) {
|
|
21
|
+
var editorContent = getContent(editor);
|
|
22
|
+
editor.windowManager.open({
|
|
23
|
+
title: 'Source Code',
|
|
24
|
+
size: 'large',
|
|
25
|
+
body: {
|
|
26
|
+
type: 'panel',
|
|
27
|
+
items: [{
|
|
28
|
+
type: 'textarea',
|
|
29
|
+
name: 'code'
|
|
30
|
+
}]
|
|
31
|
+
},
|
|
32
|
+
buttons: [{
|
|
33
|
+
type: 'cancel',
|
|
34
|
+
name: 'cancel',
|
|
35
|
+
text: 'Cancel'
|
|
36
|
+
}, {
|
|
37
|
+
type: 'submit',
|
|
38
|
+
name: 'save',
|
|
39
|
+
text: 'Save',
|
|
40
|
+
primary: true
|
|
41
|
+
}],
|
|
42
|
+
initialData: {
|
|
43
|
+
code: editorContent
|
|
44
|
+
},
|
|
45
|
+
onSubmit: function onSubmit(api) {
|
|
46
|
+
setContent(editor, api.getData().code);
|
|
47
|
+
api.close();
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
var register$1 = function register$1(editor) {
|
|
53
|
+
editor.addCommand('mceCodeEditor', function () {
|
|
54
|
+
open(editor);
|
|
55
|
+
});
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
var register = function register(editor) {
|
|
59
|
+
var onAction = function onAction() {
|
|
60
|
+
return editor.execCommand('mceCodeEditor');
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
editor.ui.registry.addButton('code', {
|
|
64
|
+
text: 'Source code',
|
|
65
|
+
tooltip: 'Source code',
|
|
66
|
+
onAction: onAction
|
|
67
|
+
});
|
|
68
|
+
editor.ui.registry.addMenuItem('code', {
|
|
69
|
+
icon: 'sourcecode',
|
|
70
|
+
text: 'Source code',
|
|
71
|
+
onAction: onAction
|
|
72
|
+
});
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
function initCodePlugin() {
|
|
76
|
+
global.add('code', function (editor) {
|
|
77
|
+
register$1(editor);
|
|
78
|
+
register(editor);
|
|
79
|
+
return {};
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export default initCodePlugin;
|
|
@@ -19,7 +19,6 @@ import 'tinymce/plugins/nonbreaking';
|
|
|
19
19
|
import 'tinymce/plugins/table';
|
|
20
20
|
import 'tinymce/plugins/template';
|
|
21
21
|
import 'tinymce/plugins/help';
|
|
22
|
-
import './plugins/code';
|
|
23
22
|
export declare type RichTextEditorProps = IAllProps;
|
|
24
23
|
declare const defaultPlugins: string[];
|
|
25
24
|
declare const defaultToolbar: string;
|
|
@@ -89,11 +89,12 @@ require("tinymce/plugins/template");
|
|
|
89
89
|
|
|
90
90
|
require("tinymce/plugins/help");
|
|
91
91
|
|
|
92
|
-
require("./plugins/code");
|
|
92
|
+
var code_1 = __importDefault(require("./plugins/code"));
|
|
93
93
|
|
|
94
94
|
var zh_CN_1 = __importDefault(require("./lang/zh_CN"));
|
|
95
95
|
|
|
96
96
|
tinymce_1["default"].addI18n('zh_CN', zh_CN_1["default"]);
|
|
97
|
+
code_1["default"]();
|
|
97
98
|
var defaultPlugins = ['autolink lists link image charmap anchor', 'searchreplace code fullscreen', 'insertdatetime media table help wordcount'];
|
|
98
99
|
exports.defaultPlugins = defaultPlugins;
|
|
99
100
|
var defaultToolbar = 'undo redo | formatselect | ' + 'code bold italic color fontcolor backcolor | alignleft aligncenter ' + 'alignright alignjustify table | image bullist numlist outdent indent | ' + 'removeformat | help';
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
declare function initCodePlugin(): void;
|
|
2
|
+
export default initCodePlugin;
|
|
@@ -1,7 +1,95 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var __importDefault = this && this.__importDefault || function (mod) {
|
|
4
|
+
return mod && mod.__esModule ? mod : {
|
|
5
|
+
"default": mod
|
|
6
|
+
};
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
Object.defineProperty(exports, "__esModule", {
|
|
10
|
+
value: true
|
|
11
|
+
}); // @ts-nocheck
|
|
12
|
+
|
|
13
|
+
var tinymce_1 = __importDefault(require("tinymce/tinymce"));
|
|
14
|
+
|
|
15
|
+
var global = tinymce_1["default"].util.Tools.resolve('tinymce.PluginManager');
|
|
16
|
+
|
|
17
|
+
var setContent = function setContent(editor, html) {
|
|
18
|
+
editor.focus();
|
|
19
|
+
editor.undoManager.transact(function () {
|
|
20
|
+
editor.setContent(html);
|
|
21
|
+
});
|
|
22
|
+
editor.selection.setCursorLocation();
|
|
23
|
+
editor.nodeChanged();
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
var getContent = function getContent(editor) {
|
|
27
|
+
return editor.getContent({
|
|
28
|
+
source_view: true
|
|
29
|
+
});
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
var open = function open(editor) {
|
|
33
|
+
var editorContent = getContent(editor);
|
|
34
|
+
editor.windowManager.open({
|
|
35
|
+
title: 'Source Code',
|
|
36
|
+
size: 'large',
|
|
37
|
+
body: {
|
|
38
|
+
type: 'panel',
|
|
39
|
+
items: [{
|
|
40
|
+
type: 'textarea',
|
|
41
|
+
name: 'code'
|
|
42
|
+
}]
|
|
43
|
+
},
|
|
44
|
+
buttons: [{
|
|
45
|
+
type: 'cancel',
|
|
46
|
+
name: 'cancel',
|
|
47
|
+
text: 'Cancel'
|
|
48
|
+
}, {
|
|
49
|
+
type: 'submit',
|
|
50
|
+
name: 'save',
|
|
51
|
+
text: 'Save',
|
|
52
|
+
primary: true
|
|
53
|
+
}],
|
|
54
|
+
initialData: {
|
|
55
|
+
code: editorContent
|
|
56
|
+
},
|
|
57
|
+
onSubmit: function onSubmit(api) {
|
|
58
|
+
setContent(editor, api.getData().code);
|
|
59
|
+
api.close();
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
var register$1 = function register$1(editor) {
|
|
65
|
+
editor.addCommand('mceCodeEditor', function () {
|
|
66
|
+
open(editor);
|
|
67
|
+
});
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
var register = function register(editor) {
|
|
71
|
+
var onAction = function onAction() {
|
|
72
|
+
return editor.execCommand('mceCodeEditor');
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
editor.ui.registry.addButton('code', {
|
|
76
|
+
text: 'Source code',
|
|
77
|
+
tooltip: 'Source code',
|
|
78
|
+
onAction: onAction
|
|
79
|
+
});
|
|
80
|
+
editor.ui.registry.addMenuItem('code', {
|
|
81
|
+
icon: 'sourcecode',
|
|
82
|
+
text: 'Source code',
|
|
83
|
+
onAction: onAction
|
|
84
|
+
});
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
function initCodePlugin() {
|
|
88
|
+
global.add('code', function (editor) {
|
|
89
|
+
register$1(editor);
|
|
90
|
+
register(editor);
|
|
91
|
+
return {};
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
exports["default"] = initCodePlugin;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "assui",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.55",
|
|
4
4
|
"description": "react ui library",
|
|
5
5
|
"author": "jason <usochen@gmail.com>",
|
|
6
6
|
"main": "./lib/index.js",
|
|
@@ -33,8 +33,8 @@
|
|
|
33
33
|
"@ahooksjs/use-url-state": "^2.5.8",
|
|
34
34
|
"@tinymce/tinymce-react": "^3.13.0",
|
|
35
35
|
"@types/react-beautiful-dnd": "^13.1.2",
|
|
36
|
-
"a-icons": "^1.0.
|
|
37
|
-
"ahooks": "^
|
|
36
|
+
"a-icons": "^1.0.28",
|
|
37
|
+
"ahooks": "^3.0.8",
|
|
38
38
|
"bignumber.js": "^9.0.1",
|
|
39
39
|
"copy-to-clipboard": "^3.3.1",
|
|
40
40
|
"echarts": "^5.1.2",
|
|
@@ -69,5 +69,5 @@
|
|
|
69
69
|
"node": ">=10.0.0"
|
|
70
70
|
},
|
|
71
71
|
"license": "MIT",
|
|
72
|
-
"gitHead": "
|
|
72
|
+
"gitHead": "6f0f0793e013f12803a71652c3248df6e5f3f23a"
|
|
73
73
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
|
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
/* eslint-disable */
|
|
2
|
-
//@ts-nocheck
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Copyright (c) Tiny Technologies, Inc. All rights reserved.
|
|
6
|
-
* Licensed under the LGPL or a commercial license.
|
|
7
|
-
* For LGPL see License.txt in the project root for license information.
|
|
8
|
-
* For commercial licenses see https://www.tiny.cloud/
|
|
9
|
-
*
|
|
10
|
-
* Version: 5.10.0 (2021-10-11)
|
|
11
|
-
*/
|
|
12
|
-
(function () {
|
|
13
|
-
'use strict';
|
|
14
|
-
|
|
15
|
-
var global = tinymce.util.Tools.resolve('tinymce.PluginManager');
|
|
16
|
-
|
|
17
|
-
var setContent = function setContent(editor, html) {
|
|
18
|
-
editor.focus();
|
|
19
|
-
editor.undoManager.transact(function () {
|
|
20
|
-
editor.setContent(html);
|
|
21
|
-
});
|
|
22
|
-
editor.selection.setCursorLocation();
|
|
23
|
-
editor.nodeChanged();
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
var getContent = function getContent(editor) {
|
|
27
|
-
return editor.getContent({
|
|
28
|
-
source_view: true
|
|
29
|
-
});
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
var open = function open(editor) {
|
|
33
|
-
var editorContent = getContent(editor);
|
|
34
|
-
editor.windowManager.open({
|
|
35
|
-
title: 'Source Code',
|
|
36
|
-
size: 'large',
|
|
37
|
-
body: {
|
|
38
|
-
type: 'panel',
|
|
39
|
-
items: [{
|
|
40
|
-
type: 'textarea',
|
|
41
|
-
name: 'code'
|
|
42
|
-
}]
|
|
43
|
-
},
|
|
44
|
-
buttons: [{
|
|
45
|
-
type: 'cancel',
|
|
46
|
-
name: 'cancel',
|
|
47
|
-
text: 'Cancel'
|
|
48
|
-
}, {
|
|
49
|
-
type: 'submit',
|
|
50
|
-
name: 'save',
|
|
51
|
-
text: 'Save',
|
|
52
|
-
primary: true
|
|
53
|
-
}],
|
|
54
|
-
initialData: {
|
|
55
|
-
code: editorContent
|
|
56
|
-
},
|
|
57
|
-
onSubmit: function onSubmit(api) {
|
|
58
|
-
setContent(editor, api.getData().code);
|
|
59
|
-
api.close();
|
|
60
|
-
}
|
|
61
|
-
});
|
|
62
|
-
};
|
|
63
|
-
|
|
64
|
-
var register$1 = function register$1(editor) {
|
|
65
|
-
editor.addCommand('mceCodeEditor', function () {
|
|
66
|
-
open(editor);
|
|
67
|
-
});
|
|
68
|
-
};
|
|
69
|
-
|
|
70
|
-
var register = function register(editor) {
|
|
71
|
-
var onAction = function onAction() {
|
|
72
|
-
return editor.execCommand('mceCodeEditor');
|
|
73
|
-
};
|
|
74
|
-
|
|
75
|
-
editor.ui.registry.addButton('code', {
|
|
76
|
-
text: 'Source code',
|
|
77
|
-
tooltip: 'Source code',
|
|
78
|
-
onAction: onAction
|
|
79
|
-
});
|
|
80
|
-
editor.ui.registry.addMenuItem('code', {
|
|
81
|
-
icon: 'sourcecode',
|
|
82
|
-
text: 'Source code',
|
|
83
|
-
onAction: onAction
|
|
84
|
-
});
|
|
85
|
-
};
|
|
86
|
-
|
|
87
|
-
function Plugin() {
|
|
88
|
-
global.add('code', function (editor) {
|
|
89
|
-
register$1(editor);
|
|
90
|
-
register(editor);
|
|
91
|
-
return {};
|
|
92
|
-
});
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
Plugin();
|
|
96
|
-
})();
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
|
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
/* eslint-disable */
|
|
2
|
-
//@ts-nocheck
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Copyright (c) Tiny Technologies, Inc. All rights reserved.
|
|
6
|
-
* Licensed under the LGPL or a commercial license.
|
|
7
|
-
* For LGPL see License.txt in the project root for license information.
|
|
8
|
-
* For commercial licenses see https://www.tiny.cloud/
|
|
9
|
-
*
|
|
10
|
-
* Version: 5.10.0 (2021-10-11)
|
|
11
|
-
*/
|
|
12
|
-
(function () {
|
|
13
|
-
'use strict';
|
|
14
|
-
|
|
15
|
-
var global = tinymce.util.Tools.resolve('tinymce.PluginManager');
|
|
16
|
-
|
|
17
|
-
var setContent = function setContent(editor, html) {
|
|
18
|
-
editor.focus();
|
|
19
|
-
editor.undoManager.transact(function () {
|
|
20
|
-
editor.setContent(html);
|
|
21
|
-
});
|
|
22
|
-
editor.selection.setCursorLocation();
|
|
23
|
-
editor.nodeChanged();
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
var getContent = function getContent(editor) {
|
|
27
|
-
return editor.getContent({
|
|
28
|
-
source_view: true
|
|
29
|
-
});
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
var open = function open(editor) {
|
|
33
|
-
var editorContent = getContent(editor);
|
|
34
|
-
editor.windowManager.open({
|
|
35
|
-
title: 'Source Code',
|
|
36
|
-
size: 'large',
|
|
37
|
-
body: {
|
|
38
|
-
type: 'panel',
|
|
39
|
-
items: [{
|
|
40
|
-
type: 'textarea',
|
|
41
|
-
name: 'code'
|
|
42
|
-
}]
|
|
43
|
-
},
|
|
44
|
-
buttons: [{
|
|
45
|
-
type: 'cancel',
|
|
46
|
-
name: 'cancel',
|
|
47
|
-
text: 'Cancel'
|
|
48
|
-
}, {
|
|
49
|
-
type: 'submit',
|
|
50
|
-
name: 'save',
|
|
51
|
-
text: 'Save',
|
|
52
|
-
primary: true
|
|
53
|
-
}],
|
|
54
|
-
initialData: {
|
|
55
|
-
code: editorContent
|
|
56
|
-
},
|
|
57
|
-
onSubmit: function onSubmit(api) {
|
|
58
|
-
setContent(editor, api.getData().code);
|
|
59
|
-
api.close();
|
|
60
|
-
}
|
|
61
|
-
});
|
|
62
|
-
};
|
|
63
|
-
|
|
64
|
-
var register$1 = function register$1(editor) {
|
|
65
|
-
editor.addCommand('mceCodeEditor', function () {
|
|
66
|
-
open(editor);
|
|
67
|
-
});
|
|
68
|
-
};
|
|
69
|
-
|
|
70
|
-
var register = function register(editor) {
|
|
71
|
-
var onAction = function onAction() {
|
|
72
|
-
return editor.execCommand('mceCodeEditor');
|
|
73
|
-
};
|
|
74
|
-
|
|
75
|
-
editor.ui.registry.addButton('code', {
|
|
76
|
-
text: 'Source code',
|
|
77
|
-
tooltip: 'Source code',
|
|
78
|
-
onAction: onAction
|
|
79
|
-
});
|
|
80
|
-
editor.ui.registry.addMenuItem('code', {
|
|
81
|
-
icon: 'sourcecode',
|
|
82
|
-
text: 'Source code',
|
|
83
|
-
onAction: onAction
|
|
84
|
-
});
|
|
85
|
-
};
|
|
86
|
-
|
|
87
|
-
function Plugin() {
|
|
88
|
-
global.add('code', function (editor) {
|
|
89
|
-
register$1(editor);
|
|
90
|
-
register(editor);
|
|
91
|
-
return {};
|
|
92
|
-
});
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
Plugin();
|
|
96
|
-
})();
|