@rspress/plugin-preview 0.0.13 → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rspress/plugin-preview",
3
- "version": "0.0.13",
3
+ "version": "0.1.0",
4
4
  "description": "A plugin for rspress to preview the code block in markdown/mdx file.",
5
5
  "bugs": "https://github.com/web-infra-dev/rspress/issues",
6
6
  "repository": {
@@ -21,10 +21,10 @@
21
21
  ],
22
22
  "dependencies": {
23
23
  "@mdx-js/mdx": "2.2.1",
24
- "@modern-js/utils": "2.35.0",
24
+ "@modern-js/utils": "2.35.1",
25
25
  "qrcode.react": "^3.1.0",
26
26
  "remark-gfm": "3.0.1",
27
- "@rspress/shared": "0.0.13"
27
+ "@rspress/shared": "0.1.0"
28
28
  },
29
29
  "devDependencies": {
30
30
  "@types/mdast": "^3.0.10",
@@ -1,7 +1,7 @@
1
1
  import { useCallback, useState } from 'react';
2
2
  import { withBase, useLang, NoSSR } from '@rspress/core/runtime';
3
3
  import MobileOperation from './common/mobile-operation';
4
- import IconCode from './svg/code.svg';
4
+ import IconCode from './icons/Code';
5
5
  import './Container.scss';
6
6
 
7
7
  type ContainerProps = {
@@ -1,9 +1,9 @@
1
1
  import { useCallback, useEffect, useRef, useState } from 'react';
2
2
  import { QRCodeSVG } from 'qrcode.react';
3
3
  import { withBase, useLang } from '@rspress/core/runtime';
4
- import IconLaunch from '../svg/launch.svg';
5
- import IconQrcode from '../svg/qrcode.svg';
6
- import IconRefresh from '../svg/refresh.svg';
4
+ import IconLaunch from '../icons/Launch';
5
+ import IconQrcode from '../icons/Qrcode';
6
+ import IconRefresh from '../icons/Refresh';
7
7
 
8
8
  const locales = {
9
9
  zh: {
@@ -0,0 +1,19 @@
1
+ const Code = ({ color = 'currentColor', ...props }) => (
2
+ <svg
3
+ width="1em"
4
+ height="1em"
5
+ viewBox="0 0 48 48"
6
+ fill="none"
7
+ xmlns="http://www.w3.org/2000/svg"
8
+ stroke={color}
9
+ strokeWidth="4"
10
+ {...props}
11
+ >
12
+ <path
13
+ d="M16.7336 12.6863L5.41992 24L16.7336 35.3137M31.2551 12.6863L42.5688 24L31.2551 35.3137M27.1999 6.28003L20.9486 41.7331"
14
+ strokeLinecap="butt"
15
+ ></path>
16
+ </svg>
17
+ );
18
+
19
+ export default Code;
@@ -0,0 +1,18 @@
1
+ const Launch = ({ color = 'currentColor', ...props }) => (
2
+ <svg
3
+ width="1em"
4
+ height="1em"
5
+ viewBox="0 0 48 48"
6
+ fill="none"
7
+ stroke={color}
8
+ strokeWidth="4"
9
+ xmlns="http://www.w3.org/2000/svg"
10
+ {...props}
11
+ >
12
+ <path d="M41 25.9998V39.9998C41 40.552 40.5523 40.9998 40 40.9998H8C7.44772 40.9998 7 40.552 7 39.9998V7.99976C7 7.44747 7.44772 6.99976 8 6.99976H22" />
13
+ <path d="M19.822 28.1776L39.899 8.09961" />
14
+ <path d="M40.9998 20L41.0002 7H28.0008" />
15
+ </svg>
16
+ );
17
+
18
+ export default Launch;
@@ -0,0 +1,19 @@
1
+ const Qrcode = ({ color = 'currentColor', ...props }) => (
2
+ <svg
3
+ width="1em"
4
+ height="1em"
5
+ viewBox="0 0 48 48"
6
+ fill="none"
7
+ stroke={color}
8
+ strokeWidth="4"
9
+ xmlns="http://www.w3.org/2000/svg"
10
+ {...props}
11
+ >
12
+ <path
13
+ d="M24 30V34M24 37V43M43 24H37M34 24H30M7 7H24V24H7V7ZM7 32H16V41H7V32ZM32 32H41V41H32V32ZM32 7H41V16H32V7ZM14 14H17V17H14V14Z"
14
+ strokeLinecap="butt"
15
+ ></path>
16
+ </svg>
17
+ );
18
+
19
+ export default Qrcode;
@@ -0,0 +1,19 @@
1
+ const Refresh = ({ color = 'currentColor', ...props }) => (
2
+ <svg
3
+ width="1em"
4
+ height="1em"
5
+ viewBox="0 0 48 48"
6
+ fill="none"
7
+ stroke={color}
8
+ strokeWidth="4"
9
+ xmlns="http://www.w3.org/2000/svg"
10
+ {...props}
11
+ >
12
+ <path
13
+ d="M38.837 18C36.4634 12.1363 30.7148 8 24 8C15.1634 8 8 15.1634 8 24C8 32.8366 15.1634 40 24 40C31.4554 40 37.7198 34.9009 39.4959 28M40 8V18H30"
14
+ strokeLinecap="butt"
15
+ ></path>
16
+ </svg>
17
+ );
18
+
19
+ export default Refresh;
@@ -1,3 +0,0 @@
1
- <svg width="1em" height="1em" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg" stroke="currentColor" stroke-width="4">
2
- <path d="M16.7336 12.6863L5.41992 24L16.7336 35.3137M31.2551 12.6863L42.5688 24L31.2551 35.3137M27.1999 6.28003L20.9486 41.7331" stroke-linecap="butt"></path>
3
- </svg>
@@ -1,5 +0,0 @@
1
- <svg width="1em" height="1em" viewBox="0 0 48 48" fill="none" stroke-width="4" stroke="currentColor" xmlns="http://www.w3.org/2000/svg">
2
- <path d="M41 25.9998V39.9998C41 40.552 40.5523 40.9998 40 40.9998H8C7.44772 40.9998 7 40.552 7 39.9998V7.99976C7 7.44747 7.44772 6.99976 8 6.99976H22" />
3
- <path d="M19.822 28.1776L39.899 8.09961" />
4
- <path d="M40.9998 20L41.0002 7H28.0008" />
5
- </svg>
@@ -1,3 +0,0 @@
1
- <svg width="1em" height="1em" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg" stroke="currentColor" stroke-width="4">
2
- <path d="M24 30V34M24 37V43M43 24H37M34 24H30M7 7H24V24H7V7ZM7 32H16V41H7V32ZM32 32H41V41H32V32ZM32 7H41V16H32V7ZM14 14H17V17H14V14Z" stroke-linecap="butt"></path>
3
- </svg>
@@ -1,3 +0,0 @@
1
- <svg width="1em" height="1em" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg" stroke="currentColor" stroke-width="4">
2
- <path d="M38.837 18C36.4634 12.1363 30.7148 8 24 8C15.1634 8 8 15.1634 8 24C8 32.8366 15.1634 40 24 40C31.4554 40 37.7198 34.9009 39.4959 28M40 8V18H30" stroke-linecap="butt"></path>
3
- </svg>