@ai-matrx/sharing 0.1.3 → 0.1.4

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,12 +1,15 @@
1
1
  # Changelog
2
2
 
3
- ## 0.1.3
3
+ ## 0.1.4
4
4
 
5
5
  UNVERIFIED: this release has no Unreleased entry and the source comparison could not be made (the caller supplied no source comparison). Whether source changed is unknown; consumer action is unknown.
6
6
  Check the package's gitHead on npm against this version's gitHead: `git diff <previous gitHead> <this gitHead> -- apps/shared/sharing/src`.
7
7
 
8
8
  ## 0.1.2
9
9
 
10
+ - **A share-sheet stand-in announces itself.** The defaults for `csvExportItem`, `jsonExportItem`, `usePageCapture`, `PageCaptureButton`, `ErrorAlchemyMenu`, `EntityDoorControls` and `vaultIdentity` used to be silent nothings. Each now warns once in the console naming the `configureShareSheetUi` field to pass, and a drawn stand-in leaves `data-share-sheet-host="unconfigured"` (+ `data-share-sheet-port`) in the DOM. New export `resetShareSheetStandInNotices` (test seam). **Consumer action:** none; pass the field to silence the notice. Guard: `react/__tests__/a-share-sheet-stand-in-announces-itself.test.tsx`.
11
+ - **`0.1.0` is superseded.** The `0.1.0` skeleton note below ("export nothing yet", "Do not adopt") is history: `/core`, `/react` and `/access/react` all export their API and matrx-frontend runs on them.
12
+
10
13
  - `ShareLinkPanel` options `linkSettings`, `showLinkDetails`, `showOpenLink`, `extraUrls`, `appOrigin`, `onLinksChange`; `shareLinkUrl`/`shareUrlForLink` take an optional origin (the one share-link manager).
11
14
 
12
15
  - **One ladder implementation.** `normalizePermissionLevel` and `parsePermissionLevel` are now re-exported from `@ai-matrx/data/access` (identical answers for every input; the unrecognised-level log now names `@ai-matrx/data/access` instead of the stale `utils/permissions/levels.ts`). `PERMISSION_LEVEL_RANK` and `permissionLevelRank` stay local: they rank the retired `edit_content` as Edit, which data's do not. Every export unchanged. **Consumer action:** none.
@@ -19,10 +22,10 @@ Check the package's gitHead on npm against this version's gitHead: `git diff <pr
19
22
 
20
23
  ## 0.1.0
21
24
 
22
- Skeleton release: the name's sections exist (`/core`, `/react`) and export nothing yet. The frozen API lands with its Wave 1 unit (BUILD-BOOK §3.2).
25
+ Skeleton release (superseded; see `0.1.1` and later): the name's sections exist (`/core`, `/react`) and export nothing yet. The frozen API lands with its Wave 1 unit (BUILD-BOOK §3.2).
23
26
 
24
27
  ### Consumer action
25
28
 
26
- None. Do not adopt until a unit ships the API.
29
+ None at the time; the API has since shipped (adopt the latest).
27
30
 
28
31
 
package/README.md CHANGED
@@ -2,12 +2,12 @@
2
2
 
3
3
  Sharing for every AI Matrx entity: the permission doors, share links, and the share dialog.
4
4
 
5
- **Status:** `/access/react` ships (the access gate screens, moved from `@ai-matrx/data`). `/core` and `/react` are reserved and export nothing yet; their API arrives with the Wave 1 unit of the Office build (`common-docs/projects/office-suite/BUILD-BOOK.md` §3.2).
5
+ **Status:** shipping and adopted by matrx-frontend. `/core` is the data half (`configureSharing`: the permission service, share links, registry, "shown to" reads); `/react` is THE share sheet (`ShareModal`, the link panels, the permission hooks; host UI through `configureShareSheetUi`); `/access/react` is the access gate screens (moved from `@ai-matrx/data`). Versions are cut by the publish lane on every push that changes this folder (`highest served + patch`), so `package.json`'s version is not the release state; `npm view @ai-matrx/sharing version` is.
6
6
 
7
7
  ## Sections
8
8
 
9
- - `@ai-matrx/sharing/core`
10
- - `@ai-matrx/sharing/react`
9
+ - `@ai-matrx/sharing/core` - the data half: `configureSharing`, permission service, share links, registry
10
+ - `@ai-matrx/sharing/react` - the share sheet and its hooks; every host-only part has an announcing default
11
11
  - `@ai-matrx/sharing/access/react` — `"use client"`: request access, access denied, governed actions, hidden-by-me
12
12
 
13
13
  ## `@ai-matrx/sharing/access/react` — the access gate screens
@@ -22,13 +22,13 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
22
22
  // src/access/react/cantRemoveDialog.render.tsx
23
23
  var cantRemoveDialog_render_exports = {};
24
24
  __export(cantRemoveDialog_render_exports, {
25
- default: () => render
25
+ default: () => CantRemoveDialogRender
26
26
  });
27
27
  module.exports = __toCommonJS(cantRemoveDialog_render_exports);
28
28
  var import_react = require("@ai-matrx/summon/react");
29
29
  var import_react2 = require("@ai-matrx/sharing/access/react");
30
30
  var import_jsx_runtime = require("react/jsx-runtime");
31
- function render({ data, close }) {
31
+ function CantRemoveDialogRender({ data, close }) {
32
32
  const { request, settle } = (0, import_react.useOverlayRequest)(data, close);
33
33
  if (!request) return null;
34
34
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/access/react/cantRemoveDialog.render.tsx"],"sourcesContent":["\"use client\";\n/**\n * The `cantRemoveDialog` overlay's render (`CANT_REMOVE_DIALOG`): answers the pending `requestCantRemove`\n * request with `GovernedActionDialog`. A host registers the overlay id with this module as its render.\n * Imports the package by name so the dialog shares the host's one `configureAccessUi` environment.\n */\nimport { useOverlayRequest, type OverlayRenderProps } from \"@ai-matrx/summon/react\";\nimport { GovernedActionDialog, type CantRemoveOutcome, type CantRemoveRequest } from \"@ai-matrx/sharing/access/react\";\n\nexport default function render({ data, close }: OverlayRenderProps) {\n const { request, settle } = useOverlayRequest<CantRemoveRequest, CantRemoveOutcome>(data, close);\n if (!request) return null;\n return (\n <GovernedActionDialog\n key={`${request.token}:${request.id}`}\n open\n onOpenChange={(next) => {\n if (!next) settle(\"closed\");\n }}\n resourceType={request.token}\n resourceId={request.id}\n itemName={request.itemName}\n itemLabel={request.itemLabel}\n action={request.action}\n href={request.href ?? null}\n // The hidden-ids store refreshed inside the hide, so every list of this kind re-renders.\n onHidden={() => settle(\"hidden\")}\n />\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAMA,mBAA2D;AAC3D,IAAAA,gBAAqF;AAMjF;AAJW,SAAR,OAAwB,EAAE,MAAM,MAAM,GAAuB;AAClE,QAAM,EAAE,SAAS,OAAO,QAAI,gCAAwD,MAAM,KAAK;AAC/F,MAAI,CAAC,QAAS,QAAO;AACrB,SACE;AAAA,IAAC;AAAA;AAAA,MAEC,MAAI;AAAA,MACJ,cAAc,CAAC,SAAS;AACtB,YAAI,CAAC,KAAM,QAAO,QAAQ;AAAA,MAC5B;AAAA,MACA,cAAc,QAAQ;AAAA,MACtB,YAAY,QAAQ;AAAA,MACpB,UAAU,QAAQ;AAAA,MAClB,WAAW,QAAQ;AAAA,MACnB,QAAQ,QAAQ;AAAA,MAChB,MAAM,QAAQ,QAAQ;AAAA,MAEtB,UAAU,MAAM,OAAO,QAAQ;AAAA;AAAA,IAZ1B,GAAG,QAAQ,KAAK,IAAI,QAAQ,EAAE;AAAA,EAarC;AAEJ;","names":["import_react"]}
1
+ {"version":3,"sources":["../src/access/react/cantRemoveDialog.render.tsx"],"sourcesContent":["\"use client\";\n/**\n * The `cantRemoveDialog` overlay's render (`CANT_REMOVE_DIALOG`): answers the pending `requestCantRemove`\n * request with `GovernedActionDialog`. A host registers the overlay id with this module as its render.\n * Imports the package by name so the dialog shares the host's one `configureAccessUi` environment.\n */\nimport { useOverlayRequest, type OverlayRenderProps } from \"@ai-matrx/summon/react\";\nimport { GovernedActionDialog, type CantRemoveOutcome, type CantRemoveRequest } from \"@ai-matrx/sharing/access/react\";\n\nexport default function CantRemoveDialogRender({ data, close }: OverlayRenderProps) {\n const { request, settle } = useOverlayRequest<CantRemoveRequest, CantRemoveOutcome>(data, close);\n if (!request) return null;\n return (\n <GovernedActionDialog\n key={`${request.token}:${request.id}`}\n open\n onOpenChange={(next) => {\n if (!next) settle(\"closed\");\n }}\n resourceType={request.token}\n resourceId={request.id}\n itemName={request.itemName}\n itemLabel={request.itemLabel}\n action={request.action}\n href={request.href ?? null}\n // The hidden-ids store refreshed inside the hide, so every list of this kind re-renders.\n onHidden={() => settle(\"hidden\")}\n />\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAMA,mBAA2D;AAC3D,IAAAA,gBAAqF;AAMjF;AAJW,SAAR,uBAAwC,EAAE,MAAM,MAAM,GAAuB;AAClF,QAAM,EAAE,SAAS,OAAO,QAAI,gCAAwD,MAAM,KAAK;AAC/F,MAAI,CAAC,QAAS,QAAO;AACrB,SACE;AAAA,IAAC;AAAA;AAAA,MAEC,MAAI;AAAA,MACJ,cAAc,CAAC,SAAS;AACtB,YAAI,CAAC,KAAM,QAAO,QAAQ;AAAA,MAC5B;AAAA,MACA,cAAc,QAAQ;AAAA,MACtB,YAAY,QAAQ;AAAA,MACpB,UAAU,QAAQ;AAAA,MAClB,WAAW,QAAQ;AAAA,MACnB,QAAQ,QAAQ;AAAA,MAChB,MAAM,QAAQ,QAAQ;AAAA,MAEtB,UAAU,MAAM,OAAO,QAAQ;AAAA;AAAA,IAZ1B,GAAG,QAAQ,KAAK,IAAI,QAAQ,EAAE;AAAA,EAarC;AAEJ;","names":["import_react"]}
@@ -1,6 +1,6 @@
1
1
  import * as react from 'react';
2
2
  import { OverlayRenderProps } from '@ai-matrx/summon/react';
3
3
 
4
- declare function render({ data, close }: OverlayRenderProps): react.JSX.Element | null;
4
+ declare function CantRemoveDialogRender({ data, close }: OverlayRenderProps): react.JSX.Element | null;
5
5
 
6
- export { render as default };
6
+ export { CantRemoveDialogRender as default };
@@ -1,6 +1,6 @@
1
1
  import * as react from 'react';
2
2
  import { OverlayRenderProps } from '@ai-matrx/summon/react';
3
3
 
4
- declare function render({ data, close }: OverlayRenderProps): react.JSX.Element | null;
4
+ declare function CantRemoveDialogRender({ data, close }: OverlayRenderProps): react.JSX.Element | null;
5
5
 
6
- export { render as default };
6
+ export { CantRemoveDialogRender as default };
@@ -5,7 +5,7 @@
5
5
  import { useOverlayRequest } from "@ai-matrx/summon/react";
6
6
  import { GovernedActionDialog } from "@ai-matrx/sharing/access/react";
7
7
  import { jsx } from "react/jsx-runtime";
8
- function render({ data, close }) {
8
+ function CantRemoveDialogRender({ data, close }) {
9
9
  const { request, settle } = useOverlayRequest(data, close);
10
10
  if (!request) return null;
11
11
  return /* @__PURE__ */ jsx(
@@ -27,6 +27,6 @@ function render({ data, close }) {
27
27
  );
28
28
  }
29
29
  export {
30
- render as default
30
+ CantRemoveDialogRender as default
31
31
  };
32
32
  //# sourceMappingURL=access-react-cant-remove-dialog.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/access/react/cantRemoveDialog.render.tsx"],"sourcesContent":["\"use client\";\n/**\n * The `cantRemoveDialog` overlay's render (`CANT_REMOVE_DIALOG`): answers the pending `requestCantRemove`\n * request with `GovernedActionDialog`. A host registers the overlay id with this module as its render.\n * Imports the package by name so the dialog shares the host's one `configureAccessUi` environment.\n */\nimport { useOverlayRequest, type OverlayRenderProps } from \"@ai-matrx/summon/react\";\nimport { GovernedActionDialog, type CantRemoveOutcome, type CantRemoveRequest } from \"@ai-matrx/sharing/access/react\";\n\nexport default function render({ data, close }: OverlayRenderProps) {\n const { request, settle } = useOverlayRequest<CantRemoveRequest, CantRemoveOutcome>(data, close);\n if (!request) return null;\n return (\n <GovernedActionDialog\n key={`${request.token}:${request.id}`}\n open\n onOpenChange={(next) => {\n if (!next) settle(\"closed\");\n }}\n resourceType={request.token}\n resourceId={request.id}\n itemName={request.itemName}\n itemLabel={request.itemLabel}\n action={request.action}\n href={request.href ?? null}\n // The hidden-ids store refreshed inside the hide, so every list of this kind re-renders.\n onHidden={() => settle(\"hidden\")}\n />\n );\n}\n"],"mappings":";;;;AAMA,SAAS,yBAAkD;AAC3D,SAAS,4BAA4E;AAMjF;AAJW,SAAR,OAAwB,EAAE,MAAM,MAAM,GAAuB;AAClE,QAAM,EAAE,SAAS,OAAO,IAAI,kBAAwD,MAAM,KAAK;AAC/F,MAAI,CAAC,QAAS,QAAO;AACrB,SACE;AAAA,IAAC;AAAA;AAAA,MAEC,MAAI;AAAA,MACJ,cAAc,CAAC,SAAS;AACtB,YAAI,CAAC,KAAM,QAAO,QAAQ;AAAA,MAC5B;AAAA,MACA,cAAc,QAAQ;AAAA,MACtB,YAAY,QAAQ;AAAA,MACpB,UAAU,QAAQ;AAAA,MAClB,WAAW,QAAQ;AAAA,MACnB,QAAQ,QAAQ;AAAA,MAChB,MAAM,QAAQ,QAAQ;AAAA,MAEtB,UAAU,MAAM,OAAO,QAAQ;AAAA;AAAA,IAZ1B,GAAG,QAAQ,KAAK,IAAI,QAAQ,EAAE;AAAA,EAarC;AAEJ;","names":[]}
1
+ {"version":3,"sources":["../src/access/react/cantRemoveDialog.render.tsx"],"sourcesContent":["\"use client\";\n/**\n * The `cantRemoveDialog` overlay's render (`CANT_REMOVE_DIALOG`): answers the pending `requestCantRemove`\n * request with `GovernedActionDialog`. A host registers the overlay id with this module as its render.\n * Imports the package by name so the dialog shares the host's one `configureAccessUi` environment.\n */\nimport { useOverlayRequest, type OverlayRenderProps } from \"@ai-matrx/summon/react\";\nimport { GovernedActionDialog, type CantRemoveOutcome, type CantRemoveRequest } from \"@ai-matrx/sharing/access/react\";\n\nexport default function CantRemoveDialogRender({ data, close }: OverlayRenderProps) {\n const { request, settle } = useOverlayRequest<CantRemoveRequest, CantRemoveOutcome>(data, close);\n if (!request) return null;\n return (\n <GovernedActionDialog\n key={`${request.token}:${request.id}`}\n open\n onOpenChange={(next) => {\n if (!next) settle(\"closed\");\n }}\n resourceType={request.token}\n resourceId={request.id}\n itemName={request.itemName}\n itemLabel={request.itemLabel}\n action={request.action}\n href={request.href ?? null}\n // The hidden-ids store refreshed inside the hide, so every list of this kind re-renders.\n onHidden={() => settle(\"hidden\")}\n />\n );\n}\n"],"mappings":";;;;AAMA,SAAS,yBAAkD;AAC3D,SAAS,4BAA4E;AAMjF;AAJW,SAAR,uBAAwC,EAAE,MAAM,MAAM,GAAuB;AAClF,QAAM,EAAE,SAAS,OAAO,IAAI,kBAAwD,MAAM,KAAK;AAC/F,MAAI,CAAC,QAAS,QAAO;AACrB,SACE;AAAA,IAAC;AAAA;AAAA,MAEC,MAAI;AAAA,MACJ,cAAc,CAAC,SAAS;AACtB,YAAI,CAAC,KAAM,QAAO,QAAQ;AAAA,MAC5B;AAAA,MACA,cAAc,QAAQ;AAAA,MACtB,YAAY,QAAQ;AAAA,MACpB,UAAU,QAAQ;AAAA,MAClB,WAAW,QAAQ;AAAA,MACnB,QAAQ,QAAQ;AAAA,MAChB,MAAM,QAAQ,QAAQ;AAAA,MAEtB,UAAU,MAAM,OAAO,QAAQ;AAAA;AAAA,IAZ1B,GAAG,QAAQ,KAAK,IAAI,QAAQ,EAAE;AAAA,EAarC;AAEJ;","names":[]}
package/dist/core.cjs CHANGED
@@ -4705,8 +4705,26 @@ function DefaultCopyButtons(props) {
4705
4705
  }
4706
4706
  );
4707
4707
  }
4708
+ var announced = /* @__PURE__ */ new Set();
4709
+ function announceStandIn(port) {
4710
+ if (announced.has(port)) return;
4711
+ announced.add(port);
4712
+ console.warn(
4713
+ `[share] The share sheet is using its built-in stand-in for "${port}": the host did not pass it, so that part of the sheet is absent. Pass it with configureShareSheetUi({ ${port} }).`
4714
+ );
4715
+ }
4716
+ function StandIn({ port }) {
4717
+ (0, import_react.useEffect)(() => announceStandIn(port), [port]);
4718
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { hidden: true, "data-share-sheet-host": "unconfigured", "data-share-sheet-port": port });
4719
+ }
4708
4720
  function DefaultErrorMenu(_props) {
4709
- return null;
4721
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(StandIn, { port: "ErrorAlchemyMenu" });
4722
+ }
4723
+ function DefaultPageCaptureButton(_props) {
4724
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(StandIn, { port: "PageCaptureButton" });
4725
+ }
4726
+ function DefaultEntityDoorControls(_props) {
4727
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(StandIn, { port: "EntityDoorControls" });
4710
4728
  }
4711
4729
  function DefaultInfoHint(props) {
4712
4730
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { title: String(props.text ?? ""), "aria-label": String(props.label ?? "More info"), className: "cursor-help text-muted-foreground", children: "\u24D8" });
@@ -4816,14 +4834,23 @@ var DEFAULTS = {
4816
4834
  useUserConnections: useDefaultConnections,
4817
4835
  confirm: (o) => (0, import_confirm_opener.confirm)(o),
4818
4836
  CopyButtons: DefaultCopyButtons,
4819
- csvExportItem: () => null,
4820
- jsonExportItem: () => null,
4821
- usePageCapture: () => void 0,
4837
+ csvExportItem: () => {
4838
+ announceStandIn("csvExportItem");
4839
+ return null;
4840
+ },
4841
+ jsonExportItem: () => {
4842
+ announceStandIn("jsonExportItem");
4843
+ return null;
4844
+ },
4845
+ usePageCapture: () => {
4846
+ announceStandIn("usePageCapture");
4847
+ return void 0;
4848
+ },
4822
4849
  dialogCapture: (input) => input,
4823
- PageCaptureButton: () => null,
4850
+ PageCaptureButton: DefaultPageCaptureButton,
4824
4851
  ErrorAlchemyMenu: DefaultErrorMenu,
4825
4852
  InfoHint: DefaultInfoHint,
4826
- EntityDoorControls: () => null,
4853
+ EntityDoorControls: DefaultEntityDoorControls,
4827
4854
  EntityRef: DefaultEntityRef,
4828
4855
  UserAvatarDisplay: DefaultUserAvatar,
4829
4856
  ConnectionsReadNotice: DefaultConnectionsNotice,