@epam/ai-dial-publish-panel 1.4.0-dev.96 → 1.4.0-rc.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.
Files changed (44) hide show
  1. package/components/PublishDependenciesList/PublishDependenciesList.d.ts.map +1 -1
  2. package/components/PublishPanel/PublishPanel.d.ts +35 -19
  3. package/components/PublishPanel/PublishPanel.d.ts.map +1 -1
  4. package/components/PublishPanel/StandalonePublishPanel.d.ts +10 -14
  5. package/components/PublishPanel/StandalonePublishPanel.d.ts.map +1 -1
  6. package/components/SaveToFolderPanel/StandaloneSaveToFolderPanel.d.ts.map +1 -1
  7. package/constants/publish-dependencies.d.ts +3 -0
  8. package/constants/publish-dependencies.d.ts.map +1 -0
  9. package/index.css +2 -2
  10. package/index.d.ts +5 -12
  11. package/index.d.ts.map +1 -1
  12. package/index.js +700 -1269
  13. package/models/folder-destination.d.ts +0 -2
  14. package/models/folder-destination.d.ts.map +1 -1
  15. package/models/publish-dependencies-list.d.ts +25 -2
  16. package/models/publish-dependencies-list.d.ts.map +1 -1
  17. package/models/publish-panel-styles.d.ts +4 -5
  18. package/models/publish-panel-styles.d.ts.map +1 -1
  19. package/models/publish.d.ts +6 -19
  20. package/models/publish.d.ts.map +1 -1
  21. package/models/save-to-folder-panel.d.ts +51 -89
  22. package/models/save-to-folder-panel.d.ts.map +1 -1
  23. package/package.json +4 -4
  24. package/types/publish-panel.d.ts +1 -1
  25. package/types/publish-panel.d.ts.map +1 -1
  26. package/types/save-to-folder.d.ts +0 -7
  27. package/types/save-to-folder.d.ts.map +1 -1
  28. package/utils/publish-state.d.ts.map +1 -1
  29. package/utils/use-publish-flow.d.ts +53 -26
  30. package/utils/use-publish-flow.d.ts.map +1 -1
  31. package/components/PublishAccessRuleEditor/PublishAccessRuleEditor.d.ts +0 -5
  32. package/components/PublishAccessRuleEditor/PublishAccessRuleEditor.d.ts.map +0 -1
  33. package/components/PublishAccessRules/PublishAccessRules.d.ts +0 -83
  34. package/components/PublishAccessRules/PublishAccessRules.d.ts.map +0 -1
  35. package/components/PublishFoldersTree/PublishFoldersTree.d.ts +0 -5
  36. package/components/PublishFoldersTree/PublishFoldersTree.d.ts.map +0 -1
  37. package/components/SaveToFolderPanel/SaveToFolderPanel.d.ts +0 -5
  38. package/components/SaveToFolderPanel/SaveToFolderPanel.d.ts.map +0 -1
  39. package/models/publish-access-rule-editor.d.ts +0 -79
  40. package/models/publish-access-rule-editor.d.ts.map +0 -1
  41. package/models/publish-access-rules-styles.d.ts +0 -25
  42. package/models/publish-access-rules-styles.d.ts.map +0 -1
  43. package/models/publish-folders-tree.d.ts +0 -73
  44. package/models/publish-folders-tree.d.ts.map +0 -1
@@ -22,7 +22,5 @@ export interface FolderDestinationRoot {
22
22
  onExpandedPathsChange?: (paths: Set<string>) => void;
23
23
  /** Folder path keys inside this root that the host is currently fetching. */
24
24
  loadingPaths?: Set<string>;
25
- /** Whether a folder under this root takes access rules, edited below the tree once selected. Defaults to `false`. */
26
- hasAccessRules?: boolean;
27
25
  }
28
26
  //# sourceMappingURL=folder-destination.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"folder-destination.d.ts","sourceRoot":"","sources":["../../src/models/folder-destination.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAEnD,gFAAgF;AAChF,MAAM,WAAW,iBAAiB;IAChC,4FAA4F;IAC5F,OAAO,EAAE,MAAM,CAAC;IAChB,sEAAsE;IACtE,IAAI,EAAE,MAAM,EAAE,CAAC;CAChB;AAED,qFAAqF;AACrF,MAAM,WAAW,qBAAqB;IACpC,+GAA+G;IAC/G,GAAG,EAAE,MAAM,CAAC;IACZ,qCAAqC;IACrC,KAAK,EAAE,MAAM,CAAC;IACd,mFAAmF;IACnF,KAAK,EAAE,iBAAiB,EAAE,CAAC;IAC3B,0EAA0E;IAC1E,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,+EAA+E;IAC/E,aAAa,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAC5B,8EAA8E;IAC9E,qBAAqB,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,CAAC,MAAM,CAAC,KAAK,IAAI,CAAC;IACrD,6EAA6E;IAC7E,YAAY,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAC3B,qHAAqH;IACrH,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B"}
1
+ {"version":3,"file":"folder-destination.d.ts","sourceRoot":"","sources":["../../src/models/folder-destination.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAEnD,gFAAgF;AAChF,MAAM,WAAW,iBAAiB;IAChC,4FAA4F;IAC5F,OAAO,EAAE,MAAM,CAAC;IAChB,sEAAsE;IACtE,IAAI,EAAE,MAAM,EAAE,CAAC;CAChB;AAED,qFAAqF;AACrF,MAAM,WAAW,qBAAqB;IACpC,+GAA+G;IAC/G,GAAG,EAAE,MAAM,CAAC;IACZ,qCAAqC;IACrC,KAAK,EAAE,MAAM,CAAC;IACd,mFAAmF;IACnF,KAAK,EAAE,iBAAiB,EAAE,CAAC;IAC3B,0EAA0E;IAC1E,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,+EAA+E;IAC/E,aAAa,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAC5B,8EAA8E;IAC9E,qBAAqB,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,CAAC,MAAM,CAAC,KAAK,IAAI,CAAC;IACrD,6EAA6E;IAC7E,YAAY,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;CAC5B"}
@@ -1,11 +1,24 @@
1
1
  import { CSSProperties } from 'react';
2
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
+ }
3
14
  /** Text overrides for the private-dependencies section. */
4
15
  export interface PublishDependenciesLabels {
5
16
  /** Section heading. Default: `'Private dependencies'`. */
6
17
  title?: string;
7
- /** Warning shown under the heading: why a private dependency matters; the host names the published entity in it. Default: a generic text about "this item". */
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". */
8
19
  description?: string;
20
+ /** How the section is presented. Default: `PublishDependenciesAppearance.Warning`. */
21
+ appearance?: PublishDependenciesAppearance;
9
22
  /** Label per kind of dependency. Defaults: `'Application'`, `'Toolset'`, `'Prompt'`, `'Skill'`, `'File'`. */
10
23
  typeLabels?: Partial<Record<PublishDependencyType, string>>;
11
24
  /** Text announced to screen readers when the section appears or its count changes; receives the count. */
@@ -19,6 +32,12 @@ export interface PublishDependenciesColors {
19
32
  nameText?: string;
20
33
  /** Type, version and location text color. Defaults to `--text-secondary`. */
21
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;
22
41
  }
23
42
  /** Style overrides for the private-dependencies section. */
24
43
  export interface PublishDependenciesStyles {
@@ -35,10 +54,14 @@ export interface PublishDependenciesListProps {
35
54
  labels?: PublishDependenciesLabels;
36
55
  /** Typography class for the heading. Default: `'dial-body-semi-text'`. */
37
56
  headingClassName?: string;
38
- /** Typography class for each dependency name. Default: `'dial-small-semi-text'`. */
57
+ /** Typography class for each dependency name. Default: `'dial-small-semi-text'`, or `'dial-body-semi-text'` in the `Published` appearance. */
39
58
  nameClassName?: string;
40
59
  /** Typography class for each dependency's type, version and location. Default: `'dial-small-text'`. */
41
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;
42
65
  /** Style overrides. */
43
66
  styles?: PublishDependenciesStyles;
44
67
  }
@@ -1 +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,2DAA2D;AAC3D,MAAM,WAAW,yBAAyB;IACxC,0DAA0D;IAC1D,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,+JAA+J;IAC/J,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,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;CACnB;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,oFAAoF;IACpF,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,uGAAuG;IACvG,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,uBAAuB;IACvB,MAAM,CAAC,EAAE,yBAAyB,CAAC;CACpC"}
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"}
@@ -1,7 +1,6 @@
1
+ import { FolderDestinationTreeStyles } from '@epam/ai-dial-react-file-manager';
1
2
  import { CSSProperties } from 'react';
2
- import { PublishAccessRulesStyles } from './publish-access-rules-styles';
3
3
  import { PublishDependenciesStyles } from './publish-dependencies-list';
4
- import { PublishFoldersTreeStyles } from './publish-folders-tree';
5
4
  /** Color overrides for the publish panel body. */
6
5
  export interface PublishPanelColors {
7
6
  /** Summary row border color. Defaults to `--stroke-tertiary`. */
@@ -14,15 +13,15 @@ export interface PublishPanelColors {
14
13
  headingText?: string;
15
14
  /** Destination folder path text color. Defaults to `--text-secondary`. */
16
15
  destinationText?: string;
16
+ /** Text color of the direct-write note. Defaults to `--text-secondary`. */
17
+ directNoteText?: string;
17
18
  }
18
19
  /** Style overrides for the publish panel body and its nested components. */
19
20
  export interface PublishPanelStyles {
20
21
  /** Color overrides for the panel body. */
21
22
  colors?: PublishPanelColors;
22
23
  /** Style overrides forwarded to the destination folder tree. */
23
- folderTree?: PublishFoldersTreeStyles;
24
- /** Style overrides forwarded to the access-rules section. */
25
- accessRules?: PublishAccessRulesStyles;
24
+ folderTree?: FolderDestinationTreeStyles;
26
25
  /** Style overrides forwarded to the private-dependencies section. */
27
26
  dependencies?: PublishDependenciesStyles;
28
27
  /** Additional CSS custom properties applied to the panel body root. */
@@ -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,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AAC7E,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,sEAAsE;IACtE,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,gEAAgE;IAChE,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,0EAA0E;IAC1E,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,4EAA4E;AAC5E,MAAM,WAAW,kBAAkB;IACjC,0CAA0C;IAC1C,MAAM,CAAC,EAAE,kBAAkB,CAAC;IAC5B,gEAAgE;IAChE,UAAU,CAAC,EAAE,wBAAwB,CAAC;IACtC,6DAA6D;IAC7D,WAAW,CAAC,EAAE,wBAAwB,CAAC;IACvC,qEAAqE;IACrE,YAAY,CAAC,EAAE,yBAAyB,CAAC;IACzC,uEAAuE;IACvE,OAAO,CAAC,EAAE,aAAa,CAAC;CACzB"}
1
+ {"version":3,"file":"publish-panel-styles.d.ts","sourceRoot":"","sources":["../../src/models/publish-panel-styles.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,kCAAkC,CAAC;AACpF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AAE7E,kDAAkD;AAClD,MAAM,WAAW,kBAAkB;IACjC,iEAAiE;IACjE,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,qEAAqE;IACrE,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,sEAAsE;IACtE,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,gEAAgE;IAChE,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,0EAA0E;IAC1E,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,2EAA2E;IAC3E,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,4EAA4E;AAC5E,MAAM,WAAW,kBAAkB;IACjC,0CAA0C;IAC1C,MAAM,CAAC,EAAE,kBAAkB,CAAC;IAC5B,gEAAgE;IAChE,UAAU,CAAC,EAAE,2BAA2B,CAAC;IACzC,qEAAqE;IACrE,YAAY,CAAC,EAAE,yBAAyB,CAAC;IACzC,uEAAuE;IACvE,OAAO,CAAC,EAAE,aAAa,CAAC;CACzB"}
@@ -49,25 +49,6 @@ export interface PublishResourceSummary {
49
49
  /** URL of the entity icon, used only by the entity-header row. */
50
50
  iconUrl?: string;
51
51
  }
52
- /** Combining function applied across a rule's `targets`. */
53
- export declare enum PublicationRuleFunction {
54
- Equal = "EQUAL",
55
- Contain = "CONTAIN",
56
- Regex = "REGEX"
57
- }
58
- /**
59
- * One access-restriction rule: grants access when `source`'s claim value
60
- * matches any of `targets` (OR) under `function`. Rules within a publish
61
- * request are combined with AND.
62
- */
63
- export interface PublicationRule {
64
- /** Claim/category name this rule matches against, e.g. `'role'`. */
65
- source: string;
66
- /** Combining function applied across `targets`. */
67
- function: PublicationRuleFunction;
68
- /** Values combined with OR; exactly one pattern when `function` is `Regex`. */
69
- targets: string[];
70
- }
71
52
  /** Which callout (if any) the publish panel should show below the folder picker. */
72
53
  export declare enum PublishCalloutKind {
73
54
  /** No callout — no folder selected, or a request is in flight. */
@@ -76,6 +57,8 @@ export declare enum PublishCalloutKind {
76
57
  Info = "info",
77
58
  /** Warning callout — publishing will replace an existing version in this folder. */
78
59
  ReplaceWarning = "replaceWarning",
60
+ /** Warning callout — another resource already holds the published path in this folder, so publishing would be rejected. */
61
+ TargetTaken = "targetTaken",
79
62
  /** Error callout — the user lacks write access to the selected folder. */
80
63
  NoAccess = "noAccess",
81
64
  /** Error callout — the most recent submit attempt failed. */
@@ -97,6 +80,10 @@ export interface PublishDerivationInput {
97
80
  isSubmitting: boolean;
98
81
  /** Whether the most recent submit attempt failed. */
99
82
  hasSubmitError: boolean;
83
+ /** Whether the host found another resource at the published path in the selected folder. Default `false`. */
84
+ isTargetTaken?: boolean;
85
+ /** Whether the host's check of the published path is still running. Default `false`. */
86
+ isTargetChecking?: boolean;
100
87
  /**
101
88
  * Whether resubmitting when `hasExistingPublicationInFolder` is true is
102
89
  * allowed (the host's backend overwrites the existing publication) or
@@ -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,iBAAiB,EAAE,CAAC;CAChC;AAED;;;GA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jC,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"}
@@ -1,10 +1,10 @@
1
- import { CSSProperties, Ref, RefObject } from 'react';
2
- import { PublishAccessRulesLabels } from '../components/PublishAccessRules/PublishAccessRules';
3
- import { SaveToFolderView, SaveVersionMode } from '../types/save-to-folder';
1
+ import { FolderDestinationTreeStyles } from '@epam/ai-dial-react-file-manager';
2
+ import { CSSProperties, RefObject } from 'react';
3
+ import { SaveVersionMode } from '../types/save-to-folder';
4
4
  import { FolderDestination, FolderDestinationRoot } from './folder-destination';
5
- import { PublicationRule, PublishResourceSummary } from './publish';
6
- import { PublishAccessRulesStyles } from './publish-access-rules-styles';
7
- import { PublishFoldersTreeStyles } from './publish-folders-tree';
5
+ import { PublishResourceSummary } from './publish';
6
+ import { PublishDependenciesLabels, PublishDependenciesStyles } from './publish-dependencies-list';
7
+ import { PublishDependency } from './publish-dependency';
8
8
  import { VersionHistorySectionProps } from './version-history';
9
9
  /** Text overrides for the body of the save-to-folder panel. */
10
10
  export interface SaveToFolderPanelLabels {
@@ -46,26 +46,26 @@ export interface SaveToFolderPanelLabels {
46
46
  createFolderDuplicateNameError?: string;
47
47
  /** Inline error for a new folder named like its parent folder. */
48
48
  createFolderSameAsParentNameError?: string;
49
+ /** Non-blocking notice for a new folder name starting with a dot, which hides the folder. Plain text. */
50
+ createFolderHiddenNameWarning?: string;
49
51
  /** Label of the action that retries a failed folder listing. Defaults to `'Retry'`. */
50
52
  retryLabel?: string;
53
+ /** Error announced when creating a folder fails and the host passes no `submitError`. Defaults to `'Failed to create the folder. Please try again.'`. */
54
+ createFolderFailedMessage?: string;
51
55
  }
52
- /** Color overrides for the body of the save-to-folder panel. */
56
+ /** Color overrides for the sections the save-to-folder panel adds to the main view. */
53
57
  export interface SaveToFolderPanelColors {
54
58
  /** Section heading text color. Defaults to `--text-primary`. */
55
59
  headingText?: string;
56
- /** Destination path text color. Defaults to `--text-secondary`. */
57
- destinationText?: string;
58
- /** Summary row border color. Defaults to `--stroke-tertiary`. */
59
- summaryBorder?: string;
60
- /** Summary row background color. Defaults to `--bg-layer-sunken`. */
61
- summaryBackground?: string;
60
+ /** Text color of `dependenciesNote` and `destinationNote`. Defaults to `--text-secondary`. */
61
+ noteText?: string;
62
62
  }
63
63
  /** Style overrides for the body of the save-to-folder panel. */
64
64
  export interface SaveToFolderPanelStyles {
65
65
  /** Color overrides. */
66
66
  colors?: SaveToFolderPanelColors;
67
67
  /** Style overrides forwarded to the folder tree. */
68
- folderTree?: PublishFoldersTreeStyles;
68
+ folderTree?: FolderDestinationTreeStyles;
69
69
  /** Additional CSS custom properties applied to the body root. */
70
70
  cssVars?: CSSProperties;
71
71
  }
@@ -86,27 +86,27 @@ export interface SaveToFolderVersionProps {
86
86
  /** Error shown under the new version input, already translated by the host. */
87
87
  newVersionError?: string;
88
88
  }
89
- /** Access-rules props; the rules section renders below the tree while a folder of a root with `hasAccessRules` is selected. */
90
- export interface SaveToFolderAccessRulesProps {
91
- /** Access rules of the selected folder, combined with AND. */
92
- rules: PublicationRule[];
93
- /** Called with the full next rules array on add, remove, or clear. */
94
- onRulesChange: (rules: PublicationRule[]) => void;
95
- /** Options offered in the rule editor's source picker. */
96
- sourceOptions: string[];
97
- /** Whether the selected folder's existing rules are being fetched. Defaults to `false`. */
98
- isLoading?: boolean;
99
- /** Whether the most recent existing-rules fetch failed. Defaults to `false`. */
100
- hasLoadError?: boolean;
101
- /** Text overrides for the rules section. */
102
- labels?: PublishAccessRulesLabels;
103
- /** Style overrides for the rules section. */
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;
89
+ /** Text overrides for the shell of the standalone save-to-folder panel. */
90
+ export interface StandaloneSaveToFolderPanelLabels {
91
+ /** Main view title and dialog name. Defaults to `'Save'`. */
92
+ title?: string;
93
+ /** Folder view title. Defaults to `'Change folder'`. */
94
+ changeFolderTitle?: string;
95
+ /** Accessible name of the close button. Defaults to `'Close'`. */
96
+ closeAriaLabel?: string;
97
+ /** Accessible name of the folder view's back button. Defaults to `'Back'`. */
98
+ backAriaLabel?: string;
99
+ /** Cancel button label. Defaults to `'Cancel'`. */
100
+ cancelLabel?: string;
101
+ /** Save button label. Defaults to `'Save'`. */
102
+ saveLabel?: string;
103
+ /** Save button label while saving. Defaults to `'Saving…'`. */
104
+ savingLabel?: string;
105
+ /** Select button label in the folder view. Defaults to `'Select'`. */
106
+ selectLabel?: string;
107
107
  }
108
- /** Props shared by the body and the standalone shell of the save-to-folder panel. */
109
- export interface SaveToFolderPanelBaseProps {
108
+ /** Props of the standalone save-to-folder panel. */
109
+ export interface StandaloneSaveToFolderPanelProps {
110
110
  /** Summary row content; a `type` renders the entity header with icon and type badge. */
111
111
  resource: PublishResourceSummary;
112
112
  /** Top-level destination roots, in display order. */
@@ -115,14 +115,28 @@ export interface SaveToFolderPanelBaseProps {
115
115
  destination: FolderDestination;
116
116
  /** Called with the destination the user selected and confirmed in the folder tree. */
117
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`. */
118
+ /** Reason a folder is unavailable as a destination, or `undefined` when it is usable; forwarded to the folder tree, see `FolderDestinationTreeProps.getDisabledReason`. */
119
119
  getDisabledReason?: (destination: FolderDestination) => string | undefined;
120
+ /** Whether a new folder may be created inside `destination`; forwarded to the folder tree, see `FolderDestinationTreeProps.canCreateFolderIn`. */
121
+ canCreateFolderIn?: (destination: FolderDestination) => boolean;
120
122
  /** Called when a new folder name is confirmed under `rootKey` at `parentPath`. */
121
123
  onCreateFolder: (rootKey: string, parentPath: string[], name: string) => Promise<void>;
124
+ /** Called with the rejection when `onCreateFolder` fails, after the panel has announced `panelLabels.createFolderFailedMessage`; the new folder is not selected. */
125
+ onCreateFolderError?: (error: unknown) => void;
122
126
  /** Version choice; omit for an unversioned resource. */
123
127
  version?: SaveToFolderVersionProps;
124
- /** Access rules for a destination under a root with `hasAccessRules`; omit to hide the section. */
125
- accessRules?: SaveToFolderAccessRulesProps;
128
+ /** Resources the item refers to that are not in the public bucket, listed in the main view as in `PublishPanel`; informational only, it never blocks Save. The host passes them only when they apply (for example, an Organization destination); the section is hidden while this is empty or omitted. */
129
+ dependencies?: PublishDependency[];
130
+ /** One sentence shown in the dependencies section, under its heading, while `dependencies` is omitted or empty; ignored while the list has rows. The host passes it only when the panel cannot list the dependencies itself. Plain text in reading order, not a live region. */
131
+ dependenciesNote?: string;
132
+ /** Notice shown under the destination in the main view, already translated; plain text, never blocks Save and is not announced. The host decides when it applies. */
133
+ destinationNote?: string;
134
+ /** Text overrides for the private-dependencies section. */
135
+ dependenciesLabels?: PublishDependenciesLabels;
136
+ /** Style overrides for the private-dependencies section. */
137
+ dependenciesStyles?: PublishDependenciesStyles;
138
+ /** Typography class of `dependenciesNote` and `destinationNote`. Defaults to `'dial-small-text'`. */
139
+ noteClassName?: string;
126
140
  /** Versions history shown as the last section of the main view; omit to hide the section. */
127
141
  versionHistory?: VersionHistorySectionProps;
128
142
  /** Whether a save is in flight; every control is disabled meanwhile. Defaults to `false`. */
@@ -141,56 +155,6 @@ export interface SaveToFolderPanelBaseProps {
141
155
  headingClassName?: string;
142
156
  /** Typography class of the destination path. Defaults to `'dial-small-semi-text'`. */
143
157
  destinationClassName?: string;
144
- }
145
- /** Props of the body of the save-to-folder panel. */
146
- export interface SaveToFolderPanelProps extends SaveToFolderPanelBaseProps {
147
- /** Which view to render. */
148
- view: SaveToFolderView;
149
- /** Called when the user activates Change in the main view. */
150
- onChangeFolderClick: () => void;
151
- /** Ref attached to the Change button, for returning focus after the folder view closes. */
152
- changeFolderButtonRef?: Ref<HTMLButtonElement>;
153
- /** Destination selected in the folder view but not yet confirmed. */
154
- pendingDestination?: FolderDestination;
155
- /** Called when the user selects or deselects a folder in the folder view. */
156
- onPendingDestinationChange: (destination: FolderDestination | undefined) => void;
157
- }
158
- /** Text overrides for the shell of the standalone save-to-folder panel. */
159
- export interface StandaloneSaveToFolderPanelLabels {
160
- /** Main view title and dialog name. Defaults to `'Save'`. */
161
- title?: string;
162
- /** Folder view title. Defaults to `'Change folder'`. */
163
- changeFolderTitle?: string;
164
- /** Accessible name of the close button. Defaults to `'Close'`. */
165
- closeAriaLabel?: string;
166
- /** Accessible name of the folder view's back button. Defaults to `'Back'`. */
167
- backAriaLabel?: string;
168
- /** Cancel button label. Defaults to `'Cancel'`. */
169
- cancelLabel?: string;
170
- /** Save button label. Defaults to `'Save'`. */
171
- saveLabel?: string;
172
- /** Save button label while saving. Defaults to `'Saving…'`. */
173
- savingLabel?: string;
174
- /** Select button label in the folder view. Defaults to `'Select'`. */
175
- selectLabel?: string;
176
- }
177
- /** Color overrides for the shell of the standalone save-to-folder panel. */
178
- export interface StandaloneSaveToFolderPanelColors {
179
- /** Backdrop background color. Defaults to `--bg-backdrop`. */
180
- backdropBackground?: string;
181
- /** Panel background color. Defaults to `--bg-layer-raised`. */
182
- panelBackground?: string;
183
- /** Panel leading-edge border color. Defaults to `--stroke-secondary`. */
184
- panelBorder?: string;
185
- /** Divider color below the header and above the footer. Defaults to `--stroke-tertiary`. */
186
- dividerBorder?: string;
187
- /** Scrollbar thumb color of the scrollable body. Defaults to `--stroke-secondary`. */
188
- scrollbarThumb?: string;
189
- /** Header title text color. Defaults to `--text-primary`. */
190
- titleText?: string;
191
- }
192
- /** Props of the standalone save-to-folder panel. */
193
- export interface StandaloneSaveToFolderPanelProps extends SaveToFolderPanelBaseProps {
194
158
  /** Whether the panel is open. */
195
159
  isOpen: boolean;
196
160
  /** Called when the panel asks to close: Close, Cancel in the main view, backdrop, or Escape. */
@@ -205,8 +169,6 @@ export interface StandaloneSaveToFolderPanelProps extends SaveToFolderPanelBaseP
205
169
  onPendingDestinationChange?: (destination: FolderDestination | undefined) => void;
206
170
  /** Text overrides for the shell. */
207
171
  labels?: StandaloneSaveToFolderPanelLabels;
208
- /** Color overrides for the shell. */
209
- colors?: StandaloneSaveToFolderPanelColors;
210
172
  /** Typography class of the header title. Defaults to `'dial-body-semi-text'`. */
211
173
  titleClassName?: string;
212
174
  }
@@ -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,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AM,CAAC;IACvB,6FAA6F;IAC7F,cAAc,CAAC,EAAE,0BAA0B,CAAC;IAC5C,6FAA6F;IAC7F,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,mFAAmF;IACnF,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,4EAA4E;IAC5E,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,4DAA4D;IAC5D,cAAc,CAAC,EAAE,MAAM,IAAI,CAAC;IAC5B,mCAAmC;IACnC,WAAW,CAAC,EAAE,uBAAuB,CAAC;IACtC,oCAAoC;IACpC,WAAW,CAAC,EAAE,uBAAuB,CAAC;IACtC,qFAAqF;IACrF,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,sFAAsF;IACtF,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,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,iFAAiF;IACjF,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB"}
package/package.json CHANGED
@@ -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.96",
4
+ "version": "1.4.0-rc.1",
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.96",
29
- "@epam/ai-dial-ui-kit": "^0.16.0",
30
- "@epam/ai-dial-react-file-manager": "^0.4.3"
28
+ "@epam/ai-dial-chat-shared": "1.4.0-rc.1",
29
+ "@epam/ai-dial-ui-kit": "^0.17.0",
30
+ "@epam/ai-dial-react-file-manager": "^0.5.1"
31
31
  },
32
32
  "repository": {
33
33
  "type": "git",
@@ -1,6 +1,6 @@
1
1
  /** Which view the publish panel shows. */
2
2
  export declare enum PublishPanelView {
3
- /** Summary, destination row, author, credentials and access rules. */
3
+ /** Summary, destination row, author and credentials. */
4
4
  Main = "main",
5
5
  /** The destination folder tree. */
6
6
  ChangeFolder = "change-folder"
@@ -1 +1 @@
1
- {"version":3,"file":"publish-panel.d.ts","sourceRoot":"","sources":["../../src/types/publish-panel.ts"],"names":[],"mappings":"AAAA,0CAA0C;AAC1C,oBAAY,gBAAgB;IAC1B,sEAAsE;IACtE,IAAI,SAAS;IACb,mCAAmC;IACnC,YAAY,kBAAkB;CAC/B"}
1
+ {"version":3,"file":"publish-panel.d.ts","sourceRoot":"","sources":["../../src/types/publish-panel.ts"],"names":[],"mappings":"AAAA,0CAA0C;AAC1C,oBAAY,gBAAgB;IAC1B,wDAAwD;IACxD,IAAI,SAAS;IACb,mCAAmC;IACnC,YAAY,kBAAkB;CAC/B"}
@@ -5,11 +5,4 @@ export declare enum SaveVersionMode {
5
5
  /** Save the edits as a new version; the current one stays as last saved. */
6
6
  New = "new"
7
7
  }
8
- /** Which view the save-to-folder panel shows. */
9
- export declare enum SaveToFolderView {
10
- /** Summary, destination and version choice. */
11
- Main = "main",
12
- /** The destination folder tree. */
13
- ChangeFolder = "change-folder"
14
- }
15
8
  //# sourceMappingURL=save-to-folder.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"save-to-folder.d.ts","sourceRoot":"","sources":["../../src/types/save-to-folder.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,oBAAY,eAAe;IACzB,+CAA+C;IAC/C,IAAI,SAAS;IACb,4EAA4E;IAC5E,GAAG,QAAQ;CACZ;AAED,iDAAiD;AACjD,oBAAY,gBAAgB;IAC1B,+CAA+C;IAC/C,IAAI,SAAS;IACb,mCAAmC;IACnC,YAAY,kBAAkB;CAC/B"}
1
+ {"version":3,"file":"save-to-folder.d.ts","sourceRoot":"","sources":["../../src/types/save-to-folder.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,oBAAY,eAAe;IACzB,+CAA+C;IAC/C,IAAI,SAAS;IACb,4EAA4E;IAC5E,GAAG,QAAQ;CACZ"}
@@ -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,mBA8CF,CAAC"}
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"}
@@ -1,8 +1,10 @@
1
- import { PublicationRule, PublishFolderNode, PublishHistoryEntry } from '../models/publish';
1
+ import { PublishFolderNode, PublishHistoryEntry } from '../models/publish';
2
2
  /** An item publishable through {@link usePublishFlow} — versioned or not (e.g. a conversation). */
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> {
@@ -41,16 +43,13 @@ export interface UsePublishFlowOptions<TItem extends PublishFlowItem> {
41
43
  */
42
44
  defaultAuthor?: string;
43
45
  /**
44
- * Called with the destination folder path, current rules, trimmed display
45
- * author, and the credentials opt-in when the user confirms publish/update.
46
- *
47
- * `publishCredentials` is additive and positional: a host callback that
48
- * declares only the first four parameters stays assignable and keeps
49
- * behaving exactly as it did.
46
+ * Called with the destination folder path, trimmed display author, and the
47
+ * credentials opt-in when the user confirms publish/update. A host callback
48
+ * that declares only the first three parameters stays assignable.
50
49
  */
51
- onPublish: (item: TItem, folderPath: string[], rules: PublicationRule[], author: string, publishCredentials: boolean) => Promise<void>;
52
- /** Called after a successful publish; the host surfaces its own success notification. */
53
- onPublishSuccess?: (item: TItem, folderPath: string[]) => void;
50
+ onPublish: (item: TItem, folderPath: string[], author: string, publishCredentials: boolean) => Promise<void>;
51
+ /** Called after a successful publish, with whether it was a direct write; the host surfaces its own success notification. */
52
+ onPublishSuccess?: (item: TItem, folderPath: string[], isDirectWrite: boolean) => void;
54
53
  /**
55
54
  * Called with the rejection reason when `onPublish` fails, before
56
55
  * `handleSubmit` resolves to `false`. The host surfaces its own error
@@ -58,13 +57,39 @@ export interface UsePublishFlowOptions<TItem extends PublishFlowItem> {
58
57
  */
59
58
  onPublishError?: (item: TItem, folderPath: string[], error: unknown) => void;
60
59
  /**
61
- * Resolves the access rules already configured for a destination folder.
62
- * Called whenever `selectedFolderPath` changes to a defined folder; the
63
- * result fully replaces the current `rules` state (never merged). Omit to
64
- * skip pre-filling entirely — `rules` then only ever changes via
65
- * `setRules`.
60
+ * Resolves whether another resource already holds the published path of
61
+ * `item` in a destination folder, so the panel can say so before submit.
62
+ * Called when the selected folder changes to a defined folder and when
63
+ * `item.version` changes while one is selected; never for a folder created
64
+ * in this session, nor for a folder where this item's own history already
65
+ * holds it. An answer that arrives after the folder or version changed again
66
+ * is discarded. A rejection leaves the target untaken and does not block
67
+ * submit: the backend's refusal on submit is the safety net. Omit to skip
68
+ * the check entirely.
69
+ */
70
+ onCheckTargetExists?: (item: TItem, folderPath: string[]) => Promise<boolean>;
71
+ /**
72
+ * Tells whether the rejection of `onPublish` means the target is taken. When
73
+ * it returns `true` the hook marks the selected folder's target as taken
74
+ * instead of setting `hasSubmitError`, so the panel shows the same callout as
75
+ * after the check; `onPublishError` is still called. Must be synchronous: a
76
+ * host that learns the cause asynchronously converts the error inside its
77
+ * `onPublish` before rethrowing it.
78
+ */
79
+ isTargetTakenError?: (error: unknown) => boolean;
80
+ /**
81
+ * Whether the host writes the item straight into this folder instead of
82
+ * filing a publication request. Together with `onPublishDirectly` it selects
83
+ * the direct path; omit either and `onPublish` is always used.
66
84
  */
67
- onFetchExistingRules?: (folderPath: string[]) => Promise<PublicationRule[]>;
85
+ canPublishDirectlyTo?: (folderPath: string[]) => boolean;
86
+ /**
87
+ * Writes the item into the folder directly. Called by `handleSubmit` instead
88
+ * of `onPublish` while {@link UsePublishFlowResult.isDirectWrite} is `true`,
89
+ * with the same success, error and taken-target handling; no author or
90
+ * credentials are sent.
91
+ */
92
+ onPublishDirectly?: (item: TItem, folderPath: string[]) => Promise<void>;
68
93
  }
69
94
  /** State and handlers returned by {@link usePublishFlow}. */
70
95
  export interface UsePublishFlowResult {
@@ -98,12 +123,8 @@ export interface UsePublishFlowResult {
98
123
  * decide whether to close the flow.
99
124
  */
100
125
  handleSubmit: () => Promise<boolean>;
101
- /** Resets folder selection, any locally-created folders, rules, the credentials opt-in, and the submit error back to their initial state. */
126
+ /** Resets folder selection, any locally-created folders, the author, the credentials opt-in, and the submit error back to their initial state. */
102
127
  reset: () => void;
103
- /** Current access rules for the selected folder — fetched, manually edited, or both. */
104
- rules: PublicationRule[];
105
- /** Replaces the current rules; used by manual add/remove/clear actions. */
106
- setRules: (rules: PublicationRule[]) => void;
107
128
  /**
108
129
  * Current display author for the publication — the host-supplied
109
130
  * `defaultAuthor` until the user edits it.
@@ -121,11 +142,17 @@ export interface UsePublishFlowResult {
121
142
  publishCredentials: boolean;
122
143
  /** Replaces the credentials opt-in. */
123
144
  setPublishCredentials: (value: boolean) => void;
124
- /** Whether `onFetchExistingRules` is currently resolving for the selected folder. */
125
- isRulesLoading: boolean;
126
- /** Whether the most recent `onFetchExistingRules` call failed. `rules` is left unchanged when this is `true`. */
127
- hasRulesLoadError: boolean;
145
+ /**
146
+ * Whether another resource holds the published path in `selectedFolderPath`:
147
+ * `onCheckTargetExists` answered `true` for the current folder and version,
148
+ * or the last submit was rejected as a taken target.
149
+ */
150
+ isTargetTaken: boolean;
151
+ /** Whether `onCheckTargetExists` is currently resolving for the selected folder and version. */
152
+ isTargetChecking: boolean;
153
+ /** Whether the selected folder is written directly: a folder is selected, both direct options are supplied and `canPublishDirectlyTo` holds for it. */
154
+ isDirectWrite: boolean;
128
155
  }
129
156
  /** 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;
157
+ export declare const usePublishFlow: <TItem extends PublishFlowItem = PublishFlowItem>({ item, history, folderItems: initialFolderItems, hasWriteAccess: resolveWriteAccess, defaultAuthor, onCreateFolder, onPublish, onPublishSuccess, onPublishError, onCheckTargetExists, isTargetTakenError, canPublishDirectlyTo, onPublishDirectly, }: UsePublishFlowOptions<TItem>) => UsePublishFlowResult;
131
158
  //# 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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E,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IACpC;;;;;;OAMG;IACH,kBAAkB,EAAE,OAAO,CAAC;IAC5B,uCAAuC;IACvC,qBAAqB,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IAChD;;;;OAIG;IACH,aAAa,EAAE,OAAO,CAAC;IACvB,gGAAgG;IAChG,gBAAgB,EAAE,OAAO,CAAC;IAC1B,uJAAuJ;IACvJ,aAAa,EAAE,OAAO,CAAC;CACxB;AAED,4IAA4I;AAC5I,eAAO,MAAM,cAAc,GACzB,KAAK,SAAS,eAAe,GAAG,eAAe,EAC/C,uPAcC,qBAAqB,CAAC,KAAK,CAAC,KAAG,oBA+MjC,CAAC"}
@@ -1,5 +0,0 @@
1
- import { FC } from 'react';
2
- import { PublishAccessRuleEditorProps } from '../../models/publish-access-rule-editor';
3
- /** Edits one access rule inline on desktop or in a bottom sheet below the desktop breakpoint. */
4
- export declare const PublishAccessRuleEditor: FC<PublishAccessRuleEditorProps>;
5
- //# sourceMappingURL=PublishAccessRuleEditor.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"PublishAccessRuleEditor.d.ts","sourceRoot":"","sources":["../../../src/components/PublishAccessRuleEditor/PublishAccessRuleEditor.tsx"],"names":[],"mappings":"AAeA,OAAO,EACL,EAAE,EAOH,MAAM,OAAO,CAAC;AAEf,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,yCAAyC,CAAC;AAoB5F,iGAAiG;AACjG,eAAO,MAAM,uBAAuB,EAAE,EAAE,CAAC,4BAA4B,CAgTpE,CAAC"}