@mantine/tiptap 9.0.0-alpha.4 → 9.0.0-alpha.6
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 +7 -7
- 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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RichTextEditorToolbar.mjs","sources":["../../src/RichTextEditorToolbar/RichTextEditorToolbar.tsx"],"sourcesContent":["import {\n Box,\n BoxProps,\n CompoundStylesApiProps,\n ElementProps,\n factory,\n Factory,\n rem,\n useProps,\n} from '@mantine/core';\nimport { useRichTextEditorContext } from '../RichTextEditor.context';\nimport classes from '../RichTextEditor.module.css';\n\nexport type RichTextEditorToolbarStylesNames = 'toolbar';\n\nexport interface RichTextEditorToolbarProps\n extends BoxProps, CompoundStylesApiProps<RichTextEditorToolbarFactory>, ElementProps<'div'> {\n /** Determines whether `position: sticky` styles should be added to the toolbar @default false */\n sticky?: boolean;\n\n /** Sets top style to offset elements with fixed position @default 0 */\n stickyOffset?: React.CSSProperties['top'];\n}\n\nexport type RichTextEditorToolbarFactory = Factory<{\n props: RichTextEditorToolbarProps;\n ref: HTMLDivElement;\n stylesNames: RichTextEditorToolbarStylesNames;\n compound: true;\n}>;\n\nexport const RichTextEditorToolbar = factory<RichTextEditorToolbarFactory>((_props) => {\n const props = useProps('RichTextEditorToolbar', null, _props);\n const {\n classNames,\n className,\n style,\n styles,\n vars,\n sticky,\n stickyOffset,\n mod,\n variant,\n ...others\n } = props;\n const ctx = useRichTextEditorContext();\n\n return (\n <Box\n mod={[{ sticky }, mod]}\n variant={variant || ctx.variant}\n {...ctx.getStyles('toolbar', { className, style, styles, classNames })}\n {...others}\n __vars={{ '--rte-sticky-offset': rem(stickyOffset) }}\n />\n );\n});\n\nRichTextEditorToolbar.classes = classes;\nRichTextEditorToolbar.displayName = '@mantine/tiptap/RichTextEditorToolbar';\n"],"
|
|
1
|
+
{"version":3,"file":"RichTextEditorToolbar.mjs","names":["classes"],"sources":["../../src/RichTextEditorToolbar/RichTextEditorToolbar.tsx"],"sourcesContent":["import {\n Box,\n BoxProps,\n CompoundStylesApiProps,\n ElementProps,\n factory,\n Factory,\n rem,\n useProps,\n} from '@mantine/core';\nimport { useRichTextEditorContext } from '../RichTextEditor.context';\nimport classes from '../RichTextEditor.module.css';\n\nexport type RichTextEditorToolbarStylesNames = 'toolbar';\n\nexport interface RichTextEditorToolbarProps\n extends BoxProps, CompoundStylesApiProps<RichTextEditorToolbarFactory>, ElementProps<'div'> {\n /** Determines whether `position: sticky` styles should be added to the toolbar @default false */\n sticky?: boolean;\n\n /** Sets top style to offset elements with fixed position @default 0 */\n stickyOffset?: React.CSSProperties['top'];\n}\n\nexport type RichTextEditorToolbarFactory = Factory<{\n props: RichTextEditorToolbarProps;\n ref: HTMLDivElement;\n stylesNames: RichTextEditorToolbarStylesNames;\n compound: true;\n}>;\n\nexport const RichTextEditorToolbar = factory<RichTextEditorToolbarFactory>((_props) => {\n const props = useProps('RichTextEditorToolbar', null, _props);\n const {\n classNames,\n className,\n style,\n styles,\n vars,\n sticky,\n stickyOffset,\n mod,\n variant,\n ...others\n } = props;\n const ctx = useRichTextEditorContext();\n\n return (\n <Box\n mod={[{ sticky }, mod]}\n variant={variant || ctx.variant}\n {...ctx.getStyles('toolbar', { className, style, styles, classNames })}\n {...others}\n __vars={{ '--rte-sticky-offset': rem(stickyOffset) }}\n />\n );\n});\n\nRichTextEditorToolbar.classes = classes;\nRichTextEditorToolbar.displayName = '@mantine/tiptap/RichTextEditorToolbar';\n"],"mappings":";;;;;;AA+BA,MAAa,wBAAwB,SAAuC,WAAW;CAErF,MAAM,EACJ,YACA,WACA,OACA,QACA,MACA,QACA,cACA,KACA,SACA,GAAG,WAXS,SAAS,yBAAyB,MAAM,OAAO;CAa7D,MAAM,MAAM,0BAA0B;AAEtC,QACE,oBAAC,KAAD;EACE,KAAK,CAAC,EAAE,QAAQ,EAAE,IAAI;EACtB,SAAS,WAAW,IAAI;EACxB,GAAI,IAAI,UAAU,WAAW;GAAE;GAAW;GAAO;GAAQ;GAAY,CAAC;EACtE,GAAI;EACJ,QAAQ,EAAE,uBAAuB,IAAI,aAAa,EAAE;EACpD,CAAA;EAEJ;AAEF,sBAAsB,UAAUA;AAChC,sBAAsB,cAAc"}
|
package/esm/extensions/Link.mjs
CHANGED
|
@@ -1,14 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
import TipTapLink from
|
|
3
|
-
|
|
4
|
-
const Link = TipTapLink.extend({
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}
|
|
10
|
-
})
|
|
11
|
-
}).configure({ openOnClick: false });
|
|
12
|
-
|
|
1
|
+
"use client";
|
|
2
|
+
import TipTapLink from "@tiptap/extension-link";
|
|
3
|
+
//#region packages/@mantine/tiptap/src/extensions/Link.ts
|
|
4
|
+
const Link = TipTapLink.extend({ addKeyboardShortcuts: () => ({ "Mod-k": () => {
|
|
5
|
+
window.dispatchEvent(new Event("edit-link"));
|
|
6
|
+
return true;
|
|
7
|
+
} }) }).configure({ openOnClick: false });
|
|
8
|
+
//#endregion
|
|
13
9
|
export { Link };
|
|
14
|
-
|
|
10
|
+
|
|
11
|
+
//# sourceMappingURL=Link.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Link.mjs","sources":["../../src/extensions/Link.ts"],"sourcesContent":["import TipTapLink from '@tiptap/extension-link';\n\nexport const Link = TipTapLink.extend({\n addKeyboardShortcuts: () => ({\n 'Mod-k': () => {\n window.dispatchEvent(new Event('edit-link'));\n return true;\n },\n }),\n}).configure({ openOnClick: false });\n"],"
|
|
1
|
+
{"version":3,"file":"Link.mjs","names":[],"sources":["../../src/extensions/Link.ts"],"sourcesContent":["import TipTapLink from '@tiptap/extension-link';\n\nexport const Link = TipTapLink.extend({\n addKeyboardShortcuts: () => ({\n 'Mod-k': () => {\n window.dispatchEvent(new Event('edit-link'));\n return true;\n },\n }),\n}).configure({ openOnClick: false });\n"],"mappings":";;;AAEA,MAAa,OAAO,WAAW,OAAO,EACpC,6BAA6B,EAC3B,eAAe;AACb,QAAO,cAAc,IAAI,MAAM,YAAY,CAAC;AAC5C,QAAO;GAEV,GACF,CAAC,CAAC,UAAU,EAAE,aAAa,OAAO,CAAC"}
|
|
@@ -1,22 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
const getTaskListExtension = (TipTapTaskList) => TipTapTaskList.extend({
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}).configure({
|
|
16
|
-
HTMLAttributes: {
|
|
17
|
-
class: `${classes.taskList} mantine-RichTextEditor-taskList`
|
|
18
|
-
}
|
|
19
|
-
});
|
|
20
|
-
|
|
1
|
+
"use client";
|
|
2
|
+
import RichTextEditor_module_default from "../RichTextEditor.module.mjs";
|
|
3
|
+
//#region packages/@mantine/tiptap/src/extensions/TaskList.ts
|
|
4
|
+
const getTaskListExtension = (TipTapTaskList) => TipTapTaskList.extend({ addKeyboardShortcuts: () => ({
|
|
5
|
+
"Mod-[": ({ editor }) => {
|
|
6
|
+
editor.chain().focus().liftListItem("taskItem").run();
|
|
7
|
+
return true;
|
|
8
|
+
},
|
|
9
|
+
"Mod-]": ({ editor }) => {
|
|
10
|
+
editor.chain().focus().sinkListItem("taskItem").run();
|
|
11
|
+
return true;
|
|
12
|
+
}
|
|
13
|
+
}) }).configure({ HTMLAttributes: { class: `${RichTextEditor_module_default.taskList} mantine-RichTextEditor-taskList` } });
|
|
14
|
+
//#endregion
|
|
21
15
|
export { getTaskListExtension };
|
|
22
|
-
|
|
16
|
+
|
|
17
|
+
//# sourceMappingURL=TaskList.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TaskList.mjs","sources":["../../src/extensions/TaskList.ts"],"sourcesContent":["import classes from '../RichTextEditor.module.css';\n\nexport const getTaskListExtension = <T>(TipTapTaskList: T): T =>\n (TipTapTaskList as any)\n .extend({\n addKeyboardShortcuts: () => ({\n 'Mod-[': ({ editor }: any) => {\n editor.chain().focus().liftListItem('taskItem').run();\n return true;\n },\n 'Mod-]': ({ editor }: any) => {\n editor.chain().focus().sinkListItem('taskItem').run();\n return true;\n },\n }),\n })\n .configure({\n HTMLAttributes: {\n class: `${classes.taskList} mantine-RichTextEditor-taskList`,\n },\n });\n"],"
|
|
1
|
+
{"version":3,"file":"TaskList.mjs","names":["classes"],"sources":["../../src/extensions/TaskList.ts"],"sourcesContent":["import classes from '../RichTextEditor.module.css';\n\nexport const getTaskListExtension = <T>(TipTapTaskList: T): T =>\n (TipTapTaskList as any)\n .extend({\n addKeyboardShortcuts: () => ({\n 'Mod-[': ({ editor }: any) => {\n editor.chain().focus().liftListItem('taskItem').run();\n return true;\n },\n 'Mod-]': ({ editor }: any) => {\n editor.chain().focus().sinkListItem('taskItem').run();\n return true;\n },\n }),\n })\n .configure({\n HTMLAttributes: {\n class: `${classes.taskList} mantine-RichTextEditor-taskList`,\n },\n });\n"],"mappings":";;;AAEA,MAAa,wBAA2B,mBACrC,eACE,OAAO,EACN,6BAA6B;CAC3B,UAAU,EAAE,aAAkB;AAC5B,SAAO,OAAO,CAAC,OAAO,CAAC,aAAa,WAAW,CAAC,KAAK;AACrD,SAAO;;CAET,UAAU,EAAE,aAAkB;AAC5B,SAAO,OAAO,CAAC,OAAO,CAAC,aAAa,WAAW,CAAC,KAAK;AACrD,SAAO;;CAEV,GACF,CAAC,CACD,UAAU,EACT,gBAAgB,EACd,OAAO,GAAGA,8BAAQ,SAAS,mCAC5B,EACF,CAAC"}
|