@dyrected/admin 2.6.0 → 2.6.1
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/admin.css +101 -4
- package/dist/components/forms/form-engine.d.ts +13 -2
- package/dist/components/workflow/WorkflowPanel.d.ts +8 -1
- package/dist/components/workflow/draft-live-compare-sheet.d.ts +6 -0
- package/dist/components/workflow/workflow-transition-controls.d.ts +60 -0
- package/dist/index.mjs +1501 -332
- package/dist/lib/draft-live-compare.d.ts +38 -0
- package/dist/lib/draft-live-compare.test.d.ts +1 -0
- package/dist/lib/workflow-autosave.d.ts +18 -0
- package/dist/lib/workflow-autosave.test.d.ts +1 -0
- package/dist/lib/workflow-ui.d.ts +21 -0
- package/dist/lib/workflow-ui.test.d.ts +1 -0
- package/package.json +4 -4
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { Field as FieldSchema } from '@dyrected/sdk';
|
|
2
|
+
export type CompareGroup = "Text changes" | "Media changes" | "Layout / sections changed" | "Settings changed";
|
|
3
|
+
export type CompareStatus = "Changed" | "Added" | "Removed";
|
|
4
|
+
export interface CompareCard {
|
|
5
|
+
id: string;
|
|
6
|
+
group: CompareGroup;
|
|
7
|
+
label: string;
|
|
8
|
+
status: CompareStatus;
|
|
9
|
+
path: string;
|
|
10
|
+
kind: "text" | "richText" | "media" | "array" | "setting";
|
|
11
|
+
liveValue: unknown;
|
|
12
|
+
draftValue: unknown;
|
|
13
|
+
liveText: string;
|
|
14
|
+
draftText: string;
|
|
15
|
+
liveMedia?: CompareMediaPreview | null;
|
|
16
|
+
draftMedia?: CompareMediaPreview | null;
|
|
17
|
+
}
|
|
18
|
+
export interface CompareMediaPreview {
|
|
19
|
+
url: string | null;
|
|
20
|
+
filename: string | null;
|
|
21
|
+
alt: string | null;
|
|
22
|
+
}
|
|
23
|
+
export interface DraftLiveComparison {
|
|
24
|
+
hasPublishedVersion: boolean;
|
|
25
|
+
hasChanges: boolean;
|
|
26
|
+
fieldChangeCount: number;
|
|
27
|
+
sectionsAdded: number;
|
|
28
|
+
sectionsRemoved: number;
|
|
29
|
+
groups: Array<{
|
|
30
|
+
title: CompareGroup;
|
|
31
|
+
cards: CompareCard[];
|
|
32
|
+
}>;
|
|
33
|
+
}
|
|
34
|
+
export declare function buildDraftLiveComparison(args: {
|
|
35
|
+
fields: FieldSchema[];
|
|
36
|
+
draft: Record<string, unknown> | null | undefined;
|
|
37
|
+
live: Record<string, unknown> | null | undefined;
|
|
38
|
+
}): DraftLiveComparison;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export declare const DEFAULT_WORKFLOW_AUTOSAVE_DELAY_MS = 1500;
|
|
2
|
+
type WorkflowAutosaveAdminConfig = {
|
|
3
|
+
autosave?: boolean;
|
|
4
|
+
autosaveDelayMs?: number;
|
|
5
|
+
} & Record<string, unknown>;
|
|
6
|
+
type WorkflowAutosaveCollectionLike = {
|
|
7
|
+
workflow?: unknown;
|
|
8
|
+
drafts?: boolean;
|
|
9
|
+
admin?: WorkflowAutosaveAdminConfig;
|
|
10
|
+
};
|
|
11
|
+
export type WorkflowAutosaveState = "idle" | "dirty" | "saving" | "saved" | "error" | "conflict";
|
|
12
|
+
export declare function isWorkflowEnabledCollection(collection?: WorkflowAutosaveCollectionLike | null): boolean;
|
|
13
|
+
export declare function resolveWorkflowAutosaveSettings(collection?: WorkflowAutosaveCollectionLike | null): {
|
|
14
|
+
enabled: boolean;
|
|
15
|
+
delayMs: number;
|
|
16
|
+
};
|
|
17
|
+
export declare function classifyWorkflowAutosaveError(error: unknown): Extract<WorkflowAutosaveState, "error" | "conflict">;
|
|
18
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { CollectionConfig, WorkflowConfig, WorkflowMetadata, WorkflowState, WorkflowTransition } from '@dyrected/core';
|
|
2
|
+
export type WorkflowDocumentLike = Record<string, unknown> & {
|
|
3
|
+
id?: string;
|
|
4
|
+
_workflow?: WorkflowMetadata | null;
|
|
5
|
+
};
|
|
6
|
+
export declare function resolveWorkflowState(workflowConfig: WorkflowConfig | null | undefined, workflowMeta: Pick<WorkflowMetadata, "state"> | null | undefined): WorkflowState | null;
|
|
7
|
+
export declare function resolveWorkflowStateFromDocument(workflowConfig: WorkflowConfig | null | undefined, item: WorkflowDocumentLike): WorkflowState | null;
|
|
8
|
+
export type PublishingStatusSummary = {
|
|
9
|
+
label: "Draft" | "Published" | "Changed";
|
|
10
|
+
color: "warning" | "success" | "info";
|
|
11
|
+
workflowStateLabel: string | null;
|
|
12
|
+
};
|
|
13
|
+
export declare function resolvePublishingStatus(schema: CollectionConfig | undefined, item: Record<string, unknown>): PublishingStatusSummary | null;
|
|
14
|
+
export declare function getAvailableWorkflowTransitions(workflowConfig: WorkflowConfig | null | undefined, workflowMeta: WorkflowMetadata | null | undefined): WorkflowTransition[];
|
|
15
|
+
export declare function getPrimaryWorkflowTransition(transitions: WorkflowTransition[]): WorkflowTransition | null;
|
|
16
|
+
export type GroupedWorkflowTransitions = {
|
|
17
|
+
normal: WorkflowTransition[];
|
|
18
|
+
unpublish: WorkflowTransition[];
|
|
19
|
+
};
|
|
20
|
+
export declare function groupWorkflowTransitions(transitions: WorkflowTransition[]): GroupedWorkflowTransitions;
|
|
21
|
+
export declare function getCommonWorkflowTransitions(workflowConfig: WorkflowConfig | null | undefined, docs: WorkflowDocumentLike[]): WorkflowTransition[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dyrected/admin",
|
|
3
|
-
"version": "2.6.
|
|
3
|
+
"version": "2.6.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist"
|
|
@@ -64,9 +64,9 @@
|
|
|
64
64
|
"tailwind-merge": "^3.5.0",
|
|
65
65
|
"tailwindcss-animate": "^1.0.7",
|
|
66
66
|
"zod": "^3.25.76",
|
|
67
|
-
"@dyrected/core": "^2.6.
|
|
68
|
-
"@dyrected/
|
|
69
|
-
"@dyrected/
|
|
67
|
+
"@dyrected/core": "^2.6.1",
|
|
68
|
+
"@dyrected/knowledge": "^0.2.15",
|
|
69
|
+
"@dyrected/sdk": "^2.6.1"
|
|
70
70
|
},
|
|
71
71
|
"peerDependencies": {
|
|
72
72
|
"@tanstack/react-query": "^5.0.0",
|