@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.
- package/dist/assets/index.css +1 -1
- package/dist/clsx-OuTLNxxd.js +16 -0
- package/dist/components/Menu/BarMenu.js +119 -4
- package/dist/components/Menu/BubbleMenu.js +1 -1
- package/dist/components/Menu/Mobile/ListOptionBar.d.ts +6 -0
- package/dist/components/Menu/Mobile/ListOptionBar.js +40 -0
- package/dist/components/Scribe/extension/emoji/EmojiList.d.ts +1 -0
- package/dist/components/Scribe/extension/emoji/EmojiList.js +35 -0
- package/dist/components/Scribe/extension/emoji/suggest.d.ts +16 -0
- package/dist/components/Scribe/extension/emoji/suggest.js +40 -0
- package/dist/components/Scribe/extension/extension-link.js +221 -217
- package/dist/components/Scribe/extension/extension-selectedText.js +1 -1
- package/dist/components/Scribe/extension/index.d.ts +1 -1
- package/dist/components/Scribe/extension/index.js +33 -28
- package/dist/components/Scribe/extension/slashCommand/SlashCommandList.js +8 -6
- package/dist/components/Scribe/extension/slashCommand/index.js +4 -153
- package/dist/components/Scribe/extension/slashCommand/renderItems.d.ts +1 -1
- package/dist/components/Scribe/extension/slashCommand/renderItems.js +14 -14
- package/dist/components/Scribe/index.d.ts +1 -0
- package/dist/components/Scribe/index.js +85 -61
- package/dist/index-B0pieAxt.js +160 -0
- package/dist/index-CCS9HOYd.js +51031 -0
- package/dist/{index-Gm-3o3nq.js → index-DoNRu1rY.js} +1654 -1553
- package/dist/index-VneQGVTd.js +2385 -0
- package/dist/main.css +64 -6
- package/dist/marked.esm-BS_MmRZC.js +1566 -0
- package/dist/purify.es-BGaRrCfO.js +553 -0
- package/dist/turndown.browser.es-RmA_HBaI.js +649 -0
- package/dist/utils/create-scribe-editor.js +7 -6
- package/dist/utils/html-to-markdown.js +7 -6
- package/dist/utils/markdown-to-html.js +4 -3
- package/package.json +44 -41
- package/dist/BarMenu-SiPgB2ow.js +0 -134
- package/dist/browser-DEobZXxB.js +0 -2099
- package/dist/components/Scribe/extension/math-extension.d.ts +0 -2
- package/dist/components/Scribe/extension/math-extension.js +0 -11770
- package/dist/index-C3_lI_rP.js +0 -2269
- package/dist/index-NRgJVTH-.js +0 -7576
- package/dist/turndown.browser.es-BSoGafvq.js +0 -1164
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
function a(r) {
|
|
2
|
+
var f, n, t = "";
|
|
3
|
+
if (typeof r == "string" || typeof r == "number") t += r;
|
|
4
|
+
else if (typeof r == "object") if (Array.isArray(r)) {
|
|
5
|
+
var o = r.length;
|
|
6
|
+
for (f = 0; f < o; f++) r[f] && (n = a(r[f])) && (t && (t += " "), t += n);
|
|
7
|
+
} else for (n in r) r[n] && (t && (t += " "), t += n);
|
|
8
|
+
return t;
|
|
9
|
+
}
|
|
10
|
+
function i() {
|
|
11
|
+
for (var r, f, n = 0, t = "", o = arguments.length; n < o; n++) (r = arguments[n]) && (f = a(r)) && (t && (t += " "), t += f);
|
|
12
|
+
return t;
|
|
13
|
+
}
|
|
14
|
+
export {
|
|
15
|
+
i as c
|
|
16
|
+
};
|
|
@@ -1,6 +1,121 @@
|
|
|
1
|
-
import "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import "react";
|
|
1
|
+
import { jsx as s, jsxs as m } from "react/jsx-runtime";
|
|
2
|
+
import { c as l } from "../../clsx-OuTLNxxd.js";
|
|
3
|
+
import { useCallback as o, Fragment as h } from "react";
|
|
4
|
+
const 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='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", 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='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", r = "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", 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='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", 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='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", 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='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", 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='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", 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='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", 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='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", 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%3crect%20x='6.5'%20y='13.375'%20width='15'%20height='1.25'%20fill='%23212529'/%3e%3c/svg%3e", k = ({ editor: e, darkMode: C }) => {
|
|
5
|
+
const a = o(() => {
|
|
6
|
+
const n = e.getAttributes("link").href, i = window.prompt("Link", n);
|
|
7
|
+
if (i !== null) {
|
|
8
|
+
if (i === "") {
|
|
9
|
+
e.chain().focus().extendMarkRange("link").unsetLink().run();
|
|
10
|
+
return;
|
|
11
|
+
}
|
|
12
|
+
e.chain().focus().extendMarkRange("link").setLink({ href: i }).selectTextblockEnd().run();
|
|
13
|
+
}
|
|
14
|
+
}, [e]), g = o(() => {
|
|
15
|
+
const n = e.getAttributes("image").src, i = window.prompt(n ? "Update Image URL" : "Image URL", n);
|
|
16
|
+
i && e.chain().focus().setImage({ src: i }).run();
|
|
17
|
+
}, [e]), t = [
|
|
18
|
+
[
|
|
19
|
+
{
|
|
20
|
+
name: "bold",
|
|
21
|
+
icon: L,
|
|
22
|
+
command: () => e.chain().focus().toggleBold().run(),
|
|
23
|
+
isActive: () => e.isActive("bold")
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
name: "italic",
|
|
27
|
+
icon: v,
|
|
28
|
+
command: () => e.chain().focus().toggleItalic().run(),
|
|
29
|
+
isActive: () => e.isActive("italic")
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
name: "strike",
|
|
33
|
+
icon: r,
|
|
34
|
+
command: () => e.chain().focus().toggleStrike().run(),
|
|
35
|
+
isActive: () => e.isActive("strike")
|
|
36
|
+
}
|
|
37
|
+
],
|
|
38
|
+
[
|
|
39
|
+
{
|
|
40
|
+
name: "inline-code",
|
|
41
|
+
icon: w,
|
|
42
|
+
command: () => e.chain().focus().toggleCode().run(),
|
|
43
|
+
isActive: () => e.isActive("code")
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
name: "highlight",
|
|
47
|
+
icon: d,
|
|
48
|
+
command: () => e.chain().focus().toggleHighlight().run(),
|
|
49
|
+
isActive: () => e.isActive("highlight")
|
|
50
|
+
}
|
|
51
|
+
],
|
|
52
|
+
[
|
|
53
|
+
{
|
|
54
|
+
name: "unordered-list",
|
|
55
|
+
icon: x,
|
|
56
|
+
command: () => e.chain().focus().toggleBulletList().run(),
|
|
57
|
+
isActive: () => e.isActive("bulletList")
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
name: "ordered-list",
|
|
61
|
+
icon: f,
|
|
62
|
+
command: () => e.chain().focus().toggleOrderedList().run(),
|
|
63
|
+
isActive: () => e.isActive("orderedList")
|
|
64
|
+
}
|
|
65
|
+
],
|
|
66
|
+
[
|
|
67
|
+
{
|
|
68
|
+
name: "link",
|
|
69
|
+
icon: p,
|
|
70
|
+
command: () => a(),
|
|
71
|
+
isActive: () => e.isActive("link")
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
name: "image",
|
|
75
|
+
icon: H,
|
|
76
|
+
command: () => g(),
|
|
77
|
+
isActive: () => e.isActive("image"),
|
|
78
|
+
disabled: !1
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
name: "code-block",
|
|
82
|
+
icon: u,
|
|
83
|
+
command: () => e.chain().focus().toggleCodeBlock().run(),
|
|
84
|
+
isActive: () => e.isActive("codeBlock")
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
name: "block-quote",
|
|
88
|
+
icon: V,
|
|
89
|
+
command: () => e.chain().focus().toggleBlockquote().run(),
|
|
90
|
+
isActive: () => e.isActive("blockquote")
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
name: "horizontal-line",
|
|
94
|
+
icon: M,
|
|
95
|
+
command: () => e.chain().focus().setHorizontalRule().run(),
|
|
96
|
+
isActive: () => !1
|
|
97
|
+
}
|
|
98
|
+
]
|
|
99
|
+
];
|
|
100
|
+
return /* @__PURE__ */ s("div", { className: l("flex flex-row gap-4 border-b p-[8px]", C ? "border-zinc-700" : "border-zinc-200"), children: t.map((n, i) => /* @__PURE__ */ m(h, { children: [
|
|
101
|
+
/* @__PURE__ */ s("div", { className: "flex gap-2", children: n.map((c) => /* @__PURE__ */ s(
|
|
102
|
+
"button",
|
|
103
|
+
{
|
|
104
|
+
title: c.name,
|
|
105
|
+
disabled: c == null ? void 0 : c.disabled,
|
|
106
|
+
className: l(
|
|
107
|
+
"rounded-md",
|
|
108
|
+
c.isActive() ? C ? "bg-zinc-700" : "bg-zinc-200" : "",
|
|
109
|
+
c != null && c.disabled ? "cursor-not-allowed bg-opacity-50" : ""
|
|
110
|
+
),
|
|
111
|
+
onClick: c.command,
|
|
112
|
+
children: /* @__PURE__ */ s("img", { src: c.icon, alt: c.name, style: { filter: `invert(${C ? 1 : 0})` } })
|
|
113
|
+
},
|
|
114
|
+
c.name
|
|
115
|
+
)) }),
|
|
116
|
+
i !== t.length - 1 && /* @__PURE__ */ s("div", { className: l("border-l", C ? "border-zinc-700" : "border-zinc-200") })
|
|
117
|
+
] }, `format-group-${i}`)) });
|
|
118
|
+
};
|
|
4
119
|
export {
|
|
5
|
-
|
|
120
|
+
k as default
|
|
6
121
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import { B as o } from "../../index-
|
|
2
|
+
import { B as o } from "../../index-VneQGVTd.js";
|
|
3
3
|
const l = ({ editor: n }) => /* @__PURE__ */ e(o, { className: "bubble-menu-wrapper", editor: n, children: /* @__PURE__ */ e("div", { className: "menu-item-wrapper", children: [
|
|
4
4
|
{
|
|
5
5
|
ariaLabel: "Heading 1",
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { jsxs as e, jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import { u as r } from "../../../index-VneQGVTd.js";
|
|
3
|
+
const c = ({ editor: t }) => {
|
|
4
|
+
const i = r({
|
|
5
|
+
editor: t,
|
|
6
|
+
selector: ({ editor: n }) => n ? {
|
|
7
|
+
isInsideList: n.isActive("bulletList") || n.isActive("orderedList")
|
|
8
|
+
} : null
|
|
9
|
+
});
|
|
10
|
+
return i != null && i.isInsideList ? /* @__PURE__ */ e(
|
|
11
|
+
"div",
|
|
12
|
+
{
|
|
13
|
+
style: {
|
|
14
|
+
display: "flex",
|
|
15
|
+
justifyContent: "space-between",
|
|
16
|
+
padding: "1rem",
|
|
17
|
+
paddingTop: "0rem"
|
|
18
|
+
},
|
|
19
|
+
children: [
|
|
20
|
+
/* @__PURE__ */ s(
|
|
21
|
+
"button",
|
|
22
|
+
{
|
|
23
|
+
onClick: () => t.chain().focus().liftListItem("listItem").run(),
|
|
24
|
+
children: "← Outdent"
|
|
25
|
+
}
|
|
26
|
+
),
|
|
27
|
+
/* @__PURE__ */ s(
|
|
28
|
+
"button",
|
|
29
|
+
{
|
|
30
|
+
onClick: () => t.chain().focus().sinkListItem("listItem").run(),
|
|
31
|
+
children: "Indent →"
|
|
32
|
+
}
|
|
33
|
+
)
|
|
34
|
+
]
|
|
35
|
+
}
|
|
36
|
+
) : null;
|
|
37
|
+
};
|
|
38
|
+
export {
|
|
39
|
+
c as ListOptionBar
|
|
40
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const EmojiList: import('react').ForwardRefExoticComponent<import('react').RefAttributes<unknown>>;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { jsx as c, jsxs as f } from "react/jsx-runtime";
|
|
2
|
+
import { c as i } from "../../../../clsx-OuTLNxxd.js";
|
|
3
|
+
import { forwardRef as g, useState as u, useEffect as h, useImperativeHandle as k } from "react";
|
|
4
|
+
const I = g((t, o) => {
|
|
5
|
+
const [n, a] = u(0), m = (e) => {
|
|
6
|
+
const r = t.items[e];
|
|
7
|
+
r && t.command({ name: r.name });
|
|
8
|
+
}, l = () => {
|
|
9
|
+
a((n + t.items.length - 1) % t.items.length);
|
|
10
|
+
}, s = () => {
|
|
11
|
+
a((n + 1) % t.items.length);
|
|
12
|
+
}, d = () => {
|
|
13
|
+
m(n);
|
|
14
|
+
};
|
|
15
|
+
return h(() => a(0), [t.items]), k(o, () => ({
|
|
16
|
+
onKeyDown: (e) => e.event.key === "ArrowUp" ? (l(), !0) : e.event.key === "ArrowDown" ? (s(), !0) : e.event.key === "Enter" ? (d(), !0) : !1
|
|
17
|
+
}), [l, s, d]), /* @__PURE__ */ c("div", { className: i(t.darkMode ? "dark:bg-gray-800" : "bg-white", "p-3", "rounded-md", "shadow-md"), children: t.items.map((e, r) => /* @__PURE__ */ f(
|
|
18
|
+
"button",
|
|
19
|
+
{
|
|
20
|
+
className: r === n ? i(t.darkMode ? "dark:bg-gray-700" : "bg-gray-200", "w-full", "p-1") : "",
|
|
21
|
+
style: { display: "flex", alignItems: "center", gap: ".5rem" },
|
|
22
|
+
onClick: () => m(r),
|
|
23
|
+
children: [
|
|
24
|
+
e.fallbackImage ? /* @__PURE__ */ c("img", { style: { width: "1rem", height: "1rem" }, src: e.fallbackImage }) : e.emoji,
|
|
25
|
+
":",
|
|
26
|
+
e.name,
|
|
27
|
+
":"
|
|
28
|
+
]
|
|
29
|
+
},
|
|
30
|
+
r
|
|
31
|
+
)) });
|
|
32
|
+
});
|
|
33
|
+
export {
|
|
34
|
+
I as EmojiList
|
|
35
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
declare const _default: ({ darkMode }: {
|
|
2
|
+
darkMode: any;
|
|
3
|
+
}) => {
|
|
4
|
+
items: ({ editor, query }: {
|
|
5
|
+
editor: any;
|
|
6
|
+
query: any;
|
|
7
|
+
}) => any;
|
|
8
|
+
allowSpaces: boolean;
|
|
9
|
+
render: () => {
|
|
10
|
+
onStart: (props: any) => void;
|
|
11
|
+
onUpdate(props: any): void;
|
|
12
|
+
onKeyDown(props: any): any;
|
|
13
|
+
onExit(): void;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
export default _default;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { R as s, t as a } from "../../../../index-VneQGVTd.js";
|
|
2
|
+
import { EmojiList as c } from "./EmojiList.js";
|
|
3
|
+
const m = ({ darkMode: i }) => ({
|
|
4
|
+
items: ({ editor: t, query: r }) => t.storage.emoji.emojis.filter(({ shortcodes: e, tags: o }) => e.find((n) => n.startsWith(r.toLowerCase())) || o.find((n) => n.startsWith(r.toLowerCase()))).slice(0, 5),
|
|
5
|
+
allowSpaces: !1,
|
|
6
|
+
render: () => {
|
|
7
|
+
let t, r;
|
|
8
|
+
return {
|
|
9
|
+
onStart: (e) => {
|
|
10
|
+
t = new s(c, {
|
|
11
|
+
props: { ...e, darkMode: i },
|
|
12
|
+
editor: e.editor
|
|
13
|
+
}), r = a("body", {
|
|
14
|
+
getReferenceClientRect: e.clientRect,
|
|
15
|
+
appendTo: () => document.body,
|
|
16
|
+
content: t.element,
|
|
17
|
+
showOnCreate: !0,
|
|
18
|
+
interactive: !0,
|
|
19
|
+
trigger: "manual",
|
|
20
|
+
placement: "bottom-start"
|
|
21
|
+
});
|
|
22
|
+
},
|
|
23
|
+
onUpdate(e) {
|
|
24
|
+
t.updateProps(e), r[0].setProps({
|
|
25
|
+
getReferenceClientRect: e.clientRect
|
|
26
|
+
});
|
|
27
|
+
},
|
|
28
|
+
onKeyDown(e) {
|
|
29
|
+
var o;
|
|
30
|
+
return e.event.key === "Escape" ? (r[0].hide(), t.destroy(), !0) : (o = t.ref) == null ? void 0 : o.onKeyDown(e);
|
|
31
|
+
},
|
|
32
|
+
onExit() {
|
|
33
|
+
r[0].destroy(), t.destroy();
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
export {
|
|
39
|
+
m as default
|
|
40
|
+
};
|