camox 0.40.0 → 0.41.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/components/PlatformLabel.js +62 -0
- package/dist/core/components/lexical/GradientNode.js +126 -0
- package/dist/core/components/lexical/InlineLexicalEditor.js +37 -56
- package/dist/core/components/lexical/InlineStylesPlugin.js +183 -0
- package/dist/core/components/lexical/SelectionBroadcaster.js +49 -46
- package/dist/core/components/lexical/SidebarLexicalEditor.js +197 -151
- package/dist/core/components/lexical/editorConfig.js +25 -7
- package/dist/core/components/lexical/selectTextLink.js +21 -0
- package/dist/core/createApp.d.ts +30 -17
- package/dist/core/createApp.js +14 -3
- package/dist/core/createBlock.d.ts +2 -2
- package/dist/core/createBlock.js +18 -15
- package/dist/core/createLayout.d.ts +48 -4
- package/dist/core/createLayout.js +51 -23
- package/dist/core/derivedRoutes.js +36 -0
- package/dist/core/editing/createEditableBlock.d.ts +9 -8
- package/dist/core/editing/createEditableBlock.js +167 -168
- package/dist/core/lib/lexicalReact.d.ts +1 -26
- package/dist/core/lib/lexicalReact.js +46 -60
- package/dist/core/lib/lexicalState.js +164 -81
- package/dist/core/lib/modifierFormats.js +4 -15
- package/dist/core/lib/textStyles.d.ts +27 -0
- package/dist/core/lib/textStyles.js +47 -0
- package/dist/features/navigation/navigation.d.ts +2 -0
- package/dist/features/navigation/navigation.js +51 -46
- package/dist/features/page/DerivedPageContent.js +61 -0
- package/dist/features/page/PublishedPageContent.js +52 -83
- package/dist/features/page/SharedLayoutContent.js +66 -0
- package/dist/features/preview/CamoxPreview.d.ts +16 -1
- package/dist/features/preview/CamoxPreview.js +242 -265
- package/dist/features/preview/DerivedPreview.js +137 -0
- package/dist/features/preview/EditablePageExperience.js +25 -8
- package/dist/features/preview/components/AddBlockSidebar.js +43 -33
- package/dist/features/preview/components/AssetLightbox.js +1 -1
- package/dist/features/preview/components/BlockThumbnail.js +192 -0
- package/dist/features/preview/components/CreatePageModal.js +123 -115
- package/dist/features/preview/components/DerivedLayoutDialog.js +100 -0
- package/dist/features/preview/components/DerivedLayoutSidebar.d.ts +5 -0
- package/dist/features/preview/components/DerivedLayoutSidebar.js +163 -0
- package/dist/features/preview/components/DerivedPageInfoSidebar.js +57 -0
- package/dist/features/preview/components/FieldToolbar.js +42 -20
- package/dist/features/preview/components/Frame.js +133 -140
- package/dist/features/preview/components/LeftSidebar.js +42 -38
- package/dist/features/preview/components/MobilePreviewDrawer.js +4 -4
- package/dist/features/preview/components/Overlays.js +57 -42
- package/dist/features/preview/components/PageInfoSidebar.js +63 -55
- package/dist/features/preview/components/PageNavigatorSidebar.js +34 -483
- package/dist/features/preview/components/PagePicker.js +205 -153
- package/dist/features/preview/components/PageTree.js +298 -206
- package/dist/features/preview/components/PreviewActivation.js +78 -0
- package/dist/features/preview/components/PreviewPanel.js +67 -35
- package/dist/features/preview/components/PreviewToolbar.js +218 -232
- package/dist/features/preview/components/PublicationRow.js +431 -0
- package/dist/features/preview/components/PublishDialog.js +180 -97
- package/dist/features/preview/components/RightSidebar.js +19 -34
- package/dist/features/preview/components/previewStyles.js +8 -0
- package/dist/features/preview/components/useUpdateBlockPosition.js +7 -13
- package/dist/features/preview/previewConstants.js +8 -0
- package/dist/features/preview/previewStore.js +0 -10
- package/dist/features/preview/publication.js +71 -0
- package/dist/features/provider/AuthenticatedCamoxProvider.js +2 -1
- package/dist/features/provider/CoreCamoxProvider.js +11 -2
- package/dist/features/provider/LocalhostPreviewProvider.js +6 -7
- package/dist/features/routes/pageRuntime.d.ts +10 -0
- package/dist/features/routes/pageRuntime.js +7 -9
- package/dist/features/runtime/PreviewDocumentContext.js +7 -0
- package/dist/features/runtime/RuntimeChrome.js +137 -0
- package/dist/features/runtime/SharedChromeContext.js +7 -0
- package/dist/features/runtime/navigationRequest.js +21 -0
- package/dist/features/runtime/navigationTarget.js +23 -0
- package/dist/features/runtime/pageApp.js +196 -121
- package/dist/features/runtime/pageNavigation.js +79 -130
- package/dist/features/runtime/runtime.d.ts +11 -0
- package/dist/features/runtime/runtime.js +183 -47
- package/dist/features/runtime/studioApp.d.ts +2 -11
- package/dist/features/runtime/studioApp.js +14 -177
- package/dist/features/studio/CamoxStudio.js +27 -13
- package/dist/features/studio/components/Navbar.js +80 -74
- package/dist/features/studio/studioTheme.js +25 -0
- package/dist/features/studio/useTheme.js +94 -109
- package/dist/features/vite/appGeneration.js +12 -3
- package/dist/features/vite/definitionsSync.js +4 -2
- package/dist/features/vite/layoutGeneration.js +38 -0
- package/dist/features/vite/runtimeDev.js +3 -1
- package/dist/lib/auth.js +15 -13
- package/dist/lib/normalized-data.js +4 -4
- package/dist/lib/platform.js +13 -0
- package/dist/lib/utils.js +90 -38
- package/dist/studio-overlays.css +5 -40
- package/dist/studio.css +1 -1
- package/package.json +8 -4
- package/skills/camox/SKILL.md +2 -0
- package/skills/camox/references/block-definitions.md +31 -12
- package/skills/camox/references/layout-definitions.md +2 -0
- package/dist/core/lib/modifiers.js +0 -24
- package/dist/features/preview/previewQueryFns.js +0 -23
- package/dist/features/runtime/studioNavigation.js +0 -120
|
@@ -185,7 +185,7 @@ function createEditableBlock(options) {
|
|
|
185
185
|
if (repeaterContext?.itemId != null) return `${blockId}__${repeaterContext.itemId}__${fieldName}`;
|
|
186
186
|
return `${blockId}__${fieldName}`;
|
|
187
187
|
};
|
|
188
|
-
const Field = ({ name,
|
|
188
|
+
const Field = ({ name, textStyle, linkStyle, children }) => {
|
|
189
189
|
const blockContext = React.use(Context);
|
|
190
190
|
if (!blockContext) throw new Error("Field must be used within a Block Component");
|
|
191
191
|
const { blockId, content, mode } = blockContext;
|
|
@@ -268,17 +268,22 @@ function createEditableBlock(options) {
|
|
|
268
268
|
if (!isContentEditable) return /* @__PURE__ */ jsx(Fragment, { children: children({ children: markdownToReactNodes(fieldValue, {
|
|
269
269
|
pages,
|
|
270
270
|
fallbackHref: currentPathname,
|
|
271
|
-
|
|
271
|
+
textStyle,
|
|
272
|
+
linkStyle
|
|
272
273
|
}) }, fieldData) });
|
|
273
274
|
return /* @__PURE__ */ jsx(Fragment, { children: children({
|
|
274
275
|
ref: elementRef,
|
|
275
276
|
"data-camox-field-id": fieldId,
|
|
276
277
|
"data-camox-hovered": isHovered || void 0,
|
|
277
278
|
"data-camox-focused": isFocused || void 0,
|
|
278
|
-
"data-camox-overlay-mode":
|
|
279
|
+
"data-camox-overlay-mode": options.synced ? "synced" : void 0,
|
|
279
280
|
onMouseEnter: handleMouseEnter,
|
|
280
281
|
onMouseLeave: handleMouseLeave,
|
|
281
282
|
children: /* @__PURE__ */ jsx(InlineLexicalEditor, {
|
|
283
|
+
textStyle,
|
|
284
|
+
linkStyle,
|
|
285
|
+
pages,
|
|
286
|
+
fallbackHref: currentPathname,
|
|
282
287
|
initialState: fieldValue,
|
|
283
288
|
externalState: fieldValue,
|
|
284
289
|
onChange: handleChange,
|
|
@@ -288,10 +293,10 @@ function createEditableBlock(options) {
|
|
|
288
293
|
}, fieldData) });
|
|
289
294
|
};
|
|
290
295
|
const Embed = (t0) => {
|
|
291
|
-
const $ = c(
|
|
292
|
-
if ($[0] !== "
|
|
293
|
-
for (let $i = 0; $i <
|
|
294
|
-
$[0] = "
|
|
296
|
+
const $ = c(58);
|
|
297
|
+
if ($[0] !== "ee337cec5e11d36faec1dbbceae05725a869a147239dea80dd42ee4c38b26512") {
|
|
298
|
+
for (let $i = 0; $i < 58; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
299
|
+
$[0] = "ee337cec5e11d36faec1dbbceae05725a869a147239dea80dd42ee4c38b26512";
|
|
295
300
|
}
|
|
296
301
|
const { name, children } = t0;
|
|
297
302
|
const blockContext = React.use(Context);
|
|
@@ -434,29 +439,28 @@ function createEditableBlock(options) {
|
|
|
434
439
|
const t17 = isContentEditable ? "embed" : void 0;
|
|
435
440
|
const t18 = isContentEditable && isHovered || void 0;
|
|
436
441
|
const t19 = isContentEditable && isOpen || void 0;
|
|
437
|
-
|
|
438
|
-
let t21;
|
|
442
|
+
let t20;
|
|
439
443
|
if ($[28] !== isContentEditable) {
|
|
440
|
-
|
|
444
|
+
t20 = isContentEditable ? () => setIsHovered(true) : void 0;
|
|
441
445
|
$[28] = isContentEditable;
|
|
442
|
-
$[29] =
|
|
443
|
-
} else
|
|
444
|
-
let
|
|
446
|
+
$[29] = t20;
|
|
447
|
+
} else t20 = $[29];
|
|
448
|
+
let t21;
|
|
445
449
|
if ($[30] !== isContentEditable) {
|
|
446
|
-
|
|
450
|
+
t21 = isContentEditable ? () => setIsHovered(false) : void 0;
|
|
447
451
|
$[30] = isContentEditable;
|
|
448
|
-
$[31] =
|
|
449
|
-
} else
|
|
450
|
-
let
|
|
451
|
-
if ($[32] !== t16 || $[33] !== t17 || $[34] !== t18 || $[35] !== t19 || $[36] !== t20 || $[37] !== t21
|
|
452
|
-
|
|
452
|
+
$[31] = t21;
|
|
453
|
+
} else t21 = $[31];
|
|
454
|
+
let t22;
|
|
455
|
+
if ($[32] !== t16 || $[33] !== t17 || $[34] !== t18 || $[35] !== t19 || $[36] !== t20 || $[37] !== t21) {
|
|
456
|
+
t22 = /* @__PURE__ */ jsx("div", {
|
|
453
457
|
"data-camox-field-id": t16,
|
|
454
458
|
"data-camox-field-type": t17,
|
|
455
459
|
"data-camox-hovered": t18,
|
|
456
460
|
"data-camox-focused": t19,
|
|
457
|
-
"data-camox-overlay-mode":
|
|
458
|
-
onMouseEnter:
|
|
459
|
-
onMouseLeave:
|
|
461
|
+
"data-camox-overlay-mode": options.synced ? "synced" : void 0,
|
|
462
|
+
onMouseEnter: t20,
|
|
463
|
+
onMouseLeave: t21
|
|
460
464
|
});
|
|
461
465
|
$[32] = t16;
|
|
462
466
|
$[33] = t17;
|
|
@@ -465,40 +469,39 @@ function createEditableBlock(options) {
|
|
|
465
469
|
$[36] = t20;
|
|
466
470
|
$[37] = t21;
|
|
467
471
|
$[38] = t22;
|
|
468
|
-
|
|
469
|
-
|
|
472
|
+
} else t22 = $[38];
|
|
473
|
+
let t23;
|
|
474
|
+
if ($[39] !== children || $[40] !== fieldValue) {
|
|
475
|
+
t23 = children({ src: fieldValue }, { url: fieldValue });
|
|
476
|
+
$[39] = children;
|
|
477
|
+
$[40] = fieldValue;
|
|
478
|
+
$[41] = t23;
|
|
479
|
+
} else t23 = $[41];
|
|
470
480
|
let t24;
|
|
471
|
-
if ($[
|
|
472
|
-
t24 =
|
|
473
|
-
$[40] = children;
|
|
474
|
-
$[41] = fieldValue;
|
|
475
|
-
$[42] = t24;
|
|
476
|
-
} else t24 = $[42];
|
|
477
|
-
let t25;
|
|
478
|
-
if ($[43] !== isContentEditable) {
|
|
479
|
-
t25 = isContentEditable && /* @__PURE__ */ jsx("div", { style: {
|
|
481
|
+
if ($[42] !== isContentEditable) {
|
|
482
|
+
t24 = isContentEditable && /* @__PURE__ */ jsx("div", { style: {
|
|
480
483
|
position: "absolute",
|
|
481
484
|
inset: 0,
|
|
482
485
|
zIndex: 10
|
|
483
486
|
} });
|
|
484
|
-
$[
|
|
485
|
-
$[
|
|
486
|
-
} else
|
|
487
|
-
let
|
|
488
|
-
if ($[
|
|
489
|
-
|
|
490
|
-
render:
|
|
487
|
+
$[42] = isContentEditable;
|
|
488
|
+
$[43] = t24;
|
|
489
|
+
} else t24 = $[43];
|
|
490
|
+
let t25;
|
|
491
|
+
if ($[44] !== t22 || $[45] !== t23 || $[46] !== t24) {
|
|
492
|
+
t25 = /* @__PURE__ */ jsxs(PopoverTrigger, {
|
|
493
|
+
render: t22,
|
|
491
494
|
nativeButton: false,
|
|
492
|
-
children: [
|
|
495
|
+
children: [t23, t24]
|
|
493
496
|
});
|
|
497
|
+
$[44] = t22;
|
|
494
498
|
$[45] = t23;
|
|
495
499
|
$[46] = t24;
|
|
496
500
|
$[47] = t25;
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
t27 = isContentEditable && /* @__PURE__ */ jsx(PopoverContent, {
|
|
501
|
+
} else t25 = $[47];
|
|
502
|
+
let t26;
|
|
503
|
+
if ($[48] !== handleUrlChange || $[49] !== isContentEditable || $[50] !== name || $[51] !== urlValue) {
|
|
504
|
+
t26 = isContentEditable && /* @__PURE__ */ jsx(PopoverContent, {
|
|
502
505
|
className: "w-96 gap-2",
|
|
503
506
|
children: /* @__PURE__ */ jsxs("form", {
|
|
504
507
|
className: "grid gap-2",
|
|
@@ -513,32 +516,32 @@ function createEditableBlock(options) {
|
|
|
513
516
|
})]
|
|
514
517
|
})
|
|
515
518
|
});
|
|
516
|
-
$[
|
|
517
|
-
$[
|
|
518
|
-
$[
|
|
519
|
-
$[
|
|
520
|
-
$[
|
|
521
|
-
} else
|
|
522
|
-
let
|
|
523
|
-
if ($[
|
|
524
|
-
|
|
519
|
+
$[48] = handleUrlChange;
|
|
520
|
+
$[49] = isContentEditable;
|
|
521
|
+
$[50] = name;
|
|
522
|
+
$[51] = urlValue;
|
|
523
|
+
$[52] = t26;
|
|
524
|
+
} else t26 = $[52];
|
|
525
|
+
let t27;
|
|
526
|
+
if ($[53] !== t14 || $[54] !== t15 || $[55] !== t25 || $[56] !== t26) {
|
|
527
|
+
t27 = /* @__PURE__ */ jsxs(Popover, {
|
|
525
528
|
open: t14,
|
|
526
529
|
onOpenChange: t15,
|
|
527
|
-
children: [
|
|
530
|
+
children: [t25, t26]
|
|
528
531
|
});
|
|
529
|
-
$[
|
|
530
|
-
$[
|
|
532
|
+
$[53] = t14;
|
|
533
|
+
$[54] = t15;
|
|
534
|
+
$[55] = t25;
|
|
531
535
|
$[56] = t26;
|
|
532
536
|
$[57] = t27;
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
return t28;
|
|
537
|
+
} else t27 = $[57];
|
|
538
|
+
return t27;
|
|
536
539
|
};
|
|
537
540
|
const Link = (t0) => {
|
|
538
541
|
const $ = c(38);
|
|
539
|
-
if ($[0] !== "
|
|
542
|
+
if ($[0] !== "ee337cec5e11d36faec1dbbceae05725a869a147239dea80dd42ee4c38b26512") {
|
|
540
543
|
for (let $i = 0; $i < 38; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
541
|
-
$[0] = "
|
|
544
|
+
$[0] = "ee337cec5e11d36faec1dbbceae05725a869a147239dea80dd42ee4c38b26512";
|
|
542
545
|
}
|
|
543
546
|
const { name, children } = t0;
|
|
544
547
|
const blockContext = React.use(Context);
|
|
@@ -722,7 +725,7 @@ function createEditableBlock(options) {
|
|
|
722
725
|
"data-camox-field-id": fieldId,
|
|
723
726
|
"data-camox-hovered": isHovered || void 0,
|
|
724
727
|
"data-camox-focused": isFocused || void 0,
|
|
725
|
-
"data-camox-overlay-mode":
|
|
728
|
+
"data-camox-overlay-mode": options.synced ? "synced" : void 0,
|
|
726
729
|
contentEditable: true,
|
|
727
730
|
onClick: _temp2,
|
|
728
731
|
onInput: handleInput,
|
|
@@ -777,9 +780,9 @@ function createEditableBlock(options) {
|
|
|
777
780
|
};
|
|
778
781
|
const Image = (t0) => {
|
|
779
782
|
const $ = c(22);
|
|
780
|
-
if ($[0] !== "
|
|
783
|
+
if ($[0] !== "ee337cec5e11d36faec1dbbceae05725a869a147239dea80dd42ee4c38b26512") {
|
|
781
784
|
for (let $i = 0; $i < 22; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
782
|
-
$[0] = "
|
|
785
|
+
$[0] = "ee337cec5e11d36faec1dbbceae05725a869a147239dea80dd42ee4c38b26512";
|
|
783
786
|
}
|
|
784
787
|
const { name, children } = t0;
|
|
785
788
|
const blockContext = React.use(Context);
|
|
@@ -861,7 +864,7 @@ function createEditableBlock(options) {
|
|
|
861
864
|
const t5 = "image";
|
|
862
865
|
const t6 = isHovered || void 0;
|
|
863
866
|
const t7 = isFocused || void 0;
|
|
864
|
-
const t8 =
|
|
867
|
+
const t8 = options.synced ? "synced" : void 0;
|
|
865
868
|
let t10;
|
|
866
869
|
let t9;
|
|
867
870
|
if ($[11] === Symbol.for("react.memo_cache_sentinel")) {
|
|
@@ -901,9 +904,9 @@ function createEditableBlock(options) {
|
|
|
901
904
|
};
|
|
902
905
|
const File = (t0) => {
|
|
903
906
|
const $ = c(9);
|
|
904
|
-
if ($[0] !== "
|
|
907
|
+
if ($[0] !== "ee337cec5e11d36faec1dbbceae05725a869a147239dea80dd42ee4c38b26512") {
|
|
905
908
|
for (let $i = 0; $i < 9; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
906
|
-
$[0] = "
|
|
909
|
+
$[0] = "ee337cec5e11d36faec1dbbceae05725a869a147239dea80dd42ee4c38b26512";
|
|
907
910
|
}
|
|
908
911
|
const { name, children } = t0;
|
|
909
912
|
const blockContext = React.use(Context);
|
|
@@ -977,10 +980,10 @@ function createEditableBlock(options) {
|
|
|
977
980
|
const ImageList = _AssetList;
|
|
978
981
|
const FileList = _AssetList;
|
|
979
982
|
const RepeaterItemWrapper = (t0) => {
|
|
980
|
-
const $ = c(
|
|
981
|
-
if ($[0] !== "
|
|
982
|
-
for (let $i = 0; $i <
|
|
983
|
-
$[0] = "
|
|
983
|
+
const $ = c(8);
|
|
984
|
+
if ($[0] !== "ee337cec5e11d36faec1dbbceae05725a869a147239dea80dd42ee4c38b26512") {
|
|
985
|
+
for (let $i = 0; $i < 8; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
986
|
+
$[0] = "ee337cec5e11d36faec1dbbceae05725a869a147239dea80dd42ee4c38b26512";
|
|
984
987
|
}
|
|
985
988
|
const { itemId, blockId, mode, children } = t0;
|
|
986
989
|
const isContentEditable = useIsEditable(mode);
|
|
@@ -1002,28 +1005,26 @@ function createEditableBlock(options) {
|
|
|
1002
1005
|
const showOverlay = isContentEditable && (isHovered || isRepeaterHovered);
|
|
1003
1006
|
const t4 = isContentEditable ? itemId : void 0;
|
|
1004
1007
|
const t5 = showOverlay || void 0;
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
t7 = /* @__PURE__ */ jsx("div", {
|
|
1008
|
+
let t6;
|
|
1009
|
+
if ($[4] !== children || $[5] !== t4 || $[6] !== t5) {
|
|
1010
|
+
t6 = /* @__PURE__ */ jsx("div", {
|
|
1009
1011
|
"data-camox-repeater-item-id": t4,
|
|
1010
1012
|
"data-camox-hovered": t5,
|
|
1011
|
-
"data-camox-overlay-mode":
|
|
1013
|
+
"data-camox-overlay-mode": options.synced ? "synced" : void 0,
|
|
1012
1014
|
children
|
|
1013
1015
|
});
|
|
1014
1016
|
$[4] = children;
|
|
1015
1017
|
$[5] = t4;
|
|
1016
1018
|
$[6] = t5;
|
|
1017
1019
|
$[7] = t6;
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
return t7;
|
|
1020
|
+
} else t6 = $[7];
|
|
1021
|
+
return t6;
|
|
1021
1022
|
};
|
|
1022
1023
|
const RepeaterHoverProvider = (t0) => {
|
|
1023
1024
|
const $ = c(7);
|
|
1024
|
-
if ($[0] !== "
|
|
1025
|
+
if ($[0] !== "ee337cec5e11d36faec1dbbceae05725a869a147239dea80dd42ee4c38b26512") {
|
|
1025
1026
|
for (let $i = 0; $i < 7; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
1026
|
-
$[0] = "
|
|
1027
|
+
$[0] = "ee337cec5e11d36faec1dbbceae05725a869a147239dea80dd42ee4c38b26512";
|
|
1027
1028
|
}
|
|
1028
1029
|
const { blockId, fieldName, children } = t0;
|
|
1029
1030
|
const isContentEditable = useIsEditable("site");
|
|
@@ -1054,9 +1055,9 @@ function createEditableBlock(options) {
|
|
|
1054
1055
|
};
|
|
1055
1056
|
const Repeater = (t0) => {
|
|
1056
1057
|
const $ = c(27);
|
|
1057
|
-
if ($[0] !== "
|
|
1058
|
+
if ($[0] !== "ee337cec5e11d36faec1dbbceae05725a869a147239dea80dd42ee4c38b26512") {
|
|
1058
1059
|
for (let $i = 0; $i < 27; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
1059
|
-
$[0] = "
|
|
1060
|
+
$[0] = "ee337cec5e11d36faec1dbbceae05725a869a147239dea80dd42ee4c38b26512";
|
|
1060
1061
|
}
|
|
1061
1062
|
const { name, children } = t0;
|
|
1062
1063
|
const blockContext = React.use(Context);
|
|
@@ -1180,10 +1181,10 @@ function createEditableBlock(options) {
|
|
|
1180
1181
|
return t4;
|
|
1181
1182
|
};
|
|
1182
1183
|
const BlockComponent = (t0) => {
|
|
1183
|
-
const $ = c(
|
|
1184
|
-
if ($[0] !== "
|
|
1185
|
-
for (let $i = 0; $i <
|
|
1186
|
-
$[0] = "
|
|
1184
|
+
const $ = c(70);
|
|
1185
|
+
if ($[0] !== "ee337cec5e11d36faec1dbbceae05725a869a147239dea80dd42ee4c38b26512") {
|
|
1186
|
+
for (let $i = 0; $i < 70; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
1187
|
+
$[0] = "ee337cec5e11d36faec1dbbceae05725a869a147239dea80dd42ee4c38b26512";
|
|
1187
1188
|
}
|
|
1188
1189
|
const { blockData, mode, isFirstBlock, showAddBlockTop, showAddBlockBottom, addBlockAfterPosition } = t0;
|
|
1189
1190
|
const isContentEditable = useIsEditable(mode);
|
|
@@ -1334,18 +1335,17 @@ function createEditableBlock(options) {
|
|
|
1334
1335
|
const t14 = isContentEditable ? blockData._id : void 0;
|
|
1335
1336
|
const t15 = shouldShowOverlay && !isBlockSelected || void 0;
|
|
1336
1337
|
const t16 = shouldShowOverlay && isBlockSelected || void 0;
|
|
1337
|
-
const t17 =
|
|
1338
|
-
|
|
1339
|
-
let t19;
|
|
1338
|
+
const t17 = blockData._id;
|
|
1339
|
+
let t18;
|
|
1340
1340
|
if ($[30] !== blockData.content) {
|
|
1341
|
-
|
|
1341
|
+
t18 = {
|
|
1342
1342
|
...contentDefaults,
|
|
1343
1343
|
...blockData.content
|
|
1344
1344
|
};
|
|
1345
1345
|
$[30] = blockData.content;
|
|
1346
|
-
$[31] =
|
|
1347
|
-
} else
|
|
1348
|
-
const merged =
|
|
1346
|
+
$[31] = t18;
|
|
1347
|
+
} else t18 = $[31];
|
|
1348
|
+
const merged = t18;
|
|
1349
1349
|
let overrides;
|
|
1350
1350
|
if ($[32] !== merged) {
|
|
1351
1351
|
overrides = {};
|
|
@@ -1356,33 +1356,33 @@ function createEditableBlock(options) {
|
|
|
1356
1356
|
$[32] = merged;
|
|
1357
1357
|
$[33] = overrides;
|
|
1358
1358
|
} else overrides = $[33];
|
|
1359
|
-
let
|
|
1359
|
+
let t19;
|
|
1360
1360
|
if ($[34] !== merged || $[35] !== overrides) {
|
|
1361
|
-
|
|
1361
|
+
t19 = {
|
|
1362
1362
|
...merged,
|
|
1363
1363
|
...overrides
|
|
1364
1364
|
};
|
|
1365
1365
|
$[34] = merged;
|
|
1366
1366
|
$[35] = overrides;
|
|
1367
|
-
$[36] =
|
|
1368
|
-
} else
|
|
1369
|
-
const
|
|
1370
|
-
let
|
|
1367
|
+
$[36] = t19;
|
|
1368
|
+
} else t19 = $[36];
|
|
1369
|
+
const t20 = t19;
|
|
1370
|
+
let t21;
|
|
1371
1371
|
if ($[37] !== blockData.settings) {
|
|
1372
|
-
|
|
1372
|
+
t21 = {
|
|
1373
1373
|
...settingsDefaults,
|
|
1374
1374
|
...blockData.settings
|
|
1375
1375
|
};
|
|
1376
1376
|
$[37] = blockData.settings;
|
|
1377
|
-
$[38] =
|
|
1378
|
-
} else
|
|
1379
|
-
const
|
|
1380
|
-
let
|
|
1381
|
-
if ($[39] !== blockData._id || $[40] !== isHovered || $[41] !== mode || $[42] !==
|
|
1382
|
-
|
|
1383
|
-
blockId:
|
|
1384
|
-
content:
|
|
1385
|
-
settings:
|
|
1377
|
+
$[38] = t21;
|
|
1378
|
+
} else t21 = $[38];
|
|
1379
|
+
const t22 = t21;
|
|
1380
|
+
let t23;
|
|
1381
|
+
if ($[39] !== blockData._id || $[40] !== isHovered || $[41] !== mode || $[42] !== t20 || $[43] !== t22) {
|
|
1382
|
+
t23 = {
|
|
1383
|
+
blockId: t17,
|
|
1384
|
+
content: t20,
|
|
1385
|
+
settings: t22,
|
|
1386
1386
|
mode,
|
|
1387
1387
|
isHovered,
|
|
1388
1388
|
setIsHovered
|
|
@@ -1390,39 +1390,39 @@ function createEditableBlock(options) {
|
|
|
1390
1390
|
$[39] = blockData._id;
|
|
1391
1391
|
$[40] = isHovered;
|
|
1392
1392
|
$[41] = mode;
|
|
1393
|
-
$[42] =
|
|
1394
|
-
$[43] =
|
|
1395
|
-
$[44] =
|
|
1396
|
-
} else
|
|
1397
|
-
let
|
|
1393
|
+
$[42] = t20;
|
|
1394
|
+
$[43] = t22;
|
|
1395
|
+
$[44] = t23;
|
|
1396
|
+
} else t23 = $[44];
|
|
1397
|
+
let t24;
|
|
1398
1398
|
if ($[45] !== normalizedContent) {
|
|
1399
|
-
|
|
1399
|
+
t24 = /* @__PURE__ */ jsx(options.component, { content: normalizedContent });
|
|
1400
1400
|
$[45] = normalizedContent;
|
|
1401
|
-
$[46] =
|
|
1402
|
-
} else
|
|
1403
|
-
let
|
|
1404
|
-
if ($[47] !==
|
|
1405
|
-
|
|
1406
|
-
value:
|
|
1407
|
-
children:
|
|
1401
|
+
$[46] = t24;
|
|
1402
|
+
} else t24 = $[46];
|
|
1403
|
+
let t25;
|
|
1404
|
+
if ($[47] !== t23 || $[48] !== t24) {
|
|
1405
|
+
t25 = /* @__PURE__ */ jsx(Context.Provider, {
|
|
1406
|
+
value: t23,
|
|
1407
|
+
children: t24
|
|
1408
1408
|
});
|
|
1409
|
-
$[47] =
|
|
1410
|
-
$[48] =
|
|
1411
|
-
$[49] =
|
|
1412
|
-
} else
|
|
1413
|
-
const
|
|
1414
|
-
let
|
|
1415
|
-
if ($[50] !==
|
|
1416
|
-
|
|
1409
|
+
$[47] = t23;
|
|
1410
|
+
$[48] = t24;
|
|
1411
|
+
$[49] = t25;
|
|
1412
|
+
} else t25 = $[49];
|
|
1413
|
+
const t26 = shouldShowAddBlockOverlay || void 0;
|
|
1414
|
+
let t27;
|
|
1415
|
+
if ($[50] !== t26) {
|
|
1416
|
+
t27 = /* @__PURE__ */ jsx("div", {
|
|
1417
1417
|
className: "camox-sheet-overlay",
|
|
1418
|
-
"data-camox-visible":
|
|
1418
|
+
"data-camox-visible": t26
|
|
1419
1419
|
});
|
|
1420
|
-
$[50] =
|
|
1421
|
-
$[51] =
|
|
1422
|
-
} else
|
|
1423
|
-
let
|
|
1420
|
+
$[50] = t26;
|
|
1421
|
+
$[51] = t27;
|
|
1422
|
+
} else t27 = $[51];
|
|
1423
|
+
let t28;
|
|
1424
1424
|
if ($[52] !== handleAddBlockClick || $[53] !== isAddBlockSidebarOpen || $[54] !== isFirstBlock || $[55] !== mode || $[56] !== shouldShowOverlay || $[57] !== showAddBlockBottom || $[58] !== showAddBlockTop) {
|
|
1425
|
-
|
|
1425
|
+
t28 = shouldShowOverlay && /* @__PURE__ */ jsxs(Fragment, { children: [(showAddBlockTop ?? (mode !== "layout" && !isFirstBlock)) && /* @__PURE__ */ jsx(AddBlockControlBar, {
|
|
1426
1426
|
position: "top",
|
|
1427
1427
|
hidden: isAddBlockSidebarOpen,
|
|
1428
1428
|
onMouseLeave: () => setIsHovered(false),
|
|
@@ -1440,25 +1440,25 @@ function createEditableBlock(options) {
|
|
|
1440
1440
|
$[56] = shouldShowOverlay;
|
|
1441
1441
|
$[57] = showAddBlockBottom;
|
|
1442
1442
|
$[58] = showAddBlockTop;
|
|
1443
|
-
$[59] =
|
|
1444
|
-
} else
|
|
1445
|
-
let
|
|
1446
|
-
if ($[60] !== handleClick || $[61] !== handleMouseEnter || $[62] !== handleMouseLeave || $[63] !== t14 || $[64] !== t15 || $[65] !== t16 || $[66] !==
|
|
1447
|
-
|
|
1443
|
+
$[59] = t28;
|
|
1444
|
+
} else t28 = $[59];
|
|
1445
|
+
let t29;
|
|
1446
|
+
if ($[60] !== handleClick || $[61] !== handleMouseEnter || $[62] !== handleMouseLeave || $[63] !== t14 || $[64] !== t15 || $[65] !== t16 || $[66] !== t25 || $[67] !== t27 || $[68] !== t28) {
|
|
1447
|
+
t29 = /* @__PURE__ */ jsxs("div", {
|
|
1448
1448
|
className: "group visual-editing-block",
|
|
1449
1449
|
ref,
|
|
1450
1450
|
style: t13,
|
|
1451
1451
|
"data-camox-block-id": t14,
|
|
1452
1452
|
"data-camox-hovered": t15,
|
|
1453
1453
|
"data-camox-focused": t16,
|
|
1454
|
-
"data-camox-overlay-mode":
|
|
1454
|
+
"data-camox-overlay-mode": options.synced ? "synced" : void 0,
|
|
1455
1455
|
onClick: handleClick,
|
|
1456
1456
|
onMouseEnter: handleMouseEnter,
|
|
1457
1457
|
onMouseLeave: handleMouseLeave,
|
|
1458
1458
|
children: [
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1459
|
+
t25,
|
|
1460
|
+
t27,
|
|
1461
|
+
t28
|
|
1462
1462
|
]
|
|
1463
1463
|
});
|
|
1464
1464
|
$[60] = handleClick;
|
|
@@ -1467,13 +1467,12 @@ function createEditableBlock(options) {
|
|
|
1467
1467
|
$[63] = t14;
|
|
1468
1468
|
$[64] = t15;
|
|
1469
1469
|
$[65] = t16;
|
|
1470
|
-
$[66] =
|
|
1471
|
-
$[67] =
|
|
1470
|
+
$[66] = t25;
|
|
1471
|
+
$[67] = t27;
|
|
1472
1472
|
$[68] = t28;
|
|
1473
1473
|
$[69] = t29;
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
return t30;
|
|
1474
|
+
} else t29 = $[69];
|
|
1475
|
+
return t29;
|
|
1477
1476
|
};
|
|
1478
1477
|
const useSetting = (name) => {
|
|
1479
1478
|
const ctx = React.use(Context);
|
|
@@ -1485,10 +1484,10 @@ function createEditableBlock(options) {
|
|
|
1485
1484
|
* Provides the same hover, selection, and sheet overlays as the main BlockComponent.
|
|
1486
1485
|
*/
|
|
1487
1486
|
const Detached = (t0) => {
|
|
1488
|
-
const $ = c(
|
|
1489
|
-
if ($[0] !== "
|
|
1490
|
-
for (let $i = 0; $i <
|
|
1491
|
-
$[0] = "
|
|
1487
|
+
const $ = c(30);
|
|
1488
|
+
if ($[0] !== "ee337cec5e11d36faec1dbbceae05725a869a147239dea80dd42ee4c38b26512") {
|
|
1489
|
+
for (let $i = 0; $i < 30; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
1490
|
+
$[0] = "ee337cec5e11d36faec1dbbceae05725a869a147239dea80dd42ee4c38b26512";
|
|
1492
1491
|
}
|
|
1493
1492
|
const { children } = t0;
|
|
1494
1493
|
const ctx = React.use(Context);
|
|
@@ -1579,13 +1578,13 @@ function createEditableBlock(options) {
|
|
|
1579
1578
|
$[21] = t9;
|
|
1580
1579
|
} else t9 = $[21];
|
|
1581
1580
|
let t10;
|
|
1582
|
-
if ($[22] !== blockId || $[23] !== container || $[24] !== isBlockSelected || $[25] !==
|
|
1581
|
+
if ($[22] !== blockId || $[23] !== container || $[24] !== isBlockSelected || $[25] !== shouldShowOverlay) {
|
|
1583
1582
|
t10 = container && createPortal(/* @__PURE__ */ jsx(Fragment, { children: shouldShowOverlay && /* @__PURE__ */ jsx("div", {
|
|
1584
1583
|
"data-camox-block-id": blockId,
|
|
1585
1584
|
"data-camox-detached": true,
|
|
1586
1585
|
"data-camox-hovered": !isBlockSelected || void 0,
|
|
1587
1586
|
"data-camox-focused": isBlockSelected || void 0,
|
|
1588
|
-
"data-camox-overlay-mode":
|
|
1587
|
+
"data-camox-overlay-mode": options.synced ? "synced" : void 0,
|
|
1589
1588
|
style: {
|
|
1590
1589
|
position: "absolute",
|
|
1591
1590
|
pointerEvents: "none",
|
|
@@ -1595,17 +1594,16 @@ function createEditableBlock(options) {
|
|
|
1595
1594
|
$[22] = blockId;
|
|
1596
1595
|
$[23] = container;
|
|
1597
1596
|
$[24] = isBlockSelected;
|
|
1598
|
-
$[25] =
|
|
1599
|
-
$[26] =
|
|
1600
|
-
|
|
1601
|
-
} else t10 = $[27];
|
|
1597
|
+
$[25] = shouldShowOverlay;
|
|
1598
|
+
$[26] = t10;
|
|
1599
|
+
} else t10 = $[26];
|
|
1602
1600
|
let t11;
|
|
1603
|
-
if ($[
|
|
1601
|
+
if ($[27] !== t10 || $[28] !== t9) {
|
|
1604
1602
|
t11 = /* @__PURE__ */ jsxs(Fragment, { children: [t9, t10] });
|
|
1605
|
-
$[
|
|
1606
|
-
$[
|
|
1607
|
-
$[
|
|
1608
|
-
} else t11 = $[
|
|
1603
|
+
$[27] = t10;
|
|
1604
|
+
$[28] = t9;
|
|
1605
|
+
$[29] = t11;
|
|
1606
|
+
} else t11 = $[29];
|
|
1609
1607
|
return t11;
|
|
1610
1608
|
};
|
|
1611
1609
|
return {
|
|
@@ -1632,6 +1630,7 @@ function createEditableBlock(options) {
|
|
|
1632
1630
|
contentSchema,
|
|
1633
1631
|
settingsSchema,
|
|
1634
1632
|
layoutOnly: options.layoutOnly ?? false,
|
|
1633
|
+
synced: options.synced ?? false,
|
|
1635
1634
|
getInitialBundle: () => {
|
|
1636
1635
|
const counter = { value: 0 };
|
|
1637
1636
|
const allSeeds = [];
|
|
@@ -1,26 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
//#region src/core/lib/lexicalReact.d.ts
|
|
4
|
-
interface MarkdownLinkRenderProps {
|
|
5
|
-
href: string;
|
|
6
|
-
target?: string;
|
|
7
|
-
rel?: string;
|
|
8
|
-
children: React.ReactNode;
|
|
9
|
-
}
|
|
10
|
-
interface MarkdownLinkRenderData {
|
|
11
|
-
target: string;
|
|
12
|
-
href: string;
|
|
13
|
-
external: boolean;
|
|
14
|
-
pageId?: string;
|
|
15
|
-
}
|
|
16
|
-
interface MarkdownInlineComponents {
|
|
17
|
-
link?: (props: MarkdownLinkRenderProps, data: MarkdownLinkRenderData) => React.ReactNode;
|
|
18
|
-
strong?: (props: {
|
|
19
|
-
children: React.ReactNode;
|
|
20
|
-
}) => React.ReactNode;
|
|
21
|
-
emphasis?: (props: {
|
|
22
|
-
children: React.ReactNode;
|
|
23
|
-
}) => React.ReactNode;
|
|
24
|
-
}
|
|
25
|
-
//#endregion
|
|
26
|
-
export { MarkdownInlineComponents, MarkdownLinkRenderData, MarkdownLinkRenderProps };
|
|
1
|
+
import { InlineStyle, InlineTextStyles, TextLinkStyleData, TextStyleData } from "./textStyles.js";
|