@everymatrix/ui-image 0.1.1 → 0.2.1
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-bdabfcc4.js → index-e835971b.js} +41 -6
- package/dist/cjs/index.cjs.js +2 -2
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/{ui-image-e059fe64.js → ui-image-008021e8.js} +6 -8
- package/dist/cjs/ui-image.cjs.js +2 -2
- package/dist/cjs/ui-image_2.cjs.entry.js +175 -0
- package/dist/collection/collection-manifest.json +8 -1
- package/dist/collection/components/ui-image/ui-image.css +10 -1
- package/dist/collection/components/ui-image/ui-image.js +6 -25
- package/dist/esm/{index-b7bbd57e.js → index-97d17652.js} +41 -7
- package/dist/esm/index.js +2 -2
- package/dist/esm/loader.js +3 -3
- package/dist/esm/{ui-image-38c3c15f.js → ui-image-3911756b.js} +6 -8
- package/dist/esm/ui-image.js +3 -3
- package/dist/esm/ui-image_2.entry.js +170 -0
- package/dist/storybook/main.js +30 -4
- package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/ui-image/.stencil/libs/common/src/storybook/storybook-utils.d.ts +39 -0
- package/dist/types/components/ui-image/ui-image.d.ts +1 -2
- package/dist/types/components.d.ts +0 -8
- package/dist/ui-image/index.esm.js +1 -1
- package/dist/ui-image/p-381d4568.js +2 -0
- package/dist/ui-image/p-40c68e79.entry.js +1 -0
- package/dist/ui-image/p-de18b4b5.js +1 -0
- package/dist/ui-image/ui-image.esm.js +1 -1
- package/package.json +2 -2
- package/dist/cjs/ui-image.cjs.entry.js +0 -10
- package/dist/esm/ui-image.entry.js +0 -2
- package/dist/ui-image/p-37874c44.js +0 -1
- package/dist/ui-image/p-864b3ce6.js +0 -2
- package/dist/ui-image/p-9da68072.entry.js +0 -1
|
@@ -21,7 +21,7 @@ function _interopNamespace(e) {
|
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
const NAMESPACE = 'ui-image';
|
|
24
|
-
const BUILD = /* ui-image */ { allRenderFn: true, appendChildSlotFix: false, asyncLoading: true, asyncQueue: false, attachStyles: true, cloneNodeFix: false, cmpDidLoad: true, cmpDidRender: false, cmpDidUnload: false, cmpDidUpdate: false, cmpShouldUpdate: false, cmpWillLoad: false, 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:
|
|
24
|
+
const BUILD = /* ui-image */ { allRenderFn: true, appendChildSlotFix: false, asyncLoading: true, asyncQueue: false, attachStyles: true, cloneNodeFix: false, cmpDidLoad: true, cmpDidRender: false, cmpDidUnload: false, cmpDidUpdate: false, cmpShouldUpdate: false, cmpWillLoad: false, 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: true, propMutable: false, propNumber: true, propString: true, reflect: false, scoped: false, scopedSlotTextContentFix: false, scriptDataOpts: false, shadowDelegatesFocus: false, shadowDom: false, slot: false, slotChildNodesFix: false, slotRelocation: false, state: true, style: true, svg: false, taskQueue: true, transformTagName: false, updatable: true, vdomAttribute: true, vdomClass: true, vdomFunctional: false, vdomKey: true, vdomListener: true, vdomPropOrAttr: true, vdomRef: true, vdomRender: true, vdomStyle: true, vdomText: true, vdomXlink: false, watchCallback: true };
|
|
25
25
|
|
|
26
26
|
/*
|
|
27
27
|
Stencil Client Platform v4.19.2 | MIT Licensed | https://stenciljs.com
|
|
@@ -71,10 +71,10 @@ var loadModule = (cmpMeta, hostRef, hmrVersionId) => {
|
|
|
71
71
|
}
|
|
72
72
|
switch(bundleId) {
|
|
73
73
|
|
|
74
|
-
case 'ui-
|
|
74
|
+
case 'ui-image_2.cjs':
|
|
75
75
|
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
76
76
|
/* webpackMode: "lazy" */
|
|
77
|
-
'./ui-
|
|
77
|
+
'./ui-image_2.cjs.entry.js')); }).then(processMod, consoleError);
|
|
78
78
|
}
|
|
79
79
|
}
|
|
80
80
|
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
@@ -293,6 +293,12 @@ var Host = {};
|
|
|
293
293
|
var isHost = (node) => node && node.$tag$ === Host;
|
|
294
294
|
var parsePropertyValue = (propValue, propType) => {
|
|
295
295
|
if (propValue != null && !isComplexType(propValue)) {
|
|
296
|
+
if (propType & 4 /* Boolean */) {
|
|
297
|
+
return propValue === "false" ? false : propValue === "" || !!propValue;
|
|
298
|
+
}
|
|
299
|
+
if (propType & 2 /* Number */) {
|
|
300
|
+
return parseFloat(propValue);
|
|
301
|
+
}
|
|
296
302
|
if (propType & 1 /* String */) {
|
|
297
303
|
return String(propValue);
|
|
298
304
|
}
|
|
@@ -370,7 +376,7 @@ var getScopeId = (cmp, mode) => "sc-" + (cmp.$tagName$);
|
|
|
370
376
|
var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
371
377
|
if (oldValue !== newValue) {
|
|
372
378
|
let isProp = isMemberInElement(elm, memberName);
|
|
373
|
-
memberName.toLowerCase();
|
|
379
|
+
let ln = memberName.toLowerCase();
|
|
374
380
|
if (memberName === "class") {
|
|
375
381
|
const classList = elm.classList;
|
|
376
382
|
const oldClasses = parseClassList(oldValue);
|
|
@@ -402,6 +408,24 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
402
408
|
if (newValue) {
|
|
403
409
|
newValue(elm);
|
|
404
410
|
}
|
|
411
|
+
} else if ((!isProp ) && memberName[0] === "o" && memberName[1] === "n") {
|
|
412
|
+
if (memberName[2] === "-") {
|
|
413
|
+
memberName = memberName.slice(3);
|
|
414
|
+
} else if (isMemberInElement(win, ln)) {
|
|
415
|
+
memberName = ln.slice(2);
|
|
416
|
+
} else {
|
|
417
|
+
memberName = ln[2] + memberName.slice(3);
|
|
418
|
+
}
|
|
419
|
+
if (oldValue || newValue) {
|
|
420
|
+
const capture = memberName.endsWith(CAPTURE_EVENT_SUFFIX);
|
|
421
|
+
memberName = memberName.replace(CAPTURE_EVENT_REGEX, "");
|
|
422
|
+
if (oldValue) {
|
|
423
|
+
plt.rel(elm, memberName, oldValue, capture);
|
|
424
|
+
}
|
|
425
|
+
if (newValue) {
|
|
426
|
+
plt.ael(elm, memberName, newValue, capture);
|
|
427
|
+
}
|
|
428
|
+
}
|
|
405
429
|
} else {
|
|
406
430
|
const isComplex = isComplexType(newValue);
|
|
407
431
|
if ((isProp || isComplex && newValue !== null) && !isSvg) {
|
|
@@ -436,6 +460,8 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
436
460
|
};
|
|
437
461
|
var parseClassListRegex = /\s/;
|
|
438
462
|
var parseClassList = (value) => !value ? [] : value.split(parseClassListRegex);
|
|
463
|
+
var CAPTURE_EVENT_SUFFIX = "Capture";
|
|
464
|
+
var CAPTURE_EVENT_REGEX = new RegExp(CAPTURE_EVENT_SUFFIX + "$");
|
|
439
465
|
|
|
440
466
|
// src/runtime/vdom/update-element.ts
|
|
441
467
|
var updateElement = (oldVnode, newVnode, isSvgMode2) => {
|
|
@@ -470,7 +496,9 @@ var createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
|
470
496
|
let i2 = 0;
|
|
471
497
|
let elm;
|
|
472
498
|
let childNode;
|
|
473
|
-
{
|
|
499
|
+
if (newVNode2.$text$ !== null) {
|
|
500
|
+
elm = newVNode2.$elm$ = doc.createTextNode(newVNode2.$text$);
|
|
501
|
+
} else {
|
|
474
502
|
elm = newVNode2.$elm$ = doc.createElement(
|
|
475
503
|
!useNativeShadowDom && BUILD.slotRelocation && newVNode2.$flags$ & 2 /* isSlotFallback */ ? "slot-fb" : newVNode2.$tag$
|
|
476
504
|
);
|
|
@@ -611,7 +639,8 @@ var patch = (oldVNode, newVNode2, isInitialRender = false) => {
|
|
|
611
639
|
const elm = newVNode2.$elm$ = oldVNode.$elm$;
|
|
612
640
|
const oldChildren = oldVNode.$children$;
|
|
613
641
|
const newChildren = newVNode2.$children$;
|
|
614
|
-
|
|
642
|
+
const text = newVNode2.$text$;
|
|
643
|
+
if (text === null) {
|
|
615
644
|
{
|
|
616
645
|
{
|
|
617
646
|
updateElement(oldVNode, newVNode2, isSvgMode);
|
|
@@ -620,10 +649,15 @@ var patch = (oldVNode, newVNode2, isInitialRender = false) => {
|
|
|
620
649
|
if (oldChildren !== null && newChildren !== null) {
|
|
621
650
|
updateChildren(elm, oldChildren, newVNode2, newChildren, isInitialRender);
|
|
622
651
|
} else if (newChildren !== null) {
|
|
652
|
+
if (oldVNode.$text$ !== null) {
|
|
653
|
+
elm.textContent = "";
|
|
654
|
+
}
|
|
623
655
|
addVnodes(elm, null, newVNode2, newChildren, 0, newChildren.length - 1);
|
|
624
656
|
} else if (oldChildren !== null) {
|
|
625
657
|
removeVnodes(oldChildren, 0, oldChildren.length - 1);
|
|
626
658
|
}
|
|
659
|
+
} else if (oldVNode.$text$ !== text) {
|
|
660
|
+
elm.data = text;
|
|
627
661
|
}
|
|
628
662
|
};
|
|
629
663
|
var nullifyVNodeRefs = (vNode) => {
|
|
@@ -1126,6 +1160,7 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
1126
1160
|
// src/runtime/nonce.ts
|
|
1127
1161
|
var setNonce = (nonce) => plt.$nonce$ = nonce;
|
|
1128
1162
|
|
|
1163
|
+
exports.Host = Host;
|
|
1129
1164
|
exports.bootstrapLazy = bootstrapLazy;
|
|
1130
1165
|
exports.getElement = getElement;
|
|
1131
1166
|
exports.h = h;
|
package/dist/cjs/index.cjs.js
CHANGED
package/dist/cjs/loader.cjs.js
CHANGED
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
5
|
+
const index = require('./index-e835971b.js');
|
|
6
6
|
const appGlobals = require('./app-globals-3a1e7e63.js');
|
|
7
7
|
|
|
8
8
|
const defineCustomElements = async (win, options) => {
|
|
9
9
|
if (typeof window === 'undefined') return undefined;
|
|
10
10
|
await appGlobals.globalScripts();
|
|
11
|
-
return index.bootstrapLazy([["ui-
|
|
11
|
+
return index.bootstrapLazy([["ui-image_2.cjs",[[0,"ui-image",{"src":[1],"width":[1],"height":[1],"alt":[1],"styles":[8],"detectDistance":[1,"detect-distance"],"imgLoaded":[32],"shouldLoad":[32]},null,{"src":["handleSrc"]}],[0,"ui-skeleton",{"structure":[1],"width":[1],"height":[1],"borderRadius":[2,"border-radius"],"marginBottom":[2,"margin-bottom"],"marginTop":[2,"margin-top"],"marginLeft":[2,"margin-left"],"marginRight":[2,"margin-right"],"animation":[4],"rows":[2],"size":[1],"color":[1],"primaryColor":[1,"primary-color"],"secondaryColor":[1,"secondary-color"]},null,{"structure":["handleStructureChange"]}]]]], options);
|
|
12
12
|
};
|
|
13
13
|
|
|
14
14
|
exports.setNonce = index.setNonce;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const index = require('./index-
|
|
3
|
+
const index = require('./index-e835971b.js');
|
|
4
4
|
|
|
5
|
-
const uiImageCss = "
|
|
5
|
+
const uiImageCss = ".HostContainer{display:block}.UiContainer{height:100%;width:100%;border-radius:inherit}.UiContainer .Image{border-radius:inherit}.Hidden{opacity:0;transition:opacity 0.5s ease-in-out}.Visible{opacity:1;transition:opacity 0.5s ease-in-out}";
|
|
6
6
|
const UiImageStyle0 = uiImageCss;
|
|
7
7
|
|
|
8
8
|
const UiImage = class {
|
|
@@ -12,7 +12,6 @@ const UiImage = class {
|
|
|
12
12
|
this.width = undefined;
|
|
13
13
|
this.height = undefined;
|
|
14
14
|
this.alt = undefined;
|
|
15
|
-
this.imgClass = '';
|
|
16
15
|
this.styles = undefined;
|
|
17
16
|
this.detectDistance = '200px';
|
|
18
17
|
this.imgLoaded = false;
|
|
@@ -22,15 +21,14 @@ const UiImage = class {
|
|
|
22
21
|
if (!this.shouldLoad) {
|
|
23
22
|
return;
|
|
24
23
|
}
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
-
tempImage.onload = () => {
|
|
24
|
+
const preloadedImage = new Image();
|
|
25
|
+
preloadedImage.onload = () => {
|
|
28
26
|
if (this.image) {
|
|
29
27
|
this.image.src = this.src;
|
|
30
28
|
this.imgLoaded = true;
|
|
31
|
-
this.el.dispatchEvent(new CustomEvent('load', { bubbles: true }));
|
|
32
29
|
}
|
|
33
30
|
};
|
|
31
|
+
preloadedImage.src = this.src;
|
|
34
32
|
}
|
|
35
33
|
componentDidLoad() {
|
|
36
34
|
if ('IntersectionObserver' in window) {
|
|
@@ -57,7 +55,7 @@ const UiImage = class {
|
|
|
57
55
|
}
|
|
58
56
|
}
|
|
59
57
|
render() {
|
|
60
|
-
return (index.h("img", { key: '
|
|
58
|
+
return (index.h(index.Host, { key: '527318220c6b48375943e897fe0e53e0f33e67ed', class: "HostContainer" }, !this.imgLoaded && (index.h("ui-skeleton", { key: 'e5c49a781ff2fac5c796cb6a3f8d334dce7be35b', class: "UiContainer", structure: "image", width: "100%", height: "100%" })), index.h("img", { key: '09dfbf8f52c2c899246590790f2780a84bdeefc3', ref: (el) => (this.image = el), src: this.shouldLoad ? this.src : undefined, onLoad: () => (this.imgLoaded = true), style: this.styles, class: `UiContainer ${this.imgLoaded ? 'Visible' : 'Hidden'}`, alt: this.alt, width: this.width, height: this.height, loading: "lazy" })));
|
|
61
59
|
}
|
|
62
60
|
get el() { return index.getElement(this); }
|
|
63
61
|
static get watchers() { return {
|
package/dist/cjs/ui-image.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-e835971b.js');
|
|
6
6
|
const appGlobals = require('./app-globals-3a1e7e63.js');
|
|
7
7
|
|
|
8
8
|
/*
|
|
@@ -19,7 +19,7 @@ var patchBrowser = () => {
|
|
|
19
19
|
|
|
20
20
|
patchBrowser().then(async (options) => {
|
|
21
21
|
await appGlobals.globalScripts();
|
|
22
|
-
return index.bootstrapLazy([["ui-
|
|
22
|
+
return index.bootstrapLazy([["ui-image_2.cjs",[[0,"ui-image",{"src":[1],"width":[1],"height":[1],"alt":[1],"styles":[8],"detectDistance":[1,"detect-distance"],"imgLoaded":[32],"shouldLoad":[32]},null,{"src":["handleSrc"]}],[0,"ui-skeleton",{"structure":[1],"width":[1],"height":[1],"borderRadius":[2,"border-radius"],"marginBottom":[2,"margin-bottom"],"marginTop":[2,"margin-top"],"marginLeft":[2,"margin-left"],"marginRight":[2,"margin-right"],"animation":[4],"rows":[2],"size":[1],"color":[1],"primaryColor":[1,"primary-color"],"secondaryColor":[1,"secondary-color"]},null,{"structure":["handleStructureChange"]}]]]], options);
|
|
23
23
|
});
|
|
24
24
|
|
|
25
25
|
exports.setNonce = index.setNonce;
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const uiImage = require('./ui-image-008021e8.js');
|
|
6
|
+
const index = require('./index-e835971b.js');
|
|
7
|
+
|
|
8
|
+
const uiSkeletonCss = ":host{display:block;--emw-skeleton-rectangle-background:#c2c2c2;--emw-skeleton-circle-background:#c2c2c2;--emw-skeleton-text-background:#c2c2c2;--emw-skeleton-title-background:#c2c2c2;--emw-skeleton-image-background:#c2c2c2;--emw-skeleton-logo-background:#c2c2c2;--emw-skeleton-primary-color:#e0e0e0;--emw-skeleton-secondary-color:#f0f0f0}.Skeleton{animation:skeleton-loading 1s linear infinite alternate}.Rectangle{background-color:var(--emw-skeleton-rectangle-background, #c2c2c2);width:var(--emw-skeleton-rectangle-width, 400px);height:var(--emw-skeleton-rectangle-height, 200px);border-radius:var(--emw-skeleton-rectangle-border-radius, 2px)}.Circle{background-color:var(--emw-skeleton-circle-background, #c2c2c2);width:var(--emw-skeleton-circle-size, 400px);height:var(--emw-skeleton-circle-size, 400px);border-radius:50%}.Text{background-color:var(--emw-skeleton-text-background, #c2c2c2);width:var(--emw-skeleton-text-width, 500px);height:var(--emw-skeleton-text-height, 20px);border-radius:var(--emw-skeleton-text-border-radius, 5px);margin-bottom:var(--emw-skeleton-text-margin-bottom, 5px)}.Text:last-child{width:var(--emw-skeleton-text-width-100, 300px)}.Title{background-color:var(--emw-skeleton-title-background, #c2c2c2);width:var(--emw-skeleton-title-width, 300px);height:var(--emw-skeleton-title-height, 30px);border-radius:var(--emw-skeleton-title-border-radius, 5px);margin-bottom:var(--emw-skeleton-title-margin-bottom, 5px)}.Image{background-color:var(--emw-skeleton-image-background, #c2c2c2);width:var(--emw-skeleton-image-width, 100%);height:var(--emw-skeleton-image-height, 100%);border-radius:var(--emw-skeleton-image-border-radius, inherit)}.Logo{background-color:var(--emw-skeleton-logo-background, #c2c2c2);width:var(--emw-skeleton-logo-width, 120px);height:var(--emw-skeleton-logo-height, 75px);border-radius:var(--emw-skeleton-logo-border-radius, 5px)}@keyframes skeleton-loading{0%{background-color:var(--emw-skeleton-primary-color, var(--emw-skeleton-color-0, #c2c2c2))}100%{background-color:var(--emw-skeleton-secondary-color, var(--emw-skeleton-color-100, #f0f0f0))}}";
|
|
9
|
+
const UiSkeletonStyle0 = uiSkeletonCss;
|
|
10
|
+
|
|
11
|
+
const UiSkeleton = class {
|
|
12
|
+
constructor(hostRef) {
|
|
13
|
+
index.registerInstance(this, hostRef);
|
|
14
|
+
this.structure = undefined;
|
|
15
|
+
this.width = undefined;
|
|
16
|
+
this.height = undefined;
|
|
17
|
+
this.borderRadius = undefined;
|
|
18
|
+
this.marginBottom = undefined;
|
|
19
|
+
this.marginTop = undefined;
|
|
20
|
+
this.marginLeft = undefined;
|
|
21
|
+
this.marginRight = undefined;
|
|
22
|
+
this.animation = true;
|
|
23
|
+
this.rows = undefined;
|
|
24
|
+
this.size = undefined;
|
|
25
|
+
this.color = undefined;
|
|
26
|
+
this.primaryColor = undefined;
|
|
27
|
+
this.secondaryColor = undefined;
|
|
28
|
+
}
|
|
29
|
+
handleStructureChange(newValue, oldValue) {
|
|
30
|
+
if (oldValue !== newValue) {
|
|
31
|
+
this.handleStructure(newValue);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
handleStructure(structure) {
|
|
35
|
+
switch (structure) {
|
|
36
|
+
case 'logo':
|
|
37
|
+
return this.renderLogo();
|
|
38
|
+
case 'image':
|
|
39
|
+
return this.renderImage();
|
|
40
|
+
case 'title':
|
|
41
|
+
return this.renderTitle();
|
|
42
|
+
case 'text':
|
|
43
|
+
return this.renderText();
|
|
44
|
+
case 'rectangle':
|
|
45
|
+
return this.renderRectangle();
|
|
46
|
+
case 'circle':
|
|
47
|
+
return this.renderCircle();
|
|
48
|
+
default:
|
|
49
|
+
return null;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
renderLogo() {
|
|
53
|
+
return (index.h("div", { class: "SkeletonContainer" }, index.h("div", { class: "Logo " + (this.animation ? 'Skeleton' : '') })));
|
|
54
|
+
}
|
|
55
|
+
renderImage() {
|
|
56
|
+
return (index.h("div", { class: "Image " + (this.animation ? 'Skeleton' : '') }));
|
|
57
|
+
}
|
|
58
|
+
renderTitle() {
|
|
59
|
+
return (index.h("div", { class: "SkeletonContainer" }, index.h("div", { class: "Title " + (this.animation ? 'Skeleton' : '') })));
|
|
60
|
+
}
|
|
61
|
+
renderText() {
|
|
62
|
+
return (index.h("div", { class: "SkeletonContainer" }, Array.from({ length: this.rows > 0 ? this.rows : 1 }).map((_, index$1) => (index.h("div", { key: index$1, class: "Text " + (this.animation ? 'Skeleton' : '') })))));
|
|
63
|
+
}
|
|
64
|
+
renderRectangle() {
|
|
65
|
+
return (index.h("div", { class: "SkeletonContainer" }, index.h("div", { class: "Rectangle " + (this.animation ? 'Skeleton' : '') })));
|
|
66
|
+
}
|
|
67
|
+
renderCircle() {
|
|
68
|
+
return (index.h("div", { class: "SkeletonContainer" }, index.h("div", { class: "Circle " + (this.animation ? 'Skeleton' : '') })));
|
|
69
|
+
}
|
|
70
|
+
render() {
|
|
71
|
+
let styleBlock = '';
|
|
72
|
+
switch (this.structure) {
|
|
73
|
+
case 'logo':
|
|
74
|
+
styleBlock = `
|
|
75
|
+
:host {
|
|
76
|
+
--emw-skeleton-logo-width: ${this.width};
|
|
77
|
+
--emw-skeleton-logo-height: ${this.height};
|
|
78
|
+
--emw-skeleton-logo-border-radius: ${this.borderRadius}px;
|
|
79
|
+
--emw-skeleton-logo-margin-bottom: ${this.marginBottom}px;
|
|
80
|
+
--emw-skeleton-logo-margin-top: ${this.marginTop}px;
|
|
81
|
+
--emw-skeleton-logo-margin-left: ${this.marginLeft}px;
|
|
82
|
+
--emw-skeleton-logo-margin-right: ${this.marginRight}px;
|
|
83
|
+
--emw-skeleton-logo-background: ${this.color};
|
|
84
|
+
--emw-skeleton-primary-color: ${this.primaryColor};
|
|
85
|
+
--emw-skeleton-secondary-color: ${this.secondaryColor};
|
|
86
|
+
}
|
|
87
|
+
`;
|
|
88
|
+
break;
|
|
89
|
+
case 'image':
|
|
90
|
+
styleBlock = `
|
|
91
|
+
:host {
|
|
92
|
+
--emw-skeleton-image-width: ${this.width};
|
|
93
|
+
--emw-skeleton-image-height: ${this.height};
|
|
94
|
+
--emw-skeleton-image-border-radius: ${this.borderRadius}px;
|
|
95
|
+
--emw-skeleton-image-margin-bottom: ${this.marginBottom}px;
|
|
96
|
+
--emw-skeleton-image-margin-top: ${this.marginTop}px;
|
|
97
|
+
--emw-skeleton-image-margin-left: ${this.marginLeft}px;
|
|
98
|
+
--emw-skeleton-image-margin-right: ${this.marginRight}px;
|
|
99
|
+
--emw-skeleton-image-background: ${this.color};
|
|
100
|
+
--emw-skeleton-primary-color: ${this.primaryColor};
|
|
101
|
+
--emw-skeleton-secondary-color: ${this.secondaryColor};
|
|
102
|
+
}
|
|
103
|
+
`;
|
|
104
|
+
break;
|
|
105
|
+
case 'title':
|
|
106
|
+
styleBlock = `
|
|
107
|
+
:host {
|
|
108
|
+
--emw-skeleton-title-width: ${this.width};
|
|
109
|
+
--emw-skeleton-title-height: ${this.height};
|
|
110
|
+
--emw-skeleton-title-border-radius: ${this.borderRadius}px;
|
|
111
|
+
--emw-skeleton-title-margin-bottom: ${this.marginBottom}px;
|
|
112
|
+
--emw-skeleton-title-margin-top: ${this.marginTop}px;
|
|
113
|
+
--emw-skeleton-title-margin-left: ${this.marginLeft}px;
|
|
114
|
+
--emw-skeleton-title-margin-right: ${this.marginRight}px;
|
|
115
|
+
--emw-skeleton-title-background: ${this.color};
|
|
116
|
+
--emw-skeleton-primary-color: ${this.primaryColor};
|
|
117
|
+
--emw-skeleton-secondary-color: ${this.secondaryColor};
|
|
118
|
+
}
|
|
119
|
+
`;
|
|
120
|
+
break;
|
|
121
|
+
case 'text':
|
|
122
|
+
styleBlock = `
|
|
123
|
+
:host {
|
|
124
|
+
--emw-skeleton-text-width: ${this.width};
|
|
125
|
+
--emw-skeleton-text-height: ${this.height};
|
|
126
|
+
--emw-skeleton-text-border-radius: ${this.borderRadius}px;
|
|
127
|
+
--emw-skeleton-text-margin-bottom: ${this.marginBottom}px;
|
|
128
|
+
--emw-skeleton-text-margin-top: ${this.marginTop}px;
|
|
129
|
+
--emw-skeleton-text-margin-left: ${this.marginLeft}px;
|
|
130
|
+
--emw-skeleton-text-margin-right: ${this.marginRight}px;
|
|
131
|
+
--emw-skeleton-text-background: ${this.color};
|
|
132
|
+
--emw-skeleton-primary-color: ${this.primaryColor};
|
|
133
|
+
--emw-skeleton-secondary-color: ${this.secondaryColor};
|
|
134
|
+
}
|
|
135
|
+
`;
|
|
136
|
+
break;
|
|
137
|
+
case 'rectangle':
|
|
138
|
+
styleBlock = `
|
|
139
|
+
:host {
|
|
140
|
+
--emw-skeleton-rectangle-width: ${this.width};
|
|
141
|
+
--emw-skeleton-rectangle-height: ${this.height};
|
|
142
|
+
--emw-skeleton-rectangle-border-radius: ${this.borderRadius}px;
|
|
143
|
+
--emw-skeleton-rectangle-margin-bottom: ${this.marginBottom}px;
|
|
144
|
+
--emw-skeleton-rectangle-margin-top: ${this.marginTop}px;
|
|
145
|
+
--emw-skeleton-rectangle-margin-left: ${this.marginLeft}px;
|
|
146
|
+
--emw-skeleton-rectangle-margin-right: ${this.marginRight}px;
|
|
147
|
+
--emw-skeleton-rectangle-background: ${this.color};
|
|
148
|
+
--emw-skeleton-primary-color: ${this.primaryColor};
|
|
149
|
+
--emw-skeleton-secondary-color: ${this.secondaryColor};
|
|
150
|
+
}
|
|
151
|
+
`;
|
|
152
|
+
break;
|
|
153
|
+
case 'circle':
|
|
154
|
+
styleBlock = `
|
|
155
|
+
:host {
|
|
156
|
+
--emw-skeleton-circle-size: ${this.size};
|
|
157
|
+
--emw-skeleton-circle-background: ${this.color};
|
|
158
|
+
--emw-skeleton-primary-color: ${this.primaryColor};
|
|
159
|
+
--emw-skeleton-secondary-color: ${this.secondaryColor};
|
|
160
|
+
}
|
|
161
|
+
`;
|
|
162
|
+
break;
|
|
163
|
+
default:
|
|
164
|
+
styleBlock = '';
|
|
165
|
+
}
|
|
166
|
+
return (index.h(index.Host, { key: '3bb792a149db7fe732d5cbfa092cdb4d6ca0689e' }, index.h("style", { key: 'a4607599b60659f385ae2660513e38b383739674' }, styleBlock), this.handleStructure(this.structure)));
|
|
167
|
+
}
|
|
168
|
+
static get watchers() { return {
|
|
169
|
+
"structure": ["handleStructureChange"]
|
|
170
|
+
}; }
|
|
171
|
+
};
|
|
172
|
+
UiSkeleton.style = UiSkeletonStyle0;
|
|
173
|
+
|
|
174
|
+
exports.ui_image = uiImage.UiImage;
|
|
175
|
+
exports.ui_skeleton = UiSkeleton;
|
|
@@ -1,7 +1,16 @@
|
|
|
1
|
-
|
|
1
|
+
.HostContainer {
|
|
2
2
|
display: block;
|
|
3
3
|
}
|
|
4
4
|
|
|
5
|
+
.UiContainer {
|
|
6
|
+
height: 100%;
|
|
7
|
+
width: 100%;
|
|
8
|
+
border-radius: inherit;
|
|
9
|
+
}
|
|
10
|
+
.UiContainer .Image {
|
|
11
|
+
border-radius: inherit;
|
|
12
|
+
}
|
|
13
|
+
|
|
5
14
|
.Hidden {
|
|
6
15
|
opacity: 0;
|
|
7
16
|
transition: opacity 0.5s ease-in-out;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { h } from "@stencil/core";
|
|
1
|
+
import { h, Host } from "@stencil/core";
|
|
2
|
+
import "../../../../../ui-skeleton/dist/types/index";
|
|
2
3
|
export class UiImage {
|
|
3
4
|
constructor() {
|
|
4
5
|
this.src = undefined;
|
|
5
6
|
this.width = undefined;
|
|
6
7
|
this.height = undefined;
|
|
7
8
|
this.alt = undefined;
|
|
8
|
-
this.imgClass = '';
|
|
9
9
|
this.styles = undefined;
|
|
10
10
|
this.detectDistance = '200px';
|
|
11
11
|
this.imgLoaded = false;
|
|
@@ -15,15 +15,14 @@ export class UiImage {
|
|
|
15
15
|
if (!this.shouldLoad) {
|
|
16
16
|
return;
|
|
17
17
|
}
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
tempImage.onload = () => {
|
|
18
|
+
const preloadedImage = new Image();
|
|
19
|
+
preloadedImage.onload = () => {
|
|
21
20
|
if (this.image) {
|
|
22
21
|
this.image.src = this.src;
|
|
23
22
|
this.imgLoaded = true;
|
|
24
|
-
this.el.dispatchEvent(new CustomEvent('load', { bubbles: true }));
|
|
25
23
|
}
|
|
26
24
|
};
|
|
25
|
+
preloadedImage.src = this.src;
|
|
27
26
|
}
|
|
28
27
|
componentDidLoad() {
|
|
29
28
|
if ('IntersectionObserver' in window) {
|
|
@@ -50,7 +49,7 @@ export class UiImage {
|
|
|
50
49
|
}
|
|
51
50
|
}
|
|
52
51
|
render() {
|
|
53
|
-
return (h("img", { key: '
|
|
52
|
+
return (h(Host, { key: '527318220c6b48375943e897fe0e53e0f33e67ed', class: "HostContainer" }, !this.imgLoaded && (h("ui-skeleton", { key: 'e5c49a781ff2fac5c796cb6a3f8d334dce7be35b', class: "UiContainer", structure: "image", width: "100%", height: "100%" })), h("img", { key: '09dfbf8f52c2c899246590790f2780a84bdeefc3', ref: (el) => (this.image = el), src: this.shouldLoad ? this.src : undefined, onLoad: () => (this.imgLoaded = true), style: this.styles, class: `UiContainer ${this.imgLoaded ? 'Visible' : 'Hidden'}`, alt: this.alt, width: this.width, height: this.height, loading: "lazy" })));
|
|
54
53
|
}
|
|
55
54
|
static get is() { return "ui-image"; }
|
|
56
55
|
static get originalStyleUrls() {
|
|
@@ -133,24 +132,6 @@ export class UiImage {
|
|
|
133
132
|
"attribute": "alt",
|
|
134
133
|
"reflect": false
|
|
135
134
|
},
|
|
136
|
-
"imgClass": {
|
|
137
|
-
"type": "string",
|
|
138
|
-
"mutable": false,
|
|
139
|
-
"complexType": {
|
|
140
|
-
"original": "string",
|
|
141
|
-
"resolved": "string",
|
|
142
|
-
"references": {}
|
|
143
|
-
},
|
|
144
|
-
"required": false,
|
|
145
|
-
"optional": false,
|
|
146
|
-
"docs": {
|
|
147
|
-
"tags": [],
|
|
148
|
-
"text": "Allow external class for the inner image element"
|
|
149
|
-
},
|
|
150
|
-
"attribute": "img-class",
|
|
151
|
-
"reflect": false,
|
|
152
|
-
"defaultValue": "''"
|
|
153
|
-
},
|
|
154
135
|
"styles": {
|
|
155
136
|
"type": "any",
|
|
156
137
|
"mutable": false,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const NAMESPACE = 'ui-image';
|
|
2
|
-
const BUILD = /* ui-image */ { allRenderFn: true, appendChildSlotFix: false, asyncLoading: true, asyncQueue: false, attachStyles: true, cloneNodeFix: false, cmpDidLoad: true, cmpDidRender: false, cmpDidUnload: false, cmpDidUpdate: false, cmpShouldUpdate: false, cmpWillLoad: false, 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:
|
|
2
|
+
const BUILD = /* ui-image */ { allRenderFn: true, appendChildSlotFix: false, asyncLoading: true, asyncQueue: false, attachStyles: true, cloneNodeFix: false, cmpDidLoad: true, cmpDidRender: false, cmpDidUnload: false, cmpDidUpdate: false, cmpShouldUpdate: false, cmpWillLoad: false, 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: true, propMutable: false, propNumber: true, propString: true, reflect: false, scoped: false, scopedSlotTextContentFix: false, scriptDataOpts: false, shadowDelegatesFocus: false, shadowDom: false, slot: false, slotChildNodesFix: false, slotRelocation: false, state: true, style: true, svg: false, taskQueue: true, transformTagName: false, updatable: true, vdomAttribute: true, vdomClass: true, vdomFunctional: false, vdomKey: true, vdomListener: true, vdomPropOrAttr: true, vdomRef: true, vdomRender: true, vdomStyle: true, vdomText: true, vdomXlink: false, watchCallback: true };
|
|
3
3
|
|
|
4
4
|
/*
|
|
5
5
|
Stencil Client Platform v4.19.2 | MIT Licensed | https://stenciljs.com
|
|
@@ -49,10 +49,10 @@ var loadModule = (cmpMeta, hostRef, hmrVersionId) => {
|
|
|
49
49
|
}
|
|
50
50
|
switch(bundleId) {
|
|
51
51
|
|
|
52
|
-
case 'ui-
|
|
52
|
+
case 'ui-image_2':
|
|
53
53
|
return import(
|
|
54
54
|
/* webpackMode: "lazy" */
|
|
55
|
-
'./ui-
|
|
55
|
+
'./ui-image_2.entry.js').then(processMod, consoleError);
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
58
|
return import(
|
|
@@ -271,6 +271,12 @@ var Host = {};
|
|
|
271
271
|
var isHost = (node) => node && node.$tag$ === Host;
|
|
272
272
|
var parsePropertyValue = (propValue, propType) => {
|
|
273
273
|
if (propValue != null && !isComplexType(propValue)) {
|
|
274
|
+
if (propType & 4 /* Boolean */) {
|
|
275
|
+
return propValue === "false" ? false : propValue === "" || !!propValue;
|
|
276
|
+
}
|
|
277
|
+
if (propType & 2 /* Number */) {
|
|
278
|
+
return parseFloat(propValue);
|
|
279
|
+
}
|
|
274
280
|
if (propType & 1 /* String */) {
|
|
275
281
|
return String(propValue);
|
|
276
282
|
}
|
|
@@ -348,7 +354,7 @@ var getScopeId = (cmp, mode) => "sc-" + (cmp.$tagName$);
|
|
|
348
354
|
var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
349
355
|
if (oldValue !== newValue) {
|
|
350
356
|
let isProp = isMemberInElement(elm, memberName);
|
|
351
|
-
memberName.toLowerCase();
|
|
357
|
+
let ln = memberName.toLowerCase();
|
|
352
358
|
if (memberName === "class") {
|
|
353
359
|
const classList = elm.classList;
|
|
354
360
|
const oldClasses = parseClassList(oldValue);
|
|
@@ -380,6 +386,24 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
380
386
|
if (newValue) {
|
|
381
387
|
newValue(elm);
|
|
382
388
|
}
|
|
389
|
+
} else if ((!isProp ) && memberName[0] === "o" && memberName[1] === "n") {
|
|
390
|
+
if (memberName[2] === "-") {
|
|
391
|
+
memberName = memberName.slice(3);
|
|
392
|
+
} else if (isMemberInElement(win, ln)) {
|
|
393
|
+
memberName = ln.slice(2);
|
|
394
|
+
} else {
|
|
395
|
+
memberName = ln[2] + memberName.slice(3);
|
|
396
|
+
}
|
|
397
|
+
if (oldValue || newValue) {
|
|
398
|
+
const capture = memberName.endsWith(CAPTURE_EVENT_SUFFIX);
|
|
399
|
+
memberName = memberName.replace(CAPTURE_EVENT_REGEX, "");
|
|
400
|
+
if (oldValue) {
|
|
401
|
+
plt.rel(elm, memberName, oldValue, capture);
|
|
402
|
+
}
|
|
403
|
+
if (newValue) {
|
|
404
|
+
plt.ael(elm, memberName, newValue, capture);
|
|
405
|
+
}
|
|
406
|
+
}
|
|
383
407
|
} else {
|
|
384
408
|
const isComplex = isComplexType(newValue);
|
|
385
409
|
if ((isProp || isComplex && newValue !== null) && !isSvg) {
|
|
@@ -414,6 +438,8 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
414
438
|
};
|
|
415
439
|
var parseClassListRegex = /\s/;
|
|
416
440
|
var parseClassList = (value) => !value ? [] : value.split(parseClassListRegex);
|
|
441
|
+
var CAPTURE_EVENT_SUFFIX = "Capture";
|
|
442
|
+
var CAPTURE_EVENT_REGEX = new RegExp(CAPTURE_EVENT_SUFFIX + "$");
|
|
417
443
|
|
|
418
444
|
// src/runtime/vdom/update-element.ts
|
|
419
445
|
var updateElement = (oldVnode, newVnode, isSvgMode2) => {
|
|
@@ -448,7 +474,9 @@ var createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
|
448
474
|
let i2 = 0;
|
|
449
475
|
let elm;
|
|
450
476
|
let childNode;
|
|
451
|
-
{
|
|
477
|
+
if (newVNode2.$text$ !== null) {
|
|
478
|
+
elm = newVNode2.$elm$ = doc.createTextNode(newVNode2.$text$);
|
|
479
|
+
} else {
|
|
452
480
|
elm = newVNode2.$elm$ = doc.createElement(
|
|
453
481
|
!useNativeShadowDom && BUILD.slotRelocation && newVNode2.$flags$ & 2 /* isSlotFallback */ ? "slot-fb" : newVNode2.$tag$
|
|
454
482
|
);
|
|
@@ -589,7 +617,8 @@ var patch = (oldVNode, newVNode2, isInitialRender = false) => {
|
|
|
589
617
|
const elm = newVNode2.$elm$ = oldVNode.$elm$;
|
|
590
618
|
const oldChildren = oldVNode.$children$;
|
|
591
619
|
const newChildren = newVNode2.$children$;
|
|
592
|
-
|
|
620
|
+
const text = newVNode2.$text$;
|
|
621
|
+
if (text === null) {
|
|
593
622
|
{
|
|
594
623
|
{
|
|
595
624
|
updateElement(oldVNode, newVNode2, isSvgMode);
|
|
@@ -598,10 +627,15 @@ var patch = (oldVNode, newVNode2, isInitialRender = false) => {
|
|
|
598
627
|
if (oldChildren !== null && newChildren !== null) {
|
|
599
628
|
updateChildren(elm, oldChildren, newVNode2, newChildren, isInitialRender);
|
|
600
629
|
} else if (newChildren !== null) {
|
|
630
|
+
if (oldVNode.$text$ !== null) {
|
|
631
|
+
elm.textContent = "";
|
|
632
|
+
}
|
|
601
633
|
addVnodes(elm, null, newVNode2, newChildren, 0, newChildren.length - 1);
|
|
602
634
|
} else if (oldChildren !== null) {
|
|
603
635
|
removeVnodes(oldChildren, 0, oldChildren.length - 1);
|
|
604
636
|
}
|
|
637
|
+
} else if (oldVNode.$text$ !== text) {
|
|
638
|
+
elm.data = text;
|
|
605
639
|
}
|
|
606
640
|
};
|
|
607
641
|
var nullifyVNodeRefs = (vNode) => {
|
|
@@ -1104,4 +1138,4 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
1104
1138
|
// src/runtime/nonce.ts
|
|
1105
1139
|
var setNonce = (nonce) => plt.$nonce$ = nonce;
|
|
1106
1140
|
|
|
1107
|
-
export { bootstrapLazy as b, getElement as g, h, promiseResolve as p, registerInstance as r, setNonce as s };
|
|
1141
|
+
export { Host as H, bootstrapLazy as b, getElement as g, h, promiseResolve as p, registerInstance as r, setNonce as s };
|
package/dist/esm/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { U as UiImage } from './ui-image-
|
|
2
|
-
import './index-
|
|
1
|
+
export { U as UiImage } from './ui-image-3911756b.js';
|
|
2
|
+
import './index-97d17652.js';
|
package/dist/esm/loader.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { b as bootstrapLazy } from './index-
|
|
2
|
-
export { s as setNonce } from './index-
|
|
1
|
+
import { b as bootstrapLazy } from './index-97d17652.js';
|
|
2
|
+
export { s as setNonce } from './index-97d17652.js';
|
|
3
3
|
import { g as globalScripts } from './app-globals-0f993ce5.js';
|
|
4
4
|
|
|
5
5
|
const defineCustomElements = async (win, options) => {
|
|
6
6
|
if (typeof window === 'undefined') return undefined;
|
|
7
7
|
await globalScripts();
|
|
8
|
-
return bootstrapLazy([["ui-
|
|
8
|
+
return bootstrapLazy([["ui-image_2",[[0,"ui-image",{"src":[1],"width":[1],"height":[1],"alt":[1],"styles":[8],"detectDistance":[1,"detect-distance"],"imgLoaded":[32],"shouldLoad":[32]},null,{"src":["handleSrc"]}],[0,"ui-skeleton",{"structure":[1],"width":[1],"height":[1],"borderRadius":[2,"border-radius"],"marginBottom":[2,"margin-bottom"],"marginTop":[2,"margin-top"],"marginLeft":[2,"margin-left"],"marginRight":[2,"margin-right"],"animation":[4],"rows":[2],"size":[1],"color":[1],"primaryColor":[1,"primary-color"],"secondaryColor":[1,"secondary-color"]},null,{"structure":["handleStructureChange"]}]]]], options);
|
|
9
9
|
};
|
|
10
10
|
|
|
11
11
|
export { defineCustomElements };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { r as registerInstance, h, g as getElement } from './index-
|
|
1
|
+
import { r as registerInstance, h, H as Host, g as getElement } from './index-97d17652.js';
|
|
2
2
|
|
|
3
|
-
const uiImageCss = "
|
|
3
|
+
const uiImageCss = ".HostContainer{display:block}.UiContainer{height:100%;width:100%;border-radius:inherit}.UiContainer .Image{border-radius:inherit}.Hidden{opacity:0;transition:opacity 0.5s ease-in-out}.Visible{opacity:1;transition:opacity 0.5s ease-in-out}";
|
|
4
4
|
const UiImageStyle0 = uiImageCss;
|
|
5
5
|
|
|
6
6
|
const UiImage = class {
|
|
@@ -10,7 +10,6 @@ const UiImage = class {
|
|
|
10
10
|
this.width = undefined;
|
|
11
11
|
this.height = undefined;
|
|
12
12
|
this.alt = undefined;
|
|
13
|
-
this.imgClass = '';
|
|
14
13
|
this.styles = undefined;
|
|
15
14
|
this.detectDistance = '200px';
|
|
16
15
|
this.imgLoaded = false;
|
|
@@ -20,15 +19,14 @@ const UiImage = class {
|
|
|
20
19
|
if (!this.shouldLoad) {
|
|
21
20
|
return;
|
|
22
21
|
}
|
|
23
|
-
const
|
|
24
|
-
|
|
25
|
-
tempImage.onload = () => {
|
|
22
|
+
const preloadedImage = new Image();
|
|
23
|
+
preloadedImage.onload = () => {
|
|
26
24
|
if (this.image) {
|
|
27
25
|
this.image.src = this.src;
|
|
28
26
|
this.imgLoaded = true;
|
|
29
|
-
this.el.dispatchEvent(new CustomEvent('load', { bubbles: true }));
|
|
30
27
|
}
|
|
31
28
|
};
|
|
29
|
+
preloadedImage.src = this.src;
|
|
32
30
|
}
|
|
33
31
|
componentDidLoad() {
|
|
34
32
|
if ('IntersectionObserver' in window) {
|
|
@@ -55,7 +53,7 @@ const UiImage = class {
|
|
|
55
53
|
}
|
|
56
54
|
}
|
|
57
55
|
render() {
|
|
58
|
-
return (h("img", { key: '
|
|
56
|
+
return (h(Host, { key: '527318220c6b48375943e897fe0e53e0f33e67ed', class: "HostContainer" }, !this.imgLoaded && (h("ui-skeleton", { key: 'e5c49a781ff2fac5c796cb6a3f8d334dce7be35b', class: "UiContainer", structure: "image", width: "100%", height: "100%" })), h("img", { key: '09dfbf8f52c2c899246590790f2780a84bdeefc3', ref: (el) => (this.image = el), src: this.shouldLoad ? this.src : undefined, onLoad: () => (this.imgLoaded = true), style: this.styles, class: `UiContainer ${this.imgLoaded ? 'Visible' : 'Hidden'}`, alt: this.alt, width: this.width, height: this.height, loading: "lazy" })));
|
|
59
57
|
}
|
|
60
58
|
get el() { return getElement(this); }
|
|
61
59
|
static get watchers() { return {
|
package/dist/esm/ui-image.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { p as promiseResolve, b as bootstrapLazy } from './index-
|
|
2
|
-
export { s as setNonce } from './index-
|
|
1
|
+
import { p as promiseResolve, b as bootstrapLazy } from './index-97d17652.js';
|
|
2
|
+
export { s as setNonce } from './index-97d17652.js';
|
|
3
3
|
import { g as globalScripts } from './app-globals-0f993ce5.js';
|
|
4
4
|
|
|
5
5
|
/*
|
|
@@ -16,5 +16,5 @@ var patchBrowser = () => {
|
|
|
16
16
|
|
|
17
17
|
patchBrowser().then(async (options) => {
|
|
18
18
|
await globalScripts();
|
|
19
|
-
return bootstrapLazy([["ui-
|
|
19
|
+
return bootstrapLazy([["ui-image_2",[[0,"ui-image",{"src":[1],"width":[1],"height":[1],"alt":[1],"styles":[8],"detectDistance":[1,"detect-distance"],"imgLoaded":[32],"shouldLoad":[32]},null,{"src":["handleSrc"]}],[0,"ui-skeleton",{"structure":[1],"width":[1],"height":[1],"borderRadius":[2,"border-radius"],"marginBottom":[2,"margin-bottom"],"marginTop":[2,"margin-top"],"marginLeft":[2,"margin-left"],"marginRight":[2,"margin-right"],"animation":[4],"rows":[2],"size":[1],"color":[1],"primaryColor":[1,"primary-color"],"secondaryColor":[1,"secondary-color"]},null,{"structure":["handleStructureChange"]}]]]], options);
|
|
20
20
|
});
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
export { U as ui_image } from './ui-image-3911756b.js';
|
|
2
|
+
import { r as registerInstance, h, H as Host } from './index-97d17652.js';
|
|
3
|
+
|
|
4
|
+
const uiSkeletonCss = ":host{display:block;--emw-skeleton-rectangle-background:#c2c2c2;--emw-skeleton-circle-background:#c2c2c2;--emw-skeleton-text-background:#c2c2c2;--emw-skeleton-title-background:#c2c2c2;--emw-skeleton-image-background:#c2c2c2;--emw-skeleton-logo-background:#c2c2c2;--emw-skeleton-primary-color:#e0e0e0;--emw-skeleton-secondary-color:#f0f0f0}.Skeleton{animation:skeleton-loading 1s linear infinite alternate}.Rectangle{background-color:var(--emw-skeleton-rectangle-background, #c2c2c2);width:var(--emw-skeleton-rectangle-width, 400px);height:var(--emw-skeleton-rectangle-height, 200px);border-radius:var(--emw-skeleton-rectangle-border-radius, 2px)}.Circle{background-color:var(--emw-skeleton-circle-background, #c2c2c2);width:var(--emw-skeleton-circle-size, 400px);height:var(--emw-skeleton-circle-size, 400px);border-radius:50%}.Text{background-color:var(--emw-skeleton-text-background, #c2c2c2);width:var(--emw-skeleton-text-width, 500px);height:var(--emw-skeleton-text-height, 20px);border-radius:var(--emw-skeleton-text-border-radius, 5px);margin-bottom:var(--emw-skeleton-text-margin-bottom, 5px)}.Text:last-child{width:var(--emw-skeleton-text-width-100, 300px)}.Title{background-color:var(--emw-skeleton-title-background, #c2c2c2);width:var(--emw-skeleton-title-width, 300px);height:var(--emw-skeleton-title-height, 30px);border-radius:var(--emw-skeleton-title-border-radius, 5px);margin-bottom:var(--emw-skeleton-title-margin-bottom, 5px)}.Image{background-color:var(--emw-skeleton-image-background, #c2c2c2);width:var(--emw-skeleton-image-width, 100%);height:var(--emw-skeleton-image-height, 100%);border-radius:var(--emw-skeleton-image-border-radius, inherit)}.Logo{background-color:var(--emw-skeleton-logo-background, #c2c2c2);width:var(--emw-skeleton-logo-width, 120px);height:var(--emw-skeleton-logo-height, 75px);border-radius:var(--emw-skeleton-logo-border-radius, 5px)}@keyframes skeleton-loading{0%{background-color:var(--emw-skeleton-primary-color, var(--emw-skeleton-color-0, #c2c2c2))}100%{background-color:var(--emw-skeleton-secondary-color, var(--emw-skeleton-color-100, #f0f0f0))}}";
|
|
5
|
+
const UiSkeletonStyle0 = uiSkeletonCss;
|
|
6
|
+
|
|
7
|
+
const UiSkeleton = class {
|
|
8
|
+
constructor(hostRef) {
|
|
9
|
+
registerInstance(this, hostRef);
|
|
10
|
+
this.structure = undefined;
|
|
11
|
+
this.width = undefined;
|
|
12
|
+
this.height = undefined;
|
|
13
|
+
this.borderRadius = undefined;
|
|
14
|
+
this.marginBottom = undefined;
|
|
15
|
+
this.marginTop = undefined;
|
|
16
|
+
this.marginLeft = undefined;
|
|
17
|
+
this.marginRight = undefined;
|
|
18
|
+
this.animation = true;
|
|
19
|
+
this.rows = undefined;
|
|
20
|
+
this.size = undefined;
|
|
21
|
+
this.color = undefined;
|
|
22
|
+
this.primaryColor = undefined;
|
|
23
|
+
this.secondaryColor = undefined;
|
|
24
|
+
}
|
|
25
|
+
handleStructureChange(newValue, oldValue) {
|
|
26
|
+
if (oldValue !== newValue) {
|
|
27
|
+
this.handleStructure(newValue);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
handleStructure(structure) {
|
|
31
|
+
switch (structure) {
|
|
32
|
+
case 'logo':
|
|
33
|
+
return this.renderLogo();
|
|
34
|
+
case 'image':
|
|
35
|
+
return this.renderImage();
|
|
36
|
+
case 'title':
|
|
37
|
+
return this.renderTitle();
|
|
38
|
+
case 'text':
|
|
39
|
+
return this.renderText();
|
|
40
|
+
case 'rectangle':
|
|
41
|
+
return this.renderRectangle();
|
|
42
|
+
case 'circle':
|
|
43
|
+
return this.renderCircle();
|
|
44
|
+
default:
|
|
45
|
+
return null;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
renderLogo() {
|
|
49
|
+
return (h("div", { class: "SkeletonContainer" }, h("div", { class: "Logo " + (this.animation ? 'Skeleton' : '') })));
|
|
50
|
+
}
|
|
51
|
+
renderImage() {
|
|
52
|
+
return (h("div", { class: "Image " + (this.animation ? 'Skeleton' : '') }));
|
|
53
|
+
}
|
|
54
|
+
renderTitle() {
|
|
55
|
+
return (h("div", { class: "SkeletonContainer" }, h("div", { class: "Title " + (this.animation ? 'Skeleton' : '') })));
|
|
56
|
+
}
|
|
57
|
+
renderText() {
|
|
58
|
+
return (h("div", { class: "SkeletonContainer" }, Array.from({ length: this.rows > 0 ? this.rows : 1 }).map((_, index) => (h("div", { key: index, class: "Text " + (this.animation ? 'Skeleton' : '') })))));
|
|
59
|
+
}
|
|
60
|
+
renderRectangle() {
|
|
61
|
+
return (h("div", { class: "SkeletonContainer" }, h("div", { class: "Rectangle " + (this.animation ? 'Skeleton' : '') })));
|
|
62
|
+
}
|
|
63
|
+
renderCircle() {
|
|
64
|
+
return (h("div", { class: "SkeletonContainer" }, h("div", { class: "Circle " + (this.animation ? 'Skeleton' : '') })));
|
|
65
|
+
}
|
|
66
|
+
render() {
|
|
67
|
+
let styleBlock = '';
|
|
68
|
+
switch (this.structure) {
|
|
69
|
+
case 'logo':
|
|
70
|
+
styleBlock = `
|
|
71
|
+
:host {
|
|
72
|
+
--emw-skeleton-logo-width: ${this.width};
|
|
73
|
+
--emw-skeleton-logo-height: ${this.height};
|
|
74
|
+
--emw-skeleton-logo-border-radius: ${this.borderRadius}px;
|
|
75
|
+
--emw-skeleton-logo-margin-bottom: ${this.marginBottom}px;
|
|
76
|
+
--emw-skeleton-logo-margin-top: ${this.marginTop}px;
|
|
77
|
+
--emw-skeleton-logo-margin-left: ${this.marginLeft}px;
|
|
78
|
+
--emw-skeleton-logo-margin-right: ${this.marginRight}px;
|
|
79
|
+
--emw-skeleton-logo-background: ${this.color};
|
|
80
|
+
--emw-skeleton-primary-color: ${this.primaryColor};
|
|
81
|
+
--emw-skeleton-secondary-color: ${this.secondaryColor};
|
|
82
|
+
}
|
|
83
|
+
`;
|
|
84
|
+
break;
|
|
85
|
+
case 'image':
|
|
86
|
+
styleBlock = `
|
|
87
|
+
:host {
|
|
88
|
+
--emw-skeleton-image-width: ${this.width};
|
|
89
|
+
--emw-skeleton-image-height: ${this.height};
|
|
90
|
+
--emw-skeleton-image-border-radius: ${this.borderRadius}px;
|
|
91
|
+
--emw-skeleton-image-margin-bottom: ${this.marginBottom}px;
|
|
92
|
+
--emw-skeleton-image-margin-top: ${this.marginTop}px;
|
|
93
|
+
--emw-skeleton-image-margin-left: ${this.marginLeft}px;
|
|
94
|
+
--emw-skeleton-image-margin-right: ${this.marginRight}px;
|
|
95
|
+
--emw-skeleton-image-background: ${this.color};
|
|
96
|
+
--emw-skeleton-primary-color: ${this.primaryColor};
|
|
97
|
+
--emw-skeleton-secondary-color: ${this.secondaryColor};
|
|
98
|
+
}
|
|
99
|
+
`;
|
|
100
|
+
break;
|
|
101
|
+
case 'title':
|
|
102
|
+
styleBlock = `
|
|
103
|
+
:host {
|
|
104
|
+
--emw-skeleton-title-width: ${this.width};
|
|
105
|
+
--emw-skeleton-title-height: ${this.height};
|
|
106
|
+
--emw-skeleton-title-border-radius: ${this.borderRadius}px;
|
|
107
|
+
--emw-skeleton-title-margin-bottom: ${this.marginBottom}px;
|
|
108
|
+
--emw-skeleton-title-margin-top: ${this.marginTop}px;
|
|
109
|
+
--emw-skeleton-title-margin-left: ${this.marginLeft}px;
|
|
110
|
+
--emw-skeleton-title-margin-right: ${this.marginRight}px;
|
|
111
|
+
--emw-skeleton-title-background: ${this.color};
|
|
112
|
+
--emw-skeleton-primary-color: ${this.primaryColor};
|
|
113
|
+
--emw-skeleton-secondary-color: ${this.secondaryColor};
|
|
114
|
+
}
|
|
115
|
+
`;
|
|
116
|
+
break;
|
|
117
|
+
case 'text':
|
|
118
|
+
styleBlock = `
|
|
119
|
+
:host {
|
|
120
|
+
--emw-skeleton-text-width: ${this.width};
|
|
121
|
+
--emw-skeleton-text-height: ${this.height};
|
|
122
|
+
--emw-skeleton-text-border-radius: ${this.borderRadius}px;
|
|
123
|
+
--emw-skeleton-text-margin-bottom: ${this.marginBottom}px;
|
|
124
|
+
--emw-skeleton-text-margin-top: ${this.marginTop}px;
|
|
125
|
+
--emw-skeleton-text-margin-left: ${this.marginLeft}px;
|
|
126
|
+
--emw-skeleton-text-margin-right: ${this.marginRight}px;
|
|
127
|
+
--emw-skeleton-text-background: ${this.color};
|
|
128
|
+
--emw-skeleton-primary-color: ${this.primaryColor};
|
|
129
|
+
--emw-skeleton-secondary-color: ${this.secondaryColor};
|
|
130
|
+
}
|
|
131
|
+
`;
|
|
132
|
+
break;
|
|
133
|
+
case 'rectangle':
|
|
134
|
+
styleBlock = `
|
|
135
|
+
:host {
|
|
136
|
+
--emw-skeleton-rectangle-width: ${this.width};
|
|
137
|
+
--emw-skeleton-rectangle-height: ${this.height};
|
|
138
|
+
--emw-skeleton-rectangle-border-radius: ${this.borderRadius}px;
|
|
139
|
+
--emw-skeleton-rectangle-margin-bottom: ${this.marginBottom}px;
|
|
140
|
+
--emw-skeleton-rectangle-margin-top: ${this.marginTop}px;
|
|
141
|
+
--emw-skeleton-rectangle-margin-left: ${this.marginLeft}px;
|
|
142
|
+
--emw-skeleton-rectangle-margin-right: ${this.marginRight}px;
|
|
143
|
+
--emw-skeleton-rectangle-background: ${this.color};
|
|
144
|
+
--emw-skeleton-primary-color: ${this.primaryColor};
|
|
145
|
+
--emw-skeleton-secondary-color: ${this.secondaryColor};
|
|
146
|
+
}
|
|
147
|
+
`;
|
|
148
|
+
break;
|
|
149
|
+
case 'circle':
|
|
150
|
+
styleBlock = `
|
|
151
|
+
:host {
|
|
152
|
+
--emw-skeleton-circle-size: ${this.size};
|
|
153
|
+
--emw-skeleton-circle-background: ${this.color};
|
|
154
|
+
--emw-skeleton-primary-color: ${this.primaryColor};
|
|
155
|
+
--emw-skeleton-secondary-color: ${this.secondaryColor};
|
|
156
|
+
}
|
|
157
|
+
`;
|
|
158
|
+
break;
|
|
159
|
+
default:
|
|
160
|
+
styleBlock = '';
|
|
161
|
+
}
|
|
162
|
+
return (h(Host, { key: '3bb792a149db7fe732d5cbfa092cdb4d6ca0689e' }, h("style", { key: 'a4607599b60659f385ae2660513e38b383739674' }, styleBlock), this.handleStructure(this.structure)));
|
|
163
|
+
}
|
|
164
|
+
static get watchers() { return {
|
|
165
|
+
"structure": ["handleStructureChange"]
|
|
166
|
+
}; }
|
|
167
|
+
};
|
|
168
|
+
UiSkeleton.style = UiSkeletonStyle0;
|
|
169
|
+
|
|
170
|
+
export { UiSkeleton as ui_skeleton };
|
package/dist/storybook/main.js
CHANGED
|
@@ -1,7 +1,12 @@
|
|
|
1
|
-
import
|
|
1
|
+
import path from "path";
|
|
2
|
+
import { getStoryFiles, detectUsedPackages, parseTsConfig, exec, filterParsedPathsByUsedPackages } from "../../../../libs/common/src/storybook/storybook-utils";
|
|
2
3
|
const config = {
|
|
3
4
|
stories: ['../**/*.@(mdx|stories.@(js|ts|tsx))'],
|
|
4
|
-
addons: [
|
|
5
|
+
addons: [
|
|
6
|
+
'@storybook/addon-essentials',
|
|
7
|
+
'@storybook/addon-interactions',
|
|
8
|
+
'storybook-dark-mode'
|
|
9
|
+
],
|
|
5
10
|
docs: {
|
|
6
11
|
defaultName: 'Documentation',
|
|
7
12
|
autodocs: 'tag'
|
|
@@ -10,10 +15,31 @@ const config = {
|
|
|
10
15
|
name: '@storybook/web-components-vite',
|
|
11
16
|
options: {}
|
|
12
17
|
},
|
|
18
|
+
// Async viteFinal to build dependent packages before finalizing configuration.
|
|
13
19
|
viteFinal: async (config) => {
|
|
20
|
+
const storyFiles = getStoryFiles(path.resolve(__dirname, '../'));
|
|
21
|
+
const usedPackages = detectUsedPackages(storyFiles);
|
|
22
|
+
const buildPromises = usedPackages.map(async (pkg) => {
|
|
23
|
+
try {
|
|
24
|
+
console.log(`Building package ${pkg}...`);
|
|
25
|
+
const { stdout, stderr } = await exec(`nx run ${pkg}:build`);
|
|
26
|
+
console.log(`Built package ${pkg}: ${stdout}`);
|
|
27
|
+
if (stderr) {
|
|
28
|
+
console.error(`Build warning/error for package ${pkg}: ${stderr}`);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
catch (error) {
|
|
32
|
+
console.error(`Error building package ${pkg}:`, error);
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
await Promise.all(buildPromises);
|
|
36
|
+
const parsedPaths = parseTsConfig() || {};
|
|
37
|
+
const filteredParsedPaths = filterParsedPathsByUsedPackages(parsedPaths, usedPackages);
|
|
14
38
|
return Object.assign(Object.assign({}, config), { resolve: {
|
|
15
|
-
alias: {
|
|
16
|
-
|
|
39
|
+
alias: Object.assign({}, filteredParsedPaths)
|
|
40
|
+
}, define: {
|
|
41
|
+
process: {
|
|
42
|
+
env: {}
|
|
17
43
|
}
|
|
18
44
|
} });
|
|
19
45
|
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { exec as execCallback } from 'child_process';
|
|
3
|
+
export declare const exec: typeof execCallback.__promisify__;
|
|
4
|
+
/**
|
|
5
|
+
* Recursively retrieves all story files (.stories.ts/.stories.tsx) in a directory.
|
|
6
|
+
* @param dir The directory to search.
|
|
7
|
+
* @returns Array of story file paths.
|
|
8
|
+
*/
|
|
9
|
+
export declare const getStoryFiles: (dir: string) => string[];
|
|
10
|
+
/**
|
|
11
|
+
* Detects which internal packages are used in the provided story files.
|
|
12
|
+
* It looks at every import that starts with the given package alias prefix,
|
|
13
|
+
* then extracts the package name (the segment immediately following the prefix).
|
|
14
|
+
*
|
|
15
|
+
* @param stories Array of story file paths.
|
|
16
|
+
* @returns Array of unique package names (e.g. ['foo', 'bar']).
|
|
17
|
+
*/
|
|
18
|
+
export declare const detectUsedPackages: (stories: string[]) => string[];
|
|
19
|
+
/**
|
|
20
|
+
* Extracts all import paths from a file using the TypeScript compiler API.
|
|
21
|
+
* @param filePath The file path to parse.
|
|
22
|
+
* @returns Array of import strings.
|
|
23
|
+
*/
|
|
24
|
+
export declare const extractImports: (filePath: string) => string[];
|
|
25
|
+
/**
|
|
26
|
+
* Parses the tsconfig paths and resolves them to absolute paths.
|
|
27
|
+
* @param tsconfigPath The path to the tsconfig file.
|
|
28
|
+
* @returns An object mapping alias keys to absolute paths.
|
|
29
|
+
*/
|
|
30
|
+
export declare const parseTsConfig: () => Record<string, string> | null;
|
|
31
|
+
/**
|
|
32
|
+
* Filters the parsed tsconfig alias mapping to only include keys that correspond
|
|
33
|
+
* to the used packages.
|
|
34
|
+
*
|
|
35
|
+
* @param parsedPaths The full alias mapping from tsconfig.
|
|
36
|
+
* @param usedPackages Array of package names that are used (e.g. ['foo', 'bar']).
|
|
37
|
+
* @returns Filtered alias mapping.
|
|
38
|
+
*/
|
|
39
|
+
export declare const filterParsedPathsByUsedPackages: (parsedPaths: Record<string, string>, usedPackages: string[]) => Record<string, string>;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import "../../../../../../dist/packages/stencil/ui-skeleton/dist/types/index";
|
|
1
2
|
export declare class UiImage {
|
|
2
3
|
/** Source of the image */
|
|
3
4
|
src: string;
|
|
@@ -7,8 +8,6 @@ export declare class UiImage {
|
|
|
7
8
|
height: string;
|
|
8
9
|
/** Alt of the image */
|
|
9
10
|
alt: string;
|
|
10
|
-
/** Allow external class for the inner image element */
|
|
11
|
-
imgClass: string;
|
|
12
11
|
/** Allow inline styles */
|
|
13
12
|
styles: any;
|
|
14
13
|
/** Distance for the image to be detected */
|
|
@@ -19,10 +19,6 @@ export namespace Components {
|
|
|
19
19
|
* Height of the image
|
|
20
20
|
*/
|
|
21
21
|
"height": string;
|
|
22
|
-
/**
|
|
23
|
-
* Allow external class for the inner image element
|
|
24
|
-
*/
|
|
25
|
-
"imgClass": string;
|
|
26
22
|
/**
|
|
27
23
|
* Source of the image
|
|
28
24
|
*/
|
|
@@ -62,10 +58,6 @@ declare namespace LocalJSX {
|
|
|
62
58
|
* Height of the image
|
|
63
59
|
*/
|
|
64
60
|
"height"?: string;
|
|
65
|
-
/**
|
|
66
|
-
* Allow external class for the inner image element
|
|
67
|
-
*/
|
|
68
|
-
"imgClass"?: string;
|
|
69
61
|
/**
|
|
70
62
|
* Source of the image
|
|
71
63
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{U as UiImage}from"./p-
|
|
1
|
+
export{U as UiImage}from"./p-de18b4b5.js";import"./p-381d4568.js";
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var e=Object.defineProperty,t=new WeakMap,n=e=>t.get(e),l=(e,n)=>t.set(n.t=e,n),o=(e,t)=>t in e,s=(e,t)=>(0,console.error)(e,t),i=new Map,r=new Map,c="slot-fb{display:contents}slot-fb[hidden]{display:none}",u="undefined"!=typeof window?window:{},a=u.document||{head:{}},f={l:0,o:"",jmp:e=>e(),raf:e=>requestAnimationFrame(e),ael:(e,t,n,l)=>e.addEventListener(t,n,l),rel:(e,t,n,l)=>e.removeEventListener(t,n,l),ce:(e,t)=>new CustomEvent(e,t)},h=e=>Promise.resolve(e),m=(()=>{try{return new CSSStyleSheet,"function"==typeof(new CSSStyleSheet).replaceSync}catch(e){}return!1})(),p=!1,d=[],y=[],$=(e,t)=>n=>{e.push(n),p||(p=!0,t&&4&f.l?b(w):f.raf(w))},v=e=>{for(let t=0;t<e.length;t++)try{e[t](performance.now())}catch(e){s(e)}e.length=0},w=()=>{v(d),v(y),(p=d.length>0)&&f.raf(w)},b=e=>h().then(e),g=$(y,!0),S={},j=e=>"object"==(e=typeof e)||"function"===e;function k(e){var t,n,l;return null!=(l=null==(n=null==(t=e.head)?void 0:t.querySelector('meta[name="csp-nonce"]'))?void 0:n.getAttribute("content"))?l:void 0}((t,n)=>{for(var l in n)e(t,l,{get:n[l],enumerable:!0})})({},{err:()=>E,map:()=>C,ok:()=>O,unwrap:()=>P,unwrapErr:()=>x});var O=e=>({isOk:!0,isErr:!1,value:e}),E=e=>({isOk:!1,isErr:!0,value:e});function C(e,t){if(e.isOk){const n=t(e.value);return n instanceof Promise?n.then((e=>O(e))):O(n)}if(e.isErr)return E(e.value);throw"should never get here"}var M,P=e=>{if(e.isOk)return e.value;throw e.value},x=e=>{if(e.isErr)return e.value;throw e.value},R=(e,t,...n)=>{let l=null,o=null,s=!1,i=!1;const r=[],c=t=>{for(let n=0;n<t.length;n++)l=t[n],Array.isArray(l)?c(l):null!=l&&"boolean"!=typeof l&&((s="function"!=typeof e&&!j(l))&&(l+=""),s&&i?r[r.length-1].i+=l:r.push(s?T(null,l):l),i=s)};if(c(n),t){t.key&&(o=t.key);{const e=t.className||t.class;e&&(t.class="object"!=typeof e?e:Object.keys(e).filter((t=>e[t])).join(" "))}}const u=T(e,null);return u.u=t,r.length>0&&(u.h=r),u.m=o,u},T=(e,t)=>({l:0,p:e,i:t,$:null,h:null,u:null,m:null}),A={},F=e=>n(e).$hostElement$,H=new WeakMap,L=e=>"sc-"+e.v,N=(e,t,n,l,s,i)=>{if(n!==l){let r=o(e,t),c=t.toLowerCase();if("class"===t){const t=e.classList,o=U(n),s=U(l);t.remove(...o.filter((e=>e&&!s.includes(e)))),t.add(...s.filter((e=>e&&!o.includes(e))))}else if("style"===t){for(const t in n)l&&null!=l[t]||(t.includes("-")?e.style.removeProperty(t):e.style[t]="");for(const t in l)n&&l[t]===n[t]||(t.includes("-")?e.style.setProperty(t,l[t]):e.style[t]=l[t])}else if("key"===t);else if("ref"===t)l&&l(e);else if(r||"o"!==t[0]||"n"!==t[1]){const o=j(l);if((r||o&&null!==l)&&!s)try{if(e.tagName.includes("-"))e[t]=l;else{const o=null==l?"":l;"list"===t?r=!1:null!=n&&e[t]==o||(e[t]=o)}}catch(e){}null==l||!1===l?!1===l&&""!==e.getAttribute(t)||e.removeAttribute(t):(!r||4&i||s)&&!o&&e.setAttribute(t,l=!0===l?"":l)}else if(t="-"===t[2]?t.slice(3):o(u,c)?c.slice(2):c[2]+t.slice(3),n||l){const o=t.endsWith(W);t=t.replace(q,""),n&&f.rel(e,t,n,o),l&&f.ael(e,t,l,o)}}},D=/\s/,U=e=>e?e.split(D):[],W="Capture",q=RegExp(W+"$"),G=(e,t,n)=>{const l=11===t.$.nodeType&&t.$.host?t.$.host:t.$,o=e&&e.u||S,s=t.u||S;for(const e of V(Object.keys(o)))e in s||N(l,e,o[e],void 0,n,t.l);for(const e of V(Object.keys(s)))N(l,e,o[e],s[e],n,t.l)};function V(e){return e.includes("ref")?[...e.filter((e=>"ref"!==e)),"ref"]:e}var _=!1,z=(e,t,n)=>{const l=t.h[n];let o,s,i=0;if(null!==l.i)o=l.$=a.createTextNode(l.i);else if(o=l.$=a.createElement(l.p),G(null,l,_),l.h)for(i=0;i<l.h.length;++i)s=z(e,l,i),s&&o.appendChild(s);return o["s-hn"]=M,o},B=(e,t,n,l,o,s)=>{let i,r=e;for(;o<=s;++o)l[o]&&(i=z(null,n,o),i&&(l[o].$=i,X(r,i,t)))},I=(e,t,n)=>{for(let l=t;l<=n;++l){const t=e[l];if(t){const e=t.$;Q(t),e&&e.remove()}}},J=(e,t,n=!1)=>e.p===t.p&&(!!n||e.m===t.m),K=(e,t,n=!1)=>{const l=t.$=e.$,o=e.h,s=t.h,i=t.i;null===i?(G(e,t,_),null!==o&&null!==s?((e,t,n,l,o=!1)=>{let s,i,r=0,c=0,u=0,a=0,f=t.length-1,h=t[0],m=t[f],p=l.length-1,d=l[0],y=l[p];for(;r<=f&&c<=p;)if(null==h)h=t[++r];else if(null==m)m=t[--f];else if(null==d)d=l[++c];else if(null==y)y=l[--p];else if(J(h,d,o))K(h,d,o),h=t[++r],d=l[++c];else if(J(m,y,o))K(m,y,o),m=t[--f],y=l[--p];else if(J(h,y,o))K(h,y,o),X(e,h.$,m.$.nextSibling),h=t[++r],y=l[--p];else if(J(m,d,o))K(m,d,o),X(e,m.$,h.$),m=t[--f],d=l[++c];else{for(u=-1,a=r;a<=f;++a)if(t[a]&&null!==t[a].m&&t[a].m===d.m){u=a;break}u>=0?(i=t[u],i.p!==d.p?s=z(t&&t[c],n,u):(K(i,d,o),t[u]=void 0,s=i.$),d=l[++c]):(s=z(t&&t[c],n,c),d=l[++c]),s&&X(h.$.parentNode,s,h.$)}r>f?B(e,null==l[p+1]?null:l[p+1].$,n,l,c,p):c>p&&I(t,r,f)})(l,o,t,s,n):null!==s?(null!==e.i&&(l.textContent=""),B(l,null,t,s,0,s.length-1)):null!==o&&I(o,0,o.length-1)):e.i!==i&&(l.data=i)},Q=e=>{e.u&&e.u.ref&&e.u.ref(null),e.h&&e.h.map(Q)},X=(e,t,n)=>null==e?void 0:e.insertBefore(t,n),Y=(e,t)=>{t&&!e.S&&t["s-p"]&&t["s-p"].push(new Promise((t=>e.S=t)))},Z=(e,t)=>{if(e.l|=16,!(4&e.l))return Y(e,e.j),g((()=>ee(e,t)));e.l|=512},ee=(e,t)=>{const n=e.t;if(!n)throw Error(`Can't render component <${e.$hostElement$.tagName.toLowerCase()} /> with invalid Stencil runtime! Make sure this imported component is compiled with a \`externalRuntime: true\` flag. For more information, please refer to https://stenciljs.com/docs/custom-elements#externalruntime`);return te(void 0,(()=>le(e,n,t)))},te=(e,t)=>ne(e)?e.then(t).catch((e=>{console.error(e),t()})):t(),ne=e=>e instanceof Promise||e&&e.then&&"function"==typeof e.then,le=async(e,t,n)=>{var l;const o=e.$hostElement$,s=o["s-rc"];n&&(e=>{const t=e.k;((e,t)=>{var n;const l=L(t),o=r.get(l);if(e=11===e.nodeType?e:a,o)if("string"==typeof o){let s,i=H.get(e=e.head||e);if(i||H.set(e,i=new Set),!i.has(l)){{s=a.createElement("style"),s.innerHTML=o;const t=null!=(n=f.O)?n:k(a);null!=t&&s.setAttribute("nonce",t),e.insertBefore(s,e.querySelector("link"))}4&t.l&&(s.innerHTML+=c),i&&i.add(l)}}else e.adoptedStyleSheets.includes(o)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,o])})(e.$hostElement$.getRootNode(),t)})(e);oe(e,t,o,n),s&&(s.map((e=>e())),o["s-rc"]=void 0);{const t=null!=(l=o["s-p"])?l:[],n=()=>se(e);0===t.length?n():(Promise.all(t).then(n),e.l|=4,t.length=0)}},oe=(e,t,n,l)=>{try{t=t.render(),e.l&=-17,e.l|=2,((e,t,n=!1)=>{const l=e.$hostElement$,o=e.C||T(null,null),s=(e=>e&&e.p===A)(t)?t:R(null,null,t);if(M=l.tagName,n&&s.u)for(const e of Object.keys(s.u))l.hasAttribute(e)&&!["key","ref","style","class"].includes(e)&&(s.u[e]=l[e]);s.p=null,s.l|=4,e.C=s,s.$=o.$=l,K(o,s,n)})(e,t,l)}catch(t){s(t,e.$hostElement$)}return null},se=e=>{const t=e.$hostElement$,n=e.t,l=e.j;64&e.l||(e.l|=64,ce(t),re(n,"componentDidLoad"),e.M(t),l||ie()),e.S&&(e.S(),e.S=void 0),512&e.l&&b((()=>Z(e,!1))),e.l&=-517},ie=()=>{ce(a.documentElement),b((()=>(e=>{const t=f.ce("appload",{detail:{namespace:"ui-image"}});return e.dispatchEvent(t),t})(u)))},re=(e,t,n)=>{if(e&&e[t])try{return e[t](n)}catch(e){s(e)}},ce=e=>e.classList.add("hydrated"),ue=(e,t,l)=>{var o,i;const r=e.prototype;if(t.P||t.R||e.watchers){e.watchers&&!t.R&&(t.R=e.watchers);const c=Object.entries(null!=(o=t.P)?o:{});if(c.map((([e,[o]])=>{(31&o||2&l&&32&o)&&Object.defineProperty(r,e,{get(){return((e,t)=>n(this).T.get(t))(0,e)},set(l){((e,t,l,o)=>{const i=n(e);if(!i)throw Error(`Couldn't find host element for "${o.v}" as it is unknown to this Stencil runtime. This usually happens when integrating a 3rd party Stencil component with another Stencil component or application. Please reach out to the maintainers of the 3rd party Stencil component or report this on the Stencil Discord server (https://chat.stenciljs.com) or comment on this similar [GitHub issue](https://github.com/ionic-team/stencil/issues/5457).`);const r=i.$hostElement$,c=i.T.get(t),u=i.l,a=i.t;if(l=((e,t)=>null==e||j(e)?e:4&t?"false"!==e&&(""===e||!!e):2&t?parseFloat(e):1&t?e+"":e)(l,o.P[t][0]),(!(8&u)||void 0===c)&&l!==c&&(!Number.isNaN(c)||!Number.isNaN(l))&&(i.T.set(t,l),a)){if(o.R&&128&u){const e=o.R[t];e&&e.map((e=>{try{a[e](l,c,t)}catch(e){s(e,r)}}))}2==(18&u)&&Z(i,!1)}})(this,e,l,t)},configurable:!0,enumerable:!0})})),1&l){const l=new Map;r.attributeChangedCallback=function(e,o,s){f.jmp((()=>{var i;const c=l.get(e);if(this.hasOwnProperty(c))s=this[c],delete this[c];else{if(r.hasOwnProperty(c)&&"number"==typeof this[c]&&this[c]==s)return;if(null==c){const l=n(this),r=null==l?void 0:l.l;if(r&&!(8&r)&&128&r&&s!==o){const n=l.t,r=null==(i=t.R)?void 0:i[e];null==r||r.forEach((t=>{null!=n[t]&&n[t].call(n,s,o,e)}))}return}}this[c]=(null!==s||"boolean"!=typeof this[c])&&s}))},e.observedAttributes=Array.from(new Set([...Object.keys(null!=(i=t.R)?i:{}),...c.filter((([e,t])=>15&t[0])).map((([e,t])=>{const n=t[1]||e;return l.set(n,e),n}))]))}}return e},ae=(e,l={})=>{var o;const h=[],p=l.exclude||[],d=u.customElements,y=a.head,$=y.querySelector("meta[charset]"),v=a.createElement("style"),w=[];let b,g=!0;Object.assign(f,l),f.o=new URL(l.resourcesUrl||"./",a.baseURI).href;let S=!1;if(e.map((e=>{e[1].map((l=>{var o;const c={l:l[0],v:l[1],P:l[2],A:l[3]};4&c.l&&(S=!0),c.P=l[2],c.R=null!=(o=l[4])?o:{};const u=c.v,a=class extends HTMLElement{constructor(e){super(e),this.hasRegisteredEventListeners=!1,((e,n)=>{const l={l:0,$hostElement$:e,k:n,T:new Map};l.F=new Promise((e=>l.M=e)),e["s-p"]=[],e["s-rc"]=[],t.set(e,l)})(e=this,c)}connectedCallback(){this.hasRegisteredEventListeners||(this.hasRegisteredEventListeners=!0),b&&(clearTimeout(b),b=null),g?w.push(this):f.jmp((()=>(e=>{if(!(1&f.l)){const t=n(e),l=t.k,o=()=>{};if(1&t.l)(null==t?void 0:t.t)||(null==t?void 0:t.F)&&t.F.then((()=>{}));else{t.l|=1;{let n=e;for(;n=n.parentNode||n.host;)if(n["s-p"]){Y(t,t.j=n);break}}l.P&&Object.entries(l.P).map((([t,[n]])=>{if(31&n&&e.hasOwnProperty(t)){const n=e[t];delete e[t],e[t]=n}})),(async(e,t,n)=>{let l;if(!(32&t.l)){if(t.l|=32,n.H){const e=(e=>{const t=e.v.replace(/-/g,"_"),n=e.H;if(!n)return;const l=i.get(n);return l?l[t]:import(`./${n}.entry.js`).then((e=>(i.set(n,e),e[t])),s)
|
|
2
|
+
/*!__STENCIL_STATIC_IMPORT_SWITCH__*/})(n);if(e&&"then"in e){const t=()=>{};l=await e,t()}else l=e;if(!l)throw Error(`Constructor for "${n.v}#${t.L}" was not found`);l.isProxied||(n.R=l.watchers,ue(l,n,2),l.isProxied=!0);const o=()=>{};t.l|=8;try{new l(t)}catch(e){s(e)}t.l&=-9,t.l|=128,o()}else l=e.constructor,customElements.whenDefined(e.localName).then((()=>t.l|=128));if(l&&l.style){let e;"string"==typeof l.style&&(e=l.style);const t=L(n);if(!r.has(t)){const l=()=>{};((e,t,n)=>{let l=r.get(e);m&&n?(l=l||new CSSStyleSheet,"string"==typeof l?l=t:l.replaceSync(t)):l=t,r.set(e,l)})(t,e,!!(1&n.l)),l()}}}const o=t.j,c=()=>Z(t,!0);o&&o["s-rc"]?o["s-rc"].push(c):c()})(e,t,l)}o()}})(this)))}disconnectedCallback(){f.jmp((()=>(async()=>{if(!(1&f.l)){const e=n(this);(null==e?void 0:e.t)||(null==e?void 0:e.F)&&e.F.then((()=>{}))}})()))}componentOnReady(){return n(this).F}};c.H=e[0],p.includes(u)||d.get(u)||(h.push(u),d.define(u,ue(a,c,1)))}))})),h.length>0&&(S&&(v.textContent+=c),v.textContent+=h.sort()+"{visibility:hidden}.hydrated{visibility:inherit}",v.innerHTML.length)){v.setAttribute("data-styles","");const e=null!=(o=f.O)?o:k(a);null!=e&&v.setAttribute("nonce",e),y.insertBefore(v,$?$.nextSibling:y.firstChild)}g=!1,w.length?w.map((e=>e.connectedCallback())):f.jmp((()=>b=setTimeout(ie,30)))},fe=e=>f.O=e;export{A as H,ae as b,F as g,R as h,h as p,l as r,fe as s}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{U as ui_image}from"./p-de18b4b5.js";import{r as e,h as t,H as n}from"./p-381d4568.js";const o=class{constructor(t){e(this,t),this.structure=void 0,this.width=void 0,this.height=void 0,this.borderRadius=void 0,this.marginBottom=void 0,this.marginTop=void 0,this.marginLeft=void 0,this.marginRight=void 0,this.animation=!0,this.rows=void 0,this.size=void 0,this.color=void 0,this.primaryColor=void 0,this.secondaryColor=void 0}handleStructureChange(e,t){t!==e&&this.handleStructure(e)}handleStructure(e){switch(e){case"logo":return this.renderLogo();case"image":return this.renderImage();case"title":return this.renderTitle();case"text":return this.renderText();case"rectangle":return this.renderRectangle();case"circle":return this.renderCircle();default:return null}}renderLogo(){return t("div",{class:"SkeletonContainer"},t("div",{class:"Logo "+(this.animation?"Skeleton":"")}))}renderImage(){return t("div",{class:"Image "+(this.animation?"Skeleton":"")})}renderTitle(){return t("div",{class:"SkeletonContainer"},t("div",{class:"Title "+(this.animation?"Skeleton":"")}))}renderText(){return t("div",{class:"SkeletonContainer"},Array.from({length:this.rows>0?this.rows:1}).map(((e,n)=>t("div",{key:n,class:"Text "+(this.animation?"Skeleton":"")}))))}renderRectangle(){return t("div",{class:"SkeletonContainer"},t("div",{class:"Rectangle "+(this.animation?"Skeleton":"")}))}renderCircle(){return t("div",{class:"SkeletonContainer"},t("div",{class:"Circle "+(this.animation?"Skeleton":"")}))}render(){let e="";switch(this.structure){case"logo":e=`\n :host {\n --emw-skeleton-logo-width: ${this.width};\n --emw-skeleton-logo-height: ${this.height};\n --emw-skeleton-logo-border-radius: ${this.borderRadius}px;\n --emw-skeleton-logo-margin-bottom: ${this.marginBottom}px;\n --emw-skeleton-logo-margin-top: ${this.marginTop}px;\n --emw-skeleton-logo-margin-left: ${this.marginLeft}px;\n --emw-skeleton-logo-margin-right: ${this.marginRight}px;\n --emw-skeleton-logo-background: ${this.color};\n --emw-skeleton-primary-color: ${this.primaryColor};\n --emw-skeleton-secondary-color: ${this.secondaryColor};\n }\n `;break;case"image":e=`\n :host {\n --emw-skeleton-image-width: ${this.width};\n --emw-skeleton-image-height: ${this.height};\n --emw-skeleton-image-border-radius: ${this.borderRadius}px;\n --emw-skeleton-image-margin-bottom: ${this.marginBottom}px;\n --emw-skeleton-image-margin-top: ${this.marginTop}px;\n --emw-skeleton-image-margin-left: ${this.marginLeft}px;\n --emw-skeleton-image-margin-right: ${this.marginRight}px;\n --emw-skeleton-image-background: ${this.color};\n --emw-skeleton-primary-color: ${this.primaryColor};\n --emw-skeleton-secondary-color: ${this.secondaryColor};\n }\n `;break;case"title":e=`\n :host {\n --emw-skeleton-title-width: ${this.width};\n --emw-skeleton-title-height: ${this.height};\n --emw-skeleton-title-border-radius: ${this.borderRadius}px;\n --emw-skeleton-title-margin-bottom: ${this.marginBottom}px;\n --emw-skeleton-title-margin-top: ${this.marginTop}px;\n --emw-skeleton-title-margin-left: ${this.marginLeft}px;\n --emw-skeleton-title-margin-right: ${this.marginRight}px;\n --emw-skeleton-title-background: ${this.color};\n --emw-skeleton-primary-color: ${this.primaryColor};\n --emw-skeleton-secondary-color: ${this.secondaryColor};\n }\n `;break;case"text":e=`\n :host {\n --emw-skeleton-text-width: ${this.width};\n --emw-skeleton-text-height: ${this.height};\n --emw-skeleton-text-border-radius: ${this.borderRadius}px;\n --emw-skeleton-text-margin-bottom: ${this.marginBottom}px;\n --emw-skeleton-text-margin-top: ${this.marginTop}px;\n --emw-skeleton-text-margin-left: ${this.marginLeft}px;\n --emw-skeleton-text-margin-right: ${this.marginRight}px;\n --emw-skeleton-text-background: ${this.color};\n --emw-skeleton-primary-color: ${this.primaryColor};\n --emw-skeleton-secondary-color: ${this.secondaryColor};\n }\n `;break;case"rectangle":e=`\n :host {\n --emw-skeleton-rectangle-width: ${this.width};\n --emw-skeleton-rectangle-height: ${this.height};\n --emw-skeleton-rectangle-border-radius: ${this.borderRadius}px;\n --emw-skeleton-rectangle-margin-bottom: ${this.marginBottom}px;\n --emw-skeleton-rectangle-margin-top: ${this.marginTop}px;\n --emw-skeleton-rectangle-margin-left: ${this.marginLeft}px;\n --emw-skeleton-rectangle-margin-right: ${this.marginRight}px;\n --emw-skeleton-rectangle-background: ${this.color};\n --emw-skeleton-primary-color: ${this.primaryColor};\n --emw-skeleton-secondary-color: ${this.secondaryColor};\n }\n `;break;case"circle":e=`\n :host {\n --emw-skeleton-circle-size: ${this.size};\n --emw-skeleton-circle-background: ${this.color};\n --emw-skeleton-primary-color: ${this.primaryColor};\n --emw-skeleton-secondary-color: ${this.secondaryColor};\n }\n `;break;default:e=""}return t(n,{key:"3bb792a149db7fe732d5cbfa092cdb4d6ca0689e"},t("style",{key:"a4607599b60659f385ae2660513e38b383739674"},e),this.handleStructure(this.structure))}static get watchers(){return{structure:["handleStructureChange"]}}};o.style=":host{display:block;--emw-skeleton-rectangle-background:#c2c2c2;--emw-skeleton-circle-background:#c2c2c2;--emw-skeleton-text-background:#c2c2c2;--emw-skeleton-title-background:#c2c2c2;--emw-skeleton-image-background:#c2c2c2;--emw-skeleton-logo-background:#c2c2c2;--emw-skeleton-primary-color:#e0e0e0;--emw-skeleton-secondary-color:#f0f0f0}.Skeleton{animation:skeleton-loading 1s linear infinite alternate}.Rectangle{background-color:var(--emw-skeleton-rectangle-background, #c2c2c2);width:var(--emw-skeleton-rectangle-width, 400px);height:var(--emw-skeleton-rectangle-height, 200px);border-radius:var(--emw-skeleton-rectangle-border-radius, 2px)}.Circle{background-color:var(--emw-skeleton-circle-background, #c2c2c2);width:var(--emw-skeleton-circle-size, 400px);height:var(--emw-skeleton-circle-size, 400px);border-radius:50%}.Text{background-color:var(--emw-skeleton-text-background, #c2c2c2);width:var(--emw-skeleton-text-width, 500px);height:var(--emw-skeleton-text-height, 20px);border-radius:var(--emw-skeleton-text-border-radius, 5px);margin-bottom:var(--emw-skeleton-text-margin-bottom, 5px)}.Text:last-child{width:var(--emw-skeleton-text-width-100, 300px)}.Title{background-color:var(--emw-skeleton-title-background, #c2c2c2);width:var(--emw-skeleton-title-width, 300px);height:var(--emw-skeleton-title-height, 30px);border-radius:var(--emw-skeleton-title-border-radius, 5px);margin-bottom:var(--emw-skeleton-title-margin-bottom, 5px)}.Image{background-color:var(--emw-skeleton-image-background, #c2c2c2);width:var(--emw-skeleton-image-width, 100%);height:var(--emw-skeleton-image-height, 100%);border-radius:var(--emw-skeleton-image-border-radius, inherit)}.Logo{background-color:var(--emw-skeleton-logo-background, #c2c2c2);width:var(--emw-skeleton-logo-width, 120px);height:var(--emw-skeleton-logo-height, 75px);border-radius:var(--emw-skeleton-logo-border-radius, 5px)}@keyframes skeleton-loading{0%{background-color:var(--emw-skeleton-primary-color, var(--emw-skeleton-color-0, #c2c2c2))}100%{background-color:var(--emw-skeleton-secondary-color, var(--emw-skeleton-color-100, #f0f0f0))}}";export{o as ui_skeleton}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as i,h as t,H as s,g as e}from"./p-381d4568.js";const n=class{constructor(t){i(this,t),this.src=void 0,this.width=void 0,this.height=void 0,this.alt=void 0,this.styles=void 0,this.detectDistance="200px",this.imgLoaded=!1,this.shouldLoad=!1}handleSrc(){if(!this.shouldLoad)return;const i=new Image;i.onload=()=>{this.image&&(this.image.src=this.src,this.imgLoaded=!0)},i.src=this.src}componentDidLoad(){"IntersectionObserver"in window?(this.el.__uxComponent=this,window.EMUxObserver||(window.EMUxObserver=new IntersectionObserver((i=>{i.forEach((i=>{if(i.isIntersecting){const t=i.target.__uxComponent;t&&(t.shouldLoad=!0,t.handleSrc()),window.EMUxObserver.unobserve(i.target)}}))}),{rootMargin:this.detectDistance})),window.EMUxObserver.observe(this.el)):(this.shouldLoad=!0,this.handleSrc())}render(){return t(s,{key:"527318220c6b48375943e897fe0e53e0f33e67ed",class:"HostContainer"},!this.imgLoaded&&t("ui-skeleton",{key:"e5c49a781ff2fac5c796cb6a3f8d334dce7be35b",class:"UiContainer",structure:"image",width:"100%",height:"100%"}),t("img",{key:"09dfbf8f52c2c899246590790f2780a84bdeefc3",ref:i=>this.image=i,src:this.shouldLoad?this.src:void 0,onLoad:()=>this.imgLoaded=!0,style:this.styles,class:"UiContainer "+(this.imgLoaded?"Visible":"Hidden"),alt:this.alt,width:this.width,height:this.height,loading:"lazy"}))}get el(){return e(this)}static get watchers(){return{src:["handleSrc"]}}};n.style=".HostContainer{display:block}.UiContainer{height:100%;width:100%;border-radius:inherit}.UiContainer .Image{border-radius:inherit}.Hidden{opacity:0;transition:opacity 0.5s ease-in-out}.Visible{opacity:1;transition:opacity 0.5s ease-in-out}";export{n as U}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as
|
|
1
|
+
import{p as r,b as t}from"./p-381d4568.js";export{s as setNonce}from"./p-381d4568.js";import{g as o}from"./p-e1255160.js";(()=>{const t=import.meta.url,o={};return""!==t&&(o.resourcesUrl=new URL(".",t).href),r(o)})().then((async r=>(await o(),t([["p-40c68e79",[[0,"ui-image",{src:[1],width:[1],height:[1],alt:[1],styles:[8],detectDistance:[1,"detect-distance"],imgLoaded:[32],shouldLoad:[32]},null,{src:["handleSrc"]}],[0,"ui-skeleton",{structure:[1],width:[1],height:[1],borderRadius:[2,"border-radius"],marginBottom:[2,"margin-bottom"],marginTop:[2,"margin-top"],marginLeft:[2,"margin-left"],marginRight:[2,"margin-right"],animation:[4],rows:[2],size:[1],color:[1],primaryColor:[1,"primary-color"],secondaryColor:[1,"secondary-color"]},null,{structure:["handleStructureChange"]}]]]],r))));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@everymatrix/ui-image",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"main": "./dist/index.cjs.js",
|
|
5
5
|
"module": "./dist/index.js",
|
|
6
6
|
"es2015": "./dist/esm/index.mjs",
|
|
@@ -24,6 +24,6 @@
|
|
|
24
24
|
"access": "public"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@everymatrix/ui-skeleton": "1.
|
|
27
|
+
"@everymatrix/ui-skeleton": "1.62.1"
|
|
28
28
|
}
|
|
29
29
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as i,h as t,g as s}from"./p-864b3ce6.js";const e=class{constructor(t){i(this,t),this.src=void 0,this.width=void 0,this.height=void 0,this.alt=void 0,this.imgClass="",this.styles=void 0,this.detectDistance="200px",this.imgLoaded=!1,this.shouldLoad=!1}handleSrc(){if(!this.shouldLoad)return;const i=new Image;i.src=this.src,i.onload=()=>{this.image&&(this.image.src=this.src,this.imgLoaded=!0,this.el.dispatchEvent(new CustomEvent("load",{bubbles:!0})))}}componentDidLoad(){"IntersectionObserver"in window?(this.el.__uxComponent=this,window.EMUxObserver||(window.EMUxObserver=new IntersectionObserver((i=>{i.forEach((i=>{if(i.isIntersecting){const t=i.target.__uxComponent;t&&(t.shouldLoad=!0,t.handleSrc()),window.EMUxObserver.unobserve(i.target)}}))}),{rootMargin:this.detectDistance})),window.EMUxObserver.observe(this.el)):(this.shouldLoad=!0,this.handleSrc())}render(){return t("img",{key:"2bb4dc391fc2f753514103e91c0abf065de3236a",ref:i=>this.image=i,style:this.styles,class:`${this.imgClass} ${this.imgLoaded?"Visible":"Hidden"}`,alt:this.alt,width:this.width,height:this.height,loading:"lazy"})}get el(){return s(this)}static get watchers(){return{src:["handleSrc"]}}};e.style=":host{display:block}.Hidden{opacity:0;transition:opacity 0.5s ease-in-out}.Visible{opacity:1;transition:opacity 0.5s ease-in-out}";export{e as U}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
var e=Object.defineProperty,t=new WeakMap,n=e=>t.get(e),l=(e,n)=>t.set(n.t=e,n),o=(e,t)=>(0,console.error)(e,t),s=new Map,i=new Map,r="slot-fb{display:contents}slot-fb[hidden]{display:none}",c="undefined"!=typeof window?window:{},u=c.document||{head:{}},a={l:0,o:"",jmp:e=>e(),raf:e=>requestAnimationFrame(e),ael:(e,t,n,l)=>e.addEventListener(t,n,l),rel:(e,t,n,l)=>e.removeEventListener(t,n,l),ce:(e,t)=>new CustomEvent(e,t)},f=e=>Promise.resolve(e),h=(()=>{try{return new CSSStyleSheet,"function"==typeof(new CSSStyleSheet).replaceSync}catch(e){}return!1})(),m=!1,d=[],p=[],y=(e,t)=>n=>{e.push(n),m||(m=!0,t&&4&a.l?w(v):a.raf(v))},$=e=>{for(let t=0;t<e.length;t++)try{e[t](performance.now())}catch(e){o(e)}e.length=0},v=()=>{$(d),$(p),(m=d.length>0)&&a.raf(v)},w=e=>f().then(e),b=y(p,!0),g={},S=e=>"object"==(e=typeof e)||"function"===e;function j(e){var t,n,l;return null!=(l=null==(n=null==(t=e.head)?void 0:t.querySelector('meta[name="csp-nonce"]'))?void 0:n.getAttribute("content"))?l:void 0}((t,n)=>{for(var l in n)e(t,l,{get:n[l],enumerable:!0})})({},{err:()=>O,map:()=>E,ok:()=>k,unwrap:()=>M,unwrapErr:()=>P});var k=e=>({isOk:!0,isErr:!1,value:e}),O=e=>({isOk:!1,isErr:!0,value:e});function E(e,t){if(e.isOk){const n=t(e.value);return n instanceof Promise?n.then((e=>k(e))):k(n)}if(e.isErr)return O(e.value);throw"should never get here"}var C,M=e=>{if(e.isOk)return e.value;throw e.value},P=e=>{if(e.isErr)return e.value;throw e.value},x=(e,t,...n)=>{let l=null,o=null,s=!1,i=!1;const r=[],c=t=>{for(let n=0;n<t.length;n++)l=t[n],Array.isArray(l)?c(l):null!=l&&"boolean"!=typeof l&&((s="function"!=typeof e&&!S(l))&&(l+=""),s&&i?r[r.length-1].i+=l:r.push(s?T(null,l):l),i=s)};if(c(n),t){t.key&&(o=t.key);{const e=t.className||t.class;e&&(t.class="object"!=typeof e?e:Object.keys(e).filter((t=>e[t])).join(" "))}}const u=T(e,null);return u.u=t,r.length>0&&(u.h=r),u.m=o,u},T=(e,t)=>({l:0,p:e,i:t,$:null,h:null,u:null,m:null}),A={},L=e=>n(e).$hostElement$,N=new WeakMap,R=e=>"sc-"+e.v,D=(e,t,n,l,o,s)=>{if(n!==l){let i=((e,t)=>t in e)(e,t);if(t.toLowerCase(),"class"===t){const t=e.classList,o=H(n),s=H(l);t.remove(...o.filter((e=>e&&!s.includes(e)))),t.add(...s.filter((e=>e&&!o.includes(e))))}else if("style"===t){for(const t in n)l&&null!=l[t]||(t.includes("-")?e.style.removeProperty(t):e.style[t]="");for(const t in l)n&&l[t]===n[t]||(t.includes("-")?e.style.setProperty(t,l[t]):e.style[t]=l[t])}else if("key"===t);else if("ref"===t)l&&l(e);else{const r=S(l);if((i||r&&null!==l)&&!o)try{if(e.tagName.includes("-"))e[t]=l;else{const o=null==l?"":l;"list"===t?i=!1:null!=n&&e[t]==o||(e[t]=o)}}catch(e){}null==l||!1===l?!1===l&&""!==e.getAttribute(t)||e.removeAttribute(t):(!i||4&s||o)&&!r&&e.setAttribute(t,l=!0===l?"":l)}}},F=/\s/,H=e=>e?e.split(F):[],U=(e,t,n)=>{const l=11===t.$.nodeType&&t.$.host?t.$.host:t.$,o=e&&e.u||g,s=t.u||g;for(const e of W(Object.keys(o)))e in s||D(l,e,o[e],void 0,n,t.l);for(const e of W(Object.keys(s)))D(l,e,o[e],s[e],n,t.l)};function W(e){return e.includes("ref")?[...e.filter((e=>"ref"!==e)),"ref"]:e}var q=!1,G=(e,t,n)=>{const l=t.h[n];let o,s,i=0;if(o=l.$=u.createElement(l.p),U(null,l,q),l.h)for(i=0;i<l.h.length;++i)s=G(e,l,i),s&&o.appendChild(s);return o["s-hn"]=C,o},V=(e,t,n,l,o,s)=>{let i,r=e;for(;o<=s;++o)l[o]&&(i=G(null,n,o),i&&(l[o].$=i,J(r,i,t)))},_=(e,t,n)=>{for(let l=t;l<=n;++l){const t=e[l];if(t){const e=t.$;I(t),e&&e.remove()}}},z=(e,t,n=!1)=>e.p===t.p&&(!!n||e.m===t.m),B=(e,t,n=!1)=>{const l=t.$=e.$,o=e.h,s=t.h;U(e,t,q),null!==o&&null!==s?((e,t,n,l,o=!1)=>{let s,i,r=0,c=0,u=0,a=0,f=t.length-1,h=t[0],m=t[f],d=l.length-1,p=l[0],y=l[d];for(;r<=f&&c<=d;)if(null==h)h=t[++r];else if(null==m)m=t[--f];else if(null==p)p=l[++c];else if(null==y)y=l[--d];else if(z(h,p,o))B(h,p,o),h=t[++r],p=l[++c];else if(z(m,y,o))B(m,y,o),m=t[--f],y=l[--d];else if(z(h,y,o))B(h,y,o),J(e,h.$,m.$.nextSibling),h=t[++r],y=l[--d];else if(z(m,p,o))B(m,p,o),J(e,m.$,h.$),m=t[--f],p=l[++c];else{for(u=-1,a=r;a<=f;++a)if(t[a]&&null!==t[a].m&&t[a].m===p.m){u=a;break}u>=0?(i=t[u],i.p!==p.p?s=G(t&&t[c],n,u):(B(i,p,o),t[u]=void 0,s=i.$),p=l[++c]):(s=G(t&&t[c],n,c),p=l[++c]),s&&J(h.$.parentNode,s,h.$)}r>f?V(e,null==l[d+1]?null:l[d+1].$,n,l,c,d):c>d&&_(t,r,f)})(l,o,t,s,n):null!==s?V(l,null,t,s,0,s.length-1):null!==o&&_(o,0,o.length-1)},I=e=>{e.u&&e.u.ref&&e.u.ref(null),e.h&&e.h.map(I)},J=(e,t,n)=>null==e?void 0:e.insertBefore(t,n),K=(e,t)=>{t&&!e.S&&t["s-p"]&&t["s-p"].push(new Promise((t=>e.S=t)))},Q=(e,t)=>{if(e.l|=16,!(4&e.l))return K(e,e.j),b((()=>X(e,t)));e.l|=512},X=(e,t)=>{const n=e.t;if(!n)throw Error(`Can't render component <${e.$hostElement$.tagName.toLowerCase()} /> with invalid Stencil runtime! Make sure this imported component is compiled with a \`externalRuntime: true\` flag. For more information, please refer to https://stenciljs.com/docs/custom-elements#externalruntime`);return Y(void 0,(()=>ee(e,n,t)))},Y=(e,t)=>Z(e)?e.then(t).catch((e=>{console.error(e),t()})):t(),Z=e=>e instanceof Promise||e&&e.then&&"function"==typeof e.then,ee=async(e,t,n)=>{var l;const o=e.$hostElement$,s=o["s-rc"];n&&(e=>{const t=e.k;((e,t)=>{var n;const l=R(t),o=i.get(l);if(e=11===e.nodeType?e:u,o)if("string"==typeof o){let s,i=N.get(e=e.head||e);if(i||N.set(e,i=new Set),!i.has(l)){{s=u.createElement("style"),s.innerHTML=o;const t=null!=(n=a.O)?n:j(u);null!=t&&s.setAttribute("nonce",t),e.insertBefore(s,e.querySelector("link"))}4&t.l&&(s.innerHTML+=r),i&&i.add(l)}}else e.adoptedStyleSheets.includes(o)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,o])})(e.$hostElement$.getRootNode(),t)})(e);te(e,t,o,n),s&&(s.map((e=>e())),o["s-rc"]=void 0);{const t=null!=(l=o["s-p"])?l:[],n=()=>ne(e);0===t.length?n():(Promise.all(t).then(n),e.l|=4,t.length=0)}},te=(e,t,n,l)=>{try{t=t.render(),e.l&=-17,e.l|=2,((e,t,n=!1)=>{const l=e.$hostElement$,o=e.C||T(null,null),s=(e=>e&&e.p===A)(t)?t:x(null,null,t);if(C=l.tagName,n&&s.u)for(const e of Object.keys(s.u))l.hasAttribute(e)&&!["key","ref","style","class"].includes(e)&&(s.u[e]=l[e]);s.p=null,s.l|=4,e.C=s,s.$=o.$=l,B(o,s,n)})(e,t,l)}catch(t){o(t,e.$hostElement$)}return null},ne=e=>{const t=e.$hostElement$,n=e.t,l=e.j;64&e.l||(e.l|=64,se(t),oe(n,"componentDidLoad"),e.M(t),l||le()),e.S&&(e.S(),e.S=void 0),512&e.l&&w((()=>Q(e,!1))),e.l&=-517},le=()=>{se(u.documentElement),w((()=>(e=>{const t=a.ce("appload",{detail:{namespace:"ui-image"}});return e.dispatchEvent(t),t})(c)))},oe=(e,t,n)=>{if(e&&e[t])try{return e[t](n)}catch(e){o(e)}},se=e=>e.classList.add("hydrated"),ie=(e,t,l)=>{var s,i;const r=e.prototype;if(t.P||t.T||e.watchers){e.watchers&&!t.T&&(t.T=e.watchers);const c=Object.entries(null!=(s=t.P)?s:{});if(c.map((([e,[s]])=>{(31&s||2&l&&32&s)&&Object.defineProperty(r,e,{get(){return((e,t)=>n(this).A.get(t))(0,e)},set(l){((e,t,l,s)=>{const i=n(e);if(!i)throw Error(`Couldn't find host element for "${s.v}" as it is unknown to this Stencil runtime. This usually happens when integrating a 3rd party Stencil component with another Stencil component or application. Please reach out to the maintainers of the 3rd party Stencil component or report this on the Stencil Discord server (https://chat.stenciljs.com) or comment on this similar [GitHub issue](https://github.com/ionic-team/stencil/issues/5457).`);const r=i.$hostElement$,c=i.A.get(t),u=i.l,a=i.t;if(l=((e,t)=>null==e||S(e)?e:1&t?e+"":e)(l,s.P[t][0]),(!(8&u)||void 0===c)&&l!==c&&(!Number.isNaN(c)||!Number.isNaN(l))&&(i.A.set(t,l),a)){if(s.T&&128&u){const e=s.T[t];e&&e.map((e=>{try{a[e](l,c,t)}catch(e){o(e,r)}}))}2==(18&u)&&Q(i,!1)}})(this,e,l,t)},configurable:!0,enumerable:!0})})),1&l){const l=new Map;r.attributeChangedCallback=function(e,o,s){a.jmp((()=>{var i;const c=l.get(e);if(this.hasOwnProperty(c))s=this[c],delete this[c];else{if(r.hasOwnProperty(c)&&"number"==typeof this[c]&&this[c]==s)return;if(null==c){const l=n(this),r=null==l?void 0:l.l;if(r&&!(8&r)&&128&r&&s!==o){const n=l.t,r=null==(i=t.T)?void 0:i[e];null==r||r.forEach((t=>{null!=n[t]&&n[t].call(n,s,o,e)}))}return}}this[c]=(null!==s||"boolean"!=typeof this[c])&&s}))},e.observedAttributes=Array.from(new Set([...Object.keys(null!=(i=t.T)?i:{}),...c.filter((([e,t])=>15&t[0])).map((([e,t])=>{const n=t[1]||e;return l.set(n,e),n}))]))}}return e},re=(e,l={})=>{var f;const m=[],d=l.exclude||[],p=c.customElements,y=u.head,$=y.querySelector("meta[charset]"),v=u.createElement("style"),w=[];let b,g=!0;Object.assign(a,l),a.o=new URL(l.resourcesUrl||"./",u.baseURI).href;let S=!1;if(e.map((e=>{e[1].map((l=>{var r;const c={l:l[0],v:l[1],P:l[2],L:l[3]};4&c.l&&(S=!0),c.P=l[2],c.T=null!=(r=l[4])?r:{};const u=c.v,f=class extends HTMLElement{constructor(e){super(e),this.hasRegisteredEventListeners=!1,((e,n)=>{const l={l:0,$hostElement$:e,k:n,A:new Map};l.N=new Promise((e=>l.M=e)),e["s-p"]=[],e["s-rc"]=[],t.set(e,l)})(e=this,c)}connectedCallback(){this.hasRegisteredEventListeners||(this.hasRegisteredEventListeners=!0),b&&(clearTimeout(b),b=null),g?w.push(this):a.jmp((()=>(e=>{if(!(1&a.l)){const t=n(e),l=t.k,r=()=>{};if(1&t.l)(null==t?void 0:t.t)||(null==t?void 0:t.N)&&t.N.then((()=>{}));else{t.l|=1;{let n=e;for(;n=n.parentNode||n.host;)if(n["s-p"]){K(t,t.j=n);break}}l.P&&Object.entries(l.P).map((([t,[n]])=>{if(31&n&&e.hasOwnProperty(t)){const n=e[t];delete e[t],e[t]=n}})),(async(e,t,n)=>{let l;if(!(32&t.l)){if(t.l|=32,n.R){const e=(e=>{const t=e.v.replace(/-/g,"_"),n=e.R;if(!n)return;const l=s.get(n);return l?l[t]:import(`./${n}.entry.js`).then((e=>(s.set(n,e),e[t])),o)
|
|
2
|
-
/*!__STENCIL_STATIC_IMPORT_SWITCH__*/})(n);if(e&&"then"in e){const t=()=>{};l=await e,t()}else l=e;if(!l)throw Error(`Constructor for "${n.v}#${t.D}" was not found`);l.isProxied||(n.T=l.watchers,ie(l,n,2),l.isProxied=!0);const i=()=>{};t.l|=8;try{new l(t)}catch(e){o(e)}t.l&=-9,t.l|=128,i()}else l=e.constructor,customElements.whenDefined(e.localName).then((()=>t.l|=128));if(l&&l.style){let e;"string"==typeof l.style&&(e=l.style);const t=R(n);if(!i.has(t)){const l=()=>{};((e,t,n)=>{let l=i.get(e);h&&n?(l=l||new CSSStyleSheet,"string"==typeof l?l=t:l.replaceSync(t)):l=t,i.set(e,l)})(t,e,!!(1&n.l)),l()}}}const r=t.j,c=()=>Q(t,!0);r&&r["s-rc"]?r["s-rc"].push(c):c()})(e,t,l)}r()}})(this)))}disconnectedCallback(){a.jmp((()=>(async()=>{if(!(1&a.l)){const e=n(this);(null==e?void 0:e.t)||(null==e?void 0:e.N)&&e.N.then((()=>{}))}})()))}componentOnReady(){return n(this).N}};c.R=e[0],d.includes(u)||p.get(u)||(m.push(u),p.define(u,ie(f,c,1)))}))})),m.length>0&&(S&&(v.textContent+=r),v.textContent+=m.sort()+"{visibility:hidden}.hydrated{visibility:inherit}",v.innerHTML.length)){v.setAttribute("data-styles","");const e=null!=(f=a.O)?f:j(u);null!=e&&v.setAttribute("nonce",e),y.insertBefore(v,$?$.nextSibling:y.firstChild)}g=!1,w.length?w.map((e=>e.connectedCallback())):a.jmp((()=>b=setTimeout(le,30)))},ce=e=>a.O=e;export{re as b,L as g,x as h,f as p,l as r,ce as s}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export{U as ui_image}from"./p-37874c44.js";import"./p-864b3ce6.js";
|