@epam/ai-dial-chat-shared 1.4.0-dev.96 → 1.4.0-rc.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/components/MarkdownRenderer/Table/MarkdownTable.js +1 -1
  2. package/components/SortMenuButton/SortMenuButton.d.ts +5 -0
  3. package/components/SortMenuButton/SortMenuButton.d.ts.map +1 -0
  4. package/components/SortMenuButton/SortMenuButton.js +42 -0
  5. package/components/SortMenuButton/SortMenuButton.module.scss.js +4 -0
  6. package/file-manager/DialFileManagerShell/DialFileManagerShell.d.ts.map +1 -1
  7. package/file-manager/DialFileManagerShell/DialFileManagerShell.js +265 -258
  8. package/file-manager/FileManagerDestinationPanel/FileManagerDestinationPanel.d.ts +26 -0
  9. package/file-manager/FileManagerDestinationPanel/FileManagerDestinationPanel.d.ts.map +1 -0
  10. package/file-manager/FileManagerDestinationPanel/FileManagerDestinationPanel.js +131 -0
  11. package/file-manager/destination-folders.d.ts +19 -0
  12. package/file-manager/destination-folders.d.ts.map +1 -0
  13. package/file-manager/destination-folders.js +27 -0
  14. package/file-manager/file-manager-controller.d.ts +2 -2
  15. package/file-manager/file-manager-controller.d.ts.map +1 -1
  16. package/file-manager/labels.d.ts +91 -19
  17. package/file-manager/labels.d.ts.map +1 -1
  18. package/hooks/useHasBeenTrue.d.ts +16 -0
  19. package/hooks/useHasBeenTrue.d.ts.map +1 -0
  20. package/hooks/useHasBeenTrue.js +8 -0
  21. package/hooks/useIsMobile.d.ts.map +1 -1
  22. package/hooks/useIsMobile.js +3 -10
  23. package/hooks/useIsPhone.d.ts.map +1 -1
  24. package/hooks/useIsPhone.js +3 -10
  25. package/hooks/useIsTablet.d.ts.map +1 -1
  26. package/hooks/useIsTablet.js +3 -10
  27. package/hooks/useMediaQueryMatch.d.ts +3 -0
  28. package/hooks/useMediaQueryMatch.d.ts.map +1 -0
  29. package/hooks/useMediaQueryMatch.js +12 -0
  30. package/index.css +2 -2
  31. package/index.d.ts +4 -0
  32. package/index.d.ts.map +1 -1
  33. package/index.js +82 -79
  34. package/models/sort-menu-button.d.ts +40 -0
  35. package/models/sort-menu-button.d.ts.map +1 -0
  36. package/package.json +3 -3
  37. package/utils/copy-to-clipboard.d.ts +0 -15
  38. package/utils/copy-to-clipboard.d.ts.map +1 -1
  39. package/utils/copy-to-clipboard.js +2 -59
  40. package/utils/markdown-rich-text.d.ts +16 -0
  41. package/utils/markdown-rich-text.d.ts.map +1 -0
  42. package/utils/markdown-rich-text.js +62 -0
  43. package/utils/org-unit.d.ts +22 -1
  44. package/utils/org-unit.d.ts.map +1 -1
  45. package/utils/org-unit.js +19 -16
@@ -1,4 +1,4 @@
1
- import { OrgUnitAction, OrgUnit, OrgUnitAccess, OrgUnitNamespace } from '../models/org-unit';
1
+ import { OrgUnitAction, OrgUnitNamespace, OrgUnit, OrgUnitAccess } from '../models/org-unit';
2
2
  /**
3
3
  * Returns a unit's Core `folder` (url-encoded, rooted at `public/`, e.g.
4
4
  * `public/Acme/US%20Risk/`) as a decoded public-relative folder with one
@@ -18,6 +18,18 @@ export declare const normalizeOrgUnitFolder: (folder: string) => string;
18
18
  * @param publicPath - decoded path relative to the public bucket, e.g. `Acme/US Risk/Reports`
19
19
  */
20
20
  export declare const findOwningOrgUnit: (units: readonly OrgUnit[], publicPath: string) => OrgUnit | undefined;
21
+ /**
22
+ * Whether `publicPath` belongs to the org-unit structure of the public bucket,
23
+ * i.e. should stay listed when org units are on: the public root, a unit's own
24
+ * folder, a folder inside a unit (see {@link findOwningOrgUnit}), or an
25
+ * ancestor of a unit folder at a segment boundary (`Acme/` when only
26
+ * `Acme/Risk/` is a unit). Any other public folder — and so its subtree — is a
27
+ * plain folder no unit owns. Describes the folder kind, not a right, so admin
28
+ * access is not consulted. `publicPath` is decoded and public-relative.
29
+ * @param units - units as returned by DIAL Core
30
+ * @param publicPath - decoded path relative to the public bucket, e.g. `Acme/Reports`
31
+ */
32
+ export declare const isOrgUnitTreeFolder: (units: readonly OrgUnit[], publicPath: string) => boolean;
21
33
  /**
22
34
  * Whether the caller may do `action` on `namespace` at `publicPath`. A DIAL
23
35
  * admin may anywhere; otherwise only the owning unit's `permissions` decide, so
@@ -54,6 +66,15 @@ export declare const canSaveToFolderAt: (access: OrgUnitAccess, publicPath: stri
54
66
  export declare const canWriteIntoOrgUnitAt: (access: OrgUnitAccess, publicPath: string, namespace: OrgUnitNamespace) => boolean;
55
67
  /** {@link canAccessAt} for the `read` action. */
56
68
  export declare const canReadAt: (access: OrgUnitAccess, publicPath: string, namespace: OrgUnitNamespace) => boolean;
69
+ /**
70
+ * Whether the caller may approve a publication into `publicPath`: a DIAL
71
+ * admin, or the owning unit grants both `read` and `write` on the
72
+ * `publications` namespace (a parent unit's grants do not extend to a child
73
+ * unit). A path under no listed unit is `false` for a non-admin.
74
+ * @param access - resolved org-unit data
75
+ * @param publicPath - decoded public-relative path
76
+ */
77
+ export declare const canApprovePublicationsAt: (access: OrgUnitAccess, publicPath: string) => boolean;
57
78
  /**
58
79
  * Whether a publication request into `publicPath` can be sent: `true` for an
59
80
  * admin and for a path under no listed unit (Core's folder rules decide there,
@@ -1 +1 @@
1
- {"version":3,"file":"org-unit.d.ts","sourceRoot":"","sources":["../../src/utils/org-unit.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EACb,KAAK,OAAO,EACZ,KAAK,aAAa,EAClB,KAAK,gBAAgB,EACtB,MAAM,oBAAoB,CAAC;AAmB5B;;;;;GAKG;AACH,eAAO,MAAM,sBAAsB,GAAI,QAAQ,MAAM,KAAG,MAIvD,CAAC;AAsBF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,iBAAiB,GAC5B,OAAO,SAAS,OAAO,EAAE,EACzB,YAAY,MAAM,KACjB,OAAO,GAAG,SAYZ,CAAC;AAEF;;;;;;;;;GASG;AACH,eAAO,MAAM,WAAW,GACtB,QAAQ,aAAa,EACrB,YAAY,MAAM,EAClB,WAAW,gBAAgB,EA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ClB,WAAW,gBAAgB,EAC3B,QAAQ,aAAa,KACpB,OAIF,CAAC;AAEF,kDAAkD;AAClD,eAAO,MAAM,UAAU,GACrB,QAAQ,aAAa,EACrB,YAAY,MAAM,EAClB,WAAW,gBAAgB,KAC1B,OAA0E,CAAC;AAE9E;;;;;;;;;GASG;AACH,eAAO,MAAM,iBAAiB,GAC5B,QAAQ,aAAa,EACrB,YAAY,MAAM,EAClB,WAAW,gBAAgB,KAC1B,OAIF,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,qBAAqB,GAChC,QAAQ,aAAa,EACrB,YAAY,MAAM,EAClB,WAAW,gBAAgB,KAC1B,OAEwC,CAAC;AAE5C,iDAAiD;AACjD,eAAO,MAAM,SAAS,GACpB,QAAQ,aAAa,EACrB,YAAY,MAAM,EAClB,WAAW,gBAAgB,KAC1B,OAAyE,CAAC;AAE7E;;;;;;;GAOG;AACH,eAAO,MAAM,wBAAwB,GACnC,QAAQ,aAAa,EACrB,YAAY,MAAM,KACjB,OAE4D,CAAC;AAEhE;;;;;;;GAOG;AACH,eAAO,MAAM,uBAAuB,GAClC,QAAQ,aAAa,EACrB,YAAY,MAAM,EAClB,WAAW,gBAAgB,KAC1B,OAIF,CAAC"}
package/utils/org-unit.js CHANGED
@@ -1,26 +1,29 @@
1
- import { OrgUnitAction as e } from "../models/org-unit.js";
1
+ import { OrgUnitAction as e, OrgUnitNamespace as t } from "../models/org-unit.js";
2
2
  //#region src/utils/org-unit.ts
3
- var t = "public", n = (e) => {
3
+ var n = "public", r = (e) => {
4
4
  try {
5
5
  return decodeURIComponent(e);
6
6
  } catch {
7
7
  return e;
8
8
  }
9
- }, r = (e) => e.split("/").filter((e) => e !== ""), i = (e) => e.length === 0 ? "" : `${e.join("/")}/`, a = (e) => {
10
- let [a, ...o] = r(e);
11
- return a === t ? i(o.map(n)) : "";
12
- }, o = /* @__PURE__ */ new WeakMap(), s = (e) => {
13
- let t = o.get(e);
9
+ }, i = (e) => e.split("/").filter((e) => e !== ""), a = (e) => e.length === 0 ? "" : `${e.join("/")}/`, o = (e) => {
10
+ let [t, ...o] = i(e);
11
+ return t === n ? a(o.map(r)) : "";
12
+ }, s = /* @__PURE__ */ new WeakMap(), c = (e) => {
13
+ let t = s.get(e);
14
14
  return t || (t = e.map((e) => ({
15
15
  unit: e,
16
- folder: a(e.folder)
17
- })), o.set(e, t)), t;
18
- }, c = (e, t) => {
19
- let n = i(r(t));
16
+ folder: o(e.folder)
17
+ })), s.set(e, t)), t;
18
+ }, l = (e, t) => {
19
+ let n = a(i(t));
20
20
  if (n === "") return;
21
- let a, o = 0;
22
- for (let { unit: t, folder: r } of s(e)) r.length > o && n.startsWith(r) && (a = t, o = r.length);
23
- return a;
24
- }, l = (e, t, n, r) => e.hasAdminAccess ? !0 : c(e.units, t)?.permissions?.[n]?.includes(r) ?? !1, u = (t, n, r) => l(t, n, r, e.Write), d = (e, t, n) => e.hasAdminAccess || !c(e.units, t) ? !0 : u(e, t, n), f = (e, t, n) => c(e.units, t) != null && u(e, t, n), p = (t, n, r) => l(t, n, r, e.Read), m = (e, t, n) => e.hasAdminAccess || !c(e.units, t) ? !0 : p(e, t, n);
21
+ let r, o = 0;
22
+ for (let { unit: t, folder: i } of c(e)) i.length > o && n.startsWith(i) && (r = t, o = i.length);
23
+ return r;
24
+ }, u = (e, t) => {
25
+ let n = a(i(t));
26
+ return n === "" || l(e, t) ? !0 : c(e).some(({ folder: e }) => e !== "" && e.startsWith(n));
27
+ }, d = (e, t, n, r) => e.hasAdminAccess ? !0 : l(e.units, t)?.permissions?.[n]?.includes(r) ?? !1, f = (t, n, r) => d(t, n, r, e.Write), p = (e, t, n) => e.hasAdminAccess || !l(e.units, t) ? !0 : f(e, t, n), m = (e, t, n) => l(e.units, t) != null && f(e, t, n), h = (t, n, r) => d(t, n, r, e.Read), g = (e, n) => h(e, n, t.Publications) && f(e, n, t.Publications), _ = (e, t, n) => e.hasAdminAccess || !l(e.units, t) ? !0 : h(e, t, n);
25
28
  //#endregion
26
- export { l as canAccessAt, p as canReadAt, m as canRequestPublicationAt, d as canSaveToFolderAt, u as canWriteAt, f as canWriteIntoOrgUnitAt, c as findOwningOrgUnit, a as normalizeOrgUnitFolder };
29
+ export { d as canAccessAt, g as canApprovePublicationsAt, h as canReadAt, _ as canRequestPublicationAt, p as canSaveToFolderAt, f as canWriteAt, m as canWriteIntoOrgUnitAt, l as findOwningOrgUnit, u as isOrgUnitTreeFolder, o as normalizeOrgUnitFolder };