@mistriwork/kit 1.0.0-rc.45 → 1.0.0-rc.46

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.
@@ -143,7 +143,10 @@ export function PageHead({ entry, page, base, others, onLayout, actions, host, o
143
143
  /* A record that is gone has nothing to be done to it: no verbs, no Delete. */
144
144
  /* The verbs, the documents and Delete stand in the App's bar (Actions.tsx), drawn through the shell's slot. */
145
145
  const { ActionBar } = shell().slots;
146
- const toolbar = ActionBar && key && !gone && (actions || deleting.available || documents.length) ? (_jsx("div", { className: "page-head-actions", children: _jsx(ActionBar, { tableId: base.id, actions: actions?.list ?? [], recordKey: key, label: label, matches: actions?.matches ?? (async () => false), queryScope: actions?.queryScope, isCurrent: isCurrent, compact: phone, destructive: destructive, primary: header?.section.primary, only: header?.section.headerActions, canUpdate: actions?.canUpdate, grantedCommands: actions?.grantedCommands, grantedActions: actions?.grantedActions, menuTail: documents.length || deleting.available ? (_jsxs(_Fragment, { children: [documents.map((document) => (_jsx(DropItem, { className: "page-actions-item", onClick: () => go({ kind: 'page', pageId: page.id, table: base.id, key, label, tab: document.id }), children: document.label }, document.id))), deleting.available && (_jsx(DropItem, { className: "page-actions-item is-danger", disabled: deleting.blocked, onClick: deleting.ask, children: say('common.delete') }))] })) : undefined, onDone: () => {
146
+ /* Revoking the record's links is a write to it, offered where the server says this reader may (appProjection.ts);
147
+ the item stands from the first paint, so the head row never changes size for it; the count is asked when its dialog opens. */
148
+ const revokesLinks = Boolean(key && !gone && shell().inApp() && shell().app()?.revokesLinks?.includes(base.id));
149
+ const toolbar = ActionBar && key && !gone && (actions || deleting.available || documents.length || revokesLinks) ? (_jsx("div", { className: "page-head-actions", children: _jsx(ActionBar, { tableId: base.id, actions: actions?.list ?? [], recordKey: key, label: label, matches: actions?.matches ?? (async () => false), queryScope: actions?.queryScope, isCurrent: isCurrent, compact: phone, destructive: destructive, primary: header?.section.primary, only: header?.section.headerActions, canUpdate: actions?.canUpdate, grantedCommands: actions?.grantedCommands, grantedActions: actions?.grantedActions, revokesLinks: revokesLinks, menuTail: documents.length || deleting.available ? (_jsxs(_Fragment, { children: [documents.map((document) => (_jsx(DropItem, { className: "page-actions-item", onClick: () => go({ kind: 'page', pageId: page.id, table: base.id, key, label, tab: document.id }), children: document.label }, document.id))), deleting.available && (_jsx(DropItem, { className: "page-actions-item is-danger", disabled: deleting.blocked, onClick: deleting.ask, children: say('common.delete') }))] })) : undefined, onDone: () => {
147
150
  if (host) {
148
151
  if (isCurrent?.())
149
152
  host.onActionDone();
@@ -65,6 +65,9 @@ export interface ActionBarProps {
65
65
  only?: readonly string[];
66
66
  /** Items drawn last in More, after the record's own verbs: Delete. Their presence alone gives the bar a More menu. */
67
67
  menuTail?: ReactNode;
68
+ /** A record page's own: this reader may revoke the record's capability links (the server's answer), so More
69
+ offers it while some still open. */
70
+ revokesLinks?: boolean;
68
71
  /** A row's own menu: every shown verb an item of one ⋯ menu the caller opens, no buttons. */
69
72
  menuOnly?: {
70
73
  label: string;
@@ -10,4 +10,17 @@ export declare const say: import("../../../messages.js").RoomMessage<{
10
10
  readonly theReasonIsKept: "The reason is kept with the record.";
11
11
  readonly reason: "Reason";
12
12
  readonly labelReason: "{label}: reason";
13
+ readonly revokeLinks: "Revoke links";
14
+ readonly revokeLinksQuestion: "Revoke links?";
15
+ readonly linksStopOpening: {
16
+ readonly one: "The {count} link to {label} that still opens stops opening.";
17
+ readonly other: "The {count} links to {label} that still open stop opening.";
18
+ };
19
+ readonly noOpenLinks: "No links to {label} are open.";
20
+ readonly linksAreKept: "Keep links";
21
+ readonly linksRevoked: {
22
+ readonly one: "Revoked {count} link.";
23
+ readonly other: "Revoked {count} links.";
24
+ };
25
+ readonly linksWereNotRevoked: "The links were not revoked.";
13
26
  }>;
@@ -12,4 +12,14 @@ export const say = defineMessages({
12
12
  theReasonIsKept: 'The reason is kept with the record.',
13
13
  reason: 'Reason',
14
14
  labelReason: '{label}: reason',
15
+ revokeLinks: 'Revoke links',
16
+ revokeLinksQuestion: 'Revoke links?',
17
+ linksStopOpening: {
18
+ one: 'The {count} link to {label} that still opens stops opening.',
19
+ other: 'The {count} links to {label} that still open stop opening.',
20
+ },
21
+ noOpenLinks: 'No links to {label} are open.',
22
+ linksAreKept: 'Keep links',
23
+ linksRevoked: { one: 'Revoked {count} link.', other: 'Revoked {count} links.' },
24
+ linksWereNotRevoked: 'The links were not revoked.',
15
25
  });
@@ -266,6 +266,8 @@ export function refreshAfterCommand(client, record) {
266
266
  export const KEYED_SECTION_READS = {
267
267
  'page-history': { table: 1, key: 2 },
268
268
  'page-flows': { table: 1, key: 2 },
269
+ /* How many of the record's capability links still open (Actions.tsx): a command that mints one leaves it stale. */
270
+ 'record-links': { table: 1, key: 2 },
269
271
  'page-link-fields': { table: 3, key: 4 },
270
272
  'record-children': { table: 1, key: 2 },
271
273
  'record-children-page': { table: 1, key: 2 },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mistriwork/kit",
3
- "version": "1.0.0-rc.45",
3
+ "version": "1.0.0-rc.46",
4
4
  "description": "The shared React client both shells are drawn with: the walk and the address, Grid, Value, the record page, lists, filters and charts.",
5
5
  "homepage": "https://mistriwork.dev",
6
6
  "bugs": {
@@ -83,8 +83,8 @@
83
83
  "./package.json": "./package.json"
84
84
  },
85
85
  "dependencies": {
86
- "@mistriwork/engine": "1.0.0-rc.45",
87
- "@mistriwork/ui": "1.0.0-rc.45",
86
+ "@mistriwork/engine": "1.0.0-rc.46",
87
+ "@mistriwork/ui": "1.0.0-rc.46",
88
88
  "intl-messageformat": "12.1.2",
89
89
  "qrcode-generator": "^2.0.4"
90
90
  },