@clevertask/scribe 0.0.10 → 0.0.12

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 (39) hide show
  1. package/dist/assets/index.css +1 -1
  2. package/dist/clsx-OuTLNxxd.js +16 -0
  3. package/dist/components/Menu/BarMenu.js +119 -4
  4. package/dist/components/Menu/BubbleMenu.js +1 -1
  5. package/dist/components/Menu/Mobile/ListOptionBar.d.ts +6 -0
  6. package/dist/components/Menu/Mobile/ListOptionBar.js +40 -0
  7. package/dist/components/Scribe/extension/emoji/EmojiList.d.ts +1 -0
  8. package/dist/components/Scribe/extension/emoji/EmojiList.js +35 -0
  9. package/dist/components/Scribe/extension/emoji/suggest.d.ts +16 -0
  10. package/dist/components/Scribe/extension/emoji/suggest.js +40 -0
  11. package/dist/components/Scribe/extension/extension-link.js +221 -217
  12. package/dist/components/Scribe/extension/extension-selectedText.js +1 -1
  13. package/dist/components/Scribe/extension/index.d.ts +1 -1
  14. package/dist/components/Scribe/extension/index.js +33 -28
  15. package/dist/components/Scribe/extension/slashCommand/SlashCommandList.js +8 -6
  16. package/dist/components/Scribe/extension/slashCommand/index.js +4 -153
  17. package/dist/components/Scribe/extension/slashCommand/renderItems.d.ts +1 -1
  18. package/dist/components/Scribe/extension/slashCommand/renderItems.js +14 -14
  19. package/dist/components/Scribe/index.d.ts +1 -0
  20. package/dist/components/Scribe/index.js +85 -61
  21. package/dist/index-B0pieAxt.js +160 -0
  22. package/dist/index-CCS9HOYd.js +51031 -0
  23. package/dist/{index-Gm-3o3nq.js → index-DoNRu1rY.js} +1654 -1553
  24. package/dist/index-VneQGVTd.js +2385 -0
  25. package/dist/main.css +64 -6
  26. package/dist/marked.esm-BS_MmRZC.js +1566 -0
  27. package/dist/purify.es-BGaRrCfO.js +553 -0
  28. package/dist/turndown.browser.es-RmA_HBaI.js +649 -0
  29. package/dist/utils/create-scribe-editor.js +7 -6
  30. package/dist/utils/html-to-markdown.js +7 -6
  31. package/dist/utils/markdown-to-html.js +4 -3
  32. package/package.json +44 -41
  33. package/dist/BarMenu-SiPgB2ow.js +0 -134
  34. package/dist/browser-DEobZXxB.js +0 -2099
  35. package/dist/components/Scribe/extension/math-extension.d.ts +0 -2
  36. package/dist/components/Scribe/extension/math-extension.js +0 -11770
  37. package/dist/index-C3_lI_rP.js +0 -2269
  38. package/dist/index-NRgJVTH-.js +0 -7576
  39. package/dist/turndown.browser.es-BSoGafvq.js +0 -1164
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "A Tiptap-based rich text editor with a Notion-style block interface for viewing and creating content. Perfect for diverse needs like notes, documents, AI chat, Markdown parsing, and comments.",
4
4
  "author": "CleverTask",
5
5
  "private": false,
6
- "version": "0.0.10",
6
+ "version": "0.0.12",
7
7
  "type": "module",
8
8
  "main": "dist/main.js",
9
9
  "types": "dist/main.d.ts",
@@ -31,42 +31,33 @@
31
31
  "type": "git",
32
32
  "url": "git+https://github.com/clevertask/scribe.git"
33
33
  },
34
- "scripts": {
35
- "dev": "vite",
36
- "build": "vite build && npm run build:style",
37
- "build:style": "postcss ./lib/styles/main.css -o ./dist/main.css",
38
- "lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
39
- "preview": "vite preview",
40
- "prettier:lint": "npx prettier . --check",
41
- "prettier:format": "npx prettier . --write"
42
- },
43
34
  "peerDependencies": {
44
35
  "react": "^18.3.1",
45
36
  "react-dom": "^18.3.1"
46
37
  },
47
38
  "devDependencies": {
48
39
  "@tailwindcss/typography": "^0.5.16",
49
- "@types/lodash": "^4.17.16",
50
- "@types/node": "^22.15.3",
51
- "@types/react": "^18.3.20",
40
+ "@types/lodash": "^4.17.20",
41
+ "@types/node": "^22.16.0",
42
+ "@types/react": "^18.3.23",
52
43
  "@types/react-dom": "^18.3.7",
53
44
  "@types/turndown": "^5.0.5",
54
- "@typescript-eslint/eslint-plugin": "^8.31.1",
55
- "@typescript-eslint/parser": "^8.31.1",
56
- "@vitejs/plugin-react": "^4.4.1",
45
+ "@typescript-eslint/eslint-plugin": "^8.35.1",
46
+ "@typescript-eslint/parser": "^8.35.1",
47
+ "@vitejs/plugin-react": "^4.6.0",
57
48
  "autoprefixer": "^10.4.21",
58
- "eslint": "^9.25.1",
49
+ "eslint": "^9.30.1",
59
50
  "eslint-plugin-react-hooks": "^5.2.0",
60
51
  "eslint-plugin-react-refresh": "^0.4.20",
61
- "glob": "^11.0.2",
52
+ "glob": "^11.0.3",
62
53
  "lodash": "^4.17.21",
63
- "postcss": "^8.5.3",
54
+ "postcss": "^8.5.6",
64
55
  "postcss-cli": "^11.0.1",
65
56
  "prettier": "3.4.2",
66
57
  "tailwindcss": "^3.4.17",
67
58
  "typescript": "^5.8.3",
68
- "vite": "^6.3.4",
69
- "vite-plugin-dts": "^4.5.3",
59
+ "vite": "^6.3.5",
60
+ "vite-plugin-dts": "^4.5.4",
70
61
  "vite-plugin-lib-inject-css": "^2.2.2"
71
62
  },
72
63
  "prepublishOnly": "npm run build",
@@ -75,27 +66,39 @@
75
66
  "registry": "https://registry.npmjs.org/"
76
67
  },
77
68
  "dependencies": {
78
- "@tiptap/core": "^2.11.9",
79
- "@tiptap/extension-focus": "^2.11.9",
80
- "@tiptap/extension-highlight": "^2.11.9",
81
- "@tiptap/extension-image": "^2.11.9",
82
- "@tiptap/extension-link": "^2.11.9",
83
- "@tiptap/extension-placeholder": "^2.11.9",
84
- "@tiptap/extension-table": "^2.11.9",
85
- "@tiptap/extension-table-cell": "^2.11.9",
86
- "@tiptap/extension-table-header": "^2.11.9",
87
- "@tiptap/extension-table-row": "^2.11.9",
88
- "@tiptap/extension-task-item": "^2.11.9",
89
- "@tiptap/extension-task-list": "^2.11.9",
90
- "@tiptap/extension-typography": "^2.11.9",
91
- "@tiptap/pm": "^2.11.9",
92
- "@tiptap/react": "^2.11.9",
93
- "@tiptap/starter-kit": "^2.11.9",
94
- "@tiptap/suggestion": "^2.11.9",
69
+ "@tiptap/core": "^2.25.0",
70
+ "@tiptap/extension-emoji": "^2.25.0",
71
+ "@tiptap/extension-focus": "^2.25.0",
72
+ "@tiptap/extension-highlight": "^2.25.0",
73
+ "@tiptap/extension-image": "^2.25.0",
74
+ "@tiptap/extension-link": "^2.25.0",
75
+ "@tiptap/extension-mathematics": "^3.19.0",
76
+ "@tiptap/extension-placeholder": "^2.25.0",
77
+ "@tiptap/extension-table": "^2.25.0",
78
+ "@tiptap/extension-table-cell": "^2.25.0",
79
+ "@tiptap/extension-table-header": "^2.25.0",
80
+ "@tiptap/extension-table-row": "^2.25.0",
81
+ "@tiptap/extension-task-item": "^2.25.0",
82
+ "@tiptap/extension-task-list": "^2.25.0",
83
+ "@tiptap/extension-typography": "^2.25.0",
84
+ "@tiptap/pm": "^2.25.0",
85
+ "@tiptap/react": "^2.25.0",
86
+ "@tiptap/starter-kit": "^2.25.0",
87
+ "@tiptap/suggestion": "^2.25.0",
95
88
  "clsx": "^2.1.1",
96
- "isomorphic-dompurify": "^2.24.0",
89
+ "dompurify": "^3.3.1",
97
90
  "katex": "^0.16.22",
98
- "marked": "^15.0.11",
91
+ "marked": "^15.0.12",
92
+ "tippy.js": "^6.3.7",
99
93
  "turndown": "^7.2.0"
94
+ },
95
+ "scripts": {
96
+ "dev": "vite",
97
+ "build": "vite build && npm run build:style",
98
+ "build:style": "postcss ./lib/styles/main.css -o ./dist/main.css",
99
+ "lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
100
+ "preview": "vite preview",
101
+ "prettier:lint": "npx prettier . --check",
102
+ "prettier:format": "npx prettier . --write"
100
103
  }
101
- }
104
+ }
@@ -1,134 +0,0 @@
1
- import { jsx as o, jsxs as m } from "react/jsx-runtime";
2
- import { useCallback as g, Fragment as h } from "react";
3
- function r(e) {
4
- var n, s, c = "";
5
- if (typeof e == "string" || typeof e == "number") c += e;
6
- else if (typeof e == "object") if (Array.isArray(e)) {
7
- var C = e.length;
8
- for (n = 0; n < C; n++) e[n] && (s = r(e[n])) && (c && (c += " "), c += s);
9
- } else for (s in e) e[s] && (c && (c += " "), c += s);
10
- return c;
11
- }
12
- function a() {
13
- for (var e, n, s = 0, c = "", C = arguments.length; s < C; s++) (e = arguments[s]) && (n = r(e)) && (c && (c += " "), c += n);
14
- return c;
15
- }
16
- const v = "data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='28'%20height='28'%20viewBox='0%200%2028%2028'%20fill='none'%3e%3cscript%20xmlns=''/%3e%3cpath%20d='M15.4062%2019.625H9.625V8.375H14.9375C15.5639%208.37504%2016.1771%208.55435%2016.7048%208.89174C17.2325%209.22914%2017.6526%209.71052%2017.9155%2010.279C18.1784%2010.8475%2018.2731%2011.4794%2018.1884%2012.1C18.1037%2012.7206%2017.8431%2013.304%2017.4375%2013.7812C17.9673%2014.205%2018.3528%2014.7825%2018.5408%2015.4344C18.7289%2016.0862%2018.7102%2016.7803%2018.4875%2017.4211C18.2647%2018.0619%2017.8488%2018.6179%2017.297%2019.0126C16.7452%2019.4073%2016.0847%2019.6213%2015.4062%2019.625ZM11.5%2017.75H15.3937C15.5784%2017.75%2015.7613%2017.7136%2015.9319%2017.643C16.1025%2017.5723%2016.2575%2017.4687%2016.3881%2017.3381C16.5187%2017.2075%2016.6223%2017.0525%2016.693%2016.8819C16.7636%2016.7113%2016.8%2016.5284%2016.8%2016.3438C16.8%2016.1591%2016.7636%2015.9762%2016.693%2015.8056C16.6223%2015.635%2016.5187%2015.48%2016.3881%2015.3494C16.2575%2015.2188%2016.1025%2015.1152%2015.9319%2015.0445C15.7613%2014.9739%2015.5784%2014.9375%2015.3937%2014.9375H11.5V17.75ZM11.5%2013.0625H14.9375C15.1222%2013.0625%2015.305%2013.0261%2015.4756%2012.9555C15.6463%2012.8848%2015.8013%2012.7812%2015.9319%2012.6506C16.0625%2012.52%2016.166%2012.365%2016.2367%2012.1944C16.3074%2012.0238%2016.3438%2011.8409%2016.3438%2011.6562C16.3438%2011.4716%2016.3074%2011.2887%2016.2367%2011.1181C16.166%2010.9475%2016.0625%2010.7925%2015.9319%2010.6619C15.8013%2010.5313%2015.6463%2010.4277%2015.4756%2010.357C15.305%2010.2864%2015.1222%2010.25%2014.9375%2010.25H11.5V13.0625Z'%20fill='%23212529'/%3e%3c/svg%3e", L = "data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='28'%20height='28'%20viewBox='0%200%2028%2028'%20fill='none'%3e%3cscript%20xmlns=''/%3e%3cpath%20d='M19.625%209.625V8.375H11.5V9.625H14.7125L11.9813%2018.375H8.375V19.625H16.5V18.375H13.2875L16.0187%209.625H19.625Z'%20fill='%23212529'/%3e%3c/svg%3e", w = "data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='28'%20height='28'%20viewBox='0%200%2028%2028'%20fill='none'%3e%3cscript%20xmlns=''/%3e%3cpath%20d='M21.5%2013.375H15.2225C14.945%2013.3004%2014.6662%2013.2306%2014.3863%2013.1656C12.6312%2012.7506%2011.6388%2012.4469%2011.6388%2011.0263C11.6245%2010.781%2011.6608%2010.5355%2011.7454%2010.3049C11.83%2010.0742%2011.9612%209.86347%2012.1306%209.68564C12.6615%209.24908%2013.3264%209.00852%2014.0137%209.00439C15.7825%208.96064%2016.5981%209.56064%2017.265%2010.4731L18.2744%209.73564C17.8019%209.05711%2017.1578%208.51617%2016.4078%208.16808C15.6578%207.81999%2014.8288%207.67723%2014.0056%207.75439C12.9944%207.76085%2012.0189%208.12911%2011.2556%208.79252C10.9663%209.08595%2010.7402%209.43554%2010.5913%209.81971C10.4423%2010.2039%2010.3736%2010.6145%2010.3894%2011.0263C10.362%2011.4768%2010.4466%2011.9271%2010.6357%2012.337C10.8248%2012.7469%2011.1125%2013.1035%2011.4731%2013.375H6.5V14.625H15.0325C16.2619%2014.9813%2016.9969%2015.445%2017.0156%2016.7238C17.0359%2016.9969%2016.9985%2017.2713%2016.9056%2017.529C16.8128%2017.7867%2016.6667%2018.0219%2016.4769%2018.2194C15.8155%2018.7407%2014.9938%2019.0166%2014.1519%2019C13.5234%2018.9818%2012.9074%2018.8209%2012.3503%2018.5296C11.7932%2018.2382%2011.3097%2017.8239%2010.9362%2017.3181L9.97812%2018.1206C10.4636%2018.7676%2011.0899%2019.2955%2011.8097%2019.6645C12.5295%2020.0334%2013.3238%2020.2336%2014.1325%2020.25H14.195C15.3492%2020.2633%2016.4695%2019.8596%2017.35%2019.1131C17.6625%2018.7981%2017.9054%2018.421%2018.0632%2018.0062C18.2209%2017.5914%2018.2898%2017.1481%2018.2656%2016.705C18.289%2015.947%2018.0332%2015.2069%2017.5469%2014.625H21.5V13.375Z'%20fill='%23212529'/%3e%3c/svg%3e", d = "data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='28'%20height='28'%20viewBox='0%200%2028%2028'%20fill='none'%3e%3cscript%20xmlns=''/%3e%3cpath%20d='M23.375%2014L19%2018.375L18.1187%2017.4938L21.6063%2014L18.1187%2010.5062L19%209.625L23.375%2014ZM4.625%2014L9%209.625L9.88125%2010.5062L6.39375%2014L9.88125%2017.4938L9%2018.375L4.625%2014Z'%20fill='%23212529'/%3e%3c/svg%3e", f = "data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='28'%20height='28'%20viewBox='0%200%2028%2028'%20fill='none'%3e%3cscript%20xmlns=''/%3e%3cpath%20d='M22.3988%2014.3575L17.4081%209.36625C17.1736%209.13187%2016.8556%209.00021%2016.5241%209.00021C16.1925%209.00021%2015.8745%209.13187%2015.64%209.36625L12.2912%2012.715L9.625%205.25H8.375L5.25%2014H6.5L7.12438%2012.125H10.8744L11.3763%2013.63L6.86625%2018.14C6.75012%2018.2561%206.658%2018.3939%206.59515%2018.5456C6.5323%2018.6973%206.49995%2018.8599%206.49995%2019.0241C6.49995%2019.1883%206.5323%2019.3508%206.59515%2019.5025C6.658%2019.6542%206.75012%2019.792%206.86625%2019.9081L9.7075%2022.75H15.7013L22.3988%2016.0519C22.5101%2015.9406%2022.5984%2015.8085%2022.6587%2015.6631C22.719%2015.5177%2022.75%2015.3618%2022.75%2015.2044C22.75%2015.047%2022.719%2014.8911%2022.6587%2014.7457C22.5984%2014.6003%2022.5101%2014.4681%2022.3988%2014.3569V14.3575ZM7.54063%2010.875L8.9975%206.5L10.4575%2010.875H7.54063ZM15.1844%2021.5H10.225L7.75%2019.0238L11.695%2015.0794L16.65%2020.0337L15.1844%2021.5ZM17.5344%2019.15L12.5794%2014.1956L16.5244%2010.25L21.4788%2015.2044L17.5344%2019.15Z'%20fill='%23212529'/%3e%3c/svg%3e", u = "data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='28'%20height='28'%20viewBox='0%200%2028%2028'%20fill='none'%3e%3cscript%20xmlns=''/%3e%3cpath%20d='M8.375%2011.5C9.41053%2011.5%2010.25%2010.6605%2010.25%209.625C10.25%208.58947%209.41053%207.75%208.375%207.75C7.33947%207.75%206.5%208.58947%206.5%209.625C6.5%2010.6605%207.33947%2011.5%208.375%2011.5Z'%20fill='%23212529'/%3e%3cpath%20d='M8.375%2020.25C9.41053%2020.25%2010.25%2019.4105%2010.25%2018.375C10.25%2017.3395%209.41053%2016.5%208.375%2016.5C7.33947%2016.5%206.5%2017.3395%206.5%2018.375C6.5%2019.4105%207.33947%2020.25%208.375%2020.25Z'%20fill='%23212529'/%3e%3cpath%20d='M14%2017.75H22.75V19H14V17.75ZM14%209H22.75V10.25H14V9Z'%20fill='%23212529'/%3e%3c/svg%3e", x = "data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='28'%20height='28'%20viewBox='0%200%2028%2028'%20fill='none'%3e%3cscript%20xmlns=''/%3e%3cpath%20d='M14%2017.75H22.75V19H14V17.75ZM14%209H22.75V10.25H14V9ZM9%2011.5V6.5H7.75V7.125H6.5V8.375H7.75V11.5H6.5V12.75H10.25V11.5H9ZM10.25%2021.5H6.5V19C6.5%2018.6685%206.6317%2018.3505%206.86612%2018.1161C7.10054%2017.8817%207.41848%2017.75%207.75%2017.75H9V16.5H6.5V15.25H9C9.33152%2015.25%209.64946%2015.3817%209.88388%2015.6161C10.1183%2015.8505%2010.25%2016.1685%2010.25%2016.5V17.75C10.25%2018.0815%2010.1183%2018.3995%209.88388%2018.6339C9.64946%2018.8683%209.33152%2019%209%2019H7.75V20.25H10.25V21.5Z'%20fill='%23212529'/%3e%3c/svg%3e", p = "data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='28'%20height='28'%20viewBox='0%200%2028%2028'%20fill='none'%3e%3cscript%20xmlns=''/%3e%3cpath%20d='M22.2813%208.225C21.9329%207.8754%2021.5189%207.59801%2021.0631%207.40874C20.6073%207.21947%2020.1186%207.12204%2019.625%207.12204C19.1315%207.12204%2018.6428%207.21947%2018.187%207.40874C17.7312%207.59801%2017.3172%207.8754%2016.9688%208.225L17.8563%209.1125C18.089%208.87981%2018.3652%208.69523%2018.6692%208.56931C18.9733%208.44338%2019.2991%208.37856%2019.6282%208.37856C19.9572%208.37856%2020.2831%208.44338%2020.5871%208.56931C20.8911%208.69523%2021.1674%208.87981%2021.4%209.1125C21.6327%209.34518%2021.8173%209.62142%2021.9432%209.92544C22.0692%2010.2295%2022.134%2010.5553%2022.134%2010.8844C22.134%2011.2134%2022.0692%2011.5393%2021.9432%2011.8433C21.8173%2012.1473%2021.6327%2012.4236%2021.4%2012.6562L16.4%2017.6562C15.9309%2018.1262%2015.2944%2018.3905%2014.6304%2018.3911C13.9664%2018.3917%2013.3293%2018.1285%2012.8594%2017.6594C12.3895%2017.1903%2012.1252%2016.5537%2012.1246%2015.8897C12.124%2015.2257%2012.3872%2014.5887%2012.8563%2014.1187L13.7375%2013.2312L12.8563%2012.3437L11.9688%2013.2312C11.6192%2013.5796%2011.3418%2013.9936%2011.1525%2014.4494C10.9633%2014.9052%2010.8658%2015.3939%2010.8658%2015.8875C10.8658%2016.381%2010.9633%2016.8697%2011.1525%2017.3256C11.3418%2017.7814%2011.6192%2018.1954%2011.9688%2018.5437C12.676%2019.2419%2013.6313%2019.6308%2014.625%2019.625C15.1205%2019.627%2015.6114%2019.5309%2016.0695%2019.3421C16.5276%2019.1533%2016.9437%2018.8756%2017.2938%2018.525L22.2938%2013.525C22.9944%2012.8202%2023.3866%2011.8662%2023.3842%2010.8724C23.3819%209.87866%2022.9852%208.92647%2022.2813%208.225Z'%20fill='%23212529'/%3e%3cpath%20d='M6.61879%2019.5125C6.38541%2019.2802%206.20022%2019.0041%206.07386%2018.7C5.94749%2018.3959%205.88244%2018.0699%205.88244%2017.7406C5.88244%2017.4113%205.94749%2017.0853%206.07386%2016.7812C6.20022%2016.4772%206.38541%2016.201%206.61879%2015.9687L11.6188%2010.9687C11.8511%2010.7354%2012.1272%2010.5502%2012.4313%2010.4238C12.7353%2010.2974%2013.0614%2010.2324%2013.3907%2010.2324C13.7199%2010.2324%2014.046%2010.2974%2014.3501%2010.4238C14.6541%2010.5502%2014.9302%2010.7354%2015.1625%2010.9687C15.3944%2011.2029%2015.577%2011.4812%2015.6994%2011.7871C15.8218%2012.0931%2015.8815%2012.4205%2015.875%2012.75C15.8769%2013.0805%2015.8133%2013.4081%2015.6878%2013.7138C15.5623%2014.0196%2015.3774%2014.2974%2015.1438%2014.5312L13.8188%2015.875L14.7063%2016.7625L16.0313%2015.4375C16.7366%2014.7322%2017.1328%2013.7756%2017.1328%2012.7781C17.1328%2011.7807%2016.7366%2010.8241%2016.0313%2010.1187C15.326%209.41344%2014.3694%209.0172%2013.3719%209.0172C12.3745%209.0172%2011.4179%209.41344%2010.7125%2010.1187L5.71254%2015.1187C5.362%2015.4672%205.08382%2015.8816%204.89399%2016.338C4.70417%2016.7944%204.60645%2017.2838%204.60645%2017.7781C4.60645%2018.2724%204.70417%2018.7618%204.89399%2019.2182C5.08382%2019.6746%205.362%2020.089%205.71254%2020.4375C6.42431%2021.1303%207.38185%2021.5124%208.37504%2021.5C9.37698%2021.501%2010.3386%2021.1055%2011.05%2020.4L10.1625%2019.5125C9.93025%2019.7459%209.65413%2019.9311%209.35006%2020.0574C9.04599%2020.1838%208.71995%2020.2488%208.39067%2020.2488C8.06138%2020.2488%207.73534%2020.1838%207.43127%2020.0574C7.1272%2019.9311%206.85109%2019.7459%206.61879%2019.5125Z'%20fill='%23212529'/%3e%3c/svg%3e", H = "data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='28'%20height='28'%20viewBox='0%200%2028%2028'%20fill='none'%3e%3cscript%20xmlns=''/%3e%3cpath%20d='M15.875%2012.75C16.2458%2012.75%2016.6084%2012.64%2016.9167%2012.434C17.225%2012.228%2017.4654%2011.9351%2017.6073%2011.5925C17.7492%2011.2499%2017.7863%2010.8729%2017.714%2010.5092C17.6416%2010.1455%2017.463%209.8114%2017.2008%209.54917C16.9386%209.28695%2016.6045%209.10837%2016.2408%209.03603C15.8771%208.96368%2015.5001%209.00081%2015.1575%209.14273C14.8149%209.28464%2014.522%209.52496%2014.316%209.83331C14.11%2010.1416%2014%2010.5042%2014%2010.875C14%2011.3723%2014.1975%2011.8492%2014.5492%2012.2008C14.9008%2012.5525%2015.3777%2012.75%2015.875%2012.75ZM15.875%2010.25C15.9986%2010.25%2016.1195%2010.2867%2016.2222%2010.3553C16.325%2010.424%2016.4051%2010.5216%2016.4524%2010.6358C16.4997%2010.75%2016.5121%2010.8757%2016.488%2010.9969C16.4639%2011.1182%2016.4044%2011.2295%2016.3169%2011.3169C16.2295%2011.4043%2016.1182%2011.4639%2015.9969%2011.488C15.8757%2011.5121%2015.75%2011.4997%2015.6358%2011.4524C15.5216%2011.4051%2015.424%2011.325%2015.3553%2011.2222C15.2867%2011.1195%2015.25%2010.9986%2015.25%2010.875C15.25%2010.7092%2015.3158%2010.5503%2015.4331%2010.4331C15.5503%2010.3158%2015.7092%2010.25%2015.875%2010.25Z'%20fill='%23212529'/%3e%3cpath%20d='M20.25%206.5H7.75C7.41848%206.5%207.10054%206.6317%206.86612%206.86612C6.6317%207.10054%206.5%207.41848%206.5%207.75V20.25C6.5%2020.5815%206.6317%2020.8995%206.86612%2021.1339C7.10054%2021.3683%207.41848%2021.5%207.75%2021.5H20.25C20.5815%2021.5%2020.8995%2021.3683%2021.1339%2021.1339C21.3683%2020.8995%2021.5%2020.5815%2021.5%2020.25V7.75C21.5%207.41848%2021.3683%207.10054%2021.1339%206.86612C20.8995%206.6317%2020.5815%206.5%2020.25%206.5ZM20.25%2020.25H7.75V16.5L10.875%2013.375L14.3688%2016.8687C14.603%2017.1016%2014.9198%2017.2322%2015.25%2017.2322C15.5802%2017.2322%2015.897%2017.1016%2016.1313%2016.8687L17.125%2015.875L20.25%2019V20.25ZM20.25%2017.2312L18.0063%2014.9875C17.772%2014.7547%2017.4552%2014.624%2017.125%2014.624C16.7948%2014.624%2016.478%2014.7547%2016.2437%2014.9875L15.25%2015.9812L11.7562%2012.4875C11.522%2012.2547%2011.2052%2012.124%2010.875%2012.124C10.5448%2012.124%2010.228%2012.2547%209.99375%2012.4875L7.75%2014.7312V7.75H20.25V17.2312Z'%20fill='%23212529'/%3e%3c/svg%3e", V = "data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='28'%20height='28'%20viewBox='0%200%2028%2028'%20fill='none'%3e%3cscript%20xmlns=''/%3e%3cpath%20d='M23.375%2014L19%2018.375L18.1187%2017.4937L21.6063%2014L18.1187%2010.5062L19%209.625L23.375%2014ZM4.625%2014L9%209.625L9.88125%2010.5062L6.39375%2014L9.88125%2017.4937L9%2018.375L4.625%2014ZM11.7625%2019.9275L15.025%207.75L16.2325%208.07313L12.97%2020.25L11.7625%2019.9275Z'%20fill='%23212529'/%3e%3c/svg%3e", M = "data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='28'%20height='28'%20viewBox='0%200%2028%2028'%20fill='none'%3e%3cscript%20xmlns=''/%3e%3cpath%20d='M11.5%2013.375H7.81875C7.93491%2012.6015%208.21112%2011.8607%208.62974%2011.1999C9.04837%2010.5391%209.6002%209.97295%2010.25%209.5375L11.3688%208.7875L10.6812%207.75L9.5625%208.5C8.6208%209.12755%207.84857%209.97785%207.31433%2010.9755C6.7801%2011.9731%206.50038%2013.0871%206.5%2014.2188V18.375C6.5%2018.7065%206.6317%2019.0245%206.86612%2019.2589C7.10054%2019.4933%207.41848%2019.625%207.75%2019.625H11.5C11.8315%2019.625%2012.1495%2019.4933%2012.3839%2019.2589C12.6183%2019.0245%2012.75%2018.7065%2012.75%2018.375V14.625C12.75%2014.2935%2012.6183%2013.9755%2012.3839%2013.7411C12.1495%2013.5067%2011.8315%2013.375%2011.5%2013.375ZM20.25%2013.375H16.5688C16.6849%2012.6015%2016.9611%2011.8607%2017.3797%2011.1999C17.7984%2010.5391%2018.3502%209.97295%2019%209.5375L20.1188%208.7875L19.4375%207.75L18.3125%208.5C17.3708%209.12755%2016.5986%209.97785%2016.0643%2010.9755C15.5301%2011.9731%2015.2504%2013.0871%2015.25%2014.2188V18.375C15.25%2018.7065%2015.3817%2019.0245%2015.6161%2019.2589C15.8505%2019.4933%2016.1685%2019.625%2016.5%2019.625H20.25C20.5815%2019.625%2020.8995%2019.4933%2021.1339%2019.2589C21.3683%2019.0245%2021.5%2018.7065%2021.5%2018.375V14.625C21.5%2014.2935%2021.3683%2013.9755%2021.1339%2013.7411C20.8995%2013.5067%2020.5815%2013.375%2020.25%2013.375Z'%20fill='%23212529'/%3e%3c/svg%3e", Z = "data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='28'%20height='28'%20viewBox='0%200%2028%2028'%20fill='none'%3e%3cscript%20xmlns=''/%3e%3crect%20x='6.5'%20y='13.375'%20width='15'%20height='1.25'%20fill='%23212529'/%3e%3c/svg%3e", k = ({ editor: e, darkMode: n }) => {
17
- const s = g(() => {
18
- const l = e.getAttributes("link").href, t = window.prompt("Link", l);
19
- if (t !== null) {
20
- if (t === "") {
21
- e.chain().focus().extendMarkRange("link").unsetLink().run();
22
- return;
23
- }
24
- e.chain().focus().extendMarkRange("link").setLink({ href: t }).selectTextblockEnd().run();
25
- }
26
- }, [e]), c = g(() => {
27
- const l = e.getAttributes("image").src, t = window.prompt(l ? "Update Image URL" : "Image URL", l);
28
- t && e.chain().focus().setImage({ src: t }).run();
29
- }, [e]), C = [
30
- [
31
- {
32
- name: "bold",
33
- icon: v,
34
- command: () => e.chain().focus().toggleBold().run(),
35
- isActive: () => e.isActive("bold")
36
- },
37
- {
38
- name: "italic",
39
- icon: L,
40
- command: () => e.chain().focus().toggleItalic().run(),
41
- isActive: () => e.isActive("italic")
42
- },
43
- {
44
- name: "strike",
45
- icon: w,
46
- command: () => e.chain().focus().toggleStrike().run(),
47
- isActive: () => e.isActive("strike")
48
- }
49
- ],
50
- [
51
- {
52
- name: "inline-code",
53
- icon: d,
54
- command: () => e.chain().focus().toggleCode().run(),
55
- isActive: () => e.isActive("code")
56
- },
57
- {
58
- name: "highlight",
59
- icon: f,
60
- command: () => e.chain().focus().toggleHighlight().run(),
61
- isActive: () => e.isActive("highlight")
62
- }
63
- ],
64
- [
65
- {
66
- name: "unordered-list",
67
- icon: u,
68
- command: () => e.chain().focus().toggleBulletList().run(),
69
- isActive: () => e.isActive("bulletList")
70
- },
71
- {
72
- name: "ordered-list",
73
- icon: x,
74
- command: () => e.chain().focus().toggleOrderedList().run(),
75
- isActive: () => e.isActive("orderedList")
76
- }
77
- ],
78
- [
79
- {
80
- name: "link",
81
- icon: p,
82
- command: () => s(),
83
- isActive: () => e.isActive("link")
84
- },
85
- {
86
- name: "image",
87
- icon: H,
88
- command: () => c(),
89
- isActive: () => e.isActive("image"),
90
- disabled: !1
91
- },
92
- {
93
- name: "code-block",
94
- icon: V,
95
- command: () => e.chain().focus().toggleCodeBlock().run(),
96
- isActive: () => e.isActive("codeBlock")
97
- },
98
- {
99
- name: "block-quote",
100
- icon: M,
101
- command: () => e.chain().focus().toggleBlockquote().run(),
102
- isActive: () => e.isActive("blockquote")
103
- },
104
- {
105
- name: "horizontal-line",
106
- icon: Z,
107
- command: () => e.chain().focus().setHorizontalRule().run(),
108
- isActive: () => !1
109
- }
110
- ]
111
- ];
112
- return /* @__PURE__ */ o("div", { className: a("flex flex-row gap-4 border-b p-[8px]", n ? "border-zinc-700" : "border-zinc-200"), children: C.map((l, t) => /* @__PURE__ */ m(h, { children: [
113
- /* @__PURE__ */ o("div", { className: "flex gap-2", children: l.map((i) => /* @__PURE__ */ o(
114
- "button",
115
- {
116
- title: i.name,
117
- disabled: i == null ? void 0 : i.disabled,
118
- className: a(
119
- "rounded-md",
120
- i.isActive() ? n ? "bg-zinc-700" : "bg-zinc-200" : "",
121
- i != null && i.disabled ? "cursor-not-allowed bg-opacity-50" : ""
122
- ),
123
- onClick: i.command,
124
- children: /* @__PURE__ */ o("img", { src: i.icon, alt: i.name, style: { filter: `invert(${n ? 1 : 0})` } })
125
- },
126
- i.name
127
- )) }),
128
- t !== C.length - 1 && /* @__PURE__ */ o("div", { className: a("border-l", n ? "border-zinc-700" : "border-zinc-200") })
129
- ] }, `format-group-${t}`)) });
130
- };
131
- export {
132
- k as B,
133
- a as c
134
- };