Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Graduate feature ContentModelPaste #2102

Merged
merged 2 commits into from
Sep 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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