@modusoperandi/licit 0.13.25 → 0.14.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.
- package/.eslintrc.js +1 -1
- package/README.md +1 -0
- package/dist/BlockquoteInsertNewLineCommand.js +3 -23
- package/dist/BlockquoteNodeSpec.js +3 -13
- package/dist/BlockquoteToggleCommand.js +3 -16
- package/dist/BookmarkNodeSpec.js +0 -6
- package/dist/BulletListNodeSpec.js +2 -16
- package/dist/CZIProseMirror.js +3 -27
- package/dist/CodeBlockCommand.js +3 -19
- package/dist/CodeBlockNodeSpec.js +3 -4
- package/dist/CodeMarkSpec.js +0 -4
- package/dist/ContentPlaceholderPlugin.js +6 -58
- package/dist/CursorPlaceholderPlugin.js +2 -32
- package/dist/DocLayoutCommand.js +5 -28
- package/dist/DocNodeSpec.js +0 -9
- package/dist/EMMarkSpec.js +0 -4
- package/dist/EditorCommands.js +5 -33
- package/dist/EditorKeyMap.js +4 -18
- package/dist/EditorMarks.js +2 -26
- package/dist/EditorNodes.js +4 -22
- package/dist/EditorPageLayoutPlugin.js +3 -15
- package/dist/EditorPlugins.js +0 -4
- package/dist/EditorSchema.js +0 -5
- package/dist/EditorState.js +0 -2
- package/dist/FontSizeMarkSpec.js +0 -12
- package/dist/FontTypeMarkSpec.js +15 -19
- package/dist/HTMLMutator.js +5 -24
- package/dist/HardBreakNodeSpec.js +0 -2
- package/dist/HeadingNodeSpec.js +6 -15
- package/dist/HistoryRedoCommand.js +3 -11
- package/dist/HistoryUndoCommand.js +3 -11
- package/dist/HorizontalRuleCommand.js +3 -22
- package/dist/HorizontalRuleNodeSpec.js +0 -10
- package/dist/ImageFromURLCommand.js +0 -9
- package/dist/ImageNodeSpec.js +2 -14
- package/dist/ImageSourceCommand.js +3 -39
- package/dist/ImageUploadCommand.js +3 -21
- package/dist/ImageUploadPlaceholderPlugin.js +10 -48
- package/dist/LinkMarkSpec.js +0 -4
- package/dist/LinkSetURLCommand.js +3 -28
- package/dist/LinkTooltipPlugin.js +6 -52
- package/dist/ListItemInsertNewLineCommand.js +3 -23
- package/dist/ListItemMergeCommand.js +15 -66
- package/dist/ListItemNodeSpec.js +0 -11
- package/dist/ListSplitCommand.js +3 -14
- package/dist/ListToggleCommand.js +5 -26
- package/dist/MarksClearCommand.js +6 -17
- package/dist/MathEditCommand.js +3 -38
- package/dist/MathNodeSpec.js +0 -10
- package/dist/OrderedListNodeSpec.js +0 -24
- package/dist/ParagraphNodeSpec.js +5 -26
- package/dist/ParagraphSpacingCommand.js +3 -32
- package/dist/PrintCommand.js +3 -13
- package/dist/SelectionPlaceholderPlugin.js +2 -31
- package/dist/SpacerMarkSpec.js +2 -6
- package/dist/StrikeMarkSpec.js +0 -4
- package/dist/StrongMarkSpec.js +2 -5
- package/dist/StyleView.js +1 -7
- package/dist/TableBackgroundColorCommand.js +3 -24
- package/dist/TableBorderColorCommand.js +3 -24
- package/dist/TableCellColorCommand.js +3 -23
- package/dist/TableCellMenuPlugin.js +9 -45
- package/dist/TableInsertCommand.js +7 -39
- package/dist/TableMergeCellsCommand.js +5 -30
- package/dist/TableNodesSpecs.js +4 -23
- package/dist/TablePlugins.js +0 -5
- package/dist/TableResizePlugin.js +54 -138
- package/dist/TextColorMarkSpec.js +0 -9
- package/dist/TextHighlightMarkSpec.js +0 -8
- package/dist/TextInsertTabSpaceCommand.js +3 -28
- package/dist/TextNoWrapMarkSpec.js +0 -4
- package/dist/TextSelectionMarkSpec.js +0 -5
- package/dist/TextSubMarkSpec.js +0 -4
- package/dist/TextSuperMarkSpec.js +0 -4
- package/dist/TextUnderlineMarkSpec.js +0 -4
- package/dist/Types.js +0 -6
- package/dist/WebFontLoader.js +3 -8
- package/dist/blockQuoteInputRule.js +0 -13
- package/dist/bom.xml +1472 -1624
- package/dist/buildEditorPlugins.js +5 -27
- package/dist/buildInputRules.js +12 -24
- package/dist/client/CollabConnector.js +6 -30
- package/dist/client/EditorConnection.js +23 -69
- package/dist/client/Licit.js +79 -163
- package/dist/client/Licit.js.flow +16 -2
- package/dist/client/Licit.test.js +6 -13
- package/dist/client/Reporter.js +1 -8
- package/dist/client/SimpleConnector.js +6 -26
- package/dist/client/http.js +8 -15
- package/dist/client/throttle.js +0 -2
- package/dist/convertFromDOMElement.js +2 -10
- package/dist/convertFromHTML.js +0 -5
- package/dist/convertFromJSON.js +3 -13
- package/dist/convertToCSSPTValue.js +0 -6
- package/dist/convertToJSON.js +0 -2
- package/dist/createCommand.js +3 -11
- package/dist/createEditorKeyMap.js +0 -13
- package/dist/createEmptyEditorState.js +0 -7
- package/dist/createTableResizingPlugin.js +5 -16
- package/dist/findActionableCell.js +0 -19
- package/dist/findActiveMark.js +0 -11
- package/dist/hyphenize.js +2 -4
- package/dist/index.js +0 -9
- package/dist/insertTable.js +0 -16
- package/dist/isEditorStateEmpty.js +0 -6
- package/dist/isTableNode.js +0 -3
- package/dist/joinDown.js +0 -7
- package/dist/joinListNode.js +0 -15
- package/dist/joinUp.js +0 -9
- package/dist/keymaps.js +0 -15
- package/dist/lookUpElement.js +0 -3
- package/dist/nodeAt.js +0 -3
- package/dist/normalizeHTML.js +9 -25
- package/dist/patchAnchorElements.js +5 -12
- package/dist/patchBreakElements.js +0 -6
- package/dist/patchElementInlineStyles.js +5 -15
- package/dist/patchListElements.js +20 -54
- package/dist/patchMathElements.js +11 -21
- package/dist/patchParagraphElements.js +0 -5
- package/dist/patchStyleElements.js +12 -41
- package/dist/patchTableElements.js +9 -37
- package/dist/rebaseDocWithSteps.js +0 -6
- package/dist/sanitizeURL.js +0 -3
- package/dist/splitListItem.js +12 -43
- package/dist/toClosestFontPtSize.js +1 -5
- package/dist/toSafeHTMLDocument.js +0 -1
- package/dist/toggleBlockquote.js +2 -19
- package/dist/toggleCodeBlock.js +2 -22
- package/dist/ui/AlertInfo.js +6 -22
- package/dist/ui/BookmarkNodeView.js +7 -28
- package/dist/ui/CommandButton.js +3 -19
- package/dist/ui/CommandMenu.js +3 -25
- package/dist/ui/CommandMenuButton.js +3 -36
- package/dist/ui/CustomEditorView.js +3 -16
- package/dist/ui/CustomMenu.js +0 -8
- package/dist/ui/CustomMenuItem.js +4 -18
- package/dist/ui/CustomNodeView.js +21 -67
- package/dist/ui/CustomRadioButton.js +14 -33
- package/dist/ui/DocLayoutEditor.js +5 -27
- package/dist/ui/Editor.js +18 -79
- package/dist/ui/EditorFrameset.js +3 -18
- package/dist/ui/EditorToolbar.js +10 -46
- package/dist/ui/EditorToolbarConfig.js +10 -20
- package/dist/ui/FontSizeCommandMenuButton.js +5 -19
- package/dist/ui/FontTypeCommandMenuButton.js +5 -22
- package/dist/ui/Frag.js +0 -7
- package/dist/ui/Icon.js +5 -25
- package/dist/ui/ImageAlignEditor.js +3 -16
- package/dist/ui/ImageInlineEditor.js +3 -16
- package/dist/ui/ImageNodeView.js +22 -110
- package/dist/ui/ImageNodeView.js.flow +2 -1
- package/dist/ui/ImageResizeBox.js +3 -53
- package/dist/ui/ImageURLEditor.js +3 -28
- package/dist/ui/ImageUploadEditor.js +3 -35
- package/dist/ui/LinkTooltip.js +5 -25
- package/dist/ui/LinkURLEditor.js +3 -29
- package/dist/ui/ListItemNodeView.js +15 -30
- package/dist/ui/ListTypeButton.js +5 -37
- package/dist/ui/ListTypeCommandButton.js +3 -19
- package/dist/ui/ListTypeMenu.js +4 -25
- package/dist/ui/LoadingIndicator.js +0 -7
- package/dist/ui/MathEditor.js +3 -24
- package/dist/ui/MathInlineEditor.js +3 -26
- package/dist/ui/MathNodeView.js +9 -59
- package/dist/ui/PasteMenu.js +4 -20
- package/dist/ui/ResizeObserver.js +0 -18
- package/dist/ui/RichTextEditor.js +5 -27
- package/dist/ui/SelectionObserver.js +3 -29
- package/dist/ui/TableCellMenu.js +3 -18
- package/dist/ui/TableGridSizeEditor.js +5 -51
- package/dist/ui/TableNodeView.js +0 -11
- package/dist/ui/bindScrollHandler.js +2 -9
- package/dist/ui/canUseCSSFont.js +2 -8
- package/dist/ui/czi-icon.css +4 -4
- package/dist/ui/findActiveFontSize.js +2 -18
- package/dist/ui/findActiveFontType.js +0 -12
- package/dist/ui/handleEditorDrop.js +0 -9
- package/dist/ui/handleEditorKeyDown.js +0 -7
- package/dist/ui/handleEditorPaste.js +0 -9
- package/dist/ui/htmlElementToRect.js +0 -4
- package/dist/ui/injectStyleSheet.js +0 -10
- package/dist/ui/isElementFullyVisible.js +2 -8
- package/dist/ui/isOffline.js +0 -2
- package/dist/ui/isReactClass.js +0 -4
- package/dist/ui/mathquill-editor/MathQuillEditor.js +9 -44
- package/dist/ui/mathquill-editor/MathQuillEditorSymbols.js +1 -3
- package/dist/ui/mathquill-editor/MathQuillEditorSymbolsPanel.js +3 -16
- package/dist/ui/mathquill-editor/mathquill-import-kludge.js +5 -7
- package/dist/ui/renderLaTeXAsHTML.js +2 -13
- package/dist/ui/resolveImage.js +7 -32
- package/dist/ui/toCSSColor.js +0 -14
- package/dist/ui/toCSSLineSpacing.js +10 -11
- package/dist/ui/toHexColor.js +0 -8
- package/dist/ui/uuid.js +0 -2
- package/dist/uuid.js +0 -2
- package/package.json +46 -70
- package/src/client/Licit.js +16 -2
- package/src/ui/ImageNodeView.js +2 -1
- package/src/ui/czi-icon.css +4 -4
- package/utils/build_web_server.js +1 -7
- package/webpack.config.js +3 -3
|
@@ -4,32 +4,23 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = findActionableCell;
|
|
7
|
-
|
|
8
7
|
var _prosemirrorModel = require("prosemirror-model");
|
|
9
|
-
|
|
10
8
|
var _prosemirrorState = require("prosemirror-state");
|
|
11
|
-
|
|
12
9
|
var _prosemirrorTables = require("prosemirror-tables");
|
|
13
|
-
|
|
14
10
|
var _prosemirrorUtils = require("prosemirror-utils");
|
|
15
|
-
|
|
16
11
|
var _NodeNames = require("./NodeNames");
|
|
17
|
-
|
|
18
12
|
function findActionableCellFromSelection(selection) {
|
|
19
13
|
const {
|
|
20
14
|
$anchorCell
|
|
21
15
|
} = selection;
|
|
22
16
|
const start = $anchorCell.start(-1);
|
|
23
17
|
const table = $anchorCell.node(-1);
|
|
24
|
-
|
|
25
18
|
const tableMap = _prosemirrorTables.TableMap.get(table);
|
|
26
|
-
|
|
27
19
|
let topRightRect;
|
|
28
20
|
let posFound = null;
|
|
29
21
|
let nodeFound = null;
|
|
30
22
|
selection.forEachCell((cell, cellPos) => {
|
|
31
23
|
const cellRect = tableMap.findCell(cellPos - start);
|
|
32
|
-
|
|
33
24
|
if (!topRightRect || cellRect.top >= topRightRect.top && cellRect.left > topRightRect.left) {
|
|
34
25
|
topRightRect = cellRect;
|
|
35
26
|
posFound = cellPos;
|
|
@@ -41,7 +32,6 @@ function findActionableCellFromSelection(selection) {
|
|
|
41
32
|
pos: posFound
|
|
42
33
|
};
|
|
43
34
|
}
|
|
44
|
-
|
|
45
35
|
function findActionableCell(state) {
|
|
46
36
|
const {
|
|
47
37
|
doc,
|
|
@@ -50,35 +40,26 @@ function findActionableCell(state) {
|
|
|
50
40
|
} = state;
|
|
51
41
|
const tdType = schema.nodes[_NodeNames.TABLE_CELL];
|
|
52
42
|
const thType = schema.nodes[_NodeNames.TABLE_HEADER];
|
|
53
|
-
|
|
54
43
|
if (!tdType && !thType) {
|
|
55
44
|
return null;
|
|
56
45
|
}
|
|
57
|
-
|
|
58
46
|
let userSelection = selection;
|
|
59
|
-
|
|
60
47
|
if (userSelection instanceof _prosemirrorState.TextSelection) {
|
|
61
48
|
const {
|
|
62
49
|
from,
|
|
63
50
|
to
|
|
64
51
|
} = selection;
|
|
65
|
-
|
|
66
52
|
if (from !== to) {
|
|
67
53
|
return null;
|
|
68
54
|
}
|
|
69
|
-
|
|
70
55
|
const result = tdType && (0, _prosemirrorUtils.findParentNodeOfType)(tdType)(selection) || thType && (0, _prosemirrorUtils.findParentNodeOfType)(thType)(selection);
|
|
71
|
-
|
|
72
56
|
if (!result) {
|
|
73
57
|
return null;
|
|
74
58
|
}
|
|
75
|
-
|
|
76
59
|
userSelection = _prosemirrorTables.CellSelection.create(doc, result.pos);
|
|
77
60
|
}
|
|
78
|
-
|
|
79
61
|
if (userSelection instanceof _prosemirrorTables.CellSelection) {
|
|
80
62
|
return findActionableCellFromSelection(userSelection);
|
|
81
63
|
}
|
|
82
|
-
|
|
83
64
|
return null;
|
|
84
65
|
}
|
package/dist/findActiveMark.js
CHANGED
|
@@ -4,37 +4,26 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = findActiveMark;
|
|
7
|
-
|
|
8
7
|
var _prosemirrorModel = require("prosemirror-model");
|
|
9
|
-
|
|
10
8
|
function findActiveMark(doc, from, to, markType) {
|
|
11
9
|
let ii = from;
|
|
12
|
-
|
|
13
10
|
if (doc.nodeSize <= 2) {
|
|
14
11
|
return null;
|
|
15
12
|
}
|
|
16
|
-
|
|
17
13
|
const finder = mark => mark.type === markType;
|
|
18
|
-
|
|
19
14
|
from = Math.max(2, from);
|
|
20
15
|
to = Math.min(to, doc.nodeSize - 2);
|
|
21
|
-
|
|
22
16
|
while (ii <= to) {
|
|
23
17
|
const node = doc.nodeAt(ii);
|
|
24
|
-
|
|
25
18
|
if (!node || !node.marks) {
|
|
26
19
|
ii++;
|
|
27
20
|
continue;
|
|
28
21
|
}
|
|
29
|
-
|
|
30
22
|
const mark = node.marks.find(finder);
|
|
31
|
-
|
|
32
23
|
if (mark) {
|
|
33
24
|
return mark;
|
|
34
25
|
}
|
|
35
|
-
|
|
36
26
|
ii++;
|
|
37
27
|
}
|
|
38
|
-
|
|
39
28
|
return null;
|
|
40
29
|
}
|
package/dist/hyphenize.js
CHANGED
|
@@ -4,18 +4,16 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = hyphenize;
|
|
7
|
-
|
|
8
7
|
function hadnleMatch(matched) {
|
|
9
8
|
return matched[0] + '-' + matched[1].toLowerCase();
|
|
10
9
|
}
|
|
10
|
+
const cached = {};
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
// converts `fooBar` to `foo-bar`.
|
|
14
13
|
function hyphenize(str) {
|
|
15
14
|
if (cached.hasOwnProperty(str)) {
|
|
16
15
|
return cached[str];
|
|
17
16
|
}
|
|
18
|
-
|
|
19
17
|
const result = str.replace(/[a-z][A-Z]/g, hadnleMatch);
|
|
20
18
|
cached[str] = result;
|
|
21
19
|
return result;
|
package/dist/index.js
CHANGED
|
@@ -69,21 +69,12 @@ Object.defineProperty(exports, "uuid", {
|
|
|
69
69
|
return _uuid.default;
|
|
70
70
|
}
|
|
71
71
|
});
|
|
72
|
-
|
|
73
72
|
var _prosemirrorState = require("prosemirror-state");
|
|
74
|
-
|
|
75
73
|
var _isEditorStateEmpty = _interopRequireDefault(require("./isEditorStateEmpty"));
|
|
76
|
-
|
|
77
74
|
var _uuid = _interopRequireDefault(require("./ui/uuid"));
|
|
78
|
-
|
|
79
75
|
var _Licit = _interopRequireWildcard(require("./client/Licit.js"));
|
|
80
|
-
|
|
81
76
|
var _Types = require("./Types");
|
|
82
|
-
|
|
83
77
|
var _http = require("./client/http");
|
|
84
|
-
|
|
85
78
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
86
|
-
|
|
87
79
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
88
|
-
|
|
89
80
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
package/dist/insertTable.js
CHANGED
|
@@ -4,30 +4,22 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = insertTable;
|
|
7
|
-
|
|
8
7
|
var _prosemirrorModel = require("prosemirror-model");
|
|
9
|
-
|
|
10
8
|
var _prosemirrorState = require("prosemirror-state");
|
|
11
|
-
|
|
12
9
|
var _prosemirrorTransform = require("prosemirror-transform");
|
|
13
|
-
|
|
14
10
|
var _NodeNames = require("./NodeNames");
|
|
15
|
-
|
|
16
11
|
// const ZERO_WIDTH_SPACE_CHAR = '\u200b';
|
|
17
12
|
function insertTable(tr, schema, rows, cols) {
|
|
18
13
|
if (!tr.selection || !tr.doc) {
|
|
19
14
|
return tr;
|
|
20
15
|
}
|
|
21
|
-
|
|
22
16
|
const {
|
|
23
17
|
from,
|
|
24
18
|
to
|
|
25
19
|
} = tr.selection;
|
|
26
|
-
|
|
27
20
|
if (from !== to) {
|
|
28
21
|
return tr;
|
|
29
22
|
}
|
|
30
|
-
|
|
31
23
|
const {
|
|
32
24
|
nodes
|
|
33
25
|
} = schema;
|
|
@@ -35,32 +27,24 @@ function insertTable(tr, schema, rows, cols) {
|
|
|
35
27
|
const paragraph = nodes[_NodeNames.PARAGRAPH];
|
|
36
28
|
const row = nodes[_NodeNames.TABLE_ROW];
|
|
37
29
|
const table = nodes[_NodeNames.TABLE];
|
|
38
|
-
|
|
39
30
|
if (!(cell && paragraph && row && table)) {
|
|
40
31
|
return tr;
|
|
41
32
|
}
|
|
42
|
-
|
|
43
33
|
const rowNodes = [];
|
|
44
|
-
|
|
45
34
|
for (let rr = 0; rr < rows; rr++) {
|
|
46
35
|
const cellNodes = [];
|
|
47
|
-
|
|
48
36
|
for (let cc = 0; cc < cols; cc++) {
|
|
49
37
|
// [FS] IRAD-950 2020-05-25
|
|
50
38
|
// Fix:Extra arrow key required for cell navigation using arrow right/Left
|
|
51
39
|
const cellNode = cell.create(undefined, _prosemirrorModel.Fragment.fromArray([paragraph.create()]));
|
|
52
40
|
cellNodes.push(cellNode);
|
|
53
41
|
}
|
|
54
|
-
|
|
55
42
|
const rowNode = row.create({}, _prosemirrorModel.Fragment.from(cellNodes));
|
|
56
43
|
rowNodes.push(rowNode);
|
|
57
44
|
}
|
|
58
|
-
|
|
59
45
|
const tableNode = table.create({}, _prosemirrorModel.Fragment.from(rowNodes));
|
|
60
46
|
tr = tr.insert(from, _prosemirrorModel.Fragment.from(tableNode));
|
|
61
|
-
|
|
62
47
|
const selection = _prosemirrorState.TextSelection.create(tr.doc, from + 5, from + 5);
|
|
63
|
-
|
|
64
48
|
tr = tr.setSelection(selection);
|
|
65
49
|
return tr;
|
|
66
50
|
}
|
|
@@ -4,11 +4,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = isEditorStateEmpty;
|
|
7
|
-
|
|
8
7
|
var _prosemirrorState = require("prosemirror-state");
|
|
9
|
-
|
|
10
8
|
const ZERO_WIDTH_SPACE_CHAR = '\u200b';
|
|
11
|
-
|
|
12
9
|
function isEditorStateEmpty(editorState) {
|
|
13
10
|
const {
|
|
14
11
|
doc
|
|
@@ -16,7 +13,6 @@ function isEditorStateEmpty(editorState) {
|
|
|
16
13
|
const {
|
|
17
14
|
nodeSize
|
|
18
15
|
} = doc;
|
|
19
|
-
|
|
20
16
|
if (nodeSize < 2) {
|
|
21
17
|
const text = doc.textContent;
|
|
22
18
|
return !text || text === ' ';
|
|
@@ -25,7 +21,6 @@ function isEditorStateEmpty(editorState) {
|
|
|
25
21
|
doc.nodesBetween(0, doc.nodeSize - 2, (node, ii) => {
|
|
26
22
|
if (isEmpty) {
|
|
27
23
|
const nodeType = node.type;
|
|
28
|
-
|
|
29
24
|
if (nodeType.isText) {
|
|
30
25
|
const text = doc.textContent;
|
|
31
26
|
isEmpty = !text || text === ' ' || text === ZERO_WIDTH_SPACE_CHAR;
|
|
@@ -34,7 +29,6 @@ function isEditorStateEmpty(editorState) {
|
|
|
34
29
|
isEmpty = false;
|
|
35
30
|
}
|
|
36
31
|
}
|
|
37
|
-
|
|
38
32
|
return isEmpty;
|
|
39
33
|
});
|
|
40
34
|
return isEmpty;
|
package/dist/isTableNode.js
CHANGED
|
@@ -4,11 +4,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = isTableNode;
|
|
7
|
-
|
|
8
7
|
var _prosemirrorModel = require("prosemirror-model");
|
|
9
|
-
|
|
10
8
|
var _NodeNames = require("./NodeNames");
|
|
11
|
-
|
|
12
9
|
function isTableNode(node) {
|
|
13
10
|
const name = node instanceof _prosemirrorModel.Node ? node.type.name : null;
|
|
14
11
|
return name === _NodeNames.TABLE || name === _NodeNames.TABLE_ROW || name === _NodeNames.TABLE_HEADER || name === _NodeNames.TABLE_CELL;
|
package/dist/joinDown.js
CHANGED
|
@@ -4,32 +4,25 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = joinDown;
|
|
7
|
-
|
|
8
7
|
var _prosemirrorState = require("prosemirror-state");
|
|
9
|
-
|
|
10
8
|
var _prosemirrorTransform = require("prosemirror-transform");
|
|
11
|
-
|
|
12
9
|
// https://github.com/ProseMirror/prosemirror-commands/blob/master/src/commands.js
|
|
13
10
|
// Join the selected block, or the closest ancestor of the selection
|
|
14
11
|
// that can be joined, with the sibling after it.
|
|
15
12
|
function joinDown(tr) {
|
|
16
13
|
const sel = tr.selection;
|
|
17
14
|
let point;
|
|
18
|
-
|
|
19
15
|
if (sel instanceof _prosemirrorState.NodeSelection) {
|
|
20
16
|
if (sel.node.isTextblock || !(0, _prosemirrorTransform.canJoin)(tr.doc, sel.to)) {
|
|
21
17
|
return tr;
|
|
22
18
|
}
|
|
23
|
-
|
|
24
19
|
point = sel.to;
|
|
25
20
|
} else {
|
|
26
21
|
point = (0, _prosemirrorTransform.joinPoint)(tr.doc, sel.to, 1);
|
|
27
|
-
|
|
28
22
|
if (point === null || point === undefined) {
|
|
29
23
|
return tr;
|
|
30
24
|
}
|
|
31
25
|
}
|
|
32
|
-
|
|
33
26
|
tr = tr.join(point);
|
|
34
27
|
return tr;
|
|
35
28
|
}
|
package/dist/joinListNode.js
CHANGED
|
@@ -4,50 +4,35 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = joinListNode;
|
|
7
|
-
|
|
8
7
|
var _prosemirrorModel = require("prosemirror-model");
|
|
9
|
-
|
|
10
8
|
var _prosemirrorState = require("prosemirror-state");
|
|
11
|
-
|
|
12
9
|
var _prosemirrorTransform = require("prosemirror-transform");
|
|
13
|
-
|
|
14
10
|
var _licitUiCommands = require("@modusoperandi/licit-ui-commands");
|
|
15
|
-
|
|
16
11
|
var _joinDown = _interopRequireDefault(require("./joinDown"));
|
|
17
|
-
|
|
18
12
|
var _joinUp = _interopRequireDefault(require("./joinUp"));
|
|
19
|
-
|
|
20
13
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
21
|
-
|
|
22
14
|
function joinListNode(tr, schema, listNodePos) {
|
|
23
15
|
if (!tr.doc || !tr.selection) {
|
|
24
16
|
return tr;
|
|
25
17
|
}
|
|
26
|
-
|
|
27
18
|
const node = tr.doc.nodeAt(listNodePos);
|
|
28
|
-
|
|
29
19
|
if (!(0, _licitUiCommands.isListNode)(node)) {
|
|
30
20
|
return tr;
|
|
31
21
|
}
|
|
32
|
-
|
|
33
22
|
const initialSelection = tr.selection;
|
|
34
23
|
const listFromPos = listNodePos;
|
|
35
24
|
const listToPos = listFromPos + node.nodeSize;
|
|
36
25
|
const $fromPos = tr.doc.resolve(listFromPos);
|
|
37
26
|
const $toPos = tr.doc.resolve(listToPos);
|
|
38
27
|
let selectionOffset = 0;
|
|
39
|
-
|
|
40
28
|
if ($toPos.nodeAfter && $toPos.nodeAfter.type === node.type && $toPos.nodeAfter.attrs.level === node.attrs.level) {
|
|
41
29
|
tr = (0, _joinDown.default)(tr);
|
|
42
30
|
}
|
|
43
|
-
|
|
44
31
|
if ($fromPos.nodeBefore && $fromPos.nodeBefore.type === node.type && $fromPos.nodeBefore.attrs.level === node.attrs.level) {
|
|
45
32
|
selectionOffset -= 2;
|
|
46
33
|
tr = (0, _joinUp.default)(tr);
|
|
47
34
|
}
|
|
48
|
-
|
|
49
35
|
const selection = _prosemirrorState.TextSelection.create(tr.doc, initialSelection.from + selectionOffset, initialSelection.to + selectionOffset);
|
|
50
|
-
|
|
51
36
|
tr = tr.setSelection(selection);
|
|
52
37
|
return tr;
|
|
53
38
|
}
|
package/dist/joinUp.js
CHANGED
|
@@ -4,11 +4,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = joinUp;
|
|
7
|
-
|
|
8
7
|
var _prosemirrorState = require("prosemirror-state");
|
|
9
|
-
|
|
10
8
|
var _prosemirrorTransform = require("prosemirror-transform");
|
|
11
|
-
|
|
12
9
|
// https://github.com/ProseMirror/prosemirror-commands/blob/master/src/commands.js
|
|
13
10
|
// Join the selected block or, if there is a text selection, the
|
|
14
11
|
// closest ancestor block of the selection that can be joined, with
|
|
@@ -17,26 +14,20 @@ function joinUp(tr) {
|
|
|
17
14
|
const sel = tr.selection;
|
|
18
15
|
const nodeSel = sel instanceof _prosemirrorState.NodeSelection;
|
|
19
16
|
let point;
|
|
20
|
-
|
|
21
17
|
if (nodeSel) {
|
|
22
18
|
if (sel.node.isTextblock || !(0, _prosemirrorTransform.canJoin)(tr.doc, sel.from)) {
|
|
23
19
|
return tr;
|
|
24
20
|
}
|
|
25
|
-
|
|
26
21
|
point = sel.from;
|
|
27
22
|
} else {
|
|
28
23
|
point = (0, _prosemirrorTransform.joinPoint)(tr.doc, sel.from, -1);
|
|
29
|
-
|
|
30
24
|
if (point === null || point === undefined) {
|
|
31
25
|
return tr;
|
|
32
26
|
}
|
|
33
27
|
}
|
|
34
|
-
|
|
35
28
|
tr = tr.join(point);
|
|
36
|
-
|
|
37
29
|
if (nodeSel) {
|
|
38
30
|
tr = tr.setSelection(_prosemirrorState.NodeSelection.create(tr.doc, point - tr.doc.resolve(point).nodeBefore.nodeSize));
|
|
39
31
|
}
|
|
40
|
-
|
|
41
32
|
return tr;
|
|
42
33
|
}
|
package/dist/keymaps.js
CHANGED
|
@@ -8,32 +8,23 @@ exports.findKeymapByDescription = findKeymapByDescription;
|
|
|
8
8
|
exports.findShortcutByDescription = findShortcutByDescription;
|
|
9
9
|
exports.findShortcutByKeymap = findShortcutByKeymap;
|
|
10
10
|
exports.tooltip = tooltip;
|
|
11
|
-
|
|
12
11
|
var _browserkeymap = _interopRequireDefault(require("browserkeymap"));
|
|
13
|
-
|
|
14
12
|
var _browser = _interopRequireDefault(require("./browser"));
|
|
15
|
-
|
|
16
13
|
var _licitDocAttrsStep = require("@modusoperandi/licit-doc-attrs-step");
|
|
17
|
-
|
|
18
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
|
-
|
|
20
15
|
// https://tinyurl.com/ybwf3wex
|
|
21
16
|
function tooltip(keymap) {
|
|
22
17
|
if (keymap) {
|
|
23
18
|
let shortcut;
|
|
24
|
-
|
|
25
19
|
if (_browser.default.isMac()) {
|
|
26
20
|
shortcut = keymap.mac.replace(/Cmd/i, '⌘').replace(/Shift/i, '⇧').replace(/Ctrl/i, '^').replace(/Alt/i, '⌥');
|
|
27
21
|
} else {
|
|
28
22
|
shortcut = keymap.windows;
|
|
29
23
|
}
|
|
30
|
-
|
|
31
24
|
return `${keymap.description} (${shortcut})`;
|
|
32
25
|
}
|
|
33
|
-
|
|
34
26
|
return null;
|
|
35
27
|
}
|
|
36
|
-
|
|
37
28
|
const KEY_BACK_DELETE = (0, _licitDocAttrsStep.makeKeyMapWithCommon)('', 'Backspace');
|
|
38
29
|
exports.KEY_BACK_DELETE = KEY_BACK_DELETE;
|
|
39
30
|
const KEY_FORWARD_DELETE = (0, _licitDocAttrsStep.makeKeyMapWithCommon)('', 'Delete');
|
|
@@ -94,28 +85,22 @@ const KEY_UNDO = (0, _licitDocAttrsStep.makeKeyMapWithCommon)('Undo', 'Mod-z');
|
|
|
94
85
|
exports.KEY_UNDO = KEY_UNDO;
|
|
95
86
|
const ALL_KEYS = [KEY_BACK_DELETE, KEY_FORWARD_DELETE, KEY_INSERT_HORIZONTAL_RULE, KEY_INSERT_NEW_LINE, KEY_INSERT_NEW_LINE_IN_BLOCKQUOTE, KEY_INSERT_NEW_LINE_IN_LIST_ITEM, KEY_SET_NORMAL_TEXT, KEY_SHIFT_BACKSPACE, KEY_SPLIT_LIST_ITEM, KEY_TAB_SHIFT, KEY_TAB, KEY_TOGGLE_BLOCK_QUOTE, KEY_TOGGLE_BOLD, KEY_TOGGLE_BULLET_LIST, KEY_TOGGLE_BULLET_LIST, KEY_TOGGLE_CODE_BLOCK, KEY_TOGGLE_HEADING_1, KEY_TOGGLE_HEADING_2, KEY_TOGGLE_HEADING_3, KEY_TOGGLE_HEADING_4, KEY_TOGGLE_HEADING_5, KEY_TOGGLE_HEADING_6, KEY_TOGGLE_ITALIC, KEY_TOGGLE_MONOSPACE, KEY_TOGGLE_ORDERED_LIST, KEY_TOGGLE_STRIKETHROUGH, KEY_TOGGLE_UNDERLINE, KEY_UNDO];
|
|
96
87
|
exports.ALL_KEYS = ALL_KEYS;
|
|
97
|
-
|
|
98
88
|
function findKeymapByDescription(description) {
|
|
99
89
|
const matches = ALL_KEYS.filter(keymap => {
|
|
100
90
|
return keymap.description.toUpperCase() === description.toUpperCase();
|
|
101
91
|
});
|
|
102
92
|
return matches[0];
|
|
103
93
|
}
|
|
104
|
-
|
|
105
94
|
function findShortcutByDescription(description) {
|
|
106
95
|
const keymap = findKeymapByDescription(description);
|
|
107
|
-
|
|
108
96
|
if (keymap) {
|
|
109
97
|
return findShortcutByKeymap(keymap);
|
|
110
98
|
}
|
|
111
|
-
|
|
112
99
|
return null;
|
|
113
100
|
}
|
|
114
|
-
|
|
115
101
|
function findShortcutByKeymap(keymap) {
|
|
116
102
|
if (_browser.default.isMac()) {
|
|
117
103
|
return keymap.mac;
|
|
118
104
|
}
|
|
119
|
-
|
|
120
105
|
return keymap.windows;
|
|
121
106
|
}
|
package/dist/lookUpElement.js
CHANGED
|
@@ -4,15 +4,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = lookUpElement;
|
|
7
|
-
|
|
8
7
|
function lookUpElement(el, predict) {
|
|
9
8
|
while (el && el.nodeName) {
|
|
10
9
|
if (predict(el)) {
|
|
11
10
|
return el;
|
|
12
11
|
}
|
|
13
|
-
|
|
14
12
|
el = el.parentElement;
|
|
15
13
|
}
|
|
16
|
-
|
|
17
14
|
return null;
|
|
18
15
|
}
|
package/dist/nodeAt.js
CHANGED
|
@@ -4,15 +4,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = nodeAt;
|
|
7
|
-
|
|
8
7
|
var _prosemirrorModel = require("prosemirror-model");
|
|
9
|
-
|
|
10
8
|
function nodeAt(doc, pos) {
|
|
11
9
|
if (pos < 0 || pos > doc.content.size) {
|
|
12
10
|
// Exit here or error will be thrown:
|
|
13
11
|
// e.g. RangeError: Position outside of fragment.
|
|
14
12
|
return null;
|
|
15
13
|
}
|
|
16
|
-
|
|
17
14
|
return doc.nodeAt(pos);
|
|
18
15
|
}
|
package/dist/normalizeHTML.js
CHANGED
|
@@ -4,36 +4,24 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = normalizeHTML;
|
|
7
|
-
|
|
8
7
|
var _SpacerMarkSpec = require("./SpacerMarkSpec");
|
|
9
|
-
|
|
10
8
|
var _patchAnchorElements = _interopRequireDefault(require("./patchAnchorElements"));
|
|
11
|
-
|
|
12
9
|
var _patchBreakElements = _interopRequireDefault(require("./patchBreakElements"));
|
|
13
|
-
|
|
14
10
|
var _patchElementInlineStyles = _interopRequireDefault(require("./patchElementInlineStyles"));
|
|
15
|
-
|
|
16
11
|
var _patchListElements = _interopRequireDefault(require("./patchListElements"));
|
|
17
|
-
|
|
18
12
|
var _patchMathElements = _interopRequireDefault(require("./patchMathElements"));
|
|
19
|
-
|
|
20
13
|
var _patchParagraphElements = _interopRequireDefault(require("./patchParagraphElements"));
|
|
21
|
-
|
|
22
14
|
var _patchStyleElements = _interopRequireDefault(require("./patchStyleElements"));
|
|
23
|
-
|
|
24
15
|
var _patchTableElements = _interopRequireDefault(require("./patchTableElements"));
|
|
25
|
-
|
|
26
16
|
var _toSafeHTMLDocument = _interopRequireDefault(require("./toSafeHTMLDocument"));
|
|
27
|
-
|
|
28
17
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
29
|
-
|
|
30
18
|
const HTML_BODY_PATTERN = /<body[\s>]/i;
|
|
31
|
-
const LONG_UNDERLINE_PATTERN = /_+/g;
|
|
32
|
-
// tab spacers. For every 6 " ", they will be converted into tab spacers.
|
|
19
|
+
const LONG_UNDERLINE_PATTERN = /_+/g;
|
|
33
20
|
|
|
21
|
+
// This is a workround to convert " ...... " into wider tab
|
|
22
|
+
// tab spacers. For every 6 " ", they will be converted into tab spacers.
|
|
34
23
|
const LONG_TAB_SPACE_PATTERN = /(\ ){6}/g;
|
|
35
24
|
const TAB_SPACER_HTML = new Array(6).join(`<span ${_SpacerMarkSpec.DOM_ATTRIBUTE_SIZE}="${_SpacerMarkSpec.SPACER_SIZE_TAB}">${_SpacerMarkSpec.HAIR_SPACE_CHAR}</span>`);
|
|
36
|
-
|
|
37
25
|
function replaceNOBR(matched) {
|
|
38
26
|
// This is a workround to convert "_______" into none-wrapped text
|
|
39
27
|
// that apppears like a horizontal line.
|
|
@@ -41,23 +29,21 @@ function replaceNOBR(matched) {
|
|
|
41
29
|
// needs extra space after it so user can escape the <nobr />.
|
|
42
30
|
matched = `<nobr>${String(matched)}</nobr> `;
|
|
43
31
|
}
|
|
44
|
-
|
|
45
32
|
return matched;
|
|
46
33
|
}
|
|
47
|
-
|
|
48
34
|
function normalizeHTML(html) {
|
|
49
35
|
let body = null;
|
|
50
36
|
const sourceIsPage = HTML_BODY_PATTERN.test(html);
|
|
51
|
-
html = html.replace(LONG_UNDERLINE_PATTERN, replaceNOBR);
|
|
37
|
+
html = html.replace(LONG_UNDERLINE_PATTERN, replaceNOBR);
|
|
52
38
|
|
|
39
|
+
// Convert every two consecutive " " into a spacer tab.
|
|
53
40
|
html = html.replace(LONG_TAB_SPACE_PATTERN, TAB_SPACER_HTML);
|
|
54
41
|
const doc = (0, _toSafeHTMLDocument.default)(html);
|
|
55
|
-
|
|
56
42
|
if (doc) {
|
|
57
43
|
// styles.
|
|
58
44
|
(0, _patchStyleElements.default)(doc);
|
|
59
|
-
(0, _patchElementInlineStyles.default)(doc);
|
|
60
|
-
|
|
45
|
+
(0, _patchElementInlineStyles.default)(doc);
|
|
46
|
+
// contents.
|
|
61
47
|
(0, _patchAnchorElements.default)(doc);
|
|
62
48
|
(0, _patchBreakElements.default)(doc);
|
|
63
49
|
(0, _patchListElements.default)(doc);
|
|
@@ -65,7 +51,6 @@ function normalizeHTML(html) {
|
|
|
65
51
|
(0, _patchTableElements.default)(doc);
|
|
66
52
|
(0, _patchMathElements.default)(doc);
|
|
67
53
|
body = doc.getElementsByTagName('body')[0];
|
|
68
|
-
|
|
69
54
|
if (body && sourceIsPage) {
|
|
70
55
|
// Source HTML contains <body />, assumes this to be a complete
|
|
71
56
|
// page HTML. Assume this <body /> may contain the style that indicates
|
|
@@ -75,12 +60,11 @@ function normalizeHTML(html) {
|
|
|
75
60
|
return frag.innerHTML;
|
|
76
61
|
}
|
|
77
62
|
}
|
|
78
|
-
|
|
79
63
|
if (!body) {
|
|
80
64
|
// <body /> should alway be generated by doc.
|
|
81
65
|
return 'Unsupported HTML content';
|
|
82
|
-
}
|
|
83
|
-
|
|
66
|
+
}
|
|
84
67
|
|
|
68
|
+
// HTML snippet only.
|
|
85
69
|
return '<body>' + body.innerHTML + '</body>';
|
|
86
70
|
}
|
|
@@ -4,40 +4,33 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = patchAnchorElements;
|
|
7
|
-
|
|
8
7
|
var _BookmarkNodeSpec = require("./BookmarkNodeSpec");
|
|
9
|
-
|
|
10
8
|
const BLOCK_NODE_NAME_PATTERN = /(P|H1|H2|H3|H4|H5|H6)/;
|
|
11
|
-
|
|
12
9
|
function patchAnchorElements(doc) {
|
|
13
10
|
Array.from(doc.querySelectorAll('a[id]')).forEach(patchAnchorElement);
|
|
14
11
|
}
|
|
15
|
-
|
|
16
12
|
function patchAnchorElement(node) {
|
|
17
13
|
const {
|
|
18
14
|
id
|
|
19
15
|
} = node;
|
|
20
|
-
|
|
21
16
|
if (id && node.childElementCount === 0) {
|
|
22
17
|
// This looks like a bookmark generated from Google Doc, will render
|
|
23
18
|
// this as BookmarkNode.
|
|
24
|
-
node.setAttribute(_BookmarkNodeSpec.ATTRIBUTE_BOOKMARK_ID, id);
|
|
19
|
+
node.setAttribute(_BookmarkNodeSpec.ATTRIBUTE_BOOKMARK_ID, id);
|
|
20
|
+
|
|
21
|
+
// Google Doc always inject anchor links before <table />.
|
|
25
22
|
// <a id="t.3060ecccc199a88a1e4cc1252769f957b88f2207"></a>
|
|
26
23
|
// <a id="t.0"></a>
|
|
27
24
|
// <table class="c23">
|
|
28
25
|
// and these anchor link should not be visible.
|
|
29
|
-
|
|
30
26
|
const visible = node.id.indexOf('t.') !== 0;
|
|
31
27
|
visible && node.setAttribute(_BookmarkNodeSpec.ATTRIBUTE_BOOKMARK_VISIBLE, 'true');
|
|
32
28
|
}
|
|
33
|
-
|
|
34
29
|
const nextNode = node.nextElementSibling;
|
|
35
|
-
|
|
36
30
|
if (!nextNode) {
|
|
37
31
|
return;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
|
|
32
|
+
}
|
|
33
|
+
// If this is next to a block element, make that block element the bookmark.
|
|
41
34
|
if (BLOCK_NODE_NAME_PATTERN.test(nextNode.nodeName)) {
|
|
42
35
|
nextNode.insertBefore(node, nextNode.firstChild);
|
|
43
36
|
}
|
|
@@ -4,7 +4,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = patchBreakElements;
|
|
7
|
-
|
|
8
7
|
function patchBreakElements(doc) {
|
|
9
8
|
// This is a workaround to handle HTML converted from DraftJS that
|
|
10
9
|
// `<div><span><br /></span><div>` becomes `<p><br /><br /></p>`.
|
|
@@ -12,23 +11,18 @@ function patchBreakElements(doc) {
|
|
|
12
11
|
const selector = 'div > span:only-child > br:only-child';
|
|
13
12
|
Array.from(doc.querySelectorAll(selector)).forEach(patchBreakElement);
|
|
14
13
|
}
|
|
15
|
-
|
|
16
14
|
function patchBreakElement(brElement) {
|
|
17
15
|
const {
|
|
18
16
|
ownerDocument,
|
|
19
17
|
parentElement
|
|
20
18
|
} = brElement;
|
|
21
|
-
|
|
22
19
|
if (!ownerDocument || !parentElement) {
|
|
23
20
|
return;
|
|
24
21
|
}
|
|
25
|
-
|
|
26
22
|
const div = brElement.parentElement && brElement.parentElement.parentElement;
|
|
27
|
-
|
|
28
23
|
if (!div) {
|
|
29
24
|
return;
|
|
30
25
|
}
|
|
31
|
-
|
|
32
26
|
const pp = ownerDocument.createElement('p');
|
|
33
27
|
div.parentElement && div.parentElement.replaceChild(pp, div);
|
|
34
28
|
}
|