@clevertask/scribe 0.0.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 (41) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +167 -0
  3. package/dist/SlashCommandList-DYKFukY8.js +3734 -0
  4. package/dist/components/Menu/BarMenu.d.ts +7 -0
  5. package/dist/components/Menu/BarMenu.js +119 -0
  6. package/dist/components/Menu/BubbleMenu.d.ts +7 -0
  7. package/dist/components/Menu/BubbleMenu.js +176 -0
  8. package/dist/components/Scribe/extension/extension-link.d.ts +2 -0
  9. package/dist/components/Scribe/extension/extension-link.js +934 -0
  10. package/dist/components/Scribe/extension/extension-selectedText.d.ts +12 -0
  11. package/dist/components/Scribe/extension/extension-selectedText.js +13 -0
  12. package/dist/components/Scribe/extension/index.d.ts +2 -0
  13. package/dist/components/Scribe/extension/index.js +1647 -0
  14. package/dist/components/Scribe/extension/slashCommand/SlashCommandList.d.ts +5 -0
  15. package/dist/components/Scribe/extension/slashCommand/SlashCommandList.js +10 -0
  16. package/dist/components/Scribe/extension/slashCommand/index.d.ts +4 -0
  17. package/dist/components/Scribe/extension/slashCommand/index.js +154 -0
  18. package/dist/components/Scribe/extension/slashCommand/items.d.ts +23 -0
  19. package/dist/components/Scribe/extension/slashCommand/items.js +159 -0
  20. package/dist/components/Scribe/extension/slashCommand/renderItems.d.ts +8 -0
  21. package/dist/components/Scribe/extension/slashCommand/renderItems.js +38 -0
  22. package/dist/components/Scribe/index.d.ts +28 -0
  23. package/dist/components/Scribe/index.js +92 -0
  24. package/dist/index-Cu10LNOZ.js +2505 -0
  25. package/dist/index-CzwFCNeI.js +12114 -0
  26. package/dist/main.css +1134 -0
  27. package/dist/main.d.ts +2 -0
  28. package/dist/main.js +10 -0
  29. package/dist/marked.esm-DIt7dqAB.js +1574 -0
  30. package/dist/purify.es-Bzg5nW_L.js +524 -0
  31. package/dist/turndown.browser.es-DwgPoVx0.js +646 -0
  32. package/dist/utils/html-to-markdown.d.ts +1 -0
  33. package/dist/utils/html-to-markdown.js +11 -0
  34. package/dist/utils/index.d.ts +3 -0
  35. package/dist/utils/index.js +8 -0
  36. package/dist/utils/is-in-viewport.d.ts +1 -0
  37. package/dist/utils/is-in-viewport.js +7 -0
  38. package/dist/utils/markdown-to-html.d.ts +1 -0
  39. package/dist/utils/markdown-to-html.js +6 -0
  40. package/dist/vite-env.d.js +1 -0
  41. package/package.json +95 -0
@@ -0,0 +1,7 @@
1
+ import { Editor } from '@tiptap/react';
2
+ import { FC } from 'react';
3
+ export interface BarMenuProps {
4
+ editor: Editor;
5
+ }
6
+ declare const BarMenu: FC<BarMenuProps>;
7
+ export default BarMenu;
@@ -0,0 +1,119 @@
1
+ import { jsx as s, jsxs as a } from "react/jsx-runtime";
2
+ import { useCallback as l, Fragment as g } from "react";
3
+ const 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='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", 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='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", 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='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", 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.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", 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='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", 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='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", 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='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", 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='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", 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='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", 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='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", 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='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", 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%3crect%20x='6.5'%20y='13.375'%20width='15'%20height='1.25'%20fill='%23212529'/%3e%3c/svg%3e", Z = ({ editor: e }) => {
4
+ const t = l(() => {
5
+ const i = e.getAttributes("link").href, n = window.prompt("Link", i);
6
+ if (n !== null) {
7
+ if (n === "") {
8
+ e.chain().focus().extendMarkRange("link").unsetLink().run();
9
+ return;
10
+ }
11
+ e.chain().focus().extendMarkRange("link").setLink({ href: n }).selectTextblockEnd().run();
12
+ }
13
+ }, [e]), o = l(() => {
14
+ const i = e.getAttributes("image").src, n = window.prompt(
15
+ i ? "Update Image URL" : "Image URL",
16
+ i
17
+ );
18
+ n && e.chain().focus().setImage({ src: n }).run();
19
+ }, [e]), C = [
20
+ [
21
+ {
22
+ name: "bold",
23
+ icon: m,
24
+ command: () => e.chain().focus().toggleBold().run(),
25
+ isActive: () => e.isActive("bold")
26
+ },
27
+ {
28
+ name: "italic",
29
+ icon: h,
30
+ command: () => e.chain().focus().toggleItalic().run(),
31
+ isActive: () => e.isActive("italic")
32
+ },
33
+ {
34
+ name: "strike",
35
+ icon: L,
36
+ command: () => e.chain().focus().toggleStrike().run(),
37
+ isActive: () => e.isActive("strike")
38
+ }
39
+ ],
40
+ [
41
+ {
42
+ name: "inline-code",
43
+ icon: v,
44
+ command: () => e.chain().focus().toggleCode().run(),
45
+ isActive: () => e.isActive("code")
46
+ },
47
+ {
48
+ name: "highlight",
49
+ icon: r,
50
+ command: () => e.chain().focus().toggleHighlight().run(),
51
+ isActive: () => e.isActive("highlight")
52
+ }
53
+ ],
54
+ [
55
+ {
56
+ name: "unordered-list",
57
+ icon: d,
58
+ command: () => e.chain().focus().toggleBulletList().run(),
59
+ isActive: () => e.isActive("bulletList")
60
+ },
61
+ {
62
+ name: "ordered-list",
63
+ icon: w,
64
+ command: () => e.chain().focus().toggleOrderedList().run(),
65
+ isActive: () => e.isActive("orderedList")
66
+ }
67
+ ],
68
+ [
69
+ {
70
+ name: "link",
71
+ icon: x,
72
+ command: () => t(),
73
+ isActive: () => e.isActive("link")
74
+ },
75
+ {
76
+ name: "image",
77
+ icon: p,
78
+ command: () => o(),
79
+ isActive: () => e.isActive("image"),
80
+ disabled: !1
81
+ },
82
+ {
83
+ name: "code-block",
84
+ icon: f,
85
+ command: () => e.chain().focus().toggleCodeBlock().run(),
86
+ isActive: () => e.isActive("codeBlock")
87
+ },
88
+ {
89
+ name: "block-quote",
90
+ icon: H,
91
+ command: () => e.chain().focus().toggleBlockquote().run(),
92
+ isActive: () => e.isActive("blockquote")
93
+ },
94
+ {
95
+ name: "horizontal-line",
96
+ icon: u,
97
+ command: () => e.chain().focus().setHorizontalRule().run(),
98
+ isActive: () => !1
99
+ }
100
+ ]
101
+ ];
102
+ return /* @__PURE__ */ s("div", { className: "flex flex-row gap-4 border-b p-[8px]", children: C.map((i, n) => /* @__PURE__ */ a(g, { children: [
103
+ /* @__PURE__ */ s("div", { className: "flex gap-2", children: i.map((c) => /* @__PURE__ */ s(
104
+ "button",
105
+ {
106
+ title: c.name,
107
+ disabled: c == null ? void 0 : c.disabled,
108
+ className: `rounded-md ${c.isActive() ? "bg-gray-100" : ""} ${c != null && c.disabled ? "cursor-not-allowed bg-opacity-50" : ""}`,
109
+ onClick: c.command,
110
+ children: /* @__PURE__ */ s("img", { src: c.icon, alt: c.name })
111
+ },
112
+ c.name
113
+ )) }),
114
+ n !== C.length - 1 && /* @__PURE__ */ s("div", { className: "border-l" })
115
+ ] }, `format-group-${n}`)) });
116
+ };
117
+ export {
118
+ Z as default
119
+ };
@@ -0,0 +1,7 @@
1
+ import { Editor } from '@tiptap/react';
2
+ import { FC } from 'react';
3
+ export interface BubbleMenuProps {
4
+ editor: Editor;
5
+ }
6
+ declare const BubbleMenu: FC<BubbleMenuProps>;
7
+ export default BubbleMenu;
@@ -0,0 +1,176 @@
1
+ import { jsx as e } from "react/jsx-runtime";
2
+ import { B as o } from "../../index-Cu10LNOZ.js";
3
+ const l = ({ editor: n }) => /* @__PURE__ */ e(o, { className: "bubble-menu-wrapper", editor: n, children: /* @__PURE__ */ e("div", { className: "menu-item-wrapper", children: [
4
+ {
5
+ ariaLabel: "Heading 1",
6
+ command: () => n.chain().focus().toggleHeading({ level: 1 }).run(),
7
+ isActive: () => n.isActive("heading", { level: 1 }),
8
+ icon: /* @__PURE__ */ e(
9
+ "svg",
10
+ {
11
+ className: "menu-icon",
12
+ viewBox: "0 0 24 24",
13
+ fill: "none",
14
+ xmlns: "http://www.w3.org/2000/svg",
15
+ children: /* @__PURE__ */ e(
16
+ "path",
17
+ {
18
+ d: "M4.00023 5L4 17M13 5L12.9998 17M4 11H12.9998M19.875 19V10L17.625 12.25",
19
+ strokeWidth: "1.5",
20
+ strokeLinecap: "round",
21
+ strokeLinejoin: "round"
22
+ }
23
+ )
24
+ }
25
+ )
26
+ },
27
+ {
28
+ ariaLabel: "Heading 2",
29
+ command: () => n.chain().focus().toggleHeading({ level: 2 }).run(),
30
+ isActive: () => n.isActive("heading", { level: 2 }),
31
+ icon: /* @__PURE__ */ e(
32
+ "svg",
33
+ {
34
+ fill: "none",
35
+ xmlns: "http://www.w3.org/2000/svg",
36
+ className: "menu-icon",
37
+ viewBox: "0 0 24 24",
38
+ children: /* @__PURE__ */ e(
39
+ "path",
40
+ {
41
+ d: "M3.37402 5V17M12.374 5V17M3.37402 11H12.374M16.302 11.373C16.5035 10.8941 16.8644 10.4997 17.3236 10.2566C17.7829 10.0136 18.312 9.93705 18.8213 10.0399C19.3306 10.1427 19.7886 10.4186 20.1175 10.8207C20.4465 11.2229 20.6262 11.7265 20.626 12.246C20.628 12.694 20.494 13.132 20.242 13.503L16.123 19H20.626",
42
+ strokeWidth: "1.5",
43
+ strokeLinecap: "round",
44
+ strokeLinejoin: "round"
45
+ }
46
+ )
47
+ }
48
+ )
49
+ },
50
+ {
51
+ ariaLabel: "Heading 3",
52
+ command: () => n.chain().focus().toggleHeading({ level: 3 }).run(),
53
+ isActive: () => n.isActive("heading", { level: 3 }),
54
+ icon: /* @__PURE__ */ e(
55
+ "svg",
56
+ {
57
+ className: "menu-icon",
58
+ viewBox: "0 0 24 24",
59
+ fill: "none",
60
+ xmlns: "http://www.w3.org/2000/svg",
61
+ children: /* @__PURE__ */ e(
62
+ "path",
63
+ {
64
+ d: "M3.375 5V17M12.375 5V17M3.375 11H12.375M16.125 10H20.625L18 13.75C18.4317 13.7499 18.8568 13.8564 19.2375 14.0598C19.6183 14.2633 19.943 14.5575 20.1828 14.9165C20.4227 15.2754 20.5703 15.688 20.6127 16.1176C20.655 16.5472 20.5907 16.9807 20.4255 17.3795C20.2603 17.7783 19.9993 18.1303 19.6656 18.4042C19.3319 18.678 18.9358 18.8654 18.5123 18.9496C18.0889 19.0338 17.6513 19.0123 17.2382 18.8869C16.8251 18.7616 16.4492 18.5363 16.144 18.231",
65
+ strokeWidth: "1.5",
66
+ strokeLinecap: "round",
67
+ strokeLinejoin: "round"
68
+ }
69
+ )
70
+ }
71
+ )
72
+ },
73
+ {
74
+ ariaLabel: "Bold",
75
+ command: () => n.chain().focus().toggleBold().run(),
76
+ isActive: () => n.isActive("bold"),
77
+ icon: /* @__PURE__ */ e(
78
+ "svg",
79
+ {
80
+ className: "menu-icon",
81
+ viewBox: "0 0 24 24",
82
+ fill: "none",
83
+ xmlns: "http://www.w3.org/2000/svg",
84
+ children: /* @__PURE__ */ e(
85
+ "path",
86
+ {
87
+ d: "M12.8571 12C13.918 12 14.9354 11.5786 15.6856 10.8284C16.4357 10.0783 16.8571 9.06087 16.8571 8C16.8571 6.93913 16.4357 5.92172 15.6856 5.17157C14.9354 4.42143 13.918 4 12.8571 4H6V12M12.8571 12H6M12.8571 12H14C15.0609 12 16.0783 12.4214 16.8284 13.1716C17.5786 13.9217 18 14.9391 18 16C18 17.0609 17.5786 18.0783 16.8284 18.8284C16.0783 19.5786 15.0609 20 14 20H6V12",
88
+ strokeWidth: "1.5",
89
+ strokeLinecap: "round",
90
+ strokeLinejoin: "round"
91
+ }
92
+ )
93
+ }
94
+ )
95
+ },
96
+ {
97
+ ariaLabel: "Italic",
98
+ command: () => n.chain().focus().toggleItalic().run(),
99
+ isActive: () => n.isActive("italic"),
100
+ icon: /* @__PURE__ */ e(
101
+ "svg",
102
+ {
103
+ className: "menu-icon",
104
+ viewBox: "0 0 24 24",
105
+ fill: "none",
106
+ xmlns: "http://www.w3.org/2000/svg",
107
+ children: /* @__PURE__ */ e(
108
+ "path",
109
+ {
110
+ d: "M10.8571 4H17.7142M6.28564 20H13.1428M14.2856 4L9.71422 20",
111
+ strokeWidth: "1.5",
112
+ strokeLinecap: "round",
113
+ strokeLinejoin: "round"
114
+ }
115
+ )
116
+ }
117
+ )
118
+ },
119
+ {
120
+ ariaLabel: "Strike",
121
+ command: () => n.chain().focus().toggleStrike().run(),
122
+ isActive: () => n.isActive("strike"),
123
+ icon: /* @__PURE__ */ e(
124
+ "svg",
125
+ {
126
+ className: "menu-icon",
127
+ viewBox: "0 0 24 24",
128
+ fill: "none",
129
+ xmlns: "http://www.w3.org/2000/svg",
130
+ children: /* @__PURE__ */ e(
131
+ "path",
132
+ {
133
+ d: "M11.0121 12H12.9874C15.1693 12 16.938 13.7909 16.938 16C16.938 18.2091 15.1693 20 12.9874 20H11.0121C8.83024 20 7.06149 18.2091 7.06149 16M16.938 8C16.938 5.79086 15.1693 4 12.9874 4H11.0121C8.83024 4 7.06149 5.79086 7.06149 8C7.06149 8.3453 7.1047 8.68038 7.18595 9M4 12H20",
134
+ strokeWidth: "1.5",
135
+ strokeLinecap: "round",
136
+ strokeLinejoin: "round"
137
+ }
138
+ )
139
+ }
140
+ )
141
+ },
142
+ {
143
+ ariaLabel: "Inline code",
144
+ command: () => n.chain().focus().toggleCode().run(),
145
+ isActive: () => n.isActive("code"),
146
+ icon: /* @__PURE__ */ e(
147
+ "svg",
148
+ {
149
+ className: "menu-icon",
150
+ viewBox: "0 0 24 24",
151
+ fill: "none",
152
+ xmlns: "http://www.w3.org/2000/svg",
153
+ children: /* @__PURE__ */ e(
154
+ "path",
155
+ {
156
+ d: "M16.5 16.5L21 12L16.5 7.50002M7.5 7.50002L3 12L7.5 16.5M13.8 3.90002L10.2 20.1",
157
+ strokeWidth: "1.5",
158
+ strokeLinecap: "round",
159
+ strokeLinejoin: "round"
160
+ }
161
+ )
162
+ }
163
+ )
164
+ }
165
+ ].map((i) => /* @__PURE__ */ e(
166
+ "button",
167
+ {
168
+ className: `${i.isActive() ? "active" : ""}`,
169
+ onClick: i.command,
170
+ children: i.icon
171
+ },
172
+ i.ariaLabel
173
+ )) }) });
174
+ export {
175
+ l as default
176
+ };
@@ -0,0 +1,2 @@
1
+ declare const _default: import('@tiptap/core').Mark<import('@tiptap/extension-link').LinkOptions, any>;
2
+ export default _default;