@abyss-project/commons-front-core 13.3.0 → 15.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/README.md +1 -1
- package/catalog/captures-plan.ts +4 -1
- package/catalog/catalog-entries.ts +6 -1
- package/catalog/expected-error.ts +6 -0
- package/catalog/pages/CookieConsent.tsx +38 -0
- package/catalog/pages/ErrorBoundary.tsx +22 -0
- package/catalog/pages/PasswordField.tsx +62 -0
- package/catalog/pages/Toast.tsx +17 -6
- package/catalog/pages/index.ts +6 -0
- package/catalog/specs/captures.spec.ts +10 -0
- package/catalog/specs/catalog-page.ts +6 -1
- package/catalog/specs/write-capture-index.ts +1 -0
- package/dist/CookieConsentSettings-B7NfjgaI.js +505 -0
- package/dist/{use-rich-intl.hook-BETUyCkW.js → Surface-BEhoEhyC.js} +844 -161
- package/dist/Tabs-DJ9_ZFjM.js +1946 -0
- package/dist/auth/components/AuthFlow/auth-flow.types.d.ts +2 -0
- package/dist/auth/components/AuthFlow/steps/MfaEnrollmentStep.component.d.ts +2 -0
- package/dist/auth/components/AuthFlow/steps/MfaStep.component.d.ts +10 -4
- package/dist/auth/components/AuthFlow/steps/PasskeyNudgeStep.component.d.ts +3 -1
- package/dist/auth/components/AuthHeroLayout/auth-hero-gradient.d.ts +18 -0
- package/dist/auth/components/MfaRequirementBanner/MfaRequirementBanner.component.d.ts +3 -1
- package/dist/auth/components/SecuritySettings/SecuritySettings.component.d.ts +1 -1
- package/dist/auth/components/SecuritySettings/sections/PasskeysSection.component.d.ts +6 -1
- package/dist/auth/components/SecuritySettings/sections/RecoveryCodesSection.component.d.ts +3 -1
- package/dist/auth/components/SecuritySettings/sections/TrustedDevicesSection.component.d.ts +6 -0
- package/dist/auth/components/index.d.ts +1 -0
- package/dist/auth/components/shared/AuthLoadingScreen.component.d.ts +5 -0
- package/dist/auth/components/shared/SingleDevicePasskeyAdvice.component.d.ts +13 -0
- package/dist/auth/components/shared/passkey-ceremonies.d.ts +6 -1
- package/dist/auth/components/shared/support-contact.d.ts +2 -0
- package/dist/auth/components/shared/use-async-resource.hook.d.ts +4 -1
- package/dist/auth/components/test-support/auth-sdk.mock.d.ts +5 -0
- package/dist/auth/components/test-support/auth-test-harness.d.ts +3 -0
- package/dist/clsx-OuTLNxxd.js +16 -0
- package/dist/{legacy/components/CookieConsent/CookieConsentBanner.component.d.ts → components/business/CookieConsent/CookieConsentBanner.d.ts} +1 -2
- package/dist/components/business/CookieConsent/CookieConsentSettings.d.ts +1 -0
- package/dist/{legacy/components → components/business}/CookieConsent/index.d.ts +2 -2
- package/dist/components/business/Support/AbyssServiceSelect.component.d.ts +26 -0
- package/dist/components/business/Support/SupportActionButtons.component.d.ts +7 -0
- package/dist/components/business/Support/SupportActivityLog.component.d.ts +7 -0
- package/dist/components/business/Support/SupportAttachmentsPanel.component.d.ts +7 -0
- package/dist/components/business/Support/SupportCategoryChip.component.d.ts +12 -0
- package/dist/components/business/Support/SupportCategoryGroupCards.component.d.ts +2 -0
- package/dist/components/business/Support/SupportCategorySelect.component.d.ts +21 -0
- package/dist/components/business/Support/SupportCreateTextField.d.ts +17 -0
- package/dist/components/business/Support/SupportMessageAttachment.component.d.ts +9 -0
- package/dist/components/business/Support/SupportMessageInput.component.d.ts +7 -0
- package/dist/components/business/Support/SupportMessageLink.component.d.ts +8 -0
- package/dist/components/business/Support/SupportMessageLink.component.spec.d.ts +1 -0
- package/dist/components/business/Support/SupportMessageThread.component.d.ts +8 -0
- package/dist/components/business/Support/SupportMessageThread.component.spec.d.ts +1 -0
- package/dist/components/business/Support/SupportPill.d.ts +18 -0
- package/dist/components/business/Support/SupportPriorityChip.component.d.ts +3 -0
- package/dist/components/business/Support/SupportSidebar.component.d.ts +7 -0
- package/dist/components/business/Support/SupportSidebar.component.spec.d.ts +1 -0
- package/dist/components/business/Support/SupportStatusBadge.component.d.ts +3 -0
- package/dist/components/business/Support/SupportStatusTimeline.component.d.ts +15 -0
- package/dist/components/business/Support/SupportSystemMessage.component.d.ts +11 -0
- package/dist/components/business/Support/SupportSystemMessage.component.spec.d.ts +1 -0
- package/dist/components/business/Support/SupportTagEditor.d.ts +15 -0
- package/dist/components/business/Support/SupportTicketCreateForm.component.d.ts +2 -0
- package/dist/components/business/Support/SupportTicketCreateForm.component.spec.d.ts +1 -0
- package/dist/components/business/Support/SupportTicketCreateStepper.component.d.ts +2 -0
- package/dist/components/business/Support/SupportTicketCreateStepper.component.spec.d.ts +1 -0
- package/dist/components/business/Support/SupportTicketDetail.component.d.ts +8 -0
- package/dist/components/business/Support/SupportTicketDetail.component.spec.d.ts +1 -0
- package/dist/components/business/Support/SupportTicketDetail.mobile-layout.spec.d.ts +1 -0
- package/dist/components/business/Support/SupportTicketList.component.spec.d.ts +1 -0
- package/dist/components/business/Support/SupportTicketList.week-preset.spec.d.ts +1 -0
- package/dist/components/business/Support/SupportTicketListFilterBar.d.ts +15 -0
- package/dist/components/business/Support/SupportTopBar.component.d.ts +7 -0
- package/dist/components/business/Support/support-action.d.ts +17 -0
- package/dist/components/business/Support/support-action.logic.d.ts +12 -0
- package/dist/components/business/Support/support-action.logic.spec.d.ts +1 -0
- package/dist/components/business/Support/support-attachment.logic.spec.d.ts +1 -0
- package/dist/components/business/Support/support-author.logic.spec.d.ts +1 -0
- package/dist/components/business/Support/support-create-stepper.logic.spec.d.ts +1 -0
- package/dist/components/business/Support/support-create.logic.d.ts +28 -0
- package/dist/components/business/Support/support-create.logic.spec.d.ts +1 -0
- package/dist/components/business/Support/support-message-anchor.d.ts +4 -0
- package/dist/components/business/Support/support-message-input.logic.spec.d.ts +1 -0
- package/dist/components/business/Support/support-service.logic.spec.d.ts +1 -0
- package/dist/components/business/Support/support-status-timeline.logic.spec.d.ts +1 -0
- package/dist/components/business/Support/support-tone.d.ts +11 -0
- package/dist/components/business/Support/test-support/support-detail.fixtures.d.ts +7 -0
- package/dist/components/business/Support/test-support/support-thread.fixtures.d.ts +9 -0
- package/dist/{legacy/components → components/business}/Support/types.d.ts +13 -4
- package/dist/components/business/Support/use-support-create-error-message.hook.d.ts +4 -0
- package/dist/components/business/index.d.ts +23 -0
- package/dist/components/inputs/ExpressionSearch/ExpressionSearch.d.ts +6 -1
- package/dist/components/inputs/FormField/FormField.d.ts +5 -1
- package/dist/components/inputs/PasswordField/PasswordField.d.ts +40 -0
- package/dist/components/inputs/PasswordField/PasswordField.spec.d.ts +1 -0
- package/dist/components/inputs/SegmentedControl/SegmentedControl.d.ts +9 -1
- package/dist/components/inputs/index.d.ts +1 -0
- package/dist/components/layers/Toast/Toast.d.ts +3 -18
- package/dist/components/layers/Toast/toast-clearance.d.ts +6 -0
- package/dist/components/layers/Toast/toast-store.d.ts +76 -0
- package/dist/components/states/ErrorBoundary/ErrorBoundary.d.ts +17 -0
- package/dist/components/states/ErrorBoundary/ErrorBoundary.spec.d.ts +1 -0
- package/dist/components/states/PageState/PageState.d.ts +3 -1
- package/dist/components/states/index.d.ts +1 -0
- package/dist/cookie-consent.d.ts +1 -1
- package/dist/cookie-consent.js +14 -15
- package/dist/demo/DemoBanner/DemoBanner.d.ts +16 -0
- package/dist/demo/DemoBanner/DemoBanner.spec.d.ts +1 -0
- package/dist/demo/DemoBanner/index.d.ts +1 -0
- package/dist/demo/demo-blocked.interceptor.d.ts +7 -0
- package/dist/demo/demo.en.d.ts +17 -0
- package/dist/demo/demo.fr.d.ts +17 -0
- package/dist/demo/index.d.ts +3 -0
- package/dist/demo/tests/demo-blocked.interceptor.spec.d.ts +1 -0
- package/dist/demo/use-demo-account.hook.d.ts +19 -0
- package/dist/design-theme-N9jJSXdK.js +27605 -0
- package/dist/{editors-CUsZNFfw.js → editors-QM76tqZI.js} +84 -84
- package/dist/editors.js +1 -1
- package/dist/hooks/use-rich-intl.hook.d.ts +210 -0
- package/dist/{index-CiDg4J7c.js → index-3-SmpH5N.js} +4 -4
- package/dist/{index-DErJ9c2q.js → index-4b2f7sdW.js} +2 -2
- package/dist/{index-DEBTvCWD.js → index-5OVR3WNo.js} +3 -3
- package/dist/{index-Lyt4_W7a.js → index-BKAfoA1a.js} +2 -2
- package/dist/{AbyssCloud-D_AbU9k7.js → index-C27b790L.js} +1438 -1083
- package/dist/{index-CYUixRIB.js → index-C6jhogFt.js} +2 -2
- package/dist/{index-D1ro2oTw.js → index-CM5COMvb.js} +2 -2
- package/dist/{index-BQ4GXlMJ.js → index-COUUAr5G.js} +1 -1
- package/dist/{index-C7a2XXcz.js → index-CQU0eEXk.js} +4 -4
- package/dist/{index-YzYX-H93.js → index-Ce0rv5wr.js} +3 -3
- package/dist/{index-CM0x-TnE.js → index-D1M_muSg.js} +2 -2
- package/dist/{index-CDpC4_po.js → index-D8ncJrf1.js} +2 -2
- package/dist/{index-DuMzZrqc.js → index-DA-HUFp6.js} +2 -2
- package/dist/{index-BzoBMWdL.js → index-DCk0q3d7.js} +3 -3
- package/dist/{index-Bn4gTAno.js → index-DW3SBSsW.js} +2 -2
- package/dist/{index-BhFOCfCj.js → index-DYXAfA_s.js} +2 -2
- package/dist/{index-pnfk6VZ7.js → index-DmAoL9-1.js} +4 -4
- package/dist/{index-CjV5ui_B.js → index-Taee9VIc.js} +2 -2
- package/dist/{index-GTkZik4b.js → index-jZGexiyT.js} +3 -3
- package/dist/{index-Ba41aBBN.js → index-mmrA4ErC.js} +2 -2
- package/dist/{index-TB7ekLl-.js → index-nKbvjf2P.js} +2 -2
- package/dist/{index-DobX4g2g.js → index-pX3CTxFd.js} +2 -2
- package/dist/index.d.ts +1 -0
- package/dist/index.js +14545 -9182
- package/dist/legacy/components/Spotlight/ProjectLinkSelector/index.d.ts +1 -4
- package/dist/legacy/components/index.d.ts +1 -2
- package/dist/legacy/legacy-support-removed.spec.d.ts +1 -0
- package/dist/legacy.js +13350 -17922
- package/dist/theme/index.d.ts +1 -1
- package/dist/translations/en.d.ts +104 -0
- package/dist/translations/fr.d.ts +104 -0
- package/dist/utils/index.d.ts +2 -0
- package/dist/utils/project-link-mode.d.ts +4 -0
- package/dist/utils/project-link-wording.utils.d.ts +1 -1
- package/dist/utils/service-config.d.ts +8 -0
- package/dist/utils/service-config.spec.d.ts +1 -0
- package/package.json +3 -3
- package/vite.config.ts +1 -1
- package/dist/AbyssCookieConsentProvider-Ds99df0E.js +0 -4562
- package/dist/CookieConsentSettings.component-DoWLHqw5.js +0 -78
- package/dist/Tabs-C1qcQ2i5.js +0 -2335
- package/dist/clsx-D8ItxkrZ.js +0 -446
- package/dist/design-theme-CYGZ6mAh.js +0 -23975
- package/dist/legacy/components/CookieConsent/CookieConsentSettings.component.d.ts +0 -2
- package/dist/legacy/components/Support/AbyssServiceSelect.component.d.ts +0 -37
- package/dist/legacy/components/Support/SupportActionButtons.component.d.ts +0 -3
- package/dist/legacy/components/Support/SupportActivityLog.component.d.ts +0 -3
- package/dist/legacy/components/Support/SupportAttachmentsPanel.component.d.ts +0 -3
- package/dist/legacy/components/Support/SupportCategoryChip.component.d.ts +0 -9
- package/dist/legacy/components/Support/SupportCategoryGroupCards.component.d.ts +0 -3
- package/dist/legacy/components/Support/SupportCategorySelect.component.d.ts +0 -22
- package/dist/legacy/components/Support/SupportMessageInput.component.d.ts +0 -3
- package/dist/legacy/components/Support/SupportMessageThread.component.d.ts +0 -3
- package/dist/legacy/components/Support/SupportPriorityChip.component.d.ts +0 -3
- package/dist/legacy/components/Support/SupportSidebar.component.d.ts +0 -3
- package/dist/legacy/components/Support/SupportStatusBadge.component.d.ts +0 -3
- package/dist/legacy/components/Support/SupportStatusTimeline.component.d.ts +0 -10
- package/dist/legacy/components/Support/SupportTicketCreateForm.component.d.ts +0 -3
- package/dist/legacy/components/Support/SupportTicketCreateStepper.component.d.ts +0 -3
- package/dist/legacy/components/Support/SupportTicketDetail.component.d.ts +0 -3
- package/dist/legacy/components/Support/SupportTopBar.component.d.ts +0 -3
- package/dist/legacy/components/Support/index.d.ts +0 -18
- /package/dist/{legacy/components/CookieConsent/AbyssCookieConsentProvider.spec.d.ts → auth/components/AuthFlow/steps/MfaStep.component.spec.d.ts} +0 -0
- /package/dist/{legacy/components/Support/SupportCategoryPick.component.spec.d.ts → auth/components/SecuritySettings/sections/SessionsSection.component.spec.d.ts} +0 -0
- /package/dist/{legacy/components/Support/SupportMessageLink.component.spec.d.ts → auth/components/shared/use-async-resource.hook.spec.d.ts} +0 -0
- /package/dist/{legacy/components → components/business}/CookieConsent/AbyssCookieConsentProvider.d.ts +0 -0
- /package/dist/{legacy/components/Support/SupportSystemMessage.component.spec.d.ts → components/business/CookieConsent/AbyssCookieConsentProvider.spec.d.ts} +0 -0
- /package/dist/{legacy/components/Support/SupportTicketDetail.mobile-layout.spec.d.ts → components/business/CookieConsent/CookieConsent.spec.d.ts} +0 -0
- /package/dist/{legacy/components/Support/SupportTicketList.week-preset.spec.d.ts → components/business/Support/AbyssServiceSelect.component.spec.d.ts} +0 -0
- /package/dist/{legacy/components/Support/support-attachment.logic.spec.d.ts → components/business/Support/SupportActivityLog.component.spec.d.ts} +0 -0
- /package/dist/{legacy/components/Support/support-author.logic.spec.d.ts → components/business/Support/SupportAttachmentsPanel.component.spec.d.ts} +0 -0
- /package/dist/{legacy/components/Support/support-create-stepper.logic.spec.d.ts → components/business/Support/SupportBadges.spec.d.ts} +0 -0
- /package/dist/{legacy/components/Support/support-message-input.logic.spec.d.ts → components/business/Support/SupportCategoryGroupCards.component.spec.d.ts} +0 -0
- /package/dist/{legacy/components/Support/support-service.logic.spec.d.ts → components/business/Support/SupportCategorySelect.component.spec.d.ts} +0 -0
- /package/dist/{legacy/components/Support/support-status-timeline.logic.spec.d.ts → components/business/Support/SupportMessageInput.component.spec.d.ts} +0 -0
- /package/dist/{legacy/components → components/business}/Support/SupportTicketList.component.d.ts +0 -0
- /package/dist/{legacy/components → components/business}/Support/support-attachment.logic.d.ts +0 -0
- /package/dist/{legacy/components → components/business}/Support/support-author.logic.d.ts +0 -0
- /package/dist/{legacy/components → components/business}/Support/support-category.logic.d.ts +0 -0
- /package/dist/{legacy/components → components/business}/Support/support-create-stepper.logic.d.ts +0 -0
- /package/dist/{legacy/components → components/business}/Support/support-message-input.logic.d.ts +0 -0
- /package/dist/{legacy/components → components/business}/Support/support-service.logic.d.ts +0 -0
- /package/dist/{legacy/components → components/business}/Support/support-status-timeline.logic.d.ts +0 -0
- /package/dist/{legacy/components → components/business}/Support/support-system-message.logic.d.ts +0 -0
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { SupportTicketAction, SupportTicketStatus } from '@abyss-project/main';
|
|
2
|
+
export interface SupportAvailableActions {
|
|
3
|
+
/** Shown as buttons. */
|
|
4
|
+
primary: SupportTicketAction[];
|
|
5
|
+
/** Kept in the overflow menu. */
|
|
6
|
+
secondary: SupportTicketAction[];
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* The actions open to the reader on a ticket in `status`: the transitions the lifecycle allows
|
|
10
|
+
* from there, narrowed to closing and reopening for a requester.
|
|
11
|
+
*/
|
|
12
|
+
export declare const getAvailableActions: (status: SupportTicketStatus, isAdmin: boolean) => SupportAvailableActions;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { SupportTicketCategory, SupportTicketPriority } from '@abyss-project/main';
|
|
2
|
+
/**
|
|
3
|
+
* Pure rules shared by the two ticket-creation components (the single form and the stepper): what a
|
|
4
|
+
* valid ticket is, which categories ask for a service, which priorities ask for a reason.
|
|
5
|
+
*/
|
|
6
|
+
export declare const TITLE_MIN_LENGTH = 3;
|
|
7
|
+
export declare const TITLE_MAX_LENGTH = 255;
|
|
8
|
+
export declare const DESCRIPTION_MIN_LENGTH = 10;
|
|
9
|
+
/** Whether a ticket of this category can name the service it is about. */
|
|
10
|
+
export declare const isServiceCategory: (category: SupportTicketCategory | "") => boolean;
|
|
11
|
+
/** Whether this priority must be justified. */
|
|
12
|
+
export declare const isReasonedPriority: (priority: SupportTicketPriority) => boolean;
|
|
13
|
+
export declare enum SupportCreateError {
|
|
14
|
+
Title = "title",
|
|
15
|
+
Description = "description",
|
|
16
|
+
Category = "category",
|
|
17
|
+
PriorityReason = "priority-reason"
|
|
18
|
+
}
|
|
19
|
+
export interface SupportCreateCheckedValues {
|
|
20
|
+
title: string;
|
|
21
|
+
description: string;
|
|
22
|
+
category: SupportTicketCategory | '';
|
|
23
|
+
priority: SupportTicketPriority;
|
|
24
|
+
priorityReason?: string;
|
|
25
|
+
}
|
|
26
|
+
export type SupportCreateErrors = Partial<Record<'title' | 'description' | 'category' | 'priorityReason', SupportCreateError>>;
|
|
27
|
+
/** The first problem of each field of a ticket about to be created; empty when it is valid. */
|
|
28
|
+
export declare const validateSupportCreate: (values: SupportCreateCheckedValues) => SupportCreateErrors;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/** Id of the row of a ticket message: the target of a link to that message. */
|
|
2
|
+
export declare const messageAnchorId: (messageId: string) => string;
|
|
3
|
+
/** Id of the bubble of a ticket message: the element a link to that message highlights. */
|
|
4
|
+
export declare const messageBubbleId: (messageId: string) => string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { SupportTicketCategoryGroup, SupportTicketPriority, SupportTicketStatus } from '@abyss-project/main';
|
|
2
|
+
import { StatusTone } from '../../meaning/StatusBadge/StatusBadge';
|
|
3
|
+
/**
|
|
4
|
+
* The tone of each status of a support ticket. The core has six tones: an archived ticket shares
|
|
5
|
+
* the neutral tone of a closed one and is told from it by its label, never by colour alone.
|
|
6
|
+
*/
|
|
7
|
+
export declare const SUPPORT_STATUS_TONE: Record<SupportTicketStatus, StatusTone>;
|
|
8
|
+
/** The tone of the dot before a priority name. */
|
|
9
|
+
export declare const SUPPORT_PRIORITY_TONE: Record<SupportTicketPriority, StatusTone>;
|
|
10
|
+
/** The tone of a category group: the dot of its categories and the accent of its card. */
|
|
11
|
+
export declare const SUPPORT_GROUP_TONE: Record<SupportTicketCategoryGroup, StatusTone>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { SupportTicketStatus, ISupportTicket } from '@abyss-project/main';
|
|
3
|
+
/** Shared fixtures of the specs of the ticket detail. */
|
|
4
|
+
/** The ticket of the thread fixtures, in another status. */
|
|
5
|
+
export declare const ticketIn: (status: SupportTicketStatus) => ISupportTicket;
|
|
6
|
+
/** `wrap`, with the host of the confirmations the actions of a ticket ask. */
|
|
7
|
+
export declare const wrapWithConfirm: (node: ReactNode) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { UserLanguage, ISupportTicket, ISupportTicketAttachment, ISupportTicketMessage } from '@abyss-project/main';
|
|
3
|
+
import { Theme } from '@mui/material';
|
|
4
|
+
/** Shared fixtures of the specs of the ticket thread. */
|
|
5
|
+
export declare const theme: Theme;
|
|
6
|
+
export declare const ticket: ISupportTicket;
|
|
7
|
+
export declare const message: (id: string, userId: string, isAdminNote?: boolean) => ISupportTicketMessage;
|
|
8
|
+
export declare const supportAttachment: (id: string, mimeType: string, extra?: Partial<ISupportTicketAttachment>) => ISupportTicketAttachment;
|
|
9
|
+
export declare const wrap: (node: ReactNode, language?: UserLanguage) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -52,12 +52,18 @@ export interface SupportTicketListProps {
|
|
|
52
52
|
subtitle?: string;
|
|
53
53
|
/** Hide the create button */
|
|
54
54
|
hideCreateButton?: boolean;
|
|
55
|
+
/** Leave the page header (title, subtitle, create button) to the host, which lays out its own */
|
|
56
|
+
hideHeader?: boolean;
|
|
55
57
|
/** URL builder for user profile pictures (required when isAdmin is true) */
|
|
56
58
|
getProfilePictureUrl: (userId: string) => string;
|
|
57
59
|
/** URL builder for organization logos (required when isAdmin is true) */
|
|
58
60
|
getOrgLogoUrl: (orgId: string) => string;
|
|
59
61
|
/** Available tags for filtering (admin only) */
|
|
60
62
|
availableTags?: ISupportTicketTag[];
|
|
63
|
+
/** Set when the tickets could not be loaded: the list shows the error block with a retry. */
|
|
64
|
+
error?: {
|
|
65
|
+
onRetry: () => void;
|
|
66
|
+
};
|
|
61
67
|
}
|
|
62
68
|
export interface SupportTicketCreateValues {
|
|
63
69
|
title: string;
|
|
@@ -250,7 +256,8 @@ export interface SupportSidebarProps extends SupportCloudImportProps {
|
|
|
250
256
|
renderScanStatusBadge?: (attachment: ISupportTicketAttachment) => ReactNode;
|
|
251
257
|
}
|
|
252
258
|
export interface SupportTicketDetailProps extends SupportCloudImportProps {
|
|
253
|
-
ticket
|
|
259
|
+
/** The ticket once loaded; `null` when there is none to show (the not-found block). */
|
|
260
|
+
ticket: ISupportTicket | null;
|
|
254
261
|
/** Thumbnail URL of an attachment's preview image. */
|
|
255
262
|
getFileThumbnailUrl: (id: string) => string;
|
|
256
263
|
messages: ISupportTicketMessage[];
|
|
@@ -259,6 +266,10 @@ export interface SupportTicketDetailProps extends SupportCloudImportProps {
|
|
|
259
266
|
targetMessageId?: string;
|
|
260
267
|
isAdmin?: boolean;
|
|
261
268
|
isLoading?: boolean;
|
|
269
|
+
/** Set when the ticket could not be loaded: the detail shows the error block with a retry. */
|
|
270
|
+
error?: {
|
|
271
|
+
onRetry: () => void;
|
|
272
|
+
};
|
|
262
273
|
onNavigateBack?: () => void;
|
|
263
274
|
onSendMessage: (content: string) => void;
|
|
264
275
|
onSendAdminNote?: (content: string) => void;
|
|
@@ -313,15 +324,13 @@ export interface SupportTicketDetailProps extends SupportCloudImportProps {
|
|
|
313
324
|
}
|
|
314
325
|
export interface SupportStatusBadgeProps {
|
|
315
326
|
status: SupportTicketStatus;
|
|
316
|
-
size?: 'small' | 'medium';
|
|
317
327
|
}
|
|
318
328
|
export interface SupportPriorityChipProps {
|
|
319
329
|
priority: SupportTicketPriority;
|
|
330
|
+
/** The larger chip is for a step that is read rather than scanned. */
|
|
320
331
|
size?: 'small' | 'medium';
|
|
321
|
-
onDelete?: () => void;
|
|
322
332
|
}
|
|
323
333
|
export interface SupportCategoryChipProps {
|
|
324
334
|
category: SupportTicketCategory;
|
|
325
335
|
size?: 'small' | 'medium';
|
|
326
|
-
onDelete?: () => void;
|
|
327
336
|
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { SupportTicketPriority } from '@abyss-project/main';
|
|
2
|
+
import { SupportCreateError } from './support-create.logic';
|
|
3
|
+
/** The sentence that tells what is wrong with a field of the ticket-creation components. */
|
|
4
|
+
export declare const useSupportCreateErrorMessage: () => ((error: SupportCreateError, priority: SupportTicketPriority) => string);
|
|
@@ -2,3 +2,26 @@ export * from './InfectedDownloadModal/InfectedDownloadModal';
|
|
|
2
2
|
export * from './CloudImport/CloudImport';
|
|
3
3
|
export * from './ImportFromCloudModal/ImportFromCloudModal';
|
|
4
4
|
export * from './QRCodeModal/QRCodeModal';
|
|
5
|
+
export * from './CookieConsent/AbyssCookieConsentProvider';
|
|
6
|
+
export * from './CookieConsent/CookieConsentBanner';
|
|
7
|
+
export * from './CookieConsent/CookieConsentSettings';
|
|
8
|
+
export * from './Support/types';
|
|
9
|
+
export * from './Support/SupportPill';
|
|
10
|
+
export * from './Support/SupportStatusBadge.component';
|
|
11
|
+
export * from './Support/SupportPriorityChip.component';
|
|
12
|
+
export * from './Support/SupportCategoryChip.component';
|
|
13
|
+
export * from './Support/SupportCategorySelect.component';
|
|
14
|
+
export * from './Support/SupportCategoryGroupCards.component';
|
|
15
|
+
export * from './Support/AbyssServiceSelect.component';
|
|
16
|
+
export * from './Support/SupportTicketCreateForm.component';
|
|
17
|
+
export * from './Support/SupportTicketCreateStepper.component';
|
|
18
|
+
export * from './Support/SupportTicketList.component';
|
|
19
|
+
export * from './Support/SupportMessageThread.component';
|
|
20
|
+
export * from './Support/SupportMessageInput.component';
|
|
21
|
+
export * from './Support/SupportAttachmentsPanel.component';
|
|
22
|
+
export * from './Support/SupportActivityLog.component';
|
|
23
|
+
export * from './Support/SupportActionButtons.component';
|
|
24
|
+
export * from './Support/SupportStatusTimeline.component';
|
|
25
|
+
export * from './Support/SupportTopBar.component';
|
|
26
|
+
export * from './Support/SupportSidebar.component';
|
|
27
|
+
export * from './Support/SupportTicketDetail.component';
|
|
@@ -17,6 +17,11 @@ export interface ExpressionSearchProps {
|
|
|
17
17
|
/** The values of `field` (as typed, `@` included) that start with `prefix`. */
|
|
18
18
|
fetchValues(field: string, prefix: string): Promise<ExpressionValueSuggestion[]>;
|
|
19
19
|
placeholder?: string;
|
|
20
|
+
/**
|
|
21
|
+
* Accept `field:/pattern/` as a valid term (an alert rule's expression, the only place a regex
|
|
22
|
+
* is read). Off by default: anywhere else a regex is a syntax error at the slash.
|
|
23
|
+
*/
|
|
24
|
+
allowRegex?: boolean;
|
|
20
25
|
}
|
|
21
26
|
/** Pause after the last keystroke before the suggestions are asked for, in ms. */
|
|
22
27
|
export declare const SUGGESTION_DELAY_MS = 150;
|
|
@@ -27,4 +32,4 @@ export declare const SUGGESTION_DELAY_MS = 150;
|
|
|
27
32
|
* before the colon, are suggested from the host's lookups; ArrowUp and ArrowDown move through
|
|
28
33
|
* them, Enter picks (or submits when none is highlighted), Escape closes the list.
|
|
29
34
|
*/
|
|
30
|
-
export declare function ExpressionSearch({ value, onChange, onSubmit, fetchKeys, fetchValues, placeholder, }: ExpressionSearchProps): import("react/jsx-runtime").JSX.Element;
|
|
35
|
+
export declare function ExpressionSearch({ value, onChange, onSubmit, fetchKeys, fetchValues, placeholder, allowRegex, }: ExpressionSearchProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -3,7 +3,11 @@ export interface FormFieldProps {
|
|
|
3
3
|
label: string;
|
|
4
4
|
/** A hint under the field, always shown. */
|
|
5
5
|
help?: ReactNode;
|
|
6
|
-
/**
|
|
6
|
+
/**
|
|
7
|
+
* The error message: the field turns to the danger color and is marked invalid. `true` marks the
|
|
8
|
+
* field invalid with no message line (the error is said elsewhere); `false`, `null` and `''`
|
|
9
|
+
* leave the field valid or without a line.
|
|
10
|
+
*/
|
|
7
11
|
error?: ReactNode;
|
|
8
12
|
required?: boolean;
|
|
9
13
|
/**
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { ChangeEvent, FocusEvent, KeyboardEvent, ReactNode, Ref } from 'react';
|
|
2
|
+
export interface PasswordFieldProps {
|
|
3
|
+
label: string;
|
|
4
|
+
name: string;
|
|
5
|
+
value: string;
|
|
6
|
+
onChange(event: ChangeEvent<HTMLInputElement>): void;
|
|
7
|
+
/** A hint under the field, always shown. */
|
|
8
|
+
help?: ReactNode;
|
|
9
|
+
/** The error message: the field turns to the danger color and is marked invalid. */
|
|
10
|
+
error?: ReactNode;
|
|
11
|
+
required?: boolean;
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
autoFocus?: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Password-manager hint. Always set it on a real auth form: `current-password` to sign in,
|
|
16
|
+
* `new-password` to sign up, reset or change. Leave it unset for a secret that belongs to no
|
|
17
|
+
* account (a protected link, an archive).
|
|
18
|
+
*/
|
|
19
|
+
autoComplete?: string;
|
|
20
|
+
/** Id of the input; generated when omitted. */
|
|
21
|
+
id?: string;
|
|
22
|
+
inputRef?: Ref<HTMLInputElement>;
|
|
23
|
+
/** Raw attributes of the `input` with no dedicated prop (`passwordrules`). */
|
|
24
|
+
inputProps?: Record<string, string | number | boolean | undefined>;
|
|
25
|
+
placeholder?: string;
|
|
26
|
+
onBlur?(event: FocusEvent<HTMLInputElement>): void;
|
|
27
|
+
onKeyDown?(event: KeyboardEvent<HTMLInputElement>): void;
|
|
28
|
+
/** Where caps-lock detection goes (`event.getModifierState('CapsLock')`). */
|
|
29
|
+
onKeyUp?(event: KeyboardEvent<HTMLInputElement>): void;
|
|
30
|
+
/** `data-testid` of the input. */
|
|
31
|
+
testId?: string;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* A password input on `FormField`: same label, hint and error contract as the other fields, and a
|
|
35
|
+
* 44 px toggle that reveals or hides the typed text. The toggle is in the tab order (WCAG 2.1.1: a
|
|
36
|
+
* keyboard user can reveal the text); it is a `type="button"`, so Enter in the input still submits
|
|
37
|
+
* the form instead of flipping the visibility. The field does no validation and shows no strength meter: the
|
|
38
|
+
* caller validates and passes `error`.
|
|
39
|
+
*/
|
|
40
|
+
export declare function PasswordField({ label, name, value, onChange, help, error, required, disabled, autoFocus, autoComplete, id, inputRef, inputProps, placeholder, onBlur, onKeyDown, onKeyUp, testId, }: PasswordFieldProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -2,16 +2,24 @@ export interface SegmentedOption<V extends string> {
|
|
|
2
2
|
value: V;
|
|
3
3
|
label: string;
|
|
4
4
|
count?: number;
|
|
5
|
+
/** Rendered as `data-testid` on the segment. */
|
|
6
|
+
testId?: string;
|
|
7
|
+
/** Accessible name of the segment when the visible label is not enough (an abbreviation). */
|
|
8
|
+
ariaLabel?: string;
|
|
9
|
+
/** Language of the label when it differs from the page's (`lang` of the segment). */
|
|
10
|
+
lang?: string;
|
|
5
11
|
}
|
|
6
12
|
export interface SegmentedControlProps<V extends string> {
|
|
7
13
|
options: SegmentedOption<V>[];
|
|
8
14
|
value: V;
|
|
9
15
|
onChange(value: V): void;
|
|
10
16
|
ariaLabel: string;
|
|
17
|
+
/** Rendered as `data-testid` on the group (the element carrying `ariaLabel`). */
|
|
18
|
+
testId?: string;
|
|
11
19
|
}
|
|
12
20
|
/**
|
|
13
21
|
* A segmented choice (`.seg`): one option is selected at a time. A `radiogroup` with a roving tab
|
|
14
22
|
* stop: Tab enters on the selected option, arrow keys move the selection (wrapping), Home and End
|
|
15
23
|
* jump to the ends.
|
|
16
24
|
*/
|
|
17
|
-
export declare function SegmentedControl<V extends string>({ options, value, onChange, ariaLabel, }: SegmentedControlProps<V>): import("react/jsx-runtime").JSX.Element;
|
|
25
|
+
export declare function SegmentedControl<V extends string>({ options, value, onChange, ariaLabel, testId, }: SegmentedControlProps<V>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -4,6 +4,7 @@ export * from './DateRangeField/DateRangeField';
|
|
|
4
4
|
export * from './ColorField/ColorField';
|
|
5
5
|
export * from './SegmentedControl/SegmentedControl';
|
|
6
6
|
export * from './FormField/FormField';
|
|
7
|
+
export * from './PasswordField/PasswordField';
|
|
7
8
|
export * from './NumberField/NumberField';
|
|
8
9
|
export * from './SettingsRow/SettingsRow';
|
|
9
10
|
export * from './CopyField/CopyField';
|
|
@@ -1,22 +1,7 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
Danger = "danger",
|
|
6
|
-
Info = "info"
|
|
7
|
-
}
|
|
8
|
-
export interface ToastAction {
|
|
9
|
-
label: string;
|
|
10
|
-
onPress(): void;
|
|
11
|
-
}
|
|
12
|
-
export interface ToastOptions {
|
|
13
|
-
tone: ToastTone;
|
|
14
|
-
message: string;
|
|
15
|
-
action?: ToastAction;
|
|
16
|
-
}
|
|
17
|
-
export interface ToastApi {
|
|
18
|
-
show(toast: ToastOptions): void;
|
|
19
|
-
}
|
|
2
|
+
import { ToastApi } from './toast-store';
|
|
3
|
+
export { toast, ToastTone } from './toast-store';
|
|
4
|
+
export type { ToastAction, ToastApi, ToastCallOptions, ToastOptions, ToastProgressOptions, ToastUpdate, } from './toast-store';
|
|
20
5
|
export interface ToastProviderProps {
|
|
21
6
|
children: ReactNode;
|
|
22
7
|
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The distance, from the bottom of the viewport, up to the top of what already occupies the bottom
|
|
3
|
+
* right corner (the cookie-consent banner). The toast region keeps above it, so a notification
|
|
4
|
+
* never covers the banner. Unset while nothing occupies the corner.
|
|
5
|
+
*/
|
|
6
|
+
export declare const TOAST_CLEARANCE_VAR = "--abyss-toast-clearance";
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
export declare enum ToastTone {
|
|
2
|
+
Success = "success",
|
|
3
|
+
Warning = "warning",
|
|
4
|
+
Danger = "danger",
|
|
5
|
+
Info = "info"
|
|
6
|
+
}
|
|
7
|
+
export interface ToastAction {
|
|
8
|
+
label: string;
|
|
9
|
+
onPress(): void;
|
|
10
|
+
}
|
|
11
|
+
export interface ToastOptions {
|
|
12
|
+
tone: ToastTone;
|
|
13
|
+
message: string;
|
|
14
|
+
action?: ToastAction;
|
|
15
|
+
}
|
|
16
|
+
/** Options of `toast.success`, `toast.error`, `toast.info` and `toast.warning`. */
|
|
17
|
+
export interface ToastCallOptions {
|
|
18
|
+
action?: ToastAction;
|
|
19
|
+
/** Showing again with the same id replaces the notification instead of stacking another one. */
|
|
20
|
+
id?: string;
|
|
21
|
+
/** Time on screen in ms; defaults to `TOAST_DURATION`. */
|
|
22
|
+
durationMs?: number;
|
|
23
|
+
}
|
|
24
|
+
export interface ToastProgressOptions {
|
|
25
|
+
id?: string;
|
|
26
|
+
}
|
|
27
|
+
export interface ToastUpdate {
|
|
28
|
+
/** A tone ends the progress: the notification then leaves like any other. */
|
|
29
|
+
tone?: ToastTone;
|
|
30
|
+
message?: string;
|
|
31
|
+
/** Between 0 and 1; shown while the notification has no final tone. */
|
|
32
|
+
progress?: number;
|
|
33
|
+
}
|
|
34
|
+
/** A notification as the store holds it. `revision` restarts its timer whenever it changes. */
|
|
35
|
+
export interface ToastItem {
|
|
36
|
+
id: string;
|
|
37
|
+
tone: ToastTone;
|
|
38
|
+
message: string;
|
|
39
|
+
action?: ToastAction;
|
|
40
|
+
durationMs?: number;
|
|
41
|
+
/** True for a progress notification that has not received its final tone yet. */
|
|
42
|
+
pending: boolean;
|
|
43
|
+
progress?: number;
|
|
44
|
+
revision: number;
|
|
45
|
+
}
|
|
46
|
+
export interface ToastApi {
|
|
47
|
+
show(toast: ToastOptions): void;
|
|
48
|
+
}
|
|
49
|
+
type Listener = () => void;
|
|
50
|
+
/**
|
|
51
|
+
* Store read by the mounted `ToastProvider`. Calls made before it mounts are kept and shown when
|
|
52
|
+
* it does.
|
|
53
|
+
*/
|
|
54
|
+
export declare const toastStore: {
|
|
55
|
+
subscribe(listener: Listener): () => void;
|
|
56
|
+
getItems(): readonly ToastItem[];
|
|
57
|
+
/** Claims the single display; returns its release function, or null if a provider already has it. */
|
|
58
|
+
attachProvider(): (() => void) | null;
|
|
59
|
+
};
|
|
60
|
+
/**
|
|
61
|
+
* Imperative notifications, usable from a hook, a utility or an axios interceptor. They show in the
|
|
62
|
+
* mounted `ToastProvider`. Every call returns the id of its notification.
|
|
63
|
+
*/
|
|
64
|
+
export declare const toast: {
|
|
65
|
+
success: (message: string, options?: ToastCallOptions) => string;
|
|
66
|
+
error: (message: string, options?: ToastCallOptions) => string;
|
|
67
|
+
info: (message: string, options?: ToastCallOptions) => string;
|
|
68
|
+
warning: (message: string, options?: ToastCallOptions) => string;
|
|
69
|
+
/** A persistent notification, ended with `toast.update(id, { tone })`. */
|
|
70
|
+
progress(message: string, options?: ToastProgressOptions): string;
|
|
71
|
+
/** Does nothing when the notification has already left. */
|
|
72
|
+
update(id: string, changes: ToastUpdate): void;
|
|
73
|
+
/** Removes one notification, or all of them without an id. */
|
|
74
|
+
dismiss(id?: string): void;
|
|
75
|
+
};
|
|
76
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export interface ErrorBoundaryProps {
|
|
3
|
+
/** Name of the app, carried by the technical detail so a report says where it came from. */
|
|
4
|
+
appName: string;
|
|
5
|
+
children: ReactNode;
|
|
6
|
+
/** Called when the user retries, before the children render again. */
|
|
7
|
+
onReset?(): void;
|
|
8
|
+
/** The boundary resets by itself when one of these values changes (the route, for instance). */
|
|
9
|
+
resetKeys?: unknown[];
|
|
10
|
+
/** Fills the viewport (the error replaces the whole app); otherwise the block sits in its slot. */
|
|
11
|
+
fullHeight?: boolean;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Catches the render errors of its children, reports them to the front's RUM and shows an error
|
|
15
|
+
* block in their place, with « Réessayer » and the technical detail on demand.
|
|
16
|
+
*/
|
|
17
|
+
export declare function ErrorBoundary({ appName, children, onReset, resetKeys, fullHeight, }: ErrorBoundaryProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -14,7 +14,9 @@ export interface PageStateEmpty {
|
|
|
14
14
|
action?: ReactNode;
|
|
15
15
|
}
|
|
16
16
|
export interface PageStateError {
|
|
17
|
-
/** Replaces the
|
|
17
|
+
/** Replaces the title « Le chargement a échoué » (a crash is not a failed load). */
|
|
18
|
+
title?: string;
|
|
19
|
+
/** Replaces the generic description; the title stays the default one unless `title` is set. */
|
|
18
20
|
message?: string;
|
|
19
21
|
onRetry(): void;
|
|
20
22
|
}
|
package/dist/cookie-consent.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './
|
|
1
|
+
export * from './components/business/CookieConsent/index'
|
|
2
2
|
export {}
|
package/dist/cookie-consent.js
CHANGED
|
@@ -1,20 +1,19 @@
|
|
|
1
|
-
import { A as
|
|
2
|
-
import {
|
|
3
|
-
import { f as E } from "./use-rich-intl.hook-BETUyCkW.js";
|
|
1
|
+
import { A as e, d as a, C as n, b as C, D as i, R as t, V as r, e as A, r as k, f as c, u as l, c as f, a as b, w as u } from "./CookieConsentSettings-B7NfjgaI.js";
|
|
2
|
+
import { f as E } from "./Surface-BEhoEhyC.js";
|
|
4
3
|
export {
|
|
5
|
-
|
|
4
|
+
e as AbyssCookieConsentProvider,
|
|
6
5
|
a as COOKIE_NAME,
|
|
7
6
|
n as CookieConsentBanner,
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
7
|
+
C as CookieConsentSettings,
|
|
8
|
+
i as DEFAULT_PRIVACY_HREF,
|
|
9
|
+
t as ReconcileAction,
|
|
10
|
+
r as VALIDITY_DAYS,
|
|
11
|
+
A as clearCookie,
|
|
13
12
|
E as flattenTranslations,
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
13
|
+
k as readCookie,
|
|
14
|
+
c as reconcile,
|
|
15
|
+
l as useAbyssCookieConsent,
|
|
16
|
+
f as useCookieConsent,
|
|
17
|
+
b as useOptionalAbyssCookieConsent,
|
|
18
|
+
u as writeCookie
|
|
20
19
|
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/** The page of abyss-docs that says what a demo account blocks (same base as the legacy layout's documentation link). */
|
|
2
|
+
export declare const DEMO_DOCS_URL = "https://docs.abyss-project.fr/abyss-project/demo-account";
|
|
3
|
+
/** CSS variable carrying the height of a pinned banner, read by the fixed chrome pushed below it. */
|
|
4
|
+
export declare const DEMO_BANNER_HEIGHT_VAR = "--demo-banner-height";
|
|
5
|
+
/**
|
|
6
|
+
* The permanent banner of a demo account: its group, when the group expires, « Réinitialiser »
|
|
7
|
+
* (after a confirmation that names the whole group) and « En savoir plus » (abyss-docs). It has no
|
|
8
|
+
* close button. Renders nothing outside a demo, or while the group is loading.
|
|
9
|
+
*
|
|
10
|
+
* `pinned` is for an app that mounts it at the root, above its router: the banner then stays on top
|
|
11
|
+
* of the page and the fixed header and sidebar of the app start under it. A banner placed inside a
|
|
12
|
+
* layout, in the flow of the page, keeps the default.
|
|
13
|
+
*/
|
|
14
|
+
export declare const DemoBanner: ({ pinned }: {
|
|
15
|
+
pinned?: boolean;
|
|
16
|
+
}) => import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './DemoBanner';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { AxiosInstance } from 'axios';
|
|
2
|
+
/**
|
|
3
|
+
* Tells the user, through `notify`, that a demo account may not do what it just tried (the API
|
|
4
|
+
* answers 403 `DEMO_ACTION_BLOCKED`). The error is still rejected so callers keep their own
|
|
5
|
+
* handling. Returns the function that detaches the interceptor.
|
|
6
|
+
*/
|
|
7
|
+
export declare const attachDemoBlockedInterceptor: (instance: AxiosInstance, notify: (message: string) => void) => (() => void);
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
banner: {
|
|
3
|
+
title: string;
|
|
4
|
+
summary: string;
|
|
5
|
+
'expires-in': string;
|
|
6
|
+
'expires-today': string;
|
|
7
|
+
reset: string;
|
|
8
|
+
'learn-more': string;
|
|
9
|
+
'reset-dialog': {
|
|
10
|
+
title: string;
|
|
11
|
+
body: string;
|
|
12
|
+
confirm: string;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
blocked: string;
|
|
16
|
+
};
|
|
17
|
+
export default _default;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
banner: {
|
|
3
|
+
title: string;
|
|
4
|
+
summary: string;
|
|
5
|
+
'expires-in': string;
|
|
6
|
+
'expires-today': string;
|
|
7
|
+
reset: string;
|
|
8
|
+
'learn-more': string;
|
|
9
|
+
'reset-dialog': {
|
|
10
|
+
title: string;
|
|
11
|
+
body: string;
|
|
12
|
+
confirm: string;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
blocked: string;
|
|
16
|
+
};
|
|
17
|
+
export default _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export interface DemoGroup {
|
|
2
|
+
label: string;
|
|
3
|
+
expiresAt: Date;
|
|
4
|
+
}
|
|
5
|
+
export interface DemoAccount {
|
|
6
|
+
/** The signed-in user belongs to a demo group. */
|
|
7
|
+
isDemo: boolean;
|
|
8
|
+
/** The group, once loaded; `null` outside a demo and while it loads or cannot be read. */
|
|
9
|
+
group: DemoGroup | null;
|
|
10
|
+
/** Resets the whole group to its seeded state (all its accounts), then reloads the group. */
|
|
11
|
+
reset(): Promise<void>;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* The demo state of the signed-in user (`IUser.demoGroupId`) and its group (`GET /demo/me`).
|
|
15
|
+
* Outside an `<AuthProvider>` or signed out, it is not a demo. The group is only read for a demo
|
|
16
|
+
* user; a group that cannot be read leaves `group` null (the server enforces the demo either way,
|
|
17
|
+
* the banner only announces it).
|
|
18
|
+
*/
|
|
19
|
+
export declare const useDemoAccount: () => DemoAccount;
|