cec-nuxt-lib 0.10.3 → 0.10.4

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.
@@ -0,0 +1,12 @@
1
+ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
2
+ canvas: {
3
+ type: ObjectConstructor;
4
+ required: true;
5
+ };
6
+ }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
7
+ canvas: {
8
+ type: ObjectConstructor;
9
+ required: true;
10
+ };
11
+ }>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
12
+ export default _default;
@@ -1,32 +1,32 @@
1
- <script setup lang="ts">
2
- import { useState } from '#app';
3
- const page = useState('page');
1
+ <script setup>
2
+ import { useState } from "#app";
3
+ const page = useState("page");
4
+ const baseUrl = useState("baseUrl");
4
5
  const props = defineProps({
5
6
  reviewed: {
6
7
  type: String,
7
- required: true,
8
+ required: true
8
9
  },
9
10
  path: {
10
11
  type: String,
11
- required: true,
12
+ required: true
12
13
  },
13
14
  title: {
14
15
  type: String,
15
- required: true,
16
- },
16
+ required: true
17
+ }
17
18
  });
18
-
19
19
  const { path, title, reviewed } = props;
20
20
  </script>
21
21
 
22
22
  <template>
23
- <div class="mt-4">
23
+ <div class="mt-4 container">
24
24
  <div class="row">
25
25
  <div class="col-lg-8">
26
26
  <p v-if="reviewed && !page.hideReviewDate">
27
27
  <small
28
28
  >Page last reviewed:
29
- {{ new Date(reviewed).toLocaleDateString('en-GB') }}
29
+ {{ new Date(reviewed).toLocaleDateString("en-GB") }}
30
30
  </small>
31
31
  </p>
32
32
  <div class="accordion pb-4">
@@ -55,7 +55,7 @@ const { path, title, reviewed } = props;
55
55
  <ul class="list-unstyled list-inline">
56
56
  <li class="list-inline-item me-3">
57
57
  <a
58
- :href="`https://digital-core.cheshireeast.gov.uk/w/webpage/request?form=improve_this_page&pageTitle=${encodeURIComponent(title)}&pagePath=https://www.cheshireeast.gov.uk${path}`"
58
+ :href="`https://digital-core.cheshireeast.gov.uk/w/webpage/request?form=improve_this_page&pageTitle=${encodeURIComponent(title)}&pagePath=${baseUrl}${path}`"
59
59
  id="yes-feedback"
60
60
  class="liberty_form_link btn btn-lg btn-outline-secondary btn-example-1 btn-chevron rounded-pill text-left"
61
61
  >Yes<span class="visually-hidden">
@@ -0,0 +1,28 @@
1
+ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
2
+ reviewed: {
3
+ type: StringConstructor;
4
+ required: true;
5
+ };
6
+ path: {
7
+ type: StringConstructor;
8
+ required: true;
9
+ };
10
+ title: {
11
+ type: StringConstructor;
12
+ required: true;
13
+ };
14
+ }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
15
+ reviewed: {
16
+ type: StringConstructor;
17
+ required: true;
18
+ };
19
+ path: {
20
+ type: StringConstructor;
21
+ required: true;
22
+ };
23
+ title: {
24
+ type: StringConstructor;
25
+ required: true;
26
+ };
27
+ }>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
28
+ export default _default;
@@ -0,0 +1,2 @@
1
+ declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
2
+ export default _default;
@@ -1,106 +1,91 @@
1
- <script setup lang="ts">
2
- import { onMounted } from 'vue';
3
- import { useState, navigateTo } from '#app';
4
-
5
- const searchTerm = useState('searchTerm', () => undefined);
6
- const questions = useState('questions');
7
- const baseUrl = useState('baseUrl');
8
- const page = useState('page');
9
- const path = useState('path');
10
-
11
- const regex =
12
- /^https:\/\/digital-core\.cheshireeast\.gov\.uk(?!.*(?:&pagePath|&pageTitle|login)).*$/;
13
-
14
- // Cookie control config.
1
+ <script setup>
2
+ import { onMounted } from "vue";
3
+ import { useState, navigateTo } from "#app";
4
+ const searchTerm = useState("searchTerm", () => void 0);
5
+ const questions = useState("questions");
6
+ const baseUrl = useState("baseUrl");
7
+ const page = useState("page");
8
+ const path = useState("path");
9
+ const regex = /^https:\/\/digital-core\.cheshireeast\.gov\.uk(?!.*(?:&pagePath|&pageTitle|login)).*$/;
15
10
  const config = {
16
- apiKey: 'c1a902dfad207b122cca32738e623af375e1d2ee',
17
- product: 'PRO_MULTISITE',
18
- mode: 'gdpr',
19
- consentCookieExpiry: '365',
11
+ apiKey: "c1a902dfad207b122cca32738e623af375e1d2ee",
12
+ product: "PRO_MULTISITE",
13
+ mode: "gdpr",
14
+ consentCookieExpiry: "365",
20
15
  statement: {
21
- description: 'For more information visit our',
22
- name: 'Cookies page',
23
- url: '/council_and_democracy/council_information/website_information/website_information.aspx',
24
- updated: '08/09/2020',
16
+ description: "For more information visit our",
17
+ name: "Cookies page",
18
+ url: "/council_and_democracy/council_information/website_information/website_information.aspx",
19
+ updated: "08/09/2020"
25
20
  },
26
21
  accessibility: {
27
- outline: true,
22
+ outline: true
28
23
  },
29
24
  optionalCookies: [
30
25
  {
31
- name: 'analytics',
32
- label: 'Analytics cookies',
33
- description:
34
- 'We would like to set Google Analytics cookies. This helps us to improve our website by collecting and reporting information on its usage and is done in a way that does not directly identify anyone.',
26
+ name: "analytics",
27
+ label: "Analytics cookies",
28
+ description: "We would like to set Google Analytics cookies. This helps us to improve our website by collecting and reporting information on its usage and is done in a way that does not directly identify anyone.",
35
29
  cookies: [
36
- '_ga',
37
- '_gid',
38
- '__utma',
39
- '__utmt',
40
- '__utmb',
41
- '__utmc',
42
- '__utmz',
43
- '__utm.gif',
30
+ "_ga",
31
+ "_gid",
32
+ "__utma",
33
+ "__utmt",
34
+ "__utmb",
35
+ "__utmc",
36
+ "__utmz",
37
+ "__utm.gif"
44
38
  ],
45
- onAccept: function () {
46
- // Add Google Analytics via GTM
47
- // assumes the associated event has been created within GTM
48
- // and that event in turn loads analytics
39
+ onAccept: function() {
49
40
  dataLayer.push({
50
- event: 'analytics_consent_given',
41
+ event: "analytics_consent_given"
51
42
  });
52
- // End Google Analytics
53
43
  },
54
- onRevoke: function () {},
44
+ onRevoke: function() {
45
+ }
55
46
  },
56
47
  {
57
- name: 'marketing',
58
- label: 'Marketing cookies',
59
- description:
60
- 'We would like to embed Facebook feeds. In return they use marketing cookies to track visitors across websites. The intention is to display ads that are relevant and engaging for the individual user and thereby more valuable for publishers and third party advertisers.',
61
- cookies: ['guest_id', 'personalization_id'],
62
- onAccept: function () {
63
- // Facebook feed
64
- !(function (d, s, id) {
65
- var js,
66
- fjs = d.getElementsByTagName(s)[0];
48
+ name: "marketing",
49
+ label: "Marketing cookies",
50
+ description: "We would like to embed Facebook feeds. In return they use marketing cookies to track visitors across websites. The intention is to display ads that are relevant and engaging for the individual user and thereby more valuable for publishers and third party advertisers.",
51
+ cookies: ["guest_id", "personalization_id"],
52
+ onAccept: function() {
53
+ !function(d, s, id) {
54
+ var js, fjs2 = d.getElementsByTagName(s)[0];
67
55
  if (d.getElementById(id)) return;
68
56
  js = d.createElement(s);
69
57
  js.id = id;
70
- js.src = '//connect.facebook.net/en_GB/sdk.js#xfbml=1&version=v2.3';
71
- fjs.parentNode.insertBefore(js, fjs);
72
- })(document, 'script', 'facebook-jssdk');
58
+ js.src = "//connect.facebook.net/en_GB/sdk.js#xfbml=1&version=v2.3";
59
+ fjs2.parentNode.insertBefore(js, fjs2);
60
+ }(document, "script", "facebook-jssdk");
73
61
  },
74
- onRevoke: function () {
75
- fjs('consent', 'revoke');
76
- },
77
- },
62
+ onRevoke: function() {
63
+ fjs("consent", "revoke");
64
+ }
65
+ }
78
66
  ],
79
- position: 'LEFT',
80
- theme: 'DARK',
67
+ position: "LEFT",
68
+ theme: "DARK",
81
69
  branding: {
82
- fontColor: '#FFF',
83
- fontSizeTitle: '1.2em',
84
- fontSizeIntro: '1em',
85
- fontSizeHeaders: '1em',
86
- fontSize: '1em',
87
- backgroundColor: '#206c49',
88
- toggleText: '#fff',
89
- toggleColor: '#68907e',
90
- toggleBackground: '#144a31',
70
+ fontColor: "#FFF",
71
+ fontSizeTitle: "1.2em",
72
+ fontSizeIntro: "1em",
73
+ fontSizeHeaders: "1em",
74
+ fontSize: "1em",
75
+ backgroundColor: "#206c49",
76
+ toggleText: "#fff",
77
+ toggleColor: "#68907e",
78
+ toggleBackground: "#144a31",
91
79
  buttonIcon: null,
92
- buttonIconWidth: '64px',
93
- buttonIconHeight: '64px',
80
+ buttonIconWidth: "64px",
81
+ buttonIconHeight: "64px",
94
82
  removeIcon: false,
95
- removeAbout: true,
96
- },
83
+ removeAbout: true
84
+ }
97
85
  };
98
-
99
- // Placeholder because we need to wait for browsealoud
100
86
  let updateToggleText = () => {
101
- console.log('toggle');
87
+ console.log("toggle");
102
88
  };
103
-
104
89
  const doSearch = async () => {
105
90
  if (searchTerm.value) {
106
91
  await navigateTo(
@@ -109,66 +94,55 @@ const doSearch = async () => {
109
94
  );
110
95
  }
111
96
  };
112
-
113
- // Set some things up once page has mounted.
114
97
  onMounted(() => {
115
98
  updateToggleText = () => {
116
- const x = document.getElementById('baToggleText');
117
- if (x.innerText === 'Listen and translate') {
118
- x.innerText = 'Close listen and translate';
99
+ const x = document.getElementById("baToggleText");
100
+ if (x.innerText === "Listen and translate") {
101
+ x.innerText = "Close listen and translate";
119
102
  } else {
120
- x.innerText = 'Listen and translate';
103
+ x.innerText = "Listen and translate";
121
104
  }
122
105
  BrowseAloud.panel.toggleBar();
123
106
  };
124
107
  try {
125
108
  CookieControl.load(config);
126
109
  } catch (ignore) {
127
- console.log('No cookie control');
110
+ console.log("No cookie control");
128
111
  }
129
112
  try {
130
113
  BrowseAloud.disableBrowsealoudAnalytics();
131
114
  } catch (ignore) {
132
- console.log('No reachdeck.');
115
+ console.log("No reachdeck.");
133
116
  }
134
-
135
- // Make accordions spring open if there is a hash (looks for an H3)
136
- let accordions = document.getElementsByClassName('access-acc-container');
117
+ let accordions = document.getElementsByClassName("access-acc-container");
137
118
  if (accordions.length) {
138
119
  let hash = window.location.hash;
139
120
  let found = false;
140
121
  if (hash) {
141
- hash = hash.toLowerCase().replace(/^#/, '').replace(/_/g, ' ');
142
- let l = Array.from(document.getElementsByTagName('LABEL')).filter((e) =>
143
- e.innerText.toLowerCase().startsWith(hash)
122
+ hash = hash.toLowerCase().replace(/^#/, "").replace(/_/g, " ");
123
+ let l = Array.from(document.getElementsByTagName("LABEL")).filter(
124
+ (e) => e.innerText.toLowerCase().startsWith(hash)
144
125
  );
145
126
  let accs = l.filter(
146
- (e) =>
147
- e.parentNode.tagName === 'SECTION' ||
148
- e.parentNode.tagName === 'TEMPLATE'
127
+ (e) => e.parentNode.tagName === "SECTION" || e.parentNode.tagName === "TEMPLATE"
149
128
  );
150
129
  if (accs.length) {
151
130
  let el = accs[0].previousElementSibling;
152
- if (el.tagName === 'INPUT') {
131
+ if (el.tagName === "INPUT") {
153
132
  el.checked = true;
154
133
  el.scrollIntoView();
155
134
  found = true;
156
135
  }
157
136
  }
158
137
  if (!found) {
159
- let h3s = Array.from(document.getElementsByTagName('H3')).filter((e) =>
160
- e.innerHTML.toLowerCase().includes(hash)
138
+ let h3s = Array.from(document.getElementsByTagName("H3")).filter(
139
+ (e) => e.innerHTML.toLowerCase().includes(hash)
161
140
  );
162
141
  if (h3s.length) {
163
142
  let parent = h3s[0].parentNode;
164
- if (parent.tagName === 'ARTICLE') {
143
+ if (parent.tagName === "ARTICLE") {
165
144
  let el = parent.previousElementSibling;
166
- let input =
167
- el.tagName === 'LABEL'
168
- ? el.control
169
- : el.tagName === 'INPUT'
170
- ? el
171
- : undefined;
145
+ let input = el.tagName === "LABEL" ? el.control : el.tagName === "INPUT" ? el : void 0;
172
146
  if (input) {
173
147
  input.checked = true;
174
148
  el.scrollIntoView();
@@ -178,10 +152,8 @@ onMounted(() => {
178
152
  }
179
153
  }
180
154
  }
181
-
182
- // Canvas stuff
183
155
  const getQuInfo = (b) => {
184
- let temp = b.id.split('_');
156
+ let temp = b.id.split("_");
185
157
  let id = temp[3];
186
158
  let q = questions.value.find((e) => e.id === id);
187
159
  if (q) {
@@ -196,7 +168,6 @@ onMounted(() => {
196
168
  }
197
169
  }
198
170
  };
199
-
200
171
  const setSelectBehaviour = (e) => {
201
172
  let { q, id, divId } = getQuInfo(e);
202
173
  let value = document.getElementById(id).value;
@@ -211,7 +182,6 @@ onMounted(() => {
211
182
  goto(divId, target);
212
183
  }
213
184
  };
214
-
215
185
  const setOnClick = (b) => {
216
186
  let { content, target, id } = getQuInfo(b);
217
187
  if (content) {
@@ -220,65 +190,55 @@ onMounted(() => {
220
190
  b.onclick = () => goto(id, target);
221
191
  }
222
192
  };
223
-
224
- // Expand all buttons
225
193
  const expandAll = (btn) => {
226
- btn.addEventListener('click', (e) => {
194
+ btn.addEventListener("click", (e) => {
227
195
  const op = btn.innerText;
228
- btn.innerText = op === 'Expand all' ? 'Close all' : 'Expand all';
196
+ btn.innerText = op === "Expand all" ? "Close all" : "Expand all";
229
197
  Array.from(document.getElementsByClassName(btn.id)).forEach(
230
- (e) => (e.checked = op === 'Expand all')
198
+ (e2) => e2.checked = op === "Expand all"
231
199
  );
232
200
  });
233
201
  };
234
- Array.from(document.getElementsByClassName('expand-all')).forEach((b) => {
202
+ Array.from(document.getElementsByClassName("expand-all")).forEach((b) => {
235
203
  expandAll(b);
236
204
  });
237
-
238
- // Forms title & path
239
- let forms = Array.from(document.querySelectorAll('a')).filter(
240
- (a) =>
241
- regex.test(a.href) &&
242
- a.href !== 'https://digital-core.cheshireeast.gov.uk/w/webpage/register'
205
+ let forms = Array.from(document.querySelectorAll("a")).filter(
206
+ (a) => regex.test(a.href) && a.href !== "https://digital-core.cheshireeast.gov.uk/w/webpage/register"
243
207
  );
244
-
245
208
  forms.forEach((link) => {
246
209
  link.href = `${link.href}&pageTitle=${encodeURIComponent(
247
210
  page.value.title
248
211
  )}&pagePath=${baseUrl.value}${encodeURIComponent(path.value)}`;
249
212
  });
250
-
251
213
  const setUpListeners = () => {
252
214
  let qSelects = Array.from(
253
- document.getElementsByClassName('question-select')
215
+ document.getElementsByClassName("question-select")
254
216
  );
255
217
  qSelects.forEach((s) => {
256
- s.onchange = function (e) {
218
+ s.onchange = function(e) {
257
219
  setSelectBehaviour(e.target);
258
220
  };
259
221
  });
260
- let qBtns = Array.from(document.getElementsByClassName('question-btns'));
222
+ let qBtns = Array.from(document.getElementsByClassName("question-btns"));
261
223
  qBtns.forEach((b) => {
262
224
  setOnClick(b);
263
225
  });
264
226
  };
265
-
266
227
  const makeBreadcrumb = (id, qTop) => {
267
- let display = document.getElementById(id + '_display');
228
+ let display2 = document.getElementById(id + "_display");
268
229
  let breadcrumb = document.getElementById(`${id}_breadcrumb`);
269
- breadcrumb.innerHTML = '';
230
+ breadcrumb.innerHTML = "";
270
231
  qTop.stack.forEach((el, i) => {
271
- let li = document.createElement('LI');
272
- li.classList.add('breadcrumb-item');
232
+ let li = document.createElement("LI");
233
+ li.classList.add("breadcrumb-item");
273
234
  li.innerHTML = qTop.question[el].question;
274
- if (i !== qTop.stack.length - 1 || display.innerText.length) {
275
- li.classList.add('fakeLink');
235
+ if (i !== qTop.stack.length - 1 || display2.innerText.length) {
236
+ li.classList.add("fakeLink");
276
237
  li.onclick = () => goto(id, el, false);
277
238
  }
278
239
  breadcrumb.appendChild(li);
279
240
  });
280
241
  };
281
-
282
242
  const goto = (id, index, addToStack = true) => {
283
243
  let qTop = questions.value.find((e) => e.id === id);
284
244
  if (!index) {
@@ -288,27 +248,24 @@ onMounted(() => {
288
248
  qTop.stack.push(index);
289
249
  }
290
250
  let q = qTop.question[index];
291
- document.getElementById(id + '_display').innerHTML = '';
292
- document.getElementById(id + '_buttons').innerHTML = q.buttons || q.select;
251
+ document.getElementById(id + "_display").innerHTML = "";
252
+ document.getElementById(id + "_buttons").innerHTML = q.buttons || q.select;
293
253
  makeBreadcrumb(id, qTop);
294
254
  setUpListeners();
295
255
  };
296
-
297
- const display = (id, display) => {
298
- document.getElementById(id + '_display').innerHTML = display;
299
- document.getElementById(id + '_buttons').innerHTML = '';
256
+ const display = (id, display2) => {
257
+ document.getElementById(id + "_display").innerHTML = display2;
258
+ document.getElementById(id + "_buttons").innerHTML = "";
300
259
  makeBreadcrumb(
301
260
  id,
302
261
  questions.value.find((e) => e.id === id)
303
262
  );
304
263
  };
305
-
306
264
  const prev = (id) => {
307
265
  let qTop = questions.value.find((e) => e.id === id);
308
266
  let ind = qTop.stack.pop();
309
267
  goto(id, ind, !qTop.stack.length);
310
268
  };
311
-
312
269
  const reset = (id) => {
313
270
  let qTop = questions.value.find((e) => e.id === id);
314
271
  if (qTop.stack.length) {
@@ -316,18 +273,16 @@ onMounted(() => {
316
273
  goto(id, 0);
317
274
  }
318
275
  };
319
-
320
- let resetBtns = Array.from(document.getElementsByClassName('reset'));
276
+ let resetBtns = Array.from(document.getElementsByClassName("reset"));
321
277
  resetBtns.forEach((rb) => {
322
- let id = rb.id.split('_')[0];
278
+ let id = rb.id.split("_")[0];
323
279
  if (!rb.onclick) {
324
280
  rb.onclick = () => reset(id);
325
281
  }
326
282
  });
327
-
328
- let prevBtns = Array.from(document.getElementsByClassName('previous'));
283
+ let prevBtns = Array.from(document.getElementsByClassName("previous"));
329
284
  prevBtns.forEach((pb) => {
330
- let id = pb.id.split('_')[0];
285
+ let id = pb.id.split("_")[0];
331
286
  if (!pb.onclick) {
332
287
  pb.onclick = () => prev(id);
333
288
  }
@@ -0,0 +1,2 @@
1
+ declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
2
+ export default _default;