Skip to content

Commit

Permalink
Graduate feature ContentModelPaste (#2102)
Browse files Browse the repository at this point in the history
  • Loading branch information
JiuqingSong authored Sep 26, 2023
1 parent cff7811 commit 897d4d2
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,7 @@ const initialState: BuildInPluginState = {
linkTitle: 'Ctrl+Click to follow the link:' + UrlPlaceholder,
watermarkText: 'Type content here ...',
forcePreserveRatio: false,
experimentalFeatures: [
ExperimentalFeatures.ContentModelPaste,
ExperimentalFeatures.ReusableContentModelV2,
],
experimentalFeatures: [ExperimentalFeatures.ReusableContentModelV2],
isRtl: false,
tableFeaturesContainerSelector: '#' + 'EditorContainer',
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ const FeatureNames: Partial<Record<ExperimentalFeatures, string>> = {
"Reuse ancestor list elements even if they don't match the types from the list item.",
[ExperimentalFeatures.DeleteTableWithBackspace]:
'Delete a table selected with the table selector pressing Backspace key',
[ExperimentalFeatures.ContentModelPaste]: 'Paste with content model',
[ExperimentalFeatures.DisableListChain]: 'Disable list chain functionality',
[ExperimentalFeatures.ReusableContentModelV2]:
'Reuse existing DOM structure if possible, and update the model when content or selection is changed',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,8 @@ export const createContentModelEditorCore: CoreCreator<
],
corePluginOverride: {
typeInContainer: new ContentModelTypeInContainerPlugin(),
copyPaste: isFeatureEnabled(
options.experimentalFeatures,
ExperimentalFeatures.ContentModelPaste
)
? new ContentModelCopyPastePlugin(pluginState.copyPaste)
: undefined,
...(options.corePluginOverride || {}),
copyPaste: new ContentModelCopyPastePlugin(pluginState.copyPaste),
...options.corePluginOverride,
},
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import ContentModelEditor from '../../../../../lib/editor/ContentModelEditor';
import ContentModelPastePlugin from '../../../../../lib/editor/plugins/PastePlugin/ContentModelPastePlugin';
import { cloneModel } from '../../../../../lib/modelApi/common/cloneModel';
import { ContentModelDocument } from 'roosterjs-content-model-types';
import { ExperimentalFeatures } from 'roosterjs-editor-types';
import {
ContentModelEditorOptions,
IContentModelEditor,
Expand All @@ -15,7 +14,6 @@ export function initEditor(id: string) {

let options: ContentModelEditorOptions = {
plugins: [new ContentModelPastePlugin()],
experimentalFeatures: [ExperimentalFeatures.ContentModelPaste],
};

let editor = new ContentModelEditor(node as HTMLDivElement, options);
Expand Down
11 changes: 6 additions & 5 deletions packages/roosterjs-editor-types/lib/enum/ExperimentalFeatures.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,12 @@ export const enum ExperimentalFeatures {
*/
InlineEntityReadOnlyDelimiters = 'InlineEntityReadOnlyDelimiters',

/**
* @deprecated This feature is always enabled
* Paste with Content model
*/
ContentModelPaste = 'ContentModelPaste',

//#endregion

/**
Expand All @@ -168,11 +174,6 @@ export const enum ExperimentalFeatures {
*/
DeleteTableWithBackspace = 'DeleteTableWithBackspace',

/**
* Paste with Content model
*/
ContentModelPaste = 'ContentModelPaste',

/**
* Disable list chain functionality
*/
Expand Down

0 comments on commit 897d4d2

Please sign in to comment.