@pagehub/sdk 0.1.5 → 0.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/chrome/viewport/Viewport/hooks/usePageLoadIndicator.d.ts +2 -2
- package/dist/chrome/viewport/design-system/hooks/useDesignSystem.d.ts +2 -2
- package/dist/chrome/viewport/design-system/hooks/usePaletteState.d.ts +2 -2
- package/dist/chunks/ActionEditorPanel-9v50QUwu.js +89 -0
- package/dist/chunks/ActionInput-CTt7sOs6.js +929 -0
- package/dist/chunks/ActionsAddPicker-BeTPUUor.js +51 -0
- package/dist/chunks/ActionsInput-D0h-zLYj.js +174 -0
- package/dist/chunks/AnchoredPopover-CckPTxXu.js +2676 -0
- package/dist/chunks/AnimationEditorPanel-CXNmsTqV.js +26 -0
- package/dist/chunks/AnimationsInput-Djyz0uXG.js +292 -0
- package/dist/chunks/AnimationsInputPopover-B2-oNebx.js +71 -0
- package/dist/chunks/AnimationsPanel-DungA9qb.js +25 -0
- package/dist/chunks/Audio.render-CsR69fZ9.js +22 -0
- package/dist/chunks/AudioMainTab-BljM2NMQ.js +70 -0
- package/dist/chunks/BackdropEditorPanel-CA2k-6SR.js +26 -0
- package/dist/chunks/BackgroundImageInputPopover-vB_217Ig.js +94 -0
- package/dist/chunks/BackgroundImagePanel-BvMhF9eU.js +100 -0
- package/dist/chunks/BackgroundMainTab-CI4c5DEF.js +10 -0
- package/dist/chunks/BundleRowPanel-BcYfyfGQ.js +33 -0
- package/dist/chunks/ButtonMainTab-Civy_DoA.js +43 -0
- package/dist/chunks/CSSEditorInput-C1ITwAh3.js +73 -0
- package/dist/chunks/ClassNameInput-Ce0fGQES.js +720 -0
- package/dist/chunks/CodeEditor-axBXmPH8.js +33370 -0
- package/dist/chunks/ColorInput-BSfMNt86.js +187 -0
- package/dist/chunks/ColorPanel-DOLrT-gS.js +562 -0
- package/dist/chunks/ComponentImportExportPanel-DVcnGhGx.js +161 -0
- package/dist/chunks/ComponentImportExportPopover-BY1_oxU8.js +26 -0
- package/dist/chunks/ConditionEditorPanel-DLbqYaSF.js +43 -0
- package/dist/chunks/ConditionsAddPicker-SsHJlc1E.js +54 -0
- package/dist/chunks/ConditionsInput-B_5Nge8o.js +474 -0
- package/dist/chunks/ContainerMainTab-kkktm1Ns.js +1107 -0
- package/dist/chunks/ContainerOverflowSectionPanel-ibKXf-1N.js +120 -0
- package/dist/chunks/ContainerOverflowSectionPopover-CRQ9EPsn.js +24 -0
- package/dist/chunks/ContainerPaddingOverlay-Cd3xOv-S.js +340 -0
- package/dist/chunks/ContainerScrollEffectSection-Dbztqdnr.js +123 -0
- package/dist/chunks/ContainerStateSection-DY_gjBJL.js +478 -0
- package/dist/chunks/ConversionFields-Bpfl-SGP.js +135 -0
- package/dist/chunks/CraftListEditor-_TIy1ogW.js +73 -0
- package/dist/chunks/CreateTokenDialog-DNWtWqJd.js +147 -0
- package/dist/chunks/Data.render-DTmaqSyz.js +10 -0
- package/dist/chunks/DataAttributesPanel-mYhisO_O.js +125 -0
- package/dist/chunks/DataMainTab-Batm515E.js +23 -0
- package/dist/chunks/DataSourceSectionSlot-BKoO6Vxn.js +10 -0
- package/dist/chunks/EditorEmptyLeafHintView-D3E3UN_0.js +78 -0
- package/dist/chunks/EffectRowInputPopover-CYhfjFwJ.js +323 -0
- package/dist/chunks/EffectsClassInput-Yujuchwy.js +315 -0
- package/dist/chunks/Embed.render-BgKpUV8n.js +17 -0
- package/dist/chunks/EmbedMainTab-d_-Bnkug.js +225 -0
- package/dist/chunks/FilterEditorPanel-CRa0IpLr.js +26 -0
- package/dist/chunks/FlexDirectionInput-C5gYjk5W.js +78 -0
- package/dist/chunks/FloatingPanel-DJP5Vhua.js +553 -0
- package/dist/chunks/FontFamilyInput-CVNnVylt.js +111 -0
- package/dist/chunks/Form.render-6GjcmL2u.js +54 -0
- package/dist/chunks/FormElement.render-DWrG-2ID.js +36 -0
- package/dist/chunks/FormElementMainTab-DSbF3F6e.js +470 -0
- package/dist/chunks/FormMainTab-SHny1HxF.js +240 -0
- package/dist/chunks/GradientInputPopover-1K6O9jBq.js +103 -0
- package/dist/chunks/GradientPanel-DSRQKkaB.js +194 -0
- package/dist/chunks/HTMLCodeInput-CCe4Bj5z.js +69 -0
- package/dist/chunks/HandlerEditorPanel-DiOXobsl.js +93 -0
- package/dist/chunks/HandlersAddPicker-DWTgjKgo.js +101 -0
- package/dist/chunks/HandlersInput-p49STTn8.js +132 -0
- package/dist/chunks/IconDialogInput-C-81_L2n.js +105 -0
- package/dist/chunks/IconInput-D2Gy7Hvf.js +182 -0
- package/dist/chunks/IconMainTab-CNrVjDWP.js +26 -0
- package/dist/chunks/IconPickerPanel-BjNOlCh6.js +670 -0
- package/dist/chunks/ImageMainTab-C4O7RjX0.js +66 -0
- package/dist/chunks/ImageSettingsPanel-dvOmGg3C.js +485 -0
- package/dist/chunks/LayoutPresetPanel-CNAVAcvw.js +81 -0
- package/dist/chunks/LayoutPresetSlot-BqMTdE33.js +16 -0
- package/dist/chunks/LinkMainTab-BfFZx0AU.js +13 -0
- package/dist/chunks/ListEditor-mD-CmRNE.js +178 -0
- package/dist/chunks/Map.render-DFkmncHz.js +82 -0
- package/dist/chunks/MapLeaflet-DOfmZ3Pk.js +6588 -0
- package/dist/chunks/MapMainTab-CxI7IS1_.js +165 -0
- package/dist/chunks/MapPoint.render-0OAfCZTp.js +16 -0
- package/dist/chunks/MapPointMainTab-CmLcaSR5.js +60 -0
- package/dist/chunks/MediaInput-DHs3D8TJ.js +672 -0
- package/dist/chunks/MediaManagerModal-Dc5PK3dn.js +240 -0
- package/dist/chunks/MiniPreviewTile-B4zxTj9Y.js +32 -0
- package/dist/chunks/ModifierChipList-CwsWklih.js +33 -0
- package/dist/chunks/ModifiersAddPicker-D-vSYw7O.js +74 -0
- package/dist/chunks/ModifiersPickerPanel-CTefidBx.js +243 -0
- package/dist/chunks/NodeAiContextInputPopover-D5bn5o_T.js +66 -0
- package/dist/chunks/NodeAiContextPanel-Bx4rcjiM.js +81 -0
- package/dist/chunks/NumberSettingsPanel-DASi_l6V.js +56 -0
- package/dist/chunks/PageSettingsModal-D6o450IR.js +2678 -0
- package/dist/chunks/PatternInputPopover-qMWBv_nl.js +100 -0
- package/dist/chunks/PatternPanel-D2fgWDd-.js +352 -0
- package/dist/chunks/PeekTargetButton-ClrJX7zh.js +26 -0
- package/dist/chunks/PermissionsSection-DwobrV40.js +82 -0
- package/dist/chunks/PresetAddChildList-D6a0xdt8.js +35 -0
- package/dist/chunks/PropertiesInput-9O39ngbb.js +125 -0
- package/dist/chunks/PropertiesPanel-DO0RlalO.js +76 -0
- package/dist/chunks/SaveModifierPanel-B6mjKyrT.js +130 -0
- package/dist/chunks/ScrollEffectEditorPanel-CllGUhui.js +26 -0
- package/dist/chunks/SearchInput-DRUztbM0.js +76 -0
- package/dist/chunks/SearchableMenuPopover-DZKVXiEl.js +1251 -0
- package/dist/chunks/SlotRenderer-CaLf_2_C.js +38 -0
- package/dist/chunks/StateBindingEditorPanel-DKdcG5py.js +101 -0
- package/dist/chunks/StateBindingsAddPicker-DxMNAWAD.js +91 -0
- package/dist/chunks/StateBindingsInput-iWiqvAVB.js +103 -0
- package/dist/chunks/TailwindInput-660FZtyK.js +24 -0
- package/dist/chunks/TextEditor-B2O7DlN8.js +22032 -0
- package/dist/chunks/TextMainTab-B5udsXsk.js +260 -0
- package/dist/chunks/TextStyleEditorPanel-GRNPGzUL.js +381 -0
- package/dist/chunks/TextStylePickerPanel-l108SmGQ.js +140 -0
- package/dist/chunks/TextareaSettingsPanel-C1rQuF1O.js +50 -0
- package/dist/chunks/TokenPicker-Q0LToF_p.js +291 -0
- package/dist/chunks/ToolbarDashedButton-DbUxGmDg.js +23 -0
- package/dist/chunks/TransformEditorPanel-BGwyznZ6.js +26 -0
- package/dist/chunks/TransitionEditorPanel-BSvk58Ow.js +26 -0
- package/dist/chunks/TypographyPresetInput-DqnGSgR2.js +296 -0
- package/dist/chunks/ValidationPanel-CmA9SfoF.js +56 -0
- package/dist/chunks/Video.render-Dg6xvis4.js +21 -0
- package/dist/chunks/VideoMainTab-v5UFhUm-.js +174 -0
- package/dist/chunks/YouTube.esm-EbHnLU1Z.js +744 -0
- package/dist/chunks/dialogAtoms-CeQ2G05l.js +59 -0
- package/dist/chunks/extends-hS2Bh-Yp.js +12 -0
- package/dist/chunks/formatStorage-C3o2s3dk.js +22 -0
- package/dist/chunks/googleFonts-Dj4AntNi.js +323 -0
- package/dist/chunks/helpers-Cll72tMn.js +18 -0
- package/dist/chunks/index-B-GJd039.js +2875 -0
- package/dist/chunks/index-C66dAl3Q.js +32177 -0
- package/dist/chunks/index.esm-mqFx3NOs.js +644 -0
- package/dist/chunks/popoverOpenRequestAtom-hBS_siXv.js +22 -0
- package/dist/chunks/propertyRegistry-CMhVNOgl.js +38 -0
- package/dist/chunks/resolveAnchorsViaCraft-Cixm6ZyJ.js +31 -0
- package/dist/chunks/toolboxUtils-DjTMslSn.js +370 -0
- package/dist/chunks/uiPrimitives-BtohldWg.js +15 -0
- package/dist/chunks/use-event-listener-DO3Sk7g0.js +15 -0
- package/dist/chunks/useElementPicker-DoNuXNMQ.js +41 -0
- package/dist/chunks/useLayoutPreset-wOMV5YnO.js +528 -0
- package/dist/chunks/useMediaManager-CmKDbFfw.js +4629 -0
- package/dist/chunks/usePopoverAutoOpen-CxIjt0ez.js +25 -0
- package/dist/chunks/usePopoverPosition-83Vti7Aw.js +15 -0
- package/dist/render/static/index.js +9 -0
- package/dist/theme.css +168 -0
- package/package.json +25 -14
- package/dist/pagehub-viewer.umd.cjs +0 -574
- package/dist/pagehub.umd.cjs +0 -1130
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
import { jsxs as k, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import B, { useRef as E, useState as C, useCallback as T, useEffect as R } from "react";
|
|
3
|
+
import { P as D, dR as S, aB as _, ca as $ } from "./index-C66dAl3Q.js";
|
|
4
|
+
import { T as O } from "./ToolbarDashedButton-DbUxGmDg.js";
|
|
5
|
+
const Y = ({
|
|
6
|
+
index: c,
|
|
7
|
+
label: o,
|
|
8
|
+
isActive: s,
|
|
9
|
+
isDragSource: f,
|
|
10
|
+
dropEdge: m,
|
|
11
|
+
onActivate: i,
|
|
12
|
+
onDelete: l,
|
|
13
|
+
extraButtons: u = [],
|
|
14
|
+
onGripPointerDown: a
|
|
15
|
+
}) => /* @__PURE__ */ k(
|
|
16
|
+
"div",
|
|
17
|
+
{
|
|
18
|
+
"data-list-row": c,
|
|
19
|
+
className: `group border-base-300 relative flex h-8 items-center gap-1 border-b px-1.5 text-sm transition-colors last:border-b-0 ${s ? "bg-base-200 text-base-content" : "text-sidebar-foreground hover:bg-base-200/60"} ${f ? "opacity-40" : ""}`,
|
|
20
|
+
children: [
|
|
21
|
+
m && /* @__PURE__ */ r(
|
|
22
|
+
"span",
|
|
23
|
+
{
|
|
24
|
+
"aria-hidden": !0,
|
|
25
|
+
className: `bg-primary pointer-events-none absolute inset-x-0 z-10 h-0.5 ${m === "top" ? "-top-px" : "-bottom-px"}`
|
|
26
|
+
}
|
|
27
|
+
),
|
|
28
|
+
/* @__PURE__ */ r(
|
|
29
|
+
"span",
|
|
30
|
+
{
|
|
31
|
+
className: `text-neutral-content flex shrink-0 items-center transition-opacity ${a ? "cursor-grab opacity-0 group-hover:opacity-100 active:cursor-grabbing" : "cursor-default opacity-30"}`,
|
|
32
|
+
onPointerDown: a,
|
|
33
|
+
"data-tooltip-id": a ? D : void 0,
|
|
34
|
+
"data-tooltip-content": a ? "Drag to reorder" : void 0,
|
|
35
|
+
"aria-label": a ? "Drag to reorder" : void 0,
|
|
36
|
+
children: /* @__PURE__ */ r(S, { className: "h-3.5 w-3.5" })
|
|
37
|
+
}
|
|
38
|
+
),
|
|
39
|
+
/* @__PURE__ */ r(
|
|
40
|
+
"button",
|
|
41
|
+
{
|
|
42
|
+
type: "button",
|
|
43
|
+
onClick: i,
|
|
44
|
+
className: "flex min-w-0 flex-1 cursor-pointer items-center truncate text-left text-xs",
|
|
45
|
+
children: /* @__PURE__ */ r("span", { className: "truncate", children: o })
|
|
46
|
+
}
|
|
47
|
+
),
|
|
48
|
+
u.map((e, n) => /* @__PURE__ */ r("span", { className: "shrink-0 opacity-0 group-hover:opacity-100", children: e }, n)),
|
|
49
|
+
l && /* @__PURE__ */ r(
|
|
50
|
+
"button",
|
|
51
|
+
{
|
|
52
|
+
type: "button",
|
|
53
|
+
className: "text-neutral-content hover:text-error flex shrink-0 items-center opacity-0 transition-colors group-hover:opacity-100",
|
|
54
|
+
onClick: l,
|
|
55
|
+
"data-tooltip-id": D,
|
|
56
|
+
"data-tooltip-content": "Delete",
|
|
57
|
+
"aria-label": "Delete",
|
|
58
|
+
children: /* @__PURE__ */ r(_, { className: "h-3.5 w-3.5" })
|
|
59
|
+
}
|
|
60
|
+
),
|
|
61
|
+
/* @__PURE__ */ r(
|
|
62
|
+
"button",
|
|
63
|
+
{
|
|
64
|
+
type: "button",
|
|
65
|
+
onClick: i,
|
|
66
|
+
"aria-label": s ? "Collapse" : "Expand",
|
|
67
|
+
className: "text-neutral-content hover:text-base-content flex shrink-0 cursor-pointer items-center",
|
|
68
|
+
children: /* @__PURE__ */ r(
|
|
69
|
+
$,
|
|
70
|
+
{
|
|
71
|
+
"aria-hidden": !0,
|
|
72
|
+
className: `h-3.5 w-3.5 transition-transform ${s ? "rotate-90" : ""}`
|
|
73
|
+
}
|
|
74
|
+
)
|
|
75
|
+
}
|
|
76
|
+
)
|
|
77
|
+
]
|
|
78
|
+
}
|
|
79
|
+
), A = ({ children: c }) => {
|
|
80
|
+
const o = E(null);
|
|
81
|
+
return R(() => {
|
|
82
|
+
var s;
|
|
83
|
+
(s = o.current) == null || s.scrollIntoView({ behavior: "smooth", block: "nearest" });
|
|
84
|
+
}, []), /* @__PURE__ */ r(
|
|
85
|
+
"div",
|
|
86
|
+
{
|
|
87
|
+
ref: o,
|
|
88
|
+
className: "border-base-300 flex flex-col gap-3 border-b px-3 py-3 last:border-b-0",
|
|
89
|
+
children: c
|
|
90
|
+
}
|
|
91
|
+
);
|
|
92
|
+
};
|
|
93
|
+
function I(c, o) {
|
|
94
|
+
const [s, f] = C(null), [m, i] = C(null), l = E(null), u = E(null), a = T(() => {
|
|
95
|
+
var e;
|
|
96
|
+
(e = u.current) == null || e.detach(), u.current = null;
|
|
97
|
+
}, []);
|
|
98
|
+
R(() => a, [a]);
|
|
99
|
+
const d = T(
|
|
100
|
+
(e) => {
|
|
101
|
+
const n = l.current;
|
|
102
|
+
a(), l.current = null, f(null), i(null), e && n && n.over !== null && n.over !== n.from && o && o(n.from, n.over);
|
|
103
|
+
},
|
|
104
|
+
[a, o]
|
|
105
|
+
), g = T(
|
|
106
|
+
(e) => (n) => {
|
|
107
|
+
if (!o || n.button !== 0) return;
|
|
108
|
+
n.preventDefault(), n.stopPropagation(), l.current = { from: e, over: e }, f(e), i(e);
|
|
109
|
+
const w = (v) => {
|
|
110
|
+
if (v.buttons === 0) {
|
|
111
|
+
d(!0);
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
114
|
+
const x = c.current;
|
|
115
|
+
if (!x) return;
|
|
116
|
+
const h = x.querySelectorAll("[data-list-row]");
|
|
117
|
+
let b = null;
|
|
118
|
+
for (const y of Array.from(h)) {
|
|
119
|
+
const N = y.getBoundingClientRect();
|
|
120
|
+
if (v.clientY >= N.top && v.clientY <= N.bottom) {
|
|
121
|
+
b = parseInt(y.dataset.listRow || "0", 10);
|
|
122
|
+
break;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
if (b === null && h.length) {
|
|
126
|
+
const y = h[0].getBoundingClientRect(), N = h[h.length - 1].getBoundingClientRect();
|
|
127
|
+
v.clientY < y.top ? b = 0 : v.clientY > N.bottom && (b = h.length - 1);
|
|
128
|
+
}
|
|
129
|
+
const L = l.current;
|
|
130
|
+
L && b !== null && b !== L.over && (L.over = b, i(b));
|
|
131
|
+
}, p = () => d(!0), t = () => d(!1);
|
|
132
|
+
window.addEventListener("pointermove", w), window.addEventListener("pointerup", p), window.addEventListener("pointercancel", t), window.addEventListener("blur", t), u.current = {
|
|
133
|
+
detach: () => {
|
|
134
|
+
window.removeEventListener("pointermove", w), window.removeEventListener("pointerup", p), window.removeEventListener("pointercancel", t), window.removeEventListener("blur", t);
|
|
135
|
+
}
|
|
136
|
+
};
|
|
137
|
+
},
|
|
138
|
+
[d, c, o]
|
|
139
|
+
);
|
|
140
|
+
return { dragSource: s, dragOver: m, startDrag: g };
|
|
141
|
+
}
|
|
142
|
+
const z = ({
|
|
143
|
+
items: c,
|
|
144
|
+
activeIndex: o,
|
|
145
|
+
setActiveIndex: s,
|
|
146
|
+
renderLabel: f,
|
|
147
|
+
renderPopover: m,
|
|
148
|
+
onDelete: i,
|
|
149
|
+
onAdd: l,
|
|
150
|
+
onReorder: u,
|
|
151
|
+
addLabel: a = "Add Item",
|
|
152
|
+
extraButtons: d
|
|
153
|
+
}) => {
|
|
154
|
+
const g = E(null), { dragSource: e, dragOver: n, startDrag: w } = I(g, u);
|
|
155
|
+
return /* @__PURE__ */ k("div", { className: "flex flex-col gap-2", children: [
|
|
156
|
+
c.length > 0 && /* @__PURE__ */ r("div", { ref: g, className: "border-base-300 overflow-hidden rounded-lg border", children: c.map((p, t) => /* @__PURE__ */ k(B.Fragment, { children: [
|
|
157
|
+
/* @__PURE__ */ r(
|
|
158
|
+
Y,
|
|
159
|
+
{
|
|
160
|
+
index: t,
|
|
161
|
+
label: f(p, t),
|
|
162
|
+
isActive: o === t,
|
|
163
|
+
isDragSource: e === t,
|
|
164
|
+
dropEdge: e === null || n !== t || e === t ? null : e > t ? "top" : "bottom",
|
|
165
|
+
onActivate: () => s(o === t ? null : t),
|
|
166
|
+
onDelete: i ? () => i(p, t) : void 0,
|
|
167
|
+
extraButtons: d ? d(p, t) : [],
|
|
168
|
+
onGripPointerDown: u ? w(t) : void 0
|
|
169
|
+
}
|
|
170
|
+
),
|
|
171
|
+
o === t && /* @__PURE__ */ r(A, { children: m(p, t) })
|
|
172
|
+
] }, p.id ?? t)) }),
|
|
173
|
+
l && /* @__PURE__ */ r(O, { onClick: l, children: a })
|
|
174
|
+
] });
|
|
175
|
+
};
|
|
176
|
+
export {
|
|
177
|
+
z as L
|
|
178
|
+
};
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { jsxs as w, jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import m from "react";
|
|
3
|
+
import { cZ as P, d6 as _, d7 as I, d8 as R, d9 as T } from "./index-C66dAl3Q.js";
|
|
4
|
+
const x = typeof window < "u" ? m.lazy(() => import("./MapLeaflet-DOfmZ3Pk.js")) : null, U = {
|
|
5
|
+
osm: "https://tile.openstreetmap.org/{z}/{x}/{y}.png",
|
|
6
|
+
"cartodb-positron": "https://a.basemaps.cartocdn.com/light_all/{z}/{x}/{y}.png",
|
|
7
|
+
"cartodb-dark": "https://a.basemaps.cartocdn.com/dark_all/{z}/{x}/{y}.png",
|
|
8
|
+
"cartodb-voyager": "https://a.basemaps.cartocdn.com/rastertiles/voyager/{z}/{x}/{y}.png"
|
|
9
|
+
};
|
|
10
|
+
function y(r, t, n) {
|
|
11
|
+
const o = Math.pow(2, n), l = Math.floor((t + 180) / 360 * o), e = r * Math.PI / 180, a = Math.floor((1 - Math.log(Math.tan(e) + 1 / Math.cos(e)) / Math.PI) / 2 * o);
|
|
12
|
+
return { x: l, y: a };
|
|
13
|
+
}
|
|
14
|
+
function z(r, t, n, o) {
|
|
15
|
+
const { x: l, y: e } = y(r, t, n);
|
|
16
|
+
return U[o].replace("{z}", String(n)).replace("{x}", String(l)).replace("{y}", String(e));
|
|
17
|
+
}
|
|
18
|
+
const W = (r) => {
|
|
19
|
+
var h;
|
|
20
|
+
const t = {
|
|
21
|
+
lat: 51.505,
|
|
22
|
+
lng: -0.09,
|
|
23
|
+
zoom: 13,
|
|
24
|
+
type: "interactive",
|
|
25
|
+
tileStyle: "osm",
|
|
26
|
+
grayscale: !1,
|
|
27
|
+
title: "",
|
|
28
|
+
...r
|
|
29
|
+
}, n = ((h = P()) == null ? void 0 : h.id) ?? "", o = _(), l = t.childPoints ?? [], { lat: e, lng: a, zoom: c, type: i, tileStyle: p, grayscale: M } = t, b = e !== 0 || a !== 0, u = M ? { filter: "grayscale(1)" } : {}, v = () => {
|
|
30
|
+
if (!b) return null;
|
|
31
|
+
if (i === "background" || i === "static") {
|
|
32
|
+
const f = z(e, a, c, p);
|
|
33
|
+
return /* @__PURE__ */ w("div", { className: "relative size-full", style: u, children: [
|
|
34
|
+
/* @__PURE__ */ s("img", { src: f, alt: t.title || `Map at ${e}, ${a}`, className: "size-full object-cover", loading: "lazy" }),
|
|
35
|
+
i === "static" && l.length > 0 && l.map((d) => {
|
|
36
|
+
const { x: N, y: S } = y(e, a, c), { x: L, y: $ } = y(d.lat, d.lng, c), k = (L - N) * 256 + 128, j = ($ - S) * 256 + 128;
|
|
37
|
+
return /* @__PURE__ */ s(
|
|
38
|
+
"div",
|
|
39
|
+
{
|
|
40
|
+
className: "absolute size-3 -translate-x-1/2 -translate-y-1/2 rounded-full bg-red-500 shadow-md",
|
|
41
|
+
style: { left: `${k}px`, top: `${j}px` },
|
|
42
|
+
title: d.title
|
|
43
|
+
},
|
|
44
|
+
d.id
|
|
45
|
+
);
|
|
46
|
+
})
|
|
47
|
+
] });
|
|
48
|
+
}
|
|
49
|
+
if (i === "interactive" && x && o)
|
|
50
|
+
return /* @__PURE__ */ s(
|
|
51
|
+
m.Suspense,
|
|
52
|
+
{
|
|
53
|
+
fallback: /* @__PURE__ */ s("div", { className: "text-neutral-content flex size-full items-center justify-center", children: "Loading map..." }),
|
|
54
|
+
children: /* @__PURE__ */ s("div", { className: "size-full", style: u, children: /* @__PURE__ */ s(
|
|
55
|
+
x,
|
|
56
|
+
{
|
|
57
|
+
lat: e,
|
|
58
|
+
lng: a,
|
|
59
|
+
zoom: c,
|
|
60
|
+
tileStyle: p,
|
|
61
|
+
childPoints: l,
|
|
62
|
+
enabled: !1
|
|
63
|
+
}
|
|
64
|
+
) })
|
|
65
|
+
}
|
|
66
|
+
);
|
|
67
|
+
if (i === "interactive") {
|
|
68
|
+
const f = z(e, a, c, p);
|
|
69
|
+
return /* @__PURE__ */ s("img", { src: f, alt: t.title || `Map at ${e}, ${a}`, className: "size-full object-cover", loading: "lazy" });
|
|
70
|
+
}
|
|
71
|
+
return null;
|
|
72
|
+
}, g = {
|
|
73
|
+
className: `overflow-hidden ${t.className || ""}`,
|
|
74
|
+
role: "region",
|
|
75
|
+
"aria-label": t.title || "Map",
|
|
76
|
+
children: v()
|
|
77
|
+
};
|
|
78
|
+
return I(g, t), m.createElement(R(t, "div", !1), T({ ...g, key: n }, t, null, !1));
|
|
79
|
+
};
|
|
80
|
+
export {
|
|
81
|
+
W as MapRender
|
|
82
|
+
};
|