@epam/ai-dial-publish-panel 1.4.0-dev.12 → 1.4.0-dev.122
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/components/PublishDependenciesList/PublishDependenciesList.d.ts +10 -0
- package/components/PublishDependenciesList/PublishDependenciesList.d.ts.map +1 -0
- package/components/PublishFoldersTree/PublishFoldersTree.d.ts.map +1 -1
- package/components/PublishPanel/PublishFooter.d.ts.map +1 -1
- package/components/PublishPanel/PublishPanel.d.ts +47 -9
- package/components/PublishPanel/PublishPanel.d.ts.map +1 -1
- package/components/PublishPanel/StandalonePublishPanel.d.ts +20 -7
- package/components/PublishPanel/StandalonePublishPanel.d.ts.map +1 -1
- package/components/SaveToFolderPanel/SaveToFolderPanel.d.ts.map +1 -1
- package/components/VersionHistorySection/VersionHistorySection.d.ts +5 -0
- package/components/VersionHistorySection/VersionHistorySection.d.ts.map +1 -0
- package/constants/public-class-names.d.ts +6 -0
- package/constants/public-class-names.d.ts.map +1 -1
- package/index.css +2 -2
- package/index.d.ts +8 -0
- package/index.d.ts.map +1 -1
- package/index.js +1186 -843
- package/models/publish-dependencies-list.d.ts +68 -0
- package/models/publish-dependencies-list.d.ts.map +1 -0
- package/models/publish-dependency.d.ts +30 -0
- package/models/publish-dependency.d.ts.map +1 -0
- package/models/publish-folders-tree.d.ts +4 -0
- package/models/publish-folders-tree.d.ts.map +1 -1
- package/models/publish-panel-styles.d.ts +3 -0
- package/models/publish-panel-styles.d.ts.map +1 -1
- package/models/publish.d.ts +6 -0
- package/models/publish.d.ts.map +1 -1
- package/models/save-to-folder-panel.d.ts +9 -0
- package/models/save-to-folder-panel.d.ts.map +1 -1
- package/models/version-history.d.ts +92 -0
- package/models/version-history.d.ts.map +1 -0
- package/package.json +3 -3
- package/utils/publish-folder-tree.d.ts +4 -2
- package/utils/publish-folder-tree.d.ts.map +1 -1
- package/utils/publish-state.d.ts.map +1 -1
- package/utils/use-publish-flow.d.ts +32 -1
- package/utils/use-publish-flow.d.ts.map +1 -1
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { CSSProperties } from 'react';
|
|
2
|
+
import { PublishDependency, PublishDependencyType } from './publish-dependency';
|
|
3
|
+
/**
|
|
4
|
+
* How the dependencies section is presented. The host picks it: a host that
|
|
5
|
+
* only warns about the dependencies keeps the default `Warning`, a host that
|
|
6
|
+
* publishes them together with the item says so with `Published`, which swaps
|
|
7
|
+
* the warning banner for a plain caption and lays the rows out as an icon next
|
|
8
|
+
* to the type label over the name.
|
|
9
|
+
*/
|
|
10
|
+
export declare enum PublishDependenciesAppearance {
|
|
11
|
+
Warning = "warning",
|
|
12
|
+
Published = "published"
|
|
13
|
+
}
|
|
14
|
+
/** Text overrides for the private-dependencies section. */
|
|
15
|
+
export interface PublishDependenciesLabels {
|
|
16
|
+
/** Section heading. Default: `'Private dependencies'`. */
|
|
17
|
+
title?: string;
|
|
18
|
+
/** Text under the heading: why a private dependency matters, or that the dependencies are published with the item; the host names the published entity in it. Default: a generic warning about "this item". */
|
|
19
|
+
description?: string;
|
|
20
|
+
/** How the section is presented. Default: `PublishDependenciesAppearance.Warning`. */
|
|
21
|
+
appearance?: PublishDependenciesAppearance;
|
|
22
|
+
/** Label per kind of dependency. Defaults: `'Application'`, `'Toolset'`, `'Prompt'`, `'Skill'`, `'File'`. */
|
|
23
|
+
typeLabels?: Partial<Record<PublishDependencyType, string>>;
|
|
24
|
+
/** Text announced to screen readers when the section appears or its count changes; receives the count. */
|
|
25
|
+
getAnnouncement?: (count: number) => string;
|
|
26
|
+
}
|
|
27
|
+
/** Color overrides for the private-dependencies section. */
|
|
28
|
+
export interface PublishDependenciesColors {
|
|
29
|
+
/** Heading text color. Defaults to `--text-primary`. */
|
|
30
|
+
headingText?: string;
|
|
31
|
+
/** Dependency name text color. Defaults to `--text-primary`. */
|
|
32
|
+
nameText?: string;
|
|
33
|
+
/** Type, version and location text color. Defaults to `--text-secondary`. */
|
|
34
|
+
metaText?: string;
|
|
35
|
+
/** Caption text color under the heading, in the `Published` appearance. Defaults to `--text-secondary`. */
|
|
36
|
+
captionText?: string;
|
|
37
|
+
/** Type label color above each name, in the `Published` appearance. Defaults to `--text-accent-tertiary`. */
|
|
38
|
+
typeText?: string;
|
|
39
|
+
/** Divider color between rows, in the `Published` appearance. Defaults to `--stroke-tertiary`. */
|
|
40
|
+
divider?: string;
|
|
41
|
+
}
|
|
42
|
+
/** Style overrides for the private-dependencies section. */
|
|
43
|
+
export interface PublishDependenciesStyles {
|
|
44
|
+
/** Color overrides for the section. */
|
|
45
|
+
colors?: PublishDependenciesColors;
|
|
46
|
+
/** Additional CSS custom properties applied to the section root. */
|
|
47
|
+
cssVars?: CSSProperties;
|
|
48
|
+
}
|
|
49
|
+
/** Props for `PublishDependenciesList`. */
|
|
50
|
+
export interface PublishDependenciesListProps {
|
|
51
|
+
/** Dependencies to list. The list is hidden while this is empty. */
|
|
52
|
+
dependencies: PublishDependency[];
|
|
53
|
+
/** Text overrides. */
|
|
54
|
+
labels?: PublishDependenciesLabels;
|
|
55
|
+
/** Typography class for the heading. Default: `'dial-body-semi-text'`. */
|
|
56
|
+
headingClassName?: string;
|
|
57
|
+
/** Typography class for each dependency name. Default: `'dial-small-semi-text'`, or `'dial-body-semi-text'` in the `Published` appearance. */
|
|
58
|
+
nameClassName?: string;
|
|
59
|
+
/** Typography class for each dependency's type, version and location. Default: `'dial-small-text'`. */
|
|
60
|
+
metaClassName?: string;
|
|
61
|
+
/** Typography class for the caption under the heading, in the `Published` appearance. Default: `'dial-tiny-text'`. */
|
|
62
|
+
captionClassName?: string;
|
|
63
|
+
/** Typography class for the type label above each name, in the `Published` appearance. Default: `'dial-tiny-lead-semi-text'`, which also upper-cases it. */
|
|
64
|
+
typeClassName?: string;
|
|
65
|
+
/** Style overrides. */
|
|
66
|
+
styles?: PublishDependenciesStyles;
|
|
67
|
+
}
|
|
68
|
+
//# sourceMappingURL=publish-dependencies-list.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"publish-dependencies-list.d.ts","sourceRoot":"","sources":["../../src/models/publish-dependencies-list.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,KAAK,EACV,iBAAiB,EACjB,qBAAqB,EACtB,MAAM,sBAAsB,CAAC;AAE9B;;;;;;GAMG;AACH,oBAAY,6BAA6B;IACvC,OAAO,YAAY;IACnB,SAAS,cAAc;CACxB;AAED,2DAA2D;AAC3D,MAAM,WAAW,yBAAyB;IACxC,0DAA0D;IAC1D,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,+MAA+M;IAC/M,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,sFAAsF;IACtF,UAAU,CAAC,EAAE,6BAA6B,CAAC;IAC3C,6GAA6G;IAC7G,UAAU,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,qBAAqB,EAAE,MAAM,CAAC,CAAC,CAAC;IAC5D,0GAA0G;IAC1G,eAAe,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;CAC7C;AAED,4DAA4D;AAC5D,MAAM,WAAW,yBAAyB;IACxC,wDAAwD;IACxD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,gEAAgE;IAChE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,6EAA6E;IAC7E,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,2GAA2G;IAC3G,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,6GAA6G;IAC7G,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,kGAAkG;IAClG,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,4DAA4D;AAC5D,MAAM,WAAW,yBAAyB;IACxC,uCAAuC;IACvC,MAAM,CAAC,EAAE,yBAAyB,CAAC;IACnC,oEAAoE;IACpE,OAAO,CAAC,EAAE,aAAa,CAAC;CACzB;AAED,2CAA2C;AAC3C,MAAM,WAAW,4BAA4B;IAC3C,oEAAoE;IACpE,YAAY,EAAE,iBAAiB,EAAE,CAAC;IAClC,sBAAsB;IACtB,MAAM,CAAC,EAAE,yBAAyB,CAAC;IACnC,0EAA0E;IAC1E,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,8IAA8I;IAC9I,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,uGAAuG;IACvG,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,sHAAsH;IACtH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,4JAA4J;IAC5J,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,uBAAuB;IACvB,MAAM,CAAC,EAAE,yBAAyB,CAAC;CACpC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/** Kinds of resource a publish dependency can be. */
|
|
2
|
+
export declare enum PublishDependencyType {
|
|
3
|
+
Application = "application",
|
|
4
|
+
Toolset = "toolset",
|
|
5
|
+
Prompt = "prompt",
|
|
6
|
+
Skill = "skill",
|
|
7
|
+
File = "file"
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* A resource the item being published refers to that is not in the public
|
|
11
|
+
* bucket, so the published copy may not work for the people it is shared with
|
|
12
|
+
* until this resource is published too.
|
|
13
|
+
*/
|
|
14
|
+
export interface PublishDependency {
|
|
15
|
+
/** Unique key of the dependency, normally its resource url. */
|
|
16
|
+
id: string;
|
|
17
|
+
/** Display name of the dependency. */
|
|
18
|
+
name: string;
|
|
19
|
+
/** Version, when the dependency is versioned. */
|
|
20
|
+
version?: string;
|
|
21
|
+
/** What kind of resource it is. */
|
|
22
|
+
type: PublishDependencyType;
|
|
23
|
+
/** Already-resolved icon URL of the dependency, when the host has one; without it the row shows the name's initials (a file shows its file-type icon instead). */
|
|
24
|
+
iconUrl?: string;
|
|
25
|
+
/** Whether a `File` dependency is a folder, which gets the folder icon instead of a file-type icon. */
|
|
26
|
+
isFolder?: boolean;
|
|
27
|
+
/** Folder path the dependency sits in, inside its owner's bucket; empty at the bucket root. */
|
|
28
|
+
location: string;
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=publish-dependency.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"publish-dependency.d.ts","sourceRoot":"","sources":["../../src/models/publish-dependency.ts"],"names":[],"mappings":"AAAA,qDAAqD;AACrD,oBAAY,qBAAqB;IAC/B,WAAW,gBAAgB;IAC3B,OAAO,YAAY;IACnB,MAAM,WAAW;IACjB,KAAK,UAAU;IACf,IAAI,SAAS;CACd;AAED;;;;GAIG;AACH,MAAM,WAAW,iBAAiB;IAChC,+DAA+D;IAC/D,EAAE,EAAE,MAAM,CAAC;IACX,sCAAsC;IACtC,IAAI,EAAE,MAAM,CAAC;IACb,iDAAiD;IACjD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,mCAAmC;IACnC,IAAI,EAAE,qBAAqB,CAAC;IAC5B,kKAAkK;IAClK,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,uGAAuG;IACvG,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,+FAA+F;IAC/F,QAAQ,EAAE,MAAM,CAAC;CAClB"}
|
|
@@ -35,6 +35,8 @@ export interface PublishFoldersTreeProps {
|
|
|
35
35
|
onCreateDestinationFolder?: (rootKey: string, parentPath: string[], name: string) => Promise<void>;
|
|
36
36
|
/** Host-owned search query used to filter the tree. */
|
|
37
37
|
searchQuery: string;
|
|
38
|
+
/** Reason a folder is unavailable as a destination; a non-empty string disables that row (`aria-disabled`, tooltip, accessible description, no selection) while it stays focusable and expandable, and no folder is created under it. `rootKey` is `''` in single-root mode. The whole-tree `disabled` wins. Without it, or while it returns `undefined`, nothing changes. */
|
|
39
|
+
getDisabledReason?: (destination: FolderDestination) => string | undefined;
|
|
38
40
|
/** Disables every control. Defaults to `false`. */
|
|
39
41
|
disabled?: boolean;
|
|
40
42
|
/** Label for the folder-creation trigger. Defaults to `'Create new folder'`. */
|
|
@@ -55,6 +57,8 @@ export interface PublishFoldersTreeProps {
|
|
|
55
57
|
invalidFolderNameError?: string;
|
|
56
58
|
/** Validation message for a duplicate folder name. Defaults to `'A folder with this name already exists.'`. */
|
|
57
59
|
duplicateFolderNameError?: string;
|
|
60
|
+
/** Validation message for a new folder named like its parent folder. Defaults to `'A folder cannot have the same name as its parent folder.'`. */
|
|
61
|
+
sameAsParentFolderNameError?: string;
|
|
58
62
|
/** Label for the selectable bucket root of the single-root tree. Ignored when `roots` is set. Defaults to `'Organization'`. */
|
|
59
63
|
rootLabel?: string;
|
|
60
64
|
/** Externally controlled expanded folder path keys of the single-root tree; use `FolderDestinationRoot.expandedPaths` in multi-root mode. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"publish-folders-tree.d.ts","sourceRoot":"","sources":["../../src/models/publish-folders-tree.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,KAAK,EACV,iBAAiB,EACjB,qBAAqB,EACtB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAEnD,+DAA+D;AAC/D,MAAM,WAAW,wBAAwB;IACvC,yFAAyF;IACzF,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,+DAA+D;AAC/D,MAAM,WAAW,wBAAwB;IACvC,uBAAuB;IACvB,MAAM,CAAC,EAAE,wBAAwB,CAAC;IAClC,2DAA2D;IAC3D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,sEAAsE;IACtE,OAAO,CAAC,EAAE,aAAa,CAAC;CACzB;AAED,qDAAqD;AACrD,MAAM,WAAW,uBAAuB;IACtC,sGAAsG;IACtG,KAAK,CAAC,EAAE,iBAAiB,EAAE,CAAC;IAC5B,+JAA+J;IAC/J,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,4EAA4E;IAC5E,oBAAoB,CAAC,EAAE,CA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IACpD,qBAAqB,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,CAAC,MAAM,CAAC,KAAK,IAAI,CAAC;IACrD,iJAAiJ;IACjJ,YAAY,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAC3B,uBAAuB;IACvB,MAAM,CAAC,EAAE,wBAAwB,CAAC;CACnC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { CSSProperties } from 'react';
|
|
2
2
|
import { PublishAccessRulesStyles } from './publish-access-rules-styles';
|
|
3
|
+
import { PublishDependenciesStyles } from './publish-dependencies-list';
|
|
3
4
|
import { PublishFoldersTreeStyles } from './publish-folders-tree';
|
|
4
5
|
/** Color overrides for the publish panel body. */
|
|
5
6
|
export interface PublishPanelColors {
|
|
@@ -22,6 +23,8 @@ export interface PublishPanelStyles {
|
|
|
22
23
|
folderTree?: PublishFoldersTreeStyles;
|
|
23
24
|
/** Style overrides forwarded to the access-rules section. */
|
|
24
25
|
accessRules?: PublishAccessRulesStyles;
|
|
26
|
+
/** Style overrides forwarded to the private-dependencies section. */
|
|
27
|
+
dependencies?: PublishDependenciesStyles;
|
|
25
28
|
/** Additional CSS custom properties applied to the panel body root. */
|
|
26
29
|
cssVars?: CSSProperties;
|
|
27
30
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"publish-panel-styles.d.ts","sourceRoot":"","sources":["../../src/models/publish-panel-styles.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AAC9E,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AAEvE,kDAAkD;AAClD,MAAM,WAAW,kBAAkB;IACjC,iEAAiE;IACjE,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,qEAAqE;IACrE,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,sEAA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AC,EAAE,wBAAwB,CAAC;IACvC,qEAAqE;IACrE,YAAY,CAAC,EAAE,yBAAyB,CAAC;IACzC,uEAAuE;IACvE,OAAO,CAAC,EAAE,aAAa,CAAC;CACzB"}
|
package/models/publish.d.ts
CHANGED
|
@@ -76,6 +76,8 @@ export declare enum PublishCalloutKind {
|
|
|
76
76
|
Info = "info",
|
|
77
77
|
/** Warning callout — publishing will replace an existing version in this folder. */
|
|
78
78
|
ReplaceWarning = "replaceWarning",
|
|
79
|
+
/** Warning callout — another resource already holds the published path in this folder, so publishing would be rejected. */
|
|
80
|
+
TargetTaken = "targetTaken",
|
|
79
81
|
/** Error callout — the user lacks write access to the selected folder. */
|
|
80
82
|
NoAccess = "noAccess",
|
|
81
83
|
/** Error callout — the most recent submit attempt failed. */
|
|
@@ -97,6 +99,10 @@ export interface PublishDerivationInput {
|
|
|
97
99
|
isSubmitting: boolean;
|
|
98
100
|
/** Whether the most recent submit attempt failed. */
|
|
99
101
|
hasSubmitError: boolean;
|
|
102
|
+
/** Whether the host found another resource at the published path in the selected folder. Default `false`. */
|
|
103
|
+
isTargetTaken?: boolean;
|
|
104
|
+
/** Whether the host's check of the published path is still running. Default `false`. */
|
|
105
|
+
isTargetChecking?: boolean;
|
|
100
106
|
/**
|
|
101
107
|
* Whether resubmitting when `hasExistingPublicationInFolder` is true is
|
|
102
108
|
* allowed (the host's backend overwrites the existing publication) or
|
package/models/publish.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"publish.d.ts","sourceRoot":"","sources":["../../src/models/publish.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAEnE,mEAAmE;AACnE,MAAM,WAAW,iBAAiB;IAChC,yFAAyF;IACzF,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,2DAA2D;IAC3D,IAAI,EAAE,MAAM,CAAC;IACb,6BAA6B;IAC7B,QAAQ,CAAC,EAAE,iBA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AED;;;;GAIG;AACH,MAAM,WAAW,eAAe;IAC9B,oEAAoE;IACpE,MAAM,EAAE,MAAM,CAAC;IACf,mDAAmD;IACnD,QAAQ,EAAE,uBAAuB,CAAC;IAClC,+EAA+E;IAC/E,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB;AAED,oFAAoF;AACpF,oBAAY,kBAAkB;IAC5B,kEAAkE;IAClE,IAAI,SAAS;IACb,uEAAuE;IACvE,IAAI,SAAS;IACb,oFAAoF;IACpF,cAAc,mBAAmB;IACjC,2HAA2H;IAC3H,WAAW,gBAAgB;IAC3B,0EAA0E;IAC1E,QAAQ,aAAa;IACrB,6DAA6D;IAC7D,WAAW,gBAAgB;CAC5B;AAED,iFAAiF;AACjF,MAAM,WAAW,sBAAsB;IACrC,0DAA0D;IAC1D,iBAAiB,EAAE,OAAO,CAAC;IAC3B;;;;OAIG;IACH,8BAA8B,EAAE,OAAO,CAAC;IACxC,mEAAmE;IACnE,cAAc,EAAE,OAAO,CAAC;IACxB,wDAAwD;IACxD,YAAY,EAAE,OAAO,CAAC;IACtB,qDAAqD;IACrD,cAAc,EAAE,OAAO,CAAC;IACxB,6GAA6G;IAC7G,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,wFAAwF;IACxF,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B;;;;;OAKG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB;AAED,yDAAyD;AACzD,MAAM,WAAW,mBAAmB;IAClC,8DAA8D;IAC9D,WAAW,EAAE,kBAAkB,CAAC;IAChC,6CAA6C;IAC7C,gBAAgB,EAAE,OAAO,CAAC;IAC1B,uEAAuE;IACvE,eAAe,EAAE,OAAO,CAAC;CAC1B"}
|
|
@@ -5,6 +5,7 @@ import { FolderDestination, FolderDestinationRoot } from './folder-destination';
|
|
|
5
5
|
import { PublicationRule, PublishResourceSummary } from './publish';
|
|
6
6
|
import { PublishAccessRulesStyles } from './publish-access-rules-styles';
|
|
7
7
|
import { PublishFoldersTreeStyles } from './publish-folders-tree';
|
|
8
|
+
import { VersionHistorySectionProps } from './version-history';
|
|
8
9
|
/** Text overrides for the body of the save-to-folder panel. */
|
|
9
10
|
export interface SaveToFolderPanelLabels {
|
|
10
11
|
/** Heading of the destination section. Defaults to `'Save to folder'`. */
|
|
@@ -43,6 +44,8 @@ export interface SaveToFolderPanelLabels {
|
|
|
43
44
|
createFolderInvalidNameError?: string;
|
|
44
45
|
/** Inline error for a new folder name that duplicates a sibling. */
|
|
45
46
|
createFolderDuplicateNameError?: string;
|
|
47
|
+
/** Inline error for a new folder named like its parent folder. */
|
|
48
|
+
createFolderSameAsParentNameError?: string;
|
|
46
49
|
/** Label of the action that retries a failed folder listing. Defaults to `'Retry'`. */
|
|
47
50
|
retryLabel?: string;
|
|
48
51
|
}
|
|
@@ -99,6 +102,8 @@ export interface SaveToFolderAccessRulesProps {
|
|
|
99
102
|
labels?: PublishAccessRulesLabels;
|
|
100
103
|
/** Style overrides for the rules section. */
|
|
101
104
|
styles?: PublishAccessRulesStyles;
|
|
105
|
+
/** Returns `true` for a destination that takes no rules, which hides the section while it is selected. Omit to show the section for every folder of a root with `hasAccessRules`. */
|
|
106
|
+
isHiddenFor?: (destination: FolderDestination) => boolean;
|
|
102
107
|
}
|
|
103
108
|
/** Props shared by the body and the standalone shell of the save-to-folder panel. */
|
|
104
109
|
export interface SaveToFolderPanelBaseProps {
|
|
@@ -110,12 +115,16 @@ export interface SaveToFolderPanelBaseProps {
|
|
|
110
115
|
destination: FolderDestination;
|
|
111
116
|
/** Called with the destination the user selected and confirmed in the folder tree. */
|
|
112
117
|
onDestinationChange: (destination: FolderDestination) => void;
|
|
118
|
+
/** Reason a folder is unavailable as a destination, or `undefined` when it is usable; forwarded to the folder tree, see `PublishFoldersTreeProps.getDisabledReason`. */
|
|
119
|
+
getDisabledReason?: (destination: FolderDestination) => string | undefined;
|
|
113
120
|
/** Called when a new folder name is confirmed under `rootKey` at `parentPath`. */
|
|
114
121
|
onCreateFolder: (rootKey: string, parentPath: string[], name: string) => Promise<void>;
|
|
115
122
|
/** Version choice; omit for an unversioned resource. */
|
|
116
123
|
version?: SaveToFolderVersionProps;
|
|
117
124
|
/** Access rules for a destination under a root with `hasAccessRules`; omit to hide the section. */
|
|
118
125
|
accessRules?: SaveToFolderAccessRulesProps;
|
|
126
|
+
/** Versions history shown as the last section of the main view; omit to hide the section. */
|
|
127
|
+
versionHistory?: VersionHistorySectionProps;
|
|
119
128
|
/** Whether a save is in flight; every control is disabled meanwhile. Defaults to `false`. */
|
|
120
129
|
isSubmitting?: boolean;
|
|
121
130
|
/** Error from the last save attempt, already translated; announced assertively. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"save-to-folder-panel.d.ts","sourceRoot":"","sources":["../../src/models/save-to-folder-panel.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAC3D,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,qDAAqD,CAAC;AACpG,OAAO,KAAK,EACV,gBAAgB,EAChB,eAAe,EAChB,MAAM,yBAAyB,CAAC;AACjC,OAAO,KAAK,EACV,iBAAiB,EACjB,qBAAqB,EACtB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,eAAe,EAAE,sBAAsB,EAAE,MAAM,WAAW,CAAC;AACzE,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AAC9E,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"save-to-folder-panel.d.ts","sourceRoot":"","sources":["../../src/models/save-to-folder-panel.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAC3D,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,qDAAqD,CAAC;AACpG,OAAO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iC;IAChD,8DAA8D;IAC9D,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,+DAA+D;IAC/D,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,yEAAyE;IACzE,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,4FAA4F;IAC5F,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,sFAAsF;IACtF,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,6DAA6D;IAC7D,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,oDAAoD;AACpD,MAAM,WAAW,gCAAiC,SAAQ,0BAA0B;IAClF,iCAAiC;IACjC,MAAM,EAAE,OAAO,CAAC;IAChB,gGAAgG;IAChG,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,2DAA2D;IAC3D,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,4FAA4F;IAC5F,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,mDAAmD;IACnD,cAAc,CAAC,EAAE,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC;IAC/C,oJAAoJ;IACpJ,0BAA0B,CAAC,EAAE,CAC3B,WAAW,EAAE,iBAAiB,GAAG,SAAS,KACvC,IAAI,CAAC;IACV,oCAAoC;IACpC,MAAM,CAAC,EAAE,iCAAiC,CAAC;IAC3C,qCAAqC;IACrC,MAAM,CAAC,EAAE,iCAAiC,CAAC;IAC3C,iFAAiF;IACjF,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB"}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { CSSProperties } from 'react';
|
|
2
|
+
/** Publication state of one saved version, as the host resolved it. */
|
|
3
|
+
export declare enum VersionHistoryStatus {
|
|
4
|
+
/** No live or pending publication of the version; the section draws no badge for it. */
|
|
5
|
+
NotPublished = "not-published",
|
|
6
|
+
/** A publication request of the version is waiting for an administrator. */
|
|
7
|
+
InReview = "in-review",
|
|
8
|
+
/** An approved publication of the version is live. */
|
|
9
|
+
Published = "published",
|
|
10
|
+
/** The state cannot be read, for a version the user does not own. */
|
|
11
|
+
Unknown = "unknown"
|
|
12
|
+
}
|
|
13
|
+
/** One saved version in the Versions history section. */
|
|
14
|
+
export interface VersionHistoryRow {
|
|
15
|
+
/** Stable identifier of the version, used as the list key. */
|
|
16
|
+
id: string;
|
|
17
|
+
/** Version text as the user knows it. */
|
|
18
|
+
version: string;
|
|
19
|
+
/** Publication state; omit while it is still loading. */
|
|
20
|
+
status?: VersionHistoryStatus;
|
|
21
|
+
/** Folder the version is saved in, already formatted by the host. */
|
|
22
|
+
folder?: string;
|
|
23
|
+
/** Last modified date, already formatted by the host. */
|
|
24
|
+
modifiedAt?: string;
|
|
25
|
+
/** Author line, already formatted and translated by the host. */
|
|
26
|
+
author?: string;
|
|
27
|
+
}
|
|
28
|
+
/** Text overrides for the Versions history section. */
|
|
29
|
+
export interface VersionHistoryLabels {
|
|
30
|
+
/** Section heading. Defaults to `'Versions history'`. */
|
|
31
|
+
heading?: string;
|
|
32
|
+
/** Status of a version with a request waiting for approval. Defaults to `'In review'`. */
|
|
33
|
+
inReviewLabel?: string;
|
|
34
|
+
/** Status badge of a published version. Defaults to `'Published'`. */
|
|
35
|
+
publishedLabel?: string;
|
|
36
|
+
/** Status of a version whose publication state cannot be read. Defaults to `'Status unavailable'`. */
|
|
37
|
+
unknownLabel?: string;
|
|
38
|
+
/** Message announced to screen readers while statuses load; a placeholder is drawn in each status slot. Defaults to `'Loading publication statuses…'`. */
|
|
39
|
+
loadingLabel?: string;
|
|
40
|
+
/** Message shown when the group lists no version. Defaults to `'No saved versions yet.'`. */
|
|
41
|
+
emptyLabel?: string;
|
|
42
|
+
/** Message shown and announced when the statuses request fails. Defaults to `'Could not load publication statuses.'`. */
|
|
43
|
+
errorLabel?: string;
|
|
44
|
+
/** Label of the action that reloads the statuses. Defaults to `'Retry'`. */
|
|
45
|
+
retryLabel?: string;
|
|
46
|
+
}
|
|
47
|
+
/** Color overrides for the Versions history section. */
|
|
48
|
+
export interface VersionHistoryColors {
|
|
49
|
+
/** Heading text color. Defaults to `--text-primary`. */
|
|
50
|
+
headingText?: string;
|
|
51
|
+
/** Version text color. Defaults to `--text-primary`. */
|
|
52
|
+
versionText?: string;
|
|
53
|
+
/** Last modified date text color. Defaults to `--text-primary`. */
|
|
54
|
+
dateText?: string;
|
|
55
|
+
/** Folder and author text color. Defaults to `--text-secondary`. */
|
|
56
|
+
metaText?: string;
|
|
57
|
+
/** Fill of the status placeholder shown while statuses load. Defaults to `--bg-control-disable-primary`. */
|
|
58
|
+
skeleton?: string;
|
|
59
|
+
/** Border color between rows. Defaults to `--stroke-tertiary`. */
|
|
60
|
+
rowBorder?: string;
|
|
61
|
+
}
|
|
62
|
+
/** Style overrides for the Versions history section. */
|
|
63
|
+
export interface VersionHistoryStyles {
|
|
64
|
+
/** Color overrides. */
|
|
65
|
+
colors?: VersionHistoryColors;
|
|
66
|
+
/** Additional CSS custom properties applied to the section root. */
|
|
67
|
+
cssVars?: CSSProperties;
|
|
68
|
+
}
|
|
69
|
+
/** Props for `VersionHistorySection`; the Save and Publish panels take the same object as `versionHistory`. */
|
|
70
|
+
export interface VersionHistorySectionProps {
|
|
71
|
+
/** Saved versions in display order; the host sorts them. */
|
|
72
|
+
rows: VersionHistoryRow[];
|
|
73
|
+
/** Whether the statuses are still loading. Defaults to `false`. */
|
|
74
|
+
isLoading?: boolean;
|
|
75
|
+
/** Whether the statuses request failed; the rows stay visible. Defaults to `false`. */
|
|
76
|
+
hasError?: boolean;
|
|
77
|
+
/** Called when the user retries a failed statuses request. */
|
|
78
|
+
onRetry?: () => void;
|
|
79
|
+
/** Text overrides. */
|
|
80
|
+
labels?: VersionHistoryLabels;
|
|
81
|
+
/** Typography class of the heading. Defaults to `'dial-body-semi-text'`. */
|
|
82
|
+
headingClassName?: string;
|
|
83
|
+
/** Typography class of each version. Defaults to `'dial-small-semi-text'`. */
|
|
84
|
+
versionClassName?: string;
|
|
85
|
+
/** Typography class of the last modified date. Defaults to `'dial-small-text'`. */
|
|
86
|
+
dateClassName?: string;
|
|
87
|
+
/** Typography class of the folder and author lines. Defaults to `'dial-tiny-text'`. */
|
|
88
|
+
metaClassName?: string;
|
|
89
|
+
/** Style overrides. */
|
|
90
|
+
styles?: VersionHistoryStyles;
|
|
91
|
+
}
|
|
92
|
+
//# sourceMappingURL=version-history.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version-history.d.ts","sourceRoot":"","sources":["../../src/models/version-history.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAE3C,uEAAuE;AACvE,oBAAY,oBAAoB;IAC9B,wFAAwF;IACxF,YAAY,kBAAkB;IAC9B,4EAA4E;IAC5E,QAAQ,cAAc;IACtB,sDAAsD;IACtD,SAAS,cAAc;IACvB,qEAAqE;IACrE,OAAO,YAAY;CACpB;AAED,yDAAyD;AACzD,MAAM,WAAW,iBAAiB;IAChC,8DAA8D;IAC9D,EAAE,EAAE,MAAM,CAAC;IACX,yCAAyC;IACzC,OAAO,EAAE,MAAM,CAAC;IAChB,yDAAyD;IACzD,MAAM,CAAC,EAAE,oBAAoB,CAAC;IAC9B,qEAAqE;IACrE,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,yDAAyD;IACzD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,iEAAiE;IACjE,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,uDAAuD;AACvD,MAAM,WAAW,oBAAoB;IACnC,yDAAyD;IACzD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,0FAA0F;IAC1F,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,sEAAsE;IACtE,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,sGAAsG;IACtG,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,0JAA0J;IAC1J,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,6FAA6F;IAC7F,UAAU,CA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GED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@epam/ai-dial-publish-panel",
|
|
3
3
|
"description": "Publish-to-folder UI and state flow shared by catalog entity publish and conversation publish",
|
|
4
|
-
"version": "1.4.0-dev.
|
|
4
|
+
"version": "1.4.0-dev.122",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"sideEffects": [
|
|
@@ -25,9 +25,9 @@
|
|
|
25
25
|
},
|
|
26
26
|
"peerDependencies": {
|
|
27
27
|
"react": "^19.2.8",
|
|
28
|
-
"@epam/ai-dial-chat-shared": "1.4.0-dev.
|
|
28
|
+
"@epam/ai-dial-chat-shared": "1.4.0-dev.122",
|
|
29
29
|
"@epam/ai-dial-ui-kit": "^0.16.0",
|
|
30
|
-
"@epam/ai-dial-react-file-manager": "^0.4.
|
|
30
|
+
"@epam/ai-dial-react-file-manager": "^0.4.3"
|
|
31
31
|
},
|
|
32
32
|
"repository": {
|
|
33
33
|
"type": "git",
|
|
@@ -32,9 +32,11 @@ export interface FolderNameValidationMessages {
|
|
|
32
32
|
invalid: string;
|
|
33
33
|
/** Shown when a sibling folder already has this name (case-insensitive). */
|
|
34
34
|
duplicate: string;
|
|
35
|
+
/** Shown when the name equals the parent folder's name (case-insensitive). Falls back to `duplicate`. */
|
|
36
|
+
sameAsParent?: string;
|
|
35
37
|
}
|
|
36
|
-
/** Returns an error message from `messages`, or `null` when `rawValue` is a valid
|
|
37
|
-
export declare const validateFolderName: (rawValue: string, siblingNames: string[], messages: FolderNameValidationMessages) => string | null;
|
|
38
|
+
/** Returns an error message from `messages`, or `null` when `rawValue` is a valid folder name for the publish destination tree: not a duplicate of a sibling and not the name of its parent folder (`parentName`, omitted for a root). */
|
|
39
|
+
export declare const validateFolderName: (rawValue: string, siblingNames: string[], messages: FolderNameValidationMessages, parentName?: string) => string | null;
|
|
38
40
|
/** Returns `baseName` if no sibling already has that name, otherwise appends a number suffix (`2`, `3`, …) until the name is free. */
|
|
39
41
|
export declare const getUniqueFolderName: (baseName: string, siblingNames: string[]) => string;
|
|
40
42
|
/** Names of the direct children of the folder at `parentPath` (root siblings when empty). */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"publish-folder-tree.d.ts","sourceRoot":"","sources":["../../src/utils/publish-folder-tree.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAoB,MAAM,sBAAsB,CAAC;AAClE,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAEtD;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,GAC3B,OAAO,iBAAiB,EAAE,EAC1B,OAAO,MAAM,KACZ,iBAAiB,EAoBnB,CAAC;AASF,+GAA+G;AAC/G,eAAO,MAAM,cAAc,GACzB,OAAO,iBAAiB,EAAE,KACzB,iBAAiB,EAOf,CAAC;AAuCN;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,GAC3B,OAAO,iBAAiB,EAAE,EAC1B,OAAO,MAAM,EAAE,EAAE,KAChB,iBAAiB,EAIjB,CAAC;AAEJ,yEAAyE;AACzE,eAAO,MAAM,iBAAiB,GAAI,OAAO,iBAAiB,EAAE,KAAG,MAAM,EAIjE,CAAC;AAEL,gGAAgG;AAChG,eAAO,MAAM,eAAe,GAAI,MAAM,MAAM,EAAE,KAAG,MAAwB,CAAC;AAE1E,wFAAwF;AACxF,eAAO,MAAM,iBAAiB,GAAI,SAAS,MAAM,KAAG,MAAM,EACtB,CAAC;AAErC,uGAAuG;AACvG,eAAO,MAAM,oBAAoB,GAC/B,SAAS,MAAM,EACf,WAAW,MAAM,KAChB,MAAwD,CAAC;AAE5D,2FAA2F;AAC3F,eAAO,MAAM,cAAc,GAAI,OAAO,iBAAiB,EAAE,KAAG,QAAQ,EAUhE,CAAC;AAKL,uFAAuF;AACvF,MAAM,WAAW,4BAA4B;IAC3C,4CAA4C;IAC5C,KAAK,EAAE,MAAM,CAAC;IACd,kEAAkE;IAClE,OA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;IAClB,yGAAyG;IACzG,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,0OAA0O;AAC1O,eAAO,MAAM,kBAAkB,GAC7B,UAAU,MAAM,EAChB,cAAc,MAAM,EAAE,EACtB,UAAU,4BAA4B,EACtC,aAAa,MAAM,KAClB,MAAM,GAAG,IAiBX,CAAC;AAEF,sIAAsI;AACtI,eAAO,MAAM,mBAAmB,GAC9B,UAAU,MAAM,EAChB,cAAc,MAAM,EAAE,KACrB,MAYF,CAAC;AAEF,6FAA6F;AAC7F,eAAO,MAAM,qBAAqB,GAChC,OAAO,iBAAiB,EAAE,EAC1B,YAAY,MAAM,EAAE,KACnB,MAAM,EAoBR,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"publish-state.d.ts","sourceRoot":"","sources":["../../src/utils/publish-state.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,sBAAsB,EACtB,mBAAmB,EACpB,MAAM,mBAAmB,CAAC;AAE3B,8GAA8G;AAC9G,eAAO,MAAM,kBAAkB,GAC7B,OAAO,sBAAsB,KAC5B,
|
|
1
|
+
{"version":3,"file":"publish-state.d.ts","sourceRoot":"","sources":["../../src/utils/publish-state.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,sBAAsB,EACtB,mBAAmB,EACpB,MAAM,mBAAmB,CAAC;AAE3B,8GAA8G;AAC9G,eAAO,MAAM,kBAAkB,GAC7B,OAAO,sBAAsB,KAC5B,mBA8DF,CAAC"}
|
|
@@ -3,6 +3,8 @@ import { PublicationRule, PublishFolderNode, PublishHistoryEntry } from '../mode
|
|
|
3
3
|
export interface PublishFlowItem {
|
|
4
4
|
/** Version, when the item is versioned. `undefined` for unversioned resources. */
|
|
5
5
|
version?: string;
|
|
6
|
+
/** Identity of the item, when the host can show several items through one flow; a taken-target answer is never carried from one id to another. */
|
|
7
|
+
id?: string;
|
|
6
8
|
}
|
|
7
9
|
/** Options for {@link usePublishFlow}. */
|
|
8
10
|
export interface UsePublishFlowOptions<TItem extends PublishFlowItem> {
|
|
@@ -65,6 +67,27 @@ export interface UsePublishFlowOptions<TItem extends PublishFlowItem> {
|
|
|
65
67
|
* `setRules`.
|
|
66
68
|
*/
|
|
67
69
|
onFetchExistingRules?: (folderPath: string[]) => Promise<PublicationRule[]>;
|
|
70
|
+
/**
|
|
71
|
+
* Resolves whether another resource already holds the published path of
|
|
72
|
+
* `item` in a destination folder, so the panel can say so before submit.
|
|
73
|
+
* Called when the selected folder changes to a defined folder and when
|
|
74
|
+
* `item.version` changes while one is selected; never for a folder created
|
|
75
|
+
* in this session, nor for a folder where this item's own history already
|
|
76
|
+
* holds it. An answer that arrives after the folder or version changed again
|
|
77
|
+
* is discarded. A rejection leaves the target untaken and does not block
|
|
78
|
+
* submit: the backend's refusal on submit is the safety net. Omit to skip
|
|
79
|
+
* the check entirely.
|
|
80
|
+
*/
|
|
81
|
+
onCheckTargetExists?: (item: TItem, folderPath: string[]) => Promise<boolean>;
|
|
82
|
+
/**
|
|
83
|
+
* Tells whether the rejection of `onPublish` means the target is taken. When
|
|
84
|
+
* it returns `true` the hook marks the selected folder's target as taken
|
|
85
|
+
* instead of setting `hasSubmitError`, so the panel shows the same callout as
|
|
86
|
+
* after the check; `onPublishError` is still called. Must be synchronous: a
|
|
87
|
+
* host that learns the cause asynchronously converts the error inside its
|
|
88
|
+
* `onPublish` before rethrowing it.
|
|
89
|
+
*/
|
|
90
|
+
isTargetTakenError?: (error: unknown) => boolean;
|
|
68
91
|
}
|
|
69
92
|
/** State and handlers returned by {@link usePublishFlow}. */
|
|
70
93
|
export interface UsePublishFlowResult {
|
|
@@ -121,11 +144,19 @@ export interface UsePublishFlowResult {
|
|
|
121
144
|
publishCredentials: boolean;
|
|
122
145
|
/** Replaces the credentials opt-in. */
|
|
123
146
|
setPublishCredentials: (value: boolean) => void;
|
|
147
|
+
/**
|
|
148
|
+
* Whether another resource holds the published path in `selectedFolderPath`:
|
|
149
|
+
* `onCheckTargetExists` answered `true` for the current folder and version,
|
|
150
|
+
* or the last submit was rejected as a taken target.
|
|
151
|
+
*/
|
|
152
|
+
isTargetTaken: boolean;
|
|
153
|
+
/** Whether `onCheckTargetExists` is currently resolving for the selected folder and version. */
|
|
154
|
+
isTargetChecking: boolean;
|
|
124
155
|
/** Whether `onFetchExistingRules` is currently resolving for the selected folder. */
|
|
125
156
|
isRulesLoading: boolean;
|
|
126
157
|
/** Whether the most recent `onFetchExistingRules` call failed. `rules` is left unchanged when this is `true`. */
|
|
127
158
|
hasRulesLoadError: boolean;
|
|
128
159
|
}
|
|
129
160
|
/** Manages all state for the Publish flow: folder selection, local folder creation, existing-publication detection, and submit handling. */
|
|
130
|
-
export declare const usePublishFlow: <TItem extends PublishFlowItem = PublishFlowItem>({ item, history, folderItems: initialFolderItems, hasWriteAccess: resolveWriteAccess, defaultAuthor, onCreateFolder, onPublish, onPublishSuccess, onPublishError, onFetchExistingRules, }: UsePublishFlowOptions<TItem>) => UsePublishFlowResult;
|
|
161
|
+
export declare const usePublishFlow: <TItem extends PublishFlowItem = PublishFlowItem>({ item, history, folderItems: initialFolderItems, hasWriteAccess: resolveWriteAccess, defaultAuthor, onCreateFolder, onPublish, onPublishSuccess, onPublishError, onFetchExistingRules, onCheckTargetExists, isTargetTakenError, }: UsePublishFlowOptions<TItem>) => UsePublishFlowResult;
|
|
131
162
|
//# sourceMappingURL=use-publish-flow.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-publish-flow.d.ts","sourceRoot":"","sources":["../../src/utils/use-publish-flow.ts"],"names":[],"mappings":"AACA,OAAO,EACL,eAAe,EACf,iBAAiB,EACjB,mBAAmB,EACpB,MAAM,mBAAmB,CAAC;AAE3B,mGAAmG;AACnG,MAAM,WAAW,eAAe;IAC9B,kFAAkF;IAClF,OAAO,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"use-publish-flow.d.ts","sourceRoot":"","sources":["../../src/utils/use-publish-flow.ts"],"names":[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