@mekari/pixel3-rich-text-editor 0.0.7 → 0.0.8-dev.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.
Files changed (58) hide show
  1. package/dist/chunk-IYCO25GF.mjs +152 -0
  2. package/dist/chunk-JAKI6TU2.mjs +104 -0
  3. package/dist/chunk-JHFPEZ7I.mjs +74 -0
  4. package/dist/chunk-P5KVIGAP.mjs +204 -0
  5. package/dist/{chunk-HB4A6A3W.mjs → chunk-PLASPZGG.mjs} +28 -20
  6. package/dist/chunk-RNQQ7LGC.mjs +342 -0
  7. package/dist/chunk-V52XUOVW.mjs +64 -0
  8. package/dist/{chunk-Y2B3Z5EO.mjs → chunk-WBMECFO3.mjs} +31 -23
  9. package/dist/editor-toolbar.d.mts +16 -4
  10. package/dist/editor-toolbar.d.ts +16 -4
  11. package/dist/editor-toolbar.js +522 -166
  12. package/dist/editor-toolbar.mjs +8 -6
  13. package/dist/extensions/align-extension.d.mts +14 -4
  14. package/dist/extensions/align-extension.d.ts +14 -4
  15. package/dist/extensions/align-extension.js +138 -103
  16. package/dist/extensions/align-extension.mjs +2 -2
  17. package/dist/extensions/color-extension.d.mts +28 -0
  18. package/dist/extensions/color-extension.d.ts +28 -0
  19. package/dist/extensions/color-extension.js +415 -0
  20. package/dist/extensions/color-extension.mjs +8 -0
  21. package/dist/extensions/heading-extension.d.mts +14 -4
  22. package/dist/extensions/heading-extension.d.ts +14 -4
  23. package/dist/extensions/heading-extension.js +139 -74
  24. package/dist/extensions/heading-extension.mjs +2 -2
  25. package/dist/extensions/icons.d.mts +4 -1
  26. package/dist/extensions/icons.d.ts +4 -1
  27. package/dist/extensions/icons.js +114 -51
  28. package/dist/extensions/icons.mjs +7 -1
  29. package/dist/extensions/index.d.mts +3 -0
  30. package/dist/extensions/index.d.ts +3 -0
  31. package/dist/extensions/index.js +454 -130
  32. package/dist/extensions/index.mjs +13 -5
  33. package/dist/extensions/link-extension.d.mts +22 -0
  34. package/dist/extensions/link-extension.d.ts +22 -0
  35. package/dist/extensions/link-extension.js +546 -0
  36. package/dist/extensions/link-extension.mjs +8 -0
  37. package/dist/extensions/single-extension.d.mts +29 -10
  38. package/dist/extensions/single-extension.d.ts +29 -10
  39. package/dist/extensions/single-extension.js +134 -57
  40. package/dist/extensions/single-extension.mjs +2 -2
  41. package/dist/index.js +562 -201
  42. package/dist/index.mjs +9 -7
  43. package/dist/metafile-cjs.json +1 -1
  44. package/dist/metafile-esm.json +1 -1
  45. package/dist/modules/rich-text-editor.props.d.mts +3 -5
  46. package/dist/modules/rich-text-editor.props.d.ts +3 -5
  47. package/dist/modules/rich-text-editor.types.d.mts +4 -3
  48. package/dist/modules/rich-text-editor.types.d.ts +4 -3
  49. package/dist/rich-text-editor.d.mts +4 -5
  50. package/dist/rich-text-editor.d.ts +4 -5
  51. package/dist/rich-text-editor.js +562 -201
  52. package/dist/rich-text-editor.mjs +9 -7
  53. package/package.json +14 -6
  54. package/dist/chunk-J5QZDLNA.mjs +0 -282
  55. package/dist/chunk-MMFX326I.mjs +0 -44
  56. package/dist/chunk-O5NDSZL6.mjs +0 -124
  57. package/dist/chunk-SUI7NBPF.mjs +0 -107
  58. /package/dist/{chunk-CE52CW3F.mjs → chunk-VYCDVS5I.mjs} +0 -0
@@ -0,0 +1,152 @@
1
+ import {
2
+ LinkExtension
3
+ } from "./chunk-P5KVIGAP.mjs";
4
+ import {
5
+ SingleExtention
6
+ } from "./chunk-V52XUOVW.mjs";
7
+ import {
8
+ AlignExtention
9
+ } from "./chunk-JAKI6TU2.mjs";
10
+ import {
11
+ ColorExtension
12
+ } from "./chunk-JHFPEZ7I.mjs";
13
+ import {
14
+ HeadingExtention
15
+ } from "./chunk-WBMECFO3.mjs";
16
+ import {
17
+ __name
18
+ } from "./chunk-QZ7VFGWC.mjs";
19
+
20
+ // src/editor-toolbar.tsx
21
+ import { Fragment as _Fragment, createVNode as _createVNode } from "vue";
22
+ import { defineComponent } from "vue";
23
+ import { MpDivider } from "@mekari/pixel3-divider";
24
+ var EditorToolbar = defineComponent({
25
+ name: "EditorToolbar",
26
+ props: {
27
+ editor: {
28
+ type: Object
29
+ },
30
+ options: {
31
+ type: Array
32
+ }
33
+ },
34
+ setup({
35
+ editor,
36
+ options
37
+ }) {
38
+ const items = ["heading", "bold", "italic", "underline", "strike", "blockquote", "bulletList", "orderedList", "textColor", "fillColor", "textLink", "align", "undo", "redo", "clear"];
39
+ const itemOptions = {
40
+ heading: {
41
+ tooltipLabel: "Text style",
42
+ editor
43
+ },
44
+ bold: {
45
+ tooltipLabel: "Bold",
46
+ onClick: () => (editor == null ? void 0 : editor.chain()).focus().toggleBold().run()
47
+ },
48
+ italic: {
49
+ tooltipLabel: "Italic",
50
+ onClick: () => (editor == null ? void 0 : editor.chain()).focus().toggleItalic().run()
51
+ },
52
+ underline: {
53
+ tooltipLabel: "Underline",
54
+ onClick: () => (editor == null ? void 0 : editor.chain()).focus().toggleUnderline().run()
55
+ },
56
+ strike: {
57
+ tooltipLabel: "Strike",
58
+ onClick: () => (editor == null ? void 0 : editor.chain()).focus().toggleStrike().run()
59
+ },
60
+ blockquote: {
61
+ tooltipLabel: "Blockquote",
62
+ onClick: () => (editor == null ? void 0 : editor.chain()).focus().toggleBlockquote().run()
63
+ },
64
+ bulletList: {
65
+ tooltipLabel: "Bullet list",
66
+ onClick: () => (editor == null ? void 0 : editor.chain()).focus().toggleBulletList().run()
67
+ },
68
+ orderedList: {
69
+ tooltipLabel: "Number list",
70
+ onClick: () => (editor == null ? void 0 : editor.chain()).focus().toggleOrderedList().run()
71
+ },
72
+ textColor: {
73
+ tooltipLabel: "Text color",
74
+ editor,
75
+ type: "text"
76
+ },
77
+ fillColor: {
78
+ tooltipLabel: "Fill color",
79
+ editor,
80
+ type: "fill"
81
+ },
82
+ textLink: {
83
+ tooltipLabel: "Insert link",
84
+ editor
85
+ },
86
+ align: {
87
+ tooltipLabel: "Text alignment",
88
+ editor
89
+ },
90
+ undo: {
91
+ tooltipLabel: "Undo",
92
+ onClick: () => (editor == null ? void 0 : editor.chain()).focus().undo().run()
93
+ },
94
+ redo: {
95
+ tooltipLabel: "Redo",
96
+ onClick: () => (editor == null ? void 0 : editor.chain()).focus().redo().run()
97
+ },
98
+ clear: {
99
+ tooltipLabel: "Reset format",
100
+ onClick: () => (editor == null ? void 0 : editor.chain()).focus().unsetAllMarks().run()
101
+ }
102
+ };
103
+ const renderExtension = /* @__PURE__ */ __name((item) => {
104
+ const options2 = itemOptions[item];
105
+ if (!options2)
106
+ return null;
107
+ switch (item) {
108
+ case "heading":
109
+ return _createVNode(HeadingExtention, {
110
+ "tooltipLabel": options2.tooltipLabel,
111
+ "editor": editor
112
+ }, null);
113
+ case "align":
114
+ return _createVNode(AlignExtention, {
115
+ "tooltipLabel": options2.tooltipLabel,
116
+ "editor": editor
117
+ }, null);
118
+ case "textColor":
119
+ case "fillColor":
120
+ return _createVNode(ColorExtension, {
121
+ "tooltipLabel": options2.tooltipLabel,
122
+ "editor": editor,
123
+ "type": options2.type
124
+ }, null);
125
+ case "textLink":
126
+ return _createVNode(LinkExtension, {
127
+ "tooltipLabel": options2.tooltipLabel,
128
+ "editor": editor
129
+ }, null);
130
+ default:
131
+ return _createVNode(SingleExtention, {
132
+ "name": item,
133
+ "tooltipLabel": options2.tooltipLabel,
134
+ "onClick": options2.onClick,
135
+ "editor": editor
136
+ }, null);
137
+ }
138
+ }, "renderExtension");
139
+ return () => _createVNode("div", null, [options == null ? void 0 : options.map((option, index) => _createVNode(_Fragment, null, [option.map((item) => {
140
+ if (items.includes(item)) {
141
+ return renderExtension(item);
142
+ }
143
+ }), index !== (options == null ? void 0 : options.length) - 1 && _createVNode(MpDivider, {
144
+ "id": "divider-toolbar",
145
+ "orientation": "vertical"
146
+ }, null)]))]);
147
+ }
148
+ });
149
+
150
+ export {
151
+ EditorToolbar
152
+ };
@@ -0,0 +1,104 @@
1
+ import {
2
+ AlignCenterIcon,
3
+ AlignJustifyIcon,
4
+ AlignLeftIcon,
5
+ AlignRightIcon
6
+ } from "./chunk-RNQQ7LGC.mjs";
7
+ import {
8
+ __name
9
+ } from "./chunk-QZ7VFGWC.mjs";
10
+
11
+ // src/extensions/align-extension.tsx
12
+ import { withDirectives as _withDirectives, resolveDirective as _resolveDirective, createVNode as _createVNode } from "vue";
13
+ import { defineComponent } from "vue";
14
+ import { MpPopover, MpPopoverTrigger, MpPopoverContent, MpPopoverList, MpPopoverListItem } from "@mekari/pixel3-popover";
15
+ import { css } from "@mekari/pixel3-styled-system/css";
16
+ var AlignExtention = defineComponent({
17
+ name: "AlignExtention",
18
+ props: {
19
+ tooltipLabel: {
20
+ type: String
21
+ },
22
+ editor: {
23
+ type: Object
24
+ }
25
+ },
26
+ setup({
27
+ tooltipLabel,
28
+ editor
29
+ }) {
30
+ const isActiveAlignment = /* @__PURE__ */ __name((alignment) => {
31
+ return editor == null ? void 0 : editor.isActive({
32
+ textAlign: alignment
33
+ });
34
+ }, "isActiveAlignment");
35
+ return () => _createVNode(MpPopover, {
36
+ "id": "popover-align-extention"
37
+ }, {
38
+ default: () => [_createVNode(MpPopoverTrigger, null, {
39
+ default: () => [_withDirectives(_createVNode("button", {
40
+ "class": {
41
+ "is-active": isActiveAlignment("left") || isActiveAlignment("right") || isActiveAlignment("center") || isActiveAlignment("justify"),
42
+ "text-sizing": true
43
+ },
44
+ "style": {
45
+ padding: "4px"
46
+ }
47
+ }, [isActiveAlignment("left") && _createVNode(AlignLeftIcon, null, null), isActiveAlignment("center") && _createVNode(AlignCenterIcon, null, null), isActiveAlignment("right") && _createVNode(AlignRightIcon, null, null), isActiveAlignment("justify") && _createVNode(AlignJustifyIcon, null, null), !isActiveAlignment("left") && !isActiveAlignment("right") && !isActiveAlignment("center") && !isActiveAlignment("justify") && _createVNode(AlignLeftIcon, null, null)]), [[_resolveDirective("tooltip"), {
48
+ label: tooltipLabel
49
+ }]])]
50
+ }), _createVNode(MpPopoverContent, {
51
+ "class": css({
52
+ width: "46px",
53
+ maxWidth: "46px",
54
+ maxHeight: "300px"
55
+ })
56
+ }, {
57
+ default: () => [_createVNode(MpPopoverList, {
58
+ "class": css({
59
+ gap: "2",
60
+ alignItems: "center"
61
+ })
62
+ }, {
63
+ default: () => [_createVNode(MpPopoverListItem, {
64
+ "class": {
65
+ "is-active": isActiveAlignment("left"),
66
+ "text-sizing": true
67
+ },
68
+ "onClick": () => (editor == null ? void 0 : editor.chain()).focus().setTextAlign("left").run()
69
+ }, {
70
+ default: () => [_createVNode(AlignLeftIcon, null, null)]
71
+ }), _createVNode(MpPopoverListItem, {
72
+ "class": {
73
+ "is-active": isActiveAlignment("center"),
74
+ "text-sizing": true
75
+ },
76
+ "onClick": () => (editor == null ? void 0 : editor.chain()).focus().setTextAlign("center").run()
77
+ }, {
78
+ default: () => [_createVNode(AlignCenterIcon, null, null)]
79
+ }), _createVNode(MpPopoverListItem, {
80
+ "class": {
81
+ "is-active": isActiveAlignment("right"),
82
+ "text-sizing": true
83
+ },
84
+ "onClick": () => (editor == null ? void 0 : editor.chain()).focus().setTextAlign("right").run()
85
+ }, {
86
+ default: () => [_createVNode(AlignRightIcon, null, null)]
87
+ }), _createVNode(MpPopoverListItem, {
88
+ "class": {
89
+ "is-active": isActiveAlignment("justify"),
90
+ "text-sizing": true
91
+ },
92
+ "onClick": () => (editor == null ? void 0 : editor.chain()).focus().setTextAlign("justify").run()
93
+ }, {
94
+ default: () => [_createVNode(AlignJustifyIcon, null, null)]
95
+ })]
96
+ })]
97
+ })]
98
+ });
99
+ }
100
+ });
101
+
102
+ export {
103
+ AlignExtention
104
+ };
@@ -0,0 +1,74 @@
1
+ import {
2
+ ColorTextIcon,
3
+ FillTextIcon
4
+ } from "./chunk-RNQQ7LGC.mjs";
5
+ import {
6
+ __name
7
+ } from "./chunk-QZ7VFGWC.mjs";
8
+
9
+ // src/extensions/color-extension.tsx
10
+ import { withDirectives as _withDirectives, resolveDirective as _resolveDirective, createVNode as _createVNode } from "vue";
11
+ import { defineComponent, ref } from "vue";
12
+ import { MpColorPicker } from "@mekari/pixel3-color-picker";
13
+ import { css } from "@mekari/pixel3-styled-system/css";
14
+ var colorPreset = ["#3B82F6", "#14B8A6", "#8B5CF6", "#F59E0B", "#EF4444", "#71717A", "#84CC16", "#EC4899", "#232933", "#FFFFFF"];
15
+ var ColorExtension = defineComponent({
16
+ name: "ColorExtension",
17
+ props: {
18
+ tooltipLabel: {
19
+ type: String
20
+ },
21
+ editor: {
22
+ type: Object
23
+ },
24
+ type: {
25
+ type: String
26
+ }
27
+ },
28
+ setup({
29
+ tooltipLabel,
30
+ type,
31
+ editor
32
+ }) {
33
+ const color = ref("");
34
+ const onColorChange = /* @__PURE__ */ __name((value) => {
35
+ color.value = value.hex;
36
+ if (type === "fill") {
37
+ (editor == null ? void 0 : editor.chain()).focus().toggleHighlight({
38
+ color: value.hex
39
+ }).run();
40
+ } else {
41
+ (editor == null ? void 0 : editor.chain()).focus().setColor(value.hex).run();
42
+ }
43
+ }, "onColorChange");
44
+ return () => _createVNode("button", {
45
+ "class": [{
46
+ "is-active": type === "fill" ? editor == null ? void 0 : editor.isActive("highlight", {
47
+ color: editor.getAttributes("highlight").color
48
+ }) : editor == null ? void 0 : editor.isActive("textStyle", {
49
+ color: editor.getAttributes("textStyle").color
50
+ })
51
+ }, css({
52
+ textAlign: "left"
53
+ })]
54
+ }, [_createVNode(MpColorPicker, {
55
+ "preset": colorPreset,
56
+ "variant": "basic",
57
+ "placement": "bottom-start",
58
+ "isShowPreset": true,
59
+ "isShowInput": false,
60
+ "class": css({
61
+ width: "auto!"
62
+ }),
63
+ "onChange": onColorChange
64
+ }, {
65
+ default: () => [_withDirectives(_createVNode("div", null, [type === "fill" ? _createVNode(FillTextIcon, null, null) : _createVNode(ColorTextIcon, null, null)]), [[_resolveDirective("tooltip"), {
66
+ label: tooltipLabel
67
+ }]])]
68
+ })]);
69
+ }
70
+ });
71
+
72
+ export {
73
+ ColorExtension
74
+ };
@@ -0,0 +1,204 @@
1
+ import {
2
+ LinkIcon
3
+ } from "./chunk-RNQQ7LGC.mjs";
4
+ import {
5
+ __name
6
+ } from "./chunk-QZ7VFGWC.mjs";
7
+
8
+ // src/extensions/link-extension.tsx
9
+ import { withDirectives as _withDirectives, resolveDirective as _resolveDirective, createVNode as _createVNode, Fragment as _Fragment } from "vue";
10
+ import { defineComponent, ref, onMounted, onBeforeUnmount, nextTick, Teleport } from "vue";
11
+ import { createPopper } from "@popperjs/core";
12
+ import { css } from "@mekari/pixel3-styled-system/css";
13
+ import { MpInput } from "@mekari/pixel3-input";
14
+ import { MpButton } from "@mekari/pixel3-button";
15
+ var LinkExtension = defineComponent({
16
+ name: "LinkExtension",
17
+ props: {
18
+ tooltipLabel: {
19
+ type: String
20
+ },
21
+ editor: {
22
+ type: Object
23
+ }
24
+ },
25
+ setup({
26
+ tooltipLabel,
27
+ editor
28
+ }) {
29
+ const isShowPopover = ref(false);
30
+ const isEditLink = ref(false);
31
+ const popoverRef = ref(null);
32
+ const inputRef = ref(null);
33
+ const url = ref("");
34
+ let popperInstance = null;
35
+ let linkElement = null;
36
+ let lastClickedElement = null;
37
+ const onClickOutside = /* @__PURE__ */ __name((event) => {
38
+ if (popoverRef.value && !popoverRef.value.contains(event.target) && event.target !== lastClickedElement) {
39
+ onClosePopover();
40
+ }
41
+ }, "onClickOutside");
42
+ const onOpenPopover = /* @__PURE__ */ __name((target) => {
43
+ isShowPopover.value = true;
44
+ isEditLink.value = target.tagName === "A";
45
+ if (target)
46
+ lastClickedElement = target;
47
+ nextTick(() => {
48
+ var _a;
49
+ if (popoverRef.value) {
50
+ if (popperInstance) {
51
+ popperInstance.destroy();
52
+ }
53
+ popperInstance = createPopper(target, popoverRef.value, {
54
+ onFirstUpdate: () => {
55
+ if (popperInstance) {
56
+ popperInstance.setOptions({
57
+ modifiers: [{
58
+ name: "eventListeners",
59
+ enabled: false
60
+ }, {
61
+ name: "offset",
62
+ options: {
63
+ offset: [0, 8]
64
+ }
65
+ }]
66
+ });
67
+ }
68
+ },
69
+ placement: "bottom"
70
+ });
71
+ }
72
+ const inputElement = (_a = popoverRef.value) == null ? void 0 : _a.querySelector("input");
73
+ if (inputElement)
74
+ inputElement.focus();
75
+ document.addEventListener("mousedown", onClickOutside);
76
+ });
77
+ }, "onOpenPopover");
78
+ const onCreateLink = /* @__PURE__ */ __name(() => {
79
+ const selection = editor == null ? void 0 : editor.view.state.selection;
80
+ if (selection && selection.from !== selection.to) {
81
+ const coords = editor.view.coordsAtPos(selection.from);
82
+ url.value = "";
83
+ onOpenPopover({
84
+ getBoundingClientRect: () => ({
85
+ top: coords.top,
86
+ left: coords.left,
87
+ bottom: coords.bottom,
88
+ right: coords.right,
89
+ width: coords.right - coords.left,
90
+ height: coords.bottom - coords.top
91
+ })
92
+ });
93
+ }
94
+ }, "onCreateLink");
95
+ const onEditLink = /* @__PURE__ */ __name(() => {
96
+ isEditLink.value = false;
97
+ }, "onEditLink");
98
+ const onUnlink = /* @__PURE__ */ __name(() => {
99
+ (editor == null ? void 0 : editor.chain()).focus().unsetLink().run();
100
+ onClosePopover();
101
+ }, "onUnlink");
102
+ const onSetLink = /* @__PURE__ */ __name(() => {
103
+ if (url.value && editor) {
104
+ editor.chain().focus().extendMarkRange("link").setLink({
105
+ href: url.value
106
+ }).run();
107
+ }
108
+ onClosePopover();
109
+ }, "onSetLink");
110
+ const onClosePopover = /* @__PURE__ */ __name(() => {
111
+ isShowPopover.value = false;
112
+ editor == null ? void 0 : editor.commands.setTextSelection({
113
+ from: 0,
114
+ to: 0
115
+ });
116
+ if (popperInstance) {
117
+ popperInstance.destroy();
118
+ popperInstance = null;
119
+ }
120
+ document.removeEventListener("mousedown", onClickOutside);
121
+ }, "onClosePopover");
122
+ onMounted(() => {
123
+ editor == null ? void 0 : editor.view.dom.addEventListener("click", (event) => {
124
+ const link = event.target.closest("a");
125
+ if (link) {
126
+ event.preventDefault();
127
+ linkElement = link;
128
+ url.value = linkElement.href;
129
+ onOpenPopover(linkElement);
130
+ }
131
+ });
132
+ });
133
+ onBeforeUnmount(() => {
134
+ if (popperInstance) {
135
+ popperInstance.destroy();
136
+ }
137
+ document.removeEventListener("mousedown", onClickOutside);
138
+ });
139
+ return () => _createVNode(_Fragment, null, [_withDirectives(_createVNode("button", {
140
+ "class": {
141
+ "is-active": editor == null ? void 0 : editor.isActive("link")
142
+ },
143
+ "disabled": isShowPopover.value,
144
+ "onClick": onCreateLink
145
+ }, [_createVNode(LinkIcon, null, null)]), [[_resolveDirective("tooltip"), {
146
+ label: tooltipLabel
147
+ }]]), isShowPopover.value && _createVNode(Teleport, {
148
+ "to": "body"
149
+ }, {
150
+ default: () => [_createVNode("div", {
151
+ "ref": popoverRef,
152
+ "data-pixel-rte": true,
153
+ "style": {
154
+ position: "absolute",
155
+ zIndex: "var(--mp-z-index-popover)"
156
+ }
157
+ }, [_createVNode("div", {
158
+ "class": css({
159
+ display: "flex",
160
+ gap: "2",
161
+ backgroundColor: "white",
162
+ border: "1px solid",
163
+ borderColor: "gray.400",
164
+ borderRadius: "md",
165
+ boxShadow: "lg",
166
+ padding: "2"
167
+ })
168
+ }, [_createVNode(MpInput, {
169
+ "ref": inputRef,
170
+ "class": css({
171
+ width: "212px",
172
+ marginRight: "1"
173
+ }),
174
+ "modelValue": url.value,
175
+ "onUpdate:modelValue": ($event) => url.value = $event,
176
+ "placeholder": "Insert URL here",
177
+ "isDisabled": isEditLink.value,
178
+ "onKeyup": (event) => {
179
+ if (event.key === "Enter")
180
+ onSetLink();
181
+ }
182
+ }, null), isEditLink.value ? _createVNode(MpButton, {
183
+ "leftIcon": "edit",
184
+ "variant": "ghost",
185
+ "onClick": onEditLink
186
+ }, null) : _createVNode(MpButton, {
187
+ "leftIcon": "check",
188
+ "onClick": onSetLink
189
+ }, null), isEditLink.value ? _createVNode(MpButton, {
190
+ "leftIcon": "delete",
191
+ "variant": "ghost",
192
+ "onClick": onUnlink
193
+ }, null) : _createVNode(MpButton, {
194
+ "leftIcon": "close",
195
+ "variant": "ghost",
196
+ "onClick": onClosePopover
197
+ }, null)])])]
198
+ })]);
199
+ }
200
+ });
201
+
202
+ export {
203
+ LinkExtension
204
+ };
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  EditorToolbar
3
- } from "./chunk-SUI7NBPF.mjs";
3
+ } from "./chunk-IYCO25GF.mjs";
4
4
  import {
5
5
  MpRTEStyleProvider
6
6
  } from "./chunk-JAMH4XOS.mjs";
@@ -19,7 +19,11 @@ import { Editor, EditorContent } from "@tiptap/vue-3";
19
19
  import StarterKit from "@tiptap/starter-kit";
20
20
  import Underline from "@tiptap/extension-underline";
21
21
  import TextAlign from "@tiptap/extension-text-align";
22
+ import TextStyle from "@tiptap/extension-text-style";
22
23
  import Placeholder from "@tiptap/extension-placeholder";
24
+ import { Color } from "@tiptap/extension-color";
25
+ import Link from "@tiptap/extension-link";
26
+ import Highlight from "@tiptap/extension-highlight";
23
27
  import { token } from "@mekari/pixel3-styled-system/tokens";
24
28
  import { useFormControlContext } from "@mekari/pixel3-form-control";
25
29
  var MpRichTextEditor = defineComponent({
@@ -41,6 +45,12 @@ var MpRichTextEditor = defineComponent({
41
45
  }
42
46
  }), Underline, TextAlign.configure({
43
47
  types: ["heading", "paragraph"]
48
+ }), TextStyle, Color.configure({
49
+ types: ["textStyle"]
50
+ }), Highlight.configure({
51
+ multicolor: true
52
+ }), Link.configure({
53
+ openOnClick: false
44
54
  }), Placeholder.configure({
45
55
  placeholder: api.value.placeholder || ""
46
56
  })],
@@ -64,25 +74,23 @@ var MpRichTextEditor = defineComponent({
64
74
  emit("change", editor2.getHTML(), editor2);
65
75
  }
66
76
  });
67
- return () => {
68
- return _createVNode("div", _mergeProps(api.value.rootProps, {
69
- "style": {
70
- "--mp-rich-text-editor--border-color-hover": (formControlProp == null ? void 0 : formControlProp.value.isInvalid) || api.value.isInvalid ? token.var("colors.red.400") : isFocused.value ? token.var("colors.blue.400") : token.var("colors.gray.400"),
71
- "--mp-rich-text-editor--border-color": (formControlProp == null ? void 0 : formControlProp.value.isInvalid) || api.value.isInvalid ? token.var("colors.red.400") : isFocused.value ? token.var("colors.blue.400") : token.var("colors.gray.100"),
72
- "--mp-rich-text-editor--box-shadow": isFocused.value ? token.var("shadows.outer") : void 0,
73
- "--mp-rich-text-editor--background-color": (formControlProp == null ? void 0 : formControlProp.value.isDisabled) || api.value.isDisabled ? token.var("colors.gray.50") : token.var("colors.white")
74
- }
75
- }), [_createVNode(EditorToolbar, _mergeProps({
76
- "editor": editor,
77
- "options": api.value.options
78
- }, api.value.toolbarProps), null), _createVNode(MpRTEStyleProvider, {
79
- "id": api.value.id
80
- }, {
81
- default: () => [_createVNode(EditorContent, _mergeProps({
82
- "editor": editor
83
- }, api.value.areaProps), null)]
84
- })]);
85
- };
77
+ return () => _createVNode("div", _mergeProps(api.value.rootProps, {
78
+ "style": {
79
+ "--mp-rich-text-editor--border-color-hover": (formControlProp == null ? void 0 : formControlProp.value.isInvalid) || api.value.isInvalid ? token.var("colors.red.400") : isFocused.value ? token.var("colors.blue.400") : token.var("colors.gray.400"),
80
+ "--mp-rich-text-editor--border-color": (formControlProp == null ? void 0 : formControlProp.value.isInvalid) || api.value.isInvalid ? token.var("colors.red.400") : isFocused.value ? token.var("colors.blue.400") : token.var("colors.gray.100"),
81
+ "--mp-rich-text-editor--box-shadow": isFocused.value ? token.var("shadows.outer") : void 0,
82
+ "--mp-rich-text-editor--background-color": (formControlProp == null ? void 0 : formControlProp.value.isDisabled) || api.value.isDisabled ? token.var("colors.gray.50") : token.var("colors.white")
83
+ }
84
+ }), [_createVNode(EditorToolbar, _mergeProps({
85
+ "editor": editor,
86
+ "options": api.value.options
87
+ }, api.value.toolbarProps), null), _createVNode(MpRTEStyleProvider, {
88
+ "id": api.value.id
89
+ }, {
90
+ default: () => [_createVNode(EditorContent, _mergeProps({
91
+ "editor": editor
92
+ }, api.value.areaProps), null)]
93
+ })]);
86
94
  }
87
95
  });
88
96