camox 0.3.0 → 0.3.1

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.
Files changed (69) hide show
  1. package/dist/components/AuthGate.js +2 -1
  2. package/dist/core/components/AddBlockControlBar.js +117 -44
  3. package/dist/core/components/lexical/InlineContentEditable.js +37 -17
  4. package/dist/core/components/lexical/InlineLexicalEditor.js +84 -25
  5. package/dist/core/components/lexical/SelectionBroadcaster.js +84 -47
  6. package/dist/core/components/lexical/SidebarLexicalEditor.js +54 -19
  7. package/dist/core/createBlock.js +1172 -414
  8. package/dist/core/createLayout.js +48 -16
  9. package/dist/core/hooks/useFieldSelection.js +24 -13
  10. package/dist/core/hooks/useIsEditable.js +8 -2
  11. package/dist/core/hooks/useOverlayMessage.js +51 -20
  12. package/dist/features/content/CamoxContent.js +239 -107
  13. package/dist/features/content/components/AssetCard.js +78 -16
  14. package/dist/features/content/components/AssetCardSkeleton.js +11 -4
  15. package/dist/features/content/components/ContentSidebar.js +15 -8
  16. package/dist/features/content/components/UploadDropZone.js +77 -34
  17. package/dist/features/content/components/UploadProgressDrawer.js +201 -58
  18. package/dist/features/metadata/sitemap.js +15 -0
  19. package/dist/features/preview/CamoxPreview.js +447 -179
  20. package/dist/features/preview/components/AddBlockSheet.js +344 -167
  21. package/dist/features/preview/components/AgentChatSheet.js +32 -10
  22. package/dist/features/preview/components/AssetFieldEditor.js +185 -50
  23. package/dist/features/preview/components/AssetLightbox.js +60 -33
  24. package/dist/features/preview/components/AssetPickerGrid.js +203 -71
  25. package/dist/features/preview/components/BlockActionsPopover.js +295 -218
  26. package/dist/features/preview/components/CreatePageSheet.js +3 -3
  27. package/dist/features/preview/components/DebouncedFieldEditor.js +80 -23
  28. package/dist/features/preview/components/EditPageSheet.js +241 -86
  29. package/dist/features/preview/components/ItemFieldsEditor.js +209 -115
  30. package/dist/features/preview/components/LinkFieldEditor.js +351 -153
  31. package/dist/features/preview/components/MultipleAssetFieldEditor.js +245 -92
  32. package/dist/features/preview/components/OverlayTracker.js +58 -23
  33. package/dist/features/preview/components/Overlays.js +85 -43
  34. package/dist/features/preview/components/PageContentSheet.js +18 -18
  35. package/dist/features/preview/components/PageLocationFieldset.js +229 -63
  36. package/dist/features/preview/components/PagePicker.js +27 -27
  37. package/dist/features/preview/components/PageTree.js +921 -319
  38. package/dist/features/preview/components/PeekedBlock.js +173 -63
  39. package/dist/features/preview/components/PreviewPanel.js +271 -148
  40. package/dist/features/preview/components/PreviewSideSheet.js +44 -11
  41. package/dist/features/preview/components/PreviewToolbar.js +262 -59
  42. package/dist/features/preview/components/RepeatableItemsList.js +187 -78
  43. package/dist/features/preview/components/ShikiMarkdown.js +46 -20
  44. package/dist/features/preview/components/TextFormatToolbar.js +81 -23
  45. package/dist/features/preview/components/UnlinkAssetButton.js +161 -40
  46. package/dist/features/preview/components/useUpdateBlockPosition.js +64 -47
  47. package/dist/features/preview/previewStore.d.ts +2 -2
  48. package/dist/features/provider/CamoxProvider.js +69 -21
  49. package/dist/features/provider/actionsStore.d.ts +2 -2
  50. package/dist/features/provider/components/CamoxAppContext.js +15 -5
  51. package/dist/features/provider/components/CommandPalette.js +199 -92
  52. package/dist/features/provider/useAdminShortcuts.js +80 -64
  53. package/dist/features/routes/pageRoute.js +8 -1
  54. package/dist/features/studio/CamoxStudio.js +45 -9
  55. package/dist/features/studio/components/EnvironmentMenu.js +47 -12
  56. package/dist/features/studio/components/Navbar.js +163 -65
  57. package/dist/features/studio/components/ProjectMenu.js +263 -82
  58. package/dist/features/studio/components/UserButton.js +21 -6
  59. package/dist/features/studio/studioStore.d.ts +2 -2
  60. package/dist/features/studio/useTheme.js +128 -74
  61. package/dist/hooks/use-file-upload.js +11 -11
  62. package/dist/hooks/use-marquee-selection.js +121 -74
  63. package/dist/lib/auth.js +95 -51
  64. package/dist/lib/normalized-data.js +103 -30
  65. package/dist/lib/use-project-room.js +55 -22
  66. package/dist/studio.css +2 -2
  67. package/package.json +29 -26
  68. package/dist/lib/auth.d.ts +0 -2130
  69. package/dist/lib/auth.d.ts.map +0 -1
@@ -1,23 +1,54 @@
1
1
  import { cn } from "../../../lib/utils.js";
2
+ import { c } from "react/compiler-runtime";
2
3
  import { jsx, jsxs } from "react/jsx-runtime";
3
4
  import { FileIcon } from "lucide-react";
4
5
  //#region src/features/content/components/AssetCard.tsx
5
- var AssetCard = ({ file, selected, onSelect, onOpen }) => {
6
- const isImage = file.mimeType?.startsWith("image/");
7
- const extension = file.filename?.split(".").pop()?.toUpperCase() ?? "";
8
- return /* @__PURE__ */ jsxs("button", {
9
- type: "button",
10
- "data-asset-id": file.id,
11
- className: cn("group flex flex-col gap-1.5 rounded-lg p-2 text-left border-2 border-transparent", selected ? "bg-primary/20 border-2 border-primary" : "hover:bg-accent/75"),
12
- onClick: (e) => {
6
+ var AssetCard = (t0) => {
7
+ const $ = c(25);
8
+ const { file, selected, onSelect, onOpen } = t0;
9
+ let t1;
10
+ if ($[0] !== file.mimeType) {
11
+ t1 = file.mimeType?.startsWith("image/");
12
+ $[0] = file.mimeType;
13
+ $[1] = t1;
14
+ } else t1 = $[1];
15
+ const isImage = t1;
16
+ let t2;
17
+ if ($[2] !== file.filename) {
18
+ t2 = file.filename?.split(".").pop()?.toUpperCase() ?? "";
19
+ $[2] = file.filename;
20
+ $[3] = t2;
21
+ } else t2 = $[3];
22
+ const extension = t2;
23
+ const t3 = file.id;
24
+ const t4 = selected ? "bg-primary/20 border-2 border-primary" : "hover:bg-accent/75";
25
+ let t5;
26
+ if ($[4] !== t4) {
27
+ t5 = cn("group flex flex-col gap-1.5 rounded-lg p-2 text-left border-2 border-transparent", t4);
28
+ $[4] = t4;
29
+ $[5] = t5;
30
+ } else t5 = $[5];
31
+ let t6;
32
+ if ($[6] !== onSelect) {
33
+ t6 = (e) => {
13
34
  e.stopPropagation();
14
35
  onSelect();
15
- },
16
- onDoubleClick: (e) => {
17
- e.stopPropagation();
36
+ };
37
+ $[6] = onSelect;
38
+ $[7] = t6;
39
+ } else t6 = $[7];
40
+ let t7;
41
+ if ($[8] !== onOpen) {
42
+ t7 = (e_0) => {
43
+ e_0.stopPropagation();
18
44
  onOpen();
19
- },
20
- children: [/* @__PURE__ */ jsx("div", {
45
+ };
46
+ $[8] = onOpen;
47
+ $[9] = t7;
48
+ } else t7 = $[9];
49
+ let t8;
50
+ if ($[10] !== extension || $[11] !== file.alt || $[12] !== file.filename || $[13] !== file.url || $[14] !== isImage) {
51
+ t8 = /* @__PURE__ */ jsx("div", {
21
52
  className: "bg-muted flex aspect-4/3 w-full items-center justify-center overflow-hidden rounded-md",
22
53
  children: isImage ? /* @__PURE__ */ jsx("img", {
23
54
  src: file.url,
@@ -31,11 +62,42 @@ var AssetCard = ({ file, selected, onSelect, onOpen }) => {
31
62
  children: extension
32
63
  })]
33
64
  })
34
- }), /* @__PURE__ */ jsx("p", {
65
+ });
66
+ $[10] = extension;
67
+ $[11] = file.alt;
68
+ $[12] = file.filename;
69
+ $[13] = file.url;
70
+ $[14] = isImage;
71
+ $[15] = t8;
72
+ } else t8 = $[15];
73
+ let t9;
74
+ if ($[16] !== file.filename) {
75
+ t9 = /* @__PURE__ */ jsx("p", {
35
76
  className: "line-clamp-2 px-0.5 text-xs break-all",
36
77
  children: file.filename
37
- })]
38
- });
78
+ });
79
+ $[16] = file.filename;
80
+ $[17] = t9;
81
+ } else t9 = $[17];
82
+ let t10;
83
+ if ($[18] !== file.id || $[19] !== t5 || $[20] !== t6 || $[21] !== t7 || $[22] !== t8 || $[23] !== t9) {
84
+ t10 = /* @__PURE__ */ jsxs("button", {
85
+ type: "button",
86
+ "data-asset-id": t3,
87
+ className: t5,
88
+ onClick: t6,
89
+ onDoubleClick: t7,
90
+ children: [t8, t9]
91
+ });
92
+ $[18] = file.id;
93
+ $[19] = t5;
94
+ $[20] = t6;
95
+ $[21] = t7;
96
+ $[22] = t8;
97
+ $[23] = t9;
98
+ $[24] = t10;
99
+ } else t10 = $[24];
100
+ return t10;
39
101
  };
40
102
  //#endregion
41
103
  export { AssetCard };
@@ -1,11 +1,18 @@
1
+ import { c } from "react/compiler-runtime";
1
2
  import { jsx, jsxs } from "react/jsx-runtime";
2
3
  import { Skeleton } from "@camox/ui/skeleton";
3
4
  //#region src/features/content/components/AssetCardSkeleton.tsx
4
5
  var AssetCardSkeleton = () => {
5
- return /* @__PURE__ */ jsxs("div", {
6
- className: "flex flex-col gap-1.5 rounded-lg p-2",
7
- children: [/* @__PURE__ */ jsx(Skeleton, { className: "aspect-4/3 w-full rounded-md" }), /* @__PURE__ */ jsx(Skeleton, { className: "mx-0.5 h-3.5 w-3/4" })]
8
- });
6
+ const $ = c(1);
7
+ let t0;
8
+ if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
9
+ t0 = /* @__PURE__ */ jsxs("div", {
10
+ className: "flex flex-col gap-1.5 rounded-lg p-2",
11
+ children: [/* @__PURE__ */ jsx(Skeleton, { className: "aspect-4/3 w-full rounded-md" }), /* @__PURE__ */ jsx(Skeleton, { className: "mx-0.5 h-3.5 w-3/4" })]
12
+ });
13
+ $[0] = t0;
14
+ } else t0 = $[0];
15
+ return t0;
9
16
  };
10
17
  //#endregion
11
18
  export { AssetCardSkeleton };
@@ -1,15 +1,22 @@
1
+ import { c } from "react/compiler-runtime";
1
2
  import { jsx, jsxs } from "react/jsx-runtime";
2
3
  import { ImageIcon } from "lucide-react";
3
4
  //#region src/features/content/components/ContentSidebar.tsx
4
5
  var ContentSidebar = () => {
5
- return /* @__PURE__ */ jsx("div", {
6
- className: "flex w-[220px] flex-col border-r-2 p-2",
7
- children: /* @__PURE__ */ jsxs("button", {
8
- type: "button",
9
- className: "bg-accent text-accent-foreground flex items-center gap-2 rounded-md px-2 py-1.5 text-sm font-medium",
10
- children: [/* @__PURE__ */ jsx(ImageIcon, { className: "h-4 w-4" }), "Assets"]
11
- })
12
- });
6
+ const $ = c(1);
7
+ let t0;
8
+ if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
9
+ t0 = /* @__PURE__ */ jsx("div", {
10
+ className: "flex w-[220px] flex-col border-r-2 p-2",
11
+ children: /* @__PURE__ */ jsxs("button", {
12
+ type: "button",
13
+ className: "bg-accent text-accent-foreground flex items-center gap-2 rounded-md px-2 py-1.5 text-sm font-medium",
14
+ children: [/* @__PURE__ */ jsx(ImageIcon, { className: "h-4 w-4" }), "Assets"]
15
+ })
16
+ });
17
+ $[0] = t0;
18
+ } else t0 = $[0];
19
+ return t0;
13
20
  };
14
21
  //#endregion
15
22
  export { ContentSidebar };
@@ -1,41 +1,60 @@
1
1
  import { cn } from "../../../lib/utils.js";
2
- import { useCallback, useRef, useState } from "react";
2
+ import { c } from "react/compiler-runtime";
3
+ import { useRef, useState } from "react";
3
4
  import { jsx, jsxs } from "react/jsx-runtime";
4
5
  import { Upload } from "lucide-react";
5
6
  //#region src/features/content/components/UploadDropZone.tsx
6
- function UploadDropZone({ onDrop, children, className, label = "Drop files to upload" }) {
7
+ function UploadDropZone(t0) {
8
+ const $ = c(14);
9
+ const { onDrop, children, className, label: t1 } = t0;
10
+ const label = t1 === void 0 ? "Drop files to upload" : t1;
7
11
  const [isDragging, setIsDragging] = useState(false);
8
12
  const dragCounter = useRef(0);
9
- const handleDragEnter = useCallback((e) => {
10
- e.preventDefault();
11
- e.stopPropagation();
12
- dragCounter.current++;
13
- if (dragCounter.current === 1) setIsDragging(true);
14
- }, []);
15
- const handleDragLeave = useCallback((e) => {
16
- e.preventDefault();
17
- e.stopPropagation();
18
- dragCounter.current--;
19
- if (dragCounter.current === 0) setIsDragging(false);
20
- }, []);
21
- const handleDragOver = useCallback((e) => {
22
- e.preventDefault();
23
- e.stopPropagation();
24
- }, []);
25
- const handleDrop = useCallback((e) => {
26
- e.preventDefault();
27
- e.stopPropagation();
28
- dragCounter.current = 0;
29
- setIsDragging(false);
30
- if (e.dataTransfer.files.length > 0) onDrop(e.dataTransfer.files);
31
- }, [onDrop]);
32
- return /* @__PURE__ */ jsxs("div", {
33
- className: cn("relative min-h-full", className),
34
- onDragEnter: handleDragEnter,
35
- onDragLeave: handleDragLeave,
36
- onDragOver: handleDragOver,
37
- onDrop: handleDrop,
38
- children: [children, isDragging && /* @__PURE__ */ jsx("div", {
13
+ let t2;
14
+ if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
15
+ t2 = (e) => {
16
+ e.preventDefault();
17
+ e.stopPropagation();
18
+ dragCounter.current = dragCounter.current + 1;
19
+ if (dragCounter.current === 1) setIsDragging(true);
20
+ };
21
+ $[0] = t2;
22
+ } else t2 = $[0];
23
+ const handleDragEnter = t2;
24
+ let t3;
25
+ if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
26
+ t3 = (e_0) => {
27
+ e_0.preventDefault();
28
+ e_0.stopPropagation();
29
+ dragCounter.current = dragCounter.current - 1;
30
+ if (dragCounter.current === 0) setIsDragging(false);
31
+ };
32
+ $[1] = t3;
33
+ } else t3 = $[1];
34
+ const handleDragLeave = t3;
35
+ const handleDragOver = _temp;
36
+ let t4;
37
+ if ($[2] !== onDrop) {
38
+ t4 = (e_2) => {
39
+ e_2.preventDefault();
40
+ e_2.stopPropagation();
41
+ dragCounter.current = 0;
42
+ setIsDragging(false);
43
+ if (e_2.dataTransfer.files.length > 0) onDrop(e_2.dataTransfer.files);
44
+ };
45
+ $[2] = onDrop;
46
+ $[3] = t4;
47
+ } else t4 = $[3];
48
+ const handleDrop = t4;
49
+ let t5;
50
+ if ($[4] !== className) {
51
+ t5 = cn("relative min-h-full", className);
52
+ $[4] = className;
53
+ $[5] = t5;
54
+ } else t5 = $[5];
55
+ let t6;
56
+ if ($[6] !== isDragging || $[7] !== label) {
57
+ t6 = isDragging && /* @__PURE__ */ jsx("div", {
39
58
  className: "bg-background absolute inset-0 z-40 flex flex-col items-center justify-center gap-2 p-4",
40
59
  children: /* @__PURE__ */ jsxs("div", {
41
60
  className: "border-primary flex h-full w-full flex-col items-center justify-center gap-2 rounded-lg border-3 border-dashed",
@@ -44,8 +63,32 @@ function UploadDropZone({ onDrop, children, className, label = "Drop files to up
44
63
  children: label
45
64
  })]
46
65
  })
47
- })]
48
- });
66
+ });
67
+ $[6] = isDragging;
68
+ $[7] = label;
69
+ $[8] = t6;
70
+ } else t6 = $[8];
71
+ let t7;
72
+ if ($[9] !== children || $[10] !== handleDrop || $[11] !== t5 || $[12] !== t6) {
73
+ t7 = /* @__PURE__ */ jsxs("div", {
74
+ className: t5,
75
+ onDragEnter: handleDragEnter,
76
+ onDragLeave: handleDragLeave,
77
+ onDragOver: handleDragOver,
78
+ onDrop: handleDrop,
79
+ children: [children, t6]
80
+ });
81
+ $[9] = children;
82
+ $[10] = handleDrop;
83
+ $[11] = t5;
84
+ $[12] = t6;
85
+ $[13] = t7;
86
+ } else t7 = $[13];
87
+ return t7;
88
+ }
89
+ function _temp(e_1) {
90
+ e_1.preventDefault();
91
+ e_1.stopPropagation();
49
92
  }
50
93
  //#endregion
51
94
  export { UploadDropZone };
@@ -1,71 +1,214 @@
1
+ import { c } from "react/compiler-runtime";
1
2
  import { useState } from "react";
2
3
  import { jsx, jsxs } from "react/jsx-runtime";
3
4
  import { AlertCircle, Check, ChevronDown, ChevronUp, File, Loader2, X } from "lucide-react";
4
5
  //#region src/features/content/components/UploadProgressDrawer.tsx
5
- function UploadProgressDrawer({ uploads, onClose }) {
6
+ function UploadProgressDrawer(t0) {
7
+ const $ = c(22);
8
+ const { uploads, onClose } = t0;
6
9
  const [collapsed, setCollapsed] = useState(false);
7
10
  if (uploads.length === 0) return null;
8
- const completedCount = uploads.filter((u) => u.status === "complete").length;
9
- return /* @__PURE__ */ jsxs("div", {
10
- className: "border-border bg-background fixed right-4 bottom-4 z-50 w-80 rounded-lg border shadow-lg",
11
- children: [/* @__PURE__ */ jsxs("div", {
11
+ let t1;
12
+ if ($[0] !== uploads) {
13
+ t1 = uploads.filter(_temp);
14
+ $[0] = uploads;
15
+ $[1] = t1;
16
+ } else t1 = $[1];
17
+ const completedCount = t1.length;
18
+ const headerText = completedCount === uploads.length ? `${completedCount} upload${completedCount !== 1 ? "s" : ""} complete` : `Uploading ${uploads.length} file${uploads.length !== 1 ? "s" : ""}`;
19
+ let t2;
20
+ if ($[2] !== headerText) {
21
+ t2 = /* @__PURE__ */ jsx("span", {
22
+ className: "text-sm font-medium",
23
+ children: headerText
24
+ });
25
+ $[2] = headerText;
26
+ $[3] = t2;
27
+ } else t2 = $[3];
28
+ let t3;
29
+ if ($[4] === Symbol.for("react.memo_cache_sentinel")) {
30
+ t3 = () => setCollapsed(_temp2);
31
+ $[4] = t3;
32
+ } else t3 = $[4];
33
+ let t4;
34
+ if ($[5] !== collapsed) {
35
+ t4 = /* @__PURE__ */ jsx("button", {
36
+ onClick: t3,
37
+ className: "hover:bg-muted rounded p-1",
38
+ children: collapsed ? /* @__PURE__ */ jsx(ChevronUp, { className: "h-4 w-4" }) : /* @__PURE__ */ jsx(ChevronDown, { className: "h-4 w-4" })
39
+ });
40
+ $[5] = collapsed;
41
+ $[6] = t4;
42
+ } else t4 = $[6];
43
+ let t5;
44
+ if ($[7] === Symbol.for("react.memo_cache_sentinel")) {
45
+ t5 = /* @__PURE__ */ jsx(X, { className: "h-4 w-4" });
46
+ $[7] = t5;
47
+ } else t5 = $[7];
48
+ let t6;
49
+ if ($[8] !== onClose) {
50
+ t6 = /* @__PURE__ */ jsx("button", {
51
+ onClick: onClose,
52
+ className: "hover:bg-muted rounded p-1",
53
+ children: t5
54
+ });
55
+ $[8] = onClose;
56
+ $[9] = t6;
57
+ } else t6 = $[9];
58
+ let t7;
59
+ if ($[10] !== t4 || $[11] !== t6) {
60
+ t7 = /* @__PURE__ */ jsxs("div", {
61
+ className: "flex items-center gap-1",
62
+ children: [t4, t6]
63
+ });
64
+ $[10] = t4;
65
+ $[11] = t6;
66
+ $[12] = t7;
67
+ } else t7 = $[12];
68
+ let t8;
69
+ if ($[13] !== t2 || $[14] !== t7) {
70
+ t8 = /* @__PURE__ */ jsxs("div", {
12
71
  className: "border-border flex items-center justify-between border-b px-3 py-2",
13
- children: [/* @__PURE__ */ jsx("span", {
14
- className: "text-sm font-medium",
15
- children: completedCount === uploads.length ? `${completedCount} upload${completedCount !== 1 ? "s" : ""} complete` : `Uploading ${uploads.length} file${uploads.length !== 1 ? "s" : ""}`
16
- }), /* @__PURE__ */ jsxs("div", {
17
- className: "flex items-center gap-1",
18
- children: [/* @__PURE__ */ jsx("button", {
19
- onClick: () => setCollapsed((c) => !c),
20
- className: "hover:bg-muted rounded p-1",
21
- children: collapsed ? /* @__PURE__ */ jsx(ChevronUp, { className: "h-4 w-4" }) : /* @__PURE__ */ jsx(ChevronDown, { className: "h-4 w-4" })
22
- }), /* @__PURE__ */ jsx("button", {
23
- onClick: onClose,
24
- className: "hover:bg-muted rounded p-1",
25
- children: /* @__PURE__ */ jsx(X, { className: "h-4 w-4" })
26
- })]
27
- })]
28
- }), !collapsed && /* @__PURE__ */ jsx("div", {
72
+ children: [t2, t7]
73
+ });
74
+ $[13] = t2;
75
+ $[14] = t7;
76
+ $[15] = t8;
77
+ } else t8 = $[15];
78
+ let t9;
79
+ if ($[16] !== collapsed || $[17] !== uploads) {
80
+ t9 = !collapsed && /* @__PURE__ */ jsx("div", {
29
81
  className: "max-h-60 overflow-y-auto",
30
- children: uploads.map((item) => /* @__PURE__ */ jsx(UploadItemRow, { item }, item.id))
31
- })]
32
- });
82
+ children: uploads.map(_temp3)
83
+ });
84
+ $[16] = collapsed;
85
+ $[17] = uploads;
86
+ $[18] = t9;
87
+ } else t9 = $[18];
88
+ let t10;
89
+ if ($[19] !== t8 || $[20] !== t9) {
90
+ t10 = /* @__PURE__ */ jsxs("div", {
91
+ className: "border-border bg-background fixed right-4 bottom-4 z-50 w-80 rounded-lg border shadow-lg",
92
+ children: [t8, t9]
93
+ });
94
+ $[19] = t8;
95
+ $[20] = t9;
96
+ $[21] = t10;
97
+ } else t10 = $[21];
98
+ return t10;
33
99
  }
34
- function UploadItemRow({ item }) {
35
- return /* @__PURE__ */ jsxs("div", {
36
- className: "flex items-center gap-2 px-3 py-2",
37
- children: [
38
- /* @__PURE__ */ jsx(File, { className: "text-muted-foreground h-4 w-4 shrink-0" }),
39
- /* @__PURE__ */ jsxs("div", {
40
- className: "min-w-0 flex-1",
41
- children: [
42
- /* @__PURE__ */ jsx("p", {
43
- className: "truncate text-sm",
44
- children: item.filename
45
- }),
46
- item.status === "uploading" && /* @__PURE__ */ jsx("div", {
47
- className: "bg-muted mt-1 h-1.5 overflow-hidden rounded-full",
48
- children: /* @__PURE__ */ jsx("div", {
49
- className: "bg-primary h-full transition-all duration-200",
50
- style: { width: `${item.progress}%` }
51
- })
52
- }),
53
- item.status === "error" && /* @__PURE__ */ jsx("p", {
54
- className: "text-destructive mt-0.5 text-xs",
55
- children: item.error
56
- })
57
- ]
58
- }),
59
- /* @__PURE__ */ jsxs("div", {
60
- className: "shrink-0",
61
- children: [
62
- item.status === "uploading" && /* @__PURE__ */ jsx(Loader2, { className: "text-muted-foreground h-4 w-4 animate-spin" }),
63
- item.status === "complete" && /* @__PURE__ */ jsx(Check, { className: "h-4 w-4 text-green-500" }),
64
- item.status === "error" && /* @__PURE__ */ jsx(AlertCircle, { className: "text-destructive h-4 w-4" })
65
- ]
100
+ function _temp3(item) {
101
+ return /* @__PURE__ */ jsx(UploadItemRow, { item }, item.id);
102
+ }
103
+ function _temp2(c) {
104
+ return !c;
105
+ }
106
+ function _temp(u) {
107
+ return u.status === "complete";
108
+ }
109
+ function UploadItemRow(t0) {
110
+ const $ = c(26);
111
+ const { item } = t0;
112
+ let t1;
113
+ if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
114
+ t1 = /* @__PURE__ */ jsx(File, { className: "text-muted-foreground h-4 w-4 shrink-0" });
115
+ $[0] = t1;
116
+ } else t1 = $[0];
117
+ let t2;
118
+ if ($[1] !== item.filename) {
119
+ t2 = /* @__PURE__ */ jsx("p", {
120
+ className: "truncate text-sm",
121
+ children: item.filename
122
+ });
123
+ $[1] = item.filename;
124
+ $[2] = t2;
125
+ } else t2 = $[2];
126
+ let t3;
127
+ if ($[3] !== item.progress || $[4] !== item.status) {
128
+ t3 = item.status === "uploading" && /* @__PURE__ */ jsx("div", {
129
+ className: "bg-muted mt-1 h-1.5 overflow-hidden rounded-full",
130
+ children: /* @__PURE__ */ jsx("div", {
131
+ className: "bg-primary h-full transition-all duration-200",
132
+ style: { width: `${item.progress}%` }
66
133
  })
67
- ]
68
- });
134
+ });
135
+ $[3] = item.progress;
136
+ $[4] = item.status;
137
+ $[5] = t3;
138
+ } else t3 = $[5];
139
+ let t4;
140
+ if ($[6] !== item.error || $[7] !== item.status) {
141
+ t4 = item.status === "error" && /* @__PURE__ */ jsx("p", {
142
+ className: "text-destructive mt-0.5 text-xs",
143
+ children: item.error
144
+ });
145
+ $[6] = item.error;
146
+ $[7] = item.status;
147
+ $[8] = t4;
148
+ } else t4 = $[8];
149
+ let t5;
150
+ if ($[9] !== t2 || $[10] !== t3 || $[11] !== t4) {
151
+ t5 = /* @__PURE__ */ jsxs("div", {
152
+ className: "min-w-0 flex-1",
153
+ children: [
154
+ t2,
155
+ t3,
156
+ t4
157
+ ]
158
+ });
159
+ $[9] = t2;
160
+ $[10] = t3;
161
+ $[11] = t4;
162
+ $[12] = t5;
163
+ } else t5 = $[12];
164
+ let t6;
165
+ if ($[13] !== item.status) {
166
+ t6 = item.status === "uploading" && /* @__PURE__ */ jsx(Loader2, { className: "text-muted-foreground h-4 w-4 animate-spin" });
167
+ $[13] = item.status;
168
+ $[14] = t6;
169
+ } else t6 = $[14];
170
+ let t7;
171
+ if ($[15] !== item.status) {
172
+ t7 = item.status === "complete" && /* @__PURE__ */ jsx(Check, { className: "h-4 w-4 text-green-500" });
173
+ $[15] = item.status;
174
+ $[16] = t7;
175
+ } else t7 = $[16];
176
+ let t8;
177
+ if ($[17] !== item.status) {
178
+ t8 = item.status === "error" && /* @__PURE__ */ jsx(AlertCircle, { className: "text-destructive h-4 w-4" });
179
+ $[17] = item.status;
180
+ $[18] = t8;
181
+ } else t8 = $[18];
182
+ let t9;
183
+ if ($[19] !== t6 || $[20] !== t7 || $[21] !== t8) {
184
+ t9 = /* @__PURE__ */ jsxs("div", {
185
+ className: "shrink-0",
186
+ children: [
187
+ t6,
188
+ t7,
189
+ t8
190
+ ]
191
+ });
192
+ $[19] = t6;
193
+ $[20] = t7;
194
+ $[21] = t8;
195
+ $[22] = t9;
196
+ } else t9 = $[22];
197
+ let t10;
198
+ if ($[23] !== t5 || $[24] !== t9) {
199
+ t10 = /* @__PURE__ */ jsxs("div", {
200
+ className: "flex items-center gap-2 px-3 py-2",
201
+ children: [
202
+ t1,
203
+ t5,
204
+ t9
205
+ ]
206
+ });
207
+ $[23] = t5;
208
+ $[24] = t9;
209
+ $[25] = t10;
210
+ } else t10 = $[25];
211
+ return t10;
69
212
  }
70
213
  //#endregion
71
214
  export { UploadItemRow, UploadProgressDrawer };
@@ -0,0 +1,15 @@
1
+ import { createORPCClient } from "@orpc/client";
2
+ import { RPCLink } from "@orpc/client/fetch";
3
+ //#region src/features/metadata/sitemap.ts
4
+ async function generateSitemap(origin) {
5
+ const headers = { "x-environment-name": __CAMOX_ENVIRONMENT_NAME__ };
6
+ return (await createORPCClient(new RPCLink({
7
+ url: `${__CAMOX_API_URL__}/rpc`,
8
+ headers
9
+ })).pages.listBySlug({ projectSlug: __CAMOX_PROJECT_SLUG__ })).map((page) => ({
10
+ loc: `${origin}${page.fullPath}`,
11
+ lastmod: new Date(page.updatedAt).toISOString()
12
+ }));
13
+ }
14
+ //#endregion
15
+ export { generateSitemap };