@londondynamics/pericles-webcomponent
Advanced tools
Comparing version 1.0.2 to 1.1.0
@@ -54,5 +54,5 @@ import { LitElement } from 'lit'; | ||
* @example getCurrentValues((values, err) => {}) | ||
* @returns {void} | ||
* @returns {Promise<any>} | ||
*/ | ||
getCurrentSelection: (callback: selectionCallbackFunction) => void; | ||
getCurrentSelection: (callback?: selectionCallbackFunction) => Promise<unknown>; | ||
/** | ||
@@ -63,5 +63,5 @@ * Fetches current configuration options | ||
* @example getCurrentConfiguration((values, err) => {}) | ||
* @returns {void} | ||
* @returns {Promise<any>} | ||
*/ | ||
getCurrentConfiguration(callback: configCallbackFunction): void; | ||
getCurrentConfiguration(callback?: configCallbackFunction): Promise<unknown>; | ||
/** | ||
@@ -72,5 +72,5 @@ * Fetches current scene composition | ||
* @example getCurrentScene((values, err) => {}) | ||
* @returns {void} | ||
* @returns {Promise<any>} | ||
*/ | ||
getCurrentScene(callback: sceneCallbackFunction): void; | ||
getCurrentScene(callback?: sceneCallbackFunction): Promise<unknown>; | ||
/** | ||
@@ -81,5 +81,5 @@ * Fetch hash code for AR | ||
* @example getCurrentHash((hash, err) => {}) | ||
* @returns {void} | ||
* @returns {Promise<any>} | ||
*/ | ||
getCurrentHash(callback: hashCallbackFunction): void; | ||
getCurrentHash(callback?: hashCallbackFunction): Promise<unknown>; | ||
/** | ||
@@ -90,5 +90,5 @@ * Fetches current source files | ||
* @example getCurrentSource((values, err) => {}) | ||
* @returns {void} | ||
* @returns {Promise<any>} | ||
*/ | ||
getCurrentSource(callback: sourceCallbackFunction): void; | ||
getCurrentSource(callback?: sourceCallbackFunction): Promise<unknown>; | ||
/** | ||
@@ -99,5 +99,5 @@ * Fetches current AR-optimised source files | ||
* @example getCurrentARSource((values, err) => {}) | ||
* @returns {void} | ||
* @returns {Promise<any>} | ||
*/ | ||
getCurrentARSource(callback: sourceCallbackFunction): void; | ||
getCurrentARSource(callback?: sourceCallbackFunction): Promise<unknown>; | ||
/** | ||
@@ -108,5 +108,5 @@ * Fetch dataURL of current view | ||
* @example getDataURL((dataURL, err) => {}) | ||
* @returns {void} | ||
* @returns {Promise<any>} | ||
*/ | ||
getDataURL(callback: dataURLCallbackFunction): void; | ||
getDataURL(callback?: dataURLCallbackFunction): Promise<unknown>; | ||
/** | ||
@@ -119,5 +119,6 @@ * Fetches frame from 360 view. | ||
* @example getFrame(0, null, ({ index, src }, err) => {}) | ||
* @returns {void} | ||
* @example const { index, src } = await getFrame(0, { zoom: 2 }) | ||
* @returns {Promise<any>} | ||
*/ | ||
getFrame(index: number, options: object, callback: frameCallbackFunction): void; | ||
getFrame(index?: number, options?: object, callback?: frameCallbackFunction): Promise<unknown>; | ||
/** | ||
@@ -124,0 +125,0 @@ * Sets new variant value (single) for the product |
@@ -6,3 +6,3 @@ /** | ||
*/ | ||
const I = globalThis, F = I.ShadowRoot && (I.ShadyCSS === void 0 || I.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, J = Symbol(), q = /* @__PURE__ */ new WeakMap(); | ||
const k = globalThis, F = k.ShadowRoot && (k.ShadyCSS === void 0 || k.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, J = Symbol(), q = /* @__PURE__ */ new WeakMap(); | ||
let ot = class { | ||
@@ -41,3 +41,3 @@ constructor(t, e, s) { | ||
for (const e of t) { | ||
const s = document.createElement("style"), r = I.litNonce; | ||
const s = document.createElement("style"), r = k.litNonce; | ||
r !== void 0 && s.setAttribute("nonce", r), s.textContent = e.cssText, i.appendChild(s); | ||
@@ -56,3 +56,3 @@ } | ||
*/ | ||
const { is: gt, defineProperty: yt, getOwnPropertyDescriptor: _t, getOwnPropertyNames: $t, getOwnPropertySymbols: mt, getPrototypeOf: ft } = Object, f = globalThis, K = f.trustedTypes, wt = K ? K.emptyScript : "", D = f.reactiveElementPolyfillSupport, C = (i, t) => i, N = { toAttribute(i, t) { | ||
const { is: gt, defineProperty: yt, getOwnPropertyDescriptor: _t, getOwnPropertyNames: $t, getOwnPropertySymbols: mt, getPrototypeOf: ft } = Object, f = globalThis, K = f.trustedTypes, wt = K ? K.emptyScript : "", D = f.reactiveElementPolyfillSupport, C = (i, t) => i, I = { toAttribute(i, t) { | ||
switch (t) { | ||
@@ -85,5 +85,5 @@ case Boolean: | ||
return e; | ||
} }, V = (i, t) => !gt(i, t), Z = { attribute: !0, type: String, converter: N, reflect: !1, hasChanged: V }; | ||
} }, V = (i, t) => !gt(i, t), Z = { attribute: !0, type: String, converter: I, reflect: !1, hasChanged: V }; | ||
Symbol.metadata ?? (Symbol.metadata = Symbol("metadata")), f.litPropertyMetadata ?? (f.litPropertyMetadata = /* @__PURE__ */ new WeakMap()); | ||
class S extends HTMLElement { | ||
class b extends HTMLElement { | ||
static addInitializer(t) { | ||
@@ -110,4 +110,4 @@ this._$Ei(), (this.l ?? (this.l = [])).push(t); | ||
}, set(o) { | ||
const l = r == null ? void 0 : r.call(this); | ||
n.call(this, o), this.requestUpdate(t, l, s); | ||
const p = r == null ? void 0 : r.call(this); | ||
n.call(this, o), this.requestUpdate(t, p, s); | ||
}, configurable: !0, enumerable: !0 }; | ||
@@ -208,3 +208,3 @@ } | ||
if (r !== void 0 && s.reflect === !0) { | ||
const o = (((n = s.converter) == null ? void 0 : n.toAttribute) !== void 0 ? s.converter : N).toAttribute(e, s.type); | ||
const o = (((n = s.converter) == null ? void 0 : n.toAttribute) !== void 0 ? s.converter : I).toAttribute(e, s.type); | ||
this._$Em = t, o == null ? this.removeAttribute(r) : this.setAttribute(r, o), this._$Em = null; | ||
@@ -217,4 +217,4 @@ } | ||
if (r !== void 0 && this._$Em !== r) { | ||
const o = s.getPropertyOptions(r), l = typeof o.converter == "function" ? { fromAttribute: o.converter } : ((n = o.converter) == null ? void 0 : n.fromAttribute) !== void 0 ? o.converter : N; | ||
this._$Em = r, this[r] = l.fromAttribute(e, o.type), this._$Em = null; | ||
const o = s.getPropertyOptions(r), p = typeof o.converter == "function" ? { fromAttribute: o.converter } : ((n = o.converter) == null ? void 0 : n.fromAttribute) !== void 0 ? o.converter : I; | ||
this._$Em = r, this[r] = p.fromAttribute(e, o.type), this._$Em = null; | ||
} | ||
@@ -302,3 +302,3 @@ } | ||
} | ||
S.elementStyles = [], S.shadowRootOptions = { mode: "open" }, S[C("elementProperties")] = /* @__PURE__ */ new Map(), S[C("finalized")] = /* @__PURE__ */ new Map(), D == null || D({ ReactiveElement: S }), (f.reactiveElementVersions ?? (f.reactiveElementVersions = [])).push("2.0.4"); | ||
b.elementStyles = [], b.shadowRootOptions = { mode: "open" }, b[C("elementProperties")] = /* @__PURE__ */ new Map(), b[C("finalized")] = /* @__PURE__ */ new Map(), D == null || D({ ReactiveElement: b }), (f.reactiveElementVersions ?? (f.reactiveElementVersions = [])).push("2.0.4"); | ||
/** | ||
@@ -309,5 +309,5 @@ * @license | ||
*/ | ||
const M = globalThis, L = M.trustedTypes, Q = L ? L.createPolicy("lit-html", { createHTML: (i) => i }) : void 0, nt = "$lit$", m = `lit$${Math.random().toFixed(9).slice(2)}$`, at = "?" + m, At = `<${at}>`, b = document, x = () => b.createComment(""), R = (i) => i === null || typeof i != "object" && typeof i != "function", ht = Array.isArray, bt = (i) => ht(i) || typeof (i == null ? void 0 : i[Symbol.iterator]) == "function", j = `[ | ||
\f\r]`, P = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, X = /-->/g, Y = />/g, w = RegExp(`>|${j}(?:([^\\s"'>=/]+)(${j}*=${j}*(?:[^ | ||
\f\r"'\`<>=]|("|')|))|$)`, "g"), tt = /'/g, et = /"/g, lt = /^(?:script|style|textarea|title)$/i, St = (i) => (t, ...e) => ({ _$litType$: i, strings: t, values: e }), st = St(1), v = Symbol.for("lit-noChange"), g = Symbol.for("lit-nothing"), it = /* @__PURE__ */ new WeakMap(), A = b.createTreeWalker(b, 129); | ||
const M = globalThis, L = M.trustedTypes, Q = L ? L.createPolicy("lit-html", { createHTML: (i) => i }) : void 0, nt = "$lit$", m = `lit$${Math.random().toFixed(9).slice(2)}$`, at = "?" + m, At = `<${at}>`, S = document, x = () => S.createComment(""), R = (i) => i === null || typeof i != "object" && typeof i != "function", ht = Array.isArray, St = (i) => ht(i) || typeof (i == null ? void 0 : i[Symbol.iterator]) == "function", z = `[ | ||
\f\r]`, P = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, X = /-->/g, Y = />/g, w = RegExp(`>|${z}(?:([^\\s"'>=/]+)(${z}*=${z}*(?:[^ | ||
\f\r"'\`<>=]|("|')|))|$)`, "g"), tt = /'/g, et = /"/g, lt = /^(?:script|style|textarea|title)$/i, bt = (i) => (t, ...e) => ({ _$litType$: i, strings: t, values: e }), st = bt(1), v = Symbol.for("lit-noChange"), y = Symbol.for("lit-nothing"), it = /* @__PURE__ */ new WeakMap(), A = S.createTreeWalker(S, 129); | ||
function pt(i, t) { | ||
@@ -321,9 +321,9 @@ if (!Array.isArray(i) || !i.hasOwnProperty("raw")) | ||
let r, n = t === 2 ? "<svg>" : "", o = P; | ||
for (let l = 0; l < e; l++) { | ||
const a = i[l]; | ||
let u, y, d = -1, _ = 0; | ||
for (; _ < a.length && (o.lastIndex = _, y = o.exec(a), y !== null); ) | ||
_ = o.lastIndex, o === P ? y[1] === "!--" ? o = X : y[1] !== void 0 ? o = Y : y[2] !== void 0 ? (lt.test(y[2]) && (r = RegExp("</" + y[2], "g")), o = w) : y[3] !== void 0 && (o = w) : o === w ? y[0] === ">" ? (o = r ?? P, d = -1) : y[1] === void 0 ? d = -2 : (d = o.lastIndex - y[2].length, u = y[1], o = y[3] === void 0 ? w : y[3] === '"' ? et : tt) : o === et || o === tt ? o = w : o === X || o === Y ? o = P : (o = w, r = void 0); | ||
const $ = o === w && i[l + 1].startsWith("/>") ? " " : ""; | ||
n += o === P ? a + At : d >= 0 ? (s.push(u), a.slice(0, d) + nt + a.slice(d) + m + $) : a + m + (d === -2 ? l : $); | ||
for (let p = 0; p < e; p++) { | ||
const a = i[p]; | ||
let d, g, u = -1, _ = 0; | ||
for (; _ < a.length && (o.lastIndex = _, g = o.exec(a), g !== null); ) | ||
_ = o.lastIndex, o === P ? g[1] === "!--" ? o = X : g[1] !== void 0 ? o = Y : g[2] !== void 0 ? (lt.test(g[2]) && (r = RegExp("</" + g[2], "g")), o = w) : g[3] !== void 0 && (o = w) : o === w ? g[0] === ">" ? (o = r ?? P, u = -1) : g[1] === void 0 ? u = -2 : (u = o.lastIndex - g[2].length, d = g[1], o = g[3] === void 0 ? w : g[3] === '"' ? et : tt) : o === et || o === tt ? o = w : o === X || o === Y ? o = P : (o = w, r = void 0); | ||
const $ = o === w && i[p + 1].startsWith("/>") ? " " : ""; | ||
n += o === P ? a + At : u >= 0 ? (s.push(d), a.slice(0, u) + nt + a.slice(u) + m + $) : a + m + (u === -2 ? p : $); | ||
} | ||
@@ -337,23 +337,23 @@ return [pt(i, n + (i[e] || "<?>") + (t === 2 ? "</svg>" : "")), s]; | ||
let n = 0, o = 0; | ||
const l = t.length - 1, a = this.parts, [u, y] = vt(t, e); | ||
if (this.el = O.createElement(u, s), A.currentNode = this.el.content, e === 2) { | ||
const d = this.el.content.firstChild; | ||
d.replaceWith(...d.childNodes); | ||
const p = t.length - 1, a = this.parts, [d, g] = vt(t, e); | ||
if (this.el = O.createElement(d, s), A.currentNode = this.el.content, e === 2) { | ||
const u = this.el.content.firstChild; | ||
u.replaceWith(...u.childNodes); | ||
} | ||
for (; (r = A.nextNode()) !== null && a.length < l; ) { | ||
for (; (r = A.nextNode()) !== null && a.length < p; ) { | ||
if (r.nodeType === 1) { | ||
if (r.hasAttributes()) | ||
for (const d of r.getAttributeNames()) | ||
if (d.endsWith(nt)) { | ||
const _ = y[o++], $ = r.getAttribute(d).split(m), k = /([.?@])?(.*)/.exec(_); | ||
a.push({ type: 1, index: n, name: k[2], strings: $, ctor: k[1] === "." ? Pt : k[1] === "?" ? Ct : k[1] === "@" ? Mt : B }), r.removeAttribute(d); | ||
for (const u of r.getAttributeNames()) | ||
if (u.endsWith(nt)) { | ||
const _ = g[o++], $ = r.getAttribute(u).split(m), H = /([.?@])?(.*)/.exec(_); | ||
a.push({ type: 1, index: n, name: H[2], strings: $, ctor: H[1] === "." ? Pt : H[1] === "?" ? Ct : H[1] === "@" ? Mt : B }), r.removeAttribute(u); | ||
} else | ||
d.startsWith(m) && (a.push({ type: 6, index: n }), r.removeAttribute(d)); | ||
u.startsWith(m) && (a.push({ type: 6, index: n }), r.removeAttribute(u)); | ||
if (lt.test(r.tagName)) { | ||
const d = r.textContent.split(m), _ = d.length - 1; | ||
const u = r.textContent.split(m), _ = u.length - 1; | ||
if (_ > 0) { | ||
r.textContent = L ? L.emptyScript : ""; | ||
for (let $ = 0; $ < _; $++) | ||
r.append(d[$], x()), A.nextNode(), a.push({ type: 2, index: ++n }); | ||
r.append(d[_], x()); | ||
r.append(u[$], x()), A.nextNode(), a.push({ type: 2, index: ++n }); | ||
r.append(u[_], x()); | ||
} | ||
@@ -365,5 +365,5 @@ } | ||
else { | ||
let d = -1; | ||
for (; (d = r.data.indexOf(m, d + 1)) !== -1; ) | ||
a.push({ type: 7, index: n }), d += m.length - 1; | ||
let u = -1; | ||
for (; (u = r.data.indexOf(m, u + 1)) !== -1; ) | ||
a.push({ type: 7, index: n }), u += m.length - 1; | ||
} | ||
@@ -374,3 +374,3 @@ n++; | ||
static createElement(t, e) { | ||
const s = b.createElement("template"); | ||
const s = S.createElement("template"); | ||
return s.innerHTML = t, s; | ||
@@ -380,3 +380,3 @@ } | ||
function E(i, t, e = i, s) { | ||
var o, l; | ||
var o, p; | ||
if (t === v) | ||
@@ -386,3 +386,3 @@ return t; | ||
const n = R(t) ? void 0 : t._$litDirective$; | ||
return (r == null ? void 0 : r.constructor) !== n && ((l = r == null ? void 0 : r._$AO) == null || l.call(r, !1), n === void 0 ? r = void 0 : (r = new n(i), r._$AT(i, e, s)), s !== void 0 ? (e._$Co ?? (e._$Co = []))[s] = r : e._$Cl = r), r !== void 0 && (t = E(i, r._$AS(i, t.values), r, s)), t; | ||
return (r == null ? void 0 : r.constructor) !== n && ((p = r == null ? void 0 : r._$AO) == null || p.call(r, !1), n === void 0 ? r = void 0 : (r = new n(i), r._$AT(i, e, s)), s !== void 0 ? (e._$Co ?? (e._$Co = []))[s] = r : e._$Cl = r), r !== void 0 && (t = E(i, r._$AS(i, t.values), r, s)), t; | ||
} | ||
@@ -400,13 +400,13 @@ class Et { | ||
u(t) { | ||
const { el: { content: e }, parts: s } = this._$AD, r = ((t == null ? void 0 : t.creationScope) ?? b).importNode(e, !0); | ||
const { el: { content: e }, parts: s } = this._$AD, r = ((t == null ? void 0 : t.creationScope) ?? S).importNode(e, !0); | ||
A.currentNode = r; | ||
let n = A.nextNode(), o = 0, l = 0, a = s[0]; | ||
let n = A.nextNode(), o = 0, p = 0, a = s[0]; | ||
for (; a !== void 0; ) { | ||
if (o === a.index) { | ||
let u; | ||
a.type === 2 ? u = new T(n, n.nextSibling, this, t) : a.type === 1 ? u = new a.ctor(n, a.name, a.strings, this, t) : a.type === 6 && (u = new Ut(n, this, t)), this._$AV.push(u), a = s[++l]; | ||
let d; | ||
a.type === 2 ? d = new T(n, n.nextSibling, this, t) : a.type === 1 ? d = new a.ctor(n, a.name, a.strings, this, t) : a.type === 6 && (d = new Ut(n, this, t)), this._$AV.push(d), a = s[++p]; | ||
} | ||
o !== (a == null ? void 0 : a.index) && (n = A.nextNode(), o++); | ||
} | ||
return A.currentNode = b, r; | ||
return A.currentNode = S, r; | ||
} | ||
@@ -425,3 +425,3 @@ p(t) { | ||
constructor(t, e, s, r) { | ||
this.type = 2, this._$AH = g, this._$AN = void 0, this._$AA = t, this._$AB = e, this._$AM = s, this.options = r, this._$Cv = (r == null ? void 0 : r.isConnected) ?? !0; | ||
this.type = 2, this._$AH = y, this._$AN = void 0, this._$AA = t, this._$AB = e, this._$AM = s, this.options = r, this._$Cv = (r == null ? void 0 : r.isConnected) ?? !0; | ||
} | ||
@@ -440,3 +440,3 @@ get parentNode() { | ||
_$AI(t, e = this) { | ||
t = E(this, t, e), R(t) ? t === g || t == null || t === "" ? (this._$AH !== g && this._$AR(), this._$AH = g) : t !== this._$AH && t !== v && this._(t) : t._$litType$ !== void 0 ? this.$(t) : t.nodeType !== void 0 ? this.T(t) : bt(t) ? this.k(t) : this._(t); | ||
t = E(this, t, e), R(t) ? t === y || t == null || t === "" ? (this._$AH !== y && this._$AR(), this._$AH = y) : t !== this._$AH && t !== v && this._(t) : t._$litType$ !== void 0 ? this.$(t) : t.nodeType !== void 0 ? this.T(t) : St(t) ? this.k(t) : this._(t); | ||
} | ||
@@ -450,3 +450,3 @@ S(t) { | ||
_(t) { | ||
this._$AH !== g && R(this._$AH) ? this._$AA.nextSibling.data = t : this.T(b.createTextNode(t)), this._$AH = t; | ||
this._$AH !== y && R(this._$AH) ? this._$AA.nextSibling.data = t : this.T(S.createTextNode(t)), this._$AH = t; | ||
} | ||
@@ -459,4 +459,4 @@ $(t) { | ||
else { | ||
const o = new Et(r, this), l = o.u(this.options); | ||
o.p(e), this.T(l), this._$AH = o; | ||
const o = new Et(r, this), p = o.u(this.options); | ||
o.p(e), this.T(p), this._$AH = o; | ||
} | ||
@@ -496,3 +496,3 @@ } | ||
constructor(t, e, s, r, n) { | ||
this.type = 1, this._$AH = g, this._$AN = void 0, this.element = t, this.name = e, this._$AM = r, this.options = n, s.length > 2 || s[0] !== "" || s[1] !== "" ? (this._$AH = Array(s.length - 1).fill(new String()), this.strings = s) : this._$AH = g; | ||
this.type = 1, this._$AH = y, this._$AN = void 0, this.element = t, this.name = e, this._$AM = r, this.options = n, s.length > 2 || s[0] !== "" || s[1] !== "" ? (this._$AH = Array(s.length - 1).fill(new String()), this.strings = s) : this._$AH = y; | ||
} | ||
@@ -505,6 +505,6 @@ _$AI(t, e = this, s, r) { | ||
else { | ||
const l = t; | ||
let a, u; | ||
const p = t; | ||
let a, d; | ||
for (t = n[0], a = 0; a < n.length - 1; a++) | ||
u = E(this, l[s + a], e, a), u === v && (u = this._$AH[a]), o || (o = !R(u) || u !== this._$AH[a]), u === g ? t = g : t !== g && (t += (u ?? "") + n[a + 1]), this._$AH[a] = u; | ||
d = E(this, p[s + a], e, a), d === v && (d = this._$AH[a]), o || (o = !R(d) || d !== this._$AH[a]), d === y ? t = y : t !== y && (t += (d ?? "") + n[a + 1]), this._$AH[a] = d; | ||
} | ||
@@ -514,3 +514,3 @@ o && !r && this.j(t); | ||
j(t) { | ||
t === g ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t ?? ""); | ||
t === y ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t ?? ""); | ||
} | ||
@@ -523,3 +523,3 @@ } | ||
j(t) { | ||
this.element[this.name] = t === g ? void 0 : t; | ||
this.element[this.name] = t === y ? void 0 : t; | ||
} | ||
@@ -532,3 +532,3 @@ } | ||
j(t) { | ||
this.element.toggleAttribute(this.name, !!t && t !== g); | ||
this.element.toggleAttribute(this.name, !!t && t !== y); | ||
} | ||
@@ -541,5 +541,5 @@ } | ||
_$AI(t, e = this) { | ||
if ((t = E(this, t, e, 0) ?? g) === v) | ||
if ((t = E(this, t, e, 0) ?? y) === v) | ||
return; | ||
const s = this._$AH, r = t === g && s !== g || t.capture !== s.capture || t.once !== s.once || t.passive !== s.passive, n = t !== g && (s === g || r); | ||
const s = this._$AH, r = t === y && s !== y || t.capture !== s.capture || t.once !== s.once || t.passive !== s.passive, n = t !== y && (s === y || r); | ||
r && this.element.removeEventListener(this.name, this, s), n && this.element.addEventListener(this.name, this, t), this._$AH = t; | ||
@@ -563,4 +563,4 @@ } | ||
} | ||
const z = M.litHtmlPolyfillSupport; | ||
z == null || z(O, T), (M.litHtmlVersions ?? (M.litHtmlVersions = [])).push("3.1.3"); | ||
const j = M.litHtmlPolyfillSupport; | ||
j == null || j(O, T), (M.litHtmlVersions ?? (M.litHtmlVersions = [])).push("3.1.3"); | ||
const xt = (i, t, e) => { | ||
@@ -580,3 +580,3 @@ const s = (e == null ? void 0 : e.renderBefore) ?? t; | ||
*/ | ||
class U extends S { | ||
class U extends b { | ||
constructor() { | ||
@@ -626,3 +626,3 @@ super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0; | ||
*/ | ||
const Ot = { attribute: !0, type: String, converter: N, reflect: !1, hasChanged: V }, Tt = (i = Ot, t, e) => { | ||
const Ot = { attribute: !0, type: String, converter: I, reflect: !1, hasChanged: V }, Tt = (i = Ot, t, e) => { | ||
const { kind: s, metadata: r } = e; | ||
@@ -632,7 +632,7 @@ let n = globalThis.litPropertyMetadata.get(r); | ||
const { name: o } = e; | ||
return { set(l) { | ||
return { set(p) { | ||
const a = t.get.call(this); | ||
t.set.call(this, l), this.requestUpdate(o, a, i); | ||
}, init(l) { | ||
return l !== void 0 && this.P(o, void 0, i), l; | ||
t.set.call(this, p), this.requestUpdate(o, a, i); | ||
}, init(p) { | ||
return p !== void 0 && this.P(o, void 0, i), p; | ||
} }; | ||
@@ -642,5 +642,5 @@ } | ||
const { name: o } = e; | ||
return function(l) { | ||
return function(p) { | ||
const a = this[o]; | ||
t.call(this, l), this.requestUpdate(o, a, i); | ||
t.call(this, p), this.requestUpdate(o, a, i); | ||
}; | ||
@@ -656,3 +656,3 @@ } | ||
} | ||
const kt = [ | ||
const Ht = [ | ||
"arPlacement", | ||
@@ -688,5 +688,5 @@ "backgroundColor", | ||
"zoomType" | ||
], Ht = (i) => { | ||
], Nt = (i) => { | ||
let t = new URLSearchParams(); | ||
return kt.forEach((e) => { | ||
return Ht.forEach((e) => { | ||
if (i.hasAttribute(e)) { | ||
@@ -700,9 +700,9 @@ let s = i.getAttribute(e); | ||
}; | ||
var It = Object.defineProperty, Nt = Object.getOwnPropertyDescriptor, p = (i, t, e, s) => { | ||
for (var r = s > 1 ? void 0 : s ? Nt(t, e) : t, n = i.length - 1, o; n >= 0; n--) | ||
var kt = Object.defineProperty, It = Object.getOwnPropertyDescriptor, l = (i, t, e, s) => { | ||
for (var r = s > 1 ? void 0 : s ? It(t, e) : t, n = i.length - 1, o; n >= 0; n--) | ||
(o = i[n]) && (r = (s ? o(t, e, r) : o(r)) || r); | ||
return s && r && It(t, e, r), r; | ||
return s && r && kt(t, e, r), r; | ||
}; | ||
const Lt = "{host}{viewer}/by_scene_id/{scene_id}", Bt = "{host}{viewer}/by_product_id/{customer_id}/{product_id}", Dt = "{host}{viewer}/by_product_id/{customer_id}/{sku}", jt = "{host}{viewer}/by_hash/{customer_id}/{hash}"; | ||
function H(i, t) { | ||
const Lt = "{host}{viewer}/by_scene_id/{scene_id}", Bt = "{host}{viewer}/by_product_id/{customer_id}/{product_id}", Dt = "{host}{viewer}/by_product_id/{customer_id}/{sku}", zt = "{host}{viewer}/by_hash/{customer_id}/{hash}"; | ||
function N(i, t) { | ||
var e = new RegExp(Object.keys(t).join("|"), "gi"); | ||
@@ -715,10 +715,8 @@ return i.replace(e, function(s) { | ||
constructor() { | ||
super(...arguments), this.customerId = void 0, this.viewer = "realtime", this.host = "https://configurator.v2.londondynamics.com", this.getCurrentSelection = (i) => { | ||
this._pingpongPostMessage( | ||
{ | ||
type: "currentValues" | ||
}, | ||
i | ||
); | ||
}, this._emit = (i, t) => { | ||
super(...arguments), this.customerId = void 0, this.viewer = "realtime", this.host = "https://configurator.v2.londondynamics.com", this.getCurrentSelection = (i) => this._pingpongPostMessage( | ||
{ | ||
type: "currentValues" | ||
}, | ||
i | ||
), this._emit = (i, t) => { | ||
this.dispatchEvent( | ||
@@ -731,16 +729,16 @@ new CustomEvent(i, { | ||
); | ||
}, this._pingpongPostMessage = (i, t) => { | ||
var n, o; | ||
const e = { ...i, messageId: Date.now() }, s = (l) => { | ||
if (l.origin === this.host && l.data.messageId === e.messageId && l.data.type === e.type) { | ||
}, this._pingpongPostMessage = (i, t) => new Promise((e, s) => { | ||
var p, a; | ||
const r = { ...i, messageId: Date.now() }, n = (d) => { | ||
if (d.origin === this.host && d.data.messageId === r.messageId && d.data.type === r.type) { | ||
try { | ||
t(JSON.parse(l.data.result)); | ||
} catch (a) { | ||
a instanceof Error ? t({}, a.message) : t({}, "Unknown error"); | ||
t ? t(JSON.parse(d.data.result)) : e(JSON.parse(d.data.result)); | ||
} catch (g) { | ||
g instanceof Error ? t ? t({}, g.message) : s(g.message) : t ? t({}, "Unknown error") : s("Unknown error"); | ||
} | ||
window.removeEventListener("message", s); | ||
window.removeEventListener("message", n); | ||
} | ||
}, r = (n = this.shadowRoot) == null ? void 0 : n.querySelector("iframe"); | ||
r && (window.addEventListener("message", s), (o = r.contentWindow) == null || o.postMessage(e, "*")); | ||
}, this._handleMessage = (i) => { | ||
}, o = (p = this.shadowRoot) == null ? void 0 : p.querySelector("iframe"); | ||
o && (window.addEventListener("message", n), (a = o.contentWindow) == null || a.postMessage(r, "*")); | ||
}), this._handleMessage = (i) => { | ||
var t; | ||
@@ -776,6 +774,6 @@ if (i.origin === this.host && (t = i == null ? void 0 : i.data) != null && t.type) | ||
* @example getCurrentConfiguration((values, err) => {}) | ||
* @returns {void} | ||
* @returns {Promise<any>} | ||
*/ | ||
getCurrentConfiguration(i) { | ||
this._pingpongPostMessage( | ||
return this._pingpongPostMessage( | ||
{ | ||
@@ -792,6 +790,6 @@ type: "currentConfig" | ||
* @example getCurrentScene((values, err) => {}) | ||
* @returns {void} | ||
* @returns {Promise<any>} | ||
*/ | ||
getCurrentScene(i) { | ||
this._pingpongPostMessage( | ||
return this._pingpongPostMessage( | ||
{ | ||
@@ -808,6 +806,6 @@ type: "currentScene" | ||
* @example getCurrentHash((hash, err) => {}) | ||
* @returns {void} | ||
* @returns {Promise<any>} | ||
*/ | ||
getCurrentHash(i) { | ||
this._pingpongPostMessage( | ||
return this._pingpongPostMessage( | ||
{ | ||
@@ -824,6 +822,6 @@ type: "currentHash" | ||
* @example getCurrentSource((values, err) => {}) | ||
* @returns {void} | ||
* @returns {Promise<any>} | ||
*/ | ||
getCurrentSource(i) { | ||
this._pingpongPostMessage( | ||
return this._pingpongPostMessage( | ||
{ | ||
@@ -840,6 +838,6 @@ type: "currentSource" | ||
* @example getCurrentARSource((values, err) => {}) | ||
* @returns {void} | ||
* @returns {Promise<any>} | ||
*/ | ||
getCurrentARSource(i) { | ||
this._pingpongPostMessage( | ||
return this._pingpongPostMessage( | ||
{ | ||
@@ -856,6 +854,6 @@ type: "currentARSource" | ||
* @example getDataURL((dataURL, err) => {}) | ||
* @returns {void} | ||
* @returns {Promise<any>} | ||
*/ | ||
getDataURL(i) { | ||
this._pingpongPostMessage( | ||
return this._pingpongPostMessage( | ||
{ | ||
@@ -874,6 +872,7 @@ type: "dataURL" | ||
* @example getFrame(0, null, ({ index, src }, err) => {}) | ||
* @returns {void} | ||
* @example const { index, src } = await getFrame(0, { zoom: 2 }) | ||
* @returns {Promise<any>} | ||
*/ | ||
getFrame(i, t, e) { | ||
this._pingpongPostMessage( | ||
return this._pingpongPostMessage( | ||
{ | ||
@@ -1016,3 +1015,3 @@ type: "getFrame", | ||
let i = null, t = null; | ||
return this.host ? this.customerId ? this.hash ? t = H(jt, { | ||
return this.host ? this.customerId ? this.hash ? t = N(zt, { | ||
"{viewer}": "", | ||
@@ -1022,3 +1021,3 @@ "{host}": this.host, | ||
"{hash}": this.hash | ||
}) : this.sceneId ? t = H(Lt, { | ||
}) : this.sceneId ? t = N(Lt, { | ||
"{viewer}": this.viewer === "360" ? "/360" : "", | ||
@@ -1028,3 +1027,3 @@ "{host}": this.host, | ||
"{scene_id}": this.sceneId | ||
}) : this.sku ? t = H(Dt, { | ||
}) : this.sku ? t = N(Dt, { | ||
"{viewer}": this.viewer === "360" ? "/360" : "", | ||
@@ -1034,3 +1033,3 @@ "{host}": this.host, | ||
"{sku}": this.sku | ||
}) : this.productId ? t = H(Bt, { | ||
}) : this.productId ? t = N(Bt, { | ||
"{viewer}": this.viewer === "360" ? "/360" : "", | ||
@@ -1040,3 +1039,3 @@ "{host}": this.host, | ||
"{product_id}": this.productId | ||
}) : i = "Missing property: sku/productId, sceneId, or hash code" : i = "Missing property: customerId" : i = "Missing property: host", i ? st`<div>${i}</div>` : (this.hasAttributes() && (t += "?" + Ht(this)), st`<iframe | ||
}) : i = "Missing property: sku/productId, sceneId, or hash code" : i = "Missing property: customerId" : i = "Missing property: host", i ? st`<div>${i}</div>` : (this.hasAttributes() && (t += "?" + Nt(this)), st`<iframe | ||
src="${t}" | ||
@@ -1065,93 +1064,93 @@ width="100%" | ||
`; | ||
p([ | ||
l([ | ||
c({ type: String }) | ||
], h.prototype, "customerId", 2); | ||
p([ | ||
l([ | ||
c({ type: String }) | ||
], h.prototype, "productId", 2); | ||
p([ | ||
l([ | ||
c({ type: String }) | ||
], h.prototype, "sku", 2); | ||
p([ | ||
l([ | ||
c({ type: String }) | ||
], h.prototype, "sceneId", 2); | ||
p([ | ||
l([ | ||
c({ type: String }) | ||
], h.prototype, "hash", 2); | ||
p([ | ||
l([ | ||
c({ type: String }) | ||
], h.prototype, "viewer", 2); | ||
p([ | ||
l([ | ||
c({ type: String }) | ||
], h.prototype, "host", 2); | ||
p([ | ||
l([ | ||
c({ type: String, attribute: "arplacement" }) | ||
], h.prototype, "arPlacement", 2); | ||
p([ | ||
l([ | ||
c({ type: String, attribute: "backgroundcolor" }) | ||
], h.prototype, "backgroundColor", 2); | ||
p([ | ||
l([ | ||
c({ type: String, attribute: "enabledarkmode" }) | ||
], h.prototype, "enableDarkMode", 2); | ||
p([ | ||
l([ | ||
c({ type: String, attribute: "disablescrollwheel" }) | ||
], h.prototype, "disableScrollWheel", 2); | ||
p([ | ||
l([ | ||
c({ type: String, attribute: "interactionpromptstyle" }) | ||
], h.prototype, "interactionPromptStyle", 2); | ||
p([ | ||
l([ | ||
c({ type: String, attribute: "lights" }) | ||
], h.prototype, "lights", 2); | ||
p([ | ||
l([ | ||
c({ type: String, attribute: "rotation" }) | ||
], h.prototype, "rotation", 2); | ||
p([ | ||
l([ | ||
c({ type: String, attribute: "rulerunit" }) | ||
], h.prototype, "rulerUnit", 2); | ||
p([ | ||
l([ | ||
c({ type: String, attribute: "shadowintensity" }) | ||
], h.prototype, "shadowIntensity", 2); | ||
p([ | ||
l([ | ||
c({ type: String, attribute: "shadowsoftness" }) | ||
], h.prototype, "shadowSoftness", 2); | ||
p([ | ||
l([ | ||
c({ type: String, attribute: "showarbutton" }) | ||
], h.prototype, "showARButton", 2); | ||
p([ | ||
l([ | ||
c({ type: String, attribute: "showarbuttonlabel" }) | ||
], h.prototype, "showARButtonLabel", 2); | ||
p([ | ||
l([ | ||
c({ type: String, attribute: "showconfigurator" }) | ||
], h.prototype, "showConfigurator", 2); | ||
p([ | ||
l([ | ||
c({ type: String, attribute: "showcontexts" }) | ||
], h.prototype, "showContexts", 2); | ||
p([ | ||
l([ | ||
c({ type: String, attribute: "showhotspots" }) | ||
], h.prototype, "showHotspots", 2); | ||
p([ | ||
l([ | ||
c({ type: String, attribute: "showinteractionprompt" }) | ||
], h.prototype, "showInteractionPrompt", 2); | ||
p([ | ||
l([ | ||
c({ type: String, attribute: "showlightswitch" }) | ||
], h.prototype, "showLightSwitch", 2); | ||
p([ | ||
l([ | ||
c({ type: String, attribute: "showrulerbutton" }) | ||
], h.prototype, "showRulerButton", 2); | ||
p([ | ||
l([ | ||
c({ type: String, attribute: "showpivotbutton" }) | ||
], h.prototype, "showPivotButton", 2); | ||
p([ | ||
l([ | ||
c({ type: String, attribute: "showpresets" }) | ||
], h.prototype, "showPresets", 2); | ||
p([ | ||
l([ | ||
c({ type: String, attribute: "startframe" }) | ||
], h.prototype, "startFrame", 2); | ||
p([ | ||
l([ | ||
c({ type: String, attribute: "tonemapping" }) | ||
], h.prototype, "toneMapping", 2); | ||
p([ | ||
l([ | ||
c({ type: String, attribute: "zoomtype" }) | ||
], h.prototype, "zoomType", 2); | ||
h = p([ | ||
h = l([ | ||
Rt("ld-configurator") | ||
@@ -1158,0 +1157,0 @@ ], h); |
{ | ||
"name": "@londondynamics/pericles-webcomponent", | ||
"license": "MIT", | ||
"version": "1.0.2", | ||
"version": "1.1.0", | ||
"type": "module", | ||
@@ -6,0 +6,0 @@ "keywords": [ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
80408
1448