@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.
Files changed (135) hide show
  1. package/dist/app/AppBar.d.ts +1 -1
  2. package/dist/app/Drawer.d.ts +1 -1
  3. package/dist/components/AIIcon.d.ts +3 -2
  4. package/dist/components/ArrayContainer.d.ts +3 -3
  5. package/dist/components/CircularProgressCenter.d.ts +2 -1
  6. package/dist/components/ClearFilterSortButton.d.ts +1 -1
  7. package/dist/components/ConfirmationDialog.d.ts +1 -1
  8. package/dist/components/DeleteEntityDialog.d.ts +2 -1
  9. package/dist/components/EntityCollectionTable/EntityCollectionRowActions.d.ts +1 -1
  10. package/dist/components/EntityCollectionTable/EntityCollectionTable.d.ts +2 -1
  11. package/dist/components/EntityCollectionTable/fields/TableReferenceField.d.ts +1 -1
  12. package/dist/components/EntityCollectionTable/fields/TableStorageUpload.d.ts +2 -2
  13. package/dist/components/EntityCollectionTable/internal/CollectionTableToolbar.d.ts +1 -1
  14. package/dist/components/EntityCollectionTable/internal/EntityTableCellActions.d.ts +1 -1
  15. package/dist/components/EntityCollectionTable/internal/popup_field/PopupFormField.d.ts +4 -3
  16. package/dist/components/EntityCollectionView/Board.d.ts +2 -1
  17. package/dist/components/EntityCollectionView/BoardColumnTitle.d.ts +1 -1
  18. package/dist/components/EntityCollectionView/BoardSortableList.d.ts +1 -1
  19. package/dist/components/EntityCollectionView/CollectionDataErrorBanner.d.ts +2 -1
  20. package/dist/components/EntityCollectionView/EntityBoardCard.d.ts +1 -1
  21. package/dist/components/EntityCollectionView/EntityCard.d.ts +2 -1
  22. package/dist/components/EntityCollectionView/EntityCollectionBoardView.d.ts +1 -1
  23. package/dist/components/EntityCollectionView/EntityCollectionCardView.d.ts +1 -1
  24. package/dist/components/EntityCollectionView/EntityCollectionViewActions.d.ts +2 -1
  25. package/dist/components/EntityCollectionView/EntityCollectionViewStartActions.d.ts +2 -1
  26. package/dist/components/EntityCollectionView/FiltersDialog.d.ts +2 -1
  27. package/dist/components/EntityCollectionView/ViewModeToggle.d.ts +2 -1
  28. package/dist/components/EntityJsonPreview.d.ts +2 -1
  29. package/dist/components/EntityPreview.d.ts +1 -1
  30. package/dist/components/EntityView.d.ts +2 -1
  31. package/dist/components/ErrorBoundary.d.ts +1 -1
  32. package/dist/components/ErrorTooltip.d.ts +2 -1
  33. package/dist/components/FieldCaption.d.ts +1 -1
  34. package/dist/components/FireCMSLogo.d.ts +1 -1
  35. package/dist/components/HomePage/DefaultHomePage.d.ts +1 -1
  36. package/dist/components/HomePage/FavouritesView.d.ts +1 -1
  37. package/dist/components/HomePage/HomePageDnD.d.ts +4 -4
  38. package/dist/components/HomePage/NavigationCardBinding.d.ts +2 -1
  39. package/dist/components/HomePage/NavigationGroup.d.ts +2 -2
  40. package/dist/components/HomePage/RenameGroupDialog.d.ts +2 -1
  41. package/dist/components/HomePage/SmallNavigationCard.d.ts +1 -1
  42. package/dist/components/LanguageToggle.d.ts +2 -1
  43. package/dist/components/NotFoundPage.d.ts +2 -1
  44. package/dist/components/PropertyCollectionView.d.ts +2 -1
  45. package/dist/components/PropertyIdCopyTooltip.d.ts +2 -2
  46. package/dist/components/ReferenceTable/ReferenceSelectionTable.d.ts +1 -1
  47. package/dist/components/ReferenceWidget.d.ts +2 -1
  48. package/dist/components/SearchIconsView.d.ts +2 -1
  49. package/dist/components/SelectableTable/SelectableTable.d.ts +1 -1
  50. package/dist/components/SelectableTable/filters/BooleanFilterField.d.ts +2 -1
  51. package/dist/components/SelectableTable/filters/DateTimeFilterField.d.ts +2 -1
  52. package/dist/components/SelectableTable/filters/ReferenceFilterField.d.ts +2 -1
  53. package/dist/components/SelectableTable/filters/StringNumberFilterField.d.ts +2 -1
  54. package/dist/components/UnsavedChangesDialog.d.ts +1 -1
  55. package/dist/components/UserDisplay.d.ts +1 -1
  56. package/dist/components/VirtualTable/VirtualTableHeaderRow.d.ts +2 -1
  57. package/dist/components/VirtualTable/fields/VirtualTableDateField.d.ts +1 -1
  58. package/dist/components/VirtualTable/fields/VirtualTableInput.d.ts +2 -1
  59. package/dist/components/VirtualTable/fields/VirtualTableNumberInput.d.ts +2 -1
  60. package/dist/components/VirtualTable/fields/VirtualTableSelect.d.ts +1 -1
  61. package/dist/components/VirtualTable/fields/VirtualTableSwitch.d.ts +2 -1
  62. package/dist/components/VirtualTable/fields/VirtualTableUserSelect.d.ts +1 -1
  63. package/dist/core/DefaultAppBar.d.ts +1 -1
  64. package/dist/core/DefaultDrawer.d.ts +2 -2
  65. package/dist/core/DrawerNavigationGroup.d.ts +1 -1
  66. package/dist/core/DrawerNavigationItem.d.ts +1 -1
  67. package/dist/core/EntityEditView.d.ts +2 -2
  68. package/dist/core/EntityEditViewFormActions.d.ts +2 -1
  69. package/dist/core/EntitySidePanel.d.ts +2 -1
  70. package/dist/core/FireCMS.d.ts +2 -1
  71. package/dist/core/FireCMSRouter.d.ts +1 -1
  72. package/dist/core/SideDialogs.d.ts +1 -1
  73. package/dist/editor/components/SlashCommandMenu.d.ts +2 -1
  74. package/dist/editor/editor.d.ts +1 -1
  75. package/dist/editor/selectors/color-selector.d.ts +1 -1
  76. package/dist/editor/selectors/link-selector.d.ts +1 -1
  77. package/dist/editor/selectors/node-selector.d.ts +1 -1
  78. package/dist/editor/selectors/text-buttons.d.ts +1 -1
  79. package/dist/form/EntityForm.d.ts +1 -1
  80. package/dist/form/EntityFormActions.d.ts +1 -1
  81. package/dist/form/components/CustomIdField.d.ts +2 -1
  82. package/dist/form/components/FieldHelperText.d.ts +1 -1
  83. package/dist/form/components/FormEntry.d.ts +1 -1
  84. package/dist/form/components/FormLayout.d.ts +1 -1
  85. package/dist/form/components/LabelWithIconAndTooltip.d.ts +1 -1
  86. package/dist/form/components/LocalChangesMenu.d.ts +2 -1
  87. package/dist/form/components/StorageItemPreview.d.ts +2 -1
  88. package/dist/form/components/StorageUploadProgress.d.ts +2 -1
  89. package/dist/form/field_bindings/ArrayCustomShapedFieldBinding.d.ts +2 -1
  90. package/dist/form/field_bindings/ArrayOfReferencesFieldBinding.d.ts +2 -1
  91. package/dist/form/field_bindings/BlockFieldBinding.d.ts +2 -1
  92. package/dist/form/field_bindings/DateTimeFieldBinding.d.ts +2 -1
  93. package/dist/form/field_bindings/KeyValueFieldBinding.d.ts +2 -1
  94. package/dist/form/field_bindings/MapFieldBinding.d.ts +2 -1
  95. package/dist/form/field_bindings/MarkdownEditorFieldBinding.d.ts +2 -1
  96. package/dist/form/field_bindings/MultiSelectFieldBinding.d.ts +2 -1
  97. package/dist/form/field_bindings/ReadOnlyFieldBinding.d.ts +2 -1
  98. package/dist/form/field_bindings/ReferenceAsStringFieldBinding.d.ts +2 -1
  99. package/dist/form/field_bindings/ReferenceFieldBinding.d.ts +2 -1
  100. package/dist/form/field_bindings/RepeatFieldBinding.d.ts +2 -1
  101. package/dist/form/field_bindings/SelectFieldBinding.d.ts +2 -1
  102. package/dist/form/field_bindings/StorageUploadFieldBinding.d.ts +3 -2
  103. package/dist/form/field_bindings/SwitchFieldBinding.d.ts +2 -1
  104. package/dist/form/field_bindings/TextFieldBinding.d.ts +2 -1
  105. package/dist/form/field_bindings/UserSelectFieldBinding.d.ts +2 -1
  106. package/dist/i18n/FireCMSi18nProvider.d.ts +2 -2
  107. package/dist/index.es.js +260 -176
  108. package/dist/index.es.js.map +1 -1
  109. package/dist/index.umd.js +260 -176
  110. package/dist/index.umd.js.map +1 -1
  111. package/dist/preview/components/ArrayEnumPreview.d.ts +2 -1
  112. package/dist/preview/components/AsyncPreviewComponent.d.ts +1 -1
  113. package/dist/preview/components/EmptyValue.d.ts +2 -1
  114. package/dist/preview/components/EnumValuesChip.d.ts +1 -1
  115. package/dist/preview/components/ImagePreview.d.ts +2 -1
  116. package/dist/preview/components/ReferencePreview.d.ts +1 -1
  117. package/dist/preview/components/StorageThumbnail.d.ts +1 -1
  118. package/dist/preview/components/UserPreview.d.ts +2 -1
  119. package/dist/preview/property_previews/ArrayOfMapsPreview.d.ts +2 -1
  120. package/dist/preview/property_previews/ArrayOfReferencesPreview.d.ts +1 -1
  121. package/dist/preview/property_previews/ArrayOfStorageComponentsPreview.d.ts +2 -1
  122. package/dist/preview/property_previews/ArrayOfStringsPreview.d.ts +2 -1
  123. package/dist/preview/property_previews/ArrayOneOfPreview.d.ts +2 -1
  124. package/dist/preview/property_previews/ArrayPropertyEnumPreview.d.ts +1 -1
  125. package/dist/preview/property_previews/ArrayPropertyPreview.d.ts +2 -1
  126. package/dist/preview/property_previews/MapPropertyPreview.d.ts +3 -2
  127. package/dist/preview/property_previews/SkeletonPropertyComponent.d.ts +5 -4
  128. package/dist/routes/FireCMSRoute.d.ts +2 -1
  129. package/dist/util/property_utils.d.ts +1 -1
  130. package/package.json +5 -5
  131. package/src/components/EntityCollectionTable/internal/common.tsx +2 -2
  132. package/src/editor/editor.tsx +20 -1
  133. package/src/editor/markdown.ts +89 -1
  134. package/src/internal/useBuildSideEntityController.tsx +1 -1
  135. 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.storage) {
7570
- const filePath = stringProperty.storage.previewUrl ? stringProperty.storage.previewUrl(value) : value;
7571
- const t02 = property.storage?.storeUrl ?? false;
7572
- let t1;
7573
- if ($[14] !== filePath || $[15] !== fill || $[16] !== interactive || $[17] !== props.size || $[18] !== t02) {
7574
- t1 = /* @__PURE__ */ jsx(StorageThumbnail, { interactive, storeUrl: t02, size: props.size, fill, storagePathOrDownloadUrl: filePath });
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
- t1 = $[19];
7576
+ t02 = $[15];
7583
7577
  }
7584
- content = t1;
7578
+ content = t02;
7585
7579
  } else {
7586
- if (stringProperty.url) {
7587
- if (typeof stringProperty.url === "boolean") {
7588
- let t02;
7589
- if ($[20] !== fill || $[21] !== props.size || $[22] !== value) {
7590
- t02 = /* @__PURE__ */ jsx(UrlComponentPreview, { size: props.size, url: value, fill });
7591
- $[20] = fill;
7592
- $[21] = props.size;
7593
- $[22] = value;
7594
- $[23] = t02;
7595
- } else {
7596
- t02 = $[23];
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
- if (typeof stringProperty.url === "string") {
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.markdown) {
7606
- let t02;
7607
- if ($[24] !== value) {
7608
- t02 = /* @__PURE__ */ jsx(Markdown, { source: value, size: "small" });
7609
- $[24] = value;
7610
- $[25] = t02;
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
- t02 = $[25];
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(76);
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
- if ($[20] !== flushChanges || $[21] !== state) {
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
- $[20] = flushChanges;
41504
- $[21] = state;
41505
- $[22] = t12;
41584
+ $[22] = flushChanges;
41585
+ $[23] = state;
41586
+ $[24] = t14;
41506
41587
  } else {
41507
- t12 = $[22];
41588
+ t14 = $[24];
41508
41589
  }
41509
- let t13;
41510
- if ($[23] !== doc) {
41511
- t13 = [doc];
41512
- $[23] = doc;
41513
- $[24] = t13;
41590
+ let t15;
41591
+ if ($[25] !== doc) {
41592
+ t15 = [doc];
41593
+ $[25] = doc;
41594
+ $[26] = t15;
41514
41595
  } else {
41515
- t13 = $[24];
41596
+ t15 = $[26];
41516
41597
  }
41517
- useEffect(t12, t13);
41518
- let t14;
41519
- if ($[25] !== flushChanges || $[26] !== view) {
41520
- t14 = () => {
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
- $[25] = flushChanges;
41532
- $[26] = view;
41533
- $[27] = t14;
41615
+ $[27] = flushChanges;
41616
+ $[28] = view;
41617
+ $[29] = t16;
41534
41618
  } else {
41535
- t14 = $[27];
41619
+ t16 = $[29];
41536
41620
  }
41537
- let t15;
41538
- if ($[28] !== view) {
41539
- t15 = [view];
41540
- $[28] = view;
41541
- $[29] = t15;
41621
+ let t17;
41622
+ if ($[30] !== view) {
41623
+ t17 = [view];
41624
+ $[30] = view;
41625
+ $[31] = t17;
41542
41626
  } else {
41543
- t15 = $[29];
41627
+ t17 = $[31];
41544
41628
  }
41545
- useEffect(t14, t15);
41546
- let t16;
41547
- if ($[30] !== highlight || $[31] !== view) {
41548
- t16 = () => {
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
- $[30] = highlight;
41558
- $[31] = view;
41559
- $[32] = t16;
41641
+ $[32] = highlight;
41642
+ $[33] = view;
41643
+ $[34] = t18;
41560
41644
  } else {
41561
- t16 = $[32];
41645
+ t18 = $[34];
41562
41646
  }
41563
- const t17 = highlight?.from;
41564
- const t18 = highlight?.to;
41565
- let t19;
41566
- if ($[33] !== t17 || $[34] !== t18) {
41567
- t19 = [t17, t18];
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
- t19 = $[35];
41656
+ t21 = $[37];
41573
41657
  }
41574
- useEffect(t16, t19);
41658
+ useEffect(t18, t21);
41575
41659
  const proseClass = proseClasses[textSize];
41576
- const t20 = isMarkdownMode ? "Switch to Visual Editor" : "Switch to Markdown";
41577
- const t21 = isMarkdownMode ? "Visual" : "Markdown";
41578
- let t22;
41579
- if ($[36] !== handleToggleMarkdown || $[37] !== t20 || $[38] !== t21) {
41580
- t22 = /* @__PURE__ */ jsx("button", { type: "button", onClick: handleToggleMarkdown, title: t20, 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: t21 });
41581
- $[36] = handleToggleMarkdown;
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
- t22 = $[39];
41670
+ t24 = $[41];
41587
41671
  }
41588
- let t23;
41589
- if ($[40] !== state || $[41] !== view) {
41590
- t23 = {
41672
+ let t25;
41673
+ if ($[42] !== state || $[43] !== view) {
41674
+ t25 = {
41591
41675
  state,
41592
41676
  view
41593
41677
  };
41594
- $[40] = state;
41595
- $[41] = view;
41596
- $[42] = t23;
41678
+ $[42] = state;
41679
+ $[43] = view;
41680
+ $[44] = t25;
41597
41681
  } else {
41598
- t23 = $[42];
41682
+ t25 = $[44];
41599
41683
  }
41600
- const t24 = isMarkdownMode ? "none" : "block";
41601
- let t25;
41602
- if ($[43] !== t24) {
41603
- t25 = {
41604
- display: t24
41684
+ const t26 = isMarkdownMode ? "none" : "block";
41685
+ let t27;
41686
+ if ($[45] !== t26) {
41687
+ t27 = {
41688
+ display: t26
41605
41689
  };
41606
- $[43] = t24;
41607
- $[44] = t25;
41690
+ $[45] = t26;
41691
+ $[46] = t27;
41608
41692
  } else {
41609
- t25 = $[44];
41693
+ t27 = $[46];
41610
41694
  }
41611
- let t26;
41612
- if ($[45] !== proseClass) {
41613
- t26 = cls(proseClass, "prose-headings:font-title font-default focus:outline-none max-w-full p-12");
41614
- $[45] = proseClass;
41615
- $[46] = t26;
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
- t26 = $[46];
41701
+ t28 = $[48];
41618
41702
  }
41619
- let t27;
41620
- if ($[47] !== editorRef || $[48] !== t26) {
41621
- t27 = /* @__PURE__ */ jsx("div", { ref: editorRef, className: t26 });
41622
- $[47] = editorRef;
41623
- $[48] = t26;
41624
- $[49] = t27;
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
- t27 = $[49];
41710
+ t29 = $[51];
41627
41711
  }
41628
- let t28;
41629
- if ($[50] !== editorRef || $[51] !== openLink || $[52] !== openNode || $[53] !== view) {
41630
- t28 = view && /* @__PURE__ */ jsxs(Fragment, { children: [
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
- $[50] = editorRef;
41648
- $[51] = openLink;
41649
- $[52] = openNode;
41650
- $[53] = view;
41651
- $[54] = t28;
41731
+ $[52] = editorRef;
41732
+ $[53] = openLink;
41733
+ $[54] = openNode;
41734
+ $[55] = view;
41735
+ $[56] = t30;
41652
41736
  } else {
41653
- t28 = $[54];
41737
+ t30 = $[56];
41654
41738
  }
41655
- let t29;
41656
- if ($[55] !== aiController || $[56] !== handleImageUpload) {
41657
- t29 = /* @__PURE__ */ jsx(SlashCommandMenu, { upload: handleImageUpload, aiController });
41658
- $[55] = aiController;
41659
- $[56] = handleImageUpload;
41660
- $[57] = t29;
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
- t29 = $[57];
41746
+ t31 = $[59];
41663
41747
  }
41664
- let t30;
41665
- if ($[58] !== t25 || $[59] !== t27 || $[60] !== t28 || $[61] !== t29) {
41666
- t30 = /* @__PURE__ */ jsxs("div", { style: t25, children: [
41667
- t27,
41668
- t28,
41669
- t29
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
- $[58] = t25;
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
- t30 = $[62];
41761
+ t32 = $[64];
41678
41762
  }
41679
- let t31;
41680
- if ($[63] !== handleMarkdownBlur || $[64] !== handleMarkdownChange || $[65] !== internalMarkdown || $[66] !== isMarkdownMode || $[67] !== proseClass) {
41681
- t31 = isMarkdownMode && /* @__PURE__ */ jsx(TextareaAutosize, { value: internalMarkdown, onChange: handleMarkdownChange, onBlur: handleMarkdownBlur, className: cls("w-full h-full min-h-[300px] p-12 bg-transparent resize-none font-mono focus:ring-0", proseClass), style: {
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
- $[63] = handleMarkdownBlur;
41688
- $[64] = handleMarkdownChange;
41689
- $[65] = internalMarkdown;
41690
- $[66] = isMarkdownMode;
41691
- $[67] = proseClass;
41692
- $[68] = t31;
41771
+ $[65] = handleMarkdownBlur;
41772
+ $[66] = handleMarkdownChange;
41773
+ $[67] = internalMarkdown;
41774
+ $[68] = isMarkdownMode;
41775
+ $[69] = proseClass;
41776
+ $[70] = t33;
41693
41777
  } else {
41694
- t31 = $[68];
41778
+ t33 = $[70];
41695
41779
  }
41696
- let t32;
41697
- if ($[69] !== t23 || $[70] !== t30 || $[71] !== t31) {
41698
- t32 = /* @__PURE__ */ jsxs(ProseMirrorContext.Provider, { value: t23, children: [
41699
- t30,
41700
- t31
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
- $[69] = t23;
41703
- $[70] = t30;
41704
- $[71] = t31;
41786
+ $[71] = t25;
41705
41787
  $[72] = t32;
41788
+ $[73] = t33;
41789
+ $[74] = t34;
41706
41790
  } else {
41707
- t32 = $[72];
41791
+ t34 = $[74];
41708
41792
  }
41709
- let t33;
41710
- if ($[73] !== t22 || $[74] !== t32) {
41711
- t33 = /* @__PURE__ */ jsxs("div", { className: "relative min-h-[300px] w-full", children: [
41712
- t22,
41713
- t32
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
- $[73] = t22;
41716
- $[74] = t32;
41717
- $[75] = t33;
41799
+ $[75] = t24;
41800
+ $[76] = t34;
41801
+ $[77] = t35;
41718
41802
  } else {
41719
- t33 = $[75];
41803
+ t35 = $[77];
41720
41804
  }
41721
- return t33;
41805
+ return t35;
41722
41806
  };
41723
41807
  const cssStyles = `
41724
41808
  .ProseMirror {