@react-fabric/lexical 1.0.0-beta.60 → 1.0.0-beta.61

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 (127) hide show
  1. package/dist/cjs/{packages/lexical/src/components → components}/StickyComponent.js +2 -3
  2. package/dist/cjs/{packages/lexical/src/editor → editor}/LexicalEditor.js +5 -5
  3. package/dist/cjs/{packages/lexical/src/hooks → hooks}/useFormatWatcher.js +101 -95
  4. package/dist/cjs/i18n/ar.json.js +24 -0
  5. package/dist/cjs/i18n/en.json.js +24 -0
  6. package/dist/cjs/i18n/index.js +33 -0
  7. package/dist/cjs/{packages/lexical/src/index.js → index.js} +1 -0
  8. package/dist/cjs/{packages/lexical/src/plugins → plugins}/DraggableBlockPlugin.js +5 -5
  9. package/dist/cjs/{packages/lexical/src/plugins → plugins}/ToolbarPlugin.js +35 -22
  10. package/dist/esm/{packages/lexical/src/components → components}/StickyComponent.js +2 -3
  11. package/dist/esm/{packages/lexical/src/editor → editor}/LexicalEditor.js +4 -4
  12. package/dist/esm/{packages/lexical/src/hooks → hooks}/useFormatWatcher.js +43 -37
  13. package/dist/esm/i18n/ar.json.js +21 -0
  14. package/dist/esm/i18n/en.json.js +21 -0
  15. package/dist/esm/i18n/index.js +33 -0
  16. package/dist/esm/{packages/lexical/src/index.js → index.js} +1 -0
  17. package/dist/esm/{packages/lexical/src/plugins → plugins}/DraggableBlockPlugin.js +2 -2
  18. package/dist/esm/{packages/lexical/src/plugins → plugins}/ToolbarPlugin.js +36 -23
  19. package/dist/types/hooks/useFormatWatcher.d.ts +1 -0
  20. package/dist/types/i18n/index.d.ts +1 -0
  21. package/dist/types/index.d.ts +1 -0
  22. package/package.json +5 -5
  23. package/src/components/StickyComponent.tsx +2 -3
  24. package/src/hooks/useFormatWatcher.ts +3 -0
  25. package/src/i18n/ar.json +16 -0
  26. package/src/i18n/en.json +16 -0
  27. package/src/i18n/index.ts +28 -0
  28. package/src/index.ts +2 -0
  29. package/src/plugins/ToolbarPlugin.tsx +34 -23
  30. package/dist/cjs/_virtual/prism.js +0 -5
  31. package/dist/cjs/node_modules/@lexical/clipboard/LexicalClipboard.dev.js +0 -474
  32. package/dist/cjs/node_modules/@lexical/clipboard/LexicalClipboard.js +0 -21
  33. package/dist/cjs/node_modules/@lexical/clipboard/LexicalClipboard.prod.js +0 -27
  34. package/dist/cjs/node_modules/@lexical/code/LexicalCode.dev.js +0 -1537
  35. package/dist/cjs/node_modules/@lexical/code/LexicalCode.js +0 -25
  36. package/dist/cjs/node_modules/@lexical/code/LexicalCode.prod.js +0 -57
  37. package/dist/cjs/node_modules/@lexical/html/LexicalHtml.dev.js +0 -252
  38. package/dist/cjs/node_modules/@lexical/html/LexicalHtml.js +0 -19
  39. package/dist/cjs/node_modules/@lexical/html/LexicalHtml.prod.js +0 -18
  40. package/dist/cjs/node_modules/@lexical/link/LexicalLink.dev.js +0 -572
  41. package/dist/cjs/node_modules/@lexical/link/LexicalLink.js +0 -17
  42. package/dist/cjs/node_modules/@lexical/link/LexicalLink.prod.js +0 -25
  43. package/dist/cjs/node_modules/@lexical/list/LexicalList.dev.js +0 -1614
  44. package/dist/cjs/node_modules/@lexical/list/LexicalList.js +0 -29
  45. package/dist/cjs/node_modules/@lexical/list/LexicalList.prod.js +0 -36
  46. package/dist/cjs/node_modules/@lexical/rich-text/LexicalRichText.dev.js +0 -838
  47. package/dist/cjs/node_modules/@lexical/rich-text/LexicalRichText.js +0 -29
  48. package/dist/cjs/node_modules/@lexical/rich-text/LexicalRichText.prod.js +0 -26
  49. package/dist/cjs/node_modules/@lexical/selection/LexicalSelection.dev.js +0 -1057
  50. package/dist/cjs/node_modules/@lexical/selection/LexicalSelection.js +0 -39
  51. package/dist/cjs/node_modules/@lexical/selection/LexicalSelection.prod.js +0 -45
  52. package/dist/cjs/node_modules/@lexical/table/LexicalTable.dev.js +0 -4207
  53. package/dist/cjs/node_modules/@lexical/table/LexicalTable.js +0 -23
  54. package/dist/cjs/node_modules/@lexical/table/LexicalTable.prod.js +0 -68
  55. package/dist/cjs/node_modules/@lexical/utils/LexicalUtils.dev.js +0 -1166
  56. package/dist/cjs/node_modules/@lexical/utils/LexicalUtils.js +0 -47
  57. package/dist/cjs/node_modules/@lexical/utils/LexicalUtils.prod.js +0 -81
  58. package/dist/cjs/node_modules/@mdi/js/mdi.js +0 -8
  59. package/dist/cjs/node_modules/prismjs/components/prism-c.js +0 -82
  60. package/dist/cjs/node_modules/prismjs/components/prism-clike.js +0 -33
  61. package/dist/cjs/node_modules/prismjs/components/prism-cpp.js +0 -101
  62. package/dist/cjs/node_modules/prismjs/components/prism-css.js +0 -66
  63. package/dist/cjs/node_modules/prismjs/components/prism-java.js +0 -126
  64. package/dist/cjs/node_modules/prismjs/components/prism-javascript.js +0 -174
  65. package/dist/cjs/node_modules/prismjs/components/prism-markdown.js +0 -417
  66. package/dist/cjs/node_modules/prismjs/components/prism-markup.js +0 -188
  67. package/dist/cjs/node_modules/prismjs/components/prism-objectivec.js +0 -14
  68. package/dist/cjs/node_modules/prismjs/components/prism-powershell.js +0 -60
  69. package/dist/cjs/node_modules/prismjs/components/prism-python.js +0 -67
  70. package/dist/cjs/node_modules/prismjs/components/prism-rust.js +0 -130
  71. package/dist/cjs/node_modules/prismjs/components/prism-sql.js +0 -34
  72. package/dist/cjs/node_modules/prismjs/components/prism-swift.js +0 -150
  73. package/dist/cjs/node_modules/prismjs/components/prism-typescript.js +0 -62
  74. package/dist/cjs/node_modules/prismjs/prism.js +0 -1951
  75. package/dist/esm/_virtual/prism.js +0 -5
  76. package/dist/esm/node_modules/@lexical/clipboard/LexicalClipboard.dev.js +0 -465
  77. package/dist/esm/node_modules/@lexical/clipboard/LexicalClipboard.js +0 -19
  78. package/dist/esm/node_modules/@lexical/clipboard/LexicalClipboard.prod.js +0 -18
  79. package/dist/esm/node_modules/@lexical/code/LexicalCode.dev.js +0 -1512
  80. package/dist/esm/node_modules/@lexical/code/LexicalCode.js +0 -21
  81. package/dist/esm/node_modules/@lexical/code/LexicalCode.prod.js +0 -32
  82. package/dist/esm/node_modules/@lexical/html/LexicalHtml.dev.js +0 -251
  83. package/dist/esm/node_modules/@lexical/html/LexicalHtml.js +0 -18
  84. package/dist/esm/node_modules/@lexical/html/LexicalHtml.prod.js +0 -17
  85. package/dist/esm/node_modules/@lexical/link/LexicalLink.dev.js +0 -563
  86. package/dist/esm/node_modules/@lexical/link/LexicalLink.js +0 -17
  87. package/dist/esm/node_modules/@lexical/link/LexicalLink.prod.js +0 -16
  88. package/dist/esm/node_modules/@lexical/list/LexicalList.dev.js +0 -1595
  89. package/dist/esm/node_modules/@lexical/list/LexicalList.js +0 -23
  90. package/dist/esm/node_modules/@lexical/list/LexicalList.prod.js +0 -17
  91. package/dist/esm/node_modules/@lexical/rich-text/LexicalRichText.dev.js +0 -830
  92. package/dist/esm/node_modules/@lexical/rich-text/LexicalRichText.js +0 -23
  93. package/dist/esm/node_modules/@lexical/rich-text/LexicalRichText.prod.js +0 -18
  94. package/dist/esm/node_modules/@lexical/selection/LexicalSelection.dev.js +0 -1028
  95. package/dist/esm/node_modules/@lexical/selection/LexicalSelection.js +0 -28
  96. package/dist/esm/node_modules/@lexical/selection/LexicalSelection.prod.js +0 -16
  97. package/dist/esm/node_modules/@lexical/table/LexicalTable.dev.js +0 -4156
  98. package/dist/esm/node_modules/@lexical/table/LexicalTable.js +0 -20
  99. package/dist/esm/node_modules/@lexical/table/LexicalTable.prod.js +0 -17
  100. package/dist/esm/node_modules/@lexical/utils/LexicalUtils.dev.js +0 -1102
  101. package/dist/esm/node_modules/@lexical/utils/LexicalUtils.js +0 -32
  102. package/dist/esm/node_modules/@lexical/utils/LexicalUtils.prod.js +0 -17
  103. package/dist/esm/node_modules/@mdi/js/mdi.js +0 -7
  104. package/dist/esm/node_modules/prismjs/components/prism-c.js +0 -82
  105. package/dist/esm/node_modules/prismjs/components/prism-clike.js +0 -33
  106. package/dist/esm/node_modules/prismjs/components/prism-cpp.js +0 -101
  107. package/dist/esm/node_modules/prismjs/components/prism-css.js +0 -66
  108. package/dist/esm/node_modules/prismjs/components/prism-java.js +0 -126
  109. package/dist/esm/node_modules/prismjs/components/prism-javascript.js +0 -174
  110. package/dist/esm/node_modules/prismjs/components/prism-markdown.js +0 -417
  111. package/dist/esm/node_modules/prismjs/components/prism-markup.js +0 -188
  112. package/dist/esm/node_modules/prismjs/components/prism-objectivec.js +0 -14
  113. package/dist/esm/node_modules/prismjs/components/prism-powershell.js +0 -60
  114. package/dist/esm/node_modules/prismjs/components/prism-python.js +0 -67
  115. package/dist/esm/node_modules/prismjs/components/prism-rust.js +0 -130
  116. package/dist/esm/node_modules/prismjs/components/prism-sql.js +0 -34
  117. package/dist/esm/node_modules/prismjs/components/prism-swift.js +0 -150
  118. package/dist/esm/node_modules/prismjs/components/prism-typescript.js +0 -62
  119. package/dist/esm/node_modules/prismjs/prism.js +0 -1951
  120. /package/dist/cjs/{packages/lexical/src/editor → editor}/theme.js +0 -0
  121. /package/dist/cjs/{packages/lexical/src/nodes → nodes}/StickyNode.js +0 -0
  122. /package/dist/cjs/{packages/lexical/src/plugins → plugins}/StickyPlugin.js +0 -0
  123. /package/dist/cjs/{packages/lexical/src/utils → utils}/index.js +0 -0
  124. /package/dist/esm/{packages/lexical/src/editor → editor}/theme.js +0 -0
  125. /package/dist/esm/{packages/lexical/src/nodes → nodes}/StickyNode.js +0 -0
  126. /package/dist/esm/{packages/lexical/src/plugins → plugins}/StickyPlugin.js +0 -0
  127. /package/dist/esm/{packages/lexical/src/utils → utils}/index.js +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-fabric/lexical",
3
- "version": "1.0.0-beta.60",
3
+ "version": "1.0.0-beta.61",
4
4
  "description": "RUF: Lexical editor",
5
5
  "author": "Adarsh Pastakia <adarshpastakia@outlook.com>",
6
6
  "license": "MIT",
@@ -36,9 +36,9 @@
36
36
  },
37
37
  "dependencies": {
38
38
  "@lexical/react": "~0.35.0",
39
- "@react-fabric/core": "^1.0.0-beta.60",
40
- "@react-fabric/form": "^1.0.0-beta.60",
41
- "@react-fabric/utilities": "^1.0.0-beta.60",
39
+ "@react-fabric/core": "^1.0.0-beta.61",
40
+ "@react-fabric/form": "^1.0.0-beta.61",
41
+ "@react-fabric/utilities": "^1.0.0-beta.61",
42
42
  "classnames": "~2.5.1",
43
43
  "lexical": "~0.35.0"
44
44
  },
@@ -52,5 +52,5 @@
52
52
  "node": ">=18.12.0",
53
53
  "npm": ">=8.19.0"
54
54
  },
55
- "gitHead": "a79f053ee7e13422c06d7d9c35d4f0c2610cdf5d"
55
+ "gitHead": "a0b0c571bf9c189fa3355bbc3b896ecc4b9d6a04"
56
56
  }
@@ -29,7 +29,6 @@ import { ContentEditable } from "@lexical/react/LexicalContentEditable";
29
29
  import { LexicalErrorBoundary } from "@lexical/react/LexicalErrorBoundary";
30
30
  import { LexicalNestedComposer } from "@lexical/react/LexicalNestedComposer";
31
31
  import { RichTextPlugin } from "@lexical/react/LexicalRichTextPlugin";
32
- import { mdiClose, mdiFormatColorFill } from "@mdi/js";
33
32
  import { Icon } from "@react-fabric/core";
34
33
  import { $getNodeByKey, createEditor, type NodeKey } from "lexical";
35
34
  import { useEffect, useMemo, useRef } from "react";
@@ -228,7 +227,7 @@ export const StickyComponent = ({
228
227
  aria-label="Change sticky note color"
229
228
  title="Color"
230
229
  >
231
- <Icon icon={mdiFormatColorFill} />
230
+ <Icon icon="icon-[mdi--format-color-fill]" />
232
231
  </button>
233
232
  <button
234
233
  onClick={handleDelete}
@@ -236,7 +235,7 @@ export const StickyComponent = ({
236
235
  aria-label="Delete sticky note"
237
236
  title="Delete"
238
237
  >
239
- <Icon icon={mdiClose} />
238
+ <Icon icon="icon-[mdi--close]" />
240
239
  </button>
241
240
  </div>
242
241
  <div className="text-sm font-semibold">{user}</div>
@@ -126,6 +126,7 @@ export const useFormatWatcher = () => {
126
126
  const [fontColor, setFontColor] = useState<string>("#000");
127
127
  const [bgColor, setBgColor] = useState<string>("#fff");
128
128
  const [fontFamily, setFontFamily] = useState<string>("Arial");
129
+ const [align, setAlign] = useState("");
129
130
  const [isLink, setIsLink] = useState(false);
130
131
  const [isBold, setIsBold] = useState(false);
131
132
  const [isItalic, setIsItalic] = useState(false);
@@ -189,6 +190,7 @@ export const useFormatWatcher = () => {
189
190
 
190
191
  if (elementDOM !== null) {
191
192
  setSelectedElementKey(elementKey);
193
+ elementDOM && setAlign(getComputedStyle(elementDOM).textAlign);
192
194
  if ($isListNode(element)) {
193
195
  const parentList = $getNearestNodeOfType<ListNode>(
194
196
  anchorNode,
@@ -488,6 +490,7 @@ export const useFormatWatcher = () => {
488
490
  canUndo,
489
491
  canRedo,
490
492
  isRTL,
493
+ align,
491
494
  isEditable,
492
495
  codeLanguage,
493
496
  activeEditor,
@@ -0,0 +1,16 @@
1
+ {
2
+ "tool": {
3
+ "alignCenter": "محاذاة المركز",
4
+ "alignJustify": "محاذاة وضبط",
5
+ "alignEnd": "محاذاة النهاية",
6
+ "alignStart": "محاذاة البداية",
7
+ "bold": "عريض",
8
+ "clear": "مسح التنسيق",
9
+ "hilight": "تسليط الضوء",
10
+ "indentIn": "المسافة البادئة في",
11
+ "underline": "تسطير",
12
+ "strikethrough": "يتوسطه خط",
13
+ "italic": "مائل",
14
+ "indentOut": "مسافة بادئة للخارج"
15
+ }
16
+ }
@@ -0,0 +1,16 @@
1
+ {
2
+ "tool": {
3
+ "alignStart": "Align Start",
4
+ "alignCenter": "Align Center",
5
+ "alignEnd": "Align End",
6
+ "alignJustify": "Align Justify",
7
+ "bold": "Bold",
8
+ "italic": "Italic",
9
+ "underline": "Underline",
10
+ "strikethrough": "Strikethrough",
11
+ "indentOut": "Indent Out",
12
+ "indentIn": "Indent In",
13
+ "hilight": "Highlight",
14
+ "clear": "Clear Formatting"
15
+ }
16
+ }
@@ -0,0 +1,28 @@
1
+ /*
2
+ * React Fabric
3
+ * @version: 1.0.0
4
+ *
5
+ *
6
+ * The MIT License (MIT)
7
+ * Copyright (c) 2024 Adarsh Pastakia
8
+ *
9
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software
10
+ * and associated documentation files (the "Software"), to deal in the Software without restriction,
11
+ * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
12
+ * and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
13
+ * subject to the following conditions:
14
+ *
15
+ * The above copyright notice and this permission notice shall be included in all copies or substantial
16
+ * portions of the Software.
17
+ *
18
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
19
+ * TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
20
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
21
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22
+ */
23
+
24
+ import { addTranslationBundle } from "@react-fabric/core";
25
+ import ar from "./ar.json";
26
+ import en from "./en.json";
27
+
28
+ addTranslationBundle("lexical", { en, ar });
package/src/index.ts CHANGED
@@ -21,4 +21,6 @@
21
21
  * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22
22
  */
23
23
 
24
+ import "./i18n";
25
+
24
26
  export { LexicalEditor } from "./editor/LexicalEditor";
@@ -24,7 +24,6 @@
24
24
  import {
25
25
  Button,
26
26
  ButtonGroup,
27
- CoreIcons,
28
27
  Divider,
29
28
  Dropdown,
30
29
  Icon,
@@ -51,14 +50,14 @@ const blockTypeToBlockName: KeyValue = {
51
50
  quote: "Quote",
52
51
  };
53
52
  const blockTypeToBlockIcon: KeyValue = {
54
- bullet: CoreIcons.formatListBullet,
55
- code: CoreIcons.formatCodeBlock,
53
+ bullet: "icon-[mdi--format-list-bulleted]",
54
+ code: "icon-[mdi--code-block-tags]",
56
55
  h1: " ",
57
56
  h2: " ",
58
57
  paragraph: "",
59
- h6: CoreIcons.formatCommentBlock,
60
- number: CoreIcons.formatListNumber,
61
- quote: CoreIcons.formatQuoteBlock,
58
+ h6: "icon-[mdi--comment-text-outline]",
59
+ number: "icon-[mdi--format-list-numbered]",
60
+ quote: "icon-[mdi--format-quote-open]",
62
61
  };
63
62
 
64
63
  const SIZES = Object.freeze([
@@ -105,7 +104,7 @@ export const ToolbarPlugin = () => {
105
104
  <Button
106
105
  variant="link"
107
106
  tabIndex={-1}
108
- altIcon={CoreIcons.caretDown}
107
+ altIcon="icon-[mdi--menu-down]"
109
108
  icon={blockTypeToBlockIcon[watch.blockType]}
110
109
  >
111
110
  {blockTypeToBlockName[watch.blockType]}
@@ -156,7 +155,7 @@ export const ToolbarPlugin = () => {
156
155
  <Divider vertical />
157
156
  <div>
158
157
  <Dropdown>
159
- <Button variant="link" altIcon={CoreIcons.caretDown}>
158
+ <Button variant="link" altIcon="icon-[mdi--menu-down]" tabIndex={-1}>
160
159
  {getValue(watch.fontSize + "", "16")}
161
160
  </Button>
162
161
  <Menu className="hide-icons">
@@ -176,7 +175,9 @@ export const ToolbarPlugin = () => {
176
175
  <ButtonWrapper
177
176
  value="start"
178
177
  label={t("tool.alignStart")}
179
- icon={{ icon: CoreIcons.alignLeft, rtlFlip: true }}
178
+ variant={watch.align === "start" ? "soft" : "link"}
179
+ color={watch.align === "start" ? "primary" : "default"}
180
+ icon={{ icon: "icon-[mdi--format-align-left]", rtlFlip: true }}
180
181
  onClick={() =>
181
182
  watch.activeEditor.dispatchCommand(FORMAT_ELEMENT_COMMAND, "start")
182
183
  }
@@ -184,7 +185,9 @@ export const ToolbarPlugin = () => {
184
185
  <ButtonWrapper
185
186
  value="center"
186
187
  label={t("tool.alignCenter")}
187
- icon={CoreIcons.alignCenter}
188
+ variant={watch.align === "center" ? "soft" : "link"}
189
+ color={watch.align === "center" ? "primary" : "default"}
190
+ icon="icon-[mdi--format-align-center]"
188
191
  onClick={() =>
189
192
  watch.activeEditor.dispatchCommand(FORMAT_ELEMENT_COMMAND, "center")
190
193
  }
@@ -192,7 +195,9 @@ export const ToolbarPlugin = () => {
192
195
  <ButtonWrapper
193
196
  value="end"
194
197
  label={t("tool.alignEnd")}
195
- icon={{ icon: CoreIcons.alignRight, rtlFlip: true }}
198
+ variant={watch.align === "end" ? "soft" : "link"}
199
+ color={watch.align === "end" ? "primary" : "default"}
200
+ icon={{ icon: "icon-[mdi--format-align-right]", rtlFlip: true }}
196
201
  onClick={() =>
197
202
  watch.activeEditor.dispatchCommand(FORMAT_ELEMENT_COMMAND, "end")
198
203
  }
@@ -200,7 +205,9 @@ export const ToolbarPlugin = () => {
200
205
  <ButtonWrapper
201
206
  value="justify"
202
207
  label={t("tool.alignJustify")}
203
- icon={{ icon: CoreIcons.alignJustify, rtlFlip: true }}
208
+ variant={watch.align === "justify" ? "soft" : "link"}
209
+ color={watch.align === "justify" ? "primary" : "default"}
210
+ icon={{ icon: "icon-[mdi--format-align-justify]", rtlFlip: true }}
204
211
  onClick={() =>
205
212
  watch.activeEditor.dispatchCommand(
206
213
  FORMAT_ELEMENT_COMMAND,
@@ -211,13 +218,13 @@ export const ToolbarPlugin = () => {
211
218
  <ButtonWrapper
212
219
  value="justify"
213
220
  label={t("tool.indentOut")}
214
- icon={{ icon: CoreIcons.formatIndentDecrease, rtlFlip: true }}
221
+ icon={{ icon: "icon-[mdi--format-indent-decrease]", rtlFlip: true }}
215
222
  onClick={() => watch.outdent()}
216
223
  />
217
224
  <ButtonWrapper
218
225
  value="justify"
219
- label={t("tool.identIn")}
220
- icon={{ icon: CoreIcons.formatIndentIncrease, rtlFlip: true }}
226
+ label={t("tool.indentIn")}
227
+ icon={{ icon: "icon-[mdi--format-indent-increase]", rtlFlip: true }}
221
228
  onClick={() => watch.indent()}
222
229
  />
223
230
  </ButtonGroup>
@@ -226,7 +233,8 @@ export const ToolbarPlugin = () => {
226
233
  <ButtonWrapper
227
234
  value="bold"
228
235
  label={t("tool.bold")}
229
- icon={CoreIcons.formatBold}
236
+ icon="icon-[mdi--format-bold]"
237
+ color={textFormat.includes("bold") ? "primary" : "default"}
230
238
  onClick={() =>
231
239
  watch.activeEditor.dispatchCommand(FORMAT_TEXT_COMMAND, "bold")
232
240
  }
@@ -234,7 +242,8 @@ export const ToolbarPlugin = () => {
234
242
  <ButtonWrapper
235
243
  value="italic"
236
244
  label={t("tool.italic")}
237
- icon={CoreIcons.formatItalic}
245
+ icon="icon-[mdi--format-italic]"
246
+ color={textFormat.includes("italic") ? "primary" : "default"}
238
247
  onClick={() =>
239
248
  watch.activeEditor.dispatchCommand(FORMAT_TEXT_COMMAND, "italic")
240
249
  }
@@ -242,7 +251,8 @@ export const ToolbarPlugin = () => {
242
251
  <ButtonWrapper
243
252
  value="underline"
244
253
  label={t("tool.underline")}
245
- icon={CoreIcons.formatUnderline}
254
+ icon="icon-[mdi--format-underline]"
255
+ color={textFormat.includes("underline") ? "primary" : "default"}
246
256
  onClick={() =>
247
257
  watch.activeEditor.dispatchCommand(FORMAT_TEXT_COMMAND, "underline")
248
258
  }
@@ -250,7 +260,8 @@ export const ToolbarPlugin = () => {
250
260
  <ButtonWrapper
251
261
  value="strikethrough"
252
262
  label={t("tool.strikethrough")}
253
- icon={CoreIcons.formatStrikethrough}
263
+ icon="icon-[mdi--format-strikethrough-variant]"
264
+ color={textFormat.includes("strikethrough") ? "primary" : "default"}
254
265
  onClick={() =>
255
266
  watch.activeEditor.dispatchCommand(
256
267
  FORMAT_TEXT_COMMAND,
@@ -264,24 +275,24 @@ export const ToolbarPlugin = () => {
264
275
  {...{ noOutline: true }}
265
276
  value={watch.fontColor}
266
277
  onChange={(v) => watch.onFontColorSelect(v ?? undefined)}
267
- decorateStart={<Icon icon={CoreIcons.formatText} />}
278
+ decorateStart={<Icon icon="icon-[mdi--format-text]" />}
268
279
  />
269
280
  <ColorInput
270
281
  {...{ noOutline: true }}
271
282
  value={watch.bgColor}
272
283
  onChange={(v) => watch.onBgColorSelect(v ?? undefined)}
273
- decorateStart={<Icon icon={CoreIcons.formatFill} />}
284
+ decorateStart={<Icon icon="icon-[mdi--format-color-fill]" />}
274
285
  />
275
286
  <ButtonWrapper
276
287
  value="hilight"
277
288
  label={t("tool.hilight")}
278
- icon={CoreIcons.formatHilight}
289
+ icon="icon-[mdi--format-color-highlight]"
279
290
  onClick={() => watch.onBgColorSelect("#fde68a")}
280
291
  />
281
292
  <ButtonWrapper
282
293
  value="hilight"
283
294
  label={t("tool.clear")}
284
- icon={CoreIcons.formatClear}
295
+ icon="icon-[mdi--format-clear]"
285
296
  onClick={() => watch.clearFormatting()}
286
297
  />
287
298
  </div>
@@ -1,5 +0,0 @@
1
- 'use strict';
2
-
3
- var prism = {exports: {}};
4
-
5
- exports.__module = prism;