From 6488380b1134895bdd49b262c22ab666419c786e Mon Sep 17 00:00:00 2001 From: phshy0607 Date: Tue, 19 Apr 2022 11:22:22 +0800 Subject: [PATCH 01/18] feat: console more info for unmatched sandbox; remove outer div of sandbox --- CHANGELOG.md | 9 +++++++++ src/client/components/SandBox/index.tsx | 9 ++++++--- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7f407e3..20e29c4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - `Security` in case of vulnerabilities. +## [0.8.2] - Unreleased + +### Added +- console more info for unmatched sandbox + +### Fixes +- remove outer div of sandbox + + ## [0.8.1] - 2022-04-18 ### Fixed diff --git a/src/client/components/SandBox/index.tsx b/src/client/components/SandBox/index.tsx index b1b0c19..f3d8f1a 100644 --- a/src/client/components/SandBox/index.tsx +++ b/src/client/components/SandBox/index.tsx @@ -15,13 +15,16 @@ const Sandbox: React.FC = () => { ComponentRef.current = Component; update({}); }); + } else { + console.warn("No Matching Sandbox!", sandboxes); + console.log({ query, sandboxes }); } }, []); return ( -
- -
+ <> + ; + ); }; From 13b376e5e4f9db2d7b495c52a5a28a866f8e3aa7 Mon Sep 17 00:00:00 2001 From: phshy0607 Date: Tue, 19 Apr 2022 11:32:47 +0800 Subject: [PATCH 02/18] feat: changed toc and sidebar style --- CHANGELOG.md | 3 +++ docs/document/live-block.mdx | 1 + src/client/components/Document/styled.ts | 2 +- src/client/components/Toc/index.tsx | 14 ++++++++++++-- src/client/components/Toc/styled.ts | 11 +++++++++-- src/client/styled/vars.ts | 4 ++-- 6 files changed, 28 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 20e29c4..a928fe5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixes - remove outer div of sandbox +### Changed +- changed toc and sidebar style + ## [0.8.1] - 2022-04-18 diff --git a/docs/document/live-block.mdx b/docs/document/live-block.mdx index 4fc72fd..0ee1afa 100644 --- a/docs/document/live-block.mdx +++ b/docs/document/live-block.mdx @@ -69,6 +69,7 @@ Docit also support live mobile block. Add a `mobile` keyword after `live` to ena ```jsx live mobile import { DemoBlock } from "../components/DemoBlock"; + ; ``` diff --git a/src/client/components/Document/styled.ts b/src/client/components/Document/styled.ts index 530de8e..34c60f6 100644 --- a/src/client/components/Document/styled.ts +++ b/src/client/components/Document/styled.ts @@ -21,7 +21,7 @@ export const StyledMarkdown = styled.div` margin-bottom: 100px; width: calc(100% - var(--toc-width)); - @media (max-width: 768px) { + @media (max-width: 1024px) { padding: 0 1em; width: 100%; } diff --git a/src/client/components/Toc/index.tsx b/src/client/components/Toc/index.tsx index 31fcd34..ff23c57 100644 --- a/src/client/components/Toc/index.tsx +++ b/src/client/components/Toc/index.tsx @@ -4,7 +4,12 @@ import { useHistory, useLocation } from "react-router"; import { useQuery } from "../../hooks/useQuery"; import { parseQueryToSearch } from "../../utils/url"; import appData from "virtual:appData"; -import { StyledToc, StyledTocItem, StyledTocItemTitle } from "./styled"; +import { + StyledToc, + StyledTocItem, + StyledTocItemTitle, + StyledTocTitle, +} from "./styled"; const { markdowns } = appData; @@ -56,7 +61,12 @@ const Toc = () => { } }; - return {parse(curr?.toc, 0)}; + return ( + + Table of Content + {parse(curr?.toc, 0)} + + ); }; export { Toc }; diff --git a/src/client/components/Toc/styled.ts b/src/client/components/Toc/styled.ts index a821a94..adcebaf 100644 --- a/src/client/components/Toc/styled.ts +++ b/src/client/components/Toc/styled.ts @@ -16,14 +16,21 @@ export const StyledToc = styled.div` color: var(--c-brand); } - @media (max-width: 768px) { + @media (max-width: 1024px) { display: none; } `; +export const StyledTocTitle = styled.div` + font-weight: bold; + font-size: 18px; + color: var(--c-brand); +`; + export const StyledTocItemTitle = styled.div` margin-bottom: 12px; cursor: pointer; + font-size: 14px; :hover { opacity: 0.6; transition: opacity 200ms linear; @@ -35,5 +42,5 @@ export const StyledTocItem = styled.div.attrs<{ level: number }>((props) => { "data-level": props.level, }; })<{ level: number; empty: boolean }>` - padding-left: ${(props) => (props.empty ? "12px" : "0")}; + padding-left: ${(props) => (props.empty ? "8px" : "0")}; `; diff --git a/src/client/styled/vars.ts b/src/client/styled/vars.ts index ab5a833..01159a2 100644 --- a/src/client/styled/vars.ts +++ b/src/client/styled/vars.ts @@ -2,9 +2,9 @@ import { createGlobalStyle } from "styled-components"; export const CssVariables = createGlobalStyle` :root { - --sidebar-width: 20em; + --sidebar-width: 15em; --header-height: 4rem; - --toc-width: 280px; + --toc-width: 15em; --font-size: 16px; --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif; From 3da9762c00cce0ef17dfe9dbfad0c847853ac83e Mon Sep 17 00:00:00 2001 From: phshy0607 Date: Tue, 19 Apr 2022 11:37:39 +0800 Subject: [PATCH 03/18] chore: release 0.8.2-beta0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 9f9cc1d..94d5468 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@blizzbolts/docit", - "version": "0.8.1", + "version": "0.8.2-beta0", "license": "MIT", "bin": { "docit": "bin/docit.js" From b217ce24e227e14e0191267e3f685012a46055fe Mon Sep 17 00:00:00 2001 From: phshy0607 Date: Tue, 19 Apr 2022 15:46:50 +0800 Subject: [PATCH 04/18] fix: remove useless comma --- package.json | 2 +- src/client/components/SandBox/index.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 94d5468..f84c107 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@blizzbolts/docit", - "version": "0.8.2-beta0", + "version": "0.8.2-beta1", "license": "MIT", "bin": { "docit": "bin/docit.js" diff --git a/src/client/components/SandBox/index.tsx b/src/client/components/SandBox/index.tsx index f3d8f1a..5fd2618 100644 --- a/src/client/components/SandBox/index.tsx +++ b/src/client/components/SandBox/index.tsx @@ -23,7 +23,7 @@ const Sandbox: React.FC = () => { return ( <> - ; + ); }; From a9ffc3b62c4e566350e191478c610ac99a9a6b80 Mon Sep 17 00:00:00 2001 From: phshy0607 Date: Tue, 19 Apr 2022 19:49:43 +0800 Subject: [PATCH 05/18] feat: adjust mobile view sandbox code height to 640px --- CHANGELOG.md | 1 + package.json | 2 +- src/client/built-in/ShowCode/styled.ts | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a928fe5..db0f9ec 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,6 +23,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed - changed toc and sidebar style +- adjust mobile view sandbox code height to 640px ## [0.8.1] - 2022-04-18 diff --git a/package.json b/package.json index f84c107..cecfc89 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@blizzbolts/docit", - "version": "0.8.2-beta1", + "version": "0.8.2-beta2", "license": "MIT", "bin": { "docit": "bin/docit.js" diff --git a/src/client/built-in/ShowCode/styled.ts b/src/client/built-in/ShowCode/styled.ts index 88134bb..fc28102 100644 --- a/src/client/built-in/ShowCode/styled.ts +++ b/src/client/built-in/ShowCode/styled.ts @@ -47,6 +47,7 @@ export const ShowCodeContainer = styled.div` flex: ${(props) => props.mobileView && "1 1 auto"}; overflow: ${(props) => props.mobileView && "auto"}; margin-right: ${(props) => props.mobileView && "2em"}; + max-height: ${(props) => props.mobileView && "640px"}; pre { height: ${(props) => props.mobileView && "100%"}; From 35359b2ebdb68fc191489ac02d5bad6f5949e88d Mon Sep 17 00:00:00 2001 From: phshy0607 Date: Wed, 20 Apr 2022 15:34:11 +0800 Subject: [PATCH 06/18] feat: change code styling --- src/client/styled/vars.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/client/styled/vars.ts b/src/client/styled/vars.ts index 01159a2..a38b06b 100644 --- a/src/client/styled/vars.ts +++ b/src/client/styled/vars.ts @@ -31,7 +31,7 @@ export const CssVariables = createGlobalStyle` --c-code-bg: #ececec; --c-code-keyword: #89b482; --c-code-function: #a9b665; - --c-code-attr: #fff; + --c-code-attr: #D8A657; --c-code-string: #D8A657; --c-code-built-in: #7DAEA3; --c-code-name: #e78a4e; From 37d7a072c91532891d2d20a796e433db1bb9efb1 Mon Sep 17 00:00:00 2001 From: phshy0607 Date: Wed, 20 Apr 2022 15:34:38 +0800 Subject: [PATCH 07/18] feat: support vite config in docit.config.js --- CHANGELOG.md | 1 + src/node/config.ts | 1 + src/node/plugins/index.ts | 4 ++-- src/node/types.ts | 4 ++++ 4 files changed, 8 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index db0f9ec..1922828 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added - console more info for unmatched sandbox +- `docit.config.js` now supports `vite` options ### Fixes - remove outer div of sandbox diff --git a/src/node/config.ts b/src/node/config.ts index 7f6be81..a1f0549 100644 --- a/src/node/config.ts +++ b/src/node/config.ts @@ -17,5 +17,6 @@ export const resolveConfig = async ( : path.resolve(CLIENT_PATH, "./components/DefaultProvider/index.js"), publicPath: command === "build" ? config.publicPath : "/", socials: config.socials, + vite: config.vite, }; }; diff --git a/src/node/plugins/index.ts b/src/node/plugins/index.ts index c12dc36..00f58df 100644 --- a/src/node/plugins/index.ts +++ b/src/node/plugins/index.ts @@ -1,4 +1,4 @@ -import { Plugin, defineConfig, UserConfig } from "vite"; +import { Plugin, defineConfig, mergeConfig } from "vite"; import fsx from "fs-extra"; import path from "path"; import react from "@vitejs/plugin-react"; @@ -59,7 +59,7 @@ export const docit = async (config: ResolvedUserConfig): Promise => { clearScreen: false, publicDir: path.resolve(config.docs, "./assets"), }); - return baseConfig as UserConfig; + return mergeConfig(baseConfig, config.vite); }, transform(_, id) { if (id.endsWith("?needParse")) { diff --git a/src/node/types.ts b/src/node/types.ts index 966e9c1..14b5f78 100644 --- a/src/node/types.ts +++ b/src/node/types.ts @@ -1,3 +1,4 @@ +import { UserConfigExport } from "vite"; export interface UserFileConfig { title?: string; sidebars?: SidebarNode[]; @@ -6,6 +7,7 @@ export interface UserFileConfig { Twitter?: string; Github?: string; }; + vite?: Partial; } export interface UserConfig { @@ -18,6 +20,7 @@ export interface UserConfig { Twitter?: string; Github?: string; }; + vite?: Partial; } export interface ResolvedUserConfig { @@ -31,6 +34,7 @@ export interface ResolvedUserConfig { Twitter?: string; Github?: string; }; + vite?: Partial; } export type DepsMapper = Map; From 617ba422766ff270d2053c7607657e305e1b4a27 Mon Sep 17 00:00:00 2001 From: phshy0607 Date: Wed, 20 Apr 2022 15:38:35 +0800 Subject: [PATCH 08/18] chore: releasing 0.8.2-beta3 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index cecfc89..46ef6bd 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@blizzbolts/docit", - "version": "0.8.2-beta2", + "version": "0.8.2-beta3", "license": "MIT", "bin": { "docit": "bin/docit.js" From 115ba1e079febe6341ac8bcbf2dcd12c8cc34542 Mon Sep 17 00:00:00 2001 From: wb-lbf794718 Date: Wed, 20 Apr 2022 21:10:23 +0800 Subject: [PATCH 09/18] =?UTF-8?q?feat(mobileView):=201.=20=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E4=BA=8C=E7=BB=B4=E7=A0=81=E6=98=BE=E7=A4=BA;2.?= =?UTF-8?q?=E4=BF=AE=E5=A4=8Dtoc=E5=B1=95=E7=A4=BA=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 1 + src/client/components/BottomTools/index.tsx | 34 +++++++++++++++++++++ src/client/components/BottomTools/styled.ts | 33 ++++++++++++++++++++ src/client/components/BottomTools/types.ts | 3 ++ src/client/components/SandBox/index.tsx | 11 +++++-- src/client/components/SandBox/styled.ts | 8 +++++ src/client/components/Toc/index.tsx | 4 ++- 7 files changed, 90 insertions(+), 4 deletions(-) create mode 100644 src/client/components/BottomTools/index.tsx create mode 100644 src/client/components/BottomTools/styled.ts create mode 100644 src/client/components/BottomTools/types.ts create mode 100644 src/client/components/SandBox/styled.ts diff --git a/package.json b/package.json index 9f9cc1d..c821a6f 100644 --- a/package.json +++ b/package.json @@ -77,6 +77,7 @@ "minimist": "^1.2.5", "normalize.css": "^8.0.1", "npm-run-all": "^4.1.5", + "qrcode": "^1.5.0", "react": "^17.0.2", "react-docgen-typescript": "^2.2.2", "react-dom": "^17.0.2", diff --git a/src/client/components/BottomTools/index.tsx b/src/client/components/BottomTools/index.tsx new file mode 100644 index 0000000..5d41a6b --- /dev/null +++ b/src/client/components/BottomTools/index.tsx @@ -0,0 +1,34 @@ +import React, { useState, useEffect } from "react"; +import { BottomToolsProps } from "./types"; +import { StyledBottomTools, StyledQrCode } from "./styled"; +import qrcode from "qrcode"; +import { Svgs } from "../Svgs/index"; + +const BottomTools: React.FC = (props) => { + const { moduleId } = props; + const [qrCodeSrc, setQrCodeSrc] = useState(null); + + useEffect(() => { + qrcode + .toDataURL(`${window.location.origin}/#sandbox?moduleId=${moduleId}`, { + margin: 0, + }) + .then((res) => { + setQrCodeSrc(res); + }); + }, []); + + return ( + + {qrCodeSrc && ( + +
+ +
+
+ )} +
+ ); +}; + +export default BottomTools; diff --git a/src/client/components/BottomTools/styled.ts b/src/client/components/BottomTools/styled.ts new file mode 100644 index 0000000..9ee2406 --- /dev/null +++ b/src/client/components/BottomTools/styled.ts @@ -0,0 +1,33 @@ +import styled from "styled-components"; + +export const StyledBottomTools = styled.div` + visibility: hidden; + position: fixed; + left: 0; + bottom: 0; + display: flex; + align-items: center; + width: 100%; + padding: 12px; + background-color: #e8e8e8; +`; + +export const StyledQrCode = styled.div<{ src: string }>` + position: relative; + width: 20px; + height: 20px; + .icon-wrapper { + position: relative; + } + .icon-wrapper:hover:after { + content: ""; + position: absolute; + top: -100px; + left: 0px; + width: 80px; + height: 80px; + background-image: url(${(props) => props.src}); + background-repeat: no-repeat; + background-size: contain; + } +`; diff --git a/src/client/components/BottomTools/types.ts b/src/client/components/BottomTools/types.ts new file mode 100644 index 0000000..0ef0f6f --- /dev/null +++ b/src/client/components/BottomTools/types.ts @@ -0,0 +1,3 @@ +export interface BottomToolsProps { + moduleId +} \ No newline at end of file diff --git a/src/client/components/SandBox/index.tsx b/src/client/components/SandBox/index.tsx index b1b0c19..07f219a 100644 --- a/src/client/components/SandBox/index.tsx +++ b/src/client/components/SandBox/index.tsx @@ -1,6 +1,8 @@ import { useQuery } from "../../hooks/useQuery"; import React, { useEffect, useRef, useState } from "react"; import sandboxes from "virtual:sandboxes"; +import BottomTools from "../BottomTools/index"; +import { StyledSandBox } from "./styled"; const Sandbox: React.FC = () => { const query = useQuery(); @@ -19,9 +21,12 @@ const Sandbox: React.FC = () => { }, []); return ( -
- -
+ +
+ +
+ +
); }; diff --git a/src/client/components/SandBox/styled.ts b/src/client/components/SandBox/styled.ts new file mode 100644 index 0000000..c472847 --- /dev/null +++ b/src/client/components/SandBox/styled.ts @@ -0,0 +1,8 @@ + +import styled from 'styled-components' + +export const StyledSandBox = styled.div` + :hover .bottom-tools { + visibility: visible; + } +` \ No newline at end of file diff --git a/src/client/components/Toc/index.tsx b/src/client/components/Toc/index.tsx index 31fcd34..f3fd9dc 100644 --- a/src/client/components/Toc/index.tsx +++ b/src/client/components/Toc/index.tsx @@ -56,7 +56,9 @@ const Toc = () => { } }; - return {parse(curr?.toc, 0)}; + return isEmpty(curr?.toc) ? null : ( + {parse(curr?.toc, 0)} + ); }; export { Toc }; From 1bd24045d9aab7d449cfc470350ba48522bf8523 Mon Sep 17 00:00:00 2001 From: wb-lbf794718 Date: Thu, 21 Apr 2022 13:50:44 +0800 Subject: [PATCH 10/18] =?UTF-8?q?feat(=E5=BA=95=E9=83=A8=E5=B7=A5=E5=85=B7?= =?UTF-8?q?=E6=A0=8F):=201.=E6=B7=BB=E5=8A=A0=E4=BA=8C=E7=BB=B4=E7=A0=81;2?= =?UTF-8?q?.=E6=96=B0tab=E6=89=93=E5=BC=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/client/components/BottomTools/index.tsx | 22 ++++++++++++----- src/client/components/BottomTools/styled.ts | 16 +++++++++---- src/client/components/Svgs/index.tsx | 26 +++++++++++++++++++++ 3 files changed, 53 insertions(+), 11 deletions(-) diff --git a/src/client/components/BottomTools/index.tsx b/src/client/components/BottomTools/index.tsx index 5d41a6b..4ff1101 100644 --- a/src/client/components/BottomTools/index.tsx +++ b/src/client/components/BottomTools/index.tsx @@ -1,32 +1,42 @@ -import React, { useState, useEffect } from "react"; +import React, { useState, useEffect, useMemo } from "react"; import { BottomToolsProps } from "./types"; -import { StyledBottomTools, StyledQrCode } from "./styled"; +import { StyledBottomTools, StyledQrCode, StyledIconWrapper } from "./styled"; import qrcode from "qrcode"; import { Svgs } from "../Svgs/index"; const BottomTools: React.FC = (props) => { const { moduleId } = props; const [qrCodeSrc, setQrCodeSrc] = useState(null); + const url = useMemo(() => { + return `${window.location.origin}/#sandbox?moduleId=${moduleId}`; + }, [moduleId]); useEffect(() => { qrcode - .toDataURL(`${window.location.origin}/#sandbox?moduleId=${moduleId}`, { + .toDataURL(url, { margin: 0, }) .then((res) => { setQrCodeSrc(res); }); - }, []); + }, [url]); return ( {qrCodeSrc && ( -
- +
+
)} + window.open(url)}> + + ); }; diff --git a/src/client/components/BottomTools/styled.ts b/src/client/components/BottomTools/styled.ts index 9ee2406..1449634 100644 --- a/src/client/components/BottomTools/styled.ts +++ b/src/client/components/BottomTools/styled.ts @@ -9,17 +9,17 @@ export const StyledBottomTools = styled.div` align-items: center; width: 100%; padding: 12px; - background-color: #e8e8e8; `; export const StyledQrCode = styled.div<{ src: string }>` position: relative; - width: 20px; - height: 20px; - .icon-wrapper { + margin-right: 12px; + .qrcode-wrapper { position: relative; + display: flex; + align-items: center; } - .icon-wrapper:hover:after { + .qrcode-wrapper:hover:after { content: ""; position: absolute; top: -100px; @@ -31,3 +31,9 @@ export const StyledQrCode = styled.div<{ src: string }>` background-size: contain; } `; + +export const StyledIconWrapper = styled.div` + display: flex; + align-items: center; + margin-right: 12px; +`; diff --git a/src/client/components/Svgs/index.tsx b/src/client/components/Svgs/index.tsx index f93a542..6d0913c 100644 --- a/src/client/components/Svgs/index.tsx +++ b/src/client/components/Svgs/index.tsx @@ -90,9 +90,35 @@ const AnimatedLoading: React.FC = (props) => { ); }; +const QRCode: React.FC = (props) => { + return ( + + + + ); +}; + +export const OpenInNewTab: React.FC = (props) => { + return ( + + + + ); +}; + export const Svgs = { Twitter, Github, ToggleBtn, AnimatedLoading, + QRCode, + OpenInNewTab, }; From b4c024c9d036158d3ecc0bdcfe67ca8c1e999fea Mon Sep 17 00:00:00 2001 From: wb-lbf794718 Date: Thu, 21 Apr 2022 14:20:07 +0800 Subject: [PATCH 11/18] =?UTF-8?q?fix(MobileView):=20=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/client/built-in/ShowCode/styled.ts | 4 ++++ src/client/components/Document/styled.ts | 4 ++++ src/client/components/Svgs/index.tsx | 2 -- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/client/built-in/ShowCode/styled.ts b/src/client/built-in/ShowCode/styled.ts index 88134bb..bb72f48 100644 --- a/src/client/built-in/ShowCode/styled.ts +++ b/src/client/built-in/ShowCode/styled.ts @@ -57,6 +57,10 @@ export const ShowCodeContainer = styled.div` height: ${(props) => props.mobileView && "100%"}; } } + @media (max-width: 1024px) { + margin-right: 0; + margin-top: 2em; + } } ${RenderWindow} { diff --git a/src/client/components/Document/styled.ts b/src/client/components/Document/styled.ts index 530de8e..2becb3d 100644 --- a/src/client/components/Document/styled.ts +++ b/src/client/components/Document/styled.ts @@ -21,6 +21,10 @@ export const StyledMarkdown = styled.div` margin-bottom: 100px; width: calc(100% - var(--toc-width)); + :last-child { + width: 100%; + } + @media (max-width: 768px) { padding: 0 1em; width: 100%; diff --git a/src/client/components/Svgs/index.tsx b/src/client/components/Svgs/index.tsx index 6d0913c..2867434 100644 --- a/src/client/components/Svgs/index.tsx +++ b/src/client/components/Svgs/index.tsx @@ -96,7 +96,6 @@ const QRCode: React.FC = (props) => { ); @@ -108,7 +107,6 @@ export const OpenInNewTab: React.FC = (props) => { ); From 714b9da962b6f8c0a494941ee1cb39dfeac48605 Mon Sep 17 00:00:00 2001 From: wb-lbf794718 Date: Thu, 21 Apr 2022 14:47:15 +0800 Subject: [PATCH 12/18] =?UTF-8?q?fix(=E5=91=BD=E5=90=8D=E9=97=AE=E9=A2=98)?= =?UTF-8?q?:=20rename=20BottomTool=20&=20OpenInNewTab?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/client/components/BottomTools/types.ts | 3 --- .../{BottomTools => IFrameTools}/index.tsx | 14 +++++++------- .../{BottomTools => IFrameTools}/styled.ts | 2 +- src/client/components/IFrameTools/types.ts | 3 +++ src/client/components/SandBox/index.tsx | 4 ++-- src/client/components/Svgs/index.tsx | 4 ++-- 6 files changed, 15 insertions(+), 15 deletions(-) delete mode 100644 src/client/components/BottomTools/types.ts rename src/client/components/{BottomTools => IFrameTools}/index.tsx (75%) rename src/client/components/{BottomTools => IFrameTools}/styled.ts (94%) create mode 100644 src/client/components/IFrameTools/types.ts diff --git a/src/client/components/BottomTools/types.ts b/src/client/components/BottomTools/types.ts deleted file mode 100644 index 0ef0f6f..0000000 --- a/src/client/components/BottomTools/types.ts +++ /dev/null @@ -1,3 +0,0 @@ -export interface BottomToolsProps { - moduleId -} \ No newline at end of file diff --git a/src/client/components/BottomTools/index.tsx b/src/client/components/IFrameTools/index.tsx similarity index 75% rename from src/client/components/BottomTools/index.tsx rename to src/client/components/IFrameTools/index.tsx index 4ff1101..c6dfdba 100644 --- a/src/client/components/BottomTools/index.tsx +++ b/src/client/components/IFrameTools/index.tsx @@ -1,10 +1,10 @@ import React, { useState, useEffect, useMemo } from "react"; -import { BottomToolsProps } from "./types"; -import { StyledBottomTools, StyledQrCode, StyledIconWrapper } from "./styled"; +import { IFrameToolsProps } from "./types"; +import { StyledIFrameTools, StyledQrCode, StyledIconWrapper } from "./styled"; import qrcode from "qrcode"; import { Svgs } from "../Svgs/index"; -const BottomTools: React.FC = (props) => { +const IFrameTools: React.FC = (props) => { const { moduleId } = props; const [qrCodeSrc, setQrCodeSrc] = useState(null); const url = useMemo(() => { @@ -22,7 +22,7 @@ const BottomTools: React.FC = (props) => { }, [url]); return ( - + {qrCodeSrc && (
@@ -31,14 +31,14 @@ const BottomTools: React.FC = (props) => { )} window.open(url)}> - - + ); }; -export default BottomTools; +export default IFrameTools; diff --git a/src/client/components/BottomTools/styled.ts b/src/client/components/IFrameTools/styled.ts similarity index 94% rename from src/client/components/BottomTools/styled.ts rename to src/client/components/IFrameTools/styled.ts index 1449634..54255a8 100644 --- a/src/client/components/BottomTools/styled.ts +++ b/src/client/components/IFrameTools/styled.ts @@ -1,6 +1,6 @@ import styled from "styled-components"; -export const StyledBottomTools = styled.div` +export const StyledIFrameTools = styled.div` visibility: hidden; position: fixed; left: 0; diff --git a/src/client/components/IFrameTools/types.ts b/src/client/components/IFrameTools/types.ts new file mode 100644 index 0000000..4db1aac --- /dev/null +++ b/src/client/components/IFrameTools/types.ts @@ -0,0 +1,3 @@ +export interface IFrameToolsProps { + moduleId +} \ No newline at end of file diff --git a/src/client/components/SandBox/index.tsx b/src/client/components/SandBox/index.tsx index 07f219a..2eaca92 100644 --- a/src/client/components/SandBox/index.tsx +++ b/src/client/components/SandBox/index.tsx @@ -1,7 +1,7 @@ import { useQuery } from "../../hooks/useQuery"; import React, { useEffect, useRef, useState } from "react"; import sandboxes from "virtual:sandboxes"; -import BottomTools from "../BottomTools/index"; +import IFrameTools from "../IFrameTools/index"; import { StyledSandBox } from "./styled"; const Sandbox: React.FC = () => { @@ -25,7 +25,7 @@ const Sandbox: React.FC = () => {
- + ); }; diff --git a/src/client/components/Svgs/index.tsx b/src/client/components/Svgs/index.tsx index 2867434..344ecd6 100644 --- a/src/client/components/Svgs/index.tsx +++ b/src/client/components/Svgs/index.tsx @@ -101,7 +101,7 @@ const QRCode: React.FC = (props) => { ); }; -export const OpenInNewTab: React.FC = (props) => { +export const Forward: React.FC = (props) => { return ( Date: Thu, 21 Apr 2022 19:21:25 +0800 Subject: [PATCH 13/18] chore: stash --- scripts/release.js | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 scripts/release.js diff --git a/scripts/release.js b/scripts/release.js new file mode 100644 index 0000000..d8a85a2 --- /dev/null +++ b/scripts/release.js @@ -0,0 +1,11 @@ +// 研发流程 +// feature分支从Master拉 +// dev分支为预发布分支 +// dev分支验证完成后在master分支进行发布,修改Changelog + +// beta release +// beta版在feature上发, +// changelog体现新版本,有unreleased +// build => .... => publish + +// main release From c04ff85ba516e461adfd8f7662a30f8a559e7da8 Mon Sep 17 00:00:00 2001 From: phshy0607 Date: Thu, 21 Apr 2022 19:31:27 +0800 Subject: [PATCH 14/18] chore: update CHANGELOG --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1922828..6a05229 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added - console more info for unmatched sandbox - `docit.config.js` now supports `vite` options +- Iframe now has a tool bar which can view qrcode and open in new tab ### Fixes - remove outer div of sandbox @@ -25,6 +26,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed - changed toc and sidebar style - adjust mobile view sandbox code height to 640px +- hide toc when no toc at all ## [0.8.1] - 2022-04-18 From f757b8f99a400eec99d1bbf5556c24ba5057a2fc Mon Sep 17 00:00:00 2001 From: phshy0607 Date: Thu, 21 Apr 2022 19:54:20 +0800 Subject: [PATCH 15/18] feat: use default vite cache --- package.json | 2 +- src/node/plugins/index.ts | 1 - yarn.lock | 162 +++++++++++++++++++++++++++++++++++++- 3 files changed, 161 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 437aee3..979be1f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@blizzbolts/docit", - "version": "0.8.2-beta3", + "version": "0.8.2-beta4", "license": "MIT", "bin": { "docit": "bin/docit.js" diff --git a/src/node/plugins/index.ts b/src/node/plugins/index.ts index 00f58df..a9950ac 100644 --- a/src/node/plugins/index.ts +++ b/src/node/plugins/index.ts @@ -24,7 +24,6 @@ export const docit = async (config: ResolvedUserConfig): Promise => { const baseConfig = defineConfig({ root: config.base, base: config.publicPath, - cacheDir: "node_modules/.docit", optimizeDeps: { include: [ "react", diff --git a/yarn.lock b/yarn.lock index ddd7ec8..b2bff3c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -639,6 +639,11 @@ acorn@^8.0.0: resolved "https://registry.npmjs.org/acorn/-/acorn-8.7.0.tgz#90951fde0f8f09df93549481e5fc141445b791cf" integrity sha512-V/LGr1APy+PXIwKebEWrkZPwoeoF+w1jiOBUmuxuiUIaOHtob8Qc9BTrYo7VuI5fR8tqsy+buA2WFooR5olqvQ== +ansi-regex@^5.0.1: + version "5.0.1" + resolved "https://registry.npmmirror.com/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304" + integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ== + ansi-styles@^3.2.1: version "3.2.1" resolved "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" @@ -646,6 +651,13 @@ ansi-styles@^3.2.1: dependencies: color-convert "^1.9.0" +ansi-styles@^4.0.0: + version "4.3.0" + resolved "https://registry.npmmirror.com/ansi-styles/-/ansi-styles-4.3.0.tgz#edd803628ae71c04c85ae7a0906edad34b648937" + integrity sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg== + dependencies: + color-convert "^2.0.1" + anymatch@~3.1.2: version "3.1.2" resolved "https://registry.npmjs.org/anymatch/-/anymatch-3.1.2.tgz#c0557c096af32f106198f4f4e2a383537e378716" @@ -784,6 +796,11 @@ call-bind@^1.0.0, call-bind@^1.0.2: function-bind "^1.1.1" get-intrinsic "^1.0.2" +camelcase@^5.0.0: + version "5.3.1" + resolved "https://registry.npmmirror.com/camelcase/-/camelcase-5.3.1.tgz#e3c9b31569e106811df242f715725a1f4c494320" + integrity sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg== + camelize@^1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/camelize/-/camelize-1.0.0.tgz#164a5483e630fa4321e5af07020e531831b2609b" @@ -866,6 +883,15 @@ check-error@^1.0.2: optionalDependencies: fsevents "~2.3.2" +cliui@^6.0.0: + version "6.0.0" + resolved "https://registry.npmmirror.com/cliui/-/cliui-6.0.0.tgz#511d702c0c4e41ca156d7d0e96021f23e13225b1" + integrity sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ== + dependencies: + string-width "^4.2.0" + strip-ansi "^6.0.0" + wrap-ansi "^6.2.0" + color-convert@^1.9.0: version "1.9.3" resolved "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8" @@ -873,11 +899,23 @@ color-convert@^1.9.0: dependencies: color-name "1.1.3" +color-convert@^2.0.1: + version "2.0.1" + resolved "https://registry.npmmirror.com/color-convert/-/color-convert-2.0.1.tgz#72d3a68d598c9bdb3af2ad1e84f21d896abd4de3" + integrity sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ== + dependencies: + color-name "~1.1.4" + color-name@1.1.3: version "1.1.3" resolved "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" integrity sha1-p9BVi9icQveV3UIyj3QIMcpTvCU= +color-name@~1.1.4: + version "1.1.4" + resolved "https://registry.npmmirror.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" + integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== + comma-separated-tokens@^2.0.0: version "2.0.2" resolved "https://registry.npmjs.org/comma-separated-tokens/-/comma-separated-tokens-2.0.2.tgz#d4c25abb679b7751c880be623c1179780fe1dd98" @@ -962,6 +1000,11 @@ debug@^4.0.0, debug@^4.1.0: dependencies: ms "2.1.2" +decamelize@^1.2.0: + version "1.2.0" + resolved "https://registry.npmmirror.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" + integrity sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA== + decode-named-character-reference@^1.0.0: version "1.0.1" resolved "https://registry.npmjs.org/decode-named-character-reference/-/decode-named-character-reference-1.0.1.tgz#57b2bd9112659cacbc449d3577d7dadb8e1f3d1b" @@ -999,6 +1042,11 @@ diff@^5.0.0: resolved "https://registry.npmjs.org/diff/-/diff-5.0.0.tgz#7ed6ad76d859d030787ec35855f5b1daf31d852b" integrity sha512-/VTCrvm5Z0JGty/BWHljh+BAiw3IK+2j87NGMu8Nwc/f48WoDAC395uomO9ZD117ZOBaHmkX1oyLvkVM/aIT3w== +dijkstrajs@^1.0.1: + version "1.0.2" + resolved "https://registry.npmmirror.com/dijkstrajs/-/dijkstrajs-1.0.2.tgz#2e48c0d3b825462afe75ab4ad5e829c8ece36257" + integrity sha512-QV6PMaHTCNmKSeP6QoXhVTw9snc9VD8MulTT0Bd99Pacp4SS1cjcrYPgBPmibqKVtMJJfqC6XvOXgPMEEPH/fg== + dir-glob@^3.0.1: version "3.0.1" resolved "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz#56dbf73d992a4a93ba1584f4534063fd2e41717f" @@ -1024,11 +1072,21 @@ email-addresses@^3.0.1: resolved "https://registry.npmjs.org/email-addresses/-/email-addresses-3.1.0.tgz#cabf7e085cbdb63008a70319a74e6136188812fb" integrity sha512-k0/r7GrWVL32kZlGwfPNgB2Y/mMXVTq/decgLczm/j34whdaspNrZO8CnXPf1laaHxI6ptUlsnAxN+UAPw+fzg== +emoji-regex@^8.0.0: + version "8.0.0" + resolved "https://registry.npmmirror.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37" + integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A== + emoticon@^4.0.0: version "4.0.1" resolved "https://registry.npmjs.org/emoticon/-/emoticon-4.0.1.tgz#2d2bbbf231ce3a5909e185bbb64a9da703a1e749" integrity sha512-dqx7eA9YaqyvYtUhJwT4rC1HIp82j5ybS1/vQ42ur+jBe17dJMwZE4+gvL1XadSFfxaPFFGt3Xsw+Y8akThDlw== +encode-utf8@^1.0.3: + version "1.0.3" + resolved "https://registry.npmmirror.com/encode-utf8/-/encode-utf8-1.0.3.tgz#f30fdd31da07fb596f281beb2f6b027851994cda" + integrity sha512-ucAnuBEhUK4boH2HjVYG5Q2mQyPorvv0u/ocS+zhdw0S8AlHYY+GOFhP1Gio5z4icpP2ivFSvhtFjQi8+T9ppw== + error-ex@^1.3.1: version "1.3.2" resolved "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz#b4ac40648107fdcdcfae242f428bea8a14d4f1bf" @@ -1328,9 +1386,9 @@ find-cache-dir@^3.3.1: make-dir "^3.0.2" pkg-dir "^4.1.0" -find-up@^4.0.0: +find-up@^4.0.0, find-up@^4.1.0: version "4.1.0" - resolved "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz#97afe7d6cdc0bc5928584b7c8d7b16e8a9aa5d19" + resolved "https://registry.npmmirror.com/find-up/-/find-up-4.1.0.tgz#97afe7d6cdc0bc5928584b7c8d7b16e8a9aa5d19" integrity sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw== dependencies: locate-path "^5.0.0" @@ -1379,6 +1437,11 @@ gensync@^1.0.0-beta.2: resolved "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz#32a6ee76c3d7f52d46b2b1ae5d93fea8580a25e0" integrity sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg== +get-caller-file@^2.0.1: + version "2.0.5" + resolved "https://registry.npmmirror.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" + integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== + get-func-name@^2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.0.tgz#ead774abee72e20409433a066366023dd6887a41" @@ -1729,6 +1792,11 @@ is-extglob@^2.1.1: resolved "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" integrity sha1-qIwCU1eR8C7TfHahueqXc8gz+MI= +is-fullwidth-code-point@^3.0.0: + version "3.0.0" + resolved "https://registry.npmmirror.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz#f116f8064fe90b3f7844a38997c0b75051269f1d" + integrity sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg== + is-glob@^4.0.1, is-glob@~4.0.1: version "4.0.3" resolved "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz#64f61e42cbbb2eec2071a9dac0b28ba1e65d5084" @@ -2851,6 +2919,11 @@ pkg-dir@^4.1.0: dependencies: find-up "^4.0.0" +pngjs@^5.0.0: + version "5.0.0" + resolved "https://registry.npmmirror.com/pngjs/-/pngjs-5.0.0.tgz#e79dd2b215767fd9c04561c01236df960bce7fbb" + integrity sha512-40QW5YalBNfQo5yRYmiw7Yz6TKKVr3h6970B2YE+3fQpsWcrbj1PzJgxeJ19DRQjhMbKPIuMY8rFaXc8moolVw== + postcss-value-parser@^4.0.2: version "4.2.0" resolved "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-4.2.0.tgz#723c09920836ba6d3e5af019f92bc0971c02e514" @@ -2884,6 +2957,16 @@ property-information@^6.0.0: resolved "https://registry.npmjs.org/property-information/-/property-information-6.1.1.tgz#5ca85510a3019726cb9afed4197b7b8ac5926a22" integrity sha512-hrzC564QIl0r0vy4l6MvRLhafmUowhO/O3KgVSoXIbbA2Sz4j8HGpJc6T2cubRVwMwpdiG/vKGfhT4IixmKN9w== +qrcode@^1.5.0: + version "1.5.0" + resolved "https://registry.npmmirror.com/qrcode/-/qrcode-1.5.0.tgz#95abb8a91fdafd86f8190f2836abbfc500c72d1b" + integrity sha512-9MgRpgVc+/+47dFvQeD6U2s0Z92EsKzcHogtum4QB+UNd025WOJSHvn/hjk9xmzj7Stj95CyUAs31mrjxliEsQ== + dependencies: + dijkstrajs "^1.0.1" + encode-utf8 "^1.0.3" + pngjs "^5.0.0" + yargs "^15.3.1" + queue-microtask@^1.2.2: version "1.2.3" resolved "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz#4929228bbc724dfac43e0efb058caf7b6cfb6243" @@ -3118,6 +3201,16 @@ remark-rehype@^10.0.0: mdast-util-to-hast "^12.1.0" unified "^10.0.0" +require-directory@^2.1.1: + version "2.1.1" + resolved "https://registry.npmmirror.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" + integrity sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q== + +require-main-filename@^2.0.0: + version "2.0.0" + resolved "https://registry.npmmirror.com/require-main-filename/-/require-main-filename-2.0.0.tgz#d0b329ecc7cc0f61649f62215be69af54aa8989b" + integrity sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg== + resolve-pathname@^3.0.0: version "3.0.0" resolved "https://registry.npmjs.org/resolve-pathname/-/resolve-pathname-3.0.0.tgz#99d02224d3cf263689becbb393bc560313025dcd" @@ -3205,6 +3298,11 @@ semver@^6.0.0, semver@^6.3.0: resolved "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d" integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw== +set-blocking@^2.0.0: + version "2.0.0" + resolved "https://registry.npmmirror.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" + integrity sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw== + shallowequal@^1.1.0: version "1.1.0" resolved "https://registry.npmjs.org/shallowequal/-/shallowequal-1.1.0.tgz#188d521de95b9087404fd4dcb68b13df0ae4e7f8" @@ -3304,6 +3402,15 @@ sprintf-js@~1.0.2: resolved "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" integrity sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw= +string-width@^4.1.0, string-width@^4.2.0: + version "4.2.3" + resolved "https://registry.npmmirror.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" + integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== + dependencies: + emoji-regex "^8.0.0" + is-fullwidth-code-point "^3.0.0" + strip-ansi "^6.0.1" + string.prototype.padend@^3.0.0: version "3.1.3" resolved "https://registry.npmjs.org/string.prototype.padend/-/string.prototype.padend-3.1.3.tgz#997a6de12c92c7cb34dc8a201a6c53d9bd88a5f1" @@ -3337,6 +3444,13 @@ stringify-entities@^4.0.0: character-entities-html4 "^2.0.0" character-entities-legacy "^3.0.0" +strip-ansi@^6.0.0, strip-ansi@^6.0.1: + version "6.0.1" + resolved "https://registry.npmmirror.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" + integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== + dependencies: + ansi-regex "^5.0.1" + strip-bom-string@^1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/strip-bom-string/-/strip-bom-string-1.0.0.tgz#e5211e9224369fbb81d633a2f00044dc8cedad92" @@ -3701,6 +3815,11 @@ which-boxed-primitive@^1.0.2: is-string "^1.0.5" is-symbol "^1.0.3" +which-module@^2.0.0: + version "2.0.0" + resolved "https://registry.npmmirror.com/which-module/-/which-module-2.0.0.tgz#d9ef07dce77b9902b8a3a8fa4b31c3e3f7e6e87a" + integrity sha512-B+enWhmw6cjfVC7kS8Pj9pCrKSc5txArRyaYGe088shv/FGWH+0Rjx/xPgtsWfsUtS27FkP697E4DDhgrgoc0Q== + which@^1.2.9: version "1.3.1" resolved "https://registry.npmjs.org/which/-/which-1.3.1.tgz#a45043d54f5805316da8d62f9f50918d3da70b0a" @@ -3708,11 +3827,50 @@ which@^1.2.9: dependencies: isexe "^2.0.0" +wrap-ansi@^6.2.0: + version "6.2.0" + resolved "https://registry.npmmirror.com/wrap-ansi/-/wrap-ansi-6.2.0.tgz#e9393ba07102e6c91a3b221478f0257cd2856e53" + integrity sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA== + dependencies: + ansi-styles "^4.0.0" + string-width "^4.1.0" + strip-ansi "^6.0.0" + wrappy@1: version "1.0.2" resolved "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= +y18n@^4.0.0: + version "4.0.3" + resolved "https://registry.npmmirror.com/y18n/-/y18n-4.0.3.tgz#b5f259c82cd6e336921efd7bfd8bf560de9eeedf" + integrity sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ== + +yargs-parser@^18.1.2: + version "18.1.3" + resolved "https://registry.npmmirror.com/yargs-parser/-/yargs-parser-18.1.3.tgz#be68c4975c6b2abf469236b0c870362fab09a7b0" + integrity sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ== + dependencies: + camelcase "^5.0.0" + decamelize "^1.2.0" + +yargs@^15.3.1: + version "15.4.1" + resolved "https://registry.npmmirror.com/yargs/-/yargs-15.4.1.tgz#0d87a16de01aee9d8bec2bfbf74f67851730f4f8" + integrity sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A== + dependencies: + cliui "^6.0.0" + decamelize "^1.2.0" + find-up "^4.1.0" + get-caller-file "^2.0.1" + require-directory "^2.1.1" + require-main-filename "^2.0.0" + set-blocking "^2.0.0" + string-width "^4.2.0" + which-module "^2.0.0" + y18n "^4.0.0" + yargs-parser "^18.1.2" + zwitch@^2.0.0: version "2.0.2" resolved "https://registry.npmjs.org/zwitch/-/zwitch-2.0.2.tgz#91f8d0e901ffa3d66599756dde7f57b17c95dce1" From 278d4bebaff535ae5839bd8d00c2e945d7d216c9 Mon Sep 17 00:00:00 2001 From: phshy0607 Date: Thu, 21 Apr 2022 20:05:19 +0800 Subject: [PATCH 16/18] feat: add qrcode to optimizeDeps --- package.json | 2 +- src/node/plugins/index.ts | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 979be1f..479427a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@blizzbolts/docit", - "version": "0.8.2-beta4", + "version": "0.8.2-beta6", "license": "MIT", "bin": { "docit": "bin/docit.js" diff --git a/src/node/plugins/index.ts b/src/node/plugins/index.ts index a9950ac..d4dade3 100644 --- a/src/node/plugins/index.ts +++ b/src/node/plugins/index.ts @@ -41,6 +41,7 @@ export const docit = async (config: ResolvedUserConfig): Promise => { "core-js", "highlight.js", "react-frame-component", + "qrcode", ], }, build: { From 3a11fc1f5994deef1324e6183cc904ac702e924f Mon Sep 17 00:00:00 2001 From: phshy0607 Date: Thu, 21 Apr 2022 20:10:40 +0800 Subject: [PATCH 17/18] fix: fix publicPath --- src/client/components/IFrameTools/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/client/components/IFrameTools/index.tsx b/src/client/components/IFrameTools/index.tsx index c6dfdba..b7c6675 100644 --- a/src/client/components/IFrameTools/index.tsx +++ b/src/client/components/IFrameTools/index.tsx @@ -8,7 +8,7 @@ const IFrameTools: React.FC = (props) => { const { moduleId } = props; const [qrCodeSrc, setQrCodeSrc] = useState(null); const url = useMemo(() => { - return `${window.location.origin}/#sandbox?moduleId=${moduleId}`; + return `${import.meta.env.BASE_URL}#sandbox?moduleId=${moduleId}`; }, [moduleId]); useEffect(() => { From 0b0f3dc48c8ec7e651a1170d3692245fec838168 Mon Sep 17 00:00:00 2001 From: phshy0607 Date: Thu, 21 Apr 2022 20:15:39 +0800 Subject: [PATCH 18/18] feat: update version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 479427a..3a1de45 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@blizzbolts/docit", - "version": "0.8.2-beta6", + "version": "0.8.2-beta7", "license": "MIT", "bin": { "docit": "bin/docit.js"