@mantine/tiptap 9.0.0-alpha.5 → 9.0.0-alpha.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/RichTextEditor.cjs +99 -112
- package/cjs/RichTextEditor.cjs.map +1 -1
- package/cjs/RichTextEditor.context.cjs +7 -8
- package/cjs/RichTextEditor.context.cjs.map +1 -1
- package/cjs/RichTextEditor.module.cjs +21 -0
- package/cjs/RichTextEditor.module.cjs.map +1 -0
- package/cjs/RichTextEditorContent/RichTextEditorContent.cjs +44 -43
- package/cjs/RichTextEditorContent/RichTextEditorContent.cjs.map +1 -1
- package/cjs/RichTextEditorControl/RichTextEditorColorControl.cjs +26 -26
- package/cjs/RichTextEditorControl/RichTextEditorColorControl.cjs.map +1 -1
- package/cjs/RichTextEditorControl/RichTextEditorColorPickerControl.cjs +127 -129
- package/cjs/RichTextEditorControl/RichTextEditorColorPickerControl.cjs.map +1 -1
- package/cjs/RichTextEditorControl/RichTextEditorControl.cjs +60 -82
- package/cjs/RichTextEditorControl/RichTextEditorControl.cjs.map +1 -1
- package/cjs/RichTextEditorControl/RichTextEditorLinkControl.cjs +120 -132
- package/cjs/RichTextEditorControl/RichTextEditorLinkControl.cjs.map +1 -1
- package/cjs/RichTextEditorControl/RichTextEditorSourceCodeControl.cjs +34 -37
- package/cjs/RichTextEditorControl/RichTextEditorSourceCodeControl.cjs.map +1 -1
- package/cjs/RichTextEditorControl/controls.cjs +240 -186
- package/cjs/RichTextEditorControl/controls.cjs.map +1 -1
- package/cjs/RichTextEditorControlsGroup/RichTextEditorControlsGroup.cjs +24 -23
- package/cjs/RichTextEditorControlsGroup/RichTextEditorControlsGroup.cjs.map +1 -1
- package/cjs/RichTextEditorToolbar/RichTextEditorToolbar.cjs +26 -36
- package/cjs/RichTextEditorToolbar/RichTextEditorToolbar.cjs.map +1 -1
- package/cjs/_virtual/_rolldown/runtime.cjs +24 -0
- package/cjs/extensions/Link.cjs +12 -19
- package/cjs/extensions/Link.cjs.map +1 -1
- package/cjs/extensions/TaskList.cjs +16 -23
- package/cjs/extensions/TaskList.cjs.map +1 -1
- package/cjs/icons/Icons.cjs +536 -289
- package/cjs/icons/Icons.cjs.map +1 -1
- package/cjs/index.cjs +57 -62
- package/cjs/labels.cjs +51 -55
- package/cjs/labels.cjs.map +1 -1
- package/esm/RichTextEditor.context.mjs +6 -5
- package/esm/RichTextEditor.context.mjs.map +1 -1
- package/esm/RichTextEditor.mjs +58 -70
- package/esm/RichTextEditor.mjs.map +1 -1
- package/esm/RichTextEditor.module.mjs +21 -0
- package/esm/RichTextEditor.module.mjs.map +1 -0
- package/esm/RichTextEditorContent/RichTextEditorContent.mjs +42 -40
- package/esm/RichTextEditorContent/RichTextEditorContent.mjs.map +1 -1
- package/esm/RichTextEditorControl/RichTextEditorColorControl.mjs +25 -24
- package/esm/RichTextEditorControl/RichTextEditorColorControl.mjs.map +1 -1
- package/esm/RichTextEditorControl/RichTextEditorColorPickerControl.mjs +126 -127
- package/esm/RichTextEditorControl/RichTextEditorColorPickerControl.mjs.map +1 -1
- package/esm/RichTextEditorControl/RichTextEditorControl.mjs +58 -79
- package/esm/RichTextEditorControl/RichTextEditorControl.mjs.map +1 -1
- package/esm/RichTextEditorControl/RichTextEditorLinkControl.mjs +117 -128
- package/esm/RichTextEditorControl/RichTextEditorLinkControl.mjs.map +1 -1
- package/esm/RichTextEditorControl/RichTextEditorSourceCodeControl.mjs +33 -35
- package/esm/RichTextEditorControl/RichTextEditorSourceCodeControl.mjs.map +1 -1
- package/esm/RichTextEditorControl/controls.mjs +179 -124
- package/esm/RichTextEditorControl/controls.mjs.map +1 -1
- package/esm/RichTextEditorControlsGroup/RichTextEditorControlsGroup.mjs +22 -20
- package/esm/RichTextEditorControlsGroup/RichTextEditorControlsGroup.mjs.map +1 -1
- package/esm/RichTextEditorToolbar/RichTextEditorToolbar.mjs +24 -33
- package/esm/RichTextEditorToolbar/RichTextEditorToolbar.mjs.map +1 -1
- package/esm/extensions/Link.mjs +10 -13
- package/esm/extensions/Link.mjs.map +1 -1
- package/esm/extensions/TaskList.mjs +16 -21
- package/esm/extensions/TaskList.mjs.map +1 -1
- package/esm/icons/Icons.mjs +535 -286
- package/esm/icons/Icons.mjs.map +1 -1
- package/esm/index.mjs +14 -14
- package/esm/labels.mjs +51 -53
- package/esm/labels.mjs.map +1 -1
- package/package.json +3 -3
- package/cjs/RichTextEditor.module.css.cjs +0 -7
- package/cjs/RichTextEditor.module.css.cjs.map +0 -1
- package/cjs/index.cjs.map +0 -1
- package/esm/RichTextEditor.module.css.mjs +0 -5
- package/esm/RichTextEditor.module.css.mjs.map +0 -1
- package/esm/index.mjs.map +0 -1
package/cjs/labels.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"labels.cjs","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 /** RichTextEditor.Undo control aria-label */\n undoControlLabel: string;\n\n /** RichTextEditor.Redo control aria-label */\n redoControlLabel: 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 /** RichTextEditor.SourceCode control aria-label */\n sourceCodeControlLabel: 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 /** Aria-label for task list control */\n tasksControlLabel: string;\n\n /** Aria-label for task list sink task */\n tasksSinkLabel: string;\n\n /** Aria-label for task list lift task */\n tasksLiftLabel: 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 sourceCodeControlLabel: 'Switch between text/source code',\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 undoControlLabel: 'Undo',\n redoControlLabel: 'Redo',\n\n // Task list\n tasksControlLabel: 'Task list',\n tasksSinkLabel: 'Decrease task level',\n tasksLiftLabel: 'Increase task level',\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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CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAuB,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,KAAU,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAkB,CAAA,CAAA,CAAA,CAAA,CAAK,CAAA,CAAA;AAC3D,CAAA,CAAA;;"}
|
|
1
|
+
{"version":3,"file":"labels.cjs","names":[],"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 /** RichTextEditor.Undo control aria-label */\n undoControlLabel: string;\n\n /** RichTextEditor.Redo control aria-label */\n redoControlLabel: 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 /** RichTextEditor.SourceCode control aria-label */\n sourceCodeControlLabel: 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 /** Aria-label for task list control */\n tasksControlLabel: string;\n\n /** Aria-label for task list sink task */\n tasksSinkLabel: string;\n\n /** Aria-label for task list lift task */\n tasksLiftLabel: 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 sourceCodeControlLabel: 'Switch between text/source code',\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 undoControlLabel: 'Undo',\n redoControlLabel: 'Redo',\n\n // Task list\n tasksControlLabel: 'Task list',\n tasksSinkLabel: 'Decrease task level',\n tasksLiftLabel: 'Increase task level',\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"],"mappings":";;AA4IA,MAAa,iBAAuC;CAElD,kBAAkB;CAClB,yBAAyB;CACzB,uBAAuB;CACvB,oBAAoB,UAAU,kBAAkB;CAChD,kBAAkB;CAClB,oBAAoB;CACpB,uBAAuB;CACvB,oBAAoB;CACpB,6BAA6B;CAC7B,oBAAoB;CACpB,wBAAwB;CACxB,yBAAyB;CACzB,wBAAwB;CACxB,gBAAgB;CAChB,gBAAgB;CAChB,gBAAgB;CAChB,gBAAgB;CAChB,gBAAgB;CAChB,gBAAgB;CAChB,wBAAwB;CACxB,uBAAuB;CACvB,yBAAyB;CACzB,wBAAwB;CACxB,0BAA0B;CAC1B,kBAAkB;CAClB,uBAAuB;CACvB,uBAAuB;CACvB,yBAAyB;CACzB,wBAAwB;CACxB,gBAAgB;CAChB,kBAAkB;CAClB,kBAAkB;CAGlB,mBAAmB;CACnB,gBAAgB;CAChB,gBAAgB;CAGhB,sBAAsB;CACtB,4BAA4B;CAC5B,wBAAwB;CACxB,wBAAwB;CACxB,gBAAgB;CAGhB,mBAAmB;CACnB,kBAAkB;CAClB,wBAAwB;CACxB,oBAAoB;CACpB,iBAAiB;CACjB,wBAAwB,UAAU,kBAAkB;CACrD"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
import { createSafeContext } from
|
|
3
|
-
|
|
1
|
+
"use client";
|
|
2
|
+
import { createSafeContext } from "@mantine/core";
|
|
3
|
+
//#region packages/@mantine/tiptap/src/RichTextEditor.context.ts
|
|
4
4
|
const [RichTextEditorProvider, useRichTextEditorContext] = createSafeContext("RichTextEditor component was not found in tree");
|
|
5
|
-
|
|
5
|
+
//#endregion
|
|
6
6
|
export { RichTextEditorProvider, useRichTextEditorContext };
|
|
7
|
-
|
|
7
|
+
|
|
8
|
+
//# sourceMappingURL=RichTextEditor.context.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RichTextEditor.context.mjs","sources":["../src/RichTextEditor.context.ts"],"sourcesContent":["import { Editor } from '@tiptap/react';\nimport { createSafeContext, GetStylesApi } from '@mantine/core';\nimport { RichTextEditorLabels } from './labels';\nimport type { RichTextEditorFactory } from './RichTextEditor';\n\ninterface RichTextEditorContext {\n getStyles: GetStylesApi<RichTextEditorFactory>;\n editor: Editor | null;\n labels: RichTextEditorLabels;\n withCodeHighlightStyles: boolean | undefined;\n withTypographyStyles: boolean | undefined;\n unstyled: boolean | undefined;\n variant: string | undefined;\n onSourceCodeTextSwitch?: (isSourceCodeModeActive: boolean) => void;\n}\n\nexport const [RichTextEditorProvider, useRichTextEditorContext] =\n createSafeContext<RichTextEditorContext>('RichTextEditor component was not found in tree');\n"],"
|
|
1
|
+
{"version":3,"file":"RichTextEditor.context.mjs","names":[],"sources":["../src/RichTextEditor.context.ts"],"sourcesContent":["import { Editor } from '@tiptap/react';\nimport { createSafeContext, GetStylesApi } from '@mantine/core';\nimport { RichTextEditorLabels } from './labels';\nimport type { RichTextEditorFactory } from './RichTextEditor';\n\ninterface RichTextEditorContext {\n getStyles: GetStylesApi<RichTextEditorFactory>;\n editor: Editor | null;\n labels: RichTextEditorLabels;\n withCodeHighlightStyles: boolean | undefined;\n withTypographyStyles: boolean | undefined;\n unstyled: boolean | undefined;\n variant: string | undefined;\n onSourceCodeTextSwitch?: (isSourceCodeModeActive: boolean) => void;\n}\n\nexport const [RichTextEditorProvider, useRichTextEditorContext] =\n createSafeContext<RichTextEditorContext>('RichTextEditor component was not found in tree');\n"],"mappings":";;;AAgBA,MAAa,CAAC,wBAAwB,4BACpC,kBAAyC,iDAAiD"}
|
package/esm/RichTextEditor.mjs
CHANGED
|
@@ -1,75 +1,62 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import
|
|
17
|
-
|
|
1
|
+
"use client";
|
|
2
|
+
import RichTextEditor_module_default from "./RichTextEditor.module.mjs";
|
|
3
|
+
import { DEFAULT_LABELS } from "./labels.mjs";
|
|
4
|
+
import { RichTextEditorProvider } from "./RichTextEditor.context.mjs";
|
|
5
|
+
import { RichTextEditorContent } from "./RichTextEditorContent/RichTextEditorContent.mjs";
|
|
6
|
+
import { RichTextEditorControl } from "./RichTextEditorControl/RichTextEditorControl.mjs";
|
|
7
|
+
import { AlignCenterControl, AlignJustifyControl, AlignLeftControl, AlignRightControl, BlockquoteControl, BoldControl, BulletListControl, ClearFormattingControl, CodeBlockControl, CodeControl, H1Control, H2Control, H3Control, H4Control, H5Control, H6Control, HighlightControl, HrControl, ItalicControl, OrderedListControl, RedoControl, StrikeThroughControl, SubscriptControl, SuperscriptControl, TaskListControl, TaskListLiftControl, TaskListSinkControl, UnderlineControl, UndoControl, UnlinkControl, UnsetColorControl } from "./RichTextEditorControl/controls.mjs";
|
|
8
|
+
import { RichTextEditorLinkControl } from "./RichTextEditorControl/RichTextEditorLinkControl.mjs";
|
|
9
|
+
import { RichTextEditorColorPickerControl } from "./RichTextEditorControl/RichTextEditorColorPickerControl.mjs";
|
|
10
|
+
import { RichTextEditorColorControl } from "./RichTextEditorControl/RichTextEditorColorControl.mjs";
|
|
11
|
+
import { RichTextEditorSourceCodeControl } from "./RichTextEditorControl/RichTextEditorSourceCodeControl.mjs";
|
|
12
|
+
import { RichTextEditorControlsGroup } from "./RichTextEditorControlsGroup/RichTextEditorControlsGroup.mjs";
|
|
13
|
+
import { RichTextEditorToolbar } from "./RichTextEditorToolbar/RichTextEditorToolbar.mjs";
|
|
14
|
+
import { useMemo } from "react";
|
|
15
|
+
import { Box, factory, useProps, useStyles } from "@mantine/core";
|
|
16
|
+
import { jsx } from "react/jsx-runtime";
|
|
17
|
+
//#region packages/@mantine/tiptap/src/RichTextEditor.tsx
|
|
18
18
|
const defaultProps = {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
withCodeHighlightStyles: true,
|
|
20
|
+
withTypographyStyles: true,
|
|
21
|
+
variant: "default"
|
|
22
22
|
};
|
|
23
23
|
const RichTextEditor = factory((_props) => {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
value: {
|
|
59
|
-
editor,
|
|
60
|
-
getStyles,
|
|
61
|
-
labels: mergedLabels,
|
|
62
|
-
withCodeHighlightStyles,
|
|
63
|
-
withTypographyStyles,
|
|
64
|
-
onSourceCodeTextSwitch,
|
|
65
|
-
unstyled,
|
|
66
|
-
variant
|
|
67
|
-
},
|
|
68
|
-
children: /* @__PURE__ */ jsx(Box, { ...getStyles("root"), ...others, children })
|
|
69
|
-
}
|
|
70
|
-
);
|
|
24
|
+
const props = useProps("RichTextEditor", defaultProps, _props);
|
|
25
|
+
const { classNames, className, style, styles, unstyled, vars, editor, withCodeHighlightStyles, withTypographyStyles, onSourceCodeTextSwitch, labels, children, variant, attributes, ...others } = props;
|
|
26
|
+
const getStyles = useStyles({
|
|
27
|
+
name: "RichTextEditor",
|
|
28
|
+
classes: RichTextEditor_module_default,
|
|
29
|
+
props,
|
|
30
|
+
className,
|
|
31
|
+
style,
|
|
32
|
+
classNames,
|
|
33
|
+
styles,
|
|
34
|
+
unstyled,
|
|
35
|
+
attributes,
|
|
36
|
+
vars
|
|
37
|
+
});
|
|
38
|
+
return /* @__PURE__ */ jsx(RichTextEditorProvider, {
|
|
39
|
+
value: {
|
|
40
|
+
editor,
|
|
41
|
+
getStyles,
|
|
42
|
+
labels: useMemo(() => ({
|
|
43
|
+
...DEFAULT_LABELS,
|
|
44
|
+
...labels
|
|
45
|
+
}), [labels]),
|
|
46
|
+
withCodeHighlightStyles,
|
|
47
|
+
withTypographyStyles,
|
|
48
|
+
onSourceCodeTextSwitch,
|
|
49
|
+
unstyled,
|
|
50
|
+
variant
|
|
51
|
+
},
|
|
52
|
+
children: /* @__PURE__ */ jsx(Box, {
|
|
53
|
+
...getStyles("root"),
|
|
54
|
+
...others,
|
|
55
|
+
children
|
|
56
|
+
})
|
|
57
|
+
});
|
|
71
58
|
});
|
|
72
|
-
RichTextEditor.classes =
|
|
59
|
+
RichTextEditor.classes = RichTextEditor_module_default;
|
|
73
60
|
RichTextEditor.displayName = "@mantine/tiptap/RichTextEditor";
|
|
74
61
|
RichTextEditor.Content = RichTextEditorContent;
|
|
75
62
|
RichTextEditor.Control = RichTextEditorControl;
|
|
@@ -110,6 +97,7 @@ RichTextEditor.TaskList = TaskListControl;
|
|
|
110
97
|
RichTextEditor.TaskListSink = TaskListSinkControl;
|
|
111
98
|
RichTextEditor.TaskListLift = TaskListLiftControl;
|
|
112
99
|
RichTextEditor.SourceCode = RichTextEditorSourceCodeControl;
|
|
113
|
-
|
|
100
|
+
//#endregion
|
|
114
101
|
export { RichTextEditor };
|
|
115
|
-
|
|
102
|
+
|
|
103
|
+
//# sourceMappingURL=RichTextEditor.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RichTextEditor.mjs","sources":["../src/RichTextEditor.tsx"],"sourcesContent":["import { useMemo } from 'react';\nimport { Editor } from '@tiptap/react';\nimport {\n Box,\n BoxProps,\n ElementProps,\n factory,\n Factory,\n StylesApiProps,\n useProps,\n useStyles,\n} from '@mantine/core';\nimport { DEFAULT_LABELS, RichTextEditorLabels } from './labels';\nimport { RichTextEditorProvider } from './RichTextEditor.context';\nimport { RichTextEditorContent } from './RichTextEditorContent/RichTextEditorContent';\nimport * as controls from './RichTextEditorControl';\nimport { RichTextEditorControl } from './RichTextEditorControl/RichTextEditorControl';\nimport { RichTextEditorSourceCodeControl } from './RichTextEditorControl/RichTextEditorSourceCodeControl';\nimport { RichTextEditorControlsGroup } from './RichTextEditorControlsGroup/RichTextEditorControlsGroup';\nimport { RichTextEditorToolbar } from './RichTextEditorToolbar/RichTextEditorToolbar';\nimport classes from './RichTextEditor.module.css';\n\nexport type RichTextEditorVariant = 'default' | 'subtle';\n\nexport type RichTextEditorStylesNames =\n | 'linkEditorSave'\n | 'linkEditorDropdown'\n | 'root'\n | 'content'\n | 'Typography'\n | 'control'\n | 'controlIcon'\n | 'controlsGroup'\n | 'toolbar'\n | 'linkEditor'\n | 'linkEditorInput'\n | 'linkEditorExternalControl';\n\nexport interface RichTextEditorProps\n extends BoxProps, StylesApiProps<RichTextEditorFactory>, ElementProps<'div'> {\n /** Tiptap editor instance */\n editor: Editor | null;\n\n /** Determines whether code highlight styles should be added @default true */\n withCodeHighlightStyles?: boolean;\n\n /** Determines whether typography styles should be added @default true */\n withTypographyStyles?: boolean;\n\n /** Called if `RichTextEditor.SourceCode` clicked. */\n onSourceCodeTextSwitch?: (isSourceCodeModeActive: boolean) => void;\n\n /** Labels that are used in controls */\n labels?: Partial<RichTextEditorLabels>;\n\n /** Child editor components */\n children: React.ReactNode;\n}\n\nexport type RichTextEditorFactory = Factory<{\n props: RichTextEditorProps;\n ref: HTMLDivElement;\n stylesNames: RichTextEditorStylesNames;\n variant: RichTextEditorVariant;\n staticComponents: {\n Content: typeof RichTextEditorContent;\n Control: typeof RichTextEditorControl;\n Toolbar: typeof RichTextEditorToolbar;\n ControlsGroup: typeof RichTextEditorControlsGroup;\n Bold: typeof controls.BoldControl;\n Italic: typeof controls.ItalicControl;\n Strikethrough: typeof controls.StrikeThroughControl;\n Underline: typeof controls.UnderlineControl;\n ClearFormatting: typeof controls.ClearFormattingControl;\n H1: typeof controls.H1Control;\n H2: typeof controls.H2Control;\n H3: typeof controls.H3Control;\n H4: typeof controls.H4Control;\n H5: typeof controls.H5Control;\n H6: typeof controls.H6Control;\n BulletList: typeof controls.BulletListControl;\n OrderedList: typeof controls.OrderedListControl;\n Link: typeof controls.RichTextEditorLinkControl;\n Unlink: typeof controls.UnlinkControl;\n Blockquote: typeof controls.BlockquoteControl;\n AlignLeft: typeof controls.AlignLeftControl;\n AlignRight: typeof controls.AlignRightControl;\n AlignCenter: typeof controls.AlignCenterControl;\n AlignJustify: typeof controls.AlignJustifyControl;\n Superscript: typeof controls.SuperscriptControl;\n Subscript: typeof controls.SubscriptControl;\n Code: typeof controls.CodeControl;\n CodeBlock: typeof controls.CodeBlockControl;\n ColorPicker: typeof controls.RichTextEditorColorPickerControl;\n Color: typeof controls.RichTextEditorColorControl;\n Highlight: typeof controls.HighlightControl;\n Hr: typeof controls.HrControl;\n UnsetColor: typeof controls.UnsetColorControl;\n Undo: typeof controls.UndoControl;\n Redo: typeof controls.RedoControl;\n TaskList: typeof controls.TaskListControl;\n TaskListSink: typeof controls.TaskListSinkControl;\n TaskListLift: typeof controls.TaskListLiftControl;\n SourceCode: typeof RichTextEditorSourceCodeControl;\n };\n}>;\n\nconst defaultProps = {\n withCodeHighlightStyles: true,\n withTypographyStyles: true,\n variant: 'default',\n} satisfies Partial<RichTextEditorProps>;\n\nexport const RichTextEditor = factory<RichTextEditorFactory>((_props) => {\n const props = useProps('RichTextEditor', defaultProps, _props);\n const {\n classNames,\n className,\n style,\n styles,\n unstyled,\n vars,\n editor,\n withCodeHighlightStyles,\n withTypographyStyles,\n onSourceCodeTextSwitch,\n labels,\n children,\n variant,\n attributes,\n ...others\n } = props;\n\n const getStyles = useStyles<RichTextEditorFactory>({\n name: 'RichTextEditor',\n classes,\n props,\n className,\n style,\n classNames,\n styles,\n unstyled,\n attributes,\n vars,\n });\n\n const mergedLabels = useMemo(() => ({ ...DEFAULT_LABELS, ...labels }), [labels]);\n\n return (\n <RichTextEditorProvider\n value={{\n editor,\n getStyles,\n labels: mergedLabels,\n withCodeHighlightStyles,\n withTypographyStyles,\n onSourceCodeTextSwitch,\n unstyled,\n variant,\n }}\n >\n <Box {...getStyles('root')} {...others}>\n {children}\n </Box>\n </RichTextEditorProvider>\n );\n});\n\nRichTextEditor.classes = classes;\nRichTextEditor.displayName = '@mantine/tiptap/RichTextEditor';\n\n// Generic components\nRichTextEditor.Content = RichTextEditorContent;\nRichTextEditor.Control = RichTextEditorControl;\nRichTextEditor.Toolbar = RichTextEditorToolbar;\nRichTextEditor.ControlsGroup = RichTextEditorControlsGroup;\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.RichTextEditorLinkControl;\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.RichTextEditorColorPickerControl;\nRichTextEditor.Color = controls.RichTextEditorColorControl;\nRichTextEditor.Highlight = controls.HighlightControl;\nRichTextEditor.Hr = controls.HrControl;\nRichTextEditor.UnsetColor = controls.UnsetColorControl;\nRichTextEditor.Undo = controls.UndoControl;\nRichTextEditor.Redo = controls.RedoControl;\nRichTextEditor.TaskList = controls.TaskListControl;\nRichTextEditor.TaskListSink = controls.TaskListSinkControl;\nRichTextEditor.TaskListLift = controls.TaskListLiftControl;\nRichTextEditor.SourceCode = RichTextEditorSourceCodeControl;\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.RichTextEditorLinkControl","controls.UnlinkControl","controls.BlockquoteControl","controls.AlignLeftControl","controls.AlignRightControl","controls.AlignCenterControl","controls.AlignJustifyControl","controls.SuperscriptControl","controls.SubscriptControl","controls.CodeControl","controls.CodeBlockControl","controls.RichTextEditorColorPickerControl","controls.RichTextEditorColorControl","controls.HighlightControl","controls.HrControl","controls.UnsetColorControl","controls.UndoControl","controls.RedoControl","controls.TaskListControl","controls.TaskListSinkControl","controls.TaskListLiftControl"],"mappings":";;;;;;;;;;;;;;;;;AA2GA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,YAAA,CAAA,CAAA,CAAe,CAAA;AAAA,CAAA,CACnB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAyB,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CAAA,CACzB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAsB,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CAAA,CACtB,OAAA,CAAA,CAAS,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AACX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AeC,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAS,CAAA;AACvC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAe,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAa,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;;"}
|
|
1
|
+
{"version":3,"file":"RichTextEditor.mjs","names":["classes","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.RichTextEditorLinkControl","controls.UnlinkControl","controls.BlockquoteControl","controls.AlignLeftControl","controls.AlignRightControl","controls.AlignCenterControl","controls.AlignJustifyControl","controls.SuperscriptControl","controls.SubscriptControl","controls.CodeControl","controls.CodeBlockControl","controls.RichTextEditorColorPickerControl","controls.RichTextEditorColorControl","controls.HighlightControl","controls.HrControl","controls.UnsetColorControl","controls.UndoControl","controls.RedoControl","controls.TaskListControl","controls.TaskListSinkControl","controls.TaskListLiftControl"],"sources":["../src/RichTextEditor.tsx"],"sourcesContent":["import { useMemo } from 'react';\nimport { Editor } from '@tiptap/react';\nimport {\n Box,\n BoxProps,\n ElementProps,\n factory,\n Factory,\n StylesApiProps,\n useProps,\n useStyles,\n} from '@mantine/core';\nimport { DEFAULT_LABELS, RichTextEditorLabels } from './labels';\nimport { RichTextEditorProvider } from './RichTextEditor.context';\nimport { RichTextEditorContent } from './RichTextEditorContent/RichTextEditorContent';\nimport * as controls from './RichTextEditorControl';\nimport { RichTextEditorControl } from './RichTextEditorControl/RichTextEditorControl';\nimport { RichTextEditorSourceCodeControl } from './RichTextEditorControl/RichTextEditorSourceCodeControl';\nimport { RichTextEditorControlsGroup } from './RichTextEditorControlsGroup/RichTextEditorControlsGroup';\nimport { RichTextEditorToolbar } from './RichTextEditorToolbar/RichTextEditorToolbar';\nimport classes from './RichTextEditor.module.css';\n\nexport type RichTextEditorVariant = 'default' | 'subtle';\n\nexport type RichTextEditorStylesNames =\n | 'linkEditorSave'\n | 'linkEditorDropdown'\n | 'root'\n | 'content'\n | 'Typography'\n | 'control'\n | 'controlIcon'\n | 'controlsGroup'\n | 'toolbar'\n | 'linkEditor'\n | 'linkEditorInput'\n | 'linkEditorExternalControl';\n\nexport interface RichTextEditorProps\n extends BoxProps, StylesApiProps<RichTextEditorFactory>, ElementProps<'div'> {\n /** Tiptap editor instance */\n editor: Editor | null;\n\n /** Determines whether code highlight styles should be added @default true */\n withCodeHighlightStyles?: boolean;\n\n /** Determines whether typography styles should be added @default true */\n withTypographyStyles?: boolean;\n\n /** Called if `RichTextEditor.SourceCode` clicked. */\n onSourceCodeTextSwitch?: (isSourceCodeModeActive: boolean) => void;\n\n /** Labels that are used in controls */\n labels?: Partial<RichTextEditorLabels>;\n\n /** Child editor components */\n children: React.ReactNode;\n}\n\nexport type RichTextEditorFactory = Factory<{\n props: RichTextEditorProps;\n ref: HTMLDivElement;\n stylesNames: RichTextEditorStylesNames;\n variant: RichTextEditorVariant;\n staticComponents: {\n Content: typeof RichTextEditorContent;\n Control: typeof RichTextEditorControl;\n Toolbar: typeof RichTextEditorToolbar;\n ControlsGroup: typeof RichTextEditorControlsGroup;\n Bold: typeof controls.BoldControl;\n Italic: typeof controls.ItalicControl;\n Strikethrough: typeof controls.StrikeThroughControl;\n Underline: typeof controls.UnderlineControl;\n ClearFormatting: typeof controls.ClearFormattingControl;\n H1: typeof controls.H1Control;\n H2: typeof controls.H2Control;\n H3: typeof controls.H3Control;\n H4: typeof controls.H4Control;\n H5: typeof controls.H5Control;\n H6: typeof controls.H6Control;\n BulletList: typeof controls.BulletListControl;\n OrderedList: typeof controls.OrderedListControl;\n Link: typeof controls.RichTextEditorLinkControl;\n Unlink: typeof controls.UnlinkControl;\n Blockquote: typeof controls.BlockquoteControl;\n AlignLeft: typeof controls.AlignLeftControl;\n AlignRight: typeof controls.AlignRightControl;\n AlignCenter: typeof controls.AlignCenterControl;\n AlignJustify: typeof controls.AlignJustifyControl;\n Superscript: typeof controls.SuperscriptControl;\n Subscript: typeof controls.SubscriptControl;\n Code: typeof controls.CodeControl;\n CodeBlock: typeof controls.CodeBlockControl;\n ColorPicker: typeof controls.RichTextEditorColorPickerControl;\n Color: typeof controls.RichTextEditorColorControl;\n Highlight: typeof controls.HighlightControl;\n Hr: typeof controls.HrControl;\n UnsetColor: typeof controls.UnsetColorControl;\n Undo: typeof controls.UndoControl;\n Redo: typeof controls.RedoControl;\n TaskList: typeof controls.TaskListControl;\n TaskListSink: typeof controls.TaskListSinkControl;\n TaskListLift: typeof controls.TaskListLiftControl;\n SourceCode: typeof RichTextEditorSourceCodeControl;\n };\n}>;\n\nconst defaultProps = {\n withCodeHighlightStyles: true,\n withTypographyStyles: true,\n variant: 'default',\n} satisfies Partial<RichTextEditorProps>;\n\nexport const RichTextEditor = factory<RichTextEditorFactory>((_props) => {\n const props = useProps('RichTextEditor', defaultProps, _props);\n const {\n classNames,\n className,\n style,\n styles,\n unstyled,\n vars,\n editor,\n withCodeHighlightStyles,\n withTypographyStyles,\n onSourceCodeTextSwitch,\n labels,\n children,\n variant,\n attributes,\n ...others\n } = props;\n\n const getStyles = useStyles<RichTextEditorFactory>({\n name: 'RichTextEditor',\n classes,\n props,\n className,\n style,\n classNames,\n styles,\n unstyled,\n attributes,\n vars,\n });\n\n const mergedLabels = useMemo(() => ({ ...DEFAULT_LABELS, ...labels }), [labels]);\n\n return (\n <RichTextEditorProvider\n value={{\n editor,\n getStyles,\n labels: mergedLabels,\n withCodeHighlightStyles,\n withTypographyStyles,\n onSourceCodeTextSwitch,\n unstyled,\n variant,\n }}\n >\n <Box {...getStyles('root')} {...others}>\n {children}\n </Box>\n </RichTextEditorProvider>\n );\n});\n\nRichTextEditor.classes = classes;\nRichTextEditor.displayName = '@mantine/tiptap/RichTextEditor';\n\n// Generic components\nRichTextEditor.Content = RichTextEditorContent;\nRichTextEditor.Control = RichTextEditorControl;\nRichTextEditor.Toolbar = RichTextEditorToolbar;\nRichTextEditor.ControlsGroup = RichTextEditorControlsGroup;\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.RichTextEditorLinkControl;\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.RichTextEditorColorPickerControl;\nRichTextEditor.Color = controls.RichTextEditorColorControl;\nRichTextEditor.Highlight = controls.HighlightControl;\nRichTextEditor.Hr = controls.HrControl;\nRichTextEditor.UnsetColor = controls.UnsetColorControl;\nRichTextEditor.Undo = controls.UndoControl;\nRichTextEditor.Redo = controls.RedoControl;\nRichTextEditor.TaskList = controls.TaskListControl;\nRichTextEditor.TaskListSink = controls.TaskListSinkControl;\nRichTextEditor.TaskListLift = controls.TaskListLiftControl;\nRichTextEditor.SourceCode = RichTextEditorSourceCodeControl;\n"],"mappings":";;;;;;;;;;;;;;;;;AA2GA,MAAM,eAAe;CACnB,yBAAyB;CACzB,sBAAsB;CACtB,SAAS;CACV;AAED,MAAa,iBAAiB,SAAgC,WAAW;CACvE,MAAM,QAAQ,SAAS,kBAAkB,cAAc,OAAO;CAC9D,MAAM,EACJ,YACA,WACA,OACA,QACA,UACA,MACA,QACA,yBACA,sBACA,wBACA,QACA,UACA,SACA,YACA,GAAG,WACD;CAEJ,MAAM,YAAY,UAAiC;EACjD,MAAM;EACN,SAAA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD,CAAC;AAIF,QACE,oBAAC,wBAAD;EACE,OAAO;GACL;GACA;GACA,QAPe,eAAe;IAAE,GAAG;IAAgB,GAAG;IAAQ,GAAG,CAAC,OAAO,CAAC;GAQ1E;GACA;GACA;GACA;GACA;GACD;YAED,oBAAC,KAAD;GAAK,GAAI,UAAU,OAAO;GAAE,GAAI;GAC7B;GACG,CAAA;EACiB,CAAA;EAE3B;AAEF,eAAe,UAAUA;AACzB,eAAe,cAAc;AAG7B,eAAe,UAAU;AACzB,eAAe,UAAU;AACzB,eAAe,UAAU;AACzB,eAAe,gBAAgB;AAG/B,eAAe,OAAOC;AACtB,eAAe,SAASC;AACxB,eAAe,gBAAgBC;AAC/B,eAAe,YAAYC;AAC3B,eAAe,kBAAkBC;AACjC,eAAe,KAAKC;AACpB,eAAe,KAAKC;AACpB,eAAe,KAAKC;AACpB,eAAe,KAAKC;AACpB,eAAe,KAAKC;AACpB,eAAe,KAAKC;AACpB,eAAe,aAAaC;AAC5B,eAAe,cAAcC;AAC7B,eAAe,OAAOC;AACtB,eAAe,SAASC;AACxB,eAAe,aAAaC;AAC5B,eAAe,YAAYC;AAC3B,eAAe,aAAaC;AAC5B,eAAe,cAAcC;AAC7B,eAAe,eAAeC;AAC9B,eAAe,cAAcC;AAC7B,eAAe,YAAYC;AAC3B,eAAe,OAAOC;AACtB,eAAe,YAAYC;AAC3B,eAAe,cAAcC;AAC7B,eAAe,QAAQC;AACvB,eAAe,YAAYC;AAC3B,eAAe,KAAKC;AACpB,eAAe,aAAaC;AAC5B,eAAe,OAAOC;AACtB,eAAe,OAAOC;AACtB,eAAe,WAAWC;AAC1B,eAAe,eAAeC;AAC9B,eAAe,eAAeC;AAC9B,eAAe,aAAa"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
//#region packages/@mantine/tiptap/src/RichTextEditor.module.css
|
|
3
|
+
var RichTextEditor_module_default = {
|
|
4
|
+
"root": "m_dd3f7539",
|
|
5
|
+
"Typography": "m_f2016866",
|
|
6
|
+
"content": "m_c2204cc2",
|
|
7
|
+
"linkEditorDropdown": "m_8a991b4f",
|
|
8
|
+
"control": "m_c2207da6",
|
|
9
|
+
"controlIcon": "m_9cdfeb3f",
|
|
10
|
+
"controlsGroup": "m_2ab47ef2",
|
|
11
|
+
"linkEditor": "m_b67b711e",
|
|
12
|
+
"linkEditorInput": "m_296cf94c",
|
|
13
|
+
"linkEditorExternalControl": "m_cfef614",
|
|
14
|
+
"linkEditorSave": "m_3b28e7bb",
|
|
15
|
+
"toolbar": "m_4574a3c4",
|
|
16
|
+
"taskList": "m_8b44009a"
|
|
17
|
+
};
|
|
18
|
+
//#endregion
|
|
19
|
+
export { RichTextEditor_module_default as default };
|
|
20
|
+
|
|
21
|
+
//# sourceMappingURL=RichTextEditor.module.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RichTextEditor.module.mjs","names":[],"sources":["../src/RichTextEditor.module.css"],"sourcesContent":[".root {\n position: relative;\n border: 1px solid;\n border-radius: var(--mantine-radius-default);\n\n @mixin where-light {\n border-color: var(--mantine-color-gray-4);\n }\n\n @mixin where-dark {\n border-color: var(--mantine-color-dark-4);\n }\n}\n\n.Typography {\n padding: 0;\n margin: 0;\n\n & li > p {\n margin: 0;\n }\n\n & ul li,\n & ol li {\n margin-top: 2px;\n }\n\n & p {\n margin-bottom: 7px;\n }\n\n & h1,\n & h2,\n & h3,\n & h4,\n & h5,\n & h6,\n & p {\n margin-top: 0;\n }\n}\n\n.content {\n background-color: var(--mantine-color-body);\n border-radius: var(--mantine-radius-default);\n\n & :global(.ProseMirror) {\n outline: 0;\n padding: var(--mantine-spacing-md);\n }\n\n & :global(.ProseMirror > *:last-child) {\n margin-bottom: 0;\n }\n\n & :global(.ProseMirror p.is-editor-empty:first-of-type::before) {\n content: attr(data-placeholder);\n pointer-events: none;\n user-select: none;\n float: left;\n height: 0;\n color: var(--mantine-color-placeholder);\n }\n\n & :global(div:not(.ProseMirror)) {\n /* Position the bubble menu above the toolbar. As it doesn't have its own selector,\n assert that the non-ProseMirror div is the bubble or floating menu */\n z-index: 2;\n }\n\n & :global(pre) {\n font-family: var(--mantine-font-family-monospace);\n border-radius: var(--mantine-radius-default);\n padding: var(--mantine-spacing-sm) var(--mantine-spacing-md);\n\n @mixin where-light {\n background-color: var(--mantine-color-gray-0);\n color: var(--mantine-color-gray-9);\n --code-color-comment: var(--mantine-color-gray-5);\n --code-color-var: var(--mantine-color-red-7);\n --code-color-number: var(--mantine-color-blue-7);\n --code-color-title: var(--mantine-color-pink-7);\n --code-color-keyword: var(--mantine-color-violet-7);\n }\n\n @mixin where-dark {\n background-color: var(--mantine-color-dark-8);\n color: var(--mantine-color-dark-1);\n --code-color-comment: var(--mantine-color-dark-2);\n --code-color-var: var(--mantine-color-red-5);\n --code-color-number: var(--mantine-color-cyan-5);\n --code-color-title: var(--mantine-color-yellow-5);\n --code-color-keyword: var(--mantine-color-violet-3);\n }\n\n & code {\n background: none !important;\n color: inherit;\n font-size: var(--mantine-font-size-sm);\n padding: 0;\n }\n\n & :global(.hljs-comment),\n & :global(.hljs-quote) {\n color: var(--code-color-comment);\n }\n\n & :global(.hljs-variable),\n & :global(.hljs-template-variable),\n & :global(.hljs-attribute),\n & :global(.hljs-tag),\n & :global(.hljs-regexp),\n & :global(.hljs-link),\n & :global(.hljs-name),\n & :global(.hljs-selector-id),\n & :global(.hljs-selector-class) {\n color: var(--code-color-var);\n }\n\n & :global(.hljs-number),\n & :global(.hljs-meta),\n & :global(.hljs-built_in),\n & :global(.hljs-builtin-name),\n & :global(.hljs-literal),\n & :global(.hljs-type),\n & :global(.hljs-params) {\n color: var(--code-color-number);\n }\n\n & :global(.hljs-string),\n & :global(.hljs-symbol),\n & :global(.hljs-bullet) {\n color: var(--code-color-var);\n }\n\n & :global(.hljs-title),\n & :global(.hljs-section) {\n color: var(--code-color-title);\n }\n\n & :global(.hljs-keyword),\n & :global(.hljs-selector-tag) {\n color: var(--code-color-keyword);\n }\n\n & :global(.hljs-emphasis) {\n font-style: italic;\n }\n\n & :global(.hljs-strong) {\n font-weight: 700;\n }\n }\n}\n\n.linkEditorDropdown {\n background-color: var(--mantine-color-body);\n}\n\n.control {\n display: flex;\n justify-content: center;\n align-items: center;\n border-radius: var(--mantine-radius-default);\n cursor: default;\n\n &:where([data-variant='default']) {\n border: 1px solid;\n min-width: 26px;\n height: 26px;\n }\n\n &:where([data-variant='subtle']) {\n --control-icon-size: 20px;\n min-width: 32px;\n height: 32px;\n }\n\n @mixin where-light {\n background-color: var(--mantine-color-white);\n border-color: var(--mantine-color-gray-4);\n color: var(--mantine-color-gray-7);\n }\n\n @mixin where-dark {\n border-color: var(--mantine-color-dark-4);\n color: var(--mantine-color-dark-1);\n\n &:where([data-variant='default']) {\n background-color: var(--mantine-color-dark-6);\n }\n\n &:where([data-variant='subtle']) {\n background-color: var(--mantine-color-dark-7);\n }\n }\n\n &:where([data-disabled]) {\n cursor: not-allowed;\n color: var(--mantine-color-disabled-color);\n background-color: var(--mantine-color-disabled);\n }\n\n &:where([data-interactive]:not([data-disabled])) {\n cursor: pointer;\n\n @mixin hover {\n color: var(--mantine-color-bright);\n\n @mixin where-light {\n &:where([data-variant='default']) {\n background-color: var(--mantine-color-gray-0);\n }\n\n &:where([data-variant='subtle']) {\n background-color: var(--mantine-color-gray-1);\n }\n }\n\n @mixin where-dark {\n background-color: var(--mantine-color-dark-5);\n }\n }\n }\n\n &:where([data-active]) {\n background-color: var(--mantine-primary-color-light);\n color: var(--mantine-primary-color-light-color);\n\n @mixin hover {\n background-color: var(--mantine-primary-color-light-hover);\n }\n }\n}\n\n.controlIcon {\n width: var(--control-icon-size, 16px);\n height: var(--control-icon-size, 16px);\n}\n\n.controlsGroup {\n display: flex;\n background-color: var(--mantine-color-body);\n\n &:where([data-variant='default']) {\n & :where([data-rich-text-editor-control]) {\n border-radius: 0;\n\n &:where(:not(:last-of-type)) {\n border-inline-end-width: 0;\n }\n\n &:where(:last-of-type) {\n border-start-end-radius: var(--mantine-radius-default);\n border-end-end-radius: var(--mantine-radius-default);\n }\n\n &:where(:first-of-type) {\n border-start-start-radius: var(--mantine-radius-default);\n border-end-start-radius: var(--mantine-radius-default);\n }\n }\n }\n}\n\n.linkEditor {\n display: flex;\n}\n\n.linkEditorInput {\n border-start-end-radius: 0;\n border-end-end-radius: 0;\n border-inline-end: 0;\n}\n\n.linkEditorExternalControl {\n border: 1px solid;\n color: var(--mantine-color-text);\n height: 24px;\n width: 24px;\n display: flex;\n justify-content: center;\n align-items: center;\n border-radius: var(--mantine-radius-default);\n\n @mixin where-light {\n background-color: var(--mantine-color-white);\n border-color: var(--mantine-color-gray-4);\n }\n\n @mixin where-dark {\n background-color: var(--mantine-color-dark-7);\n border-color: var(--mantine-color-dark-4);\n }\n\n &:where([data-active]) {\n background-color: var(--mantine-primary-color-light);\n color: var(--mantine-primary-color-filled);\n\n @mixin hover {\n background-color: var(--mantine-primary-color-light-hover);\n }\n }\n}\n\n.linkEditorSave {\n border-start-start-radius: 0;\n border-end-start-radius: 0;\n}\n\n.toolbar {\n display: flex;\n align-items: center;\n flex-wrap: wrap;\n gap: var(--mantine-spacing-sm);\n top: var(--rte-sticky-offset, 0px);\n background-color: var(--mantine-color-body);\n z-index: 1;\n border-start-end-radius: var(--mantine-radius-default);\n border-start-start-radius: var(--mantine-radius-default);\n border-bottom: 1px solid;\n\n &:where([data-variant='default']) {\n padding: var(--mantine-spacing-xs) var(--mantine-spacing-md);\n }\n\n &:where([data-variant='subtle']) {\n padding: 4px;\n row-gap: 0;\n }\n\n @mixin where-light {\n border-color: var(--mantine-color-gray-4);\n }\n\n @mixin where-dark {\n border-color: var(--mantine-color-dark-4);\n }\n\n &:where([data-sticky]) {\n position: sticky;\n }\n}\n\n.taskList {\n list-style-type: none;\n padding: 0;\n padding-inline-start: 0;\n\n & :where(li) {\n margin: 0;\n padding: 0;\n display: flex;\n }\n\n & :where(ul) {\n margin-top: 5px;\n }\n\n & p {\n margin: 0;\n padding: 0;\n }\n\n & :where(label) {\n display: inline-block;\n }\n\n & :where(input) {\n cursor: pointer;\n appearance: none;\n width: 18px;\n height: 18px;\n border: 1px solid;\n border-radius: var(--mantine-radius-default);\n vertical-align: middle;\n position: relative;\n\n @mixin where-light {\n background-color: var(--mantine-color-white);\n border-color: var(--mantine-color-gray-4);\n }\n\n @mixin where-dark {\n background-color: var(--mantine-color-dark-6);\n border-color: var(--mantine-color-dark-4);\n }\n\n &:checked {\n background-color: var(--mantine-primary-color-filled);\n border-color: var(--mantine-primary-color-filled);\n\n &::before {\n position: absolute;\n content: '';\n inset: 0;\n background-image: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGZpbGw9Im5vbmUiIHZpZXdCb3g9IjAgMCAxMCA3Ij48cGF0aCBmaWxsPSIjZmZmIiBkPSJNNCA0LjU4NkwxLjcwNyAyLjI5M0ExIDEgMCAxMC4yOTMgMy43MDdsMyAzYS45OTcuOTk3IDAgMDAxLjQxNCAwbDUtNUExIDEgMCAxMDguMjkzLjI5M0w0IDQuNTg2eiIvPjwvc3ZnPg==');\n background-repeat: no-repeat;\n background-size: 10px;\n background-position: center;\n }\n }\n }\n\n & :where(li > label) {\n margin-inline-end: var(--mantine-spacing-sm);\n }\n}\n"],"mappings":""}
|
|
@@ -1,44 +1,46 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
|
|
1
|
+
"use client";
|
|
2
|
+
import RichTextEditor_module_default from "../RichTextEditor.module.mjs";
|
|
3
|
+
import { useRichTextEditorContext } from "../RichTextEditor.context.mjs";
|
|
4
|
+
import { Box, Typography, factory, useProps } from "@mantine/core";
|
|
5
|
+
import { EditorContent } from "@tiptap/react";
|
|
6
|
+
import { jsx } from "react/jsx-runtime";
|
|
7
|
+
//#region packages/@mantine/tiptap/src/RichTextEditorContent/RichTextEditorContent.tsx
|
|
8
8
|
const RichTextEditorContent = factory((_props) => {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
9
|
+
const { classNames, className, style, styles, vars, ...others } = useProps("RichTextEditorContent", null, _props);
|
|
10
|
+
const ctx = useRichTextEditorContext();
|
|
11
|
+
if (ctx.withTypographyStyles) return /* @__PURE__ */ jsx(Typography, {
|
|
12
|
+
...ctx.getStyles("Typography", {
|
|
13
|
+
className,
|
|
14
|
+
style,
|
|
15
|
+
styles,
|
|
16
|
+
classNames
|
|
17
|
+
}),
|
|
18
|
+
unstyled: ctx.unstyled,
|
|
19
|
+
children: /* @__PURE__ */ jsx(Box, {
|
|
20
|
+
component: EditorContent,
|
|
21
|
+
editor: ctx.editor,
|
|
22
|
+
...ctx.getStyles("content", {
|
|
23
|
+
classNames,
|
|
24
|
+
styles
|
|
25
|
+
}),
|
|
26
|
+
...others
|
|
27
|
+
})
|
|
28
|
+
});
|
|
29
|
+
return /* @__PURE__ */ jsx(Box, {
|
|
30
|
+
component: EditorContent,
|
|
31
|
+
editor: ctx.editor,
|
|
32
|
+
...ctx.getStyles("content", {
|
|
33
|
+
classNames,
|
|
34
|
+
styles,
|
|
35
|
+
className,
|
|
36
|
+
style
|
|
37
|
+
}),
|
|
38
|
+
...others
|
|
39
|
+
});
|
|
39
40
|
});
|
|
40
|
-
RichTextEditorContent.classes =
|
|
41
|
+
RichTextEditorContent.classes = RichTextEditor_module_default;
|
|
41
42
|
RichTextEditorContent.displayName = "@mantine/tiptap/RichTextEditorContent";
|
|
42
|
-
|
|
43
|
+
//#endregion
|
|
43
44
|
export { RichTextEditorContent };
|
|
44
|
-
|
|
45
|
+
|
|
46
|
+
//# sourceMappingURL=RichTextEditorContent.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RichTextEditorContent.mjs","sources":["../../src/RichTextEditorContent/RichTextEditorContent.tsx"],"sourcesContent":["import { EditorContent } from '@tiptap/react';\nimport {\n Box,\n BoxProps,\n CompoundStylesApiProps,\n ElementProps,\n factory,\n Factory,\n Typography,\n useProps,\n} from '@mantine/core';\nimport { useRichTextEditorContext } from '../RichTextEditor.context';\nimport classes from '../RichTextEditor.module.css';\n\nexport type RichTextEditorContentStylesNames = 'root';\nexport interface RichTextEditorContentProps\n extends BoxProps, CompoundStylesApiProps<RichTextEditorContentFactory>, ElementProps<'div'> {}\n\nexport type RichTextEditorContentFactory = Factory<{\n props: RichTextEditorContentProps;\n ref: HTMLDivElement;\n stylesNames: RichTextEditorContentStylesNames;\n compound: true;\n}>;\n\nexport const RichTextEditorContent = factory<RichTextEditorContentFactory>((_props) => {\n const props = useProps('RichTextEditorContent', null, _props);\n const { classNames, className, style, styles, vars, ...others } = props;\n const ctx = useRichTextEditorContext();\n\n if (ctx.withTypographyStyles) {\n return (\n <Typography\n {...ctx.getStyles('Typography', { className, style, styles, classNames })}\n unstyled={ctx.unstyled}\n >\n <Box\n component={EditorContent}\n editor={ctx.editor}\n {...ctx.getStyles('content', { classNames, styles })}\n {...others}\n />\n </Typography>\n );\n }\n\n return (\n <Box\n component={EditorContent}\n editor={ctx.editor}\n {...ctx.getStyles('content', { classNames, styles, className, style })}\n {...others}\n />\n );\n});\n\nRichTextEditorContent.classes = classes;\nRichTextEditorContent.displayName = '@mantine/tiptap/RichTextEditorContent';\n"],"
|
|
1
|
+
{"version":3,"file":"RichTextEditorContent.mjs","names":["classes"],"sources":["../../src/RichTextEditorContent/RichTextEditorContent.tsx"],"sourcesContent":["import { EditorContent } from '@tiptap/react';\nimport {\n Box,\n BoxProps,\n CompoundStylesApiProps,\n ElementProps,\n factory,\n Factory,\n Typography,\n useProps,\n} from '@mantine/core';\nimport { useRichTextEditorContext } from '../RichTextEditor.context';\nimport classes from '../RichTextEditor.module.css';\n\nexport type RichTextEditorContentStylesNames = 'root';\nexport interface RichTextEditorContentProps\n extends BoxProps, CompoundStylesApiProps<RichTextEditorContentFactory>, ElementProps<'div'> {}\n\nexport type RichTextEditorContentFactory = Factory<{\n props: RichTextEditorContentProps;\n ref: HTMLDivElement;\n stylesNames: RichTextEditorContentStylesNames;\n compound: true;\n}>;\n\nexport const RichTextEditorContent = factory<RichTextEditorContentFactory>((_props) => {\n const props = useProps('RichTextEditorContent', null, _props);\n const { classNames, className, style, styles, vars, ...others } = props;\n const ctx = useRichTextEditorContext();\n\n if (ctx.withTypographyStyles) {\n return (\n <Typography\n {...ctx.getStyles('Typography', { className, style, styles, classNames })}\n unstyled={ctx.unstyled}\n >\n <Box\n component={EditorContent}\n editor={ctx.editor}\n {...ctx.getStyles('content', { classNames, styles })}\n {...others}\n />\n </Typography>\n );\n }\n\n return (\n <Box\n component={EditorContent}\n editor={ctx.editor}\n {...ctx.getStyles('content', { classNames, styles, className, style })}\n {...others}\n />\n );\n});\n\nRichTextEditorContent.classes = classes;\nRichTextEditorContent.displayName = '@mantine/tiptap/RichTextEditorContent';\n"],"mappings":";;;;;;;AAyBA,MAAa,wBAAwB,SAAuC,WAAW;CAErF,MAAM,EAAE,YAAY,WAAW,OAAO,QAAQ,MAAM,GAAG,WADzC,SAAS,yBAAyB,MAAM,OAAO;CAE7D,MAAM,MAAM,0BAA0B;AAEtC,KAAI,IAAI,qBACN,QACE,oBAAC,YAAD;EACE,GAAI,IAAI,UAAU,cAAc;GAAE;GAAW;GAAO;GAAQ;GAAY,CAAC;EACzE,UAAU,IAAI;YAEd,oBAAC,KAAD;GACE,WAAW;GACX,QAAQ,IAAI;GACZ,GAAI,IAAI,UAAU,WAAW;IAAE;IAAY;IAAQ,CAAC;GACpD,GAAI;GACJ,CAAA;EACS,CAAA;AAIjB,QACE,oBAAC,KAAD;EACE,WAAW;EACX,QAAQ,IAAI;EACZ,GAAI,IAAI,UAAU,WAAW;GAAE;GAAY;GAAQ;GAAW;GAAO,CAAC;EACtE,GAAI;EACJ,CAAA;EAEJ;AAEF,sBAAsB,UAAUA;AAChC,sBAAsB,cAAc"}
|
|
@@ -1,28 +1,29 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
1
|
+
"use client";
|
|
2
|
+
import { useRichTextEditorContext } from "../RichTextEditor.context.mjs";
|
|
3
|
+
import { RichTextEditorControl } from "./RichTextEditorControl.mjs";
|
|
4
|
+
import { ColorSwatch, useProps } from "@mantine/core";
|
|
5
|
+
import { jsx } from "react/jsx-runtime";
|
|
6
|
+
//#region packages/@mantine/tiptap/src/RichTextEditorControl/RichTextEditorColorControl.tsx
|
|
7
7
|
function RichTextEditorColorControl(props) {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
8
|
+
const { color, ...others } = useProps("RichTextEditorColorControl", null, props);
|
|
9
|
+
const { editor, labels, variant } = useRichTextEditorContext();
|
|
10
|
+
const currentColor = editor?.getAttributes("textStyle").color || null;
|
|
11
|
+
const label = labels.colorControlLabel(color);
|
|
12
|
+
return /* @__PURE__ */ jsx(RichTextEditorControl, {
|
|
13
|
+
...others,
|
|
14
|
+
variant,
|
|
15
|
+
active: currentColor === color,
|
|
16
|
+
"aria-label": label,
|
|
17
|
+
title: label,
|
|
18
|
+
onClick: () => (editor?.chain()).focus().setColor(color).run(),
|
|
19
|
+
children: /* @__PURE__ */ jsx(ColorSwatch, {
|
|
20
|
+
color,
|
|
21
|
+
size: 14
|
|
22
|
+
})
|
|
23
|
+
});
|
|
24
24
|
}
|
|
25
25
|
RichTextEditorColorControl.displayName = "@mantine/tiptap/RichTextEditorColorControl";
|
|
26
|
-
|
|
26
|
+
//#endregion
|
|
27
27
|
export { RichTextEditorColorControl };
|
|
28
|
-
|
|
28
|
+
|
|
29
|
+
//# sourceMappingURL=RichTextEditorColorControl.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RichTextEditorColorControl.mjs","sources":["../../src/RichTextEditorControl/RichTextEditorColorControl.tsx"],"sourcesContent":["import { BoxProps, ColorSwatch, ElementProps, useProps } from '@mantine/core';\nimport { useRichTextEditorContext } from '../RichTextEditor.context';\nimport { RichTextEditorControl } from './RichTextEditorControl';\n\nexport interface RichTextEditorColorControlProps extends BoxProps, ElementProps<'button'> {\n /** Color that will be set as text color, for example #ef457e */\n color: string;\n}\n\nexport function RichTextEditorColorControl(props: RichTextEditorColorControlProps) {\n const { color, ...others } = useProps('RichTextEditorColorControl', null, props);\n const { editor, labels, variant } = useRichTextEditorContext();\n const currentColor = editor?.getAttributes('textStyle').color || null;\n const label = labels.colorControlLabel(color);\n\n return (\n <RichTextEditorControl\n {...others}\n variant={variant}\n active={currentColor === color}\n aria-label={label}\n title={label}\n onClick={() => (editor?.chain() as any).focus().setColor(color).run()}\n >\n <ColorSwatch color={color} size={14} />\n </RichTextEditorControl>\n );\n}\n\nRichTextEditorColorControl.displayName = '@mantine/tiptap/RichTextEditorColorControl';\n"],"
|
|
1
|
+
{"version":3,"file":"RichTextEditorColorControl.mjs","names":[],"sources":["../../src/RichTextEditorControl/RichTextEditorColorControl.tsx"],"sourcesContent":["import { BoxProps, ColorSwatch, ElementProps, useProps } from '@mantine/core';\nimport { useRichTextEditorContext } from '../RichTextEditor.context';\nimport { RichTextEditorControl } from './RichTextEditorControl';\n\nexport interface RichTextEditorColorControlProps extends BoxProps, ElementProps<'button'> {\n /** Color that will be set as text color, for example #ef457e */\n color: string;\n}\n\nexport function RichTextEditorColorControl(props: RichTextEditorColorControlProps) {\n const { color, ...others } = useProps('RichTextEditorColorControl', null, props);\n const { editor, labels, variant } = useRichTextEditorContext();\n const currentColor = editor?.getAttributes('textStyle').color || null;\n const label = labels.colorControlLabel(color);\n\n return (\n <RichTextEditorControl\n {...others}\n variant={variant}\n active={currentColor === color}\n aria-label={label}\n title={label}\n onClick={() => (editor?.chain() as any).focus().setColor(color).run()}\n >\n <ColorSwatch color={color} size={14} />\n </RichTextEditorControl>\n );\n}\n\nRichTextEditorColorControl.displayName = '@mantine/tiptap/RichTextEditorColorControl';\n"],"mappings":";;;;;;AASA,SAAgB,2BAA2B,OAAwC;CACjF,MAAM,EAAE,OAAO,GAAG,WAAW,SAAS,8BAA8B,MAAM,MAAM;CAChF,MAAM,EAAE,QAAQ,QAAQ,YAAY,0BAA0B;CAC9D,MAAM,eAAe,QAAQ,cAAc,YAAY,CAAC,SAAS;CACjE,MAAM,QAAQ,OAAO,kBAAkB,MAAM;AAE7C,QACE,oBAAC,uBAAD;EACE,GAAI;EACK;EACT,QAAQ,iBAAiB;EACzB,cAAY;EACZ,OAAO;EACP,gBAAgB,QAAQ,OAAO,EAAS,OAAO,CAAC,SAAS,MAAM,CAAC,KAAK;YAErE,oBAAC,aAAD;GAAoB;GAAO,MAAM;GAAM,CAAA;EACjB,CAAA;;AAI5B,2BAA2B,cAAc"}
|