camox 0.41.0 → 0.42.0
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/core/components/lexical/SidebarLexicalEditor.js +42 -39
- package/dist/core/createApp.d.ts +16 -2
- package/dist/core/createBlock.js +11 -25
- package/dist/core/editing/BlockEditingRuntime.js +4 -4
- package/dist/core/editing/CompleteBlockEditingRuntime.js +5 -5
- package/dist/core/editing/createEditableBlock.d.ts +8 -1
- package/dist/core/editing/createEditableBlock.js +684 -644
- package/dist/core/hooks/useIsEditable.js +4 -7
- package/dist/core/hooks/useOverlayState.js +11 -0
- package/dist/core/hooks/useRequireDraftSource.js +7 -11
- package/dist/core/lib/fieldTypes.js +5 -5
- package/dist/core/lib/lexicalState.js +17 -1
- package/dist/features/preview/CamoxPreview.js +123 -137
- package/dist/features/preview/DerivedPreview.js +6 -9
- package/dist/features/preview/commentsEnabled.js +8 -0
- package/dist/features/preview/components/AddBlockSidebar.js +79 -89
- package/dist/features/preview/components/AssetLightbox.js +4 -11
- package/dist/features/preview/components/AttachedComments.js +194 -0
- package/dist/features/preview/components/BlockActionsPopover.js +19 -70
- package/dist/features/preview/components/CommentHeader.js +122 -0
- package/dist/features/preview/components/CommentSidebar.js +29 -0
- package/dist/features/preview/components/CommentTargetQuote.js +166 -0
- package/dist/features/preview/components/CreatePageModal.js +2 -8
- package/dist/features/preview/components/DerivedLayoutSidebar.js +4 -7
- package/dist/features/preview/components/ItemFieldsEditor.js +275 -204
- package/dist/features/preview/components/LeftSidebar.js +18 -18
- package/dist/features/preview/components/LinkFieldEditor.js +3 -4
- package/dist/features/preview/components/MobilePreviewDrawer.js +3 -3
- package/dist/features/preview/components/OverlayTracker.js +14 -20
- package/dist/features/preview/components/Overlays.js +28 -40
- package/dist/features/preview/components/PageEditorSidebar.js +231 -241
- package/dist/features/preview/components/PageInfoSidebar.js +126 -157
- package/dist/features/preview/components/PagePicker.js +13 -8
- package/dist/features/preview/components/PageTree.js +255 -319
- package/dist/features/preview/components/PreviewComments.js +56 -0
- package/dist/features/preview/components/PreviewPanel.js +149 -107
- package/dist/features/preview/components/PreviewToolbar.js +292 -246
- package/dist/features/preview/components/PreviewToolbarSpacer.js +43 -0
- package/dist/features/preview/components/PublicationRow.js +11 -24
- package/dist/features/preview/components/RightSidebar.js +14 -11
- package/dist/features/preview/components/SidebarSection.js +121 -0
- package/dist/features/preview/previewCommentsStore.js +115 -0
- package/dist/features/preview/previewSelection.js +75 -0
- package/dist/features/preview/previewStore.js +32 -63
- package/dist/features/provider/AuthenticatedCamoxProvider.js +46 -34
- package/dist/features/provider/components/CommandPalette.js +142 -58
- package/dist/features/provider/useAdminShortcuts.js +20 -8
- package/dist/features/routes/pageRuntime.js +0 -6
- package/dist/features/runtime/RuntimeChrome.js +102 -87
- package/dist/features/studio/CamoxStudio.js +30 -50
- package/dist/features/studio/components/UserButton.js +4 -4
- package/dist/features/vite/runtimeDev.js +4 -1
- package/dist/features/vite/vite.d.ts +3 -2
- package/dist/features/vite/vite.js +9 -5
- package/dist/hooks/use-file-upload.js +0 -2
- package/dist/studio.css +1 -1
- package/package.json +5 -7
- package/dist/features/preview/components/DraftSwitchDialog.js +0 -66
- package/dist/lib/telemetry-client.js +0 -66
- package/dist/lib/telemetry.js +0 -26
|
@@ -5,8 +5,8 @@ import { Type as Type$1, resolveToMarkdown } from "../lib/contentType.js";
|
|
|
5
5
|
import { buildImageSrcSet, getDefaultImageSizes, getDefaultImageWidth, transformImageUrl } from "../lib/imageTransform.js";
|
|
6
6
|
import { markdownToReactNodes } from "../lib/lexicalReact.js";
|
|
7
7
|
import { blockMutations, pageQueries, projectQueries, repeatableItemMutations } from "../../lib/queries.js";
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
8
|
+
import { previewStore, selectIsCommentMode } from "../../features/preview/previewStore.js";
|
|
9
|
+
import { usePreviewSelection } from "../../features/preview/previewSelection.js";
|
|
10
10
|
import { postOverlayMessage } from "../../features/preview/overlayMessages.js";
|
|
11
11
|
import { useFrame } from "../../features/preview/components/Frame.js";
|
|
12
12
|
import { AddBlockControlBar } from "../components/AddBlockControlBar.js";
|
|
@@ -14,6 +14,7 @@ import { InlineLexicalEditor } from "../components/lexical/InlineLexicalEditor.j
|
|
|
14
14
|
import { useFieldSelection } from "../hooks/useFieldSelection.js";
|
|
15
15
|
import { useIsEditable } from "../hooks/useIsEditable.js";
|
|
16
16
|
import { useOverlayMessage } from "../hooks/useOverlayMessage.js";
|
|
17
|
+
import { useOverlayState } from "../hooks/useOverlayState.js";
|
|
17
18
|
import { c } from "react/compiler-runtime";
|
|
18
19
|
import { Type } from "@sinclair/typebox";
|
|
19
20
|
import { useMutation, useQuery } from "@tanstack/react-query";
|
|
@@ -21,9 +22,6 @@ import { generateKeyBetween } from "fractional-indexing";
|
|
|
21
22
|
import * as React from "react";
|
|
22
23
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
23
24
|
import { useSelector } from "@xstate/store-react";
|
|
24
|
-
import { Popover, PopoverContent, PopoverTrigger } from "@camox/ui/popover";
|
|
25
|
-
import { Label } from "@camox/ui/label";
|
|
26
|
-
import { Input } from "@camox/ui/input";
|
|
27
25
|
import { createPortal } from "react-dom";
|
|
28
26
|
|
|
29
27
|
//#region src/core/editing/createEditableBlock.tsx
|
|
@@ -185,7 +183,15 @@ function createEditableBlock(options) {
|
|
|
185
183
|
if (repeaterContext?.itemId != null) return `${blockId}__${repeaterContext.itemId}__${fieldName}`;
|
|
186
184
|
return `${blockId}__${fieldName}`;
|
|
187
185
|
};
|
|
188
|
-
const Field = (
|
|
186
|
+
const Field = (t0) => {
|
|
187
|
+
const $ = c(34);
|
|
188
|
+
if ($[0] !== "9390cfa3e0bf4e772e82a3d1352a7d56d8ae67f112d215b6d45231db17c01883") {
|
|
189
|
+
for (let $i = 0; $i < 34; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
190
|
+
$[0] = "9390cfa3e0bf4e772e82a3d1352a7d56d8ae67f112d215b6d45231db17c01883";
|
|
191
|
+
}
|
|
192
|
+
const { name, textStyle, linkStyle, children } = t0;
|
|
193
|
+
const selectTarget = usePreviewSelection();
|
|
194
|
+
const isCommentMode = useSelector(previewStore, selectIsCommentMode);
|
|
189
195
|
const blockContext = React.use(Context);
|
|
190
196
|
if (!blockContext) throw new Error("Field must be used within a Block Component");
|
|
191
197
|
const { blockId, content, mode } = blockContext;
|
|
@@ -193,77 +199,154 @@ function createEditableBlock(options) {
|
|
|
193
199
|
const elementRef = React.useRef(null);
|
|
194
200
|
const { window: iframeWindow } = useFrame();
|
|
195
201
|
const projectSlug = useProjectSlug();
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
+
let t1;
|
|
203
|
+
if ($[1] !== projectSlug) {
|
|
204
|
+
t1 = projectQueries.getBySlug(projectSlug);
|
|
205
|
+
$[1] = projectSlug;
|
|
206
|
+
$[2] = t1;
|
|
207
|
+
} else t1 = $[2];
|
|
208
|
+
const { data: project } = useQuery(t1);
|
|
209
|
+
let t2;
|
|
210
|
+
if ($[3] !== project?.id) {
|
|
211
|
+
t2 = pageQueries.list(project?.id ?? 0);
|
|
212
|
+
$[3] = project?.id;
|
|
213
|
+
$[4] = t2;
|
|
214
|
+
} else t2 = $[4];
|
|
215
|
+
const t3 = !!project;
|
|
216
|
+
let t4;
|
|
217
|
+
if ($[5] !== t2 || $[6] !== t3) {
|
|
218
|
+
t4 = {
|
|
219
|
+
...t2,
|
|
220
|
+
enabled: t3
|
|
221
|
+
};
|
|
222
|
+
$[5] = t2;
|
|
223
|
+
$[6] = t3;
|
|
224
|
+
$[7] = t4;
|
|
225
|
+
} else t4 = $[7];
|
|
226
|
+
const { data: pages } = useQuery(t4);
|
|
227
|
+
let t5;
|
|
228
|
+
if ($[8] === Symbol.for("react.memo_cache_sentinel")) {
|
|
229
|
+
t5 = { select: _temp };
|
|
230
|
+
$[8] = t5;
|
|
231
|
+
} else t5 = $[8];
|
|
232
|
+
const currentPathname = useLocation(t5);
|
|
202
233
|
const repeaterContext = React.use(RepeaterItemContext);
|
|
203
234
|
const fieldId = getOverlayFieldId(blockId, repeaterContext, String(name));
|
|
204
235
|
const fieldValue = repeaterContext ? repeaterContext.itemContent[name] : content[name];
|
|
205
236
|
const [isHovered, setIsHovered] = React.useState(false);
|
|
206
237
|
const [isEditorFocused, setIsEditorFocused] = React.useState(false);
|
|
207
238
|
const isSelectedFromSelection = useFieldSelection(blockId, String(name), "String", repeaterContext?.itemId);
|
|
208
|
-
const
|
|
239
|
+
const overlayState = useOverlayState(isHovered, isEditorFocused || isSelectedFromSelection);
|
|
209
240
|
const isHoveredFromSidebar = useOverlayMessage(iframeWindow, isContentEditable, "CAMOX_HOVER_FIELD", "CAMOX_HOVER_FIELD_END", { fieldId });
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
241
|
+
let t6;
|
|
242
|
+
let t7;
|
|
243
|
+
if ($[9] !== isHoveredFromSidebar) {
|
|
244
|
+
t6 = () => {
|
|
245
|
+
setIsHovered(isHoveredFromSidebar);
|
|
246
|
+
};
|
|
247
|
+
t7 = [isHoveredFromSidebar];
|
|
248
|
+
$[9] = isHoveredFromSidebar;
|
|
249
|
+
$[10] = t6;
|
|
250
|
+
$[11] = t7;
|
|
251
|
+
} else {
|
|
252
|
+
t6 = $[10];
|
|
253
|
+
t7 = $[11];
|
|
254
|
+
}
|
|
255
|
+
React.useEffect(t6, t7);
|
|
256
|
+
let t8;
|
|
257
|
+
if ($[12] === Symbol.for("react.memo_cache_sentinel")) {
|
|
258
|
+
t8 = blockMutations.updateContent();
|
|
259
|
+
$[12] = t8;
|
|
260
|
+
} else t8 = $[12];
|
|
261
|
+
const updateBlockContent = useMutation(t8);
|
|
262
|
+
let t9;
|
|
263
|
+
if ($[13] === Symbol.for("react.memo_cache_sentinel")) {
|
|
264
|
+
t9 = repeatableItemMutations.updateContent();
|
|
265
|
+
$[13] = t9;
|
|
266
|
+
} else t9 = $[13];
|
|
267
|
+
const updateRepeatableContent = useMutation(t9);
|
|
268
|
+
let t10;
|
|
269
|
+
if ($[14] !== blockId || $[15] !== name || $[16] !== repeaterContext || $[17] !== updateBlockContent || $[18] !== updateRepeatableContent) {
|
|
270
|
+
t10 = (newValue) => {
|
|
271
|
+
if (repeaterContext) {
|
|
272
|
+
const { itemId } = repeaterContext;
|
|
273
|
+
if (itemId != null) updateRepeatableContent.mutate({
|
|
274
|
+
id: itemId,
|
|
275
|
+
content: { [name]: newValue }
|
|
276
|
+
});
|
|
277
|
+
} else updateBlockContent.mutate({
|
|
278
|
+
id: blockId,
|
|
220
279
|
content: { [name]: newValue }
|
|
221
280
|
});
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
])
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
]
|
|
253
|
-
const
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
};
|
|
264
|
-
const
|
|
265
|
-
|
|
266
|
-
|
|
281
|
+
};
|
|
282
|
+
$[14] = blockId;
|
|
283
|
+
$[15] = name;
|
|
284
|
+
$[16] = repeaterContext;
|
|
285
|
+
$[17] = updateBlockContent;
|
|
286
|
+
$[18] = updateRepeatableContent;
|
|
287
|
+
$[19] = t10;
|
|
288
|
+
} else t10 = $[19];
|
|
289
|
+
const handleChange = t10;
|
|
290
|
+
let t11;
|
|
291
|
+
if ($[20] !== blockId || $[21] !== name || $[22] !== repeaterContext || $[23] !== selectTarget) {
|
|
292
|
+
t11 = (event) => {
|
|
293
|
+
selectTarget(repeaterContext?.itemId != null ? {
|
|
294
|
+
type: "item-field",
|
|
295
|
+
blockId,
|
|
296
|
+
itemId: repeaterContext.itemId,
|
|
297
|
+
fieldName: String(name),
|
|
298
|
+
fieldType: "String"
|
|
299
|
+
} : {
|
|
300
|
+
type: "block-field",
|
|
301
|
+
blockId,
|
|
302
|
+
fieldName: String(name),
|
|
303
|
+
fieldType: "String"
|
|
304
|
+
}, event);
|
|
305
|
+
};
|
|
306
|
+
$[20] = blockId;
|
|
307
|
+
$[21] = name;
|
|
308
|
+
$[22] = repeaterContext;
|
|
309
|
+
$[23] = selectTarget;
|
|
310
|
+
$[24] = t11;
|
|
311
|
+
} else t11 = $[24];
|
|
312
|
+
const selectField = t11;
|
|
313
|
+
let t12;
|
|
314
|
+
if ($[25] !== selectField) {
|
|
315
|
+
t12 = () => {
|
|
316
|
+
if (selectIsCommentMode(previewStore.getSnapshot())) return;
|
|
317
|
+
setIsEditorFocused(true);
|
|
318
|
+
selectField();
|
|
319
|
+
};
|
|
320
|
+
$[25] = selectField;
|
|
321
|
+
$[26] = t12;
|
|
322
|
+
} else t12 = $[26];
|
|
323
|
+
const handleFocus = t12;
|
|
324
|
+
let t13;
|
|
325
|
+
if ($[27] === Symbol.for("react.memo_cache_sentinel")) {
|
|
326
|
+
t13 = () => {
|
|
327
|
+
setIsEditorFocused(false);
|
|
328
|
+
};
|
|
329
|
+
$[27] = t13;
|
|
330
|
+
} else t13 = $[27];
|
|
331
|
+
const handleBlur = t13;
|
|
332
|
+
let t14;
|
|
333
|
+
if ($[28] !== isContentEditable) {
|
|
334
|
+
t14 = () => {
|
|
335
|
+
if (isContentEditable) setIsHovered(true);
|
|
336
|
+
};
|
|
337
|
+
$[28] = isContentEditable;
|
|
338
|
+
$[29] = t14;
|
|
339
|
+
} else t14 = $[29];
|
|
340
|
+
const handleMouseEnter = t14;
|
|
341
|
+
let t15;
|
|
342
|
+
if ($[30] !== isContentEditable) {
|
|
343
|
+
t15 = () => {
|
|
344
|
+
if (isContentEditable) setIsHovered(false);
|
|
345
|
+
};
|
|
346
|
+
$[30] = isContentEditable;
|
|
347
|
+
$[31] = t15;
|
|
348
|
+
} else t15 = $[31];
|
|
349
|
+
const handleMouseLeave = t15;
|
|
267
350
|
const fieldData = { text: fieldValue };
|
|
268
351
|
if (!isContentEditable) return /* @__PURE__ */ jsx(Fragment, { children: children({ children: markdownToReactNodes(fieldValue, {
|
|
269
352
|
pages,
|
|
@@ -271,15 +354,20 @@ function createEditableBlock(options) {
|
|
|
271
354
|
textStyle,
|
|
272
355
|
linkStyle
|
|
273
356
|
}) }, fieldData) });
|
|
274
|
-
|
|
357
|
+
const t16 = children({
|
|
275
358
|
ref: elementRef,
|
|
276
359
|
"data-camox-field-id": fieldId,
|
|
277
|
-
|
|
278
|
-
"data-camox-focused": isFocused || void 0,
|
|
360
|
+
...overlayState,
|
|
279
361
|
"data-camox-overlay-mode": options.synced ? "synced" : void 0,
|
|
280
362
|
onMouseEnter: handleMouseEnter,
|
|
281
363
|
onMouseLeave: handleMouseLeave,
|
|
282
|
-
|
|
364
|
+
onClickCapture: selectField,
|
|
365
|
+
children: isCommentMode ? markdownToReactNodes(fieldValue, {
|
|
366
|
+
pages,
|
|
367
|
+
fallbackHref: currentPathname,
|
|
368
|
+
textStyle,
|
|
369
|
+
linkStyle
|
|
370
|
+
}) : /* @__PURE__ */ jsx(InlineLexicalEditor, {
|
|
283
371
|
textStyle,
|
|
284
372
|
linkStyle,
|
|
285
373
|
pages,
|
|
@@ -290,15 +378,23 @@ function createEditableBlock(options) {
|
|
|
290
378
|
onFocus: handleFocus,
|
|
291
379
|
onBlur: handleBlur
|
|
292
380
|
})
|
|
293
|
-
}, fieldData)
|
|
381
|
+
}, fieldData);
|
|
382
|
+
let t17;
|
|
383
|
+
if ($[32] !== t16) {
|
|
384
|
+
t17 = /* @__PURE__ */ jsx(Fragment, { children: t16 });
|
|
385
|
+
$[32] = t16;
|
|
386
|
+
$[33] = t17;
|
|
387
|
+
} else t17 = $[33];
|
|
388
|
+
return t17;
|
|
294
389
|
};
|
|
295
390
|
const Embed = (t0) => {
|
|
296
|
-
const $ = c(
|
|
297
|
-
if ($[0] !== "
|
|
298
|
-
for (let $i = 0; $i <
|
|
299
|
-
$[0] = "
|
|
391
|
+
const $ = c(39);
|
|
392
|
+
if ($[0] !== "9390cfa3e0bf4e772e82a3d1352a7d56d8ae67f112d215b6d45231db17c01883") {
|
|
393
|
+
for (let $i = 0; $i < 39; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
394
|
+
$[0] = "9390cfa3e0bf4e772e82a3d1352a7d56d8ae67f112d215b6d45231db17c01883";
|
|
300
395
|
}
|
|
301
396
|
const { name, children } = t0;
|
|
397
|
+
const selectTarget = usePreviewSelection();
|
|
302
398
|
const blockContext = React.use(Context);
|
|
303
399
|
if (!blockContext) throw new Error("Embed must be used within a Block Component");
|
|
304
400
|
const { blockId, content, mode } = blockContext;
|
|
@@ -316,234 +412,158 @@ function createEditableBlock(options) {
|
|
|
316
412
|
$[4] = t2;
|
|
317
413
|
} else t2 = $[4];
|
|
318
414
|
const fieldId = t2;
|
|
319
|
-
const [isOpen, setIsOpen] = React.useState(false);
|
|
320
|
-
const [urlValue, setUrlValue] = React.useState(fieldValue);
|
|
321
415
|
const [isHovered, setIsHovered] = React.useState(false);
|
|
322
|
-
const
|
|
416
|
+
const overlayState = useOverlayState(isHovered);
|
|
417
|
+
const embedRef = React.useRef(null);
|
|
418
|
+
const itemId = repeaterContext?.itemId;
|
|
323
419
|
let t3;
|
|
324
|
-
if ($[5] !==
|
|
325
|
-
t3 =
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
420
|
+
if ($[5] !== blockId || $[6] !== isContentEditable || $[7] !== itemId || $[8] !== name || $[9] !== selectTarget) {
|
|
421
|
+
t3 = (event) => {
|
|
422
|
+
if (!isContentEditable) return;
|
|
423
|
+
selectTarget(itemId != null ? {
|
|
424
|
+
type: "item-field",
|
|
425
|
+
blockId,
|
|
426
|
+
itemId,
|
|
427
|
+
fieldName: String(name),
|
|
428
|
+
fieldType: "Embed"
|
|
429
|
+
} : {
|
|
430
|
+
type: "block-field",
|
|
431
|
+
blockId,
|
|
432
|
+
fieldName: String(name),
|
|
433
|
+
fieldType: "Embed"
|
|
434
|
+
}, event);
|
|
435
|
+
};
|
|
436
|
+
$[5] = blockId;
|
|
437
|
+
$[6] = isContentEditable;
|
|
438
|
+
$[7] = itemId;
|
|
439
|
+
$[8] = name;
|
|
440
|
+
$[9] = selectTarget;
|
|
441
|
+
$[10] = t3;
|
|
442
|
+
} else t3 = $[10];
|
|
443
|
+
const selectField = t3;
|
|
330
444
|
let t4;
|
|
331
445
|
let t5;
|
|
332
|
-
if ($[
|
|
446
|
+
if ($[11] !== iframeWindow || $[12] !== isContentEditable || $[13] !== selectField) {
|
|
333
447
|
t4 = () => {
|
|
334
|
-
|
|
448
|
+
if (!isContentEditable || !iframeWindow) return;
|
|
449
|
+
let timer;
|
|
450
|
+
const handleBlur = () => {
|
|
451
|
+
iframeWindow.clearTimeout(timer);
|
|
452
|
+
timer = iframeWindow.setTimeout(() => {
|
|
453
|
+
const activeElement = iframeWindow.document.activeElement;
|
|
454
|
+
if (activeElement?.tagName !== "IFRAME") return;
|
|
455
|
+
if (!embedRef.current?.contains(activeElement)) return;
|
|
456
|
+
selectField({
|
|
457
|
+
currentTarget: embedRef.current,
|
|
458
|
+
preventDefault() {},
|
|
459
|
+
stopPropagation() {}
|
|
460
|
+
});
|
|
461
|
+
}, 0);
|
|
462
|
+
};
|
|
463
|
+
iframeWindow.addEventListener("blur", handleBlur);
|
|
464
|
+
return () => {
|
|
465
|
+
iframeWindow.clearTimeout(timer);
|
|
466
|
+
iframeWindow.removeEventListener("blur", handleBlur);
|
|
467
|
+
};
|
|
335
468
|
};
|
|
336
|
-
t5 = [
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
469
|
+
t5 = [
|
|
470
|
+
isContentEditable,
|
|
471
|
+
iframeWindow,
|
|
472
|
+
selectField
|
|
473
|
+
];
|
|
474
|
+
$[11] = iframeWindow;
|
|
475
|
+
$[12] = isContentEditable;
|
|
476
|
+
$[13] = selectField;
|
|
477
|
+
$[14] = t4;
|
|
478
|
+
$[15] = t5;
|
|
340
479
|
} else {
|
|
341
|
-
t4 = $[
|
|
342
|
-
t5 = $[
|
|
480
|
+
t4 = $[14];
|
|
481
|
+
t5 = $[15];
|
|
343
482
|
}
|
|
344
483
|
React.useEffect(t4, t5);
|
|
345
484
|
let t6;
|
|
346
|
-
if ($[
|
|
347
|
-
t6 =
|
|
348
|
-
$[
|
|
349
|
-
|
|
350
|
-
|
|
485
|
+
if ($[16] !== fieldId) {
|
|
486
|
+
t6 = { fieldId };
|
|
487
|
+
$[16] = fieldId;
|
|
488
|
+
$[17] = t6;
|
|
489
|
+
} else t6 = $[17];
|
|
490
|
+
const isHoveredFromSidebar = useOverlayMessage(iframeWindow, isContentEditable, "CAMOX_HOVER_FIELD", "CAMOX_HOVER_FIELD_END", t6);
|
|
351
491
|
let t7;
|
|
352
|
-
if ($[11] === Symbol.for("react.memo_cache_sentinel")) {
|
|
353
|
-
t7 = repeatableItemMutations.updateContent();
|
|
354
|
-
$[11] = t7;
|
|
355
|
-
} else t7 = $[11];
|
|
356
|
-
const updateRepeatableContent = useMutation(t7);
|
|
357
492
|
let t8;
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
if (!isOpen) setUrlValue(fieldValue);
|
|
493
|
+
if ($[18] !== isHoveredFromSidebar) {
|
|
494
|
+
t7 = () => {
|
|
495
|
+
setIsHovered(isHoveredFromSidebar);
|
|
362
496
|
};
|
|
363
|
-
|
|
364
|
-
$[
|
|
365
|
-
$[
|
|
366
|
-
$[
|
|
367
|
-
$[15] = t9;
|
|
497
|
+
t8 = [isHoveredFromSidebar];
|
|
498
|
+
$[18] = isHoveredFromSidebar;
|
|
499
|
+
$[19] = t7;
|
|
500
|
+
$[20] = t8;
|
|
368
501
|
} else {
|
|
369
|
-
|
|
370
|
-
|
|
502
|
+
t7 = $[19];
|
|
503
|
+
t8 = $[20];
|
|
371
504
|
}
|
|
372
|
-
React.useEffect(
|
|
373
|
-
|
|
505
|
+
React.useEffect(t7, t8);
|
|
506
|
+
const t9 = isContentEditable ? fieldId : void 0;
|
|
507
|
+
const t10 = isContentEditable ? "embed" : void 0;
|
|
374
508
|
let t11;
|
|
375
|
-
if ($[
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
$[17] = t11;
|
|
382
|
-
} else {
|
|
383
|
-
t10 = $[16];
|
|
384
|
-
t11 = $[17];
|
|
385
|
-
}
|
|
386
|
-
React.useEffect(t10, t11);
|
|
509
|
+
if ($[21] !== isContentEditable || $[22] !== overlayState) {
|
|
510
|
+
t11 = isContentEditable ? overlayState : {};
|
|
511
|
+
$[21] = isContentEditable;
|
|
512
|
+
$[22] = overlayState;
|
|
513
|
+
$[23] = t11;
|
|
514
|
+
} else t11 = $[23];
|
|
387
515
|
let t12;
|
|
388
|
-
if ($[
|
|
389
|
-
t12 = (
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
timerRef.current = window.setTimeout(() => {
|
|
394
|
-
if (repeaterContext?.itemId != null) updateRepeatableContent.mutate({
|
|
395
|
-
id: repeaterContext.itemId,
|
|
396
|
-
content: { [name]: newValue }
|
|
397
|
-
});
|
|
398
|
-
else updateBlockContent.mutate({
|
|
399
|
-
id: blockId,
|
|
400
|
-
content: { [name]: newValue }
|
|
401
|
-
});
|
|
402
|
-
}, 500);
|
|
403
|
-
};
|
|
404
|
-
$[18] = blockId;
|
|
405
|
-
$[19] = name;
|
|
406
|
-
$[20] = repeaterContext;
|
|
407
|
-
$[21] = updateBlockContent;
|
|
408
|
-
$[22] = updateRepeatableContent;
|
|
409
|
-
$[23] = t12;
|
|
410
|
-
} else t12 = $[23];
|
|
411
|
-
const handleUrlChange = t12;
|
|
516
|
+
if ($[24] !== isContentEditable) {
|
|
517
|
+
t12 = isContentEditable ? () => setIsHovered(true) : void 0;
|
|
518
|
+
$[24] = isContentEditable;
|
|
519
|
+
$[25] = t12;
|
|
520
|
+
} else t12 = $[25];
|
|
412
521
|
let t13;
|
|
413
|
-
if ($[
|
|
414
|
-
t13 = (
|
|
415
|
-
|
|
416
|
-
if (open) if (repeaterContext?.itemId != null) previewStore.send({
|
|
417
|
-
type: "selectItemField",
|
|
418
|
-
blockId,
|
|
419
|
-
itemId: repeaterContext.itemId,
|
|
420
|
-
fieldName: name.toString(),
|
|
421
|
-
fieldType: "Embed"
|
|
422
|
-
});
|
|
423
|
-
else previewStore.send({
|
|
424
|
-
type: "selectBlockField",
|
|
425
|
-
blockId,
|
|
426
|
-
fieldName: name.toString(),
|
|
427
|
-
fieldType: "Embed"
|
|
428
|
-
});
|
|
429
|
-
};
|
|
430
|
-
$[24] = blockId;
|
|
431
|
-
$[25] = name;
|
|
432
|
-
$[26] = repeaterContext;
|
|
522
|
+
if ($[26] !== isContentEditable) {
|
|
523
|
+
t13 = isContentEditable ? () => setIsHovered(false) : void 0;
|
|
524
|
+
$[26] = isContentEditable;
|
|
433
525
|
$[27] = t13;
|
|
434
526
|
} else t13 = $[27];
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
let
|
|
443
|
-
if ($[
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
t21 = isContentEditable ? () => setIsHovered(false) : void 0;
|
|
451
|
-
$[30] = isContentEditable;
|
|
452
|
-
$[31] = t21;
|
|
453
|
-
} else t21 = $[31];
|
|
454
|
-
let t22;
|
|
455
|
-
if ($[32] !== t16 || $[33] !== t17 || $[34] !== t18 || $[35] !== t19 || $[36] !== t20 || $[37] !== t21) {
|
|
456
|
-
t22 = /* @__PURE__ */ jsx("div", {
|
|
457
|
-
"data-camox-field-id": t16,
|
|
458
|
-
"data-camox-field-type": t17,
|
|
459
|
-
"data-camox-hovered": t18,
|
|
460
|
-
"data-camox-focused": t19,
|
|
527
|
+
let t14;
|
|
528
|
+
if ($[28] !== children || $[29] !== fieldValue) {
|
|
529
|
+
t14 = children({ src: fieldValue }, { url: fieldValue });
|
|
530
|
+
$[28] = children;
|
|
531
|
+
$[29] = fieldValue;
|
|
532
|
+
$[30] = t14;
|
|
533
|
+
} else t14 = $[30];
|
|
534
|
+
let t15;
|
|
535
|
+
if ($[31] !== selectField || $[32] !== t10 || $[33] !== t11 || $[34] !== t12 || $[35] !== t13 || $[36] !== t14 || $[37] !== t9) {
|
|
536
|
+
t15 = /* @__PURE__ */ jsx("div", {
|
|
537
|
+
ref: embedRef,
|
|
538
|
+
onClickCapture: selectField,
|
|
539
|
+
"data-camox-field-id": t9,
|
|
540
|
+
"data-camox-field-type": t10,
|
|
541
|
+
...t11,
|
|
461
542
|
"data-camox-overlay-mode": options.synced ? "synced" : void 0,
|
|
462
|
-
onMouseEnter:
|
|
463
|
-
onMouseLeave:
|
|
464
|
-
|
|
465
|
-
$[32] = t16;
|
|
466
|
-
$[33] = t17;
|
|
467
|
-
$[34] = t18;
|
|
468
|
-
$[35] = t19;
|
|
469
|
-
$[36] = t20;
|
|
470
|
-
$[37] = t21;
|
|
471
|
-
$[38] = t22;
|
|
472
|
-
} else t22 = $[38];
|
|
473
|
-
let t23;
|
|
474
|
-
if ($[39] !== children || $[40] !== fieldValue) {
|
|
475
|
-
t23 = children({ src: fieldValue }, { url: fieldValue });
|
|
476
|
-
$[39] = children;
|
|
477
|
-
$[40] = fieldValue;
|
|
478
|
-
$[41] = t23;
|
|
479
|
-
} else t23 = $[41];
|
|
480
|
-
let t24;
|
|
481
|
-
if ($[42] !== isContentEditable) {
|
|
482
|
-
t24 = isContentEditable && /* @__PURE__ */ jsx("div", { style: {
|
|
483
|
-
position: "absolute",
|
|
484
|
-
inset: 0,
|
|
485
|
-
zIndex: 10
|
|
486
|
-
} });
|
|
487
|
-
$[42] = isContentEditable;
|
|
488
|
-
$[43] = t24;
|
|
489
|
-
} else t24 = $[43];
|
|
490
|
-
let t25;
|
|
491
|
-
if ($[44] !== t22 || $[45] !== t23 || $[46] !== t24) {
|
|
492
|
-
t25 = /* @__PURE__ */ jsxs(PopoverTrigger, {
|
|
493
|
-
render: t22,
|
|
494
|
-
nativeButton: false,
|
|
495
|
-
children: [t23, t24]
|
|
543
|
+
onMouseEnter: t12,
|
|
544
|
+
onMouseLeave: t13,
|
|
545
|
+
children: t14
|
|
496
546
|
});
|
|
497
|
-
$[
|
|
498
|
-
$[
|
|
499
|
-
$[
|
|
500
|
-
$[
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
className: "grid gap-2",
|
|
508
|
-
children: [/* @__PURE__ */ jsx(Label, {
|
|
509
|
-
htmlFor: "url",
|
|
510
|
-
children: options.content[name]?.title ?? String(name)
|
|
511
|
-
}), /* @__PURE__ */ jsx(Input, {
|
|
512
|
-
type: "url",
|
|
513
|
-
id: "url",
|
|
514
|
-
value: urlValue,
|
|
515
|
-
onChange: handleUrlChange
|
|
516
|
-
})]
|
|
517
|
-
})
|
|
518
|
-
});
|
|
519
|
-
$[48] = handleUrlChange;
|
|
520
|
-
$[49] = isContentEditable;
|
|
521
|
-
$[50] = name;
|
|
522
|
-
$[51] = urlValue;
|
|
523
|
-
$[52] = t26;
|
|
524
|
-
} else t26 = $[52];
|
|
525
|
-
let t27;
|
|
526
|
-
if ($[53] !== t14 || $[54] !== t15 || $[55] !== t25 || $[56] !== t26) {
|
|
527
|
-
t27 = /* @__PURE__ */ jsxs(Popover, {
|
|
528
|
-
open: t14,
|
|
529
|
-
onOpenChange: t15,
|
|
530
|
-
children: [t25, t26]
|
|
531
|
-
});
|
|
532
|
-
$[53] = t14;
|
|
533
|
-
$[54] = t15;
|
|
534
|
-
$[55] = t25;
|
|
535
|
-
$[56] = t26;
|
|
536
|
-
$[57] = t27;
|
|
537
|
-
} else t27 = $[57];
|
|
538
|
-
return t27;
|
|
547
|
+
$[31] = selectField;
|
|
548
|
+
$[32] = t10;
|
|
549
|
+
$[33] = t11;
|
|
550
|
+
$[34] = t12;
|
|
551
|
+
$[35] = t13;
|
|
552
|
+
$[36] = t14;
|
|
553
|
+
$[37] = t9;
|
|
554
|
+
$[38] = t15;
|
|
555
|
+
} else t15 = $[38];
|
|
556
|
+
return t15;
|
|
539
557
|
};
|
|
540
558
|
const Link = (t0) => {
|
|
541
|
-
const $ = c(
|
|
542
|
-
if ($[0] !== "
|
|
543
|
-
for (let $i = 0; $i <
|
|
544
|
-
$[0] = "
|
|
559
|
+
const $ = c(32);
|
|
560
|
+
if ($[0] !== "9390cfa3e0bf4e772e82a3d1352a7d56d8ae67f112d215b6d45231db17c01883") {
|
|
561
|
+
for (let $i = 0; $i < 32; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
562
|
+
$[0] = "9390cfa3e0bf4e772e82a3d1352a7d56d8ae67f112d215b6d45231db17c01883";
|
|
545
563
|
}
|
|
546
564
|
const { name, children } = t0;
|
|
565
|
+
const selectTarget = usePreviewSelection();
|
|
566
|
+
const isCommentMode = useSelector(previewStore, selectIsCommentMode);
|
|
547
567
|
const blockContext = React.use(Context);
|
|
548
568
|
if (!blockContext) throw new Error("Link must be used within a Block Component");
|
|
549
569
|
const { blockId, content, mode } = blockContext;
|
|
@@ -592,7 +612,7 @@ function createEditableBlock(options) {
|
|
|
592
612
|
const { data: pages } = useQuery(t6);
|
|
593
613
|
let t7;
|
|
594
614
|
if ($[10] === Symbol.for("react.memo_cache_sentinel")) {
|
|
595
|
-
t7 = { select:
|
|
615
|
+
t7 = { select: _temp2 };
|
|
596
616
|
$[10] = t7;
|
|
597
617
|
} else t7 = $[10];
|
|
598
618
|
const resolvedHref = resolveLinkHref(fieldValue, pages, useLocation(t7));
|
|
@@ -602,7 +622,7 @@ function createEditableBlock(options) {
|
|
|
602
622
|
const [isHovered, setIsHovered] = React.useState(false);
|
|
603
623
|
const [isEditorFocused, setIsEditorFocused] = React.useState(false);
|
|
604
624
|
const isSelectedFromSelection = useFieldSelection(blockId, String(name), "Link", repeaterContext?.itemId);
|
|
605
|
-
const
|
|
625
|
+
const overlayState = useOverlayState(isHovered, isEditorFocused || isSelectedFromSelection);
|
|
606
626
|
React.useEffect(() => {
|
|
607
627
|
if (!isEditing) setDisplayText(fieldValue.text);
|
|
608
628
|
}, [fieldValue.text, isEditing]);
|
|
@@ -650,50 +670,49 @@ function createEditableBlock(options) {
|
|
|
650
670
|
});
|
|
651
671
|
};
|
|
652
672
|
let t11;
|
|
653
|
-
if ($[20] !== blockId || $[21] !== name || $[22] !== repeaterContext) {
|
|
654
|
-
t11 = () => {
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
if (repeaterContext?.itemId != null) previewStore.send({
|
|
658
|
-
type: "selectItemField",
|
|
673
|
+
if ($[20] !== blockId || $[21] !== name || $[22] !== repeaterContext || $[23] !== selectTarget) {
|
|
674
|
+
t11 = (event) => {
|
|
675
|
+
selectTarget(repeaterContext?.itemId != null ? {
|
|
676
|
+
type: "item-field",
|
|
659
677
|
blockId,
|
|
660
678
|
itemId: repeaterContext.itemId,
|
|
661
679
|
fieldName: String(name),
|
|
662
680
|
fieldType: "Link"
|
|
663
|
-
}
|
|
664
|
-
|
|
665
|
-
type: "selectBlockField",
|
|
681
|
+
} : {
|
|
682
|
+
type: "block-field",
|
|
666
683
|
blockId,
|
|
667
684
|
fieldName: String(name),
|
|
668
685
|
fieldType: "Link"
|
|
669
|
-
});
|
|
686
|
+
}, event);
|
|
670
687
|
};
|
|
671
688
|
$[20] = blockId;
|
|
672
689
|
$[21] = name;
|
|
673
690
|
$[22] = repeaterContext;
|
|
674
|
-
$[23] =
|
|
675
|
-
|
|
676
|
-
|
|
691
|
+
$[23] = selectTarget;
|
|
692
|
+
$[24] = t11;
|
|
693
|
+
} else t11 = $[24];
|
|
694
|
+
const selectField = t11;
|
|
677
695
|
let t12;
|
|
678
|
-
if ($[
|
|
696
|
+
if ($[25] !== selectField) {
|
|
679
697
|
t12 = () => {
|
|
680
|
-
|
|
681
|
-
|
|
698
|
+
if (selectIsCommentMode(previewStore.getSnapshot())) return;
|
|
699
|
+
setIsEditing(true);
|
|
700
|
+
setIsEditorFocused(true);
|
|
701
|
+
selectField();
|
|
682
702
|
};
|
|
683
|
-
$[
|
|
684
|
-
|
|
685
|
-
|
|
703
|
+
$[25] = selectField;
|
|
704
|
+
$[26] = t12;
|
|
705
|
+
} else t12 = $[26];
|
|
706
|
+
const handleFocus = t12;
|
|
686
707
|
let t13;
|
|
687
|
-
if ($[
|
|
688
|
-
t13 = (
|
|
689
|
-
e_0.stopPropagation();
|
|
690
|
-
previewStore.send({ type: "toggleContentSheet" });
|
|
691
|
-
setIsEditorFocused(false);
|
|
708
|
+
if ($[27] === Symbol.for("react.memo_cache_sentinel")) {
|
|
709
|
+
t13 = () => {
|
|
692
710
|
setIsEditing(false);
|
|
711
|
+
setIsEditorFocused(false);
|
|
693
712
|
};
|
|
694
|
-
$[
|
|
695
|
-
} else t13 = $[
|
|
696
|
-
const
|
|
713
|
+
$[27] = t13;
|
|
714
|
+
} else t13 = $[27];
|
|
715
|
+
const handleBlur = t13;
|
|
697
716
|
const linkData = {
|
|
698
717
|
text: displayText,
|
|
699
718
|
href: resolvedHref,
|
|
@@ -707,84 +726,52 @@ function createEditableBlock(options) {
|
|
|
707
726
|
}, linkData) });
|
|
708
727
|
let t14;
|
|
709
728
|
let t15;
|
|
710
|
-
if ($[
|
|
729
|
+
if ($[28] === Symbol.for("react.memo_cache_sentinel")) {
|
|
711
730
|
t14 = () => setIsHovered(true);
|
|
712
731
|
t15 = () => setIsHovered(false);
|
|
713
|
-
$[
|
|
714
|
-
$[
|
|
732
|
+
$[28] = t14;
|
|
733
|
+
$[29] = t15;
|
|
715
734
|
} else {
|
|
716
|
-
t14 = $[
|
|
717
|
-
t15 = $[
|
|
735
|
+
t14 = $[28];
|
|
736
|
+
t15 = $[29];
|
|
718
737
|
}
|
|
719
|
-
const
|
|
738
|
+
const t16 = children({
|
|
720
739
|
ref: elementRef,
|
|
721
740
|
to: resolvedHref,
|
|
722
741
|
target: fieldValue.newTab ? "_blank" : void 0,
|
|
723
742
|
rel: fieldValue.newTab ? "noreferrer" : void 0,
|
|
724
743
|
children: displayText,
|
|
725
744
|
"data-camox-field-id": fieldId,
|
|
726
|
-
|
|
727
|
-
"data-camox-focused": isFocused || void 0,
|
|
745
|
+
...overlayState,
|
|
728
746
|
"data-camox-overlay-mode": options.synced ? "synced" : void 0,
|
|
729
|
-
contentEditable:
|
|
730
|
-
|
|
747
|
+
contentEditable: !isCommentMode,
|
|
748
|
+
onClickCapture: selectField,
|
|
749
|
+
onClick: _temp3,
|
|
731
750
|
onInput: handleInput,
|
|
732
751
|
onFocus: handleFocus,
|
|
733
752
|
onBlur: handleBlur,
|
|
734
753
|
onMouseEnter: t14,
|
|
735
754
|
onMouseLeave: t15,
|
|
736
|
-
onKeyDown:
|
|
755
|
+
onKeyDown: _temp4,
|
|
737
756
|
spellCheck: false,
|
|
738
757
|
suppressContentEditableWarning: true
|
|
739
|
-
};
|
|
740
|
-
const T0 = Popover;
|
|
741
|
-
const t16 = children(linkProps, linkData);
|
|
758
|
+
}, linkData);
|
|
742
759
|
let t17;
|
|
743
|
-
if ($[
|
|
744
|
-
t17 = /* @__PURE__ */ jsx(
|
|
745
|
-
|
|
746
|
-
className: "hover:bg-accent flex items-center gap-1.5 rounded-md px-2 py-1 text-sm transition-colors",
|
|
747
|
-
onMouseDown: _temp4,
|
|
748
|
-
onClick: handleEditLink,
|
|
749
|
-
children: "Edit link"
|
|
750
|
-
});
|
|
751
|
-
$[28] = handleEditLink;
|
|
752
|
-
$[29] = t17;
|
|
753
|
-
} else t17 = $[29];
|
|
754
|
-
let t18;
|
|
755
|
-
if ($[30] !== elementRef || $[31] !== t17) {
|
|
756
|
-
t18 = /* @__PURE__ */ jsx(PopoverContent, {
|
|
757
|
-
className: "w-auto p-2",
|
|
758
|
-
initialFocus: false,
|
|
759
|
-
anchor: elementRef,
|
|
760
|
-
align: "end",
|
|
761
|
-
children: t17
|
|
762
|
-
});
|
|
763
|
-
$[30] = elementRef;
|
|
760
|
+
if ($[30] !== t16) {
|
|
761
|
+
t17 = /* @__PURE__ */ jsx(Fragment, { children: t16 });
|
|
762
|
+
$[30] = t16;
|
|
764
763
|
$[31] = t17;
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
let t19;
|
|
768
|
-
if ($[33] !== T0 || $[34] !== isEditorFocused || $[35] !== t16 || $[36] !== t18) {
|
|
769
|
-
t19 = /* @__PURE__ */ jsxs(T0, {
|
|
770
|
-
open: isEditorFocused,
|
|
771
|
-
children: [t16, t18]
|
|
772
|
-
});
|
|
773
|
-
$[33] = T0;
|
|
774
|
-
$[34] = isEditorFocused;
|
|
775
|
-
$[35] = t16;
|
|
776
|
-
$[36] = t18;
|
|
777
|
-
$[37] = t19;
|
|
778
|
-
} else t19 = $[37];
|
|
779
|
-
return t19;
|
|
764
|
+
} else t17 = $[31];
|
|
765
|
+
return t17;
|
|
780
766
|
};
|
|
781
767
|
const Image = (t0) => {
|
|
782
768
|
const $ = c(22);
|
|
783
|
-
if ($[0] !== "
|
|
769
|
+
if ($[0] !== "9390cfa3e0bf4e772e82a3d1352a7d56d8ae67f112d215b6d45231db17c01883") {
|
|
784
770
|
for (let $i = 0; $i < 22; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
785
|
-
$[0] = "
|
|
771
|
+
$[0] = "9390cfa3e0bf4e772e82a3d1352a7d56d8ae67f112d215b6d45231db17c01883";
|
|
786
772
|
}
|
|
787
773
|
const { name, children } = t0;
|
|
774
|
+
const selectTarget = usePreviewSelection();
|
|
788
775
|
const blockContext = React.use(Context);
|
|
789
776
|
if (!blockContext) throw new Error("Image must be used within a Block Component");
|
|
790
777
|
const { blockId, content, mode } = blockContext;
|
|
@@ -801,7 +788,7 @@ function createEditableBlock(options) {
|
|
|
801
788
|
const overlayItemId = isInlineArrayItem ? repeaterContext.containerItemId : repeaterContext?.itemId;
|
|
802
789
|
const fieldId = overlayItemId != null ? `${blockId}__${overlayItemId}__${overlayFieldName}` : `${blockId}__${overlayFieldName}`;
|
|
803
790
|
const [isHovered, setIsHovered] = React.useState(false);
|
|
804
|
-
const
|
|
791
|
+
const overlayState = useOverlayState(isHovered, useFieldSelection(blockId, overlayFieldName, "Image", overlayItemId));
|
|
805
792
|
let t1;
|
|
806
793
|
if ($[1] !== fieldId) {
|
|
807
794
|
t1 = { fieldId };
|
|
@@ -825,30 +812,29 @@ function createEditableBlock(options) {
|
|
|
825
812
|
}
|
|
826
813
|
React.useEffect(t2, t3);
|
|
827
814
|
let t4;
|
|
828
|
-
if ($[6] !== blockId || $[7] !== isContentEditable || $[8] !== overlayFieldName || $[9] !== overlayItemId) {
|
|
829
|
-
t4 = () => {
|
|
815
|
+
if ($[6] !== blockId || $[7] !== isContentEditable || $[8] !== overlayFieldName || $[9] !== overlayItemId || $[10] !== selectTarget) {
|
|
816
|
+
t4 = (event) => {
|
|
830
817
|
if (!isContentEditable) return;
|
|
831
|
-
|
|
832
|
-
type: "
|
|
818
|
+
selectTarget(overlayItemId != null ? {
|
|
819
|
+
type: "item-field",
|
|
833
820
|
blockId,
|
|
834
821
|
itemId: overlayItemId,
|
|
835
822
|
fieldName: overlayFieldName,
|
|
836
823
|
fieldType: "Image"
|
|
837
|
-
}
|
|
838
|
-
|
|
839
|
-
type: "selectBlockField",
|
|
824
|
+
} : {
|
|
825
|
+
type: "block-field",
|
|
840
826
|
blockId,
|
|
841
827
|
fieldName: overlayFieldName,
|
|
842
828
|
fieldType: "Image"
|
|
843
|
-
});
|
|
844
|
-
previewStore.send({ type: "toggleContentSheet" });
|
|
829
|
+
}, event);
|
|
845
830
|
};
|
|
846
831
|
$[6] = blockId;
|
|
847
832
|
$[7] = isContentEditable;
|
|
848
833
|
$[8] = overlayFieldName;
|
|
849
834
|
$[9] = overlayItemId;
|
|
850
|
-
$[10] =
|
|
851
|
-
|
|
835
|
+
$[10] = selectTarget;
|
|
836
|
+
$[11] = t4;
|
|
837
|
+
} else t4 = $[11];
|
|
852
838
|
const handleClick = t4;
|
|
853
839
|
const imageProps = {
|
|
854
840
|
src: transformImageUrl(fieldValue.url, {
|
|
@@ -862,51 +848,47 @@ function createEditableBlock(options) {
|
|
|
862
848
|
};
|
|
863
849
|
if (!isContentEditable) return /* @__PURE__ */ jsx(Fragment, { children: children(imageProps, fieldValue) });
|
|
864
850
|
const t5 = "image";
|
|
865
|
-
const t6 =
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
$[11] = t10;
|
|
874
|
-
$[12] = t9;
|
|
851
|
+
const t6 = options.synced ? "synced" : void 0;
|
|
852
|
+
let t7;
|
|
853
|
+
let t8;
|
|
854
|
+
if ($[12] === Symbol.for("react.memo_cache_sentinel")) {
|
|
855
|
+
t7 = () => setIsHovered(true);
|
|
856
|
+
t8 = () => setIsHovered(false);
|
|
857
|
+
$[12] = t7;
|
|
858
|
+
$[13] = t8;
|
|
875
859
|
} else {
|
|
876
|
-
|
|
877
|
-
|
|
860
|
+
t7 = $[12];
|
|
861
|
+
t8 = $[13];
|
|
878
862
|
}
|
|
879
|
-
const
|
|
880
|
-
let
|
|
881
|
-
if ($[
|
|
882
|
-
|
|
863
|
+
const t9 = children(imageProps, fieldValue);
|
|
864
|
+
let t10;
|
|
865
|
+
if ($[14] !== fieldId || $[15] !== handleClick || $[16] !== overlayState || $[17] !== t6 || $[18] !== t7 || $[19] !== t8 || $[20] !== t9) {
|
|
866
|
+
t10 = /* @__PURE__ */ jsx("div", {
|
|
883
867
|
"data-camox-field-id": fieldId,
|
|
884
868
|
"data-camox-field-type": t5,
|
|
885
|
-
|
|
886
|
-
"data-camox-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
children: t11
|
|
869
|
+
...overlayState,
|
|
870
|
+
"data-camox-overlay-mode": t6,
|
|
871
|
+
onMouseEnter: t7,
|
|
872
|
+
onMouseLeave: t8,
|
|
873
|
+
onClickCapture: handleClick,
|
|
874
|
+
children: t9
|
|
892
875
|
});
|
|
893
|
-
$[
|
|
894
|
-
$[
|
|
895
|
-
$[
|
|
896
|
-
$[16] = t11;
|
|
876
|
+
$[14] = fieldId;
|
|
877
|
+
$[15] = handleClick;
|
|
878
|
+
$[16] = overlayState;
|
|
897
879
|
$[17] = t6;
|
|
898
880
|
$[18] = t7;
|
|
899
881
|
$[19] = t8;
|
|
900
882
|
$[20] = t9;
|
|
901
|
-
$[21] =
|
|
902
|
-
} else
|
|
903
|
-
return
|
|
883
|
+
$[21] = t10;
|
|
884
|
+
} else t10 = $[21];
|
|
885
|
+
return t10;
|
|
904
886
|
};
|
|
905
887
|
const File = (t0) => {
|
|
906
888
|
const $ = c(9);
|
|
907
|
-
if ($[0] !== "
|
|
889
|
+
if ($[0] !== "9390cfa3e0bf4e772e82a3d1352a7d56d8ae67f112d215b6d45231db17c01883") {
|
|
908
890
|
for (let $i = 0; $i < 9; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
909
|
-
$[0] = "
|
|
891
|
+
$[0] = "9390cfa3e0bf4e772e82a3d1352a7d56d8ae67f112d215b6d45231db17c01883";
|
|
910
892
|
}
|
|
911
893
|
const { name, children } = t0;
|
|
912
894
|
const blockContext = React.use(Context);
|
|
@@ -980,14 +962,17 @@ function createEditableBlock(options) {
|
|
|
980
962
|
const ImageList = _AssetList;
|
|
981
963
|
const FileList = _AssetList;
|
|
982
964
|
const RepeaterItemWrapper = (t0) => {
|
|
983
|
-
const $ = c(
|
|
984
|
-
if ($[0] !== "
|
|
985
|
-
for (let $i = 0; $i <
|
|
986
|
-
$[0] = "
|
|
965
|
+
const $ = c(20);
|
|
966
|
+
if ($[0] !== "9390cfa3e0bf4e772e82a3d1352a7d56d8ae67f112d215b6d45231db17c01883") {
|
|
967
|
+
for (let $i = 0; $i < 20; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
968
|
+
$[0] = "9390cfa3e0bf4e772e82a3d1352a7d56d8ae67f112d215b6d45231db17c01883";
|
|
987
969
|
}
|
|
988
970
|
const { itemId, blockId, mode, children } = t0;
|
|
989
971
|
const isContentEditable = useIsEditable(mode);
|
|
990
972
|
const { window: iframeWindow } = useFrame();
|
|
973
|
+
const selectTarget = usePreviewSelection();
|
|
974
|
+
const isCommentMode = useSelector(previewStore, selectIsCommentMode);
|
|
975
|
+
const [isLocallyHovered, setIsLocallyHovered] = React.useState(false);
|
|
991
976
|
const isRepeaterHovered = React.useContext(RepeaterHoverContext);
|
|
992
977
|
const t1 = String(blockId);
|
|
993
978
|
const t2 = String(itemId);
|
|
@@ -1001,30 +986,71 @@ function createEditableBlock(options) {
|
|
|
1001
986
|
$[2] = t2;
|
|
1002
987
|
$[3] = t3;
|
|
1003
988
|
} else t3 = $[3];
|
|
1004
|
-
const
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
989
|
+
const overlayState = useOverlayState(useOverlayMessage(iframeWindow, isContentEditable, "CAMOX_HOVER_REPEATER_ITEM", "CAMOX_HOVER_REPEATER_ITEM_END", t3) || isRepeaterHovered || isCommentMode && isLocallyHovered);
|
|
990
|
+
let t4;
|
|
991
|
+
if ($[4] !== blockId || $[5] !== isCommentMode || $[6] !== isContentEditable || $[7] !== itemId || $[8] !== selectTarget) {
|
|
992
|
+
t4 = (event) => {
|
|
993
|
+
if (!isContentEditable || !isCommentMode || itemId == null) return;
|
|
994
|
+
const target = event.target;
|
|
995
|
+
if (target.closest("[data-camox-field-id]")) return;
|
|
996
|
+
if (target.closest("[data-camox-repeater-item-id], [data-camox-block-id], [data-camox-comment-block-id]") !== event.currentTarget) return;
|
|
997
|
+
selectTarget({
|
|
998
|
+
type: "item",
|
|
999
|
+
blockId,
|
|
1000
|
+
itemId
|
|
1001
|
+
}, event);
|
|
1002
|
+
};
|
|
1003
|
+
$[4] = blockId;
|
|
1004
|
+
$[5] = isCommentMode;
|
|
1005
|
+
$[6] = isContentEditable;
|
|
1006
|
+
$[7] = itemId;
|
|
1007
|
+
$[8] = selectTarget;
|
|
1008
|
+
$[9] = t4;
|
|
1009
|
+
} else t4 = $[9];
|
|
1010
|
+
const handleClick = t4;
|
|
1011
|
+
const t5 = isContentEditable ? itemId : void 0;
|
|
1008
1012
|
let t6;
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
+
let t7;
|
|
1014
|
+
if ($[10] === Symbol.for("react.memo_cache_sentinel")) {
|
|
1015
|
+
t6 = () => setIsLocallyHovered(true);
|
|
1016
|
+
t7 = () => setIsLocallyHovered(false);
|
|
1017
|
+
$[10] = t6;
|
|
1018
|
+
$[11] = t7;
|
|
1019
|
+
} else {
|
|
1020
|
+
t6 = $[10];
|
|
1021
|
+
t7 = $[11];
|
|
1022
|
+
}
|
|
1023
|
+
let t8;
|
|
1024
|
+
if ($[12] !== isContentEditable || $[13] !== overlayState) {
|
|
1025
|
+
t8 = isContentEditable ? overlayState : {};
|
|
1026
|
+
$[12] = isContentEditable;
|
|
1027
|
+
$[13] = overlayState;
|
|
1028
|
+
$[14] = t8;
|
|
1029
|
+
} else t8 = $[14];
|
|
1030
|
+
let t9;
|
|
1031
|
+
if ($[15] !== children || $[16] !== handleClick || $[17] !== t5 || $[18] !== t8) {
|
|
1032
|
+
t9 = /* @__PURE__ */ jsx("div", {
|
|
1033
|
+
"data-camox-repeater-item-id": t5,
|
|
1034
|
+
onClickCapture: handleClick,
|
|
1035
|
+
onMouseEnter: t6,
|
|
1036
|
+
onMouseLeave: t7,
|
|
1037
|
+
...t8,
|
|
1013
1038
|
"data-camox-overlay-mode": options.synced ? "synced" : void 0,
|
|
1014
1039
|
children
|
|
1015
1040
|
});
|
|
1016
|
-
$[
|
|
1017
|
-
$[
|
|
1018
|
-
$[
|
|
1019
|
-
$[
|
|
1020
|
-
|
|
1021
|
-
|
|
1041
|
+
$[15] = children;
|
|
1042
|
+
$[16] = handleClick;
|
|
1043
|
+
$[17] = t5;
|
|
1044
|
+
$[18] = t8;
|
|
1045
|
+
$[19] = t9;
|
|
1046
|
+
} else t9 = $[19];
|
|
1047
|
+
return t9;
|
|
1022
1048
|
};
|
|
1023
1049
|
const RepeaterHoverProvider = (t0) => {
|
|
1024
1050
|
const $ = c(7);
|
|
1025
|
-
if ($[0] !== "
|
|
1051
|
+
if ($[0] !== "9390cfa3e0bf4e772e82a3d1352a7d56d8ae67f112d215b6d45231db17c01883") {
|
|
1026
1052
|
for (let $i = 0; $i < 7; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
1027
|
-
$[0] = "
|
|
1053
|
+
$[0] = "9390cfa3e0bf4e772e82a3d1352a7d56d8ae67f112d215b6d45231db17c01883";
|
|
1028
1054
|
}
|
|
1029
1055
|
const { blockId, fieldName, children } = t0;
|
|
1030
1056
|
const isContentEditable = useIsEditable("site");
|
|
@@ -1055,9 +1081,9 @@ function createEditableBlock(options) {
|
|
|
1055
1081
|
};
|
|
1056
1082
|
const Repeater = (t0) => {
|
|
1057
1083
|
const $ = c(27);
|
|
1058
|
-
if ($[0] !== "
|
|
1084
|
+
if ($[0] !== "9390cfa3e0bf4e772e82a3d1352a7d56d8ae67f112d215b6d45231db17c01883") {
|
|
1059
1085
|
for (let $i = 0; $i < 27; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
1060
|
-
$[0] = "
|
|
1086
|
+
$[0] = "9390cfa3e0bf4e772e82a3d1352a7d56d8ae67f112d215b6d45231db17c01883";
|
|
1061
1087
|
}
|
|
1062
1088
|
const { name, children } = t0;
|
|
1063
1089
|
const blockContext = React.use(Context);
|
|
@@ -1181,19 +1207,21 @@ function createEditableBlock(options) {
|
|
|
1181
1207
|
return t4;
|
|
1182
1208
|
};
|
|
1183
1209
|
const BlockComponent = (t0) => {
|
|
1184
|
-
const $ = c(
|
|
1185
|
-
if ($[0] !== "
|
|
1186
|
-
for (let $i = 0; $i <
|
|
1187
|
-
$[0] = "
|
|
1210
|
+
const $ = c(74);
|
|
1211
|
+
if ($[0] !== "9390cfa3e0bf4e772e82a3d1352a7d56d8ae67f112d215b6d45231db17c01883") {
|
|
1212
|
+
for (let $i = 0; $i < 74; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
1213
|
+
$[0] = "9390cfa3e0bf4e772e82a3d1352a7d56d8ae67f112d215b6d45231db17c01883";
|
|
1188
1214
|
}
|
|
1189
1215
|
const { blockData, mode, isFirstBlock, showAddBlockTop, showAddBlockBottom, addBlockAfterPosition } = t0;
|
|
1190
1216
|
const isContentEditable = useIsEditable(mode);
|
|
1191
1217
|
const { window: iframeWindow } = useFrame();
|
|
1192
1218
|
const [isHovered, setIsHovered] = React.useState(false);
|
|
1219
|
+
const isCommentMode = useSelector(previewStore, selectIsCommentMode);
|
|
1193
1220
|
const selection = useSelector(previewStore, _temp5);
|
|
1194
|
-
const
|
|
1195
|
-
const
|
|
1221
|
+
const isAddBlockSidebarOpen = useSelector(previewStore, _temp6);
|
|
1222
|
+
const selectTarget = usePreviewSelection();
|
|
1196
1223
|
const isBlockSelected = selection?.blockId === blockData._id;
|
|
1224
|
+
const overlayState = useOverlayState(isHovered && !isBlockSelected, isBlockSelected);
|
|
1197
1225
|
const ref = React.useRef(null);
|
|
1198
1226
|
const [isFirstRender, setIsFirstRender] = React.useState(true);
|
|
1199
1227
|
let t1;
|
|
@@ -1225,89 +1253,92 @@ function createEditableBlock(options) {
|
|
|
1225
1253
|
$[6] = t3;
|
|
1226
1254
|
} else t3 = $[6];
|
|
1227
1255
|
let t4;
|
|
1228
|
-
if ($[7] !== blockData._id || $[8] !== isBlockSelected || $[9] !== isFirstRender
|
|
1256
|
+
if ($[7] !== blockData._id || $[8] !== isBlockSelected || $[9] !== isFirstRender) {
|
|
1229
1257
|
t4 = [
|
|
1230
1258
|
blockData._id,
|
|
1231
1259
|
isBlockSelected,
|
|
1232
|
-
isFirstRender
|
|
1233
|
-
isPageEditorSidebarOpen
|
|
1260
|
+
isFirstRender
|
|
1234
1261
|
];
|
|
1235
1262
|
$[7] = blockData._id;
|
|
1236
1263
|
$[8] = isBlockSelected;
|
|
1237
1264
|
$[9] = isFirstRender;
|
|
1238
|
-
$[10] =
|
|
1239
|
-
|
|
1240
|
-
} else t4 = $[11];
|
|
1265
|
+
$[10] = t4;
|
|
1266
|
+
} else t4 = $[10];
|
|
1241
1267
|
React.useEffect(t3, t4);
|
|
1242
1268
|
const t5 = String(blockData._id);
|
|
1243
1269
|
let t6;
|
|
1244
|
-
if ($[
|
|
1270
|
+
if ($[11] !== t5) {
|
|
1245
1271
|
t6 = { blockId: t5 };
|
|
1246
|
-
$[
|
|
1247
|
-
$[
|
|
1248
|
-
} else t6 = $[
|
|
1272
|
+
$[11] = t5;
|
|
1273
|
+
$[12] = t6;
|
|
1274
|
+
} else t6 = $[12];
|
|
1249
1275
|
const isHoveredFromSidebar = useOverlayMessage(iframeWindow, isContentEditable, "CAMOX_HOVER_BLOCK", "CAMOX_HOVER_BLOCK_END", t6);
|
|
1250
1276
|
let t7;
|
|
1251
1277
|
let t8;
|
|
1252
|
-
if ($[
|
|
1278
|
+
if ($[13] !== isHoveredFromSidebar) {
|
|
1253
1279
|
t7 = () => {
|
|
1254
1280
|
setIsHovered(isHoveredFromSidebar);
|
|
1255
1281
|
};
|
|
1256
1282
|
t8 = [isHoveredFromSidebar];
|
|
1257
|
-
$[
|
|
1258
|
-
$[
|
|
1259
|
-
$[
|
|
1283
|
+
$[13] = isHoveredFromSidebar;
|
|
1284
|
+
$[14] = t7;
|
|
1285
|
+
$[15] = t8;
|
|
1260
1286
|
} else {
|
|
1261
|
-
t7 = $[
|
|
1262
|
-
t8 = $[
|
|
1287
|
+
t7 = $[14];
|
|
1288
|
+
t8 = $[15];
|
|
1263
1289
|
}
|
|
1264
1290
|
React.useEffect(t7, t8);
|
|
1265
1291
|
let result;
|
|
1266
|
-
if ($[
|
|
1292
|
+
if ($[16] !== blockData.content) {
|
|
1267
1293
|
result = { ...blockData.content };
|
|
1268
1294
|
for (const key in result) {
|
|
1269
1295
|
const value = result[key];
|
|
1270
|
-
if (Array.isArray(value) && value.length > 0 && value[0]?.content !== void 0) result[key] = value.map(
|
|
1296
|
+
if (Array.isArray(value) && value.length > 0 && value[0]?.content !== void 0) result[key] = value.map(_temp7);
|
|
1271
1297
|
}
|
|
1272
|
-
$[
|
|
1273
|
-
$[
|
|
1274
|
-
} else result = $[
|
|
1298
|
+
$[16] = blockData.content;
|
|
1299
|
+
$[17] = result;
|
|
1300
|
+
} else result = $[17];
|
|
1275
1301
|
const normalizedContent = result;
|
|
1276
1302
|
let t9;
|
|
1277
|
-
if ($[
|
|
1303
|
+
if ($[18] !== blockData._id || $[19] !== isCommentMode || $[20] !== isContentEditable || $[21] !== selectTarget) {
|
|
1278
1304
|
t9 = (e) => {
|
|
1279
1305
|
if (!isContentEditable) return;
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1306
|
+
const target = e.target;
|
|
1307
|
+
if (target.closest("[data-camox-field-id]")) return;
|
|
1308
|
+
if (isCommentMode && target.closest("[data-camox-repeater-item-id]")) return;
|
|
1309
|
+
if (target.closest("[data-camox-block-id], [data-camox-comment-block-id]") !== e.currentTarget) return;
|
|
1310
|
+
selectTarget({
|
|
1311
|
+
type: "block",
|
|
1283
1312
|
blockId: blockData._id
|
|
1284
|
-
});
|
|
1313
|
+
}, e);
|
|
1285
1314
|
};
|
|
1286
|
-
$[
|
|
1315
|
+
$[18] = blockData._id;
|
|
1316
|
+
$[19] = isCommentMode;
|
|
1287
1317
|
$[20] = isContentEditable;
|
|
1288
|
-
$[21] =
|
|
1289
|
-
|
|
1318
|
+
$[21] = selectTarget;
|
|
1319
|
+
$[22] = t9;
|
|
1320
|
+
} else t9 = $[22];
|
|
1290
1321
|
const handleClick = t9;
|
|
1291
1322
|
let t10;
|
|
1292
|
-
if ($[
|
|
1323
|
+
if ($[23] !== isContentEditable) {
|
|
1293
1324
|
t10 = () => {
|
|
1294
1325
|
if (isContentEditable) setIsHovered(true);
|
|
1295
1326
|
};
|
|
1296
|
-
$[
|
|
1297
|
-
$[
|
|
1298
|
-
} else t10 = $[
|
|
1327
|
+
$[23] = isContentEditable;
|
|
1328
|
+
$[24] = t10;
|
|
1329
|
+
} else t10 = $[24];
|
|
1299
1330
|
const handleMouseEnter = t10;
|
|
1300
1331
|
let t11;
|
|
1301
|
-
if ($[
|
|
1332
|
+
if ($[25] !== isContentEditable) {
|
|
1302
1333
|
t11 = () => {
|
|
1303
1334
|
if (isContentEditable) setIsHovered(false);
|
|
1304
1335
|
};
|
|
1305
|
-
$[
|
|
1306
|
-
$[
|
|
1307
|
-
} else t11 = $[
|
|
1336
|
+
$[25] = isContentEditable;
|
|
1337
|
+
$[26] = t11;
|
|
1338
|
+
} else t11 = $[26];
|
|
1308
1339
|
const handleMouseLeave = t11;
|
|
1309
1340
|
let t12;
|
|
1310
|
-
if ($[
|
|
1341
|
+
if ($[27] !== addBlockAfterPosition || $[28] !== blockData.position) {
|
|
1311
1342
|
t12 = (insertPosition) => {
|
|
1312
1343
|
postOverlayMessage({
|
|
1313
1344
|
type: "CAMOX_ADD_BLOCK_REQUEST",
|
|
@@ -1316,113 +1347,118 @@ function createEditableBlock(options) {
|
|
|
1316
1347
|
...addBlockAfterPosition !== void 0 && { afterPosition: addBlockAfterPosition }
|
|
1317
1348
|
});
|
|
1318
1349
|
};
|
|
1319
|
-
$[
|
|
1320
|
-
$[
|
|
1321
|
-
$[
|
|
1322
|
-
} else t12 = $[
|
|
1350
|
+
$[27] = addBlockAfterPosition;
|
|
1351
|
+
$[28] = blockData.position;
|
|
1352
|
+
$[29] = t12;
|
|
1353
|
+
} else t12 = $[29];
|
|
1323
1354
|
const handleAddBlockClick = t12;
|
|
1324
|
-
const shouldShowOverlay = isContentEditable && (
|
|
1355
|
+
const shouldShowOverlay = isContentEditable && (overlayState["data-camox-hovered"] || overlayState["data-camox-focused"]) && !isAddBlockSidebarOpen;
|
|
1325
1356
|
const shouldShowAddBlockOverlay = isAddBlockSidebarOpen && mode !== "peek";
|
|
1326
1357
|
let t13;
|
|
1327
|
-
if ($[
|
|
1358
|
+
if ($[30] === Symbol.for("react.memo_cache_sentinel")) {
|
|
1328
1359
|
t13 = {
|
|
1329
1360
|
position: "relative",
|
|
1330
1361
|
scrollMargin: "5rem",
|
|
1331
1362
|
background: "var(--background)"
|
|
1332
1363
|
};
|
|
1333
|
-
$[
|
|
1334
|
-
} else t13 = $[
|
|
1364
|
+
$[30] = t13;
|
|
1365
|
+
} else t13 = $[30];
|
|
1335
1366
|
const t14 = isContentEditable ? blockData._id : void 0;
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1367
|
+
let t15;
|
|
1368
|
+
if ($[31] !== overlayState || $[32] !== shouldShowOverlay) {
|
|
1369
|
+
t15 = shouldShowOverlay ? overlayState : {};
|
|
1370
|
+
$[31] = overlayState;
|
|
1371
|
+
$[32] = shouldShowOverlay;
|
|
1372
|
+
$[33] = t15;
|
|
1373
|
+
} else t15 = $[33];
|
|
1374
|
+
const t16 = blockData._id;
|
|
1375
|
+
let t17;
|
|
1376
|
+
if ($[34] !== blockData.content) {
|
|
1377
|
+
t17 = {
|
|
1342
1378
|
...contentDefaults,
|
|
1343
1379
|
...blockData.content
|
|
1344
1380
|
};
|
|
1345
|
-
$[
|
|
1346
|
-
$[
|
|
1347
|
-
} else
|
|
1348
|
-
const merged =
|
|
1381
|
+
$[34] = blockData.content;
|
|
1382
|
+
$[35] = t17;
|
|
1383
|
+
} else t17 = $[35];
|
|
1384
|
+
const merged = t17;
|
|
1349
1385
|
let overrides;
|
|
1350
|
-
if ($[
|
|
1386
|
+
if ($[36] !== merged) {
|
|
1351
1387
|
overrides = {};
|
|
1352
1388
|
for (const key_0 in merged) {
|
|
1353
1389
|
const val = merged[key_0];
|
|
1354
1390
|
if (val && typeof val === "object" && "url" in val && !val.url && contentDefaults[key_0]) overrides[key_0] = contentDefaults[key_0];
|
|
1355
1391
|
}
|
|
1356
|
-
$[
|
|
1357
|
-
$[
|
|
1358
|
-
} else overrides = $[
|
|
1359
|
-
let
|
|
1360
|
-
if ($[
|
|
1361
|
-
|
|
1392
|
+
$[36] = merged;
|
|
1393
|
+
$[37] = overrides;
|
|
1394
|
+
} else overrides = $[37];
|
|
1395
|
+
let t18;
|
|
1396
|
+
if ($[38] !== merged || $[39] !== overrides) {
|
|
1397
|
+
t18 = {
|
|
1362
1398
|
...merged,
|
|
1363
1399
|
...overrides
|
|
1364
1400
|
};
|
|
1365
|
-
$[
|
|
1366
|
-
$[
|
|
1367
|
-
$[
|
|
1368
|
-
} else
|
|
1369
|
-
const
|
|
1370
|
-
let
|
|
1371
|
-
if ($[
|
|
1372
|
-
|
|
1401
|
+
$[38] = merged;
|
|
1402
|
+
$[39] = overrides;
|
|
1403
|
+
$[40] = t18;
|
|
1404
|
+
} else t18 = $[40];
|
|
1405
|
+
const t19 = t18;
|
|
1406
|
+
let t20;
|
|
1407
|
+
if ($[41] !== blockData.settings) {
|
|
1408
|
+
t20 = {
|
|
1373
1409
|
...settingsDefaults,
|
|
1374
1410
|
...blockData.settings
|
|
1375
1411
|
};
|
|
1376
|
-
$[
|
|
1377
|
-
$[
|
|
1378
|
-
} else
|
|
1379
|
-
const
|
|
1380
|
-
let
|
|
1381
|
-
if ($[
|
|
1382
|
-
|
|
1383
|
-
blockId:
|
|
1384
|
-
content:
|
|
1385
|
-
settings:
|
|
1412
|
+
$[41] = blockData.settings;
|
|
1413
|
+
$[42] = t20;
|
|
1414
|
+
} else t20 = $[42];
|
|
1415
|
+
const t21 = t20;
|
|
1416
|
+
let t22;
|
|
1417
|
+
if ($[43] !== blockData._id || $[44] !== isHovered || $[45] !== mode || $[46] !== t19 || $[47] !== t21) {
|
|
1418
|
+
t22 = {
|
|
1419
|
+
blockId: t16,
|
|
1420
|
+
content: t19,
|
|
1421
|
+
settings: t21,
|
|
1386
1422
|
mode,
|
|
1387
1423
|
isHovered,
|
|
1388
1424
|
setIsHovered
|
|
1389
1425
|
};
|
|
1390
|
-
$[
|
|
1391
|
-
$[
|
|
1392
|
-
$[
|
|
1393
|
-
$[
|
|
1394
|
-
$[
|
|
1395
|
-
$[
|
|
1396
|
-
} else
|
|
1426
|
+
$[43] = blockData._id;
|
|
1427
|
+
$[44] = isHovered;
|
|
1428
|
+
$[45] = mode;
|
|
1429
|
+
$[46] = t19;
|
|
1430
|
+
$[47] = t21;
|
|
1431
|
+
$[48] = t22;
|
|
1432
|
+
} else t22 = $[48];
|
|
1433
|
+
let t23;
|
|
1434
|
+
if ($[49] !== normalizedContent) {
|
|
1435
|
+
t23 = /* @__PURE__ */ jsx(options.component, { content: normalizedContent });
|
|
1436
|
+
$[49] = normalizedContent;
|
|
1437
|
+
$[50] = t23;
|
|
1438
|
+
} else t23 = $[50];
|
|
1397
1439
|
let t24;
|
|
1398
|
-
if ($[
|
|
1399
|
-
t24 = /* @__PURE__ */ jsx(
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
} else t24 = $[46];
|
|
1403
|
-
let t25;
|
|
1404
|
-
if ($[47] !== t23 || $[48] !== t24) {
|
|
1405
|
-
t25 = /* @__PURE__ */ jsx(Context.Provider, {
|
|
1406
|
-
value: t23,
|
|
1407
|
-
children: t24
|
|
1440
|
+
if ($[51] !== t22 || $[52] !== t23) {
|
|
1441
|
+
t24 = /* @__PURE__ */ jsx(Context.Provider, {
|
|
1442
|
+
value: t22,
|
|
1443
|
+
children: t23
|
|
1408
1444
|
});
|
|
1409
|
-
$[
|
|
1410
|
-
$[
|
|
1411
|
-
$[
|
|
1412
|
-
} else
|
|
1413
|
-
const
|
|
1414
|
-
let
|
|
1415
|
-
if ($[
|
|
1416
|
-
|
|
1445
|
+
$[51] = t22;
|
|
1446
|
+
$[52] = t23;
|
|
1447
|
+
$[53] = t24;
|
|
1448
|
+
} else t24 = $[53];
|
|
1449
|
+
const t25 = shouldShowAddBlockOverlay || void 0;
|
|
1450
|
+
let t26;
|
|
1451
|
+
if ($[54] !== t25) {
|
|
1452
|
+
t26 = /* @__PURE__ */ jsx("div", {
|
|
1417
1453
|
className: "camox-sheet-overlay",
|
|
1418
|
-
"data-camox-visible":
|
|
1454
|
+
"data-camox-visible": t25
|
|
1419
1455
|
});
|
|
1420
|
-
$[
|
|
1421
|
-
$[
|
|
1422
|
-
} else
|
|
1423
|
-
let
|
|
1424
|
-
if ($[
|
|
1425
|
-
|
|
1456
|
+
$[54] = t25;
|
|
1457
|
+
$[55] = t26;
|
|
1458
|
+
} else t26 = $[55];
|
|
1459
|
+
let t27;
|
|
1460
|
+
if ($[56] !== handleAddBlockClick || $[57] !== isAddBlockSidebarOpen || $[58] !== isCommentMode || $[59] !== isFirstBlock || $[60] !== mode || $[61] !== shouldShowOverlay || $[62] !== showAddBlockBottom || $[63] !== showAddBlockTop) {
|
|
1461
|
+
t27 = shouldShowOverlay && !isCommentMode && /* @__PURE__ */ jsxs(Fragment, { children: [(showAddBlockTop ?? (mode !== "layout" && !isFirstBlock)) && /* @__PURE__ */ jsx(AddBlockControlBar, {
|
|
1426
1462
|
position: "top",
|
|
1427
1463
|
hidden: isAddBlockSidebarOpen,
|
|
1428
1464
|
onMouseLeave: () => setIsHovered(false),
|
|
@@ -1433,46 +1469,45 @@ function createEditableBlock(options) {
|
|
|
1433
1469
|
onMouseLeave: () => setIsHovered(false),
|
|
1434
1470
|
onClick: () => handleAddBlockClick("after")
|
|
1435
1471
|
})] });
|
|
1436
|
-
$[
|
|
1437
|
-
$[
|
|
1438
|
-
$[
|
|
1439
|
-
$[
|
|
1440
|
-
$[
|
|
1441
|
-
$[
|
|
1442
|
-
$[
|
|
1443
|
-
$[
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1472
|
+
$[56] = handleAddBlockClick;
|
|
1473
|
+
$[57] = isAddBlockSidebarOpen;
|
|
1474
|
+
$[58] = isCommentMode;
|
|
1475
|
+
$[59] = isFirstBlock;
|
|
1476
|
+
$[60] = mode;
|
|
1477
|
+
$[61] = shouldShowOverlay;
|
|
1478
|
+
$[62] = showAddBlockBottom;
|
|
1479
|
+
$[63] = showAddBlockTop;
|
|
1480
|
+
$[64] = t27;
|
|
1481
|
+
} else t27 = $[64];
|
|
1482
|
+
let t28;
|
|
1483
|
+
if ($[65] !== handleClick || $[66] !== handleMouseEnter || $[67] !== handleMouseLeave || $[68] !== t14 || $[69] !== t15 || $[70] !== t24 || $[71] !== t26 || $[72] !== t27) {
|
|
1484
|
+
t28 = /* @__PURE__ */ jsxs("div", {
|
|
1448
1485
|
className: "group visual-editing-block",
|
|
1449
1486
|
ref,
|
|
1450
1487
|
style: t13,
|
|
1451
1488
|
"data-camox-block-id": t14,
|
|
1452
|
-
|
|
1453
|
-
"data-camox-focused": t16,
|
|
1489
|
+
...t15,
|
|
1454
1490
|
"data-camox-overlay-mode": options.synced ? "synced" : void 0,
|
|
1455
|
-
|
|
1491
|
+
onClickCapture: handleClick,
|
|
1456
1492
|
onMouseEnter: handleMouseEnter,
|
|
1457
1493
|
onMouseLeave: handleMouseLeave,
|
|
1458
1494
|
children: [
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1495
|
+
t24,
|
|
1496
|
+
t26,
|
|
1497
|
+
t27
|
|
1462
1498
|
]
|
|
1463
1499
|
});
|
|
1464
|
-
$[
|
|
1465
|
-
$[
|
|
1466
|
-
$[
|
|
1467
|
-
$[
|
|
1468
|
-
$[
|
|
1469
|
-
$[
|
|
1470
|
-
$[
|
|
1471
|
-
$[
|
|
1472
|
-
$[
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
return t29;
|
|
1500
|
+
$[65] = handleClick;
|
|
1501
|
+
$[66] = handleMouseEnter;
|
|
1502
|
+
$[67] = handleMouseLeave;
|
|
1503
|
+
$[68] = t14;
|
|
1504
|
+
$[69] = t15;
|
|
1505
|
+
$[70] = t24;
|
|
1506
|
+
$[71] = t26;
|
|
1507
|
+
$[72] = t27;
|
|
1508
|
+
$[73] = t28;
|
|
1509
|
+
} else t28 = $[73];
|
|
1510
|
+
return t28;
|
|
1476
1511
|
};
|
|
1477
1512
|
const useSetting = (name) => {
|
|
1478
1513
|
const ctx = React.use(Context);
|
|
@@ -1484,10 +1519,10 @@ function createEditableBlock(options) {
|
|
|
1484
1519
|
* Provides the same hover, selection, and sheet overlays as the main BlockComponent.
|
|
1485
1520
|
*/
|
|
1486
1521
|
const Detached = (t0) => {
|
|
1487
|
-
const $ = c(
|
|
1488
|
-
if ($[0] !== "
|
|
1489
|
-
for (let $i = 0; $i <
|
|
1490
|
-
$[0] = "
|
|
1522
|
+
const $ = c(32);
|
|
1523
|
+
if ($[0] !== "9390cfa3e0bf4e772e82a3d1352a7d56d8ae67f112d215b6d45231db17c01883") {
|
|
1524
|
+
for (let $i = 0; $i < 32; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
1525
|
+
$[0] = "9390cfa3e0bf4e772e82a3d1352a7d56d8ae67f112d215b6d45231db17c01883";
|
|
1491
1526
|
}
|
|
1492
1527
|
const { children } = t0;
|
|
1493
1528
|
const ctx = React.use(Context);
|
|
@@ -1495,9 +1530,11 @@ function createEditableBlock(options) {
|
|
|
1495
1530
|
const { blockId, mode, isHovered, setIsHovered } = ctx;
|
|
1496
1531
|
const isContentEditable = useIsEditable(mode);
|
|
1497
1532
|
const { window: iframeWindow } = useFrame();
|
|
1498
|
-
const selection = useSelector(previewStore,
|
|
1499
|
-
const isAddBlockSidebarOpen = useSelector(previewStore,
|
|
1533
|
+
const selection = useSelector(previewStore, _temp8);
|
|
1534
|
+
const isAddBlockSidebarOpen = useSelector(previewStore, _temp9);
|
|
1535
|
+
const selectTarget = usePreviewSelection();
|
|
1500
1536
|
const isBlockSelected = selection?.blockId === blockId;
|
|
1537
|
+
const overlayState = useOverlayState(isHovered && !isBlockSelected, isBlockSelected);
|
|
1501
1538
|
const t1 = String(blockId);
|
|
1502
1539
|
let t2;
|
|
1503
1540
|
if ($[1] !== t1) {
|
|
@@ -1522,68 +1559,74 @@ function createEditableBlock(options) {
|
|
|
1522
1559
|
t4 = $[6];
|
|
1523
1560
|
}
|
|
1524
1561
|
React.useEffect(t3, t4);
|
|
1525
|
-
const shouldShowOverlay = isContentEditable && (
|
|
1562
|
+
const shouldShowOverlay = isContentEditable && (overlayState["data-camox-hovered"] || overlayState["data-camox-focused"]) && !isAddBlockSidebarOpen;
|
|
1526
1563
|
const shouldHideForAddBlockSidebar = isAddBlockSidebarOpen && mode !== "peek";
|
|
1527
1564
|
let t5;
|
|
1528
|
-
if ($[7] !== blockId || $[8] !== isContentEditable) {
|
|
1565
|
+
if ($[7] !== blockId || $[8] !== isContentEditable || $[9] !== selectTarget) {
|
|
1529
1566
|
t5 = (e) => {
|
|
1530
1567
|
if (!isContentEditable) return;
|
|
1531
|
-
e.
|
|
1532
|
-
|
|
1533
|
-
|
|
1568
|
+
const target = e.target;
|
|
1569
|
+
if (target.closest("[data-camox-field-id]")) return;
|
|
1570
|
+
if (selectIsCommentMode(previewStore.getSnapshot()) && target.closest("[data-camox-repeater-item-id]")) return;
|
|
1571
|
+
if (target.closest("[data-camox-block-id], [data-camox-comment-block-id]") !== e.currentTarget) return;
|
|
1572
|
+
selectTarget({
|
|
1573
|
+
type: "block",
|
|
1534
1574
|
blockId
|
|
1535
|
-
});
|
|
1575
|
+
}, e);
|
|
1536
1576
|
};
|
|
1537
1577
|
$[7] = blockId;
|
|
1538
1578
|
$[8] = isContentEditable;
|
|
1539
|
-
$[9] =
|
|
1540
|
-
|
|
1579
|
+
$[9] = selectTarget;
|
|
1580
|
+
$[10] = t5;
|
|
1581
|
+
} else t5 = $[10];
|
|
1541
1582
|
const handleClick = t5;
|
|
1542
1583
|
let t6;
|
|
1543
|
-
if ($[
|
|
1584
|
+
if ($[11] !== isContentEditable || $[12] !== setIsHovered) {
|
|
1544
1585
|
t6 = () => {
|
|
1545
1586
|
if (isContentEditable) setIsHovered(true);
|
|
1546
1587
|
};
|
|
1547
|
-
$[
|
|
1548
|
-
$[
|
|
1549
|
-
$[
|
|
1550
|
-
} else t6 = $[
|
|
1588
|
+
$[11] = isContentEditable;
|
|
1589
|
+
$[12] = setIsHovered;
|
|
1590
|
+
$[13] = t6;
|
|
1591
|
+
} else t6 = $[13];
|
|
1551
1592
|
const handleMouseEnter = t6;
|
|
1552
1593
|
let t7;
|
|
1553
|
-
if ($[
|
|
1594
|
+
if ($[14] !== isContentEditable || $[15] !== setIsHovered) {
|
|
1554
1595
|
t7 = () => {
|
|
1555
1596
|
if (isContentEditable) setIsHovered(false);
|
|
1556
1597
|
};
|
|
1557
|
-
$[
|
|
1558
|
-
$[
|
|
1559
|
-
$[
|
|
1560
|
-
} else t7 = $[
|
|
1598
|
+
$[14] = isContentEditable;
|
|
1599
|
+
$[15] = setIsHovered;
|
|
1600
|
+
$[16] = t7;
|
|
1601
|
+
} else t7 = $[16];
|
|
1561
1602
|
const handleMouseLeave = t7;
|
|
1562
1603
|
const [container, setContainer] = React.useState(null);
|
|
1563
|
-
const t8 =
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1604
|
+
const t8 = isContentEditable ? blockId : void 0;
|
|
1605
|
+
const t9 = shouldHideForAddBlockSidebar ? 0 : 1;
|
|
1606
|
+
let t10;
|
|
1607
|
+
if ($[17] !== children || $[18] !== handleClick || $[19] !== handleMouseEnter || $[20] !== handleMouseLeave || $[21] !== t8 || $[22] !== t9) {
|
|
1608
|
+
t10 = children({
|
|
1609
|
+
"data-camox-comment-block-id": t8,
|
|
1567
1610
|
ref: setContainer,
|
|
1568
|
-
style: { opacity:
|
|
1569
|
-
|
|
1611
|
+
style: { opacity: t9 },
|
|
1612
|
+
onClickCapture: handleClick,
|
|
1570
1613
|
onMouseEnter: handleMouseEnter,
|
|
1571
1614
|
onMouseLeave: handleMouseLeave
|
|
1572
1615
|
});
|
|
1573
|
-
$[
|
|
1574
|
-
$[
|
|
1575
|
-
$[
|
|
1576
|
-
$[
|
|
1577
|
-
$[
|
|
1578
|
-
$[
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1616
|
+
$[17] = children;
|
|
1617
|
+
$[18] = handleClick;
|
|
1618
|
+
$[19] = handleMouseEnter;
|
|
1619
|
+
$[20] = handleMouseLeave;
|
|
1620
|
+
$[21] = t8;
|
|
1621
|
+
$[22] = t9;
|
|
1622
|
+
$[23] = t10;
|
|
1623
|
+
} else t10 = $[23];
|
|
1624
|
+
let t11;
|
|
1625
|
+
if ($[24] !== blockId || $[25] !== container || $[26] !== overlayState || $[27] !== shouldShowOverlay) {
|
|
1626
|
+
t11 = container && createPortal(/* @__PURE__ */ jsx(Fragment, { children: shouldShowOverlay && /* @__PURE__ */ jsx("div", {
|
|
1583
1627
|
"data-camox-block-id": blockId,
|
|
1584
1628
|
"data-camox-detached": true,
|
|
1585
|
-
|
|
1586
|
-
"data-camox-focused": isBlockSelected || void 0,
|
|
1629
|
+
...overlayState,
|
|
1587
1630
|
"data-camox-overlay-mode": options.synced ? "synced" : void 0,
|
|
1588
1631
|
style: {
|
|
1589
1632
|
position: "absolute",
|
|
@@ -1591,20 +1634,20 @@ function createEditableBlock(options) {
|
|
|
1591
1634
|
zIndex: 10
|
|
1592
1635
|
}
|
|
1593
1636
|
}) }), container);
|
|
1594
|
-
$[
|
|
1595
|
-
$[
|
|
1596
|
-
$[
|
|
1597
|
-
$[
|
|
1598
|
-
$[
|
|
1599
|
-
} else
|
|
1600
|
-
let
|
|
1601
|
-
if ($[
|
|
1602
|
-
|
|
1603
|
-
$[
|
|
1604
|
-
$[
|
|
1605
|
-
$[
|
|
1606
|
-
} else
|
|
1607
|
-
return
|
|
1637
|
+
$[24] = blockId;
|
|
1638
|
+
$[25] = container;
|
|
1639
|
+
$[26] = overlayState;
|
|
1640
|
+
$[27] = shouldShowOverlay;
|
|
1641
|
+
$[28] = t11;
|
|
1642
|
+
} else t11 = $[28];
|
|
1643
|
+
let t12;
|
|
1644
|
+
if ($[29] !== t10 || $[30] !== t11) {
|
|
1645
|
+
t12 = /* @__PURE__ */ jsxs(Fragment, { children: [t10, t11] });
|
|
1646
|
+
$[29] = t10;
|
|
1647
|
+
$[30] = t11;
|
|
1648
|
+
$[31] = t12;
|
|
1649
|
+
} else t12 = $[31];
|
|
1650
|
+
return t12;
|
|
1608
1651
|
};
|
|
1609
1652
|
return {
|
|
1610
1653
|
Detached,
|
|
@@ -1684,31 +1727,28 @@ function createEditableBlock(options) {
|
|
|
1684
1727
|
function _temp(l) {
|
|
1685
1728
|
return l.pathname;
|
|
1686
1729
|
}
|
|
1687
|
-
function _temp2(
|
|
1688
|
-
return
|
|
1730
|
+
function _temp2(l) {
|
|
1731
|
+
return l.pathname;
|
|
1689
1732
|
}
|
|
1690
|
-
function _temp3(
|
|
1691
|
-
|
|
1733
|
+
function _temp3(e_0) {
|
|
1734
|
+
return e_0.preventDefault();
|
|
1692
1735
|
}
|
|
1693
|
-
function _temp4(
|
|
1694
|
-
|
|
1736
|
+
function _temp4(e_1) {
|
|
1737
|
+
if (e_1.key === "Escape") e_1.target.blur();
|
|
1695
1738
|
}
|
|
1696
1739
|
function _temp5(state) {
|
|
1697
1740
|
return state.context.selection;
|
|
1698
1741
|
}
|
|
1699
1742
|
function _temp6(state_0) {
|
|
1700
|
-
return state_0.context.
|
|
1701
|
-
}
|
|
1702
|
-
function _temp7(state_1) {
|
|
1703
|
-
return state_1.context.isAddBlockSidebarOpen;
|
|
1743
|
+
return state_0.context.isAddBlockSidebarOpen;
|
|
1704
1744
|
}
|
|
1705
|
-
function
|
|
1745
|
+
function _temp7(item) {
|
|
1706
1746
|
return item.content;
|
|
1707
1747
|
}
|
|
1708
|
-
function
|
|
1748
|
+
function _temp8(state) {
|
|
1709
1749
|
return state.context.selection;
|
|
1710
1750
|
}
|
|
1711
|
-
function
|
|
1751
|
+
function _temp9(state_0) {
|
|
1712
1752
|
return state_0.context.isAddBlockSidebarOpen;
|
|
1713
1753
|
}
|
|
1714
1754
|
|