@tuwaio/docs-ui 0.0.13 → 0.0.15
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 +2 -2
- package/dist/index.d.cts +4 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +2 -2
- package/package.json +8 -7
package/dist/index.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
'use strict';var novaCore=require('@tuwaio/nova-core'),outline=require('@heroicons/react/24/outline'),jsxRuntime=require('react/jsx-runtime'),reactSyntaxHighlighter=require('react-syntax-highlighter'),prism=require('react-syntax-highlighter/dist/esm/styles/prism'),J=require('next/dynamic'),nextraThemeDocs=require('nextra-theme-docs'),B=require('react'),components=require('nextra/components');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var J__default=/*#__PURE__*/_interopDefault(J);var B__default=/*#__PURE__*/_interopDefault(B);function P({isCopied:e,onCopy:o}){return jsxRuntime.jsx("button",{onClick:o,type:"button",className:novaCore.cn("tuwadocs:h-6 tuwadocs:w-6 tuwadocs:cursor-pointer tuwadocs:transition-colors",e?"tuwadocs:text-[var(--tuwa-success-icon)]":"tuwadocs:text-[var(--tuwa-text-secondary)] tuwadocs:hover:text-[var(--tuwa-text-primary)]"),children:e?jsxRuntime.jsx(outline.CheckCircleIcon,{}):jsxRuntime.jsx(outline.Square2StackIcon,{})})}function L({title:e,titleIcons:o,children:t,textToCopy:r}){let{isCopied:c,copy:a}=novaCore.useCopyToClipboard(1500);return jsxRuntime.jsxs("div",{className:novaCore.cn("tuwadocs:group tuwadocs:overflow-hidden tuwadocs:rounded-[var(--tuwa-rounded-corners)] tuwadocs:border","tuwadocs:border-[var(--tuwa-border-secondary)] tuwadocs:bg-[var(--tuwa-bg-primary)]"),children:[jsxRuntime.jsxs("div",{className:novaCore.cn("tuwadocs:flex tuwadocs:items-center tuwadocs:justify-between tuwadocs:gap-4 tuwadocs:px-4 tuwadocs:py-2","tuwadocs:border-b tuwadocs:border-[var(--tuwa-border-secondary)] tuwadocs:bg-[var(--tuwa-bg-secondary)]"),children:[jsxRuntime.jsxs("div",{className:"tuwadocs:flex tuwadocs:items-center tuwadocs:gap-2",children:[jsxRuntime.jsx("div",{className:"tuwadocs:h-[20px] tuwadocs:w-[20px] tuwadocs:text-[var(--tuwa-text-secondary)]",children:o}),jsxRuntime.jsx("p",{className:"tuwadocs:text-sm tuwadocs:font-medium tuwadocs:text-[var(--tuwa-text-primary)]",children:e})]}),jsxRuntime.jsx("div",{className:"tuwadocs:transition tuwadocs:md:opacity-0 tuwadocs:group-hover:opacity-100",children:jsxRuntime.jsx(P,{isCopied:c,onCopy:()=>a(r)})})]}),t]})}var K=({children:e})=>jsxRuntime.jsx(jsxRuntime.Fragment,{children:e}),V=J__default.default(()=>Promise.resolve(K),{ssr:false});function E({children:e,language:o,resolvedTheme:t}){return jsxRuntime.jsx("div",{className:"tuwadocs:border-t tuwadocs:border-[var(--tuwa-border-secondary)]",children:jsxRuntime.jsx(V,{children:jsxRuntime.jsx(reactSyntaxHighlighter.Prism,{language:o??"bash",customStyle:{margin:0,background:"transparent"},style:t==="dark"?prism.materialOceanic:prism.materialLight,children:String(e).replace(/\n$/,"")})})})}function It({features:e}){return jsxRuntime.jsx("div",{className:"tuwadocs:grid tuwadocs:grid-cols-1 tuwadocs:md:grid-cols-3 tuwadocs:gap-6 tuwadocs:mt-12",children:e.map(o=>jsxRuntime.jsxs("div",{className:"tuwadocs:p-6 tuwadocs:border tuwadocs:rounded-[var(--tuwa-rounded-corners)] tuwadocs:hover:shadow-lg tuwadocs:transition-shadow",children:[jsxRuntime.jsx("div",{className:"tuwadocs:text-2xl tuwadocs:mb-3",children:o.icon}),jsxRuntime.jsx("h3",{className:"tuwadocs:text-lg tuwadocs:font-semibold tuwadocs:mb-2",children:o.title}),jsxRuntime.jsx("p",{className:"tuwadocs:text-[var(--tuwa-text-secondary)]",children:o.description})]},o.title))})}var I=[{title:"NPM",href:"https://npmjs.com/org/tuwaio",className:"tuwadocs:hover:text-red-600 tuwadocs:dark:hover:text-red-400",image:jsxRuntime.jsx("svg",{className:"tuwadocs:w-4 tuwadocs:h-4",fill:"currentColor",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{d:"M1.763 0C.786 0 0 .786 0 1.763v20.474C0 23.214.786 24 1.763 24h20.474c.977 0 1.763-.786 1.763-1.763V1.763C24 .786 23.214 0 22.237 0H1.763zM5.13 5.323l13.837.019-.009 13.836h-3.464l.01-10.382h-3.456L12.04 19.17H5.113l.017-13.847z"})})}],G=[{title:"NPM",href:"https://npmjs.com/org/tuwaio",className:"tuwa-footer-link--npm",image:jsxRuntime.jsx("svg",{className:"tuwadocs:w-4 tuwadocs:h-4",fill:"currentColor",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{d:"M1.763 0C.786 0 0 .786 0 1.763v20.474C0 23.214.786 24 1.763 24h20.474c.977 0 1.763-.786 1.763-1.763V1.763C24 .786 23.214 0 22.237 0H1.763zM5.13 5.323l13.837.019-.009 13.836h-3.464l.01-10.382h-3.456L12.04 19.17H5.113l.017-13.847z"})})},{title:"GitHub",href:"https://github.com/TuwaIO",className:"tuwa-footer-link--github",image:jsxRuntime.jsx("svg",{className:"tuwadocs:w-4 tuwadocs:h-4",fill:"currentColor",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{d:"M12 0c-6.626 0-12 5.373-12 12 0 5.302 3.438 9.8 8.207 11.387.599.111.793-.261.793-.577v-2.234c-3.338.726-4.033-1.416-4.033-1.416-.546-1.387-1.333-1.756-1.333-1.756-1.089-.745.083-.729.083-.729 1.205.084 1.839 1.237 1.839 1.237 1.07 1.834 2.807 1.304 3.492.997.107-.775.418-1.305.762-1.604-2.665-.305-5.467-1.334-5.467-5.931 0-1.311.469-2.381 1.236-3.221-.124-.303-.535-1.524.117-3.176 0 0 1.008-.322 3.301 1.23.957-.266 1.983-.399 3.003-.404 1.02.005 2.047.138 3.006.404 2.291-1.552 3.297-1.23 3.297-1.23.653 1.653.242 2.874.118 3.176.77.84 1.235 1.911 1.235 3.221 0 4.609-2.807 5.624-5.479 5.921.43.372.823 1.102.823 2.222v3.293c0 .319.192.694.801.576 4.765-1.589 8.199-6.086 8.199-11.386 0-6.627-5.373-12-12-12z"})})}];function $t({links:e,logo:o}){return jsxRuntime.jsx(nextraThemeDocs.Footer,{children:jsxRuntime.jsxs("div",{className:"tuwadocs:flex tuwadocs:w-full tuwadocs:flex-col tuwadocs:items-center tuwadocs:sm:items-start tuwa-footer-border tuwadocs:pt-8",children:[jsxRuntime.jsxs("div",{className:"tuwadocs:mb-6 tuwadocs:flex tuwadocs:items-center tuwadocs:gap-4 tuwadocs:w-full tuwadocs:justify-between",children:[jsxRuntime.jsx("div",{className:"tuwadocs:flex tuwadocs:items-center",children:o}),jsxRuntime.jsx("div",{className:"tuwadocs:flex tuwadocs:items-center tuwadocs:gap-4 tuwadocs:text-sm",children:(e??G).map(({title:t,href:r,image:c,className:a})=>jsxRuntime.jsxs("a",{href:r,target:"_blank",rel:"noopener noreferrer",className:novaCore.cn("tuwa-footer-link tuwadocs:flex tuwadocs:items-center tuwadocs:gap-1",a),children:[c,jsxRuntime.jsx("span",{className:"tuwadocs:hidden tuwadocs:sm:inline",children:t})]},t))})]}),jsxRuntime.jsxs("div",{className:"tuwadocs:w-full tuwa-footer-border tuwadocs:pt-4",children:[jsxRuntime.jsxs("div",{className:"tuwadocs:flex tuwadocs:flex-col tuwadocs:sm:flex-row tuwadocs:justify-between tuwadocs:items-start tuwadocs:sm:items-center tuwadocs:gap-4",children:[jsxRuntime.jsxs("div",{className:"tuwadocs:flex-1",children:[jsxRuntime.jsx("p",{className:"tuwa-footer-description",children:"The modular, headless-first Web3 infrastructure. Build self-custodial applications with zero vendor lock-in."}),jsxRuntime.jsx("p",{className:"tuwa-footer-license",children:"Licensed under Apache 2.0. Open source and free to use."})]}),jsxRuntime.jsxs("div",{className:"tuwa-footer-copyright",children:["\xA9 2025 - ",new Date().getFullYear()," TUWA. All rights reserved."]})]}),jsxRuntime.jsx("div",{className:"tuwadocs:flex tuwadocs:flex-wrap tuwadocs:items-center tuwadocs:gap-3 tuwadocs:mt-4 tuwadocs:pt-4 tuwa-footer-border"})]})]})})}var rt="https://raw.githubusercontent.com/TuwaIO/workflows/refs/heads/main/preview/logo_v1.svg";function A(e){return e.replace(/-([a-z])/g,(o,t)=>t.toUpperCase())}function ct(e){let o={};return e.split(";").forEach(t=>{let r=t.trim();if(!r)return;let c=r.indexOf(":");if(c===-1)return;let a=r.slice(0,c).trim(),s=r.slice(c+1).trim();a&&s&&(o[A(a)]=s);}),o}function H(e){if(e==="class")return "className";if(e.includes(":")){let[o,t]=e.split(":");return o+t.charAt(0).toUpperCase()+t.slice(1)}return A(e)}function nt(e){let o=[],t=[],r=/(<!--[\s\S]*?-->)|(<\s*\/\s*([a-zA-Z0-9:-]+)\s*>)|(<\s*([a-zA-Z0-9:-]+)([^>]*?)\/?>)|([^<]+)/g,c=/([a-zA-Z0-9:-]+)\s*=\s*(?:"([^"]*?)"|'([^']*?)')/g,a;for(;(a=r.exec(e))!==null;)if(!a[1]){if(a[2]){let s=a[3].toLowerCase(),n=[];for(;t.length>0&&t[t.length-1].tag!==s;)n.push(t.pop());if(t.length>0){let d=t.pop();d.children=[...n.reverse(),...d.children],t.length>0?t[t.length-1].children.push(d):o.push(d);}else for(;n.length>0;)t.push(n.pop());continue}if(a[4]){let s=a[5].toLowerCase(),n=a[6],d=a[4].endsWith("/>")||a[4].endsWith("/ >"),g={},i;for(;(i=c.exec(n))!==null;)g[i[1]]=i[2]||i[3]||"";let l={tag:s,attrs:g,children:[]};d?t.length>0?t[t.length-1].children.push(l):o.push(l):t.push(l);continue}if(a[7]){let s=a[7].trim();s&&(t.length>0?t[t.length-1].children.push(s):o.push(s));}}for(;t.length>0;){let s=t.pop();t.length>0?t[t.length-1].children.push(s):o.push(s);}return o.filter(s=>typeof s!="string")}function F(e,o){let t=e.tag;if(t==="script")return null;let r={key:o};for(let[a,s]of Object.entries(e.attrs)){let n=H(a);n==="style"?r.style=ct(s):r[n]=s;}let c=[];for(let a=0;a<e.children.length;a++){let s=e.children[a];if(typeof s=="string")c.push(s);else {let n=F(s,`${o}-${a}`);n!==null&&c.push(n);}}return c.length===0?B__default.default.createElement(t,r):B__default.default.createElement(t,r,...c)}async function Wt({url:e=rt,className:o,style:t,...r}){let c=[],a={},s=false;try{let n=await fetch(e,{next:{revalidate:86400}});if(!n.ok)throw new Error(`Failed to fetch SVG from remote source: ${n.status}`);let i=(await n.text()).replace(/<!--[\s\S]*?-->/g,"").replace(/<\?xml[\s\S]*?\?>/g,"").trim().match(/<svg([^>]*?)>([\s\S]*?)<\/svg>/i);if(!i)throw new Error("Invalid or corrupted SVG layout payload");let l=i[1],U=i[2],k={},W=/([a-zA-Z0-9:-]+)\s*=\s*(?:"([^"]*?)"|'([^']*?)')/g,h;for(;(h=W.exec(l))!==null;){let f=h[1],x=h[2]||h[3]||"",b=H(f);b!=="className"&&b!=="style"&&(k[b]=x);}a=k,c=nt(U).map((f,x)=>F(f,`logo-node-${x}`)).filter(f=>f!==null);}catch(n){console.error("Core/UI Runtime Error fetching remote SVG:",n),s=true;}return s?jsxRuntime.jsx("svg",{className:o,style:t,...r}):jsxRuntime.jsx("svg",{...a,className:o,style:t,...r,children:c})}function Kt({links:e,logo:o}){return jsxRuntime.jsx(nextraThemeDocs.Navbar,{logo:o,children:jsxRuntime.jsx("div",{className:"tuwadocs:flex tuwadocs:items-center tuwadocs:gap-3",children:(e??I).map(({title:t,href:r,image:c,className:a})=>jsxRuntime.jsxs("a",{href:r,target:"_blank",rel:"noopener noreferrer",className:novaCore.cn("tuwadocs:hidden tuwadocs:sm:flex tuwadocs:items-center tuwadocs:gap-1 tuwadocs:px-3 tuwadocs:py-1.5 tuwadocs:text-sm tuwadocs:font-medium tuwadocs:transition-colors tuwadocs:text-[var(--tuwa-text-primary)]",a),children:[c,t]},t))})})}var O=[{title:"pnpm",command:"pnpm add"},{title:"bun",command:"bun add"},{title:"npm",command:"npm install"},{title:"yarn",command:"yarn add"}];function se({packagesList:e,resolvedTheme:o}){return jsxRuntime.jsx("div",{className:"tuwadocs:my-4",children:jsxRuntime.jsx(components.Tabs,{items:O.map(t=>t.title),children:O.map(t=>jsxRuntime.jsx(components.Tabs.Tab,{children:jsxRuntime.jsx(L,{title:"Terminal",titleIcons:jsxRuntime.jsx(outline.CommandLineIcon,{}),textToCopy:`${t.command} ${e}`,children:jsxRuntime.jsx(E,{resolvedTheme:o,language:"bash",children:`${t.command} ${e}`})})},t.title))})})}function ie({href:e,children:o}){return jsxRuntime.jsx("a",{className:novaCore.cn("tuwadocs:font-medium tuwadocs:text-[var(--tuwa-text-accent)]","tuwadocs:transition-all tuwadocs:hover:underline tuwadocs:underline-offset-4"),href:e,target:"_blank",rel:"noopener noreferrer",children:o})}var pe=({src:e,poster:o,autoplay:t=false,muted:r=false,loop:c=false,controls:a=true,className:s="",aspectRatio:n="aspect-video",onPlay:d,onPause:g,onEnded:i,"aria-label":l})=>jsxRuntime.jsx("div",{className:novaCore.cn("tuwadocs:relative tuwadocs:w-full tuwadocs:overflow-hidden tuwadocs:rounded-[var(--tuwa-rounded-corners)] tuwadocs:bg-black tuwadocs:my-4",n,s),children:jsxRuntime.jsxs("video",{src:e,poster:o,controls:a,autoPlay:t,muted:r,loop:c,className:novaCore.cn("tuwadocs:absolute tuwadocs:inset-0 tuwadocs:h-full tuwadocs:w-full tuwadocs:object-contain","tuwadocs:transition-opacity tuwadocs:duration-200","tuwadocs:focus:outline-none tuwadocs:focus:ring-[length:var(--tuwa-ring-width)] tuwadocs:focus:ring-[var(--tuwa-text-accent)] tuwadocs:focus:ring-offset-[length:var(--tuwa-ring-width)] tuwadocs:focus:ring-offset-[var(--tuwa-bg-primary)]"),onPlay:d,onPause:g,onEnded:i,"aria-label":l,preload:"metadata",children:[jsxRuntime.jsx("track",{kind:"captions"}),"Your browser does not support the video tag. Please"," ",jsxRuntime.jsx("a",{href:e,download:true,className:"tuwadocs:text-[var(--tuwa-text-accent)] tuwadocs:underline tuwadocs:hover:opacity-80",children:"download the video"})," ","to watch it."]})});
|
|
2
|
-
exports.CodeBlock=
|
|
1
|
+
'use strict';var novaCore=require('@tuwaio/nova-core'),outline=require('@heroicons/react/24/outline'),jsxRuntime=require('react/jsx-runtime'),reactSyntaxHighlighter=require('react-syntax-highlighter'),prism=require('react-syntax-highlighter/dist/esm/styles/prism'),react=require('react'),nextraThemeDocs=require('nextra-theme-docs'),J=require('html-react-parser'),components=require('nextra/components');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var J__default=/*#__PURE__*/_interopDefault(J);function b({isCopied:o,onCopy:t}){return jsxRuntime.jsx("button",{onClick:t,type:"button",className:novaCore.cn("tuwadocs:h-6 tuwadocs:w-6 tuwadocs:cursor-pointer tuwadocs:transition-colors",o?"tuwadocs:text-[var(--tuwa-success-icon)]":"tuwadocs:text-[var(--tuwa-text-secondary)] tuwadocs:hover:text-[var(--tuwa-text-primary)]"),children:o?jsxRuntime.jsx(outline.CheckCircleIcon,{}):jsxRuntime.jsx(outline.Square2StackIcon,{})})}function C({title:o,titleIcons:t,children:e,textToCopy:s}){let{isCopied:r,copy:c}=novaCore.useCopyToClipboard(1500);return jsxRuntime.jsxs("div",{className:novaCore.cn("tuwadocs:group tuwadocs:overflow-hidden tuwadocs:rounded-[var(--tuwa-rounded-corners)] tuwadocs:border","tuwadocs:border-[var(--tuwa-border-secondary)] tuwadocs:bg-[var(--tuwa-bg-primary)]"),children:[jsxRuntime.jsxs("div",{className:novaCore.cn("tuwadocs:flex tuwadocs:items-center tuwadocs:justify-between tuwadocs:gap-4 tuwadocs:px-4 tuwadocs:py-2","tuwadocs:border-b tuwadocs:border-[var(--tuwa-border-secondary)] tuwadocs:bg-[var(--tuwa-bg-secondary)]"),children:[jsxRuntime.jsxs("div",{className:"tuwadocs:flex tuwadocs:items-center tuwadocs:gap-2",children:[jsxRuntime.jsx("div",{className:"tuwadocs:h-[20px] tuwadocs:w-[20px] tuwadocs:text-[var(--tuwa-text-secondary)]",children:t}),jsxRuntime.jsx("p",{className:"tuwadocs:text-sm tuwadocs:font-medium tuwadocs:text-[var(--tuwa-text-primary)]",children:o})]}),jsxRuntime.jsx("div",{className:"tuwadocs:transition tuwadocs:md:opacity-0 tuwadocs:group-hover:opacity-100",children:jsxRuntime.jsx(b,{isCopied:r,onCopy:()=>c(s)})})]}),e]})}function g({children:o}){let[t,e]=react.useState(false);return react.useEffect(()=>{e(true);},[]),t?jsxRuntime.jsx(jsxRuntime.Fragment,{children:o}):null}function k({children:o,language:t,resolvedTheme:e}){return jsxRuntime.jsx("div",{className:"tuwadocs:border-t tuwadocs:border-[var(--tuwa-border-secondary)]",children:jsxRuntime.jsx(g,{children:jsxRuntime.jsx(reactSyntaxHighlighter.Prism,{language:t??"bash",customStyle:{margin:0,background:"transparent"},style:e==="dark"?prism.materialOceanic:prism.materialLight,children:String(o).replace(/\n$/,"")})})})}function Ct({features:o}){return jsxRuntime.jsx("div",{className:"tuwadocs:grid tuwadocs:grid-cols-1 tuwadocs:md:grid-cols-3 tuwadocs:gap-6 tuwadocs:mt-12",children:o.map(t=>jsxRuntime.jsxs("div",{className:"tuwadocs:p-6 tuwadocs:border tuwadocs:rounded-[var(--tuwa-rounded-corners)] tuwadocs:hover:shadow-lg tuwadocs:transition-shadow",children:[jsxRuntime.jsx("div",{className:"tuwadocs:text-2xl tuwadocs:mb-3",children:t.icon}),jsxRuntime.jsx("h3",{className:"tuwadocs:text-lg tuwadocs:font-semibold tuwadocs:mb-2",children:t.title}),jsxRuntime.jsx("p",{className:"tuwadocs:text-[var(--tuwa-text-secondary)]",children:t.description})]},t.title))})}var P=[{title:"NPM",href:"https://npmjs.com/org/tuwaio",className:"tuwadocs:hover:text-red-600 tuwadocs:dark:hover:text-red-400",image:jsxRuntime.jsx("svg",{className:"tuwadocs:w-4 tuwadocs:h-4",fill:"currentColor",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{d:"M1.763 0C.786 0 0 .786 0 1.763v20.474C0 23.214.786 24 1.763 24h20.474c.977 0 1.763-.786 1.763-1.763V1.763C24 .786 23.214 0 22.237 0H1.763zM5.13 5.323l13.837.019-.009 13.836h-3.464l.01-10.382h-3.456L12.04 19.17H5.113l.017-13.847z"})})}],R=[{title:"NPM",href:"https://npmjs.com/org/tuwaio",className:"tuwa-footer-link--npm",image:jsxRuntime.jsx("svg",{className:"tuwadocs:w-4 tuwadocs:h-4",fill:"currentColor",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{d:"M1.763 0C.786 0 0 .786 0 1.763v20.474C0 23.214.786 24 1.763 24h20.474c.977 0 1.763-.786 1.763-1.763V1.763C24 .786 23.214 0 22.237 0H1.763zM5.13 5.323l13.837.019-.009 13.836h-3.464l.01-10.382h-3.456L12.04 19.17H5.113l.017-13.847z"})})},{title:"GitHub",href:"https://github.com/TuwaIO",className:"tuwa-footer-link--github",image:jsxRuntime.jsx("svg",{className:"tuwadocs:w-4 tuwadocs:h-4",fill:"currentColor",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{d:"M12 0c-6.626 0-12 5.373-12 12 0 5.302 3.438 9.8 8.207 11.387.599.111.793-.261.793-.577v-2.234c-3.338.726-4.033-1.416-4.033-1.416-.546-1.387-1.333-1.756-1.333-1.756-1.089-.745.083-.729.083-.729 1.205.084 1.839 1.237 1.839 1.237 1.07 1.834 2.807 1.304 3.492.997.107-.775.418-1.305.762-1.604-2.665-.305-5.467-1.334-5.467-5.931 0-1.311.469-2.381 1.236-3.221-.124-.303-.535-1.524.117-3.176 0 0 1.008-.322 3.301 1.23.957-.266 1.983-.399 3.003-.404 1.02.005 2.047.138 3.006.404 2.291-1.552 3.297-1.23 3.297-1.23.653 1.653.242 2.874.118 3.176.77.84 1.235 1.911 1.235 3.221 0 4.609-2.807 5.624-5.479 5.921.43.372.823 1.102.823 2.222v3.293c0 .319.192.694.801.576 4.765-1.589 8.199-6.086 8.199-11.386 0-6.627-5.373-12-12-12z"})})}];function It({links:o,logo:t}){return jsxRuntime.jsx(nextraThemeDocs.Footer,{children:jsxRuntime.jsxs("div",{className:"tuwadocs:flex tuwadocs:w-full tuwadocs:flex-col tuwadocs:items-center tuwadocs:sm:items-start tuwa-footer-border tuwadocs:pt-8",children:[jsxRuntime.jsxs("div",{className:"tuwadocs:mb-6 tuwadocs:flex tuwadocs:items-center tuwadocs:gap-4 tuwadocs:w-full tuwadocs:justify-between",children:[jsxRuntime.jsx("div",{className:"tuwadocs:flex tuwadocs:items-center",children:t}),jsxRuntime.jsx("div",{className:"tuwadocs:flex tuwadocs:items-center tuwadocs:gap-4 tuwadocs:text-sm",children:(o??R).map(({title:e,href:s,image:r,className:c})=>jsxRuntime.jsxs("a",{href:s,target:"_blank",rel:"noopener noreferrer",className:novaCore.cn("tuwa-footer-link tuwadocs:flex tuwadocs:items-center tuwadocs:gap-1",c),children:[r,jsxRuntime.jsx("span",{className:"tuwadocs:hidden tuwadocs:sm:inline",children:e})]},e))})]}),jsxRuntime.jsxs("div",{className:"tuwadocs:w-full tuwa-footer-border tuwadocs:pt-4",children:[jsxRuntime.jsxs("div",{className:"tuwadocs:flex tuwadocs:flex-col tuwadocs:sm:flex-row tuwadocs:justify-between tuwadocs:items-start tuwadocs:sm:items-center tuwadocs:gap-4",children:[jsxRuntime.jsxs("div",{className:"tuwadocs:flex-1",children:[jsxRuntime.jsx("p",{className:"tuwa-footer-description",children:"The modular, headless-first Web3 infrastructure. Build self-custodial applications with zero vendor lock-in."}),jsxRuntime.jsx("p",{className:"tuwa-footer-license",children:"Licensed under Apache 2.0. Open source and free to use."})]}),jsxRuntime.jsxs("div",{className:"tuwa-footer-copyright",children:["\xA9 2025 - ",new Date().getFullYear()," TUWA. All rights reserved."]})]}),jsxRuntime.jsx("div",{className:"tuwadocs:flex tuwadocs:flex-wrap tuwadocs:items-center tuwadocs:gap-3 tuwadocs:mt-4 tuwadocs:pt-4 tuwa-footer-border"})]})]})})}var X="https://raw.githubusercontent.com/TuwaIO/workflows/refs/heads/main/preview/logo_v1.svg";async function Ot({url:o=X,className:t,style:e,...s}){let r;try{let a=await fetch(o,{next:{revalidate:86400}});if(!a.ok)throw new Error(`Failed to fetch SVG: ${a.status}`);r=await a.text();}catch(a){return console.error("RemoteLogo: Failed to fetch SVG from remote source:",a),jsxRuntime.jsx("svg",{className:t,style:e,...s})}let c=r.replace(/<\?xml[\s\S]*?\?>/g,"").replace(/<!DOCTYPE[\s\S]*?>/gi,"").trim(),m=J__default.default(c,{replace(a){if(a instanceof J.Element&&a.name==="svg"){let p=J.domToReact(a.children);return jsxRuntime.jsx("svg",{...a.attribs,className:t,style:e,...s,children:p})}}});return jsxRuntime.jsx(jsxRuntime.Fragment,{children:m})}function Dt({links:o,logo:t}){return jsxRuntime.jsx(nextraThemeDocs.Navbar,{logo:t,children:jsxRuntime.jsx("div",{className:"tuwadocs:flex tuwadocs:items-center tuwadocs:gap-3",children:(o??P).map(({title:e,href:s,image:r,className:c})=>jsxRuntime.jsxs("a",{href:s,target:"_blank",rel:"noopener noreferrer",className:novaCore.cn("tuwadocs:hidden tuwadocs:sm:flex tuwadocs:items-center tuwadocs:gap-1 tuwadocs:px-3 tuwadocs:py-1.5 tuwadocs:text-sm tuwadocs:font-medium tuwadocs:transition-colors tuwadocs:text-[var(--tuwa-text-primary)]",c),children:[r,e]},e))})})}var L=[{title:"pnpm",command:"pnpm add"},{title:"bun",command:"bun add"},{title:"npm",command:"npm install"},{title:"yarn",command:"yarn add"}];function Kt({packagesList:o,resolvedTheme:t}){return jsxRuntime.jsx("div",{className:"tuwadocs:my-4",children:jsxRuntime.jsx(components.Tabs,{items:L.map(e=>e.title),children:L.map(e=>jsxRuntime.jsx(components.Tabs.Tab,{children:jsxRuntime.jsx(C,{title:"Terminal",titleIcons:jsxRuntime.jsx(outline.CommandLineIcon,{}),textToCopy:`${e.command} ${o}`,children:jsxRuntime.jsx(k,{resolvedTheme:t,language:"bash",children:`${e.command} ${o}`})})},e.title))})})}function jt({href:o,children:t}){return jsxRuntime.jsx("a",{className:novaCore.cn("tuwadocs:font-medium tuwadocs:text-[var(--tuwa-text-accent)]","tuwadocs:transition-all tuwadocs:hover:underline tuwadocs:underline-offset-4"),href:o,target:"_blank",rel:"noopener noreferrer",children:t})}var ao=({src:o,poster:t,autoplay:e=false,muted:s=false,loop:r=false,controls:c=true,className:m="",aspectRatio:a="aspect-video",onPlay:p,onPause:I,onEnded:H,"aria-label":F})=>jsxRuntime.jsx("div",{className:novaCore.cn("tuwadocs:relative tuwadocs:w-full tuwadocs:overflow-hidden tuwadocs:rounded-[var(--tuwa-rounded-corners)] tuwadocs:bg-black tuwadocs:my-4",a,m),children:jsxRuntime.jsxs("video",{src:o,poster:t,controls:c,autoPlay:e,muted:s,loop:r,className:novaCore.cn("tuwadocs:absolute tuwadocs:inset-0 tuwadocs:h-full tuwadocs:w-full tuwadocs:object-contain","tuwadocs:transition-opacity tuwadocs:duration-200","tuwadocs:focus:outline-none tuwadocs:focus:ring-[length:var(--tuwa-ring-width)] tuwadocs:focus:ring-[var(--tuwa-text-accent)] tuwadocs:focus:ring-offset-[length:var(--tuwa-ring-width)] tuwadocs:focus:ring-offset-[var(--tuwa-bg-primary)]"),onPlay:p,onPause:I,onEnded:H,"aria-label":F,preload:"metadata",children:[jsxRuntime.jsx("track",{kind:"captions"}),"Your browser does not support the video tag. Please"," ",jsxRuntime.jsx("a",{href:o,download:true,className:"tuwadocs:text-[var(--tuwa-text-accent)] tuwadocs:underline tuwadocs:hover:opacity-80",children:"download the video"})," ","to watch it."]})});
|
|
2
|
+
exports.CodeBlock=C;exports.CodeHighlighter=k;exports.CopyIconButton=b;exports.Features=Ct;exports.Footer=It;exports.Navbar=Dt;exports.PackageInstallationTabs=Kt;exports.RemoteLogo=Ot;exports.StyledLink=jt;exports.VideoPlayer=ao;exports.baseFooterLinks=R;exports.baseNavLinks=P;Object.keys(novaCore).forEach(function(k){if(k!=='default'&&!Object.prototype.hasOwnProperty.call(exports,k))Object.defineProperty(exports,k,{enumerable:true,get:function(){return novaCore[k]}})});
|
package/dist/index.d.cts
CHANGED
|
@@ -58,6 +58,10 @@ declare function Footer({ links, logo }: NavProps & {
|
|
|
58
58
|
interface RemoteLogoProps extends react__default.SVGProps<SVGSVGElement> {
|
|
59
59
|
url?: string;
|
|
60
60
|
}
|
|
61
|
+
/**
|
|
62
|
+
* Async Server Component that fetches a remote SVG and renders it
|
|
63
|
+
* as native React elements using html-react-parser.
|
|
64
|
+
*/
|
|
61
65
|
declare function RemoteLogo({ url, className, style, ...props }: RemoteLogoProps): Promise<react__default.JSX.Element>;
|
|
62
66
|
|
|
63
67
|
declare function PackageInstallationTabs({ packagesList, resolvedTheme, }: {
|
package/dist/index.d.ts
CHANGED
|
@@ -58,6 +58,10 @@ declare function Footer({ links, logo }: NavProps & {
|
|
|
58
58
|
interface RemoteLogoProps extends react__default.SVGProps<SVGSVGElement> {
|
|
59
59
|
url?: string;
|
|
60
60
|
}
|
|
61
|
+
/**
|
|
62
|
+
* Async Server Component that fetches a remote SVG and renders it
|
|
63
|
+
* as native React elements using html-react-parser.
|
|
64
|
+
*/
|
|
61
65
|
declare function RemoteLogo({ url, className, style, ...props }: RemoteLogoProps): Promise<react__default.JSX.Element>;
|
|
62
66
|
|
|
63
67
|
declare function PackageInstallationTabs({ packagesList, resolvedTheme, }: {
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {cn,useCopyToClipboard}from'@tuwaio/nova-core';export*from'@tuwaio/nova-core';import {CheckCircleIcon,Square2StackIcon,CommandLineIcon}from'@heroicons/react/24/outline';import {jsx,Fragment,jsxs}from'react/jsx-runtime';import {Prism}from'react-syntax-highlighter';import {materialOceanic,materialLight}from'react-syntax-highlighter/dist/esm/styles/prism';import J from'next/dynamic';import {Footer,Navbar}from'nextra-theme-docs';import B from'react';import {Tabs}from'nextra/components';function P({isCopied:e,onCopy:o}){return jsx("button",{onClick:o,type:"button",className:cn("tuwadocs:h-6 tuwadocs:w-6 tuwadocs:cursor-pointer tuwadocs:transition-colors",e?"tuwadocs:text-[var(--tuwa-success-icon)]":"tuwadocs:text-[var(--tuwa-text-secondary)] tuwadocs:hover:text-[var(--tuwa-text-primary)]"),children:e?jsx(CheckCircleIcon,{}):jsx(Square2StackIcon,{})})}function L({title:e,titleIcons:o,children:t,textToCopy:r}){let{isCopied:c,copy:a}=useCopyToClipboard(1500);return jsxs("div",{className:cn("tuwadocs:group tuwadocs:overflow-hidden tuwadocs:rounded-[var(--tuwa-rounded-corners)] tuwadocs:border","tuwadocs:border-[var(--tuwa-border-secondary)] tuwadocs:bg-[var(--tuwa-bg-primary)]"),children:[jsxs("div",{className:cn("tuwadocs:flex tuwadocs:items-center tuwadocs:justify-between tuwadocs:gap-4 tuwadocs:px-4 tuwadocs:py-2","tuwadocs:border-b tuwadocs:border-[var(--tuwa-border-secondary)] tuwadocs:bg-[var(--tuwa-bg-secondary)]"),children:[jsxs("div",{className:"tuwadocs:flex tuwadocs:items-center tuwadocs:gap-2",children:[jsx("div",{className:"tuwadocs:h-[20px] tuwadocs:w-[20px] tuwadocs:text-[var(--tuwa-text-secondary)]",children:o}),jsx("p",{className:"tuwadocs:text-sm tuwadocs:font-medium tuwadocs:text-[var(--tuwa-text-primary)]",children:e})]}),jsx("div",{className:"tuwadocs:transition tuwadocs:md:opacity-0 tuwadocs:group-hover:opacity-100",children:jsx(P,{isCopied:c,onCopy:()=>a(r)})})]}),t]})}var K=({children:e})=>jsx(Fragment,{children:e}),V=J(()=>Promise.resolve(K),{ssr:false});function E({children:e,language:o,resolvedTheme:t}){return jsx("div",{className:"tuwadocs:border-t tuwadocs:border-[var(--tuwa-border-secondary)]",children:jsx(V,{children:jsx(Prism,{language:o??"bash",customStyle:{margin:0,background:"transparent"},style:t==="dark"?materialOceanic:materialLight,children:String(e).replace(/\n$/,"")})})})}function It({features:e}){return jsx("div",{className:"tuwadocs:grid tuwadocs:grid-cols-1 tuwadocs:md:grid-cols-3 tuwadocs:gap-6 tuwadocs:mt-12",children:e.map(o=>jsxs("div",{className:"tuwadocs:p-6 tuwadocs:border tuwadocs:rounded-[var(--tuwa-rounded-corners)] tuwadocs:hover:shadow-lg tuwadocs:transition-shadow",children:[jsx("div",{className:"tuwadocs:text-2xl tuwadocs:mb-3",children:o.icon}),jsx("h3",{className:"tuwadocs:text-lg tuwadocs:font-semibold tuwadocs:mb-2",children:o.title}),jsx("p",{className:"tuwadocs:text-[var(--tuwa-text-secondary)]",children:o.description})]},o.title))})}var I=[{title:"NPM",href:"https://npmjs.com/org/tuwaio",className:"tuwadocs:hover:text-red-600 tuwadocs:dark:hover:text-red-400",image:jsx("svg",{className:"tuwadocs:w-4 tuwadocs:h-4",fill:"currentColor",viewBox:"0 0 24 24",children:jsx("path",{d:"M1.763 0C.786 0 0 .786 0 1.763v20.474C0 23.214.786 24 1.763 24h20.474c.977 0 1.763-.786 1.763-1.763V1.763C24 .786 23.214 0 22.237 0H1.763zM5.13 5.323l13.837.019-.009 13.836h-3.464l.01-10.382h-3.456L12.04 19.17H5.113l.017-13.847z"})})}],G=[{title:"NPM",href:"https://npmjs.com/org/tuwaio",className:"tuwa-footer-link--npm",image:jsx("svg",{className:"tuwadocs:w-4 tuwadocs:h-4",fill:"currentColor",viewBox:"0 0 24 24",children:jsx("path",{d:"M1.763 0C.786 0 0 .786 0 1.763v20.474C0 23.214.786 24 1.763 24h20.474c.977 0 1.763-.786 1.763-1.763V1.763C24 .786 23.214 0 22.237 0H1.763zM5.13 5.323l13.837.019-.009 13.836h-3.464l.01-10.382h-3.456L12.04 19.17H5.113l.017-13.847z"})})},{title:"GitHub",href:"https://github.com/TuwaIO",className:"tuwa-footer-link--github",image:jsx("svg",{className:"tuwadocs:w-4 tuwadocs:h-4",fill:"currentColor",viewBox:"0 0 24 24",children:jsx("path",{d:"M12 0c-6.626 0-12 5.373-12 12 0 5.302 3.438 9.8 8.207 11.387.599.111.793-.261.793-.577v-2.234c-3.338.726-4.033-1.416-4.033-1.416-.546-1.387-1.333-1.756-1.333-1.756-1.089-.745.083-.729.083-.729 1.205.084 1.839 1.237 1.839 1.237 1.07 1.834 2.807 1.304 3.492.997.107-.775.418-1.305.762-1.604-2.665-.305-5.467-1.334-5.467-5.931 0-1.311.469-2.381 1.236-3.221-.124-.303-.535-1.524.117-3.176 0 0 1.008-.322 3.301 1.23.957-.266 1.983-.399 3.003-.404 1.02.005 2.047.138 3.006.404 2.291-1.552 3.297-1.23 3.297-1.23.653 1.653.242 2.874.118 3.176.77.84 1.235 1.911 1.235 3.221 0 4.609-2.807 5.624-5.479 5.921.43.372.823 1.102.823 2.222v3.293c0 .319.192.694.801.576 4.765-1.589 8.199-6.086 8.199-11.386 0-6.627-5.373-12-12-12z"})})}];function $t({links:e,logo:o}){return jsx(Footer,{children:jsxs("div",{className:"tuwadocs:flex tuwadocs:w-full tuwadocs:flex-col tuwadocs:items-center tuwadocs:sm:items-start tuwa-footer-border tuwadocs:pt-8",children:[jsxs("div",{className:"tuwadocs:mb-6 tuwadocs:flex tuwadocs:items-center tuwadocs:gap-4 tuwadocs:w-full tuwadocs:justify-between",children:[jsx("div",{className:"tuwadocs:flex tuwadocs:items-center",children:o}),jsx("div",{className:"tuwadocs:flex tuwadocs:items-center tuwadocs:gap-4 tuwadocs:text-sm",children:(e??G).map(({title:t,href:r,image:c,className:a})=>jsxs("a",{href:r,target:"_blank",rel:"noopener noreferrer",className:cn("tuwa-footer-link tuwadocs:flex tuwadocs:items-center tuwadocs:gap-1",a),children:[c,jsx("span",{className:"tuwadocs:hidden tuwadocs:sm:inline",children:t})]},t))})]}),jsxs("div",{className:"tuwadocs:w-full tuwa-footer-border tuwadocs:pt-4",children:[jsxs("div",{className:"tuwadocs:flex tuwadocs:flex-col tuwadocs:sm:flex-row tuwadocs:justify-between tuwadocs:items-start tuwadocs:sm:items-center tuwadocs:gap-4",children:[jsxs("div",{className:"tuwadocs:flex-1",children:[jsx("p",{className:"tuwa-footer-description",children:"The modular, headless-first Web3 infrastructure. Build self-custodial applications with zero vendor lock-in."}),jsx("p",{className:"tuwa-footer-license",children:"Licensed under Apache 2.0. Open source and free to use."})]}),jsxs("div",{className:"tuwa-footer-copyright",children:["\xA9 2025 - ",new Date().getFullYear()," TUWA. All rights reserved."]})]}),jsx("div",{className:"tuwadocs:flex tuwadocs:flex-wrap tuwadocs:items-center tuwadocs:gap-3 tuwadocs:mt-4 tuwadocs:pt-4 tuwa-footer-border"})]})]})})}var rt="https://raw.githubusercontent.com/TuwaIO/workflows/refs/heads/main/preview/logo_v1.svg";function A(e){return e.replace(/-([a-z])/g,(o,t)=>t.toUpperCase())}function ct(e){let o={};return e.split(";").forEach(t=>{let r=t.trim();if(!r)return;let c=r.indexOf(":");if(c===-1)return;let a=r.slice(0,c).trim(),s=r.slice(c+1).trim();a&&s&&(o[A(a)]=s);}),o}function H(e){if(e==="class")return "className";if(e.includes(":")){let[o,t]=e.split(":");return o+t.charAt(0).toUpperCase()+t.slice(1)}return A(e)}function nt(e){let o=[],t=[],r=/(<!--[\s\S]*?-->)|(<\s*\/\s*([a-zA-Z0-9:-]+)\s*>)|(<\s*([a-zA-Z0-9:-]+)([^>]*?)\/?>)|([^<]+)/g,c=/([a-zA-Z0-9:-]+)\s*=\s*(?:"([^"]*?)"|'([^']*?)')/g,a;for(;(a=r.exec(e))!==null;)if(!a[1]){if(a[2]){let s=a[3].toLowerCase(),n=[];for(;t.length>0&&t[t.length-1].tag!==s;)n.push(t.pop());if(t.length>0){let d=t.pop();d.children=[...n.reverse(),...d.children],t.length>0?t[t.length-1].children.push(d):o.push(d);}else for(;n.length>0;)t.push(n.pop());continue}if(a[4]){let s=a[5].toLowerCase(),n=a[6],d=a[4].endsWith("/>")||a[4].endsWith("/ >"),g={},i;for(;(i=c.exec(n))!==null;)g[i[1]]=i[2]||i[3]||"";let l={tag:s,attrs:g,children:[]};d?t.length>0?t[t.length-1].children.push(l):o.push(l):t.push(l);continue}if(a[7]){let s=a[7].trim();s&&(t.length>0?t[t.length-1].children.push(s):o.push(s));}}for(;t.length>0;){let s=t.pop();t.length>0?t[t.length-1].children.push(s):o.push(s);}return o.filter(s=>typeof s!="string")}function F(e,o){let t=e.tag;if(t==="script")return null;let r={key:o};for(let[a,s]of Object.entries(e.attrs)){let n=H(a);n==="style"?r.style=ct(s):r[n]=s;}let c=[];for(let a=0;a<e.children.length;a++){let s=e.children[a];if(typeof s=="string")c.push(s);else {let n=F(s,`${o}-${a}`);n!==null&&c.push(n);}}return c.length===0?B.createElement(t,r):B.createElement(t,r,...c)}async function Wt({url:e=rt,className:o,style:t,...r}){let c=[],a={},s=false;try{let n=await fetch(e,{next:{revalidate:86400}});if(!n.ok)throw new Error(`Failed to fetch SVG from remote source: ${n.status}`);let i=(await n.text()).replace(/<!--[\s\S]*?-->/g,"").replace(/<\?xml[\s\S]*?\?>/g,"").trim().match(/<svg([^>]*?)>([\s\S]*?)<\/svg>/i);if(!i)throw new Error("Invalid or corrupted SVG layout payload");let l=i[1],U=i[2],k={},W=/([a-zA-Z0-9:-]+)\s*=\s*(?:"([^"]*?)"|'([^']*?)')/g,h;for(;(h=W.exec(l))!==null;){let f=h[1],x=h[2]||h[3]||"",b=H(f);b!=="className"&&b!=="style"&&(k[b]=x);}a=k,c=nt(U).map((f,x)=>F(f,`logo-node-${x}`)).filter(f=>f!==null);}catch(n){console.error("Core/UI Runtime Error fetching remote SVG:",n),s=true;}return s?jsx("svg",{className:o,style:t,...r}):jsx("svg",{...a,className:o,style:t,...r,children:c})}function Kt({links:e,logo:o}){return jsx(Navbar,{logo:o,children:jsx("div",{className:"tuwadocs:flex tuwadocs:items-center tuwadocs:gap-3",children:(e??I).map(({title:t,href:r,image:c,className:a})=>jsxs("a",{href:r,target:"_blank",rel:"noopener noreferrer",className:cn("tuwadocs:hidden tuwadocs:sm:flex tuwadocs:items-center tuwadocs:gap-1 tuwadocs:px-3 tuwadocs:py-1.5 tuwadocs:text-sm tuwadocs:font-medium tuwadocs:transition-colors tuwadocs:text-[var(--tuwa-text-primary)]",a),children:[c,t]},t))})})}var O=[{title:"pnpm",command:"pnpm add"},{title:"bun",command:"bun add"},{title:"npm",command:"npm install"},{title:"yarn",command:"yarn add"}];function se({packagesList:e,resolvedTheme:o}){return jsx("div",{className:"tuwadocs:my-4",children:jsx(Tabs,{items:O.map(t=>t.title),children:O.map(t=>jsx(Tabs.Tab,{children:jsx(L,{title:"Terminal",titleIcons:jsx(CommandLineIcon,{}),textToCopy:`${t.command} ${e}`,children:jsx(E,{resolvedTheme:o,language:"bash",children:`${t.command} ${e}`})})},t.title))})})}function ie({href:e,children:o}){return jsx("a",{className:cn("tuwadocs:font-medium tuwadocs:text-[var(--tuwa-text-accent)]","tuwadocs:transition-all tuwadocs:hover:underline tuwadocs:underline-offset-4"),href:e,target:"_blank",rel:"noopener noreferrer",children:o})}var pe=({src:e,poster:o,autoplay:t=false,muted:r=false,loop:c=false,controls:a=true,className:s="",aspectRatio:n="aspect-video",onPlay:d,onPause:g,onEnded:i,"aria-label":l})=>jsx("div",{className:cn("tuwadocs:relative tuwadocs:w-full tuwadocs:overflow-hidden tuwadocs:rounded-[var(--tuwa-rounded-corners)] tuwadocs:bg-black tuwadocs:my-4",n,s),children:jsxs("video",{src:e,poster:o,controls:a,autoPlay:t,muted:r,loop:c,className:cn("tuwadocs:absolute tuwadocs:inset-0 tuwadocs:h-full tuwadocs:w-full tuwadocs:object-contain","tuwadocs:transition-opacity tuwadocs:duration-200","tuwadocs:focus:outline-none tuwadocs:focus:ring-[length:var(--tuwa-ring-width)] tuwadocs:focus:ring-[var(--tuwa-text-accent)] tuwadocs:focus:ring-offset-[length:var(--tuwa-ring-width)] tuwadocs:focus:ring-offset-[var(--tuwa-bg-primary)]"),onPlay:d,onPause:g,onEnded:i,"aria-label":l,preload:"metadata",children:[jsx("track",{kind:"captions"}),"Your browser does not support the video tag. Please"," ",jsx("a",{href:e,download:true,className:"tuwadocs:text-[var(--tuwa-text-accent)] tuwadocs:underline tuwadocs:hover:opacity-80",children:"download the video"})," ","to watch it."]})});
|
|
2
|
-
export{
|
|
1
|
+
import {cn,useCopyToClipboard}from'@tuwaio/nova-core';export*from'@tuwaio/nova-core';import {CheckCircleIcon,Square2StackIcon,CommandLineIcon}from'@heroicons/react/24/outline';import {jsx,jsxs,Fragment}from'react/jsx-runtime';import {Prism}from'react-syntax-highlighter';import {materialOceanic,materialLight}from'react-syntax-highlighter/dist/esm/styles/prism';import {useState,useEffect}from'react';import {Footer,Navbar}from'nextra-theme-docs';import J,{Element,domToReact}from'html-react-parser';import {Tabs}from'nextra/components';function b({isCopied:o,onCopy:t}){return jsx("button",{onClick:t,type:"button",className:cn("tuwadocs:h-6 tuwadocs:w-6 tuwadocs:cursor-pointer tuwadocs:transition-colors",o?"tuwadocs:text-[var(--tuwa-success-icon)]":"tuwadocs:text-[var(--tuwa-text-secondary)] tuwadocs:hover:text-[var(--tuwa-text-primary)]"),children:o?jsx(CheckCircleIcon,{}):jsx(Square2StackIcon,{})})}function C({title:o,titleIcons:t,children:e,textToCopy:s}){let{isCopied:r,copy:c}=useCopyToClipboard(1500);return jsxs("div",{className:cn("tuwadocs:group tuwadocs:overflow-hidden tuwadocs:rounded-[var(--tuwa-rounded-corners)] tuwadocs:border","tuwadocs:border-[var(--tuwa-border-secondary)] tuwadocs:bg-[var(--tuwa-bg-primary)]"),children:[jsxs("div",{className:cn("tuwadocs:flex tuwadocs:items-center tuwadocs:justify-between tuwadocs:gap-4 tuwadocs:px-4 tuwadocs:py-2","tuwadocs:border-b tuwadocs:border-[var(--tuwa-border-secondary)] tuwadocs:bg-[var(--tuwa-bg-secondary)]"),children:[jsxs("div",{className:"tuwadocs:flex tuwadocs:items-center tuwadocs:gap-2",children:[jsx("div",{className:"tuwadocs:h-[20px] tuwadocs:w-[20px] tuwadocs:text-[var(--tuwa-text-secondary)]",children:t}),jsx("p",{className:"tuwadocs:text-sm tuwadocs:font-medium tuwadocs:text-[var(--tuwa-text-primary)]",children:o})]}),jsx("div",{className:"tuwadocs:transition tuwadocs:md:opacity-0 tuwadocs:group-hover:opacity-100",children:jsx(b,{isCopied:r,onCopy:()=>c(s)})})]}),e]})}function g({children:o}){let[t,e]=useState(false);return useEffect(()=>{e(true);},[]),t?jsx(Fragment,{children:o}):null}function k({children:o,language:t,resolvedTheme:e}){return jsx("div",{className:"tuwadocs:border-t tuwadocs:border-[var(--tuwa-border-secondary)]",children:jsx(g,{children:jsx(Prism,{language:t??"bash",customStyle:{margin:0,background:"transparent"},style:e==="dark"?materialOceanic:materialLight,children:String(o).replace(/\n$/,"")})})})}function Ct({features:o}){return jsx("div",{className:"tuwadocs:grid tuwadocs:grid-cols-1 tuwadocs:md:grid-cols-3 tuwadocs:gap-6 tuwadocs:mt-12",children:o.map(t=>jsxs("div",{className:"tuwadocs:p-6 tuwadocs:border tuwadocs:rounded-[var(--tuwa-rounded-corners)] tuwadocs:hover:shadow-lg tuwadocs:transition-shadow",children:[jsx("div",{className:"tuwadocs:text-2xl tuwadocs:mb-3",children:t.icon}),jsx("h3",{className:"tuwadocs:text-lg tuwadocs:font-semibold tuwadocs:mb-2",children:t.title}),jsx("p",{className:"tuwadocs:text-[var(--tuwa-text-secondary)]",children:t.description})]},t.title))})}var P=[{title:"NPM",href:"https://npmjs.com/org/tuwaio",className:"tuwadocs:hover:text-red-600 tuwadocs:dark:hover:text-red-400",image:jsx("svg",{className:"tuwadocs:w-4 tuwadocs:h-4",fill:"currentColor",viewBox:"0 0 24 24",children:jsx("path",{d:"M1.763 0C.786 0 0 .786 0 1.763v20.474C0 23.214.786 24 1.763 24h20.474c.977 0 1.763-.786 1.763-1.763V1.763C24 .786 23.214 0 22.237 0H1.763zM5.13 5.323l13.837.019-.009 13.836h-3.464l.01-10.382h-3.456L12.04 19.17H5.113l.017-13.847z"})})}],R=[{title:"NPM",href:"https://npmjs.com/org/tuwaio",className:"tuwa-footer-link--npm",image:jsx("svg",{className:"tuwadocs:w-4 tuwadocs:h-4",fill:"currentColor",viewBox:"0 0 24 24",children:jsx("path",{d:"M1.763 0C.786 0 0 .786 0 1.763v20.474C0 23.214.786 24 1.763 24h20.474c.977 0 1.763-.786 1.763-1.763V1.763C24 .786 23.214 0 22.237 0H1.763zM5.13 5.323l13.837.019-.009 13.836h-3.464l.01-10.382h-3.456L12.04 19.17H5.113l.017-13.847z"})})},{title:"GitHub",href:"https://github.com/TuwaIO",className:"tuwa-footer-link--github",image:jsx("svg",{className:"tuwadocs:w-4 tuwadocs:h-4",fill:"currentColor",viewBox:"0 0 24 24",children:jsx("path",{d:"M12 0c-6.626 0-12 5.373-12 12 0 5.302 3.438 9.8 8.207 11.387.599.111.793-.261.793-.577v-2.234c-3.338.726-4.033-1.416-4.033-1.416-.546-1.387-1.333-1.756-1.333-1.756-1.089-.745.083-.729.083-.729 1.205.084 1.839 1.237 1.839 1.237 1.07 1.834 2.807 1.304 3.492.997.107-.775.418-1.305.762-1.604-2.665-.305-5.467-1.334-5.467-5.931 0-1.311.469-2.381 1.236-3.221-.124-.303-.535-1.524.117-3.176 0 0 1.008-.322 3.301 1.23.957-.266 1.983-.399 3.003-.404 1.02.005 2.047.138 3.006.404 2.291-1.552 3.297-1.23 3.297-1.23.653 1.653.242 2.874.118 3.176.77.84 1.235 1.911 1.235 3.221 0 4.609-2.807 5.624-5.479 5.921.43.372.823 1.102.823 2.222v3.293c0 .319.192.694.801.576 4.765-1.589 8.199-6.086 8.199-11.386 0-6.627-5.373-12-12-12z"})})}];function It({links:o,logo:t}){return jsx(Footer,{children:jsxs("div",{className:"tuwadocs:flex tuwadocs:w-full tuwadocs:flex-col tuwadocs:items-center tuwadocs:sm:items-start tuwa-footer-border tuwadocs:pt-8",children:[jsxs("div",{className:"tuwadocs:mb-6 tuwadocs:flex tuwadocs:items-center tuwadocs:gap-4 tuwadocs:w-full tuwadocs:justify-between",children:[jsx("div",{className:"tuwadocs:flex tuwadocs:items-center",children:t}),jsx("div",{className:"tuwadocs:flex tuwadocs:items-center tuwadocs:gap-4 tuwadocs:text-sm",children:(o??R).map(({title:e,href:s,image:r,className:c})=>jsxs("a",{href:s,target:"_blank",rel:"noopener noreferrer",className:cn("tuwa-footer-link tuwadocs:flex tuwadocs:items-center tuwadocs:gap-1",c),children:[r,jsx("span",{className:"tuwadocs:hidden tuwadocs:sm:inline",children:e})]},e))})]}),jsxs("div",{className:"tuwadocs:w-full tuwa-footer-border tuwadocs:pt-4",children:[jsxs("div",{className:"tuwadocs:flex tuwadocs:flex-col tuwadocs:sm:flex-row tuwadocs:justify-between tuwadocs:items-start tuwadocs:sm:items-center tuwadocs:gap-4",children:[jsxs("div",{className:"tuwadocs:flex-1",children:[jsx("p",{className:"tuwa-footer-description",children:"The modular, headless-first Web3 infrastructure. Build self-custodial applications with zero vendor lock-in."}),jsx("p",{className:"tuwa-footer-license",children:"Licensed under Apache 2.0. Open source and free to use."})]}),jsxs("div",{className:"tuwa-footer-copyright",children:["\xA9 2025 - ",new Date().getFullYear()," TUWA. All rights reserved."]})]}),jsx("div",{className:"tuwadocs:flex tuwadocs:flex-wrap tuwadocs:items-center tuwadocs:gap-3 tuwadocs:mt-4 tuwadocs:pt-4 tuwa-footer-border"})]})]})})}var X="https://raw.githubusercontent.com/TuwaIO/workflows/refs/heads/main/preview/logo_v1.svg";async function Ot({url:o=X,className:t,style:e,...s}){let r;try{let a=await fetch(o,{next:{revalidate:86400}});if(!a.ok)throw new Error(`Failed to fetch SVG: ${a.status}`);r=await a.text();}catch(a){return console.error("RemoteLogo: Failed to fetch SVG from remote source:",a),jsx("svg",{className:t,style:e,...s})}let c=r.replace(/<\?xml[\s\S]*?\?>/g,"").replace(/<!DOCTYPE[\s\S]*?>/gi,"").trim(),m=J(c,{replace(a){if(a instanceof Element&&a.name==="svg"){let p=domToReact(a.children);return jsx("svg",{...a.attribs,className:t,style:e,...s,children:p})}}});return jsx(Fragment,{children:m})}function Dt({links:o,logo:t}){return jsx(Navbar,{logo:t,children:jsx("div",{className:"tuwadocs:flex tuwadocs:items-center tuwadocs:gap-3",children:(o??P).map(({title:e,href:s,image:r,className:c})=>jsxs("a",{href:s,target:"_blank",rel:"noopener noreferrer",className:cn("tuwadocs:hidden tuwadocs:sm:flex tuwadocs:items-center tuwadocs:gap-1 tuwadocs:px-3 tuwadocs:py-1.5 tuwadocs:text-sm tuwadocs:font-medium tuwadocs:transition-colors tuwadocs:text-[var(--tuwa-text-primary)]",c),children:[r,e]},e))})})}var L=[{title:"pnpm",command:"pnpm add"},{title:"bun",command:"bun add"},{title:"npm",command:"npm install"},{title:"yarn",command:"yarn add"}];function Kt({packagesList:o,resolvedTheme:t}){return jsx("div",{className:"tuwadocs:my-4",children:jsx(Tabs,{items:L.map(e=>e.title),children:L.map(e=>jsx(Tabs.Tab,{children:jsx(C,{title:"Terminal",titleIcons:jsx(CommandLineIcon,{}),textToCopy:`${e.command} ${o}`,children:jsx(k,{resolvedTheme:t,language:"bash",children:`${e.command} ${o}`})})},e.title))})})}function jt({href:o,children:t}){return jsx("a",{className:cn("tuwadocs:font-medium tuwadocs:text-[var(--tuwa-text-accent)]","tuwadocs:transition-all tuwadocs:hover:underline tuwadocs:underline-offset-4"),href:o,target:"_blank",rel:"noopener noreferrer",children:t})}var ao=({src:o,poster:t,autoplay:e=false,muted:s=false,loop:r=false,controls:c=true,className:m="",aspectRatio:a="aspect-video",onPlay:p,onPause:I,onEnded:H,"aria-label":F})=>jsx("div",{className:cn("tuwadocs:relative tuwadocs:w-full tuwadocs:overflow-hidden tuwadocs:rounded-[var(--tuwa-rounded-corners)] tuwadocs:bg-black tuwadocs:my-4",a,m),children:jsxs("video",{src:o,poster:t,controls:c,autoPlay:e,muted:s,loop:r,className:cn("tuwadocs:absolute tuwadocs:inset-0 tuwadocs:h-full tuwadocs:w-full tuwadocs:object-contain","tuwadocs:transition-opacity tuwadocs:duration-200","tuwadocs:focus:outline-none tuwadocs:focus:ring-[length:var(--tuwa-ring-width)] tuwadocs:focus:ring-[var(--tuwa-text-accent)] tuwadocs:focus:ring-offset-[length:var(--tuwa-ring-width)] tuwadocs:focus:ring-offset-[var(--tuwa-bg-primary)]"),onPlay:p,onPause:I,onEnded:H,"aria-label":F,preload:"metadata",children:[jsx("track",{kind:"captions"}),"Your browser does not support the video tag. Please"," ",jsx("a",{href:o,download:true,className:"tuwadocs:text-[var(--tuwa-text-accent)] tuwadocs:underline tuwadocs:hover:opacity-80",children:"download the video"})," ","to watch it."]})});
|
|
2
|
+
export{C as CodeBlock,k as CodeHighlighter,b as CopyIconButton,Ct as Features,It as Footer,Dt as Navbar,Kt as PackageInstallationTabs,Ot as RemoteLogo,jt as StyledLink,ao as VideoPlayer,R as baseFooterLinks,P as baseNavLinks};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tuwaio/docs-ui",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.15",
|
|
4
4
|
"private": false,
|
|
5
5
|
"author": "Oleksandr Tkach",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -48,28 +48,29 @@
|
|
|
48
48
|
],
|
|
49
49
|
"dependencies": {
|
|
50
50
|
"@tuwaio/nova-core": "^0.4.4",
|
|
51
|
+
"@types/react-syntax-highlighter": "^15.5.13",
|
|
51
52
|
"clsx": "^2.1.1",
|
|
53
|
+
"html-react-parser": "^6.1.3",
|
|
52
54
|
"react-syntax-highlighter": "^16.1.1",
|
|
53
|
-
"@types/react-syntax-highlighter": "^15.5.13",
|
|
54
55
|
"tailwind-merge": "^3.6.0"
|
|
55
56
|
},
|
|
56
57
|
"peerDependencies": {
|
|
57
58
|
"@heroicons/react": ">=2",
|
|
58
|
-
"react": ">=19.2.3",
|
|
59
59
|
"next": ">=16.1",
|
|
60
60
|
"nextra": ">=4.6",
|
|
61
|
-
"nextra-theme-docs": ">=4.6"
|
|
61
|
+
"nextra-theme-docs": ">=4.6",
|
|
62
|
+
"react": ">=19.2.3"
|
|
62
63
|
},
|
|
63
64
|
"devDependencies": {
|
|
64
|
-
"next": "16.2.9",
|
|
65
|
-
"nextra": "^4.6.1",
|
|
66
|
-
"nextra-theme-docs": "^4.6.1",
|
|
67
65
|
"@heroicons/react": "^2.2.0",
|
|
68
66
|
"@tailwindcss/postcss": "^4.3.1",
|
|
69
67
|
"@tailwindcss/vite": "^4.3.1",
|
|
70
68
|
"@types/node": "^25",
|
|
71
69
|
"@types/react": "^19.2.17",
|
|
72
70
|
"autoprefixer": "^10.5.0",
|
|
71
|
+
"next": "16.2.9",
|
|
72
|
+
"nextra": "^4.6.1",
|
|
73
|
+
"nextra-theme-docs": "^4.6.1",
|
|
73
74
|
"postcss": "^8.5.15",
|
|
74
75
|
"postcss-cli": "^11.0.1",
|
|
75
76
|
"react": "^19.2.7",
|