@mantine/tiptap 5.9.1 → 5.9.3
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/RichTextEditor.js.map +1 -1
- package/esm/RichTextEditor.js.map +1 -1
- package/lib/Content/Content.styles.d.ts +5 -2
- package/lib/Content/Content.styles.d.ts.map +1 -1
- package/lib/RichTextEditor.d.ts +43 -5
- package/lib/RichTextEditor.d.ts.map +1 -1
- package/lib/RichTextEditor.styles.d.ts +4 -2
- package/lib/RichTextEditor.styles.d.ts.map +1 -1
- package/lib/Toolbar/Toolbar.styles.d.ts +4 -2
- package/lib/Toolbar/Toolbar.styles.d.ts.map +1 -1
- package/lib/controls/Control/Control.styles.d.ts +4 -2
- package/lib/controls/Control/Control.styles.d.ts.map +1 -1
- package/lib/controls/ControlsGroup/ControlsGroup.styles.d.ts +4 -2
- package/lib/controls/ControlsGroup/ControlsGroup.styles.d.ts.map +1 -1
- package/lib/controls/LinkControl/LinkControl.styles.d.ts +7 -2
- package/lib/controls/LinkControl/LinkControl.styles.d.ts.map +1 -1
- package/package.json +4 -4
|
@@ -1 +1 @@
|
|
|
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,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,CAAC,EAAE,CAAC,KAAK;AAC/B,EAAE,KAAK,IAAI,IAAI,IAAI,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC;AAChC,IAAI,IAAI,YAAY,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC;AAClC,MAAM,eAAe,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;AACxC,EAAE,IAAI,mBAAmB;AACzB,IAAI,KAAK,IAAI,IAAI,IAAI,mBAAmB,CAAC,CAAC,CAAC,EAAE;AAC7C,MAAM,IAAI,YAAY,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC;AACpC,QAAQ,eAAe,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;AA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AAC;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 { ForwardRefWithStaticComponents } from '@mantine/utils';\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\ntype RichTextEditorComponent = ForwardRefWithStaticComponents<\n RichTextEditorProps,\n {\n Content: typeof Content;\n Control: typeof Control;\n ControlsGroup: typeof ControlsGroup;\n Toolbar: typeof Toolbar;\n Bold: typeof controls.BoldControl;\n Italic: typeof controls.ItalicControl;\n Strikethrough: typeof controls.StrikeThroughControl;\n Underline: typeof controls.UnderlineControl;\n ClearFormatting: typeof controls.ClearFormattingControl;\n H1: typeof controls.H1Control;\n H2: typeof controls.H2Control;\n H3: typeof controls.H3Control;\n H4: typeof controls.H4Control;\n H5: typeof controls.H5Control;\n H6: typeof controls.H6Control;\n BulletList: typeof controls.BulletListControl;\n OrderedList: typeof controls.OrderedListControl;\n Link: typeof controls.LinkControl;\n Unlink: typeof controls.UnlinkControl;\n Blockquote: typeof controls.BlockquoteControl;\n AlignLeft: typeof controls.AlignLeftControl;\n AlignRight: typeof controls.AlignRightControl;\n AlignCenter: typeof controls.AlignCenterControl;\n AlignJustify: typeof controls.AlignJustifyControl;\n Superscript: typeof controls.SuperscriptControl;\n Subscript: typeof controls.SubscriptControl;\n Code: typeof controls.CodeControl;\n CodeBlock: typeof controls.CodeBlockControl;\n ColorPicker: typeof controls.ColorPickerControl;\n Color: typeof controls.ColorControl;\n Highlight: typeof controls.HighlightControl;\n Hr: typeof controls.HrControl;\n UnsetColor: typeof controls.UnsetColorControl;\n }\n>;\n\nexport const RichTextEditor: RichTextEditorComponent = forwardRef<\n HTMLDivElement,\n RichTextEditorProps\n>((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,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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0B,CAAC;AACvD,cAAc,CAAC,WAAW,GAAGC,2BAA2B,CAAC;AACzD,cAAc,CAAC,IAAI,GAAGC,uBAAoB,CAAC;AAC3C,cAAc,CAAC,MAAM,GAAGC,sBAAsB,CAAC;AAC/C,cAAc,CAAC,UAAU,GAAGC,0BAA0B,CAAC;AACvD,cAAc,CAAC,SAAS,GAAGC,yBAAyB,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 +1 @@
|
|
|
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,CAAC,EAAE,CAAC,KAAK;AAC/B,EAAE,KAAK,IAAI,IAAI,IAAI,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC;AAChC,IAAI,IAAI,YAAY,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC;AAClC,MAAM,eAAe,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;AACxC,EAAE,IAAI,mBAAmB;AACzB,IAAI,KAAK,IAAI,IAAI,IAAI,mBAAmB,CAAC,CAAC,CAAC,EAAE;AAC7C,MAAM,IAAI,YAAY,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC;AACpC,QAAQ,eAAe,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAA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AC3C,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;;;;"}
|
|
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 { ForwardRefWithStaticComponents } from '@mantine/utils';\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\ntype RichTextEditorComponent = ForwardRefWithStaticComponents<\n RichTextEditorProps,\n {\n Content: typeof Content;\n Control: typeof Control;\n ControlsGroup: typeof ControlsGroup;\n Toolbar: typeof Toolbar;\n Bold: typeof controls.BoldControl;\n Italic: typeof controls.ItalicControl;\n Strikethrough: typeof controls.StrikeThroughControl;\n Underline: typeof controls.UnderlineControl;\n ClearFormatting: typeof controls.ClearFormattingControl;\n H1: typeof controls.H1Control;\n H2: typeof controls.H2Control;\n H3: typeof controls.H3Control;\n H4: typeof controls.H4Control;\n H5: typeof controls.H5Control;\n H6: typeof controls.H6Control;\n BulletList: typeof controls.BulletListControl;\n OrderedList: typeof controls.OrderedListControl;\n Link: typeof controls.LinkControl;\n Unlink: typeof controls.UnlinkControl;\n Blockquote: typeof controls.BlockquoteControl;\n AlignLeft: typeof controls.AlignLeftControl;\n AlignRight: typeof controls.AlignRightControl;\n AlignCenter: typeof controls.AlignCenterControl;\n AlignJustify: typeof controls.AlignJustifyControl;\n Superscript: typeof controls.SuperscriptControl;\n Subscript: typeof controls.SubscriptControl;\n Code: typeof controls.CodeControl;\n CodeBlock: typeof controls.CodeBlockControl;\n ColorPicker: typeof controls.ColorPickerControl;\n Color: typeof controls.ColorControl;\n Highlight: typeof controls.HighlightControl;\n Hr: typeof controls.HrControl;\n UnsetColor: typeof controls.UnsetColorControl;\n }\n>;\n\nexport const RichTextEditor: RichTextEditorComponent = forwardRef<\n HTMLDivElement,\n RichTextEditorProps\n>((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,CAAC,EAAE,CAAC,KAAK;AAC/B,EAAE,KAAK,IAAI,IAAI,IAAI,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC;AAChC,IAAI,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AAc,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;;;;"}
|
|
@@ -3,8 +3,11 @@ interface ContentStylesParams {
|
|
|
3
3
|
withCodeHighlightStyles: boolean;
|
|
4
4
|
withTypographyStyles: boolean;
|
|
5
5
|
}
|
|
6
|
-
declare const _default: (params: ContentStylesParams, options?: import("@mantine/core").UseStylesOptions<
|
|
7
|
-
classes:
|
|
6
|
+
declare const _default: (params: ContentStylesParams, options?: import("@mantine/core").UseStylesOptions<string>) => {
|
|
7
|
+
classes: {
|
|
8
|
+
typographyStylesProvider: string;
|
|
9
|
+
content: string;
|
|
10
|
+
};
|
|
8
11
|
cx: (...args: any) => string;
|
|
9
12
|
theme: MantineTheme;
|
|
10
13
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Content.styles.d.ts","sourceRoot":"","sources":["../../src/Content/Content.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,YAAY,EAAE,MAAM,eAAe,CAAC;AAE3D,UAAU,mBAAmB;IAC3B,uBAAuB,EAAE,OAAO,CAAC;IACjC,oBAAoB,EAAE,OAAO,CAAC;CAC/B
|
|
1
|
+
{"version":3,"file":"Content.styles.d.ts","sourceRoot":"","sources":["../../src/Content/Content.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,YAAY,EAAE,MAAM,eAAe,CAAC;AAE3D,UAAU,mBAAmB;IAC3B,uBAAuB,EAAE,OAAO,CAAC;IACjC,oBAAoB,EAAE,OAAO,CAAC;CAC/B;;;;;;;;;AA6FD,wBA8BE"}
|
package/lib/RichTextEditor.d.ts
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { DefaultProps, Selectors } from '@mantine/core';
|
|
3
3
|
import { Editor } from '@tiptap/react';
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
4
|
+
import { ForwardRefWithStaticComponents } from '@mantine/utils';
|
|
5
|
+
import * as controls from './controls';
|
|
6
|
+
import { Content, ContentStylesNames } from './Content/Content';
|
|
7
|
+
import { Control, ControlStylesNames } from './controls/Control/Control';
|
|
8
|
+
import { ControlsGroup, ControlsGroupStylesNames } from './controls/ControlsGroup/ControlsGroup';
|
|
9
|
+
import { Toolbar, ToolbarStylesNames } from './Toolbar/Toolbar';
|
|
8
10
|
import { LinkControlStylesNames } from './controls/LinkControl/LinkControl';
|
|
9
11
|
import { RichTextEditorLabels } from './labels';
|
|
10
12
|
import useStyles from './RichTextEditor.styles';
|
|
@@ -21,5 +23,41 @@ export interface RichTextEditorProps extends DefaultProps<RichTextEditorStylesNa
|
|
|
21
23
|
/** Child editor components */
|
|
22
24
|
children: React.ReactNode;
|
|
23
25
|
}
|
|
24
|
-
|
|
26
|
+
declare type RichTextEditorComponent = ForwardRefWithStaticComponents<RichTextEditorProps, {
|
|
27
|
+
Content: typeof Content;
|
|
28
|
+
Control: typeof Control;
|
|
29
|
+
ControlsGroup: typeof ControlsGroup;
|
|
30
|
+
Toolbar: typeof Toolbar;
|
|
31
|
+
Bold: typeof controls.BoldControl;
|
|
32
|
+
Italic: typeof controls.ItalicControl;
|
|
33
|
+
Strikethrough: typeof controls.StrikeThroughControl;
|
|
34
|
+
Underline: typeof controls.UnderlineControl;
|
|
35
|
+
ClearFormatting: typeof controls.ClearFormattingControl;
|
|
36
|
+
H1: typeof controls.H1Control;
|
|
37
|
+
H2: typeof controls.H2Control;
|
|
38
|
+
H3: typeof controls.H3Control;
|
|
39
|
+
H4: typeof controls.H4Control;
|
|
40
|
+
H5: typeof controls.H5Control;
|
|
41
|
+
H6: typeof controls.H6Control;
|
|
42
|
+
BulletList: typeof controls.BulletListControl;
|
|
43
|
+
OrderedList: typeof controls.OrderedListControl;
|
|
44
|
+
Link: typeof controls.LinkControl;
|
|
45
|
+
Unlink: typeof controls.UnlinkControl;
|
|
46
|
+
Blockquote: typeof controls.BlockquoteControl;
|
|
47
|
+
AlignLeft: typeof controls.AlignLeftControl;
|
|
48
|
+
AlignRight: typeof controls.AlignRightControl;
|
|
49
|
+
AlignCenter: typeof controls.AlignCenterControl;
|
|
50
|
+
AlignJustify: typeof controls.AlignJustifyControl;
|
|
51
|
+
Superscript: typeof controls.SuperscriptControl;
|
|
52
|
+
Subscript: typeof controls.SubscriptControl;
|
|
53
|
+
Code: typeof controls.CodeControl;
|
|
54
|
+
CodeBlock: typeof controls.CodeBlockControl;
|
|
55
|
+
ColorPicker: typeof controls.ColorPickerControl;
|
|
56
|
+
Color: typeof controls.ColorControl;
|
|
57
|
+
Highlight: typeof controls.HighlightControl;
|
|
58
|
+
Hr: typeof controls.HrControl;
|
|
59
|
+
UnsetColor: typeof controls.UnsetColorControl;
|
|
60
|
+
}>;
|
|
61
|
+
export declare const RichTextEditor: RichTextEditorComponent;
|
|
62
|
+
export {};
|
|
25
63
|
//# sourceMappingURL=RichTextEditor.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
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;
|
|
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;AACvC,OAAO,EAAE,8BAA8B,EAAE,MAAM,gBAAgB,CAAC;AAEhE,OAAO,KAAK,QAAQ,MAAM,YAAY,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAChE,OAAO,EAAE,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AACzE,OAAO,EAAE,aAAa,EAAE,wBAAwB,EAAE,MAAM,wCAAwC,CAAC;AACjG,OAAO,EAAE,OAAO,EAAE,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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C,UAAU,EAAE,OAAO,QAAQ,CAAC,iBAAiB,CAAC;IAC9C,SAAS,EAAE,OAAO,QAAQ,CAAC,gBAAgB,CAAC;IAC5C,UAAU,EAAE,OAAO,QAAQ,CAAC,iBAAiB,CAAC;IAC9C,WAAW,EAAE,OAAO,QAAQ,CAAC,kBAAkB,CAAC;IAChD,YAAY,EAAE,OAAO,QAAQ,CAAC,mBAAmB,CAAC;IAClD,WAAW,EAAE,OAAO,QAAQ,CAAC,kBAAkB,CAAC;IAChD,SAAS,EAAE,OAAO,QAAQ,CAAC,gBAAgB,CAAC;IAC5C,IAAI,EAAE,OAAO,QAAQ,CAAC,WAAW,CAAC;IAClC,SAAS,EAAE,OAAO,QAAQ,CAAC,gBAAgB,CAAC;IAC5C,WAAW,EAAE,OAAO,QAAQ,CAAC,kBAAkB,CAAC;IAChD,KAAK,EAAE,OAAO,QAAQ,CAAC,YAAY,CAAC;IACpC,SAAS,EAAE,OAAO,QAAQ,CAAC,gBAAgB,CAAC;IAC5C,EAAE,EAAE,OAAO,QAAQ,CAAC,SAAS,CAAC;IAC9B,UAAU,EAAE,OAAO,QAAQ,CAAC,iBAAiB,CAAC;CAC/C,CACF,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,uBAmCpB,CAAC"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
declare const _default: (params: void, options?: import("@mantine/core").UseStylesOptions<
|
|
2
|
-
classes:
|
|
1
|
+
declare const _default: (params: void, options?: import("@mantine/core").UseStylesOptions<string>) => {
|
|
2
|
+
classes: {
|
|
3
|
+
root: string;
|
|
4
|
+
};
|
|
3
5
|
cx: (...args: any) => string;
|
|
4
6
|
theme: import("@mantine/core").MantineTheme;
|
|
5
7
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RichTextEditor.styles.d.ts","sourceRoot":"","sources":["../src/RichTextEditor.styles.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"RichTextEditor.styles.d.ts","sourceRoot":"","sources":["../src/RichTextEditor.styles.ts"],"names":[],"mappings":";;;;;;;AAEA,wBAQI"}
|
|
@@ -3,8 +3,10 @@ export interface ToolbarStylesParams {
|
|
|
3
3
|
sticky: boolean;
|
|
4
4
|
stickyOffset: React.CSSProperties['top'];
|
|
5
5
|
}
|
|
6
|
-
declare const _default: (params: ToolbarStylesParams, options?: import("@mantine/core").UseStylesOptions<
|
|
7
|
-
classes:
|
|
6
|
+
declare const _default: (params: ToolbarStylesParams, options?: import("@mantine/core").UseStylesOptions<string>) => {
|
|
7
|
+
classes: {
|
|
8
|
+
toolbar: string;
|
|
9
|
+
};
|
|
8
10
|
cx: (...args: any) => string;
|
|
9
11
|
theme: import("@mantine/core").MantineTheme;
|
|
10
12
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Toolbar.styles.d.ts","sourceRoot":"","sources":["../../src/Toolbar/Toolbar.styles.ts"],"names":[],"mappings":";AAEA,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,OAAO,CAAC;IAChB,YAAY,EAAE,KAAK,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;CAC1C
|
|
1
|
+
{"version":3,"file":"Toolbar.styles.d.ts","sourceRoot":"","sources":["../../src/Toolbar/Toolbar.styles.ts"],"names":[],"mappings":";AAEA,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,OAAO,CAAC;IAChB,YAAY,EAAE,KAAK,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;CAC1C;;;;;;;;AAED,wBAaI"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
declare const _default: (params: void, options?: import("@mantine/core").UseStylesOptions<
|
|
2
|
-
classes:
|
|
1
|
+
declare const _default: (params: void, options?: import("@mantine/core").UseStylesOptions<string>) => {
|
|
2
|
+
classes: {
|
|
3
|
+
control: string;
|
|
4
|
+
};
|
|
3
5
|
cx: (...args: any) => string;
|
|
4
6
|
theme: import("@mantine/core").MantineTheme;
|
|
5
7
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Control.styles.d.ts","sourceRoot":"","sources":["../../../src/controls/Control/Control.styles.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Control.styles.d.ts","sourceRoot":"","sources":["../../../src/controls/Control/Control.styles.ts"],"names":[],"mappings":";;;;;;;AAEA,wBAkCG"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
declare const _default: (params: void, options?: import("@mantine/core").UseStylesOptions<
|
|
2
|
-
classes:
|
|
1
|
+
declare const _default: (params: void, options?: import("@mantine/core").UseStylesOptions<string>) => {
|
|
2
|
+
classes: {
|
|
3
|
+
controlsGroup: string;
|
|
4
|
+
};
|
|
3
5
|
cx: (...args: any) => string;
|
|
4
6
|
theme: import("@mantine/core").MantineTheme;
|
|
5
7
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ControlsGroup.styles.d.ts","sourceRoot":"","sources":["../../../src/controls/ControlsGroup/ControlsGroup.styles.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ControlsGroup.styles.d.ts","sourceRoot":"","sources":["../../../src/controls/ControlsGroup/ControlsGroup.styles.ts"],"names":[],"mappings":";;;;;;;AAEA,wBAsBI"}
|
|
@@ -1,5 +1,10 @@
|
|
|
1
|
-
declare const _default: (params: void, options?: import("@mantine/core").UseStylesOptions<
|
|
2
|
-
classes:
|
|
1
|
+
declare const _default: (params: void, options?: import("@mantine/core").UseStylesOptions<string>) => {
|
|
2
|
+
classes: {
|
|
3
|
+
linkEditor: string;
|
|
4
|
+
linkEditorInput: string;
|
|
5
|
+
linkEditorExternalControl: string;
|
|
6
|
+
linkEditorSave: string;
|
|
7
|
+
};
|
|
3
8
|
cx: (...args: any) => string;
|
|
4
9
|
theme: import("@mantine/core").MantineTheme;
|
|
5
10
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LinkControl.styles.d.ts","sourceRoot":"","sources":["../../../src/controls/LinkControl/LinkControl.styles.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"LinkControl.styles.d.ts","sourceRoot":"","sources":["../../../src/controls/LinkControl/LinkControl.styles.ts"],"names":[],"mappings":";;;;;;;;;;AAEA,wBAuCG"}
|
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.9.
|
|
4
|
+
"version": "5.9.3",
|
|
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.9.
|
|
31
|
-
"@mantine/hooks": "5.9.
|
|
30
|
+
"@mantine/core": "5.9.3",
|
|
31
|
+
"@mantine/hooks": "5.9.3",
|
|
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.9.
|
|
38
|
+
"@mantine/utils": "5.9.3"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {}
|
|
41
41
|
}
|