generator-folklore 3.0.30 → 3.0.33
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/lib/generators/build/index.js +0 -12
- package/lib/generators/html-project/index.js +5 -0
- package/lib/generators/laravel-project/index.js +4 -0
- package/lib/generators/micromag-project/index.js +82 -25
- package/lib/generators/micromag-project/templates/App.tsx +50 -0
- package/lib/generators/micromag-project/templates/Layout.tsx +38 -0
- package/lib/generators/micromag-project/templates/MicromagPage.tsx +73 -0
- package/lib/generators/micromag-project/templates/Routes.tsx +32 -0
- package/lib/generators/micromag-project/templates/contexts/AnalyticsContext.tsx +44 -0
- package/lib/generators/micromag-project/templates/contexts/ModalContext.tsx +69 -0
- package/lib/generators/micromag-project/templates/hooks/useKeyboardKeys.ts +29 -0
- package/lib/generators/micromag-project/templates/hooks/useMicromagPreview.ts +15 -0
- package/lib/generators/micromag-project/templates/hooks/useMicromagStory.ts +48 -0
- package/lib/generators/micromag-project/templates/hooks/useMicromagVideo.ts +40 -0
- package/lib/generators/micromag-project/templates/hooks/useParseFonts.ts +15 -0
- package/lib/generators/micromag-project/templates/hooks/useStoryTrackingVariables.ts +41 -0
- package/lib/generators/micromag-project/templates/icons/Cookie.tsx +22 -0
- package/lib/generators/micromag-project/templates/index.html.ejs +95 -0
- package/lib/generators/micromag-project/templates/kiosk/HomePage.tsx +35 -0
- package/lib/generators/micromag-project/templates/kiosk/Routes.tsx +47 -0
- package/lib/generators/micromag-project/templates/kiosk/home-page.module.css +83 -0
- package/lib/generators/micromag-project/templates/kiosk/micromags.ts +13 -0
- package/lib/generators/micromag-project/templates/kiosk/styles.css +86 -0
- package/lib/generators/micromag-project/templates/layout.module.css +26 -0
- package/lib/generators/micromag-project/templates/lib/addTrackingCodesToStory.ts +26 -0
- package/lib/generators/micromag-project/templates/micromags.ts +13 -0
- package/lib/generators/micromag-project/templates/modals/Consent.tsx +63 -0
- package/lib/generators/micromag-project/templates/partials/Micromag.tsx +156 -0
- package/lib/generators/micromag-project/templates/partials/Preview.tsx +28 -0
- package/lib/generators/micromag-project/templates/partials/Thumbnail.tsx +24 -0
- package/lib/generators/micromag-project/templates/partials/Video.tsx +36 -0
- package/lib/generators/micromag-project/templates/styles/modals/consent.module.css +150 -0
- package/lib/generators/micromag-project/templates/styles/pages/micromag.module.css +6 -0
- package/lib/generators/micromag-project/templates/styles/partials/micromag.module.css +17 -0
- package/lib/generators/micromag-project/templates/styles/partials/preview.module.css +3 -0
- package/lib/generators/micromag-project/templates/styles/partials/thumbnail.module.css +3 -0
- package/lib/generators/micromag-project/templates/styles/partials/video.module.css +3 -0
- package/lib/generators/micromag-project/templates/styles.css +85 -2
- package/lib/generators/micromag-project/templates/types/micromag.d.ts +58 -0
- package/lib/generators/react-app/templates/types/base.d.ts +1 -0
- package/lib/generators/typescript/index.js +50 -0
- package/lib/generators/typescript/templates/_tsconfig.json +8 -0
- package/package.json +3 -3
- package/lib/generators/build/templates/.jsconfig.json +0 -9
- package/lib/generators/build/templates/.tsconfig.json +0 -7
- package/lib/generators/micromag-project/templates/Home.jsx +0 -33
- package/lib/generators/micromag-project/templates/Routes.jsx +0 -26
- package/lib/generators/micromag-project/templates/home.module.css +0 -19
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
import { useWindowSize } from '@folklore/hooks';
|
|
2
|
+
import { DataProvider } from '@micromag/data';
|
|
3
|
+
import '@micromag/intl/locale/fr';
|
|
4
|
+
import Viewer from '@micromag/viewer';
|
|
5
|
+
import classNames from 'classnames';
|
|
6
|
+
import { useState, useCallback, useMemo, ReactNode } from 'react';
|
|
7
|
+
|
|
8
|
+
import useStoryTrackingVariables from '../../hooks/useStoryTrackingVariables';
|
|
9
|
+
|
|
10
|
+
import { MicromagStory } from '../../types/micromag';
|
|
11
|
+
|
|
12
|
+
import styles from '<%= getRelativeStylesPath('components/partials/Micromag.jsx', 'partials/micromag.module.css') %>';
|
|
13
|
+
|
|
14
|
+
interface MicromagProps {
|
|
15
|
+
micromag: MicromagStory;
|
|
16
|
+
viewerMenuHeader?: ReactNode;
|
|
17
|
+
currentScreenId?: string | null;
|
|
18
|
+
paused?: boolean;
|
|
19
|
+
fullscreen?: boolean;
|
|
20
|
+
autoFullscreen?: boolean;
|
|
21
|
+
withoutPlaybackControls?: boolean;
|
|
22
|
+
basePath?: string | null;
|
|
23
|
+
withoutRouter?: boolean;
|
|
24
|
+
// onStart?: () => void | null;
|
|
25
|
+
onClose?: (() => void) | null;
|
|
26
|
+
onEnd?: (() => void) | null;
|
|
27
|
+
onScreenChange?: ((...args: any[]) => void) | null;
|
|
28
|
+
onMenuChange?: ((...args: any[]) => void) | null;
|
|
29
|
+
hasHome?: boolean;
|
|
30
|
+
className?: string | number | symbol | any;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
function Micromag({
|
|
34
|
+
micromag,
|
|
35
|
+
viewerMenuHeader = null,
|
|
36
|
+
currentScreenId = null,
|
|
37
|
+
paused = false,
|
|
38
|
+
fullscreen: initialFullscreen = false,
|
|
39
|
+
autoFullscreen = false,
|
|
40
|
+
withoutPlaybackControls = false,
|
|
41
|
+
basePath = null,
|
|
42
|
+
withoutRouter = true,
|
|
43
|
+
// onStart: customOnStart = null,
|
|
44
|
+
onClose: customOnClose = null,
|
|
45
|
+
onEnd: customOnEnd = null,
|
|
46
|
+
onScreenChange = null,
|
|
47
|
+
onMenuChange = null,
|
|
48
|
+
hasHome = false,
|
|
49
|
+
className = null,
|
|
50
|
+
}: MicromagProps) {
|
|
51
|
+
const googleApiKey = null;
|
|
52
|
+
const micromagApiBaseUrl = 'https://microm.ag/api';
|
|
53
|
+
const { organisation = null } = micromag || {};
|
|
54
|
+
const { branding = null } = organisation || {};
|
|
55
|
+
|
|
56
|
+
const { width = 0, height = 0 } = useWindowSize();
|
|
57
|
+
const [landscape, setLandscape] = useState(width > height);
|
|
58
|
+
const [fullscreen, setFullscreen] = useState(autoFullscreen && !landscape && initialFullscreen);
|
|
59
|
+
|
|
60
|
+
const onClose = useCallback(() => {
|
|
61
|
+
if (autoFullscreen && fullscreen) {
|
|
62
|
+
setFullscreen(false);
|
|
63
|
+
}
|
|
64
|
+
if (customOnClose !== null) {
|
|
65
|
+
customOnClose();
|
|
66
|
+
}
|
|
67
|
+
}, [autoFullscreen, fullscreen, setFullscreen, customOnClose]);
|
|
68
|
+
|
|
69
|
+
// const onStart = useCallback(() => {
|
|
70
|
+
// if (autoFullscreen && !landscape) {
|
|
71
|
+
// setFullscreen(true);
|
|
72
|
+
// }
|
|
73
|
+
// if (customOnStart !== null) {
|
|
74
|
+
// customOnStart();
|
|
75
|
+
// }
|
|
76
|
+
// }, [autoFullscreen, setFullscreen, landscape, customOnStart]);
|
|
77
|
+
|
|
78
|
+
const onEnd = useCallback(() => {
|
|
79
|
+
if (autoFullscreen && fullscreen) {
|
|
80
|
+
setFullscreen(false);
|
|
81
|
+
}
|
|
82
|
+
if (customOnEnd !== null) {
|
|
83
|
+
customOnEnd();
|
|
84
|
+
}
|
|
85
|
+
}, [autoFullscreen, fullscreen, setFullscreen, customOnEnd]);
|
|
86
|
+
|
|
87
|
+
const onViewModeChange = useCallback(
|
|
88
|
+
({ landscape: isLandscape = false }) => {
|
|
89
|
+
setLandscape(isLandscape);
|
|
90
|
+
if (autoFullscreen && !isLandscape) {
|
|
91
|
+
setFullscreen(true);
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
[autoFullscreen, setLandscape, setFullscreen],
|
|
95
|
+
);
|
|
96
|
+
|
|
97
|
+
const trackingVariables = useStoryTrackingVariables(micromag);
|
|
98
|
+
|
|
99
|
+
const finalMicromag = useMemo(
|
|
100
|
+
() => ({
|
|
101
|
+
title: 'Custom micromag title',
|
|
102
|
+
...micromag,
|
|
103
|
+
}),
|
|
104
|
+
[micromag],
|
|
105
|
+
);
|
|
106
|
+
|
|
107
|
+
return (
|
|
108
|
+
<div
|
|
109
|
+
className={classNames([
|
|
110
|
+
styles.container,
|
|
111
|
+
{
|
|
112
|
+
[styles.fullscreen]: fullscreen,
|
|
113
|
+
[className]: className !== null,
|
|
114
|
+
},
|
|
115
|
+
])}
|
|
116
|
+
>
|
|
117
|
+
<DataProvider apiBaseUrl={micromagApiBaseUrl}>
|
|
118
|
+
<Viewer
|
|
119
|
+
story={finalMicromag}
|
|
120
|
+
trackingVariables={trackingVariables}
|
|
121
|
+
paused={paused}
|
|
122
|
+
theme={branding}
|
|
123
|
+
locale="fr"
|
|
124
|
+
visitor={null}
|
|
125
|
+
memoryRouter={basePath === null}
|
|
126
|
+
withoutRouter={withoutRouter}
|
|
127
|
+
basePath={basePath}
|
|
128
|
+
screen={currentScreenId}
|
|
129
|
+
closeable={(autoFullscreen && fullscreen) || customOnClose !== null}
|
|
130
|
+
googleApiKey={googleApiKey}
|
|
131
|
+
onViewModeChange={onViewModeChange}
|
|
132
|
+
onScreenChange={onScreenChange}
|
|
133
|
+
onMenuChange={onMenuChange}
|
|
134
|
+
onClose={onClose}
|
|
135
|
+
onEnd={onEnd}
|
|
136
|
+
withoutPlaybackControls={withoutPlaybackControls}
|
|
137
|
+
withNavigationHint
|
|
138
|
+
withMicromagBranding
|
|
139
|
+
pathWithIndex
|
|
140
|
+
menuHeader={viewerMenuHeader}
|
|
141
|
+
beforeScreensMenuButton={
|
|
142
|
+
hasHome
|
|
143
|
+
? // <Link className={styles.link} to="/">
|
|
144
|
+
// <FormattedMessage defaultMessage="Accueil" description="Homelink" />
|
|
145
|
+
// </Link>
|
|
146
|
+
null
|
|
147
|
+
: null
|
|
148
|
+
}
|
|
149
|
+
/>
|
|
150
|
+
</DataProvider>
|
|
151
|
+
</div>
|
|
152
|
+
);
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
export default Micromag;
|
|
156
|
+
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import Viewer from '@micromag/viewer';
|
|
2
|
+
import classNames from 'classnames';
|
|
3
|
+
|
|
4
|
+
import { useMicromagPreview } from '../../hooks/useMicromagPreview';
|
|
5
|
+
|
|
6
|
+
import styles from '<%= getRelativeStylesPath('components/partials/Preview.jsx', 'partials/preview.module.css') %>';
|
|
7
|
+
|
|
8
|
+
interface MicromagPreviewProps {
|
|
9
|
+
story?: Record<string, any> | null;
|
|
10
|
+
className?: string | number | symbol | any;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
const Preview = ({ story = null, className = null }: MicromagPreviewProps) => {
|
|
14
|
+
const simpleStory = useMicromagPreview(story);
|
|
15
|
+
return (
|
|
16
|
+
<Viewer
|
|
17
|
+
story={simpleStory}
|
|
18
|
+
className={classNames([styles.container, { [className]: className !== null }])}
|
|
19
|
+
withoutMenu
|
|
20
|
+
withoutGestures
|
|
21
|
+
withoutNavigationArrow
|
|
22
|
+
withNavigationHint={false}
|
|
23
|
+
withoutPlaybackControls
|
|
24
|
+
/>
|
|
25
|
+
);
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export default Preview;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import useMicromagStory from '../../hooks/useMicromagStory';
|
|
2
|
+
import { useMicromagVideo } from '../../hooks/useMicromagVideo';
|
|
3
|
+
|
|
4
|
+
import { MicromagItem } from '../../types/micromag';
|
|
5
|
+
import Preview from './Preview';
|
|
6
|
+
import Video from './Video';
|
|
7
|
+
|
|
8
|
+
interface ThumbnailProps {
|
|
9
|
+
micromag?: MicromagItem | null;
|
|
10
|
+
isPoster?: boolean;
|
|
11
|
+
className?: string | null;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const Thumbnail = ({ micromag = null, isPoster = false, className = null }: ThumbnailProps) => {
|
|
15
|
+
const { story = null, loading = false } = useMicromagStory(micromag);
|
|
16
|
+
const { url, thumbnail } = useMicromagVideo(story);
|
|
17
|
+
return url !== null || thumbnail !== null ? (
|
|
18
|
+
<Video url={url} thumbnail={thumbnail} isPoster={isPoster} className={className} />
|
|
19
|
+
) : (
|
|
20
|
+
<Preview story={story} className={className} />
|
|
21
|
+
);
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export default Thumbnail;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import classNames from 'classnames';
|
|
2
|
+
|
|
3
|
+
import styles from '<%= getRelativeStylesPath('components/partials/Video.jsx', 'partials/video.module.css') %>';
|
|
4
|
+
|
|
5
|
+
interface VideoProps {
|
|
6
|
+
url?: string | null;
|
|
7
|
+
thumbnail?: string | null;
|
|
8
|
+
isPoster?: boolean;
|
|
9
|
+
className?: string | null;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
const Video = ({
|
|
13
|
+
url = null,
|
|
14
|
+
thumbnail = null,
|
|
15
|
+
isPoster = false,
|
|
16
|
+
className = null,
|
|
17
|
+
}: VideoProps) => {
|
|
18
|
+
return url !== null || thumbnail !== null ? (
|
|
19
|
+
<video
|
|
20
|
+
className={classNames([
|
|
21
|
+
styles.container,
|
|
22
|
+
styles.video,
|
|
23
|
+
{ [className]: className !== null },
|
|
24
|
+
])}
|
|
25
|
+
src={!isPoster && url !== null ? `${url}#t=0.01` : null}
|
|
26
|
+
poster={thumbnail}
|
|
27
|
+
autoPlay
|
|
28
|
+
loop
|
|
29
|
+
muted
|
|
30
|
+
playsInline
|
|
31
|
+
preload="auto"
|
|
32
|
+
/>
|
|
33
|
+
) : null;
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
export default Video;
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
.container {
|
|
2
|
+
position: absolute;
|
|
3
|
+
z-index: 99999;
|
|
4
|
+
width: 100%;
|
|
5
|
+
height: 100%;
|
|
6
|
+
font-family: Inter, Helvetica, Arial, sans-serif;
|
|
7
|
+
inset: 0;
|
|
8
|
+
|
|
9
|
+
--color-primary: #f19e85;
|
|
10
|
+
|
|
11
|
+
.closeBtn, .arrowBtn {
|
|
12
|
+
position: absolute;
|
|
13
|
+
top: 1rem;
|
|
14
|
+
right: 1rem;
|
|
15
|
+
display: none;
|
|
16
|
+
width: 3rem;
|
|
17
|
+
height: 3rem;
|
|
18
|
+
align-items: center;
|
|
19
|
+
justify-content: center;
|
|
20
|
+
border-radius: 2rem;
|
|
21
|
+
background-color: rgb(0 0 0 / 0.2);
|
|
22
|
+
color: #FFF;
|
|
23
|
+
visibility: hidden;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.arrowBtn {
|
|
27
|
+
top: 50%;
|
|
28
|
+
padding: 0.5em;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.arrowLeftBtn {
|
|
32
|
+
right: auto;
|
|
33
|
+
left: 1rem;
|
|
34
|
+
|
|
35
|
+
.arrowIcon {
|
|
36
|
+
transform: rotate(180deg);
|
|
37
|
+
transform-origin: center;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.arrowRightBtn {
|
|
42
|
+
right: 1rem;
|
|
43
|
+
left: auto;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.lightBox {
|
|
47
|
+
position: fixed;
|
|
48
|
+
z-index: 1;
|
|
49
|
+
display: block;
|
|
50
|
+
width: 100%;
|
|
51
|
+
height: 100%;
|
|
52
|
+
backdrop-filter: blur(4px);
|
|
53
|
+
background-color: rgb(0 0 0 / 0.33);
|
|
54
|
+
inset: 0;
|
|
55
|
+
opacity: 0;
|
|
56
|
+
pointer-events: auto;
|
|
57
|
+
pointer-events: none;
|
|
58
|
+
transition: opacity 300ms 100ms ease-in;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.inner {
|
|
62
|
+
min-height: 100%;
|
|
63
|
+
padding: 0 10px;
|
|
64
|
+
opacity: 0;
|
|
65
|
+
transition: opacity 500ms ease-out, transform 500ms ease-out;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
&.visible {
|
|
69
|
+
pointer-events: all;
|
|
70
|
+
|
|
71
|
+
.closeBtn, .arrowBtn {
|
|
72
|
+
z-index: 99999;
|
|
73
|
+
display: flex;
|
|
74
|
+
pointer-events: all;
|
|
75
|
+
visibility: visible;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.lightBox {
|
|
79
|
+
opacity: 1;
|
|
80
|
+
pointer-events: all;
|
|
81
|
+
transition: opacity 500ms ease-out;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.inner {
|
|
85
|
+
opacity: 1;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.wrapper {
|
|
90
|
+
position: relative;
|
|
91
|
+
z-index: 2;
|
|
92
|
+
display: flex;
|
|
93
|
+
overflow: auto;
|
|
94
|
+
width: 100%;
|
|
95
|
+
height: 100%;
|
|
96
|
+
flex-direction: column;
|
|
97
|
+
padding: 0;
|
|
98
|
+
-webkit-overflow-scrolling: touch;
|
|
99
|
+
overscroll-behavior: contain;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.image, .embedContainer {
|
|
103
|
+
display: flex;
|
|
104
|
+
width: 100%;
|
|
105
|
+
height: 100%;
|
|
106
|
+
align-items: center;
|
|
107
|
+
justify-content: center;
|
|
108
|
+
padding: 10px;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.imageInner, .embed {
|
|
112
|
+
display: block;
|
|
113
|
+
width: 100%;
|
|
114
|
+
max-width: 100%;
|
|
115
|
+
height: auto;
|
|
116
|
+
max-height: 100%;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
.embed {
|
|
120
|
+
height: 100%;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.consent {
|
|
124
|
+
position: absolute;
|
|
125
|
+
bottom: 0;
|
|
126
|
+
left: 50%;
|
|
127
|
+
width: calc(100% - 20px);
|
|
128
|
+
max-width: 550px;
|
|
129
|
+
transform: translateX(-50%);
|
|
130
|
+
|
|
131
|
+
& > div {
|
|
132
|
+
border: 2px solid #f19e85;
|
|
133
|
+
border-radius: 10px 10px 0 0;
|
|
134
|
+
border-bottom: 0;
|
|
135
|
+
background-color: #123438;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
h3 {
|
|
139
|
+
font-size: 1.2rem;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
button {
|
|
143
|
+
line-height: 1;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
p {
|
|
147
|
+
line-height: 1.3;
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
}
|
|
@@ -1,3 +1,86 @@
|
|
|
1
|
-
|
|
2
|
-
@import
|
|
1
|
+
/* stylelint-disable selector-class-pattern */
|
|
2
|
+
@import 'sanitize.css';
|
|
3
|
+
@import './theme.css';
|
|
4
|
+
@import '@micromag/core/assets/css/styles.css';
|
|
5
|
+
@import '@micromag/viewer/assets/css/styles.css';
|
|
6
|
+
@import '@micromag/consent/assets/css/styles.css';
|
|
3
7
|
|
|
8
|
+
html,
|
|
9
|
+
body {
|
|
10
|
+
overscroll-behavior: none;
|
|
11
|
+
overscroll-behavior-x: none;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
html, body, #app {
|
|
15
|
+
width: 100%;
|
|
16
|
+
height: 100%;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
body {
|
|
20
|
+
background: var(--color-background, var(--color-black));
|
|
21
|
+
color: var(--color-text, var(--color-white));
|
|
22
|
+
font-family: var(--font-text);
|
|
23
|
+
font-size: 16px;
|
|
24
|
+
font-weight: 400;
|
|
25
|
+
overflow-y: scroll;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
h1,h2,h3,h4,h5,h6 {
|
|
29
|
+
font-family: var(--font-title);
|
|
30
|
+
font-weight: 700;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
p {
|
|
34
|
+
font-family: var(--font-text);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
strong {
|
|
38
|
+
font-weight: 700;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/* Hide scrollbar for IE, Edge and Firefox */
|
|
42
|
+
.hide-scrollbar {
|
|
43
|
+
-ms-overflow-style: none; /* IE and Edge */
|
|
44
|
+
scrollbar-width: none; /* Firefox */
|
|
45
|
+
|
|
46
|
+
&::-webkit-scrollbar {
|
|
47
|
+
display: none;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.modal-open {
|
|
52
|
+
overflow: hidden;
|
|
53
|
+
padding-right: 0;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.micromag-viewer-menus-menu-preview-title {
|
|
57
|
+
max-width: 100%;
|
|
58
|
+
font-family: Inter, Helvetica, arial, sans-serif;;
|
|
59
|
+
font-size: 20px;
|
|
60
|
+
font-weight: 400;
|
|
61
|
+
text-transform: uppercase;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.micromag-viewer-menus-menu-preview-titleContainer {
|
|
65
|
+
padding: 10px 20px;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
@media screen and (width >= 600px) {
|
|
69
|
+
.micromag-viewer-menus-menu-preview-title {
|
|
70
|
+
font-size: 24px;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.micromag-viewer-menus-menu-preview-titleContainer {
|
|
74
|
+
padding: 10px 30px;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
@media screen and (width >= 1200px) {
|
|
79
|
+
.micromag-viewer-menus-menu-preview-title {
|
|
80
|
+
font-size: 28px;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.micromag-viewer-menus-menu-preview-titleContainer {
|
|
84
|
+
padding: 10px 40px;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
export interface MicromagTrackingCode {
|
|
2
|
+
id: string;
|
|
3
|
+
type: string;
|
|
4
|
+
[key: string]: unknown;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export interface MicromagVideo {
|
|
8
|
+
media?: string;
|
|
9
|
+
[key: string]: unknown;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export interface MicromagComponent {
|
|
13
|
+
id: string;
|
|
14
|
+
type: string;
|
|
15
|
+
video?: MicromagVideo;
|
|
16
|
+
background?: {
|
|
17
|
+
video?: MicromagVideo;
|
|
18
|
+
[key: string]: unknown;
|
|
19
|
+
};
|
|
20
|
+
[key: string]: unknown;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export interface MicromagOrganisation {
|
|
24
|
+
slug?: string;
|
|
25
|
+
tracking?: {
|
|
26
|
+
codes?: MicromagTrackingCode[];
|
|
27
|
+
[key: string]: unknown;
|
|
28
|
+
};
|
|
29
|
+
branding?: {
|
|
30
|
+
[key: string]: unknown;
|
|
31
|
+
};
|
|
32
|
+
[key: string]: unknown;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export interface MicromagStory {
|
|
36
|
+
title?: string;
|
|
37
|
+
metadata?: {
|
|
38
|
+
[key: string]: unknown;
|
|
39
|
+
};
|
|
40
|
+
organisation?: MicromagOrganisation;
|
|
41
|
+
settings?: {
|
|
42
|
+
tracking?: {
|
|
43
|
+
codes?: MicromagTrackingCode[];
|
|
44
|
+
[key: string]: unknown;
|
|
45
|
+
};
|
|
46
|
+
[key: string]: unknown;
|
|
47
|
+
};
|
|
48
|
+
components: MicromagComponent[];
|
|
49
|
+
medias?: Record<string, Media>;
|
|
50
|
+
[key: string]: unknown;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export interface MicromagItem {
|
|
54
|
+
id: string;
|
|
55
|
+
slug: string;
|
|
56
|
+
story?: MicromagStory;
|
|
57
|
+
url?: string | null;
|
|
58
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _chalk = _interopRequireDefault(require("chalk"));
|
|
4
|
+
var _generator = _interopRequireDefault(require("../../lib/generator"));
|
|
5
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
6
|
+
module.exports = class TypescriptGenerator extends _generator.default {
|
|
7
|
+
constructor(...args) {
|
|
8
|
+
super(...args);
|
|
9
|
+
this.option('src-path', {
|
|
10
|
+
type: String,
|
|
11
|
+
desc: 'Path for source',
|
|
12
|
+
defaults: './src'
|
|
13
|
+
});
|
|
14
|
+
this.option('skip-install', {
|
|
15
|
+
type: Boolean,
|
|
16
|
+
required: false,
|
|
17
|
+
defaults: false
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
prompting() {
|
|
21
|
+
if (this.options.quiet) {
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
console.log(_chalk.default.yellow('\n----------------------'));
|
|
25
|
+
console.log('Typescript Generator');
|
|
26
|
+
console.log(_chalk.default.yellow('----------------------\n'));
|
|
27
|
+
}
|
|
28
|
+
get writing() {
|
|
29
|
+
return {
|
|
30
|
+
tsconfig() {
|
|
31
|
+
const srcPath = this.templatePath('_tsconfig.json');
|
|
32
|
+
const destPath = this.destinationPath('tsconfig.json');
|
|
33
|
+
this.fs.copyTpl(srcPath, destPath, {
|
|
34
|
+
srcPath: this.options['src-path']
|
|
35
|
+
});
|
|
36
|
+
},
|
|
37
|
+
dependencies() {
|
|
38
|
+
this.addDevDependencies({
|
|
39
|
+
'@tsconfig/create-react-app': '^2.0.9'
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
async install() {
|
|
45
|
+
if (this.options['skip-install']) {
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
await this.spawnCommand('npm', ['install']);
|
|
49
|
+
}
|
|
50
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
{
|
|
2
|
+
"extends": "@tsconfig/create-react-app/tsconfig.json",
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"strict": false
|
|
5
|
+
},
|
|
6
|
+
"include": ["<%= srcPath.replace(/\/$/, '') %>/**/*", "<%= srcPath.replace(/\/$/, '') %>/types/*.ts"],
|
|
7
|
+
"exclude": ["node_modules", "./public", "./storage", "./vendor", "./dist", "./es", "./lib"]
|
|
8
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "generator-folklore",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.33",
|
|
4
4
|
"description": "Yeoman generator for projects at Folklore",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"yeoman-generator"
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"scripts": {
|
|
10
10
|
"clean:lib": "rm -rf lib/*",
|
|
11
11
|
"clean": "npm run clean:lib",
|
|
12
|
-
"copy:dirs": "find src/ -type d | grep -E '(/templates|/instructions)$' | sed 's/src\\///g' | xargs -I{} cp -r \"./src/{}
|
|
12
|
+
"copy:dirs": "find src/ -type d | grep -E '(/templates|/instructions)$' | sed 's/src\\///g' | xargs -I{} cp -r \"./src/{}/\" \"./lib/{}/\"",
|
|
13
13
|
"compile": "../../node_modules/.bin/babel -d lib/ src/",
|
|
14
14
|
"build": "npm run compile && npm run copy:dirs",
|
|
15
15
|
"test": "echo \"Error: no test specified\" && exit 1",
|
|
@@ -40,5 +40,5 @@
|
|
|
40
40
|
"yeoman-generator": "5.9.0",
|
|
41
41
|
"yeoman-remote": "^1.0.1"
|
|
42
42
|
},
|
|
43
|
-
"gitHead": "
|
|
43
|
+
"gitHead": "5f3d4e617c80404bf8653fb486edceaa719f22cc"
|
|
44
44
|
}
|