roosterjs-content-model-core 0.26.2 → 0.26.3

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.
@@ -1,4 +1,4 @@
1
- import type { ExportContentMode, IStandaloneEditor } from 'roosterjs-content-model-types';
1
+ import type { ExportContentMode, IStandaloneEditor, ModelToDomOption } from 'roosterjs-content-model-types';
2
2
  /**
3
3
  * Export string content of editor
4
4
  * @param editor The editor to get content from
@@ -6,5 +6,6 @@ import type { ExportContentMode, IStandaloneEditor } from 'roosterjs-content-mod
6
6
  * - HTML: Export HTML content. If there are entities, this will cause EntityOperation event with option = 'replaceTemporaryContent' to get a dehydrated entity
7
7
  * - PlainText: Export plain text content
8
8
  * - PlainTextFast: Export plain text using editor's textContent property directly
9
+ * @param options @optional Options for Model to DOM conversion
9
10
  */
10
- export declare function exportContent(editor: IStandaloneEditor, mode?: ExportContentMode): string;
11
+ export declare function exportContent(editor: IStandaloneEditor, mode?: ExportContentMode, options?: ModelToDomOption): string;
@@ -9,8 +9,9 @@ var roosterjs_content_model_dom_1 = require("roosterjs-content-model-dom");
9
9
  * - HTML: Export HTML content. If there are entities, this will cause EntityOperation event with option = 'replaceTemporaryContent' to get a dehydrated entity
10
10
  * - PlainText: Export plain text content
11
11
  * - PlainTextFast: Export plain text using editor's textContent property directly
12
+ * @param options @optional Options for Model to DOM conversion
12
13
  */
13
- function exportContent(editor, mode) {
14
+ function exportContent(editor, mode, options) {
14
15
  if (mode === void 0) { mode = 'HTML'; }
15
16
  if (mode == 'PlainTextFast') {
16
17
  return editor.getDOMHelper().getTextContent();
@@ -23,7 +24,7 @@ function exportContent(editor, mode) {
23
24
  else {
24
25
  var doc = editor.getDocument();
25
26
  var div = doc.createElement('div');
26
- (0, roosterjs_content_model_dom_1.contentModelToDom)(doc, div, model, (0, roosterjs_content_model_dom_1.createModelToDomContext)());
27
+ (0, roosterjs_content_model_dom_1.contentModelToDom)(doc, div, model, (0, roosterjs_content_model_dom_1.createModelToDomContext)(undefined /*editorContext*/, options));
27
28
  editor.triggerEvent('extractContentWithDom', { clonedRoot: div }, true /*broadcast*/);
28
29
  return div.innerHTML;
29
30
  }
@@ -1 +1 @@
1
- {"version":3,"file":"exportContent.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-core/lib/publicApi/model/exportContent.ts"],"names":[],"mappings":";;;AAAA,2EAIqC;AAGrC;;;;;;;GAOG;AACH,SAAgB,aAAa,CAAC,MAAyB,EAAE,IAAgC;IAAhC,qBAAA,EAAA,aAAgC;IACrF,IAAI,IAAI,IAAI,eAAe,EAAE;QACzB,OAAO,MAAM,CAAC,YAAY,EAAE,CAAC,cAAc,EAAE,CAAC;KACjD;SAAM;QACH,IAAM,KAAK,GAAG,MAAM,CAAC,mBAAmB,CAAC,cAAc,CAAC,CAAC;QAEzD,IAAI,IAAI,IAAI,WAAW,EAAE;YACrB,OAAO,IAAA,gDAAkB,EAAC,KAAK,CAAC,CAAC;SACpC;aAAM;YACH,IAAM,GAAG,GAAG,MAAM,CAAC,WAAW,EAAE,CAAC;YACjC,IAAM,GAAG,GAAG,GAAG,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;YAErC,IAAA,+CAAiB,EAAC,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,IAAA,qDAAuB,GAAE,CAAC,CAAC;YAE9D,MAAM,CAAC,YAAY,CAAC,uBAAuB,EAAE,EAAE,UAAU,EAAE,GAAG,EAAE,EAAE,IAAI,CAAC,aAAa,CAAC,CAAC;YAEtF,OAAO,GAAG,CAAC,SAAS,CAAC;SACxB;KACJ;AACL,CAAC;AAnBD,sCAmBC","sourcesContent":["import {\n contentModelToDom,\n contentModelToText,\n createModelToDomContext,\n} from 'roosterjs-content-model-dom';\nimport type { ExportContentMode, IStandaloneEditor } from 'roosterjs-content-model-types';\n\n/**\n * Export string content of editor\n * @param editor The editor to get content from\n * @param mode Mode of content to export. It supports:\n * - HTML: Export HTML content. If there are entities, this will cause EntityOperation event with option = 'replaceTemporaryContent' to get a dehydrated entity\n * - PlainText: Export plain text content\n * - PlainTextFast: Export plain text using editor's textContent property directly\n */\nexport function exportContent(editor: IStandaloneEditor, mode: ExportContentMode = 'HTML'): string {\n if (mode == 'PlainTextFast') {\n return editor.getDOMHelper().getTextContent();\n } else {\n const model = editor.getContentModelCopy('disconnected');\n\n if (mode == 'PlainText') {\n return contentModelToText(model);\n } else {\n const doc = editor.getDocument();\n const div = doc.createElement('div');\n\n contentModelToDom(doc, div, model, createModelToDomContext());\n\n editor.triggerEvent('extractContentWithDom', { clonedRoot: div }, true /*broadcast*/);\n\n return div.innerHTML;\n }\n }\n}\n"]}
1
+ {"version":3,"file":"exportContent.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-core/lib/publicApi/model/exportContent.ts"],"names":[],"mappings":";;;AAAA,2EAIqC;AAOrC;;;;;;;;GAQG;AACH,SAAgB,aAAa,CACzB,MAAyB,EACzB,IAAgC,EAChC,OAA0B;IAD1B,qBAAA,EAAA,aAAgC;IAGhC,IAAI,IAAI,IAAI,eAAe,EAAE;QACzB,OAAO,MAAM,CAAC,YAAY,EAAE,CAAC,cAAc,EAAE,CAAC;KACjD;SAAM;QACH,IAAM,KAAK,GAAG,MAAM,CAAC,mBAAmB,CAAC,cAAc,CAAC,CAAC;QAEzD,IAAI,IAAI,IAAI,WAAW,EAAE;YACrB,OAAO,IAAA,gDAAkB,EAAC,KAAK,CAAC,CAAC;SACpC;aAAM;YACH,IAAM,GAAG,GAAG,MAAM,CAAC,WAAW,EAAE,CAAC;YACjC,IAAM,GAAG,GAAG,GAAG,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;YAErC,IAAA,+CAAiB,EACb,GAAG,EACH,GAAG,EACH,KAAK,EACL,IAAA,qDAAuB,EAAC,SAAS,CAAC,iBAAiB,EAAE,OAAO,CAAC,CAChE,CAAC;YAEF,MAAM,CAAC,YAAY,CAAC,uBAAuB,EAAE,EAAE,UAAU,EAAE,GAAG,EAAE,EAAE,IAAI,CAAC,aAAa,CAAC,CAAC;YAEtF,OAAO,GAAG,CAAC,SAAS,CAAC;SACxB;KACJ;AACL,CAAC;AA5BD,sCA4BC","sourcesContent":["import {\n contentModelToDom,\n contentModelToText,\n createModelToDomContext,\n} from 'roosterjs-content-model-dom';\nimport type {\n ExportContentMode,\n IStandaloneEditor,\n ModelToDomOption,\n} from 'roosterjs-content-model-types';\n\n/**\n * Export string content of editor\n * @param editor The editor to get content from\n * @param mode Mode of content to export. It supports:\n * - HTML: Export HTML content. If there are entities, this will cause EntityOperation event with option = 'replaceTemporaryContent' to get a dehydrated entity\n * - PlainText: Export plain text content\n * - PlainTextFast: Export plain text using editor's textContent property directly\n * @param options @optional Options for Model to DOM conversion\n */\nexport function exportContent(\n editor: IStandaloneEditor,\n mode: ExportContentMode = 'HTML',\n options?: ModelToDomOption\n): string {\n if (mode == 'PlainTextFast') {\n return editor.getDOMHelper().getTextContent();\n } else {\n const model = editor.getContentModelCopy('disconnected');\n\n if (mode == 'PlainText') {\n return contentModelToText(model);\n } else {\n const doc = editor.getDocument();\n const div = doc.createElement('div');\n\n contentModelToDom(\n doc,\n div,\n model,\n createModelToDomContext(undefined /*editorContext*/, options)\n );\n\n editor.triggerEvent('extractContentWithDom', { clonedRoot: div }, true /*broadcast*/);\n\n return div.innerHTML;\n }\n }\n}\n"]}
@@ -1,4 +1,4 @@
1
- import type { ExportContentMode, IStandaloneEditor } from 'roosterjs-content-model-types';
1
+ import type { ExportContentMode, IStandaloneEditor, ModelToDomOption } from 'roosterjs-content-model-types';
2
2
  /**
3
3
  * Export string content of editor
4
4
  * @param editor The editor to get content from
@@ -6,5 +6,6 @@ import type { ExportContentMode, IStandaloneEditor } from 'roosterjs-content-mod
6
6
  * - HTML: Export HTML content. If there are entities, this will cause EntityOperation event with option = 'replaceTemporaryContent' to get a dehydrated entity
7
7
  * - PlainText: Export plain text content
8
8
  * - PlainTextFast: Export plain text using editor's textContent property directly
9
+ * @param options @optional Options for Model to DOM conversion
9
10
  */
10
- export declare function exportContent(editor: IStandaloneEditor, mode?: ExportContentMode): string;
11
+ export declare function exportContent(editor: IStandaloneEditor, mode?: ExportContentMode, options?: ModelToDomOption): string;
@@ -9,8 +9,9 @@ define(["require", "exports", "roosterjs-content-model-dom"], function (require,
9
9
  * - HTML: Export HTML content. If there are entities, this will cause EntityOperation event with option = 'replaceTemporaryContent' to get a dehydrated entity
10
10
  * - PlainText: Export plain text content
11
11
  * - PlainTextFast: Export plain text using editor's textContent property directly
12
+ * @param options @optional Options for Model to DOM conversion
12
13
  */
13
- function exportContent(editor, mode) {
14
+ function exportContent(editor, mode, options) {
14
15
  if (mode === void 0) { mode = 'HTML'; }
15
16
  if (mode == 'PlainTextFast') {
16
17
  return editor.getDOMHelper().getTextContent();
@@ -23,7 +24,7 @@ define(["require", "exports", "roosterjs-content-model-dom"], function (require,
23
24
  else {
24
25
  var doc = editor.getDocument();
25
26
  var div = doc.createElement('div');
26
- (0, roosterjs_content_model_dom_1.contentModelToDom)(doc, div, model, (0, roosterjs_content_model_dom_1.createModelToDomContext)());
27
+ (0, roosterjs_content_model_dom_1.contentModelToDom)(doc, div, model, (0, roosterjs_content_model_dom_1.createModelToDomContext)(undefined /*editorContext*/, options));
27
28
  editor.triggerEvent('extractContentWithDom', { clonedRoot: div }, true /*broadcast*/);
28
29
  return div.innerHTML;
29
30
  }
@@ -1 +1 @@
1
- {"version":3,"file":"exportContent.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-core/lib/publicApi/model/exportContent.ts"],"names":[],"mappings":";;;;IAOA;;;;;;;OAOG;IACH,SAAgB,aAAa,CAAC,MAAyB,EAAE,IAAgC;QAAhC,qBAAA,EAAA,aAAgC;QACrF,IAAI,IAAI,IAAI,eAAe,EAAE;YACzB,OAAO,MAAM,CAAC,YAAY,EAAE,CAAC,cAAc,EAAE,CAAC;SACjD;aAAM;YACH,IAAM,KAAK,GAAG,MAAM,CAAC,mBAAmB,CAAC,cAAc,CAAC,CAAC;YAEzD,IAAI,IAAI,IAAI,WAAW,EAAE;gBACrB,OAAO,IAAA,gDAAkB,EAAC,KAAK,CAAC,CAAC;aACpC;iBAAM;gBACH,IAAM,GAAG,GAAG,MAAM,CAAC,WAAW,EAAE,CAAC;gBACjC,IAAM,GAAG,GAAG,GAAG,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;gBAErC,IAAA,+CAAiB,EAAC,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,IAAA,qDAAuB,GAAE,CAAC,CAAC;gBAE9D,MAAM,CAAC,YAAY,CAAC,uBAAuB,EAAE,EAAE,UAAU,EAAE,GAAG,EAAE,EAAE,IAAI,CAAC,aAAa,CAAC,CAAC;gBAEtF,OAAO,GAAG,CAAC,SAAS,CAAC;aACxB;SACJ;IACL,CAAC;IAnBD,sCAmBC","sourcesContent":["import {\n contentModelToDom,\n contentModelToText,\n createModelToDomContext,\n} from 'roosterjs-content-model-dom';\nimport type { ExportContentMode, IStandaloneEditor } from 'roosterjs-content-model-types';\n\n/**\n * Export string content of editor\n * @param editor The editor to get content from\n * @param mode Mode of content to export. It supports:\n * - HTML: Export HTML content. If there are entities, this will cause EntityOperation event with option = 'replaceTemporaryContent' to get a dehydrated entity\n * - PlainText: Export plain text content\n * - PlainTextFast: Export plain text using editor's textContent property directly\n */\nexport function exportContent(editor: IStandaloneEditor, mode: ExportContentMode = 'HTML'): string {\n if (mode == 'PlainTextFast') {\n return editor.getDOMHelper().getTextContent();\n } else {\n const model = editor.getContentModelCopy('disconnected');\n\n if (mode == 'PlainText') {\n return contentModelToText(model);\n } else {\n const doc = editor.getDocument();\n const div = doc.createElement('div');\n\n contentModelToDom(doc, div, model, createModelToDomContext());\n\n editor.triggerEvent('extractContentWithDom', { clonedRoot: div }, true /*broadcast*/);\n\n return div.innerHTML;\n }\n }\n}\n"]}
1
+ {"version":3,"file":"exportContent.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-core/lib/publicApi/model/exportContent.ts"],"names":[],"mappings":";;;;IAWA;;;;;;;;OAQG;IACH,SAAgB,aAAa,CACzB,MAAyB,EACzB,IAAgC,EAChC,OAA0B;QAD1B,qBAAA,EAAA,aAAgC;QAGhC,IAAI,IAAI,IAAI,eAAe,EAAE;YACzB,OAAO,MAAM,CAAC,YAAY,EAAE,CAAC,cAAc,EAAE,CAAC;SACjD;aAAM;YACH,IAAM,KAAK,GAAG,MAAM,CAAC,mBAAmB,CAAC,cAAc,CAAC,CAAC;YAEzD,IAAI,IAAI,IAAI,WAAW,EAAE;gBACrB,OAAO,IAAA,gDAAkB,EAAC,KAAK,CAAC,CAAC;aACpC;iBAAM;gBACH,IAAM,GAAG,GAAG,MAAM,CAAC,WAAW,EAAE,CAAC;gBACjC,IAAM,GAAG,GAAG,GAAG,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;gBAErC,IAAA,+CAAiB,EACb,GAAG,EACH,GAAG,EACH,KAAK,EACL,IAAA,qDAAuB,EAAC,SAAS,CAAC,iBAAiB,EAAE,OAAO,CAAC,CAChE,CAAC;gBAEF,MAAM,CAAC,YAAY,CAAC,uBAAuB,EAAE,EAAE,UAAU,EAAE,GAAG,EAAE,EAAE,IAAI,CAAC,aAAa,CAAC,CAAC;gBAEtF,OAAO,GAAG,CAAC,SAAS,CAAC;aACxB;SACJ;IACL,CAAC;IA5BD,sCA4BC","sourcesContent":["import {\n contentModelToDom,\n contentModelToText,\n createModelToDomContext,\n} from 'roosterjs-content-model-dom';\nimport type {\n ExportContentMode,\n IStandaloneEditor,\n ModelToDomOption,\n} from 'roosterjs-content-model-types';\n\n/**\n * Export string content of editor\n * @param editor The editor to get content from\n * @param mode Mode of content to export. It supports:\n * - HTML: Export HTML content. If there are entities, this will cause EntityOperation event with option = 'replaceTemporaryContent' to get a dehydrated entity\n * - PlainText: Export plain text content\n * - PlainTextFast: Export plain text using editor's textContent property directly\n * @param options @optional Options for Model to DOM conversion\n */\nexport function exportContent(\n editor: IStandaloneEditor,\n mode: ExportContentMode = 'HTML',\n options?: ModelToDomOption\n): string {\n if (mode == 'PlainTextFast') {\n return editor.getDOMHelper().getTextContent();\n } else {\n const model = editor.getContentModelCopy('disconnected');\n\n if (mode == 'PlainText') {\n return contentModelToText(model);\n } else {\n const doc = editor.getDocument();\n const div = doc.createElement('div');\n\n contentModelToDom(\n doc,\n div,\n model,\n createModelToDomContext(undefined /*editorContext*/, options)\n );\n\n editor.triggerEvent('extractContentWithDom', { clonedRoot: div }, true /*broadcast*/);\n\n return div.innerHTML;\n }\n }\n}\n"]}
@@ -1,4 +1,4 @@
1
- import type { ExportContentMode, IStandaloneEditor } from 'roosterjs-content-model-types';
1
+ import type { ExportContentMode, IStandaloneEditor, ModelToDomOption } from 'roosterjs-content-model-types';
2
2
  /**
3
3
  * Export string content of editor
4
4
  * @param editor The editor to get content from
@@ -6,5 +6,6 @@ import type { ExportContentMode, IStandaloneEditor } from 'roosterjs-content-mod
6
6
  * - HTML: Export HTML content. If there are entities, this will cause EntityOperation event with option = 'replaceTemporaryContent' to get a dehydrated entity
7
7
  * - PlainText: Export plain text content
8
8
  * - PlainTextFast: Export plain text using editor's textContent property directly
9
+ * @param options @optional Options for Model to DOM conversion
9
10
  */
10
- export declare function exportContent(editor: IStandaloneEditor, mode?: ExportContentMode): string;
11
+ export declare function exportContent(editor: IStandaloneEditor, mode?: ExportContentMode, options?: ModelToDomOption): string;
@@ -6,8 +6,9 @@ import { contentModelToDom, contentModelToText, createModelToDomContext, } from
6
6
  * - HTML: Export HTML content. If there are entities, this will cause EntityOperation event with option = 'replaceTemporaryContent' to get a dehydrated entity
7
7
  * - PlainText: Export plain text content
8
8
  * - PlainTextFast: Export plain text using editor's textContent property directly
9
+ * @param options @optional Options for Model to DOM conversion
9
10
  */
10
- export function exportContent(editor, mode) {
11
+ export function exportContent(editor, mode, options) {
11
12
  if (mode === void 0) { mode = 'HTML'; }
12
13
  if (mode == 'PlainTextFast') {
13
14
  return editor.getDOMHelper().getTextContent();
@@ -20,7 +21,7 @@ export function exportContent(editor, mode) {
20
21
  else {
21
22
  var doc = editor.getDocument();
22
23
  var div = doc.createElement('div');
23
- contentModelToDom(doc, div, model, createModelToDomContext());
24
+ contentModelToDom(doc, div, model, createModelToDomContext(undefined /*editorContext*/, options));
24
25
  editor.triggerEvent('extractContentWithDom', { clonedRoot: div }, true /*broadcast*/);
25
26
  return div.innerHTML;
26
27
  }
@@ -1 +1 @@
1
- {"version":3,"file":"exportContent.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-core/lib/publicApi/model/exportContent.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,iBAAiB,EACjB,kBAAkB,EAClB,uBAAuB,GAC1B,MAAM,6BAA6B,CAAC;AAGrC;;;;;;;GAOG;AACH,MAAM,UAAU,aAAa,CAAC,MAAyB,EAAE,IAAgC;IAAhC,qBAAA,EAAA,aAAgC;IACrF,IAAI,IAAI,IAAI,eAAe,EAAE;QACzB,OAAO,MAAM,CAAC,YAAY,EAAE,CAAC,cAAc,EAAE,CAAC;KACjD;SAAM;QACH,IAAM,KAAK,GAAG,MAAM,CAAC,mBAAmB,CAAC,cAAc,CAAC,CAAC;QAEzD,IAAI,IAAI,IAAI,WAAW,EAAE;YACrB,OAAO,kBAAkB,CAAC,KAAK,CAAC,CAAC;SACpC;aAAM;YACH,IAAM,GAAG,GAAG,MAAM,CAAC,WAAW,EAAE,CAAC;YACjC,IAAM,GAAG,GAAG,GAAG,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;YAErC,iBAAiB,CAAC,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,uBAAuB,EAAE,CAAC,CAAC;YAE9D,MAAM,CAAC,YAAY,CAAC,uBAAuB,EAAE,EAAE,UAAU,EAAE,GAAG,EAAE,EAAE,IAAI,CAAC,aAAa,CAAC,CAAC;YAEtF,OAAO,GAAG,CAAC,SAAS,CAAC;SACxB;KACJ;AACL,CAAC","sourcesContent":["import {\n contentModelToDom,\n contentModelToText,\n createModelToDomContext,\n} from 'roosterjs-content-model-dom';\nimport type { ExportContentMode, IStandaloneEditor } from 'roosterjs-content-model-types';\n\n/**\n * Export string content of editor\n * @param editor The editor to get content from\n * @param mode Mode of content to export. It supports:\n * - HTML: Export HTML content. If there are entities, this will cause EntityOperation event with option = 'replaceTemporaryContent' to get a dehydrated entity\n * - PlainText: Export plain text content\n * - PlainTextFast: Export plain text using editor's textContent property directly\n */\nexport function exportContent(editor: IStandaloneEditor, mode: ExportContentMode = 'HTML'): string {\n if (mode == 'PlainTextFast') {\n return editor.getDOMHelper().getTextContent();\n } else {\n const model = editor.getContentModelCopy('disconnected');\n\n if (mode == 'PlainText') {\n return contentModelToText(model);\n } else {\n const doc = editor.getDocument();\n const div = doc.createElement('div');\n\n contentModelToDom(doc, div, model, createModelToDomContext());\n\n editor.triggerEvent('extractContentWithDom', { clonedRoot: div }, true /*broadcast*/);\n\n return div.innerHTML;\n }\n }\n}\n"]}
1
+ {"version":3,"file":"exportContent.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-core/lib/publicApi/model/exportContent.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,iBAAiB,EACjB,kBAAkB,EAClB,uBAAuB,GAC1B,MAAM,6BAA6B,CAAC;AAOrC;;;;;;;;GAQG;AACH,MAAM,UAAU,aAAa,CACzB,MAAyB,EACzB,IAAgC,EAChC,OAA0B;IAD1B,qBAAA,EAAA,aAAgC;IAGhC,IAAI,IAAI,IAAI,eAAe,EAAE;QACzB,OAAO,MAAM,CAAC,YAAY,EAAE,CAAC,cAAc,EAAE,CAAC;KACjD;SAAM;QACH,IAAM,KAAK,GAAG,MAAM,CAAC,mBAAmB,CAAC,cAAc,CAAC,CAAC;QAEzD,IAAI,IAAI,IAAI,WAAW,EAAE;YACrB,OAAO,kBAAkB,CAAC,KAAK,CAAC,CAAC;SACpC;aAAM;YACH,IAAM,GAAG,GAAG,MAAM,CAAC,WAAW,EAAE,CAAC;YACjC,IAAM,GAAG,GAAG,GAAG,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;YAErC,iBAAiB,CACb,GAAG,EACH,GAAG,EACH,KAAK,EACL,uBAAuB,CAAC,SAAS,CAAC,iBAAiB,EAAE,OAAO,CAAC,CAChE,CAAC;YAEF,MAAM,CAAC,YAAY,CAAC,uBAAuB,EAAE,EAAE,UAAU,EAAE,GAAG,EAAE,EAAE,IAAI,CAAC,aAAa,CAAC,CAAC;YAEtF,OAAO,GAAG,CAAC,SAAS,CAAC;SACxB;KACJ;AACL,CAAC","sourcesContent":["import {\n contentModelToDom,\n contentModelToText,\n createModelToDomContext,\n} from 'roosterjs-content-model-dom';\nimport type {\n ExportContentMode,\n IStandaloneEditor,\n ModelToDomOption,\n} from 'roosterjs-content-model-types';\n\n/**\n * Export string content of editor\n * @param editor The editor to get content from\n * @param mode Mode of content to export. It supports:\n * - HTML: Export HTML content. If there are entities, this will cause EntityOperation event with option = 'replaceTemporaryContent' to get a dehydrated entity\n * - PlainText: Export plain text content\n * - PlainTextFast: Export plain text using editor's textContent property directly\n * @param options @optional Options for Model to DOM conversion\n */\nexport function exportContent(\n editor: IStandaloneEditor,\n mode: ExportContentMode = 'HTML',\n options?: ModelToDomOption\n): string {\n if (mode == 'PlainTextFast') {\n return editor.getDOMHelper().getTextContent();\n } else {\n const model = editor.getContentModelCopy('disconnected');\n\n if (mode == 'PlainText') {\n return contentModelToText(model);\n } else {\n const doc = editor.getDocument();\n const div = doc.createElement('div');\n\n contentModelToDom(\n doc,\n div,\n model,\n createModelToDomContext(undefined /*editorContext*/, options)\n );\n\n editor.triggerEvent('extractContentWithDom', { clonedRoot: div }, true /*broadcast*/);\n\n return div.innerHTML;\n }\n }\n}\n"]}
package/package.json CHANGED
@@ -3,10 +3,10 @@
3
3
  "description": "Content Model for roosterjs (Under development)",
4
4
  "dependencies": {
5
5
  "tslib": "^2.3.1",
6
- "roosterjs-content-model-dom": "^0.26.2",
7
- "roosterjs-content-model-types": "^0.26.2"
6
+ "roosterjs-content-model-dom": "^0.26.3",
7
+ "roosterjs-content-model-types": "^0.26.3"
8
8
  },
9
- "version": "0.26.2",
9
+ "version": "0.26.3",
10
10
  "main": "./lib/index.js",
11
11
  "typings": "./lib/index.d.ts",
12
12
  "module": "./lib-mjs/index.js",