@eox/pages-theme-eox 0.11.5 → 1.1.0

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.
Files changed (47) hide show
  1. package/.gitlab-ci.yml +30 -0
  2. package/.release-it.json +15 -0
  3. package/CHANGELOG.md +19 -0
  4. package/README.md +274 -0
  5. package/cypress/support/commands.js +25 -0
  6. package/cypress/support/component-index.html +11 -0
  7. package/cypress/support/component.js +22 -0
  8. package/cypress/support/mocks/features.data.js +9 -0
  9. package/cypress/support/mocks/helpers.js +63 -0
  10. package/cypress/support/mocks/vitepress.js +83 -0
  11. package/cypress.config.js +46 -0
  12. package/package.json +12 -2
  13. package/src/components/CTASection.cy.js +72 -0
  14. package/src/components/CookieBanner.cy.js +49 -0
  15. package/src/components/CookieBanner.vue +19 -6
  16. package/src/components/CookieSettings.cy.js +73 -0
  17. package/src/components/CookieSettings.vue +35 -27
  18. package/src/components/DataTable.cy.js +58 -0
  19. package/src/components/DataTable.vue +5 -1
  20. package/src/components/FeatureCard.cy.js +83 -0
  21. package/src/components/FeatureCard.vue +11 -5
  22. package/src/components/FeatureSection.cy.js +63 -0
  23. package/src/components/FeatureSection.vue +8 -4
  24. package/src/components/FeaturesGallery.cy.js +45 -0
  25. package/src/components/FeaturesGallery.vue +6 -3
  26. package/src/components/Footer.cy.js +77 -0
  27. package/src/components/Footer.vue +35 -14
  28. package/src/components/HeroSection.cy.js +66 -0
  29. package/src/components/LogoSection.cy.js +53 -0
  30. package/src/components/MobileNavDropdown.cy.js +67 -0
  31. package/src/components/MobileNavDropdown.vue +48 -0
  32. package/src/components/NavBar.cy.js +143 -0
  33. package/src/components/NavBar.vue +144 -8
  34. package/src/components/NavDropdown.cy.js +71 -0
  35. package/src/components/NavDropdown.vue +62 -0
  36. package/src/components/NewsBanner.cy.js +23 -0
  37. package/src/components/NewsBanner.vue +0 -1
  38. package/src/components/NotFound.cy.js +16 -0
  39. package/src/components/NotFound.vue +8 -2
  40. package/src/components/PricingTable.cy.js +91 -0
  41. package/src/components/PricingTable.vue +24 -7
  42. package/src/components/Tutorial.cy.js +85 -0
  43. package/src/components/Tutorial.vue +162 -0
  44. package/src/helpers.js +78 -0
  45. package/src/index.js +3 -0
  46. package/src/style.css +121 -4
  47. package/src/vitepressConfig.mjs +141 -95
@@ -4,70 +4,71 @@
4
4
  * @param {object} brandConfig The brand config
5
5
  * @returns
6
6
  */
7
- export const generate = (brandConfig) => ({
8
- appearance: false,
9
- cleanUrls: true,
10
- description: brandConfig.meta?.description,
11
- head: [
12
- ["link", { rel: "icon", href: brandConfig.meta?.favicon }],
13
- // Open Graph / Facebook
14
- ["meta", { property: "og:type", content: "website" }],
15
- [
16
- "meta",
17
- {
18
- property: "og:url",
19
- content: brandConfig.home,
20
- },
21
- ],
22
- ["meta", { property: "og:title", content: brandConfig.meta?.title }],
23
- [
24
- "meta",
25
- {
26
- property: "og:description",
27
- content: brandConfig.meta?.description,
28
- },
29
- ],
30
- // TODO
31
- // [
32
- // "meta",
33
- // {
34
- // property: "og:image",
35
- // content:
36
- // "https://earthcode.esa.int/img/EarthCODE_Herobanner_1920x1080.jpg",
37
- // },
38
- // ],
39
- // Twitter
40
- ["meta", { property: "twitter:card", content: "summary_large_image" }],
41
- [
42
- "meta",
43
- {
44
- property: "twitter:url",
45
- content: brandConfig.home,
46
- },
47
- ],
48
- ["meta", { property: "twitter:title", content: brandConfig.meta?.title }],
49
- [
50
- "meta",
51
- {
52
- property: "twitter:description",
53
- content: brandConfig.meta?.description,
54
- },
55
- ],
56
- // TODO
57
- // [
58
- // "meta",
59
- // {
60
- // property: "twitter:image",
61
- // content:
62
- // "https://earthcode.esa.int/img/EarthCODE_Herobanner_1920x1080.jpg",
63
- // },
64
- // ],
65
- ...(brandConfig.analytics
66
- ? [
67
- [
68
- "script",
69
- {},
70
- `
7
+ export const generate = (brandConfig) => {
8
+ const config = {
9
+ appearance: false,
10
+ cleanUrls: true,
11
+ description: brandConfig.meta?.description,
12
+ head: [
13
+ ["link", { rel: "icon", href: brandConfig.meta?.favicon }],
14
+ // Open Graph / Facebook
15
+ ["meta", { property: "og:type", content: "website" }],
16
+ [
17
+ "meta",
18
+ {
19
+ property: "og:url",
20
+ content: brandConfig.home,
21
+ },
22
+ ],
23
+ ["meta", { property: "og:title", content: brandConfig.meta?.title }],
24
+ [
25
+ "meta",
26
+ {
27
+ property: "og:description",
28
+ content: brandConfig.meta?.description,
29
+ },
30
+ ],
31
+ // TODO
32
+ // [
33
+ // "meta",
34
+ // {
35
+ // property: "og:image",
36
+ // content:
37
+ // "https://earthcode.esa.int/img/EarthCODE_Herobanner_1920x1080.jpg",
38
+ // },
39
+ // ],
40
+ // Twitter
41
+ ["meta", { property: "twitter:card", content: "summary_large_image" }],
42
+ [
43
+ "meta",
44
+ {
45
+ property: "twitter:url",
46
+ content: brandConfig.home,
47
+ },
48
+ ],
49
+ ["meta", { property: "twitter:title", content: brandConfig.meta?.title }],
50
+ [
51
+ "meta",
52
+ {
53
+ property: "twitter:description",
54
+ content: brandConfig.meta?.description,
55
+ },
56
+ ],
57
+ // TODO
58
+ // [
59
+ // "meta",
60
+ // {
61
+ // property: "twitter:image",
62
+ // content:
63
+ // "https://earthcode.esa.int/img/EarthCODE_Herobanner_1920x1080.jpg",
64
+ // },
65
+ // ],
66
+ ...(brandConfig.analytics
67
+ ? [
68
+ [
69
+ "script",
70
+ {},
71
+ `
71
72
  var _paq = (window._paq = window._paq || []);
72
73
  /* tracker methods like "setCustomDimension" should be called before "trackPageView" */
73
74
  _paq.push(["requireCookieConsent"]);
@@ -86,39 +87,84 @@ export const generate = (brandConfig) => ({
86
87
  s.parentNode.insertBefore(g, s);
87
88
  })();
88
89
  `,
89
- ],
90
- ]
91
- : []),
92
- ],
93
- srcExclude: ["README.md"],
94
- themeConfig: {
95
- siteTitle: false,
96
- theme: {
97
- primaryColor: brandConfig.theme?.primary_color,
98
- secondaryColor:
99
- brandConfig.theme?.secondary_color || brandConfig.theme?.primary_color,
100
- brandConfig,
101
- },
102
- logo: { light: brandConfig.logo, dark: brandConfig.logo_dark },
103
- footer: {
104
- message: `Powered by <img src="https://cockpit.hub.eox.at/storage/uploads/eoxhub/eoxhub_icon.svg" style="display: inline; height: 20px; transform: translateY(5px)" />`,
105
- copyright:
106
- 'Copyright © 2014-present <a href="https://eox.at" target="_blank">EOX IT Services GmbH</a>',
90
+ ],
91
+ ]
92
+ : []),
93
+ ],
94
+ srcExclude: ["README.md"],
95
+ themeConfig: {
96
+ siteTitle: false,
97
+ theme: {
98
+ primaryColor: brandConfig.theme?.primary_color,
99
+ secondaryColor:
100
+ brandConfig.theme?.secondary_color ||
101
+ brandConfig.theme?.primary_color,
102
+ brandConfig,
103
+ },
104
+ logo: { light: brandConfig.logo, dark: brandConfig.logo_dark },
105
+ footer: {
106
+ message:
107
+ brandConfig.theme?.footer?.message ||
108
+ `Powered by <img src="https://cockpit.hub.eox.at/storage/uploads/eoxhub/eoxhub_icon.svg" style="display: inline; height: 20px; transform: translateY(5px)" />`,
109
+ copyright:
110
+ brandConfig.theme?.footer?.copyright ||
111
+ 'Copyright © 2014-present <a href="https://eox.at" target="_blank">EOX IT Services GmbH</a>',
112
+ },
107
113
  },
108
- },
109
- title: brandConfig.meta?.title,
110
- vite: {
111
- ssr: {
112
- noExternal: ["@eox/pages-theme-eox"],
114
+ title: brandConfig.meta?.title,
115
+ vite: {
116
+ ssr: {
117
+ noExternal: ["@eox/pages-theme-eox"],
118
+ },
113
119
  },
114
- },
115
- vue: {
116
- template: {
117
- compilerOptions: {
118
- isCustomElement: (tag) => {
119
- return tag.toLowerCase().includes("-");
120
+ vue: {
121
+ template: {
122
+ compilerOptions: {
123
+ isCustomElement: (tag) => {
124
+ return tag.toLowerCase().includes("-");
125
+ },
120
126
  },
121
127
  },
122
128
  },
123
- },
124
- });
129
+ };
130
+
131
+ if (brandConfig.i18n?.locale) {
132
+ const localeEntries = Object.entries(brandConfig.i18n.locale);
133
+ const currentLocale = brandConfig.i18n.currentLocale || "en";
134
+
135
+ if (localeEntries.length > 1) {
136
+ config.locales = Object.fromEntries(
137
+ localeEntries.map(([key, i18n]) => {
138
+ const isRoot = key === currentLocale;
139
+ return [
140
+ isRoot ? "root" : key,
141
+ {
142
+ label: key.toUpperCase(),
143
+ lang: key,
144
+ themeConfig: {
145
+ i18n,
146
+ ...(i18n.footer
147
+ ? { footer: { ...config.themeConfig.footer, ...i18n.footer } }
148
+ : {}),
149
+ },
150
+ },
151
+ ];
152
+ }),
153
+ );
154
+ } else {
155
+ const i18n =
156
+ brandConfig.i18n.locale[currentLocale] || localeEntries[0][1];
157
+ config.themeConfig.i18n = i18n;
158
+ if (i18n.footer) {
159
+ config.themeConfig.footer = {
160
+ ...config.themeConfig.footer,
161
+ ...i18n.footer,
162
+ };
163
+ }
164
+ }
165
+ } else if (brandConfig.i18n) {
166
+ config.themeConfig.i18n = brandConfig.i18n;
167
+ }
168
+
169
+ return config;
170
+ };