@native-sdk/cli 0.10.0 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -6
- package/bin/native.js +2 -1
- package/build/app.zig +320 -60
- package/build/corewire.zig +53 -0
- package/build/test_shards.zig +49 -0
- package/build/ts_run.mjs +3 -3
- package/build.zig +1818 -87
- package/package.json +19 -14
- package/packages/core/compile-surface/core.ts +134 -72
- package/packages/core/package-lock.json +75 -357
- package/packages/core/package.json +25 -4
- package/packages/core/scripts/compiler_command.mjs +17 -12
- package/packages/core/scripts/compiler_typecheck.mjs +1 -0
- package/packages/core/scripts/gen_declarations.mjs +3 -2
- package/packages/core/scripts/gen_service_surface.mjs +22 -10
- package/packages/core/scripts/install_scriptc.mjs +182 -0
- package/packages/core/scripts/invoke_scriptc.mjs +18 -0
- package/packages/core/scripts/merge_static_archives.mjs +6 -1
- package/packages/core/scripts/npm_static_spike.mjs +2 -2
- package/packages/core/scripts/run_external_core_compiler.mjs +22 -10
- package/packages/core/scripts/run_external_service_compiler.mjs +15 -15
- package/packages/core/scripts/run_library_compiler.mjs +51 -0
- package/packages/core/scripts/run_native_tests.mjs +22 -0
- package/packages/core/scripts/scriptc-toolchain.json +101 -0
- package/packages/core/scripts/scriptc_toolchain.mjs +121 -0
- package/packages/core/scripts/stage_external_core.mjs +57 -1
- package/packages/core/scripts/surface_manifest_diff.mjs +19 -12
- package/packages/core/sdk/bytes.d.ts +2 -0
- package/packages/core/sdk/bytes.ts +86 -0
- package/packages/core/sdk/core.d.ts +308 -4
- package/packages/core/sdk/core.ts +320 -84
- package/packages/core/sdk/events.d.ts +247 -0
- package/packages/core/sdk/events.ts +230 -2
- package/packages/core/sdk/internal/image_identity.d.ts +7 -0
- package/packages/core/sdk/internal/image_identity.ts +71 -0
- package/packages/core/sdk/internal/markdown_policy.d.ts +5 -0
- package/packages/core/sdk/internal/markdown_policy.ts +878 -0
- package/packages/core/sdk/text.d.ts +27 -0
- package/packages/core/sdk/text.ts +206 -15
- package/packages/core/sdk/theme.d.ts +251 -0
- package/packages/core/sdk/theme.ts +267 -0
- package/packages/core/src/authorization.ts +137 -0
- package/packages/core/src/automation_commands.ts +201 -0
- package/packages/core/src/automation_interactions.ts +92 -0
- package/packages/core/src/bridge_descriptors.ts +104 -0
- package/packages/core/src/builtin_coordination.ts +172 -0
- package/packages/core/src/canvas_frame_coordination.ts +81 -0
- package/packages/core/src/canvas_presentation_lifecycle.ts +84 -0
- package/packages/core/src/canvas_scene_observation.ts +145 -0
- package/packages/core/src/chart_content.ts +161 -0
- package/packages/core/src/chart_plans.ts +432 -0
- package/packages/core/src/checker.ts +166 -19
- package/packages/core/src/code_content.ts +580 -0
- package/packages/core/src/command_coordination.ts +140 -0
- package/packages/core/src/component_composition.ts +94 -0
- package/packages/core/src/component_construction.ts +149 -0
- package/packages/core/src/contract.ts +25 -7
- package/packages/core/src/control_appearance.ts +232 -0
- package/packages/core/src/control_commands.ts +115 -0
- package/packages/core/src/control_content.ts +105 -0
- package/packages/core/src/control_geometry.ts +107 -0
- package/packages/core/src/control_payloads.ts +119 -0
- package/packages/core/src/control_primitives.ts +134 -0
- package/packages/core/src/devhost.ts +82 -7
- package/packages/core/src/devhost_journal.mjs +30 -7
- package/packages/core/src/effect_plans.ts +71 -0
- package/packages/core/src/flow_measurement.ts +121 -0
- package/packages/core/src/font_registry.ts +37 -0
- package/packages/core/src/glyph_atlas.ts +86 -0
- package/packages/core/src/gpu_packet_preparation.ts +130 -0
- package/packages/core/src/gpu_planning.ts +123 -0
- package/packages/core/src/gpu_presentation.ts +55 -0
- package/packages/core/src/host_flow.ts +89 -0
- package/packages/core/src/host_input_regions.ts +165 -0
- package/packages/core/src/image_registry.ts +66 -0
- package/packages/core/src/indicator_plans.ts +132 -0
- package/packages/core/src/infer.ts +150 -8
- package/packages/core/src/input_composition.ts +116 -0
- package/packages/core/src/intrinsic_measure.ts +100 -0
- package/packages/core/src/layout_coordination.ts +207 -0
- package/packages/core/src/leaf_plans.ts +134 -0
- package/packages/core/src/markup_development.ts +160 -0
- package/packages/core/src/measurement_coordination.ts +185 -0
- package/packages/core/src/modules.ts +1 -1
- package/packages/core/src/motion_sampling.ts +100 -0
- package/packages/core/src/paragraph_layout.ts +192 -0
- package/packages/core/src/portable_sources.json +74 -0
- package/packages/core/src/portable_sources.ts +17 -0
- package/packages/core/src/registered_font.ts +93 -0
- package/packages/core/src/render_animation_lifecycle.ts +128 -0
- package/packages/core/src/render_coordination.ts +170 -0
- package/packages/core/src/render_resources.ts +234 -0
- package/packages/core/src/runtime_policy.ts +3930 -0
- package/packages/core/src/scalar_text.ts +84 -0
- package/packages/core/src/service_contract.ts +2 -1
- package/packages/core/src/session_codecs.ts +309 -0
- package/packages/core/src/shell_admission.ts +126 -0
- package/packages/core/src/shell_coordination.ts +93 -0
- package/packages/core/src/sqlite_cli.ts +11 -0
- package/packages/core/src/status_validation.ts +232 -0
- package/packages/core/src/stream_policy.ts +63 -0
- package/packages/core/src/surface_recipes.ts +136 -0
- package/packages/core/src/system_admission.ts +60 -0
- package/packages/core/src/terminal_paint.ts +436 -0
- package/packages/core/src/text_document_width.ts +81 -0
- package/packages/core/src/text_measurement_cache.ts +69 -0
- package/packages/core/src/text_query_layout.ts +179 -0
- package/packages/core/src/text_run_layout.ts +410 -0
- package/packages/core/src/text_span_queries.ts +355 -0
- package/packages/core/src/typed_ast.ts +18 -1
- package/packages/core/src/types.ts +7 -5
- package/packages/core/src/vector_effects.ts +98 -0
- package/packages/core/src/vector_raster.ts +243 -0
- package/packages/core/src/view_components.ts +2415 -0
- package/packages/core/src/view_coordination.ts +198 -0
- package/packages/core/src/view_frontend.ts +980 -0
- package/packages/core/src/widget_audits.ts +202 -0
- package/packages/core/src/widget_changes.ts +258 -0
- package/packages/core/src/widget_metrics.ts +139 -0
- package/packages/core/src/widget_motion.ts +171 -0
- package/packages/core/src/widget_paint.ts +272 -0
- package/packages/core/src/widget_paint_walk.ts +203 -0
- package/packages/core/src/widget_presentation.ts +141 -0
- package/packages/core/src/widget_routing.ts +262 -0
- package/packages/core/src/window_lifecycle.ts +92 -0
- package/packages/core/testing/index.ts +430 -0
- package/schemas/app.schema.json +13 -0
- package/skill-data/core/SKILL.md +2 -2
- package/skill-data/core/references/web-engines-packaging-debugging.md +2 -1
- package/skill-data/native-ui/SKILL.md +76 -17
- package/skill-data/ts-core/SKILL.md +113 -9
- package/skill-data/ts-services/SKILL.md +1 -1
- package/skill-data/ts-services/references/service-surface.md +264 -144
- package/src/app_runner/root.zig +25 -12
- package/src/app_runner/ts_compiled_view.zig +1631 -0
- package/src/app_runner/ts_core_main.zig +143 -10
- package/src/app_runner/ts_core_mobile.zig +24 -12
- package/src/automation/server.zig +1 -3
- package/src/automation/snapshot.zig +9 -637
- package/src/automation/snapshot_reference.zig +656 -0
- package/src/automation/snapshot_serialization.zig +566 -0
- package/src/platform/linux/gtk_host.c +36 -24
- package/src/platform/linux/gtk_pixels.h +118 -0
- package/src/platform/linux/gtk_pixels_test.c +241 -0
- package/src/platform/linux/root.zig +2 -0
- package/src/platform/macos/appkit_host.m +188 -30
- package/src/platform/macos/pointer_motion_test.m +96 -0
- package/src/platform/macos/scroll_driver_test.m +105 -0
- package/src/platform/macos/spectrum_bins.h +34 -0
- package/src/platform/macos/spectrum_bins_test.c +56 -0
- package/src/platform/macos/text_keyboard_test.m +80 -0
- package/src/platform/macos/widget_focus_test.m +66 -0
- package/src/platform/null_platform.zig +26 -2
- package/src/platform/null_platform_tests.zig +13 -0
- package/src/platform/root.zig +1 -0
- package/src/platform/types.zig +13 -0
- package/src/platform/windows/root.zig +2 -0
- package/src/platform/windows/webview2_host.cpp +7 -2
- package/src/primitives/app_manifest/comptime_scene.zig +1 -1
- package/src/primitives/app_manifest/root.zig +2 -0
- package/src/primitives/app_manifest/tests.zig +4 -1
- package/src/primitives/app_manifest/validation.zig +2 -0
- package/src/primitives/canvas/a11y_audit.zig +3 -1
- package/src/primitives/canvas/canvas_frame_coordination_policy.zig +134 -0
- package/src/primitives/canvas/chart_content_policy.zig +75 -0
- package/src/primitives/canvas/chart_plan_policy.zig +196 -0
- package/src/primitives/canvas/code_content_policy.zig +162 -0
- package/src/primitives/canvas/commands.zig +29 -1
- package/src/primitives/canvas/component_composition.zig +125 -0
- package/src/primitives/canvas/component_composition_policy.zig +44 -0
- package/src/primitives/canvas/component_construction_policy.zig +187 -0
- package/src/primitives/canvas/container_layout_policy.zig +87 -0
- package/src/primitives/canvas/control_appearance_policy.zig +142 -0
- package/src/primitives/canvas/control_command_policy.zig +75 -0
- package/src/primitives/canvas/control_content_policy.zig +90 -0
- package/src/primitives/canvas/control_geometry_policy.zig +165 -0
- package/src/primitives/canvas/control_payload_policy.zig +48 -0
- package/src/primitives/canvas/control_primitive_policy.zig +129 -0
- package/src/primitives/canvas/effect_plan_policy.zig +96 -0
- package/src/primitives/canvas/events.zig +1027 -1
- package/src/primitives/canvas/flow_measurement_policy.zig +237 -0
- package/src/primitives/canvas/frame.zig +92 -23
- package/src/primitives/canvas/glyph_atlas_policy.zig +40 -0
- package/src/primitives/canvas/gpu.zig +10 -0
- package/src/primitives/canvas/gpu_packet_preparation_policy.zig +325 -0
- package/src/primitives/canvas/gpu_planning_policy.zig +364 -0
- package/src/primitives/canvas/gpu_presentation_policy.zig +74 -0
- package/src/primitives/canvas/grid_layout_policy.zig +51 -0
- package/src/primitives/canvas/indicator_plan_policy.zig +128 -0
- package/src/primitives/canvas/intrinsic_layout_policy.zig +87 -0
- package/src/primitives/canvas/intrinsic_measure_policy.zig +128 -0
- package/src/primitives/canvas/layout_audit.zig +5 -2
- package/src/primitives/canvas/layout_coordination_policy.zig +262 -0
- package/src/primitives/canvas/leaf_plan_policy.zig +117 -0
- package/src/primitives/canvas/markdown.zig +13 -3
- package/src/primitives/canvas/markdown_content_policy.zig +227 -0
- package/src/primitives/canvas/markdown_image_binding.zig +81 -0
- package/src/primitives/canvas/measurement_coordination_policy.zig +288 -0
- package/src/primitives/canvas/numeric_capabilities.zig +14 -0
- package/src/primitives/canvas/reference.zig +12 -6
- package/src/primitives/canvas/registered_font_policy.zig +152 -0
- package/src/primitives/canvas/render.zig +48 -0
- package/src/primitives/canvas/render_cache_policy.zig +184 -0
- package/src/primitives/canvas/render_coordination_policy.zig +163 -0
- package/src/primitives/canvas/render_damage_policy.zig +160 -0
- package/src/primitives/canvas/render_effects.zig +14 -0
- package/src/primitives/canvas/render_generic_resources.zig +14 -0
- package/src/primitives/canvas/render_images.zig +14 -0
- package/src/primitives/canvas/render_layers.zig +14 -0
- package/src/primitives/canvas/render_override_policy.zig +119 -0
- package/src/primitives/canvas/render_paths.zig +14 -0
- package/src/primitives/canvas/render_plan_policy.zig +199 -0
- package/src/primitives/canvas/render_resource_policy.zig +476 -0
- package/src/primitives/canvas/root.zig +100 -0
- package/src/primitives/canvas/semantic_tree_policy.zig +158 -0
- package/src/primitives/canvas/serialization.zig +8 -1
- package/src/primitives/canvas/surface_layout_policy.zig +36 -0
- package/src/primitives/canvas/surface_recipe_policy.zig +231 -0
- package/src/primitives/canvas/terminal_grid.zig +10 -696
- package/src/primitives/canvas/terminal_grid_reference.zig +709 -0
- package/src/primitives/canvas/terminal_paint_policy.zig +191 -0
- package/src/primitives/canvas/text.zig +1 -0
- package/src/primitives/canvas/text_atlas.zig +113 -0
- package/src/primitives/canvas/text_cache_policy.zig +94 -0
- package/src/primitives/canvas/text_document_policy.zig +120 -0
- package/src/primitives/canvas/text_layout.zig +51 -2
- package/src/primitives/canvas/text_layout_cache.zig +29 -0
- package/src/primitives/canvas/text_layout_hash.zig +1 -0
- package/src/primitives/canvas/text_layout_types.zig +3 -0
- package/src/primitives/canvas/text_measure_cache.zig +46 -0
- package/src/primitives/canvas/text_measurement_policy.zig +124 -0
- package/src/primitives/canvas/text_metrics.zig +23 -0
- package/src/primitives/canvas/text_query_policy.zig +156 -0
- package/src/primitives/canvas/text_run_policy.zig +252 -0
- package/src/primitives/canvas/text_scalar_policy.zig +156 -0
- package/src/primitives/canvas/text_span_query_policy.zig +232 -0
- package/src/primitives/canvas/text_spans.zig +280 -8
- package/src/primitives/canvas/text_tests.zig +10 -0
- package/src/primitives/canvas/tokens.zig +38 -0
- package/src/primitives/canvas/ui.zig +250 -83
- package/src/primitives/canvas/ui_markup.zig +139 -33
- package/src/primitives/canvas/ui_markup_compiled.zig +319 -59
- package/src/primitives/canvas/ui_markup_compiled_tests.zig +225 -0
- package/src/primitives/canvas/ui_markup_contract.zig +146 -14
- package/src/primitives/canvas/ui_markup_contract_tests.zig +77 -0
- package/src/primitives/canvas/ui_markup_reflect.zig +56 -0
- package/src/primitives/canvas/ui_markup_tests.zig +116 -0
- package/src/primitives/canvas/ui_markup_view.zig +258 -32
- package/src/primitives/canvas/ui_markup_view_tests.zig +142 -10
- package/src/primitives/canvas/ui_schema.zig +13 -1
- package/src/primitives/canvas/ui_schema_tests.zig +11 -7
- package/src/primitives/canvas/ui_tests.zig +1 -0
- package/src/primitives/canvas/vector.zig +36 -2
- package/src/primitives/canvas/vector_effect_policy.zig +236 -0
- package/src/primitives/canvas/vector_raster_policy.zig +190 -0
- package/src/primitives/canvas/virtual_extent_policy.zig +292 -0
- package/src/primitives/canvas/virtual_extents.zig +99 -3
- package/src/primitives/canvas/virtual_flow_policy.zig +108 -0
- package/src/primitives/canvas/widget_audit_policy.zig +293 -0
- package/src/primitives/canvas/widget_change_policy.zig +298 -0
- package/src/primitives/canvas/widget_invalidation.zig +113 -2
- package/src/primitives/canvas/widget_layout.zig +673 -128
- package/src/primitives/canvas/widget_layout_tests.zig +4 -0
- package/src/primitives/canvas/widget_metric_policy.zig +126 -0
- package/src/primitives/canvas/widget_metrics.zig +45 -6
- package/src/primitives/canvas/widget_paint_policy.zig +166 -0
- package/src/primitives/canvas/widget_paint_walk_policy.zig +252 -0
- package/src/primitives/canvas/widget_presentation_policy.zig +168 -0
- package/src/primitives/canvas/widget_render.zig +744 -74
- package/src/primitives/canvas/widget_render_controls.zig +1217 -133
- package/src/primitives/canvas/widget_render_scroll.zig +11 -3
- package/src/primitives/canvas/widget_render_style.zig +94 -0
- package/src/primitives/canvas/widget_render_surfaces.zig +61 -50
- package/src/primitives/canvas/widget_routing.zig +75 -0
- package/src/primitives/canvas/widget_routing_policy.zig +135 -0
- package/src/primitives/canvas/widget_runtime.zig +20 -1
- package/src/primitives/canvas/widget_semantics.zig +25 -0
- package/src/primitives/canvas/widget_text_input.zig +86 -23
- package/src/primitives/canvas/widget_text_select.zig +1 -0
- package/src/primitives/canvas/widget_tree.zig +8 -1
- package/src/primitives/canvas/widgets.zig +42 -12
- package/src/primitives/canvas/wrapped_layout_policy.zig +104 -0
- package/src/root.zig +21 -0
- package/src/runtime/accessibility_policy.zig +122 -0
- package/src/runtime/api.zig +28 -0
- package/src/runtime/app_dispatch_policy.zig +68 -0
- package/src/runtime/authorization_policy.zig +150 -0
- package/src/runtime/automation_command_policy.zig +241 -0
- package/src/runtime/automation_interaction_policy.zig +107 -0
- package/src/runtime/automation_snapshot.zig +52 -22
- package/src/runtime/automation_snapshot_reference.zig +290 -0
- package/src/runtime/automation_widget_dispatch.zig +267 -355
- package/src/runtime/automation_widget_dispatch_reference.zig +900 -0
- package/src/runtime/blob_policy.zig +58 -0
- package/src/runtime/blob_reference.zig +64 -0
- package/src/runtime/bridge_descriptor_policy.zig +206 -0
- package/src/runtime/builtin_bridge.zig +180 -44
- package/src/runtime/builtin_coordination_policy.zig +121 -0
- package/src/runtime/callback_policy_test_reference.zig +97 -0
- package/src/runtime/canvas_drag_policy.zig +94 -0
- package/src/runtime/canvas_fonts.zig +38 -10
- package/src/runtime/canvas_frame.zig +590 -134
- package/src/runtime/canvas_frame_helpers.zig +1 -0
- package/src/runtime/canvas_hover_policy.zig +131 -0
- package/src/runtime/canvas_images.zig +59 -30
- package/src/runtime/canvas_keyboard_focus_policy.zig +154 -0
- package/src/runtime/canvas_limits.zig +1 -1
- package/src/runtime/canvas_presentation_lifecycle_policy.zig +86 -0
- package/src/runtime/canvas_scene_observation_policy.zig +181 -0
- package/src/runtime/canvas_widget_context_menu.zig +4 -4
- package/src/runtime/canvas_widget_display.zig +110 -9
- package/src/runtime/canvas_widget_events.zig +718 -328
- package/src/runtime/canvas_widget_runtime.zig +437 -81
- package/src/runtime/canvas_widget_scroll_drivers.zig +39 -1
- package/src/runtime/canvas_widget_scroll_tests.zig +31 -0
- package/src/runtime/canvas_widget_state.zig +93 -56
- package/src/runtime/channel_sources.zig +80 -0
- package/src/runtime/command_policy.zig +161 -0
- package/src/runtime/component_policy.zig +83 -0
- package/src/runtime/core.zig +156 -6
- package/src/runtime/desktop_files.zig +189 -0
- package/src/runtime/effects.zig +466 -29
- package/src/runtime/effects_tests.zig +28 -0
- package/src/runtime/file_policy_test_reference.zig +113 -0
- package/src/runtime/flow.zig +418 -341
- package/src/runtime/flow_reference.zig +1426 -0
- package/src/runtime/font_registry_policy.zig +72 -0
- package/src/runtime/frame_profile.zig +24 -33
- package/src/runtime/gpu_surface_events.zig +97 -35
- package/src/runtime/host_event_pump.zig +303 -0
- package/src/runtime/host_event_pump_reference.zig +268 -0
- package/src/runtime/host_flow_policy.zig +155 -0
- package/src/runtime/host_input_regions_policy.zig +156 -0
- package/src/runtime/image_registry_policy.zig +94 -0
- package/src/runtime/input_composition_policy.zig +138 -0
- package/src/runtime/journal_policy.zig +66 -0
- package/src/runtime/journal_reference.zig +53 -0
- package/src/runtime/lifecycle_policy_test_reference.zig +97 -0
- package/src/runtime/markup_development_policy.zig +91 -0
- package/src/runtime/media_surface.zig +40 -1
- package/src/runtime/motion_sampling_policy.zig +159 -0
- package/src/runtime/recording_policy.zig +42 -0
- package/src/runtime/render_animation_policy.zig +206 -0
- package/src/runtime/replay_policy.zig +66 -0
- package/src/runtime/replay_policy_reference.zig +326 -0
- package/src/runtime/replay_progress_policy.zig +64 -0
- package/src/runtime/replay_progress_reference.zig +34 -0
- package/src/runtime/request_policy_test_reference.zig +188 -0
- package/src/runtime/root.zig +13 -0
- package/src/runtime/session_blobs.zig +157 -58
- package/src/runtime/session_blobs_reference.zig +692 -0
- package/src/runtime/session_codec.zig +361 -0
- package/src/runtime/session_codec_reference.zig +1027 -0
- package/src/runtime/session_journal.zig +246 -983
- package/src/runtime/session_record.zig +224 -45
- package/src/runtime/session_replay.zig +157 -415
- package/src/runtime/session_tests.zig +552 -0
- package/src/runtime/shell_admission_policy.zig +225 -0
- package/src/runtime/shell_coordination_policy.zig +138 -0
- package/src/runtime/shell_layout.zig +126 -1
- package/src/runtime/snapshot_policy.zig +60 -0
- package/src/runtime/snapshot_reference.zig +64 -0
- package/src/runtime/state.zig +16 -0
- package/src/runtime/status_validation.zig +190 -0
- package/src/runtime/system_admission_policy.zig +140 -0
- package/src/runtime/system_services.zig +46 -36
- package/src/runtime/tests.zig +1 -0
- package/src/runtime/ts_canvas_hooks.zig +261 -0
- package/src/runtime/ts_canvas_hooks_tests.zig +279 -0
- package/src/runtime/ts_canvas_icons.zig +234 -0
- package/src/runtime/ts_core_host.zig +2325 -411
- package/src/runtime/ts_core_host_tests.zig +1982 -0
- package/src/runtime/ts_test_host.zig +699 -0
- package/src/runtime/ts_ui_app.zig +1087 -45
- package/src/runtime/ui_app.zig +1117 -629
- package/src/runtime/ui_app_provenance.zig +147 -5
- package/src/runtime/ui_app_provenance_reference.zig +370 -0
- package/src/runtime/ui_app_tests.zig +619 -9
- package/src/runtime/ui_app_window_tests.zig +89 -0
- package/src/runtime/view.zig +25 -0
- package/src/runtime/view_canvas.zig +30 -6
- package/src/runtime/view_coordination_policy.zig +147 -0
- package/src/runtime/view_widget_control.zig +51 -14
- package/src/runtime/view_widget_scroll.zig +16 -5
- package/src/runtime/view_widget_text.zig +153 -68
- package/src/runtime/view_widget_tree.zig +460 -56
- package/src/runtime/webview_view_bridge_tests.zig +2 -0
- package/src/runtime/widget_motion_policy.zig +238 -0
- package/src/runtime/window_command_bridge_tests.zig +63 -0
- package/src/runtime/window_lifecycle_policy.zig +127 -0
- package/src/runtime/window_storage.zig +74 -8
- package/src/runtime/window_view_runtime.zig +148 -33
- package/src/runtime/window_views.zig +163 -10
- package/src/tooling/codesign.zig +125 -74
- package/src/tooling/components/identity_tests.zig +62 -36
- package/src/tooling/components/stepper.native +24 -0
- package/src/tooling/components/stepper.zig +0 -19
- package/src/tooling/components/timeline-item.native +22 -0
- package/src/tooling/components/timeline.native +5 -3
- package/src/tooling/components/timeline_item.zig +0 -32
- package/src/tooling/eject_components.zig +76 -8
- package/src/tooling/ios.zig +66 -12
- package/src/tooling/manifest.zig +35 -0
- package/src/tooling/package.zig +85 -1
- package/src/tooling/raw_manifest.zig +6 -0
- package/src/tooling/templates.zig +15 -3
- package/src/tooling/ts_core.zig +13 -3
- package/src/tooling/verbs.zig +22 -0
- package/tools/corewire/build_profile.mjs +54 -0
- package/tools/corewire/contract_intake.ts +303 -0
- package/tools/corewire/contract_intake.zig +82 -0
- package/tools/corewire/core.test.ts +166 -0
- package/tools/corewire/core_abi.zig +51 -0
- package/tools/corewire/core_cases.ts +233 -0
- package/tools/corewire/core_contract.ts +407 -0
- package/tools/corewire/core_emission.ts +136 -0
- package/tools/corewire/core_emission.zig +69 -0
- package/tools/corewire/core_goldens.json +3110 -0
- package/tools/corewire/core_policy.ts +14 -0
- package/tools/corewire/core_policy.zig +48 -0
- package/tools/corewire/core_projection.ts +360 -0
- package/tools/corewire/core_vocabulary.ts +6 -0
- package/tools/corewire/emit.zig +19 -1590
- package/tools/corewire/emit_facade.ts +714 -0
- package/tools/corewire/emit_facade.zig +10 -3752
- package/tools/corewire/emit_mirror.ts +290 -0
- package/tools/corewire/emit_profile.ts +50 -0
- package/tools/corewire/emit_service.ts +331 -0
- package/tools/corewire/emit_service.zig +23 -842
- package/tools/corewire/entry.test.ts +95 -0
- package/tools/corewire/entry_coordination.ts +127 -0
- package/tools/corewire/entry_coordination.zig +190 -0
- package/tools/corewire/facade_templates.ts +85 -0
- package/tools/corewire/filesystem.test.ts +166 -0
- package/tools/corewire/filesystem_coordination.ts +213 -0
- package/tools/corewire/filesystem_coordination.zig +245 -0
- package/tools/corewire/intake.test.ts +35 -0
- package/tools/corewire/intake_cases.ts +55 -0
- package/tools/corewire/intake_goldens.json +12237 -0
- package/tools/corewire/invocation.test.ts +24 -0
- package/tools/corewire/invocation.ts +175 -0
- package/tools/corewire/invocation.zig +136 -0
- package/tools/corewire/invocation_cases.ts +60 -0
- package/tools/corewire/invocation_fixture.ts +33 -0
- package/tools/corewire/invocation_goldens.json +1143 -0
- package/tools/corewire/invocation_tests.zig +111 -0
- package/tools/corewire/invocation_usage.ts +2 -0
- package/tools/corewire/lossless_projection.ts +96 -0
- package/tools/corewire/main.zig +7 -680
- package/tools/corewire/main_reference.zig +415 -0
- package/tools/corewire/mirror_templates.ts +55 -0
- package/tools/corewire/profile.test.ts +248 -0
- package/tools/corewire/profile.zig +56 -0
- package/tools/corewire/profile_emission.ts +202 -0
- package/tools/corewire/profile_library.json +29 -0
- package/tools/corewire/profile_tests.zig +136 -0
- package/tools/corewire/service.test.ts +75 -0
- package/tools/corewire/service_cases.ts +61 -0
- package/tools/corewire/service_contract.zig +40 -146
- package/tools/corewire/service_goldens.json +650 -0
- package/tools/corewire/service_projection.zig +52 -0
- package/tools/corewire/service_templates.ts +14 -0
- package/tools/corewire/shim_rt.zig +9 -0
- package/tools/corewire/sidecar.zig +267 -1438
- package/tools/corewire/emit_profile.zig +0 -521
|
@@ -48,6 +48,33 @@ export interface TextEditState {
|
|
|
48
48
|
readonly selection: TextSelection;
|
|
49
49
|
readonly composition: TextRange | null;
|
|
50
50
|
}
|
|
51
|
+
/** Indentation inserted by a code editor's plain Tab. Nonempty indented
|
|
52
|
+
* lines vote for tabs or spaces; space widths 2–8 compete by divisibility,
|
|
53
|
+
* with wider widths winning ties. A tied tab vote follows the caret's
|
|
54
|
+
* current line. Unindented and ambiguous files use two spaces.
|
|
55
|
+
*/
|
|
56
|
+
export declare function codeIndentationInsertion(text: Uint8Array, caret: number): Uint8Array;
|
|
57
|
+
/** Parse one-based code diff lines, such as `2-4, 7`. Lines are unique,
|
|
58
|
+
* retain author order, and range from 1 through 128. Empty ASCII-whitespace
|
|
59
|
+
* text produces no lines; malformed pieces or descending ranges return null.
|
|
60
|
+
* Decimal names accept a leading + and interior underscores, matching the
|
|
61
|
+
* native markup parser. Returns a fresh array; source bytes are never changed.
|
|
62
|
+
*/
|
|
63
|
+
export declare function parseCodeLineNumberSpec(spec: Uint8Array): number[] | null;
|
|
64
|
+
export declare function sanitizedSingleLineTextInputEvent(event: TextInputEvent): TextInputEvent | null;
|
|
65
|
+
/** Source-byte range for Copy/Cut. Clamp and order the selection, then snap
|
|
66
|
+
* its endpoints to UTF-8 boundaries. Missing or collapsed selections return
|
|
67
|
+
* null. The current selection supplies the range; line numbers and diff
|
|
68
|
+
* markers never enter the source bytes.
|
|
69
|
+
*/
|
|
70
|
+
export declare function textClipboardRange(text: Uint8Array, selection: TextSelection | null): TextRange | null;
|
|
71
|
+
/** Select the word, whitespace run or punctuation cluster at a UTF-8 byte
|
|
72
|
+
* offset. An offset at or beyond the end selects the trailing run.
|
|
73
|
+
*/
|
|
74
|
+
export declare function textWordSelectionAtOffset(text: Uint8Array, offset: number): TextSelection;
|
|
75
|
+
/** Select a hard-newline line without its LF or CRLF terminator. */
|
|
76
|
+
export declare function textLineSelectionAtOffset(text: Uint8Array, offset: number): TextSelection;
|
|
77
|
+
export declare function caretSelectionAt(anchor: number, focus: number): TextSelection;
|
|
51
78
|
export declare function applyTextInputEvent(state: TextEditState, event: TextInputEvent, capacity: number): TextEditState | null;
|
|
52
79
|
export declare function clampedInsertEvent(state: TextEditState, event: TextInputEvent, capacity: number): TextInputEvent | null;
|
|
53
80
|
export declare function containsIgnoreCase(haystack: Uint8Array, needle: Uint8Array): boolean;
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
// runs as-is — byte for byte the same results.
|
|
6
6
|
//
|
|
7
7
|
// This is the TS counterpart of the runtime's TextBuffer, extracted from
|
|
8
|
-
// the soundboard
|
|
8
|
+
// the soundboard and system-monitor ports (which carried identical
|
|
9
9
|
// private copies): UTF-8 byte splicing, caret and word movement, selection,
|
|
10
10
|
// IME composition, capacity-refusal with a clamped-insert recovery, ASCII
|
|
11
11
|
// trimming, and ASCII case-insensitive comparison. A core that binds a
|
|
@@ -73,10 +73,166 @@ export interface TextEditState {
|
|
|
73
73
|
readonly composition: TextRange | null;
|
|
74
74
|
}
|
|
75
75
|
|
|
76
|
+
/** Indentation inserted by a code editor's plain Tab. Nonempty indented
|
|
77
|
+
* lines vote for tabs or spaces; space widths 2–8 compete by divisibility,
|
|
78
|
+
* with wider widths winning ties. A tied tab vote follows the caret's
|
|
79
|
+
* current line. Unindented and ambiguous files use two spaces.
|
|
80
|
+
*/
|
|
81
|
+
export function codeIndentationInsertion(text: Uint8Array, caret: number): Uint8Array {
|
|
82
|
+
let tabLines = 0, spaceLines = 0, onlySpaceIndent = 0;
|
|
83
|
+
const scores = [0, 0, 0, 0, 0, 0, 0, 0, 0];
|
|
84
|
+
let lineStart = 0;
|
|
85
|
+
while (lineStart <= text.length) {
|
|
86
|
+
let end = lineStart;
|
|
87
|
+
while (end < text.length && text[end] !== 10) end += 1;
|
|
88
|
+
let cursor = lineStart, spaces = 0, tabs = 0;
|
|
89
|
+
while (cursor < end) {
|
|
90
|
+
if (text[cursor] === 32) spaces += 1;
|
|
91
|
+
else if (text[cursor] === 9) tabs += 1;
|
|
92
|
+
else break;
|
|
93
|
+
cursor += 1;
|
|
94
|
+
}
|
|
95
|
+
if (cursor < end && cursor > lineStart) {
|
|
96
|
+
if (tabs > 0) tabLines += 1;
|
|
97
|
+
else {
|
|
98
|
+
spaceLines += 1;
|
|
99
|
+
onlySpaceIndent = spaceLines === 1 ? spaces : 0;
|
|
100
|
+
for (let width = 2; width <= 8; width += 1) {
|
|
101
|
+
if (spaces % width === 0) scores[width] = scores[width]! + 1;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
if (end === text.length) break;
|
|
106
|
+
lineStart = end + 1;
|
|
107
|
+
}
|
|
108
|
+
const offset = Math.min(Math.max(caret, 0), text.length);
|
|
109
|
+
let localStart = 0;
|
|
110
|
+
for (let i = 0; i < offset; i += 1) if (text[i] === 10) localStart = i + 1;
|
|
111
|
+
if (tabLines > spaceLines || tabLines === spaceLines && tabLines > 0 && localStart < text.length && text[localStart] === 9) {
|
|
112
|
+
const result = new Uint8Array(1); result[0] = 9; return result;
|
|
113
|
+
}
|
|
114
|
+
let inferred = 2;
|
|
115
|
+
if (spaceLines === 1) {
|
|
116
|
+
if (onlySpaceIndent >= 2 && onlySpaceIndent <= 8) inferred = onlySpaceIndent;
|
|
117
|
+
} else if (spaceLines > 1) {
|
|
118
|
+
let bestWidth = 2, bestScore = 0;
|
|
119
|
+
for (let width = 2; width <= 8; width += 1) {
|
|
120
|
+
const score = scores[width]!;
|
|
121
|
+
if (score > bestScore || score === bestScore && score > 0 && width > bestWidth) {
|
|
122
|
+
bestWidth = width; bestScore = score;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
if (bestScore * 2 >= spaceLines) inferred = bestWidth;
|
|
126
|
+
}
|
|
127
|
+
const result = new Uint8Array(inferred);
|
|
128
|
+
for (let i = 0; i < inferred; i += 1) result[i] = 32;
|
|
129
|
+
return result;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
/** Parse one-based code diff lines, such as `2-4, 7`. Lines are unique,
|
|
133
|
+
* retain author order, and range from 1 through 128. Empty ASCII-whitespace
|
|
134
|
+
* text produces no lines; malformed pieces or descending ranges return null.
|
|
135
|
+
* Decimal names accept a leading + and interior underscores, matching the
|
|
136
|
+
* native markup parser. Returns a fresh array; source bytes are never changed.
|
|
137
|
+
*/
|
|
138
|
+
export function parseCodeLineNumberSpec(spec: Uint8Array): number[] | null {
|
|
139
|
+
let start = 0, end = spec.length;
|
|
140
|
+
while (start < end && codeSpecWhitespace(spec[start], true)) start += 1;
|
|
141
|
+
while (end > start && codeSpecWhitespace(spec[end - 1], true)) end -= 1;
|
|
142
|
+
const result: number[] = [];
|
|
143
|
+
const seen = new Uint8Array(129);
|
|
144
|
+
while (start < end) {
|
|
145
|
+
let after = start;
|
|
146
|
+
while (after < end && spec[after] !== 44) after += 1;
|
|
147
|
+
let firstByte = start, lastByte = after;
|
|
148
|
+
while (firstByte < lastByte && codeSpecWhitespace(spec[firstByte], true)) firstByte += 1;
|
|
149
|
+
while (lastByte > firstByte && codeSpecWhitespace(spec[lastByte - 1], true)) lastByte -= 1;
|
|
150
|
+
if (firstByte === lastByte) return null;
|
|
151
|
+
let dash = -1;
|
|
152
|
+
for (let i = firstByte; i < lastByte; i += 1) {
|
|
153
|
+
if (spec[i] === 45) {
|
|
154
|
+
if (dash !== -1) return null;
|
|
155
|
+
dash = i;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
const first = codeSpecNumber(spec, firstByte, dash === -1 ? lastByte : dash);
|
|
159
|
+
const last = dash === -1 ? first : codeSpecNumber(spec, dash + 1, lastByte);
|
|
160
|
+
if (first === 0 || last < first) return null;
|
|
161
|
+
for (let line = first; line <= last; line += 1) {
|
|
162
|
+
if (seen[line] === 0) { seen[line] = 1; result.push(line); }
|
|
163
|
+
}
|
|
164
|
+
if (after === end) break;
|
|
165
|
+
start = after + 1;
|
|
166
|
+
if (start === end) return null;
|
|
167
|
+
}
|
|
168
|
+
return result;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
function codeSpecWhitespace(byte: number, breaks: boolean): boolean {
|
|
172
|
+
return byte === 32 || byte === 9 || breaks && (byte === 10 || byte === 13);
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
function codeSpecNumber(spec: Uint8Array, from: number, to: number): number {
|
|
176
|
+
let start = from, end = to;
|
|
177
|
+
while (start < end && codeSpecWhitespace(spec[start], false)) start += 1;
|
|
178
|
+
while (end > start && codeSpecWhitespace(spec[end - 1], false)) end -= 1;
|
|
179
|
+
if (start < end && spec[start] === 43) start += 1;
|
|
180
|
+
if (start === end || spec[start] === 95 || spec[end - 1] === 95) return 0;
|
|
181
|
+
let value = 0;
|
|
182
|
+
for (let i = start; i < end; i += 1) {
|
|
183
|
+
const byte = spec[i];
|
|
184
|
+
if (byte === 95) continue;
|
|
185
|
+
if (byte < 48 || byte > 57) return 0;
|
|
186
|
+
value = value * 10 + byte - 48;
|
|
187
|
+
if (value > 128) return 0;
|
|
188
|
+
}
|
|
189
|
+
return value;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
/// Prepare new single-line input by removing CR/LF bytes. An insertion
|
|
193
|
+
/// containing only line breaks is suppressed; an empty composition stays
|
|
194
|
+
/// meaningful and its explicit cursor moves past the removed bytes.
|
|
195
|
+
/// Clean and over-budget events retain their original borrowed payload.
|
|
196
|
+
/// Retained history is state, so replay it without this new-input step.
|
|
197
|
+
export function sanitizedSingleLineTextInputEvent(event: TextInputEvent): TextInputEvent | null {
|
|
198
|
+
if (event.kind !== "insert_text" && event.kind !== "set_composition") return event;
|
|
199
|
+
const text = event.text;
|
|
200
|
+
if (text.length > 512 * 1024) return event;
|
|
201
|
+
let length = 0;
|
|
202
|
+
for (const byte of text) if (byte !== 10 && byte !== 13) length += 1;
|
|
203
|
+
if (length === text.length) return event;
|
|
204
|
+
if (event.kind === "insert_text" && length === 0) return null;
|
|
205
|
+
const stripped = new Uint8Array(length);
|
|
206
|
+
const cursor = event.kind === "set_composition" ? Math.min(event.cursor === null ? text.length : event.cursor, text.length) : 0;
|
|
207
|
+
let written = 0, removedBeforeCursor = 0;
|
|
208
|
+
for (let i = 0; i < text.length; i++) {
|
|
209
|
+
const byte = text[i];
|
|
210
|
+
if (byte === 10 || byte === 13) {
|
|
211
|
+
if (i < cursor) removedBeforeCursor += 1;
|
|
212
|
+
} else {
|
|
213
|
+
stripped[written] = byte;
|
|
214
|
+
written += 1;
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
if (event.kind === "insert_text") return { kind: "insert_text", text: stripped };
|
|
218
|
+
const shifted = cursor - removedBeforeCursor;
|
|
219
|
+
if (!(shifted >= 0 && shifted <= 512 * 1024)) return null;
|
|
220
|
+
return { kind: "set_composition", text: stripped,
|
|
221
|
+
cursor: event.cursor === null && shifted === stripped.length ? null : Math.trunc(shifted) };
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
// Byte ranges cross the same integer ABI as caret selections. State the
|
|
225
|
+
// ordered bounds and whole-byte intent at the record construction boundary.
|
|
226
|
+
function textRangeAt(start: number, end: number): TextRange {
|
|
227
|
+
const wholeStart = start >= 0 && start <= 9007199254740991 ? Math.trunc(start) : 0;
|
|
228
|
+
const wholeEnd = end >= 0 && end <= 9007199254740991 ? Math.trunc(end) : 0;
|
|
229
|
+
return { start: wholeStart, end: wholeEnd };
|
|
230
|
+
}
|
|
231
|
+
|
|
76
232
|
function rangeNormalized(r: TextRange, textLen: number): TextRange {
|
|
77
233
|
const start = Math.min(r.start, textLen);
|
|
78
234
|
const end = Math.min(r.end, textLen);
|
|
79
|
-
return start <= end ?
|
|
235
|
+
return start <= end ? textRangeAt(start, end) : textRangeAt(end, start);
|
|
80
236
|
}
|
|
81
237
|
|
|
82
238
|
function rangeByteLen(r: TextRange, textLen: number): number {
|
|
@@ -90,7 +246,18 @@ function rangeIsCollapsed(r: TextRange, textLen: number): boolean {
|
|
|
90
246
|
}
|
|
91
247
|
|
|
92
248
|
function selectionRange(s: TextSelection, textLen: number): TextRange {
|
|
93
|
-
return rangeNormalized(
|
|
249
|
+
return rangeNormalized(textRangeAt(s.anchor, s.focus), textLen);
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
/** Source-byte range for Copy/Cut. Clamp and order the selection, then snap
|
|
253
|
+
* its endpoints to UTF-8 boundaries. Missing or collapsed selections return
|
|
254
|
+
* null. The current selection supplies the range; line numbers and diff
|
|
255
|
+
* markers never enter the source bytes.
|
|
256
|
+
*/
|
|
257
|
+
export function textClipboardRange(text: Uint8Array, selection: TextSelection | null): TextRange | null {
|
|
258
|
+
if (selection === null) return null;
|
|
259
|
+
const range = snapTextRange(text, selectionRange(selection, text.length));
|
|
260
|
+
return range.start === range.end ? null : range;
|
|
94
261
|
}
|
|
95
262
|
|
|
96
263
|
function isUtf8ContinuationByte(byte: number): boolean {
|
|
@@ -192,6 +359,33 @@ function textOffsetStartsWord(text: Uint8Array, offset: number): boolean {
|
|
|
192
359
|
return cls !== null && cls === 0;
|
|
193
360
|
}
|
|
194
361
|
|
|
362
|
+
/** Select the word, whitespace run or punctuation cluster at a UTF-8 byte
|
|
363
|
+
* offset. An offset at or beyond the end selects the trailing run.
|
|
364
|
+
*/
|
|
365
|
+
export function textWordSelectionAtOffset(text: Uint8Array, offset: number): TextSelection {
|
|
366
|
+
if (text.length === 0) return caretSelectionAt(0, 0);
|
|
367
|
+
let cursor = snapTextOffset(text, offset);
|
|
368
|
+
if (cursor >= text.length) cursor = previousTextOffset(text, text.length);
|
|
369
|
+
const kind = textRunClassAt(text, cursor);
|
|
370
|
+
let start = cursor;
|
|
371
|
+
while (start > 0) {
|
|
372
|
+
const previous = previousTextOffset(text, start);
|
|
373
|
+
if (textRunClassAt(text, previous) !== kind) break;
|
|
374
|
+
start = previous;
|
|
375
|
+
}
|
|
376
|
+
let end = nextTextOffset(text, cursor);
|
|
377
|
+
while (end < text.length && textRunClassAt(text, end) === kind) end = nextTextOffset(text, end);
|
|
378
|
+
return caretSelectionAt(start, end);
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
/** Select a hard-newline line without its LF or CRLF terminator. */
|
|
382
|
+
export function textLineSelectionAtOffset(text: Uint8Array, offset: number): TextSelection {
|
|
383
|
+
let end = snapTextOffset(text, offset);
|
|
384
|
+
while (end < text.length && text[end] !== 0x0a) end += 1;
|
|
385
|
+
if (end > 0 && end < text.length && text[end - 1] === 0x0d) end -= 1;
|
|
386
|
+
return caretSelectionAt(textLineStartOffset(text, offset), end);
|
|
387
|
+
}
|
|
388
|
+
|
|
195
389
|
function previousTextWordOffset(text: Uint8Array, offset: number): number {
|
|
196
390
|
let cursor = snapTextOffset(text, offset);
|
|
197
391
|
while (cursor > 0) {
|
|
@@ -223,7 +417,7 @@ function nextTextWordOffset(text: Uint8Array, offset: number): number {
|
|
|
223
417
|
/// excludes NaN) and stated whole with Math.trunc. A value outside the
|
|
224
418
|
/// provable ±(2^53 − 1) window clamps to 0, the same floor every
|
|
225
419
|
/// caller's snap already applies.
|
|
226
|
-
function caretSelectionAt(anchor: number, focus: number): TextSelection {
|
|
420
|
+
export function caretSelectionAt(anchor: number, focus: number): TextSelection {
|
|
227
421
|
const wholeAnchor = anchor >= 0 && anchor <= 9007199254740991 ? Math.trunc(anchor) : 0;
|
|
228
422
|
const wholeFocus = focus >= 0 && focus <= 9007199254740991 ? Math.trunc(focus) : 0;
|
|
229
423
|
return { anchor: wholeAnchor, focus: wholeFocus };
|
|
@@ -239,10 +433,7 @@ function snapTextCaretSelection(text: Uint8Array, selection: TextSelection): Tex
|
|
|
239
433
|
function snapTextRange(text: Uint8Array, range: TextRange): TextRange {
|
|
240
434
|
const normalized = rangeNormalized(range, text.length);
|
|
241
435
|
return rangeNormalized(
|
|
242
|
-
|
|
243
|
-
start: snapTextOffset(text, normalized.start),
|
|
244
|
-
end: snapTextOffset(text, normalized.end),
|
|
245
|
-
},
|
|
436
|
+
textRangeAt(snapTextOffset(text, normalized.start), snapTextOffset(text, normalized.end)),
|
|
246
437
|
text.length,
|
|
247
438
|
);
|
|
248
439
|
}
|
|
@@ -322,7 +513,7 @@ function setTextComposition(
|
|
|
322
513
|
return {
|
|
323
514
|
text: result.text,
|
|
324
515
|
selection: caretSelectionAt(absoluteCursor, absoluteCursor),
|
|
325
|
-
composition:
|
|
516
|
+
composition: textRangeAt(result.insertedStart, result.insertedEnd),
|
|
326
517
|
};
|
|
327
518
|
}
|
|
328
519
|
|
|
@@ -352,7 +543,7 @@ function deleteBackwardTextEdit(state: TextEditState, capacity: number): TextEdi
|
|
|
352
543
|
}
|
|
353
544
|
return replaceTextEditRange(
|
|
354
545
|
state,
|
|
355
|
-
|
|
546
|
+
textRangeAt(previousTextCaretOffset(state.text, caret), caret),
|
|
356
547
|
new Uint8Array(0),
|
|
357
548
|
capacity,
|
|
358
549
|
null,
|
|
@@ -372,7 +563,7 @@ function deleteForwardTextEdit(state: TextEditState, capacity: number): TextEdit
|
|
|
372
563
|
}
|
|
373
564
|
return replaceTextEditRange(
|
|
374
565
|
state,
|
|
375
|
-
|
|
566
|
+
textRangeAt(caret, nextTextCaretOffset(state.text, caret)),
|
|
376
567
|
new Uint8Array(0),
|
|
377
568
|
capacity,
|
|
378
569
|
null,
|
|
@@ -391,7 +582,7 @@ function deleteWordBackwardTextEdit(state: TextEditState, capacity: number): Tex
|
|
|
391
582
|
}
|
|
392
583
|
return replaceTextEditRange(
|
|
393
584
|
state,
|
|
394
|
-
|
|
585
|
+
textRangeAt(previousTextWordOffset(state.text, caret), caret),
|
|
395
586
|
new Uint8Array(0),
|
|
396
587
|
capacity,
|
|
397
588
|
null,
|
|
@@ -411,7 +602,7 @@ function deleteWordForwardTextEdit(state: TextEditState, capacity: number): Text
|
|
|
411
602
|
}
|
|
412
603
|
return replaceTextEditRange(
|
|
413
604
|
state,
|
|
414
|
-
|
|
605
|
+
textRangeAt(caret, nextTextWordOffset(state.text, caret)),
|
|
415
606
|
new Uint8Array(0),
|
|
416
607
|
capacity,
|
|
417
608
|
null,
|
|
@@ -436,7 +627,7 @@ function deleteToStartTextEdit(state: TextEditState, capacity: number): TextEdit
|
|
|
436
627
|
}
|
|
437
628
|
return replaceTextEditRange(
|
|
438
629
|
state,
|
|
439
|
-
|
|
630
|
+
textRangeAt(0, caret),
|
|
440
631
|
new Uint8Array(0),
|
|
441
632
|
capacity,
|
|
442
633
|
null,
|
|
@@ -456,7 +647,7 @@ function deleteToLineStartTextEdit(state: TextEditState, capacity: number): Text
|
|
|
456
647
|
}
|
|
457
648
|
return replaceTextEditRange(
|
|
458
649
|
state,
|
|
459
|
-
|
|
650
|
+
textRangeAt(lineStart, caret),
|
|
460
651
|
new Uint8Array(0),
|
|
461
652
|
capacity,
|
|
462
653
|
null,
|
|
@@ -0,0 +1,251 @@
|
|
|
1
|
+
export type ThemeColor = {
|
|
2
|
+
readonly r: number;
|
|
3
|
+
readonly g: number;
|
|
4
|
+
readonly b: number;
|
|
5
|
+
readonly a: number;
|
|
6
|
+
};
|
|
7
|
+
export type ThemeFontFamily = "geist" | "geist_mono" | "system_sans" | "system_mono";
|
|
8
|
+
export type ThemeSpinnerStyleToken = "arc" | "segmented";
|
|
9
|
+
export type ThemeEasing = "linear" | "standard" | "emphasized" | "spring";
|
|
10
|
+
export type ThemeScrollOverscroll = "none" | "rubber_band";
|
|
11
|
+
export type ThemeTabsIndicatorKind = "pill" | "underline";
|
|
12
|
+
export type ThemeButtonGroupKind = "segmented" | "detached";
|
|
13
|
+
export type ThemeDensity = "compact" | "regular" | "spacious";
|
|
14
|
+
export type ThemeColorTokenOverrides = {
|
|
15
|
+
readonly background?: ThemeColor;
|
|
16
|
+
readonly surface?: ThemeColor;
|
|
17
|
+
readonly surface_subtle?: ThemeColor;
|
|
18
|
+
readonly surface_pressed?: ThemeColor;
|
|
19
|
+
readonly text?: ThemeColor;
|
|
20
|
+
readonly text_muted?: ThemeColor;
|
|
21
|
+
readonly syntax_plain?: ThemeColor;
|
|
22
|
+
readonly syntax_comment?: ThemeColor;
|
|
23
|
+
readonly syntax_keyword?: ThemeColor;
|
|
24
|
+
readonly syntax_literal?: ThemeColor;
|
|
25
|
+
readonly syntax_function?: ThemeColor;
|
|
26
|
+
readonly syntax_property?: ThemeColor;
|
|
27
|
+
readonly syntax_constant?: ThemeColor;
|
|
28
|
+
readonly border?: ThemeColor;
|
|
29
|
+
readonly accent?: ThemeColor;
|
|
30
|
+
readonly accent_text?: ThemeColor;
|
|
31
|
+
readonly destructive?: ThemeColor;
|
|
32
|
+
readonly destructive_text?: ThemeColor;
|
|
33
|
+
readonly success?: ThemeColor;
|
|
34
|
+
readonly success_text?: ThemeColor;
|
|
35
|
+
readonly warning?: ThemeColor;
|
|
36
|
+
readonly warning_text?: ThemeColor;
|
|
37
|
+
readonly info?: ThemeColor;
|
|
38
|
+
readonly info_text?: ThemeColor;
|
|
39
|
+
readonly focus_ring?: ThemeColor;
|
|
40
|
+
readonly shadow?: ThemeColor;
|
|
41
|
+
readonly scrim?: ThemeColor;
|
|
42
|
+
readonly disabled?: ThemeColor;
|
|
43
|
+
};
|
|
44
|
+
export type ThemeTypographyTokenOverrides = {
|
|
45
|
+
readonly font_id?: number;
|
|
46
|
+
readonly mono_font_id?: number;
|
|
47
|
+
readonly font_family?: ThemeFontFamily;
|
|
48
|
+
readonly mono_font_family?: ThemeFontFamily;
|
|
49
|
+
readonly body_size?: number;
|
|
50
|
+
readonly label_size?: number;
|
|
51
|
+
readonly title_size?: number;
|
|
52
|
+
readonly button_size?: number;
|
|
53
|
+
readonly button_font_id?: number;
|
|
54
|
+
readonly heading_size?: number;
|
|
55
|
+
readonly display_size?: number;
|
|
56
|
+
};
|
|
57
|
+
export type ThemeSpacingTokenOverrides = {
|
|
58
|
+
readonly xs?: number;
|
|
59
|
+
readonly sm?: number;
|
|
60
|
+
readonly md?: number;
|
|
61
|
+
readonly lg?: number;
|
|
62
|
+
readonly xl?: number;
|
|
63
|
+
};
|
|
64
|
+
export type ThemeRadiusTokenOverrides = {
|
|
65
|
+
readonly sm?: number;
|
|
66
|
+
readonly md?: number;
|
|
67
|
+
readonly lg?: number;
|
|
68
|
+
readonly xl?: number;
|
|
69
|
+
};
|
|
70
|
+
export type ThemeStrokeTokenOverrides = {
|
|
71
|
+
readonly hairline?: number;
|
|
72
|
+
readonly regular?: number;
|
|
73
|
+
readonly focus?: number;
|
|
74
|
+
readonly focus_offset?: number;
|
|
75
|
+
};
|
|
76
|
+
export type ThemeStateTokenOverrides = {
|
|
77
|
+
readonly hover_fill_alpha?: number;
|
|
78
|
+
readonly pressed_fill_alpha?: number;
|
|
79
|
+
readonly disabled_alpha?: number;
|
|
80
|
+
readonly selection_wash_alpha?: number;
|
|
81
|
+
readonly destructive_wash_alpha?: number;
|
|
82
|
+
readonly destructive_wash_hover_alpha?: number;
|
|
83
|
+
readonly destructive_wash_pressed_alpha?: number;
|
|
84
|
+
readonly badge_destructive_wash_alpha?: number;
|
|
85
|
+
readonly secondary_hover_alpha?: number;
|
|
86
|
+
};
|
|
87
|
+
export type ThemeControlMetricTokenOverrides = {
|
|
88
|
+
readonly control_height_sm?: number;
|
|
89
|
+
readonly control_height?: number;
|
|
90
|
+
readonly control_height_lg?: number;
|
|
91
|
+
readonly button_inset_sm?: number;
|
|
92
|
+
readonly button_inset?: number;
|
|
93
|
+
readonly button_inset_lg?: number;
|
|
94
|
+
readonly button_label_sm_step?: number;
|
|
95
|
+
readonly button_label_lg_step?: number;
|
|
96
|
+
readonly button_icon_gap?: number;
|
|
97
|
+
readonly icon_text_step?: number;
|
|
98
|
+
readonly row_extent?: number;
|
|
99
|
+
readonly size_inset_step?: number;
|
|
100
|
+
readonly slider_track_height?: number;
|
|
101
|
+
readonly slider_thumb_width?: number;
|
|
102
|
+
readonly slider_thumb_height?: number;
|
|
103
|
+
readonly tabs_indicator_thickness?: number;
|
|
104
|
+
readonly tabs_list_inset?: number;
|
|
105
|
+
readonly tabs_list_full_width?: boolean;
|
|
106
|
+
readonly tabs_trigger_height?: number;
|
|
107
|
+
readonly tabs_trigger_inset?: number;
|
|
108
|
+
readonly tabs_label_size_step?: number;
|
|
109
|
+
readonly tabs_gap?: number;
|
|
110
|
+
readonly button_group_gap?: number;
|
|
111
|
+
readonly spinner_style?: ThemeSpinnerStyleToken;
|
|
112
|
+
readonly spinner_segment_count?: number;
|
|
113
|
+
readonly spinner_segment_length_ratio?: number;
|
|
114
|
+
readonly spinner_segment_thickness_ratio?: number;
|
|
115
|
+
readonly spinner_segment_radius_ratio?: number;
|
|
116
|
+
readonly spinner_tail_opacity?: number;
|
|
117
|
+
readonly spinner_period_ms?: number;
|
|
118
|
+
readonly tooltip_show_delay_ms?: number;
|
|
119
|
+
readonly tooltip_warm_window_ms?: number;
|
|
120
|
+
};
|
|
121
|
+
export type ThemeShadowTokenOverrides = {
|
|
122
|
+
readonly y?: number;
|
|
123
|
+
readonly blur?: number;
|
|
124
|
+
readonly spread?: number;
|
|
125
|
+
};
|
|
126
|
+
export type ThemeShadowTokensOverrides = {
|
|
127
|
+
readonly none?: ThemeShadowTokenOverrides;
|
|
128
|
+
readonly xs?: ThemeShadowTokenOverrides;
|
|
129
|
+
readonly sm?: ThemeShadowTokenOverrides;
|
|
130
|
+
readonly md?: ThemeShadowTokenOverrides;
|
|
131
|
+
};
|
|
132
|
+
export type ThemeBlurTokenOverrides = {
|
|
133
|
+
readonly none?: number;
|
|
134
|
+
readonly sm?: number;
|
|
135
|
+
readonly md?: number;
|
|
136
|
+
readonly scrim?: number;
|
|
137
|
+
};
|
|
138
|
+
export type ThemeSpringTokenOverrides = {
|
|
139
|
+
readonly mass?: number;
|
|
140
|
+
readonly stiffness?: number;
|
|
141
|
+
readonly damping?: number;
|
|
142
|
+
};
|
|
143
|
+
export type ThemeMotionTokenOverrides = {
|
|
144
|
+
readonly fast_ms?: number;
|
|
145
|
+
readonly normal_ms?: number;
|
|
146
|
+
readonly slow_ms?: number;
|
|
147
|
+
readonly easing?: ThemeEasing;
|
|
148
|
+
readonly spring?: ThemeSpringTokenOverrides;
|
|
149
|
+
};
|
|
150
|
+
export type ThemeScrollPhysicsOverrides = {
|
|
151
|
+
readonly wheel_multiplier?: number;
|
|
152
|
+
readonly wheel_velocity_scale?: number;
|
|
153
|
+
readonly deceleration_per_second?: number;
|
|
154
|
+
readonly stop_velocity?: number;
|
|
155
|
+
readonly overscroll?: ThemeScrollOverscroll;
|
|
156
|
+
readonly rubberband_extent_ratio?: number;
|
|
157
|
+
readonly rubberband_max_extent?: number;
|
|
158
|
+
readonly rubberband_resistance?: number;
|
|
159
|
+
readonly rubberband_return_per_second?: number;
|
|
160
|
+
readonly rubberband_velocity_decay_per_second?: number;
|
|
161
|
+
readonly rubberband_snap_distance?: number;
|
|
162
|
+
};
|
|
163
|
+
export type ThemeLayerTokenOverrides = {
|
|
164
|
+
readonly base?: number;
|
|
165
|
+
readonly floating?: number;
|
|
166
|
+
readonly overlay?: number;
|
|
167
|
+
readonly modal?: number;
|
|
168
|
+
};
|
|
169
|
+
export type ThemePixelSnapTokenOverrides = {
|
|
170
|
+
readonly geometry?: boolean;
|
|
171
|
+
readonly text?: boolean;
|
|
172
|
+
readonly scale?: number;
|
|
173
|
+
};
|
|
174
|
+
export type ThemeControlVisualTokenOverrides = {
|
|
175
|
+
readonly background?: ThemeColor;
|
|
176
|
+
readonly hover_background?: ThemeColor;
|
|
177
|
+
readonly active_background?: ThemeColor;
|
|
178
|
+
readonly pressed_background?: ThemeColor;
|
|
179
|
+
readonly disabled_background?: ThemeColor;
|
|
180
|
+
readonly disabled_foreground?: ThemeColor;
|
|
181
|
+
readonly foreground?: ThemeColor;
|
|
182
|
+
readonly active_foreground?: ThemeColor;
|
|
183
|
+
readonly border?: ThemeColor;
|
|
184
|
+
readonly radius?: number;
|
|
185
|
+
readonly stroke_width?: number;
|
|
186
|
+
};
|
|
187
|
+
export type ThemeControlTokenOverrides = {
|
|
188
|
+
readonly button_default?: ThemeControlVisualTokenOverrides;
|
|
189
|
+
readonly button_primary?: ThemeControlVisualTokenOverrides;
|
|
190
|
+
readonly button_secondary?: ThemeControlVisualTokenOverrides;
|
|
191
|
+
readonly button_outline?: ThemeControlVisualTokenOverrides;
|
|
192
|
+
readonly button_ghost?: ThemeControlVisualTokenOverrides;
|
|
193
|
+
readonly button_destructive?: ThemeControlVisualTokenOverrides;
|
|
194
|
+
readonly button_disabled_border?: ThemeColor;
|
|
195
|
+
readonly toggle_button?: ThemeControlVisualTokenOverrides;
|
|
196
|
+
readonly accordion?: ThemeControlVisualTokenOverrides;
|
|
197
|
+
readonly alert?: ThemeControlVisualTokenOverrides;
|
|
198
|
+
readonly bubble?: ThemeControlVisualTokenOverrides;
|
|
199
|
+
readonly card?: ThemeControlVisualTokenOverrides;
|
|
200
|
+
readonly dialog?: ThemeControlVisualTokenOverrides;
|
|
201
|
+
readonly drawer?: ThemeControlVisualTokenOverrides;
|
|
202
|
+
readonly sheet?: ThemeControlVisualTokenOverrides;
|
|
203
|
+
readonly select?: ThemeControlVisualTokenOverrides;
|
|
204
|
+
readonly input?: ThemeControlVisualTokenOverrides;
|
|
205
|
+
readonly text_field?: ThemeControlVisualTokenOverrides;
|
|
206
|
+
readonly search_field?: ThemeControlVisualTokenOverrides;
|
|
207
|
+
readonly combobox?: ThemeControlVisualTokenOverrides;
|
|
208
|
+
readonly textarea?: ThemeControlVisualTokenOverrides;
|
|
209
|
+
readonly list_item?: ThemeControlVisualTokenOverrides;
|
|
210
|
+
readonly menu_item?: ThemeControlVisualTokenOverrides;
|
|
211
|
+
readonly data_cell?: ThemeControlVisualTokenOverrides;
|
|
212
|
+
readonly tabs?: ThemeControlVisualTokenOverrides;
|
|
213
|
+
readonly segmented_control?: ThemeControlVisualTokenOverrides;
|
|
214
|
+
readonly tabs_indicator?: ThemeTabsIndicatorKind;
|
|
215
|
+
readonly button_group?: ThemeControlVisualTokenOverrides;
|
|
216
|
+
readonly button_group_style?: ThemeButtonGroupKind;
|
|
217
|
+
readonly checkbox?: ThemeControlVisualTokenOverrides;
|
|
218
|
+
readonly radio?: ThemeControlVisualTokenOverrides;
|
|
219
|
+
readonly switch_control?: ThemeControlVisualTokenOverrides;
|
|
220
|
+
readonly slider?: ThemeControlVisualTokenOverrides;
|
|
221
|
+
readonly progress?: ThemeControlVisualTokenOverrides;
|
|
222
|
+
readonly scrollbar?: ThemeControlVisualTokenOverrides;
|
|
223
|
+
readonly panel?: ThemeControlVisualTokenOverrides;
|
|
224
|
+
readonly resizable?: ThemeControlVisualTokenOverrides;
|
|
225
|
+
readonly popover?: ThemeControlVisualTokenOverrides;
|
|
226
|
+
readonly menu_surface?: ThemeControlVisualTokenOverrides;
|
|
227
|
+
readonly dropdown_menu?: ThemeControlVisualTokenOverrides;
|
|
228
|
+
readonly tooltip?: ThemeControlVisualTokenOverrides;
|
|
229
|
+
readonly avatar?: ThemeControlVisualTokenOverrides;
|
|
230
|
+
readonly badge?: ThemeControlVisualTokenOverrides;
|
|
231
|
+
readonly separator?: ThemeControlVisualTokenOverrides;
|
|
232
|
+
readonly skeleton?: ThemeControlVisualTokenOverrides;
|
|
233
|
+
readonly spinner?: ThemeControlVisualTokenOverrides;
|
|
234
|
+
};
|
|
235
|
+
export type ThemeDesignTokenOverrides = {
|
|
236
|
+
readonly colors?: ThemeColorTokenOverrides;
|
|
237
|
+
readonly typography?: ThemeTypographyTokenOverrides;
|
|
238
|
+
readonly spacing?: ThemeSpacingTokenOverrides;
|
|
239
|
+
readonly radius?: ThemeRadiusTokenOverrides;
|
|
240
|
+
readonly stroke?: ThemeStrokeTokenOverrides;
|
|
241
|
+
readonly states?: ThemeStateTokenOverrides;
|
|
242
|
+
readonly metrics?: ThemeControlMetricTokenOverrides;
|
|
243
|
+
readonly shadow?: ThemeShadowTokensOverrides;
|
|
244
|
+
readonly blur?: ThemeBlurTokenOverrides;
|
|
245
|
+
readonly motion?: ThemeMotionTokenOverrides;
|
|
246
|
+
readonly scroll?: ThemeScrollPhysicsOverrides;
|
|
247
|
+
readonly layer?: ThemeLayerTokenOverrides;
|
|
248
|
+
readonly pixel_snap?: ThemePixelSnapTokenOverrides;
|
|
249
|
+
readonly controls?: ThemeControlTokenOverrides;
|
|
250
|
+
readonly density?: ThemeDensity;
|
|
251
|
+
};
|