roosterjs-content-model-dom 0.18.0 → 0.19.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/lib/domToModel/processors/delimiterProcessor.d.ts +1 -1
- package/lib/domToModel/processors/delimiterProcessor.js +16 -12
- package/lib/domToModel/processors/delimiterProcessor.js.map +1 -1
- package/lib-amd/domToModel/processors/delimiterProcessor.d.ts +1 -1
- package/lib-amd/domToModel/processors/delimiterProcessor.js +16 -10
- package/lib-amd/domToModel/processors/delimiterProcessor.js.map +1 -1
- package/lib-mjs/domToModel/processors/delimiterProcessor.d.ts +1 -1
- package/lib-mjs/domToModel/processors/delimiterProcessor.js +16 -12
- package/lib-mjs/domToModel/processors/delimiterProcessor.js.map +1 -1
- package/package.json +2 -2
|
@@ -1,24 +1,28 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.delimiterProcessor = void 0;
|
|
4
|
-
var
|
|
5
|
-
var getRegularSelectionOffsets_1 = require("../utils/getRegularSelectionOffsets");
|
|
6
|
-
var childProcessor_1 = require("./childProcessor");
|
|
4
|
+
var addSelectionMarker_1 = require("../utils/addSelectionMarker");
|
|
7
5
|
/**
|
|
8
6
|
* @internal
|
|
9
7
|
* @param group
|
|
10
|
-
* @param
|
|
8
|
+
* @param node
|
|
11
9
|
* @param context
|
|
12
10
|
*/
|
|
13
|
-
var delimiterProcessor = function (group,
|
|
14
|
-
var
|
|
15
|
-
var
|
|
16
|
-
|
|
17
|
-
(
|
|
18
|
-
|
|
19
|
-
|
|
11
|
+
var delimiterProcessor = function (group, node, context) {
|
|
12
|
+
var _a, _b;
|
|
13
|
+
var range = ((_a = context.selection) === null || _a === void 0 ? void 0 : _a.type) == 'range' ? context.selection.range : null;
|
|
14
|
+
if (range) {
|
|
15
|
+
if (node.contains(range.startContainer)) {
|
|
16
|
+
context.isInSelection = true;
|
|
17
|
+
(0, addSelectionMarker_1.addSelectionMarker)(group, context);
|
|
18
|
+
}
|
|
19
|
+
if (((_b = context.selection) === null || _b === void 0 ? void 0 : _b.type) == 'range' && node.contains(range.endContainer)) {
|
|
20
|
+
if (!context.selection.range.collapsed) {
|
|
21
|
+
(0, addSelectionMarker_1.addSelectionMarker)(group, context);
|
|
22
|
+
}
|
|
23
|
+
context.isInSelection = false;
|
|
24
|
+
}
|
|
20
25
|
}
|
|
21
|
-
(0, childProcessor_1.handleRegularSelection)(index, context, group, nodeStartOffset, nodeEndOffset);
|
|
22
26
|
};
|
|
23
27
|
exports.delimiterProcessor = delimiterProcessor;
|
|
24
28
|
//# sourceMappingURL=delimiterProcessor.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"delimiterProcessor.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-dom/lib/domToModel/processors/delimiterProcessor.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"delimiterProcessor.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-dom/lib/domToModel/processors/delimiterProcessor.ts"],"names":[],"mappings":";;;AAAA,kEAAiE;AAGjE;;;;;GAKG;AACI,IAAM,kBAAkB,GAA2B,UAAC,KAAK,EAAE,IAAI,EAAE,OAAO;;IAC3E,IAAM,KAAK,GAAG,CAAA,MAAA,OAAO,CAAC,SAAS,0CAAE,IAAI,KAAI,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC;IAElF,IAAI,KAAK,EAAE;QACP,IAAI,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,EAAE;YACrC,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC;YAE7B,IAAA,uCAAkB,EAAC,KAAK,EAAE,OAAO,CAAC,CAAC;SACtC;QAED,IAAI,CAAA,MAAA,OAAO,CAAC,SAAS,0CAAE,IAAI,KAAI,OAAO,IAAI,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,YAAY,CAAC,EAAE;YACzE,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,KAAK,CAAC,SAAS,EAAE;gBACpC,IAAA,uCAAkB,EAAC,KAAK,EAAE,OAAO,CAAC,CAAC;aACtC;YAED,OAAO,CAAC,aAAa,GAAG,KAAK,CAAC;SACjC;KACJ;AACL,CAAC,CAAC;AAlBW,QAAA,kBAAkB,sBAkB7B","sourcesContent":["import { addSelectionMarker } from '../utils/addSelectionMarker';\nimport type { ElementProcessor } from 'roosterjs-content-model-types';\n\n/**\n * @internal\n * @param group\n * @param node\n * @param context\n */\nexport const delimiterProcessor: ElementProcessor<Node> = (group, node, context) => {\n const range = context.selection?.type == 'range' ? context.selection.range : null;\n\n if (range) {\n if (node.contains(range.startContainer)) {\n context.isInSelection = true;\n\n addSelectionMarker(group, context);\n }\n\n if (context.selection?.type == 'range' && node.contains(range.endContainer)) {\n if (!context.selection.range.collapsed) {\n addSelectionMarker(group, context);\n }\n\n context.isInSelection = false;\n }\n }\n};\n"]}
|
|
@@ -1,22 +1,28 @@
|
|
|
1
|
-
define(["require", "exports", "
|
|
1
|
+
define(["require", "exports", "../utils/addSelectionMarker"], function (require, exports, addSelectionMarker_1) {
|
|
2
2
|
"use strict";
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
exports.delimiterProcessor = void 0;
|
|
5
5
|
/**
|
|
6
6
|
* @internal
|
|
7
7
|
* @param group
|
|
8
|
-
* @param
|
|
8
|
+
* @param node
|
|
9
9
|
* @param context
|
|
10
10
|
*/
|
|
11
|
-
var delimiterProcessor = function (group,
|
|
12
|
-
var
|
|
13
|
-
var
|
|
14
|
-
|
|
15
|
-
(
|
|
16
|
-
|
|
17
|
-
|
|
11
|
+
var delimiterProcessor = function (group, node, context) {
|
|
12
|
+
var _a, _b;
|
|
13
|
+
var range = ((_a = context.selection) === null || _a === void 0 ? void 0 : _a.type) == 'range' ? context.selection.range : null;
|
|
14
|
+
if (range) {
|
|
15
|
+
if (node.contains(range.startContainer)) {
|
|
16
|
+
context.isInSelection = true;
|
|
17
|
+
(0, addSelectionMarker_1.addSelectionMarker)(group, context);
|
|
18
|
+
}
|
|
19
|
+
if (((_b = context.selection) === null || _b === void 0 ? void 0 : _b.type) == 'range' && node.contains(range.endContainer)) {
|
|
20
|
+
if (!context.selection.range.collapsed) {
|
|
21
|
+
(0, addSelectionMarker_1.addSelectionMarker)(group, context);
|
|
22
|
+
}
|
|
23
|
+
context.isInSelection = false;
|
|
24
|
+
}
|
|
18
25
|
}
|
|
19
|
-
(0, childProcessor_1.handleRegularSelection)(index, context, group, nodeStartOffset, nodeEndOffset);
|
|
20
26
|
};
|
|
21
27
|
exports.delimiterProcessor = delimiterProcessor;
|
|
22
28
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"delimiterProcessor.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-dom/lib/domToModel/processors/delimiterProcessor.ts"],"names":[],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"delimiterProcessor.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-dom/lib/domToModel/processors/delimiterProcessor.ts"],"names":[],"mappings":";;;;IAGA;;;;;OAKG;IACI,IAAM,kBAAkB,GAA2B,UAAC,KAAK,EAAE,IAAI,EAAE,OAAO;;QAC3E,IAAM,KAAK,GAAG,CAAA,MAAA,OAAO,CAAC,SAAS,0CAAE,IAAI,KAAI,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC;QAElF,IAAI,KAAK,EAAE;YACP,IAAI,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,EAAE;gBACrC,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC;gBAE7B,IAAA,uCAAkB,EAAC,KAAK,EAAE,OAAO,CAAC,CAAC;aACtC;YAED,IAAI,CAAA,MAAA,OAAO,CAAC,SAAS,0CAAE,IAAI,KAAI,OAAO,IAAI,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,YAAY,CAAC,EAAE;gBACzE,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,KAAK,CAAC,SAAS,EAAE;oBACpC,IAAA,uCAAkB,EAAC,KAAK,EAAE,OAAO,CAAC,CAAC;iBACtC;gBAED,OAAO,CAAC,aAAa,GAAG,KAAK,CAAC;aACjC;SACJ;IACL,CAAC,CAAC;IAlBW,QAAA,kBAAkB,sBAkB7B","sourcesContent":["import { addSelectionMarker } from '../utils/addSelectionMarker';\nimport type { ElementProcessor } from 'roosterjs-content-model-types';\n\n/**\n * @internal\n * @param group\n * @param node\n * @param context\n */\nexport const delimiterProcessor: ElementProcessor<Node> = (group, node, context) => {\n const range = context.selection?.type == 'range' ? context.selection.range : null;\n\n if (range) {\n if (node.contains(range.startContainer)) {\n context.isInSelection = true;\n\n addSelectionMarker(group, context);\n }\n\n if (context.selection?.type == 'range' && node.contains(range.endContainer)) {\n if (!context.selection.range.collapsed) {\n addSelectionMarker(group, context);\n }\n\n context.isInSelection = false;\n }\n }\n};\n"]}
|
|
@@ -1,20 +1,24 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { getRegularSelectionOffsets } from '../utils/getRegularSelectionOffsets';
|
|
3
|
-
import { handleRegularSelection } from './childProcessor';
|
|
1
|
+
import { addSelectionMarker } from '../utils/addSelectionMarker';
|
|
4
2
|
/**
|
|
5
3
|
* @internal
|
|
6
4
|
* @param group
|
|
7
|
-
* @param
|
|
5
|
+
* @param node
|
|
8
6
|
* @param context
|
|
9
7
|
*/
|
|
10
|
-
export var delimiterProcessor = function (group,
|
|
11
|
-
var
|
|
12
|
-
var
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
8
|
+
export var delimiterProcessor = function (group, node, context) {
|
|
9
|
+
var _a, _b;
|
|
10
|
+
var range = ((_a = context.selection) === null || _a === void 0 ? void 0 : _a.type) == 'range' ? context.selection.range : null;
|
|
11
|
+
if (range) {
|
|
12
|
+
if (node.contains(range.startContainer)) {
|
|
13
|
+
context.isInSelection = true;
|
|
14
|
+
addSelectionMarker(group, context);
|
|
15
|
+
}
|
|
16
|
+
if (((_b = context.selection) === null || _b === void 0 ? void 0 : _b.type) == 'range' && node.contains(range.endContainer)) {
|
|
17
|
+
if (!context.selection.range.collapsed) {
|
|
18
|
+
addSelectionMarker(group, context);
|
|
19
|
+
}
|
|
20
|
+
context.isInSelection = false;
|
|
21
|
+
}
|
|
17
22
|
}
|
|
18
|
-
handleRegularSelection(index, context, group, nodeStartOffset, nodeEndOffset);
|
|
19
23
|
};
|
|
20
24
|
//# sourceMappingURL=delimiterProcessor.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"delimiterProcessor.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-dom/lib/domToModel/processors/delimiterProcessor.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"delimiterProcessor.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-dom/lib/domToModel/processors/delimiterProcessor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AAGjE;;;;;GAKG;AACH,MAAM,CAAC,IAAM,kBAAkB,GAA2B,UAAC,KAAK,EAAE,IAAI,EAAE,OAAO;;IAC3E,IAAM,KAAK,GAAG,CAAA,MAAA,OAAO,CAAC,SAAS,0CAAE,IAAI,KAAI,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC;IAElF,IAAI,KAAK,EAAE;QACP,IAAI,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,EAAE;YACrC,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC;YAE7B,kBAAkB,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;SACtC;QAED,IAAI,CAAA,MAAA,OAAO,CAAC,SAAS,0CAAE,IAAI,KAAI,OAAO,IAAI,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,YAAY,CAAC,EAAE;YACzE,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,KAAK,CAAC,SAAS,EAAE;gBACpC,kBAAkB,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;aACtC;YAED,OAAO,CAAC,aAAa,GAAG,KAAK,CAAC;SACjC;KACJ;AACL,CAAC,CAAC","sourcesContent":["import { addSelectionMarker } from '../utils/addSelectionMarker';\nimport type { ElementProcessor } from 'roosterjs-content-model-types';\n\n/**\n * @internal\n * @param group\n * @param node\n * @param context\n */\nexport const delimiterProcessor: ElementProcessor<Node> = (group, node, context) => {\n const range = context.selection?.type == 'range' ? context.selection.range : null;\n\n if (range) {\n if (node.contains(range.startContainer)) {\n context.isInSelection = true;\n\n addSelectionMarker(group, context);\n }\n\n if (context.selection?.type == 'range' && node.contains(range.endContainer)) {\n if (!context.selection.range.collapsed) {\n addSelectionMarker(group, context);\n }\n\n context.isInSelection = false;\n }\n }\n};\n"]}
|
package/package.json
CHANGED
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
"description": "Content Model for roosterjs (Under development)",
|
|
4
4
|
"dependencies": {
|
|
5
5
|
"tslib": "^2.3.1",
|
|
6
|
-
"roosterjs-content-model-types": "^0.
|
|
6
|
+
"roosterjs-content-model-types": "^0.19.0"
|
|
7
7
|
},
|
|
8
|
-
"version": "0.
|
|
8
|
+
"version": "0.19.0",
|
|
9
9
|
"main": "./lib/index.js",
|
|
10
10
|
"typings": "./lib/index.d.ts",
|
|
11
11
|
"license": "MIT",
|