@studiometa/ui 0.2.13 → 0.2.14
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 +3 -3
- package/atoms/AnchorScrollTo/AnchorScrollTo.d.ts +8 -15
- package/atoms/AnchorScrollTo/AnchorScrollTo.js +26 -1
- package/atoms/AnchorScrollTo/index.cjs +20 -0
- package/atoms/AnchorScrollTo/index.d.ts +1 -0
- package/atoms/AnchorScrollTo/index.js +1 -0
- package/atoms/Cursor/Cursor.cjs +16 -9
- package/atoms/Cursor/Cursor.d.ts +19 -117
- package/atoms/Cursor/Cursor.js +111 -1
- package/atoms/Cursor/index.cjs +20 -0
- package/atoms/Cursor/index.d.ts +1 -0
- package/atoms/Cursor/index.js +1 -0
- package/atoms/Figure/Figure.cjs +15 -9
- package/atoms/Figure/Figure.d.ts +18 -53
- package/atoms/Figure/Figure.js +56 -1
- package/atoms/Figure/FigureTwicPics.cjs +10 -10
- package/atoms/Figure/FigureTwicPics.d.ts +16 -37
- package/atoms/Figure/FigureTwicPics.js +51 -1
- package/atoms/Figure/index.cjs +4 -14
- package/atoms/Figure/index.d.ts +2 -2
- package/atoms/Figure/index.js +2 -1
- package/atoms/LargeText/LargeText.cjs +17 -10
- package/atoms/LargeText/LargeText.d.ts +19 -40
- package/atoms/LargeText/LargeText.js +68 -1
- package/atoms/LargeText/index.cjs +20 -0
- package/atoms/LargeText/index.d.ts +1 -0
- package/atoms/LargeText/index.js +1 -0
- package/atoms/LazyInclude/LazyInclude.cjs +2 -2
- package/atoms/LazyInclude/LazyInclude.d.ts +17 -36
- package/atoms/LazyInclude/LazyInclude.js +46 -1
- package/atoms/LazyInclude/index.cjs +20 -0
- package/atoms/LazyInclude/index.d.ts +1 -0
- package/atoms/LazyInclude/index.js +1 -0
- package/atoms/Prefetch/AbstractPrefetch.cjs +6 -6
- package/atoms/Prefetch/AbstractPrefetch.d.ts +12 -35
- package/atoms/Prefetch/AbstractPrefetch.js +58 -1
- package/atoms/Prefetch/PrefetchWhenOver.cjs +5 -8
- package/atoms/Prefetch/PrefetchWhenOver.d.ts +8 -14
- package/atoms/Prefetch/PrefetchWhenOver.js +19 -1
- package/atoms/Prefetch/PrefetchWhenVisible.cjs +5 -8
- package/atoms/Prefetch/PrefetchWhenVisible.d.ts +10 -14
- package/atoms/Prefetch/PrefetchWhenVisible.js +20 -1
- package/atoms/Prefetch/index.cjs +5 -16
- package/atoms/Prefetch/index.d.ts +3 -3
- package/atoms/Prefetch/index.js +3 -1
- package/atoms/ScrollAnimation/AbstractScrollAnimation.cjs +17 -14
- package/atoms/ScrollAnimation/AbstractScrollAnimation.d.ts +19 -89
- package/atoms/ScrollAnimation/AbstractScrollAnimation.js +67 -1
- package/atoms/ScrollAnimation/ScrollAnimation.cjs +5 -14
- package/atoms/ScrollAnimation/ScrollAnimation.d.ts +13 -51
- package/atoms/ScrollAnimation/ScrollAnimation.js +21 -1
- package/atoms/ScrollAnimation/ScrollAnimationChild.cjs +37 -14
- package/atoms/ScrollAnimation/ScrollAnimationChild.d.ts +19 -6
- package/atoms/ScrollAnimation/ScrollAnimationChild.js +53 -1
- package/atoms/ScrollAnimation/ScrollAnimationChildWithEase.cjs +6 -9
- package/atoms/ScrollAnimation/ScrollAnimationChildWithEase.d.ts +8 -2
- package/atoms/ScrollAnimation/ScrollAnimationChildWithEase.js +17 -1
- package/atoms/ScrollAnimation/ScrollAnimationParent.cjs +8 -8
- package/atoms/ScrollAnimation/ScrollAnimationParent.d.ts +14 -26
- package/atoms/ScrollAnimation/ScrollAnimationParent.js +27 -1
- package/atoms/ScrollAnimation/ScrollAnimationWithEase.cjs +6 -9
- package/atoms/ScrollAnimation/ScrollAnimationWithEase.d.ts +15 -2
- package/atoms/ScrollAnimation/ScrollAnimationWithEase.js +17 -1
- package/atoms/ScrollAnimation/animationScrollWithEase.cjs +24 -16
- package/atoms/ScrollAnimation/animationScrollWithEase.d.ts +10 -8
- package/atoms/ScrollAnimation/animationScrollWithEase.js +36 -1
- package/atoms/ScrollAnimation/index.cjs +9 -24
- package/atoms/ScrollAnimation/index.d.ts +7 -7
- package/atoms/ScrollAnimation/index.js +7 -1
- package/atoms/ScrollReveal/ScrollReveal.cjs +7 -4
- package/atoms/ScrollReveal/ScrollReveal.d.ts +16 -59
- package/atoms/ScrollReveal/ScrollReveal.js +54 -1
- package/atoms/ScrollReveal/index.cjs +3 -12
- package/atoms/ScrollReveal/index.d.ts +1 -1
- package/atoms/ScrollReveal/index.js +1 -1
- package/atoms/index.cjs +5 -18
- package/atoms/index.d.ts +8 -8
- package/atoms/index.js +8 -1
- package/decorators/index.cjs +3 -12
- package/decorators/index.d.ts +1 -1
- package/decorators/index.js +1 -1
- package/decorators/withTransition.cjs +44 -29
- package/decorators/withTransition.d.ts +21 -33
- package/decorators/withTransition.js +60 -1
- package/index.cjs +1 -1
- package/index.d.ts +5 -5
- package/index.js +5 -1
- package/molecules/Accordion/Accordion.cjs +7 -10
- package/molecules/Accordion/Accordion.d.ts +5 -23
- package/molecules/Accordion/Accordion.js +19 -1
- package/molecules/Accordion/AccordionCore.cjs +6 -8
- package/molecules/Accordion/AccordionCore.d.ts +22 -70
- package/molecules/Accordion/AccordionCore.js +32 -1
- package/molecules/Accordion/AccordionItem.cjs +39 -23
- package/molecules/Accordion/AccordionItem.d.ts +24 -94
- package/molecules/Accordion/AccordionItem.js +153 -1
- package/molecules/Accordion/index.cjs +21 -0
- package/molecules/Accordion/index.d.ts +2 -0
- package/molecules/Accordion/index.js +2 -0
- package/molecules/Menu/Menu.cjs +6 -10
- package/molecules/Menu/Menu.d.ts +24 -84
- package/molecules/Menu/Menu.js +114 -1
- package/molecules/Menu/MenuBtn.cjs +7 -5
- package/molecules/Menu/MenuBtn.d.ts +7 -9
- package/molecules/Menu/MenuBtn.js +30 -1
- package/molecules/Menu/MenuList.cjs +13 -11
- package/molecules/Menu/MenuList.d.ts +16 -53
- package/molecules/Menu/MenuList.js +113 -1
- package/molecules/Menu/index.cjs +5 -16
- package/molecules/Menu/index.d.ts +3 -3
- package/molecules/Menu/index.js +3 -1
- package/molecules/Modal/Modal.cjs +42 -13
- package/molecules/Modal/Modal.d.ts +69 -140
- package/molecules/Modal/Modal.js +163 -1
- package/molecules/Modal/ModalWithTransition.cjs +4 -7
- package/molecules/Modal/ModalWithTransition.d.ts +6 -22
- package/molecules/Modal/ModalWithTransition.js +46 -1
- package/molecules/Modal/index.cjs +21 -0
- package/molecules/Modal/index.d.ts +2 -0
- package/molecules/Modal/index.js +2 -0
- package/molecules/Panel/Panel.cjs +41 -26
- package/molecules/Panel/Panel.d.ts +22 -21
- package/molecules/Panel/Panel.js +108 -1
- package/molecules/Panel/index.cjs +20 -0
- package/molecules/Panel/index.d.ts +1 -0
- package/molecules/Panel/index.js +1 -0
- package/molecules/Slider/AbstractSliderChild.cjs +7 -9
- package/molecules/Slider/AbstractSliderChild.d.ts +11 -30
- package/molecules/Slider/AbstractSliderChild.js +48 -1
- package/molecules/Slider/Slider.cjs +45 -30
- package/molecules/Slider/Slider.d.ts +40 -157
- package/molecules/Slider/Slider.js +279 -1
- package/molecules/Slider/SliderBtn.cjs +4 -7
- package/molecules/Slider/SliderBtn.d.ts +12 -23
- package/molecules/Slider/SliderBtn.js +34 -1
- package/molecules/Slider/SliderCount.cjs +4 -7
- package/molecules/Slider/SliderCount.d.ts +10 -16
- package/molecules/Slider/SliderCount.js +19 -1
- package/molecules/Slider/SliderDots.cjs +8 -8
- package/molecules/Slider/SliderDots.d.ts +11 -31
- package/molecules/Slider/SliderDots.js +32 -1
- package/molecules/Slider/SliderDrag.cjs +2 -2
- package/molecules/Slider/SliderDrag.d.ts +12 -30
- package/molecules/Slider/SliderDrag.js +34 -1
- package/molecules/Slider/SliderItem.cjs +12 -6
- package/molecules/Slider/SliderItem.d.ts +21 -33
- package/molecules/Slider/SliderItem.js +93 -1
- package/molecules/Slider/SliderProgress.cjs +4 -7
- package/molecules/Slider/SliderProgress.d.ts +10 -25
- package/molecules/Slider/SliderProgress.js +26 -1
- package/molecules/Slider/index.cjs +10 -26
- package/molecules/Slider/index.d.ts +8 -8
- package/molecules/Slider/index.js +8 -1
- package/molecules/Sticky/Sticky.cjs +16 -10
- package/molecules/Sticky/Sticky.d.ts +30 -68
- package/molecules/Sticky/Sticky.js +110 -1
- package/molecules/Sticky/index.cjs +20 -0
- package/molecules/Sticky/index.d.ts +1 -0
- package/molecules/Sticky/index.js +1 -0
- package/molecules/TableOfContent/TableOfContent.cjs +5 -8
- package/molecules/TableOfContent/TableOfContent.d.ts +19 -41
- package/molecules/TableOfContent/TableOfContent.js +42 -1
- package/molecules/TableOfContent/TableOfContentAnchor.cjs +9 -5
- package/molecules/TableOfContent/TableOfContentAnchor.d.ts +14 -17
- package/molecules/TableOfContent/TableOfContentAnchor.js +43 -1
- package/molecules/TableOfContent/index.cjs +4 -14
- package/molecules/TableOfContent/index.d.ts +2 -2
- package/molecules/TableOfContent/index.js +2 -1
- package/molecules/Tabs/Tabs.cjs +42 -22
- package/molecules/Tabs/Tabs.d.ts +28 -90
- package/molecules/Tabs/Tabs.js +123 -1
- package/molecules/Tabs/index.cjs +20 -0
- package/molecules/Tabs/index.d.ts +1 -0
- package/molecules/Tabs/index.js +1 -0
- package/molecules/index.cjs +7 -24
- package/molecules/index.d.ts +9 -10
- package/molecules/index.js +9 -1
- package/organisms/Frame/Frame.cjs +20 -43
- package/organisms/Frame/Frame.d.ts +21 -98
- package/organisms/Frame/Frame.js +161 -1
- package/organisms/Frame/FrameAnchor.cjs +2 -2
- package/organisms/Frame/FrameAnchor.d.ts +7 -16
- package/organisms/Frame/FrameAnchor.js +18 -1
- package/organisms/Frame/FrameForm.cjs +2 -2
- package/organisms/Frame/FrameForm.d.ts +10 -16
- package/organisms/Frame/FrameForm.js +18 -1
- package/organisms/Frame/FrameTarget.cjs +15 -7
- package/organisms/Frame/FrameTarget.d.ts +17 -26
- package/organisms/Frame/FrameTarget.js +79 -1
- package/organisms/Frame/index.cjs +6 -18
- package/organisms/Frame/index.d.ts +4 -4
- package/organisms/Frame/index.js +4 -1
- package/organisms/index.cjs +1 -1
- package/organisms/index.d.ts +1 -1
- package/organisms/index.js +1 -1
- package/package.json +2 -2
- package/primitives/Draggable/Draggable.cjs +9 -6
- package/primitives/Draggable/Draggable.d.ts +10 -11
- package/primitives/Draggable/Draggable.js +33 -1
- package/primitives/Draggable/index.cjs +20 -0
- package/primitives/Draggable/index.d.ts +1 -0
- package/primitives/Draggable/index.js +1 -0
- package/primitives/Sentinel/Sentinel.cjs +2 -2
- package/primitives/Sentinel/Sentinel.d.ts +6 -5
- package/primitives/Sentinel/Sentinel.js +15 -1
- package/primitives/Sentinel/index.cjs +20 -0
- package/primitives/Sentinel/index.d.ts +1 -0
- package/primitives/Sentinel/index.js +1 -0
- package/primitives/Transition/Transition.cjs +12 -3
- package/primitives/Transition/Transition.d.ts +13 -7
- package/primitives/Transition/Transition.js +16 -1
- package/primitives/Transition/index.cjs +20 -0
- package/primitives/Transition/index.d.ts +1 -0
- package/primitives/Transition/index.js +1 -0
- package/primitives/index.cjs +5 -16
- package/primitives/index.d.ts +3 -3
- package/primitives/index.js +3 -1
|
@@ -0,0 +1,20 @@
|
|
|
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/molecules/Tabs/index.ts
|
|
17
|
+
var Tabs_exports = {};
|
|
18
|
+
module.exports = __toCommonJS(Tabs_exports);
|
|
19
|
+
__reExport(Tabs_exports, require("./Tabs.cjs"), module.exports);
|
|
20
|
+
if (module.exports.default) module.exports = module.exports.default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Tabs.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./Tabs.js";
|
package/molecules/index.cjs
CHANGED
|
@@ -1,13 +1,7 @@
|
|
|
1
|
-
var __create = Object.create;
|
|
2
1
|
var __defProp = Object.defineProperty;
|
|
3
2
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
3
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
6
4
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __export = (target, all) => {
|
|
8
|
-
for (var name in all)
|
|
9
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
-
};
|
|
11
5
|
var __copyProps = (to, from, except, desc) => {
|
|
12
6
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
7
|
for (let key of __getOwnPropNames(from))
|
|
@@ -17,29 +11,18 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
11
|
return to;
|
|
18
12
|
};
|
|
19
13
|
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
20
|
-
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));
|
|
21
14
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
22
15
|
|
|
23
|
-
// packages/ui/molecules/index.
|
|
16
|
+
// packages/ui/molecules/index.ts
|
|
24
17
|
var molecules_exports = {};
|
|
25
|
-
__export(molecules_exports, {
|
|
26
|
-
Accordion: () => import_Accordion.default,
|
|
27
|
-
AccordionItem: () => import_AccordionItem.default,
|
|
28
|
-
Modal: () => import_Modal.default,
|
|
29
|
-
ModalWithTransition: () => import_ModalWithTransition.default,
|
|
30
|
-
Panel: () => import_Panel.default,
|
|
31
|
-
Sticky: () => import_Sticky.default,
|
|
32
|
-
Tabs: () => import_Tabs.default
|
|
33
|
-
});
|
|
34
18
|
module.exports = __toCommonJS(molecules_exports);
|
|
19
|
+
__reExport(molecules_exports, require("./Accordion/Accordion.cjs"), module.exports);
|
|
20
|
+
__reExport(molecules_exports, require("./Accordion/AccordionItem.cjs"), module.exports);
|
|
35
21
|
__reExport(molecules_exports, require("./Menu/index.cjs"), module.exports);
|
|
36
22
|
__reExport(molecules_exports, require("./Slider/index.cjs"), module.exports);
|
|
23
|
+
__reExport(molecules_exports, require("./Sticky/Sticky.cjs"), module.exports);
|
|
37
24
|
__reExport(molecules_exports, require("./TableOfContent/index.cjs"), module.exports);
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
var import_ModalWithTransition = __toESM(require("./Modal/ModalWithTransition.cjs"), 1);
|
|
42
|
-
var import_Panel = __toESM(require("./Panel/Panel.cjs"), 1);
|
|
43
|
-
var import_Sticky = __toESM(require("./Sticky/Sticky.cjs"), 1);
|
|
44
|
-
var import_Tabs = __toESM(require("./Tabs/Tabs.cjs"), 1);
|
|
25
|
+
__reExport(molecules_exports, require("./Tabs/index.cjs"), module.exports);
|
|
26
|
+
__reExport(molecules_exports, require("./Modal/index.cjs"), module.exports);
|
|
27
|
+
__reExport(molecules_exports, require("./Panel/index.cjs"), module.exports);
|
|
45
28
|
if (module.exports.default) module.exports = module.exports.default;
|
package/molecules/index.d.ts
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
3
|
-
export * from
|
|
4
|
-
export
|
|
5
|
-
export
|
|
6
|
-
export
|
|
7
|
-
export
|
|
8
|
-
export
|
|
9
|
-
export
|
|
10
|
-
export { default as Tabs } from "./Tabs/Tabs.js";
|
|
1
|
+
export * from './Accordion/Accordion.js';
|
|
2
|
+
export * from './Accordion/AccordionItem.js';
|
|
3
|
+
export * from './Menu/index.js';
|
|
4
|
+
export * from './Slider/index.js';
|
|
5
|
+
export * from './Sticky/Sticky.js';
|
|
6
|
+
export * from './TableOfContent/index.js';
|
|
7
|
+
export * from './Tabs/index.js';
|
|
8
|
+
export * from './Modal/index.js';
|
|
9
|
+
export * from './Panel/index.js';
|
package/molecules/index.js
CHANGED
|
@@ -1 +1,9 @@
|
|
|
1
|
-
export*from
|
|
1
|
+
export * from "./Accordion/Accordion.js";
|
|
2
|
+
export * from "./Accordion/AccordionItem.js";
|
|
3
|
+
export * from "./Menu/index.js";
|
|
4
|
+
export * from "./Slider/index.js";
|
|
5
|
+
export * from "./Sticky/Sticky.js";
|
|
6
|
+
export * from "./TableOfContent/index.js";
|
|
7
|
+
export * from "./Tabs/index.js";
|
|
8
|
+
export * from "./Modal/index.js";
|
|
9
|
+
export * from "./Panel/index.js";
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
var __create = Object.create;
|
|
2
1
|
var __defProp = Object.defineProperty;
|
|
3
2
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
3
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
6
4
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
5
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
6
|
var __export = (target, all) => {
|
|
@@ -17,24 +15,23 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
15
|
}
|
|
18
16
|
return to;
|
|
19
17
|
};
|
|
20
|
-
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));
|
|
21
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
22
19
|
var __publicField = (obj, key, value) => {
|
|
23
20
|
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
24
21
|
return value;
|
|
25
22
|
};
|
|
26
23
|
|
|
27
|
-
// packages/ui/organisms/Frame/Frame.
|
|
24
|
+
// packages/ui/organisms/Frame/Frame.ts
|
|
28
25
|
var Frame_exports = {};
|
|
29
26
|
__export(Frame_exports, {
|
|
30
|
-
|
|
27
|
+
Frame: () => Frame
|
|
31
28
|
});
|
|
32
29
|
module.exports = __toCommonJS(Frame_exports);
|
|
33
30
|
var import_js_toolkit = require("@studiometa/js-toolkit");
|
|
34
31
|
var import_utils = require("@studiometa/js-toolkit/utils");
|
|
35
|
-
var import_FrameAnchor =
|
|
36
|
-
var import_FrameForm =
|
|
37
|
-
var import_FrameTarget =
|
|
32
|
+
var import_FrameAnchor = require("./FrameAnchor.cjs");
|
|
33
|
+
var import_FrameForm = require("./FrameForm.cjs");
|
|
34
|
+
var import_FrameTarget = require("./FrameTarget.cjs");
|
|
38
35
|
function getScrollPosition() {
|
|
39
36
|
return {
|
|
40
37
|
left: window.pageXOffset,
|
|
@@ -46,43 +43,21 @@ var _Frame = class extends import_js_toolkit.Base {
|
|
|
46
43
|
get id() {
|
|
47
44
|
return this.$el.id;
|
|
48
45
|
}
|
|
49
|
-
getDirectChild(name) {
|
|
50
|
-
if (!this.$children[name]) {
|
|
51
|
-
return [];
|
|
52
|
-
}
|
|
53
|
-
if (!this.$children.Frame) {
|
|
54
|
-
return this.$children[name];
|
|
55
|
-
}
|
|
56
|
-
return this.$children[name].filter((child) => this.$children.Frame.every((frame) => frame.$children[name] ? !frame.$children[name].includes(child) : true));
|
|
57
|
-
}
|
|
58
46
|
get directChildrenFrameTarget() {
|
|
59
47
|
return (0, import_js_toolkit.getDirectChildren)(this, "Frame", "FrameTarget");
|
|
60
48
|
}
|
|
61
|
-
mounted() {
|
|
62
|
-
if (this.$options.history) {
|
|
63
|
-
window.addEventListener("popstate", this);
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
destroyed() {
|
|
67
|
-
window.removeEventListener("popstate", this);
|
|
68
|
-
}
|
|
69
|
-
handleEvent(event) {
|
|
70
|
-
if (event.type === "popstate") {
|
|
71
|
-
this.onWindowPopstate(event);
|
|
72
|
-
}
|
|
73
|
-
if (event.type === "beforeunload") {
|
|
74
|
-
this.onWindowUnload();
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
49
|
onWindowUnload() {
|
|
78
50
|
const { history } = window;
|
|
79
51
|
if (!history.state) {
|
|
80
52
|
return;
|
|
81
53
|
}
|
|
82
|
-
history.replaceState(
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
54
|
+
history.replaceState(
|
|
55
|
+
{
|
|
56
|
+
...history.state,
|
|
57
|
+
scroll: getScrollPosition()
|
|
58
|
+
},
|
|
59
|
+
""
|
|
60
|
+
);
|
|
86
61
|
}
|
|
87
62
|
onWindowPopstate(event) {
|
|
88
63
|
this.goTo(window.location.href, event.state);
|
|
@@ -130,7 +105,9 @@ var _Frame = class extends import_js_toolkit.Base {
|
|
|
130
105
|
await Promise.all(this.directChildrenFrameTarget.map((target) => target.leave()));
|
|
131
106
|
this.$emit("after-leave");
|
|
132
107
|
this.$emit("before-content");
|
|
133
|
-
this.directChildrenFrameTarget.map(
|
|
108
|
+
this.directChildrenFrameTarget.map(
|
|
109
|
+
(target, index) => target.updateContent(newFrame.directChildrenFrameTarget[index])
|
|
110
|
+
);
|
|
134
111
|
if (this.$options.history) {
|
|
135
112
|
document.title = doc.title;
|
|
136
113
|
(0, import_utils.historyPush)({ path: parsedUrl.pathname, search: parsedUrl.searchParams });
|
|
@@ -155,14 +132,14 @@ var _Frame = class extends import_js_toolkit.Base {
|
|
|
155
132
|
}
|
|
156
133
|
return cached.content;
|
|
157
134
|
}
|
|
158
|
-
const promise = fetch(url);
|
|
135
|
+
const promise = fetch(url).then((response) => response.text());
|
|
159
136
|
try {
|
|
160
137
|
cache.set(url, {
|
|
161
138
|
promise,
|
|
162
139
|
status: "pending",
|
|
163
140
|
content: void 0
|
|
164
141
|
});
|
|
165
|
-
const content = await promise
|
|
142
|
+
const content = await promise;
|
|
166
143
|
cache.set(url, {
|
|
167
144
|
promise,
|
|
168
145
|
status: "resolved",
|
|
@@ -193,9 +170,9 @@ __publicField(Frame, "config", {
|
|
|
193
170
|
"after-enter"
|
|
194
171
|
],
|
|
195
172
|
components: {
|
|
196
|
-
FrameAnchor: import_FrameAnchor.
|
|
197
|
-
FrameForm: import_FrameForm.
|
|
198
|
-
FrameTarget: import_FrameTarget.
|
|
173
|
+
FrameAnchor: import_FrameAnchor.FrameAnchor,
|
|
174
|
+
FrameForm: import_FrameForm.FrameForm,
|
|
175
|
+
FrameTarget: import_FrameTarget.FrameTarget,
|
|
199
176
|
Frame: _Frame
|
|
200
177
|
},
|
|
201
178
|
options: {
|
|
@@ -1,141 +1,64 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
1
|
+
import { Base } from '@studiometa/js-toolkit';
|
|
2
|
+
import type { BaseProps, BaseConfig } from '@studiometa/js-toolkit';
|
|
3
|
+
import { FrameAnchor } from './FrameAnchor.js';
|
|
4
|
+
import { FrameForm } from './FrameForm.js';
|
|
5
|
+
import { FrameTarget } from './FrameTarget.js';
|
|
6
|
+
export interface FrameProps extends BaseProps {
|
|
7
|
+
$children: {
|
|
8
|
+
FrameAnchor: FrameAnchor[];
|
|
9
|
+
FrameForm: FrameForm[];
|
|
10
|
+
FrameTarget: FrameTarget[];
|
|
11
|
+
Frame: Frame[];
|
|
12
|
+
};
|
|
13
|
+
$options: {
|
|
14
|
+
history: boolean;
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
17
|
/**
|
|
18
18
|
* Class.
|
|
19
19
|
*/
|
|
20
|
-
export
|
|
20
|
+
export declare class Frame<T extends BaseProps = BaseProps> extends Base<T & FrameProps> {
|
|
21
21
|
/**
|
|
22
22
|
* Config.
|
|
23
23
|
*/
|
|
24
|
-
static config:
|
|
25
|
-
name: string;
|
|
26
|
-
emits: string[];
|
|
27
|
-
components: {
|
|
28
|
-
FrameAnchor: typeof FrameAnchor;
|
|
29
|
-
FrameForm: typeof FrameForm;
|
|
30
|
-
FrameTarget: typeof FrameTarget;
|
|
31
|
-
Frame: typeof Frame;
|
|
32
|
-
};
|
|
33
|
-
options: {
|
|
34
|
-
history: BooleanConstructor;
|
|
35
|
-
};
|
|
36
|
-
};
|
|
24
|
+
static config: BaseConfig;
|
|
37
25
|
/**
|
|
38
26
|
* Get uniq id.
|
|
39
|
-
* @returns {string}
|
|
40
27
|
*/
|
|
41
28
|
get id(): string;
|
|
42
|
-
/**
|
|
43
|
-
* Get direct children.
|
|
44
|
-
*
|
|
45
|
-
* @this {FrameInterface}
|
|
46
|
-
* @param {string} name
|
|
47
|
-
* @returns {any[]}
|
|
48
|
-
*/
|
|
49
|
-
getDirectChild(this: FrameInterface, name: string): any[];
|
|
50
29
|
/**
|
|
51
30
|
* Get direct `FrameTarget` children.
|
|
52
|
-
* @returns {FrameTarget[]}
|
|
53
31
|
*/
|
|
54
32
|
get directChildrenFrameTarget(): FrameTarget[];
|
|
55
|
-
/**
|
|
56
|
-
* Mounted hook.
|
|
57
|
-
* @returns {void}
|
|
58
|
-
*/
|
|
59
|
-
mounted(): void;
|
|
60
|
-
/**
|
|
61
|
-
* Destroyed hook.
|
|
62
|
-
* @returns {void}
|
|
63
|
-
*/
|
|
64
|
-
destroyed(): void;
|
|
65
|
-
/**
|
|
66
|
-
* Dispatch events.
|
|
67
|
-
* @param {PopStateEvent} event
|
|
68
|
-
* @returns {void}
|
|
69
|
-
*/
|
|
70
|
-
handleEvent(event: PopStateEvent): void;
|
|
71
33
|
/**
|
|
72
34
|
* Prevent scroll top on unload.
|
|
73
|
-
*
|
|
74
|
-
* @returns {void}
|
|
75
35
|
*/
|
|
76
36
|
onWindowUnload(): void;
|
|
77
37
|
/**
|
|
78
38
|
* Go to the previous URL on `popstate` event.
|
|
79
|
-
*
|
|
80
|
-
* @param {PopStateEvent} event
|
|
81
|
-
* @returns {void}
|
|
82
39
|
*/
|
|
83
40
|
onWindowPopstate(event: PopStateEvent): void;
|
|
84
41
|
/**
|
|
85
42
|
* Prevent click on `FrameAnchor`.
|
|
86
|
-
*
|
|
87
|
-
* @this {FrameInterface}
|
|
88
|
-
* @param {number} index
|
|
89
|
-
* @param {MouseEvent} event
|
|
90
|
-
* @returns {void}
|
|
91
43
|
*/
|
|
92
|
-
onFrameAnchorClick(
|
|
44
|
+
onFrameAnchorClick(index: number, event: MouseEvent): void;
|
|
93
45
|
/**
|
|
94
46
|
* Prevent submit on forms.
|
|
95
|
-
*
|
|
96
|
-
* @this {FrameInterface}
|
|
97
|
-
* @param {number} index
|
|
98
|
-
* @param {SubmitEvent} event
|
|
99
|
-
* @returns {void}
|
|
100
47
|
*/
|
|
101
|
-
onFrameFormSubmit(
|
|
48
|
+
onFrameFormSubmit(index: number, event: SubmitEvent): void;
|
|
102
49
|
/**
|
|
103
50
|
* Parge an HTML string into a DOM object.
|
|
104
|
-
* @param {string} string
|
|
105
|
-
* @returns {Document}
|
|
106
51
|
*/
|
|
107
52
|
parseHTML(string?: string): Document;
|
|
108
53
|
/**
|
|
109
54
|
* Go to the given url.
|
|
110
|
-
* @param {string} url
|
|
111
|
-
* @param {null|{ top: number, left: number }} [scroll]
|
|
112
|
-
* @returns {Promise<void>}
|
|
113
55
|
*/
|
|
114
|
-
goTo(url: string, scroll?:
|
|
56
|
+
goTo(url: string, scroll?: {
|
|
115
57
|
top: number;
|
|
116
58
|
left: number;
|
|
117
59
|
}): Promise<void>;
|
|
118
60
|
/**
|
|
119
61
|
* Fetch the given url.
|
|
120
|
-
* @param {string} url
|
|
121
|
-
* @returns {Promise<string>}
|
|
122
62
|
*/
|
|
123
63
|
fetch(url: string): Promise<string>;
|
|
124
64
|
}
|
|
125
|
-
export type FrameOptions = {
|
|
126
|
-
history: boolean;
|
|
127
|
-
position: 'replace' | 'prepend' | 'append';
|
|
128
|
-
target: string;
|
|
129
|
-
};
|
|
130
|
-
export type FrameInterface = Frame & {
|
|
131
|
-
$children: {
|
|
132
|
-
FrameAnchor: FrameAnchor[];
|
|
133
|
-
FrameForm: FrameForm[];
|
|
134
|
-
FrameTarget: FrameTarget[];
|
|
135
|
-
Frame: Frame[];
|
|
136
|
-
};
|
|
137
|
-
};
|
|
138
|
-
import { Base } from "@studiometa/js-toolkit";
|
|
139
|
-
import FrameTarget from "./FrameTarget.js";
|
|
140
|
-
import FrameAnchor from "./FrameAnchor.js";
|
|
141
|
-
import FrameForm from "./FrameForm.js";
|
package/organisms/Frame/Frame.js
CHANGED
|
@@ -1 +1,161 @@
|
|
|
1
|
-
|
|
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, isDirectChild, getDirectChildren } from "@studiometa/js-toolkit";
|
|
8
|
+
import { nextFrame, historyPush } from "@studiometa/js-toolkit/utils";
|
|
9
|
+
import { FrameAnchor } from "./FrameAnchor.js";
|
|
10
|
+
import { FrameForm } from "./FrameForm.js";
|
|
11
|
+
import { FrameTarget } from "./FrameTarget.js";
|
|
12
|
+
function getScrollPosition() {
|
|
13
|
+
return {
|
|
14
|
+
left: window.pageXOffset,
|
|
15
|
+
top: window.pageYOffset
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
const cache = /* @__PURE__ */ new Map();
|
|
19
|
+
const _Frame = class extends Base {
|
|
20
|
+
get id() {
|
|
21
|
+
return this.$el.id;
|
|
22
|
+
}
|
|
23
|
+
get directChildrenFrameTarget() {
|
|
24
|
+
return getDirectChildren(this, "Frame", "FrameTarget");
|
|
25
|
+
}
|
|
26
|
+
onWindowUnload() {
|
|
27
|
+
const { history } = window;
|
|
28
|
+
if (!history.state) {
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
history.replaceState(
|
|
32
|
+
{
|
|
33
|
+
...history.state,
|
|
34
|
+
scroll: getScrollPosition()
|
|
35
|
+
},
|
|
36
|
+
""
|
|
37
|
+
);
|
|
38
|
+
}
|
|
39
|
+
onWindowPopstate(event) {
|
|
40
|
+
this.goTo(window.location.href, event.state);
|
|
41
|
+
}
|
|
42
|
+
onFrameAnchorClick(index, event) {
|
|
43
|
+
if (!isDirectChild(this, "Frame", "FrameAnchor", this.$children.FrameAnchor[index])) {
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
this.$log("onAFrameClick", index, event);
|
|
47
|
+
event.preventDefault();
|
|
48
|
+
const anchor = this.$children.FrameAnchor[index];
|
|
49
|
+
if (anchor.href === window.location.href) {
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
this.goTo(anchor.href);
|
|
53
|
+
}
|
|
54
|
+
onFrameFormSubmit(index, event) {
|
|
55
|
+
if (!isDirectChild(this, "Frame", "FrameForm", this.$children.FrameForm[index])) {
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
this.$log("onFrameFormFrameSubmit", index, event);
|
|
59
|
+
event.preventDefault();
|
|
60
|
+
const form = this.$children.FrameForm[index];
|
|
61
|
+
const url = new URL(form.action);
|
|
62
|
+
url.search = new URLSearchParams(new FormData(form.$el)).toString();
|
|
63
|
+
this.goTo(url.toString());
|
|
64
|
+
}
|
|
65
|
+
parseHTML(string = "") {
|
|
66
|
+
return new DOMParser().parseFromString(string, "text/html");
|
|
67
|
+
}
|
|
68
|
+
async goTo(url, scroll = null) {
|
|
69
|
+
this.$log("goTo", url);
|
|
70
|
+
const parsedUrl = new URL(url);
|
|
71
|
+
if (parsedUrl.origin !== window.location.origin) {
|
|
72
|
+
throw new Error("Cross origin request are not allowed.");
|
|
73
|
+
}
|
|
74
|
+
this.$emit("before-fetch", url);
|
|
75
|
+
const content = await this.fetch(url);
|
|
76
|
+
const doc = this.parseHTML(content);
|
|
77
|
+
const el = doc.querySelector(`#${this.id}`);
|
|
78
|
+
const newFrame = new _Frame(el);
|
|
79
|
+
newFrame.$children.registerAll();
|
|
80
|
+
this.$emit("after-fetch", url, content);
|
|
81
|
+
this.$emit("before-leave");
|
|
82
|
+
await Promise.all(this.directChildrenFrameTarget.map((target) => target.leave()));
|
|
83
|
+
this.$emit("after-leave");
|
|
84
|
+
this.$emit("before-content");
|
|
85
|
+
this.directChildrenFrameTarget.map(
|
|
86
|
+
(target, index) => target.updateContent(newFrame.directChildrenFrameTarget[index])
|
|
87
|
+
);
|
|
88
|
+
if (this.$options.history) {
|
|
89
|
+
document.title = doc.title;
|
|
90
|
+
historyPush({ path: parsedUrl.pathname, search: parsedUrl.searchParams });
|
|
91
|
+
}
|
|
92
|
+
if (scroll) {
|
|
93
|
+
document.scrollingElement.scrollTop = scroll.top;
|
|
94
|
+
document.scrollingElement.scrollLeft = scroll.left;
|
|
95
|
+
}
|
|
96
|
+
await nextFrame();
|
|
97
|
+
this.$root.$update();
|
|
98
|
+
await nextFrame();
|
|
99
|
+
this.$emit("after-content");
|
|
100
|
+
this.$emit("before-enter");
|
|
101
|
+
await Promise.all(this.directChildrenFrameTarget.map((target) => target.enter()));
|
|
102
|
+
this.$emit("after-enter");
|
|
103
|
+
}
|
|
104
|
+
async fetch(url) {
|
|
105
|
+
const cached = cache.get(url);
|
|
106
|
+
if (cached) {
|
|
107
|
+
if (cached.status === "pending") {
|
|
108
|
+
return cached.promise;
|
|
109
|
+
}
|
|
110
|
+
return cached.content;
|
|
111
|
+
}
|
|
112
|
+
const promise = fetch(url).then((response) => response.text());
|
|
113
|
+
try {
|
|
114
|
+
cache.set(url, {
|
|
115
|
+
promise,
|
|
116
|
+
status: "pending",
|
|
117
|
+
content: void 0
|
|
118
|
+
});
|
|
119
|
+
const content = await promise;
|
|
120
|
+
cache.set(url, {
|
|
121
|
+
promise,
|
|
122
|
+
status: "resolved",
|
|
123
|
+
content
|
|
124
|
+
});
|
|
125
|
+
return content;
|
|
126
|
+
} catch (err) {
|
|
127
|
+
cache.set(url, {
|
|
128
|
+
promise,
|
|
129
|
+
status: "error",
|
|
130
|
+
content: err
|
|
131
|
+
});
|
|
132
|
+
return err;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
};
|
|
136
|
+
let Frame = _Frame;
|
|
137
|
+
__publicField(Frame, "config", {
|
|
138
|
+
name: "Frame",
|
|
139
|
+
emits: [
|
|
140
|
+
"before-fetch",
|
|
141
|
+
"after-fetch",
|
|
142
|
+
"before-leave",
|
|
143
|
+
"after-leave",
|
|
144
|
+
"before-content",
|
|
145
|
+
"after-content",
|
|
146
|
+
"before-enter",
|
|
147
|
+
"after-enter"
|
|
148
|
+
],
|
|
149
|
+
components: {
|
|
150
|
+
FrameAnchor,
|
|
151
|
+
FrameForm,
|
|
152
|
+
FrameTarget,
|
|
153
|
+
Frame: _Frame
|
|
154
|
+
},
|
|
155
|
+
options: {
|
|
156
|
+
history: Boolean
|
|
157
|
+
}
|
|
158
|
+
});
|
|
159
|
+
export {
|
|
160
|
+
Frame
|
|
161
|
+
};
|
|
@@ -21,10 +21,10 @@ var __publicField = (obj, key, value) => {
|
|
|
21
21
|
return value;
|
|
22
22
|
};
|
|
23
23
|
|
|
24
|
-
// packages/ui/organisms/Frame/FrameAnchor.
|
|
24
|
+
// packages/ui/organisms/Frame/FrameAnchor.ts
|
|
25
25
|
var FrameAnchor_exports = {};
|
|
26
26
|
__export(FrameAnchor_exports, {
|
|
27
|
-
|
|
27
|
+
FrameAnchor: () => FrameAnchor
|
|
28
28
|
});
|
|
29
29
|
module.exports = __toCommonJS(FrameAnchor_exports);
|
|
30
30
|
var import_js_toolkit = require("@studiometa/js-toolkit");
|
|
@@ -1,27 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { Base } from '@studiometa/js-toolkit';
|
|
2
|
+
import type { BaseConfig, BaseProps } from '@studiometa/js-toolkit';
|
|
3
|
+
export interface FrameAnchorProps extends BaseProps {
|
|
4
|
+
$el: HTMLAnchorElement;
|
|
5
|
+
}
|
|
6
6
|
/**
|
|
7
7
|
* FrameAnchor class.
|
|
8
8
|
*/
|
|
9
|
-
export
|
|
9
|
+
export declare class FrameAnchor<T extends BaseProps = BaseProps> extends Base<T & FrameAnchorProps> {
|
|
10
10
|
/**
|
|
11
11
|
* Config.
|
|
12
12
|
*/
|
|
13
|
-
static config:
|
|
14
|
-
name: string;
|
|
15
|
-
};
|
|
13
|
+
static config: BaseConfig;
|
|
16
14
|
/**
|
|
17
15
|
* Get the URL.
|
|
18
|
-
*
|
|
19
|
-
* @this {FrameAnchorInterface}
|
|
20
|
-
* @returns {string}
|
|
21
16
|
*/
|
|
22
17
|
get href(): string;
|
|
23
18
|
}
|
|
24
|
-
export type FrameAnchorInterface = FrameAnchor & {
|
|
25
|
-
$el: HTMLAnchorElement;
|
|
26
|
-
};
|
|
27
|
-
import { Base } from "@studiometa/js-toolkit";
|
|
@@ -1 +1,18 @@
|
|
|
1
|
-
|
|
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 FrameAnchor extends Base {
|
|
9
|
+
get href() {
|
|
10
|
+
return this.$el.href;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
__publicField(FrameAnchor, "config", {
|
|
14
|
+
name: "FrameAnchor"
|
|
15
|
+
});
|
|
16
|
+
export {
|
|
17
|
+
FrameAnchor
|
|
18
|
+
};
|
|
@@ -21,10 +21,10 @@ var __publicField = (obj, key, value) => {
|
|
|
21
21
|
return value;
|
|
22
22
|
};
|
|
23
23
|
|
|
24
|
-
// packages/ui/organisms/Frame/FrameForm.
|
|
24
|
+
// packages/ui/organisms/Frame/FrameForm.ts
|
|
25
25
|
var FrameForm_exports = {};
|
|
26
26
|
__export(FrameForm_exports, {
|
|
27
|
-
|
|
27
|
+
FrameForm: () => FrameForm
|
|
28
28
|
});
|
|
29
29
|
module.exports = __toCommonJS(FrameForm_exports);
|
|
30
30
|
var import_js_toolkit = require("@studiometa/js-toolkit");
|