@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.
Files changed (35) hide show
  1. package/dist/{chunk-46WCQ4F3.js → chunk-HH34WKOC.js} +104 -79
  2. package/dist/{chunk-46WCQ4F3.js.map → chunk-HH34WKOC.js.map} +1 -1
  3. package/dist/{chunk-5ZHAHJ4H.cjs → chunk-TPNLYQD2.cjs} +9 -2
  4. package/dist/chunk-TPNLYQD2.cjs.map +1 -0
  5. package/dist/{chunk-CEO7YI7I.js → chunk-X7CXCEGO.js} +8 -3
  6. package/dist/chunk-X7CXCEGO.js.map +1 -0
  7. package/dist/{chunk-5V4HH7EH.cjs → chunk-XDMIVPJP.cjs} +104 -79
  8. package/dist/{chunk-5V4HH7EH.cjs.map → chunk-XDMIVPJP.cjs.map} +1 -1
  9. package/dist/collaboration/direct-messages/DmParts.d.ts +14 -4
  10. package/dist/collaboration/index.cjs +67 -67
  11. package/dist/collaboration/index.js +1 -1
  12. package/dist/connect/index.cjs +601 -110
  13. package/dist/connect/index.cjs.map +1 -1
  14. package/dist/connect/index.d.ts +3 -0
  15. package/dist/connect/index.js +499 -11
  16. package/dist/connect/index.js.map +1 -1
  17. package/dist/connection/people/ConnectedPeopleMultiSelect.d.ts +40 -0
  18. package/dist/connection/people/index.d.ts +1 -0
  19. package/dist/connection/people/invitation-message.d.ts +2 -0
  20. package/dist/connection/sharing/ConnectedShareDialog.d.ts +7 -0
  21. package/dist/connection/sharing/ResourceShareForm.d.ts +24 -0
  22. package/dist/connection/sharing/index.d.ts +1 -0
  23. package/dist/connection/sharing/useShareResource.d.ts +44 -0
  24. package/dist/connection/tips/useContextualHints.d.ts +13 -0
  25. package/dist/index.cjs +171 -123
  26. package/dist/index.cjs.map +1 -1
  27. package/dist/index.js +43 -4
  28. package/dist/index.js.map +1 -1
  29. package/dist/tips/index.d.ts +2 -0
  30. package/dist/tips/useTipsPlacement.d.ts +24 -0
  31. package/dist/tips/visibility.d.ts +5 -0
  32. package/node_modules/@arbidocs/coedit/package.json +1 -1
  33. package/package.json +5 -5
  34. package/dist/chunk-5ZHAHJ4H.cjs.map +0 -1
  35. package/dist/chunk-CEO7YI7I.js.map +0 -1
@@ -702,22 +702,29 @@ function RecipientPicker({
702
702
  search,
703
703
  onSearchChange,
704
704
  hasNoKnownUsers,
705
- labels
705
+ labels,
706
+ layout = "compose",
707
+ actionSlot,
708
+ beforeCandidates,
709
+ candidateHeading,
710
+ emptyContent,
711
+ triggerTestId
706
712
  }) {
707
713
  const openRef = useRef(isOpen);
708
714
  openRef.current = isOpen;
709
715
  const l = useMemo(() => ({ ...DEFAULT_RECIPIENT_PICKER_LABELS, ...labels }), [labels]);
710
- return /* @__PURE__ */ jsx("div", { className: "shrink-0 border-b px-6 py-4", children: /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-3", children: [
711
- /* @__PURE__ */ jsx(ModalSectionTitle, { className: "mb-0 shrink-0 py-1.5", children: l.to }),
712
- /* @__PURE__ */ jsxs("div", { className: "flex flex-1 flex-col gap-1.5", children: [
713
- selected.map((recipient) => /* @__PURE__ */ jsxs(
714
- "div",
715
- {
716
- className: "flex items-center justify-between gap-2 rounded-md bg-muted/50 px-3 py-1.5",
717
- children: [
718
- /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
716
+ const rows = selected.map((recipient) => /* @__PURE__ */ jsxs(
717
+ "div",
718
+ {
719
+ className: layout === "field" ? "flex items-center justify-between gap-2 py-1.5 px-3 bg-muted/50 rounded-md" : "flex items-center justify-between gap-2 rounded-md bg-muted/50 px-3 py-1.5",
720
+ children: [
721
+ /* @__PURE__ */ jsxs(
722
+ "div",
723
+ {
724
+ className: layout === "field" ? "flex items-center gap-2 min-w-0" : "flex items-center gap-2",
725
+ children: [
719
726
  recipient.identity,
720
- /* @__PURE__ */ jsxs(Tooltip, { children: [
727
+ recipient.onToggleMute && /* @__PURE__ */ jsxs(Tooltip, { children: [
721
728
  /* @__PURE__ */ jsx(
722
729
  TooltipTrigger,
723
730
  {
@@ -731,78 +738,96 @@ function RecipientPicker({
731
738
  ),
732
739
  /* @__PURE__ */ jsx(TooltipContent, { className: "max-w-[250px]", children: recipient.muteTooltip })
733
740
  ] })
734
- ] }),
735
- /* @__PURE__ */ jsx(
736
- "button",
737
- {
738
- type: "button",
739
- onClick: () => onRemove(recipient.id),
740
- className: "p-1 text-muted-foreground hover:text-destructive pointer-coarse:p-3",
741
- title: l.removeRecipient,
742
- "aria-label": l.removeRecipient,
743
- children: /* @__PURE__ */ jsx(X, { className: "h-4 w-4" })
744
- }
745
- )
746
- ]
747
- },
748
- recipient.id
749
- )),
750
- canAdd && /* @__PURE__ */ jsxs(Popover, { open: isOpen, onOpenChange, children: [
751
- /* @__PURE__ */ jsx(PopoverTrigger, { asChild: true, children: selected.length === 0 ? /* @__PURE__ */ jsxs(
752
- Button,
753
- {
754
- variant: "outline",
755
- size: "sm",
756
- disabled: hasNoKnownUsers,
757
- className: "w-full justify-start text-muted-foreground",
758
- children: [
759
- /* @__PURE__ */ jsx(ChevronsUpDown, { className: "mr-2 h-4 w-4" }),
760
- l.selectRecipient
761
741
  ]
762
742
  }
763
- ) : /* @__PURE__ */ jsx(
764
- Button,
765
- {
766
- variant: "ghost",
767
- size: "icon",
768
- disabled: hasNoKnownUsers,
769
- className: "h-7 w-7 rounded-full",
770
- title: l.addRecipient,
771
- "aria-label": l.addRecipient,
772
- children: /* @__PURE__ */ jsx(Plus, { className: "h-4 w-4" })
773
- }
774
- ) }),
743
+ ),
775
744
  /* @__PURE__ */ jsx(
776
- PopoverContent,
745
+ "button",
777
746
  {
778
- onCloseAutoFocus: (event) => {
779
- if (openRef.current) event.preventDefault();
780
- },
781
- className: "w-72 p-0",
782
- align: "start",
783
- onPointerDownOutside: (e) => e.preventDefault(),
784
- children: /* @__PURE__ */ jsxs(Command, { shouldFilter: false, children: [
785
- /* @__PURE__ */ jsx(
786
- CommandInput,
787
- {
788
- placeholder: l.searchUsers,
789
- value: search,
790
- onValueChange: onSearchChange
791
- }
792
- ),
793
- /* @__PURE__ */ jsx(CommandList, { children: candidates.length === 0 ? /* @__PURE__ */ jsx(CommandEmpty, { children: hasNoKnownUsers ? l.noKnownUsers : l.noMatchingUsers }) : /* @__PURE__ */ jsx(CommandGroup, { children: candidates.map((candidate) => /* @__PURE__ */ jsx(
794
- CommandItem,
795
- {
796
- onSelect: () => onPick(candidate.id),
797
- className: "cursor-pointer justify-start",
798
- children: candidate.identity
799
- },
800
- candidate.id
801
- )) }) })
802
- ] })
747
+ type: "button",
748
+ onClick: () => onRemove(recipient.id),
749
+ className: layout === "field" ? "p-1 text-muted-foreground hover:text-destructive" : "p-1 text-muted-foreground hover:text-destructive pointer-coarse:p-3",
750
+ title: l.removeRecipient,
751
+ "aria-label": l.removeRecipient,
752
+ children: /* @__PURE__ */ jsx(X, { className: "h-4 w-4" })
803
753
  }
804
754
  )
805
- ] }),
755
+ ]
756
+ },
757
+ recipient.id
758
+ ));
759
+ const picker = canAdd && /* @__PURE__ */ jsxs(Popover, { open: isOpen, onOpenChange, children: [
760
+ /* @__PURE__ */ jsx(PopoverTrigger, { asChild: true, children: layout === "field" || selected.length === 0 ? /* @__PURE__ */ jsxs(
761
+ Button,
762
+ {
763
+ variant: "outline",
764
+ size: "sm",
765
+ disabled: layout === "compose" && hasNoKnownUsers,
766
+ className: layout === "field" ? "min-w-0 flex-1 justify-start text-muted-foreground" : "w-full justify-start text-muted-foreground",
767
+ "data-testid": triggerTestId,
768
+ children: [
769
+ /* @__PURE__ */ jsx(
770
+ ChevronsUpDown,
771
+ {
772
+ className: layout === "field" ? "mr-2 h-4 w-4 shrink-0" : "mr-2 h-4 w-4"
773
+ }
774
+ ),
775
+ layout === "field" ? /* @__PURE__ */ jsx("span", { className: "truncate", children: l.selectRecipient }) : l.selectRecipient
776
+ ]
777
+ }
778
+ ) : /* @__PURE__ */ jsx(
779
+ Button,
780
+ {
781
+ variant: "ghost",
782
+ size: "icon",
783
+ disabled: layout === "compose" && hasNoKnownUsers,
784
+ className: "h-7 w-7 rounded-full",
785
+ title: l.addRecipient,
786
+ "aria-label": l.addRecipient,
787
+ children: /* @__PURE__ */ jsx(Plus, { className: "h-4 w-4" })
788
+ }
789
+ ) }),
790
+ /* @__PURE__ */ jsx(
791
+ PopoverContent,
792
+ {
793
+ onCloseAutoFocus: (event) => {
794
+ if (openRef.current) event.preventDefault();
795
+ },
796
+ className: "w-72 p-0",
797
+ align: "start",
798
+ onPointerDownOutside: layout === "compose" ? (e) => e.preventDefault() : void 0,
799
+ children: /* @__PURE__ */ jsxs(Command, { shouldFilter: false, children: [
800
+ /* @__PURE__ */ jsx(CommandInput, { placeholder: l.searchUsers, value: search, onValueChange: onSearchChange }),
801
+ /* @__PURE__ */ jsxs(CommandList, { children: [
802
+ beforeCandidates,
803
+ candidates.length === 0 ? emptyContent === null ? null : /* @__PURE__ */ jsx(CommandEmpty, { children: emptyContent ?? (hasNoKnownUsers ? l.noKnownUsers : l.noMatchingUsers) }) : /* @__PURE__ */ jsx(CommandGroup, { heading: candidateHeading, children: candidates.map((candidate) => /* @__PURE__ */ jsx(
804
+ CommandItem,
805
+ {
806
+ value: candidate.value,
807
+ onSelect: () => onPick(candidate.id),
808
+ className: layout === "field" ? "cursor-pointer" : "cursor-pointer justify-start",
809
+ children: candidate.identity
810
+ },
811
+ candidate.id
812
+ )) })
813
+ ] })
814
+ ] })
815
+ }
816
+ )
817
+ ] });
818
+ if (layout === "field")
819
+ return /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1.5", children: [
820
+ rows,
821
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
822
+ picker,
823
+ selected.length > 0 && actionSlot
824
+ ] })
825
+ ] });
826
+ return /* @__PURE__ */ jsx("div", { className: "shrink-0 border-b px-6 py-4", children: /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-3", children: [
827
+ /* @__PURE__ */ jsx(ModalSectionTitle, { className: "mb-0 shrink-0 py-1.5", children: l.to }),
828
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-1 flex-col gap-1.5", children: [
829
+ rows,
830
+ picker,
806
831
  hasNoKnownUsers && /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: l.addContactsHint })
807
832
  ] })
808
833
  ] }) });
@@ -1567,5 +1592,5 @@ function PlainMailBodyEditor({ text, disabled, onChange }) {
1567
1592
  }
1568
1593
 
1569
1594
  export { ActionMenu, AddContactsForm, AddContactsResults, DEFAULT_ADD_CONTACTS_LABELS, DEFAULT_CONTACT_INVITE_LABELS, DEFAULT_CONTACT_OUTCOME_LABELS, DEFAULT_DM_ACCESS_REQUEST_BANNER_LABELS, DEFAULT_DM_GRANT_ACCESS_DIALOG_LABELS, DEFAULT_DM_THREAD_FRAME_LABELS, DEFAULT_MAIL_FOLDER_TREE_LABELS, DEFAULT_RECIPIENT_PICKER_LABELS, DmAccessRequestBanner, DmGrantAccessDialogView, DmInviteAvatar, DmNewTabIcon, DmThreadFrame, EMPTY_CONTACT_FORM, MAX_INVITE_EMAILS, MailDeliveryBadge, MailDeliveryList, MailDocumentPicker, MailFolderTree, MailGrid, MailMessagePreview, MailMessageView, MemberBulkActions, MemberListLoading, MemberMutedText, MemberNameCell, MemberRoleCell, NEEDS_CONNECTION, PlainMailBodyEditor, RecipientPicker, RoleSelect, WorkspaceDeleteButton, applyContactInviteResults, buildMailFolderTree, contactName, contactOutcomeMessage, contactStatusLabel, contactToForm, descendantFolderIds, draftMailCompose, emailTokens, emptyMailCompose, failContactInvites, formToContactCard, hasCalendarPart, inviteEmail, isInboxFolder, isInvitableEmail, mailAddressLabel, matchesContact, normalizeVCardDate, parseEmails, parseMailRecipients, planContactInvites, primaryEmail, replyMailCompose, summarizeContactInvites, summarizeImport, summarizeUnsentInvites, toAddContactsRow, toAddContactsRows, toggleMailFolder, validateContactForm };
1570
- //# sourceMappingURL=chunk-46WCQ4F3.js.map
1571
- //# sourceMappingURL=chunk-46WCQ4F3.js.map
1595
+ //# sourceMappingURL=chunk-HH34WKOC.js.map
1596
+ //# sourceMappingURL=chunk-HH34WKOC.js.map