@rebasepro/admin 0.2.3 → 0.3.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/dist/{CollectionEditorDialog-CmGXXSY9.js → CollectionEditorDialog-D0VqpLPO.js} +70 -77
- package/dist/CollectionEditorDialog-D0VqpLPO.js.map +1 -0
- package/dist/{CollectionsStudioView-DcLHT5bU.js → CollectionsStudioView-Bc3Rxxc2.js} +5 -4
- package/dist/{CollectionsStudioView-DcLHT5bU.js.map → CollectionsStudioView-Bc3Rxxc2.js.map} +1 -1
- package/dist/{ExportCollectionAction-BfN34eWX.js → ExportCollectionAction-Ckc-09BQ.js} +4 -3
- package/dist/ExportCollectionAction-Ckc-09BQ.js.map +1 -0
- package/dist/{ImportCollectionAction-SZrInjhx.js → ImportCollectionAction-BqjIrC3Z.js} +3 -2
- package/dist/{ImportCollectionAction-SZrInjhx.js.map → ImportCollectionAction-BqjIrC3Z.js.map} +1 -1
- package/dist/{PropertyEditView-Cvryrb3B.js → PropertyEditView-CvRSV-A2.js} +128 -121
- package/dist/PropertyEditView-CvRSV-A2.js.map +1 -0
- package/dist/collection_editor/ConfigControllerProvider.d.ts +0 -5
- package/dist/collection_editor/index.d.ts +0 -1
- package/dist/collection_editor/types/collection_editor_controller.d.ts +0 -2
- package/dist/collection_editor/ui/collection_editor/CollectionPropertiesEditorForm.d.ts +3 -3
- package/dist/collection_editor_ui.js +3 -3
- package/dist/components/ArrayContainer.d.ts +2 -2
- package/dist/components/DefaultAppBar.d.ts +18 -1
- package/dist/components/DefaultDrawer.d.ts +51 -3
- package/dist/components/EntityCollectionTable/fields/TableStorageUpload.d.ts +2 -2
- package/dist/components/EntityCollectionTable/internal/EntityTableCell.d.ts +2 -2
- package/dist/components/EntityCollectionTable/table_bindings.d.ts +4 -3
- package/dist/components/EntityCollectionView/hooks/useKanbanDragAndDrop.d.ts +4 -3
- package/dist/components/EntityEditView.d.ts +2 -1
- package/dist/components/HomePage/HomePageDnD.d.ts +3 -3
- package/dist/components/PropertyCollectionView.d.ts +1 -1
- package/dist/components/PropertyIdCopyTooltip.d.ts +1 -1
- package/dist/components/SelectableTable/SelectionStore.d.ts +4 -1
- package/dist/components/SelectableTable/filters/BooleanFilterField.d.ts +2 -2
- package/dist/components/SelectableTable/filters/DateTimeFilterField.d.ts +2 -2
- package/dist/components/SelectableTable/filters/ReferenceFilterField.d.ts +2 -2
- package/dist/components/SelectableTable/filters/StringNumberFilterField.d.ts +2 -2
- package/dist/components/admin/RolesView.d.ts +3 -3
- package/dist/components/admin/UsersView.d.ts +3 -3
- package/dist/components/app/Drawer.d.ts +8 -1
- package/dist/data_export/export/export.d.ts +3 -3
- package/dist/editor/components/editor-bubble.d.ts +5 -1
- package/dist/editor/components/image-bubble.d.ts +5 -1
- package/dist/editor/components/index.d.ts +3 -3
- package/dist/editor/components/table-bubble.d.ts +5 -1
- package/dist/editor/nodeViews/ReactNodeView.d.ts +4 -1
- package/dist/editor/useProseMirror.d.ts +2 -2
- package/dist/editor/utils/remove_classes.d.ts +1 -1
- package/dist/editor.js +15 -14
- package/dist/editor.js.map +1 -1
- package/dist/form/EntityForm.d.ts +2 -2
- package/dist/form/components/StorageUploadProgress.d.ts +2 -2
- package/dist/form/field_bindings/MultiSelectFieldBinding.d.ts +1 -1
- package/dist/form/field_bindings/StorageUploadFieldBinding.d.ts +1 -1
- package/dist/form/validation.d.ts +3 -3
- package/dist/hooks/navigation/useResolvedCollections.d.ts +6 -0
- package/dist/hooks/navigation/useResolvedViews.d.ts +3 -4
- package/dist/{index-PLIQXpTt.js → index-BCcLwgfe.js} +3 -2
- package/dist/{index-PLIQXpTt.js.map → index-BCcLwgfe.js.map} +1 -1
- package/dist/{index-DjduZG1T.js → index-DY2k5TtG.js} +3 -3
- package/dist/index-DY2k5TtG.js.map +1 -0
- package/dist/{index-MKPc70-v.js → index-UQOMHwt1.js} +3 -3
- package/dist/index-UQOMHwt1.js.map +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2813 -372
- package/dist/index.js.map +1 -1
- package/dist/{markdown-z2Ir7Cgo.js → markdown-DD2JDU1X.js} +2 -2
- package/dist/markdown-DD2JDU1X.js.map +1 -0
- package/dist/preview/components/UrlComponentPreview.d.ts +1 -0
- package/dist/types/components/EntityFormActionsProps.d.ts +1 -1
- package/dist/types/components/EntityFormProps.d.ts +2 -2
- package/dist/types/fields.d.ts +1 -1
- package/dist/{util-DbWax_sV.js → util-ZM9gQuCv.js} +2031 -2078
- package/dist/util-ZM9gQuCv.js.map +1 -0
- package/package.json +8 -8
- package/src/collection_editor/ConfigControllerProvider.tsx +3 -13
- package/src/collection_editor/index.ts +1 -3
- package/src/collection_editor/types/collection_editor_controller.tsx +0 -3
- package/src/collection_editor/ui/EditorCollectionAction.tsx +1 -6
- package/src/collection_editor/ui/EditorCollectionActionStart.tsx +1 -6
- package/src/collection_editor/ui/EditorEntityAction.tsx +1 -6
- package/src/collection_editor/ui/HomePageEditorCollectionAction.tsx +7 -14
- package/src/collection_editor/ui/NewCollectionCard.tsx +1 -5
- package/src/collection_editor/ui/PropertyAddColumnComponent.tsx +3 -8
- package/src/collection_editor/ui/collection_editor/CollectionJsonImportDialog.tsx +8 -12
- package/src/collection_editor/ui/collection_editor/CollectionPropertiesEditorForm.tsx +21 -21
- package/src/collection_editor/ui/collection_editor/CollectionRLSTab.tsx +4 -4
- package/src/collection_editor/ui/collection_editor/EnumForm.tsx +1 -1
- package/src/collection_editor/ui/collection_editor/properties/BlockPropertyField.tsx +3 -3
- package/src/collection_editor/ui/collection_editor/properties/CommonPropertyFields.tsx +3 -3
- package/src/collection_editor/ui/collection_editor/properties/DateTimePropertyField.tsx +8 -8
- package/src/collection_editor/ui/collection_editor/properties/EnumPropertyField.tsx +5 -5
- package/src/collection_editor/ui/collection_editor/properties/MapPropertyField.tsx +2 -2
- package/src/collection_editor/ui/collection_editor/properties/MarkdownPropertyField.tsx +5 -5
- package/src/collection_editor/ui/collection_editor/properties/NumberPropertyField.tsx +5 -5
- package/src/collection_editor/ui/collection_editor/properties/ReferencePropertyField.tsx +2 -2
- package/src/collection_editor/ui/collection_editor/properties/RepeatPropertyField.tsx +2 -2
- package/src/collection_editor/ui/collection_editor/properties/StoragePropertyField.tsx +8 -8
- package/src/collection_editor/ui/collection_editor/properties/StringPropertyField.tsx +5 -5
- package/src/collection_editor/ui/collection_editor/properties/UrlPropertyField.tsx +3 -2
- package/src/collection_editor/ui/collection_editor/properties/VectorPropertyField.tsx +2 -2
- package/src/collection_editor/ui/collection_editor/properties/validation/ArrayPropertyValidation.tsx +2 -2
- package/src/collection_editor/ui/collection_editor/properties/validation/GeneralPropertyValidation.tsx +1 -1
- package/src/collection_editor/ui/collection_editor/properties/validation/NumberPropertyValidation.tsx +4 -7
- package/src/collection_editor/ui/collection_editor/properties/validation/StringPropertyValidation.tsx +4 -4
- package/src/components/ArrayContainer.tsx +3 -3
- package/src/components/DefaultAppBar.tsx +52 -31
- package/src/components/DefaultDrawer.tsx +279 -66
- package/src/components/DrawerNavigationItem.tsx +1 -1
- package/src/components/EntityCollectionTable/EntityCollectionTable.tsx +6 -5
- package/src/components/EntityCollectionTable/PropertyTableCell.tsx +9 -7
- package/src/components/EntityCollectionTable/fields/TableStorageUpload.tsx +5 -5
- package/src/components/EntityCollectionTable/fields/VirtualTableNumberInput.tsx +12 -9
- package/src/components/EntityCollectionTable/internal/EntityTableCell.tsx +2 -2
- package/src/components/EntityCollectionTable/internal/popup_field/PopupFormField.tsx +1 -1
- package/src/components/EntityCollectionTable/table_bindings.tsx +5 -4
- package/src/components/EntityCollectionView/EntityCollectionView.tsx +6 -4
- package/src/components/EntityCollectionView/hooks/useCollectionInlineEditor.ts +1 -1
- package/src/components/EntityCollectionView/hooks/useKanbanDragAndDrop.ts +7 -6
- package/src/components/EntityDetailView.tsx +46 -24
- package/src/components/EntityEditView.tsx +51 -28
- package/src/components/EntityEditViewFormActions.tsx +4 -4
- package/src/components/EntityPreview.tsx +9 -4
- package/src/components/HomePage/HomePageDnD.tsx +3 -2
- package/src/components/PropertyCollectionView.tsx +1 -1
- package/src/components/PropertyIdCopyTooltip.tsx +1 -1
- package/src/components/RebaseLayout.tsx +5 -1
- package/src/components/RebaseNavigation.tsx +2 -2
- package/src/components/RebaseRouteDefs.tsx +4 -7
- package/src/components/RebaseShell.tsx +16 -13
- package/src/components/SearchIconsView.tsx +1 -8
- package/src/components/SelectableTable/SelectableTable.tsx +8 -11
- package/src/components/SelectableTable/SelectionStore.ts +1 -1
- package/src/components/SelectableTable/filters/BooleanFilterField.tsx +3 -3
- package/src/components/SelectableTable/filters/DateTimeFilterField.tsx +3 -3
- package/src/components/SelectableTable/filters/ReferenceFilterField.tsx +5 -5
- package/src/components/SelectableTable/filters/StringNumberFilterField.tsx +3 -3
- package/src/components/SideEntityProvider.tsx +2 -1
- package/src/components/admin/RolesView.tsx +7 -2
- package/src/components/admin/UsersView.tsx +12 -6
- package/src/components/app/Drawer.tsx +9 -1
- package/src/components/app/Scaffold.tsx +5 -1
- package/src/data_export/export/export.ts +17 -17
- package/src/data_import/components/DataNewPropertiesMapping.tsx +1 -1
- package/src/editor/components/editor-bubble.tsx +32 -9
- package/src/editor/components/image-bubble.tsx +27 -11
- package/src/editor/components/index.ts +3 -3
- package/src/editor/components/table-bubble.tsx +79 -17
- package/src/editor/extensions/HighlightDecorationExtension.ts +3 -2
- package/src/editor/nodeViews/ReactNodeView.tsx +1 -1
- package/src/editor/nodeViews/TaskItemComponent.tsx +9 -8
- package/src/editor/schema.ts +135 -59
- package/src/editor/selectors/link-selector.tsx +8 -5
- package/src/editor/useProseMirror.ts +2 -2
- package/src/editor/utils/remove_classes.ts +6 -5
- package/src/form/EntityForm.tsx +15 -15
- package/src/form/EntityFormActions.tsx +2 -2
- package/src/form/PropertyFieldBinding.tsx +64 -64
- package/src/form/components/FieldHelperText.tsx +4 -4
- package/src/form/components/StorageUploadProgress.tsx +2 -2
- package/src/form/field_bindings/ArrayCustomShapedFieldBinding.tsx +1 -1
- package/src/form/field_bindings/ArrayOfReferencesFieldBinding.tsx +1 -1
- package/src/form/field_bindings/BlockFieldBinding.tsx +54 -53
- package/src/form/field_bindings/KeyValueFieldBinding.tsx +290 -289
- package/src/form/field_bindings/MapFieldBinding.tsx +2 -2
- package/src/form/field_bindings/MultiSelectFieldBinding.tsx +2 -2
- package/src/form/field_bindings/MultipleRelationFieldBinding.tsx +1 -1
- package/src/form/field_bindings/ReferenceAsStringFieldBinding.tsx +1 -1
- package/src/form/field_bindings/ReferenceFieldBinding.tsx +8 -6
- package/src/form/field_bindings/RelationFieldBinding.tsx +4 -4
- package/src/form/field_bindings/RepeatFieldBinding.tsx +1 -1
- package/src/form/field_bindings/SelectFieldBinding.tsx +1 -1
- package/src/form/field_bindings/StorageUploadFieldBinding.tsx +84 -84
- package/src/form/field_bindings/SwitchFieldBinding.tsx +16 -16
- package/src/form/field_bindings/TextFieldBinding.tsx +77 -73
- package/src/form/field_bindings/UserSelectFieldBinding.tsx +17 -17
- package/src/form/validation.ts +43 -43
- package/src/hooks/navigation/useBuildNavigationStateController.tsx +3 -5
- package/src/hooks/navigation/useResolvedCollections.ts +27 -7
- package/src/hooks/navigation/useResolvedViews.tsx +24 -44
- package/src/index.ts +2 -0
- package/src/preview/PropertyPreview.tsx +2 -2
- package/src/preview/components/ImagePreview.tsx +2 -1
- package/src/preview/components/UrlComponentPreview.tsx +11 -2
- package/src/preview/components/UserPreview.tsx +1 -1
- package/src/preview/property_previews/ArrayOfMapsPreview.tsx +2 -2
- package/src/preview/property_previews/ArrayOfReferencesPreview.tsx +4 -4
- package/src/preview/property_previews/ArrayOfRelationsPreview.tsx +3 -3
- package/src/preview/property_previews/ArrayOfStorageComponentsPreview.tsx +3 -3
- package/src/preview/property_previews/ArrayOfStringsPreview.tsx +3 -2
- package/src/preview/property_previews/ArrayOneOfPreview.tsx +6 -8
- package/src/preview/property_previews/ArrayPropertyEnumPreview.tsx +1 -1
- package/src/preview/property_previews/ArrayPropertyPreview.tsx +3 -3
- package/src/preview/property_previews/MapPropertyPreview.tsx +4 -3
- package/src/preview/property_previews/NumberPropertyPreview.tsx +5 -3
- package/src/preview/property_previews/StringPropertyPreview.tsx +10 -8
- package/src/types/components/EntityFormActionsProps.tsx +1 -1
- package/src/types/components/EntityFormProps.tsx +2 -2
- package/src/types/fields.tsx +2 -2
- package/dist/CollectionEditorDialog-CmGXXSY9.js.map +0 -1
- package/dist/ContentHomePage-C7vFqKSe.js +0 -1784
- package/dist/ContentHomePage-C7vFqKSe.js.map +0 -1
- package/dist/ExportCollectionAction-BfN34eWX.js.map +0 -1
- package/dist/PropertyEditView-Cvryrb3B.js.map +0 -1
- package/dist/RoleChip-QtUFXeTp.js +0 -67
- package/dist/RoleChip-QtUFXeTp.js.map +0 -1
- package/dist/RolesView-BCb7qwWs.js +0 -437
- package/dist/RolesView-BCb7qwWs.js.map +0 -1
- package/dist/UsersView-Cex24r8H.js +0 -408
- package/dist/UsersView-Cex24r8H.js.map +0 -1
- package/dist/collection_editor/types/config_permissions.d.ts +0 -19
- package/dist/index-DjduZG1T.js.map +0 -1
- package/dist/index-MKPc70-v.js.map +0 -1
- package/dist/markdown-z2Ir7Cgo.js.map +0 -1
- package/dist/util-DbWax_sV.js.map +0 -1
- package/src/collection_editor/types/config_permissions.ts +0 -20
|
@@ -2,7 +2,6 @@ import React from "react";
|
|
|
2
2
|
import { User } from "@rebasepro/types";
|
|
3
3
|
import { CollectionsConfigController } from "./types/config_controller";
|
|
4
4
|
import { CollectionEditorController } from "./types/collection_editor_controller";
|
|
5
|
-
import { CollectionEditorPermissionsBuilder } from "./types/config_permissions";
|
|
6
5
|
import { CollectionInference } from "./types/collection_inference";
|
|
7
6
|
import { CollectionGenerationCallback } from "./api/generateCollectionApi";
|
|
8
7
|
export declare const ConfigControllerContext: React.Context<CollectionsConfigController>;
|
|
@@ -16,10 +15,6 @@ export interface ConfigControllerProviderProps {
|
|
|
16
15
|
* Callback used to infer the schema from the data.
|
|
17
16
|
*/
|
|
18
17
|
collectionInference?: CollectionInference;
|
|
19
|
-
/**
|
|
20
|
-
* Use this builder to define the permissions for the configuration per user.
|
|
21
|
-
*/
|
|
22
|
-
configPermissions?: CollectionEditorPermissionsBuilder;
|
|
23
18
|
extraView?: {
|
|
24
19
|
View: React.ComponentType<{
|
|
25
20
|
path: string;
|
|
@@ -4,7 +4,6 @@ export { useLocalCollectionsConfigController } from "./useLocalCollectionsConfig
|
|
|
4
4
|
export { validateCollectionJson, type CollectionValidationError, type CollectionValidationResult } from "./validateCollectionJson";
|
|
5
5
|
export type { CollectionsConfigController, DeleteCollectionParams, SaveCollectionParams, UpdateCollectionParams, CollectionsSetupInfo, UpdatePropertiesOrderParams, UpdateKanbanColumnsOrderParams } from "./types/config_controller";
|
|
6
6
|
export type { CollectionEditorController } from "./types/collection_editor_controller";
|
|
7
|
-
export type { CollectionEditorPermissions, CollectionEditorPermissionsBuilder } from "./types/config_permissions";
|
|
8
7
|
export type { CollectionInference } from "./types/collection_inference";
|
|
9
8
|
export { buildCollectionGenerationCallback, CollectionGenerationApiError, DEFAULT_COLLECTION_GENERATION_ENDPOINT } from "./api/generateCollectionApi";
|
|
10
9
|
export type { CollectionGenerationCallback, GenerateCollectionRequest, GenerateCollectionResult, CollectionOperation, CollectionOperationType, BuildCollectionGenerationCallbackProps } from "./api/generateCollectionApi";
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { CollectionEditorPermissionsBuilder } from "./config_permissions";
|
|
2
1
|
import { CollectionsConfigController } from "./config_controller";
|
|
3
2
|
import { Entity, EntityCollection, Property } from "@rebasepro/types";
|
|
4
3
|
/**
|
|
@@ -54,6 +53,5 @@ export interface CollectionEditorController {
|
|
|
54
53
|
* The config controller that this editor represents.
|
|
55
54
|
*/
|
|
56
55
|
configController: CollectionsConfigController;
|
|
57
|
-
configPermissions: CollectionEditorPermissionsBuilder;
|
|
58
56
|
pathSuggestions: string[] | undefined;
|
|
59
57
|
}
|
|
@@ -3,10 +3,10 @@ import { EntityCollection, PropertyConfig, User } from "@rebasepro/types";
|
|
|
3
3
|
type CollectionEditorFormProps = {
|
|
4
4
|
showErrors: boolean;
|
|
5
5
|
isNewCollection: boolean;
|
|
6
|
-
propertyErrorsRef?: React.MutableRefObject<
|
|
7
|
-
onPropertyError: (propertyKey: string, namespace: string | undefined, error?: Record<string,
|
|
6
|
+
propertyErrorsRef?: React.MutableRefObject<Record<string, unknown> | undefined>;
|
|
7
|
+
onPropertyError: (propertyKey: string, namespace: string | undefined, error?: Record<string, unknown>) => void;
|
|
8
8
|
setDirty?: (dirty: boolean) => void;
|
|
9
|
-
extraIcon: React.ReactNode
|
|
9
|
+
extraIcon: React.ReactNode;
|
|
10
10
|
getUser?: (uid: string) => User | null;
|
|
11
11
|
getData?: () => Promise<object[]>;
|
|
12
12
|
doCollectionInference?: (collection: EntityCollection) => Promise<Partial<EntityCollection> | null> | undefined;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { CollectionEditorDialog } from "./CollectionEditorDialog-
|
|
2
|
-
import { a, b } from "./PropertyEditView-
|
|
3
|
-
import { C, a as a2 } from "./CollectionsStudioView-
|
|
1
|
+
import { CollectionEditorDialog } from "./CollectionEditorDialog-D0VqpLPO.js";
|
|
2
|
+
import { a, b } from "./PropertyEditView-CvRSV-A2.js";
|
|
3
|
+
import { C, a as a2 } from "./CollectionsStudioView-Bc3Rxxc2.js";
|
|
4
4
|
export {
|
|
5
5
|
CollectionEditorDialog,
|
|
6
6
|
C as CollectionStudioView,
|
|
@@ -26,7 +26,7 @@ export interface ArrayContainerProps<T> {
|
|
|
26
26
|
type ArrayContainerItemProps = {
|
|
27
27
|
nodeRef: (node: HTMLElement | null) => void;
|
|
28
28
|
style: React.CSSProperties;
|
|
29
|
-
dragHandleProps:
|
|
29
|
+
dragHandleProps: Record<string, unknown>;
|
|
30
30
|
index: number;
|
|
31
31
|
internalId: number;
|
|
32
32
|
size?: "small" | "medium";
|
|
@@ -43,7 +43,7 @@ type ArrayContainerItemProps = {
|
|
|
43
43
|
};
|
|
44
44
|
export declare function ArrayContainerItem({ nodeRef, style, dragHandleProps, index, internalId, size, disabled, buildEntry, remove, copy, addInIndex, canAddElements, sortable, isDragging, storedProps, updateItemCustomProps }: ArrayContainerItemProps): import("react/jsx-runtime").JSX.Element;
|
|
45
45
|
export declare function ArrayItemOptions({ dragHandleProps, direction, disabled, remove, index, copy, canAddElements, sortable, addInIndex }: {
|
|
46
|
-
dragHandleProps:
|
|
46
|
+
dragHandleProps: Record<string, unknown>;
|
|
47
47
|
direction?: "row" | "column";
|
|
48
48
|
disabled: boolean;
|
|
49
49
|
remove: (index: number) => void;
|
|
@@ -14,7 +14,24 @@ export type DefaultAppBarProps<ADDITIONAL_PROPS = object> = {
|
|
|
14
14
|
*/
|
|
15
15
|
startAdornment?: React.ReactNode;
|
|
16
16
|
dropDownActions?: React.ReactNode;
|
|
17
|
+
/**
|
|
18
|
+
* Whether to render the dark/light/system mode toggle in the app bar.
|
|
19
|
+
* Set to `false` when the drawer owns this action.
|
|
20
|
+
* @default true
|
|
21
|
+
*/
|
|
17
22
|
includeModeToggle?: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Whether to render the language switcher in the app bar.
|
|
25
|
+
* Set to `false` when the drawer owns this action.
|
|
26
|
+
* @default true
|
|
27
|
+
*/
|
|
28
|
+
includeLanguageToggle?: boolean;
|
|
29
|
+
/**
|
|
30
|
+
* Whether to render the user avatar / menu in the app bar.
|
|
31
|
+
* Set to `false` when the drawer owns this action.
|
|
32
|
+
* @default true
|
|
33
|
+
*/
|
|
34
|
+
includeUserMenu?: boolean;
|
|
18
35
|
className?: string;
|
|
19
36
|
style?: React.CSSProperties;
|
|
20
37
|
logo?: string;
|
|
@@ -26,4 +43,4 @@ export type DefaultAppBarProps<ADDITIONAL_PROPS = object> = {
|
|
|
26
43
|
*
|
|
27
44
|
|
|
28
45
|
*/
|
|
29
|
-
export declare const DefaultAppBar: ({ title, endAdornment, startAdornment, dropDownActions, includeModeToggle, className, style, user: userProp, logo: logoProp }: DefaultAppBarProps) => import("react/jsx-runtime").JSX.Element;
|
|
46
|
+
export declare const DefaultAppBar: ({ title, endAdornment, startAdornment, dropDownActions, includeModeToggle, includeLanguageToggle, includeUserMenu, className, style, user: userProp, logo: logoProp }: DefaultAppBarProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,15 +1,39 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
/**
|
|
3
|
-
* Default drawer used in the CMS
|
|
3
|
+
* Default drawer used in the CMS.
|
|
4
|
+
*
|
|
5
|
+
* When no `children` are provided, renders the full CMS navigation
|
|
6
|
+
* (collection groups, mode switch, plugin slots).
|
|
7
|
+
*
|
|
8
|
+
* When `children` **are** provided, renders the shared drawer shell
|
|
9
|
+
* (logo, scrollable area, footer actions, collapse toggle) with the
|
|
10
|
+
* custom content injected in the scrollable area. This lets consumers
|
|
11
|
+
* like the SaaS dashboard reuse the identical structural layout while
|
|
12
|
+
* supplying their own navigation items.
|
|
13
|
+
*
|
|
4
14
|
* @group Core
|
|
5
15
|
*/
|
|
6
|
-
export declare function DefaultDrawer({ title, logo, logoDestination, className, style }: {
|
|
16
|
+
export declare function DefaultDrawer({ title, logo, logoDestination, children, footerActions, className, style }: {
|
|
7
17
|
title?: React.ReactNode;
|
|
8
18
|
logo?: string;
|
|
9
19
|
logoDestination?: string;
|
|
20
|
+
/**
|
|
21
|
+
* Custom navigation content for the drawer.
|
|
22
|
+
* When provided, replaces the default CMS navigation (collection groups,
|
|
23
|
+
* mode switch, slots). The shared shell (logo, scroll area, footer
|
|
24
|
+
* actions, collapse toggle) is still rendered around it.
|
|
25
|
+
*/
|
|
26
|
+
children?: React.ReactNode;
|
|
27
|
+
/**
|
|
28
|
+
* Custom content for the drawer footer actions area (language, theme, user menu).
|
|
29
|
+
* - `undefined` — renders the default `DrawerFooterActions`.
|
|
30
|
+
* - `null` — renders nothing (hides the footer actions).
|
|
31
|
+
* - `ReactNode` — renders the provided custom content.
|
|
32
|
+
*/
|
|
33
|
+
footerActions?: React.ReactNode | null;
|
|
10
34
|
className?: string;
|
|
11
35
|
style?: React.CSSProperties;
|
|
12
|
-
}): import("react/jsx-runtime").JSX.Element
|
|
36
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
13
37
|
export declare function DrawerLogo({ logo, title, logoDestination, drawerOpen, drawerHovered }: {
|
|
14
38
|
logo?: string;
|
|
15
39
|
title?: React.ReactNode;
|
|
@@ -27,3 +51,27 @@ export declare function DrawerToggle({ drawerOpen, drawerHovered, openDrawer, cl
|
|
|
27
51
|
openDrawer: () => void;
|
|
28
52
|
closeDrawer: () => void;
|
|
29
53
|
}): import("react/jsx-runtime").JSX.Element;
|
|
54
|
+
/**
|
|
55
|
+
* Footer actions rendered at the bottom of the drawer, above the collapse/expand toggle.
|
|
56
|
+
* Replaces the app bar icons (language, theme, user avatar) with a drawer-native layout
|
|
57
|
+
* that adapts between collapsed (icons only) and expanded (full labels + user bar) states.
|
|
58
|
+
*
|
|
59
|
+
* @group Core
|
|
60
|
+
*/
|
|
61
|
+
export declare function DrawerFooterActions({ drawerOpen, drawerHovered,
|
|
62
|
+
/**
|
|
63
|
+
* Custom content to render inside the user dropdown menu.
|
|
64
|
+
* When provided, these items are appended after the user info header
|
|
65
|
+
* and before the default Sign Out item.
|
|
66
|
+
*/
|
|
67
|
+
dropDownActions,
|
|
68
|
+
/**
|
|
69
|
+
* Override the user object displayed in the footer.
|
|
70
|
+
* When omitted, falls back to `authController.user`.
|
|
71
|
+
*/
|
|
72
|
+
user: userProp }: {
|
|
73
|
+
drawerOpen: boolean;
|
|
74
|
+
drawerHovered: boolean;
|
|
75
|
+
dropDownActions?: React.ReactNode;
|
|
76
|
+
user?: import("@rebasepro/types").User;
|
|
77
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -18,7 +18,7 @@ export declare function TableStorageUpload(props: {
|
|
|
18
18
|
selected: boolean;
|
|
19
19
|
focused: boolean;
|
|
20
20
|
property: StringProperty | ArrayProperty;
|
|
21
|
-
entity: Entity<
|
|
21
|
+
entity: Entity<Record<string, unknown>>;
|
|
22
22
|
path: string;
|
|
23
23
|
previewSize: PreviewSize;
|
|
24
24
|
openPopup?: (cellRect?: DOMRect) => void;
|
|
@@ -29,7 +29,7 @@ interface TableStorageItemPreviewProps {
|
|
|
29
29
|
property: StringProperty;
|
|
30
30
|
value: string;
|
|
31
31
|
size: PreviewSize;
|
|
32
|
-
entity: Entity<
|
|
32
|
+
entity: Entity<Record<string, unknown>>;
|
|
33
33
|
}
|
|
34
34
|
export declare function TableStorageItemPreview({ propertyKey, property, value, size, entity }: TableStorageItemPreviewProps): import("react/jsx-runtime").JSX.Element;
|
|
35
35
|
export {};
|
|
@@ -6,7 +6,7 @@ interface EntityTableCellProps {
|
|
|
6
6
|
/**
|
|
7
7
|
* The value is used only to check changes and force re-renders
|
|
8
8
|
*/
|
|
9
|
-
value?:
|
|
9
|
+
value?: unknown;
|
|
10
10
|
disabled: boolean;
|
|
11
11
|
savedTimestamp?: number;
|
|
12
12
|
error?: Error;
|
|
@@ -23,7 +23,7 @@ interface EntityTableCellProps {
|
|
|
23
23
|
onSelect?: (cellRect: DOMRect | undefined) => void;
|
|
24
24
|
sortableNodeRef?: (node: HTMLElement | null) => void;
|
|
25
25
|
sortableStyle?: React.CSSProperties;
|
|
26
|
-
sortableAttributes?: Record<string,
|
|
26
|
+
sortableAttributes?: Record<string, string | number | undefined>;
|
|
27
27
|
isDragging?: boolean;
|
|
28
28
|
isDraggable?: boolean;
|
|
29
29
|
frozen?: boolean;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { Entity, Property } from "@rebasepro/types";
|
|
3
|
-
|
|
3
|
+
import { TableSize } from "@rebasepro/core";
|
|
4
|
+
export interface TableFieldBindingProps<T = unknown> {
|
|
4
5
|
propertyKey: string;
|
|
5
6
|
property: Property;
|
|
6
7
|
internalValue: T;
|
|
@@ -9,9 +10,9 @@ export interface TableFieldBindingProps<T = any> {
|
|
|
9
10
|
validationError?: Error;
|
|
10
11
|
disabled: boolean;
|
|
11
12
|
selected: boolean;
|
|
12
|
-
size:
|
|
13
|
+
size: TableSize;
|
|
13
14
|
align: "left" | "center" | "right";
|
|
14
|
-
entity: Entity<
|
|
15
|
+
entity: Entity<Record<string, unknown>>;
|
|
15
16
|
path: string;
|
|
16
17
|
openPopup?: (cellRect: DOMRect | undefined) => void;
|
|
17
18
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { EntityCollection, RebaseData, RebaseContext } from "@rebasepro/types";
|
|
1
|
+
import { EntityCollection, RebaseData, RebaseContext, AnalyticsController } from "@rebasepro/types";
|
|
2
2
|
import { BoardItem } from "../board_types";
|
|
3
|
+
import { BoardDataController } from "../useBoardDataController";
|
|
3
4
|
export interface UseKanbanDragAndDropParams<M extends Record<string, unknown>> {
|
|
4
5
|
collection: EntityCollection<M>;
|
|
5
6
|
fullPath: string;
|
|
@@ -7,8 +8,8 @@ export interface UseKanbanDragAndDropParams<M extends Record<string, unknown>> {
|
|
|
7
8
|
orderProperty?: string;
|
|
8
9
|
dataClient: RebaseData;
|
|
9
10
|
context: RebaseContext;
|
|
10
|
-
boardDataController:
|
|
11
|
-
analyticsController:
|
|
11
|
+
boardDataController: BoardDataController<M>;
|
|
12
|
+
analyticsController: AnalyticsController;
|
|
12
13
|
}
|
|
13
14
|
export declare function useKanbanDragAndDrop<M extends Record<string, unknown>>({ collection, fullPath, columnProperty, orderProperty, dataClient, context, boardDataController, analyticsController }: UseKanbanDragAndDropParams<M>): {
|
|
14
15
|
handleItemsReorder: (items: BoardItem<M>[], moveInfo?: {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { EntityCollection } from "@rebasepro/types";
|
|
2
|
+
import React from "react";
|
|
2
3
|
import { Entity, EntityStatus } from "@rebasepro/types";
|
|
3
4
|
import type { EntityFormProps, OnUpdateParams } from "../types/components/EntityFormProps";
|
|
4
5
|
export declare const MAIN_TAB_VALUE = "__main_##Q$SC^#S6";
|
|
@@ -33,7 +34,7 @@ export interface EntityEditViewProps<M extends Record<string, unknown> = Record<
|
|
|
33
34
|
onTabChange?: (props: OnTabChangeParams<M>) => void;
|
|
34
35
|
navigateBack?: () => void;
|
|
35
36
|
layout?: "side_panel" | "full_screen" | "split" | "dialog";
|
|
36
|
-
barActions?: (params: BarActionsParams) =>
|
|
37
|
+
barActions?: (params: BarActionsParams) => React.ReactNode;
|
|
37
38
|
formProps?: Partial<EntityFormProps<M>>;
|
|
38
39
|
/**
|
|
39
40
|
* Pre-populate the form with these values when creating a new entity.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { NavigationEntry } from "@rebasepro/types";
|
|
2
2
|
import React from "react";
|
|
3
|
-
import { Active, CollisionDetection, DropAnimation, UniqueIdentifier } from "@dnd-kit/core";
|
|
3
|
+
import { Active, Over, CollisionDetection, DropAnimation, UniqueIdentifier } from "@dnd-kit/core";
|
|
4
4
|
export declare function SortableNavigationCard({ entry, onClick }: {
|
|
5
5
|
entry: NavigationEntry;
|
|
6
6
|
onClick?: () => void;
|
|
@@ -47,11 +47,11 @@ export declare function useHomePageDnd({ items, setItems, disabled, onCardMovedB
|
|
|
47
47
|
}) => void;
|
|
48
48
|
onDragOver: ({ active, over }: {
|
|
49
49
|
active: Active;
|
|
50
|
-
over:
|
|
50
|
+
over: Over | null;
|
|
51
51
|
}) => void;
|
|
52
52
|
onDragEnd: ({ active, over }: {
|
|
53
53
|
active: Active;
|
|
54
|
-
over:
|
|
54
|
+
over: Over | null;
|
|
55
55
|
}) => void;
|
|
56
56
|
onDragCancel: () => void;
|
|
57
57
|
dropAnimation: DropAnimation;
|
|
@@ -15,7 +15,7 @@ export declare function buildPropertyLabelAndGetProperty(properties: Properties,
|
|
|
15
15
|
* - Leaf or Array-of-Primitives -> single row with label and value
|
|
16
16
|
*/
|
|
17
17
|
export declare const PropertyCollectionView: ({ data, properties, baseKey, suppressHeader, size }: {
|
|
18
|
-
data:
|
|
18
|
+
data: unknown;
|
|
19
19
|
properties: Properties;
|
|
20
20
|
baseKey?: string;
|
|
21
21
|
suppressHeader?: boolean;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export declare function PropertyIdCopyTooltip({ propertyKey, className, children }: {
|
|
2
2
|
propertyKey: string;
|
|
3
3
|
className?: string;
|
|
4
|
-
children:
|
|
4
|
+
children: React.ReactNode;
|
|
5
5
|
}): import("react/jsx-runtime").JSX.Element;
|
|
6
6
|
export declare function PropertyIdCopyTooltipContent({ propertyKey }: {
|
|
7
7
|
propertyKey: string;
|
|
@@ -23,4 +23,7 @@ export type SelectionStore = ReturnType<typeof createSelectionStore>;
|
|
|
23
23
|
* whether THIS cell is selected. Only re-renders when the cell's
|
|
24
24
|
* `selected` boolean actually changes (not on every store update).
|
|
25
25
|
*/
|
|
26
|
-
export declare function useCellSelected(store:
|
|
26
|
+
export declare function useCellSelected(store: {
|
|
27
|
+
getSnapshot: () => SelectedCellProps<any> | undefined;
|
|
28
|
+
subscribe: (listener: () => void) => () => void;
|
|
29
|
+
}, propertyKey: string, entityPath: string, entityId: string | number): boolean;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { VirtualTableWhereFilterOp } from "@rebasepro/ui";
|
|
2
2
|
interface BooleanFieldProps {
|
|
3
3
|
name: string;
|
|
4
|
-
value?: [op: VirtualTableWhereFilterOp, fieldValue:
|
|
5
|
-
setValue: (value?: [op: VirtualTableWhereFilterOp, newValue:
|
|
4
|
+
value?: [op: VirtualTableWhereFilterOp, fieldValue: unknown];
|
|
5
|
+
setValue: (value?: [op: VirtualTableWhereFilterOp, newValue: unknown]) => void;
|
|
6
6
|
title?: string;
|
|
7
7
|
}
|
|
8
8
|
export declare function BooleanFilterField({ name, title, value, setValue }: BooleanFieldProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -2,8 +2,8 @@ import { VirtualTableWhereFilterOp } from "@rebasepro/ui";
|
|
|
2
2
|
interface DateTimeFilterFieldProps {
|
|
3
3
|
name: string;
|
|
4
4
|
mode?: "date" | "date_time";
|
|
5
|
-
value?: [op: VirtualTableWhereFilterOp, fieldValue:
|
|
6
|
-
setValue: (value?: [op: VirtualTableWhereFilterOp, newValue:
|
|
5
|
+
value?: [op: VirtualTableWhereFilterOp, fieldValue: unknown];
|
|
6
|
+
setValue: (value?: [op: VirtualTableWhereFilterOp, newValue: unknown]) => void;
|
|
7
7
|
isArray?: boolean;
|
|
8
8
|
title?: string;
|
|
9
9
|
timezone?: string;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { VirtualTableWhereFilterOp } from "@rebasepro/ui";
|
|
2
2
|
interface ReferenceFilterFieldProps {
|
|
3
3
|
name: string;
|
|
4
|
-
value?: [op: VirtualTableWhereFilterOp, fieldValue:
|
|
5
|
-
setValue: (filterValue?: [VirtualTableWhereFilterOp,
|
|
4
|
+
value?: [op: VirtualTableWhereFilterOp, fieldValue: unknown];
|
|
5
|
+
setValue: (filterValue?: [VirtualTableWhereFilterOp, unknown]) => void;
|
|
6
6
|
isArray?: boolean;
|
|
7
7
|
path?: string;
|
|
8
8
|
title?: string;
|
|
@@ -3,8 +3,8 @@ import { EnumValueConfig } from "@rebasepro/types";
|
|
|
3
3
|
interface StringNumberFilterFieldProps {
|
|
4
4
|
name: string;
|
|
5
5
|
type: "string" | "number";
|
|
6
|
-
value?: [op: VirtualTableWhereFilterOp, fieldValue:
|
|
7
|
-
setValue: (value?: [op: VirtualTableWhereFilterOp, newValue:
|
|
6
|
+
value?: [op: VirtualTableWhereFilterOp, fieldValue: unknown];
|
|
7
|
+
setValue: (value?: [op: VirtualTableWhereFilterOp, newValue: unknown]) => void;
|
|
8
8
|
isArray?: boolean;
|
|
9
9
|
enumValues?: EnumValueConfig[];
|
|
10
10
|
title?: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { UserManagementDelegate } from "@rebasepro/types";
|
|
2
|
-
export declare function RolesView({ userManagement }: {
|
|
3
|
-
userManagement
|
|
4
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export declare function RolesView({ userManagement: userManagementProp }: {
|
|
3
|
+
userManagement?: UserManagementDelegate;
|
|
4
|
+
}): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { UserManagementDelegate } from "@rebasepro/types";
|
|
2
|
-
export declare function UsersView({ userManagement }: {
|
|
3
|
-
userManagement
|
|
4
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export declare function UsersView({ userManagement: userManagementProp }: {
|
|
3
|
+
userManagement?: UserManagementDelegate;
|
|
4
|
+
}): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -6,11 +6,18 @@
|
|
|
6
6
|
* For custom drawers, you can use the {@link useApp} to open and close the drawer.
|
|
7
7
|
*
|
|
8
8
|
*/
|
|
9
|
-
export declare function Drawer({ children, title, logo, logoDestination, className, style }: {
|
|
9
|
+
export declare function Drawer({ children, title, logo, logoDestination, footerActions, className, style }: {
|
|
10
10
|
children?: React.ReactNode;
|
|
11
11
|
title?: React.ReactNode;
|
|
12
12
|
logo?: string;
|
|
13
13
|
logoDestination?: string;
|
|
14
|
+
/**
|
|
15
|
+
* Custom content for the drawer footer actions area (language, theme, user menu).
|
|
16
|
+
* - `undefined` — renders the default `DrawerFooterActions`.
|
|
17
|
+
* - `null` — renders nothing (hides the footer actions).
|
|
18
|
+
* - `ReactNode` — renders the provided custom content.
|
|
19
|
+
*/
|
|
20
|
+
footerActions?: React.ReactNode | null;
|
|
14
21
|
className?: string;
|
|
15
22
|
style?: React.CSSProperties;
|
|
16
23
|
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -5,7 +5,7 @@ interface Header {
|
|
|
5
5
|
}
|
|
6
6
|
export interface DownloadEntitiesExportParams<M extends Record<string, unknown>> {
|
|
7
7
|
data: Entity<M>[];
|
|
8
|
-
additionalData: Record<string,
|
|
8
|
+
additionalData: Record<string, unknown>[] | undefined;
|
|
9
9
|
properties: Properties;
|
|
10
10
|
propertiesOrder: string[] | undefined;
|
|
11
11
|
name: string;
|
|
@@ -15,8 +15,8 @@ export interface DownloadEntitiesExportParams<M extends Record<string, unknown>>
|
|
|
15
15
|
dateExportType: "timestamp" | "string";
|
|
16
16
|
}
|
|
17
17
|
export declare function downloadEntitiesExport<M extends Record<string, unknown>>({ data, additionalData, properties, propertiesOrder, name, flattenArrays, additionalHeaders, exportType, dateExportType }: DownloadEntitiesExportParams<M>): void;
|
|
18
|
-
export declare function getEntityCSVExportableData(data: Entity<
|
|
19
|
-
export declare function getEntityJsonExportableData(data: Entity<
|
|
18
|
+
export declare function getEntityCSVExportableData(data: Entity<Record<string, unknown>>[], additionalData: Record<string, unknown>[] | undefined, properties: Properties, headers: Header[], dateExportType: "timestamp" | "string"): unknown[][];
|
|
19
|
+
export declare function getEntityJsonExportableData(data: Entity<Record<string, unknown>>[], additionalData: Record<string, unknown>[] | undefined, properties: Properties, dateExportType: "timestamp" | "string"): Record<string, unknown>[];
|
|
20
20
|
export declare function downloadBlob(content: BlobPart[], filename: string, contentType: string): void;
|
|
21
21
|
export declare function downloadDataAsCsv(data: object[], name: string): void;
|
|
22
22
|
export {};
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import { type ReactNode } from "react";
|
|
2
|
+
import { type Placement } from "@floating-ui/dom";
|
|
2
3
|
export interface EditorBubbleProps {
|
|
3
4
|
children: ReactNode;
|
|
4
|
-
options?:
|
|
5
|
+
options?: {
|
|
6
|
+
placement?: Placement;
|
|
7
|
+
offset?: number;
|
|
8
|
+
};
|
|
5
9
|
className?: string;
|
|
6
10
|
}
|
|
7
11
|
export declare const EditorBubble: import("react").ForwardRefExoticComponent<EditorBubbleProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -1,5 +1,9 @@
|
|
|
1
|
+
import { type Placement } from "@floating-ui/dom";
|
|
1
2
|
export interface ImageBubbleProps {
|
|
2
|
-
options?:
|
|
3
|
+
options?: {
|
|
4
|
+
placement?: Placement;
|
|
5
|
+
offset?: number;
|
|
6
|
+
};
|
|
3
7
|
className?: string;
|
|
4
8
|
}
|
|
5
9
|
export declare const ImageBubble: import("react").ForwardRefExoticComponent<ImageBubbleProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -5,12 +5,12 @@ export { ImageBubble } from "./image-bubble";
|
|
|
5
5
|
export { TableBubble } from "./table-bubble";
|
|
6
6
|
export type JSONContent = {
|
|
7
7
|
type?: string;
|
|
8
|
-
attrs?: Record<string,
|
|
8
|
+
attrs?: Record<string, unknown>;
|
|
9
9
|
content?: JSONContent[];
|
|
10
10
|
marks?: {
|
|
11
11
|
type: string;
|
|
12
|
-
attrs?: Record<string,
|
|
12
|
+
attrs?: Record<string, unknown>;
|
|
13
13
|
}[];
|
|
14
14
|
text?: string;
|
|
15
|
-
[key: string]:
|
|
15
|
+
[key: string]: unknown;
|
|
16
16
|
};
|
|
@@ -1,5 +1,9 @@
|
|
|
1
|
+
import { type Placement } from "@floating-ui/dom";
|
|
1
2
|
export interface TableBubbleProps {
|
|
2
|
-
options?:
|
|
3
|
+
options?: {
|
|
4
|
+
placement?: Placement;
|
|
5
|
+
offset?: number;
|
|
6
|
+
};
|
|
3
7
|
className?: string;
|
|
4
8
|
}
|
|
5
9
|
export declare const TableBubble: import("react").ForwardRefExoticComponent<TableBubbleProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -25,5 +25,8 @@ export declare class ReactNodeView implements NodeView {
|
|
|
25
25
|
private render;
|
|
26
26
|
update(node: ProseMirrorNode): boolean;
|
|
27
27
|
destroy(): void;
|
|
28
|
-
ignoreMutation(mutation:
|
|
28
|
+
ignoreMutation(mutation: MutationRecord | {
|
|
29
|
+
type: "selection";
|
|
30
|
+
target: Node;
|
|
31
|
+
}): boolean;
|
|
29
32
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { EditorState, Plugin } from "prosemirror-state";
|
|
2
2
|
import { EditorView } from "prosemirror-view";
|
|
3
3
|
export interface UseProseMirrorOptions {
|
|
4
|
-
content?:
|
|
4
|
+
content?: unknown;
|
|
5
5
|
plugins?: Plugin[];
|
|
6
6
|
editable?: boolean;
|
|
7
7
|
onMarkdownContentChange?: (content: string) => void;
|
|
8
|
-
onJsonContentChange?: (content:
|
|
8
|
+
onJsonContentChange?: (content: unknown | null) => void;
|
|
9
9
|
onHtmlContentChange?: (content: string) => void;
|
|
10
10
|
version?: number;
|
|
11
11
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function removeClassesFromJson(jsonObj:
|
|
1
|
+
export declare function removeClassesFromJson(jsonObj: unknown): unknown;
|
package/dist/editor.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment as Fragment$1 } from "react/jsx-runtime";
|
|
2
2
|
import React__default, { createContext, useContext, forwardRef, useRef, useState, useEffect, useLayoutEffect, useMemo } from "react";
|
|
3
|
-
import { Slot, defaultBorderMixin, cls, TypeIcon, iconSize, CheckSquareIcon, Heading1Icon, Heading2Icon, Heading3Icon, ListIcon, ListOrderedIcon, QuoteIcon, CodeIcon, ImageIcon, TableIcon, Wand2Icon, TextField, IconButton, Tooltip, ChevronDownIcon, CheckIcon, Popover, Button, focusedDisabled, Trash2Icon, BoldIcon, ItalicIcon, UnderlineIcon, StrikethroughIcon, useInjectStyles, Separator, TextareaAutosize } from "@rebasepro/ui";
|
|
3
|
+
import { Slot, defaultBorderMixin, cls, TypeIcon, iconSize, CheckSquareIcon, Heading1Icon, Heading2Icon, Heading3Icon, ListIcon, ListOrderedIcon, QuoteIcon, CodeIcon, ImageIcon, TableIcon, Wand2Icon, TextField, IconButton, Tooltip, ChevronDownIcon, CheckIcon, Popover, Button, focusedDisabled, Trash2Icon, BoldIcon, ItalicIcon, UnderlineIcon, StrikethroughIcon, Label, Checkbox, useInjectStyles, Separator, TextareaAutosize } from "@rebasepro/ui";
|
|
4
4
|
import { useTranslation } from "@rebasepro/core";
|
|
5
5
|
import { c } from "react-compiler-runtime";
|
|
6
6
|
import { autoUpdate, computePosition, offset, flip, shift } from "@floating-ui/dom";
|
|
@@ -8,7 +8,7 @@ import { NodeSelection, PluginKey, Plugin, TextSelection, EditorState } from "pr
|
|
|
8
8
|
import { Fragment, DOMParser, DOMSerializer } from "prosemirror-model";
|
|
9
9
|
import { setBlockType, wrapIn, toggleMark, baseKeymap } from "prosemirror-commands";
|
|
10
10
|
import { wrapInList, sinkListItem, liftListItem, splitListItem } from "prosemirror-schema-list";
|
|
11
|
-
import { s as schema, p as parser, a as serializer } from "./markdown-
|
|
11
|
+
import { s as schema, p as parser, a as serializer } from "./markdown-DD2JDU1X.js";
|
|
12
12
|
import { DecorationSet, Decoration, EditorView } from "prosemirror-view";
|
|
13
13
|
import { addRowBefore, addRowAfter, deleteRow, addColumnBefore, addColumnAfter, deleteColumn, deleteTable, goToNextCell, columnResizing, tableEditing } from "prosemirror-tables";
|
|
14
14
|
import { keymap } from "prosemirror-keymap";
|
|
@@ -2329,14 +2329,14 @@ const LinkSelector = (t0) => {
|
|
|
2329
2329
|
}
|
|
2330
2330
|
let t17;
|
|
2331
2331
|
if ($[39] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
|
|
2332
|
-
t17 = cls("
|
|
2332
|
+
t17 = cls("bg-transparent p-1 text-sm outline-none", focusedDisabled);
|
|
2333
2333
|
$[39] = t17;
|
|
2334
2334
|
} else {
|
|
2335
2335
|
t17 = $[39];
|
|
2336
2336
|
}
|
|
2337
2337
|
let t18;
|
|
2338
2338
|
if ($[40] !== href || $[41] !== open || $[42] !== t16) {
|
|
2339
|
-
t18 = /* @__PURE__ */ jsx(
|
|
2339
|
+
t18 = /* @__PURE__ */ jsx(TextField, { inputRef, autoFocus: open, placeholder: t16, defaultValue: href, size: "small", className: "flex-grow text-surface-900 dark:text-white", inputClassName: t17 });
|
|
2340
2340
|
$[40] = href;
|
|
2341
2341
|
$[41] = open;
|
|
2342
2342
|
$[42] = t16;
|
|
@@ -2472,11 +2472,12 @@ function removeClassesFromJson(jsonObj) {
|
|
|
2472
2472
|
if (Array.isArray(jsonObj)) {
|
|
2473
2473
|
return jsonObj.map((item) => removeClassesFromJson(item));
|
|
2474
2474
|
} else if (typeof jsonObj === "object" && jsonObj !== null) {
|
|
2475
|
-
|
|
2476
|
-
|
|
2475
|
+
const obj = jsonObj;
|
|
2476
|
+
if (obj.attrs && typeof obj.attrs === "object" && obj.attrs !== null && "class" in obj.attrs) {
|
|
2477
|
+
delete obj.attrs.class;
|
|
2477
2478
|
}
|
|
2478
|
-
Object.keys(
|
|
2479
|
-
|
|
2479
|
+
Object.keys(obj).forEach((key) => {
|
|
2480
|
+
obj[key] = removeClassesFromJson(obj[key]);
|
|
2480
2481
|
});
|
|
2481
2482
|
}
|
|
2482
2483
|
return jsonObj;
|
|
@@ -3198,14 +3199,14 @@ const TaskItemComponent = (t0) => {
|
|
|
3198
3199
|
const checked = node.attrs.checked;
|
|
3199
3200
|
let t1;
|
|
3200
3201
|
if ($[0] !== getPos || $[1] !== node.attrs || $[2] !== view) {
|
|
3201
|
-
t1 = (
|
|
3202
|
+
t1 = (isChecked) => {
|
|
3202
3203
|
const pos = getPos();
|
|
3203
3204
|
if (typeof pos !== "number") {
|
|
3204
3205
|
return;
|
|
3205
3206
|
}
|
|
3206
3207
|
view.dispatch(view.state.tr.setNodeMarkup(pos, void 0, {
|
|
3207
3208
|
...node.attrs,
|
|
3208
|
-
checked:
|
|
3209
|
+
checked: isChecked
|
|
3209
3210
|
}));
|
|
3210
3211
|
};
|
|
3211
3212
|
$[0] = getPos;
|
|
@@ -3215,12 +3216,12 @@ const TaskItemComponent = (t0) => {
|
|
|
3215
3216
|
} else {
|
|
3216
3217
|
t1 = $[3];
|
|
3217
3218
|
}
|
|
3218
|
-
const
|
|
3219
|
+
const handleCheckedChange = t1;
|
|
3219
3220
|
let t2;
|
|
3220
|
-
if ($[4] !== checked || $[5] !==
|
|
3221
|
-
t2 = /* @__PURE__ */ jsx(
|
|
3221
|
+
if ($[4] !== checked || $[5] !== handleCheckedChange) {
|
|
3222
|
+
t2 = /* @__PURE__ */ jsx(Label, { contentEditable: false, className: "flex items-start select-none px-1 cursor-pointer", children: /* @__PURE__ */ jsx(Checkbox, { checked, onCheckedChange: handleCheckedChange, padding: false, size: "small" }) });
|
|
3222
3223
|
$[4] = checked;
|
|
3223
|
-
$[5] =
|
|
3224
|
+
$[5] = handleCheckedChange;
|
|
3224
3225
|
$[6] = t2;
|
|
3225
3226
|
} else {
|
|
3226
3227
|
t2 = $[6];
|