@netless/app-slide 0.2.39 → 0.2.41
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/LICENSE +21 -0
- package/README-zh.md +53 -53
- package/README.md +68 -68
- package/dist/index.d.ts +294 -294
- package/dist/main.cjs.js +57 -57
- package/dist/main.cjs.js.map +1 -1
- package/dist/main.es.js +10 -8
- package/dist/main.es.js.map +1 -1
- package/dist/main.iife.js +57 -57
- package/dist/main.iife.js.map +1 -1
- package/package.json +9 -9
- package/src/DocsViewer/icons/arrow-left.svg +4 -4
- package/src/DocsViewer/icons/arrow-left.ts +18 -18
- package/src/DocsViewer/icons/arrow-right.svg +4 -4
- package/src/DocsViewer/icons/arrow-right.ts +18 -18
- package/src/DocsViewer/icons/pause.svg +4 -4
- package/src/DocsViewer/icons/pause.ts +18 -18
- package/src/DocsViewer/icons/play.svg +4 -4
- package/src/DocsViewer/icons/play.ts +18 -18
- package/src/DocsViewer/icons/sidebar.svg +4 -4
- package/src/DocsViewer/icons/sidebar.ts +18 -18
- package/src/DocsViewer/index.ts +381 -381
- package/src/DocsViewer/style.scss +228 -228
- package/src/DocsViewer/variables.scss +1 -1
- package/src/SlideController/helpers.ts +48 -48
- package/src/SlideController/index.ts +351 -351
- package/src/SlideDocsViewer/style.scss +28 -28
- package/src/SlidePreviewer/index.ts +225 -225
- package/src/index.ts +283 -283
- package/src/style.scss +14 -14
- package/src/typings.ts +21 -21
- package/src/utils/bgcolor.ts +45 -45
- package/src/utils/freezer.ts +116 -116
- package/src/utils/helpers.ts +32 -32
- package/src/utils/logger.ts +106 -106
package/package.json
CHANGED
|
@@ -1,22 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@netless/app-slide",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.41",
|
|
4
4
|
"main": "dist/main.cjs.js",
|
|
5
5
|
"module": "dist/main.es.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
|
-
"scripts": {
|
|
8
|
-
"types": "node scripts/build-types.mjs",
|
|
9
|
-
"build": "vite build && npm run types",
|
|
10
|
-
"build:dev": "vite build --mode development && npm run types",
|
|
11
|
-
"cleanup": "rimraf ./dist"
|
|
12
|
-
},
|
|
13
7
|
"files": [
|
|
14
8
|
"src",
|
|
15
9
|
"dist",
|
|
16
10
|
"README-zh.md"
|
|
17
11
|
],
|
|
18
12
|
"devDependencies": {
|
|
19
|
-
"@netless/slide": "^1.1.
|
|
13
|
+
"@netless/slide": "^1.1.2",
|
|
20
14
|
"@types/color-string": "^1.5.2",
|
|
21
15
|
"color-string": "^1.9.1",
|
|
22
16
|
"jspdf": "2.5.1",
|
|
@@ -30,5 +24,11 @@
|
|
|
30
24
|
"jspdf": {
|
|
31
25
|
"optional": true
|
|
32
26
|
}
|
|
27
|
+
},
|
|
28
|
+
"scripts": {
|
|
29
|
+
"types": "node scripts/build-types.mjs",
|
|
30
|
+
"build": "vite build && npm run types",
|
|
31
|
+
"build:dev": "vite build --mode development && npm run types",
|
|
32
|
+
"cleanup": "rimraf ./dist"
|
|
33
33
|
}
|
|
34
|
-
}
|
|
34
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 500 500">
|
|
2
|
-
<path
|
|
3
|
-
d="M177.81 249.959L337.473 90.295c2.722-2.865 2.651-7.378-.143-10.1-2.793-2.65-7.163-2.65-9.956 0l-164.75 164.75c-2.793 2.793-2.793 7.306 0 10.1l164.75 164.75c2.865 2.722 7.378 2.65 10.099-.143 2.651-2.794 2.651-7.163 0-9.957L177.809 249.959z" />
|
|
4
|
-
</svg>
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 500 500">
|
|
2
|
+
<path
|
|
3
|
+
d="M177.81 249.959L337.473 90.295c2.722-2.865 2.651-7.378-.143-10.1-2.793-2.65-7.163-2.65-9.956 0l-164.75 164.75c-2.793 2.793-2.793 7.306 0 10.1l164.75 164.75c2.865 2.722 7.378 2.65 10.099-.143 2.651-2.794 2.651-7.163 0-9.957L177.809 249.959z" />
|
|
4
|
+
</svg>
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
export function arrowLeftSVG(namespace: string): SVGElement {
|
|
2
|
-
const NS = "http://www.w3.org/2000/svg";
|
|
3
|
-
|
|
4
|
-
const $svg = document.createElementNS(NS, "svg");
|
|
5
|
-
$svg.setAttribute("class", `${namespace}-footer-icon-arrow-left`);
|
|
6
|
-
$svg.setAttribute("viewBox", "0 0 500 500");
|
|
7
|
-
|
|
8
|
-
const $path = document.createElementNS(NS, "path");
|
|
9
|
-
$path.setAttribute("fill", "currentColor");
|
|
10
|
-
$path.setAttribute(
|
|
11
|
-
"d",
|
|
12
|
-
"M177.81 249.959L337.473 90.295c2.722-2.865 2.651-7.378-.143-10.1-2.793-2.65-7.163-2.65-9.956 0l-164.75 164.75c-2.793 2.793-2.793 7.306 0 10.1l164.75 164.75c2.865 2.722 7.378 2.65 10.099-.143 2.651-2.794 2.651-7.163 0-9.957L177.809 249.959z"
|
|
13
|
-
);
|
|
14
|
-
|
|
15
|
-
$svg.appendChild($path);
|
|
16
|
-
|
|
17
|
-
return $svg;
|
|
18
|
-
}
|
|
1
|
+
export function arrowLeftSVG(namespace: string): SVGElement {
|
|
2
|
+
const NS = "http://www.w3.org/2000/svg";
|
|
3
|
+
|
|
4
|
+
const $svg = document.createElementNS(NS, "svg");
|
|
5
|
+
$svg.setAttribute("class", `${namespace}-footer-icon-arrow-left`);
|
|
6
|
+
$svg.setAttribute("viewBox", "0 0 500 500");
|
|
7
|
+
|
|
8
|
+
const $path = document.createElementNS(NS, "path");
|
|
9
|
+
$path.setAttribute("fill", "currentColor");
|
|
10
|
+
$path.setAttribute(
|
|
11
|
+
"d",
|
|
12
|
+
"M177.81 249.959L337.473 90.295c2.722-2.865 2.651-7.378-.143-10.1-2.793-2.65-7.163-2.65-9.956 0l-164.75 164.75c-2.793 2.793-2.793 7.306 0 10.1l164.75 164.75c2.865 2.722 7.378 2.65 10.099-.143 2.651-2.794 2.651-7.163 0-9.957L177.809 249.959z"
|
|
13
|
+
);
|
|
14
|
+
|
|
15
|
+
$svg.appendChild($path);
|
|
16
|
+
|
|
17
|
+
return $svg;
|
|
18
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 500 500">
|
|
2
|
-
<path
|
|
3
|
-
d="M322.19 250.041L162.527 409.705c-2.722 2.865-2.651 7.378.143 10.1 2.793 2.65 7.163 2.65 9.956 0l164.75-164.75c2.793-2.793 2.793-7.306 0-10.1l-164.75-164.75c-2.865-2.722-7.378-2.65-10.099.143-2.651 2.794-2.651 7.163 0 9.957l159.664 159.736z" />
|
|
4
|
-
</svg>
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 500 500">
|
|
2
|
+
<path
|
|
3
|
+
d="M322.19 250.041L162.527 409.705c-2.722 2.865-2.651 7.378.143 10.1 2.793 2.65 7.163 2.65 9.956 0l164.75-164.75c2.793-2.793 2.793-7.306 0-10.1l-164.75-164.75c-2.865-2.722-7.378-2.65-10.099.143-2.651 2.794-2.651 7.163 0 9.957l159.664 159.736z" />
|
|
4
|
+
</svg>
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
export function arrowRightSVG(namespace: string): SVGElement {
|
|
2
|
-
const NS = "http://www.w3.org/2000/svg";
|
|
3
|
-
|
|
4
|
-
const $svg = document.createElementNS(NS, "svg");
|
|
5
|
-
$svg.setAttribute("class", `${namespace}-footer-icon-arrow-right`);
|
|
6
|
-
$svg.setAttribute("viewBox", "0 0 500 500");
|
|
7
|
-
|
|
8
|
-
const $path = document.createElementNS(NS, "path");
|
|
9
|
-
$path.setAttribute("fill", "currentColor");
|
|
10
|
-
$path.setAttribute(
|
|
11
|
-
"d",
|
|
12
|
-
"M322.19 250.041L162.527 409.705c-2.722 2.865-2.651 7.378.143 10.1 2.793 2.65 7.163 2.65 9.956 0l164.75-164.75c2.793-2.793 2.793-7.306 0-10.1l-164.75-164.75c-2.865-2.722-7.378-2.65-10.099.143-2.651 2.794-2.651 7.163 0 9.957l159.664 159.736z"
|
|
13
|
-
);
|
|
14
|
-
|
|
15
|
-
$svg.appendChild($path);
|
|
16
|
-
|
|
17
|
-
return $svg;
|
|
18
|
-
}
|
|
1
|
+
export function arrowRightSVG(namespace: string): SVGElement {
|
|
2
|
+
const NS = "http://www.w3.org/2000/svg";
|
|
3
|
+
|
|
4
|
+
const $svg = document.createElementNS(NS, "svg");
|
|
5
|
+
$svg.setAttribute("class", `${namespace}-footer-icon-arrow-right`);
|
|
6
|
+
$svg.setAttribute("viewBox", "0 0 500 500");
|
|
7
|
+
|
|
8
|
+
const $path = document.createElementNS(NS, "path");
|
|
9
|
+
$path.setAttribute("fill", "currentColor");
|
|
10
|
+
$path.setAttribute(
|
|
11
|
+
"d",
|
|
12
|
+
"M322.19 250.041L162.527 409.705c-2.722 2.865-2.651 7.378.143 10.1 2.793 2.65 7.163 2.65 9.956 0l164.75-164.75c2.793-2.793 2.793-7.306 0-10.1l-164.75-164.75c-2.865-2.722-7.378-2.65-10.099.143-2.651 2.794-2.651 7.163 0 9.957l159.664 159.736z"
|
|
13
|
+
);
|
|
14
|
+
|
|
15
|
+
$svg.appendChild($path);
|
|
16
|
+
|
|
17
|
+
return $svg;
|
|
18
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 500 500">
|
|
2
|
-
<path fill="#1e201d"
|
|
3
|
-
d="M312.491 78.261c0-6.159 4.893-11.213 11.04-11.213 6.158 0 11.211 5.054 11.211 11.213v343.478c0 6.159-5.053 11.213-11.211 11.213-6.147 0-11.04-5.054-11.04-11.213V78.261zM165.257 78.261c0-6.159 4.893-11.213 11.04-11.213 6.158 0 11.211 5.054 11.211 11.213v343.478c0 6.159-5.053 11.213-11.211 11.213-6.147 0-11.04-5.054-11.04-11.213V78.261z" />
|
|
4
|
-
</svg>
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 500 500">
|
|
2
|
+
<path fill="#1e201d"
|
|
3
|
+
d="M312.491 78.261c0-6.159 4.893-11.213 11.04-11.213 6.158 0 11.211 5.054 11.211 11.213v343.478c0 6.159-5.053 11.213-11.211 11.213-6.147 0-11.04-5.054-11.04-11.213V78.261zM165.257 78.261c0-6.159 4.893-11.213 11.04-11.213 6.158 0 11.211 5.054 11.211 11.213v343.478c0 6.159-5.053 11.213-11.211 11.213-6.147 0-11.04-5.054-11.04-11.213V78.261z" />
|
|
4
|
+
</svg>
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
export function pauseSVG(namespace: string): SVGElement {
|
|
2
|
-
const NS = "http://www.w3.org/2000/svg";
|
|
3
|
-
|
|
4
|
-
const $svg = document.createElementNS(NS, "svg");
|
|
5
|
-
$svg.setAttribute("class", `${namespace}-footer-icon-pause`);
|
|
6
|
-
$svg.setAttribute("viewBox", "0 0 500 500");
|
|
7
|
-
|
|
8
|
-
const $path = document.createElementNS(NS, "path");
|
|
9
|
-
$path.setAttribute("fill", "currentColor");
|
|
10
|
-
$path.setAttribute(
|
|
11
|
-
"d",
|
|
12
|
-
"M312.491 78.261c0-6.159 4.893-11.213 11.04-11.213 6.158 0 11.211 5.054 11.211 11.213v343.478c0 6.159-5.053 11.213-11.211 11.213-6.147 0-11.04-5.054-11.04-11.213V78.261zM165.257 78.261c0-6.159 4.893-11.213 11.04-11.213 6.158 0 11.211 5.054 11.211 11.213v343.478c0 6.159-5.053 11.213-11.211 11.213-6.147 0-11.04-5.054-11.04-11.213V78.261z"
|
|
13
|
-
);
|
|
14
|
-
|
|
15
|
-
$svg.appendChild($path);
|
|
16
|
-
|
|
17
|
-
return $svg;
|
|
18
|
-
}
|
|
1
|
+
export function pauseSVG(namespace: string): SVGElement {
|
|
2
|
+
const NS = "http://www.w3.org/2000/svg";
|
|
3
|
+
|
|
4
|
+
const $svg = document.createElementNS(NS, "svg");
|
|
5
|
+
$svg.setAttribute("class", `${namespace}-footer-icon-pause`);
|
|
6
|
+
$svg.setAttribute("viewBox", "0 0 500 500");
|
|
7
|
+
|
|
8
|
+
const $path = document.createElementNS(NS, "path");
|
|
9
|
+
$path.setAttribute("fill", "currentColor");
|
|
10
|
+
$path.setAttribute(
|
|
11
|
+
"d",
|
|
12
|
+
"M312.491 78.261c0-6.159 4.893-11.213 11.04-11.213 6.158 0 11.211 5.054 11.211 11.213v343.478c0 6.159-5.053 11.213-11.211 11.213-6.147 0-11.04-5.054-11.04-11.213V78.261zM165.257 78.261c0-6.159 4.893-11.213 11.04-11.213 6.158 0 11.211 5.054 11.211 11.213v343.478c0 6.159-5.053 11.213-11.211 11.213-6.147 0-11.04-5.054-11.04-11.213V78.261z"
|
|
13
|
+
);
|
|
14
|
+
|
|
15
|
+
$svg.appendChild($path);
|
|
16
|
+
|
|
17
|
+
return $svg;
|
|
18
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 500 500">
|
|
2
|
-
<path fill="#1e201d"
|
|
3
|
-
d="M418.158 257.419L174.663 413.33c-6.017 3.919-15.708 3.772-21.291-.29-2.791-2.018-4.295-4.483-4.295-7.084V94.109c0-5.65 6.883-10.289 15.271-10.289 4.298 0 8.391 1.307 11.181 3.332l242.629 155.484c6.016 3.917 6.451 10.292.649 14.491-.216.154-.432.154-.649.292zM170.621 391.288l223.116-141.301L170.71 107.753l-.089 283.535z" />
|
|
4
|
-
</svg>
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 500 500">
|
|
2
|
+
<path fill="#1e201d"
|
|
3
|
+
d="M418.158 257.419L174.663 413.33c-6.017 3.919-15.708 3.772-21.291-.29-2.791-2.018-4.295-4.483-4.295-7.084V94.109c0-5.65 6.883-10.289 15.271-10.289 4.298 0 8.391 1.307 11.181 3.332l242.629 155.484c6.016 3.917 6.451 10.292.649 14.491-.216.154-.432.154-.649.292zM170.621 391.288l223.116-141.301L170.71 107.753l-.089 283.535z" />
|
|
4
|
+
</svg>
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
export function playSVG(namespace: string): SVGElement {
|
|
2
|
-
const NS = "http://www.w3.org/2000/svg";
|
|
3
|
-
|
|
4
|
-
const $svg = document.createElementNS(NS, "svg");
|
|
5
|
-
$svg.setAttribute("class", `${namespace}-footer-icon-play`);
|
|
6
|
-
$svg.setAttribute("viewBox", "0 0 500 500");
|
|
7
|
-
|
|
8
|
-
const $path = document.createElementNS(NS, "path");
|
|
9
|
-
$path.setAttribute("fill", "currentColor");
|
|
10
|
-
$path.setAttribute(
|
|
11
|
-
"d",
|
|
12
|
-
"M418.158 257.419L174.663 413.33c-6.017 3.919-15.708 3.772-21.291-.29-2.791-2.018-4.295-4.483-4.295-7.084V94.109c0-5.65 6.883-10.289 15.271-10.289 4.298 0 8.391 1.307 11.181 3.332l242.629 155.484c6.016 3.917 6.451 10.292.649 14.491-.216.154-.432.154-.649.292zM170.621 391.288l223.116-141.301L170.71 107.753l-.089 283.535z"
|
|
13
|
-
);
|
|
14
|
-
|
|
15
|
-
$svg.appendChild($path);
|
|
16
|
-
|
|
17
|
-
return $svg;
|
|
18
|
-
}
|
|
1
|
+
export function playSVG(namespace: string): SVGElement {
|
|
2
|
+
const NS = "http://www.w3.org/2000/svg";
|
|
3
|
+
|
|
4
|
+
const $svg = document.createElementNS(NS, "svg");
|
|
5
|
+
$svg.setAttribute("class", `${namespace}-footer-icon-play`);
|
|
6
|
+
$svg.setAttribute("viewBox", "0 0 500 500");
|
|
7
|
+
|
|
8
|
+
const $path = document.createElementNS(NS, "path");
|
|
9
|
+
$path.setAttribute("fill", "currentColor");
|
|
10
|
+
$path.setAttribute(
|
|
11
|
+
"d",
|
|
12
|
+
"M418.158 257.419L174.663 413.33c-6.017 3.919-15.708 3.772-21.291-.29-2.791-2.018-4.295-4.483-4.295-7.084V94.109c0-5.65 6.883-10.289 15.271-10.289 4.298 0 8.391 1.307 11.181 3.332l242.629 155.484c6.016 3.917 6.451 10.292.649 14.491-.216.154-.432.154-.649.292zM170.621 391.288l223.116-141.301L170.71 107.753l-.089 283.535z"
|
|
13
|
+
);
|
|
14
|
+
|
|
15
|
+
$svg.appendChild($path);
|
|
16
|
+
|
|
17
|
+
return $svg;
|
|
18
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64">
|
|
2
|
-
<path
|
|
3
|
-
d="M50 8H14c-3.309 0-6 2.691-6 6v36c0 3.309 2.691 6 6 6h36c3.309 0 6-2.691 6-6V14c0-3.309-2.691-6-6-6zM12 50V14c0-1.103.897-2 2-2h8v40h-8c-1.103 0-2-.897-2-2zm40 0c0 1.103-.897 2-2 2H26V12h24c1.103 0 2 .897 2 2z" />
|
|
4
|
-
</svg>
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64">
|
|
2
|
+
<path
|
|
3
|
+
d="M50 8H14c-3.309 0-6 2.691-6 6v36c0 3.309 2.691 6 6 6h36c3.309 0 6-2.691 6-6V14c0-3.309-2.691-6-6-6zM12 50V14c0-1.103.897-2 2-2h8v40h-8c-1.103 0-2-.897-2-2zm40 0c0 1.103-.897 2-2 2H26V12h24c1.103 0 2 .897 2 2z" />
|
|
4
|
+
</svg>
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
export function sidebarSVG(namespace: string): SVGElement {
|
|
2
|
-
const NS = "http://www.w3.org/2000/svg";
|
|
3
|
-
|
|
4
|
-
const $svg = document.createElementNS(NS, "svg");
|
|
5
|
-
$svg.setAttribute("class", `${namespace}-footer-icon-sidebar`);
|
|
6
|
-
$svg.setAttribute("viewBox", "0 0 64 64");
|
|
7
|
-
|
|
8
|
-
const $path = document.createElementNS(NS, "path");
|
|
9
|
-
$path.setAttribute("fill", "currentColor");
|
|
10
|
-
$path.setAttribute(
|
|
11
|
-
"d",
|
|
12
|
-
"M50 8H14c-3.309 0-6 2.691-6 6v36c0 3.309 2.691 6 6 6h36c3.309 0 6-2.691 6-6V14c0-3.309-2.691-6-6-6zM12 50V14c0-1.103.897-2 2-2h8v40h-8c-1.103 0-2-.897-2-2zm40 0c0 1.103-.897 2-2 2H26V12h24c1.103 0 2 .897 2 2z"
|
|
13
|
-
);
|
|
14
|
-
|
|
15
|
-
$svg.appendChild($path);
|
|
16
|
-
|
|
17
|
-
return $svg;
|
|
18
|
-
}
|
|
1
|
+
export function sidebarSVG(namespace: string): SVGElement {
|
|
2
|
+
const NS = "http://www.w3.org/2000/svg";
|
|
3
|
+
|
|
4
|
+
const $svg = document.createElementNS(NS, "svg");
|
|
5
|
+
$svg.setAttribute("class", `${namespace}-footer-icon-sidebar`);
|
|
6
|
+
$svg.setAttribute("viewBox", "0 0 64 64");
|
|
7
|
+
|
|
8
|
+
const $path = document.createElementNS(NS, "path");
|
|
9
|
+
$path.setAttribute("fill", "currentColor");
|
|
10
|
+
$path.setAttribute(
|
|
11
|
+
"d",
|
|
12
|
+
"M50 8H14c-3.309 0-6 2.691-6 6v36c0 3.309 2.691 6 6 6h36c3.309 0 6-2.691 6-6V14c0-3.309-2.691-6-6-6zM12 50V14c0-1.103.897-2 2-2h8v40h-8c-1.103 0-2-.897-2-2zm40 0c0 1.103-.897 2-2 2H26V12h24c1.103 0 2 .897 2 2z"
|
|
13
|
+
);
|
|
14
|
+
|
|
15
|
+
$svg.appendChild($path);
|
|
16
|
+
|
|
17
|
+
return $svg;
|
|
18
|
+
}
|