@mantine/tiptap 5.7.2
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/README.md +21 -0
- package/cjs/Content/Content.js +62 -0
- package/cjs/Content/Content.js.map +1 -0
- package/cjs/Content/Content.styles.js +105 -0
- package/cjs/Content/Content.styles.js.map +1 -0
- package/cjs/RichTextEditor.context.js +11 -0
- package/cjs/RichTextEditor.context.js.map +1 -0
- package/cjs/RichTextEditor.js +124 -0
- package/cjs/RichTextEditor.js.map +1 -0
- package/cjs/RichTextEditor.styles.js +16 -0
- package/cjs/RichTextEditor.styles.js.map +1 -0
- package/cjs/Toolbar/Toolbar.js +56 -0
- package/cjs/Toolbar/Toolbar.js.map +1 -0
- package/cjs/Toolbar/Toolbar.styles.js +21 -0
- package/cjs/Toolbar/Toolbar.styles.js.map +1 -0
- package/cjs/controls/ColorControl/ColorControl.js +67 -0
- package/cjs/controls/ColorControl/ColorControl.js.map +1 -0
- package/cjs/controls/ColorPickerControl/ColorPickerControl.js +177 -0
- package/cjs/controls/ColorPickerControl/ColorPickerControl.js.map +1 -0
- package/cjs/controls/Control/Control.js +68 -0
- package/cjs/controls/Control/Control.js.map +1 -0
- package/cjs/controls/Control/Control.styles.js +51 -0
- package/cjs/controls/Control/Control.styles.js.map +1 -0
- package/cjs/controls/ControlBase/ControlBase.js +52 -0
- package/cjs/controls/ControlBase/ControlBase.js.map +1 -0
- package/cjs/controls/ControlBase/create-control.js +45 -0
- package/cjs/controls/ControlBase/create-control.js.map +1 -0
- package/cjs/controls/ControlsGroup/ControlsGroup.js +59 -0
- package/cjs/controls/ControlsGroup/ControlsGroup.js.map +1 -0
- package/cjs/controls/ControlsGroup/ControlsGroup.styles.js +28 -0
- package/cjs/controls/ControlsGroup/ControlsGroup.styles.js.map +1 -0
- package/cjs/controls/LinkControl/LinkControl.js +145 -0
- package/cjs/controls/LinkControl/LinkControl.js.map +1 -0
- package/cjs/controls/LinkControl/LinkControl.styles.js +57 -0
- package/cjs/controls/LinkControl/LinkControl.styles.js.map +1 -0
- package/cjs/controls/controls.js +251 -0
- package/cjs/controls/controls.js.map +1 -0
- package/cjs/extensions/Link.js +21 -0
- package/cjs/extensions/Link.js.map +1 -0
- package/cjs/index.js +16 -0
- package/cjs/index.js.map +1 -0
- package/cjs/labels.js +47 -0
- package/cjs/labels.js.map +1 -0
- package/esm/Content/Content.js +54 -0
- package/esm/Content/Content.js.map +1 -0
- package/esm/Content/Content.styles.js +101 -0
- package/esm/Content/Content.styles.js.map +1 -0
- package/esm/RichTextEditor.context.js +6 -0
- package/esm/RichTextEditor.context.js.map +1 -0
- package/esm/RichTextEditor.js +116 -0
- package/esm/RichTextEditor.js.map +1 -0
- package/esm/RichTextEditor.styles.js +12 -0
- package/esm/RichTextEditor.styles.js.map +1 -0
- package/esm/Toolbar/Toolbar.js +48 -0
- package/esm/Toolbar/Toolbar.js.map +1 -0
- package/esm/Toolbar/Toolbar.styles.js +17 -0
- package/esm/Toolbar/Toolbar.styles.js.map +1 -0
- package/esm/controls/ColorControl/ColorControl.js +59 -0
- package/esm/controls/ColorControl/ColorControl.js.map +1 -0
- package/esm/controls/ColorPickerControl/ColorPickerControl.js +169 -0
- package/esm/controls/ColorPickerControl/ColorPickerControl.js.map +1 -0
- package/esm/controls/Control/Control.js +60 -0
- package/esm/controls/Control/Control.js.map +1 -0
- package/esm/controls/Control/Control.styles.js +47 -0
- package/esm/controls/Control/Control.styles.js.map +1 -0
- package/esm/controls/ControlBase/ControlBase.js +44 -0
- package/esm/controls/ControlBase/ControlBase.js.map +1 -0
- package/esm/controls/ControlBase/create-control.js +37 -0
- package/esm/controls/ControlBase/create-control.js.map +1 -0
- package/esm/controls/ControlsGroup/ControlsGroup.js +51 -0
- package/esm/controls/ControlsGroup/ControlsGroup.js.map +1 -0
- package/esm/controls/ControlsGroup/ControlsGroup.styles.js +24 -0
- package/esm/controls/ControlsGroup/ControlsGroup.styles.js.map +1 -0
- package/esm/controls/LinkControl/LinkControl.js +137 -0
- package/esm/controls/LinkControl/LinkControl.js.map +1 -0
- package/esm/controls/LinkControl/LinkControl.styles.js +53 -0
- package/esm/controls/LinkControl/LinkControl.styles.js.map +1 -0
- package/esm/controls/controls.js +219 -0
- package/esm/controls/controls.js.map +1 -0
- package/esm/extensions/Link.js +13 -0
- package/esm/extensions/Link.js.map +1 -0
- package/esm/index.js +5 -0
- package/esm/index.js.map +1 -0
- package/esm/labels.js +43 -0
- package/esm/labels.js.map +1 -0
- package/lib/Content/Content.d.ts +8 -0
- package/lib/Content/Content.d.ts.map +1 -0
- package/lib/Content/Content.styles.d.ts +12 -0
- package/lib/Content/Content.styles.d.ts.map +1 -0
- package/lib/RichTextEditor.context.d.ts +14 -0
- package/lib/RichTextEditor.context.d.ts.map +1 -0
- package/lib/RichTextEditor.d.ts +60 -0
- package/lib/RichTextEditor.d.ts.map +1 -0
- package/lib/RichTextEditor.styles.d.ts +7 -0
- package/lib/RichTextEditor.styles.d.ts.map +1 -0
- package/lib/Toolbar/Toolbar.d.ts +12 -0
- package/lib/Toolbar/Toolbar.d.ts.map +1 -0
- package/lib/Toolbar/Toolbar.styles.d.ts +12 -0
- package/lib/Toolbar/Toolbar.styles.d.ts.map +1 -0
- package/lib/controls/ColorControl/ColorControl.d.ts +8 -0
- package/lib/controls/ColorControl/ColorControl.d.ts.map +1 -0
- package/lib/controls/ColorPickerControl/ColorPickerControl.d.ts +14 -0
- package/lib/controls/ColorPickerControl/ColorPickerControl.d.ts.map +1 -0
- package/lib/controls/Control/Control.d.ts +18 -0
- package/lib/controls/Control/Control.d.ts.map +1 -0
- package/lib/controls/Control/Control.styles.d.ts +7 -0
- package/lib/controls/Control/Control.styles.d.ts.map +1 -0
- package/lib/controls/ControlBase/ControlBase.d.ts +9 -0
- package/lib/controls/ControlBase/ControlBase.d.ts.map +1 -0
- package/lib/controls/ControlBase/create-control.d.ts +20 -0
- package/lib/controls/ControlBase/create-control.d.ts.map +1 -0
- package/lib/controls/ControlsGroup/ControlsGroup.d.ts +8 -0
- package/lib/controls/ControlsGroup/ControlsGroup.d.ts.map +1 -0
- package/lib/controls/ControlsGroup/ControlsGroup.styles.d.ts +7 -0
- package/lib/controls/ControlsGroup/ControlsGroup.styles.d.ts.map +1 -0
- package/lib/controls/LinkControl/LinkControl.d.ts +13 -0
- package/lib/controls/LinkControl/LinkControl.d.ts.map +1 -0
- package/lib/controls/LinkControl/LinkControl.styles.d.ts +7 -0
- package/lib/controls/LinkControl/LinkControl.styles.d.ts.map +1 -0
- package/lib/controls/controls.d.ts +27 -0
- package/lib/controls/controls.d.ts.map +1 -0
- package/lib/controls/index.d.ts +5 -0
- package/lib/controls/index.d.ts.map +1 -0
- package/lib/extensions/Link.d.ts +2 -0
- package/lib/extensions/Link.d.ts.map +1 -0
- package/lib/extensions/index.d.ts +2 -0
- package/lib/extensions/index.d.ts.map +1 -0
- package/lib/index.d.ts +13 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/labels.d.ts +80 -0
- package/lib/labels.d.ts.map +1 -0
- package/package.json +41 -0
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import React, { forwardRef, useState } from 'react';
|
|
2
|
+
import { IconExternalLink, IconLink } from '@tabler/icons';
|
|
3
|
+
import { useComponentDefaultProps, useContextStylesApi, Popover, TextInput, Tooltip, UnstyledButton, Button } from '@mantine/core';
|
|
4
|
+
import { useInputState, useDisclosure, useWindowEvent } from '@mantine/hooks';
|
|
5
|
+
import { ControlBase } from '../ControlBase/ControlBase.js';
|
|
6
|
+
import { useRichTextEditorContext } from '../../RichTextEditor.context.js';
|
|
7
|
+
import useStyles from './LinkControl.styles.js';
|
|
8
|
+
|
|
9
|
+
var __defProp = Object.defineProperty;
|
|
10
|
+
var __defProps = Object.defineProperties;
|
|
11
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
12
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
13
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
14
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
15
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
16
|
+
var __spreadValues = (a, b) => {
|
|
17
|
+
for (var prop in b || (b = {}))
|
|
18
|
+
if (__hasOwnProp.call(b, prop))
|
|
19
|
+
__defNormalProp(a, prop, b[prop]);
|
|
20
|
+
if (__getOwnPropSymbols)
|
|
21
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
22
|
+
if (__propIsEnum.call(b, prop))
|
|
23
|
+
__defNormalProp(a, prop, b[prop]);
|
|
24
|
+
}
|
|
25
|
+
return a;
|
|
26
|
+
};
|
|
27
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
28
|
+
var __objRest = (source, exclude) => {
|
|
29
|
+
var target = {};
|
|
30
|
+
for (var prop in source)
|
|
31
|
+
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
32
|
+
target[prop] = source[prop];
|
|
33
|
+
if (source != null && __getOwnPropSymbols)
|
|
34
|
+
for (var prop of __getOwnPropSymbols(source)) {
|
|
35
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
36
|
+
target[prop] = source[prop];
|
|
37
|
+
}
|
|
38
|
+
return target;
|
|
39
|
+
};
|
|
40
|
+
const LinkIcon = (_a) => {
|
|
41
|
+
var _b = _a, { size } = _b, others = __objRest(_b, ["size"]);
|
|
42
|
+
return /* @__PURE__ */ React.createElement(IconLink, __spreadValues({
|
|
43
|
+
size,
|
|
44
|
+
stroke: 1.5
|
|
45
|
+
}, others));
|
|
46
|
+
};
|
|
47
|
+
const defaultProps = {};
|
|
48
|
+
const LinkControl = forwardRef((props, ref) => {
|
|
49
|
+
const _a = useComponentDefaultProps("RichTextEditor.LinkControl", defaultProps, props), { icon, popoverProps, disableTooltips } = _a, others = __objRest(_a, ["icon", "popoverProps", "disableTooltips"]);
|
|
50
|
+
const { classNames, styles, unstyled } = useContextStylesApi();
|
|
51
|
+
const { classes } = useStyles(null, { name: "RichTextEditor", classNames, styles, unstyled });
|
|
52
|
+
const { editor, labels } = useRichTextEditorContext();
|
|
53
|
+
const [url, setUrl] = useInputState("");
|
|
54
|
+
const [external, setExternal] = useState(false);
|
|
55
|
+
const [opened, { open, close }] = useDisclosure(false);
|
|
56
|
+
const handleOpen = () => {
|
|
57
|
+
open();
|
|
58
|
+
const linkData = editor == null ? void 0 : editor.getAttributes("link");
|
|
59
|
+
setUrl((linkData == null ? void 0 : linkData.href) || "");
|
|
60
|
+
setExternal((linkData == null ? void 0 : linkData.target) === "_blank");
|
|
61
|
+
};
|
|
62
|
+
const handleClose = () => {
|
|
63
|
+
close();
|
|
64
|
+
setUrl("");
|
|
65
|
+
setExternal(false);
|
|
66
|
+
};
|
|
67
|
+
const setLink = () => {
|
|
68
|
+
handleClose();
|
|
69
|
+
url === "" ? editor.chain().focus().extendMarkRange("link").unsetLink().run() : editor.chain().focus().extendMarkRange("link").setLink({ href: url, target: external ? "_blank" : null }).run();
|
|
70
|
+
};
|
|
71
|
+
const handleInputKeydown = (event) => {
|
|
72
|
+
if (event.key === "Enter") {
|
|
73
|
+
event.preventDefault();
|
|
74
|
+
setLink();
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
useWindowEvent("edit-link", handleOpen, false);
|
|
78
|
+
return /* @__PURE__ */ React.createElement(Popover, __spreadValues({
|
|
79
|
+
trapFocus: true,
|
|
80
|
+
shadow: "md",
|
|
81
|
+
withinPortal: true,
|
|
82
|
+
opened,
|
|
83
|
+
onClose: handleClose,
|
|
84
|
+
offset: -44,
|
|
85
|
+
zIndex: 1e4,
|
|
86
|
+
unstyled
|
|
87
|
+
}, popoverProps), /* @__PURE__ */ React.createElement(Popover.Target, null, /* @__PURE__ */ React.createElement(ControlBase, __spreadProps(__spreadValues({
|
|
88
|
+
icon: LinkIcon,
|
|
89
|
+
"aria-label": labels.linkControlLabel,
|
|
90
|
+
title: labels.linkControlLabel,
|
|
91
|
+
onClick: handleOpen,
|
|
92
|
+
active: editor == null ? void 0 : editor.isActive("link"),
|
|
93
|
+
unstyled
|
|
94
|
+
}, others), {
|
|
95
|
+
ref
|
|
96
|
+
}))), /* @__PURE__ */ React.createElement(Popover.Dropdown, {
|
|
97
|
+
sx: (theme) => ({
|
|
98
|
+
backgroundColor: theme.colorScheme === "dark" ? theme.colors.dark[7] : theme.white
|
|
99
|
+
})
|
|
100
|
+
}, /* @__PURE__ */ React.createElement("div", {
|
|
101
|
+
className: classes.linkEditor
|
|
102
|
+
}, /* @__PURE__ */ React.createElement(TextInput, {
|
|
103
|
+
placeholder: labels.linkEditorInputPlaceholder,
|
|
104
|
+
"aria-label": labels.linkEditorInputLabel,
|
|
105
|
+
type: "url",
|
|
106
|
+
value: url,
|
|
107
|
+
onChange: setUrl,
|
|
108
|
+
classNames: { input: classes.linkEditorInput },
|
|
109
|
+
onKeyDown: handleInputKeydown,
|
|
110
|
+
unstyled,
|
|
111
|
+
rightSection: /* @__PURE__ */ React.createElement(Tooltip, {
|
|
112
|
+
label: external ? labels.linkEditorExternalLink : labels.linkEditorInternalLink,
|
|
113
|
+
events: { hover: true, focus: true, touch: true },
|
|
114
|
+
withinPortal: true,
|
|
115
|
+
withArrow: true,
|
|
116
|
+
disabled: disableTooltips,
|
|
117
|
+
unstyled,
|
|
118
|
+
zIndex: 1e4
|
|
119
|
+
}, /* @__PURE__ */ React.createElement(UnstyledButton, {
|
|
120
|
+
onClick: () => setExternal((e) => !e),
|
|
121
|
+
"data-active": external || void 0,
|
|
122
|
+
className: classes.linkEditorExternalControl,
|
|
123
|
+
unstyled
|
|
124
|
+
}, /* @__PURE__ */ React.createElement(IconExternalLink, {
|
|
125
|
+
size: 14,
|
|
126
|
+
stroke: 1.5
|
|
127
|
+
})))
|
|
128
|
+
}), /* @__PURE__ */ React.createElement(Button, {
|
|
129
|
+
variant: "default",
|
|
130
|
+
onClick: setLink,
|
|
131
|
+
className: classes.linkEditorSave,
|
|
132
|
+
unstyled
|
|
133
|
+
}, labels.linkEditorSave))));
|
|
134
|
+
});
|
|
135
|
+
|
|
136
|
+
export { LinkControl };
|
|
137
|
+
//# sourceMappingURL=LinkControl.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LinkControl.js","sources":["../../../src/controls/LinkControl/LinkControl.tsx"],"sourcesContent":["import React, { forwardRef, useState } from 'react';\nimport { IconLink, IconExternalLink } from '@tabler/icons';\nimport {\n Popover,\n TextInput,\n Button,\n UnstyledButton,\n Tooltip,\n PopoverProps,\n Selectors,\n useComponentDefaultProps,\n useContextStylesApi,\n} from '@mantine/core';\nimport { useDisclosure, useInputState, useWindowEvent } from '@mantine/hooks';\nimport { ControlBase, RichTextEditorControlBaseProps } from '../ControlBase/ControlBase';\nimport { useRichTextEditorContext } from '../../RichTextEditor.context';\nimport useStyles from './LinkControl.styles';\n\nexport type LinkControlStylesNames = Selectors<typeof useStyles>;\n\nexport interface RichTextEditorLinkControlProps extends Partial<RichTextEditorControlBaseProps> {\n /** Props added to Popover component */\n popoverProps?: Partial<PopoverProps>;\n\n /** Determines whether external link control tooltip should be disabled */\n disableTooltips?: boolean;\n}\n\nconst LinkIcon: RichTextEditorControlBaseProps['icon'] = ({ size, ...others }) => (\n <IconLink size={size} stroke={1.5} {...others} />\n);\n\nconst defaultProps: Partial<RichTextEditorLinkControlProps> = {};\n\nexport const LinkControl = forwardRef<HTMLButtonElement, RichTextEditorLinkControlProps>(\n (props, ref) => {\n const { icon, popoverProps, disableTooltips, ...others } = useComponentDefaultProps(\n 'RichTextEditor.LinkControl',\n defaultProps,\n props\n );\n\n const { classNames, styles, unstyled } = useContextStylesApi();\n const { classes } = useStyles(null, { name: 'RichTextEditor', classNames, styles, unstyled });\n const { editor, labels } = useRichTextEditorContext();\n const [url, setUrl] = useInputState('');\n const [external, setExternal] = useState(false);\n const [opened, { open, close }] = useDisclosure(false);\n\n const handleOpen = () => {\n open();\n const linkData = editor?.getAttributes('link');\n setUrl(linkData?.href || '');\n setExternal(linkData?.target === '_blank');\n };\n\n const handleClose = () => {\n close();\n setUrl('');\n setExternal(false);\n };\n\n const setLink = () => {\n handleClose();\n url === ''\n ? editor.chain().focus().extendMarkRange('link').unsetLink().run()\n : editor\n .chain()\n .focus()\n .extendMarkRange('link')\n .setLink({ href: url, target: external ? '_blank' : null })\n .run();\n };\n\n const handleInputKeydown = (event: React.KeyboardEvent<HTMLInputElement>) => {\n if (event.key === 'Enter') {\n event.preventDefault();\n setLink();\n }\n };\n\n useWindowEvent('edit-link', handleOpen, false);\n\n return (\n <Popover\n trapFocus\n shadow=\"md\"\n withinPortal\n opened={opened}\n onClose={handleClose}\n offset={-44}\n zIndex={10000}\n unstyled={unstyled}\n {...popoverProps}\n >\n <Popover.Target>\n <ControlBase\n icon={LinkIcon}\n aria-label={labels.linkControlLabel}\n title={labels.linkControlLabel}\n onClick={handleOpen}\n active={editor?.isActive('link')}\n unstyled={unstyled}\n {...others}\n ref={ref}\n />\n </Popover.Target>\n\n <Popover.Dropdown\n sx={(theme) => ({\n backgroundColor: theme.colorScheme === 'dark' ? theme.colors.dark[7] : theme.white,\n })}\n >\n <div className={classes.linkEditor}>\n <TextInput\n placeholder={labels.linkEditorInputPlaceholder}\n aria-label={labels.linkEditorInputLabel}\n type=\"url\"\n value={url}\n onChange={setUrl}\n classNames={{ input: classes.linkEditorInput }}\n onKeyDown={handleInputKeydown}\n unstyled={unstyled}\n rightSection={\n <Tooltip\n label={external ? labels.linkEditorExternalLink : labels.linkEditorInternalLink}\n events={{ hover: true, focus: true, touch: true }}\n withinPortal\n withArrow\n disabled={disableTooltips}\n unstyled={unstyled}\n zIndex={10000}\n >\n <UnstyledButton\n onClick={() => setExternal((e) => !e)}\n data-active={external || undefined}\n className={classes.linkEditorExternalControl}\n unstyled={unstyled}\n >\n <IconExternalLink size={14} stroke={1.5} />\n </UnstyledButton>\n </Tooltip>\n }\n />\n\n <Button\n variant=\"default\"\n onClick={setLink}\n className={classes.linkEditorSave}\n unstyled={unstyled}\n >\n {labels.linkEditorSave}\n </Button>\n </div>\n </Popover.Dropdown>\n </Popover>\n );\n }\n);\n"],"names":[],"mappings":";;;;;;;;AAAA,IAAI,SAAS,GAAG,MAAM,CAAC,cAAc,CAAC;AACtC,IAAI,UAAU,GAAG,MAAM,CAAC,gBAAgB,CAAC;AACzC,IAAI,iBAAiB,GAAG,MAAM,CAAC,yBAAyB,CAAC;AACzD,IAAI,mBAAmB,GAAG,MAAM,CAAC,qBAAqB,CAAC;AACvD,IAAI,YAAY,GAAG,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC;AACnD,IAAI,YAAY,GAAG,MAAM,CAAC,SAAS,CAAC,oBAAoB,CAAC;AACzD,IAAI,eAAe,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,KAAK,KAAK,GAAG,IAAI,GAAG,GAAG,SAAS,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,GAAG,GAAG,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;AAChK,IAAI,cAAc,GAAG,CAAC,CAAC,EAAE,CAAC,KAAK;AAC/B,EAAE,KAAK,IAAI,IAAI,IAAI,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC;AAChC,IAAI,IAAI,YAAY,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC;AAClC,MAAM,eAAe,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;AACxC,EAAE,IAAI,mBAAmB;AACzB,IAAI,KAAK,IAAI,IAAI,IAAI,mBAAmB,CAAC,CAAC,CAAC,EAAE;AAC7C,MAAM,IAAI,YAAY,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC;AACpC,QAAQ,eAA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|
1
|
+
import { createStyles } from '@mantine/core';
|
|
2
|
+
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
+
var __spreadValues = (a, b) => {
|
|
9
|
+
for (var prop in b || (b = {}))
|
|
10
|
+
if (__hasOwnProp.call(b, prop))
|
|
11
|
+
__defNormalProp(a, prop, b[prop]);
|
|
12
|
+
if (__getOwnPropSymbols)
|
|
13
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
+
if (__propIsEnum.call(b, prop))
|
|
15
|
+
__defNormalProp(a, prop, b[prop]);
|
|
16
|
+
}
|
|
17
|
+
return a;
|
|
18
|
+
};
|
|
19
|
+
var useStyles = createStyles((theme) => {
|
|
20
|
+
const colors = theme.fn.variant({ variant: "light" });
|
|
21
|
+
return {
|
|
22
|
+
linkEditor: {
|
|
23
|
+
display: "flex"
|
|
24
|
+
},
|
|
25
|
+
linkEditorInput: {
|
|
26
|
+
borderTopRightRadius: 0,
|
|
27
|
+
borderBottomRightRadius: 0,
|
|
28
|
+
borderRight: 0
|
|
29
|
+
},
|
|
30
|
+
linkEditorExternalControl: {
|
|
31
|
+
backgroundColor: theme.colorScheme === "dark" ? theme.fn.rgba(theme.colors.dark[7], 0.5) : theme.white,
|
|
32
|
+
border: `1px solid ${theme.colorScheme === "dark" ? theme.colors.dark[4] : theme.colors.gray[4]}`,
|
|
33
|
+
height: 24,
|
|
34
|
+
width: 24,
|
|
35
|
+
display: "flex",
|
|
36
|
+
justifyContent: "center",
|
|
37
|
+
alignItems: "center",
|
|
38
|
+
borderRadius: theme.fn.radius(),
|
|
39
|
+
"&[data-active]": __spreadValues({
|
|
40
|
+
backgroundColor: colors.background,
|
|
41
|
+
borderColor: colors.border,
|
|
42
|
+
color: colors.color
|
|
43
|
+
}, theme.fn.hover({ background: colors.hover }))
|
|
44
|
+
},
|
|
45
|
+
linkEditorSave: {
|
|
46
|
+
borderTopLeftRadius: 0,
|
|
47
|
+
borderBottomLeftRadius: 0
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
export default useStyles;
|
|
53
|
+
//# sourceMappingURL=LinkControl.styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LinkControl.styles.js","sources":["../../../src/controls/LinkControl/LinkControl.styles.ts"],"sourcesContent":["import { createStyles } from '@mantine/core';\n\nexport default createStyles((theme) => {\n const colors = theme.fn.variant({ variant: 'light' });\n return {\n linkEditor: {\n display: 'flex',\n },\n\n linkEditorInput: {\n borderTopRightRadius: 0,\n borderBottomRightRadius: 0,\n borderRight: 0,\n },\n\n linkEditorExternalControl: {\n backgroundColor:\n theme.colorScheme === 'dark' ? theme.fn.rgba(theme.colors.dark[7], 0.5) : theme.white,\n border: `1px solid ${\n theme.colorScheme === 'dark' ? theme.colors.dark[4] : theme.colors.gray[4]\n }`,\n height: 24,\n width: 24,\n display: 'flex',\n justifyContent: 'center',\n alignItems: 'center',\n borderRadius: theme.fn.radius(),\n\n '&[data-active]': {\n backgroundColor: colors.background,\n borderColor: colors.border,\n color: colors.color,\n ...theme.fn.hover({ background: colors.hover }),\n },\n },\n\n linkEditorSave: {\n borderTopLeftRadius: 0,\n borderBottomLeftRadius: 0,\n },\n };\n});\n"],"names":[],"mappings":";;AAAA,IAAI,SAAS,GAAG,MAAM,CAAC,cAAc,CAAC;AACtC,IAAI,mBAAmB,GAAG,MAAM,CAAC,qBAAqB,CAAC;AACvD,IAAI,YAAY,GAAG,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC;AACnD,IAAI,YAAY,GAAG,MAAM,CAAC,SAAS,CAAC,oBAA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AACL,IAAI,yBAAyB,EAAE;AAC/B,MAAM,eAAe,EAAE,KAAK,CAAC,WAAW,KAAK,MAAM,GAAG,KAAK,CAAC,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,GAAG,KAAK,CAAC,KAAK;AAC5G,MAAM,MAAM,EAAE,CAAC,UAAU,EAAE,KAAK,CAAC,WAAW,KAAK,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;AACvG,MAAM,MAAM,EAAE,EAAE;AAChB,MAAM,KAAK,EAAE,EAAE;AACf,MAAM,OAAO,EAAE,MAAM;AACrB,MAAM,cAAc,EAAE,QAAQ;AAC9B,MAAM,UAAU,EAAE,QAAQ;AAC1B,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,MAAM,EAAE;AACrC,MAAM,gBAAgB,EAAE,cAAc,CAAC;AACvC,QAAQ,eAAe,EAAE,MAAM,CAAC,UAAU;AAC1C,QAAQ,WAAW,EAAE,MAAM,CAAC,MAAM;AAClC,QAAQ,KAAK,EAAE,MAAM,CAAC,KAAK;AAC3B,OAAO,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,UAAU,EAAE,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC;AACtD,KAAK;AACL,IAAI,cAAc,EAAE;AACpB,MAAM,mBAAmB,EAAE,CAAC;AAC5B,MAAM,sBAAsB,EAAE,CAAC;AAC/B,KAAK;AACL,GAAG,CAAC;AACJ,CAAC,CAAC;;;;"}
|
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { IconItalic, IconUnderline, IconStrikethrough, IconClearFormatting, IconUnlink, IconList, IconListNumbers, IconH1, IconH2, IconH3, IconH4, IconH5, IconH6, IconBlockquote, IconAlignLeft, IconAlignRight, IconAlignCenter, IconAlignJustified, IconSubscript, IconSuperscript, IconCode, IconHighlight, IconLineDashed, IconBold } from '@tabler/icons';
|
|
3
|
+
import { createControl } from './ControlBase/create-control.js';
|
|
4
|
+
|
|
5
|
+
var __defProp = Object.defineProperty;
|
|
6
|
+
var __defProps = Object.defineProperties;
|
|
7
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
8
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
9
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
10
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
11
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
12
|
+
var __spreadValues = (a, b) => {
|
|
13
|
+
for (var prop in b || (b = {}))
|
|
14
|
+
if (__hasOwnProp.call(b, prop))
|
|
15
|
+
__defNormalProp(a, prop, b[prop]);
|
|
16
|
+
if (__getOwnPropSymbols)
|
|
17
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
18
|
+
if (__propIsEnum.call(b, prop))
|
|
19
|
+
__defNormalProp(a, prop, b[prop]);
|
|
20
|
+
}
|
|
21
|
+
return a;
|
|
22
|
+
};
|
|
23
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
24
|
+
const BoldControl = createControl({
|
|
25
|
+
label: "boldControlLabel",
|
|
26
|
+
icon: (props) => /* @__PURE__ */ React.createElement(IconBold, __spreadProps(__spreadValues({}, props), {
|
|
27
|
+
stroke: 1.5
|
|
28
|
+
})),
|
|
29
|
+
isActive: { name: "bold" },
|
|
30
|
+
operation: { name: "toggleBold" }
|
|
31
|
+
});
|
|
32
|
+
const ItalicControl = createControl({
|
|
33
|
+
label: "italicControlLabel",
|
|
34
|
+
icon: (props) => /* @__PURE__ */ React.createElement(IconItalic, __spreadProps(__spreadValues({}, props), {
|
|
35
|
+
stroke: 1.5
|
|
36
|
+
})),
|
|
37
|
+
isActive: { name: "italic" },
|
|
38
|
+
operation: { name: "toggleItalic" }
|
|
39
|
+
});
|
|
40
|
+
const UnderlineControl = createControl({
|
|
41
|
+
label: "underlineControlLabel",
|
|
42
|
+
icon: (props) => /* @__PURE__ */ React.createElement(IconUnderline, __spreadProps(__spreadValues({}, props), {
|
|
43
|
+
stroke: 1.5
|
|
44
|
+
})),
|
|
45
|
+
isActive: { name: "underline" },
|
|
46
|
+
operation: { name: "toggleUnderline" }
|
|
47
|
+
});
|
|
48
|
+
const StrikeThoughControl = createControl({
|
|
49
|
+
label: "strikeControlLabel",
|
|
50
|
+
icon: (props) => /* @__PURE__ */ React.createElement(IconStrikethrough, __spreadProps(__spreadValues({}, props), {
|
|
51
|
+
stroke: 1.5
|
|
52
|
+
})),
|
|
53
|
+
isActive: { name: "strike" },
|
|
54
|
+
operation: { name: "toggleStrike" }
|
|
55
|
+
});
|
|
56
|
+
const ClearFormattingControl = createControl({
|
|
57
|
+
label: "clearFormattingControlLabel",
|
|
58
|
+
icon: (props) => /* @__PURE__ */ React.createElement(IconClearFormatting, __spreadProps(__spreadValues({}, props), {
|
|
59
|
+
stroke: 1.5
|
|
60
|
+
})),
|
|
61
|
+
operation: { name: "unsetAllMarks" }
|
|
62
|
+
});
|
|
63
|
+
const UnlinkControl = createControl({
|
|
64
|
+
label: "unlinkControlLabel",
|
|
65
|
+
icon: (props) => /* @__PURE__ */ React.createElement(IconUnlink, __spreadProps(__spreadValues({}, props), {
|
|
66
|
+
stroke: 1.5
|
|
67
|
+
})),
|
|
68
|
+
operation: { name: "unsetLink" }
|
|
69
|
+
});
|
|
70
|
+
const BulletListControl = createControl({
|
|
71
|
+
label: "bulletListControlLabel",
|
|
72
|
+
icon: (props) => /* @__PURE__ */ React.createElement(IconList, __spreadProps(__spreadValues({}, props), {
|
|
73
|
+
stroke: 1.5
|
|
74
|
+
})),
|
|
75
|
+
isActive: { name: "bulletList" },
|
|
76
|
+
operation: { name: "toggleBulletList" }
|
|
77
|
+
});
|
|
78
|
+
const OrderedListControl = createControl({
|
|
79
|
+
label: "orderedListControlLabel",
|
|
80
|
+
icon: (props) => /* @__PURE__ */ React.createElement(IconListNumbers, __spreadProps(__spreadValues({}, props), {
|
|
81
|
+
stroke: 1.5
|
|
82
|
+
})),
|
|
83
|
+
isActive: { name: "orderedList" },
|
|
84
|
+
operation: { name: "toggleOrderedList" }
|
|
85
|
+
});
|
|
86
|
+
const H1Control = createControl({
|
|
87
|
+
label: "h1ControlLabel",
|
|
88
|
+
icon: (props) => /* @__PURE__ */ React.createElement(IconH1, __spreadProps(__spreadValues({}, props), {
|
|
89
|
+
stroke: 1.5
|
|
90
|
+
})),
|
|
91
|
+
isActive: { name: "heading", attributes: { level: 1 } },
|
|
92
|
+
operation: { name: "toggleHeading", attributes: { level: 1 } }
|
|
93
|
+
});
|
|
94
|
+
const H2Control = createControl({
|
|
95
|
+
label: "h2ControlLabel",
|
|
96
|
+
icon: (props) => /* @__PURE__ */ React.createElement(IconH2, __spreadProps(__spreadValues({}, props), {
|
|
97
|
+
stroke: 1.5
|
|
98
|
+
})),
|
|
99
|
+
isActive: { name: "heading", attributes: { level: 2 } },
|
|
100
|
+
operation: { name: "toggleHeading", attributes: { level: 2 } }
|
|
101
|
+
});
|
|
102
|
+
const H3Control = createControl({
|
|
103
|
+
label: "h3ControlLabel",
|
|
104
|
+
icon: (props) => /* @__PURE__ */ React.createElement(IconH3, __spreadProps(__spreadValues({}, props), {
|
|
105
|
+
stroke: 1.5
|
|
106
|
+
})),
|
|
107
|
+
isActive: { name: "heading", attributes: { level: 3 } },
|
|
108
|
+
operation: { name: "toggleHeading", attributes: { level: 3 } }
|
|
109
|
+
});
|
|
110
|
+
const H4Control = createControl({
|
|
111
|
+
label: "h4ControlLabel",
|
|
112
|
+
icon: (props) => /* @__PURE__ */ React.createElement(IconH4, __spreadProps(__spreadValues({}, props), {
|
|
113
|
+
stroke: 1.5
|
|
114
|
+
})),
|
|
115
|
+
isActive: { name: "heading", attributes: { level: 4 } },
|
|
116
|
+
operation: { name: "toggleHeading", attributes: { level: 4 } }
|
|
117
|
+
});
|
|
118
|
+
const H5Control = createControl({
|
|
119
|
+
label: "h5ControlLabel",
|
|
120
|
+
icon: (props) => /* @__PURE__ */ React.createElement(IconH5, __spreadProps(__spreadValues({}, props), {
|
|
121
|
+
stroke: 1.5
|
|
122
|
+
})),
|
|
123
|
+
isActive: { name: "heading", attributes: { level: 5 } },
|
|
124
|
+
operation: { name: "toggleHeading", attributes: { level: 5 } }
|
|
125
|
+
});
|
|
126
|
+
const H6Control = createControl({
|
|
127
|
+
label: "h6ControlLabel",
|
|
128
|
+
icon: (props) => /* @__PURE__ */ React.createElement(IconH6, __spreadProps(__spreadValues({}, props), {
|
|
129
|
+
stroke: 1.5
|
|
130
|
+
})),
|
|
131
|
+
isActive: { name: "heading", attributes: { level: 6 } },
|
|
132
|
+
operation: { name: "toggleHeading", attributes: { level: 6 } }
|
|
133
|
+
});
|
|
134
|
+
const BlockquoteControl = createControl({
|
|
135
|
+
label: "blockquoteControlLabel",
|
|
136
|
+
icon: (props) => /* @__PURE__ */ React.createElement(IconBlockquote, __spreadProps(__spreadValues({}, props), {
|
|
137
|
+
stroke: 1.5
|
|
138
|
+
})),
|
|
139
|
+
isActive: { name: "blockquote" },
|
|
140
|
+
operation: { name: "toggleBlockquote" }
|
|
141
|
+
});
|
|
142
|
+
const AlignLeftControl = createControl({
|
|
143
|
+
label: "alignLeftControlLabel",
|
|
144
|
+
icon: (props) => /* @__PURE__ */ React.createElement(IconAlignLeft, __spreadProps(__spreadValues({}, props), {
|
|
145
|
+
stroke: 1.5
|
|
146
|
+
})),
|
|
147
|
+
operation: { name: "setTextAlign", attributes: "left" }
|
|
148
|
+
});
|
|
149
|
+
const AlignRightControl = createControl({
|
|
150
|
+
label: "alignRightControlLabel",
|
|
151
|
+
icon: (props) => /* @__PURE__ */ React.createElement(IconAlignRight, __spreadProps(__spreadValues({}, props), {
|
|
152
|
+
stroke: 1.5
|
|
153
|
+
})),
|
|
154
|
+
operation: { name: "setTextAlign", attributes: "right" }
|
|
155
|
+
});
|
|
156
|
+
const AlignCenterControl = createControl({
|
|
157
|
+
label: "alignCenterControlLabel",
|
|
158
|
+
icon: (props) => /* @__PURE__ */ React.createElement(IconAlignCenter, __spreadProps(__spreadValues({}, props), {
|
|
159
|
+
stroke: 1.5
|
|
160
|
+
})),
|
|
161
|
+
operation: { name: "setTextAlign", attributes: "center" }
|
|
162
|
+
});
|
|
163
|
+
const AlignJustifyControl = createControl({
|
|
164
|
+
label: "alignJustifyControlLabel",
|
|
165
|
+
icon: (props) => /* @__PURE__ */ React.createElement(IconAlignJustified, __spreadProps(__spreadValues({}, props), {
|
|
166
|
+
stroke: 1.5
|
|
167
|
+
})),
|
|
168
|
+
operation: { name: "setTextAlign", attributes: "justify" }
|
|
169
|
+
});
|
|
170
|
+
const SubscriptControl = createControl({
|
|
171
|
+
label: "subscriptControlLabel",
|
|
172
|
+
icon: (props) => /* @__PURE__ */ React.createElement(IconSubscript, __spreadProps(__spreadValues({}, props), {
|
|
173
|
+
stroke: 1.5
|
|
174
|
+
})),
|
|
175
|
+
isActive: { name: "subscript" },
|
|
176
|
+
operation: { name: "toggleSubscript" }
|
|
177
|
+
});
|
|
178
|
+
const SuperscriptControl = createControl({
|
|
179
|
+
label: "superscriptControlLabel",
|
|
180
|
+
icon: (props) => /* @__PURE__ */ React.createElement(IconSuperscript, __spreadProps(__spreadValues({}, props), {
|
|
181
|
+
stroke: 1.5
|
|
182
|
+
})),
|
|
183
|
+
isActive: { name: "superscript" },
|
|
184
|
+
operation: { name: "toggleSuperscript" }
|
|
185
|
+
});
|
|
186
|
+
const CodeControl = createControl({
|
|
187
|
+
label: "codeControlLabel",
|
|
188
|
+
icon: (props) => /* @__PURE__ */ React.createElement(IconCode, __spreadProps(__spreadValues({}, props), {
|
|
189
|
+
stroke: 1.5
|
|
190
|
+
})),
|
|
191
|
+
isActive: { name: "code" },
|
|
192
|
+
operation: { name: "toggleCode" }
|
|
193
|
+
});
|
|
194
|
+
const CodeBlockControl = createControl({
|
|
195
|
+
label: "codeBlockControlLabel",
|
|
196
|
+
icon: (props) => /* @__PURE__ */ React.createElement(IconCode, __spreadProps(__spreadValues({}, props), {
|
|
197
|
+
stroke: 1.5
|
|
198
|
+
})),
|
|
199
|
+
isActive: { name: "codeBlock" },
|
|
200
|
+
operation: { name: "toggleCodeBlock" }
|
|
201
|
+
});
|
|
202
|
+
const HighlightControl = createControl({
|
|
203
|
+
label: "highlightControlLabel",
|
|
204
|
+
icon: (props) => /* @__PURE__ */ React.createElement(IconHighlight, __spreadProps(__spreadValues({}, props), {
|
|
205
|
+
stroke: 1.5
|
|
206
|
+
})),
|
|
207
|
+
isActive: { name: "highlight" },
|
|
208
|
+
operation: { name: "toggleHighlight" }
|
|
209
|
+
});
|
|
210
|
+
const HrControl = createControl({
|
|
211
|
+
label: "highlightControlLabel",
|
|
212
|
+
icon: (props) => /* @__PURE__ */ React.createElement(IconLineDashed, __spreadProps(__spreadValues({}, props), {
|
|
213
|
+
stroke: 1.5
|
|
214
|
+
})),
|
|
215
|
+
operation: { name: "setHorizontalRule" }
|
|
216
|
+
});
|
|
217
|
+
|
|
218
|
+
export { AlignCenterControl, AlignJustifyControl, AlignLeftControl, AlignRightControl, BlockquoteControl, BoldControl, BulletListControl, ClearFormattingControl, CodeBlockControl, CodeControl, H1Control, H2Control, H3Control, H4Control, H5Control, H6Control, HighlightControl, HrControl, ItalicControl, OrderedListControl, StrikeThoughControl, SubscriptControl, SuperscriptControl, UnderlineControl, UnlinkControl };
|
|
219
|
+
//# sourceMappingURL=controls.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"controls.js","sources":["../../src/controls/controls.tsx"],"sourcesContent":["import React from 'react';\nimport {\n IconBold,\n IconItalic,\n IconUnderline,\n IconStrikethrough,\n IconClearFormatting,\n IconH1,\n IconH2,\n IconH3,\n IconH4,\n IconH5,\n IconH6,\n IconList,\n IconListNumbers,\n IconUnlink,\n IconBlockquote,\n IconAlignLeft,\n IconAlignRight,\n IconAlignCenter,\n IconAlignJustified,\n IconSubscript,\n IconSuperscript,\n IconCode,\n IconHighlight,\n IconLineDashed,\n} from '@tabler/icons';\nimport { createControl } from './ControlBase/create-control';\n\nexport const BoldControl = createControl({\n label: 'boldControlLabel',\n icon: (props) => <IconBold {...props} stroke={1.5} />,\n isActive: { name: 'bold' },\n operation: { name: 'toggleBold' },\n});\n\nexport const ItalicControl = createControl({\n label: 'italicControlLabel',\n icon: (props) => <IconItalic {...props} stroke={1.5} />,\n isActive: { name: 'italic' },\n operation: { name: 'toggleItalic' },\n});\n\nexport const UnderlineControl = createControl({\n label: 'underlineControlLabel',\n icon: (props) => <IconUnderline {...props} stroke={1.5} />,\n isActive: { name: 'underline' },\n operation: { name: 'toggleUnderline' },\n});\n\nexport const StrikeThoughControl = createControl({\n label: 'strikeControlLabel',\n icon: (props) => <IconStrikethrough {...props} stroke={1.5} />,\n isActive: { name: 'strike' },\n operation: { name: 'toggleStrike' },\n});\n\nexport const ClearFormattingControl = createControl({\n label: 'clearFormattingControlLabel',\n icon: (props) => <IconClearFormatting {...props} stroke={1.5} />,\n operation: { name: 'unsetAllMarks' },\n});\n\nexport const UnlinkControl = createControl({\n label: 'unlinkControlLabel',\n icon: (props) => <IconUnlink {...props} stroke={1.5} />,\n operation: { name: 'unsetLink' },\n});\n\nexport const BulletListControl = createControl({\n label: 'bulletListControlLabel',\n icon: (props) => <IconList {...props} stroke={1.5} />,\n isActive: { name: 'bulletList' },\n operation: { name: 'toggleBulletList' },\n});\n\nexport const OrderedListControl = createControl({\n label: 'orderedListControlLabel',\n icon: (props) => <IconListNumbers {...props} stroke={1.5} />,\n isActive: { name: 'orderedList' },\n operation: { name: 'toggleOrderedList' },\n});\n\nexport const H1Control = createControl({\n label: 'h1ControlLabel',\n icon: (props) => <IconH1 {...props} stroke={1.5} />,\n isActive: { name: 'heading', attributes: { level: 1 } },\n operation: { name: 'toggleHeading', attributes: { level: 1 } },\n});\n\nexport const H2Control = createControl({\n label: 'h2ControlLabel',\n icon: (props) => <IconH2 {...props} stroke={1.5} />,\n isActive: { name: 'heading', attributes: { level: 2 } },\n operation: { name: 'toggleHeading', attributes: { level: 2 } },\n});\n\nexport const H3Control = createControl({\n label: 'h3ControlLabel',\n icon: (props) => <IconH3 {...props} stroke={1.5} />,\n isActive: { name: 'heading', attributes: { level: 3 } },\n operation: { name: 'toggleHeading', attributes: { level: 3 } },\n});\n\nexport const H4Control = createControl({\n label: 'h4ControlLabel',\n icon: (props) => <IconH4 {...props} stroke={1.5} />,\n isActive: { name: 'heading', attributes: { level: 4 } },\n operation: { name: 'toggleHeading', attributes: { level: 4 } },\n});\n\nexport const H5Control = createControl({\n label: 'h5ControlLabel',\n icon: (props) => <IconH5 {...props} stroke={1.5} />,\n isActive: { name: 'heading', attributes: { level: 5 } },\n operation: { name: 'toggleHeading', attributes: { level: 5 } },\n});\n\nexport const H6Control = createControl({\n label: 'h6ControlLabel',\n icon: (props) => <IconH6 {...props} stroke={1.5} />,\n isActive: { name: 'heading', attributes: { level: 6 } },\n operation: { name: 'toggleHeading', attributes: { level: 6 } },\n});\n\nexport const BlockquoteControl = createControl({\n label: 'blockquoteControlLabel',\n icon: (props) => <IconBlockquote {...props} stroke={1.5} />,\n isActive: { name: 'blockquote' },\n operation: { name: 'toggleBlockquote' },\n});\n\nexport const AlignLeftControl = createControl({\n label: 'alignLeftControlLabel',\n icon: (props) => <IconAlignLeft {...props} stroke={1.5} />,\n operation: { name: 'setTextAlign', attributes: 'left' },\n});\n\nexport const AlignRightControl = createControl({\n label: 'alignRightControlLabel',\n icon: (props) => <IconAlignRight {...props} stroke={1.5} />,\n operation: { name: 'setTextAlign', attributes: 'right' },\n});\n\nexport const AlignCenterControl = createControl({\n label: 'alignCenterControlLabel',\n icon: (props) => <IconAlignCenter {...props} stroke={1.5} />,\n operation: { name: 'setTextAlign', attributes: 'center' },\n});\n\nexport const AlignJustifyControl = createControl({\n label: 'alignJustifyControlLabel',\n icon: (props) => <IconAlignJustified {...props} stroke={1.5} />,\n operation: { name: 'setTextAlign', attributes: 'justify' },\n});\n\nexport const SubscriptControl = createControl({\n label: 'subscriptControlLabel',\n icon: (props) => <IconSubscript {...props} stroke={1.5} />,\n isActive: { name: 'subscript' },\n operation: { name: 'toggleSubscript' },\n});\n\nexport const SuperscriptControl = createControl({\n label: 'superscriptControlLabel',\n icon: (props) => <IconSuperscript {...props} stroke={1.5} />,\n isActive: { name: 'superscript' },\n operation: { name: 'toggleSuperscript' },\n});\n\nexport const CodeControl = createControl({\n label: 'codeControlLabel',\n icon: (props) => <IconCode {...props} stroke={1.5} />,\n isActive: { name: 'code' },\n operation: { name: 'toggleCode' },\n});\n\nexport const CodeBlockControl = createControl({\n label: 'codeBlockControlLabel',\n icon: (props) => <IconCode {...props} stroke={1.5} />,\n isActive: { name: 'codeBlock' },\n operation: { name: 'toggleCodeBlock' },\n});\n\nexport const HighlightControl = createControl({\n label: 'highlightControlLabel',\n icon: (props) => <IconHighlight {...props} stroke={1.5} />,\n isActive: { name: 'highlight' },\n operation: { name: 'toggleHighlight' },\n});\n\nexport const HrControl = createControl({\n label: 'highlightControlLabel',\n icon: (props) => <IconLineDashed {...props} stroke={1.5} />,\n operation: { name: 'setHorizontalRule' },\n});\n"],"names":[],"mappings":";;;;AAAA,IAAI,SAAS,GAAG,MAAM,CAAC,cAAc,CAAC;AACtC,IAAI,UAAU,GAAG,MAAM,CAAC,gBAAgB,CAAC;AACzC,IAAI,iBAAiB,GAAG,MAAM,CAAC,yBAAyB,CAAC;AACzD,IAAI,mBAAmB,GAAG,MAAM,CAAC,qBAAqB,CAAC;AACvD,IAAI,YAAY,GAAG,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC;AACnD,IAAI,YAAY,GAAG,MAAM,CAAC,SAAS,CAAC,oBAAoB,CAAC;AACzD,IAAI,eAAe,GAAG,CAA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,IAAI,EAAE,CAAC,KAAK,qBAAqB,KAAK,CAAC,aAAa,CAAC,QAAQ,EAAE,aAAa,CAAC,cAAc,CAAC,EAAE,EAAE,KAAK,CAAC,EAAE;AAC1G,IAAI,MAAM,EAAE,GAAG;AACf,GAAG,CAAC,CAAC;AACL,EAAE,QAAQ,EAAE,EAAE,IAAI,EAAE,WAAW,EAAE;AACjC,EAAE,SAAS,EAAE,EAAE,IAAI,EAAE,iBAAiB,EAAE;AACxC,CAAC,EAAE;AACS,MAAC,gBAAgB,GAAG,aAAa,CAAC;AAC9C,EAAE,KAAK,EAAE,uBAAuB;AAChC,EAAE,IAAI,EAAE,CAAC,KAAK,qBAAqB,KAAK,CAAC,aAAa,CAAC,aAAa,EAAE,aAAa,CAAC,cAAc,CAAC,EAAE,EAAE,KAAK,CAAC,EAAE;AAC/G,IAAI,MAAM,EAAE,GAAG;AACf,GAAG,CAAC,CAAC;AACL,EAAE,QAAQ,EAAE,EAAE,IAAI,EAAE,WAAW,EAAE;AACjC,EAAE,SAAS,EAAE,EAAE,IAAI,EAAE,iBAAiB,EAAE;AACxC,CAAC,EAAE;AACS,MAAC,SAAS,GAAG,aAAa,CAAC;AACvC,EAAE,KAAK,EAAE,uBAAuB;AAChC,EAAE,IAAI,EAAE,CAAC,KAAK,qBAAqB,KAAK,CAAC,aAAa,CAAC,cAAc,EAAE,aAAa,CAAC,cAAc,CAAC,EAAE,EAAE,KAAK,CAAC,EAAE;AAChH,IAAI,MAAM,EAAE,GAAG;AACf,GAAG,CAAC,CAAC;AACL,EAAE,SAAS,EAAE,EAAE,IAAI,EAAE,mBAAmB,EAAE;AAC1C,CAAC;;;;"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import TipTapLink from '@tiptap/extension-link';
|
|
2
|
+
|
|
3
|
+
const Link = TipTapLink.extend({
|
|
4
|
+
addKeyboardShortcuts: () => ({
|
|
5
|
+
"Mod-k": () => {
|
|
6
|
+
window.dispatchEvent(new Event("edit-link"));
|
|
7
|
+
return true;
|
|
8
|
+
}
|
|
9
|
+
})
|
|
10
|
+
}).configure({ openOnClick: false });
|
|
11
|
+
|
|
12
|
+
export { Link };
|
|
13
|
+
//# sourceMappingURL=Link.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Link.js","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"],"names":[],"mappings":";;AACY,MAAC,IAAI,GAAG,UAAU,CAAC,MAAM,CAAC;AACtC,EAAE,oBAAoB,EAAE,OAAO;AAC/B,IAAI,OAAO,EAAE,MAAM;AACnB,MAAM,MAAM,CAAC,aAAa,CAAC,IAAI,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC;AACnD,MAAM,OAAO,IAAI,CAAC;AAClB,KAAK;AACL,GAAG,CAAC;AACJ,CAAC,CAAC,CAAC,SAAS,CAAC,EAAE,WAAW,EAAE,KAAK,EAAE;;;;"}
|
package/esm/index.js
ADDED
package/esm/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;"}
|
package/esm/labels.js
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
const DEFAULT_LABELS = {
|
|
2
|
+
linkControlLabel: "Link",
|
|
3
|
+
colorPickerControlLabel: "Text color",
|
|
4
|
+
highlightControlLabel: "Highlight text",
|
|
5
|
+
colorControlLabel: (color) => `Set text color ${color}`,
|
|
6
|
+
boldControlLabel: "Bold",
|
|
7
|
+
italicControlLabel: "Italic",
|
|
8
|
+
underlineControlLabel: "Underline",
|
|
9
|
+
strikeControlLabel: "Strike though",
|
|
10
|
+
clearFormattingControlLabel: "Clear formatting",
|
|
11
|
+
unlinkControlLabel: "Remove link",
|
|
12
|
+
bulletListControlLabel: "Bullet list",
|
|
13
|
+
orderedListControlLabel: "Ordered list",
|
|
14
|
+
h1ControlLabel: "Heading 1",
|
|
15
|
+
h2ControlLabel: "Heading 2",
|
|
16
|
+
h3ControlLabel: "Heading 3",
|
|
17
|
+
h4ControlLabel: "Heading 4",
|
|
18
|
+
h5ControlLabel: "Heading 5",
|
|
19
|
+
h6ControlLabel: "Heading 6",
|
|
20
|
+
blockquoteControlLabel: "Blockquote",
|
|
21
|
+
alignLeftControlLabel: "Align text: left",
|
|
22
|
+
alignCenterControlLabel: "Align text: center",
|
|
23
|
+
alignRightControlLabel: "Align text: right",
|
|
24
|
+
alignJustifyControlLabel: "Align text: justify",
|
|
25
|
+
codeControlLabel: "Code",
|
|
26
|
+
codeBlockControlLabel: "Code block",
|
|
27
|
+
subscriptControlLabel: "Subscript",
|
|
28
|
+
superscriptControlLabel: "Superscript",
|
|
29
|
+
linkEditorInputLabel: "Enter URL",
|
|
30
|
+
linkEditorInputPlaceholder: "https://example.com/",
|
|
31
|
+
linkEditorExternalLink: "Open link in a new tab",
|
|
32
|
+
linkEditorInternalLink: "Open link in the same tab",
|
|
33
|
+
linkEditorSave: "Save",
|
|
34
|
+
colorPickerCancel: "Cancel",
|
|
35
|
+
colorPickerClear: "Clear color",
|
|
36
|
+
colorPickerColorPicker: "Color picker",
|
|
37
|
+
colorPickerPalette: "Color palette",
|
|
38
|
+
colorPickerSave: "Save",
|
|
39
|
+
colorPickerColorLabel: (color) => `Set text color ${color}`
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
export { DEFAULT_LABELS };
|
|
43
|
+
//# sourceMappingURL=labels.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"labels.js","sources":["../src/labels.ts"],"sourcesContent":["export interface RichTextEditorLabels {\n /** RichTextEditor.Bold control aria-label */\n boldControlLabel: string;\n\n /** RichTextEditor.Italic control aria-label */\n italicControlLabel: string;\n\n /** RichTextEditor.Underline control aria-label */\n underlineControlLabel: string;\n\n /** RichTextEditor.Strike control aria-label */\n strikeControlLabel: string;\n\n /** RichTextEditor.ClearFormatting control aria-label */\n clearFormattingControlLabel: string;\n\n /** RichTextEditor.Link control aria-label */\n linkControlLabel: string;\n\n /** RichTextEditor.Unlink control aria-label */\n unlinkControlLabel: string;\n\n /** RichTextEditor.BulletList control aria-label */\n bulletListControlLabel: string;\n\n /** RichTextEditor.OrderedList control aria-label */\n orderedListControlLabel: string;\n\n /** RichTextEditor.H1 control aria-label */\n h1ControlLabel: string;\n\n /** RichTextEditor.H2 control aria-label */\n h2ControlLabel: string;\n\n /** RichTextEditor.H3 control aria-label */\n h3ControlLabel: string;\n\n /** RichTextEditor.H4 control aria-label */\n h4ControlLabel: string;\n\n /** RichTextEditor.H5 control aria-label */\n h5ControlLabel: string;\n\n /** RichTextEditor.H6 control aria-label */\n h6ControlLabel: string;\n\n /** RichTextEditor.Blockquote control aria-label */\n blockquoteControlLabel: string;\n\n /** RichTextEditor.AlignLeft control aria-label */\n alignLeftControlLabel: string;\n\n /** RichTextEditor.AlignCenter control aria-label */\n alignCenterControlLabel: string;\n\n /** RichTextEditor.AlignRight control aria-label */\n alignRightControlLabel: string;\n\n /** RichTextEditor.AlignJustify control aria-label */\n alignJustifyControlLabel: string;\n\n /** RichTextEditor.Code control aria-label */\n codeControlLabel: string;\n\n /** RichTextEditor.CodeBlock control aria-label */\n codeBlockControlLabel: string;\n\n /** RichTextEditor.Subscript control aria-label */\n subscriptControlLabel: string;\n\n /** RichTextEditor.Superscript control aria-label */\n superscriptControlLabel: string;\n\n /** RichTextEditor.ColorPicker control aria-label */\n colorPickerControlLabel: string;\n\n /** RichTextEditor.Highlight control aria-label */\n highlightControlLabel: string;\n\n /** A function go get RichTextEditor.Color control aria-label based on color that control applies */\n colorControlLabel(color: string): string;\n\n /** aria-label for link editor url input */\n linkEditorInputLabel: string;\n\n /** placeholder for link editor url input */\n linkEditorInputPlaceholder: string;\n\n /** Content of external button tooltip in link editor when the link was chosen to open in a new tab */\n linkEditorExternalLink: string;\n\n /** Content of external button tooltip in link editor when the link was chosen to open in the same tab */\n linkEditorInternalLink: string;\n\n /** Save button content in link editor */\n linkEditorSave: string;\n\n /** Cancel button tooltip text in color picker control */\n colorPickerCancel: string;\n\n /** Clear button tooltip text in color picker control */\n colorPickerClear: string;\n\n /** Color picker button tooltip text in color picker control */\n colorPickerColorPicker: string;\n\n /** Palette button tooltip text in color picker control */\n colorPickerPalette: string;\n\n /** Save button tooltip 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: 'Strike though',\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\n // Link editor\n linkEditorInputLabel: 'Enter URL',\n linkEditorInputPlaceholder: 'https://example.com/',\n linkEditorExternalLink: 'Open link in a new tab',\n linkEditorInternalLink: 'Open link in the same tab',\n linkEditorSave: 'Save',\n\n // Color picker control\n colorPickerCancel: 'Cancel',\n colorPickerClear: 'Clear color',\n colorPickerColorPicker: 'Color picker',\n colorPickerPalette: 'Color palette',\n colorPickerSave: 'Save',\n colorPickerColorLabel: (color) => `Set text color ${color}`,\n};\n"],"names":[],"mappings":"AAAY,MAAC,cAAc,GAAG;AAC9B,EAAE,gBAAgB,EAAE,MAAM;AAC1B,EAAE,uBAAuB,EAAE,YAAY;AACvC,EAAE,qBAAqB,EAAE,gBAAgB;AACzC,EAAE,iBAAiB,EAAE,CAAC,KAAK,KAAK,CAAC,eAAe,EAAE,KAAK,CAAC,CAAC;AACzD,EAAE,gBAAgB,EAAE,MAAM;AAC1B,EAAE,kBAAkB,EAAE,QAAQ;AAC9B,EAAE,qBAAqB,EAAE,WAAW;AACpC,EAAE,kBAAkB,EAAE,eAAe;AACrC,EAAE,2BAA2B,EAAE,kBAAkB;AACjD,EAAE,kBAAkB,EAAE,aAAa;AACnC,EAAE,sBAAsB,EAAE,aAAa;AACvC,EAAE,uBAAuB,EAAE,cAAc;AACzC,EAAE,cAAc,EAAE,WAAW;AAC7B,EAAE,cAAc,EAAE,WAAW;AAC7B,EAAE,cAAc,EAAE,WAAW;AAC7B,EAAE,cAAc,EAAE,WAAW;AAC7B,EAAE,cAAc,EAAE,WAAW;AAC7B,EAAE,cAAc,EAAE,WAAW;AAC7B,EAAE,sBAAsB,EAAE,YAAY;AACtC,EAAE,qBAAqB,EAAE,kBAAkB;AAC3C,EAAE,uBAAuB,EAAE,oBAAoB;AAC/C,EAAE,sBAAsB,EAAE,mBAAmB;AAC7C,EAAE,wBAAwB,EAAE,qBAAqB;AACjD,EAAE,gBAAgB,EAAE,MAAM;AAC1B,EAAE,qBAAqB,EAAE,YAAY;AACrC,EAAE,qBAAqB,EAAE,WAAW;AACpC,EAAE,uBAAuB,EAAE,aAAa;AACxC,EAAE,oBAAoB,EAAE,WAAW;AACnC,EAAE,0BAA0B,EAAE,sBAAsB;AACpD,EAAE,sBAAsB,EAAE,wBAAwB;AAClD,EAAE,sBAAsB,EAAE,2BAA2B;AACrD,EAAE,cAAc,EAAE,MAAM;AACxB,EAAE,iBAAiB,EAAE,QAAQ;AAC7B,EAAE,gBAAgB,EAAE,aAAa;AACjC,EAAE,sBAAsB,EAAE,cAAc;AACxC,EAAE,kBAAkB,EAAE,eAAe;AACrC,EAAE,eAAe,EAAE,MAAM;AACzB,EAAE,qBAAqB,EAAE,CAAC,KAAK,KAAK,CAAC,eAAe,EAAE,KAAK,CAAC,CAAC;AAC7D;;;;"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { DefaultProps, Selectors } from '@mantine/core';
|
|
3
|
+
import useStyles from './Content.styles';
|
|
4
|
+
export declare type ContentStylesNames = Selectors<typeof useStyles>;
|
|
5
|
+
export interface RichTextEditorContentProps extends DefaultProps, React.ComponentPropsWithoutRef<'div'> {
|
|
6
|
+
}
|
|
7
|
+
export declare const Content: React.ForwardRefExoticComponent<RichTextEditorContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
8
|
+
//# sourceMappingURL=Content.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Content.d.ts","sourceRoot":"","sources":["../../src/Content/Content.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAC1C,OAAO,EAEL,YAAY,EAEZ,SAAS,EAGV,MAAM,eAAe,CAAC;AAGvB,OAAO,SAAS,MAAM,kBAAkB,CAAC;AAEzC,oBAAY,kBAAkB,GAAG,SAAS,CAAC,OAAO,SAAS,CAAC,CAAC;AAE7D,MAAM,WAAW,0BACf,SAAQ,YAAY,EAClB,KAAK,CAAC,wBAAwB,CAAC,KAAK,CAAC;CAAG;AAI5C,eAAO,MAAM,OAAO,mGAuBlB,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { MantineTheme } from '@mantine/core';
|
|
2
|
+
interface ContentStylesParams {
|
|
3
|
+
withCodeHighlightStyles: boolean;
|
|
4
|
+
withTypographyStyles: boolean;
|
|
5
|
+
}
|
|
6
|
+
declare const _default: (params: ContentStylesParams, options?: import("@mantine/core").UseStylesOptions<"content" | "typographyStylesProvider">) => {
|
|
7
|
+
classes: Record<"content" | "typographyStylesProvider", string>;
|
|
8
|
+
cx: (...args: any) => string;
|
|
9
|
+
theme: MantineTheme;
|
|
10
|
+
};
|
|
11
|
+
export default _default;
|
|
12
|
+
//# sourceMappingURL=Content.styles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Content.styles.d.ts","sourceRoot":"","sources":["../../src/Content/Content.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,YAAY,EAAE,MAAM,eAAe,CAAC;AAE3D,UAAU,mBAAmB;IAC3B,uBAAuB,EAAE,OAAO,CAAC;IACjC,oBAAoB,EAAE,OAAO,CAAC;CAC/B;;;;;;AA6FD,wBAoBE"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Editor } from '@tiptap/react';
|
|
2
|
+
import { RichTextEditorLabels } from './labels';
|
|
3
|
+
interface RichTextEditorContext {
|
|
4
|
+
editor: Editor;
|
|
5
|
+
labels: RichTextEditorLabels;
|
|
6
|
+
withCodeHighlightStyles: boolean;
|
|
7
|
+
withTypographyStyles: boolean;
|
|
8
|
+
}
|
|
9
|
+
export declare const RichTextEditorProvider: ({ children, value }: {
|
|
10
|
+
value: RichTextEditorContext;
|
|
11
|
+
children: import("react").ReactNode;
|
|
12
|
+
}) => JSX.Element, useRichTextEditorContext: () => RichTextEditorContext;
|
|
13
|
+
export {};
|
|
14
|
+
//# sourceMappingURL=RichTextEditor.context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RichTextEditor.context.d.ts","sourceRoot":"","sources":["../src/RichTextEditor.context.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACvC,OAAO,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAEhD,UAAU,qBAAqB;IAC7B,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,oBAAoB,CAAC;IAC7B,uBAAuB,EAAE,OAAO,CAAC;IACjC,oBAAoB,EAAE,OAAO,CAAC;CAC/B;AAED,eAAO,MAAO,sBAAsB;;;mBAAE,wBAAwB,6BACoB,CAAC"}
|