@evenicanpm/portal-editor-ui 1.4.1 → 1.5.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.
Files changed (35) hide show
  1. package/{src/editor.tsx → dist/editor.d.ts} +10 -14
  2. package/dist/features/editor/components/column-list/column-card/column-card-options.d.ts +9 -0
  3. package/dist/features/editor/components/column-list/column-card/column-card-title.d.ts +4 -0
  4. package/dist/features/editor/components/column-list/column-card/column-card.d.ts +8 -0
  5. package/dist/features/editor/components/column-list/column-card/drag-handle.d.ts +6 -0
  6. package/dist/features/editor/components/column-list/column-card/editable-label.d.ts +11 -0
  7. package/dist/features/editor/components/column-list/column-list-section.d.ts +12 -0
  8. package/dist/features/editor/components/column-list/column-list-skeleton.d.ts +1 -0
  9. package/dist/features/editor/components/column-list/column-list-state.d.ts +33 -0
  10. package/dist/features/editor/components/column-list/column-list-title.d.ts +5 -0
  11. package/dist/features/editor/components/column-list/column-list.d.ts +8 -0
  12. package/dist/features/editor/components/editor-dms-card.d.ts +14 -0
  13. package/dist/features/editor/components/editor-tabs.d.ts +13 -0
  14. package/dist/features/editor/components/editor.d.ts +28 -0
  15. package/{src/index.ts → dist/index.d.ts} +0 -1
  16. package/dist/tsconfig.tsbuildinfo +1 -0
  17. package/package.json +6 -3
  18. package/src/features/editor/components/column-list/column-card/column-card-options.tsx +0 -48
  19. package/src/features/editor/components/column-list/column-card/column-card-title.tsx +0 -13
  20. package/src/features/editor/components/column-list/column-card/column-card.tsx +0 -134
  21. package/src/features/editor/components/column-list/column-card/drag-handle.tsx +0 -32
  22. package/src/features/editor/components/column-list/column-card/editable-label.tsx +0 -132
  23. package/src/features/editor/components/column-list/column-list-section.tsx +0 -49
  24. package/src/features/editor/components/column-list/column-list-skeleton.tsx +0 -49
  25. package/src/features/editor/components/column-list/column-list-state.ts +0 -92
  26. package/src/features/editor/components/column-list/column-list-title.tsx +0 -18
  27. package/src/features/editor/components/column-list/column-list.tsx +0 -212
  28. package/src/features/editor/components/editor-dms-card.tsx +0 -79
  29. package/src/features/editor/components/editor-tabs.tsx +0 -42
  30. package/src/features/editor/components/editor.tsx +0 -62
  31. package/tsconfig.json +0 -28
  32. package/typedoc.json +0 -10
  33. /package/{src/features/editor/components/column-list/column-card/index.ts → dist/features/editor/components/column-list/column-card/index.d.ts} +0 -0
  34. /package/{src/features/editor/components/column-list/index.ts → dist/features/editor/components/column-list/index.d.ts} +0 -0
  35. /package/{src/features/editor/index.ts → dist/features/editor/index.d.ts} +0 -0
@@ -1,13 +1,11 @@
1
1
  import type { PropsWithChildren } from "react";
2
2
  import { Editor } from "./features/editor/components/editor";
3
-
4
3
  /**
5
4
  * Main Entry point properties into portal package
6
5
  *
7
6
  *
8
7
  */
9
8
  type PortalProps = {};
10
-
11
9
  /**
12
10
  * The main **e4Portal** entry point.
13
11
  * * This is a React Functional Component that provides the core context
@@ -18,17 +16,15 @@ type PortalProps = {};
18
16
  * @param props - The properties passed to the Portal component.
19
17
  * @returns A React Element rendering the main application structure.
20
18
  */
21
- const Portal = ({ children }: PropsWithChildren<PortalProps>) => {
22
- return <>{children}</>;
19
+ declare const Portal: {
20
+ ({ children }: PropsWithChildren<PortalProps>): import("react").JSX.Element;
21
+ /**
22
+ *
23
+ * # Feature: Editor
24
+ * This is the editor feature component.
25
+ * @params props
26
+ *
27
+ */
28
+ Editor: typeof Editor;
23
29
  };
24
-
25
- /**
26
- *
27
- * # Feature: Editor
28
- * This is the editor feature component.
29
- * @params props
30
- *
31
- */
32
- Portal.Editor = Editor;
33
-
34
30
  export { Portal, type PortalProps };
@@ -0,0 +1,9 @@
1
+ export type ColumnCardOptionsValue = {
2
+ isSortable: boolean;
3
+ isSearchable: boolean;
4
+ };
5
+ export type ColumnCardOptionsProps = {
6
+ value: ColumnCardOptionsValue;
7
+ onChange: (patch: Partial<ColumnCardOptionsValue>) => void;
8
+ };
9
+ export declare function ColumnCardOptions({ value, onChange, }: Readonly<ColumnCardOptionsProps>): import("react").JSX.Element;
@@ -0,0 +1,4 @@
1
+ export type ColumnCardTitleProps = {
2
+ value: string;
3
+ };
4
+ export declare function ColumnCardTitle({ value }: Readonly<ColumnCardTitleProps>): import("react").JSX.Element;
@@ -0,0 +1,8 @@
1
+ import type { Column } from "@evenicanpm/portal-types-schemas";
2
+ import * as React from "react";
3
+ export type ColumnCardProps = {
4
+ field: Column;
5
+ onChange: (id: string, patch: Partial<Column>) => void;
6
+ onRemove: (id: string) => void;
7
+ };
8
+ export declare function ColumnCard({ field, onChange, onRemove, }: Readonly<ColumnCardProps>): React.JSX.Element;
@@ -0,0 +1,6 @@
1
+ import type { DraggableAttributes, DraggableSyntheticListeners } from "@dnd-kit/core";
2
+ export type DragHandleProps = {
3
+ attributes: DraggableAttributes;
4
+ listeners?: DraggableSyntheticListeners;
5
+ };
6
+ export declare function DragHandle({ attributes, listeners, }: Readonly<DragHandleProps>): import("react").JSX.Element;
@@ -0,0 +1,11 @@
1
+ import * as React from "react";
2
+ export type EditableLabelProps = {
3
+ value: string;
4
+ onCommit: (next: string) => void;
5
+ labelPrefix?: string;
6
+ inputWidth?: {
7
+ xs: string | number;
8
+ sm: string | number;
9
+ };
10
+ };
11
+ export declare function EditableLabel({ value, onCommit, labelPrefix, inputWidth, }: Readonly<EditableLabelProps>): React.JSX.Element;
@@ -0,0 +1,12 @@
1
+ import type { EditorQueries } from "../editor";
2
+ interface ColumnProps {
3
+ currentResourceKey: string;
4
+ editorQueries: EditorQueries;
5
+ }
6
+ /**
7
+ * The view config column list section that handles
8
+ * fetching the initial view config data thats stored in the db
9
+ * and handles loading state skeleton view while data is pending
10
+ */
11
+ export declare function ColumnListSection({ currentResourceKey, editorQueries, }: Readonly<ColumnProps>): import("react").JSX.Element;
12
+ export {};
@@ -0,0 +1 @@
1
+ export declare function ColumnListSkeleton(): import("react").JSX.Element;
@@ -0,0 +1,33 @@
1
+ import type { Column } from "@evenicanpm/portal-types-schemas";
2
+ /**
3
+ * Reassigns sequential ColumnOrder values (1..n) to visible fields.
4
+ */
5
+ export declare function normalizeVisibleOrders(list: Column[]): Column[];
6
+ /**
7
+ * Returns fields that are currently visible (ColumnOrder not null),
8
+ * sorted by ColumnOrder.
9
+ */
10
+ export declare function getVisibleFields(fields: Column[]): Column[];
11
+ /**
12
+ * Returns fields that are currently removed (ColumnOrder null),
13
+ * sorted alphabetically by label or data key.
14
+ */
15
+ export declare function getRemovedFields(fields: Column[]): Column[];
16
+ /**
17
+ * Applies a partial update to a single field by id.
18
+ */
19
+ export declare function patchField(fields: Column[], id: string, patch: Partial<Column>): Column[];
20
+ /**
21
+ * Removes a field from the visible list by setting ColumnOrder to null
22
+ * and re-normalizes remaining visible fields.
23
+ */
24
+ export declare function removeField(fields: Column[], id: string): Column[];
25
+ /**
26
+ * Adds a previously removed field back to the end of the visible list
27
+ * and re-normalizes ordering.
28
+ */
29
+ export declare function addFieldToEnd(fields: Column[], id: string): Column[];
30
+ /**
31
+ * Reorders visible fields after a drag operation and updates ColumnOrder.
32
+ */
33
+ export declare function reorderVisibleFields(fields: Column[], activeId: string, overId: string, arrayMoveFn: <T>(array: T[], from: number, to: number) => T[]): Column[];
@@ -0,0 +1,5 @@
1
+ interface Props {
2
+ selectedResourceKey: string;
3
+ }
4
+ export declare function ColumnListTitle({ selectedResourceKey }: Readonly<Props>): import("react").JSX.Element;
5
+ export {};
@@ -0,0 +1,8 @@
1
+ import type { ViewConfig } from "@evenicanpm/portal-types-schemas";
2
+ import type { EditorQueries } from "../editor";
3
+ export type ColumnListProps = {
4
+ resourceKey: string;
5
+ initialState: ViewConfig;
6
+ editorQueries: EditorQueries;
7
+ };
8
+ export declare function ColumnList({ resourceKey, initialState, editorQueries, }: Readonly<ColumnListProps>): import("react").JSX.Element;
@@ -0,0 +1,14 @@
1
+ interface Props {
2
+ /** Currently selected resource */
3
+ selectedResourceKey: string;
4
+ /** A pojo with providers -> images */
5
+ providerImageMap: Record<string, string>;
6
+ /** A pojo with resources -> providers */
7
+ resourceProviderMap: Record<string, string>;
8
+ }
9
+ /**
10
+ * Editor view header contains provider details and other
11
+ * resource/view config data not related to the column list.
12
+ */
13
+ export declare function EditorDMSCard({ selectedResourceKey, providerImageMap, resourceProviderMap, }: Readonly<Props>): import("react").JSX.Element;
14
+ export {};
@@ -0,0 +1,13 @@
1
+ interface Props {
2
+ /** List of resource keys to select from */
3
+ resourceList: string[];
4
+ /** Currently selected key */
5
+ selectedResourceKey: string;
6
+ /** Action to take when resource changes. */
7
+ handleChangeResource: (id: string) => void;
8
+ }
9
+ /**
10
+ * Tab-based selection menu for resource keys on the editor page.
11
+ */
12
+ declare function EditorResourceTabs({ resourceList, selectedResourceKey, handleChangeResource, }: Readonly<Props>): import("react").JSX.Element;
13
+ export { EditorResourceTabs };
@@ -0,0 +1,28 @@
1
+ import type { ViewConfig } from "@evenicanpm/portal-types-schemas";
2
+ import type { QueryKey } from "@tanstack/react-query";
3
+ export type SaveInput = {
4
+ key: string;
5
+ viewConfig: ViewConfig;
6
+ };
7
+ export type ViewConfigQuery = (resourceKey: string) => {
8
+ queryKey: QueryKey;
9
+ queryFn: () => Promise<ViewConfig>;
10
+ };
11
+ export type SaveViewConfigMutation = (resourceKey: string) => {
12
+ mutationKey: QueryKey;
13
+ mutationFn: (input: SaveInput) => Promise<ViewConfig>;
14
+ };
15
+ export type EditorQueries = {
16
+ viewConfigQuery: ViewConfigQuery;
17
+ saveViewConfigMutation: SaveViewConfigMutation;
18
+ };
19
+ export interface EditorProps {
20
+ resourceList: string[];
21
+ providerMetaData: Record<string, string>;
22
+ resourceProviderMap: Record<string, string>;
23
+ editorQueries: EditorQueries;
24
+ }
25
+ /**
26
+ * Top-Level editor component.
27
+ */
28
+ export declare function Editor({ resourceList, providerMetaData, resourceProviderMap, editorQueries, }: Readonly<EditorProps>): import("react").JSX.Element;
@@ -1,3 +1,2 @@
1
1
  export { Portal, type PortalProps } from "./editor";
2
-
3
2
  export { Editor } from "./features/editor";