@openmaic/renderer 0.0.1
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/DESIGN.md +247 -0
- package/FONTS.md +90 -0
- package/LICENSE +21 -0
- package/README.md +217 -0
- package/dist/SlideCanvas.d.ts +40 -0
- package/dist/SlideElement.d.ts +14 -0
- package/dist/chunks/BaseCodeElement-Bh-Bfdz6.js +1742 -0
- package/dist/chunks/BaseCodeElement-Bh-Bfdz6.js.map +1 -0
- package/dist/chunks/SlideCanvas-BwlcjqMl.js +469 -0
- package/dist/chunks/SlideCanvas-BwlcjqMl.js.map +1 -0
- package/dist/context.d.ts +25 -0
- package/dist/effects/HighlightOverlay.d.ts +7 -0
- package/dist/effects/LaserOverlay.d.ts +7 -0
- package/dist/effects/SpotlightOverlay.d.ts +7 -0
- package/dist/effects/ZoomWrapper.d.ts +9 -0
- package/dist/effects/index.d.ts +4 -0
- package/dist/elements/chart/BaseChartElement.d.ts +6 -0
- package/dist/elements/chart/Chart.d.ts +13 -0
- package/dist/elements/chart/chartOption.d.ts +15 -0
- package/dist/elements/code/BaseCodeElement.d.ts +6 -0
- package/dist/elements/image/BaseImageElement.d.ts +13 -0
- package/dist/elements/image/ImageOutline.d.ts +5 -0
- package/dist/elements/image/clipPaths.d.ts +13 -0
- package/dist/elements/image/useClipImage.d.ts +10 -0
- package/dist/elements/image/useFilter.d.ts +4 -0
- package/dist/elements/index.d.ts +14 -0
- package/dist/elements/index.js +10 -0
- package/dist/elements/index.js.map +1 -0
- package/dist/elements/latex/BaseLatexElement.d.ts +5 -0
- package/dist/elements/line/BaseLineElement.d.ts +6 -0
- package/dist/elements/line/LinePointMarker.d.ts +11 -0
- package/dist/elements/shape/BaseShapeElement.d.ts +5 -0
- package/dist/elements/shape/GradientDefs.d.ts +9 -0
- package/dist/elements/shape/PatternDefs.d.ts +6 -0
- package/dist/elements/shared/ElementOutline.d.ts +7 -0
- package/dist/elements/shared/useElementFill.d.ts +4 -0
- package/dist/elements/shared/useElementFlip.d.ts +3 -0
- package/dist/elements/shared/useElementOutline.d.ts +7 -0
- package/dist/elements/shared/useElementShadow.d.ts +4 -0
- package/dist/elements/table/BaseTableElement.d.ts +6 -0
- package/dist/elements/table/StaticTable.d.ts +6 -0
- package/dist/elements/table/tableUtils.d.ts +5 -0
- package/dist/elements/text/BaseTextElement.d.ts +6 -0
- package/dist/elements/video/BaseVideoElement.d.ts +13 -0
- package/dist/hooks/useSlideBackgroundStyle.d.ts +5 -0
- package/dist/hooks/useViewportSize.d.ts +27 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.js +33 -0
- package/dist/index.js.map +1 -0
- package/dist/snapshot/index.d.ts +46 -0
- package/dist/snapshot/index.js +347 -0
- package/dist/snapshot/index.js.map +1 -0
- package/dist/styles.d.ts +12 -0
- package/dist/types/effects.d.ts +25 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/index.js +2 -0
- package/dist/types/index.js.map +1 -0
- package/dist/utils/cn.d.ts +2 -0
- package/dist/utils/element.d.ts +21 -0
- package/dist/utils/geometry.d.ts +19 -0
- package/font-licenses/ARPHIC-PL.txt +58 -0
- package/font-licenses/OFL.txt +101 -0
- package/font-licenses/ZcoolHappy-LICENSE.txt +16 -0
- package/fonts.css +45 -0
- package/package.json +94 -0
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
This file is the SIL Open Font License 1.1, which governs the following faces
|
|
2
|
+
served by @openmaic/renderer (see ../FONTS.md). Each face's copyright notice is
|
|
3
|
+
listed below, followed by the shared license text (OFL §2 requires the notice
|
|
4
|
+
and license to accompany every redistributed copy).
|
|
5
|
+
|
|
6
|
+
Copyright © 2014-2021 Adobe (http://www.adobe.com/), with Reserved Font Name "Source Han Sans".
|
|
7
|
+
Copyright © 2017-2021 Adobe (http://www.adobe.com/), with Reserved Font Name "Source Han Serif".
|
|
8
|
+
Copyright (c) 2021, The LXGW WenKai Project Authors (https://github.com/lxgw/LxgwWenKai).
|
|
9
|
+
Copyright (c) 2023, Zhejiang JadeFoci Techonology Co. LTD (https://www.jadefoci.com/) [ZhuQueFangSong / 朱雀仿宋].
|
|
10
|
+
|
|
11
|
+
This Font Software is licensed under the SIL Open Font License, Version 1.1.
|
|
12
|
+
This license is copied below, and is also available with a FAQ at:
|
|
13
|
+
http://scripts.sil.org/OFL
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
-----------------------------------------------------------
|
|
17
|
+
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
|
|
18
|
+
-----------------------------------------------------------
|
|
19
|
+
|
|
20
|
+
PREAMBLE
|
|
21
|
+
The goals of the Open Font License (OFL) are to stimulate worldwide
|
|
22
|
+
development of collaborative font projects, to support the font creation
|
|
23
|
+
efforts of academic and linguistic communities, and to provide a free and
|
|
24
|
+
open framework in which fonts may be shared and improved in partnership
|
|
25
|
+
with others.
|
|
26
|
+
|
|
27
|
+
The OFL allows the licensed fonts to be used, studied, modified and
|
|
28
|
+
redistributed freely as long as they are not sold by themselves. The
|
|
29
|
+
fonts, including any derivative works, can be bundled, embedded,
|
|
30
|
+
redistributed and/or sold with any software provided that any reserved
|
|
31
|
+
names are not used by derivative works. The fonts and derivatives,
|
|
32
|
+
however, cannot be released under any other type of license. The
|
|
33
|
+
requirement for fonts to remain under this license does not apply
|
|
34
|
+
to any document created using the fonts or their derivatives.
|
|
35
|
+
|
|
36
|
+
DEFINITIONS
|
|
37
|
+
"Font Software" refers to the set of files released by the Copyright
|
|
38
|
+
Holder(s) under this license and clearly marked as such. This may
|
|
39
|
+
include source files, build scripts and documentation.
|
|
40
|
+
|
|
41
|
+
"Reserved Font Name" refers to any names specified as such after the
|
|
42
|
+
copyright statement(s).
|
|
43
|
+
|
|
44
|
+
"Original Version" refers to the collection of Font Software components as
|
|
45
|
+
distributed by the Copyright Holder(s).
|
|
46
|
+
|
|
47
|
+
"Modified Version" refers to any derivative made by adding to, deleting,
|
|
48
|
+
or substituting -- in part or in whole -- any of the components of the
|
|
49
|
+
Original Version, by changing formats or by porting the Font Software to a
|
|
50
|
+
new environment.
|
|
51
|
+
|
|
52
|
+
"Author" refers to any designer, engineer, programmer, technical
|
|
53
|
+
writer or other person who contributed to the Font Software.
|
|
54
|
+
|
|
55
|
+
PERMISSION & CONDITIONS
|
|
56
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
|
57
|
+
a copy of the Font Software, to use, study, copy, merge, embed, modify,
|
|
58
|
+
redistribute, and sell modified and unmodified copies of the Font
|
|
59
|
+
Software, subject to the following conditions:
|
|
60
|
+
|
|
61
|
+
1) Neither the Font Software nor any of its individual components,
|
|
62
|
+
in Original or Modified Versions, may be sold by itself.
|
|
63
|
+
|
|
64
|
+
2) Original or Modified Versions of the Font Software may be bundled,
|
|
65
|
+
redistributed and/or sold with any software, provided that each copy
|
|
66
|
+
contains the above copyright notice and this license. These can be
|
|
67
|
+
included either as stand-alone text files, human-readable headers or
|
|
68
|
+
in the appropriate machine-readable metadata fields within text or
|
|
69
|
+
binary files as long as those fields can be easily viewed by the user.
|
|
70
|
+
|
|
71
|
+
3) No Modified Version of the Font Software may use the Reserved Font
|
|
72
|
+
Name(s) unless explicit written permission is granted by the corresponding
|
|
73
|
+
Copyright Holder. This restriction only applies to the primary font name as
|
|
74
|
+
presented to the users.
|
|
75
|
+
|
|
76
|
+
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
|
|
77
|
+
Software shall not be used to promote, endorse or advertise any
|
|
78
|
+
Modified Version, except to acknowledge the contribution(s) of the
|
|
79
|
+
Copyright Holder(s) and the Author(s) or with their explicit written
|
|
80
|
+
permission.
|
|
81
|
+
|
|
82
|
+
5) The Font Software, modified or unmodified, in part or in whole,
|
|
83
|
+
must be distributed entirely under this license, and must not be
|
|
84
|
+
distributed under any other license. The requirement for fonts to
|
|
85
|
+
remain under this license does not apply to any document created
|
|
86
|
+
using the Font Software.
|
|
87
|
+
|
|
88
|
+
TERMINATION
|
|
89
|
+
This license becomes null and void if any of the above conditions are
|
|
90
|
+
not met.
|
|
91
|
+
|
|
92
|
+
DISCLAIMER
|
|
93
|
+
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
94
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
|
|
95
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
|
|
96
|
+
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
|
|
97
|
+
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|
98
|
+
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
|
|
99
|
+
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
100
|
+
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
|
|
101
|
+
OTHER DEALINGS IN THE FONT SOFTWARE.
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
站酷快乐体(ZcoolHappy)授权与署名
|
|
2
|
+
设计:刘兵克学员及工作室团队 / thosefree
|
|
3
|
+
来源:站酷(ZCOOL)— https://www.zcool.com.cn/article/ZMTIxNjk0OA==.html
|
|
4
|
+
版权归站酷(ZCOOL)所有,全体造字者保留署名权。
|
|
5
|
+
|
|
6
|
+
版权说明(须随字体保留):
|
|
7
|
+
|
|
8
|
+
版权归站酷(ZCOOL)所有,全体造字者保留署名权,永久免费授权所有人使用
|
|
9
|
+
(可免费商用)。禁止在任何场景下改变站酷免费字体的原有名称,禁止任何人将
|
|
10
|
+
站酷免费字体作为商品进行转售及牟利。
|
|
11
|
+
|
|
12
|
+
使用条件小结:
|
|
13
|
+
- 可免费商用,永久免费授权所有人使用。
|
|
14
|
+
- 不得修改字体的原有名称("站酷快乐体")。
|
|
15
|
+
- 不得将该免费字体作为商品单独转售或牟利。
|
|
16
|
+
- 造字者保留署名权(保留本署名)。
|
package/fonts.css
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GENERATED FILE — do not edit by hand.
|
|
3
|
+
* Source of truth: fonts.config.mjs (run `pnpm run genfonts` to regenerate).
|
|
4
|
+
*
|
|
5
|
+
* Self-hosted Chinese faces for slides imported from PPTX. The importer passes
|
|
6
|
+
* original font-family names through unchanged; a name renders here only if it
|
|
7
|
+
* matches one of these families.
|
|
8
|
+
*
|
|
9
|
+
* Consumers import this once at the app shell:
|
|
10
|
+
* import '@openmaic/renderer/fonts.css';
|
|
11
|
+
*
|
|
12
|
+
* The woff2 files are served from object storage at
|
|
13
|
+
* https://file.maic.chat/fonts/<name>.woff2, fetched on demand the first
|
|
14
|
+
* time a slide actually uses the corresponding font-family.
|
|
15
|
+
*/
|
|
16
|
+
@font-face {
|
|
17
|
+
font-display: swap;
|
|
18
|
+
font-family: 'SourceHanSans';
|
|
19
|
+
src: url('https://file.maic.chat/fonts/SourceHanSans.woff2') format('woff2');
|
|
20
|
+
}
|
|
21
|
+
@font-face {
|
|
22
|
+
font-display: swap;
|
|
23
|
+
font-family: 'SourceHanSerif';
|
|
24
|
+
src: url('https://file.maic.chat/fonts/SourceHanSerif.woff2') format('woff2');
|
|
25
|
+
}
|
|
26
|
+
@font-face {
|
|
27
|
+
font-display: swap;
|
|
28
|
+
font-family: 'LXGWWenKai';
|
|
29
|
+
src: url('https://file.maic.chat/fonts/LXGWWenKai.woff2') format('woff2');
|
|
30
|
+
}
|
|
31
|
+
@font-face {
|
|
32
|
+
font-display: swap;
|
|
33
|
+
font-family: 'ZhuQueFangSong';
|
|
34
|
+
src: url('https://file.maic.chat/fonts/ZhuQueFangSong.woff2') format('woff2');
|
|
35
|
+
}
|
|
36
|
+
@font-face {
|
|
37
|
+
font-display: swap;
|
|
38
|
+
font-family: 'WenDingPLKaiTi';
|
|
39
|
+
src: url('https://file.maic.chat/fonts/WenDingPLKaiTi.woff2') format('woff2');
|
|
40
|
+
}
|
|
41
|
+
@font-face {
|
|
42
|
+
font-display: swap;
|
|
43
|
+
font-family: 'ZcoolHappy';
|
|
44
|
+
src: url('https://file.maic.chat/fonts/ZcoolHappy.woff2') format('woff2');
|
|
45
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@openmaic/renderer",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "React component for rendering PPTist-style Slide JSON, extracted from OpenMAIC.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/index.js",
|
|
7
|
+
"module": "./dist/index.js",
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
12
|
+
"import": "./dist/index.js"
|
|
13
|
+
},
|
|
14
|
+
"./elements": {
|
|
15
|
+
"types": "./dist/elements/index.d.ts",
|
|
16
|
+
"import": "./dist/elements/index.js"
|
|
17
|
+
},
|
|
18
|
+
"./types": {
|
|
19
|
+
"types": "./dist/types/index.d.ts",
|
|
20
|
+
"import": "./dist/types/index.js"
|
|
21
|
+
},
|
|
22
|
+
"./snapshot": {
|
|
23
|
+
"types": "./dist/snapshot/index.d.ts",
|
|
24
|
+
"import": "./dist/snapshot/index.js"
|
|
25
|
+
},
|
|
26
|
+
"./fonts.css": "./fonts.css"
|
|
27
|
+
},
|
|
28
|
+
"files": [
|
|
29
|
+
"dist",
|
|
30
|
+
"fonts.css",
|
|
31
|
+
"README.md",
|
|
32
|
+
"DESIGN.md",
|
|
33
|
+
"LICENSE",
|
|
34
|
+
"FONTS.md",
|
|
35
|
+
"font-licenses"
|
|
36
|
+
],
|
|
37
|
+
"keywords": [
|
|
38
|
+
"slide",
|
|
39
|
+
"renderer",
|
|
40
|
+
"pptist",
|
|
41
|
+
"canvas",
|
|
42
|
+
"react"
|
|
43
|
+
],
|
|
44
|
+
"license": "MIT",
|
|
45
|
+
"publishConfig": {
|
|
46
|
+
"registry": "https://registry.npmjs.org",
|
|
47
|
+
"access": "public"
|
|
48
|
+
},
|
|
49
|
+
"peerDependencies": {
|
|
50
|
+
"echarts": ">=5",
|
|
51
|
+
"motion": ">=11",
|
|
52
|
+
"react": ">=18",
|
|
53
|
+
"react-dom": ">=18",
|
|
54
|
+
"shiki": ">=1.0.0",
|
|
55
|
+
"tailwindcss": ">=4"
|
|
56
|
+
},
|
|
57
|
+
"peerDependenciesMeta": {
|
|
58
|
+
"echarts": {
|
|
59
|
+
"optional": true
|
|
60
|
+
},
|
|
61
|
+
"shiki": {
|
|
62
|
+
"optional": true
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
"dependencies": {
|
|
66
|
+
"clsx": "^2.1.1",
|
|
67
|
+
"html-to-image": "^1.11.13",
|
|
68
|
+
"html2canvas-pro": "^2.0.4",
|
|
69
|
+
"katex": "^0.16.33",
|
|
70
|
+
"lucide-react": "^0.562.0",
|
|
71
|
+
"tailwind-merge": "^3.4.0",
|
|
72
|
+
"tinycolor2": "^1.6.0",
|
|
73
|
+
"@openmaic/dsl": "0.0.1"
|
|
74
|
+
},
|
|
75
|
+
"devDependencies": {
|
|
76
|
+
"@rollup/plugin-commonjs": "^28.0.1",
|
|
77
|
+
"@rollup/plugin-node-resolve": "^16.0.1",
|
|
78
|
+
"@rollup/plugin-typescript": "^12.1.0",
|
|
79
|
+
"@types/katex": "^0.16.8",
|
|
80
|
+
"@types/react": "^19",
|
|
81
|
+
"@types/react-dom": "^19",
|
|
82
|
+
"@types/tinycolor2": "^1.4.6",
|
|
83
|
+
"rollup": "^4.35.0",
|
|
84
|
+
"tslib": "^2.8.0",
|
|
85
|
+
"typescript": "^5"
|
|
86
|
+
},
|
|
87
|
+
"scripts": {
|
|
88
|
+
"clean": "rm -rf dist",
|
|
89
|
+
"genfonts": "node scripts/generate-fonts-css.mjs",
|
|
90
|
+
"build": "node scripts/generate-fonts-css.mjs && rm -rf dist && rollup -c && tsc --emitDeclarationOnly --declarationDir dist",
|
|
91
|
+
"dev": "rollup -c -w",
|
|
92
|
+
"typecheck": "tsc --noEmit"
|
|
93
|
+
}
|
|
94
|
+
}
|