mirror of
https://github.com/penpot/penpot.git
synced 2025-12-11 22:14:05 +01:00
🎉 Add an option to enable and disable HTML paste
This commit is contained in:
@@ -58,7 +58,7 @@ import SafeGuard from "./SafeGuard.js";
|
||||
* Supported options for the SelectionController.
|
||||
*
|
||||
* @typedef {Object} SelectionControllerOptions
|
||||
* @property {Object} [debug] An object with references to DOM elements that will keep all the debugging values.
|
||||
* @property {SelectionControllerDebug} [debug] An object with references to DOM elements that will keep all the debugging values.
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -203,6 +203,11 @@ export class SelectionController extends EventTarget {
|
||||
*/
|
||||
#fixInsertCompositionText = false;
|
||||
|
||||
/**
|
||||
* @type {TextEditorOptions}
|
||||
*/
|
||||
#options
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
@@ -219,6 +224,7 @@ export class SelectionController extends EventTarget {
|
||||
throw new TypeError("Invalid EventTarget");
|
||||
}
|
||||
*/
|
||||
this.#options = options;
|
||||
this.#debug = options?.debug;
|
||||
this.#styleDefaults = options?.styleDefaults;
|
||||
this.#selection = selection;
|
||||
@@ -238,6 +244,15 @@ export class SelectionController extends EventTarget {
|
||||
return this.#currentStyle;
|
||||
}
|
||||
|
||||
/**
|
||||
* Text editor options.
|
||||
*
|
||||
* @type {TextEditorOptions}
|
||||
*/
|
||||
get options() {
|
||||
return this.#options;
|
||||
}
|
||||
|
||||
/**
|
||||
* Applies the default styles to the currentStyle
|
||||
* CSSStyleDeclaration.
|
||||
|
||||
Reference in New Issue
Block a user