@digigov/nextjs 1.2.0-16da9467 → 1.2.0-2271444d
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/App.js +35 -0
- package/Document.js +20 -0
- package/Image.js +12 -0
- package/Link.js +38 -0
- package/hooks.js +6 -0
- package/i18n.js +13 -0
- package/index.js +1 -2
- package/package.json +27 -16
- package/App/index.js +0 -42
- package/App/package.json +0 -6
- package/App.js.map +0 -7
- package/Document/index.js +0 -27
- package/Document/package.json +0 -6
- package/Document.js.map +0 -7
- package/Image/index.js +0 -12
- package/Image/package.json +0 -6
- package/Image.js.map +0 -7
- package/Link/index.js +0 -33
- package/Link/package.json +0 -6
- package/Link.js.map +0 -7
- package/cjs/App/index.js +0 -71
- package/cjs/App.js.map +0 -7
- package/cjs/Document/index.js +0 -56
- package/cjs/Document.js.map +0 -7
- package/cjs/Image/index.js +0 -41
- package/cjs/Image.js.map +0 -7
- package/cjs/Link/index.js +0 -62
- package/cjs/Link.js.map +0 -7
- package/cjs/hooks/index.js +0 -32
- package/cjs/hooks.js.map +0 -7
- package/cjs/i18n/index.js +0 -47
- package/cjs/i18n.js.map +0 -7
- package/cjs/index.js +0 -1
- package/cjs/index.js.map +0 -7
- package/hooks/index.js +0 -9
- package/hooks/package.json +0 -6
- package/hooks.js.map +0 -7
- package/i18n/index.js +0 -18
- package/i18n/package.json +0 -6
- package/i18n.js.map +0 -7
- package/index.js.map +0 -7
package/App.js
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import react from "react";
|
|
2
|
+
import app from "next/app.js";
|
|
3
|
+
import head from "next/head.js";
|
|
4
|
+
import { useRouter } from "next/router.js";
|
|
5
|
+
import { withTranslation } from "react-i18next";
|
|
6
|
+
import Link from "./Link.js";
|
|
7
|
+
import App, { StaticApp } from "@digigov/ui/app/App.js";
|
|
8
|
+
import { I18NProvider } from "@digigov/ui/i18n/index.js";
|
|
9
|
+
import { LinkProvider } from "@digigov/ui/navigation/Link/index.js";
|
|
10
|
+
class DigiGOVNextAppClass extends app {
|
|
11
|
+
render() {
|
|
12
|
+
const { Component, pageProps, t, i18n, ssr = false, router } = this.props;
|
|
13
|
+
const { locale } = router;
|
|
14
|
+
if (locale && i18n.language != locale) i18n.changeLanguage(locale);
|
|
15
|
+
return /*#__PURE__*/ react.createElement(I18NProvider, {
|
|
16
|
+
t: (str)=>'string' == typeof str ? t(str) : str,
|
|
17
|
+
i18n: i18n
|
|
18
|
+
}, /*#__PURE__*/ react.createElement(LinkProvider, {
|
|
19
|
+
component: Link
|
|
20
|
+
}, /*#__PURE__*/ react.createElement(head, null, /*#__PURE__*/ react.createElement("meta", {
|
|
21
|
+
name: "viewport",
|
|
22
|
+
content: "minimum-scale=1, initial-scale=1, width=device-width"
|
|
23
|
+
})), ssr ? /*#__PURE__*/ react.createElement(App, null, /*#__PURE__*/ react.createElement(Component, pageProps)) : /*#__PURE__*/ react.createElement(StaticApp, null, /*#__PURE__*/ react.createElement(Component, pageProps))));
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
const DigiGOVNextAppWithTranslation = withTranslation()(DigiGOVNextAppClass);
|
|
27
|
+
const DigiGOVNextApp = (props)=>{
|
|
28
|
+
const router = useRouter();
|
|
29
|
+
return /*#__PURE__*/ react.createElement(DigiGOVNextAppWithTranslation, {
|
|
30
|
+
...props,
|
|
31
|
+
router: router
|
|
32
|
+
});
|
|
33
|
+
};
|
|
34
|
+
const src_App = DigiGOVNextApp;
|
|
35
|
+
export { src_App as default };
|
package/Document.js
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import react from "react";
|
|
2
|
+
import next_document, { Head, Html, Main, NextScript } from "next/document.js";
|
|
3
|
+
class DigiGOVDocument extends next_document {
|
|
4
|
+
render() {
|
|
5
|
+
return /*#__PURE__*/ react.createElement(Html, null, /*#__PURE__*/ react.createElement(Head, null, /*#__PURE__*/ react.createElement("script", {
|
|
6
|
+
type: "text/javascript",
|
|
7
|
+
dangerouslySetInnerHTML: {
|
|
8
|
+
__html: `if (window.document.documentMode) alert('Internet Explorer is not supported. Please use a modern browser!');
|
|
9
|
+
`
|
|
10
|
+
}
|
|
11
|
+
})), /*#__PURE__*/ react.createElement("body", null, /*#__PURE__*/ react.createElement(Main, null), /*#__PURE__*/ react.createElement(NextScript, null)));
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
DigiGOVDocument.getInitialProps = async (ctx)=>{
|
|
15
|
+
const initialProps = await next_document.getInitialProps(ctx);
|
|
16
|
+
return {
|
|
17
|
+
...initialProps
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
export { DigiGOVDocument as default };
|
package/Image.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import react from "react";
|
|
2
|
+
import next_image from "next/image.js";
|
|
3
|
+
import { useBasePath } from "./hooks.js";
|
|
4
|
+
const Image = ({ src, ...rest })=>{
|
|
5
|
+
const basePathSrc = useBasePath('string' == typeof src ? src : '');
|
|
6
|
+
return /*#__PURE__*/ react.createElement(next_image, {
|
|
7
|
+
src: 'string' == typeof src ? basePathSrc : src,
|
|
8
|
+
...rest
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
const src_Image = Image;
|
|
12
|
+
export { src_Image as default };
|
package/Link.js
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import react, { useEffect } from "react";
|
|
2
|
+
import next_link from "next/link.js";
|
|
3
|
+
import { useRouter } from "next/router.js";
|
|
4
|
+
import { Link } from "@digigov/ui/navigation/Link/index.js";
|
|
5
|
+
const NextLink = (props, ref)=>{
|
|
6
|
+
const { href, as, ...other } = props;
|
|
7
|
+
const isExternalLink = /^(?:[a-z]+:)?\/\/|\.pdf|\.docx?|\.xlsx?|^mailto:/i.test(href || '') || '_blank' === other.target;
|
|
8
|
+
const router = useRouter();
|
|
9
|
+
useEffect(()=>{
|
|
10
|
+
const path = router.asPath;
|
|
11
|
+
if (path.includes('#')) setTimeout(()=>{
|
|
12
|
+
const id = path.replace('#', '');
|
|
13
|
+
const el = document.getElementById(id);
|
|
14
|
+
if (el) window.scroll({
|
|
15
|
+
top: scrollY + el.getBoundingClientRect().top,
|
|
16
|
+
behavior: 'smooth'
|
|
17
|
+
});
|
|
18
|
+
}, 600);
|
|
19
|
+
}, [
|
|
20
|
+
router.asPath
|
|
21
|
+
]);
|
|
22
|
+
if (isExternalLink) return /*#__PURE__*/ react.createElement(Link, {
|
|
23
|
+
ref: ref,
|
|
24
|
+
href: href || '#',
|
|
25
|
+
...other
|
|
26
|
+
}, props.children);
|
|
27
|
+
return /*#__PURE__*/ react.createElement(next_link, {
|
|
28
|
+
href: href || '#',
|
|
29
|
+
as: void 0,
|
|
30
|
+
...other
|
|
31
|
+
}, /*#__PURE__*/ react.createElement(Link, {
|
|
32
|
+
ref: ref,
|
|
33
|
+
...other,
|
|
34
|
+
as: as
|
|
35
|
+
}, props.children));
|
|
36
|
+
};
|
|
37
|
+
const src_Link = /*#__PURE__*/ react.forwardRef(NextLink);
|
|
38
|
+
export { src_Link as default };
|
package/hooks.js
ADDED
package/i18n.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import i18next from "i18next";
|
|
2
|
+
import { initReactI18next } from "react-i18next";
|
|
3
|
+
function initI18n(resources, language = 'el') {
|
|
4
|
+
return i18next.use(initReactI18next).init({
|
|
5
|
+
resources: resources,
|
|
6
|
+
lng: language,
|
|
7
|
+
keySeparator: '.',
|
|
8
|
+
interpolation: {
|
|
9
|
+
escapeValue: false
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
export { initI18n as default };
|
package/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,15 +1,35 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@digigov/nextjs",
|
|
3
|
-
"version": "1.2.0-
|
|
3
|
+
"version": "1.2.0-2271444d",
|
|
4
4
|
"description": "next specific utilities for @digigov apps",
|
|
5
5
|
"author": "GRNET Developers <devs@lists.grnet.gr>",
|
|
6
6
|
"license": "BSD-2-Clause",
|
|
7
|
-
"
|
|
8
|
-
|
|
7
|
+
"exports": {
|
|
8
|
+
".": {
|
|
9
|
+
"types": "./index.d.ts",
|
|
10
|
+
"import": "./index.js"
|
|
11
|
+
},
|
|
12
|
+
"./src/*": "./src/*",
|
|
13
|
+
"./*": {
|
|
14
|
+
"types": [
|
|
15
|
+
"./*.d.ts",
|
|
16
|
+
"./*/index.d.ts"
|
|
17
|
+
],
|
|
18
|
+
"import": [
|
|
19
|
+
"./*",
|
|
20
|
+
"./*/index.js"
|
|
21
|
+
]
|
|
22
|
+
},
|
|
23
|
+
"./*.js": {
|
|
24
|
+
"types": "./*.d.ts",
|
|
25
|
+
"import": "./*.js"
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
"type": "module",
|
|
9
29
|
"peerDependencies": {
|
|
10
|
-
"@digigov/ui": "2.0.0-
|
|
11
|
-
"@digigov/react-core": "2.0.0-
|
|
12
|
-
"clsx": "
|
|
30
|
+
"@digigov/ui": "2.0.0-2271444d",
|
|
31
|
+
"@digigov/react-core": "2.0.0-2271444d",
|
|
32
|
+
"clsx": "2.1.1",
|
|
13
33
|
"i18next": "19.1.0",
|
|
14
34
|
"react": "^18.3.0 || ^19.1.0",
|
|
15
35
|
"react-dom": "^18.3.0 || ^19.1.0",
|
|
@@ -17,14 +37,5 @@
|
|
|
17
37
|
"react-i18next": "11.3.3"
|
|
18
38
|
},
|
|
19
39
|
"gitHead": "7237a2d58c6b30979837579e51251543aff0c240",
|
|
20
|
-
"
|
|
21
|
-
".": {
|
|
22
|
-
"require": "./index.js"
|
|
23
|
-
},
|
|
24
|
-
"./*": {
|
|
25
|
-
"require": "./cjs/*"
|
|
26
|
-
}
|
|
27
|
-
},
|
|
28
|
-
"private": false,
|
|
29
|
-
"typings": "./index.d.ts"
|
|
40
|
+
"private": false
|
|
30
41
|
}
|
package/App/index.js
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import App from "next/app";
|
|
3
|
-
import Head from "next/head";
|
|
4
|
-
import { useRouter } from "next/router";
|
|
5
|
-
import { withTranslation } from "react-i18next";
|
|
6
|
-
import NextLink from "@digigov/nextjs/Link";
|
|
7
|
-
import DigiGOVApp, { StaticApp } from "@digigov/ui/app/App";
|
|
8
|
-
import { I18NProvider } from "@digigov/ui/i18n";
|
|
9
|
-
import { LinkProvider } from "@digigov/ui/navigation/Link";
|
|
10
|
-
class DigiGOVNextAppClass extends App {
|
|
11
|
-
render() {
|
|
12
|
-
const { Component, pageProps, t, i18n: i18n2, ssr = false, router } = this.props;
|
|
13
|
-
const { locale } = router;
|
|
14
|
-
if (locale && i18n2.language != locale) {
|
|
15
|
-
i18n2.changeLanguage(locale);
|
|
16
|
-
}
|
|
17
|
-
return /* @__PURE__ */ React.createElement(
|
|
18
|
-
I18NProvider,
|
|
19
|
-
{
|
|
20
|
-
t: (str) => typeof str === "string" ? t(str) : str,
|
|
21
|
-
i18n: i18n2
|
|
22
|
-
},
|
|
23
|
-
/* @__PURE__ */ React.createElement(LinkProvider, { component: NextLink }, /* @__PURE__ */ React.createElement(Head, null, /* @__PURE__ */ React.createElement(
|
|
24
|
-
"meta",
|
|
25
|
-
{
|
|
26
|
-
name: "viewport",
|
|
27
|
-
content: "minimum-scale=1, initial-scale=1, width=device-width"
|
|
28
|
-
}
|
|
29
|
-
)), ssr ? /* @__PURE__ */ React.createElement(DigiGOVApp, null, /* @__PURE__ */ React.createElement(Component, { ...pageProps })) : /* @__PURE__ */ React.createElement(StaticApp, null, /* @__PURE__ */ React.createElement(Component, { ...pageProps })))
|
|
30
|
-
);
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
const DigiGOVNextAppWithTranslation = withTranslation()(DigiGOVNextAppClass);
|
|
34
|
-
const DigiGOVNextApp = (props) => {
|
|
35
|
-
const router = useRouter();
|
|
36
|
-
return /* @__PURE__ */ React.createElement(DigiGOVNextAppWithTranslation, { ...props, router });
|
|
37
|
-
};
|
|
38
|
-
var App_default = DigiGOVNextApp;
|
|
39
|
-
export {
|
|
40
|
-
App_default as default
|
|
41
|
-
};
|
|
42
|
-
//# sourceMappingURL=App.js.map
|
package/App/package.json
DELETED
package/App.js.map
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../src/App.tsx"],
|
|
4
|
-
"sourcesContent": ["import React from 'react';\nimport { i18n, TFunction } from 'i18next';\nimport App from 'next/app';\nimport Head from 'next/head';\nimport { NextRouter, useRouter } from 'next/router';\nimport { withTranslation, WithTranslation } from 'react-i18next';\nimport NextLink from '@digigov/nextjs/Link';\nimport DigiGOVApp, { StaticApp } from '@digigov/ui/app/App';\nimport type { AppProps } from '@digigov/ui/app/App';\nimport { I18NProvider } from '@digigov/ui/i18n';\nimport { LinkProvider } from '@digigov/ui/navigation/Link';\n\nexport interface DigiGOVNextAppProps extends AppProps, WithTranslation {\n children?: React.ReactNode;\n t: TFunction;\n i18n: i18n;\n ssr: boolean;\n router: NextRouter;\n}\nclass DigiGOVNextAppClass extends App<DigiGOVNextAppProps> {\n render(): React.ReactElement {\n const { Component, pageProps, t, i18n, ssr = false, router } = this.props;\n const { locale } = router;\n\n if (locale && i18n.language != locale) {\n i18n.changeLanguage(locale);\n }\n return (\n <I18NProvider\n t={(str) => (typeof str === 'string' ? t(str) : str)}\n i18n={i18n}\n >\n <LinkProvider component={NextLink}>\n <Head>\n <meta\n name=\"viewport\"\n content=\"minimum-scale=1, initial-scale=1, width=device-width\"\n />\n </Head>\n {ssr ? (\n <DigiGOVApp>\n <Component {...pageProps} />\n </DigiGOVApp>\n ) : (\n <StaticApp>\n <Component {...pageProps} />\n </StaticApp>\n )}\n </LinkProvider>\n </I18NProvider>\n );\n }\n}\n\nconst DigiGOVNextAppWithTranslation = withTranslation()(DigiGOVNextAppClass);\nconst DigiGOVNextApp = (props) => {\n const router = useRouter();\n return <DigiGOVNextAppWithTranslation {...props} router={router} />;\n};\nexport default DigiGOVNextApp;\n"],
|
|
5
|
-
"mappings": "AAAA,OAAO,WAAW;AAElB,OAAO,SAAS;AAChB,OAAO,UAAU;AACjB,SAAqB,iBAAiB;AACtC,SAAS,uBAAwC;AACjD,OAAO,cAAc;AACrB,OAAO,cAAc,iBAAiB;AAEtC,SAAS,oBAAoB;AAC7B,SAAS,oBAAoB;AAS7B,MAAM,4BAA4B,IAAyB;AAAA,EACzD,SAA6B;AAC3B,UAAM,EAAE,WAAW,WAAW,GAAG,MAAAA,OAAM,MAAM,OAAO,OAAO,IAAI,KAAK;AACpE,UAAM,EAAE,OAAO,IAAI;AAEnB,QAAI,UAAUA,MAAK,YAAY,QAAQ;AACrC,MAAAA,MAAK,eAAe,MAAM;AAAA,IAC5B;AACA,WACE;AAAA,MAAC;AAAA;AAAA,QACC,GAAG,CAAC,QAAS,OAAO,QAAQ,WAAW,EAAE,GAAG,IAAI;AAAA,QAChD,MAAMA;AAAA;AAAA,MAEN,oCAAC,gBAAa,WAAW,YACvB,oCAAC,YACC;AAAA,QAAC;AAAA;AAAA,UACC,MAAK;AAAA,UACL,SAAQ;AAAA;AAAA,MACV,CACF,GACC,MACC,oCAAC,kBACC,oCAAC,aAAW,GAAG,WAAW,CAC5B,IAEA,oCAAC,iBACC,oCAAC,aAAW,GAAG,WAAW,CAC5B,CAEJ;AAAA,IACF;AAAA,EAEJ;AACF;AAEA,MAAM,gCAAgC,gBAAgB,EAAE,mBAAmB;AAC3E,MAAM,iBAAiB,CAAC,UAAU;AAChC,QAAM,SAAS,UAAU;AACzB,SAAO,oCAAC,iCAA+B,GAAG,OAAO,QAAgB;AACnE;AACA,IAAO,cAAQ;",
|
|
6
|
-
"names": ["i18n"]
|
|
7
|
-
}
|
package/Document/index.js
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import Document, { Html, Head, Main, NextScript } from "next/document";
|
|
3
|
-
class DigiGOVDocument extends Document {
|
|
4
|
-
render() {
|
|
5
|
-
return /* @__PURE__ */ React.createElement(Html, null, /* @__PURE__ */ React.createElement(Head, null, /* @__PURE__ */ React.createElement(
|
|
6
|
-
"script",
|
|
7
|
-
{
|
|
8
|
-
type: "text/javascript",
|
|
9
|
-
dangerouslySetInnerHTML: {
|
|
10
|
-
__html: `if (window.document.documentMode) alert('Internet Explorer is not supported. Please use a modern browser!');
|
|
11
|
-
`
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
)), /* @__PURE__ */ React.createElement("body", null, /* @__PURE__ */ React.createElement(Main, null), /* @__PURE__ */ React.createElement(NextScript, null)));
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
DigiGOVDocument.getInitialProps = async (ctx) => {
|
|
18
|
-
const initialProps = await Document.getInitialProps(ctx);
|
|
19
|
-
return {
|
|
20
|
-
...initialProps
|
|
21
|
-
// Styles fragment is rendered after the app and page rendering finish.
|
|
22
|
-
};
|
|
23
|
-
};
|
|
24
|
-
export {
|
|
25
|
-
DigiGOVDocument as default
|
|
26
|
-
};
|
|
27
|
-
//# sourceMappingURL=Document.js.map
|
package/Document/package.json
DELETED
package/Document.js.map
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../src/Document.tsx"],
|
|
4
|
-
"sourcesContent": ["/* eslint-disable @typescript-eslint/explicit-function-return-type */\nimport React from 'react';\nimport Document, { Html, Head, Main, NextScript } from 'next/document';\n\nexport default class DigiGOVDocument extends Document {\n render() {\n return (\n <Html>\n <Head>\n <script\n type=\"text/javascript\"\n dangerouslySetInnerHTML={{\n __html: `if (window.document.documentMode) alert('Internet Explorer is not supported. Please use a modern browser!');\n`,\n }}\n ></script>\n </Head>\n <body>\n <Main />\n <NextScript />\n </body>\n </Html>\n );\n }\n}\n\nDigiGOVDocument.getInitialProps = async (ctx) => {\n // Resolution order\n //\n // On the server:\n // 1. app.getInitialProps\n // 2. page.getInitialProps\n // 3. document.getInitialProps\n // 4. app.render\n // 5. page.render\n // 6. document.render\n //\n // On the server with error:\n // 1. document.getInitialProps\n // 2. app.render\n // 3. page.render\n // 4. document.render\n //\n // On the client\n // 1. app.getInitialProps\n // 2. page.getInitialProps\n // 3. app.render\n // 4. page.render\n\n // Render app and page and get the context of the page with collected side effects.\n const initialProps = await Document.getInitialProps(ctx);\n\n return {\n ...initialProps,\n // Styles fragment is rendered after the app and page rendering finish.\n };\n};\n"],
|
|
5
|
-
"mappings": "AACA,OAAO,WAAW;AAClB,OAAO,YAAY,MAAM,MAAM,MAAM,kBAAkB;AAEvD,MAAO,wBAAsC,SAAS;AAAA,EACpD,SAAS;AACP,WACE,oCAAC,YACC,oCAAC,YACC;AAAA,MAAC;AAAA;AAAA,QACC,MAAK;AAAA,QACL,yBAAyB;AAAA,UACvB,QAAQ;AAAA;AAAA,QAEV;AAAA;AAAA,IACD,CACH,GACA,oCAAC,cACC,oCAAC,UAAK,GACN,oCAAC,gBAAW,CACd,CACF;AAAA,EAEJ;AACF;AAEA,gBAAgB,kBAAkB,OAAO,QAAQ;AAwB/C,QAAM,eAAe,MAAM,SAAS,gBAAgB,GAAG;AAEvD,SAAO;AAAA,IACL,GAAG;AAAA;AAAA,EAEL;AACF;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
package/Image/index.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import NextImage from "next/image";
|
|
3
|
-
import { useBasePath } from "@digigov/nextjs/hooks";
|
|
4
|
-
const Image = ({ src, ...rest }) => {
|
|
5
|
-
const basePathSrc = useBasePath(typeof src === "string" ? src : "");
|
|
6
|
-
return /* @__PURE__ */ React.createElement(NextImage, { src: typeof src === "string" ? basePathSrc : src, ...rest });
|
|
7
|
-
};
|
|
8
|
-
var Image_default = Image;
|
|
9
|
-
export {
|
|
10
|
-
Image_default as default
|
|
11
|
-
};
|
|
12
|
-
//# sourceMappingURL=Image.js.map
|
package/Image/package.json
DELETED
package/Image.js.map
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../src/Image.tsx"],
|
|
4
|
-
"sourcesContent": ["import React from 'react';\nimport NextImage, { ImageProps } from 'next/image';\nimport { useBasePath } from '@digigov/nextjs/hooks';\n\nconst Image: React.FC<ImageProps> = ({ src, ...rest }) => {\n const basePathSrc = useBasePath(typeof src === 'string' ? src : '');\n return (\n <NextImage src={typeof src === 'string' ? basePathSrc : src} {...rest} />\n );\n};\n\nexport default Image;\n"],
|
|
5
|
-
"mappings": "AAAA,OAAO,WAAW;AAClB,OAAO,eAA+B;AACtC,SAAS,mBAAmB;AAE5B,MAAM,QAA8B,CAAC,EAAE,KAAK,GAAG,KAAK,MAAM;AACxD,QAAM,cAAc,YAAY,OAAO,QAAQ,WAAW,MAAM,EAAE;AAClE,SACE,oCAAC,aAAU,KAAK,OAAO,QAAQ,WAAW,cAAc,KAAM,GAAG,MAAM;AAE3E;AAEA,IAAO,gBAAQ;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
package/Link/index.js
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import React, { useEffect } from "react";
|
|
2
|
-
import NextRouterLink from "next/link";
|
|
3
|
-
import { useRouter } from "next/router";
|
|
4
|
-
import { Link } from "@digigov/ui/navigation/Link";
|
|
5
|
-
const NextLink = (props, ref) => {
|
|
6
|
-
const { href, as, ...other } = props;
|
|
7
|
-
const isExternalLink = /^(?:[a-z]+:)?\/\/|\.pdf|\.docx?|\.xlsx?|^mailto:/i.test(href || "") || other.target === "_blank";
|
|
8
|
-
const router = useRouter();
|
|
9
|
-
useEffect(() => {
|
|
10
|
-
const path = router.asPath;
|
|
11
|
-
if (path.includes("#")) {
|
|
12
|
-
setTimeout(() => {
|
|
13
|
-
const id = path.replace("#", "");
|
|
14
|
-
const el = document.getElementById(id);
|
|
15
|
-
if (el) {
|
|
16
|
-
window.scroll({
|
|
17
|
-
top: scrollY + el.getBoundingClientRect().top,
|
|
18
|
-
behavior: "smooth"
|
|
19
|
-
});
|
|
20
|
-
}
|
|
21
|
-
}, 600);
|
|
22
|
-
}
|
|
23
|
-
}, [router.asPath]);
|
|
24
|
-
if (isExternalLink) {
|
|
25
|
-
return /* @__PURE__ */ React.createElement(Link, { ref, href: href || "#", ...other }, props.children);
|
|
26
|
-
}
|
|
27
|
-
return /* @__PURE__ */ React.createElement(NextRouterLink, { href: href || "#", as: void 0, ...other }, /* @__PURE__ */ React.createElement(Link, { ref, ...other, as }, props.children));
|
|
28
|
-
};
|
|
29
|
-
var Link_default = React.forwardRef(NextLink);
|
|
30
|
-
export {
|
|
31
|
-
Link_default as default
|
|
32
|
-
};
|
|
33
|
-
//# sourceMappingURL=Link.js.map
|
package/Link/package.json
DELETED
package/Link.js.map
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../src/Link.tsx"],
|
|
4
|
-
"sourcesContent": ["import React, { useEffect } from 'react';\nimport NextRouterLink from 'next/link';\nimport { useRouter } from 'next/router';\nimport { Link, LinkProps } from '@digigov/ui/navigation/Link';\n\nconst NextLink: React.ForwardRefRenderFunction<HTMLAnchorElement, LinkProps> = (\n props,\n ref\n) => {\n const { href, as, ...other } = props;\n const isExternalLink =\n /^(?:[a-z]+:)?\\/\\/|\\.pdf|\\.docx?|\\.xlsx?|^mailto:/i.test(href || '') ||\n other.target === '_blank';\n\n const router = useRouter();\n\n useEffect(() => {\n const path = router.asPath;\n if (path.includes('#')) {\n setTimeout(() => {\n const id = path.replace('#', '');\n const el = document.getElementById(id);\n if (el) {\n window.scroll({\n top: scrollY + el.getBoundingClientRect().top,\n behavior: 'smooth',\n });\n }\n }, 600);\n }\n }, [router.asPath]);\n\n if (isExternalLink) {\n return (\n <Link ref={ref} href={href || '#'} {...other}>\n {props.children}\n </Link>\n );\n }\n\n return (\n <NextRouterLink href={href || '#'} as={undefined} {...other}>\n <Link ref={ref} {...other} as={as}>\n {props.children}\n </Link>\n </NextRouterLink>\n );\n};\n\nexport default React.forwardRef(NextLink);\n"],
|
|
5
|
-
"mappings": "AAAA,OAAO,SAAS,iBAAiB;AACjC,OAAO,oBAAoB;AAC3B,SAAS,iBAAiB;AAC1B,SAAS,YAAuB;AAEhC,MAAM,WAAyE,CAC7E,OACA,QACG;AACH,QAAM,EAAE,MAAM,IAAI,GAAG,MAAM,IAAI;AAC/B,QAAM,iBACJ,oDAAoD,KAAK,QAAQ,EAAE,KACnE,MAAM,WAAW;AAEnB,QAAM,SAAS,UAAU;AAEzB,YAAU,MAAM;AACd,UAAM,OAAO,OAAO;AACpB,QAAI,KAAK,SAAS,GAAG,GAAG;AACtB,iBAAW,MAAM;AACf,cAAM,KAAK,KAAK,QAAQ,KAAK,EAAE;AAC/B,cAAM,KAAK,SAAS,eAAe,EAAE;AACrC,YAAI,IAAI;AACN,iBAAO,OAAO;AAAA,YACZ,KAAK,UAAU,GAAG,sBAAsB,EAAE;AAAA,YAC1C,UAAU;AAAA,UACZ,CAAC;AAAA,QACH;AAAA,MACF,GAAG,GAAG;AAAA,IACR;AAAA,EACF,GAAG,CAAC,OAAO,MAAM,CAAC;AAElB,MAAI,gBAAgB;AAClB,WACE,oCAAC,QAAK,KAAU,MAAM,QAAQ,KAAM,GAAG,SACpC,MAAM,QACT;AAAA,EAEJ;AAEA,SACE,oCAAC,kBAAe,MAAM,QAAQ,KAAK,IAAI,QAAY,GAAG,SACpD,oCAAC,QAAK,KAAW,GAAG,OAAO,MACxB,MAAM,QACT,CACF;AAEJ;AAEA,IAAO,eAAQ,MAAM,WAAW,QAAQ;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
package/cjs/App/index.js
DELETED
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
var __create = Object.create;
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
-
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
|
-
var __copyProps = (to, from, except, desc) => {
|
|
12
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
-
for (let key of __getOwnPropNames(from))
|
|
14
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
-
}
|
|
17
|
-
return to;
|
|
18
|
-
};
|
|
19
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
-
mod
|
|
26
|
-
));
|
|
27
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
-
var App_exports = {};
|
|
29
|
-
__export(App_exports, {
|
|
30
|
-
default: () => App_default
|
|
31
|
-
});
|
|
32
|
-
module.exports = __toCommonJS(App_exports);
|
|
33
|
-
var import_react = __toESM(require("react"));
|
|
34
|
-
var import_app = __toESM(require("next/app"));
|
|
35
|
-
var import_head = __toESM(require("next/head"));
|
|
36
|
-
var import_router = require("next/router");
|
|
37
|
-
var import_react_i18next = require("react-i18next");
|
|
38
|
-
var import_Link = __toESM(require("@digigov/nextjs/Link"));
|
|
39
|
-
var import_App = __toESM(require("@digigov/ui/app/App"));
|
|
40
|
-
var import_i18n = require("@digigov/ui/i18n");
|
|
41
|
-
var import_Link2 = require("@digigov/ui/navigation/Link");
|
|
42
|
-
class DigiGOVNextAppClass extends import_app.default {
|
|
43
|
-
render() {
|
|
44
|
-
const { Component, pageProps, t, i18n: i18n2, ssr = false, router } = this.props;
|
|
45
|
-
const { locale } = router;
|
|
46
|
-
if (locale && i18n2.language != locale) {
|
|
47
|
-
i18n2.changeLanguage(locale);
|
|
48
|
-
}
|
|
49
|
-
return /* @__PURE__ */ import_react.default.createElement(
|
|
50
|
-
import_i18n.I18NProvider,
|
|
51
|
-
{
|
|
52
|
-
t: (str) => typeof str === "string" ? t(str) : str,
|
|
53
|
-
i18n: i18n2
|
|
54
|
-
},
|
|
55
|
-
/* @__PURE__ */ import_react.default.createElement(import_Link2.LinkProvider, { component: import_Link.default }, /* @__PURE__ */ import_react.default.createElement(import_head.default, null, /* @__PURE__ */ import_react.default.createElement(
|
|
56
|
-
"meta",
|
|
57
|
-
{
|
|
58
|
-
name: "viewport",
|
|
59
|
-
content: "minimum-scale=1, initial-scale=1, width=device-width"
|
|
60
|
-
}
|
|
61
|
-
)), ssr ? /* @__PURE__ */ import_react.default.createElement(import_App.default, null, /* @__PURE__ */ import_react.default.createElement(Component, { ...pageProps })) : /* @__PURE__ */ import_react.default.createElement(import_App.StaticApp, null, /* @__PURE__ */ import_react.default.createElement(Component, { ...pageProps })))
|
|
62
|
-
);
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
const DigiGOVNextAppWithTranslation = (0, import_react_i18next.withTranslation)()(DigiGOVNextAppClass);
|
|
66
|
-
const DigiGOVNextApp = (props) => {
|
|
67
|
-
const router = (0, import_router.useRouter)();
|
|
68
|
-
return /* @__PURE__ */ import_react.default.createElement(DigiGOVNextAppWithTranslation, { ...props, router });
|
|
69
|
-
};
|
|
70
|
-
var App_default = DigiGOVNextApp;
|
|
71
|
-
//# sourceMappingURL=App.js.map
|
package/cjs/App.js.map
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/App.tsx"],
|
|
4
|
-
"sourcesContent": ["import React from 'react';\nimport { i18n, TFunction } from 'i18next';\nimport App from 'next/app';\nimport Head from 'next/head';\nimport { NextRouter, useRouter } from 'next/router';\nimport { withTranslation, WithTranslation } from 'react-i18next';\nimport NextLink from '@digigov/nextjs/Link';\nimport DigiGOVApp, { StaticApp } from '@digigov/ui/app/App';\nimport type { AppProps } from '@digigov/ui/app/App';\nimport { I18NProvider } from '@digigov/ui/i18n';\nimport { LinkProvider } from '@digigov/ui/navigation/Link';\n\nexport interface DigiGOVNextAppProps extends AppProps, WithTranslation {\n children?: React.ReactNode;\n t: TFunction;\n i18n: i18n;\n ssr: boolean;\n router: NextRouter;\n}\nclass DigiGOVNextAppClass extends App<DigiGOVNextAppProps> {\n render(): React.ReactElement {\n const { Component, pageProps, t, i18n, ssr = false, router } = this.props;\n const { locale } = router;\n\n if (locale && i18n.language != locale) {\n i18n.changeLanguage(locale);\n }\n return (\n <I18NProvider\n t={(str) => (typeof str === 'string' ? t(str) : str)}\n i18n={i18n}\n >\n <LinkProvider component={NextLink}>\n <Head>\n <meta\n name=\"viewport\"\n content=\"minimum-scale=1, initial-scale=1, width=device-width\"\n />\n </Head>\n {ssr ? (\n <DigiGOVApp>\n <Component {...pageProps} />\n </DigiGOVApp>\n ) : (\n <StaticApp>\n <Component {...pageProps} />\n </StaticApp>\n )}\n </LinkProvider>\n </I18NProvider>\n );\n }\n}\n\nconst DigiGOVNextAppWithTranslation = withTranslation()(DigiGOVNextAppClass);\nconst DigiGOVNextApp = (props) => {\n const router = useRouter();\n return <DigiGOVNextAppWithTranslation {...props} router={router} />;\n};\nexport default DigiGOVNextApp;\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAkB;AAElB,iBAAgB;AAChB,kBAAiB;AACjB,oBAAsC;AACtC,2BAAiD;AACjD,kBAAqB;AACrB,iBAAsC;AAEtC,kBAA6B;AAC7B,IAAAA,eAA6B;AAS7B,MAAM,4BAA4B,WAAAC,QAAyB;AAAA,EACzD,SAA6B;AAC3B,UAAM,EAAE,WAAW,WAAW,GAAG,MAAAC,OAAM,MAAM,OAAO,OAAO,IAAI,KAAK;AACpE,UAAM,EAAE,OAAO,IAAI;AAEnB,QAAI,UAAUA,MAAK,YAAY,QAAQ;AACrC,MAAAA,MAAK,eAAe,MAAM;AAAA,IAC5B;AACA,WACE,6BAAAC,QAAA;AAAA,MAAC;AAAA;AAAA,QACC,GAAG,CAAC,QAAS,OAAO,QAAQ,WAAW,EAAE,GAAG,IAAI;AAAA,QAChD,MAAMD;AAAA;AAAA,MAEN,6BAAAC,QAAA,cAAC,6BAAa,WAAW,YAAAC,WACvB,6BAAAD,QAAA,cAAC,YAAAE,SAAA,MACC,6BAAAF,QAAA;AAAA,QAAC;AAAA;AAAA,UACC,MAAK;AAAA,UACL,SAAQ;AAAA;AAAA,MACV,CACF,GACC,MACC,6BAAAA,QAAA,cAAC,WAAAG,SAAA,MACC,6BAAAH,QAAA,cAAC,aAAW,GAAG,WAAW,CAC5B,IAEA,6BAAAA,QAAA,cAAC,4BACC,6BAAAA,QAAA,cAAC,aAAW,GAAG,WAAW,CAC5B,CAEJ;AAAA,IACF;AAAA,EAEJ;AACF;AAEA,MAAM,oCAAgC,sCAAgB,EAAE,mBAAmB;AAC3E,MAAM,iBAAiB,CAAC,UAAU;AAChC,QAAM,aAAS,yBAAU;AACzB,SAAO,6BAAAA,QAAA,cAAC,iCAA+B,GAAG,OAAO,QAAgB;AACnE;AACA,IAAO,cAAQ;",
|
|
6
|
-
"names": ["import_Link", "App", "i18n", "React", "NextLink", "Head", "DigiGOVApp"]
|
|
7
|
-
}
|
package/cjs/Document/index.js
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
var __create = Object.create;
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
-
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
|
-
var __copyProps = (to, from, except, desc) => {
|
|
12
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
-
for (let key of __getOwnPropNames(from))
|
|
14
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
-
}
|
|
17
|
-
return to;
|
|
18
|
-
};
|
|
19
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
-
mod
|
|
26
|
-
));
|
|
27
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
-
var Document_exports = {};
|
|
29
|
-
__export(Document_exports, {
|
|
30
|
-
default: () => DigiGOVDocument
|
|
31
|
-
});
|
|
32
|
-
module.exports = __toCommonJS(Document_exports);
|
|
33
|
-
var import_react = __toESM(require("react"));
|
|
34
|
-
var import_document = __toESM(require("next/document"));
|
|
35
|
-
class DigiGOVDocument extends import_document.default {
|
|
36
|
-
render() {
|
|
37
|
-
return /* @__PURE__ */ import_react.default.createElement(import_document.Html, null, /* @__PURE__ */ import_react.default.createElement(import_document.Head, null, /* @__PURE__ */ import_react.default.createElement(
|
|
38
|
-
"script",
|
|
39
|
-
{
|
|
40
|
-
type: "text/javascript",
|
|
41
|
-
dangerouslySetInnerHTML: {
|
|
42
|
-
__html: `if (window.document.documentMode) alert('Internet Explorer is not supported. Please use a modern browser!');
|
|
43
|
-
`
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
)), /* @__PURE__ */ import_react.default.createElement("body", null, /* @__PURE__ */ import_react.default.createElement(import_document.Main, null), /* @__PURE__ */ import_react.default.createElement(import_document.NextScript, null)));
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
DigiGOVDocument.getInitialProps = async (ctx) => {
|
|
50
|
-
const initialProps = await import_document.default.getInitialProps(ctx);
|
|
51
|
-
return {
|
|
52
|
-
...initialProps
|
|
53
|
-
// Styles fragment is rendered after the app and page rendering finish.
|
|
54
|
-
};
|
|
55
|
-
};
|
|
56
|
-
//# sourceMappingURL=Document.js.map
|
package/cjs/Document.js.map
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/Document.tsx"],
|
|
4
|
-
"sourcesContent": ["/* eslint-disable @typescript-eslint/explicit-function-return-type */\nimport React from 'react';\nimport Document, { Html, Head, Main, NextScript } from 'next/document';\n\nexport default class DigiGOVDocument extends Document {\n render() {\n return (\n <Html>\n <Head>\n <script\n type=\"text/javascript\"\n dangerouslySetInnerHTML={{\n __html: `if (window.document.documentMode) alert('Internet Explorer is not supported. Please use a modern browser!');\n`,\n }}\n ></script>\n </Head>\n <body>\n <Main />\n <NextScript />\n </body>\n </Html>\n );\n }\n}\n\nDigiGOVDocument.getInitialProps = async (ctx) => {\n // Resolution order\n //\n // On the server:\n // 1. app.getInitialProps\n // 2. page.getInitialProps\n // 3. document.getInitialProps\n // 4. app.render\n // 5. page.render\n // 6. document.render\n //\n // On the server with error:\n // 1. document.getInitialProps\n // 2. app.render\n // 3. page.render\n // 4. document.render\n //\n // On the client\n // 1. app.getInitialProps\n // 2. page.getInitialProps\n // 3. app.render\n // 4. page.render\n\n // Render app and page and get the context of the page with collected side effects.\n const initialProps = await Document.getInitialProps(ctx);\n\n return {\n ...initialProps,\n // Styles fragment is rendered after the app and page rendering finish.\n };\n};\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,mBAAkB;AAClB,sBAAuD;AAEvD,MAAO,wBAAsC,gBAAAA,QAAS;AAAA,EACpD,SAAS;AACP,WACE,6BAAAC,QAAA,cAAC,4BACC,6BAAAA,QAAA,cAAC,4BACC,6BAAAA,QAAA;AAAA,MAAC;AAAA;AAAA,QACC,MAAK;AAAA,QACL,yBAAyB;AAAA,UACvB,QAAQ;AAAA;AAAA,QAEV;AAAA;AAAA,IACD,CACH,GACA,6BAAAA,QAAA,cAAC,cACC,6BAAAA,QAAA,cAAC,0BAAK,GACN,6BAAAA,QAAA,cAAC,gCAAW,CACd,CACF;AAAA,EAEJ;AACF;AAEA,gBAAgB,kBAAkB,OAAO,QAAQ;AAwB/C,QAAM,eAAe,MAAM,gBAAAD,QAAS,gBAAgB,GAAG;AAEvD,SAAO;AAAA,IACL,GAAG;AAAA;AAAA,EAEL;AACF;",
|
|
6
|
-
"names": ["Document", "React"]
|
|
7
|
-
}
|
package/cjs/Image/index.js
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
var __create = Object.create;
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
-
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
|
-
var __copyProps = (to, from, except, desc) => {
|
|
12
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
-
for (let key of __getOwnPropNames(from))
|
|
14
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
-
}
|
|
17
|
-
return to;
|
|
18
|
-
};
|
|
19
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
-
mod
|
|
26
|
-
));
|
|
27
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
-
var Image_exports = {};
|
|
29
|
-
__export(Image_exports, {
|
|
30
|
-
default: () => Image_default
|
|
31
|
-
});
|
|
32
|
-
module.exports = __toCommonJS(Image_exports);
|
|
33
|
-
var import_react = __toESM(require("react"));
|
|
34
|
-
var import_image = __toESM(require("next/image"));
|
|
35
|
-
var import_hooks = require("@digigov/nextjs/hooks");
|
|
36
|
-
const Image = ({ src, ...rest }) => {
|
|
37
|
-
const basePathSrc = (0, import_hooks.useBasePath)(typeof src === "string" ? src : "");
|
|
38
|
-
return /* @__PURE__ */ import_react.default.createElement(import_image.default, { src: typeof src === "string" ? basePathSrc : src, ...rest });
|
|
39
|
-
};
|
|
40
|
-
var Image_default = Image;
|
|
41
|
-
//# sourceMappingURL=Image.js.map
|
package/cjs/Image.js.map
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/Image.tsx"],
|
|
4
|
-
"sourcesContent": ["import React from 'react';\nimport NextImage, { ImageProps } from 'next/image';\nimport { useBasePath } from '@digigov/nextjs/hooks';\n\nconst Image: React.FC<ImageProps> = ({ src, ...rest }) => {\n const basePathSrc = useBasePath(typeof src === 'string' ? src : '');\n return (\n <NextImage src={typeof src === 'string' ? basePathSrc : src} {...rest} />\n );\n};\n\nexport default Image;\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAkB;AAClB,mBAAsC;AACtC,mBAA4B;AAE5B,MAAM,QAA8B,CAAC,EAAE,KAAK,GAAG,KAAK,MAAM;AACxD,QAAM,kBAAc,0BAAY,OAAO,QAAQ,WAAW,MAAM,EAAE;AAClE,SACE,6BAAAA,QAAA,cAAC,aAAAC,SAAA,EAAU,KAAK,OAAO,QAAQ,WAAW,cAAc,KAAM,GAAG,MAAM;AAE3E;AAEA,IAAO,gBAAQ;",
|
|
6
|
-
"names": ["React", "NextImage"]
|
|
7
|
-
}
|
package/cjs/Link/index.js
DELETED
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
var __create = Object.create;
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
-
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
|
-
var __copyProps = (to, from, except, desc) => {
|
|
12
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
-
for (let key of __getOwnPropNames(from))
|
|
14
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
-
}
|
|
17
|
-
return to;
|
|
18
|
-
};
|
|
19
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
-
mod
|
|
26
|
-
));
|
|
27
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
-
var Link_exports = {};
|
|
29
|
-
__export(Link_exports, {
|
|
30
|
-
default: () => Link_default
|
|
31
|
-
});
|
|
32
|
-
module.exports = __toCommonJS(Link_exports);
|
|
33
|
-
var import_react = __toESM(require("react"));
|
|
34
|
-
var import_link = __toESM(require("next/link"));
|
|
35
|
-
var import_router = require("next/router");
|
|
36
|
-
var import_Link = require("@digigov/ui/navigation/Link");
|
|
37
|
-
const NextLink = (props, ref) => {
|
|
38
|
-
const { href, as, ...other } = props;
|
|
39
|
-
const isExternalLink = /^(?:[a-z]+:)?\/\/|\.pdf|\.docx?|\.xlsx?|^mailto:/i.test(href || "") || other.target === "_blank";
|
|
40
|
-
const router = (0, import_router.useRouter)();
|
|
41
|
-
(0, import_react.useEffect)(() => {
|
|
42
|
-
const path = router.asPath;
|
|
43
|
-
if (path.includes("#")) {
|
|
44
|
-
setTimeout(() => {
|
|
45
|
-
const id = path.replace("#", "");
|
|
46
|
-
const el = document.getElementById(id);
|
|
47
|
-
if (el) {
|
|
48
|
-
window.scroll({
|
|
49
|
-
top: scrollY + el.getBoundingClientRect().top,
|
|
50
|
-
behavior: "smooth"
|
|
51
|
-
});
|
|
52
|
-
}
|
|
53
|
-
}, 600);
|
|
54
|
-
}
|
|
55
|
-
}, [router.asPath]);
|
|
56
|
-
if (isExternalLink) {
|
|
57
|
-
return /* @__PURE__ */ import_react.default.createElement(import_Link.Link, { ref, href: href || "#", ...other }, props.children);
|
|
58
|
-
}
|
|
59
|
-
return /* @__PURE__ */ import_react.default.createElement(import_link.default, { href: href || "#", as: void 0, ...other }, /* @__PURE__ */ import_react.default.createElement(import_Link.Link, { ref, ...other, as }, props.children));
|
|
60
|
-
};
|
|
61
|
-
var Link_default = import_react.default.forwardRef(NextLink);
|
|
62
|
-
//# sourceMappingURL=Link.js.map
|
package/cjs/Link.js.map
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/Link.tsx"],
|
|
4
|
-
"sourcesContent": ["import React, { useEffect } from 'react';\nimport NextRouterLink from 'next/link';\nimport { useRouter } from 'next/router';\nimport { Link, LinkProps } from '@digigov/ui/navigation/Link';\n\nconst NextLink: React.ForwardRefRenderFunction<HTMLAnchorElement, LinkProps> = (\n props,\n ref\n) => {\n const { href, as, ...other } = props;\n const isExternalLink =\n /^(?:[a-z]+:)?\\/\\/|\\.pdf|\\.docx?|\\.xlsx?|^mailto:/i.test(href || '') ||\n other.target === '_blank';\n\n const router = useRouter();\n\n useEffect(() => {\n const path = router.asPath;\n if (path.includes('#')) {\n setTimeout(() => {\n const id = path.replace('#', '');\n const el = document.getElementById(id);\n if (el) {\n window.scroll({\n top: scrollY + el.getBoundingClientRect().top,\n behavior: 'smooth',\n });\n }\n }, 600);\n }\n }, [router.asPath]);\n\n if (isExternalLink) {\n return (\n <Link ref={ref} href={href || '#'} {...other}>\n {props.children}\n </Link>\n );\n }\n\n return (\n <NextRouterLink href={href || '#'} as={undefined} {...other}>\n <Link ref={ref} {...other} as={as}>\n {props.children}\n </Link>\n </NextRouterLink>\n );\n};\n\nexport default React.forwardRef(NextLink);\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAiC;AACjC,kBAA2B;AAC3B,oBAA0B;AAC1B,kBAAgC;AAEhC,MAAM,WAAyE,CAC7E,OACA,QACG;AACH,QAAM,EAAE,MAAM,IAAI,GAAG,MAAM,IAAI;AAC/B,QAAM,iBACJ,oDAAoD,KAAK,QAAQ,EAAE,KACnE,MAAM,WAAW;AAEnB,QAAM,aAAS,yBAAU;AAEzB,8BAAU,MAAM;AACd,UAAM,OAAO,OAAO;AACpB,QAAI,KAAK,SAAS,GAAG,GAAG;AACtB,iBAAW,MAAM;AACf,cAAM,KAAK,KAAK,QAAQ,KAAK,EAAE;AAC/B,cAAM,KAAK,SAAS,eAAe,EAAE;AACrC,YAAI,IAAI;AACN,iBAAO,OAAO;AAAA,YACZ,KAAK,UAAU,GAAG,sBAAsB,EAAE;AAAA,YAC1C,UAAU;AAAA,UACZ,CAAC;AAAA,QACH;AAAA,MACF,GAAG,GAAG;AAAA,IACR;AAAA,EACF,GAAG,CAAC,OAAO,MAAM,CAAC;AAElB,MAAI,gBAAgB;AAClB,WACE,6BAAAA,QAAA,cAAC,oBAAK,KAAU,MAAM,QAAQ,KAAM,GAAG,SACpC,MAAM,QACT;AAAA,EAEJ;AAEA,SACE,6BAAAA,QAAA,cAAC,YAAAC,SAAA,EAAe,MAAM,QAAQ,KAAK,IAAI,QAAY,GAAG,SACpD,6BAAAD,QAAA,cAAC,oBAAK,KAAW,GAAG,OAAO,MACxB,MAAM,QACT,CACF;AAEJ;AAEA,IAAO,eAAQ,aAAAA,QAAM,WAAW,QAAQ;",
|
|
6
|
-
"names": ["React", "NextRouterLink"]
|
|
7
|
-
}
|
package/cjs/hooks/index.js
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
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
|
-
var hooks_exports = {};
|
|
19
|
-
__export(hooks_exports, {
|
|
20
|
-
useBasePath: () => useBasePath
|
|
21
|
-
});
|
|
22
|
-
module.exports = __toCommonJS(hooks_exports);
|
|
23
|
-
var import_router = require("next/router");
|
|
24
|
-
function useBasePath(src) {
|
|
25
|
-
const router = (0, import_router.useRouter)();
|
|
26
|
-
return router.basePath + src;
|
|
27
|
-
}
|
|
28
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
29
|
-
0 && (module.exports = {
|
|
30
|
-
useBasePath
|
|
31
|
-
});
|
|
32
|
-
//# sourceMappingURL=hooks.js.map
|
package/cjs/hooks.js.map
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/hooks.ts"],
|
|
4
|
-
"sourcesContent": ["import { useRouter } from 'next/router';\n\nexport function useBasePath(src: string): string {\n const router = useRouter();\n return router.basePath + src;\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAA0B;AAEnB,SAAS,YAAY,KAAqB;AAC/C,QAAM,aAAS,yBAAU;AACzB,SAAO,OAAO,WAAW;AAC3B;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
package/cjs/i18n/index.js
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
var __create = Object.create;
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
-
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
|
-
var __copyProps = (to, from, except, desc) => {
|
|
12
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
-
for (let key of __getOwnPropNames(from))
|
|
14
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
-
}
|
|
17
|
-
return to;
|
|
18
|
-
};
|
|
19
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
-
mod
|
|
26
|
-
));
|
|
27
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
-
var i18n_exports = {};
|
|
29
|
-
__export(i18n_exports, {
|
|
30
|
-
default: () => initI18n
|
|
31
|
-
});
|
|
32
|
-
module.exports = __toCommonJS(i18n_exports);
|
|
33
|
-
var import_i18next = __toESM(require("i18next"));
|
|
34
|
-
var import_react_i18next = require("react-i18next");
|
|
35
|
-
function initI18n(resources, language = "el") {
|
|
36
|
-
return import_i18next.default.use(import_react_i18next.initReactI18next).init({
|
|
37
|
-
resources,
|
|
38
|
-
lng: language,
|
|
39
|
-
keySeparator: ".",
|
|
40
|
-
// we use keys in form messages.welcome
|
|
41
|
-
interpolation: {
|
|
42
|
-
escapeValue: false
|
|
43
|
-
// react already safes from xss
|
|
44
|
-
}
|
|
45
|
-
});
|
|
46
|
-
}
|
|
47
|
-
//# sourceMappingURL=i18n.js.map
|
package/cjs/i18n.js.map
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/i18n.tsx"],
|
|
4
|
-
"sourcesContent": ["import i18n, { Resource, TFunction } from 'i18next';\nimport { initReactI18next } from 'react-i18next';\n\nexport default function initI18n(\n resources: Resource,\n language = 'el'\n): Promise<TFunction> {\n return i18n\n .use(initReactI18next) // passes i18n down to react-i18next\n .init({\n resources: resources,\n lng: language,\n keySeparator: '.', // we use keys in form messages.welcome\n interpolation: {\n escapeValue: false, // react already safes from xss\n },\n });\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAA0C;AAC1C,2BAAiC;AAElB,SAAR,SACL,WACA,WAAW,MACS;AACpB,SAAO,eAAAA,QACJ,IAAI,qCAAgB,EACpB,KAAK;AAAA,IACJ;AAAA,IACA,KAAK;AAAA,IACL,cAAc;AAAA;AAAA,IACd,eAAe;AAAA,MACb,aAAa;AAAA;AAAA,IACf;AAAA,EACF,CAAC;AACL;",
|
|
6
|
-
"names": ["i18n"]
|
|
7
|
-
}
|
package/cjs/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
//# sourceMappingURL=index.js.map
|
package/cjs/index.js.map
DELETED
package/hooks/index.js
DELETED
package/hooks/package.json
DELETED
package/hooks.js.map
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../src/hooks.ts"],
|
|
4
|
-
"sourcesContent": ["import { useRouter } from 'next/router';\n\nexport function useBasePath(src: string): string {\n const router = useRouter();\n return router.basePath + src;\n}\n"],
|
|
5
|
-
"mappings": "AAAA,SAAS,iBAAiB;AAEnB,SAAS,YAAY,KAAqB;AAC/C,QAAM,SAAS,UAAU;AACzB,SAAO,OAAO,WAAW;AAC3B;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
package/i18n/index.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import i18n from "i18next";
|
|
2
|
-
import { initReactI18next } from "react-i18next";
|
|
3
|
-
function initI18n(resources, language = "el") {
|
|
4
|
-
return i18n.use(initReactI18next).init({
|
|
5
|
-
resources,
|
|
6
|
-
lng: language,
|
|
7
|
-
keySeparator: ".",
|
|
8
|
-
// we use keys in form messages.welcome
|
|
9
|
-
interpolation: {
|
|
10
|
-
escapeValue: false
|
|
11
|
-
// react already safes from xss
|
|
12
|
-
}
|
|
13
|
-
});
|
|
14
|
-
}
|
|
15
|
-
export {
|
|
16
|
-
initI18n as default
|
|
17
|
-
};
|
|
18
|
-
//# sourceMappingURL=i18n.js.map
|
package/i18n/package.json
DELETED
package/i18n.js.map
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../src/i18n.tsx"],
|
|
4
|
-
"sourcesContent": ["import i18n, { Resource, TFunction } from 'i18next';\nimport { initReactI18next } from 'react-i18next';\n\nexport default function initI18n(\n resources: Resource,\n language = 'el'\n): Promise<TFunction> {\n return i18n\n .use(initReactI18next) // passes i18n down to react-i18next\n .init({\n resources: resources,\n lng: language,\n keySeparator: '.', // we use keys in form messages.welcome\n interpolation: {\n escapeValue: false, // react already safes from xss\n },\n });\n}\n"],
|
|
5
|
-
"mappings": "AAAA,OAAO,UAAmC;AAC1C,SAAS,wBAAwB;AAElB,SAAR,SACL,WACA,WAAW,MACS;AACpB,SAAO,KACJ,IAAI,gBAAgB,EACpB,KAAK;AAAA,IACJ;AAAA,IACA,KAAK;AAAA,IACL,cAAc;AAAA;AAAA,IACd,eAAe;AAAA,MACb,aAAa;AAAA;AAAA,IACf;AAAA,EACF,CAAC;AACL;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|