camox 0.65.1 → 0.66.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/features/canvas/CamoxCanvas.js +195 -173
- package/dist/features/canvas/canvasFrameCapture.js +5 -12
- package/dist/features/canvas/canvasFrameDocument.js +90 -29
- package/dist/features/canvas/canvasItems.js +22 -6
- package/dist/features/canvas/sidebar/ContentSidebar.js +19 -21
- package/dist/features/canvas/sidebar/LayoutPageOverview.js +22 -49
- package/dist/features/canvas/sidebar/LayoutPageSeo.js +73 -76
- package/dist/features/canvas/sidebar/PageInspector.js +61 -50
- package/dist/features/canvas/sidebar/PageInspectorSkeleton.js +4 -4
- package/dist/features/canvas/useCanvasCamera.js +22 -5
- package/dist/features/preview/components/PageInfo.js +103 -100
- package/dist/features/runtime/RuntimeChrome.js +66 -40
- package/dist/features/studio/components/AgentSidebar.js +3 -3
- package/dist/features/studio/components/ChatWidget.js +34 -29
- package/dist/features/studio/components/DraftsControl.js +172 -159
- package/dist/features/studio/components/Patrol.js +423 -418
- package/dist/features/studio/components/ReviewDraftSheet.js +227 -188
- package/dist/features/studio/components/ThreadComposer.js +183 -121
- package/dist/features/studio/components/ThreadMessages.js +19 -11
- package/dist/features/studio/components/UnnamedDraftBar.js +349 -0
- package/dist/features/studio/patrollerBio.js +40 -0
- package/dist/features/studio/studioStore.js +13 -0
- package/dist/features/studio/workingSentence.js +2 -7
- package/dist/lib/revisions.js +25 -3
- package/dist/lib/use-thread.js +1 -1
- package/dist/package.js +1 -1
- package/dist/studio.css +1 -1
- package/package.json +4 -4
- package/dist/features/canvas/sidebar/DerivedPageInspector.js +0 -49
- package/dist/features/canvas/sidebar/SingletonPageInspector.js +0 -39
|
@@ -5,8 +5,7 @@ import { CanvasInspectorBody, CanvasInspectorTitle } from "./CanvasInspector.js"
|
|
|
5
5
|
import { PageInspectorSkeleton } from "./PageInspectorSkeleton.js";
|
|
6
6
|
import { PreviewEditingOwnerContext } from "../../preview/previewSelection.js";
|
|
7
7
|
import { CuratedPageInspector } from "./CuratedPageInspector.js";
|
|
8
|
-
import {
|
|
9
|
-
import { SingletonPageInspector } from "./SingletonPageInspector.js";
|
|
8
|
+
import { LayoutPageOverview } from "./LayoutPageOverview.js";
|
|
10
9
|
import { c } from "react/compiler-runtime";
|
|
11
10
|
import * as React from "react";
|
|
12
11
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -38,8 +37,8 @@ var PageInspectorBoundary = class extends React.Component {
|
|
|
38
37
|
}
|
|
39
38
|
};
|
|
40
39
|
function PageInspectorContent(t0) {
|
|
41
|
-
const $ = c(
|
|
42
|
-
const { page,
|
|
40
|
+
const $ = c(12);
|
|
41
|
+
const { page, runtimeBasePath } = t0;
|
|
43
42
|
switch (page.kind) {
|
|
44
43
|
case "curated": {
|
|
45
44
|
let t1;
|
|
@@ -51,31 +50,45 @@ function PageInspectorContent(t0) {
|
|
|
51
50
|
}
|
|
52
51
|
case "singleton": {
|
|
53
52
|
let t1;
|
|
54
|
-
if ($[1] !==
|
|
55
|
-
t1 =
|
|
53
|
+
if ($[1] !== runtimeBasePath) {
|
|
54
|
+
t1 = { runtimeBasePath };
|
|
55
|
+
$[1] = runtimeBasePath;
|
|
56
|
+
$[2] = t1;
|
|
57
|
+
} else t1 = $[2];
|
|
58
|
+
let t2;
|
|
59
|
+
if ($[3] !== page.layoutId || $[4] !== t1) {
|
|
60
|
+
t2 = /* @__PURE__ */ jsx(LayoutPageOverview, {
|
|
56
61
|
layoutId: page.layoutId,
|
|
57
|
-
|
|
62
|
+
target: t1
|
|
58
63
|
});
|
|
59
|
-
$[
|
|
60
|
-
$[
|
|
61
|
-
$[
|
|
62
|
-
} else
|
|
63
|
-
return
|
|
64
|
+
$[3] = page.layoutId;
|
|
65
|
+
$[4] = t1;
|
|
66
|
+
$[5] = t2;
|
|
67
|
+
} else t2 = $[5];
|
|
68
|
+
return t2;
|
|
64
69
|
}
|
|
65
70
|
case "derived": {
|
|
66
71
|
let t1;
|
|
67
|
-
if ($[
|
|
68
|
-
t1 =
|
|
72
|
+
if ($[6] !== page.layoutId || $[7] !== runtimeBasePath) {
|
|
73
|
+
t1 = {
|
|
74
|
+
runtimeBasePath,
|
|
75
|
+
derivedLayoutId: page.layoutId
|
|
76
|
+
};
|
|
77
|
+
$[6] = page.layoutId;
|
|
78
|
+
$[7] = runtimeBasePath;
|
|
79
|
+
$[8] = t1;
|
|
80
|
+
} else t1 = $[8];
|
|
81
|
+
let t2;
|
|
82
|
+
if ($[9] !== page.layoutId || $[10] !== t1) {
|
|
83
|
+
t2 = /* @__PURE__ */ jsx(LayoutPageOverview, {
|
|
69
84
|
layoutId: page.layoutId,
|
|
70
|
-
|
|
71
|
-
runtimeBasePath
|
|
85
|
+
target: t1
|
|
72
86
|
});
|
|
73
|
-
$[
|
|
74
|
-
$[
|
|
75
|
-
$[
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
return t1;
|
|
87
|
+
$[9] = page.layoutId;
|
|
88
|
+
$[10] = t1;
|
|
89
|
+
$[11] = t2;
|
|
90
|
+
} else t2 = $[11];
|
|
91
|
+
return t2;
|
|
79
92
|
}
|
|
80
93
|
}
|
|
81
94
|
}
|
|
@@ -85,8 +98,8 @@ function PageInspectorContent(t0) {
|
|
|
85
98
|
* overview, and the name's header goes back to it.
|
|
86
99
|
*/
|
|
87
100
|
function PageInspector(t0) {
|
|
88
|
-
const $ = c(
|
|
89
|
-
const { page, owner,
|
|
101
|
+
const $ = c(26);
|
|
102
|
+
const { page, owner, runtimeBasePath } = t0;
|
|
90
103
|
const { pathname } = useLocation();
|
|
91
104
|
let t1;
|
|
92
105
|
if ($[0] !== owner) {
|
|
@@ -140,51 +153,49 @@ function PageInspector(t0) {
|
|
|
140
153
|
$[10] = t6;
|
|
141
154
|
} else t6 = $[10];
|
|
142
155
|
let t7;
|
|
143
|
-
if ($[11] !== page || $[12] !==
|
|
156
|
+
if ($[11] !== page || $[12] !== runtimeBasePath) {
|
|
144
157
|
t7 = /* @__PURE__ */ jsx(PageInspectorContent, {
|
|
145
158
|
page,
|
|
146
|
-
pageRecord,
|
|
147
159
|
runtimeBasePath
|
|
148
160
|
});
|
|
149
161
|
$[11] = page;
|
|
150
|
-
$[12] =
|
|
151
|
-
$[13] =
|
|
152
|
-
|
|
153
|
-
} else t7 = $[14];
|
|
162
|
+
$[12] = runtimeBasePath;
|
|
163
|
+
$[13] = t7;
|
|
164
|
+
} else t7 = $[13];
|
|
154
165
|
let t8;
|
|
155
|
-
if ($[
|
|
166
|
+
if ($[14] !== t6 || $[15] !== t7) {
|
|
156
167
|
t8 = /* @__PURE__ */ jsx(React.Suspense, {
|
|
157
168
|
fallback: t6,
|
|
158
169
|
children: t7
|
|
159
170
|
});
|
|
160
|
-
$[
|
|
161
|
-
$[
|
|
162
|
-
$[
|
|
163
|
-
} else t8 = $[
|
|
171
|
+
$[14] = t6;
|
|
172
|
+
$[15] = t7;
|
|
173
|
+
$[16] = t8;
|
|
174
|
+
} else t8 = $[16];
|
|
164
175
|
let t9;
|
|
165
|
-
if ($[
|
|
176
|
+
if ($[17] !== t5 || $[18] !== t8) {
|
|
166
177
|
t9 = /* @__PURE__ */ jsx(PageInspectorBoundary, { children: t8 }, t5);
|
|
167
|
-
$[
|
|
168
|
-
$[
|
|
169
|
-
$[
|
|
170
|
-
} else t9 = $[
|
|
178
|
+
$[17] = t5;
|
|
179
|
+
$[18] = t8;
|
|
180
|
+
$[19] = t9;
|
|
181
|
+
} else t9 = $[19];
|
|
171
182
|
let t10;
|
|
172
|
-
if ($[
|
|
183
|
+
if ($[20] !== owner || $[21] !== t9) {
|
|
173
184
|
t10 = /* @__PURE__ */ jsx(CanvasInspectorBody, { children: /* @__PURE__ */ jsx(PreviewEditingOwnerContext, {
|
|
174
185
|
value: owner,
|
|
175
186
|
children: t9
|
|
176
187
|
}) });
|
|
177
|
-
$[
|
|
178
|
-
$[
|
|
179
|
-
$[
|
|
180
|
-
} else t10 = $[
|
|
188
|
+
$[20] = owner;
|
|
189
|
+
$[21] = t9;
|
|
190
|
+
$[22] = t10;
|
|
191
|
+
} else t10 = $[22];
|
|
181
192
|
let t11;
|
|
182
|
-
if ($[
|
|
193
|
+
if ($[23] !== t10 || $[24] !== t4) {
|
|
183
194
|
t11 = /* @__PURE__ */ jsxs(Fragment, { children: [t4, t10] });
|
|
184
|
-
$[
|
|
185
|
-
$[
|
|
186
|
-
$[
|
|
187
|
-
} else t11 = $[
|
|
195
|
+
$[23] = t10;
|
|
196
|
+
$[24] = t4;
|
|
197
|
+
$[25] = t11;
|
|
198
|
+
} else t11 = $[25];
|
|
188
199
|
return t11;
|
|
189
200
|
}
|
|
190
201
|
function _temp() {
|
|
@@ -61,14 +61,14 @@ function CuratedPageSkeleton() {
|
|
|
61
61
|
} else t0 = $[0];
|
|
62
62
|
return t0;
|
|
63
63
|
}
|
|
64
|
-
/** A layout page's blocks
|
|
64
|
+
/** A layout page's blocks. */
|
|
65
65
|
function LayoutPageSkeleton() {
|
|
66
66
|
const $ = c(1);
|
|
67
67
|
let t0;
|
|
68
68
|
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
69
|
-
t0 = /* @__PURE__ */ jsx(LoadingPage, { children: /* @__PURE__ */
|
|
70
|
-
className: "
|
|
71
|
-
children:
|
|
69
|
+
t0 = /* @__PURE__ */ jsx(LoadingPage, { children: /* @__PURE__ */ jsx("div", {
|
|
70
|
+
className: "px-2 pt-4",
|
|
71
|
+
children: /* @__PURE__ */ jsx(BlocksGroupSkeleton, {})
|
|
72
72
|
}) });
|
|
73
73
|
$[0] = t0;
|
|
74
74
|
} else t0 = $[0];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { canvasStore } from "./canvasStore.js";
|
|
2
2
|
import { ViewportContinuityContext, captureViewportAnchor, resolveViewportAnchor } from "../preview/viewportContinuity.js";
|
|
3
3
|
import { canvasPageIframe } from "../preview/previewPageFrame.js";
|
|
4
|
-
import {
|
|
4
|
+
import { canvasSeamCover } from "./canvasFrameDocument.js";
|
|
5
5
|
import { revealScrollDelta } from "../preview/selectionReveal.js";
|
|
6
6
|
import { CANVAS_WHEEL_ZOOM_RATE, ZOOM_STRETCH, canvasMaximumScale, canvasMinimumScale, canvasOverview, canvasVerticalRail, canvasWheelDelta, constrainCanvasCamera, findCanvasSnapTarget, fitCanvasPage, isCanvasCameraSnapped, isCanvasPageScale, isInCanvasSnapWindow, placeCanvasPageAnchor, snapCanvasZoom, stretchCanvasZoom, unstretchCanvasZoom, zoomCanvasAt } from "./canvasCamera.js";
|
|
7
7
|
import { createCanvasFlight, createCanvasPan } from "./canvasFlight.js";
|
|
@@ -73,7 +73,7 @@ function useCanvasCamera(workspaceKey, initialTarget, row) {
|
|
|
73
73
|
for (const name of CAMERA_PROPERTIES) element.style.removeProperty(name);
|
|
74
74
|
delete element.dataset.canvasPan;
|
|
75
75
|
delete element.dataset.canvasPromoted;
|
|
76
|
-
delete element.dataset.
|
|
76
|
+
delete element.dataset.canvasSeamCover;
|
|
77
77
|
};
|
|
78
78
|
}, []);
|
|
79
79
|
/**
|
|
@@ -289,10 +289,10 @@ function useCanvasCamera(workspaceKey, initialTarget, row) {
|
|
|
289
289
|
};
|
|
290
290
|
const paintAtRest = () => {
|
|
291
291
|
if (settle) return;
|
|
292
|
-
const
|
|
292
|
+
const seamCover = String(canvasSeamCover(camera.scale, ownerWindow.devicePixelRatio));
|
|
293
293
|
const zoom = String(camera.scale);
|
|
294
294
|
for (const element of [viewport, ...mirrors.current]) {
|
|
295
|
-
if (element.dataset.
|
|
295
|
+
if (element.dataset.canvasSeamCover !== seamCover) element.dataset.canvasSeamCover = seamCover;
|
|
296
296
|
if (element.style.getPropertyValue("--canvas-rest-zoom") !== zoom) element.style.setProperty("--canvas-rest-zoom", zoom);
|
|
297
297
|
}
|
|
298
298
|
};
|
|
@@ -426,6 +426,7 @@ function useCanvasCamera(workspaceKey, initialTarget, row) {
|
|
|
426
426
|
};
|
|
427
427
|
animation = requestAnimationFrame(animate);
|
|
428
428
|
};
|
|
429
|
+
let syncedTargets = targets();
|
|
429
430
|
flightControls.current = {
|
|
430
431
|
flyTo: startFlight,
|
|
431
432
|
reveal: (element, immediate) => {
|
|
@@ -451,6 +452,8 @@ function useCanvasCamera(workspaceKey, initialTarget, row) {
|
|
|
451
452
|
syncRow: () => {
|
|
452
453
|
const key = rowRef.current?.selected ?? null;
|
|
453
454
|
const destination = targetOf(key);
|
|
455
|
+
const previousTargets = syncedTargets;
|
|
456
|
+
syncedTargets = targets();
|
|
454
457
|
if (key !== requested) {
|
|
455
458
|
requested = key;
|
|
456
459
|
selection = key;
|
|
@@ -463,6 +466,20 @@ function useCanvasCamera(workspaceKey, initialTarget, row) {
|
|
|
463
466
|
else if (page.left !== flight.page.left || page.width !== flight.page.width) startFlight(page.key);
|
|
464
467
|
return;
|
|
465
468
|
}
|
|
469
|
+
const previous = previousTargets[syncedTargets.findIndex((candidate) => candidate.key === key)];
|
|
470
|
+
if (destination && previous?.key === key && previous.left !== destination.left && previous.width === destination.width && selection === key && !flight && isCanvasCameraSnapped(rest(target), viewportSize, previous)) {
|
|
471
|
+
updateGeometry();
|
|
472
|
+
const fit = fitCanvasPage(viewportSize, destination);
|
|
473
|
+
const next = {
|
|
474
|
+
...fit,
|
|
475
|
+
y: rescaleY(restoredCamera ?? target, fit.scale)
|
|
476
|
+
};
|
|
477
|
+
if (restoredCamera || fittingInitialPage) restoredCamera = next;
|
|
478
|
+
fittingInitialPage = false;
|
|
479
|
+
camera = constrain(camera, true);
|
|
480
|
+
applyCamera(next, true);
|
|
481
|
+
return;
|
|
482
|
+
}
|
|
466
483
|
if (destination && selection === key && !flight && !fittingInitialPage && !isCanvasCameraSnapped(rest(target), viewportSize, destination)) startFlight(destination.key);
|
|
467
484
|
},
|
|
468
485
|
fitAll: startOverviewFlight
|
|
@@ -771,7 +788,7 @@ function useCanvasCamera(workspaceKey, initialTarget, row) {
|
|
|
771
788
|
ownerWindow.removeEventListener("blur", releaseSpace);
|
|
772
789
|
delete viewport.dataset.canvasPan;
|
|
773
790
|
delete viewport.dataset.canvasPromoted;
|
|
774
|
-
delete viewport.dataset.
|
|
791
|
+
delete viewport.dataset.canvasSeamCover;
|
|
775
792
|
paintMirror.current = null;
|
|
776
793
|
};
|
|
777
794
|
}, [workspaceKey, continuity]);
|
|
@@ -11,6 +11,7 @@ import { DebouncedFieldEditor } from "./DebouncedFieldEditor.js";
|
|
|
11
11
|
import { Metadata, MetadataRow, formatRelativeTime } from "./Metadata.js";
|
|
12
12
|
import { useLocalizedPath } from "../../../lib/view-locale.js";
|
|
13
13
|
import { PageInfoSkeleton } from "./PageInfoSkeleton.js";
|
|
14
|
+
import { useLatestRevision } from "../../../lib/revisions.js";
|
|
14
15
|
import { useRendererAnswer } from "../../renderer/RendererFrames.js";
|
|
15
16
|
import { PageLocationFieldset } from "./PageLocationFieldset.js";
|
|
16
17
|
import { PageNicknameField } from "./PageNicknameField.js";
|
|
@@ -1428,62 +1429,64 @@ const SearchEnginePreview = (t0) => {
|
|
|
1428
1429
|
return t10;
|
|
1429
1430
|
};
|
|
1430
1431
|
const SocialPreviewSection = (t0) => {
|
|
1431
|
-
const $ = c(
|
|
1432
|
+
const $ = c(61);
|
|
1432
1433
|
const { page, metaTitle, metaDescription } = t0;
|
|
1433
1434
|
const studioCache = useStudioCache();
|
|
1434
1435
|
const localized = useLocalizedPath();
|
|
1435
|
-
const { scope } = useOptionalDraftScope();
|
|
1436
|
+
const { scope, draftId } = useOptionalDraftScope();
|
|
1437
|
+
const revision = useLatestRevision(draftId);
|
|
1436
1438
|
let t1;
|
|
1437
1439
|
let t2;
|
|
1438
|
-
if ($[0] !== localized || $[1] !== page.fullPath || $[2] !== page.metaDescription || $[3] !== page.metaTitle) {
|
|
1439
|
-
const version = new URLSearchParams({ v: `${page.metaTitle ?? ""}|${page.metaDescription ?? ""}` });
|
|
1440
|
-
if ($[
|
|
1440
|
+
if ($[0] !== localized || $[1] !== page.fullPath || $[2] !== page.metaDescription || $[3] !== page.metaTitle || $[4] !== revision) {
|
|
1441
|
+
const version = new URLSearchParams({ v: `${page.metaTitle ?? ""}|${page.metaDescription ?? ""}|${revision ?? ""}` });
|
|
1442
|
+
if ($[7] !== localized || $[8] !== page.fullPath) {
|
|
1441
1443
|
t1 = pageImageUrl({
|
|
1442
1444
|
origin: "",
|
|
1443
1445
|
path: localized(page.fullPath)
|
|
1444
1446
|
});
|
|
1445
|
-
$[
|
|
1446
|
-
$[
|
|
1447
|
-
$[
|
|
1448
|
-
} else t1 = $[
|
|
1447
|
+
$[7] = localized;
|
|
1448
|
+
$[8] = page.fullPath;
|
|
1449
|
+
$[9] = t1;
|
|
1450
|
+
} else t1 = $[9];
|
|
1449
1451
|
t2 = version.toString();
|
|
1450
1452
|
$[0] = localized;
|
|
1451
1453
|
$[1] = page.fullPath;
|
|
1452
1454
|
$[2] = page.metaDescription;
|
|
1453
1455
|
$[3] = page.metaTitle;
|
|
1454
|
-
$[4] =
|
|
1455
|
-
$[5] =
|
|
1456
|
+
$[4] = revision;
|
|
1457
|
+
$[5] = t1;
|
|
1458
|
+
$[6] = t2;
|
|
1456
1459
|
} else {
|
|
1457
|
-
t1 = $[
|
|
1458
|
-
t2 = $[
|
|
1460
|
+
t1 = $[5];
|
|
1461
|
+
t2 = $[6];
|
|
1459
1462
|
}
|
|
1460
1463
|
const generatedOgImage = `${t1}&${t2}`;
|
|
1461
1464
|
let t3;
|
|
1462
|
-
if ($[
|
|
1465
|
+
if ($[10] !== generatedOgImage || $[11] !== page.customOgImageUrl || $[12] !== scope) {
|
|
1463
1466
|
t3 = page.customOgImageUrl || (scope?.hrefFor(generatedOgImage) ?? generatedOgImage);
|
|
1464
|
-
$[
|
|
1465
|
-
$[
|
|
1466
|
-
$[
|
|
1467
|
-
$[
|
|
1468
|
-
} else t3 = $[
|
|
1467
|
+
$[10] = generatedOgImage;
|
|
1468
|
+
$[11] = page.customOgImageUrl;
|
|
1469
|
+
$[12] = scope;
|
|
1470
|
+
$[13] = t3;
|
|
1471
|
+
} else t3 = $[13];
|
|
1469
1472
|
const ogImage = t3;
|
|
1470
1473
|
const origin = typeof window !== "undefined" ? window.location.origin : "";
|
|
1471
1474
|
let t4;
|
|
1472
|
-
if ($[
|
|
1475
|
+
if ($[14] !== localized || $[15] !== page.fullPath) {
|
|
1473
1476
|
t4 = localized(page.fullPath);
|
|
1474
|
-
$[
|
|
1475
|
-
$[
|
|
1476
|
-
$[
|
|
1477
|
-
} else t4 = $[
|
|
1477
|
+
$[14] = localized;
|
|
1478
|
+
$[15] = page.fullPath;
|
|
1479
|
+
$[16] = t4;
|
|
1480
|
+
} else t4 = $[16];
|
|
1478
1481
|
const url = `${origin}${t4}`;
|
|
1479
1482
|
const fileInputRef = React.useRef(null);
|
|
1480
1483
|
let t5;
|
|
1481
|
-
if ($[
|
|
1484
|
+
if ($[17] === Symbol.for("react.memo_cache_sentinel")) {
|
|
1482
1485
|
t5 = pageMutations.uploadCustomOgImage();
|
|
1483
|
-
$[
|
|
1484
|
-
} else t5 = $[
|
|
1486
|
+
$[17] = t5;
|
|
1487
|
+
} else t5 = $[17];
|
|
1485
1488
|
let t6;
|
|
1486
|
-
if ($[
|
|
1489
|
+
if ($[18] !== page.id || $[19] !== studioCache) {
|
|
1487
1490
|
t6 = {
|
|
1488
1491
|
...t5,
|
|
1489
1492
|
onSuccess: () => {
|
|
@@ -1491,18 +1494,18 @@ const SocialPreviewSection = (t0) => {
|
|
|
1491
1494
|
},
|
|
1492
1495
|
onError: _temp13
|
|
1493
1496
|
};
|
|
1494
|
-
$[
|
|
1495
|
-
$[
|
|
1496
|
-
$[
|
|
1497
|
-
} else t6 = $[
|
|
1497
|
+
$[18] = page.id;
|
|
1498
|
+
$[19] = studioCache;
|
|
1499
|
+
$[20] = t6;
|
|
1500
|
+
} else t6 = $[20];
|
|
1498
1501
|
const uploadCustomOgImage = useMutation(t6);
|
|
1499
1502
|
let t7;
|
|
1500
|
-
if ($[
|
|
1503
|
+
if ($[21] === Symbol.for("react.memo_cache_sentinel")) {
|
|
1501
1504
|
t7 = pageMutations.deleteCustomOgImage();
|
|
1502
|
-
$[
|
|
1503
|
-
} else t7 = $[
|
|
1505
|
+
$[21] = t7;
|
|
1506
|
+
} else t7 = $[21];
|
|
1504
1507
|
let t8;
|
|
1505
|
-
if ($[
|
|
1508
|
+
if ($[22] !== page.id || $[23] !== studioCache) {
|
|
1506
1509
|
t8 = {
|
|
1507
1510
|
...t7,
|
|
1508
1511
|
onSuccess: () => {
|
|
@@ -1510,15 +1513,15 @@ const SocialPreviewSection = (t0) => {
|
|
|
1510
1513
|
},
|
|
1511
1514
|
onError: _temp14
|
|
1512
1515
|
};
|
|
1513
|
-
$[
|
|
1514
|
-
$[
|
|
1515
|
-
$[
|
|
1516
|
-
} else t8 = $[
|
|
1516
|
+
$[22] = page.id;
|
|
1517
|
+
$[23] = studioCache;
|
|
1518
|
+
$[24] = t8;
|
|
1519
|
+
} else t8 = $[24];
|
|
1517
1520
|
const deleteCustomOgImage = useMutation(t8);
|
|
1518
1521
|
const hasCustomImage = !!page.customOgImageUrl;
|
|
1519
1522
|
const isBusy = uploadCustomOgImage.isPending || deleteCustomOgImage.isPending;
|
|
1520
1523
|
let t9;
|
|
1521
|
-
if ($[
|
|
1524
|
+
if ($[25] !== page.id || $[26] !== uploadCustomOgImage) {
|
|
1522
1525
|
t9 = (files) => {
|
|
1523
1526
|
const file = files[0];
|
|
1524
1527
|
if (file) uploadCustomOgImage.mutate({
|
|
@@ -1526,30 +1529,30 @@ const SocialPreviewSection = (t0) => {
|
|
|
1526
1529
|
file
|
|
1527
1530
|
});
|
|
1528
1531
|
};
|
|
1529
|
-
$[
|
|
1530
|
-
$[
|
|
1531
|
-
$[
|
|
1532
|
-
} else t9 = $[
|
|
1532
|
+
$[25] = page.id;
|
|
1533
|
+
$[26] = uploadCustomOgImage;
|
|
1534
|
+
$[27] = t9;
|
|
1535
|
+
} else t9 = $[27];
|
|
1533
1536
|
const handleFiles = t9;
|
|
1534
1537
|
let t10;
|
|
1535
|
-
if ($[
|
|
1538
|
+
if ($[28] === Symbol.for("react.memo_cache_sentinel")) {
|
|
1536
1539
|
t10 = /* @__PURE__ */ jsx(Label, { children: "Social preview" });
|
|
1537
|
-
$[
|
|
1538
|
-
} else t10 = $[
|
|
1540
|
+
$[28] = t10;
|
|
1541
|
+
} else t10 = $[28];
|
|
1539
1542
|
let t11;
|
|
1540
|
-
if ($[
|
|
1543
|
+
if ($[29] === Symbol.for("react.memo_cache_sentinel")) {
|
|
1541
1544
|
t11 = () => fileInputRef.current?.click();
|
|
1542
|
-
$[
|
|
1543
|
-
} else t11 = $[
|
|
1545
|
+
$[29] = t11;
|
|
1546
|
+
} else t11 = $[29];
|
|
1544
1547
|
let t12;
|
|
1545
|
-
if ($[
|
|
1548
|
+
if ($[30] !== uploadCustomOgImage.isPending) {
|
|
1546
1549
|
t12 = uploadCustomOgImage.isPending ? /* @__PURE__ */ jsx(Spinner, {}) : /* @__PURE__ */ jsx(Upload, { className: "size-3.5" });
|
|
1547
|
-
$[
|
|
1548
|
-
$[
|
|
1549
|
-
} else t12 = $[
|
|
1550
|
+
$[30] = uploadCustomOgImage.isPending;
|
|
1551
|
+
$[31] = t12;
|
|
1552
|
+
} else t12 = $[31];
|
|
1550
1553
|
const t13 = hasCustomImage ? "Replace custom image" : "Upload custom image";
|
|
1551
1554
|
let t14;
|
|
1552
|
-
if ($[
|
|
1555
|
+
if ($[32] !== isBusy || $[33] !== t12 || $[34] !== t13) {
|
|
1553
1556
|
t14 = /* @__PURE__ */ jsxs(Button, {
|
|
1554
1557
|
type: "button",
|
|
1555
1558
|
variant: "secondary",
|
|
@@ -1558,13 +1561,13 @@ const SocialPreviewSection = (t0) => {
|
|
|
1558
1561
|
onClick: t11,
|
|
1559
1562
|
children: [t12, t13]
|
|
1560
1563
|
});
|
|
1561
|
-
$[
|
|
1562
|
-
$[
|
|
1563
|
-
$[
|
|
1564
|
-
$[
|
|
1565
|
-
} else t14 = $[
|
|
1564
|
+
$[32] = isBusy;
|
|
1565
|
+
$[33] = t12;
|
|
1566
|
+
$[34] = t13;
|
|
1567
|
+
$[35] = t14;
|
|
1568
|
+
} else t14 = $[35];
|
|
1566
1569
|
let t15;
|
|
1567
|
-
if ($[
|
|
1570
|
+
if ($[36] !== deleteCustomOgImage || $[37] !== hasCustomImage || $[38] !== isBusy || $[39] !== page.id) {
|
|
1568
1571
|
t15 = hasCustomImage && /* @__PURE__ */ jsxs(Button, {
|
|
1569
1572
|
type: "button",
|
|
1570
1573
|
variant: "ghost",
|
|
@@ -1577,14 +1580,14 @@ const SocialPreviewSection = (t0) => {
|
|
|
1577
1580
|
"Clear"
|
|
1578
1581
|
]
|
|
1579
1582
|
});
|
|
1580
|
-
$[
|
|
1581
|
-
$[
|
|
1582
|
-
$[
|
|
1583
|
-
$[
|
|
1584
|
-
$[
|
|
1585
|
-
} else t15 = $[
|
|
1583
|
+
$[36] = deleteCustomOgImage;
|
|
1584
|
+
$[37] = hasCustomImage;
|
|
1585
|
+
$[38] = isBusy;
|
|
1586
|
+
$[39] = page.id;
|
|
1587
|
+
$[40] = t15;
|
|
1588
|
+
} else t15 = $[40];
|
|
1586
1589
|
let t16;
|
|
1587
|
-
if ($[
|
|
1590
|
+
if ($[41] !== handleFiles) {
|
|
1588
1591
|
t16 = /* @__PURE__ */ jsx("input", {
|
|
1589
1592
|
type: "file",
|
|
1590
1593
|
ref: fileInputRef,
|
|
@@ -1595,11 +1598,11 @@ const SocialPreviewSection = (t0) => {
|
|
|
1595
1598
|
e.target.value = "";
|
|
1596
1599
|
}
|
|
1597
1600
|
});
|
|
1598
|
-
$[
|
|
1599
|
-
$[
|
|
1600
|
-
} else t16 = $[
|
|
1601
|
+
$[41] = handleFiles;
|
|
1602
|
+
$[42] = t16;
|
|
1603
|
+
} else t16 = $[42];
|
|
1601
1604
|
let t17;
|
|
1602
|
-
if ($[
|
|
1605
|
+
if ($[43] !== t14 || $[44] !== t15 || $[45] !== t16) {
|
|
1603
1606
|
t17 = /* @__PURE__ */ jsxs("div", {
|
|
1604
1607
|
className: "flex items-center gap-2",
|
|
1605
1608
|
children: [
|
|
@@ -1608,47 +1611,47 @@ const SocialPreviewSection = (t0) => {
|
|
|
1608
1611
|
t16
|
|
1609
1612
|
]
|
|
1610
1613
|
});
|
|
1611
|
-
$[
|
|
1612
|
-
$[
|
|
1613
|
-
$[
|
|
1614
|
-
$[
|
|
1615
|
-
} else t17 = $[
|
|
1614
|
+
$[43] = t14;
|
|
1615
|
+
$[44] = t15;
|
|
1616
|
+
$[45] = t16;
|
|
1617
|
+
$[46] = t17;
|
|
1618
|
+
} else t17 = $[46];
|
|
1616
1619
|
const t18 = hasCustomImage ? "Drop image to replace" : "Drop image to upload";
|
|
1617
1620
|
let t19;
|
|
1618
|
-
if ($[
|
|
1621
|
+
if ($[47] !== ogImage) {
|
|
1619
1622
|
t19 = /* @__PURE__ */ jsx(SocialPreviewImage, { src: ogImage });
|
|
1620
|
-
$[
|
|
1621
|
-
$[
|
|
1622
|
-
} else t19 = $[
|
|
1623
|
+
$[47] = ogImage;
|
|
1624
|
+
$[48] = t19;
|
|
1625
|
+
} else t19 = $[48];
|
|
1623
1626
|
let t20;
|
|
1624
|
-
if ($[
|
|
1627
|
+
if ($[49] !== handleFiles || $[50] !== t18 || $[51] !== t19) {
|
|
1625
1628
|
t20 = /* @__PURE__ */ jsx(UploadDropZone, {
|
|
1626
1629
|
onDrop: handleFiles,
|
|
1627
1630
|
label: t18,
|
|
1628
1631
|
className: "block",
|
|
1629
1632
|
children: t19
|
|
1630
1633
|
});
|
|
1631
|
-
$[
|
|
1632
|
-
$[
|
|
1633
|
-
$[
|
|
1634
|
-
$[
|
|
1635
|
-
} else t20 = $[
|
|
1634
|
+
$[49] = handleFiles;
|
|
1635
|
+
$[50] = t18;
|
|
1636
|
+
$[51] = t19;
|
|
1637
|
+
$[52] = t20;
|
|
1638
|
+
} else t20 = $[52];
|
|
1636
1639
|
let t21;
|
|
1637
|
-
if ($[
|
|
1640
|
+
if ($[53] !== metaDescription || $[54] !== metaTitle || $[55] !== t20 || $[56] !== url) {
|
|
1638
1641
|
t21 = /* @__PURE__ */ jsx(SocialPreviewCard, {
|
|
1639
1642
|
image: t20,
|
|
1640
1643
|
metaTitle,
|
|
1641
1644
|
metaDescription,
|
|
1642
1645
|
url
|
|
1643
1646
|
});
|
|
1644
|
-
$[
|
|
1645
|
-
$[
|
|
1646
|
-
$[
|
|
1647
|
-
$[
|
|
1648
|
-
$[
|
|
1649
|
-
} else t21 = $[
|
|
1647
|
+
$[53] = metaDescription;
|
|
1648
|
+
$[54] = metaTitle;
|
|
1649
|
+
$[55] = t20;
|
|
1650
|
+
$[56] = url;
|
|
1651
|
+
$[57] = t21;
|
|
1652
|
+
} else t21 = $[57];
|
|
1650
1653
|
let t22;
|
|
1651
|
-
if ($[
|
|
1654
|
+
if ($[58] !== t17 || $[59] !== t21) {
|
|
1652
1655
|
t22 = /* @__PURE__ */ jsxs("div", {
|
|
1653
1656
|
className: "space-y-2 pt-2",
|
|
1654
1657
|
children: [
|
|
@@ -1657,10 +1660,10 @@ const SocialPreviewSection = (t0) => {
|
|
|
1657
1660
|
t21
|
|
1658
1661
|
]
|
|
1659
1662
|
});
|
|
1660
|
-
$[
|
|
1661
|
-
$[
|
|
1662
|
-
$[
|
|
1663
|
-
} else t22 = $[
|
|
1663
|
+
$[58] = t17;
|
|
1664
|
+
$[59] = t21;
|
|
1665
|
+
$[60] = t22;
|
|
1666
|
+
} else t22 = $[60];
|
|
1664
1667
|
return t22;
|
|
1665
1668
|
};
|
|
1666
1669
|
const SocialPreviewImage = (t0) => {
|