@firecms/core 3.3.0-canary.451aa49 → 3.3.0-canary.a5780ce
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/app/AppBar.d.ts +1 -1
- package/dist/app/Drawer.d.ts +1 -1
- package/dist/components/AIIcon.d.ts +3 -2
- package/dist/components/ArrayContainer.d.ts +3 -3
- package/dist/components/CircularProgressCenter.d.ts +2 -1
- package/dist/components/ClearFilterSortButton.d.ts +1 -1
- package/dist/components/ConfirmationDialog.d.ts +1 -1
- package/dist/components/DeleteEntityDialog.d.ts +2 -1
- package/dist/components/EntityCollectionTable/EntityCollectionRowActions.d.ts +1 -1
- package/dist/components/EntityCollectionTable/EntityCollectionTable.d.ts +2 -1
- package/dist/components/EntityCollectionTable/fields/TableReferenceField.d.ts +1 -1
- package/dist/components/EntityCollectionTable/fields/TableStorageUpload.d.ts +2 -2
- package/dist/components/EntityCollectionTable/internal/CollectionTableToolbar.d.ts +1 -1
- package/dist/components/EntityCollectionTable/internal/EntityTableCellActions.d.ts +1 -1
- package/dist/components/EntityCollectionTable/internal/popup_field/PopupFormField.d.ts +4 -3
- package/dist/components/EntityCollectionView/Board.d.ts +2 -1
- package/dist/components/EntityCollectionView/BoardColumnTitle.d.ts +1 -1
- package/dist/components/EntityCollectionView/BoardSortableList.d.ts +1 -1
- package/dist/components/EntityCollectionView/CollectionDataErrorBanner.d.ts +2 -1
- package/dist/components/EntityCollectionView/EntityBoardCard.d.ts +1 -1
- package/dist/components/EntityCollectionView/EntityCard.d.ts +2 -1
- package/dist/components/EntityCollectionView/EntityCollectionBoardView.d.ts +1 -1
- package/dist/components/EntityCollectionView/EntityCollectionCardView.d.ts +1 -1
- package/dist/components/EntityCollectionView/EntityCollectionViewActions.d.ts +2 -1
- package/dist/components/EntityCollectionView/EntityCollectionViewStartActions.d.ts +2 -1
- package/dist/components/EntityCollectionView/FiltersDialog.d.ts +2 -1
- package/dist/components/EntityCollectionView/ViewModeToggle.d.ts +2 -1
- package/dist/components/EntityJsonPreview.d.ts +2 -1
- package/dist/components/EntityPreview.d.ts +1 -1
- package/dist/components/EntityView.d.ts +2 -1
- package/dist/components/ErrorBoundary.d.ts +1 -1
- package/dist/components/ErrorTooltip.d.ts +2 -1
- package/dist/components/FieldCaption.d.ts +1 -1
- package/dist/components/FireCMSLogo.d.ts +1 -1
- package/dist/components/HomePage/DefaultHomePage.d.ts +1 -1
- package/dist/components/HomePage/FavouritesView.d.ts +1 -1
- package/dist/components/HomePage/HomePageDnD.d.ts +4 -4
- package/dist/components/HomePage/NavigationCardBinding.d.ts +2 -1
- package/dist/components/HomePage/NavigationGroup.d.ts +2 -2
- package/dist/components/HomePage/RenameGroupDialog.d.ts +2 -1
- package/dist/components/HomePage/SmallNavigationCard.d.ts +1 -1
- package/dist/components/LanguageToggle.d.ts +2 -1
- package/dist/components/NotFoundPage.d.ts +2 -1
- package/dist/components/PropertyCollectionView.d.ts +2 -1
- package/dist/components/PropertyIdCopyTooltip.d.ts +2 -2
- package/dist/components/ReferenceTable/ReferenceSelectionTable.d.ts +1 -1
- package/dist/components/ReferenceWidget.d.ts +2 -1
- package/dist/components/SearchIconsView.d.ts +2 -1
- package/dist/components/SelectableTable/SelectableTable.d.ts +1 -1
- package/dist/components/SelectableTable/filters/BooleanFilterField.d.ts +2 -1
- package/dist/components/SelectableTable/filters/DateTimeFilterField.d.ts +2 -1
- package/dist/components/SelectableTable/filters/ReferenceFilterField.d.ts +2 -1
- package/dist/components/SelectableTable/filters/StringNumberFilterField.d.ts +2 -1
- package/dist/components/UnsavedChangesDialog.d.ts +1 -1
- package/dist/components/UserDisplay.d.ts +1 -1
- package/dist/components/VirtualTable/VirtualTableHeaderRow.d.ts +2 -1
- package/dist/components/VirtualTable/fields/VirtualTableDateField.d.ts +1 -1
- package/dist/components/VirtualTable/fields/VirtualTableInput.d.ts +2 -1
- package/dist/components/VirtualTable/fields/VirtualTableNumberInput.d.ts +2 -1
- package/dist/components/VirtualTable/fields/VirtualTableSelect.d.ts +1 -1
- package/dist/components/VirtualTable/fields/VirtualTableSwitch.d.ts +2 -1
- package/dist/components/VirtualTable/fields/VirtualTableUserSelect.d.ts +1 -1
- package/dist/core/DefaultAppBar.d.ts +1 -1
- package/dist/core/DefaultDrawer.d.ts +2 -2
- package/dist/core/DrawerNavigationGroup.d.ts +1 -1
- package/dist/core/DrawerNavigationItem.d.ts +1 -1
- package/dist/core/EntityEditView.d.ts +2 -2
- package/dist/core/EntityEditViewFormActions.d.ts +2 -1
- package/dist/core/EntitySidePanel.d.ts +2 -1
- package/dist/core/FireCMS.d.ts +2 -1
- package/dist/core/FireCMSRouter.d.ts +1 -1
- package/dist/core/SideDialogs.d.ts +1 -1
- package/dist/editor/components/SlashCommandMenu.d.ts +2 -1
- package/dist/editor/editor.d.ts +1 -1
- package/dist/editor/selectors/color-selector.d.ts +1 -1
- package/dist/editor/selectors/link-selector.d.ts +1 -1
- package/dist/editor/selectors/node-selector.d.ts +1 -1
- package/dist/editor/selectors/text-buttons.d.ts +1 -1
- package/dist/form/EntityForm.d.ts +1 -1
- package/dist/form/EntityFormActions.d.ts +1 -1
- package/dist/form/components/CustomIdField.d.ts +2 -1
- package/dist/form/components/FieldHelperText.d.ts +1 -1
- package/dist/form/components/FormEntry.d.ts +1 -1
- package/dist/form/components/FormLayout.d.ts +1 -1
- package/dist/form/components/LabelWithIconAndTooltip.d.ts +1 -1
- package/dist/form/components/LocalChangesMenu.d.ts +2 -1
- package/dist/form/components/StorageItemPreview.d.ts +2 -1
- package/dist/form/components/StorageUploadProgress.d.ts +2 -1
- package/dist/form/field_bindings/ArrayCustomShapedFieldBinding.d.ts +2 -1
- package/dist/form/field_bindings/ArrayOfReferencesFieldBinding.d.ts +2 -1
- package/dist/form/field_bindings/BlockFieldBinding.d.ts +2 -1
- package/dist/form/field_bindings/DateTimeFieldBinding.d.ts +2 -1
- package/dist/form/field_bindings/KeyValueFieldBinding.d.ts +2 -1
- package/dist/form/field_bindings/MapFieldBinding.d.ts +2 -1
- package/dist/form/field_bindings/MarkdownEditorFieldBinding.d.ts +2 -1
- package/dist/form/field_bindings/MultiSelectFieldBinding.d.ts +2 -1
- package/dist/form/field_bindings/ReadOnlyFieldBinding.d.ts +2 -1
- package/dist/form/field_bindings/ReferenceAsStringFieldBinding.d.ts +2 -1
- package/dist/form/field_bindings/ReferenceFieldBinding.d.ts +2 -1
- package/dist/form/field_bindings/RepeatFieldBinding.d.ts +2 -1
- package/dist/form/field_bindings/SelectFieldBinding.d.ts +2 -1
- package/dist/form/field_bindings/StorageUploadFieldBinding.d.ts +3 -2
- package/dist/form/field_bindings/SwitchFieldBinding.d.ts +2 -1
- package/dist/form/field_bindings/TextFieldBinding.d.ts +2 -1
- package/dist/form/field_bindings/UserSelectFieldBinding.d.ts +2 -1
- package/dist/i18n/FireCMSi18nProvider.d.ts +2 -2
- package/dist/index.es.js +260 -176
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +260 -176
- package/dist/index.umd.js.map +1 -1
- package/dist/preview/components/ArrayEnumPreview.d.ts +2 -1
- package/dist/preview/components/AsyncPreviewComponent.d.ts +1 -1
- package/dist/preview/components/EmptyValue.d.ts +2 -1
- package/dist/preview/components/EnumValuesChip.d.ts +1 -1
- package/dist/preview/components/ImagePreview.d.ts +2 -1
- package/dist/preview/components/ReferencePreview.d.ts +1 -1
- package/dist/preview/components/StorageThumbnail.d.ts +1 -1
- package/dist/preview/components/UserPreview.d.ts +2 -1
- package/dist/preview/property_previews/ArrayOfMapsPreview.d.ts +2 -1
- package/dist/preview/property_previews/ArrayOfReferencesPreview.d.ts +1 -1
- package/dist/preview/property_previews/ArrayOfStorageComponentsPreview.d.ts +2 -1
- package/dist/preview/property_previews/ArrayOfStringsPreview.d.ts +2 -1
- package/dist/preview/property_previews/ArrayOneOfPreview.d.ts +2 -1
- package/dist/preview/property_previews/ArrayPropertyEnumPreview.d.ts +1 -1
- package/dist/preview/property_previews/ArrayPropertyPreview.d.ts +2 -1
- package/dist/preview/property_previews/MapPropertyPreview.d.ts +3 -2
- package/dist/preview/property_previews/SkeletonPropertyComponent.d.ts +5 -4
- package/dist/routes/FireCMSRoute.d.ts +2 -1
- package/dist/util/property_utils.d.ts +1 -1
- package/package.json +5 -5
- package/src/components/EntityCollectionTable/internal/common.tsx +2 -2
- package/src/editor/editor.tsx +20 -1
- package/src/editor/markdown.ts +89 -1
- package/src/internal/useBuildSideEntityController.tsx +1 -1
- package/src/preview/PropertyPreview.tsx +3 -3
package/dist/index.es.js
CHANGED
|
@@ -7566,52 +7566,52 @@ const PropertyPreview = React__default.memo(function PropertyPreview2(props) {
|
|
|
7566
7566
|
if (property.dataType === "string") {
|
|
7567
7567
|
const stringProperty = property;
|
|
7568
7568
|
if (typeof value === "string") {
|
|
7569
|
-
if (stringProperty.
|
|
7570
|
-
|
|
7571
|
-
|
|
7572
|
-
|
|
7573
|
-
|
|
7574
|
-
|
|
7575
|
-
$[14] = filePath;
|
|
7576
|
-
$[15] = fill;
|
|
7577
|
-
$[16] = interactive;
|
|
7578
|
-
$[17] = props.size;
|
|
7579
|
-
$[18] = t02;
|
|
7580
|
-
$[19] = t1;
|
|
7569
|
+
if (stringProperty.markdown) {
|
|
7570
|
+
let t02;
|
|
7571
|
+
if ($[14] !== value) {
|
|
7572
|
+
t02 = /* @__PURE__ */ jsx(Markdown, { source: value, size: "small" });
|
|
7573
|
+
$[14] = value;
|
|
7574
|
+
$[15] = t02;
|
|
7581
7575
|
} else {
|
|
7582
|
-
|
|
7576
|
+
t02 = $[15];
|
|
7583
7577
|
}
|
|
7584
|
-
content =
|
|
7578
|
+
content = t02;
|
|
7585
7579
|
} else {
|
|
7586
|
-
if (stringProperty.
|
|
7587
|
-
|
|
7588
|
-
|
|
7589
|
-
|
|
7590
|
-
|
|
7591
|
-
|
|
7592
|
-
|
|
7593
|
-
|
|
7594
|
-
|
|
7595
|
-
|
|
7596
|
-
|
|
7597
|
-
|
|
7598
|
-
content = t02;
|
|
7580
|
+
if (stringProperty.storage) {
|
|
7581
|
+
const filePath = stringProperty.storage.previewUrl ? stringProperty.storage.previewUrl(value) : value;
|
|
7582
|
+
const t02 = property.storage?.storeUrl ?? false;
|
|
7583
|
+
let t1;
|
|
7584
|
+
if ($[16] !== filePath || $[17] !== fill || $[18] !== interactive || $[19] !== props.size || $[20] !== t02) {
|
|
7585
|
+
t1 = /* @__PURE__ */ jsx(StorageThumbnail, { interactive, storeUrl: t02, size: props.size, fill, storagePathOrDownloadUrl: filePath });
|
|
7586
|
+
$[16] = filePath;
|
|
7587
|
+
$[17] = fill;
|
|
7588
|
+
$[18] = interactive;
|
|
7589
|
+
$[19] = props.size;
|
|
7590
|
+
$[20] = t02;
|
|
7591
|
+
$[21] = t1;
|
|
7599
7592
|
} else {
|
|
7600
|
-
|
|
7601
|
-
content = /* @__PURE__ */ jsx(UrlComponentPreview, { size: props.size, url: value, interactive, fill, previewType: stringProperty.url });
|
|
7602
|
-
}
|
|
7593
|
+
t1 = $[21];
|
|
7603
7594
|
}
|
|
7595
|
+
content = t1;
|
|
7604
7596
|
} else {
|
|
7605
|
-
if (stringProperty.
|
|
7606
|
-
|
|
7607
|
-
|
|
7608
|
-
|
|
7609
|
-
|
|
7610
|
-
|
|
7597
|
+
if (stringProperty.url) {
|
|
7598
|
+
if (typeof stringProperty.url === "boolean") {
|
|
7599
|
+
let t02;
|
|
7600
|
+
if ($[22] !== fill || $[23] !== props.size || $[24] !== value) {
|
|
7601
|
+
t02 = /* @__PURE__ */ jsx(UrlComponentPreview, { size: props.size, url: value, fill });
|
|
7602
|
+
$[22] = fill;
|
|
7603
|
+
$[23] = props.size;
|
|
7604
|
+
$[24] = value;
|
|
7605
|
+
$[25] = t02;
|
|
7606
|
+
} else {
|
|
7607
|
+
t02 = $[25];
|
|
7608
|
+
}
|
|
7609
|
+
content = t02;
|
|
7611
7610
|
} else {
|
|
7612
|
-
|
|
7611
|
+
if (typeof stringProperty.url === "string") {
|
|
7612
|
+
content = /* @__PURE__ */ jsx(UrlComponentPreview, { size: props.size, url: value, interactive, fill, previewType: stringProperty.url });
|
|
7613
|
+
}
|
|
7613
7614
|
}
|
|
7614
|
-
content = t02;
|
|
7615
7615
|
} else {
|
|
7616
7616
|
if (stringProperty.userSelect) {
|
|
7617
7617
|
content = /* @__PURE__ */ jsx(UserPreview, { value, property: stringProperty, propertyKey, size: props.size });
|
|
@@ -17037,14 +17037,14 @@ function getTablePropertyColumnWidth(property) {
|
|
|
17037
17037
|
if (property.dataType === "string") {
|
|
17038
17038
|
if (property.url) {
|
|
17039
17039
|
return 280;
|
|
17040
|
+
} else if (property.markdown) {
|
|
17041
|
+
return 300;
|
|
17040
17042
|
} else if (property.storage) {
|
|
17041
17043
|
return 160;
|
|
17042
17044
|
} else if (property.enumValues) {
|
|
17043
17045
|
return 200;
|
|
17044
17046
|
} else if (property.multiline) {
|
|
17045
17047
|
return 300;
|
|
17046
|
-
} else if (property.markdown) {
|
|
17047
|
-
return 300;
|
|
17048
17048
|
} else if (property.email) {
|
|
17049
17049
|
return 200;
|
|
17050
17050
|
} else {
|
|
@@ -29761,7 +29761,7 @@ function getEntityViewWidth(props, small, customizationController, authControlle
|
|
|
29761
29761
|
const {
|
|
29762
29762
|
selectedSecondaryForm
|
|
29763
29763
|
} = resolvedSelectedEntityView(props.collection?.entityViews, customizationController, props.selectedTab);
|
|
29764
|
-
const shouldUseSmallLayout = !props.selectedTab || props.selectedTab === JSON_TAB_VALUE || props.selectedTab === "__history" || Boolean(selectedSecondaryForm);
|
|
29764
|
+
const shouldUseSmallLayout = !props.selectedTab || props.selectedTab === JSON_TAB_VALUE || props.selectedTab === "__history" || props.selectedTab === "__raw_data" || Boolean(selectedSecondaryForm);
|
|
29765
29765
|
let resolvedWidth;
|
|
29766
29766
|
if (props.width) {
|
|
29767
29767
|
resolvedWidth = typeof props.width === "number" ? `${props.width}px` : props.width;
|
|
@@ -38431,6 +38431,44 @@ const parserTokens = {
|
|
|
38431
38431
|
const md = markdownIt({
|
|
38432
38432
|
html: false
|
|
38433
38433
|
}).use(markdownItTaskLists).use(markdownItMark).use(markdownItIns);
|
|
38434
|
+
md.inline.ruler.at("escape", function escapeOverride(state, silent) {
|
|
38435
|
+
let pos = state.pos;
|
|
38436
|
+
const max = state.posMax;
|
|
38437
|
+
if (state.src.charCodeAt(pos) !== 92) return false;
|
|
38438
|
+
pos++;
|
|
38439
|
+
if (pos >= max) return false;
|
|
38440
|
+
const ch1 = state.src.charCodeAt(pos);
|
|
38441
|
+
if (ch1 === 10) {
|
|
38442
|
+
if (!silent) {
|
|
38443
|
+
state.pending += "\\";
|
|
38444
|
+
}
|
|
38445
|
+
state.pos = pos;
|
|
38446
|
+
return true;
|
|
38447
|
+
}
|
|
38448
|
+
let escapedStr = state.src[pos];
|
|
38449
|
+
if (ch1 >= 55296 && ch1 <= 56319 && pos + 1 < max) {
|
|
38450
|
+
const ch2 = state.src.charCodeAt(pos + 1);
|
|
38451
|
+
if (ch2 >= 56320 && ch2 <= 57343) {
|
|
38452
|
+
escapedStr += state.src[pos + 1];
|
|
38453
|
+
pos++;
|
|
38454
|
+
}
|
|
38455
|
+
}
|
|
38456
|
+
const origStr = "\\" + escapedStr;
|
|
38457
|
+
if (!silent) {
|
|
38458
|
+
const isEscapable = ch1 < 256 && /[\\!"#$%&'()*+,./:;<=>?@[\]^_`{|}~-]/.test(String.fromCharCode(ch1));
|
|
38459
|
+
const token = state.push("text_special", "", 0);
|
|
38460
|
+
if (isEscapable) {
|
|
38461
|
+
token.content = escapedStr;
|
|
38462
|
+
} else {
|
|
38463
|
+
token.content = origStr;
|
|
38464
|
+
}
|
|
38465
|
+
token.markup = origStr;
|
|
38466
|
+
token.info = "escape";
|
|
38467
|
+
}
|
|
38468
|
+
state.pos = pos + 1;
|
|
38469
|
+
return true;
|
|
38470
|
+
});
|
|
38471
|
+
md.inline.ruler.disable(["newline"]);
|
|
38434
38472
|
md.core.ruler.after("inline", "image-to-block", (state) => {
|
|
38435
38473
|
const tokens = state.tokens;
|
|
38436
38474
|
for (let i = tokens.length - 2; i >= 1; i--) {
|
|
@@ -38516,6 +38554,28 @@ const markdownSerializer = new MarkdownSerializer({
|
|
|
38516
38554
|
table_cell() {
|
|
38517
38555
|
},
|
|
38518
38556
|
table_header() {
|
|
38557
|
+
},
|
|
38558
|
+
// Custom text serializer: since our parser override keeps `\` as
|
|
38559
|
+
// literal text (instead of consuming it), we must avoid the default
|
|
38560
|
+
// esc() from double-escaping it. We escape all standard markdown
|
|
38561
|
+
// specials *except* the backslash itself.
|
|
38562
|
+
text(state, node) {
|
|
38563
|
+
const escaped = node.text.replace(/[`*~\[\]_]/g, (m, i) => {
|
|
38564
|
+
if (m === "_" && i > 0 && i + 1 < node.text.length && /\w/.test(node.text[i - 1]) && /\w/.test(node.text[i + 1])) {
|
|
38565
|
+
return m;
|
|
38566
|
+
}
|
|
38567
|
+
return "\\" + m;
|
|
38568
|
+
});
|
|
38569
|
+
const lines = escaped.split("\n");
|
|
38570
|
+
for (let i = 0; i < lines.length; i++) {
|
|
38571
|
+
state.write();
|
|
38572
|
+
let line = lines[i];
|
|
38573
|
+
if (state.atBlockStart || i > 0) {
|
|
38574
|
+
line = line.replace(/^(\+[ ]|[-*>])/, "\\$&").replace(/^(\s*)(#{1,6})(\s|$)/, "$1\\$2$3").replace(/^(\s*\d+)\.\s/, "$1\\. ");
|
|
38575
|
+
}
|
|
38576
|
+
state.out += line;
|
|
38577
|
+
if (i !== lines.length - 1) state.out += "\n";
|
|
38578
|
+
}
|
|
38519
38579
|
}
|
|
38520
38580
|
}, {
|
|
38521
38581
|
...defaultMarkdownSerializer.marks,
|
|
@@ -41317,7 +41377,7 @@ const proseClasses = {
|
|
|
41317
41377
|
"lg": "prose-lg"
|
|
41318
41378
|
};
|
|
41319
41379
|
const FireCMSEditor = (t0) => {
|
|
41320
|
-
const $ = c(
|
|
41380
|
+
const $ = c(78);
|
|
41321
41381
|
const {
|
|
41322
41382
|
content,
|
|
41323
41383
|
onJsonContentChange,
|
|
@@ -41489,63 +41549,87 @@ const FireCMSEditor = (t0) => {
|
|
|
41489
41549
|
} = useProseMirror(t10);
|
|
41490
41550
|
const view = t11;
|
|
41491
41551
|
const doc = state?.doc;
|
|
41552
|
+
const mountedRef = useRef(false);
|
|
41492
41553
|
let t12;
|
|
41493
|
-
|
|
41554
|
+
let t13;
|
|
41555
|
+
if ($[20] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
|
|
41494
41556
|
t12 = () => {
|
|
41557
|
+
const raf = requestAnimationFrame(() => {
|
|
41558
|
+
mountedRef.current = true;
|
|
41559
|
+
});
|
|
41560
|
+
return () => cancelAnimationFrame(raf);
|
|
41561
|
+
};
|
|
41562
|
+
t13 = [];
|
|
41563
|
+
$[20] = t12;
|
|
41564
|
+
$[21] = t13;
|
|
41565
|
+
} else {
|
|
41566
|
+
t12 = $[20];
|
|
41567
|
+
t13 = $[21];
|
|
41568
|
+
}
|
|
41569
|
+
useEffect(t12, t13);
|
|
41570
|
+
let t14;
|
|
41571
|
+
if ($[22] !== flushChanges || $[23] !== state) {
|
|
41572
|
+
t14 = () => {
|
|
41495
41573
|
if (!state) {
|
|
41496
41574
|
return;
|
|
41497
41575
|
}
|
|
41576
|
+
if (!mountedRef.current) {
|
|
41577
|
+
return;
|
|
41578
|
+
}
|
|
41498
41579
|
const timeout_0 = setTimeout(() => {
|
|
41499
41580
|
flushChanges(state);
|
|
41500
41581
|
}, 250);
|
|
41501
41582
|
return () => clearTimeout(timeout_0);
|
|
41502
41583
|
};
|
|
41503
|
-
$[
|
|
41504
|
-
$[
|
|
41505
|
-
$[
|
|
41584
|
+
$[22] = flushChanges;
|
|
41585
|
+
$[23] = state;
|
|
41586
|
+
$[24] = t14;
|
|
41506
41587
|
} else {
|
|
41507
|
-
|
|
41588
|
+
t14 = $[24];
|
|
41508
41589
|
}
|
|
41509
|
-
let
|
|
41510
|
-
if ($[
|
|
41511
|
-
|
|
41512
|
-
$[
|
|
41513
|
-
$[
|
|
41590
|
+
let t15;
|
|
41591
|
+
if ($[25] !== doc) {
|
|
41592
|
+
t15 = [doc];
|
|
41593
|
+
$[25] = doc;
|
|
41594
|
+
$[26] = t15;
|
|
41514
41595
|
} else {
|
|
41515
|
-
|
|
41596
|
+
t15 = $[26];
|
|
41516
41597
|
}
|
|
41517
|
-
useEffect(
|
|
41518
|
-
let
|
|
41519
|
-
if ($[
|
|
41520
|
-
|
|
41598
|
+
useEffect(t14, t15);
|
|
41599
|
+
let t16;
|
|
41600
|
+
if ($[27] !== flushChanges || $[28] !== view) {
|
|
41601
|
+
t16 = () => {
|
|
41521
41602
|
if (!view) {
|
|
41522
41603
|
return;
|
|
41523
41604
|
}
|
|
41524
41605
|
const dom = view.dom;
|
|
41525
41606
|
const handleBlur = () => {
|
|
41607
|
+
if (!mountedRef.current) {
|
|
41608
|
+
return;
|
|
41609
|
+
}
|
|
41526
41610
|
flushChanges(view.state);
|
|
41527
41611
|
};
|
|
41528
41612
|
dom.addEventListener("blur", handleBlur);
|
|
41529
41613
|
return () => dom.removeEventListener("blur", handleBlur);
|
|
41530
41614
|
};
|
|
41531
|
-
$[
|
|
41532
|
-
$[
|
|
41533
|
-
$[
|
|
41615
|
+
$[27] = flushChanges;
|
|
41616
|
+
$[28] = view;
|
|
41617
|
+
$[29] = t16;
|
|
41534
41618
|
} else {
|
|
41535
|
-
|
|
41619
|
+
t16 = $[29];
|
|
41536
41620
|
}
|
|
41537
|
-
let
|
|
41538
|
-
if ($[
|
|
41539
|
-
|
|
41540
|
-
$[
|
|
41541
|
-
$[
|
|
41621
|
+
let t17;
|
|
41622
|
+
if ($[30] !== view) {
|
|
41623
|
+
t17 = [view];
|
|
41624
|
+
$[30] = view;
|
|
41625
|
+
$[31] = t17;
|
|
41542
41626
|
} else {
|
|
41543
|
-
|
|
41627
|
+
t17 = $[31];
|
|
41544
41628
|
}
|
|
41545
|
-
useEffect(
|
|
41546
|
-
let
|
|
41547
|
-
if ($[
|
|
41548
|
-
|
|
41629
|
+
useEffect(t16, t17);
|
|
41630
|
+
let t18;
|
|
41631
|
+
if ($[32] !== highlight || $[33] !== view) {
|
|
41632
|
+
t18 = () => {
|
|
41549
41633
|
if (view) {
|
|
41550
41634
|
if (highlight) {
|
|
41551
41635
|
highlightCommands.toggleAutocompleteHighlight(highlight)(view.state, view.dispatch);
|
|
@@ -41554,80 +41638,80 @@ const FireCMSEditor = (t0) => {
|
|
|
41554
41638
|
}
|
|
41555
41639
|
}
|
|
41556
41640
|
};
|
|
41557
|
-
$[
|
|
41558
|
-
$[
|
|
41559
|
-
$[
|
|
41641
|
+
$[32] = highlight;
|
|
41642
|
+
$[33] = view;
|
|
41643
|
+
$[34] = t18;
|
|
41560
41644
|
} else {
|
|
41561
|
-
|
|
41645
|
+
t18 = $[34];
|
|
41562
41646
|
}
|
|
41563
|
-
const
|
|
41564
|
-
const
|
|
41565
|
-
let
|
|
41566
|
-
if ($[
|
|
41567
|
-
|
|
41568
|
-
$[33] = t17;
|
|
41569
|
-
$[34] = t18;
|
|
41647
|
+
const t19 = highlight?.from;
|
|
41648
|
+
const t20 = highlight?.to;
|
|
41649
|
+
let t21;
|
|
41650
|
+
if ($[35] !== t19 || $[36] !== t20) {
|
|
41651
|
+
t21 = [t19, t20];
|
|
41570
41652
|
$[35] = t19;
|
|
41653
|
+
$[36] = t20;
|
|
41654
|
+
$[37] = t21;
|
|
41571
41655
|
} else {
|
|
41572
|
-
|
|
41656
|
+
t21 = $[37];
|
|
41573
41657
|
}
|
|
41574
|
-
useEffect(
|
|
41658
|
+
useEffect(t18, t21);
|
|
41575
41659
|
const proseClass = proseClasses[textSize];
|
|
41576
|
-
const
|
|
41577
|
-
const
|
|
41578
|
-
let
|
|
41579
|
-
if ($[
|
|
41580
|
-
|
|
41581
|
-
$[
|
|
41582
|
-
$[37] = t20;
|
|
41583
|
-
$[38] = t21;
|
|
41660
|
+
const t22 = isMarkdownMode ? "Switch to Visual Editor" : "Switch to Markdown";
|
|
41661
|
+
const t23 = isMarkdownMode ? "Visual" : "Markdown";
|
|
41662
|
+
let t24;
|
|
41663
|
+
if ($[38] !== handleToggleMarkdown || $[39] !== t22 || $[40] !== t23) {
|
|
41664
|
+
t24 = /* @__PURE__ */ jsx("button", { type: "button", onClick: handleToggleMarkdown, title: t22, className: "absolute top-2 right-2 z-10 px-2 py-1 text-xs font-medium text-surface-400 hover:text-surface-700 dark:text-surface-600 dark:hover:text-surface-300 transition-colors opacity-50 hover:opacity-100 bg-transparent rounded", children: t23 });
|
|
41665
|
+
$[38] = handleToggleMarkdown;
|
|
41584
41666
|
$[39] = t22;
|
|
41667
|
+
$[40] = t23;
|
|
41668
|
+
$[41] = t24;
|
|
41585
41669
|
} else {
|
|
41586
|
-
|
|
41670
|
+
t24 = $[41];
|
|
41587
41671
|
}
|
|
41588
|
-
let
|
|
41589
|
-
if ($[
|
|
41590
|
-
|
|
41672
|
+
let t25;
|
|
41673
|
+
if ($[42] !== state || $[43] !== view) {
|
|
41674
|
+
t25 = {
|
|
41591
41675
|
state,
|
|
41592
41676
|
view
|
|
41593
41677
|
};
|
|
41594
|
-
$[
|
|
41595
|
-
$[
|
|
41596
|
-
$[
|
|
41678
|
+
$[42] = state;
|
|
41679
|
+
$[43] = view;
|
|
41680
|
+
$[44] = t25;
|
|
41597
41681
|
} else {
|
|
41598
|
-
|
|
41682
|
+
t25 = $[44];
|
|
41599
41683
|
}
|
|
41600
|
-
const
|
|
41601
|
-
let
|
|
41602
|
-
if ($[
|
|
41603
|
-
|
|
41604
|
-
display:
|
|
41684
|
+
const t26 = isMarkdownMode ? "none" : "block";
|
|
41685
|
+
let t27;
|
|
41686
|
+
if ($[45] !== t26) {
|
|
41687
|
+
t27 = {
|
|
41688
|
+
display: t26
|
|
41605
41689
|
};
|
|
41606
|
-
$[
|
|
41607
|
-
$[
|
|
41690
|
+
$[45] = t26;
|
|
41691
|
+
$[46] = t27;
|
|
41608
41692
|
} else {
|
|
41609
|
-
|
|
41693
|
+
t27 = $[46];
|
|
41610
41694
|
}
|
|
41611
|
-
let
|
|
41612
|
-
if ($[
|
|
41613
|
-
|
|
41614
|
-
$[
|
|
41615
|
-
$[
|
|
41695
|
+
let t28;
|
|
41696
|
+
if ($[47] !== proseClass) {
|
|
41697
|
+
t28 = cls(proseClass, "prose-headings:font-title font-default focus:outline-none max-w-full p-12");
|
|
41698
|
+
$[47] = proseClass;
|
|
41699
|
+
$[48] = t28;
|
|
41616
41700
|
} else {
|
|
41617
|
-
|
|
41701
|
+
t28 = $[48];
|
|
41618
41702
|
}
|
|
41619
|
-
let
|
|
41620
|
-
if ($[
|
|
41621
|
-
|
|
41622
|
-
$[
|
|
41623
|
-
$[
|
|
41624
|
-
$[
|
|
41703
|
+
let t29;
|
|
41704
|
+
if ($[49] !== editorRef || $[50] !== t28) {
|
|
41705
|
+
t29 = /* @__PURE__ */ jsx("div", { ref: editorRef, className: t28 });
|
|
41706
|
+
$[49] = editorRef;
|
|
41707
|
+
$[50] = t28;
|
|
41708
|
+
$[51] = t29;
|
|
41625
41709
|
} else {
|
|
41626
|
-
|
|
41710
|
+
t29 = $[51];
|
|
41627
41711
|
}
|
|
41628
|
-
let
|
|
41629
|
-
if ($[
|
|
41630
|
-
|
|
41712
|
+
let t30;
|
|
41713
|
+
if ($[52] !== editorRef || $[53] !== openLink || $[54] !== openNode || $[55] !== view) {
|
|
41714
|
+
t30 = view && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
41631
41715
|
/* @__PURE__ */ jsxs(EditorBubble, { options: {
|
|
41632
41716
|
placement: "top",
|
|
41633
41717
|
offset: 6
|
|
@@ -41644,81 +41728,81 @@ const FireCMSEditor = (t0) => {
|
|
|
41644
41728
|
} }),
|
|
41645
41729
|
/* @__PURE__ */ jsx(TableBubble, {})
|
|
41646
41730
|
] });
|
|
41647
|
-
$[
|
|
41648
|
-
$[
|
|
41649
|
-
$[
|
|
41650
|
-
$[
|
|
41651
|
-
$[
|
|
41731
|
+
$[52] = editorRef;
|
|
41732
|
+
$[53] = openLink;
|
|
41733
|
+
$[54] = openNode;
|
|
41734
|
+
$[55] = view;
|
|
41735
|
+
$[56] = t30;
|
|
41652
41736
|
} else {
|
|
41653
|
-
|
|
41737
|
+
t30 = $[56];
|
|
41654
41738
|
}
|
|
41655
|
-
let
|
|
41656
|
-
if ($[
|
|
41657
|
-
|
|
41658
|
-
$[
|
|
41659
|
-
$[
|
|
41660
|
-
$[
|
|
41739
|
+
let t31;
|
|
41740
|
+
if ($[57] !== aiController || $[58] !== handleImageUpload) {
|
|
41741
|
+
t31 = /* @__PURE__ */ jsx(SlashCommandMenu, { upload: handleImageUpload, aiController });
|
|
41742
|
+
$[57] = aiController;
|
|
41743
|
+
$[58] = handleImageUpload;
|
|
41744
|
+
$[59] = t31;
|
|
41661
41745
|
} else {
|
|
41662
|
-
|
|
41746
|
+
t31 = $[59];
|
|
41663
41747
|
}
|
|
41664
|
-
let
|
|
41665
|
-
if ($[
|
|
41666
|
-
|
|
41667
|
-
|
|
41668
|
-
|
|
41669
|
-
|
|
41748
|
+
let t32;
|
|
41749
|
+
if ($[60] !== t27 || $[61] !== t29 || $[62] !== t30 || $[63] !== t31) {
|
|
41750
|
+
t32 = /* @__PURE__ */ jsxs("div", { style: t27, children: [
|
|
41751
|
+
t29,
|
|
41752
|
+
t30,
|
|
41753
|
+
t31
|
|
41670
41754
|
] });
|
|
41671
|
-
$[
|
|
41672
|
-
$[59] = t27;
|
|
41673
|
-
$[60] = t28;
|
|
41755
|
+
$[60] = t27;
|
|
41674
41756
|
$[61] = t29;
|
|
41675
41757
|
$[62] = t30;
|
|
41758
|
+
$[63] = t31;
|
|
41759
|
+
$[64] = t32;
|
|
41676
41760
|
} else {
|
|
41677
|
-
|
|
41761
|
+
t32 = $[64];
|
|
41678
41762
|
}
|
|
41679
|
-
let
|
|
41680
|
-
if ($[
|
|
41681
|
-
|
|
41763
|
+
let t33;
|
|
41764
|
+
if ($[65] !== handleMarkdownBlur || $[66] !== handleMarkdownChange || $[67] !== internalMarkdown || $[68] !== isMarkdownMode || $[69] !== proseClass) {
|
|
41765
|
+
t33 = isMarkdownMode && /* @__PURE__ */ jsx(TextareaAutosize, { value: internalMarkdown, onChange: handleMarkdownChange, onBlur: handleMarkdownBlur, className: cls("w-full min-h-[300px] p-12 bg-transparent resize-none font-mono focus:ring-0 focus:outline-none outline-none", proseClass), style: {
|
|
41682
41766
|
tabSize: 4,
|
|
41683
41767
|
outline: "none",
|
|
41684
41768
|
border: "none",
|
|
41685
41769
|
boxShadow: "none"
|
|
41686
41770
|
} });
|
|
41687
|
-
$[
|
|
41688
|
-
$[
|
|
41689
|
-
$[
|
|
41690
|
-
$[
|
|
41691
|
-
$[
|
|
41692
|
-
$[
|
|
41771
|
+
$[65] = handleMarkdownBlur;
|
|
41772
|
+
$[66] = handleMarkdownChange;
|
|
41773
|
+
$[67] = internalMarkdown;
|
|
41774
|
+
$[68] = isMarkdownMode;
|
|
41775
|
+
$[69] = proseClass;
|
|
41776
|
+
$[70] = t33;
|
|
41693
41777
|
} else {
|
|
41694
|
-
|
|
41778
|
+
t33 = $[70];
|
|
41695
41779
|
}
|
|
41696
|
-
let
|
|
41697
|
-
if ($[
|
|
41698
|
-
|
|
41699
|
-
|
|
41700
|
-
|
|
41780
|
+
let t34;
|
|
41781
|
+
if ($[71] !== t25 || $[72] !== t32 || $[73] !== t33) {
|
|
41782
|
+
t34 = /* @__PURE__ */ jsxs(ProseMirrorContext.Provider, { value: t25, children: [
|
|
41783
|
+
t32,
|
|
41784
|
+
t33
|
|
41701
41785
|
] });
|
|
41702
|
-
$[
|
|
41703
|
-
$[70] = t30;
|
|
41704
|
-
$[71] = t31;
|
|
41786
|
+
$[71] = t25;
|
|
41705
41787
|
$[72] = t32;
|
|
41788
|
+
$[73] = t33;
|
|
41789
|
+
$[74] = t34;
|
|
41706
41790
|
} else {
|
|
41707
|
-
|
|
41791
|
+
t34 = $[74];
|
|
41708
41792
|
}
|
|
41709
|
-
let
|
|
41710
|
-
if ($[
|
|
41711
|
-
|
|
41712
|
-
|
|
41713
|
-
|
|
41793
|
+
let t35;
|
|
41794
|
+
if ($[75] !== t24 || $[76] !== t34) {
|
|
41795
|
+
t35 = /* @__PURE__ */ jsxs("div", { className: "relative min-h-[300px] w-full", children: [
|
|
41796
|
+
t24,
|
|
41797
|
+
t34
|
|
41714
41798
|
] });
|
|
41715
|
-
$[
|
|
41716
|
-
$[
|
|
41717
|
-
$[
|
|
41799
|
+
$[75] = t24;
|
|
41800
|
+
$[76] = t34;
|
|
41801
|
+
$[77] = t35;
|
|
41718
41802
|
} else {
|
|
41719
|
-
|
|
41803
|
+
t35 = $[77];
|
|
41720
41804
|
}
|
|
41721
|
-
return
|
|
41805
|
+
return t35;
|
|
41722
41806
|
};
|
|
41723
41807
|
const cssStyles = `
|
|
41724
41808
|
.ProseMirror {
|