@digigov/nextjs 1.1.4 → 1.1.5-0c4be34e
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 +41 -48
- package/App.d.ts +4 -7
- package/App.js.map +7 -0
- package/Document/index.js +22 -63
- package/Document.d.ts +2 -3
- package/Document.js.map +7 -0
- package/Image/index.js +11 -14
- package/Image.js.map +7 -0
- package/Link/index.js +28 -36
- package/Link.d.ts +1 -1
- package/Link.js.map +7 -0
- package/cjs/App/index.js +69 -57
- package/cjs/App.js.map +7 -0
- package/cjs/Document/index.js +50 -70
- package/cjs/Document.js.map +7 -0
- package/cjs/Image/index.js +39 -20
- package/cjs/Image.js.map +7 -0
- package/cjs/Link/index.js +56 -45
- package/cjs/Link.js.map +7 -0
- package/cjs/hooks/index.js +29 -8
- package/cjs/hooks.js.map +7 -0
- package/cjs/i18n/index.js +41 -16
- package/cjs/i18n.js.map +7 -0
- package/cjs/index.js +1 -1
- package/cjs/index.js.map +7 -0
- package/hooks/index.js +8 -4
- package/hooks.js.map +7 -0
- package/i18n/index.js +13 -10
- package/i18n.js.map +7 -0
- package/index.js +2 -1
- package/index.js.map +7 -0
- package/package.json +6 -8
- package/src/App.tsx +16 -4
- package/src/Document.tsx +0 -16
- package/src/Image.tsx +4 -2
- package/src/Link.tsx +6 -3
package/cjs/Document/index.js
CHANGED
|
@@ -1,76 +1,56 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
Object.
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
var
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
17
|
-
var _react = _interopRequireDefault(require("react"));
|
|
18
|
-
var _document = _interopRequireWildcard(require("next/document"));
|
|
19
|
-
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
20
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
|
|
21
|
-
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, "catch": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
|
|
22
|
-
function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2["default"])(o), (0, _possibleConstructorReturn2["default"])(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2["default"])(t).constructor) : o.apply(t, e)); }
|
|
23
|
-
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } /* eslint-disable @typescript-eslint/explicit-function-return-type */
|
|
24
|
-
var _ref = /*#__PURE__*/_react["default"].createElement("link", {
|
|
25
|
-
rel: "stylesheet",
|
|
26
|
-
href: "https://fonts.googleapis.com/icon?family=Material+Icons"
|
|
27
|
-
});
|
|
28
|
-
var _ref2 = /*#__PURE__*/_react["default"].createElement("link", {
|
|
29
|
-
rel: "stylesheet",
|
|
30
|
-
href: "https://fonts.googleapis.com/css?family=Roboto:300,400,500"
|
|
31
|
-
});
|
|
32
|
-
function Fonts() {
|
|
33
|
-
return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, _ref, _ref2);
|
|
34
|
-
}
|
|
35
|
-
var _ref3 = /*#__PURE__*/_react["default"].createElement(Fonts, null);
|
|
36
|
-
var _ref4 = /*#__PURE__*/_react["default"].createElement("body", null, /*#__PURE__*/_react["default"].createElement(_document.Main, null), /*#__PURE__*/_react["default"].createElement(_document.NextScript, null));
|
|
37
|
-
var DigiGOVDocument = exports["default"] = /*#__PURE__*/function (_Document) {
|
|
38
|
-
(0, _inherits2["default"])(DigiGOVDocument, _Document);
|
|
39
|
-
function DigiGOVDocument() {
|
|
40
|
-
(0, _classCallCheck2["default"])(this, DigiGOVDocument);
|
|
41
|
-
return _callSuper(this, DigiGOVDocument, arguments);
|
|
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 });
|
|
42
16
|
}
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
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
|
+
{
|
|
47
40
|
type: "text/javascript",
|
|
48
41
|
dangerouslySetInnerHTML: {
|
|
49
|
-
__html:
|
|
42
|
+
__html: `if (window.document.documentMode) alert('Internet Explorer is not supported. Please use a modern browser!');
|
|
43
|
+
`
|
|
50
44
|
}
|
|
51
|
-
}), _ref3), _ref4);
|
|
52
|
-
}
|
|
53
|
-
}]);
|
|
54
|
-
return DigiGOVDocument;
|
|
55
|
-
}(_document["default"]);
|
|
56
|
-
DigiGOVDocument.getInitialProps = /*#__PURE__*/function () {
|
|
57
|
-
var _ref5 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(ctx) {
|
|
58
|
-
var initialProps;
|
|
59
|
-
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
60
|
-
while (1) switch (_context.prev = _context.next) {
|
|
61
|
-
case 0:
|
|
62
|
-
_context.next = 2;
|
|
63
|
-
return _document["default"].getInitialProps(ctx);
|
|
64
|
-
case 2:
|
|
65
|
-
initialProps = _context.sent;
|
|
66
|
-
return _context.abrupt("return", (0, _extends2["default"])({}, initialProps));
|
|
67
|
-
case 4:
|
|
68
|
-
case "end":
|
|
69
|
-
return _context.stop();
|
|
70
45
|
}
|
|
71
|
-
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
|
|
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.
|
|
75
54
|
};
|
|
76
|
-
}
|
|
55
|
+
};
|
|
56
|
+
//# sourceMappingURL=Document.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
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
CHANGED
|
@@ -1,22 +1,41 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var
|
|
4
|
-
Object.
|
|
5
|
-
|
|
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
|
|
6
31
|
});
|
|
7
|
-
exports
|
|
8
|
-
var
|
|
9
|
-
var
|
|
10
|
-
var
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
var Image = function Image(_ref) {
|
|
15
|
-
var src = _ref.src,
|
|
16
|
-
rest = (0, _objectWithoutProperties2["default"])(_ref, _excluded);
|
|
17
|
-
var basePathSrc = (0, _hooks.useBasePath)(src);
|
|
18
|
-
return /*#__PURE__*/_react["default"].createElement(_image["default"], (0, _extends2["default"])({
|
|
19
|
-
src: basePathSrc
|
|
20
|
-
}, rest));
|
|
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 });
|
|
21
39
|
};
|
|
22
|
-
var
|
|
40
|
+
var Image_default = Image;
|
|
41
|
+
//# sourceMappingURL=Image.js.map
|
package/cjs/Image.js.map
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
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
CHANGED
|
@@ -1,56 +1,67 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
Object.
|
|
6
|
-
|
|
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
|
|
7
31
|
});
|
|
8
|
-
exports
|
|
9
|
-
var
|
|
10
|
-
var
|
|
11
|
-
var
|
|
12
|
-
var
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
var path = router.asPath;
|
|
29
|
-
if (path && path.includes('#')) {
|
|
30
|
-
setTimeout(function () {
|
|
31
|
-
var id = path.replace('#', '');
|
|
32
|
-
var el = window.document.getElementById(id);
|
|
33
|
-
var r = el === null || el === void 0 ? void 0 : el.getBoundingClientRect();
|
|
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, ...other } = props;
|
|
39
|
+
const isExternalLink = (
|
|
40
|
+
//check if url has a file extension or starts with mailto
|
|
41
|
+
/^(?:[a-z]+:)?\/\/|\.pdf|\.docx?|\.xlsx?|^mailto:/i.test(href || "") || // or if props has a target or rel
|
|
42
|
+
other.target === "_blank"
|
|
43
|
+
);
|
|
44
|
+
const router = (0, import_router.useRouter)();
|
|
45
|
+
(0, import_react.useEffect)(() => {
|
|
46
|
+
const path = router.asPath;
|
|
47
|
+
if (path && path.includes("#")) {
|
|
48
|
+
setTimeout(() => {
|
|
49
|
+
const id = path.replace("#", "");
|
|
50
|
+
const el = window.document.getElementById(id);
|
|
51
|
+
const r = el?.getBoundingClientRect();
|
|
34
52
|
if (r) {
|
|
35
|
-
|
|
36
|
-
(_window$top = window.top) === null || _window$top === void 0 ? void 0 : _window$top.scroll({
|
|
53
|
+
window.top?.scroll({
|
|
37
54
|
top: scrollY + r.top,
|
|
38
|
-
behavior:
|
|
55
|
+
behavior: "smooth"
|
|
39
56
|
});
|
|
40
57
|
}
|
|
41
58
|
}, 600);
|
|
42
59
|
}
|
|
43
60
|
}, [router.asPath]);
|
|
44
61
|
if (isExternalLink) {
|
|
45
|
-
return
|
|
46
|
-
ref: ref,
|
|
47
|
-
href: href || '#'
|
|
48
|
-
}, other), props.children);
|
|
62
|
+
return /* @__PURE__ */ import_react.default.createElement(import_Link.LinkBase, { ref, href: href || "#", ...other }, props.children);
|
|
49
63
|
}
|
|
50
|
-
return
|
|
51
|
-
href: href || '#'
|
|
52
|
-
}, other), /*#__PURE__*/_react["default"].createElement(_LinkBase["default"], (0, _extends2["default"])({
|
|
53
|
-
ref: ref
|
|
54
|
-
}, other), props.children));
|
|
64
|
+
return /* @__PURE__ */ import_react.default.createElement(import_link.default, { href: href || "#", ...other }, /* @__PURE__ */ import_react.default.createElement(import_Link.LinkBase, { ref, ...other }, props.children));
|
|
55
65
|
};
|
|
56
|
-
var
|
|
66
|
+
var Link_default = import_react.default.forwardRef(NextLink);
|
|
67
|
+
//# sourceMappingURL=Link.js.map
|
package/cjs/Link.js.map
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/Link.tsx"],
|
|
4
|
+
"sourcesContent": ["import React, { useEffect } from 'react';\nimport Link from 'next/link';\nimport { useRouter } from 'next/router';\nimport { LinkBase } from '@digigov/ui/navigation/Link';\nimport { LinkProps } from '@digigov/ui/navigation/Link';\n\nconst NextLink: React.ForwardRefRenderFunction<HTMLAnchorElement, LinkProps> = (\n props,\n ref\n) => {\n const { href, ...other } = props;\n\n const isExternalLink =\n //check if url has a file extension or starts with mailto\n /^(?:[a-z]+:)?\\/\\/|\\.pdf|\\.docx?|\\.xlsx?|^mailto:/i.test(href || '') ||\n // or if props has a target or rel\n other.target === '_blank';\n\n const router = useRouter();\n\n useEffect(() => {\n const path = router.asPath;\n if (path && path.includes('#')) {\n setTimeout(() => {\n const id = path.replace('#', '');\n const el = window.document.getElementById(id);\n const r = el?.getBoundingClientRect();\n if (r) {\n window.top?.scroll({\n top: scrollY + r.top,\n behavior: 'smooth',\n });\n }\n }, 600);\n }\n }, [router.asPath]);\n\n if (isExternalLink) {\n return (\n <LinkBase ref={ref} href={href || '#'} {...other}>\n {props.children}\n </LinkBase>\n );\n }\n\n return (\n <Link href={href || '#'} {...other}>\n <LinkBase ref={ref} {...other}>\n {props.children}\n </LinkBase>\n </Link>\n );\n};\n\nexport default React.forwardRef(NextLink);\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAiC;AACjC,kBAAiB;AACjB,oBAA0B;AAC1B,kBAAyB;AAGzB,MAAM,WAAyE,CAC7E,OACA,QACG;AACH,QAAM,EAAE,MAAM,GAAG,MAAM,IAAI;AAE3B,QAAM;AAAA;AAAA,IAEJ,oDAAoD,KAAK,QAAQ,EAAE;AAAA,IAEnE,MAAM,WAAW;AAAA;AAEnB,QAAM,aAAS,yBAAU;AAEzB,8BAAU,MAAM;AACd,UAAM,OAAO,OAAO;AACpB,QAAI,QAAQ,KAAK,SAAS,GAAG,GAAG;AAC9B,iBAAW,MAAM;AACf,cAAM,KAAK,KAAK,QAAQ,KAAK,EAAE;AAC/B,cAAM,KAAK,OAAO,SAAS,eAAe,EAAE;AAC5C,cAAM,IAAI,IAAI,sBAAsB;AACpC,YAAI,GAAG;AACL,iBAAO,KAAK,OAAO;AAAA,YACjB,KAAK,UAAU,EAAE;AAAA,YACjB,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,wBAAS,KAAU,MAAM,QAAQ,KAAM,GAAG,SACxC,MAAM,QACT;AAAA,EAEJ;AAEA,SACE,6BAAAA,QAAA,cAAC,YAAAC,SAAA,EAAK,MAAM,QAAQ,KAAM,GAAG,SAC3B,6BAAAD,QAAA,cAAC,wBAAS,KAAW,GAAG,SACrB,MAAM,QACT,CACF;AAEJ;AAEA,IAAO,eAAQ,aAAAA,QAAM,WAAW,QAAQ;",
|
|
6
|
+
"names": ["React", "Link"]
|
|
7
|
+
}
|
package/cjs/hooks/index.js
CHANGED
|
@@ -1,11 +1,32 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.
|
|
4
|
-
|
|
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
|
|
5
21
|
});
|
|
6
|
-
exports
|
|
7
|
-
var
|
|
22
|
+
module.exports = __toCommonJS(hooks_exports);
|
|
23
|
+
var import_router = require("next/router");
|
|
8
24
|
function useBasePath(src) {
|
|
9
|
-
|
|
25
|
+
const router = (0, import_router.useRouter)();
|
|
10
26
|
return router.basePath + src;
|
|
11
|
-
}
|
|
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
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
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
CHANGED
|
@@ -1,22 +1,47 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var
|
|
4
|
-
Object.
|
|
5
|
-
|
|
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
|
|
6
31
|
});
|
|
7
|
-
exports
|
|
8
|
-
var
|
|
9
|
-
var
|
|
10
|
-
function initI18n(resources) {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
.init({
|
|
14
|
-
resources: resources,
|
|
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,
|
|
15
38
|
lng: language,
|
|
16
|
-
keySeparator:
|
|
39
|
+
keySeparator: ".",
|
|
17
40
|
// we use keys in form messages.welcome
|
|
18
41
|
interpolation: {
|
|
19
|
-
escapeValue: false
|
|
42
|
+
escapeValue: false
|
|
43
|
+
// react already safes from xss
|
|
20
44
|
}
|
|
21
45
|
});
|
|
22
|
-
}
|
|
46
|
+
}
|
|
47
|
+
//# sourceMappingURL=i18n.js.map
|
package/cjs/i18n.js.map
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
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
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
//# sourceMappingURL=index.js.map
|
package/cjs/index.js.map
ADDED
package/hooks/index.js
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
|
-
import { useRouter } from
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { useRouter } from "next/router";
|
|
2
|
+
function useBasePath(src) {
|
|
3
|
+
const router = useRouter();
|
|
4
4
|
return router.basePath + src;
|
|
5
|
-
}
|
|
5
|
+
}
|
|
6
|
+
export {
|
|
7
|
+
useBasePath
|
|
8
|
+
};
|
|
9
|
+
//# sourceMappingURL=hooks.js.map
|
package/hooks.js.map
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
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
CHANGED
|
@@ -1,15 +1,18 @@
|
|
|
1
|
-
import i18n from
|
|
2
|
-
import { initReactI18next } from
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
.init({
|
|
7
|
-
resources: resources,
|
|
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,
|
|
8
6
|
lng: language,
|
|
9
|
-
keySeparator:
|
|
7
|
+
keySeparator: ".",
|
|
10
8
|
// we use keys in form messages.welcome
|
|
11
9
|
interpolation: {
|
|
12
|
-
escapeValue: false
|
|
10
|
+
escapeValue: false
|
|
11
|
+
// react already safes from xss
|
|
13
12
|
}
|
|
14
13
|
});
|
|
15
|
-
}
|
|
14
|
+
}
|
|
15
|
+
export {
|
|
16
|
+
initI18n as default
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=i18n.js.map
|
package/i18n.js.map
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
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
|
+
}
|
package/index.js
CHANGED
package/index.js.map
ADDED
package/package.json
CHANGED
|
@@ -1,21 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@digigov/nextjs",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.5-0c4be34e",
|
|
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": "
|
|
11
|
-
"@digigov/react-core": "
|
|
12
|
-
"@material-ui/core": "4.11.3",
|
|
13
|
-
"@material-ui/icons": "4.11.2",
|
|
10
|
+
"@digigov/ui": "2.0.0-0c4be34e",
|
|
11
|
+
"@digigov/react-core": "2.0.0-0c4be34e",
|
|
14
12
|
"clsx": "1.1.1",
|
|
15
13
|
"i18next": "19.1.0",
|
|
16
|
-
"react": "
|
|
17
|
-
"react-dom": "
|
|
18
|
-
"next": "
|
|
14
|
+
"react": ">=16.8.0 <19.0.0",
|
|
15
|
+
"react-dom": ">=16.8.0 <19.0.0",
|
|
16
|
+
"next": "13.1.1",
|
|
19
17
|
"react-i18next": "11.3.3"
|
|
20
18
|
},
|
|
21
19
|
"gitHead": "7237a2d58c6b30979837579e51251543aff0c240",
|