@illinois-toolkit/ilw-quote 1.0.0 → 1.2.0
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/README.md +12 -5
- package/builder/ilw-quote.json +2 -2
- package/builder/versions/ilw-quote.1.1.json +80 -0
- package/builder/versions/ilw-quote.1.2.json +74 -0
- package/dist/cdn/ilw-quote.css +1 -0
- package/dist/cdn/ilw-quote.js +565 -0
- package/dist/ilw-quote.css +1 -1
- package/dist/ilw-quote.d.ts +16 -0
- package/dist/ilw-quote.d.ts.map +1 -0
- package/dist/ilw-quote.js +30 -596
- package/package.json +26 -7
- package/src/ilw-quote.css +72 -47
- package/src/ilw-quote.styles.css +26 -0
- package/src/ilw-quote.ts +43 -0
- package/dist/ilw-quote.cjs +0 -62
- package/dist/ilw-quote.umd.cjs +0 -62
- package/src/ilw-quote.js +0 -32
- package/src/ilw-quote.styles.js +0 -41
|
@@ -0,0 +1,565 @@
|
|
|
1
|
+
const T = globalThis, z = T.ShadowRoot && (T.ShadyCSS === void 0 || T.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, X = Symbol(), B = /* @__PURE__ */ new WeakMap();
|
|
2
|
+
let ot = class {
|
|
3
|
+
constructor(t, e, s) {
|
|
4
|
+
if (this._$cssResult$ = !0, s !== X) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
|
|
5
|
+
this.cssText = t, this.t = e;
|
|
6
|
+
}
|
|
7
|
+
get styleSheet() {
|
|
8
|
+
let t = this.o;
|
|
9
|
+
const e = this.t;
|
|
10
|
+
if (z && t === void 0) {
|
|
11
|
+
const s = e !== void 0 && e.length === 1;
|
|
12
|
+
s && (t = B.get(e)), t === void 0 && ((this.o = t = new CSSStyleSheet()).replaceSync(this.cssText), s && B.set(e, t));
|
|
13
|
+
}
|
|
14
|
+
return t;
|
|
15
|
+
}
|
|
16
|
+
toString() {
|
|
17
|
+
return this.cssText;
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
const tt = (r) => new ot(typeof r == "string" ? r : r + "", void 0, X), nt = (r, t) => {
|
|
21
|
+
if (z) r.adoptedStyleSheets = t.map(((e) => e instanceof CSSStyleSheet ? e : e.styleSheet));
|
|
22
|
+
else for (const e of t) {
|
|
23
|
+
const s = document.createElement("style"), i = T.litNonce;
|
|
24
|
+
i !== void 0 && s.setAttribute("nonce", i), s.textContent = e.cssText, r.appendChild(s);
|
|
25
|
+
}
|
|
26
|
+
}, W = z ? (r) => r : (r) => r instanceof CSSStyleSheet ? ((t) => {
|
|
27
|
+
let e = "";
|
|
28
|
+
for (const s of t.cssRules) e += s.cssText;
|
|
29
|
+
return tt(e);
|
|
30
|
+
})(r) : r;
|
|
31
|
+
const { is: ht, defineProperty: at, getOwnPropertyDescriptor: lt, getOwnPropertyNames: ct, getOwnPropertySymbols: dt, getPrototypeOf: pt } = Object, R = globalThis, V = R.trustedTypes, ut = V ? V.emptyScript : "", $t = R.reactiveElementPolyfillSupport, S = (r, t) => r, H = { toAttribute(r, t) {
|
|
32
|
+
switch (t) {
|
|
33
|
+
case Boolean:
|
|
34
|
+
r = r ? ut : null;
|
|
35
|
+
break;
|
|
36
|
+
case Object:
|
|
37
|
+
case Array:
|
|
38
|
+
r = r == null ? r : JSON.stringify(r);
|
|
39
|
+
}
|
|
40
|
+
return r;
|
|
41
|
+
}, fromAttribute(r, t) {
|
|
42
|
+
let e = r;
|
|
43
|
+
switch (t) {
|
|
44
|
+
case Boolean:
|
|
45
|
+
e = r !== null;
|
|
46
|
+
break;
|
|
47
|
+
case Number:
|
|
48
|
+
e = r === null ? null : Number(r);
|
|
49
|
+
break;
|
|
50
|
+
case Object:
|
|
51
|
+
case Array:
|
|
52
|
+
try {
|
|
53
|
+
e = JSON.parse(r);
|
|
54
|
+
} catch {
|
|
55
|
+
e = null;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
return e;
|
|
59
|
+
} }, D = (r, t) => !ht(r, t), K = { attribute: !0, type: String, converter: H, reflect: !1, useDefault: !1, hasChanged: D };
|
|
60
|
+
Symbol.metadata ??= Symbol("metadata"), R.litPropertyMetadata ??= /* @__PURE__ */ new WeakMap();
|
|
61
|
+
class g extends HTMLElement {
|
|
62
|
+
static addInitializer(t) {
|
|
63
|
+
this._$Ei(), (this.l ??= []).push(t);
|
|
64
|
+
}
|
|
65
|
+
static get observedAttributes() {
|
|
66
|
+
return this.finalize(), this._$Eh && [...this._$Eh.keys()];
|
|
67
|
+
}
|
|
68
|
+
static createProperty(t, e = K) {
|
|
69
|
+
if (e.state && (e.attribute = !1), this._$Ei(), this.prototype.hasOwnProperty(t) && ((e = Object.create(e)).wrapped = !0), this.elementProperties.set(t, e), !e.noAccessor) {
|
|
70
|
+
const s = Symbol(), i = this.getPropertyDescriptor(t, s, e);
|
|
71
|
+
i !== void 0 && at(this.prototype, t, i);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
static getPropertyDescriptor(t, e, s) {
|
|
75
|
+
const { get: i, set: o } = lt(this.prototype, t) ?? { get() {
|
|
76
|
+
return this[e];
|
|
77
|
+
}, set(n) {
|
|
78
|
+
this[e] = n;
|
|
79
|
+
} };
|
|
80
|
+
return { get: i, set(n) {
|
|
81
|
+
const a = i?.call(this);
|
|
82
|
+
o?.call(this, n), this.requestUpdate(t, a, s);
|
|
83
|
+
}, configurable: !0, enumerable: !0 };
|
|
84
|
+
}
|
|
85
|
+
static getPropertyOptions(t) {
|
|
86
|
+
return this.elementProperties.get(t) ?? K;
|
|
87
|
+
}
|
|
88
|
+
static _$Ei() {
|
|
89
|
+
if (this.hasOwnProperty(S("elementProperties"))) return;
|
|
90
|
+
const t = pt(this);
|
|
91
|
+
t.finalize(), t.l !== void 0 && (this.l = [...t.l]), this.elementProperties = new Map(t.elementProperties);
|
|
92
|
+
}
|
|
93
|
+
static finalize() {
|
|
94
|
+
if (this.hasOwnProperty(S("finalized"))) return;
|
|
95
|
+
if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(S("properties"))) {
|
|
96
|
+
const e = this.properties, s = [...ct(e), ...dt(e)];
|
|
97
|
+
for (const i of s) this.createProperty(i, e[i]);
|
|
98
|
+
}
|
|
99
|
+
const t = this[Symbol.metadata];
|
|
100
|
+
if (t !== null) {
|
|
101
|
+
const e = litPropertyMetadata.get(t);
|
|
102
|
+
if (e !== void 0) for (const [s, i] of e) this.elementProperties.set(s, i);
|
|
103
|
+
}
|
|
104
|
+
this._$Eh = /* @__PURE__ */ new Map();
|
|
105
|
+
for (const [e, s] of this.elementProperties) {
|
|
106
|
+
const i = this._$Eu(e, s);
|
|
107
|
+
i !== void 0 && this._$Eh.set(i, e);
|
|
108
|
+
}
|
|
109
|
+
this.elementStyles = this.finalizeStyles(this.styles);
|
|
110
|
+
}
|
|
111
|
+
static finalizeStyles(t) {
|
|
112
|
+
const e = [];
|
|
113
|
+
if (Array.isArray(t)) {
|
|
114
|
+
const s = new Set(t.flat(1 / 0).reverse());
|
|
115
|
+
for (const i of s) e.unshift(W(i));
|
|
116
|
+
} else t !== void 0 && e.push(W(t));
|
|
117
|
+
return e;
|
|
118
|
+
}
|
|
119
|
+
static _$Eu(t, e) {
|
|
120
|
+
const s = e.attribute;
|
|
121
|
+
return s === !1 ? void 0 : typeof s == "string" ? s : typeof t == "string" ? t.toLowerCase() : void 0;
|
|
122
|
+
}
|
|
123
|
+
constructor() {
|
|
124
|
+
super(), this._$Ep = void 0, this.isUpdatePending = !1, this.hasUpdated = !1, this._$Em = null, this._$Ev();
|
|
125
|
+
}
|
|
126
|
+
_$Ev() {
|
|
127
|
+
this._$ES = new Promise(((t) => this.enableUpdating = t)), this._$AL = /* @__PURE__ */ new Map(), this._$E_(), this.requestUpdate(), this.constructor.l?.forEach(((t) => t(this)));
|
|
128
|
+
}
|
|
129
|
+
addController(t) {
|
|
130
|
+
(this._$EO ??= /* @__PURE__ */ new Set()).add(t), this.renderRoot !== void 0 && this.isConnected && t.hostConnected?.();
|
|
131
|
+
}
|
|
132
|
+
removeController(t) {
|
|
133
|
+
this._$EO?.delete(t);
|
|
134
|
+
}
|
|
135
|
+
_$E_() {
|
|
136
|
+
const t = /* @__PURE__ */ new Map(), e = this.constructor.elementProperties;
|
|
137
|
+
for (const s of e.keys()) this.hasOwnProperty(s) && (t.set(s, this[s]), delete this[s]);
|
|
138
|
+
t.size > 0 && (this._$Ep = t);
|
|
139
|
+
}
|
|
140
|
+
createRenderRoot() {
|
|
141
|
+
const t = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions);
|
|
142
|
+
return nt(t, this.constructor.elementStyles), t;
|
|
143
|
+
}
|
|
144
|
+
connectedCallback() {
|
|
145
|
+
this.renderRoot ??= this.createRenderRoot(), this.enableUpdating(!0), this._$EO?.forEach(((t) => t.hostConnected?.()));
|
|
146
|
+
}
|
|
147
|
+
enableUpdating(t) {
|
|
148
|
+
}
|
|
149
|
+
disconnectedCallback() {
|
|
150
|
+
this._$EO?.forEach(((t) => t.hostDisconnected?.()));
|
|
151
|
+
}
|
|
152
|
+
attributeChangedCallback(t, e, s) {
|
|
153
|
+
this._$AK(t, s);
|
|
154
|
+
}
|
|
155
|
+
_$ET(t, e) {
|
|
156
|
+
const s = this.constructor.elementProperties.get(t), i = this.constructor._$Eu(t, s);
|
|
157
|
+
if (i !== void 0 && s.reflect === !0) {
|
|
158
|
+
const o = (s.converter?.toAttribute !== void 0 ? s.converter : H).toAttribute(e, s.type);
|
|
159
|
+
this._$Em = t, o == null ? this.removeAttribute(i) : this.setAttribute(i, o), this._$Em = null;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
_$AK(t, e) {
|
|
163
|
+
const s = this.constructor, i = s._$Eh.get(t);
|
|
164
|
+
if (i !== void 0 && this._$Em !== i) {
|
|
165
|
+
const o = s.getPropertyOptions(i), n = typeof o.converter == "function" ? { fromAttribute: o.converter } : o.converter?.fromAttribute !== void 0 ? o.converter : H;
|
|
166
|
+
this._$Em = i;
|
|
167
|
+
const a = n.fromAttribute(e, o.type);
|
|
168
|
+
this[i] = a ?? this._$Ej?.get(i) ?? a, this._$Em = null;
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
requestUpdate(t, e, s) {
|
|
172
|
+
if (t !== void 0) {
|
|
173
|
+
const i = this.constructor, o = this[t];
|
|
174
|
+
if (s ??= i.getPropertyOptions(t), !((s.hasChanged ?? D)(o, e) || s.useDefault && s.reflect && o === this._$Ej?.get(t) && !this.hasAttribute(i._$Eu(t, s)))) return;
|
|
175
|
+
this.C(t, e, s);
|
|
176
|
+
}
|
|
177
|
+
this.isUpdatePending === !1 && (this._$ES = this._$EP());
|
|
178
|
+
}
|
|
179
|
+
C(t, e, { useDefault: s, reflect: i, wrapped: o }, n) {
|
|
180
|
+
s && !(this._$Ej ??= /* @__PURE__ */ new Map()).has(t) && (this._$Ej.set(t, n ?? e ?? this[t]), o !== !0 || n !== void 0) || (this._$AL.has(t) || (this.hasUpdated || s || (e = void 0), this._$AL.set(t, e)), i === !0 && this._$Em !== t && (this._$Eq ??= /* @__PURE__ */ new Set()).add(t));
|
|
181
|
+
}
|
|
182
|
+
async _$EP() {
|
|
183
|
+
this.isUpdatePending = !0;
|
|
184
|
+
try {
|
|
185
|
+
await this._$ES;
|
|
186
|
+
} catch (e) {
|
|
187
|
+
Promise.reject(e);
|
|
188
|
+
}
|
|
189
|
+
const t = this.scheduleUpdate();
|
|
190
|
+
return t != null && await t, !this.isUpdatePending;
|
|
191
|
+
}
|
|
192
|
+
scheduleUpdate() {
|
|
193
|
+
return this.performUpdate();
|
|
194
|
+
}
|
|
195
|
+
performUpdate() {
|
|
196
|
+
if (!this.isUpdatePending) return;
|
|
197
|
+
if (!this.hasUpdated) {
|
|
198
|
+
if (this.renderRoot ??= this.createRenderRoot(), this._$Ep) {
|
|
199
|
+
for (const [i, o] of this._$Ep) this[i] = o;
|
|
200
|
+
this._$Ep = void 0;
|
|
201
|
+
}
|
|
202
|
+
const s = this.constructor.elementProperties;
|
|
203
|
+
if (s.size > 0) for (const [i, o] of s) {
|
|
204
|
+
const { wrapped: n } = o, a = this[i];
|
|
205
|
+
n !== !0 || this._$AL.has(i) || a === void 0 || this.C(i, void 0, o, a);
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
let t = !1;
|
|
209
|
+
const e = this._$AL;
|
|
210
|
+
try {
|
|
211
|
+
t = this.shouldUpdate(e), t ? (this.willUpdate(e), this._$EO?.forEach(((s) => s.hostUpdate?.())), this.update(e)) : this._$EM();
|
|
212
|
+
} catch (s) {
|
|
213
|
+
throw t = !1, this._$EM(), s;
|
|
214
|
+
}
|
|
215
|
+
t && this._$AE(e);
|
|
216
|
+
}
|
|
217
|
+
willUpdate(t) {
|
|
218
|
+
}
|
|
219
|
+
_$AE(t) {
|
|
220
|
+
this._$EO?.forEach(((e) => e.hostUpdated?.())), this.hasUpdated || (this.hasUpdated = !0, this.firstUpdated(t)), this.updated(t);
|
|
221
|
+
}
|
|
222
|
+
_$EM() {
|
|
223
|
+
this._$AL = /* @__PURE__ */ new Map(), this.isUpdatePending = !1;
|
|
224
|
+
}
|
|
225
|
+
get updateComplete() {
|
|
226
|
+
return this.getUpdateComplete();
|
|
227
|
+
}
|
|
228
|
+
getUpdateComplete() {
|
|
229
|
+
return this._$ES;
|
|
230
|
+
}
|
|
231
|
+
shouldUpdate(t) {
|
|
232
|
+
return !0;
|
|
233
|
+
}
|
|
234
|
+
update(t) {
|
|
235
|
+
this._$Eq &&= this._$Eq.forEach(((e) => this._$ET(e, this[e]))), this._$EM();
|
|
236
|
+
}
|
|
237
|
+
updated(t) {
|
|
238
|
+
}
|
|
239
|
+
firstUpdated(t) {
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
g.elementStyles = [], g.shadowRootOptions = { mode: "open" }, g[S("elementProperties")] = /* @__PURE__ */ new Map(), g[S("finalized")] = /* @__PURE__ */ new Map(), $t?.({ ReactiveElement: g }), (R.reactiveElementVersions ??= []).push("2.1.1");
|
|
243
|
+
const L = globalThis, N = L.trustedTypes, Z = N ? N.createPolicy("lit-html", { createHTML: (r) => r }) : void 0, et = "$lit$", f = `lit$${Math.random().toFixed(9).slice(2)}$`, st = "?" + f, ft = `<${st}>`, A = document, P = () => A.createComment(""), C = (r) => r === null || typeof r != "object" && typeof r != "function", I = Array.isArray, _t = (r) => I(r) || typeof r?.[Symbol.iterator] == "function", q = `[
|
|
244
|
+
\f\r]`, b = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, F = /-->/g, J = />/g, _ = RegExp(`>|${q}(?:([^\\s"'>=/]+)(${q}*=${q}*(?:[^
|
|
245
|
+
\f\r"'\`<>=]|("|')|))|$)`, "g"), Q = /'/g, G = /"/g, it = /^(?:script|style|textarea|title)$/i, mt = (r) => (t, ...e) => ({ _$litType$: r, strings: t, values: e }), At = mt(1), y = Symbol.for("lit-noChange"), d = Symbol.for("lit-nothing"), Y = /* @__PURE__ */ new WeakMap(), m = A.createTreeWalker(A, 129);
|
|
246
|
+
function rt(r, t) {
|
|
247
|
+
if (!I(r) || !r.hasOwnProperty("raw")) throw Error("invalid template strings array");
|
|
248
|
+
return Z !== void 0 ? Z.createHTML(t) : t;
|
|
249
|
+
}
|
|
250
|
+
const gt = (r, t) => {
|
|
251
|
+
const e = r.length - 1, s = [];
|
|
252
|
+
let i, o = t === 2 ? "<svg>" : t === 3 ? "<math>" : "", n = b;
|
|
253
|
+
for (let a = 0; a < e; a++) {
|
|
254
|
+
const h = r[a];
|
|
255
|
+
let c, p, l = -1, u = 0;
|
|
256
|
+
for (; u < h.length && (n.lastIndex = u, p = n.exec(h), p !== null); ) u = n.lastIndex, n === b ? p[1] === "!--" ? n = F : p[1] !== void 0 ? n = J : p[2] !== void 0 ? (it.test(p[2]) && (i = RegExp("</" + p[2], "g")), n = _) : p[3] !== void 0 && (n = _) : n === _ ? p[0] === ">" ? (n = i ?? b, l = -1) : p[1] === void 0 ? l = -2 : (l = n.lastIndex - p[2].length, c = p[1], n = p[3] === void 0 ? _ : p[3] === '"' ? G : Q) : n === G || n === Q ? n = _ : n === F || n === J ? n = b : (n = _, i = void 0);
|
|
257
|
+
const $ = n === _ && r[a + 1].startsWith("/>") ? " " : "";
|
|
258
|
+
o += n === b ? h + ft : l >= 0 ? (s.push(c), h.slice(0, l) + et + h.slice(l) + f + $) : h + f + (l === -2 ? a : $);
|
|
259
|
+
}
|
|
260
|
+
return [rt(r, o + (r[e] || "<?>") + (t === 2 ? "</svg>" : t === 3 ? "</math>" : "")), s];
|
|
261
|
+
};
|
|
262
|
+
class O {
|
|
263
|
+
constructor({ strings: t, _$litType$: e }, s) {
|
|
264
|
+
let i;
|
|
265
|
+
this.parts = [];
|
|
266
|
+
let o = 0, n = 0;
|
|
267
|
+
const a = t.length - 1, h = this.parts, [c, p] = gt(t, e);
|
|
268
|
+
if (this.el = O.createElement(c, s), m.currentNode = this.el.content, e === 2 || e === 3) {
|
|
269
|
+
const l = this.el.content.firstChild;
|
|
270
|
+
l.replaceWith(...l.childNodes);
|
|
271
|
+
}
|
|
272
|
+
for (; (i = m.nextNode()) !== null && h.length < a; ) {
|
|
273
|
+
if (i.nodeType === 1) {
|
|
274
|
+
if (i.hasAttributes()) for (const l of i.getAttributeNames()) if (l.endsWith(et)) {
|
|
275
|
+
const u = p[n++], $ = i.getAttribute(l).split(f), M = /([.?@])?(.*)/.exec(u);
|
|
276
|
+
h.push({ type: 1, index: o, name: M[2], strings: $, ctor: M[1] === "." ? vt : M[1] === "?" ? Et : M[1] === "@" ? bt : k }), i.removeAttribute(l);
|
|
277
|
+
} else l.startsWith(f) && (h.push({ type: 6, index: o }), i.removeAttribute(l));
|
|
278
|
+
if (it.test(i.tagName)) {
|
|
279
|
+
const l = i.textContent.split(f), u = l.length - 1;
|
|
280
|
+
if (u > 0) {
|
|
281
|
+
i.textContent = N ? N.emptyScript : "";
|
|
282
|
+
for (let $ = 0; $ < u; $++) i.append(l[$], P()), m.nextNode(), h.push({ type: 2, index: ++o });
|
|
283
|
+
i.append(l[u], P());
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
} else if (i.nodeType === 8) if (i.data === st) h.push({ type: 2, index: o });
|
|
287
|
+
else {
|
|
288
|
+
let l = -1;
|
|
289
|
+
for (; (l = i.data.indexOf(f, l + 1)) !== -1; ) h.push({ type: 7, index: o }), l += f.length - 1;
|
|
290
|
+
}
|
|
291
|
+
o++;
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
static createElement(t, e) {
|
|
295
|
+
const s = A.createElement("template");
|
|
296
|
+
return s.innerHTML = t, s;
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
function v(r, t, e = r, s) {
|
|
300
|
+
if (t === y) return t;
|
|
301
|
+
let i = s !== void 0 ? e.o?.[s] : e.l;
|
|
302
|
+
const o = C(t) ? void 0 : t._$litDirective$;
|
|
303
|
+
return i?.constructor !== o && (i?._$AO?.(!1), o === void 0 ? i = void 0 : (i = new o(r), i._$AT(r, e, s)), s !== void 0 ? (e.o ??= [])[s] = i : e.l = i), i !== void 0 && (t = v(r, i._$AS(r, t.values), i, s)), t;
|
|
304
|
+
}
|
|
305
|
+
class yt {
|
|
306
|
+
constructor(t, e) {
|
|
307
|
+
this._$AV = [], this._$AN = void 0, this._$AD = t, this._$AM = e;
|
|
308
|
+
}
|
|
309
|
+
get parentNode() {
|
|
310
|
+
return this._$AM.parentNode;
|
|
311
|
+
}
|
|
312
|
+
get _$AU() {
|
|
313
|
+
return this._$AM._$AU;
|
|
314
|
+
}
|
|
315
|
+
u(t) {
|
|
316
|
+
const { el: { content: e }, parts: s } = this._$AD, i = (t?.creationScope ?? A).importNode(e, !0);
|
|
317
|
+
m.currentNode = i;
|
|
318
|
+
let o = m.nextNode(), n = 0, a = 0, h = s[0];
|
|
319
|
+
for (; h !== void 0; ) {
|
|
320
|
+
if (n === h.index) {
|
|
321
|
+
let c;
|
|
322
|
+
h.type === 2 ? c = new x(o, o.nextSibling, this, t) : h.type === 1 ? c = new h.ctor(o, h.name, h.strings, this, t) : h.type === 6 && (c = new St(o, this, t)), this._$AV.push(c), h = s[++a];
|
|
323
|
+
}
|
|
324
|
+
n !== h?.index && (o = m.nextNode(), n++);
|
|
325
|
+
}
|
|
326
|
+
return m.currentNode = A, i;
|
|
327
|
+
}
|
|
328
|
+
p(t) {
|
|
329
|
+
let e = 0;
|
|
330
|
+
for (const s of this._$AV) s !== void 0 && (s.strings !== void 0 ? (s._$AI(t, s, e), e += s.strings.length - 2) : s._$AI(t[e])), e++;
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
class x {
|
|
334
|
+
get _$AU() {
|
|
335
|
+
return this._$AM?._$AU ?? this.v;
|
|
336
|
+
}
|
|
337
|
+
constructor(t, e, s, i) {
|
|
338
|
+
this.type = 2, this._$AH = d, this._$AN = void 0, this._$AA = t, this._$AB = e, this._$AM = s, this.options = i, this.v = i?.isConnected ?? !0;
|
|
339
|
+
}
|
|
340
|
+
get parentNode() {
|
|
341
|
+
let t = this._$AA.parentNode;
|
|
342
|
+
const e = this._$AM;
|
|
343
|
+
return e !== void 0 && t?.nodeType === 11 && (t = e.parentNode), t;
|
|
344
|
+
}
|
|
345
|
+
get startNode() {
|
|
346
|
+
return this._$AA;
|
|
347
|
+
}
|
|
348
|
+
get endNode() {
|
|
349
|
+
return this._$AB;
|
|
350
|
+
}
|
|
351
|
+
_$AI(t, e = this) {
|
|
352
|
+
t = v(this, t, e), C(t) ? t === d || t == null || t === "" ? (this._$AH !== d && this._$AR(), this._$AH = d) : t !== this._$AH && t !== y && this._(t) : t._$litType$ !== void 0 ? this.$(t) : t.nodeType !== void 0 ? this.T(t) : _t(t) ? this.k(t) : this._(t);
|
|
353
|
+
}
|
|
354
|
+
O(t) {
|
|
355
|
+
return this._$AA.parentNode.insertBefore(t, this._$AB);
|
|
356
|
+
}
|
|
357
|
+
T(t) {
|
|
358
|
+
this._$AH !== t && (this._$AR(), this._$AH = this.O(t));
|
|
359
|
+
}
|
|
360
|
+
_(t) {
|
|
361
|
+
this._$AH !== d && C(this._$AH) ? this._$AA.nextSibling.data = t : this.T(A.createTextNode(t)), this._$AH = t;
|
|
362
|
+
}
|
|
363
|
+
$(t) {
|
|
364
|
+
const { values: e, _$litType$: s } = t, i = typeof s == "number" ? this._$AC(t) : (s.el === void 0 && (s.el = O.createElement(rt(s.h, s.h[0]), this.options)), s);
|
|
365
|
+
if (this._$AH?._$AD === i) this._$AH.p(e);
|
|
366
|
+
else {
|
|
367
|
+
const o = new yt(i, this), n = o.u(this.options);
|
|
368
|
+
o.p(e), this.T(n), this._$AH = o;
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
_$AC(t) {
|
|
372
|
+
let e = Y.get(t.strings);
|
|
373
|
+
return e === void 0 && Y.set(t.strings, e = new O(t)), e;
|
|
374
|
+
}
|
|
375
|
+
k(t) {
|
|
376
|
+
I(this._$AH) || (this._$AH = [], this._$AR());
|
|
377
|
+
const e = this._$AH;
|
|
378
|
+
let s, i = 0;
|
|
379
|
+
for (const o of t) i === e.length ? e.push(s = new x(this.O(P()), this.O(P()), this, this.options)) : s = e[i], s._$AI(o), i++;
|
|
380
|
+
i < e.length && (this._$AR(s && s._$AB.nextSibling, i), e.length = i);
|
|
381
|
+
}
|
|
382
|
+
_$AR(t = this._$AA.nextSibling, e) {
|
|
383
|
+
for (this._$AP?.(!1, !0, e); t && t !== this._$AB; ) {
|
|
384
|
+
const s = t.nextSibling;
|
|
385
|
+
t.remove(), t = s;
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
setConnected(t) {
|
|
389
|
+
this._$AM === void 0 && (this.v = t, this._$AP?.(t));
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
class k {
|
|
393
|
+
get tagName() {
|
|
394
|
+
return this.element.tagName;
|
|
395
|
+
}
|
|
396
|
+
get _$AU() {
|
|
397
|
+
return this._$AM._$AU;
|
|
398
|
+
}
|
|
399
|
+
constructor(t, e, s, i, o) {
|
|
400
|
+
this.type = 1, this._$AH = d, this._$AN = void 0, this.element = t, this.name = e, this._$AM = i, this.options = o, s.length > 2 || s[0] !== "" || s[1] !== "" ? (this._$AH = Array(s.length - 1).fill(new String()), this.strings = s) : this._$AH = d;
|
|
401
|
+
}
|
|
402
|
+
_$AI(t, e = this, s, i) {
|
|
403
|
+
const o = this.strings;
|
|
404
|
+
let n = !1;
|
|
405
|
+
if (o === void 0) t = v(this, t, e, 0), n = !C(t) || t !== this._$AH && t !== y, n && (this._$AH = t);
|
|
406
|
+
else {
|
|
407
|
+
const a = t;
|
|
408
|
+
let h, c;
|
|
409
|
+
for (t = o[0], h = 0; h < o.length - 1; h++) c = v(this, a[s + h], e, h), c === y && (c = this._$AH[h]), n ||= !C(c) || c !== this._$AH[h], c === d ? t = d : t !== d && (t += (c ?? "") + o[h + 1]), this._$AH[h] = c;
|
|
410
|
+
}
|
|
411
|
+
n && !i && this.j(t);
|
|
412
|
+
}
|
|
413
|
+
j(t) {
|
|
414
|
+
t === d ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t ?? "");
|
|
415
|
+
}
|
|
416
|
+
}
|
|
417
|
+
class vt extends k {
|
|
418
|
+
constructor() {
|
|
419
|
+
super(...arguments), this.type = 3;
|
|
420
|
+
}
|
|
421
|
+
j(t) {
|
|
422
|
+
this.element[this.name] = t === d ? void 0 : t;
|
|
423
|
+
}
|
|
424
|
+
}
|
|
425
|
+
class Et extends k {
|
|
426
|
+
constructor() {
|
|
427
|
+
super(...arguments), this.type = 4;
|
|
428
|
+
}
|
|
429
|
+
j(t) {
|
|
430
|
+
this.element.toggleAttribute(this.name, !!t && t !== d);
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
class bt extends k {
|
|
434
|
+
constructor(t, e, s, i, o) {
|
|
435
|
+
super(t, e, s, i, o), this.type = 5;
|
|
436
|
+
}
|
|
437
|
+
_$AI(t, e = this) {
|
|
438
|
+
if ((t = v(this, t, e, 0) ?? d) === y) return;
|
|
439
|
+
const s = this._$AH, i = t === d && s !== d || t.capture !== s.capture || t.once !== s.once || t.passive !== s.passive, o = t !== d && (s === d || i);
|
|
440
|
+
i && this.element.removeEventListener(this.name, this, s), o && this.element.addEventListener(this.name, this, t), this._$AH = t;
|
|
441
|
+
}
|
|
442
|
+
handleEvent(t) {
|
|
443
|
+
typeof this._$AH == "function" ? this._$AH.call(this.options?.host ?? this.element, t) : this._$AH.handleEvent(t);
|
|
444
|
+
}
|
|
445
|
+
}
|
|
446
|
+
class St {
|
|
447
|
+
constructor(t, e, s) {
|
|
448
|
+
this.element = t, this.type = 6, this._$AN = void 0, this._$AM = e, this.options = s;
|
|
449
|
+
}
|
|
450
|
+
get _$AU() {
|
|
451
|
+
return this._$AM._$AU;
|
|
452
|
+
}
|
|
453
|
+
_$AI(t) {
|
|
454
|
+
v(this, t);
|
|
455
|
+
}
|
|
456
|
+
}
|
|
457
|
+
const wt = L.litHtmlPolyfillSupport;
|
|
458
|
+
wt?.(O, x), (L.litHtmlVersions ??= []).push("3.2.0");
|
|
459
|
+
const Pt = (r, t, e) => {
|
|
460
|
+
const s = e?.renderBefore ?? t;
|
|
461
|
+
let i = s._$litPart$;
|
|
462
|
+
if (i === void 0) {
|
|
463
|
+
const o = e?.renderBefore ?? null;
|
|
464
|
+
s._$litPart$ = i = new x(t.insertBefore(P(), o), o, void 0, e ?? {});
|
|
465
|
+
}
|
|
466
|
+
return i._$AI(r), i;
|
|
467
|
+
};
|
|
468
|
+
class w extends g {
|
|
469
|
+
constructor() {
|
|
470
|
+
super(...arguments), this.renderOptions = { host: this }, this.o = void 0;
|
|
471
|
+
}
|
|
472
|
+
createRenderRoot() {
|
|
473
|
+
const t = super.createRenderRoot();
|
|
474
|
+
return this.renderOptions.renderBefore ??= t.firstChild, t;
|
|
475
|
+
}
|
|
476
|
+
update(t) {
|
|
477
|
+
const e = this.render();
|
|
478
|
+
this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(t), this.o = Pt(e, this.renderRoot, this.renderOptions);
|
|
479
|
+
}
|
|
480
|
+
connectedCallback() {
|
|
481
|
+
super.connectedCallback(), this.o?.setConnected(!0);
|
|
482
|
+
}
|
|
483
|
+
disconnectedCallback() {
|
|
484
|
+
super.disconnectedCallback(), this.o?.setConnected(!1);
|
|
485
|
+
}
|
|
486
|
+
render() {
|
|
487
|
+
return y;
|
|
488
|
+
}
|
|
489
|
+
}
|
|
490
|
+
w._$litElement$ = !0, w.finalized = !0, globalThis.litElementHydrateSupport?.({ LitElement: w });
|
|
491
|
+
const Ct = globalThis.litElementPolyfillSupport;
|
|
492
|
+
Ct?.({ LitElement: w });
|
|
493
|
+
(globalThis.litElementVersions ??= []).push("4.1.0");
|
|
494
|
+
const Ot = (r) => (t, e) => {
|
|
495
|
+
e !== void 0 ? e.addInitializer((() => {
|
|
496
|
+
customElements.define(r, t);
|
|
497
|
+
})) : customElements.define(r, t);
|
|
498
|
+
};
|
|
499
|
+
const xt = { attribute: !0, type: String, converter: H, reflect: !1, hasChanged: D }, Ut = (r = xt, t, e) => {
|
|
500
|
+
const { kind: s, metadata: i } = e;
|
|
501
|
+
let o = globalThis.litPropertyMetadata.get(i);
|
|
502
|
+
if (o === void 0 && globalThis.litPropertyMetadata.set(i, o = /* @__PURE__ */ new Map()), s === "setter" && ((r = Object.create(r)).wrapped = !0), o.set(e.name, r), s === "accessor") {
|
|
503
|
+
const { name: n } = e;
|
|
504
|
+
return { set(a) {
|
|
505
|
+
const h = t.get.call(this);
|
|
506
|
+
t.set.call(this, a), this.requestUpdate(n, h, r);
|
|
507
|
+
}, init(a) {
|
|
508
|
+
return a !== void 0 && this.C(n, void 0, r, a), a;
|
|
509
|
+
} };
|
|
510
|
+
}
|
|
511
|
+
if (s === "setter") {
|
|
512
|
+
const { name: n } = e;
|
|
513
|
+
return function(a) {
|
|
514
|
+
const h = this[n];
|
|
515
|
+
t.call(this, a), this.requestUpdate(n, h, r);
|
|
516
|
+
};
|
|
517
|
+
}
|
|
518
|
+
throw Error("Unsupported decorator location: " + s);
|
|
519
|
+
};
|
|
520
|
+
function j(r) {
|
|
521
|
+
return (t, e) => typeof e == "object" ? Ut(r, t, e) : ((s, i, o) => {
|
|
522
|
+
const n = i.hasOwnProperty(o);
|
|
523
|
+
return i.constructor.createProperty(o, s), n ? Object.getOwnPropertyDescriptor(i, o) : void 0;
|
|
524
|
+
})(r, t, e);
|
|
525
|
+
}
|
|
526
|
+
const Mt = ":host{display:block;background:var(--ilw-color--background)}#quote{margin:0 auto;max-width:var(--ilw-quote--max-width)}#content{color:var(--ilw-color--heading);position:relative}#content:before{content:var(--ilw-quote--mark-content-before);position:relative;font-style:normal;color:var(--ilw-color--control-accent);font:var(--ilw-quote--mark-font);line-height:1;height:var(--ilw-quote--mark-height);top:var(--ilw-quote--mark-top);display:block}";
|
|
527
|
+
var Tt = Object.defineProperty, Ht = Object.getOwnPropertyDescriptor, U = (r, t, e, s) => {
|
|
528
|
+
for (var i = s > 1 ? void 0 : s ? Ht(t, e) : t, o = r.length - 1, n; o >= 0; o--)
|
|
529
|
+
(n = r[o]) && (i = (s ? n(t, e, i) : n(i)) || i);
|
|
530
|
+
return s && i && Tt(t, e, i), i;
|
|
531
|
+
};
|
|
532
|
+
let E = class extends w {
|
|
533
|
+
constructor() {
|
|
534
|
+
super(), this.theme = "", this.align = "center", this.size = "small", this.font = "serif";
|
|
535
|
+
}
|
|
536
|
+
static get styles() {
|
|
537
|
+
return tt(Mt);
|
|
538
|
+
}
|
|
539
|
+
render() {
|
|
540
|
+
return At`
|
|
541
|
+
<blockquote id="quote">
|
|
542
|
+
<div id="content"><slot name="content"></slot></div>
|
|
543
|
+
<div id="source"><slot name="author"></slot><slot name="source"></slot></div>
|
|
544
|
+
</blockquote>
|
|
545
|
+
`;
|
|
546
|
+
}
|
|
547
|
+
};
|
|
548
|
+
U([
|
|
549
|
+
j()
|
|
550
|
+
], E.prototype, "theme", 2);
|
|
551
|
+
U([
|
|
552
|
+
j()
|
|
553
|
+
], E.prototype, "align", 2);
|
|
554
|
+
U([
|
|
555
|
+
j()
|
|
556
|
+
], E.prototype, "size", 2);
|
|
557
|
+
U([
|
|
558
|
+
j()
|
|
559
|
+
], E.prototype, "font", 2);
|
|
560
|
+
E = U([
|
|
561
|
+
Ot("ilw-quote")
|
|
562
|
+
], E);
|
|
563
|
+
export {
|
|
564
|
+
E as default
|
|
565
|
+
};
|
package/dist/ilw-quote.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
:root{--ilw-quote--
|
|
1
|
+
@layer base{:root{--ilw-quote--margin: 1rem 0;--ilw-quote--padding: 0 0 1em 0;--ilw-quote--base-font-size: .875rem;--ilw-quote--font: var(--il-font-sans);--ilw-quote--font-serif: var(--il-font-serif);--ilw-quote--font-weight: 600;--ilw-quote--font-size: 1.625em;--ilw-quote--line-height: 1.35;--ilw-quote--author-font-weight: 700;--ilw-quote--author-font-size: 1.625em;--ilw-quote--author-line-height: 1.1;--ilw-quote--source-font-weight: 400;--ilw-quote--source-font-size: 1.428em;--ilw-quote--source-line-height: 1.35;--ilw-quote--mark-font: 9.5em/0 var(--il-font-serif);--ilw-quote--mark-height: .4em;--ilw-quote--mark-top: -10px;--ilw-quote--mark-content-before: "“";--ilw-quote--mark-content-after: "”";--ilw-quote--max-width: 620px;--ilw-quote--border: 6px solid var(--ilw-color--control-accent)}ilw-quote{font-family:var(--ilw-quote--font);font-size:var(--ilw-quote--base-font-size);text-align:center;margin:var(--ilw-quote--margin);padding:var(--ilw-quote--padding)}ilw-quote[align=left]{text-align:left;border-left:var(--ilw-quote--border);--ilw-quote--max-width: none;padding-left:3.125em}ilw-quote[align=right]{text-align:right;border-right:var(--ilw-quote--border);--ilw-quote--max-width: none;padding-right:3.125em}ilw-quote[size=medium]{--ilw-quote--base-font-size: 1rem}ilw-quote[size=large]{--ilw-quote--base-font-size: 1.154rem}}.ilw-quote--exclude-marks{--ilw-quote--mark-content-before: none;--ilw-quote--mark-content-after: none}ilw-quote *[slot=content]{font-weight:var(--ilw-quote--font-weight);font-size:var(--ilw-quote--font-size);line-height:var(--ilw-quote--line-height)}ilw-quote[font=serif] *[slot=content]{font-family:var(--ilw-quote--font-serif);--ilw-quote--font-weight: 400}ilw-quote *[slot=author]{margin-top:1.8em;margin-bottom:.5em;color:var(--ilw-color--control-accent);font-weight:var(--ilw-quote--author-font-weight);font-size:var(--ilw-quote--author-font-size);line-height:var(--ilw-quote--author-line-height)}ilw-quote *[slot=source]{margin:0;color:var(--ilw-color--heading);font-style:inherit;font-weight:var(--ilw-quote--source-font-weight);font-size:var(--ilw-quote--source-font-size);line-height:var(--ilw-quote--source-line-height);display:block}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
export default class Quote extends LitElement {
|
|
3
|
+
theme: string;
|
|
4
|
+
align: "left" | "right" | "center";
|
|
5
|
+
size: "small" | "medium" | "large";
|
|
6
|
+
font: "sans" | "serif";
|
|
7
|
+
static get styles(): import('lit').CSSResult;
|
|
8
|
+
constructor();
|
|
9
|
+
render(): import('lit-html').TemplateResult<1>;
|
|
10
|
+
}
|
|
11
|
+
declare global {
|
|
12
|
+
interface HTMLElementTagNameMap {
|
|
13
|
+
"ilw-quote": Quote;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=ilw-quote.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ilw-quote.d.ts","sourceRoot":"","sources":["../src/ilw-quote.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAkB,MAAM,KAAK,CAAC;AAIhD,OAAO,iBAAiB,CAAC;AAGzB,MAAM,CAAC,OAAO,OAAO,KAAM,SAAQ,UAAU;IAEzC,KAAK,EAAE,MAAM,CAAM;IAGnB,KAAK,EAAE,MAAM,GAAG,OAAO,GAAG,QAAQ,CAAY;IAG9C,IAAI,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAW;IAG7C,IAAI,EAAE,MAAM,GAAG,OAAO,CAAW;IAEjC,MAAM,KAAK,MAAM,4BAEhB;;IAMD,MAAM;CAQT;AAED,OAAO,CAAC,MAAM,CAAC;IACX,UAAU,qBAAqB;QAC3B,WAAW,EAAE,KAAK,CAAC;KACtB;CACJ"}
|