@eox/pages-theme-esa 0.7.6 → 0.8.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.
package/README.md CHANGED
@@ -17,3 +17,109 @@ export default {
17
17
  ```
18
18
 
19
19
  See also the [Vitepress Docs](https://vitepress.dev/guide/custom-theme#consuming-a-custom-theme).
20
+
21
+
22
+ ### Feedback Form
23
+
24
+ **Feedback Form** for collecting user feedback can be enabled by configuring the theme:
25
+
26
+ ```javascript
27
+ // themeConfig
28
+ {
29
+ feedback: {
30
+ endpoint: "https://example.com/create-issue?repo=github.com/org/repo" // or repo can be passed in request body by being included in schema such as a hidden field with default value
31
+ schema: {
32
+ "type": "object",
33
+ "title": "Feedback contains URL of current page automatically. Let us know your feedback or issue type.",
34
+ "options": {
35
+ "remove_empty_properties": true,
36
+ "remove_additional_properties": true
37
+ },
38
+ "oneOf": [
39
+ {
40
+ "title": "Feature Request",
41
+ "properties": {
42
+ "type_feature": {
43
+ "type": "string",
44
+ "default": "feature",
45
+ "options": {
46
+ "hidden": true
47
+ }
48
+ },
49
+ "title": {
50
+ "type": "string",
51
+ "title": "Title"
52
+ },
53
+ "Expected behavior": {
54
+ "type": "string",
55
+ "format": "textarea",
56
+ "minLength": 1,
57
+ "options": {
58
+ "inputAttributes": {
59
+ "placeholder": "Describe the new functionality and how it would help you."
60
+ }
61
+ }
62
+ },
63
+ "Contact information or additional comments (optional)": {
64
+ "type": "string"
65
+ }
66
+ },
67
+ "required": [
68
+ "type_feature"
69
+ ],
70
+ "additionalProperties": false
71
+ },
72
+ {
73
+ "title": "Issue or Question",
74
+ "properties": {
75
+ "type_catalog": {
76
+ "type": "string",
77
+ "default": "catalog",
78
+ "options": {
79
+ "hidden": true
80
+ }
81
+ },
82
+ "title": {
83
+ "type": "string",
84
+ "title": "Title"
85
+ },
86
+ "Steps to reproduce": {
87
+ "type": "string",
88
+ "format": "textarea",
89
+ "minLength": 1,
90
+ "options": {
91
+ "inputAttributes": {
92
+ "placeholder": "Describe what you tried to do."
93
+ }
94
+ }
95
+ },
96
+ "Expected content": {
97
+ "type": "string",
98
+ "format": "textarea",
99
+ "minLength": 1,
100
+ "options": {
101
+ "inputAttributes": {
102
+ "placeholder": "What would you like to see?"
103
+ }
104
+ }
105
+ }
106
+ },
107
+ "required": [
108
+ "type_catalog"
109
+ ],
110
+ "additionalProperties": false
111
+ },
112
+ ]
113
+ }, // optional - feedback has a default single text field
114
+ position: "bottom-right", // can be any of bottom-left, top-left, bottom-right, top-right
115
+ }
116
+ }
117
+ ```
118
+
119
+ feedback form can be disabled on individual pages via frontmatter configuration
120
+
121
+ ```yaml
122
+ ---
123
+ feedback: false
124
+ ---
125
+ ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eox/pages-theme-esa",
3
- "version": "0.7.6",
3
+ "version": "0.8.0",
4
4
  "type": "module",
5
5
  "description": "Vitepress Theme with ESA branding",
6
6
  "main": "src/index.js",
@@ -11,5 +11,8 @@
11
11
  },
12
12
  "devDependencies": {
13
13
  "@eox/eslint-config": "^2.0.0"
14
+ },
15
+ "dependencies": {
16
+ "@eox/feedback": "^1.1.1"
14
17
  }
15
18
  }
package/src/Layout.vue CHANGED
@@ -170,6 +170,13 @@ onMounted(async () => {
170
170
  ]
171
171
  "
172
172
  ></esa-footer>
173
+ <ClientOnly v-if="theme.feedback && frontmatter?.feedback !== false">
174
+ <eox-feedback-button
175
+ :endpoint="theme.feedback?.endpoint"
176
+ .schema="theme.feedback?.schema"
177
+ :position="theme.feedback?.position"
178
+ />
179
+ </ClientOnly>
173
180
  <esa-cookies
174
181
  link="https://www.esa.int/Services/Cookies_notice"
175
182
  style="display: none"
package/src/index.js CHANGED
@@ -13,6 +13,7 @@ export default {
13
13
  app.component("BlogGallery", BlogGallery);
14
14
  router.onBeforePageLoad = async (to) => {
15
15
  if (!import.meta.env.SSR) {
16
+ import("@eox/feedback");
16
17
  if (to.includes("/blog/") && to !== "/blog/" && to !== "/blog/README") {
17
18
  // console.log(router.route.data)
18
19
  router.route.data = {
package/src/style.css CHANGED
@@ -236,3 +236,6 @@ section > p {
236
236
  .VPFooter {
237
237
  display: none;
238
238
  }
239
+ eox-feedback-button {
240
+ z-index: calc(var(--vp-z-index-footer) + 1);
241
+ }