@saasquatch/vanilla-components 1.4.2-1 → 1.4.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.
- package/dist/cjs/{WidgetHost-7c65e2c5.js → WidgetHost-71b013eb.js} +2 -2
- package/dist/cjs/sqh-close-button.cjs.entry.js +1 -1
- package/dist/cjs/sqh-copy-button_12.cjs.entry.js +14 -4
- package/dist/cjs/sqh-referral-code.cjs.entry.js +1 -1
- package/dist/collection/components/text-component/text-component.js +4 -4
- package/dist/collection/services/WidgetHost.js +2 -2
- package/dist/collection/utilities.js +12 -1
- package/dist/esm/{WidgetHost-b09e0d27.js → WidgetHost-9c337319.js} +2 -2
- package/dist/esm/sqh-close-button.entry.js +1 -1
- package/dist/esm/sqh-copy-button_12.entry.js +14 -4
- package/dist/esm/sqh-referral-code.entry.js +1 -1
- package/dist/esm-es5/{WidgetHost-b09e0d27.js → WidgetHost-9c337319.js} +2 -2
- package/dist/esm-es5/sqh-close-button.entry.js +1 -1
- package/dist/esm-es5/sqh-copy-button_12.entry.js +14 -4
- package/dist/esm-es5/sqh-referral-code.entry.js +1 -1
- package/dist/types/utilities.d.ts +10 -1
- package/dist/widget-components/{p-c1c81a3b.entry.js → p-366f1663.entry.js} +1 -1
- package/dist/widget-components/p-42a27560.system.entry.js +8 -0
- package/dist/widget-components/{p-d6bde96f.entry.js → p-54ea7a00.entry.js} +1 -1
- package/dist/widget-components/p-58be1132.system.js +1 -1
- package/dist/widget-components/{p-37fd6e72.system.js → p-8e232564.system.js} +1 -1
- package/dist/widget-components/{p-1a19f961.system.entry.js → p-b17efca4.system.entry.js} +1 -1
- package/dist/widget-components/{p-e1d2fd8f.system.entry.js → p-c8bc8c77.system.entry.js} +1 -1
- package/dist/widget-components/{p-7c848114.entry.js → p-e36f72cb.entry.js} +3 -3
- package/dist/widget-components/{p-5f2ae286.js → p-edd43dbc.js} +2 -2
- package/dist/widget-components/widget-components.esm.js +1 -1
- package/docs/raisins.json +1 -1
- package/package.json +20 -29
- package/dist/widget-components/p-2e323fe9.system.entry.js +0 -8
|
@@ -10226,7 +10226,7 @@ const API = {
|
|
|
10226
10226
|
$userId: String!
|
|
10227
10227
|
$accountId: String!
|
|
10228
10228
|
$programId: ID
|
|
10229
|
-
$engagementMedium: UserEngagementMedium
|
|
10229
|
+
$engagementMedium: UserEngagementMedium!
|
|
10230
10230
|
) {
|
|
10231
10231
|
user(id: $userId, accountId: $accountId) {
|
|
10232
10232
|
shareLink(
|
|
@@ -10505,7 +10505,7 @@ const API = {
|
|
|
10505
10505
|
return this.getClient()
|
|
10506
10506
|
.query({
|
|
10507
10507
|
query: src `
|
|
10508
|
-
query($userId: String!, $accountId: String!, $programId: ID, $engagementMedium: UserEngagementMedium) {
|
|
10508
|
+
query($userId: String!, $accountId: String!, $programId: ID, $engagementMedium: UserEngagementMedium!) {
|
|
10509
10509
|
user(id: $userId, accountId: $accountId) {
|
|
10510
10510
|
${mediums[0]}:messageLink(programId: $programId, engagementMedium: $engagementMedium, shareMedium: ${mediums[0]})
|
|
10511
10511
|
${mediums[1]}:messageLink(programId: $programId, engagementMedium: $engagementMedium, shareMedium: ${mediums[1]})
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
const index = require('./index-deb40352.js');
|
|
6
6
|
require('./_commonjsHelpers-ac2d0785.js');
|
|
7
|
-
const WidgetHost = require('./WidgetHost-
|
|
7
|
+
const WidgetHost = require('./WidgetHost-71b013eb.js');
|
|
8
8
|
|
|
9
9
|
const closeButtonCss = "sqh-close-button .squatch-header-close{position:absolute;top:4px;right:6px;background:transparent;border:0;color:#4486e1;font-size:12px}sqh-close-button .squatch-header-close:hover{text-decoration:underline}";
|
|
10
10
|
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
const index = require('./index-deb40352.js');
|
|
6
6
|
const _commonjsHelpers = require('./_commonjsHelpers-ac2d0785.js');
|
|
7
|
-
const WidgetHost = require('./WidgetHost-
|
|
7
|
+
const WidgetHost = require('./WidgetHost-71b013eb.js');
|
|
8
8
|
|
|
9
9
|
/////////////////////////////////////
|
|
10
10
|
////// ////
|
|
@@ -86,6 +86,17 @@ const uuid = function b(a = undefined) {
|
|
|
86
86
|
? (a ^ ((Math.random() * 16) >> (a / 4))).toString(16)
|
|
87
87
|
: ([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, b);
|
|
88
88
|
};
|
|
89
|
+
/**
|
|
90
|
+
* Decides whether a background value should be treated as an image URL
|
|
91
|
+
* (as opposed to a CSS color). The check is anchored to the start of the
|
|
92
|
+
* value and runs in linear time: an unanchored pattern would rescan the
|
|
93
|
+
* remaining suffix at every word boundary, freezing the widget on long
|
|
94
|
+
* non-URL values (e.g. "a.".repeat(32000) + "!") since it runs
|
|
95
|
+
* synchronously in render(). Embedded URLs are intentionally unsupported.
|
|
96
|
+
*/
|
|
97
|
+
const isUrl = (value) => {
|
|
98
|
+
return /^(?:[a-z][\w-]+:(?:\/{1,3}|[a-z0-9%])|(?:\/\/)?(?:www\d{0,3}\.|[a-z0-9-]+(?:\.[a-z0-9-]+)*\.[a-z]{2,4}\/))/i.test(value.trim());
|
|
99
|
+
};
|
|
89
100
|
|
|
90
101
|
/*
|
|
91
102
|
|
|
@@ -10482,7 +10493,6 @@ const TextComponent = class {
|
|
|
10482
10493
|
index.registerInstance(this, hostRef);
|
|
10483
10494
|
}
|
|
10484
10495
|
render() {
|
|
10485
|
-
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;
|
|
10486
10496
|
const textStyle = css `
|
|
10487
10497
|
font-family: ${this.fontfamily || "inherit"};
|
|
10488
10498
|
font-size: ${this.fontsize ? this.fontsize + "px" : "inherit"};
|
|
@@ -10497,14 +10507,14 @@ const TextComponent = class {
|
|
|
10497
10507
|
`;
|
|
10498
10508
|
const divStyle = css `
|
|
10499
10509
|
background: ${this.background
|
|
10500
|
-
? this.background
|
|
10510
|
+
? isUrl(this.background)
|
|
10501
10511
|
? `url(${this.background}) no-repeat center center;`
|
|
10502
10512
|
: this.background
|
|
10503
10513
|
: "inherit"};
|
|
10504
10514
|
height: ${this.height || "inherit"};
|
|
10505
10515
|
background-size: contain;
|
|
10506
10516
|
`;
|
|
10507
|
-
const content = this.ismarkdown ? (index.h("div", { innerHTML: marked(this.text) })) : (this.text);
|
|
10517
|
+
const content = this.ismarkdown ? (index.h("div", { innerHTML: marked.marked.parse(this.text) })) : (this.text);
|
|
10508
10518
|
return (!this.ishidden && (index.h("div", { class: divStyle }, index.h("p", { class: textStyle }, content))));
|
|
10509
10519
|
}
|
|
10510
10520
|
get textEl() { return index.getElement(this); }
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
const index = require('./index-deb40352.js');
|
|
6
6
|
require('./_commonjsHelpers-ac2d0785.js');
|
|
7
|
-
const WidgetHost = require('./WidgetHost-
|
|
7
|
+
const WidgetHost = require('./WidgetHost-71b013eb.js');
|
|
8
8
|
|
|
9
9
|
const referralCodeCss = "sqh-referral-code{display:inline}sqh-referral-code span{font-family:inherit;font-size:inherit;color:inherit;overflow-wrap:break-word}";
|
|
10
10
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { h, Component, Prop, Element } from "@stencil/core";
|
|
2
2
|
import { css } from "emotion";
|
|
3
|
-
import marked from "marked";
|
|
3
|
+
import { marked } from "marked";
|
|
4
|
+
import { isUrl } from "../../utilities";
|
|
4
5
|
/**
|
|
5
6
|
* @uiName Text Component
|
|
6
7
|
* @canvasRenderer always-replace
|
|
@@ -10,7 +11,6 @@ import marked from "marked";
|
|
|
10
11
|
*/
|
|
11
12
|
export class TextComponent {
|
|
12
13
|
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
14
|
const textStyle = css `
|
|
15
15
|
font-family: ${this.fontfamily || "inherit"};
|
|
16
16
|
font-size: ${this.fontsize ? this.fontsize + "px" : "inherit"};
|
|
@@ -25,14 +25,14 @@ export class TextComponent {
|
|
|
25
25
|
`;
|
|
26
26
|
const divStyle = css `
|
|
27
27
|
background: ${this.background
|
|
28
|
-
? this.background
|
|
28
|
+
? isUrl(this.background)
|
|
29
29
|
? `url(${this.background}) no-repeat center center;`
|
|
30
30
|
: this.background
|
|
31
31
|
: "inherit"};
|
|
32
32
|
height: ${this.height || "inherit"};
|
|
33
33
|
background-size: contain;
|
|
34
34
|
`;
|
|
35
|
-
const content = this.ismarkdown ? (h("div", { innerHTML: marked(this.text) })) : (this.text);
|
|
35
|
+
const content = this.ismarkdown ? (h("div", { innerHTML: marked.parse(this.text) })) : (this.text);
|
|
36
36
|
return (!this.ishidden && (h("div", { class: divStyle },
|
|
37
37
|
h("p", { class: textStyle }, content))));
|
|
38
38
|
}
|
|
@@ -318,7 +318,7 @@ const API = {
|
|
|
318
318
|
$userId: String!
|
|
319
319
|
$accountId: String!
|
|
320
320
|
$programId: ID
|
|
321
|
-
$engagementMedium: UserEngagementMedium
|
|
321
|
+
$engagementMedium: UserEngagementMedium!
|
|
322
322
|
) {
|
|
323
323
|
user(id: $userId, accountId: $accountId) {
|
|
324
324
|
shareLink(
|
|
@@ -597,7 +597,7 @@ const API = {
|
|
|
597
597
|
return this.getClient()
|
|
598
598
|
.query({
|
|
599
599
|
query: gql `
|
|
600
|
-
query($userId: String!, $accountId: String!, $programId: ID, $engagementMedium: UserEngagementMedium) {
|
|
600
|
+
query($userId: String!, $accountId: String!, $programId: ID, $engagementMedium: UserEngagementMedium!) {
|
|
601
601
|
user(id: $userId, accountId: $accountId) {
|
|
602
602
|
${mediums[0]}:messageLink(programId: $programId, engagementMedium: $engagementMedium, shareMedium: ${mediums[0]})
|
|
603
603
|
${mediums[1]}:messageLink(programId: $programId, engagementMedium: $engagementMedium, shareMedium: ${mediums[1]})
|
|
@@ -78,4 +78,15 @@ const uuid = function b(a = undefined) {
|
|
|
78
78
|
? (a ^ ((Math.random() * 16) >> (a / 4))).toString(16)
|
|
79
79
|
: ([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, b);
|
|
80
80
|
};
|
|
81
|
-
|
|
81
|
+
/**
|
|
82
|
+
* Decides whether a background value should be treated as an image URL
|
|
83
|
+
* (as opposed to a CSS color). The check is anchored to the start of the
|
|
84
|
+
* value and runs in linear time: an unanchored pattern would rescan the
|
|
85
|
+
* remaining suffix at every word boundary, freezing the widget on long
|
|
86
|
+
* non-URL values (e.g. "a.".repeat(32000) + "!") since it runs
|
|
87
|
+
* synchronously in render(). Embedded URLs are intentionally unsupported.
|
|
88
|
+
*/
|
|
89
|
+
const isUrl = (value) => {
|
|
90
|
+
return /^(?:[a-z][\w-]+:(?:\/{1,3}|[a-z0-9%])|(?:\/\/)?(?:www\d{0,3}\.|[a-z0-9-]+(?:\.[a-z0-9-]+)*\.[a-z]{2,4}\/))/i.test(value.trim());
|
|
91
|
+
};
|
|
92
|
+
export { shadeColor, addClass, removeClass, detectMobileSafari, detectMobileChrome, uuid, isUrl, };
|
|
@@ -10224,7 +10224,7 @@ const API = {
|
|
|
10224
10224
|
$userId: String!
|
|
10225
10225
|
$accountId: String!
|
|
10226
10226
|
$programId: ID
|
|
10227
|
-
$engagementMedium: UserEngagementMedium
|
|
10227
|
+
$engagementMedium: UserEngagementMedium!
|
|
10228
10228
|
) {
|
|
10229
10229
|
user(id: $userId, accountId: $accountId) {
|
|
10230
10230
|
shareLink(
|
|
@@ -10503,7 +10503,7 @@ const API = {
|
|
|
10503
10503
|
return this.getClient()
|
|
10504
10504
|
.query({
|
|
10505
10505
|
query: src `
|
|
10506
|
-
query($userId: String!, $accountId: String!, $programId: ID, $engagementMedium: UserEngagementMedium) {
|
|
10506
|
+
query($userId: String!, $accountId: String!, $programId: ID, $engagementMedium: UserEngagementMedium!) {
|
|
10507
10507
|
user(id: $userId, accountId: $accountId) {
|
|
10508
10508
|
${mediums[0]}:messageLink(programId: $programId, engagementMedium: $engagementMedium, shareMedium: ${mediums[0]})
|
|
10509
10509
|
${mediums[1]}:messageLink(programId: $programId, engagementMedium: $engagementMedium, shareMedium: ${mediums[1]})
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { r as registerInstance, h, g as getElement } from './index-8ea8b6d8.js';
|
|
2
2
|
import './_commonjsHelpers-1d681858.js';
|
|
3
|
-
import { A as API, w as widgetIdent } from './WidgetHost-
|
|
3
|
+
import { A as API, w as widgetIdent } from './WidgetHost-9c337319.js';
|
|
4
4
|
|
|
5
5
|
const closeButtonCss = "sqh-close-button .squatch-header-close{position:absolute;top:4px;right:6px;background:transparent;border:0;color:#4486e1;font-size:12px}sqh-close-button .squatch-header-close:hover{text-decoration:underline}";
|
|
6
6
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { r as registerInstance, h, c as createEvent, g as getElement } from './index-8ea8b6d8.js';
|
|
2
2
|
import { c as createCommonjsModule, a as commonjsGlobal, u as unwrapExports } from './_commonjsHelpers-1d681858.js';
|
|
3
|
-
import { A as API } from './WidgetHost-
|
|
3
|
+
import { A as API } from './WidgetHost-9c337319.js';
|
|
4
4
|
|
|
5
5
|
/////////////////////////////////////
|
|
6
6
|
////// ////
|
|
@@ -82,6 +82,17 @@ const uuid = function b(a = undefined) {
|
|
|
82
82
|
? (a ^ ((Math.random() * 16) >> (a / 4))).toString(16)
|
|
83
83
|
: ([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, b);
|
|
84
84
|
};
|
|
85
|
+
/**
|
|
86
|
+
* Decides whether a background value should be treated as an image URL
|
|
87
|
+
* (as opposed to a CSS color). The check is anchored to the start of the
|
|
88
|
+
* value and runs in linear time: an unanchored pattern would rescan the
|
|
89
|
+
* remaining suffix at every word boundary, freezing the widget on long
|
|
90
|
+
* non-URL values (e.g. "a.".repeat(32000) + "!") since it runs
|
|
91
|
+
* synchronously in render(). Embedded URLs are intentionally unsupported.
|
|
92
|
+
*/
|
|
93
|
+
const isUrl = (value) => {
|
|
94
|
+
return /^(?:[a-z][\w-]+:(?:\/{1,3}|[a-z0-9%])|(?:\/\/)?(?:www\d{0,3}\.|[a-z0-9-]+(?:\.[a-z0-9-]+)*\.[a-z]{2,4}\/))/i.test(value.trim());
|
|
95
|
+
};
|
|
85
96
|
|
|
86
97
|
/*
|
|
87
98
|
|
|
@@ -10478,7 +10489,6 @@ const TextComponent = class {
|
|
|
10478
10489
|
registerInstance(this, hostRef);
|
|
10479
10490
|
}
|
|
10480
10491
|
render() {
|
|
10481
|
-
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;
|
|
10482
10492
|
const textStyle = css `
|
|
10483
10493
|
font-family: ${this.fontfamily || "inherit"};
|
|
10484
10494
|
font-size: ${this.fontsize ? this.fontsize + "px" : "inherit"};
|
|
@@ -10493,14 +10503,14 @@ const TextComponent = class {
|
|
|
10493
10503
|
`;
|
|
10494
10504
|
const divStyle = css `
|
|
10495
10505
|
background: ${this.background
|
|
10496
|
-
? this.background
|
|
10506
|
+
? isUrl(this.background)
|
|
10497
10507
|
? `url(${this.background}) no-repeat center center;`
|
|
10498
10508
|
: this.background
|
|
10499
10509
|
: "inherit"};
|
|
10500
10510
|
height: ${this.height || "inherit"};
|
|
10501
10511
|
background-size: contain;
|
|
10502
10512
|
`;
|
|
10503
|
-
const content = this.ismarkdown ? (h("div", { innerHTML: marked(this.text) })) : (this.text);
|
|
10513
|
+
const content = this.ismarkdown ? (h("div", { innerHTML: marked.marked.parse(this.text) })) : (this.text);
|
|
10504
10514
|
return (!this.ishidden && (h("div", { class: divStyle }, h("p", { class: textStyle }, content))));
|
|
10505
10515
|
}
|
|
10506
10516
|
get textEl() { return getElement(this); }
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { r as registerInstance, h } from './index-8ea8b6d8.js';
|
|
2
2
|
import './_commonjsHelpers-1d681858.js';
|
|
3
|
-
import { A as API } from './WidgetHost-
|
|
3
|
+
import { A as API } from './WidgetHost-9c337319.js';
|
|
4
4
|
|
|
5
5
|
const referralCodeCss = "sqh-referral-code{display:inline}sqh-referral-code span{font-family:inherit;font-size:inherit;color:inherit;overflow-wrap:break-word}";
|
|
6
6
|
|
|
@@ -9291,7 +9291,7 @@ var API = {
|
|
|
9291
9291
|
};
|
|
9292
9292
|
return this.getClient()
|
|
9293
9293
|
.query({
|
|
9294
|
-
query: src(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n query (\n $userId: String!\n $accountId: String!\n $programId: ID\n $engagementMedium: UserEngagementMedium
|
|
9294
|
+
query: src(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n query (\n $userId: String!\n $accountId: String!\n $programId: ID\n $engagementMedium: UserEngagementMedium!\n ) {\n user(id: $userId, accountId: $accountId) {\n shareLink(\n programId: $programId\n engagementMedium: $engagementMedium\n shareMedium: DIRECT\n useCleanLink: true\n )\n }\n }\n "], ["\n query (\n $userId: String!\n $accountId: String!\n $programId: ID\n $engagementMedium: UserEngagementMedium!\n ) {\n user(id: $userId, accountId: $accountId) {\n shareLink(\n programId: $programId\n engagementMedium: $engagementMedium\n shareMedium: DIRECT\n useCleanLink: true\n )\n }\n }\n "]))),
|
|
9295
9295
|
variables: variables,
|
|
9296
9296
|
})
|
|
9297
9297
|
.then(function (res) { return res.data.user.shareLink; });
|
|
@@ -9420,7 +9420,7 @@ var API = {
|
|
|
9420
9420
|
};
|
|
9421
9421
|
return this.getClient()
|
|
9422
9422
|
.query({
|
|
9423
|
-
query: src(templateObject_9 || (templateObject_9 = __makeTemplateObject(["\n query($userId: String!, $accountId: String!, $programId: ID, $engagementMedium: UserEngagementMedium) {\n user(id: $userId, accountId: $accountId) {\n ", ":messageLink(programId: $programId, engagementMedium: $engagementMedium, shareMedium: ", ")\n ", ":messageLink(programId: $programId, engagementMedium: $engagementMedium, shareMedium: ", ")\n ", ":messageLink(programId: $programId, engagementMedium: $engagementMedium, shareMedium: ", ")\n ", ":messageLink(programId: $programId, engagementMedium: $engagementMedium, shareMedium: ", ")\n ", ":messageLink(programId: $programId, engagementMedium: $engagementMedium, shareMedium: ", ")\n ", ":messageLink(programId: $programId, engagementMedium: $engagementMedium, shareMedium: ", ")\n ", ":messageLink(programId: $programId, engagementMedium: $engagementMedium, shareMedium: ", ")\n ", ":messageLink(programId: $programId, engagementMedium: $engagementMedium, shareMedium: ", ")\n ", ":messageLink(programId: $programId, engagementMedium: $engagementMedium, shareMedium: ", ")\n }\n }\n "], ["\n query($userId: String!, $accountId: String!, $programId: ID, $engagementMedium: UserEngagementMedium) {\n user(id: $userId, accountId: $accountId) {\n ", ":messageLink(programId: $programId, engagementMedium: $engagementMedium, shareMedium: ", ")\n ", ":messageLink(programId: $programId, engagementMedium: $engagementMedium, shareMedium: ", ")\n ", ":messageLink(programId: $programId, engagementMedium: $engagementMedium, shareMedium: ", ")\n ", ":messageLink(programId: $programId, engagementMedium: $engagementMedium, shareMedium: ", ")\n ", ":messageLink(programId: $programId, engagementMedium: $engagementMedium, shareMedium: ", ")\n ", ":messageLink(programId: $programId, engagementMedium: $engagementMedium, shareMedium: ", ")\n ", ":messageLink(programId: $programId, engagementMedium: $engagementMedium, shareMedium: ", ")\n ", ":messageLink(programId: $programId, engagementMedium: $engagementMedium, shareMedium: ", ")\n ", ":messageLink(programId: $programId, engagementMedium: $engagementMedium, shareMedium: ", ")\n }\n }\n "])), mediums[0], mediums[0], mediums[1], mediums[1], mediums[2], mediums[2], mediums[3], mediums[3], mediums[4], mediums[4], mediums[5], mediums[5], mediums[6], mediums[6], mediums[7], mediums[7], mediums[8], mediums[8]),
|
|
9423
|
+
query: src(templateObject_9 || (templateObject_9 = __makeTemplateObject(["\n query($userId: String!, $accountId: String!, $programId: ID, $engagementMedium: UserEngagementMedium!) {\n user(id: $userId, accountId: $accountId) {\n ", ":messageLink(programId: $programId, engagementMedium: $engagementMedium, shareMedium: ", ")\n ", ":messageLink(programId: $programId, engagementMedium: $engagementMedium, shareMedium: ", ")\n ", ":messageLink(programId: $programId, engagementMedium: $engagementMedium, shareMedium: ", ")\n ", ":messageLink(programId: $programId, engagementMedium: $engagementMedium, shareMedium: ", ")\n ", ":messageLink(programId: $programId, engagementMedium: $engagementMedium, shareMedium: ", ")\n ", ":messageLink(programId: $programId, engagementMedium: $engagementMedium, shareMedium: ", ")\n ", ":messageLink(programId: $programId, engagementMedium: $engagementMedium, shareMedium: ", ")\n ", ":messageLink(programId: $programId, engagementMedium: $engagementMedium, shareMedium: ", ")\n ", ":messageLink(programId: $programId, engagementMedium: $engagementMedium, shareMedium: ", ")\n }\n }\n "], ["\n query($userId: String!, $accountId: String!, $programId: ID, $engagementMedium: UserEngagementMedium!) {\n user(id: $userId, accountId: $accountId) {\n ", ":messageLink(programId: $programId, engagementMedium: $engagementMedium, shareMedium: ", ")\n ", ":messageLink(programId: $programId, engagementMedium: $engagementMedium, shareMedium: ", ")\n ", ":messageLink(programId: $programId, engagementMedium: $engagementMedium, shareMedium: ", ")\n ", ":messageLink(programId: $programId, engagementMedium: $engagementMedium, shareMedium: ", ")\n ", ":messageLink(programId: $programId, engagementMedium: $engagementMedium, shareMedium: ", ")\n ", ":messageLink(programId: $programId, engagementMedium: $engagementMedium, shareMedium: ", ")\n ", ":messageLink(programId: $programId, engagementMedium: $engagementMedium, shareMedium: ", ")\n ", ":messageLink(programId: $programId, engagementMedium: $engagementMedium, shareMedium: ", ")\n ", ":messageLink(programId: $programId, engagementMedium: $engagementMedium, shareMedium: ", ")\n }\n }\n "])), mediums[0], mediums[0], mediums[1], mediums[1], mediums[2], mediums[2], mediums[3], mediums[3], mediums[4], mediums[4], mediums[5], mediums[5], mediums[6], mediums[6], mediums[7], mediums[7], mediums[8], mediums[8]),
|
|
9424
9424
|
variables: variables,
|
|
9425
9425
|
})
|
|
9426
9426
|
.then(function (res) { return res.data.user; });
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { r as registerInstance, h, g as getElement } from './index-8ea8b6d8.js';
|
|
2
2
|
import './_commonjsHelpers-1d681858.js';
|
|
3
|
-
import { A as API, w as widgetIdent } from './WidgetHost-
|
|
3
|
+
import { A as API, w as widgetIdent } from './WidgetHost-9c337319.js';
|
|
4
4
|
var closeButtonCss = "sqh-close-button .squatch-header-close{position:absolute;top:4px;right:6px;background:transparent;border:0;color:#4486e1;font-size:12px}sqh-close-button .squatch-header-close:hover{text-decoration:underline}";
|
|
5
5
|
var CloseButton = /** @class */ (function () {
|
|
6
6
|
function CloseButton(hostRef) {
|
|
@@ -4,7 +4,7 @@ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cook
|
|
|
4
4
|
};
|
|
5
5
|
import { r as registerInstance, h, c as createEvent, g as getElement } from './index-8ea8b6d8.js';
|
|
6
6
|
import { c as createCommonjsModule, a as commonjsGlobal, u as unwrapExports } from './_commonjsHelpers-1d681858.js';
|
|
7
|
-
import { A as API } from './WidgetHost-
|
|
7
|
+
import { A as API } from './WidgetHost-9c337319.js';
|
|
8
8
|
/////////////////////////////////////
|
|
9
9
|
////// ////
|
|
10
10
|
///// Color Utility Functions /////
|
|
@@ -86,6 +86,17 @@ var uuid = function b(a) {
|
|
|
86
86
|
? (a ^ ((Math.random() * 16) >> (a / 4))).toString(16)
|
|
87
87
|
: ([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, b);
|
|
88
88
|
};
|
|
89
|
+
/**
|
|
90
|
+
* Decides whether a background value should be treated as an image URL
|
|
91
|
+
* (as opposed to a CSS color). The check is anchored to the start of the
|
|
92
|
+
* value and runs in linear time: an unanchored pattern would rescan the
|
|
93
|
+
* remaining suffix at every word boundary, freezing the widget on long
|
|
94
|
+
* non-URL values (e.g. "a.".repeat(32000) + "!") since it runs
|
|
95
|
+
* synchronously in render(). Embedded URLs are intentionally unsupported.
|
|
96
|
+
*/
|
|
97
|
+
var isUrl = function (value) {
|
|
98
|
+
return /^(?:[a-z][\w-]+:(?:\/{1,3}|[a-z0-9%])|(?:\/\/)?(?:www\d{0,3}\.|[a-z0-9-]+(?:\.[a-z0-9-]+)*\.[a-z]{2,4}\/))/i.test(value.trim());
|
|
99
|
+
};
|
|
89
100
|
/*
|
|
90
101
|
|
|
91
102
|
Based off glamor's StyleSheet, thanks Sunil ❤️
|
|
@@ -9509,18 +9520,17 @@ var TextComponent = /** @class */ (function () {
|
|
|
9509
9520
|
registerInstance(this, hostRef);
|
|
9510
9521
|
}
|
|
9511
9522
|
TextComponent.prototype.render = function () {
|
|
9512
|
-
var 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;
|
|
9513
9523
|
var textStyle = css(templateObject_13 || (templateObject_13 = __makeTemplateObject(["\n font-family: ", ";\n font-size: ", ";\n font-weight: ", ";\n text-align: ", ";\n color: ", ";\n padding-top: ", ";\n padding-bottom: ", ";\n overflow-wrap: break-word;\n "], ["\n font-family: ", ";\n font-size: ", ";\n font-weight: ", ";\n text-align: ", ";\n color: ", ";\n padding-top: ", ";\n padding-bottom: ",
|
|
9514
9524
|
";\n overflow-wrap: break-word;\n "])), this.fontfamily || "inherit", this.fontsize ? this.fontsize + "px" : "inherit", this.fontweight ? this.fontweight : "inherit", this.textalign, this.color || "inherit", this.paddingtop ? this.paddingtop + "px" : "inherit", this.paddingbottom
|
|
9515
9525
|
? this.paddingbottom + "px"
|
|
9516
9526
|
: "inherit");
|
|
9517
9527
|
var divStyle = css(templateObject_14 || (templateObject_14 = __makeTemplateObject(["\n background: ", ";\n height: ", ";\n background-size: contain;\n "], ["\n background: ",
|
|
9518
9528
|
";\n height: ", ";\n background-size: contain;\n "])), this.background
|
|
9519
|
-
? this.background
|
|
9529
|
+
? isUrl(this.background)
|
|
9520
9530
|
? "url(" + this.background + ") no-repeat center center;"
|
|
9521
9531
|
: this.background
|
|
9522
9532
|
: "inherit", this.height || "inherit");
|
|
9523
|
-
var content = this.ismarkdown ? (h("div", { innerHTML: marked(this.text) })) : (this.text);
|
|
9533
|
+
var content = this.ismarkdown ? (h("div", { innerHTML: marked.marked.parse(this.text) })) : (this.text);
|
|
9524
9534
|
return (!this.ishidden && (h("div", { class: divStyle }, h("p", { class: textStyle }, content))));
|
|
9525
9535
|
};
|
|
9526
9536
|
Object.defineProperty(TextComponent.prototype, "textEl", {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { r as registerInstance, h } from './index-8ea8b6d8.js';
|
|
2
2
|
import './_commonjsHelpers-1d681858.js';
|
|
3
|
-
import { A as API } from './WidgetHost-
|
|
3
|
+
import { A as API } from './WidgetHost-9c337319.js';
|
|
4
4
|
var referralCodeCss = "sqh-referral-code{display:inline}sqh-referral-code span{font-family:inherit;font-size:inherit;color:inherit;overflow-wrap:break-word}";
|
|
5
5
|
var ReferralCode = /** @class */ (function () {
|
|
6
6
|
function ReferralCode(hostRef) {
|
|
@@ -4,4 +4,13 @@ declare const removeClass: (el: any, className: any) => void;
|
|
|
4
4
|
declare const detectMobileSafari: () => boolean;
|
|
5
5
|
declare const detectMobileChrome: () => RegExpMatchArray;
|
|
6
6
|
declare const uuid: (a?: any) => any;
|
|
7
|
-
|
|
7
|
+
/**
|
|
8
|
+
* Decides whether a background value should be treated as an image URL
|
|
9
|
+
* (as opposed to a CSS color). The check is anchored to the start of the
|
|
10
|
+
* value and runs in linear time: an unanchored pattern would rescan the
|
|
11
|
+
* remaining suffix at every word boundary, freezing the widget on long
|
|
12
|
+
* non-URL values (e.g. "a.".repeat(32000) + "!") since it runs
|
|
13
|
+
* synchronously in render(). Embedded URLs are intentionally unsupported.
|
|
14
|
+
*/
|
|
15
|
+
declare const isUrl: (value: string) => boolean;
|
|
16
|
+
export { shadeColor, addClass, removeClass, detectMobileSafari, detectMobileChrome, uuid, isUrl, };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r,h as o}from"./p-485eaf44.js";import"./p-b18ab5ec.js";import{A as e}from"./p-
|
|
1
|
+
import{r,h as o}from"./p-485eaf44.js";import"./p-b18ab5ec.js";import{A as e}from"./p-edd43dbc.js";const s=class{constructor(o){r(this,o)}componentWillLoad(){return e.graphql.getReferralCode().then(r=>{this.referralcode=r}).catch(r=>{this.onError(r)})}onError(r){console.log("Error loading via GraphQL.",r)}render(){return o("span",null,this.referralcode)}};s.style="sqh-referral-code{display:inline}sqh-referral-code span{font-family:inherit;font-size:inherit;color:inherit;overflow-wrap:break-word}";export{s as sqh_referral_code}
|