@ohhwells/bridge 0.1.48-next.113 → 0.1.49-next.114
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 +816 -437
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +28 -4
- package/dist/index.d.ts +28 -4
- package/dist/index.js +608 -235
- package/dist/index.js.map +1 -1
- package/dist/styles.css +131 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
// src/OhhwellsBridge.tsx
|
|
4
|
-
import React11, { useCallback as useCallback5, useEffect as useEffect9, useLayoutEffect as useLayoutEffect3, useRef as useRef7, useState as
|
|
4
|
+
import React11, { useCallback as useCallback5, useEffect as useEffect9, useLayoutEffect as useLayoutEffect3, useRef as useRef7, useState as useState9 } from "react";
|
|
5
5
|
import { createRoot } from "react-dom/client";
|
|
6
6
|
import { flushSync } from "react-dom";
|
|
7
7
|
|
|
@@ -4338,22 +4338,116 @@ var CustomToolbarButton = React4.forwardRef(
|
|
|
4338
4338
|
CustomToolbarButton.displayName = "CustomToolbarButton";
|
|
4339
4339
|
|
|
4340
4340
|
// src/ui/item-action-toolbar.tsx
|
|
4341
|
-
import {
|
|
4341
|
+
import { useState as useState3 } from "react";
|
|
4342
|
+
import { Copy, CornerLeftUp, Link, MoreHorizontal, Plus, Trash2 } from "lucide-react";
|
|
4343
|
+
|
|
4344
|
+
// src/ui/dropdown-menu.tsx
|
|
4345
|
+
import { DropdownMenu as DropdownMenuPrimitive } from "radix-ui";
|
|
4346
|
+
import { jsx as jsx7 } from "react/jsx-runtime";
|
|
4347
|
+
function DropdownMenu({ ...props }) {
|
|
4348
|
+
return /* @__PURE__ */ jsx7(DropdownMenuPrimitive.Root, { "data-slot": "dropdown-menu", ...props });
|
|
4349
|
+
}
|
|
4350
|
+
function DropdownMenuTrigger({
|
|
4351
|
+
...props
|
|
4352
|
+
}) {
|
|
4353
|
+
return /* @__PURE__ */ jsx7(DropdownMenuPrimitive.Trigger, { "data-slot": "dropdown-menu-trigger", ...props });
|
|
4354
|
+
}
|
|
4355
|
+
function DropdownMenuGroup({
|
|
4356
|
+
className,
|
|
4357
|
+
...props
|
|
4358
|
+
}) {
|
|
4359
|
+
return /* @__PURE__ */ jsx7(
|
|
4360
|
+
DropdownMenuPrimitive.Group,
|
|
4361
|
+
{
|
|
4362
|
+
"data-slot": "dropdown-menu-group",
|
|
4363
|
+
className: cn("flex w-full flex-col items-start p-1", className),
|
|
4364
|
+
...props
|
|
4365
|
+
}
|
|
4366
|
+
);
|
|
4367
|
+
}
|
|
4368
|
+
function DropdownMenuContent({
|
|
4369
|
+
className,
|
|
4370
|
+
sideOffset = 6,
|
|
4371
|
+
...props
|
|
4372
|
+
}) {
|
|
4373
|
+
return /* @__PURE__ */ jsx7(DropdownMenuPrimitive.Portal, { children: /* @__PURE__ */ jsx7(
|
|
4374
|
+
DropdownMenuPrimitive.Content,
|
|
4375
|
+
{
|
|
4376
|
+
"data-slot": "dropdown-menu-content",
|
|
4377
|
+
"data-ohw-more-menu": "",
|
|
4378
|
+
sideOffset,
|
|
4379
|
+
className: cn(
|
|
4380
|
+
"z-[2147483647] flex w-56 min-w-32 flex-col items-center overflow-hidden rounded-[6px] border border-border bg-popover p-0 text-popover-foreground outline-none",
|
|
4381
|
+
"shadow-[0px_4px_6px_0px_rgba(0,0,0,0.1),0px_2px_4px_0px_rgba(0,0,0,0.1)]",
|
|
4382
|
+
"origin-[var(--radix-dropdown-menu-content-transform-origin)]",
|
|
4383
|
+
"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95",
|
|
4384
|
+
"data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
|
|
4385
|
+
className
|
|
4386
|
+
),
|
|
4387
|
+
...props
|
|
4388
|
+
}
|
|
4389
|
+
) });
|
|
4390
|
+
}
|
|
4391
|
+
function DropdownMenuItem({
|
|
4392
|
+
className,
|
|
4393
|
+
inset,
|
|
4394
|
+
variant = "default",
|
|
4395
|
+
...props
|
|
4396
|
+
}) {
|
|
4397
|
+
return /* @__PURE__ */ jsx7(
|
|
4398
|
+
DropdownMenuPrimitive.Item,
|
|
4399
|
+
{
|
|
4400
|
+
"data-slot": "dropdown-menu-item",
|
|
4401
|
+
"data-inset": inset ? "" : void 0,
|
|
4402
|
+
"data-variant": variant,
|
|
4403
|
+
className: cn(
|
|
4404
|
+
"relative flex w-full min-w-32 cursor-pointer select-none items-center gap-2 rounded-[calc(var(--radius,0.5rem)-4px)] py-1.5 pl-8 pr-2 text-sm leading-5 outline-none",
|
|
4405
|
+
"text-popover-foreground",
|
|
4406
|
+
"focus:bg-muted data-[highlighted]:bg-muted",
|
|
4407
|
+
"data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
4408
|
+
"[&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
|
|
4409
|
+
"[&_svg:not([class*=absolute])]:relative",
|
|
4410
|
+
// Leading icon — Figma absolute left-2 / top-1/2
|
|
4411
|
+
"[&>svg:first-child]:absolute [&>svg:first-child]:left-2 [&>svg:first-child]:top-1/2 [&>svg:first-child]:-translate-y-1/2",
|
|
4412
|
+
"data-[variant=destructive]:text-destructive",
|
|
4413
|
+
"data-[variant=destructive]:focus:bg-bg-destructive-10 data-[variant=destructive]:focus:text-destructive",
|
|
4414
|
+
"data-[variant=destructive]:data-[highlighted]:bg-bg-destructive-10 data-[variant=destructive]:data-[highlighted]:text-destructive",
|
|
4415
|
+
"data-[variant=destructive]:[&_svg]:text-destructive",
|
|
4416
|
+
inset && "pl-8",
|
|
4417
|
+
className
|
|
4418
|
+
),
|
|
4419
|
+
...props
|
|
4420
|
+
}
|
|
4421
|
+
);
|
|
4422
|
+
}
|
|
4423
|
+
function DropdownMenuSeparator({
|
|
4424
|
+
className,
|
|
4425
|
+
...props
|
|
4426
|
+
}) {
|
|
4427
|
+
return /* @__PURE__ */ jsx7(
|
|
4428
|
+
DropdownMenuPrimitive.Separator,
|
|
4429
|
+
{
|
|
4430
|
+
"data-slot": "dropdown-menu-separator",
|
|
4431
|
+
className: cn("h-px w-full bg-border", className),
|
|
4432
|
+
...props
|
|
4433
|
+
}
|
|
4434
|
+
);
|
|
4435
|
+
}
|
|
4342
4436
|
|
|
4343
4437
|
// src/ui/tooltip.tsx
|
|
4344
4438
|
import { Tooltip as TooltipPrimitive } from "radix-ui";
|
|
4345
|
-
import { jsx as
|
|
4439
|
+
import { jsx as jsx8 } from "react/jsx-runtime";
|
|
4346
4440
|
function TooltipProvider({
|
|
4347
4441
|
delayDuration = 0,
|
|
4348
4442
|
...props
|
|
4349
4443
|
}) {
|
|
4350
|
-
return /* @__PURE__ */
|
|
4444
|
+
return /* @__PURE__ */ jsx8(TooltipPrimitive.Provider, { "data-slot": "tooltip-provider", delayDuration, ...props });
|
|
4351
4445
|
}
|
|
4352
4446
|
function Tooltip({ ...props }) {
|
|
4353
|
-
return /* @__PURE__ */
|
|
4447
|
+
return /* @__PURE__ */ jsx8(TooltipPrimitive.Root, { "data-slot": "tooltip", ...props });
|
|
4354
4448
|
}
|
|
4355
4449
|
function TooltipTrigger({ ...props }) {
|
|
4356
|
-
return /* @__PURE__ */
|
|
4450
|
+
return /* @__PURE__ */ jsx8(TooltipPrimitive.Trigger, { "data-slot": "tooltip-trigger", ...props });
|
|
4357
4451
|
}
|
|
4358
4452
|
var arrowClassBySide = {
|
|
4359
4453
|
top: "before:bottom-0 before:left-1/2 before:-translate-x-1/2 before:translate-y-1/2",
|
|
@@ -4370,7 +4464,7 @@ function TooltipContent({
|
|
|
4370
4464
|
...props
|
|
4371
4465
|
}) {
|
|
4372
4466
|
const resolvedSide = side ?? "bottom";
|
|
4373
|
-
return /* @__PURE__ */
|
|
4467
|
+
return /* @__PURE__ */ jsx8(TooltipPrimitive.Portal, { children: /* @__PURE__ */ jsx8(
|
|
4374
4468
|
TooltipPrimitive.Content,
|
|
4375
4469
|
{
|
|
4376
4470
|
"data-slot": "tooltip-content",
|
|
@@ -4393,7 +4487,7 @@ function TooltipContent({
|
|
|
4393
4487
|
}
|
|
4394
4488
|
|
|
4395
4489
|
// src/ui/item-action-toolbar.tsx
|
|
4396
|
-
import { jsx as
|
|
4490
|
+
import { jsx as jsx9, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
4397
4491
|
function ToolbarActionTooltip({
|
|
4398
4492
|
label,
|
|
4399
4493
|
side = "bottom",
|
|
@@ -4401,25 +4495,31 @@ function ToolbarActionTooltip({
|
|
|
4401
4495
|
buttonProps,
|
|
4402
4496
|
children
|
|
4403
4497
|
}) {
|
|
4404
|
-
const button = /* @__PURE__ */
|
|
4498
|
+
const button = /* @__PURE__ */ jsx9(CustomToolbarButton, { type: "button", "aria-label": label, disabled, ...buttonProps, children });
|
|
4405
4499
|
return /* @__PURE__ */ jsxs3(Tooltip, { children: [
|
|
4406
|
-
/* @__PURE__ */
|
|
4407
|
-
/* @__PURE__ */
|
|
4500
|
+
/* @__PURE__ */ jsx9(TooltipTrigger, { asChild: true, children: disabled ? /* @__PURE__ */ jsx9("span", { className: "inline-flex", children: button }) : button }),
|
|
4501
|
+
/* @__PURE__ */ jsx9(TooltipContent, { side, sideOffset: 9, children: label })
|
|
4408
4502
|
] });
|
|
4409
4503
|
}
|
|
4410
4504
|
function ItemActionToolbar({
|
|
4411
4505
|
onEditLink,
|
|
4412
4506
|
onAddItem,
|
|
4413
|
-
|
|
4507
|
+
onSelectParent,
|
|
4508
|
+
onDuplicate,
|
|
4509
|
+
onDelete,
|
|
4414
4510
|
editLinkDisabled = false,
|
|
4415
4511
|
addItemDisabled = true,
|
|
4416
|
-
moreDisabled =
|
|
4512
|
+
moreDisabled = false,
|
|
4513
|
+
selectParentDisabled = false,
|
|
4514
|
+
duplicateDisabled = false,
|
|
4515
|
+
deleteDisabled = false,
|
|
4417
4516
|
showAddItem = true,
|
|
4418
4517
|
showMore = true,
|
|
4419
4518
|
tooltipSide = "bottom"
|
|
4420
4519
|
}) {
|
|
4421
|
-
|
|
4422
|
-
|
|
4520
|
+
const [moreOpen, setMoreOpen] = useState3(false);
|
|
4521
|
+
return /* @__PURE__ */ jsx9(TooltipProvider, { delayDuration: 0, children: /* @__PURE__ */ jsxs3(CustomToolbar, { children: [
|
|
4522
|
+
/* @__PURE__ */ jsx9(
|
|
4423
4523
|
ToolbarActionTooltip,
|
|
4424
4524
|
{
|
|
4425
4525
|
label: "Edit link",
|
|
@@ -4437,10 +4537,10 @@ function ItemActionToolbar({
|
|
|
4437
4537
|
e.stopPropagation();
|
|
4438
4538
|
}
|
|
4439
4539
|
},
|
|
4440
|
-
children: /* @__PURE__ */
|
|
4540
|
+
children: /* @__PURE__ */ jsx9(Link, { className: "size-4 shrink-0", "aria-hidden": true })
|
|
4441
4541
|
}
|
|
4442
4542
|
),
|
|
4443
|
-
showAddItem ? /* @__PURE__ */
|
|
4543
|
+
showAddItem ? /* @__PURE__ */ jsx9(
|
|
4444
4544
|
ToolbarActionTooltip,
|
|
4445
4545
|
{
|
|
4446
4546
|
label: "Add item",
|
|
@@ -4454,32 +4554,84 @@ function ItemActionToolbar({
|
|
|
4454
4554
|
onAddItem?.();
|
|
4455
4555
|
}
|
|
4456
4556
|
},
|
|
4457
|
-
children: /* @__PURE__ */
|
|
4557
|
+
children: /* @__PURE__ */ jsx9(Plus, { className: "size-4 shrink-0", "aria-hidden": true })
|
|
4458
4558
|
}
|
|
4459
4559
|
) : null,
|
|
4460
|
-
showMore ? /* @__PURE__ */
|
|
4461
|
-
|
|
4462
|
-
|
|
4463
|
-
|
|
4464
|
-
|
|
4465
|
-
|
|
4466
|
-
|
|
4560
|
+
showMore ? /* @__PURE__ */ jsxs3(DropdownMenu, { open: moreOpen, onOpenChange: setMoreOpen, children: [
|
|
4561
|
+
/* @__PURE__ */ jsxs3(Tooltip, { open: moreOpen ? false : void 0, children: [
|
|
4562
|
+
/* @__PURE__ */ jsx9(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx9(DropdownMenuTrigger, { asChild: true, disabled: moreDisabled, children: /* @__PURE__ */ jsx9(
|
|
4563
|
+
CustomToolbarButton,
|
|
4564
|
+
{
|
|
4565
|
+
type: "button",
|
|
4566
|
+
"aria-label": "More",
|
|
4567
|
+
disabled: moreDisabled,
|
|
4568
|
+
onMouseDown: (e) => {
|
|
4569
|
+
e.preventDefault();
|
|
4570
|
+
e.stopPropagation();
|
|
4571
|
+
},
|
|
4572
|
+
children: /* @__PURE__ */ jsx9(MoreHorizontal, { className: "size-4 shrink-0", "aria-hidden": true })
|
|
4573
|
+
}
|
|
4574
|
+
) }) }),
|
|
4575
|
+
/* @__PURE__ */ jsx9(TooltipContent, { side: tooltipSide, sideOffset: 9, children: "More" })
|
|
4576
|
+
] }),
|
|
4577
|
+
/* @__PURE__ */ jsxs3(
|
|
4578
|
+
DropdownMenuContent,
|
|
4579
|
+
{
|
|
4580
|
+
align: "end",
|
|
4581
|
+
side: "bottom",
|
|
4582
|
+
onCloseAutoFocus: (e) => e.preventDefault(),
|
|
4467
4583
|
onMouseDown: (e) => {
|
|
4468
|
-
if (moreDisabled) return;
|
|
4469
4584
|
e.preventDefault();
|
|
4470
4585
|
e.stopPropagation();
|
|
4471
|
-
|
|
4472
|
-
|
|
4473
|
-
|
|
4474
|
-
|
|
4475
|
-
|
|
4476
|
-
|
|
4586
|
+
},
|
|
4587
|
+
children: [
|
|
4588
|
+
/* @__PURE__ */ jsxs3(DropdownMenuGroup, { children: [
|
|
4589
|
+
/* @__PURE__ */ jsxs3(
|
|
4590
|
+
DropdownMenuItem,
|
|
4591
|
+
{
|
|
4592
|
+
disabled: selectParentDisabled,
|
|
4593
|
+
onSelect: () => onSelectParent?.(),
|
|
4594
|
+
children: [
|
|
4595
|
+
/* @__PURE__ */ jsx9(CornerLeftUp, { size: 12, "aria-hidden": true }),
|
|
4596
|
+
"Select parent"
|
|
4597
|
+
]
|
|
4598
|
+
}
|
|
4599
|
+
),
|
|
4600
|
+
/* @__PURE__ */ jsxs3(
|
|
4601
|
+
DropdownMenuItem,
|
|
4602
|
+
{
|
|
4603
|
+
disabled: duplicateDisabled,
|
|
4604
|
+
onSelect: () => onDuplicate?.(),
|
|
4605
|
+
children: [
|
|
4606
|
+
/* @__PURE__ */ jsx9(Copy, { size: 12, "aria-hidden": true }),
|
|
4607
|
+
"Duplicate"
|
|
4608
|
+
]
|
|
4609
|
+
}
|
|
4610
|
+
)
|
|
4611
|
+
] }),
|
|
4612
|
+
/* @__PURE__ */ jsx9(DropdownMenuSeparator, {}),
|
|
4613
|
+
/* @__PURE__ */ jsx9(DropdownMenuGroup, { children: /* @__PURE__ */ jsxs3(
|
|
4614
|
+
DropdownMenuItem,
|
|
4615
|
+
{
|
|
4616
|
+
variant: "destructive",
|
|
4617
|
+
disabled: deleteDisabled,
|
|
4618
|
+
onSelect: () => onDelete?.(),
|
|
4619
|
+
children: [
|
|
4620
|
+
/* @__PURE__ */ jsx9(Trash2, { size: 15, "aria-hidden": true }),
|
|
4621
|
+
"Delete"
|
|
4622
|
+
]
|
|
4623
|
+
}
|
|
4624
|
+
) })
|
|
4625
|
+
]
|
|
4626
|
+
}
|
|
4627
|
+
)
|
|
4628
|
+
] }) : null
|
|
4477
4629
|
] }) });
|
|
4478
4630
|
}
|
|
4479
4631
|
|
|
4480
4632
|
// src/ui/item-interaction-layer.tsx
|
|
4481
4633
|
import * as React5 from "react";
|
|
4482
|
-
import { jsx as
|
|
4634
|
+
import { jsx as jsx10, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
4483
4635
|
var PRIMARY = "var(--ohw-primary, #0885FE)";
|
|
4484
4636
|
var FOCUS_RING = `0 0 0 4px color-mix(in srgb, ${PRIMARY} 12%, transparent)`;
|
|
4485
4637
|
var DRAG_SHADOW = "0px 4px 6px -1px rgba(0, 0, 0, 0.1), 0px 2px 4px -2px rgba(0, 0, 0, 0.1)";
|
|
@@ -4561,7 +4713,7 @@ function ClampedToolbarSlot({
|
|
|
4561
4713
|
window.removeEventListener("resize", clamp);
|
|
4562
4714
|
};
|
|
4563
4715
|
}, [placement, children]);
|
|
4564
|
-
return /* @__PURE__ */
|
|
4716
|
+
return /* @__PURE__ */ jsx10(
|
|
4565
4717
|
"div",
|
|
4566
4718
|
{
|
|
4567
4719
|
ref: slotRef,
|
|
@@ -4617,7 +4769,7 @@ function ItemInteractionLayer({
|
|
|
4617
4769
|
zIndex: getChromeZIndex(state)
|
|
4618
4770
|
},
|
|
4619
4771
|
children: [
|
|
4620
|
-
/* @__PURE__ */
|
|
4772
|
+
/* @__PURE__ */ jsx10(
|
|
4621
4773
|
"div",
|
|
4622
4774
|
{
|
|
4623
4775
|
"aria-hidden": true,
|
|
@@ -4625,7 +4777,7 @@ function ItemInteractionLayer({
|
|
|
4625
4777
|
style: getChromeStyle(state)
|
|
4626
4778
|
}
|
|
4627
4779
|
),
|
|
4628
|
-
itemDragEnabled && /* @__PURE__ */
|
|
4780
|
+
itemDragEnabled && /* @__PURE__ */ jsx10(
|
|
4629
4781
|
"div",
|
|
4630
4782
|
{
|
|
4631
4783
|
"data-ohw-item-drag-surface": "",
|
|
@@ -4641,14 +4793,14 @@ function ItemInteractionLayer({
|
|
|
4641
4793
|
}
|
|
4642
4794
|
}
|
|
4643
4795
|
),
|
|
4644
|
-
showDragHandle && /* @__PURE__ */
|
|
4796
|
+
showDragHandle && /* @__PURE__ */ jsx10(
|
|
4645
4797
|
"div",
|
|
4646
4798
|
{
|
|
4647
4799
|
"data-ohw-drag-handle-container": "",
|
|
4648
4800
|
className: "pointer-events-auto absolute left-0 top-1/2 z-10 -translate-x-[calc(100%+7px)] -translate-y-1/2",
|
|
4649
4801
|
style: isDragging ? { opacity: 0 } : void 0,
|
|
4650
4802
|
"aria-hidden": isDragging || void 0,
|
|
4651
|
-
children: /* @__PURE__ */
|
|
4803
|
+
children: /* @__PURE__ */ jsx10(
|
|
4652
4804
|
DragHandle,
|
|
4653
4805
|
{
|
|
4654
4806
|
draggable: !dragDisabled,
|
|
@@ -4678,8 +4830,8 @@ function ItemInteractionLayer({
|
|
|
4678
4830
|
)
|
|
4679
4831
|
}
|
|
4680
4832
|
),
|
|
4681
|
-
showToolbar && state === "active-top" && /* @__PURE__ */
|
|
4682
|
-
showToolbar && state === "active-bottom" && /* @__PURE__ */
|
|
4833
|
+
showToolbar && state === "active-top" && /* @__PURE__ */ jsx10(ClampedToolbarSlot, { placement: "top", children: toolbar }),
|
|
4834
|
+
showToolbar && state === "active-bottom" && /* @__PURE__ */ jsx10(ClampedToolbarSlot, { placement: "bottom", children: toolbar })
|
|
4683
4835
|
]
|
|
4684
4836
|
}
|
|
4685
4837
|
);
|
|
@@ -4692,7 +4844,7 @@ import { Film, ImageIcon, Pause, Play, Volume2, VolumeX } from "lucide-react";
|
|
|
4692
4844
|
// src/ui/button.tsx
|
|
4693
4845
|
import * as React6 from "react";
|
|
4694
4846
|
import { Slot } from "radix-ui";
|
|
4695
|
-
import { jsx as
|
|
4847
|
+
import { jsx as jsx11 } from "react/jsx-runtime";
|
|
4696
4848
|
var buttonVariants = cva(
|
|
4697
4849
|
"inline-flex items-center justify-center gap-1 whitespace-nowrap rounded-md text-sm font-medium transition-colors outline-none disabled:pointer-events-none disabled:opacity-50 min-w-[80px] px-3 py-2",
|
|
4698
4850
|
{
|
|
@@ -4716,7 +4868,7 @@ var buttonVariants = cva(
|
|
|
4716
4868
|
var Button = React6.forwardRef(
|
|
4717
4869
|
({ className, variant, size, asChild = false, ...props }, ref) => {
|
|
4718
4870
|
const Comp = asChild ? Slot.Root : "button";
|
|
4719
|
-
return /* @__PURE__ */
|
|
4871
|
+
return /* @__PURE__ */ jsx11(
|
|
4720
4872
|
Comp,
|
|
4721
4873
|
{
|
|
4722
4874
|
ref,
|
|
@@ -4730,7 +4882,7 @@ var Button = React6.forwardRef(
|
|
|
4730
4882
|
Button.displayName = "Button";
|
|
4731
4883
|
|
|
4732
4884
|
// src/ui/MediaOverlay.tsx
|
|
4733
|
-
import { Fragment as Fragment2, jsx as
|
|
4885
|
+
import { Fragment as Fragment2, jsx as jsx12, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
4734
4886
|
var MEDIA_UPLOAD_FADE_MS = 300;
|
|
4735
4887
|
var VIDEO_SETTINGS_BAR_INSET = 8;
|
|
4736
4888
|
var OVERLAY_BUTTON_STYLE = {
|
|
@@ -4788,7 +4940,7 @@ function MediaOverlay({
|
|
|
4788
4940
|
return () => anim.cancel();
|
|
4789
4941
|
}, [isUploading, fadingOut, onFadeOutComplete, hover.key]);
|
|
4790
4942
|
if (isUploading) {
|
|
4791
|
-
return /* @__PURE__ */
|
|
4943
|
+
return /* @__PURE__ */ jsx12(
|
|
4792
4944
|
"div",
|
|
4793
4945
|
{
|
|
4794
4946
|
ref: skeletonRef,
|
|
@@ -4797,7 +4949,7 @@ function MediaOverlay({
|
|
|
4797
4949
|
"data-ohw-media-skeleton": "",
|
|
4798
4950
|
"aria-hidden": true,
|
|
4799
4951
|
style: { ...box, pointerEvents: "none" },
|
|
4800
|
-
children: /* @__PURE__ */
|
|
4952
|
+
children: /* @__PURE__ */ jsx12("style", { children: SKELETON_CSS })
|
|
4801
4953
|
}
|
|
4802
4954
|
);
|
|
4803
4955
|
}
|
|
@@ -4817,7 +4969,7 @@ function MediaOverlay({
|
|
|
4817
4969
|
},
|
|
4818
4970
|
onClick: (e) => e.stopPropagation(),
|
|
4819
4971
|
children: [
|
|
4820
|
-
/* @__PURE__ */
|
|
4972
|
+
/* @__PURE__ */ jsx12(
|
|
4821
4973
|
Button,
|
|
4822
4974
|
{
|
|
4823
4975
|
"data-ohw-media-overlay": "",
|
|
@@ -4832,10 +4984,10 @@ function MediaOverlay({
|
|
|
4832
4984
|
e.stopPropagation();
|
|
4833
4985
|
onVideoSettingsChange?.(hover.key, { autoplay: !autoplay });
|
|
4834
4986
|
},
|
|
4835
|
-
children: autoplay ? /* @__PURE__ */
|
|
4987
|
+
children: autoplay ? /* @__PURE__ */ jsx12(Pause, { size: 14 }) : /* @__PURE__ */ jsx12(Play, { size: 14 })
|
|
4836
4988
|
}
|
|
4837
4989
|
),
|
|
4838
|
-
/* @__PURE__ */
|
|
4990
|
+
/* @__PURE__ */ jsx12(
|
|
4839
4991
|
Button,
|
|
4840
4992
|
{
|
|
4841
4993
|
"data-ohw-media-overlay": "",
|
|
@@ -4850,7 +5002,7 @@ function MediaOverlay({
|
|
|
4850
5002
|
e.stopPropagation();
|
|
4851
5003
|
onVideoSettingsChange?.(hover.key, { muted: !muted });
|
|
4852
5004
|
},
|
|
4853
|
-
children: muted ? /* @__PURE__ */
|
|
5005
|
+
children: muted ? /* @__PURE__ */ jsx12(VolumeX, { size: 14 }) : /* @__PURE__ */ jsx12(Volume2, { size: 14 })
|
|
4854
5006
|
}
|
|
4855
5007
|
)
|
|
4856
5008
|
]
|
|
@@ -4858,7 +5010,7 @@ function MediaOverlay({
|
|
|
4858
5010
|
) : null;
|
|
4859
5011
|
return /* @__PURE__ */ jsxs5(Fragment2, { children: [
|
|
4860
5012
|
settingsBar,
|
|
4861
|
-
/* @__PURE__ */
|
|
5013
|
+
/* @__PURE__ */ jsx12(
|
|
4862
5014
|
"div",
|
|
4863
5015
|
{
|
|
4864
5016
|
"data-ohw-bridge": "",
|
|
@@ -4893,7 +5045,7 @@ function MediaOverlay({
|
|
|
4893
5045
|
onReplace(hover.key);
|
|
4894
5046
|
},
|
|
4895
5047
|
children: [
|
|
4896
|
-
isVideo ? /* @__PURE__ */
|
|
5048
|
+
isVideo ? /* @__PURE__ */ jsx12(Film, { size: 14 }) : /* @__PURE__ */ jsx12(ImageIcon, { size: 14 }),
|
|
4897
5049
|
isVideo ? "Replace video" : "Replace image"
|
|
4898
5050
|
]
|
|
4899
5051
|
}
|
|
@@ -4905,7 +5057,7 @@ function MediaOverlay({
|
|
|
4905
5057
|
|
|
4906
5058
|
// src/ui/CarouselOverlay.tsx
|
|
4907
5059
|
import { GalleryHorizontal } from "lucide-react";
|
|
4908
|
-
import { jsx as
|
|
5060
|
+
import { jsx as jsx13, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
4909
5061
|
var OVERLAY_BUTTON_STYLE2 = {
|
|
4910
5062
|
pointerEvents: "auto",
|
|
4911
5063
|
fontFamily: "Inter, sans-serif",
|
|
@@ -4917,7 +5069,7 @@ function CarouselOverlay({
|
|
|
4917
5069
|
onEdit
|
|
4918
5070
|
}) {
|
|
4919
5071
|
const { rect } = hover;
|
|
4920
|
-
return /* @__PURE__ */
|
|
5072
|
+
return /* @__PURE__ */ jsx13(
|
|
4921
5073
|
"div",
|
|
4922
5074
|
{
|
|
4923
5075
|
"data-ohw-bridge": "",
|
|
@@ -4949,7 +5101,7 @@ function CarouselOverlay({
|
|
|
4949
5101
|
onEdit(hover.key);
|
|
4950
5102
|
},
|
|
4951
5103
|
children: [
|
|
4952
|
-
/* @__PURE__ */
|
|
5104
|
+
/* @__PURE__ */ jsx13(GalleryHorizontal, { size: 14 }),
|
|
4953
5105
|
"Edit gallery"
|
|
4954
5106
|
]
|
|
4955
5107
|
}
|
|
@@ -5244,22 +5396,22 @@ import { useEffect as useEffect6 } from "react";
|
|
|
5244
5396
|
import * as React8 from "react";
|
|
5245
5397
|
import { Dialog as DialogPrimitive } from "radix-ui";
|
|
5246
5398
|
import { X } from "lucide-react";
|
|
5247
|
-
import { jsx as
|
|
5399
|
+
import { jsx as jsx14, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
5248
5400
|
function Dialog2({
|
|
5249
5401
|
...props
|
|
5250
5402
|
}) {
|
|
5251
|
-
return /* @__PURE__ */
|
|
5403
|
+
return /* @__PURE__ */ jsx14(DialogPrimitive.Root, { "data-slot": "dialog", ...props });
|
|
5252
5404
|
}
|
|
5253
5405
|
function DialogPortal({
|
|
5254
5406
|
...props
|
|
5255
5407
|
}) {
|
|
5256
|
-
return /* @__PURE__ */
|
|
5408
|
+
return /* @__PURE__ */ jsx14(DialogPrimitive.Portal, { ...props });
|
|
5257
5409
|
}
|
|
5258
5410
|
function DialogOverlay({
|
|
5259
5411
|
className,
|
|
5260
5412
|
...props
|
|
5261
5413
|
}) {
|
|
5262
|
-
return /* @__PURE__ */
|
|
5414
|
+
return /* @__PURE__ */ jsx14(
|
|
5263
5415
|
DialogPrimitive.Overlay,
|
|
5264
5416
|
{
|
|
5265
5417
|
"data-slot": "dialog-overlay",
|
|
@@ -5273,7 +5425,7 @@ var DialogContent = React8.forwardRef(
|
|
|
5273
5425
|
({ className, children, showCloseButton = true, container, ...props }, ref) => {
|
|
5274
5426
|
const positionMode = container ? "absolute" : "fixed";
|
|
5275
5427
|
return /* @__PURE__ */ jsxs7(DialogPortal, { container: container ?? void 0, children: [
|
|
5276
|
-
/* @__PURE__ */
|
|
5428
|
+
/* @__PURE__ */ jsx14(DialogOverlay, { className: cn(positionMode, "inset-0") }),
|
|
5277
5429
|
/* @__PURE__ */ jsxs7(
|
|
5278
5430
|
DialogPrimitive.Content,
|
|
5279
5431
|
{
|
|
@@ -5290,13 +5442,13 @@ var DialogContent = React8.forwardRef(
|
|
|
5290
5442
|
...props,
|
|
5291
5443
|
children: [
|
|
5292
5444
|
children,
|
|
5293
|
-
showCloseButton ? /* @__PURE__ */
|
|
5445
|
+
showCloseButton ? /* @__PURE__ */ jsx14(
|
|
5294
5446
|
DialogPrimitive.Close,
|
|
5295
5447
|
{
|
|
5296
5448
|
type: "button",
|
|
5297
5449
|
className: "absolute right-[9px] top-[9px] rounded-sm p-1.5 text-foreground hover:bg-muted/50",
|
|
5298
5450
|
"aria-label": "Close",
|
|
5299
|
-
children: /* @__PURE__ */
|
|
5451
|
+
children: /* @__PURE__ */ jsx14(X, { size: 16, "aria-hidden": true })
|
|
5300
5452
|
}
|
|
5301
5453
|
) : null
|
|
5302
5454
|
]
|
|
@@ -5310,13 +5462,13 @@ function DialogHeader({
|
|
|
5310
5462
|
className,
|
|
5311
5463
|
...props
|
|
5312
5464
|
}) {
|
|
5313
|
-
return /* @__PURE__ */
|
|
5465
|
+
return /* @__PURE__ */ jsx14("div", { className: cn("flex flex-col gap-1.5", className), ...props });
|
|
5314
5466
|
}
|
|
5315
5467
|
function DialogFooter({
|
|
5316
5468
|
className,
|
|
5317
5469
|
...props
|
|
5318
5470
|
}) {
|
|
5319
|
-
return /* @__PURE__ */
|
|
5471
|
+
return /* @__PURE__ */ jsx14(
|
|
5320
5472
|
"div",
|
|
5321
5473
|
{
|
|
5322
5474
|
className: cn("flex items-center justify-end gap-2", className),
|
|
@@ -5324,7 +5476,7 @@ function DialogFooter({
|
|
|
5324
5476
|
}
|
|
5325
5477
|
);
|
|
5326
5478
|
}
|
|
5327
|
-
var DialogTitle = React8.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
5479
|
+
var DialogTitle = React8.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx14(
|
|
5328
5480
|
DialogPrimitive.Title,
|
|
5329
5481
|
{
|
|
5330
5482
|
ref,
|
|
@@ -5336,7 +5488,7 @@ var DialogTitle = React8.forwardRef(({ className, ...props }, ref) => /* @__PURE
|
|
|
5336
5488
|
}
|
|
5337
5489
|
));
|
|
5338
5490
|
DialogTitle.displayName = DialogPrimitive.Title.displayName;
|
|
5339
|
-
var DialogDescription = React8.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
5491
|
+
var DialogDescription = React8.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx14(
|
|
5340
5492
|
DialogPrimitive.Description,
|
|
5341
5493
|
{
|
|
5342
5494
|
ref,
|
|
@@ -5352,19 +5504,19 @@ import { Info, X as X3 } from "lucide-react";
|
|
|
5352
5504
|
|
|
5353
5505
|
// src/ui/link-modal/DestinationBreadcrumb.tsx
|
|
5354
5506
|
import { ArrowRight, File, GalleryVertical } from "lucide-react";
|
|
5355
|
-
import { jsx as
|
|
5507
|
+
import { jsx as jsx15, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
5356
5508
|
function DestinationBreadcrumb({
|
|
5357
5509
|
pageTitle,
|
|
5358
5510
|
sectionLabel
|
|
5359
5511
|
}) {
|
|
5360
5512
|
return /* @__PURE__ */ jsxs8("div", { className: "flex w-full flex-col gap-2", children: [
|
|
5361
|
-
/* @__PURE__ */
|
|
5513
|
+
/* @__PURE__ */ jsx15("p", { className: "text-sm font-medium! text-foreground m-0", children: "Destination" }),
|
|
5362
5514
|
/* @__PURE__ */ jsxs8("div", { className: "flex items-center gap-3", children: [
|
|
5363
5515
|
/* @__PURE__ */ jsxs8("div", { className: "flex items-center gap-2", children: [
|
|
5364
|
-
/* @__PURE__ */
|
|
5365
|
-
/* @__PURE__ */
|
|
5516
|
+
/* @__PURE__ */ jsx15(File, { size: 16, className: "shrink-0 text-foreground", "aria-hidden": true }),
|
|
5517
|
+
/* @__PURE__ */ jsx15("span", { className: "text-sm font-medium leading-none text-foreground!", children: pageTitle })
|
|
5366
5518
|
] }),
|
|
5367
|
-
/* @__PURE__ */
|
|
5519
|
+
/* @__PURE__ */ jsx15(
|
|
5368
5520
|
ArrowRight,
|
|
5369
5521
|
{
|
|
5370
5522
|
size: 16,
|
|
@@ -5373,7 +5525,7 @@ function DestinationBreadcrumb({
|
|
|
5373
5525
|
}
|
|
5374
5526
|
),
|
|
5375
5527
|
/* @__PURE__ */ jsxs8("div", { className: "flex min-w-0 flex-1 items-center gap-2", children: [
|
|
5376
|
-
/* @__PURE__ */
|
|
5528
|
+
/* @__PURE__ */ jsx15(
|
|
5377
5529
|
GalleryVertical,
|
|
5378
5530
|
{
|
|
5379
5531
|
size: 16,
|
|
@@ -5381,7 +5533,7 @@ function DestinationBreadcrumb({
|
|
|
5381
5533
|
"aria-hidden": true
|
|
5382
5534
|
}
|
|
5383
5535
|
),
|
|
5384
|
-
/* @__PURE__ */
|
|
5536
|
+
/* @__PURE__ */ jsx15("span", { className: "truncate text-sm font-medium leading-none text-foreground", children: sectionLabel })
|
|
5385
5537
|
] })
|
|
5386
5538
|
] })
|
|
5387
5539
|
] });
|
|
@@ -5389,7 +5541,7 @@ function DestinationBreadcrumb({
|
|
|
5389
5541
|
|
|
5390
5542
|
// src/ui/link-modal/SectionTreeItem.tsx
|
|
5391
5543
|
import { GalleryVertical as GalleryVertical2 } from "lucide-react";
|
|
5392
|
-
import { jsx as
|
|
5544
|
+
import { jsx as jsx16, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
5393
5545
|
function SectionTreeItem({
|
|
5394
5546
|
section,
|
|
5395
5547
|
onSelect,
|
|
@@ -5397,7 +5549,7 @@ function SectionTreeItem({
|
|
|
5397
5549
|
}) {
|
|
5398
5550
|
const interactive = Boolean(onSelect);
|
|
5399
5551
|
return /* @__PURE__ */ jsxs9("div", { className: "flex h-9 w-full items-end pl-3", children: [
|
|
5400
|
-
/* @__PURE__ */
|
|
5552
|
+
/* @__PURE__ */ jsx16(
|
|
5401
5553
|
"div",
|
|
5402
5554
|
{
|
|
5403
5555
|
className: "mr-[-1px] h-9 w-2 shrink-0 rounded-bl-sm border-b border-l border-border mb-4",
|
|
@@ -5422,7 +5574,7 @@ function SectionTreeItem({
|
|
|
5422
5574
|
interactive && selected && "border-primary"
|
|
5423
5575
|
),
|
|
5424
5576
|
children: [
|
|
5425
|
-
/* @__PURE__ */
|
|
5577
|
+
/* @__PURE__ */ jsx16(
|
|
5426
5578
|
GalleryVertical2,
|
|
5427
5579
|
{
|
|
5428
5580
|
size: 16,
|
|
@@ -5430,7 +5582,7 @@ function SectionTreeItem({
|
|
|
5430
5582
|
"aria-hidden": true
|
|
5431
5583
|
}
|
|
5432
5584
|
),
|
|
5433
|
-
/* @__PURE__ */
|
|
5585
|
+
/* @__PURE__ */ jsx16("span", { className: "truncate text-sm font-normal leading-5 text-foreground", children: section.label })
|
|
5434
5586
|
]
|
|
5435
5587
|
}
|
|
5436
5588
|
)
|
|
@@ -5438,14 +5590,14 @@ function SectionTreeItem({
|
|
|
5438
5590
|
}
|
|
5439
5591
|
|
|
5440
5592
|
// src/ui/link-modal/UrlOrPageInput.tsx
|
|
5441
|
-
import { useEffect as useEffect3, useId as useId2, useRef as useRef4, useState as
|
|
5593
|
+
import { useEffect as useEffect3, useId as useId2, useRef as useRef4, useState as useState4 } from "react";
|
|
5442
5594
|
|
|
5443
5595
|
// src/ui/input.tsx
|
|
5444
5596
|
import * as React9 from "react";
|
|
5445
|
-
import { jsx as
|
|
5597
|
+
import { jsx as jsx17 } from "react/jsx-runtime";
|
|
5446
5598
|
var Input = React9.forwardRef(
|
|
5447
5599
|
({ className, type, ...props }, ref) => {
|
|
5448
|
-
return /* @__PURE__ */
|
|
5600
|
+
return /* @__PURE__ */ jsx17(
|
|
5449
5601
|
"input",
|
|
5450
5602
|
{
|
|
5451
5603
|
type,
|
|
@@ -5464,9 +5616,9 @@ Input.displayName = "Input";
|
|
|
5464
5616
|
|
|
5465
5617
|
// src/ui/label.tsx
|
|
5466
5618
|
import { Label as LabelPrimitive } from "radix-ui";
|
|
5467
|
-
import { jsx as
|
|
5619
|
+
import { jsx as jsx18 } from "react/jsx-runtime";
|
|
5468
5620
|
function Label({ className, ...props }) {
|
|
5469
|
-
return /* @__PURE__ */
|
|
5621
|
+
return /* @__PURE__ */ jsx18(
|
|
5470
5622
|
LabelPrimitive.Root,
|
|
5471
5623
|
{
|
|
5472
5624
|
"data-slot": "label",
|
|
@@ -5478,11 +5630,11 @@ function Label({ className, ...props }) {
|
|
|
5478
5630
|
|
|
5479
5631
|
// src/ui/link-modal/UrlOrPageInput.tsx
|
|
5480
5632
|
import { ChevronDown, File as File2, X as X2 } from "lucide-react";
|
|
5481
|
-
import { jsx as
|
|
5633
|
+
import { jsx as jsx19, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
5482
5634
|
function FieldChevron({
|
|
5483
5635
|
onClick
|
|
5484
5636
|
}) {
|
|
5485
|
-
return /* @__PURE__ */
|
|
5637
|
+
return /* @__PURE__ */ jsx19(
|
|
5486
5638
|
"button",
|
|
5487
5639
|
{
|
|
5488
5640
|
type: "button",
|
|
@@ -5490,7 +5642,7 @@ function FieldChevron({
|
|
|
5490
5642
|
onClick,
|
|
5491
5643
|
"aria-label": "Open page list",
|
|
5492
5644
|
tabIndex: -1,
|
|
5493
|
-
children: /* @__PURE__ */
|
|
5645
|
+
children: /* @__PURE__ */ jsx19(ChevronDown, { size: 16 })
|
|
5494
5646
|
}
|
|
5495
5647
|
);
|
|
5496
5648
|
}
|
|
@@ -5509,7 +5661,7 @@ function UrlOrPageInput({
|
|
|
5509
5661
|
const inputId = useId2();
|
|
5510
5662
|
const inputRef = useRef4(null);
|
|
5511
5663
|
const rootRef = useRef4(null);
|
|
5512
|
-
const [isFocused, setIsFocused] =
|
|
5664
|
+
const [isFocused, setIsFocused] = useState4(false);
|
|
5513
5665
|
useEffect3(() => {
|
|
5514
5666
|
if (!dropdownOpen) return;
|
|
5515
5667
|
const isOutside = (e) => {
|
|
@@ -5552,10 +5704,10 @@ function UrlOrPageInput({
|
|
|
5552
5704
|
urlError ? "border-destructive shadow-[0_0_0_1px_var(--ohw-destructive)]" : isFocused ? "border-primary shadow-[0_0_0_1px_var(--ohw-primary)]" : "border-input"
|
|
5553
5705
|
);
|
|
5554
5706
|
return /* @__PURE__ */ jsxs10("div", { className: "flex w-full flex-col gap-2 p-0", children: [
|
|
5555
|
-
/* @__PURE__ */
|
|
5707
|
+
/* @__PURE__ */ jsx19(Label, { htmlFor: inputId, className: cn(urlError && "text-destructive"), children: "Destination" }),
|
|
5556
5708
|
/* @__PURE__ */ jsxs10("div", { ref: rootRef, className: "relative w-full", children: [
|
|
5557
5709
|
/* @__PURE__ */ jsxs10("div", { "data-ohw-link-field": true, className: fieldClassName, children: [
|
|
5558
|
-
selectedPage ? /* @__PURE__ */
|
|
5710
|
+
selectedPage ? /* @__PURE__ */ jsx19("div", { className: "flex shrink-0 items-center pr-2", children: /* @__PURE__ */ jsx19(
|
|
5559
5711
|
File2,
|
|
5560
5712
|
{
|
|
5561
5713
|
size: 16,
|
|
@@ -5563,7 +5715,7 @@ function UrlOrPageInput({
|
|
|
5563
5715
|
"aria-hidden": true
|
|
5564
5716
|
}
|
|
5565
5717
|
) }) : null,
|
|
5566
|
-
readOnly ? /* @__PURE__ */
|
|
5718
|
+
readOnly ? /* @__PURE__ */ jsx19("span", { className: "min-w-0 flex-1 truncate text-sm leading-5 text-foreground", children: selectedPage?.title ?? value }) : /* @__PURE__ */ jsx19(
|
|
5567
5719
|
Input,
|
|
5568
5720
|
{
|
|
5569
5721
|
ref: inputRef,
|
|
@@ -5589,7 +5741,7 @@ function UrlOrPageInput({
|
|
|
5589
5741
|
)
|
|
5590
5742
|
}
|
|
5591
5743
|
),
|
|
5592
|
-
selectedPage && !readOnly ? /* @__PURE__ */
|
|
5744
|
+
selectedPage && !readOnly ? /* @__PURE__ */ jsx19(
|
|
5593
5745
|
"button",
|
|
5594
5746
|
{
|
|
5595
5747
|
type: "button",
|
|
@@ -5597,12 +5749,12 @@ function UrlOrPageInput({
|
|
|
5597
5749
|
onMouseDown: clearSelection,
|
|
5598
5750
|
"aria-label": "Clear selected page",
|
|
5599
5751
|
tabIndex: -1,
|
|
5600
|
-
children: /* @__PURE__ */
|
|
5752
|
+
children: /* @__PURE__ */ jsx19(X2, { size: 16, "aria-hidden": true })
|
|
5601
5753
|
}
|
|
5602
5754
|
) : null,
|
|
5603
|
-
!readOnly ? /* @__PURE__ */
|
|
5755
|
+
!readOnly ? /* @__PURE__ */ jsx19(FieldChevron, { onClick: toggleDropdown }) : null
|
|
5604
5756
|
] }),
|
|
5605
|
-
dropdownOpen && !readOnly && filteredPages.length > 0 ? /* @__PURE__ */
|
|
5757
|
+
dropdownOpen && !readOnly && filteredPages.length > 0 ? /* @__PURE__ */ jsx19(
|
|
5606
5758
|
"div",
|
|
5607
5759
|
{
|
|
5608
5760
|
"data-ohw-link-page-dropdown": "",
|
|
@@ -5615,8 +5767,8 @@ function UrlOrPageInput({
|
|
|
5615
5767
|
className: "flex h-9 w-full items-center gap-2 border-0 bg-transparent px-3 text-left text-sm leading-5 text-foreground outline-none hover:bg-muted",
|
|
5616
5768
|
onClick: () => onPageSelect(page),
|
|
5617
5769
|
children: [
|
|
5618
|
-
/* @__PURE__ */
|
|
5619
|
-
/* @__PURE__ */
|
|
5770
|
+
/* @__PURE__ */ jsx19(File2, { size: 16, className: "shrink-0", "aria-hidden": true }),
|
|
5771
|
+
/* @__PURE__ */ jsx19("span", { className: "truncate", children: page.title })
|
|
5620
5772
|
]
|
|
5621
5773
|
},
|
|
5622
5774
|
page.path
|
|
@@ -5624,34 +5776,34 @@ function UrlOrPageInput({
|
|
|
5624
5776
|
}
|
|
5625
5777
|
) : null
|
|
5626
5778
|
] }),
|
|
5627
|
-
urlError ? /* @__PURE__ */
|
|
5779
|
+
urlError ? /* @__PURE__ */ jsx19("p", { className: "text-sm font-medium text-destructive", children: urlError }) : null
|
|
5628
5780
|
] });
|
|
5629
5781
|
}
|
|
5630
5782
|
|
|
5631
5783
|
// src/ui/link-modal/LinkEditorPanel.tsx
|
|
5632
|
-
import { Fragment as Fragment3, jsx as
|
|
5784
|
+
import { Fragment as Fragment3, jsx as jsx20, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
5633
5785
|
function LinkEditorPanel({ state, onClose }) {
|
|
5634
5786
|
const isCancel = state.secondaryLabel === "Cancel" || state.secondaryLabel === "Back to sections";
|
|
5635
5787
|
return /* @__PURE__ */ jsxs11(Fragment3, { children: [
|
|
5636
|
-
/* @__PURE__ */
|
|
5788
|
+
/* @__PURE__ */ jsx20(DialogClose, { asChild: true, children: /* @__PURE__ */ jsx20(
|
|
5637
5789
|
"button",
|
|
5638
5790
|
{
|
|
5639
5791
|
type: "button",
|
|
5640
5792
|
className: "absolute right-[9px] top-[9px] rounded-sm p-1.5 text-foreground hover:bg-muted/50 h-7",
|
|
5641
5793
|
"aria-label": "Close",
|
|
5642
5794
|
onClick: onClose,
|
|
5643
|
-
children: /* @__PURE__ */
|
|
5795
|
+
children: /* @__PURE__ */ jsx20(X3, { size: 16, "aria-hidden": true })
|
|
5644
5796
|
}
|
|
5645
5797
|
) }),
|
|
5646
|
-
/* @__PURE__ */
|
|
5798
|
+
/* @__PURE__ */ jsx20(DialogHeader, { className: "w-full gap-1.5 p-6 pr-12", children: /* @__PURE__ */ jsx20(DialogTitle, { className: "m-0 w-full break-words", children: state.title }) }),
|
|
5647
5799
|
/* @__PURE__ */ jsxs11("div", { className: "flex w-full flex-col gap-3 px-6 pb-8 pt-1", children: [
|
|
5648
|
-
state.showBreadcrumb && state.selectedPage && state.selectedSection ? /* @__PURE__ */
|
|
5800
|
+
state.showBreadcrumb && state.selectedPage && state.selectedSection ? /* @__PURE__ */ jsx20(
|
|
5649
5801
|
DestinationBreadcrumb,
|
|
5650
5802
|
{
|
|
5651
5803
|
pageTitle: state.selectedPage.title,
|
|
5652
5804
|
sectionLabel: state.selectedSection.label
|
|
5653
5805
|
}
|
|
5654
|
-
) : /* @__PURE__ */
|
|
5806
|
+
) : /* @__PURE__ */ jsx20(
|
|
5655
5807
|
UrlOrPageInput,
|
|
5656
5808
|
{
|
|
5657
5809
|
value: state.searchValue,
|
|
@@ -5665,7 +5817,7 @@ function LinkEditorPanel({ state, onClose }) {
|
|
|
5665
5817
|
}
|
|
5666
5818
|
),
|
|
5667
5819
|
state.showChooseSection ? /* @__PURE__ */ jsxs11("div", { className: "flex flex-col justify-center gap-2", children: [
|
|
5668
|
-
/* @__PURE__ */
|
|
5820
|
+
/* @__PURE__ */ jsx20(
|
|
5669
5821
|
Button,
|
|
5670
5822
|
{
|
|
5671
5823
|
type: "button",
|
|
@@ -5677,14 +5829,14 @@ function LinkEditorPanel({ state, onClose }) {
|
|
|
5677
5829
|
}
|
|
5678
5830
|
),
|
|
5679
5831
|
/* @__PURE__ */ jsxs11("div", { className: "flex items-center gap-1 text-sm text-muted-foreground", children: [
|
|
5680
|
-
/* @__PURE__ */
|
|
5681
|
-
/* @__PURE__ */
|
|
5832
|
+
/* @__PURE__ */ jsx20(Info, { size: 16, className: "shrink-0", "aria-hidden": true }),
|
|
5833
|
+
/* @__PURE__ */ jsx20("span", { children: "Pick a section this link should scroll to." })
|
|
5682
5834
|
] })
|
|
5683
5835
|
] }) : null,
|
|
5684
|
-
state.showSectionRow && state.selectedSection ? /* @__PURE__ */
|
|
5836
|
+
state.showSectionRow && state.selectedSection ? /* @__PURE__ */ jsx20(SectionTreeItem, { section: state.selectedSection, selected: true }) : null
|
|
5685
5837
|
] }),
|
|
5686
5838
|
/* @__PURE__ */ jsxs11(DialogFooter, { className: "w-full px-6 pb-6", children: [
|
|
5687
|
-
/* @__PURE__ */
|
|
5839
|
+
/* @__PURE__ */ jsx20(
|
|
5688
5840
|
Button,
|
|
5689
5841
|
{
|
|
5690
5842
|
type: "button",
|
|
@@ -5699,7 +5851,7 @@ function LinkEditorPanel({ state, onClose }) {
|
|
|
5699
5851
|
children: state.secondaryLabel
|
|
5700
5852
|
}
|
|
5701
5853
|
),
|
|
5702
|
-
/* @__PURE__ */
|
|
5854
|
+
/* @__PURE__ */ jsx20(
|
|
5703
5855
|
Button,
|
|
5704
5856
|
{
|
|
5705
5857
|
type: "button",
|
|
@@ -5718,11 +5870,11 @@ function LinkEditorPanel({ state, onClose }) {
|
|
|
5718
5870
|
}
|
|
5719
5871
|
|
|
5720
5872
|
// src/ui/link-modal/SectionPickerOverlay.tsx
|
|
5721
|
-
import { useCallback as useCallback2, useEffect as useEffect4, useMemo as useMemo2, useRef as useRef5, useState as
|
|
5873
|
+
import { useCallback as useCallback2, useEffect as useEffect4, useMemo as useMemo2, useRef as useRef5, useState as useState5 } from "react";
|
|
5722
5874
|
import { createPortal } from "react-dom";
|
|
5723
5875
|
import { ArrowLeft, Check } from "lucide-react";
|
|
5724
5876
|
import { usePathname, useRouter } from "next/navigation";
|
|
5725
|
-
import { jsx as
|
|
5877
|
+
import { jsx as jsx21, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
5726
5878
|
var DIM_OVERLAY = "rgba(0, 0, 0, 0.45)";
|
|
5727
5879
|
function rectsEqual(a, b) {
|
|
5728
5880
|
if (a.size !== b.size) return false;
|
|
@@ -5755,7 +5907,7 @@ function hitTestSectionId(x, y, sectionIds, rects) {
|
|
|
5755
5907
|
return null;
|
|
5756
5908
|
}
|
|
5757
5909
|
function useSectionRects(sectionIdsKey, enabled) {
|
|
5758
|
-
const [rects, setRects] =
|
|
5910
|
+
const [rects, setRects] = useState5(/* @__PURE__ */ new Map());
|
|
5759
5911
|
const sectionIds = useMemo2(
|
|
5760
5912
|
() => sectionIdsKey ? sectionIdsKey.split("\0") : [],
|
|
5761
5913
|
[sectionIdsKey]
|
|
@@ -5801,13 +5953,13 @@ function SectionPickerOverlay({
|
|
|
5801
5953
|
}) {
|
|
5802
5954
|
const router = useRouter();
|
|
5803
5955
|
const pathname = usePathname();
|
|
5804
|
-
const [selectedId, setSelectedId] =
|
|
5805
|
-
const [hoveredId, setHoveredId] =
|
|
5956
|
+
const [selectedId, setSelectedId] = useState5(null);
|
|
5957
|
+
const [hoveredId, setHoveredId] = useState5(null);
|
|
5806
5958
|
const pointerRef = useRef5(null);
|
|
5807
5959
|
const pointerScreenRef = useRef5(null);
|
|
5808
5960
|
const iframeOffsetTopRef = useRef5(null);
|
|
5809
5961
|
const sectionIdsRef = useRef5([]);
|
|
5810
|
-
const [chromeClip, setChromeClip] =
|
|
5962
|
+
const [chromeClip, setChromeClip] = useState5(
|
|
5811
5963
|
() => ({
|
|
5812
5964
|
top: 0,
|
|
5813
5965
|
bottom: typeof window !== "undefined" ? window.innerHeight : 0
|
|
@@ -5961,7 +6113,7 @@ function SectionPickerOverlay({
|
|
|
5961
6113
|
role: "dialog",
|
|
5962
6114
|
"aria-label": "Choose a section",
|
|
5963
6115
|
children: [
|
|
5964
|
-
/* @__PURE__ */
|
|
6116
|
+
/* @__PURE__ */ jsx21(
|
|
5965
6117
|
"div",
|
|
5966
6118
|
{
|
|
5967
6119
|
className: "pointer-events-auto fixed left-5 z-[2]",
|
|
@@ -5975,14 +6127,14 @@ function SectionPickerOverlay({
|
|
|
5975
6127
|
className: "h-8 min-w-0 gap-1 border-border bg-background px-2 py-1.5 shadow-sm hover:bg-muted cursor-pointer",
|
|
5976
6128
|
onClick: onBack,
|
|
5977
6129
|
children: [
|
|
5978
|
-
/* @__PURE__ */
|
|
6130
|
+
/* @__PURE__ */ jsx21(ArrowLeft, { className: "size-4 shrink-0", "aria-hidden": true }),
|
|
5979
6131
|
"Back"
|
|
5980
6132
|
]
|
|
5981
6133
|
}
|
|
5982
6134
|
)
|
|
5983
6135
|
}
|
|
5984
6136
|
),
|
|
5985
|
-
/* @__PURE__ */
|
|
6137
|
+
/* @__PURE__ */ jsx21(
|
|
5986
6138
|
"div",
|
|
5987
6139
|
{
|
|
5988
6140
|
className: "pointer-events-none fixed left-1/2 z-[2] rounded-lg px-4 py-3 text-xs leading-4 tracking-[0.18px] text-white shadow-md",
|
|
@@ -5995,7 +6147,7 @@ function SectionPickerOverlay({
|
|
|
5995
6147
|
children: "Click on section to select"
|
|
5996
6148
|
}
|
|
5997
6149
|
),
|
|
5998
|
-
!isOnTargetPage ? /* @__PURE__ */
|
|
6150
|
+
!isOnTargetPage ? /* @__PURE__ */ jsx21(
|
|
5999
6151
|
"div",
|
|
6000
6152
|
{
|
|
6001
6153
|
className: "pointer-events-none fixed left-1/2 z-[1] -translate-x-1/2 rounded-md px-3 py-2 text-sm text-muted-foreground shadow-sm",
|
|
@@ -6003,7 +6155,7 @@ function SectionPickerOverlay({
|
|
|
6003
6155
|
children: "Loading page preview\u2026"
|
|
6004
6156
|
}
|
|
6005
6157
|
) : null,
|
|
6006
|
-
isOnTargetPage && liveSections.length === 0 ? /* @__PURE__ */
|
|
6158
|
+
isOnTargetPage && liveSections.length === 0 ? /* @__PURE__ */ jsx21("div", { className: "pointer-events-auto fixed inset-0 z-[1] flex items-center justify-center bg-muted/40", children: /* @__PURE__ */ jsx21("p", { className: "text-sm text-muted-foreground", children: "No sections found on this page." }) }) : null,
|
|
6007
6159
|
isOnTargetPage ? liveSections.map((section) => {
|
|
6008
6160
|
const rect = rects.get(section.id);
|
|
6009
6161
|
if (!rect || rect.width <= 0 || rect.height <= 0) return null;
|
|
@@ -6025,7 +6177,7 @@ function SectionPickerOverlay({
|
|
|
6025
6177
|
"aria-label": `Select section ${section.label}`,
|
|
6026
6178
|
onClick: () => handleSelect(section),
|
|
6027
6179
|
children: [
|
|
6028
|
-
isLit ? /* @__PURE__ */
|
|
6180
|
+
isLit ? /* @__PURE__ */ jsx21(
|
|
6029
6181
|
"span",
|
|
6030
6182
|
{
|
|
6031
6183
|
className: "pointer-events-none absolute",
|
|
@@ -6038,13 +6190,13 @@ function SectionPickerOverlay({
|
|
|
6038
6190
|
"aria-hidden": true
|
|
6039
6191
|
}
|
|
6040
6192
|
) : null,
|
|
6041
|
-
isSelected ? /* @__PURE__ */
|
|
6193
|
+
isSelected ? /* @__PURE__ */ jsx21(
|
|
6042
6194
|
"span",
|
|
6043
6195
|
{
|
|
6044
6196
|
className: "absolute right-3 top-3 flex size-8 items-center justify-center rounded-full text-white",
|
|
6045
6197
|
style: { backgroundColor: "var(--ohw-primary, #0885fe)" },
|
|
6046
6198
|
"aria-hidden": true,
|
|
6047
|
-
children: /* @__PURE__ */
|
|
6199
|
+
children: /* @__PURE__ */ jsx21(Check, { className: "size-5" })
|
|
6048
6200
|
}
|
|
6049
6201
|
) : null
|
|
6050
6202
|
]
|
|
@@ -6060,7 +6212,7 @@ function SectionPickerOverlay({
|
|
|
6060
6212
|
}
|
|
6061
6213
|
|
|
6062
6214
|
// src/ui/link-modal/useLinkModalState.ts
|
|
6063
|
-
import { useCallback as useCallback3, useEffect as useEffect5, useMemo as useMemo3, useState as
|
|
6215
|
+
import { useCallback as useCallback3, useEffect as useEffect5, useMemo as useMemo3, useState as useState6 } from "react";
|
|
6064
6216
|
function useLinkModalState({
|
|
6065
6217
|
open,
|
|
6066
6218
|
mode,
|
|
@@ -6073,12 +6225,12 @@ function useLinkModalState({
|
|
|
6073
6225
|
onSubmit
|
|
6074
6226
|
}) {
|
|
6075
6227
|
const availablePages = useMemo3(() => pages, [pages]);
|
|
6076
|
-
const [searchValue, setSearchValue] =
|
|
6077
|
-
const [selectedPage, setSelectedPage] =
|
|
6078
|
-
const [selectedSection, setSelectedSection] =
|
|
6079
|
-
const [step, setStep] =
|
|
6080
|
-
const [dropdownOpen, setDropdownOpen] =
|
|
6081
|
-
const [urlError, setUrlError] =
|
|
6228
|
+
const [searchValue, setSearchValue] = useState6("");
|
|
6229
|
+
const [selectedPage, setSelectedPage] = useState6(null);
|
|
6230
|
+
const [selectedSection, setSelectedSection] = useState6(null);
|
|
6231
|
+
const [step, setStep] = useState6("input");
|
|
6232
|
+
const [dropdownOpen, setDropdownOpen] = useState6(false);
|
|
6233
|
+
const [urlError, setUrlError] = useState6("");
|
|
6082
6234
|
const reset = useCallback3(() => {
|
|
6083
6235
|
setSearchValue("");
|
|
6084
6236
|
setSelectedPage(null);
|
|
@@ -6224,7 +6376,7 @@ function useLinkModalState({
|
|
|
6224
6376
|
}
|
|
6225
6377
|
|
|
6226
6378
|
// src/ui/link-modal/LinkPopover.tsx
|
|
6227
|
-
import { Fragment as Fragment4, jsx as
|
|
6379
|
+
import { Fragment as Fragment4, jsx as jsx22, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
6228
6380
|
function postToParent(data) {
|
|
6229
6381
|
window.parent?.postMessage(data, "*");
|
|
6230
6382
|
}
|
|
@@ -6321,14 +6473,14 @@ function LinkPopover({
|
|
|
6321
6473
|
};
|
|
6322
6474
|
}, [open, sectionPickerActive]);
|
|
6323
6475
|
return /* @__PURE__ */ jsxs13(Fragment4, { children: [
|
|
6324
|
-
/* @__PURE__ */
|
|
6476
|
+
/* @__PURE__ */ jsx22(
|
|
6325
6477
|
Dialog2,
|
|
6326
6478
|
{
|
|
6327
6479
|
open: open && !sectionPickerActive,
|
|
6328
6480
|
onOpenChange: (next) => {
|
|
6329
6481
|
if (!next) onClose?.();
|
|
6330
6482
|
},
|
|
6331
|
-
children: /* @__PURE__ */
|
|
6483
|
+
children: /* @__PURE__ */ jsx22(
|
|
6332
6484
|
DialogContent,
|
|
6333
6485
|
{
|
|
6334
6486
|
ref: panelRef,
|
|
@@ -6338,12 +6490,12 @@ function LinkPopover({
|
|
|
6338
6490
|
"data-ohw-bridge": "",
|
|
6339
6491
|
showCloseButton: false,
|
|
6340
6492
|
className: "gap-0 p-0 w-full max-w-[448px] pointer-events-auto z-[2147483646] overflow-visible",
|
|
6341
|
-
children: /* @__PURE__ */
|
|
6493
|
+
children: /* @__PURE__ */ jsx22(LinkEditorPanel, { state, onClose })
|
|
6342
6494
|
}
|
|
6343
6495
|
)
|
|
6344
6496
|
}
|
|
6345
6497
|
),
|
|
6346
|
-
sectionPickerActive && state.selectedPage ? /* @__PURE__ */
|
|
6498
|
+
sectionPickerActive && state.selectedPage ? /* @__PURE__ */ jsx22(
|
|
6347
6499
|
SectionPickerOverlay,
|
|
6348
6500
|
{
|
|
6349
6501
|
pagePath: state.selectedPage.path,
|
|
@@ -6882,6 +7034,53 @@ function insertNavbarItem(href, label, afterAnchor = null) {
|
|
|
6882
7034
|
order
|
|
6883
7035
|
};
|
|
6884
7036
|
}
|
|
7037
|
+
function duplicateNavbarItem(sourceAnchor) {
|
|
7038
|
+
if (!isNavbarLinkItem(sourceAnchor)) return null;
|
|
7039
|
+
const sourceHrefKey = sourceAnchor.getAttribute("data-ohw-href-key");
|
|
7040
|
+
if (!sourceHrefKey || !isNavbarHrefKey(sourceHrefKey)) return null;
|
|
7041
|
+
const href = getLinkHref(sourceAnchor);
|
|
7042
|
+
const labelEl = sourceAnchor.querySelector('[data-ohw-editable="text"]');
|
|
7043
|
+
const label = (labelEl?.textContent ?? "").trim() || "Untitled";
|
|
7044
|
+
const forest = getNavForestFromDom();
|
|
7045
|
+
const sourceNode = forest.find((n) => n.id === sourceHrefKey);
|
|
7046
|
+
const childIds = sourceNode?.children.map((c) => c.id) ?? [];
|
|
7047
|
+
const primary = insertNavbarItem(href, label, sourceAnchor);
|
|
7048
|
+
const childResults = [];
|
|
7049
|
+
let after = primary.anchor;
|
|
7050
|
+
for (const childId of childIds) {
|
|
7051
|
+
const childEl = findCounterpartByHrefKey(childId, document) ?? document.querySelector(`[data-ohw-href-key="${CSS.escape(childId)}"]`);
|
|
7052
|
+
if (!childEl || !isNavbarLinkItem(childEl)) continue;
|
|
7053
|
+
const childHref = getLinkHref(childEl);
|
|
7054
|
+
const childLabelEl = childEl.querySelector('[data-ohw-editable="text"]');
|
|
7055
|
+
const childLabel = (childLabelEl?.textContent ?? "").trim() || "Untitled";
|
|
7056
|
+
const inserted = insertNavbarItem(childHref, childLabel, after);
|
|
7057
|
+
childResults.push(inserted);
|
|
7058
|
+
after = inserted.anchor;
|
|
7059
|
+
}
|
|
7060
|
+
let orderJson;
|
|
7061
|
+
if (childResults.length > 0) {
|
|
7062
|
+
const nextForest = getNavForestFromDom();
|
|
7063
|
+
const withoutNew = nextForest.filter(
|
|
7064
|
+
(n) => n.id !== primary.hrefKey && !childResults.some((c) => c.hrefKey === n.id)
|
|
7065
|
+
);
|
|
7066
|
+
const sourceIdx = withoutNew.findIndex((n) => n.id === sourceHrefKey);
|
|
7067
|
+
const insertAt = sourceIdx >= 0 ? sourceIdx + 1 : withoutNew.length;
|
|
7068
|
+
withoutNew.splice(insertAt, 0, {
|
|
7069
|
+
id: primary.hrefKey,
|
|
7070
|
+
children: childResults.map((c) => ({ id: c.hrefKey, children: [] }))
|
|
7071
|
+
});
|
|
7072
|
+
applyNavForest(withoutNew);
|
|
7073
|
+
orderJson = serializeNavOrder(withoutNew);
|
|
7074
|
+
} else {
|
|
7075
|
+
orderJson = serializeNavOrder(getNavForestFromDom());
|
|
7076
|
+
}
|
|
7077
|
+
return {
|
|
7078
|
+
...primary,
|
|
7079
|
+
order: flattenNavOrder(parseNavOrderJson(orderJson) ?? getNavForestFromDom()),
|
|
7080
|
+
childResults,
|
|
7081
|
+
orderJson
|
|
7082
|
+
};
|
|
7083
|
+
}
|
|
6885
7084
|
|
|
6886
7085
|
// src/lib/footer-items.ts
|
|
6887
7086
|
var FOOTER_ORDER_KEY = "__ohw_footer_order";
|
|
@@ -7099,16 +7298,6 @@ function getNextFooterColumnIndex() {
|
|
|
7099
7298
|
if (indices.length === 0) return 0;
|
|
7100
7299
|
return Math.max(...indices) + 1;
|
|
7101
7300
|
}
|
|
7102
|
-
function cloneFooterLinkShell(template) {
|
|
7103
|
-
const anchor = document.createElement("a");
|
|
7104
|
-
if (template) {
|
|
7105
|
-
anchor.style.cssText = template.style.cssText;
|
|
7106
|
-
if (template.className) anchor.className = template.className;
|
|
7107
|
-
}
|
|
7108
|
-
anchor.style.cursor = "pointer";
|
|
7109
|
-
anchor.style.textDecoration = "none";
|
|
7110
|
-
return anchor;
|
|
7111
|
-
}
|
|
7112
7301
|
function buildFooterHeading(colIndex, text) {
|
|
7113
7302
|
const heading = document.createElement("p");
|
|
7114
7303
|
heading.setAttribute("data-ohw-editable", "text");
|
|
@@ -7437,6 +7626,76 @@ function hitTestColumnDropSlot(clientX, _clientY) {
|
|
|
7437
7626
|
}
|
|
7438
7627
|
return best?.slot ?? null;
|
|
7439
7628
|
}
|
|
7629
|
+
function getLinkHref2(el) {
|
|
7630
|
+
const key = el.getAttribute("data-ohw-href-key");
|
|
7631
|
+
if (key) {
|
|
7632
|
+
const stored = getStoredLinkHref(key);
|
|
7633
|
+
if (stored !== void 0) return stored;
|
|
7634
|
+
}
|
|
7635
|
+
return el.getAttribute("href") ?? "";
|
|
7636
|
+
}
|
|
7637
|
+
function getNextFooterItemIndex(col) {
|
|
7638
|
+
let max = -1;
|
|
7639
|
+
for (const el of document.querySelectorAll("footer [data-ohw-href-key]")) {
|
|
7640
|
+
const parsed = parseFooterHrefKey(el.getAttribute("data-ohw-href-key"));
|
|
7641
|
+
if (!parsed || parsed.col !== col) continue;
|
|
7642
|
+
if (parsed.item > max) max = parsed.item;
|
|
7643
|
+
}
|
|
7644
|
+
return max + 1;
|
|
7645
|
+
}
|
|
7646
|
+
function cloneFooterLinkShell(template) {
|
|
7647
|
+
const anchor = document.createElement("a");
|
|
7648
|
+
if (template) {
|
|
7649
|
+
anchor.style.cssText = template.style.cssText;
|
|
7650
|
+
if (template.className) anchor.className = template.className;
|
|
7651
|
+
}
|
|
7652
|
+
anchor.style.cursor = "pointer";
|
|
7653
|
+
anchor.style.textDecoration = "none";
|
|
7654
|
+
return anchor;
|
|
7655
|
+
}
|
|
7656
|
+
function insertFooterItem(column, href, label, afterAnchor = null) {
|
|
7657
|
+
const columns = listFooterColumns();
|
|
7658
|
+
const colIndex = columns.indexOf(column);
|
|
7659
|
+
if (colIndex < 0) throw new Error("Footer column not found");
|
|
7660
|
+
const item = getNextFooterItemIndex(colIndex);
|
|
7661
|
+
const hrefKey = `footer-${colIndex}-${item}-href`;
|
|
7662
|
+
const labelKey = `footer-${colIndex}-${item}-label`;
|
|
7663
|
+
const template = listFooterLinksInColumn(column)[0] ?? null;
|
|
7664
|
+
const anchor = cloneFooterLinkShell(template);
|
|
7665
|
+
anchor.href = href;
|
|
7666
|
+
anchor.setAttribute("data-ohw-href-key", hrefKey);
|
|
7667
|
+
const span = document.createElement("span");
|
|
7668
|
+
span.setAttribute("data-ohw-editable", "text");
|
|
7669
|
+
span.setAttribute("data-ohw-key", labelKey);
|
|
7670
|
+
span.textContent = label;
|
|
7671
|
+
anchor.appendChild(span);
|
|
7672
|
+
if (afterAnchor && afterAnchor.parentElement === column) {
|
|
7673
|
+
afterAnchor.insertAdjacentElement("afterend", anchor);
|
|
7674
|
+
} else {
|
|
7675
|
+
column.appendChild(anchor);
|
|
7676
|
+
}
|
|
7677
|
+
const order = getFooterOrderFromDom();
|
|
7678
|
+
applyFooterOrder(order);
|
|
7679
|
+
return {
|
|
7680
|
+
anchor,
|
|
7681
|
+
col: colIndex,
|
|
7682
|
+
item,
|
|
7683
|
+
hrefKey,
|
|
7684
|
+
labelKey,
|
|
7685
|
+
href,
|
|
7686
|
+
label,
|
|
7687
|
+
order
|
|
7688
|
+
};
|
|
7689
|
+
}
|
|
7690
|
+
function duplicateFooterItem(sourceAnchor) {
|
|
7691
|
+
if (!isFooterLinkAnchor(sourceAnchor)) return null;
|
|
7692
|
+
const column = findFooterColumnForLink(sourceAnchor);
|
|
7693
|
+
if (!column) return null;
|
|
7694
|
+
const href = getLinkHref2(sourceAnchor);
|
|
7695
|
+
const labelEl = sourceAnchor.querySelector('[data-ohw-editable="text"]');
|
|
7696
|
+
const label = (labelEl?.textContent ?? "").trim() || "Untitled";
|
|
7697
|
+
return insertFooterItem(column, href || "/", label, sourceAnchor);
|
|
7698
|
+
}
|
|
7440
7699
|
|
|
7441
7700
|
// src/lib/add-footer-column.ts
|
|
7442
7701
|
function buildFooterColumnEditContentPatch(result) {
|
|
@@ -7659,7 +7918,7 @@ function hitTestNavDropSlot(clientX, clientY, draggedHrefKey) {
|
|
|
7659
7918
|
}
|
|
7660
7919
|
|
|
7661
7920
|
// src/useNavItemDrag.ts
|
|
7662
|
-
import { useCallback as useCallback4, useEffect as useEffect7, useRef as useRef6, useState as
|
|
7921
|
+
import { useCallback as useCallback4, useEffect as useEffect7, useRef as useRef6, useState as useState7 } from "react";
|
|
7663
7922
|
function useNavItemDrag({
|
|
7664
7923
|
isEditMode,
|
|
7665
7924
|
editContentRef,
|
|
@@ -7685,8 +7944,8 @@ function useNavItemDrag({
|
|
|
7685
7944
|
isNavbarButton: isNavbarButton3
|
|
7686
7945
|
}) {
|
|
7687
7946
|
const navDragRef = useRef6(null);
|
|
7688
|
-
const [navDropSlots, setNavDropSlots] =
|
|
7689
|
-
const [activeNavDropIndex, setActiveNavDropIndex] =
|
|
7947
|
+
const [navDropSlots, setNavDropSlots] = useState7([]);
|
|
7948
|
+
const [activeNavDropIndex, setActiveNavDropIndex] = useState7(null);
|
|
7690
7949
|
const navPointerDragRef = useRef6(null);
|
|
7691
7950
|
const clearNavDragVisuals = useCallback4(() => {
|
|
7692
7951
|
navDragRef.current = null;
|
|
@@ -7996,11 +8255,11 @@ function useNavItemDrag({
|
|
|
7996
8255
|
|
|
7997
8256
|
// src/ui/footer-container-chrome.tsx
|
|
7998
8257
|
import { Plus as Plus2 } from "lucide-react";
|
|
7999
|
-
import { jsx as
|
|
8258
|
+
import { jsx as jsx23, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
8000
8259
|
function FooterContainerChrome({ rect, onAdd }) {
|
|
8001
8260
|
const chromeGap = 6;
|
|
8002
8261
|
const buttonMargin = 7;
|
|
8003
|
-
return /* @__PURE__ */
|
|
8262
|
+
return /* @__PURE__ */ jsx23(TooltipProvider, { delayDuration: 0, children: /* @__PURE__ */ jsx23(
|
|
8004
8263
|
"div",
|
|
8005
8264
|
{
|
|
8006
8265
|
"data-ohw-footer-container-chrome": "",
|
|
@@ -8013,7 +8272,7 @@ function FooterContainerChrome({ rect, onAdd }) {
|
|
|
8013
8272
|
height: rect.height + chromeGap * 2
|
|
8014
8273
|
},
|
|
8015
8274
|
children: /* @__PURE__ */ jsxs14(Tooltip, { children: [
|
|
8016
|
-
/* @__PURE__ */
|
|
8275
|
+
/* @__PURE__ */ jsx23(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx23(
|
|
8017
8276
|
"button",
|
|
8018
8277
|
{
|
|
8019
8278
|
type: "button",
|
|
@@ -8030,17 +8289,17 @@ function FooterContainerChrome({ rect, onAdd }) {
|
|
|
8030
8289
|
e.stopPropagation();
|
|
8031
8290
|
onAdd();
|
|
8032
8291
|
},
|
|
8033
|
-
children: /* @__PURE__ */
|
|
8292
|
+
children: /* @__PURE__ */ jsx23(Plus2, { className: "size-4 shrink-0 text-foreground", "aria-hidden": true })
|
|
8034
8293
|
}
|
|
8035
8294
|
) }),
|
|
8036
|
-
/* @__PURE__ */
|
|
8295
|
+
/* @__PURE__ */ jsx23(TooltipContent, { side: "bottom", sideOffset: 9, children: "Add item" })
|
|
8037
8296
|
] })
|
|
8038
8297
|
}
|
|
8039
8298
|
) });
|
|
8040
8299
|
}
|
|
8041
8300
|
|
|
8042
8301
|
// src/lib/carousel.ts
|
|
8043
|
-
import { useEffect as useEffect8, useState as
|
|
8302
|
+
import { useEffect as useEffect8, useState as useState8 } from "react";
|
|
8044
8303
|
var CAROUSEL_ATTR = "data-ohw-carousel";
|
|
8045
8304
|
var CAROUSEL_VALUE_ATTR = "data-ohw-carousel-value";
|
|
8046
8305
|
var CAROUSEL_SLIDE_ATTR = "data-ohw-carousel-slide";
|
|
@@ -8102,7 +8361,7 @@ function applyCarouselNode(key, val) {
|
|
|
8102
8361
|
return true;
|
|
8103
8362
|
}
|
|
8104
8363
|
function useOhwCarousel(key, initial) {
|
|
8105
|
-
const [images, setImages] =
|
|
8364
|
+
const [images, setImages] = useState8(initial);
|
|
8106
8365
|
useEffect8(() => {
|
|
8107
8366
|
const el = document.querySelector(
|
|
8108
8367
|
`[${CAROUSEL_ATTR}][data-ohw-key="${CSS.escape(key)}"]`
|
|
@@ -8125,13 +8384,13 @@ function useOhwCarousel(key, initial) {
|
|
|
8125
8384
|
|
|
8126
8385
|
// src/ui/navbar-container-chrome.tsx
|
|
8127
8386
|
import { Plus as Plus3 } from "lucide-react";
|
|
8128
|
-
import { jsx as
|
|
8387
|
+
import { jsx as jsx24 } from "react/jsx-runtime";
|
|
8129
8388
|
function NavbarContainerChrome({
|
|
8130
8389
|
rect,
|
|
8131
8390
|
onAdd
|
|
8132
8391
|
}) {
|
|
8133
8392
|
const chromeGap = 6;
|
|
8134
|
-
return /* @__PURE__ */
|
|
8393
|
+
return /* @__PURE__ */ jsx24(
|
|
8135
8394
|
"div",
|
|
8136
8395
|
{
|
|
8137
8396
|
"data-ohw-navbar-container-chrome": "",
|
|
@@ -8143,7 +8402,7 @@ function NavbarContainerChrome({
|
|
|
8143
8402
|
width: rect.width + chromeGap * 2,
|
|
8144
8403
|
height: rect.height + chromeGap * 2
|
|
8145
8404
|
},
|
|
8146
|
-
children: /* @__PURE__ */
|
|
8405
|
+
children: /* @__PURE__ */ jsx24(
|
|
8147
8406
|
"button",
|
|
8148
8407
|
{
|
|
8149
8408
|
type: "button",
|
|
@@ -8160,7 +8419,7 @@ function NavbarContainerChrome({
|
|
|
8160
8419
|
e.stopPropagation();
|
|
8161
8420
|
onAdd();
|
|
8162
8421
|
},
|
|
8163
|
-
children: /* @__PURE__ */
|
|
8422
|
+
children: /* @__PURE__ */ jsx24(Plus3, { className: "size-4 shrink-0 text-foreground", "aria-hidden": true })
|
|
8164
8423
|
}
|
|
8165
8424
|
)
|
|
8166
8425
|
}
|
|
@@ -8169,7 +8428,7 @@ function NavbarContainerChrome({
|
|
|
8169
8428
|
|
|
8170
8429
|
// src/ui/drop-indicator.tsx
|
|
8171
8430
|
import * as React10 from "react";
|
|
8172
|
-
import { jsx as
|
|
8431
|
+
import { jsx as jsx25 } from "react/jsx-runtime";
|
|
8173
8432
|
var dropIndicatorVariants = cva(
|
|
8174
8433
|
"ov-gap-line pointer-events-none shrink-0 transition-opacity duration-150",
|
|
8175
8434
|
{
|
|
@@ -8193,7 +8452,7 @@ var dropIndicatorVariants = cva(
|
|
|
8193
8452
|
);
|
|
8194
8453
|
var DropIndicator = React10.forwardRef(
|
|
8195
8454
|
({ className, direction, state, ...props }, ref) => {
|
|
8196
|
-
return /* @__PURE__ */
|
|
8455
|
+
return /* @__PURE__ */ jsx25(
|
|
8197
8456
|
"div",
|
|
8198
8457
|
{
|
|
8199
8458
|
ref,
|
|
@@ -8210,7 +8469,7 @@ var DropIndicator = React10.forwardRef(
|
|
|
8210
8469
|
DropIndicator.displayName = "DropIndicator";
|
|
8211
8470
|
|
|
8212
8471
|
// src/ui/badge.tsx
|
|
8213
|
-
import { jsx as
|
|
8472
|
+
import { jsx as jsx26 } from "react/jsx-runtime";
|
|
8214
8473
|
var badgeVariants = cva(
|
|
8215
8474
|
"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
|
|
8216
8475
|
{
|
|
@@ -8228,12 +8487,12 @@ var badgeVariants = cva(
|
|
|
8228
8487
|
}
|
|
8229
8488
|
);
|
|
8230
8489
|
function Badge({ className, variant, ...props }) {
|
|
8231
|
-
return /* @__PURE__ */
|
|
8490
|
+
return /* @__PURE__ */ jsx26("div", { className: cn(badgeVariants({ variant }), className), ...props });
|
|
8232
8491
|
}
|
|
8233
8492
|
|
|
8234
8493
|
// src/OhhwellsBridge.tsx
|
|
8235
8494
|
import { Link as Link2 } from "lucide-react";
|
|
8236
|
-
import { Fragment as Fragment5, jsx as
|
|
8495
|
+
import { Fragment as Fragment5, jsx as jsx27, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
8237
8496
|
var PRIMARY2 = "#0885FE";
|
|
8238
8497
|
var IMAGE_FADE_MS = 300;
|
|
8239
8498
|
function runOpacityFade(el, onDone) {
|
|
@@ -8412,7 +8671,7 @@ function mountSchedulingWidget(insertAfter, notifyOnConnect = false, scheduleId,
|
|
|
8412
8671
|
const root = createRoot(container);
|
|
8413
8672
|
flushSync(() => {
|
|
8414
8673
|
root.render(
|
|
8415
|
-
/* @__PURE__ */
|
|
8674
|
+
/* @__PURE__ */ jsx27(
|
|
8416
8675
|
SchedulingWidget,
|
|
8417
8676
|
{
|
|
8418
8677
|
notifyOnConnect,
|
|
@@ -8452,7 +8711,7 @@ function mountSchedulingEntries(entries, notifyOnConnect = false) {
|
|
|
8452
8711
|
}
|
|
8453
8712
|
}
|
|
8454
8713
|
}
|
|
8455
|
-
function
|
|
8714
|
+
function getLinkHref3(el) {
|
|
8456
8715
|
const anchor = el instanceof HTMLAnchorElement ? el : el.querySelector("a");
|
|
8457
8716
|
return anchor?.getAttribute("href") ?? "";
|
|
8458
8717
|
}
|
|
@@ -8502,7 +8761,7 @@ function collectEditableNodes(extraContent) {
|
|
|
8502
8761
|
return { key: el.dataset.ohwKey ?? "", type: "video", text: getVideoEl(el)?.src ?? "" };
|
|
8503
8762
|
}
|
|
8504
8763
|
if (el.dataset.ohwEditable === "link") {
|
|
8505
|
-
return { key: el.dataset.ohwKey ?? "", type: "link", text:
|
|
8764
|
+
return { key: el.dataset.ohwKey ?? "", type: "link", text: getLinkHref3(el) };
|
|
8506
8765
|
}
|
|
8507
8766
|
return {
|
|
8508
8767
|
key: el.dataset.ohwKey ?? "",
|
|
@@ -8513,7 +8772,7 @@ function collectEditableNodes(extraContent) {
|
|
|
8513
8772
|
document.querySelectorAll("[data-ohw-href-key]").forEach((el) => {
|
|
8514
8773
|
const key = el.getAttribute("data-ohw-href-key") ?? "";
|
|
8515
8774
|
if (!key) return;
|
|
8516
|
-
nodes.push({ key, type: "link", text:
|
|
8775
|
+
nodes.push({ key, type: "link", text: getLinkHref3(el) });
|
|
8517
8776
|
});
|
|
8518
8777
|
if (extraContent) {
|
|
8519
8778
|
for (const key of [NAV_ORDER_KEY, FOOTER_ORDER_KEY, NAV_COUNT_KEY]) {
|
|
@@ -8616,7 +8875,7 @@ function applyLinkByKey(key, val) {
|
|
|
8616
8875
|
}
|
|
8617
8876
|
function isInsideLinkEditor(target) {
|
|
8618
8877
|
return Boolean(
|
|
8619
|
-
target.closest("[data-ohw-link-popover-root]") || target.closest("[data-ohw-link-modal-root]") || target.closest("[data-ohw-link-page-dropdown]") || target.closest("[data-ohw-section-picker]") || target.closest("[data-ohw-navbar-container-chrome]") || target.closest("[data-ohw-navbar-add-button]") || target.closest("[data-ohw-footer-container-chrome]") || target.closest("[data-ohw-footer-add-button]") || target.closest('[data-slot="popover-content"]') || target.closest('[data-slot="dialog-content"]') || target.closest('[data-slot="dialog-overlay"]')
|
|
8878
|
+
target.closest("[data-ohw-link-popover-root]") || target.closest("[data-ohw-link-modal-root]") || target.closest("[data-ohw-link-page-dropdown]") || target.closest("[data-ohw-section-picker]") || target.closest("[data-ohw-navbar-container-chrome]") || target.closest("[data-ohw-navbar-add-button]") || target.closest("[data-ohw-footer-container-chrome]") || target.closest("[data-ohw-footer-add-button]") || target.closest("[data-ohw-more-menu]") || target.closest('[data-slot="dropdown-menu-content"]') || target.closest('[data-slot="popover-content"]') || target.closest('[data-slot="dialog-content"]') || target.closest('[data-slot="dialog-overlay"]')
|
|
8620
8879
|
);
|
|
8621
8880
|
}
|
|
8622
8881
|
function getHrefKeyFromElement(el) {
|
|
@@ -9028,7 +9287,7 @@ function EditGlowChrome({
|
|
|
9028
9287
|
zIndex: 2147483646
|
|
9029
9288
|
},
|
|
9030
9289
|
children: [
|
|
9031
|
-
/* @__PURE__ */
|
|
9290
|
+
/* @__PURE__ */ jsx27(
|
|
9032
9291
|
"div",
|
|
9033
9292
|
{
|
|
9034
9293
|
style: {
|
|
@@ -9041,7 +9300,7 @@ function EditGlowChrome({
|
|
|
9041
9300
|
}
|
|
9042
9301
|
}
|
|
9043
9302
|
),
|
|
9044
|
-
reorderHrefKey && !hideHandle && /* @__PURE__ */
|
|
9303
|
+
reorderHrefKey && !hideHandle && /* @__PURE__ */ jsx27(
|
|
9045
9304
|
"div",
|
|
9046
9305
|
{
|
|
9047
9306
|
"data-ohw-drag-handle-container": "",
|
|
@@ -9053,7 +9312,7 @@ function EditGlowChrome({
|
|
|
9053
9312
|
transform: "translate(calc(-100% - 7px), -50%)",
|
|
9054
9313
|
pointerEvents: dragDisabled ? "none" : "auto"
|
|
9055
9314
|
},
|
|
9056
|
-
children: /* @__PURE__ */
|
|
9315
|
+
children: /* @__PURE__ */ jsx27(
|
|
9057
9316
|
DragHandle,
|
|
9058
9317
|
{
|
|
9059
9318
|
"aria-label": `Reorder ${reorderHrefKey}`,
|
|
@@ -9263,7 +9522,7 @@ function FloatingToolbar({
|
|
|
9263
9522
|
return () => ro.disconnect();
|
|
9264
9523
|
}, [showEditLink, activeCommands]);
|
|
9265
9524
|
const { top, left, transform } = calcToolbarPos(rect, parentScroll, measuredW);
|
|
9266
|
-
return /* @__PURE__ */
|
|
9525
|
+
return /* @__PURE__ */ jsx27(
|
|
9267
9526
|
"div",
|
|
9268
9527
|
{
|
|
9269
9528
|
ref: setRefs,
|
|
@@ -9277,10 +9536,10 @@ function FloatingToolbar({
|
|
|
9277
9536
|
},
|
|
9278
9537
|
children: /* @__PURE__ */ jsxs15(CustomToolbar, { children: [
|
|
9279
9538
|
TOOLBAR_GROUPS.map((btns, gi) => /* @__PURE__ */ jsxs15(React11.Fragment, { children: [
|
|
9280
|
-
gi > 0 && /* @__PURE__ */
|
|
9539
|
+
gi > 0 && /* @__PURE__ */ jsx27(CustomToolbarDivider, {}),
|
|
9281
9540
|
btns.map((btn) => {
|
|
9282
9541
|
const isActive = activeCommands.has(btn.cmd);
|
|
9283
|
-
return /* @__PURE__ */
|
|
9542
|
+
return /* @__PURE__ */ jsx27(
|
|
9284
9543
|
CustomToolbarButton,
|
|
9285
9544
|
{
|
|
9286
9545
|
title: btn.title,
|
|
@@ -9289,7 +9548,7 @@ function FloatingToolbar({
|
|
|
9289
9548
|
e.preventDefault();
|
|
9290
9549
|
onCommand(btn.cmd);
|
|
9291
9550
|
},
|
|
9292
|
-
children: /* @__PURE__ */
|
|
9551
|
+
children: /* @__PURE__ */ jsx27(
|
|
9293
9552
|
"svg",
|
|
9294
9553
|
{
|
|
9295
9554
|
width: "16",
|
|
@@ -9310,7 +9569,7 @@ function FloatingToolbar({
|
|
|
9310
9569
|
);
|
|
9311
9570
|
})
|
|
9312
9571
|
] }, gi)),
|
|
9313
|
-
showEditLink ? /* @__PURE__ */
|
|
9572
|
+
showEditLink ? /* @__PURE__ */ jsx27(
|
|
9314
9573
|
CustomToolbarButton,
|
|
9315
9574
|
{
|
|
9316
9575
|
type: "button",
|
|
@@ -9324,7 +9583,7 @@ function FloatingToolbar({
|
|
|
9324
9583
|
e.preventDefault();
|
|
9325
9584
|
e.stopPropagation();
|
|
9326
9585
|
},
|
|
9327
|
-
children: /* @__PURE__ */
|
|
9586
|
+
children: /* @__PURE__ */ jsx27(Link2, { className: "size-4 shrink-0", "aria-hidden": true })
|
|
9328
9587
|
}
|
|
9329
9588
|
) : null
|
|
9330
9589
|
] })
|
|
@@ -9341,7 +9600,7 @@ function StateToggle({
|
|
|
9341
9600
|
states,
|
|
9342
9601
|
onStateChange
|
|
9343
9602
|
}) {
|
|
9344
|
-
return /* @__PURE__ */
|
|
9603
|
+
return /* @__PURE__ */ jsx27(
|
|
9345
9604
|
ToggleGroup,
|
|
9346
9605
|
{
|
|
9347
9606
|
"data-ohw-state-toggle": "",
|
|
@@ -9355,7 +9614,7 @@ function StateToggle({
|
|
|
9355
9614
|
left: rect.right - 8,
|
|
9356
9615
|
transform: "translateX(-100%)"
|
|
9357
9616
|
},
|
|
9358
|
-
children: states.map((state) => /* @__PURE__ */
|
|
9617
|
+
children: states.map((state) => /* @__PURE__ */ jsx27(ToggleGroupItem, { value: state, size: "sm", children: state }, state))
|
|
9359
9618
|
}
|
|
9360
9619
|
);
|
|
9361
9620
|
}
|
|
@@ -9382,7 +9641,7 @@ function OhhwellsBridge() {
|
|
|
9382
9641
|
const router = useRouter2();
|
|
9383
9642
|
const searchParams = useSearchParams();
|
|
9384
9643
|
const isEditMode = isEditSessionActive();
|
|
9385
|
-
const [bridgeRoot, setBridgeRoot] =
|
|
9644
|
+
const [bridgeRoot, setBridgeRoot] = useState9(null);
|
|
9386
9645
|
useEffect9(() => {
|
|
9387
9646
|
const figtreeFontId = "ohw-figtree-font";
|
|
9388
9647
|
if (!document.getElementById(figtreeFontId)) {
|
|
@@ -9416,7 +9675,7 @@ function OhhwellsBridge() {
|
|
|
9416
9675
|
window.parent.postMessage(data, "*");
|
|
9417
9676
|
}
|
|
9418
9677
|
}, []);
|
|
9419
|
-
const [fetchState, setFetchState] =
|
|
9678
|
+
const [fetchState, setFetchState] = useState9("idle");
|
|
9420
9679
|
const autoSaveTimers = useRef7(/* @__PURE__ */ new Map());
|
|
9421
9680
|
const activeElRef = useRef7(null);
|
|
9422
9681
|
const pointerHeldRef = useRef7(false);
|
|
@@ -9427,7 +9686,7 @@ function OhhwellsBridge() {
|
|
|
9427
9686
|
const activeStateElRef = useRef7(null);
|
|
9428
9687
|
const parentScrollRef = useRef7(null);
|
|
9429
9688
|
const visibleViewportRef = useRef7(null);
|
|
9430
|
-
const [dialogPortalContainer, setDialogPortalContainer] =
|
|
9689
|
+
const [dialogPortalContainer, setDialogPortalContainer] = useState9(null);
|
|
9431
9690
|
const attachVisibleViewport = useCallback5((node) => {
|
|
9432
9691
|
visibleViewportRef.current = node;
|
|
9433
9692
|
setDialogPortalContainer(node);
|
|
@@ -9438,9 +9697,9 @@ function OhhwellsBridge() {
|
|
|
9438
9697
|
const hoveredImageRef = useRef7(null);
|
|
9439
9698
|
const hoveredImageHasTextOverlapRef = useRef7(false);
|
|
9440
9699
|
const dragOverElRef = useRef7(null);
|
|
9441
|
-
const [mediaHover, setMediaHover] =
|
|
9442
|
-
const [carouselHover, setCarouselHover] =
|
|
9443
|
-
const [uploadingRects, setUploadingRects] =
|
|
9700
|
+
const [mediaHover, setMediaHover] = useState9(null);
|
|
9701
|
+
const [carouselHover, setCarouselHover] = useState9(null);
|
|
9702
|
+
const [uploadingRects, setUploadingRects] = useState9({});
|
|
9444
9703
|
const hoveredGapRef = useRef7(null);
|
|
9445
9704
|
const imageUnhoverTimerRef = useRef7(null);
|
|
9446
9705
|
const imageShowTimerRef = useRef7(null);
|
|
@@ -9465,40 +9724,40 @@ function OhhwellsBridge() {
|
|
|
9465
9724
|
postToParentRef.current = postToParent2;
|
|
9466
9725
|
const sectionsLoadedRef = useRef7(false);
|
|
9467
9726
|
const pendingScheduleConfigRequests = useRef7([]);
|
|
9468
|
-
const [toolbarRect, setToolbarRect] =
|
|
9469
|
-
const [toolbarVariant, setToolbarVariant] =
|
|
9727
|
+
const [toolbarRect, setToolbarRect] = useState9(null);
|
|
9728
|
+
const [toolbarVariant, setToolbarVariant] = useState9("none");
|
|
9470
9729
|
const toolbarVariantRef = useRef7("none");
|
|
9471
9730
|
toolbarVariantRef.current = toolbarVariant;
|
|
9472
|
-
const [selectedIsCta, setSelectedIsCta] =
|
|
9473
|
-
const [reorderHrefKey, setReorderHrefKey] =
|
|
9474
|
-
const [reorderDragDisabled, setReorderDragDisabled] =
|
|
9475
|
-
const [toggleState, setToggleState] =
|
|
9476
|
-
const [maxBadge, setMaxBadge] =
|
|
9477
|
-
const [activeCommands, setActiveCommands] =
|
|
9478
|
-
const [sectionGap, setSectionGap] =
|
|
9479
|
-
const [toolbarShowEditLink, setToolbarShowEditLink] =
|
|
9731
|
+
const [selectedIsCta, setSelectedIsCta] = useState9(false);
|
|
9732
|
+
const [reorderHrefKey, setReorderHrefKey] = useState9(null);
|
|
9733
|
+
const [reorderDragDisabled, setReorderDragDisabled] = useState9(false);
|
|
9734
|
+
const [toggleState, setToggleState] = useState9(null);
|
|
9735
|
+
const [maxBadge, setMaxBadge] = useState9(null);
|
|
9736
|
+
const [activeCommands, setActiveCommands] = useState9(/* @__PURE__ */ new Set());
|
|
9737
|
+
const [sectionGap, setSectionGap] = useState9(null);
|
|
9738
|
+
const [toolbarShowEditLink, setToolbarShowEditLink] = useState9(false);
|
|
9480
9739
|
const hoveredNavContainerRef = useRef7(null);
|
|
9481
|
-
const [hoveredNavContainerRect, setHoveredNavContainerRect] =
|
|
9740
|
+
const [hoveredNavContainerRect, setHoveredNavContainerRect] = useState9(null);
|
|
9482
9741
|
const hoveredItemElRef = useRef7(null);
|
|
9483
|
-
const [hoveredItemRect, setHoveredItemRect] =
|
|
9742
|
+
const [hoveredItemRect, setHoveredItemRect] = useState9(null);
|
|
9484
9743
|
const siblingHintElRef = useRef7(null);
|
|
9485
|
-
const [siblingHintRect, setSiblingHintRect] =
|
|
9486
|
-
const [siblingHintRects, setSiblingHintRects] =
|
|
9487
|
-
const [isItemDragging, setIsItemDragging] =
|
|
9488
|
-
const [isFooterFrameSelection, setIsFooterFrameSelection] =
|
|
9744
|
+
const [siblingHintRect, setSiblingHintRect] = useState9(null);
|
|
9745
|
+
const [siblingHintRects, setSiblingHintRects] = useState9([]);
|
|
9746
|
+
const [isItemDragging, setIsItemDragging] = useState9(false);
|
|
9747
|
+
const [isFooterFrameSelection, setIsFooterFrameSelection] = useState9(false);
|
|
9489
9748
|
const footerDragRef = useRef7(null);
|
|
9490
|
-
const [footerDropSlots, setFooterDropSlots] =
|
|
9491
|
-
const [activeFooterDropIndex, setActiveFooterDropIndex] =
|
|
9492
|
-
const [draggedItemRect, setDraggedItemRect] =
|
|
9749
|
+
const [footerDropSlots, setFooterDropSlots] = useState9([]);
|
|
9750
|
+
const [activeFooterDropIndex, setActiveFooterDropIndex] = useState9(null);
|
|
9751
|
+
const [draggedItemRect, setDraggedItemRect] = useState9(null);
|
|
9493
9752
|
const footerPointerDragRef = useRef7(null);
|
|
9494
9753
|
const suppressNextClickRef = useRef7(false);
|
|
9495
9754
|
const suppressClickUntilRef = useRef7(0);
|
|
9496
|
-
const [linkPopover, setLinkPopover] =
|
|
9755
|
+
const [linkPopover, setLinkPopover] = useState9(null);
|
|
9497
9756
|
const linkPopoverSessionRef = useRef7(null);
|
|
9498
9757
|
const addNavAfterAnchorRef = useRef7(null);
|
|
9499
9758
|
const editContentRef = useRef7({});
|
|
9500
|
-
const [sitePages, setSitePages] =
|
|
9501
|
-
const [sectionsByPath, setSectionsByPath] =
|
|
9759
|
+
const [sitePages, setSitePages] = useState9([]);
|
|
9760
|
+
const [sectionsByPath, setSectionsByPath] = useState9({});
|
|
9502
9761
|
const sectionsPrefetchGenRef = useRef7(0);
|
|
9503
9762
|
const setLinkPopoverRef = useRef7(setLinkPopover);
|
|
9504
9763
|
const linkPopoverPanelRef = useRef7(null);
|
|
@@ -10721,7 +10980,7 @@ function OhhwellsBridge() {
|
|
|
10721
10980
|
setLinkPopoverRef.current({
|
|
10722
10981
|
key: editable.dataset.ohwKey ?? "",
|
|
10723
10982
|
mode: "edit",
|
|
10724
|
-
target:
|
|
10983
|
+
target: getLinkHref3(editable)
|
|
10725
10984
|
});
|
|
10726
10985
|
return;
|
|
10727
10986
|
}
|
|
@@ -11193,6 +11452,13 @@ function OhhwellsBridge() {
|
|
|
11193
11452
|
probeNavigationHoverAt(x, y);
|
|
11194
11453
|
return;
|
|
11195
11454
|
}
|
|
11455
|
+
const overMoreMenu = document.elementFromPoint(x, y)?.closest?.(
|
|
11456
|
+
'[data-ohw-more-menu], [data-slot="dropdown-menu-content"], [data-slot="dropdown-menu-item"]'
|
|
11457
|
+
);
|
|
11458
|
+
if (overMoreMenu) {
|
|
11459
|
+
dismissImageHover();
|
|
11460
|
+
return;
|
|
11461
|
+
}
|
|
11196
11462
|
hoveredNavContainerRef.current = null;
|
|
11197
11463
|
setHoveredNavContainerRect(null);
|
|
11198
11464
|
if (hoveredItemElRef.current?.hasAttribute("data-ohw-footer-col") || hoveredItemElRef.current?.hasAttribute("data-ohw-footer-column")) {
|
|
@@ -11239,7 +11505,7 @@ function OhhwellsBridge() {
|
|
|
11239
11505
|
return;
|
|
11240
11506
|
}
|
|
11241
11507
|
const topEl = document.elementFromPoint(x2, y2);
|
|
11242
|
-
if (topEl?.closest('[data-ohw-toolbar], [data-ohw-edit-chrome], [data-ohw-item-interaction], [data-ohw-drag-handle-container], [data-slot="drag-handle"]')) {
|
|
11508
|
+
if (topEl?.closest('[data-ohw-toolbar], [data-ohw-edit-chrome], [data-ohw-item-interaction], [data-ohw-drag-handle-container], [data-slot="drag-handle"], [data-ohw-more-menu], [data-slot="dropdown-menu-content"], [data-slot="dropdown-menu-item"]')) {
|
|
11243
11509
|
if (hoveredImageRef.current) {
|
|
11244
11510
|
hoveredImageRef.current = null;
|
|
11245
11511
|
resumeAnimTracks();
|
|
@@ -11683,6 +11949,7 @@ function OhhwellsBridge() {
|
|
|
11683
11949
|
window.addEventListener("message", handleDeactivate);
|
|
11684
11950
|
const handleUiEscape = (e) => {
|
|
11685
11951
|
if (e.data?.type !== "ui:escape") return;
|
|
11952
|
+
if (document.querySelector("[data-ohw-more-menu]")) return;
|
|
11686
11953
|
if (linkPopoverOpenRef.current) {
|
|
11687
11954
|
setLinkPopoverRef.current(null);
|
|
11688
11955
|
return;
|
|
@@ -11737,6 +12004,7 @@ function OhhwellsBridge() {
|
|
|
11737
12004
|
window.addEventListener("message", handleUiEscape);
|
|
11738
12005
|
const handleKeyDown = (e) => {
|
|
11739
12006
|
if (e.key === "Escape" && document.querySelector("[data-ohw-section-picker]")) return;
|
|
12007
|
+
if (e.key === "Escape" && document.querySelector("[data-ohw-more-menu]")) return;
|
|
11740
12008
|
if ((e.ctrlKey || e.metaKey) && e.key.toLowerCase() === "a" && activeElRef.current) {
|
|
11741
12009
|
e.preventDefault();
|
|
11742
12010
|
selectAllTextInEditable(activeElRef.current);
|
|
@@ -12475,7 +12743,7 @@ function OhhwellsBridge() {
|
|
|
12475
12743
|
setLinkPopover({
|
|
12476
12744
|
key: hrefCtx.key,
|
|
12477
12745
|
mode: "edit",
|
|
12478
|
-
target:
|
|
12746
|
+
target: getLinkHref3(hrefCtx.anchor)
|
|
12479
12747
|
});
|
|
12480
12748
|
deactivate();
|
|
12481
12749
|
}, [deactivate]);
|
|
@@ -12488,10 +12756,107 @@ function OhhwellsBridge() {
|
|
|
12488
12756
|
setLinkPopover({
|
|
12489
12757
|
key,
|
|
12490
12758
|
mode: "edit",
|
|
12491
|
-
target:
|
|
12759
|
+
target: getLinkHref3(anchor)
|
|
12492
12760
|
});
|
|
12493
12761
|
deselect();
|
|
12494
12762
|
}, [deselect]);
|
|
12763
|
+
const handleSelectParent = useCallback5(() => {
|
|
12764
|
+
const selected = selectedElRef.current;
|
|
12765
|
+
if (!selected) return;
|
|
12766
|
+
if (toolbarVariantRef.current === "select-frame") {
|
|
12767
|
+
deselectRef.current();
|
|
12768
|
+
return;
|
|
12769
|
+
}
|
|
12770
|
+
const parent = getNavigationSelectionParent(selected);
|
|
12771
|
+
if (parent && isNavigationContainer(parent)) {
|
|
12772
|
+
selectFrameRef.current(parent);
|
|
12773
|
+
} else {
|
|
12774
|
+
deselectRef.current();
|
|
12775
|
+
}
|
|
12776
|
+
}, []);
|
|
12777
|
+
const handleDuplicateSelected = useCallback5(() => {
|
|
12778
|
+
const selected = selectedElRef.current;
|
|
12779
|
+
if (!selected || !isNavigationItem(selected)) return;
|
|
12780
|
+
const hrefKey = selected.getAttribute("data-ohw-href-key");
|
|
12781
|
+
if (!hrefKey) return;
|
|
12782
|
+
if (isNavbarHrefKey(hrefKey)) {
|
|
12783
|
+
const result = duplicateNavbarItem(selected);
|
|
12784
|
+
if (!result) return;
|
|
12785
|
+
applyLinkByKey(result.hrefKey, result.href);
|
|
12786
|
+
document.querySelectorAll(`[data-ohw-key="${result.labelKey}"]`).forEach((el) => {
|
|
12787
|
+
el.textContent = result.label;
|
|
12788
|
+
});
|
|
12789
|
+
const nodes = [
|
|
12790
|
+
{ key: result.hrefKey, text: result.href },
|
|
12791
|
+
{ key: result.labelKey, text: result.label }
|
|
12792
|
+
];
|
|
12793
|
+
for (const child of result.childResults) {
|
|
12794
|
+
applyLinkByKey(child.hrefKey, child.href);
|
|
12795
|
+
document.querySelectorAll(`[data-ohw-key="${child.labelKey}"]`).forEach((el) => {
|
|
12796
|
+
el.textContent = child.label;
|
|
12797
|
+
});
|
|
12798
|
+
nodes.push(
|
|
12799
|
+
{ key: child.hrefKey, text: child.href },
|
|
12800
|
+
{ key: child.labelKey, text: child.label }
|
|
12801
|
+
);
|
|
12802
|
+
}
|
|
12803
|
+
const maxIndex = Math.max(
|
|
12804
|
+
result.index,
|
|
12805
|
+
...result.childResults.map((c) => c.index)
|
|
12806
|
+
);
|
|
12807
|
+
const navCount = String(maxIndex + 1);
|
|
12808
|
+
nodes.push(
|
|
12809
|
+
{ key: NAV_COUNT_KEY, text: navCount },
|
|
12810
|
+
{ key: NAV_ORDER_KEY, text: result.orderJson }
|
|
12811
|
+
);
|
|
12812
|
+
editContentRef.current = {
|
|
12813
|
+
...editContentRef.current,
|
|
12814
|
+
[result.hrefKey]: result.href,
|
|
12815
|
+
[result.labelKey]: result.label,
|
|
12816
|
+
...Object.fromEntries(
|
|
12817
|
+
result.childResults.flatMap((c) => [
|
|
12818
|
+
[c.hrefKey, c.href],
|
|
12819
|
+
[c.labelKey, c.label]
|
|
12820
|
+
])
|
|
12821
|
+
),
|
|
12822
|
+
[NAV_COUNT_KEY]: navCount,
|
|
12823
|
+
[NAV_ORDER_KEY]: result.orderJson
|
|
12824
|
+
};
|
|
12825
|
+
postToParent2({ type: "ow:change", nodes });
|
|
12826
|
+
enforceLinkHrefs();
|
|
12827
|
+
requestAnimationFrame(() => {
|
|
12828
|
+
selectRef.current(result.anchor);
|
|
12829
|
+
});
|
|
12830
|
+
return;
|
|
12831
|
+
}
|
|
12832
|
+
if (isFooterHrefKey(hrefKey)) {
|
|
12833
|
+
const result = duplicateFooterItem(selected);
|
|
12834
|
+
if (!result) return;
|
|
12835
|
+
applyLinkByKey(result.hrefKey, result.href);
|
|
12836
|
+
document.querySelectorAll(`[data-ohw-key="${result.labelKey}"]`).forEach((el) => {
|
|
12837
|
+
el.textContent = result.label;
|
|
12838
|
+
});
|
|
12839
|
+
const orderJson = JSON.stringify(result.order);
|
|
12840
|
+
editContentRef.current = {
|
|
12841
|
+
...editContentRef.current,
|
|
12842
|
+
[result.hrefKey]: result.href,
|
|
12843
|
+
[result.labelKey]: result.label,
|
|
12844
|
+
[FOOTER_ORDER_KEY]: orderJson
|
|
12845
|
+
};
|
|
12846
|
+
postToParent2({
|
|
12847
|
+
type: "ow:change",
|
|
12848
|
+
nodes: [
|
|
12849
|
+
{ key: result.hrefKey, text: result.href },
|
|
12850
|
+
{ key: result.labelKey, text: result.label },
|
|
12851
|
+
{ key: FOOTER_ORDER_KEY, text: orderJson }
|
|
12852
|
+
]
|
|
12853
|
+
});
|
|
12854
|
+
enforceLinkHrefs();
|
|
12855
|
+
requestAnimationFrame(() => {
|
|
12856
|
+
selectRef.current(result.anchor);
|
|
12857
|
+
});
|
|
12858
|
+
}
|
|
12859
|
+
}, [postToParent2]);
|
|
12495
12860
|
const handleLinkPopoverSubmit = useCallback5(
|
|
12496
12861
|
(target) => {
|
|
12497
12862
|
const session = linkPopoverSessionRef.current;
|
|
@@ -12595,8 +12960,8 @@ function OhhwellsBridge() {
|
|
|
12595
12960
|
);
|
|
12596
12961
|
return bridgeRoot ? createPortal2(
|
|
12597
12962
|
/* @__PURE__ */ jsxs15(Fragment5, { children: [
|
|
12598
|
-
/* @__PURE__ */
|
|
12599
|
-
Object.entries(uploadingRects).map(([key, { rect, fadingOut }]) => /* @__PURE__ */
|
|
12963
|
+
/* @__PURE__ */ jsx27("div", { ref: attachVisibleViewport, "data-ohw-visible-viewport": "", "aria-hidden": true }),
|
|
12964
|
+
Object.entries(uploadingRects).map(([key, { rect, fadingOut }]) => /* @__PURE__ */ jsx27(
|
|
12600
12965
|
MediaOverlay,
|
|
12601
12966
|
{
|
|
12602
12967
|
hover: { key, rect, elementType: "image", isDragOver: false, hasTextOverlap: false },
|
|
@@ -12607,7 +12972,7 @@ function OhhwellsBridge() {
|
|
|
12607
12972
|
},
|
|
12608
12973
|
`uploading-${key}`
|
|
12609
12974
|
)),
|
|
12610
|
-
mediaHover && !(mediaHover.key in uploadingRects) && /* @__PURE__ */
|
|
12975
|
+
mediaHover && !(mediaHover.key in uploadingRects) && /* @__PURE__ */ jsx27(
|
|
12611
12976
|
MediaOverlay,
|
|
12612
12977
|
{
|
|
12613
12978
|
hover: mediaHover,
|
|
@@ -12616,11 +12981,11 @@ function OhhwellsBridge() {
|
|
|
12616
12981
|
onVideoSettingsChange: handleVideoSettingsChange
|
|
12617
12982
|
}
|
|
12618
12983
|
),
|
|
12619
|
-
carouselHover && !linkPopover && !isItemDragging && /* @__PURE__ */
|
|
12620
|
-
siblingHintRect && !linkPopover && !isItemDragging && siblingHintRects.length === 0 && /* @__PURE__ */
|
|
12621
|
-
siblingHintRects.length > 0 && !linkPopover && !isItemDragging && siblingHintRects.map((rect, i) => /* @__PURE__ */
|
|
12622
|
-
isItemDragging && draggedItemRect && selectedElRef.current !== footerDragRef.current?.draggedEl && selectedElRef.current !== navDragRef.current?.draggedEl && /* @__PURE__ */
|
|
12623
|
-
isItemDragging && footerDropSlots.map((slot, i) => /* @__PURE__ */
|
|
12984
|
+
carouselHover && !linkPopover && !isItemDragging && /* @__PURE__ */ jsx27(CarouselOverlay, { hover: carouselHover, onEdit: handleEditCarousel }),
|
|
12985
|
+
siblingHintRect && !linkPopover && !isItemDragging && siblingHintRects.length === 0 && /* @__PURE__ */ jsx27(ItemInteractionLayer, { rect: siblingHintRect, state: "sibling-hint" }),
|
|
12986
|
+
siblingHintRects.length > 0 && !linkPopover && !isItemDragging && siblingHintRects.map((rect, i) => /* @__PURE__ */ jsx27(ItemInteractionLayer, { rect, state: "sibling-hint" }, `sibling-hint-${i}`)),
|
|
12987
|
+
isItemDragging && draggedItemRect && selectedElRef.current !== footerDragRef.current?.draggedEl && selectedElRef.current !== navDragRef.current?.draggedEl && /* @__PURE__ */ jsx27(ItemInteractionLayer, { rect: draggedItemRect, state: "dragging" }),
|
|
12988
|
+
isItemDragging && footerDropSlots.map((slot, i) => /* @__PURE__ */ jsx27(
|
|
12624
12989
|
"div",
|
|
12625
12990
|
{
|
|
12626
12991
|
className: "pointer-events-none fixed z-2147483646",
|
|
@@ -12630,7 +12995,7 @@ function OhhwellsBridge() {
|
|
|
12630
12995
|
width: slot.width,
|
|
12631
12996
|
height: slot.height
|
|
12632
12997
|
},
|
|
12633
|
-
children: /* @__PURE__ */
|
|
12998
|
+
children: /* @__PURE__ */ jsx27(
|
|
12634
12999
|
DropIndicator,
|
|
12635
13000
|
{
|
|
12636
13001
|
direction: slot.direction,
|
|
@@ -12641,7 +13006,7 @@ function OhhwellsBridge() {
|
|
|
12641
13006
|
},
|
|
12642
13007
|
`footer-drop-${slot.direction}-${slot.columnIndex}-${slot.insertIndex}-${i}`
|
|
12643
13008
|
)),
|
|
12644
|
-
isItemDragging && navDropSlots.map((slot, i) => /* @__PURE__ */
|
|
13009
|
+
isItemDragging && navDropSlots.map((slot, i) => /* @__PURE__ */ jsx27(
|
|
12645
13010
|
"div",
|
|
12646
13011
|
{
|
|
12647
13012
|
className: "pointer-events-none fixed z-2147483646",
|
|
@@ -12651,7 +13016,7 @@ function OhhwellsBridge() {
|
|
|
12651
13016
|
width: slot.width,
|
|
12652
13017
|
height: slot.height
|
|
12653
13018
|
},
|
|
12654
|
-
children: /* @__PURE__ */
|
|
13019
|
+
children: /* @__PURE__ */ jsx27(
|
|
12655
13020
|
DropIndicator,
|
|
12656
13021
|
{
|
|
12657
13022
|
direction: slot.direction,
|
|
@@ -12662,11 +13027,11 @@ function OhhwellsBridge() {
|
|
|
12662
13027
|
},
|
|
12663
13028
|
`nav-drop-${slot.direction}-${slot.parentId ?? "root"}-${slot.insertIndex}-${i}`
|
|
12664
13029
|
)),
|
|
12665
|
-
hoveredNavContainerRect && (toolbarVariant !== "select-frame" || isFooterFrameSelection) && !linkPopover && !isItemDragging && /* @__PURE__ */
|
|
12666
|
-
hoveredItemRect && !linkPopover && !hoveredNavContainerRect && !isItemDragging && hoveredItemElRef.current !== selectedElRef.current && /* @__PURE__ */
|
|
12667
|
-
toolbarVariant === "select-frame" && toolbarRect && !linkPopover && !isItemDragging && !isFooterFrameSelection && selectedElRef.current && isNavbarLinksContainer(selectedElRef.current) && /* @__PURE__ */
|
|
12668
|
-
toolbarVariant === "select-frame" && toolbarRect && !linkPopover && !isItemDragging && !isFooterFrameSelection && selectedElRef.current && isFooterLinksContainer(selectedElRef.current) && /* @__PURE__ */
|
|
12669
|
-
toolbarRect && !linkPopover && (toolbarVariant === "link-action" || toolbarVariant === "select-frame") && /* @__PURE__ */
|
|
13030
|
+
hoveredNavContainerRect && (toolbarVariant !== "select-frame" || isFooterFrameSelection) && !linkPopover && !isItemDragging && /* @__PURE__ */ jsx27(ItemInteractionLayer, { rect: hoveredNavContainerRect, state: "hover" }),
|
|
13031
|
+
hoveredItemRect && !linkPopover && !hoveredNavContainerRect && !isItemDragging && hoveredItemElRef.current !== selectedElRef.current && /* @__PURE__ */ jsx27(ItemInteractionLayer, { rect: hoveredItemRect, state: "hover" }),
|
|
13032
|
+
toolbarVariant === "select-frame" && toolbarRect && !linkPopover && !isItemDragging && !isFooterFrameSelection && selectedElRef.current && isNavbarLinksContainer(selectedElRef.current) && /* @__PURE__ */ jsx27(NavbarContainerChrome, { rect: toolbarRect, onAdd: handleAddTopLevelNavItem }),
|
|
13033
|
+
toolbarVariant === "select-frame" && toolbarRect && !linkPopover && !isItemDragging && !isFooterFrameSelection && selectedElRef.current && isFooterLinksContainer(selectedElRef.current) && /* @__PURE__ */ jsx27(FooterContainerChrome, { rect: toolbarRect, onAdd: handleAddFooterColumn }),
|
|
13034
|
+
toolbarRect && !linkPopover && (toolbarVariant === "link-action" || toolbarVariant === "select-frame") && /* @__PURE__ */ jsx27(
|
|
12670
13035
|
ItemInteractionLayer,
|
|
12671
13036
|
{
|
|
12672
13037
|
rect: isItemDragging && draggedItemRect && (footerDragRef.current?.wasSelected || navDragRef.current?.wasSelected) ? draggedItemRect : toolbarRect,
|
|
@@ -12680,13 +13045,15 @@ function OhhwellsBridge() {
|
|
|
12680
13045
|
onItemPointerDown: handleItemChromePointerDown,
|
|
12681
13046
|
onItemClick: handleItemChromeClick,
|
|
12682
13047
|
itemDragSurface: !isFooterFrameSelection,
|
|
12683
|
-
toolbar: toolbarVariant === "link-action" && !isItemDragging ? /* @__PURE__ */
|
|
13048
|
+
toolbar: toolbarVariant === "link-action" && !isItemDragging ? /* @__PURE__ */ jsx27(
|
|
12684
13049
|
ItemActionToolbar,
|
|
12685
13050
|
{
|
|
12686
13051
|
onEditLink: openLinkPopoverForSelected,
|
|
13052
|
+
onSelectParent: handleSelectParent,
|
|
13053
|
+
onDuplicate: handleDuplicateSelected,
|
|
12687
13054
|
addItemDisabled: true,
|
|
12688
13055
|
editLinkDisabled: false,
|
|
12689
|
-
moreDisabled:
|
|
13056
|
+
moreDisabled: false,
|
|
12690
13057
|
showAddItem: !selectedIsCta,
|
|
12691
13058
|
showMore: !selectedIsCta
|
|
12692
13059
|
}
|
|
@@ -12694,7 +13061,7 @@ function OhhwellsBridge() {
|
|
|
12694
13061
|
}
|
|
12695
13062
|
),
|
|
12696
13063
|
toolbarRect && toolbarVariant === "rich-text" && !linkPopover && /* @__PURE__ */ jsxs15(Fragment5, { children: [
|
|
12697
|
-
/* @__PURE__ */
|
|
13064
|
+
/* @__PURE__ */ jsx27(
|
|
12698
13065
|
EditGlowChrome,
|
|
12699
13066
|
{
|
|
12700
13067
|
rect: toolbarRect,
|
|
@@ -12704,7 +13071,7 @@ function OhhwellsBridge() {
|
|
|
12704
13071
|
hideHandle: isItemDragging
|
|
12705
13072
|
}
|
|
12706
13073
|
),
|
|
12707
|
-
/* @__PURE__ */
|
|
13074
|
+
/* @__PURE__ */ jsx27(
|
|
12708
13075
|
FloatingToolbar,
|
|
12709
13076
|
{
|
|
12710
13077
|
rect: toolbarRect,
|
|
@@ -12743,7 +13110,7 @@ function OhhwellsBridge() {
|
|
|
12743
13110
|
]
|
|
12744
13111
|
}
|
|
12745
13112
|
),
|
|
12746
|
-
toggleState && !linkPopover && /* @__PURE__ */
|
|
13113
|
+
toggleState && !linkPopover && /* @__PURE__ */ jsx27(
|
|
12747
13114
|
StateToggle,
|
|
12748
13115
|
{
|
|
12749
13116
|
rect: toggleState.rect,
|
|
@@ -12759,8 +13126,8 @@ function OhhwellsBridge() {
|
|
|
12759
13126
|
className: "fixed left-0 w-full z-2147483646 flex items-center pointer-events-none",
|
|
12760
13127
|
style: { top: sectionGap.y, transform: "translateY(-50%)" },
|
|
12761
13128
|
children: [
|
|
12762
|
-
/* @__PURE__ */
|
|
12763
|
-
/* @__PURE__ */
|
|
13129
|
+
/* @__PURE__ */ jsx27("div", { className: "flex-1 bg-primary", style: { height: 3 } }),
|
|
13130
|
+
/* @__PURE__ */ jsx27(
|
|
12764
13131
|
Badge,
|
|
12765
13132
|
{
|
|
12766
13133
|
className: "px-8 py-1 bg-primary hover:bg-primary text-primary-foreground text-xs font-medium shrink-0 rounded-full cursor-pointer pointer-events-auto",
|
|
@@ -12777,11 +13144,11 @@ function OhhwellsBridge() {
|
|
|
12777
13144
|
children: "Add Section"
|
|
12778
13145
|
}
|
|
12779
13146
|
),
|
|
12780
|
-
/* @__PURE__ */
|
|
13147
|
+
/* @__PURE__ */ jsx27("div", { className: "flex-1 bg-primary", style: { height: 3 } })
|
|
12781
13148
|
]
|
|
12782
13149
|
}
|
|
12783
13150
|
),
|
|
12784
|
-
linkPopover && dialogPortalContainer ? /* @__PURE__ */
|
|
13151
|
+
linkPopover && dialogPortalContainer ? /* @__PURE__ */ jsx27(
|
|
12785
13152
|
LinkPopover,
|
|
12786
13153
|
{
|
|
12787
13154
|
panelRef: linkPopoverPanelRef,
|
|
@@ -12808,6 +13175,12 @@ export {
|
|
|
12808
13175
|
CustomToolbarDivider,
|
|
12809
13176
|
DragHandle,
|
|
12810
13177
|
DropIndicator,
|
|
13178
|
+
DropdownMenu,
|
|
13179
|
+
DropdownMenuContent,
|
|
13180
|
+
DropdownMenuGroup,
|
|
13181
|
+
DropdownMenuItem,
|
|
13182
|
+
DropdownMenuSeparator,
|
|
13183
|
+
DropdownMenuTrigger,
|
|
12811
13184
|
ItemActionToolbar,
|
|
12812
13185
|
ItemInteractionLayer,
|
|
12813
13186
|
LinkEditorPanel,
|