From 7b665cd930503b83af90eb9822ee6f65cf6e6a52 Mon Sep 17 00:00:00 2001 From: owjs3901 Date: Thu, 19 Nov 2026 22:55:12 +0900 Subject: [PATCH 1/4] feat(extractor): compile Devup UI elements to React Native styles Add a Native target to ExtractOption that turns Devup UI elements into React Native components with their styles hoisted into one StyleSheet.create per file, and expose it as codeExtractNative in the WASM and NAPI bindings. Co-Authored-By: Claude Opus 5.5 --- bindings/argument-validation.cjs | 1 + bindings/devup-ui-binding/adapter.cjs | 2 + bindings/devup-ui-binding/index.d.cts | 13 + bindings/devup-ui-binding/index.mjs | 1 + bindings/devup-ui-binding/src/host.rs | 15 + bindings/devup-ui-binding/src/lib.rs | 4 +- bindings/devup-ui-wasm/script.js | 6 +- bindings/devup-ui-wasm/src/lib.rs | 63 + e2e/binding/corpus/extraction.mjs | 31 + e2e/binding/host.mjs | 6 +- e2e/binding/package/consumer.mjs | 2 +- e2e/binding/validation-cases.mjs | 9 +- e2e/binding/validation.mjs | 2 +- e2e/binding/wasm-abi/coverage.test.mjs | 2 +- libs/binding/src/lib.rs | 4 +- libs/binding/src/output.rs | 33 +- libs/binding/tests/native.rs | 52 + libs/extractor/benches/alloc_benchmark.rs | 1 + libs/extractor/benches/extract_benchmark.rs | 1 + .../benches/semantic_pass_benchmark.rs | 1 + .../src/jsx_semantics_tests/factory_spread.rs | 1 + .../src/legacy_semantics_contract_tests.rs | 1 + libs/extractor/src/lib.rs | 2020 +++++++++++------ libs/extractor/src/native/element.rs | 756 ++++++ libs/extractor/src/native/errors.rs | 82 + libs/extractor/src/native/imports.rs | 185 ++ libs/extractor/src/native/mod.rs | 136 ++ libs/extractor/src/native/props.rs | 388 ++++ libs/extractor/src/native/sheet.rs | 76 + ...tor__native__tests__aliases_and_types.snap | 10 + .../extractor__native__tests__apis.snap | 14 + ...ative__tests__backgrounds_and_borders.snap | 26 + .../extractor__native__tests__box_sides.snap | 25 + .../extractor__native__tests__components.snap | 29 + ...or__native__tests__conditional_values.snap | 22 + ...ractor__native__tests__default_import.snap | 5 + ...ractor__native__tests__dynamic_splits.snap | 7 + ...ractor__native__tests__dynamic_values.snap | 16 + ...xtractor__native__tests__empty_values.snap | 6 + ...xtractor__native__tests__given_styles.snap | 15 + .../extractor__native__tests__grid.snap | 5 + ...xtractor__native__tests__image_source.snap | 5 + ...extractor__native__tests__merge_order.snap | 27 + ...ive__tests__missing_and_object_values.snap | 7 + ...actor__native__tests__name_collisions.snap | 10 + .../extractor__native__tests__namespace.snap | 5 + ...actor__native__tests__namespaced_prop.snap | 8 + ...actor__native__tests__nested_elements.snap | 15 + ...tractor__native__tests__no_components.snap | 6 + .../extractor__native__tests__no_styles.snap | 6 + ...tractor__native__tests__opaque_spread.snap | 5 + ...extractor__native__tests__orientation.snap | 6 + ...extractor__native__tests__parse_error.snap | 5 + ...ative__tests__platform_blocks_android.snap | 15 + ...r__native__tests__platform_blocks_ios.snap | 11 + ...r__native__tests__platform_blocks_web.snap | 12 + ...actor__native__tests__platform_shapes.snap | 13 + .../extractor__native__tests__pressed.snap | 6 + .../extractor__native__tests__references.snap | 8 + .../extractor__native__tests__responsive.snap | 5 + ...ative__tests__responsive_in_condition.snap | 5 + .../extractor__native__tests__retagged.snap | 13 + ...tractor__native__tests__runtime_false.snap | 7 + ...xtractor__native__tests__runtime_true.snap | 7 + .../extractor__native__tests__selectors.snap | 7 + ...ractor__native__tests__shared_objects.snap | 13 + ...r__native__tests__sheet_after_imports.snap | 11 + ...__native__tests__shorthands_and_units.snap | 40 + .../extractor__native__tests__style_text.snap | 5 + .../extractor__native__tests__tags.snap | 7 + ...tractor__native__tests__text_children.snap | 8 + ...ractor__native__tests__theme_selector.snap | 5 + ...extractor__native__tests__theme_token.snap | 5 + .../extractor__native__tests__types_read.snap | 7 + .../extractor__native__tests__typography.snap | 5 + ...or__native__tests__unknown_properties.snap | 8 + ...or__native__tests__unsupported_values.snap | 16 + ...tractor__native__tests__unused_import.snap | 5 + ...ractor__native__tests__web_only_props.snap | 7 + ...actor__native__tests__without_package.snap | 5 + libs/extractor/src/native/style.rs | 156 ++ libs/extractor/src/native/tests.rs | 447 ++++ libs/extractor/src/native/values.rs | 161 ++ .../tests/styled_library_forwarding_tests.rs | 2 + libs/extractor/tests/quoted_boundaries.rs | 1 + libs/extractor/tests/vanilla_extract.rs | 3 +- libs/sheet/benches/my_benchmark.rs | 1 + libs/sheet/src/global_order_tests.rs | 2 + libs/sheet/src/lib.rs | 12 +- 89 files changed, 4528 insertions(+), 692 deletions(-) create mode 100644 libs/binding/tests/native.rs create mode 100644 libs/extractor/src/native/element.rs create mode 100644 libs/extractor/src/native/errors.rs create mode 100644 libs/extractor/src/native/imports.rs create mode 100644 libs/extractor/src/native/mod.rs create mode 100644 libs/extractor/src/native/props.rs create mode 100644 libs/extractor/src/native/sheet.rs create mode 100644 libs/extractor/src/native/snapshots/extractor__native__tests__aliases_and_types.snap create mode 100644 libs/extractor/src/native/snapshots/extractor__native__tests__apis.snap create mode 100644 libs/extractor/src/native/snapshots/extractor__native__tests__backgrounds_and_borders.snap create mode 100644 libs/extractor/src/native/snapshots/extractor__native__tests__box_sides.snap create mode 100644 libs/extractor/src/native/snapshots/extractor__native__tests__components.snap create mode 100644 libs/extractor/src/native/snapshots/extractor__native__tests__conditional_values.snap create mode 100644 libs/extractor/src/native/snapshots/extractor__native__tests__default_import.snap create mode 100644 libs/extractor/src/native/snapshots/extractor__native__tests__dynamic_splits.snap create mode 100644 libs/extractor/src/native/snapshots/extractor__native__tests__dynamic_values.snap create mode 100644 libs/extractor/src/native/snapshots/extractor__native__tests__empty_values.snap create mode 100644 libs/extractor/src/native/snapshots/extractor__native__tests__given_styles.snap create mode 100644 libs/extractor/src/native/snapshots/extractor__native__tests__grid.snap create mode 100644 libs/extractor/src/native/snapshots/extractor__native__tests__image_source.snap create mode 100644 libs/extractor/src/native/snapshots/extractor__native__tests__merge_order.snap create mode 100644 libs/extractor/src/native/snapshots/extractor__native__tests__missing_and_object_values.snap create mode 100644 libs/extractor/src/native/snapshots/extractor__native__tests__name_collisions.snap create mode 100644 libs/extractor/src/native/snapshots/extractor__native__tests__namespace.snap create mode 100644 libs/extractor/src/native/snapshots/extractor__native__tests__namespaced_prop.snap create mode 100644 libs/extractor/src/native/snapshots/extractor__native__tests__nested_elements.snap create mode 100644 libs/extractor/src/native/snapshots/extractor__native__tests__no_components.snap create mode 100644 libs/extractor/src/native/snapshots/extractor__native__tests__no_styles.snap create mode 100644 libs/extractor/src/native/snapshots/extractor__native__tests__opaque_spread.snap create mode 100644 libs/extractor/src/native/snapshots/extractor__native__tests__orientation.snap create mode 100644 libs/extractor/src/native/snapshots/extractor__native__tests__parse_error.snap create mode 100644 libs/extractor/src/native/snapshots/extractor__native__tests__platform_blocks_android.snap create mode 100644 libs/extractor/src/native/snapshots/extractor__native__tests__platform_blocks_ios.snap create mode 100644 libs/extractor/src/native/snapshots/extractor__native__tests__platform_blocks_web.snap create mode 100644 libs/extractor/src/native/snapshots/extractor__native__tests__platform_shapes.snap create mode 100644 libs/extractor/src/native/snapshots/extractor__native__tests__pressed.snap create mode 100644 libs/extractor/src/native/snapshots/extractor__native__tests__references.snap create mode 100644 libs/extractor/src/native/snapshots/extractor__native__tests__responsive.snap create mode 100644 libs/extractor/src/native/snapshots/extractor__native__tests__responsive_in_condition.snap create mode 100644 libs/extractor/src/native/snapshots/extractor__native__tests__retagged.snap create mode 100644 libs/extractor/src/native/snapshots/extractor__native__tests__runtime_false.snap create mode 100644 libs/extractor/src/native/snapshots/extractor__native__tests__runtime_true.snap create mode 100644 libs/extractor/src/native/snapshots/extractor__native__tests__selectors.snap create mode 100644 libs/extractor/src/native/snapshots/extractor__native__tests__shared_objects.snap create mode 100644 libs/extractor/src/native/snapshots/extractor__native__tests__sheet_after_imports.snap create mode 100644 libs/extractor/src/native/snapshots/extractor__native__tests__shorthands_and_units.snap create mode 100644 libs/extractor/src/native/snapshots/extractor__native__tests__style_text.snap create mode 100644 libs/extractor/src/native/snapshots/extractor__native__tests__tags.snap create mode 100644 libs/extractor/src/native/snapshots/extractor__native__tests__text_children.snap create mode 100644 libs/extractor/src/native/snapshots/extractor__native__tests__theme_selector.snap create mode 100644 libs/extractor/src/native/snapshots/extractor__native__tests__theme_token.snap create mode 100644 libs/extractor/src/native/snapshots/extractor__native__tests__types_read.snap create mode 100644 libs/extractor/src/native/snapshots/extractor__native__tests__typography.snap create mode 100644 libs/extractor/src/native/snapshots/extractor__native__tests__unknown_properties.snap create mode 100644 libs/extractor/src/native/snapshots/extractor__native__tests__unsupported_values.snap create mode 100644 libs/extractor/src/native/snapshots/extractor__native__tests__unused_import.snap create mode 100644 libs/extractor/src/native/snapshots/extractor__native__tests__web_only_props.snap create mode 100644 libs/extractor/src/native/snapshots/extractor__native__tests__without_package.snap create mode 100644 libs/extractor/src/native/style.rs create mode 100644 libs/extractor/src/native/tests.rs create mode 100644 libs/extractor/src/native/values.rs diff --git a/bindings/argument-validation.cjs b/bindings/argument-validation.cjs index 5aeaf410e..4f0181655 100644 --- a/bindings/argument-validation.cjs +++ b/bindings/argument-validation.cjs @@ -5,6 +5,7 @@ module.exports = function createBoundary() { const descriptors = { codeExtract: extraction, codeExtractWithoutSourceMap: extraction, + codeExtractNative: 'filename:s code:s _package:s platform:s runtime:b', dropSession: 'id:u', getCss: 'file_num:n import_main_css:b', getThemeInterface: diff --git a/bindings/devup-ui-binding/adapter.cjs b/bindings/devup-ui-binding/adapter.cjs index 59b3cf52e..eac096303 100644 --- a/bindings/devup-ui-binding/adapter.cjs +++ b/bindings/devup-ui-binding/adapter.cjs @@ -82,6 +82,8 @@ exports.createBinding = function createBinding(raw) { Output: raw.Output, codeExtract, codeExtractWithoutSourceMap, + codeExtractNative: (filename, code, pkg, platform, runtime) => + raw.extractNative(filename, code, pkg, platform, runtime), createSession: () => raw.createSession(), dropSession: (id) => raw.dropSession(id), exportCanonicalMap: raw.exportCanonicalMap, diff --git a/bindings/devup-ui-binding/index.d.cts b/bindings/devup-ui-binding/index.d.cts index 9d6cb8957..2f4c38c59 100644 --- a/bindings/devup-ui-binding/index.d.cts +++ b/bindings/devup-ui-binding/index.d.cts @@ -36,6 +36,19 @@ export function codeExtractWithoutSourceMap( importMainCssInCss: boolean, importAliases: unknown, ): Output +/** + * Compile a source for React Native on `platform`: Devup UI elements become + * React Native components whose styles are hoisted into one + * `StyleSheet.create`. No CSS is emitted (`css` and `cssFile` are undefined); + * `runtime: false` makes what needs the React Native runtime a build error. + */ +export function codeExtractNative( + filename: string, + code: string, + packageName: string, + platform: 'ios' | 'android' | 'web', + runtime: boolean, +): Output /** Create an engine session with a clean state; select it before each call. */ export function createSession(): number /** Drop a session and its state; dropping the live one makes session 0 live. */ diff --git a/bindings/devup-ui-binding/index.mjs b/bindings/devup-ui-binding/index.mjs index 793f3ed87..a03e6724a 100644 --- a/bindings/devup-ui-binding/index.mjs +++ b/bindings/devup-ui-binding/index.mjs @@ -4,6 +4,7 @@ export const { Output, codeExtract, codeExtractWithoutSourceMap, + codeExtractNative, createSession, dropSession, exportCanonicalMap, diff --git a/bindings/devup-ui-binding/src/host.rs b/bindings/devup-ui-binding/src/host.rs index afdfb63fc..e09c38712 100644 --- a/bindings/devup-ui-binding/src/host.rs +++ b/bindings/devup-ui-binding/src/host.rs @@ -204,6 +204,7 @@ pub fn extract<'env>( single_css: arg(&request, 4)?, import_main_css: arg(&request, 5)?, import_aliases: aliases(decode(arg(&request, 7)?, &access, 7)?), + ..Default::default() }; let import_main_css_in_css = arg(&request, 6)?; let source_map = if arg(&request, 8)? { @@ -277,3 +278,17 @@ pub fn reserve<'env>( )) }) } +/// Compile a source for React Native on a platform: its code and source map, no CSS. +#[napi] +pub fn extract_native( + env: Env, + filename: String, + code: String, + package: String, + platform: String, + runtime: bool, +) -> Result { + core::code_extract_native((&filename, &code), &package, &platform, runtime) + .map(|output| NativeOutput(Some(output))) + .map_err(|error| binding_error(env, error)) +} diff --git a/bindings/devup-ui-binding/src/lib.rs b/bindings/devup-ui-binding/src/lib.rs index bcd3f0180..9103d0b56 100644 --- a/bindings/devup-ui-binding/src/lib.rs +++ b/bindings/devup-ui-binding/src/lib.rs @@ -6,8 +6,8 @@ mod output; mod value; pub use host::{ - Resolved, create_session, drop_session, extract, has_devup_ui, init, reserve, reset, - select_session, set_resolver, + Resolved, create_session, drop_session, extract, extract_native, has_devup_ui, init, reserve, + reset, select_session, set_resolver, }; pub use output::NativeOutput; diff --git a/bindings/devup-ui-wasm/script.js b/bindings/devup-ui-wasm/script.js index 5bbbffac9..0017f9302 100644 --- a/bindings/devup-ui-wasm/script.js +++ b/bindings/devup-ui-wasm/script.js @@ -50,9 +50,9 @@ types = types.replace(hookType, '') assert.equal(types.includes('install_panic_hook'), false) writeFileSync('pkg/index.d.ts', types, 'utf8') const names = [...source.matchAll(/^exports\.(\w+) = \1;/gm)] -assert.equal(names.length, 36) -assert.equal(new Set(names.map((match) => match[1])).size, 36) -assert.equal([...source.matchAll(/^exports\./gm)].length, 36) +assert.equal(names.length, 37) +assert.equal(new Set(names.map((match) => match[1])).size, 37) +assert.equal([...source.matchAll(/^exports\./gm)].length, 37) assert.equal(source.includes('module.exports'), false) for (const name of ['codeExtract', 'codeExtractWithoutSourceMap']) { const signatures = [ diff --git a/bindings/devup-ui-wasm/src/lib.rs b/bindings/devup-ui-wasm/src/lib.rs index 628fe2b8e..8ec64beb5 100644 --- a/bindings/devup-ui-wasm/src/lib.rs +++ b/bindings/devup-ui-wasm/src/lib.rs @@ -531,6 +531,7 @@ fn code_extract_internal_impl( single_css, import_main_css: import_main_css_in_code, import_aliases, + ..Default::default() }; let check = || resolver_state.map_or(Ok(()), |state| state.borrow().check()); binding_core::code_extract( @@ -725,6 +726,37 @@ pub fn code_extract_without_source_map( ) } +/// Internal function to compile a source for React Native (testable without +/// `JsValue`) +pub fn code_extract_native_internal( + filename: &str, + code: &str, + package: &str, + platform: &str, + runtime: bool, +) -> Result { + binding_core::code_extract_native((filename, code), package, platform, runtime) + .map(Output::from) +} + +/// Compile a source for React Native on `platform` (`ios`, `android` or `web`). +/// +/// Devup UI elements become React Native components whose styles are hoisted +/// into one `StyleSheet.create`; the output has the code and its source map +/// but no CSS. `runtime: false` makes what needs the React Native runtime a +/// build error. +#[cfg(not(tarpaulin_include))] +#[wasm_bindgen(js_name = "codeExtractNative")] +pub fn code_extract_native( + filename: &str, + code: &str, + package: &str, + platform: &str, + runtime: bool, +) -> Result { + code_extract_native_internal(filename, code, package, platform, runtime).map_err(js_error) +} + /// Internal function to register theme (testable without `JsValue`) pub fn register_theme_internal(theme: sheet::theme::Theme) { binding_core::register_theme_internal(theme); @@ -1026,6 +1058,35 @@ mod tests { assert_debug_snapshot!(get_css(None, false).unwrap().split("*/").nth(1).unwrap()); } + #[test] + #[serial] + fn test_code_extract_native() { + let _state = TestStateGuard::new(); + let output = code_extract_native_internal( + "view.tsx", + "import { Text } from '@devup-ui/react'\nHi\n", + "@devup-ui/react", + "ios", + true, + ) + .unwrap(); + assert!( + output + .code() + .contains("import { Text } from \"react-native\"") + ); + assert!(output.code().contains("color: \"red\"")); + assert!(output.map().is_some()); + assert_eq!(output.css(), None); + assert_eq!(output.css_file(), None); + assert!(!output.updated_base_style()); + // The sheet is not touched + assert_eq!(get_css(None, false).unwrap(), ""); + assert!( + code_extract_native_internal("view.tsx", "", "@devup-ui/react", "tv", true).is_err() + ); + } + #[test] #[serial] fn test_code_extract_with_modules() { @@ -1406,6 +1467,7 @@ mod tests { single_css: false, import_main_css: false, import_aliases: HashMap::new(), + ..Default::default() }, ) .unwrap(); @@ -1508,6 +1570,7 @@ mod tests { single_css: true, import_main_css: true, import_aliases: HashMap::new(), + ..Default::default() }, ) .unwrap(); diff --git a/e2e/binding/corpus/extraction.mjs b/e2e/binding/corpus/extraction.mjs index 47e8112a2..eb75783c8 100644 --- a/e2e/binding/corpus/extraction.mjs +++ b/e2e/binding/corpus/extraction.mjs @@ -199,4 +199,35 @@ add('located-extractor-error', (h) => { `import {css} from '${pkg}';\nexport const cls=css({color:window.name});`, ) }) +add('react-native-target', (h) => { + const native = `import { Flex, Text } from '${pkg}'\nexport const view = Hi` + for (const [code, platform, runtime] of [ + [native, 'ios', true], + [native, 'android', false], + [native, 'web', true], + ['export const value = 1', 'ios', true], + [box('p={[1, 2]}'), 'ios', false], + [native, 'windows', true], + ]) + h.step( + 'codeExtractNative', + () => { + const out = h.w.codeExtractNative(file, code, pkg, platform, runtime) + try { + return { + instanceOfOutput: out instanceof h.w.Output, + ...Object.fromEntries( + h.fields.map((key) => [ + key, + key in out ? out[key] : { tag: 'absent' }, + ]), + ), + } + } finally { + out.free() + } + }, + [code, platform, runtime], + ) +}) export const extraction = cases diff --git a/e2e/binding/host.mjs b/e2e/binding/host.mjs index 983a462e2..232089280 100644 --- a/e2e/binding/host.mjs +++ b/e2e/binding/host.mjs @@ -68,7 +68,7 @@ save('provenance.json', { scenarios: corpus.map((c) => c.name), }) const names = - 'Output codeExtract codeExtractWithoutSourceMap createSession dropSession exportCanonicalMap exportClassMap exportFileMap exportSheet getCss getDefaultTheme getPrefix getThemeInterface getUnreservedClassSlotCount hasDevupUI importCanonicalMap importClassMap importFileMap importFileRoutes importSheet isDebug isLicenseBanner registerShorthands registerTheme removeFile reserveClassSlots resetBuildState resetStateForTesting seedFileMap selectSession setAtomHoist setDebug setLicenseBanner setModuleResolver setPrefix setStylexStyleResolution'.split( + 'Output codeExtract codeExtractNative codeExtractWithoutSourceMap createSession dropSession exportCanonicalMap exportClassMap exportFileMap exportSheet getCss getDefaultTheme getPrefix getThemeInterface getUnreservedClassSlotCount hasDevupUI importCanonicalMap importClassMap importFileMap importFileRoutes importSheet isDebug isLicenseBanner registerShorthands registerTheme removeFile reserveClassSlots resetBuildState resetStateForTesting seedFileMap selectSession setAtomHoist setDebug setLicenseBanner setModuleResolver setPrefix setStylexStyleResolution'.split( ' ', ) const abi = { @@ -202,8 +202,8 @@ const h = { ) }, } -assert.equal(corpus.length, 29) -assert.equal(new Set(corpus.map((c) => c.name)).size, 29) +assert.equal(corpus.length, 30) +assert.equal(new Set(corpus.map((c) => c.name)).size, 30) h.note('public-error-inventory', runDiagnostics(w)) for (const test of corpus) { scenario = test.name diff --git a/e2e/binding/package/consumer.mjs b/e2e/binding/package/consumer.mjs index d88d174d8..24de60ce0 100644 --- a/e2e/binding/package/consumer.mjs +++ b/e2e/binding/package/consumer.mjs @@ -136,7 +136,7 @@ export async function consume(options) { ] .map((match) => match[1]) .sort() - assert.equal(names.length, 36) + assert.equal(names.length, 37) for (const manager of ['npm', 'bun']) { for (const omit of [false, true]) { const startRequest = server.requests.length diff --git a/e2e/binding/validation-cases.mjs b/e2e/binding/validation-cases.mjs index 26c775745..229085772 100644 --- a/e2e/binding/validation-cases.mjs +++ b/e2e/binding/validation-cases.mjs @@ -20,6 +20,11 @@ const extractSlots = export const positions = [ ['codeExtract', extractSlots, extraction], ['codeExtractWithoutSourceMap', extractSlots, extraction], + [ + 'codeExtractNative', + 'filename:s code:s _package:s platform:s runtime:b', + () => ['src/new.tsx', code, pkg, 'ios', true], + ], ['dropSession', 'id:session', () => [1]], ['getCss', 'file_num:n import_main_css:b', () => [null, false]], [ @@ -164,6 +169,6 @@ export const cases = positions.flatMap((position) => .map((good, index) => (index === position.index ? value : good)), })), ) -assert.equal(positions.length, 50) -assert.equal(new Set(positions.map((p) => p.fn)).size, 23) +assert.equal(positions.length, 55) +assert.equal(new Set(positions.map((p) => p.fn)).size, 24) assert.equal(new Set(cases.map((c) => c.id)).size, cases.length) diff --git a/e2e/binding/validation.mjs b/e2e/binding/validation.mjs index 027d1aa76..980962ecd 100644 --- a/e2e/binding/validation.mjs +++ b/e2e/binding/validation.mjs @@ -114,7 +114,7 @@ for (const [engine, entry] of [ const summary = { cases: cases.length, positions: positions.length, - functions: 23, + functions: 24, engines: 2, runs: runs.length, failed: runs.filter((run) => run.failed).length, diff --git a/e2e/binding/wasm-abi/coverage.test.mjs b/e2e/binding/wasm-abi/coverage.test.mjs index 288e9a09f..57bb6efcf 100644 --- a/e2e/binding/wasm-abi/coverage.test.mjs +++ b/e2e/binding/wasm-abi/coverage.test.mjs @@ -157,6 +157,6 @@ test('exempts only the documented unvalidated parameters', () => { test('the validation oracle covers every documented argument position', () => { const positions = new Set(cases.map((item) => `${item.fn}.${item.parameter}`)) - assert.equal(positions.size, 50) + assert.equal(positions.size, 55) for (const key of Object.keys(UNVALIDATED)) assert.ok(!positions.has(key)) }) diff --git a/libs/binding/src/lib.rs b/libs/binding/src/lib.rs index ed443c077..9a8944e5a 100644 --- a/libs/binding/src/lib.rs +++ b/libs/binding/src/lib.rs @@ -15,7 +15,9 @@ pub use css::{get_prefix, set_custom_shorthands as register_shorthands_internal, pub use css_cache::{SheetCell, SheetGuard}; pub use extractor::{has_devup_ui, has_devup_ui_with}; pub use lazy_css::LazyCss; -pub use output::{CssOptions, ExtractionMode, Output, SourceMapMode, code_extract}; +pub use output::{ + CssOptions, ExtractionMode, Output, SourceMapMode, code_extract, code_extract_native, +}; pub use reservation::{ ReservationInput, reserve_class_slots_internal, reserve_class_slots_selecting, }; diff --git a/libs/binding/src/output.rs b/libs/binding/src/output.rs index b7aa86510..441bbe899 100644 --- a/libs/binding/src/output.rs +++ b/libs/binding/src/output.rs @@ -1,7 +1,7 @@ use css::file_map::{canonical, is_global}; use extractor::{ - ExtractOption, ExtractOutput, ModuleResolver, extract, extract_with_modules, - extract_without_source_map, + ExtractOption, ExtractOutput, ExtractTarget, ModuleResolver, NativePlatform, NativeTarget, + extract, extract_with_modules, extract_without_source_map, }; use crate::css_cache::invalidate_css; @@ -141,3 +141,32 @@ pub fn code_extract( Err(error) => Err(error.to_string()), } } + +/// Compile a `(filename, code)` source for React Native on `platform` +/// (`ios`, `android` or `web`): its code and source map, with no CSS +pub fn code_extract_native( + source: (&str, &str), + package: &str, + platform: &str, + runtime: bool, +) -> Result { + let (filename, code) = source; + let platform = platform.parse::().map_err(|_| { + format!("unknown React Native platform `{platform}`: use `ios`, `android` or `web`") + })?; + let option = ExtractOption { + package: package.to_string(), + target: ExtractTarget::Native(NativeTarget { platform, runtime }), + ..ExtractOption::default() + }; + let output = extract(filename, code, option).map_err(|error| error.to_string())?; + Ok(Output { + code: output.code, + map: output.map, + css_file: None, + updated_base_style: false, + css: None, + dependencies: output.dependencies, + component_markers: output.component_markers, + }) +} diff --git a/libs/binding/tests/native.rs b/libs/binding/tests/native.rs new file mode 100644 index 000000000..2cb427c3d --- /dev/null +++ b/libs/binding/tests/native.rs @@ -0,0 +1,52 @@ +use devup_ui_binding_core::code_extract_native; + +const SOURCE: &str = + "import { Box } from '@devup-ui/react'\nexport const view = \n"; + +#[test] +fn native_extraction_gives_code_and_a_map_without_css() -> Result<(), String> { + // When + let output = code_extract_native(("view.tsx", SOURCE), "@devup-ui/react", "android", true)?; + // Then: React Native's View with a hoisted style, and nothing for a stylesheet. + assert!(output.code.contains("View as Box")); + assert!(output.code.contains("backgroundColor: \"red\"")); + assert!(output.code.contains("padding: 4")); + assert!(output.map.is_some()); + assert!(output.css.is_none()); + assert!(output.css_file.is_none()); + assert!(!output.updated_base_style); + assert_eq!(output.dependencies, Vec::::new()); + Ok(()) +} + +#[test] +fn native_extraction_rejects_an_unknown_platform() { + // When + let error = code_extract_native(("view.tsx", SOURCE), "@devup-ui/react", "windows", true) + .err() + .unwrap_or_default(); + // Then + assert_eq!( + error, + "unknown React Native platform `windows`: use `ios`, `android` or `web`" + ); +} + +#[test] +fn native_extraction_reports_build_errors() { + // When + let error = code_extract_native( + ( + "view.tsx", + "import { Box } from '@devup-ui/react'\n\n", + ), + "@devup-ui/react", + "ios", + false, + ) + .err() + .unwrap_or_default(); + // Then + assert!(error.starts_with("view.tsx:2:6: `` cannot use `p` on React Native")); + assert!(error.contains("`runtime: false`")); +} diff --git a/libs/extractor/benches/alloc_benchmark.rs b/libs/extractor/benches/alloc_benchmark.rs index c1efda4f8..cda740f4e 100644 --- a/libs/extractor/benches/alloc_benchmark.rs +++ b/libs/extractor/benches/alloc_benchmark.rs @@ -87,6 +87,7 @@ fn make_option() -> ExtractOption { single_css: true, import_main_css: false, import_aliases: HashMap::new(), + ..Default::default() } } diff --git a/libs/extractor/benches/extract_benchmark.rs b/libs/extractor/benches/extract_benchmark.rs index 46eadf327..06b71ac17 100644 --- a/libs/extractor/benches/extract_benchmark.rs +++ b/libs/extractor/benches/extract_benchmark.rs @@ -17,6 +17,7 @@ fn make_option() -> ExtractOption { single_css: true, import_main_css: false, import_aliases: HashMap::new(), + ..Default::default() } } diff --git a/libs/extractor/benches/semantic_pass_benchmark.rs b/libs/extractor/benches/semantic_pass_benchmark.rs index 41c7f8964..cc913e0c4 100644 --- a/libs/extractor/benches/semantic_pass_benchmark.rs +++ b/libs/extractor/benches/semantic_pass_benchmark.rs @@ -30,6 +30,7 @@ fn make_option() -> ExtractOption { single_css: true, import_main_css: false, import_aliases: HashMap::new(), + ..Default::default() } } diff --git a/libs/extractor/src/jsx_semantics_tests/factory_spread.rs b/libs/extractor/src/jsx_semantics_tests/factory_spread.rs index 5e7f165c0..a6d7c8547 100644 --- a/libs/extractor/src/jsx_semantics_tests/factory_spread.rs +++ b/libs/extractor/src/jsx_semantics_tests/factory_spread.rs @@ -248,6 +248,7 @@ fn saved_eight_factory_calls_keep_spread_value_and_direct_identity() { ImportAlias::DefaultToNamed("styled".into()), ), ]), + ..Default::default() }, ) .unwrap_or_else(|error| panic!("saved original context: {error}")); diff --git a/libs/extractor/src/legacy_semantics_contract_tests.rs b/libs/extractor/src/legacy_semantics_contract_tests.rs index 69ad88915..b688d3999 100644 --- a/libs/extractor/src/legacy_semantics_contract_tests.rs +++ b/libs/extractor/src/legacy_semantics_contract_tests.rs @@ -18,6 +18,7 @@ fn core_option() -> ExtractOption { single_css: true, import_main_css: false, import_aliases: std::collections::HashMap::new(), + ..Default::default() } } diff --git a/libs/extractor/src/lib.rs b/libs/extractor/src/lib.rs index a93391b1e..4afc47771 100644 --- a/libs/extractor/src/lib.rs +++ b/libs/extractor/src/lib.rs @@ -63,6 +63,7 @@ mod module_loader; mod module_loads; pub mod module_reference; mod mutations; +pub mod native; #[cfg(test)] mod numeric_template_tests; #[cfg(test)] @@ -199,6 +200,7 @@ mod dead_properties_tests; #[cfg(test)] mod dead_properties_text_tests; use crate::extract_style::extract_style_value::ExtractStyleValue; +pub use crate::native::{ExtractTarget, NativePlatform, NativeTarget}; use crate::visit::DevupVisitor; use css::file_map::{canonical, get_file_num_by_filename, is_global}; use oxc_allocator::{Allocator, CloneIn}; @@ -424,6 +426,9 @@ pub struct ExtractOption { pub import_main_css: bool, /// Import aliases for redirecting imports from other CSS-in-JS libraries to the target package pub import_aliases: HashMap, + /// What the output runs on: the web (class names and CSS) or React Native + /// (style objects); the web when not given + pub target: ExtractTarget, } impl Default for ExtractOption { @@ -434,6 +439,7 @@ impl Default for ExtractOption { single_css: false, import_main_css: false, import_aliases: HashMap::new(), + target: ExtractTarget::Web, } } } @@ -472,6 +478,9 @@ fn extract_with_source_map( source_map: bool, resolver: Option<&ModuleResolver>, ) -> Result> { + if let ExtractTarget::Native(target) = option.target { + return native::extract(filename, code, &option.package, target, source_map); + } extract_source(filename, code, None, None, option, source_map, resolver) } @@ -1847,6 +1856,7 @@ mod tests { single_css: false, import_main_css: false, import_aliases: HashMap::new(), + ..Default::default() }; let src = r#"import { Box } from "@devup-ui/react"; const a = ;"#; let parent = extract("parent.tsx", src, opt()).unwrap(); @@ -1881,6 +1891,7 @@ mod tests { single_css: false, import_main_css: false, import_aliases: HashMap::new(), + ..Default::default() }; let src = r#"import { Box } from "@devup-ui/react"; const a = ;"#; let global_out = extract("shared.tsx", src, opt()).unwrap(); @@ -1919,7 +1930,8 @@ mod tests { css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() }, ) .unwrap() @@ -1936,7 +1948,8 @@ mod tests { css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() }, ) .unwrap() @@ -1953,7 +1966,7 @@ mod tests { r#"import {Box} from '@devup-ui/core' {}} aria-valuenow={24} key={2} tabIndex={1} id="id" /> "#, - ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, import_aliases: HashMap::new() } + ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, import_aliases: HashMap::new(), ..Default::default() } ) .unwrap() )); @@ -1971,7 +1984,8 @@ mod tests { css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -1994,7 +2008,8 @@ mod tests { css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -2013,7 +2028,8 @@ mod tests { css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -2032,7 +2048,8 @@ mod tests { css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -2051,7 +2068,8 @@ mod tests { css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -2070,7 +2088,8 @@ mod tests { css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -2089,7 +2108,8 @@ mod tests { css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -2108,7 +2128,8 @@ mod tests { css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -2127,7 +2148,8 @@ mod tests { css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -2146,7 +2168,8 @@ mod tests { css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -2165,7 +2188,8 @@ mod tests { css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -2184,7 +2208,8 @@ mod tests { css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -2203,7 +2228,8 @@ mod tests { css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -2222,7 +2248,8 @@ mod tests { css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -2241,7 +2268,8 @@ mod tests { css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -2255,7 +2283,7 @@ mod tests { r#"import {Box} from '@devup-ui/core' "#, - ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, import_aliases: HashMap::new() } + ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, import_aliases: HashMap::new(), ..Default::default() } ) .unwrap() )); @@ -2268,7 +2296,7 @@ mod tests { r#"import {Box} from '@devup-ui/core' "#, - ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, import_aliases: HashMap::new() } + ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, import_aliases: HashMap::new(), ..Default::default() } ) .unwrap() )); @@ -2286,7 +2314,8 @@ mod tests { css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -2305,7 +2334,8 @@ mod tests { css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -2324,7 +2354,8 @@ mod tests { css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -2344,7 +2375,8 @@ mod tests { css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -2364,7 +2396,8 @@ mod tests { css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -2386,7 +2419,8 @@ mod tests { css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -2404,7 +2438,8 @@ mod tests { css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -2422,7 +2457,8 @@ mod tests { css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -2441,7 +2477,8 @@ mod tests { css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -2460,7 +2497,8 @@ mod tests { css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -2479,7 +2517,8 @@ mod tests { css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -2504,7 +2543,8 @@ mod tests { css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -2530,7 +2570,8 @@ mod tests { css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -2555,7 +2596,8 @@ mod tests { css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -2578,7 +2620,8 @@ mod tests { css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -2597,7 +2640,8 @@ mod tests { css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -2616,7 +2660,8 @@ mod tests { css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -2635,7 +2680,8 @@ mod tests { css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -2653,7 +2699,8 @@ mod tests { css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -2678,7 +2725,8 @@ mod tests { css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -2697,7 +2745,8 @@ mod tests { css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -2720,7 +2769,8 @@ mod tests { css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -2757,7 +2807,8 @@ import clsx from 'clsx' css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -2781,7 +2832,8 @@ import clsx from 'clsx' css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -2803,7 +2855,8 @@ import clsx from 'clsx' css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -2819,7 +2872,8 @@ import clsx from 'clsx' css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -2842,7 +2896,8 @@ import clsx from 'clsx' css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -2861,7 +2916,8 @@ import clsx from 'clsx' css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -2880,7 +2936,8 @@ import clsx from 'clsx' css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -2899,7 +2956,8 @@ import clsx from 'clsx' css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -2918,7 +2976,8 @@ import clsx from 'clsx' css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -2941,7 +3000,8 @@ import clsx from 'clsx' css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -2960,7 +3020,8 @@ import clsx from 'clsx' css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -2979,7 +3040,8 @@ import clsx from 'clsx' css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -3002,7 +3064,8 @@ import clsx from 'clsx' css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -3021,7 +3084,8 @@ import clsx from 'clsx' css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -3040,7 +3104,8 @@ import clsx from 'clsx' css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -3059,7 +3124,8 @@ import clsx from 'clsx' css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -3078,7 +3144,8 @@ import clsx from 'clsx' css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -3101,7 +3168,8 @@ import clsx from 'clsx' css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -3124,7 +3192,8 @@ import clsx from 'clsx' css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -3147,7 +3216,8 @@ import clsx from 'clsx' css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -3166,7 +3236,8 @@ import clsx from 'clsx' css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -3189,7 +3260,8 @@ import clsx from 'clsx' css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -3208,7 +3280,8 @@ import clsx from 'clsx' css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -3231,7 +3304,8 @@ import clsx from 'clsx' css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -3250,7 +3324,8 @@ import clsx from 'clsx' css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -3269,7 +3344,8 @@ import clsx from 'clsx' css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -3288,7 +3364,8 @@ import clsx from 'clsx' css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -3307,7 +3384,8 @@ import clsx from 'clsx' css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -3326,7 +3404,8 @@ import clsx from 'clsx' css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -3345,7 +3424,8 @@ import clsx from 'clsx' css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -3364,7 +3444,8 @@ import clsx from 'clsx' css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -3383,7 +3464,8 @@ import clsx from 'clsx' css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -3402,7 +3484,8 @@ import clsx from 'clsx' css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -3421,7 +3504,8 @@ import clsx from 'clsx' css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -3444,7 +3528,8 @@ import clsx from 'clsx' css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -3463,7 +3548,8 @@ import clsx from 'clsx' css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -3482,7 +3568,8 @@ import clsx from 'clsx' css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -3501,7 +3588,8 @@ import clsx from 'clsx' css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -3520,7 +3608,8 @@ import clsx from 'clsx' css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -3539,7 +3628,8 @@ import clsx from 'clsx' css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -3562,7 +3652,8 @@ import clsx from 'clsx' css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -3581,7 +3672,8 @@ import clsx from 'clsx' css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -3604,7 +3696,8 @@ import clsx from 'clsx' css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -3623,7 +3716,8 @@ import clsx from 'clsx' css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -3642,7 +3736,8 @@ import clsx from 'clsx' css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -3661,7 +3756,8 @@ import clsx from 'clsx' css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -3680,7 +3776,8 @@ import clsx from 'clsx' css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -3699,7 +3796,8 @@ import clsx from 'clsx' css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -3718,7 +3816,8 @@ import clsx from 'clsx' css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -3737,7 +3836,8 @@ import clsx from 'clsx' css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -3760,7 +3860,8 @@ import clsx from 'clsx' css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -3779,7 +3880,8 @@ import clsx from 'clsx' css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -3798,7 +3900,8 @@ import clsx from 'clsx' css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -3817,7 +3920,8 @@ import clsx from 'clsx' css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -3840,7 +3944,8 @@ import clsx from 'clsx' css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -3859,7 +3964,8 @@ import clsx from 'clsx' css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -3878,7 +3984,8 @@ import clsx from 'clsx' css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -3897,7 +4004,8 @@ import clsx from 'clsx' css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -3919,7 +4027,8 @@ import clsx from 'clsx' css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -3938,7 +4047,8 @@ import clsx from 'clsx' css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -3963,7 +4073,8 @@ import clsx from 'clsx' css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -4001,7 +4112,8 @@ import clsx from 'clsx' css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -4024,7 +4136,8 @@ import clsx from 'clsx' css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -4047,7 +4160,8 @@ import clsx from 'clsx' css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -4070,7 +4184,8 @@ import clsx from 'clsx' css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -4093,7 +4208,8 @@ import clsx from 'clsx' css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -4116,7 +4232,8 @@ import clsx from 'clsx' css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -4137,7 +4254,8 @@ import clsx from 'clsx' css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -4165,7 +4283,8 @@ import clsx from 'clsx' css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -4188,7 +4307,8 @@ import clsx from 'clsx' css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -4211,7 +4331,8 @@ import clsx from 'clsx' css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -4238,7 +4359,8 @@ import clsx from 'clsx' css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -4261,7 +4383,8 @@ import clsx from 'clsx' css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -4284,7 +4407,8 @@ import clsx from 'clsx' css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -4314,7 +4438,8 @@ import clsx from 'clsx' css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -4344,7 +4469,8 @@ import clsx from 'clsx' css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -4373,7 +4499,8 @@ import clsx from 'clsx' css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -4396,7 +4523,8 @@ import clsx from 'clsx' css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -4415,7 +4543,8 @@ import clsx from 'clsx' css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -4434,7 +4563,8 @@ import clsx from 'clsx' css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -4453,7 +4583,8 @@ import clsx from 'clsx' css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -4472,7 +4603,8 @@ import clsx from 'clsx' css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -4491,7 +4623,8 @@ import clsx from 'clsx' css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -4510,7 +4643,8 @@ import clsx from 'clsx' css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -4535,7 +4669,8 @@ import clsx from 'clsx' css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -4558,7 +4693,8 @@ import clsx from 'clsx' css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -4584,7 +4720,8 @@ import clsx from 'clsx' css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -4609,7 +4746,8 @@ import clsx from 'clsx' css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -4637,7 +4775,8 @@ import clsx from 'clsx' css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -4664,7 +4803,8 @@ import clsx from 'clsx' css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -4690,7 +4830,8 @@ import clsx from 'clsx' css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -4722,7 +4863,8 @@ import clsx from 'clsx' css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -4749,7 +4891,8 @@ import clsx from 'clsx' css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -4778,7 +4921,8 @@ import clsx from 'clsx' css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -4807,7 +4951,8 @@ import clsx from 'clsx' css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -4836,7 +4981,8 @@ import clsx from 'clsx' css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -4865,7 +5011,8 @@ import clsx from 'clsx' css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -4890,7 +5037,8 @@ import clsx from 'clsx' css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -4911,7 +5059,8 @@ import clsx from 'clsx' css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -4930,7 +5079,8 @@ import clsx from 'clsx' css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -4952,7 +5102,8 @@ import clsx from 'clsx' css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -4977,7 +5128,8 @@ import clsx from 'clsx' css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -5000,7 +5152,8 @@ import clsx from 'clsx' css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -5025,7 +5178,8 @@ import clsx from 'clsx' css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -5050,7 +5204,8 @@ import clsx from 'clsx' css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -5071,7 +5226,8 @@ import clsx from 'clsx' css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -5093,7 +5249,8 @@ import clsx from 'clsx' css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -5114,7 +5271,8 @@ import clsx from 'clsx' css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -5138,7 +5296,8 @@ import clsx from 'clsx' css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -5157,7 +5316,8 @@ import clsx from 'clsx' css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -5176,7 +5336,8 @@ import clsx from 'clsx' css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -5195,7 +5356,8 @@ import clsx from 'clsx' css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -5219,7 +5381,8 @@ import clsx from 'clsx' css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -5249,7 +5412,8 @@ import clsx from 'clsx' css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -5268,7 +5432,8 @@ import clsx from 'clsx' css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -5287,7 +5452,8 @@ import clsx from 'clsx' css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -5307,7 +5473,8 @@ import clsx from 'clsx' css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -5326,7 +5493,8 @@ import clsx from 'clsx' css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -5345,7 +5513,8 @@ import clsx from 'clsx' css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -5364,7 +5533,8 @@ import clsx from 'clsx' css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -5393,7 +5563,8 @@ import clsx from 'clsx' css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -5421,7 +5592,8 @@ import clsx from 'clsx' css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -5444,7 +5616,8 @@ import clsx from 'clsx' css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -5467,7 +5640,8 @@ import clsx from 'clsx' css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -5486,7 +5660,8 @@ import clsx from 'clsx' css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -5505,7 +5680,8 @@ import clsx from 'clsx' css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -5528,7 +5704,8 @@ import clsx from 'clsx' css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -5547,7 +5724,8 @@ import clsx from 'clsx' css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -5566,7 +5744,8 @@ import clsx from 'clsx' css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -5588,7 +5767,8 @@ import clsx from 'clsx' css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -5607,7 +5787,8 @@ import clsx from 'clsx' css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -5626,7 +5807,8 @@ import clsx from 'clsx' css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -5650,7 +5832,8 @@ import clsx from 'clsx' css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -5678,7 +5861,8 @@ import clsx from 'clsx' css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -5707,7 +5891,8 @@ import clsx from 'clsx' css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -5728,7 +5913,8 @@ import clsx from 'clsx' css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() }, ) .unwrap_err() @@ -5747,7 +5933,8 @@ import clsx from 'clsx' css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() }, ) .unwrap_err() @@ -5771,7 +5958,8 @@ import clsx from 'clsx' css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -5790,7 +5978,8 @@ useTheme(); css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -5832,7 +6021,8 @@ export { css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -5870,7 +6060,8 @@ export { css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -5890,7 +6081,8 @@ e(o, { className: "a", bg: "red" }) css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -5910,7 +6102,8 @@ e(o, { className: "a", bg: variable, style: { color: "blue" } }) css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -5930,7 +6123,8 @@ e(o, { className: "a", bg: variable, style: { color: "blue" }, ...props }) css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -5946,7 +6140,7 @@ e(o, { className: "a", bg: variable, style: { color: "blue" }, ...props }) import { Box as o } from "@devup-ui/core"; e(o, { as: b ? "div" : "section", className: "a", bg: variable, style: { color: "blue" }, props: { animate: { duration: 1 } } }) "#, - ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, import_aliases: HashMap::new() } + ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, import_aliases: HashMap::new(), ..Default::default() } ) .unwrap() )); @@ -5959,7 +6153,7 @@ e(o, { className: "a", bg: variable, style: { color: "blue" }, ...props }) import { Box as o } from "@devup-ui/core"; e(o, { as: Variable, className: "a", bg: variable, style: { color: "blue" }, props: { animate: { duration: 1 } } }) "#, - ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, import_aliases: HashMap::new() } + ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, import_aliases: HashMap::new(), ..Default::default() } ) .unwrap() )); @@ -5973,7 +6167,7 @@ e(o, { className: "a", bg: variable, style: { color: "blue" }, ...props }) import { Box as o } from "@devup-ui/core"; e(o, { as: b ? null : undefined, className: "a", bg: variable, style: { color: "blue" }, props: { animate: { duration: 1 } } }) "#, - ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, import_aliases: HashMap::new() } + ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, import_aliases: HashMap::new(), ..Default::default() } ) .unwrap() )); @@ -5984,31 +6178,31 @@ e(o, { className: "a", bg: variable, style: { color: "blue" }, ...props }) fn support_transpile_cjs() { reset_class_map(); reset_file_map(); - assert_debug_snapshot!(ToBTreeSet::from(extract("test.cjs", r#""use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),r=require("@devup-ui/react");function t(){return e.jsxs("div",{children:[e.jsx(r.Box,{_hover:{bg:"blue"},bg:"$text",color:"red",children:"hello"}),e.jsx(r.Text,{typography:"header",children:"typo"}),e.jsx(r.Flex,{as:"section",mt:2,children:"section"})]})}exports.Lib=t;"#, ExtractOption { package: "@devup-ui/react".to_string(), css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, import_aliases: HashMap::new() }).unwrap())); + assert_debug_snapshot!(ToBTreeSet::from(extract("test.cjs", r#""use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),r=require("@devup-ui/react");function t(){return e.jsxs("div",{children:[e.jsx(r.Box,{_hover:{bg:"blue"},bg:"$text",color:"red",children:"hello"}),e.jsx(r.Text,{typography:"header",children:"typo"}),e.jsx(r.Flex,{as:"section",mt:2,children:"section"})]})}exports.Lib=t;"#, ExtractOption { package: "@devup-ui/react".to_string(), css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, import_aliases: HashMap::new(), ..Default::default() }).unwrap())); reset_class_map(); reset_file_map(); - assert_debug_snapshot!(ToBTreeSet::from(extract("test.cjs", r#""use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const {jsx:e1, jsxs:e2}=require("react/jsx-runtime"),r=require("@devup-ui/react");function t(){return e2("div",{children:[e1(r.Box,{_hover:{bg:"blue"},bg:"$text",color:"red",children:"hello"}),e1(r.Text,{typography:"header",children:"typo"}),e1(r.Flex,{as:"section",mt:2,children:"section"})]})}exports.Lib=t;"#, ExtractOption { package: "@devup-ui/react".to_string(), css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, import_aliases: HashMap::new() }).unwrap())); + assert_debug_snapshot!(ToBTreeSet::from(extract("test.cjs", r#""use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const {jsx:e1, jsxs:e2}=require("react/jsx-runtime"),r=require("@devup-ui/react");function t(){return e2("div",{children:[e1(r.Box,{_hover:{bg:"blue"},bg:"$text",color:"red",children:"hello"}),e1(r.Text,{typography:"header",children:"typo"}),e1(r.Flex,{as:"section",mt:2,children:"section"})]})}exports.Lib=t;"#, ExtractOption { package: "@devup-ui/react".to_string(), css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, import_aliases: HashMap::new(), ..Default::default() }).unwrap())); reset_class_map(); reset_file_map(); - assert_debug_snapshot!(ToBTreeSet::from(extract("test.js", r#""use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),r=require("@devup-ui/react");function t(){return e.jsxs("div",{children:[e.jsx(r.Box,{_hover:{bg:"blue"},bg:"$text",color:"red",children:"hello"}),e.jsx(r.Text,{typography:"header",children:"typo"}),e.jsx(r.Flex,{as:"section",mt:2,children:"section"})]})}exports.Lib=t;"#, ExtractOption { package: "@devup-ui/react".to_string(), css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, import_aliases: HashMap::new() }).unwrap())); + assert_debug_snapshot!(ToBTreeSet::from(extract("test.js", r#""use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),r=require("@devup-ui/react");function t(){return e.jsxs("div",{children:[e.jsx(r.Box,{_hover:{bg:"blue"},bg:"$text",color:"red",children:"hello"}),e.jsx(r.Text,{typography:"header",children:"typo"}),e.jsx(r.Flex,{as:"section",mt:2,children:"section"})]})}exports.Lib=t;"#, ExtractOption { package: "@devup-ui/react".to_string(), css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, import_aliases: HashMap::new(), ..Default::default() }).unwrap())); reset_class_map(); reset_file_map(); - assert_debug_snapshot!(ToBTreeSet::from(extract("test.js", r#""use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),r=require("@devup-ui/react");function t(){return e.jsxs("div",{children:[e.jsx(r.Box,{_hover:{bg:"blue"},bg:"$text",color:"red",children:"hello"}),e.jsx(r.Text,{typography:`header`,children:"typo"}),e.jsx(r.Flex,{as:"section",mt:2,children:"section"})]})}exports.Lib=t;"#, ExtractOption { package: "@devup-ui/react".to_string(), css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, import_aliases: HashMap::new() }).unwrap())); + assert_debug_snapshot!(ToBTreeSet::from(extract("test.js", r#""use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),r=require("@devup-ui/react");function t(){return e.jsxs("div",{children:[e.jsx(r.Box,{_hover:{bg:"blue"},bg:"$text",color:"red",children:"hello"}),e.jsx(r.Text,{typography:`header`,children:"typo"}),e.jsx(r.Flex,{as:"section",mt:2,children:"section"})]})}exports.Lib=t;"#, ExtractOption { package: "@devup-ui/react".to_string(), css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, import_aliases: HashMap::new(), ..Default::default() }).unwrap())); reset_class_map(); reset_file_map(); - assert_debug_snapshot!(ToBTreeSet::from(extract("test.js", r#""use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),{Box,Text,Flex}=require("@devup-ui/react");function t(){return e.jsxs("div",{children:[e.jsx(Box,{_hover:{bg:"blue"},bg:"$text",color:"red",children:"hello"}),e.jsx(Text,{typography:`header`,children:"typo"}),e.jsx(Flex,{as:"section",mt:2,children:"section"})]})}exports.Lib=t;"#, ExtractOption { package: "@devup-ui/react".to_string(), css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, import_aliases: HashMap::new() }).unwrap())); + assert_debug_snapshot!(ToBTreeSet::from(extract("test.js", r#""use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),{Box,Text,Flex}=require("@devup-ui/react");function t(){return e.jsxs("div",{children:[e.jsx(Box,{_hover:{bg:"blue"},bg:"$text",color:"red",children:"hello"}),e.jsx(Text,{typography:`header`,children:"typo"}),e.jsx(Flex,{as:"section",mt:2,children:"section"})]})}exports.Lib=t;"#, ExtractOption { package: "@devup-ui/react".to_string(), css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, import_aliases: HashMap::new(), ..Default::default() }).unwrap())); reset_class_map(); reset_file_map(); - assert_debug_snapshot!(ToBTreeSet::from(extract("test.js", r#""use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),{Box,Text,Flex}=require("@devup-ui/react");function t(){return e.jsxs("div",{children:[e.jsx(Box,{["_hover"]:{bg:"blue"},bg:"$text",color:"red",children:"hello"}),e.jsx(Text,{typography:`header`,children:"typo"}),e.jsx(Flex,{as:"section",mt:2,children:"section"})]})}exports.Lib=t;"#, ExtractOption { package: "@devup-ui/react".to_string(), css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, import_aliases: HashMap::new() }).unwrap())); + assert_debug_snapshot!(ToBTreeSet::from(extract("test.js", r#""use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),{Box,Text,Flex}=require("@devup-ui/react");function t(){return e.jsxs("div",{children:[e.jsx(Box,{["_hover"]:{bg:"blue"},bg:"$text",color:"red",children:"hello"}),e.jsx(Text,{typography:`header`,children:"typo"}),e.jsx(Flex,{as:"section",mt:2,children:"section"})]})}exports.Lib=t;"#, ExtractOption { package: "@devup-ui/react".to_string(), css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, import_aliases: HashMap::new(), ..Default::default() }).unwrap())); reset_class_map(); reset_file_map(); - assert_debug_snapshot!(extract("test.js", r#""use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),{Box,Text,Flex}=require("@devup-ui/react");function t(){return e.jsxs("div",{children:[e.jsx(Box,{["_hover"]:{bg:"blue"},bg:"$text",[variable]:"red",children:"hello"})]})}exports.Lib=t;"#, ExtractOption { package: "@devup-ui/react".to_string(), css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, import_aliases: HashMap::new() }).map(ToBTreeSet::from).map_err(|error|error.to_string())); + assert_debug_snapshot!(extract("test.js", r#""use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),{Box,Text,Flex}=require("@devup-ui/react");function t(){return e.jsxs("div",{children:[e.jsx(Box,{["_hover"]:{bg:"blue"},bg:"$text",[variable]:"red",children:"hello"})]})}exports.Lib=t;"#, ExtractOption { package: "@devup-ui/react".to_string(), css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, import_aliases: HashMap::new(), ..Default::default() }).map(ToBTreeSet::from).map_err(|error|error.to_string())); } #[test] @@ -6022,7 +6216,7 @@ e(o, { className: "a", bg: variable, style: { color: "blue" }, ...props }) r"import {Flex} from '@devup-ui/core' ", - ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, import_aliases: HashMap::new() } + ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, import_aliases: HashMap::new(), ..Default::default() } ) .unwrap() )); @@ -6044,7 +6238,8 @@ e(o, { className: "a", bg: variable, style: { color: "blue" }, ...props }) css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -6067,7 +6262,8 @@ e(o, { className: "a", bg: variable, style: { color: "blue" }, ...props }) css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -6086,7 +6282,8 @@ e(o, { className: "a", bg: variable, style: { color: "blue" }, ...props }) css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -6105,7 +6302,8 @@ e(o, { className: "a", bg: variable, style: { color: "blue" }, ...props }) css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -6128,7 +6326,8 @@ e(o, { className: "a", bg: variable, style: { color: "blue" }, ...props }) css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -6147,7 +6346,8 @@ e(o, { className: "a", bg: variable, style: { color: "blue" }, ...props }) css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -6166,7 +6366,8 @@ e(o, { className: "a", bg: variable, style: { color: "blue" }, ...props }) css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -6189,7 +6390,8 @@ e(o, { className: "a", bg: variable, style: { color: "blue" }, ...props }) css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -6227,7 +6429,8 @@ export default function Card({ css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -6251,7 +6454,8 @@ export default function Card({ css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -6270,7 +6474,8 @@ export default function Card({ css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -6289,7 +6494,8 @@ export default function Card({ css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -6308,7 +6514,8 @@ export default function Card({ css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -6327,7 +6534,8 @@ export default function Card({ css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -6347,7 +6555,8 @@ export default function Card({ css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -6367,7 +6576,8 @@ export default function Card({ css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -6387,7 +6597,8 @@ export default function Card({ css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -6409,7 +6620,8 @@ export default function Card({ css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -6428,7 +6640,8 @@ export default function Card({ css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -6447,7 +6660,8 @@ export default function Card({ css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -6466,7 +6680,8 @@ export default function Card({ css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -6485,7 +6700,8 @@ export default function Card({ css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -6504,7 +6720,8 @@ export default function Card({ css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -6523,7 +6740,8 @@ export default function Card({ css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -6546,7 +6764,8 @@ export default function Card({ css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -6565,7 +6784,8 @@ export default function Card({ css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -6584,7 +6804,8 @@ export default function Card({ css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -6603,7 +6824,8 @@ export default function Card({ css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -6623,7 +6845,8 @@ export default function Card({ css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -6650,7 +6873,8 @@ export default function Card({ css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -6669,7 +6893,8 @@ export default function Card({ css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -6692,7 +6917,8 @@ export default function Card({ css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -6711,7 +6937,8 @@ export default function Card({ css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -6730,7 +6957,8 @@ export default function Card({ css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -6749,7 +6977,8 @@ export default function Card({ css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -6771,7 +7000,8 @@ export default function Card({ css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -6790,7 +7020,8 @@ export default function Card({ css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -6809,7 +7040,8 @@ export default function Card({ css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -6852,7 +7084,8 @@ export default function Card({ css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -6875,7 +7108,8 @@ export default function Card({ css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -6894,7 +7128,8 @@ export default function Card({ css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -6913,7 +7148,8 @@ export default function Card({ css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -6932,7 +7168,8 @@ export default function Card({ css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -6955,7 +7192,8 @@ export default function Card({ css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -6973,7 +7211,8 @@ export default function Card({ css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -6996,7 +7235,8 @@ export default function Card({ css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -7015,7 +7255,8 @@ export default function Card({ css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -7037,7 +7278,8 @@ export default function Card({ css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -7060,7 +7302,8 @@ export default function Card({ css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -7079,7 +7322,8 @@ export default function Card({ css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -7101,7 +7345,8 @@ export default function Card({ css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -7120,7 +7365,8 @@ export default function Card({ css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -7143,7 +7389,8 @@ export default function Card({ css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -7166,7 +7413,8 @@ export default function Card({ css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -7193,7 +7441,8 @@ PROCESS_DATA.map(({ id, title, content }, idx) => ( css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -7216,7 +7465,8 @@ PROCESS_DATA.map(({ id, title, content }, idx) => ( css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -7235,7 +7485,8 @@ PROCESS_DATA.map(({ id, title, content }, idx) => ( css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -7258,7 +7509,8 @@ PROCESS_DATA.map(({ id, title, content }, idx) => ( css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -7281,7 +7533,8 @@ PROCESS_DATA.map(({ id, title, content }, idx) => ( css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -7306,7 +7559,8 @@ import {Button} from '@devup/ui' css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -7332,7 +7586,8 @@ import {Button} from '@devup/ui' css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -7354,7 +7609,8 @@ import {Button} from '@devup/ui' css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -7377,7 +7633,8 @@ import {Button} from '@devup/ui' css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -7412,7 +7669,8 @@ import {Button} from '@devup/ui' css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -7435,7 +7693,8 @@ import {Button} from '@devup/ui' css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -7454,7 +7713,8 @@ import {Button} from '@devup/ui' css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -7473,7 +7733,8 @@ import {Button} from '@devup/ui' css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -7492,7 +7753,8 @@ import {Button} from '@devup/ui' css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -7511,7 +7773,8 @@ import {Button} from '@devup/ui' css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -7534,7 +7797,8 @@ import {Button} from '@devup/ui' css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -7557,7 +7821,8 @@ import {Button} from '@devup/ui' css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -7575,7 +7840,8 @@ import {Button} from '@devup/ui' css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -7601,7 +7867,8 @@ import {Button} from '@devup/ui' css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -7628,7 +7895,8 @@ import {Button} from '@devup/ui' css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -7651,7 +7919,8 @@ import {Button} from '@devup/ui' css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -7674,7 +7943,8 @@ import {Button} from '@devup/ui' css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -7694,6 +7964,7 @@ import {Button} from '@devup/ui' single_css: true, import_main_css: false, import_aliases: HashMap::new(), + ..Default::default() }, ) .err() @@ -7724,7 +7995,8 @@ import {Button} from '@devup/ui' css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -7763,7 +8035,8 @@ export { css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -7782,7 +8055,8 @@ export { css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -7801,7 +8075,8 @@ export { css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -7820,7 +8095,8 @@ export { css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -7846,7 +8122,8 @@ export { css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -7873,7 +8150,8 @@ export { css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -7892,7 +8170,8 @@ export { css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap_err() @@ -7919,7 +8198,8 @@ export { css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -7940,7 +8220,8 @@ export { css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .map(ToBTreeSet::from) @@ -7961,7 +8242,8 @@ export { css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .map(ToBTreeSet::from) @@ -7983,7 +8265,8 @@ export { css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -8003,7 +8286,8 @@ export { css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -8028,7 +8312,8 @@ export { css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -8048,7 +8333,8 @@ export { css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -8071,7 +8357,8 @@ export { c as Lib };"#, css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -8095,7 +8382,8 @@ export { c as Lib };"#, css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -8115,7 +8403,8 @@ export { c as Lib };"#, css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -8136,7 +8425,8 @@ export { c as Lib };"#, css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -8156,7 +8446,8 @@ export { c as Lib };"#, css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -8179,7 +8470,8 @@ export { c as Lib };"#, css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -8203,7 +8495,8 @@ export { c as Lib };"#, css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .map(ToBTreeSet::from) @@ -8227,7 +8520,8 @@ export { c as Lib };"#, css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -8254,7 +8548,8 @@ export { c as Lib };"#, css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -8277,7 +8572,8 @@ export { c as Lib };"#, css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -8300,7 +8596,8 @@ export { c as Lib };"#, css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -8330,7 +8627,8 @@ export { c as Lib };"#, css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -8356,7 +8654,8 @@ export { c as Lib };"#, css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -8382,7 +8681,8 @@ export { c as Lib };"#, css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -8407,7 +8707,8 @@ export { c as Lib };"#, css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -8428,7 +8729,8 @@ export { c as Lib };"#, css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -8450,7 +8752,8 @@ export { c as Lib };"#, css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -8471,7 +8774,8 @@ export { c as Lib };"#, css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -8492,7 +8796,8 @@ export { c as Lib };"#, css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -8513,7 +8818,8 @@ export { c as Lib };"#, css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -8534,7 +8840,8 @@ export { c as Lib };"#, css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -8555,7 +8862,8 @@ export { c as Lib };"#, css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -8579,7 +8887,8 @@ export { c as Lib };"#, css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -8598,7 +8907,8 @@ export { c as Lib };"#, css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -8617,7 +8927,8 @@ export { c as Lib };"#, css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -8640,7 +8951,8 @@ export { c as Lib };"#, css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -8664,7 +8976,8 @@ e(o, { styleVars: { c: "yellow" } }) css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -8691,7 +9004,8 @@ globalCss({ css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -8714,7 +9028,8 @@ globalCss({ css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -8737,7 +9052,8 @@ globalCss({ css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -8760,7 +9076,8 @@ globalCss({ css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -8783,7 +9100,8 @@ globalCss({ css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -8806,7 +9124,8 @@ globalCss({ css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -8829,7 +9148,8 @@ globalCss({ css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -8848,7 +9168,8 @@ globalCss(...{}) css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -8867,7 +9188,8 @@ globalCss(...{div: {bg: "red"}}) css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -8887,7 +9209,8 @@ globalCss(...{div: {bg: "red"}, ...{span: {bg: "blue"}}}) css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -8914,7 +9237,8 @@ globalCss({ css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -8933,7 +9257,8 @@ globalCss() css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -8950,7 +9275,8 @@ globalCss() css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap_err() @@ -8984,7 +9310,8 @@ globalCss({ css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -9020,7 +9347,8 @@ globalCss({ css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -9056,7 +9384,8 @@ globalCss({ css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -9100,7 +9429,8 @@ globalCss({ css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -9127,7 +9457,8 @@ globalCss({ css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -9148,7 +9479,8 @@ globalCss({ css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -9169,7 +9501,8 @@ globalCss({ css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -9191,7 +9524,8 @@ globalCss({ css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -9215,7 +9549,8 @@ globalCss({ css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -9234,7 +9569,8 @@ globalCss({ css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -9253,7 +9589,8 @@ globalCss({ css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -9273,7 +9610,8 @@ globalCss({ css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -9292,7 +9630,8 @@ globalCss({ css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -9317,7 +9656,8 @@ globalCss({ css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -9338,7 +9678,8 @@ globalCss({ css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -9359,7 +9700,8 @@ globalCss({ css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -9395,7 +9737,8 @@ globalCss({ css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -9422,7 +9765,8 @@ globalCss({ css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -9448,7 +9792,8 @@ globalCss({ css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -9473,7 +9818,8 @@ globalCss({ css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -9500,7 +9846,8 @@ globalCss({ css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -9527,7 +9874,8 @@ globalCss({ css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -9569,7 +9917,8 @@ globalCss({ css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -9590,7 +9939,8 @@ globalCss({ css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -9611,7 +9961,8 @@ globalCss({ css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -9632,7 +9983,8 @@ globalCss({ css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -9657,7 +10009,8 @@ globalCss({ css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -9678,7 +10031,8 @@ globalCss({ css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -9703,7 +10057,8 @@ globalCss({ css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -9725,7 +10080,8 @@ globalCss({ css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -9746,7 +10102,8 @@ globalCss({ css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -9768,7 +10125,8 @@ globalCss({ css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -9787,7 +10145,8 @@ globalCss({}) css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -9806,7 +10165,8 @@ globalCss() css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -9832,7 +10192,8 @@ keyframes({ css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -9855,7 +10216,8 @@ keyframes({ css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -9878,7 +10240,8 @@ keyframes({ css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -9901,7 +10264,8 @@ keyframes({ css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -9924,7 +10288,8 @@ keyframes({ css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -9947,7 +10312,8 @@ keyframes({ css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -9970,7 +10336,8 @@ keyframes({ css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -9993,7 +10360,8 @@ keyframes({ css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -10032,7 +10400,8 @@ keyframes({ css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -10055,7 +10424,8 @@ keyframes(...{ css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -10081,7 +10451,8 @@ keyframes({ css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -10326,7 +10697,8 @@ keyframes({ css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -10375,7 +10747,8 @@ keyframes({ css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -10398,7 +10771,8 @@ keyframes({ css_dir: "@devup-ui/core".to_string(), single_css: false, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -10414,7 +10788,8 @@ keyframes({ css_dir: "@devup-ui/core".to_string(), single_css: false, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -10431,7 +10806,8 @@ keyframes({ css_dir: "@devup-ui/core".to_string(), single_css: false, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -10447,7 +10823,8 @@ keyframes({ css_dir: "@devup-ui/core".to_string(), single_css: false, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -10470,7 +10847,8 @@ keyframes({ css_dir: "@devup-ui/core".to_string(), single_css: false, import_main_css: true, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -10493,7 +10871,8 @@ keyframes({ css_dir: "@devup-ui/core".to_string(), single_css: false, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -10516,7 +10895,8 @@ keyframes({ css_dir: "@devup-ui/core".to_string(), single_css: false, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -10536,7 +10916,8 @@ keyframes({ css_dir: "@devup-ui/core".to_string(), single_css: false, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -10555,7 +10936,8 @@ keyframes({ css_dir: "@devup-ui/core".to_string(), single_css: false, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -10574,7 +10956,8 @@ keyframes({ css_dir: "@devup-ui/core".to_string(), single_css: false, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -10593,7 +10976,8 @@ keyframes({ css_dir: "@devup-ui/core".to_string(), single_css: false, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -10612,7 +10996,8 @@ keyframes({ css_dir: "@devup-ui/core".to_string(), single_css: false, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -10638,7 +11023,8 @@ keyframes({ css_dir: "@devup-ui/core".to_string(), single_css: false, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -10660,7 +11046,8 @@ keyframes({ css_dir: "@devup-ui/core".to_string(), single_css: false, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -10744,7 +11131,8 @@ keyframes({ css_dir: "@devup-ui/core".to_string(), single_css: false, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -10773,7 +11161,8 @@ keyframes({ css_dir: "@devup-ui/core".to_string(), single_css: false, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -10797,7 +11186,8 @@ keyframes({ css_dir: "@devup-ui/core".to_string(), single_css: false, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -10818,7 +11208,8 @@ keyframes({ css_dir: "@devup-ui/core".to_string(), single_css: false, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -10839,7 +11230,8 @@ keyframes({ css_dir: "@devup-ui/core".to_string(), single_css: false, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -10860,7 +11252,8 @@ keyframes({ css_dir: "@devup-ui/core".to_string(), single_css: false, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -10883,7 +11276,8 @@ keyframes({ css_dir: "@devup-ui/core".to_string(), single_css: false, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -10903,7 +11297,8 @@ keyframes({ css_dir: "@devup-ui/core".to_string(), single_css: false, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -10926,7 +11321,8 @@ keyframes({ css_dir: "@devup-ui/core".to_string(), single_css: false, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -10946,7 +11342,8 @@ keyframes({ css_dir: "@devup-ui/core".to_string(), single_css: false, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -10969,7 +11366,8 @@ keyframes({ css_dir: "@devup-ui/core".to_string(), single_css: false, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -10989,7 +11387,8 @@ keyframes({ css_dir: "@devup-ui/core".to_string(), single_css: false, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -11014,7 +11413,8 @@ keyframes({ css_dir: "@devup-ui/core".to_string(), single_css: false, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -11035,7 +11435,8 @@ keyframes({ css_dir: "@devup-ui/core".to_string(), single_css: false, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -11059,7 +11460,8 @@ keyframes({ css_dir: "@devup-ui/core".to_string(), single_css: false, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -11080,7 +11482,8 @@ keyframes({ css_dir: "@devup-ui/core".to_string(), single_css: false, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -11104,7 +11507,8 @@ keyframes({ css_dir: "@devup-ui/core".to_string(), single_css: false, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -11133,7 +11537,8 @@ keyframes({ css_dir: "@devup-ui/core".to_string(), single_css: false, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -11159,7 +11564,8 @@ keyframes({ css_dir: "@devup-ui/core".to_string(), single_css: false, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -11181,7 +11587,8 @@ keyframes({ css_dir: "@devup-ui/core".to_string(), single_css: false, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -11203,7 +11610,8 @@ keyframes({ css_dir: "@devup-ui/core".to_string(), single_css: false, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -11227,7 +11635,8 @@ keyframes({ css_dir: "@devup-ui/core".to_string(), single_css: false, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -11247,7 +11656,8 @@ keyframes({ css_dir: "@devup-ui/core".to_string(), single_css: false, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -11267,7 +11677,8 @@ keyframes({ css_dir: "@devup-ui/core".to_string(), single_css: false, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -11295,7 +11706,8 @@ keyframes({ css_dir: "@devup-ui/core".to_string(), single_css: false, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -11320,7 +11732,8 @@ keyframes({ css_dir: "@devup-ui/core".to_string(), single_css: false, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -11347,7 +11760,8 @@ keyframes({ css_dir: "@devup-ui/core".to_string(), single_css: false, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -11372,7 +11786,8 @@ keyframes({ css_dir: "@devup-ui/core".to_string(), single_css: false, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -11409,6 +11824,7 @@ keyframes({ single_css: false, import_main_css: false, import_aliases: HashMap::new(), + ..Default::default() }, ) .err() @@ -11430,7 +11846,8 @@ keyframes({ css_dir: "@devup-ui/core".to_string(), single_css: false, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -11450,7 +11867,8 @@ keyframes({ css_dir: "@devup-ui/core".to_string(), single_css: false, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -11481,7 +11899,8 @@ keyframes({ css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -11505,7 +11924,8 @@ keyframes({ css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -11525,7 +11945,8 @@ keyframes({ css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -11545,7 +11966,8 @@ keyframes({ css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -11565,7 +11987,8 @@ keyframes({ css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -11590,7 +12013,8 @@ const StyledDiv = styled.div({ ...baseStyles }) css_dir: "@devup-ui/core".to_string(), single_css: false, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -11614,7 +12038,8 @@ const className = css() css_dir: "@devup-ui/core".to_string(), single_css: false, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -11638,7 +12063,8 @@ const className = css({}) css_dir: "@devup-ui/core".to_string(), single_css: false, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -11665,7 +12091,8 @@ const spin = keyframes({ css_dir: "@devup-ui/core".to_string(), single_css: false, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -11691,7 +12118,8 @@ globalCss({ css_dir: "@devup-ui/core".to_string(), single_css: false, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -11718,7 +12146,8 @@ const Component = () => { css_dir: "@devup-ui/core".to_string(), single_css: false, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -11743,7 +12172,8 @@ const className = myCss({ bg: "red" }) css_dir: "@devup-ui/core".to_string(), single_css: false, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -11804,7 +12234,8 @@ globalCss({ css_dir: "@devup-ui/core".to_string(), single_css: false, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -11836,7 +12267,8 @@ globalCss({ css_dir: "@devup-ui/core".to_string(), single_css: false, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -11862,7 +12294,8 @@ globalCss({ css_dir: "@devup-ui/core".to_string(), single_css: false, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -11886,7 +12319,8 @@ globalCss({ css_dir: "@devup-ui/core".to_string(), single_css: false, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -11912,7 +12346,8 @@ let key = "primary"; css_dir: "@devup-ui/core".to_string(), single_css: false, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -11938,7 +12373,8 @@ const Component = ({ className }) => { css_dir: "@devup-ui/core".to_string(), single_css: false, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -11962,7 +12398,8 @@ const Component = ({ className }) => { css_dir: "@devup-ui/core".to_string(), single_css: false, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -11987,7 +12424,8 @@ const className = css({ fontSize: `${size}px` }) css_dir: "@devup-ui/core".to_string(), single_css: false, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -12012,7 +12450,8 @@ const isActive = true; css_dir: "@devup-ui/core".to_string(), single_css: false, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -12038,7 +12477,8 @@ const Component = (props) => { css_dir: "@devup-ui/core".to_string(), single_css: false, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -12064,7 +12504,8 @@ const b = false; css_dir: "@devup-ui/core".to_string(), single_css: false, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -12089,7 +12530,8 @@ let color = "red"; css_dir: "@devup-ui/core".to_string(), single_css: false, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -12118,6 +12560,7 @@ export const e = spin.toString()", single_css: true, import_main_css: false, import_aliases: HashMap::new(), + ..Default::default() }, ) .unwrap() @@ -12149,6 +12592,7 @@ export const e = spin.toString()", } else { HashMap::new() }, + ..Default::default() }; let code = "import { recipe } from '@vanilla-extract/recipes'\nexport const b = recipe({})"; let error = extract("a.css.ts", code, option(true)) @@ -12243,7 +12687,7 @@ export const e = spin.toString()", css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new(), + import_aliases: HashMap::new(), ..Default::default() }, ) .unwrap_err() @@ -12412,7 +12856,8 @@ const spin = keyframes() css_dir: "@devup-ui/core".to_string(), single_css: false, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -12436,7 +12881,8 @@ globalCss() css_dir: "@devup-ui/core".to_string(), single_css: false, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -12460,7 +12906,8 @@ globalCss() css_dir: "@devup-ui/core".to_string(), single_css: false, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -12484,7 +12931,8 @@ globalCss() css_dir: "@devup-ui/core".to_string(), single_css: false, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -12508,7 +12956,8 @@ const className = DevUI.css({ bg: "red" }) css_dir: "@devup-ui/core".to_string(), single_css: false, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -12534,7 +12983,8 @@ let colors = { primary: "blue", secondary: "red" }; css_dir: "@devup-ui/core".to_string(), single_css: false, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -12559,7 +13009,8 @@ let dynamicColor = "blue"; css_dir: "@devup-ui/core".to_string(), single_css: false, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -12584,7 +13035,8 @@ const extraProps = { onClick: () => {} }; css_dir: "@devup-ui/core".to_string(), single_css: false, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -12608,7 +13060,8 @@ const extraProps = { onClick: () => {} }; css_dir: "@devup-ui/core".to_string(), single_css: false, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -12635,7 +13088,8 @@ let margin = 5; css_dir: "@devup-ui/core".to_string(), single_css: false, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -12661,7 +13115,8 @@ let color = "red"; css_dir: "@devup-ui/core".to_string(), single_css: false, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -12685,7 +13140,8 @@ let color = "red"; css_dir: "@devup-ui/core".to_string(), single_css: false, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -12705,7 +13161,8 @@ let color = "red"; css_dir: "@devup-ui/core".to_string(), single_css: false, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -12725,7 +13182,8 @@ let color = "red"; css_dir: "@devup-ui/core".to_string(), single_css: false, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -12745,7 +13203,8 @@ let color = "red"; css_dir: "@devup-ui/core".to_string(), single_css: false, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -12769,7 +13228,8 @@ let color = "red"; css_dir: "@devup-ui/core".to_string(), single_css: false, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -12793,7 +13253,8 @@ let color = "red"; css_dir: "@devup-ui/core".to_string(), single_css: false, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -12813,7 +13274,8 @@ let color = "red"; css_dir: "@devup-ui/core".to_string(), single_css: false, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -12833,7 +13295,8 @@ let color = "red"; css_dir: "@devup-ui/core".to_string(), single_css: false, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -12853,7 +13316,8 @@ let color = "red"; css_dir: "@devup-ui/core".to_string(), single_css: false, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -12877,7 +13341,8 @@ let color = "red"; css_dir: "@devup-ui/core".to_string(), single_css: false, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -12897,7 +13362,8 @@ let color = "red"; css_dir: "@devup-ui/core".to_string(), single_css: false, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -12917,7 +13383,8 @@ let color = "red"; css_dir: "@devup-ui/core".to_string(), single_css: false, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -12947,7 +13414,8 @@ globalCss({ css_dir: "@devup-ui/core".to_string(), single_css: false, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -12973,7 +13441,8 @@ globalCss({ css_dir: "@devup-ui/core".to_string(), single_css: false, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -12999,7 +13468,8 @@ globalCss({ css_dir: "@devup-ui/core".to_string(), single_css: false, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -13032,7 +13502,8 @@ globalCss({ css_dir: "@devup-ui/core".to_string(), single_css: false, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -13062,7 +13533,8 @@ globalCss({ css_dir: "@devup-ui/core".to_string(), single_css: false, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -13091,7 +13563,8 @@ globalCss({ css_dir: "@devup-ui/core".to_string(), single_css: false, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -13122,7 +13595,8 @@ export const container: string = style({ background: "red", padding: 16 }) css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -13147,7 +13621,8 @@ export const wrapper = style({ backgroundColor: "white", margin: 8 }) css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -13167,7 +13642,8 @@ export const link = style({ color: "blue", textDecoration: "underline" }) css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -13207,7 +13683,8 @@ export const text = style({ css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, - import_aliases + import_aliases, + ..Default::default() } ) .unwrap() @@ -13234,7 +13711,8 @@ export const button = style({ background: primaryColor, padding: spacing }) css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -13260,7 +13738,8 @@ export const box = style({ padding: base * 2, margin: base / 2 }) css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -13286,7 +13765,8 @@ export const extended = style({ ...baseStyle, background: "red" }) css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -13311,7 +13791,8 @@ export const hoverButton = style({ background: "gray", _hover: { background: "bl css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -13336,7 +13817,8 @@ export const responsiveBox = style({ padding: [8, 16, 32] }) css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -13362,7 +13844,8 @@ export const animated = style({ animation: "fadeIn 1s ease-in" }) css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -13382,7 +13865,8 @@ globalStyle("body", { margin: 0, padding: 0 }) css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -13413,7 +13897,8 @@ export const box = style({ css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -13436,7 +13921,8 @@ export const box = style({ css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -13465,7 +13951,8 @@ export const background = styleVariants({ css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -13489,7 +13976,8 @@ export const button = styleVariants({ css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -13520,7 +14008,8 @@ export const text = style({ css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -13547,7 +14036,8 @@ export const body = style({ css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -13587,7 +14077,8 @@ export const box = style({ css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -13625,7 +14116,8 @@ export const darkTheme = createTheme(vars, { css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -13657,7 +14149,8 @@ const A = styled.div({ '@layer': { base: { css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -13687,7 +14180,7 @@ export const button = style({ color: 'red', '@layer': { [components]: { color: ' import_aliases: HashMap::from([( "@vanilla-extract/css".to_string(), ImportAlias::NamedToNamed - )]) + )]), ..Default::default() } ) .unwrap() @@ -13720,7 +14213,8 @@ globalStyle('*', { css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -13756,7 +14250,8 @@ export const responsive = style({ css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -13790,7 +14285,8 @@ export const vars = createGlobalTheme(':root', { css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -13826,7 +14322,8 @@ export const button = style([base, interactive, { css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -13868,7 +14365,8 @@ export const button = style({ css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -13900,7 +14398,8 @@ export const child = style({ css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -13939,7 +14438,8 @@ export const responsive = style({ css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -13971,7 +14471,8 @@ export const grid = style({ css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -14108,7 +14609,8 @@ export const grid = style({ css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -14134,7 +14636,8 @@ export const grid = style({ css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -14162,6 +14665,7 @@ export const broken = style((() => { throw new Error("fail"); })()) single_css: true, import_main_css: false, import_aliases: HashMap::new(), + ..Default::default() }, ); // Should not panic, may return error or empty styles @@ -14189,6 +14693,7 @@ const unused = 1; single_css: true, import_main_css: false, import_aliases: HashMap::new(), + ..Default::default() }, ); assert!(result.is_ok()); @@ -14215,7 +14720,8 @@ export const box = style({ padding: SPACING }) css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -14250,7 +14756,8 @@ export const [lightTheme, vars] = createTheme({ css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -14284,7 +14791,8 @@ export const themed = style({ css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -14311,7 +14819,8 @@ export const withEmpty = style([{}]) css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -14345,7 +14854,8 @@ export const sizes = styleVariants({ css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -14377,7 +14887,8 @@ export const containerStyle = style({ css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -14415,7 +14926,8 @@ export const box = style({ css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -14452,7 +14964,8 @@ export const darkTheme = createTheme(contract, { css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -14484,7 +14997,8 @@ export const text = style({ css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -14515,7 +15029,8 @@ export const box = style({ css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -14542,7 +15057,8 @@ export const box = style({ padding: 8 }) css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -14568,7 +15084,7 @@ const internalContainer = createContainer() const internalLayer = layer('internal') export const publicStyle = style({ margin: 8 }) ", - ExtractOption { package: "@devup-ui/react".to_string(), css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, import_aliases: HashMap::new() } + ExtractOption { package: "@devup-ui/react".to_string(), css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, import_aliases: HashMap::new(), ..Default::default() } ) .unwrap() )); @@ -14607,7 +15123,8 @@ export const sibling = style({ css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -14654,7 +15171,8 @@ globalCss({ css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -14688,7 +15206,8 @@ globalCss({ css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -14721,7 +15240,8 @@ globalCss({ css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -14748,7 +15268,8 @@ globalCss({ css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -14775,7 +15296,8 @@ globalCss({ css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -14800,7 +15322,8 @@ globalCss({ css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -14825,6 +15348,7 @@ globalCss({ single_css: true, import_main_css: false, import_aliases: HashMap::new(), + ..Default::default() }, ); assert!(result.is_ok()); @@ -14907,6 +15431,7 @@ const x = style({ padding: [[[}}} // invalid syntax single_css: true, import_main_css: false, import_aliases: HashMap::new(), + ..Default::default() }, ); // Should not panic - falls back to regular processing @@ -14939,7 +15464,8 @@ const buttonStyle = css({ bg: 'red', p: 4 }) css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, - import_aliases: aliases + import_aliases: aliases, + ..Default::default() }, ) .unwrap() @@ -14973,7 +15499,8 @@ export const spinner = style({ animation: spin }) css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -15001,7 +15528,8 @@ export const myTheme = createTheme({ css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -15032,7 +15560,8 @@ export const buttons = styleVariants({ css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -15068,7 +15597,8 @@ export const box = style({ padding: 8 }) css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -15095,7 +15625,8 @@ export const text = style({ fontFamily: minimalFont }) css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -15124,7 +15655,8 @@ export const animated = style({ animation: fadeIn }) css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -15159,7 +15691,8 @@ export const box = style({ padding: 8 }) css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -15186,7 +15719,8 @@ export const complex = style([base, { margin: 4 }, { color: 'blue' }]) css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -15217,7 +15751,8 @@ export const child = style({ css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -15251,7 +15786,7 @@ export const buttons = styleVariants({ }) export const box = style({ fontFamily: myFont }) ", - ExtractOption { package: "@devup-ui/react".to_string(), css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, import_aliases: HashMap::new() } + ExtractOption { package: "@devup-ui/react".to_string(), css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, import_aliases: HashMap::new(), ..Default::default() } ) .unwrap() )); @@ -15280,7 +15815,8 @@ export const themed = style({ color: themeVars.colors.primary }) css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -15315,7 +15851,8 @@ export const heading = style({ fontFamily: secondFont }) css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -15347,7 +15884,8 @@ export const box = style({ padding: 8 }) css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -15378,7 +15916,8 @@ globalCss({ css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -15408,7 +15947,8 @@ globalCss({ css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -15440,7 +15980,8 @@ globalCss({ css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -15472,7 +16013,7 @@ export const child = style({ }) globalStyle('body', { margin: 0 }) ", - ExtractOption { package: "@devup-ui/react".to_string(), css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, import_aliases: HashMap::new() } + ExtractOption { package: "@devup-ui/react".to_string(), css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, import_aliases: HashMap::new(), ..Default::default() } ) .unwrap() )); @@ -15503,7 +16044,8 @@ export const box = style({ padding: 8 }) css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -15536,7 +16078,8 @@ globalCss({ css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -15571,7 +16114,8 @@ export const child = style({ css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -15605,7 +16149,8 @@ export const card = style({ css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -15628,6 +16173,7 @@ export const card = style({ single_css: true, import_main_css: false, import_aliases: HashMap::new(), + ..Default::default() }, &style_names, ) @@ -15688,7 +16234,8 @@ const Button = styled.button({ bg: 'red', p: 4 }) css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, - import_aliases: aliases + import_aliases: aliases, + ..Default::default() }, ) .unwrap() @@ -15718,7 +16265,8 @@ const Card = styled("div")({ bg: 'blue', m: 2 }) css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, - import_aliases: aliases + import_aliases: aliases, + ..Default::default() }, ) .unwrap() @@ -15747,7 +16295,8 @@ const element =
Hello
", css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, - import_aliases: aliases + import_aliases: aliases, + ..Default::default() }, ) .unwrap() @@ -15777,7 +16326,8 @@ const Button = myStyled.button({ bg: 'green', p: 2 }) css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, - import_aliases: aliases + import_aliases: aliases, + ..Default::default() }, ) .unwrap() @@ -15808,7 +16358,8 @@ const Button = emotionStyled.button({ bg: 'purple', p: 3 }) css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, - import_aliases: aliases + import_aliases: aliases, + ..Default::default() }, ) .unwrap() @@ -15847,7 +16398,8 @@ const Button = styled.button({ bg: 'red' }) css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, - import_aliases: aliases + import_aliases: aliases, + ..Default::default() }, ) .unwrap() @@ -15869,6 +16421,7 @@ const Button = styled.button({ bg: 'red' }) single_css: true, import_main_css: false, import_aliases: HashMap::new(), + ..Default::default() }, ); match output { @@ -17205,6 +17758,7 @@ export const base = css(local, { bg: 'white' });", single_css: true, import_main_css: false, import_aliases: HashMap::new(), + ..Default::default() }, ) .unwrap(); @@ -17250,6 +17804,7 @@ export const base = css(local, { bg: 'white' });", single_css: true, import_main_css: false, import_aliases: HashMap::new(), + ..Default::default() }, ) .unwrap(); @@ -17373,6 +17928,7 @@ const on = false; single_css: true, import_main_css: false, import_aliases: HashMap::new(), + ..Default::default() }, ) .unwrap(); @@ -17399,7 +17955,8 @@ const on = false; css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -17423,7 +17980,8 @@ const on = false; css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -17447,7 +18005,8 @@ const on = false; css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -17471,7 +18030,8 @@ const on = false; css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -17495,7 +18055,8 @@ const on = false; css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -17534,7 +18095,7 @@ export const Card = () => (
) "#, - ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, import_aliases: HashMap::new() } + ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, import_aliases: HashMap::new(), ..Default::default() } ) .unwrap() )); @@ -17552,7 +18113,7 @@ export const Card = () => ( r#"import {Box} from '@devup-ui/core' "#, - ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, import_aliases: HashMap::new() } + ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, import_aliases: HashMap::new(), ..Default::default() } ) .unwrap() )); @@ -17580,7 +18141,8 @@ export const Card = () => ( css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -17604,7 +18166,8 @@ export const Card = () => ( css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -17630,7 +18193,8 @@ export const Card = () => ( css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -17656,7 +18220,8 @@ export const Card = () => ( css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -17682,7 +18247,8 @@ export const Card = () => ( css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -17708,7 +18274,8 @@ export const Card = () => ( css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -17734,7 +18301,8 @@ export const Card = () => ( css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -17760,7 +18328,8 @@ export const Card = () => ( css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -17787,7 +18356,8 @@ export const Card = () => ( css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -17815,7 +18385,8 @@ export { c as Lib };"#, css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -17837,7 +18408,8 @@ export { c as Lib };"#, css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -17863,7 +18435,8 @@ export { c as Lib };"#, css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -17885,7 +18458,8 @@ export { c as Lib };"#, css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -17912,7 +18486,8 @@ export { c as Lib };"#, css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -17935,7 +18510,8 @@ export { c as Lib };"#, css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -18005,7 +18581,8 @@ const styles = stylex.create({ base: { color: 'red' } });", css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() }, ) .unwrap() @@ -18027,7 +18604,8 @@ const styles = stylex.create({ base: { color: 'blue' } });", css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() }, ) .unwrap() @@ -18049,7 +18627,8 @@ const styles = create({ base: { color: 'green' } });", css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() }, ) .unwrap() @@ -18101,7 +18680,8 @@ const styles = stylex.create({ css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() }, ) .unwrap() @@ -18131,7 +18711,8 @@ const styles = stylex.create({ css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() }, ) .unwrap() @@ -18289,7 +18870,8 @@ const styles = stylex.create({ css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() }, ) .unwrap() @@ -18311,7 +18893,8 @@ const styles = stylex.create({});", css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() }, ) .unwrap() @@ -18333,7 +18916,8 @@ const styles = stylex.create({ base: {} });", css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() }, ) .unwrap() @@ -18359,7 +18943,8 @@ const styles = stylex.create({ css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() }, ) .unwrap() @@ -18385,7 +18970,8 @@ const styles = stylex.create({ css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() }, ) .unwrap() @@ -18411,7 +18997,8 @@ const styles = stylex.create({ css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() }, ) .unwrap() @@ -18437,7 +19024,8 @@ const styles = stylex.create({ css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() }, ) .unwrap() @@ -18463,7 +19051,8 @@ const styles = stylex.create({ css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() }, ) .unwrap() @@ -18489,7 +19078,8 @@ const styles = stylex.create({ css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() }, ) .unwrap() @@ -18515,7 +19105,8 @@ const styles = stylex.create({ css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() }, ) .unwrap() @@ -18541,7 +19132,8 @@ const styles = stylex.create({ css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() }, ) .unwrap() @@ -18567,7 +19159,8 @@ const styles = stylex.create({ css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() }, ) .unwrap() @@ -18594,7 +19187,8 @@ const styles = stylex.create({ css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() }, ) .unwrap() @@ -18621,7 +19215,8 @@ const el =
;", css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() }, ) .unwrap() @@ -18647,7 +19242,8 @@ const el =
;", css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() }, ) .unwrap() @@ -18673,7 +19269,8 @@ const el =
;", css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() }, ) .unwrap() @@ -18698,7 +19295,8 @@ const el =
;", css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() }, ) .unwrap() @@ -18744,7 +19343,8 @@ const el =
;", css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() }, ) .unwrap() @@ -18790,7 +19391,8 @@ const el =
;", css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() }, ) .unwrap() @@ -18813,7 +19415,8 @@ const el =
;", css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() }, ) .unwrap() @@ -18839,7 +19442,8 @@ const el =
;", css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() }, ) .unwrap() @@ -18865,7 +19469,8 @@ const el =
;", css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() }, ) .unwrap() @@ -18912,7 +19518,8 @@ const el =
;", css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() }, ) .unwrap() @@ -18937,7 +19544,8 @@ const el =
;", css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() }, ) .unwrap() @@ -18962,7 +19570,8 @@ const el =
;", css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() }, ) .unwrap() @@ -18991,7 +19600,8 @@ const fadeIn = stylex.keyframes({ css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() }, ) .unwrap() @@ -19019,7 +19629,8 @@ const styles = stylex.create({ css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() }, ) .unwrap() @@ -19043,7 +19654,8 @@ const styles = stylex.create({ css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() }, ) .unwrap() @@ -19067,7 +19679,8 @@ const styles = stylex.create({ css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() }, ) .unwrap() @@ -19091,7 +19704,8 @@ const styles = stylex.create({ css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() }, ) .unwrap() @@ -19115,7 +19729,8 @@ const styles = stylex.create({ css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() }, ) .unwrap() @@ -19143,7 +19758,8 @@ const styles = create({ css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() }, ) .unwrap() @@ -19170,7 +19786,8 @@ const result = stylex.props(styles.bar(h));", css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() }, ) .unwrap() @@ -19198,7 +19815,8 @@ const result = stylex.props(styles.bar(h));", css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() }, ) .unwrap() @@ -19226,7 +19844,8 @@ const result = stylex.props(styles.bar(myH, myW));", css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() }, ) .unwrap() @@ -19285,7 +19904,8 @@ const styles = stylex.create({ css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() }, ) .unwrap() @@ -19314,7 +19934,8 @@ const el =
css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() }, ) .unwrap() @@ -19344,7 +19965,8 @@ const el =
css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() }, ) .unwrap() @@ -19373,7 +19995,8 @@ const styles = stylex.create({ css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() }, ) .unwrap() @@ -19402,7 +20025,8 @@ const styles = stylex.create({ css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() }, ) .unwrap() @@ -19429,7 +20053,8 @@ const composed = stylex.create({ css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() }, ) .unwrap() @@ -19456,7 +20081,8 @@ const composed = create({ css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() }, ) .unwrap() @@ -19484,7 +20110,8 @@ const el =
;", css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() }, ) .unwrap() @@ -19510,7 +20137,8 @@ const styles = create({ base: { color: firstThatWorks('red', 'blue') } });", css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() }, ) .unwrap() @@ -19532,7 +20160,8 @@ const styles = stylex.create({ base: { fontSize: 16, lineHeight: 1.5 } });", css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() }, ) .unwrap() @@ -19554,7 +20183,8 @@ const styles = stylex.create({ base: { zIndex: stylex.firstThatWorks(10, 20) } } css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() }, ) .unwrap() @@ -19576,7 +20206,8 @@ const styles = stylex.create({ base: { fontSize: stylex.types.length(16) } });", css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() }, ) .unwrap() @@ -19598,7 +20229,8 @@ const styles = stylex.create({ base: () => ({ color: 'red' }) });", css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() }, ) .unwrap() @@ -19620,7 +20252,8 @@ const styles = stylex.create({ base: (x) => ({ fontSize: 16, height: x }) });", css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() }, ) .unwrap() @@ -19638,7 +20271,7 @@ const styles = stylex.create({ base: (x) => ({ fontSize: 16, height: x }) });", r"import stylex from '@stylexjs/stylex'; const fadeIn = stylex.keyframes({ from: { opacity: '0' }, to: { opacity: '1' } }); const styles = stylex.create({ base: (dur) => ({ animationName: fadeIn, animationDuration: dur }) });", - ExtractOption { package: "@devup-ui/react".to_string(), css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, import_aliases: HashMap::new() }, + ExtractOption { package: "@devup-ui/react".to_string(), css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, import_aliases: HashMap::new(), ..Default::default() }, ) .unwrap() )); @@ -19660,7 +20293,8 @@ const el =
;", css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() }, ) .unwrap() @@ -19683,7 +20317,8 @@ const el =
;", css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() }, ) .unwrap() @@ -19706,7 +20341,8 @@ const el =
;", css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() }, ) .unwrap() @@ -19729,7 +20365,8 @@ const el =
;", css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() }, ) .unwrap() @@ -19752,7 +20389,8 @@ const el =
;", css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() }, ) .unwrap() @@ -19775,7 +20413,8 @@ const el =
;", css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() }, ) .unwrap() @@ -19793,7 +20432,7 @@ const el =
;", r"import stylex from '@stylexjs/stylex'; const base = stylex.create({ dynamic: (x) => ({ color: x, fontSize: '14px' }) }); const composed = stylex.create({ fancy: { ...stylex.include(base.dynamic), backgroundColor: 'blue' } });", - ExtractOption { package: "@devup-ui/react".to_string(), css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, import_aliases: HashMap::new() }, + ExtractOption { package: "@devup-ui/react".to_string(), css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, import_aliases: HashMap::new(), ..Default::default() }, ) .unwrap() )); @@ -19844,7 +20483,8 @@ const styles = create({ base: { width: types.length('100px') } });", css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() }, ) .unwrap() @@ -19872,7 +20512,8 @@ const el =
;", css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() }, ) .unwrap() @@ -19896,7 +20537,8 @@ const el =
;", css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() }, ) .unwrap() @@ -19920,7 +20562,8 @@ const el =
;", css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() }, ) .unwrap() @@ -19944,7 +20587,8 @@ const composed = stylex.create({ test: { ...stylex.include(base.empty), color: ' css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() }, ) .unwrap() @@ -19969,7 +20613,8 @@ const composed = stylex.create({ combined: { ...stylex.include(base.root) } });" css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() }, ) .unwrap() @@ -19994,7 +20639,8 @@ const composed = stylex.create({ combined: { ...stylex.include(base.root) } });" css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -20014,7 +20660,8 @@ const composed = stylex.create({ combined: { ...stylex.include(base.root) } });" css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -20034,7 +20681,8 @@ const composed = stylex.create({ combined: { ...stylex.include(base.root) } });" css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -20059,7 +20707,8 @@ const composed = stylex.create({ combined: { ...stylex.include(base.root) } });" css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -20079,7 +20728,8 @@ const composed = stylex.create({ combined: { ...stylex.include(base.root) } });" css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -20110,7 +20760,8 @@ const composed = stylex.create({ combined: { ...stylex.include(base.root) } });" css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -20130,7 +20781,8 @@ const composed = stylex.create({ combined: { ...stylex.include(base.root) } });" css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -20150,7 +20802,8 @@ const composed = stylex.create({ combined: { ...stylex.include(base.root) } });" css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -20170,7 +20823,8 @@ const composed = stylex.create({ combined: { ...stylex.include(base.root) } });" css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -20201,7 +20855,8 @@ const composed = stylex.create({ combined: { ...stylex.include(base.root) } });" css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -20221,7 +20876,8 @@ const composed = stylex.create({ combined: { ...stylex.include(base.root) } });" css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -20241,7 +20897,8 @@ const composed = stylex.create({ combined: { ...stylex.include(base.root) } });" css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -20261,7 +20918,8 @@ const composed = stylex.create({ combined: { ...stylex.include(base.root) } });" css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -20351,6 +21009,7 @@ export const A = () => ; single_css: true, import_main_css: false, import_aliases: HashMap::new(), + ..Default::default() }, ) }); @@ -20396,7 +21055,8 @@ export const A = () => ; css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() }, ) .unwrap() @@ -20433,7 +21093,8 @@ export const A = () => ; css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -20453,7 +21114,8 @@ export const A = () => ; css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -20473,7 +21135,8 @@ export const A = () => ; css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new() + import_aliases: HashMap::new(), + ..Default::default() } ) .unwrap() @@ -20521,6 +21184,7 @@ export const A = () => ; single_css: true, import_main_css: false, import_aliases: HashMap::new(), + ..Default::default() }, ) .expect("extract should not fail") @@ -20667,7 +21331,8 @@ export const App = () => <>< "@emotion/styled".to_string(), ImportAlias::DefaultToNamed("styled".to_string()) ) - ]) + ]), + ..Default::default() }, ) .unwrap() @@ -20718,6 +21383,7 @@ export const j = css({ height: 2 });", single_css: true, import_main_css: false, import_aliases: aliases.clone(), + ..Default::default() }, ) .unwrap() @@ -20758,7 +21424,7 @@ export const J = other(Base).attrs({ id: 'j' })({ margin: 4 });", css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, - import_aliases: aliases.clone(), + import_aliases: aliases.clone(), ..Default::default() }, ) .unwrap() @@ -20907,7 +21573,8 @@ export const d = style([cond && base]);", "@vanilla-extract/css".to_string(), ImportAlias::NamedToNamed ) - ]) + ]), + ..Default::default() }, ) .unwrap() @@ -21583,7 +22250,7 @@ export const k = styled('div')({ color: SIZE });", css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new(), + import_aliases: HashMap::new(), ..Default::default() }, false, &memory_resolver(CONSTANT_MODULES), @@ -23207,7 +23874,7 @@ export const hover = style({ selectors: { [`${base}:hover &`]: { color: 'red' } import_aliases: HashMap::from([( "@vanilla-extract/css".to_string(), ImportAlias::NamedToNamed, - )]), + )]), ..Default::default() }, false, &memory_resolver(STYLESHEET_MODULES), @@ -23277,6 +23944,7 @@ export const K = styled.div(base, cond && { color: 'blue' }, { margin: 1 });", "@emotion/styled".to_string(), ImportAlias::DefaultToNamed("styled".to_string()), )]), + ..Default::default() }, ) .unwrap() @@ -23611,7 +24279,8 @@ export const App = () => <>;", import_aliases: HashMap::from([( "styled-components".to_string(), ImportAlias::DefaultToNamed("styled".to_string()) - )]) + )]), + ..Default::default() }, ) .unwrap() @@ -23644,7 +24313,7 @@ const Indexed = styled.u`margin: ${p => p.theme.space[2]} ${({ theme }) => theme import_aliases: HashMap::from([( "styled-components".to_string(), ImportAlias::DefaultToNamed("styled".to_string()) - )]) + )]), ..Default::default() }, ) .unwrap() @@ -23676,6 +24345,7 @@ const I = styled.dd`color: ${function (p) { return p.theme }};`", single_css: true, import_main_css: false, import_aliases: HashMap::new(), + ..Default::default() }, ) { Ok(output) => output.code, @@ -23713,7 +24383,8 @@ const Tagged = Emotion.span`color: ${p => p.theme.brand};`;", import_aliases: HashMap::from([( "@emotion/styled".to_string(), ImportAlias::DefaultToNamed("styled".to_string()) - )]) + )]), + ..Default::default() }, ) .unwrap() @@ -23730,7 +24401,7 @@ const Tagged = Emotion.span`color: ${p => p.theme.brand};`;", "test.tsx", r"import styled, { css, keyframes, createGlobalStyle, ThemeProvider, useTheme, withTheme, ServerStyleSheet, StyleSheetManager, isStyledComponent } from 'styled-components'; const S = styled.div`color: red;`;", - ExtractOption { package: "@devup-ui/react".to_string(), css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, import_aliases: HashMap::from([("styled-components".to_string(), ImportAlias::DefaultToNamed("styled".to_string()))]) }, + ExtractOption { package: "@devup-ui/react".to_string(), css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, import_aliases: HashMap::from([("styled-components".to_string(), ImportAlias::DefaultToNamed("styled".to_string()))]), ..Default::default() }, ) .unwrap() )); @@ -23756,7 +24427,8 @@ export const v = styleVariants({});", import_aliases: HashMap::from([( "@vanilla-extract/css".to_string(), ImportAlias::NamedToNamed - )]) + )]), + ..Default::default() }, ) .unwrap() @@ -23949,7 +24621,8 @@ export const App = () => , + pub errors: Vec<(u32, String)>, +} + +/// Compile the Devup UI elements of `program` +pub(super) fn compile( + program: &Program<'_>, + code: &str, + package: &str, + target: NativeTarget, + scoping: &Scoping, +) -> Compiled { + let imports = imports::read(program, code, package, target); + let mut visitor = Elements { + code, + target, + scoping, + components: &imports.components, + sheet: Sheet::new(fresh_name("__s", code)), + replacements: imports.replacements, + errors: imports.errors, + }; + if !visitor.components.is_empty() { + visitor.visit_program(program); + } + let Elements { + sheet, + mut replacements, + errors, + .. + } = visitor; + if !sheet.is_empty() + && let Some(at) = imports.sheet_at + { + let style_sheet = fresh_name("StyleSheet", code); + let import = if style_sheet == "StyleSheet" { + style_sheet.clone() + } else { + format!("StyleSheet as {style_sheet}") + }; + replacements.push(( + at, + at, + format!( + "import {{ {import} }} from \"{REACT_NATIVE}\";\n{}\n", + sheet.declaration(&style_sheet) + ), + )); + } + Compiled { + replacements, + errors, + } +} + +/// What a prop of a Devup UI element is +#[derive(Debug, PartialEq)] +enum Prop { + /// `as`, the component rendered instead + As, + /// `style`, given whole + Style, + /// A style prop + Declares, + /// `_ios`, `_android` or `_web`: styles for one platform + Platform(NativePlatform), + /// What needs the React Native runtime + Runtime(RuntimeFeature), + /// What React Native has no equivalent of + Unsupported(Problem), + /// A prop the element passes on to the React Native component + Pass, +} + +/// What the prop `name` of a Devup UI element is +fn classify(name: &str) -> Prop { + match name { + "as" => Prop::As, + "style" => Prop::Style, + "_ios" => Prop::Platform(NativePlatform::Ios), + "_android" => Prop::Platform(NativePlatform::Android), + "_web" => Prop::Platform(NativePlatform::Web), + "_pressed" | "_active" => Prop::Runtime(RuntimeFeature::Pressed), + "_portrait" | "_landscape" => Prop::Runtime(RuntimeFeature::Responsive), + "className" => Prop::Unsupported(Problem::new( + "React Native has no class names", + "write the styles as props, or pass them in `style`", + )), + "typography" => Prop::Unsupported(Problem::new( + "theme typography is not read on React Native yet", + "write `fontSize`, `fontWeight`, `lineHeight` and `letterSpacing` themselves", + )), + "styleOrder" | "styleVars" => Prop::Unsupported(Problem::new( + "React Native has no stylesheet order and no CSS variables", + "remove it; on React Native the later style in `style` wins", + )), + name if name.starts_with("_theme") => Prop::Runtime(RuntimeFeature::Theme), + name if name.starts_with('_') || name == "selectors" => Prop::Unsupported(Problem::new( + "React Native has no selectors, pseudo-elements or media queries", + "remove it, or write the style the element takes in every state", + )), + name if css::is_style_property(name) => Prop::Declares, + _ => Prop::Pass, + } +} + +/// The styles a component declares before its props +fn defaults(kind: &ExportVariableKind) -> Vec { + let row = || { + ( + "flexDirection".to_string(), + NativeValue::Text("row".to_string()), + ) + }; + let center = |key: &str| (key.to_string(), NativeValue::Text("center".to_string())); + match kind { + ExportVariableKind::Flex => vec![Choice::Static(vec![row()])], + ExportVariableKind::Center => vec![Choice::Static(vec![ + row(), + center("justifyContent"), + center("alignItems"), + ])], + _ => vec![], + } +} + +/// Whether a React Native component renders no text of its own +fn holds_no_text(native: &str) -> bool { + matches!(native, "View" | "Pressable") +} + +struct Elements<'s> { + code: &'s str, + target: NativeTarget, + scoping: &'s Scoping, + components: &'s FxHashMap, + sheet: Sheet, + replacements: Vec, + errors: Vec<(u32, String)>, +} + +/// What the props of one element give its `style` +#[derive(Default)] +struct Styles { + choices: Vec, + /// The code of each style given whole, in prop order + given: Vec, + /// The span of each prop leaving the element once it takes `style` + removed: Vec, + /// The `style` prop, which leaves the element with the style props + style: Option, + /// A spread whose `style` cannot be read twice + opaque_spread: Option, +} + +impl<'a> Visit<'a> for Elements<'_> { + fn visit_jsx_element(&mut self, element: &JSXElement<'a>) { + match self.component(&element.opening_element.name) { + Some((kind, local)) => self.element(element, &kind, &local), + None => walk::walk_jsx_element(self, element), + } + } + + fn visit_identifier_reference(&mut self, identifier: &IdentifierReference<'a>) { + if let Some((_, local)) = self.binding(identifier) { + self.errors.push(( + identifier.span.start, + format!( + "`{local}` can only be rendered as a JSX element on React Native: the build compiles its props into styles only there. Fix: render `<{local} />`, or use a React Native component here" + ), + )); + } + } + + fn visit_ts_type(&mut self, _: &TSType<'a>) {} +} + +impl<'a> Elements<'_> { + /// The Devup UI component `identifier` reads + fn binding( + &self, + identifier: &IdentifierReference<'_>, + ) -> Option<(ExportVariableKind, String)> { + let reference = identifier.reference_id.get()?; + let symbol = self.scoping.get_reference(reference).symbol_id()?; + self.components.get(&symbol).cloned() + } + + /// The Devup UI component an element renders + fn component(&self, name: &JSXElementName<'_>) -> Option<(ExportVariableKind, String)> { + match name { + JSXElementName::IdentifierReference(identifier) => self.binding(identifier), + _ => None, + } + } + + fn error(&mut self, offset: u32, message: String) { + self.errors.push((offset, message)); + } + + /// Compile one Devup UI element + fn element(&mut self, element: &JSXElement<'a>, kind: &ExportVariableKind, local: &str) { + let opening = &element.opening_element; + let mut styles = Styles { + choices: defaults(kind), + ..Styles::default() + }; + let mut tag = None; + let mut previous_end = opening + .type_arguments + .as_ref() + .map_or_else(|| opening.name.span().end, |arguments| arguments.span.end); + for item in &opening.attributes { + let span = Span::new(previous_end, item.span().end); + previous_end = item.span().end; + match item { + JSXAttributeItem::SpreadAttribute(spread) => { + match spread_style(&spread.argument, self.code) { + Some(style) => styles.given.push(style), + None => styles.opaque_spread = Some(spread.span), + } + self.visit_expression(&spread.argument); + } + JSXAttributeItem::Attribute(attribute) => { + if let Some(name) = self.attribute(attribute, span, kind, local, &mut styles) { + tag = Some(name); + } + } + } + } + let retagged = tag.is_some(); + self.finish(element, styles, tag, previous_end); + self.children(element, kind, local, retagged); + } + + /// Read one prop; the code of the component it renders instead when it + /// is `as` + fn attribute( + &mut self, + attribute: &JSXAttribute<'a>, + span: Span, + kind: &ExportVariableKind, + local: &str, + styles: &mut Styles, + ) -> Option { + let JSXAttributeName::Identifier(name) = &attribute.name else { + self.pass(attribute); + return None; + }; + let name = name.name.as_str(); + if name == "src" && *kind == ExportVariableKind::Image { + self.image_source(attribute, local); + return None; + } + match classify(name) { + Prop::As => { + styles.removed.push(span); + return self.tag(attribute, local); + } + Prop::Style => self.given_style(attribute, span, local, styles), + Prop::Declares => { + styles.removed.push(span); + match self.value_choice(name, attribute.value.as_ref()) { + Ok(choice) => styles.choices.push(choice), + Err(problem) => self.error(attribute.span.start, problem.on(local, name)), + } + } + Prop::Platform(platform) => { + styles.removed.push(span); + let choices = self.platform( + attribute_expression(attribute), + name, + attribute.span.start, + local, + ); + if platform == self.target.platform { + styles.choices.extend(choices); + } + } + Prop::Runtime(feature) => self.error( + attribute.span.start, + feature.problem(self.target).on(local, name), + ), + Prop::Unsupported(problem) => self.error(attribute.span.start, problem.on(local, name)), + Prop::Pass => self.pass(attribute), + } + None + } + + /// Visit a prop the element passes on, for the elements in its value + fn pass(&mut self, attribute: &JSXAttribute<'a>) { + if let Some(value) = &attribute.value { + self.visit_jsx_attribute_value(value); + } + } + + /// `style`, applied after the style props as an inline style is on the web + fn given_style( + &mut self, + attribute: &JSXAttribute<'a>, + span: Span, + local: &str, + styles: &mut Styles, + ) { + match attribute_expression(attribute) { + Some(expression) => { + styles + .given + .push(expression.span().source_text(self.code).to_string()); + styles.style = Some(span); + self.visit_expression(expression); + } + None => self.error( + attribute.span.start, + Problem::new( + "React Native takes a style object, not CSS text", + "pass an object, such as `style={{ opacity: 0.5 }}`", + ) + .on(local, "style"), + ), + } + } + + /// The code of the component `as` renders + fn tag(&mut self, attribute: &JSXAttribute<'a>, local: &str) -> Option { + let tag = attribute_expression(attribute).filter(|expression| component_name(expression)); + if tag.is_none() { + self.error( + attribute.span.start, + Problem::new( + "React Native renders components, not HTML tags or values chosen at runtime", + "pass a capitalized component, such as `as={Pressable}`", + ) + .on(local, "as"), + ); + } + tag.map(|expression| expression.span().source_text(self.code).to_string()) + } + + /// `src` of an `Image` as React Native's `source` + fn image_source(&mut self, attribute: &JSXAttribute<'a>, local: &str) { + let source = match &attribute.value { + Some(JSXAttributeValue::StringLiteral(literal)) => { + Some(uri_source(literal.span, self.code)) + } + _ => attribute_expression(attribute).and_then(|expression| { + image_source_code(expression.without_parentheses(), self.code) + }), + }; + match source { + Some(source) => self.replacements.push(( + attribute.span.start as usize, + attribute.span.end as usize, + format!("source={{{source}}}"), + )), + None => self.error( + attribute.span.start, + Problem::new( + "the build turns only a literal, a name or a member `src` into a `source`", + "assign the value to a variable first, or pass React Native's `source`, such as `source={require('./image.png')}`", + ) + .on(local, "src"), + ), + } + } + + /// The styles of a platform block, such as `_ios={{ boxShadow: '...' }}` + fn platform( + &mut self, + value: Option<&Expression<'a>>, + name: &str, + offset: u32, + local: &str, + ) -> Vec { + if let Some(Expression::ObjectExpression(object)) = + value.map(Expression::without_parentheses) + { + return self.object_choices(object, local); + } + self.error( + offset, + Problem::new( + "a platform block takes an object of styles", + format!("write the styles in an object, such as `{name}={{{{ p: 2 }}}}`"), + ) + .on(local, name), + ); + Vec::new() + } + + /// The styles of an object of style props + fn object_choices(&mut self, object: &ObjectExpression<'a>, local: &str) -> Vec { + let mut choices = Vec::new(); + for property in &object.properties { + let ObjectPropertyKind::ObjectProperty(property) = property else { + self.error( + property.span().start, + Problem::new( + "the build reads only the styles written in a platform block", + "write each style in the block", + ) + .on(local, "..."), + ); + continue; + }; + let Some(key) = property + .key + .static_name() + .filter(|_| !property.computed) + .and_then(|key| key.as_str().map(str::to_string)) + else { + let key = property.key.span().source_text(self.code); + self.error( + property.span.start, + Problem::new( + "the build reads only keys written in a platform block", + "write the key itself", + ) + .on(local, &format!("[{key}]")), + ); + continue; + }; + choices.extend(self.object_property(&key, &property.value, property.span.start, local)); + } + choices + } + + /// The styles one key of a platform block declares + fn object_property( + &mut self, + key: &str, + value: &Expression<'a>, + offset: u32, + local: &str, + ) -> Vec { + match classify(key) { + Prop::Declares => match self.expression_choice(key, value) { + Ok(choice) => return vec![choice], + Err(problem) => self.error(offset, problem.on(local, key)), + }, + Prop::Platform(platform) => { + let choices = self.platform(Some(value), key, offset, local); + if platform == self.target.platform { + return choices; + } + } + Prop::Runtime(feature) => { + self.error(offset, feature.problem(self.target).on(local, key)); + } + Prop::Unsupported(problem) => self.error(offset, problem.on(local, key)), + Prop::As | Prop::Style | Prop::Pass => self.error( + offset, + Problem::new( + "a platform block holds only style props", + "pass it to the element itself", + ) + .on(local, key), + ), + } + Vec::new() + } + + /// The styles a style prop declares with the value it is written with + fn value_choice( + &self, + name: &str, + value: Option<&JSXAttributeValue<'a>>, + ) -> Result { + match value { + Some(JSXAttributeValue::StringLiteral(literal)) => literal.value.as_str().map_or_else( + || dynamic_choice(name, literal.span.source_text(self.code)), + |text| static_choice(name, &Literal::Text(text.to_string())), + ), + Some(JSXAttributeValue::ExpressionContainer(container)) => container + .expression + .as_expression() + .map_or(Ok(Choice::Empty), |expression| { + self.expression_choice(name, expression) + }), + _ => Err(Problem::new( + "a style prop takes a value", + "give the style a value, such as `p={2}`", + )), + } + } + + /// The styles a style prop declares with `expression` + fn expression_choice( + &self, + name: &str, + expression: &Expression<'a>, + ) -> Result { + if let Some(literal) = literal(expression) { + return static_choice(name, &literal); + } + match expression.without_parentheses() { + Expression::NullLiteral(_) | Expression::BooleanLiteral(_) => Ok(Choice::Empty), + Expression::Identifier(identifier) if identifier.name == "undefined" => { + Ok(Choice::Empty) + } + Expression::ConditionalExpression(condition) => Ok(Choice::Condition { + test: self.source(&condition.test), + consequent: Box::new(self.expression_choice(name, &condition.consequent)?), + alternate: Box::new(self.expression_choice(name, &condition.alternate)?), + }), + Expression::LogicalExpression(logical) if logical.operator == LogicalOperator::And => { + Ok(Choice::Condition { + test: self.source(&logical.left), + consequent: Box::new(self.expression_choice(name, &logical.right)?), + alternate: Box::new(Choice::Empty), + }) + } + Expression::ArrayExpression(_) => Err(RuntimeFeature::Responsive.problem(self.target)), + Expression::ObjectExpression(_) => Err(Problem::new( + "a style prop takes one value, not an object", + "give one value, or use a platform block such as `_ios`", + )), + expression => dynamic_choice(name, &self.source(expression)), + } + } + + /// The code of `expression` + fn source(&self, expression: &Expression<'_>) -> String { + let code = expression.span().source_text(self.code); + if matches!( + expression.without_parentheses(), + Expression::SequenceExpression(_) + ) { + format!("({code})") + } else { + code.to_string() + } + } + + /// Check the children of an element that renders no text, and visit them + fn children( + &mut self, + element: &JSXElement<'a>, + kind: &ExportVariableKind, + local: &str, + retagged: bool, + ) { + if !retagged && holds_no_text(native_component(kind)) { + for child in &element.children { + if let Some(span) = text_child(child) { + self.error( + span.start, + format!( + "`<{local}>` cannot hold text on React Native: it renders a `{}`, and React Native renders text only inside a `Text`. Fix: wrap the text in ``", + native_component(kind) + ), + ); + } + } + } + self.visit_jsx_children(&element.children); + } + + /// Give the element its `style` and component + fn finish( + &mut self, + element: &JSXElement<'a>, + styles: Styles, + tag: Option, + attributes_end: u32, + ) { + if let Some(tag) = &tag { + self.rename(element, tag); + } + let Styles { + choices, + given, + mut removed, + style, + opaque_spread, + } = styles; + let Some(code) = style_code(choices, given, &mut self.sheet) else { + self.remove(&removed); + return; + }; + if let Some(spread) = opaque_spread { + self.error( + spread.start, + "A spread on a Devup UI element must be a name or a member on React Native: the element merges the `style` it gives with its own. Fix: assign the spread object to a variable first".to_string(), + ); + } + removed.extend(style); + self.remove(&removed); + self.replacements.push(( + attributes_end as usize, + attributes_end as usize, + format!(" style={{{code}}}"), + )); + } + + /// Render the component `as` gives + fn rename(&mut self, element: &JSXElement<'a>, tag: &str) { + let names = std::iter::once(element.opening_element.name.span()).chain( + element + .closing_element + .as_ref() + .map(|closing| closing.name.span()), + ); + for span in names { + self.replacements + .push((span.start as usize, span.end as usize, tag.to_string())); + } + } + + fn remove(&mut self, spans: &[Span]) { + self.replacements.extend( + spans + .iter() + .map(|span| (span.start as usize, span.end as usize, String::new())), + ); + } +} + +/// The `source` of a URL written at `span` +fn uri_source(span: Span, code: &str) -> String { + format!("{{ uri: {} }}", span.source_text(code)) +} + +/// The `source` of an `Image` whose `src` is `expression`: a literal is a +/// URL, and a name or a member may hold a URL or, imported through Metro, an +/// asset number React Native takes as it is +fn image_source_code(expression: &Expression<'_>, code: &str) -> Option { + match expression { + Expression::StringLiteral(_) | Expression::TemplateLiteral(_) => { + Some(uri_source(expression.span(), code)) + } + Expression::Identifier(_) | Expression::StaticMemberExpression(_) => { + let value = expression.span().source_text(code); + Some(format!( + "typeof {value} === \"number\" ? {value} : {{ uri: {value} }}" + )) + } + _ => None, + } +} + +/// The expression a prop is written with +fn attribute_expression<'b, 'a>(attribute: &'b JSXAttribute<'a>) -> Option<&'b Expression<'a>> { + match &attribute.value { + Some(JSXAttributeValue::ExpressionContainer(container)) => { + container.expression.as_expression() + } + _ => None, + } +} + +/// Whether `expression` names a component: a capitalized name, or a member +/// of names such as `Animated.View` +fn component_name(expression: &Expression<'_>) -> bool { + match expression { + Expression::Identifier(identifier) => identifier + .name + .chars() + .next() + .is_some_and(char::is_uppercase), + Expression::StaticMemberExpression(member) => member_of_names(&member.object), + _ => false, + } +} + +fn member_of_names(expression: &Expression<'_>) -> bool { + match expression { + Expression::Identifier(_) => true, + Expression::StaticMemberExpression(member) => member_of_names(&member.object), + _ => false, + } +} + +/// The code of the `style` a spread gives, when its object can be read twice +fn spread_style(argument: &Expression<'_>, code: &str) -> Option { + member_of_names(argument).then(|| format!("{}.style", argument.span().source_text(code))) +} + +/// The literal `expression` writes, if it writes one +fn literal(expression: &Expression<'_>) -> Option { + match expression.without_parentheses() { + Expression::StringLiteral(literal) => literal + .value + .as_str() + .map(|text| Literal::Text(text.to_string())), + Expression::NumericLiteral(literal) => Some(Literal::Number(literal.value)), + Expression::UnaryExpression(unary) if unary.operator == UnaryOperator::UnaryNegation => { + match unary.argument.without_parentheses() { + Expression::NumericLiteral(literal) => Some(Literal::Number(-literal.value)), + _ => None, + } + } + Expression::TemplateLiteral(template) if template.expressions.is_empty() => template + .quasis + .first() + .and_then(|quasi| quasi.value.cooked?.as_str()) + .map(|cooked| Literal::Text(cooked.to_string())), + _ => None, + } +} + +/// The styles a style prop declares with a literal +fn static_choice(name: &str, literal: &Literal) -> Result { + declarations(name, literal).map(Choice::Static) +} + +/// The styles a style prop declares with a value read at runtime +fn dynamic_choice(name: &str, code: &str) -> Result { + dynamic_keys(name).map(|keys| { + Choice::Dynamic( + keys.into_iter() + .map(|key| (key.to_string(), code.to_string())) + .collect(), + ) + }) +} + +/// The span of a child writing text, if it writes any +fn text_child(child: &JSXChild<'_>) -> Option { + match child { + JSXChild::Text(text) if !text.value.trim().is_empty() => Some(text.span), + JSXChild::ExpressionContainer(container) => match &container.expression { + JSXExpression::StringLiteral(literal) => Some(literal.span), + JSXExpression::TemplateLiteral(template) => Some(template.span), + _ => None, + }, + _ => None, + } +} diff --git a/libs/extractor/src/native/errors.rs b/libs/extractor/src/native/errors.rs new file mode 100644 index 000000000..4a57442e1 --- /dev/null +++ b/libs/extractor/src/native/errors.rs @@ -0,0 +1,82 @@ +//! The build errors of the React Native output + +use super::NativeTarget; + +/// Why a value or prop cannot compile, and what to write instead +#[derive(Debug, Clone, PartialEq, Eq)] +pub(super) struct Problem { + pub reason: String, + pub fix: String, +} + +impl Problem { + pub(super) fn new(reason: impl Into, fix: impl Into) -> Self { + Self { + reason: reason.into(), + fix: fix.into(), + } + } + + /// The error for the prop `prop` of `` + pub(super) fn on(&self, element: &str, prop: &str) -> String { + format!( + "`<{element}>` cannot use `{prop}` on React Native: {}. Fix: {}", + self.reason, self.fix + ) + } + + /// The error for the import `name` of `package` + pub(super) fn import(&self, name: &str, package: &str) -> String { + format!( + "`{name}` from `{package}` cannot be used on React Native: {}. Fix: {}", + self.reason, self.fix + ) + } +} + +/// What needs the React Native runtime: one style object a breakpoint, a +/// theme or a press state, chosen while the app runs +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +pub(super) enum RuntimeFeature { + Responsive, + Theme, + Pressed, +} + +impl RuntimeFeature { + const fn what(self) -> &'static str { + match self { + Self::Responsive => "a responsive value is chosen by the window width", + Self::Theme => "a theme variant is chosen by the theme the app shows", + Self::Pressed => "a press style is chosen while the element is pressed", + } + } + + const fn fix(self) -> &'static str { + match self { + Self::Responsive => "give one value", + Self::Theme => "give the value for one theme", + Self::Pressed => { + "pass a function to the `style` of a React Native `Pressable`, reading `pressed`" + } + } + } + + /// Why the feature cannot compile for `target` + pub(super) fn problem(self, target: NativeTarget) -> Problem { + let runtime = if target.runtime { + "which needs the React Native runtime that this version does not include yet" + } else { + "which needs the React Native runtime that `runtime: false` turns off" + }; + Problem::new(format!("{}, {runtime}", self.what()), self.fix()) + } +} + +/// A theme token, read from the theme in a later version +pub(super) fn theme_token(value: &str) -> Problem { + Problem::new( + format!("the theme token in `{value}` is not read on React Native yet"), + "write the value itself", + ) +} diff --git a/libs/extractor/src/native/imports.rs b/libs/extractor/src/native/imports.rs new file mode 100644 index 000000000..1fac876e4 --- /dev/null +++ b/libs/extractor/src/native/imports.rs @@ -0,0 +1,185 @@ +//! The Devup UI imports of a file, rewritten to React Native's components. +//! +//! An imported component keeps its local name, now bound to the React Native +//! component it compiles to: `import { Box } from '@devup-ui/react'` becomes +//! `import { View as Box } from 'react-native'`. + +use oxc_ast::ast::{ + ImportDeclaration, ImportDeclarationSpecifier, ImportSpecifier, ModuleExportName, Program, + Statement, +}; +use oxc_span::GetSpan; +use oxc_syntax::symbol::SymbolId; +use rustc_hash::FxHashMap; + +use super::errors::{Problem, RuntimeFeature}; +use super::{NativeTarget, REACT_NATIVE, Replacement}; +use crate::component::ExportVariableKind; + +/// The Devup UI components a file imports, and how its imports change +#[derive(Default)] +pub(super) struct Imports { + /// Each component's binding: its kind and local name + pub components: FxHashMap, + pub replacements: Vec, + pub errors: Vec<(u32, String)>, + /// Where the stylesheet is declared: before the first statement that is + /// not an import + pub sheet_at: Option, +} + +/// The React Native component a Devup UI component renders +pub(super) const fn native_component(kind: &ExportVariableKind) -> &'static str { + match kind { + ExportVariableKind::Box + | ExportVariableKind::Flex + | ExportVariableKind::VStack + | ExportVariableKind::Center + | ExportVariableKind::Grid => "View", + ExportVariableKind::Text => "Text", + ExportVariableKind::Image => "Image", + ExportVariableKind::Input => "TextInput", + ExportVariableKind::Button => "Pressable", + } +} + +/// Why an export of the package cannot be imported on React Native, or `None` +/// for one that can (a component, or a name only types read) +fn unsupported(name: &str, target: NativeTarget) -> Option { + match name { + "Grid" => Some(Problem::new( + "React Native has no grid layout", + "lay the items out with `Flex` and `flexWrap`", + )), + "css" | "styled" => Some(Problem::new( + format!("`{name}` is not compiled for React Native yet"), + "write the styles as props of a Devup UI component", + )), + "useTheme" | "getTheme" | "setTheme" => Some(RuntimeFeature::Theme.problem(target)), + "ThemeScript" | "initTheme" | "globalCss" => Some(Problem::new( + "React Native has no document and no global stylesheet", + "remove it from the React Native build", + )), + "keyframes" => Some(Problem::new( + "animations need react-native-reanimated, which is not supported yet", + "animate with React Native's `Animated` or react-native-reanimated directly", + )), + "stylex" => Some(Problem::new( + "StyleX has no React Native output", + "write the styles as props of a Devup UI component", + )), + _ => None, + } +} + +/// Read the imports of `package` in `program` +pub(super) fn read( + program: &Program<'_>, + code: &str, + package: &str, + target: NativeTarget, +) -> Imports { + let mut imports = Imports::default(); + for statement in &program.body { + match statement { + Statement::ImportDeclaration(declaration) => { + if declaration.source.value == package && !declaration.import_kind.is_type() { + imports.declaration(declaration, code, package, target); + } + } + statement => { + imports + .sheet_at + .get_or_insert_with(|| statement.span().start as usize); + } + } + } + imports +} + +impl Imports { + fn declaration( + &mut self, + declaration: &ImportDeclaration<'_>, + code: &str, + package: &str, + target: NativeTarget, + ) { + let mut natives = Vec::new(); + let mut kept = Vec::new(); + for specifier in declaration.specifiers.iter().flatten() { + match specifier { + ImportDeclarationSpecifier::ImportSpecifier(specifier) => { + match self.specifier(specifier, package, target) { + Some(native) => natives.push(native), + None => kept.push(specifier_code(specifier, code)), + } + } + specifier => self.errors.push(( + specifier.span().start, + Problem::new( + "the build reads only components imported by name", + format!("import each component by name, such as `import {{ Box }} from '{package}'`"), + ) + .import(specifier.span().source_text(code), package), + )), + } + } + if natives.is_empty() { + return; + } + let mut text = format!( + "import {{ {} }} from \"{REACT_NATIVE}\";", + natives.join(", ") + ); + if !kept.is_empty() { + text = format!( + "{text}\nimport {{ {} }} from {};", + kept.join(", "), + declaration.source.span.source_text(code) + ); + } + let span = declaration.span; + self.replacements + .push((span.start as usize, span.end as usize, text)); + } + + /// The React Native import a specifier becomes, or `None` to keep it + fn specifier( + &mut self, + specifier: &ImportSpecifier<'_>, + package: &str, + target: NativeTarget, + ) -> Option { + if specifier.import_kind.is_type() { + return None; + } + let name = imported_name(&specifier.imported); + if let Some(problem) = unsupported(&name, target) { + self.errors + .push((specifier.span.start, problem.import(&name, package))); + return None; + } + let kind = ExportVariableKind::try_from(name).ok()?; + let local = specifier.local.name.to_string(); + let native = native_component(&kind); + if let Some(symbol) = specifier.local.symbol_id.get() { + self.components.insert(symbol, (kind, local.clone())); + } + Some(if native == local { + local + } else { + format!("{native} as {local}") + }) + } +} + +/// The name a specifier imports +fn imported_name(name: &ModuleExportName<'_>) -> String { + name.name().to_string() +} + +/// The code of a specifier kept on the package +fn specifier_code(specifier: &ImportSpecifier<'_>, code: &str) -> String { + specifier.span.source_text(code).to_string() +} diff --git a/libs/extractor/src/native/mod.rs b/libs/extractor/src/native/mod.rs new file mode 100644 index 000000000..d7effcfe4 --- /dev/null +++ b/libs/extractor/src/native/mod.rs @@ -0,0 +1,136 @@ +//! React Native output, as style objects instead of CSS. +//! +//! The styles of Devup UI elements compile to style objects hoisted into one +//! `StyleSheet.create` per file, passed to the React Native element through +//! `style`, with no CSS and no class names. +//! +//! Only what the build can decide is supported: static values, values the +//! element reads at runtime as they are, conditions between them, and the +//! platform blocks `_ios`, `_android` and `_web`. Responsive arrays, themes and +//! `_pressed` need a runtime that this version does not include, and a prop +//! React Native has no style for is a build error naming the prop. + +mod element; +mod errors; +mod imports; +mod props; +mod sheet; +mod style; +mod values; + +#[cfg(test)] +mod tests; + +use std::error::Error; + +use oxc_allocator::Allocator; +use oxc_semantic::SemanticBuilder; +use rustc_hash::FxHashSet; +use strum_macros::{Display, EnumString}; + +use crate::ExtractOutput; + +/// What extraction compiles for +#[derive(Debug, Clone, Copy, PartialEq, Eq, Default)] +pub enum ExtractTarget { + /// Class names and CSS + #[default] + Web, + /// React Native style objects + Native(NativeTarget), +} + +/// The React Native build a file is compiled for +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +pub struct NativeTarget { + /// The platform Metro builds the bundle for + pub platform: NativePlatform, + /// Whether the React Native runtime may be imported for what needs it; + /// with `false`, such styles are build errors + pub runtime: bool, +} + +/// The platform Metro builds a bundle for +#[derive(Debug, Clone, Copy, PartialEq, Eq, Display, EnumString)] +#[strum(serialize_all = "lowercase")] +pub enum NativePlatform { + Ios, + Android, + Web, +} + +/// The package React Native components are imported from +pub(crate) const REACT_NATIVE: &str = "react-native"; + +/// Compile `code` for React Native, or tell every place it cannot be, each +/// led by `filename:line:column` +pub(crate) fn extract( + filename: &str, + code: &str, + package: &str, + target: NativeTarget, + source_map: bool, +) -> Result> { + if !code.contains(package) { + return Ok(unchanged(code)); + } + let source_type = crate::supported_source_type(filename)?; + let allocator = Allocator::default(); + let program = crate::parsing::checked(&allocator, code, source_type) + .map_err(|errors| crate::located_errors(filename, code, &[], errors))?; + let scoping = SemanticBuilder::new() + .build(&program) + .semantic + .into_scoping(); + let compiled = element::compile(&program, code, package, target, &scoping); + if !compiled.errors.is_empty() { + return Err(crate::located_errors(filename, code, &[], compiled.errors).into()); + } + if compiled.replacements.is_empty() { + return Ok(unchanged(code)); + } + let (rewritten, edits) = apply(code, compiled.replacements); + let mut output = crate::emotion_namespace::Rewritten { + filename, + code: &rewritten, + source: code, + edits: &[&edits], + } + .output(); + output.map = output.map.filter(|_| source_map); + Ok(output) +} + +/// `code` as it is, with nothing to compile +fn unchanged(code: &str) -> ExtractOutput { + ExtractOutput { + styles: FxHashSet::default(), + code: code.to_string(), + map: None, + css_file: None, + dependencies: Vec::new(), + component_markers: crate::ComponentMarkers::default(), + } +} + +/// A replacement of `code[start..end]` by a text +pub(super) type Replacement = (usize, usize, String); + +/// `code` with `replacements` made, and the edits mapping it back +fn apply( + code: &str, + mut replacements: Vec, +) -> (String, Vec) { + replacements.sort_by_key(|(start, end, _)| (*start, *end)); + let mut rewritten = String::with_capacity(code.len()); + let mut edits = Vec::with_capacity(replacements.len()); + let mut at = 0; + for (start, end, text) in replacements { + rewritten.push_str(&code[at..start]); + rewritten.push_str(&text); + edits.push((start, end, text.len())); + at = end; + } + rewritten.push_str(&code[at..]); + (rewritten, edits) +} diff --git a/libs/extractor/src/native/props.rs b/libs/extractor/src/native/props.rs new file mode 100644 index 000000000..607ec024d --- /dev/null +++ b/libs/extractor/src/native/props.rs @@ -0,0 +1,388 @@ +//! CSS properties as React Native styles: which React Native reads, under +//! which key, and how their values convert. +//! +//! The list follows the style types of React Native with the New Architecture +//! (`ViewStyle`, `TextStyle` and `ImageStyle`). A CSS property it does not +//! name is a build error. + +use std::borrow::Cow; + +use phf::phf_map; + +use super::errors::Problem; +use super::values::{ + Literal, NativeValue, css_text, font_weight, keyword, length, line_height, number_code, + number_or_text, plain_number, +}; + +/// How React Native reads the value of a style +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +pub(super) enum Kind { + /// Pixels as a number, or a percentage or `auto` + Length, + /// A plain number + Number, + /// A number, or a ratio as text + Ratio, + /// A weight, as a string + FontWeight, + /// Pixels only + LineHeight, + /// Text kept as it is: colors, shadows, transforms, filters, families + Text, + /// One of a set of keywords + Keyword(&'static [&'static str]), +} + +const ALIGN: &[&str] = &["flex-start", "flex-end", "center", "stretch", "baseline"]; +const ALIGN_SELF: &[&str] = &[ + "auto", + "flex-start", + "flex-end", + "center", + "stretch", + "baseline", +]; +const DISTRIBUTE: &[&str] = &[ + "flex-start", + "flex-end", + "center", + "stretch", + "space-between", + "space-around", + "space-evenly", +]; +const JUSTIFY: &[&str] = &[ + "flex-start", + "flex-end", + "center", + "space-between", + "space-around", + "space-evenly", +]; +const LINE_STYLE: &[&str] = &["solid", "dotted", "dashed"]; +const TEXT_DECORATION_LINE: &[&str] = &[ + "none", + "underline", + "line-through", + "underline line-through", +]; + +/// The React Native key and value kind of each CSS property React Native reads +static NATIVE_PROPERTIES: phf::Map<&'static str, (&'static str, Kind)> = phf_map! { + "width" => ("width", Kind::Length), + "height" => ("height", Kind::Length), + "min-width" => ("minWidth", Kind::Length), + "min-height" => ("minHeight", Kind::Length), + "max-width" => ("maxWidth", Kind::Length), + "max-height" => ("maxHeight", Kind::Length), + "margin" => ("margin", Kind::Length), + "margin-top" => ("marginTop", Kind::Length), + "margin-right" => ("marginRight", Kind::Length), + "margin-bottom" => ("marginBottom", Kind::Length), + "margin-left" => ("marginLeft", Kind::Length), + "margin-block" => ("marginBlock", Kind::Length), + "margin-block-start" => ("marginBlockStart", Kind::Length), + "margin-block-end" => ("marginBlockEnd", Kind::Length), + "margin-inline" => ("marginInline", Kind::Length), + "margin-inline-start" => ("marginInlineStart", Kind::Length), + "margin-inline-end" => ("marginInlineEnd", Kind::Length), + "padding" => ("padding", Kind::Length), + "padding-top" => ("paddingTop", Kind::Length), + "padding-right" => ("paddingRight", Kind::Length), + "padding-bottom" => ("paddingBottom", Kind::Length), + "padding-left" => ("paddingLeft", Kind::Length), + "padding-block" => ("paddingBlock", Kind::Length), + "padding-block-start" => ("paddingBlockStart", Kind::Length), + "padding-block-end" => ("paddingBlockEnd", Kind::Length), + "padding-inline" => ("paddingInline", Kind::Length), + "padding-inline-start" => ("paddingInlineStart", Kind::Length), + "padding-inline-end" => ("paddingInlineEnd", Kind::Length), + "top" => ("top", Kind::Length), + "right" => ("right", Kind::Length), + "bottom" => ("bottom", Kind::Length), + "left" => ("left", Kind::Length), + "inset" => ("inset", Kind::Length), + "inset-block" => ("insetBlock", Kind::Length), + "inset-block-start" => ("insetBlockStart", Kind::Length), + "inset-block-end" => ("insetBlockEnd", Kind::Length), + "inset-inline" => ("insetInline", Kind::Length), + "inset-inline-start" => ("insetInlineStart", Kind::Length), + "inset-inline-end" => ("insetInlineEnd", Kind::Length), + "gap" => ("gap", Kind::Length), + "row-gap" => ("rowGap", Kind::Length), + "column-gap" => ("columnGap", Kind::Length), + "flex-basis" => ("flexBasis", Kind::Length), + "border-width" => ("borderWidth", Kind::Length), + "border-top-width" => ("borderTopWidth", Kind::Length), + "border-right-width" => ("borderRightWidth", Kind::Length), + "border-bottom-width" => ("borderBottomWidth", Kind::Length), + "border-left-width" => ("borderLeftWidth", Kind::Length), + "border-radius" => ("borderRadius", Kind::Length), + "border-top-left-radius" => ("borderTopLeftRadius", Kind::Length), + "border-top-right-radius" => ("borderTopRightRadius", Kind::Length), + "border-bottom-left-radius" => ("borderBottomLeftRadius", Kind::Length), + "border-bottom-right-radius" => ("borderBottomRightRadius", Kind::Length), + "border-start-start-radius" => ("borderStartStartRadius", Kind::Length), + "border-start-end-radius" => ("borderStartEndRadius", Kind::Length), + "border-end-start-radius" => ("borderEndStartRadius", Kind::Length), + "border-end-end-radius" => ("borderEndEndRadius", Kind::Length), + "outline-width" => ("outlineWidth", Kind::Length), + "outline-offset" => ("outlineOffset", Kind::Length), + "font-size" => ("fontSize", Kind::Length), + "letter-spacing" => ("letterSpacing", Kind::Length), + "flex" => ("flex", Kind::Number), + "flex-grow" => ("flexGrow", Kind::Number), + "flex-shrink" => ("flexShrink", Kind::Number), + "opacity" => ("opacity", Kind::Number), + "z-index" => ("zIndex", Kind::Number), + "aspect-ratio" => ("aspectRatio", Kind::Ratio), + "font-weight" => ("fontWeight", Kind::FontWeight), + "line-height" => ("lineHeight", Kind::LineHeight), + "background-color" => ("backgroundColor", Kind::Text), + "background-image" => ("backgroundImage", Kind::Text), + "color" => ("color", Kind::Text), + "border-color" => ("borderColor", Kind::Text), + "border-top-color" => ("borderTopColor", Kind::Text), + "border-right-color" => ("borderRightColor", Kind::Text), + "border-bottom-color" => ("borderBottomColor", Kind::Text), + "border-left-color" => ("borderLeftColor", Kind::Text), + "border-block-color" => ("borderBlockColor", Kind::Text), + "border-block-start-color" => ("borderBlockStartColor", Kind::Text), + "border-block-end-color" => ("borderBlockEndColor", Kind::Text), + "outline-color" => ("outlineColor", Kind::Text), + "text-decoration-color" => ("textDecorationColor", Kind::Text), + "box-shadow" => ("boxShadow", Kind::Text), + "filter" => ("filter", Kind::Text), + "transform" => ("transform", Kind::Text), + "transform-origin" => ("transformOrigin", Kind::Text), + "font-family" => ("fontFamily", Kind::Text), + "font-variant" => ("fontVariant", Kind::Text), + "display" => ("display", Kind::Keyword(&["none", "flex", "contents"])), + "position" => ("position", Kind::Keyword(&["absolute", "relative", "static"])), + "overflow" => ("overflow", Kind::Keyword(&["visible", "hidden", "scroll"])), + "flex-direction" => ("flexDirection", Kind::Keyword(&["row", "column", "row-reverse", "column-reverse"])), + "flex-wrap" => ("flexWrap", Kind::Keyword(&["wrap", "nowrap", "wrap-reverse"])), + "justify-content" => ("justifyContent", Kind::Keyword(JUSTIFY)), + "align-items" => ("alignItems", Kind::Keyword(ALIGN)), + "align-self" => ("alignSelf", Kind::Keyword(ALIGN_SELF)), + "align-content" => ("alignContent", Kind::Keyword(DISTRIBUTE)), + "direction" => ("direction", Kind::Keyword(&["inherit", "ltr", "rtl"])), + "box-sizing" => ("boxSizing", Kind::Keyword(&["border-box", "content-box"])), + "backface-visibility" => ("backfaceVisibility", Kind::Keyword(&["visible", "hidden"])), + "border-style" => ("borderStyle", Kind::Keyword(LINE_STYLE)), + "outline-style" => ("outlineStyle", Kind::Keyword(LINE_STYLE)), + "pointer-events" => ("pointerEvents", Kind::Keyword(&["auto", "none", "box-none", "box-only"])), + "cursor" => ("cursor", Kind::Keyword(&["auto", "pointer"])), + "isolation" => ("isolation", Kind::Keyword(&["auto", "isolate"])), + "mix-blend-mode" => ("mixBlendMode", Kind::Text), + "font-style" => ("fontStyle", Kind::Keyword(&["normal", "italic"])), + "text-align" => ("textAlign", Kind::Keyword(&["auto", "left", "right", "center", "justify"])), + "text-decoration" => ("textDecorationLine", Kind::Keyword(TEXT_DECORATION_LINE)), + "text-decoration-line" => ("textDecorationLine", Kind::Keyword(TEXT_DECORATION_LINE)), + "text-decoration-style" => ("textDecorationStyle", Kind::Keyword(&["solid", "double", "dotted", "dashed"])), + "text-transform" => ("textTransform", Kind::Keyword(&["none", "uppercase", "lowercase", "capitalize"])), + "user-select" => ("userSelect", Kind::Keyword(&["auto", "none", "text", "contain", "all"])), + "vertical-align" => ("verticalAlign", Kind::Keyword(&["auto", "top", "bottom", "middle"])), + "object-fit" => ("objectFit", Kind::Keyword(&["cover", "contain", "fill", "scale-down", "none"])), +}; + +/// A style React Native reads: its key and value +pub(super) type Declaration = (String, NativeValue); + +/// The React Native key and kind of the CSS `property` +fn native_property(property: &str) -> Result<(&'static str, Kind), Problem> { + NATIVE_PROPERTIES.get(property).copied().ok_or_else(|| { + Problem::new( + format!("React Native has no `{property}` style"), + "remove it, or write a style React Native reads", + ) + }) +} + +/// The value `text` as React Native reads a value of `kind` +fn native_value(kind: Kind, text: &str) -> Result { + match kind { + Kind::Length => length(text), + Kind::Number => plain_number(text), + Kind::Ratio => Ok(number_or_text(text)), + Kind::FontWeight => Ok(font_weight(text)), + Kind::LineHeight => line_height(text), + Kind::Text => Ok(NativeValue::Text(text.trim().to_string())), + Kind::Keyword(keywords) => keyword(text, keywords), + } +} + +/// What the web cannot pass on to React Native in any value +fn check_text(text: &str) -> Result<(), Problem> { + if text.contains('$') { + return Err(super::errors::theme_token(text)); + } + if text.contains("!important") { + return Err(Problem::new( + "React Native styles have no `!important`", + "remove `!important`; a later style already wins", + )); + } + if text.contains("var(") || text.contains("calc(") || text.contains("env(") { + return Err(Problem::new( + format!("React Native cannot compute `{text}`"), + "write the value itself", + )); + } + Ok(()) +} + +/// The styles the style prop `prop`, with the value `literal`, declares +pub(super) fn declarations(prop: &str, literal: &Literal) -> Result, Problem> { + if css::is_enum_property(prop) { + return enum_declarations(prop, literal); + } + let mut declarations = Vec::new(); + for property in css::disassemble_property(prop) { + let text = css_text(&property, literal); + check_text(&text)?; + declarations.extend(property_declarations(&property, &text)?); + } + Ok(declarations) +} + +/// The styles of a Devup UI enum prop, such as `positioning="top-left"` +fn enum_declarations(prop: &str, literal: &Literal) -> Result, Problem> { + let value = match literal { + Literal::Text(text) => Cow::Borrowed(text.as_str()), + Literal::Number(number) => Cow::Owned(number_code(*number)), + }; + let map = css::get_enum_property_value(prop, &value).ok_or_else(|| { + Problem::new( + format!("`{prop}` has no `{value}`"), + "use one of the values the prop takes", + ) + })?; + let mut declarations = Vec::new(); + for (property, value) in map.entries() { + declarations.extend(property_declarations(property, value)?); + } + declarations.sort_by(|a, b| a.0.cmp(&b.0)); + Ok(declarations) +} + +/// The styles the CSS `property: text` declares +fn property_declarations(property: &str, text: &str) -> Result, Problem> { + match property { + "background" => background(text).map(|declaration| vec![declaration]), + "margin" | "padding" => box_sides(property, text), + "gap" => gap(text), + "border" => Ok(border(text)), + _ => { + let (key, kind) = native_property(property)?; + Ok(vec![(key.to_string(), native_value(kind, text)?)]) + } + } +} + +/// `background`: a gradient is a background image, else a color +fn background(text: &str) -> Result { + let text = text.trim(); + if text.contains("url(") { + return Err(Problem::new( + "React Native draws no image in a background", + "render an `Image` instead", + )); + } + let key = if text.contains("gradient(") { + "backgroundImage" + } else { + "backgroundColor" + }; + Ok((key.to_string(), NativeValue::Text(text.to_string()))) +} + +/// `margin` and `padding` with one to four lengths, side by side +fn box_sides(property: &str, text: &str) -> Result, Problem> { + let parts: Vec<&str> = text.split_whitespace().collect(); + let sides: &[&str] = match parts.len() { + 1 => &[""], + 2 => &["Vertical", "Horizontal"], + 3 => &["Top", "Horizontal", "Bottom"], + 4 => &["Top", "Right", "Bottom", "Left"], + _ => { + return Err(Problem::new( + format!("`{text}` is not one to four lengths"), + "give one to four lengths", + )); + } + }; + parts + .iter() + .zip(sides) + .map(|(part, side)| Ok((format!("{property}{side}"), length(part)?))) + .collect() +} + +/// `gap` with a row and a column gap +fn gap(text: &str) -> Result, Problem> { + let parts: Vec<&str> = text.split_whitespace().collect(); + match parts.as_slice() { + [row, column] => Ok(vec![ + ("rowGap".to_string(), length(row)?), + ("columnGap".to_string(), length(column)?), + ]), + _ => Ok(vec![("gap".to_string(), length(text)?)]), + } +} + +/// `border` as its width, style and color +fn border(text: &str) -> Vec { + let text = text.trim(); + if text == "none" || text == "0" { + return vec![("borderWidth".to_string(), NativeValue::Number(0.0))]; + } + let mut declarations = Vec::new(); + let mut color = Vec::new(); + for part in text.split_whitespace() { + if LINE_STYLE.contains(&part) { + declarations.push(( + "borderStyle".to_string(), + NativeValue::Text(part.to_string()), + )); + } else if let Ok(width) = length(part) { + declarations.push(("borderWidth".to_string(), width)); + } else { + color.push(part); + } + } + if !color.is_empty() { + declarations.push(( + "borderColor".to_string(), + NativeValue::Text(color.join(" ")), + )); + } + declarations +} + +/// The React Native keys a style prop declares with a value the element +/// reads at runtime, which React Native receives as it is +pub(super) fn dynamic_keys(prop: &str) -> Result, Problem> { + if css::is_enum_property(prop) { + return Err(runtime_value_problem(prop)); + } + css::disassemble_property(prop) + .map(|property| match property.as_ref() { + "background" => Ok("backgroundColor"), + "margin" => Ok("margin"), + "padding" => Ok("padding"), + "border" => Err(runtime_value_problem(prop)), + property => native_property(property).map(|(key, _)| key), + }) + .collect() +} + +fn runtime_value_problem(prop: &str) -> Problem { + Problem::new( + format!( + "the build cannot split a value of `{prop}` it reads at runtime into React Native styles" + ), + "write the value as a literal, or pass the React Native styles in `style`", + ) +} diff --git a/libs/extractor/src/native/sheet.rs b/libs/extractor/src/native/sheet.rs new file mode 100644 index 000000000..b73bcee34 --- /dev/null +++ b/libs/extractor/src/native/sheet.rs @@ -0,0 +1,76 @@ +//! The styles of a file, hoisted into one `StyleSheet.create` + +use super::props::Declaration; + +/// The static styles of a file, each declared once under a short name +pub(super) struct Sheet { + /// The name the file's stylesheet constant takes + name: String, + /// The code of each style object, in the order they are first used + objects: Vec, +} + +impl Sheet { + pub(super) const fn new(name: String) -> Self { + Self { + name, + objects: Vec::new(), + } + } + + /// The code reading the style object of `declarations` from the sheet + pub(super) fn reference(&mut self, declarations: &[Declaration]) -> String { + let object = object_code(declarations); + let index = self + .objects + .iter() + .position(|existing| *existing == object) + .unwrap_or_else(|| { + self.objects.push(object); + self.objects.len() - 1 + }); + format!("{}.{}", self.name, key_name(index)) + } + + pub(super) const fn is_empty(&self) -> bool { + self.objects.is_empty() + } + + /// The declaration of the sheet, created by `style_sheet`, the local name + /// of React Native's `StyleSheet` + pub(super) fn declaration(&self, style_sheet: &str) -> String { + let objects: Vec = self + .objects + .iter() + .enumerate() + .map(|(index, object)| format!("{}: {object}", key_name(index))) + .collect(); + format!( + "const {} = {style_sheet}.create({{ {} }});", + self.name, + objects.join(", ") + ) + } +} + +/// The code of the style object `declarations` declare +fn object_code(declarations: &[Declaration]) -> String { + let properties: Vec = declarations + .iter() + .map(|(key, value)| format!("{key}: {}", value.code())) + .collect(); + format!("{{ {} }}", properties.join(", ")) +} + +/// The key of the style object at `index`: `a` to `z`, then `aa`, `ab`, ... +pub(super) fn key_name(index: usize) -> String { + let mut name = Vec::new(); + let mut rest = index + 1; + while rest > 0 { + rest -= 1; + name.push(b'a' + (rest % 26) as u8); + rest /= 26; + } + name.reverse(); + String::from_utf8_lossy(&name).into_owned() +} diff --git a/libs/extractor/src/native/snapshots/extractor__native__tests__aliases_and_types.snap b/libs/extractor/src/native/snapshots/extractor__native__tests__aliases_and_types.snap new file mode 100644 index 000000000..ff814cd3f --- /dev/null +++ b/libs/extractor/src/native/snapshots/extractor__native__tests__aliases_and_types.snap @@ -0,0 +1,10 @@ +--- +source: libs/extractor/src/native/tests.rs +expression: "compile_for(NativePlatform::Android, true, code)" +--- +import { View as B } from "react-native"; +import { type DevupProps, DevupTheme } from "@devup-ui/react"; +import type { DevupThemeTypography } from "@devup-ui/react"; +import { StyleSheet } from "react-native"; +const __s = StyleSheet.create({ a: { padding: 4 } }); +export const C = (props: DevupProps) => ; diff --git a/libs/extractor/src/native/snapshots/extractor__native__tests__apis.snap b/libs/extractor/src/native/snapshots/extractor__native__tests__apis.snap new file mode 100644 index 000000000..01d0e5454 --- /dev/null +++ b/libs/extractor/src/native/snapshots/extractor__native__tests__apis.snap @@ -0,0 +1,14 @@ +--- +source: libs/extractor/src/native/tests.rs +expression: "compile_for(NativePlatform::Ios, false, code)" +--- +error: test.tsx:1:10: `css` from `@devup-ui/react` cannot be used on React Native: `css` is not compiled for React Native yet. Fix: write the styles as props of a Devup UI component +test.tsx:1:15: `styled` from `@devup-ui/react` cannot be used on React Native: `styled` is not compiled for React Native yet. Fix: write the styles as props of a Devup UI component +test.tsx:1:23: `globalCss` from `@devup-ui/react` cannot be used on React Native: React Native has no document and no global stylesheet. Fix: remove it from the React Native build +test.tsx:1:34: `ThemeScript` from `@devup-ui/react` cannot be used on React Native: React Native has no document and no global stylesheet. Fix: remove it from the React Native build +test.tsx:1:47: `initTheme` from `@devup-ui/react` cannot be used on React Native: React Native has no document and no global stylesheet. Fix: remove it from the React Native build +test.tsx:1:58: `keyframes` from `@devup-ui/react` cannot be used on React Native: animations need react-native-reanimated, which is not supported yet. Fix: animate with React Native's `Animated` or react-native-reanimated directly +test.tsx:1:69: `stylex` from `@devup-ui/react` cannot be used on React Native: StyleX has no React Native output. Fix: write the styles as props of a Devup UI component +test.tsx:1:77: `useTheme` from `@devup-ui/react` cannot be used on React Native: a theme variant is chosen by the theme the app shows, which needs the React Native runtime that `runtime: false` turns off. Fix: give the value for one theme +test.tsx:1:87: `getTheme` from `@devup-ui/react` cannot be used on React Native: a theme variant is chosen by the theme the app shows, which needs the React Native runtime that `runtime: false` turns off. Fix: give the value for one theme +test.tsx:1:97: `setTheme` from `@devup-ui/react` cannot be used on React Native: a theme variant is chosen by the theme the app shows, which needs the React Native runtime that `runtime: false` turns off. Fix: give the value for one theme diff --git a/libs/extractor/src/native/snapshots/extractor__native__tests__backgrounds_and_borders.snap b/libs/extractor/src/native/snapshots/extractor__native__tests__backgrounds_and_borders.snap new file mode 100644 index 000000000..09f583463 --- /dev/null +++ b/libs/extractor/src/native/snapshots/extractor__native__tests__backgrounds_and_borders.snap @@ -0,0 +1,26 @@ +--- +source: libs/extractor/src/native/tests.rs +expression: compile(code) +--- +import { View as Box, Pressable as Button, View as Center, View as Flex, Image, TextInput as Input, Text, View as VStack } from "react-native"; +import { StyleSheet } from "react-native"; +const __s = StyleSheet.create({ + a: { + backgroundImage: "linear-gradient(red, blue)", + borderWidth: 1, + borderStyle: "solid", + borderColor: "rgba(0, 0, 0, 0.5)" + }, + b: { + backgroundColor: "red", + borderWidth: 0 + }, + c: { + backgroundImage: "radial-gradient(red, blue)", + borderWidth: 2, + borderStyle: "dashed" + } +}); +; +; +; diff --git a/libs/extractor/src/native/snapshots/extractor__native__tests__box_sides.snap b/libs/extractor/src/native/snapshots/extractor__native__tests__box_sides.snap new file mode 100644 index 000000000..b109e7c43 --- /dev/null +++ b/libs/extractor/src/native/snapshots/extractor__native__tests__box_sides.snap @@ -0,0 +1,25 @@ +--- +source: libs/extractor/src/native/tests.rs +expression: compile(code) +--- +import { View as Box, Pressable as Button, View as Center, View as Flex, Image, TextInput as Input, Text, View as VStack } from "react-native"; +import { StyleSheet } from "react-native"; +const __s = StyleSheet.create({ + a: { + marginVertical: 1, + marginHorizontal: 2, + paddingTop: 1, + paddingHorizontal: 2, + paddingBottom: 3, + marginLeft: 1, + marginRight: 1 + }, + b: { + marginTop: 1, + marginRight: 2, + marginBottom: 3, + marginLeft: 4 + } +}); +; +; diff --git a/libs/extractor/src/native/snapshots/extractor__native__tests__components.snap b/libs/extractor/src/native/snapshots/extractor__native__tests__components.snap new file mode 100644 index 000000000..4428ec6e8 --- /dev/null +++ b/libs/extractor/src/native/snapshots/extractor__native__tests__components.snap @@ -0,0 +1,29 @@ +--- +source: libs/extractor/src/native/tests.rs +expression: compile(code) +--- +import { View as Box, Pressable as Button, View as Center, View as Flex, Image, TextInput as Input, Text, View as VStack } from "react-native"; +import { StyleSheet } from "react-native"; +const __s = StyleSheet.create({ + a: { gap: 8 }, + b: { width: 40 }, + c: { flexDirection: "row" }, + d: { + flexDirection: "row", + justifyContent: "center", + alignItems: "center" + }, + e: { color: "red" } +}); +export const App = () => + + +
+ Hi + a + + + + + + ; diff --git a/libs/extractor/src/native/snapshots/extractor__native__tests__conditional_values.snap b/libs/extractor/src/native/snapshots/extractor__native__tests__conditional_values.snap new file mode 100644 index 000000000..c7c88be30 --- /dev/null +++ b/libs/extractor/src/native/snapshots/extractor__native__tests__conditional_values.snap @@ -0,0 +1,22 @@ +--- +source: libs/extractor/src/native/tests.rs +expression: compile(code) +--- +import { View as Box, Pressable as Button, View as Center, View as Flex, Image, TextInput as Input, Text, View as VStack } from "react-native"; +import { StyleSheet } from "react-native"; +const __s = StyleSheet.create({ + a: { backgroundColor: "red" }, + b: { backgroundColor: "blue" }, + c: { padding: 16 }, + d: { margin: 8 }, + e: { color: "red" }, + f: { height: 8 } +}); + 1 && __s.d, + a ? __s.e : b && { color: c }, + { width: x ?? 1 }, + off ? null : __s.f +]} />; diff --git a/libs/extractor/src/native/snapshots/extractor__native__tests__default_import.snap b/libs/extractor/src/native/snapshots/extractor__native__tests__default_import.snap new file mode 100644 index 000000000..57aa8ebfe --- /dev/null +++ b/libs/extractor/src/native/snapshots/extractor__native__tests__default_import.snap @@ -0,0 +1,5 @@ +--- +source: libs/extractor/src/native/tests.rs +expression: "compile_for(NativePlatform::Ios, false, code)" +--- +error: test.tsx:1:8: `D` from `@devup-ui/react` cannot be used on React Native: the build reads only components imported by name. Fix: import each component by name, such as `import { Box } from '@devup-ui/react'` diff --git a/libs/extractor/src/native/snapshots/extractor__native__tests__dynamic_splits.snap b/libs/extractor/src/native/snapshots/extractor__native__tests__dynamic_splits.snap new file mode 100644 index 000000000..137806a5d --- /dev/null +++ b/libs/extractor/src/native/snapshots/extractor__native__tests__dynamic_splits.snap @@ -0,0 +1,7 @@ +--- +source: libs/extractor/src/native/tests.rs +expression: compile(code) +--- +error: test.tsx:2:6: `` cannot use `border` on React Native: the build cannot split a value of `border` it reads at runtime into React Native styles. Fix: write the value as a literal, or pass the React Native styles in `style` +test.tsx:2:17: `` cannot use `positioning` on React Native: the build cannot split a value of `positioning` it reads at runtime into React Native styles. Fix: write the value as a literal, or pass the React Native styles in `style` +test.tsx:2:33: `` cannot use `gridArea` on React Native: React Native has no `grid-area` style. Fix: remove it, or write a style React Native reads diff --git a/libs/extractor/src/native/snapshots/extractor__native__tests__dynamic_values.snap b/libs/extractor/src/native/snapshots/extractor__native__tests__dynamic_values.snap new file mode 100644 index 000000000..1b6746bb0 --- /dev/null +++ b/libs/extractor/src/native/snapshots/extractor__native__tests__dynamic_values.snap @@ -0,0 +1,16 @@ +--- +source: libs/extractor/src/native/tests.rs +expression: compile(code) +--- +import { View as Box, Pressable as Button, View as Center, View as Flex, Image, TextInput as Input, Text, View as VStack } from "react-native"; +; diff --git a/libs/extractor/src/native/snapshots/extractor__native__tests__empty_values.snap b/libs/extractor/src/native/snapshots/extractor__native__tests__empty_values.snap new file mode 100644 index 000000000..3896c2aff --- /dev/null +++ b/libs/extractor/src/native/snapshots/extractor__native__tests__empty_values.snap @@ -0,0 +1,6 @@ +--- +source: libs/extractor/src/native/tests.rs +expression: compile(code) +--- +import { View as Box, Pressable as Button, View as Center, View as Flex, Image, TextInput as Input, Text, View as VStack } from "react-native"; +; diff --git a/libs/extractor/src/native/snapshots/extractor__native__tests__given_styles.snap b/libs/extractor/src/native/snapshots/extractor__native__tests__given_styles.snap new file mode 100644 index 000000000..52f8ce5ab --- /dev/null +++ b/libs/extractor/src/native/snapshots/extractor__native__tests__given_styles.snap @@ -0,0 +1,15 @@ +--- +source: libs/extractor/src/native/tests.rs +expression: compile(code) +--- +import { View as Box, Pressable as Button, View as Center, View as Flex, Image, TextInput as Input, Text, View as VStack } from "react-native"; +import { StyleSheet } from "react-native"; +const __s = StyleSheet.create({ a: { padding: 4 } }); +; +; +; diff --git a/libs/extractor/src/native/snapshots/extractor__native__tests__grid.snap b/libs/extractor/src/native/snapshots/extractor__native__tests__grid.snap new file mode 100644 index 000000000..d19d94203 --- /dev/null +++ b/libs/extractor/src/native/snapshots/extractor__native__tests__grid.snap @@ -0,0 +1,5 @@ +--- +source: libs/extractor/src/native/tests.rs +expression: "compile_for(NativePlatform::Ios, false, code)" +--- +error: test.tsx:1:10: `Grid` from `@devup-ui/react` cannot be used on React Native: React Native has no grid layout. Fix: lay the items out with `Flex` and `flexWrap` diff --git a/libs/extractor/src/native/snapshots/extractor__native__tests__image_source.snap b/libs/extractor/src/native/snapshots/extractor__native__tests__image_source.snap new file mode 100644 index 000000000..02cd480d3 --- /dev/null +++ b/libs/extractor/src/native/snapshots/extractor__native__tests__image_source.snap @@ -0,0 +1,5 @@ +--- +source: libs/extractor/src/native/tests.rs +expression: compile(code) +--- +error: test.tsx:2:8: `` cannot use `src` on React Native: the build turns only a literal, a name or a member `src` into a `source`. Fix: assign the value to a variable first, or pass React Native's `source`, such as `source={require('./image.png')}` diff --git a/libs/extractor/src/native/snapshots/extractor__native__tests__merge_order.snap b/libs/extractor/src/native/snapshots/extractor__native__tests__merge_order.snap new file mode 100644 index 000000000..e211cb1b7 --- /dev/null +++ b/libs/extractor/src/native/snapshots/extractor__native__tests__merge_order.snap @@ -0,0 +1,27 @@ +--- +source: libs/extractor/src/native/tests.rs +expression: compile(code) +--- +import { View as Box, Pressable as Button, View as Center, View as Flex, Image, TextInput as Input, Text, View as VStack } from "react-native"; +import { StyleSheet } from "react-native"; +const __s = StyleSheet.create({ + a: { + padding: 4, + margin: 8 + }, + b: { backgroundColor: "red" }, + c: { backgroundColor: "blue" }, + d: { backgroundColor: "black" }, + e: { + paddingLeft: 8, + paddingRight: 4 + }, + f: { flexDirection: "column" } +}); +; +; +; diff --git a/libs/extractor/src/native/snapshots/extractor__native__tests__missing_and_object_values.snap b/libs/extractor/src/native/snapshots/extractor__native__tests__missing_and_object_values.snap new file mode 100644 index 000000000..a20fc8df3 --- /dev/null +++ b/libs/extractor/src/native/snapshots/extractor__native__tests__missing_and_object_values.snap @@ -0,0 +1,7 @@ +--- +source: libs/extractor/src/native/tests.rs +expression: compile(code) +--- +error: test.tsx:2:6: `` cannot use `flex` on React Native: a style prop takes a value. Fix: give the style a value, such as `p={2}` +test.tsx:2:11: `` cannot use `bg` on React Native: a style prop takes one value, not an object. Fix: give one value, or use a platform block such as `_ios` +test.tsx:2:25: `` cannot use `p` on React Native: a style prop takes a value. Fix: give the style a value, such as `p={2}` diff --git a/libs/extractor/src/native/snapshots/extractor__native__tests__name_collisions.snap b/libs/extractor/src/native/snapshots/extractor__native__tests__name_collisions.snap new file mode 100644 index 000000000..c39699d3a --- /dev/null +++ b/libs/extractor/src/native/snapshots/extractor__native__tests__name_collisions.snap @@ -0,0 +1,10 @@ +--- +source: libs/extractor/src/native/tests.rs +expression: "compile_for(NativePlatform::Android, true, code)" +--- +import { StyleSheet, View } from "react-native"; +import { View as Box, Text } from "react-native"; +import { StyleSheet as StyleSheet_ } from "react-native"; +const __s_ = StyleSheet_.create({ a: { padding: 4 } }); +const __s = StyleSheet.create({ a: { flex: 1 } }); +export const C = () => t; diff --git a/libs/extractor/src/native/snapshots/extractor__native__tests__namespace.snap b/libs/extractor/src/native/snapshots/extractor__native__tests__namespace.snap new file mode 100644 index 000000000..29abd4b2a --- /dev/null +++ b/libs/extractor/src/native/snapshots/extractor__native__tests__namespace.snap @@ -0,0 +1,5 @@ +--- +source: libs/extractor/src/native/tests.rs +expression: "compile_for(NativePlatform::Ios, false, code)" +--- +error: test.tsx:1:8: `* as D` from `@devup-ui/react` cannot be used on React Native: the build reads only components imported by name. Fix: import each component by name, such as `import { Box } from '@devup-ui/react'` diff --git a/libs/extractor/src/native/snapshots/extractor__native__tests__namespaced_prop.snap b/libs/extractor/src/native/snapshots/extractor__native__tests__namespaced_prop.snap new file mode 100644 index 000000000..81630b401 --- /dev/null +++ b/libs/extractor/src/native/snapshots/extractor__native__tests__namespaced_prop.snap @@ -0,0 +1,8 @@ +--- +source: libs/extractor/src/native/tests.rs +expression: compile(code) +--- +import { View as Box, Pressable as Button, View as Center, View as Flex, Image, TextInput as Input, Text, View as VStack } from "react-native"; +import { StyleSheet } from "react-native"; +const __s = StyleSheet.create({ a: { padding: 4 } }); +; diff --git a/libs/extractor/src/native/snapshots/extractor__native__tests__nested_elements.snap b/libs/extractor/src/native/snapshots/extractor__native__tests__nested_elements.snap new file mode 100644 index 000000000..83f98e22f --- /dev/null +++ b/libs/extractor/src/native/snapshots/extractor__native__tests__nested_elements.snap @@ -0,0 +1,15 @@ +--- +source: libs/extractor/src/native/tests.rs +expression: compile(code) +--- +import { View as Box, Pressable as Button, View as Center, View as Flex, Image, TextInput as Input, Text, View as VStack } from "react-native"; +import { StyleSheet } from "react-native"; +const __s = StyleSheet.create({ + a: { color: "red" }, + b: { margin: 4 }, + c: { padding: 4 } +}); +!} render={() => } style={__s.c}> + {items.map((item) => {item})} + {/* a comment */} +; diff --git a/libs/extractor/src/native/snapshots/extractor__native__tests__no_components.snap b/libs/extractor/src/native/snapshots/extractor__native__tests__no_components.snap new file mode 100644 index 000000000..8f1b4f26a --- /dev/null +++ b/libs/extractor/src/native/snapshots/extractor__native__tests__no_components.snap @@ -0,0 +1,6 @@ +--- +source: libs/extractor/src/native/tests.rs +expression: "compile_for(NativePlatform::Android, true, code)" +--- +import type { DevupProps } from '@devup-ui/react' +export const value: DevupProps = {} diff --git a/libs/extractor/src/native/snapshots/extractor__native__tests__no_styles.snap b/libs/extractor/src/native/snapshots/extractor__native__tests__no_styles.snap new file mode 100644 index 000000000..c1a7650ac --- /dev/null +++ b/libs/extractor/src/native/snapshots/extractor__native__tests__no_styles.snap @@ -0,0 +1,6 @@ +--- +source: libs/extractor/src/native/tests.rs +expression: compile(code) +--- +import { View as Box, Pressable as Button, View as Center, View as Flex, Image, TextInput as Input, Text, View as VStack } from "react-native"; +; diff --git a/libs/extractor/src/native/snapshots/extractor__native__tests__opaque_spread.snap b/libs/extractor/src/native/snapshots/extractor__native__tests__opaque_spread.snap new file mode 100644 index 000000000..6252c23f0 --- /dev/null +++ b/libs/extractor/src/native/snapshots/extractor__native__tests__opaque_spread.snap @@ -0,0 +1,5 @@ +--- +source: libs/extractor/src/native/tests.rs +expression: compile(code) +--- +error: test.tsx:2:6: A spread on a Devup UI element must be a name or a member on React Native: the element merges the `style` it gives with its own. Fix: assign the spread object to a variable first diff --git a/libs/extractor/src/native/snapshots/extractor__native__tests__orientation.snap b/libs/extractor/src/native/snapshots/extractor__native__tests__orientation.snap new file mode 100644 index 000000000..4b19decba --- /dev/null +++ b/libs/extractor/src/native/snapshots/extractor__native__tests__orientation.snap @@ -0,0 +1,6 @@ +--- +source: libs/extractor/src/native/tests.rs +expression: compile(code) +--- +error: test.tsx:2:6: `` cannot use `_portrait` on React Native: a responsive value is chosen by the window width, which needs the React Native runtime that this version does not include yet. Fix: give one value +test.tsx:2:27: `` cannot use `_landscape` on React Native: a responsive value is chosen by the window width, which needs the React Native runtime that this version does not include yet. Fix: give one value diff --git a/libs/extractor/src/native/snapshots/extractor__native__tests__parse_error.snap b/libs/extractor/src/native/snapshots/extractor__native__tests__parse_error.snap new file mode 100644 index 000000000..f6fbd9fd4 --- /dev/null +++ b/libs/extractor/src/native/snapshots/extractor__native__tests__parse_error.snap @@ -0,0 +1,5 @@ +--- +source: libs/extractor/src/native/tests.rs +expression: "compile_for(NativePlatform::Ios, false, code)" +--- +error: test.tsx:2:12: Cannot parse source: Unexpected token. Fix: correct the syntax at this location diff --git a/libs/extractor/src/native/snapshots/extractor__native__tests__platform_blocks_android.snap b/libs/extractor/src/native/snapshots/extractor__native__tests__platform_blocks_android.snap new file mode 100644 index 000000000..056e56865 --- /dev/null +++ b/libs/extractor/src/native/snapshots/extractor__native__tests__platform_blocks_android.snap @@ -0,0 +1,15 @@ +--- +source: libs/extractor/src/native/tests.rs +expression: "compile_for(platform, true, &code)" +--- +import { View as Box, Pressable as Button, View as Center, View as Flex, Image, TextInput as Input, Text, View as VStack } from "react-native"; +import { StyleSheet } from "react-native"; +const __s = StyleSheet.create({ + a: { + padding: 4, + backgroundColor: "green" + }, + b: { opacity: 1 }, + c: { opacity: 0 } +}); +; diff --git a/libs/extractor/src/native/snapshots/extractor__native__tests__platform_blocks_ios.snap b/libs/extractor/src/native/snapshots/extractor__native__tests__platform_blocks_ios.snap new file mode 100644 index 000000000..513ea83fc --- /dev/null +++ b/libs/extractor/src/native/snapshots/extractor__native__tests__platform_blocks_ios.snap @@ -0,0 +1,11 @@ +--- +source: libs/extractor/src/native/tests.rs +expression: "compile_for(platform, true, &code)" +--- +import { View as Box, Pressable as Button, View as Center, View as Flex, Image, TextInput as Input, Text, View as VStack } from "react-native"; +import { StyleSheet } from "react-native"; +const __s = StyleSheet.create({ a: { + padding: 4, + backgroundColor: "red" +} }); +; diff --git a/libs/extractor/src/native/snapshots/extractor__native__tests__platform_blocks_web.snap b/libs/extractor/src/native/snapshots/extractor__native__tests__platform_blocks_web.snap new file mode 100644 index 000000000..169503609 --- /dev/null +++ b/libs/extractor/src/native/snapshots/extractor__native__tests__platform_blocks_web.snap @@ -0,0 +1,12 @@ +--- +source: libs/extractor/src/native/tests.rs +expression: "compile_for(platform, true, &code)" +--- +import { View as Box, Pressable as Button, View as Center, View as Flex, Image, TextInput as Input, Text, View as VStack } from "react-native"; +import { StyleSheet } from "react-native"; +const __s = StyleSheet.create({ a: { + padding: 4, + backgroundColor: "blue", + cursor: "pointer" +} }); +; diff --git a/libs/extractor/src/native/snapshots/extractor__native__tests__platform_shapes.snap b/libs/extractor/src/native/snapshots/extractor__native__tests__platform_shapes.snap new file mode 100644 index 000000000..86ea5568e --- /dev/null +++ b/libs/extractor/src/native/snapshots/extractor__native__tests__platform_shapes.snap @@ -0,0 +1,13 @@ +--- +source: libs/extractor/src/native/tests.rs +expression: compile(code) +--- +error: test.tsx:2:6: `` cannot use `_ios` on React Native: a platform block takes an object of styles. Fix: write the styles in an object, such as `_ios={{ p: 2 }}` +test.tsx:2:32: `` cannot use `...` on React Native: the build reads only the styles written in a platform block. Fix: write each style in the block +test.tsx:2:41: `` cannot use `[key]` on React Native: the build reads only keys written in a platform block. Fix: write the key itself +test.tsx:2:51: `` cannot use `onPress` on React Native: a platform block holds only style props. Fix: pass it to the element itself +test.tsx:2:63: `` cannot use `_hover` on React Native: React Native has no selectors, pseudo-elements or media queries. Fix: remove it, or write the style the element takes in every state +test.tsx:2:75: `` cannot use `_pressed` on React Native: a press style is chosen while the element is pressed, which needs the React Native runtime that this version does not include yet. Fix: pass a function to the `style` of a React Native `Pressable`, reading `pressed` +test.tsx:2:89: `` cannot use `_web` on React Native: a platform block takes an object of styles. Fix: write the styles in an object, such as `_web={{ p: 2 }}` +test.tsx:2:103: `` cannot use `as` on React Native: a platform block holds only style props. Fix: pass it to the element itself +test.tsx:2:110: `` cannot use `bg` on React Native: a responsive value is chosen by the window width, which needs the React Native runtime that this version does not include yet. Fix: give one value diff --git a/libs/extractor/src/native/snapshots/extractor__native__tests__pressed.snap b/libs/extractor/src/native/snapshots/extractor__native__tests__pressed.snap new file mode 100644 index 000000000..bbe1020a8 --- /dev/null +++ b/libs/extractor/src/native/snapshots/extractor__native__tests__pressed.snap @@ -0,0 +1,6 @@ +--- +source: libs/extractor/src/native/tests.rs +expression: compile(code) +--- +error: test.tsx:2:9: ` + +)"## +)] +#[case::shorthands_and_units( + "shorthands_and_units", + r##""## +)] +#[case::box_sides( + "box_sides", + r##"; +"## +)] +#[case::backgrounds_and_borders( + "backgrounds_and_borders", + r##"; +; +"## +)] +#[case::dynamic_values( + "dynamic_values", + "" +)] +#[case::conditional_values( + "conditional_values", + r##" 1 ? 2 : undefined} + color={a ? 'red' : b ? c : null} w={x ?? 1} h={off ? null : 2} opacity={false} />"## +)] +#[case::merge_order( + "merge_order", + r##"; +; +"## +)] +#[case::given_styles( + "given_styles", + r##"; +; +"## +)] +#[case::shared_objects( + "shared_objects", + r##"; +; +"## +)] +#[case::retagged( + "retagged", + r##"text; +; +"## +)] +#[case::nested_elements( + "nested_elements", + r##"!} render={() => }> + {items.map((item) => {item})} + {/* a comment */} +"## +)] +#[case::no_styles( + "no_styles", + r##""## +)] +#[case::empty_values("empty_values", "")] +#[case::namespaced_prop("namespaced_prop", "")] +fn compiles(#[case] name: &str, #[case] code: &str) { + assert_snapshot!(name, compile(code)); +} + +#[rstest] +#[case(NativePlatform::Ios)] +#[case(NativePlatform::Android)] +#[case(NativePlatform::Web)] +fn platform_blocks(#[case] platform: NativePlatform) { + let code = format!( + "{IMPORT}" + ); + assert_snapshot!( + format!("platform_blocks_{platform}"), + compile_for(platform, true, &code) + ); +} + +#[rstest] +#[case::aliases_and_types( + "aliases_and_types", + r##"import { Box as B, type DevupProps, DevupTheme } from "@devup-ui/react" +import type { DevupThemeTypography } from '@devup-ui/react' +export const C = (props: DevupProps) => "## +)] +#[case::name_collisions( + "name_collisions", + r##"import { StyleSheet, View } from 'react-native' +import { Box, Text } from '@devup-ui/react' +const __s = StyleSheet.create({ a: { flex: 1 } }) +export const C = () => t"## +)] +#[case::no_components( + "no_components", + r##"import type { DevupProps } from '@devup-ui/react' +export const value: DevupProps = {}"## +)] +#[case::unused_import("unused_import", "import { Box } from '@devup-ui/react'\n")] +#[case::types_read( + "types_read", + r##"import { Box } from '@devup-ui/react' +type P = React.ComponentProps +export const C = (props: P) => "## +)] +#[case::without_package("without_package", "export const value = 1\n")] +#[case::sheet_after_imports( + "sheet_after_imports", + r##"'use client' +import { Box } from '@devup-ui/react' +import { a } from './a' +const element = +import { b } from './b'"## +)] +fn compiles_files(#[case] name: &str, #[case] code: &str) { + assert_snapshot!(name, compile_for(NativePlatform::Android, true, code)); +} + +#[rstest] +#[case::responsive("responsive", "")] +#[case::responsive_in_condition("responsive_in_condition", "")] +#[case::orientation("orientation", "")] +#[case::theme_token("theme_token", "")] +#[case::theme_selector("theme_selector", "")] +#[case::typography("typography", "")] +#[case::pressed( + "pressed", + ";\n{`a`}; +{\" \"}" +)] +#[case::references( + "references", + "const C = Box;\nexport { Text };\nstyled(Flex);\n" +)] +#[case::opaque_spread("opaque_spread", "")] +fn errors(#[case] name: &str, #[case] code: &str) { + assert_snapshot!(name, compile(code)); +} + +#[rstest] +#[case::grid("grid", "import { Grid } from '@devup-ui/react'\n")] +#[case::apis( + "apis", + "import { css, styled, globalCss, ThemeScript, initTheme, keyframes, stylex, useTheme, getTheme, setTheme } from '@devup-ui/react'\n" +)] +#[case::namespace("namespace", "import * as D from '@devup-ui/react'\n")] +#[case::default_import("default_import", "import D, { Box } from '@devup-ui/react'\n")] +#[case::parse_error("parse_error", "import { Box } from '@devup-ui/react'\n\n")] +fn import_errors(#[case] name: &str, #[case] code: &str) { + assert_snapshot!(name, compile_for(NativePlatform::Ios, false, code)); +} + +#[rstest] +#[case(true)] +#[case(false)] +fn runtime_errors_name_the_option(#[case] runtime: bool) { + let code = format!("{IMPORT}"); + assert_snapshot!( + format!("runtime_{runtime}"), + compile_for(NativePlatform::Ios, runtime, &code) + ); +} + +#[test] +fn unsupported_file_extension_is_an_error() { + let error = extract( + "test.vue", + "import { Box } from '@devup-ui/react'", + option(NativePlatform::Ios, true), + ) + .err() + .map(|error| error.to_string()) + .unwrap_or_default(); + assert!(error.starts_with("test.vue:1:1: "), "{error}"); +} + +#[test] +fn source_map_follows_the_request() { + let code = format!("{IMPORT}"); + let with = extract("test.tsx", &code, option(NativePlatform::Ios, true)).map(|o| o.map); + let without = extract_without_source_map("test.tsx", &code, option(NativePlatform::Ios, true)) + .map(|o| o.map); + assert!(matches!(with, Ok(Some(map)) if map.contains("test.tsx"))); + assert!(matches!(without, Ok(None))); +} + +#[test] +fn native_output_has_no_css() { + let code = format!("{IMPORT}"); + let output = extract("test.tsx", &code, option(NativePlatform::Ios, true)); + assert!(matches!( + output, + Ok(output) if output.styles.is_empty() && output.css_file.is_none() && output.dependencies.is_empty() + )); +} + +#[test] +fn web_stays_the_default_target() { + assert_eq!(ExtractOption::default().target, ExtractTarget::Web); + assert_eq!(ExtractTarget::default(), ExtractTarget::Web); +} + +#[rstest] +#[case("ios", Some(NativePlatform::Ios))] +#[case("android", Some(NativePlatform::Android))] +#[case("web", Some(NativePlatform::Web))] +#[case("IOS", None)] +#[case("windows", None)] +fn platforms_parse(#[case] text: &str, #[case] expected: Option) { + assert_eq!(text.parse::().ok(), expected); + if let Some(platform) = expected { + assert_eq!(platform.to_string(), text); + } +} + +#[rstest] +#[case(0, "a")] +#[case(25, "z")] +#[case(26, "aa")] +#[case(27, "ab")] +#[case(701, "zz")] +#[case(702, "aaa")] +fn key_names(#[case] index: usize, #[case] expected: &str) { + assert_eq!(key_name(index), expected); +} + +#[rstest] +#[case(&[], "")] +#[case(&["a"], "`a`")] +#[case(&["a", "b"], "`a` or `b`")] +#[case(&["a", "b", "c"], "`a`, `b` or `c`")] +fn quoted_lists(#[case] values: &[&str], #[case] expected: &str) { + assert_eq!(quoted_list(values), expected); +} + +#[rstest] +#[case(NativeValue::Number(4.0), "4")] +#[case(NativeValue::Number(-0.5), "-0.5")] +#[case(NativeValue::Text("a\"b".to_string()), "\"a\\\"b\"")] +fn native_value_code(#[case] value: NativeValue, #[case] expected: &str) { + assert_eq!(value.code(), expected); +} + +#[rstest] +#[case("padding", Literal::Number(1.0), "4px")] +#[case("padding", Literal::Text("2".to_string()), "8px")] +#[case("padding", Literal::Text("2px".to_string()), "2px")] +#[case("opacity", Literal::Number(0.5), "0.5")] +#[case("opacity", Literal::Text("1".to_string()), "1")] +fn web_css_text(#[case] property: &str, #[case] literal: Literal, #[case] expected: &str) { + assert_eq!(css_text(property, &literal), expected); +} + +#[rstest] +#[case("2", NativeValue::Number(2.0))] +#[case(" 16 / 9 ", NativeValue::Text("16 / 9".to_string()))] +fn ratios(#[case] text: &str, #[case] expected: NativeValue) { + assert_eq!(number_or_text(text), expected); +} + +fn declarations(pairs: &[(&str, f64)]) -> Vec { + pairs + .iter() + .map(|(key, value)| ((*key).to_string(), NativeValue::Number(*value))) + .collect() +} + +#[test] +fn sheet_shares_equal_objects() { + let mut sheet = Sheet::new("s".to_string()); + assert!(sheet.is_empty()); + let a = sheet.reference(&declarations(&[("padding", 4.0)])); + let b = sheet.reference(&declarations(&[("margin", 4.0)])); + let again = sheet.reference(&declarations(&[("padding", 4.0)])); + assert_eq!( + (a.as_str(), b.as_str(), again.as_str()), + ("s.a", "s.b", "s.a") + ); + assert_eq!( + sheet.declaration("SS"), + "const s = SS.create({ a: { padding: 4 }, b: { margin: 4 } });" + ); +} + +#[test] +fn style_code_orders_and_merges_choices() { + let mut sheet = Sheet::new("s".to_string()); + let condition = |test: &str, consequent: Choice, alternate: Choice| Choice::Condition { + test: test.to_string(), + consequent: Box::new(consequent), + alternate: Box::new(alternate), + }; + let dynamic = + |key: &str, code: &str| Choice::Dynamic(vec![(key.to_string(), code.to_string())]); + let code = style_code( + vec![ + Choice::Empty, + dynamic("margin", "m"), + Choice::Static(declarations(&[("padding", 1.0)])), + Choice::Static(declarations(&[("margin", 2.0)])), + Choice::Static(declarations(&[("margin", 3.0), ("width", 1.0)])), + condition( + "a.b", + condition("c > 1", dynamic("width", "w"), Choice::Empty), + Choice::Static(declarations(&[("width", 2.0)])), + ), + condition( + "!d", + Choice::Empty, + Choice::Static(declarations(&[("height", 1.0)])), + ), + Choice::Static(declarations(&[("padding", 5.0)])), + ], + vec!["given".to_string()], + &mut sheet, + ); + assert_eq!( + code.as_deref(), + Some( + "[s.a, { margin: m }, s.b, a.b ? ((c > 1) && { width: w }) : s.c, (!d) ? null : s.d, given]" + ) + ); + assert_eq!( + sheet.declaration("SS"), + "const s = SS.create({ a: { padding: 5 }, b: { margin: 3, width: 1 }, c: { width: 2 }, d: { height: 1 } });" + ); + assert_eq!( + style_code(vec![Choice::Empty], vec!["given".to_string()], &mut sheet), + None + ); +} + +#[test] +fn problems_format_for_props_and_imports() { + let problem = Problem::new("why", "how"); + assert_eq!( + problem.on("Box", "p"), + "`` cannot use `p` on React Native: why. Fix: how" + ); + assert_eq!( + problem.import("css", "@devup-ui/react"), + "`css` from `@devup-ui/react` cannot be used on React Native: why. Fix: how" + ); + let target = NativeTarget { + platform: NativePlatform::Ios, + runtime: true, + }; + assert!( + RuntimeFeature::Pressed + .problem(target) + .fix + .contains("Pressable") + ); +} diff --git a/libs/extractor/src/native/values.rs b/libs/extractor/src/native/values.rs new file mode 100644 index 000000000..404b241f0 --- /dev/null +++ b/libs/extractor/src/native/values.rs @@ -0,0 +1,161 @@ +//! Values as the source writes them, and as React Native reads them + +use std::borrow::Cow; + +use crate::extract_style::constant::is_maintain_value_property; +use crate::utils::convert_value; + +use super::errors::Problem; + +/// The base `rem` and `em` are measured in, in density-independent pixels +pub(super) const ROOT_FONT_SIZE: f64 = 16.0; + +/// A value the source writes as a literal +#[derive(Debug, Clone, PartialEq)] +pub(super) enum Literal { + Number(f64), + Text(String), +} + +/// A value of a React Native style +#[derive(Debug, Clone, PartialEq)] +pub(super) enum NativeValue { + Number(f64), + Text(String), +} + +impl NativeValue { + /// The value as JavaScript writes it + pub(super) fn code(&self) -> String { + match self { + Self::Number(number) => number_code(*number), + Self::Text(text) => serde_json::Value::String(text.clone()).to_string(), + } + } +} + +/// `number` as JavaScript writes it +pub(super) fn number_code(number: f64) -> String { + format!("{number}") +} + +/// The finite number `text` writes, if it is one +pub(super) fn number(text: &str) -> Option { + text.trim() + .parse::() + .ok() + .filter(|number| number.is_finite()) +} + +/// The CSS value the web build gives `literal` for the CSS `property`: a +/// number is four pixels a unit, but for the properties taking a plain number +pub(super) fn css_text<'a>(property: &str, literal: &'a Literal) -> Cow<'a, str> { + let text = match literal { + Literal::Number(number) => Cow::Owned(number_code(*number)), + Literal::Text(text) => Cow::Borrowed(text.as_str()), + }; + if is_maintain_value_property(property) { + return text; + } + match convert_value(&text) { + Cow::Owned(converted) => Cow::Owned(converted), + Cow::Borrowed(_) => text, + } +} + +/// A length: pixels and `rem`/`em` become numbers, a percentage and `auto` +/// stay strings +pub(super) fn length(text: &str) -> Result { + let text = text.trim(); + if text == "auto" || text.strip_suffix('%').and_then(number).is_some() { + return Ok(NativeValue::Text(text.to_string())); + } + scaled_length(text) + .or_else(|| number(text)) + .map(NativeValue::Number) + .ok_or_else(|| unsupported_length(text)) +} + +/// `text` in pixels, from pixels or a `rem`/`em` length +fn scaled_length(text: &str) -> Option { + [("px", 1.0), ("rem", ROOT_FONT_SIZE), ("em", ROOT_FONT_SIZE)] + .into_iter() + .find_map(|(unit, scale)| { + text.strip_suffix(unit) + .and_then(number) + .map(|number| number * scale) + }) +} + +fn unsupported_length(text: &str) -> Problem { + if ["vw", "vh", "vmin", "vmax", "dvh", "svh", "lvh"] + .iter() + .any(|unit| text.ends_with(unit)) + { + return Problem::new( + format!("`{text}` needs the window size, which React Native knows only at runtime"), + "use a number of pixels or a percentage", + ); + } + Problem::new( + format!("`{text}` is not one length React Native reads"), + "use one number of pixels, a `rem` or `em` length, a percentage or `auto`", + ) +} + +/// A plain number, such as an opacity or a flex factor +pub(super) fn plain_number(text: &str) -> Result { + number(text) + .map(NativeValue::Number) + .ok_or_else(|| Problem::new(format!("`{text}` is not a number"), "use a number")) +} + +/// A number when it is one, else the text, as `aspectRatio` takes `16 / 9` +pub(super) fn number_or_text(text: &str) -> NativeValue { + number(text).map_or_else( + || NativeValue::Text(text.trim().to_string()), + NativeValue::Number, + ) +} + +/// A font weight, which React Native reads as a string +pub(super) fn font_weight(text: &str) -> NativeValue { + NativeValue::Text(text.trim().to_string()) +} + +/// A line height, which React Native reads in pixels, never relative to the +/// font size +pub(super) fn line_height(text: &str) -> Result { + let text = text.trim(); + scaled_length(text) + .map(NativeValue::Number) + .ok_or_else(|| { + Problem::new( + format!( + "`{text}` is relative to the font size on the web, but React Native reads a line height in pixels" + ), + "write the line height in pixels, such as `24px`", + ) + }) +} + +/// One of the `keywords` React Native reads for the property +pub(super) fn keyword(text: &str, keywords: &[&str]) -> Result { + let text = text.trim(); + if keywords.contains(&text) { + return Ok(NativeValue::Text(text.to_string())); + } + Err(Problem::new( + format!("React Native does not read `{text}` here"), + format!("use one of {}", quoted_list(keywords)), + )) +} + +/// `values` quoted and joined, the last by `or` +pub(super) fn quoted_list(values: &[&str]) -> String { + let quoted: Vec = values.iter().map(|value| format!("`{value}`")).collect(); + match quoted.split_last() { + Some((last, rest)) if !rest.is_empty() => format!("{} or {last}", rest.join(", ")), + _ => quoted.concat(), + } +} diff --git a/libs/extractor/src/tests/styled_library_forwarding_tests.rs b/libs/extractor/src/tests/styled_library_forwarding_tests.rs index da2ac2145..efea98740 100644 --- a/libs/extractor/src/tests/styled_library_forwarding_tests.rs +++ b/libs/extractor/src/tests/styled_library_forwarding_tests.rs @@ -30,6 +30,7 @@ fn library_code(source: &str) -> String { ImportAlias::DefaultToNamed("styled".to_string()), ), ]), + ..Default::default() }; extract("test.tsx", source, option).unwrap().code } @@ -316,6 +317,7 @@ fn styled_components_v5_validators_are_build_errors(#[case] source: &str, #[case ImportAlias::DefaultToNamed("styled".to_string()), ), ]), + ..Default::default() }; let result = extract("test.tsx", source, option); diff --git a/libs/extractor/tests/quoted_boundaries.rs b/libs/extractor/tests/quoted_boundaries.rs index bed15a900..d89943bde 100644 --- a/libs/extractor/tests/quoted_boundaries.rs +++ b/libs/extractor/tests/quoted_boundaries.rs @@ -45,6 +45,7 @@ fn options() -> ExtractOption { single_css: true, import_main_css: false, import_aliases: HashMap::new(), + ..Default::default() } } diff --git a/libs/extractor/tests/vanilla_extract.rs b/libs/extractor/tests/vanilla_extract.rs index 0e1eb2925..674b85b9e 100644 --- a/libs/extractor/tests/vanilla_extract.rs +++ b/libs/extractor/tests/vanilla_extract.rs @@ -14,7 +14,7 @@ fn extract_stylesheet(code: &str) -> String { css_dir: "@devup-ui/react".to_string(), single_css: true, import_main_css: false, - import_aliases: HashMap::new(), + import_aliases: HashMap::new(), ..Default::default() }, ) .unwrap(); @@ -52,6 +52,7 @@ fn an_unreadable_var_declaration_is_reported() { single_css: true, import_main_css: false, import_aliases: HashMap::new(), + ..Default::default() }, ) .err() diff --git a/libs/sheet/benches/my_benchmark.rs b/libs/sheet/benches/my_benchmark.rs index 2468e8bb8..089d106d8 100644 --- a/libs/sheet/benches/my_benchmark.rs +++ b/libs/sheet/benches/my_benchmark.rs @@ -140,6 +140,7 @@ fn make_update_option() -> ExtractOption { single_css: true, import_main_css: false, import_aliases: HashMap::new(), + ..Default::default() } } diff --git a/libs/sheet/src/global_order_tests.rs b/libs/sheet/src/global_order_tests.rs index 60fbf5aff..2f97c5952 100644 --- a/libs/sheet/src/global_order_tests.rs +++ b/libs/sheet/src/global_order_tests.rs @@ -28,6 +28,7 @@ fn shared_tailwind_registrations_survive_source_updates( single_css, import_main_css: false, import_aliases: std::collections::HashMap::new(), + ..Default::default() }; let mut sources = [ ( @@ -244,6 +245,7 @@ fn global_css_keeps_authored_cascade_order( single_css: true, import_main_css: false, import_aliases: std::collections::HashMap::new(), + ..Default::default() }, )?; sheet.update_styles(&output.styles, "global-order.tsx", true); diff --git a/libs/sheet/src/lib.rs b/libs/sheet/src/lib.rs index a0a8d53d8..92bc7bb70 100644 --- a/libs/sheet/src/lib.rs +++ b/libs/sheet/src/lib.rs @@ -2269,6 +2269,7 @@ mod tests { single_css: true, import_main_css: false, import_aliases: std::collections::HashMap::new(), + ..Default::default() }, ) .unwrap(); @@ -3466,7 +3467,7 @@ mod tests { let output = extract( "index.tsx", "import {Box,globalCss,keyframes,Flex} from '@devup-ui/core';;keyframes({from:{opacity:0},to:{opacity:1}});;globalCss`div{color:red}`;globalCss({div:{display:'flex'},imports:['https://test.com/a.css'],fontFaces:[{fontFamily:'Roboto',src:'url(/fonts/Roboto-Regular.ttf)'}]})", - ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, import_aliases: std::collections::HashMap::new() }, + ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, import_aliases: std::collections::HashMap::new(), ..Default::default() }, ) .unwrap(); sheet.update_styles(&output.styles, "index.tsx", true); @@ -4116,6 +4117,7 @@ mod tests { single_css, import_main_css: false, import_aliases: std::collections::HashMap::new(), + ..Default::default() }, ) .unwrap(); @@ -4743,7 +4745,7 @@ mod tests { let output = extract( "global.tsx", "import {globalCss} from '@devup-ui/core';globalCss({ body: { color: '$text', border: '1px solid $line.100' } })", - ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, import_aliases: std::collections::HashMap::new() }, + ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, import_aliases: std::collections::HashMap::new(), ..Default::default() }, ) .unwrap(); sheet.update_styles(&output.styles, "global.tsx", true); @@ -4786,6 +4788,7 @@ mod tests { single_css: true, import_main_css: false, import_aliases: std::collections::HashMap::new(), + ..Default::default() }; let mut sheet = StyleSheet::default(); let b = extract( @@ -4822,7 +4825,7 @@ mod tests { let output = extract( "global.tsx", "import {globalCss} from '@devup-ui/core';globalCss({ body: { color: 'red', _motionReduce: { transition: 'none' } } })", - ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, import_aliases: std::collections::HashMap::new() }, + ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), single_css: true, import_main_css: false, import_aliases: std::collections::HashMap::new(), ..Default::default() }, ) .unwrap(); sheet.update_styles(&output.styles, "global.tsx", true); @@ -4859,6 +4862,7 @@ mod tests { single_css: true, import_main_css: false, import_aliases: std::collections::HashMap::new(), + ..Default::default() }, ) .unwrap(); @@ -4905,6 +4909,7 @@ mod tests { single_css: true, import_main_css: false, import_aliases: std::collections::HashMap::new(), + ..Default::default() }, ) .unwrap(); @@ -4943,6 +4948,7 @@ let color = "red"; single_css: true, import_main_css: false, import_aliases: std::collections::HashMap::new(), + ..Default::default() }, ) .unwrap(); From c352820194ffea2d405b53e0f0155f237bc83e98 Mon Sep 17 00:00:00 2001 From: owjs3901 Date: Thu, 19 Nov 2026 23:21:38 +0900 Subject: [PATCH 2/4] test(extractor): cover the React Native target and wire codeExtractNative into the ABI checks Snapshot every supported prop shape, platform and build error of the native target, list codeExtractNative in the binding ABI guards and the cross-engine corpus, document it and add its changepack. Co-Authored-By: Claude Opus 5.5 --- .../changepack_log_react_native_core.json | 8 +++ bindings/devup-ui-wasm/AGENTS.md | 1 + bindings/devup-ui-wasm/README.md | 33 ++++----- libs/extractor/src/native/tests.rs | 71 +++++++++---------- .../src/__tests__/compiler-types.test.ts | 2 +- .../src/__tests__/wasm-abi.test.ts | 1 + 6 files changed, 63 insertions(+), 53 deletions(-) create mode 100644 .changepacks/changepack_log_react_native_core.json diff --git a/.changepacks/changepack_log_react_native_core.json b/.changepacks/changepack_log_react_native_core.json new file mode 100644 index 000000000..cb220b940 --- /dev/null +++ b/.changepacks/changepack_log_react_native_core.json @@ -0,0 +1,8 @@ +{ + "changes": { + "bindings/devup-ui-binding/package.json": "Patch", + "bindings/devup-ui-wasm/package.json": "Patch" + }, + "note": "Add `codeExtractNative(filename, code, packageName, platform, runtime)` to both engines (part of #411). It compiles a file for React Native: Devup UI elements imported from `@devup-ui/react` become React Native components (`Box` → `View`, `Text` → `Text`, `Image` → `Image`, `Input` → `TextInput`, `Button` → `Pressable`, `Flex`/`VStack`/`Center` → `View` with their flex styles), and their style props become style objects hoisted into one `StyleSheet.create` per file and passed through `style`. `_ios`, `_android` and `_web` resolve at build time from `platform`. A style React Native cannot take is a build error naming the prop, as are responsive values, themes and `_pressed`, which need a runtime this release does not include. Web output is unchanged.", + "date": "2026-11-19T00:00:00.000Z" +} diff --git a/bindings/devup-ui-wasm/AGENTS.md b/bindings/devup-ui-wasm/AGENTS.md index 1fcd3f3c9..497836d00 100644 --- a/bindings/devup-ui-wasm/AGENTS.md +++ b/bindings/devup-ui-wasm/AGENTS.md @@ -6,6 +6,7 @@ Rust → WebAssembly → JavaScript bridge. Exposes extraction engine to build p ### Core Functions - `codeExtract(filename, code, pkg, cssDir, singleCss, importMainCss, importCssInCss)` → Output +- `codeExtractNative(filename, code, pkg, platform, runtime)` → Output (React Native: `StyleSheet.create` styles, no CSS) - `hasDevupUI(filename, code, package)` → boolean - `getCss(fileNum?, importMainCss)` → string diff --git a/bindings/devup-ui-wasm/README.md b/bindings/devup-ui-wasm/README.md index fc9ffcf00..f5e26a55d 100644 --- a/bindings/devup-ui-wasm/README.md +++ b/bindings/devup-ui-wasm/README.md @@ -23,22 +23,23 @@ repository root fails if one does. Everything is exported from `pkg/index.js` (types in `pkg/index.d.ts`). -| Function | Does | -| ----------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `codeExtract(filename, code, package, cssDir, singleCss, importMainCssInCode, importMainCssInCss, importAliases)` | Compiles one source file and returns an `Output`: the rewritten `code`, its `css`, `cssFile`, source `map`, the `dependencies` it read and `updatedBaseStyle`. Throws on a build error. | -| `codeExtractWithoutSourceMap(...)` | The same without the source map. | -| `hasDevupUI(filename, code, package)` | Whether the file imports Devup UI, so a plugin can skip the rest. | -| `getCss(fileNum, importMainCss)` | The stylesheet collected so far: the whole sheet for `null`, one file's for its number. | -| `removeFile(filename)` | Forgets a deleted source file: its global CSS, its own stylesheet and the class names handed out in it. Returns whether the sheet changed. | -| `registerTheme(theme)`, `registerShorthands(shorthands)` | Registers the `devup.json` theme and the custom shorthand props before extracting. | -| `getThemeInterface(package, color, typography, length, shadows, theme)` | The `.d.ts` text that types the registered theme. | -| `getDefaultTheme()` | The theme variant that applies without `data-theme`. | -| `setPrefix(prefix)`, `getPrefix()` | Class name prefix. | -| `setDebug(debug)`, `isDebug()` | Readable class names instead of base-37 ones, with repeated declarations kept (the tests run this way). | -| `setLicenseBanner(enabled)`, `isLicenseBanner()` | Whether every stylesheet starts with the `/*! devup-ui v… */` license banner. On by default. A stylesheet without any rule is emitted empty either way. | -| `setModuleResolver(resolver)` | `(specifier, importer) => ({ path, code })`: how imports are resolved, so imported stylesheets are evaluated and imported constants inlined. | -| `setAtomHoist(threshold)`, `importFileRoutes(routes)` | Moves atoms used by `threshold` routes or more into the shared sheet. Call before `codeExtract`. | -| `exportSheet`, `exportClassMap`, `exportFileMap`, `exportCanonicalMap` and the matching `import*` functions | Save the collected state and load it into another process, as a bundler does between its server and client builds. | +| Function | Does | +| ----------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `codeExtract(filename, code, package, cssDir, singleCss, importMainCssInCode, importMainCssInCss, importAliases)` | Compiles one source file and returns an `Output`: the rewritten `code`, its `css`, `cssFile`, source `map`, the `dependencies` it read and `updatedBaseStyle`. Throws on a build error. | +| `codeExtractWithoutSourceMap(...)` | The same without the source map. | +| `codeExtractNative(filename, code, package, platform, runtime)` | Compiles one source file for React Native on `platform` (`ios`, `android` or `web`): Devup UI elements become React Native components, their styles one `StyleSheet.create` passed through `style`. The `Output` has the `code` and its `map`, but no `css`. A style React Native cannot take is a build error; `runtime: false` also makes responsive values, themes and `_pressed` build errors. | +| `hasDevupUI(filename, code, package)` | Whether the file imports Devup UI, so a plugin can skip the rest. | +| `getCss(fileNum, importMainCss)` | The stylesheet collected so far: the whole sheet for `null`, one file's for its number. | +| `removeFile(filename)` | Forgets a deleted source file: its global CSS, its own stylesheet and the class names handed out in it. Returns whether the sheet changed. | +| `registerTheme(theme)`, `registerShorthands(shorthands)` | Registers the `devup.json` theme and the custom shorthand props before extracting. | +| `getThemeInterface(package, color, typography, length, shadows, theme)` | The `.d.ts` text that types the registered theme. | +| `getDefaultTheme()` | The theme variant that applies without `data-theme`. | +| `setPrefix(prefix)`, `getPrefix()` | Class name prefix. | +| `setDebug(debug)`, `isDebug()` | Readable class names instead of base-37 ones, with repeated declarations kept (the tests run this way). | +| `setLicenseBanner(enabled)`, `isLicenseBanner()` | Whether every stylesheet starts with the `/*! devup-ui v… */` license banner. On by default. A stylesheet without any rule is emitted empty either way. | +| `setModuleResolver(resolver)` | `(specifier, importer) => ({ path, code })`: how imports are resolved, so imported stylesheets are evaluated and imported constants inlined. | +| `setAtomHoist(threshold)`, `importFileRoutes(routes)` | Moves atoms used by `threshold` routes or more into the shared sheet. Call before `codeExtract`. | +| `exportSheet`, `exportClassMap`, `exportFileMap`, `exportCanonicalMap` and the matching `import*` functions | Save the collected state and load it into another process, as a bundler does between its server and client builds. | ## State diff --git a/libs/extractor/src/native/tests.rs b/libs/extractor/src/native/tests.rs index c53939099..fb0778836 100644 --- a/libs/extractor/src/native/tests.rs +++ b/libs/extractor/src/native/tests.rs @@ -35,7 +35,7 @@ fn compile(code: &str) -> String { #[rstest] #[case::components( "components", - r##"export const App = () => ( + r#"export const App = () => ( @@ -48,26 +48,26 @@ fn compile(code: &str) -> String { -)"## +)"# )] #[case::shorthands_and_units( "shorthands_and_units", - r##""## + textDecoration="underline" transform="rotate(45deg)" boxShadow="0 1px 2px #0003" />"# )] #[case::box_sides( "box_sides", - r##"; -"## + r#"; +"# )] #[case::backgrounds_and_borders( "backgrounds_and_borders", - r##"; + r#"; ; -"## +"# )] #[case::dynamic_values( "dynamic_values", @@ -75,43 +75,43 @@ fn compile(code: &str) -> String { )] #[case::conditional_values( "conditional_values", - r##" 1 ? 2 : undefined} - color={a ? 'red' : b ? c : null} w={x ?? 1} h={off ? null : 2} opacity={false} />"## + r" 1 ? 2 : undefined} + color={a ? 'red' : b ? c : null} w={x ?? 1} h={off ? null : 2} opacity={false} />" )] #[case::merge_order( "merge_order", - r##"; + r#"; ; -"## +"# )] #[case::given_styles( "given_styles", - r##"; + r#"; ; -"## +"# )] #[case::shared_objects( "shared_objects", - r##"; + r#"; ; -"## +"# )] #[case::retagged( "retagged", - r##"text; + r"text; ; -"## +" )] #[case::nested_elements( "nested_elements", - r##"!} render={() => }> + r#"!} render={() => }> {items.map((item) => {item})} {/* a comment */} -"## +"# )] #[case::no_styles( "no_styles", - r##""## + r#""# )] #[case::empty_values("empty_values", "")] #[case::namespaced_prop("namespaced_prop", "")] @@ -136,37 +136,37 @@ fn platform_blocks(#[case] platform: NativePlatform) { #[rstest] #[case::aliases_and_types( "aliases_and_types", - r##"import { Box as B, type DevupProps, DevupTheme } from "@devup-ui/react" + r#"import { Box as B, type DevupProps, DevupTheme } from "@devup-ui/react" import type { DevupThemeTypography } from '@devup-ui/react' -export const C = (props: DevupProps) => "## +export const C = (props: DevupProps) => "# )] #[case::name_collisions( "name_collisions", - r##"import { StyleSheet, View } from 'react-native' + r"import { StyleSheet, View } from 'react-native' import { Box, Text } from '@devup-ui/react' const __s = StyleSheet.create({ a: { flex: 1 } }) -export const C = () => t"## +export const C = () => t" )] #[case::no_components( "no_components", - r##"import type { DevupProps } from '@devup-ui/react' -export const value: DevupProps = {}"## + r"import type { DevupProps } from '@devup-ui/react' +export const value: DevupProps = {}" )] #[case::unused_import("unused_import", "import { Box } from '@devup-ui/react'\n")] #[case::types_read( "types_read", - r##"import { Box } from '@devup-ui/react' + r"import { Box } from '@devup-ui/react' type P = React.ComponentProps -export const C = (props: P) => "## +export const C = (props: P) => " )] #[case::without_package("without_package", "export const value = 1\n")] #[case::sheet_after_imports( "sheet_after_imports", - r##"'use client' + r"'use client' import { Box } from '@devup-ui/react' import { a } from './a' const element = -import { b } from './b'"## +import { b } from './b'" )] fn compiles_files(#[case] name: &str, #[case] code: &str) { assert_snapshot!(name, compile_for(NativePlatform::Android, true, code)); @@ -197,9 +197,9 @@ fn compiles_files(#[case] name: &str, #[case] code: &str) { )] #[case::unsupported_values( "unsupported_values", - r##""## + bg="url(a.png)" positioning={1} flexDir="row" maxH="1ch" />"# )] #[case::missing_and_object_values( "missing_and_object_values", @@ -214,7 +214,7 @@ fn compiles_files(#[case] name: &str, #[case] code: &str) { #[case::image_source("image_source", "")] #[case::platform_shapes( "platform_shapes", - r##""## + r"" )] #[case::text_children( "text_children", @@ -262,8 +262,7 @@ fn unsupported_file_extension_is_an_error() { option(NativePlatform::Ios, true), ) .err() - .map(|error| error.to_string()) - .unwrap_or_default(); + .map_or_else(String::new, |error| error.to_string()); assert!(error.starts_with("test.vue:1:1: "), "{error}"); } diff --git a/packages/plugin-utils/src/__tests__/compiler-types.test.ts b/packages/plugin-utils/src/__tests__/compiler-types.test.ts index 2ca93991d..3478730d3 100644 --- a/packages/plugin-utils/src/__tests__/compiler-types.test.ts +++ b/packages/plugin-utils/src/__tests__/compiler-types.test.ts @@ -78,7 +78,7 @@ describe('compiler structural types', () => { Object.keys(compiler).filter( (key) => key !== 'Output' && key !== 'default', ), - ).toHaveLength(35) + ).toHaveLength(36) } finally { compiler.resetStateForTesting() } diff --git a/packages/plugin-utils/src/__tests__/wasm-abi.test.ts b/packages/plugin-utils/src/__tests__/wasm-abi.test.ts index 85461f3ca..292a1d938 100644 --- a/packages/plugin-utils/src/__tests__/wasm-abi.test.ts +++ b/packages/plugin-utils/src/__tests__/wasm-abi.test.ts @@ -45,6 +45,7 @@ describe('@devup-ui/wasm exports', () => { ).toEqual([ 'Output', 'codeExtract', + 'codeExtractNative', 'codeExtractWithoutSourceMap', 'createSession', 'dropSession', From 5c2691aaab9e0fedea35e7b5d97e08bc2ab25c30 Mon Sep 17 00:00:00 2001 From: owjs3901 Date: Fri, 20 Nov 2026 00:09:05 +0900 Subject: [PATCH 3/4] fix(extractor): convert style values read at runtime on React Native as literals are A dynamic length such as p={x} reached React Native unscaled, so x = 2 gave padding 2 where the web build gives 8px for the constant. Wrap values read at runtime in a file-local function that converts them as the build converts a literal: numbers and numeric strings take the property's scale (four pixels a unit for lengths), px lengths become numbers and rem/em lengths become pixels. Colors, keywords and other text pass through as they are. Co-Authored-By: Claude Opus 5.5 --- libs/extractor/src/native/element.rs | 95 ++++++++++++++----- libs/extractor/src/native/props.rs | 29 ++++-- ...or__native__tests__conditional_values.snap | 7 +- ...ractor__native__tests__dynamic_groups.snap | 32 +++++++ ..._native__tests__dynamic_in_conditions.snap | 20 ++++ ...ractor__native__tests__dynamic_values.snap | 17 ++-- ..._tests__dynamic_with_sheet_name_taken.snap | 14 +++ libs/extractor/src/native/tests.rs | 45 +++++++++ 8 files changed, 220 insertions(+), 39 deletions(-) create mode 100644 libs/extractor/src/native/snapshots/extractor__native__tests__dynamic_groups.snap create mode 100644 libs/extractor/src/native/snapshots/extractor__native__tests__dynamic_in_conditions.snap create mode 100644 libs/extractor/src/native/snapshots/extractor__native__tests__dynamic_with_sheet_name_taken.snap diff --git a/libs/extractor/src/native/element.rs b/libs/extractor/src/native/element.rs index 8b498da4d..23261152f 100644 --- a/libs/extractor/src/native/element.rs +++ b/libs/extractor/src/native/element.rs @@ -7,6 +7,8 @@ use oxc_ast::ast::{ JSXAttributeValue, JSXChild, JSXElement, JSXElementName, JSXExpression, LogicalOperator, ObjectExpression, ObjectPropertyKind, Program, TSType, UnaryOperator, }; +use std::cell::Cell; + use oxc_ast_visit::{Visit, walk}; use oxc_semantic::Scoping; use oxc_span::{GetSpan, Span}; @@ -18,7 +20,7 @@ use super::imports::{self, native_component}; use super::props::{declarations, dynamic_keys}; use super::sheet::Sheet; use super::style::{Choice, style_code}; -use super::values::{Literal, NativeValue}; +use super::values::{Literal, NativeValue, ROOT_FONT_SIZE}; use super::{NativePlatform, NativeTarget, REACT_NATIVE, Replacement}; use crate::component::ExportVariableKind; use crate::fresh_name::fresh_name; @@ -44,6 +46,8 @@ pub(super) fn compile( scoping, components: &imports.components, sheet: Sheet::new(fresh_name("__s", code)), + units: fresh_name("__u", code), + units_used: Cell::new(false), replacements: imports.replacements, errors: imports.errors, }; @@ -52,27 +56,23 @@ pub(super) fn compile( } let Elements { sheet, + units, + units_used, mut replacements, errors, .. } = visitor; - if !sheet.is_empty() + let mut prelude = String::new(); + if !sheet.is_empty() { + prelude.push_str(&sheet_prelude(&sheet, code)); + } + if units_used.get() { + prelude.push_str(&units_declaration(&units)); + } + if !prelude.is_empty() && let Some(at) = imports.sheet_at { - let style_sheet = fresh_name("StyleSheet", code); - let import = if style_sheet == "StyleSheet" { - style_sheet.clone() - } else { - format!("StyleSheet as {style_sheet}") - }; - replacements.push(( - at, - at, - format!( - "import {{ {import} }} from \"{REACT_NATIVE}\";\n{}\n", - sheet.declaration(&style_sheet) - ), - )); + replacements.push((at, at, prelude)); } Compiled { replacements, @@ -162,6 +162,10 @@ struct Elements<'s> { scoping: &'s Scoping, components: &'s FxHashMap, sheet: Sheet, + /// The name of the function converting values read at runtime + units: String, + /// Whether a value read at runtime is converted + units_used: Cell, replacements: Vec, errors: Vec<(u32, String)>, } @@ -495,7 +499,7 @@ impl<'a> Elements<'_> { ) -> Result { match value { Some(JSXAttributeValue::StringLiteral(literal)) => literal.value.as_str().map_or_else( - || dynamic_choice(name, literal.span.source_text(self.code)), + || self.dynamic_choice(name, literal.span.source_text(self.code)), |text| static_choice(name, &Literal::Text(text.to_string())), ), Some(JSXAttributeValue::ExpressionContainer(container)) => container @@ -542,10 +546,33 @@ impl<'a> Elements<'_> { "a style prop takes one value, not an object", "give one value, or use a platform block such as `_ios`", )), - expression => dynamic_choice(name, &self.source(expression)), + expression => self.dynamic_choice(name, &self.source(expression)), } } + /// The styles a style prop declares with the value `code` the element + /// reads at runtime + fn dynamic_choice(&self, name: &str, code: &str) -> Result { + dynamic_keys(name).map(|keys| { + Choice::Dynamic( + keys.into_iter() + .map(|(key, scale)| (key.to_string(), self.converted(code, scale))) + .collect(), + ) + }) + } + + /// `code`, converted at runtime when its numbers take `scale` + fn converted(&self, code: &str, scale: Option) -> String { + scale.map_or_else( + || code.to_string(), + |scale| { + self.units_used.set(true); + format!("{}({code}, {scale})", self.units) + }, + ) + } + /// The code of `expression` fn source(&self, expression: &Expression<'_>) -> String { let code = expression.span().source_text(self.code); @@ -732,14 +759,30 @@ fn static_choice(name: &str, literal: &Literal) -> Result { } /// The styles a style prop declares with a value read at runtime -fn dynamic_choice(name: &str, code: &str) -> Result { - dynamic_keys(name).map(|keys| { - Choice::Dynamic( - keys.into_iter() - .map(|key| (key.to_string(), code.to_string())) - .collect(), - ) - }) +/// The import of `StyleSheet` and the declaration of `sheet` +fn sheet_prelude(sheet: &Sheet, code: &str) -> String { + let style_sheet = fresh_name("StyleSheet", code); + let import = if style_sheet == "StyleSheet" { + style_sheet.clone() + } else { + format!("StyleSheet as {style_sheet}") + }; + format!( + "import {{ {import} }} from \"{REACT_NATIVE}\"; +{} +", + sheet.declaration(&style_sheet) + ) +} + +/// The declaration of the function converting a value read at runtime as the +/// build converts a literal: a number or a number in a string is multiplied by +/// the scale `s`, a pixel length is its number, a `rem` or `em` length is +/// in pixels, and any other value stays as it is +pub(super) fn units_declaration(name: &str) -> String { + format!( + r#"const {name} = (v, s) => {{ if (typeof v === "number") return v * s; const m = typeof v === "string" && /^\s*(-?(?:\d+\.?\d*|\.\d+))(px|r?em)?\s*$/.exec(v); return m ? Number(m[1]) * (m[2] ? (m[2] === "px" ? 1 : {ROOT_FONT_SIZE}) : s) : v; }};"# + ) + "\n" } /// The span of a child writing text, if it writes any diff --git a/libs/extractor/src/native/props.rs b/libs/extractor/src/native/props.rs index 607ec024d..7843c7f65 100644 --- a/libs/extractor/src/native/props.rs +++ b/libs/extractor/src/native/props.rs @@ -9,6 +9,8 @@ use std::borrow::Cow; use phf::phf_map; +use crate::extract_style::constant::is_maintain_value_property; + use super::errors::Problem; use super::values::{ Literal, NativeValue, css_text, font_weight, keyword, length, line_height, number_code, @@ -362,22 +364,37 @@ fn border(text: &str) -> Vec { } /// The React Native keys a style prop declares with a value the element -/// reads at runtime, which React Native receives as it is -pub(super) fn dynamic_keys(prop: &str) -> Result, Problem> { +/// reads at runtime, each with the scale a number of it is multiplied by +/// when the value is converted as the build converts a literal, or `None` +/// when React Native receives it as it is +pub(super) fn dynamic_keys(prop: &str) -> Result)>, Problem> { if css::is_enum_property(prop) { return Err(runtime_value_problem(prop)); } css::disassemble_property(prop) .map(|property| match property.as_ref() { - "background" => Ok("backgroundColor"), - "margin" => Ok("margin"), - "padding" => Ok("padding"), + "background" => Ok(("backgroundColor", None)), + "margin" => Ok(("margin", runtime_scale("margin", Kind::Length))), + "padding" => Ok(("padding", runtime_scale("padding", Kind::Length))), "border" => Err(runtime_value_problem(prop)), - property => native_property(property).map(|(key, _)| key), + property => { + native_property(property).map(|(key, kind)| (key, runtime_scale(property, kind))) + } }) .collect() } +/// The scale a number read at runtime for the CSS `property` of `kind` is +/// multiplied by, as the web build scales a literal: four pixels a unit for a +/// length, but for the properties taking a plain number +fn runtime_scale(property: &str, kind: Kind) -> Option { + match kind { + Kind::Length if !is_maintain_value_property(property) => Some(4), + Kind::Length | Kind::Number | Kind::Ratio | Kind::LineHeight => Some(1), + Kind::FontWeight | Kind::Text | Kind::Keyword(_) => None, + } +} + fn runtime_value_problem(prop: &str) -> Problem { Problem::new( format!( diff --git a/libs/extractor/src/native/snapshots/extractor__native__tests__conditional_values.snap b/libs/extractor/src/native/snapshots/extractor__native__tests__conditional_values.snap index c7c88be30..51b116b28 100644 --- a/libs/extractor/src/native/snapshots/extractor__native__tests__conditional_values.snap +++ b/libs/extractor/src/native/snapshots/extractor__native__tests__conditional_values.snap @@ -12,11 +12,16 @@ const __s = StyleSheet.create({ e: { color: "red" }, f: { height: 8 } }); +const __u = (v, s) => { + if (typeof v === "number") return v * s; + const m = typeof v === "string" && /^\s*(-?(?:\d+\.?\d*|\.\d+))(px|r?em)?\s*$/.exec(v); + return m ? Number(m[1]) * (m[2] ? m[2] === "px" ? 1 : 16 : s) : v; +}; 1 && __s.d, a ? __s.e : b && { color: c }, - { width: x ?? 1 }, + { width: __u(x ?? 1, 4) }, off ? null : __s.f ]} />; diff --git a/libs/extractor/src/native/snapshots/extractor__native__tests__dynamic_groups.snap b/libs/extractor/src/native/snapshots/extractor__native__tests__dynamic_groups.snap new file mode 100644 index 000000000..88c80fdc6 --- /dev/null +++ b/libs/extractor/src/native/snapshots/extractor__native__tests__dynamic_groups.snap @@ -0,0 +1,32 @@ +--- +source: libs/extractor/src/native/tests.rs +expression: compile(code) +--- +import { View as Box, Pressable as Button, View as Center, View as Flex, Image, TextInput as Input, Text, View as VStack } from "react-native"; +const __u = (v, s) => { + if (typeof v === "number") return v * s; + const m = typeof v === "string" && /^\s*(-?(?:\d+\.?\d*|\.\d+))(px|r?em)?\s*$/.exec(v); + return m ? Number(m[1]) * (m[2] ? m[2] === "px" ? 1 : 16 : s) : v; +}; +; diff --git a/libs/extractor/src/native/snapshots/extractor__native__tests__dynamic_in_conditions.snap b/libs/extractor/src/native/snapshots/extractor__native__tests__dynamic_in_conditions.snap new file mode 100644 index 000000000..b2169538e --- /dev/null +++ b/libs/extractor/src/native/snapshots/extractor__native__tests__dynamic_in_conditions.snap @@ -0,0 +1,20 @@ +--- +source: libs/extractor/src/native/tests.rs +expression: compile(code) +--- +import { View as Box, Pressable as Button, View as Center, View as Flex, Image, TextInput as Input, Text, View as VStack } from "react-native"; +import { StyleSheet } from "react-native"; +const __s = StyleSheet.create({ + a: { padding: 8 }, + b: { backgroundColor: "red" } +}); +const __u = (v, s) => { + if (typeof v === "number") return v * s; + const m = typeof v === "string" && /^\s*(-?(?:\d+\.?\d*|\.\d+))(px|r?em)?\s*$/.exec(v); + return m ? Number(m[1]) * (m[2] ? m[2] === "px" ? 1 : 16 : s) : v; +}; +; diff --git a/libs/extractor/src/native/snapshots/extractor__native__tests__dynamic_values.snap b/libs/extractor/src/native/snapshots/extractor__native__tests__dynamic_values.snap index 1b6746bb0..1ed81ef25 100644 --- a/libs/extractor/src/native/snapshots/extractor__native__tests__dynamic_values.snap +++ b/libs/extractor/src/native/snapshots/extractor__native__tests__dynamic_values.snap @@ -3,14 +3,19 @@ source: libs/extractor/src/native/tests.rs expression: compile(code) --- import { View as Box, Pressable as Button, View as Center, View as Flex, Image, TextInput as Input, Text, View as VStack } from "react-native"; +const __u = (v, s) => { + if (typeof v === "number") return v * s; + const m = typeof v === "string" && /^\s*(-?(?:\d+\.?\d*|\.\d+))(px|r?em)?\s*$/.exec(v); + return m ? Number(m[1]) * (m[2] ? m[2] === "px" ? 1 : 16 : s) : v; +}; ; diff --git a/libs/extractor/src/native/snapshots/extractor__native__tests__dynamic_with_sheet_name_taken.snap b/libs/extractor/src/native/snapshots/extractor__native__tests__dynamic_with_sheet_name_taken.snap new file mode 100644 index 000000000..a0a43edf2 --- /dev/null +++ b/libs/extractor/src/native/snapshots/extractor__native__tests__dynamic_with_sheet_name_taken.snap @@ -0,0 +1,14 @@ +--- +source: libs/extractor/src/native/tests.rs +expression: compile(code) +--- +import { View as Box, Pressable as Button, View as Center, View as Flex, Image, TextInput as Input, Text, View as VStack } from "react-native"; +import { StyleSheet } from "react-native"; +const __s = StyleSheet.create({ a: { margin: 4 } }); +const __u_ = (v, s) => { + if (typeof v === "number") return v * s; + const m = typeof v === "string" && /^\s*(-?(?:\d+\.?\d*|\.\d+))(px|r?em)?\s*$/.exec(v); + return m ? Number(m[1]) * (m[2] ? m[2] === "px" ? 1 : 16 : s) : v; +}; +const __u = 1; +; diff --git a/libs/extractor/src/native/tests.rs b/libs/extractor/src/native/tests.rs index fb0778836..554eed9bc 100644 --- a/libs/extractor/src/native/tests.rs +++ b/libs/extractor/src/native/tests.rs @@ -1,6 +1,7 @@ use insta::assert_snapshot; use rstest::rstest; +use super::element::units_declaration; use super::errors::{Problem, RuntimeFeature}; use super::props::Declaration; use super::sheet::{Sheet, key_name}; @@ -73,6 +74,21 @@ fn compile(code: &str) -> String { "dynamic_values", "" )] +#[case::dynamic_groups( + "dynamic_groups", + r#""# +)] +#[case::dynamic_in_conditions( + "dynamic_in_conditions", + "" +)] +#[case::dynamic_with_sheet_name_taken( + "dynamic_with_sheet_name_taken", + "const __u = 1; +" +)] #[case::conditional_values( "conditional_values", r" 1 ? 2 : undefined} @@ -444,3 +460,32 @@ fn problems_format_for_props_and_imports() { .contains("Pressable") ); } + +#[rstest] +#[case("2, 4", "8")] +#[case("-1.5, 4", "-6")] +#[case("0.5, 1", "0.5")] +#[case("\"2\", 4", "8")] +#[case("\" .5 \", 1", "0.5")] +#[case("\"3px\", 4", "3")] +#[case("\"-3px\", 1", "-3")] +#[case("\"1rem\", 4", "16")] +#[case("\"0.5em\", 1", "8")] +#[case("\"50%\", 4", "50%")] +#[case("\"auto\", 4", "auto")] +#[case("\"1vw\", 4", "1vw")] +#[case("\"16 / 9\", 1", "16 / 9")] +#[case("null, 4", "null")] +#[case("undefined, 4", "undefined")] +fn runtime_values_convert_as_literals_do(#[case] arguments: &str, #[case] expected: &str) { + // Given: the function the build declares for values read at runtime + let code = format!("{}String(u({arguments}))", units_declaration("u")); + // When + let mut context = boa_engine::Context::default(); + let value = context + .eval(boa_engine::Source::from_bytes(&code)) + .and_then(|value| value.to_string(&mut context)) + .map(|text| text.to_std_string_escaped()); + // Then + assert_eq!(value.ok().as_deref(), Some(expected), "{code}"); +} From 200d61d2d93b016dc8a08d74c1a81735fa1187aa Mon Sep 17 00:00:00 2001 From: owjs3901 Date: Fri, 20 Nov 2026 00:10:38 +0900 Subject: [PATCH 4/4] test(extractor): drop the needless raw string hashes and note runtime conversion in the changepack Co-Authored-By: Claude Opus 5.5 --- .changepacks/changepack_log_react_native_core.json | 2 +- libs/extractor/src/native/tests.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.changepacks/changepack_log_react_native_core.json b/.changepacks/changepack_log_react_native_core.json index cb220b940..adb2acd11 100644 --- a/.changepacks/changepack_log_react_native_core.json +++ b/.changepacks/changepack_log_react_native_core.json @@ -3,6 +3,6 @@ "bindings/devup-ui-binding/package.json": "Patch", "bindings/devup-ui-wasm/package.json": "Patch" }, - "note": "Add `codeExtractNative(filename, code, packageName, platform, runtime)` to both engines (part of #411). It compiles a file for React Native: Devup UI elements imported from `@devup-ui/react` become React Native components (`Box` → `View`, `Text` → `Text`, `Image` → `Image`, `Input` → `TextInput`, `Button` → `Pressable`, `Flex`/`VStack`/`Center` → `View` with their flex styles), and their style props become style objects hoisted into one `StyleSheet.create` per file and passed through `style`. `_ios`, `_android` and `_web` resolve at build time from `platform`. A style React Native cannot take is a build error naming the prop, as are responsive values, themes and `_pressed`, which need a runtime this release does not include. Web output is unchanged.", + "note": "Add `codeExtractNative(filename, code, packageName, platform, runtime)` to both engines (part of #411). It compiles a file for React Native: Devup UI elements imported from `@devup-ui/react` become React Native components (`Box` → `View`, `Text` → `Text`, `Image` → `Image`, `Input` → `TextInput`, `Button` → `Pressable`, `Flex`/`VStack`/`Center` → `View` with their flex styles), and their style props become style objects hoisted into one `StyleSheet.create` per file and passed through `style`. `_ios`, `_android` and `_web` resolve at build time from `platform`. A style React Native cannot take is a build error naming the prop, as are responsive values, themes and `_pressed`, which need a runtime this release does not include. A value read at runtime converts as a literal does, through a function the file declares: numbers take the scale of the property (four pixels a unit for lengths), `px` strings become numbers and `rem`/`em` strings pixels. Web output is unchanged.", "date": "2026-11-19T00:00:00.000Z" } diff --git a/libs/extractor/src/native/tests.rs b/libs/extractor/src/native/tests.rs index 554eed9bc..648716e5b 100644 --- a/libs/extractor/src/native/tests.rs +++ b/libs/extractor/src/native/tests.rs @@ -76,9 +76,9 @@ fn compile(code: &str) -> String { )] #[case::dynamic_groups( "dynamic_groups", - r#""# + aspectRatio={ar} lineHeight={lh} fontWeight={fw} color={c} display={d} boxShadow={bs} />" )] #[case::dynamic_in_conditions( "dynamic_in_conditions",