simetra 0.3.0-next.1 → 0.3.0-next.11

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.
@@ -97,4 +97,16 @@ export declare function entityCardRoute(entity: EntityDescriptor): {
97
97
  * route the one with `simetraList`; the path comes from the app's route tree.
98
98
  */
99
99
  export declare function routerNavigation(router: AnyRouter): NavigationAdapter;
100
+ /**
101
+ * Маркер кінця гідратації (спека «Споживач поза монорепо» §5.5, T6):
102
+ * `<html data-hydrated="true">` ставиться раз, після того як клієнт узяв
103
+ * серверну розмітку під себе. Тест застосунку чекає `html[data-hydrated]`
104
+ * замість таймера; атрибут є й у production-збірці. Корінь застосунку кличе
105
+ * цю функцію в ефекті гідратації.
106
+ */
107
+ export declare function markHydrated(doc: {
108
+ readonly documentElement: {
109
+ setAttribute(name: string, value: string): void;
110
+ };
111
+ }): void;
100
112
  export type { EntityDescriptor, EntityListRouteOptions, SimetraApp, SimetraRouterContext };
@@ -145,4 +145,15 @@ function routerNavigation(router) {
145
145
  }
146
146
  };
147
147
  }
148
- export { entityCardRoute, entityListRoute, routerNavigation, simetraApp };
148
+ // src/shell/hydration.ts
149
+ /**
150
+ * Маркер кінця гідратації (спека «Споживач поза монорепо» §5.5, T6):
151
+ * `<html data-hydrated="true">` ставиться раз, після того як клієнт узяв
152
+ * серверну розмітку під себе. Тест застосунку чекає `html[data-hydrated]`
153
+ * замість таймера; атрибут є й у production-збірці. Корінь застосунку кличе
154
+ * цю функцію в ефекті гідратації.
155
+ */
156
+ function markHydrated(doc) {
157
+ doc.documentElement.setAttribute("data-hydrated", "true");
158
+ }
159
+ export { entityCardRoute, entityListRoute, markHydrated, routerNavigation, simetraApp };
package/dist/ui/index.js CHANGED
@@ -421,6 +421,27 @@ const STATE_CELL_WIDTH = "var(--simetra-state-cell-width, 160px)";
421
421
  const SELECTION_PANEL_HEIGHT = "var(--simetra-selection-panel-height, 32px)";
422
422
  /** Width of the reserved selection-count slot; override with `--simetra-selection-count-width`. */
423
423
  const SELECTION_COUNT_WIDTH = "var(--simetra-selection-count-width, 96px)";
424
+ // src/ui/view-markers.ts
425
+ /**
426
+ * `loading` — даних ще немає; `refreshing` — дані є, перечитуються; усе
427
+ * інше (`ready`, `error`, `purged`) — `ready`: подання вже не чекає даних, а
428
+ * причину відмови показує власний слот.
429
+ */
430
+ function viewStateOf(status) {
431
+ return status === "loading" || status === "refreshing" ? status : "ready";
432
+ }
433
+ /** `pending`, коли хоч один рядок області чекає запису: стан `pending` чи `unknown`. */
434
+ function writesOf(rows) {
435
+ for (const row of rows) if (row.state === "pending" || row.state === "unknown") return "pending";
436
+ return "idle";
437
+ }
438
+ /** Атрибути області `[data-region="list"]` і `[data-region="card"]`. */
439
+ function viewMarkers(status, rows) {
440
+ return {
441
+ "data-view-state": viewStateOf(status),
442
+ "data-writes": writesOf(rows)
443
+ };
444
+ }
424
445
  // src/ui/list/selection-panel.ts
425
446
  function Button$1(props) {
426
447
  return createElement("button", {
@@ -668,7 +689,8 @@ function ListHost(props) {
668
689
  return createElement("div", {
669
690
  "data-region": "list",
670
691
  "data-object": object,
671
- role: "grid"
692
+ role: "grid",
693
+ ...viewMarkers(view.status, rows)
672
694
  }, createElement(SelectionPanel, { view }), createElement("div", {
673
695
  role: "row",
674
696
  style: {
@@ -1049,11 +1071,15 @@ function CardBody(props) {
1049
1071
  "data-object": object,
1050
1072
  "data-key": id,
1051
1073
  "data-state": row === void 0 ? void 0 : displayState(row),
1052
- "data-draft": draft.state
1074
+ "data-draft": draft.state,
1075
+ ...viewMarkers(card.status, row === void 0 ? [] : [row])
1053
1076
  }, createElement("div", { "data-region": "card-status" }, createElement("span", {
1054
1077
  "aria-live": "polite",
1055
1078
  "data-card": "status"
1056
- }, key === void 0 || key === "state.purged" ? null : createElement(Text, { messageKey: key }), staleHint ? createElement("span", { "data-hint": "stale" }, createElement(Text, { messageKey: "state.stale" })) : null, card.status === "error" && card.error !== void 0 && !("reason" in card.error && card.error.reason === "tabular-too-large") ? createElement("span", { "data-error": card.error.code }, card.error.code) : null), createElement("span", {
1079
+ }, key === void 0 || key === "state.purged" ? null : createElement(Text, { messageKey: key }), staleHint ? createElement("span", { "data-hint": "stale" }, createElement(Text, { messageKey: "state.stale" })) : null, card.status === "error" && card.error !== void 0 && !("reason" in card.error && card.error.reason === "tabular-too-large") ? createElement("span", { "data-error": card.error.code }, card.error.code) : null), card.status === "error" && card.error !== void 0 && !card.isStale && !("reason" in card.error && card.error.reason === "tabular-too-large") ? createElement(Button, {
1080
+ messageKey: "action.retry",
1081
+ onClick: card.refresh
1082
+ }) : null, createElement("span", {
1057
1083
  "aria-live": "assertive",
1058
1084
  "data-card": "security",
1059
1085
  "data-reason": card.status === "purged" ? card.reason : void 0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "simetra",
3
- "version": "0.3.0-next.1",
3
+ "version": "0.3.0-next.11",
4
4
  "description": "Metadata-driven platform for business applications on Postgres: metamodel, compiler and schema engine",
5
5
  "keywords": [
6
6
  "metadata",
@@ -135,6 +135,7 @@
135
135
  "publishConfig": {
136
136
  "access": "public"
137
137
  },
138
+ "gitHead": "63780dad2e1b47788b81c194072f1e30bec3f364",
138
139
  "scripts": {
139
140
  "build": "tsc --noEmit",
140
141
  "build:package": "tsdown",
@@ -429,32 +429,9 @@
429
429
  }
430
430
  },
431
431
  "containerBinding": {
432
- "description": "Attribute (or a two-step path of attributes) that binds a row to its rights container: the catalog flagged rightsContainer.",
433
- "anyOf": [
434
- {
435
- "type": "string",
436
- "pattern": "^[A-Za-z][A-Za-z0-9_]*$",
437
- "description": "Logical element name (attribute, section, column). The casing style is checked against the project naming setting."
438
- },
439
- {
440
- "type": "array",
441
- "prefixItems": [
442
- {
443
- "type": "string",
444
- "pattern": "^[A-Za-z][A-Za-z0-9_]*$",
445
- "description": "Logical element name (attribute, section, column). The casing style is checked against the project naming setting."
446
- },
447
- {
448
- "type": "string",
449
- "pattern": "^[A-Za-z][A-Za-z0-9_]*$",
450
- "description": "Logical element name (attribute, section, column). The casing style is checked against the project naming setting."
451
- }
452
- ],
453
- "items": false,
454
- "minItems": 2,
455
- "maxItems": 2
456
- }
457
- ]
432
+ "description": "Attribute that binds a row to its rights container (the catalog flagged rightsContainer) or to an object that is itself bound: a chain of bindings.",
433
+ "type": "string",
434
+ "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
458
435
  },
459
436
  "rightsContainer": {
460
437
  "description": "Marks the catalog as a rights container: objects bind to its rows with containerBinding, and a grant on the container covers them.",
@@ -447,32 +447,9 @@
447
447
  }
448
448
  },
449
449
  "containerBinding": {
450
- "description": "Attribute (or a two-step path of attributes) that binds a row to its rights container: the catalog flagged rightsContainer.",
451
- "anyOf": [
452
- {
453
- "type": "string",
454
- "pattern": "^[A-Za-z][A-Za-z0-9_]*$",
455
- "description": "Logical element name (attribute, section, column). The casing style is checked against the project naming setting."
456
- },
457
- {
458
- "type": "array",
459
- "prefixItems": [
460
- {
461
- "type": "string",
462
- "pattern": "^[A-Za-z][A-Za-z0-9_]*$",
463
- "description": "Logical element name (attribute, section, column). The casing style is checked against the project naming setting."
464
- },
465
- {
466
- "type": "string",
467
- "pattern": "^[A-Za-z][A-Za-z0-9_]*$",
468
- "description": "Logical element name (attribute, section, column). The casing style is checked against the project naming setting."
469
- }
470
- ],
471
- "items": false,
472
- "minItems": 2,
473
- "maxItems": 2
474
- }
475
- ]
450
+ "description": "Attribute that binds a row to its rights container (the catalog flagged rightsContainer) or to an object that is itself bound: a chain of bindings.",
451
+ "type": "string",
452
+ "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
476
453
  },
477
454
  "standardAttributeOverrides": {
478
455
  "default": {},
@@ -91,6 +91,201 @@
91
91
  "description": "Whether users may register themselves; enables the self sign-up warning and host start check.",
92
92
  "type": "boolean"
93
93
  },
94
+ "invitations": {
95
+ "description": "Invitations to scope kinds with a membership catalog and system role assignments; absent — no invitations.",
96
+ "type": "object",
97
+ "properties": {
98
+ "expiresInHours": {
99
+ "type": "integer",
100
+ "minimum": 1,
101
+ "maximum": 8760,
102
+ "description": "Hours an invitation secret stays valid after it is issued, 1 to 8760."
103
+ }
104
+ },
105
+ "required": [
106
+ "expiresInHours"
107
+ ],
108
+ "additionalProperties": false
109
+ },
110
+ "selfSignUpAccepted": {
111
+ "description": "What the self sign-up warning no longer reports: it names only objects and grants open to anyone that are not listed here.",
112
+ "type": "object",
113
+ "properties": {
114
+ "objects": {
115
+ "default": [],
116
+ "description": "Objects accepted as open to every signed-in user (publicRead authenticated).",
117
+ "type": "array",
118
+ "items": {
119
+ "type": "object",
120
+ "properties": {
121
+ "object": {
122
+ "type": "object",
123
+ "properties": {
124
+ "kind": {
125
+ "type": "string",
126
+ "enum": [
127
+ "Catalog",
128
+ "Document",
129
+ "Enumeration",
130
+ "InformationRegister",
131
+ "AccumulationRegister",
132
+ "Constant",
133
+ "CustomTable",
134
+ "PgEnum",
135
+ "EventSubscription",
136
+ "RightsSet",
137
+ "Role"
138
+ ],
139
+ "description": "Kind of the referenced metadata object."
140
+ },
141
+ "name": {
142
+ "type": "string",
143
+ "pattern": "^[A-Z][A-Za-z0-9]*$",
144
+ "description": "Logical name of the referenced object."
145
+ }
146
+ },
147
+ "required": [
148
+ "kind",
149
+ "name"
150
+ ],
151
+ "additionalProperties": false,
152
+ "description": "Object with publicRead authenticated accepted as open to anyone."
153
+ },
154
+ "published": {
155
+ "description": "Accept only the published rows (the conditional publicRead); without it every row is accepted.",
156
+ "type": "boolean",
157
+ "const": true
158
+ }
159
+ },
160
+ "required": [
161
+ "object"
162
+ ],
163
+ "additionalProperties": false
164
+ }
165
+ },
166
+ "grants": {
167
+ "default": [],
168
+ "description": "Grants of everyUser roles accepted as open to anyone.",
169
+ "type": "array",
170
+ "items": {
171
+ "type": "object",
172
+ "properties": {
173
+ "role": {
174
+ "type": "object",
175
+ "properties": {
176
+ "kind": {
177
+ "type": "string",
178
+ "enum": [
179
+ "Catalog",
180
+ "Document",
181
+ "Enumeration",
182
+ "InformationRegister",
183
+ "AccumulationRegister",
184
+ "Constant",
185
+ "CustomTable",
186
+ "PgEnum",
187
+ "EventSubscription",
188
+ "RightsSet",
189
+ "Role"
190
+ ],
191
+ "description": "Kind of the referenced metadata object."
192
+ },
193
+ "name": {
194
+ "type": "string",
195
+ "pattern": "^[A-Z][A-Za-z0-9]*$",
196
+ "description": "Logical name of the referenced object."
197
+ }
198
+ },
199
+ "required": [
200
+ "kind",
201
+ "name"
202
+ ],
203
+ "additionalProperties": false,
204
+ "description": "Role of the everyUser level."
205
+ },
206
+ "object": {
207
+ "type": "object",
208
+ "properties": {
209
+ "kind": {
210
+ "type": "string",
211
+ "enum": [
212
+ "Catalog",
213
+ "Document",
214
+ "Enumeration",
215
+ "InformationRegister",
216
+ "AccumulationRegister",
217
+ "Constant",
218
+ "CustomTable",
219
+ "PgEnum",
220
+ "EventSubscription",
221
+ "RightsSet",
222
+ "Role"
223
+ ],
224
+ "description": "Kind of the referenced metadata object."
225
+ },
226
+ "name": {
227
+ "type": "string",
228
+ "pattern": "^[A-Z][A-Za-z0-9]*$",
229
+ "description": "Logical name of the referenced object."
230
+ }
231
+ },
232
+ "required": [
233
+ "kind",
234
+ "name"
235
+ ],
236
+ "additionalProperties": false,
237
+ "description": "Object of the grant."
238
+ },
239
+ "actions": {
240
+ "minItems": 1,
241
+ "type": "array",
242
+ "items": {
243
+ "type": "string",
244
+ "pattern": "^[A-Za-z][A-Za-z0-9_]*$",
245
+ "description": "Logical element name (attribute, section, column). The casing style is checked against the project naming setting."
246
+ },
247
+ "description": "Accepted actions: standard words or custom action names."
248
+ },
249
+ "extent": {
250
+ "anyOf": [
251
+ {
252
+ "type": "string",
253
+ "const": "any"
254
+ },
255
+ {
256
+ "type": "string",
257
+ "const": "own"
258
+ },
259
+ {
260
+ "type": "object",
261
+ "properties": {
262
+ "dimension": {
263
+ "type": "string",
264
+ "pattern": "^[A-Za-z][A-Za-z0-9_]*$",
265
+ "description": "Name of a project access dimension."
266
+ }
267
+ },
268
+ "required": [
269
+ "dimension"
270
+ ],
271
+ "additionalProperties": false
272
+ }
273
+ ],
274
+ "description": "Rows the grant opens: any row, own rows, or rows with a value of an access dimension of the user."
275
+ }
276
+ },
277
+ "required": [
278
+ "role",
279
+ "object",
280
+ "actions",
281
+ "extent"
282
+ ],
283
+ "additionalProperties": false
284
+ }
285
+ }
286
+ },
287
+ "additionalProperties": false
288
+ },
94
289
  "scopeKinds": {
95
290
  "default": [],
96
291
  "description": "Scope kinds of the application; leave empty for a single-tenant application.",
@@ -17,6 +17,21 @@
17
17
  "pattern": "^[A-Z][A-Za-z0-9]*$",
18
18
  "description": "Logical object name in PascalCase."
19
19
  },
20
+ "title": {
21
+ "description": "Human-readable title of the object.",
22
+ "type": "object",
23
+ "properties": {
24
+ "uk": {
25
+ "description": "Ukrainian text.",
26
+ "type": "string"
27
+ },
28
+ "en": {
29
+ "description": "English text.",
30
+ "type": "string"
31
+ }
32
+ },
33
+ "additionalProperties": false
34
+ },
20
35
  "kind": {
21
36
  "type": "string",
22
37
  "const": "RightsSet",
@@ -172,7 +187,8 @@
172
187
  "unpost",
173
188
  "write",
174
189
  "publish",
175
- "unpublish"
190
+ "unpublish",
191
+ "acceptInvitation"
176
192
  ],
177
193
  "description": "Standard action word; selects every object of the role level that has it."
178
194
  }
@@ -17,6 +17,21 @@
17
17
  "pattern": "^[A-Z][A-Za-z0-9]*$",
18
18
  "description": "Logical object name in PascalCase."
19
19
  },
20
+ "title": {
21
+ "description": "Human-readable title of the object.",
22
+ "type": "object",
23
+ "properties": {
24
+ "uk": {
25
+ "description": "Ukrainian text.",
26
+ "type": "string"
27
+ },
28
+ "en": {
29
+ "description": "English text.",
30
+ "type": "string"
31
+ }
32
+ },
33
+ "additionalProperties": false
34
+ },
20
35
  "kind": {
21
36
  "type": "string",
22
37
  "const": "Role",
@@ -299,7 +314,8 @@
299
314
  "unpost",
300
315
  "write",
301
316
  "publish",
302
- "unpublish"
317
+ "unpublish",
318
+ "acceptInvitation"
303
319
  ],
304
320
  "description": "Standard action word; selects every object of the role level that has it."
305
321
  }
@@ -424,7 +440,8 @@
424
440
  "unpost",
425
441
  "write",
426
442
  "publish",
427
- "unpublish"
443
+ "unpublish",
444
+ "acceptInvitation"
428
445
  ],
429
446
  "description": "Standard action word; selects every object of the role level that has it."
430
447
  }