generator-folklore 3.0.39 → 3.0.41
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 +1 -1
- package/lib/generators/eslint/index.js +1 -3
- package/lib/generators/eslint/templates/.eslint.config.js +16 -13
- package/lib/generators/html-project/index.js +5 -2
- package/lib/generators/laravel/templates/laravel/resources/views/layouts/main.blade.php +6 -6
- package/lib/generators/laravel-panneau/index.js +7 -7
- package/lib/generators/laravel-panneau/templates/app/Http/Middleware/Authenticate.php +1 -2
- package/lib/generators/laravel-panneau/templates/app/Panneau/PanneauServiceProvider.php +0 -2
- package/lib/generators/laravel-panneau/templates/{index.js → index.ts} +16 -5
- package/lib/generators/laravel-panneau/templates/resources/assets/js/components/{Panneau.jsx → Panneau.tsx} +19 -22
- package/lib/generators/laravel-panneau/templates/resources/assets/js/components/panneau/fields/{PageSlug.jsx → PageSlug.tsx} +42 -28
- package/lib/generators/laravel-panneau/templates/resources/assets/js/components/panneau/fields/PageSlugLocalized.tsx +42 -0
- package/lib/generators/laravel-project/index.js +8 -4
- package/lib/generators/laravel-project/templates/env +33 -8
- package/lib/generators/laravel-project/templates/laravel/app/Http/Middleware/Authenticate.php +30 -0
- package/lib/generators/laravel-project/templates/laravel/app/Models/User.php +1 -2
- package/lib/generators/laravel-project/templates/laravel/app/Providers/AppServiceProvider.php +7 -2
- package/lib/generators/laravel-project/templates/laravel/app/Providers/RouteServiceProvider.php +0 -27
- package/lib/generators/laravel-project/templates/laravel/bootstrap/app.php +53 -0
- package/lib/generators/laravel-project/templates/laravel/bootstrap/providers.php +9 -0
- package/lib/generators/laravel-project/templates/laravel/config/app.php +22 -114
- package/lib/generators/laravel-project/templates/laravel/config/auth.php +24 -23
- package/lib/generators/laravel-project/templates/laravel/resources/views/meta/base.blade.php +4 -4
- package/lib/generators/laravel-project/templates/laravel/resources/views/meta/opengraph.blade.php +5 -5
- package/lib/generators/lerna-package/index.js +1 -1
- package/lib/generators/lerna-repository/templates/jest.config.js +1 -1
- package/lib/generators/micromag-project/index.js +5 -5
- package/lib/generators/micromag-project/templates/App.tsx +0 -1
- package/lib/generators/micromag-project/templates/MicromagPage.tsx +0 -1
- package/lib/generators/micromag-project/templates/Routes.tsx +0 -1
- package/lib/generators/micromag-project/templates/hooks/useMicromagPreview.ts +0 -1
- package/lib/generators/micromag-project/templates/hooks/useMicromagStory.ts +0 -1
- package/lib/generators/micromag-project/templates/hooks/useMicromagVideo.ts +0 -2
- package/lib/generators/micromag-project/templates/hooks/useStoryTrackingVariables.ts +0 -2
- package/lib/generators/micromag-project/templates/index.html.ejs +1 -1
- package/lib/generators/micromag-project/templates/kiosk/Routes.tsx +0 -1
- package/lib/generators/micromag-project/templates/kiosk/micromags.ts +0 -2
- package/lib/generators/micromag-project/templates/lib/addTrackingCodesToStory.ts +0 -2
- package/lib/generators/micromag-project/templates/micromags.ts +0 -2
- package/lib/generators/micromag-project/templates/partials/Micromag.tsx +0 -2
- package/lib/generators/micromag-project/templates/partials/Thumbnail.tsx +0 -1
- package/lib/generators/micromag-project/templates/types/micromag.d.ts +6 -6
- package/lib/generators/node-project/index.js +2 -2
- package/lib/generators/node-project/templates/index.ts +0 -0
- package/lib/generators/postcss/index.js +45 -0
- package/lib/generators/postcss/templates/config.js +19 -0
- package/lib/generators/prettier/index.js +1 -1
- package/lib/generators/react-app/index.js +11 -11
- package/lib/generators/react-app/templates/_package.json +1 -0
- package/lib/generators/react-app/templates/{index.js → index.ts} +14 -3
- package/lib/generators/react-app/templates/src/components/App.tsx +9 -2
- package/lib/generators/react-app/templates/src/components/buttons/Button.tsx +1 -3
- package/lib/generators/react-app/templates/src/components/menus/Menu.tsx +26 -23
- package/lib/generators/react-app/templates/src/components/partials/PageMeta.tsx +5 -5
- package/lib/generators/react-app/templates/src/contexts/TrackingContext.tsx +45 -0
- package/lib/generators/react-app/templates/src/lib/Tracking.ts +39 -0
- package/lib/generators/react-app/templates/src/lib/utils.ts +6 -0
- package/lib/generators/react-app/templates/types/base.d.ts +19 -14
- package/lib/generators/react-app/templates/types/blocks.d.ts +8 -8
- package/lib/generators/react-app/templates/types/forms.d.ts +12 -12
- package/lib/generators/react-app/templates/types/global.d.ts +17 -12
- package/lib/generators/react-app/templates/types/index.ts +0 -0
- package/lib/generators/react-app/templates/types/metadata.d.ts +6 -6
- package/lib/generators/react-app/templates/types/typings.d.ts +13 -0
- package/lib/generators/rollup/templates/config.js +1 -1
- package/lib/generators/stylelint/index.js +2 -2
- package/lib/generators/typescript/index.js +10 -1
- package/lib/generators/typescript/templates/_tsconfig.json +3 -2
- package/package.json +2 -2
- package/lib/generators/laravel-panneau/templates/resources/assets/js/components/panneau/fields/PageSlugLocalized.jsx +0 -43
- package/lib/generators/laravel-project/templates/laravel/app/Actions/Fortify/PasswordValidationRules.php +0 -18
- package/lib/generators/laravel-project/templates/laravel/app/Providers/TelescopeServiceProvider.php +0 -67
- package/lib/generators/react-app/templates/src/lib/utils.js +0 -14
- package/lib/generators/react-app/templates/types/index.d.ts +0 -4
- /package/lib/generators/laravel-panneau/templates/resources/assets/js/components/panneau/fields/{index.js → index.ts} +0 -0
- /package/lib/generators/{node-project/templates/index.js → laravel-panneau/templates/resources/assets/styles/panneau.css} +0 -0
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _chalk = _interopRequireDefault(require("chalk"));
|
|
8
|
+
var _generator = _interopRequireDefault(require("../../lib/generator"));
|
|
9
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
|
+
class PostcssGenerator extends _generator.default {
|
|
11
|
+
constructor(...args) {
|
|
12
|
+
super(...args);
|
|
13
|
+
}
|
|
14
|
+
prompting() {
|
|
15
|
+
if (this.options.quiet) {
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
console.log(_chalk.default.yellow('\n----------------------'));
|
|
19
|
+
console.log('PostCSS Generator');
|
|
20
|
+
console.log(_chalk.default.yellow('----------------------\n'));
|
|
21
|
+
}
|
|
22
|
+
get writing() {
|
|
23
|
+
return {
|
|
24
|
+
config() {
|
|
25
|
+
this.fs.copyTpl(this.templatePath('config.js'), this.destinationPath('postcss.config.js'));
|
|
26
|
+
},
|
|
27
|
+
dependencies() {
|
|
28
|
+
this.addDevDependencies({
|
|
29
|
+
'postcss-custom-media': '^10.0.0',
|
|
30
|
+
'postcss-import': '^16.0.0',
|
|
31
|
+
'postcss-normalize': '^10.0.1',
|
|
32
|
+
'postcss-preset-env': '^9.0.0',
|
|
33
|
+
'@csstools/postcss-global-data': '^2.0.0'
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
async install() {
|
|
39
|
+
if (this.options['skip-install']) {
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
await this.spawnCommand('npm', ['install']);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
exports.default = PostcssGenerator;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import postcssGlobalData from '@csstools/postcss-global-data';
|
|
2
|
+
import postcssCustomMedia from 'postcss-custom-media';
|
|
3
|
+
import postcssImport from 'postcss-import';
|
|
4
|
+
import postcssNormalize from 'postcss-normalize';
|
|
5
|
+
import postcssPresetEnv from 'postcss-preset-env';
|
|
6
|
+
|
|
7
|
+
export default {
|
|
8
|
+
plugins: [
|
|
9
|
+
postcssImport({}),
|
|
10
|
+
// postcssGlobalData({
|
|
11
|
+
// files: [
|
|
12
|
+
// 'src/styles/theme/variables.css',
|
|
13
|
+
// ],
|
|
14
|
+
// }),
|
|
15
|
+
postcssCustomMedia({}),
|
|
16
|
+
postcssPresetEnv({}),
|
|
17
|
+
postcssNormalize({}),
|
|
18
|
+
],
|
|
19
|
+
};
|
|
@@ -31,7 +31,7 @@ class PrettierGenerator extends _generator.default {
|
|
|
31
31
|
this.addDevDependencies({
|
|
32
32
|
prettier: '^3.6.2',
|
|
33
33
|
'@prettier/plugin-php': '^0.24.0',
|
|
34
|
-
'@trivago/prettier-plugin-sort-imports': '^
|
|
34
|
+
'@trivago/prettier-plugin-sort-imports': '^6.0.0',
|
|
35
35
|
'stylelint-prettier': '^5.0.3'
|
|
36
36
|
});
|
|
37
37
|
}
|
|
@@ -75,7 +75,7 @@ class ReactAppGenerator extends _generator.default {
|
|
|
75
75
|
},
|
|
76
76
|
index() {
|
|
77
77
|
const jsPath = this.options.path;
|
|
78
|
-
this.fs.copyTpl(this.templatePath('index.
|
|
78
|
+
this.fs.copyTpl(this.templatePath('index.ts'), this.destinationPath(_path.default.join(jsPath, 'index.ts')));
|
|
79
79
|
},
|
|
80
80
|
styles() {
|
|
81
81
|
const templateData = {};
|
|
@@ -100,18 +100,18 @@ class ReactAppGenerator extends _generator.default {
|
|
|
100
100
|
},
|
|
101
101
|
dependencies() {
|
|
102
102
|
this.addDependencies({
|
|
103
|
-
react: '^
|
|
104
|
-
'react-dom': '^
|
|
105
|
-
'react-intl': '^
|
|
103
|
+
react: '^19.2.0',
|
|
104
|
+
'react-dom': '^19.2.0',
|
|
105
|
+
'react-intl': '^10.0.0',
|
|
106
106
|
wouter: '^3.7.1',
|
|
107
|
-
'react-helmet': '^6.1.0',
|
|
108
107
|
classnames: '^2.5.1',
|
|
109
|
-
'@folklore/
|
|
110
|
-
'@folklore/
|
|
111
|
-
'@folklore/
|
|
112
|
-
'@folklore/
|
|
113
|
-
'@folklore/
|
|
114
|
-
'@folklore/
|
|
108
|
+
'@folklore/auth': '^0.0.14',
|
|
109
|
+
'@folklore/routes': '^0.2.47',
|
|
110
|
+
'@folklore/fonts': '^0.0.20',
|
|
111
|
+
'@folklore/forms': '^0.0.35',
|
|
112
|
+
'@folklore/fetch': '^0.1.24',
|
|
113
|
+
'@folklore/hooks': '^0.0.91',
|
|
114
|
+
'@folklore/tracking': '^0.0.36',
|
|
115
115
|
// Polyfills
|
|
116
116
|
intl: '^1.2.5',
|
|
117
117
|
'@formatjs/intl-locale': '^4.2.11',
|
|
@@ -4,11 +4,22 @@ import { createRoot } from 'react-dom/client';
|
|
|
4
4
|
import App from './components/App';
|
|
5
5
|
import shouldPolyfill from './polyfills/should';
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
interface Props {
|
|
8
|
+
isPanneau?: boolean;
|
|
9
|
+
[key: string]: unknown;
|
|
9
10
|
}
|
|
10
11
|
|
|
11
|
-
|
|
12
|
+
declare global {
|
|
13
|
+
interface Window {
|
|
14
|
+
props?: Props;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
function getAppProps(): Props {
|
|
19
|
+
return window.props || ({} as Props);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
function renderApp(props: Props) {
|
|
12
23
|
const element = document.getElementById('app');
|
|
13
24
|
const app = createElement(App, props);
|
|
14
25
|
const strictMode = createElement(StrictMode, {}, app);
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
+
import { AuthProvider } from '@folklore/auth';
|
|
1
2
|
import { type RoutesMap, RoutesProvider } from '@folklore/routes';
|
|
2
3
|
import { IntlProvider } from 'react-intl';
|
|
3
4
|
import { Router } from 'wouter';
|
|
4
5
|
|
|
5
6
|
import Routes from './Routes';
|
|
7
|
+
import TrackingProvider from '../contexts/TrackingContext';
|
|
6
8
|
|
|
7
9
|
const defaultRoutes: RoutesMap = { home: '/' };
|
|
8
10
|
|
|
@@ -11,16 +13,21 @@ interface AppProps {
|
|
|
11
13
|
locale?: string;
|
|
12
14
|
messages?: Record<string, Record<string, string>> | Record<string, string>;
|
|
13
15
|
} | null;
|
|
16
|
+
user?: User | null;
|
|
14
17
|
routes?: RoutesMap;
|
|
15
18
|
}
|
|
16
19
|
|
|
17
|
-
function App({ intl = null, routes = defaultRoutes }: AppProps) {
|
|
20
|
+
function App({ intl = null, routes = defaultRoutes, user = null }: AppProps) {
|
|
18
21
|
const { locale = 'fr', messages = {} } = intl || {};
|
|
19
22
|
return (
|
|
20
23
|
<IntlProvider locale={locale} messages={messages[locale] || messages}>
|
|
21
24
|
<Router>
|
|
22
25
|
<RoutesProvider routes={routes}>
|
|
23
|
-
<
|
|
26
|
+
<AuthProvider user={user}>
|
|
27
|
+
<TrackingProvider>
|
|
28
|
+
<Routes />
|
|
29
|
+
</TrackingProvider>
|
|
30
|
+
</AuthProvider>
|
|
24
31
|
</RoutesProvider>
|
|
25
32
|
</Router>
|
|
26
33
|
</IntlProvider>
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import { ReactNode, MouseEvent } from 'react';
|
|
2
1
|
import classNames from 'classnames';
|
|
2
|
+
import { ReactNode, MouseEvent } from 'react';
|
|
3
3
|
import { Link } from 'wouter';
|
|
4
4
|
|
|
5
|
-
import { IntlMessage } from '../../types';
|
|
6
|
-
|
|
7
5
|
import styles from '<%= getRelativeStylesPath('components/buttons/Button.jsx', 'buttons/button.module.css') %>';
|
|
8
6
|
|
|
9
7
|
type Label = IntlMessage | ReactNode;
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import classNames from 'classnames';
|
|
2
2
|
import { Link } from 'wouter';
|
|
3
3
|
|
|
4
|
-
import { MenuItem } from '../../types';
|
|
5
|
-
|
|
6
4
|
import styles from '<%= getRelativeStylesPath('components/menus/Menu.jsx', 'menus/menu.module.css') %>';
|
|
7
5
|
|
|
8
6
|
|
|
@@ -22,27 +20,32 @@ function Menu({ items = null, className = null }: MenuProps) {
|
|
|
22
20
|
])}
|
|
23
21
|
>
|
|
24
22
|
<ul className={styles.items}>
|
|
25
|
-
{(items || []).map(
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
23
|
+
{(items || []).map(
|
|
24
|
+
(
|
|
25
|
+
{ label, url, active = false, external = false, target = '_blank' },
|
|
26
|
+
index,
|
|
27
|
+
) => (
|
|
28
|
+
<li
|
|
29
|
+
className={classNames([
|
|
30
|
+
styles.item,
|
|
31
|
+
{
|
|
32
|
+
[styles.active]: active,
|
|
33
|
+
},
|
|
34
|
+
])}
|
|
35
|
+
key={`item-${index}`}
|
|
36
|
+
>
|
|
37
|
+
{external ? (
|
|
38
|
+
<a href={url} target={target} className={styles.link}>
|
|
39
|
+
{label}
|
|
40
|
+
</a>
|
|
41
|
+
) : (
|
|
42
|
+
<Link href={url} className={styles.link}>
|
|
43
|
+
{label}
|
|
44
|
+
</Link>
|
|
45
|
+
)}
|
|
46
|
+
</li>
|
|
47
|
+
),
|
|
48
|
+
)}
|
|
46
49
|
</ul>
|
|
47
50
|
</nav>
|
|
48
51
|
);
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { useIntl } from 'react-intl';
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { type MessageDescriptor, useIntl } from 'react-intl';
|
|
3
3
|
|
|
4
4
|
import { isMessage } from '../../lib/utils';
|
|
5
5
|
|
|
6
|
-
function PageMeta({ title = null }: { title:
|
|
6
|
+
function PageMeta({ title = null }: { title: ReactNode | MessageDescriptor | null }) {
|
|
7
7
|
const intl = useIntl();
|
|
8
8
|
return (
|
|
9
|
-
|
|
9
|
+
<>
|
|
10
10
|
<title>{isMessage(title) ? intl.formatMessage(title) : title}</title>
|
|
11
|
-
|
|
11
|
+
</>
|
|
12
12
|
);
|
|
13
13
|
}
|
|
14
14
|
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { useUser } from '@folklore/auth';
|
|
2
|
+
import { TrackingContainer } from '@folklore/tracking';
|
|
3
|
+
import createDebug from 'debug';
|
|
4
|
+
import { ReactNode, useEffect, useMemo } from 'react';
|
|
5
|
+
|
|
6
|
+
import Tracking from '../lib/Tracking';
|
|
7
|
+
|
|
8
|
+
const debug = createDebug('app:tracking');
|
|
9
|
+
|
|
10
|
+
interface TrackingProviderProps {
|
|
11
|
+
children: ReactNode;
|
|
12
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
13
|
+
variables?: Record<string, any> | null;
|
|
14
|
+
disabled?: boolean;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export function TrackingProvider({
|
|
18
|
+
children,
|
|
19
|
+
variables = null,
|
|
20
|
+
disabled = false,
|
|
21
|
+
}: TrackingProviderProps) {
|
|
22
|
+
const user = useUser();
|
|
23
|
+
const tracking = useMemo(
|
|
24
|
+
() =>
|
|
25
|
+
new Tracking({
|
|
26
|
+
user,
|
|
27
|
+
disabled,
|
|
28
|
+
}),
|
|
29
|
+
[],
|
|
30
|
+
);
|
|
31
|
+
|
|
32
|
+
useEffect(() => {
|
|
33
|
+
if (variables !== null) {
|
|
34
|
+
tracking.setVariables(variables);
|
|
35
|
+
}
|
|
36
|
+
}, [variables]);
|
|
37
|
+
|
|
38
|
+
useEffect(() => {
|
|
39
|
+
tracking.setUser(user);
|
|
40
|
+
}, [user]);
|
|
41
|
+
|
|
42
|
+
return <TrackingContainer tracking={tracking}>{children}</TrackingContainer>;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export default TrackingProvider;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { Tracking as BaseTracking } from '@folklore/tracking';
|
|
2
|
+
|
|
3
|
+
class Tracking extends BaseTracking {
|
|
4
|
+
user: User | null;
|
|
5
|
+
identified: boolean;
|
|
6
|
+
options: BaseTracking['options'] & {
|
|
7
|
+
user?: User | null;
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
constructor(opts = {}) {
|
|
11
|
+
super(opts);
|
|
12
|
+
|
|
13
|
+
this.user = null;
|
|
14
|
+
this.identified = false;
|
|
15
|
+
|
|
16
|
+
const { user = null } = this.options;
|
|
17
|
+
if (user !== null) {
|
|
18
|
+
this.setUser(user);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
setUser(user) {
|
|
23
|
+
if (user === this.user && this.identified) {
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
this.user = user;
|
|
28
|
+
this.identified = true;
|
|
29
|
+
|
|
30
|
+
this.pushEventNow('identify', {
|
|
31
|
+
identified: true,
|
|
32
|
+
userId: user !== null ? user.id : null,
|
|
33
|
+
user_id: user !== null ? user.id : null,
|
|
34
|
+
user,
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export default Tracking;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import isObject from 'lodash/isObject';
|
|
2
|
+
import { type MessageDescriptor } from 'react-intl';
|
|
3
|
+
|
|
4
|
+
export function isMessage(message: MessageDescriptor | unknown): message is MessageDescriptor {
|
|
5
|
+
return message !== null && isObject(message) && typeof message.id !== 'undefined';
|
|
6
|
+
}
|
|
@@ -1,37 +1,39 @@
|
|
|
1
|
-
|
|
1
|
+
type ReactNode = import('react').ReactNode;
|
|
2
|
+
|
|
3
|
+
interface IntlMessage {
|
|
2
4
|
id?: string;
|
|
3
5
|
defaultMessage?: string;
|
|
4
6
|
}
|
|
5
7
|
|
|
6
|
-
|
|
8
|
+
interface Labels {
|
|
7
9
|
[key: string]: string;
|
|
8
10
|
}
|
|
9
11
|
|
|
10
|
-
|
|
12
|
+
interface Theme {
|
|
11
13
|
name: string;
|
|
12
14
|
}
|
|
13
15
|
|
|
14
|
-
|
|
16
|
+
interface ImageSize {
|
|
15
17
|
id: string;
|
|
16
18
|
url: string;
|
|
17
19
|
width: number;
|
|
18
20
|
height: number;
|
|
19
21
|
}
|
|
20
22
|
|
|
21
|
-
|
|
23
|
+
interface Source {
|
|
22
24
|
id: string;
|
|
23
25
|
mime?: string | null;
|
|
24
26
|
url: string;
|
|
25
27
|
size?: number | null;
|
|
26
28
|
}
|
|
27
29
|
|
|
28
|
-
|
|
30
|
+
interface Embed {
|
|
29
31
|
provider: string;
|
|
30
32
|
iframeUrl?: string;
|
|
31
33
|
html?: string;
|
|
32
34
|
}
|
|
33
35
|
|
|
34
|
-
|
|
36
|
+
interface Media {
|
|
35
37
|
id: string;
|
|
36
38
|
type: string;
|
|
37
39
|
url: string;
|
|
@@ -41,31 +43,33 @@ export interface Media {
|
|
|
41
43
|
files?: Record<string, Source>;
|
|
42
44
|
}
|
|
43
45
|
|
|
44
|
-
|
|
46
|
+
interface Image extends Media, ImageSize {
|
|
45
47
|
type: 'image';
|
|
46
48
|
sizes: ImageSize[];
|
|
47
49
|
credits?: string;
|
|
48
50
|
}
|
|
49
51
|
|
|
50
|
-
|
|
52
|
+
interface Audio extends Media {
|
|
51
53
|
type: 'audio';
|
|
52
54
|
}
|
|
53
55
|
|
|
54
|
-
|
|
56
|
+
interface Video extends Media {
|
|
55
57
|
type: 'video';
|
|
56
58
|
embed?: Embed;
|
|
57
59
|
sources?: Source[];
|
|
58
60
|
}
|
|
59
61
|
|
|
60
|
-
|
|
62
|
+
interface MenuItem {
|
|
61
63
|
id: string;
|
|
62
|
-
|
|
64
|
+
url: string;
|
|
65
|
+
active?: boolean;
|
|
63
66
|
external?: boolean;
|
|
67
|
+
target?: string;
|
|
64
68
|
label?: string | ReactNode;
|
|
65
69
|
icon?: ReactNode;
|
|
66
70
|
}
|
|
67
71
|
|
|
68
|
-
|
|
72
|
+
interface Page {
|
|
69
73
|
id: string;
|
|
70
74
|
title?: string | null;
|
|
71
75
|
slug?: string | null;
|
|
@@ -74,7 +78,8 @@ export interface Page {
|
|
|
74
78
|
image?: Image | null;
|
|
75
79
|
}
|
|
76
80
|
|
|
77
|
-
|
|
81
|
+
interface User {
|
|
78
82
|
id: string;
|
|
83
|
+
[key: string]: unknown;
|
|
79
84
|
}
|
|
80
85
|
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
|
|
1
|
+
interface BaseBlock {
|
|
2
2
|
id: string;
|
|
3
3
|
uuid?: string;
|
|
4
4
|
type: string;
|
|
5
5
|
placement?: string;
|
|
6
6
|
}
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
interface TextBlock extends BaseBlock {
|
|
9
9
|
type: 'text';
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
interface ImageBlock extends BaseBlock {
|
|
13
13
|
type: 'image';
|
|
14
14
|
media: {
|
|
15
15
|
url: string;
|
|
@@ -19,18 +19,18 @@ export interface ImageBlock extends BaseBlock {
|
|
|
19
19
|
caption?: string;
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
-
|
|
22
|
+
interface HeadingBlock extends BaseBlock {
|
|
23
23
|
type: 'heading';
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
|
|
26
|
+
interface CardsBlock extends BaseBlock {
|
|
27
27
|
type: 'cards';
|
|
28
28
|
cards: Card[];
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
|
|
31
|
+
type Block = TextBlock | ImageBlock | HeadingBlock | CardsBlock | BaseBlock;
|
|
32
32
|
|
|
33
|
-
|
|
33
|
+
interface BaseCard {
|
|
34
34
|
id: string;
|
|
35
35
|
type: string;
|
|
36
36
|
title?: string | null;
|
|
@@ -38,4 +38,4 @@ export interface BaseCard {
|
|
|
38
38
|
image?: Image | null;
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
-
|
|
41
|
+
type Card = BaseCard;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
interface BaseField {
|
|
2
2
|
name: string;
|
|
3
3
|
type: string;
|
|
4
4
|
component?: string;
|
|
@@ -7,49 +7,49 @@ export interface BaseField {
|
|
|
7
7
|
image?: Image | null;
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
interface FieldOption {
|
|
11
11
|
value: string;
|
|
12
12
|
label: string;
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
interface OptionsField extends BaseField {
|
|
16
16
|
type: 'options';
|
|
17
17
|
options: FieldOption[];
|
|
18
18
|
multiple?: boolean;
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
interface ButtonsField extends OptionsField {
|
|
22
22
|
type: 'buttons';
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
interface SelectField extends OptionsField {
|
|
26
26
|
type: 'select';
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
interface TextField extends BaseField {
|
|
30
30
|
type: 'text';
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
-
|
|
33
|
+
type FormBaseField = OptionsField | TextField | BaseField;
|
|
34
34
|
|
|
35
|
-
|
|
35
|
+
interface GroupField extends BaseField {
|
|
36
36
|
type: 'group';
|
|
37
37
|
fields: FormBaseField[];
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
-
|
|
40
|
+
type FormField = FormBaseField | GroupField;
|
|
41
41
|
|
|
42
|
-
|
|
42
|
+
interface Form {
|
|
43
43
|
id: string;
|
|
44
44
|
title?: string;
|
|
45
45
|
fields: FormField[];
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
-
|
|
48
|
+
interface FormErrors {
|
|
49
49
|
[fieldName: string]: string[] | null;
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
-
|
|
52
|
+
interface FormSnippet {
|
|
53
53
|
id: string;
|
|
54
54
|
title?: string;
|
|
55
55
|
}
|
|
@@ -1,28 +1,33 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
const value: any;
|
|
1
|
+
declare module '*.png' {
|
|
2
|
+
const value: string;
|
|
4
3
|
export default value;
|
|
5
4
|
}
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
|
|
6
|
+
declare module '*.mp3' {
|
|
7
|
+
const value: string;
|
|
8
8
|
export default value;
|
|
9
9
|
}
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
|
|
11
|
+
declare module '*.mp4' {
|
|
12
|
+
const value: string;
|
|
12
13
|
export default value;
|
|
13
14
|
}
|
|
14
|
-
|
|
15
|
-
|
|
15
|
+
|
|
16
|
+
declare module '*.jpg' {
|
|
17
|
+
const value: string;
|
|
16
18
|
export default value;
|
|
17
|
-
export const ReactComponent: any;
|
|
18
19
|
}
|
|
19
20
|
|
|
20
|
-
declare module '*.
|
|
21
|
+
declare module '*.svg' {
|
|
22
|
+
import { type ElementType } from 'react';
|
|
21
23
|
const value: string;
|
|
22
24
|
export default value;
|
|
25
|
+
export const ReactComponent: ElementType;
|
|
23
26
|
}
|
|
24
27
|
|
|
25
28
|
interface Window {
|
|
26
|
-
cioanalytics:
|
|
29
|
+
cioanalytics: {
|
|
30
|
+
[key: string]: unknown;
|
|
31
|
+
};
|
|
27
32
|
cioanalyticsReady?: () => void;
|
|
28
33
|
}
|
|
File without changes
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
|
|
1
|
+
interface Microformat {
|
|
2
2
|
'@context': string;
|
|
3
3
|
'@type': string;
|
|
4
4
|
identifier: string;
|
|
5
5
|
[key: string]: unknown;
|
|
6
6
|
}
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
interface Taxonomy {
|
|
9
9
|
id: string;
|
|
10
10
|
type: string;
|
|
11
11
|
label: string;
|
|
12
12
|
slug: string;
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
interface Category extends Taxonomy {
|
|
16
16
|
type: 'category';
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
interface Author {
|
|
20
20
|
id: string;
|
|
21
21
|
slug: string;
|
|
22
22
|
name: string;
|
|
@@ -24,13 +24,13 @@ export interface Author {
|
|
|
24
24
|
isPerson?: boolean;
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
|
|
27
|
+
interface Credit {
|
|
28
28
|
author?: Author | null;
|
|
29
29
|
name?: string | null;
|
|
30
30
|
role?: string;
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
-
|
|
33
|
+
interface Organisation {
|
|
34
34
|
id: string;
|
|
35
35
|
name: string;
|
|
36
36
|
}
|