@manuscripts/body-editor 2.0.0 → 2.0.2-LEAN-3302.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/dist/cjs/configs/editor-views.js +0 -4
- package/dist/cjs/versions.js +1 -1
- package/dist/es/configs/editor-views.js +0 -4
- package/dist/es/versions.js +1 -1
- package/dist/types/configs/editor-views.d.ts +0 -36
- package/dist/types/versions.d.ts +1 -1
- package/package.json +2 -2
- package/dist/cjs/lib/codemirror-modes.js +0 -195
- package/dist/cjs/views/listing.js +0 -120
- package/dist/cjs/views/listing_editable.js +0 -38
- package/dist/cjs/views/listing_element.js +0 -36
- package/dist/cjs/views/listing_element_editable.js +0 -21
- package/dist/es/lib/codemirror-modes.js +0 -192
- package/dist/es/views/listing.js +0 -93
- package/dist/es/views/listing_editable.js +0 -34
- package/dist/es/views/listing_element.js +0 -29
- package/dist/es/views/listing_element_editable.js +0 -19
- package/dist/types/lib/codemirror-modes.d.ts +0 -172
- package/dist/types/views/listing.d.ts +0 -35
- package/dist/types/views/listing_editable.d.ts +0 -24
- package/dist/types/views/listing_element.d.ts +0 -24
- package/dist/types/views/listing_element_editable.d.ts +0 -52
|
@@ -40,8 +40,6 @@ const keyword_group_1 = __importDefault(require("../views/keyword_group"));
|
|
|
40
40
|
const link_editable_1 = __importDefault(require("../views/link_editable"));
|
|
41
41
|
const list_1 = __importDefault(require("../views/list"));
|
|
42
42
|
const list_item_1 = __importDefault(require("../views/list_item"));
|
|
43
|
-
const listing_editable_1 = __importDefault(require("../views/listing_editable"));
|
|
44
|
-
const listing_element_editable_1 = __importDefault(require("../views/listing_element_editable"));
|
|
45
43
|
const paragraph_editable_1 = __importDefault(require("../views/paragraph_editable"));
|
|
46
44
|
const placeholder_1 = __importDefault(require("../views/placeholder"));
|
|
47
45
|
const placeholder_element_editable_1 = __importDefault(require("../views/placeholder_element_editable"));
|
|
@@ -74,8 +72,6 @@ exports.default = (props, dispatch) => {
|
|
|
74
72
|
keyword: (0, keyword_1.default)(props, dispatch),
|
|
75
73
|
keyword_group: (0, keyword_group_1.default)(props, dispatch),
|
|
76
74
|
link: (0, link_editable_1.default)(props, dispatch),
|
|
77
|
-
listing: (0, listing_editable_1.default)(props),
|
|
78
|
-
listing_element: (0, listing_element_editable_1.default)(props),
|
|
79
75
|
list_item: (0, list_item_1.default)(props),
|
|
80
76
|
paragraph: (0, paragraph_editable_1.default)(props),
|
|
81
77
|
placeholder: (0, placeholder_1.default)(props),
|
package/dist/cjs/versions.js
CHANGED
|
@@ -35,8 +35,6 @@ import keywordGroup from '../views/keyword_group';
|
|
|
35
35
|
import link from '../views/link_editable';
|
|
36
36
|
import list from '../views/list';
|
|
37
37
|
import list_item from '../views/list_item';
|
|
38
|
-
import listing from '../views/listing_editable';
|
|
39
|
-
import listingElement from '../views/listing_element_editable';
|
|
40
38
|
import paragraph from '../views/paragraph_editable';
|
|
41
39
|
import placeholder from '../views/placeholder';
|
|
42
40
|
import placeholderElement from '../views/placeholder_element_editable';
|
|
@@ -69,8 +67,6 @@ export default (props, dispatch) => {
|
|
|
69
67
|
keyword: keyword(props, dispatch),
|
|
70
68
|
keyword_group: keywordGroup(props, dispatch),
|
|
71
69
|
link: link(props, dispatch),
|
|
72
|
-
listing: listing(props),
|
|
73
|
-
listing_element: listingElement(props),
|
|
74
70
|
list_item: list_item(props),
|
|
75
71
|
paragraph: paragraph(props),
|
|
76
72
|
placeholder: placeholder(props),
|
package/dist/es/versions.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const VERSION = '2.0.0';
|
|
1
|
+
export const VERSION = '2.0.2-LEAN-3302.0';
|
|
2
2
|
export const MATHJAX_VERSION = '3.2.2';
|
|
@@ -244,42 +244,6 @@ declare const _default: (props: EditorProps, dispatch: Dispatch) => {
|
|
|
244
244
|
keyword: import("../types").NodeViewCreator<import("../views/keyword").KeywordView>;
|
|
245
245
|
keyword_group: import("../types").NodeViewCreator<import("../views/keyword_group").KeywordGroupView>;
|
|
246
246
|
link: import("../types").NodeViewCreator<import("../views/link_editable").LinkEditableView>;
|
|
247
|
-
listing: import("../types").NodeViewCreator<import("../views/listing_editable").ListingEditableView>;
|
|
248
|
-
listing_element: import("../types").NodeViewCreator<{
|
|
249
|
-
gutterButtons: () => HTMLElement[];
|
|
250
|
-
actionGutterButtons: () => HTMLElement[];
|
|
251
|
-
createAddButton: () => HTMLElement | null;
|
|
252
|
-
createEditButton: () => HTMLElement | null;
|
|
253
|
-
createMenu: () => import("../lib/context-menu").ContextMenu;
|
|
254
|
-
viewAttributes: {
|
|
255
|
-
id: string;
|
|
256
|
-
placeholder: string;
|
|
257
|
-
paragraphStyle: string;
|
|
258
|
-
};
|
|
259
|
-
initialise: () => void;
|
|
260
|
-
updateContents: () => void;
|
|
261
|
-
onUpdateContent(): void;
|
|
262
|
-
updateClasses: () => void;
|
|
263
|
-
updateAttributes: () => void;
|
|
264
|
-
createElement: () => void;
|
|
265
|
-
createDOM: () => void;
|
|
266
|
-
createGutter: (className: string, buttons: HTMLElement[]) => void;
|
|
267
|
-
dom: HTMLElement;
|
|
268
|
-
contentDOM?: HTMLElement | undefined;
|
|
269
|
-
syncErrors: import("../types").SyncError[];
|
|
270
|
-
elementType: string;
|
|
271
|
-
readonly props: EditableBlockProps;
|
|
272
|
-
node: import("prosemirror-model").Node;
|
|
273
|
-
readonly view: import("prosemirror-view").EditorView;
|
|
274
|
-
readonly getPos: () => number;
|
|
275
|
-
decorations: readonly import("prosemirror-view").Decoration[];
|
|
276
|
-
update: (newNode: import("prosemirror-model").Node, decorations: readonly import("prosemirror-view").Decoration[]) => boolean;
|
|
277
|
-
setDomAttrs(node: import("prosemirror-model").Node, element: HTMLElement, omit?: string[]): void;
|
|
278
|
-
selectNode: () => void;
|
|
279
|
-
deselectNode: () => void;
|
|
280
|
-
destroy: () => void;
|
|
281
|
-
handleDecorations: (decorations: readonly import("prosemirror-view").Decoration[]) => void;
|
|
282
|
-
} & import("../views/listing_element").ListingElementView<any>>;
|
|
283
247
|
list_item: import("../types").NodeViewCreator<import("../views/list_item").ListItemView<any>>;
|
|
284
248
|
paragraph: import("../types").NodeViewCreator<{
|
|
285
249
|
gutterButtons: () => HTMLElement[];
|
package/dist/types/versions.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "2.0.0";
|
|
1
|
+
export declare const VERSION = "2.0.2-LEAN-3302.0";
|
|
2
2
|
export declare const MATHJAX_VERSION = "3.2.2";
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@manuscripts/body-editor",
|
|
3
3
|
"description": "Prosemirror components for editing and viewing manuscripts",
|
|
4
|
-
"version": "2.0.0",
|
|
4
|
+
"version": "2.0.2-LEAN-3302.0",
|
|
5
5
|
"repository": "github:Atypon-OpenSource/manuscripts-body-editor",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"main": "dist/cjs",
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
"react-dnd": "^16.0.1",
|
|
61
61
|
"react-dnd-html5-backend": "^16.0.1",
|
|
62
62
|
"react-dom": "^18.3.1",
|
|
63
|
-
"react-is": "^
|
|
63
|
+
"react-is": "^18.3.1",
|
|
64
64
|
"react-router-dom": "^6.25.0",
|
|
65
65
|
"react-select": "^5.7.3",
|
|
66
66
|
"styled-components": "^5.2.0"
|
|
@@ -1,195 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*!
|
|
3
|
-
* © 2019 Atypon Systems LLC
|
|
4
|
-
*
|
|
5
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
-
* you may not use this file except in compliance with the License.
|
|
7
|
-
* You may obtain a copy of the License at
|
|
8
|
-
*
|
|
9
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
-
*
|
|
11
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
-
* See the License for the specific language governing permissions and
|
|
15
|
-
* limitations under the License.
|
|
16
|
-
*/
|
|
17
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
exports.codemirrorModeGroups = exports.codemirrorModeOptions = exports.codemirrorModeLabels = void 0;
|
|
19
|
-
require("codemirror/mode/apl/apl");
|
|
20
|
-
require("codemirror/mode/asciiarmor/asciiarmor");
|
|
21
|
-
require("codemirror/mode/asn.1/asn.1");
|
|
22
|
-
require("codemirror/mode/asterisk/asterisk");
|
|
23
|
-
require("codemirror/mode/brainfuck/brainfuck");
|
|
24
|
-
require("codemirror/mode/clike/clike");
|
|
25
|
-
require("codemirror/mode/clojure/clojure");
|
|
26
|
-
require("codemirror/mode/cmake/cmake");
|
|
27
|
-
require("codemirror/mode/cobol/cobol");
|
|
28
|
-
require("codemirror/mode/coffeescript/coffeescript");
|
|
29
|
-
require("codemirror/mode/commonlisp/commonlisp");
|
|
30
|
-
require("codemirror/mode/crystal/crystal");
|
|
31
|
-
require("codemirror/mode/css/css");
|
|
32
|
-
require("codemirror/mode/cypher/cypher");
|
|
33
|
-
require("codemirror/mode/d/d");
|
|
34
|
-
require("codemirror/mode/dart/dart");
|
|
35
|
-
require("codemirror/mode/diff/diff");
|
|
36
|
-
require("codemirror/mode/django/django");
|
|
37
|
-
require("codemirror/mode/dockerfile/dockerfile");
|
|
38
|
-
require("codemirror/mode/dtd/dtd");
|
|
39
|
-
require("codemirror/mode/dylan/dylan");
|
|
40
|
-
require("codemirror/mode/ebnf/ebnf");
|
|
41
|
-
require("codemirror/mode/ecl/ecl");
|
|
42
|
-
require("codemirror/mode/eiffel/eiffel");
|
|
43
|
-
require("codemirror/mode/elm/elm");
|
|
44
|
-
require("codemirror/mode/erlang/erlang");
|
|
45
|
-
require("codemirror/mode/factor/factor");
|
|
46
|
-
require("codemirror/mode/fcl/fcl");
|
|
47
|
-
require("codemirror/mode/forth/forth");
|
|
48
|
-
require("codemirror/mode/fortran/fortran");
|
|
49
|
-
require("codemirror/mode/gas/gas");
|
|
50
|
-
require("codemirror/mode/gfm/gfm");
|
|
51
|
-
require("codemirror/mode/gherkin/gherkin");
|
|
52
|
-
require("codemirror/mode/go/go");
|
|
53
|
-
require("codemirror/mode/groovy/groovy");
|
|
54
|
-
require("codemirror/mode/haml/haml");
|
|
55
|
-
require("codemirror/mode/handlebars/handlebars");
|
|
56
|
-
require("codemirror/mode/haskell-literate/haskell-literate");
|
|
57
|
-
require("codemirror/mode/haskell/haskell");
|
|
58
|
-
require("codemirror/mode/haxe/haxe");
|
|
59
|
-
require("codemirror/mode/htmlembedded/htmlembedded");
|
|
60
|
-
require("codemirror/mode/htmlmixed/htmlmixed");
|
|
61
|
-
require("codemirror/mode/http/http");
|
|
62
|
-
require("codemirror/mode/idl/idl");
|
|
63
|
-
require("codemirror/mode/javascript/javascript");
|
|
64
|
-
require("codemirror/mode/jinja2/jinja2");
|
|
65
|
-
require("codemirror/mode/jsx/jsx");
|
|
66
|
-
require("codemirror/mode/julia/julia");
|
|
67
|
-
require("codemirror/mode/livescript/livescript");
|
|
68
|
-
require("codemirror/mode/lua/lua");
|
|
69
|
-
require("codemirror/mode/markdown/markdown");
|
|
70
|
-
require("codemirror/mode/mathematica/mathematica");
|
|
71
|
-
require("codemirror/mode/mbox/mbox");
|
|
72
|
-
require("codemirror/mode/mirc/mirc");
|
|
73
|
-
require("codemirror/mode/mllike/mllike");
|
|
74
|
-
require("codemirror/mode/modelica/modelica");
|
|
75
|
-
require("codemirror/mode/mscgen/mscgen");
|
|
76
|
-
require("codemirror/mode/mumps/mumps");
|
|
77
|
-
require("codemirror/mode/nginx/nginx");
|
|
78
|
-
require("codemirror/mode/nsis/nsis");
|
|
79
|
-
require("codemirror/mode/ntriples/ntriples");
|
|
80
|
-
require("codemirror/mode/octave/octave");
|
|
81
|
-
require("codemirror/mode/oz/oz");
|
|
82
|
-
require("codemirror/mode/pascal/pascal");
|
|
83
|
-
require("codemirror/mode/pegjs/pegjs");
|
|
84
|
-
require("codemirror/mode/perl/perl");
|
|
85
|
-
require("codemirror/mode/php/php");
|
|
86
|
-
require("codemirror/mode/pig/pig");
|
|
87
|
-
require("codemirror/mode/powershell/powershell");
|
|
88
|
-
require("codemirror/mode/properties/properties");
|
|
89
|
-
require("codemirror/mode/protobuf/protobuf");
|
|
90
|
-
require("codemirror/mode/pug/pug");
|
|
91
|
-
require("codemirror/mode/puppet/puppet");
|
|
92
|
-
require("codemirror/mode/python/python");
|
|
93
|
-
require("codemirror/mode/q/q");
|
|
94
|
-
require("codemirror/mode/r/r");
|
|
95
|
-
require("codemirror/mode/rpm/rpm");
|
|
96
|
-
require("codemirror/mode/rst/rst");
|
|
97
|
-
require("codemirror/mode/ruby/ruby");
|
|
98
|
-
require("codemirror/mode/rust/rust");
|
|
99
|
-
require("codemirror/mode/sas/sas");
|
|
100
|
-
require("codemirror/mode/sass/sass");
|
|
101
|
-
require("codemirror/mode/scheme/scheme");
|
|
102
|
-
require("codemirror/mode/shell/shell");
|
|
103
|
-
require("codemirror/mode/sieve/sieve");
|
|
104
|
-
require("codemirror/mode/slim/slim");
|
|
105
|
-
require("codemirror/mode/smalltalk/smalltalk");
|
|
106
|
-
require("codemirror/mode/smarty/smarty");
|
|
107
|
-
require("codemirror/mode/solr/solr");
|
|
108
|
-
require("codemirror/mode/soy/soy");
|
|
109
|
-
require("codemirror/mode/sparql/sparql");
|
|
110
|
-
require("codemirror/mode/spreadsheet/spreadsheet");
|
|
111
|
-
require("codemirror/mode/sql/sql");
|
|
112
|
-
require("codemirror/mode/stex/stex");
|
|
113
|
-
require("codemirror/mode/stylus/stylus");
|
|
114
|
-
require("codemirror/mode/swift/swift");
|
|
115
|
-
require("codemirror/mode/tcl/tcl");
|
|
116
|
-
require("codemirror/mode/textile/textile");
|
|
117
|
-
require("codemirror/mode/tiddlywiki/tiddlywiki");
|
|
118
|
-
require("codemirror/mode/tiki/tiki");
|
|
119
|
-
require("codemirror/mode/toml/toml");
|
|
120
|
-
require("codemirror/mode/tornado/tornado");
|
|
121
|
-
require("codemirror/mode/troff/troff");
|
|
122
|
-
require("codemirror/mode/ttcn-cfg/ttcn-cfg");
|
|
123
|
-
require("codemirror/mode/ttcn/ttcn");
|
|
124
|
-
require("codemirror/mode/turtle/turtle");
|
|
125
|
-
require("codemirror/mode/twig/twig");
|
|
126
|
-
require("codemirror/mode/vb/vb");
|
|
127
|
-
require("codemirror/mode/vbscript/vbscript");
|
|
128
|
-
require("codemirror/mode/velocity/velocity");
|
|
129
|
-
require("codemirror/mode/verilog/verilog");
|
|
130
|
-
require("codemirror/mode/vhdl/vhdl");
|
|
131
|
-
require("codemirror/mode/vue/vue");
|
|
132
|
-
require("codemirror/mode/webidl/webidl");
|
|
133
|
-
require("codemirror/mode/xml/xml");
|
|
134
|
-
require("codemirror/mode/xquery/xquery");
|
|
135
|
-
require("codemirror/mode/yacas/yacas");
|
|
136
|
-
require("codemirror/mode/yaml-frontmatter/yaml-frontmatter");
|
|
137
|
-
require("codemirror/mode/yaml/yaml");
|
|
138
|
-
require("codemirror/mode/z80/z80");
|
|
139
|
-
exports.codemirrorModeLabels = {
|
|
140
|
-
clojure: 'Clojure',
|
|
141
|
-
cobol: 'COBOL',
|
|
142
|
-
css: 'CSS',
|
|
143
|
-
go: 'Go',
|
|
144
|
-
javascript: 'JavaScript',
|
|
145
|
-
json: 'JSON',
|
|
146
|
-
jsonld: 'JSON-LD',
|
|
147
|
-
jsx: 'JSX',
|
|
148
|
-
julia: 'Julia',
|
|
149
|
-
python: 'Python',
|
|
150
|
-
r: 'R',
|
|
151
|
-
ruby: 'Ruby',
|
|
152
|
-
rust: 'Rust',
|
|
153
|
-
shell: 'Shell',
|
|
154
|
-
sparql: 'SPARQL',
|
|
155
|
-
sql: 'SQL',
|
|
156
|
-
swift: 'Swift',
|
|
157
|
-
turtle: 'Turtle',
|
|
158
|
-
twig: 'Twig',
|
|
159
|
-
typescript: 'TypeScript',
|
|
160
|
-
xml: 'XML',
|
|
161
|
-
yaml: 'YAML',
|
|
162
|
-
};
|
|
163
|
-
exports.codemirrorModeOptions = {
|
|
164
|
-
typescript: {
|
|
165
|
-
name: 'javascript',
|
|
166
|
-
typescript: true,
|
|
167
|
-
},
|
|
168
|
-
json: {
|
|
169
|
-
name: 'javascript',
|
|
170
|
-
json: true,
|
|
171
|
-
},
|
|
172
|
-
jsonld: {
|
|
173
|
-
name: 'javascript',
|
|
174
|
-
jsonld: true,
|
|
175
|
-
},
|
|
176
|
-
};
|
|
177
|
-
exports.codemirrorModeGroups = {
|
|
178
|
-
Language: [
|
|
179
|
-
'clojure',
|
|
180
|
-
'cobol',
|
|
181
|
-
'go',
|
|
182
|
-
'javascript',
|
|
183
|
-
'julia',
|
|
184
|
-
'python',
|
|
185
|
-
'r',
|
|
186
|
-
'ruby',
|
|
187
|
-
'rust',
|
|
188
|
-
'swift',
|
|
189
|
-
'typescript',
|
|
190
|
-
],
|
|
191
|
-
Data: ['json', 'jsonld', 'turtle', 'xml', 'yaml'],
|
|
192
|
-
Markup: ['jsx', 'twig'],
|
|
193
|
-
Query: ['sql', 'sparql'],
|
|
194
|
-
Other: ['css', 'shell'],
|
|
195
|
-
};
|
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*!
|
|
3
|
-
* © 2019 Atypon Systems LLC
|
|
4
|
-
*
|
|
5
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
-
* you may not use this file except in compliance with the License.
|
|
7
|
-
* You may obtain a copy of the License at
|
|
8
|
-
*
|
|
9
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
-
*
|
|
11
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
-
* See the License for the specific language governing permissions and
|
|
15
|
-
* limitations under the License.
|
|
16
|
-
*/
|
|
17
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
18
|
-
if (k2 === undefined) k2 = k;
|
|
19
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
20
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
21
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
22
|
-
}
|
|
23
|
-
Object.defineProperty(o, k2, desc);
|
|
24
|
-
}) : (function(o, m, k, k2) {
|
|
25
|
-
if (k2 === undefined) k2 = k;
|
|
26
|
-
o[k2] = m[k];
|
|
27
|
-
}));
|
|
28
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
29
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
30
|
-
}) : function(o, v) {
|
|
31
|
-
o["default"] = v;
|
|
32
|
-
});
|
|
33
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
34
|
-
if (mod && mod.__esModule) return mod;
|
|
35
|
-
var result = {};
|
|
36
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
37
|
-
__setModuleDefault(result, mod);
|
|
38
|
-
return result;
|
|
39
|
-
};
|
|
40
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
41
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
42
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
43
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
44
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
45
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
46
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
47
|
-
});
|
|
48
|
-
};
|
|
49
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
50
|
-
exports.ListingView = void 0;
|
|
51
|
-
const base_node_view_1 = require("./base_node_view");
|
|
52
|
-
const creators_1 = require("./creators");
|
|
53
|
-
class ListingView extends base_node_view_1.BaseNodeView {
|
|
54
|
-
constructor() {
|
|
55
|
-
super(...arguments);
|
|
56
|
-
this.ignoreMutation = () => true;
|
|
57
|
-
this.initialise = () => {
|
|
58
|
-
this.createDOM();
|
|
59
|
-
this.updateContents();
|
|
60
|
-
};
|
|
61
|
-
this.updateContents = () => {
|
|
62
|
-
const { contents, isExpanded } = this.node.attrs;
|
|
63
|
-
if (this.editor) {
|
|
64
|
-
if (isExpanded) {
|
|
65
|
-
this.editor.refresh();
|
|
66
|
-
}
|
|
67
|
-
if (contents !== this.editor.getValue()) {
|
|
68
|
-
this.editor.setValue(contents);
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
};
|
|
72
|
-
this.createDOM = () => {
|
|
73
|
-
this.dom = document.createElement('div');
|
|
74
|
-
this.dom.classList.add('listing');
|
|
75
|
-
this.container = document.createElement('div');
|
|
76
|
-
this.dom.appendChild(this.container);
|
|
77
|
-
this.createEditor().catch((error) => {
|
|
78
|
-
console.error(error);
|
|
79
|
-
});
|
|
80
|
-
};
|
|
81
|
-
this.createEditor = (defaultPlaceholder = '<Listing>') => __awaiter(this, void 0, void 0, function* () {
|
|
82
|
-
const { contents, languageKey, placeholder } = this.node.attrs;
|
|
83
|
-
const { createEditor } = yield Promise.resolve().then(() => __importStar(require('../lib/codemirror')));
|
|
84
|
-
const { codemirrorModeOptions } = yield Promise.resolve().then(() => __importStar(require('../lib/codemirror-modes')));
|
|
85
|
-
this.editor = yield createEditor({
|
|
86
|
-
readOnly: true,
|
|
87
|
-
value: contents,
|
|
88
|
-
mode: languageKey in codemirrorModeOptions
|
|
89
|
-
? codemirrorModeOptions[languageKey]
|
|
90
|
-
: languageKey,
|
|
91
|
-
placeholder: placeholder || defaultPlaceholder,
|
|
92
|
-
autofocus: false,
|
|
93
|
-
});
|
|
94
|
-
this.container.appendChild(this.editor.getWrapperElement());
|
|
95
|
-
this.refreshEditor();
|
|
96
|
-
});
|
|
97
|
-
this.refreshEditor = () => {
|
|
98
|
-
window.requestAnimationFrame(() => {
|
|
99
|
-
this.editor.refresh();
|
|
100
|
-
});
|
|
101
|
-
};
|
|
102
|
-
this.focusEditor = () => {
|
|
103
|
-
window.requestAnimationFrame(() => {
|
|
104
|
-
this.editor.focus();
|
|
105
|
-
});
|
|
106
|
-
};
|
|
107
|
-
this.toggleListing = (isExpanded) => {
|
|
108
|
-
this.setNodeAttrs({ isExpanded });
|
|
109
|
-
if (isExpanded) {
|
|
110
|
-
this.refreshEditor();
|
|
111
|
-
this.focusEditor();
|
|
112
|
-
}
|
|
113
|
-
};
|
|
114
|
-
this.setNodeAttrs = (attrs) => {
|
|
115
|
-
this.view.dispatch(this.view.state.tr.setNodeMarkup(this.getPos(), undefined, Object.assign(Object.assign({}, this.node.attrs), attrs)));
|
|
116
|
-
};
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
exports.ListingView = ListingView;
|
|
120
|
-
exports.default = (0, creators_1.createNodeView)(ListingView);
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*!
|
|
3
|
-
* © 2019 Atypon Systems LLC
|
|
4
|
-
*
|
|
5
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
-
* you may not use this file except in compliance with the License.
|
|
7
|
-
* You may obtain a copy of the License at
|
|
8
|
-
*
|
|
9
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
-
*
|
|
11
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
-
* See the License for the specific language governing permissions and
|
|
15
|
-
* limitations under the License.
|
|
16
|
-
*/
|
|
17
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
exports.ListingEditableView = void 0;
|
|
19
|
-
const creators_1 = require("./creators");
|
|
20
|
-
const listing_1 = require("./listing");
|
|
21
|
-
class ListingEditableView extends listing_1.ListingView {
|
|
22
|
-
constructor() {
|
|
23
|
-
super(...arguments);
|
|
24
|
-
this.needsFocus = false;
|
|
25
|
-
this.selectNode = () => {
|
|
26
|
-
this.needsFocus = true;
|
|
27
|
-
if (this.editor) {
|
|
28
|
-
this.editor.focus();
|
|
29
|
-
}
|
|
30
|
-
};
|
|
31
|
-
this.createDOM = () => {
|
|
32
|
-
this.dom = document.createElement('div');
|
|
33
|
-
this.dom.classList.add('listing');
|
|
34
|
-
};
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
exports.ListingEditableView = ListingEditableView;
|
|
38
|
-
exports.default = (0, creators_1.createEditableNodeView)(ListingEditableView);
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*!
|
|
3
|
-
* © 2019 Atypon Systems LLC
|
|
4
|
-
*
|
|
5
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
-
* you may not use this file except in compliance with the License.
|
|
7
|
-
* You may obtain a copy of the License at
|
|
8
|
-
*
|
|
9
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
-
*
|
|
11
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
-
* See the License for the specific language governing permissions and
|
|
15
|
-
* limitations under the License.
|
|
16
|
-
*/
|
|
17
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
18
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
19
|
-
};
|
|
20
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
-
exports.ListingElementView = void 0;
|
|
22
|
-
const block_view_1 = __importDefault(require("./block_view"));
|
|
23
|
-
const creators_1 = require("./creators");
|
|
24
|
-
class ListingElementView extends block_view_1.default {
|
|
25
|
-
constructor() {
|
|
26
|
-
super(...arguments);
|
|
27
|
-
this.elementType = 'figure';
|
|
28
|
-
this.updateContents = () => {
|
|
29
|
-
const { suppressCaption, suppressTitle } = this.node.attrs;
|
|
30
|
-
this.dom.classList.toggle('suppress-caption', suppressCaption);
|
|
31
|
-
this.dom.classList.toggle('suppress-title', suppressTitle === undefined ? true : suppressTitle);
|
|
32
|
-
};
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
exports.ListingElementView = ListingElementView;
|
|
36
|
-
exports.default = (0, creators_1.createNodeView)(ListingElementView);
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*!
|
|
3
|
-
* © 2019 Atypon Systems LLC
|
|
4
|
-
*
|
|
5
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
-
* you may not use this file except in compliance with the License.
|
|
7
|
-
* You may obtain a copy of the License at
|
|
8
|
-
*
|
|
9
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
-
*
|
|
11
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
-
* See the License for the specific language governing permissions and
|
|
15
|
-
* limitations under the License.
|
|
16
|
-
*/
|
|
17
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
const creators_1 = require("./creators");
|
|
19
|
-
const editable_block_1 = require("./editable_block");
|
|
20
|
-
const listing_element_1 = require("./listing_element");
|
|
21
|
-
exports.default = (0, creators_1.createEditableNodeView)((0, editable_block_1.EditableBlock)(listing_element_1.ListingElementView));
|
|
@@ -1,192 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* © 2019 Atypon Systems LLC
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
* you may not use this file except in compliance with the License.
|
|
6
|
-
* You may obtain a copy of the License at
|
|
7
|
-
*
|
|
8
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
15
|
-
*/
|
|
16
|
-
import 'codemirror/mode/apl/apl';
|
|
17
|
-
import 'codemirror/mode/asciiarmor/asciiarmor';
|
|
18
|
-
import 'codemirror/mode/asn.1/asn.1';
|
|
19
|
-
import 'codemirror/mode/asterisk/asterisk';
|
|
20
|
-
import 'codemirror/mode/brainfuck/brainfuck';
|
|
21
|
-
import 'codemirror/mode/clike/clike';
|
|
22
|
-
import 'codemirror/mode/clojure/clojure';
|
|
23
|
-
import 'codemirror/mode/cmake/cmake';
|
|
24
|
-
import 'codemirror/mode/cobol/cobol';
|
|
25
|
-
import 'codemirror/mode/coffeescript/coffeescript';
|
|
26
|
-
import 'codemirror/mode/commonlisp/commonlisp';
|
|
27
|
-
import 'codemirror/mode/crystal/crystal';
|
|
28
|
-
import 'codemirror/mode/css/css';
|
|
29
|
-
import 'codemirror/mode/cypher/cypher';
|
|
30
|
-
import 'codemirror/mode/d/d';
|
|
31
|
-
import 'codemirror/mode/dart/dart';
|
|
32
|
-
import 'codemirror/mode/diff/diff';
|
|
33
|
-
import 'codemirror/mode/django/django';
|
|
34
|
-
import 'codemirror/mode/dockerfile/dockerfile';
|
|
35
|
-
import 'codemirror/mode/dtd/dtd';
|
|
36
|
-
import 'codemirror/mode/dylan/dylan';
|
|
37
|
-
import 'codemirror/mode/ebnf/ebnf';
|
|
38
|
-
import 'codemirror/mode/ecl/ecl';
|
|
39
|
-
import 'codemirror/mode/eiffel/eiffel';
|
|
40
|
-
import 'codemirror/mode/elm/elm';
|
|
41
|
-
import 'codemirror/mode/erlang/erlang';
|
|
42
|
-
import 'codemirror/mode/factor/factor';
|
|
43
|
-
import 'codemirror/mode/fcl/fcl';
|
|
44
|
-
import 'codemirror/mode/forth/forth';
|
|
45
|
-
import 'codemirror/mode/fortran/fortran';
|
|
46
|
-
import 'codemirror/mode/gas/gas';
|
|
47
|
-
import 'codemirror/mode/gfm/gfm';
|
|
48
|
-
import 'codemirror/mode/gherkin/gherkin';
|
|
49
|
-
import 'codemirror/mode/go/go';
|
|
50
|
-
import 'codemirror/mode/groovy/groovy';
|
|
51
|
-
import 'codemirror/mode/haml/haml';
|
|
52
|
-
import 'codemirror/mode/handlebars/handlebars';
|
|
53
|
-
import 'codemirror/mode/haskell-literate/haskell-literate';
|
|
54
|
-
import 'codemirror/mode/haskell/haskell';
|
|
55
|
-
import 'codemirror/mode/haxe/haxe';
|
|
56
|
-
import 'codemirror/mode/htmlembedded/htmlembedded';
|
|
57
|
-
import 'codemirror/mode/htmlmixed/htmlmixed';
|
|
58
|
-
import 'codemirror/mode/http/http';
|
|
59
|
-
import 'codemirror/mode/idl/idl';
|
|
60
|
-
import 'codemirror/mode/javascript/javascript';
|
|
61
|
-
import 'codemirror/mode/jinja2/jinja2';
|
|
62
|
-
import 'codemirror/mode/jsx/jsx';
|
|
63
|
-
import 'codemirror/mode/julia/julia';
|
|
64
|
-
import 'codemirror/mode/livescript/livescript';
|
|
65
|
-
import 'codemirror/mode/lua/lua';
|
|
66
|
-
import 'codemirror/mode/markdown/markdown';
|
|
67
|
-
import 'codemirror/mode/mathematica/mathematica';
|
|
68
|
-
import 'codemirror/mode/mbox/mbox';
|
|
69
|
-
import 'codemirror/mode/mirc/mirc';
|
|
70
|
-
import 'codemirror/mode/mllike/mllike';
|
|
71
|
-
import 'codemirror/mode/modelica/modelica';
|
|
72
|
-
import 'codemirror/mode/mscgen/mscgen';
|
|
73
|
-
import 'codemirror/mode/mumps/mumps';
|
|
74
|
-
import 'codemirror/mode/nginx/nginx';
|
|
75
|
-
import 'codemirror/mode/nsis/nsis';
|
|
76
|
-
import 'codemirror/mode/ntriples/ntriples';
|
|
77
|
-
import 'codemirror/mode/octave/octave';
|
|
78
|
-
import 'codemirror/mode/oz/oz';
|
|
79
|
-
import 'codemirror/mode/pascal/pascal';
|
|
80
|
-
import 'codemirror/mode/pegjs/pegjs';
|
|
81
|
-
import 'codemirror/mode/perl/perl';
|
|
82
|
-
import 'codemirror/mode/php/php';
|
|
83
|
-
import 'codemirror/mode/pig/pig';
|
|
84
|
-
import 'codemirror/mode/powershell/powershell';
|
|
85
|
-
import 'codemirror/mode/properties/properties';
|
|
86
|
-
import 'codemirror/mode/protobuf/protobuf';
|
|
87
|
-
import 'codemirror/mode/pug/pug';
|
|
88
|
-
import 'codemirror/mode/puppet/puppet';
|
|
89
|
-
import 'codemirror/mode/python/python';
|
|
90
|
-
import 'codemirror/mode/q/q';
|
|
91
|
-
import 'codemirror/mode/r/r';
|
|
92
|
-
import 'codemirror/mode/rpm/rpm';
|
|
93
|
-
import 'codemirror/mode/rst/rst';
|
|
94
|
-
import 'codemirror/mode/ruby/ruby';
|
|
95
|
-
import 'codemirror/mode/rust/rust';
|
|
96
|
-
import 'codemirror/mode/sas/sas';
|
|
97
|
-
import 'codemirror/mode/sass/sass';
|
|
98
|
-
import 'codemirror/mode/scheme/scheme';
|
|
99
|
-
import 'codemirror/mode/shell/shell';
|
|
100
|
-
import 'codemirror/mode/sieve/sieve';
|
|
101
|
-
import 'codemirror/mode/slim/slim';
|
|
102
|
-
import 'codemirror/mode/smalltalk/smalltalk';
|
|
103
|
-
import 'codemirror/mode/smarty/smarty';
|
|
104
|
-
import 'codemirror/mode/solr/solr';
|
|
105
|
-
import 'codemirror/mode/soy/soy';
|
|
106
|
-
import 'codemirror/mode/sparql/sparql';
|
|
107
|
-
import 'codemirror/mode/spreadsheet/spreadsheet';
|
|
108
|
-
import 'codemirror/mode/sql/sql';
|
|
109
|
-
import 'codemirror/mode/stex/stex';
|
|
110
|
-
import 'codemirror/mode/stylus/stylus';
|
|
111
|
-
import 'codemirror/mode/swift/swift';
|
|
112
|
-
import 'codemirror/mode/tcl/tcl';
|
|
113
|
-
import 'codemirror/mode/textile/textile';
|
|
114
|
-
import 'codemirror/mode/tiddlywiki/tiddlywiki';
|
|
115
|
-
import 'codemirror/mode/tiki/tiki';
|
|
116
|
-
import 'codemirror/mode/toml/toml';
|
|
117
|
-
import 'codemirror/mode/tornado/tornado';
|
|
118
|
-
import 'codemirror/mode/troff/troff';
|
|
119
|
-
import 'codemirror/mode/ttcn-cfg/ttcn-cfg';
|
|
120
|
-
import 'codemirror/mode/ttcn/ttcn';
|
|
121
|
-
import 'codemirror/mode/turtle/turtle';
|
|
122
|
-
import 'codemirror/mode/twig/twig';
|
|
123
|
-
import 'codemirror/mode/vb/vb';
|
|
124
|
-
import 'codemirror/mode/vbscript/vbscript';
|
|
125
|
-
import 'codemirror/mode/velocity/velocity';
|
|
126
|
-
import 'codemirror/mode/verilog/verilog';
|
|
127
|
-
import 'codemirror/mode/vhdl/vhdl';
|
|
128
|
-
import 'codemirror/mode/vue/vue';
|
|
129
|
-
import 'codemirror/mode/webidl/webidl';
|
|
130
|
-
import 'codemirror/mode/xml/xml';
|
|
131
|
-
import 'codemirror/mode/xquery/xquery';
|
|
132
|
-
import 'codemirror/mode/yacas/yacas';
|
|
133
|
-
import 'codemirror/mode/yaml-frontmatter/yaml-frontmatter';
|
|
134
|
-
import 'codemirror/mode/yaml/yaml';
|
|
135
|
-
import 'codemirror/mode/z80/z80';
|
|
136
|
-
export const codemirrorModeLabels = {
|
|
137
|
-
clojure: 'Clojure',
|
|
138
|
-
cobol: 'COBOL',
|
|
139
|
-
css: 'CSS',
|
|
140
|
-
go: 'Go',
|
|
141
|
-
javascript: 'JavaScript',
|
|
142
|
-
json: 'JSON',
|
|
143
|
-
jsonld: 'JSON-LD',
|
|
144
|
-
jsx: 'JSX',
|
|
145
|
-
julia: 'Julia',
|
|
146
|
-
python: 'Python',
|
|
147
|
-
r: 'R',
|
|
148
|
-
ruby: 'Ruby',
|
|
149
|
-
rust: 'Rust',
|
|
150
|
-
shell: 'Shell',
|
|
151
|
-
sparql: 'SPARQL',
|
|
152
|
-
sql: 'SQL',
|
|
153
|
-
swift: 'Swift',
|
|
154
|
-
turtle: 'Turtle',
|
|
155
|
-
twig: 'Twig',
|
|
156
|
-
typescript: 'TypeScript',
|
|
157
|
-
xml: 'XML',
|
|
158
|
-
yaml: 'YAML',
|
|
159
|
-
};
|
|
160
|
-
export const codemirrorModeOptions = {
|
|
161
|
-
typescript: {
|
|
162
|
-
name: 'javascript',
|
|
163
|
-
typescript: true,
|
|
164
|
-
},
|
|
165
|
-
json: {
|
|
166
|
-
name: 'javascript',
|
|
167
|
-
json: true,
|
|
168
|
-
},
|
|
169
|
-
jsonld: {
|
|
170
|
-
name: 'javascript',
|
|
171
|
-
jsonld: true,
|
|
172
|
-
},
|
|
173
|
-
};
|
|
174
|
-
export const codemirrorModeGroups = {
|
|
175
|
-
Language: [
|
|
176
|
-
'clojure',
|
|
177
|
-
'cobol',
|
|
178
|
-
'go',
|
|
179
|
-
'javascript',
|
|
180
|
-
'julia',
|
|
181
|
-
'python',
|
|
182
|
-
'r',
|
|
183
|
-
'ruby',
|
|
184
|
-
'rust',
|
|
185
|
-
'swift',
|
|
186
|
-
'typescript',
|
|
187
|
-
],
|
|
188
|
-
Data: ['json', 'jsonld', 'turtle', 'xml', 'yaml'],
|
|
189
|
-
Markup: ['jsx', 'twig'],
|
|
190
|
-
Query: ['sql', 'sparql'],
|
|
191
|
-
Other: ['css', 'shell'],
|
|
192
|
-
};
|
package/dist/es/views/listing.js
DELETED
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* © 2019 Atypon Systems LLC
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
* you may not use this file except in compliance with the License.
|
|
6
|
-
* You may obtain a copy of the License at
|
|
7
|
-
*
|
|
8
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
15
|
-
*/
|
|
16
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
17
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
18
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
19
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
20
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
21
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
22
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
23
|
-
});
|
|
24
|
-
};
|
|
25
|
-
import { BaseNodeView } from './base_node_view';
|
|
26
|
-
import { createNodeView } from './creators';
|
|
27
|
-
export class ListingView extends BaseNodeView {
|
|
28
|
-
constructor() {
|
|
29
|
-
super(...arguments);
|
|
30
|
-
this.ignoreMutation = () => true;
|
|
31
|
-
this.initialise = () => {
|
|
32
|
-
this.createDOM();
|
|
33
|
-
this.updateContents();
|
|
34
|
-
};
|
|
35
|
-
this.updateContents = () => {
|
|
36
|
-
const { contents, isExpanded } = this.node.attrs;
|
|
37
|
-
if (this.editor) {
|
|
38
|
-
if (isExpanded) {
|
|
39
|
-
this.editor.refresh();
|
|
40
|
-
}
|
|
41
|
-
if (contents !== this.editor.getValue()) {
|
|
42
|
-
this.editor.setValue(contents);
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
};
|
|
46
|
-
this.createDOM = () => {
|
|
47
|
-
this.dom = document.createElement('div');
|
|
48
|
-
this.dom.classList.add('listing');
|
|
49
|
-
this.container = document.createElement('div');
|
|
50
|
-
this.dom.appendChild(this.container);
|
|
51
|
-
this.createEditor().catch((error) => {
|
|
52
|
-
console.error(error);
|
|
53
|
-
});
|
|
54
|
-
};
|
|
55
|
-
this.createEditor = (defaultPlaceholder = '<Listing>') => __awaiter(this, void 0, void 0, function* () {
|
|
56
|
-
const { contents, languageKey, placeholder } = this.node.attrs;
|
|
57
|
-
const { createEditor } = yield import('../lib/codemirror');
|
|
58
|
-
const { codemirrorModeOptions } = yield import('../lib/codemirror-modes');
|
|
59
|
-
this.editor = yield createEditor({
|
|
60
|
-
readOnly: true,
|
|
61
|
-
value: contents,
|
|
62
|
-
mode: languageKey in codemirrorModeOptions
|
|
63
|
-
? codemirrorModeOptions[languageKey]
|
|
64
|
-
: languageKey,
|
|
65
|
-
placeholder: placeholder || defaultPlaceholder,
|
|
66
|
-
autofocus: false,
|
|
67
|
-
});
|
|
68
|
-
this.container.appendChild(this.editor.getWrapperElement());
|
|
69
|
-
this.refreshEditor();
|
|
70
|
-
});
|
|
71
|
-
this.refreshEditor = () => {
|
|
72
|
-
window.requestAnimationFrame(() => {
|
|
73
|
-
this.editor.refresh();
|
|
74
|
-
});
|
|
75
|
-
};
|
|
76
|
-
this.focusEditor = () => {
|
|
77
|
-
window.requestAnimationFrame(() => {
|
|
78
|
-
this.editor.focus();
|
|
79
|
-
});
|
|
80
|
-
};
|
|
81
|
-
this.toggleListing = (isExpanded) => {
|
|
82
|
-
this.setNodeAttrs({ isExpanded });
|
|
83
|
-
if (isExpanded) {
|
|
84
|
-
this.refreshEditor();
|
|
85
|
-
this.focusEditor();
|
|
86
|
-
}
|
|
87
|
-
};
|
|
88
|
-
this.setNodeAttrs = (attrs) => {
|
|
89
|
-
this.view.dispatch(this.view.state.tr.setNodeMarkup(this.getPos(), undefined, Object.assign(Object.assign({}, this.node.attrs), attrs)));
|
|
90
|
-
};
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
export default createNodeView(ListingView);
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* © 2019 Atypon Systems LLC
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
* you may not use this file except in compliance with the License.
|
|
6
|
-
* You may obtain a copy of the License at
|
|
7
|
-
*
|
|
8
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
15
|
-
*/
|
|
16
|
-
import { createEditableNodeView } from './creators';
|
|
17
|
-
import { ListingView } from './listing';
|
|
18
|
-
export class ListingEditableView extends ListingView {
|
|
19
|
-
constructor() {
|
|
20
|
-
super(...arguments);
|
|
21
|
-
this.needsFocus = false;
|
|
22
|
-
this.selectNode = () => {
|
|
23
|
-
this.needsFocus = true;
|
|
24
|
-
if (this.editor) {
|
|
25
|
-
this.editor.focus();
|
|
26
|
-
}
|
|
27
|
-
};
|
|
28
|
-
this.createDOM = () => {
|
|
29
|
-
this.dom = document.createElement('div');
|
|
30
|
-
this.dom.classList.add('listing');
|
|
31
|
-
};
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
export default createEditableNodeView(ListingEditableView);
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* © 2019 Atypon Systems LLC
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
* you may not use this file except in compliance with the License.
|
|
6
|
-
* You may obtain a copy of the License at
|
|
7
|
-
*
|
|
8
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
15
|
-
*/
|
|
16
|
-
import BlockView from './block_view';
|
|
17
|
-
import { createNodeView } from './creators';
|
|
18
|
-
export class ListingElementView extends BlockView {
|
|
19
|
-
constructor() {
|
|
20
|
-
super(...arguments);
|
|
21
|
-
this.elementType = 'figure';
|
|
22
|
-
this.updateContents = () => {
|
|
23
|
-
const { suppressCaption, suppressTitle } = this.node.attrs;
|
|
24
|
-
this.dom.classList.toggle('suppress-caption', suppressCaption);
|
|
25
|
-
this.dom.classList.toggle('suppress-title', suppressTitle === undefined ? true : suppressTitle);
|
|
26
|
-
};
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
export default createNodeView(ListingElementView);
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* © 2019 Atypon Systems LLC
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
* you may not use this file except in compliance with the License.
|
|
6
|
-
* You may obtain a copy of the License at
|
|
7
|
-
*
|
|
8
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
15
|
-
*/
|
|
16
|
-
import { createEditableNodeView } from './creators';
|
|
17
|
-
import { EditableBlock } from './editable_block';
|
|
18
|
-
import { ListingElementView } from './listing_element';
|
|
19
|
-
export default createEditableNodeView(EditableBlock(ListingElementView));
|
|
@@ -1,172 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* © 2019 Atypon Systems LLC
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
* you may not use this file except in compliance with the License.
|
|
6
|
-
* You may obtain a copy of the License at
|
|
7
|
-
*
|
|
8
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
15
|
-
*/
|
|
16
|
-
import 'codemirror/mode/apl/apl';
|
|
17
|
-
import 'codemirror/mode/asciiarmor/asciiarmor';
|
|
18
|
-
import 'codemirror/mode/asn.1/asn.1';
|
|
19
|
-
import 'codemirror/mode/asterisk/asterisk';
|
|
20
|
-
import 'codemirror/mode/brainfuck/brainfuck';
|
|
21
|
-
import 'codemirror/mode/clike/clike';
|
|
22
|
-
import 'codemirror/mode/clojure/clojure';
|
|
23
|
-
import 'codemirror/mode/cmake/cmake';
|
|
24
|
-
import 'codemirror/mode/cobol/cobol';
|
|
25
|
-
import 'codemirror/mode/coffeescript/coffeescript';
|
|
26
|
-
import 'codemirror/mode/commonlisp/commonlisp';
|
|
27
|
-
import 'codemirror/mode/crystal/crystal';
|
|
28
|
-
import 'codemirror/mode/css/css';
|
|
29
|
-
import 'codemirror/mode/cypher/cypher';
|
|
30
|
-
import 'codemirror/mode/d/d';
|
|
31
|
-
import 'codemirror/mode/dart/dart';
|
|
32
|
-
import 'codemirror/mode/diff/diff';
|
|
33
|
-
import 'codemirror/mode/django/django';
|
|
34
|
-
import 'codemirror/mode/dockerfile/dockerfile';
|
|
35
|
-
import 'codemirror/mode/dtd/dtd';
|
|
36
|
-
import 'codemirror/mode/dylan/dylan';
|
|
37
|
-
import 'codemirror/mode/ebnf/ebnf';
|
|
38
|
-
import 'codemirror/mode/ecl/ecl';
|
|
39
|
-
import 'codemirror/mode/eiffel/eiffel';
|
|
40
|
-
import 'codemirror/mode/elm/elm';
|
|
41
|
-
import 'codemirror/mode/erlang/erlang';
|
|
42
|
-
import 'codemirror/mode/factor/factor';
|
|
43
|
-
import 'codemirror/mode/fcl/fcl';
|
|
44
|
-
import 'codemirror/mode/forth/forth';
|
|
45
|
-
import 'codemirror/mode/fortran/fortran';
|
|
46
|
-
import 'codemirror/mode/gas/gas';
|
|
47
|
-
import 'codemirror/mode/gfm/gfm';
|
|
48
|
-
import 'codemirror/mode/gherkin/gherkin';
|
|
49
|
-
import 'codemirror/mode/go/go';
|
|
50
|
-
import 'codemirror/mode/groovy/groovy';
|
|
51
|
-
import 'codemirror/mode/haml/haml';
|
|
52
|
-
import 'codemirror/mode/handlebars/handlebars';
|
|
53
|
-
import 'codemirror/mode/haskell-literate/haskell-literate';
|
|
54
|
-
import 'codemirror/mode/haskell/haskell';
|
|
55
|
-
import 'codemirror/mode/haxe/haxe';
|
|
56
|
-
import 'codemirror/mode/htmlembedded/htmlembedded';
|
|
57
|
-
import 'codemirror/mode/htmlmixed/htmlmixed';
|
|
58
|
-
import 'codemirror/mode/http/http';
|
|
59
|
-
import 'codemirror/mode/idl/idl';
|
|
60
|
-
import 'codemirror/mode/javascript/javascript';
|
|
61
|
-
import 'codemirror/mode/jinja2/jinja2';
|
|
62
|
-
import 'codemirror/mode/jsx/jsx';
|
|
63
|
-
import 'codemirror/mode/julia/julia';
|
|
64
|
-
import 'codemirror/mode/livescript/livescript';
|
|
65
|
-
import 'codemirror/mode/lua/lua';
|
|
66
|
-
import 'codemirror/mode/markdown/markdown';
|
|
67
|
-
import 'codemirror/mode/mathematica/mathematica';
|
|
68
|
-
import 'codemirror/mode/mbox/mbox';
|
|
69
|
-
import 'codemirror/mode/mirc/mirc';
|
|
70
|
-
import 'codemirror/mode/mllike/mllike';
|
|
71
|
-
import 'codemirror/mode/modelica/modelica';
|
|
72
|
-
import 'codemirror/mode/mscgen/mscgen';
|
|
73
|
-
import 'codemirror/mode/mumps/mumps';
|
|
74
|
-
import 'codemirror/mode/nginx/nginx';
|
|
75
|
-
import 'codemirror/mode/nsis/nsis';
|
|
76
|
-
import 'codemirror/mode/ntriples/ntriples';
|
|
77
|
-
import 'codemirror/mode/octave/octave';
|
|
78
|
-
import 'codemirror/mode/oz/oz';
|
|
79
|
-
import 'codemirror/mode/pascal/pascal';
|
|
80
|
-
import 'codemirror/mode/pegjs/pegjs';
|
|
81
|
-
import 'codemirror/mode/perl/perl';
|
|
82
|
-
import 'codemirror/mode/php/php';
|
|
83
|
-
import 'codemirror/mode/pig/pig';
|
|
84
|
-
import 'codemirror/mode/powershell/powershell';
|
|
85
|
-
import 'codemirror/mode/properties/properties';
|
|
86
|
-
import 'codemirror/mode/protobuf/protobuf';
|
|
87
|
-
import 'codemirror/mode/pug/pug';
|
|
88
|
-
import 'codemirror/mode/puppet/puppet';
|
|
89
|
-
import 'codemirror/mode/python/python';
|
|
90
|
-
import 'codemirror/mode/q/q';
|
|
91
|
-
import 'codemirror/mode/r/r';
|
|
92
|
-
import 'codemirror/mode/rpm/rpm';
|
|
93
|
-
import 'codemirror/mode/rst/rst';
|
|
94
|
-
import 'codemirror/mode/ruby/ruby';
|
|
95
|
-
import 'codemirror/mode/rust/rust';
|
|
96
|
-
import 'codemirror/mode/sas/sas';
|
|
97
|
-
import 'codemirror/mode/sass/sass';
|
|
98
|
-
import 'codemirror/mode/scheme/scheme';
|
|
99
|
-
import 'codemirror/mode/shell/shell';
|
|
100
|
-
import 'codemirror/mode/sieve/sieve';
|
|
101
|
-
import 'codemirror/mode/slim/slim';
|
|
102
|
-
import 'codemirror/mode/smalltalk/smalltalk';
|
|
103
|
-
import 'codemirror/mode/smarty/smarty';
|
|
104
|
-
import 'codemirror/mode/solr/solr';
|
|
105
|
-
import 'codemirror/mode/soy/soy';
|
|
106
|
-
import 'codemirror/mode/sparql/sparql';
|
|
107
|
-
import 'codemirror/mode/spreadsheet/spreadsheet';
|
|
108
|
-
import 'codemirror/mode/sql/sql';
|
|
109
|
-
import 'codemirror/mode/stex/stex';
|
|
110
|
-
import 'codemirror/mode/stylus/stylus';
|
|
111
|
-
import 'codemirror/mode/swift/swift';
|
|
112
|
-
import 'codemirror/mode/tcl/tcl';
|
|
113
|
-
import 'codemirror/mode/textile/textile';
|
|
114
|
-
import 'codemirror/mode/tiddlywiki/tiddlywiki';
|
|
115
|
-
import 'codemirror/mode/tiki/tiki';
|
|
116
|
-
import 'codemirror/mode/toml/toml';
|
|
117
|
-
import 'codemirror/mode/tornado/tornado';
|
|
118
|
-
import 'codemirror/mode/troff/troff';
|
|
119
|
-
import 'codemirror/mode/ttcn-cfg/ttcn-cfg';
|
|
120
|
-
import 'codemirror/mode/ttcn/ttcn';
|
|
121
|
-
import 'codemirror/mode/turtle/turtle';
|
|
122
|
-
import 'codemirror/mode/twig/twig';
|
|
123
|
-
import 'codemirror/mode/vb/vb';
|
|
124
|
-
import 'codemirror/mode/vbscript/vbscript';
|
|
125
|
-
import 'codemirror/mode/velocity/velocity';
|
|
126
|
-
import 'codemirror/mode/verilog/verilog';
|
|
127
|
-
import 'codemirror/mode/vhdl/vhdl';
|
|
128
|
-
import 'codemirror/mode/vue/vue';
|
|
129
|
-
import 'codemirror/mode/webidl/webidl';
|
|
130
|
-
import 'codemirror/mode/xml/xml';
|
|
131
|
-
import 'codemirror/mode/xquery/xquery';
|
|
132
|
-
import 'codemirror/mode/yacas/yacas';
|
|
133
|
-
import 'codemirror/mode/yaml-frontmatter/yaml-frontmatter';
|
|
134
|
-
import 'codemirror/mode/yaml/yaml';
|
|
135
|
-
import 'codemirror/mode/z80/z80';
|
|
136
|
-
export declare const codemirrorModeLabels: {
|
|
137
|
-
clojure: string;
|
|
138
|
-
cobol: string;
|
|
139
|
-
css: string;
|
|
140
|
-
go: string;
|
|
141
|
-
javascript: string;
|
|
142
|
-
json: string;
|
|
143
|
-
jsonld: string;
|
|
144
|
-
jsx: string;
|
|
145
|
-
julia: string;
|
|
146
|
-
python: string;
|
|
147
|
-
r: string;
|
|
148
|
-
ruby: string;
|
|
149
|
-
rust: string;
|
|
150
|
-
shell: string;
|
|
151
|
-
sparql: string;
|
|
152
|
-
sql: string;
|
|
153
|
-
swift: string;
|
|
154
|
-
turtle: string;
|
|
155
|
-
twig: string;
|
|
156
|
-
typescript: string;
|
|
157
|
-
xml: string;
|
|
158
|
-
yaml: string;
|
|
159
|
-
};
|
|
160
|
-
export type CodemirrorMode = keyof typeof codemirrorModeLabels;
|
|
161
|
-
interface ModeDescription {
|
|
162
|
-
name: string;
|
|
163
|
-
[key: string]: unknown;
|
|
164
|
-
}
|
|
165
|
-
export declare const codemirrorModeOptions: {
|
|
166
|
-
[key in CodemirrorMode]?: ModeDescription;
|
|
167
|
-
};
|
|
168
|
-
interface Groups {
|
|
169
|
-
[key: string]: CodemirrorMode[];
|
|
170
|
-
}
|
|
171
|
-
export declare const codemirrorModeGroups: Groups;
|
|
172
|
-
export {};
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* © 2019 Atypon Systems LLC
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
* you may not use this file except in compliance with the License.
|
|
6
|
-
* You may obtain a copy of the License at
|
|
7
|
-
*
|
|
8
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
15
|
-
*/
|
|
16
|
-
import { ManuscriptNodeView } from '@manuscripts/transform';
|
|
17
|
-
import CodeMirror from 'codemirror';
|
|
18
|
-
import { BaseNodeProps, BaseNodeView } from './base_node_view';
|
|
19
|
-
export declare class ListingView<PropsType extends BaseNodeProps> extends BaseNodeView<PropsType> implements ManuscriptNodeView {
|
|
20
|
-
protected container: HTMLElement;
|
|
21
|
-
protected attachmentsNode: HTMLElement;
|
|
22
|
-
protected outputNode: HTMLElement;
|
|
23
|
-
protected editor: CodeMirror.Editor;
|
|
24
|
-
ignoreMutation: () => boolean;
|
|
25
|
-
initialise: () => void;
|
|
26
|
-
updateContents: () => void;
|
|
27
|
-
protected createDOM: () => void;
|
|
28
|
-
protected createEditor: (defaultPlaceholder?: string) => Promise<void>;
|
|
29
|
-
protected refreshEditor: () => void;
|
|
30
|
-
protected focusEditor: () => void;
|
|
31
|
-
protected toggleListing: (isExpanded: boolean) => void;
|
|
32
|
-
protected setNodeAttrs: (attrs: Record<string, unknown>) => void;
|
|
33
|
-
}
|
|
34
|
-
declare const _default: (props: BaseNodeProps, dispatch?: import("..").Dispatch | undefined) => import("../types").NodeViewCreator<ListingView<any>>;
|
|
35
|
-
export default _default;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* © 2019 Atypon Systems LLC
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
* you may not use this file except in compliance with the License.
|
|
6
|
-
* You may obtain a copy of the License at
|
|
7
|
-
*
|
|
8
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
15
|
-
*/
|
|
16
|
-
import { EditableBlockProps } from './editable_block';
|
|
17
|
-
import { ListingView } from './listing';
|
|
18
|
-
export declare class ListingEditableView extends ListingView<EditableBlockProps> {
|
|
19
|
-
protected needsFocus: boolean;
|
|
20
|
-
selectNode: () => void;
|
|
21
|
-
protected createDOM: () => void;
|
|
22
|
-
}
|
|
23
|
-
declare const _default: (props: EditableBlockProps, dispatch?: import("..").Dispatch | undefined) => import("../types").NodeViewCreator<ListingEditableView>;
|
|
24
|
-
export default _default;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* © 2019 Atypon Systems LLC
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
* you may not use this file except in compliance with the License.
|
|
6
|
-
* You may obtain a copy of the License at
|
|
7
|
-
*
|
|
8
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
15
|
-
*/
|
|
16
|
-
import { ManuscriptNodeView } from '@manuscripts/transform';
|
|
17
|
-
import { BaseNodeProps } from './base_node_view';
|
|
18
|
-
import BlockView from './block_view';
|
|
19
|
-
export declare class ListingElementView<PropsType extends BaseNodeProps> extends BlockView<PropsType> implements ManuscriptNodeView {
|
|
20
|
-
elementType: string;
|
|
21
|
-
updateContents: () => void;
|
|
22
|
-
}
|
|
23
|
-
declare const _default: (props: BaseNodeProps, dispatch?: import("..").Dispatch | undefined) => import("../types").NodeViewCreator<ListingElementView<any>>;
|
|
24
|
-
export default _default;
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* © 2019 Atypon Systems LLC
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
* you may not use this file except in compliance with the License.
|
|
6
|
-
* You may obtain a copy of the License at
|
|
7
|
-
*
|
|
8
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
15
|
-
*/
|
|
16
|
-
import { ListingElementView } from './listing_element';
|
|
17
|
-
declare const _default: (props: import("./editable_block").EditableBlockProps, dispatch?: import("..").Dispatch | undefined) => import("../types").NodeViewCreator<{
|
|
18
|
-
gutterButtons: () => HTMLElement[];
|
|
19
|
-
actionGutterButtons: () => HTMLElement[];
|
|
20
|
-
createAddButton: () => HTMLElement | null;
|
|
21
|
-
createEditButton: () => HTMLElement | null;
|
|
22
|
-
createMenu: () => import("../lib/context-menu").ContextMenu;
|
|
23
|
-
viewAttributes: {
|
|
24
|
-
id: string;
|
|
25
|
-
placeholder: string;
|
|
26
|
-
paragraphStyle: string;
|
|
27
|
-
};
|
|
28
|
-
initialise: () => void;
|
|
29
|
-
updateContents: () => void;
|
|
30
|
-
onUpdateContent(): void;
|
|
31
|
-
updateClasses: () => void;
|
|
32
|
-
updateAttributes: () => void;
|
|
33
|
-
createElement: () => void;
|
|
34
|
-
createDOM: () => void;
|
|
35
|
-
createGutter: (className: string, buttons: HTMLElement[]) => void;
|
|
36
|
-
dom: HTMLElement;
|
|
37
|
-
contentDOM?: HTMLElement | undefined;
|
|
38
|
-
syncErrors: import("../types").SyncError[];
|
|
39
|
-
elementType: string;
|
|
40
|
-
readonly props: import("./editable_block").EditableBlockProps;
|
|
41
|
-
node: import("prosemirror-model").Node;
|
|
42
|
-
readonly view: import("prosemirror-view").EditorView;
|
|
43
|
-
readonly getPos: () => number;
|
|
44
|
-
decorations: readonly import("prosemirror-view").Decoration[];
|
|
45
|
-
update: (newNode: import("prosemirror-model").Node, decorations: readonly import("prosemirror-view").Decoration[]) => boolean;
|
|
46
|
-
setDomAttrs(node: import("prosemirror-model").Node, element: HTMLElement, omit?: string[]): void;
|
|
47
|
-
selectNode: () => void;
|
|
48
|
-
deselectNode: () => void;
|
|
49
|
-
destroy: () => void;
|
|
50
|
-
handleDecorations: (decorations: readonly import("prosemirror-view").Decoration[]) => void;
|
|
51
|
-
} & ListingElementView<any>>;
|
|
52
|
-
export default _default;
|