@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.
- 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.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.
|
|
7547
|
-
|
|
7548
|
-
|
|
7549
|
-
|
|
7550
|
-
|
|
7551
|
-
|
|
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
|
-
|
|
7553
|
+
t02 = $[15];
|
|
7560
7554
|
}
|
|
7561
|
-
content =
|
|
7555
|
+
content = t02;
|
|
7562
7556
|
} else {
|
|
7563
|
-
if (stringProperty.
|
|
7564
|
-
|
|
7565
|
-
|
|
7566
|
-
|
|
7567
|
-
|
|
7568
|
-
|
|
7569
|
-
|
|
7570
|
-
|
|
7571
|
-
|
|
7572
|
-
|
|
7573
|
-
|
|
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
|
-
|
|
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.
|
|
7583
|
-
|
|
7584
|
-
|
|
7585
|
-
|
|
7586
|
-
|
|
7587
|
-
|
|
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
|
-
|
|
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(
|
|
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
|
-
|
|
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
|
-
$[
|
|
41481
|
-
$[
|
|
41482
|
-
$[
|
|
41561
|
+
$[22] = flushChanges;
|
|
41562
|
+
$[23] = state;
|
|
41563
|
+
$[24] = t14;
|
|
41483
41564
|
} else {
|
|
41484
|
-
|
|
41565
|
+
t14 = $[24];
|
|
41485
41566
|
}
|
|
41486
|
-
let
|
|
41487
|
-
if ($[
|
|
41488
|
-
|
|
41489
|
-
$[
|
|
41490
|
-
$[
|
|
41567
|
+
let t15;
|
|
41568
|
+
if ($[25] !== doc) {
|
|
41569
|
+
t15 = [doc];
|
|
41570
|
+
$[25] = doc;
|
|
41571
|
+
$[26] = t15;
|
|
41491
41572
|
} else {
|
|
41492
|
-
|
|
41573
|
+
t15 = $[26];
|
|
41493
41574
|
}
|
|
41494
|
-
React.useEffect(
|
|
41495
|
-
let
|
|
41496
|
-
if ($[
|
|
41497
|
-
|
|
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
|
-
$[
|
|
41509
|
-
$[
|
|
41510
|
-
$[
|
|
41592
|
+
$[27] = flushChanges;
|
|
41593
|
+
$[28] = view;
|
|
41594
|
+
$[29] = t16;
|
|
41511
41595
|
} else {
|
|
41512
|
-
|
|
41596
|
+
t16 = $[29];
|
|
41513
41597
|
}
|
|
41514
|
-
let
|
|
41515
|
-
if ($[
|
|
41516
|
-
|
|
41517
|
-
$[
|
|
41518
|
-
$[
|
|
41598
|
+
let t17;
|
|
41599
|
+
if ($[30] !== view) {
|
|
41600
|
+
t17 = [view];
|
|
41601
|
+
$[30] = view;
|
|
41602
|
+
$[31] = t17;
|
|
41519
41603
|
} else {
|
|
41520
|
-
|
|
41604
|
+
t17 = $[31];
|
|
41521
41605
|
}
|
|
41522
|
-
React.useEffect(
|
|
41523
|
-
let
|
|
41524
|
-
if ($[
|
|
41525
|
-
|
|
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
|
-
$[
|
|
41535
|
-
$[
|
|
41536
|
-
$[
|
|
41618
|
+
$[32] = highlight;
|
|
41619
|
+
$[33] = view;
|
|
41620
|
+
$[34] = t18;
|
|
41537
41621
|
} else {
|
|
41538
|
-
|
|
41622
|
+
t18 = $[34];
|
|
41539
41623
|
}
|
|
41540
|
-
const
|
|
41541
|
-
const
|
|
41542
|
-
let
|
|
41543
|
-
if ($[
|
|
41544
|
-
|
|
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
|
-
|
|
41633
|
+
t21 = $[37];
|
|
41550
41634
|
}
|
|
41551
|
-
React.useEffect(
|
|
41635
|
+
React.useEffect(t18, t21);
|
|
41552
41636
|
const proseClass = proseClasses[textSize];
|
|
41553
|
-
const
|
|
41554
|
-
const
|
|
41555
|
-
let
|
|
41556
|
-
if ($[
|
|
41557
|
-
|
|
41558
|
-
$[
|
|
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
|
-
|
|
41647
|
+
t24 = $[41];
|
|
41564
41648
|
}
|
|
41565
|
-
let
|
|
41566
|
-
if ($[
|
|
41567
|
-
|
|
41649
|
+
let t25;
|
|
41650
|
+
if ($[42] !== state || $[43] !== view) {
|
|
41651
|
+
t25 = {
|
|
41568
41652
|
state,
|
|
41569
41653
|
view
|
|
41570
41654
|
};
|
|
41571
|
-
$[
|
|
41572
|
-
$[
|
|
41573
|
-
$[
|
|
41655
|
+
$[42] = state;
|
|
41656
|
+
$[43] = view;
|
|
41657
|
+
$[44] = t25;
|
|
41574
41658
|
} else {
|
|
41575
|
-
|
|
41659
|
+
t25 = $[44];
|
|
41576
41660
|
}
|
|
41577
|
-
const
|
|
41578
|
-
let
|
|
41579
|
-
if ($[
|
|
41580
|
-
|
|
41581
|
-
display:
|
|
41661
|
+
const t26 = isMarkdownMode ? "none" : "block";
|
|
41662
|
+
let t27;
|
|
41663
|
+
if ($[45] !== t26) {
|
|
41664
|
+
t27 = {
|
|
41665
|
+
display: t26
|
|
41582
41666
|
};
|
|
41583
|
-
$[
|
|
41584
|
-
$[
|
|
41667
|
+
$[45] = t26;
|
|
41668
|
+
$[46] = t27;
|
|
41585
41669
|
} else {
|
|
41586
|
-
|
|
41670
|
+
t27 = $[46];
|
|
41587
41671
|
}
|
|
41588
|
-
let
|
|
41589
|
-
if ($[
|
|
41590
|
-
|
|
41591
|
-
$[
|
|
41592
|
-
$[
|
|
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
|
-
|
|
41678
|
+
t28 = $[48];
|
|
41595
41679
|
}
|
|
41596
|
-
let
|
|
41597
|
-
if ($[
|
|
41598
|
-
|
|
41599
|
-
$[
|
|
41600
|
-
$[
|
|
41601
|
-
$[
|
|
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
|
-
|
|
41687
|
+
t29 = $[51];
|
|
41604
41688
|
}
|
|
41605
|
-
let
|
|
41606
|
-
if ($[
|
|
41607
|
-
|
|
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
|
-
$[
|
|
41625
|
-
$[
|
|
41626
|
-
$[
|
|
41627
|
-
$[
|
|
41628
|
-
$[
|
|
41708
|
+
$[52] = editorRef;
|
|
41709
|
+
$[53] = openLink;
|
|
41710
|
+
$[54] = openNode;
|
|
41711
|
+
$[55] = view;
|
|
41712
|
+
$[56] = t30;
|
|
41629
41713
|
} else {
|
|
41630
|
-
|
|
41714
|
+
t30 = $[56];
|
|
41631
41715
|
}
|
|
41632
|
-
let
|
|
41633
|
-
if ($[
|
|
41634
|
-
|
|
41635
|
-
$[
|
|
41636
|
-
$[
|
|
41637
|
-
$[
|
|
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
|
-
|
|
41723
|
+
t31 = $[59];
|
|
41640
41724
|
}
|
|
41641
|
-
let
|
|
41642
|
-
if ($[
|
|
41643
|
-
|
|
41644
|
-
|
|
41645
|
-
|
|
41646
|
-
|
|
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
|
-
$[
|
|
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
|
-
|
|
41738
|
+
t32 = $[64];
|
|
41655
41739
|
}
|
|
41656
|
-
let
|
|
41657
|
-
if ($[
|
|
41658
|
-
|
|
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
|
-
$[
|
|
41665
|
-
$[
|
|
41666
|
-
$[
|
|
41667
|
-
$[
|
|
41668
|
-
$[
|
|
41669
|
-
$[
|
|
41748
|
+
$[65] = handleMarkdownBlur;
|
|
41749
|
+
$[66] = handleMarkdownChange;
|
|
41750
|
+
$[67] = internalMarkdown;
|
|
41751
|
+
$[68] = isMarkdownMode;
|
|
41752
|
+
$[69] = proseClass;
|
|
41753
|
+
$[70] = t33;
|
|
41670
41754
|
} else {
|
|
41671
|
-
|
|
41755
|
+
t33 = $[70];
|
|
41672
41756
|
}
|
|
41673
|
-
let
|
|
41674
|
-
if ($[
|
|
41675
|
-
|
|
41676
|
-
|
|
41677
|
-
|
|
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
|
-
$[
|
|
41680
|
-
$[70] = t30;
|
|
41681
|
-
$[71] = t31;
|
|
41763
|
+
$[71] = t25;
|
|
41682
41764
|
$[72] = t32;
|
|
41765
|
+
$[73] = t33;
|
|
41766
|
+
$[74] = t34;
|
|
41683
41767
|
} else {
|
|
41684
|
-
|
|
41768
|
+
t34 = $[74];
|
|
41685
41769
|
}
|
|
41686
|
-
let
|
|
41687
|
-
if ($[
|
|
41688
|
-
|
|
41689
|
-
|
|
41690
|
-
|
|
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
|
-
$[
|
|
41693
|
-
$[
|
|
41694
|
-
$[
|
|
41776
|
+
$[75] = t24;
|
|
41777
|
+
$[76] = t34;
|
|
41778
|
+
$[77] = t35;
|
|
41695
41779
|
} else {
|
|
41696
|
-
|
|
41780
|
+
t35 = $[77];
|
|
41697
41781
|
}
|
|
41698
|
-
return
|
|
41782
|
+
return t35;
|
|
41699
41783
|
};
|
|
41700
41784
|
const cssStyles = `
|
|
41701
41785
|
.ProseMirror {
|