@studiometa/ui 0.2.3 → 0.2.6
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 +8 -13
- package/atoms/AnchorScrollTo/AnchorScrollTo.js +1 -26
- package/atoms/Button/Button.twig +68 -0
- package/atoms/Button/StyledButton.twig +47 -0
- package/atoms/Cursor/Cursor.cjs +14 -22
- package/atoms/Cursor/Cursor.d.ts +2 -2
- package/atoms/Cursor/Cursor.js +1 -103
- package/atoms/Cursor/Cursor.twig +28 -0
- package/atoms/Figure/Figure.cjs +20 -16
- package/atoms/Figure/Figure.d.ts +19 -1
- package/atoms/Figure/Figure.js +1 -27
- package/atoms/Figure/Figure.twig +120 -0
- package/atoms/Figure/FigureTwicPics.cjs +72 -0
- package/atoms/Figure/FigureTwicPics.d.ts +48 -0
- package/atoms/Figure/FigureTwicPics.js +1 -0
- package/atoms/Figure/index.cjs +31 -0
- package/atoms/Figure/index.d.ts +2 -0
- package/atoms/Figure/index.js +1 -0
- package/atoms/Icon/Icon.twig +13 -0
- package/atoms/LargeText/LargeText.cjs +15 -23
- package/atoms/LargeText/LargeText.d.ts +3 -3
- package/atoms/LargeText/LargeText.js +1 -64
- package/atoms/LargeText/LargeText.twig +49 -0
- package/atoms/LazyInclude/LazyInclude.cjs +8 -13
- package/atoms/LazyInclude/LazyInclude.d.ts +4 -4
- package/atoms/LazyInclude/LazyInclude.js +1 -46
- package/atoms/Prefetch/AbstractPrefetch.cjs +8 -13
- package/atoms/Prefetch/AbstractPrefetch.d.ts +1 -1
- package/atoms/Prefetch/AbstractPrefetch.js +1 -58
- package/atoms/Prefetch/PrefetchWhenOver.cjs +12 -34
- package/atoms/Prefetch/PrefetchWhenOver.d.ts +1 -1
- package/atoms/Prefetch/PrefetchWhenOver.js +1 -35
- package/atoms/Prefetch/PrefetchWhenVisible.cjs +12 -34
- package/atoms/Prefetch/PrefetchWhenVisible.d.ts +1 -1
- package/atoms/Prefetch/PrefetchWhenVisible.js +1 -36
- package/atoms/Prefetch/index.cjs +9 -16
- package/atoms/Prefetch/index.js +1 -8
- package/atoms/ScrollAnimation/AbstractScrollAnimation.cjs +126 -0
- package/atoms/ScrollAnimation/AbstractScrollAnimation.d.ts +133 -0
- package/atoms/ScrollAnimation/AbstractScrollAnimation.js +1 -0
- package/atoms/ScrollAnimation/ScrollAnimation.cjs +51 -0
- package/atoms/ScrollAnimation/ScrollAnimation.d.ts +55 -0
- package/atoms/ScrollAnimation/ScrollAnimation.js +1 -0
- package/atoms/ScrollAnimation/ScrollAnimationChild.cjs +51 -0
- package/atoms/ScrollAnimation/ScrollAnimationChild.d.ts +13 -0
- package/atoms/ScrollAnimation/ScrollAnimationChild.js +1 -0
- package/atoms/ScrollAnimation/ScrollAnimationChildWithEase.cjs +41 -0
- package/atoms/ScrollAnimation/ScrollAnimationChildWithEase.d.ts +6 -0
- package/atoms/ScrollAnimation/ScrollAnimationChildWithEase.js +1 -0
- package/atoms/ScrollAnimation/ScrollAnimationParent.cjs +48 -0
- package/atoms/ScrollAnimation/ScrollAnimationParent.d.ts +35 -0
- package/atoms/ScrollAnimation/ScrollAnimationParent.js +1 -0
- package/atoms/ScrollAnimation/ScrollAnimationWithEase.cjs +41 -0
- package/atoms/ScrollAnimation/ScrollAnimationWithEase.d.ts +6 -0
- package/atoms/ScrollAnimation/ScrollAnimationWithEase.js +1 -0
- package/atoms/ScrollAnimation/animationScrollWithEase.cjs +70 -0
- package/atoms/ScrollAnimation/animationScrollWithEase.d.ts +11 -0
- package/atoms/ScrollAnimation/animationScrollWithEase.js +1 -0
- package/atoms/ScrollAnimation/index.cjs +41 -0
- package/atoms/ScrollAnimation/index.d.ts +7 -0
- package/atoms/ScrollAnimation/index.js +1 -0
- package/atoms/index.cjs +13 -19
- package/atoms/index.d.ts +2 -1
- package/atoms/index.js +1 -13
- package/index.cjs +12 -15
- package/index.d.ts +1 -0
- package/index.js +1 -3
- package/molecules/Accordion/Accordion.cjs +12 -34
- package/molecules/Accordion/Accordion.js +1 -35
- package/molecules/Accordion/Accordion.twig +54 -0
- package/molecules/Accordion/AccordionCore.cjs +8 -13
- package/molecules/Accordion/AccordionCore.d.ts +2 -2
- package/molecules/Accordion/AccordionCore.js +1 -34
- package/molecules/Accordion/AccordionItem.cjs +70 -114
- package/molecules/Accordion/AccordionItem.d.ts +7 -6
- package/molecules/Accordion/AccordionItem.js +1 -178
- package/molecules/Menu/Menu.cjs +148 -0
- package/molecules/Menu/Menu.d.ts +140 -0
- package/molecules/Menu/Menu.js +1 -0
- package/molecules/Menu/MenuBtn.cjs +53 -0
- package/molecules/Menu/MenuBtn.d.ts +39 -0
- package/molecules/Menu/MenuBtn.js +1 -0
- package/molecules/Menu/MenuList.cjs +134 -0
- package/molecules/Menu/MenuList.d.ts +101 -0
- package/molecules/Menu/MenuList.js +1 -0
- package/molecules/Menu/index.cjs +33 -0
- package/molecules/Menu/index.d.ts +3 -0
- package/molecules/Menu/index.js +1 -0
- package/molecules/Modal/Modal.cjs +42 -71
- package/molecules/Modal/Modal.d.ts +5 -5
- package/molecules/Modal/Modal.js +1 -150
- package/molecules/Modal/Modal.twig +108 -0
- package/molecules/Modal/ModalWithTransition.cjs +13 -43
- package/molecules/Modal/ModalWithTransition.js +1 -69
- package/molecules/Modal/StyledModal.twig +39 -0
- package/molecules/Panel/Panel.cjs +42 -76
- package/molecules/Panel/Panel.js +1 -117
- package/molecules/Panel/Panel.twig +73 -0
- package/molecules/Panel/StyledPanel.twig +28 -0
- package/molecules/Slider/AbstractSliderChild.cjs +10 -20
- package/molecules/Slider/AbstractSliderChild.d.ts +6 -2
- package/molecules/Slider/AbstractSliderChild.js +1 -43
- package/molecules/Slider/Slider.cjs +14 -24
- package/molecules/Slider/Slider.d.ts +6 -6
- package/molecules/Slider/Slider.js +1 -209
- package/molecules/Slider/SliderBtn.cjs +9 -16
- package/molecules/Slider/SliderBtn.d.ts +1 -1
- package/molecules/Slider/SliderBtn.js +1 -34
- package/molecules/Slider/SliderCount.cjs +9 -16
- package/molecules/Slider/SliderCount.js +1 -19
- package/molecules/Slider/SliderDots.cjs +9 -16
- package/molecules/Slider/SliderDots.js +1 -24
- package/molecules/Slider/SliderDrag.cjs +8 -13
- package/molecules/Slider/SliderDrag.js +1 -19
- package/molecules/Slider/SliderItem.cjs +14 -37
- package/molecules/Slider/SliderItem.js +1 -105
- package/molecules/Slider/SliderProgress.cjs +9 -16
- package/molecules/Slider/SliderProgress.js +1 -23
- package/molecules/Slider/index.cjs +9 -16
- package/molecules/Slider/index.js +1 -18
- package/molecules/Sticky/Sticky.cjs +11 -19
- package/molecules/Sticky/Sticky.d.ts +8 -8
- package/molecules/Sticky/Sticky.js +1 -107
- package/molecules/Sticky/Sticky.twig +31 -0
- package/molecules/TableOfContent/TableOfContent.cjs +9 -16
- package/molecules/TableOfContent/TableOfContent.d.ts +1 -1
- package/molecules/TableOfContent/TableOfContent.js +1 -42
- package/molecules/TableOfContent/TableOfContentAnchor.cjs +8 -13
- package/molecules/TableOfContent/TableOfContentAnchor.js +1 -39
- package/molecules/TableOfContent/index.cjs +9 -16
- package/molecules/TableOfContent/index.js +1 -6
- package/molecules/Tabs/Tabs.cjs +54 -82
- package/molecules/Tabs/Tabs.d.ts +5 -4
- package/molecules/Tabs/Tabs.js +1 -126
- package/molecules/Tabs/Tabs.twig +20 -0
- package/molecules/index.cjs +13 -18
- package/molecules/index.d.ts +1 -0
- package/molecules/index.js +1 -18
- package/organisms/Frame/Frame.cjs +107 -99
- package/organisms/Frame/Frame.d.ts +37 -4
- package/organisms/Frame/Frame.js +1 -171
- package/organisms/Frame/FrameAnchor.cjs +8 -13
- package/organisms/Frame/FrameAnchor.js +1 -22
- package/organisms/Frame/FrameForm.cjs +8 -13
- package/organisms/Frame/FrameForm.js +1 -22
- package/organisms/Frame/FrameTarget.cjs +31 -73
- package/organisms/Frame/FrameTarget.js +1 -109
- package/organisms/Frame/index.cjs +9 -16
- package/organisms/Frame/index.js +1 -10
- package/organisms/ImageGrid/ImageGrid.twig +42 -0
- package/organisms/index.cjs +9 -13
- package/organisms/index.js +1 -1
- package/package.json +3 -4
- package/primitives/Draggable/Draggable.cjs +15 -28
- package/primitives/Draggable/Draggable.d.ts +0 -5
- package/primitives/Draggable/Draggable.js +1 -38
- package/primitives/Sentinel/Sentinel.cjs +8 -13
- package/primitives/Sentinel/Sentinel.js +1 -15
- package/primitives/Transition/Transition.cjs +12 -17
- package/primitives/Transition/Transition.d.ts +2 -4
- package/primitives/Transition/Transition.js +1 -45
- package/primitives/index.cjs +9 -16
- package/primitives/index.js +1 -8
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
{#
|
|
2
|
+
/**
|
|
3
|
+
* @file
|
|
4
|
+
* Image Grid.
|
|
5
|
+
*
|
|
6
|
+
* @param array<Figure> $images
|
|
7
|
+
* List of images to display. See Figure.twig for the composition of each image.
|
|
8
|
+
* @param array $attr
|
|
9
|
+
* Custom attributes for the root element.
|
|
10
|
+
* @param array $inner_attr
|
|
11
|
+
* Custom attributes for the inner element.
|
|
12
|
+
* @param array $image_attr
|
|
13
|
+
* Custom attributes for the images' elements.
|
|
14
|
+
*/
|
|
15
|
+
#}
|
|
16
|
+
|
|
17
|
+
{% set attributes = merge_html_attributes(attr ?? null, { class: 'image-grid' }) %}
|
|
18
|
+
{% set inner_attributes =
|
|
19
|
+
merge_html_attributes(inner_attr ?? null, { class: 'image-grid__inner s:grid grid-cols-12 gap-10' })
|
|
20
|
+
%}
|
|
21
|
+
|
|
22
|
+
<div {{ html_attributes(attributes) }}>
|
|
23
|
+
<div {{ html_attributes(inner_attributes) }}>
|
|
24
|
+
{% for image in images %}
|
|
25
|
+
{% set modulo = loop.index % 5 %}
|
|
26
|
+
{% set image_attributes = merge_html_attributes(image_attr ?? null, {
|
|
27
|
+
class: 'image-grid__img'
|
|
28
|
+
}, {
|
|
29
|
+
class: {
|
|
30
|
+
's:col-span-7': modulo == 1 or modulo == 4,
|
|
31
|
+
's:col-span-5 mt-10': modulo == 2,
|
|
32
|
+
's:col-span-5 mt-10 clear-m-left': modulo == 3 and not loop.last,
|
|
33
|
+
's:col-start-2 s:col-end-11': modulo == 0 or (modulo in [0,3] and loop.last),
|
|
34
|
+
's:col-start-2 s:col-end-13': loop.first and loop.last
|
|
35
|
+
}
|
|
36
|
+
}) %}
|
|
37
|
+
<div {{ html_attributes(image_attributes) }}>
|
|
38
|
+
{% include '@ui/atoms/Figure/Figure.twig' with image only %}
|
|
39
|
+
</div>
|
|
40
|
+
{% endfor %}
|
|
41
|
+
</div>
|
|
42
|
+
</div>
|
package/organisms/index.cjs
CHANGED
|
@@ -2,23 +2,19 @@ var __defProp = Object.defineProperty;
|
|
|
2
2
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
3
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
4
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
__defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
|
|
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 });
|
|
11
10
|
}
|
|
12
|
-
return
|
|
11
|
+
return to;
|
|
13
12
|
};
|
|
14
|
-
var
|
|
15
|
-
|
|
16
|
-
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
17
|
-
};
|
|
18
|
-
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
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);
|
|
19
15
|
|
|
20
16
|
// packages/ui/organisms/index.js
|
|
21
17
|
var organisms_exports = {};
|
|
22
|
-
__reExport(organisms_exports, require("./Frame/index.cjs"));
|
|
23
18
|
module.exports = __toCommonJS(organisms_exports);
|
|
19
|
+
__reExport(organisms_exports, require("./Frame/index.cjs"), module.exports);
|
|
24
20
|
if (module.exports.default) module.exports = module.exports.default;
|
package/organisms/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export*from"./Frame/index.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@studiometa/ui",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.6",
|
|
4
4
|
"description": "A set of opiniated, unstyled and accessible components",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -29,8 +29,7 @@
|
|
|
29
29
|
},
|
|
30
30
|
"homepage": "https://github.com/studiometa/ui#readme",
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@studiometa/js-toolkit": "^2.0.0
|
|
33
|
-
"deepmerge": "^4.2.2"
|
|
34
|
-
"motion": "^10.5.0"
|
|
32
|
+
"@studiometa/js-toolkit": "^2.0.0",
|
|
33
|
+
"deepmerge": "^4.2.2"
|
|
35
34
|
}
|
|
36
35
|
}
|
|
@@ -3,24 +3,19 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
3
3
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
4
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
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
6
|
var __export = (target, all) => {
|
|
8
7
|
for (var name in all)
|
|
9
8
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
9
|
};
|
|
11
|
-
var
|
|
12
|
-
if (
|
|
13
|
-
for (let key of __getOwnPropNames(
|
|
14
|
-
if (!__hasOwnProp.call(
|
|
15
|
-
__defProp(
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
15
|
}
|
|
17
|
-
return
|
|
16
|
+
return to;
|
|
18
17
|
};
|
|
19
|
-
var __toCommonJS =
|
|
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);
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
24
19
|
var __publicField = (obj, key, value) => {
|
|
25
20
|
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
26
21
|
return value;
|
|
@@ -31,16 +26,14 @@ var Draggable_exports = {};
|
|
|
31
26
|
__export(Draggable_exports, {
|
|
32
27
|
default: () => Draggable
|
|
33
28
|
});
|
|
34
|
-
|
|
29
|
+
module.exports = __toCommonJS(Draggable_exports);
|
|
35
30
|
var import_js_toolkit = require("@studiometa/js-toolkit");
|
|
36
|
-
var
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
__publicField(this, "originY", 0);
|
|
43
|
-
}
|
|
31
|
+
var import_utils = require("@studiometa/js-toolkit/utils");
|
|
32
|
+
var Draggable = class extends (0, import_js_toolkit.withDrag)(import_js_toolkit.Base) {
|
|
33
|
+
x = 0;
|
|
34
|
+
y = 0;
|
|
35
|
+
originX = 0;
|
|
36
|
+
originY = 0;
|
|
44
37
|
dragged(props) {
|
|
45
38
|
if (props.mode === "start") {
|
|
46
39
|
this.originX = this.x;
|
|
@@ -49,16 +42,10 @@ var _Draggable = class extends (0, import_js_toolkit.withDrag)(import_js_toolkit
|
|
|
49
42
|
}
|
|
50
43
|
this.x = this.originX + props.x - props.origin.x;
|
|
51
44
|
this.y = this.originY + props.y - props.origin.y;
|
|
52
|
-
(0,
|
|
45
|
+
this.$el.style.transform = (0, import_utils.matrix)({ translateX: this.x, translateY: this.y });
|
|
53
46
|
}
|
|
54
47
|
};
|
|
55
|
-
var Draggable = _Draggable;
|
|
56
48
|
__publicField(Draggable, "config", {
|
|
57
49
|
name: "DraggableElement"
|
|
58
50
|
});
|
|
59
|
-
__publicField(Draggable, "animateOptions", {
|
|
60
|
-
easing: "linear",
|
|
61
|
-
duration: 0
|
|
62
|
-
});
|
|
63
|
-
module.exports = __toCommonJS(Draggable_exports);
|
|
64
51
|
if (module.exports.default) module.exports = module.exports.default;
|
|
@@ -5,11 +5,6 @@ export default class Draggable extends Base {
|
|
|
5
5
|
static config: {
|
|
6
6
|
name: string;
|
|
7
7
|
};
|
|
8
|
-
/**
|
|
9
|
-
* Options for the animate function.
|
|
10
|
-
* @type {import('motion').AnimationListOptions}
|
|
11
|
-
*/
|
|
12
|
-
static animateOptions: import('motion').AnimationListOptions;
|
|
13
8
|
/**
|
|
14
9
|
* Horizontal transformation.
|
|
15
10
|
* @type {number}
|
|
@@ -1,38 +1 @@
|
|
|
1
|
-
|
|
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 { animate } from "motion";
|
|
8
|
-
import { Base, withDrag } from "@studiometa/js-toolkit";
|
|
9
|
-
const _Draggable = class extends withDrag(Base) {
|
|
10
|
-
constructor() {
|
|
11
|
-
super(...arguments);
|
|
12
|
-
__publicField(this, "x", 0);
|
|
13
|
-
__publicField(this, "y", 0);
|
|
14
|
-
__publicField(this, "originX", 0);
|
|
15
|
-
__publicField(this, "originY", 0);
|
|
16
|
-
}
|
|
17
|
-
dragged(props) {
|
|
18
|
-
if (props.mode === "start") {
|
|
19
|
-
this.originX = this.x;
|
|
20
|
-
this.originY = this.y;
|
|
21
|
-
return;
|
|
22
|
-
}
|
|
23
|
-
this.x = this.originX + props.x - props.origin.x;
|
|
24
|
-
this.y = this.originY + props.y - props.origin.y;
|
|
25
|
-
animate(this.$el, { x: this.x, y: this.y }, _Draggable.animateOptions);
|
|
26
|
-
}
|
|
27
|
-
};
|
|
28
|
-
let Draggable = _Draggable;
|
|
29
|
-
__publicField(Draggable, "config", {
|
|
30
|
-
name: "DraggableElement"
|
|
31
|
-
});
|
|
32
|
-
__publicField(Draggable, "animateOptions", {
|
|
33
|
-
easing: "linear",
|
|
34
|
-
duration: 0
|
|
35
|
-
});
|
|
36
|
-
export {
|
|
37
|
-
Draggable as default
|
|
38
|
-
};
|
|
1
|
+
import{Base as t,withDrag as r}from"@studiometa/js-toolkit";import{matrix as a}from"@studiometa/js-toolkit/utils";class e extends r(t){static config={name:"DraggableElement"};x=0;y=0;originX=0;originY=0;dragged(i){if(i.mode==="start"){this.originX=this.x,this.originY=this.y;return}this.x=this.originX+i.x-i.origin.x,this.y=this.originY+i.y-i.origin.y,this.$el.style.transform=a({translateX:this.x,translateY:this.y})}}export{e as default};
|
|
@@ -3,24 +3,19 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
3
3
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
4
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
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
6
|
var __export = (target, all) => {
|
|
8
7
|
for (var name in all)
|
|
9
8
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
9
|
};
|
|
11
|
-
var
|
|
12
|
-
if (
|
|
13
|
-
for (let key of __getOwnPropNames(
|
|
14
|
-
if (!__hasOwnProp.call(
|
|
15
|
-
__defProp(
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
15
|
}
|
|
17
|
-
return
|
|
16
|
+
return to;
|
|
18
17
|
};
|
|
19
|
-
var __toCommonJS =
|
|
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);
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
24
19
|
var __publicField = (obj, key, value) => {
|
|
25
20
|
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
26
21
|
return value;
|
|
@@ -31,11 +26,11 @@ var Sentinel_exports = {};
|
|
|
31
26
|
__export(Sentinel_exports, {
|
|
32
27
|
default: () => Sentinel
|
|
33
28
|
});
|
|
29
|
+
module.exports = __toCommonJS(Sentinel_exports);
|
|
34
30
|
var import_js_toolkit = require("@studiometa/js-toolkit");
|
|
35
31
|
var Sentinel = class extends (0, import_js_toolkit.withIntersectionObserver)(import_js_toolkit.Base, { threshold: [0, 1] }) {
|
|
36
32
|
};
|
|
37
33
|
__publicField(Sentinel, "config", {
|
|
38
34
|
name: "Sentinel"
|
|
39
35
|
});
|
|
40
|
-
module.exports = __toCommonJS(Sentinel_exports);
|
|
41
36
|
if (module.exports.default) module.exports = module.exports.default;
|
|
@@ -1,15 +1 @@
|
|
|
1
|
-
|
|
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, withIntersectionObserver } from "@studiometa/js-toolkit";
|
|
8
|
-
class Sentinel extends withIntersectionObserver(Base, { threshold: [0, 1] }) {
|
|
9
|
-
}
|
|
10
|
-
__publicField(Sentinel, "config", {
|
|
11
|
-
name: "Sentinel"
|
|
12
|
-
});
|
|
13
|
-
export {
|
|
14
|
-
Sentinel as default
|
|
15
|
-
};
|
|
1
|
+
import{Base as e,withIntersectionObserver as t}from"@studiometa/js-toolkit";class n extends t(e,{threshold:[0,1]}){static config={name:"Sentinel"}}export{n as default};
|
|
@@ -3,24 +3,19 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
3
3
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
4
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
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
6
|
var __export = (target, all) => {
|
|
8
7
|
for (var name in all)
|
|
9
8
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
9
|
};
|
|
11
|
-
var
|
|
12
|
-
if (
|
|
13
|
-
for (let key of __getOwnPropNames(
|
|
14
|
-
if (!__hasOwnProp.call(
|
|
15
|
-
__defProp(
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
15
|
}
|
|
17
|
-
return
|
|
16
|
+
return to;
|
|
18
17
|
};
|
|
19
|
-
var __toCommonJS =
|
|
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);
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
24
19
|
var __publicField = (obj, key, value) => {
|
|
25
20
|
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
26
21
|
return value;
|
|
@@ -31,6 +26,7 @@ var Transition_exports = {};
|
|
|
31
26
|
__export(Transition_exports, {
|
|
32
27
|
default: () => Transition
|
|
33
28
|
});
|
|
29
|
+
module.exports = __toCommonJS(Transition_exports);
|
|
34
30
|
var import_js_toolkit = require("@studiometa/js-toolkit");
|
|
35
31
|
var import_utils = require("@studiometa/js-toolkit/utils");
|
|
36
32
|
var Transition = class extends import_js_toolkit.Base {
|
|
@@ -38,17 +34,17 @@ var Transition = class extends import_js_toolkit.Base {
|
|
|
38
34
|
return this.$el;
|
|
39
35
|
}
|
|
40
36
|
enter() {
|
|
41
|
-
const { enterFrom, enterActive, enterTo, enterKeep } = this.$options;
|
|
37
|
+
const { enterFrom, enterActive, enterTo, enterKeep, leaveTo } = this.$options;
|
|
42
38
|
return (0, import_utils.transition)(this.target, {
|
|
43
|
-
from: enterFrom,
|
|
39
|
+
from: (leaveTo + " " + enterFrom).trim(),
|
|
44
40
|
active: enterActive,
|
|
45
41
|
to: enterTo
|
|
46
42
|
}, enterKeep && "keep");
|
|
47
43
|
}
|
|
48
44
|
leave() {
|
|
49
|
-
const { leaveFrom, leaveActive, leaveTo, leaveKeep } = this.$options;
|
|
45
|
+
const { leaveFrom, leaveActive, leaveTo, leaveKeep, enterTo } = this.$options;
|
|
50
46
|
return (0, import_utils.transition)(this.target, {
|
|
51
|
-
from: leaveFrom,
|
|
47
|
+
from: (enterTo + " " + leaveFrom).trim(),
|
|
52
48
|
active: leaveActive,
|
|
53
49
|
to: leaveTo
|
|
54
50
|
}, leaveKeep && "keep");
|
|
@@ -67,5 +63,4 @@ __publicField(Transition, "config", {
|
|
|
67
63
|
leaveKeep: Boolean
|
|
68
64
|
}
|
|
69
65
|
});
|
|
70
|
-
module.exports = __toCommonJS(Transition_exports);
|
|
71
66
|
if (module.exports.default) module.exports = module.exports.default;
|
|
@@ -36,19 +36,17 @@ export default class Transition extends Base {
|
|
|
36
36
|
/**
|
|
37
37
|
* Trigger the enter transition.
|
|
38
38
|
*
|
|
39
|
-
* @todo merge leaveTo and enterFrom classes when leaveKeep is active
|
|
40
39
|
* @this {TransitionInterface}
|
|
41
40
|
* @returns {Promise<void>}
|
|
42
41
|
*/
|
|
43
|
-
enter(): Promise<void>;
|
|
42
|
+
enter(this: TransitionInterface): Promise<void>;
|
|
44
43
|
/**
|
|
45
44
|
* Trigger the leave transition.
|
|
46
45
|
*
|
|
47
|
-
* @todo merge enterTo and leaveTo classes when enterKeep is active
|
|
48
46
|
* @this {TransitionInterface}
|
|
49
47
|
* @returns {Promise<void>}
|
|
50
48
|
*/
|
|
51
|
-
leave(): Promise<void>;
|
|
49
|
+
leave(this: TransitionInterface): Promise<void>;
|
|
52
50
|
}
|
|
53
51
|
export type TransitionOptions = {
|
|
54
52
|
enterFrom: string;
|
|
@@ -1,45 +1 @@
|
|
|
1
|
-
|
|
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 { transition } from "@studiometa/js-toolkit/utils";
|
|
9
|
-
class Transition extends Base {
|
|
10
|
-
get target() {
|
|
11
|
-
return this.$el;
|
|
12
|
-
}
|
|
13
|
-
enter() {
|
|
14
|
-
const { enterFrom, enterActive, enterTo, enterKeep } = this.$options;
|
|
15
|
-
return transition(this.target, {
|
|
16
|
-
from: enterFrom,
|
|
17
|
-
active: enterActive,
|
|
18
|
-
to: enterTo
|
|
19
|
-
}, enterKeep && "keep");
|
|
20
|
-
}
|
|
21
|
-
leave() {
|
|
22
|
-
const { leaveFrom, leaveActive, leaveTo, leaveKeep } = this.$options;
|
|
23
|
-
return transition(this.target, {
|
|
24
|
-
from: leaveFrom,
|
|
25
|
-
active: leaveActive,
|
|
26
|
-
to: leaveTo
|
|
27
|
-
}, leaveKeep && "keep");
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
__publicField(Transition, "config", {
|
|
31
|
-
name: "Transition",
|
|
32
|
-
options: {
|
|
33
|
-
enterFrom: String,
|
|
34
|
-
enterActive: String,
|
|
35
|
-
enterTo: String,
|
|
36
|
-
enterKeep: Boolean,
|
|
37
|
-
leaveFrom: String,
|
|
38
|
-
leaveActive: String,
|
|
39
|
-
leaveTo: String,
|
|
40
|
-
leaveKeep: Boolean
|
|
41
|
-
}
|
|
42
|
-
});
|
|
43
|
-
export {
|
|
44
|
-
Transition as default
|
|
45
|
-
};
|
|
1
|
+
import{Base as a}from"@studiometa/js-toolkit";import{transition as i}from"@studiometa/js-toolkit/utils";class s extends a{static config={name:"Transition",options:{enterFrom:String,enterActive:String,enterTo:String,enterKeep:Boolean,leaveFrom:String,leaveActive:String,leaveTo:String,leaveKeep:Boolean}};get target(){return this.$el}enter(){const{enterFrom:e,enterActive:t,enterTo:r,enterKeep:n,leaveTo:o}=this.$options;return i(this.target,{from:(o+" "+e).trim(),active:t,to:r},n&&"keep")}leave(){const{leaveFrom:e,leaveActive:t,leaveTo:r,leaveKeep:n,enterTo:o}=this.$options;return i(this.target,{from:(o+" "+e).trim(),active:t,to:r},n&&"keep")}}export{s as default};
|
package/primitives/index.cjs
CHANGED
|
@@ -4,27 +4,20 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
4
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
5
|
var __getProtoOf = Object.getPrototypeOf;
|
|
6
6
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
8
7
|
var __export = (target, all) => {
|
|
9
8
|
for (var name in all)
|
|
10
9
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
10
|
};
|
|
12
|
-
var
|
|
13
|
-
if (
|
|
14
|
-
for (let key of __getOwnPropNames(
|
|
15
|
-
if (!__hasOwnProp.call(
|
|
16
|
-
__defProp(
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
16
|
}
|
|
18
|
-
return
|
|
17
|
+
return to;
|
|
19
18
|
};
|
|
20
|
-
var __toESM = (
|
|
21
|
-
|
|
22
|
-
};
|
|
23
|
-
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
|
24
|
-
return (module2, temp) => {
|
|
25
|
-
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
26
|
-
};
|
|
27
|
-
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
|
|
20
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
21
|
|
|
29
22
|
// packages/ui/primitives/index.js
|
|
30
23
|
var primitives_exports = {};
|
|
@@ -33,8 +26,8 @@ __export(primitives_exports, {
|
|
|
33
26
|
Sentinel: () => import_Sentinel.default,
|
|
34
27
|
Transition: () => import_Transition.default
|
|
35
28
|
});
|
|
29
|
+
module.exports = __toCommonJS(primitives_exports);
|
|
36
30
|
var import_Draggable = __toESM(require("./Draggable/Draggable.cjs"), 1);
|
|
37
31
|
var import_Sentinel = __toESM(require("./Sentinel/Sentinel.cjs"), 1);
|
|
38
32
|
var import_Transition = __toESM(require("./Transition/Transition.cjs"), 1);
|
|
39
|
-
module.exports = __toCommonJS(primitives_exports);
|
|
40
33
|
if (module.exports.default) module.exports = module.exports.default;
|
package/primitives/index.js
CHANGED
|
@@ -1,8 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { default as default3 } from "./Sentinel/Sentinel.js";
|
|
3
|
-
import { default as default4 } from "./Transition/Transition.js";
|
|
4
|
-
export {
|
|
5
|
-
default2 as Draggable,
|
|
6
|
-
default3 as Sentinel,
|
|
7
|
-
default4 as Transition
|
|
8
|
-
};
|
|
1
|
+
import{default as r}from"./Draggable/Draggable.js";import{default as o}from"./Sentinel/Sentinel.js";import{default as l}from"./Transition/Transition.js";export{r as Draggable,o as Sentinel,l as Transition};
|