roosterjs-content-model-api 9.24.0 → 9.25.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/README.md +3 -0
- package/lib/publicApi/format/getFormatState.js +1 -1
- package/lib/publicApi/format/getFormatState.js.map +1 -1
- package/lib-amd/publicApi/format/getFormatState.js +1 -1
- package/lib-amd/publicApi/format/getFormatState.js.map +1 -1
- package/lib-mjs/publicApi/format/getFormatState.js +1 -1
- package/lib-mjs/publicApi/format/getFormatState.js.map +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -51,6 +51,9 @@ There are also some extension packages to provide additional functionalities.
|
|
|
51
51
|
1. [roosterjs-color-utils](https://microsoft.github.io/roosterjs/docs/modules/roosterjs_color_utils.html):
|
|
52
52
|
Provide color transformation utility to make editor work under dark mode.
|
|
53
53
|
|
|
54
|
+
2. [roosterjs-content-model-markdown](https://microsoft.github.io/roosterjs/docs/modules/roosterjs_content_model_types.html):
|
|
55
|
+
Defines public APIs to enable conversions between Markdown and ContentModel
|
|
56
|
+
|
|
54
57
|
To be compatible with old (8.\*) versions, you can use `EditorAdapter` class from the following package which can act as a 8.\* Editor:
|
|
55
58
|
|
|
56
59
|
1. [roosterjs-editor-adapter](https://microsoft.github.io/roosterjs/docs/modules/roosterjs_editor_adapter.html):
|
|
@@ -18,7 +18,7 @@ function getFormatState(editor, conflictSolution) {
|
|
|
18
18
|
isDarkMode: editor.isDarkMode(),
|
|
19
19
|
};
|
|
20
20
|
editor.formatContentModel(function (model) {
|
|
21
|
-
(0, roosterjs_content_model_dom_1.retrieveModelFormatState)(model, pendingFormat, result, conflictSolution);
|
|
21
|
+
(0, roosterjs_content_model_dom_1.retrieveModelFormatState)(model, pendingFormat, result, conflictSolution, editor.getDOMHelper());
|
|
22
22
|
return false;
|
|
23
23
|
}, undefined /*options*/, {
|
|
24
24
|
processorOverride: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getFormatState.js","sourceRoot":"","sources":["../../../../../packages/roosterjs-content-model-api/lib/publicApi/format/getFormatState.ts"],"names":[],"mappings":";;;AAAA,+FAA8F;AAC9F,2EAAuE;
|
|
1
|
+
{"version":3,"file":"getFormatState.js","sourceRoot":"","sources":["../../../../../packages/roosterjs-content-model-api/lib/publicApi/format/getFormatState.ts"],"names":[],"mappings":";;;AAAA,+FAA8F;AAC9F,2EAAuE;AAOvE;;;;GAIG;AACH,SAAgB,cAAc,CAC1B,MAAe,EACf,gBAAmD;IAAnD,iCAAA,EAAA,2BAAmD;IAEnD,IAAM,aAAa,GAAG,MAAM,CAAC,gBAAgB,EAAE,CAAC;IAChD,IAAM,OAAO,GAAG,MAAM,CAAC,mBAAmB,EAAE,CAAC;IAC7C,IAAM,MAAM,GAA4B;QACpC,OAAO,EAAE,OAAO,CAAC,aAAa,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;QACrD,OAAO,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC;QAC3B,UAAU,EAAE,MAAM,CAAC,UAAU,EAAE;KAClC,CAAC;IAEF,MAAM,CAAC,kBAAkB,CACrB,UAAA,KAAK;QACD,IAAA,sDAAwB,EACpB,KAAK,EACL,aAAa,EACb,MAAM,EACN,gBAAgB,EAChB,MAAM,CAAC,YAAY,EAAE,CACxB,CAAC;QAEF,OAAO,KAAK,CAAC;IACjB,CAAC,EACD,SAAS,CAAC,WAAW,EACrB;QACI,iBAAiB,EAAE;YACf,KAAK,EAAE,uDAA0B;SACpC;QACD,eAAe,EAAE,IAAI;KACxB,CACJ,CAAC;IAEF,OAAO,MAAM,CAAC;AAClB,CAAC;AAlCD,wCAkCC","sourcesContent":["import { reducedModelChildProcessor } from '../../modelApi/common/reducedModelChildProcessor';\nimport { retrieveModelFormatState } from 'roosterjs-content-model-dom';\nimport type {\n IEditor,\n ContentModelFormatState,\n ConflictFormatSolution,\n} from 'roosterjs-content-model-types';\n\n/**\n * Get current format state\n * @param editor The editor to get format from\n * @param conflictSolution The strategy for handling format conflicts\n */\nexport function getFormatState(\n editor: IEditor,\n conflictSolution: ConflictFormatSolution = 'remove'\n): ContentModelFormatState {\n const pendingFormat = editor.getPendingFormat();\n const manager = editor.getSnapshotsManager();\n const result: ContentModelFormatState = {\n canUndo: manager.hasNewContent || manager.canMove(-1),\n canRedo: manager.canMove(1),\n isDarkMode: editor.isDarkMode(),\n };\n\n editor.formatContentModel(\n model => {\n retrieveModelFormatState(\n model,\n pendingFormat,\n result,\n conflictSolution,\n editor.getDOMHelper()\n );\n\n return false;\n },\n undefined /*options*/,\n {\n processorOverride: {\n child: reducedModelChildProcessor,\n },\n tryGetFromCache: true,\n }\n );\n\n return result;\n}\n"]}
|
|
@@ -17,7 +17,7 @@ define(["require", "exports", "../../modelApi/common/reducedModelChildProcessor"
|
|
|
17
17
|
isDarkMode: editor.isDarkMode(),
|
|
18
18
|
};
|
|
19
19
|
editor.formatContentModel(function (model) {
|
|
20
|
-
(0, roosterjs_content_model_dom_1.retrieveModelFormatState)(model, pendingFormat, result, conflictSolution);
|
|
20
|
+
(0, roosterjs_content_model_dom_1.retrieveModelFormatState)(model, pendingFormat, result, conflictSolution, editor.getDOMHelper());
|
|
21
21
|
return false;
|
|
22
22
|
}, undefined /*options*/, {
|
|
23
23
|
processorOverride: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getFormatState.js","sourceRoot":"","sources":["../../../../../packages/roosterjs-content-model-api/lib/publicApi/format/getFormatState.ts"],"names":[],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"getFormatState.js","sourceRoot":"","sources":["../../../../../packages/roosterjs-content-model-api/lib/publicApi/format/getFormatState.ts"],"names":[],"mappings":";;;;IAQA;;;;OAIG;IACH,SAAgB,cAAc,CAC1B,MAAe,EACf,gBAAmD;QAAnD,iCAAA,EAAA,2BAAmD;QAEnD,IAAM,aAAa,GAAG,MAAM,CAAC,gBAAgB,EAAE,CAAC;QAChD,IAAM,OAAO,GAAG,MAAM,CAAC,mBAAmB,EAAE,CAAC;QAC7C,IAAM,MAAM,GAA4B;YACpC,OAAO,EAAE,OAAO,CAAC,aAAa,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;YACrD,OAAO,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC;YAC3B,UAAU,EAAE,MAAM,CAAC,UAAU,EAAE;SAClC,CAAC;QAEF,MAAM,CAAC,kBAAkB,CACrB,UAAA,KAAK;YACD,IAAA,sDAAwB,EACpB,KAAK,EACL,aAAa,EACb,MAAM,EACN,gBAAgB,EAChB,MAAM,CAAC,YAAY,EAAE,CACxB,CAAC;YAEF,OAAO,KAAK,CAAC;QACjB,CAAC,EACD,SAAS,CAAC,WAAW,EACrB;YACI,iBAAiB,EAAE;gBACf,KAAK,EAAE,uDAA0B;aACpC;YACD,eAAe,EAAE,IAAI;SACxB,CACJ,CAAC;QAEF,OAAO,MAAM,CAAC;IAClB,CAAC;IAlCD,wCAkCC","sourcesContent":["import { reducedModelChildProcessor } from '../../modelApi/common/reducedModelChildProcessor';\nimport { retrieveModelFormatState } from 'roosterjs-content-model-dom';\nimport type {\n IEditor,\n ContentModelFormatState,\n ConflictFormatSolution,\n} from 'roosterjs-content-model-types';\n\n/**\n * Get current format state\n * @param editor The editor to get format from\n * @param conflictSolution The strategy for handling format conflicts\n */\nexport function getFormatState(\n editor: IEditor,\n conflictSolution: ConflictFormatSolution = 'remove'\n): ContentModelFormatState {\n const pendingFormat = editor.getPendingFormat();\n const manager = editor.getSnapshotsManager();\n const result: ContentModelFormatState = {\n canUndo: manager.hasNewContent || manager.canMove(-1),\n canRedo: manager.canMove(1),\n isDarkMode: editor.isDarkMode(),\n };\n\n editor.formatContentModel(\n model => {\n retrieveModelFormatState(\n model,\n pendingFormat,\n result,\n conflictSolution,\n editor.getDOMHelper()\n );\n\n return false;\n },\n undefined /*options*/,\n {\n processorOverride: {\n child: reducedModelChildProcessor,\n },\n tryGetFromCache: true,\n }\n );\n\n return result;\n}\n"]}
|
|
@@ -15,7 +15,7 @@ export function getFormatState(editor, conflictSolution) {
|
|
|
15
15
|
isDarkMode: editor.isDarkMode(),
|
|
16
16
|
};
|
|
17
17
|
editor.formatContentModel(function (model) {
|
|
18
|
-
retrieveModelFormatState(model, pendingFormat, result, conflictSolution);
|
|
18
|
+
retrieveModelFormatState(model, pendingFormat, result, conflictSolution, editor.getDOMHelper());
|
|
19
19
|
return false;
|
|
20
20
|
}, undefined /*options*/, {
|
|
21
21
|
processorOverride: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getFormatState.js","sourceRoot":"","sources":["../../../../../packages/roosterjs-content-model-api/lib/publicApi/format/getFormatState.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,MAAM,kDAAkD,CAAC;AAC9F,OAAO,EAAE,wBAAwB,EAAE,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"getFormatState.js","sourceRoot":"","sources":["../../../../../packages/roosterjs-content-model-api/lib/publicApi/format/getFormatState.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,MAAM,kDAAkD,CAAC;AAC9F,OAAO,EAAE,wBAAwB,EAAE,MAAM,6BAA6B,CAAC;AAOvE;;;;GAIG;AACH,MAAM,UAAU,cAAc,CAC1B,MAAe,EACf,gBAAmD;IAAnD,iCAAA,EAAA,2BAAmD;IAEnD,IAAM,aAAa,GAAG,MAAM,CAAC,gBAAgB,EAAE,CAAC;IAChD,IAAM,OAAO,GAAG,MAAM,CAAC,mBAAmB,EAAE,CAAC;IAC7C,IAAM,MAAM,GAA4B;QACpC,OAAO,EAAE,OAAO,CAAC,aAAa,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;QACrD,OAAO,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC;QAC3B,UAAU,EAAE,MAAM,CAAC,UAAU,EAAE;KAClC,CAAC;IAEF,MAAM,CAAC,kBAAkB,CACrB,UAAA,KAAK;QACD,wBAAwB,CACpB,KAAK,EACL,aAAa,EACb,MAAM,EACN,gBAAgB,EAChB,MAAM,CAAC,YAAY,EAAE,CACxB,CAAC;QAEF,OAAO,KAAK,CAAC;IACjB,CAAC,EACD,SAAS,CAAC,WAAW,EACrB;QACI,iBAAiB,EAAE;YACf,KAAK,EAAE,0BAA0B;SACpC;QACD,eAAe,EAAE,IAAI;KACxB,CACJ,CAAC;IAEF,OAAO,MAAM,CAAC;AAClB,CAAC","sourcesContent":["import { reducedModelChildProcessor } from '../../modelApi/common/reducedModelChildProcessor';\nimport { retrieveModelFormatState } from 'roosterjs-content-model-dom';\nimport type {\n IEditor,\n ContentModelFormatState,\n ConflictFormatSolution,\n} from 'roosterjs-content-model-types';\n\n/**\n * Get current format state\n * @param editor The editor to get format from\n * @param conflictSolution The strategy for handling format conflicts\n */\nexport function getFormatState(\n editor: IEditor,\n conflictSolution: ConflictFormatSolution = 'remove'\n): ContentModelFormatState {\n const pendingFormat = editor.getPendingFormat();\n const manager = editor.getSnapshotsManager();\n const result: ContentModelFormatState = {\n canUndo: manager.hasNewContent || manager.canMove(-1),\n canRedo: manager.canMove(1),\n isDarkMode: editor.isDarkMode(),\n };\n\n editor.formatContentModel(\n model => {\n retrieveModelFormatState(\n model,\n pendingFormat,\n result,\n conflictSolution,\n editor.getDOMHelper()\n );\n\n return false;\n },\n undefined /*options*/,\n {\n processorOverride: {\n child: reducedModelChildProcessor,\n },\n tryGetFromCache: true,\n }\n );\n\n return result;\n}\n"]}
|
package/package.json
CHANGED
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
"description": "Format API for roosterjs",
|
|
4
4
|
"dependencies": {
|
|
5
5
|
"tslib": "^2.3.1",
|
|
6
|
-
"roosterjs-content-model-dom": "^9.
|
|
7
|
-
"roosterjs-content-model-types": "^9.
|
|
6
|
+
"roosterjs-content-model-dom": "^9.25.0",
|
|
7
|
+
"roosterjs-content-model-types": "^9.25.0"
|
|
8
8
|
},
|
|
9
|
-
"version": "9.
|
|
9
|
+
"version": "9.25.0",
|
|
10
10
|
"main": "./lib/index.js",
|
|
11
11
|
"typings": "./lib/index.d.ts",
|
|
12
12
|
"module": "./lib-mjs/index.js",
|