@studiometa/ui 0.2.47 → 0.2.48
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/FigureVideo/FigureVideo.cjs +132 -0
- package/atoms/FigureVideo/FigureVideo.cjs.map +7 -0
- package/atoms/FigureVideo/FigureVideo.d.ts +51 -0
- package/atoms/FigureVideo/FigureVideo.js +110 -0
- package/atoms/FigureVideo/FigureVideo.js.map +7 -0
- package/atoms/FigureVideo/FigureVideo.twig +152 -0
- package/atoms/FigureVideo/FigureVideoTwicpics.cjs +153 -0
- package/atoms/FigureVideo/FigureVideoTwicpics.cjs.map +7 -0
- package/atoms/FigureVideo/FigureVideoTwicpics.d.ts +57 -0
- package/atoms/FigureVideo/FigureVideoTwicpics.js +135 -0
- package/atoms/FigureVideo/FigureVideoTwicpics.js.map +7 -0
- package/atoms/FigureVideo/FigureVideoTwicpics.twig +98 -0
- package/atoms/FigureVideo/index.cjs +22 -0
- package/atoms/FigureVideo/index.cjs.map +7 -0
- package/atoms/FigureVideo/index.d.ts +2 -0
- package/atoms/FigureVideo/index.js +3 -0
- package/atoms/FigureVideo/index.js.map +7 -0
- package/atoms/index.cjs +1 -0
- package/atoms/index.cjs.map +2 -2
- package/atoms/index.d.ts +1 -0
- package/atoms/index.js +1 -0
- package/atoms/index.js.map +2 -2
- package/molecules/AnchorNav/AnchorNav.cjs +63 -0
- package/molecules/AnchorNav/AnchorNav.cjs.map +7 -0
- package/molecules/AnchorNav/AnchorNav.d.ts +24 -0
- package/molecules/AnchorNav/AnchorNav.js +41 -0
- package/molecules/AnchorNav/AnchorNav.js.map +7 -0
- package/molecules/AnchorNav/AnchorNavLink.cjs +40 -0
- package/molecules/AnchorNav/AnchorNavLink.cjs.map +7 -0
- package/molecules/AnchorNav/AnchorNavLink.d.ts +19 -0
- package/molecules/AnchorNav/AnchorNavLink.js +18 -0
- package/molecules/AnchorNav/AnchorNavLink.js.map +7 -0
- package/molecules/AnchorNav/AnchorNavTarget.cjs +35 -0
- package/molecules/AnchorNav/AnchorNavTarget.cjs.map +7 -0
- package/molecules/AnchorNav/AnchorNavTarget.d.ts +13 -0
- package/molecules/AnchorNav/AnchorNavTarget.js +13 -0
- package/molecules/AnchorNav/AnchorNavTarget.js.map +7 -0
- package/molecules/AnchorNav/index.cjs +23 -0
- package/molecules/AnchorNav/index.cjs.map +7 -0
- package/molecules/AnchorNav/index.d.ts +3 -0
- package/molecules/AnchorNav/index.js +4 -0
- package/molecules/AnchorNav/index.js.map +7 -0
- package/molecules/index.cjs +1 -0
- package/molecules/index.cjs.map +2 -2
- package/molecules/index.d.ts +1 -0
- package/molecules/index.js +1 -0
- package/molecules/index.js.map +2 -2
- package/organisms/Frame/Frame.cjs +20 -7
- package/organisms/Frame/Frame.cjs.map +3 -3
- package/organisms/Frame/Frame.d.ts +2 -2
- package/organisms/Frame/Frame.js +20 -7
- package/organisms/Frame/Frame.js.map +3 -3
- package/package.json +1 -1
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import type { BaseConfig, BaseProps } from '@studiometa/js-toolkit';
|
|
2
|
+
import { FigureVideo } from './FigureVideo.js';
|
|
3
|
+
export interface FigureVideoTwicpicsProps extends BaseProps {
|
|
4
|
+
$refs: {
|
|
5
|
+
video: HTMLVideoElement;
|
|
6
|
+
};
|
|
7
|
+
$options: {
|
|
8
|
+
lazy: boolean;
|
|
9
|
+
transform: string;
|
|
10
|
+
domain: string;
|
|
11
|
+
path: string;
|
|
12
|
+
step: number;
|
|
13
|
+
mode: string;
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* FigureVideo class.
|
|
18
|
+
*
|
|
19
|
+
* Manager lazyloading image sources.
|
|
20
|
+
*/
|
|
21
|
+
export declare class FigureVideoTwicpics<T extends BaseProps = BaseProps> extends FigureVideo<T & FigureVideoTwicpicsProps> {
|
|
22
|
+
/**
|
|
23
|
+
* Config.
|
|
24
|
+
*/
|
|
25
|
+
static config: BaseConfig;
|
|
26
|
+
/**
|
|
27
|
+
* Get the Twicpics path.
|
|
28
|
+
*/
|
|
29
|
+
get path(): string;
|
|
30
|
+
/**
|
|
31
|
+
* Get the Twicpics domain.
|
|
32
|
+
*/
|
|
33
|
+
get domain(): string;
|
|
34
|
+
/**
|
|
35
|
+
* Format the source for Twicpics.
|
|
36
|
+
* @param {string} src
|
|
37
|
+
* @param {Array} options
|
|
38
|
+
* @returns {string}
|
|
39
|
+
*/
|
|
40
|
+
formatSrc(src: string, options?: Array<string>): string;
|
|
41
|
+
/**
|
|
42
|
+
* Load poster
|
|
43
|
+
*/
|
|
44
|
+
loadPoster(): Promise<void | HTMLImageElement>;
|
|
45
|
+
/**
|
|
46
|
+
* Load sources
|
|
47
|
+
*/
|
|
48
|
+
loadSources(): Promise<void>;
|
|
49
|
+
/**
|
|
50
|
+
* Reassign the source from the original on resize.
|
|
51
|
+
*/
|
|
52
|
+
resized(): Promise<void>;
|
|
53
|
+
/**
|
|
54
|
+
* Do not terminate on image load as we need to set the src on resize.
|
|
55
|
+
*/
|
|
56
|
+
onLoad(): void;
|
|
57
|
+
}
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import {
|
|
2
|
+
withLeadingSlash,
|
|
3
|
+
withoutLeadingSlash,
|
|
4
|
+
withoutTrailingSlash
|
|
5
|
+
} from "@studiometa/js-toolkit/utils";
|
|
6
|
+
import { loadImage } from "../index.js";
|
|
7
|
+
import { FigureVideo } from "./FigureVideo.js";
|
|
8
|
+
function normalizeSize(that, prop) {
|
|
9
|
+
const { step } = that.$options;
|
|
10
|
+
return Math.ceil(that.$refs.video[prop] / step) * step;
|
|
11
|
+
}
|
|
12
|
+
class FigureVideoTwicpics extends FigureVideo {
|
|
13
|
+
/**
|
|
14
|
+
* Config.
|
|
15
|
+
*/
|
|
16
|
+
static config = {
|
|
17
|
+
...FigureVideo.config,
|
|
18
|
+
name: "FigureVideoTwicpics",
|
|
19
|
+
options: {
|
|
20
|
+
...FigureVideo.config.options,
|
|
21
|
+
transform: String,
|
|
22
|
+
domain: String,
|
|
23
|
+
path: String,
|
|
24
|
+
step: {
|
|
25
|
+
type: Number,
|
|
26
|
+
default: 50
|
|
27
|
+
},
|
|
28
|
+
mode: {
|
|
29
|
+
type: String,
|
|
30
|
+
default: "cover"
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* Get the Twicpics path.
|
|
36
|
+
*/
|
|
37
|
+
get path() {
|
|
38
|
+
return withoutTrailingSlash(withoutLeadingSlash(this.$options.path));
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Get the Twicpics domain.
|
|
42
|
+
*/
|
|
43
|
+
get domain() {
|
|
44
|
+
if (this.$options.domain) {
|
|
45
|
+
return this.$options.domain;
|
|
46
|
+
}
|
|
47
|
+
const url = new URL(this.sources[0].dataset.src);
|
|
48
|
+
return url.host;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Format the source for Twicpics.
|
|
52
|
+
* @param {string} src
|
|
53
|
+
* @param {Array} options
|
|
54
|
+
* @returns {string}
|
|
55
|
+
*/
|
|
56
|
+
formatSrc(src, options = []) {
|
|
57
|
+
const url = new URL(src, "https://localhost");
|
|
58
|
+
url.host = this.domain;
|
|
59
|
+
url.port = "";
|
|
60
|
+
if (this.path && !url.pathname.startsWith(withLeadingSlash(this.path))) {
|
|
61
|
+
url.pathname = `/${this.path}${url.pathname}`;
|
|
62
|
+
}
|
|
63
|
+
const width = normalizeSize(this, "offsetWidth");
|
|
64
|
+
const height = normalizeSize(this, "offsetHeight");
|
|
65
|
+
this.$log(this.$options.mode, width, height);
|
|
66
|
+
url.searchParams.set(
|
|
67
|
+
"twic",
|
|
68
|
+
["v1", this.$options.transform, `${this.$options.mode}=${width}x${height}`, ...options].filter(Boolean).join("/")
|
|
69
|
+
);
|
|
70
|
+
url.search = decodeURIComponent(url.search);
|
|
71
|
+
return url.toString();
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Load poster
|
|
75
|
+
*/
|
|
76
|
+
loadPoster() {
|
|
77
|
+
const { video } = this.$refs;
|
|
78
|
+
if (!video.dataset.poster) {
|
|
79
|
+
return Promise.resolve();
|
|
80
|
+
}
|
|
81
|
+
const twicPoster = this.formatSrc(video.dataset.poster);
|
|
82
|
+
return loadImage(twicPoster).then(() => {
|
|
83
|
+
video.poster = twicPoster;
|
|
84
|
+
this.$log("fresh poster loaded");
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Load sources
|
|
89
|
+
*/
|
|
90
|
+
loadSources() {
|
|
91
|
+
const { video } = this.$refs;
|
|
92
|
+
this.sources.forEach((source) => {
|
|
93
|
+
if (!source.dataset.src) {
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
source.src = this.formatSrc(
|
|
97
|
+
source.dataset.src,
|
|
98
|
+
source.dataset.output ? [`output=${source.dataset.output}`] : []
|
|
99
|
+
);
|
|
100
|
+
});
|
|
101
|
+
return new Promise((resolve) => {
|
|
102
|
+
const loadHandler = () => {
|
|
103
|
+
resolve();
|
|
104
|
+
video.removeEventListener("canplaythrough", loadHandler);
|
|
105
|
+
this.$log("fresh sources loaded");
|
|
106
|
+
};
|
|
107
|
+
video.addEventListener("canplaythrough", loadHandler);
|
|
108
|
+
this.$refs.video.width = normalizeSize(this, "offsetWidth");
|
|
109
|
+
this.$refs.video.height = normalizeSize(this, "offsetHeight");
|
|
110
|
+
video.load();
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Reassign the source from the original on resize.
|
|
115
|
+
*/
|
|
116
|
+
async resized() {
|
|
117
|
+
const width = normalizeSize(this, "offsetWidth");
|
|
118
|
+
const height = normalizeSize(this, "offsetHeight");
|
|
119
|
+
if (width === this.$refs.video.width && height === this.$refs.video.height) {
|
|
120
|
+
return;
|
|
121
|
+
}
|
|
122
|
+
this.$refs.video.width = width;
|
|
123
|
+
this.$refs.video.height = height;
|
|
124
|
+
await this.load();
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Do not terminate on image load as we need to set the src on resize.
|
|
128
|
+
*/
|
|
129
|
+
onLoad() {
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
export {
|
|
133
|
+
FigureVideoTwicpics
|
|
134
|
+
};
|
|
135
|
+
//# sourceMappingURL=FigureVideoTwicpics.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../packages/ui/atoms/FigureVideo/FigureVideoTwicpics.ts"],
|
|
4
|
+
"sourcesContent": ["import type { BaseConfig, BaseProps } from '@studiometa/js-toolkit';\nimport {\n withLeadingSlash,\n withoutLeadingSlash,\n withoutTrailingSlash,\n} from '@studiometa/js-toolkit/utils';\nimport { loadImage } from '../index.js';\nimport { FigureVideo } from './FigureVideo.js';\n\nexport interface FigureVideoTwicpicsProps extends BaseProps {\n $refs: {\n video: HTMLVideoElement;\n };\n $options: {\n lazy: boolean;\n transform: string;\n domain: string;\n path: string;\n step: number;\n mode: string;\n };\n}\n\n/**\n * Normalize the given size to the step option.\n */\n// eslint-disable-next-line no-use-before-define\nfunction normalizeSize(that: FigureVideoTwicpics, prop: string): number {\n const { step } = that.$options;\n return Math.ceil(that.$refs.video[prop] / step) * step;\n}\n\n/**\n * FigureVideo class.\n *\n * Manager lazyloading image sources.\n */\nexport class FigureVideoTwicpics<T extends BaseProps = BaseProps> extends FigureVideo<\n T & FigureVideoTwicpicsProps\n> {\n /**\n * Config.\n */\n static config: BaseConfig = {\n ...FigureVideo.config,\n name: 'FigureVideoTwicpics',\n options: {\n ...FigureVideo.config.options,\n transform: String,\n domain: String,\n path: String,\n step: {\n type: Number,\n default: 50,\n },\n mode: {\n type: String,\n default: 'cover',\n },\n },\n };\n\n /**\n * Get the Twicpics path.\n */\n get path(): string {\n return withoutTrailingSlash(withoutLeadingSlash(this.$options.path));\n }\n\n /**\n * Get the Twicpics domain.\n */\n get domain(): string {\n if (this.$options.domain) {\n return this.$options.domain;\n }\n const url = new URL(this.sources[0].dataset.src);\n return url.host;\n }\n\n /**\n * Format the source for Twicpics.\n * @param {string} src\n * @param {Array} options\n * @returns {string}\n */\n formatSrc(src: string, options: Array<string> = []): string {\n const url = new URL(src, 'https://localhost');\n url.host = this.domain;\n url.port = '';\n\n if (this.path && !url.pathname.startsWith(withLeadingSlash(this.path))) {\n url.pathname = `/${this.path}${url.pathname}`;\n }\n\n const width = normalizeSize(this, 'offsetWidth');\n const height = normalizeSize(this, 'offsetHeight');\n\n this.$log(this.$options.mode, width, height);\n\n url.searchParams.set(\n 'twic',\n ['v1', this.$options.transform, `${this.$options.mode}=${width}x${height}`, ...options]\n .filter(Boolean)\n .join('/'),\n );\n\n url.search = decodeURIComponent(url.search);\n\n return url.toString();\n }\n\n /**\n * Load poster\n */\n loadPoster(): Promise<void|HTMLImageElement> {\n const { video } = this.$refs;\n\n if (!video.dataset.poster) {\n return Promise.resolve();\n }\n\n const twicPoster = this.formatSrc(video.dataset.poster);\n\n return loadImage(twicPoster).then(() => {\n video.poster = twicPoster;\n this.$log('fresh poster loaded');\n });\n }\n\n /**\n * Load sources\n */\n loadSources(): Promise<void> {\n const { video } = this.$refs;\n\n this.sources.forEach((source) => {\n if (!source.dataset.src) {\n return;\n }\n source.src = this.formatSrc(\n source.dataset.src,\n source.dataset.output ? [`output=${source.dataset.output}`] : [],\n );\n });\n\n return new Promise((resolve) => {\n const loadHandler = () => {\n resolve();\n video.removeEventListener('canplaythrough', loadHandler);\n this.$log('fresh sources loaded');\n };\n\n video.addEventListener('canplaythrough', loadHandler);\n\n this.$refs.video.width = normalizeSize(this, 'offsetWidth');\n this.$refs.video.height = normalizeSize(this, 'offsetHeight');\n\n video.load();\n });\n }\n\n /**\n * Reassign the source from the original on resize.\n */\n async resized() {\n const width = normalizeSize(this, 'offsetWidth');\n const height = normalizeSize(this, 'offsetHeight');\n\n if (width === this.$refs.video.width && height === this.$refs.video.height) {\n return;\n }\n\n this.$refs.video.width = width;\n this.$refs.video.height = height;\n\n await this.load();\n }\n\n /**\n * Do not terminate on image load as we need to set the src on resize.\n */\n onLoad() {\n // Do not terminate on image load as we need.\n }\n}\n"],
|
|
5
|
+
"mappings": "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",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
{#
|
|
2
|
+
/**
|
|
3
|
+
* @file
|
|
4
|
+
* FigureVideo with Twicpics component.
|
|
5
|
+
*
|
|
6
|
+
* @param string $twic_domain
|
|
7
|
+
* The Twicpics domain to use.
|
|
8
|
+
* @param string $twic_path
|
|
9
|
+
* The Twicpics path to use.
|
|
10
|
+
* @param object $twic_transform
|
|
11
|
+
* Custom transforms for Twicpics.
|
|
12
|
+
*/
|
|
13
|
+
#}
|
|
14
|
+
|
|
15
|
+
{% extends '@ui-pkg/atoms/FigureVideo/FigureVideo.twig' %}
|
|
16
|
+
|
|
17
|
+
{% set twic_param = 'v1' %}
|
|
18
|
+
{% if twic_transform is defined %}
|
|
19
|
+
{% set formatted_transform = [] %}
|
|
20
|
+
{% for key, value in twic_transform %}
|
|
21
|
+
{% set formatted_transform = formatted_transform|merge(['%s=%s'|format(key, value)]) %}
|
|
22
|
+
{% endfor %}
|
|
23
|
+
{% set formatted_transform = formatted_transform|join('/') %}
|
|
24
|
+
|
|
25
|
+
{% set twic_param = 'v1/%s'|format(formatted_transform) %}
|
|
26
|
+
{% set attr = (attr ?? {})|merge({ data_option_transform: formatted_transform }) %}
|
|
27
|
+
{% endif %}
|
|
28
|
+
|
|
29
|
+
{% if twic_domain is defined %}
|
|
30
|
+
{% set attr = (attr ?? {})|merge({ data_option_domain: twic_domain }) %}
|
|
31
|
+
{% endif %}
|
|
32
|
+
|
|
33
|
+
{% if twic_path is defined %}
|
|
34
|
+
{% set attr = (attr ?? {})|merge({ data_option_path: twic_path }) %}
|
|
35
|
+
{% endif %}
|
|
36
|
+
|
|
37
|
+
{% block sources %}
|
|
38
|
+
{% if sources is empty %}
|
|
39
|
+
{% set twic_src =
|
|
40
|
+
twig_toolkit_url(src).withQueryParameter('twic', twic_param).withScheme('https')
|
|
41
|
+
%}
|
|
42
|
+
|
|
43
|
+
{% if twic_domain is defined %}
|
|
44
|
+
{% set twic_src = twic_src.withHost(twic_domain) %}
|
|
45
|
+
{% endif %}
|
|
46
|
+
|
|
47
|
+
{% if twic_path is defined %}
|
|
48
|
+
{% set twic_src = twic_src.withPath(twic_path ~ twic_src.getPath()) %}
|
|
49
|
+
{% endif %}
|
|
50
|
+
|
|
51
|
+
{% set sources = [
|
|
52
|
+
{
|
|
53
|
+
src: twic_src.withQueryParameter('twic', '%s/output=%s'|format(twic_param, 'h265')),
|
|
54
|
+
data_output: lazy ? 'h265' : false,
|
|
55
|
+
type: 'video/mp4;codecs=hvc1'
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
src: twic_src.withQueryParameter('twic', '%s/output=%s'|format(twic_param, 'vp9')),
|
|
59
|
+
data_output: lazy ? 'vp9' : false,
|
|
60
|
+
type: 'video/webm;codecs=vp9'
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
src: twic_src.withQueryParameter('twic', '%s/output=%s'|format(twic_param, 'h264')),
|
|
64
|
+
data_output: lazy ? 'h264' : false
|
|
65
|
+
}
|
|
66
|
+
] %}
|
|
67
|
+
{% endif %}
|
|
68
|
+
|
|
69
|
+
{% for source in sources %}
|
|
70
|
+
{% if twic_src is empty and source.src is not empty %}
|
|
71
|
+
{% set source_twic_src =
|
|
72
|
+
twig_toolkit_url(source.src).withQueryParameter('twic', twic_param).withScheme('https')
|
|
73
|
+
%}
|
|
74
|
+
|
|
75
|
+
{% if twic_domain is defined %}
|
|
76
|
+
{% set source_twic_src = source_twic_src.withHost(twic_domain) %}
|
|
77
|
+
{% endif %}
|
|
78
|
+
|
|
79
|
+
{% if twic_path is defined %}
|
|
80
|
+
{% set source_twic_src = source_twic_src.withPath(twic_path ~ source_twic_src.getPath()) %}
|
|
81
|
+
{% endif %}
|
|
82
|
+
{% else %}
|
|
83
|
+
{% set source_twic_src = source.src %}
|
|
84
|
+
{% endif %}
|
|
85
|
+
|
|
86
|
+
<source {{
|
|
87
|
+
html_attributes(
|
|
88
|
+
merge_html_attributes(
|
|
89
|
+
source,
|
|
90
|
+
{
|
|
91
|
+
src: lazy ? false : source_twic_src|default(false),
|
|
92
|
+
data_src: lazy ? source_twic_src|default(false) : false
|
|
93
|
+
}
|
|
94
|
+
)
|
|
95
|
+
)
|
|
96
|
+
}} />
|
|
97
|
+
{% endfor %}
|
|
98
|
+
{% endblock %}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __copyProps = (to, from, except, desc) => {
|
|
6
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
7
|
+
for (let key of __getOwnPropNames(from))
|
|
8
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
9
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
10
|
+
}
|
|
11
|
+
return to;
|
|
12
|
+
};
|
|
13
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
14
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
|
+
|
|
16
|
+
// packages/ui/atoms/FigureVideo/index.ts
|
|
17
|
+
var FigureVideo_exports = {};
|
|
18
|
+
module.exports = __toCommonJS(FigureVideo_exports);
|
|
19
|
+
__reExport(FigureVideo_exports, require("./FigureVideo.cjs"), module.exports);
|
|
20
|
+
__reExport(FigureVideo_exports, require("./FigureVideoTwicpics.cjs"), module.exports);
|
|
21
|
+
if (module.exports.default) module.exports = module.exports.default;
|
|
22
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../packages/ui/atoms/FigureVideo/index.ts"],
|
|
4
|
+
"sourcesContent": ["export * from './FigureVideo.js';\nexport * from './FigureVideoTwicpics.js';\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,gCAAc,8BAAd;AACA,gCAAc,sCADd;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/atoms/index.cjs
CHANGED
|
@@ -21,6 +21,7 @@ __reExport(atoms_exports, require("./AnchorScrollTo/index.cjs"), module.exports)
|
|
|
21
21
|
__reExport(atoms_exports, require("./CircularMarquee/index.cjs"), module.exports);
|
|
22
22
|
__reExport(atoms_exports, require("./Cursor/index.cjs"), module.exports);
|
|
23
23
|
__reExport(atoms_exports, require("./Figure/index.cjs"), module.exports);
|
|
24
|
+
__reExport(atoms_exports, require("./FigureVideo/index.cjs"), module.exports);
|
|
24
25
|
__reExport(atoms_exports, require("./LargeText/index.cjs"), module.exports);
|
|
25
26
|
__reExport(atoms_exports, require("./LazyInclude/index.cjs"), module.exports);
|
|
26
27
|
__reExport(atoms_exports, require("./Prefetch/index.cjs"), module.exports);
|
package/atoms/index.cjs.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../packages/ui/atoms/index.ts"],
|
|
4
|
-
"sourcesContent": ["export * from './Action/index.js';\nexport * from './AnchorScrollTo/index.js';\nexport * from './CircularMarquee/index.js';\nexport * from './Cursor/index.js';\nexport * from './Figure/index.js';\nexport * from './LargeText/index.js';\nexport * from './LazyInclude/index.js';\nexport * from './Prefetch/index.js';\nexport * from './ScrollAnimation/index.js';\nexport * from './ScrollReveal/index.js';\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,0BAAc,+BAAd;AACA,0BAAc,uCADd;AAEA,0BAAc,wCAFd;AAGA,0BAAc,+BAHd;AAIA,0BAAc,+BAJd;AAKA,0BAAc,
|
|
4
|
+
"sourcesContent": ["export * from './Action/index.js';\nexport * from './AnchorScrollTo/index.js';\nexport * from './CircularMarquee/index.js';\nexport * from './Cursor/index.js';\nexport * from './Figure/index.js';\nexport * from './FigureVideo/index.js';\nexport * from './LargeText/index.js';\nexport * from './LazyInclude/index.js';\nexport * from './Prefetch/index.js';\nexport * from './ScrollAnimation/index.js';\nexport * from './ScrollReveal/index.js';\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,0BAAc,+BAAd;AACA,0BAAc,uCADd;AAEA,0BAAc,wCAFd;AAGA,0BAAc,+BAHd;AAIA,0BAAc,+BAJd;AAKA,0BAAc,oCALd;AAMA,0BAAc,kCANd;AAOA,0BAAc,oCAPd;AAQA,0BAAc,iCARd;AASA,0BAAc,wCATd;AAUA,0BAAc,qCAVd;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/atoms/index.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ export * from './AnchorScrollTo/index.js';
|
|
|
3
3
|
export * from './CircularMarquee/index.js';
|
|
4
4
|
export * from './Cursor/index.js';
|
|
5
5
|
export * from './Figure/index.js';
|
|
6
|
+
export * from './FigureVideo/index.js';
|
|
6
7
|
export * from './LargeText/index.js';
|
|
7
8
|
export * from './LazyInclude/index.js';
|
|
8
9
|
export * from './Prefetch/index.js';
|
package/atoms/index.js
CHANGED
|
@@ -3,6 +3,7 @@ export * from "./AnchorScrollTo/index.js";
|
|
|
3
3
|
export * from "./CircularMarquee/index.js";
|
|
4
4
|
export * from "./Cursor/index.js";
|
|
5
5
|
export * from "./Figure/index.js";
|
|
6
|
+
export * from "./FigureVideo/index.js";
|
|
6
7
|
export * from "./LargeText/index.js";
|
|
7
8
|
export * from "./LazyInclude/index.js";
|
|
8
9
|
export * from "./Prefetch/index.js";
|
package/atoms/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../packages/ui/atoms/index.ts"],
|
|
4
|
-
"sourcesContent": ["export * from './Action/index.js';\nexport * from './AnchorScrollTo/index.js';\nexport * from './CircularMarquee/index.js';\nexport * from './Cursor/index.js';\nexport * from './Figure/index.js';\nexport * from './LargeText/index.js';\nexport * from './LazyInclude/index.js';\nexport * from './Prefetch/index.js';\nexport * from './ScrollAnimation/index.js';\nexport * from './ScrollReveal/index.js';\n"],
|
|
5
|
-
"mappings": "AAAA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;",
|
|
4
|
+
"sourcesContent": ["export * from './Action/index.js';\nexport * from './AnchorScrollTo/index.js';\nexport * from './CircularMarquee/index.js';\nexport * from './Cursor/index.js';\nexport * from './Figure/index.js';\nexport * from './FigureVideo/index.js';\nexport * from './LargeText/index.js';\nexport * from './LazyInclude/index.js';\nexport * from './Prefetch/index.js';\nexport * from './ScrollAnimation/index.js';\nexport * from './ScrollReveal/index.js';\n"],
|
|
5
|
+
"mappings": "AAAA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// packages/ui/molecules/AnchorNav/AnchorNav.ts
|
|
20
|
+
var AnchorNav_exports = {};
|
|
21
|
+
__export(AnchorNav_exports, {
|
|
22
|
+
AnchorNav: () => AnchorNav
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(AnchorNav_exports);
|
|
25
|
+
var import_js_toolkit = require("@studiometa/js-toolkit");
|
|
26
|
+
var import_AnchorNavLink = require("./AnchorNavLink.cjs");
|
|
27
|
+
var import_AnchorNavTarget = require("./AnchorNavTarget.cjs");
|
|
28
|
+
var AnchorNav = class extends import_js_toolkit.Base {
|
|
29
|
+
/**
|
|
30
|
+
* Config
|
|
31
|
+
*/
|
|
32
|
+
static config = {
|
|
33
|
+
name: "AnchorNav",
|
|
34
|
+
components: {
|
|
35
|
+
AnchorNavLink: import_AnchorNavLink.AnchorNavLink,
|
|
36
|
+
AnchorNavTarget: import_AnchorNavTarget.AnchorNavTarget
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
/**
|
|
40
|
+
* Listen to the AnchorNavTarget that is mounted
|
|
41
|
+
*/
|
|
42
|
+
onAnchorNavTargetMounted(index) {
|
|
43
|
+
const { id } = this.$children.AnchorNavTarget[index].$el;
|
|
44
|
+
this.$children.AnchorNavLink.forEach((anchorNavLink) => {
|
|
45
|
+
if (id === anchorNavLink.targetId) {
|
|
46
|
+
anchorNavLink.enter();
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Listen to the AnchorNavTarget that is destroyed
|
|
52
|
+
*/
|
|
53
|
+
onAnchorNavTargetDestroyed(index) {
|
|
54
|
+
const { id } = this.$children.AnchorNavTarget[index].$el;
|
|
55
|
+
this.$children.AnchorNavLink.forEach((anchorNavLink) => {
|
|
56
|
+
if (id === anchorNavLink.targetId) {
|
|
57
|
+
anchorNavLink.leave();
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
if (module.exports.default) module.exports = module.exports.default;
|
|
63
|
+
//# sourceMappingURL=AnchorNav.cjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../packages/ui/molecules/AnchorNav/AnchorNav.ts"],
|
|
4
|
+
"sourcesContent": ["import { Base } from '@studiometa/js-toolkit';\nimport type { BaseProps, BaseConfig } from '@studiometa/js-toolkit';\nimport { AnchorNavLink } from './AnchorNavLink.js';\nimport { AnchorNavTarget } from './AnchorNavTarget.js';\n\nexport interface AnchorNavProps extends BaseProps {\n $children: {\n AnchorNavLink: AnchorNavLink[];\n AnchorNavTarget: AnchorNavTarget[];\n };\n}\n\nexport class AnchorNav<T extends BaseProps = BaseProps> extends Base<T & AnchorNavProps> {\n /**\n * Config\n */\n static config: BaseConfig = {\n name: 'AnchorNav',\n components: {\n AnchorNavLink,\n AnchorNavTarget,\n },\n };\n\n /**\n * Listen to the AnchorNavTarget that is mounted\n */\n onAnchorNavTargetMounted(index) {\n const { id } = this.$children.AnchorNavTarget[index].$el;\n this.$children.AnchorNavLink.forEach((anchorNavLink) => {\n if (id === anchorNavLink.targetId) {\n anchorNavLink.enter();\n }\n });\n }\n\n /**\n * Listen to the AnchorNavTarget that is destroyed\n */\n onAnchorNavTargetDestroyed(index) {\n const { id } = this.$children.AnchorNavTarget[index].$el;\n this.$children.AnchorNavLink.forEach((anchorNavLink) => {\n if (id === anchorNavLink.targetId) {\n anchorNavLink.leave();\n }\n });\n }\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,wBAAqB;AAErB,2BAA8B;AAC9B,6BAAgC;AASzB,IAAM,YAAN,cAAyD,uBAAyB;AAAA;AAAA;AAAA;AAAA,EAIvF,OAAO,SAAqB;AAAA,IAC1B,MAAM;AAAA,IACN,YAAY;AAAA,MACV;AAAA,MACA;AAAA,IACF;AAAA,EACF;AAAA;AAAA;AAAA;AAAA,EAKA,yBAAyB,OAAO;AAC9B,UAAM,EAAE,GAAG,IAAI,KAAK,UAAU,gBAAgB,KAAK,EAAE;AACrD,SAAK,UAAU,cAAc,QAAQ,CAAC,kBAAkB;AACtD,UAAI,OAAO,cAAc,UAAU;AACjC,sBAAc,MAAM;AAAA,MACtB;AAAA,IACF,CAAC;AAAA,EACH;AAAA;AAAA;AAAA;AAAA,EAKA,2BAA2B,OAAO;AAChC,UAAM,EAAE,GAAG,IAAI,KAAK,UAAU,gBAAgB,KAAK,EAAE;AACrD,SAAK,UAAU,cAAc,QAAQ,CAAC,kBAAkB;AACtD,UAAI,OAAO,cAAc,UAAU;AACjC,sBAAc,MAAM;AAAA,MACtB;AAAA,IACF,CAAC;AAAA,EACH;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Base } from '@studiometa/js-toolkit';
|
|
2
|
+
import type { BaseProps, BaseConfig } from '@studiometa/js-toolkit';
|
|
3
|
+
import { AnchorNavLink } from './AnchorNavLink.js';
|
|
4
|
+
import { AnchorNavTarget } from './AnchorNavTarget.js';
|
|
5
|
+
export interface AnchorNavProps extends BaseProps {
|
|
6
|
+
$children: {
|
|
7
|
+
AnchorNavLink: AnchorNavLink[];
|
|
8
|
+
AnchorNavTarget: AnchorNavTarget[];
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
export declare class AnchorNav<T extends BaseProps = BaseProps> extends Base<T & AnchorNavProps> {
|
|
12
|
+
/**
|
|
13
|
+
* Config
|
|
14
|
+
*/
|
|
15
|
+
static config: BaseConfig;
|
|
16
|
+
/**
|
|
17
|
+
* Listen to the AnchorNavTarget that is mounted
|
|
18
|
+
*/
|
|
19
|
+
onAnchorNavTargetMounted(index: any): void;
|
|
20
|
+
/**
|
|
21
|
+
* Listen to the AnchorNavTarget that is destroyed
|
|
22
|
+
*/
|
|
23
|
+
onAnchorNavTargetDestroyed(index: any): void;
|
|
24
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { Base } from "@studiometa/js-toolkit";
|
|
2
|
+
import { AnchorNavLink } from "./AnchorNavLink.js";
|
|
3
|
+
import { AnchorNavTarget } from "./AnchorNavTarget.js";
|
|
4
|
+
class AnchorNav extends Base {
|
|
5
|
+
/**
|
|
6
|
+
* Config
|
|
7
|
+
*/
|
|
8
|
+
static config = {
|
|
9
|
+
name: "AnchorNav",
|
|
10
|
+
components: {
|
|
11
|
+
AnchorNavLink,
|
|
12
|
+
AnchorNavTarget
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Listen to the AnchorNavTarget that is mounted
|
|
17
|
+
*/
|
|
18
|
+
onAnchorNavTargetMounted(index) {
|
|
19
|
+
const { id } = this.$children.AnchorNavTarget[index].$el;
|
|
20
|
+
this.$children.AnchorNavLink.forEach((anchorNavLink) => {
|
|
21
|
+
if (id === anchorNavLink.targetId) {
|
|
22
|
+
anchorNavLink.enter();
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Listen to the AnchorNavTarget that is destroyed
|
|
28
|
+
*/
|
|
29
|
+
onAnchorNavTargetDestroyed(index) {
|
|
30
|
+
const { id } = this.$children.AnchorNavTarget[index].$el;
|
|
31
|
+
this.$children.AnchorNavLink.forEach((anchorNavLink) => {
|
|
32
|
+
if (id === anchorNavLink.targetId) {
|
|
33
|
+
anchorNavLink.leave();
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
export {
|
|
39
|
+
AnchorNav
|
|
40
|
+
};
|
|
41
|
+
//# sourceMappingURL=AnchorNav.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../packages/ui/molecules/AnchorNav/AnchorNav.ts"],
|
|
4
|
+
"sourcesContent": ["import { Base } from '@studiometa/js-toolkit';\nimport type { BaseProps, BaseConfig } from '@studiometa/js-toolkit';\nimport { AnchorNavLink } from './AnchorNavLink.js';\nimport { AnchorNavTarget } from './AnchorNavTarget.js';\n\nexport interface AnchorNavProps extends BaseProps {\n $children: {\n AnchorNavLink: AnchorNavLink[];\n AnchorNavTarget: AnchorNavTarget[];\n };\n}\n\nexport class AnchorNav<T extends BaseProps = BaseProps> extends Base<T & AnchorNavProps> {\n /**\n * Config\n */\n static config: BaseConfig = {\n name: 'AnchorNav',\n components: {\n AnchorNavLink,\n AnchorNavTarget,\n },\n };\n\n /**\n * Listen to the AnchorNavTarget that is mounted\n */\n onAnchorNavTargetMounted(index) {\n const { id } = this.$children.AnchorNavTarget[index].$el;\n this.$children.AnchorNavLink.forEach((anchorNavLink) => {\n if (id === anchorNavLink.targetId) {\n anchorNavLink.enter();\n }\n });\n }\n\n /**\n * Listen to the AnchorNavTarget that is destroyed\n */\n onAnchorNavTargetDestroyed(index) {\n const { id } = this.$children.AnchorNavTarget[index].$el;\n this.$children.AnchorNavLink.forEach((anchorNavLink) => {\n if (id === anchorNavLink.targetId) {\n anchorNavLink.leave();\n }\n });\n }\n}\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,YAAY;AAErB,SAAS,qBAAqB;AAC9B,SAAS,uBAAuB;AASzB,MAAM,kBAAmD,KAAyB;AAAA;AAAA;AAAA;AAAA,EAIvF,OAAO,SAAqB;AAAA,IAC1B,MAAM;AAAA,IACN,YAAY;AAAA,MACV;AAAA,MACA;AAAA,IACF;AAAA,EACF;AAAA;AAAA;AAAA;AAAA,EAKA,yBAAyB,OAAO;AAC9B,UAAM,EAAE,GAAG,IAAI,KAAK,UAAU,gBAAgB,KAAK,EAAE;AACrD,SAAK,UAAU,cAAc,QAAQ,CAAC,kBAAkB;AACtD,UAAI,OAAO,cAAc,UAAU;AACjC,sBAAc,MAAM;AAAA,MACtB;AAAA,IACF,CAAC;AAAA,EACH;AAAA;AAAA;AAAA;AAAA,EAKA,2BAA2B,OAAO;AAChC,UAAM,EAAE,GAAG,IAAI,KAAK,UAAU,gBAAgB,KAAK,EAAE;AACrD,SAAK,UAAU,cAAc,QAAQ,CAAC,kBAAkB;AACtD,UAAI,OAAO,cAAc,UAAU;AACjC,sBAAc,MAAM;AAAA,MACtB;AAAA,IACF,CAAC;AAAA,EACH;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// packages/ui/molecules/AnchorNav/AnchorNavLink.ts
|
|
20
|
+
var AnchorNavLink_exports = {};
|
|
21
|
+
__export(AnchorNavLink_exports, {
|
|
22
|
+
AnchorNavLink: () => AnchorNavLink
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(AnchorNavLink_exports);
|
|
25
|
+
var import_AnchorScrollTo = require("../../atoms/AnchorScrollTo/AnchorScrollTo.cjs");
|
|
26
|
+
var import_decorators = require("../../decorators/index.cjs");
|
|
27
|
+
var AnchorNavLink = class extends (0, import_decorators.withTransition)(import_AnchorScrollTo.AnchorScrollTo) {
|
|
28
|
+
/**
|
|
29
|
+
* Config.
|
|
30
|
+
*/
|
|
31
|
+
static config = {
|
|
32
|
+
...import_AnchorScrollTo.AnchorScrollTo.config,
|
|
33
|
+
name: "AnchorNavLink"
|
|
34
|
+
};
|
|
35
|
+
get targetId() {
|
|
36
|
+
return this.$el.hash.replace(/^#/, "");
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
if (module.exports.default) module.exports = module.exports.default;
|
|
40
|
+
//# sourceMappingURL=AnchorNavLink.cjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../packages/ui/molecules/AnchorNav/AnchorNavLink.ts"],
|
|
4
|
+
"sourcesContent": ["import type { BaseConfig } from '@studiometa/js-toolkit';\nimport { AnchorScrollTo, AnchorScrollToProps } from '../../atoms/AnchorScrollTo/AnchorScrollTo.js';\nimport { withTransition } from '../../decorators/index.js';\n\nexport interface AnchorNavLinkProps extends AnchorScrollToProps {\n $options: {\n id: string;\n };\n}\n\n/**\n * Manage a slider item and its state transition.\n */\nexport class AnchorNavLink extends withTransition(AnchorScrollTo)<AnchorNavLinkProps> {\n /**\n * Config.\n */\n static config: BaseConfig = {\n ...AnchorScrollTo.config,\n name: 'AnchorNavLink',\n };\n\n get targetId() {\n return this.$el.hash.replace(/^#/, '');\n }\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,4BAAoD;AACpD,wBAA+B;AAWxB,IAAM,gBAAN,kBAA4B,kCAAe,oCAAc,EAAsB;AAAA;AAAA;AAAA;AAAA,EAIpF,OAAO,SAAqB;AAAA,IAC1B,GAAG,qCAAe;AAAA,IAClB,MAAM;AAAA,EACR;AAAA,EAEA,IAAI,WAAW;AACb,WAAO,KAAK,IAAI,KAAK,QAAQ,MAAM,EAAE;AAAA,EACvC;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { BaseConfig } from '@studiometa/js-toolkit';
|
|
2
|
+
import { AnchorScrollToProps } from '../../atoms/AnchorScrollTo/AnchorScrollTo.js';
|
|
3
|
+
export interface AnchorNavLinkProps extends AnchorScrollToProps {
|
|
4
|
+
$options: {
|
|
5
|
+
id: string;
|
|
6
|
+
};
|
|
7
|
+
}
|
|
8
|
+
declare const AnchorNavLink_base: import("@studiometa/js-toolkit").BaseDecorator<import("decorators/withTransition.js").TransitionInterface, import("@studiometa/js-toolkit").Base<import("@studiometa/js-toolkit").BaseProps>, import("decorators/withTransition.js").TransitionProps>;
|
|
9
|
+
/**
|
|
10
|
+
* Manage a slider item and its state transition.
|
|
11
|
+
*/
|
|
12
|
+
export declare class AnchorNavLink extends AnchorNavLink_base<AnchorNavLinkProps> {
|
|
13
|
+
/**
|
|
14
|
+
* Config.
|
|
15
|
+
*/
|
|
16
|
+
static config: BaseConfig;
|
|
17
|
+
get targetId(): string;
|
|
18
|
+
}
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { AnchorScrollTo } from "../../atoms/AnchorScrollTo/AnchorScrollTo.js";
|
|
2
|
+
import { withTransition } from "../../decorators/index.js";
|
|
3
|
+
class AnchorNavLink extends withTransition(AnchorScrollTo) {
|
|
4
|
+
/**
|
|
5
|
+
* Config.
|
|
6
|
+
*/
|
|
7
|
+
static config = {
|
|
8
|
+
...AnchorScrollTo.config,
|
|
9
|
+
name: "AnchorNavLink"
|
|
10
|
+
};
|
|
11
|
+
get targetId() {
|
|
12
|
+
return this.$el.hash.replace(/^#/, "");
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
export {
|
|
16
|
+
AnchorNavLink
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=AnchorNavLink.js.map
|