@epam/ai-dial-chat-shared 1.4.0-dev.95 → 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.
- package/components/MarkdownRenderer/Table/MarkdownTable.js +1 -1
- package/components/SortMenuButton/SortMenuButton.d.ts +5 -0
- package/components/SortMenuButton/SortMenuButton.d.ts.map +1 -0
- package/components/SortMenuButton/SortMenuButton.js +42 -0
- package/components/SortMenuButton/SortMenuButton.module.scss.js +4 -0
- package/file-manager/DialFileManagerShell/DialFileManagerShell.d.ts.map +1 -1
- package/file-manager/DialFileManagerShell/DialFileManagerShell.js +265 -258
- package/file-manager/FileManagerDestinationPanel/FileManagerDestinationPanel.d.ts +26 -0
- package/file-manager/FileManagerDestinationPanel/FileManagerDestinationPanel.d.ts.map +1 -0
- package/file-manager/FileManagerDestinationPanel/FileManagerDestinationPanel.js +131 -0
- package/file-manager/destination-folders.d.ts +19 -0
- package/file-manager/destination-folders.d.ts.map +1 -0
- package/file-manager/destination-folders.js +27 -0
- package/file-manager/file-manager-controller.d.ts +2 -2
- package/file-manager/file-manager-controller.d.ts.map +1 -1
- package/file-manager/labels.d.ts +91 -19
- package/file-manager/labels.d.ts.map +1 -1
- package/hooks/useHasBeenTrue.d.ts +16 -0
- package/hooks/useHasBeenTrue.d.ts.map +1 -0
- package/hooks/useHasBeenTrue.js +8 -0
- package/hooks/useIsMobile.d.ts.map +1 -1
- package/hooks/useIsMobile.js +3 -10
- package/hooks/useIsPhone.d.ts.map +1 -1
- package/hooks/useIsPhone.js +3 -10
- package/hooks/useIsTablet.d.ts.map +1 -1
- package/hooks/useIsTablet.js +3 -10
- package/hooks/useMediaQueryMatch.d.ts +3 -0
- package/hooks/useMediaQueryMatch.d.ts.map +1 -0
- package/hooks/useMediaQueryMatch.js +12 -0
- package/index.css +2 -2
- package/index.d.ts +4 -0
- package/index.d.ts.map +1 -1
- package/index.js +82 -79
- package/models/sort-menu-button.d.ts +40 -0
- package/models/sort-menu-button.d.ts.map +1 -0
- package/package.json +3 -3
- package/utils/copy-to-clipboard.d.ts +0 -15
- package/utils/copy-to-clipboard.d.ts.map +1 -1
- package/utils/copy-to-clipboard.js +2 -59
- package/utils/markdown-rich-text.d.ts +16 -0
- package/utils/markdown-rich-text.d.ts.map +1 -0
- package/utils/markdown-rich-text.js +62 -0
- package/utils/org-unit.d.ts +22 -1
- package/utils/org-unit.d.ts.map +1 -1
- package/utils/org-unit.js +19 -16
package/utils/org-unit.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { OrgUnitAction, OrgUnit, OrgUnitAccess
|
|
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,
|
package/utils/org-unit.d.ts.map
CHANGED
|
@@ -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,
|
|
1
|
+
{"version":3,"file":"org-unit.d.ts","sourceRoot":"","sources":["../../src/utils/org-unit.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EACb,gBAAgB,EAChB,KAAK,OAAO,EACZ,KAAK,aAAa,EACnB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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
|
|
3
|
+
var n = "public", r = (e) => {
|
|
4
4
|
try {
|
|
5
5
|
return decodeURIComponent(e);
|
|
6
6
|
} catch {
|
|
7
7
|
return e;
|
|
8
8
|
}
|
|
9
|
-
},
|
|
10
|
-
let [
|
|
11
|
-
return
|
|
12
|
-
},
|
|
13
|
-
let t =
|
|
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:
|
|
17
|
-
})),
|
|
18
|
-
},
|
|
19
|
-
let n = i(
|
|
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
|
|
22
|
-
for (let { unit: t, folder:
|
|
23
|
-
return
|
|
24
|
-
},
|
|
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 {
|
|
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 };
|