assui 2.0.50 → 2.0.51
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/plugins/code/index.d.ts +1 -0
- package/es/rich-text-editor/plugins/code/index.js +7 -0
- package/es/rich-text-editor/plugins/code/plugin.d.ts +1 -0
- package/es/rich-text-editor/plugins/code/plugin.js +96 -0
- package/lib/rich-text-editor/plugins/code/index.d.ts +1 -0
- package/lib/rich-text-editor/plugins/code/index.js +7 -0
- package/lib/rich-text-editor/plugins/code/plugin.d.ts +1 -0
- package/lib/rich-text-editor/plugins/code/plugin.js +96 -0
- package/package.json +2 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,96 @@
|
|
|
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
|
+
})();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,96 @@
|
|
|
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
|
+
})();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "assui",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.51",
|
|
4
4
|
"description": "react ui library",
|
|
5
5
|
"author": "jason <usochen@gmail.com>",
|
|
6
6
|
"main": "./lib/index.js",
|
|
@@ -69,5 +69,5 @@
|
|
|
69
69
|
"node": ">=10.0.0"
|
|
70
70
|
},
|
|
71
71
|
"license": "MIT",
|
|
72
|
-
"gitHead": "
|
|
72
|
+
"gitHead": "03b61ab6941ce9d642475283b0a8b884a89e93e9"
|
|
73
73
|
}
|