@gooddata/sdk-model 11.62.0-alpha.0 → 11.62.0-alpha.2
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/esm/genAI/chat.d.ts +9 -9
- package/esm/genAI/chat.d.ts.map +1 -1
- package/esm/index.d.ts +12 -12
- package/esm/index.d.ts.map +1 -1
- package/esm/index.js +10 -10
- package/esm/publisher/builtinPageLayouts.d.ts +45 -0
- package/esm/publisher/builtinPageLayouts.d.ts.map +1 -0
- package/esm/{reports → publisher}/builtinPageLayouts.js +19 -19
- package/esm/{reports → publisher}/content.d.ts +20 -20
- package/esm/publisher/content.d.ts.map +1 -0
- package/esm/{reports → publisher}/content.js +2 -2
- package/esm/{reports/report.d.ts → publisher/document.d.ts} +28 -28
- package/esm/publisher/document.d.ts.map +1 -0
- package/esm/{reports/report.js → publisher/document.js} +10 -10
- package/esm/publisher/factory.d.ts +65 -0
- package/esm/publisher/factory.d.ts.map +1 -0
- package/esm/{reports → publisher}/factory.js +22 -22
- package/esm/{reports → publisher}/layout.d.ts +15 -15
- package/esm/publisher/layout.d.ts.map +1 -0
- package/esm/{reports → publisher}/layout.js +4 -4
- package/esm/publisher/pageFormat.d.ts +38 -0
- package/esm/publisher/pageFormat.d.ts.map +1 -0
- package/esm/publisher/pageFormat.js +33 -0
- package/esm/{reports → publisher}/pageLayout.d.ts +28 -28
- package/esm/publisher/pageLayout.d.ts.map +1 -0
- package/esm/{reports → publisher}/pageLayout.js +18 -18
- package/esm/{reports → publisher}/slot.d.ts +48 -48
- package/esm/publisher/slot.d.ts.map +1 -0
- package/esm/publisher/slot.js +87 -0
- package/esm/{reports → publisher}/styling.d.ts +39 -39
- package/esm/publisher/styling.d.ts.map +1 -0
- package/esm/publisher/styling.js +58 -0
- package/esm/publisher/variables.d.ts +72 -0
- package/esm/publisher/variables.d.ts.map +1 -0
- package/esm/{reports → publisher}/variables.js +7 -7
- package/esm/sdk-model.d.ts +889 -858
- package/esm/settings/settings.d.ts +13 -0
- package/esm/settings/settings.d.ts.map +1 -1
- package/esm/theme/index.d.ts +68 -51
- package/esm/theme/index.d.ts.map +1 -1
- package/package.json +3 -3
- package/esm/reports/builtinPageLayouts.d.ts +0 -45
- package/esm/reports/builtinPageLayouts.d.ts.map +0 -1
- package/esm/reports/content.d.ts.map +0 -1
- package/esm/reports/factory.d.ts +0 -65
- package/esm/reports/factory.d.ts.map +0 -1
- package/esm/reports/layout.d.ts.map +0 -1
- package/esm/reports/pageFormat.d.ts +0 -38
- package/esm/reports/pageFormat.d.ts.map +0 -1
- package/esm/reports/pageFormat.js +0 -33
- package/esm/reports/pageLayout.d.ts.map +0 -1
- package/esm/reports/report.d.ts.map +0 -1
- package/esm/reports/slot.d.ts.map +0 -1
- package/esm/reports/slot.js +0 -87
- package/esm/reports/styling.d.ts.map +0 -1
- package/esm/reports/styling.js +0 -58
- package/esm/reports/variables.d.ts +0 -72
- package/esm/reports/variables.d.ts.map +0 -1
|
@@ -3,16 +3,16 @@
|
|
|
3
3
|
*
|
|
4
4
|
* @alpha
|
|
5
5
|
*/
|
|
6
|
-
export type
|
|
6
|
+
export type PublisherContentAlignment = "start" | "center" | "end";
|
|
7
7
|
/**
|
|
8
8
|
* Solid color painted behind a section's or page's content.
|
|
9
9
|
*
|
|
10
10
|
* @alpha
|
|
11
11
|
*/
|
|
12
|
-
export interface
|
|
12
|
+
export interface IPublisherColorBackground {
|
|
13
13
|
type: "color";
|
|
14
14
|
/**
|
|
15
|
-
* CSS color value. Absolute:
|
|
15
|
+
* CSS color value. Absolute: document styling states brand colors directly and does not
|
|
16
16
|
* follow the workspace theme.
|
|
17
17
|
*/
|
|
18
18
|
color: string;
|
|
@@ -22,10 +22,10 @@ export interface IReportColorBackground {
|
|
|
22
22
|
*
|
|
23
23
|
* @alpha
|
|
24
24
|
*/
|
|
25
|
-
export interface
|
|
25
|
+
export interface IPublisherImageBackground {
|
|
26
26
|
type: "image";
|
|
27
27
|
/**
|
|
28
|
-
* Local identifier of an image slot in {@link
|
|
28
|
+
* Local identifier of an image slot in {@link IPublisherPageBody.slots}. Routing the image
|
|
29
29
|
* through a slot keeps it template-fillable and gives it the slot's placeholder metadata.
|
|
30
30
|
* A reference that is missing or resolves to a non-image slot paints no background.
|
|
31
31
|
*/
|
|
@@ -36,24 +36,24 @@ export interface IReportImageBackground {
|
|
|
36
36
|
*
|
|
37
37
|
* @alpha
|
|
38
38
|
*/
|
|
39
|
-
export type
|
|
39
|
+
export type PublisherBackground = IPublisherColorBackground | IPublisherImageBackground;
|
|
40
40
|
/**
|
|
41
41
|
* Paint of the box itself. Never affects the geometry of the box or its children —
|
|
42
42
|
* geometry always comes from layout weights.
|
|
43
43
|
*
|
|
44
44
|
* @alpha
|
|
45
45
|
*/
|
|
46
|
-
export interface
|
|
47
|
-
background?:
|
|
46
|
+
export interface IPublisherBoxStyle {
|
|
47
|
+
background?: PublisherBackground;
|
|
48
48
|
/**
|
|
49
|
-
* Corner radius in percent of the page width — the same relative unit the rest of a
|
|
49
|
+
* Corner radius in percent of the page width — the same relative unit the rest of a document page
|
|
50
50
|
* is sized in, so the corners keep their proportion however large the page is rendered.
|
|
51
51
|
* Content reaching into a rounded corner is clipped.
|
|
52
52
|
*/
|
|
53
53
|
borderRadius?: number;
|
|
54
54
|
/**
|
|
55
55
|
* Inset of the box's own content, in percent of the page width like
|
|
56
|
-
* {@link
|
|
56
|
+
* {@link IPublisherBoxStyle.borderRadius}. Insets only inward — siblings and the layout
|
|
57
57
|
* gaps around the box are untouched. A box that paints a background usually wants one;
|
|
58
58
|
* a full-bleed box (an image-backed cover) wants none, which is why no default exists.
|
|
59
59
|
*/
|
|
@@ -65,91 +65,91 @@ export interface IReportBoxStyle {
|
|
|
65
65
|
*
|
|
66
66
|
* @alpha
|
|
67
67
|
*/
|
|
68
|
-
export type
|
|
68
|
+
export type PublisherHeadingType = "h1" | "h2" | "h3" | "h4" | "h5" | "h6";
|
|
69
69
|
/**
|
|
70
70
|
* Size a paragraph is rendered at. Each size is styled by the matching theme text level
|
|
71
71
|
* (`reports.textStyle.paragraph.largeText` ...).
|
|
72
72
|
*
|
|
73
73
|
* @alpha
|
|
74
74
|
*/
|
|
75
|
-
export type
|
|
75
|
+
export type PublisherParagraphType = "largeText" | "normalText" | "smallText";
|
|
76
76
|
/**
|
|
77
|
-
* Size any
|
|
77
|
+
* Size any document text is rendered at.
|
|
78
78
|
*
|
|
79
79
|
* @alpha
|
|
80
80
|
*/
|
|
81
|
-
export type
|
|
81
|
+
export type PublisherTextType = PublisherHeadingType | PublisherParagraphType;
|
|
82
82
|
/**
|
|
83
83
|
* All heading sizes, largest first.
|
|
84
84
|
*
|
|
85
85
|
* @alpha
|
|
86
86
|
*/
|
|
87
|
-
export declare const
|
|
87
|
+
export declare const PublisherHeadingTypes: PublisherHeadingType[];
|
|
88
88
|
/**
|
|
89
89
|
* All paragraph sizes, largest first.
|
|
90
90
|
*
|
|
91
91
|
* @alpha
|
|
92
92
|
*/
|
|
93
|
-
export declare const
|
|
93
|
+
export declare const PublisherParagraphTypes: PublisherParagraphType[];
|
|
94
94
|
/**
|
|
95
95
|
* Size a heading slot that states none is rendered at.
|
|
96
96
|
*
|
|
97
97
|
* @alpha
|
|
98
98
|
*/
|
|
99
|
-
export declare const
|
|
99
|
+
export declare const DefaultPublisherHeadingType: PublisherHeadingType;
|
|
100
100
|
/**
|
|
101
101
|
* Size a paragraph slot that states none is rendered at.
|
|
102
102
|
*
|
|
103
103
|
* @alpha
|
|
104
104
|
*/
|
|
105
|
-
export declare const
|
|
105
|
+
export declare const DefaultPublisherParagraphType: PublisherParagraphType;
|
|
106
106
|
/**
|
|
107
|
-
* Type-guard testing whether the value is a {@link
|
|
107
|
+
* Type-guard testing whether the value is a {@link PublisherHeadingType}.
|
|
108
108
|
*
|
|
109
109
|
* @alpha
|
|
110
110
|
*/
|
|
111
|
-
export declare function
|
|
111
|
+
export declare function isPublisherHeadingType(value: unknown): value is PublisherHeadingType;
|
|
112
112
|
/**
|
|
113
|
-
* Type-guard testing whether the value is a {@link
|
|
113
|
+
* Type-guard testing whether the value is a {@link PublisherParagraphType}.
|
|
114
114
|
*
|
|
115
115
|
* @alpha
|
|
116
116
|
*/
|
|
117
|
-
export declare function
|
|
117
|
+
export declare function isPublisherParagraphType(value: unknown): value is PublisherParagraphType;
|
|
118
118
|
/**
|
|
119
119
|
* Styling of a text slot: the paint of its box, plus the ink and placement of the text it owns.
|
|
120
120
|
*
|
|
121
121
|
* @alpha
|
|
122
122
|
*/
|
|
123
|
-
export interface
|
|
123
|
+
export interface IPublisherTextStyle extends IPublisherBoxStyle {
|
|
124
124
|
/**
|
|
125
|
-
* CSS color value. Absolute, like {@link
|
|
125
|
+
* CSS color value. Absolute, like {@link IPublisherColorBackground.color}.
|
|
126
126
|
*/
|
|
127
127
|
color?: string;
|
|
128
|
-
horizontalAlign?:
|
|
129
|
-
verticalAlign?:
|
|
128
|
+
horizontalAlign?: PublisherContentAlignment;
|
|
129
|
+
verticalAlign?: PublisherContentAlignment;
|
|
130
130
|
}
|
|
131
131
|
/**
|
|
132
132
|
* Styling of a heading slot.
|
|
133
133
|
*
|
|
134
134
|
* @alpha
|
|
135
135
|
*/
|
|
136
|
-
export interface
|
|
136
|
+
export interface IPublisherHeadingStyle extends IPublisherTextStyle {
|
|
137
137
|
/**
|
|
138
|
-
* Defaults to {@link
|
|
138
|
+
* Defaults to {@link DefaultPublisherHeadingType}. The size owns the semantic typography that goes
|
|
139
139
|
* with it; the rest of the style overrides ink and placement on top of it.
|
|
140
140
|
*/
|
|
141
|
-
type?:
|
|
141
|
+
type?: PublisherHeadingType;
|
|
142
142
|
}
|
|
143
143
|
/**
|
|
144
144
|
* Styling of a paragraph slot.
|
|
145
145
|
*
|
|
146
146
|
* @alpha
|
|
147
147
|
*/
|
|
148
|
-
export interface
|
|
148
|
+
export interface IPublisherParagraphStyle extends IPublisherTextStyle {
|
|
149
149
|
/**
|
|
150
|
-
* Defaults to {@link
|
|
150
|
+
* Defaults to {@link DefaultPublisherParagraphType}.
|
|
151
151
|
*/
|
|
152
|
-
type?:
|
|
152
|
+
type?: PublisherParagraphType;
|
|
153
153
|
}
|
|
154
154
|
/**
|
|
155
155
|
* Where the drawn image sits when it does not fill its box, and which part of it is kept when it
|
|
@@ -157,20 +157,20 @@ export interface IReportParagraphStyle extends IReportTextStyle {
|
|
|
157
157
|
*
|
|
158
158
|
* @alpha
|
|
159
159
|
*/
|
|
160
|
-
export interface
|
|
161
|
-
horizontalAlign?:
|
|
162
|
-
verticalAlign?:
|
|
160
|
+
export interface IPublisherImageStyle {
|
|
161
|
+
horizontalAlign?: PublisherContentAlignment;
|
|
162
|
+
verticalAlign?: PublisherContentAlignment;
|
|
163
163
|
}
|
|
164
164
|
/**
|
|
165
|
-
* Type-guard testing whether the provided object is an instance of {@link
|
|
165
|
+
* Type-guard testing whether the provided object is an instance of {@link IPublisherColorBackground}.
|
|
166
166
|
*
|
|
167
167
|
* @alpha
|
|
168
168
|
*/
|
|
169
|
-
export declare function
|
|
169
|
+
export declare function isPublisherColorBackground(obj: unknown): obj is IPublisherColorBackground;
|
|
170
170
|
/**
|
|
171
|
-
* Type-guard testing whether the provided object is an instance of {@link
|
|
171
|
+
* Type-guard testing whether the provided object is an instance of {@link IPublisherImageBackground}.
|
|
172
172
|
*
|
|
173
173
|
* @alpha
|
|
174
174
|
*/
|
|
175
|
-
export declare function
|
|
175
|
+
export declare function isPublisherImageBackground(obj: unknown): obj is IPublisherImageBackground;
|
|
176
176
|
//# sourceMappingURL=styling.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"styling.d.ts","sourceRoot":"","sources":["../../src/publisher/styling.ts"],"names":[],"mappings":"AAIA;;;;GAIG;AACH,MAAM,MAAM,yBAAyB,GAAG,OAAO,GAAG,QAAQ,GAAG,KAAK,CAAC;AAEnE;;;;GAIG;AACH,MAAM,WAAW,yBAAyB;IACtC,IAAI,EAAE,OAAO,CAAC;IAEd;;;OAGG;IACH,KAAK,EAAE,MAAM,CAAC;CACjB;AAED;;;;GAIG;AACH,MAAM,WAAW,yBAAyB;IACtC,IAAI,EAAE,OAAO,CAAC;IAEd;;;;OAIG;IACH,MAAM,EAAE,MAAM,CAAC;CAClB;AAED;;;;GAIG;AACH,MAAM,MAAM,mBAAmB,GAAG,yBAAyB,GAAG,yBAAyB,CAAC;AAExF;;;;;GAKG;AACH,MAAM,WAAW,kBAAkB;IAC/B,UAAU,CAAC,EAAE,mBAAmB,CAAC;IAEjC;;;;OAIG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;;;;OAKG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;GAKG;AACH,MAAM,MAAM,oBAAoB,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAE3E;;;;;GAKG;AACH,MAAM,MAAM,sBAAsB,GAAG,WAAW,GAAG,YAAY,GAAG,WAAW,CAAC;AAE9E;;;;GAIG;AACH,MAAM,MAAM,iBAAiB,GAAG,oBAAoB,GAAG,sBAAsB,CAAC;AAE9E;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,EAAE,oBAAoB,EAAyC,CAAC;AAElG;;;;GAIG;AACH,eAAO,MAAM,uBAAuB,EAAE,sBAAsB,EAA6C,CAAC;AAE1G;;;;GAIG;AACH,eAAO,MAAM,2BAA2B,EAAE,oBAA2B,CAAC;AAEtE;;;;GAIG;AACH,eAAO,MAAM,6BAA6B,EAAE,sBAAqC,CAAC;AAElF;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,oBAAoB,CAEpF;AAED;;;;GAIG;AACH,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,sBAAsB,CAExF;AAED;;;;GAIG;AACH,MAAM,WAAW,mBAAoB,SAAQ,kBAAkB;IAC3D;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf,eAAe,CAAC,EAAE,yBAAyB,CAAC;IAE5C,aAAa,CAAC,EAAE,yBAAyB,CAAC;CAC7C;AAED;;;;GAIG;AACH,MAAM,WAAW,sBAAuB,SAAQ,mBAAmB;IAC/D;;;OAGG;IACH,IAAI,CAAC,EAAE,oBAAoB,CAAC;CAC/B;AAED;;;;GAIG;AACH,MAAM,WAAW,wBAAyB,SAAQ,mBAAmB;IACjE;;OAEG;IACH,IAAI,CAAC,EAAE,sBAAsB,CAAC;CACjC;AAED;;;;;GAKG;AACH,MAAM,WAAW,oBAAoB;IACjC,eAAe,CAAC,EAAE,yBAAyB,CAAC;IAE5C,aAAa,CAAC,EAAE,yBAAyB,CAAC;CAC7C;AAED;;;;GAIG;AACH,wBAAgB,0BAA0B,CAAC,GAAG,EAAE,OAAO,GAAG,GAAG,IAAI,yBAAyB,CAEzF;AAED;;;;GAIG;AACH,wBAAgB,0BAA0B,CAAC,GAAG,EAAE,OAAO,GAAG,GAAG,IAAI,yBAAyB,CAEzF"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
// (C) 2026 GoodData Corporation
|
|
2
|
+
import { isEmpty } from "lodash-es";
|
|
3
|
+
/**
|
|
4
|
+
* All heading sizes, largest first.
|
|
5
|
+
*
|
|
6
|
+
* @alpha
|
|
7
|
+
*/
|
|
8
|
+
export const PublisherHeadingTypes = ["h1", "h2", "h3", "h4", "h5", "h6"];
|
|
9
|
+
/**
|
|
10
|
+
* All paragraph sizes, largest first.
|
|
11
|
+
*
|
|
12
|
+
* @alpha
|
|
13
|
+
*/
|
|
14
|
+
export const PublisherParagraphTypes = ["largeText", "normalText", "smallText"];
|
|
15
|
+
/**
|
|
16
|
+
* Size a heading slot that states none is rendered at.
|
|
17
|
+
*
|
|
18
|
+
* @alpha
|
|
19
|
+
*/
|
|
20
|
+
export const DefaultPublisherHeadingType = "h1";
|
|
21
|
+
/**
|
|
22
|
+
* Size a paragraph slot that states none is rendered at.
|
|
23
|
+
*
|
|
24
|
+
* @alpha
|
|
25
|
+
*/
|
|
26
|
+
export const DefaultPublisherParagraphType = "normalText";
|
|
27
|
+
/**
|
|
28
|
+
* Type-guard testing whether the value is a {@link PublisherHeadingType}.
|
|
29
|
+
*
|
|
30
|
+
* @alpha
|
|
31
|
+
*/
|
|
32
|
+
export function isPublisherHeadingType(value) {
|
|
33
|
+
return PublisherHeadingTypes.includes(value);
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Type-guard testing whether the value is a {@link PublisherParagraphType}.
|
|
37
|
+
*
|
|
38
|
+
* @alpha
|
|
39
|
+
*/
|
|
40
|
+
export function isPublisherParagraphType(value) {
|
|
41
|
+
return PublisherParagraphTypes.includes(value);
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Type-guard testing whether the provided object is an instance of {@link IPublisherColorBackground}.
|
|
45
|
+
*
|
|
46
|
+
* @alpha
|
|
47
|
+
*/
|
|
48
|
+
export function isPublisherColorBackground(obj) {
|
|
49
|
+
return !isEmpty(obj) && obj.type === "color";
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Type-guard testing whether the provided object is an instance of {@link IPublisherImageBackground}.
|
|
53
|
+
*
|
|
54
|
+
* @alpha
|
|
55
|
+
*/
|
|
56
|
+
export function isPublisherImageBackground(obj) {
|
|
57
|
+
return !isEmpty(obj) && obj.type === "image";
|
|
58
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ISO 8601 calendar date (YYYY-MM-DD).
|
|
3
|
+
*
|
|
4
|
+
* @alpha
|
|
5
|
+
*/
|
|
6
|
+
export type PublisherDateString = string;
|
|
7
|
+
/**
|
|
8
|
+
* Variables resolved by the rendering runtime; they are never declared or stored.
|
|
9
|
+
*
|
|
10
|
+
* @remarks
|
|
11
|
+
* Referenced from document text as `{name}`. Custom variable names must not collide with these;
|
|
12
|
+
* on collision the built-in wins.
|
|
13
|
+
*
|
|
14
|
+
* @alpha
|
|
15
|
+
*/
|
|
16
|
+
export type PublisherBuiltInVariable = "reportName" | "reportDescription" | "periodStart" | "periodEnd" | "reportDateRange" | "reportAttributeFilters" | "exportedAt" | "exportedBy" | "lastModifiedAt" | "lastModifiedBy" | "workspaceName" | "workspaceId" | "totalPages" | "currentPageNumber" | "logo";
|
|
17
|
+
/**
|
|
18
|
+
* All built-in document variable names.
|
|
19
|
+
*
|
|
20
|
+
* @alpha
|
|
21
|
+
*/
|
|
22
|
+
export declare const PublisherBuiltInVariables: PublisherBuiltInVariable[];
|
|
23
|
+
/**
|
|
24
|
+
* A custom variable declared by document content and given a value by a document.
|
|
25
|
+
*
|
|
26
|
+
* @remarks
|
|
27
|
+
* Referenced from text as `{name}`. Values come from {@link IPublisherDocumentBase.variableValues},
|
|
28
|
+
* falling back to {@link IPublisherVariableDefinition.defaultValue}.
|
|
29
|
+
*
|
|
30
|
+
* @alpha
|
|
31
|
+
*/
|
|
32
|
+
export interface IPublisherVariableDefinition {
|
|
33
|
+
/**
|
|
34
|
+
* Variable name as used inside the `{...}` marker. Must match /^[a-zA-Z][a-zA-Z0-9_]*$/.
|
|
35
|
+
* Built-in names ({@link PublisherBuiltInVariable}) are reserved.
|
|
36
|
+
*/
|
|
37
|
+
name: string;
|
|
38
|
+
/**
|
|
39
|
+
* Human readable label shown in the editor.
|
|
40
|
+
*/
|
|
41
|
+
title?: string;
|
|
42
|
+
description?: string;
|
|
43
|
+
/**
|
|
44
|
+
* Value used when the document does not provide one. May not contain further
|
|
45
|
+
* placeholders — there is no recursive expansion.
|
|
46
|
+
*/
|
|
47
|
+
defaultValue?: string;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* The marker referencing the named variable from document text.
|
|
51
|
+
*
|
|
52
|
+
* @alpha
|
|
53
|
+
*/
|
|
54
|
+
export declare function publisherTextPlaceholder(name: string): string;
|
|
55
|
+
/**
|
|
56
|
+
* Collects the distinct `{variable}` names referenced in the text, in order of first occurrence.
|
|
57
|
+
*
|
|
58
|
+
* @alpha
|
|
59
|
+
*/
|
|
60
|
+
export declare function getPublisherTextPlaceholders(text: string): string[];
|
|
61
|
+
/**
|
|
62
|
+
* Replaces `{variable}` markers with values. Markers with no value are left as-is.
|
|
63
|
+
* Values are inserted verbatim — there is no recursive expansion.
|
|
64
|
+
*
|
|
65
|
+
* @remarks
|
|
66
|
+
* A marker resolves wherever it appears, braces around it included, so there is no escape for a
|
|
67
|
+
* literal `{name}` in document text.
|
|
68
|
+
*
|
|
69
|
+
* @alpha
|
|
70
|
+
*/
|
|
71
|
+
export declare function resolvePublisherTextPlaceholders(text: string, values: Record<string, string>): string;
|
|
72
|
+
//# sourceMappingURL=variables.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"variables.d.ts","sourceRoot":"","sources":["../../src/publisher/variables.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,MAAM,MAAM,mBAAmB,GAAG,MAAM,CAAC;AAEzC;;;;;;;;GAQG;AACH,MAAM,MAAM,wBAAwB,GAC9B,YAAY,GACZ,mBAAmB,GACnB,aAAa,GACb,WAAW,GACX,iBAAiB,GACjB,wBAAwB,GACxB,YAAY,GACZ,YAAY,GACZ,gBAAgB,GAChB,gBAAgB,GAChB,eAAe,GACf,aAAa,GACb,YAAY,GACZ,mBAAmB,GACnB,MAAM,CAAC;AAEb;;;;GAIG;AACH,eAAO,MAAM,yBAAyB,EAAE,wBAAwB,EAgB/D,CAAC;AAEF;;;;;;;;GAQG;AACH,MAAM,WAAW,4BAA4B;IACzC;;;OAGG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;CACzB;AAID;;;;GAIG;AACH,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAE7D;AAED;;;;GAIG;AACH,wBAAgB,4BAA4B,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CASnE;AAED;;;;;;;;;GASG;AACH,wBAAgB,gCAAgC,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,MAAM,CAIrG"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
// (C) 2026 GoodData Corporation
|
|
2
2
|
/**
|
|
3
|
-
* All built-in
|
|
3
|
+
* All built-in document variable names.
|
|
4
4
|
*
|
|
5
5
|
* @alpha
|
|
6
6
|
*/
|
|
7
|
-
export const
|
|
7
|
+
export const PublisherBuiltInVariables = [
|
|
8
8
|
"reportName",
|
|
9
9
|
"reportDescription",
|
|
10
10
|
"periodStart",
|
|
@@ -23,11 +23,11 @@ export const ReportBuiltInVariables = [
|
|
|
23
23
|
];
|
|
24
24
|
const placeholderRegex = /\{([a-zA-Z][a-zA-Z0-9_]*)\}/g;
|
|
25
25
|
/**
|
|
26
|
-
* The marker referencing the named variable from
|
|
26
|
+
* The marker referencing the named variable from document text.
|
|
27
27
|
*
|
|
28
28
|
* @alpha
|
|
29
29
|
*/
|
|
30
|
-
export function
|
|
30
|
+
export function publisherTextPlaceholder(name) {
|
|
31
31
|
return `{${name}}`;
|
|
32
32
|
}
|
|
33
33
|
/**
|
|
@@ -35,7 +35,7 @@ export function reportTextPlaceholder(name) {
|
|
|
35
35
|
*
|
|
36
36
|
* @alpha
|
|
37
37
|
*/
|
|
38
|
-
export function
|
|
38
|
+
export function getPublisherTextPlaceholders(text) {
|
|
39
39
|
const names = [];
|
|
40
40
|
for (const match of text.matchAll(placeholderRegex)) {
|
|
41
41
|
const name = match[1];
|
|
@@ -51,10 +51,10 @@ export function getReportTextPlaceholders(text) {
|
|
|
51
51
|
*
|
|
52
52
|
* @remarks
|
|
53
53
|
* A marker resolves wherever it appears, braces around it included, so there is no escape for a
|
|
54
|
-
* literal `{name}` in
|
|
54
|
+
* literal `{name}` in document text.
|
|
55
55
|
*
|
|
56
56
|
* @alpha
|
|
57
57
|
*/
|
|
58
|
-
export function
|
|
58
|
+
export function resolvePublisherTextPlaceholders(text, values) {
|
|
59
59
|
return text.replace(placeholderRegex, (marker, name) => Object.prototype.hasOwnProperty.call(values, name) ? values[name] : marker);
|
|
60
60
|
}
|