@everymatrix/ui-image 0.1.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/app-globals-3a1e7e63.js +5 -0
- package/dist/cjs/index-bdabfcc4.js +1134 -0
- package/dist/cjs/index.cjs.js +10 -0
- package/dist/cjs/loader.cjs.js +15 -0
- package/dist/cjs/ui-image-e059fe64.js +69 -0
- package/dist/cjs/ui-image.cjs.entry.js +10 -0
- package/dist/cjs/ui-image.cjs.js +25 -0
- package/dist/collection/collection-manifest.json +12 -0
- package/dist/collection/components/ui-image/index.js +1 -0
- package/dist/collection/components/ui-image/ui-image.css +13 -0
- package/dist/collection/components/ui-image/ui-image.js +204 -0
- package/dist/collection/index.js +1 -0
- package/dist/collection/utils/utils.js +3 -0
- package/dist/esm/app-globals-0f993ce5.js +3 -0
- package/dist/esm/index-b7bbd57e.js +1107 -0
- package/dist/esm/index.js +2 -0
- package/dist/esm/loader.js +11 -0
- package/dist/esm/ui-image-38c3c15f.js +67 -0
- package/dist/esm/ui-image.entry.js +2 -0
- package/dist/esm/ui-image.js +20 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.js +1 -0
- package/dist/stencil.config.dev.js +17 -0
- package/dist/stencil.config.js +17 -0
- package/dist/storybook/main.js +21 -0
- package/dist/storybook/preview.js +9 -0
- package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/ui-image/.stencil/packages/stencil/ui-image/stencil.config.d.ts +2 -0
- package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/ui-image/.stencil/packages/stencil/ui-image/stencil.config.dev.d.ts +2 -0
- package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/ui-image/.stencil/packages/stencil/ui-image/storybook/main.d.ts +3 -0
- package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/ui-image/.stencil/packages/stencil/ui-image/storybook/preview.d.ts +70 -0
- package/dist/types/components/ui-image/index.d.ts +1 -0
- package/dist/types/components/ui-image/ui-image.d.ts +23 -0
- package/dist/types/components.d.ts +93 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/stencil-public-runtime.d.ts +1674 -0
- package/dist/types/utils/utils.d.ts +1 -0
- package/dist/ui-image/index.esm.js +1 -0
- package/dist/ui-image/p-37874c44.js +1 -0
- package/dist/ui-image/p-864b3ce6.js +2 -0
- package/dist/ui-image/p-9da68072.entry.js +1 -0
- package/dist/ui-image/p-e1255160.js +1 -0
- package/dist/ui-image/ui-image.esm.js +1 -0
- package/loader/cdn.js +1 -0
- package/loader/index.cjs.js +1 -0
- package/loader/index.d.ts +24 -0
- package/loader/index.es2017.js +1 -0
- package/loader/index.js +2 -0
- package/loader/package.json +11 -0
- package/package.json +29 -0
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { b as bootstrapLazy } from './index-b7bbd57e.js';
|
|
2
|
+
export { s as setNonce } from './index-b7bbd57e.js';
|
|
3
|
+
import { g as globalScripts } from './app-globals-0f993ce5.js';
|
|
4
|
+
|
|
5
|
+
const defineCustomElements = async (win, options) => {
|
|
6
|
+
if (typeof window === 'undefined') return undefined;
|
|
7
|
+
await globalScripts();
|
|
8
|
+
return bootstrapLazy([["ui-image",[[0,"ui-image",{"src":[1],"width":[1],"height":[1],"alt":[1],"imgClass":[1,"img-class"],"styles":[8],"detectDistance":[1,"detect-distance"],"imgLoaded":[32],"shouldLoad":[32]},null,{"src":["handleSrc"]}]]]], options);
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export { defineCustomElements };
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { r as registerInstance, h, g as getElement } from './index-b7bbd57e.js';
|
|
2
|
+
|
|
3
|
+
const uiImageCss = ":host{display:block}.Hidden{opacity:0;transition:opacity 0.5s ease-in-out}.Visible{opacity:1;transition:opacity 0.5s ease-in-out}";
|
|
4
|
+
const UiImageStyle0 = uiImageCss;
|
|
5
|
+
|
|
6
|
+
const UiImage = class {
|
|
7
|
+
constructor(hostRef) {
|
|
8
|
+
registerInstance(this, hostRef);
|
|
9
|
+
this.src = undefined;
|
|
10
|
+
this.width = undefined;
|
|
11
|
+
this.height = undefined;
|
|
12
|
+
this.alt = undefined;
|
|
13
|
+
this.imgClass = '';
|
|
14
|
+
this.styles = undefined;
|
|
15
|
+
this.detectDistance = '200px';
|
|
16
|
+
this.imgLoaded = false;
|
|
17
|
+
this.shouldLoad = false;
|
|
18
|
+
}
|
|
19
|
+
handleSrc() {
|
|
20
|
+
if (!this.shouldLoad) {
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
const tempImage = new Image();
|
|
24
|
+
tempImage.src = this.src;
|
|
25
|
+
tempImage.onload = () => {
|
|
26
|
+
if (this.image) {
|
|
27
|
+
this.image.src = this.src;
|
|
28
|
+
this.imgLoaded = true;
|
|
29
|
+
this.el.dispatchEvent(new CustomEvent('load', { bubbles: true }));
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
componentDidLoad() {
|
|
34
|
+
if ('IntersectionObserver' in window) {
|
|
35
|
+
this.el.__uxComponent = this;
|
|
36
|
+
if (!window.EMUxObserver) {
|
|
37
|
+
window.EMUxObserver = new IntersectionObserver((entries) => {
|
|
38
|
+
entries.forEach(entry => {
|
|
39
|
+
if (entry.isIntersecting) {
|
|
40
|
+
const comp = entry.target.__uxComponent;
|
|
41
|
+
if (comp) {
|
|
42
|
+
comp.shouldLoad = true;
|
|
43
|
+
comp.handleSrc();
|
|
44
|
+
}
|
|
45
|
+
window.EMUxObserver.unobserve(entry.target);
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
}, { rootMargin: this.detectDistance });
|
|
49
|
+
}
|
|
50
|
+
window.EMUxObserver.observe(this.el);
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
this.shouldLoad = true;
|
|
54
|
+
this.handleSrc();
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
render() {
|
|
58
|
+
return (h("img", { key: '2bb4dc391fc2f753514103e91c0abf065de3236a', ref: el => (this.image = el), style: this.styles, class: `${this.imgClass} ${this.imgLoaded ? 'Visible' : 'Hidden'}`, alt: this.alt, width: this.width, height: this.height, loading: "lazy" }));
|
|
59
|
+
}
|
|
60
|
+
get el() { return getElement(this); }
|
|
61
|
+
static get watchers() { return {
|
|
62
|
+
"src": ["handleSrc"]
|
|
63
|
+
}; }
|
|
64
|
+
};
|
|
65
|
+
UiImage.style = UiImageStyle0;
|
|
66
|
+
|
|
67
|
+
export { UiImage as U };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { p as promiseResolve, b as bootstrapLazy } from './index-b7bbd57e.js';
|
|
2
|
+
export { s as setNonce } from './index-b7bbd57e.js';
|
|
3
|
+
import { g as globalScripts } from './app-globals-0f993ce5.js';
|
|
4
|
+
|
|
5
|
+
/*
|
|
6
|
+
Stencil Client Patch Browser v4.19.2 | MIT Licensed | https://stenciljs.com
|
|
7
|
+
*/
|
|
8
|
+
var patchBrowser = () => {
|
|
9
|
+
const importMeta = import.meta.url;
|
|
10
|
+
const opts = {};
|
|
11
|
+
if (importMeta !== "") {
|
|
12
|
+
opts.resourcesUrl = new URL(".", importMeta).href;
|
|
13
|
+
}
|
|
14
|
+
return promiseResolve(opts);
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
patchBrowser().then(async (options) => {
|
|
18
|
+
await globalScripts();
|
|
19
|
+
return bootstrapLazy([["ui-image",[[0,"ui-image",{"src":[1],"width":[1],"height":[1],"alt":[1],"imgClass":[1,"img-class"],"styles":[8],"detectDistance":[1,"detect-distance"],"imgLoaded":[32],"shouldLoad":[32]},null,{"src":["handleSrc"]}]]]], options);
|
|
20
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require('./cjs/index.cjs.js');
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './esm/index.js';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { sass } from "@stencil/sass";
|
|
2
|
+
export const config = {
|
|
3
|
+
namespace: 'ui-image',
|
|
4
|
+
taskQueue: 'async',
|
|
5
|
+
sourceMap: false,
|
|
6
|
+
minifyJs: true,
|
|
7
|
+
extras: {
|
|
8
|
+
experimentalImportInjection: true
|
|
9
|
+
},
|
|
10
|
+
plugins: [sass()],
|
|
11
|
+
outputTargets: [
|
|
12
|
+
{
|
|
13
|
+
type: 'www',
|
|
14
|
+
serviceWorker: null // disable service workers
|
|
15
|
+
}
|
|
16
|
+
]
|
|
17
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { sass } from "@stencil/sass";
|
|
2
|
+
export const config = {
|
|
3
|
+
namespace: 'ui-image',
|
|
4
|
+
taskQueue: 'async',
|
|
5
|
+
sourceMap: false,
|
|
6
|
+
minifyJs: true,
|
|
7
|
+
extras: {
|
|
8
|
+
experimentalImportInjection: true
|
|
9
|
+
},
|
|
10
|
+
plugins: [sass()],
|
|
11
|
+
outputTargets: [
|
|
12
|
+
{
|
|
13
|
+
type: 'dist',
|
|
14
|
+
esmLoaderPath: '../loader'
|
|
15
|
+
}
|
|
16
|
+
]
|
|
17
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import * as path from "path";
|
|
2
|
+
const config = {
|
|
3
|
+
stories: ['../**/*.@(mdx|stories.@(js|ts|tsx))'],
|
|
4
|
+
addons: ['@storybook/addon-essentials', '@storybook/addon-interactions', 'storybook-dark-mode'],
|
|
5
|
+
docs: {
|
|
6
|
+
defaultName: 'Documentation',
|
|
7
|
+
autodocs: 'tag'
|
|
8
|
+
},
|
|
9
|
+
framework: {
|
|
10
|
+
name: '@storybook/web-components-vite',
|
|
11
|
+
options: {}
|
|
12
|
+
},
|
|
13
|
+
viteFinal: async (config) => {
|
|
14
|
+
return Object.assign(Object.assign({}, config), { resolve: {
|
|
15
|
+
alias: {
|
|
16
|
+
'ui-image': path.resolve(__dirname, '../../../../dist/packages/stencil/ui-image')
|
|
17
|
+
}
|
|
18
|
+
} });
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
export default config;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { themes } from "@storybook/theming";
|
|
2
|
+
export const parameters = {
|
|
3
|
+
darkMode: {
|
|
4
|
+
dark: Object.assign(Object.assign({}, themes.dark), { appBg: 'black' }),
|
|
5
|
+
light: Object.assign(Object.assign({}, themes.normal), { appBg: 'green' }),
|
|
6
|
+
current: 'light',
|
|
7
|
+
stylePreview: true
|
|
8
|
+
}
|
|
9
|
+
};
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
export declare const parameters: {
|
|
2
|
+
darkMode: {
|
|
3
|
+
dark: {
|
|
4
|
+
appBg: string;
|
|
5
|
+
base: "light" | "dark";
|
|
6
|
+
colorPrimary: string;
|
|
7
|
+
colorSecondary: string;
|
|
8
|
+
appContentBg: string;
|
|
9
|
+
appPreviewBg: string;
|
|
10
|
+
appBorderColor: string;
|
|
11
|
+
appBorderRadius: number;
|
|
12
|
+
fontBase: string;
|
|
13
|
+
fontCode: string;
|
|
14
|
+
textColor: string;
|
|
15
|
+
textInverseColor: string;
|
|
16
|
+
textMutedColor: string;
|
|
17
|
+
barTextColor: string;
|
|
18
|
+
barHoverColor: string;
|
|
19
|
+
barSelectedColor: string;
|
|
20
|
+
barBg: string;
|
|
21
|
+
buttonBg: string;
|
|
22
|
+
buttonBorder: string;
|
|
23
|
+
booleanBg: string;
|
|
24
|
+
booleanSelectedBg: string;
|
|
25
|
+
inputBg: string;
|
|
26
|
+
inputBorder: string;
|
|
27
|
+
inputTextColor: string;
|
|
28
|
+
inputBorderRadius: number;
|
|
29
|
+
brandTitle?: string;
|
|
30
|
+
brandUrl?: string;
|
|
31
|
+
brandImage?: string;
|
|
32
|
+
brandTarget?: string;
|
|
33
|
+
gridCellSize?: number;
|
|
34
|
+
};
|
|
35
|
+
light: {
|
|
36
|
+
appBg: string;
|
|
37
|
+
base: "light" | "dark";
|
|
38
|
+
colorPrimary: string;
|
|
39
|
+
colorSecondary: string;
|
|
40
|
+
appContentBg: string;
|
|
41
|
+
appPreviewBg: string;
|
|
42
|
+
appBorderColor: string;
|
|
43
|
+
appBorderRadius: number;
|
|
44
|
+
fontBase: string;
|
|
45
|
+
fontCode: string;
|
|
46
|
+
textColor: string;
|
|
47
|
+
textInverseColor: string;
|
|
48
|
+
textMutedColor: string;
|
|
49
|
+
barTextColor: string;
|
|
50
|
+
barHoverColor: string;
|
|
51
|
+
barSelectedColor: string;
|
|
52
|
+
barBg: string;
|
|
53
|
+
buttonBg: string;
|
|
54
|
+
buttonBorder: string;
|
|
55
|
+
booleanBg: string;
|
|
56
|
+
booleanSelectedBg: string;
|
|
57
|
+
inputBg: string;
|
|
58
|
+
inputBorder: string;
|
|
59
|
+
inputTextColor: string;
|
|
60
|
+
inputBorderRadius: number;
|
|
61
|
+
brandTitle?: string;
|
|
62
|
+
brandUrl?: string;
|
|
63
|
+
brandImage?: string;
|
|
64
|
+
brandTarget?: string;
|
|
65
|
+
gridCellSize?: number;
|
|
66
|
+
};
|
|
67
|
+
current: string;
|
|
68
|
+
stylePreview: boolean;
|
|
69
|
+
};
|
|
70
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { UiImage } from './ui-image';
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export declare class UiImage {
|
|
2
|
+
/** Source of the image */
|
|
3
|
+
src: string;
|
|
4
|
+
/** Width of the image */
|
|
5
|
+
width: string;
|
|
6
|
+
/** Height of the image */
|
|
7
|
+
height: string;
|
|
8
|
+
/** Alt of the image */
|
|
9
|
+
alt: string;
|
|
10
|
+
/** Allow external class for the inner image element */
|
|
11
|
+
imgClass: string;
|
|
12
|
+
/** Allow inline styles */
|
|
13
|
+
styles: any;
|
|
14
|
+
/** Distance for the image to be detected */
|
|
15
|
+
detectDistance: string;
|
|
16
|
+
private imgLoaded;
|
|
17
|
+
private shouldLoad;
|
|
18
|
+
el: HTMLElement;
|
|
19
|
+
private image;
|
|
20
|
+
handleSrc(): void;
|
|
21
|
+
componentDidLoad(): void;
|
|
22
|
+
render(): any;
|
|
23
|
+
}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
/* tslint:disable */
|
|
3
|
+
/**
|
|
4
|
+
* This is an autogenerated file created by the Stencil compiler.
|
|
5
|
+
* It contains typing information for all components that exist in this project.
|
|
6
|
+
*/
|
|
7
|
+
import { HTMLStencilElement, JSXBase } from "./stencil-public-runtime";
|
|
8
|
+
export namespace Components {
|
|
9
|
+
interface UiImage {
|
|
10
|
+
/**
|
|
11
|
+
* Alt of the image
|
|
12
|
+
*/
|
|
13
|
+
"alt": string;
|
|
14
|
+
/**
|
|
15
|
+
* Distance for the image to be detected
|
|
16
|
+
*/
|
|
17
|
+
"detectDistance": string;
|
|
18
|
+
/**
|
|
19
|
+
* Height of the image
|
|
20
|
+
*/
|
|
21
|
+
"height": string;
|
|
22
|
+
/**
|
|
23
|
+
* Allow external class for the inner image element
|
|
24
|
+
*/
|
|
25
|
+
"imgClass": string;
|
|
26
|
+
/**
|
|
27
|
+
* Source of the image
|
|
28
|
+
*/
|
|
29
|
+
"src": string;
|
|
30
|
+
/**
|
|
31
|
+
* Allow inline styles
|
|
32
|
+
*/
|
|
33
|
+
"styles": any;
|
|
34
|
+
/**
|
|
35
|
+
* Width of the image
|
|
36
|
+
*/
|
|
37
|
+
"width": string;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
declare global {
|
|
41
|
+
interface HTMLUiImageElement extends Components.UiImage, HTMLStencilElement {
|
|
42
|
+
}
|
|
43
|
+
var HTMLUiImageElement: {
|
|
44
|
+
prototype: HTMLUiImageElement;
|
|
45
|
+
new (): HTMLUiImageElement;
|
|
46
|
+
};
|
|
47
|
+
interface HTMLElementTagNameMap {
|
|
48
|
+
"ui-image": HTMLUiImageElement;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
declare namespace LocalJSX {
|
|
52
|
+
interface UiImage {
|
|
53
|
+
/**
|
|
54
|
+
* Alt of the image
|
|
55
|
+
*/
|
|
56
|
+
"alt"?: string;
|
|
57
|
+
/**
|
|
58
|
+
* Distance for the image to be detected
|
|
59
|
+
*/
|
|
60
|
+
"detectDistance"?: string;
|
|
61
|
+
/**
|
|
62
|
+
* Height of the image
|
|
63
|
+
*/
|
|
64
|
+
"height"?: string;
|
|
65
|
+
/**
|
|
66
|
+
* Allow external class for the inner image element
|
|
67
|
+
*/
|
|
68
|
+
"imgClass"?: string;
|
|
69
|
+
/**
|
|
70
|
+
* Source of the image
|
|
71
|
+
*/
|
|
72
|
+
"src"?: string;
|
|
73
|
+
/**
|
|
74
|
+
* Allow inline styles
|
|
75
|
+
*/
|
|
76
|
+
"styles"?: any;
|
|
77
|
+
/**
|
|
78
|
+
* Width of the image
|
|
79
|
+
*/
|
|
80
|
+
"width"?: string;
|
|
81
|
+
}
|
|
82
|
+
interface IntrinsicElements {
|
|
83
|
+
"ui-image": UiImage;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
export { LocalJSX as JSX };
|
|
87
|
+
declare module "@stencil/core" {
|
|
88
|
+
export namespace JSX {
|
|
89
|
+
interface IntrinsicElements {
|
|
90
|
+
"ui-image": LocalJSX.UiImage & JSXBase.HTMLAttributes<HTMLUiImageElement>;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './components/ui-image';
|