pollcatch 2.2.2 → 2.2.3
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/package.json +1 -1
- package/pc.js +98 -32
package/package.json
CHANGED
package/pc.js
CHANGED
|
@@ -35,7 +35,7 @@ const Ae = (e) => new le(typeof e == "string" ? e : e + "", void 0, Et), F = (e,
|
|
|
35
35
|
const r = document.createElement("style"), s = it.litNonce;
|
|
36
36
|
s !== void 0 && r.setAttribute("nonce", s), r.textContent = o.cssText, e.appendChild(r);
|
|
37
37
|
}
|
|
38
|
-
},
|
|
38
|
+
}, jt = _t ? (e) => e : (e) => e instanceof CSSStyleSheet ? ((t) => {
|
|
39
39
|
let o = "";
|
|
40
40
|
for (const r of t.cssRules) o += r.cssText;
|
|
41
41
|
return Ae(o);
|
|
@@ -45,7 +45,7 @@ const Ae = (e) => new le(typeof e == "string" ? e : e + "", void 0, Et), F = (e,
|
|
|
45
45
|
* Copyright 2017 Google LLC
|
|
46
46
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
47
47
|
*/
|
|
48
|
-
const { is: Ee, defineProperty: Pe, getOwnPropertyDescriptor: Oe, getOwnPropertyNames: Te, getOwnPropertySymbols: ze, getPrototypeOf: Ie } = Object, T = globalThis,
|
|
48
|
+
const { is: Ee, defineProperty: Pe, getOwnPropertyDescriptor: Oe, getOwnPropertyNames: Te, getOwnPropertySymbols: ze, getPrototypeOf: Ie } = Object, T = globalThis, Ut = T.trustedTypes, Ne = Ut ? Ut.emptyScript : "", bt = T.reactiveElementPolyfillSupport, K = (e, t) => e, at = { toAttribute(e, t) {
|
|
49
49
|
switch (t) {
|
|
50
50
|
case Boolean:
|
|
51
51
|
e = e ? Ne : null;
|
|
@@ -75,7 +75,7 @@ const { is: Ee, defineProperty: Pe, getOwnPropertyDescriptor: Oe, getOwnProperty
|
|
|
75
75
|
return o;
|
|
76
76
|
} }, Pt = (e, t) => !Ee(e, t), Bt = { attribute: !0, type: String, converter: at, reflect: !1, hasChanged: Pt };
|
|
77
77
|
Symbol.metadata ?? (Symbol.metadata = Symbol("metadata")), T.litPropertyMetadata ?? (T.litPropertyMetadata = /* @__PURE__ */ new WeakMap());
|
|
78
|
-
let
|
|
78
|
+
let j = class extends HTMLElement {
|
|
79
79
|
static addInitializer(t) {
|
|
80
80
|
this._$Ei(), (this.l ?? (this.l = [])).push(t);
|
|
81
81
|
}
|
|
@@ -131,8 +131,8 @@ let U = class extends HTMLElement {
|
|
|
131
131
|
const o = [];
|
|
132
132
|
if (Array.isArray(t)) {
|
|
133
133
|
const r = new Set(t.flat(1 / 0).reverse());
|
|
134
|
-
for (const s of r) o.unshift(
|
|
135
|
-
} else t !== void 0 && o.push(
|
|
134
|
+
for (const s of r) o.unshift(jt(s));
|
|
135
|
+
} else t !== void 0 && o.push(jt(t));
|
|
136
136
|
return o;
|
|
137
137
|
}
|
|
138
138
|
static _$Eu(t, o) {
|
|
@@ -273,7 +273,7 @@ let U = class extends HTMLElement {
|
|
|
273
273
|
firstUpdated(t) {
|
|
274
274
|
}
|
|
275
275
|
};
|
|
276
|
-
|
|
276
|
+
j.elementStyles = [], j.shadowRootOptions = { mode: "open" }, j[K("elementProperties")] = /* @__PURE__ */ new Map(), j[K("finalized")] = /* @__PURE__ */ new Map(), bt == null || bt({ ReactiveElement: j }), (T.reactiveElementVersions ?? (T.reactiveElementVersions = [])).push("2.0.4");
|
|
277
277
|
/**
|
|
278
278
|
* @license
|
|
279
279
|
* Copyright 2017 Google LLC
|
|
@@ -286,7 +286,7 @@ function ue(e, t) {
|
|
|
286
286
|
if (!Ot(e) || !e.hasOwnProperty("raw")) throw Error("invalid template strings array");
|
|
287
287
|
return Dt !== void 0 ? Dt.createHTML(t) : t;
|
|
288
288
|
}
|
|
289
|
-
const
|
|
289
|
+
const je = (e, t) => {
|
|
290
290
|
const o = e.length - 1, r = [];
|
|
291
291
|
let s, i = t === 2 ? "<svg>" : t === 3 ? "<math>" : "", a = Z;
|
|
292
292
|
for (let n = 0; n < o; n++) {
|
|
@@ -303,7 +303,7 @@ let At = class he {
|
|
|
303
303
|
let s;
|
|
304
304
|
this.parts = [];
|
|
305
305
|
let i = 0, a = 0;
|
|
306
|
-
const n = t.length - 1, l = this.parts, [p, c] =
|
|
306
|
+
const n = t.length - 1, l = this.parts, [p, c] = je(t, o);
|
|
307
307
|
if (this.el = he.createElement(p, r), M.currentNode = this.el.content, o === 2 || o === 3) {
|
|
308
308
|
const u = this.el.content.firstChild;
|
|
309
309
|
u.replaceWith(...u.childNodes);
|
|
@@ -342,7 +342,7 @@ function D(e, t, o = e, r) {
|
|
|
342
342
|
const i = Q(t) ? void 0 : t._$litDirective$;
|
|
343
343
|
return (s == null ? void 0 : s.constructor) !== i && ((n = s == null ? void 0 : s._$AO) == null || n.call(s, !1), i === void 0 ? s = void 0 : (s = new i(e), s._$AT(e, o, r)), r !== void 0 ? (o._$Co ?? (o._$Co = []))[r] = s : o._$Cl = s), s !== void 0 && (t = D(e, s._$AS(e, t.values), s, r)), t;
|
|
344
344
|
}
|
|
345
|
-
let
|
|
345
|
+
let Ue = class {
|
|
346
346
|
constructor(t, o) {
|
|
347
347
|
this._$AV = [], this._$AN = void 0, this._$AD = t, this._$AM = o;
|
|
348
348
|
}
|
|
@@ -406,7 +406,7 @@ class et {
|
|
|
406
406
|
const { values: o, _$litType$: r } = t, s = typeof r == "number" ? this._$AC(t) : (r.el === void 0 && (r.el = At.createElement(ue(r.h, r.h[0]), this.options)), r);
|
|
407
407
|
if (((i = this._$AH) == null ? void 0 : i._$AD) === s) this._$AH.p(o);
|
|
408
408
|
else {
|
|
409
|
-
const a = new
|
|
409
|
+
const a = new Ue(s, this), n = a.u(this.options);
|
|
410
410
|
a.p(o), this.T(n), this._$AH = a;
|
|
411
411
|
}
|
|
412
412
|
}
|
|
@@ -515,7 +515,7 @@ const He = (e, t, o) => {
|
|
|
515
515
|
* Copyright 2017 Google LLC
|
|
516
516
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
517
517
|
*/
|
|
518
|
-
let
|
|
518
|
+
let U = class extends j {
|
|
519
519
|
constructor() {
|
|
520
520
|
super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0;
|
|
521
521
|
}
|
|
@@ -541,9 +541,9 @@ let j = class extends U {
|
|
|
541
541
|
}
|
|
542
542
|
};
|
|
543
543
|
var ne;
|
|
544
|
-
|
|
544
|
+
U._$litElement$ = !0, U.finalized = !0, (ne = globalThis.litElementHydrateSupport) == null || ne.call(globalThis, { LitElement: U });
|
|
545
545
|
const yt = globalThis.litElementPolyfillSupport;
|
|
546
|
-
yt == null || yt({ LitElement:
|
|
546
|
+
yt == null || yt({ LitElement: U });
|
|
547
547
|
(globalThis.litElementVersions ?? (globalThis.litElementVersions = [])).push("4.1.1");
|
|
548
548
|
/**
|
|
549
549
|
* @license
|
|
@@ -596,7 +596,53 @@ function Tt(e) {
|
|
|
596
596
|
return f({ ...e, state: !0, attribute: !1 });
|
|
597
597
|
}
|
|
598
598
|
var x = /* @__PURE__ */ ((e) => (e.reaction = "reaction", e.stars = "stars", e.poll = "poll", e.text = "text", e.nps = "nps", e))(x || {});
|
|
599
|
-
const Ze =
|
|
599
|
+
const Ze = d`
|
|
600
|
+
<svg
|
|
601
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
602
|
+
height="24px"
|
|
603
|
+
viewBox="0 -960 960 960"
|
|
604
|
+
width="24px"
|
|
605
|
+
fill="currentColor"
|
|
606
|
+
>
|
|
607
|
+
<path d="M640-160v-280h160v280H640Zm-240 0v-640h160v640H400Zm-240 0v-440h160v440H160Z" />
|
|
608
|
+
</svg>
|
|
609
|
+
`, Ge = d`
|
|
610
|
+
<svg
|
|
611
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
612
|
+
height="24px"
|
|
613
|
+
viewBox="0 -960 960 960"
|
|
614
|
+
width="24px"
|
|
615
|
+
fill="currentColor"
|
|
616
|
+
>
|
|
617
|
+
<path
|
|
618
|
+
d="M160-160v-440h160v440H160Zm240 0v-400l160 160v240H400Zm160-354L400-674v-126h160v286Zm240 240L640-434v-6h160v166Zm-9 219L55-791l57-57 736 736-57 57Z"
|
|
619
|
+
/>
|
|
620
|
+
</svg>
|
|
621
|
+
`, Ke = d`
|
|
622
|
+
<svg
|
|
623
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
624
|
+
height="24px"
|
|
625
|
+
viewBox="0 -960 960 960"
|
|
626
|
+
width="24px"
|
|
627
|
+
fill="currentColor"
|
|
628
|
+
>
|
|
629
|
+
<path
|
|
630
|
+
d="M200-200h57l391-391-57-57-391 391v57Zm-80 80v-170l528-527q12-11 26.5-17t30.5-6q16 0 31 6t26 18l55 56q12 11 17.5 26t5.5 30q0 16-5.5 30.5T817-647L290-120H120Zm640-584-56-56 56 56Zm-141 85-28-29 57 57-29-28Z"
|
|
631
|
+
/>
|
|
632
|
+
</svg>
|
|
633
|
+
`, We = d`
|
|
634
|
+
<svg
|
|
635
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
636
|
+
width="16"
|
|
637
|
+
height="16"
|
|
638
|
+
fill="currentColor"
|
|
639
|
+
viewBox="0 0 16 16"
|
|
640
|
+
>
|
|
641
|
+
<path
|
|
642
|
+
d="M4.646 4.646a.5.5 0 0 1 .708 0L8 7.293l2.646-2.647a.5.5 0 0 1 .708.708L8.707 8l2.647 2.646a.5.5 0 0 1-.708.708L8 8.707l-2.646 2.647a.5.5 0 0 1-.708-.708L7.293 8 4.646 5.354a.5.5 0 0 1 0-.708"
|
|
643
|
+
/>
|
|
644
|
+
</svg>
|
|
645
|
+
`;
|
|
600
646
|
var Je = { grad: 0.9, turn: 360, rad: 360 / (2 * Math.PI) }, A = function(e) {
|
|
601
647
|
return typeof e == "string" ? e.length > 0 : typeof e == "number";
|
|
602
648
|
}, $ = function(e, t, o) {
|
|
@@ -1584,7 +1630,7 @@ const st = {
|
|
|
1584
1630
|
mobile: "480px",
|
|
1585
1631
|
tablet: "768px",
|
|
1586
1632
|
desktop: "1024px"
|
|
1587
|
-
}, Rt = class Rt extends
|
|
1633
|
+
}, Rt = class Rt extends U {
|
|
1588
1634
|
constructor() {
|
|
1589
1635
|
super(...arguments), this.dataController = new _o(this), this.displayController = new Eo(this, this.dataController), this.hasEditButton = !0, this.showStats = "never", this.showChart = !1, this.initialized = !1, this.lockAnswer = !1, this.ariaLabel = null, this.minContrast = ge.AA_NORMAL, this.options = [], this.project = "public", this.questionPosition = "top", this.statsText = "{count} votes", this.buttonText = "Submit", this.buttonRadius = "sm", this.multiple = !1, this.readOnly = !1, this.handleEditToggleKeyDown = (t) => {
|
|
1590
1636
|
(t.key === "Enter" || t.key === " ") && (t.preventDefault(), this.handleEnterEditMode());
|
|
@@ -1721,16 +1767,16 @@ const st = {
|
|
|
1721
1767
|
*/
|
|
1722
1768
|
renderEditToggleIcon(t = "edit-toggle-button") {
|
|
1723
1769
|
return this.displayController.shouldShowEditButton() ? d`
|
|
1724
|
-
<
|
|
1725
|
-
src="${Ke}"
|
|
1726
|
-
alt="Edit vote"
|
|
1770
|
+
<span
|
|
1727
1771
|
class="edit-toggle-icon"
|
|
1728
1772
|
data-testid="${t}"
|
|
1729
1773
|
@click="${this.handleEnterEditMode}"
|
|
1730
1774
|
role="button"
|
|
1731
1775
|
tabindex="0"
|
|
1776
|
+
aria-label="Edit vote"
|
|
1732
1777
|
@keydown="${this.handleEditToggleKeyDown}"
|
|
1733
|
-
|
|
1778
|
+
>${Ke}</span
|
|
1779
|
+
>
|
|
1734
1780
|
` : h;
|
|
1735
1781
|
}
|
|
1736
1782
|
renderStatsText() {
|
|
@@ -1740,16 +1786,16 @@ const st = {
|
|
|
1740
1786
|
}
|
|
1741
1787
|
renderChartToggle() {
|
|
1742
1788
|
return this.displayController.shouldShowChartToggle() ? d`
|
|
1743
|
-
<
|
|
1744
|
-
src="${this.displayController.isChartVisible ? Ge : Ze}"
|
|
1745
|
-
alt="${this.displayController.isChartVisible ? "Hide chart" : "Show chart"}"
|
|
1789
|
+
<span
|
|
1746
1790
|
class="chart-toggle-icon"
|
|
1747
1791
|
data-testid="chart-toggle-button"
|
|
1748
1792
|
@click="${() => this.displayController.toggleChartVisibility()}"
|
|
1749
1793
|
role="button"
|
|
1750
1794
|
tabindex="0"
|
|
1795
|
+
aria-label="${this.displayController.isChartVisible ? "Hide chart" : "Show chart"}"
|
|
1751
1796
|
@keydown="${() => this.displayController.toggleChartVisibility()}"
|
|
1752
|
-
|
|
1797
|
+
>${this.displayController.isChartVisible ? Ge : Ze}</span
|
|
1798
|
+
>
|
|
1753
1799
|
` : h;
|
|
1754
1800
|
}
|
|
1755
1801
|
renderStatus() {
|
|
@@ -1781,14 +1827,14 @@ const st = {
|
|
|
1781
1827
|
<div class="pc-thank-you" data-testid="thank-you">
|
|
1782
1828
|
<div class="pc-thank-you-msg" data-testid="thank-you-msg">
|
|
1783
1829
|
${t}
|
|
1784
|
-
<
|
|
1785
|
-
src="${We}"
|
|
1786
|
-
alt="Close"
|
|
1830
|
+
<span
|
|
1787
1831
|
class="thank-you-close-icon"
|
|
1788
1832
|
data-testid="close-thank-you-button"
|
|
1789
1833
|
@click="${() => this.displayController.toggleThankYouVisibility(!1)}"
|
|
1790
1834
|
role="button"
|
|
1791
|
-
|
|
1835
|
+
aria-label="Close"
|
|
1836
|
+
>${We}</span
|
|
1837
|
+
>
|
|
1792
1838
|
</div>
|
|
1793
1839
|
</div>
|
|
1794
1840
|
</div>
|
|
@@ -2369,6 +2415,9 @@ const zo = F`
|
|
|
2369
2415
|
/* Inline chart toggle icon - shared between components */
|
|
2370
2416
|
.chart-toggle-icon,
|
|
2371
2417
|
.edit-toggle-icon {
|
|
2418
|
+
display: inline-flex;
|
|
2419
|
+
align-items: center;
|
|
2420
|
+
justify-content: center;
|
|
2372
2421
|
margin-left: 0.2em;
|
|
2373
2422
|
width: 1.2em;
|
|
2374
2423
|
height: 1.2em;
|
|
@@ -2376,6 +2425,13 @@ const zo = F`
|
|
|
2376
2425
|
cursor: pointer;
|
|
2377
2426
|
transition: opacity 0.2s ease;
|
|
2378
2427
|
vertical-align: middle;
|
|
2428
|
+
color: var(--pc-text-color, var(--default-text-color));
|
|
2429
|
+
}
|
|
2430
|
+
|
|
2431
|
+
.chart-toggle-icon svg,
|
|
2432
|
+
.edit-toggle-icon svg {
|
|
2433
|
+
width: 100%;
|
|
2434
|
+
height: 100%;
|
|
2379
2435
|
}
|
|
2380
2436
|
|
|
2381
2437
|
.chart-toggle-icon:hover,
|
|
@@ -2576,6 +2632,9 @@ const zo = F`
|
|
|
2576
2632
|
}
|
|
2577
2633
|
|
|
2578
2634
|
.thank-you-close-icon {
|
|
2635
|
+
display: inline-flex;
|
|
2636
|
+
align-items: center;
|
|
2637
|
+
justify-content: center;
|
|
2579
2638
|
width: 1.2em;
|
|
2580
2639
|
height: 1.2em;
|
|
2581
2640
|
cursor: pointer;
|
|
@@ -2583,6 +2642,13 @@ const zo = F`
|
|
|
2583
2642
|
position: absolute;
|
|
2584
2643
|
top: 0.2em;
|
|
2585
2644
|
right: 0.2em;
|
|
2645
|
+
color: var(--pc-text-color, var(--default-text-color));
|
|
2646
|
+
opacity: 0.6;
|
|
2647
|
+
}
|
|
2648
|
+
|
|
2649
|
+
.thank-you-close-icon svg {
|
|
2650
|
+
width: 100%;
|
|
2651
|
+
height: 100%;
|
|
2586
2652
|
}
|
|
2587
2653
|
|
|
2588
2654
|
.thank-you-close-icon:hover {
|
|
@@ -3330,7 +3396,7 @@ Mt([
|
|
|
3330
3396
|
tt = Mt([
|
|
3331
3397
|
ot("pc-poll")
|
|
3332
3398
|
], tt);
|
|
3333
|
-
const
|
|
3399
|
+
const jo = F`
|
|
3334
3400
|
/* CSS variables inherit from parent - defaults are specified at usage sites */
|
|
3335
3401
|
|
|
3336
3402
|
.pc-section {
|
|
@@ -3423,7 +3489,7 @@ const Uo = F`
|
|
|
3423
3489
|
* Copyright 2018 Google LLC
|
|
3424
3490
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
3425
3491
|
*/
|
|
3426
|
-
const ke = "important",
|
|
3492
|
+
const ke = "important", Uo = " !" + ke, Bo = Se(class extends Ce {
|
|
3427
3493
|
constructor(e) {
|
|
3428
3494
|
var t;
|
|
3429
3495
|
if (super(e), e.type !== xe.ATTRIBUTE || e.name !== "style" || ((t = e.strings) == null ? void 0 : t.length) > 2) throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.");
|
|
@@ -3442,7 +3508,7 @@ const ke = "important", jo = " !" + ke, Bo = Se(class extends Ce {
|
|
|
3442
3508
|
const s = t[r];
|
|
3443
3509
|
if (s != null) {
|
|
3444
3510
|
this.ft.add(r);
|
|
3445
|
-
const i = typeof s == "string" && s.endsWith(
|
|
3511
|
+
const i = typeof s == "string" && s.endsWith(Uo);
|
|
3446
3512
|
r.includes("-") || i ? o.setProperty(r, i ? s.slice(0, -11) : s, i ? ke : "") : o[r] = s;
|
|
3447
3513
|
}
|
|
3448
3514
|
}
|
|
@@ -3714,7 +3780,7 @@ let V = class extends m {
|
|
|
3714
3780
|
`;
|
|
3715
3781
|
}
|
|
3716
3782
|
};
|
|
3717
|
-
V.styles = [...m.styles, ut,
|
|
3783
|
+
V.styles = [...m.styles, ut, jo];
|
|
3718
3784
|
ht([
|
|
3719
3785
|
f({ type: String })
|
|
3720
3786
|
], V.prototype, "icon", 2);
|
|
@@ -4162,7 +4228,7 @@ var Go = Object.defineProperty, Ko = Object.getOwnPropertyDescriptor, mt = (e, t
|
|
|
4162
4228
|
(a = e[i]) && (s = (r ? a(t, o, s) : a(s)) || s);
|
|
4163
4229
|
return r && s && Go(t, o, s), s;
|
|
4164
4230
|
};
|
|
4165
|
-
let H = class extends
|
|
4231
|
+
let H = class extends U {
|
|
4166
4232
|
constructor() {
|
|
4167
4233
|
super(), this.options = "", this.parsedOptions = [], H.injectGlobalStyle();
|
|
4168
4234
|
}
|