@4399ywkf/editor 0.13.0 → 0.13.2

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.
@@ -35918,7 +35918,7 @@ var comboboxStyles = ({ surface, gray }) => `
35918
35918
 
35919
35919
  .tiptap-combobox-popover {
35920
35920
  isolation: isolate;
35921
- z-index: 50;
35921
+ z-index: 1000;
35922
35922
  }
35923
35923
 
35924
35924
  .tiptap-combobox-label {
@@ -36436,7 +36436,7 @@ var dropdownMenuStyles = ({ surface, gray }) => `
36436
36436
  --slide-y: 0px;
36437
36437
  --padding: 0.375rem;
36438
36438
 
36439
- z-index: 50;
36439
+ z-index: 1000;
36440
36440
  min-width: 6rem;
36441
36441
  overflow: hidden;
36442
36442
  border-radius: ${surface.floatRadius}px;
@@ -39999,7 +39999,7 @@ var mentionDropdownMenuStyles = ({ surface, pick: pick2 }) => `
39999
39999
  // src/components/tiptap-ui-primitive/menu/menu.style.ts
40000
40000
  var menuStyles = ({ gray }) => `
40001
40001
  .tiptap-menu-content {
40002
- z-index: 50;
40002
+ z-index: 1000;
40003
40003
  display: flex;
40004
40004
  flex-direction: column;
40005
40005
  height: 100%;
@@ -42108,7 +42108,7 @@ var popoverStyles = () => `
42108
42108
  --------- POPOVER STYLING SETTINGS -----------
42109
42109
  -------------------------------------------- */
42110
42110
  .tiptap-popover {
42111
- z-index: 50;
42111
+ z-index: 1000;
42112
42112
  outline: none;
42113
42113
  transform-origin: var(--radix-popover-content-transform-origin);
42114
42114
  max-height: var(--radix-popover-content-available-height);
@@ -44783,7 +44783,7 @@ var tooltipStyles = ({ surface, pick: pick2, isDark }) => `
44783
44783
  }
44784
44784
 
44785
44785
  .tiptap-tooltip {
44786
- z-index: 50;
44786
+ z-index: 1000;
44787
44787
  overflow: hidden;
44788
44788
  border-radius: ${pick2("var(--tt-radius-md, 0.375rem)", `${surface.itemRadius}px`)};
44789
44789
  background-color: var(--tt-tooltip-bg);
@@ -46524,14 +46524,14 @@ function getOverflowAncestors(node, list, traverseIframes) {
46524
46524
  if (traverseIframes === void 0) {
46525
46525
  traverseIframes = true;
46526
46526
  }
46527
- const scrollableAncestor = getNearestOverflowAncestor(node);
46528
- const isBody = scrollableAncestor === ((_node$ownerDocument2 = node.ownerDocument) == null ? void 0 : _node$ownerDocument2.body);
46529
- const win = getWindow(scrollableAncestor);
46527
+ const scrollableAncestor2 = getNearestOverflowAncestor(node);
46528
+ const isBody = scrollableAncestor2 === ((_node$ownerDocument2 = node.ownerDocument) == null ? void 0 : _node$ownerDocument2.body);
46529
+ const win = getWindow(scrollableAncestor2);
46530
46530
  if (isBody) {
46531
46531
  const frameElement = getFrameElement(win);
46532
- return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], frameElement && traverseIframes ? getOverflowAncestors(frameElement) : []);
46532
+ return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor2) ? scrollableAncestor2 : [], frameElement && traverseIframes ? getOverflowAncestors(frameElement) : []);
46533
46533
  } else {
46534
- return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes));
46534
+ return list.concat(scrollableAncestor2, getOverflowAncestors(scrollableAncestor2, [], traverseIframes));
46535
46535
  }
46536
46536
  }
46537
46537
  function getFrameElement(win) {
@@ -71875,8 +71875,8 @@ var TableOfContents = Extension.create({
71875
71875
  if (!this.options.scrollParent) {
71876
71876
  return;
71877
71877
  }
71878
- const scrollParent22 = typeof this.options.scrollParent === "function" ? this.options.scrollParent() : this.options.scrollParent;
71879
- const scrollPosition = scrollParent22 instanceof HTMLElement ? scrollParent22.scrollTop : scrollParent22.scrollY;
71878
+ const scrollParent2 = typeof this.options.scrollParent === "function" ? this.options.scrollParent() : this.options.scrollParent;
71879
+ const scrollPosition = scrollParent2 instanceof HTMLElement ? scrollParent2.scrollTop : scrollParent2.scrollY;
71880
71880
  this.storage.scrollPosition = scrollPosition || 0;
71881
71881
  const updatedItems = addTocActiveStatesAndGetItems(this.storage.content, {
71882
71882
  editor: this.editor,
@@ -71889,18 +71889,18 @@ var TableOfContents = Extension.create({
71889
71889
  if (!this.options.scrollParent) {
71890
71890
  return;
71891
71891
  }
71892
- const scrollParent3 = typeof this.options.scrollParent === "function" ? this.options.scrollParent() : this.options.scrollParent;
71893
- if (scrollParent3) {
71894
- scrollParent3.addEventListener("scroll", this.storage.scrollHandler);
71892
+ const scrollParent = typeof this.options.scrollParent === "function" ? this.options.scrollParent() : this.options.scrollParent;
71893
+ if (scrollParent) {
71894
+ scrollParent.addEventListener("scroll", this.storage.scrollHandler);
71895
71895
  }
71896
71896
  },
71897
71897
  onDestroy() {
71898
71898
  if (!this.options.scrollParent) {
71899
71899
  return;
71900
71900
  }
71901
- const scrollParent3 = typeof this.options.scrollParent === "function" ? this.options.scrollParent() : this.options.scrollParent;
71902
- if (scrollParent3) {
71903
- scrollParent3.removeEventListener("scroll", this.storage.scrollHandler);
71901
+ const scrollParent = typeof this.options.scrollParent === "function" ? this.options.scrollParent() : this.options.scrollParent;
71902
+ if (scrollParent) {
71903
+ scrollParent.removeEventListener("scroll", this.storage.scrollHandler);
71904
71904
  }
71905
71905
  },
71906
71906
  addProseMirrorPlugins() {
@@ -76714,6 +76714,18 @@ var BlockSpacing = Extension.create({
76714
76714
  };
76715
76715
  }
76716
76716
  });
76717
+
76718
+ // src/lib/scroll-parent.ts
76719
+ function scrollableAncestor(el, styleOf = (node) => getComputedStyle(node)) {
76720
+ const { body, documentElement } = el.ownerDocument;
76721
+ for (let p = el.parentElement; p && p !== documentElement; p = p.parentElement) {
76722
+ if (p === body && styleOf(documentElement).overflowY === "visible") return null;
76723
+ const { overflowY } = styleOf(p);
76724
+ if ((overflowY === "auto" || overflowY === "scroll") && p.scrollHeight > p.clientHeight)
76725
+ return p;
76726
+ }
76727
+ return null;
76728
+ }
76717
76729
  function withOrder(item) {
76718
76730
  const order = item.editor && typeof item.pos === "number" ? headingOrderTextAt(item.editor.state, item.pos) : null;
76719
76731
  return order ? `${order} ${item.textContent}` : item.textContent;
@@ -76738,17 +76750,7 @@ function normalizeHeadingDepths(items) {
76738
76750
  }
76739
76751
  return depths;
76740
76752
  }
76741
- var getScrollableAncestor = (element) => {
76742
- let parent = element.parentElement;
76743
- while (parent) {
76744
- const { overflowY } = getComputedStyle(parent);
76745
- if ((overflowY === "auto" || overflowY === "scroll") && parent.scrollHeight > parent.clientHeight) {
76746
- return parent;
76747
- }
76748
- parent = parent.parentElement;
76749
- }
76750
- return window;
76751
- };
76753
+ var getScrollableAncestor = (element) => scrollableAncestor(element) ?? window;
76752
76754
  var isElementVisible = (element, topOffset) => {
76753
76755
  const rect = element.getBoundingClientRect();
76754
76756
  const viewportHeight = window.innerHeight || document.documentElement.clientHeight;
@@ -83195,13 +83197,6 @@ function leafTextFor(editor) {
83195
83197
  }
83196
83198
  };
83197
83199
  }
83198
- function scrollParent(el) {
83199
- for (let p = el.parentElement; p; p = p.parentElement) {
83200
- const { overflowY } = getComputedStyle(p);
83201
- if ((overflowY === "auto" || overflowY === "scroll") && p.scrollHeight > p.clientHeight) return p;
83202
- }
83203
- return null;
83204
- }
83205
83200
  function scrollToMatch(view, from2) {
83206
83201
  let rect;
83207
83202
  try {
@@ -83209,7 +83204,7 @@ function scrollToMatch(view, from2) {
83209
83204
  } catch {
83210
83205
  return;
83211
83206
  }
83212
- const container = scrollParent(view.dom);
83207
+ const container = scrollableAncestor(view.dom);
83213
83208
  const top = container ? container.getBoundingClientRect().top : 0;
83214
83209
  const bottom = container ? container.getBoundingClientRect().bottom : window.innerHeight;
83215
83210
  if (rect.top > top + REVEAL_TOP && rect.bottom < bottom) return;
@@ -99757,15 +99752,7 @@ function stickyShift(m) {
99757
99752
  return Math.round(Math.min(shift6, max3));
99758
99753
  }
99759
99754
  function scrollParentTop(el) {
99760
- let p = el.parentElement;
99761
- while (p) {
99762
- const { overflowY } = getComputedStyle(p);
99763
- if ((overflowY === "auto" || overflowY === "scroll") && p.scrollHeight > p.clientHeight) {
99764
- return p.getBoundingClientRect().top;
99765
- }
99766
- p = p.parentElement;
99767
- }
99768
- return 0;
99755
+ return scrollableAncestor(el)?.getBoundingClientRect().top ?? 0;
99769
99756
  }
99770
99757
  function defaultTopOffset() {
99771
99758
  const header = document.querySelector(".notion-like-editor-header");
@@ -117709,7 +117696,7 @@ var FloatingElement = forwardRef(
117709
117696
  editor: providedEditor,
117710
117697
  shouldShow = void 0,
117711
117698
  floatingOptions,
117712
- zIndex = 50,
117699
+ zIndex = 1e3,
117713
117700
  onOpenChange,
117714
117701
  referenceElement,
117715
117702
  getBoundingClientRect: getBoundingClientRect2 = getSelectionBoundingRect,
@@ -119512,13 +119499,6 @@ function showSelectAllTip() {
119512
119499
  }
119513
119500
  });
119514
119501
  }
119515
- function scrollParent2(el) {
119516
- for (let cur = el.parentElement; cur; cur = cur.parentElement) {
119517
- const { overflowY } = getComputedStyle(cur);
119518
- if ((overflowY === "auto" || overflowY === "scroll") && cur.scrollHeight > cur.clientHeight) return cur;
119519
- }
119520
- return null;
119521
- }
119522
119502
  function marqueeView(view) {
119523
119503
  const boundary = view.dom.closest(".notion-like-editor-wrapper") ?? view.dom.parentElement ?? view.dom;
119524
119504
  let start = null;
@@ -119606,7 +119586,7 @@ function marqueeView(view) {
119606
119586
  if (!view.editable || e.button !== 0 || e.shiftKey || isMac6() && e.ctrlKey) return;
119607
119587
  if (!isMargin(e)) return;
119608
119588
  e.preventDefault();
119609
- scroller = scrollParent2(view.dom);
119589
+ scroller = scrollableAncestor(view.dom);
119610
119590
  start = { x: e.clientX, y: e.clientY, scrollTop: scrollTop() };
119611
119591
  pointer = { x: e.clientX, y: e.clientY };
119612
119592
  document.addEventListener("mousemove", onMove);