瀏覽代碼

[doc]Update next document

dufu1991 1 年之前
父節點
當前提交
d305746db6

+ 4 - 2
docs/site/src/components/header/Header.svelte

@@ -180,8 +180,9 @@
 						</svg>
 					</div>
 					<!-- GitHub -->
+					<!-- main -> next -->
 					<a
-						href="https://github.com/any-tdf/stdf"
+						href="https://github.com/any-tdf/stdf/tree/next"
 						class="rounded px-4 py-1 text-center hover:bg-gray-100 dark:hover:bg-gray-700"
 						target="_blank"
 					>
@@ -270,8 +271,9 @@
 				</svg>
 			</button>
 			<!-- GitHub -->
+			<!-- main -> next -->
 			<a
-				href="https://github.com/any-tdf/stdf"
+				href="https://github.com/any-tdf/stdf/tree/next"
 				class="inline-block rounded px-4 py-1 transition-all hover:bg-black/5 dark:hover:bg-white/5"
 				target="_blank"
 				title={isZh ? '跳转至 GitHub' : 'Jump to GitHub'}

+ 42 - 41
docs/site/src/pages/components/FAQ.svelte

@@ -1,52 +1,53 @@
 <script>
-    // @ts-nocheck
+	// @ts-nocheck
 
-    import { mdTextToHljs } from '../../utils/index';
+	import { mdTextToHljs } from '../../utils/index';
 
-    export let guide = 'button';
-    const isZh = localStorage.getItem('lang') === 'zh_CN';
+	export let guide = 'button';
+	const isZh = localStorage.getItem('lang') === 'zh_CN';
 
-    let loading = true;
-    const getMdStrFunc = async nav => {
-        loading = true;
-        const rawObj = await import(`../../../../mds/components/${nav}/FAQ${isZh ? '' : '_en'}.md`);
-        const mdStr = rawObj.default;
-        loading = false;
-        return mdTextToHljs(mdStr.replace(/<a href="/g, '<a target="_blank" href="'));
-    };
-    $: guideText = getMdStrFunc(guide).then(res => {
-        // @ts-ignore
-        guideText = res;
-    });
+	let loading = true;
+	const getMdStrFunc = async (nav) => {
+		loading = true;
+		const rawObj = await import(`../../../../mds/components/${nav}/FAQ${isZh ? '' : '_en'}.md`);
+		const mdStr = rawObj.default;
+		loading = false;
+		return mdTextToHljs(mdStr.replace(/<a href="/g, '<a target="_blank" href="'));
+	};
+	$: guideText = getMdStrFunc(guide).then((res) => {
+		// @ts-ignore
+		guideText = res;
+	});
 </script>
 
-<p class="text-xs mb-4 text-black/40 dark:text-white/30">
-    {isZh
-        ? '注:请将开发中遇到的问题或想法提到 GitHub Issue,后续会筛选出有代表性的问题整理在此处。'
-        : 'Note: Please raise any issues or ideas encountered in development to GitHub Issue, and then select representative issues to organize here.'}
+<p class="mb-4 text-xs text-black/40 dark:text-white/30">
+	{isZh
+		? '注:请将开发中遇到的问题或想法提到 GitHub Issue,后续会筛选出有代表性的问题整理在此处。'
+		: 'Note: Please raise any issues or ideas encountered in development to GitHub Issue, and then select representative issues to organize here.'}
 </p>
 <article
-    class="prose dark:prose-invert max-w-none pb-12 prose-table:break-all overflow-x-auto prose-td:whitespace-nowrap md:prose-td:whitespace-normal"
+	class="prose dark:prose-invert prose-table:break-all prose-td:whitespace-nowrap md:prose-td:whitespace-normal max-w-none overflow-x-auto pb-12"
 >
-    {#if loading}
-        {isZh ? '请等待...' : 'Please wait...'}
-    {:else}
-        {@html guideText}
-    {/if}
+	{#if loading}
+		{isZh ? '请等待...' : 'Please wait...'}
+	{:else}
+		{@html guideText}
+	{/if}
 </article>
-<div class="pb-8 text-xs flex gap-2">
-    <a
-        href={'https://github.com/any-tdf/stdf/edit/main/doc/components/' + guide + '/FAQ' + (isZh ? '' : '_en') + '.md'}
-        target="_blank"
-        class="flex text-primary dark:text-dark"
-    >
-        <span class="h-4 w-4 mr-1">
-            <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" class="w-4 h-4" style="fill: currentColor;">
-                <path
-                    d="M12.8995 6.85431L17.1421 11.0969L7.24264 20.9964H3V16.7538L12.8995 6.85431ZM14.3137 5.44009L16.435 3.31877C16.8256 2.92825 17.4587 2.92825 17.8492 3.31877L20.6777 6.1472C21.0682 6.53772 21.0682 7.17089 20.6777 7.56141L18.5563 9.68273L14.3137 5.44009Z"
-                />
-            </svg>
-        </span>
-        {isZh ? '在 GitHub 上编辑' : 'Edit on GitHub'}
-    </a>
+<div class="flex gap-2 pb-8 text-xs">
+	<!-- main -> next -->
+	<a
+		href={'https://github.com/any-tdf/stdf/edit/next/docs/mds/components/' + guide + '/FAQ' + (isZh ? '' : '_en') + '.md'}
+		target="_blank"
+		class="text-primary dark:text-dark flex"
+	>
+		<span class="mr-1 h-4 w-4">
+			<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" class="h-4 w-4" style="fill: currentColor;">
+				<path
+					d="M12.8995 6.85431L17.1421 11.0969L7.24264 20.9964H3V16.7538L12.8995 6.85431ZM14.3137 5.44009L16.435 3.31877C16.8256 2.92825 17.4587 2.92825 17.8492 3.31877L20.6777 6.1472C21.0682 6.53772 21.0682 7.17089 20.6777 7.56141L18.5563 9.68273L14.3137 5.44009Z"
+				/>
+			</svg>
+		</span>
+		{isZh ? '在 GitHub 上编辑' : 'Edit on GitHub'}
+	</a>
 </div>

+ 72 - 71
docs/site/src/pages/components/Guide.svelte

@@ -1,87 +1,88 @@
 <script>
-    // @ts-nocheck
+	// @ts-nocheck
 
-    import { mdTextToHljs } from './../../utils/index';
-    import { themeStore, sysThemeStore, isWideScreenStore } from '../../store';
+	import { mdTextToHljs } from './../../utils/index';
+	import { themeStore, sysThemeStore, isWideScreenStore } from '../../store';
 
-    export let guide = 'button';
+	export let guide = 'button';
 
-    const isZh = localStorage.getItem('lang') === 'zh_CN';
-    let loading = true;
-    $: theme = $themeStore === 'auto' ? ($sysThemeStore === 'dark' ? 'dark' : 'light') : $themeStore;
-    const getMdStrFunc = async nav => {
-        loading = true;
-        const rawObj = await import(`../../../../mds/components/${nav}/guide${isZh ? '' : '_en'}.md`);
-        const mdStr = rawObj.default;
-        loading = false;
-        return mdTextToHljs(
-            mdStr
-                .replace(/<img src="/g, `<img class="w-full md:w-1/2${theme === 'dark' ? ' invert' : ''}" src="./assets/images/guide/`)
-                .replace(/<a href="/g, '<a target="_blank" href="')
-        );
-    };
-    $: guideText = getMdStrFunc(guide).then(res => {
-        guideText = res;
-    });
+	const isZh = localStorage.getItem('lang') === 'zh_CN';
+	let loading = true;
+	$: theme = $themeStore === 'auto' ? ($sysThemeStore === 'dark' ? 'dark' : 'light') : $themeStore;
+	const getMdStrFunc = async (nav) => {
+		loading = true;
+		const rawObj = await import(`../../../../mds/components/${nav}/guide${isZh ? '' : '_en'}.md`);
+		const mdStr = rawObj.default;
+		loading = false;
+		return mdTextToHljs(
+			mdStr
+				.replace(/<img src="/g, `<img class="w-full md:w-1/2${theme === 'dark' ? ' invert' : ''}" src="./assets/images/guide/`)
+				.replace(/<a href="/g, '<a target="_blank" href="')
+		);
+	};
+	$: guideText = getMdStrFunc(guide).then((res) => {
+		guideText = res;
+	});
 
-    // 全屏
-    const changeFullFunc = () => {
-        if ($isWideScreenStore) {
-            isWideScreenStore.set(false);
-            localStorage.setItem('isFull', 'notFull');
-        } else {
-            isWideScreenStore.set(true);
-            localStorage.setItem('isFull', 'full');
-        }
-    };
+	// 全屏
+	const changeFullFunc = () => {
+		if ($isWideScreenStore) {
+			isWideScreenStore.set(false);
+			localStorage.setItem('isFull', 'notFull');
+		} else {
+			isWideScreenStore.set(true);
+			localStorage.setItem('isFull', 'full');
+		}
+	};
 </script>
 
 <article
-    class="prose prose-strong:text-primary dark:prose-strong:text-dark dark:prose-invert pb-12 {$isWideScreenStore
-        ? 'max-w-full'
-        : 'max-w-5xl'}"
+	class="prose prose-strong:text-primary dark:prose-strong:text-dark dark:prose-invert pb-12 {$isWideScreenStore
+		? 'max-w-full'
+		: 'max-w-5xl'}"
 >
-    {#if loading}
-        {isZh ? '请等待...' : 'Please wait...'}
-    {:else}
-        {@html guideText}
-    {/if}
+	{#if loading}
+		{isZh ? '请等待...' : 'Please wait...'}
+	{:else}
+		{@html guideText}
+	{/if}
 </article>
 
-<div class="pb-8 text-xs flex gap-2">
-    <a
-        href={'https://github.com/any-tdf/stdf/edit/main/doc/components/' + guide + '/guide' + (isZh ? '' : '_en') + '.md'}
-        target="_blank"
-        class="flex text-primary dark:text-dark"
-    >
-        <span class="h-4 w-4 mr-1">
-            <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" class="w-4 h-4" style="fill: currentColor;">
-                <path
-                    d="M12.8995 6.85431L17.1421 11.0969L7.24264 20.9964H3V16.7538L12.8995 6.85431ZM14.3137 5.44009L16.435 3.31877C16.8256 2.92825 17.4587 2.92825 17.8492 3.31877L20.6777 6.1472C21.0682 6.53772 21.0682 7.17089 20.6777 7.56141L18.5563 9.68273L14.3137 5.44009Z"
-                />
-            </svg>
-        </span>
-        {isZh ? '在 GitHub 上编辑' : 'Edit on GitHub'}
-    </a>
+<div class="flex gap-2 pb-8 text-xs">
+	<!-- main -> next -->
+	<a
+		href={'https://github.com/any-tdf/stdf/edit/next/docs/mds/components/' + guide + '/guide' + (isZh ? '' : '_en') + '.md'}
+		target="_blank"
+		class="text-primary dark:text-dark flex"
+	>
+		<span class="mr-1 h-4 w-4">
+			<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" class="h-4 w-4" style="fill: currentColor;">
+				<path
+					d="M12.8995 6.85431L17.1421 11.0969L7.24264 20.9964H3V16.7538L12.8995 6.85431ZM14.3137 5.44009L16.435 3.31877C16.8256 2.92825 17.4587 2.92825 17.8492 3.31877L20.6777 6.1472C21.0682 6.53772 21.0682 7.17089 20.6777 7.56141L18.5563 9.68273L14.3137 5.44009Z"
+				/>
+			</svg>
+		</span>
+		{isZh ? '在 GitHub 上编辑' : 'Edit on GitHub'}
+	</a>
 </div>
 
 <button
-    class="hidden md:block fixed right-2 bottom-4 z-50 p-1.5 w-8 h-8 rounded-full bg-primary dark:bg-dark text-white dark:text-black shadow-md shadow-primary/50 dark:shadow-dark/50"
-    on:click={changeFullFunc}
+	class="bg-primary dark:bg-dark shadow-primary/50 dark:shadow-dark/50 fixed bottom-4 right-2 z-50 hidden h-8 w-8 rounded-full p-1.5 text-white shadow-md md:block dark:text-black"
+	on:click={changeFullFunc}
 >
-    {#if $isWideScreenStore}
-        <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"
-            ><path
-                d="M20 3C20.5523 3 21 3.44772 21 4V20C21 20.5523 20.5523 21 20 21H4C3.44772 21 3 20.5523 3 20V4C3 3.44772 3.44772 3 4 3H20ZM11 5H5V19H11V15H13V19H19V5H13V9H11V5ZM15 9L18 12L15 15V13H9V15L6 12L9 9V11H15V9Z"
-                fill="currentColor"
-            ></path></svg
-        >
-    {:else}
-        <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"
-            ><path
-                d="M20 3C20.5523 3 21 3.44772 21 4V20C21 20.5523 20.5523 21 20 21H4C3.44772 21 3 20.5523 3 20V4C3 3.44772 3.44772 3 4 3H20ZM11 5H5V10.999H7V9L10 12L7 15V13H5V19H11V17H13V19H19V13H17V15L14 12L17 9V10.999H19V5H13V7H11V5ZM13 13V15H11V13H13ZM13 9V11H11V9H13Z"
-                fill="currentColor"
-            ></path></svg
-        >
-    {/if}
+	{#if $isWideScreenStore}
+		<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"
+			><path
+				d="M20 3C20.5523 3 21 3.44772 21 4V20C21 20.5523 20.5523 21 20 21H4C3.44772 21 3 20.5523 3 20V4C3 3.44772 3.44772 3 4 3H20ZM11 5H5V19H11V15H13V19H19V5H13V9H11V5ZM15 9L18 12L15 15V13H9V15L6 12L9 9V11H15V9Z"
+				fill="currentColor"
+			></path></svg
+		>
+	{:else}
+		<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"
+			><path
+				d="M20 3C20.5523 3 21 3.44772 21 4V20C21 20.5523 20.5523 21 20 21H4C3.44772 21 3 20.5523 3 20V4C3 3.44772 3.44772 3 4 3H20ZM11 5H5V10.999H7V9L10 12L7 15V13H5V19H11V17H13V19H19V13H17V15L14 12L17 9V10.999H19V5H13V7H11V5ZM13 13V15H11V13H13ZM13 9V11H11V9H13Z"
+				fill="currentColor"
+			></path></svg
+		>
+	{/if}
 </button>

+ 113 - 112
docs/site/src/pages/components/Version.svelte

@@ -1,128 +1,129 @@
 <script>
-    // @ts-nocheck
+	// @ts-nocheck
 
-    import { mdTextToHljs } from '../../utils/index';
+	import { mdTextToHljs } from '../../utils/index';
 
-    export let guide = 'button';
-    const isZh = localStorage.getItem('lang') === 'zh_CN';
+	export let guide = 'button';
+	const isZh = localStorage.getItem('lang') === 'zh_CN';
 
-    let loading = true;
+	let loading = true;
 
-    //提取字符中以‘[!tag’开头且以‘]’结尾的所有字符串,组成数组,并返回数组
-    const getTags = str => {
-        return str.match(/\[!tag[^\]]+\]/g);
-    };
+	//提取字符中以‘[!tag’开头且以‘]’结尾的所有字符串,组成数组,并返回数组
+	const getTags = (str) => {
+		return str.match(/\[!tag[^\]]+\]/g);
+	};
 
-    //提取字符中以‘[!issue‘开头且以‘]’结尾的所有字符串,组成数组,并返回数组
-    const getIssues = str => {
-        return str.match(/\[!issue[^\]]+\]/g);
-    };
+	//提取字符中以‘[!issue‘开头且以‘]’结尾的所有字符串,组成数组,并返回数组
+	const getIssues = (str) => {
+		return str.match(/\[!issue[^\]]+\]/g);
+	};
 
-    //提取字符中以‘[!contribute‘开头且以‘]’结尾的所有字符串,组成数组,并返回数组
-    const getContributes = str => {
-        return str.match(/\[!contribute[^\]]+\]/g);
-    };
+	//提取字符中以‘[!contribute‘开头且以‘]’结尾的所有字符串,组成数组,并返回数组
+	const getContributes = (str) => {
+		return str.match(/\[!contribute[^\]]+\]/g);
+	};
 
-    // 传入 tag 类型和 index,返回对应的 emoji
-    const spanTextFun = (type, index) => {
-        if (type === 'O') {
-            return '👏';
-        }
-        if (type === 'A') {
-            return '💪';
-        }
-        switch (index) {
-            case '1':
-                return '👊';
-            case '2':
-                return '✊';
-            case '3':
-                return '👎';
-            default:
-                return '👎';
-        }
-    };
-    //替换Markdown中的标签
-    const mdTextToHljsFun = string => {
-        //替换tag
-        const tagList = getTags(string);
-        if (tagList) {
-            tagList.forEach(item => {
-                const arr = item.split('|');
-                // const span = `<span class="w-2 h-2 text-xs inline-block rounded-full mr-1 ${bgClassFun(arr[1], arr[2])}"></span>`;
-                const span = `<span class="mr-1">${spanTextFun(arr[1], arr[2])}</span>`;
-                string = string.replace(item, span);
-            });
-        }
-        //替换issue
-        const issueList = getIssues(string);
-        if (issueList) {
-            issueList.forEach(item => {
-                const arr = item.split('|');
-                const span = `<span><a href="https://github.com/${
-                    arr[1]
-                }" target="_blank"><img class="w-4 h-4 ml-1 p-0 m-0 rounded-full overflow-hidden inline" src="https://avatars.githubusercontent.com/${
-                    arr[1]
-                }" title="${isZh ? '感谢' : 'Thanks'} ${arr[1]} ${isZh ? '提出 Issue' : 'raise an Issue'}" alt=""></a></span>`;
-                string = string.replace(item, span);
-            });
-        }
-        //替换contribute
-        const contributeList = getContributes(string);
-        if (contributeList) {
-            contributeList.forEach(item => {
-                const arr = item.split('|');
-                const span = `<span><a href="https://github.com/${
-                    arr[1]
-                }" target="_blank"><img class="w-4 h-4 ml-1 p-0 m-0 rounded-full overflow-hidden inline" src="https://avatars.githubusercontent.com/${
-                    arr[1]
-                }" title="${isZh ? '感谢' : 'Thanks'} ${arr[1]} ${isZh ? '贡献代码' : 'contribute code'}" alt=""></a></span>`;
-                string = string.replace(item, span);
-            });
-        }
-        return string;
-    };
+	// 传入 tag 类型和 index,返回对应的 emoji
+	const spanTextFun = (type, index) => {
+		if (type === 'O') {
+			return '👏';
+		}
+		if (type === 'A') {
+			return '💪';
+		}
+		switch (index) {
+			case '1':
+				return '👊';
+			case '2':
+				return '✊';
+			case '3':
+				return '👎';
+			default:
+				return '👎';
+		}
+	};
+	//替换Markdown中的标签
+	const mdTextToHljsFun = (string) => {
+		//替换tag
+		const tagList = getTags(string);
+		if (tagList) {
+			tagList.forEach((item) => {
+				const arr = item.split('|');
+				// const span = `<span class="w-2 h-2 text-xs inline-block rounded-full mr-1 ${bgClassFun(arr[1], arr[2])}"></span>`;
+				const span = `<span class="mr-1">${spanTextFun(arr[1], arr[2])}</span>`;
+				string = string.replace(item, span);
+			});
+		}
+		//替换issue
+		const issueList = getIssues(string);
+		if (issueList) {
+			issueList.forEach((item) => {
+				const arr = item.split('|');
+				const span = `<span><a href="https://github.com/${
+					arr[1]
+				}" target="_blank"><img class="w-4 h-4 ml-1 p-0 m-0 rounded-full overflow-hidden inline" src="https://avatars.githubusercontent.com/${
+					arr[1]
+				}" title="${isZh ? '感谢' : 'Thanks'} ${arr[1]} ${isZh ? '提出 Issue' : 'raise an Issue'}" alt=""></a></span>`;
+				string = string.replace(item, span);
+			});
+		}
+		//替换contribute
+		const contributeList = getContributes(string);
+		if (contributeList) {
+			contributeList.forEach((item) => {
+				const arr = item.split('|');
+				const span = `<span><a href="https://github.com/${
+					arr[1]
+				}" target="_blank"><img class="w-4 h-4 ml-1 p-0 m-0 rounded-full overflow-hidden inline" src="https://avatars.githubusercontent.com/${
+					arr[1]
+				}" title="${isZh ? '感谢' : 'Thanks'} ${arr[1]} ${isZh ? '贡献代码' : 'contribute code'}" alt=""></a></span>`;
+				string = string.replace(item, span);
+			});
+		}
+		return string;
+	};
 
-    const getMdStrFunc = async nav => {
-        loading = true;
-        const rawObj = await import(`../../../../mds/components/${nav}/version${isZh ? '' : '_en'}.md`);
-        const mdStr = rawObj.default;
-        loading = false;
-        return mdTextToHljs(mdStr.replace(/<a href="/g, '<a target="_blank" href="'));
-    };
-    $: guideText = getMdStrFunc(guide).then(res => {
-        // @ts-ignore
-        guideText = mdTextToHljsFun(res);
-    });
+	const getMdStrFunc = async (nav) => {
+		loading = true;
+		const rawObj = await import(`../../../../mds/components/${nav}/version${isZh ? '' : '_en'}.md`);
+		const mdStr = rawObj.default;
+		loading = false;
+		return mdTextToHljs(mdStr.replace(/<a href="/g, '<a target="_blank" href="'));
+	};
+	$: guideText = getMdStrFunc(guide).then((res) => {
+		// @ts-ignore
+		guideText = mdTextToHljsFun(res);
+	});
 </script>
 
-<div class="text-xs mb-4 text-black/40 dark:text-white/30 max-w-5xl">
-    {isZh
-        ? '注:👊、✊、👎 分别表示严重、一般、轻微三个等级的 BUG,👏 表示优化,💪 表示新增。描述后面的头像表示此项的提出者或贡献者,感谢他们。'
-        : 'Note: 👊, ✊, and 👎 represent three levels of severity for bugs, with 👊 being the most severe and 👎 the least severe. 👏 means optimization, and 💪 means new feature. The avatar after the description represents the proposer or contributor of the item. We thank them for their contributions. '}
+<div class="mb-4 max-w-5xl text-xs text-black/40 dark:text-white/30">
+	{isZh
+		? '注:👊、✊、👎 分别表示严重、一般、轻微三个等级的 BUG,👏 表示优化,💪 表示新增。描述后面的头像表示此项的提出者或贡献者,感谢他们。'
+		: 'Note: 👊, ✊, and 👎 represent three levels of severity for bugs, with 👊 being the most severe and 👎 the least severe. 👏 means optimization, and 💪 means new feature. The avatar after the description represents the proposer or contributor of the item. We thank them for their contributions. '}
 </div>
 <article
-    class="prose dark:prose-invert max-w-none pb-12 prose-table:break-all overflow-x-auto prose-td:whitespace-nowrap md:prose-td:whitespace-normal"
+	class="prose dark:prose-invert prose-table:break-all prose-td:whitespace-nowrap md:prose-td:whitespace-normal max-w-none overflow-x-auto pb-12"
 >
-    {#if loading}
-        {isZh ? '请等待...' : 'Please wait...'}
-    {:else}
-        {@html guideText}
-    {/if}
+	{#if loading}
+		{isZh ? '请等待...' : 'Please wait...'}
+	{:else}
+		{@html guideText}
+	{/if}
 </article>
-<div class="pb-8 text-xs flex gap-2">
-    <a
-        href={'https://github.com/any-tdf/stdf/edit/main/doc/components/' + guide + '/version' + (isZh ? '' : '_en') + '.md'}
-        class="flex text-primary dark:text-dark"
-        target="_blank"
-    >
-        <span class="h-4 w-4 mr-1">
-            <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" class="w-4 h-4" style="fill: currentColor;">
-                <path
-                    d="M12.8995 6.85431L17.1421 11.0969L7.24264 20.9964H3V16.7538L12.8995 6.85431ZM14.3137 5.44009L16.435 3.31877C16.8256 2.92825 17.4587 2.92825 17.8492 3.31877L20.6777 6.1472C21.0682 6.53772 21.0682 7.17089 20.6777 7.56141L18.5563 9.68273L14.3137 5.44009Z"
-                />
-            </svg>
-        </span>
-        {isZh ? '在 GitHub 上编辑' : 'Edit on GitHub'}
-    </a>
+<div class="flex gap-2 pb-8 text-xs">
+	<!-- main -> next -->
+	<a
+		href={'https://github.com/any-tdf/stdf/edit/next/docs/mds/components/' + guide + '/version' + (isZh ? '' : '_en') + '.md'}
+		class="text-primary dark:text-dark flex"
+		target="_blank"
+	>
+		<span class="mr-1 h-4 w-4">
+			<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" class="h-4 w-4" style="fill: currentColor;">
+				<path
+					d="M12.8995 6.85431L17.1421 11.0969L7.24264 20.9964H3V16.7538L12.8995 6.85431ZM14.3137 5.44009L16.435 3.31877C16.8256 2.92825 17.4587 2.92825 17.8492 3.31877L20.6777 6.1472C21.0682 6.53772 21.0682 7.17089 20.6777 7.56141L18.5563 9.68273L14.3137 5.44009Z"
+				/>
+			</svg>
+		</span>
+		{isZh ? '在 GitHub 上编辑' : 'Edit on GitHub'}
+	</a>
 </div>

+ 50 - 49
docs/site/src/pages/guide/Guide.svelte

@@ -46,7 +46,7 @@
 		'/generator': Generator,
 		'/create': Create,
 		'/icon-plugin': IconPlugin,
-		'/': QuickStart,
+		'/': QuickStart
 	};
 
 	let params = new URLSearchParams('?' + $querystring);
@@ -62,16 +62,16 @@
 				{ title: '更新日志', title_en: 'Changelog', nav: 'changelog', doc: 'changelog' },
 				{ title: '常见问题', title_en: 'FAQ', nav: 'faq', doc: 'faq' },
 				{ title: '贡献指南', title_en: 'Contribution Guide', nav: 'contribution', doc: 'contribution' },
-				{ title: '兼容性', title_en: 'Compatibility', nav: 'compatibility', doc: 'compatibility' },
-			],
+				{ title: '兼容性', title_en: 'Compatibility', nav: 'compatibility', doc: 'compatibility' }
+			]
 		},
 		{
 			class: '设计',
 			class_en: 'Design',
 			childs: [
 				{ title: '色彩', title_en: 'Color', nav: 'color' },
-				{ title: 'LOGO', title_en: 'LOGO', nav: 'logo' },
-			],
+				{ title: 'LOGO', title_en: 'LOGO', nav: 'logo' }
+			]
 		},
 		{
 			class: '工具',
@@ -81,8 +81,8 @@
 				{ title: 'IDE 插件', title_en: 'IDE plugin', nav: 'vscode', doc: 'vscode' },
 				{ title: '脚手架', title_en: 'Create cli', nav: 'create' },
 				{ title: '图标插件', title_en: 'Icon plugin', nav: 'icon-plugin' },
-				{ title: '快捷键', title_en: 'Shortcut key', nav: 'shortkey' },
-			],
+				{ title: '快捷键', title_en: 'Shortcut key', nav: 'shortkey' }
+			]
 		},
 		{
 			class: '其他',
@@ -90,9 +90,9 @@
 			childs: [
 				{ title: '关于', title_en: 'About', nav: 'about', doc: 'about' },
 				{ title: '里程碑', title_en: 'Milestone', nav: 'milestone', doc: 'milestone' },
-				{ title: '计划', title_en: 'Future', nav: 'future', doc: 'future' },
-			],
-		},
+				{ title: '计划', title_en: 'Future', nav: 'future', doc: 'future' }
+			]
+		}
 	];
 	//扁平 menuList
 	const flatMenuList = [];
@@ -104,7 +104,7 @@
 	const getMenuHeightFun = () => {
 		menuHeight = document.documentElement.clientHeight - 56;
 	};
-	const menuClickFun = currentMenu => {
+	const menuClickFun = (currentMenu) => {
 		if ($isShowNavStore) {
 			isShowNavStore.set;
 		}
@@ -137,7 +137,7 @@
 			}
 			// 去掉 locationNoGuide 开头的 /
 			const locationNoGuideNoSlash = locationNoGuide.replace('/', '');
-			currentNav = arr.filter(item => item.nav === locationNoGuideNoSlash)[0];
+			currentNav = arr.filter((item) => item.nav === locationNoGuideNoSlash)[0];
 		}
 		return () => {
 			window.removeEventListener('resize', getMenuHeightFun);
@@ -154,14 +154,15 @@
 		}
 	};
 	// 编辑地址处理
-	const editUrlFn = nav => {
+	const editUrlFn = (nav) => {
+		// main -> next
 		if (nav === 'create') {
-			return 'https://github.com/any-tdf/stdf/edit/main/packages/create-stdf/README' + (isZh ? '_CN' : '') + '.md';
+			return 'https://github.com/any-tdf/stdf/edit/next/packages/create-stdf/README' + (isZh ? '_CN' : '') + '.md';
 		}
 		if (nav === 'icon-plugin') {
-			return 'https://github.com/any-tdf/stdf/edit/main/packages/rollup-plugin-stdf-icon/README' + (isZh ? '_CN' : '') + '.md';
+			return 'https://github.com/any-tdf/stdf/edit/next/packages/rollup-plugin-stdf-icon/README' + (isZh ? '_CN' : '') + '.md';
 		}
-		return `https://github.com/any-tdf/stdf/edit/main/doc/guide/${flatMenuList.filter(item => item.nav === nav)[0]?.doc}${
+		return `https://github.com/any-tdf/stdf/edit/next/docs/mds/guide/${flatMenuList.filter((item) => item.nav === nav)[0]?.doc}${
 			isZh ? '' : '_en'
 		}.md`;
 	};
@@ -169,30 +170,30 @@
 
 <div class="flex">
 	<div
-		class="fixed -left-52 md:left-0 top-14 w-48 overflow-y-scroll transition-all duration-300 z-[100] bg-white dark:bg-black md:bg-transparent dark:md:bg-transparent border-r border-black/10 dark:border-white/20"
+		class="fixed -left-52 top-14 z-[100] w-48 overflow-y-scroll border-r border-black/10 bg-white transition-all duration-300 md:left-0 md:bg-transparent dark:border-white/20 dark:bg-black dark:md:bg-transparent"
 		class:left-0={$isShowNavStore}
 		class:-left-52={!$isShowNavStore}
 		style="height:{menuHeight + 'px'}"
 	>
 		<Menu {menuList} currentNav={currentNav.nav} on:MenuClick={menuClickFun} showNum={false} />
 	</div>
-	<div class="md:pl-48 w-screen">
+	<div class="w-screen md:pl-48">
 		{#if currentNav.nav !== 'generator'}
 			<div class="px-4 py-12 md:px-8 md:py-4">
-				<div class="font-bold text-4xl">
+				<div class="text-4xl font-bold">
 					{isZh ? currentNav.title : currentNav.title_en}
 				</div>
 			</div>
 			<div class="h-px bg-black/10 dark:bg-white/20"></div>
 		{/if}
-		<div class="px-4 pt-4 {currentNav.nav === 'generator' ? 'md:pt-4 md:px-4' : 'md:pt-12 md:px-8'}">
+		<div class="px-4 pt-4 {currentNav.nav === 'generator' ? 'md:px-4 md:pt-4' : 'md:px-8 md:pt-12'}">
 			<Router routes={guideRoutes} prefix="/guide" />
 		</div>
 		{#if currentNav.nav != 'color' && currentNav.nav != 'logo' && currentNav.nav != 'shortkey' && currentNav.nav != 'generator'}
-			<div class="px-4 md:px-8 pb-8 text-xs flex gap-2">
-				<a href={editUrlFn(currentNav.nav)} class="flex text-primary dark:text-dark w-full" target="_blank">
-					<span class="h-4 w-4 mr-1">
-						<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" class="w-4 h-4" style="fill: currentColor;">
+			<div class="flex gap-2 px-4 pb-8 text-xs md:px-8">
+				<a href={editUrlFn(currentNav.nav)} class="text-primary dark:text-dark flex w-full" target="_blank">
+					<span class="mr-1 h-4 w-4">
+						<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" class="h-4 w-4" style="fill: currentColor;">
 							<path
 								d="M12.8995 6.85431L17.1421 11.0969L7.24264 20.9964H3V16.7538L12.8995 6.85431ZM14.3137 5.44009L16.435 3.31877C16.8256 2.92825 17.4587 2.92825 17.8492 3.31877L20.6777 6.1472C21.0682 6.53772 21.0682 7.17089 20.6777 7.56141L18.5563 9.68273L14.3137 5.44009Z"
 							/>
@@ -207,7 +208,7 @@
 
 {#if !$location.includes('generator')}
 	<button
-		class="hidden md:block fixed right-2 bottom-4 z-50 p-1.5 w-8 h-8 rounded-full bg-primary dark:bg-dark text-white dark:text-black shadow-md shadow-primary/50 dark:shadow-dark/50"
+		class="bg-primary dark:bg-dark shadow-primary/50 dark:shadow-dark/50 fixed bottom-4 right-2 z-50 hidden h-8 w-8 rounded-full p-1.5 text-white shadow-md md:block dark:text-black"
 		on:click={changeFullFunc}
 	>
 		{#if $isWideScreenStore}
@@ -229,28 +230,28 @@
 {/if}
 <!-- 为 code-groups 预先编译 tailwind -->
 <div
-	class="hidden dark:bg-[#202020] border-b-2 peer-checked/tab-0-0:border-primary dark:peer-checked/tab-0-0:border-dark peer-checked/tab-0-0:block
-peer-checked/tab-0-1:border-primary dark:peer-checked/tab-0-1:border-dark peer-checked/tab-0-1:block
-peer-checked/tab-0-2:border-primary dark:peer-checked/tab-0-2:border-dark peer-checked/tab-0-2:block
-peer-checked/tab-0-3:border-primary dark:peer-checked/tab-0-3:border-dark peer-checked/tab-0-3:block
-peer-checked/tab-0-4:border-primary dark:peer-checked/tab-0-4:border-dark peer-checked/tab-0-4:block
-peer-checked/tab-0-5:border-primary dark:peer-checked/tab-0-5:border-dark peer-checked/tab-0-5:block
-peer-checked/tab-1-0:border-primary dark:peer-checked/tab-1-0:border-dark peer-checked/tab-1-0:block
-peer-checked/tab-1-1:border-primary dark:peer-checked/tab-1-1:border-dark peer-checked/tab-1-1:block
-peer-checked/tab-1-2:border-primary dark:peer-checked/tab-1-2:border-dark peer-checked/tab-1-2:block
-peer-checked/tab-1-3:border-primary dark:peer-checked/tab-1-3:border-dark peer-checked/tab-1-3:block
-peer-checked/tab-1-4:border-primary dark:peer-checked/tab-1-4:border-dark peer-checked/tab-1-4:block
-peer-checked/tab-1-5:border-primary dark:peer-checked/tab-1-5:border-dark peer-checked/tab-1-5:block
-peer-checked/tab-2-0:border-primary dark:peer-checked/tab-2-0:border-dark peer-checked/tab-2-0:block
-peer-checked/tab-2-1:border-primary dark:peer-checked/tab-2-1:border-dark peer-checked/tab-2-1:block
-peer-checked/tab-2-2:border-primary dark:peer-checked/tab-2-2:border-dark peer-checked/tab-2-2:block
-peer-checked/tab-2-3:border-primary dark:peer-checked/tab-2-3:border-dark peer-checked/tab-2-3:block
-peer-checked/tab-2-4:border-primary dark:peer-checked/tab-2-4:border-dark peer-checked/tab-2-4:block
-peer-checked/tab-2-5:border-primary dark:peer-checked/tab-2-5:border-dark peer-checked/tab-2-5:block
-peer-checked/tab-3-0:border-primary dark:peer-checked/tab-3-0:border-dark peer-checked/tab-3-0:block
-peer-checked/tab-3-1:border-primary dark:peer-checked/tab-3-1:border-dark peer-checked/tab-3-1:block
-peer-checked/tab-3-2:border-primary dark:peer-checked/tab-3-2:border-dark peer-checked/tab-3-2:block
-peer-checked/tab-3-3:border-primary dark:peer-checked/tab-3-3:border-dark peer-checked/tab-3-3:block
-peer-checked/tab-3-4:border-primary dark:peer-checked/tab-3-4:border-dark peer-checked/tab-3-4:block
-peer-checked/tab-3-5:border-primary dark:peer-checked/tab-3-5:border-dark peer-checked/tab-3-5:block"
+	class="peer-checked/tab-0-0:border-primary dark:peer-checked/tab-0-0:border-dark peer-checked/tab-0-1:border-primary dark:peer-checked/tab-0-1:border-dark peer-checked/tab-0-2:border-primary dark:peer-checked/tab-0-2:border-dark
+peer-checked/tab-0-3:border-primary dark:peer-checked/tab-0-3:border-dark peer-checked/tab-0-4:border-primary
+dark:peer-checked/tab-0-4:border-dark peer-checked/tab-0-5:border-primary dark:peer-checked/tab-0-5:border-dark
+peer-checked/tab-1-0:border-primary dark:peer-checked/tab-1-0:border-dark peer-checked/tab-1-1:border-primary
+dark:peer-checked/tab-1-1:border-dark peer-checked/tab-1-2:border-primary dark:peer-checked/tab-1-2:border-dark
+peer-checked/tab-1-3:border-primary dark:peer-checked/tab-1-3:border-dark peer-checked/tab-1-4:border-primary
+dark:peer-checked/tab-1-4:border-dark peer-checked/tab-1-5:border-primary dark:peer-checked/tab-1-5:border-dark
+peer-checked/tab-2-0:border-primary dark:peer-checked/tab-2-0:border-dark peer-checked/tab-2-1:border-primary
+dark:peer-checked/tab-2-1:border-dark peer-checked/tab-2-2:border-primary dark:peer-checked/tab-2-2:border-dark
+peer-checked/tab-2-3:border-primary dark:peer-checked/tab-2-3:border-dark peer-checked/tab-2-4:border-primary
+dark:peer-checked/tab-2-4:border-dark peer-checked/tab-2-5:border-primary dark:peer-checked/tab-2-5:border-dark
+peer-checked/tab-3-0:border-primary dark:peer-checked/tab-3-0:border-dark peer-checked/tab-3-1:border-primary
+dark:peer-checked/tab-3-1:border-dark peer-checked/tab-3-2:border-primary dark:peer-checked/tab-3-2:border-dark
+peer-checked/tab-3-3:border-primary dark:peer-checked/tab-3-3:border-dark peer-checked/tab-3-4:border-primary
+dark:peer-checked/tab-3-4:border-dark peer-checked/tab-3-5:border-primary dark:peer-checked/tab-3-5:border-dark
+hidden border-b-2 peer-checked/tab-0-0:block
+peer-checked/tab-0-1:block peer-checked/tab-0-2:block peer-checked/tab-0-3:block
+peer-checked/tab-0-4:block peer-checked/tab-0-5:block peer-checked/tab-1-0:block
+peer-checked/tab-1-1:block peer-checked/tab-1-2:block peer-checked/tab-1-3:block
+peer-checked/tab-1-4:block peer-checked/tab-1-5:block peer-checked/tab-2-0:block
+peer-checked/tab-2-1:block peer-checked/tab-2-2:block peer-checked/tab-2-3:block
+peer-checked/tab-2-4:block peer-checked/tab-2-5:block peer-checked/tab-3-0:block
+peer-checked/tab-3-1:block peer-checked/tab-3-2:block peer-checked/tab-3-3:block
+peer-checked/tab-3-4:block peer-checked/tab-3-5:block dark:bg-[#202020]"
 ></div>