@ohhwells/bridge 0.1.42-next.92 → 0.1.42-next.93

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -4491,6 +4491,19 @@ var DRAG_SHADOW = "0px 4px 6px -1px rgba(0, 0, 0, 0.1), 0px 2px 4px -2px rgba(0,
4491
4491
  var TOOLBAR_EDGE_MARGIN = 4;
4492
4492
  var SELECTION_CHROME_GAP = 4;
4493
4493
  var TOOLBAR_STROKE_GAP = 4;
4494
+ function getChromeZIndex(state) {
4495
+ switch (state) {
4496
+ case "active-top":
4497
+ case "active-bottom":
4498
+ case "dragging":
4499
+ return 2147483644;
4500
+ case "hover":
4501
+ case "sibling-hint":
4502
+ return 2147483643;
4503
+ default:
4504
+ return 2147483642;
4505
+ }
4506
+ }
4494
4507
  function getChromeStyle(state) {
4495
4508
  switch (state) {
4496
4509
  case "hover":
@@ -4606,7 +4619,7 @@ function ItemInteractionLayer({
4606
4619
  left: rect.left - chromeGap,
4607
4620
  width: rect.width + chromeGap * 2,
4608
4621
  height: rect.height + chromeGap * 2,
4609
- zIndex: 2147483646
4622
+ zIndex: getChromeZIndex(state)
4610
4623
  },
4611
4624
  children: [
4612
4625
  /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
@@ -8996,6 +9009,16 @@ function OhhwellsBridge() {
8996
9009
  return;
8997
9010
  }
8998
9011
  document.documentElement.setAttribute("data-ohw-link-popover-open", "");
9012
+ hoveredItemElRef.current = null;
9013
+ setHoveredItemRect(null);
9014
+ hoveredNavContainerRef.current = null;
9015
+ setHoveredNavContainerRect(null);
9016
+ siblingHintElRef.current = null;
9017
+ setSiblingHintRect(null);
9018
+ setSiblingHintRects([]);
9019
+ if (selectedElRef.current || toolbarVariantRef.current !== "none") {
9020
+ deselectRef.current();
9021
+ }
8999
9022
  if (hoveredImageRef.current) {
9000
9023
  hoveredImageRef.current = null;
9001
9024
  hoveredImageHasTextOverlapRef.current = false;
@@ -11878,8 +11901,8 @@ function OhhwellsBridge() {
11878
11901
  onVideoSettingsChange: handleVideoSettingsChange
11879
11902
  }
11880
11903
  ),
11881
- siblingHintRect && !isItemDragging && siblingHintRects.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(ItemInteractionLayer, { rect: siblingHintRect, state: "sibling-hint" }),
11882
- siblingHintRects.map((rect, i) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(ItemInteractionLayer, { rect, state: "sibling-hint" }, `sibling-hint-${i}`)),
11904
+ siblingHintRect && !linkPopover && !isItemDragging && siblingHintRects.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(ItemInteractionLayer, { rect: siblingHintRect, state: "sibling-hint" }),
11905
+ siblingHintRects.length > 0 && !linkPopover && siblingHintRects.map((rect, i) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(ItemInteractionLayer, { rect, state: "sibling-hint" }, `sibling-hint-${i}`)),
11883
11906
  isItemDragging && draggedItemRect && selectedElRef.current !== footerDragRef.current?.draggedEl && selectedElRef.current !== navDragRef.current?.draggedEl && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(ItemInteractionLayer, { rect: draggedItemRect, state: "dragging" }),
11884
11907
  isItemDragging && footerDropSlots.map((slot, i) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
11885
11908
  "div",
@@ -11924,8 +11947,9 @@ function OhhwellsBridge() {
11924
11947
  `nav-drop-${slot.direction}-${slot.parentId ?? "root"}-${slot.insertIndex}-${i}`
11925
11948
  )),
11926
11949
  hoveredNavContainerRect && toolbarVariant !== "select-frame" && !linkPopover && !isItemDragging && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(ItemInteractionLayer, { rect: hoveredNavContainerRect, state: "hover" }),
11950
+ hoveredItemRect && !linkPopover && !hoveredNavContainerRect && !isItemDragging && hoveredItemElRef.current !== selectedElRef.current && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(ItemInteractionLayer, { rect: hoveredItemRect, state: "hover" }),
11927
11951
  toolbarVariant === "select-frame" && toolbarRect && !linkPopover && !isItemDragging && !isFooterFrameSelection && selectedElRef.current && isNavbarLinksContainer(selectedElRef.current) && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(NavbarContainerChrome, { rect: toolbarRect, onAdd: handleAddTopLevelNavItem }),
11928
- toolbarRect && (toolbarVariant === "link-action" || toolbarVariant === "select-frame") && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
11952
+ toolbarRect && !linkPopover && (toolbarVariant === "link-action" || toolbarVariant === "select-frame") && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
11929
11953
  ItemInteractionLayer,
11930
11954
  {
11931
11955
  rect: isItemDragging && draggedItemRect && (footerDragRef.current?.wasSelected || navDragRef.current?.wasSelected) ? draggedItemRect : toolbarRect,
@@ -11952,8 +11976,7 @@ function OhhwellsBridge() {
11952
11976
  ) : void 0
11953
11977
  }
11954
11978
  ),
11955
- hoveredItemRect && !linkPopover && !hoveredNavContainerRect && !isItemDragging && hoveredItemElRef.current !== selectedElRef.current && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(ItemInteractionLayer, { rect: hoveredItemRect, state: "hover" }),
11956
- toolbarRect && toolbarVariant === "rich-text" && /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_jsx_runtime24.Fragment, { children: [
11979
+ toolbarRect && toolbarVariant === "rich-text" && !linkPopover && /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_jsx_runtime24.Fragment, { children: [
11957
11980
  /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
11958
11981
  EditGlowChrome,
11959
11982
  {