@graphcore/react-kernel 0.0.0 → 0.1.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/LICENSE +202 -0
- package/NOTICE +2 -0
- package/dist/api/agentApi.d.ts +7 -0
- package/dist/api/entityApi.d.ts +37 -0
- package/dist/api/predicate.d.ts +37 -0
- package/dist/auth/oidc.d.ts +39 -0
- package/dist/components/Access/AccessPanel.d.ts +7 -0
- package/dist/components/Access/GroupView.d.ts +1 -0
- package/dist/components/Access/index.d.ts +5 -0
- package/dist/components/Access/useAccess.d.ts +42 -0
- package/dist/components/Admin/AdminPanel.d.ts +22 -0
- package/dist/components/Admin/index.d.ts +3 -0
- package/dist/components/Admin/useIsDeploymentAdmin.d.ts +2 -0
- package/dist/components/AgentMirror/AgentMirror.d.ts +15 -0
- package/dist/components/AgentMirror/index.d.ts +1 -0
- package/dist/components/Auth/AuthPage.d.ts +14 -0
- package/dist/components/Auth/index.d.ts +1 -0
- package/dist/components/Entity/BaseEntity.d.ts +6 -0
- package/dist/components/Entity/EntityRoute.d.ts +14 -0
- package/dist/components/Entity/index.d.ts +2 -0
- package/dist/components/Entity/renderGuard.d.ts +8 -0
- package/dist/components/Entity/types/UIHooks.d.ts +42 -0
- package/dist/components/Entity/types/index.d.ts +6 -0
- package/dist/components/Invite/InviteRoute.d.ts +20 -0
- package/dist/components/Invite/index.d.ts +2 -0
- package/dist/components/Routes/AppRoutes.d.ts +11 -0
- package/dist/components/Routes/GraphCoreApp.d.ts +11 -0
- package/dist/components/Routes/GraphCoreRouter.d.ts +28 -0
- package/dist/components/Routes/pageCollisions.d.ts +12 -0
- package/dist/components/TopBar/TopBar.d.ts +31 -0
- package/dist/components/ViewEntity/CompositeView/CompositeBox.d.ts +5 -0
- package/dist/components/ViewEntity/CompositeView/CompositeHBox.d.ts +2 -0
- package/dist/components/ViewEntity/CompositeView/CompositeTabs.d.ts +2 -0
- package/dist/components/ViewEntity/CompositeView/CompositeVBox.d.ts +2 -0
- package/dist/components/ViewEntity/CompositeView/index.d.ts +8 -0
- package/dist/components/ViewEntity/CompositeView/panels.d.ts +30 -0
- package/dist/components/ViewEntity/EntityAttributes/EntityAttributesView.d.ts +2 -0
- package/dist/components/ViewEntity/EntityAttributes/index.d.ts +2 -0
- package/dist/components/ViewEntity/EntityIDE/EntityExplorer.d.ts +29 -0
- package/dist/components/ViewEntity/EntityIDE/EntityIDE.d.ts +15 -0
- package/dist/components/ViewEntity/EntityIDE/index.d.ts +1 -0
- package/dist/components/ViewEntity/ListEntity/ListView.d.ts +6 -0
- package/dist/components/ViewEntity/ViewGallery/ViewGallery.d.ts +2 -0
- package/dist/components/common/EntityPicker.d.ts +15 -0
- package/dist/components/common/ErrorBoundary.d.ts +15 -0
- package/dist/components/common/ForbiddenGhost.d.ts +9 -0
- package/dist/components/common/Notification.d.ts +9 -0
- package/dist/components/common/ViewTypePicker.d.ts +10 -0
- package/dist/graphcore-react-kernel.cjs.js +3 -0
- package/dist/graphcore-react-kernel.es.js +7946 -0
- package/dist/hooks/useAuth.d.ts +14 -0
- package/dist/hooks/useEntities.d.ts +6 -0
- package/dist/hooks/useServerRoutes.d.ts +8 -0
- package/dist/hooks/useWebSocketConsumer.d.ts +15 -0
- package/dist/index.d.ts +2 -0
- package/dist/lib/GraphCoreProvider.d.ts +43 -0
- package/dist/lib/index.d.ts +57 -0
- package/dist/lib/runtimeConfig.d.ts +22 -0
- package/dist/pages/definePage.d.ts +31 -0
- package/dist/registry/EntityIcon.d.ts +12 -0
- package/dist/registry/baseViews.d.ts +2 -0
- package/dist/registry/entityTypeIds.d.ts +16 -0
- package/dist/registry/registry-context.d.ts +3 -0
- package/dist/registry/viewRegistry.d.ts +25 -0
- package/dist/setupTests.d.ts +1 -0
- package/dist/state/accessEvents.d.ts +4 -0
- package/dist/state/authStore.d.ts +14 -0
- package/dist/state/deploymentStore.d.ts +3 -0
- package/dist/state/entityGraph/entityAccessors.d.ts +8 -0
- package/dist/state/entityGraph/entityGraph.d.ts +7 -0
- package/dist/state/entityGraph/hooks.d.ts +5 -0
- package/dist/state/entityGraph/index.d.ts +5 -0
- package/dist/state/entityGraph/store.d.ts +14 -0
- package/dist/state/entityGraph/types.d.ts +47 -0
- package/dist/state/graphCoreBridge/StrategyError.d.ts +11 -0
- package/dist/state/graphCoreBridge/bridge-context.d.ts +4 -0
- package/dist/state/graphCoreBridge/bridge.d.ts +3 -0
- package/dist/state/graphCoreBridge/hooks.d.ts +4 -0
- package/dist/state/graphCoreBridge/statusStore.d.ts +4 -0
- package/dist/state/graphCoreBridge/types.d.ts +29 -0
- package/dist/state/notificationStore.d.ts +15 -0
- package/dist/state/registryDirectoryStore.d.ts +14 -0
- package/dist/state/resyncEvents.d.ts +6 -0
- package/dist/state/useEntityQuery.d.ts +23 -0
- package/dist/state/views/viewScopes.d.ts +11 -0
- package/dist/style.css +2 -0
- package/dist/utils/StrategyRequestBuilder.d.ts +198 -0
- package/dist/utils/dragDropInterface.d.ts +81 -0
- package/dist/utils/entityPath.d.ts +14 -0
- package/dist/views/EntityView.d.ts +15 -0
- package/dist/views/ViewContext.d.ts +13 -0
- package/dist/views/defineView.d.ts +45 -0
- package/dist/views/position.d.ts +24 -0
- package/dist/views/useEntityTypeIds.d.ts +2 -0
- package/dist/views/useViewState.d.ts +22 -0
- package/package.json +71 -5
- package/README.md +0 -3
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { ServerRoute } from '../../hooks/useServerRoutes';
|
|
3
|
+
/** One link in the top bar. */
|
|
4
|
+
export interface TopBarPlace {
|
|
5
|
+
to: string;
|
|
6
|
+
label: React.ReactNode;
|
|
7
|
+
}
|
|
8
|
+
export interface TopBarProps {
|
|
9
|
+
/** Shown at the left of the bar. */
|
|
10
|
+
title?: React.ReactNode;
|
|
11
|
+
/**
|
|
12
|
+
* The links beside the title. By default `/` and every server route that
|
|
13
|
+
* needs no entity; pass a list to replace them, a function to adjust the
|
|
14
|
+
* defaults, or `false` for none.
|
|
15
|
+
*/
|
|
16
|
+
places?: false | TopBarPlace[] | ((defaults: TopBarPlace[]) => TopBarPlace[]);
|
|
17
|
+
/** Additional CSS classes for the outer bar. */
|
|
18
|
+
className?: string;
|
|
19
|
+
/** Where the Admin item (shown to deployment administrators) points. */
|
|
20
|
+
adminHref?: string;
|
|
21
|
+
}
|
|
22
|
+
/** `/` as `home`, then each route without a parameter, labelled by its path. */
|
|
23
|
+
export declare function defaultPlaces(routes: ServerRoute[]): TopBarPlace[];
|
|
24
|
+
/**
|
|
25
|
+
* TopBar — the title, links to the deployment's places, and a user menu
|
|
26
|
+
* (copy the user entity ID, Admin for administrators, logout). Mount it once
|
|
27
|
+
* under the router, above the routed content; leave it out for a custom shell.
|
|
28
|
+
* Logout stays reachable here even if the rest of the screen fails to render.
|
|
29
|
+
*/
|
|
30
|
+
export declare const TopBar: React.FC<TopBarProps>;
|
|
31
|
+
export default TopBar;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Layout views. Each stores its panels (`{entityId, slot?}`) in its own view
|
|
3
|
+
* state and renders every panel as an `EntityView`, so a panel's view and
|
|
4
|
+
* state are stored one step below the composite's.
|
|
5
|
+
*/
|
|
6
|
+
export { CompositeHBox } from './CompositeHBox';
|
|
7
|
+
export { CompositeVBox } from './CompositeVBox';
|
|
8
|
+
export { CompositeTabs } from './CompositeTabs';
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export interface Panel {
|
|
3
|
+
entityId: string;
|
|
4
|
+
slot?: string;
|
|
5
|
+
}
|
|
6
|
+
export interface CompositeState {
|
|
7
|
+
panels: Panel[];
|
|
8
|
+
/** Flex weight per panel key; a missing key weighs 1. */
|
|
9
|
+
sizes: Record<string, number>;
|
|
10
|
+
[key: string]: any;
|
|
11
|
+
}
|
|
12
|
+
export declare const panelKey: (panel: Panel) => string;
|
|
13
|
+
/** A composite's panels in its view state, with add and remove. Removing a panel never deletes the entity. */
|
|
14
|
+
export declare function useCompositePanels<S extends CompositeState>(defaults: S): {
|
|
15
|
+
state: S;
|
|
16
|
+
update: import('../../../lib').ViewStateUpdate<S>;
|
|
17
|
+
panels: Panel[];
|
|
18
|
+
addPanel: (entityId: string) => Promise<{
|
|
19
|
+
view_entity_id?: string;
|
|
20
|
+
}>;
|
|
21
|
+
removePanel: (key: string) => Promise<{
|
|
22
|
+
view_entity_id?: string;
|
|
23
|
+
}>;
|
|
24
|
+
};
|
|
25
|
+
export declare function AddPanelControl({ onPick }: {
|
|
26
|
+
onPick: (entityId: string) => void;
|
|
27
|
+
}): React.JSX.Element;
|
|
28
|
+
export declare function RemovePanelButton({ onClick }: {
|
|
29
|
+
onClick: (event: React.MouseEvent) => void;
|
|
30
|
+
}): React.JSX.Element;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { UIHooksProps } from '../../Entity';
|
|
2
|
+
/**
|
|
3
|
+
* Ported from v1's `ComposableDesktop/EntityExplorer` (kept as a standalone
|
|
4
|
+
* tree/search component there despite the folder name — no window-management
|
|
5
|
+
* dependency). Snapshot, snapshot-import, and free-text search were dropped:
|
|
6
|
+
* they depend on `SerializeEntityGraph`/`QueryEntities`,
|
|
7
|
+
* which aren't part of the v2 backend kernel yet (see
|
|
8
|
+
* `utils/StrategyRequestBuilder.js`'s file header). Add them back here once
|
|
9
|
+
* those strategies are ported.
|
|
10
|
+
*/
|
|
11
|
+
interface EntityExplorerProps extends UIHooksProps {
|
|
12
|
+
className?: string;
|
|
13
|
+
onEntityDelete?: (entityId: string) => void;
|
|
14
|
+
/** Direct callbacks — take precedence over the same hooks in uiHooks */
|
|
15
|
+
onEntityOpen?: (entityId: string) => void;
|
|
16
|
+
onEntitySelect?: (entityId: string) => void;
|
|
17
|
+
onEntityPin?: (entityId: string) => void;
|
|
18
|
+
explorerConfig?: {
|
|
19
|
+
filter_entity_types?: string[];
|
|
20
|
+
allow_create?: boolean;
|
|
21
|
+
title?: string;
|
|
22
|
+
show_delete_action?: boolean;
|
|
23
|
+
show_create_child_action?: boolean;
|
|
24
|
+
group_by_entity_type?: boolean;
|
|
25
|
+
reveal_entity_id?: string;
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
export declare const EntityExplorer: import('../../../lib').DefinedView<EntityExplorerProps>;
|
|
29
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { UIHooks } from '../../Entity';
|
|
2
|
+
export interface EntityIDESidebarConfig {
|
|
3
|
+
filter_entity_types?: string[];
|
|
4
|
+
allow_create?: boolean;
|
|
5
|
+
show_delete_action?: boolean;
|
|
6
|
+
show_create_child_action?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export interface EntityIDEProps {
|
|
9
|
+
sidebarConfig?: EntityIDESidebarConfig;
|
|
10
|
+
rootEntityId?: string;
|
|
11
|
+
explorerTitle?: string;
|
|
12
|
+
uiHooks?: UIHooks;
|
|
13
|
+
}
|
|
14
|
+
export declare const EntityIDE: import('../../../lib').DefinedView<EntityIDEProps>;
|
|
15
|
+
export default EntityIDE;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { EntityIDE, default } from './EntityIDE';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { ViewProps } from '../../../views/defineView';
|
|
3
|
+
/** The children of `entityId` as a reorderable list; an item opens in a modal. */
|
|
4
|
+
export declare function ListViewComponent({ entityId }: ViewProps): React.JSX.Element;
|
|
5
|
+
export declare const ListView: import('../../../lib').DefinedView<{}>;
|
|
6
|
+
export default ListView;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export type EntityPickerProps = {
|
|
2
|
+
typeIds: string[];
|
|
3
|
+
onPick: (entity: any) => void;
|
|
4
|
+
exclude?: string[];
|
|
5
|
+
labelFor?: (entity: any) => string;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
placeholder?: string;
|
|
8
|
+
className?: string;
|
|
9
|
+
autoFocus?: boolean;
|
|
10
|
+
/** Where the result list opens relative to the input. */
|
|
11
|
+
listPlacement?: 'above' | 'below';
|
|
12
|
+
};
|
|
13
|
+
/** Searchable, cursor-paginated list of entities. Pages load on scroll, and
|
|
14
|
+
* while a search has fewer than a page of matches. Search is client-side. */
|
|
15
|
+
export declare function EntityPicker({ typeIds, onPick, exclude, labelFor, disabled, placeholder, className, autoFocus, listPlacement, }: EntityPickerProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export default ErrorBoundary;
|
|
3
|
+
declare class ErrorBoundary extends React.Component<any, any, any> {
|
|
4
|
+
static getDerivedStateFromError(error: any): {
|
|
5
|
+
hasError: boolean;
|
|
6
|
+
error: any;
|
|
7
|
+
};
|
|
8
|
+
constructor(props: any);
|
|
9
|
+
state: {
|
|
10
|
+
hasError: boolean;
|
|
11
|
+
error: any;
|
|
12
|
+
};
|
|
13
|
+
componentDidCatch(error: any, errorInfo: any): void;
|
|
14
|
+
render(): any;
|
|
15
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Opaque placeholder rendered when the current user lacks read permission for
|
|
4
|
+
* an entity or its source data entity. Intentionally distinct from loading /
|
|
5
|
+
* "not connected" states so the user knows the entity exists but is private.
|
|
6
|
+
*/
|
|
7
|
+
export default function ForbiddenGhost({ className }: {
|
|
8
|
+
className?: string;
|
|
9
|
+
}): React.JSX.Element;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Renders whatever was last passed to setNotification (auth errors, failed
|
|
4
|
+
* awaited strategy requests, etc). Mounted automatically by GraphCoreProvider
|
|
5
|
+
* so notifications are never silently dropped — partners don't need to wire
|
|
6
|
+
* this up themselves.
|
|
7
|
+
*/
|
|
8
|
+
export declare const Notification: React.FC;
|
|
9
|
+
export default Notification;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export default ViewTypePicker;
|
|
3
|
+
declare function ViewTypePicker({ availableViewTypes, selectedValue, onSelect, theme, placeholder, autoFocus, }: {
|
|
4
|
+
availableViewTypes: any;
|
|
5
|
+
selectedValue: any;
|
|
6
|
+
onSelect: any;
|
|
7
|
+
theme?: string;
|
|
8
|
+
placeholder?: string;
|
|
9
|
+
autoFocus?: boolean;
|
|
10
|
+
}): React.JSX.Element;
|