From 96cd0698f7a8a09726bf47107809fc3bb7d0cde6 Mon Sep 17 00:00:00 2001 From: owjs3901 Date: Mon, 3 Feb 2025 14:47:12 +0900 Subject: [PATCH] Fix theme typing issue and update dependencies to version 0.48.2 --- .changeset/long-laws-shout.md | 5 ++ .changeset/polite-humans-wash.md | 5 ++ Cargo.lock | 76 ++++++++----------- libs/extractor/Cargo.toml | 12 +-- libs/extractor/src/extract_style/mod.rs | 10 ++- .../react/src/types/props/selector/index.ts | 10 ++- 6 files changed, 62 insertions(+), 56 deletions(-) create mode 100644 .changeset/long-laws-shout.md create mode 100644 .changeset/polite-humans-wash.md diff --git a/.changeset/long-laws-shout.md b/.changeset/long-laws-shout.md new file mode 100644 index 00000000..f56d1617 --- /dev/null +++ b/.changeset/long-laws-shout.md @@ -0,0 +1,5 @@ +--- +"@devup-ui/wasm": patch +--- + +Add flexGrow to Maintain prop diff --git a/.changeset/polite-humans-wash.md b/.changeset/polite-humans-wash.md new file mode 100644 index 00000000..806095f6 --- /dev/null +++ b/.changeset/polite-humans-wash.md @@ -0,0 +1,5 @@ +--- +"@devup-ui/react": patch +--- + +Fix theme typing issue diff --git a/Cargo.lock b/Cargo.lock index 73586d23..ab2d58f1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -435,9 +435,9 @@ dependencies = [ [[package]] name = "oxc_allocator" -version = "0.48.1" +version = "0.48.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd69a857285f6519c595cfba74b91649b22b715169f11e2b4355f32b36c780c2" +checksum = "17374a91329f2e362bc8be31cb3e171ef226777d0ea668e17a39620443693027" dependencies = [ "allocator-api2", "bumpalo", @@ -448,9 +448,9 @@ dependencies = [ [[package]] name = "oxc_ast" -version = "0.48.1" +version = "0.48.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aeac0e9cfa9b40f04feb51d723a71279a985088c3df18d04e92e8a2d96385017" +checksum = "21b38cfe954ee987354af015020f5cb2723df6fed6cd688eff24388437c7eb7e" dependencies = [ "bitflags", "cow-utils", @@ -466,9 +466,9 @@ dependencies = [ [[package]] name = "oxc_ast_macros" -version = "0.48.1" +version = "0.48.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f3dfdfd34a28dd0258717a0a6e40c1f33bcf096c11f0b29a0930aca48b34b81" +checksum = "85f9e03eff90b041078edcc8aff09457eb4126fa5d62a383fdb082d3ae286274" dependencies = [ "proc-macro2", "quote", @@ -477,9 +477,9 @@ dependencies = [ [[package]] name = "oxc_cfg" -version = "0.48.1" +version = "0.48.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8828ecb52029aeec2cc96039e407e9e64c3c343cb85a3ed7d7e17908f3013c10" +checksum = "20347f1cff149f8d7354b0a16877714f4e3f7d6eb4f5cd659c3de1d5d283e846" dependencies = [ "bitflags", "itertools", @@ -492,9 +492,9 @@ dependencies = [ [[package]] name = "oxc_codegen" -version = "0.48.1" +version = "0.48.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "317584c2cea0053b4882901ac5f7caa6036d39285881767467d7ade6959a1816" +checksum = "d5bd847bc5d8a2b5a620e33e0b0422fc8ddb6c85562de97da6fe86659dfd571b" dependencies = [ "assert-unchecked", "bitflags", @@ -504,18 +504,19 @@ dependencies = [ "oxc_ast", "oxc_data_structures", "oxc_index", - "oxc_mangler", + "oxc_semantic", "oxc_sourcemap", "oxc_span", "oxc_syntax", "rustc-hash", + "ryu-js", ] [[package]] name = "oxc_data_structures" -version = "0.48.1" +version = "0.48.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "150f668753d100a1709f2962f4000405e85b34feac675aec71c9cf158676a26a" +checksum = "3697dd172835a236572748761301a7e3a17fb770cf30bb771ec10982fcbd86c8" dependencies = [ "assert-unchecked", "ropey", @@ -523,18 +524,19 @@ dependencies = [ [[package]] name = "oxc_diagnostics" -version = "0.48.1" +version = "0.48.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc6d24b258ff0a030abaf64b0dcf66b7e0edd7a7a250982bee221a00518517b0" +checksum = "a24c41929c1910d83fb6f4c508190a8b2d1bad02e81c8cb3a9d3f474ca0ad2c1" dependencies = [ + "cow-utils", "oxc-miette", ] [[package]] name = "oxc_ecmascript" -version = "0.48.1" +version = "0.48.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2436fe122e749f834e8a8d9efe68f5d3b64e3c757424db0a897a289e173dfea1" +checksum = "30fba86c97b571671f941b818e6831ba821aac398b9f6f3b4e3367ca264b8324" dependencies = [ "num-bigint", "num-traits", @@ -545,9 +547,9 @@ dependencies = [ [[package]] name = "oxc_estree" -version = "0.48.1" +version = "0.48.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae587120a6203d483ff0e3f36aa7b062cdffba829e9ebbfecc9e434f83a7db19" +checksum = "e587034bb5f108dd987e5419a4ad35a173550bd9439fc2b610d34e4ce41e8b23" [[package]] name = "oxc_index" @@ -555,27 +557,11 @@ version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5eca5d9726cd0a6e433debe003b7bc88b2ecad0bb6109f0cef7c55e692139a34" -[[package]] -name = "oxc_mangler" -version = "0.48.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "439e7592d6ba4177e5422c06a8c59b860303c7dda5046140733f6cb76ef5623c" -dependencies = [ - "fixedbitset", - "itertools", - "oxc_allocator", - "oxc_ast", - "oxc_index", - "oxc_semantic", - "oxc_span", - "rustc-hash", -] - [[package]] name = "oxc_parser" -version = "0.48.1" +version = "0.48.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3012efb4a88efc6b24977a45254ef5f4e18490d47421bbefa11503198399bfa2" +checksum = "8dc385aca3586877f8c918aed1141b885dedcfc1019d6ea5be4105f8e2a7965e" dependencies = [ "assert-unchecked", "bitflags", @@ -596,9 +582,9 @@ dependencies = [ [[package]] name = "oxc_regular_expression" -version = "0.48.1" +version = "0.48.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f207437d0911f8f9e77efb680b7fc5a7000073fcf72072139cf95cac18e89f6c" +checksum = "f8d172402f6d542ab2837d35126cc42ad6989b9c2289b06bc5c8c89dceb60c48" dependencies = [ "oxc_allocator", "oxc_ast_macros", @@ -612,9 +598,9 @@ dependencies = [ [[package]] name = "oxc_semantic" -version = "0.48.1" +version = "0.48.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3adfa6378abdef12ee82535f4c53018b46773e5ed91c4f0ca632e6e369fae89b" +checksum = "7ceb1f387b1ded0c84bdbc1f14eb087204cb9cd9ca4b4ff867be8d1575c7b20a" dependencies = [ "assert-unchecked", "itertools", @@ -648,9 +634,9 @@ dependencies = [ [[package]] name = "oxc_span" -version = "0.48.1" +version = "0.48.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8457acf582fa6139d91b6e28d839baf67fe8f0f1f427a3da15cb50e71b82e1f8" +checksum = "75881376dfdbb6a23f12a66794904f0d215629f208edcf7e156c0770e89e2101" dependencies = [ "compact_str", "oxc-miette", @@ -661,9 +647,9 @@ dependencies = [ [[package]] name = "oxc_syntax" -version = "0.48.1" +version = "0.48.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56135335adaf1c90d23851da0afb9960f191ef2f3fcd6f16cf16da2e6cfc339e" +checksum = "c6d88037a5de07f66299ab523a65545cc48d550658cea8cadcea09b60596dd49" dependencies = [ "assert-unchecked", "bitflags", diff --git a/libs/extractor/Cargo.toml b/libs/extractor/Cargo.toml index 8d8a245c..e8396907 100644 --- a/libs/extractor/Cargo.toml +++ b/libs/extractor/Cargo.toml @@ -4,12 +4,12 @@ version = "0.1.0" edition = "2021" [dependencies] -oxc_parser = "0.48.1" -oxc_syntax = "0.48.1" -oxc_span = "0.48.1" -oxc_allocator = "0.48.1" -oxc_ast = "0.48.1" -oxc_codegen = "0.48.1" +oxc_parser = "0.48.2" +oxc_syntax = "0.48.2" +oxc_span = "0.48.2" +oxc_allocator = "0.48.2" +oxc_ast = "0.48.2" +oxc_codegen = "0.48.2" css = { path = "../css" } once_cell = "1.20.2" diff --git a/libs/extractor/src/extract_style/mod.rs b/libs/extractor/src/extract_style/mod.rs index 29c7c6b5..fe186bcd 100644 --- a/libs/extractor/src/extract_style/mod.rs +++ b/libs/extractor/src/extract_style/mod.rs @@ -28,6 +28,7 @@ static MAINTAIN_VALUE_PROPERTIES: Lazy> = Lazy::new(|| { set.insert("fontWeight".to_string()); set.insert("scale".to_string()); set.insert("aspectRatio".to_string()); + set.insert("flexGrow".to_string()); set }); @@ -98,7 +99,14 @@ impl ExtractStyleProperty for ExtractStaticStyle { StyleProperty::ClassName(sheet_to_classname( self.property.as_str(), self.level, - Some(convert_value(self.value.as_str()).as_str()), + Some( + if MAINTAIN_VALUE_PROPERTIES.contains(self.property.as_str()) { + self.value.to_string() + } else { + convert_value(self.value.as_str()) + } + .as_str(), + ), s.as_deref(), )) } diff --git a/packages/react/src/types/props/selector/index.ts b/packages/react/src/types/props/selector/index.ts index db02c2a6..bcfe6a8d 100644 --- a/packages/react/src/types/props/selector/index.ts +++ b/packages/react/src/types/props/selector/index.ts @@ -5,10 +5,12 @@ type toPascalCase = S extends `${infer T}${infer U}` ? `${Uppercase}${U}` : S -export type DevupThemeSelectorProps = { - [K in keyof DevupTheme as `_theme${toPascalCase}`]?: DevupCommonProps & - DevupSelectorProps -} +export type DevupThemeSelectorProps = keyof DevupTheme extends undefined + ? Record<`_theme${string}`, DevupCommonProps & DevupSelectorProps> + : { + [K in keyof DevupTheme as `_theme${toPascalCase}`]?: DevupCommonProps & + DevupSelectorProps + } export interface DevupSelectorProps { _active?: DevupCommonProps