@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
@@ -708,22 +708,29 @@ function RecipientPicker({
708
708
  search,
709
709
  onSearchChange,
710
710
  hasNoKnownUsers,
711
- labels
711
+ labels,
712
+ layout = "compose",
713
+ actionSlot,
714
+ beforeCandidates,
715
+ candidateHeading,
716
+ emptyContent,
717
+ triggerTestId
712
718
  }) {
713
719
  const openRef = react.useRef(isOpen);
714
720
  openRef.current = isOpen;
715
721
  const l = react.useMemo(() => ({ ...DEFAULT_RECIPIENT_PICKER_LABELS, ...labels }), [labels]);
716
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "shrink-0 border-b px-6 py-4", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start gap-3", children: [
717
- /* @__PURE__ */ jsxRuntime.jsx(chunkULWRNGGE_cjs.ModalSectionTitle, { className: "mb-0 shrink-0 py-1.5", children: l.to }),
718
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-1 flex-col gap-1.5", children: [
719
- selected.map((recipient) => /* @__PURE__ */ jsxRuntime.jsxs(
720
- "div",
721
- {
722
- className: "flex items-center justify-between gap-2 rounded-md bg-muted/50 px-3 py-1.5",
723
- children: [
724
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
722
+ const rows = selected.map((recipient) => /* @__PURE__ */ jsxRuntime.jsxs(
723
+ "div",
724
+ {
725
+ 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",
726
+ children: [
727
+ /* @__PURE__ */ jsxRuntime.jsxs(
728
+ "div",
729
+ {
730
+ className: layout === "field" ? "flex items-center gap-2 min-w-0" : "flex items-center gap-2",
731
+ children: [
725
732
  recipient.identity,
726
- /* @__PURE__ */ jsxRuntime.jsxs(ui.Tooltip, { children: [
733
+ recipient.onToggleMute && /* @__PURE__ */ jsxRuntime.jsxs(ui.Tooltip, { children: [
727
734
  /* @__PURE__ */ jsxRuntime.jsx(
728
735
  ui.TooltipTrigger,
729
736
  {
@@ -737,78 +744,96 @@ function RecipientPicker({
737
744
  ),
738
745
  /* @__PURE__ */ jsxRuntime.jsx(ui.TooltipContent, { className: "max-w-[250px]", children: recipient.muteTooltip })
739
746
  ] })
740
- ] }),
741
- /* @__PURE__ */ jsxRuntime.jsx(
742
- "button",
743
- {
744
- type: "button",
745
- onClick: () => onRemove(recipient.id),
746
- className: "p-1 text-muted-foreground hover:text-destructive pointer-coarse:p-3",
747
- title: l.removeRecipient,
748
- "aria-label": l.removeRecipient,
749
- children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "h-4 w-4" })
750
- }
751
- )
752
- ]
753
- },
754
- recipient.id
755
- )),
756
- canAdd && /* @__PURE__ */ jsxRuntime.jsxs(ui.Popover, { open: isOpen, onOpenChange, children: [
757
- /* @__PURE__ */ jsxRuntime.jsx(ui.PopoverTrigger, { asChild: true, children: selected.length === 0 ? /* @__PURE__ */ jsxRuntime.jsxs(
758
- ui.Button,
759
- {
760
- variant: "outline",
761
- size: "sm",
762
- disabled: hasNoKnownUsers,
763
- className: "w-full justify-start text-muted-foreground",
764
- children: [
765
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronsUpDown, { className: "mr-2 h-4 w-4" }),
766
- l.selectRecipient
767
747
  ]
768
748
  }
769
- ) : /* @__PURE__ */ jsxRuntime.jsx(
770
- ui.Button,
771
- {
772
- variant: "ghost",
773
- size: "icon",
774
- disabled: hasNoKnownUsers,
775
- className: "h-7 w-7 rounded-full",
776
- title: l.addRecipient,
777
- "aria-label": l.addRecipient,
778
- children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Plus, { className: "h-4 w-4" })
779
- }
780
- ) }),
749
+ ),
781
750
  /* @__PURE__ */ jsxRuntime.jsx(
782
- ui.PopoverContent,
751
+ "button",
783
752
  {
784
- onCloseAutoFocus: (event) => {
785
- if (openRef.current) event.preventDefault();
786
- },
787
- className: "w-72 p-0",
788
- align: "start",
789
- onPointerDownOutside: (e) => e.preventDefault(),
790
- children: /* @__PURE__ */ jsxRuntime.jsxs(ui.Command, { shouldFilter: false, children: [
791
- /* @__PURE__ */ jsxRuntime.jsx(
792
- ui.CommandInput,
793
- {
794
- placeholder: l.searchUsers,
795
- value: search,
796
- onValueChange: onSearchChange
797
- }
798
- ),
799
- /* @__PURE__ */ jsxRuntime.jsx(ui.CommandList, { children: candidates.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx(ui.CommandEmpty, { children: hasNoKnownUsers ? l.noKnownUsers : l.noMatchingUsers }) : /* @__PURE__ */ jsxRuntime.jsx(ui.CommandGroup, { children: candidates.map((candidate) => /* @__PURE__ */ jsxRuntime.jsx(
800
- ui.CommandItem,
801
- {
802
- onSelect: () => onPick(candidate.id),
803
- className: "cursor-pointer justify-start",
804
- children: candidate.identity
805
- },
806
- candidate.id
807
- )) }) })
808
- ] })
753
+ type: "button",
754
+ onClick: () => onRemove(recipient.id),
755
+ className: layout === "field" ? "p-1 text-muted-foreground hover:text-destructive" : "p-1 text-muted-foreground hover:text-destructive pointer-coarse:p-3",
756
+ title: l.removeRecipient,
757
+ "aria-label": l.removeRecipient,
758
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "h-4 w-4" })
809
759
  }
810
760
  )
811
- ] }),
761
+ ]
762
+ },
763
+ recipient.id
764
+ ));
765
+ const picker = canAdd && /* @__PURE__ */ jsxRuntime.jsxs(ui.Popover, { open: isOpen, onOpenChange, children: [
766
+ /* @__PURE__ */ jsxRuntime.jsx(ui.PopoverTrigger, { asChild: true, children: layout === "field" || selected.length === 0 ? /* @__PURE__ */ jsxRuntime.jsxs(
767
+ ui.Button,
768
+ {
769
+ variant: "outline",
770
+ size: "sm",
771
+ disabled: layout === "compose" && hasNoKnownUsers,
772
+ className: layout === "field" ? "min-w-0 flex-1 justify-start text-muted-foreground" : "w-full justify-start text-muted-foreground",
773
+ "data-testid": triggerTestId,
774
+ children: [
775
+ /* @__PURE__ */ jsxRuntime.jsx(
776
+ lucideReact.ChevronsUpDown,
777
+ {
778
+ className: layout === "field" ? "mr-2 h-4 w-4 shrink-0" : "mr-2 h-4 w-4"
779
+ }
780
+ ),
781
+ layout === "field" ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate", children: l.selectRecipient }) : l.selectRecipient
782
+ ]
783
+ }
784
+ ) : /* @__PURE__ */ jsxRuntime.jsx(
785
+ ui.Button,
786
+ {
787
+ variant: "ghost",
788
+ size: "icon",
789
+ disabled: layout === "compose" && hasNoKnownUsers,
790
+ className: "h-7 w-7 rounded-full",
791
+ title: l.addRecipient,
792
+ "aria-label": l.addRecipient,
793
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Plus, { className: "h-4 w-4" })
794
+ }
795
+ ) }),
796
+ /* @__PURE__ */ jsxRuntime.jsx(
797
+ ui.PopoverContent,
798
+ {
799
+ onCloseAutoFocus: (event) => {
800
+ if (openRef.current) event.preventDefault();
801
+ },
802
+ className: "w-72 p-0",
803
+ align: "start",
804
+ onPointerDownOutside: layout === "compose" ? (e) => e.preventDefault() : void 0,
805
+ children: /* @__PURE__ */ jsxRuntime.jsxs(ui.Command, { shouldFilter: false, children: [
806
+ /* @__PURE__ */ jsxRuntime.jsx(ui.CommandInput, { placeholder: l.searchUsers, value: search, onValueChange: onSearchChange }),
807
+ /* @__PURE__ */ jsxRuntime.jsxs(ui.CommandList, { children: [
808
+ beforeCandidates,
809
+ candidates.length === 0 ? emptyContent === null ? null : /* @__PURE__ */ jsxRuntime.jsx(ui.CommandEmpty, { children: emptyContent ?? (hasNoKnownUsers ? l.noKnownUsers : l.noMatchingUsers) }) : /* @__PURE__ */ jsxRuntime.jsx(ui.CommandGroup, { heading: candidateHeading, children: candidates.map((candidate) => /* @__PURE__ */ jsxRuntime.jsx(
810
+ ui.CommandItem,
811
+ {
812
+ value: candidate.value,
813
+ onSelect: () => onPick(candidate.id),
814
+ className: layout === "field" ? "cursor-pointer" : "cursor-pointer justify-start",
815
+ children: candidate.identity
816
+ },
817
+ candidate.id
818
+ )) })
819
+ ] })
820
+ ] })
821
+ }
822
+ )
823
+ ] });
824
+ if (layout === "field")
825
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-1.5", children: [
826
+ rows,
827
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
828
+ picker,
829
+ selected.length > 0 && actionSlot
830
+ ] })
831
+ ] });
832
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "shrink-0 border-b px-6 py-4", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start gap-3", children: [
833
+ /* @__PURE__ */ jsxRuntime.jsx(chunkULWRNGGE_cjs.ModalSectionTitle, { className: "mb-0 shrink-0 py-1.5", children: l.to }),
834
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-1 flex-col gap-1.5", children: [
835
+ rows,
836
+ picker,
812
837
  hasNoKnownUsers && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-muted-foreground", children: l.addContactsHint })
813
838
  ] })
814
839
  ] }) });
@@ -1638,5 +1663,5 @@ exports.toAddContactsRow = toAddContactsRow;
1638
1663
  exports.toAddContactsRows = toAddContactsRows;
1639
1664
  exports.toggleMailFolder = toggleMailFolder;
1640
1665
  exports.validateContactForm = validateContactForm;
1641
- //# sourceMappingURL=chunk-5V4HH7EH.cjs.map
1642
- //# sourceMappingURL=chunk-5V4HH7EH.cjs.map
1666
+ //# sourceMappingURL=chunk-XDMIVPJP.cjs.map
1667
+ //# sourceMappingURL=chunk-XDMIVPJP.cjs.map