Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
zbeyens committed Oct 2, 2023
1 parent d02fb62 commit 663f789
Show file tree
Hide file tree
Showing 4 changed files with 418 additions and 417 deletions.
225 changes: 113 additions & 112 deletions apps/www/src/registry/default/example/playground-demo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -126,124 +126,125 @@ export const usePlaygroundPlugins = ({

return useMemo(
() => {
const plugins = [
// Nodes
createParagraphPlugin({ enabled: !!enabled.p }),
createHeadingPlugin({ enabled: !!enabled.heading }),
createBlockquotePlugin({ enabled: !!enabled.blockquote }),
createCodeBlockPlugin({ enabled: !!enabled.code_block }),
createHorizontalRulePlugin({ enabled: !!enabled.hr }),
createLinkPlugin({ ...linkPlugin, enabled: !!enabled.a }),
createListPlugin({
enabled: id === 'list' || !!enabled.list,
}),
createImagePlugin({ enabled: !!enabled.img }),
createMediaEmbedPlugin({ enabled: !!enabled.media_embed }),
createCaptionPlugin({ ...captionPlugin, enabled: !!enabled.caption }),
createMentionPlugin({
enabled: !!enabled.mention,
options: {
triggerPreviousCharPattern: /^$|^[\s"']$/,
},
}),
createTablePlugin({ enabled: !!enabled.table }),
createTodoListPlugin({ enabled: !!enabled.action_item }),
createExcalidrawPlugin({ enabled: !!enabled.excalidraw }),
return createPlugins(
[
// Nodes
createParagraphPlugin({ enabled: !!enabled.p }),
createHeadingPlugin({ enabled: !!enabled.heading }),
createBlockquotePlugin({ enabled: !!enabled.blockquote }),
createCodeBlockPlugin({ enabled: !!enabled.code_block }),
createHorizontalRulePlugin({ enabled: !!enabled.hr }),
createLinkPlugin({ ...linkPlugin, enabled: !!enabled.a }),
createListPlugin({
enabled: id === 'list' || !!enabled.list,
}),
createImagePlugin({ enabled: !!enabled.img }),
createMediaEmbedPlugin({ enabled: !!enabled.media_embed }),
createCaptionPlugin({ ...captionPlugin, enabled: !!enabled.caption }),
createMentionPlugin({
enabled: !!enabled.mention,
options: {
triggerPreviousCharPattern: /^$|^[\s"']$/,
},
}),
createTablePlugin({ enabled: !!enabled.table }),
createTodoListPlugin({ enabled: !!enabled.action_item }),
createExcalidrawPlugin({ enabled: !!enabled.excalidraw }),

// Marks
createBoldPlugin({ enabled: !!enabled.bold }),
createItalicPlugin({ enabled: !!enabled.italic }),
createUnderlinePlugin({ enabled: !!enabled.underline }),
createStrikethroughPlugin({ enabled: !!enabled.strikethrough }),
createCodePlugin({ enabled: !!enabled.code }),
createSubscriptPlugin({ enabled: !!enabled.subscript }),
createSuperscriptPlugin({ enabled: !!enabled.superscript }),
createFontColorPlugin({ enabled: !!enabled.color }),
createFontBackgroundColorPlugin({
enabled: !!enabled.backgroundColor,
}),
createFontSizePlugin({ enabled: !!enabled.fontSize }),
createHighlightPlugin({ enabled: !!enabled.highlight }),
createKbdPlugin({ enabled: !!enabled.kbd }),
// Marks
createBoldPlugin({ enabled: !!enabled.bold }),
createItalicPlugin({ enabled: !!enabled.italic }),
createUnderlinePlugin({ enabled: !!enabled.underline }),
createStrikethroughPlugin({ enabled: !!enabled.strikethrough }),
createCodePlugin({ enabled: !!enabled.code }),
createSubscriptPlugin({ enabled: !!enabled.subscript }),
createSuperscriptPlugin({ enabled: !!enabled.superscript }),
createFontColorPlugin({ enabled: !!enabled.color }),
createFontBackgroundColorPlugin({
enabled: !!enabled.backgroundColor,
}),
createFontSizePlugin({ enabled: !!enabled.fontSize }),
createHighlightPlugin({ enabled: !!enabled.highlight }),
createKbdPlugin({ enabled: !!enabled.kbd }),

// Block Style
createAlignPlugin({ ...alignPlugin, enabled: !!enabled.align }),
createIndentPlugin({ ...indentPlugin, enabled: !!enabled.indent }),
createIndentListPlugin({
...indentPlugin,
enabled: id === 'indentlist' || !!enabled.listStyleType,
}),
createLineHeightPlugin({
...lineHeightPlugin,
enabled: !!enabled.lineHeight,
}),
// Block Style
createAlignPlugin({ ...alignPlugin, enabled: !!enabled.align }),
createIndentPlugin({ ...indentPlugin, enabled: !!enabled.indent }),
createIndentListPlugin({
...indentPlugin,
enabled: id === 'indentlist' || !!enabled.listStyleType,
}),
createLineHeightPlugin({
...lineHeightPlugin,
enabled: !!enabled.lineHeight,
}),

// Functionality
createAutoformatPlugin({
enabled: !!enabled.autoformat,
options: autoformatOptions,
}),
createBlockSelectionPlugin({
options: {
sizes: {
top: 0,
bottom: 0,
// Functionality
createAutoformatPlugin({
enabled: !!enabled.autoformat,
options: autoformatOptions,
}),
createBlockSelectionPlugin({
options: {
sizes: {
top: 0,
bottom: 0,
},
},
},
enabled: id === 'blockselection' || !!enabled.blockSelection,
}),
createComboboxPlugin({ enabled: !!enabled.combobox }),
createDndPlugin({
options: { enableScroller: true },
enabled: !!enabled.dnd,
}),
createEmojiPlugin({ ...emojiPlugin, enabled: !!enabled.emoji }),
createExitBreakPlugin({
...exitBreakPlugin,
enabled: !!enabled.exitBreak,
}),
createNodeIdPlugin({ enabled: !!enabled.nodeId }),
createNormalizeTypesPlugin({
...forcedLayoutPlugin,
enabled: !!enabled.normalizeTypes,
}),
createResetNodePlugin({
...resetBlockTypePlugin,
enabled: !!enabled.resetNode,
}),
createSelectOnBackspacePlugin({
...selectOnBackspacePlugin,
enabled: !!enabled.selectOnBackspace,
}),
createSingleLinePlugin({
enabled: id === 'singleline' || !!enabled.singleLine,
}),
createSoftBreakPlugin({
...softBreakPlugin,
enabled: !!enabled.softBreak,
}),
createTabbablePlugin({
...tabbablePlugin,
enabled: !!enabled.tabbable,
}),
createTrailingBlockPlugin({
...trailingBlockPlugin,
enabled: id !== 'singleline' && !!enabled.trailingBlock,
}),
{ ...dragOverCursorPlugin, enabled: !!enabled.dragOverCursor },

// Collaboration
createCommentsPlugin({ enabled: !!enabled.comment }),
enabled: id === 'blockselection' || !!enabled.blockSelection,
}),
createComboboxPlugin({ enabled: !!enabled.combobox }),
createDndPlugin({
options: { enableScroller: true },
enabled: !!enabled.dnd,
}),
createEmojiPlugin({ ...emojiPlugin, enabled: !!enabled.emoji }),
createExitBreakPlugin({
...exitBreakPlugin,
enabled: !!enabled.exitBreak,
}),
createNodeIdPlugin({ enabled: !!enabled.nodeId }),
createNormalizeTypesPlugin({
...forcedLayoutPlugin,
enabled: !!enabled.normalizeTypes,
}),
createResetNodePlugin({
...resetBlockTypePlugin,
enabled: !!enabled.resetNode,
}),
createSelectOnBackspacePlugin({
...selectOnBackspacePlugin,
enabled: !!enabled.selectOnBackspace,
}),
createSingleLinePlugin({
enabled: id === 'singleline' || !!enabled.singleLine,
}),
createSoftBreakPlugin({
...softBreakPlugin,
enabled: !!enabled.softBreak,
}),
createTabbablePlugin({
...tabbablePlugin,
enabled: !!enabled.tabbable,
}),
createTrailingBlockPlugin({
...trailingBlockPlugin,
enabled: id !== 'singleline' && !!enabled.trailingBlock,
}),
{ ...dragOverCursorPlugin, enabled: !!enabled.dragOverCursor },

// Deserialization
createDeserializeDocxPlugin({ enabled: !!enabled.deserializeDocx }),
createDeserializeMdPlugin({ enabled: !!enabled.deserializeMd }),
createJuicePlugin({ enabled: !!enabled.juice }),
];
// Collaboration
createCommentsPlugin({ enabled: !!enabled.comment }),

return createPlugins(plugins, {
components,
});
// Deserialization
createDeserializeDocxPlugin({ enabled: !!enabled.deserializeDocx }),
createDeserializeMdPlugin({ enabled: !!enabled.deserializeMd }),
createJuicePlugin({ enabled: !!enabled.juice }),
],
{
components,
}
);
},
// eslint-disable-next-line react-hooks/exhaustive-deps
[enabled]
Expand Down
84 changes: 42 additions & 42 deletions templates/plate-playground-template/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,48 +23,48 @@
"@radix-ui/react-toggle": "^1.0.3",
"@radix-ui/react-toolbar": "^1.0.4",
"@radix-ui/react-tooltip": "^1.0.6",
"@udecode/plate-alignment": "^24.3.1",
"@udecode/plate-autoformat": "^24.3.1",
"@udecode/plate-basic-marks": "^24.3.1",
"@udecode/plate-block-quote": "^24.3.1",
"@udecode/plate-break": "^24.3.1",
"@udecode/plate-caption": "^24.3.1",
"@udecode/plate-code-block": "^24.3.1",
"@udecode/plate-combobox": "^24.3.1",
"@udecode/plate-comments": "^24.3.1",
"@udecode/plate-common": "^24.3.1",
"@udecode/plate-cursor": "^24.3.1",
"@udecode/plate-dnd": "^24.3.1",
"@udecode/plate-emoji": "^24.3.1",
"@udecode/plate-excalidraw": "^24.3.1",
"@udecode/plate-floating": "^24.3.1",
"@udecode/plate-font": "^24.3.1",
"@udecode/plate-heading": "^24.3.1",
"@udecode/plate-highlight": "^24.3.1",
"@udecode/plate-horizontal-rule": "^24.3.1",
"@udecode/plate-indent": "^24.3.1",
"@udecode/plate-indent-list": "^24.3.1",
"@udecode/plate-juice": "^24.3.1",
"@udecode/plate-kbd": "^24.3.1",
"@udecode/plate-line-height": "^24.3.1",
"@udecode/plate-link": "^24.3.1",
"@udecode/plate-list": "^24.3.1",
"@udecode/plate-media": "^24.3.1",
"@udecode/plate-mention": "^24.3.1",
"@udecode/plate-node-id": "^24.3.1",
"@udecode/plate-normalizers": "^24.3.1",
"@udecode/plate-paragraph": "^24.3.1",
"@udecode/plate-reset-node": "^24.3.1",
"@udecode/plate-resizable": "^24.3.1",
"@udecode/plate-select": "^24.3.1",
"@udecode/plate-selection": "^24.3.1",
"@udecode/plate-serializer-csv": "^24.3.1",
"@udecode/plate-serializer-docx": "^24.3.1",
"@udecode/plate-serializer-html": "^24.3.1",
"@udecode/plate-serializer-md": "^24.3.1",
"@udecode/plate-tabbable": "^24.3.1",
"@udecode/plate-table": "^24.3.1",
"@udecode/plate-trailing-block": "^24.3.1",
"@udecode/plate-alignment": "^24.3.2",
"@udecode/plate-autoformat": "^24.3.2",
"@udecode/plate-basic-marks": "^24.3.2",
"@udecode/plate-block-quote": "^24.3.2",
"@udecode/plate-break": "^24.3.2",
"@udecode/plate-caption": "^24.3.3",
"@udecode/plate-code-block": "^24.3.2",
"@udecode/plate-combobox": "^24.3.2",
"@udecode/plate-comments": "^24.3.2",
"@udecode/plate-common": "^24.3.2",
"@udecode/plate-cursor": "^24.3.2",
"@udecode/plate-dnd": "^24.3.2",
"@udecode/plate-emoji": "^24.3.2",
"@udecode/plate-excalidraw": "^24.3.2",
"@udecode/plate-floating": "^24.3.2",
"@udecode/plate-font": "^24.3.2",
"@udecode/plate-heading": "^24.3.2",
"@udecode/plate-highlight": "^24.3.2",
"@udecode/plate-horizontal-rule": "^24.3.2",
"@udecode/plate-indent": "^24.3.2",
"@udecode/plate-indent-list": "^24.3.2",
"@udecode/plate-juice": "^24.3.2",
"@udecode/plate-kbd": "^24.3.2",
"@udecode/plate-line-height": "^24.3.2",
"@udecode/plate-link": "^24.3.2",
"@udecode/plate-list": "^24.3.2",
"@udecode/plate-media": "^24.3.2",
"@udecode/plate-mention": "^24.3.2",
"@udecode/plate-node-id": "^24.3.2",
"@udecode/plate-normalizers": "^24.3.2",
"@udecode/plate-paragraph": "^24.3.2",
"@udecode/plate-reset-node": "^24.3.2",
"@udecode/plate-resizable": "^24.3.2",
"@udecode/plate-select": "^24.3.2",
"@udecode/plate-selection": "^24.3.2",
"@udecode/plate-serializer-csv": "^24.3.2",
"@udecode/plate-serializer-docx": "^24.3.2",
"@udecode/plate-serializer-html": "^24.3.2",
"@udecode/plate-serializer-md": "^24.3.3",
"@udecode/plate-tabbable": "^24.3.2",
"@udecode/plate-table": "^24.3.2",
"@udecode/plate-trailing-block": "^24.3.2",
"class-variance-authority": "0.7.0",
"clsx": "2.0.0",
"cmdk": "0.2.0",
Expand Down
Loading

0 comments on commit 663f789

Please sign in to comment.