@simple-reporting/base 1.0.4 → 1.0.6
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/README.md +10 -10
- package/dev/.ddev/config.yaml +1 -1
- package/dev/package.json +1 -1
- package/dev/srl.config.json +6 -6
- package/livingdocs/020.Text/060.quote-with-portrait/scss/general.scss +0 -2
- package/livingdocs/020.Text/060.quote-with-portrait/scss/pdf.scss +0 -2
- package/livingdocs/040.Media/030.video/scss/web.scss +6 -6
- package/livingdocs/100.Misc/010.anchor/scss/editor.scss +2 -2
- package/livingdocs/110.PDF/010.pdf-pagebreak/scss/editor.scss +2 -2
- package/package.json +1 -1
- package/scripts/init.js +5 -0
- package/scripts/ldd/mapLdd.js +7 -1
- package/srl/components/Srl/Article/Root.vue +1 -1
- package/srl/components/Srl/Page/App.vue +3 -9
- package/srl/composables/cssStyles.ts +16 -0
- package/srl/composables/index.ts +5 -3
- package/srl/utils/html.ts +3 -4
- package/srl/composables/root.ts +0 -7
package/README.md
CHANGED
|
@@ -24,14 +24,14 @@ Build all required files.
|
|
|
24
24
|
|
|
25
25
|
## Important CLI commands
|
|
26
26
|
|
|
27
|
-
| Command
|
|
28
|
-
|
|
29
|
-
| `npm install`
|
|
30
|
-
| `npm run dev`
|
|
31
|
-
| `npm run build`
|
|
32
|
-
| `npx
|
|
33
|
-
| `npx
|
|
34
|
-
| `npx
|
|
35
|
-
| `npx
|
|
36
|
-
| `npx
|
|
27
|
+
| Command | Description |
|
|
28
|
+
|---------------------------------|--------------------------------------------------------------------------------|
|
|
29
|
+
| `npm install` | Installs all packages listed in `package.json` |
|
|
30
|
+
| `npm run dev` | Starts the development environment including SCSS and JS watcher (Live Reload) |
|
|
31
|
+
| `npm run build` | Generates all CSS and JS files and ZIP packages in `.output` |
|
|
32
|
+
| `npx srl create component` | Creates a component |
|
|
33
|
+
| `npx srl add components` | Adds predefined components |
|
|
34
|
+
| `npx srl remove components` | Removes one or more components |
|
|
35
|
+
| `npx srl add groups` | Adds predefined groups and their components |
|
|
36
|
+
| `npx srl remove groups` | Removes one or more groups |
|
|
37
37
|
|
package/dev/.ddev/config.yaml
CHANGED
package/dev/package.json
CHANGED
package/dev/srl.config.json
CHANGED
|
@@ -454,7 +454,7 @@
|
|
|
454
454
|
"line-height": 1.5,
|
|
455
455
|
"font-style": "normal",
|
|
456
456
|
"font-weight": 400,
|
|
457
|
-
"color": "
|
|
457
|
+
"color": "primary-1000",
|
|
458
458
|
"letter-spacing": 0,
|
|
459
459
|
"media": {
|
|
460
460
|
"print": {
|
|
@@ -746,23 +746,23 @@
|
|
|
746
746
|
"color": "#ff7d00"
|
|
747
747
|
},
|
|
748
748
|
{
|
|
749
|
-
"name": "
|
|
749
|
+
"name": "secondary-200",
|
|
750
750
|
"color": "#ccd1e7"
|
|
751
751
|
},
|
|
752
752
|
{
|
|
753
|
-
"name": "
|
|
753
|
+
"name": "secondary-400",
|
|
754
754
|
"color": "#99a3cf"
|
|
755
755
|
},
|
|
756
756
|
{
|
|
757
|
-
"name": "
|
|
757
|
+
"name": "secondary-600",
|
|
758
758
|
"color": "#6675b7"
|
|
759
759
|
},
|
|
760
760
|
{
|
|
761
|
-
"name": "
|
|
761
|
+
"name": "secondary-800",
|
|
762
762
|
"color": "#33479f"
|
|
763
763
|
},
|
|
764
764
|
{
|
|
765
|
-
"name": "
|
|
765
|
+
"name": "secondary-1000",
|
|
766
766
|
"color": "#001987"
|
|
767
767
|
},
|
|
768
768
|
{
|
|
@@ -49,22 +49,22 @@
|
|
|
49
49
|
border-radius: 50%;
|
|
50
50
|
transition: background-color 0.3s ease;
|
|
51
51
|
-webkit-appearance: none;
|
|
52
|
-
border: 1px solid srl.colors-
|
|
53
|
-
color: srl.colors-
|
|
52
|
+
border: 1px solid srl.colors-primary-1000();
|
|
53
|
+
color: srl.colors-primary-1000();
|
|
54
54
|
|
|
55
55
|
@media (prefers-reduced-motion: reduce) {
|
|
56
56
|
transition-duration: 0s;
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
&:hover {
|
|
60
|
-
background-color: srl.colors-
|
|
61
|
-
border-color: srl.colors-
|
|
60
|
+
background-color: srl.colors-primary-1000();
|
|
61
|
+
border-color: srl.colors-primary-1000();
|
|
62
62
|
color: srl.colors-white-1000();
|
|
63
63
|
}
|
|
64
64
|
|
|
65
65
|
&:focus {
|
|
66
|
-
background-color: srl.colors-
|
|
67
|
-
border-color: srl.colors-
|
|
66
|
+
background-color: srl.colors-secondary-1000();
|
|
67
|
+
border-color: srl.colors-secondary-1000();
|
|
68
68
|
color: srl.colors-white-1000();
|
|
69
69
|
}
|
|
70
70
|
}
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
@use 'assets/scss/placeholders';
|
|
4
4
|
|
|
5
5
|
.srl-anchor {
|
|
6
|
-
border-top: 1px solid #{srl.colors-
|
|
7
|
-
border-bottom: 1px solid #{srl.colors-
|
|
6
|
+
border-top: 1px solid #{srl.colors-secondary-1000()};
|
|
7
|
+
border-bottom: 1px solid #{srl.colors-secondary-1000()};
|
|
8
8
|
@include srl.spacer-padding-block(200);
|
|
9
9
|
@extend %srl-grid-base;
|
|
10
10
|
}
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
@use 'assets/scss/placeholders';
|
|
4
4
|
|
|
5
5
|
.srl-pdf-pagebreak {
|
|
6
|
-
border-top: 1px solid #{srl.colors-
|
|
7
|
-
border-bottom: 1px solid #{srl.colors-
|
|
6
|
+
border-top: 1px solid #{srl.colors-secondary-1000()};
|
|
7
|
+
border-bottom: 1px solid #{srl.colors-secondary-1000()};
|
|
8
8
|
text-align: center;
|
|
9
9
|
@include srl.spacer-padding-block(200);
|
|
10
10
|
@extend %srl-grid-base;
|
package/package.json
CHANGED
package/scripts/init.js
CHANGED
|
@@ -51,6 +51,11 @@ async function init(folder, options) {
|
|
|
51
51
|
);
|
|
52
52
|
});
|
|
53
53
|
|
|
54
|
+
const ddevConfigPath = join(projectPath, '.ddev', 'config.yaml');
|
|
55
|
+
let ddevConfig = await readFileSync(ddevConfigPath, 'utf8');
|
|
56
|
+
ddevConfig = ddevConfig.replace(/name: .*/, `name: ${folder.replaceAll(/[^a-zA-Z0-9-]/g, '-').toLowerCase()}`);
|
|
57
|
+
await writeFileSync(ddevConfigPath, ddevConfig, 'utf8');
|
|
58
|
+
|
|
54
59
|
await writeFileSync(
|
|
55
60
|
`${projectPath}/.gitignore`,
|
|
56
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/`,
|
package/scripts/ldd/mapLdd.js
CHANGED
|
@@ -152,7 +152,13 @@ async function mapComponents(lddJson) {
|
|
|
152
152
|
);
|
|
153
153
|
const componentHtml = readFileSync(htmlPath, { encoding: 'utf-8' });
|
|
154
154
|
|
|
155
|
-
lddComponents.push({
|
|
155
|
+
lddComponents.push({
|
|
156
|
+
...componentDeclaration,
|
|
157
|
+
html: componentHtml
|
|
158
|
+
.replaceAll(/>\s+/g, ">")
|
|
159
|
+
.replaceAll(/\s+</g, "<")
|
|
160
|
+
.trim()
|
|
161
|
+
});
|
|
156
162
|
}
|
|
157
163
|
} catch (error) {}
|
|
158
164
|
|
|
@@ -32,7 +32,7 @@ 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, useArticles, useConfig
|
|
35
|
+
import { useArticle, useArticles, useConfig } from '#composables';
|
|
36
36
|
import { prepareHtmlContent } from '#utils';
|
|
37
37
|
|
|
38
38
|
const articleRoot = ref<HTMLDivElement | null>(null);
|
|
@@ -36,15 +36,13 @@
|
|
|
36
36
|
* to other components in the application.
|
|
37
37
|
*/
|
|
38
38
|
import App from '@/App.vue';
|
|
39
|
-
import {
|
|
39
|
+
import { watch } from 'vue'
|
|
40
|
+
import { useCssStyles } from '#composables'
|
|
40
41
|
|
|
41
42
|
const styleElement = document.createElement('style');
|
|
42
43
|
document.head.appendChild(styleElement);
|
|
43
44
|
|
|
44
|
-
const styleContent =
|
|
45
|
-
function addCssStyles(styles: string) {
|
|
46
|
-
styleContent.value.includes(styles) || styleContent.value.push(styles);
|
|
47
|
-
}
|
|
45
|
+
const styleContent = useCssStyles();
|
|
48
46
|
watch(
|
|
49
47
|
styleContent.value,
|
|
50
48
|
(newStyles) => {
|
|
@@ -52,10 +50,6 @@ watch(
|
|
|
52
50
|
},
|
|
53
51
|
{ immediate: true },
|
|
54
52
|
);
|
|
55
|
-
|
|
56
|
-
defineExpose({
|
|
57
|
-
addCssStyles,
|
|
58
|
-
});
|
|
59
53
|
</script>
|
|
60
54
|
|
|
61
55
|
<template>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ref } from 'vue';
|
|
2
|
+
|
|
3
|
+
const cssStyles = ref<string[]>([]);
|
|
4
|
+
|
|
5
|
+
export function addCssStyles(cssString: string): void {
|
|
6
|
+
cssStyles.value.includes(cssString) || cssStyles.value.push(cssString);
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export function useCssStyles(): string[] {
|
|
10
|
+
return cssStyles;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export default {
|
|
14
|
+
addCssStyles,
|
|
15
|
+
useCssStyles,
|
|
16
|
+
}
|
package/srl/composables/index.ts
CHANGED
|
@@ -4,10 +4,10 @@ import _useConfig from './config';
|
|
|
4
4
|
import _useDownloads from './downloads';
|
|
5
5
|
import _useLocale from './locale';
|
|
6
6
|
import _useMenu from './menu';
|
|
7
|
-
import _useRoot from './root';
|
|
8
7
|
import _useSearch from './search';
|
|
9
8
|
import _useSettings from './settings';
|
|
10
9
|
import _useViewPort from './viewPort';
|
|
10
|
+
import * as cssStyles from './cssStyles.ts'
|
|
11
11
|
|
|
12
12
|
export const useArticle = _useArticle;
|
|
13
13
|
export const useArticles = _useArticles;
|
|
@@ -15,10 +15,11 @@ export const useConfig = _useConfig;
|
|
|
15
15
|
export const useDownloads = _useDownloads;
|
|
16
16
|
export const useLocale = _useLocale;
|
|
17
17
|
export const useMenu = _useMenu;
|
|
18
|
-
export const useRoot = _useRoot;
|
|
19
18
|
export const useSearch = _useSearch;
|
|
20
19
|
export const useSettings = _useSettings;
|
|
21
20
|
export const useViewPort = _useViewPort;
|
|
21
|
+
export const addCssStyles = cssStyles.addCssStyles;
|
|
22
|
+
export const useCssStyles = cssStyles.useCssStyles;
|
|
22
23
|
|
|
23
24
|
export default {
|
|
24
25
|
useArticle,
|
|
@@ -27,8 +28,9 @@ export default {
|
|
|
27
28
|
useDownloads,
|
|
28
29
|
useLocale,
|
|
29
30
|
useMenu,
|
|
30
|
-
useRoot,
|
|
31
31
|
useSearch,
|
|
32
32
|
useSettings,
|
|
33
33
|
useViewPort,
|
|
34
|
+
addCssStyles,
|
|
35
|
+
useCssStyles,
|
|
34
36
|
};
|
package/srl/utils/html.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { isRouterPath } from '#utils/uri.ts';
|
|
2
|
-
import { useArticles, useLocale,
|
|
2
|
+
import { useArticles, useLocale, addCssStyles } from '#composables';
|
|
3
|
+
|
|
3
4
|
function attributesToString(attributes: Record<string, string | null>): string {
|
|
4
5
|
return Object.entries(attributes)
|
|
5
6
|
.map(([key, value]) => (value !== null ? `${key}="${value}"` : key))
|
|
@@ -7,7 +8,6 @@ function attributesToString(attributes: Record<string, string | null>): string {
|
|
|
7
8
|
}
|
|
8
9
|
|
|
9
10
|
export function prepareHtmlContent(text: string): string {
|
|
10
|
-
const rootComponent = useRoot();
|
|
11
11
|
const articles = useArticles();
|
|
12
12
|
const locale = useLocale();
|
|
13
13
|
|
|
@@ -34,7 +34,6 @@ export function prepareHtmlContent(text: string): string {
|
|
|
34
34
|
const arrLink = attrObj.href.split('#');
|
|
35
35
|
|
|
36
36
|
if (isRouterPath(arrLink[0])) {
|
|
37
|
-
console.log(arrLink);
|
|
38
37
|
delete attrObj.href;
|
|
39
38
|
if (arrLink[0].startsWith('./')) {
|
|
40
39
|
arrLink[0] = arrLink[0].substring(1);
|
|
@@ -70,7 +69,7 @@ export function prepareHtmlContent(text: string): string {
|
|
|
70
69
|
text = text.replaceAll('../', `./`);
|
|
71
70
|
|
|
72
71
|
text = text.replace(/<style[^>]*>([\s\S]*?)<\/style>/gi, (match, p1) => {
|
|
73
|
-
|
|
72
|
+
addCssStyles(p1);
|
|
74
73
|
return '';
|
|
75
74
|
});
|
|
76
75
|
|
package/srl/composables/root.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import SrlPageApp from '#components/Srl/Page/App.vue';
|
|
2
|
-
import { getCurrentInstance } from 'vue';
|
|
3
|
-
|
|
4
|
-
export default function useRoot(): typeof SrlPageApp {
|
|
5
|
-
const instance = getCurrentInstance();
|
|
6
|
-
return instance?.proxy?.$root ?? window.app._instance.root.setupState;
|
|
7
|
-
}
|