@digigov/nextjs 1.1.5-b4cd6916 → 1.1.5-d0adc9fb

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/index.js CHANGED
@@ -1,12 +1,12 @@
1
1
  import React from "react";
2
2
  import App from "next/app";
3
3
  import Head from "next/head";
4
+ import { useRouter } from "next/router";
4
5
  import { withTranslation } from "react-i18next";
5
6
  import NextLink from "@digigov/nextjs/Link";
6
7
  import DigiGOVApp, { StaticApp } from "@digigov/ui/app/App";
7
8
  import { I18NProvider } from "@digigov/ui/i18n";
8
9
  import { LinkProvider } from "@digigov/ui/navigation/Link";
9
- import { useRouter } from "next/router";
10
10
  class DigiGOVNextAppClass extends App {
11
11
  render() {
12
12
  const { Component, pageProps, t, i18n: i18n2, ssr = false, router } = this.props;
package/App.d.ts CHANGED
@@ -1,8 +1,8 @@
1
1
  import React from 'react';
2
2
  import { i18n, TFunction } from 'i18next';
3
+ import { NextRouter } from 'next/router';
3
4
  import { WithTranslation } from 'react-i18next';
4
5
  import type { AppProps } from '@digigov/ui/app/App';
5
- import { NextRouter } from 'next/router';
6
6
  export interface DigiGOVNextAppProps extends AppProps, WithTranslation {
7
7
  children?: React.ReactNode;
8
8
  t: TFunction;
package/App.js.map CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
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 { 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';\nimport { NextRouter, useRouter } from 'next/router';\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,SAAS,uBAAwC;AACjD,OAAO,cAAc;AACrB,OAAO,cAAc,iBAAiB;AAEtC,SAAS,oBAAoB;AAC7B,SAAS,oBAAoB;AAC7B,SAAqB,iBAAiB;AAStC,MAAM,4BAA4B,IAAyB;AAAA,EACzD,SAA6B;AAC3B,UAAM,EAAE,WAAW,WAAW,GAAG,MAAAA,OAAM,MAAM,OAAO,OAAO,IAAI,KAAK;AACpE,UAAM,EAAC,OAAM,IAAI;AAEjB,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;",
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
6
  "names": ["i18n"]
7
7
  }
package/cjs/App/index.js CHANGED
@@ -33,12 +33,12 @@ module.exports = __toCommonJS(App_exports);
33
33
  var import_react = __toESM(require("react"));
34
34
  var import_app = __toESM(require("next/app"));
35
35
  var import_head = __toESM(require("next/head"));
36
+ var import_router = require("next/router");
36
37
  var import_react_i18next = require("react-i18next");
37
38
  var import_Link = __toESM(require("@digigov/nextjs/Link"));
38
39
  var import_App = __toESM(require("@digigov/ui/app/App"));
39
40
  var import_i18n = require("@digigov/ui/i18n");
40
41
  var import_Link2 = require("@digigov/ui/navigation/Link");
41
- var import_router = require("next/router");
42
42
  class DigiGOVNextAppClass extends import_app.default {
43
43
  render() {
44
44
  const { Component, pageProps, t, i18n: i18n2, ssr = false, router } = this.props;
package/cjs/App.js.map CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
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 { 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';\nimport { NextRouter, useRouter } from 'next/router';\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,2BAAiD;AACjD,kBAAqB;AACrB,iBAAsC;AAEtC,kBAA6B;AAC7B,IAAAA,eAA6B;AAC7B,oBAAsC;AAStC,MAAM,4BAA4B,WAAAC,QAAyB;AAAA,EACzD,SAA6B;AAC3B,UAAM,EAAE,WAAW,WAAW,GAAG,MAAAC,OAAM,MAAM,OAAO,OAAO,IAAI,KAAK;AACpE,UAAM,EAAC,OAAM,IAAI;AAEjB,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;",
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 <DigiGOVNextApp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
  "names": ["import_Link", "App", "i18n", "React", "NextLink", "Head", "DigiGOVApp"]
7
7
  }
package/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license Digigov v1.1.5-b4cd6916
1
+ /** @license Digigov v1.1.5-d0adc9fb
2
2
  *
3
3
  * This source code is licensed under the BSD-2-Clause license found in the
4
4
  * LICENSE file in the root directory of this source tree.
package/package.json CHANGED
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "name": "@digigov/nextjs",
3
- "version": "1.1.5-b4cd6916",
3
+ "version": "1.1.5-d0adc9fb",
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
7
  "main": "./cjs/index.js",
8
8
  "module": "./index.js",
9
9
  "peerDependencies": {
10
- "@digigov/ui": "2.0.0-b4cd6916",
11
- "@digigov/react-core": "2.0.0-b4cd6916",
10
+ "@digigov/ui": "2.0.0-d0adc9fb",
11
+ "@digigov/react-core": "2.0.0-d0adc9fb",
12
12
  "clsx": "1.1.1",
13
13
  "i18next": "19.1.0",
14
14
  "react": ">=16.8.0 <19.0.0",
package/src/App.tsx CHANGED
@@ -2,13 +2,13 @@ import React from 'react';
2
2
  import { i18n, TFunction } from 'i18next';
3
3
  import App from 'next/app';
4
4
  import Head from 'next/head';
5
+ import { NextRouter, useRouter } from 'next/router';
5
6
  import { withTranslation, WithTranslation } from 'react-i18next';
6
7
  import NextLink from '@digigov/nextjs/Link';
7
8
  import DigiGOVApp, { StaticApp } from '@digigov/ui/app/App';
8
9
  import type { AppProps } from '@digigov/ui/app/App';
9
10
  import { I18NProvider } from '@digigov/ui/i18n';
10
11
  import { LinkProvider } from '@digigov/ui/navigation/Link';
11
- import { NextRouter, useRouter } from 'next/router';
12
12
 
13
13
  export interface DigiGOVNextAppProps extends AppProps, WithTranslation {
14
14
  children?: React.ReactNode;
@@ -20,9 +20,9 @@ export interface DigiGOVNextAppProps extends AppProps, WithTranslation {
20
20
  class DigiGOVNextAppClass extends App<DigiGOVNextAppProps> {
21
21
  render(): React.ReactElement {
22
22
  const { Component, pageProps, t, i18n, ssr = false, router } = this.props;
23
- const {locale} = router;
24
-
25
- if (locale && i18n.language != locale) {
23
+ const { locale } = router;
24
+
25
+ if (locale && i18n.language != locale) {
26
26
  i18n.changeLanguage(locale);
27
27
  }
28
28
  return (
@@ -54,7 +54,7 @@ class DigiGOVNextAppClass extends App<DigiGOVNextAppProps> {
54
54
 
55
55
  const DigiGOVNextAppWithTranslation = withTranslation()(DigiGOVNextAppClass);
56
56
  const DigiGOVNextApp = (props) => {
57
- const router = useRouter()
58
- return <DigiGOVNextAppWithTranslation {...props} router={router} />
59
- }
57
+ const router = useRouter();
58
+ return <DigiGOVNextAppWithTranslation {...props} router={router} />;
59
+ };
60
60
  export default DigiGOVNextApp;