@mantine/tiptap 5.7.2 → 5.8.1
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 -0
- package/cjs/Content/Content.styles.js.map +1 -1
- package/cjs/RichTextEditor.js +2 -1
- package/cjs/RichTextEditor.js.map +1 -1
- package/cjs/controls/ColorPickerControl/ColorPickerControl.js +22 -42
- package/cjs/controls/ColorPickerControl/ColorPickerControl.js.map +1 -1
- package/cjs/controls/controls.js +11 -3
- package/cjs/controls/controls.js.map +1 -1
- package/cjs/labels.js +3 -1
- package/cjs/labels.js.map +1 -1
- package/esm/Content/Content.styles.js +1 -0
- package/esm/Content/Content.styles.js.map +1 -1
- package/esm/RichTextEditor.js +3 -2
- package/esm/RichTextEditor.js.map +1 -1
- package/esm/controls/ColorPickerControl/ColorPickerControl.js +22 -42
- package/esm/controls/ColorPickerControl/ColorPickerControl.js.map +1 -1
- package/esm/controls/controls.js +11 -4
- package/esm/controls/controls.js.map +1 -1
- package/esm/labels.js +3 -1
- package/esm/labels.js.map +1 -1
- package/lib/Content/Content.styles.d.ts.map +1 -1
- package/lib/RichTextEditor.d.ts +2 -1
- package/lib/RichTextEditor.d.ts.map +1 -1
- package/lib/controls/ColorPickerControl/ColorPickerControl.d.ts +0 -2
- package/lib/controls/ColorPickerControl/ColorPickerControl.d.ts.map +1 -1
- package/lib/controls/LinkControl/LinkControl.styles.d.ts +2 -2
- package/lib/controls/controls.d.ts +2 -1
- package/lib/controls/controls.d.ts.map +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/labels.d.ts +9 -5
- package/lib/labels.d.ts.map +1 -1
- package/package.json +4 -4
|
@@ -91,6 +91,7 @@ function getTypographyStyles(withTypographyStyles) {
|
|
|
91
91
|
var useStyles = core.createStyles((theme, { withCodeHighlightStyles, withTypographyStyles }) => ({
|
|
92
92
|
typographyStylesProvider: __spreadValues({}, getTypographyStyles(withTypographyStyles)),
|
|
93
93
|
content: __spreadValues({
|
|
94
|
+
backgroundColor: theme.colorScheme === "dark" ? theme.colors.dark[7] : theme.white,
|
|
94
95
|
padding: theme.spacing.md,
|
|
95
96
|
"& .ProseMirror": {
|
|
96
97
|
outline: 0
|
|
@@ -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 padding: theme.spacing.md,\n\n '& .ProseMirror': {\n outline: 0,\n },\n\n '& .ProseMirror > *:last-child': {\n marginBottom: 0,\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,SAAS,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,GAAG,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BAAgB,CAAC,uBAAuB,EAAE,KAAK,CAAC,CAAC;AACtD,CAAC,CAAC,CAAC;;;;"}
|
|
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\n '& .ProseMirror': {\n outline: 0,\n },\n\n '& .ProseMirror > *:last-child': {\n marginBottom: 0,\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,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,C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AAE;AACrC,MAAM,YAAY,EAAE,CAAC;AACrB,KAAK;AACL,GAAG,EAAE,gBAAgB,CAAC,uBAAuB,EAAE,KAAK,CAAC,CAAC;AACtD,CAAC,CAAC,CAAC;;;;"}
|
package/cjs/RichTextEditor.js
CHANGED
|
@@ -92,7 +92,7 @@ RichTextEditor.ControlsGroup = ControlsGroup.ControlsGroup;
|
|
|
92
92
|
RichTextEditor.Toolbar = Toolbar.Toolbar;
|
|
93
93
|
RichTextEditor.Bold = controls.BoldControl;
|
|
94
94
|
RichTextEditor.Italic = controls.ItalicControl;
|
|
95
|
-
RichTextEditor.Strikethrough = controls.
|
|
95
|
+
RichTextEditor.Strikethrough = controls.StrikeThroughControl;
|
|
96
96
|
RichTextEditor.Underline = controls.UnderlineControl;
|
|
97
97
|
RichTextEditor.ClearFormatting = controls.ClearFormattingControl;
|
|
98
98
|
RichTextEditor.H1 = controls.H1Control;
|
|
@@ -118,6 +118,7 @@ RichTextEditor.ColorPicker = ColorPickerControl.ColorPickerControl;
|
|
|
118
118
|
RichTextEditor.Color = ColorControl.ColorControl;
|
|
119
119
|
RichTextEditor.Highlight = controls.HighlightControl;
|
|
120
120
|
RichTextEditor.Hr = controls.HrControl;
|
|
121
|
+
RichTextEditor.UnsetColor = controls.UnsetColorControl;
|
|
121
122
|
RichTextEditor.displayName = "@mantine/tiptap/RichTextEditor";
|
|
122
123
|
|
|
123
124
|
exports.RichTextEditor = RichTextEditor;
|
|
@@ -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;\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.
|
|
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,cAAc,GAAG,CAAC,CAAC,EAAE,CAAC,KAAK;AAC/B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B,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;;;;"}
|
|
@@ -45,7 +45,7 @@ var __objRest = (source, exclude) => {
|
|
|
45
45
|
return target;
|
|
46
46
|
};
|
|
47
47
|
const ColorPickerControl = React.forwardRef((_a, ref) => {
|
|
48
|
-
var _b = _a, { popoverProps, colors,
|
|
48
|
+
var _b = _a, { popoverProps, colors, colorPickerProps } = _b, others = __objRest(_b, ["popoverProps", "colors", "colorPickerProps"]);
|
|
49
49
|
const { unstyled } = core.useContextStylesApi();
|
|
50
50
|
const { editor, labels } = RichTextEditor_context.useRichTextEditorContext();
|
|
51
51
|
const [opened, { toggle, close }] = hooks.useDisclosure(false);
|
|
@@ -104,72 +104,52 @@ const ColorPickerControl = React.forwardRef((_a, ref) => {
|
|
|
104
104
|
position: "right",
|
|
105
105
|
spacing: "xs",
|
|
106
106
|
mt: "sm"
|
|
107
|
-
}, state === "palette" && /* @__PURE__ */ React__default.createElement(core.
|
|
108
|
-
label: labels.colorPickerCancel,
|
|
109
|
-
withArrow: true,
|
|
110
|
-
withinPortal: true,
|
|
111
|
-
unstyled,
|
|
112
|
-
disabled: disableTooltips
|
|
113
|
-
}, /* @__PURE__ */ React__default.createElement(core.ActionIcon, {
|
|
107
|
+
}, state === "palette" && /* @__PURE__ */ React__default.createElement(core.ActionIcon, {
|
|
114
108
|
variant: "default",
|
|
115
109
|
onClick: close,
|
|
116
|
-
unstyled
|
|
110
|
+
unstyled,
|
|
111
|
+
title: labels.colorPickerCancel,
|
|
112
|
+
"aria-label": labels.colorPickerCancel
|
|
117
113
|
}, /* @__PURE__ */ React__default.createElement(icons.IconX, {
|
|
118
114
|
stroke: 1.5,
|
|
119
115
|
size: 16
|
|
120
|
-
}))
|
|
121
|
-
label: labels.colorPickerClear,
|
|
122
|
-
withArrow: true,
|
|
123
|
-
withinPortal: true,
|
|
124
|
-
unstyled,
|
|
125
|
-
disabled: disableTooltips
|
|
126
|
-
}, /* @__PURE__ */ React__default.createElement(core.ActionIcon, {
|
|
116
|
+
})), /* @__PURE__ */ React__default.createElement(core.ActionIcon, {
|
|
127
117
|
variant: "default",
|
|
128
118
|
onClick: handleClear,
|
|
129
|
-
unstyled
|
|
119
|
+
unstyled,
|
|
120
|
+
title: labels.colorPickerClear,
|
|
121
|
+
"aria-label": labels.colorPickerClear
|
|
130
122
|
}, /* @__PURE__ */ React__default.createElement(icons.IconCircleOff, {
|
|
131
123
|
stroke: 1.5,
|
|
132
124
|
size: 16
|
|
133
|
-
}))
|
|
134
|
-
label: labels.colorPickerColorPicker,
|
|
135
|
-
withArrow: true,
|
|
136
|
-
withinPortal: true,
|
|
137
|
-
unstyled,
|
|
138
|
-
disabled: disableTooltips
|
|
139
|
-
}, /* @__PURE__ */ React__default.createElement(core.ActionIcon, {
|
|
125
|
+
})), state === "palette" ? /* @__PURE__ */ React__default.createElement(core.ActionIcon, {
|
|
140
126
|
variant: "default",
|
|
141
127
|
onClick: () => setState("colorPicker"),
|
|
142
|
-
unstyled
|
|
128
|
+
unstyled,
|
|
129
|
+
title: labels.colorPickerColorPicker,
|
|
130
|
+
"aria-label": labels.colorPickerColorPicker
|
|
143
131
|
}, /* @__PURE__ */ React__default.createElement(icons.IconColorPicker, {
|
|
144
132
|
stroke: 1.5,
|
|
145
133
|
size: 16
|
|
146
|
-
}))
|
|
147
|
-
label: labels.colorPickerPalette,
|
|
148
|
-
withArrow: true,
|
|
149
|
-
withinPortal: true,
|
|
150
|
-
disabled: disableTooltips,
|
|
151
|
-
unstyled
|
|
152
|
-
}, /* @__PURE__ */ React__default.createElement(core.ActionIcon, {
|
|
134
|
+
})) : /* @__PURE__ */ React__default.createElement(core.ActionIcon, {
|
|
153
135
|
variant: "default",
|
|
154
136
|
onClick: () => setState("palette"),
|
|
155
|
-
unstyled
|
|
137
|
+
unstyled,
|
|
138
|
+
"aria-label": labels.colorPickerPalette,
|
|
139
|
+
title: labels.colorPickerPalette
|
|
156
140
|
}, /* @__PURE__ */ React__default.createElement(icons.IconPalette, {
|
|
157
141
|
stroke: 1.5,
|
|
158
142
|
size: 16
|
|
159
|
-
}))
|
|
160
|
-
label: labels.colorPickerSave,
|
|
161
|
-
withArrow: true,
|
|
162
|
-
withinPortal: true,
|
|
163
|
-
disabled: disableTooltips,
|
|
164
|
-
unstyled
|
|
165
|
-
}, /* @__PURE__ */ React__default.createElement(core.ActionIcon, {
|
|
143
|
+
})), state === "colorPicker" && /* @__PURE__ */ React__default.createElement(core.ActionIcon, {
|
|
166
144
|
variant: "default",
|
|
167
145
|
onClick: close,
|
|
168
|
-
unstyled
|
|
146
|
+
unstyled,
|
|
147
|
+
title: labels.colorPickerSave,
|
|
148
|
+
"aria-label": labels.colorPickerSave
|
|
169
149
|
}, /* @__PURE__ */ React__default.createElement(icons.IconCheck, {
|
|
170
150
|
stroke: 1.5,
|
|
171
151
|
size: 16
|
|
172
|
-
}))))))
|
|
152
|
+
}))))));
|
|
173
153
|
});
|
|
174
154
|
ColorPickerControl.displayName = "@mantine/tiptap/ColorPickerControl";
|
|
175
155
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ColorPickerControl.js","sources":["../../../src/controls/ColorPickerControl/ColorPickerControl.tsx"],"sourcesContent":["import React, { forwardRef, useState } from 'react';\nimport {\n DefaultProps,\n Popover,\n PopoverProps,\n ColorSwatch,\n SimpleGrid,\n ColorPicker,\n Group,\n ActionIcon,\n Tooltip,\n ColorPickerProps,\n useContextStylesApi,\n} from '@mantine/core';\nimport { useDisclosure } from '@mantine/hooks';\nimport { IconCircleOff, IconColorPicker, IconX, IconPalette, IconCheck } from '@tabler/icons';\nimport { Control } from '../Control/Control';\nimport { useRichTextEditorContext } from '../../RichTextEditor.context';\n\nexport interface ColorPickerControlProps\n extends DefaultProps,\n React.ComponentPropsWithoutRef<'button'> {\n /** Props added to Popover component */\n popoverProps?: Partial<PopoverProps>;\n\n /** Props added to ColorPicker component */\n colorPickerProps?: Partial<ColorPickerProps>;\n\n /** List of colors that the user can choose from */\n colors: string[];\n\n /** Determines whether tooltips over controls should be visible */\n disableTooltips?: boolean;\n}\n\nexport const ColorPickerControl = forwardRef<HTMLButtonElement, ColorPickerControlProps>(\n ({ popoverProps, colors, disableTooltips, colorPickerProps, ...others }, ref) => {\n const { unstyled } = useContextStylesApi();\n const { editor, labels } = useRichTextEditorContext();\n const [opened, { toggle, close }] = useDisclosure(false);\n const [state, setState] = useState<'palette' | 'colorPicker'>('palette');\n const currentColor = editor?.getAttributes('textStyle').color || '#000';\n\n const handleChange = (value: string, shouldClose = true) => {\n (editor.chain() as any).focus().setColor(value).run();\n shouldClose && close();\n };\n\n const handleClear = () => {\n (editor.chain() as any).focus().unsetColor().run();\n close();\n };\n\n const controls = colors.map((color, index) => (\n <ColorSwatch\n key={index}\n component=\"button\"\n color={color}\n onClick={() => handleChange(color)}\n size={26}\n radius=\"xs\"\n sx={{ cursor: 'pointer' }}\n title={labels.colorPickerColorLabel(color)}\n aria-label={labels.colorPickerColorLabel(color)}\n unstyled={unstyled}\n />\n ));\n\n return (\n <Popover\n opened={opened}\n withinPortal\n trapFocus\n onClose={close}\n unstyled={unstyled}\n {...popoverProps}\n >\n <Popover.Target>\n <Control\n aria-label={labels.colorPickerControlLabel}\n title={labels.colorPickerControlLabel}\n {...others}\n ref={ref}\n onClick={toggle}\n >\n <ColorSwatch color={currentColor} size={14} unstyled={unstyled} />\n </Control>\n </Popover.Target>\n\n <Popover.Dropdown\n sx={(theme) => ({\n backgroundColor: theme.colorScheme === 'dark' ? theme.colors.dark[7] : theme.white,\n })}\n >\n {state === 'palette' && (\n <SimpleGrid cols={7} spacing={2}>\n {controls}\n </SimpleGrid>\n )}\n\n {state === 'colorPicker' && (\n <ColorPicker\n defaultValue={currentColor}\n onChange={(value) => handleChange(value, false)}\n unstyled={unstyled}\n {...colorPickerProps}\n />\n )}\n\n <Tooltip.Group closeDelay={200}>\n <Group position=\"right\" spacing=\"xs\" mt=\"sm\">\n {state === 'palette' && (\n <Tooltip\n label={labels.colorPickerCancel}\n withArrow\n withinPortal\n unstyled={unstyled}\n disabled={disableTooltips}\n >\n <ActionIcon variant=\"default\" onClick={close} unstyled={unstyled}>\n <IconX stroke={1.5} size={16} />\n </ActionIcon>\n </Tooltip>\n )}\n\n <Tooltip\n label={labels.colorPickerClear}\n withArrow\n withinPortal\n unstyled={unstyled}\n disabled={disableTooltips}\n >\n <ActionIcon variant=\"default\" onClick={handleClear} unstyled={unstyled}>\n <IconCircleOff stroke={1.5} size={16} />\n </ActionIcon>\n </Tooltip>\n\n {state === 'palette' ? (\n <Tooltip\n label={labels.colorPickerColorPicker}\n withArrow\n withinPortal\n unstyled={unstyled}\n disabled={disableTooltips}\n >\n <ActionIcon\n variant=\"default\"\n onClick={() => setState('colorPicker')}\n unstyled={unstyled}\n >\n <IconColorPicker stroke={1.5} size={16} />\n </ActionIcon>\n </Tooltip>\n ) : (\n <Tooltip\n label={labels.colorPickerPalette}\n withArrow\n withinPortal\n disabled={disableTooltips}\n unstyled={unstyled}\n >\n <ActionIcon\n variant=\"default\"\n onClick={() => setState('palette')}\n unstyled={unstyled}\n >\n <IconPalette stroke={1.5} size={16} />\n </ActionIcon>\n </Tooltip>\n )}\n\n {state === 'colorPicker' && (\n <Tooltip\n label={labels.colorPickerSave}\n withArrow\n withinPortal\n disabled={disableTooltips}\n unstyled={unstyled}\n >\n <ActionIcon variant=\"default\" onClick={close} unstyled={unstyled}>\n <IconCheck stroke={1.5} size={16} />\n </ActionIcon>\n </Tooltip>\n )}\n </Group>\n </Tooltip.Group>\n </Popover.Dropdown>\n </Popover>\n );\n }\n);\n\nColorPickerControl.displayName = '@mantine/tiptap/ColorPickerControl';\n"],"names":["forwardRef","useContextStylesApi","useRichTextEditorContext","useDisclosure","useState","React","ColorSwatch","Popover","Control","SimpleGrid","ColorPicker","Tooltip","Group","ActionIcon","IconX","IconCircleOff","IconColorPicker","IconPalette","IconCheck"],"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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, { forwardRef, useState } from 'react';\nimport {\n DefaultProps,\n Popover,\n PopoverProps,\n ColorSwatch,\n SimpleGrid,\n ColorPicker,\n Group,\n ActionIcon,\n Tooltip,\n ColorPickerProps,\n useContextStylesApi,\n} from '@mantine/core';\nimport { useDisclosure } from '@mantine/hooks';\nimport { IconCircleOff, IconColorPicker, IconX, IconPalette, IconCheck } from '@tabler/icons';\nimport { Control } from '../Control/Control';\nimport { useRichTextEditorContext } from '../../RichTextEditor.context';\n\nexport interface ColorPickerControlProps\n extends DefaultProps,\n React.ComponentPropsWithoutRef<'button'> {\n /** Props added to Popover component */\n popoverProps?: Partial<PopoverProps>;\n\n /** Props added to ColorPicker component */\n colorPickerProps?: Partial<ColorPickerProps>;\n\n /** List of colors that the user can choose from */\n colors: string[];\n}\n\nexport const ColorPickerControl = forwardRef<HTMLButtonElement, ColorPickerControlProps>(\n ({ popoverProps, colors, colorPickerProps, ...others }, ref) => {\n const { unstyled } = useContextStylesApi();\n const { editor, labels } = useRichTextEditorContext();\n const [opened, { toggle, close }] = useDisclosure(false);\n const [state, setState] = useState<'palette' | 'colorPicker'>('palette');\n const currentColor = editor?.getAttributes('textStyle').color || '#000';\n\n const handleChange = (value: string, shouldClose = true) => {\n (editor.chain() as any).focus().setColor(value).run();\n shouldClose && close();\n };\n\n const handleClear = () => {\n (editor.chain() as any).focus().unsetColor().run();\n close();\n };\n\n const controls = colors.map((color, index) => (\n <ColorSwatch\n key={index}\n component=\"button\"\n color={color}\n onClick={() => handleChange(color)}\n size={26}\n radius=\"xs\"\n sx={{ cursor: 'pointer' }}\n title={labels.colorPickerColorLabel(color)}\n aria-label={labels.colorPickerColorLabel(color)}\n unstyled={unstyled}\n />\n ));\n\n return (\n <Popover\n opened={opened}\n withinPortal\n trapFocus\n onClose={close}\n unstyled={unstyled}\n {...popoverProps}\n >\n <Popover.Target>\n <Control\n aria-label={labels.colorPickerControlLabel}\n title={labels.colorPickerControlLabel}\n {...others}\n ref={ref}\n onClick={toggle}\n >\n <ColorSwatch color={currentColor} size={14} unstyled={unstyled} />\n </Control>\n </Popover.Target>\n\n <Popover.Dropdown\n sx={(theme) => ({\n backgroundColor: theme.colorScheme === 'dark' ? theme.colors.dark[7] : theme.white,\n })}\n >\n {state === 'palette' && (\n <SimpleGrid cols={7} spacing={2}>\n {controls}\n </SimpleGrid>\n )}\n\n {state === 'colorPicker' && (\n <ColorPicker\n defaultValue={currentColor}\n onChange={(value) => handleChange(value, false)}\n unstyled={unstyled}\n {...colorPickerProps}\n />\n )}\n\n <Tooltip.Group closeDelay={200}>\n <Group position=\"right\" spacing=\"xs\" mt=\"sm\">\n {state === 'palette' && (\n <ActionIcon\n variant=\"default\"\n onClick={close}\n unstyled={unstyled}\n title={labels.colorPickerCancel}\n aria-label={labels.colorPickerCancel}\n >\n <IconX stroke={1.5} size={16} />\n </ActionIcon>\n )}\n\n <ActionIcon\n variant=\"default\"\n onClick={handleClear}\n unstyled={unstyled}\n title={labels.colorPickerClear}\n aria-label={labels.colorPickerClear}\n >\n <IconCircleOff stroke={1.5} size={16} />\n </ActionIcon>\n\n {state === 'palette' ? (\n <ActionIcon\n variant=\"default\"\n onClick={() => setState('colorPicker')}\n unstyled={unstyled}\n title={labels.colorPickerColorPicker}\n aria-label={labels.colorPickerColorPicker}\n >\n <IconColorPicker stroke={1.5} size={16} />\n </ActionIcon>\n ) : (\n <ActionIcon\n variant=\"default\"\n onClick={() => setState('palette')}\n unstyled={unstyled}\n aria-label={labels.colorPickerPalette}\n title={labels.colorPickerPalette}\n >\n <IconPalette stroke={1.5} size={16} />\n </ActionIcon>\n )}\n\n {state === 'colorPicker' && (\n <ActionIcon\n variant=\"default\"\n onClick={close}\n unstyled={unstyled}\n title={labels.colorPickerSave}\n aria-label={labels.colorPickerSave}\n >\n <IconCheck stroke={1.5} size={16} />\n </ActionIcon>\n )}\n </Group>\n </Tooltip.Group>\n </Popover.Dropdown>\n </Popover>\n );\n }\n);\n\nColorPickerControl.displayName = '@mantine/tiptap/ColorPickerControl';\n"],"names":["forwardRef","useContextStylesApi","useRichTextEditorContext","useDisclosure","useState","React","ColorSwatch","Popover","Control","SimpleGrid","ColorPicker","Tooltip","Group","ActionIcon","IconX","IconCircleOff","IconColorPicker","IconPalette","IconCheck"],"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,QAA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MAAM,EAAE,GAAG;AACf,IAAI,IAAI,EAAE,EAAE;AACZ,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACV,CAAC,EAAE;AACH,kBAAkB,CAAC,WAAW,GAAG,oCAAoC;;;;"}
|
package/cjs/controls/controls.js
CHANGED
|
@@ -53,7 +53,7 @@ const UnderlineControl = createControl.createControl({
|
|
|
53
53
|
isActive: { name: "underline" },
|
|
54
54
|
operation: { name: "toggleUnderline" }
|
|
55
55
|
});
|
|
56
|
-
const
|
|
56
|
+
const StrikeThroughControl = createControl.createControl({
|
|
57
57
|
label: "strikeControlLabel",
|
|
58
58
|
icon: (props) => /* @__PURE__ */ React__default.createElement(icons.IconStrikethrough, __spreadProps(__spreadValues({}, props), {
|
|
59
59
|
stroke: 1.5
|
|
@@ -216,12 +216,19 @@ const HighlightControl = createControl.createControl({
|
|
|
216
216
|
operation: { name: "toggleHighlight" }
|
|
217
217
|
});
|
|
218
218
|
const HrControl = createControl.createControl({
|
|
219
|
-
label: "
|
|
219
|
+
label: "hrControlLabel",
|
|
220
220
|
icon: (props) => /* @__PURE__ */ React__default.createElement(icons.IconLineDashed, __spreadProps(__spreadValues({}, props), {
|
|
221
221
|
stroke: 1.5
|
|
222
222
|
})),
|
|
223
223
|
operation: { name: "setHorizontalRule" }
|
|
224
224
|
});
|
|
225
|
+
const UnsetColorControl = createControl.createControl({
|
|
226
|
+
label: "unsetColorControlLabel",
|
|
227
|
+
icon: (props) => /* @__PURE__ */ React__default.createElement(icons.IconCircleOff, __spreadProps(__spreadValues({}, props), {
|
|
228
|
+
stroke: 1.5
|
|
229
|
+
})),
|
|
230
|
+
operation: { name: "unsetColor" }
|
|
231
|
+
});
|
|
225
232
|
|
|
226
233
|
exports.AlignCenterControl = AlignCenterControl;
|
|
227
234
|
exports.AlignJustifyControl = AlignJustifyControl;
|
|
@@ -243,9 +250,10 @@ exports.HighlightControl = HighlightControl;
|
|
|
243
250
|
exports.HrControl = HrControl;
|
|
244
251
|
exports.ItalicControl = ItalicControl;
|
|
245
252
|
exports.OrderedListControl = OrderedListControl;
|
|
246
|
-
exports.
|
|
253
|
+
exports.StrikeThroughControl = StrikeThroughControl;
|
|
247
254
|
exports.SubscriptControl = SubscriptControl;
|
|
248
255
|
exports.SuperscriptControl = SuperscriptControl;
|
|
249
256
|
exports.UnderlineControl = UnderlineControl;
|
|
250
257
|
exports.UnlinkControl = UnlinkControl;
|
|
258
|
+
exports.UnsetColorControl = UnsetColorControl;
|
|
251
259
|
//# sourceMappingURL=controls.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"controls.js","sources":["../../src/controls/controls.tsx"],"sourcesContent":["import React from 'react';\nimport {\n IconBold,\n IconItalic,\n IconUnderline,\n IconStrikethrough,\n IconClearFormatting,\n IconH1,\n IconH2,\n IconH3,\n IconH4,\n IconH5,\n IconH6,\n IconList,\n IconListNumbers,\n IconUnlink,\n IconBlockquote,\n IconAlignLeft,\n IconAlignRight,\n IconAlignCenter,\n IconAlignJustified,\n IconSubscript,\n IconSuperscript,\n IconCode,\n IconHighlight,\n IconLineDashed,\n} from '@tabler/icons';\nimport { createControl } from './ControlBase/create-control';\n\nexport const BoldControl = createControl({\n label: 'boldControlLabel',\n icon: (props) => <IconBold {...props} stroke={1.5} />,\n isActive: { name: 'bold' },\n operation: { name: 'toggleBold' },\n});\n\nexport const ItalicControl = createControl({\n label: 'italicControlLabel',\n icon: (props) => <IconItalic {...props} stroke={1.5} />,\n isActive: { name: 'italic' },\n operation: { name: 'toggleItalic' },\n});\n\nexport const UnderlineControl = createControl({\n label: 'underlineControlLabel',\n icon: (props) => <IconUnderline {...props} stroke={1.5} />,\n isActive: { name: 'underline' },\n operation: { name: 'toggleUnderline' },\n});\n\nexport const StrikeThoughControl = createControl({\n label: 'strikeControlLabel',\n icon: (props) => <IconStrikethrough {...props} stroke={1.5} />,\n isActive: { name: 'strike' },\n operation: { name: 'toggleStrike' },\n});\n\nexport const ClearFormattingControl = createControl({\n label: 'clearFormattingControlLabel',\n icon: (props) => <IconClearFormatting {...props} stroke={1.5} />,\n operation: { name: 'unsetAllMarks' },\n});\n\nexport const UnlinkControl = createControl({\n label: 'unlinkControlLabel',\n icon: (props) => <IconUnlink {...props} stroke={1.5} />,\n operation: { name: 'unsetLink' },\n});\n\nexport const BulletListControl = createControl({\n label: 'bulletListControlLabel',\n icon: (props) => <IconList {...props} stroke={1.5} />,\n isActive: { name: 'bulletList' },\n operation: { name: 'toggleBulletList' },\n});\n\nexport const OrderedListControl = createControl({\n label: 'orderedListControlLabel',\n icon: (props) => <IconListNumbers {...props} stroke={1.5} />,\n isActive: { name: 'orderedList' },\n operation: { name: 'toggleOrderedList' },\n});\n\nexport const H1Control = createControl({\n label: 'h1ControlLabel',\n icon: (props) => <IconH1 {...props} stroke={1.5} />,\n isActive: { name: 'heading', attributes: { level: 1 } },\n operation: { name: 'toggleHeading', attributes: { level: 1 } },\n});\n\nexport const H2Control = createControl({\n label: 'h2ControlLabel',\n icon: (props) => <IconH2 {...props} stroke={1.5} />,\n isActive: { name: 'heading', attributes: { level: 2 } },\n operation: { name: 'toggleHeading', attributes: { level: 2 } },\n});\n\nexport const H3Control = createControl({\n label: 'h3ControlLabel',\n icon: (props) => <IconH3 {...props} stroke={1.5} />,\n isActive: { name: 'heading', attributes: { level: 3 } },\n operation: { name: 'toggleHeading', attributes: { level: 3 } },\n});\n\nexport const H4Control = createControl({\n label: 'h4ControlLabel',\n icon: (props) => <IconH4 {...props} stroke={1.5} />,\n isActive: { name: 'heading', attributes: { level: 4 } },\n operation: { name: 'toggleHeading', attributes: { level: 4 } },\n});\n\nexport const H5Control = createControl({\n label: 'h5ControlLabel',\n icon: (props) => <IconH5 {...props} stroke={1.5} />,\n isActive: { name: 'heading', attributes: { level: 5 } },\n operation: { name: 'toggleHeading', attributes: { level: 5 } },\n});\n\nexport const H6Control = createControl({\n label: 'h6ControlLabel',\n icon: (props) => <IconH6 {...props} stroke={1.5} />,\n isActive: { name: 'heading', attributes: { level: 6 } },\n operation: { name: 'toggleHeading', attributes: { level: 6 } },\n});\n\nexport const BlockquoteControl = createControl({\n label: 'blockquoteControlLabel',\n icon: (props) => <IconBlockquote {...props} stroke={1.5} />,\n isActive: { name: 'blockquote' },\n operation: { name: 'toggleBlockquote' },\n});\n\nexport const AlignLeftControl = createControl({\n label: 'alignLeftControlLabel',\n icon: (props) => <IconAlignLeft {...props} stroke={1.5} />,\n operation: { name: 'setTextAlign', attributes: 'left' },\n});\n\nexport const AlignRightControl = createControl({\n label: 'alignRightControlLabel',\n icon: (props) => <IconAlignRight {...props} stroke={1.5} />,\n operation: { name: 'setTextAlign', attributes: 'right' },\n});\n\nexport const AlignCenterControl = createControl({\n label: 'alignCenterControlLabel',\n icon: (props) => <IconAlignCenter {...props} stroke={1.5} />,\n operation: { name: 'setTextAlign', attributes: 'center' },\n});\n\nexport const AlignJustifyControl = createControl({\n label: 'alignJustifyControlLabel',\n icon: (props) => <IconAlignJustified {...props} stroke={1.5} />,\n operation: { name: 'setTextAlign', attributes: 'justify' },\n});\n\nexport const SubscriptControl = createControl({\n label: 'subscriptControlLabel',\n icon: (props) => <IconSubscript {...props} stroke={1.5} />,\n isActive: { name: 'subscript' },\n operation: { name: 'toggleSubscript' },\n});\n\nexport const SuperscriptControl = createControl({\n label: 'superscriptControlLabel',\n icon: (props) => <IconSuperscript {...props} stroke={1.5} />,\n isActive: { name: 'superscript' },\n operation: { name: 'toggleSuperscript' },\n});\n\nexport const CodeControl = createControl({\n label: 'codeControlLabel',\n icon: (props) => <IconCode {...props} stroke={1.5} />,\n isActive: { name: 'code' },\n operation: { name: 'toggleCode' },\n});\n\nexport const CodeBlockControl = createControl({\n label: 'codeBlockControlLabel',\n icon: (props) => <IconCode {...props} stroke={1.5} />,\n isActive: { name: 'codeBlock' },\n operation: { name: 'toggleCodeBlock' },\n});\n\nexport const HighlightControl = createControl({\n label: 'highlightControlLabel',\n icon: (props) => <IconHighlight {...props} stroke={1.5} />,\n isActive: { name: 'highlight' },\n operation: { name: 'toggleHighlight' },\n});\n\nexport const HrControl = createControl({\n label: 'highlightControlLabel',\n icon: (props) => <IconLineDashed {...props} stroke={1.5} />,\n operation: { name: 'setHorizontalRule' },\n});\n"],"names":["createControl","React","IconBold","IconItalic","IconUnderline","IconStrikethrough","IconClearFormatting","IconUnlink","IconList","IconListNumbers","IconH1","IconH2","IconH3","IconH4","IconH5","IconH6","IconBlockquote","IconAlignLeft","IconAlignRight","IconAlignCenter","IconAlignJustified","IconSubscript","IconSuperscript","IconCode","IconHighlight","IconLineDashed"],"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,CA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AAuB;AAChC,EAAE,IAAI,EAAE,CAAC,KAAK,qBAAqBC,cAAK,CAAC,aAAa,CAACuB,mBAAa,EAAE,aAAa,CAAC,cAAc,CAAC,EAAE,EAAE,KAAK,CAAC,EAAE;AAC/G,IAAI,MAAM,EAAE,GAAG;AACf,GAAG,CAAC,CAAC;AACL,EAAE,QAAQ,EAAE,EAAE,IAAI,EAAE,WAAW,EAAE;AACjC,EAAE,SAAS,EAAE,EAAE,IAAI,EAAE,iBAAiB,EAAE;AACxC,CAAC,EAAE;AACS,MAAC,SAAS,GAAGxB,2BAAa,CAAC;AACvC,EAAE,KAAK,EAAE,uBAAuB;AAChC,EAAE,IAAI,EAAE,CAAC,KAAK,qBAAqBC,cAAK,CAAC,aAAa,CAACwB,oBAAc,EAAE,aAAa,CAAC,cAAc,CAAC,EAAE,EAAE,KAAK,CAAC,EAAE;AAChH,IAAI,MAAM,EAAE,GAAG;AACf,GAAG,CAAC,CAAC;AACL,EAAE,SAAS,EAAE,EAAE,IAAI,EAAE,mBAAmB,EAAE;AAC1C,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"controls.js","sources":["../../src/controls/controls.tsx"],"sourcesContent":["import React from 'react';\nimport {\n IconBold,\n IconItalic,\n IconUnderline,\n IconStrikethrough,\n IconClearFormatting,\n IconH1,\n IconH2,\n IconH3,\n IconH4,\n IconH5,\n IconH6,\n IconList,\n IconListNumbers,\n IconUnlink,\n IconBlockquote,\n IconAlignLeft,\n IconAlignRight,\n IconAlignCenter,\n IconAlignJustified,\n IconSubscript,\n IconSuperscript,\n IconCode,\n IconHighlight,\n IconLineDashed,\n IconCircleOff,\n} from '@tabler/icons';\nimport { createControl } from './ControlBase/create-control';\n\nexport const BoldControl = createControl({\n label: 'boldControlLabel',\n icon: (props) => <IconBold {...props} stroke={1.5} />,\n isActive: { name: 'bold' },\n operation: { name: 'toggleBold' },\n});\n\nexport const ItalicControl = createControl({\n label: 'italicControlLabel',\n icon: (props) => <IconItalic {...props} stroke={1.5} />,\n isActive: { name: 'italic' },\n operation: { name: 'toggleItalic' },\n});\n\nexport const UnderlineControl = createControl({\n label: 'underlineControlLabel',\n icon: (props) => <IconUnderline {...props} stroke={1.5} />,\n isActive: { name: 'underline' },\n operation: { name: 'toggleUnderline' },\n});\n\nexport const StrikeThroughControl = createControl({\n label: 'strikeControlLabel',\n icon: (props) => <IconStrikethrough {...props} stroke={1.5} />,\n isActive: { name: 'strike' },\n operation: { name: 'toggleStrike' },\n});\n\nexport const ClearFormattingControl = createControl({\n label: 'clearFormattingControlLabel',\n icon: (props) => <IconClearFormatting {...props} stroke={1.5} />,\n operation: { name: 'unsetAllMarks' },\n});\n\nexport const UnlinkControl = createControl({\n label: 'unlinkControlLabel',\n icon: (props) => <IconUnlink {...props} stroke={1.5} />,\n operation: { name: 'unsetLink' },\n});\n\nexport const BulletListControl = createControl({\n label: 'bulletListControlLabel',\n icon: (props) => <IconList {...props} stroke={1.5} />,\n isActive: { name: 'bulletList' },\n operation: { name: 'toggleBulletList' },\n});\n\nexport const OrderedListControl = createControl({\n label: 'orderedListControlLabel',\n icon: (props) => <IconListNumbers {...props} stroke={1.5} />,\n isActive: { name: 'orderedList' },\n operation: { name: 'toggleOrderedList' },\n});\n\nexport const H1Control = createControl({\n label: 'h1ControlLabel',\n icon: (props) => <IconH1 {...props} stroke={1.5} />,\n isActive: { name: 'heading', attributes: { level: 1 } },\n operation: { name: 'toggleHeading', attributes: { level: 1 } },\n});\n\nexport const H2Control = createControl({\n label: 'h2ControlLabel',\n icon: (props) => <IconH2 {...props} stroke={1.5} />,\n isActive: { name: 'heading', attributes: { level: 2 } },\n operation: { name: 'toggleHeading', attributes: { level: 2 } },\n});\n\nexport const H3Control = createControl({\n label: 'h3ControlLabel',\n icon: (props) => <IconH3 {...props} stroke={1.5} />,\n isActive: { name: 'heading', attributes: { level: 3 } },\n operation: { name: 'toggleHeading', attributes: { level: 3 } },\n});\n\nexport const H4Control = createControl({\n label: 'h4ControlLabel',\n icon: (props) => <IconH4 {...props} stroke={1.5} />,\n isActive: { name: 'heading', attributes: { level: 4 } },\n operation: { name: 'toggleHeading', attributes: { level: 4 } },\n});\n\nexport const H5Control = createControl({\n label: 'h5ControlLabel',\n icon: (props) => <IconH5 {...props} stroke={1.5} />,\n isActive: { name: 'heading', attributes: { level: 5 } },\n operation: { name: 'toggleHeading', attributes: { level: 5 } },\n});\n\nexport const H6Control = createControl({\n label: 'h6ControlLabel',\n icon: (props) => <IconH6 {...props} stroke={1.5} />,\n isActive: { name: 'heading', attributes: { level: 6 } },\n operation: { name: 'toggleHeading', attributes: { level: 6 } },\n});\n\nexport const BlockquoteControl = createControl({\n label: 'blockquoteControlLabel',\n icon: (props) => <IconBlockquote {...props} stroke={1.5} />,\n isActive: { name: 'blockquote' },\n operation: { name: 'toggleBlockquote' },\n});\n\nexport const AlignLeftControl = createControl({\n label: 'alignLeftControlLabel',\n icon: (props) => <IconAlignLeft {...props} stroke={1.5} />,\n operation: { name: 'setTextAlign', attributes: 'left' },\n});\n\nexport const AlignRightControl = createControl({\n label: 'alignRightControlLabel',\n icon: (props) => <IconAlignRight {...props} stroke={1.5} />,\n operation: { name: 'setTextAlign', attributes: 'right' },\n});\n\nexport const AlignCenterControl = createControl({\n label: 'alignCenterControlLabel',\n icon: (props) => <IconAlignCenter {...props} stroke={1.5} />,\n operation: { name: 'setTextAlign', attributes: 'center' },\n});\n\nexport const AlignJustifyControl = createControl({\n label: 'alignJustifyControlLabel',\n icon: (props) => <IconAlignJustified {...props} stroke={1.5} />,\n operation: { name: 'setTextAlign', attributes: 'justify' },\n});\n\nexport const SubscriptControl = createControl({\n label: 'subscriptControlLabel',\n icon: (props) => <IconSubscript {...props} stroke={1.5} />,\n isActive: { name: 'subscript' },\n operation: { name: 'toggleSubscript' },\n});\n\nexport const SuperscriptControl = createControl({\n label: 'superscriptControlLabel',\n icon: (props) => <IconSuperscript {...props} stroke={1.5} />,\n isActive: { name: 'superscript' },\n operation: { name: 'toggleSuperscript' },\n});\n\nexport const CodeControl = createControl({\n label: 'codeControlLabel',\n icon: (props) => <IconCode {...props} stroke={1.5} />,\n isActive: { name: 'code' },\n operation: { name: 'toggleCode' },\n});\n\nexport const CodeBlockControl = createControl({\n label: 'codeBlockControlLabel',\n icon: (props) => <IconCode {...props} stroke={1.5} />,\n isActive: { name: 'codeBlock' },\n operation: { name: 'toggleCodeBlock' },\n});\n\nexport const HighlightControl = createControl({\n label: 'highlightControlLabel',\n icon: (props) => <IconHighlight {...props} stroke={1.5} />,\n isActive: { name: 'highlight' },\n operation: { name: 'toggleHighlight' },\n});\n\nexport const HrControl = createControl({\n label: 'hrControlLabel',\n icon: (props) => <IconLineDashed {...props} stroke={1.5} />,\n operation: { name: 'setHorizontalRule' },\n});\n\nexport const UnsetColorControl = createControl({\n label: 'unsetColorControlLabel',\n icon: (props) => <IconCircleOff {...props} stroke={1.5} />,\n operation: { name: 'unsetColor' },\n});\n"],"names":["createControl","React","IconBold","IconItalic","IconUnderline","IconStrikethrough","IconClearFormatting","IconUnlink","IconList","IconListNumbers","IconH1","IconH2","IconH3","IconH4","IconH5","IconH6","IconBlockquote","IconAlignLeft","IconAlignRight","IconAlignCenter","IconAlignJustified","IconSubscript","IconSuperscript","IconCode","IconHighlight","IconLineDashed","IconCircleOff"],"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,KAA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,qBAAqBC,cAAK,CAAC,aAAa,CAACyB,mBAAa,EAAE,aAAa,CAAC,cAAc,CAAC,EAAE,EAAE,KAAK,CAAC,EAAE;AAC/G,IAAI,MAAM,EAAE,GAAG;AACf,GAAG,CAAC,CAAC;AACL,EAAE,SAAS,EAAE,EAAE,IAAI,EAAE,YAAY,EAAE;AACnC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/cjs/labels.js
CHANGED
|
@@ -10,7 +10,7 @@ const DEFAULT_LABELS = {
|
|
|
10
10
|
boldControlLabel: "Bold",
|
|
11
11
|
italicControlLabel: "Italic",
|
|
12
12
|
underlineControlLabel: "Underline",
|
|
13
|
-
strikeControlLabel: "
|
|
13
|
+
strikeControlLabel: "Strikethrough",
|
|
14
14
|
clearFormattingControlLabel: "Clear formatting",
|
|
15
15
|
unlinkControlLabel: "Remove link",
|
|
16
16
|
bulletListControlLabel: "Bullet list",
|
|
@@ -30,6 +30,8 @@ const DEFAULT_LABELS = {
|
|
|
30
30
|
codeBlockControlLabel: "Code block",
|
|
31
31
|
subscriptControlLabel: "Subscript",
|
|
32
32
|
superscriptControlLabel: "Superscript",
|
|
33
|
+
unsetColorControlLabel: "Unset color",
|
|
34
|
+
hrControlLabel: "Horizontal line",
|
|
33
35
|
linkEditorInputLabel: "Enter URL",
|
|
34
36
|
linkEditorInputPlaceholder: "https://example.com/",
|
|
35
37
|
linkEditorExternalLink: "Open link in a new tab",
|
package/cjs/labels.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"labels.js","sources":["../src/labels.ts"],"sourcesContent":["export interface RichTextEditorLabels {\n /** RichTextEditor.Bold control aria-label */\n boldControlLabel: string;\n\n /** RichTextEditor.Italic control aria-label */\n italicControlLabel: string;\n\n /** RichTextEditor.Underline control aria-label */\n underlineControlLabel: string;\n\n /** RichTextEditor.Strike control aria-label */\n strikeControlLabel: string;\n\n /** RichTextEditor.ClearFormatting control aria-label */\n clearFormattingControlLabel: string;\n\n /** RichTextEditor.Link control aria-label */\n linkControlLabel: string;\n\n /** RichTextEditor.Unlink control aria-label */\n unlinkControlLabel: string;\n\n /** RichTextEditor.BulletList control aria-label */\n bulletListControlLabel: string;\n\n /** RichTextEditor.OrderedList control aria-label */\n orderedListControlLabel: string;\n\n /** RichTextEditor.H1 control aria-label */\n h1ControlLabel: string;\n\n /** RichTextEditor.H2 control aria-label */\n h2ControlLabel: string;\n\n /** RichTextEditor.H3 control aria-label */\n h3ControlLabel: string;\n\n /** RichTextEditor.H4 control aria-label */\n h4ControlLabel: string;\n\n /** RichTextEditor.H5 control aria-label */\n h5ControlLabel: string;\n\n /** RichTextEditor.H6 control aria-label */\n h6ControlLabel: string;\n\n /** RichTextEditor.Blockquote control aria-label */\n blockquoteControlLabel: string;\n\n /** RichTextEditor.AlignLeft control aria-label */\n alignLeftControlLabel: string;\n\n /** RichTextEditor.AlignCenter control aria-label */\n alignCenterControlLabel: string;\n\n /** RichTextEditor.AlignRight control aria-label */\n alignRightControlLabel: string;\n\n /** RichTextEditor.AlignJustify control aria-label */\n alignJustifyControlLabel: string;\n\n /** RichTextEditor.Code control aria-label */\n codeControlLabel: string;\n\n /** RichTextEditor.CodeBlock control aria-label */\n codeBlockControlLabel: string;\n\n /** RichTextEditor.Subscript control aria-label */\n subscriptControlLabel: string;\n\n /** RichTextEditor.Superscript control aria-label */\n superscriptControlLabel: string;\n\n /** RichTextEditor.ColorPicker control aria-label */\n colorPickerControlLabel: string;\n\n /** RichTextEditor.Highlight control aria-label */\n highlightControlLabel: string;\n\n /** A function go get RichTextEditor.Color control aria-label based on color that control applies */\n colorControlLabel(color: string): string;\n\n /** aria-label for link editor url input */\n linkEditorInputLabel: string;\n\n /** placeholder for link editor url input */\n linkEditorInputPlaceholder: string;\n\n /** Content of external button tooltip in link editor when the link was chosen to open in a new tab */\n linkEditorExternalLink: string;\n\n /** Content of external button tooltip in link editor when the link was chosen to open in the same tab */\n linkEditorInternalLink: string;\n\n /** Save button content in link editor */\n linkEditorSave: string;\n\n /** Cancel button
|
|
1
|
+
{"version":3,"file":"labels.js","sources":["../src/labels.ts"],"sourcesContent":["export interface RichTextEditorLabels {\n /** RichTextEditor.Bold control aria-label */\n boldControlLabel: string;\n\n /** RichTextEditor.Hr control aria-label */\n hrControlLabel: string;\n\n /** RichTextEditor.Italic control aria-label */\n italicControlLabel: string;\n\n /** RichTextEditor.Underline control aria-label */\n underlineControlLabel: string;\n\n /** RichTextEditor.Strike control aria-label */\n strikeControlLabel: string;\n\n /** RichTextEditor.ClearFormatting control aria-label */\n clearFormattingControlLabel: string;\n\n /** RichTextEditor.Link control aria-label */\n linkControlLabel: string;\n\n /** RichTextEditor.Unlink control aria-label */\n unlinkControlLabel: string;\n\n /** RichTextEditor.BulletList control aria-label */\n bulletListControlLabel: string;\n\n /** RichTextEditor.OrderedList control aria-label */\n orderedListControlLabel: string;\n\n /** RichTextEditor.H1 control aria-label */\n h1ControlLabel: string;\n\n /** RichTextEditor.H2 control aria-label */\n h2ControlLabel: string;\n\n /** RichTextEditor.H3 control aria-label */\n h3ControlLabel: string;\n\n /** RichTextEditor.H4 control aria-label */\n h4ControlLabel: string;\n\n /** RichTextEditor.H5 control aria-label */\n h5ControlLabel: string;\n\n /** RichTextEditor.H6 control aria-label */\n h6ControlLabel: string;\n\n /** RichTextEditor.Blockquote control aria-label */\n blockquoteControlLabel: string;\n\n /** RichTextEditor.AlignLeft control aria-label */\n alignLeftControlLabel: string;\n\n /** RichTextEditor.AlignCenter control aria-label */\n alignCenterControlLabel: string;\n\n /** RichTextEditor.AlignRight control aria-label */\n alignRightControlLabel: string;\n\n /** RichTextEditor.AlignJustify control aria-label */\n alignJustifyControlLabel: string;\n\n /** RichTextEditor.Code control aria-label */\n codeControlLabel: string;\n\n /** RichTextEditor.CodeBlock control aria-label */\n codeBlockControlLabel: string;\n\n /** RichTextEditor.Subscript control aria-label */\n subscriptControlLabel: string;\n\n /** RichTextEditor.Superscript control aria-label */\n superscriptControlLabel: string;\n\n /** RichTextEditor.ColorPicker control aria-label */\n colorPickerControlLabel: string;\n\n /** RichTextEditor.UnsetColor control aria-label */\n unsetColorControlLabel: string;\n\n /** RichTextEditor.Highlight control aria-label */\n highlightControlLabel: string;\n\n /** A function go get RichTextEditor.Color control aria-label based on color that control applies */\n colorControlLabel(color: string): string;\n\n /** aria-label for link editor url input */\n linkEditorInputLabel: string;\n\n /** placeholder for link editor url input */\n linkEditorInputPlaceholder: string;\n\n /** Content of external button tooltip in link editor when the link was chosen to open in a new tab */\n linkEditorExternalLink: string;\n\n /** Content of external button tooltip in link editor when the link was chosen to open in the same tab */\n linkEditorInternalLink: string;\n\n /** Save button content in link editor */\n linkEditorSave: string;\n\n /** Cancel button title text in color picker control */\n colorPickerCancel: string;\n\n /** Clear button title text in color picker control */\n colorPickerClear: string;\n\n /** Color picker button title text in color picker control */\n colorPickerColorPicker: string;\n\n /** Palette button title text in color picker control */\n colorPickerPalette: string;\n\n /** Save button title text in color picker control */\n colorPickerSave: string;\n\n /** aria-label for color palette colors */\n colorPickerColorLabel(color: string): string;\n}\n\nexport const DEFAULT_LABELS: RichTextEditorLabels = {\n // Controls labels\n linkControlLabel: 'Link',\n colorPickerControlLabel: 'Text color',\n highlightControlLabel: 'Highlight text',\n colorControlLabel: (color) => `Set text color ${color}`,\n boldControlLabel: 'Bold',\n italicControlLabel: 'Italic',\n underlineControlLabel: 'Underline',\n strikeControlLabel: 'Strikethrough',\n clearFormattingControlLabel: 'Clear formatting',\n unlinkControlLabel: 'Remove link',\n bulletListControlLabel: 'Bullet list',\n orderedListControlLabel: 'Ordered list',\n h1ControlLabel: 'Heading 1',\n h2ControlLabel: 'Heading 2',\n h3ControlLabel: 'Heading 3',\n h4ControlLabel: 'Heading 4',\n h5ControlLabel: 'Heading 5',\n h6ControlLabel: 'Heading 6',\n blockquoteControlLabel: 'Blockquote',\n alignLeftControlLabel: 'Align text: left',\n alignCenterControlLabel: 'Align text: center',\n alignRightControlLabel: 'Align text: right',\n alignJustifyControlLabel: 'Align text: justify',\n codeControlLabel: 'Code',\n codeBlockControlLabel: 'Code block',\n subscriptControlLabel: 'Subscript',\n superscriptControlLabel: 'Superscript',\n unsetColorControlLabel: 'Unset color',\n hrControlLabel: 'Horizontal line',\n\n // Link editor\n linkEditorInputLabel: 'Enter URL',\n linkEditorInputPlaceholder: 'https://example.com/',\n linkEditorExternalLink: 'Open link in a new tab',\n linkEditorInternalLink: 'Open link in the same tab',\n linkEditorSave: 'Save',\n\n // Color picker control\n colorPickerCancel: 'Cancel',\n colorPickerClear: 'Clear color',\n colorPickerColorPicker: 'Color picker',\n colorPickerPalette: 'Color palette',\n colorPickerSave: 'Save',\n colorPickerColorLabel: (color) => `Set text color ${color}`,\n};\n"],"names":[],"mappings":";;;;AAAY,MAAC,cAAc,GAAG;AAC9B,EAAE,gBAAgB,EAAE,MAAM;AAC1B,EAAE,uBAAuB,EAAE,YAAY;AACvC,EAAE,qBAAqB,EAAE,gBAAgB;AACzC,EAAE,iBAAiB,EAAE,CAAC,KAAK,KAAK,CAAC,eAAe,EAAE,KAAK,CAAC,CAAC;AACzD,EAAE,gBAAgB,EAAE,MAAM;AAC1B,EAAE,kBAAkB,EAAE,QAAQ;AAC9B,EAAE,qBAAqB,EAAE,WAAW;AACpC,EAAE,kBAAkB,EAAE,eAAe;AACrC,EAAE,2BAA2B,EAAE,kBAAkB;AACjD,EAAE,kBAAkB,EAAE,aAAa;AACnC,EAAE,sBAAsB,EAAE,aAAa;AACvC,EAAE,uBAAuB,EAAE,cAAc;AACzC,EAAE,cAAc,EAAE,WAAW;AAC7B,EAAE,cAAc,EAAE,WAAW;AAC7B,EAAE,cAAc,EAAE,WAAW;AAC7B,EAAE,cAAc,EAAE,WAAW;AAC7B,EAAE,cAAc,EAAE,WAAW;AAC7B,EAAE,cAAc,EAAE,WAAW;AAC7B,EAAE,sBAAsB,EAAE,YAAY;AACtC,EAAE,qBAAqB,EAAE,kBAAkB;AAC3C,EAAE,uBAAuB,EAAE,oBAAoB;AAC/C,EAAE,sBAAsB,EAAE,mBAAmB;AAC7C,EAAE,wBAAwB,EAAE,qBAAqB;AACjD,EAAE,gBAAgB,EAAE,MAAM;AAC1B,EAAE,qBAAqB,EAAE,YAAY;AACrC,EAAE,qBAAqB,EAAE,WAAW;AACpC,EAAE,uBAAuB,EAAE,aAAa;AACxC,EAAE,sBAAsB,EAAE,aAAa;AACvC,EAAE,cAAc,EAAE,iBAAiB;AACnC,EAAE,oBAAoB,EAAE,WAAW;AACnC,EAAE,0BAA0B,EAAE,sBAAsB;AACpD,EAAE,sBAAsB,EAAE,wBAAwB;AAClD,EAAE,sBAAsB,EAAE,2BAA2B;AACrD,EAAE,cAAc,EAAE,MAAM;AACxB,EAAE,iBAAiB,EAAE,QAAQ;AAC7B,EAAE,gBAAgB,EAAE,aAAa;AACjC,EAAE,sBAAsB,EAAE,cAAc;AACxC,EAAE,kBAAkB,EAAE,eAAe;AACrC,EAAE,eAAe,EAAE,MAAM;AACzB,EAAE,qBAAqB,EAAE,CAAC,KAAK,KAAK,CAAC,eAAe,EAAE,KAAK,CAAC,CAAC;AAC7D;;;;"}
|
|
@@ -87,6 +87,7 @@ function getTypographyStyles(withTypographyStyles) {
|
|
|
87
87
|
var useStyles = createStyles((theme, { withCodeHighlightStyles, withTypographyStyles }) => ({
|
|
88
88
|
typographyStylesProvider: __spreadValues({}, getTypographyStyles(withTypographyStyles)),
|
|
89
89
|
content: __spreadValues({
|
|
90
|
+
backgroundColor: theme.colorScheme === "dark" ? theme.colors.dark[7] : theme.white,
|
|
90
91
|
padding: theme.spacing.md,
|
|
91
92
|
"& .ProseMirror": {
|
|
92
93
|
outline: 0
|
|
@@ -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 padding: theme.spacing.md,\n\n '& .ProseMirror': {\n outline: 0,\n },\n\n '& .ProseMirror > *:last-child': {\n marginBottom: 0,\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,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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AO,IAAI,CAAC;AAChB,GAAG;AACH,EAAE,OAAO;AACT,IAAI,UAAU,EAAE;AAChB,MAAM,MAAM,EAAE,CAAC;AACf,KAAK;AACL,IAAI,kBAAkB,EAAE;AACxB,MAAM,SAAS,EAAE,CAAC;AAClB,KAAK;AACL,IAAI,YAAY,EAAE;AAClB,MAAM,SAAS,EAAE,CAAC;AAClB,MAAM,YAAY,EAAE,CAAC;AACrB,KAAK;AACL,IAAI,KAAK,EAAE;AACX,MAAM,YAAY,EAAE,CAAC;AACrB,KAAK;AACL,IAAI,yCAAyC,EAAE;AAC/C,MAAM,SAAS,EAAE,CAAC;AAClB,KAAK;AACL,GAAG,CAAC;AACJ,CAAC;AACD,gBAAe,YAAY,CAAC,CAAC,KAAK,EAAE,EAAE,uBAAuB,EAAE,oBAAoB,EAAE,MAAM;AAC3F,EAAE,wBAAwB,EAAE,cAAc,CAAC,EAAE,EAAE,mBAAmB,CAAC,oBAAoB,CAAC,CAAC;AACzF,EAAE,OAAO,EAAE,cAAc,CAAC;AAC1B,IAAI,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC,EAAE;AAC7B,IAAI,gBAAgB,EAAE;AACtB,MAAM,OAAO,EAAE,CAAC;AAChB,KAAK;AACL,IAAI,+BAA+B,EAAE;AACrC,MAAM,YAAY,EAAE,CAAC;AACrB,KAAK;AACL,GAAG,EAAE,gBAAgB,CAAC,uBAAuB,EAAE,KAAK,CAAC,CAAC;AACtD,CAAC,CAAC,CAAC;;;;"}
|
|
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\n '& .ProseMirror': {\n outline: 0,\n },\n\n '& .ProseMirror > *:last-child': {\n marginBottom: 0,\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,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,CAA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AAM,EAAE,CAAC;AACf,KAAK;AACL,IAAI,kBAAkB,EAAE;AACxB,MAAM,SAAS,EAAE,CAAC;AAClB,KAAK;AACL,IAAI,YAAY,EAAE;AAClB,MAAM,SAAS,EAAE,CAAC;AAClB,MAAM,YAAY,EAAE,CAAC;AACrB,KAAK;AACL,IAAI,KAAK,EAAE;AACX,MAAM,YAAY,EAAE,CAAC;AACrB,KAAK;AACL,IAAI,yCAAyC,EAAE;AAC/C,MAAM,SAAS,EAAE,CAAC;AAClB,KAAK;AACL,GAAG,CAAC;AACJ,CAAC;AACD,gBAAe,YAAY,CAAC,CAAC,KAAK,EAAE,EAAE,uBAAuB,EAAE,oBAAoB,EAAE,MAAM;AAC3F,EAAE,wBAAwB,EAAE,cAAc,CAAC,EAAE,EAAE,mBAAmB,CAAC,oBAAoB,CAAC,CAAC;AACzF,EAAE,OAAO,EAAE,cAAc,CAAC;AAC1B,IAAI,eAAe,EAAE,KAAK,CAAC,WAAW,KAAK,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,KAAK;AACtF,IAAI,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC,EAAE;AAC7B,IAAI,gBAAgB,EAAE;AACtB,MAAM,OAAO,EAAE,CAAC;AAChB,KAAK;AACL,IAAI,+BAA+B,EAAE;AACrC,MAAM,YAAY,EAAE,CAAC;AACrB,KAAK;AACL,GAAG,EAAE,gBAAgB,CAAC,uBAAuB,EAAE,KAAK,CAAC,CAAC;AACtD,CAAC,CAAC,CAAC;;;;"}
|
package/esm/RichTextEditor.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { useMemo } from 'react';
|
|
2
2
|
import { useComponentDefaultProps, StylesApiProvider, Box } from '@mantine/core';
|
|
3
3
|
import { RichTextEditorProvider } from './RichTextEditor.context.js';
|
|
4
|
-
import { BoldControl, ItalicControl,
|
|
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';
|
|
5
5
|
import { LinkControl } from './controls/LinkControl/LinkControl.js';
|
|
6
6
|
import { ColorPickerControl } from './controls/ColorPickerControl/ColorPickerControl.js';
|
|
7
7
|
import { ColorControl } from './controls/ColorControl/ColorControl.js';
|
|
@@ -84,7 +84,7 @@ RichTextEditor.ControlsGroup = ControlsGroup;
|
|
|
84
84
|
RichTextEditor.Toolbar = Toolbar;
|
|
85
85
|
RichTextEditor.Bold = BoldControl;
|
|
86
86
|
RichTextEditor.Italic = ItalicControl;
|
|
87
|
-
RichTextEditor.Strikethrough =
|
|
87
|
+
RichTextEditor.Strikethrough = StrikeThroughControl;
|
|
88
88
|
RichTextEditor.Underline = UnderlineControl;
|
|
89
89
|
RichTextEditor.ClearFormatting = ClearFormattingControl;
|
|
90
90
|
RichTextEditor.H1 = H1Control;
|
|
@@ -110,6 +110,7 @@ RichTextEditor.ColorPicker = ColorPickerControl;
|
|
|
110
110
|
RichTextEditor.Color = ColorControl;
|
|
111
111
|
RichTextEditor.Highlight = HighlightControl;
|
|
112
112
|
RichTextEditor.Hr = HrControl;
|
|
113
|
+
RichTextEditor.UnsetColor = UnsetColorControl;
|
|
113
114
|
RichTextEditor.displayName = "@mantine/tiptap/RichTextEditor";
|
|
114
115
|
|
|
115
116
|
export { RichTextEditor };
|
|
@@ -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;\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.
|
|
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":["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,cAAc,GAAG,CAAC,CAAC,EAAE,CAAC,KAAK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C,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;;;;"}
|
|
@@ -37,7 +37,7 @@ var __objRest = (source, exclude) => {
|
|
|
37
37
|
return target;
|
|
38
38
|
};
|
|
39
39
|
const ColorPickerControl = forwardRef((_a, ref) => {
|
|
40
|
-
var _b = _a, { popoverProps, colors,
|
|
40
|
+
var _b = _a, { popoverProps, colors, colorPickerProps } = _b, others = __objRest(_b, ["popoverProps", "colors", "colorPickerProps"]);
|
|
41
41
|
const { unstyled } = useContextStylesApi();
|
|
42
42
|
const { editor, labels } = useRichTextEditorContext();
|
|
43
43
|
const [opened, { toggle, close }] = useDisclosure(false);
|
|
@@ -96,72 +96,52 @@ const ColorPickerControl = forwardRef((_a, ref) => {
|
|
|
96
96
|
position: "right",
|
|
97
97
|
spacing: "xs",
|
|
98
98
|
mt: "sm"
|
|
99
|
-
}, state === "palette" && /* @__PURE__ */ React.createElement(
|
|
100
|
-
label: labels.colorPickerCancel,
|
|
101
|
-
withArrow: true,
|
|
102
|
-
withinPortal: true,
|
|
103
|
-
unstyled,
|
|
104
|
-
disabled: disableTooltips
|
|
105
|
-
}, /* @__PURE__ */ React.createElement(ActionIcon, {
|
|
99
|
+
}, state === "palette" && /* @__PURE__ */ React.createElement(ActionIcon, {
|
|
106
100
|
variant: "default",
|
|
107
101
|
onClick: close,
|
|
108
|
-
unstyled
|
|
102
|
+
unstyled,
|
|
103
|
+
title: labels.colorPickerCancel,
|
|
104
|
+
"aria-label": labels.colorPickerCancel
|
|
109
105
|
}, /* @__PURE__ */ React.createElement(IconX, {
|
|
110
106
|
stroke: 1.5,
|
|
111
107
|
size: 16
|
|
112
|
-
}))
|
|
113
|
-
label: labels.colorPickerClear,
|
|
114
|
-
withArrow: true,
|
|
115
|
-
withinPortal: true,
|
|
116
|
-
unstyled,
|
|
117
|
-
disabled: disableTooltips
|
|
118
|
-
}, /* @__PURE__ */ React.createElement(ActionIcon, {
|
|
108
|
+
})), /* @__PURE__ */ React.createElement(ActionIcon, {
|
|
119
109
|
variant: "default",
|
|
120
110
|
onClick: handleClear,
|
|
121
|
-
unstyled
|
|
111
|
+
unstyled,
|
|
112
|
+
title: labels.colorPickerClear,
|
|
113
|
+
"aria-label": labels.colorPickerClear
|
|
122
114
|
}, /* @__PURE__ */ React.createElement(IconCircleOff, {
|
|
123
115
|
stroke: 1.5,
|
|
124
116
|
size: 16
|
|
125
|
-
}))
|
|
126
|
-
label: labels.colorPickerColorPicker,
|
|
127
|
-
withArrow: true,
|
|
128
|
-
withinPortal: true,
|
|
129
|
-
unstyled,
|
|
130
|
-
disabled: disableTooltips
|
|
131
|
-
}, /* @__PURE__ */ React.createElement(ActionIcon, {
|
|
117
|
+
})), state === "palette" ? /* @__PURE__ */ React.createElement(ActionIcon, {
|
|
132
118
|
variant: "default",
|
|
133
119
|
onClick: () => setState("colorPicker"),
|
|
134
|
-
unstyled
|
|
120
|
+
unstyled,
|
|
121
|
+
title: labels.colorPickerColorPicker,
|
|
122
|
+
"aria-label": labels.colorPickerColorPicker
|
|
135
123
|
}, /* @__PURE__ */ React.createElement(IconColorPicker, {
|
|
136
124
|
stroke: 1.5,
|
|
137
125
|
size: 16
|
|
138
|
-
}))
|
|
139
|
-
label: labels.colorPickerPalette,
|
|
140
|
-
withArrow: true,
|
|
141
|
-
withinPortal: true,
|
|
142
|
-
disabled: disableTooltips,
|
|
143
|
-
unstyled
|
|
144
|
-
}, /* @__PURE__ */ React.createElement(ActionIcon, {
|
|
126
|
+
})) : /* @__PURE__ */ React.createElement(ActionIcon, {
|
|
145
127
|
variant: "default",
|
|
146
128
|
onClick: () => setState("palette"),
|
|
147
|
-
unstyled
|
|
129
|
+
unstyled,
|
|
130
|
+
"aria-label": labels.colorPickerPalette,
|
|
131
|
+
title: labels.colorPickerPalette
|
|
148
132
|
}, /* @__PURE__ */ React.createElement(IconPalette, {
|
|
149
133
|
stroke: 1.5,
|
|
150
134
|
size: 16
|
|
151
|
-
}))
|
|
152
|
-
label: labels.colorPickerSave,
|
|
153
|
-
withArrow: true,
|
|
154
|
-
withinPortal: true,
|
|
155
|
-
disabled: disableTooltips,
|
|
156
|
-
unstyled
|
|
157
|
-
}, /* @__PURE__ */ React.createElement(ActionIcon, {
|
|
135
|
+
})), state === "colorPicker" && /* @__PURE__ */ React.createElement(ActionIcon, {
|
|
158
136
|
variant: "default",
|
|
159
137
|
onClick: close,
|
|
160
|
-
unstyled
|
|
138
|
+
unstyled,
|
|
139
|
+
title: labels.colorPickerSave,
|
|
140
|
+
"aria-label": labels.colorPickerSave
|
|
161
141
|
}, /* @__PURE__ */ React.createElement(IconCheck, {
|
|
162
142
|
stroke: 1.5,
|
|
163
143
|
size: 16
|
|
164
|
-
}))))))
|
|
144
|
+
}))))));
|
|
165
145
|
});
|
|
166
146
|
ColorPickerControl.displayName = "@mantine/tiptap/ColorPickerControl";
|
|
167
147
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ColorPickerControl.js","sources":["../../../src/controls/ColorPickerControl/ColorPickerControl.tsx"],"sourcesContent":["import React, { forwardRef, useState } from 'react';\nimport {\n DefaultProps,\n Popover,\n PopoverProps,\n ColorSwatch,\n SimpleGrid,\n ColorPicker,\n Group,\n ActionIcon,\n Tooltip,\n ColorPickerProps,\n useContextStylesApi,\n} from '@mantine/core';\nimport { useDisclosure } from '@mantine/hooks';\nimport { IconCircleOff, IconColorPicker, IconX, IconPalette, IconCheck } from '@tabler/icons';\nimport { Control } from '../Control/Control';\nimport { useRichTextEditorContext } from '../../RichTextEditor.context';\n\nexport interface ColorPickerControlProps\n extends DefaultProps,\n React.ComponentPropsWithoutRef<'button'> {\n /** Props added to Popover component */\n popoverProps?: Partial<PopoverProps>;\n\n /** Props added to ColorPicker component */\n colorPickerProps?: Partial<ColorPickerProps>;\n\n /** List of colors that the user can choose from */\n colors: string[];\n\n /** Determines whether tooltips over controls should be visible */\n disableTooltips?: boolean;\n}\n\nexport const ColorPickerControl = forwardRef<HTMLButtonElement, ColorPickerControlProps>(\n ({ popoverProps, colors, disableTooltips, colorPickerProps, ...others }, ref) => {\n const { unstyled } = useContextStylesApi();\n const { editor, labels } = useRichTextEditorContext();\n const [opened, { toggle, close }] = useDisclosure(false);\n const [state, setState] = useState<'palette' | 'colorPicker'>('palette');\n const currentColor = editor?.getAttributes('textStyle').color || '#000';\n\n const handleChange = (value: string, shouldClose = true) => {\n (editor.chain() as any).focus().setColor(value).run();\n shouldClose && close();\n };\n\n const handleClear = () => {\n (editor.chain() as any).focus().unsetColor().run();\n close();\n };\n\n const controls = colors.map((color, index) => (\n <ColorSwatch\n key={index}\n component=\"button\"\n color={color}\n onClick={() => handleChange(color)}\n size={26}\n radius=\"xs\"\n sx={{ cursor: 'pointer' }}\n title={labels.colorPickerColorLabel(color)}\n aria-label={labels.colorPickerColorLabel(color)}\n unstyled={unstyled}\n />\n ));\n\n return (\n <Popover\n opened={opened}\n withinPortal\n trapFocus\n onClose={close}\n unstyled={unstyled}\n {...popoverProps}\n >\n <Popover.Target>\n <Control\n aria-label={labels.colorPickerControlLabel}\n title={labels.colorPickerControlLabel}\n {...others}\n ref={ref}\n onClick={toggle}\n >\n <ColorSwatch color={currentColor} size={14} unstyled={unstyled} />\n </Control>\n </Popover.Target>\n\n <Popover.Dropdown\n sx={(theme) => ({\n backgroundColor: theme.colorScheme === 'dark' ? theme.colors.dark[7] : theme.white,\n })}\n >\n {state === 'palette' && (\n <SimpleGrid cols={7} spacing={2}>\n {controls}\n </SimpleGrid>\n )}\n\n {state === 'colorPicker' && (\n <ColorPicker\n defaultValue={currentColor}\n onChange={(value) => handleChange(value, false)}\n unstyled={unstyled}\n {...colorPickerProps}\n />\n )}\n\n <Tooltip.Group closeDelay={200}>\n <Group position=\"right\" spacing=\"xs\" mt=\"sm\">\n {state === 'palette' && (\n <Tooltip\n label={labels.colorPickerCancel}\n withArrow\n withinPortal\n unstyled={unstyled}\n disabled={disableTooltips}\n >\n <ActionIcon variant=\"default\" onClick={close} unstyled={unstyled}>\n <IconX stroke={1.5} size={16} />\n </ActionIcon>\n </Tooltip>\n )}\n\n <Tooltip\n label={labels.colorPickerClear}\n withArrow\n withinPortal\n unstyled={unstyled}\n disabled={disableTooltips}\n >\n <ActionIcon variant=\"default\" onClick={handleClear} unstyled={unstyled}>\n <IconCircleOff stroke={1.5} size={16} />\n </ActionIcon>\n </Tooltip>\n\n {state === 'palette' ? (\n <Tooltip\n label={labels.colorPickerColorPicker}\n withArrow\n withinPortal\n unstyled={unstyled}\n disabled={disableTooltips}\n >\n <ActionIcon\n variant=\"default\"\n onClick={() => setState('colorPicker')}\n unstyled={unstyled}\n >\n <IconColorPicker stroke={1.5} size={16} />\n </ActionIcon>\n </Tooltip>\n ) : (\n <Tooltip\n label={labels.colorPickerPalette}\n withArrow\n withinPortal\n disabled={disableTooltips}\n unstyled={unstyled}\n >\n <ActionIcon\n variant=\"default\"\n onClick={() => setState('palette')}\n unstyled={unstyled}\n >\n <IconPalette stroke={1.5} size={16} />\n </ActionIcon>\n </Tooltip>\n )}\n\n {state === 'colorPicker' && (\n <Tooltip\n label={labels.colorPickerSave}\n withArrow\n withinPortal\n disabled={disableTooltips}\n unstyled={unstyled}\n >\n <ActionIcon variant=\"default\" onClick={close} unstyled={unstyled}>\n <IconCheck stroke={1.5} size={16} />\n </ActionIcon>\n </Tooltip>\n )}\n </Group>\n </Tooltip.Group>\n </Popover.Dropdown>\n </Popover>\n );\n }\n);\n\nColorPickerControl.displayName = '@mantine/tiptap/ColorPickerControl';\n"],"names":[],"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;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,EAAE,MAAM,QAAQ,CAAC,SAAS,CAAC;AACtC,IAAI,QAAQ;AACZ,GAAG,kBAAkB,KAAK,CAAC,aAAa,CAAC,WAAW,EAAE;AACtD,IAAI,MAAM,EAAE,GAAG;AACf,IAAI,IAAI,EAAE,EAAE;AACZ,GAAG,CAAC,CAAC,CAAC,EAAE,KAAK,KAAK,aAAa,oBAAoB,KAAK,CAAC,aAAa,CAAC,OAAO,EAAE;AAChF,IAAI,KAAK,EAAE,MAAM,CAAC,eAAe;AACjC,IAAI,SAAS,EAAE,IAAI;AACnB,IAAI,YAAY,EAAE,IAAI;AACtB,IAAI,QAAQ,EAAE,eAAe;AAC7B,IAAI,QAAQ;AACZ,GAAG,kBAAkB,KAAK,CAAC,aAAa,CAAC,UAAU,EAAE;AACrD,IAAI,OAAO,EAAE,SAAS;AACtB,IAAI,OAAO,EAAE,KAAK;AAClB,IAAI,QAAQ;AACZ,GAAG,kBAAkB,KAAK,CAAC,aAAa,CAAC,SAAS,EAAE;AACpD,IAAI,MAAM,EAAE,GAAG;AACf,IAAI,IAAI,EAAE,EAAE;AACZ,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACX,CAAC,EAAE;AACH,kBAAkB,CAAC,WAAW,GAAG,oCAAoC;;;;"}
|
|
1
|
+
{"version":3,"file":"ColorPickerControl.js","sources":["../../../src/controls/ColorPickerControl/ColorPickerControl.tsx"],"sourcesContent":["import React, { forwardRef, useState } from 'react';\nimport {\n DefaultProps,\n Popover,\n PopoverProps,\n ColorSwatch,\n SimpleGrid,\n ColorPicker,\n Group,\n ActionIcon,\n Tooltip,\n ColorPickerProps,\n useContextStylesApi,\n} from '@mantine/core';\nimport { useDisclosure } from '@mantine/hooks';\nimport { IconCircleOff, IconColorPicker, IconX, IconPalette, IconCheck } from '@tabler/icons';\nimport { Control } from '../Control/Control';\nimport { useRichTextEditorContext } from '../../RichTextEditor.context';\n\nexport interface ColorPickerControlProps\n extends DefaultProps,\n React.ComponentPropsWithoutRef<'button'> {\n /** Props added to Popover component */\n popoverProps?: Partial<PopoverProps>;\n\n /** Props added to ColorPicker component */\n colorPickerProps?: Partial<ColorPickerProps>;\n\n /** List of colors that the user can choose from */\n colors: string[];\n}\n\nexport const ColorPickerControl = forwardRef<HTMLButtonElement, ColorPickerControlProps>(\n ({ popoverProps, colors, colorPickerProps, ...others }, ref) => {\n const { unstyled } = useContextStylesApi();\n const { editor, labels } = useRichTextEditorContext();\n const [opened, { toggle, close }] = useDisclosure(false);\n const [state, setState] = useState<'palette' | 'colorPicker'>('palette');\n const currentColor = editor?.getAttributes('textStyle').color || '#000';\n\n const handleChange = (value: string, shouldClose = true) => {\n (editor.chain() as any).focus().setColor(value).run();\n shouldClose && close();\n };\n\n const handleClear = () => {\n (editor.chain() as any).focus().unsetColor().run();\n close();\n };\n\n const controls = colors.map((color, index) => (\n <ColorSwatch\n key={index}\n component=\"button\"\n color={color}\n onClick={() => handleChange(color)}\n size={26}\n radius=\"xs\"\n sx={{ cursor: 'pointer' }}\n title={labels.colorPickerColorLabel(color)}\n aria-label={labels.colorPickerColorLabel(color)}\n unstyled={unstyled}\n />\n ));\n\n return (\n <Popover\n opened={opened}\n withinPortal\n trapFocus\n onClose={close}\n unstyled={unstyled}\n {...popoverProps}\n >\n <Popover.Target>\n <Control\n aria-label={labels.colorPickerControlLabel}\n title={labels.colorPickerControlLabel}\n {...others}\n ref={ref}\n onClick={toggle}\n >\n <ColorSwatch color={currentColor} size={14} unstyled={unstyled} />\n </Control>\n </Popover.Target>\n\n <Popover.Dropdown\n sx={(theme) => ({\n backgroundColor: theme.colorScheme === 'dark' ? theme.colors.dark[7] : theme.white,\n })}\n >\n {state === 'palette' && (\n <SimpleGrid cols={7} spacing={2}>\n {controls}\n </SimpleGrid>\n )}\n\n {state === 'colorPicker' && (\n <ColorPicker\n defaultValue={currentColor}\n onChange={(value) => handleChange(value, false)}\n unstyled={unstyled}\n {...colorPickerProps}\n />\n )}\n\n <Tooltip.Group closeDelay={200}>\n <Group position=\"right\" spacing=\"xs\" mt=\"sm\">\n {state === 'palette' && (\n <ActionIcon\n variant=\"default\"\n onClick={close}\n unstyled={unstyled}\n title={labels.colorPickerCancel}\n aria-label={labels.colorPickerCancel}\n >\n <IconX stroke={1.5} size={16} />\n </ActionIcon>\n )}\n\n <ActionIcon\n variant=\"default\"\n onClick={handleClear}\n unstyled={unstyled}\n title={labels.colorPickerClear}\n aria-label={labels.colorPickerClear}\n >\n <IconCircleOff stroke={1.5} size={16} />\n </ActionIcon>\n\n {state === 'palette' ? (\n <ActionIcon\n variant=\"default\"\n onClick={() => setState('colorPicker')}\n unstyled={unstyled}\n title={labels.colorPickerColorPicker}\n aria-label={labels.colorPickerColorPicker}\n >\n <IconColorPicker stroke={1.5} size={16} />\n </ActionIcon>\n ) : (\n <ActionIcon\n variant=\"default\"\n onClick={() => setState('palette')}\n unstyled={unstyled}\n aria-label={labels.colorPickerPalette}\n title={labels.colorPickerPalette}\n >\n <IconPalette stroke={1.5} size={16} />\n </ActionIcon>\n )}\n\n {state === 'colorPicker' && (\n <ActionIcon\n variant=\"default\"\n onClick={close}\n unstyled={unstyled}\n title={labels.colorPickerSave}\n aria-label={labels.colorPickerSave}\n >\n <IconCheck stroke={1.5} size={16} />\n </ActionIcon>\n )}\n </Group>\n </Tooltip.Group>\n </Popover.Dropdown>\n </Popover>\n );\n }\n);\n\nColorPickerControl.displayName = '@mantine/tiptap/ColorPickerControl';\n"],"names":[],"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,SAA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AAG,CAAC,CAAC,mBAAmB,KAAK,CAAC,aAAa,CAAC,UAAU,EAAE;AACxD,IAAI,OAAO,EAAE,SAAS;AACtB,IAAI,OAAO,EAAE,MAAM,QAAQ,CAAC,SAAS,CAAC;AACtC,IAAI,QAAQ;AACZ,IAAI,YAAY,EAAE,MAAM,CAAC,kBAAkB;AAC3C,IAAI,KAAK,EAAE,MAAM,CAAC,kBAAkB;AACpC,GAAG,kBAAkB,KAAK,CAAC,aAAa,CAAC,WAAW,EAAE;AACtD,IAAI,MAAM,EAAE,GAAG;AACf,IAAI,IAAI,EAAE,EAAE;AACZ,GAAG,CAAC,CAAC,EAAE,KAAK,KAAK,aAAa,oBAAoB,KAAK,CAAC,aAAa,CAAC,UAAU,EAAE;AAClF,IAAI,OAAO,EAAE,SAAS;AACtB,IAAI,OAAO,EAAE,KAAK;AAClB,IAAI,QAAQ;AACZ,IAAI,KAAK,EAAE,MAAM,CAAC,eAAe;AACjC,IAAI,YAAY,EAAE,MAAM,CAAC,eAAe;AACxC,GAAG,kBAAkB,KAAK,CAAC,aAAa,CAAC,SAAS,EAAE;AACpD,IAAI,MAAM,EAAE,GAAG;AACf,IAAI,IAAI,EAAE,EAAE;AACZ,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACV,CAAC,EAAE;AACH,kBAAkB,CAAC,WAAW,GAAG,oCAAoC;;;;"}
|
package/esm/controls/controls.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { IconItalic, IconUnderline, IconStrikethrough, IconClearFormatting, IconUnlink, IconList, IconListNumbers, IconH1, IconH2, IconH3, IconH4, IconH5, IconH6, IconBlockquote, IconAlignLeft, IconAlignRight, IconAlignCenter, IconAlignJustified, IconSubscript, IconSuperscript, IconCode, IconHighlight, IconLineDashed, IconBold } from '@tabler/icons';
|
|
2
|
+
import { IconItalic, IconUnderline, IconStrikethrough, IconClearFormatting, IconUnlink, IconList, IconListNumbers, IconH1, IconH2, IconH3, IconH4, IconH5, IconH6, IconBlockquote, IconAlignLeft, IconAlignRight, IconAlignCenter, IconAlignJustified, IconSubscript, IconSuperscript, IconCode, IconHighlight, IconLineDashed, IconCircleOff, IconBold } from '@tabler/icons';
|
|
3
3
|
import { createControl } from './ControlBase/create-control.js';
|
|
4
4
|
|
|
5
5
|
var __defProp = Object.defineProperty;
|
|
@@ -45,7 +45,7 @@ const UnderlineControl = createControl({
|
|
|
45
45
|
isActive: { name: "underline" },
|
|
46
46
|
operation: { name: "toggleUnderline" }
|
|
47
47
|
});
|
|
48
|
-
const
|
|
48
|
+
const StrikeThroughControl = createControl({
|
|
49
49
|
label: "strikeControlLabel",
|
|
50
50
|
icon: (props) => /* @__PURE__ */ React.createElement(IconStrikethrough, __spreadProps(__spreadValues({}, props), {
|
|
51
51
|
stroke: 1.5
|
|
@@ -208,12 +208,19 @@ const HighlightControl = createControl({
|
|
|
208
208
|
operation: { name: "toggleHighlight" }
|
|
209
209
|
});
|
|
210
210
|
const HrControl = createControl({
|
|
211
|
-
label: "
|
|
211
|
+
label: "hrControlLabel",
|
|
212
212
|
icon: (props) => /* @__PURE__ */ React.createElement(IconLineDashed, __spreadProps(__spreadValues({}, props), {
|
|
213
213
|
stroke: 1.5
|
|
214
214
|
})),
|
|
215
215
|
operation: { name: "setHorizontalRule" }
|
|
216
216
|
});
|
|
217
|
+
const UnsetColorControl = createControl({
|
|
218
|
+
label: "unsetColorControlLabel",
|
|
219
|
+
icon: (props) => /* @__PURE__ */ React.createElement(IconCircleOff, __spreadProps(__spreadValues({}, props), {
|
|
220
|
+
stroke: 1.5
|
|
221
|
+
})),
|
|
222
|
+
operation: { name: "unsetColor" }
|
|
223
|
+
});
|
|
217
224
|
|
|
218
|
-
export { AlignCenterControl, AlignJustifyControl, AlignLeftControl, AlignRightControl, BlockquoteControl, BoldControl, BulletListControl, ClearFormattingControl, CodeBlockControl, CodeControl, H1Control, H2Control, H3Control, H4Control, H5Control, H6Control, HighlightControl, HrControl, ItalicControl, OrderedListControl,
|
|
225
|
+
export { AlignCenterControl, AlignJustifyControl, AlignLeftControl, AlignRightControl, BlockquoteControl, BoldControl, BulletListControl, ClearFormattingControl, CodeBlockControl, CodeControl, H1Control, H2Control, H3Control, H4Control, H5Control, H6Control, HighlightControl, HrControl, ItalicControl, OrderedListControl, StrikeThroughControl, SubscriptControl, SuperscriptControl, UnderlineControl, UnlinkControl, UnsetColorControl };
|
|
219
226
|
//# sourceMappingURL=controls.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"controls.js","sources":["../../src/controls/controls.tsx"],"sourcesContent":["import React from 'react';\nimport {\n IconBold,\n IconItalic,\n IconUnderline,\n IconStrikethrough,\n IconClearFormatting,\n IconH1,\n IconH2,\n IconH3,\n IconH4,\n IconH5,\n IconH6,\n IconList,\n IconListNumbers,\n IconUnlink,\n IconBlockquote,\n IconAlignLeft,\n IconAlignRight,\n IconAlignCenter,\n IconAlignJustified,\n IconSubscript,\n IconSuperscript,\n IconCode,\n IconHighlight,\n IconLineDashed,\n} from '@tabler/icons';\nimport { createControl } from './ControlBase/create-control';\n\nexport const BoldControl = createControl({\n label: 'boldControlLabel',\n icon: (props) => <IconBold {...props} stroke={1.5} />,\n isActive: { name: 'bold' },\n operation: { name: 'toggleBold' },\n});\n\nexport const ItalicControl = createControl({\n label: 'italicControlLabel',\n icon: (props) => <IconItalic {...props} stroke={1.5} />,\n isActive: { name: 'italic' },\n operation: { name: 'toggleItalic' },\n});\n\nexport const UnderlineControl = createControl({\n label: 'underlineControlLabel',\n icon: (props) => <IconUnderline {...props} stroke={1.5} />,\n isActive: { name: 'underline' },\n operation: { name: 'toggleUnderline' },\n});\n\nexport const StrikeThoughControl = createControl({\n label: 'strikeControlLabel',\n icon: (props) => <IconStrikethrough {...props} stroke={1.5} />,\n isActive: { name: 'strike' },\n operation: { name: 'toggleStrike' },\n});\n\nexport const ClearFormattingControl = createControl({\n label: 'clearFormattingControlLabel',\n icon: (props) => <IconClearFormatting {...props} stroke={1.5} />,\n operation: { name: 'unsetAllMarks' },\n});\n\nexport const UnlinkControl = createControl({\n label: 'unlinkControlLabel',\n icon: (props) => <IconUnlink {...props} stroke={1.5} />,\n operation: { name: 'unsetLink' },\n});\n\nexport const BulletListControl = createControl({\n label: 'bulletListControlLabel',\n icon: (props) => <IconList {...props} stroke={1.5} />,\n isActive: { name: 'bulletList' },\n operation: { name: 'toggleBulletList' },\n});\n\nexport const OrderedListControl = createControl({\n label: 'orderedListControlLabel',\n icon: (props) => <IconListNumbers {...props} stroke={1.5} />,\n isActive: { name: 'orderedList' },\n operation: { name: 'toggleOrderedList' },\n});\n\nexport const H1Control = createControl({\n label: 'h1ControlLabel',\n icon: (props) => <IconH1 {...props} stroke={1.5} />,\n isActive: { name: 'heading', attributes: { level: 1 } },\n operation: { name: 'toggleHeading', attributes: { level: 1 } },\n});\n\nexport const H2Control = createControl({\n label: 'h2ControlLabel',\n icon: (props) => <IconH2 {...props} stroke={1.5} />,\n isActive: { name: 'heading', attributes: { level: 2 } },\n operation: { name: 'toggleHeading', attributes: { level: 2 } },\n});\n\nexport const H3Control = createControl({\n label: 'h3ControlLabel',\n icon: (props) => <IconH3 {...props} stroke={1.5} />,\n isActive: { name: 'heading', attributes: { level: 3 } },\n operation: { name: 'toggleHeading', attributes: { level: 3 } },\n});\n\nexport const H4Control = createControl({\n label: 'h4ControlLabel',\n icon: (props) => <IconH4 {...props} stroke={1.5} />,\n isActive: { name: 'heading', attributes: { level: 4 } },\n operation: { name: 'toggleHeading', attributes: { level: 4 } },\n});\n\nexport const H5Control = createControl({\n label: 'h5ControlLabel',\n icon: (props) => <IconH5 {...props} stroke={1.5} />,\n isActive: { name: 'heading', attributes: { level: 5 } },\n operation: { name: 'toggleHeading', attributes: { level: 5 } },\n});\n\nexport const H6Control = createControl({\n label: 'h6ControlLabel',\n icon: (props) => <IconH6 {...props} stroke={1.5} />,\n isActive: { name: 'heading', attributes: { level: 6 } },\n operation: { name: 'toggleHeading', attributes: { level: 6 } },\n});\n\nexport const BlockquoteControl = createControl({\n label: 'blockquoteControlLabel',\n icon: (props) => <IconBlockquote {...props} stroke={1.5} />,\n isActive: { name: 'blockquote' },\n operation: { name: 'toggleBlockquote' },\n});\n\nexport const AlignLeftControl = createControl({\n label: 'alignLeftControlLabel',\n icon: (props) => <IconAlignLeft {...props} stroke={1.5} />,\n operation: { name: 'setTextAlign', attributes: 'left' },\n});\n\nexport const AlignRightControl = createControl({\n label: 'alignRightControlLabel',\n icon: (props) => <IconAlignRight {...props} stroke={1.5} />,\n operation: { name: 'setTextAlign', attributes: 'right' },\n});\n\nexport const AlignCenterControl = createControl({\n label: 'alignCenterControlLabel',\n icon: (props) => <IconAlignCenter {...props} stroke={1.5} />,\n operation: { name: 'setTextAlign', attributes: 'center' },\n});\n\nexport const AlignJustifyControl = createControl({\n label: 'alignJustifyControlLabel',\n icon: (props) => <IconAlignJustified {...props} stroke={1.5} />,\n operation: { name: 'setTextAlign', attributes: 'justify' },\n});\n\nexport const SubscriptControl = createControl({\n label: 'subscriptControlLabel',\n icon: (props) => <IconSubscript {...props} stroke={1.5} />,\n isActive: { name: 'subscript' },\n operation: { name: 'toggleSubscript' },\n});\n\nexport const SuperscriptControl = createControl({\n label: 'superscriptControlLabel',\n icon: (props) => <IconSuperscript {...props} stroke={1.5} />,\n isActive: { name: 'superscript' },\n operation: { name: 'toggleSuperscript' },\n});\n\nexport const CodeControl = createControl({\n label: 'codeControlLabel',\n icon: (props) => <IconCode {...props} stroke={1.5} />,\n isActive: { name: 'code' },\n operation: { name: 'toggleCode' },\n});\n\nexport const CodeBlockControl = createControl({\n label: 'codeBlockControlLabel',\n icon: (props) => <IconCode {...props} stroke={1.5} />,\n isActive: { name: 'codeBlock' },\n operation: { name: 'toggleCodeBlock' },\n});\n\nexport const HighlightControl = createControl({\n label: 'highlightControlLabel',\n icon: (props) => <IconHighlight {...props} stroke={1.5} />,\n isActive: { name: 'highlight' },\n operation: { name: 'toggleHighlight' },\n});\n\nexport const HrControl = createControl({\n label: 'highlightControlLabel',\n icon: (props) => <IconLineDashed {...props} stroke={1.5} />,\n operation: { name: 'setHorizontalRule' },\n});\n"],"names":[],"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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AAE,KAAK,EAAE,uBAAuB;AAChC,EAAE,IAAI,EAAE,CAAC,KAAK,qBAAqB,KAAK,CAAC,aAAa,CAAC,cAAc,EAAE,aAAa,CAAC,cAAc,CAAC,EAAE,EAAE,KAAK,CAAC,EAAE;AAChH,IAAI,MAAM,EAAE,GAAG;AACf,GAAG,CAAC,CAAC;AACL,EAAE,SAAS,EAAE,EAAE,IAAI,EAAE,mBAAmB,EAAE;AAC1C,CAAC;;;;"}
|
|
1
|
+
{"version":3,"file":"controls.js","sources":["../../src/controls/controls.tsx"],"sourcesContent":["import React from 'react';\nimport {\n IconBold,\n IconItalic,\n IconUnderline,\n IconStrikethrough,\n IconClearFormatting,\n IconH1,\n IconH2,\n IconH3,\n IconH4,\n IconH5,\n IconH6,\n IconList,\n IconListNumbers,\n IconUnlink,\n IconBlockquote,\n IconAlignLeft,\n IconAlignRight,\n IconAlignCenter,\n IconAlignJustified,\n IconSubscript,\n IconSuperscript,\n IconCode,\n IconHighlight,\n IconLineDashed,\n IconCircleOff,\n} from '@tabler/icons';\nimport { createControl } from './ControlBase/create-control';\n\nexport const BoldControl = createControl({\n label: 'boldControlLabel',\n icon: (props) => <IconBold {...props} stroke={1.5} />,\n isActive: { name: 'bold' },\n operation: { name: 'toggleBold' },\n});\n\nexport const ItalicControl = createControl({\n label: 'italicControlLabel',\n icon: (props) => <IconItalic {...props} stroke={1.5} />,\n isActive: { name: 'italic' },\n operation: { name: 'toggleItalic' },\n});\n\nexport const UnderlineControl = createControl({\n label: 'underlineControlLabel',\n icon: (props) => <IconUnderline {...props} stroke={1.5} />,\n isActive: { name: 'underline' },\n operation: { name: 'toggleUnderline' },\n});\n\nexport const StrikeThroughControl = createControl({\n label: 'strikeControlLabel',\n icon: (props) => <IconStrikethrough {...props} stroke={1.5} />,\n isActive: { name: 'strike' },\n operation: { name: 'toggleStrike' },\n});\n\nexport const ClearFormattingControl = createControl({\n label: 'clearFormattingControlLabel',\n icon: (props) => <IconClearFormatting {...props} stroke={1.5} />,\n operation: { name: 'unsetAllMarks' },\n});\n\nexport const UnlinkControl = createControl({\n label: 'unlinkControlLabel',\n icon: (props) => <IconUnlink {...props} stroke={1.5} />,\n operation: { name: 'unsetLink' },\n});\n\nexport const BulletListControl = createControl({\n label: 'bulletListControlLabel',\n icon: (props) => <IconList {...props} stroke={1.5} />,\n isActive: { name: 'bulletList' },\n operation: { name: 'toggleBulletList' },\n});\n\nexport const OrderedListControl = createControl({\n label: 'orderedListControlLabel',\n icon: (props) => <IconListNumbers {...props} stroke={1.5} />,\n isActive: { name: 'orderedList' },\n operation: { name: 'toggleOrderedList' },\n});\n\nexport const H1Control = createControl({\n label: 'h1ControlLabel',\n icon: (props) => <IconH1 {...props} stroke={1.5} />,\n isActive: { name: 'heading', attributes: { level: 1 } },\n operation: { name: 'toggleHeading', attributes: { level: 1 } },\n});\n\nexport const H2Control = createControl({\n label: 'h2ControlLabel',\n icon: (props) => <IconH2 {...props} stroke={1.5} />,\n isActive: { name: 'heading', attributes: { level: 2 } },\n operation: { name: 'toggleHeading', attributes: { level: 2 } },\n});\n\nexport const H3Control = createControl({\n label: 'h3ControlLabel',\n icon: (props) => <IconH3 {...props} stroke={1.5} />,\n isActive: { name: 'heading', attributes: { level: 3 } },\n operation: { name: 'toggleHeading', attributes: { level: 3 } },\n});\n\nexport const H4Control = createControl({\n label: 'h4ControlLabel',\n icon: (props) => <IconH4 {...props} stroke={1.5} />,\n isActive: { name: 'heading', attributes: { level: 4 } },\n operation: { name: 'toggleHeading', attributes: { level: 4 } },\n});\n\nexport const H5Control = createControl({\n label: 'h5ControlLabel',\n icon: (props) => <IconH5 {...props} stroke={1.5} />,\n isActive: { name: 'heading', attributes: { level: 5 } },\n operation: { name: 'toggleHeading', attributes: { level: 5 } },\n});\n\nexport const H6Control = createControl({\n label: 'h6ControlLabel',\n icon: (props) => <IconH6 {...props} stroke={1.5} />,\n isActive: { name: 'heading', attributes: { level: 6 } },\n operation: { name: 'toggleHeading', attributes: { level: 6 } },\n});\n\nexport const BlockquoteControl = createControl({\n label: 'blockquoteControlLabel',\n icon: (props) => <IconBlockquote {...props} stroke={1.5} />,\n isActive: { name: 'blockquote' },\n operation: { name: 'toggleBlockquote' },\n});\n\nexport const AlignLeftControl = createControl({\n label: 'alignLeftControlLabel',\n icon: (props) => <IconAlignLeft {...props} stroke={1.5} />,\n operation: { name: 'setTextAlign', attributes: 'left' },\n});\n\nexport const AlignRightControl = createControl({\n label: 'alignRightControlLabel',\n icon: (props) => <IconAlignRight {...props} stroke={1.5} />,\n operation: { name: 'setTextAlign', attributes: 'right' },\n});\n\nexport const AlignCenterControl = createControl({\n label: 'alignCenterControlLabel',\n icon: (props) => <IconAlignCenter {...props} stroke={1.5} />,\n operation: { name: 'setTextAlign', attributes: 'center' },\n});\n\nexport const AlignJustifyControl = createControl({\n label: 'alignJustifyControlLabel',\n icon: (props) => <IconAlignJustified {...props} stroke={1.5} />,\n operation: { name: 'setTextAlign', attributes: 'justify' },\n});\n\nexport const SubscriptControl = createControl({\n label: 'subscriptControlLabel',\n icon: (props) => <IconSubscript {...props} stroke={1.5} />,\n isActive: { name: 'subscript' },\n operation: { name: 'toggleSubscript' },\n});\n\nexport const SuperscriptControl = createControl({\n label: 'superscriptControlLabel',\n icon: (props) => <IconSuperscript {...props} stroke={1.5} />,\n isActive: { name: 'superscript' },\n operation: { name: 'toggleSuperscript' },\n});\n\nexport const CodeControl = createControl({\n label: 'codeControlLabel',\n icon: (props) => <IconCode {...props} stroke={1.5} />,\n isActive: { name: 'code' },\n operation: { name: 'toggleCode' },\n});\n\nexport const CodeBlockControl = createControl({\n label: 'codeBlockControlLabel',\n icon: (props) => <IconCode {...props} stroke={1.5} />,\n isActive: { name: 'codeBlock' },\n operation: { name: 'toggleCodeBlock' },\n});\n\nexport const HighlightControl = createControl({\n label: 'highlightControlLabel',\n icon: (props) => <IconHighlight {...props} stroke={1.5} />,\n isActive: { name: 'highlight' },\n operation: { name: 'toggleHighlight' },\n});\n\nexport const HrControl = createControl({\n label: 'hrControlLabel',\n icon: (props) => <IconLineDashed {...props} stroke={1.5} />,\n operation: { name: 'setHorizontalRule' },\n});\n\nexport const UnsetColorControl = createControl({\n label: 'unsetColorControlLabel',\n icon: (props) => <IconCircleOff {...props} stroke={1.5} />,\n operation: { name: 'unsetColor' },\n});\n"],"names":[],"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,CAA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iBAAiB,EAAE;AACxC,CAAC,EAAE;AACS,MAAC,SAAS,GAAG,aAAa,CAAC;AACvC,EAAE,KAAK,EAAE,gBAAgB;AACzB,EAAE,IAAI,EAAE,CAAC,KAAK,qBAAqB,KAAK,CAAC,aAAa,CAAC,cAAc,EAAE,aAAa,CAAC,cAAc,CAAC,EAAE,EAAE,KAAK,CAAC,EAAE;AAChH,IAAI,MAAM,EAAE,GAAG;AACf,GAAG,CAAC,CAAC;AACL,EAAE,SAAS,EAAE,EAAE,IAAI,EAAE,mBAAmB,EAAE;AAC1C,CAAC,EAAE;AACS,MAAC,iBAAiB,GAAG,aAAa,CAAC;AAC/C,EAAE,KAAK,EAAE,wBAAwB;AACjC,EAAE,IAAI,EAAE,CAAC,KAAK,qBAAqB,KAAK,CAAC,aAAa,CAAC,aAAa,EAAE,aAAa,CAAC,cAAc,CAAC,EAAE,EAAE,KAAK,CAAC,EAAE;AAC/G,IAAI,MAAM,EAAE,GAAG;AACf,GAAG,CAAC,CAAC;AACL,EAAE,SAAS,EAAE,EAAE,IAAI,EAAE,YAAY,EAAE;AACnC,CAAC;;;;"}
|
package/esm/labels.js
CHANGED
|
@@ -6,7 +6,7 @@ const DEFAULT_LABELS = {
|
|
|
6
6
|
boldControlLabel: "Bold",
|
|
7
7
|
italicControlLabel: "Italic",
|
|
8
8
|
underlineControlLabel: "Underline",
|
|
9
|
-
strikeControlLabel: "
|
|
9
|
+
strikeControlLabel: "Strikethrough",
|
|
10
10
|
clearFormattingControlLabel: "Clear formatting",
|
|
11
11
|
unlinkControlLabel: "Remove link",
|
|
12
12
|
bulletListControlLabel: "Bullet list",
|
|
@@ -26,6 +26,8 @@ const DEFAULT_LABELS = {
|
|
|
26
26
|
codeBlockControlLabel: "Code block",
|
|
27
27
|
subscriptControlLabel: "Subscript",
|
|
28
28
|
superscriptControlLabel: "Superscript",
|
|
29
|
+
unsetColorControlLabel: "Unset color",
|
|
30
|
+
hrControlLabel: "Horizontal line",
|
|
29
31
|
linkEditorInputLabel: "Enter URL",
|
|
30
32
|
linkEditorInputPlaceholder: "https://example.com/",
|
|
31
33
|
linkEditorExternalLink: "Open link in a new tab",
|
package/esm/labels.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"labels.js","sources":["../src/labels.ts"],"sourcesContent":["export interface RichTextEditorLabels {\n /** RichTextEditor.Bold control aria-label */\n boldControlLabel: string;\n\n /** RichTextEditor.Italic control aria-label */\n italicControlLabel: string;\n\n /** RichTextEditor.Underline control aria-label */\n underlineControlLabel: string;\n\n /** RichTextEditor.Strike control aria-label */\n strikeControlLabel: string;\n\n /** RichTextEditor.ClearFormatting control aria-label */\n clearFormattingControlLabel: string;\n\n /** RichTextEditor.Link control aria-label */\n linkControlLabel: string;\n\n /** RichTextEditor.Unlink control aria-label */\n unlinkControlLabel: string;\n\n /** RichTextEditor.BulletList control aria-label */\n bulletListControlLabel: string;\n\n /** RichTextEditor.OrderedList control aria-label */\n orderedListControlLabel: string;\n\n /** RichTextEditor.H1 control aria-label */\n h1ControlLabel: string;\n\n /** RichTextEditor.H2 control aria-label */\n h2ControlLabel: string;\n\n /** RichTextEditor.H3 control aria-label */\n h3ControlLabel: string;\n\n /** RichTextEditor.H4 control aria-label */\n h4ControlLabel: string;\n\n /** RichTextEditor.H5 control aria-label */\n h5ControlLabel: string;\n\n /** RichTextEditor.H6 control aria-label */\n h6ControlLabel: string;\n\n /** RichTextEditor.Blockquote control aria-label */\n blockquoteControlLabel: string;\n\n /** RichTextEditor.AlignLeft control aria-label */\n alignLeftControlLabel: string;\n\n /** RichTextEditor.AlignCenter control aria-label */\n alignCenterControlLabel: string;\n\n /** RichTextEditor.AlignRight control aria-label */\n alignRightControlLabel: string;\n\n /** RichTextEditor.AlignJustify control aria-label */\n alignJustifyControlLabel: string;\n\n /** RichTextEditor.Code control aria-label */\n codeControlLabel: string;\n\n /** RichTextEditor.CodeBlock control aria-label */\n codeBlockControlLabel: string;\n\n /** RichTextEditor.Subscript control aria-label */\n subscriptControlLabel: string;\n\n /** RichTextEditor.Superscript control aria-label */\n superscriptControlLabel: string;\n\n /** RichTextEditor.ColorPicker control aria-label */\n colorPickerControlLabel: string;\n\n /** RichTextEditor.Highlight control aria-label */\n highlightControlLabel: string;\n\n /** A function go get RichTextEditor.Color control aria-label based on color that control applies */\n colorControlLabel(color: string): string;\n\n /** aria-label for link editor url input */\n linkEditorInputLabel: string;\n\n /** placeholder for link editor url input */\n linkEditorInputPlaceholder: string;\n\n /** Content of external button tooltip in link editor when the link was chosen to open in a new tab */\n linkEditorExternalLink: string;\n\n /** Content of external button tooltip in link editor when the link was chosen to open in the same tab */\n linkEditorInternalLink: string;\n\n /** Save button content in link editor */\n linkEditorSave: string;\n\n /** Cancel button
|
|
1
|
+
{"version":3,"file":"labels.js","sources":["../src/labels.ts"],"sourcesContent":["export interface RichTextEditorLabels {\n /** RichTextEditor.Bold control aria-label */\n boldControlLabel: string;\n\n /** RichTextEditor.Hr control aria-label */\n hrControlLabel: string;\n\n /** RichTextEditor.Italic control aria-label */\n italicControlLabel: string;\n\n /** RichTextEditor.Underline control aria-label */\n underlineControlLabel: string;\n\n /** RichTextEditor.Strike control aria-label */\n strikeControlLabel: string;\n\n /** RichTextEditor.ClearFormatting control aria-label */\n clearFormattingControlLabel: string;\n\n /** RichTextEditor.Link control aria-label */\n linkControlLabel: string;\n\n /** RichTextEditor.Unlink control aria-label */\n unlinkControlLabel: string;\n\n /** RichTextEditor.BulletList control aria-label */\n bulletListControlLabel: string;\n\n /** RichTextEditor.OrderedList control aria-label */\n orderedListControlLabel: string;\n\n /** RichTextEditor.H1 control aria-label */\n h1ControlLabel: string;\n\n /** RichTextEditor.H2 control aria-label */\n h2ControlLabel: string;\n\n /** RichTextEditor.H3 control aria-label */\n h3ControlLabel: string;\n\n /** RichTextEditor.H4 control aria-label */\n h4ControlLabel: string;\n\n /** RichTextEditor.H5 control aria-label */\n h5ControlLabel: string;\n\n /** RichTextEditor.H6 control aria-label */\n h6ControlLabel: string;\n\n /** RichTextEditor.Blockquote control aria-label */\n blockquoteControlLabel: string;\n\n /** RichTextEditor.AlignLeft control aria-label */\n alignLeftControlLabel: string;\n\n /** RichTextEditor.AlignCenter control aria-label */\n alignCenterControlLabel: string;\n\n /** RichTextEditor.AlignRight control aria-label */\n alignRightControlLabel: string;\n\n /** RichTextEditor.AlignJustify control aria-label */\n alignJustifyControlLabel: string;\n\n /** RichTextEditor.Code control aria-label */\n codeControlLabel: string;\n\n /** RichTextEditor.CodeBlock control aria-label */\n codeBlockControlLabel: string;\n\n /** RichTextEditor.Subscript control aria-label */\n subscriptControlLabel: string;\n\n /** RichTextEditor.Superscript control aria-label */\n superscriptControlLabel: string;\n\n /** RichTextEditor.ColorPicker control aria-label */\n colorPickerControlLabel: string;\n\n /** RichTextEditor.UnsetColor control aria-label */\n unsetColorControlLabel: string;\n\n /** RichTextEditor.Highlight control aria-label */\n highlightControlLabel: string;\n\n /** A function go get RichTextEditor.Color control aria-label based on color that control applies */\n colorControlLabel(color: string): string;\n\n /** aria-label for link editor url input */\n linkEditorInputLabel: string;\n\n /** placeholder for link editor url input */\n linkEditorInputPlaceholder: string;\n\n /** Content of external button tooltip in link editor when the link was chosen to open in a new tab */\n linkEditorExternalLink: string;\n\n /** Content of external button tooltip in link editor when the link was chosen to open in the same tab */\n linkEditorInternalLink: string;\n\n /** Save button content in link editor */\n linkEditorSave: string;\n\n /** Cancel button title text in color picker control */\n colorPickerCancel: string;\n\n /** Clear button title text in color picker control */\n colorPickerClear: string;\n\n /** Color picker button title text in color picker control */\n colorPickerColorPicker: string;\n\n /** Palette button title text in color picker control */\n colorPickerPalette: string;\n\n /** Save button title text in color picker control */\n colorPickerSave: string;\n\n /** aria-label for color palette colors */\n colorPickerColorLabel(color: string): string;\n}\n\nexport const DEFAULT_LABELS: RichTextEditorLabels = {\n // Controls labels\n linkControlLabel: 'Link',\n colorPickerControlLabel: 'Text color',\n highlightControlLabel: 'Highlight text',\n colorControlLabel: (color) => `Set text color ${color}`,\n boldControlLabel: 'Bold',\n italicControlLabel: 'Italic',\n underlineControlLabel: 'Underline',\n strikeControlLabel: 'Strikethrough',\n clearFormattingControlLabel: 'Clear formatting',\n unlinkControlLabel: 'Remove link',\n bulletListControlLabel: 'Bullet list',\n orderedListControlLabel: 'Ordered list',\n h1ControlLabel: 'Heading 1',\n h2ControlLabel: 'Heading 2',\n h3ControlLabel: 'Heading 3',\n h4ControlLabel: 'Heading 4',\n h5ControlLabel: 'Heading 5',\n h6ControlLabel: 'Heading 6',\n blockquoteControlLabel: 'Blockquote',\n alignLeftControlLabel: 'Align text: left',\n alignCenterControlLabel: 'Align text: center',\n alignRightControlLabel: 'Align text: right',\n alignJustifyControlLabel: 'Align text: justify',\n codeControlLabel: 'Code',\n codeBlockControlLabel: 'Code block',\n subscriptControlLabel: 'Subscript',\n superscriptControlLabel: 'Superscript',\n unsetColorControlLabel: 'Unset color',\n hrControlLabel: 'Horizontal line',\n\n // Link editor\n linkEditorInputLabel: 'Enter URL',\n linkEditorInputPlaceholder: 'https://example.com/',\n linkEditorExternalLink: 'Open link in a new tab',\n linkEditorInternalLink: 'Open link in the same tab',\n linkEditorSave: 'Save',\n\n // Color picker control\n colorPickerCancel: 'Cancel',\n colorPickerClear: 'Clear color',\n colorPickerColorPicker: 'Color picker',\n colorPickerPalette: 'Color palette',\n colorPickerSave: 'Save',\n colorPickerColorLabel: (color) => `Set text color ${color}`,\n};\n"],"names":[],"mappings":"AAAY,MAAC,cAAc,GAAG;AAC9B,EAAE,gBAAgB,EAAE,MAAM;AAC1B,EAAE,uBAAuB,EAAE,YAAY;AACvC,EAAE,qBAAqB,EAAE,gBAAgB;AACzC,EAAE,iBAAiB,EAAE,CAAC,KAAK,KAAK,CAAC,eAAe,EAAE,KAAK,CAAC,CAAC;AACzD,EAAE,gBAAgB,EAAE,MAAM;AAC1B,EAAE,kBAAkB,EAAE,QAAQ;AAC9B,EAAE,qBAAqB,EAAE,WAAW;AACpC,EAAE,kBA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[],"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,
|
|
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,wBAqBE"}
|
package/lib/RichTextEditor.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ import useStyles from './RichTextEditor.styles';
|
|
|
11
11
|
export declare type RichTextEditorStylesNames = Selectors<typeof useStyles> | ContentStylesNames | ControlStylesNames | ControlsGroupStylesNames | ToolbarStylesNames | LinkControlStylesNames;
|
|
12
12
|
export interface RichTextEditorProps extends DefaultProps<RichTextEditorStylesNames>, React.ComponentPropsWithoutRef<'div'> {
|
|
13
13
|
/** Tiptap editor instance */
|
|
14
|
-
editor: Editor;
|
|
14
|
+
editor: Editor | null;
|
|
15
15
|
/** Determines whether code highlight styles should be added, true by default */
|
|
16
16
|
withCodeHighlightStyles?: boolean;
|
|
17
17
|
/** Determines whether typography styles should be added, true by default */
|
|
@@ -55,6 +55,7 @@ export declare namespace RichTextEditor {
|
|
|
55
55
|
var Color: React.ForwardRefExoticComponent<import(".").RichTextEditorColorControlProps & React.RefAttributes<HTMLButtonElement>>;
|
|
56
56
|
var Highlight: React.ForwardRefExoticComponent<import("./controls/Control/Control").PremadeControlProps & React.RefAttributes<HTMLButtonElement>>;
|
|
57
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>>;
|
|
58
59
|
var displayName: string;
|
|
59
60
|
}
|
|
60
61
|
//# sourceMappingURL=RichTextEditor.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RichTextEditor.d.ts","sourceRoot":"","sources":["../src/RichTextEditor.tsx"],"names":[],"mappings":"AACA,OAAO,KAAkB,MAAM,OAAO,CAAC;AACvC,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,CAAC;
|
|
1
|
+
{"version":3,"file":"RichTextEditor.d.ts","sourceRoot":"","sources":["../src/RichTextEditor.tsx"],"names":[],"mappings":"AACA,OAAO,KAAkB,MAAM,OAAO,CAAC;AACvC,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,wBAAgB,cAAc,CAAC,KAAK,EAAE,mBAAmB,eA2BxD;yBA3Be,cAAc"}
|
|
@@ -7,8 +7,6 @@ export interface ColorPickerControlProps extends DefaultProps, React.ComponentPr
|
|
|
7
7
|
colorPickerProps?: Partial<ColorPickerProps>;
|
|
8
8
|
/** List of colors that the user can choose from */
|
|
9
9
|
colors: string[];
|
|
10
|
-
/** Determines whether tooltips over controls should be visible */
|
|
11
|
-
disableTooltips?: boolean;
|
|
12
10
|
}
|
|
13
11
|
export declare const ColorPickerControl: React.ForwardRefExoticComponent<ColorPickerControlProps & React.RefAttributes<HTMLButtonElement>>;
|
|
14
12
|
//# sourceMappingURL=ColorPickerControl.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ColorPickerControl.d.ts","sourceRoot":"","sources":["../../../src/controls/ColorPickerControl/ColorPickerControl.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA+B,MAAM,OAAO,CAAC;AACpD,OAAO,EACL,YAAY,EAEZ,YAAY,EAOZ,gBAAgB,EAEjB,MAAM,eAAe,CAAC;AAMvB,MAAM,WAAW,uBACf,SAAQ,YAAY,EAClB,KAAK,CAAC,wBAAwB,CAAC,QAAQ,CAAC;IAC1C,uCAAuC;IACvC,YAAY,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC;IAErC,2CAA2C;IAC3C,gBAAgB,CAAC,EAAE,OAAO,CAAC,gBAAgB,CAAC,CAAC;IAE7C,mDAAmD;IACnD,MAAM,EAAE,MAAM,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"ColorPickerControl.d.ts","sourceRoot":"","sources":["../../../src/controls/ColorPickerControl/ColorPickerControl.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA+B,MAAM,OAAO,CAAC;AACpD,OAAO,EACL,YAAY,EAEZ,YAAY,EAOZ,gBAAgB,EAEjB,MAAM,eAAe,CAAC;AAMvB,MAAM,WAAW,uBACf,SAAQ,YAAY,EAClB,KAAK,CAAC,wBAAwB,CAAC,QAAQ,CAAC;IAC1C,uCAAuC;IACvC,YAAY,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC;IAErC,2CAA2C;IAC3C,gBAAgB,CAAC,EAAE,OAAO,CAAC,gBAAgB,CAAC,CAAC;IAE7C,mDAAmD;IACnD,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB;AAED,eAAO,MAAM,kBAAkB,mGAyI9B,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
declare const _default: (params: void, options?: import("@mantine/core").UseStylesOptions<"
|
|
2
|
-
classes: Record<"
|
|
1
|
+
declare const _default: (params: void, options?: import("@mantine/core").UseStylesOptions<"linkEditorSave" | "linkEditor" | "linkEditorInput" | "linkEditorExternalControl">) => {
|
|
2
|
+
classes: Record<"linkEditorSave" | "linkEditor" | "linkEditorInput" | "linkEditorExternalControl", string>;
|
|
3
3
|
cx: (...args: any) => string;
|
|
4
4
|
theme: import("@mantine/core").MantineTheme;
|
|
5
5
|
};
|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
export declare const BoldControl: React.ForwardRefExoticComponent<import("./Control/Control").PremadeControlProps & React.RefAttributes<HTMLButtonElement>>;
|
|
3
3
|
export declare const ItalicControl: React.ForwardRefExoticComponent<import("./Control/Control").PremadeControlProps & React.RefAttributes<HTMLButtonElement>>;
|
|
4
4
|
export declare const UnderlineControl: React.ForwardRefExoticComponent<import("./Control/Control").PremadeControlProps & React.RefAttributes<HTMLButtonElement>>;
|
|
5
|
-
export declare const
|
|
5
|
+
export declare const StrikeThroughControl: React.ForwardRefExoticComponent<import("./Control/Control").PremadeControlProps & React.RefAttributes<HTMLButtonElement>>;
|
|
6
6
|
export declare const ClearFormattingControl: React.ForwardRefExoticComponent<import("./Control/Control").PremadeControlProps & React.RefAttributes<HTMLButtonElement>>;
|
|
7
7
|
export declare const UnlinkControl: React.ForwardRefExoticComponent<import("./Control/Control").PremadeControlProps & React.RefAttributes<HTMLButtonElement>>;
|
|
8
8
|
export declare const BulletListControl: React.ForwardRefExoticComponent<import("./Control/Control").PremadeControlProps & React.RefAttributes<HTMLButtonElement>>;
|
|
@@ -24,4 +24,5 @@ export declare const CodeControl: React.ForwardRefExoticComponent<import("./Cont
|
|
|
24
24
|
export declare const CodeBlockControl: React.ForwardRefExoticComponent<import("./Control/Control").PremadeControlProps & React.RefAttributes<HTMLButtonElement>>;
|
|
25
25
|
export declare const HighlightControl: React.ForwardRefExoticComponent<import("./Control/Control").PremadeControlProps & React.RefAttributes<HTMLButtonElement>>;
|
|
26
26
|
export declare const HrControl: React.ForwardRefExoticComponent<import("./Control/Control").PremadeControlProps & React.RefAttributes<HTMLButtonElement>>;
|
|
27
|
+
export declare const UnsetColorControl: React.ForwardRefExoticComponent<import("./Control/Control").PremadeControlProps & React.RefAttributes<HTMLButtonElement>>;
|
|
27
28
|
//# sourceMappingURL=controls.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"controls.d.ts","sourceRoot":"","sources":["../../src/controls/controls.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"controls.d.ts","sourceRoot":"","sources":["../../src/controls/controls.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AA8B1B,eAAO,MAAM,WAAW,2HAKtB,CAAC;AAEH,eAAO,MAAM,aAAa,2HAKxB,CAAC;AAEH,eAAO,MAAM,gBAAgB,2HAK3B,CAAC;AAEH,eAAO,MAAM,oBAAoB,2HAK/B,CAAC;AAEH,eAAO,MAAM,sBAAsB,2HAIjC,CAAC;AAEH,eAAO,MAAM,aAAa,2HAIxB,CAAC;AAEH,eAAO,MAAM,iBAAiB,2HAK5B,CAAC;AAEH,eAAO,MAAM,kBAAkB,2HAK7B,CAAC;AAEH,eAAO,MAAM,SAAS,2HAKpB,CAAC;AAEH,eAAO,MAAM,SAAS,2HAKpB,CAAC;AAEH,eAAO,MAAM,SAAS,2HAKpB,CAAC;AAEH,eAAO,MAAM,SAAS,2HAKpB,CAAC;AAEH,eAAO,MAAM,SAAS,2HAKpB,CAAC;AAEH,eAAO,MAAM,SAAS,2HAKpB,CAAC;AAEH,eAAO,MAAM,iBAAiB,2HAK5B,CAAC;AAEH,eAAO,MAAM,gBAAgB,2HAI3B,CAAC;AAEH,eAAO,MAAM,iBAAiB,2HAI5B,CAAC;AAEH,eAAO,MAAM,kBAAkB,2HAI7B,CAAC;AAEH,eAAO,MAAM,mBAAmB,2HAI9B,CAAC;AAEH,eAAO,MAAM,gBAAgB,2HAK3B,CAAC;AAEH,eAAO,MAAM,kBAAkB,2HAK7B,CAAC;AAEH,eAAO,MAAM,WAAW,2HAKtB,CAAC;AAEH,eAAO,MAAM,gBAAgB,2HAK3B,CAAC;AAEH,eAAO,MAAM,gBAAgB,2HAK3B,CAAC;AAEH,eAAO,MAAM,SAAS,2HAIpB,CAAC;AAEH,eAAO,MAAM,iBAAiB,2HAI5B,CAAC"}
|
package/lib/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ export * from './extensions';
|
|
|
2
2
|
export { RichTextEditor } from './RichTextEditor';
|
|
3
3
|
export { useRichTextEditorContext } from './RichTextEditor.context';
|
|
4
4
|
export { DEFAULT_LABELS } from './labels';
|
|
5
|
-
export type { RichTextEditorProps } from './RichTextEditor';
|
|
5
|
+
export type { RichTextEditorProps, RichTextEditorStylesNames } from './RichTextEditor';
|
|
6
6
|
export type { RichTextEditorToolbarProps } from './Toolbar/Toolbar';
|
|
7
7
|
export type { RichTextEditorControlProps } from './controls/Control/Control';
|
|
8
8
|
export type { RichTextEditorColorControlProps } from './controls/ColorControl/ColorControl';
|
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,wBAAwB,EAAE,MAAM,0BAA0B,CAAC;AACpE,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAE1C,YAAY,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,wBAAwB,EAAE,MAAM,0BAA0B,CAAC;AACpE,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAE1C,YAAY,EAAE,mBAAmB,EAAE,yBAAyB,EAAE,MAAM,kBAAkB,CAAC;AACvF,YAAY,EAAE,0BAA0B,EAAE,MAAM,mBAAmB,CAAC;AACpE,YAAY,EAAE,0BAA0B,EAAE,MAAM,4BAA4B,CAAC;AAC7E,YAAY,EAAE,+BAA+B,EAAE,MAAM,sCAAsC,CAAC;AAC5F,YAAY,EAAE,8BAA8B,EAAE,MAAM,oCAAoC,CAAC;AACzF,YAAY,EAAE,0BAA0B,EAAE,MAAM,mBAAmB,CAAC;AACpE,YAAY,EAAE,gCAAgC,EAAE,MAAM,wCAAwC,CAAC;AAC/F,YAAY,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC"}
|
package/lib/labels.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
export interface RichTextEditorLabels {
|
|
2
2
|
/** RichTextEditor.Bold control aria-label */
|
|
3
3
|
boldControlLabel: string;
|
|
4
|
+
/** RichTextEditor.Hr control aria-label */
|
|
5
|
+
hrControlLabel: string;
|
|
4
6
|
/** RichTextEditor.Italic control aria-label */
|
|
5
7
|
italicControlLabel: string;
|
|
6
8
|
/** RichTextEditor.Underline control aria-label */
|
|
@@ -49,6 +51,8 @@ export interface RichTextEditorLabels {
|
|
|
49
51
|
superscriptControlLabel: string;
|
|
50
52
|
/** RichTextEditor.ColorPicker control aria-label */
|
|
51
53
|
colorPickerControlLabel: string;
|
|
54
|
+
/** RichTextEditor.UnsetColor control aria-label */
|
|
55
|
+
unsetColorControlLabel: string;
|
|
52
56
|
/** RichTextEditor.Highlight control aria-label */
|
|
53
57
|
highlightControlLabel: string;
|
|
54
58
|
/** A function go get RichTextEditor.Color control aria-label based on color that control applies */
|
|
@@ -63,15 +67,15 @@ export interface RichTextEditorLabels {
|
|
|
63
67
|
linkEditorInternalLink: string;
|
|
64
68
|
/** Save button content in link editor */
|
|
65
69
|
linkEditorSave: string;
|
|
66
|
-
/** Cancel button
|
|
70
|
+
/** Cancel button title text in color picker control */
|
|
67
71
|
colorPickerCancel: string;
|
|
68
|
-
/** Clear button
|
|
72
|
+
/** Clear button title text in color picker control */
|
|
69
73
|
colorPickerClear: string;
|
|
70
|
-
/** Color picker button
|
|
74
|
+
/** Color picker button title text in color picker control */
|
|
71
75
|
colorPickerColorPicker: string;
|
|
72
|
-
/** Palette button
|
|
76
|
+
/** Palette button title text in color picker control */
|
|
73
77
|
colorPickerPalette: string;
|
|
74
|
-
/** Save button
|
|
78
|
+
/** Save button title text in color picker control */
|
|
75
79
|
colorPickerSave: string;
|
|
76
80
|
/** aria-label for color palette colors */
|
|
77
81
|
colorPickerColorLabel(color: string): string;
|
package/lib/labels.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"labels.d.ts","sourceRoot":"","sources":["../src/labels.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,oBAAoB;IACnC,6CAA6C;IAC7C,gBAAgB,EAAE,MAAM,CAAC;IAEzB,+CAA+C;IAC/C,kBAAkB,EAAE,MAAM,CAAC;IAE3B,kDAAkD;IAClD,qBAAqB,EAAE,MAAM,CAAC;IAE9B,+CAA+C;IAC/C,kBAAkB,EAAE,MAAM,CAAC;IAE3B,wDAAwD;IACxD,2BAA2B,EAAE,MAAM,CAAC;IAEpC,6CAA6C;IAC7C,gBAAgB,EAAE,MAAM,CAAC;IAEzB,+CAA+C;IAC/C,kBAAkB,EAAE,MAAM,CAAC;IAE3B,mDAAmD;IACnD,sBAAsB,EAAE,MAAM,CAAC;IAE/B,oDAAoD;IACpD,uBAAuB,EAAE,MAAM,CAAC;IAEhC,2CAA2C;IAC3C,cAAc,EAAE,MAAM,CAAC;IAEvB,2CAA2C;IAC3C,cAAc,EAAE,MAAM,CAAC;IAEvB,2CAA2C;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CAAC;IAE9B,oGAAoG;IACpG,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;IAEzC,2CAA2C;IAC3C,oBAAoB,EAAE,MAAM,CAAC;IAE7B,4CAA4C;IAC5C,0BAA0B,EAAE,MAAM,CAAC;IAEnC,sGAAsG;IACtG,sBAAsB,EAAE,MAAM,CAAC;IAE/B,yGAAyG;IACzG,sBAAsB,EAAE,MAAM,CAAC;IAE/B,yCAAyC;IACzC,cAAc,EAAE,MAAM,CAAC;IAEvB,uDAAuD;IACvD,iBAAiB,EAAE,MAAM,CAAC;IAE1B,sDAAsD;IACtD,gBAAgB,EAAE,MAAM,CAAC;IAEzB,6DAA6D;IAC7D,sBAAsB,EAAE,MAAM,CAAC;IAE/B,wDAAwD;IACxD,kBAAkB,EAAE,MAAM,CAAC;IAE3B,qDAAqD;IACrD,eAAe,EAAE,MAAM,CAAC;IAExB,0CAA0C;IAC1C,qBAAqB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;CAC9C;AAED,eAAO,MAAM,cAAc,EAAE,oBA8C5B,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.
|
|
4
|
+
"version": "5.8.1",
|
|
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.
|
|
31
|
-
"@mantine/hooks": "5.
|
|
30
|
+
"@mantine/core": "5.8.1",
|
|
31
|
+
"@mantine/hooks": "5.8.1",
|
|
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.
|
|
38
|
+
"@mantine/utils": "5.8.1"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {}
|
|
41
41
|
}
|