@everymatrix/mini-games-lobby 1.55.0 → 1.56.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/dist/cjs/{index-60aa454b.js → index-2c9f83af.js} +153 -62
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/mini-games-lobby.cjs.entry.js +182 -5
- package/dist/cjs/mini-games-lobby.cjs.js +2 -2
- package/dist/collection/collection-manifest.json +1 -1
- package/dist/collection/components/mini-games-lobby/mini-games-lobby.js +41 -4
- package/dist/esm/{index-4ae384e0.js → index-25e6da1e.js} +153 -62
- package/dist/esm/loader.js +2 -2
- package/dist/esm/mini-games-lobby.entry.js +182 -5
- package/dist/esm/mini-games-lobby.js +3 -3
- package/dist/mini-games-lobby/mini-games-lobby.esm.js +1 -1
- package/dist/mini-games-lobby/p-10aa90b5.entry.js +1 -0
- package/dist/mini-games-lobby/p-14714f4a.js +2 -0
- package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/mini-games-lobby/.stencil/packages/stencil/mini-games-lobby/stencil.config.d.ts +2 -0
- package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/mini-games-lobby/.stencil/packages/stencil/mini-games-lobby/stencil.config.dev.d.ts +2 -0
- package/package.json +1 -1
- package/dist/mini-games-lobby/p-6b2ef1fa.js +0 -2
- package/dist/mini-games-lobby/p-6f4ccffc.entry.js +0 -1
- package/dist/types/Users/maria.bumbar/Desktop/widgets-monorepo/packages/stencil/mini-games-lobby/.stencil/packages/stencil/mini-games-lobby/stencil.config.d.ts +0 -2
- package/dist/types/Users/maria.bumbar/Desktop/widgets-monorepo/packages/stencil/mini-games-lobby/.stencil/packages/stencil/mini-games-lobby/stencil.config.dev.d.ts +0 -2
- /package/dist/types/Users/{maria.bumbar/Desktop → adrian.pripon/Documents/Work}/widgets-monorepo/packages/stencil/mini-games-lobby/.stencil/tools/plugins/index.d.ts +0 -0
- /package/dist/types/Users/{maria.bumbar/Desktop → adrian.pripon/Documents/Work}/widgets-monorepo/packages/stencil/mini-games-lobby/.stencil/tools/plugins/stencil-clean-deps-plugin.d.ts +0 -0
- /package/dist/types/Users/{maria.bumbar/Desktop → adrian.pripon/Documents/Work}/widgets-monorepo/packages/stencil/mini-games-lobby/.stencil/tools/plugins/vite-chunk-plugin.d.ts +0 -0
- /package/dist/types/Users/{maria.bumbar/Desktop → adrian.pripon/Documents/Work}/widgets-monorepo/packages/stencil/mini-games-lobby/.stencil/tools/plugins/vite-clean-deps-plugin.d.ts +0 -0
|
@@ -21,19 +21,23 @@ function _interopNamespace(e) {
|
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
const NAMESPACE = 'mini-games-lobby';
|
|
24
|
-
const BUILD = /* mini-games-lobby */ { allRenderFn: true, appendChildSlotFix: false, asyncLoading: true, asyncQueue: false, attachStyles: true, cloneNodeFix: false, cmpDidLoad: true, cmpDidRender: false, cmpDidUnload: false, cmpDidUpdate: false, cmpShouldUpdate: true, cmpWillLoad: true, cmpWillRender: false, cmpWillUpdate: false, connectedCallback: false, constructableCSS: true, cssAnnotations: true, devTools: false, disconnectedCallback: false, element: false, event: false, experimentalScopedSlotChanges: false, experimentalSlotFixes: false, formAssociated: false, hasRenderFn: true, hostListener: false, hostListenerTarget: false, hostListenerTargetBody: false, hostListenerTargetDocument: false, hostListenerTargetParent: false, hostListenerTargetWindow: false, hotModuleReplacement: false, hydrateClientSide: false, hydrateServerSide: false, hydratedAttribute: false, hydratedClass: true, hydratedSelectorName: "hydrated", initializeNextTick: false, invisiblePrehydration: true, isDebug: false, isDev: false, isTesting: false, lazyLoad: true, lifecycle: true, lifecycleDOMEvents: false, member: true, method: false, mode: false, observeAttribute: true, profile: false, prop: true, propBoolean: false, propMutable: false, propNumber: false, propString: true, reflect: false, scoped: false, scopedSlotTextContentFix: false, scriptDataOpts: false, shadowDelegatesFocus: false, shadowDom: true, slot: false, slotChildNodesFix: false, slotRelocation: false, state: true, style: true, svg: false, taskQueue: true, transformTagName: false, updatable: true, vdomAttribute: true, vdomClass: false, vdomFunctional: true, vdomKey: true, vdomListener: true, vdomPropOrAttr: true, vdomRef: false, vdomRender: true, vdomStyle: false, vdomText: false, vdomXlink: false, watchCallback: true };
|
|
24
|
+
const BUILD = /* mini-games-lobby */ { allRenderFn: true, appendChildSlotFix: false, asyncLoading: true, asyncQueue: false, attachStyles: true, cloneNodeFix: false, cmpDidLoad: true, cmpDidRender: false, cmpDidUnload: false, cmpDidUpdate: false, cmpShouldUpdate: true, cmpWillLoad: true, cmpWillRender: false, cmpWillUpdate: false, connectedCallback: false, constructableCSS: true, cssAnnotations: true, devTools: false, disconnectedCallback: false, element: false, event: false, experimentalScopedSlotChanges: false, experimentalSlotFixes: false, formAssociated: false, hasRenderFn: true, hostListener: false, hostListenerTarget: false, hostListenerTargetBody: false, hostListenerTargetDocument: false, hostListenerTargetParent: false, hostListenerTargetWindow: false, hotModuleReplacement: false, hydrateClientSide: false, hydrateServerSide: false, hydratedAttribute: false, hydratedClass: true, hydratedSelectorName: "hydrated", initializeNextTick: false, invisiblePrehydration: true, isDebug: false, isDev: false, isTesting: false, lazyLoad: true, lifecycle: true, lifecycleDOMEvents: false, member: true, method: false, mode: false, modernPropertyDecls: false, observeAttribute: true, profile: false, prop: true, propBoolean: false, propMutable: false, propNumber: false, propString: true, reflect: false, scoped: false, scopedSlotTextContentFix: false, scriptDataOpts: false, shadowDelegatesFocus: false, shadowDom: true, slot: false, slotChildNodesFix: false, slotRelocation: false, state: true, style: true, svg: false, taskQueue: true, transformTagName: false, updatable: true, vdomAttribute: true, vdomClass: false, vdomFunctional: true, vdomKey: true, vdomListener: true, vdomPropOrAttr: true, vdomRef: false, vdomRender: true, vdomStyle: false, vdomText: false, vdomXlink: false, watchCallback: true };
|
|
25
25
|
|
|
26
26
|
/*
|
|
27
|
-
Stencil Client Platform v4.
|
|
27
|
+
Stencil Client Platform v4.26.0 | MIT Licensed | https://stenciljs.com
|
|
28
28
|
*/
|
|
29
29
|
var __defProp = Object.defineProperty;
|
|
30
30
|
var __export = (target, all) => {
|
|
31
31
|
for (var name in all)
|
|
32
32
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
33
33
|
};
|
|
34
|
+
|
|
35
|
+
// src/client/client-host-ref.ts
|
|
34
36
|
var hostRefs = /* @__PURE__ */ new WeakMap();
|
|
35
37
|
var getHostRef = (ref) => hostRefs.get(ref);
|
|
36
|
-
var registerInstance = (lazyInstance, hostRef) =>
|
|
38
|
+
var registerInstance = (lazyInstance, hostRef) => {
|
|
39
|
+
hostRefs.set(hostRef.$lazyInstance$ = lazyInstance, hostRef);
|
|
40
|
+
};
|
|
37
41
|
var registerHost = (hostElement, cmpMeta) => {
|
|
38
42
|
const hostRef = {
|
|
39
43
|
$flags$: 0,
|
|
@@ -46,7 +50,8 @@ var registerHost = (hostElement, cmpMeta) => {
|
|
|
46
50
|
hostElement["s-p"] = [];
|
|
47
51
|
hostElement["s-rc"] = [];
|
|
48
52
|
}
|
|
49
|
-
|
|
53
|
+
const ref = hostRefs.set(hostElement, hostRef);
|
|
54
|
+
return ref;
|
|
50
55
|
};
|
|
51
56
|
var isMemberInElement = (elm, memberName) => memberName in elm;
|
|
52
57
|
var consoleError = (e, el) => (0, console.error)(e, el);
|
|
@@ -83,16 +88,22 @@ var loadModule = (cmpMeta, hostRef, hmrVersionId) => {
|
|
|
83
88
|
/* webpackExclude: /\.system\.entry\.js$/ */
|
|
84
89
|
/* webpackMode: "lazy" */
|
|
85
90
|
`./${bundleId}.entry.js${""}`
|
|
86
|
-
)); }).then(
|
|
87
|
-
{
|
|
88
|
-
|
|
91
|
+
)); }).then(
|
|
92
|
+
(importedModule) => {
|
|
93
|
+
{
|
|
94
|
+
cmpModules.set(bundleId, importedModule);
|
|
95
|
+
}
|
|
96
|
+
return importedModule[exportName];
|
|
97
|
+
},
|
|
98
|
+
(e) => {
|
|
99
|
+
consoleError(e, hostRef.$hostElement$);
|
|
89
100
|
}
|
|
90
|
-
|
|
91
|
-
}, consoleError);
|
|
101
|
+
);
|
|
92
102
|
};
|
|
93
103
|
|
|
94
104
|
// src/client/client-style.ts
|
|
95
105
|
var styles = /* @__PURE__ */ new Map();
|
|
106
|
+
var HYDRATED_STYLE_ID = "sty-id";
|
|
96
107
|
var HYDRATED_CSS = "{visibility:hidden}.hydrated{visibility:inherit}";
|
|
97
108
|
var SLOT_FB_CSS = "slot-fb{display:contents}slot-fb[hidden]{display:none}";
|
|
98
109
|
var win = typeof window !== "undefined" ? window : {};
|
|
@@ -150,12 +161,6 @@ var flush = () => {
|
|
|
150
161
|
};
|
|
151
162
|
var nextTick = (cb) => promiseResolve().then(cb);
|
|
152
163
|
var writeTask = /* @__PURE__ */ queueTask(queueDomWrites, true);
|
|
153
|
-
|
|
154
|
-
// src/utils/constants.ts
|
|
155
|
-
var EMPTY_OBJ = {};
|
|
156
|
-
|
|
157
|
-
// src/utils/helpers.ts
|
|
158
|
-
var isDef = (v) => v != null;
|
|
159
164
|
var isComplexType = (o) => {
|
|
160
165
|
o = typeof o;
|
|
161
166
|
return o === "object" || o === "function";
|
|
@@ -369,7 +374,7 @@ var addStyle = (styleContainerNode, cmpMeta, mode) => {
|
|
|
369
374
|
}
|
|
370
375
|
if (!appliedStyles.has(scopeId2)) {
|
|
371
376
|
{
|
|
372
|
-
styleElm = doc.createElement("style");
|
|
377
|
+
styleElm = document.querySelector(`[${HYDRATED_STYLE_ID}="${scopeId2}"]`) || doc.createElement("style");
|
|
373
378
|
styleElm.innerHTML = style;
|
|
374
379
|
const nonce = (_a = plt.$nonce$) != null ? _a : queryNonceMetaTagContent(doc);
|
|
375
380
|
if (nonce != null) {
|
|
@@ -379,7 +384,10 @@ var addStyle = (styleContainerNode, cmpMeta, mode) => {
|
|
|
379
384
|
if (styleContainerNode.nodeName === "HEAD") {
|
|
380
385
|
const preconnectLinks = styleContainerNode.querySelectorAll("link[rel=preconnect]");
|
|
381
386
|
const referenceNode2 = preconnectLinks.length > 0 ? preconnectLinks[preconnectLinks.length - 1].nextSibling : styleContainerNode.querySelector("style");
|
|
382
|
-
styleContainerNode.insertBefore(
|
|
387
|
+
styleContainerNode.insertBefore(
|
|
388
|
+
styleElm,
|
|
389
|
+
(referenceNode2 == null ? void 0 : referenceNode2.parentNode) === styleContainerNode ? referenceNode2 : null
|
|
390
|
+
);
|
|
383
391
|
} else if ("host" in styleContainerNode) {
|
|
384
392
|
if (supportsConstructableStylesheets) {
|
|
385
393
|
const stylesheet = new CSSStyleSheet();
|
|
@@ -397,7 +405,7 @@ var addStyle = (styleContainerNode, cmpMeta, mode) => {
|
|
|
397
405
|
styleContainerNode.append(styleElm);
|
|
398
406
|
}
|
|
399
407
|
}
|
|
400
|
-
if (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */
|
|
408
|
+
if (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
|
|
401
409
|
styleContainerNode.insertBefore(styleElm, null);
|
|
402
410
|
}
|
|
403
411
|
}
|
|
@@ -422,14 +430,14 @@ var attachStyles = (hostRef) => {
|
|
|
422
430
|
const scopeId2 = addStyle(
|
|
423
431
|
elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(),
|
|
424
432
|
cmpMeta);
|
|
425
|
-
if (flags & 10 /* needsScopedEncapsulation */ && flags & 2 /* scopedCssEncapsulation */) {
|
|
433
|
+
if ((flags & 10 /* needsScopedEncapsulation */ && flags & 2 /* scopedCssEncapsulation */ || flags & 128 /* shadowNeedsScopedCss */)) {
|
|
426
434
|
elm["s-sc"] = scopeId2;
|
|
427
435
|
elm.classList.add(scopeId2 + "-h");
|
|
428
436
|
}
|
|
429
437
|
endAttachStyles();
|
|
430
438
|
};
|
|
431
439
|
var getScopeId = (cmp, mode) => "sc-" + (cmp.$tagName$);
|
|
432
|
-
var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
440
|
+
var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags, initialRender) => {
|
|
433
441
|
if (oldValue !== newValue) {
|
|
434
442
|
let isProp = isMemberInElement(elm, memberName);
|
|
435
443
|
let ln = memberName.toLowerCase();
|
|
@@ -466,7 +474,7 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
466
474
|
elm.setAttribute(memberName, n);
|
|
467
475
|
}
|
|
468
476
|
}
|
|
469
|
-
} else {
|
|
477
|
+
} else if (elm[memberName] !== newValue) {
|
|
470
478
|
elm[memberName] = newValue;
|
|
471
479
|
}
|
|
472
480
|
} catch (e) {
|
|
@@ -491,19 +499,31 @@ var CAPTURE_EVENT_SUFFIX = "Capture";
|
|
|
491
499
|
var CAPTURE_EVENT_REGEX = new RegExp(CAPTURE_EVENT_SUFFIX + "$");
|
|
492
500
|
|
|
493
501
|
// src/runtime/vdom/update-element.ts
|
|
494
|
-
var updateElement = (oldVnode, newVnode, isSvgMode2) => {
|
|
502
|
+
var updateElement = (oldVnode, newVnode, isSvgMode2, isInitialRender) => {
|
|
495
503
|
const elm = newVnode.$elm$.nodeType === 11 /* DocumentFragment */ && newVnode.$elm$.host ? newVnode.$elm$.host : newVnode.$elm$;
|
|
496
|
-
const oldVnodeAttrs = oldVnode && oldVnode.$attrs$ ||
|
|
497
|
-
const newVnodeAttrs = newVnode.$attrs$ ||
|
|
504
|
+
const oldVnodeAttrs = oldVnode && oldVnode.$attrs$ || {};
|
|
505
|
+
const newVnodeAttrs = newVnode.$attrs$ || {};
|
|
498
506
|
{
|
|
499
507
|
for (const memberName of sortedAttrNames(Object.keys(oldVnodeAttrs))) {
|
|
500
508
|
if (!(memberName in newVnodeAttrs)) {
|
|
501
|
-
setAccessor(
|
|
509
|
+
setAccessor(
|
|
510
|
+
elm,
|
|
511
|
+
memberName,
|
|
512
|
+
oldVnodeAttrs[memberName],
|
|
513
|
+
void 0,
|
|
514
|
+
isSvgMode2,
|
|
515
|
+
newVnode.$flags$);
|
|
502
516
|
}
|
|
503
517
|
}
|
|
504
518
|
}
|
|
505
519
|
for (const memberName of sortedAttrNames(Object.keys(newVnodeAttrs))) {
|
|
506
|
-
setAccessor(
|
|
520
|
+
setAccessor(
|
|
521
|
+
elm,
|
|
522
|
+
memberName,
|
|
523
|
+
oldVnodeAttrs[memberName],
|
|
524
|
+
newVnodeAttrs[memberName],
|
|
525
|
+
isSvgMode2,
|
|
526
|
+
newVnode.$flags$);
|
|
507
527
|
}
|
|
508
528
|
};
|
|
509
529
|
function sortedAttrNames(attrNames) {
|
|
@@ -515,13 +535,10 @@ function sortedAttrNames(attrNames) {
|
|
|
515
535
|
attrNames
|
|
516
536
|
);
|
|
517
537
|
}
|
|
518
|
-
|
|
519
|
-
// src/runtime/vdom/vdom-render.ts
|
|
520
|
-
var scopeId;
|
|
521
538
|
var hostTagName;
|
|
522
539
|
var useNativeShadowDom = false;
|
|
523
540
|
var isSvgMode = false;
|
|
524
|
-
var createElm = (oldParentVNode, newParentVNode, childIndex
|
|
541
|
+
var createElm = (oldParentVNode, newParentVNode, childIndex) => {
|
|
525
542
|
const newVNode2 = newParentVNode.$children$[childIndex];
|
|
526
543
|
let i2 = 0;
|
|
527
544
|
let elm;
|
|
@@ -533,11 +550,6 @@ var createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
|
533
550
|
{
|
|
534
551
|
updateElement(null, newVNode2, isSvgMode);
|
|
535
552
|
}
|
|
536
|
-
const rootNode = elm.getRootNode();
|
|
537
|
-
const isElementWithinShadowRoot = !rootNode.querySelector("body");
|
|
538
|
-
if (!isElementWithinShadowRoot && BUILD.scoped && isDef(scopeId) && elm["s-si"] !== scopeId) {
|
|
539
|
-
elm.classList.add(elm["s-si"] = scopeId);
|
|
540
|
-
}
|
|
541
553
|
if (newVNode2.$children$) {
|
|
542
554
|
for (i2 = 0; i2 < newVNode2.$children$.length; ++i2) {
|
|
543
555
|
childNode = createElm(oldParentVNode, newVNode2, i2);
|
|
@@ -666,6 +678,9 @@ var isSameVnode = (leftVNode, rightVNode, isInitialRender = false) => {
|
|
|
666
678
|
if (!isInitialRender) {
|
|
667
679
|
return leftVNode.$key$ === rightVNode.$key$;
|
|
668
680
|
}
|
|
681
|
+
if (isInitialRender && !leftVNode.$key$ && rightVNode.$key$) {
|
|
682
|
+
leftVNode.$key$ = rightVNode.$key$;
|
|
683
|
+
}
|
|
669
684
|
return true;
|
|
670
685
|
}
|
|
671
686
|
return false;
|
|
@@ -693,8 +708,9 @@ var patch = (oldVNode, newVNode2, isInitialRender = false) => {
|
|
|
693
708
|
}
|
|
694
709
|
};
|
|
695
710
|
var insertBefore = (parent, newNode, reference) => {
|
|
696
|
-
|
|
697
|
-
|
|
711
|
+
{
|
|
712
|
+
return parent == null ? void 0 : parent.insertBefore(newNode, reference);
|
|
713
|
+
}
|
|
698
714
|
};
|
|
699
715
|
var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
|
|
700
716
|
const hostElm = hostRef.$hostElement$;
|
|
@@ -713,17 +729,21 @@ var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
|
|
|
713
729
|
rootVnode.$flags$ |= 4 /* isHost */;
|
|
714
730
|
hostRef.$vnode$ = rootVnode;
|
|
715
731
|
rootVnode.$elm$ = oldVNode.$elm$ = hostElm.shadowRoot || hostElm ;
|
|
716
|
-
|
|
717
|
-
scopeId = hostElm["s-sc"];
|
|
718
|
-
}
|
|
719
|
-
useNativeShadowDom = (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) !== 0;
|
|
732
|
+
useNativeShadowDom = !!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) && !(cmpMeta.$flags$ & 128 /* shadowNeedsScopedCss */);
|
|
720
733
|
patch(oldVNode, rootVnode, isInitialLoad);
|
|
721
734
|
};
|
|
722
735
|
|
|
723
736
|
// src/runtime/update-component.ts
|
|
724
737
|
var attachToAncestor = (hostRef, ancestorComponent) => {
|
|
725
738
|
if (ancestorComponent && !hostRef.$onRenderResolve$ && ancestorComponent["s-p"]) {
|
|
726
|
-
ancestorComponent["s-p"].push(
|
|
739
|
+
const index = ancestorComponent["s-p"].push(
|
|
740
|
+
new Promise(
|
|
741
|
+
(r) => hostRef.$onRenderResolve$ = () => {
|
|
742
|
+
ancestorComponent["s-p"].splice(index - 1, 1);
|
|
743
|
+
r();
|
|
744
|
+
}
|
|
745
|
+
)
|
|
746
|
+
);
|
|
727
747
|
}
|
|
728
748
|
};
|
|
729
749
|
var scheduleUpdate = (hostRef, isInitialLoad) => {
|
|
@@ -750,7 +770,7 @@ var dispatchHooks = (hostRef, isInitialLoad) => {
|
|
|
750
770
|
let maybePromise;
|
|
751
771
|
if (isInitialLoad) {
|
|
752
772
|
{
|
|
753
|
-
maybePromise = safeCall(instance, "componentWillLoad");
|
|
773
|
+
maybePromise = safeCall(instance, "componentWillLoad", void 0, elm);
|
|
754
774
|
}
|
|
755
775
|
}
|
|
756
776
|
endSchedule();
|
|
@@ -824,7 +844,7 @@ var postUpdateComponent = (hostRef) => {
|
|
|
824
844
|
addHydratedFlag(elm);
|
|
825
845
|
}
|
|
826
846
|
{
|
|
827
|
-
safeCall(instance, "componentDidLoad");
|
|
847
|
+
safeCall(instance, "componentDidLoad", void 0, elm);
|
|
828
848
|
}
|
|
829
849
|
endPostUpdate();
|
|
830
850
|
{
|
|
@@ -848,17 +868,14 @@ var postUpdateComponent = (hostRef) => {
|
|
|
848
868
|
}
|
|
849
869
|
};
|
|
850
870
|
var appDidLoad = (who) => {
|
|
851
|
-
{
|
|
852
|
-
addHydratedFlag(doc.documentElement);
|
|
853
|
-
}
|
|
854
871
|
nextTick(() => emitEvent(win, "appload", { detail: { namespace: NAMESPACE } }));
|
|
855
872
|
};
|
|
856
|
-
var safeCall = (instance, method, arg) => {
|
|
873
|
+
var safeCall = (instance, method, arg, elm) => {
|
|
857
874
|
if (instance && instance[method]) {
|
|
858
875
|
try {
|
|
859
876
|
return instance[method](arg);
|
|
860
877
|
} catch (e) {
|
|
861
|
-
consoleError(e);
|
|
878
|
+
consoleError(e, elm);
|
|
862
879
|
}
|
|
863
880
|
}
|
|
864
881
|
return void 0;
|
|
@@ -922,15 +939,68 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
922
939
|
const members = Object.entries((_a = cmpMeta.$members$) != null ? _a : {});
|
|
923
940
|
members.map(([memberName, [memberFlags]]) => {
|
|
924
941
|
if ((memberFlags & 31 /* Prop */ || (flags & 2 /* proxyState */) && memberFlags & 32 /* State */)) {
|
|
942
|
+
const { get: origGetter, set: origSetter } = Object.getOwnPropertyDescriptor(prototype, memberName) || {};
|
|
943
|
+
if (origGetter) cmpMeta.$members$[memberName][0] |= 2048 /* Getter */;
|
|
944
|
+
if (origSetter) cmpMeta.$members$[memberName][0] |= 4096 /* Setter */;
|
|
945
|
+
if (flags & 1 /* isElementConstructor */ || !origGetter) {
|
|
946
|
+
Object.defineProperty(prototype, memberName, {
|
|
947
|
+
get() {
|
|
948
|
+
{
|
|
949
|
+
if ((cmpMeta.$members$[memberName][0] & 2048 /* Getter */) === 0) {
|
|
950
|
+
return getValue(this, memberName);
|
|
951
|
+
}
|
|
952
|
+
const ref = getHostRef(this);
|
|
953
|
+
const instance = ref ? ref.$lazyInstance$ : prototype;
|
|
954
|
+
if (!instance) return;
|
|
955
|
+
return instance[memberName];
|
|
956
|
+
}
|
|
957
|
+
},
|
|
958
|
+
configurable: true,
|
|
959
|
+
enumerable: true
|
|
960
|
+
});
|
|
961
|
+
}
|
|
925
962
|
Object.defineProperty(prototype, memberName, {
|
|
926
|
-
get() {
|
|
927
|
-
return getValue(this, memberName);
|
|
928
|
-
},
|
|
929
963
|
set(newValue) {
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
964
|
+
const ref = getHostRef(this);
|
|
965
|
+
if (origSetter) {
|
|
966
|
+
const currentValue = memberFlags & 32 /* State */ ? this[memberName] : ref.$hostElement$[memberName];
|
|
967
|
+
if (typeof currentValue === "undefined" && ref.$instanceValues$.get(memberName)) {
|
|
968
|
+
newValue = ref.$instanceValues$.get(memberName);
|
|
969
|
+
} else if (!ref.$instanceValues$.get(memberName) && currentValue) {
|
|
970
|
+
ref.$instanceValues$.set(memberName, currentValue);
|
|
971
|
+
}
|
|
972
|
+
origSetter.apply(this, [parsePropertyValue(newValue, memberFlags)]);
|
|
973
|
+
newValue = memberFlags & 32 /* State */ ? this[memberName] : ref.$hostElement$[memberName];
|
|
974
|
+
setValue(this, memberName, newValue, cmpMeta);
|
|
975
|
+
return;
|
|
976
|
+
}
|
|
977
|
+
{
|
|
978
|
+
if ((flags & 1 /* isElementConstructor */) === 0 || (cmpMeta.$members$[memberName][0] & 4096 /* Setter */) === 0) {
|
|
979
|
+
setValue(this, memberName, newValue, cmpMeta);
|
|
980
|
+
if (flags & 1 /* isElementConstructor */ && !ref.$lazyInstance$) {
|
|
981
|
+
ref.$onReadyPromise$.then(() => {
|
|
982
|
+
if (cmpMeta.$members$[memberName][0] & 4096 /* Setter */ && ref.$lazyInstance$[memberName] !== ref.$instanceValues$.get(memberName)) {
|
|
983
|
+
ref.$lazyInstance$[memberName] = newValue;
|
|
984
|
+
}
|
|
985
|
+
});
|
|
986
|
+
}
|
|
987
|
+
return;
|
|
988
|
+
}
|
|
989
|
+
const setterSetVal = () => {
|
|
990
|
+
const currentValue = ref.$lazyInstance$[memberName];
|
|
991
|
+
if (!ref.$instanceValues$.get(memberName) && currentValue) {
|
|
992
|
+
ref.$instanceValues$.set(memberName, currentValue);
|
|
993
|
+
}
|
|
994
|
+
ref.$lazyInstance$[memberName] = parsePropertyValue(newValue, memberFlags);
|
|
995
|
+
setValue(this, memberName, ref.$lazyInstance$[memberName], cmpMeta);
|
|
996
|
+
};
|
|
997
|
+
if (ref.$lazyInstance$) {
|
|
998
|
+
setterSetVal();
|
|
999
|
+
} else {
|
|
1000
|
+
ref.$onReadyPromise$.then(() => setterSetVal());
|
|
1001
|
+
}
|
|
1002
|
+
}
|
|
1003
|
+
}
|
|
934
1004
|
});
|
|
935
1005
|
}
|
|
936
1006
|
});
|
|
@@ -940,7 +1010,7 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
940
1010
|
plt.jmp(() => {
|
|
941
1011
|
var _a2;
|
|
942
1012
|
const propName = attrNameToPropName.get(attrName);
|
|
943
|
-
if (this.hasOwnProperty(propName)) {
|
|
1013
|
+
if (this.hasOwnProperty(propName) && BUILD.lazyLoad) {
|
|
944
1014
|
newValue = this[propName];
|
|
945
1015
|
delete this[propName];
|
|
946
1016
|
} else if (prototype.hasOwnProperty(propName) && typeof this[propName] === "number" && // cast type to number to avoid TS compiler issues
|
|
@@ -960,7 +1030,11 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
960
1030
|
}
|
|
961
1031
|
return;
|
|
962
1032
|
}
|
|
963
|
-
|
|
1033
|
+
const propDesc = Object.getOwnPropertyDescriptor(prototype, propName);
|
|
1034
|
+
newValue = newValue === null && typeof this[propName] === "boolean" ? false : newValue;
|
|
1035
|
+
if (newValue !== this[propName] && (!propDesc.get || !!propDesc.set)) {
|
|
1036
|
+
this[propName] = newValue;
|
|
1037
|
+
}
|
|
964
1038
|
});
|
|
965
1039
|
};
|
|
966
1040
|
Cstr.observedAttributes = Array.from(
|
|
@@ -985,7 +1059,7 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
|
|
|
985
1059
|
hostRef.$flags$ |= 32 /* hasInitializedComponent */;
|
|
986
1060
|
const bundleId = cmpMeta.$lazyBundleId$;
|
|
987
1061
|
if (bundleId) {
|
|
988
|
-
const CstrImport = loadModule(cmpMeta);
|
|
1062
|
+
const CstrImport = loadModule(cmpMeta, hostRef);
|
|
989
1063
|
if (CstrImport && "then" in CstrImport) {
|
|
990
1064
|
const endLoad = uniqueTime();
|
|
991
1065
|
Cstr = await CstrImport;
|
|
@@ -1010,7 +1084,7 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
|
|
|
1010
1084
|
try {
|
|
1011
1085
|
new Cstr(hostRef);
|
|
1012
1086
|
} catch (e) {
|
|
1013
|
-
consoleError(e);
|
|
1087
|
+
consoleError(e, elm);
|
|
1014
1088
|
}
|
|
1015
1089
|
{
|
|
1016
1090
|
hostRef.$flags$ &= ~8 /* isConstructingInstance */;
|
|
@@ -1045,7 +1119,7 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
|
|
|
1045
1119
|
schedule();
|
|
1046
1120
|
}
|
|
1047
1121
|
};
|
|
1048
|
-
var fireConnectedCallback = (instance) => {
|
|
1122
|
+
var fireConnectedCallback = (instance, elm) => {
|
|
1049
1123
|
};
|
|
1050
1124
|
|
|
1051
1125
|
// src/runtime/connected-callback.ts
|
|
@@ -1085,7 +1159,7 @@ var connectedCallback = (elm) => {
|
|
|
1085
1159
|
endConnected();
|
|
1086
1160
|
}
|
|
1087
1161
|
};
|
|
1088
|
-
var disconnectInstance = (instance) => {
|
|
1162
|
+
var disconnectInstance = (instance, elm) => {
|
|
1089
1163
|
};
|
|
1090
1164
|
var disconnectedCallback = async (elm) => {
|
|
1091
1165
|
if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
|
|
@@ -1094,6 +1168,12 @@ var disconnectedCallback = async (elm) => {
|
|
|
1094
1168
|
hostRef.$onReadyPromise$.then(() => disconnectInstance());
|
|
1095
1169
|
}
|
|
1096
1170
|
}
|
|
1171
|
+
if (rootAppliedStyles.has(elm)) {
|
|
1172
|
+
rootAppliedStyles.delete(elm);
|
|
1173
|
+
}
|
|
1174
|
+
if (elm.shadowRoot && rootAppliedStyles.has(elm.shadowRoot)) {
|
|
1175
|
+
rootAppliedStyles.delete(elm.shadowRoot);
|
|
1176
|
+
}
|
|
1097
1177
|
};
|
|
1098
1178
|
|
|
1099
1179
|
// src/runtime/bootstrap-lazy.ts
|
|
@@ -1171,6 +1251,17 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
1171
1251
|
}
|
|
1172
1252
|
disconnectedCallback() {
|
|
1173
1253
|
plt.jmp(() => disconnectedCallback(this));
|
|
1254
|
+
plt.raf(() => {
|
|
1255
|
+
var _a3;
|
|
1256
|
+
const hostRef = getHostRef(this);
|
|
1257
|
+
const i2 = deferredConnectedCallbacks.findIndex((host) => host === this);
|
|
1258
|
+
if (i2 > -1) {
|
|
1259
|
+
deferredConnectedCallbacks.splice(i2, 1);
|
|
1260
|
+
}
|
|
1261
|
+
if (((_a3 = hostRef == null ? void 0 : hostRef.$vnode$) == null ? void 0 : _a3.$elm$) instanceof Node && !hostRef.$vnode$.$elm$.isConnected) {
|
|
1262
|
+
delete hostRef.$vnode$.$elm$;
|
|
1263
|
+
}
|
|
1264
|
+
});
|
|
1174
1265
|
}
|
|
1175
1266
|
componentOnReady() {
|
|
1176
1267
|
return getHostRef(this).$onReadyPromise$;
|
package/dist/cjs/loader.cjs.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
5
|
+
const index = require('./index-2c9f83af.js');
|
|
6
6
|
const appGlobals = require('./app-globals-3a1e7e63.js');
|
|
7
7
|
|
|
8
8
|
const defineCustomElements = async (win, options) => {
|
|
@@ -2,7 +2,38 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
5
|
+
const index = require('./index-2c9f83af.js');
|
|
6
|
+
|
|
7
|
+
/******************************************************************************
|
|
8
|
+
Copyright (c) Microsoft Corporation.
|
|
9
|
+
|
|
10
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
11
|
+
purpose with or without fee is hereby granted.
|
|
12
|
+
|
|
13
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
14
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
15
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
16
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
17
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
18
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
19
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
20
|
+
***************************************************************************** */
|
|
21
|
+
|
|
22
|
+
function __decorate(decorators, target, key, desc) {
|
|
23
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
24
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
25
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
26
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
function __metadata(metadataKey, metadataValue) {
|
|
30
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
34
|
+
var e = new Error(message);
|
|
35
|
+
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
36
|
+
};
|
|
6
37
|
|
|
7
38
|
const fetcher = async (url) => {
|
|
8
39
|
let res;
|
|
@@ -61,20 +92,154 @@ const Games = ({ text, games, onClickGame }) => (index.h("div", { class: "GamesC
|
|
|
61
92
|
index.h("div", { id: "Games" }, games.map((game) => index.h("div", { class: "Game" },
|
|
62
93
|
index.h("div", Object.assign({ class: "GameImg" }, getProps(game, onClickGame))))))));
|
|
63
94
|
|
|
95
|
+
const apply = (proto, lifecycle, run) => {
|
|
96
|
+
const existLifeCycle = proto[lifecycle];
|
|
97
|
+
if (!existLifeCycle) {
|
|
98
|
+
throw new Error('lifecycle ' + lifecycle + ' not defined');
|
|
99
|
+
}
|
|
100
|
+
proto[lifecycle] = function (...args) {
|
|
101
|
+
run.bind(this, ...args).call();
|
|
102
|
+
if (existLifeCycle) {
|
|
103
|
+
return existLifeCycle.bind(this, ...args).call();
|
|
104
|
+
}
|
|
105
|
+
};
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
const translation = {
|
|
109
|
+
en: {
|
|
110
|
+
MiniGames: 'Mini Games',
|
|
111
|
+
},
|
|
112
|
+
'zh-hk': {
|
|
113
|
+
MiniGames: '小游戲',
|
|
114
|
+
},
|
|
115
|
+
hr: {
|
|
116
|
+
MiniGames: 'Mini igre'
|
|
117
|
+
}
|
|
118
|
+
};
|
|
119
|
+
|
|
120
|
+
const getLocale = (_translations, language) => {
|
|
121
|
+
return _translations[language] || _translations['en'];
|
|
122
|
+
};
|
|
123
|
+
function setLocale() {
|
|
124
|
+
this.locale = getLocale(this.translation, this.language);
|
|
125
|
+
}
|
|
126
|
+
async function setLocaleByUrl(isInit = true) {
|
|
127
|
+
if (this.translationUrl) {
|
|
128
|
+
this.translation = await fetcher(this.translationUrl);
|
|
129
|
+
setLocale.bind(this).call();
|
|
130
|
+
}
|
|
131
|
+
else {
|
|
132
|
+
if (!isInit) {
|
|
133
|
+
this.translation = translation;
|
|
134
|
+
setLocale.bind(this).call();
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
const Locale = () => {
|
|
139
|
+
// @ts-ignore
|
|
140
|
+
return (proto, prop) => {
|
|
141
|
+
apply(proto, 'componentWillLoad', async function () {
|
|
142
|
+
this.translation = translation;
|
|
143
|
+
setLocale.bind(this).call();
|
|
144
|
+
setLocaleByUrl.bind(this, true).call();
|
|
145
|
+
});
|
|
146
|
+
// @ts-ignore
|
|
147
|
+
apply(proto, 'componentShouldUpdate', async function (newValue, oldValue, key) {
|
|
148
|
+
if (key === 'language') {
|
|
149
|
+
setLocale.bind(this).call();
|
|
150
|
+
}
|
|
151
|
+
if (key === 'translationUrl') {
|
|
152
|
+
setLocaleByUrl.bind(this, false).call();
|
|
153
|
+
}
|
|
154
|
+
});
|
|
155
|
+
};
|
|
156
|
+
};
|
|
157
|
+
|
|
158
|
+
const fetchText = async (url) => {
|
|
159
|
+
let styleCode;
|
|
160
|
+
try {
|
|
161
|
+
let res = await fetch(url);
|
|
162
|
+
styleCode = await res.text();
|
|
163
|
+
}
|
|
164
|
+
catch (err) {
|
|
165
|
+
console.error('error ', err);
|
|
166
|
+
}
|
|
167
|
+
return styleCode;
|
|
168
|
+
};
|
|
169
|
+
const setStyle = (container, index, styleCode) => {
|
|
170
|
+
const sheet = new CSSStyleSheet();
|
|
171
|
+
styleCode && sheet.insertRule(styleCode);
|
|
172
|
+
try {
|
|
173
|
+
container.adoptedStyleSheets[index] = sheet;
|
|
174
|
+
}
|
|
175
|
+
catch (err) { }
|
|
176
|
+
};
|
|
177
|
+
const getCode = async (url) => {
|
|
178
|
+
let styleCode;
|
|
179
|
+
if (url) {
|
|
180
|
+
styleCode = await fetchText(url);
|
|
181
|
+
}
|
|
182
|
+
return styleCode;
|
|
183
|
+
};
|
|
184
|
+
const setClientStyling = (root, styleCode) => {
|
|
185
|
+
if (!root)
|
|
186
|
+
return;
|
|
187
|
+
setStyle(root, 1, styleCode);
|
|
188
|
+
};
|
|
189
|
+
const setClientStylingUrl = async (root, url) => {
|
|
190
|
+
if (!root)
|
|
191
|
+
return;
|
|
192
|
+
setStyle(root, 2, await getCode(url));
|
|
193
|
+
};
|
|
194
|
+
|
|
195
|
+
const matchStyleProcess = (root, value, key) => {
|
|
196
|
+
switch (key) {
|
|
197
|
+
case 'clientStyling':
|
|
198
|
+
setClientStyling(root, value);
|
|
199
|
+
break;
|
|
200
|
+
case 'clientStylingUrl':
|
|
201
|
+
setClientStylingUrl(root, value);
|
|
202
|
+
break;
|
|
203
|
+
}
|
|
204
|
+
};
|
|
205
|
+
const Style = () => {
|
|
206
|
+
return (proto, prop) => {
|
|
207
|
+
apply(proto, 'componentDidLoad', function () {
|
|
208
|
+
const root = index.getElement(this).shadowRoot;
|
|
209
|
+
matchStyleProcess(root, this[prop], prop);
|
|
210
|
+
});
|
|
211
|
+
// @ts-ignore
|
|
212
|
+
apply(proto, 'componentShouldUpdate', function (newValue, oldValue, key) {
|
|
213
|
+
if (key !== prop)
|
|
214
|
+
return;
|
|
215
|
+
const root = index.getElement(this).shadowRoot;
|
|
216
|
+
matchStyleProcess(root, this[prop], prop);
|
|
217
|
+
});
|
|
218
|
+
};
|
|
219
|
+
};
|
|
220
|
+
|
|
64
221
|
const miniGamesLobbyCss = ":host{display:block}*{box-sizing:border-box}#LobbyContainer{display:flex;flex-direction:column;flex-grow:1;position:relative}#GameLaunchHeader{align-items:center;display:flex;background:var(--mini-games-header-bg, var(--base-bg, #fff));height:40px;justify-content:space-between;padding:0 15px}#GameLaunchHeader button{border:none;color:inherit;cursor:pointer;outline:0}#GameLaunchHeader .GameIcon--full-screen{margin:0 10px 0 auto}#GameLaunchHeader .GameIcon{background:var(--mini-game-icon-bg, transparent);padding:0}#GamesHeader{align-items:center;display:flex;background:var(--mini-games-header-bg, var(--base-bg, #fff));height:40px;justify-content:space-between;padding:0 15px;color:var(--mini-games-header-color, var(--text, #000))}#GamesHeader button{border:none;color:inherit;cursor:pointer;outline:0}#GamesHeader>div{align-items:center;display:flex}#GamesHeader p{font-weight:600;margin:0 5px}@media (min-width: 340px){#Games{gap:15px;justify-content:center}}#Games{display:inline-flex;flex-wrap:wrap;justify-content:space-between;gap:4px;padding:15px 15px 54px}.Game{width:68px;height:68px;border-radius:50%;box-shadow:0 4px 12px 0 rgba(13, 19, 29, 0.3);cursor:pointer}.GameImg{width:68px;height:68px;background-position:center center;background-size:cover;transition:0.3s}.GameImg:hover{transform:scale(1.5)}";
|
|
65
222
|
const MiniGamesLobbyStyle0 = miniGamesLobbyCss;
|
|
66
223
|
|
|
67
224
|
const MiniGamesLobby = class {
|
|
68
225
|
constructor(hostRef) {
|
|
69
226
|
index.registerInstance(this, hostRef);
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
227
|
+
/**
|
|
228
|
+
* Language of the widget
|
|
229
|
+
*/
|
|
73
230
|
this.language = 'en';
|
|
231
|
+
/**
|
|
232
|
+
* Client custom styling via string
|
|
233
|
+
*/
|
|
74
234
|
this.clientStyling = '';
|
|
235
|
+
/**
|
|
236
|
+
* Client custom styling via url
|
|
237
|
+
*/
|
|
75
238
|
this.clientStylingUrl = '';
|
|
239
|
+
/**
|
|
240
|
+
* translation via url
|
|
241
|
+
*/
|
|
76
242
|
this.translationUrl = '';
|
|
77
|
-
this.locale = undefined;
|
|
78
243
|
this.launchUrl = undefined;
|
|
79
244
|
this.games = [];
|
|
80
245
|
}
|
|
@@ -113,6 +278,18 @@ const MiniGamesLobby = class {
|
|
|
113
278
|
"language": ["updateGames"]
|
|
114
279
|
}; }
|
|
115
280
|
};
|
|
281
|
+
__decorate([
|
|
282
|
+
Locale(),
|
|
283
|
+
__metadata("design:type", String)
|
|
284
|
+
], MiniGamesLobby.prototype, "language", void 0);
|
|
285
|
+
__decorate([
|
|
286
|
+
Style(),
|
|
287
|
+
__metadata("design:type", String)
|
|
288
|
+
], MiniGamesLobby.prototype, "clientStyling", void 0);
|
|
289
|
+
__decorate([
|
|
290
|
+
Style(),
|
|
291
|
+
__metadata("design:type", String)
|
|
292
|
+
], MiniGamesLobby.prototype, "clientStylingUrl", void 0);
|
|
116
293
|
MiniGamesLobby.style = MiniGamesLobbyStyle0;
|
|
117
294
|
|
|
118
295
|
exports.mini_games_lobby = MiniGamesLobby;
|