@antelopejs/dms 0.25.7 → 0.25.8-next.1159.gac14ce1
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/E2E.md +5 -2
- package/data/mockup-spec.schema.json +18 -22
- package/dist/e2e/index.d.mts +4 -3
- package/dist/e2e/run-state.d.mts +8 -0
- package/dist/e2e/stack.d.mts +3 -1
- package/dist/implementations/dms/page/access.js +1 -1
- package/dist/implementations/dms/page/access.js.map +1 -1
- package/dist/implementations/dms/page/payloads.js +1 -1
- package/dist/implementations/dms/page/payloads.js.map +1 -1
- package/dist/implementations/dms/page/registry.js +1 -1
- package/dist/implementations/dms/page/registry.js.map +1 -1
- package/dist/implementations/dms-base/bulk-selection.d.ts +1 -1
- package/dist/implementations/dms-base/bulk-selection.js +7 -1
- package/dist/implementations/dms-base/bulk-selection.js.map +1 -1
- package/dist/implementations/dms-base/group-order.d.ts +1 -1
- package/dist/implementations/dms-base/group-order.js +17 -4
- package/dist/implementations/dms-base/group-order.js.map +1 -1
- package/dist/implementations/dms-base/search-route.d.ts +1 -1
- package/dist/implementations/dms-base/search-route.js +11 -3
- package/dist/implementations/dms-base/search-route.js.map +1 -1
- package/dist/implementations/dms-base/table-view.js +12 -3
- package/dist/implementations/dms-base/table-view.js.map +1 -1
- package/dist/implementations/dms-builder/engine/expression.js +3 -2
- package/dist/implementations/dms-builder/engine/expression.js.map +1 -1
- package/dist/implementations/dms-builder/engine/inherited-variables.js +2 -1
- package/dist/implementations/dms-builder/engine/inherited-variables.js.map +1 -1
- package/dist/implementations/dms-builder/engine/preview.js +2 -1
- package/dist/implementations/dms-builder/engine/preview.js.map +1 -1
- package/dist/implementations/dms-builder/engine/table-view-settings.js +67 -23
- package/dist/implementations/dms-builder/engine/table-view-settings.js.map +1 -1
- package/dist/mockup/compile.js +2 -0
- package/dist/mockup/compile.js.map +1 -1
- package/dist/mockup/controller-blocks.d.ts +1 -0
- package/dist/mockup/controller-blocks.js +2 -2
- package/dist/mockup/controller-blocks.js.map +1 -1
- package/dist/mockup/fixtures.d.ts +1 -0
- package/dist/mockup/fixtures.js +11 -6
- package/dist/mockup/fixtures.js.map +1 -1
- package/dist/mockup/json-schema.js +0 -4
- package/dist/mockup/json-schema.js.map +1 -1
- package/dist/mockup/model.d.ts +0 -1
- package/dist/mockup/model.js +5 -7
- package/dist/mockup/model.js.map +1 -1
- package/dist/mockup/owner-controller.js +1 -1
- package/dist/mockup/owner-controller.js.map +1 -1
- package/dist/mockup/table-param-filters.d.ts +2 -1
- package/dist/mockup/table-param-filters.js +6 -4
- package/dist/mockup/table-param-filters.js.map +1 -1
- package/dist/pages/settings/users/account-activity.js +2 -1
- package/dist/pages/settings/users/account-activity.js.map +1 -1
- package/dist/routes/auth/oauth/config.js +1 -1
- package/dist/routes/auth/oauth/config.js.map +1 -1
- package/dist/routes/system-state.js +1 -1
- package/dist/routes/system-state.js.map +1 -1
- package/dist/store/interfaces.js +2 -1
- package/dist/store/interfaces.js.map +1 -1
- package/dist/utils/export-jobs-run.js +4 -4
- package/dist/utils/export-jobs-run.js.map +1 -1
- package/dist/utils/export-jobs.js +15 -3
- package/dist/utils/export-jobs.js.map +1 -1
- package/e2e/index.mjs +27 -6
- package/e2e/journey-run.mjs +4 -3
- package/e2e/run-state.mjs +11 -0
- package/e2e/stack.mjs +9 -1
- package/frontend-vue/layers/dms-core/app/composables/page/useSiteLayout.ts +5 -2
- package/frontend-vue/layers/dms-core/app/composables/period/usePeriod.ts +13 -19
- package/frontend-vue/layers/dms-core/app/composables/period/usePeriodScope.ts +6 -15
- package/frontend-vue/layers/dms-core/i18n/locales/core-en-GB.json +24 -3
- package/frontend-vue/layers/dms-core/i18n/locales/core-fr-FR.json +24 -3
- package/frontend-vue/layers/dms-layout/app/build/composables/notification/useNotificationGroupsOpen.ts +3 -3
- package/frontend-vue/layers/dms-layout/app/build/composables/notification/useNotificationPreferences.ts +13 -8
- package/frontend-vue/layers/dms-layout/app/composables/page/useModuleHistory.ts +3 -1
- package/frontend-vue/layers/dms-ui/app/build/components/table/tableComponentTheme.ts +4 -2
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupOverview.ts +13 -2
- package/frontend-vue/layers/dms-ui/app/build/composables/containers/drawerSize.ts +4 -1
- package/frontend-vue/layers/dms-ui/app/build/composables/data-types/defaultIdentityCells.ts +1 -1
- package/frontend-vue/layers/dms-ui/app/build/composables/data-types/relationBadges.ts +2 -1
- package/frontend-vue/layers/dms-ui/app/build/composables/form/formState.ts +3 -1
- package/frontend-vue/layers/dms-ui/app/build/composables/navigation/useNavBadges.ts +3 -1
- package/frontend-vue/layers/dms-ui/app/build/composables/page-toolbar/toolbarControlHeight.ts +1 -1
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/tableViewPresence.ts +10 -4
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/tableViewSelection.ts +5 -2
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/useExpandedRowDetails.ts +6 -6
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/utils/card.ts +4 -1
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/utils/formTexts.ts +2 -2
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/utils/views.ts +1 -1
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupEdit.ts +0 -2
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupOverview.ts +24 -8
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupSections.ts +1 -2
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupSketchStates.ts +7 -2
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupSpec.ts +0 -3
- package/frontend-vue/layers/dms-ui/app/components/chart/ChartBlock.vue +1 -2
- package/frontend-vue/layers/dms-ui/app/components/form/components/RepeaterTable.vue +3 -1
- package/frontend-vue/layers/dms-ui/app/composables/chart/useApexChart.ts +0 -2
- package/frontend-vue/layers/dms-ui/app/composables/chart/useApexChart.types.ts +0 -1
- package/frontend-vue/layers/dms-ui/app/composables/chart/useChartTheme.ts +8 -2
- package/frontend-vue/layers/dms-ui/app/composables/table-view/useTableDataChanges.ts +5 -4
- package/frontend-vue/package.json +1 -1
- package/frontend-vue/server/private-options.ts +13 -3
- package/package.json +8 -8
|
@@ -73,7 +73,9 @@ function createFormState(props: FormProps) {
|
|
|
73
73
|
value: Parameters<FieldValueComparer>[1],
|
|
74
74
|
): boolean => {
|
|
75
75
|
const field = allFields.value.find((entry) => entry.id === fieldId);
|
|
76
|
-
const initial = initialValues.value
|
|
76
|
+
const initial = Object.hasOwn(initialValues.value, fieldId)
|
|
77
|
+
? initialValues.value[fieldId]
|
|
78
|
+
: undefined;
|
|
77
79
|
return field
|
|
78
80
|
? isSameFieldValue(field, value, initial)
|
|
79
81
|
: sameFormValue(value, initial);
|
|
@@ -47,7 +47,9 @@ export const useNavBadges = () => {
|
|
|
47
47
|
label: string | undefined,
|
|
48
48
|
tone?: Tone,
|
|
49
49
|
): void {
|
|
50
|
-
const current = badges.value
|
|
50
|
+
const current = Object.hasOwn(badges.value, fullId)
|
|
51
|
+
? badges.value[fullId]
|
|
52
|
+
: undefined;
|
|
51
53
|
if (current?.label === label && current?.tone === tone) return;
|
|
52
54
|
const { [fullId]: _previous, ...rest } = badges.value;
|
|
53
55
|
if (label === undefined) {
|
package/frontend-vue/layers/dms-ui/app/build/composables/page-toolbar/toolbarControlHeight.ts
CHANGED
|
@@ -28,5 +28,5 @@ export function toolbarControlHeightClass(size: string): string {
|
|
|
28
28
|
const heights: Readonly<
|
|
29
29
|
Record<Parameters<typeof toolbarControlHeightClass>[0], string>
|
|
30
30
|
> = PAGE_TOOLBAR_CONTROL_HEIGHT_CLASSES;
|
|
31
|
-
return heights[size]
|
|
31
|
+
return Object.hasOwn(heights, size) ? heights[size] : "";
|
|
32
32
|
}
|
|
@@ -4,6 +4,12 @@ import type {
|
|
|
4
4
|
} from "./tableViewTypes";
|
|
5
5
|
import type { TableViewScope } from "./tableViewScope";
|
|
6
6
|
|
|
7
|
+
const presenceOf = (
|
|
8
|
+
map: RealtimePresenceMap,
|
|
9
|
+
rowId: string,
|
|
10
|
+
): RealtimePresenceActor[] | undefined =>
|
|
11
|
+
Object.hasOwn(map, rowId) ? map[rowId] : undefined;
|
|
12
|
+
|
|
7
13
|
export function useTableViewPresenceState<T extends Data>(
|
|
8
14
|
scope: Pick<TableViewScope<T>, "rowRealtime">,
|
|
9
15
|
) {
|
|
@@ -13,7 +19,7 @@ export function useTableViewPresenceState<T extends Data>(
|
|
|
13
19
|
};
|
|
14
20
|
|
|
15
21
|
const upsertPresence = (rowId: string, actor: RealtimePresenceActor) => {
|
|
16
|
-
const current = presenceByRow.value
|
|
22
|
+
const current = presenceOf(presenceByRow.value, rowId) ?? [];
|
|
17
23
|
if (current.some((entry) => entry.sessionId === actor.sessionId)) return;
|
|
18
24
|
replacePresenceMap({
|
|
19
25
|
...presenceByRow.value,
|
|
@@ -22,7 +28,7 @@ export function useTableViewPresenceState<T extends Data>(
|
|
|
22
28
|
};
|
|
23
29
|
|
|
24
30
|
const removePresence = (rowId: string, sessionId: string) => {
|
|
25
|
-
const current = presenceByRow.value
|
|
31
|
+
const current = presenceOf(presenceByRow.value, rowId);
|
|
26
32
|
if (!current) return;
|
|
27
33
|
const next = current.filter((entry) => entry.sessionId !== sessionId);
|
|
28
34
|
if (next.length === 0) {
|
|
@@ -43,7 +49,7 @@ export function useTableViewPresenceState<T extends Data>(
|
|
|
43
49
|
) => {
|
|
44
50
|
const next: RealtimePresenceMap = {};
|
|
45
51
|
for (const entry of entries) {
|
|
46
|
-
const list = next
|
|
52
|
+
const list = presenceOf(next, entry.rowId) ?? [];
|
|
47
53
|
list.push({
|
|
48
54
|
...entry.actor,
|
|
49
55
|
sessionId: entry.sessionId,
|
|
@@ -105,7 +111,7 @@ export function useTableViewPresenceEvents<T extends Data>(
|
|
|
105
111
|
};
|
|
106
112
|
|
|
107
113
|
const otherEditorsForRow = (rowId: string): RealtimePresenceActor[] => {
|
|
108
|
-
return filterSelf(presenceByRow.value
|
|
114
|
+
return filterSelf(presenceOf(presenceByRow.value, rowId) ?? []);
|
|
109
115
|
};
|
|
110
116
|
|
|
111
117
|
const presenceByRowFiltered = computed<RealtimePresenceMap>(() => {
|
|
@@ -82,10 +82,13 @@ export function useTableViewDisplaySelection<T extends Data>(
|
|
|
82
82
|
return evaluateRowActionRule(normalized.rule, item);
|
|
83
83
|
};
|
|
84
84
|
|
|
85
|
+
const isPicked = (id: string): boolean =>
|
|
86
|
+
Object.hasOwn(rowSelect.value, id) && !!rowSelect.value[id];
|
|
87
|
+
|
|
85
88
|
const displaySelection = {
|
|
86
|
-
isSelected:
|
|
89
|
+
isSelected: isPicked,
|
|
87
90
|
toggle: (id: string, value?: boolean) => {
|
|
88
|
-
if (value ?? !
|
|
91
|
+
if (value ?? !isPicked(id)) {
|
|
89
92
|
rowSelect.value = { ...rowSelect.value, [id]: true };
|
|
90
93
|
return;
|
|
91
94
|
}
|
package/frontend-vue/layers/dms-ui/app/build/composables/table-view/useExpandedRowDetails.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { shallowRef } from "vue";
|
|
2
2
|
import { detach } from "../detach";
|
|
3
3
|
|
|
4
4
|
/** Where the row a `lazyLoad` band shows stands. */
|
|
@@ -18,12 +18,12 @@ export interface ExpandedRowDetailEntry<T> {
|
|
|
18
18
|
export function useExpandedRowDetails<T>(
|
|
19
19
|
getRow: (id: string) => Promise<T | undefined>,
|
|
20
20
|
) {
|
|
21
|
-
const entries =
|
|
21
|
+
const entries = shallowRef(new Map<string, ExpandedRowDetailEntry<T>>());
|
|
22
22
|
const errorPresenter = useApiErrorPresenter();
|
|
23
23
|
let generation = 0;
|
|
24
24
|
|
|
25
25
|
const setEntry = (id: string, entry: ExpandedRowDetailEntry<T>) => {
|
|
26
|
-
entries.value =
|
|
26
|
+
entries.value = new Map(entries.value).set(id, entry);
|
|
27
27
|
};
|
|
28
28
|
|
|
29
29
|
async function load(id: string): Promise<void> {
|
|
@@ -45,17 +45,17 @@ export function useExpandedRowDetails<T>(
|
|
|
45
45
|
|
|
46
46
|
function ensure(ids: string[]): void {
|
|
47
47
|
for (const id of ids) {
|
|
48
|
-
if (!entries.value
|
|
48
|
+
if (!entries.value.has(id)) detach(load(id));
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
51
|
|
|
52
52
|
function reset(): void {
|
|
53
53
|
generation += 1;
|
|
54
|
-
entries.value =
|
|
54
|
+
entries.value = new Map();
|
|
55
55
|
}
|
|
56
56
|
|
|
57
57
|
const entryOf = (id: string): ExpandedRowDetailEntry<T> | undefined =>
|
|
58
|
-
entries.value
|
|
58
|
+
entries.value.get(id);
|
|
59
59
|
|
|
60
60
|
return { entryOf, ensure, load, reset };
|
|
61
61
|
}
|
|
@@ -103,7 +103,10 @@ export interface CardIdentity {
|
|
|
103
103
|
const optionString = (
|
|
104
104
|
options: NonNullable<TableViewColumn["display"]>["options"],
|
|
105
105
|
key: string,
|
|
106
|
-
): string | undefined =>
|
|
106
|
+
): string | undefined =>
|
|
107
|
+
options && Object.hasOwn(options, key) && isString(options[key])
|
|
108
|
+
? options[key]
|
|
109
|
+
: undefined;
|
|
107
110
|
|
|
108
111
|
/** The identity the title column (`labelKey`) declares, if it is one. */
|
|
109
112
|
export function cardIdentity(
|
|
@@ -116,8 +116,8 @@ export function formatRecordLabel(
|
|
|
116
116
|
}
|
|
117
117
|
const language = locale?.split("-")[0];
|
|
118
118
|
const candidates = [
|
|
119
|
-
locale ? value[locale] : undefined,
|
|
120
|
-
language ? value[language] : undefined,
|
|
119
|
+
locale && Object.hasOwn(value, locale) ? value[locale] : undefined,
|
|
120
|
+
language && Object.hasOwn(value, language) ? value[language] : undefined,
|
|
121
121
|
...Object.values(value),
|
|
122
122
|
];
|
|
123
123
|
for (const candidate of candidates) {
|
|
@@ -285,7 +285,7 @@ export function readTableUrlKey(
|
|
|
285
285
|
): UrlKeyReading {
|
|
286
286
|
const prefixed = scope.tableId ? query[`${scope.tableId}.${key}`] : undefined;
|
|
287
287
|
if (isString(prefixed)) return readUrlValue(prefixed);
|
|
288
|
-
const short = query[key];
|
|
288
|
+
const short = Object.hasOwn(query, key) ? query[key] : undefined;
|
|
289
289
|
if (!isString(short)) return {};
|
|
290
290
|
if (scope.isSoleTableView) return readUrlValue(short);
|
|
291
291
|
return short ? { ignoredShortKey: true } : {};
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import {
|
|
2
|
-
MOCKUP_MAX_PAGES,
|
|
3
2
|
MOCKUP_PAGE_ID_PATTERN,
|
|
4
3
|
authoredId,
|
|
5
4
|
freeId,
|
|
@@ -386,7 +385,6 @@ function setTitle(spec: MockupSpecDocument, title: string): MockupEditResult {
|
|
|
386
385
|
}
|
|
387
386
|
|
|
388
387
|
function addPage(spec: MockupSpecDocument, title: string): MockupEditResult {
|
|
389
|
-
if (spec.pages.length >= MOCKUP_MAX_PAGES) return { spec };
|
|
390
388
|
const page: MockupSpecPage = { id: pageIdFor(spec, title), title, tree: [] };
|
|
391
389
|
return { spec: { ...spec, pages: [...spec.pages, page] }, page: page.id };
|
|
392
390
|
}
|
|
@@ -17,7 +17,11 @@ const COLUMN_GAP = 160;
|
|
|
17
17
|
/** The space between two rows, which holds the titles of the row below. */
|
|
18
18
|
const ROW_GAP = 400;
|
|
19
19
|
|
|
20
|
-
/**
|
|
20
|
+
/**
|
|
21
|
+
* How far the overview zooms out and in: 100% draws a page at its real size.
|
|
22
|
+
* A mockup too large to fit at `min` zooms out as far as it fits, see
|
|
23
|
+
* {@link zoomFloor}.
|
|
24
|
+
*/
|
|
21
25
|
export const OVERVIEW_ZOOM = { min: 0.02, max: 2 } as const;
|
|
22
26
|
|
|
23
27
|
/** How many screen pixels of wheel turn the zoom by a factor of e. */
|
|
@@ -176,8 +180,20 @@ export function framesBounds(
|
|
|
176
180
|
return { x: left, y: top, width: right - left, height: bottom - top };
|
|
177
181
|
}
|
|
178
182
|
|
|
179
|
-
|
|
180
|
-
|
|
183
|
+
/** `zoom` within `floor` and {@link OVERVIEW_ZOOM}'s `max`. */
|
|
184
|
+
export function clampZoom(
|
|
185
|
+
zoom: number,
|
|
186
|
+
floor: number = OVERVIEW_ZOOM.min,
|
|
187
|
+
): number {
|
|
188
|
+
return Math.min(OVERVIEW_ZOOM.max, Math.max(floor, zoom));
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
/**
|
|
192
|
+
* The least zoom of an overview that `fit` shows whole: {@link OVERVIEW_ZOOM}'s
|
|
193
|
+
* `min`, or the fitted zoom when the pages fit only below it.
|
|
194
|
+
*/
|
|
195
|
+
export function zoomFloor(fit: OverviewCamera | undefined): number {
|
|
196
|
+
return Math.min(OVERVIEW_ZOOM.min, fit?.zoom ?? OVERVIEW_ZOOM.min);
|
|
181
197
|
}
|
|
182
198
|
|
|
183
199
|
/** The world point drawn at a viewport point. */
|
|
@@ -193,8 +209,9 @@ export function zoomAt(
|
|
|
193
209
|
camera: OverviewCamera,
|
|
194
210
|
zoom: number,
|
|
195
211
|
at: ViewportPoint,
|
|
212
|
+
floor: number = OVERVIEW_ZOOM.min,
|
|
196
213
|
): OverviewCamera {
|
|
197
|
-
const next = clampZoom(zoom);
|
|
214
|
+
const next = clampZoom(zoom, floor);
|
|
198
215
|
const world = toWorld(camera, at);
|
|
199
216
|
return { x: at.x - world.x * next, y: at.y - world.y * next, zoom: next };
|
|
200
217
|
}
|
|
@@ -229,7 +246,8 @@ export function wheelZoomFactor(pixels: number): number {
|
|
|
229
246
|
/**
|
|
230
247
|
* The camera that shows the whole of `bounds` inside the viewport, `padding`
|
|
231
248
|
* pixels off each edge, centred, never past 100%, so a single small page is
|
|
232
|
-
* drawn at its real size.
|
|
249
|
+
* drawn at its real size. It goes below {@link OVERVIEW_ZOOM}'s `min` when
|
|
250
|
+
* the pages fit only there.
|
|
233
251
|
*/
|
|
234
252
|
export function fitCamera(
|
|
235
253
|
bounds: PreviewRect,
|
|
@@ -238,9 +256,7 @@ export function fitCamera(
|
|
|
238
256
|
): OverviewCamera {
|
|
239
257
|
const width = Math.max(1, viewport.width - padding * 2);
|
|
240
258
|
const height = Math.max(1, viewport.height - padding * 2);
|
|
241
|
-
const zoom =
|
|
242
|
-
Math.min(width / bounds.width, height / bounds.height, 1),
|
|
243
|
-
);
|
|
259
|
+
const zoom = Math.min(width / bounds.width, height / bounds.height, 1);
|
|
244
260
|
return {
|
|
245
261
|
x: viewport.width / 2 - (bounds.x + bounds.width / 2) * zoom,
|
|
246
262
|
y: viewport.height / 2 - (bounds.y + bounds.height / 2) * zoom,
|
|
@@ -2,7 +2,6 @@ import { isString } from "../../../../dms-core/app/utils/type-check";
|
|
|
2
2
|
import type { JsonObject } from "./json";
|
|
3
3
|
import { isMockupCategory, type MockupCategory } from "./mockup";
|
|
4
4
|
import {
|
|
5
|
-
MOCKUP_MAX_PAGES,
|
|
6
5
|
freeId,
|
|
7
6
|
slugify,
|
|
8
7
|
type MockupSpecDocument,
|
|
@@ -147,7 +146,7 @@ function addCategory(
|
|
|
147
146
|
): MockupSpecDocument {
|
|
148
147
|
const categories = specCategories(spec);
|
|
149
148
|
const name = title.trim();
|
|
150
|
-
if (!name
|
|
149
|
+
if (!name) return spec;
|
|
151
150
|
const taken = new Set(categories.map((category) => category.id));
|
|
152
151
|
const id = freeId(taken, slugify(name) || CATEGORY_ID_FALLBACK);
|
|
153
152
|
return withCategories(spec, [...categories, { id, title: name }]);
|
|
@@ -30,7 +30,9 @@ function sketchKey(
|
|
|
30
30
|
): string | undefined {
|
|
31
31
|
return page.custom && layoutPath === CUSTOM_PAGE_PATH
|
|
32
32
|
? CUSTOM_PAGE_SKETCH
|
|
33
|
-
: page.paths
|
|
33
|
+
: Object.hasOwn(page.paths, layoutPath)
|
|
34
|
+
? page.paths[layoutPath]
|
|
35
|
+
: undefined;
|
|
34
36
|
}
|
|
35
37
|
|
|
36
38
|
/** The names of the states a sketch's `states` option holds, in its order; none when it holds none. */
|
|
@@ -53,7 +55,10 @@ function drawnIn(
|
|
|
53
55
|
return node;
|
|
54
56
|
}
|
|
55
57
|
const states = options.states;
|
|
56
|
-
const markup =
|
|
58
|
+
const markup =
|
|
59
|
+
isWritableObject(states) && Object.hasOwn(states, state)
|
|
60
|
+
? states[state]
|
|
61
|
+
: undefined;
|
|
57
62
|
return isString(markup)
|
|
58
63
|
? { ...node, options: { ...options, html: markup } }
|
|
59
64
|
: node;
|
|
@@ -58,9 +58,6 @@ export const MOCKUP_SKETCH_TYPE = "sketch";
|
|
|
58
58
|
/** A page id: the URL slug the spec allows. */
|
|
59
59
|
export const MOCKUP_PAGE_ID_PATTERN = /^[a-z0-9][a-z0-9-]{0,63}$/;
|
|
60
60
|
|
|
61
|
-
/** How many pages a spec holds at most. */
|
|
62
|
-
export const MOCKUP_MAX_PAGES = 50;
|
|
63
|
-
|
|
64
61
|
/** Leaves room for a `-<n>` suffix under the 64 characters an id has. */
|
|
65
62
|
const ID_MAX_BASE = 60;
|
|
66
63
|
const ID_SUFFIX = /-\d+$/;
|
|
@@ -131,7 +131,7 @@ const { state: watchState } = useWatch(
|
|
|
131
131
|
);
|
|
132
132
|
|
|
133
133
|
const watchKey = computed(() => JSON.stringify(watchState.value));
|
|
134
|
-
|
|
134
|
+
useThemeRevision();
|
|
135
135
|
|
|
136
136
|
const isCircular = computed(() => CIRCULAR_CHART_TYPES.includes(props.type));
|
|
137
137
|
|
|
@@ -290,7 +290,6 @@ const apex = useApexChart(() => ({
|
|
|
290
290
|
donutData: finalDonutData.value,
|
|
291
291
|
colors: props.color,
|
|
292
292
|
rawOptions: props.rawOptions,
|
|
293
|
-
themeRevision: themeRevision.value,
|
|
294
293
|
yRange: props.yRange,
|
|
295
294
|
strokeWidth: props.strokeWidth,
|
|
296
295
|
fillOpacity: props.fillOpacity,
|
|
@@ -47,7 +47,9 @@ const instanceId = useId();
|
|
|
47
47
|
function useColumnRelationRows(columnId: string, source: RelationLabelSource) {
|
|
48
48
|
const ids = computed(() =>
|
|
49
49
|
unlabeledRelationIds(
|
|
50
|
-
props.rows.flatMap((row) =>
|
|
50
|
+
props.rows.flatMap((row) =>
|
|
51
|
+
[Object.hasOwn(row, columnId) ? row[columnId] : undefined].flat(),
|
|
52
|
+
),
|
|
51
53
|
NO_LABELS,
|
|
52
54
|
),
|
|
53
55
|
);
|
|
@@ -274,7 +274,6 @@ function projectSeries(
|
|
|
274
274
|
buckets: DatetimeBuckets | null,
|
|
275
275
|
): ChartSeries[] {
|
|
276
276
|
if (isCircular) return [];
|
|
277
|
-
void input.themeRevision;
|
|
278
277
|
const mixed =
|
|
279
278
|
input.type === "mixed"
|
|
280
279
|
? applyMixedSeriesDefs(input.series, input.seriesDefs)
|
|
@@ -399,7 +398,6 @@ function buildChartOptions(
|
|
|
399
398
|
finalSeries: ChartSeries[],
|
|
400
399
|
buckets: DatetimeBuckets | null,
|
|
401
400
|
): RawOptionSection {
|
|
402
|
-
void value.themeRevision;
|
|
403
401
|
const ctx = buildChartOptionsContext(value, cfg, finalSeries);
|
|
404
402
|
|
|
405
403
|
const baseOptions = buildBaseOptions(
|
|
@@ -52,7 +52,6 @@ export interface UseApexChartInput {
|
|
|
52
52
|
donutData?: DonutRecord[];
|
|
53
53
|
colors?: string[] | string;
|
|
54
54
|
rawOptions?: Array<{ key: string; value: string }>;
|
|
55
|
-
themeRevision?: number;
|
|
56
55
|
yRange?: { min: number; max: number };
|
|
57
56
|
strokeWidth?: number;
|
|
58
57
|
fillOpacity?: number;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ref } from "vue";
|
|
1
2
|
import { isString } from "../../../../dms-core/app/utils/type-check";
|
|
2
3
|
import type { ChartSeries } from "./types";
|
|
3
4
|
const DEFAULT_COLOR_NAME = "primary";
|
|
@@ -61,10 +62,15 @@ function toCommaSeparatedRgb(color: string): string {
|
|
|
61
62
|
}
|
|
62
63
|
|
|
63
64
|
const colorProbeCache = new Map<string, string>();
|
|
65
|
+
const colorCacheGeneration = ref(0);
|
|
64
66
|
|
|
65
|
-
/**
|
|
67
|
+
/**
|
|
68
|
+
* Invalidate resolved colors for a theme change. A computed that resolved a
|
|
69
|
+
* color reads the generation in its cache key, so it recomputes.
|
|
70
|
+
*/
|
|
66
71
|
export function clearChartColorCache(): void {
|
|
67
72
|
colorProbeCache.clear();
|
|
73
|
+
colorCacheGeneration.value += 1;
|
|
68
74
|
}
|
|
69
75
|
|
|
70
76
|
function toApexColor(color: string, fallback: string): string {
|
|
@@ -96,7 +102,7 @@ function themeCacheScope(): string {
|
|
|
96
102
|
|
|
97
103
|
function probeCssColor(varName: string, fallback: string): string {
|
|
98
104
|
if (typeof document === "undefined" || !document.body) return fallback;
|
|
99
|
-
const cacheKey = `${themeCacheScope()}:${varName}:${fallback}`;
|
|
105
|
+
const cacheKey = `${colorCacheGeneration.value}:${themeCacheScope()}:${varName}:${fallback}`;
|
|
100
106
|
const cached = colorProbeCache.get(cacheKey);
|
|
101
107
|
if (cached) return cached;
|
|
102
108
|
const probe = document.createElement("div");
|
|
@@ -18,18 +18,19 @@ export const useTableDataChanges = () => {
|
|
|
18
18
|
() => ({}),
|
|
19
19
|
);
|
|
20
20
|
|
|
21
|
+
const versionOf = (location: string): number =>
|
|
22
|
+
Object.hasOwn(versions.value, location) ? versions.value[location] : 0;
|
|
23
|
+
|
|
21
24
|
function notifyTableDataChanged(location: string | undefined): void {
|
|
22
25
|
if (!location) return;
|
|
23
26
|
versions.value = {
|
|
24
27
|
...versions.value,
|
|
25
|
-
[location]: (
|
|
28
|
+
[location]: versionOf(location) + 1,
|
|
26
29
|
};
|
|
27
30
|
}
|
|
28
31
|
|
|
29
32
|
function tableDataVersion(locations: readonly string[]): ComputedRef<string> {
|
|
30
|
-
return computed(() =>
|
|
31
|
-
locations.map((location) => versions.value[location] ?? 0).join(":"),
|
|
32
|
-
);
|
|
33
|
+
return computed(() => locations.map(versionOf).join(":"));
|
|
33
34
|
}
|
|
34
35
|
|
|
35
36
|
return { notifyTableDataChanged, tableDataVersion };
|
|
@@ -19,10 +19,20 @@ export function privateSecret(
|
|
|
19
19
|
key: string,
|
|
20
20
|
variable: string,
|
|
21
21
|
): string | undefined {
|
|
22
|
-
const
|
|
22
|
+
const { privateOptions } = event.module;
|
|
23
|
+
const options = Object.hasOwn(privateOptions, section)
|
|
24
|
+
? privateOptions[section]
|
|
25
|
+
: undefined;
|
|
26
|
+
const table = z.record(z.string(), z.unknown()).safeParse(options);
|
|
23
27
|
const secret = z
|
|
24
28
|
.string()
|
|
25
|
-
.safeParse(
|
|
29
|
+
.safeParse(
|
|
30
|
+
table.success && Object.hasOwn(table.data, key)
|
|
31
|
+
? table.data[key]
|
|
32
|
+
: undefined,
|
|
33
|
+
);
|
|
26
34
|
if (secret.success && secret.data) return secret.data;
|
|
27
|
-
return
|
|
35
|
+
return (
|
|
36
|
+
(Object.hasOwn(process.env, variable) && process.env[variable]) || undefined
|
|
37
|
+
);
|
|
28
38
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@antelopejs/dms",
|
|
3
|
-
"version": "0.25.
|
|
3
|
+
"version": "0.25.8-next.1159.gac14ce1",
|
|
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",
|
|
@@ -88,6 +88,8 @@
|
|
|
88
88
|
"@antelopejs/interface-data-api": ">=0.8.2 <0.9.0",
|
|
89
89
|
"@antelopejs/interface-database": ">=0.4.5 <0.5.0",
|
|
90
90
|
"@antelopejs/interface-database-decorators": ">=0.5.4 <0.6.0",
|
|
91
|
+
"@antelopejs/interface-dms": "0.17.5-next.1173.g098f3ca",
|
|
92
|
+
"@antelopejs/interface-dms-builder": "0.6.5-next.1159.gac14ce1",
|
|
91
93
|
"@antelopejs/interface-email": ">=0.2.2 <0.3.0",
|
|
92
94
|
"@antelopejs/interface-file-storage": ">=0.1.10 <0.2.0",
|
|
93
95
|
"@csstools/css-tokenizer": "^4.0.3",
|
|
@@ -109,9 +111,7 @@
|
|
|
109
111
|
"striptags": "^3.2.0",
|
|
110
112
|
"ts-morph": "^28.0.0",
|
|
111
113
|
"ua-parser-js": "^2.0.9",
|
|
112
|
-
"zod": "^4.5.0"
|
|
113
|
-
"@antelopejs/interface-dms": "^0.17.4",
|
|
114
|
-
"@antelopejs/interface-dms-builder": "^0.6.4"
|
|
114
|
+
"zod": "^4.5.0"
|
|
115
115
|
},
|
|
116
116
|
"devDependencies": {
|
|
117
117
|
"@antelopejs/api": "~1.7.9",
|
|
@@ -132,7 +132,7 @@
|
|
|
132
132
|
"@types/semver": "^7.7.1",
|
|
133
133
|
"ajv": "^8.17.1",
|
|
134
134
|
"axios": "^1.7.9",
|
|
135
|
-
"chai": "^
|
|
135
|
+
"chai": "^6.0.0",
|
|
136
136
|
"fast-check": "^4.10.2",
|
|
137
137
|
"ioredis": "^5.10.1",
|
|
138
138
|
"knip": "^6.34.0",
|
|
@@ -144,9 +144,9 @@
|
|
|
144
144
|
"oxlint": "1.95.0",
|
|
145
145
|
"oxlint-tsgolint": "^7.0.2001",
|
|
146
146
|
"pg": "^8.22.0",
|
|
147
|
-
"release-it": "^
|
|
147
|
+
"release-it": "^21.0.0",
|
|
148
148
|
"release-it-changelogen": "^0.1.0",
|
|
149
|
-
"rethinkdb-ts": "^
|
|
149
|
+
"rethinkdb-ts": "^3.0.0",
|
|
150
150
|
"rimraf": "^6.1.3",
|
|
151
151
|
"tsc-alias": "^1.9.1",
|
|
152
152
|
"typescript": "^6.0.3",
|
|
@@ -211,7 +211,7 @@
|
|
|
211
211
|
"optional": true
|
|
212
212
|
}
|
|
213
213
|
},
|
|
214
|
-
"gitHead": "
|
|
214
|
+
"gitHead": "ac14ce171e3e1773b484a29e07cfceced71fa705",
|
|
215
215
|
"scripts": {
|
|
216
216
|
"build": "pnpm --filter @antelopejs/interface-dms --filter @antelopejs/interface-dms-builder build && rimraf dist && antelopejs-tsc && tsc-alias && tsc -p e2e/tsconfig.types.json",
|
|
217
217
|
"dev": "ajs project run --inspect -w -p playground",
|