camox 0.42.0 → 0.44.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/bin/camox.mjs +9 -1
- package/dist/core/components/lexical/{GradientNode.js → HighlightNode.js} +34 -34
- package/dist/core/components/lexical/InlineLexicalEditor.js +14 -14
- package/dist/core/components/lexical/InlineStylesPlugin.js +25 -9
- package/dist/core/components/lexical/SelectionBroadcaster.js +7 -7
- package/dist/core/components/lexical/SidebarLexicalEditor.js +24 -24
- package/dist/core/components/lexical/TextLinkPopover.js +191 -208
- package/dist/core/components/lexical/editorConfig.js +2 -2
- package/dist/core/createApp.d.ts +31 -4
- package/dist/core/createApp.js +2 -1
- package/dist/core/createBlock.js +24 -10
- package/dist/core/createLayout.d.ts +16 -3
- package/dist/core/createLayout.js +15 -15
- package/dist/core/derivedRoutes.js +1 -1
- package/dist/core/dom.d.ts +17 -0
- package/dist/core/dom.js +22 -0
- package/dist/core/editing/createEditableBlock.d.ts +135 -1
- package/dist/core/editing/createEditableBlock.js +209 -74
- package/dist/core/lib/contentType.d.ts +5 -0
- package/dist/core/lib/contentType.js +11 -0
- package/dist/core/lib/fieldTypes.js +1 -0
- package/dist/core/lib/iconTypes.d.ts +13 -0
- package/dist/core/lib/icons.d.ts +6 -0
- package/dist/core/lib/icons.js +130 -0
- package/dist/core/lib/lexicalReact.js +4 -4
- package/dist/core/lib/lexicalState.js +8 -8
- package/dist/core/lib/modifierFormats.js +2 -2
- package/dist/core/lib/textLinks.js +5 -2
- package/dist/core/lib/textStyles.d.ts +3 -3
- package/dist/core/lib/textStyles.js +9 -14
- package/dist/core/pageDestinations.js +37 -0
- package/dist/features/content/components/AssetCard.js +104 -68
- package/dist/features/og/imageResponse.node.js +11 -9
- package/dist/features/preview/CamoxPreview.js +148 -146
- package/dist/features/preview/commentsEnabled.js +2 -2
- package/dist/features/preview/components/AddBlockSidebar.js +1 -1
- package/dist/features/preview/components/AssetLightbox.js +17 -6
- package/dist/features/preview/components/AttachedComments.js +224 -87
- package/dist/features/preview/components/BlockActionsPopover.js +1 -1
- package/dist/features/preview/components/CommentTargetQuote.js +22 -21
- package/dist/features/preview/components/CreatePageModal.js +4 -4
- package/dist/features/preview/components/DerivedLayoutDialog.js +36 -21
- package/dist/features/preview/components/DerivedLayoutSidebar.js +45 -26
- package/dist/features/preview/components/DerivedPageInfoSidebar.js +38 -26
- package/dist/features/preview/components/FieldOverlayStyles.js +29 -9
- package/dist/features/preview/components/FieldToolbar.js +12 -12
- package/dist/features/preview/components/IconFieldEditor.js +231 -0
- package/dist/features/preview/components/ItemFieldsEditor.js +21 -14
- package/dist/features/preview/components/LinkFieldEditor.js +212 -209
- package/dist/features/preview/components/OverlayTracker.js +1 -1
- package/dist/features/preview/components/PageEditorSidebar.js +1 -1
- package/dist/features/preview/components/PageInfoSidebar.js +28 -28
- package/dist/features/preview/components/PagePicker.js +46 -46
- package/dist/features/preview/components/PageTree.js +1 -1
- package/dist/features/preview/components/PreviewPanel.js +1 -1
- package/dist/features/preview/components/PreviewToolbar.js +224 -225
- package/dist/features/preview/components/PublicationRow.js +8 -4
- package/dist/features/preview/components/SendFeedbackDialog.js +83 -0
- package/dist/features/preview/components/useRepeatableItemActions.js +1 -1
- package/dist/features/preview/overlayHighlights.js +54 -0
- package/dist/features/preview/previewCommentsStore.js +54 -34
- package/dist/features/preview/previewSelection.js +28 -23
- package/dist/features/preview/publication.js +10 -0
- package/dist/features/preview/usePageComments.js +39 -0
- package/dist/features/provider/CoreCamoxProvider.js +38 -6
- package/dist/features/provider/LocalhostPreviewProvider.js +81 -45
- package/dist/features/provider/components/CommandPalette.js +35 -84
- package/dist/features/runtime/pageApp.js +32 -28
- package/dist/features/runtime/pageServer.js +4 -1
- package/dist/features/runtime/runtime.d.ts +2 -0
- package/dist/features/runtime/runtime.js +45 -21
- package/dist/features/studio/components/EnvironmentMenu.js +76 -63
- package/dist/features/studio/components/Navbar.js +53 -80
- package/dist/features/vite/auth.js +1 -50
- package/dist/features/vite/iconGeneration.js +16 -0
- package/dist/features/vite/layoutGeneration.js +7 -3
- package/dist/features/vite/vite.d.ts +4 -2
- package/dist/features/vite/vite.js +24 -3
- package/dist/hooks/use-page-destinations.js +53 -0
- package/dist/lib/auth.js +40 -20
- package/dist/lib/preview-handoff.js +13 -0
- package/dist/lib/queries.js +12 -1
- package/dist/lib/server-auth-cookie.js +21 -0
- package/dist/lib/use-project-room.js +5 -2
- package/dist/studio-overlays.css +19 -15
- package/dist/studio.css +1 -1
- package/package.json +9 -4
- package/skills/camox/SKILL.md +38 -9
- package/skills/camox/references/block-definitions.md +107 -286
- package/skills/camox/references/cli-common.md +16 -4
- package/skills/camox/references/cli-content.md +158 -0
- package/skills/camox/references/cli-environments.md +1 -1
- package/skills/camox/references/dom-integrations.md +93 -0
- package/skills/camox/references/field-styling.md +50 -0
- package/skills/camox/references/layout-definitions.md +33 -147
- package/skills/camox/references/routed-layouts.md +71 -0
- package/skills/camoxify/SKILL.md +66 -0
- package/skills/camox/references/cli-blocks.md +0 -78
- package/skills/camox/references/cli-pages.md +0 -53
|
@@ -4,11 +4,13 @@ import { useIsAuthenticated, useProjectSlug } from "../../lib/auth.js";
|
|
|
4
4
|
import { getApiClient } from "../../lib/api-client.js";
|
|
5
5
|
import { NormalizedDataProvider, seedBlockCaches, usePageBlocks } from "../../lib/normalized-data.js";
|
|
6
6
|
import { BlockErrorBoundary } from "./components/BlockErrorBoundary.js";
|
|
7
|
-
import { blockQueries, pageQueries, projectQueries } from "../../lib/queries.js";
|
|
8
|
-
import { cn } from "../../lib/utils.js";
|
|
9
7
|
import { useCamoxApp } from "../provider/components/CamoxAppContext.js";
|
|
8
|
+
import { blockQueries } from "../../lib/queries.js";
|
|
9
|
+
import { usePageDestinations } from "../../hooks/use-page-destinations.js";
|
|
10
|
+
import { cn } from "../../lib/utils.js";
|
|
10
11
|
import { SharedChromeContext } from "../runtime/SharedChromeContext.js";
|
|
11
|
-
import {
|
|
12
|
+
import { areCommentsEnabled } from "./commentsEnabled.js";
|
|
13
|
+
import { previewStore, selectIsCommentMode, selectIsEditMode, selectPreviewSource } from "./previewStore.js";
|
|
12
14
|
import { Navbar } from "../studio/components/Navbar.js";
|
|
13
15
|
import { CreatePageModal } from "./components/CreatePageModal.js";
|
|
14
16
|
import { EDIT_MODE_SHORTCUT } from "./previewConstants.js";
|
|
@@ -18,7 +20,7 @@ import { PreviewPanel } from "./components/PreviewPanel.js";
|
|
|
18
20
|
import { PreviewToolbarSpacer } from "./components/PreviewToolbarSpacer.js";
|
|
19
21
|
import { RightSidebar } from "./components/RightSidebar.js";
|
|
20
22
|
import { c } from "react/compiler-runtime";
|
|
21
|
-
import {
|
|
23
|
+
import { useQueryClient, useSuspenseQuery } from "@tanstack/react-query";
|
|
22
24
|
import * as React from "react";
|
|
23
25
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
24
26
|
import { useSelector } from "@xstate/store-react";
|
|
@@ -36,9 +38,9 @@ function getMobileStudioSnapshot() {
|
|
|
36
38
|
}
|
|
37
39
|
function useIsMobileStudio() {
|
|
38
40
|
const $ = c(1);
|
|
39
|
-
if ($[0] !== "
|
|
41
|
+
if ($[0] !== "1f7f5b8cfc80775a4d8d5a69dedeb5c289bf8de78288daf387d6edc5d5f0b09c") {
|
|
40
42
|
for (let $i = 0; $i < 1; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
41
|
-
$[0] = "
|
|
43
|
+
$[0] = "1f7f5b8cfc80775a4d8d5a69dedeb5c289bf8de78288daf387d6edc5d5f0b09c";
|
|
42
44
|
}
|
|
43
45
|
return React.useSyncExternalStore(subscribeToMobileStudio, getMobileStudioSnapshot, _temp);
|
|
44
46
|
}
|
|
@@ -71,9 +73,9 @@ function pageStructureQueryFn(path, projectSlug, source) {
|
|
|
71
73
|
}
|
|
72
74
|
function usePreviewedPage() {
|
|
73
75
|
const $ = c(11);
|
|
74
|
-
if ($[0] !== "
|
|
76
|
+
if ($[0] !== "1f7f5b8cfc80775a4d8d5a69dedeb5c289bf8de78288daf387d6edc5d5f0b09c") {
|
|
75
77
|
for (let $i = 0; $i < 11; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
76
|
-
$[0] = "
|
|
78
|
+
$[0] = "1f7f5b8cfc80775a4d8d5a69dedeb5c289bf8de78288daf387d6edc5d5f0b09c";
|
|
77
79
|
}
|
|
78
80
|
const { pathname } = useLocation();
|
|
79
81
|
const projectSlug = useProjectSlug();
|
|
@@ -109,9 +111,9 @@ function usePreviewedPage() {
|
|
|
109
111
|
}
|
|
110
112
|
const BlockRenderer = (t0) => {
|
|
111
113
|
const $ = c(23);
|
|
112
|
-
if ($[0] !== "
|
|
114
|
+
if ($[0] !== "1f7f5b8cfc80775a4d8d5a69dedeb5c289bf8de78288daf387d6edc5d5f0b09c") {
|
|
113
115
|
for (let $i = 0; $i < 23; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
114
|
-
$[0] = "
|
|
116
|
+
$[0] = "1f7f5b8cfc80775a4d8d5a69dedeb5c289bf8de78288daf387d6edc5d5f0b09c";
|
|
115
117
|
}
|
|
116
118
|
const { blockId, mode, showAddBlockTop, showAddBlockBottom } = t0;
|
|
117
119
|
const previewSource = useSelector(previewStore, selectPreviewSource);
|
|
@@ -254,9 +256,9 @@ const PageContent = () => {
|
|
|
254
256
|
};
|
|
255
257
|
function useHydrateDraftCache() {
|
|
256
258
|
const $ = c(7);
|
|
257
|
-
if ($[0] !== "
|
|
259
|
+
if ($[0] !== "1f7f5b8cfc80775a4d8d5a69dedeb5c289bf8de78288daf387d6edc5d5f0b09c") {
|
|
258
260
|
for (let $i = 0; $i < 7; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
259
|
-
$[0] = "
|
|
261
|
+
$[0] = "1f7f5b8cfc80775a4d8d5a69dedeb5c289bf8de78288daf387d6edc5d5f0b09c";
|
|
260
262
|
}
|
|
261
263
|
const isAuthenticated = useIsAuthenticated();
|
|
262
264
|
const queryClient = useQueryClient();
|
|
@@ -307,9 +309,9 @@ function useHydrateDraftCache() {
|
|
|
307
309
|
function _temp2() {}
|
|
308
310
|
const CamoxPreview = (t0) => {
|
|
309
311
|
const $ = c(4);
|
|
310
|
-
if ($[0] !== "
|
|
312
|
+
if ($[0] !== "1f7f5b8cfc80775a4d8d5a69dedeb5c289bf8de78288daf387d6edc5d5f0b09c") {
|
|
311
313
|
for (let $i = 0; $i < 4; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
312
|
-
$[0] = "
|
|
314
|
+
$[0] = "1f7f5b8cfc80775a4d8d5a69dedeb5c289bf8de78288daf387d6edc5d5f0b09c";
|
|
313
315
|
}
|
|
314
316
|
const { children } = t0;
|
|
315
317
|
const pageData = usePreviewedPage();
|
|
@@ -328,10 +330,10 @@ const CamoxPreview = (t0) => {
|
|
|
328
330
|
};
|
|
329
331
|
/** Studio chrome is shared; only curated previews require a Camox page record. */
|
|
330
332
|
const PreviewShell = (t0) => {
|
|
331
|
-
const $ = c(
|
|
332
|
-
if ($[0] !== "
|
|
333
|
-
for (let $i = 0; $i <
|
|
334
|
-
$[0] = "
|
|
333
|
+
const $ = c(61);
|
|
334
|
+
if ($[0] !== "1f7f5b8cfc80775a4d8d5a69dedeb5c289bf8de78288daf387d6edc5d5f0b09c") {
|
|
335
|
+
for (let $i = 0; $i < 61; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
336
|
+
$[0] = "1f7f5b8cfc80775a4d8d5a69dedeb5c289bf8de78288daf387d6edc5d5f0b09c";
|
|
335
337
|
}
|
|
336
338
|
const { children, pageData, hasLiveVersion: t1, derivedLayoutId, derivedLayout } = t0;
|
|
337
339
|
const hasLiveVersion = t1 === void 0 ? false : t1;
|
|
@@ -339,6 +341,7 @@ const PreviewShell = (t0) => {
|
|
|
339
341
|
const isMobileStudio = useIsMobileStudio();
|
|
340
342
|
const sharedChrome = React.useContext(SharedChromeContext);
|
|
341
343
|
const isEditMode = useSelector(previewStore, selectIsEditMode);
|
|
344
|
+
const isCommentMode = useSelector(previewStore, selectIsCommentMode);
|
|
342
345
|
const isToolbarHidden = useSelector(previewStore, _temp3);
|
|
343
346
|
const isAddBlockSidebarOpen = useSelector(previewStore, _temp4);
|
|
344
347
|
const previewSource = useSelector(previewStore, selectPreviewSource);
|
|
@@ -362,7 +365,7 @@ const PreviewShell = (t0) => {
|
|
|
362
365
|
React.useEffect(t2, t3);
|
|
363
366
|
let t4;
|
|
364
367
|
let t5;
|
|
365
|
-
if ($[4] !== hasLiveCheckpoint || $[5] !== isAuthenticated || $[6] !==
|
|
368
|
+
if ($[4] !== hasLiveCheckpoint || $[5] !== isAuthenticated || $[6] !== isCommentMode || $[7] !== isEditMode || $[8] !== isMobileStudio || $[9] !== pageData || $[10] !== previewSource) {
|
|
366
369
|
t4 = () => {
|
|
367
370
|
const actions = [
|
|
368
371
|
{
|
|
@@ -392,6 +395,25 @@ const PreviewShell = (t0) => {
|
|
|
392
395
|
execute: _temp6,
|
|
393
396
|
shortcut: EDIT_MODE_SHORTCUT
|
|
394
397
|
},
|
|
398
|
+
{
|
|
399
|
+
id: "enter-comment-mode",
|
|
400
|
+
label: "Leave feedback",
|
|
401
|
+
aliases: [
|
|
402
|
+
"Comment",
|
|
403
|
+
"Comment mode",
|
|
404
|
+
"Show feedback"
|
|
405
|
+
],
|
|
406
|
+
groupLabel: "Preview",
|
|
407
|
+
checkIfAvailable: () => isAuthenticated && !isMobileStudio && pageData != null && areCommentsEnabled() && !isCommentMode,
|
|
408
|
+
execute: () => {
|
|
409
|
+
if (!isEditMode) previewStore.send({ type: "enterEditMode" });
|
|
410
|
+
previewStore.send({
|
|
411
|
+
type: "setCommentMode",
|
|
412
|
+
enabled: true
|
|
413
|
+
});
|
|
414
|
+
},
|
|
415
|
+
shortcut: { key: "c" }
|
|
416
|
+
},
|
|
395
417
|
{
|
|
396
418
|
id: "preview-live-content",
|
|
397
419
|
label: "Preview live content",
|
|
@@ -447,43 +469,47 @@ const PreviewShell = (t0) => {
|
|
|
447
469
|
};
|
|
448
470
|
t5 = [
|
|
449
471
|
isEditMode,
|
|
472
|
+
isCommentMode,
|
|
450
473
|
isAuthenticated,
|
|
451
474
|
isMobileStudio,
|
|
475
|
+
pageData,
|
|
452
476
|
previewSource,
|
|
453
477
|
hasLiveCheckpoint
|
|
454
478
|
];
|
|
455
479
|
$[4] = hasLiveCheckpoint;
|
|
456
480
|
$[5] = isAuthenticated;
|
|
457
|
-
$[6] =
|
|
458
|
-
$[7] =
|
|
459
|
-
$[8] =
|
|
460
|
-
$[9] =
|
|
461
|
-
$[10] =
|
|
481
|
+
$[6] = isCommentMode;
|
|
482
|
+
$[7] = isEditMode;
|
|
483
|
+
$[8] = isMobileStudio;
|
|
484
|
+
$[9] = pageData;
|
|
485
|
+
$[10] = previewSource;
|
|
486
|
+
$[11] = t4;
|
|
487
|
+
$[12] = t5;
|
|
462
488
|
} else {
|
|
463
|
-
t4 = $[
|
|
464
|
-
t5 = $[
|
|
489
|
+
t4 = $[11];
|
|
490
|
+
t5 = $[12];
|
|
465
491
|
}
|
|
466
492
|
React.useEffect(t4, t5);
|
|
467
493
|
if (!isAuthenticated) {
|
|
468
494
|
let t6;
|
|
469
|
-
if ($[
|
|
495
|
+
if ($[13] !== children) {
|
|
470
496
|
t6 = /* @__PURE__ */ jsx(Fragment, { children });
|
|
471
|
-
$[
|
|
472
|
-
$[
|
|
473
|
-
} else t6 = $[
|
|
497
|
+
$[13] = children;
|
|
498
|
+
$[14] = t6;
|
|
499
|
+
} else t6 = $[14];
|
|
474
500
|
return t6;
|
|
475
501
|
}
|
|
476
502
|
const t6 = sharedChrome ? "h-full" : "h-screen";
|
|
477
503
|
const t7 = !isEditMode && "bg-black";
|
|
478
504
|
let t8;
|
|
479
|
-
if ($[
|
|
505
|
+
if ($[15] !== t6 || $[16] !== t7) {
|
|
480
506
|
t8 = cn("bg-background flex flex-col overflow-hidden", t6, t7);
|
|
481
|
-
$[
|
|
482
|
-
$[
|
|
483
|
-
$[
|
|
484
|
-
} else t8 = $[
|
|
507
|
+
$[15] = t6;
|
|
508
|
+
$[16] = t7;
|
|
509
|
+
$[17] = t8;
|
|
510
|
+
} else t8 = $[17];
|
|
485
511
|
let t9;
|
|
486
|
-
if ($[
|
|
512
|
+
if ($[18] !== isAddBlockSidebarOpen || $[19] !== isMobileStudio || $[20] !== isToolbarHidden || $[21] !== pageData || $[22] !== sharedChrome) {
|
|
487
513
|
t9 = !sharedChrome && !isMobileStudio && !isToolbarHidden && /* @__PURE__ */ jsxs("div", {
|
|
488
514
|
className: "relative",
|
|
489
515
|
children: [/* @__PURE__ */ jsx(Navbar, { isPreview: true }), pageData && isAddBlockSidebarOpen && /* @__PURE__ */ jsx("div", {
|
|
@@ -492,15 +518,15 @@ const PreviewShell = (t0) => {
|
|
|
492
518
|
onClick: _temp10
|
|
493
519
|
})]
|
|
494
520
|
});
|
|
495
|
-
$[
|
|
496
|
-
$[
|
|
497
|
-
$[
|
|
498
|
-
$[
|
|
499
|
-
$[
|
|
500
|
-
$[
|
|
501
|
-
} else t9 = $[
|
|
521
|
+
$[18] = isAddBlockSidebarOpen;
|
|
522
|
+
$[19] = isMobileStudio;
|
|
523
|
+
$[20] = isToolbarHidden;
|
|
524
|
+
$[21] = pageData;
|
|
525
|
+
$[22] = sharedChrome;
|
|
526
|
+
$[23] = t9;
|
|
527
|
+
} else t9 = $[23];
|
|
502
528
|
let t10;
|
|
503
|
-
if ($[
|
|
529
|
+
if ($[24] !== derivedLayout || $[25] !== derivedLayoutId || $[26] !== isEditMode || $[27] !== isMobileStudio || $[28] !== pageData) {
|
|
504
530
|
t10 = !isMobileStudio && (pageData || derivedLayoutId) && /* @__PURE__ */ jsx("div", {
|
|
505
531
|
className: isEditMode ? "contents" : "hidden",
|
|
506
532
|
children: /* @__PURE__ */ jsx(LeftSidebar, {
|
|
@@ -508,38 +534,38 @@ const PreviewShell = (t0) => {
|
|
|
508
534
|
derivedLayout
|
|
509
535
|
})
|
|
510
536
|
});
|
|
511
|
-
$[
|
|
512
|
-
$[
|
|
513
|
-
$[
|
|
514
|
-
$[
|
|
515
|
-
$[
|
|
516
|
-
$[
|
|
517
|
-
} else t10 = $[
|
|
537
|
+
$[24] = derivedLayout;
|
|
538
|
+
$[25] = derivedLayoutId;
|
|
539
|
+
$[26] = isEditMode;
|
|
540
|
+
$[27] = isMobileStudio;
|
|
541
|
+
$[28] = pageData;
|
|
542
|
+
$[29] = t10;
|
|
543
|
+
} else t10 = $[29];
|
|
518
544
|
const t11 = pageData?.page;
|
|
519
545
|
const t12 = pageData?.projectName;
|
|
520
546
|
const t13 = pageData?.page.id;
|
|
521
547
|
const t14 = pageData?.page.status;
|
|
522
548
|
let t15;
|
|
523
|
-
if ($[
|
|
549
|
+
if ($[30] !== hasLiveCheckpoint || $[31] !== t13 || $[32] !== t14) {
|
|
524
550
|
t15 = {
|
|
525
551
|
pageId: t13,
|
|
526
552
|
pageStatus: t14,
|
|
527
553
|
hasLiveVersion: hasLiveCheckpoint
|
|
528
554
|
};
|
|
529
|
-
$[
|
|
530
|
-
$[
|
|
531
|
-
$[
|
|
532
|
-
$[
|
|
533
|
-
} else t15 = $[
|
|
555
|
+
$[30] = hasLiveCheckpoint;
|
|
556
|
+
$[31] = t13;
|
|
557
|
+
$[32] = t14;
|
|
558
|
+
$[33] = t15;
|
|
559
|
+
} else t15 = $[33];
|
|
534
560
|
let t16;
|
|
535
|
-
if ($[
|
|
561
|
+
if ($[34] !== isEditMode || $[35] !== isMobileStudio) {
|
|
536
562
|
t16 = !isMobileStudio && isEditMode && /* @__PURE__ */ jsx(PreviewToolbarSpacer, {});
|
|
537
|
-
$[
|
|
538
|
-
$[
|
|
539
|
-
$[
|
|
540
|
-
} else t16 = $[
|
|
563
|
+
$[34] = isEditMode;
|
|
564
|
+
$[35] = isMobileStudio;
|
|
565
|
+
$[36] = t16;
|
|
566
|
+
} else t16 = $[36];
|
|
541
567
|
let t17;
|
|
542
|
-
if ($[
|
|
568
|
+
if ($[37] !== children || $[38] !== isMobileStudio || $[39] !== t11 || $[40] !== t12 || $[41] !== t15 || $[42] !== t16) {
|
|
543
569
|
t17 = /* @__PURE__ */ jsxs(PreviewPanel, {
|
|
544
570
|
isMobileExperience: isMobileStudio,
|
|
545
571
|
page: t11,
|
|
@@ -547,28 +573,28 @@ const PreviewShell = (t0) => {
|
|
|
547
573
|
toolbarProps: t15,
|
|
548
574
|
children: [children, t16]
|
|
549
575
|
});
|
|
550
|
-
$[
|
|
551
|
-
$[
|
|
552
|
-
$[
|
|
553
|
-
$[
|
|
554
|
-
$[
|
|
555
|
-
$[
|
|
556
|
-
$[
|
|
557
|
-
} else t17 = $[
|
|
576
|
+
$[37] = children;
|
|
577
|
+
$[38] = isMobileStudio;
|
|
578
|
+
$[39] = t11;
|
|
579
|
+
$[40] = t12;
|
|
580
|
+
$[41] = t15;
|
|
581
|
+
$[42] = t16;
|
|
582
|
+
$[43] = t17;
|
|
583
|
+
} else t17 = $[43];
|
|
558
584
|
let t18;
|
|
559
|
-
if ($[
|
|
585
|
+
if ($[44] !== derivedLayoutId || $[45] !== isEditMode || $[46] !== isMobileStudio || $[47] !== pageData?.page) {
|
|
560
586
|
t18 = !isMobileStudio && isEditMode && /* @__PURE__ */ jsx(RightSidebar, {
|
|
561
587
|
pageId: pageData?.page.id,
|
|
562
588
|
derivedLayoutId
|
|
563
589
|
});
|
|
564
|
-
$[
|
|
565
|
-
$[
|
|
566
|
-
$[
|
|
567
|
-
$[
|
|
568
|
-
$[
|
|
569
|
-
} else t18 = $[
|
|
590
|
+
$[44] = derivedLayoutId;
|
|
591
|
+
$[45] = isEditMode;
|
|
592
|
+
$[46] = isMobileStudio;
|
|
593
|
+
$[47] = pageData?.page;
|
|
594
|
+
$[48] = t18;
|
|
595
|
+
} else t18 = $[48];
|
|
570
596
|
let t19;
|
|
571
|
-
if ($[
|
|
597
|
+
if ($[49] !== t10 || $[50] !== t17 || $[51] !== t18) {
|
|
572
598
|
t19 = /* @__PURE__ */ jsxs("div", {
|
|
573
599
|
className: "flex h-full flex-row items-stretch",
|
|
574
600
|
children: [
|
|
@@ -577,20 +603,20 @@ const PreviewShell = (t0) => {
|
|
|
577
603
|
t18
|
|
578
604
|
]
|
|
579
605
|
});
|
|
580
|
-
$[
|
|
581
|
-
$[
|
|
582
|
-
$[
|
|
583
|
-
$[
|
|
584
|
-
} else t19 = $[
|
|
606
|
+
$[49] = t10;
|
|
607
|
+
$[50] = t17;
|
|
608
|
+
$[51] = t18;
|
|
609
|
+
$[52] = t19;
|
|
610
|
+
} else t19 = $[52];
|
|
585
611
|
let t20;
|
|
586
|
-
if ($[
|
|
612
|
+
if ($[53] !== isEditMode || $[54] !== isMobileStudio) {
|
|
587
613
|
t20 = (isMobileStudio || isEditMode) && /* @__PURE__ */ jsx(CreatePageModal, {});
|
|
588
|
-
$[
|
|
589
|
-
$[
|
|
590
|
-
$[
|
|
591
|
-
} else t20 = $[
|
|
614
|
+
$[53] = isEditMode;
|
|
615
|
+
$[54] = isMobileStudio;
|
|
616
|
+
$[55] = t20;
|
|
617
|
+
} else t20 = $[55];
|
|
592
618
|
let t21;
|
|
593
|
-
if ($[
|
|
619
|
+
if ($[56] !== t19 || $[57] !== t20 || $[58] !== t8 || $[59] !== t9) {
|
|
594
620
|
t21 = /* @__PURE__ */ jsxs("div", {
|
|
595
621
|
className: t8,
|
|
596
622
|
children: [
|
|
@@ -599,53 +625,28 @@ const PreviewShell = (t0) => {
|
|
|
599
625
|
t20
|
|
600
626
|
]
|
|
601
627
|
});
|
|
602
|
-
$[
|
|
603
|
-
$[
|
|
604
|
-
$[
|
|
605
|
-
$[
|
|
606
|
-
$[
|
|
607
|
-
} else t21 = $[
|
|
628
|
+
$[56] = t19;
|
|
629
|
+
$[57] = t20;
|
|
630
|
+
$[58] = t8;
|
|
631
|
+
$[59] = t9;
|
|
632
|
+
$[60] = t21;
|
|
633
|
+
} else t21 = $[60];
|
|
608
634
|
return t21;
|
|
609
635
|
};
|
|
610
636
|
function usePreviewPagesActions() {
|
|
611
|
-
const $ = c(
|
|
612
|
-
if ($[0] !== "
|
|
613
|
-
for (let $i = 0; $i <
|
|
614
|
-
$[0] = "
|
|
637
|
+
const $ = c(6);
|
|
638
|
+
if ($[0] !== "1f7f5b8cfc80775a4d8d5a69dedeb5c289bf8de78288daf387d6edc5d5f0b09c") {
|
|
639
|
+
for (let $i = 0; $i < 6; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
640
|
+
$[0] = "1f7f5b8cfc80775a4d8d5a69dedeb5c289bf8de78288daf387d6edc5d5f0b09c";
|
|
615
641
|
}
|
|
616
642
|
const navigate = useNavigate();
|
|
617
643
|
const { pathname } = useLocation();
|
|
618
|
-
const
|
|
644
|
+
const pages = usePageDestinations();
|
|
619
645
|
let t0;
|
|
620
|
-
if ($[1] !== projectSlug) {
|
|
621
|
-
t0 = projectQueries.getBySlug(projectSlug);
|
|
622
|
-
$[1] = projectSlug;
|
|
623
|
-
$[2] = t0;
|
|
624
|
-
} else t0 = $[2];
|
|
625
|
-
const { data: project } = useQuery(t0);
|
|
626
646
|
let t1;
|
|
627
|
-
if ($[3] !==
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
$[4] = t1;
|
|
631
|
-
} else t1 = $[4];
|
|
632
|
-
const t2 = !!project;
|
|
633
|
-
let t3;
|
|
634
|
-
if ($[5] !== t1 || $[6] !== t2) {
|
|
635
|
-
t3 = {
|
|
636
|
-
...t1,
|
|
637
|
-
enabled: t2
|
|
638
|
-
};
|
|
639
|
-
$[5] = t1;
|
|
640
|
-
$[6] = t2;
|
|
641
|
-
$[7] = t3;
|
|
642
|
-
} else t3 = $[7];
|
|
643
|
-
const { data: pages } = useQuery(t3);
|
|
644
|
-
let t4;
|
|
645
|
-
let t5;
|
|
646
|
-
if ($[8] !== navigate || $[9] !== pages || $[10] !== pathname) {
|
|
647
|
-
t4 = () => {
|
|
648
|
-
const currentPage = pages?.find((p) => p.fullPath === pathname);
|
|
647
|
+
if ($[1] !== navigate || $[2] !== pages || $[3] !== pathname) {
|
|
648
|
+
t0 = () => {
|
|
649
|
+
const currentPage = pages.find((p) => p.kind === "curated" && p.fullPath === pathname);
|
|
649
650
|
const actions = [
|
|
650
651
|
{
|
|
651
652
|
id: "create-page",
|
|
@@ -664,12 +665,12 @@ function usePreviewPagesActions() {
|
|
|
664
665
|
"Page metadata"
|
|
665
666
|
],
|
|
666
667
|
groupLabel: "Preview",
|
|
667
|
-
checkIfAvailable: () =>
|
|
668
|
+
checkIfAvailable: () => currentPage?.kind === "curated",
|
|
668
669
|
execute: () => {
|
|
669
|
-
if (
|
|
670
|
+
if (currentPage?.kind !== "curated") return;
|
|
670
671
|
previewStore.send({
|
|
671
672
|
type: "openEditPageModal",
|
|
672
|
-
pageId: currentPage.
|
|
673
|
+
pageId: currentPage.pageId
|
|
673
674
|
});
|
|
674
675
|
}
|
|
675
676
|
},
|
|
@@ -682,18 +683,19 @@ function usePreviewPagesActions() {
|
|
|
682
683
|
"Switch page"
|
|
683
684
|
],
|
|
684
685
|
groupLabel: "Preview",
|
|
685
|
-
checkIfAvailable: () =>
|
|
686
|
+
checkIfAvailable: () => pages.length > 0,
|
|
686
687
|
hasChildren: true,
|
|
687
688
|
execute: _temp13
|
|
688
689
|
},
|
|
689
|
-
...pages
|
|
690
|
-
id: `go-to-page-${page.
|
|
690
|
+
...pages.map((page) => ({
|
|
691
|
+
id: `go-to-page-${page.key}`,
|
|
691
692
|
parentActionId: "go-to-page",
|
|
692
|
-
label: `Go to "${page.
|
|
693
|
+
label: `Go to "${page.title}"`,
|
|
694
|
+
aliases: [page.fullPath],
|
|
693
695
|
groupLabel: "Preview",
|
|
694
696
|
checkIfAvailable: _temp14,
|
|
695
697
|
execute: () => navigate({ to: page.fullPath })
|
|
696
|
-
}))
|
|
698
|
+
}))
|
|
697
699
|
];
|
|
698
700
|
actionsStore.send({
|
|
699
701
|
type: "registerManyActions",
|
|
@@ -706,21 +708,21 @@ function usePreviewPagesActions() {
|
|
|
706
708
|
});
|
|
707
709
|
};
|
|
708
710
|
};
|
|
709
|
-
|
|
711
|
+
t1 = [
|
|
710
712
|
navigate,
|
|
711
713
|
pages,
|
|
712
714
|
pathname
|
|
713
715
|
];
|
|
714
|
-
$[
|
|
715
|
-
$[
|
|
716
|
-
$[
|
|
717
|
-
$[
|
|
718
|
-
$[
|
|
716
|
+
$[1] = navigate;
|
|
717
|
+
$[2] = pages;
|
|
718
|
+
$[3] = pathname;
|
|
719
|
+
$[4] = t0;
|
|
720
|
+
$[5] = t1;
|
|
719
721
|
} else {
|
|
720
|
-
|
|
721
|
-
|
|
722
|
+
t0 = $[4];
|
|
723
|
+
t1 = $[5];
|
|
722
724
|
}
|
|
723
|
-
React.useEffect(
|
|
725
|
+
React.useEffect(t0, t1);
|
|
724
726
|
}
|
|
725
727
|
function _temp15(a) {
|
|
726
728
|
return a.id;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
//#region src/features/preview/commentsEnabled.ts
|
|
2
|
-
/**
|
|
2
|
+
/** Comments follow the experimental-features flag in both client and SSR builds. */
|
|
3
3
|
function areCommentsEnabled() {
|
|
4
|
-
return typeof
|
|
4
|
+
return typeof __CAMOX_ENABLE_EXPERIMENTAL_FEATURES__ !== "undefined" && __CAMOX_ENABLE_EXPERIMENTAL_FEATURES__;
|
|
5
5
|
}
|
|
6
6
|
|
|
7
7
|
//#endregion
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { useLocation } from "../../navigation/navigation.js";
|
|
2
2
|
import { useProjectSlug } from "../../../lib/auth.js";
|
|
3
3
|
import { usePageBlocks } from "../../../lib/normalized-data.js";
|
|
4
|
-
import { blockMutations, blockQueries, projectQueries } from "../../../lib/queries.js";
|
|
5
4
|
import { useCamoxApp } from "../../provider/components/CamoxAppContext.js";
|
|
5
|
+
import { blockMutations, blockQueries, projectQueries } from "../../../lib/queries.js";
|
|
6
6
|
import { previewStore } from "../previewStore.js";
|
|
7
7
|
import { useRequireDraftSource } from "../../../core/hooks/useRequireDraftSource.js";
|
|
8
8
|
import { BlockThumbnail } from "./BlockThumbnail.js";
|
|
@@ -21,9 +21,9 @@ import { Switch } from "@camox/ui/switch";
|
|
|
21
21
|
//#region src/features/preview/components/AssetLightbox.tsx
|
|
22
22
|
function DeliveredSize(t0) {
|
|
23
23
|
const $ = c(16);
|
|
24
|
-
if ($[0] !== "
|
|
24
|
+
if ($[0] !== "a37322f6f4a0473903954c8afefb928b001d0a8beede19e05fe56bf7cdbe1ecf") {
|
|
25
25
|
for (let $i = 0; $i < 16; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
26
|
-
$[0] = "
|
|
26
|
+
$[0] = "a37322f6f4a0473903954c8afefb928b001d0a8beede19e05fe56bf7cdbe1ecf";
|
|
27
27
|
}
|
|
28
28
|
const { bytes, raw } = t0;
|
|
29
29
|
if (bytes == null) {
|
|
@@ -92,9 +92,9 @@ function DeliveredSize(t0) {
|
|
|
92
92
|
}
|
|
93
93
|
function DeliveredLabel(t0) {
|
|
94
94
|
const $ = c(4);
|
|
95
|
-
if ($[0] !== "
|
|
95
|
+
if ($[0] !== "a37322f6f4a0473903954c8afefb928b001d0a8beede19e05fe56bf7cdbe1ecf") {
|
|
96
96
|
for (let $i = 0; $i < 4; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
97
|
-
$[0] = "
|
|
97
|
+
$[0] = "a37322f6f4a0473903954c8afefb928b001d0a8beede19e05fe56bf7cdbe1ecf";
|
|
98
98
|
}
|
|
99
99
|
const { children } = t0;
|
|
100
100
|
let t1;
|
|
@@ -171,6 +171,7 @@ const AssetLightbox = ({ open, onOpenChange, fileId }) => {
|
|
|
171
171
|
}
|
|
172
172
|
}, [open]);
|
|
173
173
|
const isImage = file?.mimeType?.startsWith("image/") ?? false;
|
|
174
|
+
const isVideo = file?.mimeType?.startsWith("video/") ?? false;
|
|
174
175
|
const canUseAiMetadata = isRasterImage(file?.mimeType);
|
|
175
176
|
const fileUrl = file?.url;
|
|
176
177
|
const fileMimeType = file?.mimeType;
|
|
@@ -367,6 +368,16 @@ const AssetLightbox = ({ open, onOpenChange, fileId }) => {
|
|
|
367
368
|
className: "max-h-full max-w-full cursor-zoom-in object-contain shadow-lg",
|
|
368
369
|
draggable: false
|
|
369
370
|
})
|
|
371
|
+
}) : isVideo ? /* @__PURE__ */ jsx("div", {
|
|
372
|
+
className: "checkered absolute inset-0 flex items-center justify-center p-6",
|
|
373
|
+
children: open && /* @__PURE__ */ jsx("video", {
|
|
374
|
+
src: file.url,
|
|
375
|
+
controls: true,
|
|
376
|
+
playsInline: true,
|
|
377
|
+
preload: "metadata",
|
|
378
|
+
"aria-label": file.alt || file.filename || "Video preview",
|
|
379
|
+
className: "max-h-full max-w-full object-contain shadow-lg"
|
|
380
|
+
}, file.url)
|
|
370
381
|
}) : /* @__PURE__ */ jsx("div", {
|
|
371
382
|
className: "bg-muted/30 flex h-full min-h-[70vh] items-center justify-center p-6",
|
|
372
383
|
children: /* @__PURE__ */ jsx(FileIcon, { className: "text-muted-foreground h-16 w-16" })
|
|
@@ -530,7 +541,7 @@ const AssetLightbox = ({ open, onOpenChange, fileId }) => {
|
|
|
530
541
|
ref: replaceInputRef,
|
|
531
542
|
type: "file",
|
|
532
543
|
className: "hidden",
|
|
533
|
-
accept: isImage ? "image/*" : "*/*",
|
|
544
|
+
accept: isImage ? "image/*" : isVideo ? "video/*" : "*/*",
|
|
534
545
|
onChange: (e_0) => {
|
|
535
546
|
if (e_0.target.files) handleReplaceDrop(e_0.target.files);
|
|
536
547
|
e_0.target.value = "";
|
|
@@ -540,7 +551,7 @@ const AssetLightbox = ({ open, onOpenChange, fileId }) => {
|
|
|
540
551
|
type: "button",
|
|
541
552
|
variant: "secondary",
|
|
542
553
|
onClick: () => replaceInputRef.current?.click(),
|
|
543
|
-
children: isImage ? "Replace image" : "Replace file"
|
|
554
|
+
children: isImage ? "Replace image" : isVideo ? "Replace video" : "Replace file"
|
|
544
555
|
})
|
|
545
556
|
]
|
|
546
557
|
})
|