@epam/ai-dial-publish-panel 1.1.0-dev.445 → 1.1.0-dev.447

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/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.1.0-dev.445",
4
+ "version": "1.1.0-dev.447",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
7
7
  "sideEffects": [
@@ -23,7 +23,7 @@
23
23
  "peerDependencies": {
24
24
  "react": "^19.0.0",
25
25
  "@tabler/icons-react": "^3.0.0",
26
- "@epam/ai-dial-chat-shared": "1.1.0-dev.445",
26
+ "@epam/ai-dial-chat-shared": "1.1.0-dev.447",
27
27
  "@epam/ai-dial-ui-kit": "*",
28
28
  "@epam/ai-dial-react-file-manager": "^0.2.0-dev.10"
29
29
  },
@@ -25,8 +25,23 @@ export interface UsePublishFlowOptions<TItem extends PublishFlowItem> {
25
25
  * error callout is surfaced.
26
26
  */
27
27
  onCreateFolder?: (parentPath: string[], name: string) => void | Promise<void>;
28
- /** Called with the destination folder path and current rules when the user confirms publish/update. */
29
- onPublish: (item: TItem, folderPath: string[], rules: PublicationRule[]) => Promise<void>;
28
+ /**
29
+ * Initial value for the publication's display author, and the value
30
+ * `reset` restores.
31
+ *
32
+ * The hook cannot resolve this itself: who the signed-in user is, is host
33
+ * knowledge, and this library holds no notion of a session. The host
34
+ * passes its own resolved display name here. It may arrive after the first
35
+ * render (a profile still loading) or change (a different session), which
36
+ * is why {@link UsePublishFlowResult.author} re-syncs from it while the
37
+ * user has not edited the field.
38
+ *
39
+ * Defaults to `''`, which leaves the decision entirely to the host's own
40
+ * publish call.
41
+ */
42
+ defaultAuthor?: string;
43
+ /** Called with the destination folder path, current rules, and trimmed display author when the user confirms publish/update. */
44
+ onPublish: (item: TItem, folderPath: string[], rules: PublicationRule[], author: string) => Promise<void>;
30
45
  /** Called after a successful publish; the host surfaces its own success notification. */
31
46
  onPublishSuccess?: (item: TItem, folderPath: string[]) => void;
32
47
  /**
@@ -82,11 +97,18 @@ export interface UsePublishFlowResult {
82
97
  rules: PublicationRule[];
83
98
  /** Replaces the current rules; used by manual add/remove/clear actions. */
84
99
  setRules: (rules: PublicationRule[]) => void;
100
+ /**
101
+ * Current display author for the publication — the host-supplied
102
+ * `defaultAuthor` until the user edits it.
103
+ */
104
+ author: string;
105
+ /** Replaces the current display author; marks the field as user-edited, so `defaultAuthor` no longer overwrites it. */
106
+ setAuthor: (author: string) => void;
85
107
  /** Whether `onFetchExistingRules` is currently resolving for the selected folder. */
86
108
  isRulesLoading: boolean;
87
109
  /** Whether the most recent `onFetchExistingRules` call failed. `rules` is left unchanged when this is `true`. */
88
110
  hasRulesLoadError: boolean;
89
111
  }
90
112
  /** Manages all state for the Publish flow: folder selection, local folder creation, existing-publication detection, and submit handling. */
91
- export declare const usePublishFlow: <TItem extends PublishFlowItem = PublishFlowItem>({ item, history, folderItems: initialFolderItems, hasWriteAccess: resolveWriteAccess, onCreateFolder, onPublish, onPublishSuccess, onPublishError, onFetchExistingRules, }: UsePublishFlowOptions<TItem>) => UsePublishFlowResult;
113
+ export declare const usePublishFlow: <TItem extends PublishFlowItem = PublishFlowItem>({ item, history, folderItems: initialFolderItems, hasWriteAccess: resolveWriteAccess, defaultAuthor, onCreateFolder, onPublish, onPublishSuccess, onPublishError, onFetchExistingRules, }: UsePublishFlowOptions<TItem>) => UsePublishFlowResult;
92
114
  //# 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;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