@firecms/core 3.3.0-canary.451aa49 → 3.3.0-canary.69e5ab1

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.umd.js CHANGED
@@ -7543,52 +7543,52 @@
7543
7543
  if (property.dataType === "string") {
7544
7544
  const stringProperty = property;
7545
7545
  if (typeof value === "string") {
7546
- if (stringProperty.storage) {
7547
- const filePath = stringProperty.storage.previewUrl ? stringProperty.storage.previewUrl(value) : value;
7548
- const t02 = property.storage?.storeUrl ?? false;
7549
- let t1;
7550
- if ($[14] !== filePath || $[15] !== fill || $[16] !== interactive || $[17] !== props.size || $[18] !== t02) {
7551
- t1 = /* @__PURE__ */ jsxRuntime.jsx(StorageThumbnail, { interactive, storeUrl: t02, size: props.size, fill, storagePathOrDownloadUrl: filePath });
7552
- $[14] = filePath;
7553
- $[15] = fill;
7554
- $[16] = interactive;
7555
- $[17] = props.size;
7556
- $[18] = t02;
7557
- $[19] = t1;
7546
+ if (stringProperty.markdown) {
7547
+ let t02;
7548
+ if ($[14] !== value) {
7549
+ t02 = /* @__PURE__ */ jsxRuntime.jsx(ui.Markdown, { source: value, size: "small" });
7550
+ $[14] = value;
7551
+ $[15] = t02;
7558
7552
  } else {
7559
- t1 = $[19];
7553
+ t02 = $[15];
7560
7554
  }
7561
- content = t1;
7555
+ content = t02;
7562
7556
  } else {
7563
- if (stringProperty.url) {
7564
- if (typeof stringProperty.url === "boolean") {
7565
- let t02;
7566
- if ($[20] !== fill || $[21] !== props.size || $[22] !== value) {
7567
- t02 = /* @__PURE__ */ jsxRuntime.jsx(UrlComponentPreview, { size: props.size, url: value, fill });
7568
- $[20] = fill;
7569
- $[21] = props.size;
7570
- $[22] = value;
7571
- $[23] = t02;
7572
- } else {
7573
- t02 = $[23];
7574
- }
7575
- content = t02;
7557
+ if (stringProperty.storage) {
7558
+ const filePath = stringProperty.storage.previewUrl ? stringProperty.storage.previewUrl(value) : value;
7559
+ const t02 = property.storage?.storeUrl ?? false;
7560
+ let t1;
7561
+ if ($[16] !== filePath || $[17] !== fill || $[18] !== interactive || $[19] !== props.size || $[20] !== t02) {
7562
+ t1 = /* @__PURE__ */ jsxRuntime.jsx(StorageThumbnail, { interactive, storeUrl: t02, size: props.size, fill, storagePathOrDownloadUrl: filePath });
7563
+ $[16] = filePath;
7564
+ $[17] = fill;
7565
+ $[18] = interactive;
7566
+ $[19] = props.size;
7567
+ $[20] = t02;
7568
+ $[21] = t1;
7576
7569
  } else {
7577
- if (typeof stringProperty.url === "string") {
7578
- content = /* @__PURE__ */ jsxRuntime.jsx(UrlComponentPreview, { size: props.size, url: value, interactive, fill, previewType: stringProperty.url });
7579
- }
7570
+ t1 = $[21];
7580
7571
  }
7572
+ content = t1;
7581
7573
  } else {
7582
- if (stringProperty.markdown) {
7583
- let t02;
7584
- if ($[24] !== value) {
7585
- t02 = /* @__PURE__ */ jsxRuntime.jsx(ui.Markdown, { source: value, size: "small" });
7586
- $[24] = value;
7587
- $[25] = t02;
7574
+ if (stringProperty.url) {
7575
+ if (typeof stringProperty.url === "boolean") {
7576
+ let t02;
7577
+ if ($[22] !== fill || $[23] !== props.size || $[24] !== value) {
7578
+ t02 = /* @__PURE__ */ jsxRuntime.jsx(UrlComponentPreview, { size: props.size, url: value, fill });
7579
+ $[22] = fill;
7580
+ $[23] = props.size;
7581
+ $[24] = value;
7582
+ $[25] = t02;
7583
+ } else {
7584
+ t02 = $[25];
7585
+ }
7586
+ content = t02;
7588
7587
  } else {
7589
- t02 = $[25];
7588
+ if (typeof stringProperty.url === "string") {
7589
+ content = /* @__PURE__ */ jsxRuntime.jsx(UrlComponentPreview, { size: props.size, url: value, interactive, fill, previewType: stringProperty.url });
7590
+ }
7590
7591
  }
7591
- content = t02;
7592
7592
  } else {
7593
7593
  if (stringProperty.userSelect) {
7594
7594
  content = /* @__PURE__ */ jsxRuntime.jsx(UserPreview, { value, property: stringProperty, propertyKey, size: props.size });
@@ -17014,14 +17014,14 @@
17014
17014
  if (property.dataType === "string") {
17015
17015
  if (property.url) {
17016
17016
  return 280;
17017
+ } else if (property.markdown) {
17018
+ return 300;
17017
17019
  } else if (property.storage) {
17018
17020
  return 160;
17019
17021
  } else if (property.enumValues) {
17020
17022
  return 200;
17021
17023
  } else if (property.multiline) {
17022
17024
  return 300;
17023
- } else if (property.markdown) {
17024
- return 300;
17025
17025
  } else if (property.email) {
17026
17026
  return 200;
17027
17027
  } else {
@@ -29738,7 +29738,7 @@
29738
29738
  const {
29739
29739
  selectedSecondaryForm
29740
29740
  } = resolvedSelectedEntityView(props.collection?.entityViews, customizationController, props.selectedTab);
29741
- const shouldUseSmallLayout = !props.selectedTab || props.selectedTab === JSON_TAB_VALUE || props.selectedTab === "__history" || Boolean(selectedSecondaryForm);
29741
+ const shouldUseSmallLayout = !props.selectedTab || props.selectedTab === JSON_TAB_VALUE || props.selectedTab === "__history" || props.selectedTab === "__raw_data" || Boolean(selectedSecondaryForm);
29742
29742
  let resolvedWidth;
29743
29743
  if (props.width) {
29744
29744
  resolvedWidth = typeof props.width === "number" ? `${props.width}px` : props.width;
@@ -38408,6 +38408,44 @@
38408
38408
  const md = markdownIt({
38409
38409
  html: false
38410
38410
  }).use(markdownItTaskLists).use(markdownItMark).use(markdownItIns);
38411
+ md.inline.ruler.at("escape", function escapeOverride(state, silent) {
38412
+ let pos = state.pos;
38413
+ const max = state.posMax;
38414
+ if (state.src.charCodeAt(pos) !== 92) return false;
38415
+ pos++;
38416
+ if (pos >= max) return false;
38417
+ const ch1 = state.src.charCodeAt(pos);
38418
+ if (ch1 === 10) {
38419
+ if (!silent) {
38420
+ state.pending += "\\";
38421
+ }
38422
+ state.pos = pos;
38423
+ return true;
38424
+ }
38425
+ let escapedStr = state.src[pos];
38426
+ if (ch1 >= 55296 && ch1 <= 56319 && pos + 1 < max) {
38427
+ const ch2 = state.src.charCodeAt(pos + 1);
38428
+ if (ch2 >= 56320 && ch2 <= 57343) {
38429
+ escapedStr += state.src[pos + 1];
38430
+ pos++;
38431
+ }
38432
+ }
38433
+ const origStr = "\\" + escapedStr;
38434
+ if (!silent) {
38435
+ const isEscapable = ch1 < 256 && /[\\!"#$%&'()*+,./:;<=>?@[\]^_`{|}~-]/.test(String.fromCharCode(ch1));
38436
+ const token = state.push("text_special", "", 0);
38437
+ if (isEscapable) {
38438
+ token.content = escapedStr;
38439
+ } else {
38440
+ token.content = origStr;
38441
+ }
38442
+ token.markup = origStr;
38443
+ token.info = "escape";
38444
+ }
38445
+ state.pos = pos + 1;
38446
+ return true;
38447
+ });
38448
+ md.inline.ruler.disable(["newline"]);
38411
38449
  md.core.ruler.after("inline", "image-to-block", (state) => {
38412
38450
  const tokens = state.tokens;
38413
38451
  for (let i = tokens.length - 2; i >= 1; i--) {
@@ -38493,6 +38531,28 @@
38493
38531
  table_cell() {
38494
38532
  },
38495
38533
  table_header() {
38534
+ },
38535
+ // Custom text serializer: since our parser override keeps `\` as
38536
+ // literal text (instead of consuming it), we must avoid the default
38537
+ // esc() from double-escaping it. We escape all standard markdown
38538
+ // specials *except* the backslash itself.
38539
+ text(state, node) {
38540
+ const escaped = node.text.replace(/[`*~\[\]_]/g, (m, i) => {
38541
+ if (m === "_" && i > 0 && i + 1 < node.text.length && /\w/.test(node.text[i - 1]) && /\w/.test(node.text[i + 1])) {
38542
+ return m;
38543
+ }
38544
+ return "\\" + m;
38545
+ });
38546
+ const lines = escaped.split("\n");
38547
+ for (let i = 0; i < lines.length; i++) {
38548
+ state.write();
38549
+ let line = lines[i];
38550
+ if (state.atBlockStart || i > 0) {
38551
+ line = line.replace(/^(\+[ ]|[-*>])/, "\\$&").replace(/^(\s*)(#{1,6})(\s|$)/, "$1\\$2$3").replace(/^(\s*\d+)\.\s/, "$1\\. ");
38552
+ }
38553
+ state.out += line;
38554
+ if (i !== lines.length - 1) state.out += "\n";
38555
+ }
38496
38556
  }
38497
38557
  }, {
38498
38558
  ...prosemirrorMarkdown.defaultMarkdownSerializer.marks,
@@ -41294,7 +41354,7 @@
41294
41354
  "lg": "prose-lg"
41295
41355
  };
41296
41356
  const FireCMSEditor = (t0) => {
41297
- const $ = reactCompilerRuntime.c(76);
41357
+ const $ = reactCompilerRuntime.c(78);
41298
41358
  const {
41299
41359
  content,
41300
41360
  onJsonContentChange,
@@ -41466,63 +41526,87 @@
41466
41526
  } = useProseMirror(t10);
41467
41527
  const view = t11;
41468
41528
  const doc = state?.doc;
41529
+ const mountedRef = React.useRef(false);
41469
41530
  let t12;
41470
- if ($[20] !== flushChanges || $[21] !== state) {
41531
+ let t13;
41532
+ if ($[20] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
41471
41533
  t12 = () => {
41534
+ const raf = requestAnimationFrame(() => {
41535
+ mountedRef.current = true;
41536
+ });
41537
+ return () => cancelAnimationFrame(raf);
41538
+ };
41539
+ t13 = [];
41540
+ $[20] = t12;
41541
+ $[21] = t13;
41542
+ } else {
41543
+ t12 = $[20];
41544
+ t13 = $[21];
41545
+ }
41546
+ React.useEffect(t12, t13);
41547
+ let t14;
41548
+ if ($[22] !== flushChanges || $[23] !== state) {
41549
+ t14 = () => {
41472
41550
  if (!state) {
41473
41551
  return;
41474
41552
  }
41553
+ if (!mountedRef.current) {
41554
+ return;
41555
+ }
41475
41556
  const timeout_0 = setTimeout(() => {
41476
41557
  flushChanges(state);
41477
41558
  }, 250);
41478
41559
  return () => clearTimeout(timeout_0);
41479
41560
  };
41480
- $[20] = flushChanges;
41481
- $[21] = state;
41482
- $[22] = t12;
41561
+ $[22] = flushChanges;
41562
+ $[23] = state;
41563
+ $[24] = t14;
41483
41564
  } else {
41484
- t12 = $[22];
41565
+ t14 = $[24];
41485
41566
  }
41486
- let t13;
41487
- if ($[23] !== doc) {
41488
- t13 = [doc];
41489
- $[23] = doc;
41490
- $[24] = t13;
41567
+ let t15;
41568
+ if ($[25] !== doc) {
41569
+ t15 = [doc];
41570
+ $[25] = doc;
41571
+ $[26] = t15;
41491
41572
  } else {
41492
- t13 = $[24];
41573
+ t15 = $[26];
41493
41574
  }
41494
- React.useEffect(t12, t13);
41495
- let t14;
41496
- if ($[25] !== flushChanges || $[26] !== view) {
41497
- t14 = () => {
41575
+ React.useEffect(t14, t15);
41576
+ let t16;
41577
+ if ($[27] !== flushChanges || $[28] !== view) {
41578
+ t16 = () => {
41498
41579
  if (!view) {
41499
41580
  return;
41500
41581
  }
41501
41582
  const dom2 = view.dom;
41502
41583
  const handleBlur = () => {
41584
+ if (!mountedRef.current) {
41585
+ return;
41586
+ }
41503
41587
  flushChanges(view.state);
41504
41588
  };
41505
41589
  dom2.addEventListener("blur", handleBlur);
41506
41590
  return () => dom2.removeEventListener("blur", handleBlur);
41507
41591
  };
41508
- $[25] = flushChanges;
41509
- $[26] = view;
41510
- $[27] = t14;
41592
+ $[27] = flushChanges;
41593
+ $[28] = view;
41594
+ $[29] = t16;
41511
41595
  } else {
41512
- t14 = $[27];
41596
+ t16 = $[29];
41513
41597
  }
41514
- let t15;
41515
- if ($[28] !== view) {
41516
- t15 = [view];
41517
- $[28] = view;
41518
- $[29] = t15;
41598
+ let t17;
41599
+ if ($[30] !== view) {
41600
+ t17 = [view];
41601
+ $[30] = view;
41602
+ $[31] = t17;
41519
41603
  } else {
41520
- t15 = $[29];
41604
+ t17 = $[31];
41521
41605
  }
41522
- React.useEffect(t14, t15);
41523
- let t16;
41524
- if ($[30] !== highlight || $[31] !== view) {
41525
- t16 = () => {
41606
+ React.useEffect(t16, t17);
41607
+ let t18;
41608
+ if ($[32] !== highlight || $[33] !== view) {
41609
+ t18 = () => {
41526
41610
  if (view) {
41527
41611
  if (highlight) {
41528
41612
  highlightCommands.toggleAutocompleteHighlight(highlight)(view.state, view.dispatch);
@@ -41531,80 +41615,80 @@
41531
41615
  }
41532
41616
  }
41533
41617
  };
41534
- $[30] = highlight;
41535
- $[31] = view;
41536
- $[32] = t16;
41618
+ $[32] = highlight;
41619
+ $[33] = view;
41620
+ $[34] = t18;
41537
41621
  } else {
41538
- t16 = $[32];
41622
+ t18 = $[34];
41539
41623
  }
41540
- const t17 = highlight?.from;
41541
- const t18 = highlight?.to;
41542
- let t19;
41543
- if ($[33] !== t17 || $[34] !== t18) {
41544
- t19 = [t17, t18];
41545
- $[33] = t17;
41546
- $[34] = t18;
41624
+ const t19 = highlight?.from;
41625
+ const t20 = highlight?.to;
41626
+ let t21;
41627
+ if ($[35] !== t19 || $[36] !== t20) {
41628
+ t21 = [t19, t20];
41547
41629
  $[35] = t19;
41630
+ $[36] = t20;
41631
+ $[37] = t21;
41548
41632
  } else {
41549
- t19 = $[35];
41633
+ t21 = $[37];
41550
41634
  }
41551
- React.useEffect(t16, t19);
41635
+ React.useEffect(t18, t21);
41552
41636
  const proseClass = proseClasses[textSize];
41553
- const t20 = isMarkdownMode ? "Switch to Visual Editor" : "Switch to Markdown";
41554
- const t21 = isMarkdownMode ? "Visual" : "Markdown";
41555
- let t22;
41556
- if ($[36] !== handleToggleMarkdown || $[37] !== t20 || $[38] !== t21) {
41557
- t22 = /* @__PURE__ */ jsxRuntime.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 });
41558
- $[36] = handleToggleMarkdown;
41559
- $[37] = t20;
41560
- $[38] = t21;
41637
+ const t22 = isMarkdownMode ? "Switch to Visual Editor" : "Switch to Markdown";
41638
+ const t23 = isMarkdownMode ? "Visual" : "Markdown";
41639
+ let t24;
41640
+ if ($[38] !== handleToggleMarkdown || $[39] !== t22 || $[40] !== t23) {
41641
+ t24 = /* @__PURE__ */ jsxRuntime.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 });
41642
+ $[38] = handleToggleMarkdown;
41561
41643
  $[39] = t22;
41644
+ $[40] = t23;
41645
+ $[41] = t24;
41562
41646
  } else {
41563
- t22 = $[39];
41647
+ t24 = $[41];
41564
41648
  }
41565
- let t23;
41566
- if ($[40] !== state || $[41] !== view) {
41567
- t23 = {
41649
+ let t25;
41650
+ if ($[42] !== state || $[43] !== view) {
41651
+ t25 = {
41568
41652
  state,
41569
41653
  view
41570
41654
  };
41571
- $[40] = state;
41572
- $[41] = view;
41573
- $[42] = t23;
41655
+ $[42] = state;
41656
+ $[43] = view;
41657
+ $[44] = t25;
41574
41658
  } else {
41575
- t23 = $[42];
41659
+ t25 = $[44];
41576
41660
  }
41577
- const t24 = isMarkdownMode ? "none" : "block";
41578
- let t25;
41579
- if ($[43] !== t24) {
41580
- t25 = {
41581
- display: t24
41661
+ const t26 = isMarkdownMode ? "none" : "block";
41662
+ let t27;
41663
+ if ($[45] !== t26) {
41664
+ t27 = {
41665
+ display: t26
41582
41666
  };
41583
- $[43] = t24;
41584
- $[44] = t25;
41667
+ $[45] = t26;
41668
+ $[46] = t27;
41585
41669
  } else {
41586
- t25 = $[44];
41670
+ t27 = $[46];
41587
41671
  }
41588
- let t26;
41589
- if ($[45] !== proseClass) {
41590
- t26 = ui.cls(proseClass, "prose-headings:font-title font-default focus:outline-none max-w-full p-12");
41591
- $[45] = proseClass;
41592
- $[46] = t26;
41672
+ let t28;
41673
+ if ($[47] !== proseClass) {
41674
+ t28 = ui.cls(proseClass, "prose-headings:font-title font-default focus:outline-none max-w-full p-12");
41675
+ $[47] = proseClass;
41676
+ $[48] = t28;
41593
41677
  } else {
41594
- t26 = $[46];
41678
+ t28 = $[48];
41595
41679
  }
41596
- let t27;
41597
- if ($[47] !== editorRef || $[48] !== t26) {
41598
- t27 = /* @__PURE__ */ jsxRuntime.jsx("div", { ref: editorRef, className: t26 });
41599
- $[47] = editorRef;
41600
- $[48] = t26;
41601
- $[49] = t27;
41680
+ let t29;
41681
+ if ($[49] !== editorRef || $[50] !== t28) {
41682
+ t29 = /* @__PURE__ */ jsxRuntime.jsx("div", { ref: editorRef, className: t28 });
41683
+ $[49] = editorRef;
41684
+ $[50] = t28;
41685
+ $[51] = t29;
41602
41686
  } else {
41603
- t27 = $[49];
41687
+ t29 = $[51];
41604
41688
  }
41605
- let t28;
41606
- if ($[50] !== editorRef || $[51] !== openLink || $[52] !== openNode || $[53] !== view) {
41607
- t28 = view && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
41689
+ let t30;
41690
+ if ($[52] !== editorRef || $[53] !== openLink || $[54] !== openNode || $[55] !== view) {
41691
+ t30 = view && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
41608
41692
  /* @__PURE__ */ jsxRuntime.jsxs(EditorBubble, { options: {
41609
41693
  placement: "top",
41610
41694
  offset: 6
@@ -41621,81 +41705,81 @@
41621
41705
  } }),
41622
41706
  /* @__PURE__ */ jsxRuntime.jsx(TableBubble, {})
41623
41707
  ] });
41624
- $[50] = editorRef;
41625
- $[51] = openLink;
41626
- $[52] = openNode;
41627
- $[53] = view;
41628
- $[54] = t28;
41708
+ $[52] = editorRef;
41709
+ $[53] = openLink;
41710
+ $[54] = openNode;
41711
+ $[55] = view;
41712
+ $[56] = t30;
41629
41713
  } else {
41630
- t28 = $[54];
41714
+ t30 = $[56];
41631
41715
  }
41632
- let t29;
41633
- if ($[55] !== aiController || $[56] !== handleImageUpload) {
41634
- t29 = /* @__PURE__ */ jsxRuntime.jsx(SlashCommandMenu, { upload: handleImageUpload, aiController });
41635
- $[55] = aiController;
41636
- $[56] = handleImageUpload;
41637
- $[57] = t29;
41716
+ let t31;
41717
+ if ($[57] !== aiController || $[58] !== handleImageUpload) {
41718
+ t31 = /* @__PURE__ */ jsxRuntime.jsx(SlashCommandMenu, { upload: handleImageUpload, aiController });
41719
+ $[57] = aiController;
41720
+ $[58] = handleImageUpload;
41721
+ $[59] = t31;
41638
41722
  } else {
41639
- t29 = $[57];
41723
+ t31 = $[59];
41640
41724
  }
41641
- let t30;
41642
- if ($[58] !== t25 || $[59] !== t27 || $[60] !== t28 || $[61] !== t29) {
41643
- t30 = /* @__PURE__ */ jsxRuntime.jsxs("div", { style: t25, children: [
41644
- t27,
41645
- t28,
41646
- t29
41725
+ let t32;
41726
+ if ($[60] !== t27 || $[61] !== t29 || $[62] !== t30 || $[63] !== t31) {
41727
+ t32 = /* @__PURE__ */ jsxRuntime.jsxs("div", { style: t27, children: [
41728
+ t29,
41729
+ t30,
41730
+ t31
41647
41731
  ] });
41648
- $[58] = t25;
41649
- $[59] = t27;
41650
- $[60] = t28;
41732
+ $[60] = t27;
41651
41733
  $[61] = t29;
41652
41734
  $[62] = t30;
41735
+ $[63] = t31;
41736
+ $[64] = t32;
41653
41737
  } else {
41654
- t30 = $[62];
41738
+ t32 = $[64];
41655
41739
  }
41656
- let t31;
41657
- if ($[63] !== handleMarkdownBlur || $[64] !== handleMarkdownChange || $[65] !== internalMarkdown || $[66] !== isMarkdownMode || $[67] !== proseClass) {
41658
- t31 = isMarkdownMode && /* @__PURE__ */ jsxRuntime.jsx(ui.TextareaAutosize, { value: internalMarkdown, onChange: handleMarkdownChange, onBlur: handleMarkdownBlur, className: ui.cls("w-full h-full min-h-[300px] p-12 bg-transparent resize-none font-mono focus:ring-0", proseClass), style: {
41740
+ let t33;
41741
+ if ($[65] !== handleMarkdownBlur || $[66] !== handleMarkdownChange || $[67] !== internalMarkdown || $[68] !== isMarkdownMode || $[69] !== proseClass) {
41742
+ t33 = isMarkdownMode && /* @__PURE__ */ jsxRuntime.jsx(ui.TextareaAutosize, { value: internalMarkdown, onChange: handleMarkdownChange, onBlur: handleMarkdownBlur, className: ui.cls("w-full min-h-[300px] p-12 bg-transparent resize-none font-mono focus:ring-0 focus:outline-none outline-none", proseClass), style: {
41659
41743
  tabSize: 4,
41660
41744
  outline: "none",
41661
41745
  border: "none",
41662
41746
  boxShadow: "none"
41663
41747
  } });
41664
- $[63] = handleMarkdownBlur;
41665
- $[64] = handleMarkdownChange;
41666
- $[65] = internalMarkdown;
41667
- $[66] = isMarkdownMode;
41668
- $[67] = proseClass;
41669
- $[68] = t31;
41748
+ $[65] = handleMarkdownBlur;
41749
+ $[66] = handleMarkdownChange;
41750
+ $[67] = internalMarkdown;
41751
+ $[68] = isMarkdownMode;
41752
+ $[69] = proseClass;
41753
+ $[70] = t33;
41670
41754
  } else {
41671
- t31 = $[68];
41755
+ t33 = $[70];
41672
41756
  }
41673
- let t32;
41674
- if ($[69] !== t23 || $[70] !== t30 || $[71] !== t31) {
41675
- t32 = /* @__PURE__ */ jsxRuntime.jsxs(ProseMirrorContext.Provider, { value: t23, children: [
41676
- t30,
41677
- t31
41757
+ let t34;
41758
+ if ($[71] !== t25 || $[72] !== t32 || $[73] !== t33) {
41759
+ t34 = /* @__PURE__ */ jsxRuntime.jsxs(ProseMirrorContext.Provider, { value: t25, children: [
41760
+ t32,
41761
+ t33
41678
41762
  ] });
41679
- $[69] = t23;
41680
- $[70] = t30;
41681
- $[71] = t31;
41763
+ $[71] = t25;
41682
41764
  $[72] = t32;
41765
+ $[73] = t33;
41766
+ $[74] = t34;
41683
41767
  } else {
41684
- t32 = $[72];
41768
+ t34 = $[74];
41685
41769
  }
41686
- let t33;
41687
- if ($[73] !== t22 || $[74] !== t32) {
41688
- t33 = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative min-h-[300px] w-full", children: [
41689
- t22,
41690
- t32
41770
+ let t35;
41771
+ if ($[75] !== t24 || $[76] !== t34) {
41772
+ t35 = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative min-h-[300px] w-full", children: [
41773
+ t24,
41774
+ t34
41691
41775
  ] });
41692
- $[73] = t22;
41693
- $[74] = t32;
41694
- $[75] = t33;
41776
+ $[75] = t24;
41777
+ $[76] = t34;
41778
+ $[77] = t35;
41695
41779
  } else {
41696
- t33 = $[75];
41780
+ t35 = $[77];
41697
41781
  }
41698
- return t33;
41782
+ return t35;
41699
41783
  };
41700
41784
  const cssStyles = `
41701
41785
  .ProseMirror {