roosterjs-content-model-core
Advanced tools
Comparing version 9.8.1 to 9.9.0
@@ -1,2 +0,2 @@ | ||
import type { PasteType, ClipboardData, IEditor } from 'roosterjs-content-model-types'; | ||
import type { PasteTypeOrGetter, ClipboardData, IEditor } from 'roosterjs-content-model-types'; | ||
/** | ||
@@ -6,4 +6,4 @@ * Paste into editor using a clipboardData object | ||
* @param clipboardData Clipboard data retrieved from clipboard | ||
* @param pasteType Type of content to paste. @default normal | ||
* @param pasteTypeOrGetter Type of content to paste or function that returns the Paste Type to use based on the document and the clipboard Data. @default normal | ||
*/ | ||
export declare function paste(editor: IEditor, clipboardData: ClipboardData, pasteType?: PasteType): void; | ||
export declare function paste(editor: IEditor, clipboardData: ClipboardData, pasteTypeOrGetter?: PasteTypeOrGetter): void; |
@@ -9,7 +9,7 @@ define(["require", "exports", "./mergePasteContent", "../createModelFromHtml/convertInlineCss", "./createPasteFragment", "./generatePasteOptionFromPlugins", "./retrieveHtmlInfo"], function (require, exports, mergePasteContent_1, convertInlineCss_1, createPasteFragment_1, generatePasteOptionFromPlugins_1, retrieveHtmlInfo_1) { | ||
* @param clipboardData Clipboard data retrieved from clipboard | ||
* @param pasteType Type of content to paste. @default normal | ||
* @param pasteTypeOrGetter Type of content to paste or function that returns the Paste Type to use based on the document and the clipboard Data. @default normal | ||
*/ | ||
function paste(editor, clipboardData, pasteType) { | ||
function paste(editor, clipboardData, pasteTypeOrGetter) { | ||
var _a; | ||
if (pasteType === void 0) { pasteType = 'normal'; } | ||
if (pasteTypeOrGetter === void 0) { pasteTypeOrGetter = 'normal'; } | ||
editor.focus(); | ||
@@ -25,2 +25,5 @@ var trustedHTMLHandler = editor.getTrustedHTMLHandler(); | ||
var doc = createDOMFromHtml(clipboardData.rawHtml, trustedHTMLHandler); | ||
var pasteType = typeof pasteTypeOrGetter == 'function' | ||
? pasteTypeOrGetter(doc, clipboardData) | ||
: pasteTypeOrGetter; | ||
// 2. Handle HTML from clipboard | ||
@@ -27,0 +30,0 @@ var htmlFromClipboard = (0, retrieveHtmlInfo_1.retrieveHtmlInfo)(doc, clipboardData); |
@@ -1,2 +0,2 @@ | ||
import type { PasteType, ClipboardData, IEditor } from 'roosterjs-content-model-types'; | ||
import type { PasteTypeOrGetter, ClipboardData, IEditor } from 'roosterjs-content-model-types'; | ||
/** | ||
@@ -6,4 +6,4 @@ * Paste into editor using a clipboardData object | ||
* @param clipboardData Clipboard data retrieved from clipboard | ||
* @param pasteType Type of content to paste. @default normal | ||
* @param pasteTypeOrGetter Type of content to paste or function that returns the Paste Type to use based on the document and the clipboard Data. @default normal | ||
*/ | ||
export declare function paste(editor: IEditor, clipboardData: ClipboardData, pasteType?: PasteType): void; | ||
export declare function paste(editor: IEditor, clipboardData: ClipboardData, pasteTypeOrGetter?: PasteTypeOrGetter): void; |
@@ -10,7 +10,7 @@ import { cloneModelForPaste, mergePasteContent } from './mergePasteContent'; | ||
* @param clipboardData Clipboard data retrieved from clipboard | ||
* @param pasteType Type of content to paste. @default normal | ||
* @param pasteTypeOrGetter Type of content to paste or function that returns the Paste Type to use based on the document and the clipboard Data. @default normal | ||
*/ | ||
export function paste(editor, clipboardData, pasteType) { | ||
export function paste(editor, clipboardData, pasteTypeOrGetter) { | ||
var _a; | ||
if (pasteType === void 0) { pasteType = 'normal'; } | ||
if (pasteTypeOrGetter === void 0) { pasteTypeOrGetter = 'normal'; } | ||
editor.focus(); | ||
@@ -26,2 +26,5 @@ var trustedHTMLHandler = editor.getTrustedHTMLHandler(); | ||
var doc = createDOMFromHtml(clipboardData.rawHtml, trustedHTMLHandler); | ||
var pasteType = typeof pasteTypeOrGetter == 'function' | ||
? pasteTypeOrGetter(doc, clipboardData) | ||
: pasteTypeOrGetter; | ||
// 2. Handle HTML from clipboard | ||
@@ -28,0 +31,0 @@ var htmlFromClipboard = retrieveHtmlInfo(doc, clipboardData); |
@@ -1,2 +0,2 @@ | ||
import type { PasteType, ClipboardData, IEditor } from 'roosterjs-content-model-types'; | ||
import type { PasteTypeOrGetter, ClipboardData, IEditor } from 'roosterjs-content-model-types'; | ||
/** | ||
@@ -6,4 +6,4 @@ * Paste into editor using a clipboardData object | ||
* @param clipboardData Clipboard data retrieved from clipboard | ||
* @param pasteType Type of content to paste. @default normal | ||
* @param pasteTypeOrGetter Type of content to paste or function that returns the Paste Type to use based on the document and the clipboard Data. @default normal | ||
*/ | ||
export declare function paste(editor: IEditor, clipboardData: ClipboardData, pasteType?: PasteType): void; | ||
export declare function paste(editor: IEditor, clipboardData: ClipboardData, pasteTypeOrGetter?: PasteTypeOrGetter): void; |
@@ -13,7 +13,7 @@ "use strict"; | ||
* @param clipboardData Clipboard data retrieved from clipboard | ||
* @param pasteType Type of content to paste. @default normal | ||
* @param pasteTypeOrGetter Type of content to paste or function that returns the Paste Type to use based on the document and the clipboard Data. @default normal | ||
*/ | ||
function paste(editor, clipboardData, pasteType) { | ||
function paste(editor, clipboardData, pasteTypeOrGetter) { | ||
var _a; | ||
if (pasteType === void 0) { pasteType = 'normal'; } | ||
if (pasteTypeOrGetter === void 0) { pasteTypeOrGetter = 'normal'; } | ||
editor.focus(); | ||
@@ -29,2 +29,5 @@ var trustedHTMLHandler = editor.getTrustedHTMLHandler(); | ||
var doc = createDOMFromHtml(clipboardData.rawHtml, trustedHTMLHandler); | ||
var pasteType = typeof pasteTypeOrGetter == 'function' | ||
? pasteTypeOrGetter(doc, clipboardData) | ||
: pasteTypeOrGetter; | ||
// 2. Handle HTML from clipboard | ||
@@ -31,0 +34,0 @@ var htmlFromClipboard = (0, retrieveHtmlInfo_1.retrieveHtmlInfo)(doc, clipboardData); |
@@ -6,6 +6,6 @@ { | ||
"tslib": "^2.3.1", | ||
"roosterjs-content-model-dom": "^9.8.1", | ||
"roosterjs-content-model-types": "^9.8.1" | ||
"roosterjs-content-model-dom": "^9.9.0", | ||
"roosterjs-content-model-types": "^9.9.0" | ||
}, | ||
"version": "9.8.1", | ||
"version": "9.9.0", | ||
"main": "./lib/index.js", | ||
@@ -12,0 +12,0 @@ "typings": "./lib/index.d.ts", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2463737
22267