@simple-reporting/base 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/npm-publish.yml +25 -0
- package/.nvmrc +1 -0
- package/.prettierrc +6 -0
- package/README.md +23 -0
- package/cli.js +114 -0
- package/dev/.ddev/config.yaml +279 -0
- package/dev/.ddev/nginx_full/custom.conf +12 -0
- package/dev/.env +1 -0
- package/dev/.env.development +1 -0
- package/dev/.eslintrc.cjs +15 -0
- package/dev/.nvmrc +1 -0
- package/dev/.prettierrc.json +8 -0
- package/dev/.vscode/extensions.json +3 -0
- package/dev/.vscode/settings.json +4 -0
- package/dev/README.md +45 -0
- package/dev/env.d.ts +1 -0
- package/dev/index.html +17 -0
- package/dev/ldd.html +7 -0
- package/dev/livingdocs/Media/image/app.scss +25 -0
- package/dev/livingdocs/Media/image/general.scss +11 -0
- package/dev/livingdocs/Media/image/image.html +46 -0
- package/dev/livingdocs/Media/image/ldd.scss +1 -0
- package/dev/livingdocs/Media/image/pdf.scss +1 -0
- package/dev/livingdocs/Media/image/print.scss +7 -0
- package/dev/livingdocs/Media/image/properties.json +41 -0
- package/dev/livingdocs/Media/image/web.scss +0 -0
- package/dev/livingdocs/Media/image/word.scss +1 -0
- package/dev/livingdocs/Properties/grid/app.scss +1 -0
- package/dev/livingdocs/Properties/grid/general.scss +95 -0
- package/dev/livingdocs/Properties/grid/ldd.scss +1 -0
- package/dev/livingdocs/Properties/grid/pdf.scss +1 -0
- package/dev/livingdocs/Properties/grid/print.scss +94 -0
- package/dev/livingdocs/Properties/grid/properties.json +68 -0
- package/dev/livingdocs/Properties/grid/web.scss +98 -0
- package/dev/livingdocs/Properties/grid/word.scss +1 -0
- package/dev/livingdocs/Text/paragraph/general.scss +9 -0
- package/dev/livingdocs/Text/paragraph/paragraph.html +22 -0
- package/dev/livingdocs/Titles/title-h1/general.scss +10 -0
- package/dev/livingdocs/Titles/title-h1/title-h1.html +16 -0
- package/dev/livingdocs/Titles/title-h2/app.scss +1 -0
- package/dev/livingdocs/Titles/title-h2/general.scss +13 -0
- package/dev/livingdocs/Titles/title-h2/ldd.scss +1 -0
- package/dev/livingdocs/Titles/title-h2/pdf.scss +1 -0
- package/dev/livingdocs/Titles/title-h2/print.scss +36 -0
- package/dev/livingdocs/Titles/title-h2/title-h2.html +24 -0
- package/dev/livingdocs/Titles/title-h2/web.scss +27 -0
- package/dev/livingdocs/Titles/title-h2/word.scss +1 -0
- package/dev/livingdocs/Titles/title-h3/app.scss +1 -0
- package/dev/livingdocs/Titles/title-h3/general.scss +13 -0
- package/dev/livingdocs/Titles/title-h3/ldd.scss +1 -0
- package/dev/livingdocs/Titles/title-h3/pdf.scss +1 -0
- package/dev/livingdocs/Titles/title-h3/print.scss +34 -0
- package/dev/livingdocs/Titles/title-h3/title-h3.html +24 -0
- package/dev/livingdocs/Titles/title-h3/web.scss +27 -0
- package/dev/livingdocs/Titles/title-h3/word.scss +1 -0
- package/dev/livingdocs/Titles/title-h4/app.scss +1 -0
- package/dev/livingdocs/Titles/title-h4/general.scss +13 -0
- package/dev/livingdocs/Titles/title-h4/ldd.scss +1 -0
- package/dev/livingdocs/Titles/title-h4/pdf.scss +1 -0
- package/dev/livingdocs/Titles/title-h4/print.scss +34 -0
- package/dev/livingdocs/Titles/title-h4/title-h4.html +24 -0
- package/dev/livingdocs/Titles/title-h4/web.scss +27 -0
- package/dev/livingdocs/Titles/title-h4/word.scss +1 -0
- package/dev/livingdocs/Titles/title-h5/general.scss +10 -0
- package/dev/livingdocs/Titles/title-h5/title-h5.html +16 -0
- package/dev/livingdocs/Titles/title-h6/general.scss +10 -0
- package/dev/livingdocs/Titles/title-h6/title-h6.html +16 -0
- package/dev/livingdocs.config.json +376 -0
- package/dev/nswow/ArticleAutoloader.ts +100 -0
- package/dev/nswow/ArticleLoader.ts +91 -0
- package/dev/nswow/colors.scss +3 -0
- package/dev/nswow/config.scss +13 -0
- package/dev/nswow/core-styles.scss +2 -0
- package/dev/nswow/fonts.scss +2 -0
- package/dev/nswow/grid.scss +2 -0
- package/dev/nswow/helpers.scss +2 -0
- package/dev/nswow/index.scss +9 -0
- package/dev/nswow/meta.scss +2 -0
- package/dev/nswow/spacer.scss +2 -0
- package/dev/nswow/system.scss +2 -0
- package/dev/nswow/typography.scss +3 -0
- package/dev/nswow.config.json +293 -0
- package/dev/package.json +61 -0
- package/dev/pdf/pdf-configuration-debug.xml +6 -0
- package/dev/pdf/pdf-configuration.xml +3 -0
- package/dev/pdf.ts +1 -0
- package/dev/public/.keep +0 -0
- package/dev/src/App.vue +44 -0
- package/dev/src/Autoload.ts +6 -0
- package/dev/src/assets/fonts/Roboto/roboto-v30-latin-300.woff2 +0 -0
- package/dev/src/assets/fonts/Roboto/roboto-v30-latin-700.woff2 +0 -0
- package/dev/src/assets/fonts/Roboto/roboto-v30-latin-italic.woff2 +0 -0
- package/dev/src/assets/fonts/Roboto/roboto-v30-latin-regular.woff2 +0 -0
- package/dev/src/assets/images/mms-logo-black.svg +91 -0
- package/dev/src/assets/images/mms-logo-white.svg +105 -0
- package/dev/src/assets/scss/app.scss +39 -0
- package/dev/src/assets/scss/general.scss +17 -0
- package/dev/src/assets/scss/ldd.scss +27 -0
- package/dev/src/assets/scss/pdf.scss +2 -0
- package/dev/src/assets/scss/print.scss +1 -0
- package/dev/src/assets/scss/web.scss +1 -0
- package/dev/src/assets/scss/word.scss +2 -0
- package/dev/src/components/LanguageSwitch.vue +100 -0
- package/dev/src/components/MainNavigation.vue +209 -0
- package/dev/src/components/MenuItem/MenuArticle.vue +15 -0
- package/dev/src/components/MenuItem/MenuEntry.vue +26 -0
- package/dev/src/components/MenuItem/MenuExternal.vue +28 -0
- package/dev/src/components/MenuItem/index.ts +5 -0
- package/dev/src/components/PageFooter.vue +86 -0
- package/dev/src/components/PageHeader.vue +149 -0
- package/dev/src/components/PageModal.vue +95 -0
- package/dev/src/components/PrevNext.vue +144 -0
- package/dev/src/components/ScrollToTop.vue +63 -0
- package/dev/src/components/SrlPage/KFCApplication/KFCApplication.vue +715 -0
- package/dev/src/components/SrlPage/KFCApplication/KFCDropdownCharts.vue +112 -0
- package/dev/src/components/SrlPage/KFCApplication/KFCDropdownPeriod.vue +85 -0
- package/dev/src/components/SrlPage/KFCApplication/KFCTable.vue +63 -0
- package/dev/src/components/SrlPage/KFCApplication/hooks/kfcData.ts +9 -0
- package/dev/src/components/SrlPage/KFCApplication/models/KFCApplication.ts +183 -0
- package/dev/src/components/SrlPage/KFCApplication/scss/_highcharts-basic.scss +1136 -0
- package/dev/src/components/SrlPage/KFCApplication/scss/_highcharts-custom.scss +71 -0
- package/dev/src/components/SrlPage/KFCApplication/scss/_highcharts-general.scss +113 -0
- package/dev/src/components/SrlPage/KFCApplication/scss/_iz-keyfigure-comparison-dropdown.scss +189 -0
- package/dev/src/components/SrlPage/KFCApplication/scss/_iz-keyfigure-comparison.scss +151 -0
- package/dev/src/components/SrlPage/KFCApplication/scss/_kfc-loading.scss +40 -0
- package/dev/src/components/SrlPage/KFCApplication/scss/_kfc-print.scss +20 -0
- package/dev/src/components/SrlPage/KFCApplication/scss/_srl-button-kfc.scss +21 -0
- package/dev/src/components/SrlPage/KFCApplication/scss/_variables.scss +10 -0
- package/dev/src/components/SrlPage/KFCApplication/services/xlsxParser.ts +194 -0
- package/dev/src/components/SrlPage/KFCApplication/theme/SvgColumnView.vue +28 -0
- package/dev/src/components/SrlPage/KFCApplication/theme/SvgDownloadChart.vue +26 -0
- package/dev/src/components/SrlPage/KFCApplication/theme/SvgDropdown.vue +18 -0
- package/dev/src/components/SrlPage/KFCApplication/theme/SvgIndexedValues.vue +18 -0
- package/dev/src/components/SrlPage/KFCApplication/theme/SvgLegendSwap.vue +18 -0
- package/dev/src/components/SrlPage/KFCApplication/theme/SvgLineView.vue +28 -0
- package/dev/src/components/SrlPage/KFCApplication/theme/SvgPDFChart.vue +26 -0
- package/dev/src/components/SrlPage/KFCApplication/theme/SvgPrintChart.vue +33 -0
- package/dev/src/components/SrlPage/KFCApplication/theme/SvgTableView.vue +67 -0
- package/dev/src/components/SrlPage/KFCApplication/utils/XDownloader.js +455 -0
- package/dev/src/components/SrlPage/KFCApplication/utils/XDownloaderStyle.js +44 -0
- package/dev/src/components/SrlPage/KFCApplication/utils/XTableNamer.js +68 -0
- package/dev/src/composables/config.ts +48 -0
- package/dev/src/i18n/index.ts +51 -0
- package/dev/src/i18n/translation.ts +85 -0
- package/dev/src/locales/de.json +15 -0
- package/dev/src/locales/en.json +15 -0
- package/dev/src/main.ts +16 -0
- package/dev/src/router/index.ts +47 -0
- package/dev/src/types/nswow.d.ts +73 -0
- package/dev/src/utils/variables.ts +13 -0
- package/dev/src/views/ArticleView.vue +77 -0
- package/dev/src/views/DownloadsView.vue +88 -0
- package/dev/src/views/HomeView.vue +35 -0
- package/dev/src/views/PageNotFound.vue +73 -0
- package/dev/src/views/SearchView.vue +126 -0
- package/dev/tsconfig.app.json +16 -0
- package/dev/tsconfig.json +14 -0
- package/dev/tsconfig.node.json +19 -0
- package/dev/tsconfig.vitest.json +11 -0
- package/dev/vite.config.ts +27 -0
- package/dev/vitest.config.ts +14 -0
- package/dev/word.ts +1 -0
- package/livingdocs/Buttons/button/app.scss +1 -0
- package/livingdocs/Buttons/button/button.html +18 -0
- package/livingdocs/Buttons/button/general.scss +33 -0
- package/livingdocs/Buttons/button/ldd.scss +1 -0
- package/livingdocs/Buttons/button/pdf.scss +1 -0
- package/livingdocs/Buttons/button/word.scss +1 -0
- package/livingdocs/Buttons/button-container/app.scss +1 -0
- package/livingdocs/Buttons/button-container/button-container.html +31 -0
- package/livingdocs/Buttons/button-container/general.scss +12 -0
- package/livingdocs/Buttons/button-container/ldd.scss +1 -0
- package/livingdocs/Buttons/button-container/pdf.scss +3 -0
- package/livingdocs/Buttons/button-container/properties.json +19 -0
- package/livingdocs/Buttons/button-container/word.scss +3 -0
- package/livingdocs/CV/cv-timeline/app.scss +1 -0
- package/livingdocs/CV/cv-timeline/cv-timeline.html +19 -0
- package/livingdocs/CV/cv-timeline/general.scss +1 -0
- package/livingdocs/CV/cv-timeline/ldd.scss +1 -0
- package/livingdocs/CV/cv-timeline/pdf.scss +1 -0
- package/livingdocs/CV/cv-timeline/print.scss +35 -0
- package/livingdocs/CV/cv-timeline/web.scss +27 -0
- package/livingdocs/CV/cv-timeline/word.scss +1 -0
- package/livingdocs/Container/column-container/column-container.html +44 -0
- package/livingdocs/Container/column-container/general.scss +105 -0
- package/livingdocs/Container/column-container/properties.json +83 -0
- package/livingdocs/Lists/alphanumeric-list-group/alphanumeric-list-group.html +25 -0
- package/livingdocs/Lists/alphanumeric-list-group/app.scss +1 -0
- package/livingdocs/Lists/alphanumeric-list-group/general.scss +5 -0
- package/livingdocs/Lists/alphanumeric-list-group/ldd.scss +1 -0
- package/livingdocs/Lists/alphanumeric-list-group/pdf.scss +1 -0
- package/livingdocs/Lists/alphanumeric-list-group/print.scss +0 -0
- package/livingdocs/Lists/alphanumeric-list-group/web.scss +0 -0
- package/livingdocs/Lists/alphanumeric-list-group/word.scss +1 -0
- package/livingdocs/Lists/list-item/app.scss +1 -0
- package/livingdocs/Lists/list-item/general.scss +4 -0
- package/livingdocs/Lists/list-item/ldd.scss +1 -0
- package/livingdocs/Lists/list-item/list-item.html +17 -0
- package/livingdocs/Lists/list-item/pdf.scss +1 -0
- package/livingdocs/Lists/list-item/print.scss +0 -0
- package/livingdocs/Lists/list-item/web.scss +0 -0
- package/livingdocs/Lists/list-item/word.scss +1 -0
- package/livingdocs/Lists/ordered-list-group/app.scss +1 -0
- package/livingdocs/Lists/ordered-list-group/general.scss +5 -0
- package/livingdocs/Lists/ordered-list-group/ldd.scss +1 -0
- package/livingdocs/Lists/ordered-list-group/ordered-list-group.html +25 -0
- package/livingdocs/Lists/ordered-list-group/pdf.scss +1 -0
- package/livingdocs/Lists/ordered-list-group/print.scss +0 -0
- package/livingdocs/Lists/ordered-list-group/web.scss +0 -0
- package/livingdocs/Lists/ordered-list-group/word.scss +1 -0
- package/livingdocs/Lists/unordered-list-group/app.scss +1 -0
- package/livingdocs/Lists/unordered-list-group/general.scss +5 -0
- package/livingdocs/Lists/unordered-list-group/ldd.scss +1 -0
- package/livingdocs/Lists/unordered-list-group/pdf.scss +1 -0
- package/livingdocs/Lists/unordered-list-group/print.scss +0 -0
- package/livingdocs/Lists/unordered-list-group/unordered-list-group.html +25 -0
- package/livingdocs/Lists/unordered-list-group/web.scss +0 -0
- package/livingdocs/Lists/unordered-list-group/word.scss +1 -0
- package/livingdocs/Media/chart/app.scss +19 -0
- package/livingdocs/Media/chart/chart.html +29 -0
- package/livingdocs/Media/chart/general.scss +11 -0
- package/livingdocs/Media/chart/ldd.scss +1 -0
- package/livingdocs/Media/chart/pdf.scss +9 -0
- package/livingdocs/Media/chart/print.scss +0 -0
- package/livingdocs/Media/chart/properties.json +41 -0
- package/livingdocs/Media/chart/web.scss +0 -0
- package/livingdocs/Media/chart/word.scss +1 -0
- package/livingdocs/Media/graphic/app.scss +1 -0
- package/livingdocs/Media/graphic/general.scss +18 -0
- package/livingdocs/Media/graphic/graphic.html +29 -0
- package/livingdocs/Media/graphic/ldd.scss +1 -0
- package/livingdocs/Media/graphic/pdf.scss +1 -0
- package/livingdocs/Media/graphic/print.scss +0 -0
- package/livingdocs/Media/graphic/properties.json +36 -0
- package/livingdocs/Media/graphic/web.scss +0 -0
- package/livingdocs/Media/graphic/word.scss +1 -0
- package/livingdocs/Media/image/app.scss +25 -0
- package/livingdocs/Media/image/general.scss +11 -0
- package/livingdocs/Media/image/image.html +55 -0
- package/livingdocs/Media/image/ldd.scss +1 -0
- package/livingdocs/Media/image/pdf.scss +1 -0
- package/livingdocs/Media/image/print.scss +7 -0
- package/livingdocs/Media/image/properties.json +41 -0
- package/livingdocs/Media/image/web.scss +0 -0
- package/livingdocs/Media/image/word.scss +1 -0
- package/livingdocs/Media/nswow-table/app.scss +2 -0
- package/livingdocs/Media/nswow-table/app.ts +35 -0
- package/livingdocs/Media/nswow-table/general.scss +281 -0
- package/livingdocs/Media/nswow-table/ldd.scss +2 -0
- package/livingdocs/Media/nswow-table/nswow-table.html +30 -0
- package/livingdocs/Media/nswow-table/pdf.scss +8 -0
- package/livingdocs/Media/nswow-table/print.scss +0 -0
- package/livingdocs/Media/nswow-table/properties.json +66 -0
- package/livingdocs/Media/nswow-table/web.scss +23 -0
- package/livingdocs/Media/nswow-table/word.scss +2 -0
- package/livingdocs/Media/video/app.scss +1 -0
- package/livingdocs/Media/video/general.scss +7 -0
- package/livingdocs/Media/video/ldd.scss +1 -0
- package/livingdocs/Media/video/pdf.scss +1 -0
- package/livingdocs/Media/video/print.scss +5 -0
- package/livingdocs/Media/video/properties.json +41 -0
- package/livingdocs/Media/video/video.html +26 -0
- package/livingdocs/Media/video/web.scss +0 -0
- package/livingdocs/Media/video/word.scss +1 -0
- package/livingdocs/Misc/accordion/accordion.html +56 -0
- package/livingdocs/Misc/accordion/app.scss +63 -0
- package/livingdocs/Misc/accordion/app.ts +10 -0
- package/livingdocs/Misc/accordion/general.scss +44 -0
- package/livingdocs/Misc/accordion/ldd.scss +36 -0
- package/livingdocs/Misc/accordion/pdf.scss +39 -0
- package/livingdocs/Misc/accordion/word.scss +39 -0
- package/livingdocs/Misc/anchor/anchor.html +15 -0
- package/livingdocs/Misc/anchor/app.scss +10 -0
- package/livingdocs/Misc/anchor/app.ts +11 -0
- package/livingdocs/Misc/anchor/general.scss +1 -0
- package/livingdocs/Misc/anchor/pdf.scss +1 -0
- package/livingdocs/Misc/anchor/print.scss +3 -0
- package/livingdocs/Misc/anchor/word.scss +1 -0
- package/livingdocs/Misc/spacer/app.scss +1 -0
- package/livingdocs/Misc/spacer/general.scss +8 -0
- package/livingdocs/Misc/spacer/ldd.scss +1 -0
- package/livingdocs/Misc/spacer/pdf.scss +1 -0
- package/livingdocs/Misc/spacer/print.scss +18 -0
- package/livingdocs/Misc/spacer/properties.json +52 -0
- package/livingdocs/Misc/spacer/spacer.html +12 -0
- package/livingdocs/Misc/spacer/web.scss +18 -0
- package/livingdocs/Misc/spacer/word.scss +1 -0
- package/livingdocs/PDF_only/pdf-cover/ldd.scss +42 -0
- package/livingdocs/PDF_only/pdf-cover/pdf-cover.html +29 -0
- package/livingdocs/PDF_only/pdf-cover/pdf.scss +1 -0
- package/livingdocs/PDF_only/pdf-cover/print.scss +0 -0
- package/livingdocs/PDF_only/pdf-cover/word.scss +1 -0
- package/livingdocs/PDF_only/pdf-cover-chapter/ldd.scss +19 -0
- package/livingdocs/PDF_only/pdf-cover-chapter/pdf-chapter-cover.html +18 -0
- package/livingdocs/PDF_only/pdf-cover-chapter/pdf.scss +1 -0
- package/livingdocs/PDF_only/pdf-cover-chapter/print.scss +19 -0
- package/livingdocs/PDF_only/pdf-cover-chapter/word.scss +1 -0
- package/livingdocs/PDF_only/pdf-pagebreak/general.scss +4 -0
- package/livingdocs/PDF_only/pdf-pagebreak/ldd.scss +5 -0
- package/livingdocs/PDF_only/pdf-pagebreak/pdf-pagebreak.html +8 -0
- package/livingdocs/PDF_only/pdf-publication-title/general.scss +5 -0
- package/livingdocs/PDF_only/pdf-publication-title/pdf-publication-title.html +15 -0
- package/livingdocs/PDF_only/pdf-toc-item/general.scss +41 -0
- package/livingdocs/PDF_only/pdf-toc-item/pdf-toc-item.html +33 -0
- package/livingdocs/PDF_only/pdf-toc-item/properties.json +7 -0
- package/livingdocs/PDF_only/pdf-toc-item-blank/general.scss +5 -0
- package/livingdocs/PDF_only/pdf-toc-item-blank/pdf-toc-item-blank.html +11 -0
- package/livingdocs/PDF_only/pdf-toc-item-title/general.scss +5 -0
- package/livingdocs/PDF_only/pdf-toc-item-title/pdf-toc-item-title.html +11 -0
- package/livingdocs/PDF_only/pdf-toc-page/app.scss +1 -0
- package/livingdocs/PDF_only/pdf-toc-page/general.scss +1 -0
- package/livingdocs/PDF_only/pdf-toc-page/ldd.scss +1 -0
- package/livingdocs/PDF_only/pdf-toc-page/pdf-toc-page.html +33 -0
- package/livingdocs/PDF_only/pdf-toc-page/pdf.scss +1 -0
- package/livingdocs/PDF_only/pdf-toc-page/properties.json +12 -0
- package/livingdocs/PDF_only/pdf-toc-page/word.scss +1 -0
- package/livingdocs/PDF_only/pdf-video-link/ldd.scss +16 -0
- package/livingdocs/PDF_only/pdf-video-link/pdf-video-link.html +41 -0
- package/livingdocs/PDF_only/pdf-video-link/pdf.scss +1 -0
- package/livingdocs/PDF_only/pdf-video-link/print.scss +12 -0
- package/livingdocs/PDF_only/pdf-video-link/word.scss +1 -0
- package/livingdocs/Properties/grid/app.scss +1 -0
- package/livingdocs/Properties/grid/general.scss +95 -0
- package/livingdocs/Properties/grid/ldd.scss +1 -0
- package/livingdocs/Properties/grid/pdf.scss +1 -0
- package/livingdocs/Properties/grid/print.scss +94 -0
- package/livingdocs/Properties/grid/properties.json +68 -0
- package/livingdocs/Properties/grid/web.scss +98 -0
- package/livingdocs/Properties/grid/word.scss +1 -0
- package/livingdocs/Signatures/signature-container/app.scss +1 -0
- package/livingdocs/Signatures/signature-container/general.scss +7 -0
- package/livingdocs/Signatures/signature-container/ldd.scss +1 -0
- package/livingdocs/Signatures/signature-container/pdf.scss +1 -0
- package/livingdocs/Signatures/signature-container/print.scss +0 -0
- package/livingdocs/Signatures/signature-container/signature-container.html +30 -0
- package/livingdocs/Signatures/signature-container/web.scss +0 -0
- package/livingdocs/Signatures/signature-container/word.scss +1 -0
- package/livingdocs/Signatures/signature-item/app.scss +1 -0
- package/livingdocs/Signatures/signature-item/general.scss +53 -0
- package/livingdocs/Signatures/signature-item/ldd.scss +1 -0
- package/livingdocs/Signatures/signature-item/pdf.scss +1 -0
- package/livingdocs/Signatures/signature-item/print.scss +0 -0
- package/livingdocs/Signatures/signature-item/signature-item.html +23 -0
- package/livingdocs/Signatures/signature-item/web.scss +0 -0
- package/livingdocs/Signatures/signature-item/word.scss +1 -0
- package/livingdocs/Text/footnote/app.scss +1 -0
- package/livingdocs/Text/footnote/footnote.html +14 -0
- package/livingdocs/Text/footnote/general.scss +12 -0
- package/livingdocs/Text/footnote/ldd.scss +1 -0
- package/livingdocs/Text/footnote/pdf.scss +1 -0
- package/livingdocs/Text/footnote/print.scss +36 -0
- package/livingdocs/Text/footnote/web.scss +27 -0
- package/livingdocs/Text/footnote/word.scss +1 -0
- package/livingdocs/Text/lead/general.scss +9 -0
- package/livingdocs/Text/lead/lead.html +23 -0
- package/livingdocs/Text/paragraph/general.scss +9 -0
- package/livingdocs/Text/paragraph/paragraph.html +24 -0
- package/livingdocs/Text/quote/general.scss +43 -0
- package/livingdocs/Text/quote/properties.json +7 -0
- package/livingdocs/Text/quote/quote.html +29 -0
- package/livingdocs/Text/quote-with-portrait/general.scss +81 -0
- package/livingdocs/Text/quote-with-portrait/properties.json +12 -0
- package/livingdocs/Text/quote-with-portrait/quote-with-portrait.html +49 -0
- package/livingdocs/Titles/title-h1/general.scss +10 -0
- package/livingdocs/Titles/title-h1/title-h1.html +16 -0
- package/livingdocs/Titles/title-h2/app.scss +1 -0
- package/livingdocs/Titles/title-h2/general.scss +13 -0
- package/livingdocs/Titles/title-h2/ldd.scss +1 -0
- package/livingdocs/Titles/title-h2/pdf.scss +1 -0
- package/livingdocs/Titles/title-h2/print.scss +36 -0
- package/livingdocs/Titles/title-h2/title-h2.html +26 -0
- package/livingdocs/Titles/title-h2/web.scss +27 -0
- package/livingdocs/Titles/title-h2/word.scss +1 -0
- package/livingdocs/Titles/title-h3/app.scss +1 -0
- package/livingdocs/Titles/title-h3/general.scss +13 -0
- package/livingdocs/Titles/title-h3/ldd.scss +1 -0
- package/livingdocs/Titles/title-h3/pdf.scss +1 -0
- package/livingdocs/Titles/title-h3/print.scss +34 -0
- package/livingdocs/Titles/title-h3/title-h3.html +26 -0
- package/livingdocs/Titles/title-h3/web.scss +27 -0
- package/livingdocs/Titles/title-h3/word.scss +1 -0
- package/livingdocs/Titles/title-h4/app.scss +1 -0
- package/livingdocs/Titles/title-h4/general.scss +13 -0
- package/livingdocs/Titles/title-h4/ldd.scss +1 -0
- package/livingdocs/Titles/title-h4/pdf.scss +1 -0
- package/livingdocs/Titles/title-h4/print.scss +34 -0
- package/livingdocs/Titles/title-h4/title-h4.html +26 -0
- package/livingdocs/Titles/title-h4/web.scss +27 -0
- package/livingdocs/Titles/title-h4/word.scss +1 -0
- package/livingdocs/Titles/title-h5/general.scss +10 -0
- package/livingdocs/Titles/title-h5/title-h5.html +16 -0
- package/livingdocs/Titles/title-h6/general.scss +10 -0
- package/livingdocs/Titles/title-h6/title-h6.html +16 -0
- package/package.json +50 -0
- package/preparePublish.cjs +95 -0
- package/scripts/beaver.d.ts +6 -0
- package/scripts/beaver.js +316 -0
- package/scripts/build.d.ts +40 -0
- package/scripts/build.js +812 -0
- package/scripts/colors.d.ts +3 -0
- package/scripts/colors.js +27 -0
- package/scripts/components.d.ts +43 -0
- package/scripts/components.js +566 -0
- package/scripts/config.d.ts +1 -0
- package/scripts/config.js +1 -0
- package/scripts/doPublish.d.ts +1 -0
- package/scripts/doPublish.js +43 -0
- package/scripts/init.d.ts +9 -0
- package/scripts/init.js +45 -0
- package/scripts/migrate-livingdocs-build/LICENSE +21 -0
- package/scripts/migrate-livingdocs-build/bin/build.d.ts +8 -0
- package/scripts/migrate-livingdocs-build/bin/build.js +53 -0
- package/scripts/migrate-livingdocs-build/bin/migrate.d.ts +2 -0
- package/scripts/migrate-livingdocs-build/bin/migrate.js +43 -0
- package/scripts/migrate-livingdocs-build/dev/build/v1.d.ts +9 -0
- package/scripts/migrate-livingdocs-build/dev/build/v1.d.ts.map +1 -0
- package/scripts/migrate-livingdocs-build/dev/build/v1.js +51 -0
- package/scripts/migrate-livingdocs-build/dev/build/v2.d.ts +2 -0
- package/scripts/migrate-livingdocs-build/dev/build/v2.d.ts.map +1 -0
- package/scripts/migrate-livingdocs-build/dev/build/v2.js +44 -0
- package/scripts/migrate-livingdocs-build/dev/build/zip-archive.d.ts +2 -0
- package/scripts/migrate-livingdocs-build/dev/build/zip-archive.d.ts.map +1 -0
- package/scripts/migrate-livingdocs-build/dev/build/zip-archive.js +39 -0
- package/scripts/migrate-livingdocs-build/dev/build.d.ts +9 -0
- package/scripts/migrate-livingdocs-build/dev/build.js +7 -0
- package/scripts/migrate-livingdocs-build/dev/configuration-defaults.d.ts +20 -0
- package/scripts/migrate-livingdocs-build/dev/configuration-defaults.js +18 -0
- package/scripts/migrate-livingdocs-build/dev/configuration.d.ts +2 -0
- package/scripts/migrate-livingdocs-build/dev/configuration.js +34 -0
- package/scripts/migrate-livingdocs-build/dev/lib.d.ts +33 -0
- package/scripts/migrate-livingdocs-build/dev/lib.js +251 -0
- package/scripts/migrate-livingdocs-build/dev/livingdocs-design.d.ts +9 -0
- package/scripts/migrate-livingdocs-build/dev/livingdocs-design.js +80 -0
- package/scripts/migrate-livingdocs-build/dev/logger.d.ts +2 -0
- package/scripts/migrate-livingdocs-build/dev/logger.js +16 -0
- package/scripts/migrate-livingdocs-build/dev/migrate.d.ts +22 -0
- package/scripts/migrate-livingdocs-build/dev/migrate.js +241 -0
- package/scripts/migrate-livingdocs-build/readme.md +62 -0
- package/scripts/preparePublish.d.ts +1 -0
- package/scripts/preparePublish.js +88 -0
- package/scripts/renamePackage.d.ts +1 -0
- package/scripts/renamePackage.js +48 -0
- package/scripts/utils.d.ts +49 -0
- package/scripts/utils.js +106 -0
- package/scripts/vite.d.ts +10 -0
- package/scripts/vite.js +58 -0
- package/scss/colors/functions.scss +18 -0
- package/scss/colors/index.scss +3 -0
- package/scss/colors/mixins.scss +45 -0
- package/scss/colors/variables.scss +6 -0
- package/scss/config.scss +7 -0
- package/scss/core-styles.scss +22 -0
- package/scss/fonts/functions.scss +21 -0
- package/scss/fonts/index.scss +3 -0
- package/scss/fonts/mixins.scss +31 -0
- package/scss/fonts/variables.scss +8 -0
- package/scss/grid/functions.scss +29 -0
- package/scss/grid/index.scss +3 -0
- package/scss/grid/mixins.scss +388 -0
- package/scss/grid/variables.scss +10 -0
- package/scss/helpers/functions.scss +0 -0
- package/scss/helpers/index.scss +3 -0
- package/scss/helpers/mixins.scss +87 -0
- package/scss/helpers/variables.scss +7 -0
- package/scss/index.scss +8 -0
- package/scss/meta/functions.scss +64 -0
- package/scss/meta/index.scss +3 -0
- package/scss/meta/mixins.scss +6 -0
- package/scss/meta/variables.scss +8 -0
- package/scss/spacer/functions.scss +9 -0
- package/scss/spacer/index.scss +3 -0
- package/scss/spacer/mixins.scss +236 -0
- package/scss/spacer/variables.scss +6 -0
- package/scss/system/functions.scss +77 -0
- package/scss/system/index.scss +3 -0
- package/scss/system/mixins.scss +27 -0
- package/scss/system/root.scss +39 -0
- package/scss/system/variables.scss +13 -0
- package/scss/typography/functions.scss +63 -0
- package/scss/typography/index.scss +3 -0
- package/scss/typography/mixins.scss +262 -0
- package/scss/typography/variables.scss +11 -0
- package/tags.txt +1 -0
|
@@ -0,0 +1,251 @@
|
|
|
1
|
+
import fs from 'fs';
|
|
2
|
+
import { globbySync } from 'globby';
|
|
3
|
+
import logger from './logger.js';
|
|
4
|
+
|
|
5
|
+
const bFileExists = (path) => {
|
|
6
|
+
return fs.existsSync(path);
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
function getAllComponentPaths(componentPath) {
|
|
10
|
+
const files = globbySync(componentPath);
|
|
11
|
+
return files;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
function removeFolder(path) {
|
|
15
|
+
if (bFileExists(path)) {
|
|
16
|
+
fs.rmSync(path, { recursive: true });
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
function removeFile(path) {
|
|
21
|
+
if (bFileExists(path)) {
|
|
22
|
+
fs.rmSync(path);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
function minifyHtml(s) {
|
|
27
|
+
return s
|
|
28
|
+
? s
|
|
29
|
+
.replace(/\>[\r\n ]+\</g, '><') // Removes new lines and irrelevant spaces which might affect layout, and are better gone
|
|
30
|
+
.replace(/(<.*?>)|\s+/g, (m, $1) => ($1 ? $1 : ' '))
|
|
31
|
+
.trim()
|
|
32
|
+
: '';
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
function testComponentExistV1(designData, components) {
|
|
36
|
+
const componentNames = components.map(
|
|
37
|
+
(component) => component.configurationData.name,
|
|
38
|
+
);
|
|
39
|
+
designData.groups.forEach((componentGroup) => {
|
|
40
|
+
componentGroup.components.forEach((c) => {
|
|
41
|
+
if (!componentNames.includes(c)) {
|
|
42
|
+
throw {
|
|
43
|
+
message: `component "${c}" in componentGroup "${componentGroup.label}" does not exist`,
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
function testComponentExistV2(designData, components) {
|
|
51
|
+
designData.designSettings.componentGroups.forEach((componentGroup) => {
|
|
52
|
+
componentGroup.components.forEach((componentName) => {
|
|
53
|
+
if (
|
|
54
|
+
!components.find((component) => {
|
|
55
|
+
return component.configurationData.name === componentName;
|
|
56
|
+
})
|
|
57
|
+
) {
|
|
58
|
+
throw {
|
|
59
|
+
message: `component "${componentName}" in componentGroup "${componentGroup.label}" does not exist`,
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
return true;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
function testPropertyExistV1(designData, components) {
|
|
69
|
+
const allProperties = Object.keys(designData.componentProperties);
|
|
70
|
+
|
|
71
|
+
for (let index = 0; index < components.length; index++) {
|
|
72
|
+
const component = components[index];
|
|
73
|
+
|
|
74
|
+
if (
|
|
75
|
+
component.configurationData.properties &&
|
|
76
|
+
component.configurationData.properties.length > 0
|
|
77
|
+
) {
|
|
78
|
+
component.configurationData.properties.forEach((cProperty) => {
|
|
79
|
+
if (!allProperties.includes(cProperty)) {
|
|
80
|
+
throw {
|
|
81
|
+
message: `property "${cProperty}" in component "${component.configurationData.name}" is not present in design`,
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
function testPropertyExistV2(designData, components) {
|
|
90
|
+
const allProperties = designData.designSettings.componentProperties.map(
|
|
91
|
+
(p) => p.name,
|
|
92
|
+
);
|
|
93
|
+
for (let index = 0; index < components.length; index++) {
|
|
94
|
+
const component = components[index];
|
|
95
|
+
|
|
96
|
+
if (
|
|
97
|
+
component.configurationData.properties &&
|
|
98
|
+
component.configurationData.properties.length > 0
|
|
99
|
+
) {
|
|
100
|
+
component.configurationData.properties.forEach((cProperty) => {
|
|
101
|
+
if (!allProperties.includes(cProperty)) {
|
|
102
|
+
throw {
|
|
103
|
+
message: `property "${cProperty}" in component "${component.configurationData.name}" is not present in design`,
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
function testComponentsAllUsedV1(designData, components) {
|
|
112
|
+
const componentGroupComponents = [
|
|
113
|
+
...designData.groups.map((componentGroup) => componentGroup.components),
|
|
114
|
+
].flat(1);
|
|
115
|
+
|
|
116
|
+
components.forEach((component) => {
|
|
117
|
+
if (
|
|
118
|
+
!componentGroupComponents.find(
|
|
119
|
+
(c) => c === component.configurationData.name,
|
|
120
|
+
)
|
|
121
|
+
) {
|
|
122
|
+
logger.warn(
|
|
123
|
+
`component ${component.path} is unused in config.json, will not be packed into zip`,
|
|
124
|
+
);
|
|
125
|
+
}
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
function testComponentsAllUsedV2(designData, components) {
|
|
130
|
+
const componentGroupComponents = [
|
|
131
|
+
...designData.designSettings.componentGroups.map(
|
|
132
|
+
(componentGroup) => componentGroup.components,
|
|
133
|
+
),
|
|
134
|
+
].flat(1);
|
|
135
|
+
|
|
136
|
+
components.forEach((component) => {
|
|
137
|
+
if (
|
|
138
|
+
!componentGroupComponents.find(
|
|
139
|
+
(c) => c === component.configurationData.name,
|
|
140
|
+
)
|
|
141
|
+
) {
|
|
142
|
+
logger.warn(
|
|
143
|
+
`component ${component.path} is unused in config.json, will not be packed into zip`,
|
|
144
|
+
);
|
|
145
|
+
}
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
function testDesignPropertiesV1(designData, components) {
|
|
150
|
+
Object.keys(designData.componentProperties).forEach((componentProperty) => {
|
|
151
|
+
if (!propertyExistInComponentsV1(componentProperty, components)) {
|
|
152
|
+
logger.info(`property "${componentProperty}" is never used`);
|
|
153
|
+
}
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
function testDesignPropertiesV2(designData, components) {
|
|
158
|
+
designData.designSettings.componentProperties.forEach((componentProperty) => {
|
|
159
|
+
if (!propertyExistInComponentsV2(componentProperty.name, components)) {
|
|
160
|
+
logger.info(`property "${componentProperty.name}" is never used`);
|
|
161
|
+
}
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
function propertyExistInComponentsV1(property, components) {
|
|
166
|
+
for (let index = 0; index < components.length; index++) {
|
|
167
|
+
const component = components[index];
|
|
168
|
+
if (
|
|
169
|
+
component.configurationData.properties &&
|
|
170
|
+
component.configurationData.properties.includes(property)
|
|
171
|
+
) {
|
|
172
|
+
return true;
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
return false;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
function propertyExistInComponentsV2(property, components) {
|
|
180
|
+
for (let index = 0; index < components.length; index++) {
|
|
181
|
+
const component = components[index];
|
|
182
|
+
if (
|
|
183
|
+
component.configurationData.properties &&
|
|
184
|
+
component.configurationData.properties.includes(property)
|
|
185
|
+
) {
|
|
186
|
+
return true;
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
return false;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
function mergeDesignV1(designData, components) {
|
|
194
|
+
const newDesignData = JSON.parse(JSON.stringify(designData));
|
|
195
|
+
const designComponents = designData.groups
|
|
196
|
+
.map((componentGroup) => componentGroup.components)
|
|
197
|
+
.flat(1);
|
|
198
|
+
|
|
199
|
+
newDesignData.components = components
|
|
200
|
+
.filter((component) => {
|
|
201
|
+
return designComponents.includes(component.configurationData.name);
|
|
202
|
+
})
|
|
203
|
+
.map((component) => {
|
|
204
|
+
return {
|
|
205
|
+
...component.configurationData,
|
|
206
|
+
html: minifyHtml(component.html),
|
|
207
|
+
};
|
|
208
|
+
});
|
|
209
|
+
|
|
210
|
+
return newDesignData;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
function mergeDesignV2(designData, components) {
|
|
214
|
+
const newDesignData = JSON.parse(JSON.stringify(designData));
|
|
215
|
+
const designComponents = designData.designSettings.componentGroups
|
|
216
|
+
.map((componentGroup) => componentGroup.components)
|
|
217
|
+
.flat(1);
|
|
218
|
+
|
|
219
|
+
newDesignData.components = components
|
|
220
|
+
.filter((component) => {
|
|
221
|
+
return designComponents.includes(component.configurationData.name);
|
|
222
|
+
})
|
|
223
|
+
.map((component) => {
|
|
224
|
+
return {
|
|
225
|
+
...component.configurationData,
|
|
226
|
+
html: minifyHtml(component.html),
|
|
227
|
+
};
|
|
228
|
+
});
|
|
229
|
+
|
|
230
|
+
return newDesignData;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
const lib = {
|
|
234
|
+
bFileExists,
|
|
235
|
+
removeFolder,
|
|
236
|
+
removeFile,
|
|
237
|
+
getAllComponentPaths,
|
|
238
|
+
minifyHtml,
|
|
239
|
+
mergeDesignV1,
|
|
240
|
+
mergeDesignV2,
|
|
241
|
+
testComponentExistV1,
|
|
242
|
+
testComponentExistV2,
|
|
243
|
+
testPropertyExistV1,
|
|
244
|
+
testPropertyExistV2,
|
|
245
|
+
testComponentsAllUsedV1,
|
|
246
|
+
testComponentsAllUsedV2,
|
|
247
|
+
testDesignPropertiesV1,
|
|
248
|
+
testDesignPropertiesV2,
|
|
249
|
+
};
|
|
250
|
+
|
|
251
|
+
export default lib;
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import fs from 'fs';
|
|
2
|
+
import lib from './lib.js';
|
|
3
|
+
import logger from './logger.js';
|
|
4
|
+
import * as cheerio from 'cheerio';
|
|
5
|
+
|
|
6
|
+
class LivingdocsDesign {
|
|
7
|
+
static loadDesign(configuration) {
|
|
8
|
+
logger.debug('loading design ' + configuration.build.design);
|
|
9
|
+
if (!lib.bFileExists(configuration.build.design)) {
|
|
10
|
+
throw {
|
|
11
|
+
message: 'design not found at ' + configuration.build.design,
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
try {
|
|
16
|
+
const designJSON = JSON.parse(
|
|
17
|
+
fs.readFileSync(configuration.build.design, {
|
|
18
|
+
encoding: 'utf8',
|
|
19
|
+
flag: 'r',
|
|
20
|
+
}),
|
|
21
|
+
);
|
|
22
|
+
|
|
23
|
+
return designJSON;
|
|
24
|
+
} catch (error) {
|
|
25
|
+
throw {
|
|
26
|
+
message: 'design could not be loaded at ' + configuration.build.design,
|
|
27
|
+
error: error,
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
static loadComponents(configuration) {
|
|
33
|
+
logger.debug('loading components ' + configuration.build.components);
|
|
34
|
+
const componentPaths = lib.getAllComponentPaths(
|
|
35
|
+
configuration.build.components,
|
|
36
|
+
);
|
|
37
|
+
const components = [];
|
|
38
|
+
|
|
39
|
+
for (let index = 0; index < componentPaths.length; index++) {
|
|
40
|
+
const path = componentPaths[index];
|
|
41
|
+
|
|
42
|
+
const raw = fs.readFileSync(path);
|
|
43
|
+
|
|
44
|
+
const htmlObj = cheerio.load(raw.toString());
|
|
45
|
+
let configurationData = null;
|
|
46
|
+
|
|
47
|
+
// check component configuration for syntax errors
|
|
48
|
+
try {
|
|
49
|
+
configurationData = JSON.parse(
|
|
50
|
+
htmlObj(configuration.configurationSelector).html(),
|
|
51
|
+
);
|
|
52
|
+
} catch (error) {
|
|
53
|
+
throw {
|
|
54
|
+
message: `JSON error in component ${path}`,
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
htmlObj(configuration.configurationSelector).remove();
|
|
59
|
+
|
|
60
|
+
const children = htmlObj('body > *:not(script)');
|
|
61
|
+
|
|
62
|
+
// check html for children count
|
|
63
|
+
if (children.length === 1) {
|
|
64
|
+
components.push({
|
|
65
|
+
path: path,
|
|
66
|
+
configurationData: configurationData,
|
|
67
|
+
html: htmlObj.html(children[0]),
|
|
68
|
+
});
|
|
69
|
+
} else {
|
|
70
|
+
throw {
|
|
71
|
+
message: `template ${path} contains ${children.length} root elements. Components only work with one root element.`,
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
return components;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export default LivingdocsDesign;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import winston from 'winston';
|
|
2
|
+
|
|
3
|
+
const logger = winston.createLogger({
|
|
4
|
+
level: 'debug',
|
|
5
|
+
format: winston.format.json(),
|
|
6
|
+
transports: [
|
|
7
|
+
new winston.transports.Console({
|
|
8
|
+
format: winston.format.combine(
|
|
9
|
+
winston.format.colorize(),
|
|
10
|
+
winston.format.simple(),
|
|
11
|
+
),
|
|
12
|
+
}),
|
|
13
|
+
],
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
export default logger;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export default Migrate;
|
|
2
|
+
declare class Migrate {
|
|
3
|
+
static migrateDesign(oldDesignData: any): {
|
|
4
|
+
v: number;
|
|
5
|
+
name: string;
|
|
6
|
+
version: string;
|
|
7
|
+
designSettings: {
|
|
8
|
+
componentProperties: any[];
|
|
9
|
+
defaultComponents: {};
|
|
10
|
+
prefilledComponents: {};
|
|
11
|
+
componentGroups: any[];
|
|
12
|
+
fieldExtractor: {};
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
static migrateComponentProperties(oldProperties: any): any[];
|
|
16
|
+
static migrateComponents(components: any): any;
|
|
17
|
+
static getDirectiveType(directive: any, componentPath: any, directiveKey: any): "include" | "" | "image" | "editable" | "container";
|
|
18
|
+
static writeDesign(newDesign: any): void;
|
|
19
|
+
static writeComponents(newComponents: any): void;
|
|
20
|
+
static makeComponentFileString(component: any): string;
|
|
21
|
+
static writeManualReviews(): void;
|
|
22
|
+
}
|
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
import configuration from './configuration.js';
|
|
2
|
+
import lib from './lib.js';
|
|
3
|
+
import logger from './logger.js';
|
|
4
|
+
import fs from 'fs';
|
|
5
|
+
|
|
6
|
+
const migrationManualReviews = [];
|
|
7
|
+
|
|
8
|
+
class Migrate {
|
|
9
|
+
static migrateDesign(oldDesignData) {
|
|
10
|
+
let newDesignData = {
|
|
11
|
+
v: 2,
|
|
12
|
+
name: '',
|
|
13
|
+
version: '',
|
|
14
|
+
designSettings: {
|
|
15
|
+
componentProperties: [],
|
|
16
|
+
defaultComponents: {},
|
|
17
|
+
prefilledComponents: {},
|
|
18
|
+
componentGroups: [],
|
|
19
|
+
fieldExtractor: {},
|
|
20
|
+
},
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
// mapping
|
|
24
|
+
newDesignData.name = oldDesignData.name;
|
|
25
|
+
newDesignData.version = oldDesignData.version;
|
|
26
|
+
|
|
27
|
+
newDesignData.designSettings.assets = oldDesignData.assets;
|
|
28
|
+
newDesignData.designSettings.componentProperties =
|
|
29
|
+
this.migrateComponentProperties(oldDesignData.componentProperties);
|
|
30
|
+
newDesignData.designSettings.defaultComponents =
|
|
31
|
+
oldDesignData.defaultComponents;
|
|
32
|
+
newDesignData.designSettings.prefilledComponents =
|
|
33
|
+
oldDesignData.prefilledComponents;
|
|
34
|
+
newDesignData.designSettings.componentGroups = oldDesignData.groups;
|
|
35
|
+
newDesignData.designSettings.fieldExtractor = oldDesignData.metadata;
|
|
36
|
+
newDesignData.designSettings.defaultComponents =
|
|
37
|
+
oldDesignData.defaultComponents;
|
|
38
|
+
|
|
39
|
+
// delete removed properties
|
|
40
|
+
delete oldDesignData.label;
|
|
41
|
+
delete oldDesignData.license;
|
|
42
|
+
delete oldDesignData.description;
|
|
43
|
+
delete oldDesignData.author;
|
|
44
|
+
delete oldDesignData.imageRatios;
|
|
45
|
+
delete oldDesignData.defaultLayout;
|
|
46
|
+
|
|
47
|
+
// delete already moved properties
|
|
48
|
+
delete oldDesignData.name;
|
|
49
|
+
delete oldDesignData.version;
|
|
50
|
+
delete oldDesignData.assets;
|
|
51
|
+
delete oldDesignData.componentProperties;
|
|
52
|
+
delete oldDesignData.defaultComponents;
|
|
53
|
+
delete oldDesignData.prefilledComponents;
|
|
54
|
+
delete oldDesignData.groups;
|
|
55
|
+
delete oldDesignData.metadata;
|
|
56
|
+
delete oldDesignData.defaultComponents;
|
|
57
|
+
delete oldDesignData.defaultContent;
|
|
58
|
+
|
|
59
|
+
return newDesignData;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
static migrateComponentProperties(oldProperties) {
|
|
63
|
+
const newProperties = [];
|
|
64
|
+
|
|
65
|
+
Object.keys(oldProperties).forEach((key) => {
|
|
66
|
+
newProperties.push({
|
|
67
|
+
name: key,
|
|
68
|
+
...oldProperties[key],
|
|
69
|
+
});
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
return newProperties;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
static migrateComponents(components) {
|
|
76
|
+
components.map((component) => {
|
|
77
|
+
const oldData = component.configurationData;
|
|
78
|
+
// clean copy the old Data
|
|
79
|
+
const newData = JSON.parse(JSON.stringify(oldData));
|
|
80
|
+
|
|
81
|
+
if (!!newData.directives) {
|
|
82
|
+
const directiveKeys = Object.keys(newData.directives);
|
|
83
|
+
|
|
84
|
+
let newDirectives = [];
|
|
85
|
+
if (directiveKeys) {
|
|
86
|
+
// remap directive object
|
|
87
|
+
directiveKeys.forEach((directiveKey) => {
|
|
88
|
+
const oldDirective = oldData.directives[directiveKey];
|
|
89
|
+
|
|
90
|
+
let newDirective = {
|
|
91
|
+
name: directiveKey,
|
|
92
|
+
...oldDirective,
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
if (!newDirective.type) {
|
|
96
|
+
newDirective.type = this.getDirectiveType(
|
|
97
|
+
oldDirective,
|
|
98
|
+
component.path,
|
|
99
|
+
directiveKey,
|
|
100
|
+
);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
if (newDirective.imageRatios) {
|
|
104
|
+
newDirective.imageRatios.forEach((imageRatio) => {
|
|
105
|
+
const regex = new RegExp(/[\d]{1,}\:[\d]{1,}/gm);
|
|
106
|
+
const regexResult = regex.test(imageRatio.trim());
|
|
107
|
+
if (!regexResult) {
|
|
108
|
+
migrationManualReviews.push({
|
|
109
|
+
path: component.path,
|
|
110
|
+
directive: 'imageRatio: ' + imageRatio + ' ',
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
});
|
|
114
|
+
|
|
115
|
+
if (newDirective.allowOriginalRatio) {
|
|
116
|
+
newDirective.recommendedRatios = newDirective.imageRatios;
|
|
117
|
+
delete newDirective.imageRatios;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
delete newDirective.allowOriginalRatio;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
newDirectives.push(newDirective);
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
newData.directives = newDirectives;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
component.configurationData = newData;
|
|
131
|
+
|
|
132
|
+
return component;
|
|
133
|
+
});
|
|
134
|
+
|
|
135
|
+
return components;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
static getDirectiveType(directive, componentPath, directiveKey) {
|
|
139
|
+
if (
|
|
140
|
+
directive.allowedChildren ||
|
|
141
|
+
directive.defaultComponents ||
|
|
142
|
+
directive.defaultContent
|
|
143
|
+
) {
|
|
144
|
+
return 'container';
|
|
145
|
+
} else if (
|
|
146
|
+
directive.plainText ||
|
|
147
|
+
directive.excludeFromTextCount ||
|
|
148
|
+
directive.maxLength ||
|
|
149
|
+
directive.recommendedMaxLength
|
|
150
|
+
) {
|
|
151
|
+
return 'editable';
|
|
152
|
+
} else if (directive.imageRatios || directive.allowOriginalRatio) {
|
|
153
|
+
return 'image';
|
|
154
|
+
} else if (directive.service || directive.services) {
|
|
155
|
+
return 'include';
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
migrationManualReviews.push({
|
|
159
|
+
path: componentPath,
|
|
160
|
+
directive: directiveKey,
|
|
161
|
+
});
|
|
162
|
+
|
|
163
|
+
return '';
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
static writeDesign(newDesign) {
|
|
167
|
+
if (lib.bFileExists(configuration.migration.dest + '/config.json')) {
|
|
168
|
+
fs.rmSync(configuration.migration.dest + '/config.json');
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
fs.mkdirSync(configuration.migration.dest, { recursive: true });
|
|
172
|
+
|
|
173
|
+
fs.writeFileSync(
|
|
174
|
+
configuration.migration.dest + '/config.json',
|
|
175
|
+
JSON.stringify(newDesign, null, '\t'),
|
|
176
|
+
{
|
|
177
|
+
encoding: 'utf8',
|
|
178
|
+
flag: 'a+',
|
|
179
|
+
mode: 0o666,
|
|
180
|
+
},
|
|
181
|
+
);
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
static writeComponents(newComponents) {
|
|
185
|
+
newComponents.forEach((component) => {
|
|
186
|
+
const pathEndIndex = configuration.migration.components.indexOf('*');
|
|
187
|
+
const toReplace = configuration.migration.components.substring(
|
|
188
|
+
0,
|
|
189
|
+
pathEndIndex,
|
|
190
|
+
);
|
|
191
|
+
const newFullPath = component.path.replace(
|
|
192
|
+
toReplace,
|
|
193
|
+
configuration.migration.dest + '/components/',
|
|
194
|
+
);
|
|
195
|
+
const newPath = newFullPath.split('/');
|
|
196
|
+
|
|
197
|
+
newPath.splice(-1);
|
|
198
|
+
|
|
199
|
+
fs.mkdirSync(newPath.join('/'), { recursive: true });
|
|
200
|
+
|
|
201
|
+
fs.writeFileSync(newFullPath, this.makeComponentFileString(component));
|
|
202
|
+
});
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
static makeComponentFileString(component) {
|
|
206
|
+
let data = `<script type="ld-conf">\n${JSON.stringify(component.configurationData, null, '\t')}\n</script>\n`;
|
|
207
|
+
data += component.html;
|
|
208
|
+
|
|
209
|
+
return data;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
static writeManualReviews() {
|
|
213
|
+
if (migrationManualReviews.length == 0) {
|
|
214
|
+
console.info('probably no manual reviews required');
|
|
215
|
+
return;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
migrationManualReviews.forEach((review) => {
|
|
219
|
+
logger.warn(
|
|
220
|
+
`component ${review.path} directive ${review.directive} requires manual review`,
|
|
221
|
+
);
|
|
222
|
+
});
|
|
223
|
+
|
|
224
|
+
const textOutput = migrationManualReviews
|
|
225
|
+
.map(
|
|
226
|
+
(review) =>
|
|
227
|
+
`component ${review.path} directive ${review.directive} requires manual review`,
|
|
228
|
+
)
|
|
229
|
+
.join('\n');
|
|
230
|
+
fs.writeFileSync('./manual-review.txt', textOutput, {
|
|
231
|
+
encoding: 'utf8',
|
|
232
|
+
flag: 'a+',
|
|
233
|
+
mode: 0o666,
|
|
234
|
+
});
|
|
235
|
+
logger.warn(
|
|
236
|
+
`found [${migrationManualReviews.length}] issues, building a design without manual review will fail. ./manual-review.txt`,
|
|
237
|
+
);
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
export default Migrate;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# Installation
|
|
2
|
+
|
|
3
|
+
sudo npm i --location=global git@github.com:mmssolutionsio/migrate-livingdocs-build.git
|
|
4
|
+
|
|
5
|
+
## Update
|
|
6
|
+
|
|
7
|
+
sudo npm update migrate-livingdocs-build --location=global
|
|
8
|
+
|
|
9
|
+
# Usage
|
|
10
|
+
|
|
11
|
+
## Node Version
|
|
12
|
+
|
|
13
|
+
at least "16.15.1"
|
|
14
|
+
|
|
15
|
+
## Custom configuration
|
|
16
|
+
|
|
17
|
+
default values which can be overwritten in package.json of the current ld project
|
|
18
|
+
|
|
19
|
+
{
|
|
20
|
+
"nhs-design-builder": {
|
|
21
|
+
"configurationSelector": "[type=\"ld-conf\"]",
|
|
22
|
+
"build": {
|
|
23
|
+
"design": "./src/config.json",
|
|
24
|
+
"components": "./src/components/**/*.html",
|
|
25
|
+
"requiredFolders": [
|
|
26
|
+
"./src/css",
|
|
27
|
+
"./src/fonts",
|
|
28
|
+
"./src/svg",
|
|
29
|
+
"./src/images"
|
|
30
|
+
],
|
|
31
|
+
"dist": "./dist",
|
|
32
|
+
"dest": "./",
|
|
33
|
+
"archiveName": "design.zip"
|
|
34
|
+
},
|
|
35
|
+
"migration": {
|
|
36
|
+
"design": "./src/config.json",
|
|
37
|
+
"components": "./src/components/**/*.html",
|
|
38
|
+
"dest": "./design-v2",
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
| prop | desc |
|
|
44
|
+
| --------------------- | ----------------------------------------------------- |
|
|
45
|
+
| configurationSelector | querySelector string for script tag in html component |
|
|
46
|
+
| build.design | location of base ld-design.json file |
|
|
47
|
+
| build.components | location of html templates |
|
|
48
|
+
| build.requiredFolders | array of folders which are copied into the dist |
|
|
49
|
+
| build.dist | dist folder, will be created and deleted |
|
|
50
|
+
| build.dest | destination for the archive |
|
|
51
|
+
| build.archiveName | zipped design file name |
|
|
52
|
+
| migration.design | location of base ld-design.json file |
|
|
53
|
+
| migration.components | location of html templates |
|
|
54
|
+
| dest | folder in which all migrated files will be written |
|
|
55
|
+
|
|
56
|
+
## Build
|
|
57
|
+
|
|
58
|
+
cli command `nhs-ld-build` in ld project folder to make dist, build design and zip dist.
|
|
59
|
+
|
|
60
|
+
## Migrate
|
|
61
|
+
|
|
62
|
+
cli command `nhs-ld-migrate` in ld project folder to migrate html components and config.json, and write into a new location.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export function preparePublish(version: any): Promise<any>;
|