Skip to content
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 @@ -118,6 +118,8 @@ export const CommentsPlugin = Extension.create({
let shouldUpdate;
let activeThreadId;

if (editor.options.isHeadless) return [];

const commentsPlugin = new Plugin({
key: CommentsPluginKey,

Expand Down
54 changes: 37 additions & 17 deletions packages/super-editor/src/extensions/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,23 +55,43 @@ import { LinkedStyles } from './linked-styles/linked-styles.js';
// Helpers
import { trackChangesHelpers } from './track-changes/index.js';

const getRichTextExtensions = () => [
Bold,
Color,
Document,
History,
Italic,
Link,
Paragraph,
Strike,
Text,
TextStyle,
Underline,
Placeholder,
PopoverPlugin,
Mention,
Highlight,
];
const getRichTextExtensions = () => {
return [
Bold,
Color,
Document,
FontFamily,
FontSize,
History,
Heading,
Italic,
LineHeight,
Link,
Paragraph,
LineBreak,
HardBreak,
Strike,
Text,
TextAlign,
TextIndent,
TextStyle,
Underline,
Placeholder,
PopoverPlugin,
Mention,
Highlight,
FormatCommands,
Table,
TableRow,
TableCell,
TableHeader,
FieldAnnotation,
DropCursor,
TrackInsert,
TrackDelete,
TrackFormat,
];
};

const getStarterExtensions = () => {
return [
Expand Down
11 changes: 11 additions & 0 deletions packages/super-editor/src/extensions/paragraph/paragraph.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,17 @@ export const Paragraph = Node.create({
},
filename: { rendered: false },
rsidRDefault: { rendered: false },

// Experimental
isEditable: {
renderDOM: ({ isEditable }) => {
let style = '';
if (isEditable === false) {
style = 'opacity: 0.5; cursor: default; pointer-events: none; user-select: none;';
}
return { style, contenteditable: isEditable === false ? false : true };
},
}
};
},

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ export const getExportedResult = async (name, comments = []) => {
extensions: getStarterExtensions(),
documentId: 'test-doc',
content: docx,
mode: 'docx',
media,
mediaFiles,
fonts,
Expand Down