@pubwave/editor 0.1.1 → 0.1.3

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/README.md CHANGED
@@ -600,32 +600,15 @@ const customCommands: SlashCommand[] = [
600
600
 
601
601
  ---
602
602
 
603
- ## ⚡ SSR Integration (Next.js)
604
603
 
605
- The library is SSR-safe and can be imported server-side without errors. The editor component itself renders client-side only.
606
604
 
607
- ```tsx
608
- 'use client';
609
-
610
- import { PubwaveEditor } from '@pubwave/editor';
611
- import '@pubwave/editor/style.css';
612
-
613
- export default function EditorComponent() {
614
- return <PubwaveEditor />;
615
- }
616
- ```
617
605
 
618
- ---
619
606
 
620
607
 
621
608
  ## 🐛 Troubleshooting
622
609
 
623
610
  ### Common Issues
624
611
 
625
- **Q: The editor doesn't render in Next.js SSR**
626
- - Make sure you're using `'use client'` directive
627
- - Ensure the component is marked as a client component
628
-
629
612
  **Q: Styles are not applied**
630
613
  - Ensure you've imported the CSS: `import '@pubwave/editor/style.css'`
631
614
  - Check that CSS custom properties are defined
@@ -650,11 +633,6 @@ export default function EditorComponent() {
650
633
 
651
634
  ---
652
635
 
653
- ## 🤝 Contributing
654
-
655
- See [CONTRIBUTING.md](./CONTRIBUTING.md) for development setup and guidelines.
656
-
657
- ---
658
636
 
659
637
  ## 📄 License
660
638
 
package/dist/index.cjs CHANGED
@@ -463,6 +463,13 @@ function safeRequestAnimationFrame(callback) {
463
463
  }
464
464
  return 0;
465
465
  }
466
+ function isMobileDevice() {
467
+ if (!canUseDOM) return false;
468
+ const hasTouchSupport = "ontouchstart" in window || navigator.maxTouchPoints > 0;
469
+ const hasCoarsePointer = window.matchMedia("(pointer: coarse)").matches;
470
+ const hasHover = window.matchMedia("(hover: hover)").matches;
471
+ return hasTouchSupport && hasCoarsePointer || hasTouchSupport && !hasHover;
472
+ }
466
473
  function TextIcon() {
467
474
  return /* @__PURE__ */ jsxRuntime.jsx("svg", { width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M4 7V4h16v3M9 20h6M12 4v16" }) });
468
475
  }
@@ -6302,18 +6309,31 @@ function BlockHandle({ editor }) {
6302
6309
  const [visible, setVisible] = React.useState(false);
6303
6310
  const [isDragging, setIsDragging] = React.useState(false);
6304
6311
  const [position, setPosition] = React.useState({ top: 0 });
6312
+ const [isMobile, setIsMobile] = React.useState(false);
6313
+ React.useEffect(() => {
6314
+ const checkMobile = () => {
6315
+ setIsMobile(isMobileDevice());
6316
+ };
6317
+ checkMobile();
6318
+ window.addEventListener("resize", checkMobile);
6319
+ return () => {
6320
+ window.removeEventListener("resize", checkMobile);
6321
+ };
6322
+ }, []);
6305
6323
  const updatePosition = React.useCallback(() => {
6306
6324
  const container = containerRef.current;
6307
6325
  const block = currentBlockRef.current;
6308
6326
  if (!container || !block) return;
6309
6327
  const editorContainer = container.closest(".pubwave-editor");
6310
6328
  if (!editorContainer) return;
6329
+ void editorContainer.offsetHeight;
6311
6330
  const editorRect = editorContainer.getBoundingClientRect();
6312
6331
  let offset2 = 14;
6313
6332
  let target = block;
6314
6333
  if (["UL", "OL", "BLOCKQUOTE"].includes(block.tagName) && block.firstElementChild instanceof HTMLElement) {
6315
6334
  target = block.firstElementChild;
6316
6335
  }
6336
+ void target.offsetHeight;
6317
6337
  const targetRect = target.getBoundingClientRect();
6318
6338
  try {
6319
6339
  const style = window.getComputedStyle(target);
@@ -6332,12 +6352,18 @@ function BlockHandle({ editor }) {
6332
6352
  } catch (e) {
6333
6353
  }
6334
6354
  const top2 = targetRect.top - editorRect.top + offset2;
6335
- setPosition({ top: top2 });
6355
+ if (!isNaN(top2) && isFinite(top2) && top2 >= 0) {
6356
+ setPosition({ top: top2 });
6357
+ }
6336
6358
  }, []);
6337
6359
  const showHandle = React.useCallback((block) => {
6338
6360
  currentBlockRef.current = block;
6339
6361
  setVisible(true);
6340
- setTimeout(updatePosition, 0);
6362
+ requestAnimationFrame(() => {
6363
+ requestAnimationFrame(() => {
6364
+ updatePosition();
6365
+ });
6366
+ });
6341
6367
  }, [updatePosition]);
6342
6368
  const hideHandle = React.useCallback(() => {
6343
6369
  if (!isDraggingRef.current) {
@@ -6399,8 +6425,16 @@ function BlockHandle({ editor }) {
6399
6425
  hideHandle();
6400
6426
  }, 150);
6401
6427
  };
6428
+ const onEditorMouseLeave = () => {
6429
+ if (isDraggingRef.current) return;
6430
+ clearHideTimeout();
6431
+ hideTimeoutRef.current = setTimeout(() => {
6432
+ hideHandle();
6433
+ }, 150);
6434
+ };
6402
6435
  proseMirror.addEventListener("mouseover", onMouseOver);
6403
6436
  proseMirror.addEventListener("mouseout", onMouseOut);
6437
+ editorContainer.addEventListener("mouseleave", onEditorMouseLeave);
6404
6438
  const handleTransaction = ({ transaction }) => {
6405
6439
  if (transaction.docChanged && !isDraggingRef.current) {
6406
6440
  hideHandle();
@@ -6410,10 +6444,20 @@ function BlockHandle({ editor }) {
6410
6444
  return () => {
6411
6445
  proseMirror.removeEventListener("mouseover", onMouseOver);
6412
6446
  proseMirror.removeEventListener("mouseout", onMouseOut);
6447
+ editorContainer.removeEventListener("mouseleave", onEditorMouseLeave);
6413
6448
  editor.off("transaction", handleTransaction);
6414
6449
  clearHideTimeout();
6415
6450
  };
6416
6451
  }, [editor, showHandle, hideHandle, clearHideTimeout]);
6452
+ React.useEffect(() => {
6453
+ if (visible && currentBlockRef.current) {
6454
+ requestAnimationFrame(() => {
6455
+ requestAnimationFrame(() => {
6456
+ updatePosition();
6457
+ });
6458
+ });
6459
+ }
6460
+ }, [visible, updatePosition]);
6417
6461
  React.useEffect(() => {
6418
6462
  if (!visible) return;
6419
6463
  const onScroll = () => {
@@ -6508,7 +6552,7 @@ function BlockHandle({ editor }) {
6508
6552
  }
6509
6553
  setVisible(false);
6510
6554
  }, []);
6511
- if (!visible) return null;
6555
+ if (isMobile || !visible) return null;
6512
6556
  return /* @__PURE__ */ jsxRuntime.jsxs(
6513
6557
  "div",
6514
6558
  {
@@ -7515,6 +7559,7 @@ exports.handleSelectionClear = handleSelectionClear;
7515
7559
  exports.isEditable = isEditable;
7516
7560
  exports.isEditorValid = isEditorValid;
7517
7561
  exports.isMarkActive = isMarkActive;
7562
+ exports.isMobileDevice = isMobileDevice;
7518
7563
  exports.isNodeActive = isNodeActive;
7519
7564
  exports.isReadOnly = isReadOnly;
7520
7565
  exports.isSSR = isSSR;
package/dist/index.css CHANGED
@@ -1,2 +1,2 @@
1
1
  /*! tailwindcss v4.1.18 | MIT License | https://tailwindcss.com */
2
- @layer properties{@supports ((-webkit-hyphens:none) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-border-style:solid;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial}}}.invisible{visibility:hidden}.visible{visibility:visible}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.isolate{isolation:isolate}.container{width:100%}.block{display:block}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.table{display:table}.transform{transform:var(--tw-rotate-x,)var(--tw-rotate-y,)var(--tw-rotate-z,)var(--tw-skew-x,)var(--tw-skew-y,)}.resize{resize:both}.border{border-style:var(--tw-border-style);border-width:1px}.uppercase{text-transform:uppercase}.italic{font-style:italic}.underline{text-decoration-line:underline}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.filter{filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,ease);transition-duration:var(--tw-duration,0s)}:root{--pubwave-bg:#fff;--pubwave-surface:#fff;--pubwave-text:#37352f;--pubwave-text-muted:#9b9a97;--pubwave-border:#e3e2e0;--pubwave-border-light:#f3f4f6;--pubwave-hover:#f7f6f3;--pubwave-focus:#0000000d;--pubwave-selection:#3b82f6;--pubwave-selection-bg:#2383e226;--pubwave-primary:#2383e2;--pubwave-primary-hover:#2563eb;--pubwave-handle-color:#9b9a97;--pubwave-primary-faded:#3b82f61a;--pubwave-drop-indicator:#3b82f6;--pubwave-drop-target:#3b82f60d;--pubwave-error:#ef4444;--pubwave-success:#10b981;--pubwave-warning:#f59e0b;--pubwave-text-secondary:#374151;--pubwave-text-tertiary:#4b5563;--pubwave-hover-bg:#f3f4f6;--pubwave-hover-task:#e8f2ff;--pubwave-checked-text:#9ca3af;--pubwave-spacing-xs:.25rem;--pubwave-spacing-sm:.5rem;--pubwave-spacing-md:1rem;--pubwave-spacing-lg:1.5rem;--pubwave-spacing-xl:2rem;--pubwave-spacing-1:4px;--pubwave-spacing-2:8px;--pubwave-spacing-3:12px;--pubwave-spacing-4:16px;--pubwave-spacing-7:28px;--pubwave-font-family:inherit;--pubwave-font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--pubwave-font-size-xs:11px;--pubwave-font-size-sm:13px;--pubwave-font-size-base:14px;--pubwave-font-size-md:1rem;--pubwave-font-size-lg:1.125rem;--pubwave-font-size-xl:1.25rem;--pubwave-font-size-2xl:1.5rem;--pubwave-font-size-3xl:2rem;--pubwave-line-height:1.625;--pubwave-line-height-heading:1.25;--pubwave-button-width:28px;--pubwave-button-height:28px;--pubwave-icon-size:20px;--pubwave-checkbox-size:20px;--pubwave-checkbox-input-size:16px;--pubwave-divider-width:1px;--pubwave-divider-height:20px;--pubwave-drop-indicator-width:2px;--pubwave-drop-indicator-height:2px;--pubwave-task-item-height:30px;--pubwave-radius-xs:3px;--pubwave-radius-sm:4px;--pubwave-radius:6px;--pubwave-radius-md:6px;--pubwave-radius-lg:8px;--pubwave-shadow-sm:0 1px 2px 0 #0000000d;--pubwave-shadow:0 4px 6px -1px #0000001a,0 2px 4px -1px #0000000f;--pubwave-shadow-lg:0 10px 15px -3px #0000001a,0 4px 6px -2px #0000000d}@media (prefers-color-scheme:dark){:root{--pubwave-bg:#1a1a1a;--pubwave-surface:#262626;--pubwave-text:#e5e7eb;--pubwave-text-muted:#9ca3af;--pubwave-border:#374151;--pubwave-border-light:#4b5563;--pubwave-hover:#ffffff0d;--pubwave-focus:#ffffff14;--pubwave-selection:#60a5fa;--pubwave-selection-bg:#60a5fa26;--pubwave-primary:#60a5fa;--pubwave-primary-hover:#3b82f6;--pubwave-primary-faded:#60a5fa26;--pubwave-drop-indicator:#60a5fa;--pubwave-drop-target:#60a5fa14;--pubwave-error:#f87171;--pubwave-text-secondary:#d1d5db;--pubwave-text-tertiary:#9ca3af;--pubwave-hover-bg:#374151;--pubwave-hover-task:#3b82f626;--pubwave-checked-text:#6b7280}}.pubwave-editor{width:var(--pubwave-container-width,100%);max-width:var(--pubwave-container-max-width,none);font-family:var(--pubwave-font-family);color:var(--pubwave-text);background:var(--pubwave-bg,#fff);border-radius:var(--pubwave-container-border-radius,16px);min-height:var(--pubwave-container-min-height,700px);padding:var(--pubwave-container-padding-y,96px)var(--pubwave-container-padding-x,120px);padding-left:var(--pubwave-container-padding-left,140px);position:relative;box-shadow:0 0 0 1px #0000000a,0 20px 25px -5px #0000000d,0 10px 10px -5px #00000005}@media (max-width:768px){.pubwave-editor{padding:var(--pubwave-container-padding-y-mobile,20px)var(--pubwave-container-padding-x-mobile,16px);padding-left:var(--pubwave-container-padding-left-mobile,16px);border-radius:var(--pubwave-container-border-radius-mobile,12px);min-height:var(--pubwave-container-min-height-mobile,400px)}}.pubwave-editor,.pubwave-editor *,.pubwave-editor :before,.pubwave-editor :after{box-sizing:border-box}.pubwave-editor__content{outline:none;flex-direction:column;min-height:1em;display:flex}.pubwave-editor__content .ProseMirror{min-height:100%;padding-bottom:30vh;padding-top:var(--pubwave-spacing-md,1rem);outline:none;flex-grow:1}.pubwave-editor__content .ProseMirror p.is-editor-empty:first-child:before,.pubwave-editor__content.ProseMirror-focused p.pubwave-editor__node--empty:before,.ProseMirror.ProseMirror-focused p.pubwave-editor__node--empty:before{content:attr(data-placeholder);float:left;color:var(--pubwave-text-muted);pointer-events:none;height:0}.pubwave-editor__content .ProseMirror>*+*{margin-top:.75em}@media (max-width:768px){.pubwave-editor__content .ProseMirror>*+*{margin-top:.35em}.pubwave-editor__content .ProseMirror h1+*,.pubwave-editor__content .ProseMirror h2+*,.pubwave-editor__content .ProseMirror h3+*{margin-top:.4em}.pubwave-editor__content .ProseMirror h1,.pubwave-editor__content .ProseMirror h2,.pubwave-editor__content .ProseMirror h3{margin-top:.6em}.pubwave-editor__content .ProseMirror{font-size:var(--pubwave-font-size-base-mobile,15px)}.pubwave-editor__content .ProseMirror h1{font-size:var(--pubwave-font-size-3xl-mobile,1.75rem)}.pubwave-editor__content .ProseMirror h2{font-size:var(--pubwave-font-size-2xl-mobile,1.375rem)}.pubwave-editor__content .ProseMirror h3{font-size:var(--pubwave-font-size-xl-mobile,1.125rem)}}.pubwave-editor__content .pubwave-editor__bullet-list,.pubwave-editor__content .pubwave-editor__ordered-list{padding-left:1.3em!important}.pubwave-editor__content .ProseMirror p{line-height:var(--pubwave-line-height);margin:0}.pubwave-editor__content .ProseMirror h1,.pubwave-editor__content .ProseMirror h2,.pubwave-editor__content .ProseMirror h3{line-height:var(--pubwave-line-height-heading);margin:0;font-weight:600}.pubwave-editor__content .ProseMirror h1{font-size:var(--pubwave-font-size-3xl)}.pubwave-editor__content .ProseMirror h2{font-size:var(--pubwave-font-size-2xl)}.pubwave-editor__content .ProseMirror h3{font-size:var(--pubwave-font-size-xl)}.pubwave-editor__content .ProseMirror ul:not([data-type=taskList]),.pubwave-editor__content .ProseMirror ol{margin:0;padding-left:1.5em}.pubwave-editor__content .ProseMirror li:not([data-type=taskItem]):not(.pubwave-editor__task-item){margin:.25em 0}.pubwave-editor__content .ProseMirror li>p{margin:0}.pubwave-editor__content ul[data-type=taskList]{padding:var(--pubwave-spacing-4,16px)0;margin:0!important;padding-left:0!important;list-style:none!important}.pubwave-editor__content .ProseMirror ul[data-type=taskList] li,.pubwave-editor__content .ProseMirror ul[data-type=taskList]>li,.pubwave-editor__content .ProseMirror ul[data-type=taskList] li[data-type=taskItem],.pubwave-editor__content .ProseMirror ul[data-type=taskList] li.pubwave-editor__task-item,.pubwave-editor__content .ProseMirror .pubwave-editor__task-item,.pubwave-editor__content.ProseMirror ul[data-type=taskList] li,.ProseMirror.pubwave-editor__content ul[data-type=taskList] li{border-radius:var(--pubwave-radius-sm,4px)!important;-webkit-appearance:none!important;-moz-appearance:none!important;appearance:none!important;flex-direction:row!important;align-items:center!important;gap:.5em!important;margin:0!important;padding:0!important;list-style:none!important;display:flex!important}.pubwave-editor__task-item{height:var(--pubwave-task-item-height,30px)}.pubwave-editor__content .ProseMirror ul[data-type=taskList] li::marker{content:""!important;width:0!important;font-size:0!important;display:none!important}.pubwave-editor__content .ProseMirror ul[data-type=taskList] li[data-type=taskItem]::marker{content:""!important;width:0!important;font-size:0!important;display:none!important}.pubwave-editor__content .ProseMirror ul[data-type=taskList] li.pubwave-editor__task-item::marker{content:""!important;width:0!important;font-size:0!important;display:none!important}.pubwave-editor__content .ProseMirror ul[data-type=taskList] li:before,.pubwave-editor__content .ProseMirror ul[data-type=taskList] li[data-type=taskItem]:before,.pubwave-editor__content .ProseMirror ul[data-type=taskList] li.pubwave-editor__task-item:before{content:""!important;width:0!important;display:none!important}.pubwave-editor__content .ProseMirror ul[data-type=taskList] li:hover,.pubwave-editor__content .ProseMirror ul[data-type=taskList] li.ProseMirror-selectednode{background-color:var(--pubwave-hover-task,#e8f2ff)}.pubwave-editor__content .ProseMirror ul[data-type=taskList] li>label,.pubwave-editor__content .ProseMirror ul[data-type=taskList] li[data-type=taskItem]>label,.pubwave-editor__content .ProseMirror ul[data-type=taskList] li.pubwave-editor__task-item>label{cursor:pointer!important;width:var(--pubwave-checkbox-size,20px)!important;height:var(--pubwave-checkbox-size,20px)!important;min-height:var(--pubwave-checkbox-size,20px)!important;max-height:var(--pubwave-checkbox-size,20px)!important;flex-shrink:0!important;align-self:center!important;margin:0!important;padding:0!important;line-height:1!important;display:block!important;position:relative!important;overflow:hidden!important}li>label input[type=checkbox]{width:var(--pubwave-checkbox-input-size,16px);height:var(--pubwave-checkbox-input-size,16px);cursor:pointer;margin-top:5px}.pubwave-editor__content .ProseMirror ul[data-type=taskList] li>label:before{content:"";width:var(--pubwave-checkbox-size,20px);height:var(--pubwave-checkbox-size,20px);border:1.5px solid var(--pubwave-text,#1a1a1a);border-radius:var(--pubwave-radius-xs,3px);background-color:var(--pubwave-bg,#fff);box-sizing:border-box;transition:all .15s;display:block;position:absolute;top:0;left:0}.pubwave-editor__content .ProseMirror ul[data-type=taskList] li[data-checked=true]>label:before{background-color:var(--pubwave-primary-hover,#2563eb);border-color:var(--pubwave-primary-hover,#2563eb)}.pubwave-editor__content .ProseMirror ul[data-type=taskList] li[data-checked=true]>label:after{content:"";border:solid var(--pubwave-bg,#fff);box-sizing:border-box;z-index:1;border-width:0 2px 2px 0;width:5px;height:10px;position:absolute;top:3px;left:6px;transform:rotate(45deg)}.pubwave-editor__content ul[data-type=taskList] li>div,.pubwave-editor__content ul[data-type=taskList] li[data-type=taskItem]>div,.pubwave-editor__content ul[data-type=taskList] li.pubwave-editor__task-item>div{min-width:0!important;color:var(--pubwave-text,#1a1a1a)!important;flex:1!important;margin:0!important;padding:.1em 0!important;display:block!important}.pubwave-editor__content ul[data-type=taskList] li>div p,.pubwave-editor__content ul[data-type=taskList] li[data-type=taskItem]>div p,.pubwave-editor__content ul[data-type=taskList] li.pubwave-editor__task-item>div p,.pubwave-editor__content ul[data-type=taskList] li>div>p,.pubwave-editor__content ul[data-type=taskList] li>div p.pubwave-editor__paragraph,.pubwave-editor__content ul[data-type=taskList] li[data-type=taskItem]>div p.pubwave-editor__paragraph{width:100%!important;min-height:1.5em!important;margin:0!important;padding:0!important;line-height:1.5!important;display:block!important}.pubwave-editor__content.ProseMirror ul[data-type=taskList] li[data-checked=true]>div p,.pubwave-editor__content ul[data-type=taskList] li[data-checked=true]>div p{color:var(--pubwave-checked-text,#9ca3af)!important;text-decoration:line-through!important}.pubwave-editor__content blockquote,.pubwave-editor__content.ProseMirror blockquote{margin:.5em 0;padding-left:1em;font-style:italic;border-left:3px solid var(--pubwave-text,#1a1a1a)!important}.pubwave-editor__content .ProseMirror pre,.pubwave-editor__content pre{margin:.5em 0;padding:.5em .75em;line-height:1.5;overflow-x:auto;background:var(--pubwave-border-light,#f3f4f6)!important;border-radius:var(--pubwave-radius-md,6px)!important;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace!important;font-size:var(--pubwave-font-size-sm,13px)!important;color:#1a1a1a!important}.pubwave-editor__content .ProseMirror pre code,.pubwave-editor__content pre code{font-size:inherit!important;color:inherit!important;background:0 0!important;border-radius:0!important;padding:0!important;font-family:inherit!important}.pubwave-block{padding-left:2.5em;position:relative}.pubwave-block-menu{z-index:2;align-items:center;gap:.5em;display:flex;position:absolute;top:50%;left:.5em;transform:translateY(-50%)}.pubwave-editor__content .ProseMirror hr,.pubwave-editor__content hr,.pubwave-editor__content .pubwave-editor__divider{border:none;border-top:1px solid var(--pubwave-border,#e5e7eb)!important;background:0 0!important;height:0!important;margin:1em 0!important}.pubwave-editor__content .ProseMirror img,.pubwave-editor__content img,.pubwave-editor__content .pubwave-editor__image{border-radius:var(--pubwave-radius-md,6px);cursor:pointer;max-width:100%;height:auto;margin:1em auto;transition:opacity .2s;display:block;box-shadow:0 1px 3px #0000001a}.pubwave-editor__content .ProseMirror img:hover,.pubwave-editor__content img:hover,.pubwave-editor__content .pubwave-editor__image:hover{opacity:.9}.pubwave-editor__content .ProseMirror img.ProseMirror-selectednode,.pubwave-editor__content img.ProseMirror-selectednode,.pubwave-editor__content .pubwave-editor__image.ProseMirror-selectednode{outline:2px solid var(--pubwave-primary,#2383e2);outline-offset:2px}.pubwave-editor__content .ProseMirror strong{font-weight:600}.pubwave-editor__content .ProseMirror em{font-style:italic}.pubwave-editor__content .ProseMirror u{text-decoration:underline}.pubwave-editor__content .ProseMirror s{text-decoration:line-through}.pubwave-editor__content .ProseMirror code{background:var(--pubwave-hover);border-radius:var(--pubwave-radius-sm);font-family:var(--pubwave-font-mono);padding:.15em .35em;font-size:.9em}.pubwave-editor__content .ProseMirror a,.pubwave-editor .ProseMirror a{cursor:pointer;text-decoration:underline;color:var(--pubwave-link-color,#2383e2)!important}.pubwave-editor__content .ProseMirror a:hover,.pubwave-editor .ProseMirror a:hover{opacity:.8;color:var(--pubwave-link-hover-color,var(--pubwave-link-color,#2383e2))!important}.pubwave-editor__content .ProseMirror ::-moz-selection{background-color:var(--pubwave-selection-bg)}.pubwave-editor__content .ProseMirror ::selection{background-color:var(--pubwave-selection-bg)}.pubwave-editor--readonly,.pubwave-editor--readonly .pubwave-editor__content{cursor:default}.pubwave-block--dragging{opacity:.4}.pubwave-block--drag-preview{color:var(--pubwave-text-muted,#9b9a97)!important;opacity:.6!important}.pubwave-block--drag-preview div,.pubwave-block--drag-preview p,.pubwave-block--drag-preview label,.pubwave-block--drag-preview .pubwave-editor__task-item>div{color:var(--pubwave-text-muted,#9b9a97)!important}.pubwave-block--drag-preview label input{display:none!important}.pubwave-block--drag-preview label:before{border-color:var(--pubwave-text-muted,#9b9a97)!important;width:16px!important;height:16px!important}.pubwave-block--drag-preview label:after{border-color:var(--pubwave-bg,#fff)!important;top:2px!important;left:4px!important}.ProseMirror .ProseMirror-gapcursor{pointer-events:none;display:none;position:absolute}.ProseMirror .ProseMirror-gapcursor:after{content:"";border-top:1px solid var(--pubwave-text);width:20px;animation:1.1s steps(2,start) infinite pubwave-cursor-blink;display:block;position:absolute;top:-2px}@keyframes pubwave-cursor-blink{to{visibility:hidden}}.ProseMirror-focused .ProseMirror-gapcursor{display:block}.tippy-box{z-index:var(--pubwave-z-dropdown,60)!important;background:0 0!important;border:none!important}.tippy-box:has(.pubwave-slash-menu){background:0 0!important;border:none!important}.pubwave-slash-menu{border:1px solid var(--pubwave-border,#e3e2e0)!important}.ProseMirror-dropcursor{border-left:2px solid var(--pubwave-primary);pointer-events:none}.pubwave-editor .ProseMirror .suggestion{border:1px solid var(--pubwave-border,#e3e2e0)!important;border-radius:var(--pubwave-radius-md,6px)!important;color:#1f2937!important;background-color:#fffffff2!important;padding:2px 4px!important;display:inline-block!important}.pubwave-editor .ProseMirror .suggestion,.pubwave-editor .ProseMirror .suggestion *,.pubwave-editor .ProseMirror .suggestion span,.pubwave-editor .ProseMirror .suggestion strong,.pubwave-editor .ProseMirror .suggestion em,.pubwave-editor .ProseMirror .suggestion code{color:#1f2937!important}.tippy-box,.tippy-box[data-theme]{z-index:60!important}.tippy-box[data-theme~=pubwave]{box-shadow:none;background:0 0;border:none}.tippy-box[data-theme~=pubwave] .tippy-content{padding:0}.tippy-box[data-theme~=light-border]{border-radius:var(--pubwave-radius,6px);box-shadow:var(--pubwave-shadow-md,0 4px 6px -1px #0000001a);padding:4px 8px;font-size:12px;color:#fff!important;background-color:#000!important;border:none!important}.tippy-box[data-theme~=light-border] .tippy-content{color:#fff!important}.pubwave-block-handle__drag,.pubwave-block-handle__add{color:var(--pubwave-text-muted,#9b9a97)!important}.pubwave-toolbar__button:not(:disabled):hover,.pubwave-toolbar__turn-into-option:not(.pubwave-toolbar__turn-into-option--active):hover{background-color:var(--pubwave-hover)!important}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}.tippy-box[data-animation=fade][data-state=hidden]{opacity:0}[data-tippy-root]{max-width:calc(100vw - 10px)}.tippy-box{position:relative;background-color:#333;color:#fff;border-radius:4px;font-size:14px;line-height:1.4;white-space:normal;outline:0;transition-property:transform,visibility,opacity}.tippy-box[data-placement^=top]>.tippy-arrow{bottom:0}.tippy-box[data-placement^=top]>.tippy-arrow:before{bottom:-7px;left:0;border-width:8px 8px 0;border-top-color:initial;transform-origin:center top}.tippy-box[data-placement^=bottom]>.tippy-arrow{top:0}.tippy-box[data-placement^=bottom]>.tippy-arrow:before{top:-7px;left:0;border-width:0 8px 8px;border-bottom-color:initial;transform-origin:center bottom}.tippy-box[data-placement^=left]>.tippy-arrow{right:0}.tippy-box[data-placement^=left]>.tippy-arrow:before{border-width:8px 0 8px 8px;border-left-color:initial;right:-7px;transform-origin:center left}.tippy-box[data-placement^=right]>.tippy-arrow{left:0}.tippy-box[data-placement^=right]>.tippy-arrow:before{left:-7px;border-width:8px 8px 8px 0;border-right-color:initial;transform-origin:center right}.tippy-box[data-inertia][data-state=visible]{transition-timing-function:cubic-bezier(.54,1.5,.38,1.11)}.tippy-arrow{width:16px;height:16px;color:#333}.tippy-arrow:before{content:"";position:absolute;border-color:transparent;border-style:solid}.tippy-content{position:relative;padding:5px 9px;z-index:1}
2
+ @layer properties{@supports ((-webkit-hyphens:none) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-border-style:solid;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial}}}.invisible{visibility:hidden}.visible{visibility:visible}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.isolate{isolation:isolate}.container{width:100%}.block{display:block}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.transform{transform:var(--tw-rotate-x,)var(--tw-rotate-y,)var(--tw-rotate-z,)var(--tw-skew-x,)var(--tw-skew-y,)}.resize{resize:both}.border{border-style:var(--tw-border-style);border-width:1px}.uppercase{text-transform:uppercase}.italic{font-style:italic}.underline{text-decoration-line:underline}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.filter{filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,ease);transition-duration:var(--tw-duration,0s)}:root{--pubwave-bg:#fff;--pubwave-surface:#fff;--pubwave-text:#37352f;--pubwave-text-muted:#9b9a97;--pubwave-border:#e3e2e0;--pubwave-border-light:#f3f4f6;--pubwave-hover:#f7f6f3;--pubwave-focus:#0000000d;--pubwave-selection:#3b82f6;--pubwave-selection-bg:#2383e226;--pubwave-primary:#2383e2;--pubwave-primary-hover:#2563eb;--pubwave-handle-color:#9b9a97;--pubwave-primary-faded:#3b82f61a;--pubwave-drop-indicator:#3b82f6;--pubwave-drop-target:#3b82f60d;--pubwave-error:#ef4444;--pubwave-success:#10b981;--pubwave-warning:#f59e0b;--pubwave-text-secondary:#374151;--pubwave-text-tertiary:#4b5563;--pubwave-hover-bg:#f3f4f6;--pubwave-hover-task:#e8f2ff;--pubwave-checked-text:#9ca3af;--pubwave-spacing-xs:.25rem;--pubwave-spacing-sm:.5rem;--pubwave-spacing-md:1rem;--pubwave-spacing-lg:1.5rem;--pubwave-spacing-xl:2rem;--pubwave-spacing-1:4px;--pubwave-spacing-2:8px;--pubwave-spacing-3:12px;--pubwave-spacing-4:16px;--pubwave-spacing-7:28px;--pubwave-font-family:inherit;--pubwave-font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--pubwave-font-size-xs:11px;--pubwave-font-size-sm:13px;--pubwave-font-size-base:14px;--pubwave-font-size-md:1rem;--pubwave-font-size-lg:1.125rem;--pubwave-font-size-xl:1.25rem;--pubwave-font-size-2xl:1.5rem;--pubwave-font-size-3xl:2rem;--pubwave-line-height:1.625;--pubwave-line-height-heading:1.25;--pubwave-button-width:28px;--pubwave-button-height:28px;--pubwave-icon-size:20px;--pubwave-checkbox-size:20px;--pubwave-checkbox-input-size:16px;--pubwave-divider-width:1px;--pubwave-divider-height:20px;--pubwave-drop-indicator-width:2px;--pubwave-drop-indicator-height:2px;--pubwave-task-item-height:30px;--pubwave-radius-xs:3px;--pubwave-radius-sm:4px;--pubwave-radius:6px;--pubwave-radius-md:6px;--pubwave-radius-lg:8px;--pubwave-shadow-sm:0 1px 2px 0 #0000000d;--pubwave-shadow:0 4px 6px -1px #0000001a,0 2px 4px -1px #0000000f;--pubwave-shadow-lg:0 10px 15px -3px #0000001a,0 4px 6px -2px #0000000d}@media (prefers-color-scheme:dark){:root{--pubwave-bg:#1a1a1a;--pubwave-surface:#262626;--pubwave-text:#e5e7eb;--pubwave-text-muted:#9ca3af;--pubwave-border:#374151;--pubwave-border-light:#4b5563;--pubwave-hover:#ffffff0d;--pubwave-focus:#ffffff14;--pubwave-selection:#60a5fa;--pubwave-selection-bg:#60a5fa26;--pubwave-primary:#60a5fa;--pubwave-primary-hover:#3b82f6;--pubwave-primary-faded:#60a5fa26;--pubwave-drop-indicator:#60a5fa;--pubwave-drop-target:#60a5fa14;--pubwave-error:#f87171;--pubwave-text-secondary:#d1d5db;--pubwave-text-tertiary:#9ca3af;--pubwave-hover-bg:#374151;--pubwave-hover-task:#3b82f626;--pubwave-checked-text:#6b7280}}.pubwave-editor{width:var(--pubwave-container-width,100%);max-width:var(--pubwave-container-max-width,none);font-family:var(--pubwave-font-family);color:var(--pubwave-text);background:var(--pubwave-bg,#fff);border-radius:var(--pubwave-container-border-radius,16px);min-height:var(--pubwave-container-min-height,700px);padding:var(--pubwave-container-padding-y,96px)var(--pubwave-container-padding-x,120px);padding-left:var(--pubwave-container-padding-left,140px);position:relative;box-shadow:0 0 0 1px #0000000a,0 20px 25px -5px #0000000d,0 10px 10px -5px #00000005}@media (max-width:768px){.pubwave-editor{padding:var(--pubwave-container-padding-y-mobile,20px)var(--pubwave-container-padding-x-mobile,16px);padding-left:var(--pubwave-container-padding-left-mobile,16px);border-radius:var(--pubwave-container-border-radius-mobile,12px);min-height:var(--pubwave-container-min-height-mobile,400px)}}.pubwave-editor,.pubwave-editor *,.pubwave-editor :before,.pubwave-editor :after{box-sizing:border-box}.pubwave-editor__content{outline:none;flex-direction:column;min-height:1em;display:flex}.pubwave-editor__content .ProseMirror{min-height:100%;padding-bottom:30vh;padding-top:var(--pubwave-spacing-md,1rem);outline:none;flex-grow:1}.pubwave-editor__content .ProseMirror p.is-editor-empty:first-child:before,.pubwave-editor__content.ProseMirror-focused p.pubwave-editor__node--empty:before,.ProseMirror.ProseMirror-focused p.pubwave-editor__node--empty:before{content:attr(data-placeholder);float:left;color:var(--pubwave-text-muted);pointer-events:none;height:0}.pubwave-editor__content .ProseMirror>*+*{margin-top:.75em}@media (max-width:768px){.pubwave-editor__content .ProseMirror>*+*{margin-top:.35em}.pubwave-editor__content .ProseMirror h1+*,.pubwave-editor__content .ProseMirror h2+*,.pubwave-editor__content .ProseMirror h3+*{margin-top:.4em}.pubwave-editor__content .ProseMirror h1,.pubwave-editor__content .ProseMirror h2,.pubwave-editor__content .ProseMirror h3{margin-top:.6em}.pubwave-editor__content .ProseMirror{font-size:var(--pubwave-font-size-base-mobile,15px)}.pubwave-editor__content .ProseMirror h1{font-size:var(--pubwave-font-size-3xl-mobile,1.75rem)}.pubwave-editor__content .ProseMirror h2{font-size:var(--pubwave-font-size-2xl-mobile,1.375rem)}.pubwave-editor__content .ProseMirror h3{font-size:var(--pubwave-font-size-xl-mobile,1.125rem)}}.pubwave-editor__content .pubwave-editor__bullet-list,.pubwave-editor__content .pubwave-editor__ordered-list{padding-left:1.3em!important}.pubwave-editor__content .ProseMirror p{line-height:var(--pubwave-line-height);margin:0}.pubwave-editor__content .ProseMirror h1,.pubwave-editor__content .ProseMirror h2,.pubwave-editor__content .ProseMirror h3{line-height:var(--pubwave-line-height-heading);margin:0;font-weight:600}.pubwave-editor__content .ProseMirror h1{font-size:var(--pubwave-font-size-3xl)}.pubwave-editor__content .ProseMirror h2{font-size:var(--pubwave-font-size-2xl)}.pubwave-editor__content .ProseMirror h3{font-size:var(--pubwave-font-size-xl)}.pubwave-editor__content .ProseMirror ul:not([data-type=taskList]),.pubwave-editor__content .ProseMirror ol{margin:0;padding-left:1.5em}.pubwave-editor__content .ProseMirror li:not([data-type=taskItem]):not(.pubwave-editor__task-item){margin:.25em 0}.pubwave-editor__content .ProseMirror li>p{margin:0}.pubwave-editor__content ul[data-type=taskList]{padding:var(--pubwave-spacing-4,16px)0;margin:0!important;padding-left:0!important;list-style:none!important}.pubwave-editor__content .ProseMirror ul[data-type=taskList] li,.pubwave-editor__content .ProseMirror ul[data-type=taskList]>li,.pubwave-editor__content .ProseMirror ul[data-type=taskList] li[data-type=taskItem],.pubwave-editor__content .ProseMirror ul[data-type=taskList] li.pubwave-editor__task-item,.pubwave-editor__content .ProseMirror .pubwave-editor__task-item,.pubwave-editor__content.ProseMirror ul[data-type=taskList] li,.ProseMirror.pubwave-editor__content ul[data-type=taskList] li{border-radius:var(--pubwave-radius-sm,4px)!important;-webkit-appearance:none!important;-moz-appearance:none!important;appearance:none!important;flex-direction:row!important;align-items:center!important;gap:.5em!important;margin:0!important;padding:0!important;list-style:none!important;display:flex!important}.pubwave-editor__task-item{height:var(--pubwave-task-item-height,30px)}.pubwave-editor__content .ProseMirror ul[data-type=taskList] li::marker{content:""!important;width:0!important;font-size:0!important;display:none!important}.pubwave-editor__content .ProseMirror ul[data-type=taskList] li[data-type=taskItem]::marker{content:""!important;width:0!important;font-size:0!important;display:none!important}.pubwave-editor__content .ProseMirror ul[data-type=taskList] li.pubwave-editor__task-item::marker{content:""!important;width:0!important;font-size:0!important;display:none!important}.pubwave-editor__content .ProseMirror ul[data-type=taskList] li:before,.pubwave-editor__content .ProseMirror ul[data-type=taskList] li[data-type=taskItem]:before,.pubwave-editor__content .ProseMirror ul[data-type=taskList] li.pubwave-editor__task-item:before{content:""!important;width:0!important;display:none!important}.pubwave-editor__content .ProseMirror ul[data-type=taskList] li:hover,.pubwave-editor__content .ProseMirror ul[data-type=taskList] li.ProseMirror-selectednode{background-color:var(--pubwave-hover-task,#e8f2ff)}.pubwave-editor__content .ProseMirror ul[data-type=taskList] li>label,.pubwave-editor__content .ProseMirror ul[data-type=taskList] li[data-type=taskItem]>label,.pubwave-editor__content .ProseMirror ul[data-type=taskList] li.pubwave-editor__task-item>label{cursor:pointer!important;width:var(--pubwave-checkbox-size,20px)!important;height:var(--pubwave-checkbox-size,20px)!important;min-height:var(--pubwave-checkbox-size,20px)!important;max-height:var(--pubwave-checkbox-size,20px)!important;flex-shrink:0!important;align-self:center!important;margin:0!important;padding:0!important;line-height:1!important;display:block!important;position:relative!important;overflow:hidden!important}li>label input[type=checkbox]{width:var(--pubwave-checkbox-input-size,16px);height:var(--pubwave-checkbox-input-size,16px);cursor:pointer;margin-top:5px}.pubwave-editor__content .ProseMirror ul[data-type=taskList] li>label:before{content:"";width:var(--pubwave-checkbox-size,20px);height:var(--pubwave-checkbox-size,20px);border:1.5px solid var(--pubwave-text,#1a1a1a);border-radius:var(--pubwave-radius-xs,3px);background-color:var(--pubwave-bg,#fff);box-sizing:border-box;transition:all .15s;display:block;position:absolute;top:0;left:0}.pubwave-editor__content .ProseMirror ul[data-type=taskList] li[data-checked=true]>label:before{background-color:var(--pubwave-primary-hover,#2563eb);border-color:var(--pubwave-primary-hover,#2563eb)}.pubwave-editor__content .ProseMirror ul[data-type=taskList] li[data-checked=true]>label:after{content:"";border:solid var(--pubwave-bg,#fff);box-sizing:border-box;z-index:1;border-width:0 2px 2px 0;width:5px;height:10px;position:absolute;top:3px;left:6px;transform:rotate(45deg)}.pubwave-editor__content ul[data-type=taskList] li>div,.pubwave-editor__content ul[data-type=taskList] li[data-type=taskItem]>div,.pubwave-editor__content ul[data-type=taskList] li.pubwave-editor__task-item>div{min-width:0!important;color:var(--pubwave-text,#1a1a1a)!important;flex:1!important;margin:0!important;padding:.1em 0!important;display:block!important}.pubwave-editor__content ul[data-type=taskList] li>div p,.pubwave-editor__content ul[data-type=taskList] li[data-type=taskItem]>div p,.pubwave-editor__content ul[data-type=taskList] li.pubwave-editor__task-item>div p,.pubwave-editor__content ul[data-type=taskList] li>div>p,.pubwave-editor__content ul[data-type=taskList] li>div p.pubwave-editor__paragraph,.pubwave-editor__content ul[data-type=taskList] li[data-type=taskItem]>div p.pubwave-editor__paragraph{width:100%!important;min-height:1.5em!important;margin:0!important;padding:0!important;line-height:1.5!important;display:block!important}.pubwave-editor__content.ProseMirror ul[data-type=taskList] li[data-checked=true]>div p,.pubwave-editor__content ul[data-type=taskList] li[data-checked=true]>div p{color:var(--pubwave-checked-text,#9ca3af)!important;text-decoration:line-through!important}.pubwave-editor__content blockquote,.pubwave-editor__content.ProseMirror blockquote{margin:.5em 0;padding-left:1em;font-style:italic;border-left:3px solid var(--pubwave-text,#1a1a1a)!important}.pubwave-editor__content .ProseMirror pre,.pubwave-editor__content pre{margin:.5em 0;padding:.5em .75em;line-height:1.5;overflow-x:auto;background:var(--pubwave-border-light,#f3f4f6)!important;border-radius:var(--pubwave-radius-md,6px)!important;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace!important;font-size:var(--pubwave-font-size-sm,13px)!important;color:#1a1a1a!important}.pubwave-editor__content .ProseMirror pre code,.pubwave-editor__content pre code{font-size:inherit!important;color:inherit!important;background:0 0!important;border-radius:0!important;padding:0!important;font-family:inherit!important}.pubwave-block{padding-left:2.5em;position:relative}.pubwave-block-menu{z-index:2;align-items:center;gap:.5em;display:flex;position:absolute;top:50%;left:.5em;transform:translateY(-50%)}.pubwave-editor__content .ProseMirror hr,.pubwave-editor__content hr,.pubwave-editor__content .pubwave-editor__divider{border:none;border-top:1px solid var(--pubwave-border,#e5e7eb)!important;background:0 0!important;height:0!important;margin:1em 0!important}.pubwave-editor__content .ProseMirror img,.pubwave-editor__content img,.pubwave-editor__content .pubwave-editor__image{border-radius:var(--pubwave-radius-md,6px);cursor:pointer;max-width:100%;height:auto;margin:1em auto;transition:opacity .2s;display:block;box-shadow:0 1px 3px #0000001a}.pubwave-editor__content .ProseMirror img:hover,.pubwave-editor__content img:hover,.pubwave-editor__content .pubwave-editor__image:hover{opacity:.9}.pubwave-editor__content .ProseMirror img.ProseMirror-selectednode,.pubwave-editor__content img.ProseMirror-selectednode,.pubwave-editor__content .pubwave-editor__image.ProseMirror-selectednode{outline:2px solid var(--pubwave-primary,#2383e2);outline-offset:2px}.pubwave-editor__content .ProseMirror strong{font-weight:600}.pubwave-editor__content .ProseMirror em{font-style:italic}.pubwave-editor__content .ProseMirror u{text-decoration:underline}.pubwave-editor__content .ProseMirror s{text-decoration:line-through}.pubwave-editor__content .ProseMirror code{background:var(--pubwave-hover);border-radius:var(--pubwave-radius-sm);font-family:var(--pubwave-font-mono);padding:.15em .35em;font-size:.9em}.pubwave-editor__content .ProseMirror a,.pubwave-editor .ProseMirror a{cursor:pointer;text-decoration:underline;color:var(--pubwave-link-color,#2383e2)!important}.pubwave-editor__content .ProseMirror a:hover,.pubwave-editor .ProseMirror a:hover{opacity:.8;color:var(--pubwave-link-hover-color,var(--pubwave-link-color,#2383e2))!important}.pubwave-editor__content .ProseMirror ::-moz-selection{background-color:var(--pubwave-selection-bg)}.pubwave-editor__content .ProseMirror ::selection{background-color:var(--pubwave-selection-bg)}.pubwave-editor--readonly,.pubwave-editor--readonly .pubwave-editor__content{cursor:default}.pubwave-block--dragging{opacity:.4}.pubwave-block--drag-preview{color:var(--pubwave-text-muted,#9b9a97)!important;opacity:.6!important}.pubwave-block--drag-preview div,.pubwave-block--drag-preview p,.pubwave-block--drag-preview label,.pubwave-block--drag-preview .pubwave-editor__task-item>div{color:var(--pubwave-text-muted,#9b9a97)!important}.pubwave-block--drag-preview label input{display:none!important}.pubwave-block--drag-preview label:before{border-color:var(--pubwave-text-muted,#9b9a97)!important;width:16px!important;height:16px!important}.pubwave-block--drag-preview label:after{border-color:var(--pubwave-bg,#fff)!important;top:2px!important;left:4px!important}.ProseMirror .ProseMirror-gapcursor{pointer-events:none;display:none;position:absolute}.ProseMirror .ProseMirror-gapcursor:after{content:"";border-top:1px solid var(--pubwave-text);width:20px;animation:1.1s steps(2,start) infinite pubwave-cursor-blink;display:block;position:absolute;top:-2px}@keyframes pubwave-cursor-blink{to{visibility:hidden}}.ProseMirror-focused .ProseMirror-gapcursor{display:block}.tippy-box{z-index:var(--pubwave-z-dropdown,60)!important;background:0 0!important;border:none!important}.tippy-box:has(.pubwave-slash-menu){background:0 0!important;border:none!important}.pubwave-slash-menu{border:1px solid var(--pubwave-border,#e3e2e0)!important}.ProseMirror-dropcursor{border-left:2px solid var(--pubwave-primary);pointer-events:none}.pubwave-editor .ProseMirror .suggestion{border:1px solid var(--pubwave-border,#e3e2e0)!important;border-radius:var(--pubwave-radius-md,6px)!important;color:#1f2937!important;background-color:#fffffff2!important;padding:2px 4px!important;display:inline-block!important}.pubwave-editor .ProseMirror .suggestion,.pubwave-editor .ProseMirror .suggestion *,.pubwave-editor .ProseMirror .suggestion span,.pubwave-editor .ProseMirror .suggestion strong,.pubwave-editor .ProseMirror .suggestion em,.pubwave-editor .ProseMirror .suggestion code{color:#1f2937!important}.tippy-box,.tippy-box[data-theme]{z-index:60!important}.tippy-box[data-theme~=pubwave]{box-shadow:none;background:0 0;border:none}.tippy-box[data-theme~=pubwave] .tippy-content{padding:0}.tippy-box[data-theme~=light-border]{border-radius:var(--pubwave-radius,6px);box-shadow:var(--pubwave-shadow-md,0 4px 6px -1px #0000001a);padding:4px 8px;font-size:12px;color:#fff!important;background-color:#000!important;border:none!important}.tippy-box[data-theme~=light-border] .tippy-content{color:#fff!important}.pubwave-block-handle__drag,.pubwave-block-handle__add{color:var(--pubwave-text-muted,#9b9a97)!important}.pubwave-toolbar__button:not(:disabled):hover,.pubwave-toolbar__turn-into-option:not(.pubwave-toolbar__turn-into-option--active):hover{background-color:var(--pubwave-hover)!important}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}.tippy-box[data-animation=fade][data-state=hidden]{opacity:0}[data-tippy-root]{max-width:calc(100vw - 10px)}.tippy-box{position:relative;background-color:#333;color:#fff;border-radius:4px;font-size:14px;line-height:1.4;white-space:normal;outline:0;transition-property:transform,visibility,opacity}.tippy-box[data-placement^=top]>.tippy-arrow{bottom:0}.tippy-box[data-placement^=top]>.tippy-arrow:before{bottom:-7px;left:0;border-width:8px 8px 0;border-top-color:initial;transform-origin:center top}.tippy-box[data-placement^=bottom]>.tippy-arrow{top:0}.tippy-box[data-placement^=bottom]>.tippy-arrow:before{top:-7px;left:0;border-width:0 8px 8px;border-bottom-color:initial;transform-origin:center bottom}.tippy-box[data-placement^=left]>.tippy-arrow{right:0}.tippy-box[data-placement^=left]>.tippy-arrow:before{border-width:8px 0 8px 8px;border-left-color:initial;right:-7px;transform-origin:center left}.tippy-box[data-placement^=right]>.tippy-arrow{left:0}.tippy-box[data-placement^=right]>.tippy-arrow:before{left:-7px;border-width:8px 8px 8px 0;border-right-color:initial;transform-origin:center right}.tippy-box[data-inertia][data-state=visible]{transition-timing-function:cubic-bezier(.54,1.5,.38,1.11)}.tippy-arrow{width:16px;height:16px;color:#333}.tippy-arrow:before{content:"";position:absolute;border-color:transparent;border-style:solid}.tippy-content{position:relative;padding:5px 9px;z-index:1}
package/dist/index.d.ts CHANGED
@@ -759,6 +759,19 @@ export declare function isEditorValid(editor: Editor_2 | null): editor is Editor
759
759
  */
760
760
  export declare function isMarkActive(editor: Editor_2, markType: string): boolean;
761
761
 
762
+ /**
763
+ * Check if the device is a mobile/touch device
764
+ * Returns true for mobile devices, false for desktop
765
+ *
766
+ * This function safely checks for mobile device characteristics:
767
+ * - Touch support
768
+ * - Coarse pointer type (touch screen)
769
+ * - Hover capability (mobile devices typically don't support hover)
770
+ *
771
+ * @returns true if the device appears to be a mobile/touch device, false otherwise
772
+ */
773
+ export declare function isMobileDevice(): boolean;
774
+
762
775
  /**
763
776
  * Check if a node type is currently active
764
777
  */
package/dist/index.js CHANGED
@@ -461,6 +461,13 @@ function safeRequestAnimationFrame(callback) {
461
461
  }
462
462
  return 0;
463
463
  }
464
+ function isMobileDevice() {
465
+ if (!canUseDOM) return false;
466
+ const hasTouchSupport = "ontouchstart" in window || navigator.maxTouchPoints > 0;
467
+ const hasCoarsePointer = window.matchMedia("(pointer: coarse)").matches;
468
+ const hasHover = window.matchMedia("(hover: hover)").matches;
469
+ return hasTouchSupport && hasCoarsePointer || hasTouchSupport && !hasHover;
470
+ }
464
471
  function TextIcon() {
465
472
  return /* @__PURE__ */ jsx("svg", { width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ jsx("path", { d: "M4 7V4h16v3M9 20h6M12 4v16" }) });
466
473
  }
@@ -6300,18 +6307,31 @@ function BlockHandle({ editor }) {
6300
6307
  const [visible, setVisible] = useState(false);
6301
6308
  const [isDragging, setIsDragging] = useState(false);
6302
6309
  const [position, setPosition] = useState({ top: 0 });
6310
+ const [isMobile, setIsMobile] = useState(false);
6311
+ useEffect(() => {
6312
+ const checkMobile = () => {
6313
+ setIsMobile(isMobileDevice());
6314
+ };
6315
+ checkMobile();
6316
+ window.addEventListener("resize", checkMobile);
6317
+ return () => {
6318
+ window.removeEventListener("resize", checkMobile);
6319
+ };
6320
+ }, []);
6303
6321
  const updatePosition = useCallback(() => {
6304
6322
  const container = containerRef.current;
6305
6323
  const block = currentBlockRef.current;
6306
6324
  if (!container || !block) return;
6307
6325
  const editorContainer = container.closest(".pubwave-editor");
6308
6326
  if (!editorContainer) return;
6327
+ void editorContainer.offsetHeight;
6309
6328
  const editorRect = editorContainer.getBoundingClientRect();
6310
6329
  let offset2 = 14;
6311
6330
  let target = block;
6312
6331
  if (["UL", "OL", "BLOCKQUOTE"].includes(block.tagName) && block.firstElementChild instanceof HTMLElement) {
6313
6332
  target = block.firstElementChild;
6314
6333
  }
6334
+ void target.offsetHeight;
6315
6335
  const targetRect = target.getBoundingClientRect();
6316
6336
  try {
6317
6337
  const style = window.getComputedStyle(target);
@@ -6330,12 +6350,18 @@ function BlockHandle({ editor }) {
6330
6350
  } catch (e) {
6331
6351
  }
6332
6352
  const top2 = targetRect.top - editorRect.top + offset2;
6333
- setPosition({ top: top2 });
6353
+ if (!isNaN(top2) && isFinite(top2) && top2 >= 0) {
6354
+ setPosition({ top: top2 });
6355
+ }
6334
6356
  }, []);
6335
6357
  const showHandle = useCallback((block) => {
6336
6358
  currentBlockRef.current = block;
6337
6359
  setVisible(true);
6338
- setTimeout(updatePosition, 0);
6360
+ requestAnimationFrame(() => {
6361
+ requestAnimationFrame(() => {
6362
+ updatePosition();
6363
+ });
6364
+ });
6339
6365
  }, [updatePosition]);
6340
6366
  const hideHandle = useCallback(() => {
6341
6367
  if (!isDraggingRef.current) {
@@ -6397,8 +6423,16 @@ function BlockHandle({ editor }) {
6397
6423
  hideHandle();
6398
6424
  }, 150);
6399
6425
  };
6426
+ const onEditorMouseLeave = () => {
6427
+ if (isDraggingRef.current) return;
6428
+ clearHideTimeout();
6429
+ hideTimeoutRef.current = setTimeout(() => {
6430
+ hideHandle();
6431
+ }, 150);
6432
+ };
6400
6433
  proseMirror.addEventListener("mouseover", onMouseOver);
6401
6434
  proseMirror.addEventListener("mouseout", onMouseOut);
6435
+ editorContainer.addEventListener("mouseleave", onEditorMouseLeave);
6402
6436
  const handleTransaction = ({ transaction }) => {
6403
6437
  if (transaction.docChanged && !isDraggingRef.current) {
6404
6438
  hideHandle();
@@ -6408,10 +6442,20 @@ function BlockHandle({ editor }) {
6408
6442
  return () => {
6409
6443
  proseMirror.removeEventListener("mouseover", onMouseOver);
6410
6444
  proseMirror.removeEventListener("mouseout", onMouseOut);
6445
+ editorContainer.removeEventListener("mouseleave", onEditorMouseLeave);
6411
6446
  editor.off("transaction", handleTransaction);
6412
6447
  clearHideTimeout();
6413
6448
  };
6414
6449
  }, [editor, showHandle, hideHandle, clearHideTimeout]);
6450
+ useEffect(() => {
6451
+ if (visible && currentBlockRef.current) {
6452
+ requestAnimationFrame(() => {
6453
+ requestAnimationFrame(() => {
6454
+ updatePosition();
6455
+ });
6456
+ });
6457
+ }
6458
+ }, [visible, updatePosition]);
6415
6459
  useEffect(() => {
6416
6460
  if (!visible) return;
6417
6461
  const onScroll = () => {
@@ -6506,7 +6550,7 @@ function BlockHandle({ editor }) {
6506
6550
  }
6507
6551
  setVisible(false);
6508
6552
  }, []);
6509
- if (!visible) return null;
6553
+ if (isMobile || !visible) return null;
6510
6554
  return /* @__PURE__ */ jsxs(
6511
6555
  "div",
6512
6556
  {
@@ -7514,6 +7558,7 @@ export {
7514
7558
  isEditable,
7515
7559
  isEditorValid,
7516
7560
  isMarkActive,
7561
+ isMobileDevice,
7517
7562
  isNodeActive,
7518
7563
  isReadOnly,
7519
7564
  isSSR,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pubwave/editor",
3
- "version": "0.1.1",
3
+ "version": "0.1.3",
4
4
  "description": "A Notion-level block editor built with React and Tiptap",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -20,7 +20,11 @@
20
20
  "./style.css": "./dist/index.css"
21
21
  },
22
22
  "files": [
23
- "dist",
23
+ "dist/**/*.js",
24
+ "dist/**/*.cjs",
25
+ "dist/**/*.d.ts",
26
+ "dist/**/*.d.cts",
27
+ "dist/**/*.css",
24
28
  "README.md",
25
29
  "LICENSE"
26
30
  ],