From 7b665cd930503b83af90eb9822ee6f65cf6e6a52 Mon Sep 17 00:00:00 2001 From: owjs3901 Date: Thu, 19 Nov 2026 22:55:12 +0900 Subject: [PATCH 01/40] 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 02/40] 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 03/40] 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 04/40] 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", From f0c31adedc5ab67f0772cd37251c02be627f68d8 Mon Sep 17 00:00:00 2001 From: owjs3901 Date: Fri, 20 Nov 2026 06:56:14 +0900 Subject: [PATCH 05/40] feat(metro-plugin): compile Devup UI for React Native in Metro Add @devup-ui/metro-plugin (experimental, private 0.x): withDevupUI() points babelTransformerPath at a transformer that runs codeExtractNative on files importing Devup UI and chains to the upstream transformer (the config's, else Expo's, else React Native's). Build errors carry loc and a code frame so Metro reports file:line:col, the upstream AST locations are moved back to the source through the engine's map, and the cache key covers the upstream key, devup.json, the engine version and the options. Add apps/expo (Expo SDK 58, RN 0.88) and a path-filtered CI job that exports iOS and Android bundles and checks no @devup-ui/react module or runtime placeholder is left. Part of #411. Co-Authored-By: Claude Opus 5.5 --- .changepacks/changepack_log_metro_plugin.json | 7 + .github/workflows/publish.yml | 62 + apps/expo/.gitignore | 2 + apps/expo/app.json | 8 + apps/expo/check-bundle.mjs | 50 + apps/expo/index.ts | 5 + apps/expo/metro.config.js | 4 + apps/expo/package.json | 22 + apps/expo/src/App.tsx | 61 + apps/expo/tsconfig.json | 6 + bun.lock | 1227 ++++++++++++++++- package.json | 2 +- packages/metro-plugin/README.md | 98 ++ packages/metro-plugin/package.json | 56 + .../metro-plugin/src/__tests__/index.test.ts | 20 + .../src/__tests__/located-error.test.ts | 69 + .../metro-plugin/src/__tests__/plugin.test.ts | 160 +++ .../src/__tests__/settings.test.ts | 44 + .../src/__tests__/source-map.test.ts | 75 + .../src/__tests__/transform.test.ts | 299 ++++ .../src/__tests__/transformer.test.ts | 57 + packages/metro-plugin/src/index.ts | 11 + packages/metro-plugin/src/located-error.ts | 83 ++ packages/metro-plugin/src/plugin.ts | 161 +++ packages/metro-plugin/src/settings.ts | 56 + packages/metro-plugin/src/source-map.ts | 134 ++ packages/metro-plugin/src/transform.ts | 216 +++ packages/metro-plugin/src/transformer.ts | 16 + packages/metro-plugin/tsconfig.json | 29 + 29 files changed, 3000 insertions(+), 40 deletions(-) create mode 100644 .changepacks/changepack_log_metro_plugin.json create mode 100644 apps/expo/.gitignore create mode 100644 apps/expo/app.json create mode 100644 apps/expo/check-bundle.mjs create mode 100644 apps/expo/index.ts create mode 100644 apps/expo/metro.config.js create mode 100644 apps/expo/package.json create mode 100644 apps/expo/src/App.tsx create mode 100644 apps/expo/tsconfig.json create mode 100644 packages/metro-plugin/README.md create mode 100644 packages/metro-plugin/package.json create mode 100644 packages/metro-plugin/src/__tests__/index.test.ts create mode 100644 packages/metro-plugin/src/__tests__/located-error.test.ts create mode 100644 packages/metro-plugin/src/__tests__/plugin.test.ts create mode 100644 packages/metro-plugin/src/__tests__/settings.test.ts create mode 100644 packages/metro-plugin/src/__tests__/source-map.test.ts create mode 100644 packages/metro-plugin/src/__tests__/transform.test.ts create mode 100644 packages/metro-plugin/src/__tests__/transformer.test.ts create mode 100644 packages/metro-plugin/src/index.ts create mode 100644 packages/metro-plugin/src/located-error.ts create mode 100644 packages/metro-plugin/src/plugin.ts create mode 100644 packages/metro-plugin/src/settings.ts create mode 100644 packages/metro-plugin/src/source-map.ts create mode 100644 packages/metro-plugin/src/transform.ts create mode 100644 packages/metro-plugin/src/transformer.ts create mode 100644 packages/metro-plugin/tsconfig.json diff --git a/.changepacks/changepack_log_metro_plugin.json b/.changepacks/changepack_log_metro_plugin.json new file mode 100644 index 000000000..6618f0a2e --- /dev/null +++ b/.changepacks/changepack_log_metro_plugin.json @@ -0,0 +1,7 @@ +{ + "changes": { + "packages/metro-plugin/package.json": "Minor" + }, + "note": "Add `@devup-ui/metro-plugin` (experimental, part of #411): `withDevupUI(metroConfig, options)` points Metro's `babelTransformerPath` at a transformer that compiles each file importing Devup UI for the platform Metro builds with `codeExtractNative`, then hands the code to the upstream transformer (the config's, else Expo's, else React Native's). Build errors show in Metro at the file, line and column with a code frame, and the source map of a compiled file points at the file as written. The cache key covers the upstream key, devup.json and its `extends` chain, the engine version and the options. The package is private and is not published yet.", + "date": "2026-11-20T00:00:00.000Z" +} diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 428d15200..ee225ff41 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -8,6 +8,7 @@ on: branches: - main - feat/napi-binding + - feat/react-native-core # Pull requests and every job below run read-only. Only the `release` and # `deploy-pages` jobs get write permissions, and they run on pushes to main @@ -889,6 +890,67 @@ jobs: working-directory: apps/react-18 run: bun run test:e2e + # Whether this change touches React Native: the extractor's native output, + # the engines, the Metro plugin and its utilities, the Expo app or this + # workflow. The Expo job below runs only then. + native-changes: + runs-on: ubuntu-latest + timeout-minutes: 5 + outputs: + changed: ${{ steps.diff.outputs.changed }} + steps: + - name: Checkout + uses: actions/checkout@v7 + with: + fetch-depth: 0 + - name: Compare with the base + id: diff + shell: bash + env: + BASE: ${{ github.event_name == 'pull_request' && github.event.pull_request.base.sha || github.event.before }} + run: | + set -euo pipefail + if ! git cat-file -e "$BASE^{commit}" 2>/dev/null; then + echo "No base commit to compare with; running the Expo job." + echo "changed=true" >> "$GITHUB_OUTPUT" + exit 0 + fi + files="$(git diff --name-only "$(git merge-base "$BASE" HEAD)" HEAD)" + echo "$files" + if grep -qE '^(libs/extractor/src/native/|libs/binding/|bindings/devup-ui-(binding|wasm)/|packages/(metro-plugin|plugin-utils)/|apps/expo/|\.github/workflows/publish\.yml$)' <<< "$files"; then + echo "changed=true" >> "$GITHUB_OUTPUT" + else + echo "changed=false" >> "$GITHUB_OUTPUT" + fi + + # The Expo example app (apps/expo) bundled for iOS and Android through + # @devup-ui/metro-plugin, as a release build does. Devup UI compiles away, + # so no bundle may keep a module of @devup-ui/react or its runtime + # placeholder. + expo: + needs: [build, native-changes] + if: needs.native-changes.outputs.changed == 'true' + runs-on: ubuntu-latest + timeout-minutes: 30 + steps: + - name: Checkout + uses: actions/checkout@v7 + - *record-runner-image + - *setup-bun + - *restore-bun-cache + - *setup-node + - run: bun install --frozen-lockfile + - *download-build + - *unpack-build + - name: Export the iOS and Android bundles + working-directory: apps/expo + env: + EXPO_NO_TELEMETRY: '1' + run: bun run export + - name: Check the bundles + working-directory: apps/expo + run: bun run check + # @devup-ui/vite-plugin must keep the CSS every server page needs when the # build is vinext/RSC. The fixture shares one Devup UI header between server # list pages and a client page, and the tests read the styles the browser diff --git a/apps/expo/.gitignore b/apps/expo/.gitignore new file mode 100644 index 000000000..776505ab9 --- /dev/null +++ b/apps/expo/.gitignore @@ -0,0 +1,2 @@ +.expo/ +dist/ diff --git a/apps/expo/app.json b/apps/expo/app.json new file mode 100644 index 000000000..ad7952e54 --- /dev/null +++ b/apps/expo/app.json @@ -0,0 +1,8 @@ +{ + "expo": { + "name": "Devup UI Expo", + "slug": "devup-ui-expo", + "version": "0.1.0", + "platforms": ["ios", "android"] + } +} diff --git a/apps/expo/check-bundle.mjs b/apps/expo/check-bundle.mjs new file mode 100644 index 000000000..bed164e51 --- /dev/null +++ b/apps/expo/check-bundle.mjs @@ -0,0 +1,50 @@ +// Checks the bundles `expo export` wrote to dist/ for iOS and Android: Devup +// UI compiled away at build time, so no bundle may hold the runtime +// placeholders of @devup-ui/react or any module of that package, and the +// styles of src/App.tsx must be there as React Native style objects. +import { readdirSync, readFileSync } from 'node:fs' +import { join } from 'node:path' + +const PLACEHOLDER = 'Cannot run on the runtime' +const root = join(import.meta.dirname, 'dist', '_expo', 'static', 'js') +const failures = [] + +/** The sources of a source map, an indexed one (Metro's) included */ +function mapSources(map) { + return map.sections + ? map.sections.flatMap((section) => mapSources(section.map)) + : map.sources +} + +for (const platform of ['ios', 'android']) { + const directory = join(root, platform) + const bundles = readdirSync(directory).filter((file) => file.endsWith('.js')) + if (bundles.length === 0) failures.push(`${platform}: no JavaScript bundle`) + for (const file of bundles) { + const code = readFileSync(join(directory, file), 'utf-8') + if (code.includes(PLACEHOLDER)) { + failures.push(`${platform}/${file}: holds "${PLACEHOLDER}"`) + } + for (const style of ['backgroundColor:"#5a44ff"', 'StyleSheet']) { + if (!code.replaceAll(' ', '').includes(style)) { + failures.push(`${platform}/${file}: lacks ${style}`) + } + } + const sources = mapSources( + JSON.parse(readFileSync(join(directory, `${file}.map`), 'utf-8')), + ) + for (const source of sources) { + if ( + /(^|[\\/])(@devup-ui[\\/]react|packages[\\/]react)[\\/]/.test(source) + ) { + failures.push(`${platform}/${file}: bundles ${source}`) + } + } + console.info(`${platform}/${file}: ${sources.length} modules, checked`) + } +} + +if (failures.length > 0) { + console.error(failures.join('\n')) + process.exit(1) +} diff --git a/apps/expo/index.ts b/apps/expo/index.ts new file mode 100644 index 000000000..90813e8ed --- /dev/null +++ b/apps/expo/index.ts @@ -0,0 +1,5 @@ +import { registerRootComponent } from 'expo' + +import { App } from './src/App' + +registerRootComponent(App) diff --git a/apps/expo/metro.config.js b/apps/expo/metro.config.js new file mode 100644 index 000000000..4f3f49e0c --- /dev/null +++ b/apps/expo/metro.config.js @@ -0,0 +1,4 @@ +const { getDefaultConfig } = require('expo/metro-config') +const { withDevupUI } = require('@devup-ui/metro-plugin') + +module.exports = withDevupUI(getDefaultConfig(__dirname)) diff --git a/apps/expo/package.json b/apps/expo/package.json new file mode 100644 index 000000000..3a625f4e2 --- /dev/null +++ b/apps/expo/package.json @@ -0,0 +1,22 @@ +{ + "name": "expo-example", + "version": "0.1.0", + "private": true, + "main": "index.ts", + "scripts": { + "start": "expo start", + "export": "expo export --platform ios --platform android --no-bytecode --source-maps", + "check": "node check-bundle.mjs" + }, + "dependencies": { + "@devup-ui/react": "workspace:^", + "expo": "~58.0.26", + "react": "^19.3.1", + "react-native": "0.88.1" + }, + "devDependencies": { + "@devup-ui/metro-plugin": "workspace:^", + "@types/react": "^19.3.0", + "typescript": "^7.0.2" + } +} diff --git a/apps/expo/src/App.tsx b/apps/expo/src/App.tsx new file mode 100644 index 000000000..cfc2850ad --- /dev/null +++ b/apps/expo/src/App.tsx @@ -0,0 +1,61 @@ +import { Box, Button, Flex, Image, Input, Text } from '@devup-ui/react' +import { useState } from 'react' + +export function App() { + const [name, setName] = useState('') + const [count, setCount] = useState(0) + return ( + + + + Devup UI on React Native + + + + Your name + + + + {name ? `Hello, ${name}` : 'Type your name'} + + + + + ) +} diff --git a/apps/expo/tsconfig.json b/apps/expo/tsconfig.json new file mode 100644 index 000000000..b9567f605 --- /dev/null +++ b/apps/expo/tsconfig.json @@ -0,0 +1,6 @@ +{ + "extends": "expo/tsconfig.base", + "compilerOptions": { + "strict": true + } +} diff --git a/bun.lock b/bun.lock index 9ffbabf14..dcdb5bfad 100644 --- a/bun.lock +++ b/bun.lock @@ -22,6 +22,21 @@ "typescript": "^7.0.2", }, }, + "apps/expo": { + "name": "expo-example", + "version": "0.1.0", + "dependencies": { + "@devup-ui/react": "workspace:^", + "expo": "~58.0.26", + "react": "^19.3.1", + "react-native": "0.88.1", + }, + "devDependencies": { + "@devup-ui/metro-plugin": "workspace:^", + "@types/react": "^19.3.0", + "typescript": "^7.0.2", + }, + }, "apps/landing": { "name": "landing", "version": "0.1.0", @@ -684,6 +699,18 @@ "typescript-eslint": ">=8.0.0", }, }, + "packages/metro-plugin": { + "name": "@devup-ui/metro-plugin", + "version": "0.0.0", + "dependencies": { + "@devup-ui/binding": "workspace:^", + "@devup-ui/plugin-utils": "workspace:^", + "@devup-ui/wasm": "workspace:^", + }, + "devDependencies": { + "typescript": "^7.0.2", + }, + }, "packages/next-plugin": { "name": "@devup-ui/next-plugin", "version": "1.0.90", @@ -794,6 +821,8 @@ }, }, "packages": { + "2g": ["2g@1.0.1", "", { "peerDependencies": { "typescript": ">=5.8.0" }, "optionalPeers": ["typescript"], "bin": { "2g": "bin/cli.js" } }, "sha512-+uViadKOS/wwR4pFu5g8TPn3QHpKqoX19JHCnp8k/3cLpImdcXozwvZA6Q/5PeW3AcU8neL8faaMidBcv7o8CA=="], + "@adobe/css-tools": ["@adobe/css-tools@4.5.0", "", {}, "sha512-6OzddxPio9UiWTCemp4N8cYLV2ZN1ncRnV1cVGtve7dhPOtRkleRyx32GQCYSwDYgaHU3USMm84tNsvKzRCa1Q=="], "@alloc/quick-lru": ["@alloc/quick-lru@5.3.0", "", {}, "sha512-U4+70Pc5ZS9osnCBCE5Jha/ciHM+Yp+CNMNC/7HvYbNRk1Ldd+f7qO65W5qfhu/TCv+/ozljlXXe9Nj8419DMA=="], @@ -860,8 +889,18 @@ "@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly": ["@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly@7.29.7", "", { "dependencies": { "@babel/helper-plugin-utils": "^7.29.7", "@babel/traverse": "^7.29.7" }, "peerDependencies": { "@babel/core": "^7.0.0" } }, "sha512-pn6QacGLgvCcwc+syUhKE/qSjV2D1IHDB84RNxWYSt1mW3K/SCtjinZ2p0cETJxAWBjPy3K/1lHwG5BjjPxNlw=="], + "@babel/plugin-proposal-decorators": ["@babel/plugin-proposal-decorators@7.29.7", "", { "dependencies": { "@babel/helper-create-class-features-plugin": "^7.29.7", "@babel/helper-plugin-utils": "^7.29.7", "@babel/plugin-syntax-decorators": "^7.29.7" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-EtU0Hi3GvrTqD56xKmZvV/uCXK2ZbwVNPNLAquVItcAZpUhkXwWlo3Fmj0c2LxgSf2I8IDULeAepwNP1OefLXg=="], + + "@babel/plugin-proposal-export-default-from": ["@babel/plugin-proposal-export-default-from@7.29.7", "", { "dependencies": { "@babel/helper-plugin-utils": "^7.29.7" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-p+G5BNXDcy3bOXplhY4HybQ1GxH3i2Tppmdm/3epyRu2VgJJZuUlZ61MqRTg582Q7ZLBdP7fePYvsumSEkMxcQ=="], + "@babel/plugin-proposal-private-property-in-object": ["@babel/plugin-proposal-private-property-in-object@7.21.0-placeholder-for-preset-env.2", "", { "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-SOSkfJDddaM7mak6cPEpswyTRnuRltl429hMraQEglW+OkovnCzsiszTmsrlY//qLFjCpQDFRvjdm2wA5pPm9w=="], + "@babel/plugin-syntax-decorators": ["@babel/plugin-syntax-decorators@7.29.7", "", { "dependencies": { "@babel/helper-plugin-utils": "^7.29.7" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-9MTTLbF39X6sqM92JPEsoI7++26hjZvzkxKZy64aMhWLH2mPkJ/Q3AV4QLmls3R14FpSpkOwQQfUh962JGQxxg=="], + + "@babel/plugin-syntax-dynamic-import": ["@babel/plugin-syntax-dynamic-import@7.8.3", "", { "dependencies": { "@babel/helper-plugin-utils": "^7.8.0" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-5gdGbFon+PszYzqs83S3E5mpi7/y/8M9eC90MRTZfduQOYW76ig6SOSPNe41IG5LoP3FGBn2N0RjVDSQiS94kQ=="], + + "@babel/plugin-syntax-export-default-from": ["@babel/plugin-syntax-export-default-from@7.29.7", "", { "dependencies": { "@babel/helper-plugin-utils": "^7.29.7" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-foag0BB37ROhdeIX9O8G0jX7hw0UekJc04cHMrYLOnrErsnBKqJGHJ8eDRpoCFZBvEPPygmmtw4qyU97qa4oOw=="], + "@babel/plugin-syntax-flow": ["@babel/plugin-syntax-flow@8.0.1", "", { "dependencies": { "@babel/helper-plugin-utils": "^8.0.1" }, "peerDependencies": { "@babel/core": "^8.0.0" } }, "sha512-0cXdg5GCKK+PoV+Anjbi0yAXq/mq1iIRBiMG1REOLc4iLN4jj86dWS08qMatUYAsNMzkcurn4okYHnoy0B1Txg=="], "@babel/plugin-syntax-import-assertions": ["@babel/plugin-syntax-import-assertions@7.29.7", "", { "dependencies": { "@babel/helper-plugin-utils": "^7.29.7" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-/An1OCBN93thpBAGyfsK2pcf0jvju1SAtKkL2Ny++B5Sy6sqgzXDQH1cZxWbF96Wuk+bn41MDA9bLd4VVAw6rw=="], @@ -870,6 +909,10 @@ "@babel/plugin-syntax-jsx": ["@babel/plugin-syntax-jsx@8.0.1", "", { "dependencies": { "@babel/helper-plugin-utils": "^8.0.1" }, "peerDependencies": { "@babel/core": "^8.0.0" } }, "sha512-n0jtCOxEovhU7METqSQjcZO9pX53nu9uNIjMS+hEt+Nt9jA7oOZoBIgbCxhhASmF6T6rPDGge5UAvh6Z4eFz/g=="], + "@babel/plugin-syntax-nullish-coalescing-operator": ["@babel/plugin-syntax-nullish-coalescing-operator@7.8.3", "", { "dependencies": { "@babel/helper-plugin-utils": "^7.8.0" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-aSff4zPII1u2QD7y+F8oDsz19ew4IGEJg9SVW+bqwpwtfFleiQDMdzA/R+UlWDzfnHFCxxleFT0PMIrR36XLNQ=="], + + "@babel/plugin-syntax-optional-chaining": ["@babel/plugin-syntax-optional-chaining@7.8.3", "", { "dependencies": { "@babel/helper-plugin-utils": "^7.8.0" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-KoK9ErH1MBlCPxV0VANkXW2/dw4vlbGDrFgz8bmUsBGYkFRcbRwMh6cIJubdPrkxRwuGdtCk0v/wPTKbQgBjkg=="], + "@babel/plugin-syntax-typescript": ["@babel/plugin-syntax-typescript@8.0.3", "", { "dependencies": { "@babel/helper-plugin-utils": "^8.0.1" }, "peerDependencies": { "@babel/core": "^8.0.0" } }, "sha512-jmTPwps7oSQSZaV1SxkQ3C12UWyufGysGc5OzDpZzvPAIX4mO7dJT3hoqkWVrSImvkcMiknir1iLN1SNV/CZzg=="], "@babel/plugin-syntax-unicode-sets-regex": ["@babel/plugin-syntax-unicode-sets-regex@7.18.6", "", { "dependencies": { "@babel/helper-create-regexp-features-plugin": "^7.18.6", "@babel/helper-plugin-utils": "^7.18.6" }, "peerDependencies": { "@babel/core": "^7.0.0" } }, "sha512-727YkEAPwSIQTv5im8QHz3upqp92JTWhidIC81Tdx4VJYIte/VndKf1qKrfnnhPLiPghStWfvC/iFaMCQu7Nqg=="], @@ -908,6 +951,8 @@ "@babel/plugin-transform-export-namespace-from": ["@babel/plugin-transform-export-namespace-from@7.29.7", "", { "dependencies": { "@babel/helper-plugin-utils": "^7.29.7" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-24B2nOy2TeJSMheqwPD4DDQOV/elLSIlKxjZt4i05H5AgdPdWR3n18HnNrcJ+j76WJd9gbwb9jPjNYUy6RautA=="], + "@babel/plugin-transform-flow-strip-types": ["@babel/plugin-transform-flow-strip-types@7.29.7", "", { "dependencies": { "@babel/helper-plugin-utils": "^7.29.7", "@babel/plugin-syntax-flow": "^7.29.7" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-wRHeUjUjCZnMHmiO5bRgjFLcoEh7JyTdByOW11ahhwNa4V0bmeGEaIvt51yq0zQp2yWIpqfxXXPyUP6GFJZHOQ=="], + "@babel/plugin-transform-for-of": ["@babel/plugin-transform-for-of@7.29.13", "", { "dependencies": { "@babel/helper-plugin-utils": "^7.29.7", "@babel/helper-skip-transparent-expression-wrappers": "^7.29.13" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-dFjiIw+xBYpgLhYDc1QFQOZmMX44se0YCmXUjPsm9SQEj9HaCJAjvVnK6/yK9iE4E1LaKU5fIAKVJPZWCbKwXw=="], "@babel/plugin-transform-function-name": ["@babel/plugin-transform-function-name@7.29.7", "", { "dependencies": { "@babel/helper-compilation-targets": "^7.29.7", "@babel/helper-plugin-utils": "^7.29.7", "@babel/traverse": "^7.29.7" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-otRWaHXE6fbAGkePvaj/kvs3HsqXfPhlnzwSOlnFgbqCPMd975dW+4wZ00WFBt+/YlBGcJwNrARQTOJOb4ZrIg=="], @@ -966,6 +1011,8 @@ "@babel/plugin-transform-reserved-words": ["@babel/plugin-transform-reserved-words@7.29.7", "", { "dependencies": { "@babel/helper-plugin-utils": "^7.29.7" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-5+YhdpVgmfSmwZyLMftfaiffLRMHjzIRHFHHLdibcSyJm2pasMrKHrO3Ptrt2DRshjvpgjEJJ1zVW14WPq/6QA=="], + "@babel/plugin-transform-runtime": ["@babel/plugin-transform-runtime@7.29.7", "", { "dependencies": { "@babel/helper-module-imports": "^7.29.7", "@babel/helper-plugin-utils": "^7.29.7", "babel-plugin-polyfill-corejs2": "^0.4.14", "babel-plugin-polyfill-corejs3": "^0.13.0", "babel-plugin-polyfill-regenerator": "^0.6.5", "semver": "^6.3.1" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-xmAscdE/AsqRW7vutbPNoUmu/nF5SrLKPs7aoJgEjo35lLKA/Bc0i2rMv/hr1+Y0o1bQCiVtith3u2vdgRL39Q=="], + "@babel/plugin-transform-shorthand-properties": ["@babel/plugin-transform-shorthand-properties@7.29.7", "", { "dependencies": { "@babel/helper-plugin-utils": "^7.29.7" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-I+WYbGBAiCn7nA6xBrlgPH+MB7HWb4u8pv5S0Pv7OtwNvIFvCCb24YlttKEeUFVurfBCEaOTnuhlqsb7f0Z5Dg=="], "@babel/plugin-transform-spread": ["@babel/plugin-transform-spread@7.29.11", "", { "dependencies": { "@babel/helper-plugin-utils": "^7.29.7", "@babel/helper-skip-transparent-expression-wrappers": "^7.29.7" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-5xWGhfuMgbOfIjsk/I2c4uMnoqRwQdKYi4QjvybQrcEVE0G9/p3qmIkp2Sxe8YF8DGNNVs5whfwNqIM5684XoQ=="], @@ -1038,6 +1085,8 @@ "@devup-ui/eslint-plugin": ["@devup-ui/eslint-plugin@workspace:packages/eslint-plugin"], + "@devup-ui/metro-plugin": ["@devup-ui/metro-plugin@workspace:packages/metro-plugin"], + "@devup-ui/next-plugin": ["@devup-ui/next-plugin@workspace:packages/next-plugin"], "@devup-ui/plugin-utils": ["@devup-ui/plugin-utils@workspace:packages/plugin-utils"], @@ -1168,6 +1217,78 @@ "@eslint/plugin-kit": ["@eslint/plugin-kit@0.7.3", "", { "dependencies": { "@eslint/core": "^1.2.1", "levn": "^0.4.1" } }, "sha512-IkO+/KEUvwbVpiURZg+P7zF74z5Jxe0UgJxVni+RtoHQ6IZieXaO02kmadomap/q+l6bc/jdPGGqTjhuZnuz1Q=="], + "@expo/cli": ["@expo/cli@58.1.21", "", { "dependencies": { "2g": "^1.0.1", "@expo/code-signing-certificates": "^0.0.7", "@expo/config": "~58.0.12", "@expo/config-plugins": "~58.0.13", "@expo/devcert": "^1.2.2", "@expo/env": "~2.6.0", "@expo/image-utils": "^0.12.7", "@expo/inline-modules": "^0.2.10", "@expo/json-file": "^11.2.1", "@expo/log-box": "^58.0.15", "@expo/log-box-utils": "^58.0.2", "@expo/metro": "~58.0.0", "@expo/metro-config": "58.0.23", "@expo/metro-file-map": "^58.0.6", "@expo/osascript": "^2.8.1", "@expo/package-manager": "^1.14.2", "@expo/platforms": "^58.0.1", "@expo/plist": "^0.10.2", "@expo/prebuild-config": "^58.0.20", "@expo/require-utils": "^58.0.6", "@expo/router-server": "^58.0.23", "@expo/schema-utils": "^58.0.3", "@expo/spawn-async": "^1.8.0", "@expo/ws-tunnel": "^2.0.1", "@expo/xcpretty": "^4.4.6", "@react-native/asset-utils": "0.88.1", "@react-native/dev-middleware": "0.88.1", "@react-native/js-polyfills": "0.88.1", "accepts": "^1.3.8", "agent-cli-detector": "0.1.7", "arg": "^5.0.2", "bplist-creator": "0.1.0", "bplist-parser": "^0.3.1", "chalk": "^4.0.0", "ci-info": "^3.3.0", "compression": "^1.7.4", "connect": "^3.7.0", "dnssd-advertise": "^1.1.6", "expo-server": "^58.1.0", "fetch-nodeshim": "^0.4.10", "lan-network": "^0.2.1", "multitars": "^1.0.2", "node-forge": "^1.4.0", "npm-package-arg": "^11.0.0", "ora": "^3.4.0", "picomatch": "^4.0.4", "pretty-format": "^29.7.0", "progress": "^2.0.3", "prompts": "^2.3.2", "resolve-from": "^5.0.0", "sandbox-cli-detector": "^0.2.0", "semver": "^7.7.4", "send": "^0.19.0", "slugify": "^1.3.4", "stacktrace-parser": "^0.1.10", "structured-headers": "^0.4.1", "terminal-link": "^2.1.1", "tinyglobby": "^0.2.15", "toqr": "^0.1.1", "wrap-ansi": "^7.0.0", "ws": "^8.12.1" }, "peerDependencies": { "expo": "*", "expo-mcp": "*", "expo-router": "*", "react-native": "*" }, "optionalPeers": ["expo-mcp", "expo-router", "react-native"], "bin": { "expo-internal": "bin/cli.js" } }, "sha512-E+27FQ1Y26fVb0p1wVHBFkbe5oQubUXLwF/au5Vy8OCqDWrmbekBQamRI4mBhY15FhZQxAkyK0e6hXcEFKVBOw=="], + + "@expo/code-signing-certificates": ["@expo/code-signing-certificates@0.0.7", "", { "dependencies": { "node-forge": "^1.4.0" } }, "sha512-zP0tnfqrFFRL8INtOaQ6XwEYfdIpIH9vrEo7y0bHQGQa50z4/QWXE5CI4nRUHxqFW4MVWOwXFg1hom1aAZHNkQ=="], + + "@expo/config": ["@expo/config@58.0.12", "", { "dependencies": { "@expo/config-plugins": "~58.0.13", "@expo/config-types": "^58.0.3", "@expo/json-file": "^11.2.1", "@expo/platforms": "^58.0.1", "@expo/require-utils": "^58.0.6", "resolve-workspace-root": "^2.0.0", "semver": "^7.7.4", "slugify": "^1.3.4" } }, "sha512-Ch/4Cb8womWYpY1zI4BEEYT1rGuKti8O8aSzyAM79xNTVRx6nPw2h9j91Knq95OSH3wtjrcthZwVYZ3po4igNg=="], + + "@expo/config-plugins": ["@expo/config-plugins@58.0.13", "", { "dependencies": { "@expo/config-types": "^58.0.3", "@expo/json-file": "~11.2.1", "@expo/plist": "^0.10.2", "@expo/require-utils": "^58.0.6", "@expo/sdk-runtime-versions": "^1.0.1", "chalk": "^4.1.2", "debug": "^4.3.5", "semver": "^7.7.4", "slugify": "^1.6.6", "tinyglobby": "^0.2.15", "xcode": "^4.0.0", "xml2js": "0.6.0" } }, "sha512-Vbkt0vpIJ9z+oCFr2simtfuiPxdpIovDgYnzenC9z7jX0rlo8nTLGQky+q+SJdovIbyymGAO45UR0YqwLgbvKw=="], + + "@expo/config-types": ["@expo/config-types@58.0.3", "", {}, "sha512-wyfrwkTT/hQHzwyqkXkngKxoOa8L6ovsTP4h/UukS1mTmssee5et6HOPoN5RtawdJPnm5JO28f//C/wXlpka8Q=="], + + "@expo/devcert": ["@expo/devcert@1.2.2", "", { "dependencies": { "@expo/sudo-prompt": "^9.3.1", "debug": "^3.1.0" } }, "sha512-wz1YedXwdNbYqk/PRr34vixnuw1+l6uSwmPXUj649cot5iYNccb2zIOnK7Nonb1Pfd/dxAY6CvU6KM3uSdxC7A=="], + + "@expo/devtools": ["@expo/devtools@58.0.2", "", { "dependencies": { "chalk": "^4.1.2" }, "peerDependencies": { "expo": "*", "react": "*", "react-native": "*" }, "optionalPeers": ["expo", "react", "react-native"] }, "sha512-WBj/K+vv8JPSmY70ennL04YYOHkpEsGGkfuVY9lfv4XO7Qhbt5qz4q6W7maME194I5oGcimRMigUFfWNkBe90w=="], + + "@expo/dom-webview": ["@expo/dom-webview@58.0.2", "", { "peerDependencies": { "expo": "*", "react": "*", "react-native": "*" } }, "sha512-bLkREoP7qL3rEuzxP60xG+TjdPoGjbnZfxkvYo5imJxGWfKMOf7x962W06Pu+WWAr4gcDRk16iA+Clg8D0zjCg=="], + + "@expo/env": ["@expo/env@2.6.0", "", { "dependencies": { "chalk": "^4.0.0", "debug": "^4.3.4" } }, "sha512-pSNESQU0IGhLs/A3QlNPoh/acb1vWU7N721OjaIm3JT8yzgZymIM/m4x2y73YwpEtqgwWsCl6+japtq2PtXIPw=="], + + "@expo/fingerprint": ["@expo/fingerprint@0.21.10", "", { "dependencies": { "@expo/env": "^2.6.0", "@expo/spawn-async": "^1.8.0", "arg": "^5.0.2", "chalk": "^4.1.2", "debug": "^4.3.4", "ignore": "^5.3.1", "minimatch": "^10.2.6", "resolve-from": "^5.0.0", "semver": "^7.7.4" }, "bin": { "fingerprint": "bin/cli.js" } }, "sha512-u73rWDHOYijO1wT60uKjtuoGBKsU9/MFSh7WEE63K2jJ0ML8eycUCXF9FmLf3EVzzIjYIPu6Ns04LR7FVGh6mA=="], + + "@expo/image-utils": ["@expo/image-utils@0.12.7", "", { "dependencies": { "@expo/require-utils": "^58.0.6", "@expo/spawn-async": "^1.8.0", "chalk": "^4.0.0", "jimp-compact": "0.16.1", "parse-png": "^2.1.0", "semver": "^7.7.4" } }, "sha512-fuiRQxvvkbj932BamtYh1UKuyRJ5tXBJ3XxpGm5pT4zzynPmygd3RtOQrzIhcsIZGcG6i1n+KvrszYRnk3evqQ=="], + + "@expo/inline-modules": ["@expo/inline-modules@0.2.10", "", { "dependencies": { "@expo/config-plugins": "~58.0.13" } }, "sha512-WFqhlOrUUc0VZxrUPq5X328aP2e/cQKvJJXhwNxNj9fqWS9iFWC1E9VRHHhJIqdu+qy2YU3s2OBDlyIz9X/5aA=="], + + "@expo/json-file": ["@expo/json-file@11.2.1", "", { "dependencies": { "@babel/code-frame": "^7.20.0", "json5": "^2.2.3" } }, "sha512-UPhKoFCj8BcwgLB1rKQ1CuR/REITnZLiqxHEHOeH1tPsdXcHGtUDh0P5bLbr7oU0nKVdtJ5rzyKx8jniMQdESQ=="], + + "@expo/local-build-cache-provider": ["@expo/local-build-cache-provider@58.0.12", "", { "dependencies": { "@expo/config": "~58.0.12", "chalk": "^4.1.2" } }, "sha512-2fpz4A+cf7YybeVx6lc/kulUpMLOv0OrlhdcvOpMCQG/9Wp5IBOZUgykSN86wmU5ZGJe4JeDJ4Soq5H3hfvzIw=="], + + "@expo/log-box": ["@expo/log-box@58.0.15", "", { "dependencies": { "@expo/dom-webview": "^58.0.2", "@expo/log-box-utils": "^58.0.2", "anser": "^1.4.9", "stacktrace-parser": "^0.1.10" }, "peerDependencies": { "expo": "*", "react": "*", "react-native": "*" }, "optionalPeers": ["expo"] }, "sha512-IBpaJcTdJlSqmiEtyI9XDiNPSRUZNpeWdRbzE4ic6I4k17mpy0LxWJ4Mz2hB7B48b9BrleUKFeZ+6VseglmvGQ=="], + + "@expo/log-box-utils": ["@expo/log-box-utils@58.0.2", "", {}, "sha512-My8Lwe9FU/yDwwzqwi5LN2rzzDcJqIAZKrD9f0XHZEKz/FQnWJYdt1rsV7+RwqMGeGq2XsxTCVT1ggTCOvumxw=="], + + "@expo/metro": ["@expo/metro@58.0.0", "", { "dependencies": { "metro": "0.87.1", "metro-babel-transformer": "0.87.1", "metro-cache": "0.87.1", "metro-cache-key": "0.87.1", "metro-config": "0.87.1", "metro-core": "0.87.1", "metro-file-map": "0.87.1", "metro-minify-terser": "0.87.1", "metro-resolver": "0.87.1", "metro-runtime": "0.87.1", "metro-source-map": "0.87.1", "metro-symbolicate": "0.87.1", "metro-transform-plugins": "0.87.1", "metro-transform-worker": "0.87.1" } }, "sha512-PMD640ihB0C3Oqm0AnDVJ/8qF2cKbRUEqGuSOr4tM/OTb9ktxsQqsiSSSeaOEgdCZBq20AxRS0d6WHNhhH2P+g=="], + + "@expo/metro-config": ["@expo/metro-config@58.0.23", "", { "dependencies": { "2g": "^1.0.1", "@babel/code-frame": "^7.20.0", "@babel/core": "^7.20.0", "@babel/generator": "^7.20.5", "@expo/config": "~58.0.12", "@expo/env": "~2.6.0", "@expo/json-file": "~11.2.1", "@expo/metro": "~58.0.0", "@expo/platforms": "^58.0.1", "@expo/require-utils": "^58.0.6", "@expo/spawn-async": "^1.8.0", "@jridgewell/gen-mapping": "^0.3.13", "@jridgewell/remapping": "^2.3.5", "@jridgewell/sourcemap-codec": "^1.5.5", "@jridgewell/trace-mapping": "^0.3.31", "@react-native/js-polyfills": "0.88.1", "browserslist": "^4.25.0", "chalk": "^4.1.0", "debug": "^4.3.2", "hermes-parser": "^0.36.0", "jsc-safe-url": "^0.2.4", "lightningcss": "^1.30.1", "noxcturnal": "^0.1.14", "picomatch": "^4.0.4", "postcss": "^8.5.23", "resolve-from": "^5.0.0", "tinyglobby": "^0.2.15" }, "peerDependencies": { "expo": "*" }, "optionalPeers": ["expo"] }, "sha512-cEFdrMxH4cddH9rHDg2FxUAl4FUC7TBs8d8GYE1r+zXOjsScoKrQhMtLOPqIc2VEj3ehUFvto3EycrEgrWck+A=="], + + "@expo/metro-file-map": ["@expo/metro-file-map@58.0.6", "", { "dependencies": { "2g": "^1.0.1", "debug": "^4.3.4", "fb-watchman": "^2.0.2", "invariant": "^2.2.4", "jest-worker": "^29.7.0", "walker": "^1.0.8" } }, "sha512-+kPFI328BSUxpK7OO0kM31NQlYG/z7WOTISbPEuY4fMZxmN/nLnmJIDNG8NTtM5ZHXlNPqgjRvdukxtsBEkvuw=="], + + "@expo/modules-macros-linux-arm64": ["@expo/modules-macros-linux-arm64@0.33.0", "", { "os": "linux", "cpu": "arm64", "libc": "glibc" }, "sha512-5F4L/IJThOBq3oRo9NB5BI4+Od8K2YDTbU+2IHgsnXsrTc5icQtOlLwHOEfExghjo0PHCXGap4zprfOKvtANxw=="], + + "@expo/modules-macros-linux-x64": ["@expo/modules-macros-linux-x64@0.33.0", "", { "os": "linux", "cpu": "x64", "libc": "glibc" }, "sha512-G3kxfmMpH7BDtoeBVeJA4vh5O3kQ3wmjmSfDremRBWENHKwHJXTOsyerLQqkJC39oPKCuXgXhzvp+/5qy+DyvA=="], + + "@expo/modules-macros-win32-arm64": ["@expo/modules-macros-win32-arm64@0.33.0", "", { "os": "win32", "cpu": "arm64" }, "sha512-sAYEhKqywo+38UcWt1KLNzJkSkpba4HYybSSZfpFsoA28/MCBupFZggkbU/E9z81fZeuiWVA2Ote1fp8ogqRAA=="], + + "@expo/modules-macros-win32-x64": ["@expo/modules-macros-win32-x64@0.33.0", "", { "os": "win32", "cpu": "x64" }, "sha512-O7tmET8ehVpmocxpVUlXkV9yfKCNo3uKvpN7wNyWcJlEIM6xo+WZuN4RDtndExI6CE5wn8Io608US+BYtrE9+w=="], + + "@expo/osascript": ["@expo/osascript@2.8.1", "", { "dependencies": { "@expo/spawn-async": "^1.8.0" } }, "sha512-SCi+6q6uOkGhiAn6AIP/OPFgaIq/iKD2oYpnAOg2rShHStJ8ey7wyT127RbOaZXmlcY/62rHOX1WiiMnD8u/BA=="], + + "@expo/package-manager": ["@expo/package-manager@1.14.2", "", { "dependencies": { "@expo/json-file": "^11.2.1", "@expo/spawn-async": "^1.8.0", "chalk": "^4.0.0", "npm-package-arg": "^11.0.0", "ora": "^3.4.0", "resolve-workspace-root": "^2.0.0" } }, "sha512-sftl0eRVVCarI6grMdjAB3jX2pX1Mt3cdSnajlXS4QyeDkaKRM/ntBy6dcagj1VL0+cEfEqctlyvinmlZdNubg=="], + + "@expo/platforms": ["@expo/platforms@58.0.1", "", {}, "sha512-KtLrtAvpShq16l9lTxd2fZSjULxcGxXrJTHA31iUVqrc+Af7aTAJW4ZB3yQBgi/w+kSb6BB/CG9RXI0ohbMm6g=="], + + "@expo/plist": ["@expo/plist@0.10.2", "", { "dependencies": { "@xmldom/xmldom": "^0.8.8", "xmlbuilder": "^15.1.1" } }, "sha512-kaCDdGLtezkt5s1w7iCaISNJ+RkNac/1yBYYE8XyXLSJu3czGHZKzJGQ8fFOrpEGm6GdlIHFpzVeiF01ZVyHyg=="], + + "@expo/prebuild-config": ["@expo/prebuild-config@58.0.20", "", { "dependencies": { "@expo/config": "~58.0.12", "@expo/config-plugins": "~58.0.13", "@expo/config-types": "^58.0.3", "@expo/image-utils": "^0.12.7", "@expo/json-file": "^11.2.1", "@react-native/normalize-colors": "0.88.1", "debug": "^4.3.1", "expo-modules-autolinking": "~58.1.0", "resolve-from": "^5.0.0", "semver": "^7.7.4" } }, "sha512-lqXK5d6ni2MCNO/MbuXhojKC+Iy/gaYm0a3vVebwf/njoe1Fp3iw8mXDwoofmvlzZ3HO+beL7XCX6e6ZEYmVyg=="], + + "@expo/require-utils": ["@expo/require-utils@58.0.6", "", { "dependencies": { "@babel/code-frame": "^7.20.0", "@babel/core": "^7.25.2", "@babel/plugin-transform-modules-commonjs": "^7.24.8" }, "peerDependencies": { "typescript": "^5.0.0 || ^5.0.0-0 || ^6.0.0 || ^7.0.0" }, "optionalPeers": ["typescript"] }, "sha512-k9Ce7indjY3+nRBNT6wKw7NghN7pP6WhFnYNjuDiAypwjtVgaZHpD9fo0/g3/emDUpM6ebl8Ekz/teyUGfD9og=="], + + "@expo/router-server": ["@expo/router-server@58.0.23", "", { "dependencies": { "debug": "^4.3.4" }, "peerDependencies": { "@expo/metro-runtime": "^58.0.17", "expo": "*", "expo-constants": "^58.0.16", "expo-font": "^58.0.12", "expo-router": "*", "expo-server": "^58.1.0", "react": "*", "react-dom": "*", "react-server-dom-webpack": "~19.0.1 || ~19.1.2 || ~19.2.1 || ~19.3.0" }, "optionalPeers": ["@expo/metro-runtime", "expo-router", "react-dom", "react-server-dom-webpack"] }, "sha512-Vcd/mskn2BSGt9dVAzAKlUFGbagfUlMT3afTgkw7KDpn8pwtkbm6M4g11158OcVSZ10m3VLvoySeZDFPskHLaQ=="], + + "@expo/schema-utils": ["@expo/schema-utils@58.0.3", "", {}, "sha512-DwoMEpT3H+r1lU+YUEP10UcUW7sDKmfvgE7oA+zQeuGyi0XxDSDgRZUUZ5nOGp+lymmTicoIUKkoN7rByuI04g=="], + + "@expo/sdk-runtime-versions": ["@expo/sdk-runtime-versions@1.0.1", "", {}, "sha512-kvisefkhxu8Fm/4M8G6DEqUaigrXfrSOm2lFw7hsk/nq0zchcp6B4wSk8rlheHY8FRi5iHxKtoVMGY/3M6h04A=="], + + "@expo/spawn-async": ["@expo/spawn-async@1.8.0", "", { "dependencies": { "cross-spawn": "^7.0.6" } }, "sha512-eb9xxd/LbuEGSdua4NumCu/McVB9EM+F/JxB9pWgnERw4HQ9XyTNH1KapG6oqLWR8TuRK2LQfzJlmNi94CVobw=="], + + "@expo/sudo-prompt": ["@expo/sudo-prompt@9.3.2", "", {}, "sha512-HHQigo3rQWKMDzYDLkubN5WQOYXJJE2eNqIQC2axC2iO3mHdwnIR7FgZVvHWtBwAdzBgAP0ECp8KqS8TiMKvgw=="], + + "@expo/ws-tunnel": ["@expo/ws-tunnel@2.0.1", "", { "peerDependencies": { "ws": "^8.0.0" } }, "sha512-mljsRffbOHzmSimYQbQu9h9NR3alwCCwEEouRGFL4QRTt8dNvsNtKEPa/5jHmtDLDtsh4xXsWKwzjN9BTpeXHQ=="], + + "@expo/xcpretty": ["@expo/xcpretty@4.4.7", "", { "dependencies": { "@babel/code-frame": "^7.20.0", "chalk": "^4.1.0", "js-yaml": "^4.1.0" }, "bin": { "excpretty": "build/cli.js" } }, "sha512-EbxYllZ7/ozONVZd425cm4XnolfW+AmSFT5aP7Jdno6oc3WrYQcHz2CO20z/2rwWwYgztmV2PXvYH+BQ8YFjqg=="], + "@floating-ui/core": ["@floating-ui/core@1.8.0", "", { "dependencies": { "@floating-ui/utils": "^0.2.12" } }, "sha512-0CIZ5itps/8x7BG8dEIhs53BvCUH2PCoogtakwRTut+Arm58sJooJ0AuZhLw2HJYIR5cMLNPBSS728sPho2khQ=="], "@floating-ui/dom": ["@floating-ui/dom@1.8.0", "", { "dependencies": { "@floating-ui/core": "^1.8.0", "@floating-ui/utils": "^0.2.12" } }, "sha512-yXSrzeHZBTZadLOlfyhCkJHNeLJnHRnRInwdZ40L7ZiaAtrBwoYlsDrX3v5zB1Utk7CLfzcOVnVVWoXEky7Ceg=="], @@ -1256,6 +1377,12 @@ "@isaacs/nonrecursive-glob-match": ["@isaacs/nonrecursive-glob-match@1.1.0", "", {}, "sha512-GPm/Dbvk5RLmhRnxXIa7nTpK0xtl4E0wj0MslsuNiJ1FIROU+2+9lgUC/dgF7Ey4QCWhfEsgxilMRMCdHPfDfw=="], + "@isaacs/ttlcache": ["@isaacs/ttlcache@1.4.1", "", {}, "sha512-RQgQ4uQ+pLbqXfOmieB91ejmLwvSgv9nLx6sT6sD83s7umBypgg+OIBOBbEUiJXrfpnp9j0mRhYYdzp9uqq3lA=="], + + "@jest/schemas": ["@jest/schemas@29.6.3", "", { "dependencies": { "@sinclair/typebox": "^0.27.8" } }, "sha512-mo5j5X+jIZmJQveBKeS/clAueipV7KgiX1vMgCxam1RNYiqE1w62n0/tJJnHtjW8ZHcQco5gY85jA3mi0L+nSA=="], + + "@jest/types": ["@jest/types@29.6.3", "", { "dependencies": { "@jest/schemas": "^29.6.3", "@types/istanbul-lib-coverage": "^2.0.0", "@types/istanbul-reports": "^3.0.0", "@types/node": "*", "@types/yargs": "^17.0.8", "chalk": "^4.0.0" } }, "sha512-u3UPsIilWKOM3F9CXtrG8LEJmNxwoCQC/XVj4IKYXvvpx7QIi/Kg1LI5uDmDpKlac62NUtX7eLjRh+jVZcLOzw=="], + "@joshwooding/vite-plugin-react-docgen-typescript": ["@joshwooding/vite-plugin-react-docgen-typescript@0.7.0", "", { "dependencies": { "glob": "^13.0.1", "react-docgen-typescript": "^2.2.2" }, "peerDependencies": { "typescript": ">= 4.3.x", "vite": "^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0" }, "optionalPeers": ["typescript"] }, "sha512-qvsTEwEFefhdirGOPnu9Wp6ChfIwy2dBCRuETU3uE+4cC+PFoxMSiiEhxk4lOluA34eARHA0OxqsEUYDqRMgeQ=="], "@jridgewell/gen-mapping": ["@jridgewell/gen-mapping@0.3.13", "", { "dependencies": { "@jridgewell/sourcemap-codec": "^1.5.0", "@jridgewell/trace-mapping": "^0.3.24" } }, "sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA=="], @@ -1340,6 +1467,22 @@ "@nodelib/fs.walk": ["@nodelib/fs.walk@1.2.8", "", { "dependencies": { "@nodelib/fs.scandir": "2.1.5", "fastq": "^1.6.0" } }, "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg=="], + "@noxcturnal/noxcturnal-darwin-arm64": ["@noxcturnal/noxcturnal-darwin-arm64@0.1.14", "", { "os": "darwin", "cpu": "arm64" }, "sha512-5g1fvtfmDsaDzNoqZicO7UKUUaGm9HOTJy30KNxXbSJRreLOQwK0fd0wuAA0OEbBgJSQAvVdAovpjT5HvYRIWw=="], + + "@noxcturnal/noxcturnal-darwin-x64": ["@noxcturnal/noxcturnal-darwin-x64@0.1.14", "", { "os": "darwin", "cpu": "x64" }, "sha512-rnZ8LRa+rYOyHmPS2PpPgxRHaeU0zJZ7Ii8huuAMbADfJHGceGBU8SQYqd7+Vs1VwSUcxRm4BMC4+QL1IgdqrA=="], + + "@noxcturnal/noxcturnal-linux-arm64-gnu": ["@noxcturnal/noxcturnal-linux-arm64-gnu@0.1.14", "", { "os": "linux", "cpu": "arm64", "libc": "glibc" }, "sha512-9SZoiNaEKwFJ0V7cgpoCjHLh80fd8/wAJrbG1VWR8DJfkbVBvXhipTnxEISZ0LdidmthpVo0i2GiI6ToUdkmkg=="], + + "@noxcturnal/noxcturnal-linux-arm64-musl": ["@noxcturnal/noxcturnal-linux-arm64-musl@0.1.14", "", { "os": "linux", "cpu": "arm64", "libc": "musl" }, "sha512-dxZXo7Xj00w8eeFac+ev/75lJd/62GSUIX4wwCN2yYn6r9Jrim3DJ6yKVZwmfqHDE0v55TZsif0/vdhNFxFXfQ=="], + + "@noxcturnal/noxcturnal-linux-x64-gnu": ["@noxcturnal/noxcturnal-linux-x64-gnu@0.1.14", "", { "os": "linux", "cpu": "x64", "libc": "glibc" }, "sha512-ek3098/TS+Ma2vJUjzpIZnhU70lryFzFPEdKdQ5u+1w00QKvMg0teFa2mec1H8/ndK74/xYWy8e4d92Uz+s9Dg=="], + + "@noxcturnal/noxcturnal-linux-x64-musl": ["@noxcturnal/noxcturnal-linux-x64-musl@0.1.14", "", { "os": "linux", "cpu": "x64", "libc": "musl" }, "sha512-qblXyvGhD5HoJSK32Q8YN6PnEz4GPXgr2KLgStpRG1oG8+BRPlrqZCaQRbQI5Bn3L8NZ+OjyGWhLEG1kgdzHBw=="], + + "@noxcturnal/noxcturnal-win32-arm64-msvc": ["@noxcturnal/noxcturnal-win32-arm64-msvc@0.1.14", "", { "os": "win32", "cpu": "arm64" }, "sha512-K9Q82l32juE/p7Ca6p36rAWfNzORkCyoL0R2aDUq3tkYOmivu3xTewnxUwDLTzDIuLsMgb4niy5vrtr4IXdNXw=="], + + "@noxcturnal/noxcturnal-win32-x64-msvc": ["@noxcturnal/noxcturnal-win32-x64-msvc@0.1.14", "", { "os": "win32", "cpu": "x64" }, "sha512-qiiOLLQUYnLZai3traWx90yzMLGZlkvwGNYMFkGw5MwnMifVgfl3Z3ooFiSYaVKjkTYqxBF9rOCvhFL6yXaoxA=="], + "@npmcli/config": ["@npmcli/config@8.3.4", "", { "dependencies": { "@npmcli/map-workspaces": "^3.0.2", "@npmcli/package-json": "^5.1.1", "ci-info": "^4.0.0", "ini": "^4.1.2", "nopt": "^7.2.1", "proc-log": "^4.2.0", "semver": "^7.3.5", "walk-up-path": "^3.0.1" } }, "sha512-01rtHedemDNhUXdicU7s+QYz/3JyV5Naj84cvdXGH4mgCdL+agmSYaLF4LUG4vMCLzhBO8YtS0gPpH1FGvbgAw=="], "@npmcli/git": ["@npmcli/git@5.0.8", "", { "dependencies": { "@npmcli/promise-spawn": "^7.0.0", "ini": "^4.1.3", "lru-cache": "^10.0.1", "npm-pick-manifest": "^9.0.0", "proc-log": "^4.0.0", "promise-inflight": "^1.0.1", "promise-retry": "^2.0.1", "semver": "^7.3.5", "which": "^4.0.0" } }, "sha512-liASfw5cqhjNW9UFd+ruwwdEf/lbOAQjLL2XY2dFW/bkJheXDYZgOyul/4gVvEV4BWkTXjYGmDqMw9uegdbJNQ=="], @@ -1506,6 +1649,28 @@ "@popperjs/core": ["@popperjs/core@2.11.8", "", {}, "sha512-P1st0aksCrn9sGZhp8GMYwBnQsbvAWsZAX44oXNNvLHGqAOcoVxmjZiohstwQ7SqKnbR47akdNi+uleWD8+g6A=="], + "@react-native/asset-utils": ["@react-native/asset-utils@0.88.1", "", {}, "sha512-BLb5FF7NgggGYiCsA7KKkK2qFhn0K+6iGXOI+4Ucd+G7Robzw9Gt4WsWwxLt+Od+G+/hyqfz8ASokyWFZ6VcLw=="], + + "@react-native/babel-plugin-codegen": ["@react-native/babel-plugin-codegen@0.88.1", "", { "dependencies": { "@babel/traverse": "^7.29.0", "@react-native/codegen": "0.88.1" } }, "sha512-2r7aeE3dXu3hawHNYHgazWQl9MJNjcnA/gxLApFK2gPMxBCLiQOHVUSaemDQz4mKPs5svulbhtDehxo6LzTzpQ=="], + + "@react-native/codegen": ["@react-native/codegen@0.88.1", "", { "dependencies": { "@babel/core": "^7.25.2", "@babel/parser": "^7.29.0", "flow-parser": "0.327.0", "invariant": "^2.2.4", "nullthrows": "^1.1.1", "tinyglobby": "^0.2.15", "yargs": "^17.6.2" } }, "sha512-URPgPhnsxqeQSLyTRVzhZZ8iNXtZdR1Jop6lqaQacymvl3byghXisNIRR1YyG6PbXUfzPan5Jmz/kPhUUsZ2Yw=="], + + "@react-native/community-cli-plugin": ["@react-native/community-cli-plugin@0.88.1", "", { "dependencies": { "@react-native/asset-utils": "0.88.1", "@react-native/dev-middleware": "0.88.1", "commander": "^12.0.0", "debug": "^4.4.0", "invariant": "^2.2.4", "metro": "^0.87.1", "semver": "^7.1.3" }, "peerDependencies": { "@react-native-community/cli": "*", "@react-native/metro-config": "0.88.1" }, "optionalPeers": ["@react-native-community/cli", "@react-native/metro-config"] }, "sha512-L2CQvzsOMz4oof6AVLSzesFL1Q92nrtXpK0uQH2VwdOmzzgkiHql8WFQSo9VLvMFGJDg8+G6enrHH573ruqqWA=="], + + "@react-native/debugger-frontend": ["@react-native/debugger-frontend@0.88.1", "", {}, "sha512-4ZjH2093hZWWgsYs5ExqjzJX5uCS4R5yZa17eRHsQClUc6RjlV61kLdIk722sQReLL+NYtBn2RJtdcQtLCwiug=="], + + "@react-native/debugger-shell": ["@react-native/debugger-shell@0.88.1", "", { "dependencies": { "cross-spawn": "^7.0.6", "debug": "^4.4.0", "fb-dotslash": "0.5.8" } }, "sha512-vrOLlxkp/417qcSUiS3x3gmdoQHYA/26oEKIWPB4EekJG0uJxKXsMR0tHIDiJWO0JH/2BO3M+507DjR1U74jQg=="], + + "@react-native/dev-middleware": ["@react-native/dev-middleware@0.88.1", "", { "dependencies": { "@isaacs/ttlcache": "^1.4.1", "@react-native/debugger-frontend": "0.88.1", "@react-native/debugger-shell": "0.88.1", "connect": "^3.6.5", "debug": "^4.4.0", "invariant": "^2.2.4", "nullthrows": "^1.1.1", "open": "^8.4.2", "serve-static": "^1.16.2", "ws": "^7.5.10" } }, "sha512-0smOWE3NCdEYUwPiEdiwVXjTdvXcwSejviCM0YZB0Dj6HaQ+uu4hpSrvgERDevr5dvtSaqr8N4TdYZCLXiVgFw=="], + + "@react-native/gradle-plugin": ["@react-native/gradle-plugin@0.88.1", "", {}, "sha512-zalxoJJ/m5kxLnBy9I1zYrx4jaPxPXdys8DeROvrSOa3pSQkTwVVXRZ4FkXCdGodVA9KR2WitplDo/URNjyvFA=="], + + "@react-native/js-polyfills": ["@react-native/js-polyfills@0.88.1", "", {}, "sha512-B62O6zVMYW7kK8dxIuCwpdJ5RYcIvET6ItScm0sfsTibJs+llS0krUVSAOHnEUn3lbFMfw+o+sNdWREOAc6FfQ=="], + + "@react-native/normalize-colors": ["@react-native/normalize-colors@0.88.1", "", {}, "sha512-2SAKiLyZRf+peBLkhhJWGY5vC26w1Uj9QBgUZvjAnOxjgeEKUGBE5riPS0R7+YoqSrRL0w8ucwZB4M+vvy9HMg=="], + + "@react-native/virtualized-lists": ["@react-native/virtualized-lists@0.88.1", "", { "dependencies": { "invariant": "^2.2.4", "nullthrows": "^1.1.1" }, "peerDependencies": { "@types/react": "^19.2.0", "react": "*", "react-native": "0.88.1" }, "optionalPeers": ["@types/react"] }, "sha512-Zt+OGvJE6VgmzgemZL8TSA0VomNWpHMNcG0OvLkkBQEGrzY8OdDHRfjJh7S+f+UFJF77kicRC6o6mt3A7ER9lQ=="], + "@resvg/resvg-wasm": ["@resvg/resvg-wasm@2.4.1", "", {}, "sha512-yi6R0HyHtsoWTRA06Col4WoDs7SvlXU3DLMNP2bdAgs7HK18dTEVl1weXgxRzi8gwLteGUbIg29zulxIB3GSdg=="], "@rolldown/binding-android-arm-eabi": ["@rolldown/binding-android-arm-eabi@1.2.19", "", { "os": "android", "cpu": "arm" }, "sha512-e+Ebe0WT+9tbXmNKPIiC8YrWAHYwug3m6i4p3rZGGulfZri1jtI4HslT+OZnFf/OIHowWF71DTlHwXBP2SiA7A=="], @@ -1638,6 +1803,8 @@ "@shuding/opentype.js": ["@shuding/opentype.js@1.4.0-beta.0", "", { "dependencies": { "fflate": "^0.7.3", "string.prototype.codepointat": "^0.2.1" }, "bin": { "ot": "bin/ot" } }, "sha512-3NgmNyH3l/Hv6EvsWJbsvpcpUba6R8IREQ83nH83cyakCw7uM1arZKNfHwv1Wz6jgqrF/j4x5ELvR6PnK9nTcA=="], + "@sinclair/typebox": ["@sinclair/typebox@0.27.12", "", {}, "sha512-hhyNJ+nbR6ZR7pToHvllEFun9TL0sbL+tk/ON75lo+Xas054uez98qRbsuNt7MBCyZKK4+8Yli/OAGZhmfBZ/g=="], + "@storybook/addon-docs": ["@storybook/addon-docs@10.6.7", "", { "dependencies": { "@mdx-js/react": "^3.0.0", "@storybook/icons": "^2.0.2", "@storybook/react-dom-shim": "10.6.7", "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0", "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0", "ts-dedent": "^2.0.0", "unplugin": "^2.3.5" }, "peerDependencies": { "@types/react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0", "storybook": "^10.6.7" }, "optionalPeers": ["@types/react"] }, "sha512-R0SxB+sv99/V1H51JFh5CjiN5Ufpuh8Bho7iT8hhl1NMGLk76BBqq9l63XgCp4d+1k9mXz7BVu7zFLWdf+j/Rg=="], "@storybook/addon-onboarding": ["@storybook/addon-onboarding@10.6.7", "", { "peerDependencies": { "storybook": "^10.6.7" } }, "sha512-zNB2Ww6YjWV+JnG3jQjp4GE7+8680TlUMl+MPb2vKri36O/xPyD/8J2dZefkrbbN1wGvFqpWDWPDVM1sZhBXjA=="], @@ -1780,6 +1947,12 @@ "@types/is-empty": ["@types/is-empty@1.2.3", "", {}, "sha512-4J1l5d79hoIvsrKh5VUKVRA1aIdsOb10Hu5j3J2VfP/msDnfTdGPmNp2E1Wg+vs97Bktzo+MZePFFXSGoykYJw=="], + "@types/istanbul-lib-coverage": ["@types/istanbul-lib-coverage@2.0.6", "", {}, "sha512-2QF/t/auWm0lsy8XtKVPG19v3sSOQlJe/YHZgfjb/KBBHOGSV+J2q/S671rcq9uTBrLAXmZpqJiaQbMT+zNU1w=="], + + "@types/istanbul-lib-report": ["@types/istanbul-lib-report@3.0.3", "", { "dependencies": { "@types/istanbul-lib-coverage": "*" } }, "sha512-NQn7AHQnk/RSLOxrBbGyJM/aVQ+pjj5HCgasFxc0K/KhoATfQ/47AyUl15I2yBUpihjmas+a+VJBOqecrFH+uA=="], + + "@types/istanbul-reports": ["@types/istanbul-reports@3.0.4", "", { "dependencies": { "@types/istanbul-lib-report": "*" } }, "sha512-pk2B1NWalF9toCRu6gjBzR69syFjP4Od8WRAX+0mmf9lAjCRicLOWc+ZrxZHx/0XRjotgkF9t6iaMJ+aXcOdZQ=="], + "@types/jsesc": ["@types/jsesc@2.5.1", "", {}, "sha512-9VN+6yxLOPLOav+7PwjZbxiID2bVaeq0ED4qSQmdQTdjnXJSaCVKTR58t15oqH1H5t8Ng2ZX1SabJVoN9Q34bw=="], "@types/json-schema": ["@types/json-schema@7.0.15", "", {}, "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA=="], @@ -1822,6 +1995,10 @@ "@types/ws": ["@types/ws@8.18.2", "", { "dependencies": { "@types/node": "*" } }, "sha512-67MQl+fpWKVTT1NYdnmo3U4sc/xPo/zQBncVnI74qmQa0z/b+1g6iYqNmGCPbxO+zz2aklb08a0oHfegiVd0/w=="], + "@types/yargs": ["@types/yargs@17.0.35", "", { "dependencies": { "@types/yargs-parser": "*" } }, "sha512-qUHkeCyQFxMXg79wQfTtfndEC+N9ZZg76HJftDJp+qH2tV7Gj4OJi7l+PiWwJ+pWtW8GwSmqsDj/oymhrTWXjg=="], + + "@types/yargs-parser": ["@types/yargs-parser@21.0.3", "", {}, "sha512-I4q9QU9MQv4oEOz4tAHJtNz1cwuLxn2F3xcc2iV5WdqLPpUnj30aUuxt1mAxYTG+oe8CZMV/+6rU4S4gRDzqtQ=="], + "@typescript-eslint/eslint-plugin": ["@typescript-eslint/eslint-plugin@8.73.0", "", { "dependencies": { "@eslint-community/regexpp": "^4.12.2", "@typescript-eslint/scope-manager": "8.73.0", "@typescript-eslint/type-utils": "8.73.0", "@typescript-eslint/utils": "8.73.0", "@typescript-eslint/visitor-keys": "8.73.0", "ignore": "^7.0.5", "natural-compare": "^1.4.0", "ts-api-utils": "^2.5.0" }, "peerDependencies": { "@typescript-eslint/parser": "^8.73.0", "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", "typescript": ">=4.8.4 <6.1.0" } }, "sha512-UkygMFer53Yzn29MCYFTHf34hGXf5KJhiDWfIm1tXtXRrym1CS6l5H9Y3yCtPWChpC0/f93H88gdj8tN0dd4kw=="], "@typescript-eslint/parser": ["@typescript-eslint/parser@8.73.0", "", { "dependencies": { "@typescript-eslint/scope-manager": "8.73.0", "@typescript-eslint/types": "8.73.0", "@typescript-eslint/typescript-estree": "8.73.0", "@typescript-eslint/visitor-keys": "8.73.0", "debug": "^4.4.3" }, "peerDependencies": { "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", "typescript": ">=4.8.4 <6.1.0" } }, "sha512-AuL45bVcmssHfZ3Di3cs9Q0l4gBm4ZFVrJOQEE7VpqW+PVgQaEwSwazz4TVIiFabXkk6U51EprYDwqw+HR8ePw=="], @@ -1966,6 +2143,8 @@ "@webcontainer/env": ["@webcontainer/env@1.1.1", "", {}, "sha512-6aN99yL695Hi9SuIk1oC88l9o0gmxL1nGWWQ/kNy81HigJ0FoaoTXpytCj6ItzgyCEwA9kF1wixsTuv5cjsgng=="], + "@xmldom/xmldom": ["@xmldom/xmldom@0.8.15", "", {}, "sha512-/5NV/vDALVFDXgLmfsy9TRCBlKwO2LNBFzpzvb9iIj+jR+eSc6DLYYvVOdivT/jm7MtU6TebYuRmzEOI7w40UA=="], + "@xtuc/ieee754": ["@xtuc/ieee754@1.2.0", "", {}, "sha512-DX8nKgqcGwsc0eJSqYt5lwP4DH5FlHnmuWWBRy7X0NcaGR0ZtuyeESgMwTYVEtxmsNGY+qit4QYT/MIYTOTPeA=="], "@xtuc/long": ["@xtuc/long@4.2.2", "", {}, "sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ=="], @@ -2126,6 +2305,8 @@ "abbrev": ["abbrev@2.0.0", "", {}, "sha512-6/mh1E2u2YgEsCHdY0Yx5oW+61gZU+1vXaoiHHrpKeuRNNgFvS+/jrwHiQhB5apAf5oB7UB7E19ol2R2LKH8hQ=="], + "accepts": ["accepts@1.3.8", "", { "dependencies": { "mime-types": "~2.1.34", "negotiator": "0.6.3" } }, "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw=="], + "acorn": ["acorn@8.19.0", "", { "bin": { "acorn": "bin/acorn" } }, "sha512-oJlA3XiRm7Cyk6qFD2Jn8ak9B7jSy0qy00ADO3+8dpT0LSjFihQYv4C02LFCSYJV3Q37xYwwRy5m+IpIiUzqWw=="], "acorn-jsx": ["acorn-jsx@5.3.2", "", { "peerDependencies": { "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" } }, "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ=="], @@ -2134,18 +2315,32 @@ "acorn-walk": ["acorn-walk@8.3.5", "", { "dependencies": { "acorn": "^8.11.0" } }, "sha512-HEHNfbars9v4pgpW6SO1KSPkfoS0xVOM/9UzkJltjlsHZmJasxg8aXkuZa7SMf8vKGIBhpUsPluQSqhJFCqebw=="], + "agent-base": ["agent-base@7.1.4", "", {}, "sha512-MnA+YT8fwfJPgBx3m60MNqakm30XOkyIoH1y6huTQvC0PwZG7ki8NacLBcrPbNoo8vEZy7Jpuk7+jMO+CUovTQ=="], + + "agent-cli-detector": ["agent-cli-detector@0.1.7", "", { "bin": { "agent-cli-detector": "dist/cli.js" } }, "sha512-d8OWDVdZMgjhLUT9ZPgSv/BdFFF9pVuscC0JdUSz3bjwE15gcp6u/o0/JooM2yyAWC49KThFhXlgTXRa9B7yng=="], + "ajv": ["ajv@6.15.0", "", { "dependencies": { "fast-deep-equal": "^3.1.1", "fast-json-stable-stringify": "^2.0.0", "json-schema-traverse": "^0.4.1", "uri-js": "^4.2.2" } }, "sha512-fgFx7Hfoq60ytK2c7DhnF8jIvzYgOMxfugjLOSMHjLIPgenqa7S7oaagATUq99mV6IYvN2tRmC0wnTYX6iPbMw=="], "ajv-formats": ["ajv-formats@3.0.1", "", { "dependencies": { "ajv": "^8.0.0" } }, "sha512-8iUql50EUR+uUcdRQ3HDqa6EVyo3docL8g5WJ3FNcWmu62IbkGUue/pEyLBW8VGKKucTPgqeks4fIU1DA4yowQ=="], + "anser": ["anser@1.4.10", "", {}, "sha512-hCv9AqTQ8ycjpSd3upOJd7vFwW1JaoYQ7tpham03GJ1ca8/65rqn0RpaWpItOAd6ylW9wAw6luXYPJIyPFVOww=="], + + "ansi-escapes": ["ansi-escapes@4.3.2", "", { "dependencies": { "type-fest": "^0.21.3" } }, "sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ=="], + "ansi-regex": ["ansi-regex@5.0.1", "", {}, "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ=="], "ansi-sequence-parser": ["ansi-sequence-parser@1.1.1", "", {}, "sha512-vJXt3yiaUL4UU546s3rPXlsry/RnM730G1+HkpKE012AN0sx1eOrxSu95oKDIonskeLTijMgqWZ3uDEe3NFvyg=="], "ansi-styles": ["ansi-styles@5.2.0", "", {}, "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA=="], + "arg": ["arg@5.0.2", "", {}, "sha512-PYjyFOLKQ9y57JvQ6QLo8dAgNqswh8M1RMJYdQduT6xbWSgK36P/Z/v+p888pM69jMMfS8Xd8F6I1kQ/I9HUGg=="], + + "argparse": ["argparse@2.0.1", "", {}, "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q=="], + "aria-query": ["aria-query@5.3.0", "", { "dependencies": { "dequal": "^2.0.3" } }, "sha512-b0P0sZPKtyu8HkeRAfCq0IfURZK+SuwMjY1UXGBU27wpAiTwQAIlq56IbIO+ytk/JjS1fMR14ee5WBBfKi5J6A=="], + "asap": ["asap@2.0.6", "", {}, "sha512-BSHWgDSAiKs50o2Re8ppvp3seVHXSRM44cdSsT9FfNEUUZLOGWVCsiWaRPWM1Znn+mqZ1OfVZ3z3DWEzSp7hRA=="], + "assertion-error": ["assertion-error@2.0.1", "", {}, "sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA=="], "ast-types": ["ast-types@0.16.3", "", { "dependencies": { "tslib": "^2.0.1" } }, "sha512-FvWoWYfSCM6kRxCSH+MGLHIKKGRL6A6AW7Zek2O32REPQRdg131428uRTKMBYAeRd3XXAaHDS60Wpri7CdKDrA=="], @@ -2164,18 +2359,32 @@ "babel-plugin-react-compiler": ["babel-plugin-react-compiler@1.0.0", "", { "dependencies": { "@babel/types": "^7.26.0" } }, "sha512-Ixm8tFfoKKIPYdCCKYTsqv+Fd4IJ0DQqMyEimo+pxUOMUR9cVPlwTrFt9Avu+3cb6Zp3mAzl+t1MrG2fxxKsxw=="], + "babel-plugin-react-native-web": ["babel-plugin-react-native-web@0.21.4", "", {}, "sha512-FSclsDTGi5EcvpbW3TM7s8GLWwQqo5wI9zQqJr2m0IoJRenSkp1+bVvdeZXTNznI5Ms9Bry7DLBR+C5Shb9gtw=="], + + "babel-plugin-syntax-hermes-parser": ["babel-plugin-syntax-hermes-parser@0.36.1", "", { "dependencies": { "hermes-parser": "0.36.1" } }, "sha512-ycduwJbvdvIMmVvlAZqGggS+pm5Eu4Bk9pcV9Sm2Z4PJNRVsKkv0g7vHj+LeuC1gHTeF67sJXFOq61IlqCa2hA=="], + + "babel-plugin-transform-flow-enums": ["babel-plugin-transform-flow-enums@0.0.2", "", { "dependencies": { "@babel/plugin-syntax-flow": "^7.12.1" } }, "sha512-g4aaCrDDOsWjbm0PUUeVnkcVd6AKJsVc/MbnPhEotEpkeJQP6b8nzewohQi7+QS8UyPehOhGWn0nOwjvWpmMvQ=="], + + "babel-preset-expo": ["babel-preset-expo@58.0.26", "", { "dependencies": { "@babel/generator": "^7.20.5", "@babel/helper-module-imports": "^7.25.9", "@babel/plugin-proposal-decorators": "^7.12.9", "@babel/plugin-proposal-export-default-from": "^7.24.7", "@babel/plugin-syntax-dynamic-import": "^7.8.3", "@babel/plugin-syntax-export-default-from": "^7.24.7", "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.3", "@babel/plugin-syntax-optional-chaining": "^7.8.3", "@babel/plugin-transform-async-generator-functions": "^7.25.4", "@babel/plugin-transform-async-to-generator": "^7.24.7", "@babel/plugin-transform-block-scoping": "^7.25.0", "@babel/plugin-transform-class-properties": "^7.25.4", "@babel/plugin-transform-class-static-block": "^7.27.1", "@babel/plugin-transform-classes": "^7.25.4", "@babel/plugin-transform-destructuring": "^7.24.8", "@babel/plugin-transform-export-namespace-from": "^7.25.9", "@babel/plugin-transform-flow-strip-types": "^7.25.2", "@babel/plugin-transform-for-of": "^7.24.7", "@babel/plugin-transform-logical-assignment-operators": "^7.24.7", "@babel/plugin-transform-modules-commonjs": "^7.24.8", "@babel/plugin-transform-named-capturing-groups-regex": "^7.24.7", "@babel/plugin-transform-nullish-coalescing-operator": "^7.24.7", "@babel/plugin-transform-object-rest-spread": "^7.24.7", "@babel/plugin-transform-optional-catch-binding": "^7.24.7", "@babel/plugin-transform-optional-chaining": "^7.24.8", "@babel/plugin-transform-parameters": "^7.24.7", "@babel/plugin-transform-private-methods": "^7.24.7", "@babel/plugin-transform-private-property-in-object": "^7.24.7", "@babel/plugin-transform-react-display-name": "^7.24.7", "@babel/plugin-transform-react-jsx": "^7.28.6", "@babel/plugin-transform-react-jsx-development": "^7.27.1", "@babel/plugin-transform-react-pure-annotations": "^7.27.1", "@babel/plugin-transform-runtime": "^7.24.7", "@babel/plugin-transform-typescript": "^7.25.2", "@babel/plugin-transform-unicode-regex": "^7.24.7", "@babel/preset-typescript": "^7.23.0", "@react-native/babel-plugin-codegen": "0.88.1", "babel-plugin-react-compiler": "^1.0.0", "babel-plugin-react-native-web": "~0.21.4", "babel-plugin-syntax-hermes-parser": "^0.36.0", "babel-plugin-transform-flow-enums": "^0.0.2", "debug": "^4.3.4" }, "peerDependencies": { "@babel/runtime": "^7.20.0", "expo": "*", "expo-widgets": "^58.0.29", "react-refresh": ">=0.14.0 <1.0.0" }, "optionalPeers": ["@babel/runtime", "expo", "expo-widgets"] }, "sha512-ZCH0nRF6T5Txn2r7FqY66xcYN2ni80WzH3snBA0pFGHZpMeSgaADnb5jJmPGEnWKcb7p34ViGFf17jXoFQ1zGg=="], + "bail": ["bail@2.0.2", "", {}, "sha512-0xO6mYd7JB2YesxDKplafRpsiOzPt9V02ddPCLbY1xYGPOX24NTyN50qnUxgCPcSoYMhKpAuBTjQoRZCAkUDRw=="], "balanced-match": ["balanced-match@4.0.4", "", {}, "sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA=="], - "base64-js": ["base64-js@0.0.8", "", {}, "sha512-3XSA2cR/h/73EzlXXdU6YNycmYI7+kicTxks4eJg2g39biHR84slg2+des+p7iHYhbRg/udIS4TD53WabcOUkw=="], + "base64-js": ["base64-js@1.5.1", "", {}, "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA=="], "baseline-browser-mapping": ["baseline-browser-mapping@2.11.38", "", { "bin": { "baseline-browser-mapping": "dist/cli.cjs" } }, "sha512-rMgy5YW7x28SMfXHLlVZDBqlWzYZ0x2rVR/6FWrNBF0chjigARK1H6nM0hKA1Um3kPOlkQFVtjJs00d2N1ezuw=="], + "big-integer": ["big-integer@1.6.52", "", {}, "sha512-QxD8cf2eVqJOOz63z6JIN9BzvVs/dlySa5HGSBH5xtR8dPteIRQnBxxKqkNTiT6jbDTF6jAfrd4oMcND9RGbQg=="], + "big.js": ["big.js@5.2.2", "", {}, "sha512-vyL2OymJxmarO8gxMr0mhChsO9QGwhynfuu4+MHTAW6czfq9humCB7rKpUjDd9YUiDPU4mzpyupFSvOClAwbmQ=="], "body-scroll-lock": ["body-scroll-lock@4.0.0-beta.0", "", {}, "sha512-a7tP5+0Mw3YlUJcGAKUqIBkYYGlYxk2fnCasq/FUph1hadxlTRjF+gAcZksxANnaMnALjxEddmSi/H3OR8ugcQ=="], + "bplist-creator": ["bplist-creator@0.1.0", "", { "dependencies": { "stream-buffers": "2.2.x" } }, "sha512-sXaHZicyEEmY86WyueLTQesbeoH/mquvarJaQNbjuOQO+7gbFcDEWqKmcWA4cOTLzFlfgvkiVxolk1k5bBIpmg=="], + + "bplist-parser": ["bplist-parser@0.3.1", "", { "dependencies": { "big-integer": "1.6.x" } }, "sha512-PyJxiNtA5T2PlLIeBot4lbp7rj4OadzjnMZD/G5zuBNt8ei/yCU7+wW0h2bag9vr8c+/WuRWmSxbqAl9hL1rBA=="], + "brace-expansion": ["brace-expansion@5.0.13", "", { "dependencies": { "balanced-match": "^4.0.2" } }, "sha512-Vh3dmFbc4wZeox7M9I/0L9GfFd83Su4+yCck/OF9Gi/P/dAHn0RT7X4K9R7gMNMhDck3DvhR6QXsnQdjjgwNvQ=="], "braces": ["braces@3.0.3", "", { "dependencies": { "fill-range": "^7.1.1" } }, "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA=="], @@ -2184,6 +2393,8 @@ "browserslist": ["browserslist@4.21.5", "", { "dependencies": { "caniuse-lite": "^1.0.30001449", "electron-to-chromium": "^1.4.284", "node-releases": "^2.0.8", "update-browserslist-db": "^1.0.10" }, "bin": { "browserslist": "cli.js" } }, "sha512-tUkiguQGW7S3IhB7N+c2MV/HZPSCPAAiYBZXLsBhFB/PCy6ZKKsZrmBayHV9fdGV/ARIfJ14NkxKzRDjvp7L6w=="], + "bser": ["bser@2.1.2", "", { "dependencies": { "node-int64": "^0.4.0" } }, "sha512-V2o8YS2EhrKMO9AumnkK0ynynfFlsajpYupwq7S46H5mhcanwxDkNTw3K67wPIcKTH1ffkA4vhMOtAc7gRmPZw=="], + "buffer-from": ["buffer-from@1.1.2", "", {}, "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ=="], "buffer-image-size": ["buffer-image-size@0.6.4", "", { "dependencies": { "@types/node": "*" } }, "sha512-nEh+kZOPY1w+gcCMobZ6ETUp9WfibndnosbpwB1iJk/8Gt5ZF2bhS6+B6bPYz424KtwsR6Rflc3tCz1/ghX2dQ=="], @@ -2194,6 +2405,8 @@ "bundle-name": ["bundle-name@4.1.1", "", { "dependencies": { "run-applescript": "^7.0.0" } }, "sha512-DdH81/zPLVS11EUgWq3tEu/xn+EzljlMYooDNdzWEnFha3R3NBMpMV1UqYIpjYHV/SgpFKMIX1Oh7o06SjM/oA=="], + "bytes": ["bytes@3.1.2", "", {}, "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg=="], + "cac": ["cac@7.1.0", "", {}, "sha512-LMDU/U2yA4IPIY8KT0NsNPWEYZvAMkbgyspxJ6btJaYV+WMDOHAZCmB0lsTObiHaRS1V/ztKAl7+TSkTqXyeoA=="], "cacheable": ["cacheable@2.5.0", "", { "dependencies": { "@cacheable/memory": "^2.2.0", "@cacheable/utils": "^2.5.0", "hookified": "^1.15.0", "keyv": "^5.6.0", "qified": "^0.10.1" } }, "sha512-60cyAOytib/OzBw1JNSoSV/boK1AtHryDIjvVBk7XbN4ugfkM3+Sry7fEjNgPMGgOjuaZPAp8ruZ0Cxafwyq9g=="], @@ -2210,6 +2423,8 @@ "chai": ["chai@5.3.3", "", { "dependencies": { "assertion-error": "^2.0.1", "check-error": "^2.1.1", "deep-eql": "^5.0.1", "loupe": "^3.1.0", "pathval": "^2.0.0" } }, "sha512-4zNhdJD/iOjSH0A05ea+Ke6MU5mmpQcbQsSOkgdaUMJ9zTlDTD/GYlwohmIE2u0gaxHYiVHEn1Fw9mZ/ktJWgw=="], + "chalk": ["chalk@4.1.2", "", { "dependencies": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" } }, "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA=="], + "character-entities": ["character-entities@2.0.2", "", {}, "sha512-shx7oQ0Awen/BRIdkjkvz54PnEEI/EjwXDSIZp86/KKdbafHh1Df/RYGBhn4hbe2+uKC9FnT5UCEdyPz3ai9hQ=="], "character-entities-html4": ["character-entities-html4@2.1.0", "", {}, "sha512-1v7fgQRj6hnSwFpq1Eu0ynr/CDEw0rXo2B61qXrLNdHZmPKgb7fqS1a2JwF0rISo9q77jDI8VMEHoApn8qDoZA=="], @@ -2222,13 +2437,19 @@ "chrome-trace-event": ["chrome-trace-event@1.0.4", "", {}, "sha512-rNjApaLzuwaOTjCiT8lSDdGN1APCiqkChLMJxJPWLunPAt5fy8xgU9/jNOchV84wfIxrA0lRQB7oCT8jrn/wrQ=="], - "ci-info": ["ci-info@4.5.0", "", {}, "sha512-d1uM8k5UZEyPza1n/MG3ko8nKupKN0KJpFsipgPcgaCCvV+IqIfJ+NzTjetlLM+UcXZx3+cLrNr76+eAO7G1Mw=="], + "ci-info": ["ci-info@3.9.0", "", {}, "sha512-NIxF55hv4nSqQswkAeiOi1r83xy8JldOFDTWiug55KBu9Jnblncd2U6ViHmYgHf01TPZS77NJBhBMKdWj9HQMQ=="], "citty": ["citty@0.2.2", "", {}, "sha512-+6vJA3L98yv+IdfKGZHBNiGW5KHn22e/JwID0Strsz8h4S/csAu/OuICwxrg44k5MRiZHWIo8XXuJgQTriRP4w=="], + "cli-cursor": ["cli-cursor@2.1.0", "", { "dependencies": { "restore-cursor": "^2.0.0" } }, "sha512-8lgKz8LmCRYZZQDpRyT2m5rKJ08TnU4tR9FFFW2rxpxR1FzWi4PQ/NfyODchAatHaUgnSPVcx/R5w6NuTBzFiw=="], + + "cli-spinners": ["cli-spinners@2.9.2", "", {}, "sha512-ywqV+5MmyL4E7ybXgKys4DugZbX0FC6LnwrhjuykIjnK9k8OQacQ7axGKnjDXWNhns0xot3bZI5h55H8yo9cJg=="], + "client-only": ["client-only@0.0.1", "", {}, "sha512-IV3Ou0jSMzZrd3pZ48nLkT9DA7Ag1pnPzaiQhpW7c3RbcqqzvzzVu+L8gfqMp/8IM2MQtSiqaCxrrcfu8I8rMA=="], - "cliui": ["cliui@6.0.0", "", { "dependencies": { "string-width": "^4.2.0", "strip-ansi": "^6.0.0", "wrap-ansi": "^6.2.0" } }, "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ=="], + "cliui": ["cliui@8.0.1", "", { "dependencies": { "string-width": "^4.2.0", "strip-ansi": "^6.0.1", "wrap-ansi": "^7.0.0" } }, "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ=="], + + "clone": ["clone@1.0.4", "", {}, "sha512-JQHZ2QMW6l3aH/j6xCqQThY/9OH4D/9ls34cgkUBiEeocRTU04tHfKPBsUK1PqZCUQM7GiA0IIXJSuXHI64Kbg=="], "clsx": ["clsx@2.1.1", "", {}, "sha512-eYm0QWBtUrBWZWG0d386OGAw16Z995PiOVo2B7bjWSbHedGl5e0ZWaq65kOGgUSNesEIDkB9ISbTg/JK9dhCZA=="], @@ -2248,12 +2469,18 @@ "compare-versions": ["compare-versions@6.1.1", "", {}, "sha512-4hm4VPpIecmlg59CHXnRDnqGplJFrbLG4aFEl5vl6cK1u76ws3LLvX7ikFnTDl5vo39sjWD6AaDPYodJp/NNHg=="], + "compressible": ["compressible@2.0.18", "", { "dependencies": { "mime-db": ">= 1.43.0 < 2" } }, "sha512-AF3r7P5dWxL8MxyITRMlORQNaOA2IkAFaTr4k7BUumjPtRpGDTZpl0Pb1XCO6JeDCBdp126Cgs9sMxqSjgYyRg=="], + + "compression": ["compression@1.8.2", "", { "dependencies": { "bytes": "3.1.2", "compressible": "~2.0.18", "debug": "2.6.9", "destroy": "1.2.0", "negotiator": "~0.6.4", "on-headers": "~1.1.0", "safe-buffer": "5.2.1", "vary": "~1.1.2" } }, "sha512-o8vI5RE5A6EVVOd9o41jKp41aJom+QTEO/Bx8MYNjexMo/Bv2WOjUfZr+aL0WnYSgymUy6zeguqLTsIhV0gMvQ=="], + "concat-map": ["concat-map@0.0.1", "", {}, "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg=="], "concat-stream": ["concat-stream@2.0.0", "", { "dependencies": { "buffer-from": "^1.0.0", "inherits": "^2.0.3", "readable-stream": "^3.0.2", "typedarray": "^0.0.6" } }, "sha512-MWufYdFw53ccGjCA+Ol7XJYpAlW6/prSMzuPOTRnJGcGzuhLn4Scrz7qf6o8bROZ514ltazcIFJZevcfbo0x7A=="], "confbox": ["confbox@0.3.2", "", {}, "sha512-ZUAKhKlkCOrIGKc8cj7zek9s9z1mveHif/25nUshI2BzCRzF7KH7KHa+Lnh2ubq+e1tIlaFuP763mzW4qVoehg=="], + "connect": ["connect@3.7.0", "", { "dependencies": { "debug": "2.6.9", "finalhandler": "1.1.2", "parseurl": "~1.3.3", "utils-merge": "1.0.1" } }, "sha512-ZqRXc+tZukToSNmh5C2iWMSoV3X1YUcPbqEM4DkEG5tNQXrQUZCNVGGv3IuicnkMtPfGf3Xtp8WCXs295iQ1pQ=="], + "content-type": ["content-type@2.1.0", "", {}, "sha512-mj7UPXE0jaqaOsukNZRUEfEi2AcL7C/vwmwcHV0O97eO1E1pxBZuyjlZrx5seTaNBg1U6+o35wpa35Qfcc+7ag=="], "convert-source-map": ["convert-source-map@2.0.0", "", {}, "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg=="], @@ -2304,16 +2531,24 @@ "default-browser-id": ["default-browser-id@5.0.1", "", {}, "sha512-x1VCxdX4t+8wVfd1so/9w+vQ4vx7lKd2Qp5tDRutErwmR85OgmfX7RlLRMWafRMY7hbEiXIbudNrjOAPa/hL8Q=="], + "defaults": ["defaults@1.0.4", "", { "dependencies": { "clone": "^1.0.2" } }, "sha512-eFuaLoy/Rxalv2kr+lqMlUnrDWV+3j4pljOIJgLIhI058IQfWJ7vXhyEIHu+HtC738klGALYxOKDO0bQP3tg8A=="], + "define-lazy-prop": ["define-lazy-prop@3.0.0", "", {}, "sha512-N+MeXYoqr3pOgn8xfyRPREN7gHakLYjhsHhWGT3fWAiL4IkAt0iDw14QiiEm2bE30c5XX5q0FtAA3CK5f9/BUg=="], + "depd": ["depd@2.0.0", "", {}, "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw=="], + "dequal": ["dequal@2.0.3", "", {}, "sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA=="], + "destroy": ["destroy@1.2.0", "", {}, "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg=="], + "detect-libc": ["detect-libc@2.1.2", "", {}, "sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ=="], "devlop": ["devlop@1.1.0", "", { "dependencies": { "dequal": "^2.0.0" } }, "sha512-RWmIqhcFf1lRYBvNmr7qTNuyCt/7/ns2jbpp1+PalgE/rDQcBT0fioSMUpJ93irlUhC5hrg4cYqe6U+0ImW0rA=="], "diff-sequences": ["diff-sequences@29.6.3", "", {}, "sha512-EjePK1srD3P08o2j4f0ExnylqRs5B9tJjcp9t1krH2qRi8CCdsYfwe9JgSLurFBWwq4uOlipzfk5fHNvwFKr8Q=="], + "dnssd-advertise": ["dnssd-advertise@1.1.6", "", {}, "sha512-Ndrrf6BMPalkQPd/zubL+4YghH2J9NspapQ09uDXwYbvOPkP0oaqf5CkcwJ0b50kS2O3ul6yVu+jz+RY62Cejg=="], + "doctrine": ["doctrine@3.0.0", "", { "dependencies": { "esutils": "^2.0.2" } }, "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w=="], "dom-accessibility-api": ["dom-accessibility-api@0.5.16", "", {}, "sha512-X7BJ2yElsnOJ30pZF4uIIDfBEVgF4XEBxL9Bxhy6dnrm5hkzqmsWHGTiHqRiITNhMyFLyAiWndIJP7Z1NTteDg=="], @@ -2322,9 +2557,11 @@ "eastasianwidth": ["eastasianwidth@0.2.0", "", {}, "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA=="], + "ee-first": ["ee-first@1.1.1", "", {}, "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow=="], + "electron-to-chromium": ["electron-to-chromium@1.5.490", "", {}, "sha512-I0dPyEsiaYAlbGJlr0SdRRGSWk9BpOz8AIo/4f93A6bAGuN3YafmT71rpss72SA05isaAkcAOYcW0F0H48om4Q=="], - "emoji-regex": ["emoji-regex@10.6.0", "", {}, "sha512-toUI84YS5YmxW219erniWD0CIVOo46xGKColeNQRgOzDorgBi1v4D71/OFzgD9GO2UGKIv1C3Sp8DAn0+j5w7A=="], + "emoji-regex": ["emoji-regex@8.0.0", "", {}, "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A=="], "emoji-regex-xs": ["emoji-regex-xs@2.0.1", "", {}, "sha512-1QFuh8l7LqUcKe24LsPUNzjrzJQ7pgRwp1QMcZ5MX6mFplk2zQ08NVCM84++1cveaUUYtcCYHmeFEuNg16sU4g=="], @@ -2332,6 +2569,8 @@ "empathic": ["empathic@2.1.0", "", {}, "sha512-AnfC1ATldl49/cvZdLPDjBfrRNwbDO05aibiOtzQu3qtlbJtomNLhF30HEtn/7iBz50dlMECqATo3fG0LrdEgw=="], + "encodeurl": ["encodeurl@2.0.3", "", {}, "sha512-mIteYONiEfc4xWf2F1WXovh1c8npzS00vNeiUPdwFF+QlVJni+gNvpQltLMQhob8rew/bWWc/bGTuUr0EUGt0w=="], + "enhanced-resolve": ["enhanced-resolve@5.27.0", "", { "dependencies": { "graceful-fs": "^4.2.4", "tapable": "^2.3.3" } }, "sha512-Do6BB2xzlcc/odFg+XEYyneAx4T/WfywO71yw9ePS2tVfRsf7JVR4mUeELadIeHzixkzbG5DpluiEFPi2WGfYQ=="], "entities": ["entities@9.0.0", "", {}, "sha512-oJFNDJg3kTPwAD1cNn2+WmUq4wFoo09npc3Ydf1D7ED4smRiWrsKnaLxykrTWgyGEcusc87P5dxlAleol9kpkg=="], @@ -2340,6 +2579,8 @@ "error-ex": ["error-ex@1.3.4", "", { "dependencies": { "is-arrayish": "^0.2.1" } }, "sha512-sqQamAnR14VgCr1A618A3sGrygcpK+HEbenA/HiEAkkUwcZIIB/tgWqHFxWgOyDh4nB4JCRimh79dR5Ywc9MDQ=="], + "error-stack-parser": ["error-stack-parser@2.1.4", "", { "dependencies": { "stackframe": "^1.3.4" } }, "sha512-Sk5V6wVazPhq5MhpO+AUxJn5x7XSXGl1R93Vn7i+zS15KDVxQijejNCrz8340/2bgLBjR9GtEG8ZVKONDjcqGQ=="], + "es-errors": ["es-errors@1.3.0", "", {}, "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw=="], "es-module-lexer": ["es-module-lexer@3.0.5", "", {}, "sha512-RNq2lKJw53c7z9QRHeiKeA6Ez0oikOqiBGdmxQhKDxEiOX1g5QJR4IoFVwicn8uCZcRWNrXC3NZaJihgK7aEbg=="], @@ -2426,10 +2667,40 @@ "esutils": ["esutils@2.0.3", "", {}, "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g=="], + "etag": ["etag@1.8.1", "", {}, "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg=="], + "eval": ["eval@0.1.8", "", { "dependencies": { "@types/node": "*", "require-like": ">= 0.1.1" } }, "sha512-EzV94NYKoO09GLXGjXj9JIlXijVck4ONSr5wiCWDvhsvj5jxSrzTmRU/9C1DyB6uToszLs8aifA6NQ7lEQdvFw=="], "events": ["events@3.3.0", "", {}, "sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q=="], + "expo": ["expo@58.0.26", "", { "dependencies": { "@babel/runtime": "^7.20.0", "@expo/cli": "^58.1.21", "@expo/config": "~58.0.12", "@expo/config-plugins": "~58.0.13", "@expo/devtools": "~58.0.2", "@expo/dom-webview": "~58.0.2", "@expo/fingerprint": "^0.21.10", "@expo/local-build-cache-provider": "^58.0.12", "@expo/log-box": "^58.0.15", "@expo/log-box-utils": "^58.0.2", "@expo/metro": "~58.0.0", "@expo/metro-config": "~58.0.23", "@ungap/structured-clone": "^1.3.0", "babel-preset-expo": "~58.0.26", "expo-asset": "~58.0.21", "expo-constants": "~58.0.16", "expo-file-system": "~58.0.14", "expo-font": "~58.0.12", "expo-keep-awake": "~58.0.4", "expo-modules-autolinking": "~58.1.0", "expo-modules-cli": "~0.5.0", "expo-modules-core": "~58.1.0", "pretty-format": "^29.7.0", "react-refresh": "^0.14.2", "whatwg-url-minimum": "^0.2.0" }, "peerDependencies": { "@expo/metro-runtime": "*", "react": "*", "react-dom": "*", "react-native": "*", "react-native-web": "*", "react-native-webview": "*" }, "optionalPeers": ["@expo/metro-runtime", "react-dom", "react-native-web", "react-native-webview"], "bin": { "expo": "bin/cli", "fingerprint": "bin/fingerprint", "expo-modules": "bin/modules", "expo-modules-autolinking": "bin/autolinking" } }, "sha512-6i4kqt5lbcQdxmtnkkJ3JR5sn+A3L+xO45duLhh2rndvrek/chX/GTysTYozl4oL3+txKD53pDlJd75XRYf9Ow=="], + + "expo-asset": ["expo-asset@58.0.21", "", { "dependencies": { "@expo/image-utils": "^0.12.7", "expo-constants": "~58.0.16" }, "peerDependencies": { "expo": "*", "react": "*", "react-native": "*" } }, "sha512-qaJmuTtswggXdBQfiUdpxrVGM7l+tH8iEDHwVDMuxyCF/kAau8sUGVuWrDKYNW4yAx7Z8ncgsT8s27pXjRH5GA=="], + + "expo-constants": ["expo-constants@58.0.16", "", { "dependencies": { "@expo/env": "~2.6.0", "@expo/require-utils": "^58.0.6" }, "peerDependencies": { "expo": "*", "react-native": "*" } }, "sha512-sVETnE1ktBMclc2Ve3qNrHhOCCio75a9JdghnJYGbqblmKfrrfE+lO9K4g9kNtmslIBLTK9Dyty6PbubkXs3Yw=="], + + "expo-example": ["expo-example@workspace:apps/expo"], + + "expo-file-system": ["expo-file-system@58.0.14", "", { "peerDependencies": { "expo": "*", "react-native": "*" } }, "sha512-VK67RQPDmWRHGbvpmPY5MeA1Ulw1LiyKs4KIN8na/q7SlkxYuPPR8biWsyX1S1/8XAHm6y2txUnYjCKh9l93lQ=="], + + "expo-font": ["expo-font@58.0.12", "", { "peerDependencies": { "expo": "*", "react": "*", "react-native": "*" } }, "sha512-5m8TJrQ27DT1815P066HBtcHINgD8yuIqH4ca2ZyYwCsPa4QZ8UzOBDtrHnAMWMAlAgol+PGVj9aKeoYov70JA=="], + + "expo-keep-awake": ["expo-keep-awake@58.0.4", "", { "peerDependencies": { "expo": "*", "react": "*" } }, "sha512-zXJJRBwMpWl2Q2Aj9rksMe1ncz6aphOPqYnG3rTkCFALZiM22xQCqpQqBloDcQ6g4RdGTy++lRnsDX7MWpK1qw=="], + + "expo-modules-autolinking": ["expo-modules-autolinking@58.1.0", "", { "dependencies": { "@expo/platforms": "^58.0.1", "@expo/require-utils": "^58.0.6", "@expo/spawn-async": "^1.8.0", "chalk": "^4.1.0", "commander": "^7.2.0" }, "bin": { "expo-modules-autolinking": "bin/expo-modules-autolinking.js" } }, "sha512-JAegkS+nC4LVEgKMHAnpWhUxs1BYHHaTJnncVW2EQION1bVz0y8/wEglAeGV+oq4BNS1V7s8zCMTZU0hMi28bA=="], + + "expo-modules-cli": ["expo-modules-cli@0.5.0", "", { "dependencies": { "@babel/parser": "^7.20.0", "arg": "^5.0.2" }, "bin": { "expo-modules": "bin/expo-modules.js" } }, "sha512-uBNKkp5NIMo2bmJiQL36EBLNMeX+2GEIxpz10BioT0EGQTsPcgrV0ypfGy31GtPoFOObyc9ibHhklsOtpzhblw=="], + + "expo-modules-core": ["expo-modules-core@58.1.0", "", { "dependencies": { "expo-modules-jsi": "~58.0.23", "expo-modules-macros": "0.33.0", "invariant": "^2.2.4" }, "peerDependencies": { "react": "*", "react-native": "*", "react-native-worklets": ">=0.13.0" }, "optionalPeers": ["react-native-worklets"] }, "sha512-eXHOPyxHkDyTxUWnKEatC+Hx4tLoPWCPd5pCynAU4WkaBvAG/l5t/wu5jXiE5eh2CRr2NU4iAQePX2zUfNEVhA=="], + + "expo-modules-jsi": ["expo-modules-jsi@58.0.23", "", { "peerDependencies": { "react-native": "*" } }, "sha512-ex3CnT8KLubsPjUG0RpEL5VgmpnWxf7Ouc+WXEr8jEbIwqcULEWtA2tfhGZwjg6jS3zeNwjygF1w8QSstP7JfQ=="], + + "expo-modules-macros": ["expo-modules-macros@0.33.0", "", { "optionalDependencies": { "@expo/modules-macros-linux-arm64": "0.33.0", "@expo/modules-macros-linux-x64": "0.33.0", "@expo/modules-macros-win32-arm64": "0.33.0", "@expo/modules-macros-win32-x64": "0.33.0" } }, "sha512-ddrT2jbYPYmiHmzcYOixRemFUUK9qQEb5pOBWgoFoW0gj3sGld1CZX0GwblUXeZMyEX65S9vc1bEhIAGVDRA9w=="], + + "expo-server": ["expo-server@58.1.0", "", {}, "sha512-jo7I6uHnP5OQYKx3+7lbpdVVnOEwFj2ryDkQdauUQSwgh2HuMUkiFXWUIVe01ts6DLRoff5U0Tv+uNb3CMq/kw=="], + + "exponential-backoff": ["exponential-backoff@3.1.3", "", {}, "sha512-ZgEeZXj30q+I0EN+CbSSpIyPaJ5HVQD18Z1m+u1FXbAeT94mr1zw50q4q6jiiC447Nl/YTcIYSAftiGqetwXCA=="], + "exsolve": ["exsolve@1.2.0", "", {}, "sha512-h1pQPR9XoeSMdntRNCjyTznaume4UpfXrULBnlkZ2CUM/G5eSa+pBByGldO5uR8dxbPC+OuJXsPPNf+JZ81ADg=="], "extend": ["extend@3.0.2", "", {}, "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g=="], @@ -2456,14 +2727,22 @@ "fault": ["fault@1.0.4", "", { "dependencies": { "format": "^0.2.0" } }, "sha512-CJ0HCB5tL5fYTEA7ToAq5+kTwd++Borf1/bifxd9iT70QcXr4MRrO3Llf8Ifs70q+SJcGHFtnIE/Nw6giCtECA=="], + "fb-dotslash": ["fb-dotslash@0.5.8", "", { "bin": { "dotslash": "bin/dotslash" } }, "sha512-XHYLKk9J4BupDxi9bSEhkfss0m+Vr9ChTrjhf9l2iw3jB5C7BnY4GVPoMcqbrTutsKJso6yj2nAB6BI/F2oZaA=="], + + "fb-watchman": ["fb-watchman@2.0.4", "", { "dependencies": { "bser": "2.1.2" } }, "sha512-tGQtaoYisPDriJBN0mT5yZSyNETnJGA1gTYxaVRAE5KUO3LI9kPUc9WIu8JXcxaIci+faIKlzXqXyPgrmubtBQ=="], + "fdir": ["fdir@6.5.0", "", { "peerDependencies": { "picomatch": "^3 || ^4" }, "optionalPeers": ["picomatch"] }, "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg=="], + "fetch-nodeshim": ["fetch-nodeshim@0.4.10", "", {}, "sha512-m6I8ALe4L4XpdETy7MJZWs6L1IVMbjs99bwbpIKphxX+0CTns4IKDWJY0LWfr4YsFjfg+z1TjzTMU8lKl8rG0w=="], + "fflate": ["fflate@0.8.3", "", {}, "sha512-tbZNuJrLwGUp3zshBtdy4W+ORxZuIh8a5ilyIEQDC5rY1f3U20JMry0Ll3WBzU58EZKsEuJFXhb5gwv8CsPvgA=="], "file-entry-cache": ["file-entry-cache@11.1.5", "", { "dependencies": { "flat-cache": "^6.1.23" } }, "sha512-+PFTHITI08JIGhnNpGNI8T8inUpgZfk3GNEqfT9R2zZV2iFXg3CvqzSl/uEhs7TSGujYRELEANyDvS8Fj7+S7Q=="], "fill-range": ["fill-range@7.1.1", "", { "dependencies": { "to-regex-range": "^5.0.1" } }, "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg=="], + "finalhandler": ["finalhandler@1.1.2", "", { "dependencies": { "debug": "2.6.9", "encodeurl": "~1.0.2", "escape-html": "~1.0.3", "on-finished": "~2.3.0", "parseurl": "~1.3.3", "statuses": "~1.5.0", "unpipe": "~1.0.0" } }, "sha512-aAWcW57uxVNrQZqFXjITpW3sIUQmHGG3qSb9mUah9MgMC4NeWhNOlNjXEYq3HjRAvL6arUviZGGJsBg6z0zsWA=="], + "find-cache-dir": ["find-cache-dir@4.0.0", "", { "dependencies": { "common-path-prefix": "^3.0.0", "pkg-dir": "^7.0.0" } }, "sha512-9ZonPT4ZAK4a+1pUPVPZJapbi7O5qbbJPdYw/NOQWZZbVLdDTYM3A4R9z/DpAM08IDaFGsvPgiGZ82WEwUDWjg=="], "find-root": ["find-root@1.1.0", "", {}, "sha512-NKfW6bec6GfKc0SGx1e07QZY9PE99u0Bft/0rzSD5k3sO/vwkVUpDUKVm5Gpp5Ue3YfShPFTX2070tDs5kB9Ng=="], @@ -2474,12 +2753,20 @@ "flatted": ["flatted@3.4.4", "", {}, "sha512-5+ybhBZANEJxaH3X5evAFatUxLfEHSr7n6kYJ+1Qd0mUqr4eu9gIf6GDbWHf8RJijHrjjO8G+la14SlL2SeS1Q=="], + "flow-enums-runtime": ["flow-enums-runtime@0.0.6", "", {}, "sha512-3PYnM29RFXwvAN6Pc/scUfkI7RwhQ/xqyLUyPNlXUp9S40zI8nup9tUSrTLSVnWGBN38FNiGWbwZOB6uR4OGdw=="], + + "flow-estree": ["flow-estree@0.327.0", "", {}, "sha512-f9vK751YUzD0qaHSpKc5/qQM6gqOlgGS+4ZRqTNcZOpVqn3mC55yEQ6dUG2K1eaVm5FbKkz9CFWe6XNvrkQFQg=="], + + "flow-parser": ["flow-parser@0.327.0", "", { "dependencies": { "flow-estree": "0.327.0" } }, "sha512-/MYZ5hXWf5ozpbdfUDmazMgQXviLxWEiRLH3MppEGDdW0itRVqmB5UaU7QX+SBCDNiq+gEesSVn8nlxmPDyDkw=="], + "flru": ["flru@1.0.2", "", {}, "sha512-kWyh8ADvHBFz6ua5xYOPnUroZTT/bwWfrCeL0Wj1dzG4/YOmOcfJ99W8dOVyyynJN35rZ9aCOtHChqQovV7yog=="], "foreground-child": ["foreground-child@3.3.1", "", { "dependencies": { "cross-spawn": "^7.0.6", "signal-exit": "^4.0.1" } }, "sha512-gIXjKqtFuWEgzFRJA9WCQeSJLZDjgJUOMCMzxtvFq/37KojM1BFGufqsCy0r4qSQmYLsZYMeyRqzIWOMup03sw=="], "format": ["format@0.2.2", "", {}, "sha512-wzsgA6WOq+09wrU1tsJ09udeR/YZRaeArL9e1wPbFg3GG2yDnC2ldKpxs4xunpFF9DgqCqOIra3bc1HWrJ37Ww=="], + "fresh": ["fresh@0.5.2", "", {}, "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q=="], + "fs.realpath": ["fs.realpath@1.0.0", "", {}, "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw=="], "fsevents": ["fsevents@2.3.3", "", { "os": "darwin", "hasInstallScript": true }, "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw=="], @@ -2522,6 +2809,8 @@ "hastscript": ["hastscript@9.0.3", "", { "dependencies": { "@types/hast": "^3.0.0", "comma-separated-tokens": "^2.0.0", "hast-util-parse-selector": "^4.0.0", "property-information": "^7.0.0", "space-separated-tokens": "^2.0.0" } }, "sha512-1ALZXSmCGmW3h8AMz4R4+QKSKFi7sNgXLVwmwB8FYVtl1CwQ3WDkSAEY/d5tp1g/vbQgq2s1WlHgfO3jbw1TsA=="], + "hermes-compiler": ["hermes-compiler@260318099.0.5", "", {}, "sha512-4Gze+pGTGTUBRmnv6LtdOMo6ZzMMh3hEkvDiWzvuNL5LM0EO5YGhr8xh3fRjFaEqReUwEGjJGcGgEPFe9+E6Gw=="], + "hermes-estree": ["hermes-estree@0.25.1", "", {}, "sha512-0wUoCcLp+5Ev5pDW2OriHC2MJCbwLwuRx+gAqMTOkGKJJiBCLjtrvy4PWUGn6MIVefecRpzoOZ/UV6iGdOr+Cw=="], "hermes-parser": ["hermes-parser@0.25.1", "", { "dependencies": { "hermes-estree": "0.25.1" } }, "sha512-6pEjquH3rqaI6cYAXYPcz9MS4rY6R4ngRgrgfDshRptUZIc3lw0MCIJIGDj9++mfySOuPTHB4nrSW99BCvOPIA=="], @@ -2540,6 +2829,10 @@ "html-url-attributes": ["html-url-attributes@3.0.1", "", {}, "sha512-ol6UPyBWqsrO6EJySPz2O7ZSr856WDrEzM5zMqp+FJJLGMW35cLYmmZnl0vztAZxRUoNZJFTCohfjuIJ8I4QBQ=="], + "http-errors": ["http-errors@2.0.1", "", { "dependencies": { "depd": "~2.0.0", "inherits": "~2.0.4", "setprototypeof": "~1.2.0", "statuses": "~2.0.2", "toidentifier": "~1.0.1" } }, "sha512-4FbRdAX+bSdmo4AUFuS0WNiPz8NgFt+r8ThgNWmlrjQjt1Q7ZR9+zTlce2859x4KSXrwIsaeTqDoKQmtP8pLmQ=="], + + "https-proxy-agent": ["https-proxy-agent@7.0.6", "", { "dependencies": { "agent-base": "^7.1.2", "debug": "4" } }, "sha512-vK9P5/iUfdl95AI+JVyUuIcVtd4ofvtrOr3HNtM2yxC9bnMbEdp3x01OhQNnjb8IJYi38VlTE3mBXwcfvywuSw=="], + "husky": ["husky@9.1.7", "", { "bin": { "husky": "bin.js" } }, "sha512-5gs5ytaNjBrh5Ow3zrvdUUY+0VxIuWVL4i9irt6friV+BqdCfmV11CQTWMiBYWHbXhco+J1kHfTOUkePhCDvMA=="], "icu-minify": ["icu-minify@4.15.2", "", { "dependencies": { "@formatjs/icu-messageformat-parser": "^3.4.0" } }, "sha512-IsgBR7/1RBkYWUqP2wS+vE9BBBfH4HjNjDbSPF3uK2Jjlzlsd7R+loUhjEEUySU6tjGmUIuft7w3qp7PI0KkXA=="], @@ -2604,12 +2897,24 @@ "javascript-stringify": ["javascript-stringify@2.1.0", "", {}, "sha512-JVAfqNPTvNq3sB/VHQJAFxN/sPgKnsKrCwyRt15zwNCdrMMJDdcEOdubuy+DuJYYdm0ox1J4uzEuYKkN+9yhVg=="], + "jest-get-type": ["jest-get-type@29.6.3", "", {}, "sha512-zrteXnqYxfQh7l5FHyL38jL39di8H8rHoecLH3JNxH3BwOrBsNeabdap5e0I23lD4HHI8W5VFBZqG4Eaq5LNcw=="], + + "jest-util": ["jest-util@29.7.0", "", { "dependencies": { "@jest/types": "^29.6.3", "@types/node": "*", "chalk": "^4.0.0", "ci-info": "^3.2.0", "graceful-fs": "^4.2.9", "picomatch": "^2.2.3" } }, "sha512-z6EbKajIpqGKU56y5KBUgy1dt1ihhQJgWzUlZHArA/+X2ad7Cb5iF+AK1EWVL/Bo7Rz9uurpqw6SiBCefUbCGA=="], + + "jest-validate": ["jest-validate@29.7.0", "", { "dependencies": { "@jest/types": "^29.6.3", "camelcase": "^6.2.0", "chalk": "^4.0.0", "jest-get-type": "^29.6.3", "leven": "^3.1.0", "pretty-format": "^29.7.0" } }, "sha512-ZB7wHqaRGVw/9hST/OuFUReG7M8vKeq0/J2egIGLdvjHCmYqGARhzXmtgi+gVeZ5uXFF219aOc3Ls2yLg27tkw=="], + "jest-worker": ["jest-worker@27.5.1", "", { "dependencies": { "@types/node": "*", "merge-stream": "^2.0.0", "supports-color": "^8.0.0" } }, "sha512-7vuh85V5cdDofPyxn58nrPjBktZo0u9x1g8WtjQol+jZDaE+fhN+cIvTj11GndBnMnyfrUOG1sZQxCdjKh+DKg=="], + "jimp-compact": ["jimp-compact@0.16.1", "", {}, "sha512-dZ6Ra7u1G8c4Letq/B5EzAxj4tLFHL+cGtdpR+PVm4yzPDj+lCk+AbivWt1eOM+ikzkowtyV7qSqX6qr3t71Ww=="], + "jiti": ["jiti@2.7.0", "", { "bin": { "jiti": "lib/jiti-cli.mjs" } }, "sha512-AC/7JofJvZGrrneWNaEnJeOLUx+JlGt7tNa0wZiRPT4MY1wmfKjt2+6O2p2uz2+skll8OZZmJMNqeke7kKbNgQ=="], "js-tokens": ["js-tokens@10.0.0", "", {}, "sha512-lM/UBzQmfJRo9ABXbPWemivdCW8V2G8FHaHdypQaIy523snUjog0W71ayWXTjiR+ixeMyVHN2XcpnTd/liPg/Q=="], + "js-yaml": ["js-yaml@4.3.2", "", { "dependencies": { "argparse": "^2.0.1" }, "bin": { "js-yaml": "bin/js-yaml.js" } }, "sha512-SFNOvSJ+Dgf/9An904Yx+CgSlIPCkIpao4qo51lpee25TIRejdH3rhR4EZMGoNx3/TP3O+wzWuiTFl4sqbltzA=="], + + "jsc-safe-url": ["jsc-safe-url@0.2.4", "", {}, "sha512-0wM3YBWtYePOjfyXQH5MWQ8H7sdk5EXSwZvmSLKk2RboVQ2Bu239jycHDz5J/8Blf3K0Qnoy2b6xD+z10MFB+Q=="], + "jsesc": ["jsesc@3.1.0", "", { "bin": { "jsesc": "bin/jsesc" } }, "sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA=="], "json-parse-even-better-errors": ["json-parse-even-better-errors@3.0.2", "", {}, "sha512-fi0NG4bPjCHunUJffmLd0gxssIgkNmArMvis4iNah6Owg1MCJjWhEcDLmsK6iGkJq3tHwbDkTlce70/tmXN4cQ=="], @@ -2626,12 +2931,18 @@ "keyv": ["keyv@5.6.0", "", { "dependencies": { "@keyv/serialize": "^1.1.1" } }, "sha512-CYDD3SOtsHtyXeEORYRx2qBtpDJFjRTGXUtmNEMGyzYOKj1TE3tycdlho7kA1Ufx9OYWZzg52QFBGALTirzDSw=="], + "kleur": ["kleur@3.0.3", "", {}, "sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w=="], + "kolorist": ["kolorist@1.8.0", "", {}, "sha512-Y+60/zizpJ3HRH8DCss+q95yr6145JXZo46OTpFvDZWLfRCE4qChOyk1b26nMaNpfHHgxagk9dXT5OP0Tfe+dQ=="], + "lan-network": ["lan-network@0.2.1", "", { "bin": { "lan-network": "dist/lan-network-cli.js" } }, "sha512-ONPnazC96VKDntab9j9JKwIWhZ4ZUceB4A9Epu4Ssg0hYFmtHZSeQ+n15nIwTFmcBUKtExOer8WTJ4GF9MO64A=="], + "landing": ["landing@workspace:apps/landing"], "lenis": ["lenis@1.3.27", "", { "peerDependencies": { "@nuxt/kit": ">=3.0.0", "react": ">=17.0.0", "vue": ">=3.0.0" }, "optionalPeers": ["@nuxt/kit", "react", "vue"] }, "sha512-QIHNH4LIfWyLfgH/5K0aTGZgyFJJ7GfHNcaH/AIgyKjb8gstLh5siNGvrVqz1w5ClLXzOvllBVk7vby8JzUVPQ=="], + "leven": ["leven@3.1.0", "", {}, "sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A=="], + "levn": ["levn@0.4.1", "", { "dependencies": { "prelude-ls": "^1.2.1", "type-check": "~0.4.0" } }, "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ=="], "lightningcss": ["lightningcss@1.33.0", "", { "dependencies": { "detect-libc": "^2.0.3" }, "optionalDependencies": { "lightningcss-android-arm64": "1.33.0", "lightningcss-darwin-arm64": "1.33.0", "lightningcss-darwin-x64": "1.33.0", "lightningcss-freebsd-x64": "1.33.0", "lightningcss-linux-arm-gnueabihf": "1.33.0", "lightningcss-linux-arm64-gnu": "1.33.0", "lightningcss-linux-arm64-musl": "1.33.0", "lightningcss-linux-x64-gnu": "1.33.0", "lightningcss-linux-x64-musl": "1.33.0", "lightningcss-win32-arm64-msvc": "1.33.0", "lightningcss-win32-x64-msvc": "1.33.0" } }, "sha512-WkUDrojuJs0xkgGf2udWxa3yGBRxPtxUkB79i6aCZLRgc7PM8fZe9TosfPDcvEpQZbuFASnHYmRLBLUbmLOIIA=="], @@ -2674,6 +2985,10 @@ "lodash.merge": ["lodash.merge@4.6.2", "", {}, "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ=="], + "lodash.throttle": ["lodash.throttle@4.1.1", "", {}, "sha512-wIkUCfVKpVsWo3JSZlc+8MB5it+2AN5W8J7YVMST30UrvcQNZ1Okbj+rbVniijTWE6FGYy4XJq/rHkas8qJMLQ=="], + + "log-symbols": ["log-symbols@2.2.0", "", { "dependencies": { "chalk": "^2.0.1" } }, "sha512-VeIAFslyIerEJLXHziedo2basKbMKtTw3vfn5IzG0XTjhAVEJyNHnL2p7vc+wBDSdQuUpNw3M2u6xb9QsAY5Eg=="], + "longest-streak": ["longest-streak@3.1.0", "", {}, "sha512-9Ri+o0JYgehTaVBBDoMqIl8GXtbWg711O3srftcHhZ0dqnETqLaoIK0x17fUw9rFSlK/0NlsKe0Ahhyl5pXE2g=="], "loose-envify": ["loose-envify@1.4.0", "", { "dependencies": { "js-tokens": "^3.0.0 || ^4.0.0" }, "bin": { "loose-envify": "cli.js" } }, "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q=="], @@ -2688,6 +3003,8 @@ "magic-string": ["magic-string@1.4.5", "", { "dependencies": { "@jridgewell/sourcemap-codec": "^1.6.0" } }, "sha512-oLLC2+YvQUfAa+vxoufE/yc1icb87M9iXIRqAoR/2EhE/8cb3SF/+Gi0c2By1B+5Vz2e2vQtUvHiu1+63Znh+w=="], + "makeerror": ["makeerror@1.0.12", "", { "dependencies": { "tmpl": "1.0.5" } }, "sha512-JmqCvUhmt43madlpFzG4BQzG2Z3m6tvQDNKdClZnO3VbIudJYmxsT0FNJMeiB2+JTSlTQTSbU8QdesVmwJcmLg=="], + "markdown-extensions": ["markdown-extensions@2.0.0", "", {}, "sha512-o5vL7aDWatOTX8LzaS1WMoaoxIiLRQJuIKKe2wAw6IeULDHaqbiqiggmx+pKvZDb1Sj+pE46Sn1T7lCqfFtg1Q=="], "mdast-util-from-markdown": ["mdast-util-from-markdown@2.1.0", "", { "dependencies": { "@types/mdast": "^4.0.0", "@types/unist": "^3.0.0", "decode-named-character-reference": "^1.0.0", "devlop": "^1.0.0", "mdast-util-to-string": "^4.0.0", "micromark": "^4.0.0", "micromark-util-decode-numeric-character-reference": "^2.0.0", "micromark-util-decode-string": "^2.0.0", "micromark-util-normalize-identifier": "^2.0.0", "micromark-util-symbol": "^2.0.0", "micromark-util-types": "^2.0.0", "unist-util-stringify-position": "^4.0.0" } }, "sha512-KRLgmPaP2H1ul2bpoJkOS+9pAcDAAj9Nu1mqLnh8NLeJG5tlvj42TH80PIGBpROWlRXLk0lDrWNuZCFy/tsB4A=="], @@ -2710,10 +3027,40 @@ "media-query-parser": ["media-query-parser@2.0.2", "", { "dependencies": { "@babel/runtime": "^7.12.5" } }, "sha512-1N4qp+jE0pL5Xv4uEcwVUhIkwdUO3S/9gML90nqKA7v7FcOS5vUtatfzok9S9U1EJU8dHWlcv95WLnKmmxZI9w=="], + "memoize-one": ["memoize-one@5.2.1", "", {}, "sha512-zYiwtZUcYyXKo/np96AGZAckk+FWWsUdJ3cHGGmld7+AhvcWmQyGCYUh1hc4Q/pkOhb65dQR/pqCyK0cOaHz4Q=="], + "merge-stream": ["merge-stream@2.0.0", "", {}, "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w=="], "merge2": ["merge2@1.4.1", "", {}, "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg=="], + "metro": ["metro@0.87.1", "", { "dependencies": { "@babel/code-frame": "^7.29.0", "@babel/core": "^7.25.2", "@babel/generator": "^7.29.1", "@babel/parser": "^7.29.0", "@babel/template": "^7.28.6", "@babel/traverse": "^7.29.0", "@babel/types": "^7.29.0", "accepts": "^2.0.0", "connect": "^3.6.5", "debug": "^4.4.0", "error-stack-parser": "^2.0.6", "flow-enums-runtime": "^0.0.6", "flow-parser": "0.331.0", "graceful-fs": "^4.2.4", "invariant": "^2.2.4", "jest-worker": "^29.7.0", "jsc-safe-url": "^0.2.2", "lodash.throttle": "^4.1.1", "metro-babel-transformer": "0.87.1", "metro-cache": "0.87.1", "metro-cache-key": "0.87.1", "metro-config": "0.87.1", "metro-core": "0.87.1", "metro-file-map": "0.87.1", "metro-resolver": "0.87.1", "metro-runtime": "0.87.1", "metro-source-map": "0.87.1", "metro-symbolicate": "0.87.1", "metro-transform-plugins": "0.87.1", "metro-transform-worker": "0.87.1", "mime-types": "^3.0.1", "nullthrows": "^1.1.1", "serialize-error": "^2.1.0", "source-map": "^0.5.6", "throat": "^5.0.0", "ws": "^7.5.10", "yargs": "^17.6.2" }, "bin": { "metro": "src/cli.js" } }, "sha512-1oyLU9elM7hPAsKIqKooEekwxiuWr27+MZBhUROPhzcbXhMDxK64GPF/hCXwBZVp1F89ODavCrBmJtLx9WtBoQ=="], + + "metro-babel-transformer": ["metro-babel-transformer@0.87.1", "", { "dependencies": { "@babel/core": "^7.25.2", "flow-enums-runtime": "^0.0.6", "flow-parser": "0.331.0", "metro-cache-key": "0.87.1", "nullthrows": "^1.1.1" } }, "sha512-orvRIGpb0yK1yMbk5YP3dhVKjmoxUkRB9fdltGJxNppEqus/1tFpNuf9KnGFR3Qjg0izoUrJ4z6WgoBvdkXPrA=="], + + "metro-cache": ["metro-cache@0.87.1", "", { "dependencies": { "exponential-backoff": "^3.1.1", "flow-enums-runtime": "^0.0.6", "https-proxy-agent": "^7.0.5", "metro-core": "0.87.1" } }, "sha512-juNPaj0Xi5tkLp8imXqvbSnEIijwKG36m7OiFFVJMqEkiURwAjkMFVek3/xpix1+LVQqO7kjVp3PvuvIM61mKQ=="], + + "metro-cache-key": ["metro-cache-key@0.87.1", "", { "dependencies": { "flow-enums-runtime": "^0.0.6" } }, "sha512-scqVVPMA2c+RVO12I3wyMDp5xCkRPLsyrcG4Qc3xfU5JR0EW/0sz2tjty+5UjMUtG09uiM1KYQ8HjWg7OQXHtw=="], + + "metro-config": ["metro-config@0.87.1", "", { "dependencies": { "connect": "^3.6.5", "flow-enums-runtime": "^0.0.6", "jest-validate": "^29.7.0", "metro": "0.87.1", "metro-cache": "0.87.1", "metro-core": "0.87.1", "metro-runtime": "0.87.1" } }, "sha512-NmkDlc/qZAdo5gTkVTuO2AKE/khemRKRH5IA+SKfqUBJigI5GqZ5TOXhmEokhlkAqzjt8dyzKhzI6FHvXoXaTQ=="], + + "metro-core": ["metro-core@0.87.1", "", { "dependencies": { "flow-enums-runtime": "^0.0.6", "lodash.throttle": "^4.1.1", "metro-resolver": "0.87.1" } }, "sha512-xizzky/4+c/Mkznege8OW05j7bSdM39VPoEps61Se4+hf32UQujmbvLvIE9+UnP6kNEPVomk0Fw8NsBK9iRQmw=="], + + "metro-file-map": ["metro-file-map@0.87.1", "", { "dependencies": { "debug": "^4.4.0", "fb-watchman": "^2.0.0", "flow-enums-runtime": "^0.0.6", "graceful-fs": "^4.2.4", "invariant": "^2.2.4", "jest-worker": "^29.7.0", "micromatch": "^4.0.4", "nullthrows": "^1.1.1" } }, "sha512-9sPuNCojC3pS4vj+ZPY7FXmHGpdJeckXuKXQrDAfJvZc60AF8owRFTkI8XdwlwrmPIB2w++KraK9FMEXvC4wJw=="], + + "metro-minify-terser": ["metro-minify-terser@0.87.1", "", { "dependencies": { "flow-enums-runtime": "^0.0.6", "terser": "^5.15.0" } }, "sha512-YK4k1oO1wV48hfE+Nbw2rJCnAgeabzrgT/xH5ha5n9gbK4p3HYFC898cERUiyTl9vRh58CNTiXRc88f7y6PfKg=="], + + "metro-resolver": ["metro-resolver@0.87.1", "", { "dependencies": { "flow-enums-runtime": "^0.0.6" } }, "sha512-FXH/brY69wT6sPxaSW8BhMmDGD/6irmBr/cL4rUi+VWwqR3pbvdcfUOfyjcHucgQ7pe5IW3xJY21eHKLVKNumQ=="], + + "metro-runtime": ["metro-runtime@0.87.1", "", { "dependencies": { "@babel/runtime": "^7.25.0", "flow-enums-runtime": "^0.0.6" } }, "sha512-kjeuSvInsM6OzBjkCQsWxnkrKZFMKtnkCl38oXWRI9lDGs2L9hGs9Tak9sQYJ9h3gtDujneB7wZio+irgqJKDw=="], + + "metro-source-map": ["metro-source-map@0.87.3", "", { "dependencies": { "@babel/core": "^7.25.2", "@babel/traverse": "^7.29.10", "@babel/types": "^7.29.8", "flow-enums-runtime": "^0.0.6", "invariant": "^2.2.4", "metro-symbolicate": "0.87.3", "nullthrows": "^1.1.1", "ob1": "0.87.3", "source-map": "^0.5.6" } }, "sha512-kvgC0nIP1emXDiMLhmcy1AOxZrfPMWxrvYqOMNVXvKbObtakGXqu60WpeSVlzo3VBfXCMmZDBz1SvsP80Ug+kQ=="], + + "metro-symbolicate": ["metro-symbolicate@0.87.1", "", { "dependencies": { "flow-enums-runtime": "^0.0.6", "invariant": "^2.2.4", "metro-source-map": "0.87.1", "nullthrows": "^1.1.1", "source-map": "^0.5.6", "vlq": "^1.0.0" }, "bin": { "metro-symbolicate": "src/index.js" } }, "sha512-rcGvwabrg0lbXGRGRKl14PY3My3+dkno2jZYhdJEuH2DmjTtTkV5bYwgto4JtV/Lbe+sXE6GO1UGg654430uow=="], + + "metro-transform-plugins": ["metro-transform-plugins@0.87.1", "", { "dependencies": { "@babel/core": "^7.25.2", "@babel/generator": "^7.29.1", "@babel/template": "^7.28.6", "@babel/traverse": "^7.29.0", "flow-enums-runtime": "^0.0.6", "nullthrows": "^1.1.1" } }, "sha512-qMiJ/x+VfqumFJJSefKS6nj8uojzC29b2/aK8vlMuFABIqGjDucICEOXd2Yt6k/XMFAgAcaJvShUOT0HLyYaPw=="], + + "metro-transform-worker": ["metro-transform-worker@0.87.1", "", { "dependencies": { "@babel/core": "^7.25.2", "@babel/generator": "^7.29.1", "@babel/parser": "^7.29.0", "@babel/types": "^7.29.0", "flow-enums-runtime": "^0.0.6", "metro": "0.87.1", "metro-babel-transformer": "0.87.1", "metro-cache": "0.87.1", "metro-cache-key": "0.87.1", "metro-minify-terser": "0.87.1", "metro-source-map": "0.87.1", "metro-transform-plugins": "0.87.1", "nullthrows": "^1.1.1" } }, "sha512-VOzs3OV405FuOLYdAhqA2wsn1F9lvueDVxMDLvCKaQ44U+yknIqphJ9eMjjsGwLDZiJq9sW3DMLhjD27JxQgqQ=="], + "microdiff": ["microdiff@1.5.0", "", {}, "sha512-Drq+/THMvDdzRYrK0oxJmOKiC24ayUV8ahrt8l3oRK51PWt6gdtrIGrlIH3pT/lFh1z93FbAcidtsHcWbnRz8Q=="], "micromark": ["micromark@4.0.3", "", { "dependencies": { "@types/debug": "^4.0.0", "debug": "^4.0.0", "decode-named-character-reference": "^1.0.0", "devlop": "^1.0.0", "micromark-core-commonmark": "^2.0.0", "micromark-factory-space": "^2.0.0", "micromark-util-character": "^2.0.0", "micromark-util-chunked": "^2.0.0", "micromark-util-combine-extensions": "^2.0.0", "micromark-util-decode-numeric-character-reference": "^2.0.0", "micromark-util-edit-map": "^1.0.0", "micromark-util-encode": "^2.0.0", "micromark-util-normalize-identifier": "^2.0.0", "micromark-util-resolve-all": "^2.0.0", "micromark-util-sanitize-uri": "^2.0.0", "micromark-util-subtokenize": "^2.0.0", "micromark-util-symbol": "^2.0.0", "micromark-util-types": "^2.0.0" } }, "sha512-oGYfQzHSG5dOMovQcJ3fyTmZlWAWpi0XA0sJwJs+i6OT88o1+Jtw/8z0CmdowSLxGhhFK89rQ/oXph/wN02PNw=="], @@ -2776,8 +3123,14 @@ "micromatch": ["micromatch@4.0.8", "", { "dependencies": { "braces": "^3.0.3", "picomatch": "^2.3.1" } }, "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA=="], + "mime": ["mime@1.6.0", "", { "bin": { "mime": "cli.js" } }, "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg=="], + "mime-db": ["mime-db@1.54.0", "", {}, "sha512-aU5EJuIN2WDemCcAp2vFBfp/m4EAhWJnUNSSw0ixs7/kXbd6Pg64EmwJkNdFhB8aWt1sH2CTXrLxo/iAGV3oPQ=="], + "mime-types": ["mime-types@2.1.35", "", { "dependencies": { "mime-db": "1.52.0" } }, "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw=="], + + "mimic-fn": ["mimic-fn@1.2.0", "", {}, "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ=="], + "min-indent": ["min-indent@1.0.1", "", {}, "sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg=="], "minimatch": ["minimatch@11.0.9", "", { "dependencies": { "@isaacs/nonrecursive-glob-match": "^1.1.0", "brace-expansion": "^5.0.12" } }, "sha512-KCFkfyjqerNlSstjlhIGNXIKZGA/6O4V4RlhZ+Dsr621SPPw0mzlypE9D9ZOoPiVefHID+j7/XuMMlqfD/F60Q=="], @@ -2796,6 +3149,8 @@ "ms": ["ms@2.1.3", "", {}, "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA=="], + "multitars": ["multitars@1.0.2", "", {}, "sha512-6GwVw5eLi9sThdtlS4PKwC7yRLaf45pYhIEzKBHdKxi+YOXGKFX8acIniH+Uh/+k9mS2lQOupTccjoe5r0/1IQ=="], + "nanoid": ["nanoid@3.3.20", "", { "bin": { "nanoid": "bin/nanoid.cjs" } }, "sha512-uKdg2G3GNCKQn9byYOpxbGqrT2fGO5KRt5J/8b3pok8rT6qxGWF6hxMyJiEYtAf+FVyYuD9hRaDqX5uPFYJ4ZQ=="], "natural-compare": ["natural-compare@1.4.0", "", {}, "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw=="], @@ -2860,12 +3215,18 @@ "node-addon-api": ["node-addon-api@7.1.1", "", {}, "sha512-5m3bsyrjFWE1xf7nz7YXdN4udnVtXK6/Yfgn5qnahL6bCkf2yKt4k3nuTKAtT4r3IG8JNR2ncsIMdZuAzJjHQQ=="], + "node-forge": ["node-forge@1.4.3", "", {}, "sha512-P6wzfh6t70avmV8FrVEAd/36sOPJQ+hkaJVX1Laap9J/77m7M0eyozDvc8SwnDf4P7MP94gwbAAo0rg3YVXT+g=="], + + "node-int64": ["node-int64@0.4.0", "", {}, "sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw=="], + "node-releases": ["node-releases@2.0.65", "", {}, "sha512-PfvofsGQ+MiOQIPkX9fU8ELUWmy5zL74CdQaph/ismKszfFkfwXaw0cGiwbwym2hT9k5+mdyl8O5WQ1MD8EHmA=="], "nopt": ["nopt@7.2.1", "", { "dependencies": { "abbrev": "^2.0.0" }, "bin": { "nopt": "bin/nopt.js" } }, "sha512-taM24ViiimT/XntxbPyJQzCG+p4EKOpgD3mxFwW38mGjVUrfERQOeY4EDHjdnptttfHuHQXFx+lTP08Q+mLa/w=="], "normalize-package-data": ["normalize-package-data@6.0.2", "", { "dependencies": { "hosted-git-info": "^7.0.0", "semver": "^7.3.5", "validate-npm-package-license": "^3.0.4" } }, "sha512-V6gygoYb/5EmNI+MEGrWkC+e6+Rr7mTmfHrxDbLzxQogBkgzo76rkok0Am6thgSF7Mv2nLOajAJj5vDJZEFn7g=="], + "noxcturnal": ["noxcturnal@0.1.14", "", { "dependencies": { "@babel/code-frame": "^7.20.0", "@oxc-project/types": "0.154.0" }, "optionalDependencies": { "@noxcturnal/noxcturnal-darwin-arm64": "0.1.14", "@noxcturnal/noxcturnal-darwin-x64": "0.1.14", "@noxcturnal/noxcturnal-linux-arm64-gnu": "0.1.14", "@noxcturnal/noxcturnal-linux-arm64-musl": "0.1.14", "@noxcturnal/noxcturnal-linux-x64-gnu": "0.1.14", "@noxcturnal/noxcturnal-linux-x64-musl": "0.1.14", "@noxcturnal/noxcturnal-win32-arm64-msvc": "0.1.14", "@noxcturnal/noxcturnal-win32-x64-msvc": "0.1.14" } }, "sha512-dYhWwCVfxlxnyzkVvP6W+XXd7lKikl04YckNur8xV4IejmgYDPq2ykSvzA2zfYVaNgEvmWDceOVRFn3sjry69Q=="], + "npm-install-checks": ["npm-install-checks@6.3.0", "", { "dependencies": { "semver": "^7.1.1" } }, "sha512-W29RiK/xtpCGqn6f3ixfRYGk+zRyr+Ew9F2E20BfXxT5/euLdA/Nm7fO7OeTGuAmTs30cpgInyJ0cYe708YTZw=="], "npm-normalize-package-bin": ["npm-normalize-package-bin@3.0.1", "", {}, "sha512-dMxCf+zZ+3zeQZXKxmyuCKlIDPGuv8EF940xbkC4kQVDTtqoh6rJFO+JTKSA6/Rwi0getWmtuy4Itup0AMcaDQ=="], @@ -2874,16 +3235,28 @@ "npm-pick-manifest": ["npm-pick-manifest@9.1.0", "", { "dependencies": { "npm-install-checks": "^6.0.0", "npm-normalize-package-bin": "^3.0.0", "npm-package-arg": "^11.0.0", "semver": "^7.3.5" } }, "sha512-nkc+3pIIhqHVQr085X9d2JzPzLyjzQS96zbruppqC9aZRm/x8xx6xhI98gHtsfELP2bE+loHq8ZaHFHhe+NauA=="], + "nullthrows": ["nullthrows@1.1.1", "", {}, "sha512-2vPPEi+Z7WqML2jZYddDIfy5Dqb0r2fze2zTxNNknZaFpVHU3mFB3R+DWeJWGVx0ecvttSGlJTI+WG+8Z4cDWw=="], + + "ob1": ["ob1@0.87.3", "", { "dependencies": { "flow-enums-runtime": "^0.0.6" } }, "sha512-g3UMN6od3PKhcpNFKZ1tj4pVFMHcipEGLiUdyGbm5yAQAwSvZA5VQBpvoyC2y8s1oFZ5oTknFxxEFaYPRi2M+Q=="], + "object-assign": ["object-assign@4.1.1", "", {}, "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg=="], "obug": ["obug@3.0.0", "", {}, "sha512-5vvB5+W7ePv+p3uqxi+RcW1XAzLW0/hxt3/4X4Lc4qHudzOhmBiBwOY6DRob4WnanAEGvNcLjF+KNOufrUoEQw=="], + "on-finished": ["on-finished@2.4.2", "", { "dependencies": { "ee-first": "1.1.1" } }, "sha512-ATWUv387i+nLD49EiDoOft5scf32Vsdz3ktrQJG9bi7jRFmaXTssvyvj1EmeKVVgvesbqUtvQQvaS2TpTukAZQ=="], + + "on-headers": ["on-headers@1.1.0", "", {}, "sha512-737ZY3yNnXy37FHkQxPzt4UZ2UWPWiCZWLvFZ4fu5cueciegX0zGPnrlY6bwRg4FdQOe9YU8MkmJwGhoMybl8A=="], + "once": ["once@1.4.0", "", { "dependencies": { "wrappy": "1" } }, "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w=="], + "onetime": ["onetime@2.0.1", "", { "dependencies": { "mimic-fn": "^1.0.0" } }, "sha512-oyyPpiMaKARvvcgip+JV+7zci5L8D1W9RZIz2l1o08AM3pfspitVWnPt3mzHcBPp12oYMTy0pqrFs/C+m3EwsQ=="], + "open": ["open@10.2.0", "", { "dependencies": { "default-browser": "^5.2.1", "define-lazy-prop": "^3.0.0", "is-inside-container": "^1.0.0", "wsl-utils": "^0.1.0" } }, "sha512-YgBpdJHPyQ2UE5x+hlSXcnejzAvD0b22U2OuAP+8OnlJT+PjWPxtgmGqKKc+RgTM63U9gN0YzrYc71R2WT/hTA=="], "optionator": ["optionator@0.9.4", "", { "dependencies": { "deep-is": "^0.1.3", "fast-levenshtein": "^2.0.6", "levn": "^0.4.1", "prelude-ls": "^1.2.1", "type-check": "^0.4.0", "word-wrap": "^1.2.5" } }, "sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g=="], + "ora": ["ora@3.4.0", "", { "dependencies": { "chalk": "^2.4.2", "cli-cursor": "^2.1.0", "cli-spinners": "^2.0.0", "log-symbols": "^2.2.0", "strip-ansi": "^5.2.0", "wcwidth": "^1.0.1" } }, "sha512-eNwHudNbO1folBP3JsZ19v9azXWtQZjICdr3Q0TDPIaeBQ3mXLrh54wM+er0+hSp+dWKf+Z8KM58CYzEyIYxYg=="], + "oxc-parser": ["oxc-parser@0.127.0", "", { "dependencies": { "@oxc-project/types": "^0.127.0" }, "optionalDependencies": { "@oxc-parser/binding-android-arm-eabi": "0.127.0", "@oxc-parser/binding-android-arm64": "0.127.0", "@oxc-parser/binding-darwin-arm64": "0.127.0", "@oxc-parser/binding-darwin-x64": "0.127.0", "@oxc-parser/binding-freebsd-x64": "0.127.0", "@oxc-parser/binding-linux-arm-gnueabihf": "0.127.0", "@oxc-parser/binding-linux-arm-musleabihf": "0.127.0", "@oxc-parser/binding-linux-arm64-gnu": "0.127.0", "@oxc-parser/binding-linux-arm64-musl": "0.127.0", "@oxc-parser/binding-linux-ppc64-gnu": "0.127.0", "@oxc-parser/binding-linux-riscv64-gnu": "0.127.0", "@oxc-parser/binding-linux-riscv64-musl": "0.127.0", "@oxc-parser/binding-linux-s390x-gnu": "0.127.0", "@oxc-parser/binding-linux-x64-gnu": "0.127.0", "@oxc-parser/binding-linux-x64-musl": "0.127.0", "@oxc-parser/binding-openharmony-arm64": "0.127.0", "@oxc-parser/binding-wasm32-wasi": "0.127.0", "@oxc-parser/binding-win32-arm64-msvc": "0.127.0", "@oxc-parser/binding-win32-ia32-msvc": "0.127.0", "@oxc-parser/binding-win32-x64-msvc": "0.127.0" } }, "sha512-bkgD4qHlN7WxLdX8bLXdaU54TtQtAIg/ZBAfm0aje/mo3MRDo3P0hZSgr4U7O3xfX+fQmR5AP04JS/TGcZLcFA=="], "oxc-resolver": ["oxc-resolver@11.21.2", "", { "optionalDependencies": { "@oxc-resolver/binding-android-arm-eabi": "11.21.2", "@oxc-resolver/binding-android-arm64": "11.21.2", "@oxc-resolver/binding-darwin-arm64": "11.21.2", "@oxc-resolver/binding-darwin-x64": "11.21.2", "@oxc-resolver/binding-freebsd-x64": "11.21.2", "@oxc-resolver/binding-linux-arm-gnueabihf": "11.21.2", "@oxc-resolver/binding-linux-arm-musleabihf": "11.21.2", "@oxc-resolver/binding-linux-arm64-gnu": "11.21.2", "@oxc-resolver/binding-linux-arm64-musl": "11.21.2", "@oxc-resolver/binding-linux-ppc64-gnu": "11.21.2", "@oxc-resolver/binding-linux-riscv64-gnu": "11.21.2", "@oxc-resolver/binding-linux-riscv64-musl": "11.21.2", "@oxc-resolver/binding-linux-s390x-gnu": "11.21.2", "@oxc-resolver/binding-linux-x64-gnu": "11.21.2", "@oxc-resolver/binding-linux-x64-musl": "11.21.2", "@oxc-resolver/binding-openharmony-arm64": "11.21.2", "@oxc-resolver/binding-wasm32-wasi": "11.21.2", "@oxc-resolver/binding-win32-arm64-msvc": "11.21.2", "@oxc-resolver/binding-win32-x64-msvc": "11.21.2" } }, "sha512-w5tLwYN3Zo24w5EeWJjJWZOwhYqTtC8PS2B1tIt7BZUuqTIcU07sQValbDw+rq7+AuAGzOHklgK+ifsy4lpXfw=="], @@ -2906,8 +3279,12 @@ "parse-json": ["parse-json@7.1.1", "", { "dependencies": { "@babel/code-frame": "^7.21.4", "error-ex": "^1.3.2", "json-parse-even-better-errors": "^3.0.0", "lines-and-columns": "^2.0.3", "type-fest": "^3.8.0" } }, "sha512-SgOTCX/EZXtZxBE5eJ97P4yGM5n37BwRU+YMsH4vNzFqJV/oWFXXCmwFlgWUM4PrakybVOueJJ6pwHqSVhTFDw=="], + "parse-png": ["parse-png@2.1.0", "", { "dependencies": { "pngjs": "^3.3.0" } }, "sha512-Nt/a5SfCLiTnQAjx3fHlqp8hRgTL3z7kTQZzvIMS9uCAepnCyjpdEc6M/sz69WqMBdaDBw9sF1F1UaHROYzGkQ=="], + "parse5": ["parse5@8.1.1", "", { "dependencies": { "entities": "^9.0.0" } }, "sha512-EcR/6WDcU7b2N3vQSxKALCk9lXGtUMQxXio008OEMBE0kavu/7JLfBEeFPzi43nMqVDSbEn3QCK+BMCc9zO//w=="], + "parseurl": ["parseurl@1.3.3", "", {}, "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ=="], + "path-browserify": ["path-browserify@1.0.1", "", {}, "sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g=="], "path-exists": ["path-exists@4.0.0", "", {}, "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w=="], @@ -2940,6 +3317,10 @@ "playwright-core": ["playwright-core@1.65.1", "", { "bin": { "playwright-core": "cli.js" } }, "sha512-hqPpz7blSMPxWVdoeE1yiBSzXsKiVOd2k+kjCvmUywD2GPO2Dd9HfcWnq9NN0GHbNZDFgZ9JfBFr+X5/BLo0qw=="], + "plist": ["plist@3.1.1", "", { "dependencies": { "@xmldom/xmldom": "^0.9.10", "base64-js": "^1.5.1", "xmlbuilder": "^15.1.1" } }, "sha512-ZIfcLJC+7E7FBFnDxm9MPmt7D+DidyQ26lewieO75AdhA2ayMtsJSES0iWzqJQbcVRSrTufQoy0DR94xHue0oA=="], + + "pngjs": ["pngjs@3.4.0", "", {}, "sha512-NCrCHhWmnQklfH4MtJMRjZ2a8c80qXeMlQMv2uVp9ISJMTt562SbGd6n2oq0PaPgKm7Z6pL9E2UlLIhC+SHL3w=="], + "po-parser": ["po-parser@2.2.0", "", {}, "sha512-NdTrKgh0oO7+y+RFX8KKhOB438x/j94UGXEFzl/7pHH0JjWSn42iJ9tgmPksIO6n1JKDHmNDcejPJfKspljB9g=="], "postcss": ["postcss@8.5.33", "", { "dependencies": { "nanoid": "^3.3.20", "picocolors": "^1.1.1", "source-map-js": "^1.2.2" } }, "sha512-RVHEU9/Pp1Fnjr/MpAJsZoADukCKhfIi15OunEYiGktIkYLkPVvC1sioWolGDS7XByMTx9m/IGbro0Js13zhnQ=="], @@ -2952,16 +3333,22 @@ "prettier-linter-helpers": ["prettier-linter-helpers@1.0.1", "", { "dependencies": { "fast-diff": "^1.1.2" } }, "sha512-SxToR7P8Y2lWmv/kTzVLC1t/GDI2WGjMwNhLLE9qtH8Q13C+aEmuRlzDst4Up4s0Wc8sF2M+J57iB3cMLqftfg=="], - "pretty-format": ["pretty-format@27.5.1", "", { "dependencies": { "ansi-regex": "^5.0.1", "ansi-styles": "^5.0.0", "react-is": "^17.0.1" } }, "sha512-Qb1gy5OrP5+zDf2Bvnzdl3jsTf1qXVMazbvCoKhtKqVs4/YK4ozX4gKQJJVyNe+cajNPn0KoC0MC3FUmaHWEmQ=="], + "pretty-format": ["pretty-format@29.7.0", "", { "dependencies": { "@jest/schemas": "^29.6.3", "ansi-styles": "^5.0.0", "react-is": "^18.0.0" } }, "sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ=="], "prismjs": ["prismjs@1.30.0", "", {}, "sha512-DEvV2ZF2r2/63V+tK8hQvrR2ZGn10srHbXviTlcv7Kpzw8jWiNTqbVgjO3IY8RxrrOUF8VPMQQFysYYYv0YZxw=="], "proc-log": ["proc-log@4.2.0", "", {}, "sha512-g8+OnU/L2v+wyiVK+D5fA34J7EH8jZ8DDlvwhRCMxmMj7UCBvxiO1mGeN+36JXIKF4zevU4kRBd8lVgG9vLelA=="], + "progress": ["progress@2.0.3", "", {}, "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA=="], + + "promise": ["promise@8.3.0", "", { "dependencies": { "asap": "~2.0.6" } }, "sha512-rZPNPKTOYVNEEKFaq1HqTgOwZD+4/YHS5ukLzQCypkj+OkYx7iv0mA91lJlpPPZ8vMau3IIGj5Qlwrx+8iiSmg=="], + "promise-inflight": ["promise-inflight@1.0.1", "", {}, "sha512-6zWPyEOFaQBJYcGMHBKTKJ3u6TBsnMFOIZSa6ce1e/ZrrsOlnHRHbabMjLiBYKp+n44X9eUI6VUPaukCXHuG4g=="], "promise-retry": ["promise-retry@2.0.1", "", { "dependencies": { "err-code": "^2.0.2", "retry": "^0.12.0" } }, "sha512-y+WKFlBR8BGXnsNlIHFGPZmyDf3DFMoLhaflAnyZgV6rG6xu+JwesTo2Q9R6XwYmtmwAFCkAk3e35jEdoeh/3g=="], + "prompts": ["prompts@2.4.2", "", { "dependencies": { "kleur": "^3.0.3", "sisteransi": "^1.0.5" } }, "sha512-NxNv/kLguCA7p3jE8oL2aEBsrJWgAakBpgmgK6lpPWV+WuOmY6r2/zbAVnP+T8bQlA0nzHXSJSJW0Hq7ylaD2Q=="], + "prop-types": ["prop-types@15.8.1", "", { "dependencies": { "loose-envify": "^1.4.0", "object-assign": "^4.1.1", "react-is": "^16.13.1" } }, "sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg=="], "property-information": ["property-information@7.2.0", "", {}, "sha512-IAtzIB6sUiWaJYrX9smp3V46pBGbBeLFRGdh25kg1334VcBlD8HzhPeNIWQH9zhGmo2itIe25EHt9dQP7G5hmg=="], @@ -2978,10 +3365,14 @@ "queue-microtask": ["queue-microtask@1.2.3", "", {}, "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A=="], + "range-parser": ["range-parser@1.2.1", "", {}, "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg=="], + "react": ["react@19.3.1", "", {}, "sha512-QNhWdt7nrgVWWQG58QuGsAR3jv3Hbe4mb4vz7w2csnHavciZJgda1CPNaldF6eVxv90ud3jUXpKlHL69gO38yw=="], "react-18-example": ["react-18-example@workspace:apps/react-18"], + "react-devtools-core": ["react-devtools-core@6.1.5", "", { "dependencies": { "shell-quote": "^1.6.1", "ws": "^7" } }, "sha512-ePrwPfxAnB+7hgnEr8vpKxL9cmnp7F322t8oqcPshbIQQhDKgFDW4tjhF2wjVbdXF9O/nyuy3sQWd9JGpiLPvA=="], + "react-docgen": ["react-docgen@8.0.4", "", { "dependencies": { "@babel/core": "^7.28.0", "@babel/traverse": "^7.28.0", "@babel/types": "^7.28.2", "@types/babel__core": "^7.20.5", "@types/babel__traverse": "^7.20.7", "@types/doctrine": "^0.0.9", "@types/resolve": "^1.20.2", "doctrine": "^3.0.0", "resolve": "^1.22.1", "strip-indent": "^4.0.0" } }, "sha512-gIYjtVTU4NCWZnb/LXVSWfClZXnjzX3+xxi69Tkfu4YsmYuqiOk8giLkKt/WwxWqh+U66CTh8Kqbha1uPv8/qQ=="], "react-docgen-typescript": ["react-docgen-typescript@2.4.0", "", { "peerDependencies": { "typescript": ">= 4.3.x" } }, "sha512-ZtAp5XTO5HRzQctjPU0ybY0RRCQO19X/8fxn3w7y2VVTUbGHDKULPTL4ky3vB05euSgG5NpALhEhDPvQ56wvXg=="], @@ -2994,7 +3385,9 @@ "react-markdown": ["react-markdown@10.1.0", "", { "dependencies": { "@types/hast": "^3.0.0", "@types/mdast": "^4.0.0", "devlop": "^1.0.0", "hast-util-to-jsx-runtime": "^2.0.0", "html-url-attributes": "^3.0.0", "mdast-util-to-hast": "^13.0.0", "remark-parse": "^11.0.0", "remark-rehype": "^11.0.0", "unified": "^11.0.0", "unist-util-visit": "^5.0.0", "vfile": "^6.0.0" }, "peerDependencies": { "@types/react": ">=18", "react": ">=18" } }, "sha512-qKxVopLT/TyA6BX3Ue5NwabOsAzm0Q7kAPwq6L+wWDwisYs7R8vZ0nRXqq6rkueboxpkjvLGU9fWifiX/ZZFxQ=="], - "react-refresh": ["react-refresh@0.19.0", "", {}, "sha512-5HdstYgoJBbBofjapO5qCPcovECJCBfvjLb+iTcsmqDFVMRdqy0qs7iiInBJTUXmIFc2bjoc5b2HVLp2zRtYhQ=="], + "react-native": ["react-native@0.88.1", "", { "dependencies": { "@react-native/asset-utils": "0.88.1", "@react-native/codegen": "0.88.1", "@react-native/community-cli-plugin": "0.88.1", "@react-native/gradle-plugin": "0.88.1", "@react-native/normalize-colors": "0.88.1", "@react-native/virtualized-lists": "0.88.1", "anser": "^1.4.9", "ansi-regex": "^5.0.0", "base64-js": "^1.5.1", "flow-enums-runtime": "^0.0.6", "flow-parser": "0.327.0", "hermes-compiler": "260318099.0.5", "invariant": "^2.2.4", "memoize-one": "^5.0.0", "metro-runtime": "^0.87.1", "metro-source-map": "^0.87.1", "nullthrows": "^1.1.1", "pretty-format": "^29.7.0", "promise": "^8.3.0", "react-devtools-core": "^6.1.5", "react-refresh": "^0.14.0", "regenerator-runtime": "^0.13.2", "scheduler": "0.28.0", "semver": "^7.1.3", "stacktrace-parser": "^0.1.10", "tinyglobby": "^0.2.15", "whatwg-fetch": "^3.0.0", "ws": "^7.5.10", "yargs": "^17.6.2" }, "peerDependencies": { "@types/react": "^19.1.1", "react": "^19.3.0" }, "optionalPeers": ["@types/react"], "bin": { "react-native": "cli.js" } }, "sha512-wajWcLZ93GCN7k4Uwh4CS4L2Ah8ohcvkOXnvIYmh4Yvuqho5j3APZ9qozK+nQrHWSgauq4h8D3HN5DKK84SrHA=="], + + "react-refresh": ["react-refresh@0.14.2", "", {}, "sha512-jCvmsr+1IUSMUyzOkRcvnVbX3ZYC6g9TDrDbFuFmRDq7PD4yaGbLKNQL6k2jnArV8hjYxh7hVhAZB6s9HDGpZA=="], "react-server-dom-webpack": ["react-server-dom-webpack@19.3.1", "", { "dependencies": { "acorn-loose": "^8.3.0", "neo-async": "^2.6.1", "webpack-sources": "^3.2.0" }, "peerDependencies": { "react": "^19.3.1", "react-dom": "^19.3.1", "webpack": "^5.59.0" } }, "sha512-I1Smf6Yc+389rFWPwyYjvCQVK1XFWpb2M9gvgYgfpbZ+LPqkZtb0tT9Fwdk0K+wknK2E+ns82lC0DCYLnXCVGA=="], @@ -3026,6 +3419,8 @@ "regenerate-unicode-properties": ["regenerate-unicode-properties@10.3.0", "", { "dependencies": { "regenerate": "^1.4.2" } }, "sha512-9ns8odR8e9q3otKeHj3DE80jZYKg6zVeZKE+zQmRKXFoVUcuiTGeO6iusDhPRoIQQPVPRvH+SfBhrTud4eczuw=="], + "regenerator-runtime": ["regenerator-runtime@0.13.11", "", {}, "sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg=="], + "regexpu-core": ["regexpu-core@6.5.4", "", { "dependencies": { "regenerate": "^1.5.0", "regenerate-unicode-properties": "^10.3.0", "regjsgen": "^0.8.0", "regjsparser": "^0.14.0", "unicode-match-property-ecmascript": "^2.0.0", "unicode-match-property-value-ecmascript": "^2.2.1" } }, "sha512-VpdamrZ9bw4YmvMZfTA3Yg8IHU9Guvg21bonvgjC4l3KfBkOqCPJesHakz7cQeE4Vh4zz4r4Gy6igAcnJxZv9g=="], "regjsgen": ["regjsgen@0.8.0", "", {}, "sha512-RvwtGe3d7LvWiDQXeQw8p5asZUmfU1G/l6WbUXeHta7Y2PEIvBTwH6E2EfmYUK8pxcxEdEmaomqyp0vZZ7C+3Q=="], @@ -3052,7 +3447,11 @@ "resolve": ["resolve@1.22.14", "", { "dependencies": { "es-errors": "^1.3.0", "is-core-module": "^2.18.0", "path-parse": "^1.0.7", "supports-preserve-symlinks-flag": "^1.0.0" }, "bin": { "resolve": "bin/resolve" } }, "sha512-1ZjYvR9sbkiwC5+9QHetqW5HmA2pHRMaoupD01t2HlYnV/vydC2zPwLixhsMieSWVZt0JJRg5LVIk0Ow1D/TrA=="], - "resolve-from": ["resolve-from@4.0.0", "", {}, "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g=="], + "resolve-from": ["resolve-from@5.0.0", "", {}, "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw=="], + + "resolve-workspace-root": ["resolve-workspace-root@2.0.1", "", {}, "sha512-nR23LHAvaI6aHtMg6RWoaHpdR4D881Nydkzi2CixINyg9T00KgaJdJI6Vwty+Ps8WLxZHuxsS0BseWjxSA4C+w=="], + + "restore-cursor": ["restore-cursor@2.0.0", "", { "dependencies": { "onetime": "^2.0.0", "signal-exit": "^3.0.2" } }, "sha512-6IzJLuGi4+R14vwagDHX+JrXmPVtPpn4mffDJ1UdR7/Edm87fl6yi8mMBIVvFtJaNTUvjughmW4hwLhRG7gC1Q=="], "retry": ["retry@0.12.0", "", {}, "sha512-9LkiTwjUh6rT555DtE9rTX+BKByPfrMzEAtnlEtdEwr3Nkffwiihqe2bWADg+OQRjt9gl6ICdmB/ZFDCGAtSow=="], @@ -3076,28 +3475,46 @@ "safe-buffer": ["safe-buffer@5.2.1", "", {}, "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ=="], + "sandbox-cli-detector": ["sandbox-cli-detector@0.2.0", "", { "bin": { "sandbox-cli-detector": "dist/cli.js" } }, "sha512-4lyHX0ZU0AZKwjgZ1InxZAa3PNpyEb8rOQ+Zss1ReYmhNzW0Q+h1zE5nvniXN0HaAWZaZE1zgVNEirb0R7LmNg=="], + "satori": ["satori@0.33.5", "", { "dependencies": { "@shuding/opentype.js": "1.4.0-beta.0", "css-background-parser": "^0.1.0", "css-box-shadow": "1.0.0-3", "css-gradient-parser": "^0.0.17", "css-to-react-native": "^3.0.0", "emoji-regex-xs": "^2.0.1", "escape-html": "^1.0.3", "fflate": "0.7.3", "harfbuzzjs": "0.10.0", "linebreak": "^1.1.0", "parse-css-color": "^0.2.1", "postcss-value-parser": "^4.2.0", "yoga-layout": "^3.2.1" } }, "sha512-PNW6ktrQ8SM6kk7u4aOuTkkUewkzyTOrj+QeEzXSsnNMAdff4ire9CAqIz8+4C3rCiBtK8QTELv52AZEd1PbRw=="], + "sax": ["sax@1.6.1", "", {}, "sha512-42tBVwLWnaQvW5zc4HbZrTuWccECCZfBi92FDuwtqxasH+JbPB3/FOKb1m222K42R4WxuxzzMsTswfzgtSu64Q=="], + "scheduler": ["scheduler@0.28.0", "", {}, "sha512-juorfCmIkIw8tT+p5BXSm6PJjQF/ycEYmKyzURCIt/RaZIhL+PulbQ9Yu2z1HdOJDdqDTlxA1+xKBmHXJsczAw=="], "schema-utils": ["schema-utils@4.8.5", "", { "dependencies": { "@types/json-schema": "^7.0.15", "ajv": "^8.20.0", "ajv-formats": "^3.0.1", "ajv-keywords": "^5.1.0" }, "peerDependencies": { "webpack": "^5.0.0" }, "optionalPeers": ["webpack"], "bin": { "schema-utils": "bin/schema-utils.js" } }, "sha512-K1RRP7aTUAY2lGXNzPwjMK6AMMzbETdpF3pTPMEnH/RrpmPx6K1X47/gSebrV+1I9pRcgpwZwqpYBlyZAsliiw=="], "semver": ["semver@7.8.6", "", { "bin": { "semver": "bin/semver.js" } }, "sha512-9lpSSU4Mly3mrtruwLs1eLK6+gzbzqeBFwRNjIjE+9LuDpWdYctrQlQ3ej1Ilgi7gknpsTRnPoLP8DpCHqHIJw=="], + "send": ["send@0.19.2", "", { "dependencies": { "debug": "2.6.9", "depd": "2.0.0", "destroy": "1.2.0", "encodeurl": "~2.0.0", "escape-html": "~1.0.3", "etag": "~1.8.1", "fresh": "~0.5.2", "http-errors": "~2.0.1", "mime": "1.6.0", "ms": "2.1.3", "on-finished": "~2.4.1", "range-parser": "~1.2.1", "statuses": "~2.0.2" } }, "sha512-VMbMxbDeehAxpOtWJXlcUS5E8iXh6QmN+BkRX1GARS3wRaXEEgzCcB10gTQazO42tpNIya8xIyNx8fll1OFPrg=="], + + "serialize-error": ["serialize-error@2.1.0", "", {}, "sha512-ghgmKt5o4Tly5yEG/UJp8qTd0AN7Xalw4XBtDEKP655B699qMEtra1WlXeE6WIvdEG481JvRxULKsInq/iNysw=="], + + "serve-static": ["serve-static@1.16.3", "", { "dependencies": { "encodeurl": "~2.0.0", "escape-html": "~1.0.3", "parseurl": "~1.3.3", "send": "~0.19.1" } }, "sha512-x0RTqQel6g5SY7Lg6ZreMmsOzncHFU7nhnRWkKgWuMTu5NN0DR5oruckMqRvacAN9d5w6ARnRBXl9xhDCgfMeA=="], + "server-only": ["server-only@0.0.1", "", {}, "sha512-qepMx2JxAa5jjfzxG79yPPq+8BuFToHd1hm7kI+Z4zAq1ftQiP7HcxMhDDItrbtwVeLg/cY2JnKnrcFkmiswNA=="], "set-blocking": ["set-blocking@2.0.0", "", {}, "sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw=="], + "setprototypeof": ["setprototypeof@1.2.0", "", {}, "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw=="], + "sharp": ["sharp@0.35.5", "", { "dependencies": { "@img/colour": "^1.1.0", "detect-libc": "^2.1.2", "semver": "^7.8.5" }, "optionalDependencies": { "@img/sharp-darwin-arm64": "0.35.5", "@img/sharp-darwin-x64": "0.35.5", "@img/sharp-freebsd-wasm32": "0.35.5", "@img/sharp-libvips-darwin-arm64": "1.3.4", "@img/sharp-libvips-darwin-x64": "1.3.4", "@img/sharp-libvips-linux-arm": "1.3.4", "@img/sharp-libvips-linux-arm64": "1.3.4", "@img/sharp-libvips-linux-ppc64": "1.3.4", "@img/sharp-libvips-linux-riscv64": "1.3.4", "@img/sharp-libvips-linux-s390x": "1.3.4", "@img/sharp-libvips-linux-x64": "1.3.4", "@img/sharp-libvips-linuxmusl-arm64": "1.3.4", "@img/sharp-libvips-linuxmusl-x64": "1.3.4", "@img/sharp-linux-arm": "0.35.5", "@img/sharp-linux-arm64": "0.35.5", "@img/sharp-linux-ppc64": "0.35.5", "@img/sharp-linux-riscv64": "0.35.5", "@img/sharp-linux-s390x": "0.35.5", "@img/sharp-linux-x64": "0.35.5", "@img/sharp-linuxmusl-arm64": "0.35.5", "@img/sharp-linuxmusl-x64": "0.35.5", "@img/sharp-webcontainers-wasm32": "0.35.5", "@img/sharp-win32-arm64": "0.35.5", "@img/sharp-win32-ia32": "0.35.5", "@img/sharp-win32-x64": "0.35.5" }, "peerDependencies": { "@types/node": "*" }, "optionalPeers": ["@types/node"] }, "sha512-Ywn4OnzGukp7CDMrp08RQ50YKmuwG47brZgIVPTvBaaAfQlRlygrRqSrxdCiL9M+LlzLBiJ68IR1QqvzHyjC7g=="], "shebang-command": ["shebang-command@2.0.0", "", { "dependencies": { "shebang-regex": "^3.0.0" } }, "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA=="], "shebang-regex": ["shebang-regex@3.0.0", "", {}, "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A=="], + "shell-quote": ["shell-quote@1.12.0", "", {}, "sha512-PcByqNyT/38F2kDNi006HAMRJaULuBzq/FOsw3qdZvX/GA9W/jamDaRskgHjubHiftXK5sIFxLNkvrXUwcof6Q=="], + "signal-exit": ["signal-exit@4.1.0", "", {}, "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw=="], + "simple-plist": ["simple-plist@1.3.1", "", { "dependencies": { "bplist-creator": "0.1.0", "bplist-parser": "0.3.1", "plist": "^3.0.5" } }, "sha512-iMSw5i0XseMnrhtIzRb7XpQEXepa9xhWxGUojHBL43SIpQuDQkh3Wpy67ZbDzZVr6EKxvwVChnVpdl8hEVLDiw=="], + "sisteransi": ["sisteransi@1.0.5", "", {}, "sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg=="], + "slugify": ["slugify@1.6.9", "", {}, "sha512-vZ7rfeehZui7wQs438JXBckYLkIIdfHOXsaVEUMyS5fHo1483l1bMdo0EDSWYclY0yZKFOipDy4KHuKs6ssvdg=="], + "source-map": ["source-map@0.7.6", "", {}, "sha512-i5uvt8C3ikiWeNZSVZNWcfZPItFQOsYTUAOkcUPGd8DqDy1uOUikjt5dG+uRlwyvR108Fb9DOd4GvXfT0N2/uQ=="], "source-map-js": ["source-map-js@1.2.2", "", {}, "sha512-KGj/8Y43x35aZVDtt+J4mK1hoLGHULMYfSkODJNQjNDC3oW1PqPoxMwo0pLUsWM/UEGzON/NxeHywEfNXNP3Vw=="], @@ -3116,11 +3533,19 @@ "srvx": ["srvx@1.0.8", "", { "bin": { "srvx": "./bin/srvx.mjs" } }, "sha512-ngFS/J6St4PJfHRHGjr78xkPPtbyXtdMOLNE4x/XZunEK3OhV7aGUWMHf9WTUEy6wm1U0W4okkd82ZFFWRVQTw=="], + "stackframe": ["stackframe@1.3.4", "", {}, "sha512-oeVtt7eWQS+Na6F//S4kJ2K2VbRlS9D43mAlMyVpVWovy9o+jfgH8O9agzANzaiLjclA0oYzUXEM4PurhSUChw=="], + + "stacktrace-parser": ["stacktrace-parser@0.1.11", "", { "dependencies": { "type-fest": "^0.7.1" } }, "sha512-WjlahMgHmCJpqzU8bIBy4qtsZdU9lRlcZE3Lvyej6t4tuOuv1vk57OW3MBrj6hXBFx/nNoC9MPMTcr5YA7NQbg=="], + + "statuses": ["statuses@2.0.2", "", {}, "sha512-DvEy55V3DB7uknRo+4iOGT5fP1slR8wQohVdknigZPMpMstaKJQWhwiYBACJE3Ul2pTnATihhBYnRhZQHGBiRw=="], + "storybook": ["storybook@10.6.7", "", { "dependencies": { "@storybook/global": "^5.0.0", "@storybook/icons": "^2.0.2", "@testing-library/dom": "^10.4.1", "@testing-library/jest-dom": "6.9.1", "@testing-library/user-event": "^14.6.3", "@vitest/expect": "3.2.4", "@vitest/spy": "3.2.4", "@webcontainer/env": "^1.1.1", "esbuild": "^0.18.0 || ^0.19.0 || ^0.20.0 || ^0.21.0 || ^0.22.0 || ^0.23.0 || ^0.24.0 || ^0.25.0 || ^0.26.0 || ^0.27.0 || ^0.28.0", "jsonc-parser": "^3.3.1", "open": "^10.2.0", "oxc-parser": "^0.127.0", "oxc-resolver": "11.21.2", "recast": "^0.23.5", "semver": "^7.7.3", "use-sync-external-store": "^1.5.0", "ws": "^8.21.1" }, "peerDependencies": { "@types/react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0", "prettier": "^2 || ^3", "vite-plus": "^0.1.15 || ^0.2.0" }, "optionalPeers": ["@types/react", "prettier", "vite-plus"], "bin": "./dist/bin/dispatcher.js" }, "sha512-/1h87XqC+8tZ5PQ/GVWOg78tCQuEAshYWwok5niBcnHEKzZy6Ls06uuT5/rhQ3iUB0y8iexEVHmUe3jaaxNguw=="], + "stream-buffers": ["stream-buffers@2.2.0", "", {}, "sha512-uyQK/mx5QjHun80FLJTfaWE7JtwfRMKBLkMne6udYOmvH0CawotVa7TfgYHzAnpphn4+TweIx1QKMnRIbipmUg=="], + "string-ts": ["string-ts@2.4.0", "", {}, "sha512-JOrTlmqL2wGvXZI+4RLzSAAqvhQL3rXOmSCLoacd9MC5hIj20xoa7CfYBEApBDncf+hhvbGi6atCy7LyweWRKQ=="], - "string-width": ["string-width@7.2.0", "", { "dependencies": { "emoji-regex": "^10.3.0", "get-east-asian-width": "^1.0.0", "strip-ansi": "^7.1.0" } }, "sha512-tsaTIkKW9b4N+AEj+SVA+WhJzV7/zMhcSu78mLKWSk7cXMOSHsBKFWUs0fWwq8QyK3MgJBQRX6Gbi4kYbdvGkQ=="], + "string-width": ["string-width@4.2.3", "", { "dependencies": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", "strip-ansi": "^6.0.1" } }, "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g=="], "string-width-cjs": ["string-width@4.2.3", "", { "dependencies": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", "strip-ansi": "^6.0.1" } }, "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g=="], @@ -3130,7 +3555,7 @@ "stringify-entities": ["stringify-entities@4.0.4", "", { "dependencies": { "character-entities-html4": "^2.0.0", "character-entities-legacy": "^3.0.0" } }, "sha512-IwfBptatlO+QCJUo19AqvrPNqlVMpW9YEL2LIVY+Rpv2qsjCGxaDLNRgeGsQWJhfItebuJhsGSLjaBbNSQ+ieg=="], - "strip-ansi": ["strip-ansi@7.2.0", "", { "dependencies": { "ansi-regex": "^6.2.2" } }, "sha512-yDPMNjp4WyfYBkHnjIRLfca1i6KMyGCtsVgoKe/z1+6vukgaENdgGBZt+ZmKPc4gavvEZ5OgHfHdrazhgNyG7w=="], + "strip-ansi": ["strip-ansi@5.2.0", "", { "dependencies": { "ansi-regex": "^4.1.0" } }, "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA=="], "strip-ansi-cjs": ["strip-ansi@6.0.1", "", { "dependencies": { "ansi-regex": "^5.0.1" } }, "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A=="], @@ -3140,6 +3565,8 @@ "strip-literal": ["strip-literal@4.0.0", "", { "dependencies": { "js-tokens": "^10.0.0" } }, "sha512-PaqAvfUZKBwc/SLmNZtHmzK+v19Z4O4eS3cKPeGvbIv/U3pnyEq4Tuw3/4v/FwfM8VQaEawsyCcOQ0P+kpwWWw=="], + "structured-headers": ["structured-headers@0.4.1", "", {}, "sha512-0MP/Cxx5SzeeZ10p/bZI0S6MpgD+yxAhi1BOQ34jgnMXsCq3j1t6tQnZu+KdlL7dvJTLT3g9xN8tl10TqgFMcg=="], + "style-to-js": ["style-to-js@1.1.21", "", { "dependencies": { "style-to-object": "1.0.14" } }, "sha512-RjQetxJrrUJLQPHbLku6U/ocGtzyjbJMP9lCNK7Ag0CNh690nSH8woqWH9u16nMjYBAok+i7JO1NP2pOy8IsPQ=="], "style-to-object": ["style-to-object@2.0.2", "", { "dependencies": { "inline-style-parser": "0.2.9" } }, "sha512-QmbXPUylqU80HAgTOJeEOdbA40W9KtxmjMhQy+tq+b8F2aoh3aQLuy82hh2jm2qsC9hR9eI0+eQidTMydKcqRA=="], @@ -3152,6 +3579,8 @@ "supports-color": ["supports-color@9.4.0", "", {}, "sha512-VL+lNrEoIXww1coLPOmiEmK/0sGigko5COxI09KzHc2VJXJsQ37UaQ+8quuxjDeA7+KnLGTWRyOXSLLR2Wb4jw=="], + "supports-hyperlinks": ["supports-hyperlinks@2.3.0", "", { "dependencies": { "has-flag": "^4.0.0", "supports-color": "^7.0.0" } }, "sha512-RpsAZlpWcDwOPQA22aCH4J0t7L8JmAvsCxfOSEwm7cQs3LshN36QaTkwd70DnBOXDWGssw2eUoc8CaRWT0XunA=="], + "supports-preserve-symlinks-flag": ["supports-preserve-symlinks-flag@1.0.0", "", {}, "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w=="], "synckit": ["synckit@0.11.13", "", { "dependencies": { "@pkgr/core": "^0.3.6" } }, "sha512-eNRKgb3z66Yp3D2CixVujOUvXLFUTij/zVnV8KRyvFdQwpz7I5DS8UfRkTeLzb64u+dkzDSdelE24izu+zSSUg=="], @@ -3160,8 +3589,12 @@ "tapable": ["tapable@2.3.4", "", {}, "sha512-NHFiWnAbMJxNNpBwiO7jJVGDuqMxT9/oV8v57RR+fgBQShkJil5inGD8/xWy0hjLyHQyX1tu27QANhlz3KBqCg=="], + "terminal-link": ["terminal-link@2.1.1", "", { "dependencies": { "ansi-escapes": "^4.2.1", "supports-hyperlinks": "^2.0.0" } }, "sha512-un0FmiRUQNr5PJqy9kP7c40F5BOfpGlYTrxonDChEZB7pzZxRNp/bt+ymiy9/npwXya9KH99nJ/GXFIiUkYGFQ=="], + "terser": ["terser@5.51.2", "", { "dependencies": { "@jridgewell/source-map": "^0.3.3", "acorn": "^8.15.0", "commander": "^2.20.0", "source-map-support": "~0.5.20" }, "bin": { "terser": "bin/terser" } }, "sha512-bWnjSNscmuI+GJze6ZupnHP8G/cTcsJF+bXCeQknk2SHQsgbNJnLrqiH9jZ2W4STPVXH2mDKKRX3iwPhc9Cn/Q=="], + "throat": ["throat@5.0.0", "", {}, "sha512-fcwX4mndzpLQKBS1DVYhGAcYaYt7vsHNIvQV+WXMvnow5cgjPphq5CaayLaGsjRdSCKZFNGt7/GYAuXaNOiYCA=="], + "tiny-inflate": ["tiny-inflate@1.0.3", "", {}, "sha512-pkY1fj1cKHb2seWDy0B16HeWyczlJA9/WW3u3c4z/NiWDsO3DOU5D7nhTLE9CF0yXv/QZFY7sEJmj24dK+Rrqw=="], "tiny-invariant": ["tiny-invariant@1.3.3", "", {}, "sha512-+FbBPE1o9QAYvviau/qC5SE3caw21q3xkvWKBtja5vgqOWIHHJ3ioaq1VPfn/Szqctz2bU/oYeKd9/z5BL+PVg=="], @@ -3174,8 +3607,14 @@ "tm-grammars": ["tm-grammars@1.32.22", "", {}, "sha512-VKWL+UiqlGqbGHonRbrBc0kkqDIHUUiVO/A2rBTBz5LBXKA8Fe2f34O1YiBI7ED37tTUlT3MGmLf9+0F/H4/Ww=="], + "tmpl": ["tmpl@1.0.5", "", {}, "sha512-3f0uOEAQwIqGuWW2MVzYg8fV/QNnc/IpuJNG837rLuczAaLVHslWHZQj4IGiEl5Hs3kkbhwL9Ab7Hrsmuj+Smw=="], + "to-regex-range": ["to-regex-range@5.0.1", "", { "dependencies": { "is-number": "^7.0.0" } }, "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ=="], + "toidentifier": ["toidentifier@1.0.1", "", {}, "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA=="], + + "toqr": ["toqr@0.1.1", "", {}, "sha512-FWAPzCIHZHnrE/5/w9MPk0kK25hSQSH2IKhYh9PyjS3SG/+IEMvlwIHbhz+oF7xl54I+ueZlVnMjyzdSwLmAwA=="], + "trim-lines": ["trim-lines@3.0.1", "", {}, "sha512-kRj8B+YHZCc9kQYdWfJB2/oUl9rA99qbowYYBtr4ui4mZyAQ2JpvVBd/6U2YloATfqBhBTSMhTpgBHtU0Mf3Rg=="], "trough": ["trough@2.2.0", "", {}, "sha512-tmMpK00BjZiUyVyvrBK7knerNgmgvcV/KLVyuma/SC+TQN167GrMRciANTz09+k3zW8L8t60jWO1GpfkZdjTaw=="], @@ -3198,7 +3637,7 @@ "type-check": ["type-check@0.4.0", "", { "dependencies": { "prelude-ls": "^1.2.1" } }, "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew=="], - "type-fest": ["type-fest@3.13.1", "", {}, "sha512-tLq3bSNx+xSpwvAJnzrK0Ep5CLNWjvFTOp71URMaAEWBfRb9nnJiBoUe0tF8bI4ZFO3omgBR6NvnbzVUT3Ly4g=="], + "type-fest": ["type-fest@0.7.1", "", {}, "sha512-Ne2YiiGN8bmrmJJEuTWTLJR32nh/JdL1+PSicowtNb0WFpn59GK8/lfD61bVtzguz7b3PBt74nxpv/Pw5po5Rg=="], "typedarray": ["typedarray@0.0.6", "", {}, "sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA=="], @@ -3240,6 +3679,8 @@ "unpic": ["unpic@4.2.2", "", {}, "sha512-z6T2ScMgRV2y2H8MwwhY5xHZWXhUx/YxtOCGJwfURSl7ypVy4HpLIMWoIZKnnxQa/RKzM0kg8hUh0paIrpLfvw=="], + "unpipe": ["unpipe@1.0.0", "", {}, "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ=="], + "unplugin": ["unplugin@2.3.11", "", { "dependencies": { "@jridgewell/remapping": "^2.3.5", "acorn": "^8.15.0", "picomatch": "^4.0.3", "webpack-virtual-modules": "^0.6.2" } }, "sha512-5uKD0nqiYVzlmCRs01Fhs2BdkEgBS3SAVP6ndrBsuK42iC2+JHyxM05Rm9G8+5mkmRtzMZGY8Ct5+mliZxU/Ww=="], "unplugin-dts": ["unplugin-dts@1.1.2", "", { "dependencies": { "@rollup/pluginutils": "^5.1.4", "@volar/typescript": "^2.4.26", "compare-versions": "^6.1.1", "debug": "^4.4.0", "glob-to-regexp": "0.4.1", "kolorist": "^1.8.0", "local-pkg": "^1.1.1", "magic-string": "^0.30.17", "unplugin": "^2.3.2" }, "peerDependencies": { "@microsoft/api-extractor": ">=7", "@rspack/core": "^1", "@vue/language-core": "^3.1.5", "esbuild": "*", "rolldown": "*", "rollup": ">=3", "typescript": ">=4", "vite": ">=3", "webpack": "^4 || ^5" }, "optionalPeers": ["@microsoft/api-extractor", "@rspack/core", "@vue/language-core", "esbuild", "rolldown", "rollup", "vite", "webpack"] }, "sha512-RDqy90XUmFj6rz4U5YoTMdYdaCJe2ZnQZaWIjkWS4952Gv0zBTQyqWtlGgVMPYHa982dURvyoc+sUOFIcDFv+w=="], @@ -3256,10 +3697,14 @@ "util-deprecate": ["util-deprecate@1.0.2", "", {}, "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw=="], + "utils-merge": ["utils-merge@1.0.1", "", {}, "sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA=="], + "validate-npm-package-license": ["validate-npm-package-license@3.0.4", "", { "dependencies": { "spdx-correct": "^3.0.0", "spdx-expression-parse": "^3.0.0" } }, "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew=="], "validate-npm-package-name": ["validate-npm-package-name@5.0.1", "", {}, "sha512-OljLrQ9SQdOUqTaQxqL5dEfZWrXExyyWsozYlAWFawPVNuD83igl7uJD2RTkNMbniIYgt8l81eCJGIdQF7avLQ=="], + "vary": ["vary@1.1.2", "", {}, "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg=="], + "verkit": ["verkit@0.5.0", "", {}, "sha512-u4J1hr6Y+C/hit34GwL3eIcUf3wngT8TlYUjK7tk0jxydKLAq3sYvifjdTDA6U3KCKRcQCQDGf/srjxfZF3l7g=="], "vfile": ["vfile@6.0.3", "", { "dependencies": { "@types/unist": "^3.0.0", "vfile-message": "^4.0.0" } }, "sha512-KzIbH/9tXat2u30jf+smMwFCsno4wHVdNmzFyL+T/L3UGqqk6JKfVqOFOZEpZSHADH1k40ab6NUIXZq422ov3Q=="], @@ -3294,6 +3739,8 @@ "vitefu": ["vitefu@1.1.4", "", { "peerDependencies": { "vite": "^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0" }, "optionalPeers": ["vite"] }, "sha512-qbEIDswfXH3x3IYRMScl/bf1AVW0dn7Z8qkr7g7nohkusfuC7tcFa7t5EoTOz60AunosLM9sDrDjHxsX+Up+CQ=="], + "vlq": ["vlq@1.0.1", "", {}, "sha512-gQpnTgkubC6hQgdIcRdYGDSDc+SaujOdyesZQMv6JlfQee/9Mp0Qhnys6WxDWvQnL5WZdT7o2Ul187aSt0Rq+w=="], + "vscode-jsonrpc": ["vscode-jsonrpc@10.0.0", "", {}, "sha512-USSfxg0vDIpTQqlQBGxF3mBARyoS8cU7LHLpbYNh6dOJt32dlskxPWB0Irrh5TllTmyf7oNLAvqDqzklbwwnpA=="], "vscode-languageserver-protocol": ["vscode-languageserver-protocol@3.18.5", "", { "dependencies": { "vscode-jsonrpc": "10.0.0", "vscode-languageserver-types": "3.18.5" } }, "sha512-FW4fBMzZ99N8xeob4py0l050wgCoRgTpEq5Xcsb9lM1bc29UKGR/wSV+4knaqFxssFHajy7OzNiKP/m3U1ZEuA=="], @@ -3306,8 +3753,12 @@ "walk-up-path": ["walk-up-path@3.0.1", "", {}, "sha512-9YlCL/ynK3CTlrSRrDxZvUauLzAswPCrsaCgilqFevUYpeEW0/3ScEjaa3kbW/T0ghhkEr7mv+fpjqn1Y1YuTA=="], + "walker": ["walker@1.0.8", "", { "dependencies": { "makeerror": "1.0.12" } }, "sha512-ts/8E8l5b7kY0vlWLewOkDXMmPdLcVV4GmOQLyxuSswIJsweeFZtAsMF7k1Nszz+TYBQrlYRmzOnr398y1JemQ=="], + "watchpack": ["watchpack@2.6.4", "", { "dependencies": { "graceful-fs": "^4.1.2" } }, "sha512-5H3Tce2GfzWbcr9VnSqyak2whFaONw4BdmI5BDnMXold4qSlCFd64XaMQESRh2vkDKmdUkv6rUo17UvZ9f9nXw=="], + "wcwidth": ["wcwidth@1.0.1", "", { "dependencies": { "defaults": "^1.0.3" } }, "sha512-XHPEwS0q6TaxcvG85+8EYkbiCux2XtWG2mkc47Ng2A77BQu9+DqIOJldST4HgPkuea7dvKSj5VgX3P1d4rW8Tg=="], + "web-vitals": ["web-vitals@4.2.4", "", {}, "sha512-r4DIlprAGwJ7YM11VZp4R884m0Vmgr6EAKe3P+kO0PPj3Unqyvv59rczf6UiGcb9Z8QxZVcqKNwv/g0WNdWwsw=="], "webpack": ["webpack@5.112.2", "", { "dependencies": { "@types/estree": "^1.0.8", "@types/json-schema": "^7.0.15", "@webassemblyjs/ast": "^1.14.1", "@webassemblyjs/wasm-edit": "^1.14.1", "@webassemblyjs/wasm-parser": "^1.14.1", "browserslist": "^4.28.1", "chrome-trace-event": "^1.0.2", "enhanced-resolve": "^5.26.0", "es-module-lexer": "^2.1.0", "events": "^3.2.0", "graceful-fs": "^4.2.11", "mime-db": "^1.54.0", "minimizer-webpack-plugin": "^5.13.0", "schema-utils": "^4.8.1", "tapable": "^2.3.0", "watchpack": "^2.6.3", "webpack-sources": "^3.6.0" }, "peerDependencies": { "webpack-cli": "*" }, "optionalPeers": ["webpack-cli"], "bin": { "webpack": "bin/webpack.js" } }, "sha512-B2tp1LI9D8GVpPDqprdt12ukTkXXahj9MzqSWJq4faSPgOUM7CdZaGAB6HrL/8E6UwbBpdj4vzWDbKoFnVoU6g=="], @@ -3316,15 +3767,19 @@ "webpack-virtual-modules": ["webpack-virtual-modules@0.6.2", "", {}, "sha512-66/V2i5hQanC51vBQKPH4aI8NMAcBW59FVBs+rC7eGHupMyfn34q7rZIE+ETlJ+XTevqfUhVVBgSUNSW2flEUQ=="], + "whatwg-fetch": ["whatwg-fetch@3.6.20", "", {}, "sha512-EqhiFU6daOA8kpjOWTL0olhVOF3i7OrFzSYiGsEMB8GcXS+RrzauAERX65xMeNWVqxA6HXH2m69Z9LaKKdisfg=="], + "whatwg-mimetype": ["whatwg-mimetype@3.0.0", "", {}, "sha512-nt+N2dzIutVRxARx1nghPKGv1xHikU7HKdfafKkLNLindmPU/ch3U31NOCGGA/dmPcmb1VlofO0vnKAcsm0o/Q=="], + "whatwg-url-minimum": ["whatwg-url-minimum@0.2.0", "", {}, "sha512-BtjXU1caNcCFfETP2DhqSeVPfRDl2MTUitI107RE34rJXjR/izfUtR5IoTFOK1WqjNLXbbeqaCH/mQAOLjpc8g=="], + "which": ["which@2.0.2", "", { "dependencies": { "isexe": "^2.0.0" }, "bin": { "node-which": "./bin/node-which" } }, "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA=="], "which-module": ["which-module@2.0.1", "", {}, "sha512-iBdZ57RDvnOR9AGBhML2vFZf7h8vmBjhoaZqODJBFWHVtKkDmKuHai3cx5PgVMrX5YDNp27AofYbAwctSS+vhQ=="], "word-wrap": ["word-wrap@1.2.5", "", {}, "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA=="], - "wrap-ansi": ["wrap-ansi@6.2.0", "", { "dependencies": { "ansi-styles": "^4.0.0", "string-width": "^4.1.0", "strip-ansi": "^6.0.0" } }, "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA=="], + "wrap-ansi": ["wrap-ansi@7.0.0", "", { "dependencies": { "ansi-styles": "^4.0.0", "string-width": "^4.1.0", "strip-ansi": "^6.0.0" } }, "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q=="], "wrap-ansi-cjs": ["wrap-ansi@7.0.0", "", { "dependencies": { "ansi-styles": "^4.0.0", "string-width": "^4.1.0", "strip-ansi": "^6.0.0" } }, "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q=="], @@ -3334,15 +3789,21 @@ "wsl-utils": ["wsl-utils@0.1.0", "", { "dependencies": { "is-wsl": "^3.1.0" } }, "sha512-h3Fbisa2nKGPxCpm89Hk33lBLsnaGBvctQopaBSOW/uIs6FTe1ATyAnKFJrzVs9vpGdsTe73WF3V4lIsk4Gacw=="], - "y18n": ["y18n@4.0.3", "", {}, "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ=="], + "xcode": ["xcode@4.0.0", "", { "dependencies": { "simple-plist": "^1.3.1" } }, "sha512-dDaoWzc9EP2fp9FS9PVZUkyvFxY4y1TOV9pcKaKLk++Ei/qb97XDFEVP7GnW7Osii/TzVABJ0jq2F+9/lq0TVA=="], + + "xml2js": ["xml2js@0.6.0", "", { "dependencies": { "sax": ">=0.6.0", "xmlbuilder": "~11.0.0" } }, "sha512-eLTh0kA8uHceqesPqSE+VvO1CDDJWMwlQfB6LuN6T8w6MaDJ8Txm8P7s5cHD0miF0V+GGTZrDQfxPZQVsur33w=="], + + "xmlbuilder": ["xmlbuilder@15.1.1", "", {}, "sha512-yMqGBqtXyeN1e3TGYvgNgDVZ3j84W4cwkOXQswghol6APgZWaff9lnbvN7MHYJOiXsvGPXtjTYJEiC9J2wv9Eg=="], + + "y18n": ["y18n@5.0.8", "", {}, "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA=="], "yallist": ["yallist@3.1.1", "", {}, "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g=="], "yaml": ["yaml@2.9.1", "", { "bin": { "yaml": "bin.mjs" } }, "sha512-3NxN8+78OdzbT7C/WjGsyfPAtJaN3FNDsWxv7Y7mcDsT/oOmgW8BpyQQFFBnvZE3j9Y2Sdz1ULFLezL7Eb2yFw=="], - "yargs": ["yargs@15.4.1", "", { "dependencies": { "cliui": "^6.0.0", "decamelize": "^1.2.0", "find-up": "^4.1.0", "get-caller-file": "^2.0.1", "require-directory": "^2.1.1", "require-main-filename": "^2.0.0", "set-blocking": "^2.0.0", "string-width": "^4.2.0", "which-module": "^2.0.0", "y18n": "^4.0.0", "yargs-parser": "^18.1.2" } }, "sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A=="], + "yargs": ["yargs@17.7.3", "", { "dependencies": { "cliui": "^8.0.1", "escalade": "^3.1.1", "get-caller-file": "^2.0.5", "require-directory": "^2.1.1", "string-width": "^4.2.3", "y18n": "^5.0.5", "yargs-parser": "^21.1.1" } }, "sha512-GZtjxm/J/4TSxuL3FNYjCmLktBTnIw/rVmKSIyKeYAZpmJB2ig9VauCC5xsa82GNKVKDAqpOn3KVzNt0zmrU0g=="], - "yargs-parser": ["yargs-parser@18.1.3", "", { "dependencies": { "camelcase": "^5.0.0", "decamelize": "^1.2.0" } }, "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ=="], + "yargs-parser": ["yargs-parser@21.1.1", "", {}, "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw=="], "yocto-queue": ["yocto-queue@0.1.0", "", {}, "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q=="], @@ -3420,8 +3881,28 @@ "@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly/@babel/helper-plugin-utils": ["@babel/helper-plugin-utils@7.29.7", "", {}, "sha512-G7sHYigPY17oO5SYWnfD/0MTBwVR781S/JI643e/JhUYgVgWE/61SoW3NH9KWUKyKq5LVh3npif99Wkt6j86Jw=="], + "@babel/plugin-proposal-decorators/@babel/core": ["@babel/core@7.29.13", "", { "dependencies": { "@babel/code-frame": "^7.29.7", "@babel/generator": "^7.29.13", "@babel/helper-compilation-targets": "^7.29.13", "@babel/helper-module-transforms": "^7.29.13", "@babel/helpers": "^7.29.13", "@babel/parser": "^7.29.13", "@babel/template": "^7.29.7", "@babel/traverse": "^7.29.13", "@babel/types": "^7.29.11", "@jridgewell/remapping": "^2.3.5", "convert-source-map": "^2.0.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.2", "json5": "^2.2.3", "semver": "^6.3.1" } }, "sha512-j1nvOQCZYSgp7HLmisnCXFTpVvFODiijQ9QHkORfGKWH6YDtskTEeCJS7eV545GZ9UBzrq0e2xsOd5QQ5PjIqw=="], + + "@babel/plugin-proposal-decorators/@babel/helper-plugin-utils": ["@babel/helper-plugin-utils@7.29.7", "", {}, "sha512-G7sHYigPY17oO5SYWnfD/0MTBwVR781S/JI643e/JhUYgVgWE/61SoW3NH9KWUKyKq5LVh3npif99Wkt6j86Jw=="], + + "@babel/plugin-proposal-export-default-from/@babel/core": ["@babel/core@7.29.13", "", { "dependencies": { "@babel/code-frame": "^7.29.7", "@babel/generator": "^7.29.13", "@babel/helper-compilation-targets": "^7.29.13", "@babel/helper-module-transforms": "^7.29.13", "@babel/helpers": "^7.29.13", "@babel/parser": "^7.29.13", "@babel/template": "^7.29.7", "@babel/traverse": "^7.29.13", "@babel/types": "^7.29.11", "@jridgewell/remapping": "^2.3.5", "convert-source-map": "^2.0.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.2", "json5": "^2.2.3", "semver": "^6.3.1" } }, "sha512-j1nvOQCZYSgp7HLmisnCXFTpVvFODiijQ9QHkORfGKWH6YDtskTEeCJS7eV545GZ9UBzrq0e2xsOd5QQ5PjIqw=="], + + "@babel/plugin-proposal-export-default-from/@babel/helper-plugin-utils": ["@babel/helper-plugin-utils@7.29.7", "", {}, "sha512-G7sHYigPY17oO5SYWnfD/0MTBwVR781S/JI643e/JhUYgVgWE/61SoW3NH9KWUKyKq5LVh3npif99Wkt6j86Jw=="], + "@babel/plugin-proposal-private-property-in-object/@babel/core": ["@babel/core@7.29.13", "", { "dependencies": { "@babel/code-frame": "^7.29.7", "@babel/generator": "^7.29.13", "@babel/helper-compilation-targets": "^7.29.13", "@babel/helper-module-transforms": "^7.29.13", "@babel/helpers": "^7.29.13", "@babel/parser": "^7.29.13", "@babel/template": "^7.29.7", "@babel/traverse": "^7.29.13", "@babel/types": "^7.29.11", "@jridgewell/remapping": "^2.3.5", "convert-source-map": "^2.0.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.2", "json5": "^2.2.3", "semver": "^6.3.1" } }, "sha512-j1nvOQCZYSgp7HLmisnCXFTpVvFODiijQ9QHkORfGKWH6YDtskTEeCJS7eV545GZ9UBzrq0e2xsOd5QQ5PjIqw=="], + "@babel/plugin-syntax-decorators/@babel/core": ["@babel/core@7.29.13", "", { "dependencies": { "@babel/code-frame": "^7.29.7", "@babel/generator": "^7.29.13", "@babel/helper-compilation-targets": "^7.29.13", "@babel/helper-module-transforms": "^7.29.13", "@babel/helpers": "^7.29.13", "@babel/parser": "^7.29.13", "@babel/template": "^7.29.7", "@babel/traverse": "^7.29.13", "@babel/types": "^7.29.11", "@jridgewell/remapping": "^2.3.5", "convert-source-map": "^2.0.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.2", "json5": "^2.2.3", "semver": "^6.3.1" } }, "sha512-j1nvOQCZYSgp7HLmisnCXFTpVvFODiijQ9QHkORfGKWH6YDtskTEeCJS7eV545GZ9UBzrq0e2xsOd5QQ5PjIqw=="], + + "@babel/plugin-syntax-decorators/@babel/helper-plugin-utils": ["@babel/helper-plugin-utils@7.29.7", "", {}, "sha512-G7sHYigPY17oO5SYWnfD/0MTBwVR781S/JI643e/JhUYgVgWE/61SoW3NH9KWUKyKq5LVh3npif99Wkt6j86Jw=="], + + "@babel/plugin-syntax-dynamic-import/@babel/core": ["@babel/core@7.29.13", "", { "dependencies": { "@babel/code-frame": "^7.29.7", "@babel/generator": "^7.29.13", "@babel/helper-compilation-targets": "^7.29.13", "@babel/helper-module-transforms": "^7.29.13", "@babel/helpers": "^7.29.13", "@babel/parser": "^7.29.13", "@babel/template": "^7.29.7", "@babel/traverse": "^7.29.13", "@babel/types": "^7.29.11", "@jridgewell/remapping": "^2.3.5", "convert-source-map": "^2.0.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.2", "json5": "^2.2.3", "semver": "^6.3.1" } }, "sha512-j1nvOQCZYSgp7HLmisnCXFTpVvFODiijQ9QHkORfGKWH6YDtskTEeCJS7eV545GZ9UBzrq0e2xsOd5QQ5PjIqw=="], + + "@babel/plugin-syntax-dynamic-import/@babel/helper-plugin-utils": ["@babel/helper-plugin-utils@7.29.7", "", {}, "sha512-G7sHYigPY17oO5SYWnfD/0MTBwVR781S/JI643e/JhUYgVgWE/61SoW3NH9KWUKyKq5LVh3npif99Wkt6j86Jw=="], + + "@babel/plugin-syntax-export-default-from/@babel/core": ["@babel/core@7.29.13", "", { "dependencies": { "@babel/code-frame": "^7.29.7", "@babel/generator": "^7.29.13", "@babel/helper-compilation-targets": "^7.29.13", "@babel/helper-module-transforms": "^7.29.13", "@babel/helpers": "^7.29.13", "@babel/parser": "^7.29.13", "@babel/template": "^7.29.7", "@babel/traverse": "^7.29.13", "@babel/types": "^7.29.11", "@jridgewell/remapping": "^2.3.5", "convert-source-map": "^2.0.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.2", "json5": "^2.2.3", "semver": "^6.3.1" } }, "sha512-j1nvOQCZYSgp7HLmisnCXFTpVvFODiijQ9QHkORfGKWH6YDtskTEeCJS7eV545GZ9UBzrq0e2xsOd5QQ5PjIqw=="], + + "@babel/plugin-syntax-export-default-from/@babel/helper-plugin-utils": ["@babel/helper-plugin-utils@7.29.7", "", {}, "sha512-G7sHYigPY17oO5SYWnfD/0MTBwVR781S/JI643e/JhUYgVgWE/61SoW3NH9KWUKyKq5LVh3npif99Wkt6j86Jw=="], + "@babel/plugin-syntax-import-assertions/@babel/core": ["@babel/core@7.29.13", "", { "dependencies": { "@babel/code-frame": "^7.29.7", "@babel/generator": "^7.29.13", "@babel/helper-compilation-targets": "^7.29.13", "@babel/helper-module-transforms": "^7.29.13", "@babel/helpers": "^7.29.13", "@babel/parser": "^7.29.13", "@babel/template": "^7.29.7", "@babel/traverse": "^7.29.13", "@babel/types": "^7.29.11", "@jridgewell/remapping": "^2.3.5", "convert-source-map": "^2.0.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.2", "json5": "^2.2.3", "semver": "^6.3.1" } }, "sha512-j1nvOQCZYSgp7HLmisnCXFTpVvFODiijQ9QHkORfGKWH6YDtskTEeCJS7eV545GZ9UBzrq0e2xsOd5QQ5PjIqw=="], "@babel/plugin-syntax-import-assertions/@babel/helper-plugin-utils": ["@babel/helper-plugin-utils@7.29.7", "", {}, "sha512-G7sHYigPY17oO5SYWnfD/0MTBwVR781S/JI643e/JhUYgVgWE/61SoW3NH9KWUKyKq5LVh3npif99Wkt6j86Jw=="], @@ -3430,6 +3911,14 @@ "@babel/plugin-syntax-import-attributes/@babel/helper-plugin-utils": ["@babel/helper-plugin-utils@7.29.7", "", {}, "sha512-G7sHYigPY17oO5SYWnfD/0MTBwVR781S/JI643e/JhUYgVgWE/61SoW3NH9KWUKyKq5LVh3npif99Wkt6j86Jw=="], + "@babel/plugin-syntax-nullish-coalescing-operator/@babel/core": ["@babel/core@7.29.13", "", { "dependencies": { "@babel/code-frame": "^7.29.7", "@babel/generator": "^7.29.13", "@babel/helper-compilation-targets": "^7.29.13", "@babel/helper-module-transforms": "^7.29.13", "@babel/helpers": "^7.29.13", "@babel/parser": "^7.29.13", "@babel/template": "^7.29.7", "@babel/traverse": "^7.29.13", "@babel/types": "^7.29.11", "@jridgewell/remapping": "^2.3.5", "convert-source-map": "^2.0.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.2", "json5": "^2.2.3", "semver": "^6.3.1" } }, "sha512-j1nvOQCZYSgp7HLmisnCXFTpVvFODiijQ9QHkORfGKWH6YDtskTEeCJS7eV545GZ9UBzrq0e2xsOd5QQ5PjIqw=="], + + "@babel/plugin-syntax-nullish-coalescing-operator/@babel/helper-plugin-utils": ["@babel/helper-plugin-utils@7.29.7", "", {}, "sha512-G7sHYigPY17oO5SYWnfD/0MTBwVR781S/JI643e/JhUYgVgWE/61SoW3NH9KWUKyKq5LVh3npif99Wkt6j86Jw=="], + + "@babel/plugin-syntax-optional-chaining/@babel/core": ["@babel/core@7.29.13", "", { "dependencies": { "@babel/code-frame": "^7.29.7", "@babel/generator": "^7.29.13", "@babel/helper-compilation-targets": "^7.29.13", "@babel/helper-module-transforms": "^7.29.13", "@babel/helpers": "^7.29.13", "@babel/parser": "^7.29.13", "@babel/template": "^7.29.7", "@babel/traverse": "^7.29.13", "@babel/types": "^7.29.11", "@jridgewell/remapping": "^2.3.5", "convert-source-map": "^2.0.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.2", "json5": "^2.2.3", "semver": "^6.3.1" } }, "sha512-j1nvOQCZYSgp7HLmisnCXFTpVvFODiijQ9QHkORfGKWH6YDtskTEeCJS7eV545GZ9UBzrq0e2xsOd5QQ5PjIqw=="], + + "@babel/plugin-syntax-optional-chaining/@babel/helper-plugin-utils": ["@babel/helper-plugin-utils@7.29.7", "", {}, "sha512-G7sHYigPY17oO5SYWnfD/0MTBwVR781S/JI643e/JhUYgVgWE/61SoW3NH9KWUKyKq5LVh3npif99Wkt6j86Jw=="], + "@babel/plugin-syntax-unicode-sets-regex/@babel/core": ["@babel/core@7.29.13", "", { "dependencies": { "@babel/code-frame": "^7.29.7", "@babel/generator": "^7.29.13", "@babel/helper-compilation-targets": "^7.29.13", "@babel/helper-module-transforms": "^7.29.13", "@babel/helpers": "^7.29.13", "@babel/parser": "^7.29.13", "@babel/template": "^7.29.7", "@babel/traverse": "^7.29.13", "@babel/types": "^7.29.11", "@jridgewell/remapping": "^2.3.5", "convert-source-map": "^2.0.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.2", "json5": "^2.2.3", "semver": "^6.3.1" } }, "sha512-j1nvOQCZYSgp7HLmisnCXFTpVvFODiijQ9QHkORfGKWH6YDtskTEeCJS7eV545GZ9UBzrq0e2xsOd5QQ5PjIqw=="], "@babel/plugin-syntax-unicode-sets-regex/@babel/helper-plugin-utils": ["@babel/helper-plugin-utils@7.29.7", "", {}, "sha512-G7sHYigPY17oO5SYWnfD/0MTBwVR781S/JI643e/JhUYgVgWE/61SoW3NH9KWUKyKq5LVh3npif99Wkt6j86Jw=="], @@ -3506,6 +3995,12 @@ "@babel/plugin-transform-export-namespace-from/@babel/helper-plugin-utils": ["@babel/helper-plugin-utils@7.29.7", "", {}, "sha512-G7sHYigPY17oO5SYWnfD/0MTBwVR781S/JI643e/JhUYgVgWE/61SoW3NH9KWUKyKq5LVh3npif99Wkt6j86Jw=="], + "@babel/plugin-transform-flow-strip-types/@babel/core": ["@babel/core@7.29.13", "", { "dependencies": { "@babel/code-frame": "^7.29.7", "@babel/generator": "^7.29.13", "@babel/helper-compilation-targets": "^7.29.13", "@babel/helper-module-transforms": "^7.29.13", "@babel/helpers": "^7.29.13", "@babel/parser": "^7.29.13", "@babel/template": "^7.29.7", "@babel/traverse": "^7.29.13", "@babel/types": "^7.29.11", "@jridgewell/remapping": "^2.3.5", "convert-source-map": "^2.0.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.2", "json5": "^2.2.3", "semver": "^6.3.1" } }, "sha512-j1nvOQCZYSgp7HLmisnCXFTpVvFODiijQ9QHkORfGKWH6YDtskTEeCJS7eV545GZ9UBzrq0e2xsOd5QQ5PjIqw=="], + + "@babel/plugin-transform-flow-strip-types/@babel/helper-plugin-utils": ["@babel/helper-plugin-utils@7.29.7", "", {}, "sha512-G7sHYigPY17oO5SYWnfD/0MTBwVR781S/JI643e/JhUYgVgWE/61SoW3NH9KWUKyKq5LVh3npif99Wkt6j86Jw=="], + + "@babel/plugin-transform-flow-strip-types/@babel/plugin-syntax-flow": ["@babel/plugin-syntax-flow@7.29.7", "", { "dependencies": { "@babel/helper-plugin-utils": "^7.29.7" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-ajMX6QPcyomotqwpzhkYGxcK2i/us0rs1Qo9QvUpa+Fca0FTmqrzKrctoIYLMxcOhGZldGT/BAVkRGTWBiR8gQ=="], + "@babel/plugin-transform-for-of/@babel/core": ["@babel/core@7.29.13", "", { "dependencies": { "@babel/code-frame": "^7.29.7", "@babel/generator": "^7.29.13", "@babel/helper-compilation-targets": "^7.29.13", "@babel/helper-module-transforms": "^7.29.13", "@babel/helpers": "^7.29.13", "@babel/parser": "^7.29.13", "@babel/template": "^7.29.7", "@babel/traverse": "^7.29.13", "@babel/types": "^7.29.11", "@jridgewell/remapping": "^2.3.5", "convert-source-map": "^2.0.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.2", "json5": "^2.2.3", "semver": "^6.3.1" } }, "sha512-j1nvOQCZYSgp7HLmisnCXFTpVvFODiijQ9QHkORfGKWH6YDtskTEeCJS7eV545GZ9UBzrq0e2xsOd5QQ5PjIqw=="], "@babel/plugin-transform-for-of/@babel/helper-plugin-utils": ["@babel/helper-plugin-utils@7.29.7", "", {}, "sha512-G7sHYigPY17oO5SYWnfD/0MTBwVR781S/JI643e/JhUYgVgWE/61SoW3NH9KWUKyKq5LVh3npif99Wkt6j86Jw=="], @@ -3626,9 +4121,17 @@ "@babel/plugin-transform-reserved-words/@babel/helper-plugin-utils": ["@babel/helper-plugin-utils@7.29.7", "", {}, "sha512-G7sHYigPY17oO5SYWnfD/0MTBwVR781S/JI643e/JhUYgVgWE/61SoW3NH9KWUKyKq5LVh3npif99Wkt6j86Jw=="], - "@babel/plugin-transform-shorthand-properties/@babel/core": ["@babel/core@7.29.13", "", { "dependencies": { "@babel/code-frame": "^7.29.7", "@babel/generator": "^7.29.13", "@babel/helper-compilation-targets": "^7.29.13", "@babel/helper-module-transforms": "^7.29.13", "@babel/helpers": "^7.29.13", "@babel/parser": "^7.29.13", "@babel/template": "^7.29.7", "@babel/traverse": "^7.29.13", "@babel/types": "^7.29.11", "@jridgewell/remapping": "^2.3.5", "convert-source-map": "^2.0.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.2", "json5": "^2.2.3", "semver": "^6.3.1" } }, "sha512-j1nvOQCZYSgp7HLmisnCXFTpVvFODiijQ9QHkORfGKWH6YDtskTEeCJS7eV545GZ9UBzrq0e2xsOd5QQ5PjIqw=="], + "@babel/plugin-transform-runtime/@babel/core": ["@babel/core@7.29.13", "", { "dependencies": { "@babel/code-frame": "^7.29.7", "@babel/generator": "^7.29.13", "@babel/helper-compilation-targets": "^7.29.13", "@babel/helper-module-transforms": "^7.29.13", "@babel/helpers": "^7.29.13", "@babel/parser": "^7.29.13", "@babel/template": "^7.29.7", "@babel/traverse": "^7.29.13", "@babel/types": "^7.29.11", "@jridgewell/remapping": "^2.3.5", "convert-source-map": "^2.0.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.2", "json5": "^2.2.3", "semver": "^6.3.1" } }, "sha512-j1nvOQCZYSgp7HLmisnCXFTpVvFODiijQ9QHkORfGKWH6YDtskTEeCJS7eV545GZ9UBzrq0e2xsOd5QQ5PjIqw=="], - "@babel/plugin-transform-shorthand-properties/@babel/helper-plugin-utils": ["@babel/helper-plugin-utils@7.29.7", "", {}, "sha512-G7sHYigPY17oO5SYWnfD/0MTBwVR781S/JI643e/JhUYgVgWE/61SoW3NH9KWUKyKq5LVh3npif99Wkt6j86Jw=="], + "@babel/plugin-transform-runtime/@babel/helper-plugin-utils": ["@babel/helper-plugin-utils@7.29.7", "", {}, "sha512-G7sHYigPY17oO5SYWnfD/0MTBwVR781S/JI643e/JhUYgVgWE/61SoW3NH9KWUKyKq5LVh3npif99Wkt6j86Jw=="], + + "@babel/plugin-transform-runtime/babel-plugin-polyfill-corejs3": ["babel-plugin-polyfill-corejs3@0.13.0", "", { "dependencies": { "@babel/helper-define-polyfill-provider": "^0.6.5", "core-js-compat": "^3.43.0" }, "peerDependencies": { "@babel/core": "^7.4.0 || ^8.0.0-0 <8.0.0" } }, "sha512-U+GNwMdSFgzVmfhNm8GJUX88AadB3uo9KpJqS3FaqNIPKgySuvMb+bHPsOmmuWyIcuqZj/pzt1RUIUZns4y2+A=="], + + "@babel/plugin-transform-runtime/semver": ["semver@6.3.2", "", { "bin": { "semver": "bin/semver.js" } }, "sha512-GYrCADwpu6yV5OAvchkQ27Z5wwMxWAEMg5NNWjyHh/5DboFFqbdbvYNIvZouQpxXyeMPoTOh0vdPYKlf0ZswdQ=="], + + "@babel/plugin-transform-shorthand-properties/@babel/core": ["@babel/core@7.29.13", "", { "dependencies": { "@babel/code-frame": "^7.29.7", "@babel/generator": "^7.29.13", "@babel/helper-compilation-targets": "^7.29.13", "@babel/helper-module-transforms": "^7.29.13", "@babel/helpers": "^7.29.13", "@babel/parser": "^7.29.13", "@babel/template": "^7.29.7", "@babel/traverse": "^7.29.13", "@babel/types": "^7.29.11", "@jridgewell/remapping": "^2.3.5", "convert-source-map": "^2.0.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.2", "json5": "^2.2.3", "semver": "^6.3.1" } }, "sha512-j1nvOQCZYSgp7HLmisnCXFTpVvFODiijQ9QHkORfGKWH6YDtskTEeCJS7eV545GZ9UBzrq0e2xsOd5QQ5PjIqw=="], + + "@babel/plugin-transform-shorthand-properties/@babel/helper-plugin-utils": ["@babel/helper-plugin-utils@7.29.7", "", {}, "sha512-G7sHYigPY17oO5SYWnfD/0MTBwVR781S/JI643e/JhUYgVgWE/61SoW3NH9KWUKyKq5LVh3npif99Wkt6j86Jw=="], "@babel/plugin-transform-spread/@babel/core": ["@babel/core@7.29.13", "", { "dependencies": { "@babel/code-frame": "^7.29.7", "@babel/generator": "^7.29.13", "@babel/helper-compilation-targets": "^7.29.13", "@babel/helper-module-transforms": "^7.29.13", "@babel/helpers": "^7.29.13", "@babel/parser": "^7.29.13", "@babel/template": "^7.29.7", "@babel/traverse": "^7.29.13", "@babel/types": "^7.29.11", "@jridgewell/remapping": "^2.3.5", "convert-source-map": "^2.0.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.2", "json5": "^2.2.3", "semver": "^6.3.1" } }, "sha512-j1nvOQCZYSgp7HLmisnCXFTpVvFODiijQ9QHkORfGKWH6YDtskTEeCJS7eV545GZ9UBzrq0e2xsOd5QQ5PjIqw=="], @@ -3714,6 +4217,34 @@ "@eslint-community/eslint-utils/eslint-visitor-keys": ["eslint-visitor-keys@3.4.3", "", {}, "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag=="], + "@expo/devcert/debug": ["debug@3.2.7", "", { "dependencies": { "ms": "^2.1.1" } }, "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ=="], + + "@expo/fingerprint/minimatch": ["minimatch@10.2.6", "", { "dependencies": { "brace-expansion": "^5.0.8" } }, "sha512-vpLQEs+VLCr1nU0BXS07maYoFwlDAH0gngQuuttxIwutDFEMHq2blX+8vpgxDdK3J1PwjCJiep77OitTZ4Ll1A=="], + + "@expo/json-file/@babel/code-frame": ["@babel/code-frame@7.29.7", "", { "dependencies": { "@babel/helper-validator-identifier": "^7.29.7", "js-tokens": "^4.0.0", "picocolors": "^1.1.1" } }, "sha512-Aup7aUOfpbAUg2ROOJN6Iw5f9DMBlzu0mIkm/malLQFN/YQgO48wCj0Kxa3sEHJvPVFg7siR+qRInwXd2qhQKw=="], + + "@expo/metro/metro-source-map": ["metro-source-map@0.87.1", "", { "dependencies": { "@babel/traverse": "^7.29.0", "@babel/types": "^7.29.0", "flow-enums-runtime": "^0.0.6", "invariant": "^2.2.4", "metro-symbolicate": "0.87.1", "nullthrows": "^1.1.1", "ob1": "0.87.1", "source-map": "^0.5.6", "vlq": "^1.0.0" } }, "sha512-Bqpm0PBGdy53pigIJb4HRF7QxD2pUOdgSmVh/4AWbP635kSCv+Y6ltVxUZgSnzS/QbSmzyCGijmRPlXMj2/qHw=="], + + "@expo/metro-config/@babel/code-frame": ["@babel/code-frame@7.29.7", "", { "dependencies": { "@babel/helper-validator-identifier": "^7.29.7", "js-tokens": "^4.0.0", "picocolors": "^1.1.1" } }, "sha512-Aup7aUOfpbAUg2ROOJN6Iw5f9DMBlzu0mIkm/malLQFN/YQgO48wCj0Kxa3sEHJvPVFg7siR+qRInwXd2qhQKw=="], + + "@expo/metro-config/@babel/core": ["@babel/core@7.29.13", "", { "dependencies": { "@babel/code-frame": "^7.29.7", "@babel/generator": "^7.29.13", "@babel/helper-compilation-targets": "^7.29.13", "@babel/helper-module-transforms": "^7.29.13", "@babel/helpers": "^7.29.13", "@babel/parser": "^7.29.13", "@babel/template": "^7.29.7", "@babel/traverse": "^7.29.13", "@babel/types": "^7.29.11", "@jridgewell/remapping": "^2.3.5", "convert-source-map": "^2.0.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.2", "json5": "^2.2.3", "semver": "^6.3.1" } }, "sha512-j1nvOQCZYSgp7HLmisnCXFTpVvFODiijQ9QHkORfGKWH6YDtskTEeCJS7eV545GZ9UBzrq0e2xsOd5QQ5PjIqw=="], + + "@expo/metro-config/@babel/generator": ["@babel/generator@7.29.14", "", { "dependencies": { "@babel/parser": "^7.29.14", "@babel/types": "^7.29.14", "@jridgewell/gen-mapping": "^0.3.12", "@jridgewell/trace-mapping": "^0.3.28", "jsesc": "^3.0.2" } }, "sha512-qSY56jgW5JnSXzuekLVil6zaOQxOCtOHidr65KkaMBw772IuAY28Qx4ZykAcDn8+FRF15qk80XzKwgSc/RYW6g=="], + + "@expo/metro-config/browserslist": ["browserslist@4.29.6", "", { "dependencies": { "baseline-browser-mapping": "^2.11.37", "caniuse-lite": "^1.0.30001826", "electron-to-chromium": "^1.5.486", "node-releases": "^2.0.64", "update-browserslist-db": "^1.4.0" }, "bin": { "browserslist": "cli.js" } }, "sha512-CmVVIQ3RVc5HxYEc9X84GvxK/C8C1wH8TlKAiO7uTxF8PDwt7r8t9Qk3J9NkMOVzX5O/HbLv3yzxZg9HPrnI9w=="], + + "@expo/metro-config/hermes-parser": ["hermes-parser@0.36.1", "", { "dependencies": { "hermes-estree": "0.36.1" } }, "sha512-GApNk4zLHi2UWoWZZkx7LNCOSzLSc5lB55pZ/PhK7ycFeg7u5LcF88p/WbpIi1XUDtE0MpHE3uRR3u3KB7TjSQ=="], + + "@expo/metro-file-map/jest-worker": ["jest-worker@29.7.0", "", { "dependencies": { "@types/node": "*", "jest-util": "^29.7.0", "merge-stream": "^2.0.0", "supports-color": "^8.0.0" } }, "sha512-eIz2msL/EzL9UFTFFx7jBTkeZfku0yUAyZZZmJ93H2TYEiroIx2PQjEXcwYtYl8zXCxb+PAmA2hLIt/6ZEkPHw=="], + + "@expo/require-utils/@babel/code-frame": ["@babel/code-frame@7.29.7", "", { "dependencies": { "@babel/helper-validator-identifier": "^7.29.7", "js-tokens": "^4.0.0", "picocolors": "^1.1.1" } }, "sha512-Aup7aUOfpbAUg2ROOJN6Iw5f9DMBlzu0mIkm/malLQFN/YQgO48wCj0Kxa3sEHJvPVFg7siR+qRInwXd2qhQKw=="], + + "@expo/require-utils/@babel/core": ["@babel/core@7.29.13", "", { "dependencies": { "@babel/code-frame": "^7.29.7", "@babel/generator": "^7.29.13", "@babel/helper-compilation-targets": "^7.29.13", "@babel/helper-module-transforms": "^7.29.13", "@babel/helpers": "^7.29.13", "@babel/parser": "^7.29.13", "@babel/template": "^7.29.7", "@babel/traverse": "^7.29.13", "@babel/types": "^7.29.11", "@jridgewell/remapping": "^2.3.5", "convert-source-map": "^2.0.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.2", "json5": "^2.2.3", "semver": "^6.3.1" } }, "sha512-j1nvOQCZYSgp7HLmisnCXFTpVvFODiijQ9QHkORfGKWH6YDtskTEeCJS7eV545GZ9UBzrq0e2xsOd5QQ5PjIqw=="], + + "@expo/require-utils/@babel/plugin-transform-modules-commonjs": ["@babel/plugin-transform-modules-commonjs@7.29.14", "", { "dependencies": { "@babel/helper-module-transforms": "^7.29.14", "@babel/helper-plugin-utils": "^7.29.7" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-mbv2yy5dqP6e3DbusCx+5AypXkFbyJD/JhG4/XhA+BIADOw5o7W+X0ewSp/h3w7gRL3oR5yny2/K8ljiydj4uA=="], + + "@expo/xcpretty/@babel/code-frame": ["@babel/code-frame@7.29.7", "", { "dependencies": { "@babel/helper-validator-identifier": "^7.29.7", "js-tokens": "^4.0.0", "picocolors": "^1.1.1" } }, "sha512-Aup7aUOfpbAUg2ROOJN6Iw5f9DMBlzu0mIkm/malLQFN/YQgO48wCj0Kxa3sEHJvPVFg7siR+qRInwXd2qhQKw=="], + "@img/sharp-wasm32/@emnapi/runtime": ["@emnapi/runtime@1.11.3", "", { "dependencies": { "tslib": "^2.4.0" } }, "sha512-Xz4Tpyki7XyrpbUK1jR1AhdAdaXyhhY4lZ3neLodmhpuWfy2PAQN5B46sAiU4liOXGLkHypn/qU+jvfWSCYYLA=="], "@internationalized/date/@swc/helpers": ["@swc/helpers@0.5.24", "", {}, "sha512-6tcXo4kA8HgGO7AVmawB57RYi/piBPYVHVcO6dXjX+SZw8GoHmi262sp4v2Ha2kNP9Cx84qei27yT+fjS1lxgg=="], @@ -3722,6 +4253,8 @@ "@isaacs/cliui/string-width": ["string-width@5.1.2", "", { "dependencies": { "eastasianwidth": "^0.2.0", "emoji-regex": "^9.2.2", "strip-ansi": "^7.0.1" } }, "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA=="], + "@isaacs/cliui/strip-ansi": ["strip-ansi@7.2.0", "", { "dependencies": { "ansi-regex": "^6.2.2" } }, "sha512-yDPMNjp4WyfYBkHnjIRLfca1i6KMyGCtsVgoKe/z1+6vukgaENdgGBZt+ZmKPc4gavvEZ5OgHfHdrazhgNyG7w=="], + "@isaacs/cliui/wrap-ansi": ["wrap-ansi@8.1.0", "", { "dependencies": { "ansi-styles": "^6.1.0", "string-width": "^5.0.1", "strip-ansi": "^7.0.1" } }, "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ=="], "@joshwooding/vite-plugin-react-docgen-typescript/glob": ["glob@13.0.7", "", { "dependencies": { "minimatch": "^10.2.2", "minipass": "^7.1.3", "path-scurry": "^2.0.2" } }, "sha512-wfsFgXQ8A3SEI9XGf7Nl3Y9l7ffSrGh7SUCT7vU/2CzYPep9kjxAn1S40F9OPKxAMGCVl7HtNlJhrCJUeUq83g=="], @@ -3730,6 +4263,8 @@ "@kuma-ui/compiler/@babel/core": ["@babel/core@7.29.13", "", { "dependencies": { "@babel/code-frame": "^7.29.7", "@babel/generator": "^7.29.13", "@babel/helper-compilation-targets": "^7.29.13", "@babel/helper-module-transforms": "^7.29.13", "@babel/helpers": "^7.29.13", "@babel/parser": "^7.29.13", "@babel/template": "^7.29.7", "@babel/traverse": "^7.29.13", "@babel/types": "^7.29.11", "@jridgewell/remapping": "^2.3.5", "convert-source-map": "^2.0.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.2", "json5": "^2.2.3", "semver": "^6.3.1" } }, "sha512-j1nvOQCZYSgp7HLmisnCXFTpVvFODiijQ9QHkORfGKWH6YDtskTEeCJS7eV545GZ9UBzrq0e2xsOd5QQ5PjIqw=="], + "@npmcli/config/ci-info": ["ci-info@4.5.0", "", {}, "sha512-d1uM8k5UZEyPza1n/MG3ko8nKupKN0KJpFsipgPcgaCCvV+IqIfJ+NzTjetlLM+UcXZx3+cLrNr76+eAO7G1Mw=="], + "@npmcli/git/which": ["which@4.0.0", "", { "dependencies": { "isexe": "^3.1.1" }, "bin": { "node-which": "bin/which.js" } }, "sha512-GlaYyEb07DPxYCKhKzplCWBJtvxZcZMrL+4UkrTSJHHPyZU4mYYTv3qaOe77H7EODLSSopAUFAc6W8U4yqvscg=="], "@npmcli/map-workspaces/glob": ["glob@10.5.0", "", { "dependencies": { "foreground-child": "^3.1.0", "jackspeak": "^3.1.2", "minimatch": "^9.0.4", "minipass": "^7.1.2", "package-json-from-dist": "^1.0.0", "path-scurry": "^1.11.1" }, "bin": { "glob": "dist/esm/bin.mjs" } }, "sha512-DfXN8DfhJ7NH3Oe7cFmu3NCu1wKbkReJ8TorzSAFbSKrlNaQSKfIzqYqVY8zlbs2NLBbWpRiU52GX2PbaBVNkg=="], @@ -3744,10 +4279,22 @@ "@oxc-resolver/binding-wasm32-wasi/@emnapi/runtime": ["@emnapi/runtime@1.11.0", "", { "dependencies": { "tslib": "^2.4.0" } }, "sha512-55coeOFKHv1ywEcUXJtWU5f+Jr/W5tZDvZig8DLKSwUN1JpROQ4rk/SNOQiFWmaR/VKF4zuFyW1B8JduOSv6Pg=="], + "@pandacss/cli/string-width": ["string-width@7.2.0", "", { "dependencies": { "emoji-regex": "^10.3.0", "get-east-asian-width": "^1.0.0", "strip-ansi": "^7.1.0" } }, "sha512-tsaTIkKW9b4N+AEj+SVA+WhJzV7/zMhcSu78mLKWSk7cXMOSHsBKFWUs0fWwq8QyK3MgJBQRX6Gbi4kYbdvGkQ=="], + "@pandacss/config/magic-string": ["magic-string@0.30.21", "", { "dependencies": { "@jridgewell/sourcemap-codec": "^1.5.5" } }, "sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ=="], "@pandacss/config/rolldown": ["rolldown@1.2.7", "", { "dependencies": { "@oxc-project/types": "=0.148.0", "@rolldown/pluginutils": "^1.0.0" }, "optionalDependencies": { "@rolldown/binding-android-arm-eabi": "1.2.7", "@rolldown/binding-android-arm64": "1.2.7", "@rolldown/binding-darwin-arm64": "1.2.7", "@rolldown/binding-darwin-x64": "1.2.7", "@rolldown/binding-freebsd-x64": "1.2.7", "@rolldown/binding-linux-arm-gnueabihf": "1.2.7", "@rolldown/binding-linux-arm64-gnu": "1.2.7", "@rolldown/binding-linux-arm64-musl": "1.2.7", "@rolldown/binding-linux-ppc64-gnu": "1.2.7", "@rolldown/binding-linux-s390x-gnu": "1.2.7", "@rolldown/binding-linux-x64-gnu": "1.2.7", "@rolldown/binding-linux-x64-musl": "1.2.7", "@rolldown/binding-openharmony-arm64": "1.2.7", "@rolldown/binding-win32-arm64-msvc": "1.2.7", "@rolldown/binding-win32-x64-msvc": "1.2.7" }, "bin": { "rolldown": "./bin/cli.mjs" } }, "sha512-g0EtLvBjTUB7jhyV0S/TCup3v/XSVl45vUIGbOGU4QPiyjTenCe4mKuFvW9fEgYmS2Fo42AUssRmNuMziXdrig=="], + "@react-native/codegen/@babel/core": ["@babel/core@7.29.13", "", { "dependencies": { "@babel/code-frame": "^7.29.7", "@babel/generator": "^7.29.13", "@babel/helper-compilation-targets": "^7.29.13", "@babel/helper-module-transforms": "^7.29.13", "@babel/helpers": "^7.29.13", "@babel/parser": "^7.29.13", "@babel/template": "^7.29.7", "@babel/traverse": "^7.29.13", "@babel/types": "^7.29.11", "@jridgewell/remapping": "^2.3.5", "convert-source-map": "^2.0.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.2", "json5": "^2.2.3", "semver": "^6.3.1" } }, "sha512-j1nvOQCZYSgp7HLmisnCXFTpVvFODiijQ9QHkORfGKWH6YDtskTEeCJS7eV545GZ9UBzrq0e2xsOd5QQ5PjIqw=="], + + "@react-native/codegen/@babel/parser": ["@babel/parser@7.29.14", "", { "dependencies": { "@babel/types": "^7.29.14" }, "bin": "./bin/babel-parser.js" }, "sha512-VL220vXuyO2z3rNIQwY7ftj9UwpqOt+33sH+sBWkOekbsSR2g7EEMnOx24ZlCH0xOA3DM/33SifVFGbnJD8r/w=="], + + "@react-native/community-cli-plugin/commander": ["commander@12.1.0", "", {}, "sha512-Vw8qHK3bZM9y/P10u3Vib8o/DdkvA2OtPtZvD871QKjy74Wj1WSKFILMPRPSdUSx5RFK1arlJzEtA4PkFgnbuA=="], + + "@react-native/dev-middleware/open": ["open@8.4.2", "", { "dependencies": { "define-lazy-prop": "^2.0.0", "is-docker": "^2.1.1", "is-wsl": "^2.2.0" } }, "sha512-7x81NCL719oNbsq/3mh+hVrAWmFuEYUqrq/Iw3kUzH8ReypT9QQ0BLoJS7/G9k6N81XjW4qHWtjWwe/9eLy1EQ=="], + + "@react-native/dev-middleware/ws": ["ws@7.5.14", "", { "peerDependencies": { "bufferutil": "^4.0.1", "utf-8-validate": "^5.0.2" }, "optionalPeers": ["bufferutil", "utf-8-validate"] }, "sha512-u9Oi2nQ8SZnTUAf6spLLKF5TyqoG3Nbbrd4ai6Sjo4P24bycDewhQqtNMIg4bFpnpH/TD4qk4IuAVhT0HIIqug=="], + "@rolldown/binding-wasm32-wasi/@emnapi/core": ["@emnapi/core@2.0.0-beta.2", "", { "dependencies": { "@emnapi/wasi-threads": "2.2.0", "tslib": "^2.4.0" } }, "sha512-MzCVoWtcg4Pm2B3je5mMvYMvj3MmBKw+fU7vbsJc9/iT8ip6/eYIHo/Dsm/mr+wsHB6SEyJDuxB09Yy6r/8+4A=="], "@rolldown/binding-wasm32-wasi/@emnapi/runtime": ["@emnapi/runtime@2.0.0-beta.2", "", { "dependencies": { "tslib": "^2.4.0" } }, "sha512-JcrSPzPvZuNZvJqPTF9Fw25LbOJ8avzFVlaf2grmH4Cku0oGP47tRgqPZadcfj3YoZMHkFVnCYFbQM8I+i5QEw=="], @@ -3758,6 +4305,8 @@ "@rsbuild/core/@swc/helpers": ["@swc/helpers@0.5.24", "", {}, "sha512-6tcXo4kA8HgGO7AVmawB57RYi/piBPYVHVcO6dXjX+SZw8GoHmi262sp4v2Ha2kNP9Cx84qei27yT+fjS1lxgg=="], + "@rsbuild/plugin-react/react-refresh": ["react-refresh@0.19.0", "", {}, "sha512-5HdstYgoJBbBofjapO5qCPcovECJCBfvjLb+iTcsmqDFVMRdqy0qs7iiInBJTUXmIFc2bjoc5b2HVLp2zRtYhQ=="], + "@rspack/binding-wasm32-wasi/@emnapi/core": ["@emnapi/core@2.0.0-beta.3", "", { "dependencies": { "@emnapi/wasi-threads": "2.2.0", "tslib": "^2.4.0" } }, "sha512-KA+gOBtbifRATmUa/Gpf5C2B2EJ0r4brHUT3XSgACeHREcuiObXH56xd+B3fFsEFbUT04VBEe6MuZiCtMp0tQg=="], "@rspack/binding-wasm32-wasi/@emnapi/runtime": ["@emnapi/runtime@2.0.0-beta.3", "", { "dependencies": { "tslib": "^2.4.0" } }, "sha512-ayb/PyyLzpwRyFVxeC0uoEHu59QlB1iWGcGsOpXQcaB/Dc+uGfBmNmpCHp3HmTT0t8lSsMmg3j7+tdJW/TlHjQ=="], @@ -3794,6 +4343,8 @@ "@testing-library/dom/@babel/code-frame": ["@babel/code-frame@7.29.7", "", { "dependencies": { "@babel/helper-validator-identifier": "^7.29.7", "js-tokens": "^4.0.0", "picocolors": "^1.1.1" } }, "sha512-Aup7aUOfpbAUg2ROOJN6Iw5f9DMBlzu0mIkm/malLQFN/YQgO48wCj0Kxa3sEHJvPVFg7siR+qRInwXd2qhQKw=="], + "@testing-library/dom/pretty-format": ["pretty-format@27.5.1", "", { "dependencies": { "ansi-regex": "^5.0.1", "ansi-styles": "^5.0.0", "react-is": "^17.0.1" } }, "sha512-Qb1gy5OrP5+zDf2Bvnzdl3jsTf1qXVMazbvCoKhtKqVs4/YK4ozX4gKQJJVyNe+cajNPn0KoC0MC3FUmaHWEmQ=="], + "@testing-library/jest-dom/dom-accessibility-api": ["dom-accessibility-api@0.6.3", "", {}, "sha512-7ZgogeTnjuHbo+ct10G9Ffp0mif17idi0IyWNVA/wcwcm7NPOD/WEHVP3n7n3MhXqxoIYm8d6MuZohYWIZ4T3w=="], "@ts-morph/common/minimatch": ["minimatch@7.4.9", "", { "dependencies": { "brace-expansion": "^2.0.2" } }, "sha512-Brg/fp/iAVDOQoHxkuN5bEYhyQlZhxddI78yWsCbeEwTHXQjlNLtiJDUsp1GIptVqMI7/gkJMz4vVAc01mpoBw=="], @@ -3810,8 +4361,12 @@ "@vanilla-extract/integration/@babel/plugin-syntax-typescript": ["@babel/plugin-syntax-typescript@7.29.7", "", { "dependencies": { "@babel/helper-plugin-utils": "^7.29.7" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-ngr+82Sh0xMz25TPCZi+nC2iTzjfCdWS2ONXTp/PtSCHCgaCNBpdMqgvJ2ccdLlClVZ7sisIgB914j/JFe+RZA=="], + "accepts/negotiator": ["negotiator@0.6.3", "", {}, "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg=="], + "ajv-formats/ajv": ["ajv@8.20.0", "", { "dependencies": { "fast-deep-equal": "^3.1.3", "fast-uri": "^3.0.1", "json-schema-traverse": "^1.0.0", "require-from-string": "^2.0.2" } }, "sha512-Thbli+OlOj+iMPYFBVBfJ3OmCAnaSyNn4M1vz9T6Gka5Jt9ba/HIR56joy65tY6kx/FCF5VXNB819Y7/GUrBGA=="], + "ansi-escapes/type-fest": ["type-fest@0.21.3", "", {}, "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w=="], + "babel-loader/@babel/core": ["@babel/core@7.29.13", "", { "dependencies": { "@babel/code-frame": "^7.29.7", "@babel/generator": "^7.29.13", "@babel/helper-compilation-targets": "^7.29.13", "@babel/helper-module-transforms": "^7.29.13", "@babel/helpers": "^7.29.13", "@babel/parser": "^7.29.13", "@babel/template": "^7.29.7", "@babel/traverse": "^7.29.13", "@babel/types": "^7.29.11", "@jridgewell/remapping": "^2.3.5", "convert-source-map": "^2.0.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.2", "json5": "^2.2.3", "semver": "^6.3.1" } }, "sha512-j1nvOQCZYSgp7HLmisnCXFTpVvFODiijQ9QHkORfGKWH6YDtskTEeCJS7eV545GZ9UBzrq0e2xsOd5QQ5PjIqw=="], "babel-plugin-polyfill-corejs2/@babel/core": ["@babel/core@7.29.13", "", { "dependencies": { "@babel/code-frame": "^7.29.7", "@babel/generator": "^7.29.13", "@babel/helper-compilation-targets": "^7.29.13", "@babel/helper-module-transforms": "^7.29.13", "@babel/helpers": "^7.29.13", "@babel/parser": "^7.29.13", "@babel/template": "^7.29.7", "@babel/traverse": "^7.29.13", "@babel/types": "^7.29.11", "@jridgewell/remapping": "^2.3.5", "convert-source-map": "^2.0.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.2", "json5": "^2.2.3", "semver": "^6.3.1" } }, "sha512-j1nvOQCZYSgp7HLmisnCXFTpVvFODiijQ9QHkORfGKWH6YDtskTEeCJS7eV545GZ9UBzrq0e2xsOd5QQ5PjIqw=="], @@ -3822,10 +4377,24 @@ "babel-plugin-polyfill-regenerator/@babel/core": ["@babel/core@7.29.13", "", { "dependencies": { "@babel/code-frame": "^7.29.7", "@babel/generator": "^7.29.13", "@babel/helper-compilation-targets": "^7.29.13", "@babel/helper-module-transforms": "^7.29.13", "@babel/helpers": "^7.29.13", "@babel/parser": "^7.29.13", "@babel/template": "^7.29.7", "@babel/traverse": "^7.29.13", "@babel/types": "^7.29.11", "@jridgewell/remapping": "^2.3.5", "convert-source-map": "^2.0.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.2", "json5": "^2.2.3", "semver": "^6.3.1" } }, "sha512-j1nvOQCZYSgp7HLmisnCXFTpVvFODiijQ9QHkORfGKWH6YDtskTEeCJS7eV545GZ9UBzrq0e2xsOd5QQ5PjIqw=="], - "cliui/string-width": ["string-width@4.2.3", "", { "dependencies": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", "strip-ansi": "^6.0.1" } }, "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g=="], + "babel-plugin-syntax-hermes-parser/hermes-parser": ["hermes-parser@0.36.1", "", { "dependencies": { "hermes-estree": "0.36.1" } }, "sha512-GApNk4zLHi2UWoWZZkx7LNCOSzLSc5lB55pZ/PhK7ycFeg7u5LcF88p/WbpIi1XUDtE0MpHE3uRR3u3KB7TjSQ=="], + + "babel-plugin-transform-flow-enums/@babel/plugin-syntax-flow": ["@babel/plugin-syntax-flow@7.29.7", "", { "dependencies": { "@babel/helper-plugin-utils": "^7.29.7" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-ajMX6QPcyomotqwpzhkYGxcK2i/us0rs1Qo9QvUpa+Fca0FTmqrzKrctoIYLMxcOhGZldGT/BAVkRGTWBiR8gQ=="], + + "babel-preset-expo/@babel/generator": ["@babel/generator@7.29.14", "", { "dependencies": { "@babel/parser": "^7.29.14", "@babel/types": "^7.29.14", "@jridgewell/gen-mapping": "^0.3.12", "@jridgewell/trace-mapping": "^0.3.28", "jsesc": "^3.0.2" } }, "sha512-qSY56jgW5JnSXzuekLVil6zaOQxOCtOHidr65KkaMBw772IuAY28Qx4ZykAcDn8+FRF15qk80XzKwgSc/RYW6g=="], + + "chalk/ansi-styles": ["ansi-styles@4.3.0", "", { "dependencies": { "color-convert": "^2.0.1" } }, "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg=="], + + "chalk/supports-color": ["supports-color@7.2.0", "", { "dependencies": { "has-flag": "^4.0.0" } }, "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw=="], "cliui/strip-ansi": ["strip-ansi@6.0.1", "", { "dependencies": { "ansi-regex": "^5.0.1" } }, "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A=="], + "compression/debug": ["debug@2.6.9", "", { "dependencies": { "ms": "2.0.0" } }, "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA=="], + + "compression/negotiator": ["negotiator@0.6.4", "", {}, "sha512-myRT3DiWPHqho5PrJaIRyaMv2kgYf0mUVgBNOYMuCH5Ki1yEiQaf/ZJuQ62nvpc44wL5WDbTX7yGJi1Neevw8w=="], + + "connect/debug": ["debug@2.6.9", "", { "dependencies": { "ms": "2.0.0" } }, "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA=="], + "core-js-compat/browserslist": ["browserslist@4.29.6", "", { "dependencies": { "baseline-browser-mapping": "^2.11.37", "caniuse-lite": "^1.0.30001826", "electron-to-chromium": "^1.5.486", "node-releases": "^2.0.64", "update-browserslist-db": "^1.4.0" }, "bin": { "browserslist": "cli.js" } }, "sha512-CmVVIQ3RVc5HxYEc9X84GvxK/C8C1wH8TlKAiO7uTxF8PDwt7r8t9Qk3J9NkMOVzX5O/HbLv3yzxZg9HPrnI9w=="], "cosmiconfig/parse-json": ["parse-json@5.2.0", "", { "dependencies": { "@babel/code-frame": "^7.0.0", "error-ex": "^1.3.1", "json-parse-even-better-errors": "^2.3.0", "lines-and-columns": "^1.1.6" } }, "sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg=="], @@ -3840,33 +4409,121 @@ "eslint-plugin-react-hooks/@babel/parser": ["@babel/parser@7.29.14", "", { "dependencies": { "@babel/types": "^7.29.14" }, "bin": "./bin/babel-parser.js" }, "sha512-VL220vXuyO2z3rNIQwY7ftj9UwpqOt+33sH+sBWkOekbsSR2g7EEMnOx24ZlCH0xOA3DM/33SifVFGbnJD8r/w=="], + "expo-modules-autolinking/commander": ["commander@7.2.0", "", {}, "sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw=="], + + "expo-modules-cli/@babel/parser": ["@babel/parser@7.29.14", "", { "dependencies": { "@babel/types": "^7.29.14" }, "bin": "./bin/babel-parser.js" }, "sha512-VL220vXuyO2z3rNIQwY7ftj9UwpqOt+33sH+sBWkOekbsSR2g7EEMnOx24ZlCH0xOA3DM/33SifVFGbnJD8r/w=="], + "fast-glob/glob-parent": ["glob-parent@5.1.2", "", { "dependencies": { "is-glob": "^4.0.1" } }, "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow=="], + "finalhandler/debug": ["debug@2.6.9", "", { "dependencies": { "ms": "2.0.0" } }, "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA=="], + + "finalhandler/encodeurl": ["encodeurl@1.0.4", "", {}, "sha512-ImAQpWtQZKdkUxvj9CMNzB8M4IGg0DkRTZzmOHqgVFrf71JDmUacbt+iKljfIpD2yHcxI+HR76d8bwvdvtSvGA=="], + + "finalhandler/on-finished": ["on-finished@2.3.0", "", { "dependencies": { "ee-first": "1.1.1" } }, "sha512-ikqdkGAAyf/X/gPhXGvfgAytDZtDbr+bkNUJ0N9h5MI/dmdgCs3l6hoHrcUv41sRKew3jIwrp4qQDXiK99Utww=="], + + "finalhandler/statuses": ["statuses@1.5.0", "", {}, "sha512-OpZ3zP+jT1PI7I8nemJX4AKmAX070ZkYPVWV/AaKTJl+tXCTGyVdC1a4SL8RUQYEwk/f34ZX8UTykN68FwrqAA=="], + "happy-dom/entities": ["entities@7.0.1", "", {}, "sha512-TWrgLOFUQTH994YUyl1yT4uyavY5nNB5muff+RtWaqNVCAK408b5ZnnbNAUEWLTCpum9w6arT70i1XdQ4UeOPA=="], "hoist-non-react-statics/react-is": ["react-is@16.13.1", "", {}, "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ=="], + "import-fresh/resolve-from": ["resolve-from@4.0.0", "", {}, "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g=="], + + "jest-util/picomatch": ["picomatch@2.3.2", "", {}, "sha512-V7+vQEJ06Z+c5tSye8S+nHUfI51xoXIXjHQ99cQtKUkQqqO1kO/KCJUfZXuB47h/YBlDhah2H3hdUGXn8ie0oA=="], + + "jest-validate/camelcase": ["camelcase@6.3.0", "", {}, "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA=="], + "jest-worker/supports-color": ["supports-color@8.1.1", "", { "dependencies": { "has-flag": "^4.0.0" } }, "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q=="], "jsonc-eslint-parser/verkit": ["verkit@0.3.2", "", {}, "sha512-zj/ob3UsvJGN0whEAKFp53REA5X66hvffVqoCtVQAakJKnKlH+/PcOfMoFwIG/o4rElqLv/ycAFlx8ZlXUorCg=="], + "linebreak/base64-js": ["base64-js@0.0.8", "", {}, "sha512-3XSA2cR/h/73EzlXXdU6YNycmYI7+kicTxks4eJg2g39biHR84slg2+des+p7iHYhbRg/udIS4TD53WabcOUkw=="], + + "log-symbols/chalk": ["chalk@2.4.2", "", { "dependencies": { "ansi-styles": "^3.2.1", "escape-string-regexp": "^1.0.5", "supports-color": "^5.3.0" } }, "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ=="], + "loose-envify/js-tokens": ["js-tokens@4.0.0", "", {}, "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ=="], + "metro/@babel/code-frame": ["@babel/code-frame@7.29.7", "", { "dependencies": { "@babel/helper-validator-identifier": "^7.29.7", "js-tokens": "^4.0.0", "picocolors": "^1.1.1" } }, "sha512-Aup7aUOfpbAUg2ROOJN6Iw5f9DMBlzu0mIkm/malLQFN/YQgO48wCj0Kxa3sEHJvPVFg7siR+qRInwXd2qhQKw=="], + + "metro/@babel/core": ["@babel/core@7.29.13", "", { "dependencies": { "@babel/code-frame": "^7.29.7", "@babel/generator": "^7.29.13", "@babel/helper-compilation-targets": "^7.29.13", "@babel/helper-module-transforms": "^7.29.13", "@babel/helpers": "^7.29.13", "@babel/parser": "^7.29.13", "@babel/template": "^7.29.7", "@babel/traverse": "^7.29.13", "@babel/types": "^7.29.11", "@jridgewell/remapping": "^2.3.5", "convert-source-map": "^2.0.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.2", "json5": "^2.2.3", "semver": "^6.3.1" } }, "sha512-j1nvOQCZYSgp7HLmisnCXFTpVvFODiijQ9QHkORfGKWH6YDtskTEeCJS7eV545GZ9UBzrq0e2xsOd5QQ5PjIqw=="], + + "metro/@babel/generator": ["@babel/generator@7.29.14", "", { "dependencies": { "@babel/parser": "^7.29.14", "@babel/types": "^7.29.14", "@jridgewell/gen-mapping": "^0.3.12", "@jridgewell/trace-mapping": "^0.3.28", "jsesc": "^3.0.2" } }, "sha512-qSY56jgW5JnSXzuekLVil6zaOQxOCtOHidr65KkaMBw772IuAY28Qx4ZykAcDn8+FRF15qk80XzKwgSc/RYW6g=="], + + "metro/@babel/parser": ["@babel/parser@7.29.14", "", { "dependencies": { "@babel/types": "^7.29.14" }, "bin": "./bin/babel-parser.js" }, "sha512-VL220vXuyO2z3rNIQwY7ftj9UwpqOt+33sH+sBWkOekbsSR2g7EEMnOx24ZlCH0xOA3DM/33SifVFGbnJD8r/w=="], + + "metro/@babel/template": ["@babel/template@7.29.7", "", { "dependencies": { "@babel/code-frame": "^7.29.7", "@babel/parser": "^7.29.7", "@babel/types": "^7.29.7" } }, "sha512-puq+Gf35oI24FeN11LkoUQFqv9uwNeWpxXZi/Ji3rRIoKAzKnxRaZ+Gkj0vKS9ZCiTESfng1N9LyOyXvo+m+Gg=="], + + "metro/accepts": ["accepts@2.0.0", "", { "dependencies": { "mime-types": "^3.0.0", "negotiator": "^1.0.0" } }, "sha512-5cvg6CtKwfgdmVqY1WIiXKc3Q1bkRqGLi+2W/6ao+6Y7gu/RCwRuAhGEzh5B4KlszSuTLgZYuqFqo5bImjNKng=="], + + "metro/flow-parser": ["flow-parser@0.331.0", "", { "dependencies": { "flow-estree": "0.331.0" } }, "sha512-vEZcHIlnKeN8JSVtYFczj8sWJfHIJOkz+YG00O/oul/Bete+t1ZhTi+O6JRRLFYvGW+yJkZ0YgL16iStnbkUqQ=="], + + "metro/jest-worker": ["jest-worker@29.7.0", "", { "dependencies": { "@types/node": "*", "jest-util": "^29.7.0", "merge-stream": "^2.0.0", "supports-color": "^8.0.0" } }, "sha512-eIz2msL/EzL9UFTFFx7jBTkeZfku0yUAyZZZmJ93H2TYEiroIx2PQjEXcwYtYl8zXCxb+PAmA2hLIt/6ZEkPHw=="], + + "metro/metro-source-map": ["metro-source-map@0.87.1", "", { "dependencies": { "@babel/traverse": "^7.29.0", "@babel/types": "^7.29.0", "flow-enums-runtime": "^0.0.6", "invariant": "^2.2.4", "metro-symbolicate": "0.87.1", "nullthrows": "^1.1.1", "ob1": "0.87.1", "source-map": "^0.5.6", "vlq": "^1.0.0" } }, "sha512-Bqpm0PBGdy53pigIJb4HRF7QxD2pUOdgSmVh/4AWbP635kSCv+Y6ltVxUZgSnzS/QbSmzyCGijmRPlXMj2/qHw=="], + + "metro/mime-types": ["mime-types@3.0.2", "", { "dependencies": { "mime-db": "^1.54.0" } }, "sha512-Lbgzdk0h4juoQ9fCKXW4by0UJqj+nOOrI9MJ1sSj4nI8aI2eo1qmvQEie4VD1glsS250n15LsWsYtCugiStS5A=="], + + "metro/source-map": ["source-map@0.5.7", "", {}, "sha512-LbrmJOMUSdEVxIKvdcJzQC+nQhe8FUZQTXQy6+I75skNgn3OoQ0DZA8YnFa7gp8tqtL3KPf1kmo0R5DoApeSGQ=="], + + "metro/ws": ["ws@7.5.14", "", { "peerDependencies": { "bufferutil": "^4.0.1", "utf-8-validate": "^5.0.2" }, "optionalPeers": ["bufferutil", "utf-8-validate"] }, "sha512-u9Oi2nQ8SZnTUAf6spLLKF5TyqoG3Nbbrd4ai6Sjo4P24bycDewhQqtNMIg4bFpnpH/TD4qk4IuAVhT0HIIqug=="], + + "metro-babel-transformer/@babel/core": ["@babel/core@7.29.13", "", { "dependencies": { "@babel/code-frame": "^7.29.7", "@babel/generator": "^7.29.13", "@babel/helper-compilation-targets": "^7.29.13", "@babel/helper-module-transforms": "^7.29.13", "@babel/helpers": "^7.29.13", "@babel/parser": "^7.29.13", "@babel/template": "^7.29.7", "@babel/traverse": "^7.29.13", "@babel/types": "^7.29.11", "@jridgewell/remapping": "^2.3.5", "convert-source-map": "^2.0.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.2", "json5": "^2.2.3", "semver": "^6.3.1" } }, "sha512-j1nvOQCZYSgp7HLmisnCXFTpVvFODiijQ9QHkORfGKWH6YDtskTEeCJS7eV545GZ9UBzrq0e2xsOd5QQ5PjIqw=="], + + "metro-babel-transformer/flow-parser": ["flow-parser@0.331.0", "", { "dependencies": { "flow-estree": "0.331.0" } }, "sha512-vEZcHIlnKeN8JSVtYFczj8sWJfHIJOkz+YG00O/oul/Bete+t1ZhTi+O6JRRLFYvGW+yJkZ0YgL16iStnbkUqQ=="], + + "metro-file-map/jest-worker": ["jest-worker@29.7.0", "", { "dependencies": { "@types/node": "*", "jest-util": "^29.7.0", "merge-stream": "^2.0.0", "supports-color": "^8.0.0" } }, "sha512-eIz2msL/EzL9UFTFFx7jBTkeZfku0yUAyZZZmJ93H2TYEiroIx2PQjEXcwYtYl8zXCxb+PAmA2hLIt/6ZEkPHw=="], + + "metro-source-map/@babel/core": ["@babel/core@7.29.13", "", { "dependencies": { "@babel/code-frame": "^7.29.7", "@babel/generator": "^7.29.13", "@babel/helper-compilation-targets": "^7.29.13", "@babel/helper-module-transforms": "^7.29.13", "@babel/helpers": "^7.29.13", "@babel/parser": "^7.29.13", "@babel/template": "^7.29.7", "@babel/traverse": "^7.29.13", "@babel/types": "^7.29.11", "@jridgewell/remapping": "^2.3.5", "convert-source-map": "^2.0.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.2", "json5": "^2.2.3", "semver": "^6.3.1" } }, "sha512-j1nvOQCZYSgp7HLmisnCXFTpVvFODiijQ9QHkORfGKWH6YDtskTEeCJS7eV545GZ9UBzrq0e2xsOd5QQ5PjIqw=="], + + "metro-source-map/metro-symbolicate": ["metro-symbolicate@0.87.3", "", { "dependencies": { "flow-enums-runtime": "^0.0.6", "invariant": "^2.2.4", "metro-source-map": "0.87.3", "nullthrows": "^1.1.1", "source-map": "^0.5.6", "vlq": "^1.0.0" }, "bin": { "metro-symbolicate": "src/index.js" } }, "sha512-koHM4gA6iE7OSYACKvJCg/N/9QK6i7vrA3l4gMKtK1Z7XfQVixtWiUTqf+XTkGdVTjioHmlTF/MmG+BmfL301w=="], + + "metro-source-map/source-map": ["source-map@0.5.7", "", {}, "sha512-LbrmJOMUSdEVxIKvdcJzQC+nQhe8FUZQTXQy6+I75skNgn3OoQ0DZA8YnFa7gp8tqtL3KPf1kmo0R5DoApeSGQ=="], + + "metro-symbolicate/metro-source-map": ["metro-source-map@0.87.1", "", { "dependencies": { "@babel/traverse": "^7.29.0", "@babel/types": "^7.29.0", "flow-enums-runtime": "^0.0.6", "invariant": "^2.2.4", "metro-symbolicate": "0.87.1", "nullthrows": "^1.1.1", "ob1": "0.87.1", "source-map": "^0.5.6", "vlq": "^1.0.0" } }, "sha512-Bqpm0PBGdy53pigIJb4HRF7QxD2pUOdgSmVh/4AWbP635kSCv+Y6ltVxUZgSnzS/QbSmzyCGijmRPlXMj2/qHw=="], + + "metro-symbolicate/source-map": ["source-map@0.5.7", "", {}, "sha512-LbrmJOMUSdEVxIKvdcJzQC+nQhe8FUZQTXQy6+I75skNgn3OoQ0DZA8YnFa7gp8tqtL3KPf1kmo0R5DoApeSGQ=="], + + "metro-transform-plugins/@babel/core": ["@babel/core@7.29.13", "", { "dependencies": { "@babel/code-frame": "^7.29.7", "@babel/generator": "^7.29.13", "@babel/helper-compilation-targets": "^7.29.13", "@babel/helper-module-transforms": "^7.29.13", "@babel/helpers": "^7.29.13", "@babel/parser": "^7.29.13", "@babel/template": "^7.29.7", "@babel/traverse": "^7.29.13", "@babel/types": "^7.29.11", "@jridgewell/remapping": "^2.3.5", "convert-source-map": "^2.0.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.2", "json5": "^2.2.3", "semver": "^6.3.1" } }, "sha512-j1nvOQCZYSgp7HLmisnCXFTpVvFODiijQ9QHkORfGKWH6YDtskTEeCJS7eV545GZ9UBzrq0e2xsOd5QQ5PjIqw=="], + + "metro-transform-plugins/@babel/generator": ["@babel/generator@7.29.14", "", { "dependencies": { "@babel/parser": "^7.29.14", "@babel/types": "^7.29.14", "@jridgewell/gen-mapping": "^0.3.12", "@jridgewell/trace-mapping": "^0.3.28", "jsesc": "^3.0.2" } }, "sha512-qSY56jgW5JnSXzuekLVil6zaOQxOCtOHidr65KkaMBw772IuAY28Qx4ZykAcDn8+FRF15qk80XzKwgSc/RYW6g=="], + + "metro-transform-plugins/@babel/template": ["@babel/template@7.29.7", "", { "dependencies": { "@babel/code-frame": "^7.29.7", "@babel/parser": "^7.29.7", "@babel/types": "^7.29.7" } }, "sha512-puq+Gf35oI24FeN11LkoUQFqv9uwNeWpxXZi/Ji3rRIoKAzKnxRaZ+Gkj0vKS9ZCiTESfng1N9LyOyXvo+m+Gg=="], + + "metro-transform-worker/@babel/core": ["@babel/core@7.29.13", "", { "dependencies": { "@babel/code-frame": "^7.29.7", "@babel/generator": "^7.29.13", "@babel/helper-compilation-targets": "^7.29.13", "@babel/helper-module-transforms": "^7.29.13", "@babel/helpers": "^7.29.13", "@babel/parser": "^7.29.13", "@babel/template": "^7.29.7", "@babel/traverse": "^7.29.13", "@babel/types": "^7.29.11", "@jridgewell/remapping": "^2.3.5", "convert-source-map": "^2.0.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.2", "json5": "^2.2.3", "semver": "^6.3.1" } }, "sha512-j1nvOQCZYSgp7HLmisnCXFTpVvFODiijQ9QHkORfGKWH6YDtskTEeCJS7eV545GZ9UBzrq0e2xsOd5QQ5PjIqw=="], + + "metro-transform-worker/@babel/generator": ["@babel/generator@7.29.14", "", { "dependencies": { "@babel/parser": "^7.29.14", "@babel/types": "^7.29.14", "@jridgewell/gen-mapping": "^0.3.12", "@jridgewell/trace-mapping": "^0.3.28", "jsesc": "^3.0.2" } }, "sha512-qSY56jgW5JnSXzuekLVil6zaOQxOCtOHidr65KkaMBw772IuAY28Qx4ZykAcDn8+FRF15qk80XzKwgSc/RYW6g=="], + + "metro-transform-worker/@babel/parser": ["@babel/parser@7.29.14", "", { "dependencies": { "@babel/types": "^7.29.14" }, "bin": "./bin/babel-parser.js" }, "sha512-VL220vXuyO2z3rNIQwY7ftj9UwpqOt+33sH+sBWkOekbsSR2g7EEMnOx24ZlCH0xOA3DM/33SifVFGbnJD8r/w=="], + + "metro-transform-worker/metro-source-map": ["metro-source-map@0.87.1", "", { "dependencies": { "@babel/traverse": "^7.29.0", "@babel/types": "^7.29.0", "flow-enums-runtime": "^0.0.6", "invariant": "^2.2.4", "metro-symbolicate": "0.87.1", "nullthrows": "^1.1.1", "ob1": "0.87.1", "source-map": "^0.5.6", "vlq": "^1.0.0" } }, "sha512-Bqpm0PBGdy53pigIJb4HRF7QxD2pUOdgSmVh/4AWbP635kSCv+Y6ltVxUZgSnzS/QbSmzyCGijmRPlXMj2/qHw=="], + "micromatch/picomatch": ["picomatch@2.3.2", "", {}, "sha512-V7+vQEJ06Z+c5tSye8S+nHUfI51xoXIXjHQ99cQtKUkQqqO1kO/KCJUfZXuB47h/YBlDhah2H3hdUGXn8ie0oA=="], + "mime-types/mime-db": ["mime-db@1.52.0", "", {}, "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg=="], + "mlly/pkg-types": ["pkg-types@1.3.1", "", { "dependencies": { "confbox": "^0.1.8", "mlly": "^1.7.4", "pathe": "^2.0.1" } }, "sha512-/Jm5M4RvtBFVkKWRu2BLUTNP8/M2a+UwuAX+ae4770q1qVGtfjG+WTCupoZixokjmHiry8uI+dlY8KXYV5HVVQ=="], "next/postcss": ["postcss@8.5.23", "", { "dependencies": { "nanoid": "^3.3.16", "picocolors": "^1.1.1", "source-map-js": "^1.2.1" } }, "sha512-g50586zr4bZmwFiTlflMu8E0bDTb5I5gertgwAKmsdUlTQIhZtunzUlD1WSzwcVWPoAVpsrA6vlfCD7oXvRwgg=="], + "noxcturnal/@babel/code-frame": ["@babel/code-frame@7.29.7", "", { "dependencies": { "@babel/helper-validator-identifier": "^7.29.7", "js-tokens": "^4.0.0", "picocolors": "^1.1.1" } }, "sha512-Aup7aUOfpbAUg2ROOJN6Iw5f9DMBlzu0mIkm/malLQFN/YQgO48wCj0Kxa3sEHJvPVFg7siR+qRInwXd2qhQKw=="], + + "noxcturnal/@oxc-project/types": ["@oxc-project/types@0.154.0", "", {}, "sha512-KYOUGQFlLWR+s4QMV2Q9ko38TZm7EdO87Qm7rvZLqk/webse/cDjtyxKhg/47l0byCbs/k46LT8qc4PKjAikzA=="], + + "ora/chalk": ["chalk@2.4.2", "", { "dependencies": { "ansi-styles": "^3.2.1", "escape-string-regexp": "^1.0.5", "supports-color": "^5.3.0" } }, "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ=="], + "parse-entities/@types/unist": ["@types/unist@2.0.11", "", {}, "sha512-CmBKiL6NNo/OqgmMn95Fk9Whlp2mtvIv+KNpQKN2F4SjvrEesubTRWGYSg+BnWZOnlCaSTU1sMpsBOzgbYhnsA=="], "parse-json/@babel/code-frame": ["@babel/code-frame@7.29.7", "", { "dependencies": { "@babel/helper-validator-identifier": "^7.29.7", "js-tokens": "^4.0.0", "picocolors": "^1.1.1" } }, "sha512-Aup7aUOfpbAUg2ROOJN6Iw5f9DMBlzu0mIkm/malLQFN/YQgO48wCj0Kxa3sEHJvPVFg7siR+qRInwXd2qhQKw=="], + "parse-json/type-fest": ["type-fest@3.13.1", "", {}, "sha512-tLq3bSNx+xSpwvAJnzrK0Ep5CLNWjvFTOp71URMaAEWBfRb9nnJiBoUe0tF8bI4ZFO3omgBR6NvnbzVUT3Ly4g=="], + "path-scurry/lru-cache": ["lru-cache@11.5.3", "", {}, "sha512-U4N8FgzmWxc8k1VH8Kr6lQg18U7Fjvby6wXHVRX/ZZ7IwWbRMgrRbP0Wrb5q5NVinryp4SQampHKdvtecItxUg=="], "pkg-dir/find-up": ["find-up@6.3.0", "", { "dependencies": { "locate-path": "^7.1.0", "path-exists": "^5.0.0" } }, "sha512-v2ZsoEuVHYy8ZIlYqwPe/39Cy+cFDzp4dXPaxNvkEuouymu+2Jbz0PxpKarJHYJTmv2HWT3O382qY8l4jMWthw=="], - "pretty-format/react-is": ["react-is@17.0.2", "", {}, "sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w=="], + "plist/@xmldom/xmldom": ["@xmldom/xmldom@0.9.12", "", {}, "sha512-5AXjrcMClTryPe9LgZrygpB1lj7s0S9E0+W+AHaVKAVyHanafK86iPSvG5xHVSp/jC+VH1UXu0TAEmY279xH7A=="], + + "pretty-format/react-is": ["react-is@18.3.1", "", {}, "sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg=="], "prop-types/react-is": ["react-is@16.13.1", "", {}, "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ=="], @@ -3880,12 +4537,18 @@ "react-18-example/react-dom": ["react-dom@18.3.1", "", { "dependencies": { "loose-envify": "^1.1.0", "scheduler": "^0.23.2" }, "peerDependencies": { "react": "^18.3.1" } }, "sha512-5m4nQKp+rZRb09LNH59GM4BxTh9251/ylbKIbpe7TpGxfJ+9kv6BLkLBXIjjspbgbnIBNqlI23tRnTWT0snUIw=="], + "react-devtools-core/ws": ["ws@7.5.14", "", { "peerDependencies": { "bufferutil": "^4.0.1", "utf-8-validate": "^5.0.2" }, "optionalPeers": ["bufferutil", "utf-8-validate"] }, "sha512-u9Oi2nQ8SZnTUAf6spLLKF5TyqoG3Nbbrd4ai6Sjo4P24bycDewhQqtNMIg4bFpnpH/TD4qk4IuAVhT0HIIqug=="], + "react-docgen/@babel/core": ["@babel/core@7.29.13", "", { "dependencies": { "@babel/code-frame": "^7.29.7", "@babel/generator": "^7.29.13", "@babel/helper-compilation-targets": "^7.29.13", "@babel/helper-module-transforms": "^7.29.13", "@babel/helpers": "^7.29.13", "@babel/parser": "^7.29.13", "@babel/template": "^7.29.7", "@babel/traverse": "^7.29.13", "@babel/types": "^7.29.11", "@jridgewell/remapping": "^2.3.5", "convert-source-map": "^2.0.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.2", "json5": "^2.2.3", "semver": "^6.3.1" } }, "sha512-j1nvOQCZYSgp7HLmisnCXFTpVvFODiijQ9QHkORfGKWH6YDtskTEeCJS7eV545GZ9UBzrq0e2xsOd5QQ5PjIqw=="], + "react-native/ws": ["ws@7.5.14", "", { "peerDependencies": { "bufferutil": "^4.0.1", "utf-8-validate": "^5.0.2" }, "optionalPeers": ["bufferutil", "utf-8-validate"] }, "sha512-u9Oi2nQ8SZnTUAf6spLLKF5TyqoG3Nbbrd4ai6Sjo4P24bycDewhQqtNMIg4bFpnpH/TD4qk4IuAVhT0HIIqug=="], + "recast/source-map": ["source-map@0.6.1", "", {}, "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g=="], "redent/strip-indent": ["strip-indent@3.0.0", "", { "dependencies": { "min-indent": "^1.0.0" } }, "sha512-laJTa3Jb+VQpaC6DseHhF7dXVqHTfJPCRDaEbid/drOhgitgYku/letMUqOXFoWV0zIIUbjpdH2t+tYj4bQMRQ=="], + "restore-cursor/signal-exit": ["signal-exit@3.0.7", "", {}, "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ=="], + "rolldown/@oxc-project/types": ["@oxc-project/types@0.156.0", "", {}, "sha512-1Duyg48TdJNdyhEB8Xn1L36bT9Pv6GUtlKjHxOys8xkaF/rQq3XJE+bAurSK/AgIz5mGFsb77cn9Pb20+WCScw=="], "rollup-plugin-dts/magic-string": ["magic-string@0.30.21", "", { "dependencies": { "@jridgewell/sourcemap-codec": "^1.5.5" } }, "sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ=="], @@ -3898,20 +4561,26 @@ "schema-utils/ajv-keywords": ["ajv-keywords@5.1.0", "", { "dependencies": { "fast-deep-equal": "^3.1.3" }, "peerDependencies": { "ajv": "^8.8.2" } }, "sha512-YCS/JNFAUyr5vAuhk1DWm1CBxRHW9LbJ2ozWeemrIqpbsqKjHVxYPyi5GC0rjZIT5JxJ3virVTS8wk4i/Z+krw=="], + "send/debug": ["debug@2.6.9", "", { "dependencies": { "ms": "2.0.0" } }, "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA=="], + "source-map-support/source-map": ["source-map@0.6.1", "", {}, "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g=="], - "string-width-cjs/emoji-regex": ["emoji-regex@8.0.0", "", {}, "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A=="], + "string-width/strip-ansi": ["strip-ansi@6.0.1", "", { "dependencies": { "ansi-regex": "^5.0.1" } }, "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A=="], "string-width-cjs/strip-ansi": ["strip-ansi@6.0.1", "", { "dependencies": { "ansi-regex": "^5.0.1" } }, "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A=="], - "strip-ansi/ansi-regex": ["ansi-regex@6.6.0", "", {}, "sha512-XZ5apbzreCbXSKwPjJstu8R0zOi247w3XYwWxtwBXgpZrCyc1Ka7p9/xY0A9/diMewmHbEKz+FIraWaEWjlN5g=="], + "strip-ansi/ansi-regex": ["ansi-regex@4.1.1", "", {}, "sha512-ILlv4k/3f6vfQ4OoP2AGvirOktlQ98ZEL1k9FaQjxa3L1abBgbuTDAdPOpvbGncC0BTVQrl+OM8xZGK6tWXt7g=="], "style-to-js/style-to-object": ["style-to-object@1.0.14", "", { "dependencies": { "inline-style-parser": "0.2.7" } }, "sha512-LIN7rULI0jBscWQYaSswptyderlarFkjQ+t79nzty8tcIAceVomEVlLzH5VP4Cmsv6MtKhs7qaAiwlcp+Mgaxw=="], + "supports-hyperlinks/supports-color": ["supports-color@7.2.0", "", { "dependencies": { "has-flag": "^4.0.0" } }, "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw=="], + "ts_dependency_graph/glob": ["glob@7.2.3", "", { "dependencies": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", "inherits": "2", "minimatch": "^3.1.1", "once": "^1.3.0", "path-is-absolute": "^1.0.0" } }, "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q=="], "ts_dependency_graph/typescript": ["typescript@4.9.5", "", { "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" } }, "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g=="], + "ts_dependency_graph/yargs": ["yargs@15.4.1", "", { "dependencies": { "cliui": "^6.0.0", "decamelize": "^1.2.0", "find-up": "^4.1.0", "get-caller-file": "^2.0.1", "require-directory": "^2.1.1", "require-main-filename": "^2.0.0", "set-blocking": "^2.0.0", "string-width": "^4.2.0", "which-module": "^2.0.0", "y18n": "^4.0.0", "yargs-parser": "^18.1.2" } }, "sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A=="], + "unified-engine/@types/node": ["@types/node@22.20.5", "", { "dependencies": { "undici-types": "~6.21.0" } }, "sha512-U2+DNr+wSjpsTS/wZGYHq7GcwfuSmKiKvoPvK22zwTlRhU91yOniN4qRR5KhIjvif7ysw/dz/hKmfDH0Ris4aA=="], "unified-engine/glob": ["glob@10.5.0", "", { "dependencies": { "foreground-child": "^3.1.0", "jackspeak": "^3.1.2", "minimatch": "^9.0.4", "minipass": "^7.1.2", "package-json-from-dist": "^1.0.0", "path-scurry": "^1.11.1" }, "bin": { "glob": "dist/esm/bin.mjs" } }, "sha512-DfXN8DfhJ7NH3Oe7cFmu3NCu1wKbkReJ8TorzSAFbSKrlNaQSKfIzqYqVY8zlbs2NLBbWpRiU52GX2PbaBVNkg=="], @@ -3940,19 +4609,13 @@ "wrap-ansi/ansi-styles": ["ansi-styles@4.3.0", "", { "dependencies": { "color-convert": "^2.0.1" } }, "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg=="], - "wrap-ansi/string-width": ["string-width@4.2.3", "", { "dependencies": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", "strip-ansi": "^6.0.1" } }, "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g=="], - "wrap-ansi/strip-ansi": ["strip-ansi@6.0.1", "", { "dependencies": { "ansi-regex": "^5.0.1" } }, "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A=="], "wrap-ansi-cjs/ansi-styles": ["ansi-styles@4.3.0", "", { "dependencies": { "color-convert": "^2.0.1" } }, "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg=="], - "wrap-ansi-cjs/string-width": ["string-width@4.2.3", "", { "dependencies": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", "strip-ansi": "^6.0.1" } }, "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g=="], - "wrap-ansi-cjs/strip-ansi": ["strip-ansi@6.0.1", "", { "dependencies": { "ansi-regex": "^5.0.1" } }, "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A=="], - "yargs/find-up": ["find-up@4.1.0", "", { "dependencies": { "locate-path": "^5.0.0", "path-exists": "^4.0.0" } }, "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw=="], - - "yargs/string-width": ["string-width@4.2.3", "", { "dependencies": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", "strip-ansi": "^6.0.1" } }, "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g=="], + "xml2js/xmlbuilder": ["xmlbuilder@11.0.1", "", {}, "sha512-fDlsI/kFEx7gLvbecc0/ohLG50fugQp8ryHzMTuW9vSa1GJ0XYWKnhsUx7oie3G98+r56aTQIUB4kht42R3JvA=="], "@babel/core/@babel/traverse/@babel/helper-globals": ["@babel/helper-globals@8.0.6", "", {}, "sha512-OdnA/N52LhzFpeUuVz5YGuSWjc7TPHiFmVYZbPlSgExocO2GwbxVpSni9MVs5wwW+wZ4kPuwBEBN9pIPDYz1mA=="], @@ -4168,6 +4831,38 @@ "@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly/@babel/core/semver": ["semver@6.3.2", "", { "bin": { "semver": "bin/semver.js" } }, "sha512-GYrCADwpu6yV5OAvchkQ27Z5wwMxWAEMg5NNWjyHh/5DboFFqbdbvYNIvZouQpxXyeMPoTOh0vdPYKlf0ZswdQ=="], + "@babel/plugin-proposal-decorators/@babel/core/@babel/code-frame": ["@babel/code-frame@7.29.7", "", { "dependencies": { "@babel/helper-validator-identifier": "^7.29.7", "js-tokens": "^4.0.0", "picocolors": "^1.1.1" } }, "sha512-Aup7aUOfpbAUg2ROOJN6Iw5f9DMBlzu0mIkm/malLQFN/YQgO48wCj0Kxa3sEHJvPVFg7siR+qRInwXd2qhQKw=="], + + "@babel/plugin-proposal-decorators/@babel/core/@babel/generator": ["@babel/generator@7.29.14", "", { "dependencies": { "@babel/parser": "^7.29.14", "@babel/types": "^7.29.14", "@jridgewell/gen-mapping": "^0.3.12", "@jridgewell/trace-mapping": "^0.3.28", "jsesc": "^3.0.2" } }, "sha512-qSY56jgW5JnSXzuekLVil6zaOQxOCtOHidr65KkaMBw772IuAY28Qx4ZykAcDn8+FRF15qk80XzKwgSc/RYW6g=="], + + "@babel/plugin-proposal-decorators/@babel/core/@babel/helper-compilation-targets": ["@babel/helper-compilation-targets@7.29.13", "", { "dependencies": { "@babel/compat-data": "^7.29.7", "@babel/helper-validator-option": "^7.29.7", "browserslist": "^4.24.0", "lru-cache": "^5.1.1", "semver": "^6.3.1" } }, "sha512-8WxJ4/Vmes3ghacj8VOJy3NW8eyHiFY/4thU/LSBuBE470+igjR/j1ZTNn8fV5VdNrLx6iXUwig526UdOvfP0w=="], + + "@babel/plugin-proposal-decorators/@babel/core/@babel/helper-module-transforms": ["@babel/helper-module-transforms@7.29.14", "", { "dependencies": { "@babel/helper-module-imports": "^7.29.7", "@babel/helper-validator-identifier": "^7.29.7", "@babel/traverse": "^7.29.14" }, "peerDependencies": { "@babel/core": "^7.0.0" } }, "sha512-2XDvQVd9JESaOgGc4jT2/jquTAO7ppA5noTZQqH+MmZ89yjCzScLwtCPbWtkPZylL+TLWR49IwWmk+QkRR4GsA=="], + + "@babel/plugin-proposal-decorators/@babel/core/@babel/helpers": ["@babel/helpers@7.29.14", "", { "dependencies": { "@babel/template": "^7.29.7", "@babel/types": "^7.29.14" } }, "sha512-6E3Mi1r0B0umq6vmZa4/78q+64fqO2YY0THUdjDPKUCKhNb0yQy5NQIaPHCSD3ryTgiTss//P4JsWS80AsZ6LQ=="], + + "@babel/plugin-proposal-decorators/@babel/core/@babel/parser": ["@babel/parser@7.29.14", "", { "dependencies": { "@babel/types": "^7.29.14" }, "bin": "./bin/babel-parser.js" }, "sha512-VL220vXuyO2z3rNIQwY7ftj9UwpqOt+33sH+sBWkOekbsSR2g7EEMnOx24ZlCH0xOA3DM/33SifVFGbnJD8r/w=="], + + "@babel/plugin-proposal-decorators/@babel/core/@babel/template": ["@babel/template@7.29.7", "", { "dependencies": { "@babel/code-frame": "^7.29.7", "@babel/parser": "^7.29.7", "@babel/types": "^7.29.7" } }, "sha512-puq+Gf35oI24FeN11LkoUQFqv9uwNeWpxXZi/Ji3rRIoKAzKnxRaZ+Gkj0vKS9ZCiTESfng1N9LyOyXvo+m+Gg=="], + + "@babel/plugin-proposal-decorators/@babel/core/semver": ["semver@6.3.2", "", { "bin": { "semver": "bin/semver.js" } }, "sha512-GYrCADwpu6yV5OAvchkQ27Z5wwMxWAEMg5NNWjyHh/5DboFFqbdbvYNIvZouQpxXyeMPoTOh0vdPYKlf0ZswdQ=="], + + "@babel/plugin-proposal-export-default-from/@babel/core/@babel/code-frame": ["@babel/code-frame@7.29.7", "", { "dependencies": { "@babel/helper-validator-identifier": "^7.29.7", "js-tokens": "^4.0.0", "picocolors": "^1.1.1" } }, "sha512-Aup7aUOfpbAUg2ROOJN6Iw5f9DMBlzu0mIkm/malLQFN/YQgO48wCj0Kxa3sEHJvPVFg7siR+qRInwXd2qhQKw=="], + + "@babel/plugin-proposal-export-default-from/@babel/core/@babel/generator": ["@babel/generator@7.29.14", "", { "dependencies": { "@babel/parser": "^7.29.14", "@babel/types": "^7.29.14", "@jridgewell/gen-mapping": "^0.3.12", "@jridgewell/trace-mapping": "^0.3.28", "jsesc": "^3.0.2" } }, "sha512-qSY56jgW5JnSXzuekLVil6zaOQxOCtOHidr65KkaMBw772IuAY28Qx4ZykAcDn8+FRF15qk80XzKwgSc/RYW6g=="], + + "@babel/plugin-proposal-export-default-from/@babel/core/@babel/helper-compilation-targets": ["@babel/helper-compilation-targets@7.29.13", "", { "dependencies": { "@babel/compat-data": "^7.29.7", "@babel/helper-validator-option": "^7.29.7", "browserslist": "^4.24.0", "lru-cache": "^5.1.1", "semver": "^6.3.1" } }, "sha512-8WxJ4/Vmes3ghacj8VOJy3NW8eyHiFY/4thU/LSBuBE470+igjR/j1ZTNn8fV5VdNrLx6iXUwig526UdOvfP0w=="], + + "@babel/plugin-proposal-export-default-from/@babel/core/@babel/helper-module-transforms": ["@babel/helper-module-transforms@7.29.14", "", { "dependencies": { "@babel/helper-module-imports": "^7.29.7", "@babel/helper-validator-identifier": "^7.29.7", "@babel/traverse": "^7.29.14" }, "peerDependencies": { "@babel/core": "^7.0.0" } }, "sha512-2XDvQVd9JESaOgGc4jT2/jquTAO7ppA5noTZQqH+MmZ89yjCzScLwtCPbWtkPZylL+TLWR49IwWmk+QkRR4GsA=="], + + "@babel/plugin-proposal-export-default-from/@babel/core/@babel/helpers": ["@babel/helpers@7.29.14", "", { "dependencies": { "@babel/template": "^7.29.7", "@babel/types": "^7.29.14" } }, "sha512-6E3Mi1r0B0umq6vmZa4/78q+64fqO2YY0THUdjDPKUCKhNb0yQy5NQIaPHCSD3ryTgiTss//P4JsWS80AsZ6LQ=="], + + "@babel/plugin-proposal-export-default-from/@babel/core/@babel/parser": ["@babel/parser@7.29.14", "", { "dependencies": { "@babel/types": "^7.29.14" }, "bin": "./bin/babel-parser.js" }, "sha512-VL220vXuyO2z3rNIQwY7ftj9UwpqOt+33sH+sBWkOekbsSR2g7EEMnOx24ZlCH0xOA3DM/33SifVFGbnJD8r/w=="], + + "@babel/plugin-proposal-export-default-from/@babel/core/@babel/template": ["@babel/template@7.29.7", "", { "dependencies": { "@babel/code-frame": "^7.29.7", "@babel/parser": "^7.29.7", "@babel/types": "^7.29.7" } }, "sha512-puq+Gf35oI24FeN11LkoUQFqv9uwNeWpxXZi/Ji3rRIoKAzKnxRaZ+Gkj0vKS9ZCiTESfng1N9LyOyXvo+m+Gg=="], + + "@babel/plugin-proposal-export-default-from/@babel/core/semver": ["semver@6.3.2", "", { "bin": { "semver": "bin/semver.js" } }, "sha512-GYrCADwpu6yV5OAvchkQ27Z5wwMxWAEMg5NNWjyHh/5DboFFqbdbvYNIvZouQpxXyeMPoTOh0vdPYKlf0ZswdQ=="], + "@babel/plugin-proposal-private-property-in-object/@babel/core/@babel/code-frame": ["@babel/code-frame@7.29.7", "", { "dependencies": { "@babel/helper-validator-identifier": "^7.29.7", "js-tokens": "^4.0.0", "picocolors": "^1.1.1" } }, "sha512-Aup7aUOfpbAUg2ROOJN6Iw5f9DMBlzu0mIkm/malLQFN/YQgO48wCj0Kxa3sEHJvPVFg7siR+qRInwXd2qhQKw=="], "@babel/plugin-proposal-private-property-in-object/@babel/core/@babel/generator": ["@babel/generator@7.29.14", "", { "dependencies": { "@babel/parser": "^7.29.14", "@babel/types": "^7.29.14", "@jridgewell/gen-mapping": "^0.3.12", "@jridgewell/trace-mapping": "^0.3.28", "jsesc": "^3.0.2" } }, "sha512-qSY56jgW5JnSXzuekLVil6zaOQxOCtOHidr65KkaMBw772IuAY28Qx4ZykAcDn8+FRF15qk80XzKwgSc/RYW6g=="], @@ -4184,6 +4879,54 @@ "@babel/plugin-proposal-private-property-in-object/@babel/core/semver": ["semver@6.3.2", "", { "bin": { "semver": "bin/semver.js" } }, "sha512-GYrCADwpu6yV5OAvchkQ27Z5wwMxWAEMg5NNWjyHh/5DboFFqbdbvYNIvZouQpxXyeMPoTOh0vdPYKlf0ZswdQ=="], + "@babel/plugin-syntax-decorators/@babel/core/@babel/code-frame": ["@babel/code-frame@7.29.7", "", { "dependencies": { "@babel/helper-validator-identifier": "^7.29.7", "js-tokens": "^4.0.0", "picocolors": "^1.1.1" } }, "sha512-Aup7aUOfpbAUg2ROOJN6Iw5f9DMBlzu0mIkm/malLQFN/YQgO48wCj0Kxa3sEHJvPVFg7siR+qRInwXd2qhQKw=="], + + "@babel/plugin-syntax-decorators/@babel/core/@babel/generator": ["@babel/generator@7.29.14", "", { "dependencies": { "@babel/parser": "^7.29.14", "@babel/types": "^7.29.14", "@jridgewell/gen-mapping": "^0.3.12", "@jridgewell/trace-mapping": "^0.3.28", "jsesc": "^3.0.2" } }, "sha512-qSY56jgW5JnSXzuekLVil6zaOQxOCtOHidr65KkaMBw772IuAY28Qx4ZykAcDn8+FRF15qk80XzKwgSc/RYW6g=="], + + "@babel/plugin-syntax-decorators/@babel/core/@babel/helper-compilation-targets": ["@babel/helper-compilation-targets@7.29.13", "", { "dependencies": { "@babel/compat-data": "^7.29.7", "@babel/helper-validator-option": "^7.29.7", "browserslist": "^4.24.0", "lru-cache": "^5.1.1", "semver": "^6.3.1" } }, "sha512-8WxJ4/Vmes3ghacj8VOJy3NW8eyHiFY/4thU/LSBuBE470+igjR/j1ZTNn8fV5VdNrLx6iXUwig526UdOvfP0w=="], + + "@babel/plugin-syntax-decorators/@babel/core/@babel/helper-module-transforms": ["@babel/helper-module-transforms@7.29.14", "", { "dependencies": { "@babel/helper-module-imports": "^7.29.7", "@babel/helper-validator-identifier": "^7.29.7", "@babel/traverse": "^7.29.14" }, "peerDependencies": { "@babel/core": "^7.0.0" } }, "sha512-2XDvQVd9JESaOgGc4jT2/jquTAO7ppA5noTZQqH+MmZ89yjCzScLwtCPbWtkPZylL+TLWR49IwWmk+QkRR4GsA=="], + + "@babel/plugin-syntax-decorators/@babel/core/@babel/helpers": ["@babel/helpers@7.29.14", "", { "dependencies": { "@babel/template": "^7.29.7", "@babel/types": "^7.29.14" } }, "sha512-6E3Mi1r0B0umq6vmZa4/78q+64fqO2YY0THUdjDPKUCKhNb0yQy5NQIaPHCSD3ryTgiTss//P4JsWS80AsZ6LQ=="], + + "@babel/plugin-syntax-decorators/@babel/core/@babel/parser": ["@babel/parser@7.29.14", "", { "dependencies": { "@babel/types": "^7.29.14" }, "bin": "./bin/babel-parser.js" }, "sha512-VL220vXuyO2z3rNIQwY7ftj9UwpqOt+33sH+sBWkOekbsSR2g7EEMnOx24ZlCH0xOA3DM/33SifVFGbnJD8r/w=="], + + "@babel/plugin-syntax-decorators/@babel/core/@babel/template": ["@babel/template@7.29.7", "", { "dependencies": { "@babel/code-frame": "^7.29.7", "@babel/parser": "^7.29.7", "@babel/types": "^7.29.7" } }, "sha512-puq+Gf35oI24FeN11LkoUQFqv9uwNeWpxXZi/Ji3rRIoKAzKnxRaZ+Gkj0vKS9ZCiTESfng1N9LyOyXvo+m+Gg=="], + + "@babel/plugin-syntax-decorators/@babel/core/semver": ["semver@6.3.2", "", { "bin": { "semver": "bin/semver.js" } }, "sha512-GYrCADwpu6yV5OAvchkQ27Z5wwMxWAEMg5NNWjyHh/5DboFFqbdbvYNIvZouQpxXyeMPoTOh0vdPYKlf0ZswdQ=="], + + "@babel/plugin-syntax-dynamic-import/@babel/core/@babel/code-frame": ["@babel/code-frame@7.29.7", "", { "dependencies": { "@babel/helper-validator-identifier": "^7.29.7", "js-tokens": "^4.0.0", "picocolors": "^1.1.1" } }, "sha512-Aup7aUOfpbAUg2ROOJN6Iw5f9DMBlzu0mIkm/malLQFN/YQgO48wCj0Kxa3sEHJvPVFg7siR+qRInwXd2qhQKw=="], + + "@babel/plugin-syntax-dynamic-import/@babel/core/@babel/generator": ["@babel/generator@7.29.14", "", { "dependencies": { "@babel/parser": "^7.29.14", "@babel/types": "^7.29.14", "@jridgewell/gen-mapping": "^0.3.12", "@jridgewell/trace-mapping": "^0.3.28", "jsesc": "^3.0.2" } }, "sha512-qSY56jgW5JnSXzuekLVil6zaOQxOCtOHidr65KkaMBw772IuAY28Qx4ZykAcDn8+FRF15qk80XzKwgSc/RYW6g=="], + + "@babel/plugin-syntax-dynamic-import/@babel/core/@babel/helper-compilation-targets": ["@babel/helper-compilation-targets@7.29.13", "", { "dependencies": { "@babel/compat-data": "^7.29.7", "@babel/helper-validator-option": "^7.29.7", "browserslist": "^4.24.0", "lru-cache": "^5.1.1", "semver": "^6.3.1" } }, "sha512-8WxJ4/Vmes3ghacj8VOJy3NW8eyHiFY/4thU/LSBuBE470+igjR/j1ZTNn8fV5VdNrLx6iXUwig526UdOvfP0w=="], + + "@babel/plugin-syntax-dynamic-import/@babel/core/@babel/helper-module-transforms": ["@babel/helper-module-transforms@7.29.14", "", { "dependencies": { "@babel/helper-module-imports": "^7.29.7", "@babel/helper-validator-identifier": "^7.29.7", "@babel/traverse": "^7.29.14" }, "peerDependencies": { "@babel/core": "^7.0.0" } }, "sha512-2XDvQVd9JESaOgGc4jT2/jquTAO7ppA5noTZQqH+MmZ89yjCzScLwtCPbWtkPZylL+TLWR49IwWmk+QkRR4GsA=="], + + "@babel/plugin-syntax-dynamic-import/@babel/core/@babel/helpers": ["@babel/helpers@7.29.14", "", { "dependencies": { "@babel/template": "^7.29.7", "@babel/types": "^7.29.14" } }, "sha512-6E3Mi1r0B0umq6vmZa4/78q+64fqO2YY0THUdjDPKUCKhNb0yQy5NQIaPHCSD3ryTgiTss//P4JsWS80AsZ6LQ=="], + + "@babel/plugin-syntax-dynamic-import/@babel/core/@babel/parser": ["@babel/parser@7.29.14", "", { "dependencies": { "@babel/types": "^7.29.14" }, "bin": "./bin/babel-parser.js" }, "sha512-VL220vXuyO2z3rNIQwY7ftj9UwpqOt+33sH+sBWkOekbsSR2g7EEMnOx24ZlCH0xOA3DM/33SifVFGbnJD8r/w=="], + + "@babel/plugin-syntax-dynamic-import/@babel/core/@babel/template": ["@babel/template@7.29.7", "", { "dependencies": { "@babel/code-frame": "^7.29.7", "@babel/parser": "^7.29.7", "@babel/types": "^7.29.7" } }, "sha512-puq+Gf35oI24FeN11LkoUQFqv9uwNeWpxXZi/Ji3rRIoKAzKnxRaZ+Gkj0vKS9ZCiTESfng1N9LyOyXvo+m+Gg=="], + + "@babel/plugin-syntax-dynamic-import/@babel/core/semver": ["semver@6.3.2", "", { "bin": { "semver": "bin/semver.js" } }, "sha512-GYrCADwpu6yV5OAvchkQ27Z5wwMxWAEMg5NNWjyHh/5DboFFqbdbvYNIvZouQpxXyeMPoTOh0vdPYKlf0ZswdQ=="], + + "@babel/plugin-syntax-export-default-from/@babel/core/@babel/code-frame": ["@babel/code-frame@7.29.7", "", { "dependencies": { "@babel/helper-validator-identifier": "^7.29.7", "js-tokens": "^4.0.0", "picocolors": "^1.1.1" } }, "sha512-Aup7aUOfpbAUg2ROOJN6Iw5f9DMBlzu0mIkm/malLQFN/YQgO48wCj0Kxa3sEHJvPVFg7siR+qRInwXd2qhQKw=="], + + "@babel/plugin-syntax-export-default-from/@babel/core/@babel/generator": ["@babel/generator@7.29.14", "", { "dependencies": { "@babel/parser": "^7.29.14", "@babel/types": "^7.29.14", "@jridgewell/gen-mapping": "^0.3.12", "@jridgewell/trace-mapping": "^0.3.28", "jsesc": "^3.0.2" } }, "sha512-qSY56jgW5JnSXzuekLVil6zaOQxOCtOHidr65KkaMBw772IuAY28Qx4ZykAcDn8+FRF15qk80XzKwgSc/RYW6g=="], + + "@babel/plugin-syntax-export-default-from/@babel/core/@babel/helper-compilation-targets": ["@babel/helper-compilation-targets@7.29.13", "", { "dependencies": { "@babel/compat-data": "^7.29.7", "@babel/helper-validator-option": "^7.29.7", "browserslist": "^4.24.0", "lru-cache": "^5.1.1", "semver": "^6.3.1" } }, "sha512-8WxJ4/Vmes3ghacj8VOJy3NW8eyHiFY/4thU/LSBuBE470+igjR/j1ZTNn8fV5VdNrLx6iXUwig526UdOvfP0w=="], + + "@babel/plugin-syntax-export-default-from/@babel/core/@babel/helper-module-transforms": ["@babel/helper-module-transforms@7.29.14", "", { "dependencies": { "@babel/helper-module-imports": "^7.29.7", "@babel/helper-validator-identifier": "^7.29.7", "@babel/traverse": "^7.29.14" }, "peerDependencies": { "@babel/core": "^7.0.0" } }, "sha512-2XDvQVd9JESaOgGc4jT2/jquTAO7ppA5noTZQqH+MmZ89yjCzScLwtCPbWtkPZylL+TLWR49IwWmk+QkRR4GsA=="], + + "@babel/plugin-syntax-export-default-from/@babel/core/@babel/helpers": ["@babel/helpers@7.29.14", "", { "dependencies": { "@babel/template": "^7.29.7", "@babel/types": "^7.29.14" } }, "sha512-6E3Mi1r0B0umq6vmZa4/78q+64fqO2YY0THUdjDPKUCKhNb0yQy5NQIaPHCSD3ryTgiTss//P4JsWS80AsZ6LQ=="], + + "@babel/plugin-syntax-export-default-from/@babel/core/@babel/parser": ["@babel/parser@7.29.14", "", { "dependencies": { "@babel/types": "^7.29.14" }, "bin": "./bin/babel-parser.js" }, "sha512-VL220vXuyO2z3rNIQwY7ftj9UwpqOt+33sH+sBWkOekbsSR2g7EEMnOx24ZlCH0xOA3DM/33SifVFGbnJD8r/w=="], + + "@babel/plugin-syntax-export-default-from/@babel/core/@babel/template": ["@babel/template@7.29.7", "", { "dependencies": { "@babel/code-frame": "^7.29.7", "@babel/parser": "^7.29.7", "@babel/types": "^7.29.7" } }, "sha512-puq+Gf35oI24FeN11LkoUQFqv9uwNeWpxXZi/Ji3rRIoKAzKnxRaZ+Gkj0vKS9ZCiTESfng1N9LyOyXvo+m+Gg=="], + + "@babel/plugin-syntax-export-default-from/@babel/core/semver": ["semver@6.3.2", "", { "bin": { "semver": "bin/semver.js" } }, "sha512-GYrCADwpu6yV5OAvchkQ27Z5wwMxWAEMg5NNWjyHh/5DboFFqbdbvYNIvZouQpxXyeMPoTOh0vdPYKlf0ZswdQ=="], + "@babel/plugin-syntax-import-assertions/@babel/core/@babel/code-frame": ["@babel/code-frame@7.29.7", "", { "dependencies": { "@babel/helper-validator-identifier": "^7.29.7", "js-tokens": "^4.0.0", "picocolors": "^1.1.1" } }, "sha512-Aup7aUOfpbAUg2ROOJN6Iw5f9DMBlzu0mIkm/malLQFN/YQgO48wCj0Kxa3sEHJvPVFg7siR+qRInwXd2qhQKw=="], "@babel/plugin-syntax-import-assertions/@babel/core/@babel/generator": ["@babel/generator@7.29.14", "", { "dependencies": { "@babel/parser": "^7.29.14", "@babel/types": "^7.29.14", "@jridgewell/gen-mapping": "^0.3.12", "@jridgewell/trace-mapping": "^0.3.28", "jsesc": "^3.0.2" } }, "sha512-qSY56jgW5JnSXzuekLVil6zaOQxOCtOHidr65KkaMBw772IuAY28Qx4ZykAcDn8+FRF15qk80XzKwgSc/RYW6g=="], @@ -4216,6 +4959,38 @@ "@babel/plugin-syntax-import-attributes/@babel/core/semver": ["semver@6.3.2", "", { "bin": { "semver": "bin/semver.js" } }, "sha512-GYrCADwpu6yV5OAvchkQ27Z5wwMxWAEMg5NNWjyHh/5DboFFqbdbvYNIvZouQpxXyeMPoTOh0vdPYKlf0ZswdQ=="], + "@babel/plugin-syntax-nullish-coalescing-operator/@babel/core/@babel/code-frame": ["@babel/code-frame@7.29.7", "", { "dependencies": { "@babel/helper-validator-identifier": "^7.29.7", "js-tokens": "^4.0.0", "picocolors": "^1.1.1" } }, "sha512-Aup7aUOfpbAUg2ROOJN6Iw5f9DMBlzu0mIkm/malLQFN/YQgO48wCj0Kxa3sEHJvPVFg7siR+qRInwXd2qhQKw=="], + + "@babel/plugin-syntax-nullish-coalescing-operator/@babel/core/@babel/generator": ["@babel/generator@7.29.14", "", { "dependencies": { "@babel/parser": "^7.29.14", "@babel/types": "^7.29.14", "@jridgewell/gen-mapping": "^0.3.12", "@jridgewell/trace-mapping": "^0.3.28", "jsesc": "^3.0.2" } }, "sha512-qSY56jgW5JnSXzuekLVil6zaOQxOCtOHidr65KkaMBw772IuAY28Qx4ZykAcDn8+FRF15qk80XzKwgSc/RYW6g=="], + + "@babel/plugin-syntax-nullish-coalescing-operator/@babel/core/@babel/helper-compilation-targets": ["@babel/helper-compilation-targets@7.29.13", "", { "dependencies": { "@babel/compat-data": "^7.29.7", "@babel/helper-validator-option": "^7.29.7", "browserslist": "^4.24.0", "lru-cache": "^5.1.1", "semver": "^6.3.1" } }, "sha512-8WxJ4/Vmes3ghacj8VOJy3NW8eyHiFY/4thU/LSBuBE470+igjR/j1ZTNn8fV5VdNrLx6iXUwig526UdOvfP0w=="], + + "@babel/plugin-syntax-nullish-coalescing-operator/@babel/core/@babel/helper-module-transforms": ["@babel/helper-module-transforms@7.29.14", "", { "dependencies": { "@babel/helper-module-imports": "^7.29.7", "@babel/helper-validator-identifier": "^7.29.7", "@babel/traverse": "^7.29.14" }, "peerDependencies": { "@babel/core": "^7.0.0" } }, "sha512-2XDvQVd9JESaOgGc4jT2/jquTAO7ppA5noTZQqH+MmZ89yjCzScLwtCPbWtkPZylL+TLWR49IwWmk+QkRR4GsA=="], + + "@babel/plugin-syntax-nullish-coalescing-operator/@babel/core/@babel/helpers": ["@babel/helpers@7.29.14", "", { "dependencies": { "@babel/template": "^7.29.7", "@babel/types": "^7.29.14" } }, "sha512-6E3Mi1r0B0umq6vmZa4/78q+64fqO2YY0THUdjDPKUCKhNb0yQy5NQIaPHCSD3ryTgiTss//P4JsWS80AsZ6LQ=="], + + "@babel/plugin-syntax-nullish-coalescing-operator/@babel/core/@babel/parser": ["@babel/parser@7.29.14", "", { "dependencies": { "@babel/types": "^7.29.14" }, "bin": "./bin/babel-parser.js" }, "sha512-VL220vXuyO2z3rNIQwY7ftj9UwpqOt+33sH+sBWkOekbsSR2g7EEMnOx24ZlCH0xOA3DM/33SifVFGbnJD8r/w=="], + + "@babel/plugin-syntax-nullish-coalescing-operator/@babel/core/@babel/template": ["@babel/template@7.29.7", "", { "dependencies": { "@babel/code-frame": "^7.29.7", "@babel/parser": "^7.29.7", "@babel/types": "^7.29.7" } }, "sha512-puq+Gf35oI24FeN11LkoUQFqv9uwNeWpxXZi/Ji3rRIoKAzKnxRaZ+Gkj0vKS9ZCiTESfng1N9LyOyXvo+m+Gg=="], + + "@babel/plugin-syntax-nullish-coalescing-operator/@babel/core/semver": ["semver@6.3.2", "", { "bin": { "semver": "bin/semver.js" } }, "sha512-GYrCADwpu6yV5OAvchkQ27Z5wwMxWAEMg5NNWjyHh/5DboFFqbdbvYNIvZouQpxXyeMPoTOh0vdPYKlf0ZswdQ=="], + + "@babel/plugin-syntax-optional-chaining/@babel/core/@babel/code-frame": ["@babel/code-frame@7.29.7", "", { "dependencies": { "@babel/helper-validator-identifier": "^7.29.7", "js-tokens": "^4.0.0", "picocolors": "^1.1.1" } }, "sha512-Aup7aUOfpbAUg2ROOJN6Iw5f9DMBlzu0mIkm/malLQFN/YQgO48wCj0Kxa3sEHJvPVFg7siR+qRInwXd2qhQKw=="], + + "@babel/plugin-syntax-optional-chaining/@babel/core/@babel/generator": ["@babel/generator@7.29.14", "", { "dependencies": { "@babel/parser": "^7.29.14", "@babel/types": "^7.29.14", "@jridgewell/gen-mapping": "^0.3.12", "@jridgewell/trace-mapping": "^0.3.28", "jsesc": "^3.0.2" } }, "sha512-qSY56jgW5JnSXzuekLVil6zaOQxOCtOHidr65KkaMBw772IuAY28Qx4ZykAcDn8+FRF15qk80XzKwgSc/RYW6g=="], + + "@babel/plugin-syntax-optional-chaining/@babel/core/@babel/helper-compilation-targets": ["@babel/helper-compilation-targets@7.29.13", "", { "dependencies": { "@babel/compat-data": "^7.29.7", "@babel/helper-validator-option": "^7.29.7", "browserslist": "^4.24.0", "lru-cache": "^5.1.1", "semver": "^6.3.1" } }, "sha512-8WxJ4/Vmes3ghacj8VOJy3NW8eyHiFY/4thU/LSBuBE470+igjR/j1ZTNn8fV5VdNrLx6iXUwig526UdOvfP0w=="], + + "@babel/plugin-syntax-optional-chaining/@babel/core/@babel/helper-module-transforms": ["@babel/helper-module-transforms@7.29.14", "", { "dependencies": { "@babel/helper-module-imports": "^7.29.7", "@babel/helper-validator-identifier": "^7.29.7", "@babel/traverse": "^7.29.14" }, "peerDependencies": { "@babel/core": "^7.0.0" } }, "sha512-2XDvQVd9JESaOgGc4jT2/jquTAO7ppA5noTZQqH+MmZ89yjCzScLwtCPbWtkPZylL+TLWR49IwWmk+QkRR4GsA=="], + + "@babel/plugin-syntax-optional-chaining/@babel/core/@babel/helpers": ["@babel/helpers@7.29.14", "", { "dependencies": { "@babel/template": "^7.29.7", "@babel/types": "^7.29.14" } }, "sha512-6E3Mi1r0B0umq6vmZa4/78q+64fqO2YY0THUdjDPKUCKhNb0yQy5NQIaPHCSD3ryTgiTss//P4JsWS80AsZ6LQ=="], + + "@babel/plugin-syntax-optional-chaining/@babel/core/@babel/parser": ["@babel/parser@7.29.14", "", { "dependencies": { "@babel/types": "^7.29.14" }, "bin": "./bin/babel-parser.js" }, "sha512-VL220vXuyO2z3rNIQwY7ftj9UwpqOt+33sH+sBWkOekbsSR2g7EEMnOx24ZlCH0xOA3DM/33SifVFGbnJD8r/w=="], + + "@babel/plugin-syntax-optional-chaining/@babel/core/@babel/template": ["@babel/template@7.29.7", "", { "dependencies": { "@babel/code-frame": "^7.29.7", "@babel/parser": "^7.29.7", "@babel/types": "^7.29.7" } }, "sha512-puq+Gf35oI24FeN11LkoUQFqv9uwNeWpxXZi/Ji3rRIoKAzKnxRaZ+Gkj0vKS9ZCiTESfng1N9LyOyXvo+m+Gg=="], + + "@babel/plugin-syntax-optional-chaining/@babel/core/semver": ["semver@6.3.2", "", { "bin": { "semver": "bin/semver.js" } }, "sha512-GYrCADwpu6yV5OAvchkQ27Z5wwMxWAEMg5NNWjyHh/5DboFFqbdbvYNIvZouQpxXyeMPoTOh0vdPYKlf0ZswdQ=="], + "@babel/plugin-syntax-unicode-sets-regex/@babel/core/@babel/code-frame": ["@babel/code-frame@7.29.7", "", { "dependencies": { "@babel/helper-validator-identifier": "^7.29.7", "js-tokens": "^4.0.0", "picocolors": "^1.1.1" } }, "sha512-Aup7aUOfpbAUg2ROOJN6Iw5f9DMBlzu0mIkm/malLQFN/YQgO48wCj0Kxa3sEHJvPVFg7siR+qRInwXd2qhQKw=="], "@babel/plugin-syntax-unicode-sets-regex/@babel/core/@babel/generator": ["@babel/generator@7.29.14", "", { "dependencies": { "@babel/parser": "^7.29.14", "@babel/types": "^7.29.14", "@jridgewell/gen-mapping": "^0.3.12", "@jridgewell/trace-mapping": "^0.3.28", "jsesc": "^3.0.2" } }, "sha512-qSY56jgW5JnSXzuekLVil6zaOQxOCtOHidr65KkaMBw772IuAY28Qx4ZykAcDn8+FRF15qk80XzKwgSc/RYW6g=="], @@ -4510,6 +5285,22 @@ "@babel/plugin-transform-export-namespace-from/@babel/core/semver": ["semver@6.3.2", "", { "bin": { "semver": "bin/semver.js" } }, "sha512-GYrCADwpu6yV5OAvchkQ27Z5wwMxWAEMg5NNWjyHh/5DboFFqbdbvYNIvZouQpxXyeMPoTOh0vdPYKlf0ZswdQ=="], + "@babel/plugin-transform-flow-strip-types/@babel/core/@babel/code-frame": ["@babel/code-frame@7.29.7", "", { "dependencies": { "@babel/helper-validator-identifier": "^7.29.7", "js-tokens": "^4.0.0", "picocolors": "^1.1.1" } }, "sha512-Aup7aUOfpbAUg2ROOJN6Iw5f9DMBlzu0mIkm/malLQFN/YQgO48wCj0Kxa3sEHJvPVFg7siR+qRInwXd2qhQKw=="], + + "@babel/plugin-transform-flow-strip-types/@babel/core/@babel/generator": ["@babel/generator@7.29.14", "", { "dependencies": { "@babel/parser": "^7.29.14", "@babel/types": "^7.29.14", "@jridgewell/gen-mapping": "^0.3.12", "@jridgewell/trace-mapping": "^0.3.28", "jsesc": "^3.0.2" } }, "sha512-qSY56jgW5JnSXzuekLVil6zaOQxOCtOHidr65KkaMBw772IuAY28Qx4ZykAcDn8+FRF15qk80XzKwgSc/RYW6g=="], + + "@babel/plugin-transform-flow-strip-types/@babel/core/@babel/helper-compilation-targets": ["@babel/helper-compilation-targets@7.29.13", "", { "dependencies": { "@babel/compat-data": "^7.29.7", "@babel/helper-validator-option": "^7.29.7", "browserslist": "^4.24.0", "lru-cache": "^5.1.1", "semver": "^6.3.1" } }, "sha512-8WxJ4/Vmes3ghacj8VOJy3NW8eyHiFY/4thU/LSBuBE470+igjR/j1ZTNn8fV5VdNrLx6iXUwig526UdOvfP0w=="], + + "@babel/plugin-transform-flow-strip-types/@babel/core/@babel/helper-module-transforms": ["@babel/helper-module-transforms@7.29.14", "", { "dependencies": { "@babel/helper-module-imports": "^7.29.7", "@babel/helper-validator-identifier": "^7.29.7", "@babel/traverse": "^7.29.14" }, "peerDependencies": { "@babel/core": "^7.0.0" } }, "sha512-2XDvQVd9JESaOgGc4jT2/jquTAO7ppA5noTZQqH+MmZ89yjCzScLwtCPbWtkPZylL+TLWR49IwWmk+QkRR4GsA=="], + + "@babel/plugin-transform-flow-strip-types/@babel/core/@babel/helpers": ["@babel/helpers@7.29.14", "", { "dependencies": { "@babel/template": "^7.29.7", "@babel/types": "^7.29.14" } }, "sha512-6E3Mi1r0B0umq6vmZa4/78q+64fqO2YY0THUdjDPKUCKhNb0yQy5NQIaPHCSD3ryTgiTss//P4JsWS80AsZ6LQ=="], + + "@babel/plugin-transform-flow-strip-types/@babel/core/@babel/parser": ["@babel/parser@7.29.14", "", { "dependencies": { "@babel/types": "^7.29.14" }, "bin": "./bin/babel-parser.js" }, "sha512-VL220vXuyO2z3rNIQwY7ftj9UwpqOt+33sH+sBWkOekbsSR2g7EEMnOx24ZlCH0xOA3DM/33SifVFGbnJD8r/w=="], + + "@babel/plugin-transform-flow-strip-types/@babel/core/@babel/template": ["@babel/template@7.29.7", "", { "dependencies": { "@babel/code-frame": "^7.29.7", "@babel/parser": "^7.29.7", "@babel/types": "^7.29.7" } }, "sha512-puq+Gf35oI24FeN11LkoUQFqv9uwNeWpxXZi/Ji3rRIoKAzKnxRaZ+Gkj0vKS9ZCiTESfng1N9LyOyXvo+m+Gg=="], + + "@babel/plugin-transform-flow-strip-types/@babel/core/semver": ["semver@6.3.2", "", { "bin": { "semver": "bin/semver.js" } }, "sha512-GYrCADwpu6yV5OAvchkQ27Z5wwMxWAEMg5NNWjyHh/5DboFFqbdbvYNIvZouQpxXyeMPoTOh0vdPYKlf0ZswdQ=="], + "@babel/plugin-transform-for-of/@babel/core/@babel/code-frame": ["@babel/code-frame@7.29.7", "", { "dependencies": { "@babel/helper-validator-identifier": "^7.29.7", "js-tokens": "^4.0.0", "picocolors": "^1.1.1" } }, "sha512-Aup7aUOfpbAUg2ROOJN6Iw5f9DMBlzu0mIkm/malLQFN/YQgO48wCj0Kxa3sEHJvPVFg7siR+qRInwXd2qhQKw=="], "@babel/plugin-transform-for-of/@babel/core/@babel/generator": ["@babel/generator@7.29.14", "", { "dependencies": { "@babel/parser": "^7.29.14", "@babel/types": "^7.29.14", "@jridgewell/gen-mapping": "^0.3.12", "@jridgewell/trace-mapping": "^0.3.28", "jsesc": "^3.0.2" } }, "sha512-qSY56jgW5JnSXzuekLVil6zaOQxOCtOHidr65KkaMBw772IuAY28Qx4ZykAcDn8+FRF15qk80XzKwgSc/RYW6g=="], @@ -4982,6 +5773,22 @@ "@babel/plugin-transform-reserved-words/@babel/core/semver": ["semver@6.3.2", "", { "bin": { "semver": "bin/semver.js" } }, "sha512-GYrCADwpu6yV5OAvchkQ27Z5wwMxWAEMg5NNWjyHh/5DboFFqbdbvYNIvZouQpxXyeMPoTOh0vdPYKlf0ZswdQ=="], + "@babel/plugin-transform-runtime/@babel/core/@babel/code-frame": ["@babel/code-frame@7.29.7", "", { "dependencies": { "@babel/helper-validator-identifier": "^7.29.7", "js-tokens": "^4.0.0", "picocolors": "^1.1.1" } }, "sha512-Aup7aUOfpbAUg2ROOJN6Iw5f9DMBlzu0mIkm/malLQFN/YQgO48wCj0Kxa3sEHJvPVFg7siR+qRInwXd2qhQKw=="], + + "@babel/plugin-transform-runtime/@babel/core/@babel/generator": ["@babel/generator@7.29.14", "", { "dependencies": { "@babel/parser": "^7.29.14", "@babel/types": "^7.29.14", "@jridgewell/gen-mapping": "^0.3.12", "@jridgewell/trace-mapping": "^0.3.28", "jsesc": "^3.0.2" } }, "sha512-qSY56jgW5JnSXzuekLVil6zaOQxOCtOHidr65KkaMBw772IuAY28Qx4ZykAcDn8+FRF15qk80XzKwgSc/RYW6g=="], + + "@babel/plugin-transform-runtime/@babel/core/@babel/helper-compilation-targets": ["@babel/helper-compilation-targets@7.29.13", "", { "dependencies": { "@babel/compat-data": "^7.29.7", "@babel/helper-validator-option": "^7.29.7", "browserslist": "^4.24.0", "lru-cache": "^5.1.1", "semver": "^6.3.1" } }, "sha512-8WxJ4/Vmes3ghacj8VOJy3NW8eyHiFY/4thU/LSBuBE470+igjR/j1ZTNn8fV5VdNrLx6iXUwig526UdOvfP0w=="], + + "@babel/plugin-transform-runtime/@babel/core/@babel/helper-module-transforms": ["@babel/helper-module-transforms@7.29.14", "", { "dependencies": { "@babel/helper-module-imports": "^7.29.7", "@babel/helper-validator-identifier": "^7.29.7", "@babel/traverse": "^7.29.14" }, "peerDependencies": { "@babel/core": "^7.0.0" } }, "sha512-2XDvQVd9JESaOgGc4jT2/jquTAO7ppA5noTZQqH+MmZ89yjCzScLwtCPbWtkPZylL+TLWR49IwWmk+QkRR4GsA=="], + + "@babel/plugin-transform-runtime/@babel/core/@babel/helpers": ["@babel/helpers@7.29.14", "", { "dependencies": { "@babel/template": "^7.29.7", "@babel/types": "^7.29.14" } }, "sha512-6E3Mi1r0B0umq6vmZa4/78q+64fqO2YY0THUdjDPKUCKhNb0yQy5NQIaPHCSD3ryTgiTss//P4JsWS80AsZ6LQ=="], + + "@babel/plugin-transform-runtime/@babel/core/@babel/parser": ["@babel/parser@7.29.14", "", { "dependencies": { "@babel/types": "^7.29.14" }, "bin": "./bin/babel-parser.js" }, "sha512-VL220vXuyO2z3rNIQwY7ftj9UwpqOt+33sH+sBWkOekbsSR2g7EEMnOx24ZlCH0xOA3DM/33SifVFGbnJD8r/w=="], + + "@babel/plugin-transform-runtime/@babel/core/@babel/template": ["@babel/template@7.29.7", "", { "dependencies": { "@babel/code-frame": "^7.29.7", "@babel/parser": "^7.29.7", "@babel/types": "^7.29.7" } }, "sha512-puq+Gf35oI24FeN11LkoUQFqv9uwNeWpxXZi/Ji3rRIoKAzKnxRaZ+Gkj0vKS9ZCiTESfng1N9LyOyXvo+m+Gg=="], + + "@babel/plugin-transform-runtime/babel-plugin-polyfill-corejs3/@babel/helper-define-polyfill-provider": ["@babel/helper-define-polyfill-provider@0.6.8", "", { "dependencies": { "@babel/helper-compilation-targets": "^7.28.6", "@babel/helper-plugin-utils": "^7.28.6", "debug": "^4.4.3", "lodash.debounce": "^4.0.8", "resolve": "^1.22.11" }, "peerDependencies": { "@babel/core": "^7.4.0 || ^8.0.0-0 <8.0.0" } }, "sha512-47UwBLPpQi1NoWzLuHNjRoHlYXMwIJoBf7MFou6viC/sIHWYygpvr0B6IAyh5sBdA2nr2LPIRww8lfaUVQINBA=="], + "@babel/plugin-transform-shorthand-properties/@babel/core/@babel/code-frame": ["@babel/code-frame@7.29.7", "", { "dependencies": { "@babel/helper-validator-identifier": "^7.29.7", "js-tokens": "^4.0.0", "picocolors": "^1.1.1" } }, "sha512-Aup7aUOfpbAUg2ROOJN6Iw5f9DMBlzu0mIkm/malLQFN/YQgO48wCj0Kxa3sEHJvPVFg7siR+qRInwXd2qhQKw=="], "@babel/plugin-transform-shorthand-properties/@babel/core/@babel/generator": ["@babel/generator@7.29.14", "", { "dependencies": { "@babel/parser": "^7.29.14", "@babel/types": "^7.29.14", "@jridgewell/gen-mapping": "^0.3.12", "@jridgewell/trace-mapping": "^0.3.28", "jsesc": "^3.0.2" } }, "sha512-qSY56jgW5JnSXzuekLVil6zaOQxOCtOHidr65KkaMBw772IuAY28Qx4ZykAcDn8+FRF15qk80XzKwgSc/RYW6g=="], @@ -5224,8 +6031,58 @@ "@devup-ui/eslint-plugin/typescript-eslint/@typescript-eslint/typescript-estree": ["@typescript-eslint/typescript-estree@8.73.0", "", { "dependencies": { "@typescript-eslint/project-service": "8.73.0", "@typescript-eslint/tsconfig-utils": "8.73.0", "@typescript-eslint/types": "8.73.0", "@typescript-eslint/visitor-keys": "8.73.0", "debug": "^4.4.3", "minimatch": "^11.0.1", "semver": "^7.7.3", "tinyglobby": "^0.2.15", "ts-api-utils": "^2.5.0" }, "peerDependencies": { "@typescript/native": "npm:typescript@>=7.1.0-dev.20261009.1 || >=7.1.0-beta <7.1.0-dev", "typescript": ">=4.8.4 <6.1.0" }, "optionalPeers": ["@typescript/native"] }, "sha512-InjlBkSdWceIwIBWSwS3ENUp+i0O02PGX3Zv2wnihWJC1WDVGvG7mTHuf8b57uAaITj94d6tRPDH+sUEtXdRQQ=="], + "@expo/json-file/@babel/code-frame/js-tokens": ["js-tokens@4.0.0", "", {}, "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ=="], + + "@expo/metro-config/@babel/code-frame/js-tokens": ["js-tokens@4.0.0", "", {}, "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ=="], + + "@expo/metro-config/@babel/core/@babel/helper-compilation-targets": ["@babel/helper-compilation-targets@7.29.13", "", { "dependencies": { "@babel/compat-data": "^7.29.7", "@babel/helper-validator-option": "^7.29.7", "browserslist": "^4.24.0", "lru-cache": "^5.1.1", "semver": "^6.3.1" } }, "sha512-8WxJ4/Vmes3ghacj8VOJy3NW8eyHiFY/4thU/LSBuBE470+igjR/j1ZTNn8fV5VdNrLx6iXUwig526UdOvfP0w=="], + + "@expo/metro-config/@babel/core/@babel/helper-module-transforms": ["@babel/helper-module-transforms@7.29.14", "", { "dependencies": { "@babel/helper-module-imports": "^7.29.7", "@babel/helper-validator-identifier": "^7.29.7", "@babel/traverse": "^7.29.14" }, "peerDependencies": { "@babel/core": "^7.0.0" } }, "sha512-2XDvQVd9JESaOgGc4jT2/jquTAO7ppA5noTZQqH+MmZ89yjCzScLwtCPbWtkPZylL+TLWR49IwWmk+QkRR4GsA=="], + + "@expo/metro-config/@babel/core/@babel/helpers": ["@babel/helpers@7.29.14", "", { "dependencies": { "@babel/template": "^7.29.7", "@babel/types": "^7.29.14" } }, "sha512-6E3Mi1r0B0umq6vmZa4/78q+64fqO2YY0THUdjDPKUCKhNb0yQy5NQIaPHCSD3ryTgiTss//P4JsWS80AsZ6LQ=="], + + "@expo/metro-config/@babel/core/@babel/parser": ["@babel/parser@7.29.14", "", { "dependencies": { "@babel/types": "^7.29.14" }, "bin": "./bin/babel-parser.js" }, "sha512-VL220vXuyO2z3rNIQwY7ftj9UwpqOt+33sH+sBWkOekbsSR2g7EEMnOx24ZlCH0xOA3DM/33SifVFGbnJD8r/w=="], + + "@expo/metro-config/@babel/core/@babel/template": ["@babel/template@7.29.7", "", { "dependencies": { "@babel/code-frame": "^7.29.7", "@babel/parser": "^7.29.7", "@babel/types": "^7.29.7" } }, "sha512-puq+Gf35oI24FeN11LkoUQFqv9uwNeWpxXZi/Ji3rRIoKAzKnxRaZ+Gkj0vKS9ZCiTESfng1N9LyOyXvo+m+Gg=="], + + "@expo/metro-config/@babel/core/semver": ["semver@6.3.2", "", { "bin": { "semver": "bin/semver.js" } }, "sha512-GYrCADwpu6yV5OAvchkQ27Z5wwMxWAEMg5NNWjyHh/5DboFFqbdbvYNIvZouQpxXyeMPoTOh0vdPYKlf0ZswdQ=="], + + "@expo/metro-config/@babel/generator/@babel/parser": ["@babel/parser@7.29.14", "", { "dependencies": { "@babel/types": "^7.29.14" }, "bin": "./bin/babel-parser.js" }, "sha512-VL220vXuyO2z3rNIQwY7ftj9UwpqOt+33sH+sBWkOekbsSR2g7EEMnOx24ZlCH0xOA3DM/33SifVFGbnJD8r/w=="], + + "@expo/metro-config/hermes-parser/hermes-estree": ["hermes-estree@0.36.1", "", {}, "sha512-guv1nQ6IJ7S83NRFPWc3SA7IBZrdNC9kapwOq6uXvF4wP+sDCgjzQbKPCoyYmoyZRzztF/n/c36l/rccCZSiCw=="], + + "@expo/metro-file-map/jest-worker/supports-color": ["supports-color@8.1.1", "", { "dependencies": { "has-flag": "^4.0.0" } }, "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q=="], + + "@expo/metro/metro-source-map/ob1": ["ob1@0.87.1", "", { "dependencies": { "flow-enums-runtime": "^0.0.6" } }, "sha512-i8iA8uij0g1YQzS8uOJPSRCgwDjO9warIHUAu1Fqj877Wc3wlfxDYBioYWgKTBF2+URVJttyDWSEpmd99nlvtQ=="], + + "@expo/metro/metro-source-map/source-map": ["source-map@0.5.7", "", {}, "sha512-LbrmJOMUSdEVxIKvdcJzQC+nQhe8FUZQTXQy6+I75skNgn3OoQ0DZA8YnFa7gp8tqtL3KPf1kmo0R5DoApeSGQ=="], + + "@expo/require-utils/@babel/code-frame/js-tokens": ["js-tokens@4.0.0", "", {}, "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ=="], + + "@expo/require-utils/@babel/core/@babel/generator": ["@babel/generator@7.29.14", "", { "dependencies": { "@babel/parser": "^7.29.14", "@babel/types": "^7.29.14", "@jridgewell/gen-mapping": "^0.3.12", "@jridgewell/trace-mapping": "^0.3.28", "jsesc": "^3.0.2" } }, "sha512-qSY56jgW5JnSXzuekLVil6zaOQxOCtOHidr65KkaMBw772IuAY28Qx4ZykAcDn8+FRF15qk80XzKwgSc/RYW6g=="], + + "@expo/require-utils/@babel/core/@babel/helper-compilation-targets": ["@babel/helper-compilation-targets@7.29.13", "", { "dependencies": { "@babel/compat-data": "^7.29.7", "@babel/helper-validator-option": "^7.29.7", "browserslist": "^4.24.0", "lru-cache": "^5.1.1", "semver": "^6.3.1" } }, "sha512-8WxJ4/Vmes3ghacj8VOJy3NW8eyHiFY/4thU/LSBuBE470+igjR/j1ZTNn8fV5VdNrLx6iXUwig526UdOvfP0w=="], + + "@expo/require-utils/@babel/core/@babel/helper-module-transforms": ["@babel/helper-module-transforms@7.29.14", "", { "dependencies": { "@babel/helper-module-imports": "^7.29.7", "@babel/helper-validator-identifier": "^7.29.7", "@babel/traverse": "^7.29.14" }, "peerDependencies": { "@babel/core": "^7.0.0" } }, "sha512-2XDvQVd9JESaOgGc4jT2/jquTAO7ppA5noTZQqH+MmZ89yjCzScLwtCPbWtkPZylL+TLWR49IwWmk+QkRR4GsA=="], + + "@expo/require-utils/@babel/core/@babel/helpers": ["@babel/helpers@7.29.14", "", { "dependencies": { "@babel/template": "^7.29.7", "@babel/types": "^7.29.14" } }, "sha512-6E3Mi1r0B0umq6vmZa4/78q+64fqO2YY0THUdjDPKUCKhNb0yQy5NQIaPHCSD3ryTgiTss//P4JsWS80AsZ6LQ=="], + + "@expo/require-utils/@babel/core/@babel/parser": ["@babel/parser@7.29.14", "", { "dependencies": { "@babel/types": "^7.29.14" }, "bin": "./bin/babel-parser.js" }, "sha512-VL220vXuyO2z3rNIQwY7ftj9UwpqOt+33sH+sBWkOekbsSR2g7EEMnOx24ZlCH0xOA3DM/33SifVFGbnJD8r/w=="], + + "@expo/require-utils/@babel/core/@babel/template": ["@babel/template@7.29.7", "", { "dependencies": { "@babel/code-frame": "^7.29.7", "@babel/parser": "^7.29.7", "@babel/types": "^7.29.7" } }, "sha512-puq+Gf35oI24FeN11LkoUQFqv9uwNeWpxXZi/Ji3rRIoKAzKnxRaZ+Gkj0vKS9ZCiTESfng1N9LyOyXvo+m+Gg=="], + + "@expo/require-utils/@babel/core/semver": ["semver@6.3.2", "", { "bin": { "semver": "bin/semver.js" } }, "sha512-GYrCADwpu6yV5OAvchkQ27Z5wwMxWAEMg5NNWjyHh/5DboFFqbdbvYNIvZouQpxXyeMPoTOh0vdPYKlf0ZswdQ=="], + + "@expo/require-utils/@babel/plugin-transform-modules-commonjs/@babel/helper-module-transforms": ["@babel/helper-module-transforms@7.29.14", "", { "dependencies": { "@babel/helper-module-imports": "^7.29.7", "@babel/helper-validator-identifier": "^7.29.7", "@babel/traverse": "^7.29.14" }, "peerDependencies": { "@babel/core": "^7.0.0" } }, "sha512-2XDvQVd9JESaOgGc4jT2/jquTAO7ppA5noTZQqH+MmZ89yjCzScLwtCPbWtkPZylL+TLWR49IwWmk+QkRR4GsA=="], + + "@expo/require-utils/@babel/plugin-transform-modules-commonjs/@babel/helper-plugin-utils": ["@babel/helper-plugin-utils@7.29.7", "", {}, "sha512-G7sHYigPY17oO5SYWnfD/0MTBwVR781S/JI643e/JhUYgVgWE/61SoW3NH9KWUKyKq5LVh3npif99Wkt6j86Jw=="], + + "@expo/xcpretty/@babel/code-frame/js-tokens": ["js-tokens@4.0.0", "", {}, "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ=="], + "@isaacs/cliui/string-width/emoji-regex": ["emoji-regex@9.2.2", "", {}, "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg=="], + "@isaacs/cliui/strip-ansi/ansi-regex": ["ansi-regex@6.6.0", "", {}, "sha512-XZ5apbzreCbXSKwPjJstu8R0zOi247w3XYwWxtwBXgpZrCyc1Ka7p9/xY0A9/diMewmHbEKz+FIraWaEWjlN5g=="], + "@isaacs/cliui/wrap-ansi/ansi-styles": ["ansi-styles@6.2.3", "", {}, "sha512-4Dj6M28JB+oAH8kFkTLUo+a2jwOFkuqb3yucU0CANcRRUbxS0cP0nZYCGjcc3BNXwRIsUVmDGgzawme7zvJHvg=="], "@joshwooding/vite-plugin-react-docgen-typescript/glob/minimatch": ["minimatch@10.2.6", "", { "dependencies": { "brace-expansion": "^5.0.8" } }, "sha512-vpLQEs+VLCr1nU0BXS07maYoFwlDAH0gngQuuttxIwutDFEMHq2blX+8vpgxDdK3J1PwjCJiep77OitTZ4Ll1A=="], @@ -5278,6 +6135,10 @@ "@oxc-resolver/binding-wasm32-wasi/@emnapi/core/@emnapi/wasi-threads": ["@emnapi/wasi-threads@1.2.2", "", { "dependencies": { "tslib": "^2.4.0" } }, "sha512-c95qOXkHdydNKhscBTebqEC1CVAZpyqOfVfBzQ1qgzyl3gfeldUjIggDbIZgDKsHLgnsM+igH7TJ/eAasaVuMA=="], + "@pandacss/cli/string-width/emoji-regex": ["emoji-regex@10.6.0", "", {}, "sha512-toUI84YS5YmxW219erniWD0CIVOo46xGKColeNQRgOzDorgBi1v4D71/OFzgD9GO2UGKIv1C3Sp8DAn0+j5w7A=="], + + "@pandacss/cli/string-width/strip-ansi": ["strip-ansi@7.2.0", "", { "dependencies": { "ansi-regex": "^6.2.2" } }, "sha512-yDPMNjp4WyfYBkHnjIRLfca1i6KMyGCtsVgoKe/z1+6vukgaENdgGBZt+ZmKPc4gavvEZ5OgHfHdrazhgNyG7w=="], + "@pandacss/config/rolldown/@oxc-project/types": ["@oxc-project/types@0.148.0", "", {}, "sha512-Nm4s/jB+4FpFsPhWGEC4h7rzksesmtnMXomo6rCMcg/b8zLQuOziRgkCS1fxDCXOlJB/6Q8oABOZ/OP6RIPj9A=="], "@pandacss/config/rolldown/@rolldown/binding-android-arm-eabi": ["@rolldown/binding-android-arm-eabi@1.2.7", "", { "os": "android", "cpu": "arm" }, "sha512-EypzgnYCwyVY4NDHKzGmNJT5b+XaQEBniHxsMdeIQLB/tcCzZnhqrzHpZFbX9iaxx+5RiB8caATBtfvZP7zVxQ=="], @@ -5310,6 +6171,26 @@ "@pandacss/config/rolldown/@rolldown/binding-win32-x64-msvc": ["@rolldown/binding-win32-x64-msvc@1.2.7", "", { "os": "win32", "cpu": "x64" }, "sha512-W/jg5qoRSqjsEv0+dZi4e687mcHqmVuU0P4fK6qS/xjetW2Gmc1W8j//z5nAeNcC8Ttm0hV46IjcYeuVwYhuiw=="], + "@react-native/codegen/@babel/core/@babel/code-frame": ["@babel/code-frame@7.29.7", "", { "dependencies": { "@babel/helper-validator-identifier": "^7.29.7", "js-tokens": "^4.0.0", "picocolors": "^1.1.1" } }, "sha512-Aup7aUOfpbAUg2ROOJN6Iw5f9DMBlzu0mIkm/malLQFN/YQgO48wCj0Kxa3sEHJvPVFg7siR+qRInwXd2qhQKw=="], + + "@react-native/codegen/@babel/core/@babel/generator": ["@babel/generator@7.29.14", "", { "dependencies": { "@babel/parser": "^7.29.14", "@babel/types": "^7.29.14", "@jridgewell/gen-mapping": "^0.3.12", "@jridgewell/trace-mapping": "^0.3.28", "jsesc": "^3.0.2" } }, "sha512-qSY56jgW5JnSXzuekLVil6zaOQxOCtOHidr65KkaMBw772IuAY28Qx4ZykAcDn8+FRF15qk80XzKwgSc/RYW6g=="], + + "@react-native/codegen/@babel/core/@babel/helper-compilation-targets": ["@babel/helper-compilation-targets@7.29.13", "", { "dependencies": { "@babel/compat-data": "^7.29.7", "@babel/helper-validator-option": "^7.29.7", "browserslist": "^4.24.0", "lru-cache": "^5.1.1", "semver": "^6.3.1" } }, "sha512-8WxJ4/Vmes3ghacj8VOJy3NW8eyHiFY/4thU/LSBuBE470+igjR/j1ZTNn8fV5VdNrLx6iXUwig526UdOvfP0w=="], + + "@react-native/codegen/@babel/core/@babel/helper-module-transforms": ["@babel/helper-module-transforms@7.29.14", "", { "dependencies": { "@babel/helper-module-imports": "^7.29.7", "@babel/helper-validator-identifier": "^7.29.7", "@babel/traverse": "^7.29.14" }, "peerDependencies": { "@babel/core": "^7.0.0" } }, "sha512-2XDvQVd9JESaOgGc4jT2/jquTAO7ppA5noTZQqH+MmZ89yjCzScLwtCPbWtkPZylL+TLWR49IwWmk+QkRR4GsA=="], + + "@react-native/codegen/@babel/core/@babel/helpers": ["@babel/helpers@7.29.14", "", { "dependencies": { "@babel/template": "^7.29.7", "@babel/types": "^7.29.14" } }, "sha512-6E3Mi1r0B0umq6vmZa4/78q+64fqO2YY0THUdjDPKUCKhNb0yQy5NQIaPHCSD3ryTgiTss//P4JsWS80AsZ6LQ=="], + + "@react-native/codegen/@babel/core/@babel/template": ["@babel/template@7.29.7", "", { "dependencies": { "@babel/code-frame": "^7.29.7", "@babel/parser": "^7.29.7", "@babel/types": "^7.29.7" } }, "sha512-puq+Gf35oI24FeN11LkoUQFqv9uwNeWpxXZi/Ji3rRIoKAzKnxRaZ+Gkj0vKS9ZCiTESfng1N9LyOyXvo+m+Gg=="], + + "@react-native/codegen/@babel/core/semver": ["semver@6.3.2", "", { "bin": { "semver": "bin/semver.js" } }, "sha512-GYrCADwpu6yV5OAvchkQ27Z5wwMxWAEMg5NNWjyHh/5DboFFqbdbvYNIvZouQpxXyeMPoTOh0vdPYKlf0ZswdQ=="], + + "@react-native/dev-middleware/open/define-lazy-prop": ["define-lazy-prop@2.0.0", "", {}, "sha512-Ds09qNh8yw3khSjiJjiUInaGX9xlqZDY7JVryGxdxV7NPeuqQfplOpQ66yJFZut3jLa5zOwkXw1g9EI2uKh4Og=="], + + "@react-native/dev-middleware/open/is-docker": ["is-docker@2.2.1", "", { "bin": { "is-docker": "cli.js" } }, "sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ=="], + + "@react-native/dev-middleware/open/is-wsl": ["is-wsl@2.2.0", "", { "dependencies": { "is-docker": "^2.0.0" } }, "sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww=="], + "@rolldown/binding-wasm32-wasi/@emnapi/core/@emnapi/wasi-threads": ["@emnapi/wasi-threads@2.2.0", "", { "dependencies": { "tslib": "^2.4.0" } }, "sha512-JP7OYH38Q7+pyTAe14raZHLQIK7BDKbdwji+Xi3pcd/6QkJYQH3SX4wu6EplGrGJWRepoNzedfm0G3B9Z4e9Rw=="], "@rspack/binding-wasm32-wasi/@emnapi/core/@emnapi/wasi-threads": ["@emnapi/wasi-threads@2.2.0", "", { "dependencies": { "tslib": "^2.4.0" } }, "sha512-JP7OYH38Q7+pyTAe14raZHLQIK7BDKbdwji+Xi3pcd/6QkJYQH3SX4wu6EplGrGJWRepoNzedfm0G3B9Z4e9Rw=="], @@ -5374,6 +6255,8 @@ "@testing-library/dom/@babel/code-frame/js-tokens": ["js-tokens@4.0.0", "", {}, "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ=="], + "@testing-library/dom/pretty-format/react-is": ["react-is@17.0.2", "", {}, "sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w=="], + "@ts-morph/common/minimatch/brace-expansion": ["brace-expansion@2.1.8", "", { "dependencies": { "balanced-match": "^1.0.0" } }, "sha512-BnlDzDYQoplTsZSvPi86CNzmbcb07X8ufR8fk1zivaiEJlXJkiq1MQyDCVmlWcsWbj6aWXqHnrwwevbrm/Saig=="], "@vanilla-extract/babel-plugin-debug-ids/@babel/core/@babel/code-frame": ["@babel/code-frame@7.29.7", "", { "dependencies": { "@babel/helper-validator-identifier": "^7.29.7", "js-tokens": "^4.0.0", "picocolors": "^1.1.1" } }, "sha512-Aup7aUOfpbAUg2ROOJN6Iw5f9DMBlzu0mIkm/malLQFN/YQgO48wCj0Kxa3sEHJvPVFg7siR+qRInwXd2qhQKw=="], @@ -5474,7 +6357,17 @@ "babel-plugin-polyfill-regenerator/@babel/core/semver": ["semver@6.3.2", "", { "bin": { "semver": "bin/semver.js" } }, "sha512-GYrCADwpu6yV5OAvchkQ27Z5wwMxWAEMg5NNWjyHh/5DboFFqbdbvYNIvZouQpxXyeMPoTOh0vdPYKlf0ZswdQ=="], - "cliui/string-width/emoji-regex": ["emoji-regex@8.0.0", "", {}, "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A=="], + "babel-plugin-syntax-hermes-parser/hermes-parser/hermes-estree": ["hermes-estree@0.36.1", "", {}, "sha512-guv1nQ6IJ7S83NRFPWc3SA7IBZrdNC9kapwOq6uXvF4wP+sDCgjzQbKPCoyYmoyZRzztF/n/c36l/rccCZSiCw=="], + + "babel-plugin-transform-flow-enums/@babel/plugin-syntax-flow/@babel/core": ["@babel/core@7.29.13", "", { "dependencies": { "@babel/code-frame": "^7.29.7", "@babel/generator": "^7.29.13", "@babel/helper-compilation-targets": "^7.29.13", "@babel/helper-module-transforms": "^7.29.13", "@babel/helpers": "^7.29.13", "@babel/parser": "^7.29.13", "@babel/template": "^7.29.7", "@babel/traverse": "^7.29.13", "@babel/types": "^7.29.11", "@jridgewell/remapping": "^2.3.5", "convert-source-map": "^2.0.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.2", "json5": "^2.2.3", "semver": "^6.3.1" } }, "sha512-j1nvOQCZYSgp7HLmisnCXFTpVvFODiijQ9QHkORfGKWH6YDtskTEeCJS7eV545GZ9UBzrq0e2xsOd5QQ5PjIqw=="], + + "babel-plugin-transform-flow-enums/@babel/plugin-syntax-flow/@babel/helper-plugin-utils": ["@babel/helper-plugin-utils@7.29.7", "", {}, "sha512-G7sHYigPY17oO5SYWnfD/0MTBwVR781S/JI643e/JhUYgVgWE/61SoW3NH9KWUKyKq5LVh3npif99Wkt6j86Jw=="], + + "babel-preset-expo/@babel/generator/@babel/parser": ["@babel/parser@7.29.14", "", { "dependencies": { "@babel/types": "^7.29.14" }, "bin": "./bin/babel-parser.js" }, "sha512-VL220vXuyO2z3rNIQwY7ftj9UwpqOt+33sH+sBWkOekbsSR2g7EEMnOx24ZlCH0xOA3DM/33SifVFGbnJD8r/w=="], + + "compression/debug/ms": ["ms@2.0.0", "", {}, "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A=="], + + "connect/debug/ms": ["ms@2.0.0", "", {}, "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A=="], "cosmiconfig/parse-json/@babel/code-frame": ["@babel/code-frame@7.29.7", "", { "dependencies": { "@babel/helper-validator-identifier": "^7.29.7", "js-tokens": "^4.0.0", "picocolors": "^1.1.1" } }, "sha512-Aup7aUOfpbAUg2ROOJN6Iw5f9DMBlzu0mIkm/malLQFN/YQgO48wCj0Kxa3sEHJvPVFg7siR+qRInwXd2qhQKw=="], @@ -5496,8 +6389,112 @@ "eslint-plugin-react-hooks/@babel/core/semver": ["semver@6.3.2", "", { "bin": { "semver": "bin/semver.js" } }, "sha512-GYrCADwpu6yV5OAvchkQ27Z5wwMxWAEMg5NNWjyHh/5DboFFqbdbvYNIvZouQpxXyeMPoTOh0vdPYKlf0ZswdQ=="], + "finalhandler/debug/ms": ["ms@2.0.0", "", {}, "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A=="], + + "log-symbols/chalk/ansi-styles": ["ansi-styles@3.2.1", "", { "dependencies": { "color-convert": "^1.9.0" } }, "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA=="], + + "log-symbols/chalk/escape-string-regexp": ["escape-string-regexp@1.0.5", "", {}, "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg=="], + + "log-symbols/chalk/supports-color": ["supports-color@5.5.0", "", { "dependencies": { "has-flag": "^3.0.0" } }, "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow=="], + + "metro-babel-transformer/@babel/core/@babel/code-frame": ["@babel/code-frame@7.29.7", "", { "dependencies": { "@babel/helper-validator-identifier": "^7.29.7", "js-tokens": "^4.0.0", "picocolors": "^1.1.1" } }, "sha512-Aup7aUOfpbAUg2ROOJN6Iw5f9DMBlzu0mIkm/malLQFN/YQgO48wCj0Kxa3sEHJvPVFg7siR+qRInwXd2qhQKw=="], + + "metro-babel-transformer/@babel/core/@babel/generator": ["@babel/generator@7.29.14", "", { "dependencies": { "@babel/parser": "^7.29.14", "@babel/types": "^7.29.14", "@jridgewell/gen-mapping": "^0.3.12", "@jridgewell/trace-mapping": "^0.3.28", "jsesc": "^3.0.2" } }, "sha512-qSY56jgW5JnSXzuekLVil6zaOQxOCtOHidr65KkaMBw772IuAY28Qx4ZykAcDn8+FRF15qk80XzKwgSc/RYW6g=="], + + "metro-babel-transformer/@babel/core/@babel/helper-compilation-targets": ["@babel/helper-compilation-targets@7.29.13", "", { "dependencies": { "@babel/compat-data": "^7.29.7", "@babel/helper-validator-option": "^7.29.7", "browserslist": "^4.24.0", "lru-cache": "^5.1.1", "semver": "^6.3.1" } }, "sha512-8WxJ4/Vmes3ghacj8VOJy3NW8eyHiFY/4thU/LSBuBE470+igjR/j1ZTNn8fV5VdNrLx6iXUwig526UdOvfP0w=="], + + "metro-babel-transformer/@babel/core/@babel/helper-module-transforms": ["@babel/helper-module-transforms@7.29.14", "", { "dependencies": { "@babel/helper-module-imports": "^7.29.7", "@babel/helper-validator-identifier": "^7.29.7", "@babel/traverse": "^7.29.14" }, "peerDependencies": { "@babel/core": "^7.0.0" } }, "sha512-2XDvQVd9JESaOgGc4jT2/jquTAO7ppA5noTZQqH+MmZ89yjCzScLwtCPbWtkPZylL+TLWR49IwWmk+QkRR4GsA=="], + + "metro-babel-transformer/@babel/core/@babel/helpers": ["@babel/helpers@7.29.14", "", { "dependencies": { "@babel/template": "^7.29.7", "@babel/types": "^7.29.14" } }, "sha512-6E3Mi1r0B0umq6vmZa4/78q+64fqO2YY0THUdjDPKUCKhNb0yQy5NQIaPHCSD3ryTgiTss//P4JsWS80AsZ6LQ=="], + + "metro-babel-transformer/@babel/core/@babel/parser": ["@babel/parser@7.29.14", "", { "dependencies": { "@babel/types": "^7.29.14" }, "bin": "./bin/babel-parser.js" }, "sha512-VL220vXuyO2z3rNIQwY7ftj9UwpqOt+33sH+sBWkOekbsSR2g7EEMnOx24ZlCH0xOA3DM/33SifVFGbnJD8r/w=="], + + "metro-babel-transformer/@babel/core/@babel/template": ["@babel/template@7.29.7", "", { "dependencies": { "@babel/code-frame": "^7.29.7", "@babel/parser": "^7.29.7", "@babel/types": "^7.29.7" } }, "sha512-puq+Gf35oI24FeN11LkoUQFqv9uwNeWpxXZi/Ji3rRIoKAzKnxRaZ+Gkj0vKS9ZCiTESfng1N9LyOyXvo+m+Gg=="], + + "metro-babel-transformer/@babel/core/semver": ["semver@6.3.2", "", { "bin": { "semver": "bin/semver.js" } }, "sha512-GYrCADwpu6yV5OAvchkQ27Z5wwMxWAEMg5NNWjyHh/5DboFFqbdbvYNIvZouQpxXyeMPoTOh0vdPYKlf0ZswdQ=="], + + "metro-babel-transformer/flow-parser/flow-estree": ["flow-estree@0.331.0", "", {}, "sha512-FVLYkSL/ITb/QXBEQvNWPjPooRGswuUtGOwrH+puSlMDneNkxy640+FZsk/TfKL+b7Wbw/Fg9FTUv2bMQDpj2w=="], + + "metro-file-map/jest-worker/supports-color": ["supports-color@8.1.1", "", { "dependencies": { "has-flag": "^4.0.0" } }, "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q=="], + + "metro-source-map/@babel/core/@babel/code-frame": ["@babel/code-frame@7.29.7", "", { "dependencies": { "@babel/helper-validator-identifier": "^7.29.7", "js-tokens": "^4.0.0", "picocolors": "^1.1.1" } }, "sha512-Aup7aUOfpbAUg2ROOJN6Iw5f9DMBlzu0mIkm/malLQFN/YQgO48wCj0Kxa3sEHJvPVFg7siR+qRInwXd2qhQKw=="], + + "metro-source-map/@babel/core/@babel/generator": ["@babel/generator@7.29.14", "", { "dependencies": { "@babel/parser": "^7.29.14", "@babel/types": "^7.29.14", "@jridgewell/gen-mapping": "^0.3.12", "@jridgewell/trace-mapping": "^0.3.28", "jsesc": "^3.0.2" } }, "sha512-qSY56jgW5JnSXzuekLVil6zaOQxOCtOHidr65KkaMBw772IuAY28Qx4ZykAcDn8+FRF15qk80XzKwgSc/RYW6g=="], + + "metro-source-map/@babel/core/@babel/helper-compilation-targets": ["@babel/helper-compilation-targets@7.29.13", "", { "dependencies": { "@babel/compat-data": "^7.29.7", "@babel/helper-validator-option": "^7.29.7", "browserslist": "^4.24.0", "lru-cache": "^5.1.1", "semver": "^6.3.1" } }, "sha512-8WxJ4/Vmes3ghacj8VOJy3NW8eyHiFY/4thU/LSBuBE470+igjR/j1ZTNn8fV5VdNrLx6iXUwig526UdOvfP0w=="], + + "metro-source-map/@babel/core/@babel/helper-module-transforms": ["@babel/helper-module-transforms@7.29.14", "", { "dependencies": { "@babel/helper-module-imports": "^7.29.7", "@babel/helper-validator-identifier": "^7.29.7", "@babel/traverse": "^7.29.14" }, "peerDependencies": { "@babel/core": "^7.0.0" } }, "sha512-2XDvQVd9JESaOgGc4jT2/jquTAO7ppA5noTZQqH+MmZ89yjCzScLwtCPbWtkPZylL+TLWR49IwWmk+QkRR4GsA=="], + + "metro-source-map/@babel/core/@babel/helpers": ["@babel/helpers@7.29.14", "", { "dependencies": { "@babel/template": "^7.29.7", "@babel/types": "^7.29.14" } }, "sha512-6E3Mi1r0B0umq6vmZa4/78q+64fqO2YY0THUdjDPKUCKhNb0yQy5NQIaPHCSD3ryTgiTss//P4JsWS80AsZ6LQ=="], + + "metro-source-map/@babel/core/@babel/parser": ["@babel/parser@7.29.14", "", { "dependencies": { "@babel/types": "^7.29.14" }, "bin": "./bin/babel-parser.js" }, "sha512-VL220vXuyO2z3rNIQwY7ftj9UwpqOt+33sH+sBWkOekbsSR2g7EEMnOx24ZlCH0xOA3DM/33SifVFGbnJD8r/w=="], + + "metro-source-map/@babel/core/@babel/template": ["@babel/template@7.29.7", "", { "dependencies": { "@babel/code-frame": "^7.29.7", "@babel/parser": "^7.29.7", "@babel/types": "^7.29.7" } }, "sha512-puq+Gf35oI24FeN11LkoUQFqv9uwNeWpxXZi/Ji3rRIoKAzKnxRaZ+Gkj0vKS9ZCiTESfng1N9LyOyXvo+m+Gg=="], + + "metro-source-map/@babel/core/semver": ["semver@6.3.2", "", { "bin": { "semver": "bin/semver.js" } }, "sha512-GYrCADwpu6yV5OAvchkQ27Z5wwMxWAEMg5NNWjyHh/5DboFFqbdbvYNIvZouQpxXyeMPoTOh0vdPYKlf0ZswdQ=="], + + "metro-symbolicate/metro-source-map/ob1": ["ob1@0.87.1", "", { "dependencies": { "flow-enums-runtime": "^0.0.6" } }, "sha512-i8iA8uij0g1YQzS8uOJPSRCgwDjO9warIHUAu1Fqj877Wc3wlfxDYBioYWgKTBF2+URVJttyDWSEpmd99nlvtQ=="], + + "metro-transform-plugins/@babel/core/@babel/code-frame": ["@babel/code-frame@7.29.7", "", { "dependencies": { "@babel/helper-validator-identifier": "^7.29.7", "js-tokens": "^4.0.0", "picocolors": "^1.1.1" } }, "sha512-Aup7aUOfpbAUg2ROOJN6Iw5f9DMBlzu0mIkm/malLQFN/YQgO48wCj0Kxa3sEHJvPVFg7siR+qRInwXd2qhQKw=="], + + "metro-transform-plugins/@babel/core/@babel/helper-compilation-targets": ["@babel/helper-compilation-targets@7.29.13", "", { "dependencies": { "@babel/compat-data": "^7.29.7", "@babel/helper-validator-option": "^7.29.7", "browserslist": "^4.24.0", "lru-cache": "^5.1.1", "semver": "^6.3.1" } }, "sha512-8WxJ4/Vmes3ghacj8VOJy3NW8eyHiFY/4thU/LSBuBE470+igjR/j1ZTNn8fV5VdNrLx6iXUwig526UdOvfP0w=="], + + "metro-transform-plugins/@babel/core/@babel/helper-module-transforms": ["@babel/helper-module-transforms@7.29.14", "", { "dependencies": { "@babel/helper-module-imports": "^7.29.7", "@babel/helper-validator-identifier": "^7.29.7", "@babel/traverse": "^7.29.14" }, "peerDependencies": { "@babel/core": "^7.0.0" } }, "sha512-2XDvQVd9JESaOgGc4jT2/jquTAO7ppA5noTZQqH+MmZ89yjCzScLwtCPbWtkPZylL+TLWR49IwWmk+QkRR4GsA=="], + + "metro-transform-plugins/@babel/core/@babel/helpers": ["@babel/helpers@7.29.14", "", { "dependencies": { "@babel/template": "^7.29.7", "@babel/types": "^7.29.14" } }, "sha512-6E3Mi1r0B0umq6vmZa4/78q+64fqO2YY0THUdjDPKUCKhNb0yQy5NQIaPHCSD3ryTgiTss//P4JsWS80AsZ6LQ=="], + + "metro-transform-plugins/@babel/core/@babel/parser": ["@babel/parser@7.29.14", "", { "dependencies": { "@babel/types": "^7.29.14" }, "bin": "./bin/babel-parser.js" }, "sha512-VL220vXuyO2z3rNIQwY7ftj9UwpqOt+33sH+sBWkOekbsSR2g7EEMnOx24ZlCH0xOA3DM/33SifVFGbnJD8r/w=="], + + "metro-transform-plugins/@babel/core/semver": ["semver@6.3.2", "", { "bin": { "semver": "bin/semver.js" } }, "sha512-GYrCADwpu6yV5OAvchkQ27Z5wwMxWAEMg5NNWjyHh/5DboFFqbdbvYNIvZouQpxXyeMPoTOh0vdPYKlf0ZswdQ=="], + + "metro-transform-plugins/@babel/generator/@babel/parser": ["@babel/parser@7.29.14", "", { "dependencies": { "@babel/types": "^7.29.14" }, "bin": "./bin/babel-parser.js" }, "sha512-VL220vXuyO2z3rNIQwY7ftj9UwpqOt+33sH+sBWkOekbsSR2g7EEMnOx24ZlCH0xOA3DM/33SifVFGbnJD8r/w=="], + + "metro-transform-plugins/@babel/template/@babel/code-frame": ["@babel/code-frame@7.29.7", "", { "dependencies": { "@babel/helper-validator-identifier": "^7.29.7", "js-tokens": "^4.0.0", "picocolors": "^1.1.1" } }, "sha512-Aup7aUOfpbAUg2ROOJN6Iw5f9DMBlzu0mIkm/malLQFN/YQgO48wCj0Kxa3sEHJvPVFg7siR+qRInwXd2qhQKw=="], + + "metro-transform-plugins/@babel/template/@babel/parser": ["@babel/parser@7.29.14", "", { "dependencies": { "@babel/types": "^7.29.14" }, "bin": "./bin/babel-parser.js" }, "sha512-VL220vXuyO2z3rNIQwY7ftj9UwpqOt+33sH+sBWkOekbsSR2g7EEMnOx24ZlCH0xOA3DM/33SifVFGbnJD8r/w=="], + + "metro-transform-worker/@babel/core/@babel/code-frame": ["@babel/code-frame@7.29.7", "", { "dependencies": { "@babel/helper-validator-identifier": "^7.29.7", "js-tokens": "^4.0.0", "picocolors": "^1.1.1" } }, "sha512-Aup7aUOfpbAUg2ROOJN6Iw5f9DMBlzu0mIkm/malLQFN/YQgO48wCj0Kxa3sEHJvPVFg7siR+qRInwXd2qhQKw=="], + + "metro-transform-worker/@babel/core/@babel/helper-compilation-targets": ["@babel/helper-compilation-targets@7.29.13", "", { "dependencies": { "@babel/compat-data": "^7.29.7", "@babel/helper-validator-option": "^7.29.7", "browserslist": "^4.24.0", "lru-cache": "^5.1.1", "semver": "^6.3.1" } }, "sha512-8WxJ4/Vmes3ghacj8VOJy3NW8eyHiFY/4thU/LSBuBE470+igjR/j1ZTNn8fV5VdNrLx6iXUwig526UdOvfP0w=="], + + "metro-transform-worker/@babel/core/@babel/helper-module-transforms": ["@babel/helper-module-transforms@7.29.14", "", { "dependencies": { "@babel/helper-module-imports": "^7.29.7", "@babel/helper-validator-identifier": "^7.29.7", "@babel/traverse": "^7.29.14" }, "peerDependencies": { "@babel/core": "^7.0.0" } }, "sha512-2XDvQVd9JESaOgGc4jT2/jquTAO7ppA5noTZQqH+MmZ89yjCzScLwtCPbWtkPZylL+TLWR49IwWmk+QkRR4GsA=="], + + "metro-transform-worker/@babel/core/@babel/helpers": ["@babel/helpers@7.29.14", "", { "dependencies": { "@babel/template": "^7.29.7", "@babel/types": "^7.29.14" } }, "sha512-6E3Mi1r0B0umq6vmZa4/78q+64fqO2YY0THUdjDPKUCKhNb0yQy5NQIaPHCSD3ryTgiTss//P4JsWS80AsZ6LQ=="], + + "metro-transform-worker/@babel/core/@babel/template": ["@babel/template@7.29.7", "", { "dependencies": { "@babel/code-frame": "^7.29.7", "@babel/parser": "^7.29.7", "@babel/types": "^7.29.7" } }, "sha512-puq+Gf35oI24FeN11LkoUQFqv9uwNeWpxXZi/Ji3rRIoKAzKnxRaZ+Gkj0vKS9ZCiTESfng1N9LyOyXvo+m+Gg=="], + + "metro-transform-worker/@babel/core/semver": ["semver@6.3.2", "", { "bin": { "semver": "bin/semver.js" } }, "sha512-GYrCADwpu6yV5OAvchkQ27Z5wwMxWAEMg5NNWjyHh/5DboFFqbdbvYNIvZouQpxXyeMPoTOh0vdPYKlf0ZswdQ=="], + + "metro-transform-worker/metro-source-map/ob1": ["ob1@0.87.1", "", { "dependencies": { "flow-enums-runtime": "^0.0.6" } }, "sha512-i8iA8uij0g1YQzS8uOJPSRCgwDjO9warIHUAu1Fqj877Wc3wlfxDYBioYWgKTBF2+URVJttyDWSEpmd99nlvtQ=="], + + "metro-transform-worker/metro-source-map/source-map": ["source-map@0.5.7", "", {}, "sha512-LbrmJOMUSdEVxIKvdcJzQC+nQhe8FUZQTXQy6+I75skNgn3OoQ0DZA8YnFa7gp8tqtL3KPf1kmo0R5DoApeSGQ=="], + + "metro/@babel/code-frame/js-tokens": ["js-tokens@4.0.0", "", {}, "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ=="], + + "metro/@babel/core/@babel/helper-compilation-targets": ["@babel/helper-compilation-targets@7.29.13", "", { "dependencies": { "@babel/compat-data": "^7.29.7", "@babel/helper-validator-option": "^7.29.7", "browserslist": "^4.24.0", "lru-cache": "^5.1.1", "semver": "^6.3.1" } }, "sha512-8WxJ4/Vmes3ghacj8VOJy3NW8eyHiFY/4thU/LSBuBE470+igjR/j1ZTNn8fV5VdNrLx6iXUwig526UdOvfP0w=="], + + "metro/@babel/core/@babel/helper-module-transforms": ["@babel/helper-module-transforms@7.29.14", "", { "dependencies": { "@babel/helper-module-imports": "^7.29.7", "@babel/helper-validator-identifier": "^7.29.7", "@babel/traverse": "^7.29.14" }, "peerDependencies": { "@babel/core": "^7.0.0" } }, "sha512-2XDvQVd9JESaOgGc4jT2/jquTAO7ppA5noTZQqH+MmZ89yjCzScLwtCPbWtkPZylL+TLWR49IwWmk+QkRR4GsA=="], + + "metro/@babel/core/@babel/helpers": ["@babel/helpers@7.29.14", "", { "dependencies": { "@babel/template": "^7.29.7", "@babel/types": "^7.29.14" } }, "sha512-6E3Mi1r0B0umq6vmZa4/78q+64fqO2YY0THUdjDPKUCKhNb0yQy5NQIaPHCSD3ryTgiTss//P4JsWS80AsZ6LQ=="], + + "metro/@babel/core/semver": ["semver@6.3.2", "", { "bin": { "semver": "bin/semver.js" } }, "sha512-GYrCADwpu6yV5OAvchkQ27Z5wwMxWAEMg5NNWjyHh/5DboFFqbdbvYNIvZouQpxXyeMPoTOh0vdPYKlf0ZswdQ=="], + + "metro/flow-parser/flow-estree": ["flow-estree@0.331.0", "", {}, "sha512-FVLYkSL/ITb/QXBEQvNWPjPooRGswuUtGOwrH+puSlMDneNkxy640+FZsk/TfKL+b7Wbw/Fg9FTUv2bMQDpj2w=="], + + "metro/jest-worker/supports-color": ["supports-color@8.1.1", "", { "dependencies": { "has-flag": "^4.0.0" } }, "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q=="], + + "metro/metro-source-map/ob1": ["ob1@0.87.1", "", { "dependencies": { "flow-enums-runtime": "^0.0.6" } }, "sha512-i8iA8uij0g1YQzS8uOJPSRCgwDjO9warIHUAu1Fqj877Wc3wlfxDYBioYWgKTBF2+URVJttyDWSEpmd99nlvtQ=="], + "mlly/pkg-types/confbox": ["confbox@0.1.8", "", {}, "sha512-RMtmw0iFkeR4YV+fUOSucriAQNb9g8zFR52MWCtl+cCZOFRNL6zeB395vPzFhEjjn4fMxXudmELnl/KF/WrK6w=="], + "noxcturnal/@babel/code-frame/js-tokens": ["js-tokens@4.0.0", "", {}, "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ=="], + + "ora/chalk/ansi-styles": ["ansi-styles@3.2.1", "", { "dependencies": { "color-convert": "^1.9.0" } }, "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA=="], + + "ora/chalk/escape-string-regexp": ["escape-string-regexp@1.0.5", "", {}, "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg=="], + + "ora/chalk/supports-color": ["supports-color@5.5.0", "", { "dependencies": { "has-flag": "^3.0.0" } }, "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow=="], + "parse-json/@babel/code-frame/js-tokens": ["js-tokens@4.0.0", "", {}, "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ=="], "pkg-dir/find-up/locate-path": ["locate-path@7.2.0", "", { "dependencies": { "p-locate": "^6.0.0" } }, "sha512-gvVijfZvn7R+2qyPX8mAuKcFGDf6Nc61GdvGafQsHL0sBIxfKzA+usWn4GFC/bk+QdwPUD4kWFJLhElipq+0VA=="], @@ -5524,25 +6521,29 @@ "schema-utils/ajv/json-schema-traverse": ["json-schema-traverse@1.0.0", "", {}, "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug=="], + "send/debug/ms": ["ms@2.0.0", "", {}, "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A=="], + "style-to-js/style-to-object/inline-style-parser": ["inline-style-parser@0.2.7", "", {}, "sha512-Nb2ctOyNR8DqQoR0OwRG95uNWIC0C1lCgf5Naz5H6Ji72KZ8OcFZLz2P5sNgwlyoJ8Yif11oMuYs5pBQa86csA=="], "ts_dependency_graph/glob/minimatch": ["minimatch@3.1.5", "", { "dependencies": { "brace-expansion": "^1.1.7" } }, "sha512-VgjWUsnnT6n+NUk6eZq77zeFdpW2LWDzP6zFGrCbHXiYNul5Dzqk2HHQ5uFH2DNW5Xbp8+jVzaeNt94ssEEl4w=="], - "unified-engine/@types/node/undici-types": ["undici-types@6.21.0", "", {}, "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ=="], + "ts_dependency_graph/yargs/cliui": ["cliui@6.0.0", "", { "dependencies": { "string-width": "^4.2.0", "strip-ansi": "^6.0.0", "wrap-ansi": "^6.2.0" } }, "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ=="], - "unified-engine/glob/minimatch": ["minimatch@9.0.9", "", { "dependencies": { "brace-expansion": "^2.0.2" } }, "sha512-OBwBN9AL4dqmETlpS2zasx+vTeWclWzkblfZk7KTA5j3jeOONz/tRCnZomUyvNg83wL5Zv9Ss6HMJXAgL8R2Yg=="], + "ts_dependency_graph/yargs/find-up": ["find-up@4.1.0", "", { "dependencies": { "locate-path": "^5.0.0", "path-exists": "^4.0.0" } }, "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw=="], - "unified-engine/glob/path-scurry": ["path-scurry@1.11.1", "", { "dependencies": { "lru-cache": "^10.2.0", "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" } }, "sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA=="], + "ts_dependency_graph/yargs/y18n": ["y18n@4.0.3", "", {}, "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ=="], - "wrap-ansi-cjs/string-width/emoji-regex": ["emoji-regex@8.0.0", "", {}, "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A=="], + "ts_dependency_graph/yargs/yargs-parser": ["yargs-parser@18.1.3", "", { "dependencies": { "camelcase": "^5.0.0", "decamelize": "^1.2.0" } }, "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ=="], - "wrap-ansi/string-width/emoji-regex": ["emoji-regex@8.0.0", "", {}, "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A=="], + "unified-engine/@types/node/undici-types": ["undici-types@6.21.0", "", {}, "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ=="], - "yargs/find-up/locate-path": ["locate-path@5.0.0", "", { "dependencies": { "p-locate": "^4.1.0" } }, "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g=="], + "unified-engine/glob/minimatch": ["minimatch@9.0.9", "", { "dependencies": { "brace-expansion": "^2.0.2" } }, "sha512-OBwBN9AL4dqmETlpS2zasx+vTeWclWzkblfZk7KTA5j3jeOONz/tRCnZomUyvNg83wL5Zv9Ss6HMJXAgL8R2Yg=="], + + "unified-engine/glob/path-scurry": ["path-scurry@1.11.1", "", { "dependencies": { "lru-cache": "^10.2.0", "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" } }, "sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA=="], - "yargs/string-width/emoji-regex": ["emoji-regex@8.0.0", "", {}, "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A=="], + "vfile-reporter/string-width/emoji-regex": ["emoji-regex@10.6.0", "", {}, "sha512-toUI84YS5YmxW219erniWD0CIVOo46xGKColeNQRgOzDorgBi1v4D71/OFzgD9GO2UGKIv1C3Sp8DAn0+j5w7A=="], - "yargs/string-width/strip-ansi": ["strip-ansi@6.0.1", "", { "dependencies": { "ansi-regex": "^5.0.1" } }, "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A=="], + "vfile-reporter/string-width/strip-ansi": ["strip-ansi@7.2.0", "", { "dependencies": { "ansi-regex": "^6.2.2" } }, "sha512-yDPMNjp4WyfYBkHnjIRLfca1i6KMyGCtsVgoKe/z1+6vukgaENdgGBZt+ZmKPc4gavvEZ5OgHfHdrazhgNyG7w=="], "@babel/helper-create-class-features-plugin/@babel/core/@babel/code-frame/js-tokens": ["js-tokens@4.0.0", "", {}, "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ=="], @@ -5614,12 +6615,42 @@ "@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly/@babel/core/@babel/helper-compilation-targets/lru-cache": ["lru-cache@5.1.1", "", { "dependencies": { "yallist": "^3.0.2" } }, "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w=="], + "@babel/plugin-proposal-decorators/@babel/core/@babel/code-frame/js-tokens": ["js-tokens@4.0.0", "", {}, "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ=="], + + "@babel/plugin-proposal-decorators/@babel/core/@babel/helper-compilation-targets/browserslist": ["browserslist@4.29.6", "", { "dependencies": { "baseline-browser-mapping": "^2.11.37", "caniuse-lite": "^1.0.30001826", "electron-to-chromium": "^1.5.486", "node-releases": "^2.0.64", "update-browserslist-db": "^1.4.0" }, "bin": { "browserslist": "cli.js" } }, "sha512-CmVVIQ3RVc5HxYEc9X84GvxK/C8C1wH8TlKAiO7uTxF8PDwt7r8t9Qk3J9NkMOVzX5O/HbLv3yzxZg9HPrnI9w=="], + + "@babel/plugin-proposal-decorators/@babel/core/@babel/helper-compilation-targets/lru-cache": ["lru-cache@5.1.1", "", { "dependencies": { "yallist": "^3.0.2" } }, "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w=="], + + "@babel/plugin-proposal-export-default-from/@babel/core/@babel/code-frame/js-tokens": ["js-tokens@4.0.0", "", {}, "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ=="], + + "@babel/plugin-proposal-export-default-from/@babel/core/@babel/helper-compilation-targets/browserslist": ["browserslist@4.29.6", "", { "dependencies": { "baseline-browser-mapping": "^2.11.37", "caniuse-lite": "^1.0.30001826", "electron-to-chromium": "^1.5.486", "node-releases": "^2.0.64", "update-browserslist-db": "^1.4.0" }, "bin": { "browserslist": "cli.js" } }, "sha512-CmVVIQ3RVc5HxYEc9X84GvxK/C8C1wH8TlKAiO7uTxF8PDwt7r8t9Qk3J9NkMOVzX5O/HbLv3yzxZg9HPrnI9w=="], + + "@babel/plugin-proposal-export-default-from/@babel/core/@babel/helper-compilation-targets/lru-cache": ["lru-cache@5.1.1", "", { "dependencies": { "yallist": "^3.0.2" } }, "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w=="], + "@babel/plugin-proposal-private-property-in-object/@babel/core/@babel/code-frame/js-tokens": ["js-tokens@4.0.0", "", {}, "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ=="], "@babel/plugin-proposal-private-property-in-object/@babel/core/@babel/helper-compilation-targets/browserslist": ["browserslist@4.29.6", "", { "dependencies": { "baseline-browser-mapping": "^2.11.37", "caniuse-lite": "^1.0.30001826", "electron-to-chromium": "^1.5.486", "node-releases": "^2.0.64", "update-browserslist-db": "^1.4.0" }, "bin": { "browserslist": "cli.js" } }, "sha512-CmVVIQ3RVc5HxYEc9X84GvxK/C8C1wH8TlKAiO7uTxF8PDwt7r8t9Qk3J9NkMOVzX5O/HbLv3yzxZg9HPrnI9w=="], "@babel/plugin-proposal-private-property-in-object/@babel/core/@babel/helper-compilation-targets/lru-cache": ["lru-cache@5.1.1", "", { "dependencies": { "yallist": "^3.0.2" } }, "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w=="], + "@babel/plugin-syntax-decorators/@babel/core/@babel/code-frame/js-tokens": ["js-tokens@4.0.0", "", {}, "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ=="], + + "@babel/plugin-syntax-decorators/@babel/core/@babel/helper-compilation-targets/browserslist": ["browserslist@4.29.6", "", { "dependencies": { "baseline-browser-mapping": "^2.11.37", "caniuse-lite": "^1.0.30001826", "electron-to-chromium": "^1.5.486", "node-releases": "^2.0.64", "update-browserslist-db": "^1.4.0" }, "bin": { "browserslist": "cli.js" } }, "sha512-CmVVIQ3RVc5HxYEc9X84GvxK/C8C1wH8TlKAiO7uTxF8PDwt7r8t9Qk3J9NkMOVzX5O/HbLv3yzxZg9HPrnI9w=="], + + "@babel/plugin-syntax-decorators/@babel/core/@babel/helper-compilation-targets/lru-cache": ["lru-cache@5.1.1", "", { "dependencies": { "yallist": "^3.0.2" } }, "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w=="], + + "@babel/plugin-syntax-dynamic-import/@babel/core/@babel/code-frame/js-tokens": ["js-tokens@4.0.0", "", {}, "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ=="], + + "@babel/plugin-syntax-dynamic-import/@babel/core/@babel/helper-compilation-targets/browserslist": ["browserslist@4.29.6", "", { "dependencies": { "baseline-browser-mapping": "^2.11.37", "caniuse-lite": "^1.0.30001826", "electron-to-chromium": "^1.5.486", "node-releases": "^2.0.64", "update-browserslist-db": "^1.4.0" }, "bin": { "browserslist": "cli.js" } }, "sha512-CmVVIQ3RVc5HxYEc9X84GvxK/C8C1wH8TlKAiO7uTxF8PDwt7r8t9Qk3J9NkMOVzX5O/HbLv3yzxZg9HPrnI9w=="], + + "@babel/plugin-syntax-dynamic-import/@babel/core/@babel/helper-compilation-targets/lru-cache": ["lru-cache@5.1.1", "", { "dependencies": { "yallist": "^3.0.2" } }, "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w=="], + + "@babel/plugin-syntax-export-default-from/@babel/core/@babel/code-frame/js-tokens": ["js-tokens@4.0.0", "", {}, "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ=="], + + "@babel/plugin-syntax-export-default-from/@babel/core/@babel/helper-compilation-targets/browserslist": ["browserslist@4.29.6", "", { "dependencies": { "baseline-browser-mapping": "^2.11.37", "caniuse-lite": "^1.0.30001826", "electron-to-chromium": "^1.5.486", "node-releases": "^2.0.64", "update-browserslist-db": "^1.4.0" }, "bin": { "browserslist": "cli.js" } }, "sha512-CmVVIQ3RVc5HxYEc9X84GvxK/C8C1wH8TlKAiO7uTxF8PDwt7r8t9Qk3J9NkMOVzX5O/HbLv3yzxZg9HPrnI9w=="], + + "@babel/plugin-syntax-export-default-from/@babel/core/@babel/helper-compilation-targets/lru-cache": ["lru-cache@5.1.1", "", { "dependencies": { "yallist": "^3.0.2" } }, "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w=="], + "@babel/plugin-syntax-import-assertions/@babel/core/@babel/code-frame/js-tokens": ["js-tokens@4.0.0", "", {}, "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ=="], "@babel/plugin-syntax-import-assertions/@babel/core/@babel/helper-compilation-targets/browserslist": ["browserslist@4.29.6", "", { "dependencies": { "baseline-browser-mapping": "^2.11.37", "caniuse-lite": "^1.0.30001826", "electron-to-chromium": "^1.5.486", "node-releases": "^2.0.64", "update-browserslist-db": "^1.4.0" }, "bin": { "browserslist": "cli.js" } }, "sha512-CmVVIQ3RVc5HxYEc9X84GvxK/C8C1wH8TlKAiO7uTxF8PDwt7r8t9Qk3J9NkMOVzX5O/HbLv3yzxZg9HPrnI9w=="], @@ -5632,6 +6663,18 @@ "@babel/plugin-syntax-import-attributes/@babel/core/@babel/helper-compilation-targets/lru-cache": ["lru-cache@5.1.1", "", { "dependencies": { "yallist": "^3.0.2" } }, "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w=="], + "@babel/plugin-syntax-nullish-coalescing-operator/@babel/core/@babel/code-frame/js-tokens": ["js-tokens@4.0.0", "", {}, "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ=="], + + "@babel/plugin-syntax-nullish-coalescing-operator/@babel/core/@babel/helper-compilation-targets/browserslist": ["browserslist@4.29.6", "", { "dependencies": { "baseline-browser-mapping": "^2.11.37", "caniuse-lite": "^1.0.30001826", "electron-to-chromium": "^1.5.486", "node-releases": "^2.0.64", "update-browserslist-db": "^1.4.0" }, "bin": { "browserslist": "cli.js" } }, "sha512-CmVVIQ3RVc5HxYEc9X84GvxK/C8C1wH8TlKAiO7uTxF8PDwt7r8t9Qk3J9NkMOVzX5O/HbLv3yzxZg9HPrnI9w=="], + + "@babel/plugin-syntax-nullish-coalescing-operator/@babel/core/@babel/helper-compilation-targets/lru-cache": ["lru-cache@5.1.1", "", { "dependencies": { "yallist": "^3.0.2" } }, "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w=="], + + "@babel/plugin-syntax-optional-chaining/@babel/core/@babel/code-frame/js-tokens": ["js-tokens@4.0.0", "", {}, "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ=="], + + "@babel/plugin-syntax-optional-chaining/@babel/core/@babel/helper-compilation-targets/browserslist": ["browserslist@4.29.6", "", { "dependencies": { "baseline-browser-mapping": "^2.11.37", "caniuse-lite": "^1.0.30001826", "electron-to-chromium": "^1.5.486", "node-releases": "^2.0.64", "update-browserslist-db": "^1.4.0" }, "bin": { "browserslist": "cli.js" } }, "sha512-CmVVIQ3RVc5HxYEc9X84GvxK/C8C1wH8TlKAiO7uTxF8PDwt7r8t9Qk3J9NkMOVzX5O/HbLv3yzxZg9HPrnI9w=="], + + "@babel/plugin-syntax-optional-chaining/@babel/core/@babel/helper-compilation-targets/lru-cache": ["lru-cache@5.1.1", "", { "dependencies": { "yallist": "^3.0.2" } }, "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w=="], + "@babel/plugin-syntax-unicode-sets-regex/@babel/core/@babel/code-frame/js-tokens": ["js-tokens@4.0.0", "", {}, "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ=="], "@babel/plugin-syntax-unicode-sets-regex/@babel/core/@babel/helper-compilation-targets/browserslist": ["browserslist@4.29.6", "", { "dependencies": { "baseline-browser-mapping": "^2.11.37", "caniuse-lite": "^1.0.30001826", "electron-to-chromium": "^1.5.486", "node-releases": "^2.0.64", "update-browserslist-db": "^1.4.0" }, "bin": { "browserslist": "cli.js" } }, "sha512-CmVVIQ3RVc5HxYEc9X84GvxK/C8C1wH8TlKAiO7uTxF8PDwt7r8t9Qk3J9NkMOVzX5O/HbLv3yzxZg9HPrnI9w=="], @@ -5738,6 +6781,12 @@ "@babel/plugin-transform-export-namespace-from/@babel/core/@babel/helper-compilation-targets/lru-cache": ["lru-cache@5.1.1", "", { "dependencies": { "yallist": "^3.0.2" } }, "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w=="], + "@babel/plugin-transform-flow-strip-types/@babel/core/@babel/code-frame/js-tokens": ["js-tokens@4.0.0", "", {}, "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ=="], + + "@babel/plugin-transform-flow-strip-types/@babel/core/@babel/helper-compilation-targets/browserslist": ["browserslist@4.29.6", "", { "dependencies": { "baseline-browser-mapping": "^2.11.37", "caniuse-lite": "^1.0.30001826", "electron-to-chromium": "^1.5.486", "node-releases": "^2.0.64", "update-browserslist-db": "^1.4.0" }, "bin": { "browserslist": "cli.js" } }, "sha512-CmVVIQ3RVc5HxYEc9X84GvxK/C8C1wH8TlKAiO7uTxF8PDwt7r8t9Qk3J9NkMOVzX5O/HbLv3yzxZg9HPrnI9w=="], + + "@babel/plugin-transform-flow-strip-types/@babel/core/@babel/helper-compilation-targets/lru-cache": ["lru-cache@5.1.1", "", { "dependencies": { "yallist": "^3.0.2" } }, "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w=="], + "@babel/plugin-transform-for-of/@babel/core/@babel/code-frame/js-tokens": ["js-tokens@4.0.0", "", {}, "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ=="], "@babel/plugin-transform-for-of/@babel/core/@babel/helper-compilation-targets/browserslist": ["browserslist@4.29.6", "", { "dependencies": { "baseline-browser-mapping": "^2.11.37", "caniuse-lite": "^1.0.30001826", "electron-to-chromium": "^1.5.486", "node-releases": "^2.0.64", "update-browserslist-db": "^1.4.0" }, "bin": { "browserslist": "cli.js" } }, "sha512-CmVVIQ3RVc5HxYEc9X84GvxK/C8C1wH8TlKAiO7uTxF8PDwt7r8t9Qk3J9NkMOVzX5O/HbLv3yzxZg9HPrnI9w=="], @@ -5904,6 +6953,14 @@ "@babel/plugin-transform-reserved-words/@babel/core/@babel/helper-compilation-targets/lru-cache": ["lru-cache@5.1.1", "", { "dependencies": { "yallist": "^3.0.2" } }, "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w=="], + "@babel/plugin-transform-runtime/@babel/core/@babel/code-frame/js-tokens": ["js-tokens@4.0.0", "", {}, "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ=="], + + "@babel/plugin-transform-runtime/@babel/core/@babel/helper-compilation-targets/browserslist": ["browserslist@4.29.6", "", { "dependencies": { "baseline-browser-mapping": "^2.11.37", "caniuse-lite": "^1.0.30001826", "electron-to-chromium": "^1.5.486", "node-releases": "^2.0.64", "update-browserslist-db": "^1.4.0" }, "bin": { "browserslist": "cli.js" } }, "sha512-CmVVIQ3RVc5HxYEc9X84GvxK/C8C1wH8TlKAiO7uTxF8PDwt7r8t9Qk3J9NkMOVzX5O/HbLv3yzxZg9HPrnI9w=="], + + "@babel/plugin-transform-runtime/@babel/core/@babel/helper-compilation-targets/lru-cache": ["lru-cache@5.1.1", "", { "dependencies": { "yallist": "^3.0.2" } }, "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w=="], + + "@babel/plugin-transform-runtime/babel-plugin-polyfill-corejs3/@babel/helper-define-polyfill-provider/@babel/helper-compilation-targets": ["@babel/helper-compilation-targets@7.29.13", "", { "dependencies": { "@babel/compat-data": "^7.29.7", "@babel/helper-validator-option": "^7.29.7", "browserslist": "^4.24.0", "lru-cache": "^5.1.1", "semver": "^6.3.1" } }, "sha512-8WxJ4/Vmes3ghacj8VOJy3NW8eyHiFY/4thU/LSBuBE470+igjR/j1ZTNn8fV5VdNrLx6iXUwig526UdOvfP0w=="], + "@babel/plugin-transform-shorthand-properties/@babel/core/@babel/code-frame/js-tokens": ["js-tokens@4.0.0", "", {}, "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ=="], "@babel/plugin-transform-shorthand-properties/@babel/core/@babel/helper-compilation-targets/browserslist": ["browserslist@4.29.6", "", { "dependencies": { "baseline-browser-mapping": "^2.11.37", "caniuse-lite": "^1.0.30001826", "electron-to-chromium": "^1.5.486", "node-releases": "^2.0.64", "update-browserslist-db": "^1.4.0" }, "bin": { "browserslist": "cli.js" } }, "sha512-CmVVIQ3RVc5HxYEc9X84GvxK/C8C1wH8TlKAiO7uTxF8PDwt7r8t9Qk3J9NkMOVzX5O/HbLv3yzxZg9HPrnI9w=="], @@ -6000,6 +7057,12 @@ "@devup-ui/eslint-plugin/typescript-eslint/@typescript-eslint/typescript-estree/@typescript-eslint/tsconfig-utils": ["@typescript-eslint/tsconfig-utils@8.73.0", "", { "peerDependencies": { "typescript": ">=4.8.4 <6.1.0" } }, "sha512-lmtCFOfYaJfpqZywGuXi4FpNtE+NQ+YLe3T0K9rtEDcW8ZuGWvfI++pj8r05sYMI8vWT2CYK4rWyedmD6Rp4og=="], + "@expo/metro-config/@babel/core/@babel/helper-compilation-targets/lru-cache": ["lru-cache@5.1.1", "", { "dependencies": { "yallist": "^3.0.2" } }, "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w=="], + + "@expo/require-utils/@babel/core/@babel/helper-compilation-targets/browserslist": ["browserslist@4.29.6", "", { "dependencies": { "baseline-browser-mapping": "^2.11.37", "caniuse-lite": "^1.0.30001826", "electron-to-chromium": "^1.5.486", "node-releases": "^2.0.64", "update-browserslist-db": "^1.4.0" }, "bin": { "browserslist": "cli.js" } }, "sha512-CmVVIQ3RVc5HxYEc9X84GvxK/C8C1wH8TlKAiO7uTxF8PDwt7r8t9Qk3J9NkMOVzX5O/HbLv3yzxZg9HPrnI9w=="], + + "@expo/require-utils/@babel/core/@babel/helper-compilation-targets/lru-cache": ["lru-cache@5.1.1", "", { "dependencies": { "yallist": "^3.0.2" } }, "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w=="], + "@joshwooding/vite-plugin-react-docgen-typescript/glob/path-scurry/lru-cache": ["lru-cache@11.5.3", "", {}, "sha512-U4N8FgzmWxc8k1VH8Kr6lQg18U7Fjvby6wXHVRX/ZZ7IwWbRMgrRbP0Wrb5q5NVinryp4SQampHKdvtecItxUg=="], "@kuma-ui/babel-plugin/@babel/core/@babel/code-frame/js-tokens": ["js-tokens@4.0.0", "", {}, "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ=="], @@ -6018,6 +7081,14 @@ "@npmcli/package-json/glob/minimatch/brace-expansion": ["brace-expansion@2.1.8", "", { "dependencies": { "balanced-match": "^1.0.0" } }, "sha512-BnlDzDYQoplTsZSvPi86CNzmbcb07X8ufR8fk1zivaiEJlXJkiq1MQyDCVmlWcsWbj6aWXqHnrwwevbrm/Saig=="], + "@pandacss/cli/string-width/strip-ansi/ansi-regex": ["ansi-regex@6.6.0", "", {}, "sha512-XZ5apbzreCbXSKwPjJstu8R0zOi247w3XYwWxtwBXgpZrCyc1Ka7p9/xY0A9/diMewmHbEKz+FIraWaEWjlN5g=="], + + "@react-native/codegen/@babel/core/@babel/code-frame/js-tokens": ["js-tokens@4.0.0", "", {}, "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ=="], + + "@react-native/codegen/@babel/core/@babel/helper-compilation-targets/browserslist": ["browserslist@4.29.6", "", { "dependencies": { "baseline-browser-mapping": "^2.11.37", "caniuse-lite": "^1.0.30001826", "electron-to-chromium": "^1.5.486", "node-releases": "^2.0.64", "update-browserslist-db": "^1.4.0" }, "bin": { "browserslist": "cli.js" } }, "sha512-CmVVIQ3RVc5HxYEc9X84GvxK/C8C1wH8TlKAiO7uTxF8PDwt7r8t9Qk3J9NkMOVzX5O/HbLv3yzxZg9HPrnI9w=="], + + "@react-native/codegen/@babel/core/@babel/helper-compilation-targets/lru-cache": ["lru-cache@5.1.1", "", { "dependencies": { "yallist": "^3.0.2" } }, "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w=="], + "@stylexjs/babel-plugin/@babel/core/@babel/code-frame/js-tokens": ["js-tokens@4.0.0", "", {}, "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ=="], "@stylexjs/babel-plugin/@babel/core/@babel/helper-compilation-targets/browserslist": ["browserslist@4.29.6", "", { "dependencies": { "baseline-browser-mapping": "^2.11.37", "caniuse-lite": "^1.0.30001826", "electron-to-chromium": "^1.5.486", "node-releases": "^2.0.64", "update-browserslist-db": "^1.4.0" }, "bin": { "browserslist": "cli.js" } }, "sha512-CmVVIQ3RVc5HxYEc9X84GvxK/C8C1wH8TlKAiO7uTxF8PDwt7r8t9Qk3J9NkMOVzX5O/HbLv3yzxZg9HPrnI9w=="], @@ -6074,6 +7145,22 @@ "babel-plugin-polyfill-regenerator/@babel/core/@babel/helper-compilation-targets/lru-cache": ["lru-cache@5.1.1", "", { "dependencies": { "yallist": "^3.0.2" } }, "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w=="], + "babel-plugin-transform-flow-enums/@babel/plugin-syntax-flow/@babel/core/@babel/code-frame": ["@babel/code-frame@7.29.7", "", { "dependencies": { "@babel/helper-validator-identifier": "^7.29.7", "js-tokens": "^4.0.0", "picocolors": "^1.1.1" } }, "sha512-Aup7aUOfpbAUg2ROOJN6Iw5f9DMBlzu0mIkm/malLQFN/YQgO48wCj0Kxa3sEHJvPVFg7siR+qRInwXd2qhQKw=="], + + "babel-plugin-transform-flow-enums/@babel/plugin-syntax-flow/@babel/core/@babel/generator": ["@babel/generator@7.29.14", "", { "dependencies": { "@babel/parser": "^7.29.14", "@babel/types": "^7.29.14", "@jridgewell/gen-mapping": "^0.3.12", "@jridgewell/trace-mapping": "^0.3.28", "jsesc": "^3.0.2" } }, "sha512-qSY56jgW5JnSXzuekLVil6zaOQxOCtOHidr65KkaMBw772IuAY28Qx4ZykAcDn8+FRF15qk80XzKwgSc/RYW6g=="], + + "babel-plugin-transform-flow-enums/@babel/plugin-syntax-flow/@babel/core/@babel/helper-compilation-targets": ["@babel/helper-compilation-targets@7.29.13", "", { "dependencies": { "@babel/compat-data": "^7.29.7", "@babel/helper-validator-option": "^7.29.7", "browserslist": "^4.24.0", "lru-cache": "^5.1.1", "semver": "^6.3.1" } }, "sha512-8WxJ4/Vmes3ghacj8VOJy3NW8eyHiFY/4thU/LSBuBE470+igjR/j1ZTNn8fV5VdNrLx6iXUwig526UdOvfP0w=="], + + "babel-plugin-transform-flow-enums/@babel/plugin-syntax-flow/@babel/core/@babel/helper-module-transforms": ["@babel/helper-module-transforms@7.29.14", "", { "dependencies": { "@babel/helper-module-imports": "^7.29.7", "@babel/helper-validator-identifier": "^7.29.7", "@babel/traverse": "^7.29.14" }, "peerDependencies": { "@babel/core": "^7.0.0" } }, "sha512-2XDvQVd9JESaOgGc4jT2/jquTAO7ppA5noTZQqH+MmZ89yjCzScLwtCPbWtkPZylL+TLWR49IwWmk+QkRR4GsA=="], + + "babel-plugin-transform-flow-enums/@babel/plugin-syntax-flow/@babel/core/@babel/helpers": ["@babel/helpers@7.29.14", "", { "dependencies": { "@babel/template": "^7.29.7", "@babel/types": "^7.29.14" } }, "sha512-6E3Mi1r0B0umq6vmZa4/78q+64fqO2YY0THUdjDPKUCKhNb0yQy5NQIaPHCSD3ryTgiTss//P4JsWS80AsZ6LQ=="], + + "babel-plugin-transform-flow-enums/@babel/plugin-syntax-flow/@babel/core/@babel/parser": ["@babel/parser@7.29.14", "", { "dependencies": { "@babel/types": "^7.29.14" }, "bin": "./bin/babel-parser.js" }, "sha512-VL220vXuyO2z3rNIQwY7ftj9UwpqOt+33sH+sBWkOekbsSR2g7EEMnOx24ZlCH0xOA3DM/33SifVFGbnJD8r/w=="], + + "babel-plugin-transform-flow-enums/@babel/plugin-syntax-flow/@babel/core/@babel/template": ["@babel/template@7.29.7", "", { "dependencies": { "@babel/code-frame": "^7.29.7", "@babel/parser": "^7.29.7", "@babel/types": "^7.29.7" } }, "sha512-puq+Gf35oI24FeN11LkoUQFqv9uwNeWpxXZi/Ji3rRIoKAzKnxRaZ+Gkj0vKS9ZCiTESfng1N9LyOyXvo+m+Gg=="], + + "babel-plugin-transform-flow-enums/@babel/plugin-syntax-flow/@babel/core/semver": ["semver@6.3.2", "", { "bin": { "semver": "bin/semver.js" } }, "sha512-GYrCADwpu6yV5OAvchkQ27Z5wwMxWAEMg5NNWjyHh/5DboFFqbdbvYNIvZouQpxXyeMPoTOh0vdPYKlf0ZswdQ=="], + "cosmiconfig/parse-json/@babel/code-frame/js-tokens": ["js-tokens@4.0.0", "", {}, "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ=="], "eslint-plugin-react-hooks/@babel/core/@babel/code-frame/js-tokens": ["js-tokens@4.0.0", "", {}, "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ=="], @@ -6082,6 +7169,44 @@ "eslint-plugin-react-hooks/@babel/core/@babel/helper-compilation-targets/lru-cache": ["lru-cache@5.1.1", "", { "dependencies": { "yallist": "^3.0.2" } }, "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w=="], + "log-symbols/chalk/ansi-styles/color-convert": ["color-convert@1.9.3", "", { "dependencies": { "color-name": "1.1.3" } }, "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg=="], + + "log-symbols/chalk/supports-color/has-flag": ["has-flag@3.0.0", "", {}, "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw=="], + + "metro-babel-transformer/@babel/core/@babel/code-frame/js-tokens": ["js-tokens@4.0.0", "", {}, "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ=="], + + "metro-babel-transformer/@babel/core/@babel/helper-compilation-targets/browserslist": ["browserslist@4.29.6", "", { "dependencies": { "baseline-browser-mapping": "^2.11.37", "caniuse-lite": "^1.0.30001826", "electron-to-chromium": "^1.5.486", "node-releases": "^2.0.64", "update-browserslist-db": "^1.4.0" }, "bin": { "browserslist": "cli.js" } }, "sha512-CmVVIQ3RVc5HxYEc9X84GvxK/C8C1wH8TlKAiO7uTxF8PDwt7r8t9Qk3J9NkMOVzX5O/HbLv3yzxZg9HPrnI9w=="], + + "metro-babel-transformer/@babel/core/@babel/helper-compilation-targets/lru-cache": ["lru-cache@5.1.1", "", { "dependencies": { "yallist": "^3.0.2" } }, "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w=="], + + "metro-source-map/@babel/core/@babel/code-frame/js-tokens": ["js-tokens@4.0.0", "", {}, "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ=="], + + "metro-source-map/@babel/core/@babel/helper-compilation-targets/browserslist": ["browserslist@4.29.6", "", { "dependencies": { "baseline-browser-mapping": "^2.11.37", "caniuse-lite": "^1.0.30001826", "electron-to-chromium": "^1.5.486", "node-releases": "^2.0.64", "update-browserslist-db": "^1.4.0" }, "bin": { "browserslist": "cli.js" } }, "sha512-CmVVIQ3RVc5HxYEc9X84GvxK/C8C1wH8TlKAiO7uTxF8PDwt7r8t9Qk3J9NkMOVzX5O/HbLv3yzxZg9HPrnI9w=="], + + "metro-source-map/@babel/core/@babel/helper-compilation-targets/lru-cache": ["lru-cache@5.1.1", "", { "dependencies": { "yallist": "^3.0.2" } }, "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w=="], + + "metro-transform-plugins/@babel/core/@babel/code-frame/js-tokens": ["js-tokens@4.0.0", "", {}, "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ=="], + + "metro-transform-plugins/@babel/core/@babel/helper-compilation-targets/browserslist": ["browserslist@4.29.6", "", { "dependencies": { "baseline-browser-mapping": "^2.11.37", "caniuse-lite": "^1.0.30001826", "electron-to-chromium": "^1.5.486", "node-releases": "^2.0.64", "update-browserslist-db": "^1.4.0" }, "bin": { "browserslist": "cli.js" } }, "sha512-CmVVIQ3RVc5HxYEc9X84GvxK/C8C1wH8TlKAiO7uTxF8PDwt7r8t9Qk3J9NkMOVzX5O/HbLv3yzxZg9HPrnI9w=="], + + "metro-transform-plugins/@babel/core/@babel/helper-compilation-targets/lru-cache": ["lru-cache@5.1.1", "", { "dependencies": { "yallist": "^3.0.2" } }, "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w=="], + + "metro-transform-plugins/@babel/template/@babel/code-frame/js-tokens": ["js-tokens@4.0.0", "", {}, "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ=="], + + "metro-transform-worker/@babel/core/@babel/code-frame/js-tokens": ["js-tokens@4.0.0", "", {}, "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ=="], + + "metro-transform-worker/@babel/core/@babel/helper-compilation-targets/browserslist": ["browserslist@4.29.6", "", { "dependencies": { "baseline-browser-mapping": "^2.11.37", "caniuse-lite": "^1.0.30001826", "electron-to-chromium": "^1.5.486", "node-releases": "^2.0.64", "update-browserslist-db": "^1.4.0" }, "bin": { "browserslist": "cli.js" } }, "sha512-CmVVIQ3RVc5HxYEc9X84GvxK/C8C1wH8TlKAiO7uTxF8PDwt7r8t9Qk3J9NkMOVzX5O/HbLv3yzxZg9HPrnI9w=="], + + "metro-transform-worker/@babel/core/@babel/helper-compilation-targets/lru-cache": ["lru-cache@5.1.1", "", { "dependencies": { "yallist": "^3.0.2" } }, "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w=="], + + "metro/@babel/core/@babel/helper-compilation-targets/browserslist": ["browserslist@4.29.6", "", { "dependencies": { "baseline-browser-mapping": "^2.11.37", "caniuse-lite": "^1.0.30001826", "electron-to-chromium": "^1.5.486", "node-releases": "^2.0.64", "update-browserslist-db": "^1.4.0" }, "bin": { "browserslist": "cli.js" } }, "sha512-CmVVIQ3RVc5HxYEc9X84GvxK/C8C1wH8TlKAiO7uTxF8PDwt7r8t9Qk3J9NkMOVzX5O/HbLv3yzxZg9HPrnI9w=="], + + "metro/@babel/core/@babel/helper-compilation-targets/lru-cache": ["lru-cache@5.1.1", "", { "dependencies": { "yallist": "^3.0.2" } }, "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w=="], + + "ora/chalk/ansi-styles/color-convert": ["color-convert@1.9.3", "", { "dependencies": { "color-name": "1.1.3" } }, "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg=="], + + "ora/chalk/supports-color/has-flag": ["has-flag@3.0.0", "", {}, "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw=="], + "pkg-dir/find-up/locate-path/p-locate": ["p-locate@6.0.0", "", { "dependencies": { "p-limit": "^4.0.0" } }, "sha512-wPrq66Llhl7/4AGC6I+cqxT07LhXvWL08LNXz1fENOw0Ap4sRZZ/gZpTTJ5jpurzzzfS2W/Ge9BY3LgLjCShcw=="], "react-docgen/@babel/core/@babel/code-frame/js-tokens": ["js-tokens@4.0.0", "", {}, "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ=="], @@ -6092,20 +7217,44 @@ "ts_dependency_graph/glob/minimatch/brace-expansion": ["brace-expansion@1.1.22", "", { "dependencies": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" } }, "sha512-CKLDTuSsN0+r1ThM0WkzzBI7dnPI6xEGfa/JnVYIK9JNBA1N1NyPwXVHor//NKD/y3sDxp764sZdLhFK7pH8XQ=="], + "ts_dependency_graph/yargs/cliui/strip-ansi": ["strip-ansi@6.0.1", "", { "dependencies": { "ansi-regex": "^5.0.1" } }, "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A=="], + + "ts_dependency_graph/yargs/cliui/wrap-ansi": ["wrap-ansi@6.2.0", "", { "dependencies": { "ansi-styles": "^4.0.0", "string-width": "^4.1.0", "strip-ansi": "^6.0.0" } }, "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA=="], + + "ts_dependency_graph/yargs/find-up/locate-path": ["locate-path@5.0.0", "", { "dependencies": { "p-locate": "^4.1.0" } }, "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g=="], + "unified-engine/glob/minimatch/brace-expansion": ["brace-expansion@2.1.8", "", { "dependencies": { "balanced-match": "^1.0.0" } }, "sha512-BnlDzDYQoplTsZSvPi86CNzmbcb07X8ufR8fk1zivaiEJlXJkiq1MQyDCVmlWcsWbj6aWXqHnrwwevbrm/Saig=="], - "yargs/find-up/locate-path/p-locate": ["p-locate@4.1.0", "", { "dependencies": { "p-limit": "^2.2.0" } }, "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A=="], + "vfile-reporter/string-width/strip-ansi/ansi-regex": ["ansi-regex@6.6.0", "", {}, "sha512-XZ5apbzreCbXSKwPjJstu8R0zOi247w3XYwWxtwBXgpZrCyc1Ka7p9/xY0A9/diMewmHbEKz+FIraWaEWjlN5g=="], + + "@babel/plugin-transform-runtime/babel-plugin-polyfill-corejs3/@babel/helper-define-polyfill-provider/@babel/helper-compilation-targets/browserslist": ["browserslist@4.29.6", "", { "dependencies": { "baseline-browser-mapping": "^2.11.37", "caniuse-lite": "^1.0.30001826", "electron-to-chromium": "^1.5.486", "node-releases": "^2.0.64", "update-browserslist-db": "^1.4.0" }, "bin": { "browserslist": "cli.js" } }, "sha512-CmVVIQ3RVc5HxYEc9X84GvxK/C8C1wH8TlKAiO7uTxF8PDwt7r8t9Qk3J9NkMOVzX5O/HbLv3yzxZg9HPrnI9w=="], + + "@babel/plugin-transform-runtime/babel-plugin-polyfill-corejs3/@babel/helper-define-polyfill-provider/@babel/helper-compilation-targets/lru-cache": ["lru-cache@5.1.1", "", { "dependencies": { "yallist": "^3.0.2" } }, "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w=="], "@npmcli/package-json/glob/minimatch/brace-expansion/balanced-match": ["balanced-match@1.0.2", "", {}, "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw=="], + "babel-plugin-transform-flow-enums/@babel/plugin-syntax-flow/@babel/core/@babel/code-frame/js-tokens": ["js-tokens@4.0.0", "", {}, "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ=="], + + "babel-plugin-transform-flow-enums/@babel/plugin-syntax-flow/@babel/core/@babel/helper-compilation-targets/browserslist": ["browserslist@4.29.6", "", { "dependencies": { "baseline-browser-mapping": "^2.11.37", "caniuse-lite": "^1.0.30001826", "electron-to-chromium": "^1.5.486", "node-releases": "^2.0.64", "update-browserslist-db": "^1.4.0" }, "bin": { "browserslist": "cli.js" } }, "sha512-CmVVIQ3RVc5HxYEc9X84GvxK/C8C1wH8TlKAiO7uTxF8PDwt7r8t9Qk3J9NkMOVzX5O/HbLv3yzxZg9HPrnI9w=="], + + "babel-plugin-transform-flow-enums/@babel/plugin-syntax-flow/@babel/core/@babel/helper-compilation-targets/lru-cache": ["lru-cache@5.1.1", "", { "dependencies": { "yallist": "^3.0.2" } }, "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w=="], + + "log-symbols/chalk/ansi-styles/color-convert/color-name": ["color-name@1.1.3", "", {}, "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw=="], + + "ora/chalk/ansi-styles/color-convert/color-name": ["color-name@1.1.3", "", {}, "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw=="], + "pkg-dir/find-up/locate-path/p-locate/p-limit": ["p-limit@4.0.0", "", { "dependencies": { "yocto-queue": "^1.0.0" } }, "sha512-5b0R4txpzjPWVw/cXXUResoD4hb6U/x9BH08L7nw+GN1sezDzPdxeRvpc9c433fZhBan/wusjbCsqwqm4EIBIQ=="], "ts_dependency_graph/glob/minimatch/brace-expansion/balanced-match": ["balanced-match@1.0.2", "", {}, "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw=="], - "unified-engine/glob/minimatch/brace-expansion/balanced-match": ["balanced-match@1.0.2", "", {}, "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw=="], + "ts_dependency_graph/yargs/cliui/wrap-ansi/ansi-styles": ["ansi-styles@4.3.0", "", { "dependencies": { "color-convert": "^2.0.1" } }, "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg=="], - "yargs/find-up/locate-path/p-locate/p-limit": ["p-limit@2.3.0", "", { "dependencies": { "p-try": "^2.0.0" } }, "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w=="], + "ts_dependency_graph/yargs/find-up/locate-path/p-locate": ["p-locate@4.1.0", "", { "dependencies": { "p-limit": "^2.2.0" } }, "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A=="], + + "unified-engine/glob/minimatch/brace-expansion/balanced-match": ["balanced-match@1.0.2", "", {}, "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw=="], "pkg-dir/find-up/locate-path/p-locate/p-limit/yocto-queue": ["yocto-queue@1.2.2", "", {}, "sha512-4LCcse/U2MHZ63HAJVE+v71o7yOdIe4cZ70Wpf8D/IyjDKYQLV5GD46B+hSTjJsvV5PztjvHoU580EftxjDZFQ=="], + + "ts_dependency_graph/yargs/find-up/locate-path/p-locate/p-limit": ["p-limit@2.3.0", "", { "dependencies": { "p-try": "^2.0.0" } }, "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w=="], } } diff --git a/package.json b/package.json index f509f319b..227f922ab 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,7 @@ "test:wasm-abi": "node --test e2e/binding/wasm-abi/coverage.test.mjs && node e2e/binding/wasm-abi/run.mjs", "test:e2e:ui": "bunx playwright test --ui", "test:e2e:update": "bunx playwright test --update-snapshots", - "build": "node e2e/binding/package/build-host.mjs && bun run --filter @devup-ui/wasm --filter @devup-ui/plugin-utils build && bun run --filter @devup-ui/react --filter @devup-ui/webpack-plugin build && bun run --filter @devup-ui/eslint-plugin --filter @devup-ui/vite-plugin --filter @devup-ui/next-plugin --filter @devup-ui/rsbuild-plugin --filter @devup-ui/bun-plugin --filter @devup-ui/components --filter @devup-ui/reset-css build", + "build": "node e2e/binding/package/build-host.mjs && bun run --filter @devup-ui/wasm --filter @devup-ui/plugin-utils build && bun run --filter @devup-ui/react --filter @devup-ui/webpack-plugin build && bun run --filter @devup-ui/eslint-plugin --filter @devup-ui/vite-plugin --filter @devup-ui/next-plugin --filter @devup-ui/rsbuild-plugin --filter @devup-ui/bun-plugin --filter @devup-ui/metro-plugin --filter @devup-ui/components --filter @devup-ui/reset-css build", "dev": "bun run --filter '*' dev", "verify:dist": "bun verify-dist.ts", "benchmark": "bun benchmark.js", diff --git a/packages/metro-plugin/README.md b/packages/metro-plugin/README.md new file mode 100644 index 000000000..dd54604f6 --- /dev/null +++ b/packages/metro-plugin/README.md @@ -0,0 +1,98 @@ +# @devup-ui/metro-plugin + +> **Experimental (0.x).** React Native support is in progress +> ([#411](https://github.com/dev-five-git/devup-ui/issues/411)). This package +> is not published yet, and its API may change. + +Compiles Devup UI for React Native in [Metro](https://metrobundler.dev/), the +bundler of React Native and Expo. You keep importing `Box`, `Text`, ... from +`@devup-ui/react`; at build time each element becomes a React Native component +and its style props become style objects hoisted into one `StyleSheet.create` +per file. Nothing runs at runtime. + +## Setup + +```js +// metro.config.js (Expo) +const { getDefaultConfig } = require('expo/metro-config') +const { withDevupUI } = require('@devup-ui/metro-plugin') + +module.exports = withDevupUI(getDefaultConfig(__dirname)) +``` + +```js +// metro.config.js (React Native CLI) +const { getDefaultConfig } = require('@react-native/metro-config') +const { withDevupUI } = require('@devup-ui/metro-plugin') + +module.exports = withDevupUI(getDefaultConfig(__dirname)) +``` + +```tsx +import { Box, Flex, Text } from '@devup-ui/react' + +export function Card() { + return ( + + + Hello + + + + ) +} +``` + +`withDevupUI` sets `transformer.babelTransformerPath` to its own transformer. +The transformer compiles each file that imports Devup UI for the platform +Metro builds (`ios`, `android` or `web`) and then hands the code to the +transformer the config had: Expo's, React Native's, or the one you name. + +| Element | React Native | +| --- | --- | +| `Box`, `Flex`, `VStack`, `Center` | `View` (`Flex`, `VStack` and `Center` add their flex styles) | +| `Text` | `Text` | +| `Image` | `Image` (`src` becomes `source`) | +| `Input` | `TextInput` | +| `Button` | `Pressable` | + +`_ios`, `_android` and `_web` apply their styles on that platform only. + +## Options + +```js +withDevupUI(config, { + // The package Devup UI is imported from. Default: '@devup-ui/react' + package: '@devup-ui/react', + // devup.json, from the project root. Default: 'devup.json' + devupFile: 'devup.json', + // Packages in node_modules that ship uncompiled Devup UI. Default: [] + include: [], + // Whether styles that need the React Native runtime may import it. + // Default: true. false is a strict zero-runtime mode. + runtime: true, + // 'native' (default) or 'wasm' + engine: 'native', + // The Babel transformer the compiled code goes to. + // Default: the config's babelTransformerPath, else Expo's, else React Native's. + upstreamTransformer: undefined, +}) +``` + +## Limits of this version + +Only styles the build can decide are supported: literals, values read at +runtime, conditions between them and the platform blocks. These are build +errors, reported by Metro at the file, line and column: + +- responsive arrays (`p={[1, 2]}`), theme tokens (`color="$primary"`), + typography and `_dark`/`_light`/`_theme*` +- interaction states (`_hover`, `_active`, `_pressed`, `_focus`, ...) +- `css()`, `styled()`, `globalCss()`, `keyframes()` and `Grid` +- any prop React Native has no style for + +The runtime that brings responsive values, themes and `_pressed` comes in a +later version. + +Metro reads devup.json when it starts, so restart Metro after changing it +(`--reset-cache` is not needed). diff --git a/packages/metro-plugin/package.json b/packages/metro-plugin/package.json new file mode 100644 index 000000000..53c36eab2 --- /dev/null +++ b/packages/metro-plugin/package.json @@ -0,0 +1,56 @@ +{ + "name": "@devup-ui/metro-plugin", + "description": "Devup UI for React Native: compiles Devup UI to React Native styles in Metro (experimental)", + "repository": "https://github.com/dev-five-git/devup-ui", + "author": "devfive", + "license": "Apache-2.0", + "homepage": "https://devup-ui.com", + "bugs": { + "url": "https://github.com/dev-five-git/devup-ui/issues", + "email": "contact@devfive.kr" + }, + "keywords": [ + "css", + "css-in-js", + "css-in-js-preprocessor", + "react", + "react-native", + "expo", + "metro" + ], + "type": "module", + "version": "0.0.0", + "private": true, + "scripts": { + "lint": "eslint", + "build": "bun ../../node_modules/@typescript/native/bin/tsc && bun build --target node src/index.ts --production --env=disable --outfile dist/index.cjs --format cjs --packages external --define import.meta.url=module.filename && bun build --target node src/index.ts --production --env=disable --outfile dist/index.mjs --format esm --packages external && bun build --target node src/transformer.ts --production --env=disable --outfile dist/transformer.cjs --format cjs --packages external --define import.meta.url=module.filename" + }, + "publishConfig": { + "access": "public" + }, + "engines": { + "node": ">=20" + }, + "main": "./dist/index.cjs", + "module": "./dist/index.mjs", + "types": "./dist/index.d.ts", + "exports": { + ".": { + "types": "./dist/index.d.ts", + "import": "./dist/index.mjs", + "require": "./dist/index.cjs" + }, + "./transformer": "./dist/transformer.cjs" + }, + "files": [ + "dist" + ], + "dependencies": { + "@devup-ui/binding": "workspace:^", + "@devup-ui/plugin-utils": "workspace:^", + "@devup-ui/wasm": "workspace:^" + }, + "devDependencies": { + "typescript": "^7.0.2" + } +} diff --git a/packages/metro-plugin/src/__tests__/index.test.ts b/packages/metro-plugin/src/__tests__/index.test.ts new file mode 100644 index 000000000..314c8fc2a --- /dev/null +++ b/packages/metro-plugin/src/__tests__/index.test.ts @@ -0,0 +1,20 @@ +import { describe, expect, it } from 'bun:test' + +import * as entry from '../index' +import { DevupUIBuildError } from '../located-error' +import { TRANSFORMER_PATH, withDevupUI } from '../plugin' +import { MissingSettingsError } from '../settings' + +describe('@devup-ui/metro-plugin', () => { + it('exports the plugin, its transformer path and its errors', () => { + expect(entry.withDevupUI).toBe(withDevupUI) + expect(entry.TRANSFORMER_PATH).toBe(TRANSFORMER_PATH) + expect(entry.DevupUIBuildError).toBe(DevupUIBuildError) + expect(entry.MissingSettingsError).toBe(MissingSettingsError) + expect(entry.DEFAULT_UPSTREAM_TRANSFORMERS).toEqual([ + '@expo/metro-config/babel-transformer', + '@react-native/metro-babel-transformer', + ]) + expect(entry.UpstreamTransformerNotFoundError).toBeFunction() + }) +}) diff --git a/packages/metro-plugin/src/__tests__/located-error.test.ts b/packages/metro-plugin/src/__tests__/located-error.test.ts new file mode 100644 index 000000000..9f7de3f77 --- /dev/null +++ b/packages/metro-plugin/src/__tests__/located-error.test.ts @@ -0,0 +1,69 @@ +import { describe, expect, it } from 'bun:test' + +import { codeFrame, DevupUIBuildError, locatedError } from '../located-error' + +const source = ['a', 'bb', '', 'dddd', 'e', 'f'].join('\n') + +describe('codeFrame', () => { + it('shows two lines around the line with a caret under the column', () => { + expect(codeFrame(source, 4, 3)).toBe( + [ + ' 2 | bb', + ' 3 |', + '> 4 | dddd', + ' | ^', + ' 5 | e', + ' 6 | f', + ].join('\n'), + ) + }) + + it('stops at the first and the last line', () => { + expect(codeFrame('x\r\ny', 1, 1)).toBe( + ['> 1 | x', ' | ^', ' 2 | y'].join('\n'), + ) + expect(codeFrame('x\ny', 2, 1)).toBe( + [' 1 | x', '> 2 | y', ' | ^'].join('\n'), + ) + }) + + it('pads the gutter to the widest line number', () => { + const lines = Array.from({ length: 10 }, (_, index) => `l${index + 1}`) + expect(codeFrame(lines.join('\n'), 9, 2)).toBe( + [' 7 | l7', ' 8 | l8', '> 9 | l9', ' | ^', ' 10 | l10'].join( + '\n', + ), + ) + }) +}) + +describe('locatedError', () => { + it('locates an engine error at its first location', () => { + const cause = new Error( + 'src/App.tsx:4:3: `` cannot use `_hover` on React Native\nsrc/App.tsx:5:1: another', + ) + const error = locatedError(cause, 'src/App.tsx', source) + expect(error).toBeInstanceOf(DevupUIBuildError) + expect(error).toBeInstanceOf(SyntaxError) + if (!(error instanceof DevupUIBuildError)) throw error + expect(error.name).toBe('DevupUIBuildError') + expect(error.message).toBe(cause.message) + expect(error.loc).toEqual({ line: 4, column: 2 }) + expect(error.codeFrame).toBe(codeFrame(source, 4, 3)) + expect(error.cause).toBe(cause) + }) + + it('matches the filename literally', () => { + const cause = new Error('a+b(1).tsx:1:1: bad') + expect(locatedError(cause, 'a+b(1).tsx', 'x')).toBeInstanceOf( + DevupUIBuildError, + ) + expect(locatedError(cause, 'aab1.tsx', 'x')).toBe(cause) + }) + + it('keeps an error without a location as it is', () => { + const cause = new Error('unknown React Native platform ``') + expect(locatedError(cause, 'App.tsx', 'x')).toBe(cause) + expect(locatedError('text', 'App.tsx', 'x')).toBe('text') + }) +}) diff --git a/packages/metro-plugin/src/__tests__/plugin.test.ts b/packages/metro-plugin/src/__tests__/plugin.test.ts new file mode 100644 index 000000000..0285f02c0 --- /dev/null +++ b/packages/metro-plugin/src/__tests__/plugin.test.ts @@ -0,0 +1,160 @@ +import { mkdirSync, mkdtempSync, rmSync, writeFileSync } from 'node:fs' +import { tmpdir } from 'node:os' +import { dirname, join } from 'node:path' + +import { afterEach, beforeEach, describe, expect, it, spyOn } from 'bun:test' + +import { + TRANSFORMER_PATH, + UpstreamTransformerNotFoundError, + withDevupUI, +} from '../plugin' +import { readSettings, SETTINGS_ENV } from '../settings' + +let root: string +let previous: string | undefined + +beforeEach(() => { + root = mkdtempSync(join(tmpdir(), 'devup-metro-plugin-')) + previous = process.env[SETTINGS_ENV] + delete process.env[SETTINGS_ENV] +}) + +afterEach(() => { + rmSync(root, { recursive: true, force: true }) + if (previous === undefined) delete process.env[SETTINGS_ENV] + else process.env[SETTINGS_ENV] = previous +}) + +/** Write `path` under the project root, with its directories */ +function write(path: string, content = 'module.exports = {}'): string { + const file = join(root, path) + mkdirSync(dirname(file), { recursive: true }) + writeFileSync(file, content) + return file +} + +/** A package installed in the project's node_modules */ +function install(name: string, file: string): string { + write( + `node_modules/${name}/package.json`, + JSON.stringify({ name, version: '1.0.0' }), + ) + return write(`node_modules/${name}/${file}`) +} + +describe('withDevupUI', () => { + it('points Metro at the transformer, keeping the rest of the config', () => { + const resolver = { sourceExts: ['tsx'] } + const config = { + projectRoot: root, + resolver, + transformer: { + babelTransformerPath: '/upstream.js', + minifierPath: 'minifier', + }, + } + const wrapped = withDevupUI(config) + expect(wrapped).toEqual({ + projectRoot: root, + resolver, + transformer: { + babelTransformerPath: TRANSFORMER_PATH, + minifierPath: 'minifier', + }, + }) + expect(config.transformer.babelTransformerPath).toBe('/upstream.js') + expect(TRANSFORMER_PATH).toEndWith('transformer.cjs') + expect(readSettings()).toEqual({ + upstreamTransformer: '/upstream.js', + package: '@devup-ui/react', + include: [], + runtime: true, + devupFile: join(root, 'devup.json'), + engine: undefined, + }) + }) + + it('passes the options to the transformer', () => { + withDevupUI( + { projectRoot: root, transformer: { babelTransformerPath: '/up.js' } }, + { + package: '@acme/ui', + include: ['lib'], + runtime: false, + engine: 'wasm', + devupFile: 'theme/devup.json', + }, + ) + expect(readSettings()).toEqual({ + upstreamTransformer: '/up.js', + package: '@acme/ui', + include: ['lib'], + runtime: false, + devupFile: join(root, 'theme', 'devup.json'), + engine: 'wasm', + }) + }) + + it('resolves the upstreamTransformer option from the project root', () => { + const local = write('transformer.cjs') + const config = { + projectRoot: root, + transformer: { babelTransformerPath: '/up.js' }, + } + withDevupUI(config, { upstreamTransformer: './transformer.cjs' }) + expect(readSettings().upstreamTransformer).toBe(local) + const installed = install('custom-transformer', 'index.js') + withDevupUI(config, { upstreamTransformer: 'custom-transformer' }) + expect(readSettings().upstreamTransformer).toBe(installed) + expect(() => + withDevupUI(config, { upstreamTransformer: './missing.cjs' }), + ).toThrow() + }) + + it("prefers Expo's transformer", () => { + install('@react-native/metro-babel-transformer', 'index.js') + const expo = install('@expo/metro-config', 'babel-transformer.js') + withDevupUI({ projectRoot: root, transformer: {} }) + expect(readSettings().upstreamTransformer).toBe(expo) + }) + + it("falls back to React Native's transformer", () => { + const reactNative = install( + '@react-native/metro-babel-transformer', + 'index.js', + ) + withDevupUI({ projectRoot: root }) + expect(readSettings().upstreamTransformer).toBe(reactNative) + }) + + it('tells what to install when no transformer is found', () => { + expect(() => withDevupUI({ projectRoot: root })).toThrow( + UpstreamTransformerNotFoundError, + ) + expect(() => withDevupUI({ projectRoot: root })).toThrow( + '`upstreamTransformer` option', + ) + }) + + it('keeps the first upstream transformer when wrapped twice', () => { + const wrapped = withDevupUI({ + projectRoot: root, + transformer: { babelTransformerPath: '/up.js' }, + }) + expect(withDevupUI(wrapped).transformer.babelTransformerPath).toBe( + TRANSFORMER_PATH, + ) + expect(readSettings().upstreamTransformer).toBe('/up.js') + }) + + it('uses the working directory without a project root', () => { + const cwd = spyOn(process, 'cwd').mockReturnValue(root) + try { + withDevupUI({ transformer: { babelTransformerPath: '/up.js' } }) + expect(readSettings().devupFile).toBe(join(root, 'devup.json')) + } finally { + cwd.mockRestore() + } + }) +}) diff --git a/packages/metro-plugin/src/__tests__/settings.test.ts b/packages/metro-plugin/src/__tests__/settings.test.ts new file mode 100644 index 000000000..7176eaafc --- /dev/null +++ b/packages/metro-plugin/src/__tests__/settings.test.ts @@ -0,0 +1,44 @@ +import { describe, expect, it } from 'bun:test' + +import { + MissingSettingsError, + readSettings, + SETTINGS_ENV, + writeSettings, +} from '../settings' + +const settings = { + upstreamTransformer: '/upstream.js', + package: '@devup-ui/react', + include: ['lib'], + runtime: false, + devupFile: '/devup.json', + engine: 'wasm', +} as const + +describe('settings', () => { + it('round-trips through the environment', () => { + const env: NodeJS.ProcessEnv = {} + writeSettings(settings, env) + expect(JSON.parse(env[SETTINGS_ENV] ?? '')).toEqual(settings) + expect(readSettings(env)).toEqual(settings) + }) + + it('tells how to configure Metro when withDevupUI() did not run', () => { + expect(() => readSettings({})).toThrow(MissingSettingsError) + expect(() => readSettings({})).toThrow( + 'Wrap the Metro config with `withDevupUI(config)`', + ) + }) + + it('reads the process environment by default', () => { + const previous = process.env[SETTINGS_ENV] + try { + writeSettings(settings) + expect(readSettings()).toEqual(settings) + } finally { + if (previous === undefined) delete process.env[SETTINGS_ENV] + else process.env[SETTINGS_ENV] = previous + } + }) +}) diff --git a/packages/metro-plugin/src/__tests__/source-map.test.ts b/packages/metro-plugin/src/__tests__/source-map.test.ts new file mode 100644 index 000000000..ce33069ed --- /dev/null +++ b/packages/metro-plugin/src/__tests__/source-map.test.ts @@ -0,0 +1,75 @@ +import { describe, expect, it } from 'bun:test' + +import { createLocator, decodeMappings, remapLocations } from '../source-map' + +describe('decodeMappings', () => { + it('decodes relative segments, skipping those without a source', () => { + // Line 1: column 0 -> 1:0, column 4 -> 1:2; line 3: column 2 -> 2:0 + // (a negative column delta), column 33 -> 18:5 (multi-digit values). + // `C` names no source; the empty group and line are skipped. + expect(decodeMappings('AAAA,IAAE,C;;EACF,+BAgBK,')).toEqual([ + { line: 1, column: 0, source: { line: 1, column: 0 } }, + { line: 1, column: 4, source: { line: 1, column: 2 } }, + { line: 3, column: 2, source: { line: 2, column: 0 } }, + { line: 3, column: 33, source: { line: 18, column: 5 } }, + ]) + }) +}) + +describe('createLocator', () => { + const locate = createLocator(decodeMappings('AAAA,IAAE;;EACF')) + + it('moves a place by its distance from the segment on its line', () => { + expect(locate({ line: 1, column: 6 })).toEqual({ line: 1, column: 4 }) + expect(locate({ line: 3, column: 9 })).toEqual({ line: 2, column: 7 }) + }) + + it('places inserted lines at the segment before them', () => { + expect(locate({ line: 2, column: 5 })).toEqual({ line: 1, column: 2 }) + }) + + it('leaves a place before the first segment', () => { + expect(createLocator(decodeMappings(';AAAA'))({ line: 1, column: 0 })).toBe( + undefined, + ) + }) +}) + +describe('remapLocations', () => { + it('moves every location of the AST once', () => { + const shared = { line: 3, column: 2 } + const comment = { type: 'CommentLine', loc: { start: shared, end: shared } } + const program: Record = { + type: 'Program', + loc: { + start: { line: 1, column: 0 }, + end: { line: 3, column: 4 }, + filename: 'App.tsx', + }, + body: [ + { type: 'Inserted', loc: { start: { line: 2, column: 0 } } }, + { type: 'Partial', loc: { start: { line: 'x' }, end: null } }, + { type: 'Plain', extra: null, value: 1 }, + ], + comments: [comment], + leadingComments: [comment], + } + program.self = program + remapLocations({ type: 'File', program }, '{"mappings":";AAAA;EACA"}') + expect(program.loc).toEqual({ + start: { line: 1, column: 0 }, + end: { line: 2, column: 2 }, + filename: 'App.tsx', + }) + expect(program.body).toEqual([ + { type: 'Inserted', loc: { start: { line: 1, column: 0 } } }, + { type: 'Partial', loc: { start: { line: 'x' }, end: null } }, + { type: 'Plain', extra: null, value: 1 }, + ]) + expect(shared).toEqual({ line: 2, column: 0 }) + }) + + it('accepts a missing AST', () => { + expect(() => remapLocations(null, '{"mappings":""}')).not.toThrow() + }) +}) diff --git a/packages/metro-plugin/src/__tests__/transform.test.ts b/packages/metro-plugin/src/__tests__/transform.test.ts new file mode 100644 index 000000000..fe3de5dee --- /dev/null +++ b/packages/metro-plugin/src/__tests__/transform.test.ts @@ -0,0 +1,299 @@ +import { mkdirSync, mkdtempSync, rmSync, writeFileSync } from 'node:fs' +import { tmpdir } from 'node:os' +import { dirname, join } from 'node:path' + +import { + afterEach, + beforeEach, + describe, + expect, + it, + mock, + spyOn, +} from 'bun:test' + +import { DevupUIBuildError } from '../located-error' +import type { MetroTransformerSettings } from '../settings' +import { + type BabelTransformer, + type BabelTransformerArgs, + createTransformer, + engineVersion, + type NativeCompiler, + type TransformerHost, +} from '../transform' + +let root: string + +beforeEach(() => { + root = mkdtempSync(join(tmpdir(), 'devup-metro-transform-')) +}) + +afterEach(() => { + rmSync(root, { recursive: true, force: true }) +}) + +function write(path: string, content: string): string { + const file = join(root, path) + mkdirSync(dirname(file), { recursive: true }) + writeFileSync(file, content) + return file +} + +const APP = + "import { Box } from '@devup-ui/react'\nexport const A = () => " + +/** A compiler double whose `codeExtractNative` returns `code` */ +function fakeCompiler( + codeExtractNative: (...args: unknown[]) => string = () => 'compiled', + map: string | null = null, +) { + const free = mock() + const extract = mock((...args: unknown[]) => ({ + code: codeExtractNative(...args), + map, + free, + })) + const compiler: NativeCompiler = { codeExtractNative: extract } + return { compiler, extract, free } +} + +function setup( + overrides: Partial = {}, + upstream: BabelTransformer = { + transform: (args) => args, + getCacheKey: () => 'upstream-key', + }, + compiler = fakeCompiler().compiler, +) { + const settings: MetroTransformerSettings = { + upstreamTransformer: '/upstream.js', + package: '@devup-ui/react', + include: [], + runtime: true, + devupFile: join(root, 'devup.json'), + ...overrides, + } + const host = { + settings: mock(() => settings), + requireModule: mock(() => upstream), + loadCompiler: mock(() => compiler), + engineVersion: mock(() => '@devup-ui/binding@1.0.0'), + } satisfies TransformerHost + return { host, transformer: createTransformer(host), settings } +} + +function args( + filename: string, + src = APP, + platform: string | null = 'ios', +): BabelTransformerArgs { + return { filename, src, options: { platform, projectRoot: root } } +} + +describe('transform', () => { + it('compiles a file that imports Devup UI and hands it upstream', () => { + const { compiler, extract, free } = fakeCompiler() + const transform = mock((input: BabelTransformerArgs) => ({ input })) + const { host, transformer } = setup( + { runtime: false, engine: 'wasm' }, + { transform }, + compiler, + ) + const input = { ...args('src/App.tsx'), plugins: ['p'] } + expect(transformer.transform(input)).toEqual({ + input: { ...input, src: 'compiled' }, + }) + expect(extract.mock.calls).toEqual([ + ['src/App.tsx', APP, '@devup-ui/react', 'ios', false], + ]) + expect(free).toHaveBeenCalledTimes(1) + expect(host.requireModule.mock.calls).toEqual([['/upstream.js']]) + expect(host.loadCompiler.mock.calls).toEqual([['wasm']]) + }) + + it('loads the settings, the upstream and the engine once', () => { + const { host, transformer } = setup() + transformer.transform(args('a.tsx')) + transformer.transform(args('b.tsx', APP, 'android')) + expect(host.settings).toHaveBeenCalledTimes(1) + expect(host.requireModule).toHaveBeenCalledTimes(1) + expect(host.loadCompiler).toHaveBeenCalledTimes(1) + }) + + it('passes other files upstream untouched', () => { + const { host, transformer } = setup({ include: ['lib'] }) + for (const input of [ + args('App.tsx', 'export const a = 1'), + args('data.json', APP), + args('node_modules/other/index.js', APP), + args('node_modules/lib/node_modules/nested/index.js', APP), + ]) { + expect(transformer.transform(input)).toBe(input) + } + expect(host.loadCompiler).not.toHaveBeenCalled() + }) + + it('compiles included packages, Devup UI ones and a custom package', () => { + const { compiler, extract } = fakeCompiler() + const { transformer } = setup( + { include: ['lib'], package: '@acme/ui' }, + { transform: (input) => input }, + compiler, + ) + const code = "import { Box } from '@acme/ui'" + transformer.transform(args('node_modules/lib/index.js', code)) + transformer.transform(args('node_modules/@devup-ui/kit/index.mjs', code)) + transformer.transform(args('App.tsx', APP)) + expect(extract.mock.calls.map(([filename]) => filename)).toEqual([ + 'node_modules/lib/index.js', + 'node_modules/@devup-ui/kit/index.mjs', + ]) + }) + + it('moves the locations of the upstream AST to the source', () => { + // Compiled line 2 is inserted; compiled line 3 is source line 2 + const map = '{"mappings":"AAAA;;AACA"}' + const { compiler } = fakeCompiler(() => 'compiled', map) + const loc = { start: { line: 3, column: 1 }, end: { line: 2, column: 0 } } + const results: unknown[] = [ + { ast: { type: 'File', loc } }, + null, + 'code', + {}, + ] + const { transformer } = setup( + {}, + { transform: () => results.shift() }, + compiler, + ) + expect(transformer.transform(args('App.tsx'))).toEqual({ + ast: { + type: 'File', + loc: { start: { line: 2, column: 1 }, end: { line: 1, column: 0 } }, + }, + }) + expect(transformer.transform(args('App.tsx'))).toBe(null) + expect(transformer.transform(args('App.tsx'))).toBe('code') + expect(transformer.transform(args('App.tsx'))).toEqual({}) + }) + + it('keeps the arguments when the compiled code is the same', () => { + const { compiler } = fakeCompiler(() => APP) + const { transformer } = setup({}, { transform: (input) => input }, compiler) + const input = args('App.tsx') + expect(transformer.transform(input)).toBe(input) + }) + + it('passes an empty platform when Metro gives none', () => { + const { compiler, extract } = fakeCompiler() + const { transformer } = setup({}, { transform: (input) => input }, compiler) + transformer.transform(args('App.tsx', APP, null)) + expect(extract.mock.calls[0][3]).toBe('') + }) + + it('reports a build error at its location', () => { + const { compiler } = fakeCompiler(() => { + throw new Error('App.tsx:2:24: `` cannot use `_hover`') + }) + const { transformer } = setup({}, { transform: (input) => input }, compiler) + let thrown: unknown + try { + transformer.transform(args('App.tsx')) + } catch (error) { + thrown = error + } + expect(thrown).toBeInstanceOf(DevupUIBuildError) + expect(thrown).toMatchObject({ loc: { line: 2, column: 23 } }) + }) +}) + +describe('getCacheKey', () => { + it('changes with the upstream key, devup.json, its extends, the engine and the settings', () => { + let upstreamKey = 'a' + const upstream: BabelTransformer = { + transform: (input) => input, + getCacheKey: mock(() => upstreamKey), + } + const { host, transformer } = setup({}, upstream) + const keys = new Set() + const key = () => { + const value = transformer.getCacheKey({ projectRoot: root }) + keys.add(value) + return value + } + const first = key() + expect(first).toMatch(/^[0-9a-f]{64}$/) + expect(key()).toBe(first) + expect(upstream.getCacheKey).toHaveBeenCalledWith({ projectRoot: root }) + upstreamKey = 'b' + key() + const warn = spyOn(console, 'warn').mockImplementation(() => {}) + write('devup.json', '{"extends":["base.json"]}') + key() + expect(warn).toHaveBeenCalledTimes(1) + warn.mockRestore() + write('base.json', '{"theme":{}}') + key() + write('base.json', '{"theme":{"colors":{}}}') + key() + write('devup.json', '{') + key() + host.engineVersion.mockReturnValue('@devup-ui/binding@2.0.0') + key() + expect(keys.size).toBe(7) + }) + + it('works with an upstream transformer without a cache key', () => { + const { transformer: withKey } = setup( + {}, + { + transform: (input) => input, + getCacheKey: () => '', + }, + ) + const { transformer } = setup({}, { transform: (input) => input }) + expect(transformer.getCacheKey()).toBe(withKey.getCacheKey()) + }) + + it('differs between settings', () => { + const { transformer: strict } = setup({ runtime: false }) + const { transformer } = setup() + expect(strict.getCacheKey()).not.toBe(transformer.getCacheKey()) + }) +}) + +describe('engineVersion', () => { + it('reads the version of the package the engine resolves to', () => { + write( + 'node_modules/@devup-ui/binding/package.json', + JSON.stringify({ name: '@devup-ui/binding', version: '1.2.3' }), + ) + // A nested manifest of another name, as wasm-pack writes into `pkg` + write( + 'node_modules/@devup-ui/binding/pkg/package.json', + JSON.stringify({ name: 'devup-ui-binding', version: '0.0.1' }), + ) + const entry = write('node_modules/@devup-ui/binding/pkg/index.cjs', '') + const resolve = mock(() => entry) + expect(engineVersion(undefined, { resolve })).toBe( + '@devup-ui/binding@1.2.3', + ) + expect(resolve.mock.calls).toEqual([['@devup-ui/binding']]) + }) + + it('names the WASM package for the WASM engine', () => { + const resolve = mock(() => { + throw new Error('not found') + }) + expect(engineVersion('wasm', { resolve })).toBe('@devup-ui/wasm@unknown') + }) + + it('is unknown when no manifest names the package', () => { + const entry = write('lonely/index.js', '') + const resolve = mock(() => entry) + expect(engineVersion('native', { resolve })).toBe( + '@devup-ui/binding@unknown', + ) + }) +}) diff --git a/packages/metro-plugin/src/__tests__/transformer.test.ts b/packages/metro-plugin/src/__tests__/transformer.test.ts new file mode 100644 index 000000000..2bba7a839 --- /dev/null +++ b/packages/metro-plugin/src/__tests__/transformer.test.ts @@ -0,0 +1,57 @@ +import { mkdtempSync, rmSync, writeFileSync } from 'node:fs' +import { tmpdir } from 'node:os' +import { join } from 'node:path' + +import * as pluginUtils from '@devup-ui/plugin-utils' +import { afterAll, beforeAll, describe, expect, it, spyOn } from 'bun:test' + +import { SETTINGS_ENV, writeSettings } from '../settings' + +let root: string +let previous: string | undefined + +beforeAll(() => { + root = mkdtempSync(join(tmpdir(), 'devup-metro-transformer-')) + previous = process.env[SETTINGS_ENV] +}) + +afterAll(() => { + rmSync(root, { recursive: true, force: true }) + if (previous === undefined) delete process.env[SETTINGS_ENV] + else process.env[SETTINGS_ENV] = previous +}) + +describe('the module Metro loads', () => { + it('compiles with the configured engine and chains to the upstream module', async () => { + const upstream = join(root, 'upstream.cjs') + writeFileSync( + upstream, + "exports.transform = (args) => ({ code: args.src })\nexports.getCacheKey = () => 'upstream'", + ) + writeSettings({ + upstreamTransformer: upstream, + package: '@devup-ui/react', + include: [], + runtime: true, + devupFile: join(root, 'devup.json'), + engine: 'wasm', + }) + const selection = spyOn(pluginUtils, 'loadCompiler') + try { + const { getCacheKey, transform } = await import('../transformer') + expect(getCacheKey()).toMatch(/^[0-9a-f]{64}$/) + const result = transform({ + filename: 'App.tsx', + src: "import { Box } from '@devup-ui/react'\nexport const A = () => ", + options: { platform: 'android', projectRoot: root }, + }) + expect(result).toEqual({ code: expect.stringContaining('padding: 4') }) + expect(result).toEqual({ + code: expect.stringContaining('from "react-native"'), + }) + expect(selection.mock.calls).toEqual([['wasm']]) + } finally { + selection.mockRestore() + } + }) +}) diff --git a/packages/metro-plugin/src/index.ts b/packages/metro-plugin/src/index.ts new file mode 100644 index 000000000..5c26f5844 --- /dev/null +++ b/packages/metro-plugin/src/index.ts @@ -0,0 +1,11 @@ +export { DevupUIBuildError } from './located-error' +export { + DEFAULT_UPSTREAM_TRANSFORMERS, + type DevupUIMetroPluginOptions, + type MetroConfigLike, + TRANSFORMER_PATH, + UpstreamTransformerNotFoundError, + withDevupUI, +} from './plugin' +export { MissingSettingsError } from './settings' +export type { BabelTransformer, BabelTransformerArgs } from './transform' diff --git a/packages/metro-plugin/src/located-error.ts b/packages/metro-plugin/src/located-error.ts new file mode 100644 index 000000000..25d175f55 --- /dev/null +++ b/packages/metro-plugin/src/located-error.ts @@ -0,0 +1,83 @@ +/** A line break as the engine counts lines: CRLF, LF, CR, U+2028 and U+2029 */ +const LINE_BREAK = new RegExp( + `\r\n|[\n\r${String.fromCharCode(0x2028, 0x2029)}]`, +) + +/** Lines of source shown around the reported line */ +const CONTEXT_LINES = 2 + +/** + * The error Metro shows for a build error of the engine. The engine leads + * each error with `filename:line:column`; Metro prints an error with `loc` as + * a transform error at that place, with `codeFrame` under it, the way it + * prints a Babel syntax error. + */ +export class DevupUIBuildError extends SyntaxError { + static { + // Metro's workers send an error by its constructor name, which the + // minified build would lose + Object.defineProperty(this, 'name', { value: 'DevupUIBuildError' }) + } + readonly name = 'DevupUIBuildError' + /** Babel's location shape: a 1-based line and a 0-based column */ + readonly loc: { readonly line: number; readonly column: number } + readonly codeFrame: string + + constructor(message: string, line: number, column: number, source: string) { + super(message) + this.loc = { line, column: column - 1 } + this.codeFrame = codeFrame(source, line, column) + } +} + +/** + * The lines of `source` around `line`, numbered, with a caret under `column` + * (both 1-based) + */ +export function codeFrame(source: string, line: number, column: number) { + const lines = source.split(LINE_BREAK) + const first = Math.max(line - CONTEXT_LINES, 1) + const last = Math.min(line + CONTEXT_LINES, lines.length) + const width = String(last).length + const frame: string[] = [] + for (let number = first; number <= last; number++) { + const gutter = String(number).padStart(width) + const text = lines[number - 1] + frame.push( + `${number === line ? '>' : ' '} ${gutter} |${text ? ` ${text}` : ''}`, + ) + if (number === line) { + frame.push(` ${' '.repeat(width)} | ${' '.repeat(column - 1)}^`) + } + } + return frame.join('\n') +} + +function escapeRegExp(text: string): string { + return text.replace(/[.*+?^${}()|[\]\\]/g, '\\$&') +} + +/** + * `error` of the engine compiling `filename` as Metro reports it: located at + * its first `filename:line:column` when it has one, as it is otherwise + */ +export function locatedError( + error: unknown, + filename: string, + source: string, +): unknown { + if (!(error instanceof Error)) return error + const location = new RegExp( + `^${escapeRegExp(filename)}:(\\d+):(\\d+): `, + 'm', + ).exec(error.message) + if (!location) return error + const located = new DevupUIBuildError( + error.message, + Number(location[1]), + Number(location[2]), + source, + ) + located.cause = error + return located +} diff --git a/packages/metro-plugin/src/plugin.ts b/packages/metro-plugin/src/plugin.ts new file mode 100644 index 000000000..969e956eb --- /dev/null +++ b/packages/metro-plugin/src/plugin.ts @@ -0,0 +1,161 @@ +import { createRequire } from 'node:module' +import { dirname, isAbsolute, join, resolve } from 'node:path' +import { fileURLToPath } from 'node:url' + +import { + type DevupEngine, + resolveDevupFile, + RUNTIME_PACKAGE, +} from '@devup-ui/plugin-utils' + +import { + type MetroTransformerSettings, + readSettings, + writeSettings, +} from './settings' + +export interface DevupUIMetroPluginOptions { + /** + * The engine. Native by default; `'wasm'` selects the WebAssembly engine, + * as in the other plugins. + */ + engine?: DevupEngine + /** The package Devup UI is imported from. Defaults to `@devup-ui/react`. */ + package?: string + /** Path of devup.json, from the project root. Defaults to `devup.json`. */ + devupFile?: string + /** + * Packages in `node_modules` whose files are compiled as well: a library + * that ships Devup UI components uncompiled. Each name matches that whole + * package (`pkg` is not `pkg-extra` or `@scope/pkg`). + */ + include?: string[] + /** + * Whether the React Native runtime may be imported for what needs it + * (responsive values, themes, `_pressed`). Defaults to `true`; `false` + * keeps every file free of runtime imports and makes those styles build + * errors. This version has no runtime yet, so they are build errors either + * way. + */ + runtime?: boolean + /** + * The Babel transformer the compiled code goes to, as a path or a package + * resolved from the project root. Defaults to the `babelTransformerPath` + * of the config, else Expo's transformer, else React Native's. + */ + upstreamTransformer?: string +} + +/** The part of a Metro config this plugin reads and changes */ +export interface MetroConfigLike { + projectRoot?: string + transformer?: { + babelTransformerPath?: string + } +} + +/** The transformers tried, in order, when neither the config nor the options name one */ +export const DEFAULT_UPSTREAM_TRANSFORMERS = [ + '@expo/metro-config/babel-transformer', + '@react-native/metro-babel-transformer', +] as const + +/** Where this module is; the CJS build substitutes `module.filename` */ +function moduleDirectory(location: string): string { + return dirname(isAbsolute(location) ? location : fileURLToPath(location)) +} + +/** The Babel transformer Metro runs: the built `transformer.cjs` next to this module */ +export const TRANSFORMER_PATH = join( + moduleDirectory(import.meta.url), + 'transformer.cjs', +) + +export class UpstreamTransformerNotFoundError extends Error { + readonly name = 'UpstreamTransformerNotFoundError' + + constructor(projectRoot: string) { + super( + `[devup-ui] Cannot find a Babel transformer for Metro in ${projectRoot}. Install \`@expo/metro-config\` (Expo) or \`@react-native/metro-babel-transformer\` (React Native), or name one with the \`upstreamTransformer\` option of withDevupUI().`, + ) + } +} + +/** `request` resolved from `projectRoot`, as `require` there resolves it */ +function resolveFrom(projectRoot: string, request: string): string { + return createRequire(join(projectRoot, 'package.json')).resolve(request) +} + +/** `request` resolved from `projectRoot`, or `undefined` when it is not installed */ +function findFrom(projectRoot: string, request: string): string | undefined { + try { + return resolveFrom(projectRoot, request) + } catch { + return undefined + } +} + +/** The Babel transformer the compiled code goes to */ +function upstreamTransformer( + projectRoot: string, + configured: string | undefined, + option: string | undefined, +): string { + if (option !== undefined) { + return resolveFrom(projectRoot, option) + } + if (configured === TRANSFORMER_PATH) { + // Wrapped twice: keep the transformer the first call chose + return readSettings().upstreamTransformer + } + if (configured !== undefined) return configured + for (const request of DEFAULT_UPSTREAM_TRANSFORMERS) { + const path = findFrom(projectRoot, request) + if (path !== undefined) return path + } + throw new UpstreamTransformerNotFoundError(projectRoot) +} + +/** + * Compile Devup UI for React Native in Metro: the config's Babel transformer + * becomes Devup UI's, which compiles each file that imports Devup UI and then + * hands the code to the transformer the config had (Expo's or React + * Native's). + * + * ```js + * // metro.config.js + * const { getDefaultConfig } = require('expo/metro-config') + * const { withDevupUI } = require('@devup-ui/metro-plugin') + * + * module.exports = withDevupUI(getDefaultConfig(__dirname)) + * ``` + */ +export function withDevupUI( + config: T, + options: DevupUIMetroPluginOptions = {}, +): T { + const projectRoot = config.projectRoot ?? process.cwd() + const settings: MetroTransformerSettings = { + upstreamTransformer: upstreamTransformer( + projectRoot, + config.transformer?.babelTransformerPath, + options.upstreamTransformer, + ), + package: options.package ?? RUNTIME_PACKAGE, + include: options.include ?? [], + runtime: options.runtime ?? true, + devupFile: resolve( + projectRoot, + resolveDevupFile(projectRoot, options.devupFile), + ), + engine: options.engine, + } + writeSettings(settings) + return { + ...config, + transformer: { + ...config.transformer, + babelTransformerPath: TRANSFORMER_PATH, + }, + } +} diff --git a/packages/metro-plugin/src/settings.ts b/packages/metro-plugin/src/settings.ts new file mode 100644 index 000000000..4f3c7dbff --- /dev/null +++ b/packages/metro-plugin/src/settings.ts @@ -0,0 +1,56 @@ +import type { DevupEngine } from '@devup-ui/plugin-utils' + +/** + * The environment variable `withDevupUI()` hands the transformer settings + * through. Metro loads its config in the main process and forks the transform + * workers with that process's environment, and its transformer API has no + * other way to pass options to a Babel transformer. + */ +export const SETTINGS_ENV = 'DEVUP_UI_METRO_SETTINGS' + +/** What the transformer needs, resolved once in the process that loads the config */ +export interface MetroTransformerSettings { + /** Absolute path of the Babel transformer the compiled code goes to */ + readonly upstreamTransformer: string + /** The package whose imports are compiled */ + readonly package: string + /** Packages in `node_modules` that are compiled too */ + readonly include: readonly string[] + /** Whether the React Native runtime may be imported for what needs it */ + readonly runtime: boolean + /** Absolute path of devup.json */ + readonly devupFile: string + /** The engine; native by default */ + readonly engine?: DevupEngine +} + +export function writeSettings( + settings: MetroTransformerSettings, + env: NodeJS.ProcessEnv = process.env, +): void { + env[SETTINGS_ENV] = JSON.stringify(settings) +} + +export class MissingSettingsError extends Error { + static { + // Metro's workers send an error by its constructor name, which the + // minified build would lose + Object.defineProperty(this, 'name', { value: 'MissingSettingsError' }) + } + readonly name = 'MissingSettingsError' + + constructor() { + super( + '[devup-ui] The Metro transformer of @devup-ui/metro-plugin has no settings. Wrap the Metro config with `withDevupUI(config)` in metro.config.js instead of setting `babelTransformerPath` to it by hand.', + ) + } +} + +export function readSettings( + env: NodeJS.ProcessEnv = process.env, +): MetroTransformerSettings { + const raw = env[SETTINGS_ENV] + if (!raw) throw new MissingSettingsError() + const settings: MetroTransformerSettings = JSON.parse(raw) + return settings +} diff --git a/packages/metro-plugin/src/source-map.ts b/packages/metro-plugin/src/source-map.ts new file mode 100644 index 000000000..9afed587e --- /dev/null +++ b/packages/metro-plugin/src/source-map.ts @@ -0,0 +1,134 @@ +const BASE64 = + 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/' + +/** A place in code: a 1-based line and a 0-based column, as in Babel */ +export interface Position { + line: number + column: number +} + +/** A mapping from a place in the compiled code to one in the source */ +interface Segment extends Position { + readonly source: Position +} + +/** The numbers of one Base64 VLQ segment */ +function decodeSegment(text: string): number[] { + const values: number[] = [] + let value = 0 + let shift = 0 + for (const character of text) { + const digit = BASE64.indexOf(character) + value += (digit & 31) << shift + if (digit & 32) { + shift += 5 + } else { + values.push(value & 1 ? -(value >>> 1) : value >>> 1) + value = 0 + shift = 0 + } + } + return values +} + +/** The segments of a single-source map's `mappings` that name a source place */ +export function decodeMappings(mappings: string): Segment[] { + const segments: Segment[] = [] + let sourceLine = 0 + let sourceColumn = 0 + mappings.split(';').forEach((text, index) => { + let column = 0 + for (const group of text.split(',')) { + const values = decodeSegment(group) + if (values.length === 0) continue + column += values[0] + if (values.length < 4) continue + sourceLine += values[2] + sourceColumn += values[3] + segments.push({ + line: index + 1, + column, + source: { line: sourceLine + 1, column: sourceColumn }, + }) + } + }) + return segments +} + +/** + * The source place of a place in the compiled code: the last segment at or + * before it, moved by the columns between them on the same line, or that + * segment's place for code the compiler inserted on lines of its own. + * `undefined` before the first segment. + */ +export function createLocator(segments: readonly Segment[]) { + return (place: Position): Position | undefined => { + let low = 0 + let high = segments.length - 1 + let found: Segment | undefined + while (low <= high) { + const middle = (low + high) >> 1 + const segment = segments[middle] + if ( + segment.line < place.line || + (segment.line === place.line && segment.column <= place.column) + ) { + found = segment + low = middle + 1 + } else { + high = middle - 1 + } + } + if (!found) return undefined + return found.line === place.line + ? { + line: found.source.line, + column: found.source.column + place.column - found.column, + } + : { ...found.source } + } +} + +function isObject(value: unknown): value is Record { + return typeof value === 'object' && value !== null +} + +function isPosition(value: unknown): value is Position { + return ( + isObject(value) && + typeof value.line === 'number' && + typeof value.column === 'number' + ) +} + +/** + * Move every `loc` in the Babel AST `root`, built from the compiled code, to + * the source: Metro writes the source map of a module from these locations + * and pairs it with the file as it is on disk. + */ +export function remapLocations(root: unknown, map: string): void { + const { mappings }: { mappings: string } = JSON.parse(map) + const locate = createLocator(decodeMappings(mappings)) + const seen = new WeakSet() + const move = (position: unknown) => { + if (!isPosition(position) || seen.has(position)) return + seen.add(position) + const source = locate(position) + if (!source) return + position.line = source.line + position.column = source.column + } + const visit = (node: unknown) => { + if (!isObject(node) || seen.has(node)) return + seen.add(node) + for (const [key, value] of Object.entries(node)) { + if (key === 'loc' && isObject(value)) { + move(value.start) + move(value.end) + } else { + visit(value) + } + } + } + visit(root) +} diff --git a/packages/metro-plugin/src/transform.ts b/packages/metro-plugin/src/transform.ts new file mode 100644 index 000000000..b9080b45f --- /dev/null +++ b/packages/metro-plugin/src/transform.ts @@ -0,0 +1,216 @@ +import { createHash } from 'node:crypto' +import { existsSync, readFileSync } from 'node:fs' +import { createRequire } from 'node:module' +import { dirname, join } from 'node:path' + +import { + createNodeModulesExcludeRegex, + type DevupEngine, + loadCompiler, + loadDevupConfigSync, + SOURCE_FILE_REGEX, +} from '@devup-ui/plugin-utils' + +import { locatedError } from './located-error' +import { type MetroTransformerSettings, readSettings } from './settings' +import { remapLocations } from './source-map' + +/** What Metro passes a Babel transformer */ +export interface BabelTransformerArgs { + readonly filename: string + readonly src: string + readonly options: { + readonly platform?: string | null + readonly projectRoot: string + } + readonly plugins?: unknown +} + +/** A Babel transformer module as Metro loads it */ +export interface BabelTransformer { + transform(args: BabelTransformerArgs): unknown + getCacheKey?(...args: unknown[]): string +} + +/** The part of the engine the transformer calls */ +export interface NativeCompiler { + codeExtractNative( + filename: string, + code: string, + packageName: string, + platform: string, + runtime: boolean, + ): { + readonly code: string + readonly map?: string | null + free(): void + } +} + +/** What the transformer loads, replaceable in tests */ +export interface TransformerHost { + readonly settings: () => MetroTransformerSettings + readonly requireModule: (path: string) => BabelTransformer + readonly loadCompiler: (engine?: DevupEngine) => NativeCompiler + readonly engineVersion: (engine?: DevupEngine) => string +} + +/** The package an engine is loaded from */ +function enginePackage(engine?: DevupEngine): string { + return engine === 'wasm' ? '@devup-ui/wasm' : '@devup-ui/binding' +} + +/** + * The `name@version` of the package the engine is loaded from, found from the + * module `require` resolves it to, or `name@unknown` when it is not installed + */ +export function engineVersion( + engine: DevupEngine | undefined, + require: { resolve(request: string): string }, +): string { + const name = enginePackage(engine) + let directory: string + try { + directory = dirname(require.resolve(name)) + } catch { + return `${name}@unknown` + } + for (;;) { + const manifest = join(directory, 'package.json') + if (existsSync(manifest)) { + const { name: found, version } = JSON.parse( + readFileSync(manifest, 'utf-8'), + ) + if (found === name) return `${name}@${version}` + } + const parent = dirname(directory) + if (parent === directory) return `${name}@unknown` + directory = parent + } +} + +const localRequire = createRequire(import.meta.url) + +const defaultHost: TransformerHost = { + settings: () => readSettings(), + requireModule: (path) => localRequire(path), + loadCompiler: (engine) => loadCompiler(engine), + engineVersion: (engine) => engineVersion(engine, localRequire), +} + +/** devup.json and the files of its `extends` chain, as they are on disk */ +function devupFileContents(devupFile: string): string[] { + const inputs = new Set() + try { + loadDevupConfigSync(devupFile, inputs) + } catch { + // An unreadable chain still keys on the files read so far + } + return [...inputs].map( + (path) => `${path}\0${existsSync(path) ? readFileSync(path, 'utf-8') : ''}`, + ) +} + +/** + * The Babel transformer of `@devup-ui/metro-plugin`: it compiles a file that + * imports Devup UI for the platform Metro builds, then hands the code to the + * upstream transformer. Everything is loaded on first use, once per worker. + */ +export function createTransformer(host: TransformerHost = defaultHost) { + let loaded: + | { + readonly settings: MetroTransformerSettings + readonly upstream: BabelTransformer + readonly exclude: RegExp + } + | undefined + let compiler: NativeCompiler | undefined + + function load() { + if (!loaded) { + const settings = host.settings() + const upstream = host.requireModule(settings.upstreamTransformer) + loaded = { + settings, + upstream, + exclude: createNodeModulesExcludeRegex([...settings.include]), + } + } + return loaded + } + + /** + * `src` compiled for React Native with its source map, or `undefined` when + * it uses no Devup UI + */ + function compile({ + filename, + src, + options, + }: BabelTransformerArgs): { code: string; map?: string | null } | undefined { + const { settings, exclude } = load() + if ( + !SOURCE_FILE_REGEX.test(filename) || + exclude.test(filename) || + !src.includes(settings.package) + ) { + return undefined + } + compiler ??= host.loadCompiler(settings.engine) + let output: ReturnType + try { + output = compiler.codeExtractNative( + filename, + src, + settings.package, + options.platform ?? '', + settings.runtime, + ) + } catch (error) { + throw locatedError(error, filename, src) + } + try { + return { code: output.code, map: output.map } + } finally { + output.free() + } + } + + return { + transform(args: BabelTransformerArgs): unknown { + const { upstream } = load() + const compiled = compile(args) + if (!compiled || compiled.code === args.src) + return upstream.transform(args) + const result = upstream.transform({ ...args, src: compiled.code }) + if ( + compiled.map && + typeof result === 'object' && + result !== null && + 'ast' in result + ) { + remapLocations(result.ast, compiled.map) + } + return result + }, + + /** + * The upstream key, devup.json and its `extends` chain, the engine + * version and the settings: a change to any of them recompiles every + * file on the next Metro start. Metro adds the transformer file itself. + */ + getCacheKey(...args: unknown[]): string { + const { settings, upstream } = load() + const hash = createHash('sha256') + for (const part of [ + upstream.getCacheKey?.(...args) ?? '', + ...devupFileContents(settings.devupFile), + host.engineVersion(settings.engine), + JSON.stringify(settings), + ]) { + hash.update(part).update('\0') + } + return hash.digest('hex') + }, + } +} diff --git a/packages/metro-plugin/src/transformer.ts b/packages/metro-plugin/src/transformer.ts new file mode 100644 index 000000000..e585521c8 --- /dev/null +++ b/packages/metro-plugin/src/transformer.ts @@ -0,0 +1,16 @@ +/** + * The module Metro loads as `babelTransformerPath`: `withDevupUI()` points the + * config here, and the settings it resolved reach every worker through the + * environment. + */ +import { type BabelTransformerArgs, createTransformer } from './transform' + +const transformer = createTransformer() + +export function transform(args: BabelTransformerArgs): unknown { + return transformer.transform(args) +} + +export function getCacheKey(...args: unknown[]): string { + return transformer.getCacheKey(...args) +} diff --git a/packages/metro-plugin/tsconfig.json b/packages/metro-plugin/tsconfig.json new file mode 100644 index 000000000..c4c8a2838 --- /dev/null +++ b/packages/metro-plugin/tsconfig.json @@ -0,0 +1,29 @@ +{ + "compilerOptions": { + "types": ["bun"], + "strict": true, + "target": "ESNext", + "declaration": true, + "emitDeclarationOnly": true, + "outDir": "dist", + "declarationMap": true, + "removeComments": true, + "sourceMap": true, + "useDefineForClassFields": true, + "allowJs": false, + "skipLibCheck": true, + "noFallthroughCasesInSwitch": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": true, + "module": "ESNext", + "moduleResolution": "Bundler", + "resolveJsonModule": true, + "isolatedModules": true, + "rootDir": "src", + "jsx": "react-jsx" + }, + "include": ["src"], + "exclude": ["node_modules", "dist", "src/**/__tests__"] +} From 2717c03927d8453fae3ecb2d7fcd0d0c4c97106b Mon Sep 17 00:00:00 2001 From: owjs3901 Date: Fri, 20 Nov 2026 07:40:06 +0900 Subject: [PATCH 06/40] ci: drop the react-native-core pull request branch now that it is merged Co-Authored-By: Claude Opus 5.5 --- .github/workflows/publish.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 767733c01..51c5256a3 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -8,7 +8,6 @@ on: branches: - main - feat/napi-binding - - feat/react-native-core # Pull requests and every job below run read-only. Only the `release` and # `deploy-pages` jobs get write permissions, and they run on pushes to main From 6bf539326f75b8caaaeb4308e338ad4ce72a2e8b Mon Sep 17 00:00:00 2001 From: owjs3901 Date: Fri, 20 Nov 2026 19:11:02 +0900 Subject: [PATCH 07/40] feat(native): theme tokens, multiple themes and the React Native runtime Resolve `$` tokens and typography of devup.json at build time for React Native. With one theme every value is a literal and no runtime is imported; with more, each theme's styles are precomputed and picked by the index `useThemeIndex()` of the new `@devup-ui/react/native` runtime gives, which follows the OS appearance and `setTheme`. `_theme*` and the theme API compile, and `runtime: false` keeps them build errors. The Metro plugin registers devup.json's theme, and the Expo example gains a theme toggle and a bundle check that static files do not use the runtime. Part of #411. Co-Authored-By: Claude Opus 5.5 --- .../changepack_log_metro_plugin_themes.json | 7 + .../changepack_log_react_native_runtime.json | 7 + .../changepack_log_react_native_themes.json | 8 + .github/workflows/publish.yml | 8 +- apps/expo/check-bundle.mjs | 115 ++++- apps/expo/devup.json | 39 ++ apps/expo/src/App.tsx | 45 +- apps/expo/src/Badge.tsx | 18 + bun.lock | 49 +- libs/binding/src/lib.rs | 2 + libs/binding/src/native_theme.rs | 129 ++++++ libs/binding/src/output.rs | 12 +- libs/binding/tests/native.rs | 109 +++++ libs/extractor/src/lib.rs | 4 +- libs/extractor/src/native/element.rs | 420 ++++++++++++++++-- libs/extractor/src/native/errors.rs | 14 +- libs/extractor/src/native/imports.rs | 96 ++-- libs/extractor/src/native/mod.rs | 25 +- libs/extractor/src/native/props.rs | 127 +++++- .../extractor__native__tests__apis.snap | 6 +- ...extractor__native__tests__arrow_block.snap | 17 + ...ctor__native__tests__arrow_expression.snap | 16 + ...r__native__tests__arrow_parenthesized.snap | 16 + ..._native__tests__callback_in_component.snap | 16 + ...actor__native__tests__class_component.snap | 17 + ...tor__native__tests__declared_function.snap | 17 + ...__native__tests__export_default_arrow.snap | 16 + ...ative__tests__export_default_function.snap | 16 + ...__native__tests__export_default_value.snap | 13 + ...__native__tests__function_declaration.snap | 19 + ...actor__native__tests__helper_function.snap | 22 + .../extractor__native__tests__hook.snap | 23 + ...xtractor__native__tests__module_scope.snap | 20 + ...tor__native__tests__nested_components.snap | 22 + ...actor__native__tests__platform_shapes.snap | 12 +- ...tractor__native__tests__runtime_false.snap | 2 +- ..._native__tests__runtime_off_one_theme.snap | 23 + ...native__tests__runtime_off_two_themes.snap | 6 + ...xtractor__native__tests__runtime_true.snap | 2 +- ...r__native__tests__static_in_component.snap | 13 + ...ractor__native__tests__theme_api_none.snap | 13 + ...tractor__native__tests__theme_api_one.snap | 13 + ..._native__tests__theme_api_runtime_off.snap | 7 + ...tractor__native__tests__theme_api_two.snap | 13 + ...ctor__native__tests__theme_bad_values.snap | 6 + ..._native__tests__theme_name_collisions.snap | 18 + .../extractor__native__tests__theme_one.snap | 50 +++ ...ative__tests__theme_responsive_tokens.snap | 5 + ...ractor__native__tests__theme_selector.snap | 2 +- ...extractor__native__tests__theme_three.snap | 36 ++ ...extractor__native__tests__theme_token.snap | 2 +- ...ctor__native__tests__theme_token_loop.snap | 5 + .../extractor__native__tests__theme_two.snap | 87 ++++ ...or__native__tests__theme_typographies.snap | 9 + ...r__native__tests__theme_unknown_theme.snap | 6 + ...r__native__tests__theme_unknown_token.snap | 6 + .../extractor__native__tests__typography.snap | 2 +- .../extractor__native__tests__wrapped.snap | 25 ++ libs/extractor/src/native/style.rs | 175 ++++++-- libs/extractor/src/native/tests.rs | 398 ++++++++++++++++- libs/extractor/src/native/theme.rs | 186 ++++++++ libs/extractor/src/native/values.rs | 2 +- libs/sheet/src/theme.rs | 12 +- packages/metro-plugin/README.md | 55 ++- .../src/__tests__/transform.test.ts | 27 +- .../src/__tests__/transformer.test.ts | 20 + packages/metro-plugin/src/plugin.ts | 11 +- packages/metro-plugin/src/transform.ts | 9 +- packages/react/package.json | 14 +- packages/react/rollup.types.config.mjs | 1 + .../native/__tests__/index.browser.test.tsx | 125 ++++++ packages/react/src/native/index.ts | 106 +++++ packages/react/vite.config.ts | 1 + 73 files changed, 2773 insertions(+), 222 deletions(-) create mode 100644 .changepacks/changepack_log_metro_plugin_themes.json create mode 100644 .changepacks/changepack_log_react_native_runtime.json create mode 100644 .changepacks/changepack_log_react_native_themes.json create mode 100644 apps/expo/devup.json create mode 100644 apps/expo/src/Badge.tsx create mode 100644 libs/binding/src/native_theme.rs create mode 100644 libs/extractor/src/native/snapshots/extractor__native__tests__arrow_block.snap create mode 100644 libs/extractor/src/native/snapshots/extractor__native__tests__arrow_expression.snap create mode 100644 libs/extractor/src/native/snapshots/extractor__native__tests__arrow_parenthesized.snap create mode 100644 libs/extractor/src/native/snapshots/extractor__native__tests__callback_in_component.snap create mode 100644 libs/extractor/src/native/snapshots/extractor__native__tests__class_component.snap create mode 100644 libs/extractor/src/native/snapshots/extractor__native__tests__declared_function.snap create mode 100644 libs/extractor/src/native/snapshots/extractor__native__tests__export_default_arrow.snap create mode 100644 libs/extractor/src/native/snapshots/extractor__native__tests__export_default_function.snap create mode 100644 libs/extractor/src/native/snapshots/extractor__native__tests__export_default_value.snap create mode 100644 libs/extractor/src/native/snapshots/extractor__native__tests__function_declaration.snap create mode 100644 libs/extractor/src/native/snapshots/extractor__native__tests__helper_function.snap create mode 100644 libs/extractor/src/native/snapshots/extractor__native__tests__hook.snap create mode 100644 libs/extractor/src/native/snapshots/extractor__native__tests__module_scope.snap create mode 100644 libs/extractor/src/native/snapshots/extractor__native__tests__nested_components.snap create mode 100644 libs/extractor/src/native/snapshots/extractor__native__tests__runtime_off_one_theme.snap create mode 100644 libs/extractor/src/native/snapshots/extractor__native__tests__runtime_off_two_themes.snap create mode 100644 libs/extractor/src/native/snapshots/extractor__native__tests__static_in_component.snap create mode 100644 libs/extractor/src/native/snapshots/extractor__native__tests__theme_api_none.snap create mode 100644 libs/extractor/src/native/snapshots/extractor__native__tests__theme_api_one.snap create mode 100644 libs/extractor/src/native/snapshots/extractor__native__tests__theme_api_runtime_off.snap create mode 100644 libs/extractor/src/native/snapshots/extractor__native__tests__theme_api_two.snap create mode 100644 libs/extractor/src/native/snapshots/extractor__native__tests__theme_bad_values.snap create mode 100644 libs/extractor/src/native/snapshots/extractor__native__tests__theme_name_collisions.snap create mode 100644 libs/extractor/src/native/snapshots/extractor__native__tests__theme_one.snap create mode 100644 libs/extractor/src/native/snapshots/extractor__native__tests__theme_responsive_tokens.snap create mode 100644 libs/extractor/src/native/snapshots/extractor__native__tests__theme_three.snap create mode 100644 libs/extractor/src/native/snapshots/extractor__native__tests__theme_token_loop.snap create mode 100644 libs/extractor/src/native/snapshots/extractor__native__tests__theme_two.snap create mode 100644 libs/extractor/src/native/snapshots/extractor__native__tests__theme_typographies.snap create mode 100644 libs/extractor/src/native/snapshots/extractor__native__tests__theme_unknown_theme.snap create mode 100644 libs/extractor/src/native/snapshots/extractor__native__tests__theme_unknown_token.snap create mode 100644 libs/extractor/src/native/snapshots/extractor__native__tests__wrapped.snap create mode 100644 libs/extractor/src/native/theme.rs create mode 100644 packages/react/src/native/__tests__/index.browser.test.tsx create mode 100644 packages/react/src/native/index.ts diff --git a/.changepacks/changepack_log_metro_plugin_themes.json b/.changepacks/changepack_log_metro_plugin_themes.json new file mode 100644 index 000000000..99971187d --- /dev/null +++ b/.changepacks/changepack_log_metro_plugin_themes.json @@ -0,0 +1,7 @@ +{ + "changes": { + "packages/metro-plugin/package.json": "Minor" + }, + "note": "The Metro transformer registers the theme of devup.json (and its `extends` chain) with the engine, so `$` tokens, `typography`, `_theme*` and `useTheme`/`getTheme`/`setTheme` compile for React Native (part of #411).", + "date": "2026-11-20T00:00:00.000Z" +} diff --git a/.changepacks/changepack_log_react_native_runtime.json b/.changepacks/changepack_log_react_native_runtime.json new file mode 100644 index 000000000..d7239b692 --- /dev/null +++ b/.changepacks/changepack_log_react_native_runtime.json @@ -0,0 +1,7 @@ +{ + "changes": { + "packages/react/package.json": "Patch" + }, + "note": "Add `@devup-ui/react/native`, the React Native runtime the Metro build imports when a style differs by theme (part of #411). It only tells which theme shows (about 400 bytes minified and gzipped): the theme `setTheme` chose, else the dark theme while React Native's `Appearance` is dark, else the default theme. `useTheme`, `getTheme` and `setTheme` keep their web names, and `useTheme` reads a store with `useSyncExternalStore`. It reads no CSS and computes no style, and web builds never import it. `react-native` is an optional peer dependency.", + "date": "2026-11-20T00:00:00.000Z" +} diff --git a/.changepacks/changepack_log_react_native_themes.json b/.changepacks/changepack_log_react_native_themes.json new file mode 100644 index 000000000..304d50d90 --- /dev/null +++ b/.changepacks/changepack_log_react_native_themes.json @@ -0,0 +1,8 @@ +{ + "changes": { + "bindings/devup-ui-binding/package.json": "Patch", + "bindings/devup-ui-wasm/package.json": "Patch" + }, + "note": "`codeExtractNative` resolves the theme registered with `registerTheme` (part of #411): `$` color, length and shadow tokens and `typography` become the values React Native takes, a relative line height or letter spacing in pixels of the typography's font size. With one theme every value is a literal and the file imports no runtime. With more themes, the styles of each theme are precomputed into the file's `StyleSheet` and the element picks one by the index `useThemeIndex()` of `@devup-ui/react/native` gives, called at the top of the enclosing component or hook (an element outside one renders through the runtime's `Themed`); what does not differ by theme stays shared. `_theme*` applies its styles in that theme only, and `useTheme`, `getTheme` and `setTheme` import from the runtime. With `runtime: false` all of these that need the runtime are build errors, while a value of a single theme still compiles. A token or typography with a value at each breakpoint, and a `$` token devup.json does not define, are build errors. Web output is unchanged.", + "date": "2026-11-20T00:00:00.000Z" +} diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 51c5256a3..c1bd3a86b 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -8,6 +8,7 @@ on: branches: - main - feat/napi-binding + - feat/react-native-metro # Pull requests and every job below run read-only. Only the `release` and # `deploy-pages` jobs get write permissions, and they run on pushes to main @@ -921,7 +922,7 @@ jobs: fi files="$(git diff --name-only "$(git merge-base "$BASE" HEAD)" HEAD)" echo "$files" - if grep -qE '^(libs/extractor/src/native/|libs/binding/|bindings/devup-ui-(binding|wasm)/|packages/(metro-plugin|plugin-utils)/|apps/expo/|\.github/workflows/publish\.yml$)' <<< "$files"; then + if grep -qE '^(libs/extractor/src/native/|libs/binding/|bindings/devup-ui-(binding|wasm)/|packages/(metro-plugin|plugin-utils)/|packages/react/src/native/|apps/expo/|\.github/workflows/publish\.yml$)' <<< "$files"; then echo "changed=true" >> "$GITHUB_OUTPUT" else echo "changed=false" >> "$GITHUB_OUTPUT" @@ -929,8 +930,9 @@ jobs: # The Expo example app (apps/expo) bundled for iOS and Android through # @devup-ui/metro-plugin, as a release build does. Devup UI compiles away, - # so no bundle may keep a module of @devup-ui/react or its runtime - # placeholder. + # so no bundle may keep a module of @devup-ui/react but its React Native + # runtime (`@devup-ui/react/native`), nor its runtime placeholder, and a + # file styled the same in every theme must not use that runtime. expo: needs: [build, native-changes] if: needs.native-changes.outputs.changed == 'true' diff --git a/apps/expo/check-bundle.mjs b/apps/expo/check-bundle.mjs index bed164e51..913534639 100644 --- a/apps/expo/check-bundle.mjs +++ b/apps/expo/check-bundle.mjs @@ -1,14 +1,87 @@ // Checks the bundles `expo export` wrote to dist/ for iOS and Android: Devup // UI compiled away at build time, so no bundle may hold the runtime -// placeholders of @devup-ui/react or any module of that package, and the -// styles of src/App.tsx must be there as React Native style objects. +// placeholders of @devup-ui/react or any module of that package but its React +// Native runtime (`@devup-ui/react/native`), and the styles of src/App.tsx +// must be there as React Native style objects. src/App.tsx reads the theme, +// so it uses the runtime; src/Badge.tsx is styled the same in every theme, so +// it must not. import { readdirSync, readFileSync } from 'node:fs' import { join } from 'node:path' const PLACEHOLDER = 'Cannot run on the runtime' +/** Names of the runtime that only code using it holds, as minified code keeps them */ +const RUNTIME_NAMES = /\b(?:defineThemes|useThemeIndex)\b/g +/** Modules of @devup-ui/react, by the path Metro resolves */ +const REACT_PACKAGE = /(^|[\\/])(@devup-ui[\\/]react|packages[\\/]react)[\\/]/ +/** The React Native runtime among them */ +const NATIVE_RUNTIME = + /(^|[\\/])(@devup-ui[\\/]react|packages[\\/]react)[\\/]dist[\\/]native[\\/]/ const root = join(import.meta.dirname, 'dist', '_expo', 'static', 'js') const failures = [] +const BASE64 = + 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/' + +/** Each generated line of `mappings`, as its segments' [column, source index] */ +function decodeMappings(mappings) { + let source = 0 + return mappings.split(';').map((line) => { + let column = 0 + const segments = [] + for (const segment of line.split(',')) { + if (!segment) continue + const fields = [] + let value = 0 + let shift = 0 + for (const character of segment) { + const digit = BASE64.indexOf(character) + value += (digit & 31) << shift + if (digit & 32) { + shift += 5 + } else { + fields.push(value & 1 ? -(value >>> 1) : value >>> 1) + value = 0 + shift = 0 + } + } + column += fields[0] + if (fields.length > 1) { + source += fields[1] + segments.push([column, source]) + } + } + return segments + }) +} + +/** A function telling the source a generated line and column come from */ +function sourceLocator(map) { + if (map.sections) { + const sections = map.sections.map(({ offset, map }) => ({ + offset, + locate: sourceLocator(map), + })) + return (line, column) => { + const section = sections.findLast( + ({ offset }) => + offset.line < line || + (offset.line === line && offset.column <= column), + ) + if (!section) return null + const { offset } = section + return section.locate( + line - offset.line, + line === offset.line ? column - offset.column : column, + ) + } + } + const lines = decodeMappings(map.mappings) + return (line, column) => { + const segment = lines[line]?.findLast(([start]) => start <= column) + return segment ? map.sources[segment[1]] : null + } +} + /** The sources of a source map, an indexed one (Metro's) included */ function mapSources(map) { return map.sections @@ -16,6 +89,19 @@ function mapSources(map) { : map.sources } +/** The sources of the code that names the runtime */ +function runtimeUsers(code, locate) { + const users = new Set() + code.split('\n').forEach((line, index) => { + for (const match of line.matchAll(RUNTIME_NAMES)) { + users.add(locate(index, match.index)) + } + }) + return [...users].filter( + (source) => source !== null && !NATIVE_RUNTIME.test(source), + ) +} + for (const platform of ['ios', 'android']) { const directory = join(root, platform) const bundles = readdirSync(directory).filter((file) => file.endsWith('.js')) @@ -30,17 +116,30 @@ for (const platform of ['ios', 'android']) { failures.push(`${platform}/${file}: lacks ${style}`) } } - const sources = mapSources( - JSON.parse(readFileSync(join(directory, `${file}.map`), 'utf-8')), + const map = JSON.parse( + readFileSync(join(directory, `${file}.map`), 'utf-8'), ) + const sources = mapSources(map) for (const source of sources) { - if ( - /(^|[\\/])(@devup-ui[\\/]react|packages[\\/]react)[\\/]/.test(source) - ) { + if (REACT_PACKAGE.test(source) && !NATIVE_RUNTIME.test(source)) { failures.push(`${platform}/${file}: bundles ${source}`) } } - console.info(`${platform}/${file}: ${sources.length} modules, checked`) + if (!sources.some((source) => NATIVE_RUNTIME.test(source))) { + failures.push(`${platform}/${file}: lacks @devup-ui/react/native`) + } + const users = runtimeUsers(code, sourceLocator(map)) + if (!users.some((source) => /src[\\/]App\.tsx$/.test(source))) { + failures.push(`${platform}/${file}: src/App.tsx does not use the runtime`) + } + for (const source of users.filter((source) => + /src[\\/]Badge\.tsx$/.test(source), + )) { + failures.push(`${platform}/${file}: ${source} uses the runtime`) + } + console.info( + `${platform}/${file}: ${sources.length} modules, runtime used by ${users.join(', ')}`, + ) } } diff --git a/apps/expo/devup.json b/apps/expo/devup.json new file mode 100644 index 000000000..a3a26daa2 --- /dev/null +++ b/apps/expo/devup.json @@ -0,0 +1,39 @@ +{ + "theme": { + "colors": { + "light": { + "background": "#f6f7fb", + "card": "#fff", + "text": "#1a1a2e", + "muted": "#555", + "border": "#ccc", + "placeholder": "#999" + }, + "dark": { + "background": "#12121c", + "card": "#1f1f2e", + "text": "#f2f2f7", + "muted": "#a0a0b8", + "border": "#3a3a4e", + "placeholder": "#6a6a80" + } + }, + "length": { + "default": { + "radius": ["12px"] + } + }, + "shadow": { + "default": { + "raised": ["0 2px 8px #0002"] + } + }, + "typography": { + "title": { + "fontSize": "24px", + "fontWeight": 700, + "lineHeight": 1.3 + } + } + } +} diff --git a/apps/expo/src/App.tsx b/apps/expo/src/App.tsx index cfc2850ad..4834b1d6c 100644 --- a/apps/expo/src/App.tsx +++ b/apps/expo/src/App.tsx @@ -1,13 +1,25 @@ -import { Box, Button, Flex, Image, Input, Text } from '@devup-ui/react' +import { + Box, + Button, + Flex, + Image, + Input, + setTheme, + Text, + useTheme, +} from '@devup-ui/react' import { useState } from 'react' +import { Badge } from './Badge' + export function App() { const [name, setName] = useState('') const [count, setCount] = useState(0) + const theme = useTheme() return ( - + Devup UI on React Native - - + + + Your name - + {name ? `Hello, ${name}` : 'Type your name'} @@ -56,6 +64,17 @@ export function App() { Pressed {count} times + ) } diff --git a/apps/expo/src/Badge.tsx b/apps/expo/src/Badge.tsx new file mode 100644 index 000000000..abc21d682 --- /dev/null +++ b/apps/expo/src/Badge.tsx @@ -0,0 +1,18 @@ +import { Text } from '@devup-ui/react' + +/** Styles the same in every theme, so it compiles without the runtime */ +export function Badge({ label }: { label: string }) { + return ( + + {label} + + ) +} diff --git a/bun.lock b/bun.lock index dcdb5bfad..566cd7605 100644 --- a/bun.lock +++ b/bun.lock @@ -751,6 +751,7 @@ "@types/react": "^19.3.0", "@typescript/typescript6": "^6.0.2", "react": "^19.3.1", + "react-native": "0.88.1", "rollup": "^4.68.7", "rollup-plugin-dts": "^6.5.1", "rollup-plugin-preserve-directives": "^0.4.0", @@ -761,7 +762,11 @@ "peerDependencies": { "csstype-extra": "*", "react": "^18 || ^19", + "react-native": "*", }, + "optionalPeers": [ + "react-native", + ], }, "packages/reset-css": { "name": "@devup-ui/reset-css", @@ -3055,7 +3060,7 @@ "metro-source-map": ["metro-source-map@0.87.3", "", { "dependencies": { "@babel/core": "^7.25.2", "@babel/traverse": "^7.29.10", "@babel/types": "^7.29.8", "flow-enums-runtime": "^0.0.6", "invariant": "^2.2.4", "metro-symbolicate": "0.87.3", "nullthrows": "^1.1.1", "ob1": "0.87.3", "source-map": "^0.5.6" } }, "sha512-kvgC0nIP1emXDiMLhmcy1AOxZrfPMWxrvYqOMNVXvKbObtakGXqu60WpeSVlzo3VBfXCMmZDBz1SvsP80Ug+kQ=="], - "metro-symbolicate": ["metro-symbolicate@0.87.1", "", { "dependencies": { "flow-enums-runtime": "^0.0.6", "invariant": "^2.2.4", "metro-source-map": "0.87.1", "nullthrows": "^1.1.1", "source-map": "^0.5.6", "vlq": "^1.0.0" }, "bin": { "metro-symbolicate": "src/index.js" } }, "sha512-rcGvwabrg0lbXGRGRKl14PY3My3+dkno2jZYhdJEuH2DmjTtTkV5bYwgto4JtV/Lbe+sXE6GO1UGg654430uow=="], + "metro-symbolicate": ["metro-symbolicate@0.87.3", "", { "dependencies": { "flow-enums-runtime": "^0.0.6", "invariant": "^2.2.4", "metro-source-map": "0.87.3", "nullthrows": "^1.1.1", "source-map": "^0.5.6", "vlq": "^1.0.0" }, "bin": { "metro-symbolicate": "src/index.js" } }, "sha512-koHM4gA6iE7OSYACKvJCg/N/9QK6i7vrA3l4gMKtK1Z7XfQVixtWiUTqf+XTkGdVTjioHmlTF/MmG+BmfL301w=="], "metro-transform-plugins": ["metro-transform-plugins@0.87.1", "", { "dependencies": { "@babel/core": "^7.25.2", "@babel/generator": "^7.29.1", "@babel/template": "^7.28.6", "@babel/traverse": "^7.29.0", "flow-enums-runtime": "^0.0.6", "nullthrows": "^1.1.1" } }, "sha512-qMiJ/x+VfqumFJJSefKS6nj8uojzC29b2/aK8vlMuFABIqGjDucICEOXd2Yt6k/XMFAgAcaJvShUOT0HLyYaPw=="], @@ -3127,7 +3132,7 @@ "mime-db": ["mime-db@1.54.0", "", {}, "sha512-aU5EJuIN2WDemCcAp2vFBfp/m4EAhWJnUNSSw0ixs7/kXbd6Pg64EmwJkNdFhB8aWt1sH2CTXrLxo/iAGV3oPQ=="], - "mime-types": ["mime-types@2.1.35", "", { "dependencies": { "mime-db": "1.52.0" } }, "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw=="], + "mime-types": ["mime-types@3.0.2", "", { "dependencies": { "mime-db": "^1.54.0" } }, "sha512-Lbgzdk0h4juoQ9fCKXW4by0UJqj+nOOrI9MJ1sSj4nI8aI2eo1qmvQEie4VD1glsS250n15LsWsYtCugiStS5A=="], "mimic-fn": ["mimic-fn@1.2.0", "", {}, "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ=="], @@ -3555,7 +3560,7 @@ "stringify-entities": ["stringify-entities@4.0.4", "", { "dependencies": { "character-entities-html4": "^2.0.0", "character-entities-legacy": "^3.0.0" } }, "sha512-IwfBptatlO+QCJUo19AqvrPNqlVMpW9YEL2LIVY+Rpv2qsjCGxaDLNRgeGsQWJhfItebuJhsGSLjaBbNSQ+ieg=="], - "strip-ansi": ["strip-ansi@5.2.0", "", { "dependencies": { "ansi-regex": "^4.1.0" } }, "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA=="], + "strip-ansi": ["strip-ansi@6.0.1", "", { "dependencies": { "ansi-regex": "^5.0.1" } }, "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A=="], "strip-ansi-cjs": ["strip-ansi@6.0.1", "", { "dependencies": { "ansi-regex": "^5.0.1" } }, "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A=="], @@ -4225,6 +4230,8 @@ "@expo/metro/metro-source-map": ["metro-source-map@0.87.1", "", { "dependencies": { "@babel/traverse": "^7.29.0", "@babel/types": "^7.29.0", "flow-enums-runtime": "^0.0.6", "invariant": "^2.2.4", "metro-symbolicate": "0.87.1", "nullthrows": "^1.1.1", "ob1": "0.87.1", "source-map": "^0.5.6", "vlq": "^1.0.0" } }, "sha512-Bqpm0PBGdy53pigIJb4HRF7QxD2pUOdgSmVh/4AWbP635kSCv+Y6ltVxUZgSnzS/QbSmzyCGijmRPlXMj2/qHw=="], + "@expo/metro/metro-symbolicate": ["metro-symbolicate@0.87.1", "", { "dependencies": { "flow-enums-runtime": "^0.0.6", "invariant": "^2.2.4", "metro-source-map": "0.87.1", "nullthrows": "^1.1.1", "source-map": "^0.5.6", "vlq": "^1.0.0" }, "bin": { "metro-symbolicate": "src/index.js" } }, "sha512-rcGvwabrg0lbXGRGRKl14PY3My3+dkno2jZYhdJEuH2DmjTtTkV5bYwgto4JtV/Lbe+sXE6GO1UGg654430uow=="], + "@expo/metro-config/@babel/code-frame": ["@babel/code-frame@7.29.7", "", { "dependencies": { "@babel/helper-validator-identifier": "^7.29.7", "js-tokens": "^4.0.0", "picocolors": "^1.1.1" } }, "sha512-Aup7aUOfpbAUg2ROOJN6Iw5f9DMBlzu0mIkm/malLQFN/YQgO48wCj0Kxa3sEHJvPVFg7siR+qRInwXd2qhQKw=="], "@expo/metro-config/@babel/core": ["@babel/core@7.29.13", "", { "dependencies": { "@babel/code-frame": "^7.29.7", "@babel/generator": "^7.29.13", "@babel/helper-compilation-targets": "^7.29.13", "@babel/helper-module-transforms": "^7.29.13", "@babel/helpers": "^7.29.13", "@babel/parser": "^7.29.13", "@babel/template": "^7.29.7", "@babel/traverse": "^7.29.13", "@babel/types": "^7.29.11", "@jridgewell/remapping": "^2.3.5", "convert-source-map": "^2.0.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.2", "json5": "^2.2.3", "semver": "^6.3.1" } }, "sha512-j1nvOQCZYSgp7HLmisnCXFTpVvFODiijQ9QHkORfGKWH6YDtskTEeCJS7eV545GZ9UBzrq0e2xsOd5QQ5PjIqw=="], @@ -4361,6 +4368,8 @@ "@vanilla-extract/integration/@babel/plugin-syntax-typescript": ["@babel/plugin-syntax-typescript@7.29.7", "", { "dependencies": { "@babel/helper-plugin-utils": "^7.29.7" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-ngr+82Sh0xMz25TPCZi+nC2iTzjfCdWS2ONXTp/PtSCHCgaCNBpdMqgvJ2ccdLlClVZ7sisIgB914j/JFe+RZA=="], + "accepts/mime-types": ["mime-types@2.1.35", "", { "dependencies": { "mime-db": "1.52.0" } }, "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw=="], + "accepts/negotiator": ["negotiator@0.6.3", "", {}, "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg=="], "ajv-formats/ajv": ["ajv@8.20.0", "", { "dependencies": { "fast-deep-equal": "^3.1.3", "fast-uri": "^3.0.1", "json-schema-traverse": "^1.0.0", "require-from-string": "^2.0.2" } }, "sha512-Thbli+OlOj+iMPYFBVBfJ3OmCAnaSyNn4M1vz9T6Gka5Jt9ba/HIR56joy65tY6kx/FCF5VXNB819Y7/GUrBGA=="], @@ -4387,8 +4396,6 @@ "chalk/supports-color": ["supports-color@7.2.0", "", { "dependencies": { "has-flag": "^4.0.0" } }, "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw=="], - "cliui/strip-ansi": ["strip-ansi@6.0.1", "", { "dependencies": { "ansi-regex": "^5.0.1" } }, "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A=="], - "compression/debug": ["debug@2.6.9", "", { "dependencies": { "ms": "2.0.0" } }, "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA=="], "compression/negotiator": ["negotiator@0.6.4", "", {}, "sha512-myRT3DiWPHqho5PrJaIRyaMv2kgYf0mUVgBNOYMuCH5Ki1yEiQaf/ZJuQ62nvpc44wL5WDbTX7yGJi1Neevw8w=="], @@ -4461,7 +4468,7 @@ "metro/metro-source-map": ["metro-source-map@0.87.1", "", { "dependencies": { "@babel/traverse": "^7.29.0", "@babel/types": "^7.29.0", "flow-enums-runtime": "^0.0.6", "invariant": "^2.2.4", "metro-symbolicate": "0.87.1", "nullthrows": "^1.1.1", "ob1": "0.87.1", "source-map": "^0.5.6", "vlq": "^1.0.0" } }, "sha512-Bqpm0PBGdy53pigIJb4HRF7QxD2pUOdgSmVh/4AWbP635kSCv+Y6ltVxUZgSnzS/QbSmzyCGijmRPlXMj2/qHw=="], - "metro/mime-types": ["mime-types@3.0.2", "", { "dependencies": { "mime-db": "^1.54.0" } }, "sha512-Lbgzdk0h4juoQ9fCKXW4by0UJqj+nOOrI9MJ1sSj4nI8aI2eo1qmvQEie4VD1glsS250n15LsWsYtCugiStS5A=="], + "metro/metro-symbolicate": ["metro-symbolicate@0.87.1", "", { "dependencies": { "flow-enums-runtime": "^0.0.6", "invariant": "^2.2.4", "metro-source-map": "0.87.1", "nullthrows": "^1.1.1", "source-map": "^0.5.6", "vlq": "^1.0.0" }, "bin": { "metro-symbolicate": "src/index.js" } }, "sha512-rcGvwabrg0lbXGRGRKl14PY3My3+dkno2jZYhdJEuH2DmjTtTkV5bYwgto4JtV/Lbe+sXE6GO1UGg654430uow=="], "metro/source-map": ["source-map@0.5.7", "", {}, "sha512-LbrmJOMUSdEVxIKvdcJzQC+nQhe8FUZQTXQy6+I75skNgn3OoQ0DZA8YnFa7gp8tqtL3KPf1kmo0R5DoApeSGQ=="], @@ -4475,12 +4482,8 @@ "metro-source-map/@babel/core": ["@babel/core@7.29.13", "", { "dependencies": { "@babel/code-frame": "^7.29.7", "@babel/generator": "^7.29.13", "@babel/helper-compilation-targets": "^7.29.13", "@babel/helper-module-transforms": "^7.29.13", "@babel/helpers": "^7.29.13", "@babel/parser": "^7.29.13", "@babel/template": "^7.29.7", "@babel/traverse": "^7.29.13", "@babel/types": "^7.29.11", "@jridgewell/remapping": "^2.3.5", "convert-source-map": "^2.0.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.2", "json5": "^2.2.3", "semver": "^6.3.1" } }, "sha512-j1nvOQCZYSgp7HLmisnCXFTpVvFODiijQ9QHkORfGKWH6YDtskTEeCJS7eV545GZ9UBzrq0e2xsOd5QQ5PjIqw=="], - "metro-source-map/metro-symbolicate": ["metro-symbolicate@0.87.3", "", { "dependencies": { "flow-enums-runtime": "^0.0.6", "invariant": "^2.2.4", "metro-source-map": "0.87.3", "nullthrows": "^1.1.1", "source-map": "^0.5.6", "vlq": "^1.0.0" }, "bin": { "metro-symbolicate": "src/index.js" } }, "sha512-koHM4gA6iE7OSYACKvJCg/N/9QK6i7vrA3l4gMKtK1Z7XfQVixtWiUTqf+XTkGdVTjioHmlTF/MmG+BmfL301w=="], - "metro-source-map/source-map": ["source-map@0.5.7", "", {}, "sha512-LbrmJOMUSdEVxIKvdcJzQC+nQhe8FUZQTXQy6+I75skNgn3OoQ0DZA8YnFa7gp8tqtL3KPf1kmo0R5DoApeSGQ=="], - "metro-symbolicate/metro-source-map": ["metro-source-map@0.87.1", "", { "dependencies": { "@babel/traverse": "^7.29.0", "@babel/types": "^7.29.0", "flow-enums-runtime": "^0.0.6", "invariant": "^2.2.4", "metro-symbolicate": "0.87.1", "nullthrows": "^1.1.1", "ob1": "0.87.1", "source-map": "^0.5.6", "vlq": "^1.0.0" } }, "sha512-Bqpm0PBGdy53pigIJb4HRF7QxD2pUOdgSmVh/4AWbP635kSCv+Y6ltVxUZgSnzS/QbSmzyCGijmRPlXMj2/qHw=="], - "metro-symbolicate/source-map": ["source-map@0.5.7", "", {}, "sha512-LbrmJOMUSdEVxIKvdcJzQC+nQhe8FUZQTXQy6+I75skNgn3OoQ0DZA8YnFa7gp8tqtL3KPf1kmo0R5DoApeSGQ=="], "metro-transform-plugins/@babel/core": ["@babel/core@7.29.13", "", { "dependencies": { "@babel/code-frame": "^7.29.7", "@babel/generator": "^7.29.13", "@babel/helper-compilation-targets": "^7.29.13", "@babel/helper-module-transforms": "^7.29.13", "@babel/helpers": "^7.29.13", "@babel/parser": "^7.29.13", "@babel/template": "^7.29.7", "@babel/traverse": "^7.29.13", "@babel/types": "^7.29.11", "@jridgewell/remapping": "^2.3.5", "convert-source-map": "^2.0.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.2", "json5": "^2.2.3", "semver": "^6.3.1" } }, "sha512-j1nvOQCZYSgp7HLmisnCXFTpVvFODiijQ9QHkORfGKWH6YDtskTEeCJS7eV545GZ9UBzrq0e2xsOd5QQ5PjIqw=="], @@ -4499,8 +4502,6 @@ "micromatch/picomatch": ["picomatch@2.3.2", "", {}, "sha512-V7+vQEJ06Z+c5tSye8S+nHUfI51xoXIXjHQ99cQtKUkQqqO1kO/KCJUfZXuB47h/YBlDhah2H3hdUGXn8ie0oA=="], - "mime-types/mime-db": ["mime-db@1.52.0", "", {}, "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg=="], - "mlly/pkg-types": ["pkg-types@1.3.1", "", { "dependencies": { "confbox": "^0.1.8", "mlly": "^1.7.4", "pathe": "^2.0.1" } }, "sha512-/Jm5M4RvtBFVkKWRu2BLUTNP8/M2a+UwuAX+ae4770q1qVGtfjG+WTCupoZixokjmHiry8uI+dlY8KXYV5HVVQ=="], "next/postcss": ["postcss@8.5.23", "", { "dependencies": { "nanoid": "^3.3.16", "picocolors": "^1.1.1", "source-map-js": "^1.2.1" } }, "sha512-g50586zr4bZmwFiTlflMu8E0bDTb5I5gertgwAKmsdUlTQIhZtunzUlD1WSzwcVWPoAVpsrA6vlfCD7oXvRwgg=="], @@ -4511,6 +4512,8 @@ "ora/chalk": ["chalk@2.4.2", "", { "dependencies": { "ansi-styles": "^3.2.1", "escape-string-regexp": "^1.0.5", "supports-color": "^5.3.0" } }, "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ=="], + "ora/strip-ansi": ["strip-ansi@5.2.0", "", { "dependencies": { "ansi-regex": "^4.1.0" } }, "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA=="], + "parse-entities/@types/unist": ["@types/unist@2.0.11", "", {}, "sha512-CmBKiL6NNo/OqgmMn95Fk9Whlp2mtvIv+KNpQKN2F4SjvrEesubTRWGYSg+BnWZOnlCaSTU1sMpsBOzgbYhnsA=="], "parse-json/@babel/code-frame": ["@babel/code-frame@7.29.7", "", { "dependencies": { "@babel/helper-validator-identifier": "^7.29.7", "js-tokens": "^4.0.0", "picocolors": "^1.1.1" } }, "sha512-Aup7aUOfpbAUg2ROOJN6Iw5f9DMBlzu0mIkm/malLQFN/YQgO48wCj0Kxa3sEHJvPVFg7siR+qRInwXd2qhQKw=="], @@ -4565,12 +4568,6 @@ "source-map-support/source-map": ["source-map@0.6.1", "", {}, "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g=="], - "string-width/strip-ansi": ["strip-ansi@6.0.1", "", { "dependencies": { "ansi-regex": "^5.0.1" } }, "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A=="], - - "string-width-cjs/strip-ansi": ["strip-ansi@6.0.1", "", { "dependencies": { "ansi-regex": "^5.0.1" } }, "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A=="], - - "strip-ansi/ansi-regex": ["ansi-regex@4.1.1", "", {}, "sha512-ILlv4k/3f6vfQ4OoP2AGvirOktlQ98ZEL1k9FaQjxa3L1abBgbuTDAdPOpvbGncC0BTVQrl+OM8xZGK6tWXt7g=="], - "style-to-js/style-to-object": ["style-to-object@1.0.14", "", { "dependencies": { "inline-style-parser": "0.2.7" } }, "sha512-LIN7rULI0jBscWQYaSswptyderlarFkjQ+t79nzty8tcIAceVomEVlLzH5VP4Cmsv6MtKhs7qaAiwlcp+Mgaxw=="], "supports-hyperlinks/supports-color": ["supports-color@7.2.0", "", { "dependencies": { "has-flag": "^4.0.0" } }, "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw=="], @@ -4609,12 +4606,8 @@ "wrap-ansi/ansi-styles": ["ansi-styles@4.3.0", "", { "dependencies": { "color-convert": "^2.0.1" } }, "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg=="], - "wrap-ansi/strip-ansi": ["strip-ansi@6.0.1", "", { "dependencies": { "ansi-regex": "^5.0.1" } }, "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A=="], - "wrap-ansi-cjs/ansi-styles": ["ansi-styles@4.3.0", "", { "dependencies": { "color-convert": "^2.0.1" } }, "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg=="], - "wrap-ansi-cjs/strip-ansi": ["strip-ansi@6.0.1", "", { "dependencies": { "ansi-regex": "^5.0.1" } }, "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A=="], - "xml2js/xmlbuilder": ["xmlbuilder@11.0.1", "", {}, "sha512-fDlsI/kFEx7gLvbecc0/ohLG50fugQp8ryHzMTuW9vSa1GJ0XYWKnhsUx7oie3G98+r56aTQIUB4kht42R3JvA=="], "@babel/core/@babel/traverse/@babel/helper-globals": ["@babel/helper-globals@8.0.6", "", {}, "sha512-OdnA/N52LhzFpeUuVz5YGuSWjc7TPHiFmVYZbPlSgExocO2GwbxVpSni9MVs5wwW+wZ4kPuwBEBN9pIPDYz1mA=="], @@ -6057,6 +6050,8 @@ "@expo/metro/metro-source-map/source-map": ["source-map@0.5.7", "", {}, "sha512-LbrmJOMUSdEVxIKvdcJzQC+nQhe8FUZQTXQy6+I75skNgn3OoQ0DZA8YnFa7gp8tqtL3KPf1kmo0R5DoApeSGQ=="], + "@expo/metro/metro-symbolicate/source-map": ["source-map@0.5.7", "", {}, "sha512-LbrmJOMUSdEVxIKvdcJzQC+nQhe8FUZQTXQy6+I75skNgn3OoQ0DZA8YnFa7gp8tqtL3KPf1kmo0R5DoApeSGQ=="], + "@expo/require-utils/@babel/code-frame/js-tokens": ["js-tokens@4.0.0", "", {}, "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ=="], "@expo/require-utils/@babel/core/@babel/generator": ["@babel/generator@7.29.14", "", { "dependencies": { "@babel/parser": "^7.29.14", "@babel/types": "^7.29.14", "@jridgewell/gen-mapping": "^0.3.12", "@jridgewell/trace-mapping": "^0.3.28", "jsesc": "^3.0.2" } }, "sha512-qSY56jgW5JnSXzuekLVil6zaOQxOCtOHidr65KkaMBw772IuAY28Qx4ZykAcDn8+FRF15qk80XzKwgSc/RYW6g=="], @@ -6293,6 +6288,8 @@ "@vanilla-extract/integration/@babel/plugin-syntax-typescript/@babel/helper-plugin-utils": ["@babel/helper-plugin-utils@7.29.7", "", {}, "sha512-G7sHYigPY17oO5SYWnfD/0MTBwVR781S/JI643e/JhUYgVgWE/61SoW3NH9KWUKyKq5LVh3npif99Wkt6j86Jw=="], + "accepts/mime-types/mime-db": ["mime-db@1.52.0", "", {}, "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg=="], + "ajv-formats/ajv/json-schema-traverse": ["json-schema-traverse@1.0.0", "", {}, "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug=="], "babel-loader/@babel/core/@babel/code-frame": ["@babel/code-frame@7.29.7", "", { "dependencies": { "@babel/helper-validator-identifier": "^7.29.7", "js-tokens": "^4.0.0", "picocolors": "^1.1.1" } }, "sha512-Aup7aUOfpbAUg2ROOJN6Iw5f9DMBlzu0mIkm/malLQFN/YQgO48wCj0Kxa3sEHJvPVFg7siR+qRInwXd2qhQKw=="], @@ -6433,8 +6430,6 @@ "metro-source-map/@babel/core/semver": ["semver@6.3.2", "", { "bin": { "semver": "bin/semver.js" } }, "sha512-GYrCADwpu6yV5OAvchkQ27Z5wwMxWAEMg5NNWjyHh/5DboFFqbdbvYNIvZouQpxXyeMPoTOh0vdPYKlf0ZswdQ=="], - "metro-symbolicate/metro-source-map/ob1": ["ob1@0.87.1", "", { "dependencies": { "flow-enums-runtime": "^0.0.6" } }, "sha512-i8iA8uij0g1YQzS8uOJPSRCgwDjO9warIHUAu1Fqj877Wc3wlfxDYBioYWgKTBF2+URVJttyDWSEpmd99nlvtQ=="], - "metro-transform-plugins/@babel/core/@babel/code-frame": ["@babel/code-frame@7.29.7", "", { "dependencies": { "@babel/helper-validator-identifier": "^7.29.7", "js-tokens": "^4.0.0", "picocolors": "^1.1.1" } }, "sha512-Aup7aUOfpbAUg2ROOJN6Iw5f9DMBlzu0mIkm/malLQFN/YQgO48wCj0Kxa3sEHJvPVFg7siR+qRInwXd2qhQKw=="], "metro-transform-plugins/@babel/core/@babel/helper-compilation-targets": ["@babel/helper-compilation-targets@7.29.13", "", { "dependencies": { "@babel/compat-data": "^7.29.7", "@babel/helper-validator-option": "^7.29.7", "browserslist": "^4.24.0", "lru-cache": "^5.1.1", "semver": "^6.3.1" } }, "sha512-8WxJ4/Vmes3ghacj8VOJy3NW8eyHiFY/4thU/LSBuBE470+igjR/j1ZTNn8fV5VdNrLx6iXUwig526UdOvfP0w=="], @@ -6465,6 +6460,8 @@ "metro-transform-worker/@babel/core/semver": ["semver@6.3.2", "", { "bin": { "semver": "bin/semver.js" } }, "sha512-GYrCADwpu6yV5OAvchkQ27Z5wwMxWAEMg5NNWjyHh/5DboFFqbdbvYNIvZouQpxXyeMPoTOh0vdPYKlf0ZswdQ=="], + "metro-transform-worker/metro-source-map/metro-symbolicate": ["metro-symbolicate@0.87.1", "", { "dependencies": { "flow-enums-runtime": "^0.0.6", "invariant": "^2.2.4", "metro-source-map": "0.87.1", "nullthrows": "^1.1.1", "source-map": "^0.5.6", "vlq": "^1.0.0" }, "bin": { "metro-symbolicate": "src/index.js" } }, "sha512-rcGvwabrg0lbXGRGRKl14PY3My3+dkno2jZYhdJEuH2DmjTtTkV5bYwgto4JtV/Lbe+sXE6GO1UGg654430uow=="], + "metro-transform-worker/metro-source-map/ob1": ["ob1@0.87.1", "", { "dependencies": { "flow-enums-runtime": "^0.0.6" } }, "sha512-i8iA8uij0g1YQzS8uOJPSRCgwDjO9warIHUAu1Fqj877Wc3wlfxDYBioYWgKTBF2+URVJttyDWSEpmd99nlvtQ=="], "metro-transform-worker/metro-source-map/source-map": ["source-map@0.5.7", "", {}, "sha512-LbrmJOMUSdEVxIKvdcJzQC+nQhe8FUZQTXQy6+I75skNgn3OoQ0DZA8YnFa7gp8tqtL3KPf1kmo0R5DoApeSGQ=="], @@ -6495,6 +6492,8 @@ "ora/chalk/supports-color": ["supports-color@5.5.0", "", { "dependencies": { "has-flag": "^3.0.0" } }, "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow=="], + "ora/strip-ansi/ansi-regex": ["ansi-regex@4.1.1", "", {}, "sha512-ILlv4k/3f6vfQ4OoP2AGvirOktlQ98ZEL1k9FaQjxa3L1abBgbuTDAdPOpvbGncC0BTVQrl+OM8xZGK6tWXt7g=="], + "parse-json/@babel/code-frame/js-tokens": ["js-tokens@4.0.0", "", {}, "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ=="], "pkg-dir/find-up/locate-path": ["locate-path@7.2.0", "", { "dependencies": { "p-locate": "^6.0.0" } }, "sha512-gvVijfZvn7R+2qyPX8mAuKcFGDf6Nc61GdvGafQsHL0sBIxfKzA+usWn4GFC/bk+QdwPUD4kWFJLhElipq+0VA=="], @@ -7217,8 +7216,6 @@ "ts_dependency_graph/glob/minimatch/brace-expansion": ["brace-expansion@1.1.22", "", { "dependencies": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" } }, "sha512-CKLDTuSsN0+r1ThM0WkzzBI7dnPI6xEGfa/JnVYIK9JNBA1N1NyPwXVHor//NKD/y3sDxp764sZdLhFK7pH8XQ=="], - "ts_dependency_graph/yargs/cliui/strip-ansi": ["strip-ansi@6.0.1", "", { "dependencies": { "ansi-regex": "^5.0.1" } }, "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A=="], - "ts_dependency_graph/yargs/cliui/wrap-ansi": ["wrap-ansi@6.2.0", "", { "dependencies": { "ansi-styles": "^4.0.0", "string-width": "^4.1.0", "strip-ansi": "^6.0.0" } }, "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA=="], "ts_dependency_graph/yargs/find-up/locate-path": ["locate-path@5.0.0", "", { "dependencies": { "p-locate": "^4.1.0" } }, "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g=="], diff --git a/libs/binding/src/lib.rs b/libs/binding/src/lib.rs index 9a8944e5a..ccfad999c 100644 --- a/libs/binding/src/lib.rs +++ b/libs/binding/src/lib.rs @@ -2,6 +2,7 @@ mod css_cache; mod lazy_css; +mod native_theme; mod output; mod reservation; mod resolver_state; @@ -15,6 +16,7 @@ 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 native_theme::native_theme; pub use output::{ CssOptions, ExtractionMode, Output, SourceMapMode, code_extract, code_extract_native, }; diff --git a/libs/binding/src/native_theme.rs b/libs/binding/src/native_theme.rs new file mode 100644 index 000000000..d974d91fa --- /dev/null +++ b/libs/binding/src/native_theme.rs @@ -0,0 +1,129 @@ +//! The registered theme as the React Native output reads it: every token and +//! typography resolved for each theme, from the theme the web parses. + +use std::collections::{BTreeMap, BTreeSet}; + +use extractor::{NativeTheme, TokenLevels, TypographyProperties}; +use sheet::theme::{ColorScheme, Theme, TokenValues, Typographies, default_variant_key}; + +/// `theme` for React Native, every token resolved for each theme. +/// +/// The themes are the color variants, the default first and the rest by name, +/// as the web's `data-theme` names them; with no colors, the length and shadow +/// variants. A token a theme does not define takes the value of the default +/// variant of its kind, as the web's `:root` gives it +#[must_use] +pub fn native_theme(theme: &Theme) -> NativeTheme { + let names = theme_names(theme); + let mut tokens = BTreeMap::new(); + for key in theme + .colors + .values() + .flat_map(|colors| colors.css_entries().map(|(key, _)| key)) + { + tokens.entry(key.clone()).or_insert_with(|| { + per_theme(&names, &theme.colors, |colors| { + colors.get(key).map(|value| vec![Some(value.clone())]) + }) + }); + } + for themes in [&theme.length, &theme.shadows] { + for name in themes.values().flat_map(BTreeMap::keys) { + tokens.entry(name.replace('.', "-")).or_insert_with(|| { + per_theme(&names, themes, |values| values.get(name).map(levels)) + }); + } + } + let dark = dark_theme(theme, &names); + NativeTheme { + names, + dark, + tokens, + typography: theme + .typography + .iter() + .map(|(name, typography)| (name.clone(), typography_levels(typography))) + .collect(), + } +} + +/// The theme names, the default first +fn theme_names(theme: &Theme) -> Vec { + let names: BTreeSet<&str> = if theme.colors.is_empty() { + theme + .length + .keys() + .chain(theme.shadows.keys()) + .map(String::as_str) + .collect() + } else { + theme.colors.keys().map(String::as_str).collect() + }; + // The variant the page shows without a `data-theme`, as the web picks it + let default = ["default", "light"] + .into_iter() + .find(|name| names.contains(name)) + .or_else(|| names.first().copied()); + default + .into_iter() + .chain(names.iter().copied().filter(|name| Some(*name) != default)) + .map(str::to_string) + .collect() +} + +/// A token's value in each of `names`, read from its variant of `themes` by +/// `read`, else from the default variant +fn per_theme( + names: &[String], + themes: &BTreeMap, + read: impl Fn(&T) -> Option, +) -> Vec> { + let fallback = default_variant_key(themes) + .and_then(|default| themes.get(default)) + .and_then(&read); + names + .iter() + .map(|name| { + themes + .get(name) + .and_then(&read) + .or_else(|| fallback.clone()) + }) + .collect() +} + +fn levels(values: &TokenValues) -> TokenLevels { + values.0.clone() +} + +/// The theme the system's dark appearance shows: `dark`, as on the web, when +/// it renders dark, else the first theme `colorScheme` makes dark +fn dark_theme(theme: &Theme, names: &[String]) -> Option { + let is_dark = |name: &String| theme.color_scheme_of(name) == ColorScheme::Dark; + names + .iter() + .position(|name| name == "dark" && is_dark(name)) + .or_else(|| names.iter().position(is_dark)) +} + +/// The properties of a typography at each breakpoint +fn typography_levels(typography: &Typographies) -> Vec> { + typography + .0 + .iter() + .map(|entry| { + entry.as_ref().map(|entry| { + entry + .properties() + .into_iter() + .filter_map(|(property, value)| { + value + .map(str::trim) + .filter(|value| !value.is_empty()) + .map(|value| (property.to_string(), value.to_string())) + }) + .collect() + }) + }) + .collect() +} diff --git a/libs/binding/src/output.rs b/libs/binding/src/output.rs index 441bbe899..0497ebda0 100644 --- a/libs/binding/src/output.rs +++ b/libs/binding/src/output.rs @@ -6,7 +6,8 @@ use extractor::{ use crate::css_cache::invalidate_css; use crate::lazy_css::{LazyCss, settle}; -use crate::with_style_sheet_untracked; +use crate::native_theme::native_theme; +use crate::{with_style_sheet, with_style_sheet_untracked}; /// Whether extraction generates a source map. #[derive(Clone, Copy)] @@ -143,7 +144,8 @@ pub fn code_extract( } /// Compile a `(filename, code)` source for React Native on `platform` -/// (`ios`, `android` or `web`): its code and source map, with no CSS +/// (`ios`, `android` or `web`): its code and source map, with no CSS. Theme +/// tokens resolve in the registered theme pub fn code_extract_native( source: (&str, &str), package: &str, @@ -156,7 +158,11 @@ pub fn code_extract_native( })?; let option = ExtractOption { package: package.to_string(), - target: ExtractTarget::Native(NativeTarget { platform, runtime }), + target: ExtractTarget::Native(NativeTarget { + platform, + runtime, + theme: std::sync::Arc::new(with_style_sheet(|sheet| native_theme(&sheet.theme))), + }), ..ExtractOption::default() }; let output = extract(filename, code, option).map_err(|error| error.to_string())?; diff --git a/libs/binding/tests/native.rs b/libs/binding/tests/native.rs index 2cb427c3d..9c44f4d28 100644 --- a/libs/binding/tests/native.rs +++ b/libs/binding/tests/native.rs @@ -50,3 +50,112 @@ fn native_extraction_reports_build_errors() { assert!(error.starts_with("view.tsx:2:6: `` cannot use `p` on React Native")); assert!(error.contains("`runtime: false`")); } + +/// A theme as devup.json writes it +fn theme(json: &str) -> sheet::theme::Theme { + serde_json::from_str(json).unwrap_or_default() +} + +#[test] +fn native_theme_reads_every_token_for_each_theme() { + // Given: colors in two themes, a renamed dark scheme, and length, shadow + // and typography tokens whose variants do not all match the colors + let theme = theme( + r##"{ + "colors": { + "light": { "primary": "#000", "gray": { "100": "#111" }, "lightOnly": "#222" }, + "dark": { "primary": "#fff" }, + "dim": { "primary": "#888" } + }, + "colorScheme": { "dim": "dark", "dark": "light" }, + "length": { "default": { "gap.x": 2, "pad": ["1px", null, "2px"] }, "dim": { "gap.x": "3px" } }, + "shadow": { "light": { "card": "0 1px #000" } }, + "typography": { + "body": { "fontSize": "16px", "lineHeight": 1.5, "fontFamily": " " }, + "title": [null, { "fontSize": "20px" }] + } + }"##, + ); + // When + let native = devup_ui_binding_core::native_theme(&theme); + // Then: the default first, `dim` is the dark one as `dark` renders light + assert_eq!(native.names, ["light", "dark", "dim"]); + assert_eq!(native.dark, Some(2)); + let one = |value: &str| Some(vec![Some(value.to_string())]); + assert_eq!( + native.tokens["primary"], + [one("#000"), one("#fff"), one("#888")] + ); + assert_eq!( + native.tokens["gray-100"], + [one("#111"), one("#111"), one("#111")] + ); + assert_eq!(native.tokens["gap-x"], [one("8px"), one("8px"), one("3px")]); + assert_eq!( + native.tokens["card"], + [one("0 1px #000"), one("0 1px #000"), one("0 1px #000")] + ); + assert_eq!( + native.tokens["pad"][0], + Some(vec![Some("1px".to_string()), None, Some("2px".to_string())]) + ); + assert_eq!( + native.typography["body"], + [Some(vec![ + ("font-size".to_string(), "16px".to_string()), + ("line-height".to_string(), "1.5".to_string()), + ])] + ); + assert_eq!(native.typography["title"][0], None); +} + +#[test] +fn native_theme_without_colors_names_the_length_and_shadow_variants() { + let native = devup_ui_binding_core::native_theme(&theme( + r#"{ "length": { "dark": { "a": "1px" } }, "shadow": { "default": { "b": "0 0 1px red" } } }"#, + )); + assert_eq!(native.names, ["default", "dark"]); + assert_eq!(native.dark, Some(1)); + // The only length variant is the one the page shows without a theme + let one = Some(vec![Some("1px".to_string())]); + assert_eq!(native.tokens["a"], [one.clone(), one]); +} + +#[test] +fn native_theme_without_a_dark_theme_has_none() { + let native = devup_ui_binding_core::native_theme(&theme( + r#"{ "colors": { "default": { "a": "red" } } }"#, + )); + assert_eq!( + (native.names.as_slice(), native.dark), + (["default".to_string()].as_slice(), None) + ); +} + +#[test] +#[serial_test::serial] +fn native_extraction_resolves_the_registered_theme() -> Result<(), String> { + // Given + devup_ui_binding_core::register_theme_internal(theme( + r##"{ "colors": { "light": { "primary": "#000" }, "dark": { "primary": "#fff" } } }"##, + )); + // When + let output = code_extract_native( + ( + "view.tsx", + "import { Box } from '@devup-ui/react'\nexport const V = () => \n", + ), + "@devup-ui/react", + "ios", + true, + ); + devup_ui_binding_core::register_theme_internal(sheet::theme::Theme::default()); + // Then + let code = output?.code; + assert!( + code.contains("__defineThemes([\"light\", \"dark\"], 1)"), + "{code}" + ); + assert!(code.contains("backgroundColor: \"#fff\""), "{code}"); + Ok(()) +} diff --git a/libs/extractor/src/lib.rs b/libs/extractor/src/lib.rs index 4afc47771..e5906526d 100644 --- a/libs/extractor/src/lib.rs +++ b/libs/extractor/src/lib.rs @@ -200,7 +200,9 @@ 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}; +pub use crate::native::{ + ExtractTarget, NativePlatform, NativeTarget, NativeTheme, TokenLevels, TypographyProperties, +}; use crate::visit::DevupVisitor; use css::file_map::{canonical, get_file_num_by_filename, is_global}; use oxc_allocator::{Allocator, CloneIn}; diff --git a/libs/extractor/src/native/element.rs b/libs/extractor/src/native/element.rs index 23261152f..36f2a0d08 100644 --- a/libs/extractor/src/native/element.rs +++ b/libs/extractor/src/native/element.rs @@ -3,25 +3,28 @@ //! component its import is now bound to. use oxc_ast::ast::{ - Expression, IdentifierReference, JSXAttribute, JSXAttributeItem, JSXAttributeName, - JSXAttributeValue, JSXChild, JSXElement, JSXElementName, JSXExpression, LogicalOperator, - ObjectExpression, ObjectPropertyKind, Program, TSType, UnaryOperator, + ArrowFunctionExpression, ExportDefaultDeclaration, Expression, Function, FunctionBody, + IdentifierReference, JSXAttribute, JSXAttributeItem, JSXAttributeName, JSXAttributeValue, + JSXChild, JSXElement, JSXElementName, JSXExpression, LogicalOperator, ObjectExpression, + ObjectPropertyKind, Program, TSType, UnaryOperator, VariableDeclarator, }; use std::cell::Cell; use oxc_ast_visit::{Visit, walk}; use oxc_semantic::Scoping; use oxc_span::{GetSpan, Span}; +use oxc_syntax::scope::ScopeFlags; use oxc_syntax::symbol::SymbolId; -use rustc_hash::FxHashMap; +use rustc_hash::{FxHashMap, FxHashSet}; use super::errors::{Problem, RuntimeFeature}; use super::imports::{self, native_component}; -use super::props::{declarations, dynamic_keys}; +use super::props::{Tokens, declarations, dynamic_keys}; use super::sheet::Sheet; -use super::style::{Choice, style_code}; +use super::style::{Choice, in_theme, style_code, themed}; +use super::theme::selector_theme; use super::values::{Literal, NativeValue, ROOT_FONT_SIZE}; -use super::{NativePlatform, NativeTarget, REACT_NATIVE, Replacement}; +use super::{NativePlatform, NativeTarget, REACT_NATIVE, RUNTIME, Replacement}; use crate::component::ExportVariableKind; use crate::fresh_name::fresh_name; @@ -31,12 +34,87 @@ pub(super) struct Compiled { pub errors: Vec<(u32, String)>, } +/// The names the file gives what it imports from the runtime, and whether +/// it uses each +struct Runtime { + /// The variable holding the index of the theme the app shows + index: String, + /// The hook reading that index + hook: String, + hook_used: bool, + /// The component that reads the index itself, for an element outside a + /// function component + wrapper: String, + wrapper_used: bool, + /// The function telling the runtime the theme names + define: String, +} + +impl Runtime { + fn new(code: &str) -> Self { + Self { + index: fresh_name("__t", code), + hook: fresh_name("__useThemeIndex", code), + hook_used: false, + wrapper: fresh_name("__Themed", code), + wrapper_used: false, + define: fresh_name("__defineThemes", code), + } + } + + /// The import of the runtime and the call telling it the theme names, + /// when the file uses it + fn prelude(&self, target: &NativeTarget, theme_api: bool) -> Option { + if !(self.hook_used || self.wrapper_used || theme_api) { + return None; + } + let mut specifiers = Vec::new(); + if self.hook_used { + specifiers.push(format!("useThemeIndex as {}", self.hook)); + } + if self.wrapper_used { + specifiers.push(format!("Themed as {}", self.wrapper)); + } + specifiers.push(format!("defineThemes as {}", self.define)); + let theme = &target.theme; + let names = serde_json::Value::from(theme.names.clone()).to_string(); + let dark = theme + .dark + .map_or_else(String::new, |dark| format!(", {dark}")); + Some(format!( + "import {{ {} }} from \"{RUNTIME}\";\n{}({names}{dark});\n", + specifiers.join(", "), + self.define + )) + } +} + +/// A function the elements are in +struct Frame { + /// Whether it is a function component or a hook, where the hook reading + /// the theme can be called first + component: bool, + /// Whether an element in it reads the theme + used: bool, + /// Where the hook is called + hook_at: HookAt, +} + +/// Where the hook reading the theme is called in a function +#[derive(Clone, Copy)] +enum HookAt { + /// First in a body of statements, at this offset + Body(usize), + /// Before the expression an arrow function returns, between these offsets + Expression(usize, usize), +} + /// Compile the Devup UI elements of `program` pub(super) fn compile( program: &Program<'_>, code: &str, package: &str, - target: NativeTarget, + target: &NativeTarget, scoping: &Scoping, ) -> Compiled { let imports = imports::read(program, code, package, target); @@ -48,6 +126,10 @@ pub(super) fn compile( sheet: Sheet::new(fresh_name("__s", code)), units: fresh_name("__u", code), units_used: Cell::new(false), + runtime: Runtime::new(code), + theme_scope: None, + frames: Vec::new(), + component_functions: FxHashSet::default(), replacements: imports.replacements, errors: imports.errors, }; @@ -58,20 +140,22 @@ pub(super) fn compile( sheet, units, units_used, + runtime, mut replacements, errors, .. } = visitor; - let mut prelude = String::new(); + let mut prelude = runtime + .prelude(target, imports.theme_api) + .unwrap_or_default(); 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 - { + if !prelude.is_empty() { + let at = imports.sheet_at.unwrap_or(code.len()); replacements.push((at, at, prelude)); } Compiled { @@ -91,6 +175,8 @@ enum Prop { Declares, /// `_ios`, `_android` or `_web`: styles for one platform Platform(NativePlatform), + /// `_themeDark` and the like: styles for the theme named + Theme(String), /// What needs the React Native runtime Runtime(RuntimeFeature), /// What React Native has no equivalent of @@ -113,15 +199,14 @@ fn classify(name: &str) -> Prop { "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", - )), + "typography" => Prop::Declares, "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("_theme") && name.len() > "_theme".len() => { + Prop::Theme(selector_theme(name)) + } 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", @@ -158,7 +243,7 @@ fn holds_no_text(native: &str) -> bool { struct Elements<'s> { code: &'s str, - target: NativeTarget, + target: &'s NativeTarget, scoping: &'s Scoping, components: &'s FxHashMap, sheet: Sheet, @@ -166,6 +251,14 @@ struct Elements<'s> { units: String, /// Whether a value read at runtime is converted units_used: Cell, + runtime: Runtime, + /// The theme of the `_theme*` block being read, whose tokens resolve in + /// that theme alone + theme_scope: Option, + /// The functions the visited code is in, innermost last + frames: Vec, + /// Where each function a component or a hook is bound to starts + component_functions: FxHashSet, replacements: Vec, errors: Vec<(u32, String)>, } @@ -204,6 +297,98 @@ impl<'a> Visit<'a> for Elements<'_> { } fn visit_ts_type(&mut self, _: &TSType<'a>) {} + + fn visit_variable_declarator(&mut self, declarator: &VariableDeclarator<'a>) { + if let (Some(name), Some(init)) = (declarator.id.get_identifier_name(), &declarator.init) + && is_component_name(&name) + { + self.component_functions.extend(function_start(init)); + } + walk::walk_variable_declarator(self, declarator); + } + + fn visit_export_default_declaration(&mut self, declaration: &ExportDefaultDeclaration<'a>) { + let start = declaration.declaration.as_expression().map_or_else( + || Some(declaration.declaration.span().start), + function_start, + ); + self.component_functions.extend(start); + walk::walk_export_default_declaration(self, declaration); + } + + fn visit_function(&mut self, function: &Function<'a>, flags: ScopeFlags) { + let component = function + .id + .as_ref() + .is_some_and(|id| is_component_name(&id.name)) + || self.component_functions.contains(&function.span.start); + let body = function.body.as_deref().map(body_start); + self.in_frame(component, body, |visitor| { + walk::walk_function(visitor, function, flags); + }); + } + + fn visit_arrow_function_expression(&mut self, arrow: &ArrowFunctionExpression<'a>) { + let component = self.component_functions.contains(&arrow.span.start); + let hook_at = arrow.get_expression().map_or_else( + || arrow.get_function_body().map(body_start), + |expression| { + let span = expression.span(); + Some(HookAt::Expression(span.start as usize, span.end as usize)) + }, + ); + self.in_frame(component, hook_at, |visitor| { + walk::walk_arrow_function_expression(visitor, arrow); + }); + } +} + +/// Where the hook is called first in `body`: after its directives +fn body_start(body: &FunctionBody<'_>) -> HookAt { + HookAt::Body( + body.directives + .last() + .map_or(body.span.start + 1, |directive| directive.span.end) as usize, + ) +} + +/// Whether a function bound to `name` is a function component or a hook, +/// which may call a hook first: a capitalized name, or `use` and a capital +fn is_component_name(name: &str) -> bool { + let mut chars = name.chars(); + match chars.next() { + Some(first) if first.is_ascii_uppercase() => true, + Some('u') => name + .strip_prefix("use") + .is_some_and(|rest| rest.chars().next().is_none_or(|c| c.is_ascii_uppercase())), + _ => false, + } +} + +/// Where the function `expression` gives starts, through `memo()` and +/// `forwardRef()`, if it gives one +fn function_start(expression: &Expression<'_>) -> Option { + match expression.get_inner_expression() { + Expression::ArrowFunctionExpression(arrow) => Some(arrow.span.start), + Expression::FunctionExpression(function) => Some(function.span.start), + Expression::CallExpression(call) if is_component_wrapper(&call.callee) => call + .arguments + .first() + .and_then(|argument| argument.as_expression()) + .and_then(function_start), + _ => None, + } +} + +/// Whether `callee` wraps a component in a component: `memo` or `forwardRef`, +/// imported or read from `React` +fn is_component_wrapper(callee: &Expression<'_>) -> bool { + let name = match callee.get_inner_expression() { + Expression::Identifier(identifier) => identifier.name.as_str(), + Expression::StaticMemberExpression(member) => member.property.name.as_str(), + _ => return false, + }; + matches!(name, "memo" | "forwardRef") } impl<'a> Elements<'_> { @@ -229,6 +414,83 @@ impl<'a> Elements<'_> { self.errors.push((offset, message)); } + /// Visit a function, through `visit`, as the innermost frame when it has + /// a body, then call the hook reading the theme first in it when an + /// element in it reads the theme + fn in_frame( + &mut self, + component: bool, + hook_at: Option, + visit: impl FnOnce(&mut Self), + ) { + let Some(hook_at) = hook_at else { + visit(self); + return; + }; + self.frames.push(Frame { + component, + used: false, + hook_at, + }); + visit(self); + if let Some(frame) = self.frames.pop() + && frame.used + { + self.call_hook(frame.hook_at); + } + } + + /// Call the hook reading the theme at `at` + fn call_hook(&mut self, at: HookAt) { + self.runtime.hook_used = true; + let call = format!("const {} = {}();", self.runtime.index, self.runtime.hook); + match at { + HookAt::Body(at) => self.replacements.push((at, at, format!("\n{call}"))), + HookAt::Expression(start, end) => { + self.replacements + .push((start, start, format!("{{ {call} return "))); + self.replacements.push((end, end, "; }".to_string())); + } + } + } + + /// Whether the element being compiled is in a function component or a + /// hook, which then reads the theme first + fn reads_theme_in_component(&mut self) -> bool { + match self.frames.iter_mut().rev().find(|frame| frame.component) { + Some(frame) => { + frame.used = true; + true + } + None => false, + } + } + + /// The styles a style prop declares with a literal: one style object, or + /// one a theme when its tokens differ by theme + fn static_choice(&self, name: &str, literal: &Literal) -> Result { + let theme = &self.target.theme; + let indexes = match self.theme_scope { + Some(index) => index..index + 1, + None if names_tokens(name, literal) => 0..theme.count(), + None => 0..1, + }; + let mut variants = Vec::new(); + for index in indexes { + let tokens = Tokens { + theme, + index, + target: self.target, + }; + variants.push(declarations(name, literal, &tokens)?.unwrap_or_default()); + } + let choice = themed(variants); + if choice.reads_theme() && !self.target.runtime { + return Err(RuntimeFeature::Theme.problem(self.target)); + } + Ok(choice) + } + /// Compile one Devup UI element fn element(&mut self, element: &JSXElement<'a>, kind: &ExportVariableKind, local: &str) { let opening = &element.opening_element; @@ -260,7 +522,7 @@ impl<'a> Elements<'_> { } } let retagged = tag.is_some(); - self.finish(element, styles, tag, previous_end); + self.finish(element, styles, (tag, local), previous_end); self.children(element, kind, local, retagged); } @@ -298,7 +560,7 @@ impl<'a> Elements<'_> { } Prop::Platform(platform) => { styles.removed.push(span); - let choices = self.platform( + let choices = self.block( attribute_expression(attribute), name, attribute.span.start, @@ -308,6 +570,16 @@ impl<'a> Elements<'_> { styles.choices.extend(choices); } } + Prop::Theme(theme) => { + styles.removed.push(span); + let choices = self.theme_block( + attribute_expression(attribute), + (name, &theme), + attribute.span.start, + local, + ); + styles.choices.extend(choices); + } Prop::Runtime(feature) => self.error( attribute.span.start, feature.problem(self.target).on(local, name), @@ -395,8 +667,9 @@ impl<'a> Elements<'_> { } } - /// The styles of a platform block, such as `_ios={{ boxShadow: '...' }}` - fn platform( + /// The styles of a block, such as `_ios={{ boxShadow: '...' }}` or + /// `_themeDark={{ bg: 'black' }}` + fn block( &mut self, value: Option<&Expression<'a>>, name: &str, @@ -411,7 +684,7 @@ impl<'a> Elements<'_> { self.error( offset, Problem::new( - "a platform block takes an object of styles", + format!("`{name}` takes an object of styles"), format!("write the styles in an object, such as `{name}={{{{ p: 2 }}}}`"), ) .on(local, name), @@ -419,6 +692,47 @@ impl<'a> Elements<'_> { Vec::new() } + /// The styles of a theme block, such as `_themeDark={{ bg: 'black' }}`, + /// `name` being the prop and `theme` the theme it names: they apply only + /// while that theme shows + fn theme_block( + &mut self, + value: Option<&Expression<'a>>, + (name, theme): (&str, &str), + offset: u32, + local: &str, + ) -> Vec { + let Some(index) = self.target.theme.index_of(theme) else { + self.error( + offset, + Problem::new( + format!("devup.json defines no `{theme}` theme"), + "add the theme to devup.json, or remove the block", + ) + .on(local, name), + ); + return Vec::new(); + }; + let count = self.target.theme.count(); + if count > 1 && !self.target.runtime { + self.error( + offset, + RuntimeFeature::Theme.problem(self.target).on(local, name), + ); + return Vec::new(); + } + if self.theme_scope.is_some_and(|scope| scope != index) { + return Vec::new(); + } + let outer = self.theme_scope.replace(index); + let choices = self.block(value, name, offset, local); + self.theme_scope = outer; + choices + .into_iter() + .map(|choice| in_theme(index, count, choice)) + .collect() + } + /// The styles of an object of style props fn object_choices(&mut self, object: &ObjectExpression<'a>, local: &str) -> Vec { let mut choices = Vec::new(); @@ -427,7 +741,7 @@ impl<'a> Elements<'_> { self.error( property.span().start, Problem::new( - "the build reads only the styles written in a platform block", + "the build reads only the styles written in a block", "write each style in the block", ) .on(local, "..."), @@ -444,7 +758,7 @@ impl<'a> Elements<'_> { self.error( property.span.start, Problem::new( - "the build reads only keys written in a platform block", + "the build reads only keys written in a block", "write the key itself", ) .on(local, &format!("[{key}]")), @@ -456,7 +770,7 @@ impl<'a> Elements<'_> { choices } - /// The styles one key of a platform block declares + /// The styles one key of a block declares fn object_property( &mut self, key: &str, @@ -470,11 +784,14 @@ impl<'a> Elements<'_> { Err(problem) => self.error(offset, problem.on(local, key)), }, Prop::Platform(platform) => { - let choices = self.platform(Some(value), key, offset, local); + let choices = self.block(Some(value), key, offset, local); if platform == self.target.platform { return choices; } } + Prop::Theme(theme) => { + return self.theme_block(Some(value), (key, &theme), offset, local); + } Prop::Runtime(feature) => { self.error(offset, feature.problem(self.target).on(local, key)); } @@ -482,7 +799,7 @@ impl<'a> Elements<'_> { Prop::As | Prop::Style | Prop::Pass => self.error( offset, Problem::new( - "a platform block holds only style props", + "a block holds only style props", "pass it to the element itself", ) .on(local, key), @@ -500,7 +817,7 @@ impl<'a> Elements<'_> { match value { Some(JSXAttributeValue::StringLiteral(literal)) => literal.value.as_str().map_or_else( || self.dynamic_choice(name, literal.span.source_text(self.code)), - |text| static_choice(name, &Literal::Text(text.to_string())), + |text| self.static_choice(name, &Literal::Text(text.to_string())), ), Some(JSXAttributeValue::ExpressionContainer(container)) => container .expression @@ -522,7 +839,7 @@ impl<'a> Elements<'_> { expression: &Expression<'a>, ) -> Result { if let Some(literal) = literal(expression) { - return static_choice(name, &literal); + return self.static_choice(name, &literal); } match expression.without_parentheses() { Expression::NullLiteral(_) | Expression::BooleanLiteral(_) => Ok(Choice::Empty), @@ -615,12 +932,9 @@ impl<'a> Elements<'_> { &mut self, element: &JSXElement<'a>, styles: Styles, - tag: Option, + (tag, local): (Option, &str), attributes_end: u32, ) { - if let Some(tag) = &tag { - self.rename(element, tag); - } let Styles { choices, given, @@ -628,10 +942,31 @@ impl<'a> Elements<'_> { style, opaque_spread, } = styles; - let Some(code) = style_code(choices, given, &mut self.sheet) else { + let style_code = style_code(choices, given, &mut self.sheet, &self.runtime.index); + let wrapped = style_code + .as_ref() + .is_some_and(|style| style.reads_theme && !self.reads_theme_in_component()); + if wrapped { + self.runtime.wrapper_used = true; + let wrapper = self.runtime.wrapper.clone(); + self.rename(element, &wrapper); + } else if let Some(tag) = &tag { + self.rename(element, tag); + } + let Some(style_code) = style_code else { self.remove(&removed); return; }; + let code = if wrapped { + format!( + " $c={{{}}} $s={{({}) => ({})}}", + tag.as_deref().unwrap_or(local), + self.runtime.index, + style_code.code + ) + } else { + format!(" style={{{}}}", style_code.code) + }; if let Some(spread) = opaque_spread { self.error( spread.start, @@ -640,11 +975,8 @@ impl<'a> Elements<'_> { } removed.extend(style); self.remove(&removed); - self.replacements.push(( - attributes_end as usize, - attributes_end as usize, - format!(" style={{{code}}}"), - )); + self.replacements + .push((attributes_end as usize, attributes_end as usize, code)); } /// Render the component `as` gives @@ -753,12 +1085,12 @@ fn literal(expression: &Expression<'_>) -> Option { } } -/// The styles a style prop declares with a literal -fn static_choice(name: &str, literal: &Literal) -> Result { - declarations(name, literal).map(Choice::Static) +/// Whether the styles of `literal` for the style prop `name` may differ by +/// theme: a typography, or a value naming a `$token` +fn names_tokens(name: &str, literal: &Literal) -> bool { + name == "typography" || matches!(literal, Literal::Text(text) if text.contains('$')) } -/// The styles a style prop declares with a value read at runtime /// The import of `StyleSheet` and the declaration of `sheet` fn sheet_prelude(sheet: &Sheet, code: &str) -> String { let style_sheet = fresh_name("StyleSheet", code); diff --git a/libs/extractor/src/native/errors.rs b/libs/extractor/src/native/errors.rs index 4a57442e1..6e21074b3 100644 --- a/libs/extractor/src/native/errors.rs +++ b/libs/extractor/src/native/errors.rs @@ -55,7 +55,7 @@ impl RuntimeFeature { const fn fix(self) -> &'static str { match self { Self::Responsive => "give one value", - Self::Theme => "give the value for one theme", + Self::Theme => "give the value for one theme, or turn the runtime on", Self::Pressed => { "pass a function to the `style` of a React Native `Pressable`, reading `pressed`" } @@ -63,7 +63,7 @@ impl RuntimeFeature { } /// Why the feature cannot compile for `target` - pub(super) fn problem(self, target: NativeTarget) -> Problem { + 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 { @@ -73,10 +73,12 @@ impl RuntimeFeature { } } -/// A theme token, read from the theme in a later version -pub(super) fn theme_token(value: &str) -> Problem { +/// Why the theme API `name` cannot be imported with `runtime: false` +pub(super) fn theme_api(name: &str) -> Problem { Problem::new( - format!("the theme token in `{value}` is not read on React Native yet"), - "write the value itself", + format!( + "`{name}` reads or changes the theme the app shows, which needs the React Native runtime that `runtime: false` turns off" + ), + "remove it, or turn the runtime on", ) } diff --git a/libs/extractor/src/native/imports.rs b/libs/extractor/src/native/imports.rs index 1fac876e4..ae544d5a3 100644 --- a/libs/extractor/src/native/imports.rs +++ b/libs/extractor/src/native/imports.rs @@ -12,8 +12,8 @@ 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 super::errors::{Problem, theme_api}; +use super::{NativeTarget, REACT_NATIVE, RUNTIME, Replacement}; use crate::component::ExportVariableKind; /// The Devup UI components a file imports, and how its imports change @@ -23,6 +23,8 @@ pub(super) struct Imports { pub components: FxHashMap, pub replacements: Vec, pub errors: Vec<(u32, String)>, + /// Whether the file imports the theme API of the runtime + pub theme_api: bool, /// Where the stylesheet is declared: before the first statement that is /// not an import pub sheet_at: Option, @@ -43,9 +45,25 @@ pub(super) const fn native_component(kind: &ExportVariableKind) -> &'static str } } +/// The theme API, which the runtime of React Native implements +fn is_theme_api(name: &str) -> bool { + matches!(name, "useTheme" | "getTheme" | "setTheme") +} + +/// Where an imported name of the package goes on React Native +enum Destination { + /// A React Native component, under this specifier + Native(String), + /// The runtime, under this specifier + Runtime(String), + /// The package, as it is: a name only types read + Kept, +} + /// 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 { +/// for one that can (a component, the theme API with the runtime, 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", @@ -55,7 +73,7 @@ fn unsupported(name: &str, target: NativeTarget) -> Option { 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)), + name if is_theme_api(name) => (!target.runtime).then(|| theme_api(name)), "ThemeScript" | "initTheme" | "globalCss" => Some(Problem::new( "React Native has no document and no global stylesheet", "remove it from the React Native build", @@ -77,7 +95,7 @@ pub(super) fn read( program: &Program<'_>, code: &str, package: &str, - target: NativeTarget, + target: &NativeTarget, ) -> Imports { let mut imports = Imports::default(); for statement in &program.body { @@ -103,16 +121,18 @@ impl Imports { declaration: &ImportDeclaration<'_>, code: &str, package: &str, - target: NativeTarget, + target: &NativeTarget, ) { let mut natives = Vec::new(); + let mut runtime = 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)), + Destination::Native(native) => natives.push(native), + Destination::Runtime(name) => runtime.push(name), + Destination::Kept => kept.push(specifier_code(specifier, code)), } } specifier => self.errors.push(( @@ -125,52 +145,62 @@ impl Imports { )), } } - if natives.is_empty() { + if natives.is_empty() && runtime.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) - ); - } + self.theme_api |= !runtime.is_empty(); + let source = declaration.source.span.source_text(code).to_string(); + let text: Vec = [ + (natives, format!("\"{REACT_NATIVE}\"")), + (runtime, format!("\"{RUNTIME}\"")), + (kept, source), + ] + .into_iter() + .filter(|(names, _)| !names.is_empty()) + .map(|(names, source)| format!("import {{ {} }} from {source};", names.join(", "))) + .collect(); let span = declaration.span; self.replacements - .push((span.start as usize, span.end as usize, text)); + .push((span.start as usize, span.end as usize, text.join("\n"))); } - /// The React Native import a specifier becomes, or `None` to keep it + /// Where a specifier goes on React Native fn specifier( &mut self, specifier: &ImportSpecifier<'_>, package: &str, - target: NativeTarget, - ) -> Option { + target: &NativeTarget, + ) -> Destination { if specifier.import_kind.is_type() { - return None; + return Destination::Kept; } 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; + return Destination::Kept; } - let kind = ExportVariableKind::try_from(name).ok()?; let local = specifier.local.name.to_string(); + if is_theme_api(&name) { + return Destination::Runtime(renamed(&name, local)); + } + let Ok(kind) = ExportVariableKind::try_from(name) else { + return Destination::Kept; + }; 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}") - }) + Destination::Native(renamed(native, local)) + } +} + +/// The specifier importing `name` under `local` +fn renamed(name: &str, local: String) -> String { + if name == local { + local + } else { + format!("{name} as {local}") } } diff --git a/libs/extractor/src/native/mod.rs b/libs/extractor/src/native/mod.rs index d7effcfe4..68911d456 100644 --- a/libs/extractor/src/native/mod.rs +++ b/libs/extractor/src/native/mod.rs @@ -4,9 +4,12 @@ //! `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 +//! What the build can decide compiles statically: literal values, values the +//! element reads at runtime as they are, conditions between them, the +//! platform blocks `_ios`, `_android` and `_web`, and theme tokens when the +//! theme has one value for them. A value that differs by theme compiles to +//! one style object a theme, and the element picks one by the index the +//! runtime of `@devup-ui/react/native` gives. Responsive arrays 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. @@ -16,12 +19,14 @@ mod imports; mod props; mod sheet; mod style; +mod theme; mod values; #[cfg(test)] mod tests; use std::error::Error; +use std::sync::Arc; use oxc_allocator::Allocator; use oxc_semantic::SemanticBuilder; @@ -30,8 +35,10 @@ use strum_macros::{Display, EnumString}; use crate::ExtractOutput; +pub use theme::{NativeTheme, TokenLevels, TypographyProperties}; + /// What extraction compiles for -#[derive(Debug, Clone, Copy, PartialEq, Eq, Default)] +#[derive(Debug, Clone, PartialEq, Eq, Default)] pub enum ExtractTarget { /// Class names and CSS #[default] @@ -41,13 +48,15 @@ pub enum ExtractTarget { } /// The React Native build a file is compiled for -#[derive(Debug, Clone, Copy, PartialEq, Eq)] +#[derive(Debug, Clone, 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 theme tokens resolve in + pub theme: Arc, } /// The platform Metro builds a bundle for @@ -62,6 +71,10 @@ pub enum NativePlatform { /// The package React Native components are imported from pub(crate) const REACT_NATIVE: &str = "react-native"; +/// The module of the React Native runtime: the theme store and the hook and +/// component that pick a style object by theme +pub(crate) const RUNTIME: &str = "@devup-ui/react/native"; + /// Compile `code` for React Native, or tell every place it cannot be, each /// led by `filename:line:column` pub(crate) fn extract( @@ -82,7 +95,7 @@ pub(crate) fn extract( .build(&program) .semantic .into_scoping(); - let compiled = element::compile(&program, code, package, target, &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()); } diff --git a/libs/extractor/src/native/props.rs b/libs/extractor/src/native/props.rs index 7843c7f65..6d0eceb1a 100644 --- a/libs/extractor/src/native/props.rs +++ b/libs/extractor/src/native/props.rs @@ -11,10 +11,12 @@ use phf::phf_map; use crate::extract_style::constant::is_maintain_value_property; +use super::NativeTarget; use super::errors::Problem; +use super::theme::NativeTheme; use super::values::{ - Literal, NativeValue, css_text, font_weight, keyword, length, line_height, number_code, - number_or_text, plain_number, + Literal, NativeValue, css_text, font_weight, keyword, length, line_height, number, number_code, + number_or_text, plain_number, scaled_length, }; /// How React Native reads the value of a style @@ -217,9 +219,6 @@ fn native_value(kind: Kind, text: &str) -> Result { /// 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`", @@ -235,26 +234,124 @@ fn check_text(text: &str) -> Result<(), Problem> { Ok(()) } -/// The styles the style prop `prop`, with the value `literal`, declares -pub(super) fn declarations(prop: &str, literal: &Literal) -> Result, Problem> { +/// Where the `$token`s of a value resolve: one theme of the theme a file is +/// compiled with +pub(super) struct Tokens<'t> { + pub theme: &'t NativeTheme, + pub index: usize, + pub target: &'t NativeTarget, +} + +impl Tokens<'_> { + /// `text` with its tokens resolved, or `None` when the theme lacks one + fn resolve<'v>(&self, text: &'v str) -> Result>, Problem> { + self.theme.resolve(text, self.index, self.target) + } +} + +/// The styles the style prop `prop`, with the value `literal`, declares in +/// the theme of `tokens`, or `None` when that theme lacks a token it names +pub(super) fn declarations( + prop: &str, + literal: &Literal, + tokens: &Tokens<'_>, +) -> Result>, Problem> { + if prop == "typography" { + return typography(&literal_text(literal), tokens); + } if css::is_enum_property(prop) { - return enum_declarations(prop, literal); + return enum_declarations(prop, literal).map(Some); } let mut declarations = Vec::new(); for property in css::disassemble_property(prop) { let text = css_text(&property, literal); + let Some(text) = tokens.resolve(&text)? else { + return Ok(None); + }; check_text(&text)?; declarations.extend(property_declarations(&property, &text)?); } - Ok(declarations) + Ok(Some(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` as text +fn literal_text(literal: &Literal) -> Cow<'_, str> { + match literal { Literal::Text(text) => Cow::Borrowed(text.as_str()), Literal::Number(number) => Cow::Owned(number_code(*number)), + } +} + +/// The styles of the typography `name` of the theme: its font size in +/// pixels, and a line height or letter spacing relative to the font size +/// multiplied by it, as React Native reads both in pixels +fn typography(name: &str, tokens: &Tokens<'_>) -> Result>, Problem> { + let mut properties = Vec::new(); + for (property, value) in tokens.theme.typography(name, tokens.target)? { + let Some(value) = tokens.resolve(value)? else { + return Ok(None); + }; + check_text(&value)?; + properties.push((property.as_str(), value.into_owned())); + } + let font_size = properties + .iter() + .find(|(property, _)| *property == "font-size") + .and_then(|(_, value)| scaled_length(value.trim()).or_else(|| number(value))); + let mut declarations = Vec::new(); + for (property, value) in &properties { + match *property { + "line-height" | "letter-spacing" => { + declarations.extend(relative_to_font(property, value, font_size)?); + } + property => declarations.extend(property_declarations(property, value)?), + } + } + Ok(Some(declarations)) +} + +/// A typography's line height or letter spacing in pixels: a number, a +/// percentage or an `em` length is relative to the font size, and `normal` +/// leaves React Native's default +fn relative_to_font( + property: &str, + text: &str, + font_size: Option, +) -> Result, Problem> { + let text = text.trim(); + let key = if property == "line-height" { + "lineHeight" + } else { + "letterSpacing" }; + if text == "normal" { + return Ok(None); + } + let relative = text + .strip_suffix('%') + .and_then(number) + .map(|percent| percent / 100.0) + .or_else(|| text.strip_suffix("em").and_then(number)) + .or_else(|| (property == "line-height").then(|| number(text)).flatten()); + let pixels = match (relative, font_size) { + // Rounded to a thousandth of a pixel, so `1.3` of `24px` is `31.2` + (Some(relative), Some(font_size)) => (relative * font_size * 1000.0).round() / 1000.0, + (Some(_), None) => { + return Err(Problem::new( + format!( + "`{text}` is relative to the font size, and the typography has no font size in pixels" + ), + "give the typography a `fontSize` in pixels, or the value in pixels", + )); + } + (None, _) => return length(text).map(|value| Some((key.to_string(), value))), + }; + Ok(Some((key.to_string(), NativeValue::Number(pixels)))) +} + +/// The styles of a Devup UI enum prop, such as `positioning="top-left"` +fn enum_declarations(prop: &str, literal: &Literal) -> Result, Problem> { + let value = literal_text(literal); let map = css::get_enum_property_value(prop, &value).ok_or_else(|| { Problem::new( format!("`{prop}` has no `{value}`"), @@ -368,6 +465,12 @@ fn border(text: &str) -> Vec { /// 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 prop == "typography" { + return Err(Problem::new( + "the build reads the styles of a typography by its name, which a value read at runtime does not give", + "write the name, or a condition between names such as `typography={big ? 'h1' : 'body'}`", + )); + } if css::is_enum_property(prop) { return Err(runtime_value_problem(prop)); } diff --git a/libs/extractor/src/native/snapshots/extractor__native__tests__apis.snap b/libs/extractor/src/native/snapshots/extractor__native__tests__apis.snap index 01d0e5454..6d3e6d0a6 100644 --- a/libs/extractor/src/native/snapshots/extractor__native__tests__apis.snap +++ b/libs/extractor/src/native/snapshots/extractor__native__tests__apis.snap @@ -9,6 +9,6 @@ test.tsx:1:34: `ThemeScript` from `@devup-ui/react` cannot be used on React Nati 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 +test.tsx:1:77: `useTheme` from `@devup-ui/react` cannot be used on React Native: `useTheme` reads or changes the theme the app shows, which needs the React Native runtime that `runtime: false` turns off. Fix: remove it, or turn the runtime on +test.tsx:1:87: `getTheme` from `@devup-ui/react` cannot be used on React Native: `getTheme` reads or changes the theme the app shows, which needs the React Native runtime that `runtime: false` turns off. Fix: remove it, or turn the runtime on +test.tsx:1:97: `setTheme` from `@devup-ui/react` cannot be used on React Native: `setTheme` reads or changes the theme the app shows, which needs the React Native runtime that `runtime: false` turns off. Fix: remove it, or turn the runtime on diff --git a/libs/extractor/src/native/snapshots/extractor__native__tests__arrow_block.snap b/libs/extractor/src/native/snapshots/extractor__native__tests__arrow_block.snap new file mode 100644 index 000000000..190af9899 --- /dev/null +++ b/libs/extractor/src/native/snapshots/extractor__native__tests__arrow_block.snap @@ -0,0 +1,17 @@ +--- +source: libs/extractor/src/native/tests.rs +expression: "compile_themed(two_themes(), 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 { useThemeIndex as __useThemeIndex, defineThemes as __defineThemes } from "@devup-ui/react/native"; +__defineThemes(["light", "dark"], 1); +import { StyleSheet } from "react-native"; +const __s = StyleSheet.create({ + a: { backgroundColor: "#5a44ff" }, + b: { backgroundColor: "#8c7bff" } +}); +export const A = () => { + "use memo"; + const __t = __useThemeIndex(); + return ; +}; diff --git a/libs/extractor/src/native/snapshots/extractor__native__tests__arrow_expression.snap b/libs/extractor/src/native/snapshots/extractor__native__tests__arrow_expression.snap new file mode 100644 index 000000000..0c7e70940 --- /dev/null +++ b/libs/extractor/src/native/snapshots/extractor__native__tests__arrow_expression.snap @@ -0,0 +1,16 @@ +--- +source: libs/extractor/src/native/tests.rs +expression: "compile_themed(two_themes(), 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 { useThemeIndex as __useThemeIndex, defineThemes as __defineThemes } from "@devup-ui/react/native"; +__defineThemes(["light", "dark"], 1); +import { StyleSheet } from "react-native"; +const __s = StyleSheet.create({ + a: { backgroundColor: "#5a44ff" }, + b: { backgroundColor: "#8c7bff" } +}); +export const A = () => { + const __t = __useThemeIndex(); + return ; +}; diff --git a/libs/extractor/src/native/snapshots/extractor__native__tests__arrow_parenthesized.snap b/libs/extractor/src/native/snapshots/extractor__native__tests__arrow_parenthesized.snap new file mode 100644 index 000000000..0c7e70940 --- /dev/null +++ b/libs/extractor/src/native/snapshots/extractor__native__tests__arrow_parenthesized.snap @@ -0,0 +1,16 @@ +--- +source: libs/extractor/src/native/tests.rs +expression: "compile_themed(two_themes(), 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 { useThemeIndex as __useThemeIndex, defineThemes as __defineThemes } from "@devup-ui/react/native"; +__defineThemes(["light", "dark"], 1); +import { StyleSheet } from "react-native"; +const __s = StyleSheet.create({ + a: { backgroundColor: "#5a44ff" }, + b: { backgroundColor: "#8c7bff" } +}); +export const A = () => { + const __t = __useThemeIndex(); + return ; +}; diff --git a/libs/extractor/src/native/snapshots/extractor__native__tests__callback_in_component.snap b/libs/extractor/src/native/snapshots/extractor__native__tests__callback_in_component.snap new file mode 100644 index 000000000..44c9e6e48 --- /dev/null +++ b/libs/extractor/src/native/snapshots/extractor__native__tests__callback_in_component.snap @@ -0,0 +1,16 @@ +--- +source: libs/extractor/src/native/tests.rs +expression: "compile_themed(two_themes(), 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 { useThemeIndex as __useThemeIndex, defineThemes as __defineThemes } from "@devup-ui/react/native"; +__defineThemes(["light", "dark"], 1); +import { StyleSheet } from "react-native"; +const __s = StyleSheet.create({ + a: { color: "#111" }, + b: { color: "#eee" } +}); +export function List({ items }) { + const __t = __useThemeIndex(); + return {items.map((item) => {item})}; +} diff --git a/libs/extractor/src/native/snapshots/extractor__native__tests__class_component.snap b/libs/extractor/src/native/snapshots/extractor__native__tests__class_component.snap new file mode 100644 index 000000000..e84a99bd7 --- /dev/null +++ b/libs/extractor/src/native/snapshots/extractor__native__tests__class_component.snap @@ -0,0 +1,17 @@ +--- +source: libs/extractor/src/native/tests.rs +expression: "compile_themed(two_themes(), 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 { Themed as __Themed, defineThemes as __defineThemes } from "@devup-ui/react/native"; +__defineThemes(["light", "dark"], 1); +import { StyleSheet } from "react-native"; +const __s = StyleSheet.create({ + a: { backgroundColor: "#5a44ff" }, + b: { backgroundColor: "#8c7bff" } +}); +export class A extends Component { + render() { + return <__Themed $c={Box} $s={(__t) => [__s.a, __s.b][__t]} />; + } +} diff --git a/libs/extractor/src/native/snapshots/extractor__native__tests__declared_function.snap b/libs/extractor/src/native/snapshots/extractor__native__tests__declared_function.snap new file mode 100644 index 000000000..14e600359 --- /dev/null +++ b/libs/extractor/src/native/snapshots/extractor__native__tests__declared_function.snap @@ -0,0 +1,17 @@ +--- +source: libs/extractor/src/native/tests.rs +expression: "compile_themed(two_themes(), 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 { useThemeIndex as __useThemeIndex, defineThemes as __defineThemes } from "@devup-ui/react/native"; +__defineThemes(["light", "dark"], 1); +import { StyleSheet } from "react-native"; +const __s = StyleSheet.create({ + a: { backgroundColor: "#5a44ff" }, + b: { backgroundColor: "#8c7bff" } +}); +declare function Typed(): void; +export function A() { + const __t = __useThemeIndex(); + return ; +} diff --git a/libs/extractor/src/native/snapshots/extractor__native__tests__export_default_arrow.snap b/libs/extractor/src/native/snapshots/extractor__native__tests__export_default_arrow.snap new file mode 100644 index 000000000..b4042b4c1 --- /dev/null +++ b/libs/extractor/src/native/snapshots/extractor__native__tests__export_default_arrow.snap @@ -0,0 +1,16 @@ +--- +source: libs/extractor/src/native/tests.rs +expression: "compile_themed(two_themes(), 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 { useThemeIndex as __useThemeIndex, defineThemes as __defineThemes } from "@devup-ui/react/native"; +__defineThemes(["light", "dark"], 1); +import { StyleSheet } from "react-native"; +const __s = StyleSheet.create({ + a: { backgroundColor: "#5a44ff" }, + b: { backgroundColor: "#8c7bff" } +}); +export default () => { + const __t = __useThemeIndex(); + return ; +}; diff --git a/libs/extractor/src/native/snapshots/extractor__native__tests__export_default_function.snap b/libs/extractor/src/native/snapshots/extractor__native__tests__export_default_function.snap new file mode 100644 index 000000000..88cd8e499 --- /dev/null +++ b/libs/extractor/src/native/snapshots/extractor__native__tests__export_default_function.snap @@ -0,0 +1,16 @@ +--- +source: libs/extractor/src/native/tests.rs +expression: "compile_themed(two_themes(), 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 { useThemeIndex as __useThemeIndex, defineThemes as __defineThemes } from "@devup-ui/react/native"; +__defineThemes(["light", "dark"], 1); +import { StyleSheet } from "react-native"; +const __s = StyleSheet.create({ + a: { backgroundColor: "#5a44ff" }, + b: { backgroundColor: "#8c7bff" } +}); +export default function() { + const __t = __useThemeIndex(); + return ; +} diff --git a/libs/extractor/src/native/snapshots/extractor__native__tests__export_default_value.snap b/libs/extractor/src/native/snapshots/extractor__native__tests__export_default_value.snap new file mode 100644 index 000000000..50061519c --- /dev/null +++ b/libs/extractor/src/native/snapshots/extractor__native__tests__export_default_value.snap @@ -0,0 +1,13 @@ +--- +source: libs/extractor/src/native/tests.rs +expression: "compile_themed(two_themes(), 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 { Themed as __Themed, defineThemes as __defineThemes } from "@devup-ui/react/native"; +__defineThemes(["light", "dark"], 1); +import { StyleSheet } from "react-native"; +const __s = StyleSheet.create({ + a: { backgroundColor: "#5a44ff" }, + b: { backgroundColor: "#8c7bff" } +}); +export default <__Themed $c={Box} $s={(__t) => [__s.a, __s.b][__t]} />; diff --git a/libs/extractor/src/native/snapshots/extractor__native__tests__function_declaration.snap b/libs/extractor/src/native/snapshots/extractor__native__tests__function_declaration.snap new file mode 100644 index 000000000..b85f0495e --- /dev/null +++ b/libs/extractor/src/native/snapshots/extractor__native__tests__function_declaration.snap @@ -0,0 +1,19 @@ +--- +source: libs/extractor/src/native/tests.rs +expression: "compile_themed(two_themes(), 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 { useThemeIndex as __useThemeIndex, defineThemes as __defineThemes } from "@devup-ui/react/native"; +__defineThemes(["light", "dark"], 1); +import { StyleSheet } from "react-native"; +const __s = StyleSheet.create({ + a: { backgroundColor: "#5a44ff" }, + b: { backgroundColor: "#8c7bff" }, + c: { backgroundColor: "#111" }, + d: { backgroundColor: "#eee" } +}); +function A() { + const __t = __useThemeIndex(); + const x = 1; + return <>; +} diff --git a/libs/extractor/src/native/snapshots/extractor__native__tests__helper_function.snap b/libs/extractor/src/native/snapshots/extractor__native__tests__helper_function.snap new file mode 100644 index 000000000..8cbf9a0b2 --- /dev/null +++ b/libs/extractor/src/native/snapshots/extractor__native__tests__helper_function.snap @@ -0,0 +1,22 @@ +--- +source: libs/extractor/src/native/tests.rs +expression: "compile_themed(two_themes(), 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 { Themed as __Themed, defineThemes as __defineThemes } from "@devup-ui/react/native"; +__defineThemes(["light", "dark"], 1); +import { StyleSheet } from "react-native"; +const __s = StyleSheet.create({ + a: { color: "#111" }, + b: { color: "#eee" }, + c: { padding: 4 }, + d: { backgroundColor: "#111" }, + e: { backgroundColor: "#eee" } +}); +function renderItem({ item }) { + return <__Themed $c={Text} $s={(__t) => [__s.a, __s.b][__t]}>{item}; +} +const lower = function() { + return <__Themed $c={Box} $s={(__t) => [null, __s.c][__t]} />; +}; +const { Destructured } = { Destructured: () => <__Themed $c={Box} $s={(__t) => [__s.d, __s.e][__t]} /> }; diff --git a/libs/extractor/src/native/snapshots/extractor__native__tests__hook.snap b/libs/extractor/src/native/snapshots/extractor__native__tests__hook.snap new file mode 100644 index 000000000..ffa60d603 --- /dev/null +++ b/libs/extractor/src/native/snapshots/extractor__native__tests__hook.snap @@ -0,0 +1,23 @@ +--- +source: libs/extractor/src/native/tests.rs +expression: "compile_themed(two_themes(), 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 { useThemeIndex as __useThemeIndex, Themed as __Themed, defineThemes as __defineThemes } from "@devup-ui/react/native"; +__defineThemes(["light", "dark"], 1); +import { StyleSheet } from "react-native"; +const __s = StyleSheet.create({ + a: { backgroundColor: "#5a44ff" }, + b: { backgroundColor: "#8c7bff" }, + c: { backgroundColor: "#111" }, + d: { backgroundColor: "#eee" } +}); +export function useCard() { + const __t = __useThemeIndex(); + return ; +} +export const use = () => { + const __t = __useThemeIndex(); + return ; +}; +export const user = () => <__Themed $c={Box} $s={(__t) => [__s.c, __s.d][__t]} />; diff --git a/libs/extractor/src/native/snapshots/extractor__native__tests__module_scope.snap b/libs/extractor/src/native/snapshots/extractor__native__tests__module_scope.snap new file mode 100644 index 000000000..713cc85b3 --- /dev/null +++ b/libs/extractor/src/native/snapshots/extractor__native__tests__module_scope.snap @@ -0,0 +1,20 @@ +--- +source: libs/extractor/src/native/tests.rs +expression: "compile_themed(two_themes(), 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 { Themed as __Themed, defineThemes as __defineThemes } from "@devup-ui/react/native"; +__defineThemes(["light", "dark"], 1); +import { StyleSheet } from "react-native"; +const __s = StyleSheet.create({ + a: { padding: 4 }, + b: { backgroundColor: "#5a44ff" }, + c: { backgroundColor: "#8c7bff" }, + d: { flexDirection: "row" }, + e: { backgroundColor: "#111" }, + f: { backgroundColor: "#eee" } +}); +const element = <__Themed $c={Box} $s={(__t) => [__s.a, [__s.b, __s.c][__t]]} />; +export const icon = <__Themed key="k" $c={Animated.View} $s={(__t) => [__s.d, [__s.e, __s.f][__t]]}> + t +; diff --git a/libs/extractor/src/native/snapshots/extractor__native__tests__nested_components.snap b/libs/extractor/src/native/snapshots/extractor__native__tests__nested_components.snap new file mode 100644 index 000000000..0c3ce666f --- /dev/null +++ b/libs/extractor/src/native/snapshots/extractor__native__tests__nested_components.snap @@ -0,0 +1,22 @@ +--- +source: libs/extractor/src/native/tests.rs +expression: "compile_themed(two_themes(), 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 { useThemeIndex as __useThemeIndex, defineThemes as __defineThemes } from "@devup-ui/react/native"; +__defineThemes(["light", "dark"], 1); +import { StyleSheet } from "react-native"; +const __s = StyleSheet.create({ + a: { backgroundColor: "#111" }, + b: { backgroundColor: "#eee" }, + c: { backgroundColor: "#5a44ff" }, + d: { backgroundColor: "#8c7bff" } +}); +export function Outer() { + const __t = __useThemeIndex(); + const Inner = () => { + const __t = __useThemeIndex(); + return ; + }; + return ; +} 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 index 86ea5568e..0d58afdd6 100644 --- a/libs/extractor/src/native/snapshots/extractor__native__tests__platform_shapes.snap +++ b/libs/extractor/src/native/snapshots/extractor__native__tests__platform_shapes.snap @@ -2,12 +2,12 @@ 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 +error: test.tsx:2:6: `` cannot use `_ios` on React Native: `_ios` 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 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 block. Fix: write the key itself +test.tsx:2:51: `` cannot use `onPress` on React Native: a 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:89: `` cannot use `_web` on React Native: `_web` 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 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__runtime_false.snap b/libs/extractor/src/native/snapshots/extractor__native__tests__runtime_false.snap index f89fa0aac..ec6bc54a4 100644 --- a/libs/extractor/src/native/snapshots/extractor__native__tests__runtime_false.snap +++ b/libs/extractor/src/native/snapshots/extractor__native__tests__runtime_false.snap @@ -3,5 +3,5 @@ source: libs/extractor/src/native/tests.rs expression: "compile_for(NativePlatform::Ios, runtime, &code)" --- error: test.tsx:2:6: `` cannot use `p` on React Native: a responsive value is chosen by the window width, which needs the React Native runtime that `runtime: false` turns off. Fix: give one value -test.tsx:2:17: `` cannot use `_themeDark` 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:2:17: `` cannot use `_themeDark` on React Native: devup.json defines no `dark` theme. Fix: add the theme to devup.json, or remove the block test.tsx:2:33: `` cannot use `_pressed` on React Native: a press style is chosen while the element is pressed, which needs the React Native runtime that `runtime: false` turns off. Fix: pass a function to the `style` of a React Native `Pressable`, reading `pressed` diff --git a/libs/extractor/src/native/snapshots/extractor__native__tests__runtime_off_one_theme.snap b/libs/extractor/src/native/snapshots/extractor__native__tests__runtime_off_one_theme.snap new file mode 100644 index 000000000..39c59e1e4 --- /dev/null +++ b/libs/extractor/src/native/snapshots/extractor__native__tests__runtime_off_one_theme.snap @@ -0,0 +1,23 @@ +--- +source: libs/extractor/src/native/tests.rs +expression: "compile_themed(theme, false, RUNTIME_OFF_ELEMENTS)" +--- +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: "#000", + width: 8, + color: "red", + padding: 4 + }, + b: { + fontFamily: "Inter", + fontSize: 16, + fontWeight: "500", + lineHeight: 24, + letterSpacing: -.32 + } +}); +; +; diff --git a/libs/extractor/src/native/snapshots/extractor__native__tests__runtime_off_two_themes.snap b/libs/extractor/src/native/snapshots/extractor__native__tests__runtime_off_two_themes.snap new file mode 100644 index 000000000..54ec6c1db --- /dev/null +++ b/libs/extractor/src/native/snapshots/extractor__native__tests__runtime_off_two_themes.snap @@ -0,0 +1,6 @@ +--- +source: libs/extractor/src/native/tests.rs +expression: "compile_themed(theme, false, RUNTIME_OFF_ELEMENTS)" +--- +error: test.tsx:2:6: `` cannot use `bg` 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, or turn the runtime on +test.tsx:2:50: `` cannot use `_themeDark` 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, or turn the runtime on diff --git a/libs/extractor/src/native/snapshots/extractor__native__tests__runtime_true.snap b/libs/extractor/src/native/snapshots/extractor__native__tests__runtime_true.snap index 310298c73..441bb88d5 100644 --- a/libs/extractor/src/native/snapshots/extractor__native__tests__runtime_true.snap +++ b/libs/extractor/src/native/snapshots/extractor__native__tests__runtime_true.snap @@ -3,5 +3,5 @@ source: libs/extractor/src/native/tests.rs expression: "compile_for(NativePlatform::Ios, runtime, &code)" --- error: test.tsx:2:6: `` cannot use `p` 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:17: `` cannot use `_themeDark` on React Native: a theme variant is chosen by the theme the app shows, which needs the React Native runtime that this version does not include yet. Fix: give the value for one theme +test.tsx:2:17: `` cannot use `_themeDark` on React Native: devup.json defines no `dark` theme. Fix: add the theme to devup.json, or remove the block test.tsx:2:33: `` 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` diff --git a/libs/extractor/src/native/snapshots/extractor__native__tests__static_in_component.snap b/libs/extractor/src/native/snapshots/extractor__native__tests__static_in_component.snap new file mode 100644 index 000000000..b466669a4 --- /dev/null +++ b/libs/extractor/src/native/snapshots/extractor__native__tests__static_in_component.snap @@ -0,0 +1,13 @@ +--- +source: libs/extractor/src/native/tests.rs +expression: "compile_themed(two_themes(), 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: { + backgroundColor: "red", + padding: 4 +} }); +export function A() { + return ; +} diff --git a/libs/extractor/src/native/snapshots/extractor__native__tests__theme_api_none.snap b/libs/extractor/src/native/snapshots/extractor__native__tests__theme_api_none.snap new file mode 100644 index 000000000..7257b82fc --- /dev/null +++ b/libs/extractor/src/native/snapshots/extractor__native__tests__theme_api_none.snap @@ -0,0 +1,13 @@ +--- +source: libs/extractor/src/native/tests.rs +expression: output +--- +import { View as Box, Text } from "react-native"; +import { useTheme, setTheme as set, getTheme } from "@devup-ui/react/native"; +import { type DevupTheme } from "@devup-ui/react"; +import { defineThemes as __defineThemes } from "@devup-ui/react/native"; +__defineThemes([]); +export function Toggle() { + const theme = useTheme(); + return set(getTheme() === "dark" ? "light" : "dark")}>{theme}; +} diff --git a/libs/extractor/src/native/snapshots/extractor__native__tests__theme_api_one.snap b/libs/extractor/src/native/snapshots/extractor__native__tests__theme_api_one.snap new file mode 100644 index 000000000..19602c211 --- /dev/null +++ b/libs/extractor/src/native/snapshots/extractor__native__tests__theme_api_one.snap @@ -0,0 +1,13 @@ +--- +source: libs/extractor/src/native/tests.rs +expression: output +--- +import { View as Box, Text } from "react-native"; +import { useTheme, setTheme as set, getTheme } from "@devup-ui/react/native"; +import { type DevupTheme } from "@devup-ui/react"; +import { defineThemes as __defineThemes } from "@devup-ui/react/native"; +__defineThemes(["default"]); +export function Toggle() { + const theme = useTheme(); + return set(getTheme() === "dark" ? "light" : "dark")}>{theme}; +} diff --git a/libs/extractor/src/native/snapshots/extractor__native__tests__theme_api_runtime_off.snap b/libs/extractor/src/native/snapshots/extractor__native__tests__theme_api_runtime_off.snap new file mode 100644 index 000000000..853574b62 --- /dev/null +++ b/libs/extractor/src/native/snapshots/extractor__native__tests__theme_api_runtime_off.snap @@ -0,0 +1,7 @@ +--- +source: libs/extractor/src/native/tests.rs +expression: output +--- +error: test.tsx:1:21: `useTheme` from `@devup-ui/react` cannot be used on React Native: `useTheme` reads or changes the theme the app shows, which needs the React Native runtime that `runtime: false` turns off. Fix: remove it, or turn the runtime on +test.tsx:1:31: `setTheme` from `@devup-ui/react` cannot be used on React Native: `setTheme` reads or changes the theme the app shows, which needs the React Native runtime that `runtime: false` turns off. Fix: remove it, or turn the runtime on +test.tsx:1:48: `getTheme` from `@devup-ui/react` cannot be used on React Native: `getTheme` reads or changes the theme the app shows, which needs the React Native runtime that `runtime: false` turns off. Fix: remove it, or turn the runtime on diff --git a/libs/extractor/src/native/snapshots/extractor__native__tests__theme_api_two.snap b/libs/extractor/src/native/snapshots/extractor__native__tests__theme_api_two.snap new file mode 100644 index 000000000..fd4261a4a --- /dev/null +++ b/libs/extractor/src/native/snapshots/extractor__native__tests__theme_api_two.snap @@ -0,0 +1,13 @@ +--- +source: libs/extractor/src/native/tests.rs +expression: output +--- +import { View as Box, Text } from "react-native"; +import { useTheme, setTheme as set, getTheme } from "@devup-ui/react/native"; +import { type DevupTheme } from "@devup-ui/react"; +import { defineThemes as __defineThemes } from "@devup-ui/react/native"; +__defineThemes(["light", "dark"], 1); +export function Toggle() { + const theme = useTheme(); + return set(getTheme() === "dark" ? "light" : "dark")}>{theme}; +} diff --git a/libs/extractor/src/native/snapshots/extractor__native__tests__theme_bad_values.snap b/libs/extractor/src/native/snapshots/extractor__native__tests__theme_bad_values.snap new file mode 100644 index 000000000..135ba02c0 --- /dev/null +++ b/libs/extractor/src/native/snapshots/extractor__native__tests__theme_bad_values.snap @@ -0,0 +1,6 @@ +--- +source: libs/extractor/src/native/tests.rs +expression: "compile_themed(two_themes(), true, code)" +--- +error: test.tsx:2:28: `` cannot use `lineHeight` on React Native: `#5a44ff` is relative to the font size on the web, but React Native reads a line height in pixels. Fix: write the line height in pixels, such as `24px` +test.tsx:2:50: `` cannot use `fontSize` on React Native: `red` is not one length React Native reads. Fix: use one number of pixels, a `rem` or `em` length, a percentage or `auto` diff --git a/libs/extractor/src/native/snapshots/extractor__native__tests__theme_name_collisions.snap b/libs/extractor/src/native/snapshots/extractor__native__tests__theme_name_collisions.snap new file mode 100644 index 000000000..464fc8baf --- /dev/null +++ b/libs/extractor/src/native/snapshots/extractor__native__tests__theme_name_collisions.snap @@ -0,0 +1,18 @@ +--- +source: libs/extractor/src/native/tests.rs +expression: "compile_themed(two_themes(), 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 { useThemeIndex as __useThemeIndex_, Themed as __Themed_, defineThemes as __defineThemes_ } from "@devup-ui/react/native"; +__defineThemes_(["light", "dark"], 1); +import { StyleSheet } from "react-native"; +const __s = StyleSheet.create({ + a: { backgroundColor: "#5a44ff" }, + b: { backgroundColor: "#8c7bff" } +}); +const __t = 1, __useThemeIndex = 2, __Themed = 3, __defineThemes = 4; +export const A = () => { + const __t_ = __useThemeIndex_(); + return ; +}; +export const b = <__Themed_ $c={Box} $s={(__t_) => [__s.a, __s.b][__t_]} />; diff --git a/libs/extractor/src/native/snapshots/extractor__native__tests__theme_one.snap b/libs/extractor/src/native/snapshots/extractor__native__tests__theme_one.snap new file mode 100644 index 000000000..3b437a956 --- /dev/null +++ b/libs/extractor/src/native/snapshots/extractor__native__tests__theme_one.snap @@ -0,0 +1,50 @@ +--- +source: libs/extractor/src/native/tests.rs +expression: "compile_themed(theme, 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: { + backgroundColor: "#5a44ff", + width: 16, + boxShadow: "0 1px 2px #0003", + borderWidth: 1, + borderStyle: "solid", + borderColor: "#5a44ff", + padding: 4 + }, + b: { + fontFamily: "Inter", + fontSize: 16, + fontWeight: "500", + lineHeight: 24, + letterSpacing: -.32 + }, + c: { color: "#5a44ff" }, + d: { color: "#111" }, + e: { + fontSize: 12, + lineHeight: 18, + letterSpacing: 1, + textTransform: "uppercase" + }, + f: { fontStyle: "italic" }, + g: { + fontSize: 12, + lineHeight: 18, + letterSpacing: 1, + textTransform: "uppercase", + margin: 2 + }, + h: { + fontSize: 24, + lineHeight: 31.2 + } +}); +export const Card = ({ on }) => + + + + + ; diff --git a/libs/extractor/src/native/snapshots/extractor__native__tests__theme_responsive_tokens.snap b/libs/extractor/src/native/snapshots/extractor__native__tests__theme_responsive_tokens.snap new file mode 100644 index 000000000..ee9541720 --- /dev/null +++ b/libs/extractor/src/native/snapshots/extractor__native__tests__theme_responsive_tokens.snap @@ -0,0 +1,5 @@ +--- +source: libs/extractor/src/native/tests.rs +expression: "compile_themed(two_themes(), true, code)" +--- +error: test.tsx:2:6: `` cannot use `p` on React Native: `gutter` has a value at each breakpoint: a responsive value is chosen by the window width, which needs the React Native runtime that this version does not include yet. Fix: give it one value in devup.json, or write the value itself diff --git a/libs/extractor/src/native/snapshots/extractor__native__tests__theme_selector.snap b/libs/extractor/src/native/snapshots/extractor__native__tests__theme_selector.snap index 84d799026..678e22089 100644 --- a/libs/extractor/src/native/snapshots/extractor__native__tests__theme_selector.snap +++ b/libs/extractor/src/native/snapshots/extractor__native__tests__theme_selector.snap @@ -2,4 +2,4 @@ source: libs/extractor/src/native/tests.rs expression: compile(code) --- -error: test.tsx:2:6: `` cannot use `_themeDark` on React Native: a theme variant is chosen by the theme the app shows, which needs the React Native runtime that this version does not include yet. Fix: give the value for one theme +error: test.tsx:2:6: `` cannot use `_themeDark` on React Native: devup.json defines no `dark` theme. Fix: add the theme to devup.json, or remove the block diff --git a/libs/extractor/src/native/snapshots/extractor__native__tests__theme_three.snap b/libs/extractor/src/native/snapshots/extractor__native__tests__theme_three.snap new file mode 100644 index 000000000..543876e72 --- /dev/null +++ b/libs/extractor/src/native/snapshots/extractor__native__tests__theme_three.snap @@ -0,0 +1,36 @@ +--- +source: libs/extractor/src/native/tests.rs +expression: "compile_themed(theme, 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 { useThemeIndex as __useThemeIndex, defineThemes as __defineThemes } from "@devup-ui/react/native"; +__defineThemes([ + "light", + "dark", + "sepia" +], 1); +import { StyleSheet } from "react-native"; +const __s = StyleSheet.create({ + a: { + backgroundColor: "#5a44ff", + color: "#111" + }, + b: { + backgroundColor: "#8c7bff", + color: "#eee", + margin: 4 + }, + c: { + backgroundColor: "#704214", + color: "#3b2a1a", + padding: 8 + } +}); +export function Card() { + const __t = __useThemeIndex(); + return ; +} diff --git a/libs/extractor/src/native/snapshots/extractor__native__tests__theme_token.snap b/libs/extractor/src/native/snapshots/extractor__native__tests__theme_token.snap index b470711ef..4654687aa 100644 --- a/libs/extractor/src/native/snapshots/extractor__native__tests__theme_token.snap +++ b/libs/extractor/src/native/snapshots/extractor__native__tests__theme_token.snap @@ -2,4 +2,4 @@ source: libs/extractor/src/native/tests.rs expression: compile(code) --- -error: test.tsx:2:6: `` cannot use `bg` on React Native: the theme token in `$primary` is not read on React Native yet. Fix: write the value itself +error: test.tsx:2:6: `` cannot use `bg` on React Native: devup.json defines no `$primary` token. Fix: add the token to the theme in devup.json, or write the value itself diff --git a/libs/extractor/src/native/snapshots/extractor__native__tests__theme_token_loop.snap b/libs/extractor/src/native/snapshots/extractor__native__tests__theme_token_loop.snap new file mode 100644 index 000000000..39f783159 --- /dev/null +++ b/libs/extractor/src/native/snapshots/extractor__native__tests__theme_token_loop.snap @@ -0,0 +1,5 @@ +--- +source: libs/extractor/src/native/tests.rs +expression: "compile_themed(two_themes(), true, code)" +--- +error: test.tsx:2:6: `` cannot use `bg` on React Native: the tokens in `$loopA` name each other without end. Fix: give one of the tokens a value in devup.json diff --git a/libs/extractor/src/native/snapshots/extractor__native__tests__theme_two.snap b/libs/extractor/src/native/snapshots/extractor__native__tests__theme_two.snap new file mode 100644 index 000000000..b19bcaf8f --- /dev/null +++ b/libs/extractor/src/native/snapshots/extractor__native__tests__theme_two.snap @@ -0,0 +1,87 @@ +--- +source: libs/extractor/src/native/tests.rs +expression: "compile_themed(theme, 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 { useThemeIndex as __useThemeIndex, defineThemes as __defineThemes } from "@devup-ui/react/native"; +__defineThemes(["light", "dark"], 1); +import { StyleSheet } from "react-native"; +const __s = StyleSheet.create({ + a: { + padding: 16, + borderRadius: 8, + width: 16 + }, + b: { + backgroundColor: "#fff", + boxShadow: "0 1px 2px #0003" + }, + c: { + backgroundColor: "#1a1a2e", + boxShadow: "0 1px 2px #0009" + }, + d: { + fontFamily: "Inter", + fontSize: 16, + fontWeight: "500", + lineHeight: 24, + letterSpacing: -.32 + }, + e: { color: "#5a44ff" }, + f: { color: "#8c7bff" }, + g: { color: "#111" }, + h: { color: "#eee" }, + i: { color: "red" }, + j: { + fontSize: 12, + lineHeight: 18, + letterSpacing: 1, + textTransform: "uppercase" + }, + k: { + fontSize: 14, + lineHeight: 21, + letterSpacing: 1, + textTransform: "uppercase" + }, + l: { borderColor: "#eef" }, + m: { borderColor: "#223" }, + n: { + borderWidth: 1, + borderStyle: "solid", + borderColor: "#5a44ff" + }, + o: { + borderWidth: 1, + borderStyle: "solid", + borderColor: "#8c7bff" + }, + p: { margin: 8 }, + q: { opacity: .5 }, + r: { padding: 4 }, + s: { padding: 8 }, + t: { + backgroundColor: "#5a44ff", + margin: 4 + }, + u: { color: "#000" } +}); +export function Card({ on, color }) { + const __t = __useThemeIndex(); + return + Hi + + + + ; +} diff --git a/libs/extractor/src/native/snapshots/extractor__native__tests__theme_typographies.snap b/libs/extractor/src/native/snapshots/extractor__native__tests__theme_typographies.snap new file mode 100644 index 000000000..8d134d650 --- /dev/null +++ b/libs/extractor/src/native/snapshots/extractor__native__tests__theme_typographies.snap @@ -0,0 +1,9 @@ +--- +source: libs/extractor/src/native/tests.rs +expression: "compile_themed(two_themes(), true, code)" +--- +error: test.tsx:2:7: `` cannot use `typography` on React Native: devup.json defines no `missing` typography. Fix: add the typography to the theme in devup.json +test.tsx:3:7: `` cannot use `typography` on React Native: `heading` has a value at each breakpoint: a responsive value is chosen by the window width, which needs the React Native runtime that this version does not include yet. Fix: give it one value in devup.json, or write the value itself +test.tsx:4:7: `` cannot use `typography` on React Native: the build reads the styles of a typography by its name, which a value read at runtime does not give. Fix: write the name, or a condition between names such as `typography={big ? 'h1' : 'body'}` +test.tsx:5:7: `` cannot use `typography` on React Native: `2em` is relative to the font size, and the typography has no font size in pixels. Fix: give the typography a `fontSize` in pixels, or the value in pixels +test.tsx:6:7: `` cannot use `typography` on React Native: devup.json defines no `1` typography. Fix: add the typography to the theme in devup.json diff --git a/libs/extractor/src/native/snapshots/extractor__native__tests__theme_unknown_theme.snap b/libs/extractor/src/native/snapshots/extractor__native__tests__theme_unknown_theme.snap new file mode 100644 index 000000000..d41c11540 --- /dev/null +++ b/libs/extractor/src/native/snapshots/extractor__native__tests__theme_unknown_theme.snap @@ -0,0 +1,6 @@ +--- +source: libs/extractor/src/native/tests.rs +expression: "compile_themed(two_themes(), true, code)" +--- +error: test.tsx:2:6: `` cannot use `_themeSepia` on React Native: devup.json defines no `sepia` theme. Fix: add the theme to devup.json, or remove the block +test.tsx:2:29: `` cannot use `_themeDark` on React Native: `_themeDark` takes an object of styles. Fix: write the styles in an object, such as `_themeDark={{ p: 2 }}` diff --git a/libs/extractor/src/native/snapshots/extractor__native__tests__theme_unknown_token.snap b/libs/extractor/src/native/snapshots/extractor__native__tests__theme_unknown_token.snap new file mode 100644 index 000000000..fdcc6a126 --- /dev/null +++ b/libs/extractor/src/native/snapshots/extractor__native__tests__theme_unknown_token.snap @@ -0,0 +1,6 @@ +--- +source: libs/extractor/src/native/tests.rs +expression: "compile_themed(two_themes(), true, code)" +--- +error: test.tsx:2:6: `` cannot use `bg` on React Native: devup.json defines no `$missing` token. Fix: add the token to the theme in devup.json, or write the value itself +test.tsx:2:20: `` cannot use `color` on React Native: devup.json defines no `$primary.200` token. Fix: add the token to the theme in devup.json, or write the value itself diff --git a/libs/extractor/src/native/snapshots/extractor__native__tests__typography.snap b/libs/extractor/src/native/snapshots/extractor__native__tests__typography.snap index 082920853..34badf314 100644 --- a/libs/extractor/src/native/snapshots/extractor__native__tests__typography.snap +++ b/libs/extractor/src/native/snapshots/extractor__native__tests__typography.snap @@ -2,4 +2,4 @@ source: libs/extractor/src/native/tests.rs expression: compile(code) --- -error: test.tsx:2:7: `` cannot use `typography` on React Native: theme typography is not read on React Native yet. Fix: write `fontSize`, `fontWeight`, `lineHeight` and `letterSpacing` themselves +error: test.tsx:2:7: `` cannot use `typography` on React Native: devup.json defines no `heading` typography. Fix: add the typography to the theme in devup.json diff --git a/libs/extractor/src/native/snapshots/extractor__native__tests__wrapped.snap b/libs/extractor/src/native/snapshots/extractor__native__tests__wrapped.snap new file mode 100644 index 000000000..86142f201 --- /dev/null +++ b/libs/extractor/src/native/snapshots/extractor__native__tests__wrapped.snap @@ -0,0 +1,25 @@ +--- +source: libs/extractor/src/native/tests.rs +expression: "compile_themed(two_themes(), 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 { useThemeIndex as __useThemeIndex, Themed as __Themed, defineThemes as __defineThemes } from "@devup-ui/react/native"; +__defineThemes(["light", "dark"], 1); +import { StyleSheet } from "react-native"; +const __s = StyleSheet.create({ + a: { backgroundColor: "#5a44ff" }, + b: { backgroundColor: "#8c7bff" }, + c: { backgroundColor: "#111" }, + d: { backgroundColor: "#eee" } +}); +export const A = memo(forwardRef((props, ref) => { + const __t = __useThemeIndex(); + return ; +})); +export const B = React.memo(function() { + const __t = __useThemeIndex(); + return ; +}); +export const C = wrap(() => <__Themed $c={Box} $s={(__t) => [__s.c, __s.d][__t]} />); +export const D = wrap()(() => <__Themed $c={Box} $s={(__t) => [__s.c, __s.d][__t]} />); +export const E = 1; diff --git a/libs/extractor/src/native/style.rs b/libs/extractor/src/native/style.rs index 8ab4c03ec..39c8ff251 100644 --- a/libs/extractor/src/native/style.rs +++ b/libs/extractor/src/native/style.rs @@ -20,6 +20,55 @@ pub(super) enum Choice { consequent: Box, alternate: Box, }, + /// Styles the build knows for each theme, in the order of the theme + /// names; the element picks one by the theme the app shows + Themed(Vec>), + /// A choice that applies only while the theme at `index` shows + InTheme { index: usize, choice: Box }, +} + +/// The choice of `variants`, one a theme: static when every theme declares +/// the same styles +pub(super) fn themed(mut variants: Vec>) -> Choice { + if variants.windows(2).all(|pair| pair[0] == pair[1]) { + variants + .pop() + .filter(|declarations| !declarations.is_empty()) + .map_or(Choice::Empty, Choice::Static) + } else { + Choice::Themed(variants) + } +} + +/// `choice` applied only while the theme at `index` of `count` shows +pub(super) fn in_theme(index: usize, count: usize, choice: Choice) -> Choice { + match choice { + Choice::Empty => Choice::Empty, + choice if count <= 1 => choice, + Choice::Static(declarations) => Choice::Themed( + (0..count) + .map(|at| { + if at == index { + declarations.clone() + } else { + Vec::new() + } + }) + .collect(), + ), + Choice::Themed(mut variants) => { + for (at, variant) in variants.iter_mut().enumerate() { + if at != index { + variant.clear(); + } + } + Choice::Themed(variants) + } + choice => Choice::InTheme { + index, + choice: Box::new(choice), + }, + } } impl Choice { @@ -27,18 +76,36 @@ impl Choice { fn declares(&self, key: &str) -> bool { match self { Self::Empty => false, - Self::Static(declarations) => declarations.iter().any(|(name, _)| name == key), + Self::Static(declarations) => declares(declarations, key), Self::Dynamic(values) => values.iter().any(|(name, _)| name == key), Self::Condition { consequent, alternate, .. } => consequent.declares(key) || alternate.declares(key), + Self::Themed(variants) => variants + .iter() + .any(|declarations| declares(declarations, key)), + Self::InTheme { choice, .. } => choice.declares(key), + } + } + + /// Whether the choice reads the theme the app shows + pub(super) fn reads_theme(&self) -> bool { + match self { + Self::Empty | Self::Static(_) | Self::Dynamic(_) => false, + Self::Condition { + consequent, + alternate, + .. + } => consequent.reads_theme() || alternate.reads_theme(), + Self::Themed(_) | Self::InTheme { .. } => true, } } - /// The code of the choice, its static styles named in `sheet` - fn code(&self, sheet: &mut Sheet) -> String { + /// The code of the choice, its static styles named in `sheet` and the + /// index of the theme read from `theme` + fn code(&self, sheet: &mut Sheet, theme: &str) -> String { match self { Self::Empty => "null".to_string(), Self::Static(declarations) => sheet.reference(declarations), @@ -50,21 +117,42 @@ impl Choice { } => { let test = operand(test); match alternate.as_ref() { - Self::Empty => format!("{test} && {}", consequent.operand_code(sheet)), + Self::Empty => { + format!("{test} && {}", consequent.operand_code(sheet, theme)) + } alternate => format!( "{test} ? {} : {}", - consequent.operand_code(sheet), - alternate.operand_code(sheet) + consequent.operand_code(sheet, theme), + alternate.operand_code(sheet, theme) ), } } + Self::Themed(variants) => { + let references: Vec = variants + .iter() + .map(|declarations| { + if declarations.is_empty() { + "null".to_string() + } else { + sheet.reference(declarations) + } + }) + .collect(); + format!("[{}][{theme}]", references.join(", ")) + } + Self::InTheme { index, choice } => { + format!( + "{theme} === {index} && {}", + choice.operand_code(sheet, theme) + ) + } } } /// The code of the choice as an operand of a condition - fn operand_code(&self, sheet: &mut Sheet) -> String { - let code = self.code(sheet); - if matches!(self, Self::Condition { .. }) { + fn operand_code(&self, sheet: &mut Sheet, theme: &str) -> String { + let code = self.code(sheet, theme); + if matches!(self, Self::Condition { .. } | Self::InTheme { .. }) { format!("({code})") } else { code @@ -72,6 +160,10 @@ impl Choice { } } +fn declares(declarations: &[Declaration], key: &str) -> bool { + declarations.iter().any(|(name, _)| name == key) +} + /// `code` as an operand: a name or a member read as it is, else parenthesized fn operand(code: &str) -> String { if code @@ -103,6 +195,30 @@ fn merge(declarations: &mut Vec, later: Vec) { } } +/// `later` merged into the last of `rest` when both are static or both +/// differ by theme, else `later` itself to apply after it +fn merge_last(rest: &mut [Choice], later: Choice) -> Option { + match (rest.last_mut(), later) { + (Some(Choice::Static(last)), Choice::Static(declarations)) => { + merge(last, declarations); + None + } + (Some(Choice::Themed(last)), Choice::Static(declarations)) => { + for variant in last { + merge(variant, declarations.clone()); + } + None + } + (Some(Choice::Themed(last)), Choice::Themed(variants)) => { + for (variant, later) in last.iter_mut().zip(variants) { + merge(variant, later); + } + None + } + (_, later) => Some(later), + } +} + /// The choices of an element in the order they apply, with as many static /// styles as can be moved first merged into one fn ordered(choices: Vec) -> Vec { @@ -111,19 +227,17 @@ fn ordered(choices: Vec) -> Vec { for choice in choices { match choice { Choice::Empty => {} - Choice::Static(declarations) => { + Choice::Static(declarations) if declarations .iter() - .all(|(key, _)| rest.iter().all(|choice| !choice.declares(key))) - { - merge(&mut first, declarations); - } else if let Some(Choice::Static(last)) = rest.last_mut() { - merge(last, declarations); - } else { - rest.push(Choice::Static(declarations)); - } + .all(|(key, _)| rest.iter().all(|choice| !choice.declares(key))) => + { + merge(&mut first, declarations); + } + choice => { + let unmerged = merge_last(&mut rest, choice); + rest.extend(unmerged); } - choice => rest.push(choice), } } if !first.is_empty() { @@ -132,25 +246,36 @@ fn ordered(choices: Vec) -> Vec { rest } +/// The `style` an element takes, and whether it reads the theme the app shows +pub(super) struct StyleCode { + pub code: String, + pub reads_theme: bool, +} + /// The code of the `style` an element takes: its choices, then the code of /// the styles it is given whole (a spread's `style`, its own `style` prop); -/// `None` when its props declare no style, and it keeps what it is given +/// `None` when its props declare no style, and it keeps what it is given. +/// The index of the theme the app shows is read from `theme` pub(super) fn style_code( choices: Vec, given: Vec, sheet: &mut Sheet, -) -> Option { - let mut entries: Vec = ordered(choices) + theme: &str, +) -> Option { + let choices = ordered(choices); + let reads_theme = choices.iter().any(Choice::reads_theme); + let mut entries: Vec = choices .iter() - .map(|choice| choice.code(sheet)) + .map(|choice| choice.code(sheet, theme)) .collect(); if entries.is_empty() { return None; } entries.extend(given); - Some(if entries.len() == 1 { + let code = if entries.len() == 1 { entries.concat() } else { format!("[{}]", entries.join(", ")) - }) + }; + Some(StyleCode { code, reads_theme }) } diff --git a/libs/extractor/src/native/tests.rs b/libs/extractor/src/native/tests.rs index 648716e5b..768151e1e 100644 --- a/libs/extractor/src/native/tests.rs +++ b/libs/extractor/src/native/tests.rs @@ -5,17 +5,25 @@ use super::element::units_declaration; use super::errors::{Problem, RuntimeFeature}; use super::props::Declaration; use super::sheet::{Sheet, key_name}; -use super::style::{Choice, style_code}; +use super::style::{Choice, in_theme, style_code, themed}; use super::values::{Literal, NativeValue, css_text, number_or_text, quoted_list}; -use super::{NativePlatform, NativeTarget}; +use super::{NativePlatform, NativeTarget, NativeTheme, TokenLevels, TypographyProperties}; use crate::{ExtractOption, ExtractTarget, extract, extract_without_source_map}; const IMPORT: &str = "import { Box, Button, Center, Flex, Image, Input, Text, VStack } from '@devup-ui/react'\n"; fn option(platform: NativePlatform, runtime: bool) -> ExtractOption { + themed_option(platform, runtime, NativeTheme::default()) +} + +fn themed_option(platform: NativePlatform, runtime: bool, theme: NativeTheme) -> ExtractOption { ExtractOption { - target: ExtractTarget::Native(NativeTarget { platform, runtime }), + target: ExtractTarget::Native(NativeTarget { + platform, + runtime, + theme: std::sync::Arc::new(theme), + }), ..ExtractOption::default() } } @@ -421,7 +429,9 @@ fn style_code_orders_and_merges_choices() { ], vec!["given".to_string()], &mut sheet, - ); + "t", + ) + .map(|style| style.code); assert_eq!( code.as_deref(), Some( @@ -432,9 +442,14 @@ fn style_code_orders_and_merges_choices() { 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 + assert!( + style_code( + vec![Choice::Empty], + vec!["given".to_string()], + &mut sheet, + "t" + ) + .is_none() ); } @@ -452,10 +467,11 @@ fn problems_format_for_props_and_imports() { let target = NativeTarget { platform: NativePlatform::Ios, runtime: true, + theme: std::sync::Arc::default(), }; assert!( RuntimeFeature::Pressed - .problem(target) + .problem(&target) .fix .contains("Pressable") ); @@ -489,3 +505,369 @@ fn runtime_values_convert_as_literals_do(#[case] arguments: &str, #[case] expect // Then assert_eq!(value.ok().as_deref(), Some(expected), "{code}"); } + +/// A token with one value a theme, `None` where the theme lacks it +fn per_theme(values: &[Option<&str>]) -> Vec> { + values + .iter() + .map(|value| value.map(|value| vec![Some(value.to_string())])) + .collect() +} + +fn typography_entry(properties: &[(&str, &str)]) -> TypographyProperties { + properties + .iter() + .map(|(property, value)| ((*property).to_string(), (*value).to_string())) + .collect() +} + +/// A theme named `names`, each token with its values in them, and the +/// tokens and typographies every test reads +fn theme(names: &[&str], dark: Option, tokens: &[(&str, &[Option<&str>])]) -> NativeTheme { + let mut all: std::collections::BTreeMap>> = tokens + .iter() + .map(|(name, values)| ((*name).to_string(), per_theme(values))) + .collect(); + all.insert( + "gutter".to_string(), + vec![Some(vec![Some("4px".to_string()), None, Some("8px".to_string())]); names.len()], + ); + all.insert( + "trailing".to_string(), + vec![Some(vec![Some("2px".to_string()), None]); names.len()], + ); + all.insert( + "loopA".to_string(), + per_theme(&vec![Some("$loopB"); names.len()]), + ); + all.insert( + "loopB".to_string(), + per_theme(&vec![Some("$loopA"); names.len()]), + ); + NativeTheme { + names: names.iter().map(|name| (*name).to_string()).collect(), + dark, + tokens: all, + typography: [ + ( + "body", + vec![Some(typography_entry(&[ + ("font-family", "Inter"), + ("font-size", "16px"), + ("font-weight", "500"), + ("line-height", "1.5"), + ("letter-spacing", "-0.02em"), + ]))], + ), + ( + "caption", + vec![ + Some(typography_entry(&[ + ("font-size", "$captionSize"), + ("line-height", "150%"), + ("letter-spacing", "1px"), + ("text-transform", "uppercase"), + ])), + None, + ], + ), + ( + "loose", + vec![Some(typography_entry(&[ + ("line-height", "normal"), + ("letter-spacing", "normal"), + ("font-style", "italic"), + ]))], + ), + ( + "relative", + vec![Some(typography_entry(&[("line-height", "2em")]))], + ), + ( + "rounded", + vec![Some(typography_entry(&[ + ("font-size", "24px"), + ("line-height", "1.3"), + ]))], + ), + ( + "heading", + vec![ + Some(typography_entry(&[("font-size", "24px")])), + None, + Some(typography_entry(&[("font-size", "32px")])), + ], + ), + ] + .into_iter() + .map(|(name, levels)| (name.to_string(), levels)) + .collect(), + } +} + +fn one_theme() -> NativeTheme { + theme( + &["default"], + None, + &[ + ("primary", &[Some("#5a44ff")]), + ("text", &[Some("#111")]), + ("containerX", &[Some("16px")]), + ("card", &[Some("0 1px 2px $shadow")]), + ("shadow", &[Some("#0003")]), + ("captionSize", &[Some("12px")]), + ], + ) +} + +fn two_themes() -> NativeTheme { + theme( + &["light", "dark"], + Some(1), + &[ + ("primary", &[Some("#5a44ff"), Some("#8c7bff")]), + ("text", &[Some("#111"), Some("#eee")]), + ("surface", &[Some("#fff"), Some("#1a1a2e")]), + ("same", &[Some("red"), Some("red")]), + ("containerX", &[Some("16px"), Some("16px")]), + ("card", &[Some("0 1px 2px #0003"), Some("0 1px 2px #0009")]), + ("onlyDark", &[None, Some("#000")]), + ("captionSize", &[Some("12px"), Some("14px")]), + ("primary-100", &[Some("#eef"), Some("#223")]), + ], + ) +} + +fn three_themes() -> NativeTheme { + theme( + &["light", "dark", "sepia"], + Some(1), + &[ + ( + "primary", + &[Some("#5a44ff"), Some("#8c7bff"), Some("#704214")], + ), + ("text", &[Some("#111"), Some("#eee"), Some("#3b2a1a")]), + ("captionSize", &[Some("12px"), Some("12px"), Some("12px")]), + ], + ) +} + +/// `code` after the import of every component, compiled for iOS with `theme` +fn compile_themed(theme: NativeTheme, runtime: bool, code: &str) -> String { + match extract( + "test.tsx", + &format!("{IMPORT}{code}"), + themed_option(NativePlatform::Ios, runtime, theme), + ) { + Ok(output) => output.code, + Err(error) => format!("error: {error}"), + } +} + +const ONE_THEME_ELEMENTS: &str = r#"export const Card = ({ on }) => ( + + + + + + +)"#; + +const TWO_THEME_ELEMENTS: &str = r#"export function Card({ on, color }) { + return ( + + Hi + + + + + ) +}"#; + +const THREE_THEME_ELEMENTS: &str = r#"export function Card() { + return +}"#; + +#[rstest] +#[case::one_theme("theme_one", one_theme(), ONE_THEME_ELEMENTS)] +#[case::two_themes("theme_two", two_themes(), TWO_THEME_ELEMENTS)] +#[case::three_themes("theme_three", three_themes(), THREE_THEME_ELEMENTS)] +fn compiles_themes(#[case] name: &str, #[case] theme: NativeTheme, #[case] code: &str) { + assert_snapshot!(name, compile_themed(theme, true, code)); +} + +#[rstest] +#[case::arrow_expression("arrow_expression", "export const A = () => ")] +#[case::arrow_parenthesized( + "arrow_parenthesized", + "export const A = () => (\n \n)" +)] +#[case::arrow_block( + "arrow_block", + "export const A = () => {\n \"use memo\"\n return \n}" +)] +#[case::function_declaration( + "function_declaration", + "function A() {\n const x = 1\n return <>\n}" +)] +#[case::wrapped( + "wrapped", + "export const A = memo(forwardRef((props, ref) => ));\nexport const B = React.memo(function () { return });\nexport const C = (wrap)(() => );\nexport const D = wrap()(() => );\nexport const E = 1" +)] +#[case::export_default_arrow( + "export_default_arrow", + "export default () => " +)] +#[case::export_default_function( + "export_default_function", + "export default function () {\n return \n}" +)] +#[case::export_default_value("export_default_value", "export default ")] +#[case::hook( + "hook", + "export function useCard() {\n return \n}\nexport const use = () => ;\nexport const user = () => " +)] +#[case::callback_in_component( + "callback_in_component", + "export function List({ items }) {\n return {items.map((item) => {item})}\n}" +)] +#[case::nested_components( + "nested_components", + "export function Outer() {\n const Inner = () => \n return \n}" +)] +#[case::module_scope( + "module_scope", + "const element = ;\nexport const icon = \n t\n" +)] +#[case::helper_function( + "helper_function", + "function renderItem({ item }) {\n return {item}\n}\nconst lower = function () { return }\nconst { Destructured } = { Destructured: () => }" +)] +#[case::class_component( + "class_component", + "export class A extends Component {\n render() {\n return \n }\n}" +)] +#[case::static_in_component( + "static_in_component", + "export function A() {\n return \n}" +)] +#[case::declared_function( + "declared_function", + "declare function Typed(): void\nexport function A() {\n return \n}" +)] +#[case::name_collisions( + "theme_name_collisions", + "const __t = 1, __useThemeIndex = 2, __Themed = 3, __defineThemes = 4;\nexport const A = () => ;\nexport const b = " +)] +fn places_the_theme_hook(#[case] name: &str, #[case] code: &str) { + assert_snapshot!(name, compile_themed(two_themes(), true, code)); +} + +const THEME_API: &str = r"import { Box, Text, useTheme, setTheme as set, getTheme, type DevupTheme } from '@devup-ui/react' +export function Toggle() { + const theme = useTheme() + return set(getTheme() === 'dark' ? 'light' : 'dark')}>{theme} +}"; + +#[rstest] +#[case::two_themes("theme_api_two", two_themes(), true)] +#[case::one_theme("theme_api_one", one_theme(), true)] +#[case::no_theme("theme_api_none", NativeTheme::default(), true)] +#[case::runtime_off("theme_api_runtime_off", two_themes(), false)] +fn compiles_theme_api(#[case] name: &str, #[case] theme: NativeTheme, #[case] runtime: bool) { + let output = match extract( + "test.tsx", + THEME_API, + themed_option(NativePlatform::Ios, runtime, theme), + ) { + Ok(output) => output.code, + Err(error) => format!("error: {error}"), + }; + assert_snapshot!(name, output); +} + +#[test] +fn theme_api_alone_defines_the_themes_at_the_end() { + let output = extract( + "test.tsx", + "import { setTheme } from '@devup-ui/react'\n", + themed_option(NativePlatform::Ios, true, two_themes()), + ) + .map(|output| output.code); + assert_eq!( + output.ok().as_deref(), + Some( + "import { setTheme } from \"@devup-ui/react/native\";\nimport { defineThemes as __defineThemes } from \"@devup-ui/react/native\";\n__defineThemes([\"light\", \"dark\"], 1);\n" + ) + ); +} + +const RUNTIME_OFF_ELEMENTS: &str = r#"; +"#; + +#[rstest] +#[case::one_theme("runtime_off_one_theme", theme(&["dark"], Some(0), &[("primary", &[Some("#000")]), ("containerX", &[Some("8px")]), ("same", &[Some("red")])]))] +#[case::two_themes("runtime_off_two_themes", two_themes())] +fn runtime_off_keeps_single_values(#[case] name: &str, #[case] theme: NativeTheme) { + assert_snapshot!(name, compile_themed(theme, false, RUNTIME_OFF_ELEMENTS)); +} + +#[rstest] +#[case::unknown_token( + "theme_unknown_token", + "" +)] +#[case::responsive_tokens("theme_responsive_tokens", "")] +#[case::typographies( + "theme_typographies", + ";\n;\n;\n;\n" +)] +#[case::unknown_theme("theme_unknown_theme", "")] +#[case::token_loop("theme_token_loop", "")] +#[case::bad_values( + "theme_bad_values", + "" +)] +fn theme_errors(#[case] name: &str, #[case] code: &str) { + assert_snapshot!(name, compile_themed(two_themes(), true, code)); +} + +#[rstest] +#[case("$primary", Some(("", "primary", "")))] +#[case("1px solid $gray.100, red", Some(("1px solid ", "gray.100", ", red")))] +#[case("$a-b_c $d", Some(("", "a-b_c", " $d")))] +#[case("$-a $b", Some(("$-a ", "b", "")))] +#[case("cost $", None)] +#[case("no tokens", None)] +fn finds_tokens(#[case] text: &str, #[case] expected: Option<(&str, &str, &str)>) { + assert_eq!(super::theme::next_token(text), expected); +} + +#[rstest] +#[case("_themeDark", "dark")] +#[case("_themeHighContrast", "highContrast")] +#[case("_themeSepia2", "sepia2")] +fn names_selector_themes(#[case] prop: &str, #[case] expected: &str) { + assert_eq!(super::theme::selector_theme(prop), expected); +} + +#[test] +fn themed_choices_collapse_when_every_theme_agrees() { + let red = declarations(&[("opacity", 1.0)]); + assert_eq!(themed(vec![]), Choice::Empty); + assert_eq!(themed(vec![vec![], vec![]]), Choice::Empty); + assert_eq!( + themed(vec![red.clone(), red.clone()]), + Choice::Static(red.clone()) + ); + assert_eq!( + in_theme(0, 1, Choice::Static(red.clone())), + Choice::Static(red.clone()) + ); + assert_eq!(in_theme(1, 2, Choice::Empty), Choice::Empty); + assert_eq!( + in_theme(1, 2, Choice::Static(red.clone())), + Choice::Themed(vec![vec![], red]) + ); +} diff --git a/libs/extractor/src/native/theme.rs b/libs/extractor/src/native/theme.rs new file mode 100644 index 000000000..c7f99a530 --- /dev/null +++ b/libs/extractor/src/native/theme.rs @@ -0,0 +1,186 @@ +//! The theme of `devup.json` as the React Native output reads it: the names +//! of the themes in the order the runtime indexes them, and the value of each +//! token and typography in every theme, resolved at build time. + +use std::borrow::Cow; +use std::collections::BTreeMap; + +use super::NativeTarget; +use super::errors::{Problem, RuntimeFeature}; + +/// The values of a token at each breakpoint, `None` where it has none +pub type TokenLevels = Vec>; + +/// The CSS properties of a typography, each with its value +pub type TypographyProperties = Vec<(String, String)>; + +/// The theme a file is compiled with. Built from `devup.json` by the +/// bindings, which read it with the web's theme parser +#[derive(Debug, Clone, Default, PartialEq, Eq)] +pub struct NativeTheme { + /// The theme names, the default first: the runtime picks a style object by + /// the index of a name here + pub names: Vec, + /// The index of the theme the system's dark appearance shows, if any + pub dark: Option, + /// Each token by its CSS variable name (`primary`, `gray-100`), with its + /// values in each theme, in the order of `names`; `None` in a theme that + /// does not define it + pub tokens: BTreeMap>>, + /// Each typography by name, with its properties at each breakpoint + pub typography: BTreeMap>>, +} + +/// How many times a token's value may name another token +const MAX_TOKEN_DEPTH: usize = 8; + +impl NativeTheme { + /// How many style objects a value that differs by theme takes: one a + /// theme, and one when the theme defines no theme at all + pub(super) fn count(&self) -> usize { + self.names.len().max(1) + } + + /// The index of the theme `name` + pub(super) fn index_of(&self, name: &str) -> Option { + self.names.iter().position(|theme| theme == name) + } + + /// `text` with each `$token` replaced by its value in the theme at + /// `index`, or `None` when that theme does not define one of them + pub(super) fn resolve<'t>( + &self, + text: &'t str, + index: usize, + target: &NativeTarget, + ) -> Result>, Problem> { + if !text.contains('$') { + return Ok(Some(Cow::Borrowed(text))); + } + let mut resolved = text.to_string(); + for _ in 0..MAX_TOKEN_DEPTH { + match self.resolve_once(&resolved, index, target)? { + Some(next) if next == resolved => return Ok(Some(Cow::Owned(next))), + Some(next) => resolved = next, + None => return Ok(None), + } + } + Err(Problem::new( + format!("the tokens in `{text}` name each other without end"), + "give one of the tokens a value in devup.json", + )) + } + + /// `text` with each `$token` replaced once + fn resolve_once( + &self, + text: &str, + index: usize, + target: &NativeTarget, + ) -> Result, Problem> { + let mut resolved = String::with_capacity(text.len()); + let mut rest = text; + while let Some((before, token, after)) = next_token(rest) { + resolved.push_str(before); + match self.token(token, index, target)? { + Some(value) => resolved.push_str(value), + None => return Ok(None), + } + rest = after; + } + resolved.push_str(rest); + Ok(Some(resolved)) + } + + /// The value of `token` (as written after `$`) in the theme at `index` + fn token( + &self, + token: &str, + index: usize, + target: &NativeTarget, + ) -> Result, Problem> { + let key = token.replace('.', "-"); + let themes = self.tokens.get(&key).ok_or_else(|| { + Problem::new( + format!("devup.json defines no `${token}` token"), + "add the token to the theme in devup.json, or write the value itself", + ) + })?; + if themes.iter().flatten().any(is_responsive) { + return Err(responsive_token(token, target)); + } + Ok(themes + .get(index) + .and_then(Option::as_ref) + .and_then(|levels| levels.first()) + .and_then(Option::as_deref)) + } + + /// The properties of the typography `name` + pub(super) fn typography( + &self, + name: &str, + target: &NativeTarget, + ) -> Result<&TypographyProperties, Problem> { + let levels = self.typography.get(name).ok_or_else(|| { + Problem::new( + format!("devup.json defines no `{name}` typography"), + "add the typography to the theme in devup.json", + ) + })?; + match levels.split_first() { + Some((Some(properties), rest)) if rest.iter().all(Option::is_none) => Ok(properties), + _ => Err(responsive_token(name, target)), + } + } +} + +/// Whether a token has a value at a breakpoint but the first, which the +/// window width chooses +fn is_responsive(levels: &TokenLevels) -> bool { + !matches!(levels.split_first(), Some((Some(_), rest)) if rest.iter().all(Option::is_none)) +} + +/// Why a token with a value at each breakpoint cannot compile yet +fn responsive_token(name: &str, target: &NativeTarget) -> Problem { + let problem = RuntimeFeature::Responsive.problem(target); + Problem::new( + format!( + "`{name}` has a value at each breakpoint: {}", + problem.reason + ), + "give it one value in devup.json, or write the value itself", + ) +} + +/// The text before the first `$token` of `text`, the token's name and the +/// text after it. A token is `$`, a word character, then word characters, +/// dots and dashes, as on the web +pub(super) fn next_token(text: &str) -> Option<(&str, &str, &str)> { + let bytes = text.as_bytes(); + let mut from = 0; + while let Some(offset) = text[from..].find('$') { + let start = from + offset; + let name_start = start + 1; + if bytes.get(name_start).is_some_and(|b| is_word(*b)) { + let end = bytes[name_start..] + .iter() + .position(|b| !is_word(*b) && !matches!(b, b'.' | b'-')) + .map_or(bytes.len(), |length| name_start + length); + return Some((&text[..start], &text[name_start..end], &text[end..])); + } + from = name_start; + } + None +} + +const fn is_word(byte: u8) -> bool { + byte.is_ascii_alphanumeric() || byte == b'_' +} + +/// The theme a `_theme*` prop names: `_themeDark` is `dark`, `_themeHighContrast` +/// is `highContrast`, as on the web. `prop` starts with `_theme` +pub(super) fn selector_theme(prop: &str) -> String { + let rest = &prop["_theme".len()..]; + css::utils::to_camel_case(&css::utils::to_kebab_case(rest)).into_owned() +} diff --git a/libs/extractor/src/native/values.rs b/libs/extractor/src/native/values.rs index 404b241f0..fdf1fbe2d 100644 --- a/libs/extractor/src/native/values.rs +++ b/libs/extractor/src/native/values.rs @@ -77,7 +77,7 @@ pub(super) fn length(text: &str) -> Result { } /// `text` in pixels, from pixels or a `rem`/`em` length -fn scaled_length(text: &str) -> Option { +pub(super) fn scaled_length(text: &str) -> Option { [("px", 1.0), ("rem", ROOT_FONT_SIZE), ("em", ROOT_FONT_SIZE)] .into_iter() .find_map(|(unit, scale)| { diff --git a/libs/sheet/src/theme.rs b/libs/sheet/src/theme.rs index c558b4bfa..cf23e3ee7 100644 --- a/libs/sheet/src/theme.rs +++ b/libs/sheet/src/theme.rs @@ -229,7 +229,8 @@ impl Typography { } /// The CSS declarations of this preset, in output order - fn properties(&self) -> [(&'static str, Option<&str>); 7] { + #[must_use] + pub fn properties(&self) -> [(&'static str, Option<&str>); 7] { [ ("font-family", self.font_family.as_deref()), ("font-size", self.font_size.as_deref()), @@ -524,7 +525,9 @@ fn token_levels( .collect() } -fn default_variant_key(themes: &BTreeMap) -> Option<&str> { +/// The variant of `themes` the page shows without a `data-theme`: `default`, +/// else `light`, else the first by name +pub fn default_variant_key(themes: &BTreeMap) -> Option<&str> { if themes.contains_key("default") { Some("default") } else if themes.contains_key("light") { @@ -819,7 +822,10 @@ impl Theme { default_variant_key(&self.colors).map(str::to_string) } - fn color_scheme_of(&self, variant: &str) -> ColorScheme { + /// The color scheme `variant` renders with: the one `colorScheme` names, + /// else dark for `dark` and light for any other + #[must_use] + pub fn color_scheme_of(&self, variant: &str) -> ColorScheme { self.color_scheme .get(variant) .copied() diff --git a/packages/metro-plugin/README.md b/packages/metro-plugin/README.md index dd54604f6..41d86cfa9 100644 --- a/packages/metro-plugin/README.md +++ b/packages/metro-plugin/README.md @@ -8,7 +8,8 @@ Compiles Devup UI for React Native in [Metro](https://metrobundler.dev/), the bundler of React Native and Expo. You keep importing `Box`, `Text`, ... from `@devup-ui/react`; at build time each element becomes a React Native component and its style props become style objects hoisted into one `StyleSheet.create` -per file. Nothing runs at runtime. +per file. With one theme nothing runs at runtime; with more, a tiny runtime +(`@devup-ui/react/native`) only tells which theme shows. ## Setup @@ -79,20 +80,60 @@ withDevupUI(config, { }) ``` +## Themes + +`$` tokens of devup.json (colors, `length` and `shadow`) and `typography` +resolve at build time to the values React Native takes. With one theme each +becomes its literal value, and no file imports a runtime: + +```tsx + +// const __s = StyleSheet.create({ a: { backgroundColor: "#fff", padding: 16 } }) +// +``` + +With more themes, the styles of every theme are precomputed, and the element +picks one by the index of the theme that shows; what does not differ by theme +stays shared: + +```tsx +// +``` + +The themes are the color variants of devup.json, the default first. The app +starts on the theme that follows the system appearance (React Native's +`Appearance`): while it is dark, `dark`, or else the first theme `colorScheme` +makes dark; otherwise the default theme. `_themeDark`, `_themeSepia`, ... +apply their styles in that theme only. + +```tsx +import { getTheme, setTheme, useTheme } from '@devup-ui/react' + +const theme = useTheme() // renders again when the theme changes +setTheme('sepia') // wins over the system appearance +``` + +The build imports these from `@devup-ui/react/native`, a store read with +`useSyncExternalStore` that computes no style; web builds never import it. +`setTheme` does not save the choice across launches. + ## Limits of this version Only styles the build can decide are supported: literals, values read at -runtime, conditions between them and the platform blocks. These are build -errors, reported by Metro at the file, line and column: +runtime, theme tokens, conditions between them and the platform and theme +blocks. These are build errors, reported by Metro at the file, line and +column: -- responsive arrays (`p={[1, 2]}`), theme tokens (`color="$primary"`), - typography and `_dark`/`_light`/`_theme*` +- responsive arrays (`p={[1, 2]}`), and tokens or typography with a value at + each breakpoint - interaction states (`_hover`, `_active`, `_pressed`, `_focus`, ...) - `css()`, `styled()`, `globalCss()`, `keyframes()` and `Grid` - any prop React Native has no style for +- with `runtime: false`, a value that differs by theme, `_theme*` with more + than one theme, and `useTheme`, `getTheme` and `setTheme` -The runtime that brings responsive values, themes and `_pressed` comes in a -later version. +The runtime that brings responsive values and `_pressed` comes in a later +version. Metro reads devup.json when it starts, so restart Metro after changing it (`--reset-cache` is not needed). diff --git a/packages/metro-plugin/src/__tests__/transform.test.ts b/packages/metro-plugin/src/__tests__/transform.test.ts index fe3de5dee..f9df91e8e 100644 --- a/packages/metro-plugin/src/__tests__/transform.test.ts +++ b/packages/metro-plugin/src/__tests__/transform.test.ts @@ -54,8 +54,9 @@ function fakeCompiler( map, free, })) - const compiler: NativeCompiler = { codeExtractNative: extract } - return { compiler, extract, free } + const registerTheme = mock() + const compiler: NativeCompiler = { codeExtractNative: extract, registerTheme } + return { compiler, extract, free, registerTheme } } function setup( @@ -112,6 +113,28 @@ describe('transform', () => { expect(host.loadCompiler.mock.calls).toEqual([['wasm']]) }) + it('registers the theme of devup.json once, before compiling', () => { + const theme = { + colors: { light: { text: '#000' }, dark: { text: '#fff' } }, + } + write('devup.json', JSON.stringify({ theme })) + const { compiler, extract, registerTheme } = fakeCompiler() + const { transformer } = setup({}, undefined, compiler) + transformer.transform(args('a.tsx')) + transformer.transform(args('b.tsx')) + expect(registerTheme.mock.calls).toEqual([[theme]]) + expect(registerTheme.mock.invocationCallOrder[0]).toBeLessThan( + extract.mock.invocationCallOrder[0], + ) + }) + + it('registers an empty theme without devup.json', () => { + const { compiler, registerTheme } = fakeCompiler() + const { transformer } = setup({}, undefined, compiler) + transformer.transform(args('a.tsx')) + expect(registerTheme.mock.calls).toEqual([[{}]]) + }) + it('loads the settings, the upstream and the engine once', () => { const { host, transformer } = setup() transformer.transform(args('a.tsx')) diff --git a/packages/metro-plugin/src/__tests__/transformer.test.ts b/packages/metro-plugin/src/__tests__/transformer.test.ts index 2bba7a839..f8654e679 100644 --- a/packages/metro-plugin/src/__tests__/transformer.test.ts +++ b/packages/metro-plugin/src/__tests__/transformer.test.ts @@ -28,6 +28,14 @@ describe('the module Metro loads', () => { upstream, "exports.transform = (args) => ({ code: args.src })\nexports.getCacheKey = () => 'upstream'", ) + writeFileSync( + join(root, 'devup.json'), + JSON.stringify({ + theme: { + colors: { light: { surface: '#fff' }, dark: { surface: '#000' } }, + }, + }), + ) writeSettings({ upstreamTransformer: upstream, package: '@devup-ui/react', @@ -50,6 +58,18 @@ describe('the module Metro loads', () => { code: expect.stringContaining('from "react-native"'), }) expect(selection.mock.calls).toEqual([['wasm']]) + // devup.json's theme reaches the engine: two themes pick a style object + // by the theme the runtime reports + const themed = transform({ + filename: 'Themed.tsx', + src: 'import { Box } from \'@devup-ui/react\'\nexport function A() { return }', + options: { platform: 'ios', projectRoot: root }, + }) + expect(themed).toEqual({ + code: expect.stringContaining('from "@devup-ui/react/native"'), + }) + expect(themed).toEqual({ code: expect.stringContaining('"#000"') }) + expect(themed).toEqual({ code: expect.stringContaining('"#fff"') }) } finally { selection.mockRestore() } diff --git a/packages/metro-plugin/src/plugin.ts b/packages/metro-plugin/src/plugin.ts index 969e956eb..8febe95c7 100644 --- a/packages/metro-plugin/src/plugin.ts +++ b/packages/metro-plugin/src/plugin.ts @@ -31,11 +31,12 @@ export interface DevupUIMetroPluginOptions { */ include?: string[] /** - * Whether the React Native runtime may be imported for what needs it - * (responsive values, themes, `_pressed`). Defaults to `true`; `false` - * keeps every file free of runtime imports and makes those styles build - * errors. This version has no runtime yet, so they are build errors either - * way. + * Whether the React Native runtime (`@devup-ui/react/native`) may be + * imported for what needs it: a value that differs by theme, `_theme*` with + * more than one theme, and `useTheme`, `getTheme` and `setTheme`. Defaults + * to `true`; `false` keeps every file free of runtime imports and makes + * those build errors, while a token of a single theme still compiles to its + * value. */ runtime?: boolean /** diff --git a/packages/metro-plugin/src/transform.ts b/packages/metro-plugin/src/transform.ts index b9080b45f..129401b72 100644 --- a/packages/metro-plugin/src/transform.ts +++ b/packages/metro-plugin/src/transform.ts @@ -34,6 +34,7 @@ export interface BabelTransformer { /** The part of the engine the transformer calls */ export interface NativeCompiler { + registerTheme(theme: unknown): void codeExtractNative( filename: string, code: string, @@ -156,7 +157,13 @@ export function createTransformer(host: TransformerHost = defaultHost) { ) { return undefined } - compiler ??= host.loadCompiler(settings.engine) + if (!compiler) { + compiler = host.loadCompiler(settings.engine) + // The theme of devup.json, which resolves `$` tokens and the themes + compiler.registerTheme( + loadDevupConfigSync(settings.devupFile).theme ?? {}, + ) + } let output: ReturnType try { output = compiler.codeExtractNative( diff --git a/packages/react/package.json b/packages/react/package.json index 44d0cf8d5..0c045735e 100644 --- a/packages/react/package.json +++ b/packages/react/package.json @@ -69,6 +69,11 @@ "types": "./dist/utils/stylex.d.ts", "import": "./dist/utils/stylex.js", "require": "./dist/utils/stylex.cjs" + }, + "./native": { + "types": "./dist/native/index.d.ts", + "import": "./dist/native/index.js", + "require": "./dist/native/index.cjs" } }, "files": [ @@ -88,10 +93,17 @@ "@typescript/typescript6": "^6.0.2", "@types/react": "^19.3.0", "@types/node": "^26.6.6", - "react": "^19.3.1" + "react": "^19.3.1", + "react-native": "0.88.1" }, "peerDependencies": { "react": "^18 || ^19", + "react-native": "*", "csstype-extra": "*" + }, + "peerDependenciesMeta": { + "react-native": { + "optional": true + } } } diff --git a/packages/react/rollup.types.config.mjs b/packages/react/rollup.types.config.mjs index 084ff9d90..509834bda 100644 --- a/packages/react/rollup.types.config.mjs +++ b/packages/react/rollup.types.config.mjs @@ -15,6 +15,7 @@ const entries = { index: 'dist/index.d.ts', 'compat/index': 'dist/compat/index.d.ts', 'utils/stylex': 'dist/utils/stylex.d.ts', + 'native/index': 'dist/native/index.d.ts', } const shared = '_shared' diff --git a/packages/react/src/native/__tests__/index.browser.test.tsx b/packages/react/src/native/__tests__/index.browser.test.tsx new file mode 100644 index 000000000..1dd10010e --- /dev/null +++ b/packages/react/src/native/__tests__/index.browser.test.tsx @@ -0,0 +1,125 @@ +import { beforeEach, describe, expect, it, mock } from 'bun:test' +import { act, render, renderHook } from 'bun-test-env-dom' +import { createElement, type ReactNode } from 'react' + +/** The system appearance React Native reports, and who listens to it */ +const appearance = { + scheme: 'light' as string | null, + listeners: [] as (() => void)[], +} + +mock.module('react-native', () => ({ + Appearance: { + getColorScheme: () => appearance.scheme, + addChangeListener: (listener: () => void) => { + appearance.listeners.push(listener) + return { remove: () => {} } + }, + }, +})) + +/** The system appearance changing to `scheme` */ +function changeAppearance(scheme: string | null) { + act(() => { + appearance.scheme = scheme + for (const listener of appearance.listeners) listener() + }) +} + +const runtime = await import('../index') +const { defineThemes, getTheme, setTheme, Themed, useTheme, useThemeIndex } = + runtime + +beforeEach(() => { + appearance.scheme = 'light' + defineThemes(['light', 'dark', 'sepia'], 1) + setTheme(null) +}) + +describe('getTheme', () => { + it('follows the system appearance until a theme is set', () => { + expect(getTheme() as string | null).toBe('light') + appearance.scheme = 'dark' + expect(getTheme() as string | null).toBe('dark') + setTheme('sepia' as Parameters[0]) + expect(getTheme() as string | null).toBe('sepia') + setTheme(null) + expect(getTheme() as string | null).toBe('dark') + }) + + it('shows the default theme in the dark when no theme is dark', () => { + defineThemes(['default']) + appearance.scheme = 'dark' + expect(getTheme() as string | null).toBe('default') + }) + + it('is null without themes', () => { + defineThemes([]) + expect(getTheme()).toBeNull() + }) +}) + +describe('useTheme and useThemeIndex', () => { + it('render again when the system appearance changes', () => { + const { result } = renderHook(() => [useTheme(), useThemeIndex()]) + expect(result.current as unknown[]).toEqual(['light', 0]) + changeAppearance('dark') + expect(result.current as unknown[]).toEqual(['dark', 1]) + changeAppearance(null) + expect(result.current as unknown[]).toEqual(['light', 0]) + }) + + it('render again when a theme is set, which wins over the system', () => { + const { result, unmount } = renderHook(() => [useTheme(), useThemeIndex()]) + act(() => setTheme('sepia' as Parameters[0])) + expect(result.current as unknown[]).toEqual(['sepia', 2]) + changeAppearance('dark') + expect(result.current as unknown[]).toEqual(['sepia', 2]) + unmount() + }) + + it('show the default theme for a name the themes lack', () => { + const { result } = renderHook(() => [useTheme(), useThemeIndex()]) + act(() => setTheme('missing' as Parameters[0])) + expect(result.current as unknown[]).toEqual(['missing', 0]) + }) + + it('give the first index without themes', () => { + defineThemes([]) + const { result } = renderHook(() => [useTheme(), useThemeIndex()]) + expect(result.current as unknown[]).toEqual([null, 0]) + }) + + it('listen to the system appearance once', () => { + renderHook(() => useTheme()) + renderHook(() => useTheme()) + expect(appearance.listeners).toHaveLength(1) + }) +}) + +describe('Themed', () => { + it('renders the component with the style of the theme that shows', () => { + const styles = [{ color: 'black' }, { color: 'white' }, { color: 'brown' }] + const Probe = ({ + style, + children, + }: { + style?: { color: string } + children?: ReactNode + }) => createElement('span', { 'data-color': style?.color }, children) + const { container } = render( + createElement( + Themed, + { $c: Probe, $s: (theme: number) => styles[theme] }, + 'text', + ), + ) + const span = () => container.querySelector('span') + expect(span()?.getAttribute('data-color')).toBe('black') + expect(span()?.textContent).toBe('text') + changeAppearance('dark') + expect(span()?.getAttribute('data-color')).toBe('white') + act(() => setTheme('sepia' as Parameters[0])) + expect(span()?.getAttribute('data-color')).toBe('brown') + }) +}) diff --git a/packages/react/src/native/index.ts b/packages/react/src/native/index.ts new file mode 100644 index 000000000..cffcb461e --- /dev/null +++ b/packages/react/src/native/index.ts @@ -0,0 +1,106 @@ +import { + createElement, + type ElementType, + type ReactElement, + useSyncExternalStore, +} from 'react' +import { Appearance } from 'react-native' + +import type { DevupTheme } from '../types/theme' + +/** + * The React Native runtime of Devup UI. The build compiles every style to + * `StyleSheet` objects, one a theme when a value differs by theme; this + * module only tells which theme shows. It reads no CSS, resolves no token + * and computes no style. Web builds never import it. + */ + +type ThemeName = keyof DevupTheme extends undefined ? string : keyof DevupTheme + +/** The theme names, in the order the build indexes style objects by */ +let names: readonly string[] = [] +/** The index of the theme the system's dark appearance shows */ +let dark = -1 +/** The theme `setTheme` chose, which wins over the system appearance */ +let chosen: string | null = null +let following = false +const listeners = new Set<() => void>() + +function notify(): void { + for (const listener of listeners) listener() +} + +function subscribe(listener: () => void): () => void { + if (!following) { + following = true + Appearance.addChangeListener(notify) + } + listeners.add(listener) + return () => { + listeners.delete(listener) + } +} + +/** + * Tells the runtime the theme names of devup.json, the default first, and + * the index of the one the system's dark appearance shows. The build calls + * it in each file that uses the runtime. + * @internal + */ +export function defineThemes(themes: readonly string[], darkIndex = -1): void { + names = themes + dark = darkIndex +} + +/** + * The theme the app shows: the one `setTheme` chose, else the dark theme + * while the system appearance is dark, else the default theme; `null` + * without themes + */ +export function getTheme(): ThemeName | null { + const system = + Appearance.getColorScheme() === 'dark' ? names[dark] : undefined + return (chosen ?? system ?? names[0] ?? null) as ThemeName | null +} + +/** + * Shows `theme` whatever the system appearance is, as `setTheme` does on the + * web; `null` follows the system appearance again. A name devup.json does + * not define shows the default theme's styles, as on the web. The choice is + * not saved across launches. + */ +export function setTheme(theme: ThemeName | null): void { + chosen = theme + notify() +} + +/** The theme the app shows, rendering again when it changes */ +export function useTheme(): ThemeName | null { + return useSyncExternalStore(subscribe, getTheme, getTheme) +} + +/** + * The index of the theme the app shows among the theme names, which the + * build picks a style object by + * @internal + */ +export function useThemeIndex(): number { + return Math.max(names.indexOf(useTheme() ?? ''), 0) +} + +/** + * Renders `$c` with the style `$s` gives for the theme the app shows. The + * build renders an element through it where no function component can read + * the theme for it. + * @internal + */ +export function Themed({ + $c, + $s, + ...props +}: { + $c: ElementType + $s: (theme: number) => unknown +} & Record): ReactElement { + return createElement($c, { ...props, style: $s(useThemeIndex()) }) +} diff --git a/packages/react/vite.config.ts b/packages/react/vite.config.ts index 17167e831..8a34d0e5e 100644 --- a/packages/react/vite.config.ts +++ b/packages/react/vite.config.ts @@ -50,6 +50,7 @@ export default defineConfig({ entry: { index: 'src/index.ts', 'compat/index': 'src/compat/index.ts', + 'native/index': 'src/native/index.ts', }, }, outDir: 'dist', From 140a47055beaf14c57566ce2af6f4d79e7a5fc31 Mon Sep 17 00:00:00 2001 From: owjs3901 Date: Fri, 20 Nov 2026 19:17:23 +0900 Subject: [PATCH 08/40] ci: load the React Native runtime entry with a react-native stand-in verify-dist loads every declared entry, and `@devup-ui/react/native` imports react-native, which is Flow source Bun cannot parse. A virtual module stands in for it so the entry still loads and exports. Co-Authored-By: Claude Opus 5.5 --- verify-dist.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/verify-dist.ts b/verify-dist.ts index 30baeb56b..e65a5b665 100644 --- a/verify-dist.ts +++ b/verify-dist.ts @@ -79,6 +79,18 @@ async function verifyPackage(pkgDir: string): Promise { return failures } +// `@devup-ui/react/native` runs only under React Native, whose package is Flow +// source no JavaScript runtime here loads; a stand-in lets that entry load +Bun.plugin({ + name: 'react-native-stand-in', + setup(build) { + build.module('react-native', () => ({ + exports: { Appearance: {} }, + loader: 'object', + })) + }, +}) + // Subpaths of a removed export (the `lite` engine) that a stale generated build can leave behind const REMOVED_SUBPATHS = ['bindings/devup-ui-wasm/pkg/lite'] From 065a54c051053b9c36f36d71d74a7aeb61a9e45b Mon Sep 17 00:00:00 2001 From: owjs3901 Date: Fri, 20 Nov 2026 19:38:07 +0900 Subject: [PATCH 09/40] test(native): cover theme merges and a typography a theme lacks Cover a typography whose token one theme does not define, a static style merged into a themed one, and a later style checked against a choice that applies in one theme. A merge that leaves every theme declaring the same styles now collapses to one static style instead of picking between equal objects. Co-Authored-By: Claude Opus 5.5 --- .../snapshots/extractor__native__tests__theme_two.snap | 7 ++++++- libs/extractor/src/native/style.rs | 8 +++++++- libs/extractor/src/native/tests.rs | 7 +++++++ 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/libs/extractor/src/native/snapshots/extractor__native__tests__theme_two.snap b/libs/extractor/src/native/snapshots/extractor__native__tests__theme_two.snap index b19bcaf8f..559ed4ebb 100644 --- a/libs/extractor/src/native/snapshots/extractor__native__tests__theme_two.snap +++ b/libs/extractor/src/native/snapshots/extractor__native__tests__theme_two.snap @@ -64,7 +64,9 @@ const __s = StyleSheet.create({ backgroundColor: "#5a44ff", margin: 4 }, - u: { color: "#000" } + u: { color: "#000" }, + v: { fontFamily: "#000" }, + w: { margin: 4 } }); export function Card({ on, color }) { const __t = __useThemeIndex(); @@ -83,5 +85,8 @@ export function Card({ on, color }) { __t === 1 && (on ? __s.r : __s.s) ]} /> + + + ; } diff --git a/libs/extractor/src/native/style.rs b/libs/extractor/src/native/style.rs index 39c8ff251..f6e48f5ea 100644 --- a/libs/extractor/src/native/style.rs +++ b/libs/extractor/src/native/style.rs @@ -243,7 +243,13 @@ fn ordered(choices: Vec) -> Vec { if !first.is_empty() { rest.insert(0, Choice::Static(first)); } - rest + // A later style can make every theme declare the same + rest.into_iter() + .map(|choice| match choice { + Choice::Themed(variants) => themed(variants), + choice => choice, + }) + .collect() } /// The `style` an element takes, and whether it reads the theme the app shows diff --git a/libs/extractor/src/native/tests.rs b/libs/extractor/src/native/tests.rs index 768151e1e..ee1c164f3 100644 --- a/libs/extractor/src/native/tests.rs +++ b/libs/extractor/src/native/tests.rs @@ -583,6 +583,10 @@ fn theme(names: &[&str], dark: Option, tokens: &[(&str, &[Option<&str>])] "relative", vec![Some(typography_entry(&[("line-height", "2em")]))], ), + ( + "darkFont", + vec![Some(typography_entry(&[("font-family", "$onlyDark")]))], + ), ( "rounded", vec![Some(typography_entry(&[ @@ -681,6 +685,9 @@ const TWO_THEME_ELEMENTS: &str = r#"export function Card({ on, color }) { + + + ) }"#; From b61c8546c9781ad8a56821a1a9edb6c7a59dff59 Mon Sep 17 00:00:00 2001 From: owjs3901 Date: Sat, 21 Nov 2026 10:45:24 +0900 Subject: [PATCH 10/40] feat(native): responsive values, responsive tokens and orientation on React Native Responsive arrays, length/shadow/typography tokens with a value at each breakpoint, responsive values in platform, theme and orientation blocks and conditions compile to one style object for each run of breakpoints that share their styles (by breakpoint and theme where both differ). The runtime store of @devup-ui/react/native also tells the breakpoint of devup.json the window is at and its orientation through one Dimensions listener that notifies only when a breakpoint is crossed or the window turns. _portrait/_landscape apply by orientation. With runtime: false these stay build errors. Co-Authored-By: Claude Opus 5.5 --- ..._log_react_native_breakpoints_runtime.json | 7 + ...hangepack_log_react_native_responsive.json | 8 + .github/workflows/publish.yml | 1 + apps/expo/check-bundle.mjs | 38 +- apps/expo/devup.json | 17 +- apps/expo/src/App.tsx | 60 ++- libs/binding/src/native_theme.rs | 1 + libs/binding/tests/native.rs | 9 + libs/extractor/src/native/element.rs | 349 ++++++++++--- libs/extractor/src/native/errors.rs | 5 +- libs/extractor/src/native/mod.rs | 6 +- libs/extractor/src/native/props.rs | 27 +- ...extractor__native__tests__orientation.snap | 10 +- ...or__native__tests__orientation_blocks.snap | 29 ++ ...tor__native__tests__orientation_value.snap | 6 + ...actor__native__tests__platform_shapes.snap | 1 - .../extractor__native__tests__responsive.snap | 9 +- ...tor__native__tests__responsive_arrays.snap | 98 ++++ ..._tests__responsive_custom_breakpoints.snap | 22 + ...ive__tests__responsive_hooks_in_arrow.snap | 31 ++ ...ative__tests__responsive_in_condition.snap | 10 +- ...ve__tests__responsive_name_collisions.snap | 18 + ...tor__native__tests__responsive_nested.snap | 5 + ...ive__tests__responsive_no_breakpoints.snap | 17 + ...tor__native__tests__responsive_spread.snap | 5 + ...tor__native__tests__responsive_themes.snap | 99 ++++ ...tractor__native__tests__runtime_false.snap | 2 +- ...or__native__tests__runtime_off_arrays.snap | 7 + ...ative__tests__runtime_off_orientation.snap | 6 + ..._tests__runtime_off_responsive_tokens.snap | 6 + ...xtractor__native__tests__runtime_true.snap | 3 +- ...ative__tests__theme_responsive_tokens.snap | 10 +- .../extractor__native__tests__theme_two.snap | 61 ++- ...or__native__tests__theme_typographies.snap | 1 - libs/extractor/src/native/style.rs | 476 ++++++++++++++---- libs/extractor/src/native/tests.rs | 280 ++++++++++- libs/extractor/src/native/theme.rs | 146 ++++-- packages/metro-plugin/README.md | 39 +- .../native/__tests__/index.browser.test.tsx | 122 ++++- packages/react/src/native/index.ts | 88 +++- 40 files changed, 1813 insertions(+), 322 deletions(-) create mode 100644 .changepacks/changepack_log_react_native_breakpoints_runtime.json create mode 100644 .changepacks/changepack_log_react_native_responsive.json create mode 100644 libs/extractor/src/native/snapshots/extractor__native__tests__orientation_blocks.snap create mode 100644 libs/extractor/src/native/snapshots/extractor__native__tests__orientation_value.snap create mode 100644 libs/extractor/src/native/snapshots/extractor__native__tests__responsive_arrays.snap create mode 100644 libs/extractor/src/native/snapshots/extractor__native__tests__responsive_custom_breakpoints.snap create mode 100644 libs/extractor/src/native/snapshots/extractor__native__tests__responsive_hooks_in_arrow.snap create mode 100644 libs/extractor/src/native/snapshots/extractor__native__tests__responsive_name_collisions.snap create mode 100644 libs/extractor/src/native/snapshots/extractor__native__tests__responsive_nested.snap create mode 100644 libs/extractor/src/native/snapshots/extractor__native__tests__responsive_no_breakpoints.snap create mode 100644 libs/extractor/src/native/snapshots/extractor__native__tests__responsive_spread.snap create mode 100644 libs/extractor/src/native/snapshots/extractor__native__tests__responsive_themes.snap create mode 100644 libs/extractor/src/native/snapshots/extractor__native__tests__runtime_off_arrays.snap create mode 100644 libs/extractor/src/native/snapshots/extractor__native__tests__runtime_off_orientation.snap create mode 100644 libs/extractor/src/native/snapshots/extractor__native__tests__runtime_off_responsive_tokens.snap diff --git a/.changepacks/changepack_log_react_native_breakpoints_runtime.json b/.changepacks/changepack_log_react_native_breakpoints_runtime.json new file mode 100644 index 000000000..d5a77ade3 --- /dev/null +++ b/.changepacks/changepack_log_react_native_breakpoints_runtime.json @@ -0,0 +1,7 @@ +{ + "changes": { + "packages/react/package.json": "Patch" + }, + "note": "`@devup-ui/react/native` also tells which breakpoint of devup.json the window is at (`useBreakpoint`, `getBreakpoint`) and whether it is in landscape, for responsive values on React Native (part of #411). One `Dimensions` listener is shared by every component, and a component renders again only when the window crosses into another breakpoint or turns, not on every pixel. The runtime is about 630 bytes minified and gzipped.", + "date": "2026-11-21T00:00:00.000Z" +} diff --git a/.changepacks/changepack_log_react_native_responsive.json b/.changepacks/changepack_log_react_native_responsive.json new file mode 100644 index 000000000..38e58c018 --- /dev/null +++ b/.changepacks/changepack_log_react_native_responsive.json @@ -0,0 +1,8 @@ +{ + "changes": { + "bindings/devup-ui-binding/package.json": "Patch", + "bindings/devup-ui-wasm/package.json": "Patch" + }, + "note": "`codeExtractNative` compiles responsive values for React Native (part of #411): responsive arrays (`p={[1, null, 3]}`, `null` keeping the value before as on the web), `length`, `shadow` and `typography` tokens with a value at each breakpoint, responsive values inside `_ios`, `_theme*` and conditions, and `_portrait`/`_landscape`. The breakpoints of devup.json are measured against the window width. The build precomputes one style object for each run of breakpoints that share their styles, only for the styles that differ, and picks one by the breakpoint `useBreakpoint()` of `@devup-ui/react/native` gives (by breakpoint and theme where both differ). A value read at runtime in an array applies from its breakpoint on. With `runtime: false` these are build errors. Web output is unchanged.", + "date": "2026-11-21T00:00:00.000Z" +} diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index c1bd3a86b..1696a4342 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -9,6 +9,7 @@ on: - main - feat/napi-binding - feat/react-native-metro + - feat/react-native-themes # Pull requests and every job below run read-only. Only the `release` and # `deploy-pages` jobs get write permissions, and they run on pushes to main diff --git a/apps/expo/check-bundle.mjs b/apps/expo/check-bundle.mjs index 913534639..445677c7b 100644 --- a/apps/expo/check-bundle.mjs +++ b/apps/expo/check-bundle.mjs @@ -3,14 +3,18 @@ // placeholders of @devup-ui/react or any module of that package but its React // Native runtime (`@devup-ui/react/native`), and the styles of src/App.tsx // must be there as React Native style objects. src/App.tsx reads the theme, -// so it uses the runtime; src/Badge.tsx is styled the same in every theme, so -// it must not. +// the breakpoint and the orientation, so it calls each of those hooks of the +// runtime; src/Badge.tsx is styled the same in every theme and at every +// width, so it must not use the runtime. import { readdirSync, readFileSync } from 'node:fs' import { join } from 'node:path' const PLACEHOLDER = 'Cannot run on the runtime' /** Names of the runtime that only code using it holds, as minified code keeps them */ -const RUNTIME_NAMES = /\b(?:defineThemes|useThemeIndex)\b/g +const RUNTIME_NAMES = + /\b(?:defineThemes|useThemeIndex|useBreakpoint|useLandscape)\b/g +/** The hooks src/App.tsx must call */ +const APP_HOOKS = ['useThemeIndex', 'useBreakpoint', 'useLandscape'] /** Modules of @devup-ui/react, by the path Metro resolves */ const REACT_PACKAGE = /(^|[\\/])(@devup-ui[\\/]react|packages[\\/]react)[\\/]/ /** The React Native runtime among them */ @@ -89,17 +93,19 @@ function mapSources(map) { : map.sources } -/** The sources of the code that names the runtime */ +/** Each name of the runtime, with the sources of the code that names it */ function runtimeUsers(code, locate) { - const users = new Set() + const users = new Map() code.split('\n').forEach((line, index) => { for (const match of line.matchAll(RUNTIME_NAMES)) { - users.add(locate(index, match.index)) + const source = locate(index, match.index) + if (source === null || NATIVE_RUNTIME.test(source)) continue + const sources = users.get(match[0]) ?? new Set() + sources.add(source) + users.set(match[0], sources) } }) - return [...users].filter( - (source) => source !== null && !NATIVE_RUNTIME.test(source), - ) + return users } for (const platform of ['ios', 'android']) { @@ -129,16 +135,22 @@ for (const platform of ['ios', 'android']) { failures.push(`${platform}/${file}: lacks @devup-ui/react/native`) } const users = runtimeUsers(code, sourceLocator(map)) - if (!users.some((source) => /src[\\/]App\.tsx$/.test(source))) { - failures.push(`${platform}/${file}: src/App.tsx does not use the runtime`) + for (const hook of APP_HOOKS) { + const callers = [...(users.get(hook) ?? [])] + if (!callers.some((source) => /src[\\/]App\.tsx$/.test(source))) { + failures.push(`${platform}/${file}: src/App.tsx does not call ${hook}`) + } } - for (const source of users.filter((source) => + const all = [ + ...new Set([...users.values()].flatMap((sources) => [...sources])), + ] + for (const source of all.filter((source) => /src[\\/]Badge\.tsx$/.test(source), )) { failures.push(`${platform}/${file}: ${source} uses the runtime`) } console.info( - `${platform}/${file}: ${sources.length} modules, runtime used by ${users.join(', ')}`, + `${platform}/${file}: ${sources.length} modules, runtime used by ${all.join(', ')}`, ) } } diff --git a/apps/expo/devup.json b/apps/expo/devup.json index a3a26daa2..beff56bfa 100644 --- a/apps/expo/devup.json +++ b/apps/expo/devup.json @@ -20,7 +20,8 @@ }, "length": { "default": { - "radius": ["12px"] + "radius": ["12px"], + "gutter": ["16px", null, "32px"] } }, "shadow": { @@ -29,11 +30,15 @@ } }, "typography": { - "title": { - "fontSize": "24px", - "fontWeight": 700, - "lineHeight": 1.3 - } + "title": [ + { + "fontSize": "24px", + "fontWeight": 700, + "lineHeight": 1.3 + }, + null, + { "fontSize": "32px" } + ] } } } diff --git a/apps/expo/src/App.tsx b/apps/expo/src/App.tsx index 4834b1d6c..02be3958e 100644 --- a/apps/expo/src/App.tsx +++ b/apps/expo/src/App.tsx @@ -24,7 +24,8 @@ export function App() { flexDirection="column" gap={4} justifyContent="center" - p={6} + px="$gutter" + py={[6, null, 10]} > - + Your name @@ -53,28 +61,34 @@ export function App() { {name ? `Hello, ${name}` : 'Type your name'} - - + + + ) } diff --git a/libs/binding/src/native_theme.rs b/libs/binding/src/native_theme.rs index d974d91fa..41d6a2200 100644 --- a/libs/binding/src/native_theme.rs +++ b/libs/binding/src/native_theme.rs @@ -44,6 +44,7 @@ pub fn native_theme(theme: &Theme) -> NativeTheme { .iter() .map(|(name, typography)| (name.clone(), typography_levels(typography))) .collect(), + breakpoints: theme.breakpoints.clone(), } } diff --git a/libs/binding/tests/native.rs b/libs/binding/tests/native.rs index 9c44f4d28..49010502c 100644 --- a/libs/binding/tests/native.rs +++ b/libs/binding/tests/native.rs @@ -159,3 +159,12 @@ fn native_extraction_resolves_the_registered_theme() -> Result<(), String> { assert!(code.contains("backgroundColor: \"#fff\""), "{code}"); Ok(()) } + +#[test] +fn native_theme_keeps_the_breakpoints() { + // The web's breakpoints by default, and those devup.json sets + let default = devup_ui_binding_core::native_theme(&theme("{}")); + let custom = devup_ui_binding_core::native_theme(&theme(r#"{ "breakpoints": [0, 600] }"#)); + assert_eq!(default.breakpoints, [0, 480, 768, 992, 1280, 1600]); + assert_eq!(custom.breakpoints, [0, 600]); +} diff --git a/libs/extractor/src/native/element.rs b/libs/extractor/src/native/element.rs index 36f2a0d08..84bac63a8 100644 --- a/libs/extractor/src/native/element.rs +++ b/libs/extractor/src/native/element.rs @@ -3,12 +3,14 @@ //! component its import is now bound to. use oxc_ast::ast::{ - ArrowFunctionExpression, ExportDefaultDeclaration, Expression, Function, FunctionBody, - IdentifierReference, JSXAttribute, JSXAttributeItem, JSXAttributeName, JSXAttributeValue, - JSXChild, JSXElement, JSXElementName, JSXExpression, LogicalOperator, ObjectExpression, - ObjectPropertyKind, Program, TSType, UnaryOperator, VariableDeclarator, + ArrayExpression, ArrayExpressionElement, ArrowFunctionExpression, ExportDefaultDeclaration, + Expression, Function, FunctionBody, IdentifierReference, JSXAttribute, JSXAttributeItem, + JSXAttributeName, JSXAttributeValue, JSXChild, JSXElement, JSXElementName, JSXExpression, + LogicalOperator, ObjectExpression, ObjectPropertyKind, Program, TSType, UnaryOperator, + VariableDeclarator, }; use std::cell::Cell; +use std::fmt::Write; use oxc_ast_visit::{Visit, walk}; use oxc_semantic::Scoping; @@ -19,10 +21,10 @@ use rustc_hash::{FxHashMap, FxHashSet}; use super::errors::{Problem, RuntimeFeature}; use super::imports::{self, native_component}; -use super::props::{Tokens, declarations, dynamic_keys}; +use super::props::{Declaration, Tokens, declarations, dynamic_keys, literal_levels}; use super::sheet::Sheet; -use super::style::{Choice, in_theme, style_code, themed}; -use super::theme::selector_theme; +use super::style::{Choice, Reads, State, Vars, cascade, in_theme, style_code, varied, when}; +use super::theme::{DEFAULT_BREAKPOINTS, selector_theme}; use super::values::{Literal, NativeValue, ROOT_FONT_SIZE}; use super::{NativePlatform, NativeTarget, REACT_NATIVE, RUNTIME, Replacement}; use crate::component::ExportVariableKind; @@ -39,52 +41,96 @@ pub(super) struct Compiled { struct Runtime { /// The variable holding the index of the theme the app shows index: String, - /// The hook reading that index - hook: String, - hook_used: bool, - /// The component that reads the index itself, for an element outside a + /// The variable holding the breakpoint the window is at + breakpoint: String, + /// The variable holding whether the window is in landscape + landscape: String, + /// The hooks reading each, by what they read + hooks: [String; 3], + /// What the hooks the file calls read + hooks_used: Reads, + /// The component that reads them itself, for an element outside a /// function component wrapper: String, wrapper_used: bool, + /// What the elements rendered through it read + wrapper_reads: Reads, /// The function telling the runtime the theme names define: String, + /// The function telling the runtime the breakpoints + define_breakpoints: String, } +/// The runtime hooks, in the order they are called, by the name they are +/// exported under: they read the theme, the breakpoint and the orientation +const HOOKS: [&str; 3] = ["useThemeIndex", "useBreakpoint", "useLandscape"]; + impl Runtime { fn new(code: &str) -> Self { Self { index: fresh_name("__t", code), - hook: fresh_name("__useThemeIndex", code), - hook_used: false, + breakpoint: fresh_name("__b", code), + landscape: fresh_name("__l", code), + hooks: HOOKS.map(|hook| fresh_name(&format!("__{hook}"), code)), + hooks_used: Reads::default(), wrapper: fresh_name("__Themed", code), wrapper_used: false, + wrapper_reads: Reads::default(), define: fresh_name("__defineThemes", code), + define_breakpoints: fresh_name("__defineBreakpoints", code), + } + } + + /// The variables holding what the runtime tells + fn vars(&self) -> Vars<'_> { + Vars { + theme: &self.index, + breakpoint: &self.breakpoint, + landscape: &self.landscape, } } - /// The import of the runtime and the call telling it the theme names, - /// when the file uses it + /// The variables of `reads`, in the order of the hooks + fn variables(&self, reads: Reads) -> impl Iterator { + [&self.index, &self.breakpoint, &self.landscape] + .into_iter() + .enumerate() + .filter(move |(at, _)| reads.flags()[*at]) + .map(|(at, name)| (at, name.as_str())) + } + + /// The import of the runtime and the calls telling it the theme names + /// and the breakpoints, when the file uses it fn prelude(&self, target: &NativeTarget, theme_api: bool) -> Option { - if !(self.hook_used || self.wrapper_used || theme_api) { + if !(self.hooks_used.any() || self.wrapper_used || theme_api) { return None; } - let mut specifiers = Vec::new(); - if self.hook_used { - specifiers.push(format!("useThemeIndex as {}", self.hook)); - } + let reads = self.hooks_used.union(self.wrapper_reads); + let mut specifiers: Vec = self + .variables(self.hooks_used) + .map(|(at, _)| format!("{} as {}", HOOKS[at], self.hooks[at])) + .collect(); if self.wrapper_used { specifiers.push(format!("Themed as {}", self.wrapper)); } - specifiers.push(format!("defineThemes as {}", self.define)); let theme = &target.theme; - let names = serde_json::Value::from(theme.names.clone()).to_string(); - let dark = theme - .dark - .map_or_else(String::new, |dark| format!(", {dark}")); + let mut calls = String::new(); + if reads.theme || theme_api { + specifiers.push(format!("defineThemes as {}", self.define)); + let names = serde_json::Value::from(theme.names.clone()).to_string(); + let dark = theme + .dark + .map_or_else(String::new, |dark| format!(", {dark}")); + let _ = writeln!(calls, "{}({names}{dark});", self.define); + } + if reads.breakpoint && theme.breakpoints != DEFAULT_BREAKPOINTS { + specifiers.push(format!("defineBreakpoints as {}", self.define_breakpoints)); + let breakpoints = serde_json::Value::from(theme.breakpoints.clone()).to_string(); + let _ = writeln!(calls, "{}({breakpoints});", self.define_breakpoints); + } Some(format!( - "import {{ {} }} from \"{RUNTIME}\";\n{}({names}{dark});\n", - specifiers.join(", "), - self.define + "import {{ {} }} from \"{RUNTIME}\";\n{calls}", + specifiers.join(", ") )) } } @@ -94,8 +140,8 @@ struct Frame { /// Whether it is a function component or a hook, where the hook reading /// the theme can be called first component: bool, - /// Whether an element in it reads the theme - used: bool, + /// What the elements in it read from the runtime + reads: Reads, /// Where the hook is called hook_at: HookAt, } @@ -177,6 +223,9 @@ enum Prop { Platform(NativePlatform), /// `_themeDark` and the like: styles for the theme named Theme(String), + /// `_landscape` (`true`) or `_portrait` (`false`): styles for the + /// orientation of the window + Orientation(bool), /// What needs the React Native runtime Runtime(RuntimeFeature), /// What React Native has no equivalent of @@ -194,7 +243,8 @@ fn classify(name: &str) -> Prop { "_android" => Prop::Platform(NativePlatform::Android), "_web" => Prop::Platform(NativePlatform::Web), "_pressed" | "_active" => Prop::Runtime(RuntimeFeature::Pressed), - "_portrait" | "_landscape" => Prop::Runtime(RuntimeFeature::Responsive), + "_portrait" => Prop::Orientation(false), + "_landscape" => Prop::Orientation(true), "className" => Prop::Unsupported(Problem::new( "React Native has no class names", "write the styles as props, or pass them in `style`", @@ -429,21 +479,26 @@ impl<'a> Elements<'_> { }; self.frames.push(Frame { component, - used: false, + reads: Reads::default(), hook_at, }); visit(self); if let Some(frame) = self.frames.pop() - && frame.used + && frame.reads.any() { - self.call_hook(frame.hook_at); + self.call_hooks(frame.hook_at, frame.reads); } } - /// Call the hook reading the theme at `at` - fn call_hook(&mut self, at: HookAt) { - self.runtime.hook_used = true; - let call = format!("const {} = {}();", self.runtime.index, self.runtime.hook); + /// Call the hooks reading what `reads` names at `at` + fn call_hooks(&mut self, at: HookAt, reads: Reads) { + self.runtime.hooks_used = self.runtime.hooks_used.union(reads); + let calls: Vec = self + .runtime + .variables(reads) + .map(|(hook, variable)| format!("const {variable} = {}();", self.runtime.hooks[hook])) + .collect(); + let call = calls.join(" "); match at { HookAt::Body(at) => self.replacements.push((at, at, format!("\n{call}"))), HookAt::Expression(start, end) => { @@ -455,42 +510,70 @@ impl<'a> Elements<'_> { } /// Whether the element being compiled is in a function component or a - /// hook, which then reads the theme first - fn reads_theme_in_component(&mut self) -> bool { + /// hook, which then calls the hooks reading what `reads` names first + fn read_in_component(&mut self, reads: Reads) -> bool { match self.frames.iter_mut().rev().find(|frame| frame.component) { Some(frame) => { - frame.used = true; + frame.reads = frame.reads.union(reads); true } None => false, } } - /// The styles a style prop declares with a literal: one style object, or - /// one a theme when its tokens differ by theme - fn static_choice(&self, name: &str, literal: &Literal) -> Result { + /// The styles a style prop declares with literals, each from the + /// breakpoint it is paired with on: one style object, or one a + /// breakpoint and a theme where the styles differ by them + fn static_choice(&self, name: &str, items: &[(usize, Literal)]) -> Result { let theme = &self.target.theme; - let indexes = match self.theme_scope { + let themes = match self.theme_scope { Some(index) => index..index + 1, - None if names_tokens(name, literal) => 0..theme.count(), + None if items.iter().any(|(_, literal)| names_tokens(name, literal)) => { + 0..theme.count() + } None => 0..1, }; - let mut variants = Vec::new(); - for index in indexes { - let tokens = Tokens { - theme, - index, - target: self.target, - }; - variants.push(declarations(name, literal, &tokens)?.unwrap_or_default()); - } - let choice = themed(variants); - if choice.reads_theme() && !self.target.runtime { - return Err(RuntimeFeature::Theme.problem(self.target)); + let levels = items + .iter() + .map(|(from, literal)| (from + 1).max(literal_levels(name, literal, theme))) + .fold(1, usize::max) + .min(theme.levels()); + let mut grid = Vec::with_capacity(levels); + for level in 0..levels { + let mut row = Vec::with_capacity(themes.len()); + for index in themes.clone() { + row.push(cell( + name, + items, + &Tokens { + theme, + index, + level, + }, + )?); + } + grid.push(row); } + let choice = varied(grid); + self.check_runtime(&choice)?; Ok(choice) } + /// Fail for a choice the runtime makes when it is turned off + fn check_runtime(&self, choice: &Choice) -> Result<(), Problem> { + let reads = choice.reads(); + let feature = if self.target.runtime { + None + } else if reads.breakpoint { + Some(RuntimeFeature::Responsive) + } else if reads.theme { + Some(RuntimeFeature::Theme) + } else { + None + }; + feature.map_or(Ok(()), |feature| Err(feature.problem(self.target))) + } + /// Compile one Devup UI element fn element(&mut self, element: &JSXElement<'a>, kind: &ExportVariableKind, local: &str) { let opening = &element.opening_element; @@ -580,6 +663,16 @@ impl<'a> Elements<'_> { ); styles.choices.extend(choices); } + Prop::Orientation(landscape) => { + styles.removed.push(span); + let choices = self.orientation_block( + attribute_expression(attribute), + (name, landscape), + attribute.span.start, + local, + ); + styles.choices.extend(choices); + } Prop::Runtime(feature) => self.error( attribute.span.start, feature.problem(self.target).on(local, name), @@ -733,6 +826,30 @@ impl<'a> Elements<'_> { .collect() } + /// The styles of `_landscape` or `_portrait`, `name` being the prop: they + /// apply only while the window is in that orientation + fn orientation_block( + &mut self, + value: Option<&Expression<'a>>, + (name, landscape): (&str, bool), + offset: u32, + local: &str, + ) -> Vec { + if !self.target.runtime { + self.error( + offset, + RuntimeFeature::Orientation + .problem(self.target) + .on(local, name), + ); + return Vec::new(); + } + self.block(value, name, offset, local) + .into_iter() + .map(|choice| when(State::Landscape(landscape), choice)) + .collect() + } + /// The styles of an object of style props fn object_choices(&mut self, object: &ObjectExpression<'a>, local: &str) -> Vec { let mut choices = Vec::new(); @@ -792,6 +909,9 @@ impl<'a> Elements<'_> { Prop::Theme(theme) => { return self.theme_block(Some(value), (key, &theme), offset, local); } + Prop::Orientation(landscape) => { + return self.orientation_block(Some(value), (key, landscape), offset, local); + } Prop::Runtime(feature) => { self.error(offset, feature.problem(self.target).on(local, key)); } @@ -817,7 +937,7 @@ impl<'a> Elements<'_> { match value { Some(JSXAttributeValue::StringLiteral(literal)) => literal.value.as_str().map_or_else( || self.dynamic_choice(name, literal.span.source_text(self.code)), - |text| self.static_choice(name, &Literal::Text(text.to_string())), + |text| self.static_choice(name, &[(0, Literal::Text(text.to_string()))]), ), Some(JSXAttributeValue::ExpressionContainer(container)) => container .expression @@ -839,7 +959,7 @@ impl<'a> Elements<'_> { expression: &Expression<'a>, ) -> Result { if let Some(literal) = literal(expression) { - return self.static_choice(name, &literal); + return self.static_choice(name, &[(0, literal)]); } match expression.without_parentheses() { Expression::NullLiteral(_) | Expression::BooleanLiteral(_) => Ok(Choice::Empty), @@ -858,7 +978,7 @@ impl<'a> Elements<'_> { alternate: Box::new(Choice::Empty), }) } - Expression::ArrayExpression(_) => Err(RuntimeFeature::Responsive.problem(self.target)), + Expression::ArrayExpression(array) => self.responsive_choice(name, array), 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`", @@ -867,6 +987,62 @@ impl<'a> Elements<'_> { } } + /// The styles a responsive array declares: each value from the + /// breakpoint at its index on, as on the web, where `null` and + /// `undefined` keep the value before. Literals compile to one style + /// object a breakpoint; any other value applies from its breakpoint on + fn responsive_choice( + &self, + name: &str, + array: &ArrayExpression<'a>, + ) -> Result { + let last = self.target.theme.levels() - 1; + let mut items = Vec::new(); + for (index, element) in array.elements.iter().enumerate() { + match element.as_expression() { + Some(expression) if !is_empty_value(expression) => { + items.push((index.min(last), expression)); + } + None if matches!(element, ArrayExpressionElement::SpreadElement(_)) => { + return Err(Problem::new( + "the build reads only the values written in a responsive array", + "write each value in the array", + )); + } + _ => {} + } + } + let literals: Option> = items + .iter() + .map(|(level, expression)| literal(expression).map(|literal| (*level, literal))) + .collect(); + if let Some(literals) = literals { + return self.static_choice(name, &literals); + } + if !self.target.runtime { + return Err(RuntimeFeature::Responsive.problem(self.target)); + } + let mut choices = Vec::with_capacity(items.len()); + for (level, expression) in items { + if matches!( + expression.without_parentheses(), + Expression::ArrayExpression(_) + ) { + return Err(Problem::new( + "a responsive array holds one value a breakpoint", + "write each value itself, not an array", + )); + } + let choice = self.expression_choice(name, expression)?; + choices.push(if level == 0 { + choice + } else { + when(State::AtLeast(level), choice) + }); + } + Ok(Choice::All(choices)) + } + /// The styles a style prop declares with the value `code` the element /// reads at runtime fn dynamic_choice(&self, name: &str, code: &str) -> Result { @@ -942,12 +1118,14 @@ impl<'a> Elements<'_> { style, opaque_spread, } = styles; - let style_code = style_code(choices, given, &mut self.sheet, &self.runtime.index); - let wrapped = style_code + let style_code = style_code(choices, given, &mut self.sheet, &self.runtime.vars()); + let reads = style_code .as_ref() - .is_some_and(|style| style.reads_theme && !self.reads_theme_in_component()); + .map_or_else(Reads::default, |style| style.reads); + let wrapped = reads.any() && !self.read_in_component(reads); if wrapped { self.runtime.wrapper_used = true; + self.runtime.wrapper_reads = self.runtime.wrapper_reads.union(reads); let wrapper = self.runtime.wrapper.clone(); self.rename(element, &wrapper); } else if let Some(tag) = &tag { @@ -958,10 +1136,21 @@ impl<'a> Elements<'_> { return; }; let code = if wrapped { + // The wrapper gives the theme, the breakpoint and the orientation, + // in this order: the style takes them up to the last it reads + let read = self.runtime.variables(reads).last().map_or(0, |(at, _)| at); + let parameters = [ + &self.runtime.index, + &self.runtime.breakpoint, + &self.runtime.landscape, + ][..=read] + .iter() + .map(|name| name.as_str()) + .collect::>() + .join(", "); format!( - " $c={{{}}} $s={{({}) => ({})}}", + " $c={{{}}} $s={{({parameters}) => ({})}}", tag.as_deref().unwrap_or(local), - self.runtime.index, style_code.code ) } else { @@ -1085,6 +1274,34 @@ fn literal(expression: &Expression<'_>) -> Option { } } +/// The styles the literals of `items` declare for the style prop `name` at +/// the breakpoint and in the theme of `tokens`: each literal from its +/// breakpoint on, a later one declared after the one before +fn cell( + name: &str, + items: &[(usize, Literal)], + tokens: &Tokens<'_>, +) -> Result, Problem> { + let mut declared = Vec::new(); + for (_, literal) in items.iter().filter(|(from, _)| *from <= tokens.level) { + cascade( + &mut declared, + declarations(name, literal, tokens)?.unwrap_or_default(), + ); + } + Ok(declared) +} + +/// Whether `expression` declares nothing, as `null`, `undefined` and +/// booleans do +fn is_empty_value(expression: &Expression<'_>) -> bool { + match expression.without_parentheses() { + Expression::NullLiteral(_) | Expression::BooleanLiteral(_) => true, + Expression::Identifier(identifier) => identifier.name == "undefined", + _ => false, + } +} + /// Whether the styles of `literal` for the style prop `name` may differ by /// theme: a typography, or a value naming a `$token` fn names_tokens(name: &str, literal: &Literal) -> bool { diff --git a/libs/extractor/src/native/errors.rs b/libs/extractor/src/native/errors.rs index 6e21074b3..31259ea32 100644 --- a/libs/extractor/src/native/errors.rs +++ b/libs/extractor/src/native/errors.rs @@ -39,6 +39,7 @@ impl Problem { #[derive(Debug, Clone, Copy, PartialEq, Eq)] pub(super) enum RuntimeFeature { Responsive, + Orientation, Theme, Pressed, } @@ -47,6 +48,7 @@ impl RuntimeFeature { const fn what(self) -> &'static str { match self { Self::Responsive => "a responsive value is chosen by the window width", + Self::Orientation => "an orientation style is chosen by the orientation of the window", 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", } @@ -54,7 +56,8 @@ impl RuntimeFeature { const fn fix(self) -> &'static str { match self { - Self::Responsive => "give one value", + Self::Responsive => "give one value, or turn the runtime on", + Self::Orientation => "remove it, or turn the runtime on", Self::Theme => "give the value for one theme, or turn the runtime on", Self::Pressed => { "pass a function to the `style` of a React Native `Pressable`, reading `pressed`" diff --git a/libs/extractor/src/native/mod.rs b/libs/extractor/src/native/mod.rs index 68911d456..e578e65a8 100644 --- a/libs/extractor/src/native/mod.rs +++ b/libs/extractor/src/native/mod.rs @@ -9,8 +9,10 @@ //! platform blocks `_ios`, `_android` and `_web`, and theme tokens when the //! theme has one value for them. A value that differs by theme compiles to //! one style object a theme, and the element picks one by the index the -//! runtime of `@devup-ui/react/native` gives. Responsive arrays and -//! `_pressed` need a runtime that this version does not include, and a prop +//! runtime of `@devup-ui/react/native` gives; a responsive value compiles to +//! one style object a run of breakpoints, picked by the breakpoint the +//! runtime gives, and `_portrait`/`_landscape` apply by its orientation. +//! `_pressed` needs 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; diff --git a/libs/extractor/src/native/props.rs b/libs/extractor/src/native/props.rs index 6d0eceb1a..ca966cebd 100644 --- a/libs/extractor/src/native/props.rs +++ b/libs/extractor/src/native/props.rs @@ -11,7 +11,6 @@ use phf::phf_map; use crate::extract_style::constant::is_maintain_value_property; -use super::NativeTarget; use super::errors::Problem; use super::theme::NativeTheme; use super::values::{ @@ -238,14 +237,16 @@ fn check_text(text: &str) -> Result<(), Problem> { /// compiled with pub(super) struct Tokens<'t> { pub theme: &'t NativeTheme, + /// The index of the theme pub index: usize, - pub target: &'t NativeTarget, + /// The breakpoint + pub level: usize, } impl Tokens<'_> { /// `text` with its tokens resolved, or `None` when the theme lacks one fn resolve<'v>(&self, text: &'v str) -> Result>, Problem> { - self.theme.resolve(text, self.index, self.target) + self.theme.resolve(text, (self.index, self.level)) } } @@ -274,6 +275,16 @@ pub(super) fn declarations( Ok(Some(declarations)) } +/// How many breakpoints the styles of the style prop `prop` with the value +/// `literal` tell apart through the responsive tokens or typography it names +pub(super) fn literal_levels(prop: &str, literal: &Literal, theme: &NativeTheme) -> usize { + match literal { + Literal::Text(text) if prop == "typography" => theme.typography_levels(text), + Literal::Text(text) => theme.token_levels(text), + Literal::Number(_) => 1, + } +} + /// `literal` as text fn literal_text(literal: &Literal) -> Cow<'_, str> { match literal { @@ -287,20 +298,20 @@ fn literal_text(literal: &Literal) -> Cow<'_, str> { /// multiplied by it, as React Native reads both in pixels fn typography(name: &str, tokens: &Tokens<'_>) -> Result>, Problem> { let mut properties = Vec::new(); - for (property, value) in tokens.theme.typography(name, tokens.target)? { - let Some(value) = tokens.resolve(value)? else { + for (property, value) in tokens.theme.typography(name, tokens.level)? { + let Some(value) = tokens.resolve(&value)?.map(Cow::into_owned) else { return Ok(None); }; check_text(&value)?; - properties.push((property.as_str(), value.into_owned())); + properties.push((property, value)); } let font_size = properties .iter() - .find(|(property, _)| *property == "font-size") + .find(|(property, _)| property == "font-size") .and_then(|(_, value)| scaled_length(value.trim()).or_else(|| number(value))); let mut declarations = Vec::new(); for (property, value) in &properties { - match *property { + match property.as_str() { "line-height" | "letter-spacing" => { declarations.extend(relative_to_font(property, value, font_size)?); } diff --git a/libs/extractor/src/native/snapshots/extractor__native__tests__orientation.snap b/libs/extractor/src/native/snapshots/extractor__native__tests__orientation.snap index 4b19decba..c9626a9d3 100644 --- a/libs/extractor/src/native/snapshots/extractor__native__tests__orientation.snap +++ b/libs/extractor/src/native/snapshots/extractor__native__tests__orientation.snap @@ -2,5 +2,11 @@ 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 +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 { Themed as __Themed } from "@devup-ui/react/native"; +import { StyleSheet } from "react-native"; +const __s = StyleSheet.create({ + a: { padding: 4 }, + b: { padding: 8 } +}); +<__Themed $c={Box} $s={(__t, __b, __l) => [!__l && __s.a, __l && __s.b]} />; diff --git a/libs/extractor/src/native/snapshots/extractor__native__tests__orientation_blocks.snap b/libs/extractor/src/native/snapshots/extractor__native__tests__orientation_blocks.snap new file mode 100644 index 000000000..d939c9b22 --- /dev/null +++ b/libs/extractor/src/native/snapshots/extractor__native__tests__orientation_blocks.snap @@ -0,0 +1,29 @@ +--- +source: libs/extractor/src/native/tests.rs +expression: "compile_themed(two_themes(), 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 { useBreakpoint as __useBreakpoint, useLandscape as __useLandscape } from "@devup-ui/react/native"; +import { StyleSheet } from "react-native"; +const __s = StyleSheet.create({ + a: { flexDirection: "row" }, + b: { flexDirection: "column" }, + c: { padding: 4 }, + d: { padding: 8 }, + e: { padding: 12 }, + f: { padding: 16 }, + g: { margin: 4 } +}); +export function Screen({ on }) { + const __b = __useBreakpoint(); + const __l = __useLandscape(); + return + + ; +} diff --git a/libs/extractor/src/native/snapshots/extractor__native__tests__orientation_value.snap b/libs/extractor/src/native/snapshots/extractor__native__tests__orientation_value.snap new file mode 100644 index 000000000..0c621a572 --- /dev/null +++ b/libs/extractor/src/native/snapshots/extractor__native__tests__orientation_value.snap @@ -0,0 +1,6 @@ +--- +source: libs/extractor/src/native/tests.rs +expression: "compile_themed(two_themes(), true, code)" +--- +error: test.tsx:2:6: `` cannot use `_landscape` on React Native: `_landscape` takes an object of styles. Fix: write the styles in an object, such as `_landscape={{ p: 2 }}` +test.tsx:2:34: `` cannot use `p` on React Native: a style prop takes one value, not an object. Fix: give one value, or use a platform block such as `_ios` 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 index 0d58afdd6..725ae4af6 100644 --- a/libs/extractor/src/native/snapshots/extractor__native__tests__platform_shapes.snap +++ b/libs/extractor/src/native/snapshots/extractor__native__tests__platform_shapes.snap @@ -10,4 +10,3 @@ test.tsx:2:63: `` cannot use `_hover` on React Native: React Native has no 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: `_web` 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 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__responsive.snap b/libs/extractor/src/native/snapshots/extractor__native__tests__responsive.snap index 8ca40cd95..7ef5c17bd 100644 --- a/libs/extractor/src/native/snapshots/extractor__native__tests__responsive.snap +++ b/libs/extractor/src/native/snapshots/extractor__native__tests__responsive.snap @@ -2,4 +2,11 @@ source: libs/extractor/src/native/tests.rs expression: compile(code) --- -error: test.tsx:2:6: `` cannot use `p` 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 +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 { Themed as __Themed } from "@devup-ui/react/native"; +import { StyleSheet } from "react-native"; +const __s = StyleSheet.create({ + a: { padding: 4 }, + b: { padding: 8 } +}); +<__Themed $c={Box} $s={(__t, __b) => __b < 1 ? __s.a : __s.b} />; diff --git a/libs/extractor/src/native/snapshots/extractor__native__tests__responsive_arrays.snap b/libs/extractor/src/native/snapshots/extractor__native__tests__responsive_arrays.snap new file mode 100644 index 000000000..5c5841189 --- /dev/null +++ b/libs/extractor/src/native/snapshots/extractor__native__tests__responsive_arrays.snap @@ -0,0 +1,98 @@ +--- +source: libs/extractor/src/native/tests.rs +expression: "compile_themed(two_themes(), 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 { useBreakpoint as __useBreakpoint } from "@devup-ui/react/native"; +import { StyleSheet } from "react-native"; +const __s = StyleSheet.create({ + a: { margin: 8 }, + b: { padding: 4 }, + c: { padding: 12 }, + d: { padding: 8 }, + e: { padding: 16 }, + f: { padding: 20 }, + g: { padding: 32 }, + h: { + padding: 8, + width: "50%" + }, + i: { backgroundColor: "red" }, + j: { + marginVertical: 1, + marginHorizontal: 2, + paddingVertical: 1, + paddingHorizontal: 2 + }, + k: { + margin: 3, + paddingVertical: 1, + paddingHorizontal: 2 + }, + l: { + margin: 3, + paddingVertical: 3, + paddingHorizontal: 4 + }, + m: { margin: 4 }, + n: { + padding: 16, + margin: 8 + }, + o: { + padding: 4, + margin: 12, + gap: 4 + }, + p: { + padding: 8, + margin: 12, + gap: 8 + }, + q: { + padding: 8, + margin: 16, + gap: 8 + }, + r: { + paddingTop: 12, + paddingBottom: 12 + }, + s: { + paddingLeft: 4, + paddingRight: 4 + }, + t: { + paddingLeft: 8, + paddingRight: 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; +}; +export function Layout({ on, x }) { + const __b = __useBreakpoint(); + return + + + + + = 1 && __s.d]} /> + = 2 && __s.c, + on && __s.m, + __b >= 1 && { margin: __u(x, 4) } + ]} /> + + + + + + + + = 1 && __s.d] : __s.c, __s.b]} /> + ; +} diff --git a/libs/extractor/src/native/snapshots/extractor__native__tests__responsive_custom_breakpoints.snap b/libs/extractor/src/native/snapshots/extractor__native__tests__responsive_custom_breakpoints.snap new file mode 100644 index 000000000..7f2e12013 --- /dev/null +++ b/libs/extractor/src/native/snapshots/extractor__native__tests__responsive_custom_breakpoints.snap @@ -0,0 +1,22 @@ +--- +source: libs/extractor/src/native/tests.rs +expression: "compile_themed(theme, 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 { useThemeIndex as __useThemeIndex, useBreakpoint as __useBreakpoint, Themed as __Themed, defineThemes as __defineThemes, defineBreakpoints as __defineBreakpoints } from "@devup-ui/react/native"; +__defineThemes(["light", "dark"], 1); +__defineBreakpoints([0, 600]); +import { StyleSheet } from "react-native"; +const __s = StyleSheet.create({ + a: { margin: 4 }, + b: { margin: 6 }, + c: { padding: 4 }, + d: { padding: 12 }, + e: { padding: 8 } +}); +export const A = () => { + const __t = __useThemeIndex(); + const __b = __useBreakpoint(); + return ; +}; +export const b = <__Themed $c={Box} $s={(__t, __b) => __b < 1 ? __s.c : __s.e} />; diff --git a/libs/extractor/src/native/snapshots/extractor__native__tests__responsive_hooks_in_arrow.snap b/libs/extractor/src/native/snapshots/extractor__native__tests__responsive_hooks_in_arrow.snap new file mode 100644 index 000000000..862ae770b --- /dev/null +++ b/libs/extractor/src/native/snapshots/extractor__native__tests__responsive_hooks_in_arrow.snap @@ -0,0 +1,31 @@ +--- +source: libs/extractor/src/native/tests.rs +expression: "compile_themed(two_themes(), 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 { useThemeIndex as __useThemeIndex, useBreakpoint as __useBreakpoint, useLandscape as __useLandscape, Themed as __Themed, defineThemes as __defineThemes } from "@devup-ui/react/native"; +__defineThemes(["light", "dark"], 1); +import { StyleSheet } from "react-native"; +const __s = StyleSheet.create({ + a: { backgroundColor: "#5a44ff" }, + b: { backgroundColor: "#8c7bff" }, + c: { padding: 4 }, + d: { padding: 8 }, + e: { margin: 4 } +}); +export const A = () => { + const __t = __useThemeIndex(); + const __b = __useBreakpoint(); + const __l = __useLandscape(); + return ; +}; +export const B = () => { + const __l = __useLandscape(); + return ; +}; +export const c = <__Themed $c={Box} $s={(__t, __b, __l) => [__b < 1 ? __s.c : __s.d, __l && __s.e]} />; +export const d = <__Themed $c={Box} $s={(__t, __b) => [[__s.a, __s.b][__t], __b < 1 ? __s.c : __s.d]} />; diff --git a/libs/extractor/src/native/snapshots/extractor__native__tests__responsive_in_condition.snap b/libs/extractor/src/native/snapshots/extractor__native__tests__responsive_in_condition.snap index 8ca40cd95..80de23140 100644 --- a/libs/extractor/src/native/snapshots/extractor__native__tests__responsive_in_condition.snap +++ b/libs/extractor/src/native/snapshots/extractor__native__tests__responsive_in_condition.snap @@ -2,4 +2,12 @@ source: libs/extractor/src/native/tests.rs expression: compile(code) --- -error: test.tsx:2:6: `` cannot use `p` 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 +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 { Themed as __Themed } from "@devup-ui/react/native"; +import { StyleSheet } from "react-native"; +const __s = StyleSheet.create({ + a: { padding: 4 }, + b: { padding: 8 }, + c: { padding: 12 } +}); +<__Themed $c={Box} $s={(__t, __b) => on ? __b < 1 ? __s.a : __s.b : __s.c} />; diff --git a/libs/extractor/src/native/snapshots/extractor__native__tests__responsive_name_collisions.snap b/libs/extractor/src/native/snapshots/extractor__native__tests__responsive_name_collisions.snap new file mode 100644 index 000000000..1e32b3aef --- /dev/null +++ b/libs/extractor/src/native/snapshots/extractor__native__tests__responsive_name_collisions.snap @@ -0,0 +1,18 @@ +--- +source: libs/extractor/src/native/tests.rs +expression: "compile_themed(two_themes(), 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 { useBreakpoint as __useBreakpoint_, useLandscape as __useLandscape_ } from "@devup-ui/react/native"; +import { StyleSheet } from "react-native"; +const __s = StyleSheet.create({ + a: { padding: 4 }, + b: { padding: 8 }, + c: { margin: 4 } +}); +const __b = 1, __l = 2, __useBreakpoint = 3, __useLandscape = 4; +export const A = () => { + const __b_ = __useBreakpoint_(); + const __l_ = __useLandscape_(); + return ; +}; diff --git a/libs/extractor/src/native/snapshots/extractor__native__tests__responsive_nested.snap b/libs/extractor/src/native/snapshots/extractor__native__tests__responsive_nested.snap new file mode 100644 index 000000000..9fc3450e8 --- /dev/null +++ b/libs/extractor/src/native/snapshots/extractor__native__tests__responsive_nested.snap @@ -0,0 +1,5 @@ +--- +source: libs/extractor/src/native/tests.rs +expression: "compile_themed(two_themes(), true, code)" +--- +error: test.tsx:2:6: `` cannot use `p` on React Native: a responsive array holds one value a breakpoint. Fix: write each value itself, not an array diff --git a/libs/extractor/src/native/snapshots/extractor__native__tests__responsive_no_breakpoints.snap b/libs/extractor/src/native/snapshots/extractor__native__tests__responsive_no_breakpoints.snap new file mode 100644 index 000000000..d239d9ff0 --- /dev/null +++ b/libs/extractor/src/native/snapshots/extractor__native__tests__responsive_no_breakpoints.snap @@ -0,0 +1,17 @@ +--- +source: libs/extractor/src/native/tests.rs +expression: "compile_themed(theme, 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 { useThemeIndex as __useThemeIndex, defineThemes as __defineThemes } from "@devup-ui/react/native"; +__defineThemes(["light", "dark"], 1); +import { StyleSheet } from "react-native"; +const __s = StyleSheet.create({ + a: { padding: 12 }, + b: { margin: 4 }, + c: { margin: 6 } +}); +export const A = () => { + const __t = __useThemeIndex(); + return ; +}; diff --git a/libs/extractor/src/native/snapshots/extractor__native__tests__responsive_spread.snap b/libs/extractor/src/native/snapshots/extractor__native__tests__responsive_spread.snap new file mode 100644 index 000000000..4c3bcc5e2 --- /dev/null +++ b/libs/extractor/src/native/snapshots/extractor__native__tests__responsive_spread.snap @@ -0,0 +1,5 @@ +--- +source: libs/extractor/src/native/tests.rs +expression: "compile_themed(two_themes(), true, code)" +--- +error: test.tsx:2:6: `` cannot use `p` on React Native: the build reads only the values written in a responsive array. Fix: write each value in the array diff --git a/libs/extractor/src/native/snapshots/extractor__native__tests__responsive_themes.snap b/libs/extractor/src/native/snapshots/extractor__native__tests__responsive_themes.snap new file mode 100644 index 000000000..4b4b74e10 --- /dev/null +++ b/libs/extractor/src/native/snapshots/extractor__native__tests__responsive_themes.snap @@ -0,0 +1,99 @@ +--- +source: libs/extractor/src/native/tests.rs +expression: "compile_themed(theme, 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 { useThemeIndex as __useThemeIndex, useBreakpoint as __useBreakpoint, useLandscape as __useLandscape, defineThemes as __defineThemes } from "@devup-ui/react/native"; +__defineThemes(["light", "dark"], 1); +import { StyleSheet } from "react-native"; +const __s = StyleSheet.create({ + a: { borderColor: "#5a44ff" }, + b: { borderColor: "#8c7bff" }, + c: { margin: 4 }, + d: { margin: 8 }, + e: { + backgroundColor: "#5a44ff", + padding: 4 + }, + f: { + backgroundColor: "#8c7bff", + padding: 6 + }, + g: { + backgroundColor: "#111", + padding: 4 + }, + h: { + backgroundColor: "#eee", + padding: 6 + }, + i: { + backgroundColor: "#111", + padding: 8 + }, + j: { + backgroundColor: "#eee", + padding: 12 + }, + k: { color: "#111" }, + l: { color: "#eee" }, + m: { fontSize: 24 }, + n: { fontSize: 32 }, + o: { fontFamily: "Inter" }, + p: { + fontSize: 12, + lineHeight: 18 + }, + q: { + fontSize: 14, + lineHeight: 21 + }, + r: { + fontSize: 40, + lineHeight: 60 + }, + s: { + fontFamily: "Inter", + fontWeight: "500", + lineHeight: 24, + letterSpacing: -.32 + }, + t: { fontSize: 16 }, + u: { backgroundColor: "#8c7bff" }, + v: { padding: 4 }, + w: { padding: 8 }, + x: { margin: 2 }, + y: { padding: 6 }, + z: { backgroundColor: "#5a44ff" }, + aa: { backgroundColor: "red" }, + ab: { backgroundColor: "#111" }, + ac: { backgroundColor: "#eee" }, + ad: { borderStyle: "solid" }, + ae: { borderWidth: 1 }, + af: { borderWidth: 2 }, + ag: { padding: 12 } +}); +export function Card({ on }) { + const __t = __useThemeIndex(); + const __b = __useBreakpoint(); + const __l = __useLandscape(); + return + + + + + = 1 && __s.x, __b < 2 ? [__s.v, __s.y][__t] : __s.v]} /> + + + + + ; +} diff --git a/libs/extractor/src/native/snapshots/extractor__native__tests__runtime_false.snap b/libs/extractor/src/native/snapshots/extractor__native__tests__runtime_false.snap index ec6bc54a4..9dc9cebe4 100644 --- a/libs/extractor/src/native/snapshots/extractor__native__tests__runtime_false.snap +++ b/libs/extractor/src/native/snapshots/extractor__native__tests__runtime_false.snap @@ -2,6 +2,6 @@ source: libs/extractor/src/native/tests.rs expression: "compile_for(NativePlatform::Ios, runtime, &code)" --- -error: test.tsx:2:6: `` cannot use `p` on React Native: a responsive value is chosen by the window width, which needs the React Native runtime that `runtime: false` turns off. Fix: give one value +error: test.tsx:2:6: `` cannot use `p` on React Native: a responsive value is chosen by the window width, which needs the React Native runtime that `runtime: false` turns off. Fix: give one value, or turn the runtime on test.tsx:2:17: `` cannot use `_themeDark` on React Native: devup.json defines no `dark` theme. Fix: add the theme to devup.json, or remove the block test.tsx:2:33: `` cannot use `_pressed` on React Native: a press style is chosen while the element is pressed, which needs the React Native runtime that `runtime: false` turns off. Fix: pass a function to the `style` of a React Native `Pressable`, reading `pressed` diff --git a/libs/extractor/src/native/snapshots/extractor__native__tests__runtime_off_arrays.snap b/libs/extractor/src/native/snapshots/extractor__native__tests__runtime_off_arrays.snap new file mode 100644 index 000000000..0baeb4e15 --- /dev/null +++ b/libs/extractor/src/native/snapshots/extractor__native__tests__runtime_off_arrays.snap @@ -0,0 +1,7 @@ +--- +source: libs/extractor/src/native/tests.rs +expression: "compile_themed(one_theme(), false, code)" +--- +error: test.tsx:2:6: `` cannot use `p` on React Native: a responsive value is chosen by the window width, which needs the React Native runtime that `runtime: false` turns off. Fix: give one value, or turn the runtime on +test.tsx:3:6: `` cannot use `p` on React Native: a responsive value is chosen by the window width, which needs the React Native runtime that `runtime: false` turns off. Fix: give one value, or turn the runtime on +test.tsx:4:25: `` cannot use `w` on React Native: a responsive value is chosen by the window width, which needs the React Native runtime that `runtime: false` turns off. Fix: give one value, or turn the runtime on diff --git a/libs/extractor/src/native/snapshots/extractor__native__tests__runtime_off_orientation.snap b/libs/extractor/src/native/snapshots/extractor__native__tests__runtime_off_orientation.snap new file mode 100644 index 000000000..4294c17ed --- /dev/null +++ b/libs/extractor/src/native/snapshots/extractor__native__tests__runtime_off_orientation.snap @@ -0,0 +1,6 @@ +--- +source: libs/extractor/src/native/tests.rs +expression: "compile_themed(one_theme(), false, code)" +--- +error: test.tsx:2:6: `` cannot use `_landscape` on React Native: an orientation style is chosen by the orientation of the window, which needs the React Native runtime that `runtime: false` turns off. Fix: remove it, or turn the runtime on +test.tsx:2:28: `` cannot use `_portrait` on React Native: an orientation style is chosen by the orientation of the window, which needs the React Native runtime that `runtime: false` turns off. Fix: remove it, or turn the runtime on diff --git a/libs/extractor/src/native/snapshots/extractor__native__tests__runtime_off_responsive_tokens.snap b/libs/extractor/src/native/snapshots/extractor__native__tests__runtime_off_responsive_tokens.snap new file mode 100644 index 000000000..26dcc8b86 --- /dev/null +++ b/libs/extractor/src/native/snapshots/extractor__native__tests__runtime_off_responsive_tokens.snap @@ -0,0 +1,6 @@ +--- +source: libs/extractor/src/native/tests.rs +expression: "compile_themed(one_theme(), false, code)" +--- +error: test.tsx:2:6: `` cannot use `p` on React Native: a responsive value is chosen by the window width, which needs the React Native runtime that `runtime: false` turns off. Fix: give one value, or turn the runtime on +test.tsx:3:7: `` cannot use `typography` on React Native: a responsive value is chosen by the window width, which needs the React Native runtime that `runtime: false` turns off. Fix: give one value, or turn the runtime on diff --git a/libs/extractor/src/native/snapshots/extractor__native__tests__runtime_true.snap b/libs/extractor/src/native/snapshots/extractor__native__tests__runtime_true.snap index 441bb88d5..7b1927f74 100644 --- a/libs/extractor/src/native/snapshots/extractor__native__tests__runtime_true.snap +++ b/libs/extractor/src/native/snapshots/extractor__native__tests__runtime_true.snap @@ -2,6 +2,5 @@ source: libs/extractor/src/native/tests.rs expression: "compile_for(NativePlatform::Ios, runtime, &code)" --- -error: test.tsx:2:6: `` cannot use `p` 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:17: `` cannot use `_themeDark` on React Native: devup.json defines no `dark` theme. Fix: add the theme to devup.json, or remove the block +error: test.tsx:2:17: `` cannot use `_themeDark` on React Native: devup.json defines no `dark` theme. Fix: add the theme to devup.json, or remove the block test.tsx:2:33: `` 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` diff --git a/libs/extractor/src/native/snapshots/extractor__native__tests__theme_responsive_tokens.snap b/libs/extractor/src/native/snapshots/extractor__native__tests__theme_responsive_tokens.snap index ee9541720..2e4b87ae3 100644 --- a/libs/extractor/src/native/snapshots/extractor__native__tests__theme_responsive_tokens.snap +++ b/libs/extractor/src/native/snapshots/extractor__native__tests__theme_responsive_tokens.snap @@ -2,4 +2,12 @@ source: libs/extractor/src/native/tests.rs expression: "compile_themed(two_themes(), true, code)" --- -error: test.tsx:2:6: `` cannot use `p` on React Native: `gutter` has a value at each breakpoint: a responsive value is chosen by the window width, which needs the React Native runtime that this version does not include yet. Fix: give it one value in devup.json, or write the value itself +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 { Themed as __Themed } from "@devup-ui/react/native"; +import { StyleSheet } from "react-native"; +const __s = StyleSheet.create({ + a: { margin: 2 }, + b: { padding: 4 }, + c: { padding: 8 } +}); +<__Themed $c={Box} $s={(__t, __b) => [__s.a, __b < 2 ? __s.b : __s.c]} />; diff --git a/libs/extractor/src/native/snapshots/extractor__native__tests__theme_two.snap b/libs/extractor/src/native/snapshots/extractor__native__tests__theme_two.snap index 559ed4ebb..78a879126 100644 --- a/libs/extractor/src/native/snapshots/extractor__native__tests__theme_two.snap +++ b/libs/extractor/src/native/snapshots/extractor__native__tests__theme_two.snap @@ -33,40 +33,36 @@ const __s = StyleSheet.create({ h: { color: "#eee" }, i: { color: "red" }, j: { - fontSize: 12, - lineHeight: 18, letterSpacing: 1, textTransform: "uppercase" }, k: { - fontSize: 14, - lineHeight: 21, - letterSpacing: 1, - textTransform: "uppercase" + fontSize: 12, + lineHeight: 18 }, - l: { borderColor: "#eef" }, - m: { borderColor: "#223" }, - n: { - borderWidth: 1, - borderStyle: "solid", - borderColor: "#5a44ff" + l: { + fontSize: 14, + lineHeight: 21 }, + m: { borderColor: "#eef" }, + n: { borderColor: "#223" }, o: { borderWidth: 1, - borderStyle: "solid", - borderColor: "#8c7bff" + borderStyle: "solid" }, - p: { margin: 8 }, - q: { opacity: .5 }, - r: { padding: 4 }, - s: { padding: 8 }, - t: { + p: { borderColor: "#5a44ff" }, + q: { borderColor: "#8c7bff" }, + r: { margin: 8 }, + s: { opacity: .5 }, + t: { padding: 4 }, + u: { padding: 8 }, + v: { backgroundColor: "#5a44ff", margin: 4 }, - u: { color: "#000" }, - v: { fontFamily: "#000" }, - w: { margin: 4 } + w: { color: "#000" }, + x: { fontFamily: "#000" }, + y: { margin: 4 } }); export function Card({ on, color }) { const __t = __useThemeIndex(); @@ -74,19 +70,20 @@ export function Card({ on, color }) { Hi - - - - + + + + ; } diff --git a/libs/extractor/src/native/snapshots/extractor__native__tests__theme_typographies.snap b/libs/extractor/src/native/snapshots/extractor__native__tests__theme_typographies.snap index 8d134d650..efb66b50f 100644 --- a/libs/extractor/src/native/snapshots/extractor__native__tests__theme_typographies.snap +++ b/libs/extractor/src/native/snapshots/extractor__native__tests__theme_typographies.snap @@ -3,7 +3,6 @@ source: libs/extractor/src/native/tests.rs expression: "compile_themed(two_themes(), true, code)" --- error: test.tsx:2:7: `` cannot use `typography` on React Native: devup.json defines no `missing` typography. Fix: add the typography to the theme in devup.json -test.tsx:3:7: `` cannot use `typography` on React Native: `heading` has a value at each breakpoint: a responsive value is chosen by the window width, which needs the React Native runtime that this version does not include yet. Fix: give it one value in devup.json, or write the value itself test.tsx:4:7: `` cannot use `typography` on React Native: the build reads the styles of a typography by its name, which a value read at runtime does not give. Fix: write the name, or a condition between names such as `typography={big ? 'h1' : 'body'}` test.tsx:5:7: `` cannot use `typography` on React Native: `2em` is relative to the font size, and the typography has no font size in pixels. Fix: give the typography a `fontSize` in pixels, or the value in pixels test.tsx:6:7: `` cannot use `typography` on React Native: devup.json defines no `1` typography. Fix: add the typography to the theme in devup.json diff --git a/libs/extractor/src/native/style.rs b/libs/extractor/src/native/style.rs index f6e48f5ea..26e71d31d 100644 --- a/libs/extractor/src/native/style.rs +++ b/libs/extractor/src/native/style.rs @@ -4,6 +4,22 @@ use super::props::Declaration; use super::sheet::Sheet; +/// The styles of a value at each breakpoint, each with the styles in each +/// theme: `grid[level][theme]`. A breakpoint past the last takes the styles of +/// the last, and a row of one theme holds the styles of every theme +pub(super) type Grid = Vec>>; + +/// What a choice applies only while it holds +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +pub(super) enum State { + /// The theme at this index shows + Theme(usize), + /// The window is at this breakpoint or a wider one + AtLeast(usize), + /// The window is in landscape (`true`) or portrait (`false`) orientation + Landscape(bool), +} + /// The styles one prop declares #[derive(Debug, Clone, PartialEq)] pub(super) enum Choice { @@ -20,24 +36,74 @@ pub(super) enum Choice { consequent: Box, alternate: Box, }, - /// Styles the build knows for each theme, in the order of the theme - /// names; the element picks one by the theme the app shows - Themed(Vec>), - /// A choice that applies only while the theme at `index` shows - InTheme { index: usize, choice: Box }, + /// Styles the build knows for each breakpoint and theme; the element + /// picks one by the breakpoint and the theme the app shows + Varied(Grid), + /// A choice that applies only while `state` holds + When { state: State, choice: Box }, + /// Choices applied one after the other + All(Vec), } -/// The choice of `variants`, one a theme: static when every theme declares -/// the same styles -pub(super) fn themed(mut variants: Vec>) -> Choice { - if variants.windows(2).all(|pair| pair[0] == pair[1]) { - variants - .pop() - .filter(|declarations| !declarations.is_empty()) - .map_or(Choice::Empty, Choice::Static) - } else { - Choice::Themed(variants) +/// What the runtime tells a style: which theme shows, which breakpoint the +/// window is at, and whether it is in landscape +#[derive(Debug, Clone, Copy, Default, PartialEq, Eq)] +pub(super) struct Reads { + pub theme: bool, + pub breakpoint: bool, + pub landscape: bool, +} + +impl Reads { + pub(super) const fn any(self) -> bool { + self.theme || self.breakpoint || self.landscape + } + + /// What it reads, in the order of the runtime's hooks + pub(super) const fn flags(self) -> [bool; 3] { + [self.theme, self.breakpoint, self.landscape] + } + + pub(super) const fn union(self, other: Self) -> Self { + Self { + theme: self.theme || other.theme, + breakpoint: self.breakpoint || other.breakpoint, + landscape: self.landscape || other.landscape, + } + } +} + +/// The names of the variables holding what the runtime tells +pub(super) struct Vars<'v> { + pub theme: &'v str, + pub breakpoint: &'v str, + pub landscape: &'v str, +} + +/// The choice of `grid`, as small as it can be: the last breakpoints that +/// repeat the one before dropped, one theme when every theme declares the +/// same, static with one breakpoint and one theme +pub(super) fn varied(mut grid: Grid) -> Choice { + if grid.iter().flatten().all(Vec::is_empty) { + return Choice::Empty; + } + while grid.len() > 1 && grid[grid.len() - 1] == grid[grid.len() - 2] { + grid.pop(); } + if grid + .iter() + .all(|row| row.windows(2).all(|pair| pair[0] == pair[1])) + { + for row in &mut grid { + row.truncate(1); + } + } + if let [row] = grid.as_mut_slice() + && let [declarations] = row.as_mut_slice() + { + return Choice::Static(std::mem::take(declarations)); + } + Choice::Varied(grid) } /// `choice` applied only while the theme at `index` of `count` shows @@ -45,32 +111,60 @@ pub(super) fn in_theme(index: usize, count: usize, choice: Choice) -> Choice { match choice { Choice::Empty => Choice::Empty, choice if count <= 1 => choice, - Choice::Static(declarations) => Choice::Themed( - (0..count) - .map(|at| { - if at == index { - declarations.clone() - } else { - Vec::new() - } + Choice::Static(declarations) => { + in_theme(index, count, Choice::Varied(vec![vec![declarations]])) + } + Choice::Varied(grid) => varied( + grid.into_iter() + .map(|row| { + (0..count) + .map(|at| { + if at == index { + cell(&row, at).clone() + } else { + Vec::new() + } + }) + .collect() }) .collect(), ), - Choice::Themed(mut variants) => { - for (at, variant) in variants.iter_mut().enumerate() { - if at != index { - variant.clear(); - } - } - Choice::Themed(variants) - } - choice => Choice::InTheme { - index, + choice => when(State::Theme(index), choice), + } +} + +/// `choice` applied only while `state` holds +pub(super) fn when(state: State, choice: Choice) -> Choice { + match choice { + Choice::Empty => Choice::Empty, + // A block in a block of the same state, such as `_landscape` in + // `_landscape`, holds while the outer one does + Choice::When { + state: inner, + choice, + } if inner == state => Choice::When { state, choice }, + choice => Choice::When { + state, choice: Box::new(choice), }, } } +/// The styles of `row` in the theme at `theme` +const fn cell(row: &[Vec], theme: usize) -> &Vec { + &row[if row.len() == 1 { 0 } else { theme }] +} + +/// The styles of `grid` at the breakpoint `level` in the theme at `theme` +fn grid_cell(grid: &Grid, level: usize, theme: usize) -> &Vec { + cell(&grid[level.min(grid.len() - 1)], theme) +} + +/// How many themes a row of `grid` holds +fn themes_of(grid: &Grid) -> usize { + grid.iter().map(Vec::len).max().unwrap_or(1) +} + impl Choice { /// Whether the choice declares the React Native style `key` fn declares(&self, key: &str) -> bool { @@ -83,29 +177,38 @@ impl Choice { alternate, .. } => consequent.declares(key) || alternate.declares(key), - Self::Themed(variants) => variants + Self::Varied(grid) => grid .iter() + .flatten() .any(|declarations| declares(declarations, key)), - Self::InTheme { choice, .. } => choice.declares(key), + Self::When { choice, .. } => choice.declares(key), + Self::All(choices) => choices.iter().any(|choice| choice.declares(key)), } } - /// Whether the choice reads the theme the app shows - pub(super) fn reads_theme(&self) -> bool { + /// What the choice reads from the runtime + pub(super) fn reads(&self) -> Reads { match self { - Self::Empty | Self::Static(_) | Self::Dynamic(_) => false, + Self::Empty | Self::Static(_) | Self::Dynamic(_) => Reads::default(), Self::Condition { consequent, alternate, .. - } => consequent.reads_theme() || alternate.reads_theme(), - Self::Themed(_) | Self::InTheme { .. } => true, + } => consequent.reads().union(alternate.reads()), + Self::Varied(grid) => Reads { + theme: themes_of(grid) > 1, + breakpoint: grid.len() > 1, + landscape: false, + }, + Self::When { state, choice } => choice.reads().union(state.reads()), + Self::All(choices) => choices.iter().fold(Reads::default(), |reads, choice| { + reads.union(choice.reads()) + }), } } - /// The code of the choice, its static styles named in `sheet` and the - /// index of the theme read from `theme` - fn code(&self, sheet: &mut Sheet, theme: &str) -> String { + /// The code of the choice, its static styles named in `sheet` + fn code(&self, sheet: &mut Sheet, vars: &Vars<'_>) -> String { match self { Self::Empty => "null".to_string(), Self::Static(declarations) => sheet.reference(declarations), @@ -118,48 +221,181 @@ impl Choice { let test = operand(test); match alternate.as_ref() { Self::Empty => { - format!("{test} && {}", consequent.operand_code(sheet, theme)) + format!("{test} && {}", consequent.operand_code(sheet, vars)) } alternate => format!( "{test} ? {} : {}", - consequent.operand_code(sheet, theme), - alternate.operand_code(sheet, theme) + consequent.operand_code(sheet, vars), + alternate.operand_code(sheet, vars) ), } } - Self::Themed(variants) => { - let references: Vec = variants + Self::Varied(grid) => { + let parts = split(grid); + let codes: Vec = parts .iter() - .map(|declarations| { - if declarations.is_empty() { - "null".to_string() - } else { - sheet.reference(declarations) - } + .map(|part| match part { + Self::Varied(grid) => grid_code(grid, sheet, vars), + part => part.code(sheet, vars), }) .collect(); - format!("[{}][{theme}]", references.join(", ")) + if codes.len() == 1 { + codes.concat() + } else { + format!("[{}]", codes.join(", ")) + } } - Self::InTheme { index, choice } => { + Self::When { state, choice } => { format!( - "{theme} === {index} && {}", - choice.operand_code(sheet, theme) + "{} && {}", + state.test(vars), + choice.operand_code(sheet, vars) ) } + Self::All(choices) => { + let codes: Vec = choices + .iter() + .map(|choice| choice.code(sheet, vars)) + .collect(); + format!("[{}]", codes.join(", ")) + } } } /// The code of the choice as an operand of a condition - fn operand_code(&self, sheet: &mut Sheet, theme: &str) -> String { - let code = self.code(sheet, theme); - if matches!(self, Self::Condition { .. } | Self::InTheme { .. }) { - format!("({code})") - } else { + fn operand_code(&self, sheet: &mut Sheet, vars: &Vars<'_>) -> String { + let code = self.code(sheet, vars); + let compound = match self { + Self::Condition { .. } | Self::When { .. } => true, + Self::Varied(grid) => grid.len() > 1, + _ => false, + }; + if compound { format!("({code})") } else { code } + } +} + +impl State { + const fn reads(self) -> Reads { + Reads { + theme: matches!(self, Self::Theme(_)), + breakpoint: matches!(self, Self::AtLeast(_)), + landscape: matches!(self, Self::Landscape(_)), + } + } + + /// The code testing that the state holds + fn test(self, vars: &Vars<'_>) -> String { + match self { + Self::Theme(index) => format!("{} === {index}", vars.theme), + Self::AtLeast(level) => format!("{} >= {level}", vars.breakpoint), + Self::Landscape(true) => vars.landscape.to_string(), + Self::Landscape(false) => format!("!{}", vars.landscape), + } + } +} + +/// The parts of `grid` by what their styles differ by: the styles every +/// breakpoint and theme share, those that differ only by theme, only by +/// breakpoint, and by both, so a style object is repeated only for what +/// differs +fn split(grid: &Grid) -> Vec { + let mut keys: Vec<&str> = Vec::new(); + for (key, _) in grid.iter().flatten().flatten() { + if !keys.contains(&key.as_str()) { + keys.push(key); + } + } + let themes = themes_of(grid); + let mut groups: [Vec<&str>; 4] = Default::default(); + for key in keys { + let by_theme = grid.iter().any(|row| { + (1..themes).any(|theme| value(cell(row, theme), key) != value(cell(row, 0), key)) + }); + let by_breakpoint = (0..themes).any(|theme| { + (1..grid.len()).any(|level| { + value(grid_cell(grid, level, theme), key) != value(grid_cell(grid, 0, theme), key) + }) + }); + groups[usize::from(by_theme) + 2 * usize::from(by_breakpoint)].push(key); + } + groups + .iter() + .filter(|keys| !keys.is_empty()) + .map(|keys| varied(project(grid, keys))) + .collect() +} + +/// The value of `key` in `declarations` +fn value<'d>(declarations: &'d [Declaration], key: &str) -> Option<&'d Declaration> { + declarations.iter().find(|(name, _)| name == key) +} + +/// `grid` with only the styles of `keys` +fn project(grid: &Grid, keys: &[&str]) -> Grid { + grid.iter() + .map(|row| { + row.iter() + .map(|declarations| { + declarations + .iter() + .filter(|(key, _)| keys.contains(&key.as_str())) + .cloned() + .collect() + }) + .collect() + }) + .collect() +} + +/// The code picking the style object of `grid` by breakpoint and theme: a +/// condition on the breakpoint for each run of breakpoints that share their +/// styles, each picking by theme where the themes differ +fn grid_code(grid: &Grid, sheet: &mut Sheet, vars: &Vars<'_>) -> String { + let mut runs: Vec<(usize, &Vec>)> = Vec::new(); + for (level, row) in grid.iter().enumerate() { + if runs.last().is_none_or(|(_, last)| *last != row) { + runs.push((level, row)); + } + } + let codes: Vec = runs + .iter() + .map(|(_, row)| row_code(row, sheet, vars)) + .collect(); + match (runs.as_slice(), codes.as_slice()) { + ([_, (start, _)], [first, second]) if first == "null" => { + format!("{} >= {start} && {second}", vars.breakpoint) + } + _ => { + let mut code = codes.last().cloned().unwrap_or_default(); + for index in (0..runs.len() - 1).rev() { + code = format!( + "{} < {} ? {} : {code}", + vars.breakpoint, + runs[index + 1].0, + codes[index] + ); + } code } } } +/// The code picking the style object of `row` by theme +fn row_code(row: &[Vec], sheet: &mut Sheet, vars: &Vars<'_>) -> String { + let mut reference = |declarations: &Vec| { + if declarations.is_empty() { + "null".to_string() + } else { + sheet.reference(declarations) + } + }; + if row.windows(2).all(|pair| pair[0] == pair[1]) { + return reference(&row[0]); + } + let references: Vec = row.iter().map(reference).collect(); + format!("[{}][{}]", references.join(", "), vars.theme) +} + fn declares(declarations: &[Declaration], key: &str) -> bool { declarations.iter().any(|(name, _)| name == key) } @@ -195,36 +431,88 @@ fn merge(declarations: &mut Vec, later: Vec) { } } +/// `declarations` of a narrower breakpoint with `later` of a wider one +/// declared after them, as a media query declares them on the web: a later +/// shorthand also replaces the longhands it covers, which React Native would +/// otherwise prefer whatever their order +pub(super) fn cascade(declarations: &mut Vec, later: Vec) { + declarations.retain(|(key, _)| !later.iter().any(|(shorthand, _)| covers(shorthand, key))); + merge(declarations, later); +} + +/// Whether React Native prefers the style `longhand` over `shorthand`, which +/// sets it too +fn covers(shorthand: &str, longhand: &str) -> bool { + let sides = |base: &str, sides: &[&str]| { + longhand + .strip_prefix(base) + .is_some_and(|side| sides.contains(&side)) + }; + match shorthand { + "margin" | "padding" => longhand != shorthand && longhand.starts_with(shorthand), + "inset" => { + longhand != shorthand + && (longhand.starts_with(shorthand) + || matches!(longhand, "top" | "right" | "bottom" | "left")) + } + "marginVertical" => sides("margin", &["Top", "Bottom"]), + "paddingVertical" => sides("padding", &["Top", "Bottom"]), + "marginHorizontal" => sides("margin", &["Left", "Right", "Start", "End"]), + "paddingHorizontal" => sides("padding", &["Left", "Right", "Start", "End"]), + "gap" => matches!(longhand, "rowGap" | "columnGap"), + "borderWidth" | "borderColor" | "borderRadius" => { + longhand != shorthand + && longhand.starts_with("border") + && longhand.ends_with(&shorthand["border".len()..]) + } + _ => false, + } +} + /// `later` merged into the last of `rest` when both are static or both -/// differ by theme, else `later` itself to apply after it +/// differ by breakpoint or theme, else `later` itself to apply after it fn merge_last(rest: &mut [Choice], later: Choice) -> Option { match (rest.last_mut(), later) { (Some(Choice::Static(last)), Choice::Static(declarations)) => { merge(last, declarations); None } - (Some(Choice::Themed(last)), Choice::Static(declarations)) => { - for variant in last { - merge(variant, declarations.clone()); + (Some(Choice::Varied(last)), Choice::Static(declarations)) => { + for cell in last.iter_mut().flatten() { + merge(cell, declarations.clone()); } None } - (Some(Choice::Themed(last)), Choice::Themed(variants)) => { - for (variant, later) in last.iter_mut().zip(variants) { - merge(variant, later); - } + (Some(Choice::Varied(last)), Choice::Varied(grid)) => { + *last = merge_grids(last, &grid); None } (_, later) => Some(later), } } +/// `later` declared after `earlier`, at every breakpoint and theme of either +fn merge_grids(earlier: &Grid, later: &Grid) -> Grid { + let themes = themes_of(earlier).max(themes_of(later)); + (0..earlier.len().max(later.len())) + .map(|level| { + (0..themes) + .map(|theme| { + let mut declarations = grid_cell(earlier, level, theme).clone(); + merge(&mut declarations, grid_cell(later, level, theme).clone()); + declarations + }) + .collect() + }) + .collect() +} + /// The choices of an element in the order they apply, with as many static /// styles as can be moved first merged into one fn ordered(choices: Vec) -> Vec { let mut first = Vec::new(); let mut rest: Vec = Vec::new(); - for choice in choices { + for choice in flattened(choices) { match choice { Choice::Empty => {} Choice::Static(declarations) @@ -243,36 +531,56 @@ fn ordered(choices: Vec) -> Vec { if !first.is_empty() { rest.insert(0, Choice::Static(first)); } - // A later style can make every theme declare the same + // A later style can make every breakpoint or theme declare the same, and + // what differs splits from what does not rest.into_iter() - .map(|choice| match choice { - Choice::Themed(variants) => themed(variants), - choice => choice, + .flat_map(|choice| match choice { + Choice::Varied(grid) => match varied(grid) { + Choice::Varied(grid) => split(&grid), + choice => vec![choice], + }, + choice => vec![choice], }) + .filter(|choice| *choice != Choice::Empty) .collect() } -/// The `style` an element takes, and whether it reads the theme the app shows +/// `choices` with the choices of each `All` in its place +fn flattened(choices: Vec) -> Vec { + choices + .into_iter() + .flat_map(|choice| match choice { + Choice::All(choices) => flattened(choices), + choice => vec![choice], + }) + .collect() +} + +/// The `style` an element takes, and what it reads from the runtime pub(super) struct StyleCode { pub code: String, - pub reads_theme: bool, + pub reads: Reads, } /// The code of the `style` an element takes: its choices, then the code of /// the styles it is given whole (a spread's `style`, its own `style` prop); -/// `None` when its props declare no style, and it keeps what it is given. -/// The index of the theme the app shows is read from `theme` +/// `None` when its props declare no style, and it keeps what it is given pub(super) fn style_code( choices: Vec, given: Vec, sheet: &mut Sheet, - theme: &str, + vars: &Vars<'_>, ) -> Option { let choices = ordered(choices); - let reads_theme = choices.iter().any(Choice::reads_theme); + let reads = choices.iter().fold(Reads::default(), |reads, choice| { + reads.union(choice.reads()) + }); let mut entries: Vec = choices .iter() - .map(|choice| choice.code(sheet, theme)) + .map(|choice| match choice { + Choice::Varied(grid) => grid_code(grid, sheet, vars), + choice => choice.code(sheet, vars), + }) .collect(); if entries.is_empty() { return None; @@ -283,5 +591,5 @@ pub(super) fn style_code( } else { format!("[{}]", entries.join(", ")) }; - Some(StyleCode { code, reads_theme }) + Some(StyleCode { code, reads }) } diff --git a/libs/extractor/src/native/tests.rs b/libs/extractor/src/native/tests.rs index ee1c164f3..3665d9263 100644 --- a/libs/extractor/src/native/tests.rs +++ b/libs/extractor/src/native/tests.rs @@ -5,11 +5,17 @@ use super::element::units_declaration; use super::errors::{Problem, RuntimeFeature}; use super::props::Declaration; use super::sheet::{Sheet, key_name}; -use super::style::{Choice, in_theme, style_code, themed}; +use super::style::{Choice, State, Vars, cascade, in_theme, style_code, varied, when}; use super::values::{Literal, NativeValue, css_text, number_or_text, quoted_list}; use super::{NativePlatform, NativeTarget, NativeTheme, TokenLevels, TypographyProperties}; use crate::{ExtractOption, ExtractTarget, extract, extract_without_source_map}; +const VARS: Vars<'static> = Vars { + theme: "t", + breakpoint: "b", + landscape: "l", +}; + const IMPORT: &str = "import { Box, Button, Center, Flex, Image, Input, Text, VStack } from '@devup-ui/react'\n"; @@ -429,7 +435,7 @@ fn style_code_orders_and_merges_choices() { ], vec!["given".to_string()], &mut sheet, - "t", + &VARS, ) .map(|style| style.code); assert_eq!( @@ -447,7 +453,7 @@ fn style_code_orders_and_merges_choices() { vec![Choice::Empty], vec!["given".to_string()], &mut sheet, - "t" + &VARS ) .is_none() ); @@ -606,6 +612,7 @@ fn theme(names: &[&str], dark: Option, tokens: &[(&str, &[Option<&str>])] .into_iter() .map(|(name, levels)| (name.to_string(), levels)) .collect(), + ..NativeTheme::default() } } @@ -862,10 +869,10 @@ fn names_selector_themes(#[case] prop: &str, #[case] expected: &str) { #[test] fn themed_choices_collapse_when_every_theme_agrees() { let red = declarations(&[("opacity", 1.0)]); - assert_eq!(themed(vec![]), Choice::Empty); - assert_eq!(themed(vec![vec![], vec![]]), Choice::Empty); + assert_eq!(varied(vec![vec![]]), Choice::Empty); + assert_eq!(varied(vec![vec![vec![], vec![]]]), Choice::Empty); assert_eq!( - themed(vec![red.clone(), red.clone()]), + varied(vec![vec![red.clone(), red.clone()]]), Choice::Static(red.clone()) ); assert_eq!( @@ -875,6 +882,265 @@ fn themed_choices_collapse_when_every_theme_agrees() { assert_eq!(in_theme(1, 2, Choice::Empty), Choice::Empty); assert_eq!( in_theme(1, 2, Choice::Static(red.clone())), - Choice::Themed(vec![vec![], red]) + Choice::Varied(vec![vec![vec![], red]]) + ); +} + +const RESPONSIVE_ELEMENTS: &str = r#"export function Layout({ on, x }) { + return ( + + + + + + + + + + + + + + + + + ) +}"#; + +const ORIENTATION_ELEMENTS: &str = r"export function Screen({ on }) { + return ( + + + + ) +}"; + +#[rstest] +#[case::responsive("responsive_arrays", RESPONSIVE_ELEMENTS)] +#[case::orientation("orientation_blocks", ORIENTATION_ELEMENTS)] +#[case::hooks_in_arrow( + "responsive_hooks_in_arrow", + "export const A = () => ;\nexport const B = () => ;\nexport const c = ;\nexport const d = " +)] +#[case::name_collisions( + "responsive_name_collisions", + "const __b = 1, __l = 2, __useBreakpoint = 3, __useLandscape = 4;\nexport const A = () => " +)] +fn compiles_responsive(#[case] name: &str, #[case] code: &str) { + assert_snapshot!(name, compile_themed(two_themes(), true, code)); +} + +/// Token values at each breakpoint +fn levels(values: &[Option<&str>]) -> TokenLevels { + values + .iter() + .map(|value| value.map(str::to_string)) + .collect() +} + +/// Two themes whose tokens and typographies differ by breakpoint +fn responsive_themes() -> NativeTheme { + let mut theme = two_themes(); + theme.tokens.insert( + "space".to_string(), + vec![ + Some(levels(&[Some("4px"), None, Some("8px")])), + Some(levels(&[Some("6px"), None, Some("12px")])), + ], + ); + theme.tokens.insert( + "edge".to_string(), + vec![ + Some(levels(&[ + Some("1px solid $primary"), + Some("2px solid $primary") + ])); + 2 + ], + ); + theme.tokens.insert( + "late".to_string(), + vec![Some(levels(&[None, Some("2px")])); 2], + ); + theme.typography.insert( + "display".to_string(), + vec![ + Some(typography_entry(&[ + ("font-family", "Inter"), + ("font-size", "$captionSize"), + ("line-height", "1.5"), + ])), + None, + Some(typography_entry(&[("font-size", "40px")])), + ], + ); + theme +} + +const THEMED_RESPONSIVE_ELEMENTS: &str = r#"export function Card({ on }) { + return ( + + + + + + + + + + + + ) +}"#; + +#[rstest] +#[case::two_themes("responsive_themes", responsive_themes(), THEMED_RESPONSIVE_ELEMENTS)] +#[case::custom_breakpoints( + "responsive_custom_breakpoints", + NativeTheme { + breakpoints: vec![0, 600], + ..responsive_themes() + }, + "export const A = () => ;\nexport const b = " +)] +#[case::no_breakpoints( + "responsive_no_breakpoints", + NativeTheme { + breakpoints: vec![], + ..responsive_themes() + }, + "export const A = () => " +)] +fn compiles_responsive_themes(#[case] name: &str, #[case] theme: NativeTheme, #[case] code: &str) { + assert_snapshot!(name, compile_themed(theme, true, code)); +} + +#[rstest] +#[case::arrays( + "runtime_off_arrays", + ";\n;\n" +)] +#[case::tokens( + "runtime_off_responsive_tokens", + ";\n" +)] +#[case::orientation( + "runtime_off_orientation", + "" +)] +fn runtime_off_rejects_responsive_values(#[case] name: &str, #[case] code: &str) { + assert_snapshot!(name, compile_themed(one_theme(), false, code)); +} + +#[rstest] +#[case::spread("responsive_spread", "")] +#[case::nested("responsive_nested", "")] +#[case::orientation_value( + "orientation_value", + "" +)] +fn responsive_errors(#[case] name: &str, #[case] code: &str) { + assert_snapshot!(name, compile_themed(two_themes(), true, code)); +} + +#[rstest] +#[case("margin", "marginTop", true)] +#[case("margin", "margin", false)] +#[case("margin", "padding", false)] +#[case("padding", "paddingVertical", true)] +#[case("inset", "insetBlock", true)] +#[case("inset", "top", true)] +#[case("inset", "inset", false)] +#[case("inset", "width", false)] +#[case("marginVertical", "marginTop", true)] +#[case("marginVertical", "marginLeft", false)] +#[case("paddingVertical", "paddingBottom", true)] +#[case("marginHorizontal", "marginStart", true)] +#[case("marginHorizontal", "marginTop", false)] +#[case("paddingHorizontal", "paddingRight", true)] +#[case("gap", "rowGap", true)] +#[case("gap", "gap", false)] +#[case("borderWidth", "borderTopWidth", true)] +#[case("borderWidth", "borderWidth", false)] +#[case("borderColor", "borderLeftColor", true)] +#[case("borderRadius", "borderTopLeftRadius", true)] +#[case("borderRadius", "outlineRadius", false)] +#[case("width", "minWidth", false)] +fn cascade_replaces_covered_longhands( + #[case] shorthand: &str, + #[case] longhand: &str, + #[case] replaced: bool, +) { + // Given: a narrower breakpoint declaring `longhand` + let mut declared = declarations(&[(longhand, 1.0), ("opacity", 1.0)]); + // When: a wider one declares `shorthand` + cascade(&mut declared, declarations(&[(shorthand, 2.0)])); + // Then + let kept = declared.iter().any(|(key, value)| { + key == longhand && (longhand == shorthand || *value == NativeValue::Number(1.0)) + }); + assert_eq!(!kept, replaced, "{declared:?}"); + assert!(declared.iter().any(|(key, _)| key == "opacity")); +} + +#[test] +fn varied_choices_pick_by_breakpoint_and_theme() { + let a = declarations(&[("padding", 1.0)]); + let b = declarations(&[("padding", 2.0)]); + let c = declarations(&[("padding", 3.0)]); + let mut sheet = Sheet::new("s".to_string()); + let mut code = |choice: Choice| { + style_code(vec![choice], vec![], &mut sheet, &VARS) + .map_or_else(Default::default, |style| (style.code, style.reads)) + }; + // Three runs of breakpoints, the first without styles + let (three, _) = code(Choice::Varied(vec![ + vec![vec![]], + vec![a.clone()], + vec![a.clone()], + vec![b.clone()], + ])); + assert_eq!(three, "b < 1 ? null : b < 3 ? s.a : s.b"); + // Breakpoints and themes both + let (both, reads) = code(Choice::Varied(vec![ + vec![a.clone(), b.clone()], + vec![c.clone(), c.clone()], + ])); + assert_eq!(both, "b < 1 ? [s.a, s.b][t] : s.c"); + assert!(reads.theme && reads.breakpoint && !reads.landscape); + // In a condition, and applied while a state holds + let (condition, reads) = code(Choice::Condition { + test: "on".to_string(), + consequent: Box::new(Choice::Varied(vec![vec![a.clone()], vec![b.clone()]])), + alternate: Box::new(when(State::Landscape(false), Choice::Static(c))), + }); + assert_eq!(condition, "on ? (b < 1 ? s.a : s.b) : (!l && s.c)"); + assert!(!reads.theme && reads.breakpoint && reads.landscape); + let (nested, _) = code(Choice::Condition { + test: "on".to_string(), + consequent: Box::new(Choice::Varied(vec![ + vec![declarations(&[("padding", 1.0), ("margin", 1.0)])], + vec![declarations(&[("padding", 2.0), ("margin", 1.0)])], + ])), + alternate: Box::new(Choice::All(vec![ + Choice::Static(a.clone()), + when(State::AtLeast(2), Choice::Static(b)), + ])), + }); + assert_eq!( + nested, + "on ? ([s.d, b < 1 ? s.a : s.b]) : [s.a, b >= 2 && s.b]" + ); + assert_eq!(when(State::Theme(1), Choice::Empty), Choice::Empty); + assert_eq!( + in_theme( + 1, + 2, + when(State::Landscape(true), Choice::Static(a.clone())) + ), + when( + State::Theme(1), + when(State::Landscape(true), Choice::Static(a)) + ) ); } diff --git a/libs/extractor/src/native/theme.rs b/libs/extractor/src/native/theme.rs index c7f99a530..e168d76e4 100644 --- a/libs/extractor/src/native/theme.rs +++ b/libs/extractor/src/native/theme.rs @@ -1,12 +1,12 @@ //! The theme of `devup.json` as the React Native output reads it: the names -//! of the themes in the order the runtime indexes them, and the value of each -//! token and typography in every theme, resolved at build time. +//! of the themes in the order the runtime indexes them, the breakpoints, and +//! the value of each token and typography in every theme at each breakpoint, +//! resolved at build time. use std::borrow::Cow; use std::collections::BTreeMap; -use super::NativeTarget; -use super::errors::{Problem, RuntimeFeature}; +use super::errors::Problem; /// The values of a token at each breakpoint, `None` where it has none pub type TokenLevels = Vec>; @@ -14,9 +14,12 @@ pub type TokenLevels = Vec>; /// The CSS properties of a typography, each with its value pub type TypographyProperties = Vec<(String, String)>; +/// The breakpoints of the web, which `devup.json` keeps unless it sets its own +pub const DEFAULT_BREAKPOINTS: [u16; 6] = [0, 480, 768, 992, 1280, 1600]; + /// The theme a file is compiled with. Built from `devup.json` by the /// bindings, which read it with the web's theme parser -#[derive(Debug, Clone, Default, PartialEq, Eq)] +#[derive(Debug, Clone, PartialEq, Eq)] pub struct NativeTheme { /// The theme names, the default first: the runtime picks a style object by /// the index of a name here @@ -29,6 +32,21 @@ pub struct NativeTheme { pub tokens: BTreeMap>>, /// Each typography by name, with its properties at each breakpoint pub typography: BTreeMap>>, + /// The window width, in density-independent pixels, each breakpoint + /// starts at, as the web's media queries read them + pub breakpoints: Vec, +} + +impl Default for NativeTheme { + fn default() -> Self { + Self { + names: Vec::new(), + dark: None, + tokens: BTreeMap::new(), + typography: BTreeMap::new(), + breakpoints: DEFAULT_BREAKPOINTS.to_vec(), + } + } } /// How many times a token's value may name another token @@ -41,25 +59,30 @@ impl NativeTheme { self.names.len().max(1) } + /// How many breakpoints a responsive value can tell apart: at least one + pub(super) fn levels(&self) -> usize { + self.breakpoints.len().max(1) + } + /// The index of the theme `name` pub(super) fn index_of(&self, name: &str) -> Option { self.names.iter().position(|theme| theme == name) } - /// `text` with each `$token` replaced by its value in the theme at - /// `index`, or `None` when that theme does not define one of them + /// `text` with each `$token` replaced by its value at the breakpoint + /// `level` in the theme at `index`, or `None` when that theme does not + /// define one of them there pub(super) fn resolve<'t>( &self, text: &'t str, - index: usize, - target: &NativeTarget, + at: (usize, usize), ) -> Result>, Problem> { if !text.contains('$') { return Ok(Some(Cow::Borrowed(text))); } let mut resolved = text.to_string(); for _ in 0..MAX_TOKEN_DEPTH { - match self.resolve_once(&resolved, index, target)? { + match self.resolve_once(&resolved, at)? { Some(next) if next == resolved => return Ok(Some(Cow::Owned(next))), Some(next) => resolved = next, None => return Ok(None), @@ -72,17 +95,12 @@ impl NativeTheme { } /// `text` with each `$token` replaced once - fn resolve_once( - &self, - text: &str, - index: usize, - target: &NativeTarget, - ) -> Result, Problem> { + fn resolve_once(&self, text: &str, at: (usize, usize)) -> Result, Problem> { let mut resolved = String::with_capacity(text.len()); let mut rest = text; while let Some((before, token, after)) = next_token(rest) { resolved.push_str(before); - match self.token(token, index, target)? { + match self.token(token, at)? { Some(value) => resolved.push_str(value), None => return Ok(None), } @@ -92,13 +110,10 @@ impl NativeTheme { Ok(Some(resolved)) } - /// The value of `token` (as written after `$`) in the theme at `index` - fn token( - &self, - token: &str, - index: usize, - target: &NativeTarget, - ) -> Result, Problem> { + /// The value of `token` (as written after `$`) at the breakpoint `level` + /// in the theme at `index`: its value at the last breakpoint up to + /// `level` that gives one, as the web's media queries cascade + fn token(&self, token: &str, (index, level): (usize, usize)) -> Result, Problem> { let key = token.replace('.', "-"); let themes = self.tokens.get(&key).ok_or_else(|| { Problem::new( @@ -106,51 +121,82 @@ impl NativeTheme { "add the token to the theme in devup.json, or write the value itself", ) })?; - if themes.iter().flatten().any(is_responsive) { - return Err(responsive_token(token, target)); - } Ok(themes .get(index) .and_then(Option::as_ref) - .and_then(|levels| levels.first()) - .and_then(Option::as_deref)) + .and_then(|levels| at_level(levels, level))) } - /// The properties of the typography `name` + /// The properties of the typography `name` at the breakpoint `level`: + /// each property as the last breakpoint up to `level` that gives it pub(super) fn typography( &self, name: &str, - target: &NativeTarget, - ) -> Result<&TypographyProperties, Problem> { + level: usize, + ) -> Result { let levels = self.typography.get(name).ok_or_else(|| { Problem::new( format!("devup.json defines no `{name}` typography"), "add the typography to the theme in devup.json", ) })?; - match levels.split_first() { - Some((Some(properties), rest)) if rest.iter().all(Option::is_none) => Ok(properties), - _ => Err(responsive_token(name, target)), + let mut properties: TypographyProperties = Vec::new(); + for entry in levels.iter().take(level + 1).flatten() { + for (property, value) in entry { + match properties.iter_mut().find(|(name, _)| name == property) { + Some(existing) => existing.1.clone_from(value), + None => properties.push((property.clone(), value.clone())), + } + } } + Ok(properties) + } + + /// How many breakpoints the tokens `text` names tell apart, through the + /// tokens their values name: one when none is responsive + pub(super) fn token_levels(&self, text: &str) -> usize { + self.token_levels_within(text, MAX_TOKEN_DEPTH) } -} -/// Whether a token has a value at a breakpoint but the first, which the -/// window width chooses -fn is_responsive(levels: &TokenLevels) -> bool { - !matches!(levels.split_first(), Some((Some(_), rest)) if rest.iter().all(Option::is_none)) + fn token_levels_within(&self, text: &str, depth: usize) -> usize { + let mut levels = 1; + let mut rest = text; + while let Some((_, token, after)) = next_token(rest) { + let all = self.tokens.get(&token.replace('.', "-")); + for values in all.into_iter().flatten().flatten() { + levels = levels.max(values.len()); + if depth > 0 { + for value in values.iter().flatten() { + levels = levels.max(self.token_levels_within(value, depth - 1)); + } + } + } + rest = after; + } + levels + } + + /// How many breakpoints the typography `name` tells apart, through the + /// tokens its values name + pub(super) fn typography_levels(&self, name: &str) -> usize { + self.typography.get(name).map_or(1, |levels| { + levels + .iter() + .flatten() + .flatten() + .map(|(_, value)| self.token_levels(value)) + .fold(levels.len(), usize::max) + }) + } } -/// Why a token with a value at each breakpoint cannot compile yet -fn responsive_token(name: &str, target: &NativeTarget) -> Problem { - let problem = RuntimeFeature::Responsive.problem(target); - Problem::new( - format!( - "`{name}` has a value at each breakpoint: {}", - problem.reason - ), - "give it one value in devup.json, or write the value itself", - ) +/// The value of `levels` at the breakpoint `level`: the last one up to it +fn at_level(levels: &TokenLevels, level: usize) -> Option<&str> { + levels + .iter() + .take(level + 1) + .rev() + .find_map(Option::as_deref) } /// The text before the first `$token` of `text`, the token's name and the diff --git a/packages/metro-plugin/README.md b/packages/metro-plugin/README.md index 41d86cfa9..1a4e54e18 100644 --- a/packages/metro-plugin/README.md +++ b/packages/metro-plugin/README.md @@ -117,23 +117,44 @@ The build imports these from `@devup-ui/react/native`, a store read with `useSyncExternalStore` that computes no style; web builds never import it. `setTheme` does not save the choice across launches. +## Responsive values + +Responsive arrays, and `length`, `shadow` and `typography` tokens with a value +at each breakpoint, use the `breakpoints` of devup.json (the web's +`[0, 480, 768, 992, 1280, 1600]` by default), measured against the window +width in density-independent pixels. As on the web, each value applies from +its breakpoint on and `null` keeps the one before: + +```tsx + +// +``` + +The build precomputes one style object for each run of breakpoints that +share their styles, only for the styles that differ; a value that differs by +theme and breakpoint picks by both. The runtime listens to the window once +and renders a component again only when the window crosses into another +breakpoint. `_portrait` and `_landscape` apply their styles while the window +is in that orientation. + +A value read at runtime in an array (`p={[x, 2]}`) applies from its +breakpoint on as it is. + ## Limits of this version Only styles the build can decide are supported: literals, values read at -runtime, theme tokens, conditions between them and the platform and theme -blocks. These are build errors, reported by Metro at the file, line and -column: +runtime, theme tokens, responsive values, conditions between them and the +platform, theme and orientation blocks. These are build errors, reported by +Metro at the file, line and column: -- responsive arrays (`p={[1, 2]}`), and tokens or typography with a value at - each breakpoint - interaction states (`_hover`, `_active`, `_pressed`, `_focus`, ...) - `css()`, `styled()`, `globalCss()`, `keyframes()` and `Grid` - any prop React Native has no style for -- with `runtime: false`, a value that differs by theme, `_theme*` with more - than one theme, and `useTheme`, `getTheme` and `setTheme` +- with `runtime: false`, a value that differs by theme or breakpoint, + `_theme*` with more than one theme, `_portrait`, `_landscape`, and + `useTheme`, `getTheme` and `setTheme` -The runtime that brings responsive values and `_pressed` comes in a later -version. +The runtime that brings `_pressed` comes in a later version. Metro reads devup.json when it starts, so restart Metro after changing it (`--reset-cache` is not needed). diff --git a/packages/react/src/native/__tests__/index.browser.test.tsx b/packages/react/src/native/__tests__/index.browser.test.tsx index 1dd10010e..7dc2761e6 100644 --- a/packages/react/src/native/__tests__/index.browser.test.tsx +++ b/packages/react/src/native/__tests__/index.browser.test.tsx @@ -8,7 +8,21 @@ const appearance = { listeners: [] as (() => void)[], } +/** The window React Native reports, and who listens to its changes */ +const dimensions = { + width: 390, + height: 844, + listeners: [] as (() => void)[], +} + mock.module('react-native', () => ({ + Dimensions: { + get: () => ({ width: dimensions.width, height: dimensions.height }), + addEventListener: (event: string, listener: () => void) => { + if (event === 'change') dimensions.listeners.push(listener) + return { remove: () => {} } + }, + }, Appearance: { getColorScheme: () => appearance.scheme, addChangeListener: (listener: () => void) => { @@ -26,12 +40,34 @@ function changeAppearance(scheme: string | null) { }) } +/** The window resizing to `width` by `height` */ +function resize(width: number, height: number) { + act(() => { + dimensions.width = width + dimensions.height = height + for (const listener of dimensions.listeners) listener() + }) +} + const runtime = await import('../index') -const { defineThemes, getTheme, setTheme, Themed, useTheme, useThemeIndex } = - runtime +const { + defineBreakpoints, + defineThemes, + getBreakpoint, + getTheme, + setTheme, + Themed, + useBreakpoint, + useLandscape, + useTheme, + useThemeIndex, +} = runtime beforeEach(() => { appearance.scheme = 'light' + dimensions.width = 390 + dimensions.height = 844 + defineBreakpoints([0, 480, 768, 992, 1280, 1600]) defineThemes(['light', 'dark', 'sepia'], 1) setTheme(null) }) @@ -123,3 +159,85 @@ describe('Themed', () => { expect(span()?.getAttribute('data-color')).toBe('brown') }) }) + +describe('getBreakpoint and useBreakpoint', () => { + it('give the last breakpoint the window width reaches', () => { + expect(getBreakpoint()).toBe(0) + dimensions.width = 480 + expect(getBreakpoint()).toBe(1) + dimensions.width = 1599 + expect(getBreakpoint()).toBe(4) + dimensions.width = 4000 + expect(getBreakpoint()).toBe(5) + }) + + it('read the breakpoints devup.json gives', () => { + defineBreakpoints([100, 600]) + dimensions.width = 50 + expect(getBreakpoint()).toBe(0) + dimensions.width = 599 + expect(getBreakpoint()).toBe(0) + dimensions.width = 600 + expect(getBreakpoint()).toBe(1) + defineBreakpoints([]) + expect(getBreakpoint()).toBe(0) + }) + + it('render again only when the window crosses a breakpoint', () => { + let renders = 0 + const { result } = renderHook(() => { + renders += 1 + return useBreakpoint() + }) + expect([result.current, renders]).toEqual([0, 1]) + resize(400, 844) + resize(479, 844) + expect([result.current, renders]).toEqual([0, 1]) + resize(480, 844) + expect([result.current, renders]).toEqual([1, 2]) + resize(700, 844) + expect([result.current, renders]).toEqual([1, 2]) + resize(1024, 844) + expect(result.current).toBe(3) + resize(320, 844) + expect(result.current).toBe(0) + }) +}) + +describe('useLandscape', () => { + it('renders again when the window turns', () => { + const { result } = renderHook(() => useLandscape()) + expect(result.current).toBe(false) + resize(844, 390) + expect(result.current).toBe(true) + resize(390, 844) + expect(result.current).toBe(false) + }) + + it('shares one listener of the window with every hook', () => { + renderHook(() => [useLandscape(), useBreakpoint(), useTheme()]) + renderHook(() => useBreakpoint()) + expect(dimensions.listeners).toHaveLength(1) + }) +}) + +describe('Themed with breakpoints', () => { + it('renders the style of the breakpoint and orientation of the window', () => { + const Probe = ({ style }: { style?: string }) => + createElement('span', { 'data-style': style }) + const { container } = render( + createElement(Themed, { + $c: Probe, + $s: (theme: number, breakpoint: number, landscape: boolean) => + `${theme}-${breakpoint}-${landscape}`, + }), + ) + const style = () => + container.querySelector('span')?.getAttribute('data-style') + expect(style()).toBe('0-0-false') + resize(844, 390) + expect(style()).toBe('0-2-true') + changeAppearance('dark') + expect(style()).toBe('1-2-true') + }) +}) diff --git a/packages/react/src/native/index.ts b/packages/react/src/native/index.ts index cffcb461e..f9c147fd8 100644 --- a/packages/react/src/native/index.ts +++ b/packages/react/src/native/index.ts @@ -4,15 +4,16 @@ import { type ReactElement, useSyncExternalStore, } from 'react' -import { Appearance } from 'react-native' +import { Appearance, Dimensions } from 'react-native' import type { DevupTheme } from '../types/theme' /** * The React Native runtime of Devup UI. The build compiles every style to - * `StyleSheet` objects, one a theme when a value differs by theme; this - * module only tells which theme shows. It reads no CSS, resolves no token - * and computes no style. Web builds never import it. + * `StyleSheet` objects, one a theme or a breakpoint when a value differs by + * them; this module only tells which theme shows, which breakpoint the + * window is at and whether it is in landscape. It reads no CSS, resolves no + * token and computes no style. Web builds never import it. */ type ThemeName = keyof DevupTheme extends undefined ? string : keyof DevupTheme @@ -23,6 +24,10 @@ let names: readonly string[] = [] let dark = -1 /** The theme `setTheme` chose, which wins over the system appearance */ let chosen: string | null = null +/** The window widths the breakpoints start at, as devup.json gives them */ +let breakpoints: readonly number[] = [0, 480, 768, 992, 1280, 1600] +/** The breakpoint and orientation listeners last heard of, as one number */ +let layout = -1 let following = false const listeners = new Set<() => void>() @@ -30,10 +35,26 @@ function notify(): void { for (const listener of listeners) listener() } +/** The breakpoint the window is at and whether it is in landscape, as one number */ +function readLayout(): number { + return getBreakpoint() * 2 + Number(getLandscape()) +} + +/** Tells the listeners when the window crosses a breakpoint or turns */ +function resize(): void { + const next = readLayout() + if (next !== layout) { + layout = next + notify() + } +} + function subscribe(listener: () => void): () => void { if (!following) { following = true + layout = readLayout() Appearance.addChangeListener(notify) + Dimensions.addEventListener('change', resize) } listeners.add(listener) return () => { @@ -52,6 +73,15 @@ export function defineThemes(themes: readonly string[], darkIndex = -1): void { dark = darkIndex } +/** + * Tells the runtime the breakpoints of devup.json when they are not the + * web's default. The build calls it in each file that reads the breakpoint. + * @internal + */ +export function defineBreakpoints(widths: readonly number[]): void { + breakpoints = widths +} + /** * The theme the app shows: the one `setTheme` chose, else the dark theme * while the system appearance is dark, else the default theme; `null` @@ -89,9 +119,46 @@ export function useThemeIndex(): number { } /** - * Renders `$c` with the style `$s` gives for the theme the app shows. The - * build renders an element through it where no function component can read - * the theme for it. + * The breakpoint the window is at: the index of the last breakpoint whose + * width the window reaches, as the web's `min-width` media queries choose, + * and `0` below them all + */ +export function getBreakpoint(): number { + const { width } = Dimensions.get('window') + let level = 0 + for (let index = 1; index < breakpoints.length; index++) { + if (width >= breakpoints[index]) level = index + } + return level +} + +/** + * The breakpoint the window is at, rendering again only when the window + * crosses into another breakpoint + */ +export function useBreakpoint(): number { + return useSyncExternalStore(subscribe, getBreakpoint, getBreakpoint) +} + +/** Whether the window is wider than it is tall */ +function getLandscape(): boolean { + const { width, height } = Dimensions.get('window') + return width > height +} + +/** + * Whether the window is in landscape, rendering again when it turns + * @internal + */ +export function useLandscape(): boolean { + return useSyncExternalStore(subscribe, getLandscape, getLandscape) +} + +/** + * Renders `$c` with the style `$s` gives for the theme the app shows, the + * breakpoint the window is at and whether it is in landscape. The build + * renders an element through it where no function component can read them + * for it. * @internal */ export function Themed({ @@ -100,7 +167,10 @@ export function Themed({ ...props }: { $c: ElementType - $s: (theme: number) => unknown + $s: (theme: number, breakpoint: number, landscape: boolean) => unknown } & Record): ReactElement { - return createElement($c, { ...props, style: $s(useThemeIndex()) }) + return createElement($c, { + ...props, + style: $s(useThemeIndex(), useBreakpoint(), useLandscape()), + }) } From 4daea343095fb6dc9c59f8857e81d510d580871b Mon Sep 17 00:00:00 2001 From: owjs3901 Date: Sat, 21 Nov 2026 10:55:43 +0900 Subject: [PATCH 11/40] fix(verify-dist): give the react-native stand-in Dimensions The React Native runtime now reads the window size through Dimensions. Co-Authored-By: Claude Opus 5.5 --- verify-dist.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/verify-dist.ts b/verify-dist.ts index e65a5b665..d2a4f414a 100644 --- a/verify-dist.ts +++ b/verify-dist.ts @@ -85,7 +85,7 @@ Bun.plugin({ name: 'react-native-stand-in', setup(build) { build.module('react-native', () => ({ - exports: { Appearance: {} }, + exports: { Appearance: {}, Dimensions: {} }, loader: 'object', })) }, From 6c2b6f2c67f18d5082c05993d1202b88a36740bf Mon Sep 17 00:00:00 2001 From: owjs3901 Date: Sat, 21 Nov 2026 11:16:53 +0900 Subject: [PATCH 12/40] feat(native): press styles through Pressable on React Native `_active` and its React Native name `_pressed` make the element a `Pressable` whose `style` is a function of whether it is pressed: `({ pressed }) => [styles.a, pressed && styles.b]`. A `Box`, `Flex`, `Center` or `VStack` with a press style becomes a `Pressable`; a `Button` already is one. Press styles combine with responsive values, themes, platforms, orientations and conditions, and need no runtime, so they work with `runtime: false` too. On a `Text`, an `Image` or an `Input`, and with `as`, they are build errors. Co-Authored-By: Claude Opus 5.5 --- .../changepack_log_react_native_pressed.json | 8 ++ .github/workflows/publish.yml | 1 + apps/expo/check-bundle.mjs | 10 +- apps/expo/src/App.tsx | 2 + libs/extractor/src/native/element.rs | 127 +++++++++++++----- libs/extractor/src/native/errors.rs | 26 ++-- libs/extractor/src/native/mod.rs | 5 +- ...actor__native__tests__platform_shapes.snap | 1 - .../extractor__native__tests__pressed.snap | 6 - ...ractor__native__tests__pressed_errors.snap | 9 ++ ...ative__tests__pressed_name_collisions.snap | 10 ++ ...r__native__tests__pressed_runtime_off.snap | 17 +++ ...ractor__native__tests__pressed_styles.snap | 47 +++++++ ...tractor__native__tests__runtime_false.snap | 1 - ...xtractor__native__tests__runtime_true.snap | 1 - libs/extractor/src/native/style.rs | 19 +++ libs/extractor/src/native/tests.rs | 57 +++++--- packages/metro-plugin/README.md | 22 ++- 18 files changed, 285 insertions(+), 84 deletions(-) create mode 100644 .changepacks/changepack_log_react_native_pressed.json delete mode 100644 libs/extractor/src/native/snapshots/extractor__native__tests__pressed.snap create mode 100644 libs/extractor/src/native/snapshots/extractor__native__tests__pressed_errors.snap create mode 100644 libs/extractor/src/native/snapshots/extractor__native__tests__pressed_name_collisions.snap create mode 100644 libs/extractor/src/native/snapshots/extractor__native__tests__pressed_runtime_off.snap create mode 100644 libs/extractor/src/native/snapshots/extractor__native__tests__pressed_styles.snap diff --git a/.changepacks/changepack_log_react_native_pressed.json b/.changepacks/changepack_log_react_native_pressed.json new file mode 100644 index 000000000..9ed03be7e --- /dev/null +++ b/.changepacks/changepack_log_react_native_pressed.json @@ -0,0 +1,8 @@ +{ + "changes": { + "bindings/devup-ui-binding/package.json": "Patch", + "bindings/devup-ui-wasm/package.json": "Patch" + }, + "note": "`codeExtractNative` compiles press styles for React Native (part of #411): `_active` and its React Native name `_pressed` make the element a `Pressable` (a `Box`, `Flex`, `Center` or `VStack` becomes one, a `Button` already is) whose `style` is a function of whether it is pressed, `({ pressed }) => [styles.a, pressed && styles.b]`. Press styles combine with responsive values, themes, platforms, orientations and conditions, and work with `runtime: false` as they need no runtime. They are build errors on a `Text`, an `Image` or an `Input`, and with `as`. Web output is unchanged.", + "date": "2026-11-21T00:00:00.000Z" +} diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 1696a4342..2bf0a8564 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -10,6 +10,7 @@ on: - feat/napi-binding - feat/react-native-metro - feat/react-native-themes + - feat/react-native-responsive # Pull requests and every job below run read-only. Only the `release` and # `deploy-pages` jobs get write permissions, and they run on pushes to main diff --git a/apps/expo/check-bundle.mjs b/apps/expo/check-bundle.mjs index 445677c7b..a7168e173 100644 --- a/apps/expo/check-bundle.mjs +++ b/apps/expo/check-bundle.mjs @@ -5,7 +5,8 @@ // must be there as React Native style objects. src/App.tsx reads the theme, // the breakpoint and the orientation, so it calls each of those hooks of the // runtime; src/Badge.tsx is styled the same in every theme and at every -// width, so it must not use the runtime. +// width, so it must not use the runtime. Its buttons take press styles, which +// React Native's `Pressable` applies through a function for `style`. import { readdirSync, readFileSync } from 'node:fs' import { join } from 'node:path' @@ -117,7 +118,12 @@ for (const platform of ['ios', 'android']) { if (code.includes(PLACEHOLDER)) { failures.push(`${platform}/${file}: holds "${PLACEHOLDER}"`) } - for (const style of ['backgroundColor:"#5a44ff"', 'StyleSheet']) { + for (const style of [ + 'backgroundColor:"#5a44ff"', + 'backgroundColor:"#4330d9"', + 'StyleSheet', + 'style:({pressed:', + ]) { if (!code.replaceAll(' ', '').includes(style)) { failures.push(`${platform}/${file}: lacks ${style}`) } diff --git a/apps/expo/src/App.tsx b/apps/expo/src/App.tsx index 02be3958e..624128e25 100644 --- a/apps/expo/src/App.tsx +++ b/apps/expo/src/App.tsx @@ -67,6 +67,7 @@ export function App() { gap={3} > + <__Pressable onPress={go} style={({ pressed: __p }) => [__p && __s.g, __b < 1 ? __s.h : __s.a]} /> + <__Pressable onPress={go} style={({ pressed: __p }) => [ + __s.i, + __p && (on ? __s.h : __s.a), + extra + ]}> + + + <__Pressable style={({ pressed: __p }) => __t === 1 && __p && __s.j} /> + + + + + + + - <__Pressable onPress={go} style={({ pressed: __p }) => [__p && __s.g, __b < 1 ? __s.h : __s.a]} /> + <__Pressable onPress={go} style={({ pressed: __p }) => [__b < 1 ? __s.g : __s.a, __p && __s.h]} /> <__Pressable onPress={go} style={({ pressed: __p }) => [ __s.i, - __p && (on ? __s.h : __s.a), + __p && (on ? __s.g : __s.a), extra ]}> diff --git a/libs/extractor/src/native/snapshots/extractor__native__tests__theme_two.snap b/libs/extractor/src/native/snapshots/extractor__native__tests__theme_two.snap index 78a879126..621f269f2 100644 --- a/libs/extractor/src/native/snapshots/extractor__native__tests__theme_two.snap +++ b/libs/extractor/src/native/snapshots/extractor__native__tests__theme_two.snap @@ -83,7 +83,7 @@ export function Card({ on, color }) { ]} /> - + ; } diff --git a/libs/extractor/src/native/tests.rs b/libs/extractor/src/native/tests.rs index 026082155..7cb5c546d 100644 --- a/libs/extractor/src/native/tests.rs +++ b/libs/extractor/src/native/tests.rs @@ -1169,3 +1169,17 @@ export const outside = "#; fn compiles_pressed(#[case] name: &str, #[case] runtime: bool, #[case] code: &str) { assert_snapshot!(name, compile_themed(two_themes(), runtime, code)); } + +#[rstest] +#[case::theme("block_order_theme", "")] +#[case::orientation("block_order_orientation", "")] +#[case::pressed("block_order_pressed", "")] +#[case::nested( + "block_order_nested", + "" +)] +#[case::platform("block_order_platform", "")] +fn blocks_apply_after_the_other_styles(#[case] name: &str, #[case] code: &str) { + let code = format!("export function A() {{ return {code} }}"); + assert_snapshot!(name, compile_themed(two_themes(), true, &code)); +} From 3ba5930b1fd09a3bfea33aa3129c8bd9e973bc89 Mon Sep 17 00:00:00 2001 From: owjs3901 Date: Sat, 21 Nov 2026 12:04:13 +0900 Subject: [PATCH 16/40] test(native): cover a static style checked against one kept in order Co-Authored-By: Claude Opus 5.5 --- libs/extractor/src/native/tests.rs | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/libs/extractor/src/native/tests.rs b/libs/extractor/src/native/tests.rs index 7cb5c546d..d65cf36d7 100644 --- a/libs/extractor/src/native/tests.rs +++ b/libs/extractor/src/native/tests.rs @@ -1183,3 +1183,24 @@ fn blocks_apply_after_the_other_styles(#[case] name: &str, #[case] code: &str) { let code = format!("export function A() {{ return {code} }}"); assert_snapshot!(name, compile_themed(two_themes(), true, &code)); } + +#[test] +fn a_static_style_after_one_kept_in_order_checks_it() { + let mut sheet = Sheet::new("s".to_string()); + let code = style_code( + vec![ + Choice::Dynamic(vec![("margin".to_string(), "m".to_string())]), + Choice::Static(declarations(&[("margin", 2.0)])), + Choice::Dynamic(vec![("width".to_string(), "w".to_string())]), + Choice::Static(declarations(&[("padding", 1.0)])), + ], + vec![], + &mut sheet, + &VARS, + ) + .map(|style| style.code); + assert_eq!( + code.as_deref(), + Some("[s.a, { margin: m }, s.b, { width: w }]") + ); +} From 897e66ced504cb21a2327fa8f9949f3cc345ff82 Mon Sep 17 00:00:00 2001 From: owjs3901 Date: Sat, 21 Nov 2026 12:04:56 +0900 Subject: [PATCH 17/40] feat(native): css() as CSS text, README and changepack Co-Authored-By: Claude Opus 5.5 --- .../changepack_log_react_native_css.json | 8 + .github/workflows/publish.yml | 1 + libs/extractor/src/native/element.rs | 10 +- libs/extractor/src/native/element/css_call.rs | 152 +++++++++++++++++- .../extractor__native__tests__css_errors.snap | 13 +- .../extractor__native__tests__css_only.snap | 9 +- .../extractor__native__tests__css_text.snap | 32 ++++ libs/extractor/src/native/tests.rs | 14 +- packages/metro-plugin/README.md | 44 ++++- 9 files changed, 268 insertions(+), 15 deletions(-) create mode 100644 .changepacks/changepack_log_react_native_css.json create mode 100644 libs/extractor/src/native/snapshots/extractor__native__tests__css_text.snap diff --git a/.changepacks/changepack_log_react_native_css.json b/.changepacks/changepack_log_react_native_css.json new file mode 100644 index 000000000..77bab2bf9 --- /dev/null +++ b/.changepacks/changepack_log_react_native_css.json @@ -0,0 +1,8 @@ +{ + "changes": { + "bindings/devup-ui-binding/package.json": "Patch", + "bindings/devup-ui-wasm/package.json": "Patch" + }, + "note": "`codeExtractNative` compiles `css()` for React Native (part of #411): a call compiles to the style it describes, the value React Native's `style` takes, and `className` on a Devup UI element passes it on before the element's style props. `css()` takes objects of style props with responsive values, theme tokens and blocks, conditions choosing between objects, what another `css()` gives, and CSS text whose interpolations are whole values. A `css()` whose styles differ by theme, breakpoint or orientation must be called in a function component or a hook. A `style` prop holding Devup UI elements or `css()` calls now compiles them too. Web output is unchanged.", + "date": "2026-11-21T00:00:00.000Z" +} diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 2bf0a8564..e1017f857 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -11,6 +11,7 @@ on: - feat/react-native-metro - feat/react-native-themes - feat/react-native-responsive + - feat/react-native-pressed # Pull requests and every job below run read-only. Only the `release` and # `deploy-pages` jobs get write permissions, and they run on pushes to main diff --git a/libs/extractor/src/native/element.rs b/libs/extractor/src/native/element.rs index 5f2937993..b38bf526c 100644 --- a/libs/extractor/src/native/element.rs +++ b/libs/extractor/src/native/element.rs @@ -7,7 +7,7 @@ use oxc_ast::ast::{ ExportDefaultDeclaration, Expression, Function, FunctionBody, IdentifierReference, JSXAttribute, JSXAttributeItem, JSXAttributeName, JSXAttributeValue, JSXChild, JSXElement, JSXElementName, JSXExpression, LogicalOperator, ObjectExpression, ObjectPropertyKind, Program, - TSType, UnaryOperator, VariableDeclarator, + TSType, TaggedTemplateExpression, UnaryOperator, VariableDeclarator, }; use std::cell::Cell; use std::fmt::Write; @@ -389,6 +389,14 @@ impl<'a> Visit<'a> for Elements<'_> { fn visit_ts_type(&mut self, _: &TSType<'a>) {} + fn visit_tagged_template_expression(&mut self, template: &TaggedTemplateExpression<'a>) { + if self.is_css(&template.tag) { + self.css_template(template); + } else { + walk::walk_tagged_template_expression(self, template); + } + } + fn visit_call_expression(&mut self, call: &CallExpression<'a>) { if self.is_css(&call.callee) { self.css_call(call); diff --git a/libs/extractor/src/native/element/css_call.rs b/libs/extractor/src/native/element/css_call.rs index 782789c03..7de6e8afb 100644 --- a/libs/extractor/src/native/element/css_call.rs +++ b/libs/extractor/src/native/element/css_call.rs @@ -3,14 +3,16 @@ use oxc_ast::ast::{ CallExpression, Expression, IdentifierReference, JSXAttribute, LogicalOperator, - ObjectExpression, + ObjectExpression, TaggedTemplateExpression, TemplateLiteral, }; use oxc_ast_visit::Visit; use oxc_span::{GetSpan, Span}; +use std::fmt::Write; -use super::{Elements, Styles, attribute_expression}; +use super::{Elements, Prop, Styles, attribute_expression, classify}; use crate::native::errors::Problem; use crate::native::style::{Choice, combined, style_code}; +use crate::native::values::Literal; /// The name `css()` errors call the call by const CSS: &str = "css()"; @@ -52,6 +54,18 @@ impl<'a> Elements<'_> { .on(CSS, &name), ); } + self.css_code(call.span, choices); + } + + /// Compile `css` tagged with CSS text, such as `` css`padding: 8px;` ``, + /// to the style it describes + pub(super) fn css_template(&mut self, template: &TaggedTemplateExpression<'a>) { + let choices = self.css_text(&template.quasi, template.span.start); + self.css_code(template.span, choices); + } + + /// Put the style `choices` describe in place of the `css` at `span` + fn css_code(&mut self, span: Span, choices: Vec) { let code = style_code( choices, (Vec::new(), Vec::new()), @@ -62,13 +76,79 @@ impl<'a> Elements<'_> { || "null".to_string(), |style| { if style.reads.any() && !self.read_in_component(style.reads) { - self.error(call.span.start, outside_component_problem()); + self.error(span.start, outside_component_problem()); } style.code }, ); self.replacements - .push((call.span.start as usize, call.span.end as usize, code)); + .push((span.start as usize, span.end as usize, code)); + } + + /// The styles CSS text declares, each value written in it or given whole + /// by an interpolation + pub(super) fn css_text(&mut self, template: &TemplateLiteral<'a>, offset: u32) -> Vec { + let text = marked_text(template); + if text.contains(['{', '}']) { + self.error( + offset, + Problem::new( + "CSS text on React Native holds only declarations: React Native has no selectors, nesting or at-rules", + "write the declarations alone, and the styles of other states as props such as `_active`", + ) + .call(CSS), + ); + return Vec::new(); + } + let mut choices = Vec::new(); + for declaration in text + .split(';') + .map(str::trim) + .filter(|text| !text.is_empty()) + { + match self.css_declaration(declaration, &template.expressions) { + Ok(choice) => choices.push(choice), + Err((name, problem)) => self.error(offset, problem.on(CSS, &name)), + } + } + choices + } + + /// The styles one declaration of CSS text declares + fn css_declaration( + &self, + declaration: &str, + expressions: &[Expression<'a>], + ) -> Result { + let Some((name, value)) = declaration.split_once(':') else { + return Err(( + unmarked(declaration), + Problem::new( + "a declaration of CSS text is a property and a value", + "write it as `property: value`", + ), + )); + }; + let name = camel_case(name.trim()); + let value = value.trim().trim_end_matches("!important").trim_end(); + if classify(&name) != Prop::Declares { + return Err(( + name, + Problem::new( + "React Native has no such style", + "remove it, or write a style React Native has", + ), + )); + } + let result = match marker_index(value) { + Some(index) => self.expression_choice(&name, &expressions[index]), + None if value.contains(MARKER) => Err(Problem::new( + "the build reads an interpolation in CSS text only as a whole value", + "compute the whole value in the interpolation, such as `${`${size}px`}`", + )), + None => self.static_choice(&name, &[(0, Literal::Text(value.to_string()))]), + }; + result.map_err(|problem| (name, problem)) } /// One argument of `css()`: an object of styles, a condition choosing @@ -194,6 +274,70 @@ impl<'a> Elements<'_> { } } +/// What marks an interpolation in CSS text, around its index +const MARKER: char = char::MIN; + +/// The text of `template`, each interpolation marked by its index +fn marked_text(template: &TemplateLiteral<'_>) -> String { + let mut text = String::new(); + for (index, quasi) in template.quasis.iter().enumerate() { + text.push_str(quasi.value.raw.as_str()); + if index < template.expressions.len() { + let _ = write!(text, "{MARKER}{index}{MARKER}"); + } + } + strip_comments(&text) +} + +/// `text` without its CSS comments +fn strip_comments(text: &str) -> String { + let mut rest = text; + let mut kept = String::new(); + while let Some(start) = rest.find("/*") { + kept.push_str(&rest[..start]); + rest = rest[start + 2..] + .find("*/") + .map_or("", |end| &rest[start + 2 + end + 2..]); + } + kept.push_str(rest); + kept +} + +/// `text` as it is written, each interpolation as `${…}` +fn unmarked(text: &str) -> String { + text.split(MARKER) + .enumerate() + .map(|(at, part)| if at % 2 == 1 { "${…}" } else { part }) + .collect() +} + +/// The index of the interpolation `value` is, when it is one whole +fn marker_index(value: &str) -> Option { + value + .strip_prefix(MARKER)? + .strip_suffix(MARKER)? + .parse() + .ok() +} + +/// A CSS property name as React Native names its style: `background-color` +/// as `backgroundColor` +fn camel_case(name: &str) -> String { + let mut camel = String::with_capacity(name.len()); + let mut upper = false; + for character in name.chars() { + if character == '-' { + upper = !camel.is_empty(); + } else if upper { + camel.extend(character.to_uppercase()); + upper = false; + } else { + camel.push(character); + } + } + camel +} + /// Whether `expression` is an object of styles fn is_object(expression: &Expression<'_>) -> bool { matches!( diff --git a/libs/extractor/src/native/snapshots/extractor__native__tests__css_errors.snap b/libs/extractor/src/native/snapshots/extractor__native__tests__css_errors.snap index d9abd40c5..a9c1b400e 100644 --- a/libs/extractor/src/native/snapshots/extractor__native__tests__css_errors.snap +++ b/libs/extractor/src/native/snapshots/extractor__native__tests__css_errors.snap @@ -10,6 +10,13 @@ test.tsx:5:55: `css()` cannot use `?` on React Native: a condition in `css()` ch test.tsx:6:24: `css()` 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:6:42: `css()` cannot use `[key]` on React Native: the build reads only keys written in a block. Fix: write the key itself test.tsx:7:18: `css` can only be called on React Native: the build compiles each call into styles. Fix: call it where the styles are used -test.tsx:9:15: `` cannot use `className` on React Native: React Native has no class names. Fix: pass what `css()` gives, or write the styles as props -test.tsx:9:31: `css()` cannot use `_active` on React Native: a press style applies while an element is pressed, which `css()` cannot tell. Fix: give `_active` to the element -test.tsx:9:91: `` cannot use `className` on React Native: React Native has no class names. Fix: pass what `css()` gives, or write the styles as props +test.tsx:8:32: `css()` cannot use `className` on React Native: a block holds only style props. Fix: pass it to the element itself +test.tsx:8:57: `css()` cannot use `?` on React Native: a condition in `css()` chooses between objects of styles. Fix: write each branch as an object, or as `null` +test.tsx:9:18: `css()` cannot compile here on React Native: CSS text on React Native holds only declarations: React Native has no selectors, nesting or at-rules. Fix: write the declarations alone, and the styles of other states as props such as `_active` +test.tsx:10:18: `css()` cannot use `color` on React Native: a declaration of CSS text is a property and a value. Fix: write it as `property: value` +test.tsx:10:18: `css()` cannot use `padding ${…}px` on React Native: a declaration of CSS text is a property and a value. Fix: write it as `property: value` +test.tsx:10:18: `css()` cannot use `padding` on React Native: the build reads an interpolation in CSS text only as a whole value. Fix: compute the whole value in the interpolation, such as `${`${size}px`}` +test.tsx:10:18: `css()` cannot use `webkitMask` on React Native: React Native has no such style. Fix: remove it, or write a style React Native has +test.tsx:12:15: `` cannot use `className` on React Native: React Native has no class names. Fix: pass what `css()` gives, or write the styles as props +test.tsx:12:31: `css()` cannot use `_active` on React Native: a press style applies while an element is pressed, which `css()` cannot tell. Fix: give `_active` to the element +test.tsx:12:91: `` cannot use `className` on React Native: React Native has no class names. Fix: pass what `css()` gives, or write the styles as props diff --git a/libs/extractor/src/native/snapshots/extractor__native__tests__css_only.snap b/libs/extractor/src/native/snapshots/extractor__native__tests__css_only.snap index b6fc24c31..0aea6f564 100644 --- a/libs/extractor/src/native/snapshots/extractor__native__tests__css_only.snap +++ b/libs/extractor/src/native/snapshots/extractor__native__tests__css_only.snap @@ -7,6 +7,13 @@ import { StyleSheet } from "react-native"; const __s = StyleSheet.create({ a: { margin: 8 }, b: { padding: 4 }, - c: { padding: 8 } + c: { padding: 8 }, + d: { margin: 4 } }); export const s = [__s.a, cond ? __s.b : __s.c]; +export const t = [ + true, + on ? null : __s.b, + on && __s.d, + other.css({ p: 1 }) +]; diff --git a/libs/extractor/src/native/snapshots/extractor__native__tests__css_text.snap b/libs/extractor/src/native/snapshots/extractor__native__tests__css_text.snap new file mode 100644 index 000000000..54fe38b63 --- /dev/null +++ b/libs/extractor/src/native/snapshots/extractor__native__tests__css_text.snap @@ -0,0 +1,32 @@ +--- +source: libs/extractor/src/native/tests.rs +expression: "compile_themed(two_themes(), runtime, 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 { useThemeIndex as __useThemeIndex, defineThemes as __defineThemes } from "@devup-ui/react/native"; +__defineThemes(["light", "dark"], 1); +import { StyleSheet } from "react-native"; +const __s = StyleSheet.create({ + a: { + paddingVertical: 8, + paddingHorizontal: 16, + fontWeight: "bold" + }, + b: { backgroundColor: "#5a44ff" }, + c: { backgroundColor: "#8c7bff" } +}); +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; +}; +export function A({ size }) { + const __t = __useThemeIndex(); + const s = [ + __s.a, + [__s.b, __s.c][__t], + { borderRadius: __u(size, 4) } + ]; + return ; +} +export const t = null; diff --git a/libs/extractor/src/native/tests.rs b/libs/extractor/src/native/tests.rs index bff5ed3e8..f863b79ec 100644 --- a/libs/extractor/src/native/tests.rs +++ b/libs/extractor/src/native/tests.rs @@ -1181,7 +1181,7 @@ fn compiles_pressed(#[case] name: &str, #[case] runtime: bool, #[case] code: &st assert_snapshot!(name, compile_themed(two_themes(), runtime, code)); } -const CSS_ELEMENTS: &str = r#"import { css as style, type DevupProps } from '@devup-ui/react' +const CSS_ELEMENTS: &str = r"import { css as style, type DevupProps } from '@devup-ui/react' const card = style({ p: 4, borderRadius: '8px' }) export function Card({ on, extra, children }) { const title = style({ color: '$text', fontSize: [14, null, 18] }) @@ -1195,14 +1195,19 @@ export function Card({ on, extra, children }) { ) -}"#; +}"; #[rstest] #[case::css("css_calls", true, CSS_ELEMENTS)] #[case::css_only( "css_only", true, - "import { css } from '@devup-ui/react'\nexport const s = css({ m: 2 }, cond ? { p: 1 } : { p: 2 })" + "import { css } from '@devup-ui/react'\nexport const s = css({ m: 2 }, cond ? { p: 1 } : { p: 2 })\nexport const t = css(true, on ? undefined : { p: 1 }, on ? { m: 1 } : false, (other.css({ p: 1 })))" +)] +#[case::text( + "css_text", + true, + "import { css } from '@devup-ui/react'\nexport function A({ size }) {\n const s = css`\n /* the card */\n background-color: $primary;\n padding: 8px 16px !important;\n border-radius: ${size};\n font-weight: ${'bold'};\n /* unterminated`\n return \n}\nexport const t = css``" )] #[case::runtime_off( "css_runtime_off", @@ -1218,6 +1223,9 @@ export const b = css(...parts) export const c = css('flex', `p-2`, cond ? { p: 1 } : 2) export const d = css({ _hover: { p: 1 }, [key]: 1 }) export const f = css +export const g = css({ _ios: { className: 'a' } }, on ? 1 : { p: 1 }) +export const h = css`&:hover { color: red }` +export const i = css`padding ${x}px; padding: ${x}px; -webkit-mask: red; color` export function E() { return }"# diff --git a/packages/metro-plugin/README.md b/packages/metro-plugin/README.md index 728b1c8f2..e1d4638bc 100644 --- a/packages/metro-plugin/README.md +++ b/packages/metro-plugin/README.md @@ -158,15 +158,53 @@ with a press style becomes one, so it takes `onPress` and the other props of runtime. It is a build error on a `Text`, an `Image` or an `Input`, and with `as`. +## `css()` and `className` + +`css()` compiles to the style it describes, the value React Native's `style` +takes, and `className` on a Devup UI element passes it on: + +```tsx +const button = css({ borderRadius: '8px', px: 5 }) + +function Save() { + const label = css({ color: '$text', fontSize: [14, null, 18] }) + return ( + + ) +} +``` + +`css()` takes what it does on the web: objects of style props (with +responsive values, theme tokens and the theme, platform and orientation +blocks), conditions choosing between them, what another `css()` gives, and +CSS text (`` css`padding: 8px; background-color: $primary;` ``, each +interpolation a whole value). The element's style props apply after its +`className`, and its `style` prop last. + +A `css()` whose styles differ by theme, breakpoint or orientation reads the +runtime, so it must be called in a function component or a hook. One that does +not can be called anywhere, such as at the top of the file. These are build +errors: + +- a class name (`className="p-4"`, `css('p-4')`) +- a press style in `css()`: give `_active` to the element itself +- selectors, nesting and at-rules in CSS text + +`css()` gives a style rather than a class on React Native, so pass it to +`className`, not to the `style` of a React Native component, which TypeScript +types as a string. + ## Limits of this version Only styles the build can decide are supported: literals, values read at runtime, theme tokens, responsive values, conditions between them and the -platform, theme and orientation blocks. These are build errors, reported by -Metro at the file, line and column: +platform, theme, orientation and press blocks, and `css()`. These are build +errors, reported by Metro at the file, line and column: - interaction states other than `_active`/`_pressed` (`_hover`, `_focus`, ...) -- `css()`, `styled()`, `globalCss()`, `keyframes()` and `Grid` +- `styled()`, `globalCss()`, `keyframes()` and `Grid` - any prop React Native has no style for - with `runtime: false`, a value that differs by theme or breakpoint, `_theme*` with more than one theme, `_portrait`, `_landscape`, and From 4f8a95ad4edc7b9a191591e931e91509c64e5fd2 Mon Sep 17 00:00:00 2001 From: owjs3901 Date: Sat, 21 Nov 2026 12:05:15 +0900 Subject: [PATCH 18/40] test(native): pass classes to style_code in the merged test Co-Authored-By: Claude Opus 5.5 --- libs/extractor/src/native/tests.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/extractor/src/native/tests.rs b/libs/extractor/src/native/tests.rs index 1427470bd..766f40f9f 100644 --- a/libs/extractor/src/native/tests.rs +++ b/libs/extractor/src/native/tests.rs @@ -1270,7 +1270,7 @@ fn a_static_style_after_one_kept_in_order_checks_it() { Choice::Dynamic(vec![("width".to_string(), "w".to_string())]), Choice::Static(declarations(&[("padding", 1.0)])), ], - vec![], + (vec![], vec![]), &mut sheet, &VARS, ) From fb7882a62e9dff0a8ac6fa3db59b9dd8e04a09ab Mon Sep 17 00:00:00 2001 From: owjs3901 Date: Sat, 21 Nov 2026 12:22:26 +0900 Subject: [PATCH 19/40] test(native): cover css() parts around state blocks and empty objects Co-Authored-By: Claude Opus 5.5 --- libs/extractor/src/native/element/css_call.rs | 12 ++---------- .../extractor__native__tests__css_only.snap | 19 ++++++++++++++++++- libs/extractor/src/native/tests.rs | 3 ++- 3 files changed, 22 insertions(+), 12 deletions(-) diff --git a/libs/extractor/src/native/element/css_call.rs b/libs/extractor/src/native/element/css_call.rs index 7de6e8afb..b0ff3cdbd 100644 --- a/libs/extractor/src/native/element/css_call.rs +++ b/libs/extractor/src/native/element/css_call.rs @@ -244,16 +244,8 @@ impl<'a> Elements<'_> { let mark = self.replacements.len(); self.visit_expression(expression); let (start, end) = (span.start as usize, span.end as usize); - let mut inner = Vec::new(); - let mut index = mark; - while index < self.replacements.len() { - let (from, to, _) = self.replacements[index]; - if start <= from && to <= end { - inner.push(self.replacements.remove(index)); - } else { - index += 1; - } - } + // What visiting the expression changes lies in it + let mut inner = self.replacements.split_off(mark); inner.sort_by_key(|(from, to, _)| (*from, *to)); let mut code = String::new(); let mut at = start; diff --git a/libs/extractor/src/native/snapshots/extractor__native__tests__css_only.snap b/libs/extractor/src/native/snapshots/extractor__native__tests__css_only.snap index 0aea6f564..99100733a 100644 --- a/libs/extractor/src/native/snapshots/extractor__native__tests__css_only.snap +++ b/libs/extractor/src/native/snapshots/extractor__native__tests__css_only.snap @@ -3,12 +3,14 @@ source: libs/extractor/src/native/tests.rs expression: "compile_themed(two_themes(), runtime, 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 { useLandscape as __useLandscape } from "@devup-ui/react/native"; import { StyleSheet } from "react-native"; const __s = StyleSheet.create({ a: { margin: 8 }, b: { padding: 4 }, c: { padding: 8 }, - d: { margin: 4 } + d: { margin: 4 }, + e: { padding: 12 } }); export const s = [__s.a, cond ? __s.b : __s.c]; export const t = [ @@ -17,3 +19,18 @@ export const t = [ on && __s.d, other.css({ p: 1 }) ]; +export const useU = () => { + const __l = __useLandscape(); + return [ + t, + __s.b, + __l && __s.d, + __s.a, + on ? null : [__s.c, __l && __s.e], + other`x` + ]; +}; +export const useV = () => { + const __l = __useLandscape(); + return [__s.c, __l && __s.d]; +}; diff --git a/libs/extractor/src/native/tests.rs b/libs/extractor/src/native/tests.rs index 766f40f9f..2e90e2681 100644 --- a/libs/extractor/src/native/tests.rs +++ b/libs/extractor/src/native/tests.rs @@ -1202,7 +1202,8 @@ export function Card({ on, extra, children }) { #[case::css_only( "css_only", true, - "import { css } from '@devup-ui/react'\nexport const s = css({ m: 2 }, cond ? { p: 1 } : { p: 2 })\nexport const t = css(true, on ? undefined : { p: 1 }, on ? { m: 1 } : false, (other.css({ p: 1 })))" + "import { css } from '@devup-ui/react'\nexport const s = css({ m: 2 }, cond ? { p: 1 } : { p: 2 })\nexport const t = css(true, on ? undefined : { p: 1 }, on ? { m: 1 } : false, (other.css({ p: 1 })))\nexport const useU = () => css(t, { p: 1 }, { _landscape: { m: 1 } }, { m: 2 }, on ? {} : { p: 2, _landscape: { p: 3 } }, other`x`) +export const useV = () => css({ _landscape: { m: 1 } }, { p: 2 })" )] #[case::text( "css_text", From 7d52b64bbe893bae1d5bbfbbd494473c619e27b5 Mon Sep 17 00:00:00 2001 From: owjs3901 Date: Sat, 21 Nov 2026 12:30:43 +0900 Subject: [PATCH 20/40] test(native): cover a static style checked against a state block Co-Authored-By: Claude Opus 5.5 --- libs/extractor/src/native/tests.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/libs/extractor/src/native/tests.rs b/libs/extractor/src/native/tests.rs index d65cf36d7..57ae043ab 100644 --- a/libs/extractor/src/native/tests.rs +++ b/libs/extractor/src/native/tests.rs @@ -1193,6 +1193,11 @@ fn a_static_style_after_one_kept_in_order_checks_it() { Choice::Static(declarations(&[("margin", 2.0)])), Choice::Dynamic(vec![("width".to_string(), "w".to_string())]), Choice::Static(declarations(&[("padding", 1.0)])), + when( + State::Pressed, + Choice::Static(declarations(&[("height", 1.0)])), + ), + Choice::Static(declarations(&[("top", 1.0)])), ], vec![], &mut sheet, @@ -1201,6 +1206,6 @@ fn a_static_style_after_one_kept_in_order_checks_it() { .map(|style| style.code); assert_eq!( code.as_deref(), - Some("[s.a, { margin: m }, s.b, { width: w }]") + Some("[s.a, { margin: m }, s.b, { width: w }, p && s.c]") ); } From 044555e057b6a604bc0d1ecf1ddee86a37f27f64 Mon Sep 17 00:00:00 2001 From: owjs3901 Date: Sat, 21 Nov 2026 12:58:34 +0900 Subject: [PATCH 21/40] feat(native): styled() on React Native `styled(Target)(...parts)`, `` styled(Target)`css text` `` and `styled(Target, styles)` compile to a function component rendering its target with the styles they describe, before the `style` it is given. The parts are those of `css()`; a function in them is called with the props, as a value or as a part giving what `css()` gives. A Devup UI target keeps the styles it declares first, a styled `Box` with a press style becomes a `Pressable`, and the hooks the styles read are called in the component. Co-Authored-By: Claude Opus 5.5 --- .../changepack_log_react_native_styled.json | 8 + .github/workflows/publish.yml | 1 + apps/expo/src/Badge.tsx | 28 +- libs/extractor/src/native/element.rs | 46 +++- libs/extractor/src/native/element/css_call.rs | 18 +- libs/extractor/src/native/element/styled.rs | 242 ++++++++++++++++++ libs/extractor/src/native/imports.rs | 15 +- .../extractor__native__tests__apis.snap | 3 +- ...tor__native__tests__styled_components.snap | 76 ++++++ ...tractor__native__tests__styled_errors.snap | 13 + libs/extractor/src/native/tests.rs | 34 +++ packages/metro-plugin/README.md | 42 ++- 12 files changed, 490 insertions(+), 36 deletions(-) create mode 100644 .changepacks/changepack_log_react_native_styled.json create mode 100644 libs/extractor/src/native/element/styled.rs create mode 100644 libs/extractor/src/native/snapshots/extractor__native__tests__styled_components.snap create mode 100644 libs/extractor/src/native/snapshots/extractor__native__tests__styled_errors.snap diff --git a/.changepacks/changepack_log_react_native_styled.json b/.changepacks/changepack_log_react_native_styled.json new file mode 100644 index 000000000..f07bf4032 --- /dev/null +++ b/.changepacks/changepack_log_react_native_styled.json @@ -0,0 +1,8 @@ +{ + "changes": { + "bindings/devup-ui-binding/package.json": "Patch", + "bindings/devup-ui-wasm/package.json": "Patch" + }, + "note": "`codeExtractNative` compiles `styled()` for React Native (part of #411): `styled(Target)(...parts)`, `` styled(Target)`css text` `` and `styled(Target, styles)` compile to a function component rendering its target with the styles it describes, before the `style` it is given. It takes the parts `css()` takes; a function in them is called with the component's props, as a value or as a part giving what `css()` gives. A Devup UI target keeps the styles it declares first, and a styled `Box` with a press style becomes a `Pressable`. The hooks its styles read are called in the component. Web output is unchanged.", + "date": "2026-11-21T00:00:00.000Z" +} diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index e1017f857..af9dc3598 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -12,6 +12,7 @@ on: - feat/react-native-themes - feat/react-native-responsive - feat/react-native-pressed + - feat/react-native-css # Pull requests and every job below run read-only. Only the `release` and # `deploy-pages` jobs get write permissions, and they run on pushes to main diff --git a/apps/expo/src/Badge.tsx b/apps/expo/src/Badge.tsx index abc21d682..c53b56085 100644 --- a/apps/expo/src/Badge.tsx +++ b/apps/expo/src/Badge.tsx @@ -1,18 +1,16 @@ -import { Text } from '@devup-ui/react' +import { styled, Text } from '@devup-ui/react' + +/** Styled the same in every theme, so it compiles without the runtime */ +const Pill = styled(Text)({ + bg: '#5a44ff', + borderRadius: '999px', + color: '#fff', + fontSize: '12px', + fontWeight: '600', + px: 2, + py: 1, +}) -/** Styles the same in every theme, so it compiles without the runtime */ export function Badge({ label }: { label: string }) { - return ( - - {label} - - ) + return {label} } diff --git a/libs/extractor/src/native/element.rs b/libs/extractor/src/native/element.rs index b38bf526c..f034f8828 100644 --- a/libs/extractor/src/native/element.rs +++ b/libs/extractor/src/native/element.rs @@ -31,6 +31,9 @@ use crate::component::ExportVariableKind; use crate::fresh_name::fresh_name; mod css_call; +mod styled; + +use styled::is_function; /// The changes compiling a file makes, or why it cannot compile pub(super) struct Compiled { @@ -177,6 +180,9 @@ pub(super) fn compile( scoping, components: &imports.components, css: &imports.css, + styled: &imports.styled, + props: fresh_name("__props", code), + in_styled: false, sheet: Sheet::new(fresh_name("__s", code)), units: fresh_name("__u", code), units_used: Cell::new(false), @@ -190,7 +196,7 @@ pub(super) fn compile( replacements: imports.replacements, errors: imports.errors, }; - if !visitor.components.is_empty() || !visitor.css.is_empty() { + if !visitor.components.is_empty() || !visitor.css.is_empty() || !visitor.styled.is_empty() { visitor.visit_program(program); } let Elements { @@ -314,6 +320,13 @@ struct Elements<'s> { components: &'s FxHashMap, /// The bindings of `css` css: &'s FxHashSet, + /// The bindings of `styled` + styled: &'s FxHashSet, + /// The parameter holding the props of a component `styled()` gives + props: String, + /// Whether the styles of a `styled()` component are being read, where a + /// function is called with its props + in_styled: bool, sheet: Sheet, /// The name of the function converting values read at runtime units: String, @@ -376,7 +389,7 @@ impl<'a> Visit<'a> for Elements<'_> { "`{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" ), )); - } else if self.is_css_reference(identifier) { + } else if self.is_css_reference(identifier) || self.is_styled_reference(identifier) { self.errors.push(( identifier.span.start, format!( @@ -392,6 +405,8 @@ impl<'a> Visit<'a> for Elements<'_> { fn visit_tagged_template_expression(&mut self, template: &TaggedTemplateExpression<'a>) { if self.is_css(&template.tag) { self.css_template(template); + } else if let Some(target) = self.styled_target(&template.tag) { + self.styled_template(template, target); } else { walk::walk_tagged_template_expression(self, template); } @@ -400,6 +415,10 @@ impl<'a> Visit<'a> for Elements<'_> { fn visit_call_expression(&mut self, call: &CallExpression<'a>) { if self.is_css(&call.callee) { self.css_call(call); + } else if let Some(target) = self.styled_target(&call.callee) { + self.styled_call(call, target); + } else if self.is_styled(&call.callee) { + self.styled_direct(call); } else { walk::walk_call_expression(self, call); } @@ -549,13 +568,7 @@ impl<'a> Elements<'_> { /// Call the hooks reading what `reads` names at `at` fn call_hooks(&mut self, at: HookAt, reads: Reads) { - self.runtime.hooks_used = self.runtime.hooks_used.union(reads); - let calls: Vec = self - .runtime - .variables(reads) - .map(|(hook, variable)| format!("const {variable} = {}();", self.runtime.hooks[hook])) - .collect(); - let call = calls.join(" "); + let call = self.hook_calls(reads); match at { HookAt::Body(at) => self.replacements.push((at, at, format!("\n{call}"))), HookAt::Expression(start, end) => { @@ -566,6 +579,17 @@ impl<'a> Elements<'_> { } } + /// The statements calling the hooks reading what `reads` names + fn hook_calls(&mut self, reads: Reads) -> String { + self.runtime.hooks_used = self.runtime.hooks_used.union(reads); + let calls: Vec = self + .runtime + .variables(reads) + .map(|(hook, variable)| format!("const {variable} = {}();", self.runtime.hooks[hook])) + .collect(); + calls.join(" ") + } + /// Whether the element being compiled is in a function component or a /// hook, which then calls the hooks reading what `reads` names first fn read_in_component(&mut self, reads: Reads) -> bool { @@ -1128,6 +1152,10 @@ impl<'a> Elements<'_> { /// The code of `expression` fn source(&self, expression: &Expression<'_>) -> String { let code = expression.span().source_text(self.code); + if self.in_styled && is_function(expression) { + // A function in the styles of a `styled()` component takes its props + return format!("({code})({})", self.props); + } if matches!( expression.without_parentheses(), Expression::SequenceExpression(_) diff --git a/libs/extractor/src/native/element/css_call.rs b/libs/extractor/src/native/element/css_call.rs index b0ff3cdbd..7fc573276 100644 --- a/libs/extractor/src/native/element/css_call.rs +++ b/libs/extractor/src/native/element/css_call.rs @@ -9,6 +9,7 @@ use oxc_ast_visit::Visit; use oxc_span::{GetSpan, Span}; use std::fmt::Write; +use super::styled::{gives_style_props, is_function}; use super::{Elements, Prop, Styles, attribute_expression, classify}; use crate::native::errors::Problem; use crate::native::style::{Choice, combined, style_code}; @@ -154,7 +155,7 @@ impl<'a> Elements<'_> { /// One argument of `css()`: an object of styles, a condition choosing /// objects, or a style it passes on whole, such as what another `css()` /// gives - fn css_part(&mut self, expression: &Expression<'a>, choices: &mut Vec) { + pub(super) fn css_part(&mut self, expression: &Expression<'a>, choices: &mut Vec) { match expression.without_parentheses() { Expression::ObjectExpression(object) => { let object_choices = self.object_choices(object, CSS); @@ -185,6 +186,21 @@ impl<'a> Elements<'_> { self.error(expression.span().start, class_problem(CSS, "a part")); } expression if is_nothing(expression) => {} + expression if self.in_styled && is_function(expression) => { + if gives_style_props(expression) { + self.error( + expression.span().start, + Problem::new( + "a function of the props gives style props, which React Native cannot read at runtime", + "return what `css()` gives, or write each value as a function of the props", + ) + .call("styled()"), + ); + return; + } + let code = format!("({})({})", self.rewritten(expression), self.props); + choices.push(Choice::Given(code)); + } expression => { let code = self.rewritten(expression); choices.push(Choice::Given(code)); diff --git a/libs/extractor/src/native/element/styled.rs b/libs/extractor/src/native/element/styled.rs new file mode 100644 index 000000000..3f49a70d1 --- /dev/null +++ b/libs/extractor/src/native/element/styled.rs @@ -0,0 +1,242 @@ +//! `styled()` on React Native: a call compiles to a function component that +//! renders its target with the styles it describes, before the `style` it is +//! given. + +use oxc_ast::ast::{CallExpression, Expression, IdentifierReference, TaggedTemplateExpression}; +use oxc_span::{GetSpan, Span}; + +use super::{Elements, Frame, HookAt, component_name, defaults}; +use crate::component::ExportVariableKind; +use crate::native::errors::Problem; +use crate::native::style::{Choice, Reads, style_code}; + +/// The name `styled()` errors call the call by +const STYLED: &str = "styled()"; + +/// What a `styled()` component renders +pub(super) enum Target { + /// A Devup UI component, which renders its React Native component with + /// the styles it declares first + Devup(ExportVariableKind, String), + /// Any other component, by its code + Other(String), +} + +impl<'a> Elements<'_> { + /// Whether `callee` reads the `styled` the file imports + pub(super) fn is_styled(&self, callee: &Expression<'_>) -> bool { + match callee.without_parentheses() { + Expression::Identifier(identifier) => self.is_styled_reference(identifier), + _ => false, + } + } + + /// Whether `identifier` reads the `styled` the file imports + pub(super) fn is_styled_reference(&self, identifier: &IdentifierReference<'_>) -> bool { + identifier + .reference_id + .get() + .and_then(|reference| self.scoping.get_reference(reference).symbol_id()) + .is_some_and(|symbol| self.styled.contains(&symbol)) + } + + /// The target of `callee` when it is `styled(Target)`, whose call or + /// tagged template gives the styles + pub(super) fn styled_target(&mut self, callee: &Expression<'a>) -> Option { + let Expression::CallExpression(call) = callee.without_parentheses() else { + return None; + }; + if !self.is_styled(&call.callee) || call.arguments.len() != 1 { + return None; + } + let target = call.arguments[0].as_expression()?; + Some(self.target(target)) + } + + /// The target `expression` names + fn target(&mut self, expression: &Expression<'a>) -> Target { + if let Expression::Identifier(identifier) = expression.without_parentheses() + && let Some((kind, local)) = self.binding(identifier) + { + return Target::Devup(kind, local); + } + let code = expression.span().source_text(self.code).to_string(); + if !component_name(expression.without_parentheses()) { + self.error( + expression.span().start, + Problem::new( + "a `styled()` component on React Native renders a component, not a tag", + "pass a Devup UI or React Native component, such as `styled(View)`", + ) + .call(STYLED), + ); + } + Target::Other(code) + } + + /// `styled(Target)(...styles)` + pub(super) fn styled_call(&mut self, call: &CallExpression<'a>, target: Target) { + let arguments: Vec<&Expression<'a>> = call + .arguments + .iter() + .filter_map(|argument| argument.as_expression()) + .collect(); + if arguments.len() < call.arguments.len() { + self.error( + call.span.start, + Problem::new( + "the build reads only the styles written in the call", + "pass each part to `styled()` itself", + ) + .call(STYLED), + ); + } + self.styled_component(call.span, target, |visitor, choices| { + for argument in arguments { + visitor.css_part(argument, choices); + } + }); + } + + /// `` styled(Target)`css text` `` + pub(super) fn styled_template( + &mut self, + template: &TaggedTemplateExpression<'a>, + target: Target, + ) { + self.styled_component(template.span, target, |visitor, choices| { + let text = visitor.css_text(&template.quasi, template.span.start); + choices.extend(text); + }); + } + + /// `styled(Target, styles)`, or `styled(Target)` alone, which gives no + /// component until it is called with styles + pub(super) fn styled_direct(&mut self, call: &CallExpression<'a>) { + let parts = match call.arguments.as_slice() { + [target, styles] => target.as_expression().zip(styles.as_expression()), + _ => None, + }; + let Some((target, styles)) = parts else { + self.error( + call.span.start, + Problem::new( + "the build compiles `styled()` called with a component and its styles", + "write `styled(Target)({ ... })`, `` styled(Target)`...` `` or `styled(Target, { ... })`", + ) + .call(STYLED), + ); + return; + }; + let target = self.target(target); + self.styled_component(call.span, target, |visitor, choices| { + visitor.css_part(styles, choices); + }); + } + + /// Put the component rendering `target` with the styles `read` reads in + /// place of the `styled()` at `span` + fn styled_component( + &mut self, + span: Span, + target: Target, + read: impl FnOnce(&mut Self, &mut Vec), + ) { + let (tag, mut choices) = match &target { + Target::Devup(kind, local) => (local.clone(), defaults(kind)), + Target::Other(code) => (code.clone(), Vec::new()), + }; + // The component calls the hooks its styles read, as a function + // component does + self.frames.push(Frame { + component: true, + reads: Reads::default(), + hook_at: HookAt::Body(span.start as usize), + }); + let outer = std::mem::replace(&mut self.in_styled, true); + read(self, &mut choices); + self.in_styled = outer; + let frame_reads = self + .frames + .pop() + .map_or_else(Reads::default, |frame| frame.reads); + let tag = match (self.press.take(), &target) { + (Some(press), Target::Devup(kind, _)) => { + self.pressable(press, kind, "styled()", None).unwrap_or(tag) + } + (Some((offset, name)), Target::Other(_)) => { + self.error( + offset, + Problem::new( + "a press style needs React Native's `Pressable`, which the build knows only a Devup UI component renders", + "style a `Box` or a `Button`, or pass a function reading `pressed` to the `style` of a `Pressable`", + ) + .on(STYLED, &name), + ); + tag + } + (None, _) => tag, + }; + let pressed = choices.iter().any(Choice::pressed); + let props = self.props.clone(); + let given = format!("{props}.style"); + let style = style_code( + choices, + (Vec::new(), vec![given]), + &mut self.sheet, + &self.runtime.vars(), + ); + let reads = style + .as_ref() + .map_or_else(Reads::default, |style| style.reads) + .union(frame_reads); + let hooks = if reads.any() { + format!("{} ", self.hook_calls(reads)) + } else { + String::new() + }; + let style = style.map_or_else(String::new, |style| { + let code = if pressed { + format!( + "({{ pressed: {} }}) => {}", + self.runtime.pressed, style.code + ) + } else { + style.code + }; + format!(" style={{{code}}}") + }); + let code = format!("({props}) => {{ {hooks}return <{tag} {{...{props}}}{style} />; }}"); + self.replacements + .push((span.start as usize, span.end as usize, code)); + } +} + +/// Whether `expression` is a function, which a `styled()` component calls +/// with its props +pub(super) fn is_function(expression: &Expression<'_>) -> bool { + matches!( + expression.without_parentheses(), + Expression::ArrowFunctionExpression(_) | Expression::FunctionExpression(_) + ) +} + +/// Whether the function `expression` gives an object of style props, which +/// React Native cannot read: an object, or a condition choosing one +pub(super) fn gives_style_props(expression: &Expression<'_>) -> bool { + let Expression::ArrowFunctionExpression(arrow) = expression.without_parentheses() else { + return false; + }; + arrow.get_expression().is_some_and(holds_object) +} + +fn holds_object(expression: &Expression<'_>) -> bool { + match expression.without_parentheses() { + Expression::ObjectExpression(_) => true, + Expression::ConditionalExpression(condition) => { + holds_object(&condition.consequent) || holds_object(&condition.alternate) + } + Expression::LogicalExpression(logical) => holds_object(&logical.right), + _ => false, + } +} diff --git a/libs/extractor/src/native/imports.rs b/libs/extractor/src/native/imports.rs index cae451be3..4e4cf2c19 100644 --- a/libs/extractor/src/native/imports.rs +++ b/libs/extractor/src/native/imports.rs @@ -23,6 +23,8 @@ pub(super) struct Imports { pub components: FxHashMap, /// The bindings of `css`, whose calls compile to style objects pub css: FxHashSet, + /// The bindings of `styled`, whose calls compile to components + pub styled: FxHashSet, pub replacements: Vec, pub errors: Vec<(u32, String)>, /// Whether the file imports the theme API of the runtime @@ -73,10 +75,6 @@ fn unsupported(name: &str, target: &NativeTarget) -> Option { "React Native has no grid layout", "lay the items out with `Flex` and `flexWrap`", )), - "styled" => Some(Problem::new( - "`styled` is not compiled for React Native yet", - "write the styles as props of a Devup UI component", - )), name if is_theme_api(name) => (!target.runtime).then(|| theme_api(name)), "ThemeScript" | "initTheme" | "globalCss" => Some(Problem::new( "React Native has no document and no global stylesheet", @@ -188,8 +186,13 @@ impl Imports { return Destination::Kept; } let local = specifier.local.name.to_string(); - if name == "css" { - self.css.extend(specifier.local.symbol_id.get()); + if name == "css" || name == "styled" { + let bindings = if name == "css" { + &mut self.css + } else { + &mut self.styled + }; + bindings.extend(specifier.local.symbol_id.get()); return Destination::Dropped; } if is_theme_api(&name) { diff --git a/libs/extractor/src/native/snapshots/extractor__native__tests__apis.snap b/libs/extractor/src/native/snapshots/extractor__native__tests__apis.snap index ef9f8356a..76b3f8ba3 100644 --- a/libs/extractor/src/native/snapshots/extractor__native__tests__apis.snap +++ b/libs/extractor/src/native/snapshots/extractor__native__tests__apis.snap @@ -2,8 +2,7 @@ source: libs/extractor/src/native/tests.rs expression: "compile_for(NativePlatform::Ios, false, code)" --- -error: 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 +error: 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 diff --git a/libs/extractor/src/native/snapshots/extractor__native__tests__styled_components.snap b/libs/extractor/src/native/snapshots/extractor__native__tests__styled_components.snap new file mode 100644 index 000000000..1d44afee8 --- /dev/null +++ b/libs/extractor/src/native/snapshots/extractor__native__tests__styled_components.snap @@ -0,0 +1,76 @@ +--- +source: libs/extractor/src/native/tests.rs +expression: "compile_themed(two_themes(), 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 { View, Animated } from "react-native"; +import { useThemeIndex as __useThemeIndex, useBreakpoint as __useBreakpoint, defineThemes as __defineThemes } from "@devup-ui/react/native"; +__defineThemes(["light", "dark"], 1); +import { Pressable as __Pressable } from "react-native"; +import { StyleSheet } from "react-native"; +const __s = StyleSheet.create({ + a: { borderRadius: 8 }, + b: { backgroundColor: "#fff" }, + c: { backgroundColor: "#1a1a2e" }, + d: { padding: 8 }, + e: { padding: 16 }, + f: { + flexDirection: "row", + gap: 8 + }, + g: { fontSize: 18 }, + h: { opacity: .5 }, + i: { margin: 4 }, + j: { opacity: .6 }, + k: { backgroundColor: "black" } +}); +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; +}; +export const Card = (__props) => { + const __t = __useThemeIndex(); + const __b = __useBreakpoint(); + return ; +}; +export const Row = (__props) => { + return ; +}; +export const Title = (__props) => { + return props.color)(__props) }, + __props.style + ]} />; +}; +export const Item = (__props) => { + return props.active && __s.h)(__props), + { width: __u(((p) => p.width)(__props), 4) }, + __props.style + ]} />; +}; +export const Tap = (__props) => { + const __t = __useThemeIndex(); + return <__Pressable {...__props} style={({ pressed: __p }) => [ + __p && __s.j, + [null, __s.k][__t], + __props.style + ]} />; +}; +export const Plain = (__props) => { + return + ) +} +``` + +`css()` takes what it does on the web: objects of style props (with +responsive values, theme tokens and the theme, platform and orientation +blocks), conditions choosing between them, what another `css()` gives, and +CSS text (`` css`padding: 8px; background-color: $primary;` ``, each +interpolation a whole value). The element's style props apply after its +`className`, and its `style` prop last. + +A `css()` whose styles differ by theme, breakpoint or orientation reads the +runtime, so it must be called in a function component or a hook. One that does +not can be called anywhere, such as at the top of the file. These are build +errors: + +- a class name (`className="p-4"`, `css('p-4')`) +- a press style in `css()`: give `_active` to the element itself +- selectors, nesting and at-rules in CSS text + +`css()` gives a style rather than a class on React Native, so pass it to +`className`, not to the `style` of a React Native component, which TypeScript +types as a string. + +## `styled()` + +`styled()` compiles to a function component that renders its target with the +styles it describes, before the `style` the component is given: + +```tsx +const Card = styled(Box)({ bg: '$surface', p: [2, null, 4] }) +const Title = styled(Text)` + color: ${(props) => props.color}; + font-size: 18px; +` +// compiles to +const Card = (props) => { + const t = useThemeIndex(), b = useBreakpoint() + return +} +``` + +It takes the parts `css()` takes, as `styled(Target)(...parts)`, +`` styled(Target)`css text` `` or `styled(Target, styles)`. A function in +them is called with the component's props: a value (`w: (p) => p.width`, or +an interpolation in CSS text), or a part giving what `css()` gives +(`(p) => p.active && css({ opacity: 0.5 })`). The target is a Devup UI +component, which keeps the styles it declares first (`Flex` its row), or any +React Native component. A press style makes a styled `Box` a `Pressable`. +These are build errors: + +- a tag (`styled('div')`, `styled.div`) +- a function of the props giving style props (`(p) => ({ bg: p.color })`): + return what `css()` gives instead +- a press style on a component other than a `Box` or a `Button` + +The component reads style props only through `styled()`: on React Native, +`` passes `p` on to the target, so give it `style` or +`className` instead. + + tokens work too. +- A function of the props is called with `props.theme`, the theme of the + nearest `ThemeProvider`. A function giving an object gives React Native + styles as they are. +- `ThemeProvider`, `useTheme` and `withTheme` are the runtime's: a React + context, whose theme a provider merges over the outer one's. With + `runtime: false` they are build errors. +- Any other import stays on the package. + ## Limits of this version Only styles the build can decide are supported: literals, values read at diff --git a/packages/react/src/native/__tests__/index.browser.test.tsx b/packages/react/src/native/__tests__/index.browser.test.tsx index cb37e535c..326169105 100644 --- a/packages/react/src/native/__tests__/index.browser.test.tsx +++ b/packages/react/src/native/__tests__/index.browser.test.tsx @@ -2,6 +2,8 @@ import { beforeEach, describe, expect, it, mock } from 'bun:test' import { act, render, renderHook } from 'bun-test-env-dom' import { createElement, type ReactNode } from 'react' +import type { StyledTheme } from '../../types/props' + /** The system appearance React Native reports, and who listens to it */ const appearance = { scheme: 'light' as string | null, @@ -287,3 +289,51 @@ describe('Focused', () => { expect(input()?.getAttribute('data-color')).toBe('false') }) }) + +describe('ThemeProvider, useStyledTheme and withTheme', () => { + it('give the theme merged over the outer one, or what a function makes of it', () => { + const seen: StyledTheme[] = [] + const Probe = () => { + seen.push(runtime.useStyledTheme()) + return null + } + render(createElement(Probe)) + render( + createElement( + runtime.ThemeProvider, + { theme: { a: 1, b: 1 } }, + createElement( + runtime.ThemeProvider, + { theme: { b: 2 } }, + createElement(Probe), + ), + createElement( + runtime.ThemeProvider, + { + theme: (outer: StyledTheme | undefined) => ({ ...outer, c: 3 }), + }, + createElement(Probe), + ), + ), + ) + expect(seen).toEqual([{}, { a: 1, b: 2 }, { a: 1, b: 1, c: 3 }]) + }) + + it('gives a component the theme as its prop unless it is given one', () => { + const Named = ({ theme }: { theme?: { name?: string } }) => + createElement('span', null, theme?.name) + const ThemedNamed = runtime.withTheme(Named) + expect(ThemedNamed.displayName).toBe('WithTheme(Named)') + const { container } = render( + createElement( + runtime.ThemeProvider, + { theme: { name: 'ctx' } }, + createElement(ThemedNamed), + createElement(ThemedNamed, { theme: { name: 'own' } }), + ), + ) + expect( + [...container.querySelectorAll('span')].map((span) => span.textContent), + ).toEqual(['ctx', 'own']) + }) +}) diff --git a/packages/react/src/native/index.ts b/packages/react/src/native/index.ts index c9bc252d0..15f14c045 100644 --- a/packages/react/src/native/index.ts +++ b/packages/react/src/native/index.ts @@ -2,12 +2,17 @@ import { createElement, type ElementType, type ReactElement, + type ReactNode, + useContext, + useMemo, useState, useSyncExternalStore, } from 'react' import { Appearance, Dimensions } from 'react-native' +import type { StyledTheme } from '../types/props' import type { DevupTheme } from '../types/theme' +import { StyledThemeContext } from '../utils/theme-context' /** * The React Native runtime of Devup UI. The build compiles every style to @@ -214,3 +219,36 @@ export function Focused({ style: $s(focused, useThemeIndex(), useBreakpoint(), useLandscape()), }) } + +export { withTheme } from '../utils/with-theme' + +/** + * The `ThemeProvider` of styled-components and Emotion, which the build + * imports for theirs: it gives its descendants `theme`, merged over the + * theme of an outer provider, or what a function of that theme returns. The + * `styled()` components of those packages call their functions with it as + * `props.theme`, and `withTheme` gives it as the `theme` prop. + */ +export function ThemeProvider({ + theme, + children, +}: { + theme: StyledTheme | ((outer: StyledTheme | undefined) => StyledTheme) + children?: ReactNode +}): ReactElement { + const outer = useContext(StyledThemeContext) + const value = useMemo( + () => (typeof theme === 'function' ? theme(outer) : { ...outer, ...theme }), + [outer, theme], + ) + return createElement(StyledThemeContext.Provider, { value }, children) +} + +/** + * The theme of the nearest `ThemeProvider`, or an empty object outside one: + * the `useTheme` of styled-components and Emotion, which the build imports + * for theirs + */ +export function useStyledTheme(): StyledTheme { + return useContext(StyledThemeContext) ?? {} +} From 4f9b42a66c8042313a3f481e850485fa284180f3 Mon Sep 17 00:00:00 2001 From: owjs3901 Date: Sat, 21 Nov 2026 15:24:59 +0900 Subject: [PATCH 25/40] docs(metro-plugin): fix the duplicated README of the compat section Co-Authored-By: Claude Opus 5.5 --- packages/metro-plugin/README.md | 285 +------------------------------- 1 file changed, 1 insertion(+), 284 deletions(-) diff --git a/packages/metro-plugin/README.md b/packages/metro-plugin/README.md index e3cc2e684..62ce77ca8 100644 --- a/packages/metro-plugin/README.md +++ b/packages/metro-plugin/README.md @@ -301,290 +301,7 @@ const Card = styled.View({ padding: 8, backgroundColor: '$surface' }) `styled.Name` render React Native's component of that name; `styled(X)` works as Devup UI's `styled()`. - A number is pixels, as those packages read it: `padding: 8` is 8, not - Devup UI's `8 * 4`. Devup UI's shorthands and `# @devup-ui/metro-plugin - -> **Experimental (0.x).** React Native support is in progress -> ([#411](https://github.com/dev-five-git/devup-ui/issues/411)). This package -> is not published yet, and its API may change. - -Compiles Devup UI for React Native in [Metro](https://metrobundler.dev/), the -bundler of React Native and Expo. You keep importing `Box`, `Text`, ... from -`@devup-ui/react`; at build time each element becomes a React Native component -and its style props become style objects hoisted into one `StyleSheet.create` -per file. With one theme nothing runs at runtime; with more, a tiny runtime -(`@devup-ui/react/native`) only tells which theme shows. - -## Setup - -```js -// metro.config.js (Expo) -const { getDefaultConfig } = require('expo/metro-config') -const { withDevupUI } = require('@devup-ui/metro-plugin') - -module.exports = withDevupUI(getDefaultConfig(__dirname)) -``` - -```js -// metro.config.js (React Native CLI) -const { getDefaultConfig } = require('@react-native/metro-config') -const { withDevupUI } = require('@devup-ui/metro-plugin') - -module.exports = withDevupUI(getDefaultConfig(__dirname)) -``` - -```tsx -import { Box, Flex, Text } from '@devup-ui/react' - -export function Card() { - return ( - - - Hello - - - - ) -} -``` - -`withDevupUI` sets `transformer.babelTransformerPath` to its own transformer. -The transformer compiles each file that imports Devup UI for the platform -Metro builds (`ios`, `android` or `web`) and then hands the code to the -transformer the config had: Expo's, React Native's, or the one you name. - -| Element | React Native | -| --- | --- | -| `Box`, `Flex`, `VStack`, `Center` | `View` (`Flex`, `VStack` and `Center` add their flex styles) | -| `Text` | `Text` | -| `Image` | `Image` (`src` becomes `source`) | -| `Input` | `TextInput` | -| `Button` | `Pressable` | - -`_ios`, `_android` and `_web` apply their styles on that platform only. - -## Options - -```js -withDevupUI(config, { - // The package Devup UI is imported from. Default: '@devup-ui/react' - package: '@devup-ui/react', - // devup.json, from the project root. Default: 'devup.json' - devupFile: 'devup.json', - // Packages in node_modules that ship uncompiled Devup UI. Default: [] - include: [], - // Whether styles that need the React Native runtime may import it. - // Default: true. false is a strict zero-runtime mode. - runtime: true, - // 'native' (default) or 'wasm' - engine: 'native', - // The Babel transformer the compiled code goes to. - // Default: the config's babelTransformerPath, else Expo's, else React Native's. - upstreamTransformer: undefined, -}) -``` - -## Themes - -`$` tokens of devup.json (colors, `length` and `shadow`) and `typography` -resolve at build time to the values React Native takes. With one theme each -becomes its literal value, and no file imports a runtime: - -```tsx - -// const __s = StyleSheet.create({ a: { backgroundColor: "#fff", padding: 16 } }) -// -``` - -With more themes, the styles of every theme are precomputed, and the element -picks one by the index of the theme that shows; what does not differ by theme -stays shared: - -```tsx -// -``` - -The themes are the color variants of devup.json, the default first. The app -starts on the theme that follows the system appearance (React Native's -`Appearance`): while it is dark, `dark`, or else the first theme `colorScheme` -makes dark; otherwise the default theme. `_themeDark`, `_themeSepia`, ... -apply their styles in that theme only. - -```tsx -import { getTheme, setTheme, useTheme } from '@devup-ui/react' - -const theme = useTheme() // renders again when the theme changes -setTheme('sepia') // wins over the system appearance -``` - -The build imports these from `@devup-ui/react/native`, a store read with -`useSyncExternalStore` that computes no style; web builds never import it. -`setTheme` does not save the choice across launches. - -## Responsive values - -Responsive arrays, and `length`, `shadow` and `typography` tokens with a value -at each breakpoint, use the `breakpoints` of devup.json (the web's -`[0, 480, 768, 992, 1280, 1600]` by default), measured against the window -width in density-independent pixels. As on the web, each value applies from -its breakpoint on and `null` keeps the one before: - -```tsx - -// -``` - -The build precomputes one style object for each run of breakpoints that -share their styles, only for the styles that differ; a value that differs by -theme and breakpoint picks by both. The runtime listens to the window once -and renders a component again only when the window crosses into another -breakpoint. `_portrait` and `_landscape` apply their styles while the window -is in that orientation. - -A value read at runtime in an array (`p={[x, 2]}`) applies from its -breakpoint on as it is. - -## Press styles - -`_active` (or its React Native name, `_pressed`) applies its styles while the -element is pressed. React Native tells only a `Pressable` whether it is -pressed, so the build passes it a function for its `style`: - -```tsx - -// renders - [styles.a, pressed && styles.b]} /> -``` - -A `Button` is already a `Pressable`. A `Box`, `Flex`, `Center` or `VStack` -with a press style becomes one, so it takes `onPress` and the other props of -`Pressable`. A press style works with `runtime: false` too, as it needs no -runtime. It is a build error on a `Text`, an `Image` or an `Input`, and with -`as`. - -### Hover, focus and disabled - -`_hover` and `_focus` apply while the pointer is over the element and while -it has focus. A `Pressable` tells these to its style function too -(`({ hovered, focused }) => ...`). React Native reports them where the -platform has a pointer or keyboard focus, such as the web through -react-native-web, and never on a phone's touch screen. An `Input` with -`_focus` renders through the runtime's `Focused`, which follows its -`onFocus` and `onBlur` and still calls yours. `_hover` on an `Input`, and any -of these on a `Text` or an `Image`, is a build error. - -`_disabled` applies while the element's `disabled` prop is true: -` - ) -} -``` - -`css()` takes what it does on the web: objects of style props (with -responsive values, theme tokens and the theme, platform and orientation -blocks), conditions choosing between them, what another `css()` gives, and -CSS text (`` css`padding: 8px; background-color: $primary;` ``, each -interpolation a whole value). The element's style props apply after its -`className`, and its `style` prop last. - -A `css()` whose styles differ by theme, breakpoint or orientation reads the -runtime, so it must be called in a function component or a hook. One that does -not can be called anywhere, such as at the top of the file. These are build -errors: - -- a class name (`className="p-4"`, `css('p-4')`) -- a press style in `css()`: give `_active` to the element itself -- selectors, nesting and at-rules in CSS text - -`css()` gives a style rather than a class on React Native, so pass it to -`className`, not to the `style` of a React Native component, which TypeScript -types as a string. - -## `styled()` - -`styled()` compiles to a function component that renders its target with the -styles it describes, before the `style` the component is given: - -```tsx -const Card = styled(Box)({ bg: '$surface', p: [2, null, 4] }) -const Title = styled(Text)` - color: ${(props) => props.color}; - font-size: 18px; -` -// compiles to -const Card = (props) => { - const t = useThemeIndex(), b = useBreakpoint() - return -} -``` - -It takes the parts `css()` takes, as `styled(Target)(...parts)`, -`` styled(Target)`css text` `` or `styled(Target, styles)`. A function in -them is called with the component's props: a value (`w: (p) => p.width`, or -an interpolation in CSS text), or a part giving what `css()` gives -(`(p) => p.active && css({ opacity: 0.5 })`). The target is a Devup UI -component, which keeps the styles it declares first (`Flex` its row), or any -React Native component. A press style makes a styled `Box` a `Pressable`. -These are build errors: - -- a tag (`styled('div')`, `styled.div`) -- a function of the props giving style props (`(p) => ({ bg: p.color })`): - return what `css()` gives instead -- a press style on a component other than a `Box` or a `Button` - -The component reads style props only through `styled()`: on React Native, -`` passes `p` on to the target, so give it `style` or -`className` instead. - - tokens work too. + Devup UI's `8 * 4`. Devup UI's shorthands and `$` tokens work too. - A function of the props is called with `props.theme`, the theme of the nearest `ThemeProvider`. A function giving an object gives React Native styles as they are. From d4ba46dcae488ec3b0e7cdb9e1629edc92ccac83 Mon Sep 17 00:00:00 2001 From: owjs3901 Date: Sat, 21 Nov 2026 15:26:59 +0900 Subject: [PATCH 26/40] feat(expo): export and check the example on the web The Expo example exports for the web through react-native-web with the same compiled output as iOS and Android. CI checks the web bundle as the others and opens it in Chromium: the card's theme color and its switch, the input's focus style and a button press. Co-Authored-By: Claude Opus 5.5 --- .../changepack_log_metro_expo_web.json | 7 ++ .github/workflows/publish.yml | 16 ++- apps/expo/app.json | 2 +- apps/expo/check-bundle.mjs | 2 +- apps/expo/check-web.mjs | 102 ++++++++++++++++++ apps/expo/package.json | 8 +- apps/expo/src/App.tsx | 4 + bun.lock | 45 +++++++- packages/metro-plugin/README.md | 13 +++ 9 files changed, 190 insertions(+), 9 deletions(-) create mode 100644 .changepacks/changepack_log_metro_expo_web.json create mode 100644 apps/expo/check-web.mjs diff --git a/.changepacks/changepack_log_metro_expo_web.json b/.changepacks/changepack_log_metro_expo_web.json new file mode 100644 index 000000000..bd3611187 --- /dev/null +++ b/.changepacks/changepack_log_metro_expo_web.json @@ -0,0 +1,7 @@ +{ + "changes": { + "packages/metro-plugin/package.json": "Patch" + }, + "note": "Document Expo web (part of #411): Metro compiles the web build through react-native-web with the same output as iOS and Android, which the Expo example now exports and checks in Chromium.", + "date": "2026-11-21T00:00:00.000Z" +} diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 9ae22ef70..9cade6c4a 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -16,6 +16,7 @@ on: - feat/react-native-styled - feat/react-native-states - feat/react-native-animations + - feat/react-native-compat # Pull requests and every job below run read-only. Only the `release` and # `deploy-pages` jobs get write permissions, and they run on pushes to main @@ -929,14 +930,15 @@ jobs: fi files="$(git diff --name-only "$(git merge-base "$BASE" HEAD)" HEAD)" echo "$files" - if grep -qE '^(libs/extractor/src/native/|libs/binding/|bindings/devup-ui-(binding|wasm)/|packages/(metro-plugin|plugin-utils)/|packages/react/src/native/|apps/expo/|\.github/workflows/publish\.yml$)' <<< "$files"; then + if grep -qE '^(libs/extractor/src/native/|libs/binding/|bindings/devup-ui-(binding|wasm)/|packages/(metro-plugin|plugin-utils)/|packages/react/src/native/|packages/react/src/utils/(theme-context|with-theme).|apps/expo/|\.github/workflows/publish\.yml$)' <<< "$files"; then echo "changed=true" >> "$GITHUB_OUTPUT" else echo "changed=false" >> "$GITHUB_OUTPUT" fi - # The Expo example app (apps/expo) bundled for iOS and Android through - # @devup-ui/metro-plugin, as a release build does. Devup UI compiles away, + # The Expo example app (apps/expo) bundled for iOS, Android and the web + # (react-native-web) through @devup-ui/metro-plugin, as a release build + # does, and the web export opened in Chromium. Devup UI compiles away, # so no bundle may keep a module of @devup-ui/react but its React Native # runtime (`@devup-ui/react/native`), nor its runtime placeholder, and a # file styled the same in every theme must not use that runtime. @@ -955,7 +957,7 @@ jobs: - run: bun install --frozen-lockfile - *download-build - *unpack-build - - name: Export the iOS and Android bundles + - name: Export the iOS, Android and web bundles working-directory: apps/expo env: EXPO_NO_TELEMETRY: '1' @@ -963,6 +965,12 @@ jobs: - name: Check the bundles working-directory: apps/expo run: bun run check + - *record-playwright-revisions + - *restore-playwright-cache + - *install-chromium + - name: Check the web export in Chromium + working-directory: apps/expo + run: bun run check:web # @devup-ui/vite-plugin must keep the CSS every server page needs when the # build is vinext/RSC. The fixture shares one Devup UI header between server diff --git a/apps/expo/app.json b/apps/expo/app.json index ad7952e54..c9389260f 100644 --- a/apps/expo/app.json +++ b/apps/expo/app.json @@ -3,6 +3,6 @@ "name": "Devup UI Expo", "slug": "devup-ui-expo", "version": "0.1.0", - "platforms": ["ios", "android"] + "platforms": ["ios", "android", "web"] } } diff --git a/apps/expo/check-bundle.mjs b/apps/expo/check-bundle.mjs index 81297af7a..704d8d76f 100644 --- a/apps/expo/check-bundle.mjs +++ b/apps/expo/check-bundle.mjs @@ -114,7 +114,7 @@ function runtimeUsers(code, locate) { return users } -for (const platform of ['ios', 'android']) { +for (const platform of ['ios', 'android', 'web']) { const directory = join(root, platform) const bundles = readdirSync(directory).filter((file) => file.endsWith('.js')) if (bundles.length === 0) failures.push(`${platform}: no JavaScript bundle`) diff --git a/apps/expo/check-web.mjs b/apps/expo/check-web.mjs new file mode 100644 index 000000000..2d28949c7 --- /dev/null +++ b/apps/expo/check-web.mjs @@ -0,0 +1,102 @@ +// Opens the web export (`expo export --platform web` wrote dist/) in Chromium +// and checks that react-native-web renders the styles Devup UI compiled: the +// card takes the theme's color and switches with the theme, the input takes +// its focus style through the runtime's `Focused`, and the button, a +// `Pressable`, counts a press. +import { createReadStream, existsSync, statSync } from 'node:fs' +import { createServer } from 'node:http' +import { extname, join, normalize } from 'node:path' + +import { chromium } from '@playwright/test' + +const root = join(import.meta.dirname, 'dist') +const TYPES = { + '.html': 'text/html', + '.js': 'text/javascript', + '.json': 'application/json', + '.png': 'image/png', +} + +const server = createServer((request, response) => { + const path = join(root, normalize(new URL(request.url, 'http://x').pathname)) + if (!path.startsWith(root)) { + response.writeHead(404).end() + return + } + // A path that is no file is the app's page + const file = + existsSync(path) && statSync(path).isFile() + ? path + : join(root, 'index.html') + response.writeHead(200, { + 'content-type': TYPES[extname(file)] ?? 'application/octet-stream', + }) + createReadStream(file).pipe(response) +}) +await new Promise((resolve) => server.listen(0, '127.0.0.1', resolve)) +const url = `http://127.0.0.1:${server.address().port}/` + +const failures = [] +/** Fail with `message` unless `actual` is `expected` */ +function expectEqual(actual, expected, message) { + if (actual !== expected) { + failures.push(`${message}: expected ${expected}, got ${actual}`) + } +} + +const browser = await chromium.launch() +try { + const page = await browser.newPage({ colorScheme: 'light' }) + const errors = [] + page.on('pageerror', (error) => errors.push(error.message)) + await page.goto(url) + const card = page.getByTestId('card') + const name = page.getByTestId('name') + const count = page.getByTestId('count') + await card.waitFor() + /** The computed style `property` of `locator` */ + const style = (locator, property) => + locator.evaluate( + (element, property) => getComputedStyle(element)[property], + property, + ) + + expectEqual( + await style(card, 'backgroundColor'), + 'rgb(255, 255, 255)', + 'the card in the light theme', + ) + expectEqual( + await style(count, 'backgroundColor'), + 'rgb(90, 68, 255)', + 'the count button', + ) + await name.focus() + expectEqual( + await style(name, 'borderTopColor'), + 'rgb(90, 68, 255)', + 'the focused input', + ) + await count.click() + expectEqual( + (await count.textContent())?.trim(), + 'Pressed 1 times', + 'the count after a press', + ) + await page.getByTestId('theme').click() + expectEqual( + await style(card, 'backgroundColor'), + 'rgb(31, 31, 46)', + 'the card in the dark theme', + ) + for (const error of errors) failures.push(`page error: ${error}`) +} finally { + await browser.close() + server.close() +} + +if (failures.length > 0) { + console.error(failures.join('\n')) + process.exit(1) +} +console.info('web: react-native-web renders the compiled styles') diff --git a/apps/expo/package.json b/apps/expo/package.json index c9662f3d0..04463f3bc 100644 --- a/apps/expo/package.json +++ b/apps/expo/package.json @@ -5,15 +5,19 @@ "main": "index.ts", "scripts": { "start": "expo start", - "export": "expo export --platform ios --platform android --no-bytecode --source-maps", - "check": "node check-bundle.mjs" + "export": "expo export --platform ios --platform android --platform web --no-bytecode --source-maps", + "check": "node check-bundle.mjs", + "check:web": "node check-web.mjs" }, "dependencies": { "@devup-ui/react": "workspace:^", + "@expo/metro-runtime": "~58.0.17", "expo": "~58.0.26", "react": "^19.3.1", + "react-dom": "^19.3.1", "react-native": "0.88.1", "react-native-reanimated": "~4.7.1", + "react-native-web": "~0.21.4", "react-native-worklets": "0.13.0" }, "devDependencies": { diff --git a/apps/expo/src/App.tsx b/apps/expo/src/App.tsx index 56d362fdd..e6318fa87 100644 --- a/apps/expo/src/App.tsx +++ b/apps/expo/src/App.tsx @@ -59,6 +59,7 @@ export function App() { boxShadow="$raised" maxW={[null, null, '480px']} p={[4, null, 6]} + testID="card" w="100%" > @@ -72,6 +73,7 @@ export function App() { onChangeText={setName} px={3} py={2} + testID="name" value={name} /> @@ -88,6 +90,7 @@ export function App() { bg="#5a44ff" className={button} onPress={() => setCount(count + 1)} + testID="count" > Pressed {count} times @@ -98,6 +101,7 @@ export function App() { border="1px solid $border" className={button} onPress={() => setTheme(theme === 'dark' ? 'light' : 'dark')} + testID="theme" > Switch to {theme === 'dark' ? 'light' : 'dark'} diff --git a/bun.lock b/bun.lock index 699ed7003..62ce0b80a 100644 --- a/bun.lock +++ b/bun.lock @@ -27,10 +27,13 @@ "version": "0.1.0", "dependencies": { "@devup-ui/react": "workspace:^", + "@expo/metro-runtime": "~58.0.17", "expo": "~58.0.26", "react": "^19.3.1", + "react-dom": "^19.3.1", "react-native": "0.88.1", "react-native-reanimated": "~4.7.1", + "react-native-web": "~0.21.4", "react-native-worklets": "0.13.0", }, "devDependencies": { @@ -1262,6 +1265,8 @@ "@expo/metro-file-map": ["@expo/metro-file-map@58.0.6", "", { "dependencies": { "2g": "^1.0.1", "debug": "^4.3.4", "fb-watchman": "^2.0.2", "invariant": "^2.2.4", "jest-worker": "^29.7.0", "walker": "^1.0.8" } }, "sha512-+kPFI328BSUxpK7OO0kM31NQlYG/z7WOTISbPEuY4fMZxmN/nLnmJIDNG8NTtM5ZHXlNPqgjRvdukxtsBEkvuw=="], + "@expo/metro-runtime": ["@expo/metro-runtime@58.0.17", "", { "dependencies": { "@expo/log-box": "^58.0.15", "anser": "^1.4.9", "pretty-format": "^29.7.0", "stacktrace-parser": "^0.1.10", "whatwg-fetch": "^3.0.0" }, "peerDependencies": { "expo": "*", "react": "*", "react-dom": "*", "react-native": "*" }, "optionalPeers": ["react-dom"] }, "sha512-onJvBi90uwLj69F1EaVPmPeds/ndxc2/vNc0Z5n8rqcMKToMyLxGaL3Be6yf7OVjPhGvoDj+LWQ/IcbpN1hnoA=="], + "@expo/modules-macros-linux-arm64": ["@expo/modules-macros-linux-arm64@0.33.0", "", { "os": "linux", "cpu": "arm64", "libc": "glibc" }, "sha512-5F4L/IJThOBq3oRo9NB5BI4+Od8K2YDTbU+2IHgsnXsrTc5icQtOlLwHOEfExghjo0PHCXGap4zprfOKvtANxw=="], "@expo/modules-macros-linux-x64": ["@expo/modules-macros-linux-x64@0.33.0", "", { "os": "linux", "cpu": "x64", "libc": "glibc" }, "sha512-G3kxfmMpH7BDtoeBVeJA4vh5O3kQ3wmjmSfDremRBWENHKwHJXTOsyerLQqkJC39oPKCuXgXhzvp+/5qy+DyvA=="], @@ -2502,6 +2507,8 @@ "cosmiconfig": ["cosmiconfig@7.1.0", "", { "dependencies": { "@types/parse-json": "^4.0.0", "import-fresh": "^3.2.1", "parse-json": "^5.0.0", "path-type": "^4.0.0", "yaml": "^1.10.0" } }, "sha512-AdmX6xUzdNASswsFtmwSt7Vj8po9IuqXm0UXz7QKPuEUmPB4XyjGfaAr2PSuELMwkRMVH1EpIkX5bTZGRB3eCA=="], + "cross-fetch": ["cross-fetch@3.2.0", "", { "dependencies": { "node-fetch": "^2.7.0" } }, "sha512-Q+xVJLoGOeIMXZmbUK4HYk+69cQH6LudR0Vu/pRm2YlU/hDV9CiS0gKUMaWY5f2NeUH9C1nV3bsTlCo0FsTV1Q=="], + "cross-spawn": ["cross-spawn@7.0.6", "", { "dependencies": { "path-key": "^3.1.0", "shebang-command": "^2.0.0", "which": "^2.0.1" } }, "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA=="], "css-background-parser": ["css-background-parser@0.1.0", "", {}, "sha512-2EZLisiZQ+7m4wwur/qiYJRniHX4K5Tc9w93MT3AS0WS1u5kaZ4FKXlOTBhOjc+CgEgPiGY+fX1yWD8UwpEqUA=="], @@ -2512,6 +2519,8 @@ "css-gradient-parser": ["css-gradient-parser@0.0.17", "", {}, "sha512-w2Xy9UMMwlKtou0vlRnXvWglPAceXCTtcmVSo8ZBUvqCV5aXEFP/PC6d+I464810I9FT++UACwTD5511bmGPUg=="], + "css-in-js-utils": ["css-in-js-utils@3.1.0", "", { "dependencies": { "hyphenate-style-name": "^1.0.3" } }, "sha512-fJAcud6B3rRu+KHYk+Bwf+WFL2MDCJJ1XG9x137tJQ0xYxor7XziQtuGFbWNdqrvF4Tk26O3H73nfVqXt/fW1A=="], + "css-mediaquery": ["css-mediaquery@0.1.2", "", {}, "sha512-COtn4EROW5dBGlE/4PiKnh6rZpAPxDeFLaEEwt4i10jpDMFt2EhQGS79QmmrO+iKCHv0PU/HrOWEhijFd1x99Q=="], "css-to-react-native": ["css-to-react-native@3.2.0", "", { "dependencies": { "camelize": "^1.0.0", "css-color-keywords": "^1.0.0", "postcss-value-parser": "^4.0.2" } }, "sha512-e8RKaLXMOFii+02mOlqwjbD00KSEKqblnpO9e++1aXS1fPQOpS1YoqdVHBqPjHNoxeF2mimzVqawm2KCbEdtHQ=="], @@ -2744,6 +2753,10 @@ "fb-watchman": ["fb-watchman@2.0.4", "", { "dependencies": { "bser": "2.1.2" } }, "sha512-tGQtaoYisPDriJBN0mT5yZSyNETnJGA1gTYxaVRAE5KUO3LI9kPUc9WIu8JXcxaIci+faIKlzXqXyPgrmubtBQ=="], + "fbjs": ["fbjs@3.0.5", "", { "dependencies": { "cross-fetch": "^3.1.5", "fbjs-css-vars": "^1.0.0", "loose-envify": "^1.0.0", "object-assign": "^4.1.0", "promise": "^7.1.1", "setimmediate": "^1.0.5", "ua-parser-js": "^1.0.35" } }, "sha512-ztsSx77JBtkuMrEypfhgc3cI0+0h+svqeie7xHbh1k/IKdcydnvadp/mUaGgjAOXQmQSxsqgaRhS3q9fy+1kxg=="], + + "fbjs-css-vars": ["fbjs-css-vars@1.0.2", "", {}, "sha512-b2XGFAFdWZWg0phtAWLHCk836A1Xann+I+Dgd3Gk64MHKZO44FfoD1KxyvbSh0qZsIoXQGGlVztIY+oitJPpRQ=="], + "fdir": ["fdir@6.5.0", "", { "peerDependencies": { "picomatch": "^3 || ^4" }, "optionalPeers": ["picomatch"] }, "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg=="], "fetch-nodeshim": ["fetch-nodeshim@0.4.10", "", {}, "sha512-m6I8ALe4L4XpdETy7MJZWs6L1IVMbjs99bwbpIKphxX+0CTns4IKDWJY0LWfr4YsFjfg+z1TjzTMU8lKl8rG0w=="], @@ -2848,6 +2861,8 @@ "husky": ["husky@9.1.7", "", { "bin": { "husky": "bin.js" } }, "sha512-5gs5ytaNjBrh5Ow3zrvdUUY+0VxIuWVL4i9irt6friV+BqdCfmV11CQTWMiBYWHbXhco+J1kHfTOUkePhCDvMA=="], + "hyphenate-style-name": ["hyphenate-style-name@1.1.0", "", {}, "sha512-WDC/ui2VVRrz3jOVi+XtjqkDjiVjTtFaAGiW37k6b+ohyQ5wYDOGkvCZa8+H0nx3gyvv0+BST9xuOgIyGQ00gw=="], + "icu-minify": ["icu-minify@4.15.2", "", { "dependencies": { "@formatjs/icu-messageformat-parser": "^3.4.0" } }, "sha512-IsgBR7/1RBkYWUqP2wS+vE9BBBfH4HjNjDbSPF3uK2Jjlzlsd7R+loUhjEEUySU6tjGmUIuft7w3qp7PI0KkXA=="], "ignore": ["ignore@5.3.2", "", {}, "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g=="], @@ -2868,6 +2883,8 @@ "inline-style-parser": ["inline-style-parser@0.2.9", "", {}, "sha512-IttN8BqKLxzUrnTqHI+/hwAJQItBAUjdoHERCDv+oOuX48VP6bzW8+QjOXSfoevzq3YrYAwX1uLHp8TqO9yIeg=="], + "inline-style-prefixer": ["inline-style-prefixer@7.0.1", "", { "dependencies": { "css-in-js-utils": "^3.1.0" } }, "sha512-lhYo5qNTQp3EvSSp3sRvXMbVQTLrvGV6DycRMJ5dm2BLMiJ30wpXKdDdgX+GmJZ5uQMucwRKHamXSst3Sj/Giw=="], + "intl-messageformat": ["intl-messageformat@12.2.0", "", { "dependencies": { "@formatjs/fast-memoize": "3.1.7", "@formatjs/icu-messageformat-parser": "3.5.23" } }, "sha512-zFzW80iYSSJm4V185g3ItJQ96lBZ2RDO8O8qmRiPAAVKYXJeHfDQN2ITdtLlV+CjSi9Lo7zVW9xGt9CPCx7J6A=="], "invariant": ["invariant@2.2.4", "", { "dependencies": { "loose-envify": "^1.0.0" } }, "sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA=="], @@ -3228,6 +3245,8 @@ "node-addon-api": ["node-addon-api@7.1.1", "", {}, "sha512-5m3bsyrjFWE1xf7nz7YXdN4udnVtXK6/Yfgn5qnahL6bCkf2yKt4k3nuTKAtT4r3IG8JNR2ncsIMdZuAzJjHQQ=="], + "node-fetch": ["node-fetch@2.7.0", "", { "dependencies": { "whatwg-url": "^5.0.0" }, "peerDependencies": { "encoding": "^0.1.0" }, "optionalPeers": ["encoding"] }, "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A=="], + "node-forge": ["node-forge@1.4.3", "", {}, "sha512-P6wzfh6t70avmV8FrVEAd/36sOPJQ+hkaJVX1Laap9J/77m7M0eyozDvc8SwnDf4P7MP94gwbAAo0rg3YVXT+g=="], "node-int64": ["node-int64@0.4.0", "", {}, "sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw=="], @@ -3404,6 +3423,8 @@ "react-native-reanimated": ["react-native-reanimated@4.7.2", "", { "dependencies": { "react-native-is-edge-to-edge": "^1.3.1", "semver": "^7.7.3" }, "peerDependencies": { "react": "*", "react-native": "0.86 - 0.88", "react-native-worklets": "0.13.x" } }, "sha512-dlPMG+dKKbcumR8k2C8wApqVsrCevINxEki3I6t0S/6LPqa639unbwRn85yu1yhtC9oJI94xk+ycdGuEGdH4Gw=="], + "react-native-web": ["react-native-web@0.21.4", "", { "dependencies": { "@babel/runtime": "^7.18.6", "@react-native/normalize-colors": "^0.74.1", "fbjs": "^3.0.4", "inline-style-prefixer": "^7.0.1", "memoize-one": "^6.0.0", "nullthrows": "^1.1.1", "postcss-value-parser": "^4.2.0", "styleq": "^0.1.3" }, "peerDependencies": { "react": "^18.0.0 || ^19.0.0", "react-dom": "^18.0.0 || ^19.0.0" } }, "sha512-77B6KlalB4osNIck91TNFixPkYPsTbuNEvw8P7IV+4v4/5wZSBRKZnw0Zhx6YjuauDTz71gc8IW+fVhcBMjr5A=="], + "react-native-worklets": ["react-native-worklets@0.13.0", "", { "dependencies": { "@babel/generator": "^7.27.1", "@babel/plugin-transform-arrow-functions": "^7.27.1", "@babel/plugin-transform-class-properties": "^7.28.6", "@babel/plugin-transform-classes": "^7.28.6", "@babel/plugin-transform-nullish-coalescing-operator": "^7.28.6", "@babel/plugin-transform-optional-chaining": "^7.28.6", "@babel/plugin-transform-shorthand-properties": "^7.27.1", "@babel/plugin-transform-template-literals": "^7.27.1", "@babel/plugin-transform-unicode-regex": "^7.27.1", "@babel/preset-typescript": "^7.28.5", "@babel/traverse": "^7.27.1", "@babel/types": "^7.27.1", "@jridgewell/remapping": "^2.3.5", "convert-source-map": "^2.0.0", "semver": "^7.7.4", "whatwg-fetch": "^3.6.20" }, "peerDependencies": { "@babel/core": "*", "@react-native/metro-config": "*", "react": "*", "react-native": "0.86 - 0.88" } }, "sha512-1OrhAeAKaZF4XrBa4YbPQbKzNOpjh52HDlId8e6ete1OCHNdAlrQHzG4gznJ225EAj3dgQXHViJvK51M9B52jQ=="], "react-refresh": ["react-refresh@0.14.2", "", {}, "sha512-jCvmsr+1IUSMUyzOkRcvnVbX3ZYC6g9TDrDbFuFmRDq7PD4yaGbLKNQL6k2jnArV8hjYxh7hVhAZB6s9HDGpZA=="], @@ -3516,6 +3537,8 @@ "set-blocking": ["set-blocking@2.0.0", "", {}, "sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw=="], + "setimmediate": ["setimmediate@1.0.5", "", {}, "sha512-MATJdZp8sLqDl/68LfQmbP8zKPLQNV6BIZoIgrscFDQ+RsvK/BxeDQOgyxKKoh0y/8h3BqVFnCqQ/gd+reiIXA=="], + "setprototypeof": ["setprototypeof@1.2.0", "", {}, "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw=="], "sharp": ["sharp@0.35.5", "", { "dependencies": { "@img/colour": "^1.1.0", "detect-libc": "^2.1.2", "semver": "^7.8.5" }, "optionalDependencies": { "@img/sharp-darwin-arm64": "0.35.5", "@img/sharp-darwin-x64": "0.35.5", "@img/sharp-freebsd-wasm32": "0.35.5", "@img/sharp-libvips-darwin-arm64": "1.3.4", "@img/sharp-libvips-darwin-x64": "1.3.4", "@img/sharp-libvips-linux-arm": "1.3.4", "@img/sharp-libvips-linux-arm64": "1.3.4", "@img/sharp-libvips-linux-ppc64": "1.3.4", "@img/sharp-libvips-linux-riscv64": "1.3.4", "@img/sharp-libvips-linux-s390x": "1.3.4", "@img/sharp-libvips-linux-x64": "1.3.4", "@img/sharp-libvips-linuxmusl-arm64": "1.3.4", "@img/sharp-libvips-linuxmusl-x64": "1.3.4", "@img/sharp-linux-arm": "0.35.5", "@img/sharp-linux-arm64": "0.35.5", "@img/sharp-linux-ppc64": "0.35.5", "@img/sharp-linux-riscv64": "0.35.5", "@img/sharp-linux-s390x": "0.35.5", "@img/sharp-linux-x64": "0.35.5", "@img/sharp-linuxmusl-arm64": "0.35.5", "@img/sharp-linuxmusl-x64": "0.35.5", "@img/sharp-webcontainers-wasm32": "0.35.5", "@img/sharp-win32-arm64": "0.35.5", "@img/sharp-win32-ia32": "0.35.5", "@img/sharp-win32-x64": "0.35.5" }, "peerDependencies": { "@types/node": "*" }, "optionalPeers": ["@types/node"] }, "sha512-Ywn4OnzGukp7CDMrp08RQ50YKmuwG47brZgIVPTvBaaAfQlRlygrRqSrxdCiL9M+LlzLBiJ68IR1QqvzHyjC7g=="], @@ -3592,7 +3615,7 @@ "styled-jsx": ["styled-jsx@5.1.6", "", { "dependencies": { "client-only": "0.0.1" }, "peerDependencies": { "@babel/core": "*", "babel-plugin-macros": "*", "react": ">= 16.8.0 || 17.x.x || ^18.0.0-0 || ^19.0.0-0" }, "optionalPeers": ["@babel/core", "babel-plugin-macros"] }, "sha512-qSVyDTeMotdvQYoHWLNGwRFJHC+i+ZvdBRYosOFgC+Wg1vx4frN2/RG/NA7SYqqvKNLf39P2LSRA2pu6n0XYZA=="], - "styleq": ["styleq@0.2.1", "", {}, "sha512-L0TR0NQb+X4/ktDEKmjWyp27gla+LUYi/by5k5SjKXf6/pvZP7wbwEB5J+tqxdFVPgzbsuz+d4RTScO/QZquBw=="], + "styleq": ["styleq@0.1.3", "", {}, "sha512-3ZUifmCDCQanjeej1f6kyl/BeP/Vae5EYkQ9iJfUm/QwZvlgnZzyflqAsAWYURdtea8Vkvswu2GrC57h3qffcA=="], "stylis": ["stylis@4.2.0", "", {}, "sha512-Orov6g6BB1sDfYgzWfTHDOxamtX1bE/zo104Dh9e6fqJ3PooipYyfJ0pUmrZO2wAvO8YbEyeFrkV91XTsGMSrw=="], @@ -3634,6 +3657,8 @@ "toqr": ["toqr@0.1.1", "", {}, "sha512-FWAPzCIHZHnrE/5/w9MPk0kK25hSQSH2IKhYh9PyjS3SG/+IEMvlwIHbhz+oF7xl54I+ueZlVnMjyzdSwLmAwA=="], + "tr46": ["tr46@0.0.3", "", {}, "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw=="], + "trim-lines": ["trim-lines@3.0.1", "", {}, "sha512-kRj8B+YHZCc9kQYdWfJB2/oUl9rA99qbowYYBtr4ui4mZyAQ2JpvVBd/6U2YloATfqBhBTSMhTpgBHtU0Mf3Rg=="], "trough": ["trough@2.2.0", "", {}, "sha512-tmMpK00BjZiUyVyvrBK7knerNgmgvcV/KLVyuma/SC+TQN167GrMRciANTz09+k3zW8L8t60jWO1GpfkZdjTaw=="], @@ -3664,6 +3689,8 @@ "typescript-eslint": ["typescript-eslint@8.73.0", "", { "dependencies": { "@typescript-eslint/eslint-plugin": "8.73.0", "@typescript-eslint/parser": "8.73.0", "@typescript-eslint/typescript-estree": "8.73.0", "@typescript-eslint/utils": "8.73.0" }, "peerDependencies": { "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", "typescript": ">=4.8.4 <6.1.0" } }, "sha512-+EnKy9rkYPun4l+kG2bDuYWQ6y1tGVgdR/tY1U9AC6h21CjEwOoc7gsjwe0FXB8uWFzk4QiCFbuRWgX758PiAg=="], + "ua-parser-js": ["ua-parser-js@1.0.41", "", { "bin": { "ua-parser-js": "script/cli.js" } }, "sha512-LbBDqdIC5s8iROCUjMbW1f5dJQTEFB1+KO9ogbvlb3nm9n4YHa5p4KTvFPWvh2Hs8gZMBuiB1/8+pdfe/tDPug=="], + "ufo": ["ufo@1.6.4", "", {}, "sha512-JFNbkD1Svwe0KvGi8GOeLcP4kAWQ609twvCdcHxq1oSL8svv39ZuSvajcD8B+5D0eL4+s1Is2D/O6KN3qcTeRA=="], "undici-types": ["undici-types@8.9.0", "", {}, "sha512-KTDyRTYX8sWmKXAikPHHSyc63CRPETMctyjKFupcC6OBLXT3xsN0e9aF7m+mIXutFWpUXuedtowG7iLOzp0kQg=="], @@ -3780,6 +3807,8 @@ "web-vitals": ["web-vitals@4.2.4", "", {}, "sha512-r4DIlprAGwJ7YM11VZp4R884m0Vmgr6EAKe3P+kO0PPj3Unqyvv59rczf6UiGcb9Z8QxZVcqKNwv/g0WNdWwsw=="], + "webidl-conversions": ["webidl-conversions@3.0.1", "", {}, "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ=="], + "webpack": ["webpack@5.112.2", "", { "dependencies": { "@types/estree": "^1.0.8", "@types/json-schema": "^7.0.15", "@webassemblyjs/ast": "^1.14.1", "@webassemblyjs/wasm-edit": "^1.14.1", "@webassemblyjs/wasm-parser": "^1.14.1", "browserslist": "^4.28.1", "chrome-trace-event": "^1.0.2", "enhanced-resolve": "^5.26.0", "es-module-lexer": "^2.1.0", "events": "^3.2.0", "graceful-fs": "^4.2.11", "mime-db": "^1.54.0", "minimizer-webpack-plugin": "^5.13.0", "schema-utils": "^4.8.1", "tapable": "^2.3.0", "watchpack": "^2.6.3", "webpack-sources": "^3.6.0" }, "peerDependencies": { "webpack-cli": "*" }, "optionalPeers": ["webpack-cli"], "bin": { "webpack": "bin/webpack.js" } }, "sha512-B2tp1LI9D8GVpPDqprdt12ukTkXXahj9MzqSWJq4faSPgOUM7CdZaGAB6HrL/8E6UwbBpdj4vzWDbKoFnVoU6g=="], "webpack-sources": ["webpack-sources@3.7.1", "", {}, "sha512-mcxs7A2LsEdwsNqQburqS4QHPR2Ca3NGplUakn6J5GPQvnVZ4oD4IM4FJcT3f8AVN2e2EsjuIVxKj4rorHvyuQ=="], @@ -3790,6 +3819,8 @@ "whatwg-mimetype": ["whatwg-mimetype@3.0.0", "", {}, "sha512-nt+N2dzIutVRxARx1nghPKGv1xHikU7HKdfafKkLNLindmPU/ch3U31NOCGGA/dmPcmb1VlofO0vnKAcsm0o/Q=="], + "whatwg-url": ["whatwg-url@5.0.0", "", { "dependencies": { "tr46": "~0.0.3", "webidl-conversions": "^3.0.0" } }, "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw=="], + "whatwg-url-minimum": ["whatwg-url-minimum@0.2.0", "", {}, "sha512-BtjXU1caNcCFfETP2DhqSeVPfRDl2MTUitI107RE34rJXjR/izfUtR5IoTFOK1WqjNLXbbeqaCH/mQAOLjpc8g=="], "which": ["which@2.0.2", "", { "dependencies": { "isexe": "^2.0.0" }, "bin": { "node-which": "./bin/node-which" } }, "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA=="], @@ -4406,6 +4437,8 @@ "@stylexjs/postcss-plugin/@babel/core": ["@babel/core@7.29.13", "", { "dependencies": { "@babel/code-frame": "^7.29.7", "@babel/generator": "^7.29.13", "@babel/helper-compilation-targets": "^7.29.13", "@babel/helper-module-transforms": "^7.29.13", "@babel/helpers": "^7.29.13", "@babel/parser": "^7.29.13", "@babel/template": "^7.29.7", "@babel/traverse": "^7.29.13", "@babel/types": "^7.29.11", "@jridgewell/remapping": "^2.3.5", "convert-source-map": "^2.0.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.2", "json5": "^2.2.3", "semver": "^6.3.1" } }, "sha512-j1nvOQCZYSgp7HLmisnCXFTpVvFODiijQ9QHkORfGKWH6YDtskTEeCJS7eV545GZ9UBzrq0e2xsOd5QQ5PjIqw=="], + "@stylexjs/stylex/styleq": ["styleq@0.2.1", "", {}, "sha512-L0TR0NQb+X4/ktDEKmjWyp27gla+LUYi/by5k5SjKXf6/pvZP7wbwEB5J+tqxdFVPgzbsuz+d4RTScO/QZquBw=="], + "@tailwindcss/oxide-wasm32-wasi/@emnapi/core": ["@emnapi/core@1.11.3", "", { "dependencies": { "@emnapi/wasi-threads": "1.2.3", "tslib": "^2.4.0" }, "bundled": true }, "sha512-zLpS5asjEb7lq8jYLq37N6XKaE41DIexlY1rF/z4/tIl3wo13Sqm28fRyfIsKZD+NZ8mM5RoKkpW/rBcuoSZSg=="], "@tailwindcss/oxide-wasm32-wasi/@emnapi/runtime": ["@emnapi/runtime@1.11.3", "", { "dependencies": { "tslib": "^2.4.0" }, "bundled": true }, "sha512-Xz4Tpyki7XyrpbUK1jR1AhdAdaXyhhY4lZ3neLodmhpuWfy2PAQN5B46sAiU4liOXGLkHypn/qU+jvfWSCYYLA=="], @@ -4490,6 +4523,8 @@ "fast-glob/glob-parent": ["glob-parent@5.1.2", "", { "dependencies": { "is-glob": "^4.0.1" } }, "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow=="], + "fbjs/promise": ["promise@7.3.1", "", { "dependencies": { "asap": "~2.0.3" } }, "sha512-nolQXZ/4L+bP/UGlkfaIujX9BKxGwmQ9OT4mOt5yvy8iK1h3wqTEJCijzGANTCCl9nWjY41juyAn2K3Q1hLLTg=="], + "finalhandler/debug": ["debug@2.6.9", "", { "dependencies": { "ms": "2.0.0" } }, "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA=="], "finalhandler/encodeurl": ["encodeurl@1.0.4", "", {}, "sha512-ImAQpWtQZKdkUxvj9CMNzB8M4IGg0DkRTZzmOHqgVFrf71JDmUacbt+iKljfIpD2yHcxI+HR76d8bwvdvtSvGA=="], @@ -4608,6 +4643,10 @@ "react-native/ws": ["ws@7.5.14", "", { "peerDependencies": { "bufferutil": "^4.0.1", "utf-8-validate": "^5.0.2" }, "optionalPeers": ["bufferutil", "utf-8-validate"] }, "sha512-u9Oi2nQ8SZnTUAf6spLLKF5TyqoG3Nbbrd4ai6Sjo4P24bycDewhQqtNMIg4bFpnpH/TD4qk4IuAVhT0HIIqug=="], + "react-native-web/@react-native/normalize-colors": ["@react-native/normalize-colors@0.74.89", "", {}, "sha512-qoMMXddVKVhZ8PA1AbUCk83trpd6N+1nF2A6k1i6LsQObyS92fELuk8kU/lQs6M7BsMHwqyLCpQJ1uFgNvIQXg=="], + + "react-native-web/memoize-one": ["memoize-one@6.0.0", "", {}, "sha512-rkpe71W0N0c0Xz6QD0eJETuWAJGnJ9afsl1srmwPrI+yBCkge5EycXXbYRyvL29zZVUWQCY7InPRCv3GDXuZNw=="], + "recast/source-map": ["source-map@0.6.1", "", {}, "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g=="], "redent/strip-indent": ["strip-indent@3.0.0", "", { "dependencies": { "min-indent": "^1.0.0" } }, "sha512-laJTa3Jb+VQpaC6DseHhF7dXVqHTfJPCRDaEbid/drOhgitgYku/letMUqOXFoWV0zIIUbjpdH2t+tYj4bQMRQ=="], @@ -6228,6 +6267,8 @@ "@stylexjs/nextjs-plugin/@stylexjs/babel-plugin/@stylexjs/stylex": ["@stylexjs/stylex@0.11.1", "", { "dependencies": { "css-mediaquery": "^0.1.2", "invariant": "^2.2.4", "styleq": "0.2.1" } }, "sha512-1OofsiCP2DYV+Cw/iIuHYTAJRy34TtxQt0FDuQGTnNH915hb6NkPmX6iPa++9t4KP3HWR9oVRmAHkpP58BIYbw=="], + "@stylexjs/open-props/@stylexjs/stylex/styleq": ["styleq@0.2.1", "", {}, "sha512-L0TR0NQb+X4/ktDEKmjWyp27gla+LUYi/by5k5SjKXf6/pvZP7wbwEB5J+tqxdFVPgzbsuz+d4RTScO/QZquBw=="], + "@stylexjs/postcss-plugin/@babel/core/@babel/code-frame": ["@babel/code-frame@7.29.7", "", { "dependencies": { "@babel/helper-validator-identifier": "^7.29.7", "js-tokens": "^4.0.0", "picocolors": "^1.1.1" } }, "sha512-Aup7aUOfpbAUg2ROOJN6Iw5f9DMBlzu0mIkm/malLQFN/YQgO48wCj0Kxa3sEHJvPVFg7siR+qRInwXd2qhQKw=="], "@stylexjs/postcss-plugin/@babel/core/@babel/helper-compilation-targets": ["@babel/helper-compilation-targets@7.29.13", "", { "dependencies": { "@babel/compat-data": "^7.29.7", "@babel/helper-validator-option": "^7.29.7", "browserslist": "^4.24.0", "lru-cache": "^5.1.1", "semver": "^6.3.1" } }, "sha512-8WxJ4/Vmes3ghacj8VOJy3NW8eyHiFY/4thU/LSBuBE470+igjR/j1ZTNn8fV5VdNrLx6iXUwig526UdOvfP0w=="], @@ -7114,6 +7155,8 @@ "@stylexjs/nextjs-plugin/@babel/core/@babel/helper-compilation-targets/lru-cache": ["lru-cache@5.1.1", "", { "dependencies": { "yallist": "^3.0.2" } }, "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w=="], + "@stylexjs/nextjs-plugin/@stylexjs/babel-plugin/@stylexjs/stylex/styleq": ["styleq@0.2.1", "", {}, "sha512-L0TR0NQb+X4/ktDEKmjWyp27gla+LUYi/by5k5SjKXf6/pvZP7wbwEB5J+tqxdFVPgzbsuz+d4RTScO/QZquBw=="], + "@stylexjs/postcss-plugin/@babel/core/@babel/code-frame/js-tokens": ["js-tokens@4.0.0", "", {}, "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ=="], "@stylexjs/postcss-plugin/@babel/core/@babel/helper-compilation-targets/browserslist": ["browserslist@4.29.6", "", { "dependencies": { "baseline-browser-mapping": "^2.11.37", "caniuse-lite": "^1.0.30001826", "electron-to-chromium": "^1.5.486", "node-releases": "^2.0.64", "update-browserslist-db": "^1.4.0" }, "bin": { "browserslist": "cli.js" } }, "sha512-CmVVIQ3RVc5HxYEc9X84GvxK/C8C1wH8TlKAiO7uTxF8PDwt7r8t9Qk3J9NkMOVzX5O/HbLv3yzxZg9HPrnI9w=="], diff --git a/packages/metro-plugin/README.md b/packages/metro-plugin/README.md index 62ce77ca8..8a42d85f3 100644 --- a/packages/metro-plugin/README.md +++ b/packages/metro-plugin/README.md @@ -310,6 +310,19 @@ const Card = styled.View({ padding: 8, backgroundColor: '$surface' }) `runtime: false` they are build errors. - Any other import stays on the package. +## Expo web + +On the web, Expo bundles the app with Metro through +[react-native-web](https://necolas.github.io/react-native-web/), and this +plugin compiles it as for iOS and Android: the same `StyleSheet` objects, +which react-native-web turns into CSS. `_web` blocks apply there, and +`_hover` and `_focus` follow the mouse and the keyboard. Install the web +dependencies Expo asks for (`npx expo install react-dom react-native-web +@expo/metro-runtime`) and add `"web"` to the `platforms` of app.json. + +A site that is not an Expo app keeps using the Vite, Next.js, Webpack, +Rsbuild or Bun plugin, which output atomic CSS instead. + ## Limits of this version Only styles the build can decide are supported: literals, values read at From 6fd7158706b4ad8b7a0c7c230792be5f6d8909b8 Mon Sep 17 00:00:00 2001 From: owjs3901 Date: Sat, 21 Nov 2026 15:56:35 +0900 Subject: [PATCH 27/40] fix(native): cover the pixel conversion of compat numbers in one statement Tarpaulin counted the deferred `let pixels;` as an uncovered line. Co-Authored-By: Claude Opus 5.5 --- libs/extractor/src/native/element.rs | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/libs/extractor/src/native/element.rs b/libs/extractor/src/native/element.rs index a938dbb9e..989848b25 100644 --- a/libs/extractor/src/native/element.rs +++ b/libs/extractor/src/native/element.rs @@ -9,6 +9,7 @@ use oxc_ast::ast::{ JSXElementName, JSXExpression, LogicalOperator, ObjectExpression, ObjectPropertyKind, Program, TSType, TaggedTemplateExpression, UnaryOperator, VariableDeclarator, }; +use std::borrow::Cow; use std::cell::Cell; use std::fmt::Write; @@ -698,13 +699,11 @@ impl<'a> Elements<'_> { /// breakpoint it is paired with on: one style object, or one a /// breakpoint and a theme where the styles differ by them fn static_choice(&self, name: &str, items: &[(usize, Literal)]) -> Result { - let pixels; - let items = if self.compat { - // A number of a compat package is pixels, as React Native reads it - pixels = in_pixels(name, items); - &pixels + // A number of a compat package is pixels, as React Native reads it + let items: Cow<[(usize, Literal)]> = if self.compat { + Cow::Owned(in_pixels(name, items)) } else { - items + Cow::Borrowed(items) }; let theme = &self.target.theme; let themes = match self.theme_scope { @@ -725,7 +724,7 @@ impl<'a> Elements<'_> { for index in themes.clone() { row.push(cell( name, - items, + &items, &Tokens { theme, index, From 487978a299b776eb6a3b6602fdca9291c66367b2 Mon Sep 17 00:00:00 2001 From: owjs3901 Date: Sat, 21 Nov 2026 16:02:20 +0900 Subject: [PATCH 28/40] feat(native): type the theme and React Native props of each component Metro writes df/theme.d.ts (the tokens of devup.json) and df/native.d.ts when it reads the config, as the web plugins do. native.d.ts imports the new @devup-ui/react/native/types, which fills the new DevupElementProps augmentation point so each component takes the props of the React Native component it renders. Web types are unchanged. The Expo example now type-checks in CI. Co-Authored-By: Claude Opus 5.5 --- .changepacks/changepack_log_metro_types.json | 7 +++ .../changepack_log_react_native_types.json | 7 +++ .github/workflows/publish.yml | 7 ++- apps/expo/package.json | 3 +- packages/metro-plugin/README.md | 20 +++++++ .../metro-plugin/src/__tests__/plugin.test.ts | 54 ++++++++++++++++++- packages/metro-plugin/src/plugin.ts | 16 +++++- packages/metro-plugin/src/types.ts | 44 +++++++++++++++ packages/react/package.json | 7 ++- packages/react/rollup.types.config.mjs | 4 +- packages/react/src/index.ts | 2 +- packages/react/src/native/types.d.ts | 39 ++++++++++++++ packages/react/src/types/props/index.ts | 20 ++++++- packages/react/type-tests/native/app.tsx | 28 ++++++++++ .../react/type-tests/native/tsconfig.json | 11 ++++ .../react/type-tests/published/native.tsx | 16 ++++++ .../type-tests/published/tsconfig.native.json | 4 ++ 17 files changed, 277 insertions(+), 12 deletions(-) create mode 100644 .changepacks/changepack_log_metro_types.json create mode 100644 .changepacks/changepack_log_react_native_types.json create mode 100644 packages/metro-plugin/src/types.ts create mode 100644 packages/react/src/native/types.d.ts create mode 100644 packages/react/type-tests/native/app.tsx create mode 100644 packages/react/type-tests/native/tsconfig.json create mode 100644 packages/react/type-tests/published/native.tsx create mode 100644 packages/react/type-tests/published/tsconfig.native.json diff --git a/.changepacks/changepack_log_metro_types.json b/.changepacks/changepack_log_metro_types.json new file mode 100644 index 000000000..f255a5bc0 --- /dev/null +++ b/.changepacks/changepack_log_metro_types.json @@ -0,0 +1,7 @@ +{ + "changes": { + "packages/metro-plugin/package.json": "Patch" + }, + "note": "Write `df/theme.d.ts` (the tokens of devup.json) and `df/native.d.ts` (React Native props for each component) when Metro reads the config, with a `distDir` option, as the web plugins do.", + "date": "2026-11-21T00:00:00.000Z" +} diff --git a/.changepacks/changepack_log_react_native_types.json b/.changepacks/changepack_log_react_native_types.json new file mode 100644 index 000000000..ac8e96aa9 --- /dev/null +++ b/.changepacks/changepack_log_react_native_types.json @@ -0,0 +1,7 @@ +{ + "changes": { + "packages/react/package.json": "Patch" + }, + "note": "Add `@devup-ui/react/native/types`, which types each component as the React Native component it renders (`Box` takes `ViewProps`, `Button` takes `PressableProps`, ...) through the new `DevupElementProps` augmentation point. Web types are unchanged.", + "date": "2026-11-21T00:00:00.000Z" +} diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 9cade6c4a..1c506448b 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -17,6 +17,7 @@ on: - feat/react-native-states - feat/react-native-animations - feat/react-native-compat + - feat/react-native-web # Pull requests and every job below run read-only. Only the `release` and # `deploy-pages` jobs get write permissions, and they run on pushes to main @@ -930,7 +931,7 @@ jobs: fi files="$(git diff --name-only "$(git merge-base "$BASE" HEAD)" HEAD)" echo "$files" - if grep -qE '^(libs/extractor/src/native/|libs/binding/|bindings/devup-ui-(binding|wasm)/|packages/(metro-plugin|plugin-utils)/|packages/react/src/native/|packages/react/src/utils/(theme-context|with-theme).|apps/expo/|\.github/workflows/publish\.yml$)' <<< "$files"; then + if grep -qE '^(libs/extractor/src/native/|libs/binding/|bindings/devup-ui-(binding|wasm)/|packages/(metro-plugin|plugin-utils)/|packages/react/src/(native|types)/|packages/react/src/utils/(theme-context|with-theme).|apps/expo/|\.github/workflows/publish\.yml$)' <<< "$files"; then echo "changed=true" >> "$GITHUB_OUTPUT" else echo "changed=false" >> "$GITHUB_OUTPUT" @@ -965,6 +966,10 @@ jobs: - name: Check the bundles working-directory: apps/expo run: bun run check + # Metro wrote df/theme.d.ts and df/native.d.ts when it read the config + - name: Type-check the app against the theme and React Native props + working-directory: apps/expo + run: bun run typecheck - *record-playwright-revisions - *restore-playwright-cache - *install-chromium diff --git a/apps/expo/package.json b/apps/expo/package.json index 04463f3bc..0f4dea58c 100644 --- a/apps/expo/package.json +++ b/apps/expo/package.json @@ -7,7 +7,8 @@ "start": "expo start", "export": "expo export --platform ios --platform android --platform web --no-bytecode --source-maps", "check": "node check-bundle.mjs", - "check:web": "node check-web.mjs" + "check:web": "node check-web.mjs", + "typecheck": "bun ../../node_modules/@typescript/native/bin/tsc --noEmit" }, "dependencies": { "@devup-ui/react": "workspace:^", diff --git a/packages/metro-plugin/README.md b/packages/metro-plugin/README.md index 8a42d85f3..fda3842db 100644 --- a/packages/metro-plugin/README.md +++ b/packages/metro-plugin/README.md @@ -67,6 +67,8 @@ withDevupUI(config, { package: '@devup-ui/react', // devup.json, from the project root. Default: 'devup.json' devupFile: 'devup.json', + // Where the theme and React Native types are written. Default: 'df' + distDir: 'df', // Packages in node_modules that ship uncompiled Devup UI. Default: [] include: [], // Whether styles that need the React Native runtime may import it. @@ -80,6 +82,24 @@ withDevupUI(config, { }) ``` +## TypeScript + +When Metro reads the config, the plugin writes two declaration files into +`df` (the `distDir` option), which ignores itself in git: + +- `theme.d.ts`: the tokens of devup.json, as the web plugins write them, so + `bg="$primary"` and `typography="title"` complete and check. +- `native.d.ts`: it imports `@devup-ui/react/native/types`, so each + component takes the props of the React Native component it renders: + `Box`, `Flex`, `VStack`, `Center` and `Grid` take `View`'s (`onLayout`, + `testID`, ...), `Text` takes `Text`'s, `Image` takes `Image`'s, `Input` takes + `TextInput`'s (`onChangeText`, ...) and `Button` takes `Pressable`'s + (`onPress`, ...). Each also takes `className`, for `css()`. HTML props that + React Native lacks, such as `href` or `onInput`, become type errors. + +A tsconfig that names its files (`include`) must list `df/*.d.ts`. Expo's +default tsconfig includes every file of the project. + ## Themes `$` tokens of devup.json (colors, `length` and `shadow`) and `typography` diff --git a/packages/metro-plugin/src/__tests__/plugin.test.ts b/packages/metro-plugin/src/__tests__/plugin.test.ts index 55ecaa4e4..f8fbee424 100644 --- a/packages/metro-plugin/src/__tests__/plugin.test.ts +++ b/packages/metro-plugin/src/__tests__/plugin.test.ts @@ -1,8 +1,24 @@ -import { mkdirSync, mkdtempSync, rmSync, writeFileSync } from 'node:fs' +import { + existsSync, + mkdirSync, + mkdtempSync, + readFileSync, + rmSync, + writeFileSync, +} from 'node:fs' import { tmpdir } from 'node:os' import { dirname, join } from 'node:path' -import { afterEach, beforeEach, describe, expect, it, spyOn } from 'bun:test' +import * as pluginUtils from '@devup-ui/plugin-utils' +import { + afterEach, + beforeEach, + describe, + expect, + it, + type Mock, + spyOn, +} from 'bun:test' import { REANIMATED_PACKAGE, @@ -11,17 +27,22 @@ import { withDevupUI, } from '../plugin' import { readSettings, SETTINGS_ENV } from '../settings' +import { NATIVE_TYPES } from '../types' +const wasm = pluginUtils.loadCompiler('wasm') let root: string let previous: string | undefined +let selection: Mock beforeEach(() => { root = mkdtempSync(join(tmpdir(), 'devup-metro-plugin-')) previous = process.env[SETTINGS_ENV] delete process.env[SETTINGS_ENV] + selection = spyOn(pluginUtils, 'loadCompiler').mockReturnValue(wasm) }) afterEach(() => { + selection.mockRestore() rmSync(root, { recursive: true, force: true }) if (previous === undefined) delete process.env[SETTINGS_ENV] else process.env[SETTINGS_ENV] = previous @@ -106,6 +127,35 @@ describe('withDevupUI', () => { devupFile: join(root, 'theme', 'devup.json'), engine: 'wasm', }) + expect(selection.mock.calls).toEqual([['wasm']]) + }) + + it('writes the types of the theme and of React Native into df', () => { + write( + 'devup.json', + JSON.stringify({ theme: { colors: { default: { primary: '#000' } } } }), + ) + withDevupUI({ + projectRoot: root, + transformer: { babelTransformerPath: '/up.js' }, + }) + expect(readFileSync(join(root, 'df', 'theme.d.ts'), 'utf-8')).toContain( + 'primary', + ) + expect(readFileSync(join(root, 'df', 'native.d.ts'), 'utf-8')).toBe( + NATIVE_TYPES, + ) + expect(readFileSync(join(root, 'df', '.gitignore'), 'utf-8')).toBe('*') + }) + + it('writes the types into the distDir option', () => { + withDevupUI( + { projectRoot: root, transformer: { babelTransformerPath: '/up.js' } }, + { distDir: 'types/devup' }, + ) + expect(existsSync(join(root, 'types', 'devup', 'theme.d.ts'))).toBe(true) + expect(existsSync(join(root, 'types', 'devup', 'native.d.ts'))).toBe(true) + expect(existsSync(join(root, 'df'))).toBe(false) }) it('resolves the upstreamTransformer option from the project root', () => { diff --git a/packages/metro-plugin/src/plugin.ts b/packages/metro-plugin/src/plugin.ts index 062ea148e..70bac22e6 100644 --- a/packages/metro-plugin/src/plugin.ts +++ b/packages/metro-plugin/src/plugin.ts @@ -13,6 +13,7 @@ import { readSettings, writeSettings, } from './settings' +import { writeTypes } from './types' export interface DevupUIMetroPluginOptions { /** @@ -24,6 +25,12 @@ export interface DevupUIMetroPluginOptions { package?: string /** Path of devup.json, from the project root. Defaults to `devup.json`. */ devupFile?: string + /** + * Where the TypeScript declarations are written, from the project root: + * the theme's tokens and the React Native props of each component. + * Defaults to `df`, as in the other plugins. + */ + distDir?: string /** * Packages in `node_modules` whose files are compiled as well: a library * that ships Devup UI components uncompiled. Each name matches that whole @@ -127,7 +134,8 @@ function upstreamTransformer( * Compile Devup UI for React Native in Metro: the config's Babel transformer * becomes Devup UI's, which compiles each file that imports Devup UI and then * hands the code to the transformer the config had (Expo's or React - * Native's). + * Native's). The TypeScript declarations of the theme and of the React Native + * props are written into `distDir`. * * ```js * // metro.config.js @@ -159,6 +167,12 @@ export function withDevupUI( engine: options.engine, } writeSettings(settings) + writeTypes({ + distDir: resolve(projectRoot, options.distDir ?? 'df'), + devupFile: settings.devupFile, + package: settings.package, + engine: settings.engine, + }) return { ...config, transformer: { diff --git a/packages/metro-plugin/src/types.ts b/packages/metro-plugin/src/types.ts new file mode 100644 index 000000000..3013e8349 --- /dev/null +++ b/packages/metro-plugin/src/types.ts @@ -0,0 +1,44 @@ +import { mkdirSync, writeFileSync } from 'node:fs' +import { join } from 'node:path' + +import { + createThemeInterfaceArgs, + type DevupEngine, + loadCompiler, + loadDevupConfigSync, +} from '@devup-ui/plugin-utils' + +/** + * `native.d.ts`: it imports the declarations that type each component of + * `@devup-ui/react` as the React Native component it renders + */ +export const NATIVE_TYPES = "import '@devup-ui/react/native/types'\n" + +/** What the types of a project are written from */ +export interface TypesOptions { + /** The directory written, absolute */ + readonly distDir: string + /** devup.json, absolute */ + readonly devupFile: string + /** The package Devup UI is imported from */ + readonly package: string + readonly engine?: DevupEngine +} + +/** + * Write the TypeScript declarations of the project into `distDir`, as the web + * plugins do: `theme.d.ts`, the tokens of devup.json, and `native.d.ts`, which + * types the components for React Native. The directory ignores itself in git. + */ +export function writeTypes(options: TypesOptions): void { + const compiler = loadCompiler(options.engine) + compiler.registerTheme(loadDevupConfigSync(options.devupFile).theme ?? {}) + mkdirSync(options.distDir, { recursive: true }) + writeFileSync(join(options.distDir, '.gitignore'), '*', 'utf-8') + writeFileSync( + join(options.distDir, 'theme.d.ts'), + compiler.getThemeInterface(...createThemeInterfaceArgs(options.package)), + 'utf-8', + ) + writeFileSync(join(options.distDir, 'native.d.ts'), NATIVE_TYPES, 'utf-8') +} diff --git a/packages/react/package.json b/packages/react/package.json index 0c045735e..b71f42b00 100644 --- a/packages/react/package.json +++ b/packages/react/package.json @@ -21,8 +21,8 @@ "scripts": { "lint": "eslint && bun ../../node_modules/@typescript/native/bin/tsc --noEmit && bun run test:types", "build": "bun run test:types && bun ../../node_modules/@typescript/native/bin/tsc && vite build && rollup -c rollup.types.config.mjs && bun run test:published-types", - "test:types": "bun ../../node_modules/@typescript/native/bin/tsc -p type-tests/tsconfig.json", - "test:published-types": "bun ../../node_modules/@typescript/native/bin/tsc -p type-tests/published/tsconfig.bundler.json && bun ../../node_modules/@typescript/native/bin/tsc -p type-tests/published/tsconfig.node16.json" + "test:types": "bun ../../node_modules/@typescript/native/bin/tsc -p type-tests/tsconfig.json && bun ../../node_modules/@typescript/native/bin/tsc -p type-tests/native/tsconfig.json", + "test:published-types": "bun ../../node_modules/@typescript/native/bin/tsc -p type-tests/published/tsconfig.bundler.json && bun ../../node_modules/@typescript/native/bin/tsc -p type-tests/published/tsconfig.node16.json && bun ../../node_modules/@typescript/native/bin/tsc -p type-tests/published/tsconfig.native.json" }, "publishConfig": { "access": "public" @@ -74,6 +74,9 @@ "types": "./dist/native/index.d.ts", "import": "./dist/native/index.js", "require": "./dist/native/index.cjs" + }, + "./native/types": { + "types": "./dist/native/types.d.ts" } }, "files": [ diff --git a/packages/react/rollup.types.config.mjs b/packages/react/rollup.types.config.mjs index 509834bda..b2bf5b687 100644 --- a/packages/react/rollup.types.config.mjs +++ b/packages/react/rollup.types.config.mjs @@ -19,8 +19,8 @@ const entries = { } const shared = '_shared' -/** Declarations written by hand, which ambiently declare modules and stay as they are */ -const ambient = /^compat\/(?!index\.)[^/]+\.d\.ts$/ +/** Declarations written by hand, which declare or augment modules and stay as they are */ +const ambient = /^(compat\/(?!index\.)[^/]+|native\/types)\.d\.ts$/ function files(directory) { return readdirSync(directory, { withFileTypes: true }).flatMap((entry) => { diff --git a/packages/react/src/index.ts b/packages/react/src/index.ts index 1de5d171a..1afc6989f 100644 --- a/packages/react/src/index.ts +++ b/packages/react/src/index.ts @@ -9,7 +9,7 @@ export { Text } from './components/Text' export { ThemeScript } from './components/ThemeScript' export { VStack } from './components/VStack' export { useTheme } from './hooks/use-theme' -export type { DevupProps } from './types/props' +export type { DevupElementProps, DevupProps } from './types/props' export type { ResponsiveValue } from './types/responsive-value' export type { DevupCustomShorthands } from './types/shorthand' export type { DevupTheme } from './types/theme' diff --git a/packages/react/src/native/types.d.ts b/packages/react/src/native/types.d.ts new file mode 100644 index 000000000..eb30b594f --- /dev/null +++ b/packages/react/src/native/types.d.ts @@ -0,0 +1,39 @@ +/** + * Types `@devup-ui/react` for React Native: each component takes the props of + * the React Native component the build renders it as, instead of those of the + * HTML element it renders on the web. `@devup-ui/metro-plugin` imports this + * file from `/native.d.ts`; to opt in by hand, import it from a + * declaration file of the project: + * + * ```ts + * import '@devup-ui/react/native/types' + * ``` + */ +import type { + ImageProps, + PressableProps, + TextInputProps, + TextProps, + ViewProps, +} from 'react-native' + +/** What every element takes besides its component's props */ +interface DevupNativeElementProps { + /** The class of `css()`, whose styles the build gives the element */ + className?: string +} + +declare module '@devup-ui/react' { + interface DevupElementProps { + /** `Box`, `Flex`, `VStack`, `Center` and `Grid`: a `View` */ + div: ViewProps & DevupNativeElementProps + /** `Text`: a `Text` */ + span: TextProps & DevupNativeElementProps + /** `Image`: an `Image` */ + img: ImageProps & DevupNativeElementProps + /** `Input`: a `TextInput` */ + input: TextInputProps & DevupNativeElementProps + /** `Button`: a `Pressable` */ + button: PressableProps & DevupNativeElementProps + } +} diff --git a/packages/react/src/types/props/index.ts b/packages/react/src/types/props/index.ts index c2646b9b5..043bedb09 100644 --- a/packages/react/src/types/props/index.ts +++ b/packages/react/src/types/props/index.ts @@ -63,12 +63,28 @@ type DevupDefaultIntrinsicPropConflicts = | 'width' | keyof DevupCustomShorthands +/** + * The props a component takes, by the HTML element it renders on the web, in + * place of that element's: empty on the web, and filled by + * `@devup-ui/react/native/types` with the props of the React Native component + * each renders on React Native (`div` a `View`, `span` a `Text`, ...). + */ +// biome-ignore lint/suspicious/noEmptyInterface: public module augmentation point for React Native. +// eslint-disable-next-line @typescript-eslint/no-empty-object-type +export interface DevupElementProps {} + +/** The props of the element `T` a component renders */ +export type DevupIntrinsicProps = + T extends keyof DevupElementProps + ? DevupElementProps[T] + : React.ComponentProps + // Component declarations put this overload first for fast resolution and last // so Parameters keeps describing the default element. export type DevupDefaultComponentMergedProps< T extends keyof React.JSX.IntrinsicElements, -> = Omit, DevupDefaultIntrinsicPropConflicts> & { - props?: FilterChildren> +> = Omit, DevupDefaultIntrinsicPropConflicts> & { + props?: FilterChildren> } & DevupComponentProps export type DevupComponentBaseProps = diff --git a/packages/react/type-tests/native/app.tsx b/packages/react/type-tests/native/app.tsx new file mode 100644 index 000000000..118bdb76d --- /dev/null +++ b/packages/react/type-tests/native/app.tsx @@ -0,0 +1,28 @@ +// The components typed for React Native (`@devup-ui/react/native/types`): +// each takes the props of the React Native component it renders, and its +// style props as on the web +import { Box, Button, css, Flex, Image, Input, Text } from '@devup-ui/react' + +export const app = ( + {}} testID="card"> + + {}}> + title + + + text} + secureTextEntry + /> + + + +) + +// @ts-expect-error a View has no href +export const link = +// @ts-expect-error a TextInput reports its text with onChangeText +export const input = {}} /> diff --git a/packages/react/type-tests/native/tsconfig.json b/packages/react/type-tests/native/tsconfig.json new file mode 100644 index 000000000..ecdf8f0c4 --- /dev/null +++ b/packages/react/type-tests/native/tsconfig.json @@ -0,0 +1,11 @@ +{ + "extends": "../tsconfig.json", + "compilerOptions": { + "paths": { + "@devup-ui/react": ["../../src/index.ts"], + "@devup-ui/react/*": ["../../src/*"] + } + }, + "files": ["../../src/native/types.d.ts", "app.tsx"], + "include": [] +} diff --git a/packages/react/type-tests/published/native.tsx b/packages/react/type-tests/published/native.tsx new file mode 100644 index 000000000..a6e001e12 --- /dev/null +++ b/packages/react/type-tests/published/native.tsx @@ -0,0 +1,16 @@ +// Type-checks a React Native project against the published declarations: the +// import `@devup-ui/metro-plugin` writes types each component as the React +// Native component it renders +import '@devup-ui/react/native/types' + +import { Box, Button, Input } from '@devup-ui/react' + +export const app = ( + {}} p={2}> + text} /> + + ) +} +``` + +`css()` takes what it does on the web: objects of style props (with +responsive values, theme tokens and the theme, platform and orientation +blocks), conditions choosing between them, what another `css()` gives, and +CSS text (`` css`padding: 8px; background-color: $primary;` ``, each +interpolation a whole value). The element's style props apply after its +`className`, and its `style` prop last. + +A `css()` whose styles differ by theme, breakpoint or orientation reads the +runtime, so it must be called in a function component or a hook. One that does +not can be called anywhere, such as at the top of the file. These are build +errors: + +- a class name (`className="p-4"`, `css('p-4')`) +- a press style in `css()`: give `_active` to the element itself +- selectors, nesting and at-rules in CSS text + +`css()` gives a style rather than a class on React Native, so pass it to +`className`, not to the `style` of a React Native component, which TypeScript +types as a string. + ## Limits of this version Only styles the build can decide are supported: literals, values read at runtime, theme tokens, responsive values, conditions between them and the -platform, theme and orientation blocks. These are build errors, reported by -Metro at the file, line and column: +platform, theme, orientation and press blocks, and `css()`. These are build +errors, reported by Metro at the file, line and column: - interaction states other than `_active`/`_pressed` (`_hover`, `_focus`, ...) -- `css()`, `styled()`, `globalCss()`, `keyframes()` and `Grid` +- `styled()`, `globalCss()`, `keyframes()` and `Grid` - any prop React Native has no style for - with `runtime: false`, a value that differs by theme or breakpoint, `_theme*` with more than one theme, `_portrait`, `_landscape`, and From d69078d8a39c5d0bc333bb8c76512b5f9a8a1288 Mon Sep 17 00:00:00 2001 From: Jeong Min Oh Date: Thu, 26 Nov 2026 00:27:33 +0900 Subject: [PATCH 33/40] feat(native): responsive values, responsive tokens and orientation on React Native (#1044) * feat(native): responsive values, responsive tokens and orientation on React Native Responsive arrays, length/shadow/typography tokens with a value at each breakpoint, responsive values in platform, theme and orientation blocks and conditions compile to one style object for each run of breakpoints that share their styles (by breakpoint and theme where both differ). The runtime store of @devup-ui/react/native also tells the breakpoint of devup.json the window is at and its orientation through one Dimensions listener that notifies only when a breakpoint is crossed or the window turns. _portrait/_landscape apply by orientation. With runtime: false these stay build errors. Co-Authored-By: Claude Opus 5.5 * fix(verify-dist): give the react-native stand-in Dimensions The React Native runtime now reads the window size through Dimensions. Co-Authored-By: Claude Opus 5.5 --------- Co-authored-by: Claude Opus 5.5 --- ..._log_react_native_breakpoints_runtime.json | 7 + ...hangepack_log_react_native_responsive.json | 8 + .github/workflows/publish.yml | 1 + apps/expo/check-bundle.mjs | 38 +- apps/expo/devup.json | 17 +- apps/expo/src/App.tsx | 60 ++- libs/binding/src/native_theme.rs | 1 + libs/binding/tests/native.rs | 9 + libs/extractor/src/native/element.rs | 349 ++++++++++--- libs/extractor/src/native/errors.rs | 5 +- libs/extractor/src/native/mod.rs | 6 +- libs/extractor/src/native/props.rs | 27 +- ...extractor__native__tests__orientation.snap | 10 +- ...or__native__tests__orientation_blocks.snap | 29 ++ ...tor__native__tests__orientation_value.snap | 6 + ...actor__native__tests__platform_shapes.snap | 1 - .../extractor__native__tests__responsive.snap | 9 +- ...tor__native__tests__responsive_arrays.snap | 98 ++++ ..._tests__responsive_custom_breakpoints.snap | 22 + ...ive__tests__responsive_hooks_in_arrow.snap | 31 ++ ...ative__tests__responsive_in_condition.snap | 10 +- ...ve__tests__responsive_name_collisions.snap | 18 + ...tor__native__tests__responsive_nested.snap | 5 + ...ive__tests__responsive_no_breakpoints.snap | 17 + ...tor__native__tests__responsive_spread.snap | 5 + ...tor__native__tests__responsive_themes.snap | 99 ++++ ...tractor__native__tests__runtime_false.snap | 2 +- ...or__native__tests__runtime_off_arrays.snap | 7 + ...ative__tests__runtime_off_orientation.snap | 6 + ..._tests__runtime_off_responsive_tokens.snap | 6 + ...xtractor__native__tests__runtime_true.snap | 3 +- ...ative__tests__theme_responsive_tokens.snap | 10 +- .../extractor__native__tests__theme_two.snap | 61 ++- ...or__native__tests__theme_typographies.snap | 1 - libs/extractor/src/native/style.rs | 476 ++++++++++++++---- libs/extractor/src/native/tests.rs | 280 ++++++++++- libs/extractor/src/native/theme.rs | 146 ++++-- packages/metro-plugin/README.md | 39 +- .../native/__tests__/index.browser.test.tsx | 122 ++++- packages/react/src/native/index.ts | 88 +++- verify-dist.ts | 2 +- 41 files changed, 1814 insertions(+), 323 deletions(-) create mode 100644 .changepacks/changepack_log_react_native_breakpoints_runtime.json create mode 100644 .changepacks/changepack_log_react_native_responsive.json create mode 100644 libs/extractor/src/native/snapshots/extractor__native__tests__orientation_blocks.snap create mode 100644 libs/extractor/src/native/snapshots/extractor__native__tests__orientation_value.snap create mode 100644 libs/extractor/src/native/snapshots/extractor__native__tests__responsive_arrays.snap create mode 100644 libs/extractor/src/native/snapshots/extractor__native__tests__responsive_custom_breakpoints.snap create mode 100644 libs/extractor/src/native/snapshots/extractor__native__tests__responsive_hooks_in_arrow.snap create mode 100644 libs/extractor/src/native/snapshots/extractor__native__tests__responsive_name_collisions.snap create mode 100644 libs/extractor/src/native/snapshots/extractor__native__tests__responsive_nested.snap create mode 100644 libs/extractor/src/native/snapshots/extractor__native__tests__responsive_no_breakpoints.snap create mode 100644 libs/extractor/src/native/snapshots/extractor__native__tests__responsive_spread.snap create mode 100644 libs/extractor/src/native/snapshots/extractor__native__tests__responsive_themes.snap create mode 100644 libs/extractor/src/native/snapshots/extractor__native__tests__runtime_off_arrays.snap create mode 100644 libs/extractor/src/native/snapshots/extractor__native__tests__runtime_off_orientation.snap create mode 100644 libs/extractor/src/native/snapshots/extractor__native__tests__runtime_off_responsive_tokens.snap diff --git a/.changepacks/changepack_log_react_native_breakpoints_runtime.json b/.changepacks/changepack_log_react_native_breakpoints_runtime.json new file mode 100644 index 000000000..d5a77ade3 --- /dev/null +++ b/.changepacks/changepack_log_react_native_breakpoints_runtime.json @@ -0,0 +1,7 @@ +{ + "changes": { + "packages/react/package.json": "Patch" + }, + "note": "`@devup-ui/react/native` also tells which breakpoint of devup.json the window is at (`useBreakpoint`, `getBreakpoint`) and whether it is in landscape, for responsive values on React Native (part of #411). One `Dimensions` listener is shared by every component, and a component renders again only when the window crosses into another breakpoint or turns, not on every pixel. The runtime is about 630 bytes minified and gzipped.", + "date": "2026-11-21T00:00:00.000Z" +} diff --git a/.changepacks/changepack_log_react_native_responsive.json b/.changepacks/changepack_log_react_native_responsive.json new file mode 100644 index 000000000..38e58c018 --- /dev/null +++ b/.changepacks/changepack_log_react_native_responsive.json @@ -0,0 +1,8 @@ +{ + "changes": { + "bindings/devup-ui-binding/package.json": "Patch", + "bindings/devup-ui-wasm/package.json": "Patch" + }, + "note": "`codeExtractNative` compiles responsive values for React Native (part of #411): responsive arrays (`p={[1, null, 3]}`, `null` keeping the value before as on the web), `length`, `shadow` and `typography` tokens with a value at each breakpoint, responsive values inside `_ios`, `_theme*` and conditions, and `_portrait`/`_landscape`. The breakpoints of devup.json are measured against the window width. The build precomputes one style object for each run of breakpoints that share their styles, only for the styles that differ, and picks one by the breakpoint `useBreakpoint()` of `@devup-ui/react/native` gives (by breakpoint and theme where both differ). A value read at runtime in an array applies from its breakpoint on. With `runtime: false` these are build errors. Web output is unchanged.", + "date": "2026-11-21T00:00:00.000Z" +} diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index c1bd3a86b..1696a4342 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -9,6 +9,7 @@ on: - main - feat/napi-binding - feat/react-native-metro + - feat/react-native-themes # Pull requests and every job below run read-only. Only the `release` and # `deploy-pages` jobs get write permissions, and they run on pushes to main diff --git a/apps/expo/check-bundle.mjs b/apps/expo/check-bundle.mjs index 913534639..445677c7b 100644 --- a/apps/expo/check-bundle.mjs +++ b/apps/expo/check-bundle.mjs @@ -3,14 +3,18 @@ // placeholders of @devup-ui/react or any module of that package but its React // Native runtime (`@devup-ui/react/native`), and the styles of src/App.tsx // must be there as React Native style objects. src/App.tsx reads the theme, -// so it uses the runtime; src/Badge.tsx is styled the same in every theme, so -// it must not. +// the breakpoint and the orientation, so it calls each of those hooks of the +// runtime; src/Badge.tsx is styled the same in every theme and at every +// width, so it must not use the runtime. import { readdirSync, readFileSync } from 'node:fs' import { join } from 'node:path' const PLACEHOLDER = 'Cannot run on the runtime' /** Names of the runtime that only code using it holds, as minified code keeps them */ -const RUNTIME_NAMES = /\b(?:defineThemes|useThemeIndex)\b/g +const RUNTIME_NAMES = + /\b(?:defineThemes|useThemeIndex|useBreakpoint|useLandscape)\b/g +/** The hooks src/App.tsx must call */ +const APP_HOOKS = ['useThemeIndex', 'useBreakpoint', 'useLandscape'] /** Modules of @devup-ui/react, by the path Metro resolves */ const REACT_PACKAGE = /(^|[\\/])(@devup-ui[\\/]react|packages[\\/]react)[\\/]/ /** The React Native runtime among them */ @@ -89,17 +93,19 @@ function mapSources(map) { : map.sources } -/** The sources of the code that names the runtime */ +/** Each name of the runtime, with the sources of the code that names it */ function runtimeUsers(code, locate) { - const users = new Set() + const users = new Map() code.split('\n').forEach((line, index) => { for (const match of line.matchAll(RUNTIME_NAMES)) { - users.add(locate(index, match.index)) + const source = locate(index, match.index) + if (source === null || NATIVE_RUNTIME.test(source)) continue + const sources = users.get(match[0]) ?? new Set() + sources.add(source) + users.set(match[0], sources) } }) - return [...users].filter( - (source) => source !== null && !NATIVE_RUNTIME.test(source), - ) + return users } for (const platform of ['ios', 'android']) { @@ -129,16 +135,22 @@ for (const platform of ['ios', 'android']) { failures.push(`${platform}/${file}: lacks @devup-ui/react/native`) } const users = runtimeUsers(code, sourceLocator(map)) - if (!users.some((source) => /src[\\/]App\.tsx$/.test(source))) { - failures.push(`${platform}/${file}: src/App.tsx does not use the runtime`) + for (const hook of APP_HOOKS) { + const callers = [...(users.get(hook) ?? [])] + if (!callers.some((source) => /src[\\/]App\.tsx$/.test(source))) { + failures.push(`${platform}/${file}: src/App.tsx does not call ${hook}`) + } } - for (const source of users.filter((source) => + const all = [ + ...new Set([...users.values()].flatMap((sources) => [...sources])), + ] + for (const source of all.filter((source) => /src[\\/]Badge\.tsx$/.test(source), )) { failures.push(`${platform}/${file}: ${source} uses the runtime`) } console.info( - `${platform}/${file}: ${sources.length} modules, runtime used by ${users.join(', ')}`, + `${platform}/${file}: ${sources.length} modules, runtime used by ${all.join(', ')}`, ) } } diff --git a/apps/expo/devup.json b/apps/expo/devup.json index a3a26daa2..beff56bfa 100644 --- a/apps/expo/devup.json +++ b/apps/expo/devup.json @@ -20,7 +20,8 @@ }, "length": { "default": { - "radius": ["12px"] + "radius": ["12px"], + "gutter": ["16px", null, "32px"] } }, "shadow": { @@ -29,11 +30,15 @@ } }, "typography": { - "title": { - "fontSize": "24px", - "fontWeight": 700, - "lineHeight": 1.3 - } + "title": [ + { + "fontSize": "24px", + "fontWeight": 700, + "lineHeight": 1.3 + }, + null, + { "fontSize": "32px" } + ] } } } diff --git a/apps/expo/src/App.tsx b/apps/expo/src/App.tsx index 4834b1d6c..02be3958e 100644 --- a/apps/expo/src/App.tsx +++ b/apps/expo/src/App.tsx @@ -24,7 +24,8 @@ export function App() { flexDirection="column" gap={4} justifyContent="center" - p={6} + px="$gutter" + py={[6, null, 10]} > - + Your name @@ -53,28 +61,34 @@ export function App() { {name ? `Hello, ${name}` : 'Type your name'} - - + + + ) } diff --git a/libs/binding/src/native_theme.rs b/libs/binding/src/native_theme.rs index d974d91fa..41d6a2200 100644 --- a/libs/binding/src/native_theme.rs +++ b/libs/binding/src/native_theme.rs @@ -44,6 +44,7 @@ pub fn native_theme(theme: &Theme) -> NativeTheme { .iter() .map(|(name, typography)| (name.clone(), typography_levels(typography))) .collect(), + breakpoints: theme.breakpoints.clone(), } } diff --git a/libs/binding/tests/native.rs b/libs/binding/tests/native.rs index 9c44f4d28..49010502c 100644 --- a/libs/binding/tests/native.rs +++ b/libs/binding/tests/native.rs @@ -159,3 +159,12 @@ fn native_extraction_resolves_the_registered_theme() -> Result<(), String> { assert!(code.contains("backgroundColor: \"#fff\""), "{code}"); Ok(()) } + +#[test] +fn native_theme_keeps_the_breakpoints() { + // The web's breakpoints by default, and those devup.json sets + let default = devup_ui_binding_core::native_theme(&theme("{}")); + let custom = devup_ui_binding_core::native_theme(&theme(r#"{ "breakpoints": [0, 600] }"#)); + assert_eq!(default.breakpoints, [0, 480, 768, 992, 1280, 1600]); + assert_eq!(custom.breakpoints, [0, 600]); +} diff --git a/libs/extractor/src/native/element.rs b/libs/extractor/src/native/element.rs index 36f2a0d08..84bac63a8 100644 --- a/libs/extractor/src/native/element.rs +++ b/libs/extractor/src/native/element.rs @@ -3,12 +3,14 @@ //! component its import is now bound to. use oxc_ast::ast::{ - ArrowFunctionExpression, ExportDefaultDeclaration, Expression, Function, FunctionBody, - IdentifierReference, JSXAttribute, JSXAttributeItem, JSXAttributeName, JSXAttributeValue, - JSXChild, JSXElement, JSXElementName, JSXExpression, LogicalOperator, ObjectExpression, - ObjectPropertyKind, Program, TSType, UnaryOperator, VariableDeclarator, + ArrayExpression, ArrayExpressionElement, ArrowFunctionExpression, ExportDefaultDeclaration, + Expression, Function, FunctionBody, IdentifierReference, JSXAttribute, JSXAttributeItem, + JSXAttributeName, JSXAttributeValue, JSXChild, JSXElement, JSXElementName, JSXExpression, + LogicalOperator, ObjectExpression, ObjectPropertyKind, Program, TSType, UnaryOperator, + VariableDeclarator, }; use std::cell::Cell; +use std::fmt::Write; use oxc_ast_visit::{Visit, walk}; use oxc_semantic::Scoping; @@ -19,10 +21,10 @@ use rustc_hash::{FxHashMap, FxHashSet}; use super::errors::{Problem, RuntimeFeature}; use super::imports::{self, native_component}; -use super::props::{Tokens, declarations, dynamic_keys}; +use super::props::{Declaration, Tokens, declarations, dynamic_keys, literal_levels}; use super::sheet::Sheet; -use super::style::{Choice, in_theme, style_code, themed}; -use super::theme::selector_theme; +use super::style::{Choice, Reads, State, Vars, cascade, in_theme, style_code, varied, when}; +use super::theme::{DEFAULT_BREAKPOINTS, selector_theme}; use super::values::{Literal, NativeValue, ROOT_FONT_SIZE}; use super::{NativePlatform, NativeTarget, REACT_NATIVE, RUNTIME, Replacement}; use crate::component::ExportVariableKind; @@ -39,52 +41,96 @@ pub(super) struct Compiled { struct Runtime { /// The variable holding the index of the theme the app shows index: String, - /// The hook reading that index - hook: String, - hook_used: bool, - /// The component that reads the index itself, for an element outside a + /// The variable holding the breakpoint the window is at + breakpoint: String, + /// The variable holding whether the window is in landscape + landscape: String, + /// The hooks reading each, by what they read + hooks: [String; 3], + /// What the hooks the file calls read + hooks_used: Reads, + /// The component that reads them itself, for an element outside a /// function component wrapper: String, wrapper_used: bool, + /// What the elements rendered through it read + wrapper_reads: Reads, /// The function telling the runtime the theme names define: String, + /// The function telling the runtime the breakpoints + define_breakpoints: String, } +/// The runtime hooks, in the order they are called, by the name they are +/// exported under: they read the theme, the breakpoint and the orientation +const HOOKS: [&str; 3] = ["useThemeIndex", "useBreakpoint", "useLandscape"]; + impl Runtime { fn new(code: &str) -> Self { Self { index: fresh_name("__t", code), - hook: fresh_name("__useThemeIndex", code), - hook_used: false, + breakpoint: fresh_name("__b", code), + landscape: fresh_name("__l", code), + hooks: HOOKS.map(|hook| fresh_name(&format!("__{hook}"), code)), + hooks_used: Reads::default(), wrapper: fresh_name("__Themed", code), wrapper_used: false, + wrapper_reads: Reads::default(), define: fresh_name("__defineThemes", code), + define_breakpoints: fresh_name("__defineBreakpoints", code), + } + } + + /// The variables holding what the runtime tells + fn vars(&self) -> Vars<'_> { + Vars { + theme: &self.index, + breakpoint: &self.breakpoint, + landscape: &self.landscape, } } - /// The import of the runtime and the call telling it the theme names, - /// when the file uses it + /// The variables of `reads`, in the order of the hooks + fn variables(&self, reads: Reads) -> impl Iterator { + [&self.index, &self.breakpoint, &self.landscape] + .into_iter() + .enumerate() + .filter(move |(at, _)| reads.flags()[*at]) + .map(|(at, name)| (at, name.as_str())) + } + + /// The import of the runtime and the calls telling it the theme names + /// and the breakpoints, when the file uses it fn prelude(&self, target: &NativeTarget, theme_api: bool) -> Option { - if !(self.hook_used || self.wrapper_used || theme_api) { + if !(self.hooks_used.any() || self.wrapper_used || theme_api) { return None; } - let mut specifiers = Vec::new(); - if self.hook_used { - specifiers.push(format!("useThemeIndex as {}", self.hook)); - } + let reads = self.hooks_used.union(self.wrapper_reads); + let mut specifiers: Vec = self + .variables(self.hooks_used) + .map(|(at, _)| format!("{} as {}", HOOKS[at], self.hooks[at])) + .collect(); if self.wrapper_used { specifiers.push(format!("Themed as {}", self.wrapper)); } - specifiers.push(format!("defineThemes as {}", self.define)); let theme = &target.theme; - let names = serde_json::Value::from(theme.names.clone()).to_string(); - let dark = theme - .dark - .map_or_else(String::new, |dark| format!(", {dark}")); + let mut calls = String::new(); + if reads.theme || theme_api { + specifiers.push(format!("defineThemes as {}", self.define)); + let names = serde_json::Value::from(theme.names.clone()).to_string(); + let dark = theme + .dark + .map_or_else(String::new, |dark| format!(", {dark}")); + let _ = writeln!(calls, "{}({names}{dark});", self.define); + } + if reads.breakpoint && theme.breakpoints != DEFAULT_BREAKPOINTS { + specifiers.push(format!("defineBreakpoints as {}", self.define_breakpoints)); + let breakpoints = serde_json::Value::from(theme.breakpoints.clone()).to_string(); + let _ = writeln!(calls, "{}({breakpoints});", self.define_breakpoints); + } Some(format!( - "import {{ {} }} from \"{RUNTIME}\";\n{}({names}{dark});\n", - specifiers.join(", "), - self.define + "import {{ {} }} from \"{RUNTIME}\";\n{calls}", + specifiers.join(", ") )) } } @@ -94,8 +140,8 @@ struct Frame { /// Whether it is a function component or a hook, where the hook reading /// the theme can be called first component: bool, - /// Whether an element in it reads the theme - used: bool, + /// What the elements in it read from the runtime + reads: Reads, /// Where the hook is called hook_at: HookAt, } @@ -177,6 +223,9 @@ enum Prop { Platform(NativePlatform), /// `_themeDark` and the like: styles for the theme named Theme(String), + /// `_landscape` (`true`) or `_portrait` (`false`): styles for the + /// orientation of the window + Orientation(bool), /// What needs the React Native runtime Runtime(RuntimeFeature), /// What React Native has no equivalent of @@ -194,7 +243,8 @@ fn classify(name: &str) -> Prop { "_android" => Prop::Platform(NativePlatform::Android), "_web" => Prop::Platform(NativePlatform::Web), "_pressed" | "_active" => Prop::Runtime(RuntimeFeature::Pressed), - "_portrait" | "_landscape" => Prop::Runtime(RuntimeFeature::Responsive), + "_portrait" => Prop::Orientation(false), + "_landscape" => Prop::Orientation(true), "className" => Prop::Unsupported(Problem::new( "React Native has no class names", "write the styles as props, or pass them in `style`", @@ -429,21 +479,26 @@ impl<'a> Elements<'_> { }; self.frames.push(Frame { component, - used: false, + reads: Reads::default(), hook_at, }); visit(self); if let Some(frame) = self.frames.pop() - && frame.used + && frame.reads.any() { - self.call_hook(frame.hook_at); + self.call_hooks(frame.hook_at, frame.reads); } } - /// Call the hook reading the theme at `at` - fn call_hook(&mut self, at: HookAt) { - self.runtime.hook_used = true; - let call = format!("const {} = {}();", self.runtime.index, self.runtime.hook); + /// Call the hooks reading what `reads` names at `at` + fn call_hooks(&mut self, at: HookAt, reads: Reads) { + self.runtime.hooks_used = self.runtime.hooks_used.union(reads); + let calls: Vec = self + .runtime + .variables(reads) + .map(|(hook, variable)| format!("const {variable} = {}();", self.runtime.hooks[hook])) + .collect(); + let call = calls.join(" "); match at { HookAt::Body(at) => self.replacements.push((at, at, format!("\n{call}"))), HookAt::Expression(start, end) => { @@ -455,42 +510,70 @@ impl<'a> Elements<'_> { } /// Whether the element being compiled is in a function component or a - /// hook, which then reads the theme first - fn reads_theme_in_component(&mut self) -> bool { + /// hook, which then calls the hooks reading what `reads` names first + fn read_in_component(&mut self, reads: Reads) -> bool { match self.frames.iter_mut().rev().find(|frame| frame.component) { Some(frame) => { - frame.used = true; + frame.reads = frame.reads.union(reads); true } None => false, } } - /// The styles a style prop declares with a literal: one style object, or - /// one a theme when its tokens differ by theme - fn static_choice(&self, name: &str, literal: &Literal) -> Result { + /// The styles a style prop declares with literals, each from the + /// breakpoint it is paired with on: one style object, or one a + /// breakpoint and a theme where the styles differ by them + fn static_choice(&self, name: &str, items: &[(usize, Literal)]) -> Result { let theme = &self.target.theme; - let indexes = match self.theme_scope { + let themes = match self.theme_scope { Some(index) => index..index + 1, - None if names_tokens(name, literal) => 0..theme.count(), + None if items.iter().any(|(_, literal)| names_tokens(name, literal)) => { + 0..theme.count() + } None => 0..1, }; - let mut variants = Vec::new(); - for index in indexes { - let tokens = Tokens { - theme, - index, - target: self.target, - }; - variants.push(declarations(name, literal, &tokens)?.unwrap_or_default()); - } - let choice = themed(variants); - if choice.reads_theme() && !self.target.runtime { - return Err(RuntimeFeature::Theme.problem(self.target)); + let levels = items + .iter() + .map(|(from, literal)| (from + 1).max(literal_levels(name, literal, theme))) + .fold(1, usize::max) + .min(theme.levels()); + let mut grid = Vec::with_capacity(levels); + for level in 0..levels { + let mut row = Vec::with_capacity(themes.len()); + for index in themes.clone() { + row.push(cell( + name, + items, + &Tokens { + theme, + index, + level, + }, + )?); + } + grid.push(row); } + let choice = varied(grid); + self.check_runtime(&choice)?; Ok(choice) } + /// Fail for a choice the runtime makes when it is turned off + fn check_runtime(&self, choice: &Choice) -> Result<(), Problem> { + let reads = choice.reads(); + let feature = if self.target.runtime { + None + } else if reads.breakpoint { + Some(RuntimeFeature::Responsive) + } else if reads.theme { + Some(RuntimeFeature::Theme) + } else { + None + }; + feature.map_or(Ok(()), |feature| Err(feature.problem(self.target))) + } + /// Compile one Devup UI element fn element(&mut self, element: &JSXElement<'a>, kind: &ExportVariableKind, local: &str) { let opening = &element.opening_element; @@ -580,6 +663,16 @@ impl<'a> Elements<'_> { ); styles.choices.extend(choices); } + Prop::Orientation(landscape) => { + styles.removed.push(span); + let choices = self.orientation_block( + attribute_expression(attribute), + (name, landscape), + attribute.span.start, + local, + ); + styles.choices.extend(choices); + } Prop::Runtime(feature) => self.error( attribute.span.start, feature.problem(self.target).on(local, name), @@ -733,6 +826,30 @@ impl<'a> Elements<'_> { .collect() } + /// The styles of `_landscape` or `_portrait`, `name` being the prop: they + /// apply only while the window is in that orientation + fn orientation_block( + &mut self, + value: Option<&Expression<'a>>, + (name, landscape): (&str, bool), + offset: u32, + local: &str, + ) -> Vec { + if !self.target.runtime { + self.error( + offset, + RuntimeFeature::Orientation + .problem(self.target) + .on(local, name), + ); + return Vec::new(); + } + self.block(value, name, offset, local) + .into_iter() + .map(|choice| when(State::Landscape(landscape), choice)) + .collect() + } + /// The styles of an object of style props fn object_choices(&mut self, object: &ObjectExpression<'a>, local: &str) -> Vec { let mut choices = Vec::new(); @@ -792,6 +909,9 @@ impl<'a> Elements<'_> { Prop::Theme(theme) => { return self.theme_block(Some(value), (key, &theme), offset, local); } + Prop::Orientation(landscape) => { + return self.orientation_block(Some(value), (key, landscape), offset, local); + } Prop::Runtime(feature) => { self.error(offset, feature.problem(self.target).on(local, key)); } @@ -817,7 +937,7 @@ impl<'a> Elements<'_> { match value { Some(JSXAttributeValue::StringLiteral(literal)) => literal.value.as_str().map_or_else( || self.dynamic_choice(name, literal.span.source_text(self.code)), - |text| self.static_choice(name, &Literal::Text(text.to_string())), + |text| self.static_choice(name, &[(0, Literal::Text(text.to_string()))]), ), Some(JSXAttributeValue::ExpressionContainer(container)) => container .expression @@ -839,7 +959,7 @@ impl<'a> Elements<'_> { expression: &Expression<'a>, ) -> Result { if let Some(literal) = literal(expression) { - return self.static_choice(name, &literal); + return self.static_choice(name, &[(0, literal)]); } match expression.without_parentheses() { Expression::NullLiteral(_) | Expression::BooleanLiteral(_) => Ok(Choice::Empty), @@ -858,7 +978,7 @@ impl<'a> Elements<'_> { alternate: Box::new(Choice::Empty), }) } - Expression::ArrayExpression(_) => Err(RuntimeFeature::Responsive.problem(self.target)), + Expression::ArrayExpression(array) => self.responsive_choice(name, array), 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`", @@ -867,6 +987,62 @@ impl<'a> Elements<'_> { } } + /// The styles a responsive array declares: each value from the + /// breakpoint at its index on, as on the web, where `null` and + /// `undefined` keep the value before. Literals compile to one style + /// object a breakpoint; any other value applies from its breakpoint on + fn responsive_choice( + &self, + name: &str, + array: &ArrayExpression<'a>, + ) -> Result { + let last = self.target.theme.levels() - 1; + let mut items = Vec::new(); + for (index, element) in array.elements.iter().enumerate() { + match element.as_expression() { + Some(expression) if !is_empty_value(expression) => { + items.push((index.min(last), expression)); + } + None if matches!(element, ArrayExpressionElement::SpreadElement(_)) => { + return Err(Problem::new( + "the build reads only the values written in a responsive array", + "write each value in the array", + )); + } + _ => {} + } + } + let literals: Option> = items + .iter() + .map(|(level, expression)| literal(expression).map(|literal| (*level, literal))) + .collect(); + if let Some(literals) = literals { + return self.static_choice(name, &literals); + } + if !self.target.runtime { + return Err(RuntimeFeature::Responsive.problem(self.target)); + } + let mut choices = Vec::with_capacity(items.len()); + for (level, expression) in items { + if matches!( + expression.without_parentheses(), + Expression::ArrayExpression(_) + ) { + return Err(Problem::new( + "a responsive array holds one value a breakpoint", + "write each value itself, not an array", + )); + } + let choice = self.expression_choice(name, expression)?; + choices.push(if level == 0 { + choice + } else { + when(State::AtLeast(level), choice) + }); + } + Ok(Choice::All(choices)) + } + /// The styles a style prop declares with the value `code` the element /// reads at runtime fn dynamic_choice(&self, name: &str, code: &str) -> Result { @@ -942,12 +1118,14 @@ impl<'a> Elements<'_> { style, opaque_spread, } = styles; - let style_code = style_code(choices, given, &mut self.sheet, &self.runtime.index); - let wrapped = style_code + let style_code = style_code(choices, given, &mut self.sheet, &self.runtime.vars()); + let reads = style_code .as_ref() - .is_some_and(|style| style.reads_theme && !self.reads_theme_in_component()); + .map_or_else(Reads::default, |style| style.reads); + let wrapped = reads.any() && !self.read_in_component(reads); if wrapped { self.runtime.wrapper_used = true; + self.runtime.wrapper_reads = self.runtime.wrapper_reads.union(reads); let wrapper = self.runtime.wrapper.clone(); self.rename(element, &wrapper); } else if let Some(tag) = &tag { @@ -958,10 +1136,21 @@ impl<'a> Elements<'_> { return; }; let code = if wrapped { + // The wrapper gives the theme, the breakpoint and the orientation, + // in this order: the style takes them up to the last it reads + let read = self.runtime.variables(reads).last().map_or(0, |(at, _)| at); + let parameters = [ + &self.runtime.index, + &self.runtime.breakpoint, + &self.runtime.landscape, + ][..=read] + .iter() + .map(|name| name.as_str()) + .collect::>() + .join(", "); format!( - " $c={{{}}} $s={{({}) => ({})}}", + " $c={{{}}} $s={{({parameters}) => ({})}}", tag.as_deref().unwrap_or(local), - self.runtime.index, style_code.code ) } else { @@ -1085,6 +1274,34 @@ fn literal(expression: &Expression<'_>) -> Option { } } +/// The styles the literals of `items` declare for the style prop `name` at +/// the breakpoint and in the theme of `tokens`: each literal from its +/// breakpoint on, a later one declared after the one before +fn cell( + name: &str, + items: &[(usize, Literal)], + tokens: &Tokens<'_>, +) -> Result, Problem> { + let mut declared = Vec::new(); + for (_, literal) in items.iter().filter(|(from, _)| *from <= tokens.level) { + cascade( + &mut declared, + declarations(name, literal, tokens)?.unwrap_or_default(), + ); + } + Ok(declared) +} + +/// Whether `expression` declares nothing, as `null`, `undefined` and +/// booleans do +fn is_empty_value(expression: &Expression<'_>) -> bool { + match expression.without_parentheses() { + Expression::NullLiteral(_) | Expression::BooleanLiteral(_) => true, + Expression::Identifier(identifier) => identifier.name == "undefined", + _ => false, + } +} + /// Whether the styles of `literal` for the style prop `name` may differ by /// theme: a typography, or a value naming a `$token` fn names_tokens(name: &str, literal: &Literal) -> bool { diff --git a/libs/extractor/src/native/errors.rs b/libs/extractor/src/native/errors.rs index 6e21074b3..31259ea32 100644 --- a/libs/extractor/src/native/errors.rs +++ b/libs/extractor/src/native/errors.rs @@ -39,6 +39,7 @@ impl Problem { #[derive(Debug, Clone, Copy, PartialEq, Eq)] pub(super) enum RuntimeFeature { Responsive, + Orientation, Theme, Pressed, } @@ -47,6 +48,7 @@ impl RuntimeFeature { const fn what(self) -> &'static str { match self { Self::Responsive => "a responsive value is chosen by the window width", + Self::Orientation => "an orientation style is chosen by the orientation of the window", 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", } @@ -54,7 +56,8 @@ impl RuntimeFeature { const fn fix(self) -> &'static str { match self { - Self::Responsive => "give one value", + Self::Responsive => "give one value, or turn the runtime on", + Self::Orientation => "remove it, or turn the runtime on", Self::Theme => "give the value for one theme, or turn the runtime on", Self::Pressed => { "pass a function to the `style` of a React Native `Pressable`, reading `pressed`" diff --git a/libs/extractor/src/native/mod.rs b/libs/extractor/src/native/mod.rs index 68911d456..e578e65a8 100644 --- a/libs/extractor/src/native/mod.rs +++ b/libs/extractor/src/native/mod.rs @@ -9,8 +9,10 @@ //! platform blocks `_ios`, `_android` and `_web`, and theme tokens when the //! theme has one value for them. A value that differs by theme compiles to //! one style object a theme, and the element picks one by the index the -//! runtime of `@devup-ui/react/native` gives. Responsive arrays and -//! `_pressed` need a runtime that this version does not include, and a prop +//! runtime of `@devup-ui/react/native` gives; a responsive value compiles to +//! one style object a run of breakpoints, picked by the breakpoint the +//! runtime gives, and `_portrait`/`_landscape` apply by its orientation. +//! `_pressed` needs 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; diff --git a/libs/extractor/src/native/props.rs b/libs/extractor/src/native/props.rs index 6d0eceb1a..ca966cebd 100644 --- a/libs/extractor/src/native/props.rs +++ b/libs/extractor/src/native/props.rs @@ -11,7 +11,6 @@ use phf::phf_map; use crate::extract_style::constant::is_maintain_value_property; -use super::NativeTarget; use super::errors::Problem; use super::theme::NativeTheme; use super::values::{ @@ -238,14 +237,16 @@ fn check_text(text: &str) -> Result<(), Problem> { /// compiled with pub(super) struct Tokens<'t> { pub theme: &'t NativeTheme, + /// The index of the theme pub index: usize, - pub target: &'t NativeTarget, + /// The breakpoint + pub level: usize, } impl Tokens<'_> { /// `text` with its tokens resolved, or `None` when the theme lacks one fn resolve<'v>(&self, text: &'v str) -> Result>, Problem> { - self.theme.resolve(text, self.index, self.target) + self.theme.resolve(text, (self.index, self.level)) } } @@ -274,6 +275,16 @@ pub(super) fn declarations( Ok(Some(declarations)) } +/// How many breakpoints the styles of the style prop `prop` with the value +/// `literal` tell apart through the responsive tokens or typography it names +pub(super) fn literal_levels(prop: &str, literal: &Literal, theme: &NativeTheme) -> usize { + match literal { + Literal::Text(text) if prop == "typography" => theme.typography_levels(text), + Literal::Text(text) => theme.token_levels(text), + Literal::Number(_) => 1, + } +} + /// `literal` as text fn literal_text(literal: &Literal) -> Cow<'_, str> { match literal { @@ -287,20 +298,20 @@ fn literal_text(literal: &Literal) -> Cow<'_, str> { /// multiplied by it, as React Native reads both in pixels fn typography(name: &str, tokens: &Tokens<'_>) -> Result>, Problem> { let mut properties = Vec::new(); - for (property, value) in tokens.theme.typography(name, tokens.target)? { - let Some(value) = tokens.resolve(value)? else { + for (property, value) in tokens.theme.typography(name, tokens.level)? { + let Some(value) = tokens.resolve(&value)?.map(Cow::into_owned) else { return Ok(None); }; check_text(&value)?; - properties.push((property.as_str(), value.into_owned())); + properties.push((property, value)); } let font_size = properties .iter() - .find(|(property, _)| *property == "font-size") + .find(|(property, _)| property == "font-size") .and_then(|(_, value)| scaled_length(value.trim()).or_else(|| number(value))); let mut declarations = Vec::new(); for (property, value) in &properties { - match *property { + match property.as_str() { "line-height" | "letter-spacing" => { declarations.extend(relative_to_font(property, value, font_size)?); } diff --git a/libs/extractor/src/native/snapshots/extractor__native__tests__orientation.snap b/libs/extractor/src/native/snapshots/extractor__native__tests__orientation.snap index 4b19decba..c9626a9d3 100644 --- a/libs/extractor/src/native/snapshots/extractor__native__tests__orientation.snap +++ b/libs/extractor/src/native/snapshots/extractor__native__tests__orientation.snap @@ -2,5 +2,11 @@ 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 +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 { Themed as __Themed } from "@devup-ui/react/native"; +import { StyleSheet } from "react-native"; +const __s = StyleSheet.create({ + a: { padding: 4 }, + b: { padding: 8 } +}); +<__Themed $c={Box} $s={(__t, __b, __l) => [!__l && __s.a, __l && __s.b]} />; diff --git a/libs/extractor/src/native/snapshots/extractor__native__tests__orientation_blocks.snap b/libs/extractor/src/native/snapshots/extractor__native__tests__orientation_blocks.snap new file mode 100644 index 000000000..d939c9b22 --- /dev/null +++ b/libs/extractor/src/native/snapshots/extractor__native__tests__orientation_blocks.snap @@ -0,0 +1,29 @@ +--- +source: libs/extractor/src/native/tests.rs +expression: "compile_themed(two_themes(), 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 { useBreakpoint as __useBreakpoint, useLandscape as __useLandscape } from "@devup-ui/react/native"; +import { StyleSheet } from "react-native"; +const __s = StyleSheet.create({ + a: { flexDirection: "row" }, + b: { flexDirection: "column" }, + c: { padding: 4 }, + d: { padding: 8 }, + e: { padding: 12 }, + f: { padding: 16 }, + g: { margin: 4 } +}); +export function Screen({ on }) { + const __b = __useBreakpoint(); + const __l = __useLandscape(); + return + + ; +} diff --git a/libs/extractor/src/native/snapshots/extractor__native__tests__orientation_value.snap b/libs/extractor/src/native/snapshots/extractor__native__tests__orientation_value.snap new file mode 100644 index 000000000..0c621a572 --- /dev/null +++ b/libs/extractor/src/native/snapshots/extractor__native__tests__orientation_value.snap @@ -0,0 +1,6 @@ +--- +source: libs/extractor/src/native/tests.rs +expression: "compile_themed(two_themes(), true, code)" +--- +error: test.tsx:2:6: `` cannot use `_landscape` on React Native: `_landscape` takes an object of styles. Fix: write the styles in an object, such as `_landscape={{ p: 2 }}` +test.tsx:2:34: `` cannot use `p` on React Native: a style prop takes one value, not an object. Fix: give one value, or use a platform block such as `_ios` 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 index 0d58afdd6..725ae4af6 100644 --- a/libs/extractor/src/native/snapshots/extractor__native__tests__platform_shapes.snap +++ b/libs/extractor/src/native/snapshots/extractor__native__tests__platform_shapes.snap @@ -10,4 +10,3 @@ test.tsx:2:63: `` cannot use `_hover` on React Native: React Native has no 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: `_web` 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 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__responsive.snap b/libs/extractor/src/native/snapshots/extractor__native__tests__responsive.snap index 8ca40cd95..7ef5c17bd 100644 --- a/libs/extractor/src/native/snapshots/extractor__native__tests__responsive.snap +++ b/libs/extractor/src/native/snapshots/extractor__native__tests__responsive.snap @@ -2,4 +2,11 @@ source: libs/extractor/src/native/tests.rs expression: compile(code) --- -error: test.tsx:2:6: `` cannot use `p` 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 +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 { Themed as __Themed } from "@devup-ui/react/native"; +import { StyleSheet } from "react-native"; +const __s = StyleSheet.create({ + a: { padding: 4 }, + b: { padding: 8 } +}); +<__Themed $c={Box} $s={(__t, __b) => __b < 1 ? __s.a : __s.b} />; diff --git a/libs/extractor/src/native/snapshots/extractor__native__tests__responsive_arrays.snap b/libs/extractor/src/native/snapshots/extractor__native__tests__responsive_arrays.snap new file mode 100644 index 000000000..5c5841189 --- /dev/null +++ b/libs/extractor/src/native/snapshots/extractor__native__tests__responsive_arrays.snap @@ -0,0 +1,98 @@ +--- +source: libs/extractor/src/native/tests.rs +expression: "compile_themed(two_themes(), 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 { useBreakpoint as __useBreakpoint } from "@devup-ui/react/native"; +import { StyleSheet } from "react-native"; +const __s = StyleSheet.create({ + a: { margin: 8 }, + b: { padding: 4 }, + c: { padding: 12 }, + d: { padding: 8 }, + e: { padding: 16 }, + f: { padding: 20 }, + g: { padding: 32 }, + h: { + padding: 8, + width: "50%" + }, + i: { backgroundColor: "red" }, + j: { + marginVertical: 1, + marginHorizontal: 2, + paddingVertical: 1, + paddingHorizontal: 2 + }, + k: { + margin: 3, + paddingVertical: 1, + paddingHorizontal: 2 + }, + l: { + margin: 3, + paddingVertical: 3, + paddingHorizontal: 4 + }, + m: { margin: 4 }, + n: { + padding: 16, + margin: 8 + }, + o: { + padding: 4, + margin: 12, + gap: 4 + }, + p: { + padding: 8, + margin: 12, + gap: 8 + }, + q: { + padding: 8, + margin: 16, + gap: 8 + }, + r: { + paddingTop: 12, + paddingBottom: 12 + }, + s: { + paddingLeft: 4, + paddingRight: 4 + }, + t: { + paddingLeft: 8, + paddingRight: 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; +}; +export function Layout({ on, x }) { + const __b = __useBreakpoint(); + return + + + + + = 1 && __s.d]} /> + = 2 && __s.c, + on && __s.m, + __b >= 1 && { margin: __u(x, 4) } + ]} /> + + + + + + + + = 1 && __s.d] : __s.c, __s.b]} /> + ; +} diff --git a/libs/extractor/src/native/snapshots/extractor__native__tests__responsive_custom_breakpoints.snap b/libs/extractor/src/native/snapshots/extractor__native__tests__responsive_custom_breakpoints.snap new file mode 100644 index 000000000..7f2e12013 --- /dev/null +++ b/libs/extractor/src/native/snapshots/extractor__native__tests__responsive_custom_breakpoints.snap @@ -0,0 +1,22 @@ +--- +source: libs/extractor/src/native/tests.rs +expression: "compile_themed(theme, 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 { useThemeIndex as __useThemeIndex, useBreakpoint as __useBreakpoint, Themed as __Themed, defineThemes as __defineThemes, defineBreakpoints as __defineBreakpoints } from "@devup-ui/react/native"; +__defineThemes(["light", "dark"], 1); +__defineBreakpoints([0, 600]); +import { StyleSheet } from "react-native"; +const __s = StyleSheet.create({ + a: { margin: 4 }, + b: { margin: 6 }, + c: { padding: 4 }, + d: { padding: 12 }, + e: { padding: 8 } +}); +export const A = () => { + const __t = __useThemeIndex(); + const __b = __useBreakpoint(); + return ; +}; +export const b = <__Themed $c={Box} $s={(__t, __b) => __b < 1 ? __s.c : __s.e} />; diff --git a/libs/extractor/src/native/snapshots/extractor__native__tests__responsive_hooks_in_arrow.snap b/libs/extractor/src/native/snapshots/extractor__native__tests__responsive_hooks_in_arrow.snap new file mode 100644 index 000000000..862ae770b --- /dev/null +++ b/libs/extractor/src/native/snapshots/extractor__native__tests__responsive_hooks_in_arrow.snap @@ -0,0 +1,31 @@ +--- +source: libs/extractor/src/native/tests.rs +expression: "compile_themed(two_themes(), 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 { useThemeIndex as __useThemeIndex, useBreakpoint as __useBreakpoint, useLandscape as __useLandscape, Themed as __Themed, defineThemes as __defineThemes } from "@devup-ui/react/native"; +__defineThemes(["light", "dark"], 1); +import { StyleSheet } from "react-native"; +const __s = StyleSheet.create({ + a: { backgroundColor: "#5a44ff" }, + b: { backgroundColor: "#8c7bff" }, + c: { padding: 4 }, + d: { padding: 8 }, + e: { margin: 4 } +}); +export const A = () => { + const __t = __useThemeIndex(); + const __b = __useBreakpoint(); + const __l = __useLandscape(); + return ; +}; +export const B = () => { + const __l = __useLandscape(); + return ; +}; +export const c = <__Themed $c={Box} $s={(__t, __b, __l) => [__b < 1 ? __s.c : __s.d, __l && __s.e]} />; +export const d = <__Themed $c={Box} $s={(__t, __b) => [[__s.a, __s.b][__t], __b < 1 ? __s.c : __s.d]} />; diff --git a/libs/extractor/src/native/snapshots/extractor__native__tests__responsive_in_condition.snap b/libs/extractor/src/native/snapshots/extractor__native__tests__responsive_in_condition.snap index 8ca40cd95..80de23140 100644 --- a/libs/extractor/src/native/snapshots/extractor__native__tests__responsive_in_condition.snap +++ b/libs/extractor/src/native/snapshots/extractor__native__tests__responsive_in_condition.snap @@ -2,4 +2,12 @@ source: libs/extractor/src/native/tests.rs expression: compile(code) --- -error: test.tsx:2:6: `` cannot use `p` 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 +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 { Themed as __Themed } from "@devup-ui/react/native"; +import { StyleSheet } from "react-native"; +const __s = StyleSheet.create({ + a: { padding: 4 }, + b: { padding: 8 }, + c: { padding: 12 } +}); +<__Themed $c={Box} $s={(__t, __b) => on ? __b < 1 ? __s.a : __s.b : __s.c} />; diff --git a/libs/extractor/src/native/snapshots/extractor__native__tests__responsive_name_collisions.snap b/libs/extractor/src/native/snapshots/extractor__native__tests__responsive_name_collisions.snap new file mode 100644 index 000000000..1e32b3aef --- /dev/null +++ b/libs/extractor/src/native/snapshots/extractor__native__tests__responsive_name_collisions.snap @@ -0,0 +1,18 @@ +--- +source: libs/extractor/src/native/tests.rs +expression: "compile_themed(two_themes(), 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 { useBreakpoint as __useBreakpoint_, useLandscape as __useLandscape_ } from "@devup-ui/react/native"; +import { StyleSheet } from "react-native"; +const __s = StyleSheet.create({ + a: { padding: 4 }, + b: { padding: 8 }, + c: { margin: 4 } +}); +const __b = 1, __l = 2, __useBreakpoint = 3, __useLandscape = 4; +export const A = () => { + const __b_ = __useBreakpoint_(); + const __l_ = __useLandscape_(); + return ; +}; diff --git a/libs/extractor/src/native/snapshots/extractor__native__tests__responsive_nested.snap b/libs/extractor/src/native/snapshots/extractor__native__tests__responsive_nested.snap new file mode 100644 index 000000000..9fc3450e8 --- /dev/null +++ b/libs/extractor/src/native/snapshots/extractor__native__tests__responsive_nested.snap @@ -0,0 +1,5 @@ +--- +source: libs/extractor/src/native/tests.rs +expression: "compile_themed(two_themes(), true, code)" +--- +error: test.tsx:2:6: `` cannot use `p` on React Native: a responsive array holds one value a breakpoint. Fix: write each value itself, not an array diff --git a/libs/extractor/src/native/snapshots/extractor__native__tests__responsive_no_breakpoints.snap b/libs/extractor/src/native/snapshots/extractor__native__tests__responsive_no_breakpoints.snap new file mode 100644 index 000000000..d239d9ff0 --- /dev/null +++ b/libs/extractor/src/native/snapshots/extractor__native__tests__responsive_no_breakpoints.snap @@ -0,0 +1,17 @@ +--- +source: libs/extractor/src/native/tests.rs +expression: "compile_themed(theme, 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 { useThemeIndex as __useThemeIndex, defineThemes as __defineThemes } from "@devup-ui/react/native"; +__defineThemes(["light", "dark"], 1); +import { StyleSheet } from "react-native"; +const __s = StyleSheet.create({ + a: { padding: 12 }, + b: { margin: 4 }, + c: { margin: 6 } +}); +export const A = () => { + const __t = __useThemeIndex(); + return ; +}; diff --git a/libs/extractor/src/native/snapshots/extractor__native__tests__responsive_spread.snap b/libs/extractor/src/native/snapshots/extractor__native__tests__responsive_spread.snap new file mode 100644 index 000000000..4c3bcc5e2 --- /dev/null +++ b/libs/extractor/src/native/snapshots/extractor__native__tests__responsive_spread.snap @@ -0,0 +1,5 @@ +--- +source: libs/extractor/src/native/tests.rs +expression: "compile_themed(two_themes(), true, code)" +--- +error: test.tsx:2:6: `` cannot use `p` on React Native: the build reads only the values written in a responsive array. Fix: write each value in the array diff --git a/libs/extractor/src/native/snapshots/extractor__native__tests__responsive_themes.snap b/libs/extractor/src/native/snapshots/extractor__native__tests__responsive_themes.snap new file mode 100644 index 000000000..4b4b74e10 --- /dev/null +++ b/libs/extractor/src/native/snapshots/extractor__native__tests__responsive_themes.snap @@ -0,0 +1,99 @@ +--- +source: libs/extractor/src/native/tests.rs +expression: "compile_themed(theme, 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 { useThemeIndex as __useThemeIndex, useBreakpoint as __useBreakpoint, useLandscape as __useLandscape, defineThemes as __defineThemes } from "@devup-ui/react/native"; +__defineThemes(["light", "dark"], 1); +import { StyleSheet } from "react-native"; +const __s = StyleSheet.create({ + a: { borderColor: "#5a44ff" }, + b: { borderColor: "#8c7bff" }, + c: { margin: 4 }, + d: { margin: 8 }, + e: { + backgroundColor: "#5a44ff", + padding: 4 + }, + f: { + backgroundColor: "#8c7bff", + padding: 6 + }, + g: { + backgroundColor: "#111", + padding: 4 + }, + h: { + backgroundColor: "#eee", + padding: 6 + }, + i: { + backgroundColor: "#111", + padding: 8 + }, + j: { + backgroundColor: "#eee", + padding: 12 + }, + k: { color: "#111" }, + l: { color: "#eee" }, + m: { fontSize: 24 }, + n: { fontSize: 32 }, + o: { fontFamily: "Inter" }, + p: { + fontSize: 12, + lineHeight: 18 + }, + q: { + fontSize: 14, + lineHeight: 21 + }, + r: { + fontSize: 40, + lineHeight: 60 + }, + s: { + fontFamily: "Inter", + fontWeight: "500", + lineHeight: 24, + letterSpacing: -.32 + }, + t: { fontSize: 16 }, + u: { backgroundColor: "#8c7bff" }, + v: { padding: 4 }, + w: { padding: 8 }, + x: { margin: 2 }, + y: { padding: 6 }, + z: { backgroundColor: "#5a44ff" }, + aa: { backgroundColor: "red" }, + ab: { backgroundColor: "#111" }, + ac: { backgroundColor: "#eee" }, + ad: { borderStyle: "solid" }, + ae: { borderWidth: 1 }, + af: { borderWidth: 2 }, + ag: { padding: 12 } +}); +export function Card({ on }) { + const __t = __useThemeIndex(); + const __b = __useBreakpoint(); + const __l = __useLandscape(); + return + + + + + = 1 && __s.x, __b < 2 ? [__s.v, __s.y][__t] : __s.v]} /> + + + + + ; +} diff --git a/libs/extractor/src/native/snapshots/extractor__native__tests__runtime_false.snap b/libs/extractor/src/native/snapshots/extractor__native__tests__runtime_false.snap index ec6bc54a4..9dc9cebe4 100644 --- a/libs/extractor/src/native/snapshots/extractor__native__tests__runtime_false.snap +++ b/libs/extractor/src/native/snapshots/extractor__native__tests__runtime_false.snap @@ -2,6 +2,6 @@ source: libs/extractor/src/native/tests.rs expression: "compile_for(NativePlatform::Ios, runtime, &code)" --- -error: test.tsx:2:6: `` cannot use `p` on React Native: a responsive value is chosen by the window width, which needs the React Native runtime that `runtime: false` turns off. Fix: give one value +error: test.tsx:2:6: `` cannot use `p` on React Native: a responsive value is chosen by the window width, which needs the React Native runtime that `runtime: false` turns off. Fix: give one value, or turn the runtime on test.tsx:2:17: `` cannot use `_themeDark` on React Native: devup.json defines no `dark` theme. Fix: add the theme to devup.json, or remove the block test.tsx:2:33: `` cannot use `_pressed` on React Native: a press style is chosen while the element is pressed, which needs the React Native runtime that `runtime: false` turns off. Fix: pass a function to the `style` of a React Native `Pressable`, reading `pressed` diff --git a/libs/extractor/src/native/snapshots/extractor__native__tests__runtime_off_arrays.snap b/libs/extractor/src/native/snapshots/extractor__native__tests__runtime_off_arrays.snap new file mode 100644 index 000000000..0baeb4e15 --- /dev/null +++ b/libs/extractor/src/native/snapshots/extractor__native__tests__runtime_off_arrays.snap @@ -0,0 +1,7 @@ +--- +source: libs/extractor/src/native/tests.rs +expression: "compile_themed(one_theme(), false, code)" +--- +error: test.tsx:2:6: `` cannot use `p` on React Native: a responsive value is chosen by the window width, which needs the React Native runtime that `runtime: false` turns off. Fix: give one value, or turn the runtime on +test.tsx:3:6: `` cannot use `p` on React Native: a responsive value is chosen by the window width, which needs the React Native runtime that `runtime: false` turns off. Fix: give one value, or turn the runtime on +test.tsx:4:25: `` cannot use `w` on React Native: a responsive value is chosen by the window width, which needs the React Native runtime that `runtime: false` turns off. Fix: give one value, or turn the runtime on diff --git a/libs/extractor/src/native/snapshots/extractor__native__tests__runtime_off_orientation.snap b/libs/extractor/src/native/snapshots/extractor__native__tests__runtime_off_orientation.snap new file mode 100644 index 000000000..4294c17ed --- /dev/null +++ b/libs/extractor/src/native/snapshots/extractor__native__tests__runtime_off_orientation.snap @@ -0,0 +1,6 @@ +--- +source: libs/extractor/src/native/tests.rs +expression: "compile_themed(one_theme(), false, code)" +--- +error: test.tsx:2:6: `` cannot use `_landscape` on React Native: an orientation style is chosen by the orientation of the window, which needs the React Native runtime that `runtime: false` turns off. Fix: remove it, or turn the runtime on +test.tsx:2:28: `` cannot use `_portrait` on React Native: an orientation style is chosen by the orientation of the window, which needs the React Native runtime that `runtime: false` turns off. Fix: remove it, or turn the runtime on diff --git a/libs/extractor/src/native/snapshots/extractor__native__tests__runtime_off_responsive_tokens.snap b/libs/extractor/src/native/snapshots/extractor__native__tests__runtime_off_responsive_tokens.snap new file mode 100644 index 000000000..26dcc8b86 --- /dev/null +++ b/libs/extractor/src/native/snapshots/extractor__native__tests__runtime_off_responsive_tokens.snap @@ -0,0 +1,6 @@ +--- +source: libs/extractor/src/native/tests.rs +expression: "compile_themed(one_theme(), false, code)" +--- +error: test.tsx:2:6: `` cannot use `p` on React Native: a responsive value is chosen by the window width, which needs the React Native runtime that `runtime: false` turns off. Fix: give one value, or turn the runtime on +test.tsx:3:7: `` cannot use `typography` on React Native: a responsive value is chosen by the window width, which needs the React Native runtime that `runtime: false` turns off. Fix: give one value, or turn the runtime on diff --git a/libs/extractor/src/native/snapshots/extractor__native__tests__runtime_true.snap b/libs/extractor/src/native/snapshots/extractor__native__tests__runtime_true.snap index 441bb88d5..7b1927f74 100644 --- a/libs/extractor/src/native/snapshots/extractor__native__tests__runtime_true.snap +++ b/libs/extractor/src/native/snapshots/extractor__native__tests__runtime_true.snap @@ -2,6 +2,5 @@ source: libs/extractor/src/native/tests.rs expression: "compile_for(NativePlatform::Ios, runtime, &code)" --- -error: test.tsx:2:6: `` cannot use `p` 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:17: `` cannot use `_themeDark` on React Native: devup.json defines no `dark` theme. Fix: add the theme to devup.json, or remove the block +error: test.tsx:2:17: `` cannot use `_themeDark` on React Native: devup.json defines no `dark` theme. Fix: add the theme to devup.json, or remove the block test.tsx:2:33: `` 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` diff --git a/libs/extractor/src/native/snapshots/extractor__native__tests__theme_responsive_tokens.snap b/libs/extractor/src/native/snapshots/extractor__native__tests__theme_responsive_tokens.snap index ee9541720..2e4b87ae3 100644 --- a/libs/extractor/src/native/snapshots/extractor__native__tests__theme_responsive_tokens.snap +++ b/libs/extractor/src/native/snapshots/extractor__native__tests__theme_responsive_tokens.snap @@ -2,4 +2,12 @@ source: libs/extractor/src/native/tests.rs expression: "compile_themed(two_themes(), true, code)" --- -error: test.tsx:2:6: `` cannot use `p` on React Native: `gutter` has a value at each breakpoint: a responsive value is chosen by the window width, which needs the React Native runtime that this version does not include yet. Fix: give it one value in devup.json, or write the value itself +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 { Themed as __Themed } from "@devup-ui/react/native"; +import { StyleSheet } from "react-native"; +const __s = StyleSheet.create({ + a: { margin: 2 }, + b: { padding: 4 }, + c: { padding: 8 } +}); +<__Themed $c={Box} $s={(__t, __b) => [__s.a, __b < 2 ? __s.b : __s.c]} />; diff --git a/libs/extractor/src/native/snapshots/extractor__native__tests__theme_two.snap b/libs/extractor/src/native/snapshots/extractor__native__tests__theme_two.snap index 559ed4ebb..78a879126 100644 --- a/libs/extractor/src/native/snapshots/extractor__native__tests__theme_two.snap +++ b/libs/extractor/src/native/snapshots/extractor__native__tests__theme_two.snap @@ -33,40 +33,36 @@ const __s = StyleSheet.create({ h: { color: "#eee" }, i: { color: "red" }, j: { - fontSize: 12, - lineHeight: 18, letterSpacing: 1, textTransform: "uppercase" }, k: { - fontSize: 14, - lineHeight: 21, - letterSpacing: 1, - textTransform: "uppercase" + fontSize: 12, + lineHeight: 18 }, - l: { borderColor: "#eef" }, - m: { borderColor: "#223" }, - n: { - borderWidth: 1, - borderStyle: "solid", - borderColor: "#5a44ff" + l: { + fontSize: 14, + lineHeight: 21 }, + m: { borderColor: "#eef" }, + n: { borderColor: "#223" }, o: { borderWidth: 1, - borderStyle: "solid", - borderColor: "#8c7bff" + borderStyle: "solid" }, - p: { margin: 8 }, - q: { opacity: .5 }, - r: { padding: 4 }, - s: { padding: 8 }, - t: { + p: { borderColor: "#5a44ff" }, + q: { borderColor: "#8c7bff" }, + r: { margin: 8 }, + s: { opacity: .5 }, + t: { padding: 4 }, + u: { padding: 8 }, + v: { backgroundColor: "#5a44ff", margin: 4 }, - u: { color: "#000" }, - v: { fontFamily: "#000" }, - w: { margin: 4 } + w: { color: "#000" }, + x: { fontFamily: "#000" }, + y: { margin: 4 } }); export function Card({ on, color }) { const __t = __useThemeIndex(); @@ -74,19 +70,20 @@ export function Card({ on, color }) { Hi - - - - + + + + ; } diff --git a/libs/extractor/src/native/snapshots/extractor__native__tests__theme_typographies.snap b/libs/extractor/src/native/snapshots/extractor__native__tests__theme_typographies.snap index 8d134d650..efb66b50f 100644 --- a/libs/extractor/src/native/snapshots/extractor__native__tests__theme_typographies.snap +++ b/libs/extractor/src/native/snapshots/extractor__native__tests__theme_typographies.snap @@ -3,7 +3,6 @@ source: libs/extractor/src/native/tests.rs expression: "compile_themed(two_themes(), true, code)" --- error: test.tsx:2:7: `` cannot use `typography` on React Native: devup.json defines no `missing` typography. Fix: add the typography to the theme in devup.json -test.tsx:3:7: `` cannot use `typography` on React Native: `heading` has a value at each breakpoint: a responsive value is chosen by the window width, which needs the React Native runtime that this version does not include yet. Fix: give it one value in devup.json, or write the value itself test.tsx:4:7: `` cannot use `typography` on React Native: the build reads the styles of a typography by its name, which a value read at runtime does not give. Fix: write the name, or a condition between names such as `typography={big ? 'h1' : 'body'}` test.tsx:5:7: `` cannot use `typography` on React Native: `2em` is relative to the font size, and the typography has no font size in pixels. Fix: give the typography a `fontSize` in pixels, or the value in pixels test.tsx:6:7: `` cannot use `typography` on React Native: devup.json defines no `1` typography. Fix: add the typography to the theme in devup.json diff --git a/libs/extractor/src/native/style.rs b/libs/extractor/src/native/style.rs index f6e48f5ea..26e71d31d 100644 --- a/libs/extractor/src/native/style.rs +++ b/libs/extractor/src/native/style.rs @@ -4,6 +4,22 @@ use super::props::Declaration; use super::sheet::Sheet; +/// The styles of a value at each breakpoint, each with the styles in each +/// theme: `grid[level][theme]`. A breakpoint past the last takes the styles of +/// the last, and a row of one theme holds the styles of every theme +pub(super) type Grid = Vec>>; + +/// What a choice applies only while it holds +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +pub(super) enum State { + /// The theme at this index shows + Theme(usize), + /// The window is at this breakpoint or a wider one + AtLeast(usize), + /// The window is in landscape (`true`) or portrait (`false`) orientation + Landscape(bool), +} + /// The styles one prop declares #[derive(Debug, Clone, PartialEq)] pub(super) enum Choice { @@ -20,24 +36,74 @@ pub(super) enum Choice { consequent: Box, alternate: Box, }, - /// Styles the build knows for each theme, in the order of the theme - /// names; the element picks one by the theme the app shows - Themed(Vec>), - /// A choice that applies only while the theme at `index` shows - InTheme { index: usize, choice: Box }, + /// Styles the build knows for each breakpoint and theme; the element + /// picks one by the breakpoint and the theme the app shows + Varied(Grid), + /// A choice that applies only while `state` holds + When { state: State, choice: Box }, + /// Choices applied one after the other + All(Vec), } -/// The choice of `variants`, one a theme: static when every theme declares -/// the same styles -pub(super) fn themed(mut variants: Vec>) -> Choice { - if variants.windows(2).all(|pair| pair[0] == pair[1]) { - variants - .pop() - .filter(|declarations| !declarations.is_empty()) - .map_or(Choice::Empty, Choice::Static) - } else { - Choice::Themed(variants) +/// What the runtime tells a style: which theme shows, which breakpoint the +/// window is at, and whether it is in landscape +#[derive(Debug, Clone, Copy, Default, PartialEq, Eq)] +pub(super) struct Reads { + pub theme: bool, + pub breakpoint: bool, + pub landscape: bool, +} + +impl Reads { + pub(super) const fn any(self) -> bool { + self.theme || self.breakpoint || self.landscape + } + + /// What it reads, in the order of the runtime's hooks + pub(super) const fn flags(self) -> [bool; 3] { + [self.theme, self.breakpoint, self.landscape] + } + + pub(super) const fn union(self, other: Self) -> Self { + Self { + theme: self.theme || other.theme, + breakpoint: self.breakpoint || other.breakpoint, + landscape: self.landscape || other.landscape, + } + } +} + +/// The names of the variables holding what the runtime tells +pub(super) struct Vars<'v> { + pub theme: &'v str, + pub breakpoint: &'v str, + pub landscape: &'v str, +} + +/// The choice of `grid`, as small as it can be: the last breakpoints that +/// repeat the one before dropped, one theme when every theme declares the +/// same, static with one breakpoint and one theme +pub(super) fn varied(mut grid: Grid) -> Choice { + if grid.iter().flatten().all(Vec::is_empty) { + return Choice::Empty; + } + while grid.len() > 1 && grid[grid.len() - 1] == grid[grid.len() - 2] { + grid.pop(); } + if grid + .iter() + .all(|row| row.windows(2).all(|pair| pair[0] == pair[1])) + { + for row in &mut grid { + row.truncate(1); + } + } + if let [row] = grid.as_mut_slice() + && let [declarations] = row.as_mut_slice() + { + return Choice::Static(std::mem::take(declarations)); + } + Choice::Varied(grid) } /// `choice` applied only while the theme at `index` of `count` shows @@ -45,32 +111,60 @@ pub(super) fn in_theme(index: usize, count: usize, choice: Choice) -> Choice { match choice { Choice::Empty => Choice::Empty, choice if count <= 1 => choice, - Choice::Static(declarations) => Choice::Themed( - (0..count) - .map(|at| { - if at == index { - declarations.clone() - } else { - Vec::new() - } + Choice::Static(declarations) => { + in_theme(index, count, Choice::Varied(vec![vec![declarations]])) + } + Choice::Varied(grid) => varied( + grid.into_iter() + .map(|row| { + (0..count) + .map(|at| { + if at == index { + cell(&row, at).clone() + } else { + Vec::new() + } + }) + .collect() }) .collect(), ), - Choice::Themed(mut variants) => { - for (at, variant) in variants.iter_mut().enumerate() { - if at != index { - variant.clear(); - } - } - Choice::Themed(variants) - } - choice => Choice::InTheme { - index, + choice => when(State::Theme(index), choice), + } +} + +/// `choice` applied only while `state` holds +pub(super) fn when(state: State, choice: Choice) -> Choice { + match choice { + Choice::Empty => Choice::Empty, + // A block in a block of the same state, such as `_landscape` in + // `_landscape`, holds while the outer one does + Choice::When { + state: inner, + choice, + } if inner == state => Choice::When { state, choice }, + choice => Choice::When { + state, choice: Box::new(choice), }, } } +/// The styles of `row` in the theme at `theme` +const fn cell(row: &[Vec], theme: usize) -> &Vec { + &row[if row.len() == 1 { 0 } else { theme }] +} + +/// The styles of `grid` at the breakpoint `level` in the theme at `theme` +fn grid_cell(grid: &Grid, level: usize, theme: usize) -> &Vec { + cell(&grid[level.min(grid.len() - 1)], theme) +} + +/// How many themes a row of `grid` holds +fn themes_of(grid: &Grid) -> usize { + grid.iter().map(Vec::len).max().unwrap_or(1) +} + impl Choice { /// Whether the choice declares the React Native style `key` fn declares(&self, key: &str) -> bool { @@ -83,29 +177,38 @@ impl Choice { alternate, .. } => consequent.declares(key) || alternate.declares(key), - Self::Themed(variants) => variants + Self::Varied(grid) => grid .iter() + .flatten() .any(|declarations| declares(declarations, key)), - Self::InTheme { choice, .. } => choice.declares(key), + Self::When { choice, .. } => choice.declares(key), + Self::All(choices) => choices.iter().any(|choice| choice.declares(key)), } } - /// Whether the choice reads the theme the app shows - pub(super) fn reads_theme(&self) -> bool { + /// What the choice reads from the runtime + pub(super) fn reads(&self) -> Reads { match self { - Self::Empty | Self::Static(_) | Self::Dynamic(_) => false, + Self::Empty | Self::Static(_) | Self::Dynamic(_) => Reads::default(), Self::Condition { consequent, alternate, .. - } => consequent.reads_theme() || alternate.reads_theme(), - Self::Themed(_) | Self::InTheme { .. } => true, + } => consequent.reads().union(alternate.reads()), + Self::Varied(grid) => Reads { + theme: themes_of(grid) > 1, + breakpoint: grid.len() > 1, + landscape: false, + }, + Self::When { state, choice } => choice.reads().union(state.reads()), + Self::All(choices) => choices.iter().fold(Reads::default(), |reads, choice| { + reads.union(choice.reads()) + }), } } - /// The code of the choice, its static styles named in `sheet` and the - /// index of the theme read from `theme` - fn code(&self, sheet: &mut Sheet, theme: &str) -> String { + /// The code of the choice, its static styles named in `sheet` + fn code(&self, sheet: &mut Sheet, vars: &Vars<'_>) -> String { match self { Self::Empty => "null".to_string(), Self::Static(declarations) => sheet.reference(declarations), @@ -118,48 +221,181 @@ impl Choice { let test = operand(test); match alternate.as_ref() { Self::Empty => { - format!("{test} && {}", consequent.operand_code(sheet, theme)) + format!("{test} && {}", consequent.operand_code(sheet, vars)) } alternate => format!( "{test} ? {} : {}", - consequent.operand_code(sheet, theme), - alternate.operand_code(sheet, theme) + consequent.operand_code(sheet, vars), + alternate.operand_code(sheet, vars) ), } } - Self::Themed(variants) => { - let references: Vec = variants + Self::Varied(grid) => { + let parts = split(grid); + let codes: Vec = parts .iter() - .map(|declarations| { - if declarations.is_empty() { - "null".to_string() - } else { - sheet.reference(declarations) - } + .map(|part| match part { + Self::Varied(grid) => grid_code(grid, sheet, vars), + part => part.code(sheet, vars), }) .collect(); - format!("[{}][{theme}]", references.join(", ")) + if codes.len() == 1 { + codes.concat() + } else { + format!("[{}]", codes.join(", ")) + } } - Self::InTheme { index, choice } => { + Self::When { state, choice } => { format!( - "{theme} === {index} && {}", - choice.operand_code(sheet, theme) + "{} && {}", + state.test(vars), + choice.operand_code(sheet, vars) ) } + Self::All(choices) => { + let codes: Vec = choices + .iter() + .map(|choice| choice.code(sheet, vars)) + .collect(); + format!("[{}]", codes.join(", ")) + } } } /// The code of the choice as an operand of a condition - fn operand_code(&self, sheet: &mut Sheet, theme: &str) -> String { - let code = self.code(sheet, theme); - if matches!(self, Self::Condition { .. } | Self::InTheme { .. }) { - format!("({code})") - } else { + fn operand_code(&self, sheet: &mut Sheet, vars: &Vars<'_>) -> String { + let code = self.code(sheet, vars); + let compound = match self { + Self::Condition { .. } | Self::When { .. } => true, + Self::Varied(grid) => grid.len() > 1, + _ => false, + }; + if compound { format!("({code})") } else { code } + } +} + +impl State { + const fn reads(self) -> Reads { + Reads { + theme: matches!(self, Self::Theme(_)), + breakpoint: matches!(self, Self::AtLeast(_)), + landscape: matches!(self, Self::Landscape(_)), + } + } + + /// The code testing that the state holds + fn test(self, vars: &Vars<'_>) -> String { + match self { + Self::Theme(index) => format!("{} === {index}", vars.theme), + Self::AtLeast(level) => format!("{} >= {level}", vars.breakpoint), + Self::Landscape(true) => vars.landscape.to_string(), + Self::Landscape(false) => format!("!{}", vars.landscape), + } + } +} + +/// The parts of `grid` by what their styles differ by: the styles every +/// breakpoint and theme share, those that differ only by theme, only by +/// breakpoint, and by both, so a style object is repeated only for what +/// differs +fn split(grid: &Grid) -> Vec { + let mut keys: Vec<&str> = Vec::new(); + for (key, _) in grid.iter().flatten().flatten() { + if !keys.contains(&key.as_str()) { + keys.push(key); + } + } + let themes = themes_of(grid); + let mut groups: [Vec<&str>; 4] = Default::default(); + for key in keys { + let by_theme = grid.iter().any(|row| { + (1..themes).any(|theme| value(cell(row, theme), key) != value(cell(row, 0), key)) + }); + let by_breakpoint = (0..themes).any(|theme| { + (1..grid.len()).any(|level| { + value(grid_cell(grid, level, theme), key) != value(grid_cell(grid, 0, theme), key) + }) + }); + groups[usize::from(by_theme) + 2 * usize::from(by_breakpoint)].push(key); + } + groups + .iter() + .filter(|keys| !keys.is_empty()) + .map(|keys| varied(project(grid, keys))) + .collect() +} + +/// The value of `key` in `declarations` +fn value<'d>(declarations: &'d [Declaration], key: &str) -> Option<&'d Declaration> { + declarations.iter().find(|(name, _)| name == key) +} + +/// `grid` with only the styles of `keys` +fn project(grid: &Grid, keys: &[&str]) -> Grid { + grid.iter() + .map(|row| { + row.iter() + .map(|declarations| { + declarations + .iter() + .filter(|(key, _)| keys.contains(&key.as_str())) + .cloned() + .collect() + }) + .collect() + }) + .collect() +} + +/// The code picking the style object of `grid` by breakpoint and theme: a +/// condition on the breakpoint for each run of breakpoints that share their +/// styles, each picking by theme where the themes differ +fn grid_code(grid: &Grid, sheet: &mut Sheet, vars: &Vars<'_>) -> String { + let mut runs: Vec<(usize, &Vec>)> = Vec::new(); + for (level, row) in grid.iter().enumerate() { + if runs.last().is_none_or(|(_, last)| *last != row) { + runs.push((level, row)); + } + } + let codes: Vec = runs + .iter() + .map(|(_, row)| row_code(row, sheet, vars)) + .collect(); + match (runs.as_slice(), codes.as_slice()) { + ([_, (start, _)], [first, second]) if first == "null" => { + format!("{} >= {start} && {second}", vars.breakpoint) + } + _ => { + let mut code = codes.last().cloned().unwrap_or_default(); + for index in (0..runs.len() - 1).rev() { + code = format!( + "{} < {} ? {} : {code}", + vars.breakpoint, + runs[index + 1].0, + codes[index] + ); + } code } } } +/// The code picking the style object of `row` by theme +fn row_code(row: &[Vec], sheet: &mut Sheet, vars: &Vars<'_>) -> String { + let mut reference = |declarations: &Vec| { + if declarations.is_empty() { + "null".to_string() + } else { + sheet.reference(declarations) + } + }; + if row.windows(2).all(|pair| pair[0] == pair[1]) { + return reference(&row[0]); + } + let references: Vec = row.iter().map(reference).collect(); + format!("[{}][{}]", references.join(", "), vars.theme) +} + fn declares(declarations: &[Declaration], key: &str) -> bool { declarations.iter().any(|(name, _)| name == key) } @@ -195,36 +431,88 @@ fn merge(declarations: &mut Vec, later: Vec) { } } +/// `declarations` of a narrower breakpoint with `later` of a wider one +/// declared after them, as a media query declares them on the web: a later +/// shorthand also replaces the longhands it covers, which React Native would +/// otherwise prefer whatever their order +pub(super) fn cascade(declarations: &mut Vec, later: Vec) { + declarations.retain(|(key, _)| !later.iter().any(|(shorthand, _)| covers(shorthand, key))); + merge(declarations, later); +} + +/// Whether React Native prefers the style `longhand` over `shorthand`, which +/// sets it too +fn covers(shorthand: &str, longhand: &str) -> bool { + let sides = |base: &str, sides: &[&str]| { + longhand + .strip_prefix(base) + .is_some_and(|side| sides.contains(&side)) + }; + match shorthand { + "margin" | "padding" => longhand != shorthand && longhand.starts_with(shorthand), + "inset" => { + longhand != shorthand + && (longhand.starts_with(shorthand) + || matches!(longhand, "top" | "right" | "bottom" | "left")) + } + "marginVertical" => sides("margin", &["Top", "Bottom"]), + "paddingVertical" => sides("padding", &["Top", "Bottom"]), + "marginHorizontal" => sides("margin", &["Left", "Right", "Start", "End"]), + "paddingHorizontal" => sides("padding", &["Left", "Right", "Start", "End"]), + "gap" => matches!(longhand, "rowGap" | "columnGap"), + "borderWidth" | "borderColor" | "borderRadius" => { + longhand != shorthand + && longhand.starts_with("border") + && longhand.ends_with(&shorthand["border".len()..]) + } + _ => false, + } +} + /// `later` merged into the last of `rest` when both are static or both -/// differ by theme, else `later` itself to apply after it +/// differ by breakpoint or theme, else `later` itself to apply after it fn merge_last(rest: &mut [Choice], later: Choice) -> Option { match (rest.last_mut(), later) { (Some(Choice::Static(last)), Choice::Static(declarations)) => { merge(last, declarations); None } - (Some(Choice::Themed(last)), Choice::Static(declarations)) => { - for variant in last { - merge(variant, declarations.clone()); + (Some(Choice::Varied(last)), Choice::Static(declarations)) => { + for cell in last.iter_mut().flatten() { + merge(cell, declarations.clone()); } None } - (Some(Choice::Themed(last)), Choice::Themed(variants)) => { - for (variant, later) in last.iter_mut().zip(variants) { - merge(variant, later); - } + (Some(Choice::Varied(last)), Choice::Varied(grid)) => { + *last = merge_grids(last, &grid); None } (_, later) => Some(later), } } +/// `later` declared after `earlier`, at every breakpoint and theme of either +fn merge_grids(earlier: &Grid, later: &Grid) -> Grid { + let themes = themes_of(earlier).max(themes_of(later)); + (0..earlier.len().max(later.len())) + .map(|level| { + (0..themes) + .map(|theme| { + let mut declarations = grid_cell(earlier, level, theme).clone(); + merge(&mut declarations, grid_cell(later, level, theme).clone()); + declarations + }) + .collect() + }) + .collect() +} + /// The choices of an element in the order they apply, with as many static /// styles as can be moved first merged into one fn ordered(choices: Vec) -> Vec { let mut first = Vec::new(); let mut rest: Vec = Vec::new(); - for choice in choices { + for choice in flattened(choices) { match choice { Choice::Empty => {} Choice::Static(declarations) @@ -243,36 +531,56 @@ fn ordered(choices: Vec) -> Vec { if !first.is_empty() { rest.insert(0, Choice::Static(first)); } - // A later style can make every theme declare the same + // A later style can make every breakpoint or theme declare the same, and + // what differs splits from what does not rest.into_iter() - .map(|choice| match choice { - Choice::Themed(variants) => themed(variants), - choice => choice, + .flat_map(|choice| match choice { + Choice::Varied(grid) => match varied(grid) { + Choice::Varied(grid) => split(&grid), + choice => vec![choice], + }, + choice => vec![choice], }) + .filter(|choice| *choice != Choice::Empty) .collect() } -/// The `style` an element takes, and whether it reads the theme the app shows +/// `choices` with the choices of each `All` in its place +fn flattened(choices: Vec) -> Vec { + choices + .into_iter() + .flat_map(|choice| match choice { + Choice::All(choices) => flattened(choices), + choice => vec![choice], + }) + .collect() +} + +/// The `style` an element takes, and what it reads from the runtime pub(super) struct StyleCode { pub code: String, - pub reads_theme: bool, + pub reads: Reads, } /// The code of the `style` an element takes: its choices, then the code of /// the styles it is given whole (a spread's `style`, its own `style` prop); -/// `None` when its props declare no style, and it keeps what it is given. -/// The index of the theme the app shows is read from `theme` +/// `None` when its props declare no style, and it keeps what it is given pub(super) fn style_code( choices: Vec, given: Vec, sheet: &mut Sheet, - theme: &str, + vars: &Vars<'_>, ) -> Option { let choices = ordered(choices); - let reads_theme = choices.iter().any(Choice::reads_theme); + let reads = choices.iter().fold(Reads::default(), |reads, choice| { + reads.union(choice.reads()) + }); let mut entries: Vec = choices .iter() - .map(|choice| choice.code(sheet, theme)) + .map(|choice| match choice { + Choice::Varied(grid) => grid_code(grid, sheet, vars), + choice => choice.code(sheet, vars), + }) .collect(); if entries.is_empty() { return None; @@ -283,5 +591,5 @@ pub(super) fn style_code( } else { format!("[{}]", entries.join(", ")) }; - Some(StyleCode { code, reads_theme }) + Some(StyleCode { code, reads }) } diff --git a/libs/extractor/src/native/tests.rs b/libs/extractor/src/native/tests.rs index ee1c164f3..3665d9263 100644 --- a/libs/extractor/src/native/tests.rs +++ b/libs/extractor/src/native/tests.rs @@ -5,11 +5,17 @@ use super::element::units_declaration; use super::errors::{Problem, RuntimeFeature}; use super::props::Declaration; use super::sheet::{Sheet, key_name}; -use super::style::{Choice, in_theme, style_code, themed}; +use super::style::{Choice, State, Vars, cascade, in_theme, style_code, varied, when}; use super::values::{Literal, NativeValue, css_text, number_or_text, quoted_list}; use super::{NativePlatform, NativeTarget, NativeTheme, TokenLevels, TypographyProperties}; use crate::{ExtractOption, ExtractTarget, extract, extract_without_source_map}; +const VARS: Vars<'static> = Vars { + theme: "t", + breakpoint: "b", + landscape: "l", +}; + const IMPORT: &str = "import { Box, Button, Center, Flex, Image, Input, Text, VStack } from '@devup-ui/react'\n"; @@ -429,7 +435,7 @@ fn style_code_orders_and_merges_choices() { ], vec!["given".to_string()], &mut sheet, - "t", + &VARS, ) .map(|style| style.code); assert_eq!( @@ -447,7 +453,7 @@ fn style_code_orders_and_merges_choices() { vec![Choice::Empty], vec!["given".to_string()], &mut sheet, - "t" + &VARS ) .is_none() ); @@ -606,6 +612,7 @@ fn theme(names: &[&str], dark: Option, tokens: &[(&str, &[Option<&str>])] .into_iter() .map(|(name, levels)| (name.to_string(), levels)) .collect(), + ..NativeTheme::default() } } @@ -862,10 +869,10 @@ fn names_selector_themes(#[case] prop: &str, #[case] expected: &str) { #[test] fn themed_choices_collapse_when_every_theme_agrees() { let red = declarations(&[("opacity", 1.0)]); - assert_eq!(themed(vec![]), Choice::Empty); - assert_eq!(themed(vec![vec![], vec![]]), Choice::Empty); + assert_eq!(varied(vec![vec![]]), Choice::Empty); + assert_eq!(varied(vec![vec![vec![], vec![]]]), Choice::Empty); assert_eq!( - themed(vec![red.clone(), red.clone()]), + varied(vec![vec![red.clone(), red.clone()]]), Choice::Static(red.clone()) ); assert_eq!( @@ -875,6 +882,265 @@ fn themed_choices_collapse_when_every_theme_agrees() { assert_eq!(in_theme(1, 2, Choice::Empty), Choice::Empty); assert_eq!( in_theme(1, 2, Choice::Static(red.clone())), - Choice::Themed(vec![vec![], red]) + Choice::Varied(vec![vec![vec![], red]]) + ); +} + +const RESPONSIVE_ELEMENTS: &str = r#"export function Layout({ on, x }) { + return ( + + + + + + + + + + + + + + + + + ) +}"#; + +const ORIENTATION_ELEMENTS: &str = r"export function Screen({ on }) { + return ( + + + + ) +}"; + +#[rstest] +#[case::responsive("responsive_arrays", RESPONSIVE_ELEMENTS)] +#[case::orientation("orientation_blocks", ORIENTATION_ELEMENTS)] +#[case::hooks_in_arrow( + "responsive_hooks_in_arrow", + "export const A = () => ;\nexport const B = () => ;\nexport const c = ;\nexport const d = " +)] +#[case::name_collisions( + "responsive_name_collisions", + "const __b = 1, __l = 2, __useBreakpoint = 3, __useLandscape = 4;\nexport const A = () => " +)] +fn compiles_responsive(#[case] name: &str, #[case] code: &str) { + assert_snapshot!(name, compile_themed(two_themes(), true, code)); +} + +/// Token values at each breakpoint +fn levels(values: &[Option<&str>]) -> TokenLevels { + values + .iter() + .map(|value| value.map(str::to_string)) + .collect() +} + +/// Two themes whose tokens and typographies differ by breakpoint +fn responsive_themes() -> NativeTheme { + let mut theme = two_themes(); + theme.tokens.insert( + "space".to_string(), + vec![ + Some(levels(&[Some("4px"), None, Some("8px")])), + Some(levels(&[Some("6px"), None, Some("12px")])), + ], + ); + theme.tokens.insert( + "edge".to_string(), + vec![ + Some(levels(&[ + Some("1px solid $primary"), + Some("2px solid $primary") + ])); + 2 + ], + ); + theme.tokens.insert( + "late".to_string(), + vec![Some(levels(&[None, Some("2px")])); 2], + ); + theme.typography.insert( + "display".to_string(), + vec![ + Some(typography_entry(&[ + ("font-family", "Inter"), + ("font-size", "$captionSize"), + ("line-height", "1.5"), + ])), + None, + Some(typography_entry(&[("font-size", "40px")])), + ], + ); + theme +} + +const THEMED_RESPONSIVE_ELEMENTS: &str = r#"export function Card({ on }) { + return ( + + + + + + + + + + + + ) +}"#; + +#[rstest] +#[case::two_themes("responsive_themes", responsive_themes(), THEMED_RESPONSIVE_ELEMENTS)] +#[case::custom_breakpoints( + "responsive_custom_breakpoints", + NativeTheme { + breakpoints: vec![0, 600], + ..responsive_themes() + }, + "export const A = () => ;\nexport const b = " +)] +#[case::no_breakpoints( + "responsive_no_breakpoints", + NativeTheme { + breakpoints: vec![], + ..responsive_themes() + }, + "export const A = () => " +)] +fn compiles_responsive_themes(#[case] name: &str, #[case] theme: NativeTheme, #[case] code: &str) { + assert_snapshot!(name, compile_themed(theme, true, code)); +} + +#[rstest] +#[case::arrays( + "runtime_off_arrays", + ";\n;\n" +)] +#[case::tokens( + "runtime_off_responsive_tokens", + ";\n" +)] +#[case::orientation( + "runtime_off_orientation", + "" +)] +fn runtime_off_rejects_responsive_values(#[case] name: &str, #[case] code: &str) { + assert_snapshot!(name, compile_themed(one_theme(), false, code)); +} + +#[rstest] +#[case::spread("responsive_spread", "")] +#[case::nested("responsive_nested", "")] +#[case::orientation_value( + "orientation_value", + "" +)] +fn responsive_errors(#[case] name: &str, #[case] code: &str) { + assert_snapshot!(name, compile_themed(two_themes(), true, code)); +} + +#[rstest] +#[case("margin", "marginTop", true)] +#[case("margin", "margin", false)] +#[case("margin", "padding", false)] +#[case("padding", "paddingVertical", true)] +#[case("inset", "insetBlock", true)] +#[case("inset", "top", true)] +#[case("inset", "inset", false)] +#[case("inset", "width", false)] +#[case("marginVertical", "marginTop", true)] +#[case("marginVertical", "marginLeft", false)] +#[case("paddingVertical", "paddingBottom", true)] +#[case("marginHorizontal", "marginStart", true)] +#[case("marginHorizontal", "marginTop", false)] +#[case("paddingHorizontal", "paddingRight", true)] +#[case("gap", "rowGap", true)] +#[case("gap", "gap", false)] +#[case("borderWidth", "borderTopWidth", true)] +#[case("borderWidth", "borderWidth", false)] +#[case("borderColor", "borderLeftColor", true)] +#[case("borderRadius", "borderTopLeftRadius", true)] +#[case("borderRadius", "outlineRadius", false)] +#[case("width", "minWidth", false)] +fn cascade_replaces_covered_longhands( + #[case] shorthand: &str, + #[case] longhand: &str, + #[case] replaced: bool, +) { + // Given: a narrower breakpoint declaring `longhand` + let mut declared = declarations(&[(longhand, 1.0), ("opacity", 1.0)]); + // When: a wider one declares `shorthand` + cascade(&mut declared, declarations(&[(shorthand, 2.0)])); + // Then + let kept = declared.iter().any(|(key, value)| { + key == longhand && (longhand == shorthand || *value == NativeValue::Number(1.0)) + }); + assert_eq!(!kept, replaced, "{declared:?}"); + assert!(declared.iter().any(|(key, _)| key == "opacity")); +} + +#[test] +fn varied_choices_pick_by_breakpoint_and_theme() { + let a = declarations(&[("padding", 1.0)]); + let b = declarations(&[("padding", 2.0)]); + let c = declarations(&[("padding", 3.0)]); + let mut sheet = Sheet::new("s".to_string()); + let mut code = |choice: Choice| { + style_code(vec![choice], vec![], &mut sheet, &VARS) + .map_or_else(Default::default, |style| (style.code, style.reads)) + }; + // Three runs of breakpoints, the first without styles + let (three, _) = code(Choice::Varied(vec![ + vec![vec![]], + vec![a.clone()], + vec![a.clone()], + vec![b.clone()], + ])); + assert_eq!(three, "b < 1 ? null : b < 3 ? s.a : s.b"); + // Breakpoints and themes both + let (both, reads) = code(Choice::Varied(vec![ + vec![a.clone(), b.clone()], + vec![c.clone(), c.clone()], + ])); + assert_eq!(both, "b < 1 ? [s.a, s.b][t] : s.c"); + assert!(reads.theme && reads.breakpoint && !reads.landscape); + // In a condition, and applied while a state holds + let (condition, reads) = code(Choice::Condition { + test: "on".to_string(), + consequent: Box::new(Choice::Varied(vec![vec![a.clone()], vec![b.clone()]])), + alternate: Box::new(when(State::Landscape(false), Choice::Static(c))), + }); + assert_eq!(condition, "on ? (b < 1 ? s.a : s.b) : (!l && s.c)"); + assert!(!reads.theme && reads.breakpoint && reads.landscape); + let (nested, _) = code(Choice::Condition { + test: "on".to_string(), + consequent: Box::new(Choice::Varied(vec![ + vec![declarations(&[("padding", 1.0), ("margin", 1.0)])], + vec![declarations(&[("padding", 2.0), ("margin", 1.0)])], + ])), + alternate: Box::new(Choice::All(vec![ + Choice::Static(a.clone()), + when(State::AtLeast(2), Choice::Static(b)), + ])), + }); + assert_eq!( + nested, + "on ? ([s.d, b < 1 ? s.a : s.b]) : [s.a, b >= 2 && s.b]" + ); + assert_eq!(when(State::Theme(1), Choice::Empty), Choice::Empty); + assert_eq!( + in_theme( + 1, + 2, + when(State::Landscape(true), Choice::Static(a.clone())) + ), + when( + State::Theme(1), + when(State::Landscape(true), Choice::Static(a)) + ) ); } diff --git a/libs/extractor/src/native/theme.rs b/libs/extractor/src/native/theme.rs index c7f99a530..e168d76e4 100644 --- a/libs/extractor/src/native/theme.rs +++ b/libs/extractor/src/native/theme.rs @@ -1,12 +1,12 @@ //! The theme of `devup.json` as the React Native output reads it: the names -//! of the themes in the order the runtime indexes them, and the value of each -//! token and typography in every theme, resolved at build time. +//! of the themes in the order the runtime indexes them, the breakpoints, and +//! the value of each token and typography in every theme at each breakpoint, +//! resolved at build time. use std::borrow::Cow; use std::collections::BTreeMap; -use super::NativeTarget; -use super::errors::{Problem, RuntimeFeature}; +use super::errors::Problem; /// The values of a token at each breakpoint, `None` where it has none pub type TokenLevels = Vec>; @@ -14,9 +14,12 @@ pub type TokenLevels = Vec>; /// The CSS properties of a typography, each with its value pub type TypographyProperties = Vec<(String, String)>; +/// The breakpoints of the web, which `devup.json` keeps unless it sets its own +pub const DEFAULT_BREAKPOINTS: [u16; 6] = [0, 480, 768, 992, 1280, 1600]; + /// The theme a file is compiled with. Built from `devup.json` by the /// bindings, which read it with the web's theme parser -#[derive(Debug, Clone, Default, PartialEq, Eq)] +#[derive(Debug, Clone, PartialEq, Eq)] pub struct NativeTheme { /// The theme names, the default first: the runtime picks a style object by /// the index of a name here @@ -29,6 +32,21 @@ pub struct NativeTheme { pub tokens: BTreeMap>>, /// Each typography by name, with its properties at each breakpoint pub typography: BTreeMap>>, + /// The window width, in density-independent pixels, each breakpoint + /// starts at, as the web's media queries read them + pub breakpoints: Vec, +} + +impl Default for NativeTheme { + fn default() -> Self { + Self { + names: Vec::new(), + dark: None, + tokens: BTreeMap::new(), + typography: BTreeMap::new(), + breakpoints: DEFAULT_BREAKPOINTS.to_vec(), + } + } } /// How many times a token's value may name another token @@ -41,25 +59,30 @@ impl NativeTheme { self.names.len().max(1) } + /// How many breakpoints a responsive value can tell apart: at least one + pub(super) fn levels(&self) -> usize { + self.breakpoints.len().max(1) + } + /// The index of the theme `name` pub(super) fn index_of(&self, name: &str) -> Option { self.names.iter().position(|theme| theme == name) } - /// `text` with each `$token` replaced by its value in the theme at - /// `index`, or `None` when that theme does not define one of them + /// `text` with each `$token` replaced by its value at the breakpoint + /// `level` in the theme at `index`, or `None` when that theme does not + /// define one of them there pub(super) fn resolve<'t>( &self, text: &'t str, - index: usize, - target: &NativeTarget, + at: (usize, usize), ) -> Result>, Problem> { if !text.contains('$') { return Ok(Some(Cow::Borrowed(text))); } let mut resolved = text.to_string(); for _ in 0..MAX_TOKEN_DEPTH { - match self.resolve_once(&resolved, index, target)? { + match self.resolve_once(&resolved, at)? { Some(next) if next == resolved => return Ok(Some(Cow::Owned(next))), Some(next) => resolved = next, None => return Ok(None), @@ -72,17 +95,12 @@ impl NativeTheme { } /// `text` with each `$token` replaced once - fn resolve_once( - &self, - text: &str, - index: usize, - target: &NativeTarget, - ) -> Result, Problem> { + fn resolve_once(&self, text: &str, at: (usize, usize)) -> Result, Problem> { let mut resolved = String::with_capacity(text.len()); let mut rest = text; while let Some((before, token, after)) = next_token(rest) { resolved.push_str(before); - match self.token(token, index, target)? { + match self.token(token, at)? { Some(value) => resolved.push_str(value), None => return Ok(None), } @@ -92,13 +110,10 @@ impl NativeTheme { Ok(Some(resolved)) } - /// The value of `token` (as written after `$`) in the theme at `index` - fn token( - &self, - token: &str, - index: usize, - target: &NativeTarget, - ) -> Result, Problem> { + /// The value of `token` (as written after `$`) at the breakpoint `level` + /// in the theme at `index`: its value at the last breakpoint up to + /// `level` that gives one, as the web's media queries cascade + fn token(&self, token: &str, (index, level): (usize, usize)) -> Result, Problem> { let key = token.replace('.', "-"); let themes = self.tokens.get(&key).ok_or_else(|| { Problem::new( @@ -106,51 +121,82 @@ impl NativeTheme { "add the token to the theme in devup.json, or write the value itself", ) })?; - if themes.iter().flatten().any(is_responsive) { - return Err(responsive_token(token, target)); - } Ok(themes .get(index) .and_then(Option::as_ref) - .and_then(|levels| levels.first()) - .and_then(Option::as_deref)) + .and_then(|levels| at_level(levels, level))) } - /// The properties of the typography `name` + /// The properties of the typography `name` at the breakpoint `level`: + /// each property as the last breakpoint up to `level` that gives it pub(super) fn typography( &self, name: &str, - target: &NativeTarget, - ) -> Result<&TypographyProperties, Problem> { + level: usize, + ) -> Result { let levels = self.typography.get(name).ok_or_else(|| { Problem::new( format!("devup.json defines no `{name}` typography"), "add the typography to the theme in devup.json", ) })?; - match levels.split_first() { - Some((Some(properties), rest)) if rest.iter().all(Option::is_none) => Ok(properties), - _ => Err(responsive_token(name, target)), + let mut properties: TypographyProperties = Vec::new(); + for entry in levels.iter().take(level + 1).flatten() { + for (property, value) in entry { + match properties.iter_mut().find(|(name, _)| name == property) { + Some(existing) => existing.1.clone_from(value), + None => properties.push((property.clone(), value.clone())), + } + } } + Ok(properties) + } + + /// How many breakpoints the tokens `text` names tell apart, through the + /// tokens their values name: one when none is responsive + pub(super) fn token_levels(&self, text: &str) -> usize { + self.token_levels_within(text, MAX_TOKEN_DEPTH) } -} -/// Whether a token has a value at a breakpoint but the first, which the -/// window width chooses -fn is_responsive(levels: &TokenLevels) -> bool { - !matches!(levels.split_first(), Some((Some(_), rest)) if rest.iter().all(Option::is_none)) + fn token_levels_within(&self, text: &str, depth: usize) -> usize { + let mut levels = 1; + let mut rest = text; + while let Some((_, token, after)) = next_token(rest) { + let all = self.tokens.get(&token.replace('.', "-")); + for values in all.into_iter().flatten().flatten() { + levels = levels.max(values.len()); + if depth > 0 { + for value in values.iter().flatten() { + levels = levels.max(self.token_levels_within(value, depth - 1)); + } + } + } + rest = after; + } + levels + } + + /// How many breakpoints the typography `name` tells apart, through the + /// tokens its values name + pub(super) fn typography_levels(&self, name: &str) -> usize { + self.typography.get(name).map_or(1, |levels| { + levels + .iter() + .flatten() + .flatten() + .map(|(_, value)| self.token_levels(value)) + .fold(levels.len(), usize::max) + }) + } } -/// Why a token with a value at each breakpoint cannot compile yet -fn responsive_token(name: &str, target: &NativeTarget) -> Problem { - let problem = RuntimeFeature::Responsive.problem(target); - Problem::new( - format!( - "`{name}` has a value at each breakpoint: {}", - problem.reason - ), - "give it one value in devup.json, or write the value itself", - ) +/// The value of `levels` at the breakpoint `level`: the last one up to it +fn at_level(levels: &TokenLevels, level: usize) -> Option<&str> { + levels + .iter() + .take(level + 1) + .rev() + .find_map(Option::as_deref) } /// The text before the first `$token` of `text`, the token's name and the diff --git a/packages/metro-plugin/README.md b/packages/metro-plugin/README.md index 41d86cfa9..1a4e54e18 100644 --- a/packages/metro-plugin/README.md +++ b/packages/metro-plugin/README.md @@ -117,23 +117,44 @@ The build imports these from `@devup-ui/react/native`, a store read with `useSyncExternalStore` that computes no style; web builds never import it. `setTheme` does not save the choice across launches. +## Responsive values + +Responsive arrays, and `length`, `shadow` and `typography` tokens with a value +at each breakpoint, use the `breakpoints` of devup.json (the web's +`[0, 480, 768, 992, 1280, 1600]` by default), measured against the window +width in density-independent pixels. As on the web, each value applies from +its breakpoint on and `null` keeps the one before: + +```tsx + +// +``` + +The build precomputes one style object for each run of breakpoints that +share their styles, only for the styles that differ; a value that differs by +theme and breakpoint picks by both. The runtime listens to the window once +and renders a component again only when the window crosses into another +breakpoint. `_portrait` and `_landscape` apply their styles while the window +is in that orientation. + +A value read at runtime in an array (`p={[x, 2]}`) applies from its +breakpoint on as it is. + ## Limits of this version Only styles the build can decide are supported: literals, values read at -runtime, theme tokens, conditions between them and the platform and theme -blocks. These are build errors, reported by Metro at the file, line and -column: +runtime, theme tokens, responsive values, conditions between them and the +platform, theme and orientation blocks. These are build errors, reported by +Metro at the file, line and column: -- responsive arrays (`p={[1, 2]}`), and tokens or typography with a value at - each breakpoint - interaction states (`_hover`, `_active`, `_pressed`, `_focus`, ...) - `css()`, `styled()`, `globalCss()`, `keyframes()` and `Grid` - any prop React Native has no style for -- with `runtime: false`, a value that differs by theme, `_theme*` with more - than one theme, and `useTheme`, `getTheme` and `setTheme` +- with `runtime: false`, a value that differs by theme or breakpoint, + `_theme*` with more than one theme, `_portrait`, `_landscape`, and + `useTheme`, `getTheme` and `setTheme` -The runtime that brings responsive values and `_pressed` comes in a later -version. +The runtime that brings `_pressed` comes in a later version. Metro reads devup.json when it starts, so restart Metro after changing it (`--reset-cache` is not needed). diff --git a/packages/react/src/native/__tests__/index.browser.test.tsx b/packages/react/src/native/__tests__/index.browser.test.tsx index 1dd10010e..7dc2761e6 100644 --- a/packages/react/src/native/__tests__/index.browser.test.tsx +++ b/packages/react/src/native/__tests__/index.browser.test.tsx @@ -8,7 +8,21 @@ const appearance = { listeners: [] as (() => void)[], } +/** The window React Native reports, and who listens to its changes */ +const dimensions = { + width: 390, + height: 844, + listeners: [] as (() => void)[], +} + mock.module('react-native', () => ({ + Dimensions: { + get: () => ({ width: dimensions.width, height: dimensions.height }), + addEventListener: (event: string, listener: () => void) => { + if (event === 'change') dimensions.listeners.push(listener) + return { remove: () => {} } + }, + }, Appearance: { getColorScheme: () => appearance.scheme, addChangeListener: (listener: () => void) => { @@ -26,12 +40,34 @@ function changeAppearance(scheme: string | null) { }) } +/** The window resizing to `width` by `height` */ +function resize(width: number, height: number) { + act(() => { + dimensions.width = width + dimensions.height = height + for (const listener of dimensions.listeners) listener() + }) +} + const runtime = await import('../index') -const { defineThemes, getTheme, setTheme, Themed, useTheme, useThemeIndex } = - runtime +const { + defineBreakpoints, + defineThemes, + getBreakpoint, + getTheme, + setTheme, + Themed, + useBreakpoint, + useLandscape, + useTheme, + useThemeIndex, +} = runtime beforeEach(() => { appearance.scheme = 'light' + dimensions.width = 390 + dimensions.height = 844 + defineBreakpoints([0, 480, 768, 992, 1280, 1600]) defineThemes(['light', 'dark', 'sepia'], 1) setTheme(null) }) @@ -123,3 +159,85 @@ describe('Themed', () => { expect(span()?.getAttribute('data-color')).toBe('brown') }) }) + +describe('getBreakpoint and useBreakpoint', () => { + it('give the last breakpoint the window width reaches', () => { + expect(getBreakpoint()).toBe(0) + dimensions.width = 480 + expect(getBreakpoint()).toBe(1) + dimensions.width = 1599 + expect(getBreakpoint()).toBe(4) + dimensions.width = 4000 + expect(getBreakpoint()).toBe(5) + }) + + it('read the breakpoints devup.json gives', () => { + defineBreakpoints([100, 600]) + dimensions.width = 50 + expect(getBreakpoint()).toBe(0) + dimensions.width = 599 + expect(getBreakpoint()).toBe(0) + dimensions.width = 600 + expect(getBreakpoint()).toBe(1) + defineBreakpoints([]) + expect(getBreakpoint()).toBe(0) + }) + + it('render again only when the window crosses a breakpoint', () => { + let renders = 0 + const { result } = renderHook(() => { + renders += 1 + return useBreakpoint() + }) + expect([result.current, renders]).toEqual([0, 1]) + resize(400, 844) + resize(479, 844) + expect([result.current, renders]).toEqual([0, 1]) + resize(480, 844) + expect([result.current, renders]).toEqual([1, 2]) + resize(700, 844) + expect([result.current, renders]).toEqual([1, 2]) + resize(1024, 844) + expect(result.current).toBe(3) + resize(320, 844) + expect(result.current).toBe(0) + }) +}) + +describe('useLandscape', () => { + it('renders again when the window turns', () => { + const { result } = renderHook(() => useLandscape()) + expect(result.current).toBe(false) + resize(844, 390) + expect(result.current).toBe(true) + resize(390, 844) + expect(result.current).toBe(false) + }) + + it('shares one listener of the window with every hook', () => { + renderHook(() => [useLandscape(), useBreakpoint(), useTheme()]) + renderHook(() => useBreakpoint()) + expect(dimensions.listeners).toHaveLength(1) + }) +}) + +describe('Themed with breakpoints', () => { + it('renders the style of the breakpoint and orientation of the window', () => { + const Probe = ({ style }: { style?: string }) => + createElement('span', { 'data-style': style }) + const { container } = render( + createElement(Themed, { + $c: Probe, + $s: (theme: number, breakpoint: number, landscape: boolean) => + `${theme}-${breakpoint}-${landscape}`, + }), + ) + const style = () => + container.querySelector('span')?.getAttribute('data-style') + expect(style()).toBe('0-0-false') + resize(844, 390) + expect(style()).toBe('0-2-true') + changeAppearance('dark') + expect(style()).toBe('1-2-true') + }) +}) diff --git a/packages/react/src/native/index.ts b/packages/react/src/native/index.ts index cffcb461e..f9c147fd8 100644 --- a/packages/react/src/native/index.ts +++ b/packages/react/src/native/index.ts @@ -4,15 +4,16 @@ import { type ReactElement, useSyncExternalStore, } from 'react' -import { Appearance } from 'react-native' +import { Appearance, Dimensions } from 'react-native' import type { DevupTheme } from '../types/theme' /** * The React Native runtime of Devup UI. The build compiles every style to - * `StyleSheet` objects, one a theme when a value differs by theme; this - * module only tells which theme shows. It reads no CSS, resolves no token - * and computes no style. Web builds never import it. + * `StyleSheet` objects, one a theme or a breakpoint when a value differs by + * them; this module only tells which theme shows, which breakpoint the + * window is at and whether it is in landscape. It reads no CSS, resolves no + * token and computes no style. Web builds never import it. */ type ThemeName = keyof DevupTheme extends undefined ? string : keyof DevupTheme @@ -23,6 +24,10 @@ let names: readonly string[] = [] let dark = -1 /** The theme `setTheme` chose, which wins over the system appearance */ let chosen: string | null = null +/** The window widths the breakpoints start at, as devup.json gives them */ +let breakpoints: readonly number[] = [0, 480, 768, 992, 1280, 1600] +/** The breakpoint and orientation listeners last heard of, as one number */ +let layout = -1 let following = false const listeners = new Set<() => void>() @@ -30,10 +35,26 @@ function notify(): void { for (const listener of listeners) listener() } +/** The breakpoint the window is at and whether it is in landscape, as one number */ +function readLayout(): number { + return getBreakpoint() * 2 + Number(getLandscape()) +} + +/** Tells the listeners when the window crosses a breakpoint or turns */ +function resize(): void { + const next = readLayout() + if (next !== layout) { + layout = next + notify() + } +} + function subscribe(listener: () => void): () => void { if (!following) { following = true + layout = readLayout() Appearance.addChangeListener(notify) + Dimensions.addEventListener('change', resize) } listeners.add(listener) return () => { @@ -52,6 +73,15 @@ export function defineThemes(themes: readonly string[], darkIndex = -1): void { dark = darkIndex } +/** + * Tells the runtime the breakpoints of devup.json when they are not the + * web's default. The build calls it in each file that reads the breakpoint. + * @internal + */ +export function defineBreakpoints(widths: readonly number[]): void { + breakpoints = widths +} + /** * The theme the app shows: the one `setTheme` chose, else the dark theme * while the system appearance is dark, else the default theme; `null` @@ -89,9 +119,46 @@ export function useThemeIndex(): number { } /** - * Renders `$c` with the style `$s` gives for the theme the app shows. The - * build renders an element through it where no function component can read - * the theme for it. + * The breakpoint the window is at: the index of the last breakpoint whose + * width the window reaches, as the web's `min-width` media queries choose, + * and `0` below them all + */ +export function getBreakpoint(): number { + const { width } = Dimensions.get('window') + let level = 0 + for (let index = 1; index < breakpoints.length; index++) { + if (width >= breakpoints[index]) level = index + } + return level +} + +/** + * The breakpoint the window is at, rendering again only when the window + * crosses into another breakpoint + */ +export function useBreakpoint(): number { + return useSyncExternalStore(subscribe, getBreakpoint, getBreakpoint) +} + +/** Whether the window is wider than it is tall */ +function getLandscape(): boolean { + const { width, height } = Dimensions.get('window') + return width > height +} + +/** + * Whether the window is in landscape, rendering again when it turns + * @internal + */ +export function useLandscape(): boolean { + return useSyncExternalStore(subscribe, getLandscape, getLandscape) +} + +/** + * Renders `$c` with the style `$s` gives for the theme the app shows, the + * breakpoint the window is at and whether it is in landscape. The build + * renders an element through it where no function component can read them + * for it. * @internal */ export function Themed({ @@ -100,7 +167,10 @@ export function Themed({ ...props }: { $c: ElementType - $s: (theme: number) => unknown + $s: (theme: number, breakpoint: number, landscape: boolean) => unknown } & Record): ReactElement { - return createElement($c, { ...props, style: $s(useThemeIndex()) }) + return createElement($c, { + ...props, + style: $s(useThemeIndex(), useBreakpoint(), useLandscape()), + }) } diff --git a/verify-dist.ts b/verify-dist.ts index e65a5b665..d2a4f414a 100644 --- a/verify-dist.ts +++ b/verify-dist.ts @@ -85,7 +85,7 @@ Bun.plugin({ name: 'react-native-stand-in', setup(build) { build.module('react-native', () => ({ - exports: { Appearance: {} }, + exports: { Appearance: {}, Dimensions: {} }, loader: 'object', })) }, From 15d61a889d75e867e63abc5530814497a57cdf71 Mon Sep 17 00:00:00 2001 From: Jeong Min Oh Date: Sun, 29 Nov 2026 02:40:42 +0900 Subject: [PATCH 34/40] feat(native): hover, focus and disabled styles on React Native (#1048) `_hover` and `_focus` read the `hovered` and `focused` that `Pressable` gives its style function, and make a `Box` a `Pressable` as `_active` does. An `Input` with `_focus` renders through the runtime's new `Focused`, which follows its focus events. `_disabled` applies while the element's `disabled` prop is true, or a `styled()` component's. In `css()` these are build errors. Co-authored-by: Claude Opus 5.5 --- ...pack_log_react_native_focused_runtime.json | 7 + .../changepack_log_react_native_states.json | 8 + apps/expo/check-bundle.mjs | 11 +- apps/expo/src/App.tsx | 1 + libs/extractor/src/native/element.rs | 143 +++++++++++++----- libs/extractor/src/native/element/css_call.rs | 14 +- libs/extractor/src/native/element/styled.rs | 27 ++-- .../extractor__native__tests__css_errors.snap | 4 +- ...or__native__tests__interaction_errors.snap | 10 ++ ...or__native__tests__interaction_states.snap | 43 ++++++ ...or__native__tests__interaction_styled.snap | 17 +++ ...actor__native__tests__platform_shapes.snap | 1 - ...ractor__native__tests__pressed_errors.snap | 8 +- .../extractor__native__tests__selectors.snap | 4 +- ...tractor__native__tests__styled_errors.snap | 4 +- libs/extractor/src/native/style.rs | 71 ++++++++- libs/extractor/src/native/tests.rs | 32 ++++ packages/metro-plugin/README.md | 24 ++- .../native/__tests__/index.browser.test.tsx | 46 ++++++ packages/react/src/native/index.ts | 40 +++++ 20 files changed, 436 insertions(+), 79 deletions(-) create mode 100644 .changepacks/changepack_log_react_native_focused_runtime.json create mode 100644 .changepacks/changepack_log_react_native_states.json create mode 100644 libs/extractor/src/native/snapshots/extractor__native__tests__interaction_errors.snap create mode 100644 libs/extractor/src/native/snapshots/extractor__native__tests__interaction_states.snap create mode 100644 libs/extractor/src/native/snapshots/extractor__native__tests__interaction_styled.snap diff --git a/.changepacks/changepack_log_react_native_focused_runtime.json b/.changepacks/changepack_log_react_native_focused_runtime.json new file mode 100644 index 000000000..49a5b47bc --- /dev/null +++ b/.changepacks/changepack_log_react_native_focused_runtime.json @@ -0,0 +1,7 @@ +{ + "changes": { + "packages/react/package.json": "Patch" + }, + "note": "`@devup-ui/react/native` adds `Focused` (internal), which renders a `TextInput` with the style the build compiles for whether it has focus, following its `onFocus` and `onBlur` and still calling the ones it is given. The runtime grows from 630 B to 702 B min+gzip.", + "date": "2026-11-21T00:00:00.000Z" +} diff --git a/.changepacks/changepack_log_react_native_states.json b/.changepacks/changepack_log_react_native_states.json new file mode 100644 index 000000000..ea7449058 --- /dev/null +++ b/.changepacks/changepack_log_react_native_states.json @@ -0,0 +1,8 @@ +{ + "changes": { + "bindings/devup-ui-binding/package.json": "Patch", + "bindings/devup-ui-wasm/package.json": "Patch" + }, + "note": "`codeExtractNative` compiles `_hover`, `_focus` and `_disabled` for React Native (part of #411): `_hover` and `_focus` read the `hovered` and `focused` that `Pressable` gives its style function, an `Input` with `_focus` renders through the runtime's `Focused`, and `_disabled` applies while the element's `disabled` prop is true. In `css()` these and `_active` are build errors. Web output is unchanged.", + "date": "2026-11-21T00:00:00.000Z" +} diff --git a/apps/expo/check-bundle.mjs b/apps/expo/check-bundle.mjs index a7168e173..bc2d2a4c6 100644 --- a/apps/expo/check-bundle.mjs +++ b/apps/expo/check-bundle.mjs @@ -6,16 +6,17 @@ // the breakpoint and the orientation, so it calls each of those hooks of the // runtime; src/Badge.tsx is styled the same in every theme and at every // width, so it must not use the runtime. Its buttons take press styles, which -// React Native's `Pressable` applies through a function for `style`. +// React Native's `Pressable` applies through a function for `style`, and its +// input a focus style, which the runtime's `Focused` applies. import { readdirSync, readFileSync } from 'node:fs' import { join } from 'node:path' const PLACEHOLDER = 'Cannot run on the runtime' /** Names of the runtime that only code using it holds, as minified code keeps them */ const RUNTIME_NAMES = - /\b(?:defineThemes|useThemeIndex|useBreakpoint|useLandscape)\b/g -/** The hooks src/App.tsx must call */ -const APP_HOOKS = ['useThemeIndex', 'useBreakpoint', 'useLandscape'] + /\b(?:defineThemes|useThemeIndex|useBreakpoint|useLandscape|Focused)\b/g +/** What src/App.tsx must use from the runtime */ +const APP_HOOKS = ['useThemeIndex', 'useBreakpoint', 'useLandscape', 'Focused'] /** Modules of @devup-ui/react, by the path Metro resolves */ const REACT_PACKAGE = /(^|[\\/])(@devup-ui[\\/]react|packages[\\/]react)[\\/]/ /** The React Native runtime among them */ @@ -144,7 +145,7 @@ for (const platform of ['ios', 'android']) { for (const hook of APP_HOOKS) { const callers = [...(users.get(hook) ?? [])] if (!callers.some((source) => /src[\\/]App\.tsx$/.test(source))) { - failures.push(`${platform}/${file}: src/App.tsx does not call ${hook}`) + failures.push(`${platform}/${file}: src/App.tsx does not use ${hook}`) } } const all = [ diff --git a/apps/expo/src/App.tsx b/apps/expo/src/App.tsx index 6d8174a5f..fb764ead4 100644 --- a/apps/expo/src/App.tsx +++ b/apps/expo/src/App.tsx @@ -53,6 +53,7 @@ export function App() { Your name Option { - if !(self.hooks_used.any() || self.wrapper_used || theme_api) { + if !(self.hooks_used.any() || self.wrapper_used || self.focused_used || theme_api) { return None; } let reads = self.hooks_used.union(self.wrapper_reads); @@ -123,6 +140,9 @@ impl Runtime { if self.wrapper_used { specifiers.push(format!("Themed as {}", self.wrapper)); } + if self.focused_used { + specifiers.push(format!("Focused as {}", self.focused_wrapper)); + } let theme = &target.theme; let mut calls = String::new(); if reads.theme || theme_api { @@ -270,6 +290,9 @@ fn classify(name: &str) -> Prop { "_portrait" => Prop::When(State::Landscape(false)), "_landscape" => Prop::When(State::Landscape(true)), "_pressed" | "_active" => Prop::When(State::Pressed), + "_hover" => Prop::When(State::Hovered), + "_focus" => Prop::When(State::Focused), + "_disabled" => Prop::When(State::Disabled), "className" => Prop::ClassName, "typography" => Prop::Declares, "styleOrder" | "styleVars" => Prop::Unsupported(Problem::new( @@ -366,6 +389,11 @@ struct Styles { removed: Vec, /// The `style` prop, which leaves the element with the style props style: Option, + /// The code of the element's `disabled` prop, which `_disabled` reads + disabled: Option, + /// Whether `Focused` renders the element, which tells whether it has + /// focus: a `TextInput` taking a focus style + focus_wrapped: bool, /// The `style` prop's value compiled, which it keeps when the element /// takes no other style kept: Option, @@ -687,8 +715,17 @@ impl<'a> Elements<'_> { } let retagged = tag.is_some(); let press = self.press.take(); - if let Some(press) = press.filter(|_| styles.blocks.iter().any(Choice::pressed)) { - tag = self.pressable(press, kind, local, tag); + let held: Vec = INTERACTIONS + .into_iter() + .filter(|state| styles.blocks.iter().any(|choice| choice.holds(*state))) + .collect(); + if let Some(press) = press.filter(|_| !held.is_empty()) { + if *kind == ExportVariableKind::Input && held == [State::Focused] && tag.is_none() { + // A `TextInput` tells its focus only through its events + styles.focus_wrapped = true; + } else { + tag = self.pressable(press, kind, local, tag); + } } self.finish(element, styles, (tag, local), previous_end); self.children(element, kind, local, retagged); @@ -709,6 +746,12 @@ impl<'a> Elements<'_> { return None; }; let name = name.name.as_str(); + if name == "disabled" { + styles.disabled = Some( + attribute_expression(attribute) + .map_or_else(|| "true".to_string(), |value| self.source(value)), + ); + } if name == "src" && *kind == ExportVariableKind::Image { self.image_source(attribute, local); return None; @@ -914,11 +957,12 @@ impl<'a> Elements<'_> { offset: u32, local: &str, ) -> Vec { - // `Pressable` tells whether it is pressed; only the orientation needs - // the runtime - if state == State::Pressed { + // `Pressable` tells whether it is pressed, hovered or focused, and + // `disabled` whether it is disabled: only the orientation needs the + // runtime + if INTERACTIONS.contains(&state) { self.press.get_or_insert_with(|| (offset, name.to_string())); - } else if !self.target.runtime { + } else if !self.target.runtime && state != State::Disabled { self.error( offset, RuntimeFeature::Orientation.problem().on(local, name), @@ -1207,50 +1251,75 @@ impl<'a> Elements<'_> { style, kept, opaque_spread, + disabled, + focus_wrapped, } = styles; choices.extend(blocks); - let pressed = choices.iter().any(Choice::pressed); - let mut style_code = style_code( - choices, - (classes, given), - &mut self.sheet, - &self.runtime.vars(), - ); + if disabled.is_none() { + // `_disabled` applies only to an element given `disabled` + choices = choices + .into_iter() + .map(|choice| without(choice, State::Disabled)) + .collect(); + } + let disabled = disabled.unwrap_or_default(); + let vars = Vars { + disabled: &disabled, + ..self.runtime.vars() + }; + let keys = interaction_keys(&choices, &vars); + let mut style_code = style_code(choices, (classes, given), &mut self.sheet, &vars); let reads = style_code .as_ref() .map_or_else(Reads::default, |style| style.reads); - if let Some(style) = style_code.as_mut().filter(|_| pressed) { + let focus_wrapped = focus_wrapped && style_code.is_some(); + if let Some(style) = style_code + .as_mut() + .filter(|_| !keys.is_empty() && !focus_wrapped) + { // `Pressable` calls a function for its style with its state - style.code = format!( - "({{ pressed: {} }}) => {}", - self.runtime.pressed, style.code - ); + style.code = format!("({{ {} }}) => {}", keys.join(", "), style.code); } - let wrapped = reads.any() && !self.read_in_component(reads); - if wrapped { - self.runtime.wrapper_used = true; + let in_component = !reads.any() || self.read_in_component(reads); + if !in_component { self.runtime.wrapper_reads = self.runtime.wrapper_reads.union(reads); - let wrapper = self.runtime.wrapper.clone(); - self.rename(element, &wrapper); - } else if let Some(tag) = &tag { - self.rename(element, tag); + } + let wrapper = if focus_wrapped { + self.runtime.focused_used = true; + Some(self.runtime.focused_wrapper.clone()) + } else if in_component { + None + } else { + self.runtime.wrapper_used = true; + Some(self.runtime.wrapper.clone()) + }; + if let Some(name) = wrapper.as_ref().or(tag.as_ref()) { + self.rename(element, name); } let Some(style_code) = style_code else { self.remove(&removed); self.replacements.extend(kept); return; }; - let code = if wrapped { - // The wrapper gives the theme, the breakpoint and the orientation, - // in this order: the style takes them up to the last it reads - let read = self.runtime.variables(reads).last().map_or(0, |(at, _)| at); - let parameters = [ + let code = if wrapper.is_some() { + // `Focused` gives whether the element has focus first; a wrapper + // gives the theme, the breakpoint and the orientation, in this + // order, to an element outside a component: the style takes them + // up to the last it reads + let focus = focus_wrapped.then_some(self.runtime.focused.as_str()); + let read = self.runtime.variables(reads).last().map(|(at, _)| at); + let runtime = [ &self.runtime.index, &self.runtime.breakpoint, &self.runtime.landscape, - ][..=read] - .iter() - .map(|name| name.as_str()) + ]; + let parameters = focus + .into_iter() + .chain( + runtime[..read.filter(|_| !in_component).map_or(0, |at| at + 1)] + .iter() + .map(|name| name.as_str()), + ) .collect::>() .join(", "); format!( @@ -1290,12 +1359,12 @@ impl<'a> Elements<'_> { return Some(self.pressable.clone()); } (_, Some(_)) => Problem::new( - "a press style makes the element React Native's `Pressable`, which cannot render the component `as` gives", + "a press, hover or focus style makes the element React Native's `Pressable`, which cannot render the component `as` gives", "remove `as`, or pass a function reading `pressed` to the `style` of a `Pressable`", ), (native, None) => Problem::new( format!( - "a press style needs React Native's `Pressable`, and the element renders React Native's `{native}`" + "a press, hover or focus style needs React Native's `Pressable`, and the element renders React Native's `{native}`" ), "wrap it in a `Box` or a `Button` with `_pressed`", ), diff --git a/libs/extractor/src/native/element/css_call.rs b/libs/extractor/src/native/element/css_call.rs index 7fc573276..d4b44b7d6 100644 --- a/libs/extractor/src/native/element/css_call.rs +++ b/libs/extractor/src/native/element/css_call.rs @@ -12,7 +12,7 @@ use std::fmt::Write; use super::styled::{gives_style_props, is_function}; use super::{Elements, Prop, Styles, attribute_expression, classify}; use crate::native::errors::Problem; -use crate::native::style::{Choice, combined, style_code}; +use crate::native::style::{Choice, State, combined, style_code}; use crate::native::values::Literal; /// The name `css()` errors call the call by @@ -49,7 +49,7 @@ impl<'a> Elements<'_> { self.error( offset, Problem::new( - "a press style applies while an element is pressed, which `css()` cannot tell", + "a press, hover or focus style applies while the element is in that state, which `css()` cannot tell", format!("give `{name}` to the element"), ) .on(CSS, &name), @@ -67,6 +67,16 @@ impl<'a> Elements<'_> { /// Put the style `choices` describe in place of the `css` at `span` fn css_code(&mut self, span: Span, choices: Vec) { + if choices.iter().any(|choice| choice.holds(State::Disabled)) { + self.error( + span.start, + Problem::new( + "`_disabled` applies while the element is disabled, which `css()` cannot tell", + "give `_disabled` to the element", + ) + .call(CSS), + ); + } let code = style_code( choices, (Vec::new(), Vec::new()), diff --git a/libs/extractor/src/native/element/styled.rs b/libs/extractor/src/native/element/styled.rs index 3f49a70d1..928364873 100644 --- a/libs/extractor/src/native/element/styled.rs +++ b/libs/extractor/src/native/element/styled.rs @@ -8,7 +8,7 @@ use oxc_span::{GetSpan, Span}; use super::{Elements, Frame, HookAt, component_name, defaults}; use crate::component::ExportVariableKind; use crate::native::errors::Problem; -use crate::native::style::{Choice, Reads, style_code}; +use crate::native::style::{Choice, Reads, Vars, interaction_keys, style_code}; /// The name `styled()` errors call the call by const STYLED: &str = "styled()"; @@ -168,7 +168,7 @@ impl<'a> Elements<'_> { self.error( offset, Problem::new( - "a press style needs React Native's `Pressable`, which the build knows only a Devup UI component renders", + "a press, hover or focus style needs React Native's `Pressable`, which the build knows only a Devup UI component renders", "style a `Box` or a `Button`, or pass a function reading `pressed` to the `style` of a `Pressable`", ) .on(STYLED, &name), @@ -177,15 +177,15 @@ impl<'a> Elements<'_> { } (None, _) => tag, }; - let pressed = choices.iter().any(Choice::pressed); let props = self.props.clone(); let given = format!("{props}.style"); - let style = style_code( - choices, - (Vec::new(), vec![given]), - &mut self.sheet, - &self.runtime.vars(), - ); + let disabled = format!("{props}.disabled"); + let vars = Vars { + disabled: &disabled, + ..self.runtime.vars() + }; + let keys = interaction_keys(&choices, &vars); + let style = style_code(choices, (Vec::new(), vec![given]), &mut self.sheet, &vars); let reads = style .as_ref() .map_or_else(Reads::default, |style| style.reads) @@ -196,13 +196,10 @@ impl<'a> Elements<'_> { String::new() }; let style = style.map_or_else(String::new, |style| { - let code = if pressed { - format!( - "({{ pressed: {} }}) => {}", - self.runtime.pressed, style.code - ) - } else { + let code = if keys.is_empty() { style.code + } else { + format!("({{ {} }}) => {}", keys.join(", "), style.code) }; format!(" style={{{code}}}") }); diff --git a/libs/extractor/src/native/snapshots/extractor__native__tests__css_errors.snap b/libs/extractor/src/native/snapshots/extractor__native__tests__css_errors.snap index a9c1b400e..ba1792e28 100644 --- a/libs/extractor/src/native/snapshots/extractor__native__tests__css_errors.snap +++ b/libs/extractor/src/native/snapshots/extractor__native__tests__css_errors.snap @@ -7,7 +7,7 @@ test.tsx:4:22: `css()` cannot compile here on React Native: the build reads only test.tsx:5:22: `css()` cannot use `a part` on React Native: React Native has no class names. Fix: pass what `css()` gives, or write the styles as props test.tsx:5:30: `css()` cannot use `a part` on React Native: React Native has no class names. Fix: pass what `css()` gives, or write the styles as props test.tsx:5:55: `css()` cannot use `?` on React Native: a condition in `css()` chooses between objects of styles. Fix: write each branch as an object, or as `null` -test.tsx:6:24: `css()` 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:6:24: `css()` cannot use `_hover` on React Native: a press, hover or focus style applies while the element is in that state, which `css()` cannot tell. Fix: give `_hover` to the element test.tsx:6:42: `css()` cannot use `[key]` on React Native: the build reads only keys written in a block. Fix: write the key itself test.tsx:7:18: `css` can only be called on React Native: the build compiles each call into styles. Fix: call it where the styles are used test.tsx:8:32: `css()` cannot use `className` on React Native: a block holds only style props. Fix: pass it to the element itself @@ -18,5 +18,5 @@ test.tsx:10:18: `css()` cannot use `padding ${…}px` on React Native: a declara test.tsx:10:18: `css()` cannot use `padding` on React Native: the build reads an interpolation in CSS text only as a whole value. Fix: compute the whole value in the interpolation, such as `${`${size}px`}` test.tsx:10:18: `css()` cannot use `webkitMask` on React Native: React Native has no such style. Fix: remove it, or write a style React Native has test.tsx:12:15: `` cannot use `className` on React Native: React Native has no class names. Fix: pass what `css()` gives, or write the styles as props -test.tsx:12:31: `css()` cannot use `_active` on React Native: a press style applies while an element is pressed, which `css()` cannot tell. Fix: give `_active` to the element +test.tsx:12:31: `css()` cannot use `_active` on React Native: a press, hover or focus style applies while the element is in that state, which `css()` cannot tell. Fix: give `_active` to the element test.tsx:12:91: `` cannot use `className` on React Native: React Native has no class names. Fix: pass what `css()` gives, or write the styles as props diff --git a/libs/extractor/src/native/snapshots/extractor__native__tests__interaction_errors.snap b/libs/extractor/src/native/snapshots/extractor__native__tests__interaction_errors.snap new file mode 100644 index 000000000..8ca400a42 --- /dev/null +++ b/libs/extractor/src/native/snapshots/extractor__native__tests__interaction_errors.snap @@ -0,0 +1,10 @@ +--- +source: libs/extractor/src/native/tests.rs +expression: "compile_themed(two_themes(), true, code)" +--- +error: test.tsx:3:18: `css()` cannot compile here on React Native: `_disabled` applies while the element is disabled, which `css()` cannot tell. Fix: give `_disabled` to the element +test.tsx:4:24: `css()` cannot use `_hover` on React Native: a press, hover or focus style applies while the element is in that state, which `css()` cannot tell. Fix: give `_hover` to the element +test.tsx:5:7: `` cannot use `_hover` on React Native: a press, hover or focus style needs React Native's `Pressable`, and the element renders React Native's `Text`. Fix: wrap it in a `Box` or a `Button` with `_pressed` +test.tsx:6:15: `` cannot use `_focus` on React Native: a press, hover or focus style makes the element React Native's `Pressable`, which cannot render the component `as` gives. Fix: remove `as`, or pass a function reading `pressed` to the `style` of a `Pressable` +test.tsx:7:8: `` cannot use `_hover` on React Native: a press, hover or focus style needs React Native's `Pressable`, and the element renders React Native's `TextInput`. Fix: wrap it in a `Box` or a `Button` with `_pressed` +test.tsx:8:14: `` cannot use `_before` 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 diff --git a/libs/extractor/src/native/snapshots/extractor__native__tests__interaction_states.snap b/libs/extractor/src/native/snapshots/extractor__native__tests__interaction_states.snap new file mode 100644 index 000000000..e5b7adfb7 --- /dev/null +++ b/libs/extractor/src/native/snapshots/extractor__native__tests__interaction_states.snap @@ -0,0 +1,43 @@ +--- +source: libs/extractor/src/native/tests.rs +expression: "compile_themed(two_themes(), 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 { useThemeIndex as __useThemeIndex, Focused as __Focused, defineThemes as __defineThemes } from "@devup-ui/react/native"; +__defineThemes(["light", "dark"], 1); +import { Pressable as __Pressable } from "react-native"; +import { StyleSheet } from "react-native"; +const __s = StyleSheet.create({ + a: { backgroundColor: "#5a44ff" }, + b: { backgroundColor: "#8c7bff" }, + c: { opacity: .9 }, + d: { borderColor: "blue" }, + e: { opacity: .4 }, + f: { opacity: .7 }, + g: { backgroundColor: "red" }, + h: { borderColor: "#5a44ff" }, + i: { borderColor: "#8c7bff" }, + j: { borderColor: "red" }, + k: { opacity: .5 }, + l: { padding: 4 }, + m: { padding: 8 }, + n: { margin: 4 } +}); +export function Form({ busy, go, value }) { + const __t = __useThemeIndex(); + return + + + +) + +// @ts-expect-error a View has no href +export const link = +// @ts-expect-error a TextInput reports its text with onChangeText +export const input = {}} /> diff --git a/packages/react/type-tests/native/tsconfig.json b/packages/react/type-tests/native/tsconfig.json new file mode 100644 index 000000000..ecdf8f0c4 --- /dev/null +++ b/packages/react/type-tests/native/tsconfig.json @@ -0,0 +1,11 @@ +{ + "extends": "../tsconfig.json", + "compilerOptions": { + "paths": { + "@devup-ui/react": ["../../src/index.ts"], + "@devup-ui/react/*": ["../../src/*"] + } + }, + "files": ["../../src/native/types.d.ts", "app.tsx"], + "include": [] +} diff --git a/packages/react/type-tests/published/native.tsx b/packages/react/type-tests/published/native.tsx new file mode 100644 index 000000000..a6e001e12 --- /dev/null +++ b/packages/react/type-tests/published/native.tsx @@ -0,0 +1,16 @@ +// Type-checks a React Native project against the published declarations: the +// import `@devup-ui/metro-plugin` writes types each component as the React +// Native component it renders +import '@devup-ui/react/native/types' + +import { Box, Button, Input } from '@devup-ui/react' + +export const app = ( + {}} p={2}> + text} /> + + + +) + +// @ts-expect-error a View has no href +export const link = +// @ts-expect-error a TextInput reports its text with onChangeText +export const input = {}} /> diff --git a/packages/react/type-tests/native/tsconfig.json b/packages/react/type-tests/native/tsconfig.json new file mode 100644 index 000000000..ecdf8f0c4 --- /dev/null +++ b/packages/react/type-tests/native/tsconfig.json @@ -0,0 +1,11 @@ +{ + "extends": "../tsconfig.json", + "compilerOptions": { + "paths": { + "@devup-ui/react": ["../../src/index.ts"], + "@devup-ui/react/*": ["../../src/*"] + } + }, + "files": ["../../src/native/types.d.ts", "app.tsx"], + "include": [] +} diff --git a/packages/react/type-tests/published/native.tsx b/packages/react/type-tests/published/native.tsx new file mode 100644 index 000000000..a6e001e12 --- /dev/null +++ b/packages/react/type-tests/published/native.tsx @@ -0,0 +1,16 @@ +// Type-checks a React Native project against the published declarations: the +// import `@devup-ui/metro-plugin` writes types each component as the React +// Native component it renders +import '@devup-ui/react/native/types' + +import { Box, Button, Input } from '@devup-ui/react' + +export const app = ( + {}} p={2}> + text} /> +