@saasquatch/vanilla-components 1.2.5 → 1.2.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.
- package/LICENSE +21 -21
- package/dist/cjs/{WidgetHost-fce29ef5.js → WidgetHost-71b013eb.js} +195 -195
- package/dist/cjs/sqh-close-button.cjs.entry.js +1 -1
- package/dist/cjs/sqh-copy-button_12.cjs.entry.js +147 -147
- package/dist/cjs/sqh-referral-code.cjs.entry.js +1 -1
- package/dist/collection/components/copy-button/copy-button.js +22 -22
- package/dist/collection/components/copy-link-button/copy-link-button.js +15 -15
- package/dist/collection/components/global-container/global-container.js +8 -8
- package/dist/collection/components/image-component/image-component.js +10 -10
- package/dist/collection/components/partner-stat-component/partner-stat-component.js +2 -2
- package/dist/collection/components/referral-list/referral-list.js +51 -51
- package/dist/collection/components/share-button/share-button.js +19 -19
- package/dist/collection/components/stat-component/stat-component.js +2 -2
- package/dist/collection/components/stats-container/stats-container.js +4 -4
- package/dist/collection/components/text-component/text-component.js +13 -13
- package/dist/collection/entrypoint.js +34 -34
- package/dist/collection/services/WidgetHost.js +195 -195
- package/dist/esm/{WidgetHost-903fb7cc.js → WidgetHost-9c337319.js} +195 -195
- package/dist/esm/sqh-close-button.entry.js +1 -1
- package/dist/esm/sqh-copy-button_12.entry.js +147 -147
- package/dist/esm/sqh-referral-code.entry.js +1 -1
- package/dist/esm-es5/sqh-close-button.entry.js +1 -1
- package/dist/esm-es5/sqh-copy-button_12.entry.js +2 -2
- package/dist/esm-es5/sqh-referral-code.entry.js +1 -1
- package/dist/types/saasquatch.d.ts +105 -105
- package/dist/widget-components/entrypoint.js +34 -34
- package/dist/widget-components/{p-50ae8f2b.entry.js → p-366f1663.entry.js} +1 -1
- package/dist/widget-components/{p-131a5c4a.entry.js → p-54ea7a00.entry.js} +1 -1
- package/dist/widget-components/p-58be1132.system.js +1 -1
- package/dist/widget-components/{p-8baa34a0.entry.js → p-71e912a2.entry.js} +6 -6
- package/dist/widget-components/{p-b9fcb846.system.entry.js → p-b17efca4.system.entry.js} +1 -1
- package/dist/widget-components/p-c5f70ddc.system.entry.js +8 -0
- package/dist/widget-components/{p-da180bcd.system.entry.js → p-c8bc8c77.system.entry.js} +1 -1
- package/dist/widget-components/widget-components.esm.js +1 -1
- package/package.json +97 -97
- package/readme.md +52 -52
- package/dist/widget-components/p-1b8f2cfc.system.entry.js +0 -8
- /package/dist/esm-es5/{WidgetHost-903fb7cc.js → WidgetHost-9c337319.js} +0 -0
- /package/dist/widget-components/{p-e692beaf.system.js → p-8e232564.system.js} +0 -0
- /package/dist/widget-components/{p-ffeb02d1.js → p-edd43dbc.js} +0 -0
|
@@ -83,53 +83,53 @@ export class ReferralList {
|
|
|
83
83
|
if (this.referrals.length < 3 && this.referredBy && this.showreferrer) {
|
|
84
84
|
referredByRow = (h("sqh-referral-component", { id: uuid(), referral: this.referredBy, referralvariables: referralvariables, referraltype: "referrer", unknownuser: this.unknownuser, locale: this.internationalization ? this.locale : "en-US" }));
|
|
85
85
|
}
|
|
86
|
-
const clz = css `
|
|
87
|
-
.squatch-referrals-icon.icon-ok-circled {
|
|
88
|
-
color: ${this.rewardcolor};
|
|
89
|
-
}
|
|
90
|
-
.squatch-referrals-icon.icon-attention {
|
|
91
|
-
color: ${this.pendingcolor};
|
|
92
|
-
}
|
|
93
|
-
.squatch-referrals-value {
|
|
94
|
-
color: ${this.rewardcolor};
|
|
95
|
-
}
|
|
96
|
-
.squatch-referrals-value.pending {
|
|
97
|
-
color: ${this.pendingcolor};
|
|
98
|
-
}
|
|
99
|
-
.squatch-referrals-value.referrer {
|
|
100
|
-
color: ${this.rewardcolor};
|
|
101
|
-
}
|
|
102
|
-
.squatch-referrals-value.expired {
|
|
103
|
-
color: ${this.expiredcolor};
|
|
104
|
-
}
|
|
105
|
-
.squatch-value-contents.expired {
|
|
106
|
-
color: ${this.expiredcolor};
|
|
107
|
-
}
|
|
108
|
-
.squatch-referrals-icon.icon-attention.expired {
|
|
109
|
-
color: ${this.expiredcolor};
|
|
110
|
-
}
|
|
111
|
-
.squatch-referrals-value.cancelled {
|
|
112
|
-
color: ${this.cancelledcolor};
|
|
113
|
-
}
|
|
114
|
-
.squatch-value-contents.cancelled {
|
|
115
|
-
color: ${this.cancelledcolor};
|
|
116
|
-
}
|
|
117
|
-
.squatch-referrals-icon.icon-attention.cancelled {
|
|
118
|
-
color: ${this.cancelledcolor};
|
|
119
|
-
}
|
|
120
|
-
.squatch-referrals-heading {
|
|
121
|
-
color: ${this.referralnamecolor};
|
|
122
|
-
}
|
|
123
|
-
.squatch-referrals-description,
|
|
124
|
-
.squatch-referrals-value-content {
|
|
125
|
-
color: ${this.referraltextcolor};
|
|
126
|
-
}
|
|
127
|
-
.squatch-customer-note {
|
|
128
|
-
color: ${this.customernotecolor || "darkslategray"};
|
|
129
|
-
}
|
|
130
|
-
.squatch-referrals-scroll-action {
|
|
131
|
-
font-family: ${"inherit"};
|
|
132
|
-
}
|
|
86
|
+
const clz = css `
|
|
87
|
+
.squatch-referrals-icon.icon-ok-circled {
|
|
88
|
+
color: ${this.rewardcolor};
|
|
89
|
+
}
|
|
90
|
+
.squatch-referrals-icon.icon-attention {
|
|
91
|
+
color: ${this.pendingcolor};
|
|
92
|
+
}
|
|
93
|
+
.squatch-referrals-value {
|
|
94
|
+
color: ${this.rewardcolor};
|
|
95
|
+
}
|
|
96
|
+
.squatch-referrals-value.pending {
|
|
97
|
+
color: ${this.pendingcolor};
|
|
98
|
+
}
|
|
99
|
+
.squatch-referrals-value.referrer {
|
|
100
|
+
color: ${this.rewardcolor};
|
|
101
|
+
}
|
|
102
|
+
.squatch-referrals-value.expired {
|
|
103
|
+
color: ${this.expiredcolor};
|
|
104
|
+
}
|
|
105
|
+
.squatch-value-contents.expired {
|
|
106
|
+
color: ${this.expiredcolor};
|
|
107
|
+
}
|
|
108
|
+
.squatch-referrals-icon.icon-attention.expired {
|
|
109
|
+
color: ${this.expiredcolor};
|
|
110
|
+
}
|
|
111
|
+
.squatch-referrals-value.cancelled {
|
|
112
|
+
color: ${this.cancelledcolor};
|
|
113
|
+
}
|
|
114
|
+
.squatch-value-contents.cancelled {
|
|
115
|
+
color: ${this.cancelledcolor};
|
|
116
|
+
}
|
|
117
|
+
.squatch-referrals-icon.icon-attention.cancelled {
|
|
118
|
+
color: ${this.cancelledcolor};
|
|
119
|
+
}
|
|
120
|
+
.squatch-referrals-heading {
|
|
121
|
+
color: ${this.referralnamecolor};
|
|
122
|
+
}
|
|
123
|
+
.squatch-referrals-description,
|
|
124
|
+
.squatch-referrals-value-content {
|
|
125
|
+
color: ${this.referraltextcolor};
|
|
126
|
+
}
|
|
127
|
+
.squatch-customer-note {
|
|
128
|
+
color: ${this.customernotecolor || "darkslategray"};
|
|
129
|
+
}
|
|
130
|
+
.squatch-referrals-scroll-action {
|
|
131
|
+
font-family: ${"inherit"};
|
|
132
|
+
}
|
|
133
133
|
`;
|
|
134
134
|
const totalReferralsCount = this.showreferrer && this.referredBy
|
|
135
135
|
? this.referralsCount + 1
|
|
@@ -141,14 +141,14 @@ export class ReferralList {
|
|
|
141
141
|
referralsRow,
|
|
142
142
|
referredByRow),
|
|
143
143
|
h("div", { class: "squatch-referrals-scroll-action-container" },
|
|
144
|
-
h("button", { class: `
|
|
144
|
+
h("button", { class: `
|
|
145
145
|
squatch-referrals-scroll-action previous ${this.loading
|
|
146
146
|
? "disabled"
|
|
147
147
|
: this.offset === 0
|
|
148
148
|
? "disabled"
|
|
149
|
-
: ""}
|
|
149
|
+
: ""}
|
|
150
150
|
`, onClick: (event) => this.paginate(this.offset - 3, event) }, this.paginateless),
|
|
151
|
-
h("button", { class: `
|
|
151
|
+
h("button", { class: `
|
|
152
152
|
squatch-referrals-scroll-action view-more ${this.loading
|
|
153
153
|
? "disabled"
|
|
154
154
|
: this.showreferrer && this.referredBy
|
|
@@ -157,7 +157,7 @@ export class ReferralList {
|
|
|
157
157
|
: ""
|
|
158
158
|
: this.offset >= this.referralsCount - 3
|
|
159
159
|
? "disabled"
|
|
160
|
-
: ""}
|
|
160
|
+
: ""}
|
|
161
161
|
`, "view-more": true, onClick: (event) => this.paginate(this.offset + 3, event) }, this.paginatemore)))) : (
|
|
162
162
|
// 'No Referrals Yet' button if this.referralCount < 1
|
|
163
163
|
h("div", { class: "squatch-referrals-scroll-action-container" },
|
|
@@ -29,25 +29,25 @@ export class ShareButton {
|
|
|
29
29
|
const isMobileiOS = detectMobileSafari() || detectMobileChrome();
|
|
30
30
|
const target = isMobileiOS ? "_parent" : "_blank";
|
|
31
31
|
const iconClass = `icon icon-${this.icon}`;
|
|
32
|
-
const style = css `
|
|
33
|
-
background-color: ${this.backgroundcolor};
|
|
34
|
-
border: 1px solid ${this.backgroundcolor};
|
|
35
|
-
color: ${this.textcolor};
|
|
36
|
-
|
|
37
|
-
&:hover {
|
|
38
|
-
background: ${shadeColor(this.backgroundcolor, 10)};
|
|
39
|
-
border-color: ${shadeColor(this.backgroundcolor, 12)};
|
|
40
|
-
color: ${this.textcolor};
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
&:focus {
|
|
44
|
-
color: ${this.textcolor};
|
|
45
|
-
}
|
|
46
|
-
.icon-${this.icon} {
|
|
47
|
-
left: ${this.iconhorizontal}px;
|
|
48
|
-
top: ${this.iconvertical}px;
|
|
49
|
-
font-size: ${this.iconsize}em;
|
|
50
|
-
}
|
|
32
|
+
const style = css `
|
|
33
|
+
background-color: ${this.backgroundcolor};
|
|
34
|
+
border: 1px solid ${this.backgroundcolor};
|
|
35
|
+
color: ${this.textcolor};
|
|
36
|
+
|
|
37
|
+
&:hover {
|
|
38
|
+
background: ${shadeColor(this.backgroundcolor, 10)};
|
|
39
|
+
border-color: ${shadeColor(this.backgroundcolor, 12)};
|
|
40
|
+
color: ${this.textcolor};
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
&:focus {
|
|
44
|
+
color: ${this.textcolor};
|
|
45
|
+
}
|
|
46
|
+
.icon-${this.icon} {
|
|
47
|
+
left: ${this.iconhorizontal}px;
|
|
48
|
+
top: ${this.iconvertical}px;
|
|
49
|
+
font-size: ${this.iconsize}em;
|
|
50
|
+
}
|
|
51
51
|
`;
|
|
52
52
|
const classes = [
|
|
53
53
|
`squatch-share-btn`,
|
|
@@ -23,8 +23,8 @@ export class StatComponent {
|
|
|
23
23
|
this.statTypeUpdated.emit(stat);
|
|
24
24
|
}
|
|
25
25
|
render() {
|
|
26
|
-
const clz = css `
|
|
27
|
-
color: ${this.statcolor};
|
|
26
|
+
const clz = css `
|
|
27
|
+
color: ${this.statcolor};
|
|
28
28
|
`;
|
|
29
29
|
return (!this.ishidden && (h("div", { class: clz },
|
|
30
30
|
h("div", { class: "stat-value" }, this.statvalue),
|
|
@@ -102,10 +102,10 @@ export class StatsContainer {
|
|
|
102
102
|
this.loading = false;
|
|
103
103
|
}
|
|
104
104
|
render() {
|
|
105
|
-
const containerStyle = css `
|
|
106
|
-
display: ${this.ishidden ? "none" : "inherit"};
|
|
107
|
-
padding-top: ${this.paddingtop}px;
|
|
108
|
-
padding-bottom: ${this.paddingbottom}px;
|
|
105
|
+
const containerStyle = css `
|
|
106
|
+
display: ${this.ishidden ? "none" : "inherit"};
|
|
107
|
+
padding-top: ${this.paddingtop}px;
|
|
108
|
+
padding-bottom: ${this.paddingbottom}px;
|
|
109
109
|
`;
|
|
110
110
|
return (h("div", { class: containerStyle },
|
|
111
111
|
h("slot", null)));
|
|
@@ -11,26 +11,26 @@ import marked from "marked";
|
|
|
11
11
|
export class TextComponent {
|
|
12
12
|
render() {
|
|
13
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
|
-
font-weight: ${this.fontweight ? this.fontweight : "inherit"};
|
|
18
|
-
text-align: ${this.textalign};
|
|
19
|
-
color: ${this.color || "inherit"};
|
|
20
|
-
padding-top: ${this.paddingtop ? this.paddingtop + "px" : "inherit"};
|
|
14
|
+
const textStyle = css `
|
|
15
|
+
font-family: ${this.fontfamily || "inherit"};
|
|
16
|
+
font-size: ${this.fontsize ? this.fontsize + "px" : "inherit"};
|
|
17
|
+
font-weight: ${this.fontweight ? this.fontweight : "inherit"};
|
|
18
|
+
text-align: ${this.textalign};
|
|
19
|
+
color: ${this.color || "inherit"};
|
|
20
|
+
padding-top: ${this.paddingtop ? this.paddingtop + "px" : "inherit"};
|
|
21
21
|
padding-bottom: ${this.paddingbottom
|
|
22
22
|
? this.paddingbottom + "px"
|
|
23
|
-
: "inherit"};
|
|
24
|
-
overflow-wrap: break-word;
|
|
23
|
+
: "inherit"};
|
|
24
|
+
overflow-wrap: break-word;
|
|
25
25
|
`;
|
|
26
|
-
const divStyle = css `
|
|
26
|
+
const divStyle = css `
|
|
27
27
|
background: ${this.background
|
|
28
28
|
? this.background.match(regex)
|
|
29
29
|
? `url(${this.background}) no-repeat center center;`
|
|
30
30
|
: this.background
|
|
31
|
-
: "inherit"};
|
|
32
|
-
height: ${this.height || "inherit"};
|
|
33
|
-
background-size: contain;
|
|
31
|
+
: "inherit"};
|
|
32
|
+
height: ${this.height || "inherit"};
|
|
33
|
+
background-size: contain;
|
|
34
34
|
`;
|
|
35
35
|
const content = this.ismarkdown ? (h("div", { innerHTML: marked(this.text) })) : (this.text);
|
|
36
36
|
return (!this.ishidden && (h("div", { class: divStyle },
|
|
@@ -1,34 +1,34 @@
|
|
|
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 =
|
|
6
|
-
window.navigator.userAgent.indexOf("Safari") > 0 &&
|
|
7
|
-
window.navigator.userAgent.indexOf("Version/10") > 0;
|
|
8
|
-
var scriptElm = Array.from(doc.scripts).find((script) =>
|
|
9
|
-
script.src.includes("widget-components")
|
|
10
|
-
);
|
|
11
|
-
|
|
12
|
-
var parts = scriptElm.src.split("/");
|
|
13
|
-
parts.pop();
|
|
14
|
-
var url = parts.join("/");
|
|
15
|
-
|
|
16
|
-
// NOTE(johan): Safari 10 supports type="module" but the build is too new for it, so we only want the ES5 build but
|
|
17
|
-
// without the "nomodule" attribute
|
|
18
|
-
// This may not be necessary in Stencil 1.8.x - https://github.com/ionic-team/stencil/issues/1900
|
|
19
|
-
if (!isSafari10) {
|
|
20
|
-
var scriptElm = doc.createElement("script");
|
|
21
|
-
scriptElm.setAttribute("type", "module");
|
|
22
|
-
scriptElm.src = url + "/widget-components.esm.js";
|
|
23
|
-
scriptElm.setAttribute("data-stencil-namespace", "widget-components");
|
|
24
|
-
doc.head.appendChild(scriptElm);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
var scriptElm = doc.createElement("script");
|
|
28
|
-
if (!isSafari10) {
|
|
29
|
-
scriptElm.setAttribute("nomodule", "");
|
|
30
|
-
}
|
|
31
|
-
scriptElm.src = url + "/widget-components.js";
|
|
32
|
-
scriptElm.setAttribute("data-stencil-namespace", "widget-components");
|
|
33
|
-
doc.head.appendChild(scriptElm);
|
|
34
|
-
})(document);
|
|
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 =
|
|
6
|
+
window.navigator.userAgent.indexOf("Safari") > 0 &&
|
|
7
|
+
window.navigator.userAgent.indexOf("Version/10") > 0;
|
|
8
|
+
var scriptElm = Array.from(doc.scripts).find((script) =>
|
|
9
|
+
script.src.includes("widget-components")
|
|
10
|
+
);
|
|
11
|
+
|
|
12
|
+
var parts = scriptElm.src.split("/");
|
|
13
|
+
parts.pop();
|
|
14
|
+
var url = parts.join("/");
|
|
15
|
+
|
|
16
|
+
// NOTE(johan): Safari 10 supports type="module" but the build is too new for it, so we only want the ES5 build but
|
|
17
|
+
// without the "nomodule" attribute
|
|
18
|
+
// This may not be necessary in Stencil 1.8.x - https://github.com/ionic-team/stencil/issues/1900
|
|
19
|
+
if (!isSafari10) {
|
|
20
|
+
var scriptElm = doc.createElement("script");
|
|
21
|
+
scriptElm.setAttribute("type", "module");
|
|
22
|
+
scriptElm.src = url + "/widget-components.esm.js";
|
|
23
|
+
scriptElm.setAttribute("data-stencil-namespace", "widget-components");
|
|
24
|
+
doc.head.appendChild(scriptElm);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
var scriptElm = doc.createElement("script");
|
|
28
|
+
if (!isSafari10) {
|
|
29
|
+
scriptElm.setAttribute("nomodule", "");
|
|
30
|
+
}
|
|
31
|
+
scriptElm.src = url + "/widget-components.js";
|
|
32
|
+
scriptElm.setAttribute("data-stencil-namespace", "widget-components");
|
|
33
|
+
doc.head.appendChild(scriptElm);
|
|
34
|
+
})(document);
|