parent
0ea06da94c
commit
26e2f2f169
|
@ -16,5 +16,6 @@ vrt/report.html
|
|||
reg.json
|
||||
docx-core/tests/output/*.docx
|
||||
docx-wasm/*.tgz
|
||||
docx-core/bindings
|
||||
docx-core/tests/output/*.json
|
||||
test.json
|
|
@ -2,6 +2,12 @@
|
|||
# It is not intended for manual editing.
|
||||
version = 3
|
||||
|
||||
[[package]]
|
||||
name = "Inflector"
|
||||
version = "0.11.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "fe438c63458706e03479442743baae6c88256498e6431708f6dfc520a26515d3"
|
||||
|
||||
[[package]]
|
||||
name = "adler"
|
||||
version = "0.2.3"
|
||||
|
@ -176,6 +182,7 @@ dependencies = [
|
|||
"serde",
|
||||
"serde_json",
|
||||
"thiserror",
|
||||
"ts-rs",
|
||||
"wasm-bindgen",
|
||||
"xml-rs",
|
||||
"zip",
|
||||
|
@ -563,6 +570,15 @@ dependencies = [
|
|||
"unicode-xid",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "termcolor"
|
||||
version = "1.1.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "2dfed899f0eb03f32ee8c6a0aabdb8a7949659e3466561fc0adf54e26d88c5f4"
|
||||
dependencies = [
|
||||
"winapi-util",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "terminal_size"
|
||||
version = "0.1.16"
|
||||
|
@ -604,6 +620,29 @@ dependencies = [
|
|||
"weezl",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "ts-rs"
|
||||
version = "6.1.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "df082879c2ca6521d54bedd7d6d2e9407b7d457dede64415f1739d3a44a19b05"
|
||||
dependencies = [
|
||||
"thiserror",
|
||||
"ts-rs-macros",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "ts-rs-macros"
|
||||
version = "6.1.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f402688b565efbe1a0ffb296e201c12f1986fd02eba37f4dc62c13098a6218c1"
|
||||
dependencies = [
|
||||
"Inflector",
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn",
|
||||
"termcolor",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "unicode-xid"
|
||||
version = "0.2.0"
|
||||
|
@ -686,6 +725,15 @@ version = "0.4.0"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6"
|
||||
|
||||
[[package]]
|
||||
name = "winapi-util"
|
||||
version = "0.1.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178"
|
||||
dependencies = [
|
||||
"winapi",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "winapi-x86_64-pc-windows-gnu"
|
||||
version = "0.4.0"
|
||||
|
|
|
@ -27,6 +27,7 @@ zip = { version = "0.5.6", default-features = false, features = ["deflate"] }
|
|||
serde = { version = "1.0", features = ["derive"] }
|
||||
serde_json = "1.0"
|
||||
image = "0.23.14"
|
||||
ts-rs = "6.1"
|
||||
|
||||
[dev-dependencies]
|
||||
pretty_assertions = "1.0.0"
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
import type { FontSchemeFont } from "./FontSchemeFont";
|
||||
|
||||
export interface FontGroup { latin: string, ea: string, cs: string, fonts: Array<FontSchemeFont>, }
|
|
@ -0,0 +1,3 @@
|
|||
import type { FontGroup } from "./FontGroup";
|
||||
|
||||
export interface FontScheme { majorFont: FontGroup, minorFont: FontGroup, }
|
|
@ -0,0 +1,2 @@
|
|||
|
||||
export interface FontSchemeFont { script: string, typeface: string, }
|
|
@ -0,0 +1,3 @@
|
|||
import type { FontScheme } from "./FontScheme";
|
||||
|
||||
export interface Theme { fontSchema: FontScheme, }
|
|
@ -1,13 +1,15 @@
|
|||
use serde::Serialize;
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Serialize)]
|
||||
#[derive(Debug, Clone, PartialEq, Serialize, ts_rs::TS)]
|
||||
#[ts(export)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct FontSchemeFont {
|
||||
pub script: String,
|
||||
pub typeface: String,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Serialize, Default)]
|
||||
#[derive(Debug, Clone, PartialEq, Serialize, Default, ts_rs::TS)]
|
||||
#[ts(export)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct FontGroup {
|
||||
pub latin: String,
|
||||
|
@ -16,7 +18,8 @@ pub struct FontGroup {
|
|||
pub fonts: Vec<FontSchemeFont>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Serialize, Default)]
|
||||
#[derive(Debug, Clone, PartialEq, Serialize, Default, ts_rs::TS)]
|
||||
#[ts(export)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct FontScheme {
|
||||
pub major_font: FontGroup,
|
||||
|
|
|
@ -2,7 +2,8 @@ use serde::Serialize;
|
|||
|
||||
use super::*;
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Serialize, Default)]
|
||||
#[derive(Debug, Clone, PartialEq, Serialize, Default, ts_rs::TS)]
|
||||
#[ts(export)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct Theme {
|
||||
pub font_schema: FontScheme,
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
import type { FontSchemeFont } from "./FontSchemeFont";
|
||||
|
||||
export interface FontGroup { latin: string, ea: string, cs: string, fonts: Array<FontSchemeFont>, }
|
|
@ -0,0 +1,3 @@
|
|||
import type { FontGroup } from "./FontGroup";
|
||||
|
||||
export interface FontScheme { majorFont: FontGroup, minorFont: FontGroup, }
|
|
@ -0,0 +1,2 @@
|
|||
|
||||
export interface FontSchemeFont { script: string, typeface: string, }
|
|
@ -0,0 +1,3 @@
|
|||
import type { FontScheme } from "./FontScheme";
|
||||
|
||||
export interface Theme { fontSchema: FontScheme, }
|
|
@ -4,6 +4,8 @@ import { NumberingsJSON } from "./numbering";
|
|||
import { CommentJSON } from "./comment";
|
||||
import { WebSettingsJSON } from "./web-settings";
|
||||
|
||||
import { Theme as ThemeJSON } from "./bindings/Theme";
|
||||
|
||||
export type DocxJSON = {
|
||||
contentType: {
|
||||
types: {
|
||||
|
@ -44,6 +46,7 @@ export type DocxJSON = {
|
|||
settings: SettingsJSON;
|
||||
webSettings: WebSettingsJSON;
|
||||
fontTable: {};
|
||||
themes: ThemeJSON[];
|
||||
};
|
||||
|
||||
export type SettingsJSON = {
|
||||
|
@ -67,3 +70,5 @@ export * from "./web-settings";
|
|||
export * from "./comment";
|
||||
export * from "./textbox-content";
|
||||
export * from "./section-property";
|
||||
|
||||
export { ThemeJSON };
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "docx-wasm",
|
||||
"version": "0.0.235",
|
||||
"version": "0.0.240",
|
||||
"main": "dist/node/index.js",
|
||||
"browser": "dist/web/index.js",
|
||||
"author": "bokuweb <bokuweb12@gmail.com>",
|
||||
|
@ -14,9 +14,11 @@
|
|||
"tsc:node": "tsc -p tsconfig.node.json",
|
||||
"tsc": "run-s tsc:*",
|
||||
"test": "npm run build && tsc && jest",
|
||||
"build": "run-s wasm-pack tsc",
|
||||
"build": "run-s tsrs copy:bindings wasm-pack tsc",
|
||||
"serve": "webpack-dev-server --open --config webpack.dev.js",
|
||||
"copy": "cpy 'dist/node/pkg/package.json' 'dist/web/pkg'",
|
||||
"tsrs": "cd ../ && make test",
|
||||
"copy:bindings": "cpy '../docx-core/bindings' './js/json/bindings'",
|
||||
"prepublishOnly": "npm run build"
|
||||
},
|
||||
"resolutions": {
|
||||
|
|
Loading…
Reference in New Issue