camox 0.17.0 → 0.17.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.
- package/dist/core/components/lexical/InlineLexicalEditor.js +20 -15
- package/dist/core/createBlock.js +26 -20
- package/dist/features/preview/components/AddBlockSheet.js +85 -80
- package/dist/features/preview/components/AssetLightbox.js +15 -6
- package/dist/features/preview/components/BlockActionsPopover.js +15 -9
- package/dist/features/preview/components/CreatePageModal.js +1 -1
- package/dist/features/preview/components/EditPageModal.js +20 -13
- package/dist/features/preview/components/Overlays.js +4 -3
- package/dist/features/preview/components/PageContentSheet.js +24 -12
- package/dist/features/preview/components/PageTree.js +26 -23
- package/dist/features/preview/previewStore.js +25 -9
- package/dist/features/provider/CamoxProvider.js +34 -40
- package/dist/features/routes/pageRoute.js +3 -3
- package/dist/features/studio/CamoxStudio.js +43 -23
- package/dist/features/vite/vite.d.ts +2 -2
- package/dist/features/vite/vite.js +4 -2
- package/dist/hooks/use-file-upload.js +1 -1
- package/dist/lib/api-client.js +2 -1
- package/dist/lib/telemetry-client.js +66 -0
- package/dist/lib/{analytics.js → telemetry.js} +5 -4
- package/package.json +4 -4
- package/dist/lib/analytics-client.js +0 -32
|
@@ -16,9 +16,9 @@ import { COMMAND_PRIORITY_LOW, INSERT_LINE_BREAK_COMMAND, KEY_ENTER_COMMAND, KEY
|
|
|
16
16
|
//#region src/core/components/lexical/InlineLexicalEditor.tsx
|
|
17
17
|
function ExternalStateSync(t0) {
|
|
18
18
|
const $ = c(8);
|
|
19
|
-
if ($[0] !== "
|
|
19
|
+
if ($[0] !== "d55dc2470e7a8239785b31acd1a520713ae4ab4b2286f30664666de45ce709b6") {
|
|
20
20
|
for (let $i = 0; $i < 8; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
21
|
-
$[0] = "
|
|
21
|
+
$[0] = "d55dc2470e7a8239785b31acd1a520713ae4ab4b2286f30664666de45ce709b6";
|
|
22
22
|
}
|
|
23
23
|
const { externalState } = t0;
|
|
24
24
|
const [editor] = useLexicalComposerContext();
|
|
@@ -75,9 +75,9 @@ function ExternalStateSync(t0) {
|
|
|
75
75
|
}
|
|
76
76
|
function EscapeHandler() {
|
|
77
77
|
const $ = c(4);
|
|
78
|
-
if ($[0] !== "
|
|
78
|
+
if ($[0] !== "d55dc2470e7a8239785b31acd1a520713ae4ab4b2286f30664666de45ce709b6") {
|
|
79
79
|
for (let $i = 0; $i < 4; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
80
|
-
$[0] = "
|
|
80
|
+
$[0] = "d55dc2470e7a8239785b31acd1a520713ae4ab4b2286f30664666de45ce709b6";
|
|
81
81
|
}
|
|
82
82
|
const [editor] = useLexicalComposerContext();
|
|
83
83
|
let t0;
|
|
@@ -100,9 +100,9 @@ function EscapeHandler() {
|
|
|
100
100
|
}
|
|
101
101
|
function EnterAsLineBreakHandler() {
|
|
102
102
|
const $ = c(4);
|
|
103
|
-
if ($[0] !== "
|
|
103
|
+
if ($[0] !== "d55dc2470e7a8239785b31acd1a520713ae4ab4b2286f30664666de45ce709b6") {
|
|
104
104
|
for (let $i = 0; $i < 4; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
105
|
-
$[0] = "
|
|
105
|
+
$[0] = "d55dc2470e7a8239785b31acd1a520713ae4ab4b2286f30664666de45ce709b6";
|
|
106
106
|
}
|
|
107
107
|
const [editor] = useLexicalComposerContext();
|
|
108
108
|
let t0;
|
|
@@ -126,9 +126,9 @@ function EnterAsLineBreakHandler() {
|
|
|
126
126
|
}
|
|
127
127
|
function FocusBlurHandler(t0) {
|
|
128
128
|
const $ = c(6);
|
|
129
|
-
if ($[0] !== "
|
|
129
|
+
if ($[0] !== "d55dc2470e7a8239785b31acd1a520713ae4ab4b2286f30664666de45ce709b6") {
|
|
130
130
|
for (let $i = 0; $i < 6; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
131
|
-
$[0] = "
|
|
131
|
+
$[0] = "d55dc2470e7a8239785b31acd1a520713ae4ab4b2286f30664666de45ce709b6";
|
|
132
132
|
}
|
|
133
133
|
const { onFocus, onBlur } = t0;
|
|
134
134
|
const [editor] = useLexicalComposerContext();
|
|
@@ -164,22 +164,27 @@ function FocusBlurHandler(t0) {
|
|
|
164
164
|
function InlineLexicalEditor({ initialState, externalState, onChange, onFocus, onBlur }) {
|
|
165
165
|
const { window: iframeWindow } = useFrame();
|
|
166
166
|
const timerRef = React.useRef(null);
|
|
167
|
-
const
|
|
167
|
+
const isFocusedRef = React.useRef(false);
|
|
168
|
+
const editedDuringFocusRef = React.useRef(false);
|
|
168
169
|
const config = React.useMemo(() => createEditorConfig(initialState), []);
|
|
169
170
|
const handleChange = React.useCallback((editorState) => {
|
|
170
|
-
if (!
|
|
171
|
+
if (!isFocusedRef.current) return;
|
|
172
|
+
editedDuringFocusRef.current = true;
|
|
171
173
|
if (timerRef.current) clearTimeout(timerRef.current);
|
|
172
174
|
timerRef.current = window.setTimeout(() => {
|
|
173
175
|
onChange(lexicalStateToMarkdown(editorState.toJSON()));
|
|
174
176
|
}, 300);
|
|
175
177
|
}, [onChange]);
|
|
176
178
|
const handleFocus = React.useCallback(() => {
|
|
177
|
-
|
|
179
|
+
isFocusedRef.current = true;
|
|
180
|
+
editedDuringFocusRef.current = false;
|
|
178
181
|
onFocus();
|
|
179
182
|
}, [onFocus]);
|
|
180
183
|
const handleBlur = React.useCallback(() => {
|
|
181
|
-
|
|
182
|
-
|
|
184
|
+
isFocusedRef.current = false;
|
|
185
|
+
const wasEdited = editedDuringFocusRef.current;
|
|
186
|
+
editedDuringFocusRef.current = false;
|
|
187
|
+
onBlur(wasEdited);
|
|
183
188
|
}, [onBlur]);
|
|
184
189
|
React.useEffect(() => {
|
|
185
190
|
return () => {
|
|
@@ -208,9 +213,9 @@ function InlineLexicalEditor({ initialState, externalState, onChange, onFocus, o
|
|
|
208
213
|
}
|
|
209
214
|
function LexicalErrorBoundary(t0) {
|
|
210
215
|
const $ = c(3);
|
|
211
|
-
if ($[0] !== "
|
|
216
|
+
if ($[0] !== "d55dc2470e7a8239785b31acd1a520713ae4ab4b2286f30664666de45ce709b6") {
|
|
212
217
|
for (let $i = 0; $i < 3; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
213
|
-
$[0] = "
|
|
218
|
+
$[0] = "d55dc2470e7a8239785b31acd1a520713ae4ab4b2286f30664666de45ce709b6";
|
|
214
219
|
}
|
|
215
220
|
const { children } = t0;
|
|
216
221
|
let t1;
|
package/dist/core/createBlock.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { trackClientEvent } from "../lib/telemetry-client.js";
|
|
1
2
|
import { previewStore } from "../features/preview/previewStore.js";
|
|
2
3
|
import { useIsPreviewSheetOpen } from "../features/preview/components/PreviewSideSheet.js";
|
|
3
4
|
import { useProjectSlug } from "../lib/auth.js";
|
|
@@ -245,9 +246,14 @@ function createBlock(options) {
|
|
|
245
246
|
name,
|
|
246
247
|
repeaterContext?.itemId
|
|
247
248
|
]);
|
|
248
|
-
const handleBlur = React.useCallback(() => {
|
|
249
|
+
const handleBlur = React.useCallback((wasEdited) => {
|
|
249
250
|
setIsEditorFocused(false);
|
|
250
|
-
|
|
251
|
+
if (wasEdited) trackClientEvent("block_edited", {
|
|
252
|
+
via: "inline-lexical",
|
|
253
|
+
blockType: options.id,
|
|
254
|
+
field: String(name)
|
|
255
|
+
});
|
|
256
|
+
}, [name]);
|
|
251
257
|
const handleMouseEnter = () => {
|
|
252
258
|
if (isContentEditable) setIsHovered(true);
|
|
253
259
|
};
|
|
@@ -275,9 +281,9 @@ function createBlock(options) {
|
|
|
275
281
|
};
|
|
276
282
|
const Embed = (t0) => {
|
|
277
283
|
const $ = c(59);
|
|
278
|
-
if ($[0] !== "
|
|
284
|
+
if ($[0] !== "50c74140b2fc3c96e656363dba6d1b89943fa30a4545390a9b1121f213cb8321") {
|
|
279
285
|
for (let $i = 0; $i < 59; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
280
|
-
$[0] = "
|
|
286
|
+
$[0] = "50c74140b2fc3c96e656363dba6d1b89943fa30a4545390a9b1121f213cb8321";
|
|
281
287
|
}
|
|
282
288
|
const { name, children } = t0;
|
|
283
289
|
const blockContext = React.use(Context);
|
|
@@ -525,9 +531,9 @@ function createBlock(options) {
|
|
|
525
531
|
};
|
|
526
532
|
const Link = (t0) => {
|
|
527
533
|
const $ = c(38);
|
|
528
|
-
if ($[0] !== "
|
|
534
|
+
if ($[0] !== "50c74140b2fc3c96e656363dba6d1b89943fa30a4545390a9b1121f213cb8321") {
|
|
529
535
|
for (let $i = 0; $i < 38; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
530
|
-
$[0] = "
|
|
536
|
+
$[0] = "50c74140b2fc3c96e656363dba6d1b89943fa30a4545390a9b1121f213cb8321";
|
|
531
537
|
}
|
|
532
538
|
const { name, children } = t0;
|
|
533
539
|
const blockContext = React.use(Context);
|
|
@@ -766,9 +772,9 @@ function createBlock(options) {
|
|
|
766
772
|
};
|
|
767
773
|
const Image = (t0) => {
|
|
768
774
|
const $ = c(22);
|
|
769
|
-
if ($[0] !== "
|
|
775
|
+
if ($[0] !== "50c74140b2fc3c96e656363dba6d1b89943fa30a4545390a9b1121f213cb8321") {
|
|
770
776
|
for (let $i = 0; $i < 22; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
771
|
-
$[0] = "
|
|
777
|
+
$[0] = "50c74140b2fc3c96e656363dba6d1b89943fa30a4545390a9b1121f213cb8321";
|
|
772
778
|
}
|
|
773
779
|
const { name, children } = t0;
|
|
774
780
|
const blockContext = React.use(Context);
|
|
@@ -884,9 +890,9 @@ function createBlock(options) {
|
|
|
884
890
|
};
|
|
885
891
|
const File = (t0) => {
|
|
886
892
|
const $ = c(9);
|
|
887
|
-
if ($[0] !== "
|
|
893
|
+
if ($[0] !== "50c74140b2fc3c96e656363dba6d1b89943fa30a4545390a9b1121f213cb8321") {
|
|
888
894
|
for (let $i = 0; $i < 9; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
889
|
-
$[0] = "
|
|
895
|
+
$[0] = "50c74140b2fc3c96e656363dba6d1b89943fa30a4545390a9b1121f213cb8321";
|
|
890
896
|
}
|
|
891
897
|
const { name, children } = t0;
|
|
892
898
|
const blockContext = React.use(Context);
|
|
@@ -921,9 +927,9 @@ function createBlock(options) {
|
|
|
921
927
|
};
|
|
922
928
|
const RepeaterItemWrapper = (t0) => {
|
|
923
929
|
const $ = c(9);
|
|
924
|
-
if ($[0] !== "
|
|
930
|
+
if ($[0] !== "50c74140b2fc3c96e656363dba6d1b89943fa30a4545390a9b1121f213cb8321") {
|
|
925
931
|
for (let $i = 0; $i < 9; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
926
|
-
$[0] = "
|
|
932
|
+
$[0] = "50c74140b2fc3c96e656363dba6d1b89943fa30a4545390a9b1121f213cb8321";
|
|
927
933
|
}
|
|
928
934
|
const { itemId, blockId, mode, children } = t0;
|
|
929
935
|
const isContentEditable = useIsEditable(mode);
|
|
@@ -964,9 +970,9 @@ function createBlock(options) {
|
|
|
964
970
|
};
|
|
965
971
|
const RepeaterHoverProvider = (t0) => {
|
|
966
972
|
const $ = c(7);
|
|
967
|
-
if ($[0] !== "
|
|
973
|
+
if ($[0] !== "50c74140b2fc3c96e656363dba6d1b89943fa30a4545390a9b1121f213cb8321") {
|
|
968
974
|
for (let $i = 0; $i < 7; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
969
|
-
$[0] = "
|
|
975
|
+
$[0] = "50c74140b2fc3c96e656363dba6d1b89943fa30a4545390a9b1121f213cb8321";
|
|
970
976
|
}
|
|
971
977
|
const { blockId, fieldName, children } = t0;
|
|
972
978
|
const isContentEditable = useIsEditable("site");
|
|
@@ -997,9 +1003,9 @@ function createBlock(options) {
|
|
|
997
1003
|
};
|
|
998
1004
|
const Repeater = (t0) => {
|
|
999
1005
|
const $ = c(30);
|
|
1000
|
-
if ($[0] !== "
|
|
1006
|
+
if ($[0] !== "50c74140b2fc3c96e656363dba6d1b89943fa30a4545390a9b1121f213cb8321") {
|
|
1001
1007
|
for (let $i = 0; $i < 30; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
1002
|
-
$[0] = "
|
|
1008
|
+
$[0] = "50c74140b2fc3c96e656363dba6d1b89943fa30a4545390a9b1121f213cb8321";
|
|
1003
1009
|
}
|
|
1004
1010
|
const { name, children } = t0;
|
|
1005
1011
|
const blockContext = React.use(Context);
|
|
@@ -1140,9 +1146,9 @@ function createBlock(options) {
|
|
|
1140
1146
|
};
|
|
1141
1147
|
const BlockComponent = (t0) => {
|
|
1142
1148
|
const $ = c(70);
|
|
1143
|
-
if ($[0] !== "
|
|
1149
|
+
if ($[0] !== "50c74140b2fc3c96e656363dba6d1b89943fa30a4545390a9b1121f213cb8321") {
|
|
1144
1150
|
for (let $i = 0; $i < 70; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
1145
|
-
$[0] = "
|
|
1151
|
+
$[0] = "50c74140b2fc3c96e656363dba6d1b89943fa30a4545390a9b1121f213cb8321";
|
|
1146
1152
|
}
|
|
1147
1153
|
const { blockData, mode, isFirstBlock, showAddBlockTop, showAddBlockBottom, addBlockAfterPosition } = t0;
|
|
1148
1154
|
const isContentEditable = useIsEditable(mode);
|
|
@@ -1442,9 +1448,9 @@ function createBlock(options) {
|
|
|
1442
1448
|
*/
|
|
1443
1449
|
const Detached = (t0) => {
|
|
1444
1450
|
const $ = c(31);
|
|
1445
|
-
if ($[0] !== "
|
|
1451
|
+
if ($[0] !== "50c74140b2fc3c96e656363dba6d1b89943fa30a4545390a9b1121f213cb8321") {
|
|
1446
1452
|
for (let $i = 0; $i < 31; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
1447
|
-
$[0] = "
|
|
1453
|
+
$[0] = "50c74140b2fc3c96e656363dba6d1b89943fa30a4545390a9b1121f213cb8321";
|
|
1448
1454
|
}
|
|
1449
1455
|
const { children } = t0;
|
|
1450
1456
|
const ctx = React.use(Context);
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
+
import { trackClientEvent } from "../../../lib/telemetry-client.js";
|
|
1
2
|
import { previewStore } from "../previewStore.js";
|
|
2
3
|
import { PreviewSideSheet, Sheet } from "./PreviewSideSheet.js";
|
|
3
4
|
import { useProjectSlug } from "../../../lib/auth.js";
|
|
4
5
|
import { blockMutations, blockQueries, projectQueries } from "../../../lib/queries.js";
|
|
5
6
|
import { usePageBlocks } from "../../../lib/normalized-data.js";
|
|
6
7
|
import { useCamoxApp } from "../../provider/components/CamoxAppContext.js";
|
|
7
|
-
import { trackClientEvent } from "../../../lib/analytics-client.js";
|
|
8
8
|
import { usePreviewedPage } from "../CamoxPreview.js";
|
|
9
9
|
import { c } from "react/compiler-runtime";
|
|
10
10
|
import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
|
|
@@ -18,10 +18,10 @@ import { Command, CommandEmpty, CommandGroup, CommandInput, CommandItem, Command
|
|
|
18
18
|
|
|
19
19
|
//#region src/features/preview/components/AddBlockSheet.tsx
|
|
20
20
|
const AddBlockSheet = () => {
|
|
21
|
-
const $ = c(
|
|
22
|
-
if ($[0] !== "
|
|
23
|
-
for (let $i = 0; $i <
|
|
24
|
-
$[0] = "
|
|
21
|
+
const $ = c(60);
|
|
22
|
+
if ($[0] !== "eaa0318b13b193e792904949c4da8d4db94d4d7cfdb3255f0c3d4b505c4a3f1f") {
|
|
23
|
+
for (let $i = 0; $i < 60; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
24
|
+
$[0] = "eaa0318b13b193e792904949c4da8d4db94d4d7cfdb3255f0c3d4b505c4a3f1f";
|
|
25
25
|
}
|
|
26
26
|
const [highlightedValue, setHighlightedValue] = React.useState("");
|
|
27
27
|
const queryClient = useQueryClient();
|
|
@@ -163,8 +163,9 @@ const AddBlockSheet = () => {
|
|
|
163
163
|
const pageCounts = t8;
|
|
164
164
|
const isOpen = useSelector(previewStore, _temp4);
|
|
165
165
|
const peekedBlockPosition = useSelector(previewStore, _temp5);
|
|
166
|
+
const addBlockSource = useSelector(previewStore, _temp6);
|
|
166
167
|
let t9;
|
|
167
|
-
if ($[17] !==
|
|
168
|
+
if ($[17] !== addBlockSource || $[18] !== createBlock || $[19] !== page || $[20] !== pageBlocks_0 || $[21] !== peekedBlockPosition) {
|
|
168
169
|
t9 = async (block_0) => {
|
|
169
170
|
if (!page) return;
|
|
170
171
|
const afterPosition_0 = peekedBlockPosition === "" ? "" : peekedBlockPosition ?? pageBlocks_0[pageBlocks_0.length - 1]?.position;
|
|
@@ -178,8 +179,8 @@ const AddBlockSheet = () => {
|
|
|
178
179
|
repeatableItems: bundle.repeatableItems
|
|
179
180
|
});
|
|
180
181
|
trackClientEvent("block_added", {
|
|
181
|
-
|
|
182
|
-
|
|
182
|
+
blockType: block_0._internal.id,
|
|
183
|
+
via: addBlockSource ?? "unknown"
|
|
183
184
|
});
|
|
184
185
|
previewStore.send({
|
|
185
186
|
type: "focusCreatedBlock",
|
|
@@ -187,15 +188,16 @@ const AddBlockSheet = () => {
|
|
|
187
188
|
});
|
|
188
189
|
previewStore.send({ type: "exitPeekedBlock" });
|
|
189
190
|
};
|
|
190
|
-
$[17] =
|
|
191
|
-
$[18] =
|
|
192
|
-
$[19] =
|
|
193
|
-
$[20] =
|
|
194
|
-
$[21] =
|
|
195
|
-
|
|
191
|
+
$[17] = addBlockSource;
|
|
192
|
+
$[18] = createBlock;
|
|
193
|
+
$[19] = page;
|
|
194
|
+
$[20] = pageBlocks_0;
|
|
195
|
+
$[21] = peekedBlockPosition;
|
|
196
|
+
$[22] = t9;
|
|
197
|
+
} else t9 = $[22];
|
|
196
198
|
const handleAddBlock = t9;
|
|
197
199
|
let t10;
|
|
198
|
-
if ($[
|
|
200
|
+
if ($[23] !== pageBlocks_0 || $[24] !== peekedBlockPosition) {
|
|
199
201
|
t10 = (block_1) => {
|
|
200
202
|
const afterPosition_1 = peekedBlockPosition === "" ? "" : peekedBlockPosition ?? pageBlocks_0[pageBlocks_0.length - 1]?.position;
|
|
201
203
|
previewStore.send({
|
|
@@ -204,10 +206,10 @@ const AddBlockSheet = () => {
|
|
|
204
206
|
afterPosition: afterPosition_1
|
|
205
207
|
});
|
|
206
208
|
};
|
|
207
|
-
$[
|
|
208
|
-
$[
|
|
209
|
-
$[
|
|
210
|
-
} else t10 = $[
|
|
209
|
+
$[23] = pageBlocks_0;
|
|
210
|
+
$[24] = peekedBlockPosition;
|
|
211
|
+
$[25] = t10;
|
|
212
|
+
} else t10 = $[25];
|
|
211
213
|
const handlePreviewBlock = t10;
|
|
212
214
|
const handleValueChange = (value) => {
|
|
213
215
|
setHighlightedValue(value);
|
|
@@ -215,73 +217,73 @@ const AddBlockSheet = () => {
|
|
|
215
217
|
if (block_2) handlePreviewBlock(block_2);
|
|
216
218
|
else previewStore.send({ type: "clearPeekedBlock" });
|
|
217
219
|
};
|
|
218
|
-
const handleOpenChange =
|
|
220
|
+
const handleOpenChange = _temp7;
|
|
219
221
|
let t11;
|
|
220
222
|
let t12;
|
|
221
|
-
if ($[
|
|
223
|
+
if ($[26] !== isOpen) {
|
|
222
224
|
t11 = () => {
|
|
223
225
|
if (isOpen) setHighlightedValue("");
|
|
224
226
|
};
|
|
225
227
|
t12 = [isOpen];
|
|
226
|
-
$[
|
|
227
|
-
$[
|
|
228
|
-
$[
|
|
228
|
+
$[26] = isOpen;
|
|
229
|
+
$[27] = t11;
|
|
230
|
+
$[28] = t12;
|
|
229
231
|
} else {
|
|
230
|
-
t11 = $[
|
|
231
|
-
t12 = $[
|
|
232
|
+
t11 = $[27];
|
|
233
|
+
t12 = $[28];
|
|
232
234
|
}
|
|
233
235
|
React.useEffect(t11, t12);
|
|
234
236
|
let t13;
|
|
235
|
-
if ($[
|
|
237
|
+
if ($[29] !== pageCounts || $[30] !== totalCounts) {
|
|
236
238
|
t13 = (blockId_0) => {
|
|
237
239
|
const total = totalCounts[blockId_0] ?? 0;
|
|
238
240
|
if (total === 0) return "Never used";
|
|
239
241
|
const page_0 = pageCounts[blockId_0] ?? "none";
|
|
240
242
|
return `${total} use${total > 1 ? "s" : ""} (${page_0} here)`;
|
|
241
243
|
};
|
|
242
|
-
$[
|
|
243
|
-
$[
|
|
244
|
-
$[
|
|
245
|
-
} else t13 = $[
|
|
244
|
+
$[29] = pageCounts;
|
|
245
|
+
$[30] = totalCounts;
|
|
246
|
+
$[31] = t13;
|
|
247
|
+
} else t13 = $[31];
|
|
246
248
|
const displayCount = t13;
|
|
247
249
|
const T0 = PreviewSideSheet;
|
|
248
250
|
const t14 = "flex flex-col gap-0";
|
|
249
251
|
let t15;
|
|
250
|
-
if ($[
|
|
252
|
+
if ($[32] === Symbol.for("react.memo_cache_sentinel")) {
|
|
251
253
|
t15 = /* @__PURE__ */ jsxs(Sheet.SheetHeader, {
|
|
252
254
|
className: "border-border border-b",
|
|
253
255
|
children: [/* @__PURE__ */ jsx(Sheet.SheetTitle, { children: "Add new block" }), /* @__PURE__ */ jsx(Sheet.SheetDescription, { children: "Search and select a block to add to the page." })]
|
|
254
256
|
});
|
|
255
|
-
$[
|
|
256
|
-
} else t15 = $[
|
|
257
|
+
$[32] = t15;
|
|
258
|
+
} else t15 = $[32];
|
|
257
259
|
const t16 = "flex-1 overflow-auto p-2";
|
|
258
260
|
const T1 = Command;
|
|
259
261
|
const t17 = "overflow-visible";
|
|
260
|
-
const t18 =
|
|
262
|
+
const t18 = _temp8;
|
|
261
263
|
let t19;
|
|
262
|
-
if ($[
|
|
264
|
+
if ($[33] === Symbol.for("react.memo_cache_sentinel")) {
|
|
263
265
|
t19 = /* @__PURE__ */ jsx(CommandInput, {
|
|
264
266
|
placeholder: "Search blocks...",
|
|
265
267
|
autoFocus: true
|
|
266
268
|
});
|
|
267
|
-
$[
|
|
268
|
-
} else t19 = $[
|
|
269
|
+
$[33] = t19;
|
|
270
|
+
} else t19 = $[33];
|
|
269
271
|
const T2 = CommandList;
|
|
270
272
|
const t20 = "mt-1 max-h-full";
|
|
271
273
|
let t21;
|
|
272
|
-
if ($[
|
|
274
|
+
if ($[34] === Symbol.for("react.memo_cache_sentinel")) {
|
|
273
275
|
t21 = /* @__PURE__ */ jsx(CommandEmpty, { children: "No blocks found." });
|
|
274
|
-
$[
|
|
275
|
-
} else t21 = $[
|
|
276
|
+
$[34] = t21;
|
|
277
|
+
} else t21 = $[34];
|
|
276
278
|
const T3 = CommandGroup;
|
|
277
279
|
let t22;
|
|
278
|
-
if ($[
|
|
280
|
+
if ($[35] !== totalCounts) {
|
|
279
281
|
t22 = (a, b_3) => (totalCounts[b_3._internal.id] ?? 0) - (totalCounts[a._internal.id] ?? 0);
|
|
280
|
-
$[
|
|
281
|
-
$[
|
|
282
|
-
} else t22 = $[
|
|
282
|
+
$[35] = totalCounts;
|
|
283
|
+
$[36] = t22;
|
|
284
|
+
} else t22 = $[36];
|
|
283
285
|
let t23;
|
|
284
|
-
if ($[
|
|
286
|
+
if ($[37] !== displayCount || $[38] !== handleAddBlock) {
|
|
285
287
|
t23 = (block_3) => /* @__PURE__ */ jsx(CommandItem, {
|
|
286
288
|
value: block_3._internal.title,
|
|
287
289
|
onSelect: () => {
|
|
@@ -296,31 +298,31 @@ const AddBlockSheet = () => {
|
|
|
296
298
|
})]
|
|
297
299
|
})
|
|
298
300
|
}, block_3._internal.id);
|
|
299
|
-
$[
|
|
300
|
-
$[
|
|
301
|
-
$[
|
|
302
|
-
} else t23 = $[
|
|
301
|
+
$[37] = displayCount;
|
|
302
|
+
$[38] = handleAddBlock;
|
|
303
|
+
$[39] = t23;
|
|
304
|
+
} else t23 = $[39];
|
|
303
305
|
const t24 = availableBlocks.sort(t22).map(t23);
|
|
304
306
|
let t25;
|
|
305
|
-
if ($[
|
|
307
|
+
if ($[40] !== T3 || $[41] !== t24) {
|
|
306
308
|
t25 = /* @__PURE__ */ jsx(T3, { children: t24 });
|
|
307
|
-
$[
|
|
308
|
-
$[
|
|
309
|
-
$[
|
|
310
|
-
} else t25 = $[
|
|
309
|
+
$[40] = T3;
|
|
310
|
+
$[41] = t24;
|
|
311
|
+
$[42] = t25;
|
|
312
|
+
} else t25 = $[42];
|
|
311
313
|
let t26;
|
|
312
|
-
if ($[
|
|
314
|
+
if ($[43] !== T2 || $[44] !== t21 || $[45] !== t25) {
|
|
313
315
|
t26 = /* @__PURE__ */ jsxs(T2, {
|
|
314
316
|
className: t20,
|
|
315
317
|
children: [t21, t25]
|
|
316
318
|
});
|
|
317
|
-
$[
|
|
318
|
-
$[
|
|
319
|
-
$[
|
|
320
|
-
$[
|
|
321
|
-
} else t26 = $[
|
|
319
|
+
$[43] = T2;
|
|
320
|
+
$[44] = t21;
|
|
321
|
+
$[45] = t25;
|
|
322
|
+
$[46] = t26;
|
|
323
|
+
} else t26 = $[46];
|
|
322
324
|
let t27;
|
|
323
|
-
if ($[
|
|
325
|
+
if ($[47] !== T1 || $[48] !== handleValueChange || $[49] !== highlightedValue || $[50] !== t18 || $[51] !== t19 || $[52] !== t26) {
|
|
324
326
|
t27 = /* @__PURE__ */ jsx("div", {
|
|
325
327
|
className: t16,
|
|
326
328
|
children: /* @__PURE__ */ jsxs(T1, {
|
|
@@ -331,29 +333,29 @@ const AddBlockSheet = () => {
|
|
|
331
333
|
children: [t19, t26]
|
|
332
334
|
})
|
|
333
335
|
});
|
|
334
|
-
$[
|
|
335
|
-
$[
|
|
336
|
-
$[
|
|
337
|
-
$[
|
|
338
|
-
$[
|
|
339
|
-
$[
|
|
340
|
-
$[
|
|
341
|
-
} else t27 = $[
|
|
336
|
+
$[47] = T1;
|
|
337
|
+
$[48] = handleValueChange;
|
|
338
|
+
$[49] = highlightedValue;
|
|
339
|
+
$[50] = t18;
|
|
340
|
+
$[51] = t19;
|
|
341
|
+
$[52] = t26;
|
|
342
|
+
$[53] = t27;
|
|
343
|
+
} else t27 = $[53];
|
|
342
344
|
let t28;
|
|
343
|
-
if ($[
|
|
345
|
+
if ($[54] !== T0 || $[55] !== handleOpenChange || $[56] !== isOpen || $[57] !== t15 || $[58] !== t27) {
|
|
344
346
|
t28 = /* @__PURE__ */ jsxs(T0, {
|
|
345
347
|
open: isOpen,
|
|
346
348
|
onOpenChange: handleOpenChange,
|
|
347
349
|
className: t14,
|
|
348
350
|
children: [t15, t27]
|
|
349
351
|
});
|
|
350
|
-
$[
|
|
351
|
-
$[
|
|
352
|
-
$[
|
|
353
|
-
$[
|
|
354
|
-
$[
|
|
355
|
-
$[
|
|
356
|
-
} else t28 = $[
|
|
352
|
+
$[54] = T0;
|
|
353
|
+
$[55] = handleOpenChange;
|
|
354
|
+
$[56] = isOpen;
|
|
355
|
+
$[57] = t15;
|
|
356
|
+
$[58] = t27;
|
|
357
|
+
$[59] = t28;
|
|
358
|
+
} else t28 = $[59];
|
|
357
359
|
return t28;
|
|
358
360
|
};
|
|
359
361
|
function _temp(state) {
|
|
@@ -371,10 +373,13 @@ function _temp4(state_0) {
|
|
|
371
373
|
function _temp5(state_1) {
|
|
372
374
|
return state_1.context.peekedBlockPosition;
|
|
373
375
|
}
|
|
374
|
-
function _temp6(
|
|
376
|
+
function _temp6(state_2) {
|
|
377
|
+
return state_2.context.addBlockSource;
|
|
378
|
+
}
|
|
379
|
+
function _temp7(open) {
|
|
375
380
|
if (!open) previewStore.send({ type: "closeAddBlockSheet" });
|
|
376
381
|
}
|
|
377
|
-
function
|
|
382
|
+
function _temp8(e) {
|
|
378
383
|
if (e.key === "Escape") previewStore.send({ type: "closeAddBlockSheet" });
|
|
379
384
|
}
|
|
380
385
|
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { trackClientEvent } from "../../../lib/telemetry-client.js";
|
|
1
2
|
import { getAuthCookieHeader } from "../../../lib/auth.js";
|
|
2
3
|
import { getApiUrl, getEnvironmentName } from "../../../lib/api-client.js";
|
|
3
4
|
import { fileMutations, fileQueries } from "../../../lib/queries.js";
|
|
@@ -19,9 +20,9 @@ import { ButtonGroup } from "@camox/ui/button-group";
|
|
|
19
20
|
//#region src/features/preview/components/AssetLightbox.tsx
|
|
20
21
|
function MetadataRow(t0) {
|
|
21
22
|
const $ = c(9);
|
|
22
|
-
if ($[0] !== "
|
|
23
|
+
if ($[0] !== "37940925d91368c87c0e95d97da969b420d7241705fd90761ebca29def086c1e") {
|
|
23
24
|
for (let $i = 0; $i < 9; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
24
|
-
$[0] = "
|
|
25
|
+
$[0] = "37940925d91368c87c0e95d97da969b420d7241705fd90761ebca29def086c1e";
|
|
25
26
|
}
|
|
26
27
|
const { label, children } = t0;
|
|
27
28
|
let t1;
|
|
@@ -344,10 +345,18 @@ const AssetLightbox = ({ open, onOpenChange, fileId }) => {
|
|
|
344
345
|
children: [/* @__PURE__ */ jsx(Switch, {
|
|
345
346
|
id: "ai-metadata",
|
|
346
347
|
checked: file.aiMetadataEnabled !== false,
|
|
347
|
-
onCheckedChange: (checked) =>
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
348
|
+
onCheckedChange: (checked) => {
|
|
349
|
+
setAiMetadata.mutate({
|
|
350
|
+
id: fileId,
|
|
351
|
+
enabled: checked
|
|
352
|
+
});
|
|
353
|
+
trackClientEvent("ai_metadata_toggled", {
|
|
354
|
+
target: "file",
|
|
355
|
+
enabled: checked,
|
|
356
|
+
fileId,
|
|
357
|
+
mimeType: file.mimeType
|
|
358
|
+
});
|
|
359
|
+
}
|
|
351
360
|
}), /* @__PURE__ */ jsx(Label, {
|
|
352
361
|
htmlFor: "ai-metadata",
|
|
353
362
|
children: "AI metadata"
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
+
import { trackClientEvent } from "../../../lib/telemetry-client.js";
|
|
1
2
|
import { previewStore, selectionItemId } from "../previewStore.js";
|
|
2
3
|
import { actionsStore } from "../../provider/actionsStore.js";
|
|
3
4
|
import { blockMutations, repeatableItemMutations } from "../../../lib/queries.js";
|
|
4
5
|
import { formatShortcut } from "../../../lib/utils.js";
|
|
5
6
|
import { usePageBlocks } from "../../../lib/normalized-data.js";
|
|
6
7
|
import { useCamoxApp } from "../../provider/components/CamoxAppContext.js";
|
|
7
|
-
import { trackClientEvent } from "../../../lib/analytics-client.js";
|
|
8
8
|
import { useUpdateBlockPosition } from "./useUpdateBlockPosition.js";
|
|
9
9
|
import { usePreviewedPage } from "../CamoxPreview.js";
|
|
10
10
|
import { c } from "react/compiler-runtime";
|
|
@@ -61,13 +61,15 @@ const BlockActionsPopover = ({ block, children, open, onOpenChange, align = "sta
|
|
|
61
61
|
const afterPosition = blockIndex > 0 ? pageBlocks[blockIndex - 1].position : "";
|
|
62
62
|
previewStore.send({
|
|
63
63
|
type: "openAddBlockSheet",
|
|
64
|
-
afterPosition
|
|
64
|
+
afterPosition,
|
|
65
|
+
via: "popover-above"
|
|
65
66
|
});
|
|
66
67
|
};
|
|
67
68
|
const handleAddBlockBelow = (block_3) => {
|
|
68
69
|
previewStore.send({
|
|
69
70
|
type: "openAddBlockSheet",
|
|
70
|
-
afterPosition: block_3.position
|
|
71
|
+
afterPosition: block_3.position,
|
|
72
|
+
via: "popover-below"
|
|
71
73
|
});
|
|
72
74
|
};
|
|
73
75
|
const getBlocksAbove = (block_4) => {
|
|
@@ -149,7 +151,8 @@ const BlockActionsPopover = ({ block, children, open, onOpenChange, align = "sta
|
|
|
149
151
|
onSelect: () => {
|
|
150
152
|
previewStore.send({
|
|
151
153
|
type: "openAddBlockSheet",
|
|
152
|
-
afterPosition: ""
|
|
154
|
+
afterPosition: "",
|
|
155
|
+
via: "layout-popover-below"
|
|
153
156
|
});
|
|
154
157
|
onOpenChange(false);
|
|
155
158
|
},
|
|
@@ -163,7 +166,8 @@ const BlockActionsPopover = ({ block, children, open, onOpenChange, align = "sta
|
|
|
163
166
|
const lastPageBlock = pageBlocks[pageBlocks.length - 1];
|
|
164
167
|
previewStore.send({
|
|
165
168
|
type: "openAddBlockSheet",
|
|
166
|
-
afterPosition: lastPageBlock?.position
|
|
169
|
+
afterPosition: lastPageBlock?.position,
|
|
170
|
+
via: "layout-popover-above"
|
|
167
171
|
});
|
|
168
172
|
onOpenChange(false);
|
|
169
173
|
},
|
|
@@ -274,9 +278,9 @@ function isLayoutBlockId(page, blockId) {
|
|
|
274
278
|
}
|
|
275
279
|
function useBlockActionsShortcuts() {
|
|
276
280
|
const $ = c(18);
|
|
277
|
-
if ($[0] !== "
|
|
281
|
+
if ($[0] !== "0da04562301d59bc2d765af3fb0de3a8d133aacfaa39cfb8bfd25dbd31bf0320") {
|
|
278
282
|
for (let $i = 0; $i < 18; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
279
|
-
$[0] = "
|
|
283
|
+
$[0] = "0da04562301d59bc2d765af3fb0de3a8d133aacfaa39cfb8bfd25dbd31bf0320";
|
|
280
284
|
}
|
|
281
285
|
const camoxApp = useCamoxApp();
|
|
282
286
|
const page = usePreviewedPage();
|
|
@@ -454,7 +458,8 @@ function useBlockActionsShortcuts() {
|
|
|
454
458
|
if (!block_2) return;
|
|
455
459
|
previewStore.send({
|
|
456
460
|
type: "openAddBlockSheet",
|
|
457
|
-
afterPosition: block_2.position
|
|
461
|
+
afterPosition: block_2.position,
|
|
462
|
+
via: "shortcut-below"
|
|
458
463
|
});
|
|
459
464
|
}
|
|
460
465
|
},
|
|
@@ -475,7 +480,8 @@ function useBlockActionsShortcuts() {
|
|
|
475
480
|
const afterPosition_1 = blockIndex > 0 ? pageBlocks[blockIndex - 1].position : "";
|
|
476
481
|
previewStore.send({
|
|
477
482
|
type: "openAddBlockSheet",
|
|
478
|
-
afterPosition: afterPosition_1
|
|
483
|
+
afterPosition: afterPosition_1,
|
|
484
|
+
via: "shortcut-above"
|
|
479
485
|
});
|
|
480
486
|
}
|
|
481
487
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
import { trackClientEvent } from "../../../lib/telemetry-client.js";
|
|
1
2
|
import { previewStore } from "../previewStore.js";
|
|
2
3
|
import { useProjectSlug } from "../../../lib/auth.js";
|
|
3
4
|
import { layoutQueries, pageMutations, pageQueries, projectQueries } from "../../../lib/queries.js";
|
|
4
5
|
import { useCamoxApp } from "../../provider/components/CamoxAppContext.js";
|
|
5
|
-
import { trackClientEvent } from "../../../lib/analytics-client.js";
|
|
6
6
|
import { PageLocationFieldset } from "./PageLocationFieldset.js";
|
|
7
7
|
import { Label } from "@camox/ui/label";
|
|
8
8
|
import { toast } from "@camox/ui/toaster";
|