@studiometa/ui 0.2.0 → 0.2.3
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/atoms/AnchorScrollTo/AnchorScrollTo.cjs +52 -0
- package/atoms/AnchorScrollTo/AnchorScrollTo.d.ts +31 -0
- package/atoms/AnchorScrollTo/AnchorScrollTo.js +26 -0
- package/atoms/LargeText/LargeText.cjs +90 -0
- package/atoms/LargeText/LargeText.d.ts +94 -0
- package/atoms/LargeText/LargeText.js +64 -0
- package/atoms/LazyInclude/LazyInclude.cjs +72 -0
- package/atoms/LazyInclude/LazyInclude.d.ts +64 -0
- package/atoms/LazyInclude/LazyInclude.js +46 -0
- package/atoms/Prefetch/AbstractPrefetch.cjs +84 -0
- package/atoms/Prefetch/AbstractPrefetch.d.ts +52 -0
- package/atoms/Prefetch/AbstractPrefetch.js +58 -0
- package/atoms/Prefetch/PrefetchWhenOver.cjs +65 -0
- package/atoms/Prefetch/PrefetchWhenOver.d.ts +21 -0
- package/atoms/Prefetch/PrefetchWhenOver.js +35 -0
- package/atoms/Prefetch/PrefetchWhenVisible.cjs +66 -0
- package/atoms/Prefetch/PrefetchWhenVisible.d.ts +21 -0
- package/atoms/Prefetch/PrefetchWhenVisible.js +36 -0
- package/atoms/Prefetch/index.cjs +40 -0
- package/atoms/Prefetch/index.d.ts +3 -0
- package/atoms/Prefetch/index.js +8 -0
- package/atoms/index.cjs +9 -2
- package/atoms/index.d.ts +5 -1
- package/atoms/index.js +9 -2
- package/molecules/Accordion/AccordionItem.cjs +1 -1
- package/molecules/Accordion/AccordionItem.d.ts +8 -10
- package/molecules/Accordion/AccordionItem.js +1 -1
- package/molecules/Modal/Modal.cjs +4 -5
- package/molecules/Modal/Modal.d.ts +9 -9
- package/molecules/Modal/Modal.js +4 -5
- package/molecules/Modal/ModalWithTransition.cjs +100 -0
- package/molecules/Modal/ModalWithTransition.d.ts +29 -0
- package/molecules/Modal/ModalWithTransition.js +69 -0
- package/molecules/Panel/Panel.cjs +148 -0
- package/molecules/Panel/Panel.d.ts +42 -0
- package/molecules/Panel/Panel.js +117 -0
- package/molecules/Slider/AbstractSliderChild.cjs +74 -0
- package/molecules/Slider/AbstractSliderChild.d.ts +55 -0
- package/molecules/Slider/AbstractSliderChild.js +43 -0
- package/molecules/Slider/Slider.cjs +240 -0
- package/molecules/Slider/Slider.d.ts +245 -0
- package/molecules/Slider/Slider.js +209 -0
- package/molecules/Slider/SliderBtn.cjs +65 -0
- package/molecules/Slider/SliderBtn.d.ts +31 -0
- package/molecules/Slider/SliderBtn.js +34 -0
- package/molecules/Slider/SliderCount.cjs +50 -0
- package/molecules/Slider/SliderCount.d.ts +21 -0
- package/molecules/Slider/SliderCount.js +19 -0
- package/molecules/Slider/SliderDots.cjs +55 -0
- package/molecules/Slider/SliderDots.d.ts +33 -0
- package/molecules/Slider/SliderDots.js +24 -0
- package/molecules/Slider/SliderDrag.cjs +45 -0
- package/molecules/Slider/SliderDrag.d.ts +16 -0
- package/molecules/Slider/SliderDrag.js +19 -0
- package/molecules/Slider/SliderItem.cjs +130 -0
- package/molecules/Slider/SliderItem.d.ts +106 -0
- package/molecules/Slider/SliderItem.js +105 -0
- package/molecules/Slider/SliderProgress.cjs +54 -0
- package/molecules/Slider/SliderProgress.d.ts +27 -0
- package/molecules/Slider/SliderProgress.js +23 -0
- package/molecules/Slider/index.cjs +50 -0
- package/molecules/Slider/index.d.ts +8 -0
- package/molecules/Slider/index.js +18 -0
- package/molecules/TableOfContent/TableOfContent.cjs +73 -0
- package/molecules/TableOfContent/TableOfContent.d.ts +59 -0
- package/molecules/TableOfContent/TableOfContent.js +42 -0
- package/molecules/TableOfContent/TableOfContentAnchor.cjs +65 -0
- package/molecules/TableOfContent/TableOfContentAnchor.d.ts +36 -0
- package/molecules/TableOfContent/TableOfContentAnchor.js +39 -0
- package/molecules/TableOfContent/index.cjs +38 -0
- package/molecules/TableOfContent/index.d.ts +2 -0
- package/molecules/TableOfContent/index.js +6 -0
- package/molecules/Tabs/Tabs.d.ts +2 -4
- package/molecules/index.cjs +7 -1
- package/molecules/index.d.ts +5 -1
- package/molecules/index.js +10 -4
- package/organisms/Frame/Frame.cjs +202 -0
- package/organisms/Frame/Frame.d.ts +119 -0
- package/organisms/Frame/Frame.js +171 -0
- package/organisms/Frame/FrameAnchor.cjs +48 -0
- package/organisms/Frame/FrameAnchor.d.ts +35 -0
- package/organisms/Frame/FrameAnchor.js +22 -0
- package/organisms/Frame/FrameForm.cjs +48 -0
- package/organisms/Frame/FrameForm.d.ts +32 -0
- package/organisms/Frame/FrameForm.js +22 -0
- package/organisms/Frame/FrameTarget.cjs +134 -0
- package/organisms/Frame/FrameTarget.d.ts +47 -0
- package/organisms/Frame/FrameTarget.js +109 -0
- package/organisms/Frame/index.cjs +42 -0
- package/organisms/Frame/index.d.ts +4 -0
- package/organisms/Frame/index.js +10 -0
- package/organisms/index.cjs +1 -0
- package/organisms/index.d.ts +1 -1
- package/organisms/index.js +1 -0
- package/package.json +2 -2
- package/primitives/Transition/Transition.cjs +71 -0
- package/primitives/Transition/Transition.d.ts +69 -0
- package/primitives/Transition/Transition.js +45 -0
- package/primitives/index.cjs +3 -1
- package/primitives/index.d.ts +1 -0
- package/primitives/index.js +3 -1
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
6
|
+
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __reExport = (target, module2, copyDefault, desc) => {
|
|
12
|
+
if (module2 && typeof module2 === "object" || typeof module2 === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(module2))
|
|
14
|
+
if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
|
|
15
|
+
__defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return target;
|
|
18
|
+
};
|
|
19
|
+
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
|
20
|
+
return (module2, temp) => {
|
|
21
|
+
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
22
|
+
};
|
|
23
|
+
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
24
|
+
var __publicField = (obj, key, value) => {
|
|
25
|
+
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
26
|
+
return value;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
// packages/ui/atoms/AnchorScrollTo/AnchorScrollTo.js
|
|
30
|
+
var AnchorScrollTo_exports = {};
|
|
31
|
+
__export(AnchorScrollTo_exports, {
|
|
32
|
+
default: () => AnchorScrollTo
|
|
33
|
+
});
|
|
34
|
+
var import_js_toolkit = require("@studiometa/js-toolkit");
|
|
35
|
+
var import_utils = require("@studiometa/js-toolkit/utils");
|
|
36
|
+
var AnchorScrollTo = class extends import_js_toolkit.Base {
|
|
37
|
+
get targetSelector() {
|
|
38
|
+
return this.$el.hash;
|
|
39
|
+
}
|
|
40
|
+
onClick(event) {
|
|
41
|
+
try {
|
|
42
|
+
(0, import_utils.scrollTo)(this.targetSelector);
|
|
43
|
+
event.preventDefault();
|
|
44
|
+
} catch (err) {
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
__publicField(AnchorScrollTo, "config", {
|
|
49
|
+
name: "AnchorScrollTo"
|
|
50
|
+
});
|
|
51
|
+
module.exports = __toCommonJS(AnchorScrollTo_exports);
|
|
52
|
+
if (module.exports.default) module.exports = module.exports.default;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @typedef {AnchorScrollTo & {
|
|
3
|
+
* $el: HTMLAnchorElement
|
|
4
|
+
* }} AnchorScrollToInterface
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* AncorScrollTo class.
|
|
8
|
+
*/
|
|
9
|
+
export default class AnchorScrollTo extends Base {
|
|
10
|
+
static config: {
|
|
11
|
+
name: string;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Get the target selector.
|
|
15
|
+
*
|
|
16
|
+
* @this {AnchorScrollToInterface}
|
|
17
|
+
* @returns {string}
|
|
18
|
+
*/
|
|
19
|
+
get targetSelector(): string;
|
|
20
|
+
/**
|
|
21
|
+
* Scroll to the target selector on click.
|
|
22
|
+
*
|
|
23
|
+
* @param {MouseEvent} event
|
|
24
|
+
* @returns {void}
|
|
25
|
+
*/
|
|
26
|
+
onClick(event: MouseEvent): void;
|
|
27
|
+
}
|
|
28
|
+
export type AnchorScrollToInterface = AnchorScrollTo & {
|
|
29
|
+
$el: HTMLAnchorElement;
|
|
30
|
+
};
|
|
31
|
+
import { Base } from "@studiometa/js-toolkit";
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
3
|
+
var __publicField = (obj, key, value) => {
|
|
4
|
+
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
5
|
+
return value;
|
|
6
|
+
};
|
|
7
|
+
import { Base } from "@studiometa/js-toolkit";
|
|
8
|
+
import { scrollTo } from "@studiometa/js-toolkit/utils";
|
|
9
|
+
class AnchorScrollTo extends Base {
|
|
10
|
+
get targetSelector() {
|
|
11
|
+
return this.$el.hash;
|
|
12
|
+
}
|
|
13
|
+
onClick(event) {
|
|
14
|
+
try {
|
|
15
|
+
scrollTo(this.targetSelector);
|
|
16
|
+
event.preventDefault();
|
|
17
|
+
} catch (err) {
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
__publicField(AnchorScrollTo, "config", {
|
|
22
|
+
name: "AnchorScrollTo"
|
|
23
|
+
});
|
|
24
|
+
export {
|
|
25
|
+
AnchorScrollTo as default
|
|
26
|
+
};
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
6
|
+
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __reExport = (target, module2, copyDefault, desc) => {
|
|
12
|
+
if (module2 && typeof module2 === "object" || typeof module2 === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(module2))
|
|
14
|
+
if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
|
|
15
|
+
__defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return target;
|
|
18
|
+
};
|
|
19
|
+
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
|
20
|
+
return (module2, temp) => {
|
|
21
|
+
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
22
|
+
};
|
|
23
|
+
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
24
|
+
var __publicField = (obj, key, value) => {
|
|
25
|
+
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
26
|
+
return value;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
// packages/ui/atoms/LargeText/LargeText.js
|
|
30
|
+
var LargeText_exports = {};
|
|
31
|
+
__export(LargeText_exports, {
|
|
32
|
+
default: () => LargeText
|
|
33
|
+
});
|
|
34
|
+
var import_js_toolkit = require("@studiometa/js-toolkit");
|
|
35
|
+
var import_utils = require("@studiometa/js-toolkit/utils");
|
|
36
|
+
var LargeText = class extends (0, import_js_toolkit.withMountWhenInView)(import_js_toolkit.Base, { rootMargin: "50%" }) {
|
|
37
|
+
constructor() {
|
|
38
|
+
super(...arguments);
|
|
39
|
+
__publicField(this, "translateX", 0);
|
|
40
|
+
__publicField(this, "deltaY", 0);
|
|
41
|
+
__publicField(this, "transform", {
|
|
42
|
+
skewX: 0,
|
|
43
|
+
translateX: 0
|
|
44
|
+
});
|
|
45
|
+
__publicField(this, "width", 0);
|
|
46
|
+
}
|
|
47
|
+
mounted() {
|
|
48
|
+
this.width = this.$refs.target.clientWidth;
|
|
49
|
+
}
|
|
50
|
+
resized() {
|
|
51
|
+
this.width = this.$refs.target.clientWidth;
|
|
52
|
+
}
|
|
53
|
+
scrolled(props) {
|
|
54
|
+
this.deltaY = props.delta.y;
|
|
55
|
+
}
|
|
56
|
+
ticked() {
|
|
57
|
+
this.translateX -= (Math.abs(this.deltaY) + 1) * this.$options.sensitivity;
|
|
58
|
+
this.transform.translateX = (0, import_utils.damp)(this.translateX, this.transform.translateX, 0.25);
|
|
59
|
+
if (this.$options.skew) {
|
|
60
|
+
this.transform.skewX = (0, import_utils.damp)((0, import_utils.clamp)(this.deltaY / 20 * -1, -0.5, 0.5) * this.$options.skewSensitivity, this.transform.skewX, 0.25);
|
|
61
|
+
}
|
|
62
|
+
if (this.translateX <= this.width * -1) {
|
|
63
|
+
this.translateX = 0;
|
|
64
|
+
this.transform.translateX += this.width;
|
|
65
|
+
} else if (this.$options.sensitivity < 0 && this.translateX >= this.width) {
|
|
66
|
+
this.translateX = 0;
|
|
67
|
+
this.transform.translateX -= this.width;
|
|
68
|
+
}
|
|
69
|
+
(0, import_utils.nextFrame)(() => {
|
|
70
|
+
this.$refs.target.style.transform = (0, import_utils.matrix)(this.transform) + " translateZ(0px)";
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
__publicField(LargeText, "config", {
|
|
75
|
+
name: "LargeText",
|
|
76
|
+
refs: ["target"],
|
|
77
|
+
options: {
|
|
78
|
+
skew: Boolean,
|
|
79
|
+
sensitivity: {
|
|
80
|
+
type: Number,
|
|
81
|
+
default: 1
|
|
82
|
+
},
|
|
83
|
+
skewSensitivity: {
|
|
84
|
+
type: Number,
|
|
85
|
+
default: 1
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
module.exports = __toCommonJS(LargeText_exports);
|
|
90
|
+
if (module.exports.default) module.exports = module.exports.default;
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @typedef {LargeText & {
|
|
3
|
+
* $refs: { target: HTMLElement },
|
|
4
|
+
* $options: {
|
|
5
|
+
* skew: boolean,
|
|
6
|
+
* sensitivity: number,
|
|
7
|
+
* skewSensitivity: number,
|
|
8
|
+
* }
|
|
9
|
+
* }} LargeTextInterface
|
|
10
|
+
*/
|
|
11
|
+
/**
|
|
12
|
+
* Large text class.
|
|
13
|
+
*/
|
|
14
|
+
export default class LargeText extends Base {
|
|
15
|
+
/**
|
|
16
|
+
* Config.
|
|
17
|
+
*/
|
|
18
|
+
static config: {
|
|
19
|
+
name: string;
|
|
20
|
+
refs: string[];
|
|
21
|
+
options: {
|
|
22
|
+
skew: BooleanConstructor;
|
|
23
|
+
sensitivity: {
|
|
24
|
+
type: NumberConstructor;
|
|
25
|
+
default: number;
|
|
26
|
+
};
|
|
27
|
+
skewSensitivity: {
|
|
28
|
+
type: NumberConstructor;
|
|
29
|
+
default: number;
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* Translate X.
|
|
35
|
+
* @type {number}
|
|
36
|
+
*/
|
|
37
|
+
translateX: number;
|
|
38
|
+
/**
|
|
39
|
+
* Scroll delta Y.
|
|
40
|
+
* @type {number}
|
|
41
|
+
*/
|
|
42
|
+
deltaY: number;
|
|
43
|
+
/**
|
|
44
|
+
* Transform values.
|
|
45
|
+
*/
|
|
46
|
+
transform: {
|
|
47
|
+
skewX: number;
|
|
48
|
+
translateX: number;
|
|
49
|
+
};
|
|
50
|
+
/**
|
|
51
|
+
* Target width.
|
|
52
|
+
* @type {number}
|
|
53
|
+
*/
|
|
54
|
+
width: number;
|
|
55
|
+
/**
|
|
56
|
+
* Set width on mount.
|
|
57
|
+
*
|
|
58
|
+
* @this {LargeTextInterface}
|
|
59
|
+
* @returns {void}
|
|
60
|
+
*/
|
|
61
|
+
mounted(): void;
|
|
62
|
+
/**
|
|
63
|
+
* Set width on resize.
|
|
64
|
+
*
|
|
65
|
+
* @this {LargeTextInterface}
|
|
66
|
+
* @returns {void}
|
|
67
|
+
*/
|
|
68
|
+
resized(): void;
|
|
69
|
+
/**
|
|
70
|
+
* Update delta scroll on scroll.
|
|
71
|
+
*
|
|
72
|
+
* @param {import('@studiometa/js-toolkit/services/scroll').ScrollServiceProps} props
|
|
73
|
+
* @returns {void}
|
|
74
|
+
*/
|
|
75
|
+
scrolled(props: import('@studiometa/js-toolkit/services/scroll').ScrollServiceProps): void;
|
|
76
|
+
/**
|
|
77
|
+
* Update values on raf.
|
|
78
|
+
*
|
|
79
|
+
* @this {LargeTextInterface}
|
|
80
|
+
* @returns {void}
|
|
81
|
+
*/
|
|
82
|
+
ticked(): void;
|
|
83
|
+
}
|
|
84
|
+
export type LargeTextInterface = LargeText & {
|
|
85
|
+
$refs: {
|
|
86
|
+
target: HTMLElement;
|
|
87
|
+
};
|
|
88
|
+
$options: {
|
|
89
|
+
skew: boolean;
|
|
90
|
+
sensitivity: number;
|
|
91
|
+
skewSensitivity: number;
|
|
92
|
+
};
|
|
93
|
+
};
|
|
94
|
+
import { Base } from "@studiometa/js-toolkit";
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
3
|
+
var __publicField = (obj, key, value) => {
|
|
4
|
+
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
5
|
+
return value;
|
|
6
|
+
};
|
|
7
|
+
import { Base, withMountWhenInView } from "@studiometa/js-toolkit";
|
|
8
|
+
import { damp, matrix, clamp, nextFrame } from "@studiometa/js-toolkit/utils";
|
|
9
|
+
class LargeText extends withMountWhenInView(Base, { rootMargin: "50%" }) {
|
|
10
|
+
constructor() {
|
|
11
|
+
super(...arguments);
|
|
12
|
+
__publicField(this, "translateX", 0);
|
|
13
|
+
__publicField(this, "deltaY", 0);
|
|
14
|
+
__publicField(this, "transform", {
|
|
15
|
+
skewX: 0,
|
|
16
|
+
translateX: 0
|
|
17
|
+
});
|
|
18
|
+
__publicField(this, "width", 0);
|
|
19
|
+
}
|
|
20
|
+
mounted() {
|
|
21
|
+
this.width = this.$refs.target.clientWidth;
|
|
22
|
+
}
|
|
23
|
+
resized() {
|
|
24
|
+
this.width = this.$refs.target.clientWidth;
|
|
25
|
+
}
|
|
26
|
+
scrolled(props) {
|
|
27
|
+
this.deltaY = props.delta.y;
|
|
28
|
+
}
|
|
29
|
+
ticked() {
|
|
30
|
+
this.translateX -= (Math.abs(this.deltaY) + 1) * this.$options.sensitivity;
|
|
31
|
+
this.transform.translateX = damp(this.translateX, this.transform.translateX, 0.25);
|
|
32
|
+
if (this.$options.skew) {
|
|
33
|
+
this.transform.skewX = damp(clamp(this.deltaY / 20 * -1, -0.5, 0.5) * this.$options.skewSensitivity, this.transform.skewX, 0.25);
|
|
34
|
+
}
|
|
35
|
+
if (this.translateX <= this.width * -1) {
|
|
36
|
+
this.translateX = 0;
|
|
37
|
+
this.transform.translateX += this.width;
|
|
38
|
+
} else if (this.$options.sensitivity < 0 && this.translateX >= this.width) {
|
|
39
|
+
this.translateX = 0;
|
|
40
|
+
this.transform.translateX -= this.width;
|
|
41
|
+
}
|
|
42
|
+
nextFrame(() => {
|
|
43
|
+
this.$refs.target.style.transform = matrix(this.transform) + " translateZ(0px)";
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
__publicField(LargeText, "config", {
|
|
48
|
+
name: "LargeText",
|
|
49
|
+
refs: ["target"],
|
|
50
|
+
options: {
|
|
51
|
+
skew: Boolean,
|
|
52
|
+
sensitivity: {
|
|
53
|
+
type: Number,
|
|
54
|
+
default: 1
|
|
55
|
+
},
|
|
56
|
+
skewSensitivity: {
|
|
57
|
+
type: Number,
|
|
58
|
+
default: 1
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
export {
|
|
63
|
+
LargeText as default
|
|
64
|
+
};
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
6
|
+
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __reExport = (target, module2, copyDefault, desc) => {
|
|
12
|
+
if (module2 && typeof module2 === "object" || typeof module2 === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(module2))
|
|
14
|
+
if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
|
|
15
|
+
__defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return target;
|
|
18
|
+
};
|
|
19
|
+
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
|
20
|
+
return (module2, temp) => {
|
|
21
|
+
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
22
|
+
};
|
|
23
|
+
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
24
|
+
var __publicField = (obj, key, value) => {
|
|
25
|
+
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
26
|
+
return value;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
// packages/ui/atoms/LazyInclude/LazyInclude.js
|
|
30
|
+
var LazyInclude_exports = {};
|
|
31
|
+
__export(LazyInclude_exports, {
|
|
32
|
+
default: () => LazyInclude
|
|
33
|
+
});
|
|
34
|
+
var import_js_toolkit = require("@studiometa/js-toolkit");
|
|
35
|
+
var LazyInclude = class extends import_js_toolkit.Base {
|
|
36
|
+
mounted() {
|
|
37
|
+
if (!this.$options.src) {
|
|
38
|
+
this.$log("The `src` option is missing. Define it with the `data-option-src` attribute");
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
fetch(this.$options.src).then((response) => response.text()).then((content) => {
|
|
42
|
+
this.$emit("content", content);
|
|
43
|
+
}).catch((error) => {
|
|
44
|
+
this.$emit("error", error);
|
|
45
|
+
}).finally(() => {
|
|
46
|
+
this.$emit("always");
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
onContent(content) {
|
|
50
|
+
this.$refs.loading.style.display = "none";
|
|
51
|
+
this.$el.innerHTML = content;
|
|
52
|
+
}
|
|
53
|
+
onError() {
|
|
54
|
+
this.$refs.error.style.display = "block";
|
|
55
|
+
}
|
|
56
|
+
onAlways() {
|
|
57
|
+
if (this.$options.terminateOnLoad) {
|
|
58
|
+
this.$terminate();
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
__publicField(LazyInclude, "config", {
|
|
63
|
+
name: "LazyInclude",
|
|
64
|
+
refs: ["loading", "error"],
|
|
65
|
+
emits: ["content", "error", "always"],
|
|
66
|
+
options: {
|
|
67
|
+
src: String,
|
|
68
|
+
terminateOnLoad: Boolean
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
module.exports = __toCommonJS(LazyInclude_exports);
|
|
72
|
+
if (module.exports.default) module.exports = module.exports.default;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @typedef {{ src: string, terminateOnLoad: boolean }} LazyIncludeOptions
|
|
3
|
+
* @typedef {{ loading: HTMLElement, error: HTMLElement }} LazyIncludeRefs
|
|
4
|
+
* @typedef {LazyInclude & { $refs: LazyIncludeRefs, $options: LazyIncludeOptions }} LazyIncludeInterface
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* LazyInclude class.
|
|
8
|
+
*/
|
|
9
|
+
export default class LazyInclude extends Base {
|
|
10
|
+
/**
|
|
11
|
+
* Config.
|
|
12
|
+
*/
|
|
13
|
+
static config: {
|
|
14
|
+
name: string;
|
|
15
|
+
refs: string[];
|
|
16
|
+
emits: string[];
|
|
17
|
+
options: {
|
|
18
|
+
src: StringConstructor;
|
|
19
|
+
terminateOnLoad: BooleanConstructor;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* Load the lazy content on mount.
|
|
24
|
+
*
|
|
25
|
+
* @this {LazyIncludeInterface}
|
|
26
|
+
* @returns {void}
|
|
27
|
+
*/
|
|
28
|
+
mounted(): void;
|
|
29
|
+
/**
|
|
30
|
+
* Set content.
|
|
31
|
+
*
|
|
32
|
+
* @this {LazyIncludeInterface}
|
|
33
|
+
* @param {string} content
|
|
34
|
+
* @returns {void}
|
|
35
|
+
*/
|
|
36
|
+
onContent(content: string): void;
|
|
37
|
+
/**
|
|
38
|
+
* Set error.
|
|
39
|
+
*
|
|
40
|
+
* @this {LazyIncludeInterface}
|
|
41
|
+
* @returns {void}
|
|
42
|
+
*/
|
|
43
|
+
onError(): void;
|
|
44
|
+
/**
|
|
45
|
+
* Always.
|
|
46
|
+
*
|
|
47
|
+
* @this {LazyIncludeInterface}
|
|
48
|
+
* @returns {void}
|
|
49
|
+
*/
|
|
50
|
+
onAlways(): void;
|
|
51
|
+
}
|
|
52
|
+
export type LazyIncludeOptions = {
|
|
53
|
+
src: string;
|
|
54
|
+
terminateOnLoad: boolean;
|
|
55
|
+
};
|
|
56
|
+
export type LazyIncludeRefs = {
|
|
57
|
+
loading: HTMLElement;
|
|
58
|
+
error: HTMLElement;
|
|
59
|
+
};
|
|
60
|
+
export type LazyIncludeInterface = LazyInclude & {
|
|
61
|
+
$refs: LazyIncludeRefs;
|
|
62
|
+
$options: LazyIncludeOptions;
|
|
63
|
+
};
|
|
64
|
+
import { Base } from "@studiometa/js-toolkit";
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
3
|
+
var __publicField = (obj, key, value) => {
|
|
4
|
+
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
5
|
+
return value;
|
|
6
|
+
};
|
|
7
|
+
import { Base } from "@studiometa/js-toolkit";
|
|
8
|
+
class LazyInclude extends Base {
|
|
9
|
+
mounted() {
|
|
10
|
+
if (!this.$options.src) {
|
|
11
|
+
this.$log("The `src` option is missing. Define it with the `data-option-src` attribute");
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
fetch(this.$options.src).then((response) => response.text()).then((content) => {
|
|
15
|
+
this.$emit("content", content);
|
|
16
|
+
}).catch((error) => {
|
|
17
|
+
this.$emit("error", error);
|
|
18
|
+
}).finally(() => {
|
|
19
|
+
this.$emit("always");
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
onContent(content) {
|
|
23
|
+
this.$refs.loading.style.display = "none";
|
|
24
|
+
this.$el.innerHTML = content;
|
|
25
|
+
}
|
|
26
|
+
onError() {
|
|
27
|
+
this.$refs.error.style.display = "block";
|
|
28
|
+
}
|
|
29
|
+
onAlways() {
|
|
30
|
+
if (this.$options.terminateOnLoad) {
|
|
31
|
+
this.$terminate();
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
__publicField(LazyInclude, "config", {
|
|
36
|
+
name: "LazyInclude",
|
|
37
|
+
refs: ["loading", "error"],
|
|
38
|
+
emits: ["content", "error", "always"],
|
|
39
|
+
options: {
|
|
40
|
+
src: String,
|
|
41
|
+
terminateOnLoad: Boolean
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
export {
|
|
45
|
+
LazyInclude as default
|
|
46
|
+
};
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
6
|
+
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __reExport = (target, module2, copyDefault, desc) => {
|
|
12
|
+
if (module2 && typeof module2 === "object" || typeof module2 === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(module2))
|
|
14
|
+
if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
|
|
15
|
+
__defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return target;
|
|
18
|
+
};
|
|
19
|
+
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
|
20
|
+
return (module2, temp) => {
|
|
21
|
+
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
22
|
+
};
|
|
23
|
+
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
24
|
+
var __publicField = (obj, key, value) => {
|
|
25
|
+
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
26
|
+
return value;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
// packages/ui/atoms/Prefetch/AbstractPrefetch.js
|
|
30
|
+
var AbstractPrefetch_exports = {};
|
|
31
|
+
__export(AbstractPrefetch_exports, {
|
|
32
|
+
default: () => AbstractPrefetch
|
|
33
|
+
});
|
|
34
|
+
var import_js_toolkit = require("@studiometa/js-toolkit");
|
|
35
|
+
var _AbstractPrefetch = class extends import_js_toolkit.Base {
|
|
36
|
+
isPrefetchable(url, options) {
|
|
37
|
+
if (!url || !url.href) {
|
|
38
|
+
return false;
|
|
39
|
+
}
|
|
40
|
+
if (!options.prefetch) {
|
|
41
|
+
return false;
|
|
42
|
+
}
|
|
43
|
+
if (url.origin !== window.location.origin) {
|
|
44
|
+
return false;
|
|
45
|
+
}
|
|
46
|
+
if (!["http:", "https:"].includes(url.protocol)) {
|
|
47
|
+
return false;
|
|
48
|
+
}
|
|
49
|
+
if (url.protocol === "http:" && window.location.protocol === "https:") {
|
|
50
|
+
return false;
|
|
51
|
+
}
|
|
52
|
+
if (url.hash && url.pathname + url.search === window.location.pathname + window.location.search) {
|
|
53
|
+
return false;
|
|
54
|
+
}
|
|
55
|
+
return true;
|
|
56
|
+
}
|
|
57
|
+
prefetch(url) {
|
|
58
|
+
if (_AbstractPrefetch.prefetchedUrls.has(url.href)) {
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
if (!this.isPrefetchable(url, this.$options)) {
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
const prefetcher = document.createElement("link");
|
|
65
|
+
prefetcher.rel = "prefetch";
|
|
66
|
+
prefetcher.href = url.href;
|
|
67
|
+
document.head.appendChild(prefetcher);
|
|
68
|
+
_AbstractPrefetch.prefetchedUrls.add(url.href);
|
|
69
|
+
this.$terminate();
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
var AbstractPrefetch = _AbstractPrefetch;
|
|
73
|
+
__publicField(AbstractPrefetch, "config", {
|
|
74
|
+
name: "AbstractPrefetch",
|
|
75
|
+
options: {
|
|
76
|
+
prefetch: {
|
|
77
|
+
type: Boolean,
|
|
78
|
+
default: true
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
__publicField(AbstractPrefetch, "prefetchedUrls", /* @__PURE__ */ new Set());
|
|
83
|
+
module.exports = __toCommonJS(AbstractPrefetch_exports);
|
|
84
|
+
if (module.exports.default) module.exports = module.exports.default;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @typedef {{ prefetch: boolean }} PrefetchOptions
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* @typedef {AbstractPrefetch & {
|
|
6
|
+
* $options: PrefetchOptions
|
|
7
|
+
* }} AbstractPrefetchInterface
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* AbstractPrefetch class.
|
|
11
|
+
*/
|
|
12
|
+
export default class AbstractPrefetch extends Base {
|
|
13
|
+
/**
|
|
14
|
+
* Config.
|
|
15
|
+
*/
|
|
16
|
+
static config: {
|
|
17
|
+
name: string;
|
|
18
|
+
options: {
|
|
19
|
+
prefetch: {
|
|
20
|
+
type: BooleanConstructor;
|
|
21
|
+
default: boolean;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* Store prefetched URL.
|
|
27
|
+
* @type {Set<string>}
|
|
28
|
+
*/
|
|
29
|
+
static prefetchedUrls: Set<string>;
|
|
30
|
+
/**
|
|
31
|
+
* Is the given anchor prefetchable?
|
|
32
|
+
* @param {URL} url
|
|
33
|
+
* @param {PrefetchOptions} options
|
|
34
|
+
* @returns {boolean}
|
|
35
|
+
*/
|
|
36
|
+
isPrefetchable(url: URL, options: PrefetchOptions): boolean;
|
|
37
|
+
/**
|
|
38
|
+
* Prefetch the given URL and terminate the component.
|
|
39
|
+
*
|
|
40
|
+
* @this {AbstractPrefetchInterface}
|
|
41
|
+
* @param {URL} url
|
|
42
|
+
* @returns {void}
|
|
43
|
+
*/
|
|
44
|
+
prefetch(url: URL): void;
|
|
45
|
+
}
|
|
46
|
+
export type PrefetchOptions = {
|
|
47
|
+
prefetch: boolean;
|
|
48
|
+
};
|
|
49
|
+
export type AbstractPrefetchInterface = AbstractPrefetch & {
|
|
50
|
+
$options: PrefetchOptions;
|
|
51
|
+
};
|
|
52
|
+
import { Base } from "@studiometa/js-toolkit";
|