@simple-reporting/base 1.0.22 → 1.0.24
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/dev/index.html +1 -1
- package/dev/livingdocs.config.json +6 -6
- package/dev/package.json +1 -1
- package/dev/src/Dialog.vue +3 -0
- package/dev/src/assets/scss/general.scss +1 -0
- package/dev/src/assets/scss/pdf.scss +13 -0
- package/dev/src/entries/pdf.ts +14 -1
- package/dev/srl.config.json +21 -0
- package/livingdocs/040.Media/010.table/scss/pdf.scss +20 -0
- package/livingdocs/080.CV/010.cv/cv.html +34 -32
- package/livingdocs/100.Misc/010.anchor/anchor.html +1 -1
- package/livingdocs/100.Misc/020.accordion/accordion.html +7 -5
- package/livingdocs/110.PDF/100.pdf-toc-item/scss/general.scss +1 -1
- package/package.json +2 -1
- package/scripts/beaver.js +14 -18
- package/scripts/build/variables.d.ts +6 -0
- package/scripts/build/variables.js +6 -0
- package/scripts/build.js +56 -16
- package/scripts/dotenv.d.ts +1 -0
- package/scripts/dotenv.js +8 -0
- package/scripts/init.js +1 -1
- package/scripts/ldd/mapLdd.js +2 -2
- package/scripts/utils.d.ts +1 -0
- package/scripts/utils.js +22 -0
- package/scss/colors/functions.scss +2 -10
- package/scss/colors/mixins.scss +0 -18
- package/scss/colors/root.scss +10 -0
- package/scss/core-styles.scss +4 -1
- package/scss/fonts/root.scss +4 -0
- package/scss/grid/functions.scss +8 -6
- package/scss/grid/mixins.scss +0 -77
- package/scss/grid/root.scss +80 -0
- package/scss/helpers/root.scss +4 -0
- package/scss/init-root.scss +12 -0
- package/scss/meta/root.scss +4 -0
- package/scss/spacer/functions.scss +2 -1
- package/scss/spacer/mixins.scss +0 -52
- package/scss/spacer/root.scss +55 -0
- package/scss/system/functions.scss +70 -5
- package/scss/system/root.scss +0 -3
- package/scss/system/variables.scss +1 -0
- package/scss/typography/functions.scss +12 -12
- package/scss/typography/mixins.scss +0 -221
- package/scss/typography/root.scss +226 -0
- package/srl/.srl/App.vue +9 -5
- package/srl/.srl/components/Srl/Article/Accordion.vue +106 -0
- package/srl/.srl/components/Srl/Article/Dialog/Button.vue +39 -18
- package/srl/.srl/components/Srl/Category/Accordion.vue +32 -4
- package/srl/.srl/components/Srl/Page/Dialog.vue +17 -19
- package/srl/.srl/plugins/initProject.ts +12 -7
- package/srl/.srl/utils/html.ts +71 -62
- package/srl/.srl/utils/index.ts +28 -1
- package/srl/.srl/utils/pageState.ts +61 -0
- package/srl/srl/pdf/PDFNotes.ts +71 -0
- package/srl/srl/pdf/PDFSetPageNumbers.ts +25 -0
- package/srl/srl/pdf.scss +0 -2
- /package/srl/srl/{Awesomizr.js → pdf/Awesomizr.js} +0 -0
package/dev/index.html
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
>this page requires javascript to work properly. please enable javascript in your
|
|
13
13
|
browser</noscript
|
|
14
14
|
>
|
|
15
|
-
<div id="app" class="
|
|
15
|
+
<div id="app" class="srl-page"></div>
|
|
16
16
|
<script type="module" src="src/entries/main.ts"></script>
|
|
17
17
|
</body>
|
|
18
18
|
</html>
|
|
@@ -110,24 +110,24 @@
|
|
|
110
110
|
"identifier": "wp_cf_prettyTitle",
|
|
111
111
|
"type": "text",
|
|
112
112
|
"matches": [
|
|
113
|
-
"title-h1.title-h1
|
|
113
|
+
"title-h1.title-h1",
|
|
114
114
|
"title-h2.title-h2-text",
|
|
115
115
|
"title-h3.title-h3-text",
|
|
116
116
|
"title-h4.title-h4-text",
|
|
117
|
-
"title-h5.title-h5
|
|
118
|
-
"title-h6.title-h6
|
|
117
|
+
"title-h5.title-h5",
|
|
118
|
+
"title-h6.title-h6"
|
|
119
119
|
]
|
|
120
120
|
},
|
|
121
121
|
{
|
|
122
122
|
"identifier": "menuTitle",
|
|
123
123
|
"type": "text",
|
|
124
124
|
"matches": [
|
|
125
|
-
"title-h1.title-h1
|
|
125
|
+
"title-h1.title-h1",
|
|
126
126
|
"title-h2.title-h2-text",
|
|
127
127
|
"title-h3.title-h3-text",
|
|
128
128
|
"title-h4.title-h4-text",
|
|
129
|
-
"title-h5.title-h5
|
|
130
|
-
"title-h6.title-h6
|
|
129
|
+
"title-h5.title-h5",
|
|
130
|
+
"title-h6.title-h6"
|
|
131
131
|
]
|
|
132
132
|
},
|
|
133
133
|
{
|
package/dev/package.json
CHANGED
package/dev/src/Dialog.vue
CHANGED
|
@@ -85,6 +85,19 @@ img {
|
|
|
85
85
|
}
|
|
86
86
|
}
|
|
87
87
|
|
|
88
|
+
/*
|
|
89
|
+
Hold titles and the following component on the same page
|
|
90
|
+
*/
|
|
91
|
+
.srl-title-h1,
|
|
92
|
+
.srl-title-h2,
|
|
93
|
+
.srl-title-h3,
|
|
94
|
+
.srl-title-h4,
|
|
95
|
+
.srl-title-h5 {
|
|
96
|
+
& + * {
|
|
97
|
+
break-before: avoid;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
88
101
|
/*
|
|
89
102
|
Layout
|
|
90
103
|
*/
|
package/dev/src/entries/pdf.ts
CHANGED
|
@@ -1,2 +1,15 @@
|
|
|
1
1
|
import '#imports/pdf.scss'
|
|
2
|
-
import * as Awesomizr from 'srl/Awesomizr.js'
|
|
2
|
+
import * as Awesomizr from 'srl/pdf/Awesomizr.js'
|
|
3
|
+
import * as PDFNotes from 'srl/pdf/PDFNotes.ts'
|
|
4
|
+
import * as PDFSetPageNumbers from 'srl/pdf/PDFSetPageNumbers.ts';
|
|
5
|
+
|
|
6
|
+
document.addEventListener('DOMContentLoaded', () => {
|
|
7
|
+
new PDFNotes({
|
|
8
|
+
noteClass: '.srl-category-notes_group, .srl-category-notes_holding'
|
|
9
|
+
})
|
|
10
|
+
|
|
11
|
+
new PDFSetPageNumbers({
|
|
12
|
+
tocItemClass: '.srl-pdf-toc__item:not(.srl-pdf-toc__item--blank)',
|
|
13
|
+
tocItemPageNumberClass: '.srl-pdf-toc__number'
|
|
14
|
+
});
|
|
15
|
+
})
|
package/dev/srl.config.json
CHANGED
|
@@ -744,6 +744,27 @@
|
|
|
744
744
|
}
|
|
745
745
|
}
|
|
746
746
|
},
|
|
747
|
+
{
|
|
748
|
+
"name": "toc-item",
|
|
749
|
+
"font-family": "Inter",
|
|
750
|
+
"font-size": 14,
|
|
751
|
+
"line-height": 1.5,
|
|
752
|
+
"font-style": "normal",
|
|
753
|
+
"font-weight": 600,
|
|
754
|
+
"color": "black-1000",
|
|
755
|
+
"letter-spacing": 0,
|
|
756
|
+
"media": {
|
|
757
|
+
"print": {
|
|
758
|
+
"font-size": "9pt",
|
|
759
|
+
"line-height": 1.444
|
|
760
|
+
},
|
|
761
|
+
"up": {
|
|
762
|
+
"tablet-pt": {
|
|
763
|
+
"font-size": 16
|
|
764
|
+
}
|
|
765
|
+
}
|
|
766
|
+
}
|
|
767
|
+
},
|
|
747
768
|
{
|
|
748
769
|
"name": "editor-label-text",
|
|
749
770
|
"font-family": "Inter",
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
@use 'srl';
|
|
2
2
|
@use 'sass:map';
|
|
3
3
|
|
|
4
|
+
$table-cells-width-in-mm: false;
|
|
5
|
+
|
|
6
|
+
.srl-table {
|
|
7
|
+
break-inside: avoid;
|
|
8
|
+
}
|
|
9
|
+
|
|
4
10
|
.srl-table__container > div {
|
|
5
11
|
display: flex;
|
|
6
12
|
flex-direction: column;
|
|
@@ -15,6 +21,20 @@
|
|
|
15
21
|
}
|
|
16
22
|
}
|
|
17
23
|
|
|
24
|
+
@if $table-cells-width-in-mm == true {
|
|
25
|
+
.srl-table-container {
|
|
26
|
+
width: 100%;
|
|
27
|
+
display: flex;
|
|
28
|
+
flex-direction: column;
|
|
29
|
+
align-items: flex-end;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
table {
|
|
33
|
+
width: fit-content;
|
|
34
|
+
min-width: unset;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
18
38
|
tr {
|
|
19
39
|
&[class*="pagebreak"] {
|
|
20
40
|
break-after: always;
|
|
@@ -1,40 +1,42 @@
|
|
|
1
|
-
<
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
<srl-article-accordion class="srl-cv" data-replace-tag="div">
|
|
2
|
+
<div class="srl-grid srl-cv__header">
|
|
3
|
+
<div class="srl-grid__inner srl-cv__inner">
|
|
4
|
+
<div class="srl-cv__header-portrait">
|
|
5
|
+
<figure class="srl-cv__figure">
|
|
6
|
+
<img class="srl-cv__img" doc-image="image" />
|
|
7
|
+
</figure>
|
|
8
|
+
</div>
|
|
9
|
+
<div class="srl-cv__header-content">
|
|
10
|
+
<p class="srl-title-h3">
|
|
11
11
|
<span class="srl-title-h3__text" doc-editable="cv-title-h3">
|
|
12
12
|
Max Mustermann
|
|
13
13
|
</span>
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
</p>
|
|
15
|
+
<p class="srl-title-h4">
|
|
16
16
|
<span class="srl-title-h4__text" doc-editable="cv-title-h4">
|
|
17
17
|
Chairman of the Group Management, Chief Executive Officer (CEO)
|
|
18
18
|
</span>
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
19
|
+
</p>
|
|
20
|
+
<p class="srl-paragraph" doc-editable="cv-text-excerpt">
|
|
21
|
+
Swiss, born 1956 <br />
|
|
22
|
+
Appointed in 2018
|
|
23
|
+
</p>
|
|
24
|
+
</div>
|
|
25
|
+
</div>
|
|
25
26
|
</div>
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
<div class="srl-grid srl-cv__button-container">
|
|
29
|
-
<div class="srl-grid__inner srl-flex srl-justify-self-center">
|
|
30
|
-
<button type="button" class="srl-cv__button">
|
|
31
|
-
<span class="srl-cv__button-more" doc-editable="cv-text-more">
|
|
32
|
-
Read more
|
|
33
|
-
</span>
|
|
34
|
-
<span class="srl-cv__button-close" doc-editable="cv-text-close">
|
|
35
|
-
close
|
|
36
|
-
</span>
|
|
37
|
-
</button>
|
|
27
|
+
<div class="srl-cv__content srl-article-accordion__content">
|
|
28
|
+
<div class="srl-article-accordion__wrapper" doc-container="cv-content"></div>
|
|
38
29
|
</div>
|
|
39
|
-
|
|
40
|
-
|
|
30
|
+
<div class="srl-grid srl-cv__button-container">
|
|
31
|
+
<div class="srl-grid__inner srl-flex srl-justify-self-center">
|
|
32
|
+
<button type="button" class="srl-cv__button srl-article-accordion__toggle">
|
|
33
|
+
<span class="srl-cv__button-more" doc-editable="cv-text-more">
|
|
34
|
+
Read more
|
|
35
|
+
</span>
|
|
36
|
+
<span class="srl-cv__button-close" doc-editable="cv-text-close">
|
|
37
|
+
close
|
|
38
|
+
</span>
|
|
39
|
+
</button>
|
|
40
|
+
</div>
|
|
41
|
+
</div>
|
|
42
|
+
</srl-article-accordion>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<p class="srl-anchor srl-editor-component" data-is-anchor="true">
|
|
1
|
+
<p class="srl-anchor srl-editor-component" data-remove-from-translate-plus="true" data-remove-from-xhtml="complete" data-is-anchor="true">
|
|
2
2
|
<span class="srl-anchor__text srl-editor-component__text" doc-editable="anchor-text">
|
|
3
3
|
Must start with a letter (A–Z or a–z); a number is not allowed. After the
|
|
4
4
|
first letter, any combination of letters (a–z, A–Z), digits (0–9), hyphens
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
<
|
|
1
|
+
<srl-article-accordion class="srl-accordion" data-replace-tag="div">
|
|
2
2
|
<div class="srl-accordion__inner">
|
|
3
|
-
<div class="srl-accordion__head"
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
<div class="srl-accordion__head">
|
|
4
|
+
<button class="srl-accordion__toggle srl-article-accordion__toggle" type="button" data-replace-tag="div" doc-container="header"></button>
|
|
5
|
+
</div>
|
|
6
|
+
<div class="srl-accordion__content srl-article-accordion__content">
|
|
7
|
+
<div class="srl-accordion__content-inner srl-article-accordion__wrapper" doc-container="content"></div>
|
|
6
8
|
</div>
|
|
7
9
|
</div>
|
|
8
|
-
</
|
|
10
|
+
</srl-article-accordion>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@simple-reporting/base",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.24",
|
|
4
4
|
"description": "Manage srl templates, build and publish",
|
|
5
5
|
"bin": {
|
|
6
6
|
"srl": "cli.js"
|
|
@@ -22,6 +22,7 @@
|
|
|
22
22
|
"chalk": "^5.6.2",
|
|
23
23
|
"colors": "^1.4.0",
|
|
24
24
|
"commander": "^11.1.0",
|
|
25
|
+
"dotenv": "^17.2.3",
|
|
25
26
|
"enquirer": "^2.4.1",
|
|
26
27
|
"fs": "^0.0.1-security",
|
|
27
28
|
"fs-extra": "^11.3.2",
|
package/scripts/beaver.js
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { writeFileSync, readFileSync } from 'node:fs';
|
|
2
2
|
import path from 'node:path/posix';
|
|
3
3
|
import { colors } from './colors.js';
|
|
4
|
-
import { readNsWowJson } from './utils.js';
|
|
4
|
+
import { readNsWowJson, deepAssign } from './utils.js';
|
|
5
5
|
import colorPalette from '@kne/color-palette';
|
|
6
6
|
import folders from './folders.js';
|
|
7
|
+
import { buildVariables } from "./build/variables.js";
|
|
8
|
+
|
|
7
9
|
/**
|
|
8
10
|
* Maps the values of an object or array recursively.
|
|
9
11
|
*
|
|
@@ -176,24 +178,18 @@ async function beaver(verbose = 0) {
|
|
|
176
178
|
verbose = verbose ? 1 : 0;
|
|
177
179
|
}
|
|
178
180
|
|
|
179
|
-
|
|
180
|
-
configJson.system = {};
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
if (typeof configJson.system.environment === 'undefined') {
|
|
184
|
-
configJson.system.environment = process.env.NODE_ENV;
|
|
185
|
-
}
|
|
181
|
+
const configAssigned = deepAssign(configJson, buildVariables);
|
|
186
182
|
|
|
187
|
-
if (typeof
|
|
188
|
-
const fontBasePath =
|
|
183
|
+
if (typeof configAssigned.fonts !== 'undefined') {
|
|
184
|
+
const fontBasePath = configAssigned.fonts['font-base-path'] ?? '';
|
|
189
185
|
if (fontBasePath.length) {
|
|
190
|
-
|
|
186
|
+
configAssigned.fonts['font-base-path'] = '.' + path.normalize(fontBasePath);
|
|
191
187
|
}
|
|
192
|
-
if (typeof
|
|
193
|
-
for (let x = 0; x <
|
|
194
|
-
let font =
|
|
188
|
+
if (typeof configAssigned.fonts.fonts !== 'undefined') {
|
|
189
|
+
for (let x = 0; x < configAssigned.fonts.fonts.length; x++) {
|
|
190
|
+
let font = configAssigned.fonts.fonts[x];
|
|
195
191
|
if (typeof font === 'string') {
|
|
196
|
-
|
|
192
|
+
configAssigned.fonts.fonts[x] = JSON.parse(
|
|
197
193
|
readFileSync(
|
|
198
194
|
path.join(process.cwd(), fontBasePath, font, 'styles.json'),
|
|
199
195
|
),
|
|
@@ -205,10 +201,10 @@ async function beaver(verbose = 0) {
|
|
|
205
201
|
|
|
206
202
|
const map = {};
|
|
207
203
|
|
|
208
|
-
for (const file in
|
|
204
|
+
for (const file in configAssigned) {
|
|
209
205
|
map[file] = {};
|
|
210
|
-
for (const variable in
|
|
211
|
-
map[file][variable] = mapValues(
|
|
206
|
+
for (const variable in configAssigned[file]) {
|
|
207
|
+
map[file][variable] = mapValues(configAssigned[file][variable]);
|
|
212
208
|
}
|
|
213
209
|
}
|
|
214
210
|
|
package/scripts/build.js
CHANGED
|
@@ -24,6 +24,8 @@ 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 "./build/variables.js";
|
|
28
|
+
import './dotenv.js';
|
|
27
29
|
|
|
28
30
|
const placeholderId = '6297EAFB-33A0-48B8-8D64-E61CDC3E9035';
|
|
29
31
|
const nswowPath = folders.srlImports;
|
|
@@ -84,6 +86,10 @@ async function cleanOutput() {
|
|
|
84
86
|
*/
|
|
85
87
|
async function buildApp() {
|
|
86
88
|
console.log("\n\nBuild application");
|
|
89
|
+
buildVariables.system.environment = 'production';
|
|
90
|
+
buildVariables.system.build = 'app';
|
|
91
|
+
buildVariables.system['size-unit'] = 'rem';
|
|
92
|
+
|
|
87
93
|
await checkFolders();
|
|
88
94
|
const build = await viteBuild({
|
|
89
95
|
build: {
|
|
@@ -101,7 +107,7 @@ async function buildApp() {
|
|
|
101
107
|
|
|
102
108
|
// Copy public folder exclude nswow folders
|
|
103
109
|
console.log(
|
|
104
|
-
'\n\nCopy public folder exclude nswow folders and exclude folder',
|
|
110
|
+
'\n\nCopy public folder exclude nswow folders and assets, template, exclude folder and index.html',
|
|
105
111
|
);
|
|
106
112
|
await cpSync(join(folders.srlPublic, '/'), join(outputPath, 'app'), {
|
|
107
113
|
filter: (src) => {
|
|
@@ -110,7 +116,10 @@ async function buildApp() {
|
|
|
110
116
|
src.startsWith(join(folders.srlPublic, 'html')) ||
|
|
111
117
|
src.startsWith(join(folders.srlPublic, 'images')) ||
|
|
112
118
|
src.startsWith(join(folders.srlPublic, 'json')) ||
|
|
113
|
-
src.startsWith(join(folders.srlPublic, 'exclude'))
|
|
119
|
+
src.startsWith(join(folders.srlPublic, 'exclude')) ||
|
|
120
|
+
src.startsWith(join(folders.srlPublic, 'assets')) ||
|
|
121
|
+
src.startsWith(join(folders.srlPublic, 'template')) ||
|
|
122
|
+
src.startsWith(join(folders.srlPublic, 'index.html'))
|
|
114
123
|
) {
|
|
115
124
|
return false;
|
|
116
125
|
} else {
|
|
@@ -144,9 +153,7 @@ async function buildApp() {
|
|
|
144
153
|
index = index.replace(
|
|
145
154
|
/(<div\s+[^>]*id\s*=\s*["']app["'][^>]*>)([\s\S]*?)(<\/div>)/i,
|
|
146
155
|
`$1
|
|
147
|
-
|
|
148
|
-
[[content-${placeholderId}]]
|
|
149
|
-
</template>
|
|
156
|
+
[[content-${placeholderId}]]
|
|
150
157
|
$3`,
|
|
151
158
|
);
|
|
152
159
|
|
|
@@ -192,6 +199,10 @@ async function buildApp() {
|
|
|
192
199
|
*/
|
|
193
200
|
async function buildDDev() {
|
|
194
201
|
console.log("\n\nBuild application for DDEV");
|
|
202
|
+
buildVariables.system.environment = 'production';
|
|
203
|
+
buildVariables.system.build = 'app';
|
|
204
|
+
buildVariables.system['size-unit'] = 'rem';
|
|
205
|
+
|
|
195
206
|
await checkFolders();
|
|
196
207
|
const build = await viteBuild({
|
|
197
208
|
build: {
|
|
@@ -280,6 +291,10 @@ async function zipLdd() {
|
|
|
280
291
|
*/
|
|
281
292
|
async function buildPdf() {
|
|
282
293
|
console.log("\n\nBuild PDF");
|
|
294
|
+
buildVariables.system.environment = 'production';
|
|
295
|
+
buildVariables.system.build = 'pdf';
|
|
296
|
+
buildVariables.system['size-unit'] = 'rem';
|
|
297
|
+
|
|
283
298
|
await checkFolders();
|
|
284
299
|
|
|
285
300
|
const config = {
|
|
@@ -312,6 +327,10 @@ async function buildPdf() {
|
|
|
312
327
|
|
|
313
328
|
async function buildXbrl() {
|
|
314
329
|
console.log("\n\nBuild XBRL");
|
|
330
|
+
buildVariables.system.environment = 'production';
|
|
331
|
+
buildVariables.system.build = 'xbrl';
|
|
332
|
+
buildVariables.system['size-unit'] = 'rem';
|
|
333
|
+
|
|
315
334
|
await checkFolders();
|
|
316
335
|
|
|
317
336
|
const config = {
|
|
@@ -351,6 +370,10 @@ async function buildXbrl() {
|
|
|
351
370
|
*/
|
|
352
371
|
async function buildLdd(version) {
|
|
353
372
|
console.log("\n\nBuild Livingdocs");
|
|
373
|
+
buildVariables.system.environment = 'production';
|
|
374
|
+
buildVariables.system.build = 'ldd';
|
|
375
|
+
buildVariables.system['size-unit'] = 'rem';
|
|
376
|
+
|
|
354
377
|
await checkFolders();
|
|
355
378
|
await mapLdd();
|
|
356
379
|
|
|
@@ -478,7 +501,7 @@ async function buildLdd(version) {
|
|
|
478
501
|
}
|
|
479
502
|
|
|
480
503
|
async function buildPdfCustomer(customer) {
|
|
481
|
-
|
|
504
|
+
const internalLddUrl = process.env.INTERNAL_LDD_URL ?? nsWowInternalLddUrl;
|
|
482
505
|
const customersDir = join(folders.root, 'pdf', 'customers');
|
|
483
506
|
|
|
484
507
|
if (customer === 'all') {
|
|
@@ -594,7 +617,7 @@ async function buildPdfCustomer(customer) {
|
|
|
594
617
|
|
|
595
618
|
const pdfXmlStart = `<configuration xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">\n`;
|
|
596
619
|
const pdfXmlEnd = `\n</configuration>`;
|
|
597
|
-
const nsWowUrl = `${
|
|
620
|
+
const nsWowUrl = `${internalLddUrl}/${lddJson.name}/${lddJson.version}/pdf`;
|
|
598
621
|
|
|
599
622
|
const pdfConfig = [];
|
|
600
623
|
cssReferences.forEach( p => {
|
|
@@ -640,6 +663,9 @@ async function buildPdfCustomer(customer) {
|
|
|
640
663
|
*/
|
|
641
664
|
async function buildWord() {
|
|
642
665
|
console.log("\n\nBuild Word");
|
|
666
|
+
buildVariables.system.environment = 'production';
|
|
667
|
+
buildVariables.system.build = 'word';
|
|
668
|
+
buildVariables.system['size-unit'] = 'pt';
|
|
643
669
|
await checkFolders();
|
|
644
670
|
|
|
645
671
|
const config = {
|
|
@@ -740,16 +766,32 @@ function cleanupScssAlias(string) {
|
|
|
740
766
|
async function mapScss() {
|
|
741
767
|
await checkFolders();
|
|
742
768
|
try {
|
|
769
|
+
const internalLddUrl = process.env.INTERNAL_LDD_URL ?? nsWowInternalLddUrl;
|
|
743
770
|
const packageJson = await readPackageJson();
|
|
744
771
|
|
|
745
772
|
const relativePathToRoot = join('..', '..', '/');
|
|
746
773
|
|
|
747
774
|
const output = {
|
|
748
|
-
app: [
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
775
|
+
app: [
|
|
776
|
+
`"../../srl/config" as *`,
|
|
777
|
+
`"@simple-reporting/base/scss/init-root.scss" as *`
|
|
778
|
+
],
|
|
779
|
+
ldd: [
|
|
780
|
+
`"../../srl/config" as *`,
|
|
781
|
+
`"@simple-reporting/base/scss/init-root.scss" as *`
|
|
782
|
+
],
|
|
783
|
+
pdf: [
|
|
784
|
+
`"../../srl/config" as *`,
|
|
785
|
+
`"@simple-reporting/base/scss/init-root.scss" as *`
|
|
786
|
+
],
|
|
787
|
+
word: [
|
|
788
|
+
`"../../srl/config" as *`,
|
|
789
|
+
`"@simple-reporting/base/scss/init-root.scss" as *`
|
|
790
|
+
],
|
|
791
|
+
xbrl: [
|
|
792
|
+
`"../../srl/config" as *`,
|
|
793
|
+
`"@simple-reporting/base/scss/init-root.scss" as *`
|
|
794
|
+
],
|
|
753
795
|
};
|
|
754
796
|
|
|
755
797
|
const fontFiles = await glob(join(folders.srlAssets, 'fonts', '**', '*.scss'), {
|
|
@@ -759,7 +801,7 @@ async function mapScss() {
|
|
|
759
801
|
const fontsOutput = []
|
|
760
802
|
|
|
761
803
|
if (fontFiles.length) {
|
|
762
|
-
fontsOutput.push(`@import "${
|
|
804
|
+
fontsOutput.push(`@import "${internalLddUrl}/${packageJson.name}/${packageJson.version}/fonts/style.css";`);
|
|
763
805
|
fontFiles.forEach(f => {
|
|
764
806
|
output.app.push(`"${relativePathToRoot}${f.relativePosix()}" as *`);
|
|
765
807
|
output.xbrl.push(`"${relativePathToRoot}${f.relativePosix()}" as *`);
|
|
@@ -908,9 +950,7 @@ async function mapScss() {
|
|
|
908
950
|
|
|
909
951
|
await writeFileSync(
|
|
910
952
|
join(folders.srlImports, 'xbrl.scss'),
|
|
911
|
-
output.xbrl.
|
|
912
|
-
? `@use ` + output.xbrl.join(';\n@use ')
|
|
913
|
-
: '' + `;\n@use "@simple-reporting/base/scss/xbrl-core-styles.scss" as *;\n`,
|
|
953
|
+
`@use ` + output.xbrl.join(`;\n@use `) + `;\n@use "@simple-reporting/base/scss/xbrl-core-styles.scss" as *;\n`,
|
|
914
954
|
);
|
|
915
955
|
|
|
916
956
|
return true;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import dotenv from 'dotenv'
|
|
2
|
+
import folders from './folders.js';
|
|
3
|
+
import { join } from 'node:path/posix';
|
|
4
|
+
|
|
5
|
+
dotenv.config({quiet: true, path: join(folders.root, '.env.nswow')});
|
|
6
|
+
dotenv.config({quiet: true, path: join(folders.root, '.env.production.local')});
|
|
7
|
+
dotenv.config({quiet: true, path: join(folders.root, '.env.production')});
|
|
8
|
+
dotenv.config({quiet: true});
|
package/scripts/init.js
CHANGED
|
@@ -58,7 +58,7 @@ async function init(folder, options) {
|
|
|
58
58
|
|
|
59
59
|
await writeFileSync(
|
|
60
60
|
`${projectPath}/.gitignore`,
|
|
61
|
-
`/.output/\n/.srl/\n/node_modules/\n/public/downloads/\n/public/html/\n/public/images/\n/public/json/\n/public/exclude/\n/dev-dist
|
|
61
|
+
`/.output/\n/.srl/\n/node_modules/\n/public/downloads/\n/public/html/\n/public/images/\n/public/json/\n/public/exclude/\n/dev-dist/\n/.DS_Store\n/.idea\n/**/*.lcoal\n`,
|
|
62
62
|
);
|
|
63
63
|
console.log(`Project has created`);
|
|
64
64
|
console.log(`cd ${folder}`);
|
package/scripts/ldd/mapLdd.js
CHANGED
|
@@ -141,7 +141,7 @@ async function mapComponents(lddJson) {
|
|
|
141
141
|
components.forEach((component) => {
|
|
142
142
|
// ldd static component
|
|
143
143
|
try {
|
|
144
|
-
const htmlFile = globSync(join(groupPath, component, '*.html'));
|
|
144
|
+
const htmlFile = globSync(join(groupPath, component, '*.html'), { posix: true });
|
|
145
145
|
if (htmlFile.length) {
|
|
146
146
|
const htmlPath = htmlFile[0];
|
|
147
147
|
const ldConfPath = join(groupPath, component, `ld-conf.json`);
|
|
@@ -164,7 +164,7 @@ async function mapComponents(lddJson) {
|
|
|
164
164
|
|
|
165
165
|
// vue async component
|
|
166
166
|
try {
|
|
167
|
-
const vueFiles = globSync(join(groupPath, component, '*.vue'));
|
|
167
|
+
const vueFiles = globSync(join(groupPath, component, '*.vue'), { posix: true });
|
|
168
168
|
if (vueFiles.length) {
|
|
169
169
|
vueFiles.forEach( c => {
|
|
170
170
|
const vueFile = c.split('/').pop();
|
package/scripts/utils.d.ts
CHANGED
|
@@ -61,4 +61,5 @@ export function camelCase(str: string): string;
|
|
|
61
61
|
* @returns {Promise<string>} The package version.
|
|
62
62
|
*/
|
|
63
63
|
export function getPackageVersion(packageName: string): Promise<string>;
|
|
64
|
+
export function deepAssign(target: any, ...sources: any[]): any;
|
|
64
65
|
export { writeJson };
|
package/scripts/utils.js
CHANGED
|
@@ -146,6 +146,27 @@ function getPackageVersion(packageName) {
|
|
|
146
146
|
});
|
|
147
147
|
}
|
|
148
148
|
|
|
149
|
+
function deepAssign(target, ...sources) {
|
|
150
|
+
for (const source of sources) {
|
|
151
|
+
if (typeof source !== 'object' || source === null) continue;
|
|
152
|
+
for (const key of Object.keys(source)) {
|
|
153
|
+
if (
|
|
154
|
+
typeof source[key] === 'object' &&
|
|
155
|
+
source[key] !== null &&
|
|
156
|
+
!Array.isArray(source[key])
|
|
157
|
+
) {
|
|
158
|
+
if (!target[key] || typeof target[key] !== 'object') {
|
|
159
|
+
target[key] = {};
|
|
160
|
+
}
|
|
161
|
+
deepAssign(target[key], source[key]);
|
|
162
|
+
} else {
|
|
163
|
+
target[key] = source[key];
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
return target;
|
|
168
|
+
}
|
|
169
|
+
|
|
149
170
|
export {
|
|
150
171
|
writeJson,
|
|
151
172
|
lddGroupNames,
|
|
@@ -160,4 +181,5 @@ export {
|
|
|
160
181
|
writeNsWowJson,
|
|
161
182
|
camelCase,
|
|
162
183
|
getPackageVersion,
|
|
184
|
+
deepAssign,
|
|
163
185
|
};
|
|
@@ -2,17 +2,9 @@
|
|
|
2
2
|
@use 'variables';
|
|
3
3
|
@use '../system';
|
|
4
4
|
|
|
5
|
-
@function get($colorName
|
|
5
|
+
@function get($colorName) {
|
|
6
6
|
@if not map.has-key(variables.$colors, $colorName) {
|
|
7
7
|
@error "Invalid color \"#{$colorName}\" specified! Choose one of #{map.keys(variables.$colors)}";
|
|
8
8
|
}
|
|
9
|
-
|
|
10
|
-
@if $media {
|
|
11
|
-
@return var(
|
|
12
|
-
--#{variables.$variable-prefix}color-#{$colorName}-#{$media},
|
|
13
|
-
var(--#{variables.$variable-prefix}color-#{$colorName})
|
|
14
|
-
);
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
@return var(--#{variables.$variable-prefix}color-#{$colorName});
|
|
9
|
+
@return system.root-style(#{variables.$variable-prefix}color-#{$colorName});
|
|
18
10
|
}
|