@ai-matrx/associations 0.9.8 → 0.9.9

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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog — @ai-matrx/associations
2
2
 
3
+ ## 0.9.9
4
+
5
+ Automatic changed-only republish (docs/metadata drift since the last tag — see
6
+ `git diff npm/associations/v0.9.8..npm/associations/v0.9.9 -- apps/shared/associations`).
7
+ No source changes intended and no consumer action required.
8
+
3
9
  ## 0.9.8
4
10
 
5
11
  Automatic changed-only republish (docs/metadata drift since the last tag — see
@@ -566,8 +566,10 @@ interface CapturePort {
566
566
  requestUpload?(opts: CaptureUploadOpts): Promise<CaptureUploadResult>;
567
567
  /** Resolves with picked file ids, or null/empty on cancel. */
568
568
  openFilePicker?(opts: CapturePickOpts): Promise<string[] | null>;
569
+ /** Creates a document in the authoritative organization of this container. */
569
570
  createDataTable?(opts: {
570
571
  name: string;
572
+ organizationId: string;
571
573
  }): Promise<{
572
574
  id: string;
573
575
  } | null>;
@@ -1771,13 +1773,18 @@ interface AssociationCaptureToolbarProps {
1771
1773
  showToolbar?: boolean;
1772
1774
  /** Extra host-specific buttons appended after the built-ins. */
1773
1775
  extraActions?: ReactNode;
1776
+ /**
1777
+ * Authoritative organization for this container. Never inferred from global
1778
+ * selection.
1779
+ */
1780
+ organizationId?: string | null;
1774
1781
  /** Open a freshly created document via the registry door. Default true. */
1775
1782
  openCreatedDocument?: boolean;
1776
1783
  className?: string;
1777
1784
  /** The body the drop target wraps (the list of attached things). */
1778
1785
  children?: ReactNode;
1779
1786
  }
1780
- declare function AssociationCaptureToolbar({ attach, uploadFolderPath, uploadVisibility, uploadLocationLabel, attachRetryLabel, filePicker, showActions, showToolbar, extraActions, openCreatedDocument, className, children, }: AssociationCaptureToolbarProps): react.JSX.Element;
1787
+ declare function AssociationCaptureToolbar({ attach, uploadFolderPath, uploadVisibility, uploadLocationLabel, attachRetryLabel, filePicker, showActions, showToolbar, extraActions, organizationId, openCreatedDocument, className, children, }: AssociationCaptureToolbarProps): react.JSX.Element;
1781
1788
  /** The dense toolbar button (exported so hosts' extraActions match). */
1782
1789
  declare function CaptureToolbarAction({ icon: Icon, label, onClick, disabled, spinning, }: {
1783
1790
  icon: (props: IconProps) => ReactNode;
@@ -566,8 +566,10 @@ interface CapturePort {
566
566
  requestUpload?(opts: CaptureUploadOpts): Promise<CaptureUploadResult>;
567
567
  /** Resolves with picked file ids, or null/empty on cancel. */
568
568
  openFilePicker?(opts: CapturePickOpts): Promise<string[] | null>;
569
+ /** Creates a document in the authoritative organization of this container. */
569
570
  createDataTable?(opts: {
570
571
  name: string;
572
+ organizationId: string;
571
573
  }): Promise<{
572
574
  id: string;
573
575
  } | null>;
@@ -1771,13 +1773,18 @@ interface AssociationCaptureToolbarProps {
1771
1773
  showToolbar?: boolean;
1772
1774
  /** Extra host-specific buttons appended after the built-ins. */
1773
1775
  extraActions?: ReactNode;
1776
+ /**
1777
+ * Authoritative organization for this container. Never inferred from global
1778
+ * selection.
1779
+ */
1780
+ organizationId?: string | null;
1774
1781
  /** Open a freshly created document via the registry door. Default true. */
1775
1782
  openCreatedDocument?: boolean;
1776
1783
  className?: string;
1777
1784
  /** The body the drop target wraps (the list of attached things). */
1778
1785
  children?: ReactNode;
1779
1786
  }
1780
- declare function AssociationCaptureToolbar({ attach, uploadFolderPath, uploadVisibility, uploadLocationLabel, attachRetryLabel, filePicker, showActions, showToolbar, extraActions, openCreatedDocument, className, children, }: AssociationCaptureToolbarProps): react.JSX.Element;
1787
+ declare function AssociationCaptureToolbar({ attach, uploadFolderPath, uploadVisibility, uploadLocationLabel, attachRetryLabel, filePicker, showActions, showToolbar, extraActions, organizationId, openCreatedDocument, className, children, }: AssociationCaptureToolbarProps): react.JSX.Element;
1781
1788
  /** The dense toolbar button (exported so hosts' extraActions match). */
1782
1789
  declare function CaptureToolbarAction({ icon: Icon, label, onClick, disabled, spinning, }: {
1783
1790
  icon: (props: IconProps) => ReactNode;
package/dist/index.d.cts CHANGED
@@ -13618,8 +13618,10 @@ interface CapturePort {
13618
13618
  requestUpload?(opts: CaptureUploadOpts): Promise<CaptureUploadResult>;
13619
13619
  /** Resolves with picked file ids, or null/empty on cancel. */
13620
13620
  openFilePicker?(opts: CapturePickOpts): Promise<string[] | null>;
13621
+ /** Creates a document in the authoritative organization of this container. */
13621
13622
  createDataTable?(opts: {
13622
13623
  name: string;
13624
+ organizationId: string;
13623
13625
  }): Promise<{
13624
13626
  id: string;
13625
13627
  } | null>;
package/dist/index.d.ts CHANGED
@@ -13618,8 +13618,10 @@ interface CapturePort {
13618
13618
  requestUpload?(opts: CaptureUploadOpts): Promise<CaptureUploadResult>;
13619
13619
  /** Resolves with picked file ids, or null/empty on cancel. */
13620
13620
  openFilePicker?(opts: CapturePickOpts): Promise<string[] | null>;
13621
+ /** Creates a document in the authoritative organization of this container. */
13621
13622
  createDataTable?(opts: {
13622
13623
  name: string;
13624
+ organizationId: string;
13623
13625
  }): Promise<{
13624
13626
  id: string;
13625
13627
  } | null>;
@@ -3510,6 +3510,7 @@ function AssociationCaptureToolbar({
3510
3510
  showActions,
3511
3511
  showToolbar = true,
3512
3512
  extraActions,
3513
+ organizationId,
3513
3514
  openCreatedDocument = true,
3514
3515
  className,
3515
3516
  children
@@ -3678,9 +3679,15 @@ function AssociationCaptureToolbar({
3678
3679
  const createDataTable = capture?.createDataTable;
3679
3680
  const name = docName.trim();
3680
3681
  if (!name || creatingDoc || !createDataTable) return;
3682
+ if (!organizationId) {
3683
+ notifier.error(
3684
+ "This container needs an organization before a document can be created."
3685
+ );
3686
+ return;
3687
+ }
3681
3688
  setCreatingDoc(true);
3682
3689
  try {
3683
- const doc = await createDataTable({ name });
3690
+ const doc = await createDataTable({ name, organizationId });
3684
3691
  if (!doc) {
3685
3692
  notifier.error("Couldn't create the document");
3686
3693
  return;