@antelopejs/interface-dms 0.4.2 → 0.5.1
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 +58 -0
- package/dist/auth/db/tables/users.table.d.ts +7 -0
- package/dist/auth/db/tables/users.table.js +4 -0
- package/dist/auth/db/tables/users.table.js.map +1 -1
- package/dist/base/activity-feed.d.ts +53 -31
- package/dist/base/activity-feed.js +15 -6
- package/dist/base/activity-feed.js.map +1 -1
- package/dist/base/banner.d.ts +61 -4
- package/dist/base/banner.js +13 -2
- package/dist/base/banner.js.map +1 -1
- package/dist/base/block-types.d.ts +1 -0
- package/dist/base/block-types.js +1 -0
- package/dist/base/block-types.js.map +1 -1
- package/dist/base/chart-card.d.ts +1 -1
- package/dist/base/chart-schemas.d.ts +52 -52
- package/dist/base/chart-schemas.js +2 -6
- package/dist/base/chart-schemas.js.map +1 -1
- package/dist/base/chart.js +2 -20
- package/dist/base/chart.js.map +1 -1
- package/dist/base/code-block.d.ts +89 -0
- package/dist/base/code-block.js +93 -0
- package/dist/base/code-block.js.map +1 -0
- package/dist/base/display.d.ts +27 -4
- package/dist/base/display.js +28 -6
- package/dist/base/display.js.map +1 -1
- package/dist/base/empty-state.d.ts +35 -0
- package/dist/base/empty-state.js +10 -0
- package/dist/base/empty-state.js.map +1 -1
- package/dist/base/index.d.ts +1 -0
- package/dist/base/index.js +1 -0
- package/dist/base/index.js.map +1 -1
- package/dist/base/internal/composed-text.d.ts +8 -1
- package/dist/base/internal/composed-text.js +9 -1
- package/dist/base/internal/composed-text.js.map +1 -1
- package/dist/base/internal/realtime-topics.d.ts +15 -0
- package/dist/base/internal/realtime-topics.js +36 -0
- package/dist/base/internal/realtime-topics.js.map +1 -0
- package/dist/base/key-value-list.d.ts +23 -0
- package/dist/base/key-value-list.js +8 -2
- package/dist/base/key-value-list.js.map +1 -1
- package/dist/base/meter.d.ts +38 -17
- package/dist/base/meter.js +15 -6
- package/dist/base/meter.js.map +1 -1
- package/dist/base/nav-card-grid.d.ts +44 -32
- package/dist/base/nav-card-grid.js +11 -7
- package/dist/base/nav-card-grid.js.map +1 -1
- package/dist/base/stat-group.d.ts +6 -0
- package/dist/base/stat-group.js +3 -2
- package/dist/base/stat-group.js.map +1 -1
- package/dist/base/tab.d.ts +8 -0
- package/dist/base/tab.js +5 -2
- package/dist/base/tab.js.map +1 -1
- package/dist/base/table-view/column-display.d.ts +43 -3
- package/dist/base/table-view/column-display.js +3 -2
- package/dist/base/table-view/column-display.js.map +1 -1
- package/dist/base/table-view/factory.js +2 -0
- package/dist/base/table-view/factory.js.map +1 -1
- package/dist/base/table-view/internal/factory-helpers.js +8 -0
- package/dist/base/table-view/internal/factory-helpers.js.map +1 -1
- package/dist/base/table-view/internal/nav-badges.js +7 -2
- package/dist/base/table-view/internal/nav-badges.js.map +1 -1
- package/dist/base/table-view/internal/realtime.d.ts +7 -0
- package/dist/base/table-view/internal/realtime.js +14 -0
- package/dist/base/table-view/internal/realtime.js.map +1 -1
- package/dist/base/table-view/options.d.ts +20 -4
- package/dist/base/table-view/options.js.map +1 -1
- package/dist/base/table-view/schema.d.ts +22 -5
- package/dist/base/table-view/schema.js +11 -4
- package/dist/base/table-view/schema.js.map +1 -1
- package/dist/base/table-view/source.d.ts +10 -2
- package/dist/base/table-view/source.js +9 -1
- package/dist/base/table-view/source.js.map +1 -1
- package/dist/base/top-list-card.d.ts +21 -14
- package/dist/base/top-list-card.js +3 -2
- package/dist/base/top-list-card.js.map +1 -1
- package/dist/base/types/action-target.d.ts +14 -0
- package/dist/component.d.ts +35 -4
- package/dist/component.js +20 -7
- package/dist/component.js.map +1 -1
- package/dist/data-controllers/roles.js +10 -0
- package/dist/data-controllers/roles.js.map +1 -1
- package/dist/db/internal/inviteResolutions.model.d.ts +5 -0
- package/dist/db/internal/inviteResolutions.model.js +13 -0
- package/dist/db/internal/inviteResolutions.model.js.map +1 -1
- package/dist/db/tables/inviteResolutions.table.d.ts +5 -0
- package/dist/db/tables/inviteResolutions.table.js +5 -0
- package/dist/db/tables/inviteResolutions.table.js.map +1 -1
- package/dist/db/tables/user_invites.table.d.ts +0 -1
- package/dist/db/tables/user_invites.table.js +0 -4
- package/dist/db/tables/user_invites.table.js.map +1 -1
- package/dist/internal/permission-ids.d.ts +16 -0
- package/dist/internal/permission-ids.js +31 -0
- package/dist/internal/permission-ids.js.map +1 -0
- package/dist/internal/permission-requirements.d.ts +15 -0
- package/dist/internal/permission-requirements.js +38 -0
- package/dist/internal/permission-requirements.js.map +1 -0
- package/dist/invite-resolution.js +0 -1
- package/dist/invite-resolution.js.map +1 -1
- package/dist/invites.d.ts +0 -2
- package/dist/invites.js +1 -3
- package/dist/invites.js.map +1 -1
- package/dist/page/internal/categories.js +2 -1
- package/dist/page/internal/categories.js.map +1 -1
- package/dist/page/internal/member-access.d.ts +14 -0
- package/dist/page/internal/member-access.js +22 -0
- package/dist/page/internal/member-access.js.map +1 -0
- package/dist/page/internal/nav-badges.d.ts +41 -6
- package/dist/page/internal/nav-badges.js +66 -17
- package/dist/page/internal/nav-badges.js.map +1 -1
- package/dist/page/layout-filter.js +10 -3
- package/dist/page/layout-filter.js.map +1 -1
- package/dist/page/metadata.d.ts +9 -0
- package/dist/page/metadata.js +35 -4
- package/dist/page/metadata.js.map +1 -1
- package/dist/page/roots.d.ts +7 -0
- package/dist/page/roots.js +8 -0
- package/dist/page/roots.js.map +1 -1
- package/dist/page/types.d.ts +19 -3
- package/dist/permissions.d.ts +11 -0
- package/dist/permissions.js +50 -10
- package/dist/permissions.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,63 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## v0.5.1
|
|
4
|
+
|
|
5
|
+
[compare changes](https://github.com/AntelopeJS/dms/compare/interface-v0.5.0...v0.5.1)
|
|
6
|
+
|
|
7
|
+
### 🚀 Enhancements
|
|
8
|
+
|
|
9
|
+
- **table-view:** Resolve route tokens in TableView.fromSource fetchUrl ([#178](https://github.com/AntelopeJS/dms/pull/178))
|
|
10
|
+
- **blocks:** Accept composed texts in ActivityFeed, Meter, TopListCard and NavCardGrid ([#179](https://github.com/AntelopeJS/dms/pull/179))
|
|
11
|
+
- **key-value-list:** Add a copy button to key / value rows ([#180](https://github.com/AntelopeJS/dms/pull/180))
|
|
12
|
+
- **blocks:** Add a read-only CodeBlock block ([#182](https://github.com/AntelopeJS/dms/pull/182))
|
|
13
|
+
- **dms-ui:** Open a drawer action target from a chosen edge ([#188](https://github.com/AntelopeJS/dms/pull/188))
|
|
14
|
+
- **table-view:** Tone status pills and pills per row ([#181](https://github.com/AntelopeJS/dms/pull/181))
|
|
15
|
+
- **blocks:** Follow a period scope and realtime topics on list blocks, Meter and Tab badges ([#184](https://github.com/AntelopeJS/dms/pull/184))
|
|
16
|
+
- **banner:** Read a banner's content from a route ([#186](https://github.com/AntelopeJS/dms/pull/186))
|
|
17
|
+
- **table-view:** Reload rows on page refresh and on realtimeTopic events ([#185](https://github.com/AntelopeJS/dms/pull/185))
|
|
18
|
+
|
|
19
|
+
### 🩹 Fixes
|
|
20
|
+
|
|
21
|
+
- **ui:** Lay out DmsMasterDetail from its own width ([#183](https://github.com/AntelopeJS/dms/pull/183))
|
|
22
|
+
- **tenancy:** Register each tenant as an instance of the dms-tenant schema ([#190](https://github.com/AntelopeJS/dms/pull/190))
|
|
23
|
+
- **ui:** Table search label, mono cell ellipsis, flow canvas delete badge and late empty-state slots ([#187](https://github.com/AntelopeJS/dms/pull/187))
|
|
24
|
+
- **table-view:** Treat URL query filters as filters and reset the page when they change ([#189](https://github.com/AntelopeJS/dms/pull/189))
|
|
25
|
+
|
|
26
|
+
### 🏡 Chore
|
|
27
|
+
|
|
28
|
+
- **release:** @antelopejs/dms v0.7.1 ([23cf94c](https://github.com/AntelopeJS/dms/commit/23cf94c))
|
|
29
|
+
|
|
30
|
+
### ❤️ Contributors
|
|
31
|
+
|
|
32
|
+
- Antony Rizzitelli <rizzitelli.antony@pm.me>
|
|
33
|
+
|
|
34
|
+
## v0.5.0
|
|
35
|
+
|
|
36
|
+
[compare changes](https://github.com/AntelopeJS/dms/compare/interface-v0.4.2...v0.5.0)
|
|
37
|
+
|
|
38
|
+
### 🚀 Enhancements
|
|
39
|
+
|
|
40
|
+
- **layout:** Dock module side panels next to the page ([#168](https://github.com/AntelopeJS/dms/pull/168))
|
|
41
|
+
- **command-palette:** Add an assistant mode a frontend module can provide ([#169](https://github.com/AntelopeJS/dms/pull/169))
|
|
42
|
+
|
|
43
|
+
### 🩹 Fixes
|
|
44
|
+
|
|
45
|
+
- **dms:** ⚠️ Harden auth and account flows, require permission ancestors, open settings to members ([#172](https://github.com/AntelopeJS/dms/pull/172))
|
|
46
|
+
|
|
47
|
+
### 🏡 Chore
|
|
48
|
+
|
|
49
|
+
- **release:** @antelopejs/dms v0.6.2 ([c2f3269](https://github.com/AntelopeJS/dms/commit/c2f3269))
|
|
50
|
+
- **release:** @antelopejs/dms v0.7.0 ([f8cc120](https://github.com/AntelopeJS/dms/commit/f8cc120))
|
|
51
|
+
|
|
52
|
+
#### ⚠️ Breaking Changes
|
|
53
|
+
|
|
54
|
+
- **dms:** ⚠️ Harden auth and account flows, require permission ancestors, open settings to members ([#172](https://github.com/AntelopeJS/dms/pull/172))
|
|
55
|
+
|
|
56
|
+
### ❤️ Contributors
|
|
57
|
+
|
|
58
|
+
- Antony Rizzitelli <rizzitelli.antony@pm.me>
|
|
59
|
+
- Maxime Westhoven ([@mwesto](http://github.com/mwesto))
|
|
60
|
+
|
|
3
61
|
## v0.4.2
|
|
4
62
|
|
|
5
63
|
[compare changes](https://github.com/AntelopeJS/dms/compare/interface-v0.4.1...v0.4.2)
|
|
@@ -76,6 +76,12 @@ export declare class User extends User_base {
|
|
|
76
76
|
twoFactorMethods: string[];
|
|
77
77
|
twoFactorSecret: string | null;
|
|
78
78
|
twoFactorPendingSecret: string | null;
|
|
79
|
+
/**
|
|
80
|
+
* Time step (30-second window) of the last authenticator code accepted: a
|
|
81
|
+
* code from that step or an earlier one is refused, so each code works
|
|
82
|
+
* once. Unset until a code is accepted.
|
|
83
|
+
*/
|
|
84
|
+
twoFactorTotpLastStep?: number | null;
|
|
79
85
|
twoFactorBackupCodes: string[];
|
|
80
86
|
/** When the current set of backup codes was generated. */
|
|
81
87
|
twoFactorBackupCodesGeneratedAt: Date | null;
|
|
@@ -84,6 +90,7 @@ export declare class User extends User_base {
|
|
|
84
90
|
* copied or acknowledged); null until then.
|
|
85
91
|
*/
|
|
86
92
|
twoFactorBackupCodesSavedAt: Date | null;
|
|
93
|
+
/** Hash of the last code emailed for two-factor, never the code itself. */
|
|
87
94
|
twoFactorEmailCode: string | null;
|
|
88
95
|
twoFactorEmailCodeRequestedAt: Date | null;
|
|
89
96
|
}
|
|
@@ -122,6 +122,10 @@ __decorate([
|
|
|
122
122
|
(0, interface_database_decorators_1.Field)("string"),
|
|
123
123
|
__metadata("design:type", Object)
|
|
124
124
|
], User.prototype, "twoFactorPendingSecret", void 0);
|
|
125
|
+
__decorate([
|
|
126
|
+
(0, interface_database_decorators_1.Field)("number"),
|
|
127
|
+
__metadata("design:type", Object)
|
|
128
|
+
], User.prototype, "twoFactorTotpLastStep", void 0);
|
|
125
129
|
__decorate([
|
|
126
130
|
(0, interface_database_decorators_1.Field)(["string"]),
|
|
127
131
|
__metadata("design:type", Array)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"users.table.js","sourceRoot":"","sources":["../../../../src/auth/db/tables/users.table.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6FASmD;AACnD,kDAAsD;AAGzC,QAAA,gBAAgB,GAAG,OAAO,CAAC;AAYjC,IAAM,IAAI,GAAV,MAAM,IAAK,SAAQ,qCAAK,CAAC,IAAI,CAAC,4CAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"users.table.js","sourceRoot":"","sources":["../../../../src/auth/db/tables/users.table.ts"],"names":[],"mappings":";;;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AAA,qCAAK,EAAC,QAAQ,CAAC;;6CACuB;AAM/B;IADP,IAAA,qCAAK,EAAC,MAAM,CAAC;;mDAC6B;AAOnC;IAFP,IAAA,qCAAK,GAAE;IACP,IAAA,qCAAK,EAAC,QAAQ,CAAC;;iDAC2B;AAMnC;IADP,IAAA,qCAAK,EAAC,MAAM,CAAC;;uDACiC;AAMvC;IADP,IAAA,qCAAK,EAAC,SAAS,CAAC;;mCACM;AAQf;IADP,IAAA,qCAAK,EAAC,MAAM,CAAC;;0CACoB;AAG1B;IADP,IAAA,qCAAK,EAAC,CAAC,QAAQ,CAAC,CAAC;;8CACiB;AAG3B;IADP,IAAA,qCAAK,EAAC,QAAQ,CAAC;;6CACuB;AAG/B;IADP,IAAA,qCAAK,EAAC,QAAQ,CAAC;;oDAC8B;AAQtC;IADP,IAAA,qCAAK,EAAC,QAAQ,CAAC;;mDAC8B;AAGtC;IADP,IAAA,qCAAK,EAAC,CAAC,QAAQ,CAAC,CAAC;;kDACqB;AAI/B;IADP,IAAA,qCAAK,EAAC,MAAM,CAAC;;6DACuC;AAO7C;IADP,IAAA,qCAAK,EAAC,MAAM,CAAC;;yDACmC;AAIzC;IADP,IAAA,qCAAK,EAAC,QAAQ,CAAC;;gDAC0B;AAGlC;IADP,IAAA,qCAAK,EAAC,MAAM,CAAC;;2DACqC;eA9JxC,IAAI;IADhB,IAAA,6CAAa,EAAC,wBAAgB,EAAE,4BAAgB,CAAC;GACrC,IAAI,CA+JhB"}
|
|
@@ -2,6 +2,7 @@ import { ComponentBuilder } from "../component";
|
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
import { type BlockItemsSource, type BlockLinkAction } from "./display";
|
|
4
4
|
import type { BaseComponentProps } from "./types";
|
|
5
|
+
import type { BlockText, ComposedTextParam } from "./types/composed-text";
|
|
5
6
|
import { type Tone } from "./types/tone";
|
|
6
7
|
/** One entry of an activity feed. */
|
|
7
8
|
export interface ActivityFeedItem {
|
|
@@ -9,21 +10,26 @@ export interface ActivityFeedItem {
|
|
|
9
10
|
/** Icon of the entry's well, e.g. `i-ph-check-circle`. */
|
|
10
11
|
icon?: string;
|
|
11
12
|
tone?: Tone;
|
|
12
|
-
/** Title (i18n key with `$` or literal). */
|
|
13
|
-
title: string;
|
|
14
|
-
/** Details under the title, joined by "·". */
|
|
15
|
-
meta?: string[];
|
|
16
13
|
/**
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
* with the item's other values: `{ device: "$…device", browser: "Chrome",
|
|
20
|
-
* os: "Windows" }`.
|
|
14
|
+
* Title: a literal, a `$`-prefixed i18n key, or a `ComposedText` that
|
|
15
|
+
* carries its own values.
|
|
21
16
|
*/
|
|
22
|
-
|
|
17
|
+
title: BlockText;
|
|
18
|
+
/** Details under the title, joined by "·"; each one like the title. */
|
|
19
|
+
meta?: BlockText[];
|
|
20
|
+
/**
|
|
21
|
+
* Values the `$`-prefixed title and details interpolate (`{device}`). A
|
|
22
|
+
* typed value is formatted for the reader (`{ type: "count", value: 3 }`,
|
|
23
|
+
* which also picks the plural form of the message; `{ type: "relative",
|
|
24
|
+
* value: "2026-10-10T08:00:00Z" }`), as in a `ComposedText`. A string
|
|
25
|
+
* written as a `$`-prefixed key is translated first, with the item's other
|
|
26
|
+
* values: `{ device: "$…device", browser: "Chrome", os: "Windows" }`.
|
|
27
|
+
*/
|
|
28
|
+
params?: Record<string, ComposedTextParam>;
|
|
23
29
|
/** ISO date: files the entry under its day and gives its time. */
|
|
24
30
|
date?: string;
|
|
25
|
-
/**
|
|
26
|
-
time?:
|
|
31
|
+
/** Trailing text, in place of the formatted time; a `BlockText`. */
|
|
32
|
+
time?: BlockText;
|
|
27
33
|
/** Accent dot after the time. */
|
|
28
34
|
unread?: boolean;
|
|
29
35
|
/** Path the entry links to. */
|
|
@@ -45,6 +51,13 @@ export interface ActivityFeedProps extends BaseComponentProps, BlockItemsSource
|
|
|
45
51
|
groupByDay?: boolean;
|
|
46
52
|
/** Shows at most this many entries; `skeletonCount` never exceeds it. */
|
|
47
53
|
maxItems?: number;
|
|
54
|
+
/**
|
|
55
|
+
* The card fills its grid cell instead of growing with its entries, which
|
|
56
|
+
* scroll inside it under a fixed head: the cards beside it in the row set
|
|
57
|
+
* the row's height. Once the cells stack, the list scrolls past a height
|
|
58
|
+
* of its own. Defaults to `false`.
|
|
59
|
+
*/
|
|
60
|
+
fillHeight?: boolean;
|
|
48
61
|
/** Link buttons in the card head ("View all"). */
|
|
49
62
|
actions?: BlockLinkAction[];
|
|
50
63
|
/** Mono titles and details (paths, queries, request logs). */
|
|
@@ -76,6 +89,8 @@ export declare const ActivityFeedSchema: z.ZodObject<{
|
|
|
76
89
|
card: z.ZodDefault<z.ZodBoolean>;
|
|
77
90
|
fetchUrl: z.ZodOptional<z.ZodString>;
|
|
78
91
|
fetchUrlMethod: z.ZodOptional<z.ZodNativeEnum<typeof import("./types").HttpMethod>>;
|
|
92
|
+
periodScope: z.ZodOptional<z.ZodString>;
|
|
93
|
+
realtimeTopic: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
|
|
79
94
|
empty: z.ZodOptional<z.ZodObject<{
|
|
80
95
|
title: z.ZodString;
|
|
81
96
|
description: z.ZodOptional<z.ZodString>;
|
|
@@ -92,38 +107,39 @@ export declare const ActivityFeedSchema: z.ZodObject<{
|
|
|
92
107
|
id: z.ZodOptional<z.ZodString>;
|
|
93
108
|
icon: z.ZodOptional<z.ZodString>;
|
|
94
109
|
tone: z.ZodOptional<z.ZodEnum<["primary" | "secondary" | "success" | "info" | "warning" | "error" | "neutral", ...("primary" | "secondary" | "success" | "info" | "warning" | "error" | "neutral")[]]>>;
|
|
95
|
-
title: z.
|
|
96
|
-
meta: z.ZodOptional<z.ZodArray<z.
|
|
97
|
-
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.
|
|
110
|
+
title: z.ZodType<BlockText, z.ZodTypeDef, BlockText>;
|
|
111
|
+
meta: z.ZodOptional<z.ZodArray<z.ZodType<BlockText, z.ZodTypeDef, BlockText>, "many">>;
|
|
112
|
+
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<ComposedTextParam, z.ZodTypeDef, ComposedTextParam>>>;
|
|
98
113
|
date: z.ZodOptional<z.ZodString>;
|
|
99
|
-
time: z.ZodOptional<z.
|
|
114
|
+
time: z.ZodOptional<z.ZodType<BlockText, z.ZodTypeDef, BlockText>>;
|
|
100
115
|
unread: z.ZodOptional<z.ZodBoolean>;
|
|
101
116
|
to: z.ZodOptional<z.ZodString>;
|
|
102
117
|
}, "strip", z.ZodTypeAny, {
|
|
103
|
-
title:
|
|
118
|
+
title: BlockText;
|
|
104
119
|
date?: string | undefined;
|
|
105
|
-
time?:
|
|
106
|
-
params?: Record<string,
|
|
120
|
+
time?: BlockText | undefined;
|
|
121
|
+
params?: Record<string, ComposedTextParam> | undefined;
|
|
107
122
|
id?: string | undefined;
|
|
108
123
|
icon?: string | undefined;
|
|
109
|
-
meta?:
|
|
124
|
+
meta?: BlockText[] | undefined;
|
|
110
125
|
to?: string | undefined;
|
|
111
126
|
tone?: "primary" | "secondary" | "success" | "info" | "warning" | "error" | "neutral" | undefined;
|
|
112
127
|
unread?: boolean | undefined;
|
|
113
128
|
}, {
|
|
114
|
-
title:
|
|
129
|
+
title: BlockText;
|
|
115
130
|
date?: string | undefined;
|
|
116
|
-
time?:
|
|
117
|
-
params?: Record<string,
|
|
131
|
+
time?: BlockText | undefined;
|
|
132
|
+
params?: Record<string, ComposedTextParam> | undefined;
|
|
118
133
|
id?: string | undefined;
|
|
119
134
|
icon?: string | undefined;
|
|
120
|
-
meta?:
|
|
135
|
+
meta?: BlockText[] | undefined;
|
|
121
136
|
to?: string | undefined;
|
|
122
137
|
tone?: "primary" | "secondary" | "success" | "info" | "warning" | "error" | "neutral" | undefined;
|
|
123
138
|
unread?: boolean | undefined;
|
|
124
139
|
}>, "many">>;
|
|
125
140
|
groupByDay: z.ZodOptional<z.ZodBoolean>;
|
|
126
141
|
maxItems: z.ZodOptional<z.ZodNumber>;
|
|
142
|
+
fillHeight: z.ZodOptional<z.ZodBoolean>;
|
|
127
143
|
actions: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
128
144
|
label: z.ZodString;
|
|
129
145
|
to: z.ZodString;
|
|
@@ -146,13 +162,13 @@ export declare const ActivityFeedSchema: z.ZodObject<{
|
|
|
146
162
|
}, "strip", z.ZodTypeAny, {
|
|
147
163
|
card: boolean;
|
|
148
164
|
items?: {
|
|
149
|
-
title:
|
|
165
|
+
title: BlockText;
|
|
150
166
|
date?: string | undefined;
|
|
151
|
-
time?:
|
|
152
|
-
params?: Record<string,
|
|
167
|
+
time?: BlockText | undefined;
|
|
168
|
+
params?: Record<string, ComposedTextParam> | undefined;
|
|
153
169
|
id?: string | undefined;
|
|
154
170
|
icon?: string | undefined;
|
|
155
|
-
meta?:
|
|
171
|
+
meta?: BlockText[] | undefined;
|
|
156
172
|
to?: string | undefined;
|
|
157
173
|
tone?: "primary" | "secondary" | "success" | "info" | "warning" | "error" | "neutral" | undefined;
|
|
158
174
|
unread?: boolean | undefined;
|
|
@@ -161,7 +177,10 @@ export declare const ActivityFeedSchema: z.ZodObject<{
|
|
|
161
177
|
title?: string | undefined;
|
|
162
178
|
fetchUrl?: string | undefined;
|
|
163
179
|
fetchUrlMethod?: import("./types").HttpMethod | undefined;
|
|
180
|
+
periodScope?: string | undefined;
|
|
164
181
|
mono?: boolean | undefined;
|
|
182
|
+
realtimeTopic?: string | string[] | undefined;
|
|
183
|
+
fillHeight?: boolean | undefined;
|
|
165
184
|
actions?: {
|
|
166
185
|
label: string;
|
|
167
186
|
to: string;
|
|
@@ -177,13 +196,13 @@ export declare const ActivityFeedSchema: z.ZodObject<{
|
|
|
177
196
|
skeletonCount?: number | undefined;
|
|
178
197
|
}, {
|
|
179
198
|
items?: {
|
|
180
|
-
title:
|
|
199
|
+
title: BlockText;
|
|
181
200
|
date?: string | undefined;
|
|
182
|
-
time?:
|
|
183
|
-
params?: Record<string,
|
|
201
|
+
time?: BlockText | undefined;
|
|
202
|
+
params?: Record<string, ComposedTextParam> | undefined;
|
|
184
203
|
id?: string | undefined;
|
|
185
204
|
icon?: string | undefined;
|
|
186
|
-
meta?:
|
|
205
|
+
meta?: BlockText[] | undefined;
|
|
187
206
|
to?: string | undefined;
|
|
188
207
|
tone?: "primary" | "secondary" | "success" | "info" | "warning" | "error" | "neutral" | undefined;
|
|
189
208
|
unread?: boolean | undefined;
|
|
@@ -193,7 +212,10 @@ export declare const ActivityFeedSchema: z.ZodObject<{
|
|
|
193
212
|
fetchUrl?: string | undefined;
|
|
194
213
|
fetchUrlMethod?: import("./types").HttpMethod | undefined;
|
|
195
214
|
card?: boolean | undefined;
|
|
215
|
+
periodScope?: string | undefined;
|
|
196
216
|
mono?: boolean | undefined;
|
|
217
|
+
realtimeTopic?: string | string[] | undefined;
|
|
218
|
+
fillHeight?: boolean | undefined;
|
|
197
219
|
actions?: {
|
|
198
220
|
label: string;
|
|
199
221
|
to: string;
|
|
@@ -7,7 +7,9 @@ const zod_1 = require("zod");
|
|
|
7
7
|
const block_registry_1 = require("./block-registry");
|
|
8
8
|
const display_1 = require("./display");
|
|
9
9
|
const display_2 = require("./internal/display");
|
|
10
|
+
const composed_text_1 = require("./internal/composed-text");
|
|
10
11
|
const tone_1 = require("./types/tone");
|
|
12
|
+
const realtime_topics_1 = require("./internal/realtime-topics");
|
|
11
13
|
const ACTIVITY_FEED_COMPONENT_NAME = "dms-activity-feed-block";
|
|
12
14
|
const DEFAULT_ICON = "i-ph-pulse";
|
|
13
15
|
/**
|
|
@@ -28,12 +30,12 @@ const DEFAULT_ICON = "i-ph-pulse";
|
|
|
28
30
|
* ```
|
|
29
31
|
*/
|
|
30
32
|
function ActivityFeed(options) {
|
|
31
|
-
return new component_1.ComponentBuilder(ACTIVITY_FEED_COMPONENT_NAME)
|
|
33
|
+
return (0, realtime_topics_1.attachRealtimeTopicsHook)(new component_1.ComponentBuilder(ACTIVITY_FEED_COMPONENT_NAME)
|
|
32
34
|
.options({ ...options })
|
|
33
35
|
.meta({
|
|
34
36
|
name: options?.title || "Activity feed",
|
|
35
37
|
icon: DEFAULT_ICON,
|
|
36
|
-
});
|
|
38
|
+
}), options?.realtimeTopic);
|
|
37
39
|
}
|
|
38
40
|
const ActivityFeedItemSchema = zod_1.z.object({
|
|
39
41
|
id: zod_1.z.string().optional(),
|
|
@@ -42,16 +44,19 @@ const ActivityFeedItemSchema = zod_1.z.object({
|
|
|
42
44
|
label: "Tone",
|
|
43
45
|
widget: "select",
|
|
44
46
|
}),
|
|
45
|
-
title: (0, block_registry_1.ui)(
|
|
46
|
-
meta: (0, block_registry_1.ui)(zod_1.z.array(
|
|
47
|
-
params: (0, block_registry_1.ui)(zod_1.z.record(zod_1.z.string(),
|
|
47
|
+
title: (0, block_registry_1.ui)((0, composed_text_1.blockTextSchema)(), { label: "Title", widget: "text" }),
|
|
48
|
+
meta: (0, block_registry_1.ui)(zod_1.z.array((0, composed_text_1.blockTextSchema)()).optional(), { label: "Details" }),
|
|
49
|
+
params: (0, block_registry_1.ui)(zod_1.z.record(zod_1.z.string(), (0, composed_text_1.composedTextParamSchema)()).optional(), {
|
|
48
50
|
label: "Text values",
|
|
49
51
|
widget: "json",
|
|
50
52
|
}),
|
|
51
53
|
date: (0, block_registry_1.ui)(zod_1.z.string().optional().describe("ISO date of the event."), {
|
|
52
54
|
label: "Date",
|
|
53
55
|
}),
|
|
54
|
-
time: (0, block_registry_1.ui)(
|
|
56
|
+
time: (0, block_registry_1.ui)((0, composed_text_1.blockTextSchema)().optional(), {
|
|
57
|
+
label: "Time text",
|
|
58
|
+
widget: "text",
|
|
59
|
+
}),
|
|
55
60
|
unread: (0, block_registry_1.ui)(zod_1.z.boolean().optional(), { label: "Unread", widget: "switch" }),
|
|
56
61
|
to: (0, block_registry_1.ui)(zod_1.z.string().optional(), { label: "Link", widget: "url" }),
|
|
57
62
|
});
|
|
@@ -81,6 +86,10 @@ exports.ActivityFeedSchema = zod_1.z.object({
|
|
|
81
86
|
widget: "number",
|
|
82
87
|
min: 1,
|
|
83
88
|
}),
|
|
89
|
+
fillHeight: (0, block_registry_1.ui)(zod_1.z
|
|
90
|
+
.boolean()
|
|
91
|
+
.optional()
|
|
92
|
+
.describe("Fills the grid cell, the entries scrolling inside, rather than growing with them."), { label: "Fill the cell", group: "appearance", widget: "switch" }),
|
|
84
93
|
actions: (0, display_1.blockActionsOption)("Link buttons in the card head."),
|
|
85
94
|
...(0, display_1.blockItemsSourceOptions)(),
|
|
86
95
|
mono: (0, block_registry_1.ui)(zod_1.z.boolean().optional(), {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"activity-feed.js","sourceRoot":"","sources":["../../src/base/activity-feed.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"activity-feed.js","sourceRoot":"","sources":["../../src/base/activity-feed.ts"],"names":[],"mappings":";;;AAwGA,oCAYC;AApHD,4CAAgD;AAChD,6BAAwB;AACxB,qDAA+E;AAC/E,uCAMmB;AACnB,gDAA8C;AAC9C,4DAGkC;AAGlC,uCAAgD;AAChD,gEAAsE;AAkEtE,MAAM,4BAA4B,GAAG,yBAAyB,CAAC;AAC/D,MAAM,YAAY,GAAG,YAAY,CAAC;AAElC;;;;;;;;;;;;;;;;GAgBG;AACH,SAAgB,YAAY,CAC1B,OAA2B;IAE3B,OAAO,IAAA,0CAAwB,EAC7B,IAAI,4BAAgB,CAAoB,4BAA4B,CAAC;SAClE,OAAO,CAAC,EAAE,GAAG,OAAO,EAAE,CAAC;SACvB,IAAI,CAAC;QACJ,IAAI,EAAE,OAAO,EAAE,KAAK,IAAI,eAAe;QACvC,IAAI,EAAE,YAAY;KACnB,CAAC,EACJ,OAAO,EAAE,aAAa,CACvB,CAAC;AACJ,CAAC;AAED,MAAM,sBAAsB,GAAG,OAAC,CAAC,MAAM,CAAC;IACtC,EAAE,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACzB,IAAI,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kB,EAAC,gCAAgC,CAAC;IAC7D,GAAG,IAAA,iCAAuB,GAAE;IAC5B,IAAI,EAAE,IAAA,mBAAE,EAAC,OAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE,EAAE;QAC/B,KAAK,EAAE,WAAW;QAClB,KAAK,EAAE,YAAY;QACnB,MAAM,EAAE,QAAQ;KACjB,CAAC;IACF,IAAI,EAAE,IAAA,yBAAe,EAAC,IAAI,CAAC;CAC5B,CAA8C,CAAC;AAEhD,IAAA,kCAAiB,EAAC;IAChB,IAAI,EAAE,cAAc;IACpB,aAAa,EAAE,4BAA4B;IAC3C,MAAM,EAAE,0BAAkB;IAC1B,IAAI,EAAE;QACJ,IAAI,EAAE,eAAe;QACrB,IAAI,EAAE,YAAY;QAClB,WAAW,EAAE,yDAAyD;QACtE,KAAK,EAAE,MAAM;KACd;CACF,CAAC,CAAC"}
|
package/dist/base/banner.d.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { ComponentBuilder } from "../component";
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
import { type BlockLinkAction } from "./display";
|
|
4
|
-
import type { BaseComponentProps } from "./types";
|
|
4
|
+
import type { BaseComponentProps, EnumOption } from "./types";
|
|
5
|
+
import type { CustomButtonSerialized } from "./types/custom-button";
|
|
6
|
+
import type { HttpMethod } from "./types/http";
|
|
5
7
|
import type { BlockText } from "./types/composed-text";
|
|
6
8
|
import type { Tone } from "./types/tone";
|
|
7
9
|
/** The tones a banner washes with. */
|
|
@@ -11,8 +13,22 @@ export type BannerTone = Extract<Tone, (typeof BANNER_TONES)[number]>;
|
|
|
11
13
|
export declare const BANNER_SIZES: readonly ["md", "sm"];
|
|
12
14
|
/** `md` boxed banner; `sm` compact one-line banner, for cards and panels. */
|
|
13
15
|
export type BannerSize = (typeof BANNER_SIZES)[number];
|
|
14
|
-
/**
|
|
15
|
-
|
|
16
|
+
/**
|
|
17
|
+
* A button a fetched banner offers besides its links: the target of a page
|
|
18
|
+
* header or toolbar button (`CustomButton`) — an API call, a modal, a drawer,
|
|
19
|
+
* a quick action, a link or an export — with its confirmation, as the route
|
|
20
|
+
* serializes it. Pressing one that changes something refreshes the page's
|
|
21
|
+
* blocks, the banner included.
|
|
22
|
+
*/
|
|
23
|
+
export type BannerButtonAction = Pick<CustomButtonSerialized, "label" | "icon" | "variant" | "color" | "target" | "confirm">;
|
|
24
|
+
/** An action of a banner: a link, or a button only a route answers. */
|
|
25
|
+
export type BannerAction = BlockLinkAction | BannerButtonAction;
|
|
26
|
+
/**
|
|
27
|
+
* What a banner shows. A banner's `fetchUrl` answers it, or `null`, `{}` or
|
|
28
|
+
* a 204 for no banner at all; its fields override the static options one by
|
|
29
|
+
* one.
|
|
30
|
+
*/
|
|
31
|
+
export interface BannerContent {
|
|
16
32
|
/**
|
|
17
33
|
* `$`-prefixed for an i18n key, like every text of the block, or a
|
|
18
34
|
* `ComposedText` composed in the reader's language ("Payment failed, retry
|
|
@@ -25,7 +41,7 @@ export interface BannerProps extends BaseComponentProps {
|
|
|
25
41
|
/** Overrides the tone's icon. */
|
|
26
42
|
icon?: string;
|
|
27
43
|
size?: BannerSize;
|
|
28
|
-
actions?:
|
|
44
|
+
actions?: BannerAction[];
|
|
29
45
|
/** Adds a close button; the dismissal is remembered. */
|
|
30
46
|
dismissible?: boolean;
|
|
31
47
|
/**
|
|
@@ -36,11 +52,38 @@ export interface BannerProps extends BaseComponentProps {
|
|
|
36
52
|
*/
|
|
37
53
|
dismissKey?: string;
|
|
38
54
|
}
|
|
55
|
+
/** The options `Banner` takes. */
|
|
56
|
+
export interface BannerProps extends BaseComponentProps, BannerContent {
|
|
57
|
+
/**
|
|
58
|
+
* Link buttons. A button running a target (`BannerButtonAction`) is only
|
|
59
|
+
* answered by `fetchUrl`, which decides per request who is shown it.
|
|
60
|
+
*/
|
|
61
|
+
actions?: BlockLinkAction[];
|
|
62
|
+
/**
|
|
63
|
+
* Route answering the banner's `BannerContent`, or `null`, `{}` or a 204
|
|
64
|
+
* when there is nothing to tell: the block then draws nothing, and nothing
|
|
65
|
+
* either until its first answer lands. It may name the page it is shown
|
|
66
|
+
* on: `{{params.X}}` and `{{query.X}}` name the page URL, as in
|
|
67
|
+
* `BlockItemsSource.fetchUrl`.
|
|
68
|
+
*
|
|
69
|
+
* Read again, keeping the banner on screen, when the page asks its blocks
|
|
70
|
+
* to refresh: see `BlockFunctions.REFRESH_PAGE`.
|
|
71
|
+
*/
|
|
72
|
+
fetchUrl?: string;
|
|
73
|
+
fetchUrlMethod?: EnumOption<HttpMethod>;
|
|
74
|
+
/** Id of the PeriodSelector whose period is sent to `fetchUrl`. */
|
|
75
|
+
periodScope?: string;
|
|
76
|
+
/** Realtime topic(s); the banner reads `fetchUrl` again when they publish. */
|
|
77
|
+
realtimeTopic?: string | string[];
|
|
78
|
+
}
|
|
39
79
|
/**
|
|
40
80
|
* Banner — a notice across the top of a page or a card: a tinted wash, a
|
|
41
81
|
* boxed icon, a title and a line of explanation, with link actions and an
|
|
42
82
|
* optional dismiss that is remembered.
|
|
43
83
|
*
|
|
84
|
+
* With a `fetchUrl` the route decides what the banner says, and whether there
|
|
85
|
+
* is a banner at all: a computed health status, an outage notice.
|
|
86
|
+
*
|
|
44
87
|
* Distinct from `RegisterLayoutBanner` (the dashboard-wide strip under the
|
|
45
88
|
* header): this one is a block placed on one page.
|
|
46
89
|
*
|
|
@@ -53,6 +96,8 @@ export interface BannerProps extends BaseComponentProps {
|
|
|
53
96
|
* dismissible: true,
|
|
54
97
|
* dismissKey: "sales-beta-2026",
|
|
55
98
|
* })
|
|
99
|
+
*
|
|
100
|
+
* Banner({ fetchUrl: "/api/mailing/{{params.id}}/provider-status" })
|
|
56
101
|
* ```
|
|
57
102
|
*/
|
|
58
103
|
export declare function Banner(options?: BannerProps): ComponentBuilder<BannerProps>;
|
|
@@ -84,12 +129,20 @@ export declare const BannerSchema: z.ZodObject<{
|
|
|
84
129
|
size: z.ZodDefault<z.ZodEnum<["md", "sm"]>>;
|
|
85
130
|
dismissible: z.ZodOptional<z.ZodBoolean>;
|
|
86
131
|
dismissKey: z.ZodOptional<z.ZodString>;
|
|
132
|
+
fetchUrl: z.ZodOptional<z.ZodString>;
|
|
133
|
+
fetchUrlMethod: z.ZodOptional<z.ZodNativeEnum<typeof HttpMethod>>;
|
|
134
|
+
periodScope: z.ZodOptional<z.ZodString>;
|
|
135
|
+
realtimeTopic: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
|
|
87
136
|
}, "strip", z.ZodTypeAny, {
|
|
88
137
|
size: "sm" | "md";
|
|
89
138
|
tone: "primary" | "success" | "info" | "warning" | "error";
|
|
90
139
|
description?: BlockText | undefined;
|
|
91
140
|
title?: BlockText | undefined;
|
|
92
141
|
icon?: string | undefined;
|
|
142
|
+
fetchUrl?: string | undefined;
|
|
143
|
+
fetchUrlMethod?: HttpMethod | undefined;
|
|
144
|
+
periodScope?: string | undefined;
|
|
145
|
+
realtimeTopic?: string | string[] | undefined;
|
|
93
146
|
actions?: {
|
|
94
147
|
label: string;
|
|
95
148
|
to: string;
|
|
@@ -104,6 +157,10 @@ export declare const BannerSchema: z.ZodObject<{
|
|
|
104
157
|
size?: "sm" | "md" | undefined;
|
|
105
158
|
title?: BlockText | undefined;
|
|
106
159
|
icon?: string | undefined;
|
|
160
|
+
fetchUrl?: string | undefined;
|
|
161
|
+
fetchUrlMethod?: HttpMethod | undefined;
|
|
162
|
+
periodScope?: string | undefined;
|
|
163
|
+
realtimeTopic?: string | string[] | undefined;
|
|
107
164
|
actions?: {
|
|
108
165
|
label: string;
|
|
109
166
|
to: string;
|
package/dist/base/banner.js
CHANGED
|
@@ -8,6 +8,7 @@ const block_registry_1 = require("./block-registry");
|
|
|
8
8
|
const display_1 = require("./display");
|
|
9
9
|
const display_2 = require("./internal/display");
|
|
10
10
|
const composed_text_1 = require("./internal/composed-text");
|
|
11
|
+
const realtime_topics_1 = require("./internal/realtime-topics");
|
|
11
12
|
/** The tones a banner washes with. */
|
|
12
13
|
exports.BANNER_TONES = [
|
|
13
14
|
"info",
|
|
@@ -26,6 +27,9 @@ const BANNER_DEFAULTS = { tone: "info", size: "md" };
|
|
|
26
27
|
* boxed icon, a title and a line of explanation, with link actions and an
|
|
27
28
|
* optional dismiss that is remembered.
|
|
28
29
|
*
|
|
30
|
+
* With a `fetchUrl` the route decides what the banner says, and whether there
|
|
31
|
+
* is a banner at all: a computed health status, an outage notice.
|
|
32
|
+
*
|
|
29
33
|
* Distinct from `RegisterLayoutBanner` (the dashboard-wide strip under the
|
|
30
34
|
* header): this one is a block placed on one page.
|
|
31
35
|
*
|
|
@@ -38,15 +42,18 @@ const BANNER_DEFAULTS = { tone: "info", size: "md" };
|
|
|
38
42
|
* dismissible: true,
|
|
39
43
|
* dismissKey: "sales-beta-2026",
|
|
40
44
|
* })
|
|
45
|
+
*
|
|
46
|
+
* Banner({ fetchUrl: "/api/mailing/{{params.id}}/provider-status" })
|
|
41
47
|
* ```
|
|
42
48
|
*/
|
|
43
49
|
function Banner(options) {
|
|
44
|
-
|
|
50
|
+
const builder = new component_1.ComponentBuilder(BANNER_COMPONENT_NAME)
|
|
45
51
|
.options({ ...BANNER_DEFAULTS, ...options })
|
|
46
52
|
.meta({
|
|
47
53
|
name: (typeof options?.title === "string" && options.title) || "Banner",
|
|
48
54
|
icon: options?.icon || BANNER_ICON,
|
|
49
55
|
});
|
|
56
|
+
return (0, realtime_topics_1.attachRealtimeTopicsHook)(builder, options?.realtimeTopic);
|
|
50
57
|
}
|
|
51
58
|
/** The options `Banner` accepts. */
|
|
52
59
|
exports.BannerSchema = zod_1.z.object({
|
|
@@ -83,6 +90,10 @@ exports.BannerSchema = zod_1.z.object({
|
|
|
83
90
|
.string()
|
|
84
91
|
.optional()
|
|
85
92
|
.describe("Key the dismissal is remembered under; change it to reset."), { label: "Dismiss key", group: "behavior", advanced: true }),
|
|
93
|
+
fetchUrl: (0, display_1.blockFetchUrlOption)("Route answering the banner's content, or nothing to hide it."),
|
|
94
|
+
fetchUrlMethod: (0, display_1.blockFetchUrlMethodOption)(),
|
|
95
|
+
periodScope: (0, display_1.blockPeriodScopeOption)(),
|
|
96
|
+
realtimeTopic: (0, display_1.blockRealtimeTopicOption)(),
|
|
86
97
|
});
|
|
87
98
|
(0, block_registry_1.RegisterBlockType)({
|
|
88
99
|
type: "Banner",
|
|
@@ -91,7 +102,7 @@ exports.BannerSchema = zod_1.z.object({
|
|
|
91
102
|
meta: {
|
|
92
103
|
name: "Banner",
|
|
93
104
|
icon: BANNER_ICON,
|
|
94
|
-
description: "Notice with a tone, link actions and a remembered dismiss.",
|
|
105
|
+
description: "Notice with a tone, link actions and a remembered dismiss, static or fetched.",
|
|
95
106
|
group: "content",
|
|
96
107
|
},
|
|
97
108
|
});
|
package/dist/base/banner.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"banner.js","sourceRoot":"","sources":["../../src/base/banner.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"banner.js","sourceRoot":"","sources":["../../src/base/banner.ts"],"names":[],"mappings":";;;AAuIA,wBAQC;AA/ID,4CAAgD;AAChD,6BAAwB;AACxB,qDAA+E;AAC/E,uCAOmB;AACnB,gDAA8C;AAC9C,4DAA2D;AAC3D,gEAAsE;AAOtE,sCAAsC;AACzB,QAAA,YAAY,GAAG;IAC1B,MAAM;IACN,SAAS;IACT,SAAS;IACT,OAAO;IACP,SAAS;CACyB,CAAC;AAIrC,6BAA6B;AAChB,QAAA,YAAY,GAAG,CAAC,IAAI,EAAE,IAAI,CAAU,CAAC;AA2ElD,MAAM,qBAAqB,GAAG,kBAAkB,CAAC;AACjD,MAAM,WAAW,GAAG,gBAAgB,CAAC;AACrC,MAAM,eAAe,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAW,CAAC;AAE9D;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,SAAgB,MAAM,CAAC,OAAqB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@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"block-types.js","sourceRoot":"","sources":["../../src/base/block-types.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;GAWG;AACH,2BAAyB;AACzB,oBAAkB;AAClB,kBAAgB;AAChB,oCAAkC;AAClC,wBAAsB;AACtB,yBAAuB;AACvB,+BAA6B;AAC7B,kBAAgB;AAChB,4BAA0B;AAC1B,sBAAoB;AACpB,mBAAiB;AACjB,2BAAyB;AACzB,6BAA2B;AAC3B,yBAAuB;AACvB,kCAAgC;AAChC,qBAAmB;AACnB,mBAAiB;AACjB,wBAAsB;AACtB,iBAAe;AACf,+BAA6B;AAC7B,2BAAyB;AAEzB,2EAA2E;AAC3E,6DAA6D;AAC7D,iDAA+B;AAC/B,2DAAyC;AACzC,4DAA0C;AAC1C,yDAAuC"}
|
|
1
|
+
{"version":3,"file":"block-types.js","sourceRoot":"","sources":["../../src/base/block-types.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;GAWG;AACH,2BAAyB;AACzB,oBAAkB;AAClB,kBAAgB;AAChB,oCAAkC;AAClC,wBAAsB;AACtB,wBAAsB;AACtB,yBAAuB;AACvB,+BAA6B;AAC7B,kBAAgB;AAChB,4BAA0B;AAC1B,sBAAoB;AACpB,mBAAiB;AACjB,2BAAyB;AACzB,6BAA2B;AAC3B,yBAAuB;AACvB,kCAAgC;AAChC,qBAAmB;AACnB,mBAAiB;AACjB,wBAAsB;AACtB,iBAAe;AACf,+BAA6B;AAC7B,2BAAyB;AAEzB,2EAA2E;AAC3E,6DAA6D;AAC7D,iDAA+B;AAC/B,2DAAyC;AACzC,4DAA0C;AAC1C,yDAAuC"}
|
|
@@ -68,8 +68,8 @@ export declare const ChartCardSchema: z.ZodObject<{
|
|
|
68
68
|
icon?: string | undefined;
|
|
69
69
|
fetchUrl?: string | undefined;
|
|
70
70
|
fetchUrlMethod?: HttpMethod | undefined;
|
|
71
|
-
showLegend?: boolean | undefined;
|
|
72
71
|
periodScope?: string | undefined;
|
|
72
|
+
showLegend?: boolean | undefined;
|
|
73
73
|
valueFormat?: "number" | "percent" | "compact" | "currency" | undefined;
|
|
74
74
|
currencyCode?: string | undefined;
|
|
75
75
|
showDelta?: boolean | undefined;
|