@abyss-project/commons-front-core 4.0.3 → 5.0.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/dist/{CookieConsentSettings.component-B06_BnQP.js → CookieConsentSettings.component-Qv7WlFv1.js} +475 -515
- package/dist/components/Inputs/CloudImport/CloudImport.component.d.ts +4 -21
- package/dist/components/Inputs/CloudImport/CloudImport.component.spec.d.ts +1 -0
- package/dist/components/Inputs/CloudImport/cloud-picker.types.d.ts +46 -0
- package/dist/components/Inputs/CloudImport/index.d.ts +1 -0
- package/dist/components/Inputs/DropZone/DropZone.component.d.ts +9 -12
- package/dist/components/Inputs/DropZone/DropZone.component.spec.d.ts +1 -0
- package/dist/components/Inputs/index.d.ts +0 -1
- package/dist/components/Modals/ImportFromCloudModal/ImportFromCloudModal.component.d.ts +4 -18
- package/dist/components/Modals/index.d.ts +0 -1
- package/dist/components/PdfEditor/types.d.ts +3 -3
- package/dist/components/Support/types.d.ts +12 -22
- package/dist/components/Utils/ImportButton/ImportButton.component.d.ts +6 -27
- package/dist/cookie-consent.js +1 -1
- package/dist/hooks/index.d.ts +1 -1
- package/dist/hooks/use-cloud-picker.hook.d.ts +47 -0
- package/dist/hooks/use-cloud-picker.hook.spec.d.ts +1 -0
- package/dist/hooks/use-rich-intl.hook.d.ts +24 -48
- package/dist/{index-Dm4XMxYD.js → index-1CoDaadD.js} +1 -1
- package/dist/{index-DLz7OHk2.js → index-5owlFn6W.js} +2 -2
- package/dist/{index-lNrWguql.js → index-B0h04i9u.js} +3 -3
- package/dist/{index-CNqd4xCq.js → index-B2u_xNxk.js} +2 -2
- package/dist/{index-DTczxhDj.js → index-B4Ff-AfL.js} +26206 -27021
- package/dist/{index-COP395TG.js → index-BFEmh_EV.js} +2 -2
- package/dist/{index-BdJy1PZ3.js → index-BG716EPB.js} +3 -3
- package/dist/{index-CjbK-GxN.js → index-BsFPvS1n.js} +2 -2
- package/dist/{index-mGjvcLnl.js → index-BuIwrS34.js} +2 -2
- package/dist/{index-IO-duPWJ.js → index-C2RWcbVl.js} +2 -2
- package/dist/{index-Clum5fIZ.js → index-C8PVDVGQ.js} +2 -2
- package/dist/{index-CAgNKpI4.js → index-CDUED8YP.js} +2 -2
- package/dist/{index-B2e6OuRs.js → index-CLz2EEY4.js} +3 -3
- package/dist/{index-BKTtF_t2.js → index-CS_grWE4.js} +4 -4
- package/dist/{index-D674m7b5.js → index-C_-NoOPN.js} +2 -2
- package/dist/{index-qksRqwdT.js → index-Ci4SXMFB.js} +2 -2
- package/dist/{index-C8XPshUr.js → index-Cl8WUtRw.js} +2 -2
- package/dist/{index-CkrFIOKR.js → index-D1N8_Qim.js} +4 -4
- package/dist/{index-CHqYUVet.js → index-D5ylhtng.js} +2 -2
- package/dist/{index-pYtPsAyc.js → index-DHCXtcI7.js} +2 -2
- package/dist/{index-DrxSGikh.js → index-Y2TnZBi8.js} +4 -4
- package/dist/{index-B4t8DxtX.js → index-oKfJH01a.js} +3 -3
- package/dist/index.js +218 -219
- package/dist/translations/en.d.ts +4 -24
- package/dist/translations/fr.d.ts +4 -24
- package/dist/utils/cloud-space-url.utils.d.ts +7 -0
- package/dist/utils/cloud-space-url.utils.spec.d.ts +1 -0
- package/dist/utils/index.d.ts +1 -0
- package/package.json +5 -4
- package/dist/components/Inputs/CloudSave/CloudSave.component.d.ts +0 -17
- package/dist/components/Inputs/CloudSave/index.d.ts +0 -1
- package/dist/components/Modals/SaveCloudModal/SaveCloudModal.component.d.ts +0 -18
- package/dist/components/Modals/SaveCloudModal/index.d.ts +0 -1
- package/dist/hooks/use-cloud.hook.d.ts +0 -8
|
@@ -1,30 +1,13 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
-
import { ISpace, IFile
|
|
3
|
-
|
|
4
|
-
label: string;
|
|
5
|
-
avatar?: React.ReactNode;
|
|
6
|
-
subtitle?: string;
|
|
7
|
-
organizationId?: string | null;
|
|
8
|
-
organizationName?: string | null;
|
|
9
|
-
scope?: 'personal' | 'perso-in-org' | 'org-common' | 'project';
|
|
10
|
-
}
|
|
2
|
+
import { ISpace, IFile } from '@abyss-project/cloud';
|
|
3
|
+
import { CloudPicker } from './cloud-picker.types';
|
|
11
4
|
type Props = {
|
|
12
5
|
submitFiles: (cloud: ISpace, files: IFile[]) => void;
|
|
13
6
|
maxSize?: number;
|
|
14
7
|
multiple?: boolean;
|
|
15
8
|
accept?: string[];
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
getFileThumbnailUrl: (id: string) => string;
|
|
19
|
-
clouds: ISpace[] | null;
|
|
20
|
-
cloudShares: ISpace[] | null;
|
|
21
|
-
isLoadingClouds?: boolean;
|
|
22
|
-
onRefreshClouds: () => Promise<void>;
|
|
23
|
-
fetchCloudRepository: (cloudId: string) => Promise<IGetRepositoryCloudData>;
|
|
24
|
-
onActivateService: () => Promise<void>;
|
|
25
|
-
onCreateCloud: (name: string) => Promise<void>;
|
|
26
|
-
/** Host-supplied resolver: avatar + label for any space. */
|
|
27
|
-
getSpaceDisplay?: (space: ISpace) => CloudImportSpaceDisplay;
|
|
9
|
+
/** Picker state and actions, as returned by `useCloudPicker`. */
|
|
10
|
+
cloudPicker: CloudPicker;
|
|
28
11
|
};
|
|
29
12
|
declare const CloudImport: React.FC<Props>;
|
|
30
13
|
export default CloudImport;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { IFile, IGetRepositoryCloudData, ISpace } from '@abyss-project/cloud';
|
|
3
|
+
import { SpaceScope } from '../../../utils/space-display-name.utils';
|
|
4
|
+
/** Host-resolved presentation of a Space in the picker (avatar, label, org). */
|
|
5
|
+
export interface CloudImportSpaceDisplay {
|
|
6
|
+
label: string;
|
|
7
|
+
avatar?: React.ReactNode;
|
|
8
|
+
subtitle?: string;
|
|
9
|
+
organizationId?: string | null;
|
|
10
|
+
organizationName?: string | null;
|
|
11
|
+
scope?: SpaceScope;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Everything the AbyssCloud picker needs, as returned by `useCloudPicker`.
|
|
15
|
+
* A host never builds this by hand: it calls the hook and passes the result.
|
|
16
|
+
*/
|
|
17
|
+
export interface CloudPicker {
|
|
18
|
+
/** Root URL of the AbyssCloud front, used by the "Open in AbyssCloud" link. */
|
|
19
|
+
abyssCloudUrl: string;
|
|
20
|
+
getFileThumbnailUrl: (fileId: string) => string;
|
|
21
|
+
getSpaceDisplay?: (space: ISpace) => CloudImportSpaceDisplay;
|
|
22
|
+
/** Spaces owned by or provisioned for the user; `null` until the first load. */
|
|
23
|
+
clouds: ISpace[] | null;
|
|
24
|
+
/** Spaces shared with the user (accepted shares); `null` until the first load. */
|
|
25
|
+
cloudShares: ISpace[] | null;
|
|
26
|
+
isLoading: boolean;
|
|
27
|
+
/** True when the last provisioning failed (personal Space, listing or shares). */
|
|
28
|
+
hasError: boolean;
|
|
29
|
+
/**
|
|
30
|
+
* Activates AbyssCloud if needed, provisions the Spaces, then lists them.
|
|
31
|
+
* Resolves `true` when that succeeded, `false` when it failed (`hasError`).
|
|
32
|
+
* Called before the host's user is loaded, it waits for that user.
|
|
33
|
+
*/
|
|
34
|
+
refresh: () => Promise<boolean>;
|
|
35
|
+
/** Same provisioning as `refresh`, bound to the "Create my cloud" button. */
|
|
36
|
+
onCreateCloud: () => Promise<boolean>;
|
|
37
|
+
fetchCloudRepository: (spaceId: string) => Promise<IGetRepositoryCloudData>;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* A picker wired to an import action. Passing it to `ImportButton` or
|
|
41
|
+
* `DropZone` is what makes their AbyssCloud entry exist.
|
|
42
|
+
*/
|
|
43
|
+
export interface CloudImportWiring extends CloudPicker {
|
|
44
|
+
/** Receives the Space the files were picked from, and the files. */
|
|
45
|
+
onImport: (space: ISpace, files: IFile[]) => void | Promise<void>;
|
|
46
|
+
}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
import { SxProps } from '@mui/material';
|
|
3
|
-
import {
|
|
3
|
+
import { CloudImportWiring } from '../CloudImport/cloud-picker.types';
|
|
4
4
|
import { Accept } from 'react-dropzone';
|
|
5
5
|
type Props = {
|
|
6
6
|
circular?: boolean;
|
|
7
7
|
title?: React.ReactElement | string;
|
|
8
|
-
|
|
8
|
+
/** Files dropped or picked from the computer. */
|
|
9
|
+
onDrop: (acceptedFiles: File[]) => void;
|
|
9
10
|
multiple?: boolean;
|
|
10
11
|
disableMinHeight?: boolean;
|
|
11
12
|
customContentDropZone?: React.ReactElement;
|
|
@@ -14,17 +15,13 @@ type Props = {
|
|
|
14
15
|
dropzoneSx?: SxProps;
|
|
15
16
|
enableImportFromExternal?: boolean;
|
|
16
17
|
additionalContentDropZone?: React.ReactElement;
|
|
17
|
-
disableExternalImport?: boolean;
|
|
18
|
-
abyssCloudUrl: string;
|
|
19
|
-
getFileThumbnailUrl: (id: string) => string;
|
|
20
18
|
customHelperContent?: React.ReactElement;
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
onCreateCloud?: (name: string) => Promise<void>;
|
|
19
|
+
/**
|
|
20
|
+
* AbyssCloud picker (from `useCloudPicker`) plus the import action, which
|
|
21
|
+
* receives the Space the files were picked from. The cloud import button
|
|
22
|
+
* exists only when this is passed.
|
|
23
|
+
*/
|
|
24
|
+
cloudImport?: CloudImportWiring;
|
|
28
25
|
};
|
|
29
26
|
declare const DropZone: React.FC<Props>;
|
|
30
27
|
export default DropZone;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -7,7 +7,6 @@ export * from './PasswordInput';
|
|
|
7
7
|
export * from './AbyssMarkdownEditor';
|
|
8
8
|
export * from './AbyssNumberField';
|
|
9
9
|
export * from './CloudImport';
|
|
10
|
-
export * from './CloudSave';
|
|
11
10
|
export * from './DropZone';
|
|
12
11
|
export * from './AbyssSelectProject';
|
|
13
12
|
export * from './AbyssSelectOrganization';
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
-
import { ISpace, IFile
|
|
2
|
+
import { ISpace, IFile } from '@abyss-project/cloud';
|
|
3
|
+
import { CloudPicker } from '../../Inputs/CloudImport/cloud-picker.types';
|
|
3
4
|
type Props = {
|
|
4
5
|
isOpen: boolean;
|
|
5
6
|
onCancel: () => Promise<void>;
|
|
@@ -7,23 +8,8 @@ type Props = {
|
|
|
7
8
|
maxSize?: number;
|
|
8
9
|
multiple?: boolean;
|
|
9
10
|
accept?: string[];
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
clouds: ISpace[] | null;
|
|
13
|
-
cloudShares: ISpace[] | null;
|
|
14
|
-
isLoadingClouds?: boolean;
|
|
15
|
-
onRefreshClouds: () => Promise<void>;
|
|
16
|
-
fetchCloudRepository: (cloudId: string) => Promise<IGetRepositoryCloudData>;
|
|
17
|
-
onActivateService: () => Promise<void>;
|
|
18
|
-
onCreateCloud: (name: string) => Promise<void>;
|
|
19
|
-
getSpaceDisplay?: (space: ISpace) => {
|
|
20
|
-
label: string;
|
|
21
|
-
avatar?: React.ReactNode;
|
|
22
|
-
subtitle?: string;
|
|
23
|
-
organizationId?: string | null;
|
|
24
|
-
organizationName?: string | null;
|
|
25
|
-
scope?: 'personal' | 'perso-in-org' | 'org-common' | 'project';
|
|
26
|
-
};
|
|
11
|
+
/** Picker state and actions, as returned by `useCloudPicker`. */
|
|
12
|
+
cloudPicker: CloudPicker;
|
|
27
13
|
};
|
|
28
14
|
declare const ImportFromCloudModal: React.FC<Props>;
|
|
29
15
|
export default ImportFromCloudModal;
|
|
@@ -2,6 +2,5 @@ export * from './AbyssModal';
|
|
|
2
2
|
export * from './ConfirmModal';
|
|
3
3
|
export * from './ImportFromCloudModal';
|
|
4
4
|
export * from './QRCodeModal';
|
|
5
|
-
export * from './SaveCloudModal';
|
|
6
5
|
export * from './UserSettingsModal';
|
|
7
6
|
export { default as UserSettings } from './UserSettingsModal/UserSettings.compat';
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { AssetKind } from '@abyss-project/main';
|
|
3
3
|
import { ISpace, IFile } from '@abyss-project/cloud';
|
|
4
|
-
import {
|
|
4
|
+
import { CloudPicker } from '../Inputs/CloudImport/cloud-picker.types';
|
|
5
5
|
/**
|
|
6
6
|
* Wiring for cloud-backed insertions inside the editor (currently only the
|
|
7
|
-
* "Insert pages" button)
|
|
7
|
+
* "Insert pages" button): the picker returned by `useCloudPicker`, plus a
|
|
8
8
|
* helper to materialize bytes from the picked file.
|
|
9
9
|
*/
|
|
10
|
-
export interface PdfEditorCloudImportProps extends
|
|
10
|
+
export interface PdfEditorCloudImportProps extends CloudPicker {
|
|
11
11
|
/** Resolve the raw bytes for a picked cloud file (e.g. via presigned URL). */
|
|
12
12
|
downloadCloudFile: (cloud: ISpace, file: IFile) => Promise<ArrayBuffer>;
|
|
13
13
|
}
|
|
@@ -1,28 +1,12 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { ISupportTicket, ISupportTicketMessage, ISupportTicketActivity, ISupportTicketAttachment, ISupportTicketTag, SupportTicketStatus, SupportTicketCategory, SupportTicketPriority, SupportTicketAction, AbyssService } from '@abyss-project/main';
|
|
3
|
-
import {
|
|
3
|
+
import { CloudImportWiring } from '../Inputs/CloudImport/cloud-picker.types';
|
|
4
4
|
export interface SupportCloudImportProps {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
clouds?: ISpace[] | null;
|
|
11
|
-
cloudShares?: ISpace[] | null;
|
|
12
|
-
isLoadingClouds?: boolean;
|
|
13
|
-
onRefreshClouds?: () => Promise<void>;
|
|
14
|
-
fetchCloudRepository?: (cloudId: string) => Promise<IGetRepositoryCloudData>;
|
|
15
|
-
onActivateService?: () => Promise<void>;
|
|
16
|
-
onCreateCloud?: (name: string, organizationId?: string) => Promise<void>;
|
|
17
|
-
handleImportFromCloud?: (cloud: ISpace, files: IFile[]) => Promise<void>;
|
|
18
|
-
getSpaceDisplay?: (space: ISpace) => {
|
|
19
|
-
label: string;
|
|
20
|
-
avatar?: ReactNode;
|
|
21
|
-
subtitle?: string;
|
|
22
|
-
organizationId?: string | null;
|
|
23
|
-
organizationName?: string | null;
|
|
24
|
-
scope?: 'personal' | 'perso-in-org' | 'org-common' | 'project';
|
|
25
|
-
};
|
|
5
|
+
/**
|
|
6
|
+
* AbyssCloud picker (from `useCloudPicker`) plus the import action. Without
|
|
7
|
+
* it, the attachment pickers offer no AbyssCloud entry.
|
|
8
|
+
*/
|
|
9
|
+
cloudImport?: CloudImportWiring;
|
|
26
10
|
}
|
|
27
11
|
export interface SupportTicketListFilters {
|
|
28
12
|
status?: SupportTicketStatus[];
|
|
@@ -159,6 +143,8 @@ export interface SupportActionButtonsProps {
|
|
|
159
143
|
}
|
|
160
144
|
export interface SupportAttachmentsPanelProps extends SupportCloudImportProps {
|
|
161
145
|
attachments: ISupportTicketAttachment[];
|
|
146
|
+
/** Thumbnail URL of an attachment's preview image. */
|
|
147
|
+
getFileThumbnailUrl: (id: string) => string;
|
|
162
148
|
onUpload?: (file: File) => void;
|
|
163
149
|
onDelete?: (attachmentId: string) => void;
|
|
164
150
|
onDownload?: (attachment: ISupportTicketAttachment) => void;
|
|
@@ -199,6 +185,8 @@ export interface SupportSidebarUser {
|
|
|
199
185
|
}
|
|
200
186
|
export interface SupportSidebarProps extends SupportCloudImportProps {
|
|
201
187
|
ticket: ISupportTicket;
|
|
188
|
+
/** Thumbnail URL of an attachment's preview image. */
|
|
189
|
+
getFileThumbnailUrl: (id: string) => string;
|
|
202
190
|
isAdmin?: boolean;
|
|
203
191
|
currentUserId?: string;
|
|
204
192
|
onChangePriority?: (priority: SupportTicketPriority) => void;
|
|
@@ -256,6 +244,8 @@ export interface SupportSidebarProps extends SupportCloudImportProps {
|
|
|
256
244
|
}
|
|
257
245
|
export interface SupportTicketDetailProps extends SupportCloudImportProps {
|
|
258
246
|
ticket: ISupportTicket;
|
|
247
|
+
/** Thumbnail URL of an attachment's preview image. */
|
|
248
|
+
getFileThumbnailUrl: (id: string) => string;
|
|
259
249
|
messages: ISupportTicketMessage[];
|
|
260
250
|
currentUserId: string;
|
|
261
251
|
/** Message to scroll to and highlight once, read by the host page from `?messageId=`. */
|
|
@@ -1,40 +1,19 @@
|
|
|
1
1
|
import { default as React, ChangeEvent } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { CloudImportWiring } from '../../Inputs/CloudImport/cloud-picker.types';
|
|
3
3
|
export declare const MAX_PICTURE_SIZE: number;
|
|
4
4
|
type Props = {
|
|
5
5
|
children: React.ReactElement;
|
|
6
6
|
isLoading: boolean;
|
|
7
7
|
handleUploadFromUrl?: (url: string) => Promise<void>;
|
|
8
8
|
handleFileUpload: (event: ChangeEvent<HTMLInputElement>) => Promise<void>;
|
|
9
|
-
handleImportFromCloud: (cloud: ISpace, files: IFile[]) => Promise<void>;
|
|
10
9
|
multiple?: boolean;
|
|
11
10
|
maxSize?: number;
|
|
12
11
|
accept?: string[];
|
|
13
|
-
/**
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
getFileThumbnailUrl: (id: string) => string;
|
|
19
|
-
clouds?: ISpace[] | null;
|
|
20
|
-
cloudShares?: ISpace[] | null;
|
|
21
|
-
isLoadingClouds?: boolean;
|
|
22
|
-
onRefreshClouds?: () => Promise<void>;
|
|
23
|
-
fetchCloudRepository?: (cloudId: string) => Promise<IGetRepositoryCloudData>;
|
|
24
|
-
onActivateService?: () => Promise<void>;
|
|
25
|
-
onCreateCloud?: (name: string) => Promise<void>;
|
|
26
|
-
/** If true, show the cloud import option even without full cloud props */
|
|
27
|
-
showCloudOption?: boolean;
|
|
28
|
-
/** Optional resolver injecting avatar + label per ISpace into the cloud
|
|
29
|
-
* picker (so it matches the host's avatar conventions). */
|
|
30
|
-
getSpaceDisplay?: (space: ISpace) => {
|
|
31
|
-
label: string;
|
|
32
|
-
avatar?: React.ReactNode;
|
|
33
|
-
subtitle?: string;
|
|
34
|
-
organizationId?: string | null;
|
|
35
|
-
organizationName?: string | null;
|
|
36
|
-
scope?: 'personal' | 'perso-in-org' | 'org-common' | 'project';
|
|
37
|
-
};
|
|
12
|
+
/**
|
|
13
|
+
* AbyssCloud picker (from `useCloudPicker`) plus the import action. The
|
|
14
|
+
* "AbyssCloud" entry exists only when this is passed.
|
|
15
|
+
*/
|
|
16
|
+
cloudImport?: CloudImportWiring;
|
|
38
17
|
};
|
|
39
18
|
declare const ImportButton: React.FC<Props>;
|
|
40
19
|
export default ImportButton;
|
package/dist/cookie-consent.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as s, c as a, C as n, a as C, D as i, R as t, V as r, d as A, f as k, r as c, e as l, u as D, b as E, w as I } from "./CookieConsentSettings.component-
|
|
1
|
+
import { A as s, c as a, C as n, a as C, D as i, R as t, V as r, d as A, f as k, r as c, e as l, u as D, b as E, w as I } from "./CookieConsentSettings.component-Qv7WlFv1.js";
|
|
2
2
|
export {
|
|
3
3
|
s as AbyssCookieConsentProvider,
|
|
4
4
|
a as COOKIE_NAME,
|
package/dist/hooks/index.d.ts
CHANGED
|
@@ -2,6 +2,6 @@ export * from './confirm-modal';
|
|
|
2
2
|
export * from './use-sse.hook';
|
|
3
3
|
export * from './use-theme-transition.hook';
|
|
4
4
|
export * from './use-rich-intl.hook';
|
|
5
|
-
export * from './use-cloud.hook';
|
|
5
|
+
export * from './use-cloud-picker.hook';
|
|
6
6
|
export * from './use-public-users.hook';
|
|
7
7
|
export * from './use-date-fns-locale.hook';
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { ISpace } from '@abyss-project/cloud';
|
|
2
|
+
import { CloudImportSpaceDisplay, CloudPicker } from '../components/Inputs/CloudImport/cloud-picker.types';
|
|
3
|
+
/**
|
|
4
|
+
* Every call to abyss-main goes through the host: this package pins its own
|
|
5
|
+
* `@abyss-project/main`, whose `AbyssCore` is never the one a satellite front
|
|
6
|
+
* configures. Only `AbyssCloudCore` (a single copy shared with the host, see the
|
|
7
|
+
* peer dependency) is called directly.
|
|
8
|
+
*/
|
|
9
|
+
export interface UseCloudPickerParams {
|
|
10
|
+
/**
|
|
11
|
+
* The signed-in user. Only `enabledServices` is read: AbyssCloud is activated
|
|
12
|
+
* when it is missing. While it is `null` (user not loaded yet) nothing runs:
|
|
13
|
+
* a `refresh()` called meanwhile waits and runs once the user is known.
|
|
14
|
+
* Anonymous hosts never render the picker.
|
|
15
|
+
*/
|
|
16
|
+
user: {
|
|
17
|
+
enabledServices: readonly string[];
|
|
18
|
+
} | null;
|
|
19
|
+
/**
|
|
20
|
+
* True when the host knows `user` will not arrive (its user query failed,
|
|
21
|
+
* no session, offline). A waiting or new `refresh()` then ends in error
|
|
22
|
+
* (`hasError`, the "Create my cloud" retry) instead of waiting forever; a
|
|
23
|
+
* retry checks again. Required: every host decides what "unavailable" means.
|
|
24
|
+
*/
|
|
25
|
+
isUserUnavailable: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Activates AbyssCloud for the signed-in user with the host's own main SDK
|
|
28
|
+
* (`POST /auth/activate-service`), then reloads the host's user. Called only
|
|
29
|
+
* when `user` lacks `ABYSS_CLOUD`; a rejection puts the picker in error.
|
|
30
|
+
*/
|
|
31
|
+
activateCloudService: () => Promise<unknown>;
|
|
32
|
+
/**
|
|
33
|
+
* Ids of the organizations the user is a member of, read with the host's own
|
|
34
|
+
* main SDK. A rejection is treated as no organization.
|
|
35
|
+
*/
|
|
36
|
+
listOrganizationIds: () => Promise<string[]>;
|
|
37
|
+
abyssCloudUrl: string;
|
|
38
|
+
getFileThumbnailUrl: (fileId: string) => string;
|
|
39
|
+
getSpaceDisplay?: (space: ISpace) => CloudImportSpaceDisplay;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Single source of the AbyssCloud picker state for every Abyss front. Nothing
|
|
43
|
+
* runs until the picker opens (`CloudImport` calls `refresh` on mount): it then
|
|
44
|
+
* activates AbyssCloud if the user lacks it, provisions the personal Space and
|
|
45
|
+
* the common + perso Space of each member organization, and lists them.
|
|
46
|
+
*/
|
|
47
|
+
export declare const useCloudPicker: ({ user, isUserUnavailable, activateCloudService, listOrganizationIds, abyssCloudUrl, getFileThumbnailUrl, getSpaceDisplay, }: UseCloudPickerParams) => CloudPicker;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -21,6 +21,14 @@ export declare const translations: {
|
|
|
21
21
|
title: string;
|
|
22
22
|
content: string;
|
|
23
23
|
};
|
|
24
|
+
"mcp-connection-approval-requested": {
|
|
25
|
+
title: string;
|
|
26
|
+
content: string;
|
|
27
|
+
};
|
|
28
|
+
"mcp-connection-rejected": {
|
|
29
|
+
title: string;
|
|
30
|
+
content: string;
|
|
31
|
+
};
|
|
24
32
|
"subscription-created": {
|
|
25
33
|
title: string;
|
|
26
34
|
content: string;
|
|
@@ -793,13 +801,6 @@ export declare const translations: {
|
|
|
793
801
|
'open-modal-button': string;
|
|
794
802
|
modal: {
|
|
795
803
|
title: string;
|
|
796
|
-
loading: string;
|
|
797
|
-
'service-not-enabled': string;
|
|
798
|
-
'service-not-enabled-description': string;
|
|
799
|
-
'enable-service-button': string;
|
|
800
|
-
'service-unreachable': string;
|
|
801
|
-
retry: string;
|
|
802
|
-
'no-cloud-available': string;
|
|
803
804
|
'too-big-filtered-file': string;
|
|
804
805
|
'import-button': string;
|
|
805
806
|
'space-label': string;
|
|
@@ -811,27 +812,14 @@ export declare const translations: {
|
|
|
811
812
|
'files-selected': string;
|
|
812
813
|
'open-in-cloud': string;
|
|
813
814
|
refresh: string;
|
|
814
|
-
'
|
|
815
|
+
'refresh-error': string;
|
|
816
|
+
'create-error': {
|
|
815
817
|
title: string;
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
label: string;
|
|
819
|
-
placeholder: string;
|
|
820
|
-
};
|
|
821
|
-
};
|
|
822
|
-
'create-cloud-button': string;
|
|
818
|
+
description: string;
|
|
819
|
+
'create-button': string;
|
|
823
820
|
};
|
|
824
821
|
};
|
|
825
822
|
};
|
|
826
|
-
'save-cloud': {
|
|
827
|
-
modal: {
|
|
828
|
-
title: string;
|
|
829
|
-
'import-button': string;
|
|
830
|
-
'success-toast': string;
|
|
831
|
-
'no-space-toast': string;
|
|
832
|
-
'open-in-cloud': string;
|
|
833
|
-
};
|
|
834
|
-
};
|
|
835
823
|
'import-button': string;
|
|
836
824
|
'import-file-button': string;
|
|
837
825
|
'import-url-button': string;
|
|
@@ -1879,6 +1867,14 @@ export declare const translations: {
|
|
|
1879
1867
|
title: string;
|
|
1880
1868
|
content: string;
|
|
1881
1869
|
};
|
|
1870
|
+
"mcp-connection-approval-requested": {
|
|
1871
|
+
title: string;
|
|
1872
|
+
content: string;
|
|
1873
|
+
};
|
|
1874
|
+
"mcp-connection-rejected": {
|
|
1875
|
+
title: string;
|
|
1876
|
+
content: string;
|
|
1877
|
+
};
|
|
1882
1878
|
"subscription-created": {
|
|
1883
1879
|
title: string;
|
|
1884
1880
|
content: string;
|
|
@@ -2651,13 +2647,6 @@ export declare const translations: {
|
|
|
2651
2647
|
'open-modal-button': string;
|
|
2652
2648
|
modal: {
|
|
2653
2649
|
title: string;
|
|
2654
|
-
loading: string;
|
|
2655
|
-
'service-not-enabled': string;
|
|
2656
|
-
'service-not-enabled-description': string;
|
|
2657
|
-
'enable-service-button': string;
|
|
2658
|
-
'service-unreachable': string;
|
|
2659
|
-
retry: string;
|
|
2660
|
-
'no-cloud-available': string;
|
|
2661
2650
|
'too-big-filtered-file': string;
|
|
2662
2651
|
'import-button': string;
|
|
2663
2652
|
'space-label': string;
|
|
@@ -2669,27 +2658,14 @@ export declare const translations: {
|
|
|
2669
2658
|
'files-selected': string;
|
|
2670
2659
|
'open-in-cloud': string;
|
|
2671
2660
|
refresh: string;
|
|
2672
|
-
'
|
|
2661
|
+
'refresh-error': string;
|
|
2662
|
+
'create-error': {
|
|
2673
2663
|
title: string;
|
|
2674
|
-
|
|
2675
|
-
|
|
2676
|
-
label: string;
|
|
2677
|
-
placeholder: string;
|
|
2678
|
-
};
|
|
2679
|
-
};
|
|
2680
|
-
'create-cloud-button': string;
|
|
2664
|
+
description: string;
|
|
2665
|
+
'create-button': string;
|
|
2681
2666
|
};
|
|
2682
2667
|
};
|
|
2683
2668
|
};
|
|
2684
|
-
'save-cloud': {
|
|
2685
|
-
modal: {
|
|
2686
|
-
title: string;
|
|
2687
|
-
'import-button': string;
|
|
2688
|
-
'success-toast': string;
|
|
2689
|
-
'no-space-toast': string;
|
|
2690
|
-
'open-in-cloud': string;
|
|
2691
|
-
};
|
|
2692
|
-
};
|
|
2693
2669
|
'import-button': string;
|
|
2694
2670
|
'import-file-button': string;
|
|
2695
2671
|
'import-url-button': string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { L as D, E as h, C as L } from "./index-
|
|
2
|
-
import { s as H, t as n, b as B, a as K, L as M, e as OO, i as eO, f as iO, j as f, g as aO, o as nO, I as rO, d as QO, n as d } from "./index-
|
|
1
|
+
import { L as D, E as h, C as L } from "./index-1CoDaadD.js";
|
|
2
|
+
import { s as H, t as n, b as B, a as K, L as M, e as OO, i as eO, f as iO, j as f, g as aO, o as nO, I as rO, d as QO, n as d } from "./index-B4Ff-AfL.js";
|
|
3
3
|
const tO = 1, Z = 194, j = 195, oO = 196, x = 197, dO = 198, sO = 199, lO = 200, TO = 2, E = 3, u = 201, SO = 24, pO = 25, qO = 49, gO = 50, PO = 55, mO = 56, $O = 57, hO = 59, cO = 60, fO = 61, XO = 62, yO = 63, zO = 65, WO = 238, vO = 71, RO = 241, kO = 242, _O = 243, xO = 244, uO = 245, UO = 246, bO = 247, VO = 248, Y = 72, GO = 249, wO = 250, ZO = 251, jO = 252, EO = 253, YO = 254, FO = 255, CO = 256, JO = 73, AO = 77, IO = 263, NO = 112, DO = 130, LO = 151, HO = 152, BO = 155, p = 10, q = 13, k = 32, c = 9, _ = 35, KO = 40, MO = 46, R = 123, U = 125, F = 39, C = 34, b = 92, Oe = 111, ee = 120, ie = 78, ae = 117, ne = 85, re = /* @__PURE__ */ new Set([
|
|
4
4
|
pO,
|
|
5
5
|
qO,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { a as t, L as i, i as n, f as $, c as y, g as P, s as X, t as O } from "./index-
|
|
2
|
-
import { defineCSSCompletionSource as m } from "./index-
|
|
3
|
-
import { L as c, E as S } from "./index-
|
|
1
|
+
import { a as t, L as i, i as n, f as $, c as y, g as P, s as X, t as O } from "./index-B4Ff-AfL.js";
|
|
2
|
+
import { defineCSSCompletionSource as m } from "./index-D5ylhtng.js";
|
|
3
|
+
import { L as c, E as S } from "./index-1CoDaadD.js";
|
|
4
4
|
const f = 110, l = 1, s = 2, r = [
|
|
5
5
|
9,
|
|
6
6
|
10,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { L as G, E as A, C as N } from "./index-
|
|
2
|
-
import { s as I, t as p, E as Y, a as j, L as U, e as k, h as Z, i as B, f as D, H as M } from "./index-
|
|
1
|
+
import { L as G, E as A, C as N } from "./index-1CoDaadD.js";
|
|
2
|
+
import { s as I, t as p, E as Y, a as j, L as U, e as k, h as Z, i as B, f as D, H as M } from "./index-B4Ff-AfL.js";
|
|
3
3
|
const h = 1, F = 2, L = 3, H = 4, K = 5, J = 36, ee = 37, te = 38, Oe = 11, oe = 13;
|
|
4
4
|
function re(e) {
|
|
5
5
|
return e == 45 || e == 46 || e == 58 || e >= 65 && e <= 90 || e == 95 || e >= 97 && e <= 122 || e >= 161;
|