@mantine/tiptap 7.2.2 → 7.3.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/{RichTextEditor.js → RichTextEditor.cjs} +21 -69
- package/cjs/RichTextEditor.cjs.map +1 -0
- package/cjs/{RichTextEditor.context.js → RichTextEditor.context.cjs} +1 -3
- package/cjs/RichTextEditor.context.cjs.map +1 -0
- package/cjs/{RichTextEditor.module.css.js → RichTextEditor.module.css.cjs} +2 -4
- package/cjs/RichTextEditor.module.css.cjs.map +1 -0
- package/cjs/RichTextEditorContent/RichTextEditorContent.cjs +48 -0
- package/cjs/RichTextEditorContent/RichTextEditorContent.cjs.map +1 -0
- package/cjs/RichTextEditorControl/RichTextEditorColorControl.cjs +30 -0
- package/cjs/RichTextEditorControl/RichTextEditorColorControl.cjs.map +1 -0
- package/cjs/RichTextEditorControl/RichTextEditorColorPickerControl.cjs +111 -0
- package/cjs/RichTextEditorControl/RichTextEditorColorPickerControl.cjs.map +1 -0
- package/cjs/RichTextEditorControl/RichTextEditorControl.cjs +72 -0
- package/cjs/RichTextEditorControl/RichTextEditorControl.cjs.map +1 -0
- package/cjs/RichTextEditorControl/RichTextEditorLinkControl.cjs +132 -0
- package/cjs/RichTextEditorControl/RichTextEditorLinkControl.cjs.map +1 -0
- package/cjs/RichTextEditorControl/{controls.js → controls.cjs} +28 -53
- package/cjs/RichTextEditorControl/controls.cjs.map +1 -0
- package/cjs/RichTextEditorControlsGroup/RichTextEditorControlsGroup.cjs +29 -0
- package/cjs/RichTextEditorControlsGroup/RichTextEditorControlsGroup.cjs.map +1 -0
- package/cjs/RichTextEditorToolbar/RichTextEditorToolbar.cjs +29 -0
- package/cjs/RichTextEditorToolbar/RichTextEditorToolbar.cjs.map +1 -0
- package/cjs/extensions/Link.cjs +16 -0
- package/cjs/extensions/Link.cjs.map +1 -0
- package/cjs/{index.js → index.cjs} +19 -21
- package/cjs/index.cjs.map +1 -0
- package/cjs/{labels.js → labels.cjs} +1 -3
- package/cjs/labels.cjs.map +1 -0
- package/esm/RichTextEditor.context.mjs.map +1 -1
- package/esm/RichTextEditor.mjs +7 -49
- package/esm/RichTextEditor.mjs.map +1 -1
- package/esm/{RichTextEditor.module.mjs → RichTextEditor.module.css.mjs} +2 -2
- package/esm/RichTextEditor.module.css.mjs.map +1 -0
- package/esm/RichTextEditorContent/RichTextEditorContent.mjs +15 -41
- package/esm/RichTextEditorContent/RichTextEditorContent.mjs.map +1 -1
- package/esm/RichTextEditorControl/RichTextEditorColorControl.mjs +6 -36
- package/esm/RichTextEditorControl/RichTextEditorColorControl.mjs.map +1 -1
- package/esm/RichTextEditorControl/RichTextEditorColorPickerControl.mjs +14 -43
- package/esm/RichTextEditorControl/RichTextEditorColorPickerControl.mjs.map +1 -1
- package/esm/RichTextEditorControl/RichTextEditorControl.mjs +16 -55
- package/esm/RichTextEditorControl/RichTextEditorControl.mjs.map +1 -1
- package/esm/RichTextEditorControl/RichTextEditorLinkControl.mjs +28 -68
- package/esm/RichTextEditorControl/RichTextEditorLinkControl.mjs.map +1 -1
- package/esm/RichTextEditorControl/controls.mjs +27 -46
- package/esm/RichTextEditorControl/controls.mjs.map +1 -1
- package/esm/RichTextEditorControlsGroup/RichTextEditorControlsGroup.mjs +7 -33
- package/esm/RichTextEditorControlsGroup/RichTextEditorControlsGroup.mjs.map +1 -1
- package/esm/RichTextEditorToolbar/RichTextEditorToolbar.mjs +7 -37
- package/esm/RichTextEditorToolbar/RichTextEditorToolbar.mjs.map +1 -1
- package/esm/extensions/Link.mjs.map +1 -1
- package/esm/index.mjs +5 -5
- package/esm/labels.mjs.map +1 -1
- package/package.json +30 -32
- package/cjs/RichTextEditor.context.js.map +0 -1
- package/cjs/RichTextEditor.js.map +0 -1
- package/cjs/RichTextEditor.module.css.js.map +0 -1
- package/cjs/RichTextEditorContent/RichTextEditorContent.js +0 -80
- package/cjs/RichTextEditorContent/RichTextEditorContent.js.map +0 -1
- package/cjs/RichTextEditorControl/RichTextEditorColorControl.js +0 -66
- package/cjs/RichTextEditorControl/RichTextEditorColorControl.js.map +0 -1
- package/cjs/RichTextEditorControl/RichTextEditorColorPickerControl.js +0 -146
- package/cjs/RichTextEditorControl/RichTextEditorColorPickerControl.js.map +0 -1
- package/cjs/RichTextEditorControl/RichTextEditorControl.js +0 -117
- package/cjs/RichTextEditorControl/RichTextEditorControl.js.map +0 -1
- package/cjs/RichTextEditorControl/RichTextEditorLinkControl.js +0 -178
- package/cjs/RichTextEditorControl/RichTextEditorLinkControl.js.map +0 -1
- package/cjs/RichTextEditorControl/controls.js.map +0 -1
- package/cjs/RichTextEditorControlsGroup/RichTextEditorControlsGroup.js +0 -61
- package/cjs/RichTextEditorControlsGroup/RichTextEditorControlsGroup.js.map +0 -1
- package/cjs/RichTextEditorToolbar/RichTextEditorToolbar.js +0 -65
- package/cjs/RichTextEditorToolbar/RichTextEditorToolbar.js.map +0 -1
- package/cjs/extensions/Link.js +0 -22
- package/cjs/extensions/Link.js.map +0 -1
- package/cjs/index.js.map +0 -1
- package/cjs/labels.js.map +0 -1
- package/esm/RichTextEditor.module.mjs.map +0 -1
package/esm/labels.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"labels.mjs","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,GA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B,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;;"}
|
|
1
|
+
{"version":3,"file":"labels.mjs","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":";AACY,CAAA,CAAA,CAAA,CAAA,CAAA,CAAC,cAAc,CAAG,CAAA,CAAA,CAAA;AAC9B,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AACA,CAAE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAgB,EAAE,CAAM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAC1B,CAAE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAuB,EAAE,CAAY,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA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AAe,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AACrC,CAAE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAe,EAAE,CAAM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AACzB,CAAE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAqB,CAAE,CAAA,CAAC,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,CAAC,CAAe,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAE,CAAK,CAAA,CAAA,CAAA,CAAA,CAAC,CAAC;AAC7D,CAAA,CAAA;;"}
|
package/package.json
CHANGED
|
@@ -1,10 +1,29 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mantine/tiptap",
|
|
3
|
+
"version": "7.3.0-alpha.0",
|
|
3
4
|
"description": "Rich text editor based on tiptap",
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
"
|
|
5
|
+
"homepage": "https://mantine.dev/others/tiptap",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"author": "Vitaly Rtishchev <rtivital@gmail.com>",
|
|
8
|
+
"keywords": [
|
|
9
|
+
"components",
|
|
10
|
+
"frontend",
|
|
11
|
+
"library",
|
|
12
|
+
"next",
|
|
13
|
+
"nextjs",
|
|
14
|
+
"react",
|
|
15
|
+
"rich-text-editor",
|
|
16
|
+
"rte",
|
|
17
|
+
"tiptap",
|
|
18
|
+
"ui",
|
|
19
|
+
"ui-kit"
|
|
20
|
+
],
|
|
21
|
+
"sideEffects": [
|
|
22
|
+
"*.css"
|
|
23
|
+
],
|
|
24
|
+
"main": "./cjs/index.cjs",
|
|
7
25
|
"module": "./esm/index.mjs",
|
|
26
|
+
"types": "./lib/index.d.ts",
|
|
8
27
|
"exports": {
|
|
9
28
|
".": {
|
|
10
29
|
"import": {
|
|
@@ -13,45 +32,24 @@
|
|
|
13
32
|
},
|
|
14
33
|
"require": {
|
|
15
34
|
"types": "./lib/index.d.ts",
|
|
16
|
-
"default": "./cjs/index.
|
|
35
|
+
"default": "./cjs/index.cjs"
|
|
17
36
|
}
|
|
18
37
|
},
|
|
19
38
|
"./styles.css": "./esm/index.css",
|
|
20
39
|
"./styles.layer.css": "./esm/index.layer.css"
|
|
21
40
|
},
|
|
22
|
-
"sideEffects": [
|
|
23
|
-
"*.css"
|
|
24
|
-
],
|
|
25
|
-
"license": "MIT",
|
|
26
|
-
"author": "Vitaly Rtishchev <rtivital@gmail.com>",
|
|
27
|
-
"homepage": "https://mantine.dev/others/tiptap",
|
|
28
41
|
"repository": {
|
|
29
42
|
"url": "https://github.com/mantinedev/mantine.git",
|
|
30
43
|
"type": "git",
|
|
31
44
|
"directory": "src/mantine-tiptap"
|
|
32
45
|
},
|
|
33
|
-
"keywords": [
|
|
34
|
-
"react",
|
|
35
|
-
"next",
|
|
36
|
-
"nextjs",
|
|
37
|
-
"ui",
|
|
38
|
-
"components",
|
|
39
|
-
"ui-kit",
|
|
40
|
-
"library",
|
|
41
|
-
"frontend",
|
|
42
|
-
"tiptap",
|
|
43
|
-
"rte",
|
|
44
|
-
"rich-text-editor"
|
|
45
|
-
],
|
|
46
46
|
"peerDependencies": {
|
|
47
|
-
"@mantine/core": "7.
|
|
48
|
-
"@mantine/hooks": "7.
|
|
49
|
-
"@tabler/icons-react": "
|
|
50
|
-
"@tiptap/extension-link": "^2.
|
|
51
|
-
"@tiptap/react": "^2.
|
|
47
|
+
"@mantine/core": "7.3.0-alpha.0",
|
|
48
|
+
"@mantine/hooks": "7.3.0-alpha.0",
|
|
49
|
+
"@tabler/icons-react": ">=2.0.0",
|
|
50
|
+
"@tiptap/extension-link": "^2.1.12",
|
|
51
|
+
"@tiptap/react": "^2.1.12",
|
|
52
52
|
"react": "^18.2.0",
|
|
53
53
|
"react-dom": "^18.2.0"
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
"devDependencies": {}
|
|
57
|
-
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"RichTextEditor.context.js","sources":["../src/RichTextEditor.context.ts"],"sourcesContent":["import { createSafeContext, GetStylesApi } from '@mantine/core';\nimport { Editor } from '@tiptap/react';\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}\n\nexport const [RichTextEditorProvider, useRichTextEditorContext] =\n createSafeContext<RichTextEditorContext>('RichTextEditor component was not found in tree');\n"],"names":["createSafeContext"],"mappings":";;;;;;;AACY,MAAC,CAAC,sBAAsB,EAAE,wBAAwB,CAAC,GAAGA,sBAAiB,CAAC,gDAAgD;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"RichTextEditor.js","sources":["../src/RichTextEditor.tsx"],"sourcesContent":["import React, { useMemo } from 'react';\nimport {\n Box,\n BoxProps,\n StylesApiProps,\n factory,\n ElementProps,\n useProps,\n useStyles,\n Factory,\n} from '@mantine/core';\nimport { Editor } from '@tiptap/react';\nimport { DEFAULT_LABELS, RichTextEditorLabels } from './labels';\nimport { RichTextEditorProvider } from './RichTextEditor.context';\nimport { RichTextEditorToolbar } from './RichTextEditorToolbar/RichTextEditorToolbar';\nimport { RichTextEditorControlsGroup } from './RichTextEditorControlsGroup/RichTextEditorControlsGroup';\nimport { RichTextEditorContent } from './RichTextEditorContent/RichTextEditorContent';\nimport { RichTextEditorControl } from './RichTextEditorControl/RichTextEditorControl';\nimport * as controls from './RichTextEditorControl';\nimport classes from './RichTextEditor.module.css';\n\nexport type RichTextEditorStylesNames =\n | 'linkEditorSave'\n | 'linkEditorDropdown'\n | 'root'\n | 'content'\n | 'typographyStylesProvider'\n | 'control'\n | 'controlsGroup'\n | 'toolbar'\n | 'linkEditor'\n | 'linkEditorInput'\n | 'linkEditorExternalControl';\n\nexport interface RichTextEditorProps\n extends BoxProps,\n StylesApiProps<RichTextEditorFactory>,\n ElementProps<'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\nexport type RichTextEditorFactory = Factory<{\n props: RichTextEditorProps;\n ref: HTMLDivElement;\n stylesNames: RichTextEditorStylesNames;\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 };\n}>;\n\nconst defaultProps: Partial<RichTextEditorProps> = {\n withCodeHighlightStyles: true,\n withTypographyStyles: true,\n};\n\nexport const RichTextEditor = factory<RichTextEditorFactory>((_props, ref) => {\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 labels,\n children,\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 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 unstyled,\n }}\n >\n <Box {...getStyles('root')} {...others} ref={ref}>\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;\n"],"names":["factory","useProps","labels","useStyles","classes","useMemo","DEFAULT_LABELS","React","RichTextEditorProvider","Box","RichTextEditorContent","RichTextEditorControl","RichTextEditorToolbar","RichTextEditorControlsGroup","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.RichTextEditorColor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,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,iEAAyC,CAAC;AACvE,cAAc,CAAC,KAAK,GAAGC,qDAAmC,CAAC;AAC3D,cAAc,CAAC,SAAS,GAAGC,yBAAyB,CAAC;AACrD,cAAc,CAAC,EAAE,GAAGC,kBAAkB,CAAC;AACvC,cAAc,CAAC,UAAU,GAAGC,0BAA0B;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"RichTextEditor.module.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
'use strict';
|
|
3
|
-
|
|
4
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
|
-
|
|
6
|
-
var React = require('react');
|
|
7
|
-
var core = require('@mantine/core');
|
|
8
|
-
var react = require('@tiptap/react');
|
|
9
|
-
var RichTextEditor_context = require('../RichTextEditor.context.js');
|
|
10
|
-
var RichTextEditor_module = require('../RichTextEditor.module.css.js');
|
|
11
|
-
|
|
12
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e['default'] : e; }
|
|
13
|
-
|
|
14
|
-
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
15
|
-
|
|
16
|
-
var __defProp = Object.defineProperty;
|
|
17
|
-
var __defProps = Object.defineProperties;
|
|
18
|
-
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
19
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
20
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
21
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
22
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
23
|
-
var __spreadValues = (a, b) => {
|
|
24
|
-
for (var prop in b || (b = {}))
|
|
25
|
-
if (__hasOwnProp.call(b, prop))
|
|
26
|
-
__defNormalProp(a, prop, b[prop]);
|
|
27
|
-
if (__getOwnPropSymbols)
|
|
28
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
29
|
-
if (__propIsEnum.call(b, prop))
|
|
30
|
-
__defNormalProp(a, prop, b[prop]);
|
|
31
|
-
}
|
|
32
|
-
return a;
|
|
33
|
-
};
|
|
34
|
-
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
35
|
-
var __objRest = (source, exclude) => {
|
|
36
|
-
var target = {};
|
|
37
|
-
for (var prop in source)
|
|
38
|
-
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
39
|
-
target[prop] = source[prop];
|
|
40
|
-
if (source != null && __getOwnPropSymbols)
|
|
41
|
-
for (var prop of __getOwnPropSymbols(source)) {
|
|
42
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
43
|
-
target[prop] = source[prop];
|
|
44
|
-
}
|
|
45
|
-
return target;
|
|
46
|
-
};
|
|
47
|
-
const defaultProps = {};
|
|
48
|
-
const RichTextEditorContent = core.factory((_props, ref) => {
|
|
49
|
-
const props = core.useProps("RichTextEditorContent", defaultProps, _props);
|
|
50
|
-
const _a = props, { classNames, className, style, styles, vars } = _a, others = __objRest(_a, ["classNames", "className", "style", "styles", "vars"]);
|
|
51
|
-
const ctx = RichTextEditor_context.useRichTextEditorContext();
|
|
52
|
-
if (ctx.withTypographyStyles) {
|
|
53
|
-
return /* @__PURE__ */ React__default.createElement(
|
|
54
|
-
core.TypographyStylesProvider,
|
|
55
|
-
__spreadProps(__spreadValues({}, ctx.getStyles("typographyStylesProvider", { className, style, styles, classNames })), {
|
|
56
|
-
unstyled: ctx.unstyled,
|
|
57
|
-
ref
|
|
58
|
-
}),
|
|
59
|
-
/* @__PURE__ */ React__default.createElement(
|
|
60
|
-
core.Box,
|
|
61
|
-
__spreadValues(__spreadValues({
|
|
62
|
-
component: react.EditorContent,
|
|
63
|
-
editor: ctx.editor
|
|
64
|
-
}, ctx.getStyles("content", { classNames, styles })), others)
|
|
65
|
-
)
|
|
66
|
-
);
|
|
67
|
-
}
|
|
68
|
-
return /* @__PURE__ */ React__default.createElement(
|
|
69
|
-
core.Box,
|
|
70
|
-
__spreadValues(__spreadValues({
|
|
71
|
-
component: react.EditorContent,
|
|
72
|
-
editor: ctx.editor
|
|
73
|
-
}, ctx.getStyles("content", { classNames, styles, className, style })), others)
|
|
74
|
-
);
|
|
75
|
-
});
|
|
76
|
-
RichTextEditorContent.classes = RichTextEditor_module['default'];
|
|
77
|
-
RichTextEditorContent.displayName = "@mantine/tiptap/RichTextEditorContent";
|
|
78
|
-
|
|
79
|
-
exports.RichTextEditorContent = RichTextEditorContent;
|
|
80
|
-
//# sourceMappingURL=RichTextEditorContent.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"RichTextEditorContent.js","sources":["../../src/RichTextEditorContent/RichTextEditorContent.tsx"],"sourcesContent":["import React from 'react';\nimport {\n Box,\n BoxProps,\n CompoundStylesApiProps,\n factory,\n ElementProps,\n useProps,\n Factory,\n TypographyStylesProvider,\n} from '@mantine/core';\nimport { EditorContent } from '@tiptap/react';\nimport { useRichTextEditorContext } from '../RichTextEditor.context';\nimport classes from '../RichTextEditor.module.css';\n\nexport type RichTextEditorContentStylesNames = 'root';\nexport interface RichTextEditorContentProps\n extends BoxProps,\n CompoundStylesApiProps<RichTextEditorContentFactory>,\n ElementProps<'div'> {}\n\nexport type RichTextEditorContentFactory = Factory<{\n props: RichTextEditorContentProps;\n ref: HTMLDivElement;\n stylesNames: RichTextEditorContentStylesNames;\n compound: true;\n}>;\n\nconst defaultProps: Partial<RichTextEditorContentProps> = {};\n\nexport const RichTextEditorContent = factory<RichTextEditorContentFactory>((_props, ref) => {\n const props = useProps('RichTextEditorContent', defaultProps, _props);\n const { classNames, className, style, styles, vars, ...others } = props;\n const ctx = useRichTextEditorContext();\n\n if (ctx.withTypographyStyles) {\n return (\n <TypographyStylesProvider\n {...ctx.getStyles('typographyStylesProvider', { className, style, styles, classNames })}\n unstyled={ctx.unstyled}\n ref={ref}\n >\n <Box\n component={EditorContent}\n editor={ctx.editor}\n {...ctx.getStyles('content', { classNames, styles })}\n {...others}\n />\n </TypographyStylesProvider>\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"],"names":["factory","useProps","useRichTextEditorContext","React","TypographyStylesProvider","Box","EditorContent","classes"],"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,KAA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S,EAAE,EAAE,UAAU,EAAE,MAAM,EAAE,CAAC,CAAC,EAAE,MAAM,CAAC;AACrE,OAAO;AACP,KAAK,CAAC;AACN,GAAG;AACH,EAAE,uBAAuBH,cAAK,CAAC,aAAa;AAC5C,IAAIE,QAAG;AACP,IAAI,cAAc,CAAC,cAAc,CAAC;AAClC,MAAM,SAAS,EAAEC,mBAAa;AAC9B,MAAM,MAAM,EAAE,GAAG,CAAC,MAAM;AACxB,KAAK,EAAE,GAAG,CAAC,SAAS,CAAC,SAAS,EAAE,EAAE,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC,CAAC,EAAE,MAAM,CAAC;AACnF,GAAG,CAAC;AACJ,CAAC,EAAE;AACH,qBAAqB,CAAC,OAAO,GAAGC,gCAAO,CAAC;AACxC,qBAAqB,CAAC,WAAW,GAAG,uCAAuC;;"}
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
'use strict';
|
|
3
|
-
|
|
4
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
|
-
|
|
6
|
-
var React = require('react');
|
|
7
|
-
var core = require('@mantine/core');
|
|
8
|
-
var RichTextEditorControl = require('./RichTextEditorControl.js');
|
|
9
|
-
var RichTextEditor_context = require('../RichTextEditor.context.js');
|
|
10
|
-
|
|
11
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e['default'] : e; }
|
|
12
|
-
|
|
13
|
-
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
14
|
-
|
|
15
|
-
var __defProp = Object.defineProperty;
|
|
16
|
-
var __defProps = Object.defineProperties;
|
|
17
|
-
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
18
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
19
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
20
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
21
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
22
|
-
var __spreadValues = (a, b) => {
|
|
23
|
-
for (var prop in b || (b = {}))
|
|
24
|
-
if (__hasOwnProp.call(b, prop))
|
|
25
|
-
__defNormalProp(a, prop, b[prop]);
|
|
26
|
-
if (__getOwnPropSymbols)
|
|
27
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
28
|
-
if (__propIsEnum.call(b, prop))
|
|
29
|
-
__defNormalProp(a, prop, b[prop]);
|
|
30
|
-
}
|
|
31
|
-
return a;
|
|
32
|
-
};
|
|
33
|
-
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
34
|
-
var __objRest = (source, exclude) => {
|
|
35
|
-
var target = {};
|
|
36
|
-
for (var prop in source)
|
|
37
|
-
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
38
|
-
target[prop] = source[prop];
|
|
39
|
-
if (source != null && __getOwnPropSymbols)
|
|
40
|
-
for (var prop of __getOwnPropSymbols(source)) {
|
|
41
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
42
|
-
target[prop] = source[prop];
|
|
43
|
-
}
|
|
44
|
-
return target;
|
|
45
|
-
};
|
|
46
|
-
const defaultProps = {};
|
|
47
|
-
const RichTextEditorColorControl = React.forwardRef((props, ref) => {
|
|
48
|
-
const _a = core.useProps("RichTextEditorColorControl", defaultProps, props), { color } = _a, others = __objRest(_a, ["color"]);
|
|
49
|
-
const { editor, labels } = RichTextEditor_context.useRichTextEditorContext();
|
|
50
|
-
const currentColor = (editor == null ? void 0 : editor.getAttributes("textStyle").color) || null;
|
|
51
|
-
const label = labels.colorControlLabel(color);
|
|
52
|
-
return /* @__PURE__ */ React__default.createElement(
|
|
53
|
-
RichTextEditorControl.RichTextEditorControl,
|
|
54
|
-
__spreadProps(__spreadValues({}, others), {
|
|
55
|
-
active: currentColor === color,
|
|
56
|
-
"aria-label": label,
|
|
57
|
-
title: label,
|
|
58
|
-
onClick: () => (editor == null ? void 0 : editor.chain()).focus().setColor(color).run(),
|
|
59
|
-
ref
|
|
60
|
-
}),
|
|
61
|
-
/* @__PURE__ */ React__default.createElement(core.ColorSwatch, { color, size: 14 })
|
|
62
|
-
);
|
|
63
|
-
});
|
|
64
|
-
|
|
65
|
-
exports.RichTextEditorColorControl = RichTextEditorColorControl;
|
|
66
|
-
//# sourceMappingURL=RichTextEditorColorControl.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"RichTextEditorColorControl.js","sources":["../../src/RichTextEditorControl/RichTextEditorColorControl.tsx"],"sourcesContent":["import React, { forwardRef } from 'react';\nimport { ColorSwatch, BoxProps, useProps, ElementProps } from '@mantine/core';\nimport { RichTextEditorControl } from './RichTextEditorControl';\nimport { useRichTextEditorContext } from '../RichTextEditor.context';\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\nconst defaultProps: Partial<RichTextEditorColorControlProps> = {};\n\nexport const RichTextEditorColorControl = forwardRef<\n HTMLButtonElement,\n RichTextEditorColorControlProps\n>((props, ref) => {\n const { color, ...others } = useProps('RichTextEditorColorControl', defaultProps, props);\n const { editor, labels } = useRichTextEditorContext();\n const currentColor = editor?.getAttributes('textStyle').color || null;\n const label = labels.colorControlLabel(color);\n\n return (\n <RichTextEditorControl\n {...others}\n active={currentColor === color}\n aria-label={label}\n title={label}\n onClick={() => (editor?.chain() as any).focus().setColor(color).run()}\n ref={ref}\n >\n <ColorSwatch color={color} size={14} />\n </RichTextEditorControl>\n );\n});\n"],"names":["forwardRef","useProps","useRichTextEditorContext","React","RichTextEditorControl","ColorSwatch"],"mappings":";;;;;;;;;;;;;;AAAA,IAAI,SAAS,GAAG,MAAM,CAAC,cAAc,CAAC;AACtC,IAAI,UAAU,GAAG,MAAM,CAAC,gBAAgB,CAAC;AACzC,IAAI,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AAC,KAAK,CAAC,CAAC;AAChD,EAAE,uBAAuBC,cAAK,CAAC,aAAa;AAC5C,IAAIC,2CAAqB;AACzB,IAAI,aAAa,CAAC,cAAc,CAAC,EAAE,EAAE,MAAM,CAAC,EAAE;AAC9C,MAAM,MAAM,EAAE,YAAY,KAAK,KAAK;AACpC,MAAM,YAAY,EAAE,KAAK;AACzB,MAAM,KAAK,EAAE,KAAK;AAClB,MAAM,OAAO,EAAE,MAAM,CAAC,MAAM,IAAI,IAAI,GAAG,KAAK,CAAC,GAAG,MAAM,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE;AAC7F,MAAM,GAAG;AACT,KAAK,CAAC;AACN,oBAAoBD,cAAK,CAAC,aAAa,CAACE,gBAAW,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC;AACzE,GAAG,CAAC;AACJ,CAAC;;"}
|
|
@@ -1,146 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
'use strict';
|
|
3
|
-
|
|
4
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
|
-
|
|
6
|
-
var React = require('react');
|
|
7
|
-
var core = require('@mantine/core');
|
|
8
|
-
var hooks = require('@mantine/hooks');
|
|
9
|
-
var iconsReact = require('@tabler/icons-react');
|
|
10
|
-
var RichTextEditorControl = require('./RichTextEditorControl.js');
|
|
11
|
-
var RichTextEditor_context = require('../RichTextEditor.context.js');
|
|
12
|
-
|
|
13
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e['default'] : e; }
|
|
14
|
-
|
|
15
|
-
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
16
|
-
|
|
17
|
-
var __defProp = Object.defineProperty;
|
|
18
|
-
var __defProps = Object.defineProperties;
|
|
19
|
-
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
20
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
21
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
22
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
23
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
24
|
-
var __spreadValues = (a, b) => {
|
|
25
|
-
for (var prop in b || (b = {}))
|
|
26
|
-
if (__hasOwnProp.call(b, prop))
|
|
27
|
-
__defNormalProp(a, prop, b[prop]);
|
|
28
|
-
if (__getOwnPropSymbols)
|
|
29
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
30
|
-
if (__propIsEnum.call(b, prop))
|
|
31
|
-
__defNormalProp(a, prop, b[prop]);
|
|
32
|
-
}
|
|
33
|
-
return a;
|
|
34
|
-
};
|
|
35
|
-
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
36
|
-
var __objRest = (source, exclude) => {
|
|
37
|
-
var target = {};
|
|
38
|
-
for (var prop in source)
|
|
39
|
-
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
40
|
-
target[prop] = source[prop];
|
|
41
|
-
if (source != null && __getOwnPropSymbols)
|
|
42
|
-
for (var prop of __getOwnPropSymbols(source)) {
|
|
43
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
44
|
-
target[prop] = source[prop];
|
|
45
|
-
}
|
|
46
|
-
return target;
|
|
47
|
-
};
|
|
48
|
-
const defaultProps = {};
|
|
49
|
-
const RichTextEditorColorPickerControl = React.forwardRef((props, ref) => {
|
|
50
|
-
const _a = core.useProps(
|
|
51
|
-
"RichTextEditorColorPickerControl",
|
|
52
|
-
defaultProps,
|
|
53
|
-
props
|
|
54
|
-
), { popoverProps, colors, colorPickerProps } = _a, others = __objRest(_a, ["popoverProps", "colors", "colorPickerProps"]);
|
|
55
|
-
const { editor, labels, getStyles } = RichTextEditor_context.useRichTextEditorContext();
|
|
56
|
-
const [opened, { toggle, close }] = hooks.useDisclosure(false);
|
|
57
|
-
const [state, setState] = React.useState("palette");
|
|
58
|
-
const currentColor = (editor == null ? void 0 : editor.getAttributes("textStyle").color) || "var(--mantine-color-text)";
|
|
59
|
-
const handleChange = (value, shouldClose = true) => {
|
|
60
|
-
(editor == null ? void 0 : editor.chain()).focus().setColor(value).run();
|
|
61
|
-
shouldClose && close();
|
|
62
|
-
};
|
|
63
|
-
const handleClear = () => {
|
|
64
|
-
(editor == null ? void 0 : editor.chain()).focus().unsetColor().run();
|
|
65
|
-
close();
|
|
66
|
-
};
|
|
67
|
-
const controls = colors.map((color, index) => /* @__PURE__ */ React__default.createElement(
|
|
68
|
-
core.ColorSwatch,
|
|
69
|
-
{
|
|
70
|
-
key: index,
|
|
71
|
-
component: "button",
|
|
72
|
-
color,
|
|
73
|
-
onClick: () => handleChange(color),
|
|
74
|
-
size: 26,
|
|
75
|
-
radius: "xs",
|
|
76
|
-
style: { cursor: "pointer" },
|
|
77
|
-
title: labels.colorPickerColorLabel(color),
|
|
78
|
-
"aria-label": labels.colorPickerColorLabel(color)
|
|
79
|
-
}
|
|
80
|
-
));
|
|
81
|
-
return /* @__PURE__ */ React__default.createElement(core.Popover, __spreadValues({ opened, withinPortal: true, trapFocus: true, onClose: close }, popoverProps), /* @__PURE__ */ React__default.createElement(core.Popover.Target, null, /* @__PURE__ */ React__default.createElement(
|
|
82
|
-
RichTextEditorControl.RichTextEditorControl,
|
|
83
|
-
__spreadProps(__spreadValues({}, others), {
|
|
84
|
-
"aria-label": labels.colorPickerControlLabel,
|
|
85
|
-
title: labels.colorPickerControlLabel,
|
|
86
|
-
ref,
|
|
87
|
-
onClick: toggle
|
|
88
|
-
}),
|
|
89
|
-
/* @__PURE__ */ React__default.createElement(core.ColorSwatch, { color: currentColor, size: 14 })
|
|
90
|
-
)), /* @__PURE__ */ React__default.createElement(core.Popover.Dropdown, __spreadValues({}, getStyles("linkEditorDropdown")), state === "palette" && /* @__PURE__ */ React__default.createElement(core.SimpleGrid, { cols: 7, spacing: 2 }, controls), state === "colorPicker" && /* @__PURE__ */ React__default.createElement(
|
|
91
|
-
core.ColorPicker,
|
|
92
|
-
__spreadValues({
|
|
93
|
-
defaultValue: currentColor,
|
|
94
|
-
onChange: (value) => handleChange(value, false)
|
|
95
|
-
}, colorPickerProps)
|
|
96
|
-
), /* @__PURE__ */ React__default.createElement(core.Tooltip.Group, { closeDelay: 200 }, /* @__PURE__ */ React__default.createElement(core.Group, { justify: "flex-end", gap: "xs", mt: "sm" }, state === "palette" && /* @__PURE__ */ React__default.createElement(
|
|
97
|
-
core.ActionIcon,
|
|
98
|
-
{
|
|
99
|
-
variant: "default",
|
|
100
|
-
onClick: close,
|
|
101
|
-
title: labels.colorPickerCancel,
|
|
102
|
-
"aria-label": labels.colorPickerCancel
|
|
103
|
-
},
|
|
104
|
-
/* @__PURE__ */ React__default.createElement(iconsReact.IconX, { stroke: 1.5, size: "1rem" })
|
|
105
|
-
), /* @__PURE__ */ React__default.createElement(
|
|
106
|
-
core.ActionIcon,
|
|
107
|
-
{
|
|
108
|
-
variant: "default",
|
|
109
|
-
onClick: handleClear,
|
|
110
|
-
title: labels.colorPickerClear,
|
|
111
|
-
"aria-label": labels.colorPickerClear
|
|
112
|
-
},
|
|
113
|
-
/* @__PURE__ */ React__default.createElement(iconsReact.IconCircleOff, { stroke: 1.5, size: "1rem" })
|
|
114
|
-
), state === "palette" ? /* @__PURE__ */ React__default.createElement(
|
|
115
|
-
core.ActionIcon,
|
|
116
|
-
{
|
|
117
|
-
variant: "default",
|
|
118
|
-
onClick: () => setState("colorPicker"),
|
|
119
|
-
title: labels.colorPickerColorPicker,
|
|
120
|
-
"aria-label": labels.colorPickerColorPicker
|
|
121
|
-
},
|
|
122
|
-
/* @__PURE__ */ React__default.createElement(iconsReact.IconColorPicker, { stroke: 1.5, size: "1rem" })
|
|
123
|
-
) : /* @__PURE__ */ React__default.createElement(
|
|
124
|
-
core.ActionIcon,
|
|
125
|
-
{
|
|
126
|
-
variant: "default",
|
|
127
|
-
onClick: () => setState("palette"),
|
|
128
|
-
"aria-label": labels.colorPickerPalette,
|
|
129
|
-
title: labels.colorPickerPalette
|
|
130
|
-
},
|
|
131
|
-
/* @__PURE__ */ React__default.createElement(iconsReact.IconPalette, { stroke: 1.5, size: "1rem" })
|
|
132
|
-
), state === "colorPicker" && /* @__PURE__ */ React__default.createElement(
|
|
133
|
-
core.ActionIcon,
|
|
134
|
-
{
|
|
135
|
-
variant: "default",
|
|
136
|
-
onClick: close,
|
|
137
|
-
title: labels.colorPickerSave,
|
|
138
|
-
"aria-label": labels.colorPickerSave
|
|
139
|
-
},
|
|
140
|
-
/* @__PURE__ */ React__default.createElement(iconsReact.IconCheck, { stroke: 1.5, size: "1rem" })
|
|
141
|
-
)))));
|
|
142
|
-
});
|
|
143
|
-
RichTextEditorColorPickerControl.displayName = "@mantine/tiptap/ColorPickerControl";
|
|
144
|
-
|
|
145
|
-
exports.RichTextEditorColorPickerControl = RichTextEditorColorPickerControl;
|
|
146
|
-
//# sourceMappingURL=RichTextEditorColorPickerControl.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"RichTextEditorColorPickerControl.js","sources":["../../src/RichTextEditorControl/RichTextEditorColorPickerControl.tsx"],"sourcesContent":["import React, { forwardRef, useState } from 'react';\nimport {\n BoxProps,\n Popover,\n PopoverProps,\n ColorSwatch,\n SimpleGrid,\n ColorPicker,\n Group,\n ActionIcon,\n Tooltip,\n ColorPickerProps,\n useProps,\n ElementProps,\n} from '@mantine/core';\nimport { useDisclosure } from '@mantine/hooks';\nimport { IconCircleOff, IconColorPicker, IconX, IconPalette, IconCheck } from '@tabler/icons-react';\nimport { RichTextEditorControl } from './RichTextEditorControl';\nimport { useRichTextEditorContext } from '../RichTextEditor.context';\n\nexport interface RichTextEditorColorPickerControlProps extends BoxProps, ElementProps<'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\nconst defaultProps: Partial<RichTextEditorColorPickerControlProps> = {};\n\nexport const RichTextEditorColorPickerControl = forwardRef<\n HTMLButtonElement,\n RichTextEditorColorPickerControlProps\n>((props, ref) => {\n const { popoverProps, colors, colorPickerProps, ...others } = useProps(\n 'RichTextEditorColorPickerControl',\n defaultProps,\n props\n );\n\n const { editor, labels, getStyles } = useRichTextEditorContext();\n const [opened, { toggle, close }] = useDisclosure(false);\n const [state, setState] = useState<'palette' | 'colorPicker'>('palette');\n const currentColor = editor?.getAttributes('textStyle').color || 'var(--mantine-color-text)';\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 style={{ cursor: 'pointer' }}\n title={labels.colorPickerColorLabel(color)}\n aria-label={labels.colorPickerColorLabel(color)}\n />\n ));\n\n return (\n <Popover opened={opened} withinPortal trapFocus onClose={close} {...popoverProps}>\n <Popover.Target>\n <RichTextEditorControl\n {...others}\n aria-label={labels.colorPickerControlLabel}\n title={labels.colorPickerControlLabel}\n ref={ref}\n onClick={toggle}\n >\n <ColorSwatch color={currentColor} size={14} />\n </RichTextEditorControl>\n </Popover.Target>\n\n <Popover.Dropdown {...getStyles('linkEditorDropdown')}>\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 {...colorPickerProps}\n />\n )}\n\n <Tooltip.Group closeDelay={200}>\n <Group justify=\"flex-end\" gap=\"xs\" mt=\"sm\">\n {state === 'palette' && (\n <ActionIcon\n variant=\"default\"\n onClick={close}\n title={labels.colorPickerCancel}\n aria-label={labels.colorPickerCancel}\n >\n <IconX stroke={1.5} size=\"1rem\" />\n </ActionIcon>\n )}\n\n <ActionIcon\n variant=\"default\"\n onClick={handleClear}\n title={labels.colorPickerClear}\n aria-label={labels.colorPickerClear}\n >\n <IconCircleOff stroke={1.5} size=\"1rem\" />\n </ActionIcon>\n\n {state === 'palette' ? (\n <ActionIcon\n variant=\"default\"\n onClick={() => setState('colorPicker')}\n title={labels.colorPickerColorPicker}\n aria-label={labels.colorPickerColorPicker}\n >\n <IconColorPicker stroke={1.5} size=\"1rem\" />\n </ActionIcon>\n ) : (\n <ActionIcon\n variant=\"default\"\n onClick={() => setState('palette')}\n aria-label={labels.colorPickerPalette}\n title={labels.colorPickerPalette}\n >\n <IconPalette stroke={1.5} size=\"1rem\" />\n </ActionIcon>\n )}\n\n {state === 'colorPicker' && (\n <ActionIcon\n variant=\"default\"\n onClick={close}\n title={labels.colorPickerSave}\n aria-label={labels.colorPickerSave}\n >\n <IconCheck stroke={1.5} size=\"1rem\" />\n </ActionIcon>\n )}\n </Group>\n </Tooltip.Group>\n </Popover.Dropdown>\n </Popover>\n );\n});\n\nRichTextEditorColorPickerControl.displayName = '@mantine/tiptap/ColorPickerControl';\n"],"names":["forwardRef","useProps","useRichTextEditorContext","useDisclosure","useState","React","ColorSwatch","Popover","RichTextEditorControl","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,c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d,IAAI;AACJ,MAAM,OAAO,EAAE,SAAS;AACxB,MAAM,OAAO,EAAE,MAAM,QAAQ,CAAC,SAAS,CAAC;AACxC,MAAM,YAAY,EAAE,MAAM,CAAC,kBAAkB;AAC7C,MAAM,KAAK,EAAE,MAAM,CAAC,kBAAkB;AACtC,KAAK;AACL,oBAAoBR,cAAK,CAAC,aAAa,CAACY,sBAAW,EAAE,EAAE,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;AACnF,GAAG,EAAE,KAAK,KAAK,aAAa,oBAAoBZ,cAAK,CAAC,aAAa;AACnE,IAAIQ,eAAU;AACd,IAAI;AACJ,MAAM,OAAO,EAAE,SAAS;AACxB,MAAM,OAAO,EAAE,KAAK;AACpB,MAAM,KAAK,EAAE,MAAM,CAAC,eAAe;AACnC,MAAM,YAAY,EAAE,MAAM,CAAC,eAAe;AAC1C,KAAK;AACL,oBAAoBR,cAAK,CAAC,aAAa,CAACa,oBAAS,EAAE,EAAE,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;AACjF,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;AACR,CAAC,EAAE;AACH,gCAAgC,CAAC,WAAW,GAAG,oCAAoC;;"}
|
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
'use strict';
|
|
3
|
-
|
|
4
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
|
-
|
|
6
|
-
var React = require('react');
|
|
7
|
-
var core = require('@mantine/core');
|
|
8
|
-
var RichTextEditor_context = require('../RichTextEditor.context.js');
|
|
9
|
-
var RichTextEditor_module = require('../RichTextEditor.module.css.js');
|
|
10
|
-
|
|
11
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e['default'] : e; }
|
|
12
|
-
|
|
13
|
-
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
14
|
-
|
|
15
|
-
var __defProp = Object.defineProperty;
|
|
16
|
-
var __defProps = Object.defineProperties;
|
|
17
|
-
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
18
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
19
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
20
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
21
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
22
|
-
var __spreadValues = (a, b) => {
|
|
23
|
-
for (var prop in b || (b = {}))
|
|
24
|
-
if (__hasOwnProp.call(b, prop))
|
|
25
|
-
__defNormalProp(a, prop, b[prop]);
|
|
26
|
-
if (__getOwnPropSymbols)
|
|
27
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
28
|
-
if (__propIsEnum.call(b, prop))
|
|
29
|
-
__defNormalProp(a, prop, b[prop]);
|
|
30
|
-
}
|
|
31
|
-
return a;
|
|
32
|
-
};
|
|
33
|
-
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
34
|
-
var __objRest = (source, exclude) => {
|
|
35
|
-
var target = {};
|
|
36
|
-
for (var prop in source)
|
|
37
|
-
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
38
|
-
target[prop] = source[prop];
|
|
39
|
-
if (source != null && __getOwnPropSymbols)
|
|
40
|
-
for (var prop of __getOwnPropSymbols(source)) {
|
|
41
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
42
|
-
target[prop] = source[prop];
|
|
43
|
-
}
|
|
44
|
-
return target;
|
|
45
|
-
};
|
|
46
|
-
const defaultProps = {
|
|
47
|
-
interactive: true
|
|
48
|
-
};
|
|
49
|
-
const RichTextEditorControl = core.factory((_props, ref) => {
|
|
50
|
-
const props = core.useProps("RichTextEditorControl", defaultProps, _props);
|
|
51
|
-
const _a = props, {
|
|
52
|
-
classNames,
|
|
53
|
-
className,
|
|
54
|
-
style,
|
|
55
|
-
styles,
|
|
56
|
-
vars,
|
|
57
|
-
interactive,
|
|
58
|
-
active,
|
|
59
|
-
onMouseDown
|
|
60
|
-
} = _a, others = __objRest(_a, [
|
|
61
|
-
"classNames",
|
|
62
|
-
"className",
|
|
63
|
-
"style",
|
|
64
|
-
"styles",
|
|
65
|
-
"vars",
|
|
66
|
-
"interactive",
|
|
67
|
-
"active",
|
|
68
|
-
"onMouseDown"
|
|
69
|
-
]);
|
|
70
|
-
const ctx = RichTextEditor_context.useRichTextEditorContext();
|
|
71
|
-
return /* @__PURE__ */ React__default.createElement(
|
|
72
|
-
core.UnstyledButton,
|
|
73
|
-
__spreadProps(__spreadValues(__spreadValues({}, others), ctx.getStyles("control", { className, style, classNames, styles })), {
|
|
74
|
-
"data-rich-text-editor-control": true,
|
|
75
|
-
tabIndex: interactive ? 0 : -1,
|
|
76
|
-
"data-interactive": interactive || void 0,
|
|
77
|
-
"data-active": active || void 0,
|
|
78
|
-
"aria-pressed": active && interactive || void 0,
|
|
79
|
-
"aria-hidden": !interactive || void 0,
|
|
80
|
-
ref,
|
|
81
|
-
unstyled: ctx.unstyled,
|
|
82
|
-
onMouseDown: (event) => {
|
|
83
|
-
event.preventDefault();
|
|
84
|
-
onMouseDown == null ? void 0 : onMouseDown(event);
|
|
85
|
-
}
|
|
86
|
-
})
|
|
87
|
-
);
|
|
88
|
-
});
|
|
89
|
-
RichTextEditorControl.classes = RichTextEditor_module['default'];
|
|
90
|
-
RichTextEditorControl.displayName = "@mantine/tiptap/RichTextEditorControl";
|
|
91
|
-
const RichTextEditorControlBase = React.forwardRef((_a, ref) => {
|
|
92
|
-
var _b = _a, { className, icon: Icon } = _b, others = __objRest(_b, ["className", "icon"]);
|
|
93
|
-
return /* @__PURE__ */ React__default.createElement(RichTextEditorControl, __spreadValues({ ref }, others), /* @__PURE__ */ React__default.createElement(Icon, { style: { width: core.rem(16), height: core.rem(16) } }));
|
|
94
|
-
});
|
|
95
|
-
RichTextEditorControlBase.displayName = "@mantine/tiptap/RichTextEditorControlBase";
|
|
96
|
-
function createControl({ label, isActive, operation, icon }) {
|
|
97
|
-
return React.forwardRef((props, ref) => {
|
|
98
|
-
const { editor, labels } = RichTextEditor_context.useRichTextEditorContext();
|
|
99
|
-
const _label = labels[label];
|
|
100
|
-
return /* @__PURE__ */ React__default.createElement(
|
|
101
|
-
RichTextEditorControlBase,
|
|
102
|
-
__spreadProps(__spreadValues({}, props), {
|
|
103
|
-
"aria-label": _label,
|
|
104
|
-
title: _label,
|
|
105
|
-
active: (isActive == null ? void 0 : isActive.name) ? editor == null ? void 0 : editor.isActive(isActive.name, isActive.attributes) : false,
|
|
106
|
-
ref,
|
|
107
|
-
onClick: () => editor == null ? void 0 : editor.chain().focus()[operation.name](operation.attributes).run(),
|
|
108
|
-
icon: props.icon || icon
|
|
109
|
-
})
|
|
110
|
-
);
|
|
111
|
-
});
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
exports.RichTextEditorControl = RichTextEditorControl;
|
|
115
|
-
exports.RichTextEditorControlBase = RichTextEditorControlBase;
|
|
116
|
-
exports.createControl = createControl;
|
|
117
|
-
//# sourceMappingURL=RichTextEditorControl.js.map
|