@arbidocs/blocks 0.5.23 → 0.5.24

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 (83) hide show
  1. package/dist/{WorkspaceTableView-6JVHGDUB.cjs → WorkspaceTableView-GIDGNGBW.cjs} +6 -6
  2. package/dist/{WorkspaceTableView-6JVHGDUB.cjs.map → WorkspaceTableView-GIDGNGBW.cjs.map} +1 -1
  3. package/dist/{WorkspaceTableView-ECPHGWHF.js → WorkspaceTableView-S2PTTVHL.js} +4 -4
  4. package/dist/{WorkspaceTableView-ECPHGWHF.js.map → WorkspaceTableView-S2PTTVHL.js.map} +1 -1
  5. package/dist/{chunk-7DDMF3DZ.cjs → chunk-53T2FY4Z.cjs} +5 -31
  6. package/dist/chunk-53T2FY4Z.cjs.map +1 -0
  7. package/dist/chunk-5ZBXFHZW.js +434 -0
  8. package/dist/chunk-5ZBXFHZW.js.map +1 -0
  9. package/dist/{chunk-O4EQYPLO.cjs → chunk-C2SZQKX2.cjs} +169 -27
  10. package/dist/chunk-C2SZQKX2.cjs.map +1 -0
  11. package/dist/{chunk-RVKVGS72.js → chunk-FDUQQNDT.js} +2 -2
  12. package/dist/{chunk-RVKVGS72.js.map → chunk-FDUQQNDT.js.map} +1 -1
  13. package/dist/{chunk-TTJGCJWX.cjs → chunk-H3XAHVDT.cjs} +42 -2
  14. package/dist/chunk-H3XAHVDT.cjs.map +1 -0
  15. package/dist/{chunk-XL55UDLO.js → chunk-IJJKUTKM.js} +5 -30
  16. package/dist/chunk-IJJKUTKM.js.map +1 -0
  17. package/dist/{chunk-ZX663X3X.cjs → chunk-KNRAKOCO.cjs} +6 -428
  18. package/dist/chunk-KNRAKOCO.cjs.map +1 -0
  19. package/dist/chunk-KUQOHPKP.cjs +443 -0
  20. package/dist/chunk-KUQOHPKP.cjs.map +1 -0
  21. package/dist/{chunk-F2BYURQZ.cjs → chunk-LYF47OXX.cjs} +5 -5
  22. package/dist/{chunk-F2BYURQZ.cjs.map → chunk-LYF47OXX.cjs.map} +1 -1
  23. package/dist/{chunk-PZRTRYPD.js → chunk-MKTEVOC3.js} +44 -5
  24. package/dist/chunk-MKTEVOC3.js.map +1 -0
  25. package/dist/{chunk-6XW3CMU4.js → chunk-N3KNAQ55.js} +144 -4
  26. package/dist/chunk-N3KNAQ55.js.map +1 -0
  27. package/dist/{chunk-FZVAJFRH.cjs → chunk-RHKFCSFC.cjs} +2 -2
  28. package/dist/{chunk-FZVAJFRH.cjs.map → chunk-RHKFCSFC.cjs.map} +1 -1
  29. package/dist/{chunk-NVRJ6WTR.js → chunk-RTAYJUQM.js} +3 -3
  30. package/dist/{chunk-NVRJ6WTR.js.map → chunk-RTAYJUQM.js.map} +1 -1
  31. package/dist/{chunk-SLRVI2YU.js → chunk-X6U6L6BG.js} +29 -4
  32. package/dist/chunk-X6U6L6BG.js.map +1 -0
  33. package/dist/{chunk-SQ5F5BFW.cjs → chunk-XDU3HHUU.cjs} +32 -6
  34. package/dist/chunk-XDU3HHUU.cjs.map +1 -0
  35. package/dist/{chunk-SKVVOEMX.js → chunk-XXUPUXBF.js} +8 -423
  36. package/dist/chunk-XXUPUXBF.js.map +1 -0
  37. package/dist/connect/index.cjs +1039 -565
  38. package/dist/connect/index.cjs.map +1 -1
  39. package/dist/connect/index.js +649 -180
  40. package/dist/connect/index.js.map +1 -1
  41. package/dist/connection/auth/CompactLogin.d.ts +26 -0
  42. package/dist/connection/auth/ConnectedLoginPage.d.ts +9 -1
  43. package/dist/connection/auth/index.d.ts +3 -1
  44. package/dist/connection/auth/sso-popup.d.ts +13 -0
  45. package/dist/connection/auth/sso-sign-in.d.ts +38 -0
  46. package/dist/connection/auth/useLoginActions.d.ts +4 -2
  47. package/dist/connection/projects/ConnectedProjectsPanel.d.ts +9 -1
  48. package/dist/connection/projects/ProjectsListPage.d.ts +40 -0
  49. package/dist/connection/projects/index.d.ts +1 -0
  50. package/dist/connection/settings-page/appearanceSection.d.ts +30 -0
  51. package/dist/connection/settings-page/index.d.ts +1 -0
  52. package/dist/index.cjs +162 -190
  53. package/dist/index.cjs.map +1 -1
  54. package/dist/index.d.ts +2 -0
  55. package/dist/index.js +9 -48
  56. package/dist/index.js.map +1 -1
  57. package/dist/settings/AppearanceSettings.d.ts +1 -2
  58. package/dist/settings/index.cjs +153 -153
  59. package/dist/settings/index.d.ts +2 -1
  60. package/dist/settings/index.js +1 -1
  61. package/dist/site/index.cjs +82 -74
  62. package/dist/site/index.d.ts +2 -0
  63. package/dist/site/index.js +3 -3
  64. package/dist/studio/index.cjs +73 -73
  65. package/dist/studio/index.js +5 -5
  66. package/dist/theme/appearance.d.ts +47 -0
  67. package/dist/theme/fromCss.d.ts +33 -0
  68. package/node_modules/@arbidocs/coedit/package.json +1 -1
  69. package/package.json +5 -5
  70. package/dist/chunk-6XW3CMU4.js.map +0 -1
  71. package/dist/chunk-7DDMF3DZ.cjs.map +0 -1
  72. package/dist/chunk-AMTWY22T.js +0 -11
  73. package/dist/chunk-AMTWY22T.js.map +0 -1
  74. package/dist/chunk-O4EQYPLO.cjs.map +0 -1
  75. package/dist/chunk-PZRTRYPD.js.map +0 -1
  76. package/dist/chunk-SKVVOEMX.js.map +0 -1
  77. package/dist/chunk-SLRVI2YU.js.map +0 -1
  78. package/dist/chunk-SQ5F5BFW.cjs.map +0 -1
  79. package/dist/chunk-TTJGCJWX.cjs.map +0 -1
  80. package/dist/chunk-XL55UDLO.js.map +0 -1
  81. package/dist/chunk-ZU2B2RZK.cjs +0 -13
  82. package/dist/chunk-ZU2B2RZK.cjs.map +0 -1
  83. package/dist/chunk-ZX663X3X.cjs.map +0 -1
@@ -0,0 +1,26 @@
1
+ /**
2
+ * The compact sign-in of embedded hosts (an Office task pane, a browser extension): email and
3
+ * password, or SSO in a popup (the host opens it, `onSsoSignIn`) followed by the master password
4
+ * the account's keys are derived from. The same actions as the sign-in page (`useLoginActions`)
5
+ * and the same SSO completion as the callback page (`completeSsoSignIn`), arranged for a narrow
6
+ * pane, with errors shown in place.
7
+ */
8
+ import { type ReactElement } from 'react';
9
+ import { type SsoUser } from './support';
10
+ export interface CompactLoginOptions {
11
+ /**
12
+ * Sign in at the SSO provider in a popup: the provider's token and user, or `null` when the
13
+ * popup closed without one. Absent: no SSO.
14
+ */
15
+ onSsoSignIn?: () => Promise<{
16
+ accessToken: string;
17
+ user: SsoUser;
18
+ } | null>;
19
+ /** Signed in, with the person's first name. */
20
+ onSignedIn?: (name: string) => void;
21
+ /** The product name in the copy ("Sign in with …", "your … master password"). */
22
+ appName?: string;
23
+ /** The SSO provider's name on its buttons. Default: the product name. */
24
+ ssoName?: string;
25
+ }
26
+ export declare function CompactLogin({ onSsoSignIn, onSignedIn, appName, ssoName, }: CompactLoginOptions): ReactElement;
@@ -6,4 +6,12 @@
6
6
  * configuration's `auth` (and `sso`), see `./support`.
7
7
  */
8
8
  import { type ReactElement } from 'react';
9
- export declare function ConnectedLoginPage(): ReactElement;
9
+ import { type CompactLoginOptions } from './CompactLogin';
10
+ export interface ConnectedLoginPageProps extends CompactLoginOptions {
11
+ /**
12
+ * `page` (default): the full sign-in and registration page. `compact`: the sign-in of an embedded
13
+ * host's narrow pane (email and password, or SSO in a popup, `onSsoSignIn`).
14
+ */
15
+ layout?: 'page' | 'compact';
16
+ }
17
+ export declare function ConnectedLoginPage({ layout, ...compact }?: ConnectedLoginPageProps): ReactElement;
@@ -1,4 +1,6 @@
1
- export { ConnectedLoginPage } from './ConnectedLoginPage';
1
+ export { ConnectedLoginPage, type ConnectedLoginPageProps } from './ConnectedLoginPage';
2
+ export { type CompactLoginOptions } from './CompactLogin';
3
+ export { openSsoPopup } from './sso-popup';
2
4
  export { ConnectedSsoCallback } from './ConnectedSsoCallback';
3
5
  export { SsoResendVerificationButton } from './SsoResendVerificationButton';
4
6
  export { resolveSsoName, type NameSource, type ResolvedName } from './sso-name';
@@ -0,0 +1,13 @@
1
+ /**
2
+ * SSO in a popup, for hosts that cannot leave their page (an Office task pane, an extension): open
3
+ * the provider's sign-in, and wait for the callback page in the popup to post the provider's token
4
+ * and user back (`window.opener.postMessage({ accessToken, user }, origin)`). Resolves `null` when
5
+ * the popup is closed first; rejects with the provider's error.
6
+ */
7
+ import type { SsoUser } from './support';
8
+ export declare function openSsoPopup(url: string, { features }?: {
9
+ features?: string;
10
+ }): Promise<{
11
+ accessToken: string;
12
+ user: SsoUser;
13
+ } | null>;
@@ -0,0 +1,38 @@
1
+ /**
2
+ * Finishing a sign-in through SSO, once the provider has signed the person in: what their account
3
+ * is for the provider's email (`arbi.sso.status`), then, with the master password, register a new
4
+ * account (and back it up), link a local one, or sign in. One implementation for the full-page
5
+ * callback (`ConnectedSsoCallback`) and the compact sign-in of embedded hosts.
6
+ */
7
+ import type { components, LoginResult } from '@arbidocs/client';
8
+ import type { useArbi } from '@arbidocs/react';
9
+ import type { SsoUser } from './support';
10
+ export type SsoAccountStatus = components['schemas']['SSOStatusResponse'];
11
+ type Arbi = ReturnType<typeof useArbi>;
12
+ /** What the provider's account is on this deployment (`new_user`, `sso_exists`, `local_exists`). */
13
+ export declare function ssoAccountStatus(arbi: Arbi, token: string, user: SsoUser): Promise<{
14
+ status: string;
15
+ email: string;
16
+ given_name?: string | null;
17
+ family_name?: string | null;
18
+ }>;
19
+ export interface CompleteSsoSignIn {
20
+ token: string;
21
+ user: SsoUser;
22
+ status: SsoAccountStatus;
23
+ /** The master password: a new one for `new_user`, the account's otherwise. */
24
+ password: string;
25
+ /** A new account: download its recovery key (default on). */
26
+ saveRecoveryKey?: boolean;
27
+ }
28
+ /**
29
+ * Sign in with the master password by account status. A new account is registered (the SSO token
30
+ * stands in for the verification code), backed up, and signed in with the provider's name and
31
+ * picture; `registered` says so. A local account is linked to SSO (`linked`).
32
+ */
33
+ export declare function completeSsoSignIn(arbi: Arbi, { token, user, status, password, saveRecoveryKey }: CompleteSsoSignIn): Promise<{
34
+ login: LoginResult | undefined;
35
+ registered: boolean;
36
+ linked: boolean;
37
+ }>;
38
+ export {};
@@ -5,9 +5,11 @@
5
5
  * session in, and the site's sign-in hooks run around it.
6
6
  */
7
7
  import type { LoginFormActions, LoginFormState } from './useLoginForm';
8
- export declare function useLoginActions({ formState, formActions, }: {
8
+ export declare function useLoginActions({ formState, formActions, onError, }: {
9
9
  formState: LoginFormState;
10
10
  formActions: LoginFormActions;
11
+ /** Show a refusal in the form itself. Default: a notice. */
12
+ onError?: (message: string) => void;
11
13
  }): {
12
14
  isAuthenticating: boolean;
13
15
  isRequestingCode: boolean;
@@ -19,7 +21,7 @@ export declare function useLoginActions({ formState, formActions, }: {
19
21
  email: string;
20
22
  password: string;
21
23
  };
22
- }) => Promise<void>;
24
+ }) => Promise<import("@arbidocs/client").LoginResult | undefined>;
23
25
  handleRegister: (saveRecoveryKey?: boolean) => Promise<void>;
24
26
  handleRequestVerificationCode: () => Promise<void>;
25
27
  };
@@ -8,6 +8,7 @@
8
8
  * (`tabs`); without it the panel keeps them and opens its own projects' tabs.
9
9
  */
10
10
  import { type ReactNode } from 'react';
11
+ import { type ProjectsListPageProps } from './ProjectsListPage';
11
12
  /** The base tab's id. */
12
13
  export declare const PROJECTS_BASE_TAB_ID = "projects";
13
14
  /** The panel's project tabs, kept by a host. */
@@ -21,6 +22,13 @@ export interface ProjectPanelTabs {
21
22
  onClose: (projectId: string) => void;
22
23
  }
23
24
  export interface ConnectedProjectsPanelProps {
25
+ /**
26
+ * `panel` (default): the Plan & Usage panel with a tab per open project. `page`: the projects
27
+ * list as a page (`page` options), a row opening the project through `environment.openProject`.
28
+ */
29
+ layout?: 'panel' | 'page';
30
+ /** The list page's words, columns and header actions (`layout="page"`). */
31
+ page?: ProjectsListPageProps;
24
32
  /** Host-kept tabs; the panel keeps its own without. */
25
33
  tabs?: ProjectPanelTabs;
26
34
  /** A project's storage section, at the foot of its detail. */
@@ -31,4 +39,4 @@ export interface ConnectedProjectsPanelProps {
31
39
  headerRight?: ReactNode;
32
40
  className?: string;
33
41
  }
34
- export declare function ConnectedProjectsPanel({ tabs: hostTabs, projectStorage, footer, headerRight, className, }: ConnectedProjectsPanelProps): import("react").JSX.Element;
42
+ export declare function ConnectedProjectsPanel({ layout, page, ...panel }: ConnectedProjectsPanelProps): import("react").JSX.Element;
@@ -0,0 +1,40 @@
1
+ /**
2
+ * The projects list as a page (`ConnectedProjectsPanel layout="page"`): every project with its
3
+ * client, stage, documents, threads, people and storage (`useProjectSummaries`), searchable by
4
+ * project or workspace name; a row opens the project (`environment.openProject`). A site names
5
+ * things its own way (`labels`) and picks the columns (`columns`).
6
+ */
7
+ import { type ReactNode } from 'react';
8
+ /** The list's columns, in order. */
9
+ export type ProjectListColumn = 'name' | 'client' | 'stage' | 'documents' | 'conversations' | 'members' | 'storage';
10
+ export declare const DEFAULT_PROJECT_LIST_COLUMNS: readonly ProjectListColumn[];
11
+ export interface ProjectsListLabels {
12
+ eyebrow?: ReactNode;
13
+ title: string;
14
+ description?: ReactNode;
15
+ searchPlaceholder: string;
16
+ /** Column headers. */
17
+ columns: Record<ProjectListColumn, string>;
18
+ /** "opened 3 Oct 2026" under a project's name. */
19
+ opened: string;
20
+ loadingTitle: string;
21
+ loadingDescription?: string;
22
+ emptyTitle: string;
23
+ emptyDescription?: string;
24
+ }
25
+ export declare const DEFAULT_PROJECTS_LIST_LABELS: ProjectsListLabels;
26
+ export interface ProjectsListPageProps {
27
+ /** The site's words; each field falls back to the default. */
28
+ labels?: Partial<Omit<ProjectsListLabels, 'columns'>> & {
29
+ columns?: Partial<Record<ProjectListColumn, string>>;
30
+ };
31
+ /** The columns shown, in order. Default: all. */
32
+ columns?: readonly ProjectListColumn[];
33
+ /** The header's actions (a "new project" button). */
34
+ actions?: ReactNode;
35
+ /** The page's test-id prefix. Default: `projects`. */
36
+ testId?: string;
37
+ }
38
+ /** One decimal GB, or MB when tiny; "—" with nothing stored. */
39
+ export declare function formatStorageGb(gb: number): string;
40
+ export declare function ProjectsListPage({ labels: given, columns: shown, actions, testId, }: ProjectsListPageProps): import("react").JSX.Element;
@@ -1,2 +1,3 @@
1
1
  export { ConnectedProjectsPanel, PROJECTS_BASE_TAB_ID, type ConnectedProjectsPanelProps, type ProjectPanelTabs, } from './ConnectedProjectsPanel';
2
2
  export { buildProjectSummaries, primaryProjectWorkspace, useProjectSummaries, useProjectSummary, type ProjectMemberSummary, type ProjectSummary, type ProjectWorkspaceSummary, } from './useProjectSummaries';
3
+ export { DEFAULT_PROJECT_LIST_COLUMNS, DEFAULT_PROJECTS_LIST_LABELS, formatStorageGb, type ProjectListColumn, type ProjectsListLabels, type ProjectsListPageProps, } from './ProjectsListPage';
@@ -0,0 +1,30 @@
1
+ /**
2
+ * Appearance, as a settings section a site adds as data (`ConnectedSettingsPage sections`).
3
+ *
4
+ * Two parts, each shown when the site supplies its store:
5
+ * - `appearance`: the reader's colour scheme, text size and typeface on this device
6
+ * ({@link createAppearanceStore});
7
+ * - `theme`: the site's brand tokens, edited live ({@link createThemeStore} + `ThemeEditor`).
8
+ */
9
+ import type { ReactNode } from 'react';
10
+ import type { SettingsPageSection } from '../../settings/SettingsPage';
11
+ import type { AppearanceBundle } from '../../theme/appearance';
12
+ import type { ThemeBundle } from '../../theme/store';
13
+ import { type ThemeEditorProps } from '../../theme/ThemeEditor';
14
+ export interface AppearanceSettingsSectionOptions {
15
+ /** The reader's appearance store: shows colour scheme, text size and typeface. */
16
+ appearance?: AppearanceBundle;
17
+ /** The site's theme bundle: shows the token editor. */
18
+ theme?: ThemeBundle;
19
+ /** The theme editor's live preview card. */
20
+ themePreview?: ThemeEditorProps['preview'];
21
+ /** The theme editor's heading icon (a site's accent). Default: a palette. */
22
+ icon?: ReactNode;
23
+ /** The theme editor's description. */
24
+ description?: string;
25
+ }
26
+ /**
27
+ * Appearance. The tab shows a palette when the section edits the theme's colours, a type glyph
28
+ * when it only sets the reader's own scheme, size and typeface.
29
+ */
30
+ export declare function appearanceSettingsSection(options: AppearanceSettingsSectionOptions): SettingsPageSection;
@@ -5,3 +5,4 @@ export { ConnectedPrivacySettings, type ConnectedPrivacySettingsProps, } from '.
5
5
  export { ConnectedPremiumModels } from './ConnectedPremiumModels';
6
6
  export { SessionStatusIcon, renderSessionStatusIcon } from './SessionStatusIcon';
7
7
  export { usageSettingsSection, connectionSettingsSection, organisationSettingsSection, type UsageSettingsSectionOptions, type ConnectionSettingsSectionOptions, type OrganisationSettingsSectionOptions, } from './sections';
8
+ export { appearanceSettingsSection, type AppearanceSettingsSectionOptions, } from './appearanceSection';