@lidofinance/next-ui-primitives 0.37.1 → 0.39.0
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/dist/index.cjs +3 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +3 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -70,7 +70,9 @@ const $abd0d426949c0843$export$d97afdf95912bfad = (props)=>{
|
|
|
70
70
|
}
|
|
71
71
|
// Code below is only executed on the client side (due to conditions 'if (!mounted)...' above)
|
|
72
72
|
const url = new URL(href, window.location.origin);
|
|
73
|
-
if (url.origin !== window.location.origin)
|
|
73
|
+
if (url.origin !== window.location.origin) // For Next >= 13 we can use <Link ...> (import Link from 'next/link.js')
|
|
74
|
+
// For Next 12 we should use <a ...>
|
|
75
|
+
return /*#__PURE__*/ (0, $93xws$reactjsxruntime.jsx)("a", {
|
|
74
76
|
target: "_blank",
|
|
75
77
|
rel: "noreferrer",
|
|
76
78
|
...rest,
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AEIA,MAAM,2CAAqB,CAAC;IAC1B,IAAI;QACF,gBAAgB;QAChB,IAAI,IAAI;QACR,OAAO;IACT,EAAE,OAAM;QACN,aAAa;QACb,OAAO;IACT;AACF;AAIO,MAAM,4CAAuD,CAAC;IACnE,MAAM,QAAE,IAAI,EAAE,GAAG,MAAM,GAAG;IAE1B,MAAM,EACJ,uCAAuC;IACvC,gFAAgF;IAChF,OAAO,OAAE,GAAG,SAAE,KAAK,EAAE,EACtB,GAAG,CAAA,GAAA,6BAAQ;IAEZ,2EAA2E;IAC3E,gFAAgF;IAChF,gFAAgF;IAChF,MAAM,CAAC,SAAS,WAAW,GAAG,CAAA,GAAA,qBAAO,EAAE;IACvC,CAAA,GAAA,s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AO,SAAS,QACjC,yEAAyE;IACzE,oCAAoC;IACpC,qBAAO,gCAAC;QAAE,QAAQ;QAAU,KAAI;QAAc,GAAG,IAAI;QAAE,MAAM,IAAI;;IAGnE,IAAI,KAAK,IAAI,cAAc,IAAI,OAAO;IACtC,IAAI,OAAO,IAAI,cAAc,IAAI,SAAS;IAE1C,qBAAO,gCAAC,CAAA,GAAA,2CAAG;QAAG,GAAG,IAAI;QAAE,MAAM,IAAI;;AACnC","sources":["packages/next/ui-primitives/src/index.ts","packages/next/ui-primitives/src/components/index.ts","packages/next/ui-primitives/src/components/lidoLink/index.tsx"],"sourcesContent":["export * from './components'\n","export * from './lidoLink'\n","import React, { FC, useState, useEffect } from 'react'\nimport { useRouter } from 'next/router.js'\nimport Link, { LinkProps } from 'next/link.js'\n\nconst isValidAbsoluteUrl = (href: string) => {\n try {\n // External link\n new URL(href)\n return true\n } catch {\n // Local link\n return false\n }\n}\n\nexport type LidoLinkProps = Omit<LinkProps, 'as'> & { href: string }\n\nexport const LidoLink: FC<React.PropsWithChildren<LidoLinkProps>> = (props) => {\n const { href, ...rest } = props\n\n const {\n // `ref` is needed for referral program\n // `embed` is needed for support of `staking widget` via iframe in `ledger-live`\n query: { ref, embed },\n } = useRouter()\n\n // Fix `Hydration failed...` when using `styled-component` with `next/link`\n // https://github.com/vercel/next.js/discussions/35773#discussioncomment-2622885\n // https://github.com/vercel/next.js/discussions/35773#discussioncomment-4166807\n const [mounted, setMounted] = useState(false)\n useEffect(() => setMounted(true), [])\n if (!mounted) {\n // Fix for SEO\n\n if (isValidAbsoluteUrl(href)) {\n // External link\n return <a target={'_blank'} rel=\"noreferrer\" {...rest} href={href} />\n }\n\n // Local link\n return <a {...rest} href={href} />\n }\n // Code below is only executed on the client side (due to conditions 'if (!mounted)...' above)\n\n const url = new URL(href, window.location.origin)\n\n if (url.origin !== window.location.origin) {\n // For Next >= 13 we can use <Link ...> (import Link from 'next/link.js')\n // For Next 12 we should use <a ...>\n return <a target={'_blank'} rel=\"noreferrer\" {...rest} href={url.href} />\n }\n\n if (ref) url.searchParams?.set('ref', ref as string)\n if (embed) url.searchParams?.set('embed', embed as string)\n\n return <Link {...rest} href={url.href} />\n}\n"],"names":[],"version":3,"file":"index.cjs.map"}
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;AAeA,4BAA4B,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,GAAG;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,CAAA;AAEpE,OAAO,MAAM,UAAU,GAAG,MAAM,iBAAiB,CAAC,aAAa,CAAC,
|
|
1
|
+
{"mappings":";;AAeA,4BAA4B,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,GAAG;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,CAAA;AAEpE,OAAO,MAAM,UAAU,GAAG,MAAM,iBAAiB,CAAC,aAAa,CAAC,CAuC/D,CAAA","sources":["packages/next/ui-primitives/src/src/components/lidoLink/index.tsx","packages/next/ui-primitives/src/src/components/index.ts","packages/next/ui-primitives/src/src/index.ts","packages/next/ui-primitives/src/index.ts"],"sourcesContent":[null,null,null,"export * from './components'\n"],"names":[],"version":3,"file":"index.d.ts.map"}
|
package/dist/index.mjs
CHANGED
|
@@ -67,7 +67,9 @@ const $f4b56e66ba788353$export$d97afdf95912bfad = (props)=>{
|
|
|
67
67
|
}
|
|
68
68
|
// Code below is only executed on the client side (due to conditions 'if (!mounted)...' above)
|
|
69
69
|
const url = new URL(href, window.location.origin);
|
|
70
|
-
if (url.origin !== window.location.origin)
|
|
70
|
+
if (url.origin !== window.location.origin) // For Next >= 13 we can use <Link ...> (import Link from 'next/link.js')
|
|
71
|
+
// For Next 12 we should use <a ...>
|
|
72
|
+
return /*#__PURE__*/ (0, $7zhEJ$jsx)("a", {
|
|
71
73
|
target: "_blank",
|
|
72
74
|
rel: "noreferrer",
|
|
73
75
|
...rest,
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 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AAE,EACtB,GAAG,CAAA,GAAA,gBAAQ;IAEZ,2EAA2E;IAC3E,gFAAgF;IAChF,gFAAgF;IAChF,MAAM,CAAC,SAAS,WAAW,GAAG,CAAA,GAAA,eAAO,EAAE;IACvC,CAAA,GAAA,gBAAQ,EAAE,IAAM,WAAW,OAAO,EAAE;IACpC,IAAI,CAAC,SAAS;QACZ,cAAc;QAEd,IAAI,yCAAmB,OACrB,gBAAgB;QAChB,qBAAO,gBAAC;YAAE,QAAQ;YAAU,KAAI;YAAc,GAAG,IAAI;YAAE,MAAM;;QAG/D,aAAa;QACb,qBAAO,gBAAC;YAAG,GAAG,IAAI;YAAE,MAAM;;IAC5B;IACA,8FAA8F;IAE9F,MAAM,MAAM,IAAI,IAAI,MAAM,OAAO,SAAS;IAE1C,IAAI,IAAI,WAAW,OAAO,SAAS,QACjC,yEAAyE;IACzE,oCAAoC;IACpC,qBAAO,gBAAC;QAAE,QAAQ;QAAU,KAAI;QAAc,GAAG,IAAI;QAAE,MAAM,IAAI;;IAGnE,IAAI,KAAK,IAAI,cAAc,IAAI,OAAO;IACtC,IAAI,OAAO,IAAI,cAAc,IAAI,SAAS;IAE1C,qBAAO,gBAAC,CAAA,GAAA,iBAAG;QAAG,GAAG,IAAI;QAAE,MAAM,IAAI;;AACnC","sources":["packages/next/ui-primitives/src/index.ts","packages/next/ui-primitives/src/components/index.ts","packages/next/ui-primitives/src/components/lidoLink/index.tsx"],"sourcesContent":["export * from './components'\n","export * from './lidoLink'\n","import React, { FC, useState, useEffect } from 'react'\nimport { useRouter } from 'next/router.js'\nimport Link, { LinkProps } from 'next/link.js'\n\nconst isValidAbsoluteUrl = (href: string) => {\n try {\n // External link\n new URL(href)\n return true\n } catch {\n // Local link\n return false\n }\n}\n\nexport type LidoLinkProps = Omit<LinkProps, 'as'> & { href: string }\n\nexport const LidoLink: FC<React.PropsWithChildren<LidoLinkProps>> = (props) => {\n const { href, ...rest } = props\n\n const {\n // `ref` is needed for referral program\n // `embed` is needed for support of `staking widget` via iframe in `ledger-live`\n query: { ref, embed },\n } = useRouter()\n\n // Fix `Hydration failed...` when using `styled-component` with `next/link`\n // https://github.com/vercel/next.js/discussions/35773#discussioncomment-2622885\n // https://github.com/vercel/next.js/discussions/35773#discussioncomment-4166807\n const [mounted, setMounted] = useState(false)\n useEffect(() => setMounted(true), [])\n if (!mounted) {\n // Fix for SEO\n\n if (isValidAbsoluteUrl(href)) {\n // External link\n return <a target={'_blank'} rel=\"noreferrer\" {...rest} href={href} />\n }\n\n // Local link\n return <a {...rest} href={href} />\n }\n // Code below is only executed on the client side (due to conditions 'if (!mounted)...' above)\n\n const url = new URL(href, window.location.origin)\n\n if (url.origin !== window.location.origin) {\n // For Next >= 13 we can use <Link ...> (import Link from 'next/link.js')\n // For Next 12 we should use <a ...>\n return <a target={'_blank'} rel=\"noreferrer\" {...rest} href={url.href} />\n }\n\n if (ref) url.searchParams?.set('ref', ref as string)\n if (embed) url.searchParams?.set('embed', embed as string)\n\n return <Link {...rest} href={url.href} />\n}\n"],"names":[],"version":3,"file":"index.mjs.map"}
|
package/package.json
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
"url": "https://github.com/lidofinance/warehouse/issues"
|
|
8
8
|
},
|
|
9
9
|
"license": "MIT",
|
|
10
|
-
"version": "0.
|
|
10
|
+
"version": "0.39.0",
|
|
11
11
|
"files": [
|
|
12
12
|
"dist"
|
|
13
13
|
],
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"react": "17 || 18"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
|
-
"@lidofinance/config-prettier": "~0.
|
|
39
|
+
"@lidofinance/config-prettier": "~0.39.0",
|
|
40
40
|
"@types/react": "^18.0.25",
|
|
41
41
|
"next": "^12.3.0"
|
|
42
42
|
}
|