@ai-matrx/sharing 0.1.2 → 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 +10 -2
- package/README.md +3 -3
- package/dist/access-react-cant-remove-dialog.cjs +2 -2
- package/dist/access-react-cant-remove-dialog.cjs.map +1 -1
- package/dist/access-react-cant-remove-dialog.d.cts +2 -2
- package/dist/access-react-cant-remove-dialog.d.ts +2 -2
- package/dist/access-react-cant-remove-dialog.js +2 -2
- package/dist/access-react-cant-remove-dialog.js.map +1 -1
- package/dist/access-react.cjs +3 -1
- package/dist/access-react.cjs.map +1 -1
- package/dist/access-react.js +5 -1
- package/dist/access-react.js.map +1 -1
- package/dist/core.cjs +35 -8
- package/dist/core.cjs.map +1 -1
- package/dist/core.js +35 -8
- package/dist/core.js.map +1 -1
- package/dist/react.cjs +52 -24
- package/dist/react.cjs.map +1 -1
- package/dist/react.js +52 -24
- package/dist/react.js.map +1 -1
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,7 +1,15 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.1.4
|
|
4
|
+
|
|
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
|
+
Check the package's gitHead on npm against this version's gitHead: `git diff <previous gitHead> <this gitHead> -- apps/shared/sharing/src`.
|
|
7
|
+
|
|
3
8
|
## 0.1.2
|
|
4
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
|
+
|
|
5
13
|
- `ShareLinkPanel` options `linkSettings`, `showLinkDetails`, `showOpenLink`, `extraUrls`, `appOrigin`, `onLinksChange`; `shareLinkUrl`/`shareUrlForLink` take an optional origin (the one share-link manager).
|
|
6
14
|
|
|
7
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.
|
|
@@ -14,10 +22,10 @@
|
|
|
14
22
|
|
|
15
23
|
## 0.1.0
|
|
16
24
|
|
|
17
|
-
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).
|
|
18
26
|
|
|
19
27
|
### Consumer action
|
|
20
28
|
|
|
21
|
-
None
|
|
29
|
+
None at the time; the API has since shipped (adopt the latest).
|
|
22
30
|
|
|
23
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`
|
|
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: () =>
|
|
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
|
|
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
|
|
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
|
|
4
|
+
declare function CantRemoveDialogRender({ data, close }: OverlayRenderProps): react.JSX.Element | null;
|
|
5
5
|
|
|
6
|
-
export {
|
|
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
|
|
4
|
+
declare function CantRemoveDialogRender({ data, close }: OverlayRenderProps): react.JSX.Element | null;
|
|
5
5
|
|
|
6
|
-
export {
|
|
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
|
|
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
|
-
|
|
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
|
|
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/access-react.cjs
CHANGED
|
@@ -578,6 +578,7 @@ function headline(context) {
|
|
|
578
578
|
const kind = context.entity.label.toLowerCase();
|
|
579
579
|
switch (context.status) {
|
|
580
580
|
case "denied":
|
|
581
|
+
if (context.organizationArchived) return (0, import_access6.archivedOrganizationHeadline)(context);
|
|
581
582
|
return `You don't have access to this ${kind}`;
|
|
582
583
|
case "deleted":
|
|
583
584
|
return (0, import_access6.archivedHeadline)(context);
|
|
@@ -595,6 +596,7 @@ function explanation(context) {
|
|
|
595
596
|
const kind = context.entity.label.toLowerCase();
|
|
596
597
|
switch (context.status) {
|
|
597
598
|
case "denied": {
|
|
599
|
+
if (context.organizationArchived) return (0, import_access6.archivedOrganizationExplanation)(context);
|
|
598
600
|
const owner = context.organization ? context.organization.name : context.owner?.displayName;
|
|
599
601
|
if (!context.canRequest && context.request?.status !== "pending") {
|
|
600
602
|
return owner ? `It belongs to ${owner}, and there's no one for us to pass a request to.` : `It belongs to someone else, and there's no one for us to pass a request to.`;
|
|
@@ -736,7 +738,7 @@ function AccessDeniedView({
|
|
|
736
738
|
}
|
|
737
739
|
) : null
|
|
738
740
|
] }) : null,
|
|
739
|
-
context.status === "denied" && !absolute ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "mt-4", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
741
|
+
context.status === "denied" && !absolute && !context.organizationArchived ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "mt-4", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
740
742
|
RequestAccessPanel,
|
|
741
743
|
{
|
|
742
744
|
context,
|