@saasquatch/vanilla-components 1.2.4-4 → 1.2.4-7

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 (88) hide show
  1. package/LICENSE +21 -21
  2. package/dist/cjs/{WidgetHost-71b013eb.js → WidgetHost-d7b870ce.js} +615 -615
  3. package/dist/cjs/sqh-close-button.cjs.entry.js +25 -25
  4. package/dist/cjs/sqh-copy-button_12.cjs.entry.js +1134 -1050
  5. package/dist/cjs/sqh-referral-code.cjs.entry.js +22 -22
  6. package/dist/cjs/sqh-rewards-actions.cjs.entry.js +26 -26
  7. package/dist/collection/components/close-button/close-button.js +70 -70
  8. package/dist/collection/components/copy-button/copy-button.js +389 -389
  9. package/dist/collection/components/copy-link-button/copy-link-button.js +236 -233
  10. package/dist/collection/components/global-container/global-container.js +170 -170
  11. package/dist/collection/components/image-component/image-component.js +178 -175
  12. package/dist/collection/components/partner-stat-component/partner-stat-component.js +199 -193
  13. package/dist/collection/components/referral-code/referral-code.js +36 -36
  14. package/dist/collection/components/referral-component/referral-component.js +255 -255
  15. package/dist/collection/components/referral-list/referral-list.js +935 -932
  16. package/dist/collection/components/rewards-actions/rewards-actions.js +105 -105
  17. package/dist/collection/components/share-button/share-button.js +310 -310
  18. package/dist/collection/components/share-button-container/share-button-container.js +2457 -2470
  19. package/dist/collection/components/stat-component/stat-component.js +200 -194
  20. package/dist/collection/components/stats-container/stats-container.js +210 -208
  21. package/dist/collection/components/text-component/text-component.js +283 -280
  22. package/dist/collection/entrypoint.js +32 -32
  23. package/dist/collection/global/global.js +4 -4
  24. package/dist/collection/services/FormatJs.js +15 -15
  25. package/dist/collection/services/WidgetHost.js +621 -621
  26. package/dist/collection/utilities.js +81 -81
  27. package/dist/esm/{WidgetHost-9c337319.js → WidgetHost-a27e693d.js} +615 -615
  28. package/dist/esm/polyfills/core-js.js +0 -0
  29. package/dist/esm/polyfills/dom.js +0 -0
  30. package/dist/esm/polyfills/es5-html-element.js +0 -0
  31. package/dist/esm/polyfills/index.js +0 -0
  32. package/dist/esm/polyfills/system.js +0 -0
  33. package/dist/esm/sqh-close-button.entry.js +25 -25
  34. package/dist/esm/sqh-copy-button_12.entry.js +1134 -1050
  35. package/dist/esm/sqh-referral-code.entry.js +22 -22
  36. package/dist/esm/sqh-rewards-actions.entry.js +26 -26
  37. package/dist/esm-es5/{WidgetHost-9c337319.js → WidgetHost-a27e693d.js} +9432 -9432
  38. package/dist/esm-es5/_commonjsHelpers-1d681858.js +17 -17
  39. package/dist/esm-es5/css-shim-a659079f.js +122 -122
  40. package/dist/esm-es5/dom-4061ceba.js +468 -468
  41. package/dist/esm-es5/en-be593af0.js +1471 -1471
  42. package/dist/esm-es5/index-8ea8b6d8.js +1758 -1758
  43. package/dist/esm-es5/loader.mjs +11 -11
  44. package/dist/esm-es5/sqh-close-button.entry.js +35 -35
  45. package/dist/esm-es5/sqh-copy-button_12.entry.js +9643 -9571
  46. package/dist/esm-es5/sqh-referral-code.entry.js +29 -29
  47. package/dist/esm-es5/sqh-rewards-actions.entry.js +31 -31
  48. package/dist/esm-es5/widget-components.mjs +6 -6
  49. package/dist/types/components/close-button/close-button.d.ts +18 -18
  50. package/dist/types/components/copy-button/copy-button.d.ts +93 -107
  51. package/dist/types/components/copy-link-button/copy-link-button.d.ts +55 -62
  52. package/dist/types/components/global-container/global-container.d.ts +43 -47
  53. package/dist/types/components/image-component/image-component.d.ts +46 -51
  54. package/dist/types/components/partner-stat-component/partner-stat-component.d.ts +52 -54
  55. package/dist/types/components/referral-code/referral-code.d.ts +12 -12
  56. package/dist/types/components/referral-component/referral-component.d.ts +46 -46
  57. package/dist/types/components/referral-list/referral-list.d.ts +242 -251
  58. package/dist/types/components/rewards-actions/rewards-actions.d.ts +25 -25
  59. package/dist/types/components/share-button/share-button.d.ts +82 -82
  60. package/dist/types/components/share-button-container/share-button-container.d.ts +629 -684
  61. package/dist/types/components/stat-component/stat-component.d.ts +50 -54
  62. package/dist/types/components/stats-container/stats-container.d.ts +47 -48
  63. package/dist/types/components/text-component/text-component.d.ts +70 -81
  64. package/dist/types/components.d.ts +132 -234
  65. package/dist/types/global/global.d.ts +4 -4
  66. package/dist/types/saasquatch.d.ts +103 -103
  67. package/dist/types/services/FormatJs.d.ts +7 -7
  68. package/dist/types/services/WidgetHost.d.ts +45 -45
  69. package/dist/types/utilities.d.ts +7 -7
  70. package/dist/widget-components/entrypoint.js +32 -32
  71. package/dist/widget-components/p-24fc4ba9.js +1 -1
  72. package/dist/widget-components/p-46109683.js +3 -3
  73. package/dist/widget-components/p-58be1132.system.js +1 -1
  74. package/dist/widget-components/{p-54ea7a00.entry.js → p-650d012d.entry.js} +1 -1
  75. package/dist/widget-components/p-908068c2.system.entry.js +1 -0
  76. package/dist/widget-components/{p-edd43dbc.js → p-9525bf4a.js} +0 -0
  77. package/dist/widget-components/{p-8e232564.system.js → p-9adc7c50.system.js} +0 -0
  78. package/dist/widget-components/{p-b17efca4.system.entry.js → p-c0cdba77.system.entry.js} +1 -1
  79. package/dist/widget-components/{p-366f1663.entry.js → p-d4b27c72.entry.js} +1 -1
  80. package/dist/widget-components/{p-d416634a.entry.js → p-d7059393.entry.js} +16 -16
  81. package/dist/widget-components/p-fba5ea7f.system.entry.js +8 -0
  82. package/dist/widget-components/widget-components.esm.js +1 -1
  83. package/dist/widget-components/widget-components.js +1 -1
  84. package/docs/raisins.json +1 -1
  85. package/package.json +96 -96
  86. package/readme.md +52 -52
  87. package/dist/widget-components/p-c8bc8c77.system.entry.js +0 -1
  88. package/dist/widget-components/p-d97c955d.system.entry.js +0 -8
@@ -1,280 +1,283 @@
1
- import { h, Component, Prop, Element } from "@stencil/core";
2
- import { css } from "emotion";
3
- import marked from "marked";
4
- /**
5
- * @uiName Text Component
6
- * @canvasRenderer always-replace
7
- * @exampleGroup Common Components
8
- * @example Header Text - <sqh-text-component sqhheader="true" ishidden="false" ismarkdown="false" text="Give $10 and Get $10!" color="#4486E1" fontsize="30" textalign="center" paddingtop="30" paddingbottom="10"></sqh-text-component>
9
- * @example Paragraph Text - <sqh-text-component sqhbody="true" ishidden="false" ismarkdown="true" text="Give a friend a $10 and receive $10 for yourself when they purchase.<br/><br/>Share the link below or use the code **<sqh-referral-code />**" color="#000000" fontsize="13" textalign="center" paddingtop="5" paddingbottom="20"></sqh-text-component>
10
- */
11
- export class TextComponent {
12
- render() {
13
- const regex = /\b((?:[a-z][\w-]+:(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’]))/i;
14
- const textStyle = css `
15
- font-family: ${this.fontfamily || "inherit"};
16
- font-size: ${this.fontsize ? this.fontsize + "px" : "inherit"};
17
- text-align: ${this.textalign};
18
- color: ${this.color || "inherit"};
19
- padding-top: ${this.paddingtop ? this.paddingtop + "px" : "inherit"};
20
- padding-bottom: ${this.paddingbottom
21
- ? this.paddingbottom + "px"
22
- : "inherit"};
23
- overflow-wrap: break-word;
24
- `;
25
- const divStyle = css `
26
- background: ${this.background
27
- ? this.background.match(regex)
28
- ? `url(${this.background}) no-repeat center center;`
29
- : this.background
30
- : "inherit"};
31
- height: ${this.height || "inherit"};
32
- background-size: contain;
33
- `;
34
- const content = this.ismarkdown ? (h("div", { innerHTML: marked(this.text) })) : (this.text);
35
- return (!this.ishidden && (h("div", { class: divStyle },
36
- h("p", { class: textStyle }, content))));
37
- }
38
- static get is() { return "sqh-text-component"; }
39
- static get originalStyleUrls() { return {
40
- "$": ["text-component.scss"]
41
- }; }
42
- static get styleUrls() { return {
43
- "$": ["text-component.css"]
44
- }; }
45
- static get properties() { return {
46
- "ishidden": {
47
- "type": "boolean",
48
- "mutable": false,
49
- "complexType": {
50
- "original": "boolean",
51
- "resolved": "boolean",
52
- "references": {}
53
- },
54
- "required": false,
55
- "optional": false,
56
- "docs": {
57
- "tags": [{
58
- "text": "Hide Text",
59
- "name": "uiName"
60
- }],
61
- "text": "Hide or show the component"
62
- },
63
- "attribute": "ishidden",
64
- "reflect": false
65
- },
66
- "ismarkdown": {
67
- "type": "boolean",
68
- "mutable": false,
69
- "complexType": {
70
- "original": "boolean",
71
- "resolved": "boolean",
72
- "references": {}
73
- },
74
- "required": false,
75
- "optional": false,
76
- "docs": {
77
- "tags": [{
78
- "text": "Is Markdown",
79
- "name": "uiName"
80
- }],
81
- "text": "Compiles plain text into markdown"
82
- },
83
- "attribute": "ismarkdown",
84
- "reflect": false
85
- },
86
- "text": {
87
- "type": "string",
88
- "mutable": false,
89
- "complexType": {
90
- "original": "string",
91
- "resolved": "string",
92
- "references": {}
93
- },
94
- "required": false,
95
- "optional": false,
96
- "docs": {
97
- "tags": [{
98
- "text": "Text",
99
- "name": "uiName"
100
- }],
101
- "text": "The text content"
102
- },
103
- "attribute": "text",
104
- "reflect": false
105
- },
106
- "fontfamily": {
107
- "type": "string",
108
- "mutable": false,
109
- "complexType": {
110
- "original": "string",
111
- "resolved": "string",
112
- "references": {}
113
- },
114
- "required": false,
115
- "optional": false,
116
- "docs": {
117
- "tags": [{
118
- "text": "Font Family",
119
- "name": "uiName"
120
- }],
121
- "text": "Font family of the text"
122
- },
123
- "attribute": "fontfamily",
124
- "reflect": false
125
- },
126
- "color": {
127
- "type": "string",
128
- "mutable": false,
129
- "complexType": {
130
- "original": "string",
131
- "resolved": "string",
132
- "references": {}
133
- },
134
- "required": false,
135
- "optional": false,
136
- "docs": {
137
- "tags": [{
138
- "text": "Color",
139
- "name": "uiName"
140
- }, {
141
- "text": "color",
142
- "name": "uiWidget"
143
- }, {
144
- "text": "color",
145
- "name": "format"
146
- }],
147
- "text": "Color of the text"
148
- },
149
- "attribute": "color",
150
- "reflect": false
151
- },
152
- "fontsize": {
153
- "type": "string",
154
- "mutable": false,
155
- "complexType": {
156
- "original": "string",
157
- "resolved": "string",
158
- "references": {}
159
- },
160
- "required": false,
161
- "optional": false,
162
- "docs": {
163
- "tags": [{
164
- "text": "Font Size",
165
- "name": "uiName"
166
- }],
167
- "text": "Size of the text"
168
- },
169
- "attribute": "fontsize",
170
- "reflect": false
171
- },
172
- "paddingtop": {
173
- "type": "string",
174
- "mutable": false,
175
- "complexType": {
176
- "original": "string",
177
- "resolved": "string",
178
- "references": {}
179
- },
180
- "required": false,
181
- "optional": false,
182
- "docs": {
183
- "tags": [{
184
- "text": "Padding Top",
185
- "name": "uiName"
186
- }],
187
- "text": "Top padding on text"
188
- },
189
- "attribute": "paddingtop",
190
- "reflect": false
191
- },
192
- "paddingbottom": {
193
- "type": "string",
194
- "mutable": false,
195
- "complexType": {
196
- "original": "string",
197
- "resolved": "string",
198
- "references": {}
199
- },
200
- "required": false,
201
- "optional": false,
202
- "docs": {
203
- "tags": [{
204
- "text": "Padding Bottom",
205
- "name": "uiName"
206
- }],
207
- "text": "Bottom padding on text"
208
- },
209
- "attribute": "paddingbottom",
210
- "reflect": false
211
- },
212
- "textalign": {
213
- "type": "string",
214
- "mutable": false,
215
- "complexType": {
216
- "original": "string",
217
- "resolved": "string",
218
- "references": {}
219
- },
220
- "required": false,
221
- "optional": false,
222
- "docs": {
223
- "tags": [{
224
- "text": "Text Align",
225
- "name": "uiName"
226
- }, {
227
- "text": "[\"left\", \"center\", \"right\"]",
228
- "name": "uiEnum"
229
- }, {
230
- "text": "[\"Left\", \"Center\", \"Right\"]",
231
- "name": "uiEnumNames"
232
- }],
233
- "text": "Text alignment"
234
- },
235
- "attribute": "textalign",
236
- "reflect": false
237
- },
238
- "background": {
239
- "type": "string",
240
- "mutable": false,
241
- "complexType": {
242
- "original": "string",
243
- "resolved": "string",
244
- "references": {}
245
- },
246
- "required": false,
247
- "optional": false,
248
- "docs": {
249
- "tags": [{
250
- "text": "Background",
251
- "name": "uiName"
252
- }],
253
- "text": "Background the container, color or url"
254
- },
255
- "attribute": "background",
256
- "reflect": false
257
- },
258
- "height": {
259
- "type": "string",
260
- "mutable": false,
261
- "complexType": {
262
- "original": "string",
263
- "resolved": "string",
264
- "references": {}
265
- },
266
- "required": false,
267
- "optional": false,
268
- "docs": {
269
- "tags": [{
270
- "text": "Height",
271
- "name": "uiName"
272
- }],
273
- "text": "Height of the container"
274
- },
275
- "attribute": "height",
276
- "reflect": false
277
- }
278
- }; }
279
- static get elementRef() { return "textEl"; }
280
- }
1
+ import { h, Component, Prop, Element } from "@stencil/core";
2
+ import { css } from "emotion";
3
+ import marked from "marked";
4
+ /**
5
+ * @uiName Text Component
6
+ * @canvasRenderer always-replace
7
+ * @exampleGroup Common Components
8
+ * @example Header Text - <sqh-text-component sqhheader="true" ishidden="false" ismarkdown="false" text="Give $10 and Get $10!" color="#4486E1" fontsize="30" textalign="center" paddingtop="30" paddingbottom="10"></sqh-text-component>
9
+ * @example Paragraph Text - <sqh-text-component sqhbody="true" ishidden="false" ismarkdown="true" text="Give a friend a $10 and receive $10 for yourself when they purchase.<br/><br/>Share the link below or use the code **<sqh-referral-code />**" color="#000000" fontsize="13" textalign="center" paddingtop="5" paddingbottom="20"></sqh-text-component>
10
+ */
11
+ export class TextComponent {
12
+ render() {
13
+ const regex = /\b((?:[a-z][\w-]+:(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’]))/i;
14
+ const textStyle = css `
15
+ font-family: ${this.fontfamily || "inherit"};
16
+ font-size: ${this.fontsize ? this.fontsize + "px" : "inherit"};
17
+ text-align: ${this.textalign};
18
+ color: ${this.color || "inherit"};
19
+ padding-top: ${this.paddingtop ? this.paddingtop + "px" : "inherit"};
20
+ padding-bottom: ${this.paddingbottom
21
+ ? this.paddingbottom + "px"
22
+ : "inherit"};
23
+ overflow-wrap: break-word;
24
+ `;
25
+ const divStyle = css `
26
+ background: ${this.background
27
+ ? this.background.match(regex)
28
+ ? `url(${this.background}) no-repeat center center;`
29
+ : this.background
30
+ : "inherit"};
31
+ height: ${this.height || "inherit"};
32
+ background-size: contain;
33
+ `;
34
+ const content = this.ismarkdown ? (h("div", { innerHTML: marked(this.text) })) : (this.text);
35
+ return (!this.ishidden && (h("div", { class: divStyle },
36
+ h("p", { class: textStyle }, content))));
37
+ }
38
+ static get is() { return "sqh-text-component"; }
39
+ static get originalStyleUrls() { return {
40
+ "$": ["text-component.scss"]
41
+ }; }
42
+ static get styleUrls() { return {
43
+ "$": ["text-component.css"]
44
+ }; }
45
+ static get properties() { return {
46
+ "ishidden": {
47
+ "type": "boolean",
48
+ "mutable": false,
49
+ "complexType": {
50
+ "original": "boolean",
51
+ "resolved": "boolean",
52
+ "references": {}
53
+ },
54
+ "required": false,
55
+ "optional": false,
56
+ "docs": {
57
+ "tags": [{
58
+ "text": undefined,
59
+ "name": "undocumented"
60
+ }, {
61
+ "text": "Hide Text",
62
+ "name": "uiName"
63
+ }],
64
+ "text": ""
65
+ },
66
+ "attribute": "ishidden",
67
+ "reflect": false
68
+ },
69
+ "ismarkdown": {
70
+ "type": "boolean",
71
+ "mutable": false,
72
+ "complexType": {
73
+ "original": "boolean",
74
+ "resolved": "boolean",
75
+ "references": {}
76
+ },
77
+ "required": false,
78
+ "optional": false,
79
+ "docs": {
80
+ "tags": [{
81
+ "text": "Use Markdown",
82
+ "name": "uiName"
83
+ }],
84
+ "text": "Compile plain text into markdown."
85
+ },
86
+ "attribute": "ismarkdown",
87
+ "reflect": false
88
+ },
89
+ "text": {
90
+ "type": "string",
91
+ "mutable": false,
92
+ "complexType": {
93
+ "original": "string",
94
+ "resolved": "string",
95
+ "references": {}
96
+ },
97
+ "required": false,
98
+ "optional": false,
99
+ "docs": {
100
+ "tags": [{
101
+ "text": "Text",
102
+ "name": "uiName"
103
+ }],
104
+ "text": ""
105
+ },
106
+ "attribute": "text",
107
+ "reflect": false
108
+ },
109
+ "fontfamily": {
110
+ "type": "string",
111
+ "mutable": false,
112
+ "complexType": {
113
+ "original": "string",
114
+ "resolved": "string",
115
+ "references": {}
116
+ },
117
+ "required": false,
118
+ "optional": false,
119
+ "docs": {
120
+ "tags": [{
121
+ "text": "Font Family",
122
+ "name": "uiName"
123
+ }],
124
+ "text": ""
125
+ },
126
+ "attribute": "fontfamily",
127
+ "reflect": false
128
+ },
129
+ "color": {
130
+ "type": "string",
131
+ "mutable": false,
132
+ "complexType": {
133
+ "original": "string",
134
+ "resolved": "string",
135
+ "references": {}
136
+ },
137
+ "required": false,
138
+ "optional": false,
139
+ "docs": {
140
+ "tags": [{
141
+ "text": "Text Color",
142
+ "name": "uiName"
143
+ }, {
144
+ "text": "color",
145
+ "name": "uiWidget"
146
+ }, {
147
+ "text": "color",
148
+ "name": "format"
149
+ }],
150
+ "text": ""
151
+ },
152
+ "attribute": "color",
153
+ "reflect": false
154
+ },
155
+ "fontsize": {
156
+ "type": "string",
157
+ "mutable": false,
158
+ "complexType": {
159
+ "original": "string",
160
+ "resolved": "string",
161
+ "references": {}
162
+ },
163
+ "required": false,
164
+ "optional": false,
165
+ "docs": {
166
+ "tags": [{
167
+ "text": "Font Size",
168
+ "name": "uiName"
169
+ }],
170
+ "text": ""
171
+ },
172
+ "attribute": "fontsize",
173
+ "reflect": false
174
+ },
175
+ "paddingtop": {
176
+ "type": "string",
177
+ "mutable": false,
178
+ "complexType": {
179
+ "original": "string",
180
+ "resolved": "string",
181
+ "references": {}
182
+ },
183
+ "required": false,
184
+ "optional": false,
185
+ "docs": {
186
+ "tags": [{
187
+ "text": "Padding Top",
188
+ "name": "uiName"
189
+ }],
190
+ "text": "Define the top padding of the container with a pixel amount."
191
+ },
192
+ "attribute": "paddingtop",
193
+ "reflect": false
194
+ },
195
+ "paddingbottom": {
196
+ "type": "string",
197
+ "mutable": false,
198
+ "complexType": {
199
+ "original": "string",
200
+ "resolved": "string",
201
+ "references": {}
202
+ },
203
+ "required": false,
204
+ "optional": false,
205
+ "docs": {
206
+ "tags": [{
207
+ "text": "Padding Bottom",
208
+ "name": "uiName"
209
+ }],
210
+ "text": "Define the bottom padding of the container with a pixel amount."
211
+ },
212
+ "attribute": "paddingbottom",
213
+ "reflect": false
214
+ },
215
+ "textalign": {
216
+ "type": "string",
217
+ "mutable": false,
218
+ "complexType": {
219
+ "original": "string",
220
+ "resolved": "string",
221
+ "references": {}
222
+ },
223
+ "required": false,
224
+ "optional": false,
225
+ "docs": {
226
+ "tags": [{
227
+ "text": "Text Alignment",
228
+ "name": "uiName"
229
+ }, {
230
+ "text": "[\"left\", \"center\", \"right\"]",
231
+ "name": "uiEnum"
232
+ }, {
233
+ "text": "[\"Left\", \"Center\", \"Right\"]",
234
+ "name": "uiEnumNames"
235
+ }],
236
+ "text": ""
237
+ },
238
+ "attribute": "textalign",
239
+ "reflect": false
240
+ },
241
+ "background": {
242
+ "type": "string",
243
+ "mutable": false,
244
+ "complexType": {
245
+ "original": "string",
246
+ "resolved": "string",
247
+ "references": {}
248
+ },
249
+ "required": false,
250
+ "optional": false,
251
+ "docs": {
252
+ "tags": [{
253
+ "text": "Background",
254
+ "name": "uiName"
255
+ }],
256
+ "text": "Fill the background with a color or image. Input color values as a HEX code and an image as a URL."
257
+ },
258
+ "attribute": "background",
259
+ "reflect": false
260
+ },
261
+ "height": {
262
+ "type": "string",
263
+ "mutable": false,
264
+ "complexType": {
265
+ "original": "string",
266
+ "resolved": "string",
267
+ "references": {}
268
+ },
269
+ "required": false,
270
+ "optional": false,
271
+ "docs": {
272
+ "tags": [{
273
+ "text": "Height",
274
+ "name": "uiName"
275
+ }],
276
+ "text": "Define the height of the container with a pixel amount."
277
+ },
278
+ "attribute": "height",
279
+ "reflect": false
280
+ }
281
+ }; }
282
+ static get elementRef() { return "textEl"; }
283
+ }
@@ -1,32 +1,32 @@
1
- // NOTE(johan): This is a custom loader which will inject script tags for both the ES Modules and non-ES Modules
2
- // builds. We use this instead of dist/widget-components.js as that is deprecated and actually doesn't work because of
3
- // its name causing lazy loaded scripts to be loaded from the wrong path in /dist
4
- (function(doc){
5
- var isSafari10 = window.navigator.userAgent.indexOf('Safari') > 0 && window.navigator.userAgent.indexOf('Version/10') > 0;
6
- var scriptElm = doc.scripts[doc.scripts.length - 1];
7
-
8
- var parts = scriptElm.src.split('/');
9
- parts.pop();
10
- var url = parts.join('/');
11
-
12
- // NOTE(johan): Safari 10 supports type="module" but the build is too new for it, so we only want the ES5 build but
13
- // without the "nomodule" attribute
14
- // This may not be necessary in Stencil 1.8.x - https://github.com/ionic-team/stencil/issues/1900
15
-
16
- if (!isSafari10) {
17
- var scriptElm = doc.createElement('script');
18
- scriptElm.setAttribute('type', 'module');
19
- scriptElm.src = url + '/widget-components.esm.js';
20
- scriptElm.setAttribute('data-stencil-namespace', 'widget-components');
21
- doc.head.appendChild(scriptElm);
22
- }
23
-
24
- var scriptElm = doc.createElement('script');
25
- if (!isSafari10) {
26
- scriptElm.setAttribute('nomodule', '');
27
- }
28
- scriptElm.src = url + '/widget-components.js';
29
- scriptElm.setAttribute('data-stencil-namespace', 'widget-components');
30
- doc.head.appendChild(scriptElm)
31
- })(document);
32
-
1
+ // NOTE(johan): This is a custom loader which will inject script tags for both the ES Modules and non-ES Modules
2
+ // builds. We use this instead of dist/widget-components.js as that is deprecated and actually doesn't work because of
3
+ // its name causing lazy loaded scripts to be loaded from the wrong path in /dist
4
+ (function(doc){
5
+ var isSafari10 = window.navigator.userAgent.indexOf('Safari') > 0 && window.navigator.userAgent.indexOf('Version/10') > 0;
6
+ var scriptElm = doc.scripts[doc.scripts.length - 1];
7
+
8
+ var parts = scriptElm.src.split('/');
9
+ parts.pop();
10
+ var url = parts.join('/');
11
+
12
+ // NOTE(johan): Safari 10 supports type="module" but the build is too new for it, so we only want the ES5 build but
13
+ // without the "nomodule" attribute
14
+ // This may not be necessary in Stencil 1.8.x - https://github.com/ionic-team/stencil/issues/1900
15
+
16
+ if (!isSafari10) {
17
+ var scriptElm = doc.createElement('script');
18
+ scriptElm.setAttribute('type', 'module');
19
+ scriptElm.src = url + '/widget-components.esm.js';
20
+ scriptElm.setAttribute('data-stencil-namespace', 'widget-components');
21
+ doc.head.appendChild(scriptElm);
22
+ }
23
+
24
+ var scriptElm = doc.createElement('script');
25
+ if (!isSafari10) {
26
+ scriptElm.setAttribute('nomodule', '');
27
+ }
28
+ scriptElm.src = url + '/widget-components.js';
29
+ scriptElm.setAttribute('data-stencil-namespace', 'widget-components');
30
+ doc.head.appendChild(scriptElm)
31
+ })(document);
32
+