@arbidocs/react 0.4.159 → 0.4.160
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 +13 -6
- package/dist/{ProductionDialog-Dhf9MXH-.d.cts → ProductionDialog.d-BD1osHeq.d.cts} +1 -1
- package/dist/{ProductionDialog-BvRVGdvH.d.ts → ProductionDialog.d-CttHqQAh.d.ts} +1 -1
- package/dist/annotations/freeze/index.d.cts +3 -3
- package/dist/annotations/freeze/index.d.ts +3 -3
- package/dist/annotations/index.d.cts +4 -4
- package/dist/annotations/index.d.ts +4 -4
- package/dist/artifacts/index.cjs +12 -11
- package/dist/artifacts/index.cjs.map +1 -1
- package/dist/artifacts/index.d.cts +4 -4
- package/dist/artifacts/index.d.ts +4 -4
- package/dist/artifacts/index.js +3 -2
- package/dist/artifacts/index.js.map +1 -1
- package/dist/{chunk-RDLAOB55.cjs → chunk-3LMX6GXR.cjs} +150 -14
- package/dist/chunk-3LMX6GXR.cjs.map +1 -0
- package/dist/{chunk-37TQBT7Y.cjs → chunk-6MTKKT2O.cjs} +188 -126
- package/dist/chunk-6MTKKT2O.cjs.map +1 -0
- package/dist/{chunk-HKIR456G.js → chunk-CEZCFQ47.js} +149 -92
- package/dist/chunk-CEZCFQ47.js.map +1 -0
- package/dist/chunk-CPZ36AQS.js +11 -0
- package/dist/chunk-CPZ36AQS.js.map +1 -0
- package/dist/{chunk-JFKWH6EP.cjs → chunk-EUC2BTNS.cjs} +35 -4
- package/dist/chunk-EUC2BTNS.cjs.map +1 -0
- package/dist/chunk-GTJ667CP.cjs +26 -0
- package/dist/chunk-GTJ667CP.cjs.map +1 -0
- package/dist/{chunk-3XYIQZTH.js → chunk-I5ZBQ63Y.js} +33 -5
- package/dist/chunk-I5ZBQ63Y.js.map +1 -0
- package/dist/chunk-JSSKEXRR.js +22 -0
- package/dist/chunk-JSSKEXRR.js.map +1 -0
- package/dist/{chunk-QKNJ6FRD.cjs → chunk-ON4PL6DQ.cjs} +4 -4
- package/dist/chunk-ON4PL6DQ.cjs.map +1 -0
- package/dist/chunk-RCKA7BEF.cjs +14 -0
- package/dist/chunk-RCKA7BEF.cjs.map +1 -0
- package/dist/{chunk-2HNEVAXO.js → chunk-SVHGCX25.js} +3 -3
- package/dist/chunk-SVHGCX25.js.map +1 -0
- package/dist/{chunk-CNGWJDMG.js → chunk-WOXITGVS.js} +139 -15
- package/dist/chunk-WOXITGVS.js.map +1 -0
- package/dist/document-tools/index.cjs +35 -34
- package/dist/document-tools/index.cjs.map +1 -1
- package/dist/document-tools/index.d.cts +4 -4
- package/dist/document-tools/index.d.ts +4 -4
- package/dist/document-tools/index.js +4 -3
- package/dist/document-tools/index.js.map +1 -1
- package/dist/index.cjs +1777 -1515
- package/dist/index.cjs.map +1 -1
- package/dist/{index-DyFzmDZ2.d.ts → index.d-DfCFKora.d.cts} +49 -5
- package/dist/{index-DyFzmDZ2.d.cts → index.d-DfCFKora.d.ts} +49 -5
- package/dist/{index-CDTwtUr9.d.cts → index.d-eRbU1qpQ.d.cts} +333 -196
- package/dist/{index-CDTwtUr9.d.ts → index.d-eRbU1qpQ.d.ts} +333 -196
- package/dist/index.d.cts +1797 -1504
- package/dist/index.d.ts +1797 -1504
- package/dist/index.js +927 -764
- package/dist/index.js.map +1 -1
- package/dist/shell/index.cjs +24 -15
- package/dist/shell/index.d.cts +1 -1
- package/dist/shell/index.d.ts +1 -1
- package/dist/shell/index.js +2 -1
- package/dist/ui/index.cjs +191 -142
- package/dist/ui/index.d.cts +1 -1
- package/dist/ui/index.d.ts +1 -1
- package/dist/ui/index.js +2 -1
- package/dist/viewers/index.cjs +3 -2
- package/dist/viewers/index.cjs.map +1 -1
- package/dist/viewers/index.d.cts +2 -2
- package/dist/viewers/index.d.ts +2 -2
- package/dist/viewers/index.js +2 -1
- package/dist/viewers/index.js.map +1 -1
- package/package.json +4 -6
- package/dist/chunk-2HNEVAXO.js.map +0 -1
- package/dist/chunk-37TQBT7Y.cjs.map +0 -1
- package/dist/chunk-3XYIQZTH.js.map +0 -1
- package/dist/chunk-CNGWJDMG.js.map +0 -1
- package/dist/chunk-CPPBN2JB.js +0 -31
- package/dist/chunk-CPPBN2JB.js.map +0 -1
- package/dist/chunk-HKIR456G.js.map +0 -1
- package/dist/chunk-JFKWH6EP.cjs.map +0 -1
- package/dist/chunk-QKNJ6FRD.cjs.map +0 -1
- package/dist/chunk-R2MF7YCW.cjs +0 -36
- package/dist/chunk-R2MF7YCW.cjs.map +0 -1
- package/dist/chunk-RDLAOB55.cjs.map +0 -1
- /package/dist/{PdfViewer-bQH9yxFg.d.cts → PdfViewer.d-bQH9yxFg.d.cts} +0 -0
- /package/dist/{PdfViewer-bQH9yxFg.d.ts → PdfViewer.d-bQH9yxFg.d.ts} +0 -0
- /package/dist/{bundle-BnCSbHy2.d.cts → bundle.d-BnCSbHy2.d.cts} +0 -0
- /package/dist/{bundle-BnCSbHy2.d.ts → bundle.d-BnCSbHy2.d.ts} +0 -0
- /package/dist/{model-D63gedpb.d.cts → model.d-D63gedpb.d.cts} +0 -0
- /package/dist/{model-D63gedpb.d.ts → model.d-D63gedpb.d.ts} +0 -0
- /package/dist/{stored-markdown-Bp18vrbr.d.cts → stored-markdown.d-Bp18vrbr.d.cts} +0 -0
- /package/dist/{stored-markdown-Bp18vrbr.d.ts → stored-markdown.d-Bp18vrbr.d.ts} +0 -0
|
@@ -1,10 +1,54 @@
|
|
|
1
1
|
import * as zustand from 'zustand';
|
|
2
|
-
import * as React from 'react';
|
|
3
|
-
import { ReactNode, ReactElement } from 'react';
|
|
2
|
+
import * as React$1 from 'react';
|
|
3
|
+
import { ReactNode, ComponentType, ReactElement } from 'react';
|
|
4
4
|
import { StoreApi } from 'zustand/vanilla';
|
|
5
5
|
import { SearchChunk } from '@arbidocs/sdk/browser';
|
|
6
6
|
import { ToasterProps } from 'sonner';
|
|
7
7
|
|
|
8
|
+
/**
|
|
9
|
+
* `<ArbiHost config>`: the one place a host app hands its configuration to every hook and kit.
|
|
10
|
+
*
|
|
11
|
+
* <ArbiHost config={{ arbi, session, documents, calendar, mail, account, … }}>
|
|
12
|
+
* <App />
|
|
13
|
+
* </ArbiHost>
|
|
14
|
+
*
|
|
15
|
+
* Every field is optional and has a default (see `ArbiHostConfig`); a kit reads its domain from
|
|
16
|
+
* the config (`useArbiHost().documents`, `useHost().billing` in blocks). A nested `<ArbiHost>`
|
|
17
|
+
* overrides only the fields it gives and inherits the rest (`environment` field by field), for a
|
|
18
|
+
* subtree that opens projects in its own tabs, say. There is no other host provider: a new domain
|
|
19
|
+
* is a new optional field, never a new provider.
|
|
20
|
+
*
|
|
21
|
+
* SDK-free (this module, ./context and ./merge are all it reaches), so a marketing site that only sets the
|
|
22
|
+
* blocks environment does not bundle the SDK.
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
/** A sign-in layer mounted inside the host (`defaultHost` in `@arbidocs/blocks/connect`). */
|
|
26
|
+
interface ArbiHostConnection {
|
|
27
|
+
Provider: ComponentType<{
|
|
28
|
+
children: ReactNode;
|
|
29
|
+
}>;
|
|
30
|
+
}
|
|
31
|
+
interface ArbiHostProps<Config extends object> {
|
|
32
|
+
config: Config;
|
|
33
|
+
children?: ReactNode;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Provide the host configuration. Typed by the package it is imported from: `@arbidocs/react`'s
|
|
37
|
+
* takes the react domains, `@arbidocs/blocks`' the blocks domains as well.
|
|
38
|
+
*/
|
|
39
|
+
declare function ArbiHost<Config extends object>({ config, children, }: ArbiHostProps<Config>): React.ReactElement;
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* The host configuration's React context: one value for the whole tree, set by `<ArbiHost>`
|
|
43
|
+
* (./ArbiHost.tsx). It is untyped here so the SDK-free slices (`/ui`, `/shell`, the blocks root)
|
|
44
|
+
* can read their part (`dictate`, `environment`) without reaching the SDK's types; the typed read
|
|
45
|
+
* is `useArbiHost()` (react) and `useHost()` (blocks).
|
|
46
|
+
*/
|
|
47
|
+
/** The host configuration as stored: see `ArbiHostConfig`. */
|
|
48
|
+
type HostConfigRecord = Readonly<Record<string, unknown>>;
|
|
49
|
+
/** The host configuration in scope, untyped (`{}` outside an `<ArbiHost>`). */
|
|
50
|
+
declare function useHostConfigRecord(): HostConfigRecord;
|
|
51
|
+
|
|
8
52
|
/**
|
|
9
53
|
* A search's state outside any component: the query last searched, its passages, and whether it
|
|
10
54
|
* is running. A page that shows the shared session (`sharedSearchSession`) keeps its results when
|
|
@@ -201,8 +245,8 @@ interface NotificationBellProps {
|
|
|
201
245
|
side?: 'top' | 'right' | 'bottom' | 'left';
|
|
202
246
|
align?: 'start' | 'center' | 'end';
|
|
203
247
|
}
|
|
204
|
-
declare function NotificationBell({ renderTrigger, onNavigate, onSelectNotification, onMarkRead, onMarkAllRead, showMuteToggle, toneClassNames, emptyText, onViewAll, viewAllLabel, testId, side, align, }: NotificationBellProps): React.JSX.Element;
|
|
248
|
+
declare function NotificationBell({ renderTrigger, onNavigate, onSelectNotification, onMarkRead, onMarkAllRead, showMuteToggle, toneClassNames, emptyText, onViewAll, viewAllLabel, testId, side, align, }: NotificationBellProps): React$1.JSX.Element;
|
|
205
249
|
|
|
206
|
-
declare function Toaster({ toastOptions, ...props }: ToasterProps): React.JSX.Element;
|
|
250
|
+
declare function Toaster({ toastOptions, ...props }: ToasterProps): React$1.JSX.Element;
|
|
207
251
|
|
|
208
|
-
export { type AppNotification as A, DEFAULT_NOTIFY_TONE as D, MAX_SESSION_NOTIFICATIONS as M, NotificationBell as N, type SearchSession as S, Toaster as T,
|
|
252
|
+
export { type AppNotification as A, DEFAULT_NOTIFY_TONE as D, type HostConfigRecord as H, MAX_SESSION_NOTIFICATIONS as M, NotificationBell as N, type SearchSession as S, Toaster as T, ArbiHost as a, type ArbiHostConnection as b, type ArbiHostProps as c, type NotificationBellProps as d, type NotificationBellTriggerState as e, type NotifyConfig as f, type NotifyOptions as g, type NotifyVariant as h, type SearchSessionState as i, type SearchStatus as j, clearSearchSession as k, configureNotify as l, createSearchSession as m, notify as n, persistSearchSession as o, persistNotifyHistory as p, selectUnread as q, requestSearch as r, seedNotifications as s, sharedSearchSession as t, takePendingSearch as u, useHostConfigRecord as v, useNotify as w };
|
|
@@ -1,10 +1,54 @@
|
|
|
1
1
|
import * as zustand from 'zustand';
|
|
2
|
-
import * as React from 'react';
|
|
3
|
-
import { ReactNode, ReactElement } from 'react';
|
|
2
|
+
import * as React$1 from 'react';
|
|
3
|
+
import { ReactNode, ComponentType, ReactElement } from 'react';
|
|
4
4
|
import { StoreApi } from 'zustand/vanilla';
|
|
5
5
|
import { SearchChunk } from '@arbidocs/sdk/browser';
|
|
6
6
|
import { ToasterProps } from 'sonner';
|
|
7
7
|
|
|
8
|
+
/**
|
|
9
|
+
* `<ArbiHost config>`: the one place a host app hands its configuration to every hook and kit.
|
|
10
|
+
*
|
|
11
|
+
* <ArbiHost config={{ arbi, session, documents, calendar, mail, account, … }}>
|
|
12
|
+
* <App />
|
|
13
|
+
* </ArbiHost>
|
|
14
|
+
*
|
|
15
|
+
* Every field is optional and has a default (see `ArbiHostConfig`); a kit reads its domain from
|
|
16
|
+
* the config (`useArbiHost().documents`, `useHost().billing` in blocks). A nested `<ArbiHost>`
|
|
17
|
+
* overrides only the fields it gives and inherits the rest (`environment` field by field), for a
|
|
18
|
+
* subtree that opens projects in its own tabs, say. There is no other host provider: a new domain
|
|
19
|
+
* is a new optional field, never a new provider.
|
|
20
|
+
*
|
|
21
|
+
* SDK-free (this module, ./context and ./merge are all it reaches), so a marketing site that only sets the
|
|
22
|
+
* blocks environment does not bundle the SDK.
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
/** A sign-in layer mounted inside the host (`defaultHost` in `@arbidocs/blocks/connect`). */
|
|
26
|
+
interface ArbiHostConnection {
|
|
27
|
+
Provider: ComponentType<{
|
|
28
|
+
children: ReactNode;
|
|
29
|
+
}>;
|
|
30
|
+
}
|
|
31
|
+
interface ArbiHostProps<Config extends object> {
|
|
32
|
+
config: Config;
|
|
33
|
+
children?: ReactNode;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Provide the host configuration. Typed by the package it is imported from: `@arbidocs/react`'s
|
|
37
|
+
* takes the react domains, `@arbidocs/blocks`' the blocks domains as well.
|
|
38
|
+
*/
|
|
39
|
+
declare function ArbiHost<Config extends object>({ config, children, }: ArbiHostProps<Config>): React.ReactElement;
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* The host configuration's React context: one value for the whole tree, set by `<ArbiHost>`
|
|
43
|
+
* (./ArbiHost.tsx). It is untyped here so the SDK-free slices (`/ui`, `/shell`, the blocks root)
|
|
44
|
+
* can read their part (`dictate`, `environment`) without reaching the SDK's types; the typed read
|
|
45
|
+
* is `useArbiHost()` (react) and `useHost()` (blocks).
|
|
46
|
+
*/
|
|
47
|
+
/** The host configuration as stored: see `ArbiHostConfig`. */
|
|
48
|
+
type HostConfigRecord = Readonly<Record<string, unknown>>;
|
|
49
|
+
/** The host configuration in scope, untyped (`{}` outside an `<ArbiHost>`). */
|
|
50
|
+
declare function useHostConfigRecord(): HostConfigRecord;
|
|
51
|
+
|
|
8
52
|
/**
|
|
9
53
|
* A search's state outside any component: the query last searched, its passages, and whether it
|
|
10
54
|
* is running. A page that shows the shared session (`sharedSearchSession`) keeps its results when
|
|
@@ -201,8 +245,8 @@ interface NotificationBellProps {
|
|
|
201
245
|
side?: 'top' | 'right' | 'bottom' | 'left';
|
|
202
246
|
align?: 'start' | 'center' | 'end';
|
|
203
247
|
}
|
|
204
|
-
declare function NotificationBell({ renderTrigger, onNavigate, onSelectNotification, onMarkRead, onMarkAllRead, showMuteToggle, toneClassNames, emptyText, onViewAll, viewAllLabel, testId, side, align, }: NotificationBellProps): React.JSX.Element;
|
|
248
|
+
declare function NotificationBell({ renderTrigger, onNavigate, onSelectNotification, onMarkRead, onMarkAllRead, showMuteToggle, toneClassNames, emptyText, onViewAll, viewAllLabel, testId, side, align, }: NotificationBellProps): React$1.JSX.Element;
|
|
205
249
|
|
|
206
|
-
declare function Toaster({ toastOptions, ...props }: ToasterProps): React.JSX.Element;
|
|
250
|
+
declare function Toaster({ toastOptions, ...props }: ToasterProps): React$1.JSX.Element;
|
|
207
251
|
|
|
208
|
-
export { type AppNotification as A, DEFAULT_NOTIFY_TONE as D, MAX_SESSION_NOTIFICATIONS as M, NotificationBell as N, type SearchSession as S, Toaster as T,
|
|
252
|
+
export { type AppNotification as A, DEFAULT_NOTIFY_TONE as D, type HostConfigRecord as H, MAX_SESSION_NOTIFICATIONS as M, NotificationBell as N, type SearchSession as S, Toaster as T, ArbiHost as a, type ArbiHostConnection as b, type ArbiHostProps as c, type NotificationBellProps as d, type NotificationBellTriggerState as e, type NotifyConfig as f, type NotifyOptions as g, type NotifyVariant as h, type SearchSessionState as i, type SearchStatus as j, clearSearchSession as k, configureNotify as l, createSearchSession as m, notify as n, persistSearchSession as o, persistNotifyHistory as p, selectUnread as q, requestSearch as r, seedNotifications as s, sharedSearchSession as t, takePendingSearch as u, useHostConfigRecord as v, useNotify as w };
|