@arbidocs/blocks 0.5.41 → 0.5.43
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/{chunk-46WCQ4F3.js → chunk-HH34WKOC.js} +104 -79
- package/dist/{chunk-46WCQ4F3.js.map → chunk-HH34WKOC.js.map} +1 -1
- package/dist/{chunk-5ZHAHJ4H.cjs → chunk-TPNLYQD2.cjs} +9 -2
- package/dist/chunk-TPNLYQD2.cjs.map +1 -0
- package/dist/{chunk-CEO7YI7I.js → chunk-X7CXCEGO.js} +8 -3
- package/dist/chunk-X7CXCEGO.js.map +1 -0
- package/dist/{chunk-5V4HH7EH.cjs → chunk-XDMIVPJP.cjs} +104 -79
- package/dist/{chunk-5V4HH7EH.cjs.map → chunk-XDMIVPJP.cjs.map} +1 -1
- package/dist/collaboration/direct-messages/DmParts.d.ts +14 -4
- package/dist/collaboration/index.cjs +67 -67
- package/dist/collaboration/index.js +1 -1
- package/dist/connect/index.cjs +601 -110
- package/dist/connect/index.cjs.map +1 -1
- package/dist/connect/index.d.ts +3 -0
- package/dist/connect/index.js +499 -11
- package/dist/connect/index.js.map +1 -1
- package/dist/connection/people/ConnectedPeopleMultiSelect.d.ts +40 -0
- package/dist/connection/people/index.d.ts +1 -0
- package/dist/connection/people/invitation-message.d.ts +2 -0
- package/dist/connection/sharing/ConnectedShareDialog.d.ts +7 -0
- package/dist/connection/sharing/ResourceShareForm.d.ts +24 -0
- package/dist/connection/sharing/index.d.ts +1 -0
- package/dist/connection/sharing/useShareResource.d.ts +44 -0
- package/dist/connection/tips/useContextualHints.d.ts +13 -0
- package/dist/index.cjs +171 -123
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +43 -4
- package/dist/index.js.map +1 -1
- package/dist/tips/index.d.ts +2 -0
- package/dist/tips/useTipsPlacement.d.ts +24 -0
- package/dist/tips/visibility.d.ts +5 -0
- package/node_modules/@arbidocs/coedit/package.json +1 -1
- package/package.json +5 -5
- package/dist/chunk-5ZHAHJ4H.cjs.map +0 -1
- package/dist/chunk-CEO7YI7I.js.map +0 -1
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/** The shared people source bound to RecipientPicker’s field layout, including typed addresses. */
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
import { type UserResponse } from '@arbidocs/react';
|
|
4
|
+
/** Selected user - either an ARBI user or just an email (someone to invite) */
|
|
5
|
+
export interface PeopleSelection {
|
|
6
|
+
id: string;
|
|
7
|
+
email: string;
|
|
8
|
+
user?: UserResponse;
|
|
9
|
+
}
|
|
10
|
+
export interface ConnectedPeopleMultiSelectProps {
|
|
11
|
+
/** Also offer your own agents (where an agent is a valid target). */
|
|
12
|
+
includeAgents?: boolean;
|
|
13
|
+
/** Currently selected users */
|
|
14
|
+
selectedUsers: PeopleSelection[];
|
|
15
|
+
/** Callback when selection changes */
|
|
16
|
+
onSelectionChange: (users: PeopleSelection[]) => void;
|
|
17
|
+
/** Allow adding users by email (not among the search results) */
|
|
18
|
+
allowEmailEntry?: boolean;
|
|
19
|
+
/** Emails to exclude from selection (e.g., current workspace members) */
|
|
20
|
+
excludeEmails?: string[];
|
|
21
|
+
/** Emails to LABEL (not exclude) as already belonging to some group — e.g.
|
|
22
|
+
* existing workspace members when picking who to share a resource with,
|
|
23
|
+
* where re-selecting a member is valid (unlike excludeEmails). */
|
|
24
|
+
memberEmails?: string[];
|
|
25
|
+
/** Show contact toggle next to selected users */
|
|
26
|
+
showContactToggle?: boolean;
|
|
27
|
+
/** Show presence indicators */
|
|
28
|
+
showPresence?: boolean;
|
|
29
|
+
/** Placeholder text for empty state */
|
|
30
|
+
placeholder?: string;
|
|
31
|
+
/** Empty state message when no users available */
|
|
32
|
+
emptyMessage?: string;
|
|
33
|
+
/** Optional slot rendered right-aligned on the same row as the + button (when users selected) */
|
|
34
|
+
actionSlot?: ReactNode;
|
|
35
|
+
/** Optional content rendered inside each selected chip, between the identity
|
|
36
|
+
* and the remove button — lets a caller show per-recipient role/status
|
|
37
|
+
* without this component knowing anything about roles. */
|
|
38
|
+
renderChipExtra?: (selected: PeopleSelection) => ReactNode;
|
|
39
|
+
}
|
|
40
|
+
export declare function ConnectedPeopleMultiSelect({ includeAgents, selectedUsers, onSelectionChange, allowEmailEntry, excludeEmails, memberEmails, showContactToggle, showPresence, placeholder, emptyMessage, actionSlot, renderChipExtra, }: ConnectedPeopleMultiSelectProps): import("react").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ConnectedPeopleMultiSelect, type ConnectedPeopleMultiSelectProps, type PeopleSelection, } from './ConnectedPeopleMultiSelect';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { ShareRequest } from '../../provider/dialog-registry';
|
|
2
|
+
export interface ConnectedShareDialogProps {
|
|
3
|
+
request: ShareRequest | null;
|
|
4
|
+
onClose: () => void;
|
|
5
|
+
}
|
|
6
|
+
/** Share one document or conversation through the same workspace-membership permission flow. */
|
|
7
|
+
export declare function ConnectedShareDialog({ request, onClose }: ConnectedShareDialogProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { ShareRequest } from '../../provider/dialog-registry';
|
|
2
|
+
interface ResourceShareFormProps extends ShareRequest {
|
|
3
|
+
onDone: () => void;
|
|
4
|
+
disabled?: boolean;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Share a document/conversation by email — pick from contacts already on the
|
|
8
|
+
* platform (or already invited) or type a new email, same picker as
|
|
9
|
+
* AddWorkspaceUser. Unlike adding workspace members, an existing member is
|
|
10
|
+
* still a valid target (they just get notified, no role change), so members
|
|
11
|
+
* aren't excluded from the list here — they're labeled instead, both in the
|
|
12
|
+
* picker and on their chip, so it's clear who's already in and who's being
|
|
13
|
+
* invited.
|
|
14
|
+
*
|
|
15
|
+
* This is deliberately a variant of the workspace-invite flow, not a
|
|
16
|
+
* narrower one: the binary permission model (private-to-owner vs
|
|
17
|
+
* shared-with-workspace) means adding anyone here who isn't already a member
|
|
18
|
+
* invites them into the whole workspace, and sharing a private resource
|
|
19
|
+
* makes it visible to that whole workspace, not just the people picked below.
|
|
20
|
+
* Both consequences are surfaced inline (copy + toggle) instead of as
|
|
21
|
+
* after-the-fact confirm popups.
|
|
22
|
+
*/
|
|
23
|
+
export declare function ResourceShareForm({ resourceType, resourceExtId, workspaceExtId, resourceName, isPrivate, onDone, disabled, }: ResourceShareFormProps): import("react").JSX.Element;
|
|
24
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ConnectedShareDialog, type ConnectedShareDialogProps } from './ConnectedShareDialog';
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* useShareResource Hook
|
|
3
|
+
*
|
|
4
|
+
* Sharing a document/conversation by email is a variant of the existing
|
|
5
|
+
* add-user-to-workspace flow (same endpoint, same required role for new
|
|
6
|
+
* members, same confirm_invite two-phase gate for unregistered emails) — see
|
|
7
|
+
* useWorkspaceMembership.handleShareWorkspace, which this mirrors. The one thing
|
|
8
|
+
* layered on top is a second, resource-specific confirmation: sharing a
|
|
9
|
+
* private resource makes it visible to the whole workspace, not just the
|
|
10
|
+
* recipients. The modal now surfaces that consequence as an inline toggle
|
|
11
|
+
* (defaulted on for a private resource) BEFORE submit, so `shareWithWorkspace`
|
|
12
|
+
* is normally already decided by the time this runs — the old
|
|
13
|
+
* yes/no confirm prompt for it only fires as a defensive fallback if the
|
|
14
|
+
* backend still reports the resource needs confirming (e.g. someone else
|
|
15
|
+
* changed its visibility between modal-open and submit).
|
|
16
|
+
*
|
|
17
|
+
* The backend's add-users endpoint takes a single role for the whole batch of
|
|
18
|
+
* emails in one call — it has no per-email role. To let the modal assign
|
|
19
|
+
* different roles to different recipients without a backend change, entries
|
|
20
|
+
* are grouped by role client-side and submitted as one call per distinct
|
|
21
|
+
* role group.
|
|
22
|
+
*/
|
|
23
|
+
import type { WorkspaceRole } from '@arbidocs/react';
|
|
24
|
+
interface UseShareResourceParams {
|
|
25
|
+
workspaceExtId: string;
|
|
26
|
+
resourceType: 'document' | 'conversation';
|
|
27
|
+
resourceExtId: string;
|
|
28
|
+
resourceName?: string;
|
|
29
|
+
/** Emails already in the workspace. The backend's add-users endpoint
|
|
30
|
+
* never returns an already-a-member recipient in its response (it
|
|
31
|
+
* notifies them and moves on) — so without this, every already-a-member
|
|
32
|
+
* email looks identical to a genuinely-unregistered one and wrongly
|
|
33
|
+
* triggers the "isn't on the platform yet, invite them?" prompt. */
|
|
34
|
+
memberEmails?: string[];
|
|
35
|
+
}
|
|
36
|
+
export interface ShareEntry {
|
|
37
|
+
email: string;
|
|
38
|
+
role: WorkspaceRole;
|
|
39
|
+
}
|
|
40
|
+
export declare function useShareResource({ workspaceExtId, resourceType, resourceExtId, resourceName, memberEmails, }: UseShareResourceParams): {
|
|
41
|
+
shareResource: (entries: ShareEntry[], shareWithWorkspace: boolean) => Promise<"shared" | "cancelled" | "error">;
|
|
42
|
+
isSharing: boolean;
|
|
43
|
+
};
|
|
44
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared hints visibility: the account's saved show_hints preference, with an optional
|
|
3
|
+
* session-only override for guided actions. An explicit saved choice clears the override.
|
|
4
|
+
* Consumers gate on settingsLoaded so hints do not flash before the saved choice arrives.
|
|
5
|
+
*/
|
|
6
|
+
export declare function useContextualHints(): {
|
|
7
|
+
showHints: boolean;
|
|
8
|
+
settingsLoaded: boolean;
|
|
9
|
+
isDeveloper: boolean;
|
|
10
|
+
setShowHints: (value: boolean) => void;
|
|
11
|
+
setShowHintsPersisted: (value: boolean) => void;
|
|
12
|
+
dismissHints: () => void;
|
|
13
|
+
};
|