@simple-reporting/base 1.0.24 → 1.0.25
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/cli.js +5 -1
- package/dev/package.json +6 -1
- package/dev/src/assets/scss/word.scss +44 -1
- package/livingdocs/010.Titles/010.title-h1/scss/word.scss +3 -0
- package/livingdocs/010.Titles/020.title-h2/scss/word.scss +10 -0
- package/livingdocs/010.Titles/030.title-h3/scss/word.scss +10 -0
- package/livingdocs/010.Titles/040.title-h4/scss/word.scss +10 -0
- package/livingdocs/010.Titles/050.title-h5/scss/word.scss +5 -0
- package/livingdocs/010.Titles/060.title-h6/scss/word.scss +5 -0
- package/livingdocs/020.Text/010.lead/scss/word.scss +5 -0
- package/livingdocs/020.Text/020.paragraph/scss/word.scss +5 -0
- package/livingdocs/020.Text/030.paragraph-strong/scss/word.scss +6 -0
- package/livingdocs/020.Text/040.link/scss/word.scss +5 -0
- package/livingdocs/020.Text/050.quote/scss/word.scss +7 -0
- package/livingdocs/020.Text/060.quote-with-portrait/scss/word.scss +7 -0
- package/livingdocs/020.Text/080.footnote-item/scss/word.scss +6 -0
- package/livingdocs/030.Lists/010.unordered-list/scss/general.scss +0 -5
- package/livingdocs/030.Lists/010.unordered-list/scss/word.scss +6 -0
- package/livingdocs/030.Lists/020.ordered-list/scss/word.scss +9 -0
- package/livingdocs/030.Lists/030.alphanumeric-list/scss/word.scss +9 -0
- package/livingdocs/030.Lists/040.list-item/scss/pdf.scss +2 -2
- package/livingdocs/030.Lists/040.list-item/scss/word.scss +19 -0
- package/livingdocs/040.Media/010.table/scss/general.scss +22 -17
- package/livingdocs/040.Media/010.table/scss/word.scss +21 -0
- package/livingdocs/040.Media/020.image/scss/word.scss +5 -0
- package/livingdocs/040.Media/030.video/scss/word.scss +5 -0
- package/livingdocs/040.Media/030.video/video.html +2 -2
- package/livingdocs/060.Buttons/020.button/scss/word.scss +6 -1
- package/livingdocs/080.CV/010.cv/cv.html +7 -7
- package/livingdocs/090.Signatures/010.signature-container/scss/word.scss +5 -0
- package/livingdocs/090.Signatures/020.signature-item/scss/word.scss +6 -0
- package/livingdocs/100.Misc/010.anchor/anchor.html +2 -1
- package/livingdocs/110.PDF/010.pdf-pagebreak/pdf-pagebreak.html +1 -1
- package/livingdocs/110.PDF/010.pdf-pagebreak/scss/word.scss +5 -0
- package/livingdocs/110.PDF/030.pdf-publication-title/pdf-publication-title.html +1 -0
- package/livingdocs/110.PDF/040.pdf-chapter-title/pdf-chapter-title.html +1 -0
- package/livingdocs/110.PDF/050.pdf-chapter-navigation-container/pdf-chapter-navigation.html +1 -0
- package/livingdocs/110.PDF/070.pdf-cover/pdf-cover.html +1 -1
- package/livingdocs/110.PDF/080.pdf-toc-page/pdf-toc-page.html +2 -2
- package/livingdocs/110.PDF/080.pdf-toc-page/scss/editor.scss +2 -2
- package/livingdocs/110.PDF/100.pdf-toc-item/pdf-toc-item.html +3 -3
- package/package.json +1 -1
- package/scripts/build.d.ts +1 -1
- package/scripts/build.js +185 -97
- package/srl/.srl/components/Srl/Article/Root.vue +4 -3
- package/srl/.srl/types/nswow.d.ts +3 -0
package/cli.js
CHANGED
|
@@ -79,8 +79,12 @@ commander
|
|
|
79
79
|
commander
|
|
80
80
|
.command('build')
|
|
81
81
|
.description('Build ldd, app, pdf and word for production')
|
|
82
|
-
.argument('[version]', '
|
|
82
|
+
.argument('[version]', 'Livingdocs version')
|
|
83
83
|
.option('-c, --customer <customer>', 'The customer to build for')
|
|
84
|
+
.option(
|
|
85
|
+
'-t, --target <targets>',
|
|
86
|
+
'Comma separated targets: app,pdf,word,xbrl,ldd (default: all)'
|
|
87
|
+
)
|
|
84
88
|
.action(async (version, options) => {
|
|
85
89
|
await build(version, options);
|
|
86
90
|
});
|
package/dev/package.json
CHANGED
|
@@ -10,6 +10,11 @@
|
|
|
10
10
|
"scripts": {
|
|
11
11
|
"dev": "vite",
|
|
12
12
|
"build": "srl build",
|
|
13
|
+
"build-app": "srl build --target app",
|
|
14
|
+
"build-pdf": "srl build --target pdf",
|
|
15
|
+
"build-word": "srl build --target word",
|
|
16
|
+
"build-xbrl": "srl build --target xbrl",
|
|
17
|
+
"build-ldd": "srl build --target ldd",
|
|
13
18
|
"build-type-check": "run-p type-check \"build {@}\" --",
|
|
14
19
|
"preview": "vite preview",
|
|
15
20
|
"test:unit": "vitest",
|
|
@@ -19,7 +24,7 @@
|
|
|
19
24
|
"postinstall": "srl prepare"
|
|
20
25
|
},
|
|
21
26
|
"dependencies": {
|
|
22
|
-
"@simple-reporting/base": "^1.0.
|
|
27
|
+
"@simple-reporting/base": "^1.0.25",
|
|
23
28
|
"axios": "^1.12.2",
|
|
24
29
|
"chalk": "^5.6.2",
|
|
25
30
|
"exceljs": "^4.4.0",
|
|
@@ -1,2 +1,45 @@
|
|
|
1
1
|
@use 'srl';
|
|
2
|
-
|
|
2
|
+
|
|
3
|
+
.srl-chapter,
|
|
4
|
+
.srl-article {
|
|
5
|
+
page-break-after: always;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.srl-article[class*="srl-category-notes_"],
|
|
9
|
+
.srl-article[class*="srl-category-notes-"],
|
|
10
|
+
.srl-article[class*="srl-category-note_"],
|
|
11
|
+
.srl-article[class*="srl-category-note-"] {
|
|
12
|
+
page-break-after: avoid;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
[class*="srl-category-notes_"] + .srl-article,
|
|
16
|
+
[class*="srl-category-notes-"] + .srl-article,
|
|
17
|
+
[class*="srl-category-note_"] + .srl-article,
|
|
18
|
+
[class*="srl-category-note-"] + .srl-article {
|
|
19
|
+
page-break-after: always;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/*
|
|
23
|
+
Hold titles and the following component on the same page
|
|
24
|
+
*/
|
|
25
|
+
.srl-title-h1,
|
|
26
|
+
.srl-title-h2,
|
|
27
|
+
.srl-title-h3,
|
|
28
|
+
.srl-title-h4,
|
|
29
|
+
.srl-title-h5 {
|
|
30
|
+
& + * {
|
|
31
|
+
page-break-before: avoid;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.srl-article + [class*="srl-category-notes_"],
|
|
36
|
+
.srl-article + [class*="srl-category-notes-"],
|
|
37
|
+
.srl-article + [class*="srl-category-note_"],
|
|
38
|
+
.srl-article + [class*="srl-category-note-"] {
|
|
39
|
+
margin-top: srl.spacer-get(800);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
strong,
|
|
43
|
+
[class*="bold"] {
|
|
44
|
+
font-weight: bold;
|
|
45
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
@use "srl";
|
|
2
|
+
|
|
3
|
+
.srl-list-group__item {
|
|
4
|
+
font-family: 'Arial', sans-serif;
|
|
5
|
+
|
|
6
|
+
&:before {
|
|
7
|
+
.srl-list-group--ul & {
|
|
8
|
+
display: none;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.srl-list-group--ol & {
|
|
12
|
+
display: none;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.srl-list-group--alphanumeric & {
|
|
16
|
+
display: none;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -49,7 +49,7 @@ td {
|
|
|
49
49
|
);
|
|
50
50
|
vertical-align: #{map.get(srl.$meta, table, vertical-align)};
|
|
51
51
|
border-bottom: (
|
|
52
|
-
|
|
52
|
+
srl.system-root-style(srl-table-border-regular-width)
|
|
53
53
|
map.get($table-border-regular, style)
|
|
54
54
|
srl.colors-get(map.get($table-border-regular, color))
|
|
55
55
|
);
|
|
@@ -93,7 +93,7 @@ td {
|
|
|
93
93
|
*/
|
|
94
94
|
&[class*="head"] {
|
|
95
95
|
border-bottom: (
|
|
96
|
-
|
|
96
|
+
srl.system-root-style(srl-table-border-bold-width)
|
|
97
97
|
map.get($table-border-bold, style)
|
|
98
98
|
srl.colors-get(map.get($table-border-bold, color))
|
|
99
99
|
);
|
|
@@ -109,7 +109,7 @@ td {
|
|
|
109
109
|
|
|
110
110
|
&[class*="blinetop"] {
|
|
111
111
|
border-top: (
|
|
112
|
-
|
|
112
|
+
srl.system-root-style(srl-table-border-bold-width)
|
|
113
113
|
map.get($table-border-bold, style)
|
|
114
114
|
srl.colors-get(map.get($table-border-bold, color))
|
|
115
115
|
);
|
|
@@ -117,21 +117,21 @@ td {
|
|
|
117
117
|
|
|
118
118
|
&[class*="nolinetop"] {
|
|
119
119
|
border-top: (
|
|
120
|
-
|
|
120
|
+
srl.system-root-style(srl-table-border-regular-width)
|
|
121
121
|
map.get($table-border-regular, style)
|
|
122
122
|
transparent
|
|
123
123
|
);
|
|
124
124
|
|
|
125
125
|
&[class*="head"] {
|
|
126
126
|
border-top-width: (
|
|
127
|
-
|
|
127
|
+
srl.system-root-style(srl-table-border-regular-width)
|
|
128
128
|
);
|
|
129
129
|
}
|
|
130
130
|
}
|
|
131
131
|
|
|
132
132
|
&[class*="linebottom"] {
|
|
133
133
|
border-bottom: (
|
|
134
|
-
|
|
134
|
+
srl.system-root-style(srl-table-border-regular-width)
|
|
135
135
|
map.get($table-border-regular, style)
|
|
136
136
|
srl.colors-get(map.get($table-border-regular, color))
|
|
137
137
|
);
|
|
@@ -139,7 +139,7 @@ td {
|
|
|
139
139
|
|
|
140
140
|
&[class*="blinebottom"] {
|
|
141
141
|
border-bottom: (
|
|
142
|
-
|
|
142
|
+
srl.system-root-style(srl-table-border-bold-width)
|
|
143
143
|
map.get($table-border-bold, style)
|
|
144
144
|
srl.colors-get(map.get($table-border-bold, color))
|
|
145
145
|
);
|
|
@@ -147,19 +147,19 @@ td {
|
|
|
147
147
|
|
|
148
148
|
&[class*="nolinebottom"] {
|
|
149
149
|
border-bottom: (
|
|
150
|
-
|
|
150
|
+
srl.system-root-style(srl-table-border-regular-width)
|
|
151
151
|
map.get($table-border-regular, style)
|
|
152
152
|
transparent
|
|
153
153
|
);
|
|
154
154
|
|
|
155
155
|
&[class*="head"] {
|
|
156
|
-
border-bottom-width:
|
|
156
|
+
border-bottom-width: srl.system-root-style(srl-table-border-regular-width);
|
|
157
157
|
}
|
|
158
158
|
}
|
|
159
159
|
|
|
160
160
|
&[class*="lineleft"] {
|
|
161
161
|
border-left: (
|
|
162
|
-
|
|
162
|
+
srl.system-root-style(srl-table-border-regular-width)
|
|
163
163
|
map.get($table-border-regular, style)
|
|
164
164
|
srl.colors-get(map.get($table-border-regular, color))
|
|
165
165
|
);
|
|
@@ -167,7 +167,7 @@ td {
|
|
|
167
167
|
|
|
168
168
|
&[class*="blineleft"] {
|
|
169
169
|
border-left: (
|
|
170
|
-
|
|
170
|
+
srl.system-root-style(srl-table-border-bold-width)
|
|
171
171
|
map.get($table-border-bold, style)
|
|
172
172
|
srl.colors-get(map.get($table-border-bold, color))
|
|
173
173
|
);
|
|
@@ -175,7 +175,7 @@ td {
|
|
|
175
175
|
|
|
176
176
|
&[class*="nolineleft"] {
|
|
177
177
|
border-left: (
|
|
178
|
-
|
|
178
|
+
srl.system-root-style(srl-table-border-regular-width)
|
|
179
179
|
map.get($table-border-regular, style)
|
|
180
180
|
transparent
|
|
181
181
|
);
|
|
@@ -183,7 +183,7 @@ td {
|
|
|
183
183
|
|
|
184
184
|
&[class*="lineright"] {
|
|
185
185
|
border-right: (
|
|
186
|
-
|
|
186
|
+
srl.system-root-style(srl-table-border-regular-width)
|
|
187
187
|
map.get($table-border-regular, style)
|
|
188
188
|
srl.colors-get(map.get($table-border-regular, color))
|
|
189
189
|
);
|
|
@@ -191,7 +191,7 @@ td {
|
|
|
191
191
|
|
|
192
192
|
&[class*="blineright"] {
|
|
193
193
|
border-right: (
|
|
194
|
-
|
|
194
|
+
srl.system-root-style(srl-table-border-bold-width)
|
|
195
195
|
map.get($table-border-bold, style)
|
|
196
196
|
srl.colors-get(map.get($table-border-bold, color))
|
|
197
197
|
);
|
|
@@ -199,7 +199,7 @@ td {
|
|
|
199
199
|
|
|
200
200
|
&[class*="nolineleft"] {
|
|
201
201
|
border-right: (
|
|
202
|
-
|
|
202
|
+
srl.system-root-style(srl-table-border-regular-width)
|
|
203
203
|
map.get($table-border-regular, style)
|
|
204
204
|
transparent
|
|
205
205
|
);
|
|
@@ -231,9 +231,14 @@ td {
|
|
|
231
231
|
DEFINE HERE; DIFFERENT CSS CLASSES IN EVERY PROJECT
|
|
232
232
|
*/
|
|
233
233
|
@for $i from 1 through 10 {
|
|
234
|
-
$suffix:
|
|
234
|
+
$suffix: "#{$i}";
|
|
235
|
+
|
|
236
|
+
@if $i < 10 {
|
|
237
|
+
$suffix: "0#{$i}";
|
|
238
|
+
}
|
|
239
|
+
|
|
235
240
|
&[class*="background-#{$suffix}"] {
|
|
236
|
-
background-color:
|
|
241
|
+
background-color: srl.system-root-style(srl-table-background-#{$suffix}, transparent);
|
|
237
242
|
}
|
|
238
243
|
}
|
|
239
244
|
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
@use "srl";
|
|
2
|
+
|
|
3
|
+
.srl-table {
|
|
4
|
+
page-break-inside: avoid;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
th,
|
|
8
|
+
td {
|
|
9
|
+
font-family: 'Arial', sans-serif;
|
|
10
|
+
|
|
11
|
+
&[class*="head"],
|
|
12
|
+
&[class*="bold"],
|
|
13
|
+
&[class*="regular"] {
|
|
14
|
+
font-family: 'Arial', sans-serif;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
&[class*="head"],
|
|
18
|
+
&[class*="bold"] {
|
|
19
|
+
font-weight: bold;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
<div class="srl-video">
|
|
1
|
+
<div class="srl-video" data-remove-from-word="complete">
|
|
2
2
|
<div class="srl-grid srl-grid--media">
|
|
3
3
|
<div class="srl-grid__inner srl-video__inner">
|
|
4
4
|
<srl-ld-video data-remove-from-xbrl="transient" data-remove-from-pdf="transient">
|
|
5
|
-
<div class="srl-video__video-container" doc-html="free-html"
|
|
5
|
+
<div class="srl-video__video-container" doc-html="free-html" data-remove-from-pdf="complete"></div>
|
|
6
6
|
<img class="srl-video__thumbnail" doc-image="video-thumbnail"></img>
|
|
7
7
|
<div class="srl-video__play" data-remove-from-pdf="complete">
|
|
8
8
|
<button class="srl-button srl-has-icon" type="button">
|
|
@@ -8,14 +8,14 @@
|
|
|
8
8
|
</div>
|
|
9
9
|
<div class="srl-cv__header-content">
|
|
10
10
|
<p class="srl-title-h3">
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
<span class="srl-title-h3__text" doc-editable="cv-title-h3">
|
|
12
|
+
Max Mustermann
|
|
13
|
+
</span>
|
|
14
14
|
</p>
|
|
15
15
|
<p class="srl-title-h4">
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
<span class="srl-title-h4__text" doc-editable="cv-title-h4">
|
|
17
|
+
Chairman of the Group Management, Chief Executive Officer (CEO)
|
|
18
|
+
</span>
|
|
19
19
|
</p>
|
|
20
20
|
<p class="srl-paragraph" doc-editable="cv-text-excerpt">
|
|
21
21
|
Swiss, born 1956 <br />
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
<div class="srl-cv__content srl-article-accordion__content">
|
|
28
28
|
<div class="srl-article-accordion__wrapper" doc-container="cv-content"></div>
|
|
29
29
|
</div>
|
|
30
|
-
<div class="srl-grid srl-cv__button-container">
|
|
30
|
+
<div class="srl-grid srl-cv__button-container" data-remove-from-pdf="complete" data-remove-from-word="complete" data-remove-from-xhtml="complete">
|
|
31
31
|
<div class="srl-grid__inner srl-flex srl-justify-self-center">
|
|
32
32
|
<button type="button" class="srl-cv__button srl-article-accordion__toggle">
|
|
33
33
|
<span class="srl-cv__button-more" doc-editable="cv-text-more">
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
<p class="srl-anchor srl-editor-component" data-remove-from-translate-plus="true" data-remove-from-xhtml="complete"
|
|
1
|
+
<p class="srl-anchor srl-editor-component" data-remove-from-translate-plus="true" data-remove-from-xhtml="complete"
|
|
2
|
+
data-is-anchor="true">
|
|
2
3
|
<span class="srl-anchor__text srl-editor-component__text" doc-editable="anchor-text">
|
|
3
4
|
Must start with a letter (A–Z or a–z); a number is not allowed. After the
|
|
4
5
|
first letter, any combination of letters (a–z, A–Z), digits (0–9), hyphens
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<div class="srl-pdf-pagebreak srl-editor-component" data-remove-from-web="complete">
|
|
2
|
-
<span class="srl-pdf-pagebreak__editor-text srl-editor-component__text" data-remove-from-pdf="complete">
|
|
2
|
+
<span class="srl-pdf-pagebreak__editor-text srl-editor-component__text" data-remove-from-pdf="complete" data-remove-from-word="complete">
|
|
3
3
|
PDF page break
|
|
4
4
|
</span>
|
|
5
5
|
</div>
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<p
|
|
2
2
|
class="srl-pdf-publication-title srl-editor-component"
|
|
3
3
|
data-remove-from-web="complete"
|
|
4
|
+
data-remove-from-word="complete"
|
|
4
5
|
>
|
|
5
6
|
<span class="srl-pdf-publication-title__text srl-editor-component__text" doc-editable="pdf-publication-titletext">
|
|
6
7
|
Publication title
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
<div class="srl-pdf-toc-page">
|
|
1
|
+
<div class="srl-pdf-toc-page" data-remove-from-word="complete" data-is-toc-page="true">
|
|
2
2
|
<div class="srl-pdf-toc-page__inner">
|
|
3
3
|
<div class="srl-pdf-toc-page__title" doc-editable="pdf-toc-page-title">
|
|
4
4
|
Chapter title
|
|
5
5
|
</div>
|
|
6
|
-
<div class="srl-pdf-toc-page__toc-container" doc-container="toc"></div>
|
|
6
|
+
<div class="srl-pdf-toc-page__toc-container" doc-container="toc" data-is-toc-container="true"></div>
|
|
7
7
|
</div>
|
|
8
8
|
</div>
|
|
@@ -24,8 +24,8 @@ $page-margin-left: srl.system-size-unit(map.get(srl.$meta, pdf, margin, left));
|
|
|
24
24
|
|
|
25
25
|
display: grid;
|
|
26
26
|
grid-template-columns: repeat(8, 1fr);
|
|
27
|
-
column-gap:
|
|
28
|
-
row-gap:
|
|
27
|
+
column-gap: srl.system-root-style(srl-gutter-column-gap);
|
|
28
|
+
row-gap: srl.system-root-style(srl-gutter-row-gap);
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
.srl-pdf-toc-page__title,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
<a class="srl-pdf-toc__item" doc-link="href" data-page-number="">
|
|
2
|
-
<div class="srl-pdf-toc__text" doc-editable="pdf-toc-item-text">
|
|
1
|
+
<a class="srl-pdf-toc__item" doc-link="href" data-page-number="" data-is-toc-item="true">
|
|
2
|
+
<div class="srl-pdf-toc__text" doc-editable="pdf-toc-item-text" data-is-toc-text="true">
|
|
3
3
|
Article title
|
|
4
4
|
</div>
|
|
5
|
-
<div class="srl-pdf-toc__number" doc-editable="pdf-toc-item-number">1</div>
|
|
5
|
+
<div class="srl-pdf-toc__number" doc-editable="pdf-toc-item-number" data-is-toc-number="true">1</div>
|
|
6
6
|
</a>
|
package/package.json
CHANGED
package/scripts/build.d.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* @param {string} version
|
|
6
6
|
* @return {Promise<void>} A Promise that resolves when the build process is completed or rejects if an error occurs.
|
|
7
7
|
*/
|
|
8
|
-
export function build(version: string, options
|
|
8
|
+
export function build(version: string, options?: {}): Promise<void>;
|
|
9
9
|
/**
|
|
10
10
|
* Builds the project sequentially by executing a series of asynchronous tasks in a specific order.
|
|
11
11
|
* This method is used to build the project in a predetermined sequence.
|
package/scripts/build.js
CHANGED
|
@@ -24,7 +24,7 @@ import folders from './folders.js';
|
|
|
24
24
|
import { mapLdd } from './ldd/mapLdd.js';
|
|
25
25
|
import { LivingdocsDesignValidator } from './ldd/LivingdocsDesignValidator.js';
|
|
26
26
|
import { camelCase } from './utils.js';
|
|
27
|
-
import { buildVariables } from
|
|
27
|
+
import { buildVariables } from './build/variables.js';
|
|
28
28
|
import './dotenv.js';
|
|
29
29
|
|
|
30
30
|
const placeholderId = '6297EAFB-33A0-48B8-8D64-E61CDC3E9035';
|
|
@@ -85,11 +85,11 @@ async function cleanOutput() {
|
|
|
85
85
|
* @returns {Promise<void>} A Promise that resolves when the application is built.
|
|
86
86
|
*/
|
|
87
87
|
async function buildApp() {
|
|
88
|
-
console.log(
|
|
88
|
+
console.log('\n\nBuild application');
|
|
89
89
|
buildVariables.system.environment = 'production';
|
|
90
90
|
buildVariables.system.build = 'app';
|
|
91
91
|
buildVariables.system['size-unit'] = 'rem';
|
|
92
|
-
|
|
92
|
+
|
|
93
93
|
await checkFolders();
|
|
94
94
|
const build = await viteBuild({
|
|
95
95
|
build: {
|
|
@@ -198,7 +198,7 @@ async function buildApp() {
|
|
|
198
198
|
* @returns {Promise<void>} A Promise that resolves when the application is built.
|
|
199
199
|
*/
|
|
200
200
|
async function buildDDev() {
|
|
201
|
-
console.log(
|
|
201
|
+
console.log('\n\nBuild application for DDEV');
|
|
202
202
|
buildVariables.system.environment = 'production';
|
|
203
203
|
buildVariables.system.build = 'app';
|
|
204
204
|
buildVariables.system['size-unit'] = 'rem';
|
|
@@ -221,7 +221,7 @@ async function buildDDev() {
|
|
|
221
221
|
* @returns {Promise<void>} - A Promise that resolves when the zip operation is complete, or rejects with an error.
|
|
222
222
|
*/
|
|
223
223
|
async function zipApp() {
|
|
224
|
-
console.log(
|
|
224
|
+
console.log('\n\nCreate zip file for app');
|
|
225
225
|
await checkFolders();
|
|
226
226
|
const archiver = require('archiver');
|
|
227
227
|
const output = createWriteStream(join(outputPath, 'app.zip'));
|
|
@@ -252,7 +252,7 @@ async function zipApp() {
|
|
|
252
252
|
}
|
|
253
253
|
|
|
254
254
|
async function zipLdd() {
|
|
255
|
-
console.log(
|
|
255
|
+
console.log('\n\nCreate zip file for LDD');
|
|
256
256
|
await checkFolders();
|
|
257
257
|
|
|
258
258
|
const archiver = require('archiver');
|
|
@@ -290,7 +290,7 @@ async function zipLdd() {
|
|
|
290
290
|
* false otherwise.
|
|
291
291
|
*/
|
|
292
292
|
async function buildPdf() {
|
|
293
|
-
console.log(
|
|
293
|
+
console.log('\n\nBuild PDF');
|
|
294
294
|
buildVariables.system.environment = 'production';
|
|
295
295
|
buildVariables.system.build = 'pdf';
|
|
296
296
|
buildVariables.system['size-unit'] = 'rem';
|
|
@@ -326,7 +326,7 @@ async function buildPdf() {
|
|
|
326
326
|
}
|
|
327
327
|
|
|
328
328
|
async function buildXbrl() {
|
|
329
|
-
console.log(
|
|
329
|
+
console.log('\n\nBuild XBRL');
|
|
330
330
|
buildVariables.system.environment = 'production';
|
|
331
331
|
buildVariables.system.build = 'xbrl';
|
|
332
332
|
buildVariables.system['size-unit'] = 'rem';
|
|
@@ -369,7 +369,7 @@ async function buildXbrl() {
|
|
|
369
369
|
* @returns {Promise<boolean>} - A Promise that resolves to true if the LDD build is successful, false otherwise.
|
|
370
370
|
*/
|
|
371
371
|
async function buildLdd(version) {
|
|
372
|
-
console.log(
|
|
372
|
+
console.log('\n\nBuild Livingdocs');
|
|
373
373
|
buildVariables.system.environment = 'production';
|
|
374
374
|
buildVariables.system.build = 'ldd';
|
|
375
375
|
buildVariables.system['size-unit'] = 'rem';
|
|
@@ -433,12 +433,15 @@ async function buildLdd(version) {
|
|
|
433
433
|
}
|
|
434
434
|
}
|
|
435
435
|
|
|
436
|
-
const fontFiles = await glob(
|
|
437
|
-
|
|
438
|
-
|
|
436
|
+
const fontFiles = await glob(
|
|
437
|
+
join(folders.srlAssets, 'fonts', '**', '*.scss'),
|
|
438
|
+
{
|
|
439
|
+
withFileTypes: true,
|
|
440
|
+
},
|
|
441
|
+
);
|
|
439
442
|
|
|
440
443
|
if (fontFiles.length) {
|
|
441
|
-
console.log(
|
|
444
|
+
console.log('\n\nBuild Livingdocs fonts');
|
|
442
445
|
|
|
443
446
|
const importPath = join(folders.srlImports, 'fonts');
|
|
444
447
|
try {
|
|
@@ -449,10 +452,13 @@ async function buildLdd(version) {
|
|
|
449
452
|
const importFile = join(importPath, 'style.scss');
|
|
450
453
|
|
|
451
454
|
const importFonts = [];
|
|
452
|
-
fontFiles.forEach(
|
|
455
|
+
fontFiles.forEach((f) => {
|
|
453
456
|
importFonts.push(`../../../${f.relativePosix()}`);
|
|
454
|
-
})
|
|
455
|
-
await writeFileSync(
|
|
457
|
+
});
|
|
458
|
+
await writeFileSync(
|
|
459
|
+
importFile,
|
|
460
|
+
`@use "` + importFonts.join('" as *;\n@use "') + `" as *;\n`,
|
|
461
|
+
);
|
|
456
462
|
|
|
457
463
|
await viteBuild({
|
|
458
464
|
css: {
|
|
@@ -475,15 +481,15 @@ async function buildLdd(version) {
|
|
|
475
481
|
return '[name][extname]';
|
|
476
482
|
}
|
|
477
483
|
return '[name]-[hash][extname]';
|
|
478
|
-
}
|
|
479
|
-
}
|
|
480
|
-
}
|
|
484
|
+
},
|
|
485
|
+
},
|
|
486
|
+
},
|
|
481
487
|
},
|
|
482
488
|
publicDir: false,
|
|
483
|
-
})
|
|
489
|
+
});
|
|
484
490
|
}
|
|
485
491
|
|
|
486
|
-
console.log(
|
|
492
|
+
console.log('\n\nBuild Livingdocs design.json');
|
|
487
493
|
await writeLivingDocsJson();
|
|
488
494
|
|
|
489
495
|
return true;
|
|
@@ -526,25 +532,43 @@ async function buildPdfCustomer(customer) {
|
|
|
526
532
|
const lddPdfDir = join(folders.srlOutput, 'ldd', 'pdf');
|
|
527
533
|
const lddJson = await readLivingDocsJson();
|
|
528
534
|
|
|
535
|
+
try {
|
|
536
|
+
const wordDir = join(folders.srlOutput, 'word');
|
|
537
|
+
const lddWordDir = join(folders.srlOutput, 'ldd', 'word');
|
|
538
|
+
statSync(wordDir);
|
|
539
|
+
await cpSync(wordDir, lddWordDir, { recursive: true });
|
|
540
|
+
console.log(`Word folder has been copied to ${relative(folders.root, lddWordDir)}`);
|
|
541
|
+
} catch (e) {
|
|
542
|
+
console.error(e)
|
|
543
|
+
}
|
|
544
|
+
|
|
545
|
+
try {
|
|
546
|
+
const xbrlDir = join(folders.srlOutput, 'xbrl');
|
|
547
|
+
const lddXbrlDir = join(folders.srlOutput, 'ldd', 'xbrl');
|
|
548
|
+
statSync(xbrlDir);
|
|
549
|
+
await cpSync(xbrlDir, lddXbrlDir, { recursive: true });
|
|
550
|
+
console.log(`Xbrl folder has been copied to ${relative(folders.root, lddXbrlDir)}`);
|
|
551
|
+
} catch (e) {
|
|
552
|
+
console.error(e)
|
|
553
|
+
}
|
|
554
|
+
|
|
529
555
|
try {
|
|
530
556
|
const pdfDir = join(folders.srlOutput, 'pdf');
|
|
531
557
|
statSync(pdfDir);
|
|
532
558
|
await cpSync(pdfDir, lddPdfDir, { recursive: true });
|
|
533
|
-
console.log(
|
|
559
|
+
console.log(
|
|
560
|
+
`PDF folder has been copied to ${relative(folders.root, lddPdfDir)}`,
|
|
561
|
+
);
|
|
534
562
|
} catch (e) {
|
|
535
|
-
console.error(e)
|
|
563
|
+
console.error(e);
|
|
536
564
|
}
|
|
537
565
|
|
|
538
566
|
try {
|
|
539
567
|
statSync(customerDir);
|
|
540
568
|
const customerTarget = join(lddPdfDir, customerName);
|
|
541
569
|
mkdirSync(customerTarget, { recursive: true });
|
|
542
|
-
const jsReferences = [
|
|
543
|
-
|
|
544
|
-
];
|
|
545
|
-
const cssReferences = [
|
|
546
|
-
'pdf.css'
|
|
547
|
-
];
|
|
570
|
+
const jsReferences = ['pdf.js'];
|
|
571
|
+
const cssReferences = ['pdf.css'];
|
|
548
572
|
|
|
549
573
|
try {
|
|
550
574
|
const tsPath = join(customerDir, 'custom.ts');
|
|
@@ -573,9 +597,9 @@ async function buildPdfCustomer(customer) {
|
|
|
573
597
|
return '[name][extname]';
|
|
574
598
|
}
|
|
575
599
|
return 'assets/[name]-[hash][extname]';
|
|
576
|
-
}
|
|
577
|
-
}
|
|
578
|
-
}
|
|
600
|
+
},
|
|
601
|
+
},
|
|
602
|
+
},
|
|
579
603
|
},
|
|
580
604
|
publicDir: false,
|
|
581
605
|
};
|
|
@@ -599,9 +623,13 @@ async function buildPdfCustomer(customer) {
|
|
|
599
623
|
statSync(publicDir);
|
|
600
624
|
const publicTarget = join(customerTarget, 'public');
|
|
601
625
|
await cpSync(publicDir, publicTarget, { recursive: true });
|
|
602
|
-
console.log(
|
|
626
|
+
console.log(
|
|
627
|
+
`Customer ${customer} public folder has been copied to ${relative(folders.root, publicTarget)}`,
|
|
628
|
+
);
|
|
603
629
|
|
|
604
|
-
const publicFiles = await glob(join(publicTarget, '**', '*'), {
|
|
630
|
+
const publicFiles = await glob(join(publicTarget, '**', '*'), {
|
|
631
|
+
withFileTypes: true,
|
|
632
|
+
});
|
|
605
633
|
|
|
606
634
|
for (const publicFile of publicFiles) {
|
|
607
635
|
if (publicFile.isFile()) {
|
|
@@ -620,35 +648,50 @@ async function buildPdfCustomer(customer) {
|
|
|
620
648
|
const nsWowUrl = `${internalLddUrl}/${lddJson.name}/${lddJson.version}/pdf`;
|
|
621
649
|
|
|
622
650
|
const pdfConfig = [];
|
|
623
|
-
cssReferences.forEach(
|
|
624
|
-
pdfConfig.push(
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
651
|
+
cssReferences.forEach((p) => {
|
|
652
|
+
pdfConfig.push(
|
|
653
|
+
` <userStyleSheets><uri>${nsWowUrl}/${p}</uri></userStyleSheets>`,
|
|
654
|
+
);
|
|
655
|
+
});
|
|
656
|
+
|
|
657
|
+
jsReferences.forEach((p) => {
|
|
658
|
+
pdfConfig.push(
|
|
659
|
+
` <userScripts><beforeDocumentScripts>true</beforeDocumentScripts><uri>${nsWowUrl}/${p}</uri></userScripts>`,
|
|
660
|
+
);
|
|
661
|
+
});
|
|
662
|
+
|
|
663
|
+
const pdfConfigContent =
|
|
664
|
+
pdfXmlStart +
|
|
665
|
+
` <appendLog>false</appendLog>\n` +
|
|
666
|
+
pdfConfig.join('\n') +
|
|
667
|
+
pdfXmlEnd;
|
|
635
668
|
const pdfConfigPath = join(customerTarget, 'pdf-configuration.xml');
|
|
636
669
|
writeFileSync(pdfConfigPath, pdfConfigContent);
|
|
637
|
-
console.log(
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
+
|
|
643
|
-
+
|
|
644
|
-
+
|
|
645
|
-
|
|
670
|
+
console.log(
|
|
671
|
+
`Customer ${customer} PDF configuration file has been built to ${relative(folders.root, pdfConfigPath)}`,
|
|
672
|
+
);
|
|
673
|
+
|
|
674
|
+
const pdfConfigDebugContent =
|
|
675
|
+
pdfXmlStart +
|
|
676
|
+
` <appendLog>true</appendLog>\n` +
|
|
677
|
+
` <inspectableSettings><enabled>true</enabled></inspectableSettings>\n` +
|
|
678
|
+
` <debugSettings><all>true</all></debugSettings>\n` +
|
|
679
|
+
pdfConfig.join('\n') +
|
|
680
|
+
pdfXmlEnd;
|
|
681
|
+
const pdfConfigDebugPath = join(
|
|
682
|
+
customerTarget,
|
|
683
|
+
'pdf-configuration-debug.xml',
|
|
684
|
+
);
|
|
646
685
|
writeFileSync(pdfConfigDebugPath, pdfConfigDebugContent);
|
|
647
|
-
console.log(
|
|
686
|
+
console.log(
|
|
687
|
+
`Customer ${customer} PDF debug configuration file has been built to ${relative(folders.root, pdfConfigDebugPath)}`,
|
|
688
|
+
);
|
|
648
689
|
|
|
649
|
-
console.log(
|
|
690
|
+
console.log(
|
|
691
|
+
`Customer ${customer} PDF files has been built to ${relative(folders.root, customerTarget)}`,
|
|
692
|
+
);
|
|
650
693
|
|
|
651
|
-
console.log(
|
|
694
|
+
console.log('\n');
|
|
652
695
|
} catch (e) {}
|
|
653
696
|
|
|
654
697
|
return true;
|
|
@@ -662,7 +705,7 @@ async function buildPdfCustomer(customer) {
|
|
|
662
705
|
* or false if there was an error during the build process.
|
|
663
706
|
*/
|
|
664
707
|
async function buildWord() {
|
|
665
|
-
console.log(
|
|
708
|
+
console.log('\n\nBuild Word');
|
|
666
709
|
buildVariables.system.environment = 'production';
|
|
667
710
|
buildVariables.system.build = 'word';
|
|
668
711
|
buildVariables.system['size-unit'] = 'pt';
|
|
@@ -703,33 +746,68 @@ async function buildWord() {
|
|
|
703
746
|
* @param {string} version
|
|
704
747
|
* @return {Promise<void>} A Promise that resolves when the build process is completed or rejects if an error occurs.
|
|
705
748
|
*/
|
|
706
|
-
async function build(version, options) {
|
|
707
|
-
|
|
749
|
+
async function build(version, options = {}) {
|
|
708
750
|
try {
|
|
709
751
|
await checkFolders();
|
|
752
|
+
|
|
710
753
|
const packageJson = await readPackageJson();
|
|
711
754
|
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
755
|
+
// target option for separate build
|
|
756
|
+
const targetsString = options.target || 'app,pdf,word,xbrl,ldd';
|
|
757
|
+
const targets = targetsString
|
|
758
|
+
.split(',')
|
|
759
|
+
.map((t) => t.trim())
|
|
760
|
+
.filter(Boolean);
|
|
761
|
+
const has = (name) => targets.includes(name);
|
|
762
|
+
|
|
763
|
+
if (has('ldd')) {
|
|
764
|
+
if (!version) {
|
|
765
|
+
const prompt = new Input({
|
|
766
|
+
message: 'Livingdocs version',
|
|
767
|
+
initial: packageJson.version,
|
|
768
|
+
});
|
|
769
|
+
version = await prompt.run();
|
|
770
|
+
}
|
|
771
|
+
|
|
772
|
+
packageJson.version = version;
|
|
773
|
+
await writePackageJson();
|
|
718
774
|
}
|
|
719
775
|
|
|
720
|
-
|
|
721
|
-
await writePackageJson();
|
|
776
|
+
|
|
722
777
|
|
|
723
778
|
await cleanOutput();
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
779
|
+
|
|
780
|
+
if (has('app')) {
|
|
781
|
+
await buildApp();
|
|
782
|
+
}
|
|
783
|
+
|
|
784
|
+
if (has('pdf')) {
|
|
785
|
+
await buildPdf();
|
|
786
|
+
}
|
|
787
|
+
|
|
788
|
+
if (has('word')) {
|
|
789
|
+
await buildWord();
|
|
790
|
+
}
|
|
791
|
+
|
|
792
|
+
if (has('xbrl') || has('xhtml')) {
|
|
793
|
+
await buildXbrl();
|
|
794
|
+
}
|
|
795
|
+
|
|
796
|
+
if (has('ldd')) {
|
|
797
|
+
await buildLdd();
|
|
798
|
+
|
|
799
|
+
const livingdocsJson = await readLivingDocsJson();
|
|
800
|
+
new LivingdocsDesignValidator(livingdocsJson).IsDesignValid();
|
|
801
|
+
await zipLdd();
|
|
802
|
+
}
|
|
803
|
+
|
|
804
|
+
if (has('pdf') && options.customer) {
|
|
805
|
+
await buildPdfCustomer(options.customer);
|
|
806
|
+
}
|
|
807
|
+
|
|
808
|
+
if (has('app')) {
|
|
809
|
+
await zipApp();
|
|
810
|
+
}
|
|
733
811
|
} catch (error) {
|
|
734
812
|
console.log(error);
|
|
735
813
|
}
|
|
@@ -773,45 +851,53 @@ async function mapScss() {
|
|
|
773
851
|
|
|
774
852
|
const output = {
|
|
775
853
|
app: [
|
|
776
|
-
|
|
777
|
-
|
|
854
|
+
`"../../srl/config" as *`,
|
|
855
|
+
`"@simple-reporting/base/scss/init-root.scss" as *`,
|
|
778
856
|
],
|
|
779
857
|
ldd: [
|
|
780
|
-
|
|
781
|
-
|
|
858
|
+
`"../../srl/config" as *`,
|
|
859
|
+
`"@simple-reporting/base/scss/init-root.scss" as *`,
|
|
782
860
|
],
|
|
783
861
|
pdf: [
|
|
784
|
-
|
|
785
|
-
|
|
862
|
+
`"../../srl/config" as *`,
|
|
863
|
+
`"@simple-reporting/base/scss/init-root.scss" as *`,
|
|
786
864
|
],
|
|
787
865
|
word: [
|
|
788
|
-
|
|
789
|
-
|
|
866
|
+
`"../../srl/config" as *`,
|
|
867
|
+
`"@simple-reporting/base/scss/init-root.scss" as *`,
|
|
790
868
|
],
|
|
791
869
|
xbrl: [
|
|
792
|
-
|
|
793
|
-
|
|
870
|
+
`"../../srl/config" as *`,
|
|
871
|
+
`"@simple-reporting/base/scss/init-root.scss" as *`,
|
|
794
872
|
],
|
|
795
873
|
};
|
|
796
874
|
|
|
797
|
-
const fontFiles = await glob(
|
|
798
|
-
|
|
799
|
-
|
|
875
|
+
const fontFiles = await glob(
|
|
876
|
+
join(folders.srlAssets, 'fonts', '**', '*.scss'),
|
|
877
|
+
{
|
|
878
|
+
withFileTypes: true,
|
|
879
|
+
},
|
|
880
|
+
);
|
|
800
881
|
|
|
801
|
-
const fontsOutput = []
|
|
882
|
+
const fontsOutput = [];
|
|
802
883
|
|
|
803
884
|
if (fontFiles.length) {
|
|
804
|
-
fontsOutput.push(
|
|
805
|
-
|
|
885
|
+
fontsOutput.push(
|
|
886
|
+
`@import "${internalLddUrl}/${packageJson.name}/${packageJson.version}/fonts/style.css";`,
|
|
887
|
+
);
|
|
888
|
+
fontFiles.forEach((f) => {
|
|
806
889
|
output.app.push(`"${relativePathToRoot}${f.relativePosix()}" as *`);
|
|
807
890
|
output.xbrl.push(`"${relativePathToRoot}${f.relativePosix()}" as *`);
|
|
808
|
-
})
|
|
891
|
+
});
|
|
809
892
|
output.ldd.push(`"./fonts.scss" as *`);
|
|
810
893
|
output.pdf.push(`"./fonts.scss" as *`);
|
|
811
894
|
output.word.push(`"./fonts.scss" as *`);
|
|
812
895
|
}
|
|
813
896
|
|
|
814
|
-
await writeFileSync(
|
|
897
|
+
await writeFileSync(
|
|
898
|
+
join(folders.srlImports, 'fonts.scss'),
|
|
899
|
+
fontsOutput.join('\n'),
|
|
900
|
+
);
|
|
815
901
|
|
|
816
902
|
const mainFiles = await glob(join(folders.srlAssets, 'scss', '*.scss'), {
|
|
817
903
|
withFileTypes: true,
|
|
@@ -950,7 +1036,9 @@ async function mapScss() {
|
|
|
950
1036
|
|
|
951
1037
|
await writeFileSync(
|
|
952
1038
|
join(folders.srlImports, 'xbrl.scss'),
|
|
953
|
-
`@use ` +
|
|
1039
|
+
`@use ` +
|
|
1040
|
+
output.xbrl.join(`;\n@use `) +
|
|
1041
|
+
`;\n@use "@simple-reporting/base/scss/xbrl-core-styles.scss" as *;\n`,
|
|
954
1042
|
);
|
|
955
1043
|
|
|
956
1044
|
return true;
|
|
@@ -32,24 +32,25 @@ import { nextTick, ref, onMounted } from 'vue';
|
|
|
32
32
|
import VRuntimeTemplate from 'vue3-runtime-template';
|
|
33
33
|
import Autoload from '@/Autoload.ts';
|
|
34
34
|
import { useRoute } from 'vue-router';
|
|
35
|
-
import { useArticle,
|
|
35
|
+
import { useArticle, useConfig } from '#composables';
|
|
36
36
|
import { prepareHtmlContent } from '#utils';
|
|
37
37
|
|
|
38
38
|
const articleRoot = ref<HTMLDivElement | null>(null);
|
|
39
39
|
const config = useConfig();
|
|
40
40
|
const route = useRoute();
|
|
41
|
-
const articles = useArticles();
|
|
42
41
|
const content = ref<string>('');
|
|
43
42
|
const locale = route.params.locale as string;
|
|
44
43
|
const article = useArticle();
|
|
45
44
|
|
|
46
45
|
if (article.value) {
|
|
47
46
|
const file = `./html/${locale}/${article.value.name}.html`;
|
|
47
|
+
const publicationTitle = config.value.settings.publicationName[locale];
|
|
48
|
+
|
|
48
49
|
try {
|
|
49
50
|
const req = await fetch(file);
|
|
50
51
|
let text = await req.text();
|
|
51
52
|
|
|
52
|
-
document.title = article.value.translatedTitle
|
|
53
|
+
document.title = `${article.value.translatedTitle} - ${publicationTitle}`;
|
|
53
54
|
content.value = prepareHtmlContent(text);
|
|
54
55
|
} catch (error) {
|
|
55
56
|
console.error(`Failed to load article content from ${file}:`, error);
|