@everymatrix/general-tutorial-slider 1.44.0 → 1.45.2

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 (49) hide show
  1. package/dist/cjs/app-globals-3a1e7e63.js +5 -0
  2. package/dist/cjs/general-tutorial-slider.cjs.entry.js +267 -301
  3. package/dist/cjs/general-tutorial-slider.cjs.js +17 -11
  4. package/dist/cjs/index-42afbd98.js +1243 -0
  5. package/dist/cjs/loader.cjs.js +7 -13
  6. package/dist/collection/collection-manifest.json +3 -3
  7. package/dist/collection/components/general-tutorial-slider/general-tutorial-slider.css +0 -2
  8. package/dist/collection/components/general-tutorial-slider/general-tutorial-slider.js +466 -510
  9. package/dist/collection/components/general-tutorial-slider/index.js +1 -0
  10. package/dist/collection/utils/locale.utils.js +34 -34
  11. package/dist/collection/utils/utils.js +26 -26
  12. package/dist/esm/app-globals-0f993ce5.js +3 -0
  13. package/dist/esm/general-tutorial-slider.entry.js +267 -301
  14. package/dist/esm/general-tutorial-slider.js +14 -11
  15. package/dist/esm/index-a6815b2c.js +1216 -0
  16. package/dist/esm/loader.js +7 -13
  17. package/dist/general-tutorial-slider/general-tutorial-slider.esm.js +1 -1
  18. package/dist/general-tutorial-slider/p-5bac4bfc.entry.js +1 -0
  19. package/dist/general-tutorial-slider/p-87756a93.js +2 -0
  20. package/dist/general-tutorial-slider/p-e1255160.js +1 -0
  21. package/dist/stencil.config.dev.js +17 -0
  22. package/dist/stencil.config.js +14 -19
  23. package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/general-tutorial-slider/.stencil/packages/stencil/general-tutorial-slider/stencil.config.d.ts +2 -0
  24. package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/general-tutorial-slider/.stencil/packages/stencil/general-tutorial-slider/stencil.config.dev.d.ts +2 -0
  25. package/dist/types/components/general-tutorial-slider/general-tutorial-slider.d.ts +88 -88
  26. package/dist/types/components/general-tutorial-slider/index.d.ts +1 -0
  27. package/dist/types/stencil-public-runtime.d.ts +142 -33
  28. package/loader/cdn.js +1 -3
  29. package/loader/index.cjs.js +1 -3
  30. package/loader/index.d.ts +13 -1
  31. package/loader/index.es2017.js +1 -3
  32. package/loader/index.js +1 -3
  33. package/loader/package.json +1 -0
  34. package/package.json +8 -1
  35. package/dist/cjs/index-18ec3908.js +0 -1282
  36. package/dist/components/general-tutorial-slider.d.ts +0 -11
  37. package/dist/components/general-tutorial-slider.js +0 -376
  38. package/dist/components/index.d.ts +0 -26
  39. package/dist/components/index.js +0 -1
  40. package/dist/esm/index-a2165162.js +0 -1256
  41. package/dist/esm/polyfills/core-js.js +0 -11
  42. package/dist/esm/polyfills/css-shim.js +0 -1
  43. package/dist/esm/polyfills/dom.js +0 -79
  44. package/dist/esm/polyfills/es5-html-element.js +0 -1
  45. package/dist/esm/polyfills/index.js +0 -34
  46. package/dist/esm/polyfills/system.js +0 -6
  47. package/dist/general-tutorial-slider/p-4e4fd5b7.entry.js +0 -1
  48. package/dist/general-tutorial-slider/p-a878ee14.js +0 -1
  49. package/dist/types/Users/adrian.pripon/Documents/Work/widgets-stencil/packages/general-tutorial-slider/.stencil/packages/general-tutorial-slider/stencil.config.d.ts +0 -2
@@ -1,526 +1,482 @@
1
- import { Component, State, Prop, Element, Watch, h } from '@stencil/core';
2
- import { translate } from '../../utils/locale.utils';
3
- import { isMobile, getDevicePlatform } from '../../utils/utils';
1
+ import { h } from "@stencil/core";
2
+ import { translate } from "../../utils/locale.utils";
3
+ import { isMobile, getDevicePlatform } from "../../utils/utils";
4
4
  export class GeneralTutorialSlider {
5
- constructor() {
6
- /**
7
- * Client custom styling via inline style
8
- */
9
- this.clientStyling = '';
10
- /**
11
- * Client custom styling via url
12
- */
13
- this.clientStylingUrl = '';
14
- /**
15
- * Language of the widget
16
- */
17
- this.language = 'en';
18
- /**
19
- * User roles
20
- */
21
- this.userRoles = 'everyone';
22
- /**
23
- * CMS Endpoint stage
24
- */
25
- this.cmsEnv = 'stage';
26
- /**
27
- * Show slider dots
28
- */
29
- this.showSliderDots = true;
30
- /**
31
- * Show slider navigate arrows
32
- */
33
- this.showSliderArrows = true;
34
- /**
35
- * Show slider navigate arrows on mobile
36
- */
37
- this.showSliderArrowsMobile = false;
38
- /**
39
- * Auto-scroll will only function if it is set to true, and otherwise it will be ignored.
40
- */
41
- this.enableAutoScroll = false;
42
- /**
43
- * Set interval period for slider
44
- */
45
- this.intervalPeriod = 5000;
46
- /**
47
- * Set the number of slides you wish to display.
48
- */
49
- this.scrollItems = 1;
50
- /**
51
- * Set the number of slides you wish to display.
52
- */
53
- this.itemsPerPage = 1;
54
- this.hasErrors = false;
55
- this.limitStylingAppends = false;
56
- this.isLoading = true;
57
- this.activeIndex = 0;
58
- this.tutorialElementWidth = 0;
59
- this.userAgent = window.navigator.userAgent;
60
- this.isMobile = isMobile(this.userAgent);
61
- this.allElementsWidth = 0;
62
- this.xDown = null;
63
- this.yDown = null;
64
- this.resizeHandler = () => {
65
- this.recalculateItemsPerPage();
66
- };
67
- this.orientationChangeHandler = () => {
68
- setTimeout(() => {
5
+ constructor() {
6
+ this.userAgent = window.navigator.userAgent;
7
+ this.isMobile = isMobile(this.userAgent);
8
+ this.allElementsWidth = 0;
9
+ this.xDown = null;
10
+ this.yDown = null;
11
+ this.resizeHandler = () => {
12
+ this.recalculateItemsPerPage();
13
+ };
14
+ this.orientationChangeHandler = () => {
15
+ setTimeout(() => {
16
+ this.recalculateItemsPerPage();
17
+ }, 10);
18
+ };
19
+ this.setClientStyling = () => {
20
+ let sheet = document.createElement('style');
21
+ sheet.innerHTML = this.clientStyling;
22
+ this.stylingContainer.prepend(sheet);
23
+ };
24
+ this.setClientStylingURL = () => {
25
+ let url = new URL(this.clientStylingUrl);
26
+ let cssFile = document.createElement('style');
27
+ fetch(url.href)
28
+ .then((res) => res.text())
29
+ .then((data) => {
30
+ cssFile.innerHTML = data;
31
+ setTimeout(() => { this.stylingContainer.prepend(cssFile); }, 1);
32
+ })
33
+ .catch((err) => {
34
+ console.log('error ', err);
35
+ });
36
+ };
37
+ this.clientStyling = '';
38
+ this.clientStylingUrl = '';
39
+ this.language = 'en';
40
+ this.cmsEndpoint = undefined;
41
+ this.userRoles = 'everyone';
42
+ this.cmsEnv = 'stage';
43
+ this.showSliderDots = true;
44
+ this.showSliderArrows = true;
45
+ this.showSliderArrowsMobile = false;
46
+ this.enableAutoScroll = false;
47
+ this.intervalPeriod = 5000;
48
+ this.scrollItems = 1;
49
+ this.itemsPerPage = 1;
50
+ this.hasErrors = false;
51
+ this.limitStylingAppends = false;
52
+ this.isLoading = true;
53
+ this.activeIndex = 0;
54
+ this.tutorialElementWidth = 0;
55
+ }
56
+ watchEndpoint(newValue, oldValue) {
57
+ if (newValue && newValue != oldValue && this.cmsEndpoint) {
58
+ this.getGeneralTutorialSlider().then((tutorialContent) => {
59
+ this.tutorialData = tutorialContent;
60
+ });
61
+ }
62
+ }
63
+ connectedCallback() {
64
+ window.screen.orientation.addEventListener('change', this.orientationChangeHandler);
65
+ }
66
+ componentWillLoad() {
67
+ if (this.cmsEndpoint && this.language) {
68
+ return this.getGeneralTutorialSlider().then((tutorialContent) => {
69
+ this.tutorialData = tutorialContent;
70
+ });
71
+ }
72
+ }
73
+ componentDidLoad() {
74
+ window.addEventListener('resize', this.resizeHandler);
75
+ }
76
+ componentDidRender() {
77
+ this.el.addEventListener('touchstart', this.handleTouchStart.bind(this), { passive: true });
78
+ this.el.addEventListener('touchmove', this.handleTouchMove.bind(this), { passive: true });
79
+ this.recalculateItemsPerPage();
80
+ // start custom styling area
81
+ if (!this.limitStylingAppends && this.stylingContainer) {
82
+ if (this.clientStyling)
83
+ this.setClientStyling();
84
+ if (this.clientStylingUrl)
85
+ this.setClientStylingURL();
86
+ this.limitStylingAppends = true;
87
+ }
88
+ // end custom styling area
89
+ }
90
+ componentDidUpdate() {
69
91
  this.recalculateItemsPerPage();
70
- }, 10);
71
- };
72
- this.setClientStyling = () => {
73
- let sheet = document.createElement('style');
74
- sheet.innerHTML = this.clientStyling;
75
- this.stylingContainer.prepend(sheet);
76
- };
77
- this.setClientStylingURL = () => {
78
- let url = new URL(this.clientStylingUrl);
79
- let cssFile = document.createElement('style');
80
- fetch(url.href)
81
- .then((res) => res.text())
82
- .then((data) => {
83
- cssFile.innerHTML = data;
84
- setTimeout(() => { this.stylingContainer.prepend(cssFile); }, 1);
85
- })
86
- .catch((err) => {
87
- console.log('error ', err);
88
- });
89
- };
90
- }
91
- watchEndpoint(newValue, oldValue) {
92
- if (newValue && newValue != oldValue && this.cmsEndpoint) {
93
- this.getGeneralTutorialSlider().then((tutorialContent) => {
94
- this.tutorialData = tutorialContent;
95
- });
96
92
  }
97
- }
98
- connectedCallback() {
99
- window.screen.orientation.addEventListener('change', this.orientationChangeHandler);
100
- }
101
- componentWillLoad() {
102
- if (this.cmsEndpoint && this.language) {
103
- return this.getGeneralTutorialSlider().then((tutorialContent) => {
104
- this.tutorialData = tutorialContent;
105
- });
93
+ disconnectedCallback() {
94
+ this.el.removeEventListener('touchstart', this.handleTouchStart);
95
+ this.el.removeEventListener('touchmove', this.handleTouchMove);
96
+ window.screen.orientation.removeEventListener('change', this.orientationChangeHandler);
97
+ window.removeEventListener('resize', this.resizeHandler);
98
+ }
99
+ getGeneralTutorialSlider() {
100
+ let url = new URL(`${this.cmsEndpoint}/${this.language}/slider-onboarding`);
101
+ url.searchParams.append('env', this.cmsEnv);
102
+ url.searchParams.append('userRoles', this.userRoles);
103
+ url.searchParams.append('device', getDevicePlatform());
104
+ return new Promise((resolve, reject) => {
105
+ this.isLoading = true;
106
+ fetch(url.href)
107
+ .then((res) => res.json())
108
+ .then((tutorialContent) => {
109
+ resolve(tutorialContent);
110
+ }).catch((err) => {
111
+ console.error(err);
112
+ this.hasErrors = true;
113
+ reject(err);
114
+ }).finally(() => {
115
+ this.isLoading = false;
116
+ });
117
+ });
106
118
  }
107
- }
108
- componentDidLoad() {
109
- window.addEventListener('resize', this.resizeHandler);
110
- }
111
- componentDidRender() {
112
- this.el.addEventListener('touchstart', this.handleTouchStart.bind(this), { passive: true });
113
- this.el.addEventListener('touchmove', this.handleTouchMove.bind(this), { passive: true });
114
- this.recalculateItemsPerPage();
115
- // start custom styling area
116
- if (!this.limitStylingAppends && this.stylingContainer) {
117
- if (this.clientStyling)
118
- this.setClientStyling();
119
- if (this.clientStylingUrl)
120
- this.setClientStylingURL();
121
- this.limitStylingAppends = true;
119
+ move(direction) {
120
+ this.setActive(this.activeIndex + direction);
122
121
  }
123
- // end custom styling area
124
- }
125
- componentDidUpdate() {
126
- this.recalculateItemsPerPage();
127
- }
128
- disconnectedCallback() {
129
- this.el.removeEventListener('touchstart', this.handleTouchStart);
130
- this.el.removeEventListener('touchmove', this.handleTouchMove);
131
- window.screen.orientation.removeEventListener('change', this.orientationChangeHandler);
132
- window.removeEventListener('resize', this.resizeHandler);
133
- }
134
- getGeneralTutorialSlider() {
135
- let url = new URL(`${this.cmsEndpoint}/${this.language}/slider-onboarding`);
136
- url.searchParams.append('env', this.cmsEnv);
137
- url.searchParams.append('userRoles', this.userRoles);
138
- url.searchParams.append('device', getDevicePlatform());
139
- return new Promise((resolve, reject) => {
140
- this.isLoading = true;
141
- fetch(url.href)
142
- .then((res) => res.json())
143
- .then((tutorialContent) => {
144
- resolve(tutorialContent);
145
- }).catch((err) => {
146
- console.error(err);
147
- this.hasErrors = true;
148
- reject(err);
149
- }).finally(() => {
150
- this.isLoading = false;
151
- });
152
- });
153
- }
154
- move(direction) {
155
- this.setActive(this.activeIndex + direction);
156
- }
157
- ;
158
- //calculate itemsperpage by tutorials length to avoid empty in the tutorials end
159
- recalculateItemsPerPage() {
160
- if (!this.tutorialsElement)
161
- return;
162
- this.tutorialElementWidth = this.tutorialsElement.clientWidth;
163
- this.allElementsWidth = (this.tutorialData.length - 1) * this.tutorialElementWidth;
164
- }
165
- ;
166
- goTo(index) {
167
- let diff = this.activeIndex - index;
168
- if (diff > 0) {
169
- for (let i = 0; i < diff; i++) {
170
- this.move(-1);
171
- }
122
+ ;
123
+ //calculate itemsperpage by tutorials length to avoid empty in the tutorials end
124
+ recalculateItemsPerPage() {
125
+ if (!this.tutorialsElement)
126
+ return;
127
+ this.tutorialElementWidth = this.tutorialsElement.clientWidth;
128
+ this.allElementsWidth = (this.tutorialData.length - 1) * this.tutorialElementWidth;
172
129
  }
173
- else {
174
- for (let i = 0; i > diff; i--) {
175
- this.move(1);
176
- }
130
+ ;
131
+ goTo(index) {
132
+ let diff = this.activeIndex - index;
133
+ if (diff > 0) {
134
+ for (let i = 0; i < diff; i++) {
135
+ this.move(-1);
136
+ }
137
+ }
138
+ else {
139
+ for (let i = 0; i > diff; i--) {
140
+ this.move(1);
141
+ }
142
+ }
177
143
  }
178
- }
179
- handleTouchStart(evt) {
180
- const firstTouch = this.getTouches(evt)[0];
181
- this.xDown = firstTouch.clientX;
182
- this.yDown = firstTouch.clientY;
183
- }
184
- getTouches(evt) {
185
- return evt.touches || evt.originalEvent.touches;
186
- }
187
- handleTouchMove(evt) {
188
- if (!this.xDown || !this.yDown)
189
- return;
190
- let xUp = evt.touches[0].clientX;
191
- let yUp = evt.touches[0].clientY;
192
- let xDiff = this.xDown - xUp;
193
- let yDiff = this.yDown - yUp;
194
- if (Math.abs(xDiff) > Math.abs(yDiff)) {
195
- if (xDiff > 0) {
196
- this.move(1);
197
- }
198
- else {
199
- this.move(-1);
200
- }
144
+ handleTouchStart(evt) {
145
+ const firstTouch = this.getTouches(evt)[0];
146
+ this.xDown = firstTouch.clientX;
147
+ this.yDown = firstTouch.clientY;
201
148
  }
202
- this.xDown = null;
203
- this.yDown = null;
204
- }
205
- ;
206
- setActive(index) {
207
- const maxLength = this.tutorialData.length;
208
- if (index >= 0) {
209
- if (index >= maxLength - 1) {
210
- this.activeIndex = maxLength - 1;
211
- }
212
- else {
213
- this.activeIndex = index;
214
- }
149
+ getTouches(evt) {
150
+ return evt.touches || evt.originalEvent.touches;
215
151
  }
216
- else {
217
- this.activeIndex = 0;
152
+ handleTouchMove(evt) {
153
+ if (!this.xDown || !this.yDown)
154
+ return;
155
+ let xUp = evt.touches[0].clientX;
156
+ let yUp = evt.touches[0].clientY;
157
+ let xDiff = this.xDown - xUp;
158
+ let yDiff = this.yDown - yUp;
159
+ if (Math.abs(xDiff) > Math.abs(yDiff)) {
160
+ if (xDiff > 0) {
161
+ this.move(1);
162
+ }
163
+ else {
164
+ this.move(-1);
165
+ }
166
+ }
167
+ this.xDown = null;
168
+ this.yDown = null;
218
169
  }
219
- }
220
- renderDots() {
221
- const dots = [];
222
- for (let index = 0; index < this.tutorialData.length / this.itemsPerPage; index++) {
223
- dots.push(h("li", { class: index == this.activeIndex ? 'active' : 'default', onClick: () => { this.goTo(index); this.setActive(index); } }));
170
+ ;
171
+ setActive(index) {
172
+ const maxLength = this.tutorialData.length;
173
+ if (index >= 0) {
174
+ if (index >= maxLength - 1) {
175
+ this.activeIndex = maxLength - 1;
176
+ }
177
+ else {
178
+ this.activeIndex = index;
179
+ }
180
+ }
181
+ else {
182
+ this.activeIndex = 0;
183
+ }
224
184
  }
225
- return dots;
226
- }
227
- render() {
228
- const styles = {
229
- transform: `translate(${(this.allElementsWidth / (this.tutorialData.length - 1) * this.activeIndex) * -1}px, 0px)`
230
- };
231
- const itemStyle = {
232
- width: `${this.tutorialElementWidth / this.itemsPerPage}px`
233
- };
234
- if (this.hasErrors) {
235
- return (h("div", { class: "GeneralTutorialSliderError" },
236
- h("div", { class: "TitleError" }, translate('error', this.language))));
185
+ renderDots() {
186
+ const dots = [];
187
+ for (let index = 0; index < this.tutorialData.length / this.itemsPerPage; index++) {
188
+ dots.push(h("li", { class: index == this.activeIndex ? 'active' : 'default', onClick: () => { this.goTo(index); this.setActive(index); } }));
189
+ }
190
+ return dots;
237
191
  }
238
- if (!this.isLoading) {
239
- return (h("div", { ref: el => this.stylingContainer = el },
240
- h("div", { class: "TutorialWrapper" },
241
- h("div", { class: "TutorialContent", ref: (el) => this.slider = el },
242
- ((this.showSliderArrows && !this.isMobile) ||
243
- (this.showSliderArrowsMobile && this.isMobile)) &&
244
- h("div", { class: this.activeIndex === 0 ? 'SliderNavButton DisabledArrow' : 'SliderNavButton', onClick: () => this.move(-1) },
245
- h("svg", { fill: "none", stroke: "var(--emfe-w-color-secondary, #FD2839)", viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg" },
246
- h("path", { "stroke-linecap": "round", "stroke-linejoin": "round", "stroke-width": "2", d: "M15 19l-7-7 7-7" }))),
247
- h("main", null,
248
- h("div", { style: styles, ref: (el) => this.tutorialsElement = el, class: "TutorialItems" }, this.tutorialData.map((data) => {
192
+ render() {
193
+ const styles = {
194
+ transform: `translate(${(this.allElementsWidth / (this.tutorialData.length - 1) * this.activeIndex) * -1}px, 0px)`
195
+ };
196
+ const itemStyle = {
197
+ width: `${this.tutorialElementWidth / this.itemsPerPage}px`
198
+ };
199
+ if (this.hasErrors) {
200
+ return (h("div", { class: "GeneralTutorialSliderError" }, h("div", { class: "TitleError" }, translate('error', this.language))));
201
+ }
202
+ if (!this.isLoading) {
203
+ return (h("div", { ref: el => this.stylingContainer = el }, h("div", { class: "TutorialWrapper" }, h("div", { class: "TutorialContent", ref: (el) => this.slider = el }, ((this.showSliderArrows && !this.isMobile) ||
204
+ (this.showSliderArrowsMobile && this.isMobile)) &&
205
+ h("div", { class: this.activeIndex === 0 ? 'SliderNavButton DisabledArrow' : 'SliderNavButton', onClick: () => this.move(-1) }, h("svg", { fill: "none", stroke: "var(--emfe-w-color-secondary, #FD2839)", viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg" }, h("path", { "stroke-linecap": "round", "stroke-linejoin": "round", "stroke-width": "2", d: "M15 19l-7-7 7-7" }))), h("main", null, h("div", { style: styles, ref: (el) => this.tutorialsElement = el, class: "TutorialItems" }, this.tutorialData.map((data) => {
249
206
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
250
- return h("div", { class: "TutorialItem", style: itemStyle },
251
- h("div", { class: "ItemTitle", innerHTML: data === null || data === void 0 ? void 0 : data.title }),
252
- ((_a = data === null || data === void 0 ? void 0 : data.media) === null || _a === void 0 ? void 0 : _a.images) ? (h("div", { class: "ItemImage" }, this.isMobile ? (h("img", { src: (_e = (_d = (_c = (_b = data === null || data === void 0 ? void 0 : data.media) === null || _b === void 0 ? void 0 : _b.images[0]) === null || _c === void 0 ? void 0 : _c.sources) === null || _d === void 0 ? void 0 : _d.find((source) => source.media === 'mobile')) === null || _e === void 0 ? void 0 : _e.src, alt: data === null || data === void 0 ? void 0 : data.slug })) : (h("img", { src: (_j = (_h = (_g = (_f = data === null || data === void 0 ? void 0 : data.media) === null || _f === void 0 ? void 0 : _f.images[0]) === null || _g === void 0 ? void 0 : _g.sources) === null || _h === void 0 ? void 0 : _h.find((source) => source.media === 'desktop')) === null || _j === void 0 ? void 0 : _j.src, alt: data === null || data === void 0 ? void 0 : data.slug })))) : ((_k = data === null || data === void 0 ? void 0 : data.media) === null || _k === void 0 ? void 0 : _k.video) ? (h("div", { class: "ItemImage" }, this.isMobile ? (h("video", { controls: true, loop: true, autoplay: true },
253
- h("source", { src: (_p = (_o = (_m = (_l = data === null || data === void 0 ? void 0 : data.media) === null || _l === void 0 ? void 0 : _l.video[0]) === null || _m === void 0 ? void 0 : _m.sources) === null || _o === void 0 ? void 0 : _o.find((source) => source.media === 'mobile')) === null || _p === void 0 ? void 0 : _p.src, type: "video/mp4" }))) : (h("video", { controls: true, loop: true, autoplay: true },
254
- h("source", { src: (_t = (_s = (_r = (_q = data === null || data === void 0 ? void 0 : data.media) === null || _q === void 0 ? void 0 : _q.video[0]) === null || _r === void 0 ? void 0 : _r.sources) === null || _s === void 0 ? void 0 : _s.find((source) => source.media === 'desktop')) === null || _t === void 0 ? void 0 : _t.src, type: "video/mp4" }))))) : null,
255
- h("div", { class: "ItemDescription", innerHTML: data === null || data === void 0 ? void 0 : data.content }));
256
- }))),
257
- ((this.showSliderArrows && !this.isMobile) ||
258
- (this.showSliderArrowsMobile && this.isMobile)) &&
259
- h("div", { class: this.activeIndex === this.tutorialData.length - 1 ? ' SliderNavButton DisabledArrow disabled' : 'SliderNavButton', onClick: () => this.move(1) },
260
- h("svg", { fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg" },
261
- h("path", { "stroke-linecap": "round", "stroke-linejoin": "round", "stroke-width": "2", d: "M9 5l7 7-7 7" }))),
262
- h("div", null)),
263
- this.showSliderDots &&
264
- h("div", { class: "DotsWrapper" },
265
- h("ul", { class: "Dots" }, this.renderDots())))));
207
+ return h("div", { class: "TutorialItem", style: itemStyle }, h("div", { class: "ItemTitle", innerHTML: data === null || data === void 0 ? void 0 : data.title }), ((_a = data === null || data === void 0 ? void 0 : data.media) === null || _a === void 0 ? void 0 : _a.images) ? (h("div", { class: "ItemImage" }, this.isMobile ? (h("img", { src: (_e = (_d = (_c = (_b = data === null || data === void 0 ? void 0 : data.media) === null || _b === void 0 ? void 0 : _b.images[0]) === null || _c === void 0 ? void 0 : _c.sources) === null || _d === void 0 ? void 0 : _d.find((source) => source.media === 'mobile')) === null || _e === void 0 ? void 0 : _e.src, alt: data === null || data === void 0 ? void 0 : data.slug })) : (h("img", { src: (_j = (_h = (_g = (_f = data === null || data === void 0 ? void 0 : data.media) === null || _f === void 0 ? void 0 : _f.images[0]) === null || _g === void 0 ? void 0 : _g.sources) === null || _h === void 0 ? void 0 : _h.find((source) => source.media === 'desktop')) === null || _j === void 0 ? void 0 : _j.src, alt: data === null || data === void 0 ? void 0 : data.slug })))) : ((_k = data === null || data === void 0 ? void 0 : data.media) === null || _k === void 0 ? void 0 : _k.video) ? (h("div", { class: "ItemImage" }, this.isMobile ? (h("video", { controls: true, loop: true, autoplay: true }, h("source", { src: (_p = (_o = (_m = (_l = data === null || data === void 0 ? void 0 : data.media) === null || _l === void 0 ? void 0 : _l.video[0]) === null || _m === void 0 ? void 0 : _m.sources) === null || _o === void 0 ? void 0 : _o.find((source) => source.media === 'mobile')) === null || _p === void 0 ? void 0 : _p.src, type: "video/mp4" }))) : (h("video", { controls: true, loop: true, autoplay: true }, h("source", { src: (_t = (_s = (_r = (_q = data === null || data === void 0 ? void 0 : data.media) === null || _q === void 0 ? void 0 : _q.video[0]) === null || _r === void 0 ? void 0 : _r.sources) === null || _s === void 0 ? void 0 : _s.find((source) => source.media === 'desktop')) === null || _t === void 0 ? void 0 : _t.src, type: "video/mp4" }))))) : null, h("div", { class: "ItemDescription", innerHTML: data === null || data === void 0 ? void 0 : data.content }));
208
+ }))), ((this.showSliderArrows && !this.isMobile) ||
209
+ (this.showSliderArrowsMobile && this.isMobile)) &&
210
+ h("div", { class: this.activeIndex === this.tutorialData.length - 1 ? ' SliderNavButton DisabledArrow disabled' : 'SliderNavButton', onClick: () => this.move(1) }, h("svg", { fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg" }, h("path", { "stroke-linecap": "round", "stroke-linejoin": "round", "stroke-width": "2", d: "M9 5l7 7-7 7" }))), h("div", null)), this.showSliderDots &&
211
+ h("div", { class: "DotsWrapper" }, h("ul", { class: "Dots" }, this.renderDots())))));
212
+ }
213
+ }
214
+ static get is() { return "general-tutorial-slider"; }
215
+ static get encapsulation() { return "shadow"; }
216
+ static get originalStyleUrls() {
217
+ return {
218
+ "$": ["general-tutorial-slider.scss"]
219
+ };
220
+ }
221
+ static get styleUrls() {
222
+ return {
223
+ "$": ["general-tutorial-slider.css"]
224
+ };
225
+ }
226
+ static get properties() {
227
+ return {
228
+ "clientStyling": {
229
+ "type": "string",
230
+ "mutable": false,
231
+ "complexType": {
232
+ "original": "string",
233
+ "resolved": "string",
234
+ "references": {}
235
+ },
236
+ "required": false,
237
+ "optional": false,
238
+ "docs": {
239
+ "tags": [],
240
+ "text": "Client custom styling via inline style"
241
+ },
242
+ "attribute": "client-styling",
243
+ "reflect": true,
244
+ "defaultValue": "''"
245
+ },
246
+ "clientStylingUrl": {
247
+ "type": "string",
248
+ "mutable": false,
249
+ "complexType": {
250
+ "original": "string",
251
+ "resolved": "string",
252
+ "references": {}
253
+ },
254
+ "required": false,
255
+ "optional": false,
256
+ "docs": {
257
+ "tags": [],
258
+ "text": "Client custom styling via url"
259
+ },
260
+ "attribute": "client-styling-url",
261
+ "reflect": true,
262
+ "defaultValue": "''"
263
+ },
264
+ "language": {
265
+ "type": "string",
266
+ "mutable": false,
267
+ "complexType": {
268
+ "original": "string",
269
+ "resolved": "string",
270
+ "references": {}
271
+ },
272
+ "required": false,
273
+ "optional": false,
274
+ "docs": {
275
+ "tags": [],
276
+ "text": "Language of the widget"
277
+ },
278
+ "attribute": "language",
279
+ "reflect": true,
280
+ "defaultValue": "'en'"
281
+ },
282
+ "cmsEndpoint": {
283
+ "type": "string",
284
+ "mutable": false,
285
+ "complexType": {
286
+ "original": "string",
287
+ "resolved": "string",
288
+ "references": {}
289
+ },
290
+ "required": true,
291
+ "optional": false,
292
+ "docs": {
293
+ "tags": [],
294
+ "text": "Endpoint URL for the source of data"
295
+ },
296
+ "attribute": "cms-endpoint",
297
+ "reflect": true
298
+ },
299
+ "userRoles": {
300
+ "type": "string",
301
+ "mutable": false,
302
+ "complexType": {
303
+ "original": "string",
304
+ "resolved": "string",
305
+ "references": {}
306
+ },
307
+ "required": false,
308
+ "optional": false,
309
+ "docs": {
310
+ "tags": [],
311
+ "text": "User roles"
312
+ },
313
+ "attribute": "user-roles",
314
+ "reflect": true,
315
+ "defaultValue": "'everyone'"
316
+ },
317
+ "cmsEnv": {
318
+ "type": "string",
319
+ "mutable": false,
320
+ "complexType": {
321
+ "original": "string",
322
+ "resolved": "string",
323
+ "references": {}
324
+ },
325
+ "required": false,
326
+ "optional": false,
327
+ "docs": {
328
+ "tags": [],
329
+ "text": "CMS Endpoint stage"
330
+ },
331
+ "attribute": "cms-env",
332
+ "reflect": true,
333
+ "defaultValue": "'stage'"
334
+ },
335
+ "showSliderDots": {
336
+ "type": "boolean",
337
+ "mutable": false,
338
+ "complexType": {
339
+ "original": "boolean",
340
+ "resolved": "boolean",
341
+ "references": {}
342
+ },
343
+ "required": false,
344
+ "optional": false,
345
+ "docs": {
346
+ "tags": [],
347
+ "text": "Show slider dots"
348
+ },
349
+ "attribute": "show-slider-dots",
350
+ "reflect": true,
351
+ "defaultValue": "true"
352
+ },
353
+ "showSliderArrows": {
354
+ "type": "boolean",
355
+ "mutable": false,
356
+ "complexType": {
357
+ "original": "boolean",
358
+ "resolved": "boolean",
359
+ "references": {}
360
+ },
361
+ "required": false,
362
+ "optional": false,
363
+ "docs": {
364
+ "tags": [],
365
+ "text": "Show slider navigate arrows"
366
+ },
367
+ "attribute": "show-slider-arrows",
368
+ "reflect": true,
369
+ "defaultValue": "true"
370
+ },
371
+ "showSliderArrowsMobile": {
372
+ "type": "boolean",
373
+ "mutable": false,
374
+ "complexType": {
375
+ "original": "boolean",
376
+ "resolved": "boolean",
377
+ "references": {}
378
+ },
379
+ "required": false,
380
+ "optional": false,
381
+ "docs": {
382
+ "tags": [],
383
+ "text": "Show slider navigate arrows on mobile"
384
+ },
385
+ "attribute": "show-slider-arrows-mobile",
386
+ "reflect": true,
387
+ "defaultValue": "false"
388
+ },
389
+ "enableAutoScroll": {
390
+ "type": "boolean",
391
+ "mutable": false,
392
+ "complexType": {
393
+ "original": "boolean",
394
+ "resolved": "boolean",
395
+ "references": {}
396
+ },
397
+ "required": false,
398
+ "optional": false,
399
+ "docs": {
400
+ "tags": [],
401
+ "text": "Auto-scroll will only function if it is set to true, and otherwise it will be ignored."
402
+ },
403
+ "attribute": "enable-auto-scroll",
404
+ "reflect": true,
405
+ "defaultValue": "false"
406
+ },
407
+ "intervalPeriod": {
408
+ "type": "number",
409
+ "mutable": false,
410
+ "complexType": {
411
+ "original": "number",
412
+ "resolved": "number",
413
+ "references": {}
414
+ },
415
+ "required": false,
416
+ "optional": false,
417
+ "docs": {
418
+ "tags": [],
419
+ "text": "Set interval period for slider"
420
+ },
421
+ "attribute": "interval-period",
422
+ "reflect": true,
423
+ "defaultValue": "5000"
424
+ },
425
+ "scrollItems": {
426
+ "type": "any",
427
+ "mutable": false,
428
+ "complexType": {
429
+ "original": "any",
430
+ "resolved": "any",
431
+ "references": {}
432
+ },
433
+ "required": false,
434
+ "optional": false,
435
+ "docs": {
436
+ "tags": [],
437
+ "text": "Set the number of slides you wish to display."
438
+ },
439
+ "attribute": "scroll-items",
440
+ "reflect": true,
441
+ "defaultValue": "1"
442
+ },
443
+ "itemsPerPage": {
444
+ "type": "number",
445
+ "mutable": false,
446
+ "complexType": {
447
+ "original": "number",
448
+ "resolved": "number",
449
+ "references": {}
450
+ },
451
+ "required": false,
452
+ "optional": false,
453
+ "docs": {
454
+ "tags": [],
455
+ "text": "Set the number of slides you wish to display."
456
+ },
457
+ "attribute": "items-per-page",
458
+ "reflect": true,
459
+ "defaultValue": "1"
460
+ }
461
+ };
462
+ }
463
+ static get states() {
464
+ return {
465
+ "hasErrors": {},
466
+ "limitStylingAppends": {},
467
+ "isLoading": {},
468
+ "activeIndex": {},
469
+ "tutorialElementWidth": {}
470
+ };
266
471
  }
267
- }
268
- static get is() { return "general-tutorial-slider"; }
269
- static get encapsulation() { return "shadow"; }
270
- static get originalStyleUrls() { return {
271
- "$": ["general-tutorial-slider.scss"]
272
- }; }
273
- static get styleUrls() { return {
274
- "$": ["general-tutorial-slider.css"]
275
- }; }
276
- static get properties() { return {
277
- "clientStyling": {
278
- "type": "string",
279
- "mutable": false,
280
- "complexType": {
281
- "original": "string",
282
- "resolved": "string",
283
- "references": {}
284
- },
285
- "required": false,
286
- "optional": false,
287
- "docs": {
288
- "tags": [],
289
- "text": "Client custom styling via inline style"
290
- },
291
- "attribute": "client-styling",
292
- "reflect": true,
293
- "defaultValue": "''"
294
- },
295
- "clientStylingUrl": {
296
- "type": "string",
297
- "mutable": false,
298
- "complexType": {
299
- "original": "string",
300
- "resolved": "string",
301
- "references": {}
302
- },
303
- "required": false,
304
- "optional": false,
305
- "docs": {
306
- "tags": [],
307
- "text": "Client custom styling via url"
308
- },
309
- "attribute": "client-styling-url",
310
- "reflect": true,
311
- "defaultValue": "''"
312
- },
313
- "language": {
314
- "type": "string",
315
- "mutable": false,
316
- "complexType": {
317
- "original": "string",
318
- "resolved": "string",
319
- "references": {}
320
- },
321
- "required": false,
322
- "optional": false,
323
- "docs": {
324
- "tags": [],
325
- "text": "Language of the widget"
326
- },
327
- "attribute": "language",
328
- "reflect": true,
329
- "defaultValue": "'en'"
330
- },
331
- "cmsEndpoint": {
332
- "type": "string",
333
- "mutable": false,
334
- "complexType": {
335
- "original": "string",
336
- "resolved": "string",
337
- "references": {}
338
- },
339
- "required": true,
340
- "optional": false,
341
- "docs": {
342
- "tags": [],
343
- "text": "Endpoint URL for the source of data"
344
- },
345
- "attribute": "cms-endpoint",
346
- "reflect": true
347
- },
348
- "userRoles": {
349
- "type": "string",
350
- "mutable": false,
351
- "complexType": {
352
- "original": "string",
353
- "resolved": "string",
354
- "references": {}
355
- },
356
- "required": false,
357
- "optional": false,
358
- "docs": {
359
- "tags": [],
360
- "text": "User roles"
361
- },
362
- "attribute": "user-roles",
363
- "reflect": true,
364
- "defaultValue": "'everyone'"
365
- },
366
- "cmsEnv": {
367
- "type": "string",
368
- "mutable": false,
369
- "complexType": {
370
- "original": "string",
371
- "resolved": "string",
372
- "references": {}
373
- },
374
- "required": false,
375
- "optional": false,
376
- "docs": {
377
- "tags": [],
378
- "text": "CMS Endpoint stage"
379
- },
380
- "attribute": "cms-env",
381
- "reflect": true,
382
- "defaultValue": "'stage'"
383
- },
384
- "showSliderDots": {
385
- "type": "boolean",
386
- "mutable": false,
387
- "complexType": {
388
- "original": "boolean",
389
- "resolved": "boolean",
390
- "references": {}
391
- },
392
- "required": false,
393
- "optional": false,
394
- "docs": {
395
- "tags": [],
396
- "text": "Show slider dots"
397
- },
398
- "attribute": "show-slider-dots",
399
- "reflect": true,
400
- "defaultValue": "true"
401
- },
402
- "showSliderArrows": {
403
- "type": "boolean",
404
- "mutable": false,
405
- "complexType": {
406
- "original": "boolean",
407
- "resolved": "boolean",
408
- "references": {}
409
- },
410
- "required": false,
411
- "optional": false,
412
- "docs": {
413
- "tags": [],
414
- "text": "Show slider navigate arrows"
415
- },
416
- "attribute": "show-slider-arrows",
417
- "reflect": true,
418
- "defaultValue": "true"
419
- },
420
- "showSliderArrowsMobile": {
421
- "type": "boolean",
422
- "mutable": false,
423
- "complexType": {
424
- "original": "boolean",
425
- "resolved": "boolean",
426
- "references": {}
427
- },
428
- "required": false,
429
- "optional": false,
430
- "docs": {
431
- "tags": [],
432
- "text": "Show slider navigate arrows on mobile"
433
- },
434
- "attribute": "show-slider-arrows-mobile",
435
- "reflect": true,
436
- "defaultValue": "false"
437
- },
438
- "enableAutoScroll": {
439
- "type": "boolean",
440
- "mutable": false,
441
- "complexType": {
442
- "original": "boolean",
443
- "resolved": "boolean",
444
- "references": {}
445
- },
446
- "required": false,
447
- "optional": false,
448
- "docs": {
449
- "tags": [],
450
- "text": "Auto-scroll will only function if it is set to true, and otherwise it will be ignored."
451
- },
452
- "attribute": "enable-auto-scroll",
453
- "reflect": true,
454
- "defaultValue": "false"
455
- },
456
- "intervalPeriod": {
457
- "type": "number",
458
- "mutable": false,
459
- "complexType": {
460
- "original": "number",
461
- "resolved": "number",
462
- "references": {}
463
- },
464
- "required": false,
465
- "optional": false,
466
- "docs": {
467
- "tags": [],
468
- "text": "Set interval period for slider"
469
- },
470
- "attribute": "interval-period",
471
- "reflect": true,
472
- "defaultValue": "5000"
473
- },
474
- "scrollItems": {
475
- "type": "any",
476
- "mutable": false,
477
- "complexType": {
478
- "original": "any",
479
- "resolved": "any",
480
- "references": {}
481
- },
482
- "required": false,
483
- "optional": false,
484
- "docs": {
485
- "tags": [],
486
- "text": "Set the number of slides you wish to display."
487
- },
488
- "attribute": "scroll-items",
489
- "reflect": true,
490
- "defaultValue": "1"
491
- },
492
- "itemsPerPage": {
493
- "type": "number",
494
- "mutable": false,
495
- "complexType": {
496
- "original": "number",
497
- "resolved": "number",
498
- "references": {}
499
- },
500
- "required": false,
501
- "optional": false,
502
- "docs": {
503
- "tags": [],
504
- "text": "Set the number of slides you wish to display."
505
- },
506
- "attribute": "items-per-page",
507
- "reflect": true,
508
- "defaultValue": "1"
472
+ static get elementRef() { return "el"; }
473
+ static get watchers() {
474
+ return [{
475
+ "propName": "cmsEndpoint",
476
+ "methodName": "watchEndpoint"
477
+ }, {
478
+ "propName": "language",
479
+ "methodName": "watchEndpoint"
480
+ }];
509
481
  }
510
- }; }
511
- static get states() { return {
512
- "hasErrors": {},
513
- "limitStylingAppends": {},
514
- "isLoading": {},
515
- "activeIndex": {},
516
- "tutorialElementWidth": {}
517
- }; }
518
- static get elementRef() { return "el"; }
519
- static get watchers() { return [{
520
- "propName": "cmsEndpoint",
521
- "methodName": "watchEndpoint"
522
- }, {
523
- "propName": "language",
524
- "methodName": "watchEndpoint"
525
- }]; }
526
482
  }