roosterjs 8.60.0 → 8.61.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/dist/rooster-adapter-amd-min.js +2 -0
- package/dist/rooster-adapter-amd-min.js.map +1 -0
- package/dist/rooster-adapter-amd.js +2502 -0
- package/dist/rooster-adapter-amd.js.map +1 -0
- package/dist/rooster-adapter-min.js +2 -0
- package/dist/rooster-adapter-min.js.map +1 -0
- package/dist/rooster-adapter.js +2502 -0
- package/dist/rooster-adapter.js.map +1 -0
- package/dist/rooster-amd-min.js +1 -1
- package/dist/rooster-amd-min.js.map +1 -1
- package/dist/rooster-amd.d.ts +6 -1
- package/dist/rooster-amd.js +24 -2
- package/dist/rooster-amd.js.map +1 -1
- package/dist/rooster-content-model-amd-min.js +2 -0
- package/dist/rooster-content-model-amd-min.js.map +1 -0
- package/dist/rooster-content-model-amd.d.ts +7300 -0
- package/dist/rooster-content-model-amd.js +26594 -0
- package/dist/rooster-content-model-amd.js.map +1 -0
- package/dist/rooster-content-model-min.js +2 -0
- package/dist/rooster-content-model-min.js.map +1 -0
- package/dist/rooster-content-model.d.ts +7302 -0
- package/dist/rooster-content-model.js +26594 -0
- package/dist/rooster-content-model.js.map +1 -0
- package/dist/rooster-min.js +1 -1
- package/dist/rooster-min.js.map +1 -1
- package/dist/rooster-react-amd-min.js +2 -0
- package/dist/rooster-react-amd-min.js.map +1 -0
- package/dist/rooster-react-amd.d.ts +882 -0
- package/dist/rooster-react-amd.js +7073 -0
- package/dist/rooster-react-amd.js.map +1 -0
- package/dist/rooster-react-min.js +2 -0
- package/dist/rooster-react-min.js.map +1 -0
- package/dist/rooster-react.d.ts +884 -0
- package/dist/rooster-react.js +7073 -0
- package/dist/rooster-react.js.map +1 -0
- package/dist/rooster.d.ts +6 -1
- package/dist/rooster.js +24 -2
- package/dist/rooster.js.map +1 -1
- package/package.json +7 -7
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
define(["roosterjsContentModel","roosterjs"],((e,t)=>(()=>{"use strict";var n={312:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createSizeTransformer=t.BridgePlugin=void 0;var o=n(582),r=n(993),a=n(192),i=n(134),l=n(122),s=function(){function e(e,t,n){void 0===t&&(t=[]),void 0===n&&(n=[]),this.onInitialize=e,this.experimentalFeatures=n;var r=(0,i.createEditPlugin)();this.legacyPlugins=(0,o.__spreadArray)([r],(0,o.__read)(t.filter((function(e){return!!e}))),!1),this.edit=r.getState(),this.contextMenuProviders=this.legacyPlugins.filter(u),this.checkExclusivelyHandling=this.legacyPlugins.some((function(e){return e.willHandleEventExclusively}))}return e.prototype.getName=function(){return"Bridge"},e.prototype.initialize=function(e){var t=this.onInitialize(this.createEditorCore(e));this.legacyPlugins.forEach((function(e){return e.initialize(t)}))},e.prototype.dispose=function(){for(var e=this.legacyPlugins.length-1;e>=0;e--)this.legacyPlugins[e].dispose()},e.prototype.willHandleEventExclusively=function(e){return this.checkExclusivelyHandling&&!!this.cacheGetExclusivelyHandlePlugin(e)},e.prototype.onPluginEvent=function(e){var t,n=this.cacheGetOldEvent(e);if(n){var o=this.cacheGetExclusivelyHandlePlugin(e);o?null===(t=o.onPluginEvent)||void 0===t||t.call(o,n):this.legacyPlugins.forEach((function(e){var t;return null===(t=e.onPluginEvent)||void 0===t?void 0:t.call(e,n)})),Object.assign(e,(0,l.oldEventToNewEvent)(n,e))}},e.prototype.getContextMenuItems=function(e){var t=[];return this.contextMenuProviders.forEach((function(n){var r,a=null!==(r=n.getContextMenuItems(e))&&void 0!==r?r:[];(null==a?void 0:a.length)>0&&(t.length>0&&t.push(null),t.push.apply(t,(0,o.__spreadArray)([],(0,o.__read)(a),!1)))})),t},e.prototype.cacheGetExclusivelyHandlePlugin=function(e){var t=this;return(0,r.cacheGetEventData)(e,"__ExclusivelyHandleEventPlugin",(function(e){var n,o=t.cacheGetOldEvent(e);if(o)for(var r=0;r<t.legacyPlugins.length;r++){var a=t.legacyPlugins[r];if(null===(n=a.willHandleEventExclusively)||void 0===n?void 0:n.call(a,o))return a}return null}))},e.prototype.cacheGetOldEvent=function(e){return(0,r.cacheGetEventData)(e,"__OldEventFromNewEvent",l.newEventToOldEvent)},e.prototype.createEditorCore=function(e){var t;return{customData:{},experimentalFeatures:null!==(t=this.experimentalFeatures)&&void 0!==t?t:[],sizeTransformer:c(e),darkColorHandler:(0,a.createDarkColorHandler)(e.getColorManager()),edit:this.edit,contextMenuProviders:this.contextMenuProviders}},e}();function c(e){return function(t){return t/e.getDOMHelper().calculateZoomScale()}}function u(e){var t;return!!(null===(t=e)||void 0===t?void 0:t.getContextMenuItems)}t.BridgePlugin=s,t.createSizeTransformer=c},134:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createEditPlugin=void 0;var o=n(839),r=function(){function e(){this.editor=null,this.state={features:{}}}return e.prototype.getName=function(){return"Edit"},e.prototype.initialize=function(e){this.editor=e},e.prototype.dispose=function(){this.editor=null},e.prototype.getState=function(){return this.state},e.prototype.onPluginEvent=function(e){var t,n=!1,r=null,a=!1,i=0==e.eventType;if(i){var l=e.rawEvent,s=null===(t=this.editor)||void 0===t?void 0:t.getSelectionRange();n=(a=(0,o.isCtrlOrMetaPressed)(l))||l.altKey,r=this.state.features[l.which]||s&&!s.collapsed&&this.state.features[258]}else 7==e.eventType&&(r=this.state.features[257]);for(var c=0;r&&c<(null==r?void 0:r.length);c++){var u=r[c];if((u.allowFunctionKeys||!n)&&this.editor&&u.shouldHandleEvent(e,this.editor,a)){u.handleEvent(e,this.editor),i&&(e.handledByEditFeature=!0);break}}},e}();t.createEditPlugin=function(){return new r}},192:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createDarkColorHandler=void 0;var o=n(993),r=/^\s*var\(\s*(\-\-[a-zA-Z0-9\-_]+)\s*(?:,\s*(.*))?\)\s*$/,a=function(){function e(e){this.innerHandler=e}return e.prototype.getKnownColorsCopy=function(){return Object.values(this.innerHandler.knownColors)},e.prototype.registerColor=function(e,t,n){var o,r=this.parseColorValue(e);return r&&(e=r.lightModeColor,n=r.darkModeColor||n,o=r.key),t&&e?(o=o||"--darkColor_"+e.replace(/[^\d\w]/g,"_"),this.innerHandler.updateKnownColor(t,o,{lightModeColor:e,darkModeColor:n||this.innerHandler.getDarkColor(e)}),"var("+o+", "+e+")"):e},e.prototype.reset=function(){this.innerHandler.reset()},e.prototype.parseColorValue=function(e,t){var n,o,a,i="";if(e){var l=e.startsWith("var(")?r.exec(e):null;l?l[2]?(o=l[1],i=l[2],a=null===(n=this.innerHandler.knownColors[o])||void 0===n?void 0:n.darkModeColor):i="":t?(i=this.findLightColorFromDarkColor(e)||"")&&(a=e):i=e}return{key:o,lightModeColor:i,darkModeColor:a}},e.prototype.findLightColorFromDarkColor=function(e){var t=(0,o.parseColor)(e),n=this.innerHandler.knownColors;if(t){var r=(0,o.getObjectKeys)(n).find((function(e){var r=(0,o.parseColor)(n[e].darkModeColor);return r&&r[0]==t[0]&&r[1]==t[1]&&r[2]==t[2]}));if(r)return n[r].lightModeColor}return null},e.prototype.transformElementColor=function(e,t,n){var r=(0,o.getColor)(e,!1,!n,this.innerHandler),a=(0,o.getColor)(e,!0,!n,this.innerHandler);(0,o.setColor)(e,r,!1,n,this.innerHandler),(0,o.setColor)(e,a,!0,n,this.innerHandler)},e}();t.createDarkColorHandler=function(e){return new a(e)}},279:(e,t,n)=>{var o;Object.defineProperty(t,"__esModule",{value:!0}),t.EditorAdapter=void 0;var r=n(582),a=n(312),i=n(562),l=n(993),s=n(151),c=n(122),u=n(993),d=n(54),v=n(839),p=((o={})[0]="HTML",o[3]="PlainText",o[4]="PlainTextFast",o[1]="HTML",o[2]="HTML",o),f=function(e){function t(t,n){var o,i;void 0===n&&(n={});var l=this,s=new a.BridgePlugin((function(e){return l.contentModelEditorCore=e,l}),n.legacyPlugins,n.experimentalFeatures),c=(0,r.__spreadArray)([s],(0,r.__read)(null!==(o=n.plugins)&&void 0!==o?o:[]),!1),d=null!==(i=n.initialContent)&&void 0!==i?i:t.innerHTML,v=d&&!n.initialModel?(0,u.createModelFromHtml)(d,n.defaultDomToModelOptions,n.trustedHTMLHandler,n.defaultSegmentFormat):n.initialModel,p=(0,r.__assign)((0,r.__assign)({},n),{plugins:c,initialModel:v});return l=e.call(this,t,p)||this}return(0,r.__extends)(t,e),t.prototype.dispose=function(){e.prototype.dispose.call(this);var t=this.contentModelEditorCore;t&&((0,l.getObjectKeys)(t.customData).forEach((function(e){var n=t.customData[e];n&&n.disposer&&n.disposer(n.value),delete t.customData[e]})),this.contentModelEditorCore=void 0)},t.prototype.isDisposed=function(){return e.prototype.isDisposed.call(this)||!this.contentModelEditorCore},t.prototype.insertNode=function(e,t){var n;if(e){t=t||{position:3,insertOnNewLine:!1,updateCursor:!0,replaceSelection:!0,insertToRegionRoot:!1};var o=this.getCore().physicalRoot;if(t.updateCursor&&this.focus(),4==t.position)null===(n=o.parentNode)||void 0===n||n.insertBefore(e,o.nextSibling);else{this.isDarkMode()&&(0,u.transformColor)(e,!0,"lightToDark",this.getColorManager());var r=(0,s.insertNode)(o,this.getDOMSelection(),e,t);r&&t.updateCursor&&this.setDOMSelection(r)}return!0}return!1},t.prototype.deleteNode=function(e){return!!(e&&this.contains(e)&&e.parentNode)&&(e.parentNode.removeChild(e),!0)},t.prototype.replaceNode=function(e,t,n){var o,r=this.getCore();return!(!this.contains(e)||!t||(r.lifecycle.isDarkMode&&n&&this.transformToDarkColor(t,0),null===(o=e.parentNode)||void 0===o||o.replaceChild(t,e),0))},t.prototype.getBlockElementAtNode=function(e){return(0,v.getBlockElementAtNode)(this.getCore().logicalRoot,e)},t.prototype.contains=function(e){return!!e&&(0,v.contains)(this.getCore().logicalRoot,e)},t.prototype.queryElements=function(e,t,n){void 0===t&&(t=0);var o=this.getCore(),a=[],i=t instanceof Function?0:t;n=t instanceof Function?t:n;var l=0==i?null:this.getSelectionRangeEx();return l?(l.ranges.forEach((function(t){a.push.apply(a,(0,r.__spreadArray)([],(0,r.__read)((0,v.queryElements)(o.logicalRoot,e,n,i,t)),!1))})),a):(0,v.queryElements)(o.logicalRoot,e,n,i,void 0)},t.prototype.collapseNodes=function(e,t,n){return(0,v.collapseNodes)(this.getCore().physicalRoot,e,t,n)},t.prototype.isEmpty=function(e){return(0,v.isNodeEmpty)(this.getCore().physicalRoot,e)},t.prototype.getContent=function(e){return void 0===e&&(e=0),(0,u.exportContent)(this,p[e],this.getCore().environment.modelToDomSettings.customized)},t.prototype.setContent=function(e,t){void 0===t&&(t=!0);var n=this.getCore(),o=n.physicalRoot,r=n.api,a=n.trustedHTMLHandler,i=n.lifecycle,l=n.darkColorHandler;r.triggerEvent(n,{eventType:"beforeSetContent",newContent:e},!0);var s=(0,u.createModelFromHtml)(e,n.environment.domToModelSettings.customized,a,n.format.defaultFormat);r.setContentModel(n,s),t?r.triggerEvent(n,{eventType:"contentChanged",source:"SetContent"},!1):i.isDarkMode&&(0,u.transformColor)(o,!1,"lightToDark",l)},t.prototype.insertContent=function(e,t){var n;if(e){var o=this.getDocument(),r=null===(n=(new DOMParser).parseFromString(this.getCore().trustedHTMLHandler(e),"text/html"))||void 0===n?void 0:n.body,a=(null==r?void 0:r.childNodes)?(0,v.toArray)(r.childNodes):[];t&&t.insertOnNewLine&&a.length>1&&(a=[(0,v.wrap)(a)]);var i=o.createDocumentFragment();a.forEach((function(e){return i.appendChild(e)})),this.insertNode(i,t)}},t.prototype.deleteSelectedContent=function(){var e=this.getSelectionRange();return e&&!e.collapsed?(0,v.deleteSelectedContent)(this.getCore().physicalRoot,e):null},t.prototype.paste=function(e,t,n,o){void 0===t&&(t=!1),void 0===n&&(n=!1),void 0===o&&(o=!1),(0,u.paste)(this,e,t?"asPlainText":n?"mergeFormat":o?"asImage":"normal")},t.prototype.getSelectionRange=function(e){void 0===e&&(e=!0);var t=this.getDOMSelection();return"range"==(null==t?void 0:t.type)?t.range:null},t.prototype.getSelectionRangeEx=function(){var e=this.getDOMSelection();return(0,d.convertDomSelectionToRangeEx)(e)},t.prototype.getSelectionPath=function(){var e=this.getSelectionRange();return e&&(0,v.getSelectionPath)(this.getCore().physicalRoot,e)},t.prototype.select=function(e,t,n,o){var r=this.getCore(),a=(0,i.buildRangeEx)(r.physicalRoot,e,t,n,o),l=(0,d.convertRangeExToDomSelection)(a);return this.setDOMSelection(l),!0},t.prototype.getFocusedPosition=function(){var e,t=null===(e=this.getDocument().defaultView)||void 0===e?void 0:e.getSelection();if((null==t?void 0:t.focusNode)&&this.contains(t.focusNode))return new v.Position(t.focusNode,t.focusOffset);var n=this.getSelectionRange();return n?v.Position.getStart(n):null},t.prototype.getElementAtCursor=function(e,t,n){var o,r=this;return n=t?void 0:n,null!==(o=(0,v.cacheGetEventData)(null!=n?n:null,"GET_ELEMENT_AT_CURSOR_"+e,(function(){if(!t){var n=r.getFocusedPosition();t=null==n?void 0:n.node}return t&&r.getDOMHelper().findClosestElementAncestor(t,e)})))&&void 0!==o?o:null},t.prototype.isPositionAtBeginning=function(e){return(0,v.isPositionAtBeginningOf)(e,this.getCore().logicalRoot)},t.prototype.getSelectedRegions=function(e){void 0===e&&(e=0);var t=this.getSelectionRangeEx(),n=[],o=this.getCore().logicalRoot;return t.ranges.forEach((function(t){n.push.apply(n,(0,r.__spreadArray)([],(0,r.__read)(t?(0,v.getRegionsFromRange)(o,t,e):[]),!1))})),n.filter((function(e,t,n){return n.indexOf(e)===t}))},t.prototype.addDomEventHandler=function(e,t){var n,o="string"==typeof e?((n={})[e]=t,n):e,r={};return(0,l.getObjectKeys)(o).forEach((function(e){var t=o[e],n={pluginEventType:null,beforeDispatch:null};if("number"==typeof t)n.pluginEventType=c.OldEventTypeToNewEventType[t];else if("function"==typeof t)n.beforeDispatch=t;else if("object"==typeof t){var a=t;n={beforeDispatch:a.beforeDispatch,pluginEventType:"number"==typeof a.pluginEventType?c.OldEventTypeToNewEventType[a.pluginEventType]:void 0}}r[e]=n})),this.attachDomEvent(r)},t.prototype.triggerPluginEvent=function(e,t,n){var o;void 0===n&&(n=!1);var a=(0,r.__assign)({eventType:e},t),i=(0,c.oldEventToNewEvent)(a),l=this.getCore();return i?(l.api.triggerEvent(l,i,n),null!==(o=(0,c.newEventToOldEvent)(i,a))&&void 0!==o?o:a):a},t.prototype.triggerContentChangedEvent=function(e,t){void 0===e&&(e="SetContent"),this.triggerPluginEvent(7,{source:e,data:t})},t.prototype.undo=function(){(0,u.undo)(this)},t.prototype.redo=function(){(0,u.redo)(this)},t.prototype.addUndoSnapshot=function(e,t,n,o){var r,a,i,l=this.getCore(),s=l.undo,c=s.isNested;c||(s.isNested=!0,!l.undo.snapshotsManager.hasNewContent&&(null==o?void 0:o.getEntityState)&&e||l.api.addUndoSnapshot(l,!!n,null===(r=null==o?void 0:o.getEntityState)||void 0===r?void 0:r.call(o)));try{if(e){var u,d="range"==(null==(u=l.api.getDOMSelection(l))?void 0:u.type)?u.range:null;if(i=e(d&&v.Position.getStart(d).normalize(),d&&v.Position.getEnd(d).normalize()),!c){var p=null===(a=null==o?void 0:o.getEntityState)||void 0===a?void 0:a.call(o);l.api.addUndoSnapshot(l,!1,p)}}}finally{c||(s.isNested=!1)}if(e&&t){var f={eventType:7,source:t,data:i,additionalData:o};this.triggerPluginEvent(7,f,!0)}n&&"range"==(null==(u=l.api.getDOMSelection(l))?void 0:u.type)&&(l.undo.snapshotsManager.hasNewContent=!1,l.undo.posContainer=u.range.startContainer,l.undo.posOffset=u.range.startOffset)},t.prototype.getUndoState=function(){var e=this.getCore().undo.snapshotsManager;return{canUndo:e.hasNewContent||e.canMove(-1),canRedo:e.canMove(1)}},t.prototype.getCustomData=function(e,t,n){var o=this.getContentModelEditorCore();return(o.customData[e]=o.customData[e]||{value:t?t():void 0,disposer:n}).value},t.prototype.getDefaultFormat=function(){var e=this.getCore().format.defaultFormat;return{bold:(0,u.isBold)(e.fontWeight),italic:e.italic,underline:e.underline,fontFamily:e.fontFamily,fontSize:e.fontSize,textColor:e.textColor,backgroundColor:e.backgroundColor}},t.prototype.getBodyTraverser=function(e){return v.ContentTraverser.createBodyTraverser(this.getCore().logicalRoot,e)},t.prototype.getSelectionTraverser=function(e){var t;return(e=null!==(t=null!=e?e:this.getSelectionRange())&&void 0!==t?t:void 0)?v.ContentTraverser.createSelectionTraverser(this.getCore().logicalRoot,e):null},t.prototype.getBlockTraverser=function(e){void 0===e&&(e=3);var t=this.getSelectionRange();return t?v.ContentTraverser.createBlockTraverser(this.getCore().logicalRoot,t,e):null},t.prototype.getContentSearcherOfCursor=function(e){var t=this;return(0,v.cacheGetEventData)(null!=e?e:null,"ContentSearcher",(function(){var e=t.getSelectionRange();return e&&new v.PositionContentSearcher(t.getCore().logicalRoot,v.Position.getStart(e))}))},t.prototype.runAsync=function(e){var t=this,n=this.getCore().physicalRoot.ownerDocument.defaultView||window,o=n.requestAnimationFrame((function(){!t.isDisposed()&&e&&e(t)}));return function(){n.cancelAnimationFrame(o)}},t.prototype.setEditorDomAttribute=function(e,t){this.getDOMHelper().setDomAttribute(e,t)},t.prototype.getEditorDomAttribute=function(e){return this.getDOMHelper().getDomAttribute(e)},t.prototype.getRelativeDistanceToEditor=function(e,t){if(this.contains(e)){var n=this.getCore().physicalRoot,o=n.getBoundingClientRect(),r=e.getBoundingClientRect();if(o&&r){var a=r.left-(null==o?void 0:o.left),i=r.top-(null==o?void 0:o.top);return t&&(a+=n.scrollLeft,i+=n.scrollTop),[a,i]}}return null},t.prototype.addContentEditFeature=function(e){var t=this.getContentModelEditorCore();null==e||e.keys.forEach((function(n){var o=t.edit.features[n]||[];o.push(e),t.edit.features[n]=o}))},t.prototype.removeContentEditFeature=function(e){var t=this.getContentModelEditorCore();null==e||e.keys.forEach((function(n){var o,r=t.edit.features[n],a=null!==(o=null==r?void 0:r.indexOf(e))&&void 0!==o?o:-1;a>=0&&(t.edit.features[n].splice(a,1),t.edit.features[n].length<1&&delete t.edit.features[n])}))},t.prototype.getStyleBasedFormatState=function(){var e=this.retrieveFormatState();return{backgroundColor:e.backgroundColor,direction:e.direction,fontName:e.fontName,fontSize:e.fontSize,fontWeight:e.fontWeight,lineHeight:e.lineHeight,marginBottom:e.marginBottom,marginTop:e.marginTop,textAlign:e.textAlign,textColor:e.textColor}},t.prototype.getPendableFormatState=function(){var e=this.retrieveFormatState();return{isBold:e.isBold,isItalic:e.isItalic,isStrikeThrough:e.isStrikeThrough,isSubscript:e.isSubscript,isSuperscript:e.isSubscript,isUnderline:e.isUnderline}},t.prototype.ensureTypeInContainer=function(e,t){},t.prototype.transformToDarkColor=function(e,t){void 0===t&&(t=0);var n=this.getCore();n.lifecycle.isDarkMode&&(0,u.transformColor)(e,!0,1==t?"darkToLight":"lightToDark",n.darkColorHandler)},t.prototype.isFeatureEnabled=function(e){return this.getContentModelEditorCore().experimentalFeatures.indexOf(e)>=0},t.prototype.getZoomScale=function(){return this.getDOMHelper().calculateZoomScale()},t.prototype.setZoomScale=function(e){e>0&&e<=10&&this.getZoomScale()!=e&&this.triggerEvent("zoomChanged",{newZoomScale:e},!0)},t.prototype.getSizeTransformer=function(){return this.getContentModelEditorCore().sizeTransformer},t.prototype.getDarkColorHandler=function(){return this.getContentModelEditorCore().darkColorHandler},t.prototype.isInIME=function(){return this.getCore().domEvent.isInIME},t.prototype.retrieveFormatState=function(){var e=this.getPendingFormat(),t={},n=this.getContentModelCopy("reduced");return(0,u.retrieveModelFormatState)(n,e,t),t},t.prototype.getContentModelEditorCore=function(){if(!this.contentModelEditorCore)throw new Error("Editor is already disposed");return this.contentModelEditorCore},t}(u.Editor);t.EditorAdapter=f},562:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.buildRangeEx=void 0;var o=n(839);t.buildRangeEx=function(e,t,n,r,a){var i,l,s=null;if(function(e){var t=e;return t&&"object"==typeof t&&"number"==typeof t.type&&Array.isArray(t.ranges)}(t))s=t;else if((0,o.safeInstanceOf)(t,"HTMLTableElement")&&(null===(i=n)||i&&"object"==typeof i&&"object"==typeof i.firstCell&&"object"==typeof i.lastCell))s={type:1,ranges:[],areAllCollapsed:!1,table:t,coordinates:null!=n?n:void 0};else if((0,o.safeInstanceOf)(t,"HTMLImageElement")&&void 0===n)s={type:2,ranges:[],areAllCollapsed:!1,image:t};else{var c=t?(0,o.safeInstanceOf)(t,"Range")?t:(l=t)&&"object"==typeof l&&Array.isArray(l.start)&&Array.isArray(l.end)?(0,o.createRange)(e,t.start,t.end):function(e){var t=e;return t&&"object"==typeof t&&"object"==typeof t.node&&"number"==typeof t.offset}(t)||(0,o.safeInstanceOf)(t,"Node")?(0,o.createRange)(t,n,r,a):null:null;s=c?{type:0,ranges:[c],areAllCollapsed:c.collapsed}:{type:0,ranges:[],areAllCollapsed:!0}}return s}},122:(e,t,n)=>{var o,r,a,i;Object.defineProperty(t,"__esModule",{value:!0}),t.newEventToOldEvent=t.oldEventToNewEvent=t.OldEventTypeToNewEventType=void 0;var l=n(54),s=n(839),c={asImage:3,asPlainText:1,mergeFormat:2,normal:0},u=((o={})[3]="asImage",o[1]="asPlainText",o[2]="mergeFormat",o[0]="normal",o),d=((r={})[2]="announceListItemBullet",r[1]="announceListItemNumbering",r[3]="announceOnFocusLastCell",r),v={announceListItemBullet:2,announceListItemNumbering:1,announceOnFocusLastCell:3},p=((a={})[0]="newEntity",a[6]="overwrite",a[5]="removeFromEnd",a[4]="removeFromStart",a[8]="replaceTemporaryContent",a[11]="updateEntityState",a[1]="click",a[2]=void 0,a[3]=void 0,a[7]=void 0,a[9]=void 0,a[10]=void 0,a),f={newEntity:0,overwrite:6,removeFromEnd:5,removeFromStart:4,replaceTemporaryContent:8,updateEntityState:11,click:1};t.OldEventTypeToNewEventType=((i={})[9]="beforeCutCopy",i[12]="beforeDispose",i[23]="beforeKeyboardEditing",i[10]="beforePaste",i[20]="beforeSetContent",i[4]="compositionEnd",i[7]="contentChanged",i[16]="contextMenu",i[19]="editImage",i[11]="editorReady",i[17]="enteredShadowEdit",i[15]="entityOperation",i[8]="extractContentWithDom",i[3]="input",i[0]="keyDown",i[1]="keyPress",i[2]="keyUp",i[18]="leavingShadowEdit",i[5]="mouseDown",i[6]="mouseUp",i[13]=void 0,i[14]="scroll",i[22]="selectionChanged",i[21]="zoomChanged",i),t.oldEventToNewEvent=function(e,t){var n,o,r,a,i,s,c,v,f,g,y,h,m;switch(e.eventType){case 9:return{eventType:"beforeCutCopy",clonedRoot:e.clonedRoot,eventDataCache:e.eventDataCache,isCut:e.isCut,range:e.range,rawEvent:e.rawEvent};case 12:return{eventType:"beforeDispose",eventDataCache:e.eventDataCache};case 23:return{eventType:"beforeKeyboardEditing",eventDataCache:e.eventDataCache,rawEvent:e.rawEvent};case 10:var C="beforePaste"==(null==t?void 0:t.eventType)?t:void 0,E=e;return{eventType:"beforePaste",clipboardData:e.clipboardData,customizedMerge:null!==(n=E.customizedMerge)&&void 0!==n?n:null==C?void 0:C.customizedMerge,domToModelOption:null!==(r=null!==(o=E.domToModelOption)&&void 0!==o?o:null==C?void 0:C.domToModelOption)&&void 0!==r?r:{additionalAllowedTags:[],additionalDisallowedTags:[],additionalFormatParsers:{},formatParserOverride:{},processorOverride:{},styleSanitizers:{},attributeSanitizers:{}},eventDataCache:e.eventDataCache,fragment:e.fragment,htmlAfter:e.htmlAfter,htmlAttributes:e.htmlAttributes,htmlBefore:e.htmlBefore,pasteType:u[e.pasteType]};case 20:return{eventType:"beforeSetContent",eventDataCache:e.eventDataCache,newContent:e.newContent};case 4:return{eventType:"compositionEnd",eventDataCache:e.eventDataCache,rawEvent:e.rawEvent};case 7:var w="contentChanged"==(null==t?void 0:t.eventType)?t:void 0;return{eventType:"contentChanged",eventDataCache:e.eventDataCache,changedEntities:null==w?void 0:w.changedEntities,contentModel:null==w?void 0:w.contentModel,data:e.data,entityStates:null!==(s=null===(i=null===(a=e.additionalData)||void 0===a?void 0:a.getEntityState)||void 0===i?void 0:i.call(a))&&void 0!==s?s:null==w?void 0:w.entityStates,selection:null==w?void 0:w.selection,source:e.source,formatApiName:null!==(v=null===(c=e.additionalData)||void 0===c?void 0:c.formatApiName)&&void 0!==v?v:null==w?void 0:w.formatApiName,announceData:null!==(m=null===(g=null===(f=e.additionalData)||void 0===f?void 0:f.getAnnounceData)||void 0===g?void 0:g.call(f),y=m?{defaultStrings:m.defaultStrings?d[m.defaultStrings]:void 0,formatStrings:m.formatStrings,text:m.text}:void 0)&&void 0!==y?y:null==w?void 0:w.announceData};case 16:return{eventType:"contextMenu",eventDataCache:e.eventDataCache,rawEvent:e.rawEvent,items:e.items};case 19:return{eventType:"editImage",eventDataCache:e.eventDataCache,image:e.image,newSrc:e.newSrc,originalSrc:e.originalSrc,previousSrc:e.previousSrc};case 11:return{eventType:"editorReady",eventDataCache:e.eventDataCache};case 17:return{eventType:"enteredShadowEdit",eventDataCache:e.eventDataCache};case 15:var D=p[e.operation];return void 0===D?void 0:{eventType:"entityOperation",eventDataCache:e.eventDataCache,rawEvent:e.rawEvent,entity:e.entity,operation:D,shouldPersist:e.shouldPersist,state:e.state};case 8:return{eventType:"extractContentWithDom",eventDataCache:e.eventDataCache,clonedRoot:e.clonedRoot};case 3:return{eventType:"input",eventDataCache:e.eventDataCache,rawEvent:e.rawEvent};case 0:case 1:case 2:return{eventType:0==e.eventType?"keyDown":1==e.eventType?"keyPress":"keyUp",eventDataCache:e.eventDataCache,rawEvent:e.rawEvent};case 18:return{eventType:"leavingShadowEdit",eventDataCache:e.eventDataCache};case 5:return{eventType:"mouseDown",eventDataCache:e.eventDataCache,rawEvent:e.rawEvent};case 6:return{eventType:"mouseUp",eventDataCache:e.eventDataCache,rawEvent:e.rawEvent,isClicking:e.isClicking};case 14:return{eventType:"scroll",eventDataCache:e.eventDataCache,rawEvent:e.rawEvent,scrollContainer:e.scrollContainer};case 22:var T="selectionChanged"==(null==t?void 0:t.eventType)?t:void 0;return{eventType:"selectionChanged",eventDataCache:e.eventDataCache,newSelection:null!==(h=null==T?void 0:T.newSelection)&&void 0!==h?h:(0,l.convertRangeExToDomSelection)(e.selectionRangeEx)};case 21:return{eventType:"zoomChanged",eventDataCache:e.eventDataCache,newZoomScale:e.newZoomScale};default:return}},t.newEventToOldEvent=function(e,t){var n,o,r,a;switch(e.eventType){case"beforeCutCopy":return{eventType:9,clonedRoot:e.clonedRoot,eventDataCache:e.eventDataCache,isCut:e.isCut,range:e.range,rawEvent:e.rawEvent};case"beforeDispose":return{eventType:12,eventDataCache:e.eventDataCache};case"beforeKeyboardEditing":return{eventType:23,eventDataCache:e.eventDataCache,rawEvent:e.rawEvent};case"beforePaste":var i=10==(null==t?void 0:t.eventType)?t:void 0;return{eventType:10,clipboardData:e.clipboardData,eventDataCache:e.eventDataCache,fragment:e.fragment,htmlAfter:e.htmlAfter,htmlAttributes:e.htmlAttributes,htmlBefore:e.htmlBefore,pasteType:c[e.pasteType],sanitizingOption:null!==(n=null==i?void 0:i.sanitizingOption)&&void 0!==n?n:(0,s.createDefaultHtmlSanitizerOptions)(),domToModelOption:e.domToModelOption,customizedMerge:e.customizedMerge};case"beforeSetContent":return{eventType:20,eventDataCache:e.eventDataCache,newContent:e.newContent};case"compositionEnd":return{eventType:4,eventDataCache:e.eventDataCache,rawEvent:e.rawEvent};case"contentChanged":var u=e.entityStates;return{eventType:7,eventDataCache:e.eventDataCache,data:e.data,source:e.source,additionalData:{formatApiName:e.formatApiName,getAnnounceData:e.announceData?function(){return(t=e.announceData)?{defaultStrings:t.defaultStrings?v[t.defaultStrings]:void 0,formatStrings:t.formatStrings,text:t.text}:void 0;var t}:void 0,getEntityState:u?function(){return u}:void 0}};case"contextMenu":return{eventType:16,eventDataCache:e.eventDataCache,rawEvent:e.rawEvent,items:e.items};case"editImage":return{eventType:19,eventDataCache:e.eventDataCache,image:e.image,newSrc:e.newSrc,originalSrc:e.originalSrc,previousSrc:e.previousSrc};case"editorReady":return{eventType:11,eventDataCache:e.eventDataCache};case"enteredShadowEdit":var d=17==(null==t?void 0:t.eventType)?t:void 0;return{eventType:17,eventDataCache:e.eventDataCache,fragment:null!==(o=null==d?void 0:d.fragment)&&void 0!==o?o:document.createDocumentFragment(),selectionPath:null!==(r=null==d?void 0:d.selectionPath)&&void 0!==r?r:{end:[],start:[]}};case"entityOperation":return{eventType:15,eventDataCache:e.eventDataCache,rawEvent:e.rawEvent,entity:e.entity,operation:f[e.operation],shouldPersist:e.shouldPersist,state:e.state};case"extractContentWithDom":return{eventType:8,eventDataCache:e.eventDataCache,clonedRoot:e.clonedRoot};case"input":return{eventType:3,eventDataCache:e.eventDataCache,rawEvent:e.rawEvent};case"keyDown":case"keyPress":case"keyUp":return{eventType:"keyDown"==e.eventType?0:"keyPress"==e.eventType?1:2,eventDataCache:e.eventDataCache,rawEvent:e.rawEvent};case"leavingShadowEdit":return{eventType:18,eventDataCache:e.eventDataCache};case"mouseDown":return{eventType:5,eventDataCache:e.eventDataCache,rawEvent:e.rawEvent};case"mouseUp":return{eventType:6,eventDataCache:e.eventDataCache,rawEvent:e.rawEvent,isClicking:e.isClicking};case"scroll":return{eventType:14,eventDataCache:e.eventDataCache,rawEvent:e.rawEvent,scrollContainer:e.scrollContainer};case"selectionChanged":var p=22==(null==t?void 0:t.eventType)?t:void 0;return{eventType:22,eventDataCache:e.eventDataCache,selectionRangeEx:null!==(a=null==p?void 0:p.selectionRangeEx)&&void 0!==a?a:(0,l.convertDomSelectionToRangeEx)(e.newSelection)};case"zoomChanged":return{eventType:21,eventDataCache:e.eventDataCache,newZoomScale:e.newZoomScale,oldZoomScale:21==(null==t?void 0:t.eventType)?t.oldZoomScale:1};default:return}}},151:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.insertNode=void 0;var o=n(839);t.insertNode=function(e,t,n,r){var a,i;switch(r.position){case 0:case 1:var l,s=0==r.position,c=(0,o.getFirstLastBlockElement)(e,s);if(c){var u=s?c.getStartNode():c.getEndNode();r.insertOnNewLine||3==u.nodeType||(0,o.isVoidHtmlElement)(u)?(0,o.safeInstanceOf)(n,"DocumentFragment")?(l=(0,o.toArray)(n.childNodes),null===(a=u.parentNode)||void 0===a||a.insertBefore(n,s?u:u.nextSibling)):l=null===(i=u.parentNode)||void 0===i?void 0:i.insertBefore(n,s?u:u.nextSibling):l=u.insertBefore(n,s?u.firstChild:null)}else l=e.appendChild(n);if(l&&r.insertOnNewLine){var d=Array.isArray(l)?l:[l];(0,o.isBlockElement)(d[0])&&(0,o.isBlockElement)(d[d.length-1])||(0,o.wrap)(d)}break;case 2:var v=e.appendChild(n);v&&r.insertOnNewLine&&!(0,o.isBlockElement)(v)&&(0,o.wrap)(v);break;case 5:case 3:var p=function(e,t){var n="range"==(null==e?void 0:e.type)?e.range:null,o=null;return 5==t.position?(o=n,n=t.range):n&&(o=n.cloneRange()),{range:n,rangeToRestore:o}}(t,r),f=p.range,g=p.rangeToRestore;if(!f)break;r.replaceSelection&&!f.collapsed&&f.deleteContents();var y=o.Position.getStart(f),h=void 0;y=r.insertOnNewLine&&r.insertToRegionRoot?function(e,t,n){var r=(0,o.getRegionsFromRange)(e,t,0)[0],a=n.node;if(r){if(3!=a.nodeType||n.isAtEnd||(a=(0,o.splitTextNode)(a,n.offset,!0)),a!=r.rootNode)for(;a&&a.parentNode!=r.rootNode;)(0,o.splitParentNode)(a,!1),a=a.parentNode;a&&(n=new o.Position(a,-3))}return n}(e,f,y):r.insertOnNewLine&&(h=(0,o.getBlockElementAtNode)(e,y.normalize().node))?function(e,t,n){var r=new o.Position(e.getEndNode(),-3);if((0,o.safeInstanceOf)(r.node,"HTMLTableRowElement")){var a=t.ownerDocument.createElement("div");(0,o.createRange)(n).insertNode(a),r=new o.Position(a,0)}return r}(h,e,y):(0,o.adjustInsertPosition)(e,n,y,f);var m=11==n.nodeType?n.lastChild:n;return(f=(0,o.createRange)(y)).insertNode(n),r.updateCursor&&m&&(g=(0,o.createRange)(new o.Position(m,-3).normalize())),g?{type:"range",range:g,isReverted:!1}:void 0}}},54:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.convertDomSelectionToRangeEx=t.convertRangeExToDomSelection=void 0;var o=n(839),r=n(993);t.convertRangeExToDomSelection=function(e){switch(null==e?void 0:e.type){case 2:return{type:"image",image:e.image};case 0:return e.ranges.length>0?{type:"range",range:e.ranges[0],isReverted:!1}:null;case 1:return e.coordinates?{type:"table",table:e.table,firstColumn:e.coordinates.firstCell.x,firstRow:e.coordinates.firstCell.y,lastColumn:e.coordinates.lastCell.x,lastRow:e.coordinates.lastCell.y}:null;default:return null}},t.convertDomSelectionToRangeEx=function(e){switch(null==e?void 0:e.type){case"image":return{type:2,image:e.image,areAllCollapsed:!1,ranges:[(0,o.createRange)(e.image)]};case"range":return{type:0,ranges:[e.range],areAllCollapsed:e.range.collapsed};case"table":return{type:1,ranges:(0,r.createTableRanges)(e),areAllCollapsed:!1,table:e.table,coordinates:{firstCell:{x:e.firstColumn,y:e.firstRow},lastCell:{x:e.lastColumn,y:e.lastRow}}};default:return{type:0,ranges:[],areAllCollapsed:!0}}}},839:e=>{e.exports=t},993:t=>{t.exports=e},582:(e,t,n)=>{n.r(t),n.d(t,{__assign:()=>a,__asyncDelegator:()=>_,__asyncGenerator:()=>b,__asyncValues:()=>S,__await:()=>T,__awaiter:()=>f,__classPrivateFieldGet:()=>R,__classPrivateFieldIn:()=>N,__classPrivateFieldSet:()=>k,__createBinding:()=>y,__decorate:()=>l,__esDecorate:()=>c,__exportStar:()=>h,__extends:()=>r,__generator:()=>g,__importDefault:()=>x,__importStar:()=>M,__makeTemplateObject:()=>O,__metadata:()=>p,__param:()=>s,__propKey:()=>d,__read:()=>C,__rest:()=>i,__runInitializers:()=>u,__setFunctionName:()=>v,__spread:()=>E,__spreadArray:()=>D,__spreadArrays:()=>w,__values:()=>m,default:()=>A});var o=function(e,t){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},o(e,t)};function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var a=function(){return a=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},a.apply(this,arguments)};function i(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]])}return n}function l(e,t,n,o){var r,a=arguments.length,i=a<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,n,o);else for(var l=e.length-1;l>=0;l--)(r=e[l])&&(i=(a<3?r(i):a>3?r(t,n,i):r(t,n))||i);return a>3&&i&&Object.defineProperty(t,n,i),i}function s(e,t){return function(n,o){t(n,o,e)}}function c(e,t,n,o,r,a){function i(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var l,s=o.kind,c="getter"===s?"get":"setter"===s?"set":"value",u=!t&&e?o.static?e:e.prototype:null,d=t||(u?Object.getOwnPropertyDescriptor(u,o.name):{}),v=!1,p=n.length-1;p>=0;p--){var f={};for(var g in o)f[g]="access"===g?{}:o[g];for(var g in o.access)f.access[g]=o.access[g];f.addInitializer=function(e){if(v)throw new TypeError("Cannot add initializers after decoration has completed");a.push(i(e||null))};var y=(0,n[p])("accessor"===s?{get:d.get,set:d.set}:d[c],f);if("accessor"===s){if(void 0===y)continue;if(null===y||"object"!=typeof y)throw new TypeError("Object expected");(l=i(y.get))&&(d.get=l),(l=i(y.set))&&(d.set=l),(l=i(y.init))&&r.unshift(l)}else(l=i(y))&&("field"===s?r.unshift(l):d[c]=l)}u&&Object.defineProperty(u,o.name,d),v=!0}function u(e,t,n){for(var o=arguments.length>2,r=0;r<t.length;r++)n=o?t[r].call(e,n):t[r].call(e);return o?n:void 0}function d(e){return"symbol"==typeof e?e:"".concat(e)}function v(e,t,n){return"symbol"==typeof t&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:n?"".concat(n," ",t):t})}function p(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function f(e,t,n,o){return new(n||(n=Promise))((function(r,a){function i(e){try{s(o.next(e))}catch(e){a(e)}}function l(e){try{s(o.throw(e))}catch(e){a(e)}}function s(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(i,l)}s((o=o.apply(e,t||[])).next())}))}function g(e,t){var n,o,r,a,i={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return a={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function l(l){return function(s){return function(l){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,l[0]&&(i=0)),i;)try{if(n=1,o&&(r=2&l[0]?o.return:l[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,l[1])).done)return r;switch(o=0,r&&(l=[2&l[0],r.value]),l[0]){case 0:case 1:r=l;break;case 4:return i.label++,{value:l[1],done:!1};case 5:i.label++,o=l[1],l=[0];continue;case 7:l=i.ops.pop(),i.trys.pop();continue;default:if(!((r=(r=i.trys).length>0&&r[r.length-1])||6!==l[0]&&2!==l[0])){i=0;continue}if(3===l[0]&&(!r||l[1]>r[0]&&l[1]<r[3])){i.label=l[1];break}if(6===l[0]&&i.label<r[1]){i.label=r[1],r=l;break}if(r&&i.label<r[2]){i.label=r[2],i.ops.push(l);break}r[2]&&i.ops.pop(),i.trys.pop();continue}l=t.call(e,i)}catch(e){l=[6,e],o=0}finally{n=r=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}([l,s])}}}var y=Object.create?function(e,t,n,o){void 0===o&&(o=n);var r=Object.getOwnPropertyDescriptor(t,n);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,r)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]};function h(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||y(t,e,n)}function m(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],o=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&o>=e.length&&(e=void 0),{value:e&&e[o++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function C(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var o,r,a=n.call(e),i=[];try{for(;(void 0===t||t-- >0)&&!(o=a.next()).done;)i.push(o.value)}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=a.return)&&n.call(a)}finally{if(r)throw r.error}}return i}function E(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(C(arguments[t]));return e}function w(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var o=Array(e),r=0;for(t=0;t<n;t++)for(var a=arguments[t],i=0,l=a.length;i<l;i++,r++)o[r]=a[i];return o}function D(e,t,n){if(n||2===arguments.length)for(var o,r=0,a=t.length;r<a;r++)!o&&r in t||(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))}function T(e){return this instanceof T?(this.v=e,this):new T(e)}function b(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var o,r=n.apply(e,t||[]),a=[];return o={},i("next"),i("throw"),i("return"),o[Symbol.asyncIterator]=function(){return this},o;function i(e){r[e]&&(o[e]=function(t){return new Promise((function(n,o){a.push([e,t,n,o])>1||l(e,t)}))})}function l(e,t){try{(n=r[e](t)).value instanceof T?Promise.resolve(n.value.v).then(s,c):u(a[0][2],n)}catch(e){u(a[0][3],e)}var n}function s(e){l("next",e)}function c(e){l("throw",e)}function u(e,t){e(t),a.shift(),a.length&&l(a[0][0],a[0][1])}}function _(e){var t,n;return t={},o("next"),o("throw",(function(e){throw e})),o("return"),t[Symbol.iterator]=function(){return this},t;function o(o,r){t[o]=e[o]?function(t){return(n=!n)?{value:T(e[o](t)),done:!1}:r?r(t):t}:r}}function S(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e=m(e),t={},o("next"),o("throw"),o("return"),t[Symbol.asyncIterator]=function(){return this},t);function o(n){t[n]=e[n]&&function(t){return new Promise((function(o,r){!function(e,t,n,o){Promise.resolve(o).then((function(t){e({value:t,done:n})}),t)}(o,r,(t=e[n](t)).done,t.value)}))}}}function O(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}var P=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t};function M(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&y(t,e,n);return P(t,e),t}function x(e){return e&&e.__esModule?e:{default:e}}function R(e,t,n,o){if("a"===n&&!o)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?o:"a"===n?o.call(e):o?o.value:t.get(e)}function k(e,t,n,o,r){if("m"===o)throw new TypeError("Private method is not writable");if("a"===o&&!r)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===o?r.call(e,n):r?r.value=n:t.set(e,n),n}function N(e,t){if(null===t||"object"!=typeof t&&"function"!=typeof t)throw new TypeError("Cannot use 'in' operator on non-object");return"function"==typeof e?t===e:e.has(t)}const A={__extends:r,__assign:a,__rest:i,__decorate:l,__param:s,__metadata:p,__awaiter:f,__generator:g,__createBinding:y,__exportStar:h,__values:m,__read:C,__spread:E,__spreadArrays:w,__spreadArray:D,__await:T,__asyncGenerator:b,__asyncDelegator:_,__asyncValues:S,__makeTemplateObject:O,__importStar:M,__importDefault:x,__classPrivateFieldGet:R,__classPrivateFieldSet:k,__classPrivateFieldIn:N}}},o={};function r(e){var t=o[e];if(void 0!==t)return t.exports;var a=o[e]={exports:{}};return n[e](a,a.exports,r),a.exports}r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var a={};return(()=>{var e=a;Object.defineProperty(e,"__esModule",{value:!0}),e.EditorAdapter=void 0;var t=r(279);Object.defineProperty(e,"EditorAdapter",{enumerable:!0,get:function(){return t.EditorAdapter}})})(),a})()));
|
|
2
|
+
//# sourceMappingURL=rooster-adapter-amd-min.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rooster-adapter-amd-min.js","mappings":"yMAAA,SACA,SACA,SACA,SAyDA,aAMI,WACYA,EACRC,EACQC,QADR,IAAAD,IAAAA,EAAA,SACQ,IAAAC,IAAAA,EAAA,IAFA,KAAAF,aAAAA,EAEA,KAAAE,qBAAAA,EAER,IAAMC,GAAa,IAAAC,oBAEnBC,KAAKJ,eAAgB,EAAH,kBAAIE,IAAU,YAAKF,EAAcK,QAAO,SAAAC,GAAK,QAAEA,CAAF,MAAI,GACnEF,KAAKG,KAAOL,EAAWM,WACvBJ,KAAKK,qBAAuBL,KAAKJ,cAAcK,OAAOK,GACtDN,KAAKO,yBAA2BP,KAAKJ,cAAcY,MAC/C,SAAAC,GAAU,OAAAA,EAAOC,0BAAP,GAElB,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3f,MAAO,WAE7DjG,OAAOye,eAAepC,EAAS,aAAc,CAAEpW,OAAO,GAAO,E,qGCF9D,aAAS,+EAAA0O,aAAa,G","sources":["webpack://roosterjs/./packages/roosterjs-editor-adapter/lib/corePlugins/BridgePlugin.ts","webpack://roosterjs/./packages/roosterjs-editor-adapter/lib/corePlugins/EditPlugin.ts","webpack://roosterjs/./packages/roosterjs-editor-adapter/lib/editor/DarkColorHandlerImpl.ts","webpack://roosterjs/./packages/roosterjs-editor-adapter/lib/editor/EditorAdapter.ts","webpack://roosterjs/./packages/roosterjs-editor-adapter/lib/editor/utils/buildRangeEx.ts","webpack://roosterjs/./packages/roosterjs-editor-adapter/lib/editor/utils/eventConverter.ts","webpack://roosterjs/./packages/roosterjs-editor-adapter/lib/editor/utils/insertNode.ts","webpack://roosterjs/./packages/roosterjs-editor-adapter/lib/editor/utils/selectionConverter.ts","webpack://roosterjs/external amd \"roosterjs\"","webpack://roosterjs/external amd \"roosterjsContentModel\"","webpack://roosterjs/./node_modules/tslib/tslib.es6.mjs","webpack://roosterjs/webpack/bootstrap","webpack://roosterjs/webpack/runtime/define property getters","webpack://roosterjs/webpack/runtime/hasOwnProperty shorthand","webpack://roosterjs/webpack/runtime/make namespace object","webpack://roosterjs/./packages/roosterjs-editor-adapter/lib/index.ts"],"sourcesContent":["import { cacheGetEventData } from 'roosterjs-content-model-core';\nimport { createDarkColorHandler } from '../editor/DarkColorHandlerImpl';\nimport { createEditPlugin } from './EditPlugin';\nimport { newEventToOldEvent, oldEventToNewEvent } from '../editor/utils/eventConverter';\nimport type {\n EditorPlugin as LegacyEditorPlugin,\n ContextMenuProvider as LegacyContextMenuProvider,\n IEditor as ILegacyEditor,\n ExperimentalFeatures,\n SizeTransformer,\n EditPluginState,\n CustomData,\n DarkColorHandler,\n} from 'roosterjs-editor-types';\nimport type { ContextMenuProvider, IEditor, PluginEvent } from 'roosterjs-content-model-types';\n\nconst ExclusivelyHandleEventPluginKey = '__ExclusivelyHandleEventPlugin';\nconst OldEventKey = '__OldEventFromNewEvent';\n\n/**\n * @internal\n * Represents the core data structure of a editor adapter\n */\nexport interface EditorAdapterCore {\n /**\n * Custom data of this editor\n */\n readonly customData: Record<string, CustomData>;\n\n /**\n * Enabled experimental features\n */\n readonly experimentalFeatures: ExperimentalFeatures[];\n\n /**\n * Dark model handler for the editor, used for variable-based solution.\n * If keep it null, editor will still use original dataset-based dark mode solution.\n */\n readonly darkColorHandler: DarkColorHandler;\n\n /**\n * Plugin state of EditPlugin\n */\n readonly edit: EditPluginState;\n\n /**\n * Context Menu providers\n */\n readonly contextMenuProviders: LegacyContextMenuProvider<any>[];\n\n /**\n * @deprecated Use zoomScale instead\n */\n readonly sizeTransformer: SizeTransformer;\n}\n\n/**\n * @internal\n * Act as a bridge between Standalone editor and Content Model editor, translate Standalone editor event type to legacy event type\n */\nexport class BridgePlugin implements ContextMenuProvider<any> {\n private legacyPlugins: LegacyEditorPlugin[];\n private edit: EditPluginState;\n private contextMenuProviders: LegacyContextMenuProvider<any>[];\n private checkExclusivelyHandling: boolean;\n\n constructor(\n private onInitialize: (core: EditorAdapterCore) => ILegacyEditor,\n legacyPlugins: LegacyEditorPlugin[] = [],\n private experimentalFeatures: ExperimentalFeatures[] = []\n ) {\n const editPlugin = createEditPlugin();\n\n this.legacyPlugins = [editPlugin, ...legacyPlugins.filter(x => !!x)];\n this.edit = editPlugin.getState();\n this.contextMenuProviders = this.legacyPlugins.filter(isContextMenuProvider);\n this.checkExclusivelyHandling = this.legacyPlugins.some(\n plugin => plugin.willHandleEventExclusively\n );\n }\n\n /**\n * Get a friendly name of this plugin\n */\n getName() {\n return 'Bridge';\n }\n\n /**\n * Initialize this plugin. This should only be called from Editor\n * @param editor Editor instance\n */\n initialize(editor: IEditor) {\n const outerEditor = this.onInitialize(this.createEditorCore(editor));\n\n this.legacyPlugins.forEach(plugin => plugin.initialize(outerEditor));\n }\n\n /**\n * Dispose this plugin\n */\n dispose() {\n for (let i = this.legacyPlugins.length - 1; i >= 0; i--) {\n const plugin = this.legacyPlugins[i];\n\n plugin.dispose();\n }\n }\n\n willHandleEventExclusively(event: PluginEvent) {\n return this.checkExclusivelyHandling && !!this.cacheGetExclusivelyHandlePlugin(event);\n }\n\n onPluginEvent(event: PluginEvent) {\n const oldEvent = this.cacheGetOldEvent(event);\n\n if (oldEvent) {\n const exclusivelyHandleEventPlugin = this.cacheGetExclusivelyHandlePlugin(event);\n\n if (exclusivelyHandleEventPlugin) {\n exclusivelyHandleEventPlugin.onPluginEvent?.(oldEvent);\n } else {\n this.legacyPlugins.forEach(plugin => plugin.onPluginEvent?.(oldEvent));\n }\n\n Object.assign(event, oldEventToNewEvent(oldEvent, event));\n }\n }\n\n /**\n * A callback to return context menu items\n * @param target Target node that triggered a ContextMenu event\n * @returns An array of context menu items, or null means no items needed\n */\n getContextMenuItems(target: Node): any[] {\n const allItems: any[] = [];\n\n this.contextMenuProviders.forEach(provider => {\n const items = provider.getContextMenuItems(target) ?? [];\n if (items?.length > 0) {\n if (allItems.length > 0) {\n allItems.push(null);\n }\n\n allItems.push(...items);\n }\n });\n\n return allItems;\n }\n\n private cacheGetExclusivelyHandlePlugin(event: PluginEvent) {\n return cacheGetEventData(event, ExclusivelyHandleEventPluginKey, event => {\n const oldEvent = this.cacheGetOldEvent(event);\n\n if (oldEvent) {\n for (let i = 0; i < this.legacyPlugins.length; i++) {\n const plugin = this.legacyPlugins[i];\n\n if (plugin.willHandleEventExclusively?.(oldEvent)) {\n return plugin;\n }\n }\n }\n\n return null;\n });\n }\n\n private cacheGetOldEvent(event: PluginEvent) {\n return cacheGetEventData(event, OldEventKey, newEventToOldEvent);\n }\n\n private createEditorCore(editor: IEditor): EditorAdapterCore {\n return {\n customData: {},\n experimentalFeatures: this.experimentalFeatures ?? [],\n sizeTransformer: createSizeTransformer(editor),\n darkColorHandler: createDarkColorHandler(editor.getColorManager()),\n edit: this.edit,\n contextMenuProviders: this.contextMenuProviders,\n };\n }\n}\n\n/**\n * @internal Export for test only. This function is only used for compatibility from older build\n\n */\nexport function createSizeTransformer(editor: IEditor): SizeTransformer {\n return size => size / editor.getDOMHelper().calculateZoomScale();\n}\n\nfunction isContextMenuProvider(\n source: LegacyEditorPlugin\n): source is LegacyContextMenuProvider<any> {\n return !!(<LegacyContextMenuProvider<any>>source)?.getContextMenuItems;\n}\n","import { isCtrlOrMetaPressed } from 'roosterjs-editor-dom';\nimport { Keys, PluginEventType } from 'roosterjs-editor-types';\nimport type {\n EditPluginState,\n GenericContentEditFeature,\n IEditor,\n PluginEvent,\n PluginWithState,\n} from 'roosterjs-editor-types';\n\n/**\n * Edit Component helps handle Content edit features\n */\nclass EditPlugin implements PluginWithState<EditPluginState> {\n private editor: IEditor | null = null;\n private state: EditPluginState;\n\n /**\n * Construct a new instance of EditPlugin\n * @param options The editor options\n */\n constructor() {\n this.state = {\n features: {},\n };\n }\n\n /**\n * Get a friendly name of this plugin\n */\n getName() {\n return 'Edit';\n }\n\n /**\n * Initialize this plugin. This should only be called from Editor\n * @param editor Editor instance\n */\n initialize(editor: IEditor) {\n this.editor = editor;\n }\n\n /**\n * Dispose this plugin\n */\n dispose() {\n this.editor = null;\n }\n\n /**\n * Get plugin state object\n */\n getState() {\n return this.state;\n }\n\n /**\n * Handle events triggered from editor\n * @param event PluginEvent object\n */\n onPluginEvent(event: PluginEvent) {\n let hasFunctionKey = false;\n let features: GenericContentEditFeature<PluginEvent>[] | null = null;\n let ctrlOrMeta = false;\n const isKeyDownEvent = event.eventType == PluginEventType.KeyDown;\n\n if (isKeyDownEvent) {\n const rawEvent = event.rawEvent;\n const range = this.editor?.getSelectionRange();\n\n ctrlOrMeta = isCtrlOrMetaPressed(rawEvent);\n hasFunctionKey = ctrlOrMeta || rawEvent.altKey;\n features =\n this.state.features[rawEvent.which] ||\n (range && !range.collapsed && this.state.features[Keys.RANGE]);\n } else if (event.eventType == PluginEventType.ContentChanged) {\n features = this.state.features[Keys.CONTENTCHANGED];\n }\n\n for (let i = 0; features && i < features?.length; i++) {\n const feature = features[i];\n if (\n (feature.allowFunctionKeys || !hasFunctionKey) &&\n this.editor &&\n feature.shouldHandleEvent(event, this.editor, ctrlOrMeta)\n ) {\n feature.handleEvent(event, this.editor);\n if (isKeyDownEvent) {\n event.handledByEditFeature = true;\n }\n break;\n }\n }\n }\n}\n\n/**\n * @internal\n * Create a new instance of EditPlugin.\n */\nexport function createEditPlugin(): PluginWithState<EditPluginState> {\n return new EditPlugin();\n}\n","import { getColor, getObjectKeys, parseColor, setColor } from 'roosterjs-content-model-dom';\nimport type { ColorKeyAndValue, DarkColorHandler } from 'roosterjs-editor-types';\nimport type { DarkColorHandler as StandaloneDarkColorHandler } from 'roosterjs-content-model-types';\n\nconst VARIABLE_REGEX = /^\\s*var\\(\\s*(\\-\\-[a-zA-Z0-9\\-_]+)\\s*(?:,\\s*(.*))?\\)\\s*$/;\nconst VARIABLE_PREFIX = 'var(';\nconst COLOR_VAR_PREFIX = 'darkColor';\n\nclass DarkColorHandlerImpl implements DarkColorHandler {\n constructor(private innerHandler: StandaloneDarkColorHandler) {}\n\n /**\n * Get a copy of known colors\n * @returns\n */\n getKnownColorsCopy() {\n return Object.values(this.innerHandler.knownColors);\n }\n\n /**\n * Given a light mode color value and an optional dark mode color value, register this color\n * so that editor can handle it, then return the CSS color value for current color mode.\n * @param lightModeColor Light mode color value\n * @param isDarkMode Whether current color mode is dark mode\n * @param darkModeColor Optional dark mode color value. If not passed, we will calculate one.\n */\n registerColor(lightModeColor: string, isDarkMode: boolean, darkModeColor?: string): string {\n const parsedColor = this.parseColorValue(lightModeColor);\n let colorKey: string | undefined;\n\n if (parsedColor) {\n lightModeColor = parsedColor.lightModeColor;\n darkModeColor = parsedColor.darkModeColor || darkModeColor;\n colorKey = parsedColor.key;\n }\n\n if (isDarkMode && lightModeColor) {\n colorKey =\n colorKey || `--${COLOR_VAR_PREFIX}_${lightModeColor.replace(/[^\\d\\w]/g, '_')}`;\n\n this.innerHandler.updateKnownColor(isDarkMode, colorKey, {\n lightModeColor,\n darkModeColor: darkModeColor || this.innerHandler.getDarkColor(lightModeColor),\n });\n\n return `var(${colorKey}, ${lightModeColor})`;\n } else {\n return lightModeColor;\n }\n }\n\n /**\n * Reset known color record, clean up registered color variables.\n */\n reset(): void {\n this.innerHandler.reset();\n }\n\n /**\n * Parse an existing color value, if it is in variable-based color format, extract color key,\n * light color and query related dark color if any\n * @param color The color string to parse\n * @param isInDarkMode Whether current content is in dark mode. When set to true, if the color value is not in dark var format,\n * we will treat is as a dark mode color and try to find a matched dark mode color.\n */\n parseColorValue(color: string | undefined | null, isInDarkMode?: boolean): ColorKeyAndValue {\n let key: string | undefined;\n let lightModeColor = '';\n let darkModeColor: string | undefined;\n\n if (color) {\n const match = color.startsWith(VARIABLE_PREFIX) ? VARIABLE_REGEX.exec(color) : null;\n\n if (match) {\n if (match[2]) {\n key = match[1];\n lightModeColor = match[2];\n darkModeColor = this.innerHandler.knownColors[key]?.darkModeColor;\n } else {\n lightModeColor = '';\n }\n } else if (isInDarkMode) {\n // If editor is in dark mode but the color is not in dark color format, it is possible the color was inserted from external code\n // without any light color info. So we first try to see if there is a known dark color can match this color, and use its related\n // light color as light mode color. Otherwise we need to drop this color to avoid show \"white on white\" content.\n lightModeColor = this.findLightColorFromDarkColor(color) || '';\n\n if (lightModeColor) {\n darkModeColor = color;\n }\n } else {\n lightModeColor = color;\n }\n }\n\n return { key, lightModeColor, darkModeColor };\n }\n\n /**\n * Find related light mode color from dark mode color.\n * @param darkColor The existing dark color\n */\n findLightColorFromDarkColor(darkColor: string): string | null {\n const rgbSearch = parseColor(darkColor);\n const knownColors = this.innerHandler.knownColors;\n\n if (rgbSearch) {\n const key = getObjectKeys(knownColors).find(key => {\n const rgbCurrent = parseColor(knownColors[key].darkModeColor);\n\n return (\n rgbCurrent &&\n rgbCurrent[0] == rgbSearch[0] &&\n rgbCurrent[1] == rgbSearch[1] &&\n rgbCurrent[2] == rgbSearch[2]\n );\n });\n\n if (key) {\n return knownColors[key].lightModeColor;\n }\n }\n\n return null;\n }\n\n /**\n * Transform element color, from dark to light or from light to dark\n * @param element The element to transform color\n * @param fromDarkMode Whether this is transforming color from dark mode\n * @param toDarkMode Whether this is transforming color to dark mode\n */\n transformElementColor(element: HTMLElement, fromDarkMode: boolean, toDarkMode: boolean): void {\n const textColor = getColor(element, false /*isBackground*/, !toDarkMode, this.innerHandler);\n const backColor = getColor(element, true /*isBackground*/, !toDarkMode, this.innerHandler);\n\n setColor(element, textColor, false /*isBackground*/, toDarkMode, this.innerHandler);\n setColor(element, backColor, true /*isBackground*/, toDarkMode, this.innerHandler);\n }\n}\n\n/**\n * @internal\n */\nexport function createDarkColorHandler(innerHandler: StandaloneDarkColorHandler): DarkColorHandler {\n return new DarkColorHandlerImpl(innerHandler);\n}\n","import { BridgePlugin } from '../corePlugins/BridgePlugin';\nimport { buildRangeEx } from './utils/buildRangeEx';\nimport { getObjectKeys } from 'roosterjs-content-model-dom';\nimport { insertNode } from './utils/insertNode';\nimport type { EditorAdapterCore } from '../corePlugins/BridgePlugin';\nimport {\n newEventToOldEvent,\n oldEventToNewEvent,\n OldEventTypeToNewEventType,\n} from './utils/eventConverter';\nimport {\n createModelFromHtml,\n exportContent,\n isBold,\n redo,\n retrieveModelFormatState,\n Editor,\n transformColor,\n undo,\n paste,\n} from 'roosterjs-content-model-core';\nimport {\n ChangeSource,\n ColorTransformDirection,\n ContentPosition,\n GetContentMode,\n PluginEventType,\n QueryScope,\n RegionType,\n} from 'roosterjs-editor-types';\nimport type {\n BlockElement,\n ClipboardData,\n ContentChangedData,\n ContentChangedEvent,\n DOMEventHandler,\n DefaultFormat,\n EditorUndoState,\n ExperimentalFeatures,\n GenericContentEditFeature,\n IContentTraverser,\n IPositionContentSearcher,\n InsertOption,\n NodePosition,\n PendableFormatState,\n PluginEvent,\n PluginEventData,\n PluginEventFromType,\n PositionType,\n Region,\n SelectionPath,\n SelectionRangeEx,\n SizeTransformer,\n StyleBasedFormatState,\n TableSelection,\n DOMEventHandlerObject,\n DarkColorHandler,\n IEditor as ILegacyEditor,\n} from 'roosterjs-editor-types';\nimport {\n convertDomSelectionToRangeEx,\n convertRangeExToDomSelection,\n} from './utils/selectionConverter';\nimport type {\n CompatibleChangeSource,\n CompatibleColorTransformDirection,\n CompatibleContentPosition,\n CompatibleExperimentalFeatures,\n CompatibleGetContentMode,\n CompatiblePluginEventType,\n CompatibleQueryScope,\n CompatibleRegionType,\n} from 'roosterjs-editor-types/lib/compatibleTypes';\nimport {\n ContentTraverser,\n Position,\n PositionContentSearcher,\n cacheGetEventData,\n collapseNodes,\n contains,\n deleteSelectedContent,\n getBlockElementAtNode,\n getRegionsFromRange,\n getSelectionPath,\n isNodeEmpty,\n isPositionAtBeginningOf,\n queryElements,\n toArray,\n wrap,\n} from 'roosterjs-editor-dom';\nimport type { EditorAdapterOptions } from '../publicTypes/EditorAdapterOptions';\nimport type {\n ContentModelFormatState,\n DOMEventRecord,\n ExportContentMode,\n IEditor,\n EditorOptions,\n} from 'roosterjs-content-model-types';\n\nconst GetContentModeMap: Record<GetContentMode, ExportContentMode> = {\n [GetContentMode.CleanHTML]: 'HTML',\n [GetContentMode.PlainText]: 'PlainText',\n [GetContentMode.PlainTextFast]: 'PlainTextFast',\n [GetContentMode.RawHTMLOnly]: 'HTML',\n [GetContentMode.RawHTMLWithSelection]: 'HTML',\n};\n\n/**\n * Editor for Content Model.\n * (This class is still under development, and may still be changed in the future with some breaking changes)\n */\nexport class EditorAdapter extends Editor implements ILegacyEditor {\n private contentModelEditorCore: EditorAdapterCore | undefined;\n\n /**\n * Creates an instance of Editor\n * @param contentDiv The DIV HTML element which will be the container element of editor\n * @param options An optional options object to customize the editor\n */\n constructor(contentDiv: HTMLDivElement, options: EditorAdapterOptions = {}) {\n const bridgePlugin = new BridgePlugin(\n core => {\n this.contentModelEditorCore = core;\n\n return this;\n },\n options.legacyPlugins,\n options.experimentalFeatures\n );\n\n const plugins = [bridgePlugin, ...(options.plugins ?? [])];\n const initContent = options.initialContent ?? contentDiv.innerHTML;\n const initialModel =\n initContent && !options.initialModel\n ? createModelFromHtml(\n initContent,\n options.defaultDomToModelOptions,\n options.trustedHTMLHandler,\n options.defaultSegmentFormat\n )\n : options.initialModel;\n const standaloneEditorOptions: EditorOptions = {\n ...options,\n plugins,\n initialModel,\n };\n\n super(contentDiv, standaloneEditorOptions);\n }\n\n /**\n * Dispose this editor, dispose all plugins and custom data\n */\n dispose(): void {\n super.dispose();\n\n const core = this.contentModelEditorCore;\n\n if (core) {\n getObjectKeys(core.customData).forEach(key => {\n const data = core.customData[key];\n\n if (data && data.disposer) {\n data.disposer(data.value);\n }\n\n delete core.customData[key];\n });\n\n this.contentModelEditorCore = undefined;\n }\n }\n\n /**\n * Get whether this editor is disposed\n * @returns True if editor is disposed, otherwise false\n */\n isDisposed(): boolean {\n return super.isDisposed() || !this.contentModelEditorCore;\n }\n\n /**\n * Insert node into editor\n * @param node The node to insert\n * @param option Insert options. Default value is:\n * position: ContentPosition.SelectionStart\n * updateCursor: true\n * replaceSelection: true\n * insertOnNewLine: false\n * @returns true if node is inserted. Otherwise false\n */\n insertNode(node: Node, option?: InsertOption): boolean {\n if (node) {\n option = option || {\n position: ContentPosition.SelectionStart,\n insertOnNewLine: false,\n updateCursor: true,\n replaceSelection: true,\n insertToRegionRoot: false,\n };\n\n const { physicalRoot } = this.getCore();\n\n if (option.updateCursor) {\n this.focus();\n }\n\n if (option.position == ContentPosition.Outside) {\n physicalRoot.parentNode?.insertBefore(node, physicalRoot.nextSibling);\n } else {\n if (this.isDarkMode()) {\n transformColor(\n node,\n true /*includeSelf*/,\n 'lightToDark',\n this.getColorManager()\n );\n }\n\n const selection = insertNode(physicalRoot, this.getDOMSelection(), node, option);\n\n if (selection && option.updateCursor) {\n this.setDOMSelection(selection);\n }\n }\n\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * Delete a node from editor content\n * @param node The node to delete\n * @returns true if node is deleted. Otherwise false\n */\n deleteNode(node: Node): boolean {\n // Only remove the node when it falls within editor\n if (node && this.contains(node) && node.parentNode) {\n node.parentNode.removeChild(node);\n return true;\n }\n\n return false;\n }\n\n /**\n * Replace a node in editor content with another node\n * @param existingNode The existing node to be replaced\n * @param toNode node to replace to\n * @param transformColorForDarkMode (optional) Whether to transform new node to dark mode. Default is false\n * @returns true if node is replaced. Otherwise false\n */\n replaceNode(existingNode: Node, toNode: Node, transformColorForDarkMode?: boolean): boolean {\n const core = this.getCore();\n // Only replace the node when it falls within editor\n if (this.contains(existingNode) && toNode) {\n if (core.lifecycle.isDarkMode && transformColorForDarkMode) {\n this.transformToDarkColor(toNode, ColorTransformDirection.LightToDark);\n }\n\n existingNode.parentNode?.replaceChild(toNode, existingNode);\n\n return true;\n }\n\n return false;\n }\n\n /**\n * Get BlockElement at given node\n * @param node The node to create InlineElement\n * @returns The BlockElement result\n */\n getBlockElementAtNode(node: Node): BlockElement | null {\n return getBlockElementAtNode(this.getCore().logicalRoot, node);\n }\n\n contains(arg: Node | Range | null): boolean {\n if (!arg) {\n return false;\n }\n return contains(this.getCore().logicalRoot, <Node>arg);\n }\n\n queryElements(\n selector: string,\n scopeOrCallback:\n | QueryScope\n | CompatibleQueryScope\n | ((node: Node) => any) = QueryScope.Body,\n callback?: (node: Node) => any\n ) {\n const core = this.getCore();\n const result: HTMLElement[] = [];\n const scope = scopeOrCallback instanceof Function ? QueryScope.Body : scopeOrCallback;\n callback = scopeOrCallback instanceof Function ? scopeOrCallback : callback;\n\n const selectionEx = scope == QueryScope.Body ? null : this.getSelectionRangeEx();\n if (selectionEx) {\n selectionEx.ranges.forEach(range => {\n result.push(...queryElements(core.logicalRoot, selector, callback, scope, range));\n });\n } else {\n return queryElements(\n core.logicalRoot,\n selector,\n callback,\n scope,\n undefined /* range */\n );\n }\n\n return result;\n }\n\n /**\n * Collapse nodes within the given start and end nodes to their common ancestor node,\n * split parent nodes if necessary\n * @param start The start node\n * @param end The end node\n * @param canSplitParent True to allow split parent node there are nodes before start or after end under the same parent\n * and the returned nodes will be all nodes from start through end after splitting\n * False to disallow split parent\n * @returns When canSplitParent is true, returns all node from start through end after splitting,\n * otherwise just return start and end\n */\n collapseNodes(start: Node, end: Node, canSplitParent: boolean): Node[] {\n return collapseNodes(this.getCore().physicalRoot, start, end, canSplitParent);\n }\n\n //#endregion\n\n //#region Content API\n\n /**\n * Check whether the editor contains any visible content\n * @param trim Whether trim the content string before check. Default is false\n * @returns True if there's no visible content, otherwise false\n */\n isEmpty(trim?: boolean): boolean {\n return isNodeEmpty(this.getCore().physicalRoot, trim);\n }\n\n /**\n * Get current editor content as HTML string\n * @param mode specify what kind of HTML content to retrieve\n * @returns HTML string representing current editor content\n */\n getContent(mode: GetContentMode | CompatibleGetContentMode = GetContentMode.CleanHTML): string {\n return exportContent(\n this,\n GetContentModeMap[mode],\n this.getCore().environment.modelToDomSettings.customized\n );\n }\n\n /**\n * Set HTML content to this editor. All existing content will be replaced. A ContentChanged event will be triggered\n * @param content HTML content to set in\n * @param triggerContentChangedEvent True to trigger a ContentChanged event. Default value is true\n */\n setContent(content: string, triggerContentChangedEvent: boolean = true) {\n const core = this.getCore();\n const { physicalRoot, api, trustedHTMLHandler, lifecycle, darkColorHandler } = core;\n\n api.triggerEvent(\n core,\n {\n eventType: 'beforeSetContent',\n newContent: content,\n },\n true /*broadcast*/\n );\n\n const newModel = createModelFromHtml(\n content,\n core.environment.domToModelSettings.customized,\n trustedHTMLHandler,\n core.format.defaultFormat\n );\n\n api.setContentModel(core, newModel);\n\n if (triggerContentChangedEvent) {\n api.triggerEvent(\n core,\n {\n eventType: 'contentChanged',\n source: ChangeSource.SetContent,\n },\n false /*broadcast*/\n );\n } else if (lifecycle.isDarkMode) {\n transformColor(physicalRoot, false /*includeSelf*/, 'lightToDark', darkColorHandler);\n }\n }\n\n /**\n * Insert HTML content into editor\n * @param HTML content to insert\n * @param option Insert options. Default value is:\n * position: ContentPosition.SelectionStart\n * updateCursor: true\n * replaceSelection: true\n * insertOnNewLine: false\n */\n insertContent(content: string, option?: InsertOption) {\n if (content) {\n const doc = this.getDocument();\n const body = new DOMParser().parseFromString(\n this.getCore().trustedHTMLHandler(content),\n 'text/html'\n )?.body;\n let allNodes = body?.childNodes ? toArray(body.childNodes) : [];\n\n // If it is to insert on new line, and there are more than one node in the collection, wrap all nodes with\n // a parent DIV before calling insertNode on each top level sub node. Otherwise, every sub node may get wrapped\n // separately to show up on its own line\n if (option && option.insertOnNewLine && allNodes.length > 1) {\n allNodes = [wrap(allNodes)];\n }\n\n const fragment = doc.createDocumentFragment();\n allNodes.forEach(node => fragment.appendChild(node));\n\n this.insertNode(fragment, option);\n }\n }\n\n /**\n * Delete selected content\n */\n deleteSelectedContent(): NodePosition | null {\n const range = this.getSelectionRange();\n if (range && !range.collapsed) {\n return deleteSelectedContent(this.getCore().physicalRoot, range);\n }\n return null;\n }\n\n /**\n * Paste into editor using a clipboardData object\n * @param clipboardData Clipboard data retrieved from clipboard\n * @param pasteAsText Force pasting as plain text. Default value is false\n * @param applyCurrentStyle True if apply format of current selection to the pasted content,\n * false to keep original format. Default value is false. When pasteAsText is true, this parameter is ignored\n * @param pasteAsImage: When set to true, if the clipboardData contains a imageDataUri will paste the image to the editor\n */\n paste(\n clipboardData: ClipboardData,\n pasteAsText: boolean = false,\n applyCurrentFormat: boolean = false,\n pasteAsImage: boolean = false\n ) {\n paste(\n this,\n clipboardData,\n pasteAsText\n ? 'asPlainText'\n : applyCurrentFormat\n ? 'mergeFormat'\n : pasteAsImage\n ? 'asImage'\n : 'normal'\n );\n }\n\n //#endregion\n\n //#region Focus and Selection\n\n /**\n * Get current selection range from Editor.\n * It does a live pull on the selection, if nothing retrieved, return whatever we have in cache.\n * @param tryGetFromCache Set to true to retrieve the selection range from cache if editor doesn't own the focus now.\n * Default value is true\n * @returns current selection range, or null if editor never got focus before\n */\n getSelectionRange(tryGetFromCache: boolean = true): Range | null {\n const selection = this.getDOMSelection();\n\n return selection?.type == 'range' ? selection.range : null;\n }\n\n /**\n * Get current selection range from Editor.\n * It does a live pull on the selection, if nothing retrieved, return whatever we have in cache.\n * @param tryGetFromCache Set to true to retrieve the selection range from cache if editor doesn't own the focus now.\n * Default value is true\n * @returns current selection range, or null if editor never got focus before\n */\n getSelectionRangeEx(): SelectionRangeEx {\n const selection = this.getDOMSelection();\n\n return convertDomSelectionToRangeEx(selection);\n }\n\n /**\n * Get current selection in a serializable format\n * It does a live pull on the selection, if nothing retrieved, return whatever we have in cache.\n * @returns current selection path, or null if editor never got focus before\n */\n getSelectionPath(): SelectionPath | null {\n const range = this.getSelectionRange();\n return range && getSelectionPath(this.getCore().physicalRoot, range);\n }\n\n select(\n arg1: Range | SelectionRangeEx | NodePosition | Node | SelectionPath | null,\n arg2?: NodePosition | number | PositionType | TableSelection | null,\n arg3?: Node,\n arg4?: number | PositionType\n ): boolean {\n const core = this.getCore();\n const rangeEx = buildRangeEx(core.physicalRoot, arg1, arg2, arg3, arg4);\n const selection = convertRangeExToDomSelection(rangeEx);\n\n this.setDOMSelection(selection);\n return true;\n }\n\n /**\n * Get current focused position. Return null if editor doesn't have focus at this time.\n */\n getFocusedPosition(): NodePosition | null {\n const sel = this.getDocument().defaultView?.getSelection();\n if (sel?.focusNode && this.contains(sel.focusNode)) {\n return new Position(sel.focusNode, sel.focusOffset);\n }\n\n const range = this.getSelectionRange();\n if (range) {\n return Position.getStart(range);\n }\n\n return null;\n }\n\n /**\n * Get an HTML element from current cursor position.\n * When expectedTags is not specified, return value is the current node (if it is HTML element)\n * or its parent node (if current node is a Text node).\n * When expectedTags is specified, return value is the first ancestor of current node which has\n * one of the expected tags.\n * If no element found within editor by the given tag, return null.\n * @param selector Optional, an HTML selector to find HTML element with.\n * @param startFrom Start search from this node. If not specified, start from current focused position\n * @param event Optional, if specified, editor will try to get cached result from the event object first.\n * If it is not cached before, query from DOM and cache the result into the event object\n */\n getElementAtCursor(\n selector?: string,\n startFrom?: Node,\n event?: PluginEvent\n ): HTMLElement | null {\n event = startFrom ? undefined : event; // Only use cache when startFrom is not specified, for different start position can have different result\n\n return (\n cacheGetEventData(event ?? null, 'GET_ELEMENT_AT_CURSOR_' + selector, () => {\n if (!startFrom) {\n const position = this.getFocusedPosition();\n startFrom = position?.node;\n }\n return (\n startFrom && this.getDOMHelper().findClosestElementAncestor(startFrom, selector)\n );\n }) ?? null\n );\n }\n\n /**\n * Check if this position is at beginning of the editor.\n * This will return true if all nodes between the beginning of target node and the position are empty.\n * @param position The position to check\n * @returns True if position is at beginning of the editor, otherwise false\n */\n isPositionAtBeginning(position: NodePosition): boolean {\n return isPositionAtBeginningOf(position, this.getCore().logicalRoot);\n }\n\n /**\n * Get impacted regions from selection\n */\n getSelectedRegions(type: RegionType | CompatibleRegionType = RegionType.Table): Region[] {\n const selection = this.getSelectionRangeEx();\n const result: Region[] = [];\n const logicalRoot = this.getCore().logicalRoot;\n selection.ranges.forEach(range => {\n result.push(...(range ? getRegionsFromRange(logicalRoot, range, type) : []));\n });\n return result.filter((value, index, self) => {\n return self.indexOf(value) === index;\n });\n }\n\n //#endregion\n\n //#region EVENT API\n\n addDomEventHandler(\n nameOrMap: string | Record<string, DOMEventHandler>,\n handler?: DOMEventHandler\n ): () => void {\n const eventsMap = typeof nameOrMap == 'string' ? { [nameOrMap]: handler! } : nameOrMap;\n const eventsMapResult: Record<string, DOMEventRecord> = {};\n\n getObjectKeys(eventsMap).forEach(key => {\n const handlerObj = eventsMap[key];\n let result: DOMEventRecord = {\n pluginEventType: null,\n beforeDispatch: null,\n };\n\n if (typeof handlerObj === 'number') {\n result.pluginEventType = OldEventTypeToNewEventType[handlerObj as PluginEventType];\n } else if (typeof handlerObj === 'function') {\n result.beforeDispatch = handlerObj;\n } else if (typeof handlerObj === 'object') {\n const record = handlerObj as DOMEventHandlerObject;\n result = {\n beforeDispatch: record.beforeDispatch,\n pluginEventType:\n typeof record.pluginEventType == 'number'\n ? OldEventTypeToNewEventType[record.pluginEventType]\n : undefined,\n };\n }\n\n eventsMapResult[key] = result;\n });\n\n return this.attachDomEvent(eventsMapResult);\n }\n\n /**\n * Trigger an event to be dispatched to all plugins\n * @param eventType Type of the event\n * @param data data of the event with given type, this is the rest part of PluginEvent with the given type\n * @param broadcast indicates if the event needs to be dispatched to all plugins\n * True means to all, false means to allow exclusive handling from one plugin unless no one wants that\n * @returns the event object which is really passed into plugins. Some plugin may modify the event object so\n * the result of this function provides a chance to read the modified result\n */\n public triggerPluginEvent<T extends PluginEventType | CompatiblePluginEventType>(\n eventType: T,\n data: PluginEventData<T>,\n broadcast: boolean = false\n ): PluginEventFromType<T> {\n const oldEvent = {\n eventType,\n ...data,\n } as PluginEvent;\n const newEvent = oldEventToNewEvent(oldEvent);\n const core = this.getCore();\n\n if (newEvent) {\n core.api.triggerEvent(core, newEvent, broadcast);\n return (newEventToOldEvent(newEvent, oldEvent) ?? oldEvent) as PluginEventFromType<T>;\n } else {\n return oldEvent as PluginEventFromType<T>;\n }\n }\n\n /**\n * Trigger a ContentChangedEvent\n * @param source Source of this event, by default is 'SetContent'\n * @param data additional data for this event\n */\n triggerContentChangedEvent(\n source: ChangeSource | CompatibleChangeSource | string = ChangeSource.SetContent,\n data?: any\n ) {\n this.triggerPluginEvent(PluginEventType.ContentChanged, {\n source,\n data,\n });\n }\n\n //#endregion\n\n //#region Undo API\n\n /**\n * Undo last edit operation\n */\n undo() {\n undo(this);\n }\n\n /**\n * Redo next edit operation\n */\n redo() {\n redo(this);\n }\n\n /**\n * Add undo snapshot, and execute a format callback function, then add another undo snapshot, then trigger\n * ContentChangedEvent with given change source.\n * If this function is called nested, undo snapshot will only be added in the outside one\n * @param callback The callback function to perform formatting, returns a data object which will be used as\n * the data field in ContentChangedEvent if changeSource is not null.\n * @param changeSource The change source to use when fire ContentChangedEvent. When the value is not null,\n * a ContentChangedEvent will be fired with change source equal to this value\n * @param canUndoByBackspace True if this action can be undone when user press Backspace key (aka Auto Complete).\n */\n addUndoSnapshot(\n callback?: (start: NodePosition | null, end: NodePosition | null) => any,\n changeSource?: ChangeSource | CompatibleChangeSource | string,\n canUndoByBackspace?: boolean,\n additionalData?: ContentChangedData\n ) {\n const core = this.getCore();\n const undoState = core.undo;\n const isNested = undoState.isNested;\n let data: any;\n\n if (!isNested) {\n undoState.isNested = true;\n\n // When there is getEntityState, it means this is triggered by an entity change.\n // So if HTML content is not changed (hasNewContent is false), no need to add another snapshot before change\n if (\n core.undo.snapshotsManager.hasNewContent ||\n !additionalData?.getEntityState ||\n !callback\n ) {\n core.api.addUndoSnapshot(\n core,\n !!canUndoByBackspace,\n additionalData?.getEntityState?.()\n );\n }\n }\n\n try {\n if (callback) {\n const selection = core.api.getDOMSelection(core);\n const range = selection?.type == 'range' ? selection.range : null;\n data = callback(\n range && Position.getStart(range).normalize(),\n range && Position.getEnd(range).normalize()\n );\n\n if (!isNested) {\n const entityStates = additionalData?.getEntityState?.();\n\n core.api.addUndoSnapshot(core, false /*isAutoCompleteSnapshot*/, entityStates);\n }\n }\n } finally {\n if (!isNested) {\n undoState.isNested = false;\n }\n }\n\n if (callback && changeSource) {\n const event: ContentChangedEvent = {\n eventType: PluginEventType.ContentChanged,\n source: changeSource,\n data: data,\n additionalData,\n };\n this.triggerPluginEvent(PluginEventType.ContentChanged, event, true /*broadcast*/);\n }\n\n if (canUndoByBackspace) {\n const selection = core.api.getDOMSelection(core);\n\n if (selection?.type == 'range') {\n core.undo.snapshotsManager.hasNewContent = false;\n core.undo.posContainer = selection.range.startContainer;\n core.undo.posOffset = selection.range.startOffset;\n }\n }\n }\n\n /**\n * Whether there is an available undo/redo snapshot\n */\n getUndoState(): EditorUndoState {\n const { snapshotsManager } = this.getCore().undo;\n return {\n canUndo:\n snapshotsManager.hasNewContent || snapshotsManager.canMove(-1 /*previousSnapshot*/),\n canRedo: snapshotsManager.canMove(1 /*nextSnapshot*/),\n };\n }\n\n //#endregion\n\n //#region Misc\n\n /**\n * Get custom data related to this editor\n * @param key Key of the custom data\n * @param getter Getter function. If custom data for the given key doesn't exist,\n * call this function to get one and store it if it is specified. Otherwise return undefined\n * @param disposer An optional disposer function to dispose this custom data when\n * dispose editor.\n */\n getCustomData<T>(key: string, getter?: () => T, disposer?: (value: T) => void): T {\n const core = this.getContentModelEditorCore();\n return (core.customData[key] = core.customData[key] || {\n value: getter ? getter() : undefined,\n disposer,\n }).value as T;\n }\n\n /**\n * Get default format of this editor\n * @returns Default format object of this editor\n */\n getDefaultFormat(): DefaultFormat {\n const format = this.getCore().format.defaultFormat;\n\n return {\n bold: isBold(format.fontWeight),\n italic: format.italic,\n underline: format.underline,\n fontFamily: format.fontFamily,\n fontSize: format.fontSize,\n textColor: format.textColor,\n backgroundColor: format.backgroundColor,\n };\n }\n\n /**\n * Get a content traverser for the whole editor\n * @param startNode The node to start from. If not passed, it will start from the beginning of the body\n */\n getBodyTraverser(startNode?: Node): IContentTraverser {\n return ContentTraverser.createBodyTraverser(this.getCore().logicalRoot, startNode);\n }\n\n /**\n * Get a content traverser for current selection\n * @returns A content traverser, or null if editor never got focus before\n */\n getSelectionTraverser(range?: Range): IContentTraverser | null {\n range = range ?? this.getSelectionRange() ?? undefined;\n return range\n ? ContentTraverser.createSelectionTraverser(this.getCore().logicalRoot, range)\n : null;\n }\n\n /**\n * Get a content traverser for current block element start from specified position\n * @param startFrom Start position of the traverser. Default value is ContentPosition.SelectionStart\n * @returns A content traverser, or null if editor never got focus before\n */\n getBlockTraverser(\n startFrom: ContentPosition | CompatibleContentPosition = ContentPosition.SelectionStart\n ): IContentTraverser | null {\n const range = this.getSelectionRange();\n return range\n ? ContentTraverser.createBlockTraverser(this.getCore().logicalRoot, range, startFrom)\n : null;\n }\n\n /**\n * Get a text traverser of current selection\n * @param event Optional, if specified, editor will try to get cached result from the event object first.\n * If it is not cached before, query from DOM and cache the result into the event object\n * @returns A content traverser, or null if editor never got focus before\n */\n getContentSearcherOfCursor(event?: PluginEvent): IPositionContentSearcher | null {\n return cacheGetEventData(event ?? null, 'ContentSearcher', () => {\n const range = this.getSelectionRange();\n return (\n range &&\n new PositionContentSearcher(this.getCore().logicalRoot, Position.getStart(range))\n );\n });\n }\n\n /**\n * Run a callback function asynchronously\n * @param callback The callback function to run\n * @returns a function to cancel this async run\n */\n runAsync(callback: (editor: ILegacyEditor & IEditor) => void) {\n const win = this.getCore().physicalRoot.ownerDocument.defaultView || window;\n const handle = win.requestAnimationFrame(() => {\n if (!this.isDisposed() && callback) {\n callback(this);\n }\n });\n\n return () => {\n win.cancelAnimationFrame(handle);\n };\n }\n\n /**\n * Set DOM attribute of editor content DIV\n * @param name Name of the attribute\n * @param value Value of the attribute\n */\n setEditorDomAttribute(name: string, value: string | null) {\n this.getDOMHelper().setDomAttribute(name, value);\n }\n\n /**\n * Get DOM attribute of editor content DIV, null if there is no such attribute.\n * @param name Name of the attribute\n */\n getEditorDomAttribute(name: string): string | null {\n return this.getDOMHelper().getDomAttribute(name);\n }\n\n /**\n * @deprecated Use getVisibleViewport() instead.\n *\n * Get current relative distance from top-left corner of the given element to top-left corner of editor content DIV.\n * @param element The element to calculate from. If the given element is not in editor, return value will be null\n * @param addScroll When pass true, The return value will also add scrollLeft and scrollTop if any. So the value\n * may be different than what user is seeing from the view. When pass false, scroll position will be ignored.\n * @returns An [x, y] array which contains the left and top distances, or null if the given element is not in editor.\n */\n getRelativeDistanceToEditor(element: HTMLElement, addScroll?: boolean): number[] | null {\n if (this.contains(element)) {\n const physicalRoot = this.getCore().physicalRoot;\n const editorRect = physicalRoot.getBoundingClientRect();\n const elementRect = element.getBoundingClientRect();\n\n if (editorRect && elementRect) {\n let x = elementRect.left - editorRect?.left;\n let y = elementRect.top - editorRect?.top;\n\n if (addScroll) {\n x += physicalRoot.scrollLeft;\n y += physicalRoot.scrollTop;\n }\n\n return [x, y];\n }\n }\n\n return null;\n }\n\n /**\n * Add a Content Edit feature.\n * @param feature The feature to add\n */\n addContentEditFeature(feature: GenericContentEditFeature<PluginEvent>) {\n const core = this.getContentModelEditorCore();\n feature?.keys.forEach(key => {\n const array = core.edit.features[key] || [];\n array.push(feature);\n core.edit.features[key] = array;\n });\n }\n\n /**\n * Remove a Content Edit feature.\n * @param feature The feature to remove\n */\n removeContentEditFeature(feature: GenericContentEditFeature<PluginEvent>) {\n const core = this.getContentModelEditorCore();\n feature?.keys.forEach(key => {\n const featureSet = core.edit.features[key];\n const index = featureSet?.indexOf(feature) ?? -1;\n if (index >= 0) {\n core.edit.features[key].splice(index, 1);\n if (core.edit.features[key].length < 1) {\n delete core.edit.features[key];\n }\n }\n });\n }\n\n /**\n * @deprecated\n * Get style based format state from current selection, including font name/size and colors\n */\n getStyleBasedFormatState(): StyleBasedFormatState {\n const format = this.retrieveFormatState();\n\n return {\n backgroundColor: format.backgroundColor,\n direction: format.direction,\n fontName: format.fontName,\n fontSize: format.fontSize,\n fontWeight: format.fontWeight,\n lineHeight: format.lineHeight,\n marginBottom: format.marginBottom,\n marginTop: format.marginTop,\n textAlign: format.textAlign,\n textColor: format.textColor,\n };\n }\n\n /**\n * @deprecated\n * Get the pendable format such as underline and bold\n * @returns The pending format state\n */\n getPendableFormatState(): PendableFormatState {\n const format = this.retrieveFormatState();\n\n return {\n isBold: format.isBold,\n isItalic: format.isItalic,\n isStrikeThrough: format.isStrikeThrough,\n isSubscript: format.isSubscript,\n isSuperscript: format.isSubscript,\n isUnderline: format.isUnderline,\n };\n }\n\n /**\n * @deprecated\n * Ensure user will type into a container element rather than into the editor content DIV directly\n * @param position The position that user is about to type to\n * @param keyboardEvent Optional keyboard event object\n */\n ensureTypeInContainer(position: NodePosition, keyboardEvent?: KeyboardEvent) {\n // No OP\n }\n\n //#endregion\n\n //#region Dark mode APIs\n\n /**\n * Transform the given node and all its child nodes to dark mode color if editor is in dark mode\n * @param node The node to transform\n * @param direction The transform direction. @default ColorTransformDirection.LightToDark\n */\n transformToDarkColor(\n node: Node,\n direction:\n | ColorTransformDirection\n | CompatibleColorTransformDirection = ColorTransformDirection.LightToDark\n ) {\n const core = this.getCore();\n\n if (core.lifecycle.isDarkMode) {\n transformColor(\n node,\n true /*includeSelf*/,\n direction == ColorTransformDirection.DarkToLight ? 'darkToLight' : 'lightToDark',\n core.darkColorHandler\n );\n }\n }\n\n /**\n * Check if the given experimental feature is enabled\n * @param feature The feature to check\n */\n isFeatureEnabled(feature: ExperimentalFeatures | CompatibleExperimentalFeatures): boolean {\n return (\n this.getContentModelEditorCore().experimentalFeatures.indexOf(\n feature as ExperimentalFeatures\n ) >= 0\n );\n }\n\n /**\n * Get current zoom scale, default value is 1\n * When editor is put under a zoomed container, need to pass the zoom scale number using EditorOptions.zoomScale\n * to let editor behave correctly especially for those mouse drag/drop behaviors\n * @returns current zoom scale number\n */\n getZoomScale(): number {\n return this.getDOMHelper().calculateZoomScale();\n }\n\n /**\n * Set current zoom scale, default value is 1\n * When editor is put under a zoomed container, need to pass the zoom scale number using EditorOptions.zoomScale\n * to let editor behave correctly especially for those mouse drag/drop behaviors\n * @param scale The new scale number to set. It should be positive number and no greater than 10, otherwise it will be ignored.\n */\n setZoomScale(scale: number): void {\n if (scale > 0 && scale <= 10) {\n const oldValue = this.getZoomScale();\n\n if (oldValue != scale) {\n this.triggerEvent(\n 'zoomChanged',\n {\n newZoomScale: scale,\n },\n true /*broadcast*/\n );\n }\n }\n }\n\n /**\n * @deprecated Use getZoomScale() instead\n */\n getSizeTransformer(): SizeTransformer {\n return this.getContentModelEditorCore().sizeTransformer;\n }\n\n /**\n * Get a darkColorHandler object for this editor.\n */\n getDarkColorHandler(): DarkColorHandler {\n const core = this.getContentModelEditorCore();\n return core.darkColorHandler;\n }\n\n /**\n * Check if editor is in IME input sequence\n * @returns True if editor is in IME input sequence, otherwise false\n */\n isInIME(): boolean {\n return this.getCore().domEvent.isInIME;\n }\n\n private retrieveFormatState(): ContentModelFormatState {\n const pendingFormat = this.getPendingFormat();\n const result: ContentModelFormatState = {};\n const model = this.getContentModelCopy('reduced');\n\n retrieveModelFormatState(model, pendingFormat, result);\n\n return result;\n }\n\n /**\n * @returns the current EditorAdapterCore object\n * @throws a standard Error if there's no core object\n */\n private getContentModelEditorCore(): EditorAdapterCore {\n if (!this.contentModelEditorCore) {\n throw new Error('Editor is already disposed');\n }\n\n return this.contentModelEditorCore;\n }\n}\n","import { createRange, safeInstanceOf } from 'roosterjs-editor-dom';\nimport { SelectionRangeTypes } from 'roosterjs-editor-types';\nimport type {\n NodePosition,\n PositionType,\n SelectionPath,\n SelectionRangeEx,\n TableSelection,\n} from 'roosterjs-editor-types';\n\n/**\n * @internal\n */\nexport function buildRangeEx(\n root: HTMLElement,\n arg1: Range | SelectionRangeEx | NodePosition | Node | SelectionPath | null,\n arg2?: NodePosition | number | PositionType | TableSelection | null,\n arg3?: Node,\n arg4?: number | PositionType\n): SelectionRangeEx {\n let rangeEx: SelectionRangeEx | null = null;\n\n if (isSelectionRangeEx(arg1)) {\n rangeEx = arg1;\n } else if (safeInstanceOf(arg1, 'HTMLTableElement') && isTableSelectionOrNull(arg2)) {\n rangeEx = {\n type: SelectionRangeTypes.TableSelection,\n ranges: [],\n areAllCollapsed: false,\n table: arg1,\n coordinates: arg2 ?? undefined,\n };\n } else if (safeInstanceOf(arg1, 'HTMLImageElement') && typeof arg2 == 'undefined') {\n rangeEx = {\n type: SelectionRangeTypes.ImageSelection,\n ranges: [],\n areAllCollapsed: false,\n image: arg1,\n };\n } else {\n const range = !arg1\n ? null\n : safeInstanceOf(arg1, 'Range')\n ? arg1\n : isSelectionPath(arg1)\n ? createRange(root, arg1.start, arg1.end)\n : isNodePosition(arg1) || safeInstanceOf(arg1, 'Node')\n ? createRange(\n <Node>arg1,\n <number | PositionType>arg2,\n <Node>arg3,\n <number | PositionType>arg4\n )\n : null;\n\n rangeEx = range\n ? {\n type: SelectionRangeTypes.Normal,\n ranges: [range],\n areAllCollapsed: range.collapsed,\n }\n : {\n type: SelectionRangeTypes.Normal,\n ranges: [],\n areAllCollapsed: true,\n };\n }\n\n return rangeEx;\n}\n\nfunction isSelectionRangeEx(obj: any): obj is SelectionRangeEx {\n const rangeEx = obj as SelectionRangeEx;\n return (\n rangeEx &&\n typeof rangeEx == 'object' &&\n typeof rangeEx.type == 'number' &&\n Array.isArray(rangeEx.ranges)\n );\n}\n\nfunction isTableSelectionOrNull(obj: any): obj is TableSelection | null {\n const selection = obj as TableSelection | null;\n\n return (\n selection === null ||\n (selection &&\n typeof selection == 'object' &&\n typeof selection.firstCell == 'object' &&\n typeof selection.lastCell == 'object')\n );\n}\n\nfunction isSelectionPath(obj: any): obj is SelectionPath {\n const path = obj as SelectionPath;\n\n return path && typeof path == 'object' && Array.isArray(path.start) && Array.isArray(path.end);\n}\n\nfunction isNodePosition(obj: any): obj is NodePosition {\n const pos = obj as NodePosition;\n\n return (\n pos &&\n typeof pos == 'object' &&\n typeof pos.node == 'object' &&\n typeof pos.offset == 'number'\n );\n}\n","import { convertDomSelectionToRangeEx, convertRangeExToDomSelection } from './selectionConverter';\nimport { createDefaultHtmlSanitizerOptions } from 'roosterjs-editor-dom';\nimport type { BeforePasteAdapterEvent } from '../../publicTypes/BeforePasteAdapterEvent';\nimport {\n KnownAnnounceStrings as OldKnownAnnounceStrings,\n PasteType as OldPasteType,\n EntityOperation as OldEntityOperation,\n PluginEventType,\n} from 'roosterjs-editor-types';\nimport type {\n PluginEvent as OldEvent,\n AnnounceData as OldAnnounceData,\n} from 'roosterjs-editor-types';\nimport type {\n PluginEvent as NewEvent,\n PasteType as NewPasteType,\n AnnounceData as NewAnnounceData,\n KnownAnnounceStrings as NewKnownAnnounceStrings,\n EntityOperation as NewEntityOperation,\n PluginEventType as NewPluginEventType,\n} from 'roosterjs-content-model-types';\n\nconst PasteTypeNewToOld: Record<NewPasteType, OldPasteType> = {\n asImage: OldPasteType.AsImage,\n asPlainText: OldPasteType.AsPlainText,\n mergeFormat: OldPasteType.MergeFormat,\n normal: OldPasteType.Normal,\n};\n\nconst PasteTypeOldToNew: Record<OldPasteType, NewPasteType> = {\n [OldPasteType.AsImage]: 'asImage',\n [OldPasteType.AsPlainText]: 'asPlainText',\n [OldPasteType.MergeFormat]: 'mergeFormat',\n [OldPasteType.Normal]: 'normal',\n};\n\nconst KnownAnnounceStringsOldToNew: Record<OldKnownAnnounceStrings, NewKnownAnnounceStrings> = {\n [OldKnownAnnounceStrings.AnnounceListItemBullet]: 'announceListItemBullet',\n [OldKnownAnnounceStrings.AnnounceListItemNumbering]: 'announceListItemNumbering',\n [OldKnownAnnounceStrings.AnnounceOnFocusLastCell]: 'announceOnFocusLastCell',\n};\n\nconst KnownAnnounceStringsNewToOld: Record<NewKnownAnnounceStrings, OldKnownAnnounceStrings> = {\n announceListItemBullet: OldKnownAnnounceStrings.AnnounceListItemBullet,\n announceListItemNumbering: OldKnownAnnounceStrings.AnnounceListItemNumbering,\n announceOnFocusLastCell: OldKnownAnnounceStrings.AnnounceOnFocusLastCell,\n};\n\nconst EntityOperationOldToNew: Record<OldEntityOperation, NewEntityOperation | undefined> = {\n [OldEntityOperation.NewEntity]: 'newEntity',\n [OldEntityOperation.Overwrite]: 'overwrite',\n [OldEntityOperation.RemoveFromEnd]: 'removeFromEnd',\n [OldEntityOperation.RemoveFromStart]: 'removeFromStart',\n [OldEntityOperation.ReplaceTemporaryContent]: 'replaceTemporaryContent',\n [OldEntityOperation.UpdateEntityState]: 'updateEntityState',\n [OldEntityOperation.Click]: 'click',\n [OldEntityOperation.ContextMenu]: undefined,\n [OldEntityOperation.Escape]: undefined,\n [OldEntityOperation.PartialOverwrite]: undefined,\n [OldEntityOperation.AddShadowRoot]: undefined,\n [OldEntityOperation.RemoveShadowRoot]: undefined,\n};\n\nconst EntityOperationNewToOld: Record<NewEntityOperation, OldEntityOperation> = {\n newEntity: OldEntityOperation.NewEntity,\n overwrite: OldEntityOperation.Overwrite,\n removeFromEnd: OldEntityOperation.RemoveFromEnd,\n removeFromStart: OldEntityOperation.RemoveFromStart,\n replaceTemporaryContent: OldEntityOperation.ReplaceTemporaryContent,\n updateEntityState: OldEntityOperation.UpdateEntityState,\n click: OldEntityOperation.Click,\n};\n\n/**\n * @internal\n */\nexport const OldEventTypeToNewEventType: Record<PluginEventType, NewPluginEventType | undefined> = {\n [PluginEventType.BeforeCutCopy]: 'beforeCutCopy',\n [PluginEventType.BeforeDispose]: 'beforeDispose',\n [PluginEventType.BeforeKeyboardEditing]: 'beforeKeyboardEditing',\n [PluginEventType.BeforePaste]: 'beforePaste',\n [PluginEventType.BeforeSetContent]: 'beforeSetContent',\n [PluginEventType.CompositionEnd]: 'compositionEnd',\n [PluginEventType.ContentChanged]: 'contentChanged',\n [PluginEventType.ContextMenu]: 'contextMenu',\n [PluginEventType.EditImage]: 'editImage',\n [PluginEventType.EditorReady]: 'editorReady',\n [PluginEventType.EnteredShadowEdit]: 'enteredShadowEdit',\n [PluginEventType.EntityOperation]: 'entityOperation',\n [PluginEventType.ExtractContentWithDom]: 'extractContentWithDom',\n [PluginEventType.Input]: 'input',\n [PluginEventType.KeyDown]: 'keyDown',\n [PluginEventType.KeyPress]: 'keyPress',\n [PluginEventType.KeyUp]: 'keyUp',\n [PluginEventType.LeavingShadowEdit]: 'leavingShadowEdit',\n [PluginEventType.MouseDown]: 'mouseDown',\n [PluginEventType.MouseUp]: 'mouseUp',\n [PluginEventType.PendingFormatStateChanged]: undefined,\n [PluginEventType.Scroll]: 'scroll',\n [PluginEventType.SelectionChanged]: 'selectionChanged',\n [PluginEventType.ZoomChanged]: 'zoomChanged',\n};\n\n/**\n * @internal Convert legacy event object to new event object\n */\nexport function oldEventToNewEvent<TOldEvent extends OldEvent>(\n input: TOldEvent,\n refEvent?: NewEvent\n): NewEvent | undefined {\n switch (input.eventType) {\n case PluginEventType.BeforeCutCopy:\n return {\n eventType: 'beforeCutCopy',\n clonedRoot: input.clonedRoot,\n eventDataCache: input.eventDataCache,\n isCut: input.isCut,\n range: input.range,\n rawEvent: input.rawEvent,\n };\n\n case PluginEventType.BeforeDispose:\n return {\n eventType: 'beforeDispose',\n eventDataCache: input.eventDataCache,\n };\n\n case PluginEventType.BeforeKeyboardEditing:\n return {\n eventType: 'beforeKeyboardEditing',\n eventDataCache: input.eventDataCache,\n rawEvent: input.rawEvent,\n };\n\n case PluginEventType.BeforePaste:\n const refBeforePasteEvent = refEvent?.eventType == 'beforePaste' ? refEvent : undefined;\n const cmBeforePasteEvent = input as BeforePasteAdapterEvent;\n\n return {\n eventType: 'beforePaste',\n clipboardData: input.clipboardData,\n customizedMerge:\n cmBeforePasteEvent.customizedMerge ?? refBeforePasteEvent?.customizedMerge,\n domToModelOption: cmBeforePasteEvent.domToModelOption ??\n refBeforePasteEvent?.domToModelOption ?? {\n additionalAllowedTags: [],\n additionalDisallowedTags: [],\n additionalFormatParsers: {},\n formatParserOverride: {},\n processorOverride: {},\n styleSanitizers: {},\n attributeSanitizers: {},\n },\n eventDataCache: input.eventDataCache,\n fragment: input.fragment,\n htmlAfter: input.htmlAfter,\n htmlAttributes: input.htmlAttributes,\n htmlBefore: input.htmlBefore,\n pasteType: PasteTypeOldToNew[input.pasteType],\n };\n\n case PluginEventType.BeforeSetContent:\n return {\n eventType: 'beforeSetContent',\n eventDataCache: input.eventDataCache,\n newContent: input.newContent,\n };\n\n case PluginEventType.CompositionEnd:\n return {\n eventType: 'compositionEnd',\n eventDataCache: input.eventDataCache,\n rawEvent: input.rawEvent,\n };\n\n case PluginEventType.ContentChanged:\n const refContentChangedEvent =\n refEvent?.eventType == 'contentChanged' ? refEvent : undefined;\n return {\n eventType: 'contentChanged',\n eventDataCache: input.eventDataCache,\n changedEntities: refContentChangedEvent?.changedEntities,\n contentModel: refContentChangedEvent?.contentModel,\n data: input.data,\n entityStates:\n input.additionalData?.getEntityState?.() ??\n refContentChangedEvent?.entityStates,\n selection: refContentChangedEvent?.selection,\n source: input.source,\n formatApiName:\n input.additionalData?.formatApiName ?? refContentChangedEvent?.formatApiName,\n announceData:\n announceDataOldToNew(input.additionalData?.getAnnounceData?.()) ??\n refContentChangedEvent?.announceData,\n };\n\n case PluginEventType.ContextMenu:\n return {\n eventType: 'contextMenu',\n eventDataCache: input.eventDataCache,\n rawEvent: input.rawEvent,\n items: input.items,\n };\n\n case PluginEventType.EditImage:\n return {\n eventType: 'editImage',\n eventDataCache: input.eventDataCache,\n image: input.image,\n newSrc: input.newSrc,\n originalSrc: input.originalSrc,\n previousSrc: input.previousSrc,\n };\n\n case PluginEventType.EditorReady:\n return {\n eventType: 'editorReady',\n eventDataCache: input.eventDataCache,\n };\n\n case PluginEventType.EnteredShadowEdit:\n return {\n eventType: 'enteredShadowEdit',\n eventDataCache: input.eventDataCache,\n };\n\n case PluginEventType.EntityOperation:\n const operation = EntityOperationOldToNew[input.operation];\n\n return operation === undefined\n ? undefined\n : {\n eventType: 'entityOperation',\n eventDataCache: input.eventDataCache,\n rawEvent: input.rawEvent,\n entity: input.entity,\n operation: operation,\n shouldPersist: input.shouldPersist,\n state: input.state,\n };\n\n case PluginEventType.ExtractContentWithDom:\n return {\n eventType: 'extractContentWithDom',\n eventDataCache: input.eventDataCache,\n clonedRoot: input.clonedRoot,\n };\n\n case PluginEventType.Input:\n return {\n eventType: 'input',\n eventDataCache: input.eventDataCache,\n rawEvent: input.rawEvent,\n };\n\n case PluginEventType.KeyDown:\n case PluginEventType.KeyPress:\n case PluginEventType.KeyUp:\n return {\n eventType:\n input.eventType == PluginEventType.KeyDown\n ? 'keyDown'\n : input.eventType == PluginEventType.KeyPress\n ? 'keyPress'\n : 'keyUp',\n eventDataCache: input.eventDataCache,\n rawEvent: input.rawEvent,\n };\n\n case PluginEventType.LeavingShadowEdit:\n return {\n eventType: 'leavingShadowEdit',\n eventDataCache: input.eventDataCache,\n };\n\n case PluginEventType.MouseDown:\n return {\n eventType: 'mouseDown',\n eventDataCache: input.eventDataCache,\n rawEvent: input.rawEvent,\n };\n\n case PluginEventType.MouseUp:\n return {\n eventType: 'mouseUp',\n eventDataCache: input.eventDataCache,\n rawEvent: input.rawEvent,\n isClicking: input.isClicking,\n };\n\n case PluginEventType.Scroll:\n return {\n eventType: 'scroll',\n eventDataCache: input.eventDataCache,\n rawEvent: input.rawEvent,\n scrollContainer: input.scrollContainer,\n };\n\n case PluginEventType.SelectionChanged:\n const refSelectionChangedEvent =\n refEvent?.eventType == 'selectionChanged' ? refEvent : undefined;\n\n return {\n eventType: 'selectionChanged',\n eventDataCache: input.eventDataCache,\n newSelection:\n refSelectionChangedEvent?.newSelection ??\n convertRangeExToDomSelection(input.selectionRangeEx),\n };\n\n case PluginEventType.ZoomChanged:\n return {\n eventType: 'zoomChanged',\n eventDataCache: input.eventDataCache,\n newZoomScale: input.newZoomScale,\n };\n\n default:\n return undefined;\n }\n}\n\n/**\n * @internal Convert new event object to legacy event object\n */\nexport function newEventToOldEvent(input: NewEvent, refEvent?: OldEvent): OldEvent | undefined {\n switch (input.eventType) {\n case 'beforeCutCopy':\n return {\n eventType: PluginEventType.BeforeCutCopy,\n clonedRoot: input.clonedRoot,\n eventDataCache: input.eventDataCache,\n isCut: input.isCut,\n range: input.range,\n rawEvent: input.rawEvent,\n };\n\n case 'beforeDispose':\n return {\n eventType: PluginEventType.BeforeDispose,\n eventDataCache: input.eventDataCache,\n };\n\n case 'beforeKeyboardEditing':\n return {\n eventType: PluginEventType.BeforeKeyboardEditing,\n eventDataCache: input.eventDataCache,\n rawEvent: input.rawEvent,\n };\n\n case 'beforePaste':\n const refBeforePasteEvent =\n refEvent?.eventType == PluginEventType.BeforePaste ? refEvent : undefined;\n\n const oldBeforePasteEvent: BeforePasteAdapterEvent = {\n eventType: PluginEventType.BeforePaste,\n clipboardData: input.clipboardData,\n eventDataCache: input.eventDataCache,\n fragment: input.fragment,\n htmlAfter: input.htmlAfter,\n htmlAttributes: input.htmlAttributes,\n htmlBefore: input.htmlBefore,\n pasteType: PasteTypeNewToOld[input.pasteType],\n sanitizingOption:\n refBeforePasteEvent?.sanitizingOption ?? createDefaultHtmlSanitizerOptions(),\n domToModelOption: input.domToModelOption,\n customizedMerge: input.customizedMerge,\n };\n\n return oldBeforePasteEvent;\n\n case 'beforeSetContent':\n return {\n eventType: PluginEventType.BeforeSetContent,\n eventDataCache: input.eventDataCache,\n newContent: input.newContent,\n };\n\n case 'compositionEnd':\n return {\n eventType: PluginEventType.CompositionEnd,\n eventDataCache: input.eventDataCache,\n rawEvent: input.rawEvent,\n };\n\n case 'contentChanged':\n const entityStates = input.entityStates;\n\n return {\n eventType: PluginEventType.ContentChanged,\n eventDataCache: input.eventDataCache,\n data: input.data,\n source: input.source,\n additionalData: {\n formatApiName: input.formatApiName,\n getAnnounceData: input.announceData\n ? () => announceDataNewToOld(input.announceData)\n : undefined,\n getEntityState: entityStates ? () => entityStates : undefined,\n },\n };\n\n case 'contextMenu':\n return {\n eventType: PluginEventType.ContextMenu,\n eventDataCache: input.eventDataCache,\n rawEvent: input.rawEvent,\n items: input.items,\n };\n\n case 'editImage':\n return {\n eventType: PluginEventType.EditImage,\n eventDataCache: input.eventDataCache,\n image: input.image,\n newSrc: input.newSrc,\n originalSrc: input.originalSrc,\n previousSrc: input.previousSrc,\n };\n\n case 'editorReady':\n return {\n eventType: PluginEventType.EditorReady,\n eventDataCache: input.eventDataCache,\n };\n\n case 'enteredShadowEdit':\n const refEnteredShadowEditEvent =\n refEvent?.eventType == PluginEventType.EnteredShadowEdit ? refEvent : undefined;\n\n return {\n eventType: PluginEventType.EnteredShadowEdit,\n eventDataCache: input.eventDataCache,\n fragment: refEnteredShadowEditEvent?.fragment ?? document.createDocumentFragment(),\n selectionPath: refEnteredShadowEditEvent?.selectionPath ?? {\n end: [],\n start: [],\n },\n };\n\n case 'entityOperation':\n return {\n eventType: PluginEventType.EntityOperation,\n eventDataCache: input.eventDataCache,\n rawEvent: input.rawEvent,\n entity: input.entity,\n operation: EntityOperationNewToOld[input.operation],\n shouldPersist: input.shouldPersist,\n state: input.state,\n };\n\n case 'extractContentWithDom':\n return {\n eventType: PluginEventType.ExtractContentWithDom,\n eventDataCache: input.eventDataCache,\n clonedRoot: input.clonedRoot,\n };\n\n case 'input':\n return {\n eventType: PluginEventType.Input,\n eventDataCache: input.eventDataCache,\n rawEvent: input.rawEvent,\n };\n\n case 'keyDown':\n case 'keyPress':\n case 'keyUp':\n return {\n eventType:\n input.eventType == 'keyDown'\n ? PluginEventType.KeyDown\n : input.eventType == 'keyPress'\n ? PluginEventType.KeyPress\n : PluginEventType.KeyUp,\n eventDataCache: input.eventDataCache,\n rawEvent: input.rawEvent,\n };\n\n case 'leavingShadowEdit':\n return {\n eventType: PluginEventType.LeavingShadowEdit,\n eventDataCache: input.eventDataCache,\n };\n\n case 'mouseDown':\n return {\n eventType: PluginEventType.MouseDown,\n eventDataCache: input.eventDataCache,\n rawEvent: input.rawEvent,\n };\n\n case 'mouseUp':\n return {\n eventType: PluginEventType.MouseUp,\n eventDataCache: input.eventDataCache,\n rawEvent: input.rawEvent,\n isClicking: input.isClicking,\n };\n\n case 'scroll':\n return {\n eventType: PluginEventType.Scroll,\n eventDataCache: input.eventDataCache,\n rawEvent: input.rawEvent,\n scrollContainer: input.scrollContainer,\n };\n\n case 'selectionChanged':\n const refSelectionChangedEvent =\n refEvent?.eventType == PluginEventType.SelectionChanged ? refEvent : undefined;\n\n return {\n eventType: PluginEventType.SelectionChanged,\n eventDataCache: input.eventDataCache,\n selectionRangeEx:\n refSelectionChangedEvent?.selectionRangeEx ??\n convertDomSelectionToRangeEx(input.newSelection),\n };\n\n case 'zoomChanged':\n return {\n eventType: PluginEventType.ZoomChanged,\n eventDataCache: input.eventDataCache,\n newZoomScale: input.newZoomScale,\n oldZoomScale:\n refEvent?.eventType == PluginEventType.ZoomChanged ? refEvent.oldZoomScale : 1, // In new ZoomChangedEvent we don't really have oldZoomScale. So if we can't get it, just use 1 instead\n };\n\n default:\n return undefined;\n }\n}\n\nfunction announceDataOldToNew(data: OldAnnounceData | undefined): NewAnnounceData | undefined {\n return data\n ? {\n defaultStrings: data.defaultStrings\n ? KnownAnnounceStringsOldToNew[data.defaultStrings]\n : undefined,\n formatStrings: data.formatStrings,\n text: data.text,\n }\n : undefined;\n}\n\nfunction announceDataNewToOld(data: NewAnnounceData | undefined): OldAnnounceData | undefined {\n return data\n ? {\n defaultStrings: data.defaultStrings\n ? KnownAnnounceStringsNewToOld[data.defaultStrings]\n : undefined,\n formatStrings: data.formatStrings,\n text: data.text,\n }\n : undefined;\n}\n","import { ContentPosition, NodeType, PositionType, RegionType } from 'roosterjs-editor-types';\nimport type { BlockElement, InsertOption, NodePosition } from 'roosterjs-editor-types';\nimport {\n createRange,\n getBlockElementAtNode,\n getFirstLastBlockElement,\n isBlockElement,\n isVoidHtmlElement,\n Position,\n safeInstanceOf,\n toArray,\n wrap,\n adjustInsertPosition,\n getRegionsFromRange,\n splitTextNode,\n splitParentNode,\n} from 'roosterjs-editor-dom';\nimport type { DOMSelection } from 'roosterjs-content-model-types';\n\nfunction getInitialRange(\n selection: DOMSelection | null,\n option: InsertOption\n): { range: Range | null; rangeToRestore: Range | null } {\n // Selection start replaces based on the current selection.\n // Range inserts based on a provided range.\n // Both have the potential to use the current selection to restore cursor position\n // So in both cases we need to store the selection state.\n let range = selection?.type == 'range' ? selection.range : null;\n let rangeToRestore = null;\n\n if (option.position == ContentPosition.Range) {\n rangeToRestore = range;\n range = option.range;\n } else if (range) {\n rangeToRestore = range.cloneRange();\n }\n\n return { range, rangeToRestore };\n}\n\n/**\n * @internal\n * Insert a DOM node into editor content\n */\nexport function insertNode(\n contentDiv: HTMLDivElement,\n selection: DOMSelection | null,\n node: Node,\n option: InsertOption\n): DOMSelection | undefined {\n switch (option.position) {\n case ContentPosition.Begin:\n case ContentPosition.End: {\n const isBegin = option.position == ContentPosition.Begin;\n const block = getFirstLastBlockElement(contentDiv, isBegin);\n let insertedNode: Node | Node[] | undefined;\n if (block) {\n const refNode = isBegin ? block.getStartNode() : block.getEndNode();\n if (\n option.insertOnNewLine ||\n refNode.nodeType == NodeType.Text ||\n isVoidHtmlElement(refNode)\n ) {\n // For insert on new line, or refNode is text or void html element (HR, BR etc.)\n // which cannot have children, i.e. <div>hello<br>world</div>. 'hello', 'world' are the\n // first and last node. Insert before 'hello' or after 'world', but still inside DIV\n if (safeInstanceOf(node, 'DocumentFragment')) {\n // if the node to be inserted is DocumentFragment, use its childNodes as insertedNode\n // because insertBefore() returns an empty DocumentFragment\n insertedNode = toArray(node.childNodes);\n refNode.parentNode?.insertBefore(\n node,\n isBegin ? refNode : refNode.nextSibling\n );\n } else {\n insertedNode = refNode.parentNode?.insertBefore(\n node,\n isBegin ? refNode : refNode.nextSibling\n );\n }\n } else {\n // if the refNode can have child, use appendChild (which is like to insert as first/last child)\n // i.e. <div>hello</div>, the content will be inserted before/after hello\n insertedNode = refNode.insertBefore(node, isBegin ? refNode.firstChild : null);\n }\n } else {\n // No first block, this can happen when editor is empty. Use appendChild to insert the content in contentDiv\n insertedNode = contentDiv.appendChild(node);\n }\n\n // Final check to see if the inserted node is a block. If not block and the ask is to insert on new line,\n // add a DIV wrapping\n if (insertedNode && option.insertOnNewLine) {\n const nodes = Array.isArray(insertedNode) ? insertedNode : [insertedNode];\n if (!isBlockElement(nodes[0]) || !isBlockElement(nodes[nodes.length - 1])) {\n wrap(nodes);\n }\n }\n\n break;\n }\n case ContentPosition.DomEnd:\n // Use appendChild to insert the node at the end of the content div.\n const insertedNode = contentDiv.appendChild(node);\n // Final check to see if the inserted node is a block. If not block and the ask is to insert on new line,\n // add a DIV wrapping\n if (insertedNode && option.insertOnNewLine && !isBlockElement(insertedNode)) {\n wrap(insertedNode);\n }\n break;\n case ContentPosition.Range:\n case ContentPosition.SelectionStart:\n let { range, rangeToRestore } = getInitialRange(selection, option);\n if (!range) {\n break;\n }\n\n // if to replace the selection and the selection is not collapsed, remove the the content at selection first\n if (option.replaceSelection && !range.collapsed) {\n range.deleteContents();\n }\n\n let pos: NodePosition = Position.getStart(range);\n let blockElement: BlockElement | null;\n\n if (option.insertOnNewLine && option.insertToRegionRoot) {\n pos = adjustInsertPositionRegionRoot(contentDiv, range, pos);\n } else if (\n option.insertOnNewLine &&\n (blockElement = getBlockElementAtNode(contentDiv, pos.normalize().node))\n ) {\n pos = adjustInsertPositionNewLine(blockElement, contentDiv, pos);\n } else {\n pos = adjustInsertPosition(contentDiv, node, pos, range);\n }\n\n const nodeForCursor =\n node.nodeType == NodeType.DocumentFragment ? node.lastChild : node;\n\n range = createRange(pos);\n range.insertNode(node);\n\n if (option.updateCursor && nodeForCursor) {\n rangeToRestore = createRange(\n new Position(nodeForCursor, PositionType.After).normalize()\n );\n }\n\n return rangeToRestore\n ? {\n type: 'range',\n range: rangeToRestore,\n isReverted: false,\n }\n : undefined;\n }\n}\n\nfunction adjustInsertPositionRegionRoot(\n contentDiv: HTMLDivElement,\n range: Range,\n position: NodePosition\n) {\n const region = getRegionsFromRange(contentDiv, range, RegionType.Table)[0];\n let node: Node | null = position.node;\n\n if (region) {\n if (node.nodeType == NodeType.Text && !position.isAtEnd) {\n node = splitTextNode(node as Text, position.offset, true /*returnFirstPart*/);\n }\n\n if (node != region.rootNode) {\n while (node && node.parentNode != region.rootNode) {\n splitParentNode(node, false /*splitBefore*/);\n node = node.parentNode;\n }\n }\n\n if (node) {\n position = new Position(node, PositionType.After);\n }\n }\n\n return position;\n}\n\nfunction adjustInsertPositionNewLine(\n blockElement: BlockElement,\n contentDiv: HTMLDivElement,\n pos: Position\n) {\n let tempPos = new Position(blockElement.getEndNode(), PositionType.After);\n if (safeInstanceOf(tempPos.node, 'HTMLTableRowElement')) {\n const div = contentDiv.ownerDocument.createElement('div');\n const range = createRange(pos);\n range.insertNode(div);\n tempPos = new Position(div, PositionType.Begin);\n }\n return tempPos;\n}\n","import { createRange } from 'roosterjs-editor-dom';\nimport { createTableRanges } from 'roosterjs-content-model-core';\nimport { SelectionRangeTypes } from 'roosterjs-editor-types';\nimport type { DOMSelection } from 'roosterjs-content-model-types';\nimport type { SelectionRangeEx } from 'roosterjs-editor-types';\n\n// In theory, all functions below are not necessary. We keep these functions here only for compatibility with old IEditor interface\n\n/**\n * @internal\n */\nexport function convertRangeExToDomSelection(\n rangeEx: SelectionRangeEx | null\n): DOMSelection | null {\n switch (rangeEx?.type) {\n case SelectionRangeTypes.ImageSelection:\n return {\n type: 'image',\n image: rangeEx.image,\n };\n\n case SelectionRangeTypes.Normal:\n return rangeEx.ranges.length > 0\n ? {\n type: 'range',\n range: rangeEx.ranges[0],\n isReverted: false,\n }\n : null;\n\n case SelectionRangeTypes.TableSelection:\n return rangeEx.coordinates\n ? {\n type: 'table',\n table: rangeEx.table,\n firstColumn: rangeEx.coordinates.firstCell.x,\n firstRow: rangeEx.coordinates.firstCell.y,\n lastColumn: rangeEx.coordinates.lastCell.x,\n lastRow: rangeEx.coordinates.lastCell.y,\n }\n : null;\n\n default:\n return null;\n }\n}\n\n/**\n * @internal\n */\nexport function convertDomSelectionToRangeEx(selection: DOMSelection | null): SelectionRangeEx {\n switch (selection?.type) {\n case 'image':\n return {\n type: SelectionRangeTypes.ImageSelection,\n image: selection.image,\n areAllCollapsed: false,\n ranges: [createRange(selection.image)],\n };\n\n case 'range':\n return {\n type: SelectionRangeTypes.Normal,\n ranges: [selection.range],\n areAllCollapsed: selection.range.collapsed,\n };\n\n case 'table':\n return {\n type: SelectionRangeTypes.TableSelection,\n ranges: createTableRanges(selection),\n areAllCollapsed: false,\n table: selection.table,\n coordinates: {\n firstCell: { x: selection.firstColumn, y: selection.firstRow },\n lastCell: { x: selection.lastColumn, y: selection.lastRow },\n },\n };\n\n default:\n return {\n type: SelectionRangeTypes.Normal,\n ranges: [],\n areAllCollapsed: true,\n };\n }\n}\n","module.exports = __WEBPACK_EXTERNAL_MODULE__839__;","module.exports = __WEBPACK_EXTERNAL_MODULE__993__;","/******************************************************************************\nCopyright (c) Microsoft Corporation.\n\nPermission to use, copy, modify, and/or distribute this software for any\npurpose with or without fee is hereby granted.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\nPERFORMANCE OF THIS SOFTWARE.\n***************************************************************************** */\n/* global Reflect, Promise */\n\nvar extendStatics = function(d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n};\n\nexport function __extends(d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n}\n\nexport var __assign = function() {\n __assign = Object.assign || function __assign(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n return t;\n }\n return __assign.apply(this, arguments);\n}\n\nexport function __rest(s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n}\n\nexport function __decorate(decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n}\n\nexport function __param(paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n}\n\nexport function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\n function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\n var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\n var _, done = false;\n for (var i = decorators.length - 1; i >= 0; i--) {\n var context = {};\n for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\n context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\n var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\n if (kind === \"accessor\") {\n if (result === void 0) continue;\n if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\n if (_ = accept(result.get)) descriptor.get = _;\n if (_ = accept(result.set)) descriptor.set = _;\n if (_ = accept(result.init)) initializers.unshift(_);\n }\n else if (_ = accept(result)) {\n if (kind === \"field\") initializers.unshift(_);\n else descriptor[key] = _;\n }\n }\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\n done = true;\n};\n\nexport function __runInitializers(thisArg, initializers, value) {\n var useValue = arguments.length > 2;\n for (var i = 0; i < initializers.length; i++) {\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\n }\n return useValue ? value : void 0;\n};\n\nexport function __propKey(x) {\n return typeof x === \"symbol\" ? x : \"\".concat(x);\n};\n\nexport function __setFunctionName(f, name, prefix) {\n if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\n return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\n};\n\nexport function __metadata(metadataKey, metadataValue) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\n}\n\nexport function __awaiter(thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n}\n\nexport function __generator(thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n}\n\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n});\n\nexport function __exportStar(m, o) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\n}\n\nexport function __values(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n}\n\nexport function __read(o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n}\n\n/** @deprecated */\nexport function __spread() {\n for (var ar = [], i = 0; i < arguments.length; i++)\n ar = ar.concat(__read(arguments[i]));\n return ar;\n}\n\n/** @deprecated */\nexport function __spreadArrays() {\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\n r[k] = a[j];\n return r;\n}\n\nexport function __spreadArray(to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n}\n\nexport function __await(v) {\n return this instanceof __await ? (this.v = v, this) : new __await(v);\n}\n\nexport function __asyncGenerator(thisArg, _arguments, generator) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\n function fulfill(value) { resume(\"next\", value); }\n function reject(value) { resume(\"throw\", value); }\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\n}\n\nexport function __asyncDelegator(o) {\n var i, p;\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\n}\n\nexport function __asyncValues(o) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var m = o[Symbol.asyncIterator], i;\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\n}\n\nexport function __makeTemplateObject(cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\n\nvar __setModuleDefault = Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n};\n\nexport function __importStar(mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n}\n\nexport function __importDefault(mod) {\n return (mod && mod.__esModule) ? mod : { default: mod };\n}\n\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n}\n\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n}\n\nexport function __classPrivateFieldIn(state, receiver) {\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\n}\n\nexport default {\n __extends,\n __assign,\n __rest,\n __decorate,\n __param,\n __metadata,\n __awaiter,\n __generator,\n __createBinding,\n __exportStar,\n __values,\n __read,\n __spread,\n __spreadArrays,\n __spreadArray,\n __await,\n __asyncGenerator,\n __asyncDelegator,\n __asyncValues,\n __makeTemplateObject,\n __importStar,\n __importDefault,\n __classPrivateFieldGet,\n __classPrivateFieldSet,\n __classPrivateFieldIn,\n};\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","export { EditorAdapterOptions } from './publicTypes/EditorAdapterOptions';\nexport { BeforePasteAdapterEvent } from './publicTypes/BeforePasteAdapterEvent';\n\nexport { EditorAdapter } from './editor/EditorAdapter';\n"],"names":["onInitialize","legacyPlugins","experimentalFeatures","editPlugin","createEditPlugin","this","filter","x","edit","getState","contextMenuProviders","isContextMenuProvider","checkExclusivelyHandling","some","plugin","willHandleEventExclusively","getName","initialize","editor","outerEditor","createEditorCore","forEach","dispose","i","length","event","cacheGetExclusivelyHandlePlugin","onPluginEvent","oldEvent","cacheGetOldEvent","exclusivelyHandleEventPlugin","Object","assign","oldEventToNewEvent","getContextMenuItems","target","allItems","provider","items","push","cacheGetEventData","newEventToOldEvent","customData","sizeTransformer","createSizeTransformer","darkColorHandler","createDarkColorHandler","getColorManager","size","getDOMHelper","calculateZoomScale","source","BridgePlugin","state","features","hasFunctionKey","ctrlOrMeta","isKeyDownEvent","eventType","rawEvent","range","getSelectionRange","isCtrlOrMetaPressed","altKey","which","collapsed","feature","allowFunctionKeys","shouldHandleEvent","handleEvent","handledByEditFeature","EditPlugin","VARIABLE_REGEX","innerHandler","getKnownColorsCopy","values","knownColors","registerColor","lightModeColor","isDarkMode","darkModeColor","colorKey","parsedColor","parseColorValue","key","replace","updateKnownColor","getDarkColor","reset","color","isInDarkMode","match","startsWith","exec","findLightColorFromDarkColor","darkColor","rgbSearch","parseColor","getObjectKeys","find","rgbCurrent","transformElementColor","element","fromDarkMode","toDarkMode","textColor","getColor","backColor","setColor","DarkColorHandlerImpl","GetContentModeMap","contentDiv","options","bridgePlugin","core","contentModelEditorCore","plugins","initContent","initialContent","innerHTML","initialModel","createModelFromHtml","defaultDomToModelOptions","trustedHTMLHandler","defaultSegmentFormat","standaloneEditorOptions","data","disposer","value","undefined","isDisposed","insertNode","node","option","position","insertOnNewLine","updateCursor","replaceSelection","insertToRegionRoot","physicalRoot","getCore","focus","parentNode","insertBefore","nextSibling","transformColor","selection","getDOMSelection","setDOMSelection","deleteNode","contains","removeChild","replaceNode","existingNode","toNode","transformColorForDarkMode","lifecycle","transformToDarkColor","replaceChild","getBlockElementAtNode","logicalRoot","arg","queryElements","selector","scopeOrCallback","callback","result","scope","Function","selectionEx","getSelectionRangeEx","ranges","collapseNodes","start","end","canSplitParent","isEmpty","trim","isNodeEmpty","getContent","mode","exportContent","environment","modelToDomSettings","customized","setContent","content","triggerContentChangedEvent","api","triggerEvent","newContent","newModel","domToModelSettings","format","defaultFormat","setContentModel","insertContent","doc","getDocument","body","DOMParser","parseFromString","allNodes","childNodes","toArray","wrap","createDocumentFragment","appendChild","deleteSelectedContent","paste","clipboardData","pasteAsText","applyCurrentFormat","pasteAsImage","tryGetFromCache","type","convertDomSelectionToRangeEx","getSelectionPath","select","arg1","arg2","arg3","arg4","rangeEx","buildRangeEx","convertRangeExToDomSelection","getFocusedPosition","sel","defaultView","getSelection","focusNode","Position","focusOffset","getStart","getElementAtCursor","startFrom","findClosestElementAncestor","isPositionAtBeginning","isPositionAtBeginningOf","getSelectedRegions","getRegionsFromRange","index","self","indexOf","addDomEventHandler","nameOrMap","handler","eventsMap","eventsMapResult","handlerObj","pluginEventType","beforeDispatch","OldEventTypeToNewEventType","record","attachDomEvent","triggerPluginEvent","broadcast","newEvent","undo","redo","addUndoSnapshot","changeSource","canUndoByBackspace","additionalData","undoState","isNested","snapshotsManager","hasNewContent","getEntityState","normalize","getEnd","entityStates","posContainer","startContainer","posOffset","startOffset","getUndoState","canUndo","canMove","canRedo","getCustomData","getter","getContentModelEditorCore","getDefaultFormat","bold","isBold","fontWeight","italic","underline","fontFamily","fontSize","backgroundColor","getBodyTraverser","startNode","ContentTraverser","createBodyTraverser","getSelectionTraverser","createSelectionTraverser","getBlockTraverser","createBlockTraverser","getContentSearcherOfCursor","PositionContentSearcher","runAsync","win","ownerDocument","window","handle","requestAnimationFrame","cancelAnimationFrame","setEditorDomAttribute","name","setDomAttribute","getEditorDomAttribute","getDomAttribute","getRelativeDistanceToEditor","addScroll","editorRect","getBoundingClientRect","elementRect","left","y","top","scrollLeft","scrollTop","addContentEditFeature","keys","array","removeContentEditFeature","featureSet","splice","getStyleBasedFormatState","retrieveFormatState","direction","fontName","lineHeight","marginBottom","marginTop","textAlign","getPendableFormatState","isItalic","isStrikeThrough","isSubscript","isSuperscript","isUnderline","ensureTypeInContainer","keyboardEvent","isFeatureEnabled","getZoomScale","setZoomScale","scale","newZoomScale","getSizeTransformer","getDarkColorHandler","isInIME","domEvent","pendingFormat","getPendingFormat","model","getContentModelCopy","retrieveModelFormatState","Error","Editor","EditorAdapter","root","path","obj","Array","isArray","isSelectionRangeEx","safeInstanceOf","firstCell","lastCell","areAllCollapsed","table","coordinates","image","createRange","pos","offset","isNodePosition","PasteTypeNewToOld","asImage","asPlainText","mergeFormat","normal","PasteTypeOldToNew","KnownAnnounceStringsOldToNew","KnownAnnounceStringsNewToOld","announceListItemBullet","announceListItemNumbering","announceOnFocusLastCell","EntityOperationOldToNew","EntityOperationNewToOld","newEntity","overwrite","removeFromEnd","removeFromStart","replaceTemporaryContent","updateEntityState","click","input","refEvent","clonedRoot","eventDataCache","isCut","refBeforePasteEvent","cmBeforePasteEvent","customizedMerge","domToModelOption","additionalAllowedTags","additionalDisallowedTags","additionalFormatParsers","formatParserOverride","processorOverride","styleSanitizers","attributeSanitizers","fragment","htmlAfter","htmlAttributes","htmlBefore","pasteType","refContentChangedEvent","changedEntities","contentModel","formatApiName","announceData","getAnnounceData","defaultStrings","formatStrings","text","newSrc","originalSrc","previousSrc","operation","entity","shouldPersist","isClicking","scrollContainer","refSelectionChangedEvent","newSelection","selectionRangeEx","sanitizingOption","createDefaultHtmlSanitizerOptions","refEnteredShadowEditEvent","document","selectionPath","oldZoomScale","isBegin","block","getFirstLastBlockElement","refNode","getStartNode","getEndNode","nodeType","isVoidHtmlElement","firstChild","nodes","isBlockElement","insertedNode","rangeToRestore","cloneRange","getInitialRange","deleteContents","blockElement","region","isAtEnd","splitTextNode","rootNode","splitParentNode","adjustInsertPositionRegionRoot","tempPos","div","createElement","adjustInsertPositionNewLine","adjustInsertPosition","nodeForCursor","lastChild","isReverted","firstColumn","firstRow","lastColumn","lastRow","createTableRanges","module","exports","__WEBPACK_EXTERNAL_MODULE__839__","__WEBPACK_EXTERNAL_MODULE__993__","extendStatics","d","b","setPrototypeOf","__proto__","p","prototype","hasOwnProperty","call","__extends","TypeError","String","__","constructor","create","__assign","t","s","n","arguments","apply","__rest","e","getOwnPropertySymbols","propertyIsEnumerable","__decorate","decorators","desc","c","r","getOwnPropertyDescriptor","Reflect","decorate","defineProperty","__param","paramIndex","decorator","__esDecorate","ctor","descriptorIn","contextIn","initializers","extraInitializers","accept","f","_","kind","descriptor","done","context","access","addInitializer","get","set","init","unshift","__runInitializers","thisArg","useValue","__propKey","concat","__setFunctionName","prefix","description","configurable","__metadata","metadataKey","metadataValue","metadata","__awaiter","_arguments","P","generator","Promise","resolve","reject","fulfilled","step","next","rejected","then","__generator","g","label","sent","trys","ops","verb","Symbol","iterator","v","op","pop","__createBinding","o","m","k","k2","__esModule","writable","enumerable","__exportStar","__values","__read","ar","error","__spread","__spreadArrays","il","a","j","jl","__spreadArray","to","from","pack","l","slice","__await","__asyncGenerator","asyncIterator","q","resume","fulfill","settle","shift","__asyncDelegator","__asyncValues","__makeTemplateObject","cooked","raw","__setModuleDefault","__importStar","mod","__importDefault","default","__classPrivateFieldGet","receiver","has","__classPrivateFieldSet","__classPrivateFieldIn","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","__webpack_modules__","definition","prop","toStringTag"],"sourceRoot":""}
|