@rebasepro/admin 0.6.0 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -3
- package/dist/{CollectionEditorDialog-jA-PLh6N.js → CollectionEditorDialog-iGgS4rLX.js} +233 -152
- package/dist/CollectionEditorDialog-iGgS4rLX.js.map +1 -0
- package/dist/{PropertyEditView-DEUddmg_.js → PropertyEditView-C9yhLyja.js} +129 -15
- package/dist/PropertyEditView-C9yhLyja.js.map +1 -0
- package/dist/{CollectionsStudioView-UKouBPOm.js → RouterCollectionsStudioView-Dqx27GD8.js} +61 -39
- package/dist/RouterCollectionsStudioView-Dqx27GD8.js.map +1 -0
- package/dist/collection_editor/extensibility_types.d.ts +135 -0
- package/dist/collection_editor/index.d.ts +6 -0
- package/dist/collection_editor/serializable_types.d.ts +374 -0
- package/dist/collection_editor/serializable_utils.d.ts +50 -0
- package/dist/collection_editor/ui/collection_editor/CollectionEditorDialog.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/CollectionPropertiesEditorForm.d.ts +12 -1
- package/dist/collection_editor/ui/collection_editor/CollectionStudioView.d.ts +13 -1
- package/dist/collection_editor/ui/collection_editor/CollectionsStudioView.d.ts +24 -2
- package/dist/collection_editor/ui/collection_editor/DisplaySettingsForm.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/GeneralSettingsForm.d.ts +4 -1
- package/dist/collection_editor/ui/collection_editor/PropertyEditView.d.ts +12 -1
- package/dist/collection_editor/ui/collection_editor/RouterCollectionStudioView.d.ts +15 -0
- package/dist/collection_editor/ui/collection_editor/RouterCollectionsStudioView.d.ts +14 -0
- package/dist/collection_editor/useJsonCollectionsConfigController.d.ts +37 -0
- package/dist/collection_editor/useSafeSnackbarController.d.ts +2 -0
- package/dist/collection_editor_ui.d.ts +4 -0
- package/dist/collection_editor_ui.js +33 -4
- package/dist/collection_editor_ui.js.map +1 -0
- package/dist/components/EntityCollectionView/EntityBoardCard.d.ts +3 -3
- package/dist/components/EntityCollectionView/hooks/useKanbanDragAndDrop.d.ts +3 -3
- package/dist/components/EntityEditView.d.ts +3 -2
- package/dist/components/RebaseCMS.d.ts +1 -1
- package/dist/editor/editor.d.ts +10 -4
- package/dist/editor.js +6 -4
- package/dist/editor.js.map +1 -1
- package/dist/form/EntityForm.d.ts +10 -9
- package/dist/form/EntityFormBinding.d.ts +27 -0
- package/dist/form/field_bindings/MarkdownEditorFieldBinding.d.ts +2 -2
- package/dist/form/form_utils.d.ts +8 -0
- package/dist/form/index.d.ts +5 -1
- package/dist/{history-BL49TIDb.js → history-ChHgyyvM.js} +2 -2
- package/dist/{history-BL49TIDb.js.map → history-ChHgyyvM.js.map} +1 -1
- package/dist/hooks/navigation/contexts/CollectionRegistryContext.d.ts +1 -1
- package/dist/hooks/navigation/useAsyncResolver.d.ts +26 -0
- package/dist/hooks/navigation/useBuildCollectionRegistryController.d.ts +2 -0
- package/dist/hooks/navigation/useTopLevelNavigation.d.ts +1 -1
- package/dist/hooks/navigation/utils.d.ts +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +2 -2
- package/dist/routes/CustomViewRoute.d.ts +2 -1
- package/dist/{src-BJ8fkM8y.js → src-DOX2nOyh.js} +1634 -1330
- package/dist/src-DOX2nOyh.js.map +1 -0
- package/dist/types/components/EntityFormActionsProps.d.ts +1 -1
- package/dist/types/components/EntityFormProps.d.ts +59 -0
- package/dist/types/fields.d.ts +6 -1
- package/dist/util/dataControllerAdapter.d.ts +30 -0
- package/dist/util/navigation_utils.d.ts +1 -1
- package/dist/util/propertyConfigMapper.d.ts +17 -0
- package/package.json +18 -18
- package/src/collection_editor/extensibility_types.ts +168 -0
- package/src/collection_editor/index.ts +46 -0
- package/src/collection_editor/serializable_types.ts +487 -0
- package/src/collection_editor/serializable_utils.ts +588 -0
- package/src/collection_editor/ui/AddKanbanColumnAction.tsx +2 -0
- package/src/collection_editor/ui/collection_editor/AICollectionGeneratorPopover.tsx +4 -4
- package/src/collection_editor/ui/collection_editor/CollectionEditorDialog.tsx +134 -70
- package/src/collection_editor/ui/collection_editor/CollectionPropertiesEditorForm.tsx +95 -78
- package/src/collection_editor/ui/collection_editor/CollectionStudioView.tsx +23 -20
- package/src/collection_editor/ui/collection_editor/CollectionsStudioView.tsx +79 -27
- package/src/collection_editor/ui/collection_editor/DisplaySettingsForm.tsx +9 -7
- package/src/collection_editor/ui/collection_editor/GeneralSettingsForm.tsx +22 -5
- package/src/collection_editor/ui/collection_editor/GetCodeDialog.tsx +3 -3
- package/src/collection_editor/ui/collection_editor/PropertyEditView.tsx +155 -10
- package/src/collection_editor/ui/collection_editor/PropertyFieldPreview.tsx +6 -6
- package/src/collection_editor/ui/collection_editor/PropertyTree.tsx +1 -0
- package/src/collection_editor/ui/collection_editor/RouterCollectionStudioView.tsx +44 -0
- package/src/collection_editor/ui/collection_editor/RouterCollectionsStudioView.tsx +41 -0
- package/src/collection_editor/ui/collection_editor/properties/EnumPropertyField.tsx +4 -3
- package/src/collection_editor/useJsonCollectionsConfigController.tsx +286 -0
- package/src/collection_editor/useSafeSnackbarController.ts +9 -0
- package/src/collection_editor_ui.ts +6 -0
- package/src/components/ArrayContainer.tsx +5 -5
- package/src/components/DefaultDrawer.tsx +13 -3
- package/src/components/DrawerNavigationGroup.tsx +2 -2
- package/src/components/DrawerNavigationItem.tsx +4 -4
- package/src/components/EntityCollectionView/EntityBoardCard.tsx +6 -6
- package/src/components/EntityCollectionView/EntityCollectionBoardView.tsx +14 -11
- package/src/components/EntityCollectionView/EntityCollectionCardView.tsx +40 -190
- package/src/components/EntityCollectionView/EntityCollectionListView.tsx +54 -183
- package/src/components/EntityCollectionView/hooks/useKanbanDragAndDrop.ts +6 -6
- package/src/components/EntityEditView.tsx +5 -4
- package/src/components/EntityEditViewFormActions.tsx +32 -26
- package/src/components/HomePage/ContentHomePage.tsx +13 -4
- package/src/components/HomePage/NavigationCard.tsx +8 -14
- package/src/components/HomePage/NavigationGroup.tsx +1 -1
- package/src/components/HomePage/SmallNavigationCard.tsx +1 -5
- package/src/components/RebaseCMS.tsx +3 -2
- package/src/components/RebaseNavigation.tsx +71 -7
- package/src/components/SelectableTable/SelectableTable.tsx +2 -2
- package/src/components/SelectableTable/filters/StringNumberFilterField.tsx +28 -21
- package/src/components/SideDialogs.tsx +0 -7
- package/src/components/common/default_entity_actions.tsx +18 -10
- package/src/contexts/BreacrumbsContext.tsx +15 -6
- package/src/editor/editor.tsx +14 -8
- package/src/editor/selectors/ai-selector.tsx +0 -1
- package/src/form/EntityForm.tsx +191 -428
- package/src/form/EntityFormActions.tsx +33 -47
- package/src/form/EntityFormBinding.tsx +323 -0
- package/src/form/components/FormLayout.tsx +1 -1
- package/src/form/field_bindings/MarkdownEditorFieldBinding.tsx +4 -4
- package/src/form/field_bindings/ReadOnlyFieldBinding.tsx +7 -2
- package/src/form/field_bindings/StorageUploadFieldBinding.tsx +1 -1
- package/src/form/form_utils.ts +163 -0
- package/src/form/index.tsx +14 -5
- package/src/hooks/navigation/contexts/CollectionRegistryContext.tsx +2 -2
- package/src/hooks/navigation/contexts/NavigationStateContext.tsx +2 -2
- package/src/hooks/navigation/contexts/UrlContext.tsx +1 -2
- package/src/hooks/navigation/useAsyncResolver.ts +100 -0
- package/src/hooks/navigation/useBuildCollectionRegistryController.tsx +15 -8
- package/src/hooks/navigation/useBuildNavigationStateController.tsx +12 -8
- package/src/hooks/navigation/useNavigationResolution.ts +33 -0
- package/src/hooks/navigation/useResolvedCollections.ts +29 -71
- package/src/hooks/navigation/useResolvedViews.tsx +40 -70
- package/src/hooks/navigation/useTopLevelNavigation.ts +20 -16
- package/src/hooks/navigation/utils.ts +7 -4
- package/src/index.ts +7 -2
- package/src/routes/CustomViewRoute.tsx +14 -6
- package/src/types/components/EntityFormActionsProps.tsx +1 -1
- package/src/types/components/EntityFormProps.tsx +68 -0
- package/src/types/fields.tsx +7 -1
- package/src/util/dataControllerAdapter.ts +93 -0
- package/src/util/navigation_utils.ts +1 -1
- package/src/util/propertyConfigMapper.ts +134 -0
- package/LICENSE +0 -21
- package/dist/CollectionEditorDialog-jA-PLh6N.js.map +0 -1
- package/dist/CollectionsStudioView-UKouBPOm.js.map +0 -1
- package/dist/PropertyEditView-DEUddmg_.js.map +0 -1
- package/dist/components/EntityCollectionView/Board.d.ts +0 -3
- package/dist/components/EntityCollectionView/BoardColumn.d.ts +0 -42
- package/dist/components/EntityCollectionView/BoardColumnTitle.d.ts +0 -9
- package/dist/components/EntityCollectionView/BoardSortableList.d.ts +0 -14
- package/dist/components/EntityCollectionView/board_types.d.ts +0 -105
- package/dist/hooks/navigation/useNavigationRegistry.d.ts +0 -12
- package/dist/hooks/navigation/useNavigationURLs.d.ts +0 -11
- package/dist/src-BJ8fkM8y.js.map +0 -1
- package/src/components/EntityCollectionView/Board.tsx +0 -475
- package/src/components/EntityCollectionView/BoardColumn.tsx +0 -165
- package/src/components/EntityCollectionView/BoardColumnTitle.tsx +0 -46
- package/src/components/EntityCollectionView/BoardSortableList.tsx +0 -177
- package/src/components/EntityCollectionView/board_types.ts +0 -113
- package/src/hooks/navigation/useNavigationRegistry.ts +0 -164
- package/src/hooks/navigation/useNavigationURLs.ts +0 -56
|
@@ -1,4 +1,33 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { n as PropertyForm, r as PropertyFormDialog } from "./PropertyEditView-
|
|
3
|
-
import {
|
|
4
|
-
|
|
1
|
+
import { Vn as useUrlController } from "./src-DOX2nOyh.js";
|
|
2
|
+
import { n as PropertyForm, r as PropertyFormDialog } from "./PropertyEditView-C9yhLyja.js";
|
|
3
|
+
import { n as CollectionEditorDialog } from "./CollectionEditorDialog-iGgS4rLX.js";
|
|
4
|
+
import { i as CollectionStudioView, r as CollectionsStudioView, t as RouterCollectionsStudioView } from "./RouterCollectionsStudioView-Dqx27GD8.js";
|
|
5
|
+
import "react";
|
|
6
|
+
import { useSnackbarController } from "@rebasepro/core";
|
|
7
|
+
import { jsx } from "react/jsx-runtime";
|
|
8
|
+
import { useNavigate } from "react-router-dom";
|
|
9
|
+
//#region src/collection_editor/ui/collection_editor/RouterCollectionStudioView.tsx
|
|
10
|
+
function RouterCollectionStudioView(props) {
|
|
11
|
+
const navigate = useNavigate();
|
|
12
|
+
const urlController = useUrlController();
|
|
13
|
+
const snackbarController = useSnackbarController();
|
|
14
|
+
return /* @__PURE__ */ jsx(CollectionStudioView, {
|
|
15
|
+
...props,
|
|
16
|
+
onCancel: () => {
|
|
17
|
+
navigate(urlController.buildAppUrlPath("/"));
|
|
18
|
+
},
|
|
19
|
+
onSave: (savedCollection) => {
|
|
20
|
+
if (savedCollection) {
|
|
21
|
+
snackbarController.open({
|
|
22
|
+
type: "success",
|
|
23
|
+
message: `Collection ${savedCollection.name || savedCollection.slug} saved`
|
|
24
|
+
});
|
|
25
|
+
if (props.collectionId === "new") navigate(urlController.buildAppUrlPath(`s/schema/${savedCollection.slug}`));
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
//#endregion
|
|
31
|
+
export { CollectionEditorDialog, CollectionStudioView, CollectionsStudioView, PropertyForm, PropertyFormDialog, RouterCollectionStudioView, RouterCollectionsStudioView };
|
|
32
|
+
|
|
33
|
+
//# sourceMappingURL=collection_editor_ui.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"collection_editor_ui.js","names":[],"sources":["../src/collection_editor/ui/collection_editor/RouterCollectionStudioView.tsx"],"sourcesContent":["/**\n * Router-aware wrapper around CollectionStudioView.\n *\n * This component provides the react-router-based navigation behavior\n * that Rebase Studio expects: cancel navigates to the root path,\n * save navigates to the saved collection's slug, and a snackbar\n * toast is shown on success.\n *\n * External consumers should use `CollectionStudioView` directly\n * (which has no react-router dependency).\n */\nimport React from \"react\";\nimport { useNavigate } from \"react-router-dom\";\nimport { useUrlController } from \"../../_cms_internals\";\nimport { useSnackbarController } from \"@rebasepro/core\";\nimport { CollectionStudioView, CollectionStudioViewProps } from \"./CollectionStudioView\";\n\nexport type RouterCollectionStudioViewProps = Omit<CollectionStudioViewProps, \"onSave\" | \"onCancel\">;\n\nexport function RouterCollectionStudioView(props: RouterCollectionStudioViewProps) {\n const navigate = useNavigate();\n const urlController = useUrlController();\n const snackbarController = useSnackbarController();\n\n return (\n <CollectionStudioView\n {...props}\n onCancel={() => {\n navigate(urlController.buildAppUrlPath(\"/\"));\n }}\n onSave={(savedCollection) => {\n if (savedCollection) {\n snackbarController.open({\n type: \"success\",\n message: `Collection ${savedCollection.name || savedCollection.slug} saved`\n });\n if (props.collectionId === \"new\") {\n navigate(urlController.buildAppUrlPath(`s/schema/${savedCollection.slug}`));\n }\n }\n }}\n />\n );\n}\n"],"mappings":";;;;;;;;;AAmBA,SAAgB,2BAA2B,OAAwC;CAC/E,MAAM,WAAW,YAAY;CAC7B,MAAM,gBAAgB,iBAAiB;CACvC,MAAM,qBAAqB,sBAAsB;CAEjD,OACI,oBAAC,sBAAD;EACI,GAAI;EACJ,gBAAgB;GACZ,SAAS,cAAc,gBAAgB,GAAG,CAAC;EAC/C;EACA,SAAS,oBAAoB;GACzB,IAAI,iBAAiB;IACjB,mBAAmB,KAAK;KACpB,MAAM;KACN,SAAS,cAAc,gBAAgB,QAAQ,gBAAgB,KAAK;IACxE,CAAC;IACD,IAAI,MAAM,iBAAiB,OACvB,SAAS,cAAc,gBAAgB,YAAY,gBAAgB,MAAM,CAAC;GAElF;EACJ;CACH,CAAA;AAET"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { EntityCollection } from "@rebasepro/types";
|
|
2
2
|
import React from "react";
|
|
3
3
|
import { Entity } from "@rebasepro/types";
|
|
4
|
-
import { BoardItemViewProps } from "
|
|
5
|
-
export type EntityBoardCardProps<M extends Record<string, unknown> = Record<string, unknown>> = BoardItemViewProps<M
|
|
4
|
+
import { BoardItemViewProps } from "@rebasepro/ui";
|
|
5
|
+
export type EntityBoardCardProps<M extends Record<string, unknown> = Record<string, unknown>> = BoardItemViewProps<Entity<M>> & {
|
|
6
6
|
collection: EntityCollection<M>;
|
|
7
7
|
onClick?: (entity: Entity<M>) => void;
|
|
8
8
|
selected?: boolean;
|
|
@@ -27,5 +27,5 @@ export declare function createEntityBoardCardComponent<M extends Record<string,
|
|
|
27
27
|
isEntitySelected?: (entity: Entity<M>) => boolean;
|
|
28
28
|
onSelectionChange?: (entity: Entity<M>, selected: boolean) => void;
|
|
29
29
|
selectionEnabled?: boolean;
|
|
30
|
-
}): React.ComponentType<BoardItemViewProps<M
|
|
30
|
+
}): React.ComponentType<BoardItemViewProps<Entity<M>>>;
|
|
31
31
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { EntityCollection, RebaseData, RebaseContext, AnalyticsController } from "@rebasepro/types";
|
|
2
|
-
import { BoardItem } from "
|
|
1
|
+
import { EntityCollection, RebaseData, RebaseContext, AnalyticsController, Entity } from "@rebasepro/types";
|
|
2
|
+
import { BoardItem } from "@rebasepro/ui";
|
|
3
3
|
import { BoardDataController } from "../useBoardDataController";
|
|
4
4
|
export interface UseKanbanDragAndDropParams<M extends Record<string, unknown>> {
|
|
5
5
|
collection: EntityCollection<M>;
|
|
@@ -12,7 +12,7 @@ export interface UseKanbanDragAndDropParams<M extends Record<string, unknown>> {
|
|
|
12
12
|
analyticsController: AnalyticsController;
|
|
13
13
|
}
|
|
14
14
|
export declare function useKanbanDragAndDrop<M extends Record<string, unknown>>({ collection, fullPath, columnProperty, orderProperty, dataClient, context, boardDataController, analyticsController }: UseKanbanDragAndDropParams<M>): {
|
|
15
|
-
handleItemsReorder: (items: BoardItem<M
|
|
15
|
+
handleItemsReorder: (items: BoardItem<Entity<M>>[], moveInfo?: {
|
|
16
16
|
itemId: string;
|
|
17
17
|
sourceColumn: string;
|
|
18
18
|
targetColumn: string;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type { EntityCollection } from "@rebasepro/types";
|
|
2
2
|
import React from "react";
|
|
3
3
|
import { Entity, EntityStatus } from "@rebasepro/types";
|
|
4
|
-
import type {
|
|
4
|
+
import type { EntityFormBindingProps } from "../form";
|
|
5
|
+
import type { OnUpdateParams } from "../types/components/EntityFormProps";
|
|
5
6
|
import { MAIN_TAB_VALUE, JSON_TAB_VALUE, HISTORY_TAB_VALUE } from "../util/entity_view_constants";
|
|
6
7
|
export { MAIN_TAB_VALUE, JSON_TAB_VALUE, HISTORY_TAB_VALUE };
|
|
7
8
|
export type BarActionsParams = {
|
|
@@ -34,7 +35,7 @@ export interface EntityEditViewProps<M extends Record<string, unknown> = Record<
|
|
|
34
35
|
navigateBack?: () => void;
|
|
35
36
|
layout?: "side_panel" | "full_screen" | "split" | "dialog";
|
|
36
37
|
barActions?: (params: BarActionsParams) => React.ReactNode;
|
|
37
|
-
formProps?: Partial<
|
|
38
|
+
formProps?: Partial<EntityFormBindingProps<M>>;
|
|
38
39
|
/**
|
|
39
40
|
* Pre-populate the form with these values when creating a new entity.
|
|
40
41
|
* Only applied when the form is in "new" mode (no entityId).
|
|
@@ -7,4 +7,4 @@ import type { RebaseCMSConfig } from "@rebasepro/types";
|
|
|
7
7
|
* is auto-wired as a native feature (slots, provider, Studio view) without
|
|
8
8
|
* needing any external plugin.
|
|
9
9
|
*/
|
|
10
|
-
export declare function RebaseCMS({ collections, homePage, entityViews, entityActions, plugins, collectionEditor, navigationGroupMappings }: RebaseCMSConfig): null;
|
|
10
|
+
export declare function RebaseCMS({ collections, views, homePage, entityViews, entityActions, plugins, collectionEditor, navigationGroupMappings }: RebaseCMSConfig): null;
|
package/dist/editor/editor.d.ts
CHANGED
|
@@ -9,15 +9,17 @@ export interface MarkdownEditorConfig {
|
|
|
9
9
|
html?: boolean;
|
|
10
10
|
transformPastedText?: boolean;
|
|
11
11
|
}
|
|
12
|
-
export type
|
|
13
|
-
|
|
12
|
+
export type RichTextEditorTextSize = "sm" | "base" | "lg";
|
|
13
|
+
/** @deprecated Use `RichTextEditorTextSize` instead. */
|
|
14
|
+
export type RebaseEditorTextSize = RichTextEditorTextSize;
|
|
15
|
+
export type RichTextEditorProps = {
|
|
14
16
|
content?: JSONContent | string;
|
|
15
17
|
onMarkdownContentChange?: (content: string) => void;
|
|
16
18
|
onJsonContentChange?: (content: JSONContent | null) => void;
|
|
17
19
|
onHtmlContentChange?: (content: string) => void;
|
|
18
20
|
handleImageUpload: (file: File) => Promise<string>;
|
|
19
21
|
version?: number;
|
|
20
|
-
textSize?:
|
|
22
|
+
textSize?: RichTextEditorTextSize;
|
|
21
23
|
highlight?: {
|
|
22
24
|
from: number;
|
|
23
25
|
to: number;
|
|
@@ -27,4 +29,8 @@ export type RebaseEditorProps = {
|
|
|
27
29
|
disabled?: boolean;
|
|
28
30
|
markdownConfig?: MarkdownEditorConfig;
|
|
29
31
|
};
|
|
30
|
-
|
|
32
|
+
/** @deprecated Use `RichTextEditorProps` instead. */
|
|
33
|
+
export type RebaseEditorProps = RichTextEditorProps;
|
|
34
|
+
export declare const RichTextEditor: ({ content, onJsonContentChange, onHtmlContentChange, onMarkdownContentChange, version, textSize, highlight, handleImageUpload, aiController, disabled, markdownConfig }: RichTextEditorProps) => React.JSX.Element;
|
|
35
|
+
/** @deprecated Use `RichTextEditor` instead. */
|
|
36
|
+
export declare const RebaseEditor: ({ content, onJsonContentChange, onHtmlContentChange, onMarkdownContentChange, version, textSize, highlight, handleImageUpload, aiController, disabled, markdownConfig }: RichTextEditorProps) => React.JSX.Element;
|
package/dist/editor.js
CHANGED
|
@@ -2491,7 +2491,7 @@ var proseClasses = {
|
|
|
2491
2491
|
"base": "prose-base",
|
|
2492
2492
|
"lg": "prose-lg"
|
|
2493
2493
|
};
|
|
2494
|
-
var
|
|
2494
|
+
var RichTextEditor = ({ content, onJsonContentChange, onHtmlContentChange, onMarkdownContentChange, version, textSize = "base", highlight, handleImageUpload, aiController, disabled, markdownConfig }) => {
|
|
2495
2495
|
const { t } = useTranslation();
|
|
2496
2496
|
const [openNode, setOpenNode] = useState(false);
|
|
2497
2497
|
const [openLink, setOpenLink] = useState(false);
|
|
@@ -2548,7 +2548,7 @@ var RebaseEditor = ({ content, onJsonContentChange, onHtmlContentChange, onMarkd
|
|
|
2548
2548
|
if (onMarkdownContentChange) try {
|
|
2549
2549
|
onMarkdownContentChange(serializer.serialize(currentState.doc));
|
|
2550
2550
|
} catch (e) {
|
|
2551
|
-
console.warn("[
|
|
2551
|
+
console.warn("[RichTextEditor] Could not serialize editor state to markdown:", e);
|
|
2552
2552
|
}
|
|
2553
2553
|
if (onJsonContentChange) onJsonContentChange(removeClassesFromJson(currentState.doc.toJSON()));
|
|
2554
2554
|
};
|
|
@@ -2569,7 +2569,7 @@ var RebaseEditor = ({ content, onJsonContentChange, onHtmlContentChange, onMarkd
|
|
|
2569
2569
|
view.dispatch(tr);
|
|
2570
2570
|
}
|
|
2571
2571
|
} catch (e) {
|
|
2572
|
-
console.warn("[
|
|
2572
|
+
console.warn("[RichTextEditor] Could not reset editor content:", e);
|
|
2573
2573
|
}
|
|
2574
2574
|
if (isMarkdownMode) setInternalMarkdown(typeof content === "string" ? content : "");
|
|
2575
2575
|
mountTimeRef.current = Date.now();
|
|
@@ -2681,6 +2681,8 @@ var RebaseEditor = ({ content, onJsonContentChange, onHtmlContentChange, onMarkd
|
|
|
2681
2681
|
})]
|
|
2682
2682
|
});
|
|
2683
2683
|
};
|
|
2684
|
+
/** @deprecated Use `RichTextEditor` instead. */
|
|
2685
|
+
var RebaseEditor = RichTextEditor;
|
|
2684
2686
|
var cssStyles = `
|
|
2685
2687
|
.ProseMirror {
|
|
2686
2688
|
box-shadow: none !important;
|
|
@@ -2885,6 +2887,6 @@ ul[data-type="taskList"] li[data-checked="true"] > div > p {
|
|
|
2885
2887
|
}
|
|
2886
2888
|
`;
|
|
2887
2889
|
//#endregion
|
|
2888
|
-
export { RebaseEditor };
|
|
2890
|
+
export { RebaseEditor, RichTextEditor };
|
|
2889
2891
|
|
|
2890
2892
|
//# sourceMappingURL=editor.js.map
|