@mantine/tiptap 5.8.3 → 5.8.4
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/cjs/Content/Content.styles.js +1 -1
- package/cjs/Content/Content.styles.js.map +1 -1
- package/cjs/RichTextEditor.js +15 -5
- package/cjs/RichTextEditor.js.map +1 -1
- package/esm/Content/Content.styles.js +1 -1
- package/esm/Content/Content.styles.js.map +1 -1
- package/esm/RichTextEditor.js +16 -6
- package/esm/RichTextEditor.js.map +1 -1
- package/lib/RichTextEditor.d.ts +1 -37
- package/lib/RichTextEditor.d.ts.map +1 -1
- package/package.json +4 -4
|
@@ -100,7 +100,7 @@ var useStyles = core.createStyles((theme, { withCodeHighlightStyles, withTypogra
|
|
|
100
100
|
"& .ProseMirror > *:last-child": {
|
|
101
101
|
marginBottom: 0
|
|
102
102
|
},
|
|
103
|
-
"& .ProseMirror p.is-editor-empty:first-
|
|
103
|
+
"& .ProseMirror p.is-editor-empty:first-of-type::before": {
|
|
104
104
|
content: "attr(data-placeholder)",
|
|
105
105
|
userSelect: "none",
|
|
106
106
|
float: "left",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Content.styles.js","sources":["../../src/Content/Content.styles.ts"],"sourcesContent":["import { createStyles, MantineTheme } from '@mantine/core';\n\ninterface ContentStylesParams {\n withCodeHighlightStyles: boolean;\n withTypographyStyles: boolean;\n}\n\nfunction getCodeHighlight(withCodeHighlightStyles: boolean, theme: MantineTheme) {\n if (!withCodeHighlightStyles) {\n return null;\n }\n\n const highlightIndex = theme.colorScheme === 'dark' ? 5 : 7;\n\n return {\n pre: {\n background:\n theme.colorScheme === 'dark'\n ? theme.colors.dark[8]\n : theme.fn.rgba(theme.colors.gray[0], 0.65),\n borderRadius: theme.fn.radius(),\n color: theme.colorScheme === 'dark' ? theme.colors.dark[0] : theme.colors.gray[9],\n fontFamily: theme.fontFamilyMonospace,\n padding: `${theme.spacing.md}px ${theme.spacing.xl}px`,\n\n '& code': {\n background: 'none',\n color: 'inherit',\n fontSize: theme.fontSizes.sm,\n padding: 0,\n },\n\n ' & .hljs-comment, & .hljs-quote': {\n color: theme.colorScheme === 'dark' ? theme.colors.dark[2] : theme.colors.gray[5],\n },\n\n '& .hljs-variable, & .hljs-template-variable, & .hljs-attribute, & .hljs-tag, & .hljs-name, & .hljs-regexp, & .hljs-link, & .hljs-name, & .hljs-selector-id, & .hljs-selector-class':\n {\n color: theme.colors.red[highlightIndex],\n },\n\n '& .hljs-number, & .hljs-meta, & .hljs-built_in, & .hljs-builtin-name, & .hljs-literal, & .hljs-type, & .hljs-params':\n {\n color: theme.colors[theme.colorScheme === 'dark' ? 'cyan' : 'blue'][highlightIndex],\n },\n\n '& .hljs-string, & .hljs-symbol, & .hljs-bullet': {\n color: theme.colors.red[highlightIndex],\n },\n\n '& .hljs-title, & .hljs-section': {\n color: theme.colors[theme.colorScheme === 'dark' ? 'yellow' : 'pink'][highlightIndex],\n },\n\n '& .hljs-keyword, & .hljs-selector-tag': {\n color: theme.colors.violet[highlightIndex],\n },\n\n '& .hljs-emphasis': {\n fontStyle: 'italic',\n },\n\n '& .hljs-strong': {\n fontWeight: 700,\n },\n },\n };\n}\n\nfunction getTypographyStyles(withTypographyStyles: boolean) {\n if (!withTypographyStyles) {\n return null;\n }\n\n return {\n '& li > p': {\n margin: 0,\n },\n\n '& ul li, & ol li': {\n marginTop: 2,\n },\n\n '& ul, & ol': {\n marginTop: 5,\n marginBottom: 5,\n },\n\n '& p': {\n marginBottom: 7,\n },\n\n '& h1, & h2, & h3, & h4, & h5, & h6, & p': {\n marginTop: 0,\n },\n };\n}\n\nexport default createStyles(\n (theme, { withCodeHighlightStyles, withTypographyStyles }: ContentStylesParams) => ({\n typographyStylesProvider: {\n ...getTypographyStyles(withTypographyStyles),\n },\n\n content: {\n backgroundColor: theme.colorScheme === 'dark' ? theme.colors.dark[7] : theme.white,\n padding: theme.spacing.md,\n borderRadius: theme.fn.radius(),\n\n '& .ProseMirror': {\n outline: 0,\n },\n\n '& .ProseMirror > *:last-child': {\n marginBottom: 0,\n },\n\n '& .ProseMirror p.is-editor-empty:first-
|
|
1
|
+
{"version":3,"file":"Content.styles.js","sources":["../../src/Content/Content.styles.ts"],"sourcesContent":["import { createStyles, MantineTheme } from '@mantine/core';\n\ninterface ContentStylesParams {\n withCodeHighlightStyles: boolean;\n withTypographyStyles: boolean;\n}\n\nfunction getCodeHighlight(withCodeHighlightStyles: boolean, theme: MantineTheme) {\n if (!withCodeHighlightStyles) {\n return null;\n }\n\n const highlightIndex = theme.colorScheme === 'dark' ? 5 : 7;\n\n return {\n pre: {\n background:\n theme.colorScheme === 'dark'\n ? theme.colors.dark[8]\n : theme.fn.rgba(theme.colors.gray[0], 0.65),\n borderRadius: theme.fn.radius(),\n color: theme.colorScheme === 'dark' ? theme.colors.dark[0] : theme.colors.gray[9],\n fontFamily: theme.fontFamilyMonospace,\n padding: `${theme.spacing.md}px ${theme.spacing.xl}px`,\n\n '& code': {\n background: 'none',\n color: 'inherit',\n fontSize: theme.fontSizes.sm,\n padding: 0,\n },\n\n ' & .hljs-comment, & .hljs-quote': {\n color: theme.colorScheme === 'dark' ? theme.colors.dark[2] : theme.colors.gray[5],\n },\n\n '& .hljs-variable, & .hljs-template-variable, & .hljs-attribute, & .hljs-tag, & .hljs-name, & .hljs-regexp, & .hljs-link, & .hljs-name, & .hljs-selector-id, & .hljs-selector-class':\n {\n color: theme.colors.red[highlightIndex],\n },\n\n '& .hljs-number, & .hljs-meta, & .hljs-built_in, & .hljs-builtin-name, & .hljs-literal, & .hljs-type, & .hljs-params':\n {\n color: theme.colors[theme.colorScheme === 'dark' ? 'cyan' : 'blue'][highlightIndex],\n },\n\n '& .hljs-string, & .hljs-symbol, & .hljs-bullet': {\n color: theme.colors.red[highlightIndex],\n },\n\n '& .hljs-title, & .hljs-section': {\n color: theme.colors[theme.colorScheme === 'dark' ? 'yellow' : 'pink'][highlightIndex],\n },\n\n '& .hljs-keyword, & .hljs-selector-tag': {\n color: theme.colors.violet[highlightIndex],\n },\n\n '& .hljs-emphasis': {\n fontStyle: 'italic',\n },\n\n '& .hljs-strong': {\n fontWeight: 700,\n },\n },\n };\n}\n\nfunction getTypographyStyles(withTypographyStyles: boolean) {\n if (!withTypographyStyles) {\n return null;\n }\n\n return {\n '& li > p': {\n margin: 0,\n },\n\n '& ul li, & ol li': {\n marginTop: 2,\n },\n\n '& ul, & ol': {\n marginTop: 5,\n marginBottom: 5,\n },\n\n '& p': {\n marginBottom: 7,\n },\n\n '& h1, & h2, & h3, & h4, & h5, & h6, & p': {\n marginTop: 0,\n },\n };\n}\n\nexport default createStyles(\n (theme, { withCodeHighlightStyles, withTypographyStyles }: ContentStylesParams) => ({\n typographyStylesProvider: {\n ...getTypographyStyles(withTypographyStyles),\n },\n\n content: {\n backgroundColor: theme.colorScheme === 'dark' ? theme.colors.dark[7] : theme.white,\n padding: theme.spacing.md,\n borderRadius: theme.fn.radius(),\n\n '& .ProseMirror': {\n outline: 0,\n },\n\n '& .ProseMirror > *:last-child': {\n marginBottom: 0,\n },\n\n '& .ProseMirror p.is-editor-empty:first-of-type::before': {\n content: 'attr(data-placeholder)',\n userSelect: 'none',\n float: 'left',\n height: 0,\n pointerEvents: 'none',\n color: theme.colorScheme === 'dark' ? theme.colors.dark[3] : theme.colors.gray[5],\n },\n\n ...getCodeHighlight(withCodeHighlightStyles, theme),\n },\n })\n);\n"],"names":["createStyles"],"mappings":";;;;;;AAAA,IAAI,SAAS,GAAG,MAAM,CAAC,cAAc,CAAC;AACtC,IAAI,mBAAmB,GAAG,MAAM,CAAC,qBAAqB,CAAC;AACvD,IAAI,YAAY,GAAG,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC;AACnD,IAAI,YAAY,GAAG,MAAM,CAAC,SAAS,CAAC,oBAAoB,CAAC;AACzD,IAAI,eAAe,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,KAAK,KAAK,GAAG,IAAI,GAAG,GAAG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AC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,KAAK;AACtF,IAAI,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC,EAAE;AAC7B,IAAI,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,MAAM,EAAE;AACnC,IAAI,gBAAgB,EAAE;AACtB,MAAM,OAAO,EAAE,CAAC;AAChB,KAAK;AACL,IAAI,+BAA+B,EAAE;AACrC,MAAM,YAAY,EAAE,CAAC;AACrB,KAAK;AACL,IAAI,wDAAwD,EAAE;AAC9D,MAAM,OAAO,EAAE,wBAAwB;AACvC,MAAM,UAAU,EAAE,MAAM;AACxB,MAAM,KAAK,EAAE,MAAM;AACnB,MAAM,MAAM,EAAE,CAAC;AACf,MAAM,aAAa,EAAE,MAAM;AAC3B,MAAM,KAAK,EAAE,KAAK,CAAC,WAAW,KAAK,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;AACvF,KAAK;AACL,GAAG,EAAE,gBAAgB,CAAC,uBAAuB,EAAE,KAAK,CAAC,CAAC;AACtD,CAAC,CAAC,CAAC;;;;"}
|
package/cjs/RichTextEditor.js
CHANGED
|
@@ -21,6 +21,8 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
|
|
|
21
21
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
22
22
|
|
|
23
23
|
var __defProp = Object.defineProperty;
|
|
24
|
+
var __defProps = Object.defineProperties;
|
|
25
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
24
26
|
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
25
27
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
26
28
|
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
@@ -36,6 +38,7 @@ var __spreadValues = (a, b) => {
|
|
|
36
38
|
}
|
|
37
39
|
return a;
|
|
38
40
|
};
|
|
41
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
39
42
|
var __objRest = (source, exclude) => {
|
|
40
43
|
var target = {};
|
|
41
44
|
for (var prop in source)
|
|
@@ -52,7 +55,7 @@ const defaultProps = {
|
|
|
52
55
|
withCodeHighlightStyles: true,
|
|
53
56
|
withTypographyStyles: true
|
|
54
57
|
};
|
|
55
|
-
|
|
58
|
+
const RichTextEditor = React.forwardRef((props, ref) => {
|
|
56
59
|
const _a = core.useComponentDefaultProps("RichTextEditor", defaultProps, props), {
|
|
57
60
|
editor,
|
|
58
61
|
children,
|
|
@@ -74,7 +77,12 @@ function RichTextEditor(props) {
|
|
|
74
77
|
"styles",
|
|
75
78
|
"unstyled"
|
|
76
79
|
]);
|
|
77
|
-
const { classes, cx } = RichTextEditor_styles['default'](null, {
|
|
80
|
+
const { classes, cx } = RichTextEditor_styles['default'](null, {
|
|
81
|
+
name: "RichTextEditor",
|
|
82
|
+
classNames,
|
|
83
|
+
styles,
|
|
84
|
+
unstyled
|
|
85
|
+
});
|
|
78
86
|
const mergedLabels = React.useMemo(() => __spreadValues(__spreadValues({}, labels.DEFAULT_LABELS), labels$1), [labels$1]);
|
|
79
87
|
return /* @__PURE__ */ React__default.createElement(core.StylesApiProvider, {
|
|
80
88
|
classNames,
|
|
@@ -82,10 +90,12 @@ function RichTextEditor(props) {
|
|
|
82
90
|
unstyled
|
|
83
91
|
}, /* @__PURE__ */ React__default.createElement(RichTextEditor_context.RichTextEditorProvider, {
|
|
84
92
|
value: { editor, labels: mergedLabels, withCodeHighlightStyles, withTypographyStyles }
|
|
85
|
-
}, /* @__PURE__ */ React__default.createElement(core.Box, __spreadValues({
|
|
93
|
+
}, /* @__PURE__ */ React__default.createElement(core.Box, __spreadProps(__spreadValues({
|
|
86
94
|
className: cx(classes.root, className)
|
|
87
|
-
}, others),
|
|
88
|
-
|
|
95
|
+
}, others), {
|
|
96
|
+
ref
|
|
97
|
+
}), children)));
|
|
98
|
+
});
|
|
89
99
|
RichTextEditor.Content = Content.Content;
|
|
90
100
|
RichTextEditor.Control = Control.Control;
|
|
91
101
|
RichTextEditor.ControlsGroup = ControlsGroup.ControlsGroup;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RichTextEditor.js","sources":["../src/RichTextEditor.tsx"],"sourcesContent":["/* eslint-disable react/no-unused-prop-types */\nimport React, { useMemo } from 'react';\nimport {\n Box,\n useComponentDefaultProps,\n DefaultProps,\n Selectors,\n StylesApiProvider,\n} from '@mantine/core';\nimport { Editor } from '@tiptap/react';\nimport { RichTextEditorProvider } from './RichTextEditor.context';\nimport * as controls from './controls';\nimport { Content, ContentStylesNames } from './Content/Content';\nimport { Control, ControlStylesNames } from './controls/Control/Control';\nimport { ControlsGroup, ControlsGroupStylesNames } from './controls/ControlsGroup/ControlsGroup';\nimport { Toolbar, ToolbarStylesNames } from './Toolbar/Toolbar';\nimport { LinkControlStylesNames } from './controls/LinkControl/LinkControl';\nimport { DEFAULT_LABELS, RichTextEditorLabels } from './labels';\nimport useStyles from './RichTextEditor.styles';\n\nexport type RichTextEditorStylesNames =\n | Selectors<typeof useStyles>\n | ContentStylesNames\n | ControlStylesNames\n | ControlsGroupStylesNames\n | ToolbarStylesNames\n | LinkControlStylesNames;\n\nexport interface RichTextEditorProps\n extends DefaultProps<RichTextEditorStylesNames>,\n React.ComponentPropsWithoutRef<'div'> {\n /** Tiptap editor instance */\n editor: Editor | null;\n\n /** Determines whether code highlight styles should be added, true by default */\n withCodeHighlightStyles?: boolean;\n\n /** Determines whether typography styles should be added, true by default */\n withTypographyStyles?: boolean;\n\n /** Labels that are used in controls */\n labels?: Partial<RichTextEditorLabels>;\n\n /** Child editor components */\n children: React.ReactNode;\n}\n\nconst defaultProps: Partial<RichTextEditorProps> = {\n withCodeHighlightStyles: true,\n withTypographyStyles: true,\n};\n\nexport function RichTextEditor(props: RichTextEditorProps) {\n const {\n editor,\n children,\n className,\n labels,\n withCodeHighlightStyles,\n withTypographyStyles,\n classNames,\n styles,\n unstyled,\n ...others\n } = useComponentDefaultProps('RichTextEditor', defaultProps, props);\n const { classes, cx } = useStyles(null, { name: 'RichTextEditor', classNames, styles, unstyled });\n const mergedLabels = useMemo(() => ({ ...DEFAULT_LABELS, ...labels }), [labels]);\n\n return (\n <StylesApiProvider classNames={classNames} styles={styles} unstyled={unstyled}>\n <RichTextEditorProvider\n value={{ editor, labels: mergedLabels, withCodeHighlightStyles, withTypographyStyles }}\n >\n <Box className={cx(classes.root, className)} {...others}>\n {children}\n </Box>\n </RichTextEditorProvider>\n </StylesApiProvider>\n );\n}\n\n// Generic components\nRichTextEditor.Content = Content;\nRichTextEditor.Control = Control;\nRichTextEditor.ControlsGroup = ControlsGroup;\nRichTextEditor.Toolbar = Toolbar;\n\n// Controls components\nRichTextEditor.Bold = controls.BoldControl;\nRichTextEditor.Italic = controls.ItalicControl;\nRichTextEditor.Strikethrough = controls.StrikeThroughControl;\nRichTextEditor.Underline = controls.UnderlineControl;\nRichTextEditor.ClearFormatting = controls.ClearFormattingControl;\nRichTextEditor.H1 = controls.H1Control;\nRichTextEditor.H2 = controls.H2Control;\nRichTextEditor.H3 = controls.H3Control;\nRichTextEditor.H4 = controls.H4Control;\nRichTextEditor.H5 = controls.H5Control;\nRichTextEditor.H6 = controls.H6Control;\nRichTextEditor.BulletList = controls.BulletListControl;\nRichTextEditor.OrderedList = controls.OrderedListControl;\nRichTextEditor.Link = controls.LinkControl;\nRichTextEditor.Unlink = controls.UnlinkControl;\nRichTextEditor.Blockquote = controls.BlockquoteControl;\nRichTextEditor.AlignLeft = controls.AlignLeftControl;\nRichTextEditor.AlignRight = controls.AlignRightControl;\nRichTextEditor.AlignCenter = controls.AlignCenterControl;\nRichTextEditor.AlignJustify = controls.AlignJustifyControl;\nRichTextEditor.Superscript = controls.SuperscriptControl;\nRichTextEditor.Subscript = controls.SubscriptControl;\nRichTextEditor.Code = controls.CodeControl;\nRichTextEditor.CodeBlock = controls.CodeBlockControl;\nRichTextEditor.ColorPicker = controls.ColorPickerControl;\nRichTextEditor.Color = controls.ColorControl;\nRichTextEditor.Highlight = controls.HighlightControl;\nRichTextEditor.Hr = controls.HrControl;\nRichTextEditor.UnsetColor = controls.UnsetColorControl;\n\nRichTextEditor.displayName = '@mantine/tiptap/RichTextEditor';\n"],"names":["useComponentDefaultProps","labels","useStyles","useMemo","DEFAULT_LABELS","React","StylesApiProvider","RichTextEditorProvider","Box","Content","Control","ControlsGroup","Toolbar","controls.BoldControl","controls.ItalicControl","controls.StrikeThroughControl","controls.UnderlineControl","controls.ClearFormattingControl","controls.H1Control","controls.H2Control","controls.H3Control","controls.H4Control","controls.H5Control","controls.H6Control","controls.BulletListControl","controls.OrderedListControl","controls.LinkControl","controls.UnlinkControl","controls.BlockquoteControl","controls.AlignLeftControl","controls.AlignRightControl","controls.AlignCenterControl","controls.AlignJustifyControl","controls.SuperscriptControl","controls.SubscriptControl","controls.CodeControl","controls.CodeBlockControl","controls.ColorPickerControl","controls.ColorControl","controls.HighlightControl","controls.HrControl","controls.UnsetColorControl"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,IAAI,SAAS,GAAG,MAAM,CAAC,cAAc,CAAC;AACtC,IAAI,mBAAmB,GAAG,MAAM,CAAC,qBAAqB,CAAC;AACvD,IAAI,YAAY,GAAG,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC;AACnD,IAAI,YAAY,GAAG,MAAM,CAAC,SAAS,CAAC,oBAAoB,CAAC;AACzD,IAAI,eAAe,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,KAAK,KAAK,GAAG,IAAI,GAAG,GAAG,SAAS,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,GAAG,GAAG,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;AAChK,IAAI,c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yB,CAAC;AACrD,cAAc,CAAC,UAAU,GAAGC,0BAA0B,CAAC;AACvD,cAAc,CAAC,WAAW,GAAGC,2BAA2B,CAAC;AACzD,cAAc,CAAC,YAAY,GAAGC,4BAA4B,CAAC;AAC3D,cAAc,CAAC,WAAW,GAAGC,2BAA2B,CAAC;AACzD,cAAc,CAAC,SAAS,GAAGC,yBAAyB,CAAC;AACrD,cAAc,CAAC,IAAI,GAAGC,oBAAoB,CAAC;AAC3C,cAAc,CAAC,SAAS,GAAGC,yBAAyB,CAAC;AACrD,cAAc,CAAC,WAAW,GAAGC,qCAA2B,CAAC;AACzD,cAAc,CAAC,KAAK,GAAGC,yBAAqB,CAAC;AAC7C,cAAc,CAAC,SAAS,GAAGC,yBAAyB,CAAC;AACrD,cAAc,CAAC,EAAE,GAAGC,kBAAkB,CAAC;AACvC,cAAc,CAAC,UAAU,GAAGC,0BAA0B,CAAC;AACvD,cAAc,CAAC,WAAW,GAAG,gCAAgC;;;;"}
|
|
1
|
+
{"version":3,"file":"RichTextEditor.js","sources":["../src/RichTextEditor.tsx"],"sourcesContent":["/* eslint-disable react/no-unused-prop-types */\nimport React, { useMemo, forwardRef } from 'react';\nimport {\n Box,\n useComponentDefaultProps,\n DefaultProps,\n Selectors,\n StylesApiProvider,\n} from '@mantine/core';\nimport { Editor } from '@tiptap/react';\nimport { RichTextEditorProvider } from './RichTextEditor.context';\nimport * as controls from './controls';\nimport { Content, ContentStylesNames } from './Content/Content';\nimport { Control, ControlStylesNames } from './controls/Control/Control';\nimport { ControlsGroup, ControlsGroupStylesNames } from './controls/ControlsGroup/ControlsGroup';\nimport { Toolbar, ToolbarStylesNames } from './Toolbar/Toolbar';\nimport { LinkControlStylesNames } from './controls/LinkControl/LinkControl';\nimport { DEFAULT_LABELS, RichTextEditorLabels } from './labels';\nimport useStyles from './RichTextEditor.styles';\n\nexport type RichTextEditorStylesNames =\n | Selectors<typeof useStyles>\n | ContentStylesNames\n | ControlStylesNames\n | ControlsGroupStylesNames\n | ToolbarStylesNames\n | LinkControlStylesNames;\n\nexport interface RichTextEditorProps\n extends DefaultProps<RichTextEditorStylesNames>,\n React.ComponentPropsWithoutRef<'div'> {\n /** Tiptap editor instance */\n editor: Editor | null;\n\n /** Determines whether code highlight styles should be added, true by default */\n withCodeHighlightStyles?: boolean;\n\n /** Determines whether typography styles should be added, true by default */\n withTypographyStyles?: boolean;\n\n /** Labels that are used in controls */\n labels?: Partial<RichTextEditorLabels>;\n\n /** Child editor components */\n children: React.ReactNode;\n}\n\nconst defaultProps: Partial<RichTextEditorProps> = {\n withCodeHighlightStyles: true,\n withTypographyStyles: true,\n};\n\nexport const RichTextEditor = forwardRef<HTMLDivElement, RichTextEditorProps>((props, ref) => {\n const {\n editor,\n children,\n className,\n labels,\n withCodeHighlightStyles,\n withTypographyStyles,\n classNames,\n styles,\n unstyled,\n ...others\n } = useComponentDefaultProps('RichTextEditor', defaultProps, props);\n const { classes, cx } = useStyles(null, {\n name: 'RichTextEditor',\n classNames,\n styles,\n unstyled,\n });\n const mergedLabels = useMemo(() => ({ ...DEFAULT_LABELS, ...labels }), [labels]);\n\n return (\n <StylesApiProvider classNames={classNames} styles={styles} unstyled={unstyled}>\n <RichTextEditorProvider\n value={{ editor, labels: mergedLabels, withCodeHighlightStyles, withTypographyStyles }}\n >\n <Box className={cx(classes.root, className)} {...others} ref={ref}>\n {children}\n </Box>\n </RichTextEditorProvider>\n </StylesApiProvider>\n );\n}) as any;\n\n// Generic components\nRichTextEditor.Content = Content;\nRichTextEditor.Control = Control;\nRichTextEditor.ControlsGroup = ControlsGroup;\nRichTextEditor.Toolbar = Toolbar;\n\n// Controls components\nRichTextEditor.Bold = controls.BoldControl;\nRichTextEditor.Italic = controls.ItalicControl;\nRichTextEditor.Strikethrough = controls.StrikeThroughControl;\nRichTextEditor.Underline = controls.UnderlineControl;\nRichTextEditor.ClearFormatting = controls.ClearFormattingControl;\nRichTextEditor.H1 = controls.H1Control;\nRichTextEditor.H2 = controls.H2Control;\nRichTextEditor.H3 = controls.H3Control;\nRichTextEditor.H4 = controls.H4Control;\nRichTextEditor.H5 = controls.H5Control;\nRichTextEditor.H6 = controls.H6Control;\nRichTextEditor.BulletList = controls.BulletListControl;\nRichTextEditor.OrderedList = controls.OrderedListControl;\nRichTextEditor.Link = controls.LinkControl;\nRichTextEditor.Unlink = controls.UnlinkControl;\nRichTextEditor.Blockquote = controls.BlockquoteControl;\nRichTextEditor.AlignLeft = controls.AlignLeftControl;\nRichTextEditor.AlignRight = controls.AlignRightControl;\nRichTextEditor.AlignCenter = controls.AlignCenterControl;\nRichTextEditor.AlignJustify = controls.AlignJustifyControl;\nRichTextEditor.Superscript = controls.SuperscriptControl;\nRichTextEditor.Subscript = controls.SubscriptControl;\nRichTextEditor.Code = controls.CodeControl;\nRichTextEditor.CodeBlock = controls.CodeBlockControl;\nRichTextEditor.ColorPicker = controls.ColorPickerControl;\nRichTextEditor.Color = controls.ColorControl;\nRichTextEditor.Highlight = controls.HighlightControl;\nRichTextEditor.Hr = controls.HrControl;\nRichTextEditor.UnsetColor = controls.UnsetColorControl;\n\nRichTextEditor.displayName = '@mantine/tiptap/RichTextEditor';\n"],"names":["forwardRef","useComponentDefaultProps","labels","useStyles","useMemo","DEFAULT_LABELS","React","StylesApiProvider","RichTextEditorProvider","Box","Content","Control","ControlsGroup","Toolbar","controls.BoldControl","controls.ItalicControl","controls.StrikeThroughControl","controls.UnderlineControl","controls.ClearFormattingControl","controls.H1Control","controls.H2Control","controls.H3Control","controls.H4Control","controls.H5Control","controls.H6Control","controls.BulletListControl","controls.OrderedListControl","controls.LinkControl","controls.UnlinkControl","controls.BlockquoteControl","controls.AlignLeftControl","controls.AlignRightControl","controls.AlignCenterControl","controls.AlignJustifyControl","controls.SuperscriptControl","controls.SubscriptControl","controls.CodeControl","controls.CodeBlockControl","controls.ColorPickerControl","controls.ColorControl","controls.HighlightControl","controls.HrControl","controls.UnsetColorControl"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA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CAAC,KAAK,GAAGC,yBAAqB,CAAC;AAC7C,cAAc,CAAC,SAAS,GAAGC,yBAAyB,CAAC;AACrD,cAAc,CAAC,EAAE,GAAGC,kBAAkB,CAAC;AACvC,cAAc,CAAC,UAAU,GAAGC,0BAA0B,CAAC;AACvD,cAAc,CAAC,WAAW,GAAG,gCAAgC;;;;"}
|
|
@@ -96,7 +96,7 @@ var useStyles = createStyles((theme, { withCodeHighlightStyles, withTypographySt
|
|
|
96
96
|
"& .ProseMirror > *:last-child": {
|
|
97
97
|
marginBottom: 0
|
|
98
98
|
},
|
|
99
|
-
"& .ProseMirror p.is-editor-empty:first-
|
|
99
|
+
"& .ProseMirror p.is-editor-empty:first-of-type::before": {
|
|
100
100
|
content: "attr(data-placeholder)",
|
|
101
101
|
userSelect: "none",
|
|
102
102
|
float: "left",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Content.styles.js","sources":["../../src/Content/Content.styles.ts"],"sourcesContent":["import { createStyles, MantineTheme } from '@mantine/core';\n\ninterface ContentStylesParams {\n withCodeHighlightStyles: boolean;\n withTypographyStyles: boolean;\n}\n\nfunction getCodeHighlight(withCodeHighlightStyles: boolean, theme: MantineTheme) {\n if (!withCodeHighlightStyles) {\n return null;\n }\n\n const highlightIndex = theme.colorScheme === 'dark' ? 5 : 7;\n\n return {\n pre: {\n background:\n theme.colorScheme === 'dark'\n ? theme.colors.dark[8]\n : theme.fn.rgba(theme.colors.gray[0], 0.65),\n borderRadius: theme.fn.radius(),\n color: theme.colorScheme === 'dark' ? theme.colors.dark[0] : theme.colors.gray[9],\n fontFamily: theme.fontFamilyMonospace,\n padding: `${theme.spacing.md}px ${theme.spacing.xl}px`,\n\n '& code': {\n background: 'none',\n color: 'inherit',\n fontSize: theme.fontSizes.sm,\n padding: 0,\n },\n\n ' & .hljs-comment, & .hljs-quote': {\n color: theme.colorScheme === 'dark' ? theme.colors.dark[2] : theme.colors.gray[5],\n },\n\n '& .hljs-variable, & .hljs-template-variable, & .hljs-attribute, & .hljs-tag, & .hljs-name, & .hljs-regexp, & .hljs-link, & .hljs-name, & .hljs-selector-id, & .hljs-selector-class':\n {\n color: theme.colors.red[highlightIndex],\n },\n\n '& .hljs-number, & .hljs-meta, & .hljs-built_in, & .hljs-builtin-name, & .hljs-literal, & .hljs-type, & .hljs-params':\n {\n color: theme.colors[theme.colorScheme === 'dark' ? 'cyan' : 'blue'][highlightIndex],\n },\n\n '& .hljs-string, & .hljs-symbol, & .hljs-bullet': {\n color: theme.colors.red[highlightIndex],\n },\n\n '& .hljs-title, & .hljs-section': {\n color: theme.colors[theme.colorScheme === 'dark' ? 'yellow' : 'pink'][highlightIndex],\n },\n\n '& .hljs-keyword, & .hljs-selector-tag': {\n color: theme.colors.violet[highlightIndex],\n },\n\n '& .hljs-emphasis': {\n fontStyle: 'italic',\n },\n\n '& .hljs-strong': {\n fontWeight: 700,\n },\n },\n };\n}\n\nfunction getTypographyStyles(withTypographyStyles: boolean) {\n if (!withTypographyStyles) {\n return null;\n }\n\n return {\n '& li > p': {\n margin: 0,\n },\n\n '& ul li, & ol li': {\n marginTop: 2,\n },\n\n '& ul, & ol': {\n marginTop: 5,\n marginBottom: 5,\n },\n\n '& p': {\n marginBottom: 7,\n },\n\n '& h1, & h2, & h3, & h4, & h5, & h6, & p': {\n marginTop: 0,\n },\n };\n}\n\nexport default createStyles(\n (theme, { withCodeHighlightStyles, withTypographyStyles }: ContentStylesParams) => ({\n typographyStylesProvider: {\n ...getTypographyStyles(withTypographyStyles),\n },\n\n content: {\n backgroundColor: theme.colorScheme === 'dark' ? theme.colors.dark[7] : theme.white,\n padding: theme.spacing.md,\n borderRadius: theme.fn.radius(),\n\n '& .ProseMirror': {\n outline: 0,\n },\n\n '& .ProseMirror > *:last-child': {\n marginBottom: 0,\n },\n\n '& .ProseMirror p.is-editor-empty:first-
|
|
1
|
+
{"version":3,"file":"Content.styles.js","sources":["../../src/Content/Content.styles.ts"],"sourcesContent":["import { createStyles, MantineTheme } from '@mantine/core';\n\ninterface ContentStylesParams {\n withCodeHighlightStyles: boolean;\n withTypographyStyles: boolean;\n}\n\nfunction getCodeHighlight(withCodeHighlightStyles: boolean, theme: MantineTheme) {\n if (!withCodeHighlightStyles) {\n return null;\n }\n\n const highlightIndex = theme.colorScheme === 'dark' ? 5 : 7;\n\n return {\n pre: {\n background:\n theme.colorScheme === 'dark'\n ? theme.colors.dark[8]\n : theme.fn.rgba(theme.colors.gray[0], 0.65),\n borderRadius: theme.fn.radius(),\n color: theme.colorScheme === 'dark' ? theme.colors.dark[0] : theme.colors.gray[9],\n fontFamily: theme.fontFamilyMonospace,\n padding: `${theme.spacing.md}px ${theme.spacing.xl}px`,\n\n '& code': {\n background: 'none',\n color: 'inherit',\n fontSize: theme.fontSizes.sm,\n padding: 0,\n },\n\n ' & .hljs-comment, & .hljs-quote': {\n color: theme.colorScheme === 'dark' ? theme.colors.dark[2] : theme.colors.gray[5],\n },\n\n '& .hljs-variable, & .hljs-template-variable, & .hljs-attribute, & .hljs-tag, & .hljs-name, & .hljs-regexp, & .hljs-link, & .hljs-name, & .hljs-selector-id, & .hljs-selector-class':\n {\n color: theme.colors.red[highlightIndex],\n },\n\n '& .hljs-number, & .hljs-meta, & .hljs-built_in, & .hljs-builtin-name, & .hljs-literal, & .hljs-type, & .hljs-params':\n {\n color: theme.colors[theme.colorScheme === 'dark' ? 'cyan' : 'blue'][highlightIndex],\n },\n\n '& .hljs-string, & .hljs-symbol, & .hljs-bullet': {\n color: theme.colors.red[highlightIndex],\n },\n\n '& .hljs-title, & .hljs-section': {\n color: theme.colors[theme.colorScheme === 'dark' ? 'yellow' : 'pink'][highlightIndex],\n },\n\n '& .hljs-keyword, & .hljs-selector-tag': {\n color: theme.colors.violet[highlightIndex],\n },\n\n '& .hljs-emphasis': {\n fontStyle: 'italic',\n },\n\n '& .hljs-strong': {\n fontWeight: 700,\n },\n },\n };\n}\n\nfunction getTypographyStyles(withTypographyStyles: boolean) {\n if (!withTypographyStyles) {\n return null;\n }\n\n return {\n '& li > p': {\n margin: 0,\n },\n\n '& ul li, & ol li': {\n marginTop: 2,\n },\n\n '& ul, & ol': {\n marginTop: 5,\n marginBottom: 5,\n },\n\n '& p': {\n marginBottom: 7,\n },\n\n '& h1, & h2, & h3, & h4, & h5, & h6, & p': {\n marginTop: 0,\n },\n };\n}\n\nexport default createStyles(\n (theme, { withCodeHighlightStyles, withTypographyStyles }: ContentStylesParams) => ({\n typographyStylesProvider: {\n ...getTypographyStyles(withTypographyStyles),\n },\n\n content: {\n backgroundColor: theme.colorScheme === 'dark' ? theme.colors.dark[7] : theme.white,\n padding: theme.spacing.md,\n borderRadius: theme.fn.radius(),\n\n '& .ProseMirror': {\n outline: 0,\n },\n\n '& .ProseMirror > *:last-child': {\n marginBottom: 0,\n },\n\n '& .ProseMirror p.is-editor-empty:first-of-type::before': {\n content: 'attr(data-placeholder)',\n userSelect: 'none',\n float: 'left',\n height: 0,\n pointerEvents: 'none',\n color: theme.colorScheme === 'dark' ? theme.colors.dark[3] : theme.colors.gray[5],\n },\n\n ...getCodeHighlight(withCodeHighlightStyles, theme),\n },\n })\n);\n"],"names":[],"mappings":";;AAAA,IAAI,SAAS,GAAG,MAAM,CAAC,cAAc,CAAC;AACtC,IAAI,mBAAmB,GAAG,MAAM,CAAC,qBAAqB,CAAC;AACvD,IAAI,YAAY,GAAG,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC;AACnD,IAAI,YAAY,GAAG,MAAM,CAAC,SAAS,CAAC,oBAAoB,CAAC;AACzD,IAAI,eAAe,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,KAAK,KAAK,GAAG,IAAI,GAAG,GAAG,SAAS,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,GAAG,GAAG,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;AAChK,IAAI,cAAc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AE;AACtB,MAAM,OAAO,EAAE,CAAC;AAChB,KAAK;AACL,IAAI,+BAA+B,EAAE;AACrC,MAAM,YAAY,EAAE,CAAC;AACrB,KAAK;AACL,IAAI,wDAAwD,EAAE;AAC9D,MAAM,OAAO,EAAE,wBAAwB;AACvC,MAAM,UAAU,EAAE,MAAM;AACxB,MAAM,KAAK,EAAE,MAAM;AACnB,MAAM,MAAM,EAAE,CAAC;AACf,MAAM,aAAa,EAAE,MAAM;AAC3B,MAAM,KAAK,EAAE,KAAK,CAAC,WAAW,KAAK,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;AACvF,KAAK;AACL,GAAG,EAAE,gBAAgB,CAAC,uBAAuB,EAAE,KAAK,CAAC,CAAC;AACtD,CAAC,CAAC,CAAC;;;;"}
|
package/esm/RichTextEditor.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { useMemo } from 'react';
|
|
1
|
+
import React, { forwardRef, useMemo } from 'react';
|
|
2
2
|
import { useComponentDefaultProps, StylesApiProvider, Box } from '@mantine/core';
|
|
3
3
|
import { RichTextEditorProvider } from './RichTextEditor.context.js';
|
|
4
4
|
import { BoldControl, ItalicControl, StrikeThroughControl, UnderlineControl, ClearFormattingControl, H1Control, H2Control, H3Control, H4Control, H5Control, H6Control, BulletListControl, OrderedListControl, UnlinkControl, BlockquoteControl, AlignLeftControl, AlignRightControl, AlignCenterControl, AlignJustifyControl, SuperscriptControl, SubscriptControl, CodeControl, CodeBlockControl, HighlightControl, HrControl, UnsetColorControl } from './controls/controls.js';
|
|
@@ -13,6 +13,8 @@ import { DEFAULT_LABELS } from './labels.js';
|
|
|
13
13
|
import useStyles from './RichTextEditor.styles.js';
|
|
14
14
|
|
|
15
15
|
var __defProp = Object.defineProperty;
|
|
16
|
+
var __defProps = Object.defineProperties;
|
|
17
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
16
18
|
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
17
19
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
18
20
|
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
@@ -28,6 +30,7 @@ var __spreadValues = (a, b) => {
|
|
|
28
30
|
}
|
|
29
31
|
return a;
|
|
30
32
|
};
|
|
33
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
31
34
|
var __objRest = (source, exclude) => {
|
|
32
35
|
var target = {};
|
|
33
36
|
for (var prop in source)
|
|
@@ -44,7 +47,7 @@ const defaultProps = {
|
|
|
44
47
|
withCodeHighlightStyles: true,
|
|
45
48
|
withTypographyStyles: true
|
|
46
49
|
};
|
|
47
|
-
|
|
50
|
+
const RichTextEditor = forwardRef((props, ref) => {
|
|
48
51
|
const _a = useComponentDefaultProps("RichTextEditor", defaultProps, props), {
|
|
49
52
|
editor,
|
|
50
53
|
children,
|
|
@@ -66,7 +69,12 @@ function RichTextEditor(props) {
|
|
|
66
69
|
"styles",
|
|
67
70
|
"unstyled"
|
|
68
71
|
]);
|
|
69
|
-
const { classes, cx } = useStyles(null, {
|
|
72
|
+
const { classes, cx } = useStyles(null, {
|
|
73
|
+
name: "RichTextEditor",
|
|
74
|
+
classNames,
|
|
75
|
+
styles,
|
|
76
|
+
unstyled
|
|
77
|
+
});
|
|
70
78
|
const mergedLabels = useMemo(() => __spreadValues(__spreadValues({}, DEFAULT_LABELS), labels), [labels]);
|
|
71
79
|
return /* @__PURE__ */ React.createElement(StylesApiProvider, {
|
|
72
80
|
classNames,
|
|
@@ -74,10 +82,12 @@ function RichTextEditor(props) {
|
|
|
74
82
|
unstyled
|
|
75
83
|
}, /* @__PURE__ */ React.createElement(RichTextEditorProvider, {
|
|
76
84
|
value: { editor, labels: mergedLabels, withCodeHighlightStyles, withTypographyStyles }
|
|
77
|
-
}, /* @__PURE__ */ React.createElement(Box, __spreadValues({
|
|
85
|
+
}, /* @__PURE__ */ React.createElement(Box, __spreadProps(__spreadValues({
|
|
78
86
|
className: cx(classes.root, className)
|
|
79
|
-
}, others),
|
|
80
|
-
|
|
87
|
+
}, others), {
|
|
88
|
+
ref
|
|
89
|
+
}), children)));
|
|
90
|
+
});
|
|
81
91
|
RichTextEditor.Content = Content;
|
|
82
92
|
RichTextEditor.Control = Control;
|
|
83
93
|
RichTextEditor.ControlsGroup = ControlsGroup;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RichTextEditor.js","sources":["../src/RichTextEditor.tsx"],"sourcesContent":["/* eslint-disable react/no-unused-prop-types */\nimport React, { useMemo } from 'react';\nimport {\n Box,\n useComponentDefaultProps,\n DefaultProps,\n Selectors,\n StylesApiProvider,\n} from '@mantine/core';\nimport { Editor } from '@tiptap/react';\nimport { RichTextEditorProvider } from './RichTextEditor.context';\nimport * as controls from './controls';\nimport { Content, ContentStylesNames } from './Content/Content';\nimport { Control, ControlStylesNames } from './controls/Control/Control';\nimport { ControlsGroup, ControlsGroupStylesNames } from './controls/ControlsGroup/ControlsGroup';\nimport { Toolbar, ToolbarStylesNames } from './Toolbar/Toolbar';\nimport { LinkControlStylesNames } from './controls/LinkControl/LinkControl';\nimport { DEFAULT_LABELS, RichTextEditorLabels } from './labels';\nimport useStyles from './RichTextEditor.styles';\n\nexport type RichTextEditorStylesNames =\n | Selectors<typeof useStyles>\n | ContentStylesNames\n | ControlStylesNames\n | ControlsGroupStylesNames\n | ToolbarStylesNames\n | LinkControlStylesNames;\n\nexport interface RichTextEditorProps\n extends DefaultProps<RichTextEditorStylesNames>,\n React.ComponentPropsWithoutRef<'div'> {\n /** Tiptap editor instance */\n editor: Editor | null;\n\n /** Determines whether code highlight styles should be added, true by default */\n withCodeHighlightStyles?: boolean;\n\n /** Determines whether typography styles should be added, true by default */\n withTypographyStyles?: boolean;\n\n /** Labels that are used in controls */\n labels?: Partial<RichTextEditorLabels>;\n\n /** Child editor components */\n children: React.ReactNode;\n}\n\nconst defaultProps: Partial<RichTextEditorProps> = {\n withCodeHighlightStyles: true,\n withTypographyStyles: true,\n};\n\nexport
|
|
1
|
+
{"version":3,"file":"RichTextEditor.js","sources":["../src/RichTextEditor.tsx"],"sourcesContent":["/* eslint-disable react/no-unused-prop-types */\nimport React, { useMemo, forwardRef } from 'react';\nimport {\n Box,\n useComponentDefaultProps,\n DefaultProps,\n Selectors,\n StylesApiProvider,\n} from '@mantine/core';\nimport { Editor } from '@tiptap/react';\nimport { RichTextEditorProvider } from './RichTextEditor.context';\nimport * as controls from './controls';\nimport { Content, ContentStylesNames } from './Content/Content';\nimport { Control, ControlStylesNames } from './controls/Control/Control';\nimport { ControlsGroup, ControlsGroupStylesNames } from './controls/ControlsGroup/ControlsGroup';\nimport { Toolbar, ToolbarStylesNames } from './Toolbar/Toolbar';\nimport { LinkControlStylesNames } from './controls/LinkControl/LinkControl';\nimport { DEFAULT_LABELS, RichTextEditorLabels } from './labels';\nimport useStyles from './RichTextEditor.styles';\n\nexport type RichTextEditorStylesNames =\n | Selectors<typeof useStyles>\n | ContentStylesNames\n | ControlStylesNames\n | ControlsGroupStylesNames\n | ToolbarStylesNames\n | LinkControlStylesNames;\n\nexport interface RichTextEditorProps\n extends DefaultProps<RichTextEditorStylesNames>,\n React.ComponentPropsWithoutRef<'div'> {\n /** Tiptap editor instance */\n editor: Editor | null;\n\n /** Determines whether code highlight styles should be added, true by default */\n withCodeHighlightStyles?: boolean;\n\n /** Determines whether typography styles should be added, true by default */\n withTypographyStyles?: boolean;\n\n /** Labels that are used in controls */\n labels?: Partial<RichTextEditorLabels>;\n\n /** Child editor components */\n children: React.ReactNode;\n}\n\nconst defaultProps: Partial<RichTextEditorProps> = {\n withCodeHighlightStyles: true,\n withTypographyStyles: true,\n};\n\nexport const RichTextEditor = forwardRef<HTMLDivElement, RichTextEditorProps>((props, ref) => {\n const {\n editor,\n children,\n className,\n labels,\n withCodeHighlightStyles,\n withTypographyStyles,\n classNames,\n styles,\n unstyled,\n ...others\n } = useComponentDefaultProps('RichTextEditor', defaultProps, props);\n const { classes, cx } = useStyles(null, {\n name: 'RichTextEditor',\n classNames,\n styles,\n unstyled,\n });\n const mergedLabels = useMemo(() => ({ ...DEFAULT_LABELS, ...labels }), [labels]);\n\n return (\n <StylesApiProvider classNames={classNames} styles={styles} unstyled={unstyled}>\n <RichTextEditorProvider\n value={{ editor, labels: mergedLabels, withCodeHighlightStyles, withTypographyStyles }}\n >\n <Box className={cx(classes.root, className)} {...others} ref={ref}>\n {children}\n </Box>\n </RichTextEditorProvider>\n </StylesApiProvider>\n );\n}) as any;\n\n// Generic components\nRichTextEditor.Content = Content;\nRichTextEditor.Control = Control;\nRichTextEditor.ControlsGroup = ControlsGroup;\nRichTextEditor.Toolbar = Toolbar;\n\n// Controls components\nRichTextEditor.Bold = controls.BoldControl;\nRichTextEditor.Italic = controls.ItalicControl;\nRichTextEditor.Strikethrough = controls.StrikeThroughControl;\nRichTextEditor.Underline = controls.UnderlineControl;\nRichTextEditor.ClearFormatting = controls.ClearFormattingControl;\nRichTextEditor.H1 = controls.H1Control;\nRichTextEditor.H2 = controls.H2Control;\nRichTextEditor.H3 = controls.H3Control;\nRichTextEditor.H4 = controls.H4Control;\nRichTextEditor.H5 = controls.H5Control;\nRichTextEditor.H6 = controls.H6Control;\nRichTextEditor.BulletList = controls.BulletListControl;\nRichTextEditor.OrderedList = controls.OrderedListControl;\nRichTextEditor.Link = controls.LinkControl;\nRichTextEditor.Unlink = controls.UnlinkControl;\nRichTextEditor.Blockquote = controls.BlockquoteControl;\nRichTextEditor.AlignLeft = controls.AlignLeftControl;\nRichTextEditor.AlignRight = controls.AlignRightControl;\nRichTextEditor.AlignCenter = controls.AlignCenterControl;\nRichTextEditor.AlignJustify = controls.AlignJustifyControl;\nRichTextEditor.Superscript = controls.SuperscriptControl;\nRichTextEditor.Subscript = controls.SubscriptControl;\nRichTextEditor.Code = controls.CodeControl;\nRichTextEditor.CodeBlock = controls.CodeBlockControl;\nRichTextEditor.ColorPicker = controls.ColorPickerControl;\nRichTextEditor.Color = controls.ColorControl;\nRichTextEditor.Highlight = controls.HighlightControl;\nRichTextEditor.Hr = controls.HrControl;\nRichTextEditor.UnsetColor = controls.UnsetColorControl;\n\nRichTextEditor.displayName = '@mantine/tiptap/RichTextEditor';\n"],"names":["controls.BoldControl","controls.ItalicControl","controls.StrikeThroughControl","controls.UnderlineControl","controls.ClearFormattingControl","controls.H1Control","controls.H2Control","controls.H3Control","controls.H4Control","controls.H5Control","controls.H6Control","controls.BulletListControl","controls.OrderedListControl","controls.LinkControl","controls.UnlinkControl","controls.BlockquoteControl","controls.AlignLeftControl","controls.AlignRightControl","controls.AlignCenterControl","controls.AlignJustifyControl","controls.SuperscriptControl","controls.SubscriptControl","controls.CodeControl","controls.CodeBlockControl","controls.ColorPickerControl","controls.ColorControl","controls.HighlightControl","controls.HrControl","controls.UnsetColorControl"],"mappings":";;;;;;;;;;;;;;AAAA,IAAI,SAAS,GAAG,MAAM,CAAC,cAAc,CAAC;AACtC,IAAI,UAAU,GAAG,MAAM,CAAC,gBAAgB,CAAC;AACzC,IAAI,iBAAiB,GAAG,MAAM,CAAC,yBAAyB,CAAC;AACzD,IAAI,mBAAmB,GAAG,MAAM,CAAC,qBAAqB,CAAC;AACvD,IAAI,YAAY,GAAG,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC;AACnD,IAAI,YAAY,GAAG,MAAM,CAAC,SAAS,CAAC,oBAAoB,CAAC;AACzD,IAAI,eAAe,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,KAAK,KAAK,GAAG,IAAI,GAAG,GAAG,SAAS,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,GAAG,GAAG,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;AAChK,IAAI,cAAc,GAAG,CAAC,CAA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,CAAC;AACzD,cAAc,CAAC,IAAI,GAAGC,WAAoB,CAAC;AAC3C,cAAc,CAAC,MAAM,GAAGC,aAAsB,CAAC;AAC/C,cAAc,CAAC,UAAU,GAAGC,iBAA0B,CAAC;AACvD,cAAc,CAAC,SAAS,GAAGC,gBAAyB,CAAC;AACrD,cAAc,CAAC,UAAU,GAAGC,iBAA0B,CAAC;AACvD,cAAc,CAAC,WAAW,GAAGC,kBAA2B,CAAC;AACzD,cAAc,CAAC,YAAY,GAAGC,mBAA4B,CAAC;AAC3D,cAAc,CAAC,WAAW,GAAGC,kBAA2B,CAAC;AACzD,cAAc,CAAC,SAAS,GAAGC,gBAAyB,CAAC;AACrD,cAAc,CAAC,IAAI,GAAGC,WAAoB,CAAC;AAC3C,cAAc,CAAC,SAAS,GAAGC,gBAAyB,CAAC;AACrD,cAAc,CAAC,WAAW,GAAGC,kBAA2B,CAAC;AACzD,cAAc,CAAC,KAAK,GAAGC,YAAqB,CAAC;AAC7C,cAAc,CAAC,SAAS,GAAGC,gBAAyB,CAAC;AACrD,cAAc,CAAC,EAAE,GAAGC,SAAkB,CAAC;AACvC,cAAc,CAAC,UAAU,GAAGC,iBAA0B,CAAC;AACvD,cAAc,CAAC,WAAW,GAAG,gCAAgC;;;;"}
|
package/lib/RichTextEditor.d.ts
CHANGED
|
@@ -21,41 +21,5 @@ export interface RichTextEditorProps extends DefaultProps<RichTextEditorStylesNa
|
|
|
21
21
|
/** Child editor components */
|
|
22
22
|
children: React.ReactNode;
|
|
23
23
|
}
|
|
24
|
-
export declare
|
|
25
|
-
export declare namespace RichTextEditor {
|
|
26
|
-
var Content: React.ForwardRefExoticComponent<import("./Content/Content").RichTextEditorContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
27
|
-
var Control: React.ForwardRefExoticComponent<import("./controls/Control/Control").RichTextEditorControlProps & React.RefAttributes<HTMLButtonElement>>;
|
|
28
|
-
var ControlsGroup: React.ForwardRefExoticComponent<import("./controls/ControlsGroup/ControlsGroup").RichTextEditorControlsGroupProps & React.RefAttributes<HTMLDivElement>>;
|
|
29
|
-
var Toolbar: React.ForwardRefExoticComponent<import("./Toolbar/Toolbar").RichTextEditorToolbarProps & React.RefAttributes<HTMLDivElement>>;
|
|
30
|
-
var Bold: React.ForwardRefExoticComponent<import("./controls/Control/Control").PremadeControlProps & React.RefAttributes<HTMLButtonElement>>;
|
|
31
|
-
var Italic: React.ForwardRefExoticComponent<import("./controls/Control/Control").PremadeControlProps & React.RefAttributes<HTMLButtonElement>>;
|
|
32
|
-
var Strikethrough: React.ForwardRefExoticComponent<import("./controls/Control/Control").PremadeControlProps & React.RefAttributes<HTMLButtonElement>>;
|
|
33
|
-
var Underline: React.ForwardRefExoticComponent<import("./controls/Control/Control").PremadeControlProps & React.RefAttributes<HTMLButtonElement>>;
|
|
34
|
-
var ClearFormatting: React.ForwardRefExoticComponent<import("./controls/Control/Control").PremadeControlProps & React.RefAttributes<HTMLButtonElement>>;
|
|
35
|
-
var H1: React.ForwardRefExoticComponent<import("./controls/Control/Control").PremadeControlProps & React.RefAttributes<HTMLButtonElement>>;
|
|
36
|
-
var H2: React.ForwardRefExoticComponent<import("./controls/Control/Control").PremadeControlProps & React.RefAttributes<HTMLButtonElement>>;
|
|
37
|
-
var H3: React.ForwardRefExoticComponent<import("./controls/Control/Control").PremadeControlProps & React.RefAttributes<HTMLButtonElement>>;
|
|
38
|
-
var H4: React.ForwardRefExoticComponent<import("./controls/Control/Control").PremadeControlProps & React.RefAttributes<HTMLButtonElement>>;
|
|
39
|
-
var H5: React.ForwardRefExoticComponent<import("./controls/Control/Control").PremadeControlProps & React.RefAttributes<HTMLButtonElement>>;
|
|
40
|
-
var H6: React.ForwardRefExoticComponent<import("./controls/Control/Control").PremadeControlProps & React.RefAttributes<HTMLButtonElement>>;
|
|
41
|
-
var BulletList: React.ForwardRefExoticComponent<import("./controls/Control/Control").PremadeControlProps & React.RefAttributes<HTMLButtonElement>>;
|
|
42
|
-
var OrderedList: React.ForwardRefExoticComponent<import("./controls/Control/Control").PremadeControlProps & React.RefAttributes<HTMLButtonElement>>;
|
|
43
|
-
var Link: React.ForwardRefExoticComponent<import("./controls/LinkControl/LinkControl").RichTextEditorLinkControlProps & React.RefAttributes<HTMLButtonElement>>;
|
|
44
|
-
var Unlink: React.ForwardRefExoticComponent<import("./controls/Control/Control").PremadeControlProps & React.RefAttributes<HTMLButtonElement>>;
|
|
45
|
-
var Blockquote: React.ForwardRefExoticComponent<import("./controls/Control/Control").PremadeControlProps & React.RefAttributes<HTMLButtonElement>>;
|
|
46
|
-
var AlignLeft: React.ForwardRefExoticComponent<import("./controls/Control/Control").PremadeControlProps & React.RefAttributes<HTMLButtonElement>>;
|
|
47
|
-
var AlignRight: React.ForwardRefExoticComponent<import("./controls/Control/Control").PremadeControlProps & React.RefAttributes<HTMLButtonElement>>;
|
|
48
|
-
var AlignCenter: React.ForwardRefExoticComponent<import("./controls/Control/Control").PremadeControlProps & React.RefAttributes<HTMLButtonElement>>;
|
|
49
|
-
var AlignJustify: React.ForwardRefExoticComponent<import("./controls/Control/Control").PremadeControlProps & React.RefAttributes<HTMLButtonElement>>;
|
|
50
|
-
var Superscript: React.ForwardRefExoticComponent<import("./controls/Control/Control").PremadeControlProps & React.RefAttributes<HTMLButtonElement>>;
|
|
51
|
-
var Subscript: React.ForwardRefExoticComponent<import("./controls/Control/Control").PremadeControlProps & React.RefAttributes<HTMLButtonElement>>;
|
|
52
|
-
var Code: React.ForwardRefExoticComponent<import("./controls/Control/Control").PremadeControlProps & React.RefAttributes<HTMLButtonElement>>;
|
|
53
|
-
var CodeBlock: React.ForwardRefExoticComponent<import("./controls/Control/Control").PremadeControlProps & React.RefAttributes<HTMLButtonElement>>;
|
|
54
|
-
var ColorPicker: React.ForwardRefExoticComponent<import("./controls/ColorPickerControl/ColorPickerControl").ColorPickerControlProps & React.RefAttributes<HTMLButtonElement>>;
|
|
55
|
-
var Color: React.ForwardRefExoticComponent<import(".").RichTextEditorColorControlProps & React.RefAttributes<HTMLButtonElement>>;
|
|
56
|
-
var Highlight: React.ForwardRefExoticComponent<import("./controls/Control/Control").PremadeControlProps & React.RefAttributes<HTMLButtonElement>>;
|
|
57
|
-
var Hr: React.ForwardRefExoticComponent<import("./controls/Control/Control").PremadeControlProps & React.RefAttributes<HTMLButtonElement>>;
|
|
58
|
-
var UnsetColor: React.ForwardRefExoticComponent<import("./controls/Control/Control").PremadeControlProps & React.RefAttributes<HTMLButtonElement>>;
|
|
59
|
-
var displayName: string;
|
|
60
|
-
}
|
|
24
|
+
export declare const RichTextEditor: any;
|
|
61
25
|
//# sourceMappingURL=RichTextEditor.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RichTextEditor.d.ts","sourceRoot":"","sources":["../src/RichTextEditor.tsx"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"RichTextEditor.d.ts","sourceRoot":"","sources":["../src/RichTextEditor.tsx"],"names":[],"mappings":"AACA,OAAO,KAA8B,MAAM,OAAO,CAAC;AACnD,OAAO,EAGL,YAAY,EACZ,SAAS,EAEV,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAGvC,OAAO,EAAW,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAChE,OAAO,EAAW,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AACzE,OAAO,EAAiB,wBAAwB,EAAE,MAAM,wCAAwC,CAAC;AACjG,OAAO,EAAW,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAChE,OAAO,EAAE,sBAAsB,EAAE,MAAM,oCAAoC,CAAC;AAC5E,OAAO,EAAkB,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAChE,OAAO,SAAS,MAAM,yBAAyB,CAAC;AAEhD,oBAAY,yBAAyB,GACjC,SAAS,CAAC,OAAO,SAAS,CAAC,GAC3B,kBAAkB,GAClB,kBAAkB,GAClB,wBAAwB,GACxB,kBAAkB,GAClB,sBAAsB,CAAC;AAE3B,MAAM,WAAW,mBACf,SAAQ,YAAY,CAAC,yBAAyB,CAAC,EAC7C,KAAK,CAAC,wBAAwB,CAAC,KAAK,CAAC;IACvC,6BAA6B;IAC7B,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IAEtB,gFAAgF;IAChF,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAElC,4EAA4E;IAC5E,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAE/B,uCAAuC;IACvC,MAAM,CAAC,EAAE,OAAO,CAAC,oBAAoB,CAAC,CAAC;IAEvC,8BAA8B;IAC9B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAOD,eAAO,MAAM,cAAc,KAgClB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mantine/tiptap",
|
|
3
3
|
"description": "Rich text editor based on tiptap",
|
|
4
|
-
"version": "5.8.
|
|
4
|
+
"version": "5.8.4",
|
|
5
5
|
"main": "cjs/index.js",
|
|
6
6
|
"module": "esm/index.js",
|
|
7
7
|
"types": "lib/index.d.ts",
|
|
@@ -27,15 +27,15 @@
|
|
|
27
27
|
"rich-text-editor"
|
|
28
28
|
],
|
|
29
29
|
"peerDependencies": {
|
|
30
|
-
"@mantine/core": "5.8.
|
|
31
|
-
"@mantine/hooks": "5.8.
|
|
30
|
+
"@mantine/core": "5.8.4",
|
|
31
|
+
"@mantine/hooks": "5.8.4",
|
|
32
32
|
"@tabler/icons": "*",
|
|
33
33
|
"@tiptap/extension-link": "^2.0.0-beta.202",
|
|
34
34
|
"@tiptap/react": "^2.0.0-beta.202",
|
|
35
35
|
"react": ">=16.8.0"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@mantine/utils": "5.8.
|
|
38
|
+
"@mantine/utils": "5.8.4"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {}
|
|
41
41
|
}
|