@arpproject/recrate 0.1.33 → 0.1.35
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 +80 -2
- package/dist/crate-builder/CrateManager/profile-manager.d.ts +1 -1
- package/dist/crate-builder/RenderEntity/CoreEntityFields.d.ts +26 -0
- package/dist/crate-builder/RenderEntity/EntityEditorLayout.d.ts +23 -0
- package/dist/crate-builder/RenderEntity/EntityEditorToolbar.d.ts +23 -0
- package/dist/crate-builder/RenderEntity/EntityPropertyField.d.ts +33 -0
- package/dist/crate-builder/RenderEntity/EntityPropertyFields.d.ts +20 -0
- package/dist/crate-builder/RenderEntity/PaginateLinkedEntities.d.ts +1 -0
- package/dist/crate-builder/RenderEntity/ProfileTabRail.d.ts +23 -0
- package/dist/crate-builder/RenderEntity/approval-utils.d.ts +7 -0
- package/dist/crate-builder/RenderEntity/profile-tabs.lib.d.ts +14 -0
- package/dist/crate-builder/RenderEntity/profile-tabs.lib.spec.d.ts +1 -0
- package/dist/crate-builder/RenderEntity/useEntityMutationHandlers.d.ts +51 -0
- package/dist/crate-builder/RenderEntity/useEntityMutationHandlers.spec.d.ts +1 -0
- package/dist/crate-builder/RenderEntity/useEntityNavigationState.d.ts +22 -0
- package/dist/crate-builder/RenderEntity/useEntityScrollRestoration.d.ts +31 -0
- package/dist/crate-builder/RenderEntity/useScrollViewportHeight.d.ts +13 -0
- package/dist/crate-builder/RenderEntity/useTabRailScrollState.d.ts +18 -0
- package/dist/crate-builder/Shell.d.ts +3 -3
- package/dist/crate-builder/editor-state.d.ts +3 -0
- package/dist/crate-builder/editor-state.spec.d.ts +1 -0
- package/dist/crate-builder/locales/en.d.ts +7 -0
- package/dist/crate-builder/locales/hu.d.ts +7 -0
- package/dist/index.d.ts +4 -4
- package/dist/recrate.css +2 -2
- package/dist/recrate.es.js +55663 -55045
- package/dist/types.d.ts +222 -12
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -11,6 +11,10 @@ The package version matches the latest version of the original Crate Builder pr
|
|
|
11
11
|
- [Crate Builder Component](#crate-builder-component)
|
|
12
12
|
- [Documentation](#documentation)
|
|
13
13
|
- [API Documentation](#api-documentation)
|
|
14
|
+
- [ARP feature notes](#arp-feature-notes)
|
|
15
|
+
- [AI metadata review](#ai-metadata-review)
|
|
16
|
+
- [Quick filter/settings header](#quick-filtersettings-header)
|
|
17
|
+
- [Profile action management](#profile-action-management)
|
|
14
18
|
- [Developing the plugin](#developing-the-plugin)
|
|
15
19
|
- [Storybook](#storybook)
|
|
16
20
|
- [Development application](#development-application)
|
|
@@ -19,7 +23,7 @@ The package version matches the latest version of the original Crate Builder pr
|
|
|
19
23
|
- [Repository structure](#repository-structure)
|
|
20
24
|
|
|
21
25
|
This is the core UI component for assembling an RO-Crate inside Describo. It is a self contained
|
|
22
|
-
|
|
26
|
+
React component that can be used inside your app. If you use this component, your app is responsible
|
|
23
27
|
for loading the crate file from the storage layer (or minting a new one if none exists) and saving
|
|
24
28
|
the updated crate back. Your app can also provide a profile to the component and a class to handle
|
|
25
29
|
template lookups.
|
|
@@ -35,11 +39,85 @@ Comprehensive documentation is available @
|
|
|
35
39
|
- [ProfileManager](https://describo.github.io/crate-builder-component/ProfileManager.html)
|
|
36
40
|
- [EditorState](https://describo.github.io/crate-builder-component/EditorState.html)
|
|
37
41
|
|
|
42
|
+
# ARP feature notes
|
|
43
|
+
|
|
44
|
+
The ARP fork adds several host-integrated workflows on top of the upstream crate builder. Their
|
|
45
|
+
public integration points are documented in the generated `DescriboCrateBuilderProps` API docs.
|
|
46
|
+
|
|
47
|
+
## AI metadata review
|
|
48
|
+
|
|
49
|
+
Pass `roCrateApproval` to display AI-generated metadata changes that still need review. The approval
|
|
50
|
+
payload is usually loaded from `ro-crate-approval.json` and can be an array of entity approval
|
|
51
|
+
objects, an object with an `items` array, or a single entity approval object with an `approval`
|
|
52
|
+
array.
|
|
53
|
+
|
|
54
|
+
Each approval record should include:
|
|
55
|
+
|
|
56
|
+
```json
|
|
57
|
+
{
|
|
58
|
+
"propertyName": "title",
|
|
59
|
+
"previousValue": "Original title",
|
|
60
|
+
"operation": "update",
|
|
61
|
+
"approved": false,
|
|
62
|
+
"timestamp": "2026-05-12T08:15:00.000Z"
|
|
63
|
+
}
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
When pending records exist for the current entity, the editor shows the AI review banner, field-level
|
|
67
|
+
diffs, edited-field badges, and next/previous review controls. Accepting a field marks its records as
|
|
68
|
+
approved. Rejecting a field or making a manual edit removes the pending records from the approval
|
|
69
|
+
state. Persist approval state changes with `onSaveRoCrateApproval`.
|
|
70
|
+
|
|
71
|
+
```tsx
|
|
72
|
+
<DescriboCrateBuilder
|
|
73
|
+
crate={crate}
|
|
74
|
+
profile={profile}
|
|
75
|
+
roCrateApproval={roCrateApproval}
|
|
76
|
+
onSaveCrate={({ crate }) => saveCrate(crate)}
|
|
77
|
+
onSaveRoCrateApproval={({ roCrateApproval }) => saveApproval(roCrateApproval)}
|
|
78
|
+
/>
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
## Quick filter/settings header
|
|
82
|
+
|
|
83
|
+
The control-bar settings button opens a quick settings header above the entity fields. It lets users
|
|
84
|
+
toggle field help, filter visible fields by label or value, hide empty fields, and, when approved AI
|
|
85
|
+
records exist, show only AI-edited fields.
|
|
86
|
+
|
|
87
|
+
Host applications can control the panel state with `quickSettingsVisible` and
|
|
88
|
+
`onQuickSettingsVisibleChange`.
|
|
89
|
+
|
|
90
|
+
```tsx
|
|
91
|
+
<DescriboCrateBuilder
|
|
92
|
+
crate={crate}
|
|
93
|
+
profile={profile}
|
|
94
|
+
quickSettingsVisible={quickSettingsVisible}
|
|
95
|
+
onQuickSettingsVisibleChange={setQuickSettingsVisible}
|
|
96
|
+
/>
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
## Profile action management
|
|
100
|
+
|
|
101
|
+
Set `enableProfileActions` or provide profile action callbacks to show add/remove profile controls in
|
|
102
|
+
the profile tab rail. `onAddNewProfileRequest` tells the host that the user wants to add a profile to
|
|
103
|
+
the current entity. `onRemoveProfile` gives the host the entity id and selected profile tab metadata,
|
|
104
|
+
including whether the tab has data or missing required fields.
|
|
105
|
+
|
|
106
|
+
```tsx
|
|
107
|
+
<DescriboCrateBuilder
|
|
108
|
+
crate={crate}
|
|
109
|
+
profile={profile}
|
|
110
|
+
enableProfileActions
|
|
111
|
+
onAddNewProfileRequest={() => openProfilePicker()}
|
|
112
|
+
onRemoveProfile={({ entityId, tab }) => removeProfileFromEntity(entityId, tab)}
|
|
113
|
+
/>
|
|
114
|
+
```
|
|
115
|
+
|
|
38
116
|
# Developing the plugin
|
|
39
117
|
|
|
40
118
|
## Storybook
|
|
41
119
|
|
|
42
|
-
[Storybook](storybook.js.org/) is used in this application. When you are just developing the
|
|
120
|
+
[Storybook](https://storybook.js.org/) is used in this application. When you are just developing the
|
|
43
121
|
components, storybook is what you want as you can focus just on the component in isolation. To start
|
|
44
122
|
it run:
|
|
45
123
|
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { AiEditedFieldBadgeVariant } from './AiEditedFieldBadge';
|
|
3
|
+
interface CoreEntityFieldsProps {
|
|
4
|
+
entity: any;
|
|
5
|
+
layout: 'untabbed' | 'tabbed';
|
|
6
|
+
showFieldHelp: boolean;
|
|
7
|
+
savedProperty?: string;
|
|
8
|
+
selectedAiApprovalProperty?: string;
|
|
9
|
+
missingRequiredData?: boolean;
|
|
10
|
+
readonly?: boolean;
|
|
11
|
+
untabbedNameSavedClassName?: string;
|
|
12
|
+
shouldRenderCoreField: (property: string, label?: string) => boolean;
|
|
13
|
+
fieldWasAiEdited: (property: string) => boolean;
|
|
14
|
+
fieldAiEditedVariant: (property: string) => AiEditedFieldBadgeVariant;
|
|
15
|
+
getCoreAiReviewProps: (property: string) => any;
|
|
16
|
+
onUpdateCoreProperty: (data: {
|
|
17
|
+
property: string;
|
|
18
|
+
value: any;
|
|
19
|
+
}) => void;
|
|
20
|
+
onToggleHighlightRequiredProperties: () => void;
|
|
21
|
+
}
|
|
22
|
+
export declare const FloatingRequiredPropertiesWarning: React.FC<{
|
|
23
|
+
onClick: () => void;
|
|
24
|
+
}>;
|
|
25
|
+
declare const CoreEntityFields: React.FC<CoreEntityFieldsProps>;
|
|
26
|
+
export default CoreEntityFields;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
interface EntityEditorLayoutProps {
|
|
3
|
+
renderTabs: boolean;
|
|
4
|
+
tabLocation?: string;
|
|
5
|
+
iconView: boolean;
|
|
6
|
+
tabPaneWidth: number;
|
|
7
|
+
scrollViewportHeight: number;
|
|
8
|
+
editorScrollClassName: string;
|
|
9
|
+
contentContainerRef: React.RefObject<HTMLDivElement>;
|
|
10
|
+
activeContentRef: React.RefObject<HTMLDivElement>;
|
|
11
|
+
topTabItems: any[];
|
|
12
|
+
profileActionRail: React.ReactNode;
|
|
13
|
+
profileTabRail: React.ReactNode;
|
|
14
|
+
quickSettingsHeader: React.ReactNode;
|
|
15
|
+
untabbedContent: React.ReactNode;
|
|
16
|
+
untabbedTopContent: React.ReactNode;
|
|
17
|
+
tabbedRequiredWarning: React.ReactNode;
|
|
18
|
+
tabbedAboutContent: React.ReactNode;
|
|
19
|
+
tabbedOtherTabsContent: React.ReactNode;
|
|
20
|
+
onTabPaneWidthChange: (width: number) => void;
|
|
21
|
+
}
|
|
22
|
+
declare const EntityEditorLayout: React.FC<EntityEditorLayoutProps>;
|
|
23
|
+
export default EntityEditorLayout;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
interface EntityEditorToolbarProps {
|
|
3
|
+
entity: any;
|
|
4
|
+
quickSettingsVisible: boolean;
|
|
5
|
+
reverseSidebarVisible: boolean;
|
|
6
|
+
enableReverseLinkBrowser?: boolean;
|
|
7
|
+
onLoadEntity: (params: {
|
|
8
|
+
id: string;
|
|
9
|
+
updateState?: boolean;
|
|
10
|
+
}) => void;
|
|
11
|
+
onBack: () => void;
|
|
12
|
+
onForward: () => void;
|
|
13
|
+
onAddPropertyPlaceholder: (property: any) => void;
|
|
14
|
+
onDeleteEntity: (data: {
|
|
15
|
+
id: string;
|
|
16
|
+
}) => void;
|
|
17
|
+
onSaveEntityTemplate: (data: any) => void;
|
|
18
|
+
onUpdateContext: (data: any) => void;
|
|
19
|
+
onToggleQuickSettings: () => void;
|
|
20
|
+
onToggleReverseSidebar: () => void;
|
|
21
|
+
}
|
|
22
|
+
declare const EntityEditorToolbar: React.FC<EntityEditorToolbarProps>;
|
|
23
|
+
export default EntityEditorToolbar;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { AiEditedFieldBadgeVariant } from './AiEditedFieldBadge';
|
|
3
|
+
export declare const CORE_ENTITY_PROPERTIES: string[];
|
|
4
|
+
export declare const isCoreEntityProperty: (property: string) => boolean;
|
|
5
|
+
interface EntityPropertyFieldHandlers {
|
|
6
|
+
onLoadEntity: (data: any) => void;
|
|
7
|
+
onCreateEntity: (data: any) => any;
|
|
8
|
+
onLinkEntity: (data: any) => void;
|
|
9
|
+
onUnlinkEntity: (data: any) => void;
|
|
10
|
+
onCreateProperty: (data: any) => void;
|
|
11
|
+
onSaveProperty: (data: any) => void;
|
|
12
|
+
onDeleteProperty: (data: any) => void;
|
|
13
|
+
onAcceptAiEntityDelete: (deletedEntity: any) => void;
|
|
14
|
+
onRestoreAiDeletedEntity: (deletedEntity: any) => void;
|
|
15
|
+
onAcceptAiEntityEdit: (editedEntity: any) => void;
|
|
16
|
+
onRejectAiEntityEdit: (editedEntity: any) => void;
|
|
17
|
+
onAcceptAiEntityUnlink: (data: any) => void;
|
|
18
|
+
onRejectAiEntityUnlink: (data: any) => void;
|
|
19
|
+
}
|
|
20
|
+
interface EntityPropertyFieldProps extends EntityPropertyFieldHandlers {
|
|
21
|
+
entity: any;
|
|
22
|
+
property: string;
|
|
23
|
+
layout: 'untabbed' | 'tabbed';
|
|
24
|
+
showFieldHelp: boolean;
|
|
25
|
+
highlightRequiredProperties: boolean;
|
|
26
|
+
savedProperty?: string;
|
|
27
|
+
selectedAiApprovalProperty?: string;
|
|
28
|
+
aiEdited: boolean;
|
|
29
|
+
aiEditedVariant: AiEditedFieldBadgeVariant;
|
|
30
|
+
}
|
|
31
|
+
declare const EntityPropertyField: React.FC<EntityPropertyFieldProps>;
|
|
32
|
+
export default EntityPropertyField;
|
|
33
|
+
export type { EntityPropertyFieldHandlers };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { AiEditedFieldBadgeVariant } from './AiEditedFieldBadge';
|
|
3
|
+
import { EntityPropertyFieldHandlers } from './EntityPropertyField';
|
|
4
|
+
interface EntityPropertyFieldsProps extends EntityPropertyFieldHandlers {
|
|
5
|
+
entity: any;
|
|
6
|
+
fields: Array<string | {
|
|
7
|
+
name: string;
|
|
8
|
+
label?: string;
|
|
9
|
+
}>;
|
|
10
|
+
layout: 'untabbed' | 'tabbed';
|
|
11
|
+
showFieldHelp: boolean;
|
|
12
|
+
highlightRequiredProperties: boolean;
|
|
13
|
+
savedProperty?: string;
|
|
14
|
+
selectedAiApprovalProperty?: string;
|
|
15
|
+
shouldRenderField: (property: string, label?: string) => boolean;
|
|
16
|
+
fieldWasAiEdited: (property: string) => boolean;
|
|
17
|
+
fieldAiEditedVariant: (property: string) => AiEditedFieldBadgeVariant;
|
|
18
|
+
}
|
|
19
|
+
declare const EntityPropertyFields: React.FC<EntityPropertyFieldsProps>;
|
|
20
|
+
export default EntityPropertyFields;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
interface ProfileTabRailProps {
|
|
3
|
+
tabs?: any[];
|
|
4
|
+
activeTab?: string;
|
|
5
|
+
iconView: boolean;
|
|
6
|
+
showAddPanel: boolean;
|
|
7
|
+
actionsOnly?: boolean;
|
|
8
|
+
hoveredTabKey?: string | null;
|
|
9
|
+
tabRailListRef?: React.RefObject<HTMLDivElement>;
|
|
10
|
+
tabRailScrollState?: {
|
|
11
|
+
canScrollUp: boolean;
|
|
12
|
+
canScrollDown: boolean;
|
|
13
|
+
};
|
|
14
|
+
onToggleIconView: () => void;
|
|
15
|
+
onAddNewProfile: () => void;
|
|
16
|
+
onSelectTab?: (tabName: string) => void;
|
|
17
|
+
onRemoveProfile?: (tab: any) => void;
|
|
18
|
+
onHoveredTabKeyChange?: (tabKey: string | null) => void;
|
|
19
|
+
onScrollTabRail?: (direction: 'up' | 'down') => void;
|
|
20
|
+
onUpdateTabRailScrollState?: () => void;
|
|
21
|
+
}
|
|
22
|
+
declare const ProfileTabRail: React.FC<ProfileTabRailProps>;
|
|
23
|
+
export default ProfileTabRail;
|
|
@@ -6,6 +6,7 @@ export declare const isPendingEntityDeleteApproval: (entityApproval: any) => boo
|
|
|
6
6
|
export declare const getDeletedEntityFromApproval: (entityApproval: any) => any | undefined;
|
|
7
7
|
export declare const getPendingDeletedEntityFromApproval: (approvalData: any, entityId: string | undefined) => any | undefined;
|
|
8
8
|
export declare const getPendingDeletedEntitiesForReverseProperty: (approvalData: any, sourceEntityId: string | undefined, property: string) => any[];
|
|
9
|
+
export declare const getPendingDeletedEntitiesForRemovedReferences: (approvalData: any, sourceEntityId: string | undefined, property: string, currentValue: any) => any[];
|
|
9
10
|
export declare const getDeletedEntityReviewTarget: (entityApproval: any) => {
|
|
10
11
|
entityId: string;
|
|
11
12
|
property: string;
|
|
@@ -16,11 +17,17 @@ export declare const getEntityApprovalRecords: (approvalData: any, entityId: str
|
|
|
16
17
|
export declare const getReferenceId: (value: any) => string | undefined;
|
|
17
18
|
export declare const getReferenceValues: (value: any) => any[];
|
|
18
19
|
export declare const getRemovedReferenceValues: (previousValue: any, currentValue: any) => any[];
|
|
20
|
+
export declare const getAddedReferenceValues: (previousValue: any, currentValue: any) => any[];
|
|
19
21
|
export declare const getPendingUnlinkedReferenceApprovals: (approvalData: any, sourceEntityId: string | undefined, property: string, currentValue: any) => Array<{
|
|
20
22
|
approvalRecord: any;
|
|
21
23
|
reference: any;
|
|
22
24
|
targetEntityId: string;
|
|
23
25
|
}>;
|
|
26
|
+
export declare const getPendingAddedReferenceApprovals: (approvalData: any, sourceEntityId: string | undefined, property: string, currentValue: any) => Array<{
|
|
27
|
+
approvalRecord: any;
|
|
28
|
+
reference: any;
|
|
29
|
+
targetEntityId: string;
|
|
30
|
+
}>;
|
|
24
31
|
export declare const getPendingEntityApprovalRecords: (approvalData: any, entityId: string | undefined) => any[];
|
|
25
32
|
export declare const getPendingEntityApprovalFieldCount: (approvalData: any, entityId: string | undefined) => number;
|
|
26
33
|
export declare const getPendingApprovalEntities: (approvalData: any) => any[];
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare const DEFAULT_TAB_PANE_WIDTH = 240;
|
|
2
|
+
export declare const ICON_TAB_PANE_WIDTH = 80;
|
|
3
|
+
export declare const MIN_LABEL_TAB_PANE_WIDTH = 100;
|
|
4
|
+
export declare const MAX_LABEL_TAB_PANE_WIDTH = 250;
|
|
5
|
+
export declare const getProfileTabKey: (tab: any) => string;
|
|
6
|
+
export declare const isProfileTab: (tab: any) => boolean;
|
|
7
|
+
export declare const findAddedProfileTab: (tabs: any[], previousTabKeys: Set<string>) => any;
|
|
8
|
+
export declare const isAboutTab: (tab: any) => boolean;
|
|
9
|
+
export declare const tabContainsProperty: (tab: any, property: string) => boolean;
|
|
10
|
+
export declare const findTabForProperty: (tabs: any[], property: string) => any;
|
|
11
|
+
export declare const clampLabelTabPaneWidth: (width: number) => number;
|
|
12
|
+
export declare const readPendingAddedProfileTabKeys: (entityId: string) => string[] | null;
|
|
13
|
+
export declare const writePendingAddedProfileTabKeys: (entityId: string, tabKeys: string[]) => void;
|
|
14
|
+
export declare const clearPendingAddedProfileTabKeys: (entityId: string) => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
interface UseEntityMutationHandlersOptions {
|
|
2
|
+
entity: any;
|
|
3
|
+
contextEntity: any;
|
|
4
|
+
crateManager: any;
|
|
5
|
+
approvalContext: any;
|
|
6
|
+
state: any;
|
|
7
|
+
onLoadEntityWithContext: (params: {
|
|
8
|
+
id: string;
|
|
9
|
+
updateState?: boolean;
|
|
10
|
+
}) => void;
|
|
11
|
+
refresh: () => void;
|
|
12
|
+
saveCratePreservingView: () => void;
|
|
13
|
+
notifySave: (property: string) => void;
|
|
14
|
+
onWarning: () => void;
|
|
15
|
+
onError: () => void;
|
|
16
|
+
}
|
|
17
|
+
declare const useEntityMutationHandlers: ({ entity, contextEntity, crateManager, approvalContext, state, onLoadEntityWithContext, refresh, saveCratePreservingView, notifySave, onWarning, onError, }: UseEntityMutationHandlersOptions) => {
|
|
18
|
+
handleAcceptAiEntityUnlink: (data: {
|
|
19
|
+
sourceEntityId: string;
|
|
20
|
+
property: string;
|
|
21
|
+
targetEntityId: string;
|
|
22
|
+
}) => void;
|
|
23
|
+
handleCreateEntity: (data: any) => any;
|
|
24
|
+
handleCreateProperty: (data: {
|
|
25
|
+
property: string;
|
|
26
|
+
value: any;
|
|
27
|
+
}) => void;
|
|
28
|
+
handleDeleteEntity: (data: {
|
|
29
|
+
id: string;
|
|
30
|
+
}) => void;
|
|
31
|
+
handleDeleteProperty: (data: {
|
|
32
|
+
property: string;
|
|
33
|
+
idx: number;
|
|
34
|
+
}) => void;
|
|
35
|
+
handleLinkEntity: (data: any) => void;
|
|
36
|
+
handleRejectAiEntityUnlink: (data: {
|
|
37
|
+
sourceEntityId: string;
|
|
38
|
+
property: string;
|
|
39
|
+
targetEntityId: string;
|
|
40
|
+
}) => void;
|
|
41
|
+
handleUnlinkEntity: (data: {
|
|
42
|
+
property: string;
|
|
43
|
+
tgtEntityId: string;
|
|
44
|
+
}) => void;
|
|
45
|
+
handleUpdateContext: (context: any) => void;
|
|
46
|
+
handleUpdateEntity: (data: {
|
|
47
|
+
property: string;
|
|
48
|
+
value: any;
|
|
49
|
+
}) => void;
|
|
50
|
+
};
|
|
51
|
+
export default useEntityMutationHandlers;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { MutableRefObject, RefObject } from 'react';
|
|
2
|
+
interface UseEntityNavigationStateOptions {
|
|
3
|
+
activeTab: string;
|
|
4
|
+
activeContentRef: RefObject<HTMLDivElement>;
|
|
5
|
+
contextEntity: any;
|
|
6
|
+
state: any;
|
|
7
|
+
restoreInProgressRef: MutableRefObject<boolean>;
|
|
8
|
+
showAddPanel: boolean;
|
|
9
|
+
reverseSidebarVisible: boolean;
|
|
10
|
+
highlightRequiredProperties: boolean;
|
|
11
|
+
iconView: boolean;
|
|
12
|
+
tabPaneWidth: number;
|
|
13
|
+
onSaveCrate: () => void;
|
|
14
|
+
debugScroll?: (...args: any[]) => void;
|
|
15
|
+
}
|
|
16
|
+
declare const useEntityNavigationState: ({ activeTab, activeContentRef, contextEntity, state, restoreInProgressRef, showAddPanel, reverseSidebarVisible, highlightRequiredProperties, iconView, tabPaneWidth, onSaveCrate, debugScroll, }: UseEntityNavigationStateOptions) => {
|
|
17
|
+
captureCurrentViewContext: (tabName?: string) => void;
|
|
18
|
+
captureViewContext: (tabName?: string, explicitScrollTop?: number) => void;
|
|
19
|
+
saveCratePreservingView: () => void;
|
|
20
|
+
saveTabToState: (tabName: string) => void;
|
|
21
|
+
};
|
|
22
|
+
export default useEntityNavigationState;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { Dispatch, MutableRefObject, RefObject, SetStateAction } from 'react';
|
|
2
|
+
export interface PendingAddedProperty {
|
|
3
|
+
entityId: string;
|
|
4
|
+
property: string;
|
|
5
|
+
tabName?: string;
|
|
6
|
+
}
|
|
7
|
+
interface UseEntityScrollRestorationOptions {
|
|
8
|
+
activeTab: string;
|
|
9
|
+
activeContentRef: RefObject<HTMLDivElement>;
|
|
10
|
+
contextEntity: any;
|
|
11
|
+
renderTabs: boolean;
|
|
12
|
+
tabsLength: number;
|
|
13
|
+
extraPropertiesLength: number;
|
|
14
|
+
scrollRestoreNonce: number;
|
|
15
|
+
setScrollRestoreNonce: Dispatch<SetStateAction<number>>;
|
|
16
|
+
navigationRestoreReadyRef: MutableRefObject<boolean>;
|
|
17
|
+
pendingRestoredTabRef: MutableRefObject<string | null>;
|
|
18
|
+
restoreInProgressRef: MutableRefObject<boolean>;
|
|
19
|
+
pendingAddedPropertyRef: MutableRefObject<PendingAddedProperty | null>;
|
|
20
|
+
showAddPanel: boolean;
|
|
21
|
+
reverseSidebarVisible: boolean;
|
|
22
|
+
highlightRequiredProperties: boolean;
|
|
23
|
+
iconView: boolean;
|
|
24
|
+
tabPaneWidth: number;
|
|
25
|
+
state: any;
|
|
26
|
+
isAiScrollRestoreSuppressed: () => boolean;
|
|
27
|
+
captureViewContext: (tabName?: string, explicitScrollTop?: number) => void;
|
|
28
|
+
debugScroll?: (...args: any[]) => void;
|
|
29
|
+
}
|
|
30
|
+
declare const useEntityScrollRestoration: ({ activeTab, activeContentRef, contextEntity, renderTabs, tabsLength, extraPropertiesLength, scrollRestoreNonce, setScrollRestoreNonce, navigationRestoreReadyRef, pendingRestoredTabRef, restoreInProgressRef, pendingAddedPropertyRef, showAddPanel, reverseSidebarVisible, highlightRequiredProperties, iconView, tabPaneWidth, state, isAiScrollRestoreSuppressed, captureViewContext, debugScroll, }: UseEntityScrollRestorationOptions) => void;
|
|
31
|
+
export default useEntityScrollRestoration;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
interface UseScrollViewportHeightOptions {
|
|
2
|
+
activeTab: string;
|
|
3
|
+
renderTabs: boolean;
|
|
4
|
+
tabsLength: number;
|
|
5
|
+
entityId?: string;
|
|
6
|
+
reverseSidebarVisible: boolean;
|
|
7
|
+
}
|
|
8
|
+
declare const useScrollViewportHeight: ({ activeTab, renderTabs, tabsLength, entityId, reverseSidebarVisible, }: UseScrollViewportHeightOptions) => {
|
|
9
|
+
activeContentRef: import('react').RefObject<HTMLDivElement>;
|
|
10
|
+
contentContainerRef: import('react').RefObject<HTMLDivElement>;
|
|
11
|
+
scrollViewportHeight: number;
|
|
12
|
+
};
|
|
13
|
+
export default useScrollViewportHeight;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
interface UseTabRailScrollStateOptions {
|
|
2
|
+
activeTab: string;
|
|
3
|
+
iconView: boolean;
|
|
4
|
+
renderTabs: boolean;
|
|
5
|
+
scrollViewportHeight: number;
|
|
6
|
+
tabPaneWidth: number;
|
|
7
|
+
tabsLength: number;
|
|
8
|
+
}
|
|
9
|
+
declare const useTabRailScrollState: ({ activeTab, iconView, renderTabs, scrollViewportHeight, tabPaneWidth, tabsLength, }: UseTabRailScrollStateOptions) => {
|
|
10
|
+
scrollTabRail: (direction: "up" | "down") => void;
|
|
11
|
+
tabRailListRef: import('react').RefObject<HTMLDivElement>;
|
|
12
|
+
tabRailScrollState: {
|
|
13
|
+
canScrollUp: boolean;
|
|
14
|
+
canScrollDown: boolean;
|
|
15
|
+
};
|
|
16
|
+
updateTabRailScrollState: () => void;
|
|
17
|
+
};
|
|
18
|
+
export default useTabRailScrollState;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { default as React, JSX } from 'react';
|
|
2
2
|
import { CrateManagerType, ProfileManagerType } from './types';
|
|
3
3
|
type RoCrateApprovalDecision = "accept" | "reject" | "manual-edit";
|
|
4
|
-
export interface
|
|
4
|
+
export interface RecrateCrateBuilderProps {
|
|
5
5
|
crate?: CrateManagerType["crate"];
|
|
6
6
|
roCrateApproval?: any;
|
|
7
7
|
profile?: ProfileManagerType["profile"];
|
|
@@ -55,5 +55,5 @@ export declare const ProfileManagerContext: React.Context<any>;
|
|
|
55
55
|
export declare const CrateManagerContext: React.Context<any>;
|
|
56
56
|
export declare const RoCrateApprovalContext: React.Context<any>;
|
|
57
57
|
export declare const LookupsContext: React.Context<any>;
|
|
58
|
-
export declare function
|
|
59
|
-
export default
|
|
58
|
+
export declare function RecrateCrateBuilder(props: RecrateCrateBuilderProps): JSX.Element;
|
|
59
|
+
export default RecrateCrateBuilder;
|
|
@@ -35,6 +35,9 @@ export declare class EditorState {
|
|
|
35
35
|
private normaliseScopeKey;
|
|
36
36
|
private hydrate;
|
|
37
37
|
private persist;
|
|
38
|
+
private cloneNavigationState;
|
|
39
|
+
private mergeNavigationState;
|
|
40
|
+
private latestEntryForId;
|
|
38
41
|
clearPersistedState(): void;
|
|
39
42
|
dispose(options?: {
|
|
40
43
|
clearPersistedState?: boolean;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -72,6 +72,12 @@ declare namespace en {
|
|
|
72
72
|
let create_new_entity: string;
|
|
73
73
|
let select_a_type_to_add: string;
|
|
74
74
|
let add_profile_button_tooltip: string;
|
|
75
|
+
let add_profile_button_aria: string;
|
|
76
|
+
let profile_actions_aria: string;
|
|
77
|
+
let profile_sections_aria: string;
|
|
78
|
+
let remove_profile_aria: string;
|
|
79
|
+
let scroll_profile_tabs_up: string;
|
|
80
|
+
let scroll_profile_tabs_down: string;
|
|
75
81
|
let switch_to_icon_view: string;
|
|
76
82
|
let switch_to_label_view: string;
|
|
77
83
|
let select_a_class_to_add: string;
|
|
@@ -156,6 +162,7 @@ declare namespace en {
|
|
|
156
162
|
let ai_hide_unlink_diff_aria: string;
|
|
157
163
|
let ai_show_unlink_diff_aria: string;
|
|
158
164
|
let ai_entity_was_added_by_ai: string;
|
|
165
|
+
let quick_filter_settings: string;
|
|
159
166
|
let quick_filter_settings_aria: string;
|
|
160
167
|
let field_display_settings_aria: string;
|
|
161
168
|
let hide_field_help: string;
|
|
@@ -72,6 +72,12 @@ declare namespace hu {
|
|
|
72
72
|
let create_new_entity: string;
|
|
73
73
|
let select_a_type_to_add: string;
|
|
74
74
|
let add_profile_button_tooltip: string;
|
|
75
|
+
let add_profile_button_aria: string;
|
|
76
|
+
let profile_actions_aria: string;
|
|
77
|
+
let profile_sections_aria: string;
|
|
78
|
+
let remove_profile_aria: string;
|
|
79
|
+
let scroll_profile_tabs_up: string;
|
|
80
|
+
let scroll_profile_tabs_down: string;
|
|
75
81
|
let switch_to_icon_view: string;
|
|
76
82
|
let switch_to_label_view: string;
|
|
77
83
|
let select_a_class_to_add: string;
|
|
@@ -156,6 +162,7 @@ declare namespace hu {
|
|
|
156
162
|
let ai_hide_unlink_diff_aria: string;
|
|
157
163
|
let ai_show_unlink_diff_aria: string;
|
|
158
164
|
let ai_entity_was_added_by_ai: string;
|
|
165
|
+
let quick_filter_settings: string;
|
|
159
166
|
let quick_filter_settings_aria: string;
|
|
160
167
|
let field_display_settings_aria: string;
|
|
161
168
|
let hide_field_help: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { default as
|
|
1
|
+
import { default as RecrateCrateBuilder } from './crate-builder/Shell';
|
|
2
2
|
export type { JSONObject } from './types';
|
|
3
|
-
export type {
|
|
4
|
-
export {
|
|
5
|
-
export default
|
|
3
|
+
export type { RecrateCrateBuilderProps } from './types';
|
|
4
|
+
export { RecrateCrateBuilder } from './crate-builder/Shell';
|
|
5
|
+
export default RecrateCrateBuilder;
|