@studiometa/ui 1.0.0-alpha.0 → 1.0.0-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -4
- package/atoms/Data/DataBind.d.ts +1 -1
- package/atoms/Data/DataBind.js +12 -5
- package/atoms/Data/DataBind.js.map +2 -2
- package/atoms/Data/DataComputed.js +1 -1
- package/atoms/Data/DataComputed.js.map +2 -2
- package/atoms/Data/DataModel.d.ts +1 -0
- package/atoms/Data/DataModel.js +13 -3
- package/atoms/Data/DataModel.js.map +2 -2
- package/package.json +1 -1
- package/atoms/Action/Action.cjs +0 -115
- package/atoms/Action/Action.cjs.map +0 -7
- package/atoms/Action/Target.cjs +0 -35
- package/atoms/Action/Target.cjs.map +0 -7
- package/atoms/Action/index.cjs +0 -22
- package/atoms/Action/index.cjs.map +0 -7
- package/atoms/AnchorScrollTo/AnchorScrollTo.cjs +0 -52
- package/atoms/AnchorScrollTo/AnchorScrollTo.cjs.map +0 -7
- package/atoms/AnchorScrollTo/index.cjs +0 -21
- package/atoms/AnchorScrollTo/index.cjs.map +0 -7
- package/atoms/CircularMarquee/CircularMarquee.cjs +0 -69
- package/atoms/CircularMarquee/CircularMarquee.cjs.map +0 -7
- package/atoms/CircularMarquee/index.cjs +0 -21
- package/atoms/CircularMarquee/index.cjs.map +0 -7
- package/atoms/Cursor/Cursor.cjs +0 -137
- package/atoms/Cursor/Cursor.cjs.map +0 -7
- package/atoms/Cursor/index.cjs +0 -21
- package/atoms/Cursor/index.cjs.map +0 -7
- package/atoms/Data/DataBind.cjs +0 -124
- package/atoms/Data/DataBind.cjs.map +0 -7
- package/atoms/Data/DataComputed.cjs +0 -49
- package/atoms/Data/DataComputed.cjs.map +0 -7
- package/atoms/Data/DataEffect.cjs +0 -47
- package/atoms/Data/DataEffect.cjs.map +0 -7
- package/atoms/Data/DataModel.cjs +0 -38
- package/atoms/Data/DataModel.cjs.map +0 -7
- package/atoms/Data/index.cjs +0 -24
- package/atoms/Data/index.cjs.map +0 -7
- package/atoms/Data/utils.cjs +0 -46
- package/atoms/Data/utils.cjs.map +0 -7
- package/atoms/Figure/Figure.cjs +0 -105
- package/atoms/Figure/Figure.cjs.map +0 -7
- package/atoms/Figure/FigureTwicpics.cjs +0 -123
- package/atoms/Figure/FigureTwicpics.cjs.map +0 -7
- package/atoms/Figure/index.cjs +0 -22
- package/atoms/Figure/index.cjs.map +0 -7
- package/atoms/FigureVideo/FigureVideo.cjs +0 -132
- package/atoms/FigureVideo/FigureVideo.cjs.map +0 -7
- package/atoms/FigureVideo/FigureVideoTwicpics.cjs +0 -153
- package/atoms/FigureVideo/FigureVideoTwicpics.cjs.map +0 -7
- package/atoms/FigureVideo/index.cjs +0 -22
- package/atoms/FigureVideo/index.cjs.map +0 -7
- package/atoms/LargeText/LargeText.cjs +0 -109
- package/atoms/LargeText/LargeText.cjs.map +0 -7
- package/atoms/LargeText/index.cjs +0 -21
- package/atoms/LargeText/index.cjs.map +0 -7
- package/atoms/LazyInclude/LazyInclude.cjs +0 -78
- package/atoms/LazyInclude/LazyInclude.cjs.map +0 -7
- package/atoms/LazyInclude/index.cjs +0 -21
- package/atoms/LazyInclude/index.cjs.map +0 -7
- package/atoms/Prefetch/AbstractPrefetch.cjs +0 -86
- package/atoms/Prefetch/AbstractPrefetch.cjs.map +0 -7
- package/atoms/Prefetch/PrefetchWhenOver.cjs +0 -42
- package/atoms/Prefetch/PrefetchWhenOver.cjs.map +0 -7
- package/atoms/Prefetch/PrefetchWhenVisible.cjs +0 -43
- package/atoms/Prefetch/PrefetchWhenVisible.cjs.map +0 -7
- package/atoms/Prefetch/index.cjs +0 -23
- package/atoms/Prefetch/index.cjs.map +0 -7
- package/atoms/ScrollAnimation/AbstractScrollAnimation.cjs +0 -95
- package/atoms/ScrollAnimation/AbstractScrollAnimation.cjs.map +0 -7
- package/atoms/ScrollAnimation/ScrollAnimation.cjs +0 -44
- package/atoms/ScrollAnimation/ScrollAnimation.cjs.map +0 -7
- package/atoms/ScrollAnimation/ScrollAnimationChild.cjs +0 -84
- package/atoms/ScrollAnimation/ScrollAnimationChild.cjs.map +0 -7
- package/atoms/ScrollAnimation/ScrollAnimationChildWithEase.cjs +0 -37
- package/atoms/ScrollAnimation/ScrollAnimationChildWithEase.cjs.map +0 -7
- package/atoms/ScrollAnimation/ScrollAnimationParent.cjs +0 -50
- package/atoms/ScrollAnimation/ScrollAnimationParent.cjs.map +0 -7
- package/atoms/ScrollAnimation/ScrollAnimationWithEase.cjs +0 -37
- package/atoms/ScrollAnimation/ScrollAnimationWithEase.cjs.map +0 -7
- package/atoms/ScrollAnimation/animationScrollWithEase.cjs +0 -59
- package/atoms/ScrollAnimation/animationScrollWithEase.cjs.map +0 -7
- package/atoms/ScrollAnimation/index.cjs +0 -27
- package/atoms/ScrollAnimation/index.cjs.map +0 -7
- package/atoms/ScrollReveal/ScrollReveal.cjs +0 -81
- package/atoms/ScrollReveal/ScrollReveal.cjs.map +0 -7
- package/atoms/ScrollReveal/index.cjs +0 -21
- package/atoms/ScrollReveal/index.cjs.map +0 -7
- package/atoms/index.cjs +0 -32
- package/atoms/index.cjs.map +0 -7
- package/decorators/index.cjs +0 -22
- package/decorators/index.cjs.map +0 -7
- package/decorators/withDeprecation.cjs +0 -47
- package/decorators/withDeprecation.cjs.map +0 -7
- package/decorators/withTransition.cjs +0 -86
- package/decorators/withTransition.cjs.map +0 -7
- package/index.cjs +0 -25
- package/index.cjs.map +0 -7
- package/molecules/Accordion/Accordion.cjs +0 -36
- package/molecules/Accordion/Accordion.cjs.map +0 -7
- package/molecules/Accordion/AccordionCore.cjs +0 -58
- package/molecules/Accordion/AccordionCore.cjs.map +0 -7
- package/molecules/Accordion/AccordionItem.cjs +0 -206
- package/molecules/Accordion/AccordionItem.cjs.map +0 -7
- package/molecules/Accordion/index.cjs +0 -22
- package/molecules/Accordion/index.cjs.map +0 -7
- package/molecules/AnchorNav/AnchorNav.cjs +0 -63
- package/molecules/AnchorNav/AnchorNav.cjs.map +0 -7
- package/molecules/AnchorNav/AnchorNavLink.cjs +0 -40
- package/molecules/AnchorNav/AnchorNavLink.cjs.map +0 -7
- package/molecules/AnchorNav/AnchorNavTarget.cjs +0 -35
- package/molecules/AnchorNav/AnchorNavTarget.cjs.map +0 -7
- package/molecules/AnchorNav/index.cjs +0 -23
- package/molecules/AnchorNav/index.cjs.map +0 -7
- package/molecules/Menu/Menu.cjs +0 -177
- package/molecules/Menu/Menu.cjs.map +0 -7
- package/molecules/Menu/MenuBtn.cjs +0 -66
- package/molecules/Menu/MenuBtn.cjs.map +0 -7
- package/molecules/Menu/MenuList.cjs +0 -165
- package/molecules/Menu/MenuList.cjs.map +0 -7
- package/molecules/Menu/index.cjs +0 -23
- package/molecules/Menu/index.cjs.map +0 -7
- package/molecules/Modal/Modal.cjs +0 -219
- package/molecules/Modal/Modal.cjs.map +0 -7
- package/molecules/Modal/ModalWithTransition.cjs +0 -69
- package/molecules/Modal/ModalWithTransition.cjs.map +0 -7
- package/molecules/Modal/index.cjs +0 -22
- package/molecules/Modal/index.cjs.map +0 -7
- package/molecules/Panel/Panel.cjs +0 -137
- package/molecules/Panel/Panel.cjs.map +0 -7
- package/molecules/Panel/index.cjs +0 -21
- package/molecules/Panel/index.cjs.map +0 -7
- package/molecules/Slider/AbstractSliderChild.cjs +0 -88
- package/molecules/Slider/AbstractSliderChild.cjs.map +0 -7
- package/molecules/Slider/Slider.cjs +0 -404
- package/molecules/Slider/Slider.cjs.map +0 -7
- package/molecules/Slider/SliderBtn.cjs +0 -71
- package/molecules/Slider/SliderBtn.cjs.map +0 -7
- package/molecules/Slider/SliderCount.cjs +0 -44
- package/molecules/Slider/SliderCount.cjs.map +0 -7
- package/molecules/Slider/SliderDots.cjs +0 -64
- package/molecules/Slider/SliderDots.cjs.map +0 -7
- package/molecules/Slider/SliderDrag.cjs +0 -66
- package/molecules/Slider/SliderDrag.cjs.map +0 -7
- package/molecules/Slider/SliderItem.cjs +0 -177
- package/molecules/Slider/SliderItem.cjs.map +0 -7
- package/molecules/Slider/SliderProgress.cjs +0 -49
- package/molecules/Slider/SliderProgress.cjs.map +0 -7
- package/molecules/Slider/index.cjs +0 -28
- package/molecules/Slider/index.cjs.map +0 -7
- package/molecules/Sticky/Sticky.cjs +0 -177
- package/molecules/Sticky/Sticky.cjs.map +0 -7
- package/molecules/Sticky/index.cjs +0 -21
- package/molecules/Sticky/index.cjs.map +0 -7
- package/molecules/TableOfContent/TableOfContent.cjs +0 -72
- package/molecules/TableOfContent/TableOfContent.cjs.map +0 -7
- package/molecules/TableOfContent/TableOfContentAnchor.cjs +0 -76
- package/molecules/TableOfContent/TableOfContentAnchor.cjs.map +0 -7
- package/molecules/TableOfContent/index.cjs +0 -22
- package/molecules/TableOfContent/index.cjs.map +0 -7
- package/molecules/Tabs/Tabs.cjs +0 -153
- package/molecules/Tabs/Tabs.cjs.map +0 -7
- package/molecules/Tabs/index.cjs +0 -21
- package/molecules/Tabs/index.cjs.map +0 -7
- package/molecules/index.cjs +0 -30
- package/molecules/index.cjs.map +0 -7
- package/organisms/Frame/Frame.cjs +0 -220
- package/organisms/Frame/Frame.cjs.map +0 -7
- package/organisms/Frame/FrameAnchor.cjs +0 -41
- package/organisms/Frame/FrameAnchor.cjs.map +0 -7
- package/organisms/Frame/FrameForm.cjs +0 -41
- package/organisms/Frame/FrameForm.cjs.map +0 -7
- package/organisms/Frame/FrameTarget.cjs +0 -114
- package/organisms/Frame/FrameTarget.cjs.map +0 -7
- package/organisms/Frame/index.cjs +0 -24
- package/organisms/Frame/index.cjs.map +0 -7
- package/organisms/index.cjs +0 -21
- package/organisms/index.cjs.map +0 -7
- package/primitives/Draggable/Draggable.cjs +0 -65
- package/primitives/Draggable/Draggable.cjs.map +0 -7
- package/primitives/Draggable/index.cjs +0 -21
- package/primitives/Draggable/index.cjs.map +0 -7
- package/primitives/Sentinel/Sentinel.cjs +0 -35
- package/primitives/Sentinel/Sentinel.cjs.map +0 -7
- package/primitives/Sentinel/index.cjs +0 -21
- package/primitives/Sentinel/index.cjs.map +0 -7
- package/primitives/Transition/Transition.cjs +0 -36
- package/primitives/Transition/Transition.cjs.map +0 -7
- package/primitives/Transition/index.cjs +0 -21
- package/primitives/Transition/index.cjs.map +0 -7
- package/primitives/index.cjs +0 -23
- package/primitives/index.cjs.map +0 -7
package/atoms/Figure/Figure.cjs
DELETED
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __export = (target, all) => {
|
|
6
|
-
for (var name in all)
|
|
7
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
-
};
|
|
9
|
-
var __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
-
}
|
|
15
|
-
return to;
|
|
16
|
-
};
|
|
17
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
-
|
|
19
|
-
// packages/ui/atoms/Figure/Figure.ts
|
|
20
|
-
var Figure_exports = {};
|
|
21
|
-
__export(Figure_exports, {
|
|
22
|
-
Figure: () => Figure,
|
|
23
|
-
loadImage: () => loadImage
|
|
24
|
-
});
|
|
25
|
-
module.exports = __toCommonJS(Figure_exports);
|
|
26
|
-
var import_js_toolkit = require("@studiometa/js-toolkit");
|
|
27
|
-
var import_primitives = require("../../primitives/index.cjs");
|
|
28
|
-
function loadImage(src) {
|
|
29
|
-
return new Promise((resolve) => {
|
|
30
|
-
const img = new Image();
|
|
31
|
-
img.addEventListener("load", () => resolve(img));
|
|
32
|
-
img.src = src;
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
var Figure = class extends (0, import_js_toolkit.withMountWhenInView)(
|
|
36
|
-
import_primitives.Transition,
|
|
37
|
-
{
|
|
38
|
-
threshold: [0, 1]
|
|
39
|
-
}
|
|
40
|
-
) {
|
|
41
|
-
/**
|
|
42
|
-
* Config.
|
|
43
|
-
*/
|
|
44
|
-
static config = {
|
|
45
|
-
...import_primitives.Transition.config,
|
|
46
|
-
name: "Figure",
|
|
47
|
-
emits: ["load"],
|
|
48
|
-
refs: ["img"],
|
|
49
|
-
options: {
|
|
50
|
-
...import_primitives.Transition.config.options,
|
|
51
|
-
lazy: Boolean
|
|
52
|
-
}
|
|
53
|
-
};
|
|
54
|
-
/**
|
|
55
|
-
* Get the transition target.
|
|
56
|
-
*/
|
|
57
|
-
get target() {
|
|
58
|
-
return this.$refs.img;
|
|
59
|
-
}
|
|
60
|
-
/**
|
|
61
|
-
* Get the image source.
|
|
62
|
-
*/
|
|
63
|
-
get src() {
|
|
64
|
-
return this.$refs.img.src;
|
|
65
|
-
}
|
|
66
|
-
/**
|
|
67
|
-
* Set the image source.
|
|
68
|
-
*/
|
|
69
|
-
set src(value) {
|
|
70
|
-
this.$refs.img.src = value;
|
|
71
|
-
}
|
|
72
|
-
/**
|
|
73
|
-
* Get the original source.
|
|
74
|
-
*/
|
|
75
|
-
get original() {
|
|
76
|
-
return this.$refs.img.dataset.src;
|
|
77
|
-
}
|
|
78
|
-
/**
|
|
79
|
-
* Load on mount.
|
|
80
|
-
*/
|
|
81
|
-
async mounted() {
|
|
82
|
-
const { img } = this.$refs;
|
|
83
|
-
if (!img) {
|
|
84
|
-
throw new Error("[Figure] The `img` ref is required.");
|
|
85
|
-
}
|
|
86
|
-
if (!(img instanceof HTMLImageElement)) {
|
|
87
|
-
throw new Error("[Figure] The `img` ref must be an `<img>` element.");
|
|
88
|
-
}
|
|
89
|
-
const src = this.original;
|
|
90
|
-
if (this.$options.lazy && src && src !== this.src) {
|
|
91
|
-
await loadImage(src);
|
|
92
|
-
this.src = src;
|
|
93
|
-
this.enter();
|
|
94
|
-
this.$emit("load");
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
/**
|
|
98
|
-
* Terminate the component on load.
|
|
99
|
-
*/
|
|
100
|
-
onLoad() {
|
|
101
|
-
this.$terminate();
|
|
102
|
-
}
|
|
103
|
-
};
|
|
104
|
-
if (module.exports.default) module.exports = module.exports.default;
|
|
105
|
-
//# sourceMappingURL=Figure.cjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../packages/ui/atoms/Figure/Figure.ts"],
|
|
4
|
-
"sourcesContent": ["import { withMountWhenInView } from '@studiometa/js-toolkit';\nimport type { BaseConfig, BaseProps } from '@studiometa/js-toolkit';\nimport { Transition } from '../../primitives/index.js';\n\nexport interface FigureProps extends BaseProps {\n $refs: {\n img: HTMLImageElement;\n };\n $options: {\n lazy: boolean;\n };\n}\n\n/**\n * Load the given image.\n */\nexport function loadImage(src: string): Promise<HTMLImageElement> {\n return new Promise((resolve) => {\n const img = new Image();\n img.addEventListener('load', () => resolve(img));\n img.src = src;\n });\n}\n\n/**\n * Figure class.\n */\nexport class Figure<T extends BaseProps = BaseProps> extends withMountWhenInView<Transition>(\n Transition,\n {\n threshold: [0, 1],\n },\n)<T & FigureProps> {\n /**\n * Config.\n */\n static config: BaseConfig = {\n ...Transition.config,\n name: 'Figure',\n emits: ['load'],\n refs: ['img'],\n options: {\n ...Transition.config.options,\n lazy: Boolean,\n },\n };\n\n /**\n * Get the transition target.\n */\n get target() {\n return this.$refs.img;\n }\n\n /**\n * Get the image source.\n */\n get src() {\n return this.$refs.img.src;\n }\n\n /**\n * Set the image source.\n */\n set src(value: string) {\n this.$refs.img.src = value;\n }\n\n /**\n * Get the original source.\n */\n get original() {\n return this.$refs.img.dataset.src;\n }\n\n /**\n * Load on mount.\n */\n async mounted() {\n const { img } = this.$refs;\n\n if (!img) {\n throw new Error('[Figure] The `img` ref is required.');\n }\n\n if (!(img instanceof HTMLImageElement)) {\n throw new Error('[Figure] The `img` ref must be an `<img>` element.');\n }\n\n const src = this.original;\n\n if (this.$options.lazy && src && src !== this.src) {\n await loadImage(src);\n this.src = src;\n this.enter();\n this.$emit('load');\n }\n }\n\n /**\n * Terminate the component on load.\n */\n onLoad() {\n this.$terminate();\n }\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,wBAAoC;AAEpC,wBAA2B;AAcpB,SAAS,UAAU,KAAwC;AAChE,SAAO,IAAI,QAAQ,CAAC,YAAY;AAC9B,UAAM,MAAM,IAAI,MAAM;AACtB,QAAI,iBAAiB,QAAQ,MAAM,QAAQ,GAAG,CAAC;AAC/C,QAAI,MAAM;AAAA,EACZ,CAAC;AACH;AAKO,IAAM,SAAN,kBAAsD;AAAA,EAC3D;AAAA,EACA;AAAA,IACE,WAAW,CAAC,GAAG,CAAC;AAAA,EAClB;AACF,EAAmB;AAAA;AAAA;AAAA;AAAA,EAIjB,OAAO,SAAqB;AAAA,IAC1B,GAAG,6BAAW;AAAA,IACd,MAAM;AAAA,IACN,OAAO,CAAC,MAAM;AAAA,IACd,MAAM,CAAC,KAAK;AAAA,IACZ,SAAS;AAAA,MACP,GAAG,6BAAW,OAAO;AAAA,MACrB,MAAM;AAAA,IACR;AAAA,EACF;AAAA;AAAA;AAAA;AAAA,EAKA,IAAI,SAAS;AACX,WAAO,KAAK,MAAM;AAAA,EACpB;AAAA;AAAA;AAAA;AAAA,EAKA,IAAI,MAAM;AACR,WAAO,KAAK,MAAM,IAAI;AAAA,EACxB;AAAA;AAAA;AAAA;AAAA,EAKA,IAAI,IAAI,OAAe;AACrB,SAAK,MAAM,IAAI,MAAM;AAAA,EACvB;AAAA;AAAA;AAAA;AAAA,EAKA,IAAI,WAAW;AACb,WAAO,KAAK,MAAM,IAAI,QAAQ;AAAA,EAChC;AAAA;AAAA;AAAA;AAAA,EAKA,MAAM,UAAU;AACd,UAAM,EAAE,IAAI,IAAI,KAAK;AAErB,QAAI,CAAC,KAAK;AACR,YAAM,IAAI,MAAM,qCAAqC;AAAA,IACvD;AAEA,QAAI,EAAE,eAAe,mBAAmB;AACtC,YAAM,IAAI,MAAM,oDAAoD;AAAA,IACtE;AAEA,UAAM,MAAM,KAAK;AAEjB,QAAI,KAAK,SAAS,QAAQ,OAAO,QAAQ,KAAK,KAAK;AACjD,YAAM,UAAU,GAAG;AACnB,WAAK,MAAM;AACX,WAAK,MAAM;AACX,WAAK,MAAM,MAAM;AAAA,IACnB;AAAA,EACF;AAAA;AAAA;AAAA;AAAA,EAKA,SAAS;AACP,SAAK,WAAW;AAAA,EAClB;AACF;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,123 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __export = (target, all) => {
|
|
6
|
-
for (var name in all)
|
|
7
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
-
};
|
|
9
|
-
var __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
-
}
|
|
15
|
-
return to;
|
|
16
|
-
};
|
|
17
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
-
|
|
19
|
-
// packages/ui/atoms/Figure/FigureTwicpics.ts
|
|
20
|
-
var FigureTwicpics_exports = {};
|
|
21
|
-
__export(FigureTwicpics_exports, {
|
|
22
|
-
FigureTwicpics: () => FigureTwicpics
|
|
23
|
-
});
|
|
24
|
-
module.exports = __toCommonJS(FigureTwicpics_exports);
|
|
25
|
-
var import_utils = require("@studiometa/js-toolkit/utils");
|
|
26
|
-
var import_Figure = require("./Figure.cjs");
|
|
27
|
-
function normalizeSize(that, prop) {
|
|
28
|
-
const { step } = that.$options;
|
|
29
|
-
return Math.ceil(that.$refs.img[prop] / step) * step;
|
|
30
|
-
}
|
|
31
|
-
var isBot = /bot|crawl|slurp|spider/i.test(navigator.userAgent);
|
|
32
|
-
var FigureTwicpics = class extends import_Figure.Figure {
|
|
33
|
-
/**
|
|
34
|
-
* Config.
|
|
35
|
-
*/
|
|
36
|
-
static config = {
|
|
37
|
-
...import_Figure.Figure.config,
|
|
38
|
-
name: "FigureTwicpics",
|
|
39
|
-
options: {
|
|
40
|
-
...import_Figure.Figure.config.options,
|
|
41
|
-
transform: String,
|
|
42
|
-
domain: String,
|
|
43
|
-
path: String,
|
|
44
|
-
disable: Boolean,
|
|
45
|
-
step: {
|
|
46
|
-
type: Number,
|
|
47
|
-
default: 50
|
|
48
|
-
},
|
|
49
|
-
mode: {
|
|
50
|
-
type: String,
|
|
51
|
-
default: "cover"
|
|
52
|
-
},
|
|
53
|
-
dpr: {
|
|
54
|
-
type: Boolean,
|
|
55
|
-
default: true
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
};
|
|
59
|
-
/**
|
|
60
|
-
* Get the Twicpics path.
|
|
61
|
-
*/
|
|
62
|
-
get path() {
|
|
63
|
-
return (0, import_utils.withoutTrailingSlash)((0, import_utils.withoutLeadingSlash)(this.$options.path));
|
|
64
|
-
}
|
|
65
|
-
/**
|
|
66
|
-
* Get the Twicpics domain.
|
|
67
|
-
*/
|
|
68
|
-
get domain() {
|
|
69
|
-
const url = new URL(this.$refs.img.dataset.src);
|
|
70
|
-
return url.host;
|
|
71
|
-
}
|
|
72
|
-
/**
|
|
73
|
-
* Get formatted original source.
|
|
74
|
-
* If `disable` option is `true` returns the original src.
|
|
75
|
-
*/
|
|
76
|
-
get original() {
|
|
77
|
-
return this.$options.disable ? super.original : this.formatSrc(super.original);
|
|
78
|
-
}
|
|
79
|
-
/**
|
|
80
|
-
* Get the current device pixel ratio
|
|
81
|
-
* Returns 1 if user agent is considered as a bot.
|
|
82
|
-
* Returns 1 if disabled by the `data-option-no-dpr` attribute.
|
|
83
|
-
*/
|
|
84
|
-
get devicePixelRatio() {
|
|
85
|
-
if (!this.$options.dpr || isBot) {
|
|
86
|
-
return 1;
|
|
87
|
-
}
|
|
88
|
-
return window.devicePixelRatio;
|
|
89
|
-
}
|
|
90
|
-
/**
|
|
91
|
-
* Format the source for Twicpics.
|
|
92
|
-
*/
|
|
93
|
-
formatSrc(src) {
|
|
94
|
-
const url = new URL(src, "https://localhost");
|
|
95
|
-
url.host = this.domain;
|
|
96
|
-
url.port = "";
|
|
97
|
-
if (this.path && !url.pathname.startsWith((0, import_utils.withLeadingSlash)(this.path))) {
|
|
98
|
-
url.pathname = `/${this.path}${url.pathname}`;
|
|
99
|
-
}
|
|
100
|
-
const width = normalizeSize(this, "offsetWidth") * this.devicePixelRatio;
|
|
101
|
-
const height = normalizeSize(this, "offsetHeight") * this.devicePixelRatio;
|
|
102
|
-
url.searchParams.set(
|
|
103
|
-
"twic",
|
|
104
|
-
["v1", this.$options.transform, `${this.$options.mode}=${width}x${height}`].filter(Boolean).join("/")
|
|
105
|
-
);
|
|
106
|
-
url.search = decodeURIComponent(url.search);
|
|
107
|
-
return url.toString();
|
|
108
|
-
}
|
|
109
|
-
/**
|
|
110
|
-
* Reassign the source from the original on resize.
|
|
111
|
-
*/
|
|
112
|
-
async resized() {
|
|
113
|
-
const { src } = await (0, import_Figure.loadImage)(this.original);
|
|
114
|
-
this.src = src;
|
|
115
|
-
}
|
|
116
|
-
/**
|
|
117
|
-
* Do not terminate on image load as we need to set the src on resize.
|
|
118
|
-
*/
|
|
119
|
-
onLoad() {
|
|
120
|
-
}
|
|
121
|
-
};
|
|
122
|
-
if (module.exports.default) module.exports = module.exports.default;
|
|
123
|
-
//# sourceMappingURL=FigureTwicpics.cjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../packages/ui/atoms/Figure/FigureTwicpics.ts"],
|
|
4
|
-
"sourcesContent": ["import type { BaseConfig, BaseProps } from '@studiometa/js-toolkit';\nimport {\n withLeadingSlash,\n withoutLeadingSlash,\n withoutTrailingSlash,\n} from '@studiometa/js-toolkit/utils';\nimport { Figure, loadImage } from './Figure.js';\n\nexport interface FigureTwicpicsProps extends BaseProps {\n $options: {\n transform: string;\n domain: string;\n path: string;\n step: number;\n mode: string;\n dpr: boolean;\n };\n}\n\n/**\n * Normalize the given size to the step option.\n */\n// eslint-disable-next-line no-use-before-define\nfunction normalizeSize(that: FigureTwicpics, prop: string): number {\n const { step } = that.$options;\n return Math.ceil(that.$refs.img[prop] / step) * step;\n}\n\n/**\n * Determine if the user agent is a bot or not.\n */\nconst isBot = /bot|crawl|slurp|spider/i.test(navigator.userAgent);\n\n/**\n * Figure class.\n *\n * Manager lazyloading image sources.\n */\nexport class FigureTwicpics<T extends BaseProps = BaseProps> extends Figure<\n T & FigureTwicpicsProps\n> {\n /**\n * Config.\n */\n static config: BaseConfig = {\n ...Figure.config,\n name: 'FigureTwicpics',\n options: {\n ...Figure.config.options,\n transform: String,\n domain: String,\n path: String,\n disable: Boolean,\n step: {\n type: Number,\n default: 50,\n },\n mode: {\n type: String,\n default: 'cover',\n },\n dpr: {\n type: Boolean,\n default: true,\n },\n },\n };\n\n /**\n * Get the Twicpics path.\n */\n get path(): string {\n return withoutTrailingSlash(withoutLeadingSlash(this.$options.path));\n }\n\n /**\n * Get the Twicpics domain.\n */\n get domain(): string {\n const url = new URL(this.$refs.img.dataset.src);\n return url.host;\n }\n\n /**\n * Get formatted original source.\n * If `disable` option is `true` returns the original src.\n */\n get original() {\n return this.$options.disable ? super.original : this.formatSrc(super.original);\n }\n\n /**\n * Get the current device pixel ratio\n * Returns 1 if user agent is considered as a bot.\n * Returns 1 if disabled by the `data-option-no-dpr` attribute.\n */\n get devicePixelRatio() {\n if (!this.$options.dpr || isBot) {\n return 1;\n }\n\n return window.devicePixelRatio;\n }\n\n /**\n * Format the source for Twicpics.\n */\n formatSrc(src: string): string {\n const url = new URL(src, 'https://localhost');\n url.host = this.domain;\n url.port = '';\n\n if (this.path && !url.pathname.startsWith(withLeadingSlash(this.path))) {\n url.pathname = `/${this.path}${url.pathname}`;\n }\n\n const width = normalizeSize(this, 'offsetWidth') * this.devicePixelRatio;\n const height = normalizeSize(this, 'offsetHeight') * this.devicePixelRatio;\n\n url.searchParams.set(\n 'twic',\n ['v1', this.$options.transform, `${this.$options.mode}=${width}x${height}`]\n .filter(Boolean)\n .join('/'),\n );\n\n url.search = decodeURIComponent(url.search);\n\n return url.toString();\n }\n\n /**\n * Reassign the source from the original on resize.\n */\n async resized() {\n const { src } = await loadImage(this.original);\n this.src = src;\n }\n\n /**\n * Do not terminate on image load as we need to set the src on resize.\n */\n onLoad() {\n // Do not terminate on image load as we need.\n }\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,mBAIO;AACP,oBAAkC;AAiBlC,SAAS,cAAc,MAAsB,MAAsB;AACjE,QAAM,EAAE,KAAK,IAAI,KAAK;AACtB,SAAO,KAAK,KAAK,KAAK,MAAM,IAAI,IAAI,IAAI,IAAI,IAAI;AAClD;AAKA,IAAM,QAAQ,0BAA0B,KAAK,UAAU,SAAS;AAOzD,IAAM,iBAAN,cAA8D,qBAEnE;AAAA;AAAA;AAAA;AAAA,EAIA,OAAO,SAAqB;AAAA,IAC1B,GAAG,qBAAO;AAAA,IACV,MAAM;AAAA,IACN,SAAS;AAAA,MACP,GAAG,qBAAO,OAAO;AAAA,MACjB,WAAW;AAAA,MACX,QAAQ;AAAA,MACR,MAAM;AAAA,MACN,SAAS;AAAA,MACT,MAAM;AAAA,QACJ,MAAM;AAAA,QACN,SAAS;AAAA,MACX;AAAA,MACA,MAAM;AAAA,QACJ,MAAM;AAAA,QACN,SAAS;AAAA,MACX;AAAA,MACA,KAAK;AAAA,QACH,MAAM;AAAA,QACN,SAAS;AAAA,MACX;AAAA,IACF;AAAA,EACF;AAAA;AAAA;AAAA;AAAA,EAKA,IAAI,OAAe;AACjB,eAAO,uCAAqB,kCAAoB,KAAK,SAAS,IAAI,CAAC;AAAA,EACrE;AAAA;AAAA;AAAA;AAAA,EAKA,IAAI,SAAiB;AACnB,UAAM,MAAM,IAAI,IAAI,KAAK,MAAM,IAAI,QAAQ,GAAG;AAC9C,WAAO,IAAI;AAAA,EACb;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,IAAI,WAAW;AACb,WAAO,KAAK,SAAS,UAAU,MAAM,WAAW,KAAK,UAAU,MAAM,QAAQ;AAAA,EAC/E;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,IAAI,mBAAmB;AACrB,QAAI,CAAC,KAAK,SAAS,OAAO,OAAO;AAC/B,aAAO;AAAA,IACT;AAEA,WAAO,OAAO;AAAA,EAChB;AAAA;AAAA;AAAA;AAAA,EAKA,UAAU,KAAqB;AAC7B,UAAM,MAAM,IAAI,IAAI,KAAK,mBAAmB;AAC5C,QAAI,OAAO,KAAK;AAChB,QAAI,OAAO;AAEX,QAAI,KAAK,QAAQ,CAAC,IAAI,SAAS,eAAW,+BAAiB,KAAK,IAAI,CAAC,GAAG;AACtE,UAAI,WAAW,IAAI,KAAK,IAAI,GAAG,IAAI,QAAQ;AAAA,IAC7C;AAEA,UAAM,QAAQ,cAAc,MAAM,aAAa,IAAI,KAAK;AACxD,UAAM,SAAS,cAAc,MAAM,cAAc,IAAI,KAAK;AAE1D,QAAI,aAAa;AAAA,MACf;AAAA,MACA,CAAC,MAAM,KAAK,SAAS,WAAW,GAAG,KAAK,SAAS,IAAI,IAAI,KAAK,IAAI,MAAM,EAAE,EACvE,OAAO,OAAO,EACd,KAAK,GAAG;AAAA,IACb;AAEA,QAAI,SAAS,mBAAmB,IAAI,MAAM;AAE1C,WAAO,IAAI,SAAS;AAAA,EACtB;AAAA;AAAA;AAAA;AAAA,EAKA,MAAM,UAAU;AACd,UAAM,EAAE,IAAI,IAAI,UAAM,yBAAU,KAAK,QAAQ;AAC7C,SAAK,MAAM;AAAA,EACb;AAAA;AAAA;AAAA;AAAA,EAKA,SAAS;AAAA,EAET;AACF;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
package/atoms/Figure/index.cjs
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __copyProps = (to, from, except, desc) => {
|
|
6
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
7
|
-
for (let key of __getOwnPropNames(from))
|
|
8
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
9
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
10
|
-
}
|
|
11
|
-
return to;
|
|
12
|
-
};
|
|
13
|
-
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
14
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
|
-
|
|
16
|
-
// packages/ui/atoms/Figure/index.ts
|
|
17
|
-
var Figure_exports = {};
|
|
18
|
-
module.exports = __toCommonJS(Figure_exports);
|
|
19
|
-
__reExport(Figure_exports, require("./Figure.cjs"), module.exports);
|
|
20
|
-
__reExport(Figure_exports, require("./FigureTwicpics.cjs"), module.exports);
|
|
21
|
-
if (module.exports.default) module.exports = module.exports.default;
|
|
22
|
-
//# sourceMappingURL=index.cjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../packages/ui/atoms/Figure/index.ts"],
|
|
4
|
-
"sourcesContent": ["export * from './Figure.js';\nexport * from './FigureTwicpics.js';\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,2BAAc,yBAAd;AACA,2BAAc,iCADd;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,132 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __export = (target, all) => {
|
|
6
|
-
for (var name in all)
|
|
7
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
-
};
|
|
9
|
-
var __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
-
}
|
|
15
|
-
return to;
|
|
16
|
-
};
|
|
17
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
-
|
|
19
|
-
// packages/ui/atoms/FigureVideo/FigureVideo.ts
|
|
20
|
-
var FigureVideo_exports = {};
|
|
21
|
-
__export(FigureVideo_exports, {
|
|
22
|
-
FigureVideo: () => FigureVideo
|
|
23
|
-
});
|
|
24
|
-
module.exports = __toCommonJS(FigureVideo_exports);
|
|
25
|
-
var import_js_toolkit = require("@studiometa/js-toolkit");
|
|
26
|
-
var import_primitives = require("../../primitives/index.cjs");
|
|
27
|
-
var import__ = require("../index.cjs");
|
|
28
|
-
var FigureVideo = class extends (0, import_js_toolkit.withMountWhenInView)(
|
|
29
|
-
import_primitives.Transition,
|
|
30
|
-
{
|
|
31
|
-
threshold: [0, 1]
|
|
32
|
-
}
|
|
33
|
-
) {
|
|
34
|
-
/**
|
|
35
|
-
* Config.
|
|
36
|
-
*/
|
|
37
|
-
static config = {
|
|
38
|
-
...import_primitives.Transition.config,
|
|
39
|
-
name: "FigureVideo",
|
|
40
|
-
emits: ["load"],
|
|
41
|
-
refs: ["video"],
|
|
42
|
-
options: {
|
|
43
|
-
...import_primitives.Transition.config.options,
|
|
44
|
-
lazy: Boolean
|
|
45
|
-
}
|
|
46
|
-
};
|
|
47
|
-
/**
|
|
48
|
-
* Get the transition target.
|
|
49
|
-
*/
|
|
50
|
-
get target() {
|
|
51
|
-
return this.$refs.video;
|
|
52
|
-
}
|
|
53
|
-
/**
|
|
54
|
-
* Get the video sources.
|
|
55
|
-
*/
|
|
56
|
-
get sources() {
|
|
57
|
-
return Array.from(this.$refs.video.querySelectorAll("source"));
|
|
58
|
-
}
|
|
59
|
-
/**
|
|
60
|
-
* Load poster
|
|
61
|
-
*/
|
|
62
|
-
loadPoster() {
|
|
63
|
-
const { video } = this.$refs;
|
|
64
|
-
if (!video.dataset.poster) {
|
|
65
|
-
return Promise.resolve();
|
|
66
|
-
}
|
|
67
|
-
return (0, import__.loadImage)(video.dataset.poster).then(() => {
|
|
68
|
-
video.poster = video.dataset.poster;
|
|
69
|
-
this.$log("fresh poster loaded");
|
|
70
|
-
});
|
|
71
|
-
}
|
|
72
|
-
/**
|
|
73
|
-
* Load sources
|
|
74
|
-
* @returns {Promise}
|
|
75
|
-
*/
|
|
76
|
-
loadSources() {
|
|
77
|
-
const { video } = this.$refs;
|
|
78
|
-
this.sources.forEach((source) => {
|
|
79
|
-
if (!source.dataset.src) {
|
|
80
|
-
return;
|
|
81
|
-
}
|
|
82
|
-
source.src = source.dataset.src;
|
|
83
|
-
});
|
|
84
|
-
return new Promise((resolve) => {
|
|
85
|
-
const loadHandler = () => {
|
|
86
|
-
video.removeEventListener("loadeddata", loadHandler);
|
|
87
|
-
this.$log("fresh sources loaded");
|
|
88
|
-
resolve();
|
|
89
|
-
};
|
|
90
|
-
video.addEventListener("loadeddata", loadHandler);
|
|
91
|
-
video.load();
|
|
92
|
-
});
|
|
93
|
-
}
|
|
94
|
-
/**
|
|
95
|
-
* Load
|
|
96
|
-
* @returns {Promise}
|
|
97
|
-
*/
|
|
98
|
-
load() {
|
|
99
|
-
return Promise.all([this.loadPoster(), this.loadSources()]);
|
|
100
|
-
}
|
|
101
|
-
/**
|
|
102
|
-
* Load on mount.
|
|
103
|
-
*/
|
|
104
|
-
async mounted() {
|
|
105
|
-
this.$log("mounted");
|
|
106
|
-
const { video } = this.$refs;
|
|
107
|
-
if (!video) {
|
|
108
|
-
throw new Error("[VideoFigure] The `video` ref is required.");
|
|
109
|
-
}
|
|
110
|
-
if (!(video instanceof HTMLVideoElement)) {
|
|
111
|
-
throw new Error("[VideoFigure] The `video` ref must be an `<video>` element.");
|
|
112
|
-
}
|
|
113
|
-
if (!this.$options.lazy) {
|
|
114
|
-
this.$log("Lazy loading disabled");
|
|
115
|
-
return;
|
|
116
|
-
}
|
|
117
|
-
this.$log("start loading");
|
|
118
|
-
await this.load();
|
|
119
|
-
this.$log("all is loaded");
|
|
120
|
-
await this.enter();
|
|
121
|
-
this.$log("transition done");
|
|
122
|
-
this.$emit("load");
|
|
123
|
-
}
|
|
124
|
-
/**
|
|
125
|
-
* Terminate the component on load.
|
|
126
|
-
*/
|
|
127
|
-
onLoad() {
|
|
128
|
-
this.$terminate();
|
|
129
|
-
}
|
|
130
|
-
};
|
|
131
|
-
if (module.exports.default) module.exports = module.exports.default;
|
|
132
|
-
//# sourceMappingURL=FigureVideo.cjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../packages/ui/atoms/FigureVideo/FigureVideo.ts"],
|
|
4
|
-
"sourcesContent": ["import { withMountWhenInView } from '@studiometa/js-toolkit';\nimport type { BaseConfig, BaseProps } from '@studiometa/js-toolkit';\nimport { Transition } from '../../primitives/index.js';\nimport { loadImage } from '../index.js';\n\nexport interface FigureVideoProps extends BaseProps {\n $refs: {\n video: HTMLVideoElement;\n };\n $options: {\n lazy: boolean;\n };\n}\n\n/**\n * FigureVideo class.\n */\nexport class FigureVideo<T extends BaseProps = BaseProps> extends withMountWhenInView<Transition>(\n Transition,\n {\n threshold: [0, 1],\n },\n)<T & FigureVideoProps> {\n /**\n * Config.\n */\n static config: BaseConfig = {\n ...Transition.config,\n name: 'FigureVideo',\n emits: ['load'],\n refs: ['video'],\n options: {\n ...Transition.config.options,\n lazy: Boolean,\n },\n };\n\n /**\n * Get the transition target.\n */\n get target(): HTMLVideoElement {\n return this.$refs.video;\n }\n\n /**\n * Get the video sources.\n */\n get sources(): Array<HTMLSourceElement> {\n return Array.from(this.$refs.video.querySelectorAll('source'));\n }\n\n /**\n * Load poster\n */\n loadPoster(): Promise<void|HTMLImageElement> {\n const { video } = this.$refs;\n\n if (!video.dataset.poster) {\n return Promise.resolve();\n }\n\n return loadImage(video.dataset.poster).then(() => {\n video.poster = video.dataset.poster;\n this.$log('fresh poster loaded');\n })\n }\n\n /**\n * Load sources\n * @returns {Promise}\n */\n loadSources(): Promise<void> {\n const { video } = this.$refs;\n\n this.sources.forEach((source) => {\n if (!source.dataset.src) {\n return;\n }\n source.src = source.dataset.src;\n });\n\n return new Promise<void>((resolve) => {\n const loadHandler = () => {\n video.removeEventListener('loadeddata', loadHandler);\n this.$log('fresh sources loaded');\n resolve();\n };\n video.addEventListener('loadeddata', loadHandler);\n video.load();\n });\n }\n\n /**\n * Load\n * @returns {Promise}\n */\n load(): Promise<any[]> {\n return Promise.all([this.loadPoster(), this.loadSources()]);\n }\n\n /**\n * Load on mount.\n */\n async mounted() {\n this.$log('mounted');\n const { video } = this.$refs;\n\n if (!video) {\n throw new Error('[VideoFigure] The `video` ref is required.');\n }\n\n if (!(video instanceof HTMLVideoElement)) {\n throw new Error('[VideoFigure] The `video` ref must be an `<video>` element.');\n }\n\n if (!this.$options.lazy) {\n this.$log('Lazy loading disabled');\n return;\n }\n\n this.$log('start loading');\n await this.load();\n this.$log('all is loaded');\n await this.enter();\n this.$log('transition done');\n this.$emit('load');\n }\n\n /**\n * Terminate the component on load.\n */\n onLoad() {\n this.$terminate();\n }\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,wBAAoC;AAEpC,wBAA2B;AAC3B,eAA0B;AAcnB,IAAM,cAAN,kBAA2D;AAAA,EAChE;AAAA,EACA;AAAA,IACE,WAAW,CAAC,GAAG,CAAC;AAAA,EAClB;AACF,EAAwB;AAAA;AAAA;AAAA;AAAA,EAItB,OAAO,SAAqB;AAAA,IAC1B,GAAG,6BAAW;AAAA,IACd,MAAM;AAAA,IACN,OAAO,CAAC,MAAM;AAAA,IACd,MAAM,CAAC,OAAO;AAAA,IACd,SAAS;AAAA,MACP,GAAG,6BAAW,OAAO;AAAA,MACrB,MAAM;AAAA,IACR;AAAA,EACF;AAAA;AAAA;AAAA;AAAA,EAKA,IAAI,SAA2B;AAC7B,WAAO,KAAK,MAAM;AAAA,EACpB;AAAA;AAAA;AAAA;AAAA,EAKA,IAAI,UAAoC;AACtC,WAAO,MAAM,KAAK,KAAK,MAAM,MAAM,iBAAiB,QAAQ,CAAC;AAAA,EAC/D;AAAA;AAAA;AAAA;AAAA,EAKA,aAA6C;AAC3C,UAAM,EAAE,MAAM,IAAI,KAAK;AAEvB,QAAI,CAAC,MAAM,QAAQ,QAAQ;AACzB,aAAO,QAAQ,QAAQ;AAAA,IACzB;AAEA,eAAO,oBAAU,MAAM,QAAQ,MAAM,EAAE,KAAK,MAAM;AAChD,YAAM,SAAS,MAAM,QAAQ;AAC7B,WAAK,KAAK,qBAAqB;AAAA,IACjC,CAAC;AAAA,EACH;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,cAA6B;AAC3B,UAAM,EAAE,MAAM,IAAI,KAAK;AAEvB,SAAK,QAAQ,QAAQ,CAAC,WAAW;AAC/B,UAAI,CAAC,OAAO,QAAQ,KAAK;AACvB;AAAA,MACF;AACA,aAAO,MAAM,OAAO,QAAQ;AAAA,IAC9B,CAAC;AAED,WAAO,IAAI,QAAc,CAAC,YAAY;AACpC,YAAM,cAAc,MAAM;AACxB,cAAM,oBAAoB,cAAc,WAAW;AACnD,aAAK,KAAK,sBAAsB;AAChC,gBAAQ;AAAA,MACV;AACA,YAAM,iBAAiB,cAAc,WAAW;AAChD,YAAM,KAAK;AAAA,IACb,CAAC;AAAA,EACH;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,OAAuB;AACrB,WAAO,QAAQ,IAAI,CAAC,KAAK,WAAW,GAAG,KAAK,YAAY,CAAC,CAAC;AAAA,EAC5D;AAAA;AAAA;AAAA;AAAA,EAKA,MAAM,UAAU;AACd,SAAK,KAAK,SAAS;AACnB,UAAM,EAAE,MAAM,IAAI,KAAK;AAEvB,QAAI,CAAC,OAAO;AACV,YAAM,IAAI,MAAM,4CAA4C;AAAA,IAC9D;AAEA,QAAI,EAAE,iBAAiB,mBAAmB;AACxC,YAAM,IAAI,MAAM,6DAA6D;AAAA,IAC/E;AAEA,QAAI,CAAC,KAAK,SAAS,MAAM;AACvB,WAAK,KAAK,uBAAuB;AACjC;AAAA,IACF;AAEA,SAAK,KAAK,eAAe;AACzB,UAAM,KAAK,KAAK;AAChB,SAAK,KAAK,eAAe;AACzB,UAAM,KAAK,MAAM;AACjB,SAAK,KAAK,iBAAiB;AAC3B,SAAK,MAAM,MAAM;AAAA,EACnB;AAAA;AAAA;AAAA;AAAA,EAKA,SAAS;AACP,SAAK,WAAW;AAAA,EAClB;AACF;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,153 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __export = (target, all) => {
|
|
6
|
-
for (var name in all)
|
|
7
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
-
};
|
|
9
|
-
var __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
-
}
|
|
15
|
-
return to;
|
|
16
|
-
};
|
|
17
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
-
|
|
19
|
-
// packages/ui/atoms/FigureVideo/FigureVideoTwicpics.ts
|
|
20
|
-
var FigureVideoTwicpics_exports = {};
|
|
21
|
-
__export(FigureVideoTwicpics_exports, {
|
|
22
|
-
FigureVideoTwicpics: () => FigureVideoTwicpics
|
|
23
|
-
});
|
|
24
|
-
module.exports = __toCommonJS(FigureVideoTwicpics_exports);
|
|
25
|
-
var import_utils = require("@studiometa/js-toolkit/utils");
|
|
26
|
-
var import__ = require("../index.cjs");
|
|
27
|
-
var import_FigureVideo = require("./FigureVideo.cjs");
|
|
28
|
-
function normalizeSize(that, prop) {
|
|
29
|
-
const { step } = that.$options;
|
|
30
|
-
return Math.ceil(that.$refs.video[prop] / step) * step;
|
|
31
|
-
}
|
|
32
|
-
var FigureVideoTwicpics = class extends import_FigureVideo.FigureVideo {
|
|
33
|
-
/**
|
|
34
|
-
* Config.
|
|
35
|
-
*/
|
|
36
|
-
static config = {
|
|
37
|
-
...import_FigureVideo.FigureVideo.config,
|
|
38
|
-
name: "FigureVideoTwicpics",
|
|
39
|
-
options: {
|
|
40
|
-
...import_FigureVideo.FigureVideo.config.options,
|
|
41
|
-
transform: String,
|
|
42
|
-
domain: String,
|
|
43
|
-
path: String,
|
|
44
|
-
step: {
|
|
45
|
-
type: Number,
|
|
46
|
-
default: 50
|
|
47
|
-
},
|
|
48
|
-
mode: {
|
|
49
|
-
type: String,
|
|
50
|
-
default: "cover"
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
};
|
|
54
|
-
/**
|
|
55
|
-
* Get the Twicpics path.
|
|
56
|
-
*/
|
|
57
|
-
get path() {
|
|
58
|
-
return (0, import_utils.withoutTrailingSlash)((0, import_utils.withoutLeadingSlash)(this.$options.path));
|
|
59
|
-
}
|
|
60
|
-
/**
|
|
61
|
-
* Get the Twicpics domain.
|
|
62
|
-
*/
|
|
63
|
-
get domain() {
|
|
64
|
-
if (this.$options.domain) {
|
|
65
|
-
return this.$options.domain;
|
|
66
|
-
}
|
|
67
|
-
const url = new URL(this.sources[0].dataset.src);
|
|
68
|
-
return url.host;
|
|
69
|
-
}
|
|
70
|
-
/**
|
|
71
|
-
* Format the source for Twicpics.
|
|
72
|
-
* @param {string} src
|
|
73
|
-
* @param {Array} options
|
|
74
|
-
* @returns {string}
|
|
75
|
-
*/
|
|
76
|
-
formatSrc(src, options = []) {
|
|
77
|
-
const url = new URL(src, "https://localhost");
|
|
78
|
-
url.host = this.domain;
|
|
79
|
-
url.port = "";
|
|
80
|
-
if (this.path && !url.pathname.startsWith((0, import_utils.withLeadingSlash)(this.path))) {
|
|
81
|
-
url.pathname = `/${this.path}${url.pathname}`;
|
|
82
|
-
}
|
|
83
|
-
const width = normalizeSize(this, "offsetWidth");
|
|
84
|
-
const height = normalizeSize(this, "offsetHeight");
|
|
85
|
-
this.$log(this.$options.mode, width, height);
|
|
86
|
-
url.searchParams.set(
|
|
87
|
-
"twic",
|
|
88
|
-
["v1", this.$options.transform, `${this.$options.mode}=${width}x${height}`, ...options].filter(Boolean).join("/")
|
|
89
|
-
);
|
|
90
|
-
url.search = decodeURIComponent(url.search);
|
|
91
|
-
return url.toString();
|
|
92
|
-
}
|
|
93
|
-
/**
|
|
94
|
-
* Load poster
|
|
95
|
-
*/
|
|
96
|
-
loadPoster() {
|
|
97
|
-
const { video } = this.$refs;
|
|
98
|
-
if (!video.dataset.poster) {
|
|
99
|
-
return Promise.resolve();
|
|
100
|
-
}
|
|
101
|
-
const twicPoster = this.formatSrc(video.dataset.poster);
|
|
102
|
-
return (0, import__.loadImage)(twicPoster).then(() => {
|
|
103
|
-
video.poster = twicPoster;
|
|
104
|
-
this.$log("fresh poster loaded");
|
|
105
|
-
});
|
|
106
|
-
}
|
|
107
|
-
/**
|
|
108
|
-
* Load sources
|
|
109
|
-
*/
|
|
110
|
-
loadSources() {
|
|
111
|
-
const { video } = this.$refs;
|
|
112
|
-
this.sources.forEach((source) => {
|
|
113
|
-
if (!source.dataset.src) {
|
|
114
|
-
return;
|
|
115
|
-
}
|
|
116
|
-
source.src = this.formatSrc(
|
|
117
|
-
source.dataset.src,
|
|
118
|
-
source.dataset.output ? [`output=${source.dataset.output}`] : []
|
|
119
|
-
);
|
|
120
|
-
});
|
|
121
|
-
return new Promise((resolve) => {
|
|
122
|
-
const loadHandler = () => {
|
|
123
|
-
resolve();
|
|
124
|
-
video.removeEventListener("canplaythrough", loadHandler);
|
|
125
|
-
this.$log("fresh sources loaded");
|
|
126
|
-
};
|
|
127
|
-
video.addEventListener("canplaythrough", loadHandler);
|
|
128
|
-
this.$refs.video.width = normalizeSize(this, "offsetWidth");
|
|
129
|
-
this.$refs.video.height = normalizeSize(this, "offsetHeight");
|
|
130
|
-
video.load();
|
|
131
|
-
});
|
|
132
|
-
}
|
|
133
|
-
/**
|
|
134
|
-
* Reassign the source from the original on resize.
|
|
135
|
-
*/
|
|
136
|
-
async resized() {
|
|
137
|
-
const width = normalizeSize(this, "offsetWidth");
|
|
138
|
-
const height = normalizeSize(this, "offsetHeight");
|
|
139
|
-
if (width === this.$refs.video.width && height === this.$refs.video.height) {
|
|
140
|
-
return;
|
|
141
|
-
}
|
|
142
|
-
this.$refs.video.width = width;
|
|
143
|
-
this.$refs.video.height = height;
|
|
144
|
-
await this.load();
|
|
145
|
-
}
|
|
146
|
-
/**
|
|
147
|
-
* Do not terminate on image load as we need to set the src on resize.
|
|
148
|
-
*/
|
|
149
|
-
onLoad() {
|
|
150
|
-
}
|
|
151
|
-
};
|
|
152
|
-
if (module.exports.default) module.exports = module.exports.default;
|
|
153
|
-
//# sourceMappingURL=FigureVideoTwicpics.cjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../packages/ui/atoms/FigureVideo/FigureVideoTwicpics.ts"],
|
|
4
|
-
"sourcesContent": ["import type { BaseConfig, BaseProps } from '@studiometa/js-toolkit';\nimport {\n withLeadingSlash,\n withoutLeadingSlash,\n withoutTrailingSlash,\n} from '@studiometa/js-toolkit/utils';\nimport { loadImage } from '../index.js';\nimport { FigureVideo } from './FigureVideo.js';\n\nexport interface FigureVideoTwicpicsProps extends BaseProps {\n $refs: {\n video: HTMLVideoElement;\n };\n $options: {\n lazy: boolean;\n transform: string;\n domain: string;\n path: string;\n step: number;\n mode: string;\n };\n}\n\n/**\n * Normalize the given size to the step option.\n */\n// eslint-disable-next-line no-use-before-define\nfunction normalizeSize(that: FigureVideoTwicpics, prop: string): number {\n const { step } = that.$options;\n return Math.ceil(that.$refs.video[prop] / step) * step;\n}\n\n/**\n * FigureVideo class.\n *\n * Manager lazyloading image sources.\n */\nexport class FigureVideoTwicpics<T extends BaseProps = BaseProps> extends FigureVideo<\n T & FigureVideoTwicpicsProps\n> {\n /**\n * Config.\n */\n static config: BaseConfig = {\n ...FigureVideo.config,\n name: 'FigureVideoTwicpics',\n options: {\n ...FigureVideo.config.options,\n transform: String,\n domain: String,\n path: String,\n step: {\n type: Number,\n default: 50,\n },\n mode: {\n type: String,\n default: 'cover',\n },\n },\n };\n\n /**\n * Get the Twicpics path.\n */\n get path(): string {\n return withoutTrailingSlash(withoutLeadingSlash(this.$options.path));\n }\n\n /**\n * Get the Twicpics domain.\n */\n get domain(): string {\n if (this.$options.domain) {\n return this.$options.domain;\n }\n const url = new URL(this.sources[0].dataset.src);\n return url.host;\n }\n\n /**\n * Format the source for Twicpics.\n * @param {string} src\n * @param {Array} options\n * @returns {string}\n */\n formatSrc(src: string, options: Array<string> = []): string {\n const url = new URL(src, 'https://localhost');\n url.host = this.domain;\n url.port = '';\n\n if (this.path && !url.pathname.startsWith(withLeadingSlash(this.path))) {\n url.pathname = `/${this.path}${url.pathname}`;\n }\n\n const width = normalizeSize(this, 'offsetWidth');\n const height = normalizeSize(this, 'offsetHeight');\n\n this.$log(this.$options.mode, width, height);\n\n url.searchParams.set(\n 'twic',\n ['v1', this.$options.transform, `${this.$options.mode}=${width}x${height}`, ...options]\n .filter(Boolean)\n .join('/'),\n );\n\n url.search = decodeURIComponent(url.search);\n\n return url.toString();\n }\n\n /**\n * Load poster\n */\n loadPoster(): Promise<void|HTMLImageElement> {\n const { video } = this.$refs;\n\n if (!video.dataset.poster) {\n return Promise.resolve();\n }\n\n const twicPoster = this.formatSrc(video.dataset.poster);\n\n return loadImage(twicPoster).then(() => {\n video.poster = twicPoster;\n this.$log('fresh poster loaded');\n });\n }\n\n /**\n * Load sources\n */\n loadSources(): Promise<void> {\n const { video } = this.$refs;\n\n this.sources.forEach((source) => {\n if (!source.dataset.src) {\n return;\n }\n source.src = this.formatSrc(\n source.dataset.src,\n source.dataset.output ? [`output=${source.dataset.output}`] : [],\n );\n });\n\n return new Promise((resolve) => {\n const loadHandler = () => {\n resolve();\n video.removeEventListener('canplaythrough', loadHandler);\n this.$log('fresh sources loaded');\n };\n\n video.addEventListener('canplaythrough', loadHandler);\n\n this.$refs.video.width = normalizeSize(this, 'offsetWidth');\n this.$refs.video.height = normalizeSize(this, 'offsetHeight');\n\n video.load();\n });\n }\n\n /**\n * Reassign the source from the original on resize.\n */\n async resized() {\n const width = normalizeSize(this, 'offsetWidth');\n const height = normalizeSize(this, 'offsetHeight');\n\n if (width === this.$refs.video.width && height === this.$refs.video.height) {\n return;\n }\n\n this.$refs.video.width = width;\n this.$refs.video.height = height;\n\n await this.load();\n }\n\n /**\n * Do not terminate on image load as we need to set the src on resize.\n */\n onLoad() {\n // Do not terminate on image load as we need.\n }\n}\n"],
|
|
5
|
-
"mappings": "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",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __copyProps = (to, from, except, desc) => {
|
|
6
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
7
|
-
for (let key of __getOwnPropNames(from))
|
|
8
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
9
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
10
|
-
}
|
|
11
|
-
return to;
|
|
12
|
-
};
|
|
13
|
-
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
14
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
|
-
|
|
16
|
-
// packages/ui/atoms/FigureVideo/index.ts
|
|
17
|
-
var FigureVideo_exports = {};
|
|
18
|
-
module.exports = __toCommonJS(FigureVideo_exports);
|
|
19
|
-
__reExport(FigureVideo_exports, require("./FigureVideo.cjs"), module.exports);
|
|
20
|
-
__reExport(FigureVideo_exports, require("./FigureVideoTwicpics.cjs"), module.exports);
|
|
21
|
-
if (module.exports.default) module.exports = module.exports.default;
|
|
22
|
-
//# sourceMappingURL=index.cjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../packages/ui/atoms/FigureVideo/index.ts"],
|
|
4
|
-
"sourcesContent": ["export * from './FigureVideo.js';\nexport * from './FigureVideoTwicpics.js';\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,gCAAc,8BAAd;AACA,gCAAc,sCADd;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|