@antelopejs/dms 0.25.8 → 0.25.9-next.1170.g0f31f2d
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/README.md +1 -1
- package/dist/e2e/backend-ready.d.mts +10 -0
- package/dist/e2e/index.d.mts +2 -1
- package/dist/e2e/journeys-config.d.mts +9 -0
- package/dist/e2e/mongo.d.mts +22 -0
- package/dist/e2e/waits.d.mts +6 -4
- package/dist/implementations/dms-auth/index.js +1 -1
- package/dist/implementations/dms-auth/index.js.map +1 -1
- package/dist/mockup/capture-drawing.d.ts +5 -0
- package/dist/mockup/capture-drawing.js +39 -0
- package/dist/mockup/capture-drawing.js.map +1 -0
- package/dist/mockup/capture-routes.js +10 -14
- package/dist/mockup/capture-routes.js.map +1 -1
- package/dist/mockup/capture.d.ts +3 -1
- package/dist/mockup/capture.js +36 -1
- package/dist/mockup/capture.js.map +1 -1
- package/dist/mockup/files.d.ts +1 -0
- package/dist/mockup/files.js +2 -1
- package/dist/mockup/files.js.map +1 -1
- package/dist/mockup/model.d.ts +2 -0
- package/dist/mockup/model.js.map +1 -1
- package/dist/mockup/store.js +15 -3
- package/dist/mockup/store.js.map +1 -1
- package/dist/pages/settings/users/member-invite-batch.d.ts +7 -1
- package/dist/pages/settings/users/member-invite-batch.js +53 -2
- package/dist/pages/settings/users/member-invite-batch.js.map +1 -1
- package/dist/pages/settings/users/profile.js +1 -1
- package/dist/pages/settings/users/profile.js.map +1 -1
- package/e2e/backend-ready.mjs +22 -0
- package/e2e/backend.mjs +3 -3
- package/e2e/index.mjs +27 -13
- package/e2e/journeys-config.mjs +16 -0
- package/e2e/mongo.mjs +58 -0
- package/e2e/stack.mjs +3 -2
- package/e2e/waits.mjs +21 -4
- package/e2e/weighted-shards.mjs +164 -0
- package/e2e/weights.mjs +67 -0
- package/frontend-vue/layers/dms-core/i18n/locales/core-en-GB.json +17 -2
- package/frontend-vue/layers/dms-core/i18n/locales/core-fr-FR.json +17 -2
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupOverviewSlot.vue +29 -24
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupWorkbench.vue +5 -0
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/previewNavigation.ts +8 -0
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useBlockPreviewEmbed.ts +5 -10
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupCaptureRelease.ts +35 -0
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupOverview.ts +2 -0
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useOverviewCaptures.ts +20 -14
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/usePreviewFrame.ts +3 -2
- package/frontend-vue/layers/dms-ui/app/build/mockups/MockupCards.vue +6 -2
- package/frontend-vue/layers/dms-ui/app/build/mockups/manage.ts +28 -2
- package/frontend-vue/layers/dms-ui/app/build/utils/blockPreviewMessages.ts +19 -4
- package/frontend-vue/layers/dms-ui/app/build/utils/mockup.ts +15 -7
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupCaptures.ts +24 -0
- package/frontend-vue/package.json +1 -1
- package/package.json +3 -3
|
@@ -26,7 +26,7 @@ interface PreviewFrameOptions {
|
|
|
26
26
|
/** The preview's page header was picked: the page itself. */
|
|
27
27
|
onSelectPage?: () => void;
|
|
28
28
|
/** Where each block now sits, while inspecting. */
|
|
29
|
-
onLayout?: (blocks: PreviewBlockRect[]) => void;
|
|
29
|
+
onLayout?: (blocks: PreviewBlockRect[], renderId?: number) => void;
|
|
30
30
|
/** A text of a block was double-clicked, while inspecting. */
|
|
31
31
|
onText?: (text: PreviewTextMessage) => void;
|
|
32
32
|
/** An entry of the preview's sidebar, or a link to a page of the mockup, was picked: the page's id, and the row a link from a row passes. */
|
|
@@ -104,7 +104,8 @@ export function usePreviewFrame(options: PreviewFrameOptions): PreviewFrame {
|
|
|
104
104
|
},
|
|
105
105
|
"select-page": () => options.onSelectPage?.(),
|
|
106
106
|
layout: (message) => {
|
|
107
|
-
if (message.type === "layout")
|
|
107
|
+
if (message.type === "layout")
|
|
108
|
+
options.onLayout?.(message.blocks, message.renderId);
|
|
108
109
|
},
|
|
109
110
|
text: (message) => {
|
|
110
111
|
if (message.type === "text") options.onText?.(message);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { computed, ref, shallowRef } from "vue";
|
|
2
|
+
import { computed, onMounted, ref, shallowRef } from "vue";
|
|
3
3
|
import type { TableViewDisplayContext } from "../../composables/table-view/types";
|
|
4
4
|
import DmsTableEmpty from "../components/table/TableEmpty.vue";
|
|
5
5
|
import DmsTablePagination from "../components/table/TablePagination.vue";
|
|
@@ -11,6 +11,7 @@ import {
|
|
|
11
11
|
deleteMockup,
|
|
12
12
|
duplicateMockup,
|
|
13
13
|
type MockupRenameRequest,
|
|
14
|
+
releaseVanishedMockupCaptures,
|
|
14
15
|
renameMockup,
|
|
15
16
|
} from "./manage";
|
|
16
17
|
import MockupRenameModal from "./MockupRenameModal.vue";
|
|
@@ -20,7 +21,8 @@ import { resyncFromPage } from "./resync";
|
|
|
20
21
|
* The display of the Mockups page: a "New mockup" card first, then one card
|
|
21
22
|
* per mockup. A card opens the mockup's viewer and has a menu to rename, copy
|
|
22
23
|
* or delete it. The new mockup card hands the AI assistant a starter request,
|
|
23
|
-
* and shows it to copy when no assistant takes it.
|
|
24
|
+
* and shows it to copy when no assistant takes it. Once mounted, it releases
|
|
25
|
+
* the Overview's captures of every mockup the full list no longer names.
|
|
24
26
|
*/
|
|
25
27
|
const props = defineProps<{ context: TableViewDisplayContext }>();
|
|
26
28
|
|
|
@@ -46,6 +48,8 @@ const mockups = computed(() =>
|
|
|
46
48
|
props.context.items.flatMap((row) => parseMockupSummary(row) ?? []),
|
|
47
49
|
);
|
|
48
50
|
|
|
51
|
+
onMounted(() => releaseVanishedMockupCaptures($authFetch));
|
|
52
|
+
|
|
49
53
|
function labelOf(mockup: MockupSummary): string {
|
|
50
54
|
return mockup.title || mockup.name;
|
|
51
55
|
}
|
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
import { isObject, isString } from "#dms-core/app/utils/type-check";
|
|
2
|
-
import {
|
|
3
|
-
|
|
2
|
+
import {
|
|
3
|
+
MOCKUP_LIST_ENDPOINT,
|
|
4
|
+
mockupEndpoint,
|
|
5
|
+
parseMockupList,
|
|
6
|
+
} from "../utils/mockup";
|
|
7
|
+
import {
|
|
8
|
+
clearMockupCaptures,
|
|
9
|
+
holdsMockupCaptures,
|
|
10
|
+
keepMockupCaptures,
|
|
11
|
+
} from "../utils/mockupCaptures";
|
|
4
12
|
|
|
5
13
|
/** What a mockup change sends: a new name, a new title, or both. */
|
|
6
14
|
export interface MockupRenameRequest {
|
|
@@ -58,3 +66,21 @@ export async function deleteMockup(
|
|
|
58
66
|
await fetch(mockupEndpoint(name), { method: "DELETE" });
|
|
59
67
|
clearMockupCaptures(name);
|
|
60
68
|
}
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Releases the Overview's captures of every mockup the full `GET /api/mockup`
|
|
72
|
+
* list no longer names: one deleted or renamed through MCP or on disk while
|
|
73
|
+
* its viewer was closed. Reads nothing while this tab holds no capture, and
|
|
74
|
+
* releases nothing when the list cannot be read.
|
|
75
|
+
*/
|
|
76
|
+
export async function releaseVanishedMockupCaptures(
|
|
77
|
+
fetch: (url: string) => Promise<Answer>,
|
|
78
|
+
): Promise<void> {
|
|
79
|
+
if (!holdsMockupCaptures()) return;
|
|
80
|
+
try {
|
|
81
|
+
const list = parseMockupList(await fetch(MOCKUP_LIST_ENDPOINT));
|
|
82
|
+
if (list) keepMockupCaptures(list.map((mockup) => mockup.name));
|
|
83
|
+
} catch {
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
@@ -111,6 +111,8 @@ export interface PreviewRenderMessage {
|
|
|
111
111
|
params?: Record<string, string>;
|
|
112
112
|
/** The query parameters of the page the blocks are on, as its URL gives them; none when absent. */
|
|
113
113
|
query?: Record<string, string>;
|
|
114
|
+
/** Names this render: each `layout` the preview posts names the last render it laid out, so a parent can tell a layout of an earlier render from the one it waits for. */
|
|
115
|
+
renderId?: number;
|
|
114
116
|
}
|
|
115
117
|
|
|
116
118
|
/** Parent → iframe: switch the color mode. */
|
|
@@ -192,6 +194,8 @@ export interface PreviewLayoutMessage {
|
|
|
192
194
|
channel: typeof PREVIEW_CHANNEL;
|
|
193
195
|
type: "layout";
|
|
194
196
|
blocks: PreviewBlockRect[];
|
|
197
|
+
/** The `renderId` of the last render the preview received when it measured these blocks; absent when that render named none. */
|
|
198
|
+
renderId?: number;
|
|
195
199
|
}
|
|
196
200
|
|
|
197
201
|
/** Iframe → parent, while inspecting: a text of a block was double-clicked. */
|
|
@@ -335,7 +339,8 @@ function isRenderMessage(
|
|
|
335
339
|
(value.navigation === undefined || isPreviewNavigation(value.navigation)) &&
|
|
336
340
|
(value.header === undefined || isPreviewHeader(value.header)) &&
|
|
337
341
|
isOptionalPreviewPageLayout(value.pageLayout) &&
|
|
338
|
-
[value.params, value.query].every(isOptionalStringRecord)
|
|
342
|
+
[value.params, value.query].every(isOptionalStringRecord) &&
|
|
343
|
+
(value.renderId === undefined || isNumber(value.renderId))
|
|
339
344
|
);
|
|
340
345
|
}
|
|
341
346
|
|
|
@@ -412,8 +417,14 @@ export function previewSelectMessage(path: string): PreviewSelectMessage {
|
|
|
412
417
|
|
|
413
418
|
export function previewLayoutMessage(
|
|
414
419
|
blocks: PreviewBlockRect[],
|
|
420
|
+
renderId?: number,
|
|
415
421
|
): PreviewLayoutMessage {
|
|
416
|
-
return {
|
|
422
|
+
return {
|
|
423
|
+
channel: PREVIEW_CHANNEL,
|
|
424
|
+
type: "layout",
|
|
425
|
+
blocks,
|
|
426
|
+
...(renderId !== undefined && { renderId }),
|
|
427
|
+
};
|
|
417
428
|
}
|
|
418
429
|
|
|
419
430
|
export function previewTextMessage(
|
|
@@ -479,6 +490,7 @@ interface PostedFields {
|
|
|
479
490
|
record?: JsonValue;
|
|
480
491
|
button?: JsonValue;
|
|
481
492
|
edit?: JsonValue;
|
|
493
|
+
renderId?: JsonValue;
|
|
482
494
|
}
|
|
483
495
|
|
|
484
496
|
const OUTBOUND_PARSERS: Record<
|
|
@@ -494,9 +506,12 @@ const OUTBOUND_PARSERS: Record<
|
|
|
494
506
|
isString(message) ? previewErrorMessage(message) : undefined,
|
|
495
507
|
select: ({ path }) =>
|
|
496
508
|
isString(path) ? previewSelectMessage(path) : undefined,
|
|
497
|
-
layout: ({ blocks }) => {
|
|
509
|
+
layout: ({ blocks, renderId }) => {
|
|
498
510
|
const parsed = parseBlockRects(blocks);
|
|
499
|
-
|
|
511
|
+
if (!parsed || (renderId !== undefined && !isNumber(renderId))) {
|
|
512
|
+
return undefined;
|
|
513
|
+
}
|
|
514
|
+
return previewLayoutMessage(parsed, renderId);
|
|
500
515
|
},
|
|
501
516
|
text: ({ path, text, rect, font }) => {
|
|
502
517
|
const box = parseRect(rect);
|
|
@@ -106,6 +106,10 @@ export interface MockupState {
|
|
|
106
106
|
title?: string;
|
|
107
107
|
/** Moves on every successful read of the spec file. */
|
|
108
108
|
revision: number;
|
|
109
|
+
/** Names what draws the first page as the spec holds it: the image of that page is uploaded with it, and refused once the spec changed. Absent when the spec has no first page. */
|
|
110
|
+
firstPageDrawing?: string;
|
|
111
|
+
/** True while the backend reports `spec.json` gone, as for a mockup deleted or renamed outside the dashboard; absent otherwise. */
|
|
112
|
+
specMissing?: true;
|
|
109
113
|
/** The sidebar's sections, in the menu's order; absent when the spec has none. */
|
|
110
114
|
categories?: MockupCategory[];
|
|
111
115
|
/** Absent when the spec adds nothing to the sidebar. */
|
|
@@ -405,6 +409,13 @@ function isModule(
|
|
|
405
409
|
);
|
|
406
410
|
}
|
|
407
411
|
|
|
412
|
+
function isOptionalList(
|
|
413
|
+
value: Parameters<typeof isObject>[0],
|
|
414
|
+
isItem: (item: Parameters<typeof isObject>[0]) => boolean,
|
|
415
|
+
): boolean {
|
|
416
|
+
return value === undefined || (Array.isArray(value) && value.every(isItem));
|
|
417
|
+
}
|
|
418
|
+
|
|
408
419
|
function isMockupState(
|
|
409
420
|
value: Parameters<typeof isObject>[0],
|
|
410
421
|
): value is MockupState {
|
|
@@ -413,18 +424,15 @@ function isMockupState(
|
|
|
413
424
|
isString(value.name) &&
|
|
414
425
|
isOptionalString(value.title) &&
|
|
415
426
|
isNumber(value.revision) &&
|
|
416
|
-
(value.
|
|
417
|
-
|
|
418
|
-
value.categories.every(isMockupCategory))) &&
|
|
427
|
+
(value.specMissing === undefined || value.specMissing === true) &&
|
|
428
|
+
isOptionalList(value.categories, isMockupCategory) &&
|
|
419
429
|
(value.sidebar === undefined || isSidebar(value.sidebar)) &&
|
|
420
|
-
(value.modules
|
|
421
|
-
(Array.isArray(value.modules) && value.modules.every(isModule))) &&
|
|
430
|
+
isOptionalList(value.modules, isModule) &&
|
|
422
431
|
Array.isArray(value.pages) &&
|
|
423
432
|
value.pages.every(isPageState) &&
|
|
424
433
|
Array.isArray(value.issues) &&
|
|
425
434
|
value.issues.every(isIssue) &&
|
|
426
|
-
(value.warnings
|
|
427
|
-
(Array.isArray(value.warnings) && value.warnings.every(isIssue)))
|
|
435
|
+
isOptionalList(value.warnings, isIssue)
|
|
428
436
|
);
|
|
429
437
|
}
|
|
430
438
|
|
|
@@ -90,6 +90,22 @@ export function storePageCapture(
|
|
|
90
90
|
if (replaced) URL.revokeObjectURL(replaced.url);
|
|
91
91
|
}
|
|
92
92
|
|
|
93
|
+
/** Releases the captures of the mockup `name` whose page is not in `pages`, and keeps the others. */
|
|
94
|
+
export function keepPageCaptures(name: string, pages: Iterable<string>): void {
|
|
95
|
+
const store = stores.get(name);
|
|
96
|
+
if (!store) return;
|
|
97
|
+
const kept = new Set(pages);
|
|
98
|
+
const gone = [...store.value].filter(([page]) => !kept.has(page));
|
|
99
|
+
if (!gone.length) return;
|
|
100
|
+
for (const [, { url }] of gone) URL.revokeObjectURL(url);
|
|
101
|
+
store.value = new Map([...store.value].filter(([page]) => kept.has(page)));
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/** Whether this tab holds the capture of a page of any mockup. */
|
|
105
|
+
export function holdsMockupCaptures(): boolean {
|
|
106
|
+
return [...stores.values()].some((store) => store.value.size > 0);
|
|
107
|
+
}
|
|
108
|
+
|
|
93
109
|
/**
|
|
94
110
|
* What the server holds of each mockup's first page as far as this browser
|
|
95
111
|
* session knows, as the page and the capture key it was sent from.
|
|
@@ -128,3 +144,11 @@ export function clearMockupCaptures(name: string): void {
|
|
|
128
144
|
for (const { url } of store.value.values()) URL.revokeObjectURL(url);
|
|
129
145
|
store.value = new Map();
|
|
130
146
|
}
|
|
147
|
+
|
|
148
|
+
/** Releases the captures and the upload claim of every mockup not in `names`, and keeps the others. */
|
|
149
|
+
export function keepMockupCaptures(names: Iterable<string>): void {
|
|
150
|
+
const kept = new Set(names);
|
|
151
|
+
for (const name of new Set([...stores.keys(), ...sent.keys()])) {
|
|
152
|
+
if (!kept.has(name)) clearMockupCaptures(name);
|
|
153
|
+
}
|
|
154
|
+
}
|
|
@@ -79,7 +79,7 @@
|
|
|
79
79
|
},
|
|
80
80
|
"devDependencies": {
|
|
81
81
|
"@antelopejs/core": "~1.25.0",
|
|
82
|
-
"@antelopejs/dms-frontend": "0.11.
|
|
82
|
+
"@antelopejs/dms-frontend": ">=0.11.17 <0.12.0",
|
|
83
83
|
"@antelopejs/tooling-configs": ">=0.10.15 <0.11.0",
|
|
84
84
|
"@inertiajs/vue3": "^3.7.0",
|
|
85
85
|
"@nuxt/eslint-config": "^1.17.0",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@antelopejs/dms",
|
|
3
|
-
"version": "0.25.
|
|
3
|
+
"version": "0.25.9-next.1170.g0f31f2d",
|
|
4
4
|
"description": "AntelopeJS DMS. Plug in your PostgreSQL, MySQL, MariaDB, MongoDB or RethinkDB database and your coding agent builds a back office and analytics dashboard as typed TypeScript. Real-time updates on the data the DMS manages.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"antelopejs",
|
|
@@ -87,6 +87,7 @@
|
|
|
87
87
|
"@antelopejs/interface-data-api": ">=0.8.2 <0.9.0",
|
|
88
88
|
"@antelopejs/interface-database": ">=0.4.5 <0.5.0",
|
|
89
89
|
"@antelopejs/interface-database-decorators": ">=0.5.4 <0.6.0",
|
|
90
|
+
"@antelopejs/interface-dms": "0.17.6-next.1170.g0f31f2d",
|
|
90
91
|
"@antelopejs/interface-email": ">=0.2.2 <0.3.0",
|
|
91
92
|
"@antelopejs/interface-file-storage": ">=0.1.10 <0.2.0",
|
|
92
93
|
"@csstools/css-tokenizer": "^4.0.3",
|
|
@@ -109,7 +110,6 @@
|
|
|
109
110
|
"ts-morph": "^28.0.0",
|
|
110
111
|
"ua-parser-js": "^2.0.9",
|
|
111
112
|
"zod": "^4.5.0",
|
|
112
|
-
"@antelopejs/interface-dms": "^0.17.5",
|
|
113
113
|
"@antelopejs/interface-dms-builder": "^0.6.5"
|
|
114
114
|
},
|
|
115
115
|
"devDependencies": {
|
|
@@ -210,7 +210,7 @@
|
|
|
210
210
|
"optional": true
|
|
211
211
|
}
|
|
212
212
|
},
|
|
213
|
-
"gitHead": "
|
|
213
|
+
"gitHead": "0f31f2dbd0da7675f2e6af59036e9ea4479d7ff8",
|
|
214
214
|
"scripts": {
|
|
215
215
|
"build": "pnpm --filter @antelopejs/interface-dms --filter @antelopejs/interface-dms-builder build && rimraf dist && antelopejs-tsc && tsc-alias && tsc -p e2e/tsconfig.types.json",
|
|
216
216
|
"dev": "ajs project run --inspect -w -p playground",
|