@oxy.so/bloom-language 0.0.0-stage → 1.0.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/LICENSE +673 -0
- package/codemod/classnames.generated.json +12145 -0
- package/lib/commonjs/binding.js +39 -0
- package/lib/commonjs/binding.js.map +1 -0
- package/lib/commonjs/chrome/command-host.js +72 -0
- package/lib/commonjs/chrome/command-host.js.map +1 -0
- package/lib/commonjs/chrome/defined.js +20 -0
- package/lib/commonjs/chrome/defined.js.map +1 -0
- package/lib/commonjs/chrome/layout-hosts.js +181 -0
- package/lib/commonjs/chrome/layout-hosts.js.map +1 -0
- package/lib/commonjs/chrome/page-footer-host.js +36 -0
- package/lib/commonjs/chrome/page-footer-host.js.map +1 -0
- package/lib/commonjs/chrome/rail-host.js +55 -0
- package/lib/commonjs/chrome/rail-host.js.map +1 -0
- package/lib/commonjs/chrome/safe-area-inset.js +125 -0
- package/lib/commonjs/chrome/safe-area-inset.js.map +1 -0
- package/lib/commonjs/chrome/scroll-view-host.js +183 -0
- package/lib/commonjs/chrome/scroll-view-host.js.map +1 -0
- package/lib/commonjs/chrome/settings-host.js +84 -0
- package/lib/commonjs/chrome/settings-host.js.map +1 -0
- package/lib/commonjs/chrome/sidebar-host.js +227 -0
- package/lib/commonjs/chrome/sidebar-host.js.map +1 -0
- package/lib/commonjs/controls/accordion.js +80 -0
- package/lib/commonjs/controls/accordion.js.map +1 -0
- package/lib/commonjs/controls/activity-feed.js +33 -0
- package/lib/commonjs/controls/activity-feed.js.map +1 -0
- package/lib/commonjs/controls/activity-heatmap.js +46 -0
- package/lib/commonjs/controls/activity-heatmap.js.map +1 -0
- package/lib/commonjs/controls/address.js +58 -0
- package/lib/commonjs/controls/address.js.map +1 -0
- package/lib/commonjs/controls/agent-avatar.js +46 -0
- package/lib/commonjs/controls/agent-avatar.js.map +1 -0
- package/lib/commonjs/controls/agent-chat.js +62 -0
- package/lib/commonjs/controls/agent-chat.js.map +1 -0
- package/lib/commonjs/controls/agent-creator.js +59 -0
- package/lib/commonjs/controls/agent-creator.js.map +1 -0
- package/lib/commonjs/controls/agent-reply.js +69 -0
- package/lib/commonjs/controls/agent-reply.js.map +1 -0
- package/lib/commonjs/controls/agents.js +257 -0
- package/lib/commonjs/controls/agents.js.map +1 -0
- package/lib/commonjs/controls/ai-chat.js +173 -0
- package/lib/commonjs/controls/ai-chat.js.map +1 -0
- package/lib/commonjs/controls/ai-profile-card.js +40 -0
- package/lib/commonjs/controls/ai-profile-card.js.map +1 -0
- package/lib/commonjs/controls/ambient-photo.js +35 -0
- package/lib/commonjs/controls/ambient-photo.js.map +1 -0
- package/lib/commonjs/controls/animated-check.js +55 -0
- package/lib/commonjs/controls/animated-check.js.map +1 -0
- package/lib/commonjs/controls/avatar-flight.js +47 -0
- package/lib/commonjs/controls/avatar-flight.js.map +1 -0
- package/lib/commonjs/controls/booking.js +78 -0
- package/lib/commonjs/controls/booking.js.map +1 -0
- package/lib/commonjs/controls/breadcrumb.js +57 -0
- package/lib/commonjs/controls/breadcrumb.js.map +1 -0
- package/lib/commonjs/controls/calendar.js +80 -0
- package/lib/commonjs/controls/calendar.js.map +1 -0
- package/lib/commonjs/controls/call-ui.js +185 -0
- package/lib/commonjs/controls/call-ui.js.map +1 -0
- package/lib/commonjs/controls/card-form.js +99 -0
- package/lib/commonjs/controls/card-form.js.map +1 -0
- package/lib/commonjs/controls/carousel.js +90 -0
- package/lib/commonjs/controls/carousel.js.map +1 -0
- package/lib/commonjs/controls/cart-panel.js +113 -0
- package/lib/commonjs/controls/cart-panel.js.map +1 -0
- package/lib/commonjs/controls/category-bar.js +55 -0
- package/lib/commonjs/controls/category-bar.js.map +1 -0
- package/lib/commonjs/controls/chart-cards.js +247 -0
- package/lib/commonjs/controls/chart-cards.js.map +1 -0
- package/lib/commonjs/controls/chat-composer.js +208 -0
- package/lib/commonjs/controls/chat-composer.js.map +1 -0
- package/lib/commonjs/controls/chat-people.js +77 -0
- package/lib/commonjs/controls/chat-people.js.map +1 -0
- package/lib/commonjs/controls/chat.js +388 -0
- package/lib/commonjs/controls/chat.js.map +1 -0
- package/lib/commonjs/controls/checkout-sheet.js +35 -0
- package/lib/commonjs/controls/checkout-sheet.js.map +1 -0
- package/lib/commonjs/controls/checkout-summary.js +67 -0
- package/lib/commonjs/controls/checkout-summary.js.map +1 -0
- package/lib/commonjs/controls/choice-list.js +96 -0
- package/lib/commonjs/controls/choice-list.js.map +1 -0
- package/lib/commonjs/controls/code.js +100 -0
- package/lib/commonjs/controls/code.js.map +1 -0
- package/lib/commonjs/controls/collapsible.js +37 -0
- package/lib/commonjs/controls/collapsible.js.map +1 -0
- package/lib/commonjs/controls/color-swatch-picker.js +47 -0
- package/lib/commonjs/controls/color-swatch-picker.js.map +1 -0
- package/lib/commonjs/controls/composer-panel.js +79 -0
- package/lib/commonjs/controls/composer-panel.js.map +1 -0
- package/lib/commonjs/controls/composition-bar.js +72 -0
- package/lib/commonjs/controls/composition-bar.js.map +1 -0
- package/lib/commonjs/controls/confirmation-dialog.js +41 -0
- package/lib/commonjs/controls/confirmation-dialog.js.map +1 -0
- package/lib/commonjs/controls/containers.js +616 -0
- package/lib/commonjs/controls/containers.js.map +1 -0
- package/lib/commonjs/controls/context-menu.js +93 -0
- package/lib/commonjs/controls/context-menu.js.map +1 -0
- package/lib/commonjs/controls/creator-studio.js +213 -0
- package/lib/commonjs/controls/creator-studio.js.map +1 -0
- package/lib/commonjs/controls/crm.js +99 -0
- package/lib/commonjs/controls/crm.js.map +1 -0
- package/lib/commonjs/controls/dashboard-cards.js +65 -0
- package/lib/commonjs/controls/dashboard-cards.js.map +1 -0
- package/lib/commonjs/controls/data-table.js +196 -0
- package/lib/commonjs/controls/data-table.js.map +1 -0
- package/lib/commonjs/controls/date-picker.js +168 -0
- package/lib/commonjs/controls/date-picker.js.map +1 -0
- package/lib/commonjs/controls/delivery-slot.js +83 -0
- package/lib/commonjs/controls/delivery-slot.js.map +1 -0
- package/lib/commonjs/controls/draw.js +74 -0
- package/lib/commonjs/controls/draw.js.map +1 -0
- package/lib/commonjs/controls/drop-zone.js +46 -0
- package/lib/commonjs/controls/drop-zone.js.map +1 -0
- package/lib/commonjs/controls/eviction.js +50 -0
- package/lib/commonjs/controls/eviction.js.map +1 -0
- package/lib/commonjs/controls/expandable-text.js +54 -0
- package/lib/commonjs/controls/expandable-text.js.map +1 -0
- package/lib/commonjs/controls/fact-strip.js +61 -0
- package/lib/commonjs/controls/fact-strip.js.map +1 -0
- package/lib/commonjs/controls/file-upload.js +38 -0
- package/lib/commonjs/controls/file-upload.js.map +1 -0
- package/lib/commonjs/controls/generic.js +164 -0
- package/lib/commonjs/controls/generic.js.map +1 -0
- package/lib/commonjs/controls/glass-group.js +42 -0
- package/lib/commonjs/controls/glass-group.js.map +1 -0
- package/lib/commonjs/controls/home-search.js +78 -0
- package/lib/commonjs/controls/home-search.js.map +1 -0
- package/lib/commonjs/controls/hover-card.js +52 -0
- package/lib/commonjs/controls/hover-card.js.map +1 -0
- package/lib/commonjs/controls/index.js +256 -0
- package/lib/commonjs/controls/index.js.map +1 -0
- package/lib/commonjs/controls/input-group.js +53 -0
- package/lib/commonjs/controls/input-group.js.map +1 -0
- package/lib/commonjs/controls/input-otp.js +38 -0
- package/lib/commonjs/controls/input-otp.js.map +1 -0
- package/lib/commonjs/controls/inputs.js +599 -0
- package/lib/commonjs/controls/inputs.js.map +1 -0
- package/lib/commonjs/controls/link-preview.js +31 -0
- package/lib/commonjs/controls/link-preview.js.map +1 -0
- package/lib/commonjs/controls/list.js +281 -0
- package/lib/commonjs/controls/list.js.map +1 -0
- package/lib/commonjs/controls/listing-actions.js +89 -0
- package/lib/commonjs/controls/listing-actions.js.map +1 -0
- package/lib/commonjs/controls/listing-card.js +69 -0
- package/lib/commonjs/controls/listing-card.js.map +1 -0
- package/lib/commonjs/controls/listing-editor.js +67 -0
- package/lib/commonjs/controls/listing-editor.js.map +1 -0
- package/lib/commonjs/controls/listings.js +132 -0
- package/lib/commonjs/controls/listings.js.map +1 -0
- package/lib/commonjs/controls/lockup.js +56 -0
- package/lib/commonjs/controls/lockup.js.map +1 -0
- package/lib/commonjs/controls/logistics.js +231 -0
- package/lib/commonjs/controls/logistics.js.map +1 -0
- package/lib/commonjs/controls/lyrics.js +49 -0
- package/lib/commonjs/controls/lyrics.js.map +1 -0
- package/lib/commonjs/controls/mail.js +133 -0
- package/lib/commonjs/controls/mail.js.map +1 -0
- package/lib/commonjs/controls/map-chrome.js +84 -0
- package/lib/commonjs/controls/map-chrome.js.map +1 -0
- package/lib/commonjs/controls/markdown.js +74 -0
- package/lib/commonjs/controls/markdown.js.map +1 -0
- package/lib/commonjs/controls/media-cards.js +224 -0
- package/lib/commonjs/controls/media-cards.js.map +1 -0
- package/lib/commonjs/controls/media-controls.js +60 -0
- package/lib/commonjs/controls/media-controls.js.map +1 -0
- package/lib/commonjs/controls/media-flight.js +92 -0
- package/lib/commonjs/controls/media-flight.js.map +1 -0
- package/lib/commonjs/controls/media-inset-border.js +47 -0
- package/lib/commonjs/controls/media-inset-border.js.map +1 -0
- package/lib/commonjs/controls/media-player.js +185 -0
- package/lib/commonjs/controls/media-player.js.map +1 -0
- package/lib/commonjs/controls/media.js +103 -0
- package/lib/commonjs/controls/media.js.map +1 -0
- package/lib/commonjs/controls/menu-item.js +66 -0
- package/lib/commonjs/controls/menu-item.js.map +1 -0
- package/lib/commonjs/controls/menubar.js +96 -0
- package/lib/commonjs/controls/menubar.js.map +1 -0
- package/lib/commonjs/controls/message-bubble.js +83 -0
- package/lib/commonjs/controls/message-bubble.js.map +1 -0
- package/lib/commonjs/controls/multi-agent-chat.js +44 -0
- package/lib/commonjs/controls/multi-agent-chat.js.map +1 -0
- package/lib/commonjs/controls/music-library.js +129 -0
- package/lib/commonjs/controls/music-library.js.map +1 -0
- package/lib/commonjs/controls/note-card.js +51 -0
- package/lib/commonjs/controls/note-card.js.map +1 -0
- package/lib/commonjs/controls/notification.js +57 -0
- package/lib/commonjs/controls/notification.js.map +1 -0
- package/lib/commonjs/controls/offering-badge.js +32 -0
- package/lib/commonjs/controls/offering-badge.js.map +1 -0
- package/lib/commonjs/controls/order-confirmation.js +35 -0
- package/lib/commonjs/controls/order-confirmation.js.map +1 -0
- package/lib/commonjs/controls/order-status.js +51 -0
- package/lib/commonjs/controls/order-status.js.map +1 -0
- package/lib/commonjs/controls/overlays.js +214 -0
- package/lib/commonjs/controls/overlays.js.map +1 -0
- package/lib/commonjs/controls/payment-method.js +68 -0
- package/lib/commonjs/controls/payment-method.js.map +1 -0
- package/lib/commonjs/controls/payment-status.js +49 -0
- package/lib/commonjs/controls/payment-status.js.map +1 -0
- package/lib/commonjs/controls/phone-input.js +52 -0
- package/lib/commonjs/controls/phone-input.js.map +1 -0
- package/lib/commonjs/controls/place-reviews.js +38 -0
- package/lib/commonjs/controls/place-reviews.js.map +1 -0
- package/lib/commonjs/controls/places.js +157 -0
- package/lib/commonjs/controls/places.js.map +1 -0
- package/lib/commonjs/controls/price-breakdown.js +45 -0
- package/lib/commonjs/controls/price-breakdown.js.map +1 -0
- package/lib/commonjs/controls/product.js +105 -0
- package/lib/commonjs/controls/product.js.map +1 -0
- package/lib/commonjs/controls/project-board.js +89 -0
- package/lib/commonjs/controls/project-board.js.map +1 -0
- package/lib/commonjs/controls/property-insights.js +43 -0
- package/lib/commonjs/controls/property-insights.js.map +1 -0
- package/lib/commonjs/controls/queue-panel.js +58 -0
- package/lib/commonjs/controls/queue-panel.js.map +1 -0
- package/lib/commonjs/controls/rating.js +126 -0
- package/lib/commonjs/controls/rating.js.map +1 -0
- package/lib/commonjs/controls/route-stops.js +34 -0
- package/lib/commonjs/controls/route-stops.js.map +1 -0
- package/lib/commonjs/controls/settings.js +162 -0
- package/lib/commonjs/controls/settings.js.map +1 -0
- package/lib/commonjs/controls/share-sheet.js +47 -0
- package/lib/commonjs/controls/share-sheet.js.map +1 -0
- package/lib/commonjs/controls/slider.js +77 -0
- package/lib/commonjs/controls/slider.js.map +1 -0
- package/lib/commonjs/controls/social-button.js +52 -0
- package/lib/commonjs/controls/social-button.js.map +1 -0
- package/lib/commonjs/controls/sortable-chip-row.js +58 -0
- package/lib/commonjs/controls/sortable-chip-row.js.map +1 -0
- package/lib/commonjs/controls/sortable-media.js +40 -0
- package/lib/commonjs/controls/sortable-media.js.map +1 -0
- package/lib/commonjs/controls/spinner-icon.js +31 -0
- package/lib/commonjs/controls/spinner-icon.js.map +1 -0
- package/lib/commonjs/controls/stat-bar.js +161 -0
- package/lib/commonjs/controls/stat-bar.js.map +1 -0
- package/lib/commonjs/controls/stat-cards.js +43 -0
- package/lib/commonjs/controls/stat-cards.js.map +1 -0
- package/lib/commonjs/controls/stay-filters.js +208 -0
- package/lib/commonjs/controls/stay-filters.js.map +1 -0
- package/lib/commonjs/controls/stay-search.js +83 -0
- package/lib/commonjs/controls/stay-search.js.map +1 -0
- package/lib/commonjs/controls/stepper.js +65 -0
- package/lib/commonjs/controls/stepper.js.map +1 -0
- package/lib/commonjs/controls/table.js +109 -0
- package/lib/commonjs/controls/table.js.map +1 -0
- package/lib/commonjs/controls/tag-field.js +50 -0
- package/lib/commonjs/controls/tag-field.js.map +1 -0
- package/lib/commonjs/controls/task-list.js +29 -0
- package/lib/commonjs/controls/task-list.js.map +1 -0
- package/lib/commonjs/controls/tenancy.js +87 -0
- package/lib/commonjs/controls/tenancy.js.map +1 -0
- package/lib/commonjs/controls/toolbar-group.js +51 -0
- package/lib/commonjs/controls/toolbar-group.js.map +1 -0
- package/lib/commonjs/controls/tooltip.js +54 -0
- package/lib/commonjs/controls/tooltip.js.map +1 -0
- package/lib/commonjs/controls/track-list.js +170 -0
- package/lib/commonjs/controls/track-list.js.map +1 -0
- package/lib/commonjs/controls/vendor-card.js +38 -0
- package/lib/commonjs/controls/vendor-card.js.map +1 -0
- package/lib/commonjs/controls/video-playback.js +65 -0
- package/lib/commonjs/controls/video-playback.js.map +1 -0
- package/lib/commonjs/controls/video-view.js +32 -0
- package/lib/commonjs/controls/video-view.js.map +1 -0
- package/lib/commonjs/controls/view-that-fits.js +102 -0
- package/lib/commonjs/controls/view-that-fits.js.map +1 -0
- package/lib/commonjs/controls/viewport.js +29 -0
- package/lib/commonjs/controls/viewport.js.map +1 -0
- package/lib/commonjs/controls/voice.js +40 -0
- package/lib/commonjs/controls/voice.js.map +1 -0
- package/lib/commonjs/controls/web-search.js +29 -0
- package/lib/commonjs/controls/web-search.js.map +1 -0
- package/lib/commonjs/controls/zoomable-media-gallery.js +111 -0
- package/lib/commonjs/controls/zoomable-media-gallery.js.map +1 -0
- package/lib/commonjs/depth-stack.js +111 -0
- package/lib/commonjs/depth-stack.js.map +1 -0
- package/lib/commonjs/env.js +151 -0
- package/lib/commonjs/env.js.map +1 -0
- package/lib/commonjs/environment.js +100 -0
- package/lib/commonjs/environment.js.map +1 -0
- package/lib/commonjs/generated/sf-symbols.generated.js +115 -0
- package/lib/commonjs/generated/sf-symbols.generated.js.map +1 -0
- package/lib/commonjs/generated/spec.generated.js +3 -0
- package/lib/commonjs/generated/spec.generated.js.map +1 -0
- package/lib/commonjs/generated/web-sheet.generated.js +3390 -0
- package/lib/commonjs/generated/web-sheet.generated.js.map +1 -0
- package/lib/commonjs/glass.js +87 -0
- package/lib/commonjs/glass.js.map +1 -0
- package/lib/commonjs/index.js +3465 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/commonjs/modifier.js +40 -0
- package/lib/commonjs/modifier.js.map +1 -0
- package/lib/commonjs/motion/keyframes.js +75 -0
- package/lib/commonjs/motion/keyframes.js.map +1 -0
- package/lib/commonjs/motion/motion-node.js +559 -0
- package/lib/commonjs/motion/motion-node.js.map +1 -0
- package/lib/commonjs/motion/namespace.js +42 -0
- package/lib/commonjs/motion/namespace.js.map +1 -0
- package/lib/commonjs/motion/phases.js +78 -0
- package/lib/commonjs/motion/phases.js.map +1 -0
- package/lib/commonjs/motion/text-roll.js +217 -0
- package/lib/commonjs/motion/text-roll.js.map +1 -0
- package/lib/commonjs/motion/tokens.js +75 -0
- package/lib/commonjs/motion/tokens.js.map +1 -0
- package/lib/commonjs/motion/tracks.js +125 -0
- package/lib/commonjs/motion/tracks.js.map +1 -0
- package/lib/commonjs/motion/transition.js +47 -0
- package/lib/commonjs/motion/transition.js.map +1 -0
- package/lib/commonjs/motion/values.js +79 -0
- package/lib/commonjs/motion/values.js.map +1 -0
- package/lib/commonjs/node.js +2922 -0
- package/lib/commonjs/node.js.map +1 -0
- package/lib/commonjs/package.json +1 -0
- package/lib/commonjs/paint.js +304 -0
- package/lib/commonjs/paint.js.map +1 -0
- package/lib/commonjs/painted-host.js +53 -0
- package/lib/commonjs/painted-host.js.map +1 -0
- package/lib/commonjs/platform/bottom-bar-host.js +68 -0
- package/lib/commonjs/platform/bottom-bar-host.js.map +1 -0
- package/lib/commonjs/platform/confirmation-host.android.js +129 -0
- package/lib/commonjs/platform/confirmation-host.android.js.map +1 -0
- package/lib/commonjs/platform/confirmation-host.ios.js +97 -0
- package/lib/commonjs/platform/confirmation-host.ios.js.map +1 -0
- package/lib/commonjs/platform/confirmation-host.web.js +62 -0
- package/lib/commonjs/platform/confirmation-host.web.js.map +1 -0
- package/lib/commonjs/platform/glass-group-host.android.js +54 -0
- package/lib/commonjs/platform/glass-group-host.android.js.map +1 -0
- package/lib/commonjs/platform/glass-group-host.ios.js +167 -0
- package/lib/commonjs/platform/glass-group-host.ios.js.map +1 -0
- package/lib/commonjs/platform/glass-group-host.types.js +6 -0
- package/lib/commonjs/platform/glass-group-host.types.js.map +1 -0
- package/lib/commonjs/platform/glass-group-host.web.js +20 -0
- package/lib/commonjs/platform/glass-group-host.web.js.map +1 -0
- package/lib/commonjs/platform/glass-host.android.js +72 -0
- package/lib/commonjs/platform/glass-host.android.js.map +1 -0
- package/lib/commonjs/platform/glass-host.ios.js +110 -0
- package/lib/commonjs/platform/glass-host.ios.js.map +1 -0
- package/lib/commonjs/platform/glass-host.types.js +6 -0
- package/lib/commonjs/platform/glass-host.types.js.map +1 -0
- package/lib/commonjs/platform/glass-host.web.js +15 -0
- package/lib/commonjs/platform/glass-host.web.js.map +1 -0
- package/lib/commonjs/platform/header-host.ios.js +223 -0
- package/lib/commonjs/platform/header-host.ios.js.map +1 -0
- package/lib/commonjs/platform/header-host.js +13 -0
- package/lib/commonjs/platform/header-host.js.map +1 -0
- package/lib/commonjs/platform/header-page.js +105 -0
- package/lib/commonjs/platform/header-page.js.map +1 -0
- package/lib/commonjs/platform/host.types.js +6 -0
- package/lib/commonjs/platform/host.types.js.map +1 -0
- package/lib/commonjs/platform/lens-glass.js +29 -0
- package/lib/commonjs/platform/lens-glass.js.map +1 -0
- package/lib/commonjs/platform/lens-group.js +89 -0
- package/lib/commonjs/platform/lens-group.js.map +1 -0
- package/lib/commonjs/platform/lens.js +52 -0
- package/lib/commonjs/platform/lens.js.map +1 -0
- package/lib/commonjs/platform/menu-actions.js +81 -0
- package/lib/commonjs/platform/menu-actions.js.map +1 -0
- package/lib/commonjs/platform/menu-dropdown.js +158 -0
- package/lib/commonjs/platform/menu-dropdown.js.map +1 -0
- package/lib/commonjs/platform/menu-host.android.js +221 -0
- package/lib/commonjs/platform/menu-host.android.js.map +1 -0
- package/lib/commonjs/platform/menu-host.ios.js +136 -0
- package/lib/commonjs/platform/menu-host.ios.js.map +1 -0
- package/lib/commonjs/platform/menu-host.web.js +13 -0
- package/lib/commonjs/platform/menu-host.web.js.map +1 -0
- package/lib/commonjs/platform/menu-rows.js +175 -0
- package/lib/commonjs/platform/menu-rows.js.map +1 -0
- package/lib/commonjs/platform/sf-symbol.ios.js +16 -0
- package/lib/commonjs/platform/sf-symbol.ios.js.map +1 -0
- package/lib/commonjs/platform/values.js +25 -0
- package/lib/commonjs/platform/values.js.map +1 -0
- package/lib/commonjs/primitives.js +600 -0
- package/lib/commonjs/primitives.js.map +1 -0
- package/lib/commonjs/render.js +2863 -0
- package/lib/commonjs/render.js.map +1 -0
- package/lib/commonjs/router/app-layout.js +102 -0
- package/lib/commonjs/router/app-layout.js.map +1 -0
- package/lib/commonjs/router/bar.ios.js +18 -0
- package/lib/commonjs/router/bar.ios.js.map +1 -0
- package/lib/commonjs/router/bar.js +39 -0
- package/lib/commonjs/router/bar.js.map +1 -0
- package/lib/commonjs/router/components.js +91 -0
- package/lib/commonjs/router/components.js.map +1 -0
- package/lib/commonjs/router/index.js +62 -0
- package/lib/commonjs/router/index.js.map +1 -0
- package/lib/commonjs/router/navigators.js +31 -0
- package/lib/commonjs/router/navigators.js.map +1 -0
- package/lib/commonjs/router/nodes.js +122 -0
- package/lib/commonjs/router/nodes.js.map +1 -0
- package/lib/commonjs/router/pager.js +16 -0
- package/lib/commonjs/router/pager.js.map +1 -0
- package/lib/commonjs/router/primary.js +16 -0
- package/lib/commonjs/router/primary.js.map +1 -0
- package/lib/commonjs/router/routes.js +15 -0
- package/lib/commonjs/router/routes.js.map +1 -0
- package/lib/commonjs/router/screen-header.ios.js +13 -0
- package/lib/commonjs/router/screen-header.ios.js.map +1 -0
- package/lib/commonjs/router/screen-header.js +11 -0
- package/lib/commonjs/router/screen-header.js.map +1 -0
- package/lib/commonjs/router/screen-host.js +127 -0
- package/lib/commonjs/router/screen-host.js.map +1 -0
- package/lib/commonjs/router/sheet-bloom.js +105 -0
- package/lib/commonjs/router/sheet-bloom.js.map +1 -0
- package/lib/commonjs/router/sheet-host.ios.js +120 -0
- package/lib/commonjs/router/sheet-host.ios.js.map +1 -0
- package/lib/commonjs/router/sheet-host.js +13 -0
- package/lib/commonjs/router/sheet-host.js.map +1 -0
- package/lib/commonjs/router/shell-panels.js +86 -0
- package/lib/commonjs/router/shell-panels.js.map +1 -0
- package/lib/commonjs/router/stack.ios.js +38 -0
- package/lib/commonjs/router/stack.ios.js.map +1 -0
- package/lib/commonjs/router/stack.js +41 -0
- package/lib/commonjs/router/stack.js.map +1 -0
- package/lib/commonjs/router/stack.web.js +20 -0
- package/lib/commonjs/router/stack.web.js.map +1 -0
- package/lib/commonjs/router/tabs.ios.js +53 -0
- package/lib/commonjs/router/tabs.ios.js.map +1 -0
- package/lib/commonjs/router/tabs.js +23 -0
- package/lib/commonjs/router/tabs.js.map +1 -0
- package/lib/commonjs/state-host.js +179 -0
- package/lib/commonjs/state-host.js.map +1 -0
- package/lib/commonjs/style.js +1003 -0
- package/lib/commonjs/style.js.map +1 -0
- package/lib/commonjs/toast.js +39 -0
- package/lib/commonjs/toast.js.map +1 -0
- package/lib/commonjs/tokens.js +496 -0
- package/lib/commonjs/tokens.js.map +1 -0
- package/lib/commonjs/variants.js +107 -0
- package/lib/commonjs/variants.js.map +1 -0
- package/lib/commonjs/view.js +55 -0
- package/lib/commonjs/view.js.map +1 -0
- package/lib/commonjs/web-sheet.js +225 -0
- package/lib/commonjs/web-sheet.js.map +1 -0
- package/lib/module/binding.js +35 -0
- package/lib/module/binding.js.map +1 -0
- package/lib/module/chrome/command-host.js +67 -0
- package/lib/module/chrome/command-host.js.map +1 -0
- package/lib/module/chrome/defined.js +16 -0
- package/lib/module/chrome/defined.js.map +1 -0
- package/lib/module/chrome/layout-hosts.js +172 -0
- package/lib/module/chrome/layout-hosts.js.map +1 -0
- package/lib/module/chrome/page-footer-host.js +32 -0
- package/lib/module/chrome/page-footer-host.js.map +1 -0
- package/lib/module/chrome/rail-host.js +50 -0
- package/lib/module/chrome/rail-host.js.map +1 -0
- package/lib/module/chrome/safe-area-inset.js +118 -0
- package/lib/module/chrome/safe-area-inset.js.map +1 -0
- package/lib/module/chrome/scroll-view-host.js +177 -0
- package/lib/module/chrome/scroll-view-host.js.map +1 -0
- package/lib/module/chrome/settings-host.js +79 -0
- package/lib/module/chrome/settings-host.js.map +1 -0
- package/lib/module/chrome/sidebar-host.js +221 -0
- package/lib/module/chrome/sidebar-host.js.map +1 -0
- package/lib/module/controls/accordion.js +73 -0
- package/lib/module/controls/accordion.js.map +1 -0
- package/lib/module/controls/activity-feed.js +29 -0
- package/lib/module/controls/activity-feed.js.map +1 -0
- package/lib/module/controls/activity-heatmap.js +42 -0
- package/lib/module/controls/activity-heatmap.js.map +1 -0
- package/lib/module/controls/address.js +53 -0
- package/lib/module/controls/address.js.map +1 -0
- package/lib/module/controls/agent-avatar.js +42 -0
- package/lib/module/controls/agent-avatar.js.map +1 -0
- package/lib/module/controls/agent-chat.js +57 -0
- package/lib/module/controls/agent-chat.js.map +1 -0
- package/lib/module/controls/agent-creator.js +53 -0
- package/lib/module/controls/agent-creator.js.map +1 -0
- package/lib/module/controls/agent-reply.js +64 -0
- package/lib/module/controls/agent-reply.js.map +1 -0
- package/lib/module/controls/agents.js +241 -0
- package/lib/module/controls/agents.js.map +1 -0
- package/lib/module/controls/ai-chat.js +160 -0
- package/lib/module/controls/ai-chat.js.map +1 -0
- package/lib/module/controls/ai-profile-card.js +36 -0
- package/lib/module/controls/ai-profile-card.js.map +1 -0
- package/lib/module/controls/ambient-photo.js +31 -0
- package/lib/module/controls/ambient-photo.js.map +1 -0
- package/lib/module/controls/animated-check.js +50 -0
- package/lib/module/controls/animated-check.js.map +1 -0
- package/lib/module/controls/avatar-flight.js +42 -0
- package/lib/module/controls/avatar-flight.js.map +1 -0
- package/lib/module/controls/booking.js +71 -0
- package/lib/module/controls/booking.js.map +1 -0
- package/lib/module/controls/breadcrumb.js +52 -0
- package/lib/module/controls/breadcrumb.js.map +1 -0
- package/lib/module/controls/calendar.js +74 -0
- package/lib/module/controls/calendar.js.map +1 -0
- package/lib/module/controls/call-ui.js +177 -0
- package/lib/module/controls/call-ui.js.map +1 -0
- package/lib/module/controls/card-form.js +92 -0
- package/lib/module/controls/card-form.js.map +1 -0
- package/lib/module/controls/carousel.js +84 -0
- package/lib/module/controls/carousel.js.map +1 -0
- package/lib/module/controls/cart-panel.js +106 -0
- package/lib/module/controls/cart-panel.js.map +1 -0
- package/lib/module/controls/category-bar.js +51 -0
- package/lib/module/controls/category-bar.js.map +1 -0
- package/lib/module/controls/chart-cards.js +230 -0
- package/lib/module/controls/chart-cards.js.map +1 -0
- package/lib/module/controls/chat-composer.js +195 -0
- package/lib/module/controls/chat-composer.js.map +1 -0
- package/lib/module/controls/chat-people.js +71 -0
- package/lib/module/controls/chat-people.js.map +1 -0
- package/lib/module/controls/chat.js +361 -0
- package/lib/module/controls/chat.js.map +1 -0
- package/lib/module/controls/checkout-sheet.js +31 -0
- package/lib/module/controls/checkout-sheet.js.map +1 -0
- package/lib/module/controls/checkout-summary.js +61 -0
- package/lib/module/controls/checkout-summary.js.map +1 -0
- package/lib/module/controls/choice-list.js +92 -0
- package/lib/module/controls/choice-list.js.map +1 -0
- package/lib/module/controls/code.js +93 -0
- package/lib/module/controls/code.js.map +1 -0
- package/lib/module/controls/collapsible.js +33 -0
- package/lib/module/controls/collapsible.js.map +1 -0
- package/lib/module/controls/color-swatch-picker.js +43 -0
- package/lib/module/controls/color-swatch-picker.js.map +1 -0
- package/lib/module/controls/composer-panel.js +73 -0
- package/lib/module/controls/composer-panel.js.map +1 -0
- package/lib/module/controls/composition-bar.js +67 -0
- package/lib/module/controls/composition-bar.js.map +1 -0
- package/lib/module/controls/confirmation-dialog.js +37 -0
- package/lib/module/controls/confirmation-dialog.js.map +1 -0
- package/lib/module/controls/containers.js +590 -0
- package/lib/module/controls/containers.js.map +1 -0
- package/lib/module/controls/context-menu.js +88 -0
- package/lib/module/controls/context-menu.js.map +1 -0
- package/lib/module/controls/creator-studio.js +195 -0
- package/lib/module/controls/creator-studio.js.map +1 -0
- package/lib/module/controls/crm.js +91 -0
- package/lib/module/controls/crm.js.map +1 -0
- package/lib/module/controls/dashboard-cards.js +59 -0
- package/lib/module/controls/dashboard-cards.js.map +1 -0
- package/lib/module/controls/data-table.js +187 -0
- package/lib/module/controls/data-table.js.map +1 -0
- package/lib/module/controls/date-picker.js +159 -0
- package/lib/module/controls/date-picker.js.map +1 -0
- package/lib/module/controls/delivery-slot.js +77 -0
- package/lib/module/controls/delivery-slot.js.map +1 -0
- package/lib/module/controls/draw.js +68 -0
- package/lib/module/controls/draw.js.map +1 -0
- package/lib/module/controls/drop-zone.js +42 -0
- package/lib/module/controls/drop-zone.js.map +1 -0
- package/lib/module/controls/eviction.js +45 -0
- package/lib/module/controls/eviction.js.map +1 -0
- package/lib/module/controls/expandable-text.js +50 -0
- package/lib/module/controls/expandable-text.js.map +1 -0
- package/lib/module/controls/fact-strip.js +56 -0
- package/lib/module/controls/fact-strip.js.map +1 -0
- package/lib/module/controls/file-upload.js +34 -0
- package/lib/module/controls/file-upload.js.map +1 -0
- package/lib/module/controls/generic.js +153 -0
- package/lib/module/controls/generic.js.map +1 -0
- package/lib/module/controls/glass-group.js +38 -0
- package/lib/module/controls/glass-group.js.map +1 -0
- package/lib/module/controls/home-search.js +71 -0
- package/lib/module/controls/home-search.js.map +1 -0
- package/lib/module/controls/hover-card.js +47 -0
- package/lib/module/controls/hover-card.js.map +1 -0
- package/lib/module/controls/index.js +253 -0
- package/lib/module/controls/index.js.map +1 -0
- package/lib/module/controls/input-group.js +48 -0
- package/lib/module/controls/input-group.js.map +1 -0
- package/lib/module/controls/input-otp.js +34 -0
- package/lib/module/controls/input-otp.js.map +1 -0
- package/lib/module/controls/inputs.js +582 -0
- package/lib/module/controls/inputs.js.map +1 -0
- package/lib/module/controls/link-preview.js +27 -0
- package/lib/module/controls/link-preview.js.map +1 -0
- package/lib/module/controls/list.js +269 -0
- package/lib/module/controls/list.js.map +1 -0
- package/lib/module/controls/listing-actions.js +82 -0
- package/lib/module/controls/listing-actions.js.map +1 -0
- package/lib/module/controls/listing-card.js +63 -0
- package/lib/module/controls/listing-card.js.map +1 -0
- package/lib/module/controls/listing-editor.js +61 -0
- package/lib/module/controls/listing-editor.js.map +1 -0
- package/lib/module/controls/listings.js +120 -0
- package/lib/module/controls/listings.js.map +1 -0
- package/lib/module/controls/lockup.js +51 -0
- package/lib/module/controls/lockup.js.map +1 -0
- package/lib/module/controls/logistics.js +215 -0
- package/lib/module/controls/logistics.js.map +1 -0
- package/lib/module/controls/lyrics.js +44 -0
- package/lib/module/controls/lyrics.js.map +1 -0
- package/lib/module/controls/mail.js +124 -0
- package/lib/module/controls/mail.js.map +1 -0
- package/lib/module/controls/map-chrome.js +77 -0
- package/lib/module/controls/map-chrome.js.map +1 -0
- package/lib/module/controls/markdown.js +69 -0
- package/lib/module/controls/markdown.js.map +1 -0
- package/lib/module/controls/media-cards.js +205 -0
- package/lib/module/controls/media-cards.js.map +1 -0
- package/lib/module/controls/media-controls.js +55 -0
- package/lib/module/controls/media-controls.js.map +1 -0
- package/lib/module/controls/media-flight.js +84 -0
- package/lib/module/controls/media-flight.js.map +1 -0
- package/lib/module/controls/media-inset-border.js +42 -0
- package/lib/module/controls/media-inset-border.js.map +1 -0
- package/lib/module/controls/media-player.js +174 -0
- package/lib/module/controls/media-player.js.map +1 -0
- package/lib/module/controls/media.js +94 -0
- package/lib/module/controls/media.js.map +1 -0
- package/lib/module/controls/menu-item.js +61 -0
- package/lib/module/controls/menu-item.js.map +1 -0
- package/lib/module/controls/menubar.js +90 -0
- package/lib/module/controls/menubar.js.map +1 -0
- package/lib/module/controls/message-bubble.js +77 -0
- package/lib/module/controls/message-bubble.js.map +1 -0
- package/lib/module/controls/multi-agent-chat.js +39 -0
- package/lib/module/controls/multi-agent-chat.js.map +1 -0
- package/lib/module/controls/music-library.js +119 -0
- package/lib/module/controls/music-library.js.map +1 -0
- package/lib/module/controls/note-card.js +46 -0
- package/lib/module/controls/note-card.js.map +1 -0
- package/lib/module/controls/notification.js +53 -0
- package/lib/module/controls/notification.js.map +1 -0
- package/lib/module/controls/offering-badge.js +28 -0
- package/lib/module/controls/offering-badge.js.map +1 -0
- package/lib/module/controls/order-confirmation.js +31 -0
- package/lib/module/controls/order-confirmation.js.map +1 -0
- package/lib/module/controls/order-status.js +46 -0
- package/lib/module/controls/order-status.js.map +1 -0
- package/lib/module/controls/overlays.js +205 -0
- package/lib/module/controls/overlays.js.map +1 -0
- package/lib/module/controls/payment-method.js +62 -0
- package/lib/module/controls/payment-method.js.map +1 -0
- package/lib/module/controls/payment-status.js +44 -0
- package/lib/module/controls/payment-status.js.map +1 -0
- package/lib/module/controls/phone-input.js +48 -0
- package/lib/module/controls/phone-input.js.map +1 -0
- package/lib/module/controls/place-reviews.js +33 -0
- package/lib/module/controls/place-reviews.js.map +1 -0
- package/lib/module/controls/places.js +146 -0
- package/lib/module/controls/places.js.map +1 -0
- package/lib/module/controls/price-breakdown.js +40 -0
- package/lib/module/controls/price-breakdown.js.map +1 -0
- package/lib/module/controls/product.js +98 -0
- package/lib/module/controls/product.js.map +1 -0
- package/lib/module/controls/project-board.js +81 -0
- package/lib/module/controls/project-board.js.map +1 -0
- package/lib/module/controls/property-insights.js +38 -0
- package/lib/module/controls/property-insights.js.map +1 -0
- package/lib/module/controls/queue-panel.js +52 -0
- package/lib/module/controls/queue-panel.js.map +1 -0
- package/lib/module/controls/rating.js +119 -0
- package/lib/module/controls/rating.js.map +1 -0
- package/lib/module/controls/route-stops.js +30 -0
- package/lib/module/controls/route-stops.js.map +1 -0
- package/lib/module/controls/settings.js +153 -0
- package/lib/module/controls/settings.js.map +1 -0
- package/lib/module/controls/share-sheet.js +43 -0
- package/lib/module/controls/share-sheet.js.map +1 -0
- package/lib/module/controls/slider.js +72 -0
- package/lib/module/controls/slider.js.map +1 -0
- package/lib/module/controls/social-button.js +48 -0
- package/lib/module/controls/social-button.js.map +1 -0
- package/lib/module/controls/sortable-chip-row.js +53 -0
- package/lib/module/controls/sortable-chip-row.js.map +1 -0
- package/lib/module/controls/sortable-media.js +36 -0
- package/lib/module/controls/sortable-media.js.map +1 -0
- package/lib/module/controls/spinner-icon.js +27 -0
- package/lib/module/controls/spinner-icon.js.map +1 -0
- package/lib/module/controls/stat-bar.js +155 -0
- package/lib/module/controls/stat-bar.js.map +1 -0
- package/lib/module/controls/stat-cards.js +38 -0
- package/lib/module/controls/stat-cards.js.map +1 -0
- package/lib/module/controls/stay-filters.js +193 -0
- package/lib/module/controls/stay-filters.js.map +1 -0
- package/lib/module/controls/stay-search.js +75 -0
- package/lib/module/controls/stay-search.js.map +1 -0
- package/lib/module/controls/stepper.js +60 -0
- package/lib/module/controls/stepper.js.map +1 -0
- package/lib/module/controls/table.js +100 -0
- package/lib/module/controls/table.js.map +1 -0
- package/lib/module/controls/tag-field.js +46 -0
- package/lib/module/controls/tag-field.js.map +1 -0
- package/lib/module/controls/task-list.js +25 -0
- package/lib/module/controls/task-list.js.map +1 -0
- package/lib/module/controls/tenancy.js +79 -0
- package/lib/module/controls/tenancy.js.map +1 -0
- package/lib/module/controls/toolbar-group.js +46 -0
- package/lib/module/controls/toolbar-group.js.map +1 -0
- package/lib/module/controls/tooltip.js +49 -0
- package/lib/module/controls/tooltip.js.map +1 -0
- package/lib/module/controls/track-list.js +159 -0
- package/lib/module/controls/track-list.js.map +1 -0
- package/lib/module/controls/vendor-card.js +34 -0
- package/lib/module/controls/vendor-card.js.map +1 -0
- package/lib/module/controls/video-playback.js +59 -0
- package/lib/module/controls/video-playback.js.map +1 -0
- package/lib/module/controls/video-view.js +28 -0
- package/lib/module/controls/video-view.js.map +1 -0
- package/lib/module/controls/view-that-fits.js +98 -0
- package/lib/module/controls/view-that-fits.js.map +1 -0
- package/lib/module/controls/viewport.js +25 -0
- package/lib/module/controls/viewport.js.map +1 -0
- package/lib/module/controls/voice.js +36 -0
- package/lib/module/controls/voice.js.map +1 -0
- package/lib/module/controls/web-search.js +25 -0
- package/lib/module/controls/web-search.js.map +1 -0
- package/lib/module/controls/zoomable-media-gallery.js +106 -0
- package/lib/module/controls/zoomable-media-gallery.js.map +1 -0
- package/lib/module/depth-stack.js +107 -0
- package/lib/module/depth-stack.js.map +1 -0
- package/lib/module/env.js +145 -0
- package/lib/module/env.js.map +1 -0
- package/lib/module/environment.js +91 -0
- package/lib/module/environment.js.map +1 -0
- package/lib/module/generated/sf-symbols.generated.js +110 -0
- package/lib/module/generated/sf-symbols.generated.js.map +1 -0
- package/lib/module/generated/spec.generated.js +3 -0
- package/lib/module/generated/spec.generated.js.map +1 -0
- package/lib/module/generated/web-sheet.generated.js +3386 -0
- package/lib/module/generated/web-sheet.generated.js.map +1 -0
- package/lib/module/glass.js +83 -0
- package/lib/module/glass.js.map +1 -0
- package/lib/module/index.js +255 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/modifier.js +34 -0
- package/lib/module/modifier.js.map +1 -0
- package/lib/module/motion/keyframes.js +70 -0
- package/lib/module/motion/keyframes.js.map +1 -0
- package/lib/module/motion/motion-node.js +550 -0
- package/lib/module/motion/motion-node.js.map +1 -0
- package/lib/module/motion/namespace.js +38 -0
- package/lib/module/motion/namespace.js.map +1 -0
- package/lib/module/motion/phases.js +74 -0
- package/lib/module/motion/phases.js.map +1 -0
- package/lib/module/motion/text-roll.js +212 -0
- package/lib/module/motion/text-roll.js.map +1 -0
- package/lib/module/motion/tokens.js +66 -0
- package/lib/module/motion/tokens.js.map +1 -0
- package/lib/module/motion/tracks.js +121 -0
- package/lib/module/motion/tracks.js.map +1 -0
- package/lib/module/motion/transition.js +36 -0
- package/lib/module/motion/transition.js.map +1 -0
- package/lib/module/motion/values.js +68 -0
- package/lib/module/motion/values.js.map +1 -0
- package/lib/module/node.js +2918 -0
- package/lib/module/node.js.map +1 -0
- package/lib/module/package.json +1 -0
- package/lib/module/paint.js +298 -0
- package/lib/module/paint.js.map +1 -0
- package/lib/module/painted-host.js +49 -0
- package/lib/module/painted-host.js.map +1 -0
- package/lib/module/platform/bottom-bar-host.js +63 -0
- package/lib/module/platform/bottom-bar-host.js.map +1 -0
- package/lib/module/platform/confirmation-host.android.js +124 -0
- package/lib/module/platform/confirmation-host.android.js.map +1 -0
- package/lib/module/platform/confirmation-host.ios.js +93 -0
- package/lib/module/platform/confirmation-host.ios.js.map +1 -0
- package/lib/module/platform/confirmation-host.web.js +59 -0
- package/lib/module/platform/confirmation-host.web.js.map +1 -0
- package/lib/module/platform/glass-group-host.android.js +48 -0
- package/lib/module/platform/glass-group-host.android.js.map +1 -0
- package/lib/module/platform/glass-group-host.ios.js +160 -0
- package/lib/module/platform/glass-group-host.ios.js.map +1 -0
- package/lib/module/platform/glass-group-host.types.js +4 -0
- package/lib/module/platform/glass-group-host.types.js.map +1 -0
- package/lib/module/platform/glass-group-host.web.js +15 -0
- package/lib/module/platform/glass-group-host.web.js.map +1 -0
- package/lib/module/platform/glass-host.android.js +67 -0
- package/lib/module/platform/glass-host.android.js.map +1 -0
- package/lib/module/platform/glass-host.ios.js +106 -0
- package/lib/module/platform/glass-host.ios.js.map +1 -0
- package/lib/module/platform/glass-host.types.js +4 -0
- package/lib/module/platform/glass-host.types.js.map +1 -0
- package/lib/module/platform/glass-host.web.js +11 -0
- package/lib/module/platform/glass-host.web.js.map +1 -0
- package/lib/module/platform/header-host.ios.js +217 -0
- package/lib/module/platform/header-host.ios.js.map +1 -0
- package/lib/module/platform/header-host.js +5 -0
- package/lib/module/platform/header-host.js.map +1 -0
- package/lib/module/platform/header-page.js +100 -0
- package/lib/module/platform/header-page.js.map +1 -0
- package/lib/module/platform/host.types.js +4 -0
- package/lib/module/platform/host.types.js.map +1 -0
- package/lib/module/platform/lens-glass.js +25 -0
- package/lib/module/platform/lens-glass.js.map +1 -0
- package/lib/module/platform/lens-group.js +81 -0
- package/lib/module/platform/lens-group.js.map +1 -0
- package/lib/module/platform/lens.js +49 -0
- package/lib/module/platform/lens.js.map +1 -0
- package/lib/module/platform/menu-actions.js +74 -0
- package/lib/module/platform/menu-actions.js.map +1 -0
- package/lib/module/platform/menu-dropdown.js +151 -0
- package/lib/module/platform/menu-dropdown.js.map +1 -0
- package/lib/module/platform/menu-host.android.js +213 -0
- package/lib/module/platform/menu-host.android.js.map +1 -0
- package/lib/module/platform/menu-host.ios.js +132 -0
- package/lib/module/platform/menu-host.ios.js.map +1 -0
- package/lib/module/platform/menu-host.web.js +5 -0
- package/lib/module/platform/menu-host.web.js.map +1 -0
- package/lib/module/platform/menu-rows.js +165 -0
- package/lib/module/platform/menu-rows.js.map +1 -0
- package/lib/module/platform/sf-symbol.ios.js +11 -0
- package/lib/module/platform/sf-symbol.ios.js.map +1 -0
- package/lib/module/platform/values.js +21 -0
- package/lib/module/platform/values.js.map +1 -0
- package/lib/module/primitives.js +536 -0
- package/lib/module/primitives.js.map +1 -0
- package/lib/module/render.js +2855 -0
- package/lib/module/render.js.map +1 -0
- package/lib/module/router/app-layout.js +97 -0
- package/lib/module/router/app-layout.js.map +1 -0
- package/lib/module/router/bar.ios.js +14 -0
- package/lib/module/router/bar.ios.js.map +1 -0
- package/lib/module/router/bar.js +35 -0
- package/lib/module/router/bar.js.map +1 -0
- package/lib/module/router/components.js +85 -0
- package/lib/module/router/components.js.map +1 -0
- package/lib/module/router/index.js +9 -0
- package/lib/module/router/index.js.map +1 -0
- package/lib/module/router/navigators.js +28 -0
- package/lib/module/router/navigators.js.map +1 -0
- package/lib/module/router/nodes.js +112 -0
- package/lib/module/router/nodes.js.map +1 -0
- package/lib/module/router/pager.js +13 -0
- package/lib/module/router/pager.js.map +1 -0
- package/lib/module/router/primary.js +13 -0
- package/lib/module/router/primary.js.map +1 -0
- package/lib/module/router/routes.js +12 -0
- package/lib/module/router/routes.js.map +1 -0
- package/lib/module/router/screen-header.ios.js +11 -0
- package/lib/module/router/screen-header.ios.js.map +1 -0
- package/lib/module/router/screen-header.js +7 -0
- package/lib/module/router/screen-header.js.map +1 -0
- package/lib/module/router/screen-host.js +123 -0
- package/lib/module/router/screen-host.js.map +1 -0
- package/lib/module/router/sheet-bloom.js +98 -0
- package/lib/module/router/sheet-bloom.js.map +1 -0
- package/lib/module/router/sheet-host.ios.js +115 -0
- package/lib/module/router/sheet-host.ios.js.map +1 -0
- package/lib/module/router/sheet-host.js +5 -0
- package/lib/module/router/sheet-host.js.map +1 -0
- package/lib/module/router/shell-panels.js +81 -0
- package/lib/module/router/shell-panels.js.map +1 -0
- package/lib/module/router/stack.ios.js +33 -0
- package/lib/module/router/stack.ios.js.map +1 -0
- package/lib/module/router/stack.js +36 -0
- package/lib/module/router/stack.js.map +1 -0
- package/lib/module/router/stack.web.js +15 -0
- package/lib/module/router/stack.web.js.map +1 -0
- package/lib/module/router/tabs.ios.js +48 -0
- package/lib/module/router/tabs.ios.js.map +1 -0
- package/lib/module/router/tabs.js +18 -0
- package/lib/module/router/tabs.js.map +1 -0
- package/lib/module/state-host.js +174 -0
- package/lib/module/state-host.js.map +1 -0
- package/lib/module/style.js +971 -0
- package/lib/module/style.js.map +1 -0
- package/lib/module/toast.js +36 -0
- package/lib/module/toast.js.map +1 -0
- package/lib/module/tokens.js +409 -0
- package/lib/module/tokens.js.map +1 -0
- package/lib/module/variants.js +98 -0
- package/lib/module/variants.js.map +1 -0
- package/lib/module/view.js +51 -0
- package/lib/module/view.js.map +1 -0
- package/lib/module/web-sheet.js +216 -0
- package/lib/module/web-sheet.js.map +1 -0
- package/lib/typescript/commonjs/binding.d.ts +31 -0
- package/lib/typescript/commonjs/binding.d.ts.map +1 -0
- package/lib/typescript/commonjs/chrome/command-host.d.ts +7 -0
- package/lib/typescript/commonjs/chrome/command-host.d.ts.map +1 -0
- package/lib/typescript/commonjs/chrome/defined.d.ts +7 -0
- package/lib/typescript/commonjs/chrome/defined.d.ts.map +1 -0
- package/lib/typescript/commonjs/chrome/layout-hosts.d.ts +26 -0
- package/lib/typescript/commonjs/chrome/layout-hosts.d.ts.map +1 -0
- package/lib/typescript/commonjs/chrome/page-footer-host.d.ts +10 -0
- package/lib/typescript/commonjs/chrome/page-footer-host.d.ts.map +1 -0
- package/lib/typescript/commonjs/chrome/rail-host.d.ts +3 -0
- package/lib/typescript/commonjs/chrome/rail-host.d.ts.map +1 -0
- package/lib/typescript/commonjs/chrome/safe-area-inset.d.ts +37 -0
- package/lib/typescript/commonjs/chrome/safe-area-inset.d.ts.map +1 -0
- package/lib/typescript/commonjs/chrome/scroll-view-host.d.ts +31 -0
- package/lib/typescript/commonjs/chrome/scroll-view-host.d.ts.map +1 -0
- package/lib/typescript/commonjs/chrome/settings-host.d.ts +12 -0
- package/lib/typescript/commonjs/chrome/settings-host.d.ts.map +1 -0
- package/lib/typescript/commonjs/chrome/sidebar-host.d.ts +18 -0
- package/lib/typescript/commonjs/chrome/sidebar-host.d.ts.map +1 -0
- package/lib/typescript/commonjs/controls/accordion.d.ts +38 -0
- package/lib/typescript/commonjs/controls/accordion.d.ts.map +1 -0
- package/lib/typescript/commonjs/controls/activity-feed.d.ts +21 -0
- package/lib/typescript/commonjs/controls/activity-feed.d.ts.map +1 -0
- package/lib/typescript/commonjs/controls/activity-heatmap.d.ts +40 -0
- package/lib/typescript/commonjs/controls/activity-heatmap.d.ts.map +1 -0
- package/lib/typescript/commonjs/controls/address.d.ts +41 -0
- package/lib/typescript/commonjs/controls/address.d.ts.map +1 -0
- package/lib/typescript/commonjs/controls/agent-avatar.d.ts +36 -0
- package/lib/typescript/commonjs/controls/agent-avatar.d.ts.map +1 -0
- package/lib/typescript/commonjs/controls/agent-chat.d.ts +43 -0
- package/lib/typescript/commonjs/controls/agent-chat.d.ts.map +1 -0
- package/lib/typescript/commonjs/controls/agent-creator.d.ts +35 -0
- package/lib/typescript/commonjs/controls/agent-creator.d.ts.map +1 -0
- package/lib/typescript/commonjs/controls/agent-reply.d.ts +26 -0
- package/lib/typescript/commonjs/controls/agent-reply.d.ts.map +1 -0
- package/lib/typescript/commonjs/controls/agents.d.ts +159 -0
- package/lib/typescript/commonjs/controls/agents.d.ts.map +1 -0
- package/lib/typescript/commonjs/controls/ai-chat.d.ts +103 -0
- package/lib/typescript/commonjs/controls/ai-chat.d.ts.map +1 -0
- package/lib/typescript/commonjs/controls/ai-profile-card.d.ts +26 -0
- package/lib/typescript/commonjs/controls/ai-profile-card.d.ts.map +1 -0
- package/lib/typescript/commonjs/controls/ambient-photo.d.ts +23 -0
- package/lib/typescript/commonjs/controls/ambient-photo.d.ts.map +1 -0
- package/lib/typescript/commonjs/controls/animated-check.d.ts +19 -0
- package/lib/typescript/commonjs/controls/animated-check.d.ts.map +1 -0
- package/lib/typescript/commonjs/controls/avatar-flight.d.ts +20 -0
- package/lib/typescript/commonjs/controls/avatar-flight.d.ts.map +1 -0
- package/lib/typescript/commonjs/controls/booking.d.ts +50 -0
- package/lib/typescript/commonjs/controls/booking.d.ts.map +1 -0
- package/lib/typescript/commonjs/controls/breadcrumb.d.ts +38 -0
- package/lib/typescript/commonjs/controls/breadcrumb.d.ts.map +1 -0
- package/lib/typescript/commonjs/controls/calendar.d.ts +46 -0
- package/lib/typescript/commonjs/controls/calendar.d.ts.map +1 -0
- package/lib/typescript/commonjs/controls/call-ui.d.ts +106 -0
- package/lib/typescript/commonjs/controls/call-ui.d.ts.map +1 -0
- package/lib/typescript/commonjs/controls/card-form.d.ts +44 -0
- package/lib/typescript/commonjs/controls/card-form.d.ts.map +1 -0
- package/lib/typescript/commonjs/controls/carousel.d.ts +64 -0
- package/lib/typescript/commonjs/controls/carousel.d.ts.map +1 -0
- package/lib/typescript/commonjs/controls/cart-panel.d.ts +59 -0
- package/lib/typescript/commonjs/controls/cart-panel.d.ts.map +1 -0
- package/lib/typescript/commonjs/controls/category-bar.d.ts +30 -0
- package/lib/typescript/commonjs/controls/category-bar.d.ts.map +1 -0
- package/lib/typescript/commonjs/controls/chart-cards.d.ts +139 -0
- package/lib/typescript/commonjs/controls/chart-cards.d.ts.map +1 -0
- package/lib/typescript/commonjs/controls/chat-composer.d.ts +117 -0
- package/lib/typescript/commonjs/controls/chat-composer.d.ts.map +1 -0
- package/lib/typescript/commonjs/controls/chat-people.d.ts +49 -0
- package/lib/typescript/commonjs/controls/chat-people.d.ts.map +1 -0
- package/lib/typescript/commonjs/controls/chat.d.ts +211 -0
- package/lib/typescript/commonjs/controls/chat.d.ts.map +1 -0
- package/lib/typescript/commonjs/controls/checkout-sheet.d.ts +26 -0
- package/lib/typescript/commonjs/controls/checkout-sheet.d.ts.map +1 -0
- package/lib/typescript/commonjs/controls/checkout-summary.d.ts +43 -0
- package/lib/typescript/commonjs/controls/checkout-summary.d.ts.map +1 -0
- package/lib/typescript/commonjs/controls/choice-list.d.ts +34 -0
- package/lib/typescript/commonjs/controls/choice-list.d.ts.map +1 -0
- package/lib/typescript/commonjs/controls/code.d.ts +53 -0
- package/lib/typescript/commonjs/controls/code.d.ts.map +1 -0
- package/lib/typescript/commonjs/controls/collapsible.d.ts +21 -0
- package/lib/typescript/commonjs/controls/collapsible.d.ts.map +1 -0
- package/lib/typescript/commonjs/controls/color-swatch-picker.d.ts +21 -0
- package/lib/typescript/commonjs/controls/color-swatch-picker.d.ts.map +1 -0
- package/lib/typescript/commonjs/controls/composer-panel.d.ts +48 -0
- package/lib/typescript/commonjs/controls/composer-panel.d.ts.map +1 -0
- package/lib/typescript/commonjs/controls/composition-bar.d.ts +27 -0
- package/lib/typescript/commonjs/controls/composition-bar.d.ts.map +1 -0
- package/lib/typescript/commonjs/controls/confirmation-dialog.d.ts +47 -0
- package/lib/typescript/commonjs/controls/confirmation-dialog.d.ts.map +1 -0
- package/lib/typescript/commonjs/controls/containers.d.ts +307 -0
- package/lib/typescript/commonjs/controls/containers.d.ts.map +1 -0
- package/lib/typescript/commonjs/controls/context-menu.d.ts +32 -0
- package/lib/typescript/commonjs/controls/context-menu.d.ts.map +1 -0
- package/lib/typescript/commonjs/controls/creator-studio.d.ts +111 -0
- package/lib/typescript/commonjs/controls/creator-studio.d.ts.map +1 -0
- package/lib/typescript/commonjs/controls/crm.d.ts +55 -0
- package/lib/typescript/commonjs/controls/crm.d.ts.map +1 -0
- package/lib/typescript/commonjs/controls/dashboard-cards.d.ts +33 -0
- package/lib/typescript/commonjs/controls/dashboard-cards.d.ts.map +1 -0
- package/lib/typescript/commonjs/controls/data-table.d.ts +103 -0
- package/lib/typescript/commonjs/controls/data-table.d.ts.map +1 -0
- package/lib/typescript/commonjs/controls/date-picker.d.ts +103 -0
- package/lib/typescript/commonjs/controls/date-picker.d.ts.map +1 -0
- package/lib/typescript/commonjs/controls/delivery-slot.d.ts +46 -0
- package/lib/typescript/commonjs/controls/delivery-slot.d.ts.map +1 -0
- package/lib/typescript/commonjs/controls/draw.d.ts +92 -0
- package/lib/typescript/commonjs/controls/draw.d.ts.map +1 -0
- package/lib/typescript/commonjs/controls/drop-zone.d.ts +28 -0
- package/lib/typescript/commonjs/controls/drop-zone.d.ts.map +1 -0
- package/lib/typescript/commonjs/controls/eviction.d.ts +29 -0
- package/lib/typescript/commonjs/controls/eviction.d.ts.map +1 -0
- package/lib/typescript/commonjs/controls/expandable-text.d.ts +29 -0
- package/lib/typescript/commonjs/controls/expandable-text.d.ts.map +1 -0
- package/lib/typescript/commonjs/controls/fact-strip.d.ts +31 -0
- package/lib/typescript/commonjs/controls/fact-strip.d.ts.map +1 -0
- package/lib/typescript/commonjs/controls/file-upload.d.ts +31 -0
- package/lib/typescript/commonjs/controls/file-upload.d.ts.map +1 -0
- package/lib/typescript/commonjs/controls/generic.d.ts +96 -0
- package/lib/typescript/commonjs/controls/generic.d.ts.map +1 -0
- package/lib/typescript/commonjs/controls/glass-group.d.ts +22 -0
- package/lib/typescript/commonjs/controls/glass-group.d.ts.map +1 -0
- package/lib/typescript/commonjs/controls/home-search.d.ts +43 -0
- package/lib/typescript/commonjs/controls/home-search.d.ts.map +1 -0
- package/lib/typescript/commonjs/controls/hover-card.d.ts +31 -0
- package/lib/typescript/commonjs/controls/hover-card.d.ts.map +1 -0
- package/lib/typescript/commonjs/controls/index.d.ts +9 -0
- package/lib/typescript/commonjs/controls/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/controls/input-group.d.ts +30 -0
- package/lib/typescript/commonjs/controls/input-group.d.ts.map +1 -0
- package/lib/typescript/commonjs/controls/input-otp.d.ts +25 -0
- package/lib/typescript/commonjs/controls/input-otp.d.ts.map +1 -0
- package/lib/typescript/commonjs/controls/inputs.d.ts +206 -0
- package/lib/typescript/commonjs/controls/inputs.d.ts.map +1 -0
- package/lib/typescript/commonjs/controls/link-preview.d.ts +16 -0
- package/lib/typescript/commonjs/controls/link-preview.d.ts.map +1 -0
- package/lib/typescript/commonjs/controls/list.d.ts +192 -0
- package/lib/typescript/commonjs/controls/list.d.ts.map +1 -0
- package/lib/typescript/commonjs/controls/listing-actions.d.ts +58 -0
- package/lib/typescript/commonjs/controls/listing-actions.d.ts.map +1 -0
- package/lib/typescript/commonjs/controls/listing-card.d.ts +44 -0
- package/lib/typescript/commonjs/controls/listing-card.d.ts.map +1 -0
- package/lib/typescript/commonjs/controls/listing-editor.d.ts +35 -0
- package/lib/typescript/commonjs/controls/listing-editor.d.ts.map +1 -0
- package/lib/typescript/commonjs/controls/listings.d.ts +68 -0
- package/lib/typescript/commonjs/controls/listings.d.ts.map +1 -0
- package/lib/typescript/commonjs/controls/lockup.d.ts +42 -0
- package/lib/typescript/commonjs/controls/lockup.d.ts.map +1 -0
- package/lib/typescript/commonjs/controls/logistics.d.ts +133 -0
- package/lib/typescript/commonjs/controls/logistics.d.ts.map +1 -0
- package/lib/typescript/commonjs/controls/lyrics.d.ts +30 -0
- package/lib/typescript/commonjs/controls/lyrics.d.ts.map +1 -0
- package/lib/typescript/commonjs/controls/mail.d.ts +87 -0
- package/lib/typescript/commonjs/controls/mail.d.ts.map +1 -0
- package/lib/typescript/commonjs/controls/map-chrome.d.ts +56 -0
- package/lib/typescript/commonjs/controls/map-chrome.d.ts.map +1 -0
- package/lib/typescript/commonjs/controls/markdown.d.ts +43 -0
- package/lib/typescript/commonjs/controls/markdown.d.ts.map +1 -0
- package/lib/typescript/commonjs/controls/media-cards.d.ts +124 -0
- package/lib/typescript/commonjs/controls/media-cards.d.ts.map +1 -0
- package/lib/typescript/commonjs/controls/media-controls.d.ts +32 -0
- package/lib/typescript/commonjs/controls/media-controls.d.ts.map +1 -0
- package/lib/typescript/commonjs/controls/media-flight.d.ts +52 -0
- package/lib/typescript/commonjs/controls/media-flight.d.ts.map +1 -0
- package/lib/typescript/commonjs/controls/media-inset-border.d.ts +19 -0
- package/lib/typescript/commonjs/controls/media-inset-border.d.ts.map +1 -0
- package/lib/typescript/commonjs/controls/media-player.d.ts +109 -0
- package/lib/typescript/commonjs/controls/media-player.d.ts.map +1 -0
- package/lib/typescript/commonjs/controls/media.d.ts +68 -0
- package/lib/typescript/commonjs/controls/media.d.ts.map +1 -0
- package/lib/typescript/commonjs/controls/menu-item.d.ts +33 -0
- package/lib/typescript/commonjs/controls/menu-item.d.ts.map +1 -0
- package/lib/typescript/commonjs/controls/menubar.d.ts +28 -0
- package/lib/typescript/commonjs/controls/menubar.d.ts.map +1 -0
- package/lib/typescript/commonjs/controls/message-bubble.d.ts +53 -0
- package/lib/typescript/commonjs/controls/message-bubble.d.ts.map +1 -0
- package/lib/typescript/commonjs/controls/multi-agent-chat.d.ts +28 -0
- package/lib/typescript/commonjs/controls/multi-agent-chat.d.ts.map +1 -0
- package/lib/typescript/commonjs/controls/music-library.d.ts +65 -0
- package/lib/typescript/commonjs/controls/music-library.d.ts.map +1 -0
- package/lib/typescript/commonjs/controls/note-card.d.ts +32 -0
- package/lib/typescript/commonjs/controls/note-card.d.ts.map +1 -0
- package/lib/typescript/commonjs/controls/notification.d.ts +43 -0
- package/lib/typescript/commonjs/controls/notification.d.ts.map +1 -0
- package/lib/typescript/commonjs/controls/offering-badge.d.ts +19 -0
- package/lib/typescript/commonjs/controls/offering-badge.d.ts.map +1 -0
- package/lib/typescript/commonjs/controls/order-confirmation.d.ts +26 -0
- package/lib/typescript/commonjs/controls/order-confirmation.d.ts.map +1 -0
- package/lib/typescript/commonjs/controls/order-status.d.ts +35 -0
- package/lib/typescript/commonjs/controls/order-status.d.ts.map +1 -0
- package/lib/typescript/commonjs/controls/overlays.d.ts +175 -0
- package/lib/typescript/commonjs/controls/overlays.d.ts.map +1 -0
- package/lib/typescript/commonjs/controls/payment-method.d.ts +47 -0
- package/lib/typescript/commonjs/controls/payment-method.d.ts.map +1 -0
- package/lib/typescript/commonjs/controls/payment-status.d.ts +33 -0
- package/lib/typescript/commonjs/controls/payment-status.d.ts.map +1 -0
- package/lib/typescript/commonjs/controls/phone-input.d.ts +36 -0
- package/lib/typescript/commonjs/controls/phone-input.d.ts.map +1 -0
- package/lib/typescript/commonjs/controls/place-reviews.d.ts +21 -0
- package/lib/typescript/commonjs/controls/place-reviews.d.ts.map +1 -0
- package/lib/typescript/commonjs/controls/places.d.ts +92 -0
- package/lib/typescript/commonjs/controls/places.d.ts.map +1 -0
- package/lib/typescript/commonjs/controls/price-breakdown.d.ts +27 -0
- package/lib/typescript/commonjs/controls/price-breakdown.d.ts.map +1 -0
- package/lib/typescript/commonjs/controls/product.d.ts +71 -0
- package/lib/typescript/commonjs/controls/product.d.ts.map +1 -0
- package/lib/typescript/commonjs/controls/project-board.d.ts +63 -0
- package/lib/typescript/commonjs/controls/project-board.d.ts.map +1 -0
- package/lib/typescript/commonjs/controls/property-insights.d.ts +20 -0
- package/lib/typescript/commonjs/controls/property-insights.d.ts.map +1 -0
- package/lib/typescript/commonjs/controls/queue-panel.d.ts +35 -0
- package/lib/typescript/commonjs/controls/queue-panel.d.ts.map +1 -0
- package/lib/typescript/commonjs/controls/rating.d.ts +98 -0
- package/lib/typescript/commonjs/controls/rating.d.ts.map +1 -0
- package/lib/typescript/commonjs/controls/route-stops.d.ts +20 -0
- package/lib/typescript/commonjs/controls/route-stops.d.ts.map +1 -0
- package/lib/typescript/commonjs/controls/settings.d.ts +73 -0
- package/lib/typescript/commonjs/controls/settings.d.ts.map +1 -0
- package/lib/typescript/commonjs/controls/share-sheet.d.ts +29 -0
- package/lib/typescript/commonjs/controls/share-sheet.d.ts.map +1 -0
- package/lib/typescript/commonjs/controls/slider.d.ts +53 -0
- package/lib/typescript/commonjs/controls/slider.d.ts.map +1 -0
- package/lib/typescript/commonjs/controls/social-button.d.ts +32 -0
- package/lib/typescript/commonjs/controls/social-button.d.ts.map +1 -0
- package/lib/typescript/commonjs/controls/sortable-chip-row.d.ts +24 -0
- package/lib/typescript/commonjs/controls/sortable-chip-row.d.ts.map +1 -0
- package/lib/typescript/commonjs/controls/sortable-media.d.ts +29 -0
- package/lib/typescript/commonjs/controls/sortable-media.d.ts.map +1 -0
- package/lib/typescript/commonjs/controls/spinner-icon.d.ts +16 -0
- package/lib/typescript/commonjs/controls/spinner-icon.d.ts.map +1 -0
- package/lib/typescript/commonjs/controls/stat-bar.d.ts +108 -0
- package/lib/typescript/commonjs/controls/stat-bar.d.ts.map +1 -0
- package/lib/typescript/commonjs/controls/stat-cards.d.ts +25 -0
- package/lib/typescript/commonjs/controls/stat-cards.d.ts.map +1 -0
- package/lib/typescript/commonjs/controls/stay-filters.d.ts +111 -0
- package/lib/typescript/commonjs/controls/stay-filters.d.ts.map +1 -0
- package/lib/typescript/commonjs/controls/stay-search.d.ts +46 -0
- package/lib/typescript/commonjs/controls/stay-search.d.ts.map +1 -0
- package/lib/typescript/commonjs/controls/stepper.d.ts +43 -0
- package/lib/typescript/commonjs/controls/stepper.d.ts.map +1 -0
- package/lib/typescript/commonjs/controls/table.d.ts +64 -0
- package/lib/typescript/commonjs/controls/table.d.ts.map +1 -0
- package/lib/typescript/commonjs/controls/tag-field.d.ts +33 -0
- package/lib/typescript/commonjs/controls/tag-field.d.ts.map +1 -0
- package/lib/typescript/commonjs/controls/task-list.d.ts +17 -0
- package/lib/typescript/commonjs/controls/task-list.d.ts.map +1 -0
- package/lib/typescript/commonjs/controls/tenancy.d.ts +51 -0
- package/lib/typescript/commonjs/controls/tenancy.d.ts.map +1 -0
- package/lib/typescript/commonjs/controls/toolbar-group.d.ts +23 -0
- package/lib/typescript/commonjs/controls/toolbar-group.d.ts.map +1 -0
- package/lib/typescript/commonjs/controls/tooltip.d.ts +28 -0
- package/lib/typescript/commonjs/controls/tooltip.d.ts.map +1 -0
- package/lib/typescript/commonjs/controls/track-list.d.ts +91 -0
- package/lib/typescript/commonjs/controls/track-list.d.ts.map +1 -0
- package/lib/typescript/commonjs/controls/vendor-card.d.ts +23 -0
- package/lib/typescript/commonjs/controls/vendor-card.d.ts.map +1 -0
- package/lib/typescript/commonjs/controls/video-playback.d.ts +30 -0
- package/lib/typescript/commonjs/controls/video-playback.d.ts.map +1 -0
- package/lib/typescript/commonjs/controls/video-view.d.ts +18 -0
- package/lib/typescript/commonjs/controls/video-view.d.ts.map +1 -0
- package/lib/typescript/commonjs/controls/view-that-fits.d.ts +16 -0
- package/lib/typescript/commonjs/controls/view-that-fits.d.ts.map +1 -0
- package/lib/typescript/commonjs/controls/viewport.d.ts +17 -0
- package/lib/typescript/commonjs/controls/viewport.d.ts.map +1 -0
- package/lib/typescript/commonjs/controls/voice.d.ts +29 -0
- package/lib/typescript/commonjs/controls/voice.d.ts.map +1 -0
- package/lib/typescript/commonjs/controls/web-search.d.ts +17 -0
- package/lib/typescript/commonjs/controls/web-search.d.ts.map +1 -0
- package/lib/typescript/commonjs/controls/zoomable-media-gallery.d.ts +43 -0
- package/lib/typescript/commonjs/controls/zoomable-media-gallery.d.ts.map +1 -0
- package/lib/typescript/commonjs/depth-stack.d.ts +22 -0
- package/lib/typescript/commonjs/depth-stack.d.ts.map +1 -0
- package/lib/typescript/commonjs/env.d.ts +57 -0
- package/lib/typescript/commonjs/env.d.ts.map +1 -0
- package/lib/typescript/commonjs/environment.d.ts +49 -0
- package/lib/typescript/commonjs/environment.d.ts.map +1 -0
- package/lib/typescript/commonjs/generated/sf-symbols.generated.d.ts +8 -0
- package/lib/typescript/commonjs/generated/sf-symbols.generated.d.ts.map +1 -0
- package/lib/typescript/commonjs/generated/spec.generated.d.ts +2674 -0
- package/lib/typescript/commonjs/generated/spec.generated.d.ts.map +1 -0
- package/lib/typescript/commonjs/generated/web-sheet.generated.d.ts +15 -0
- package/lib/typescript/commonjs/generated/web-sheet.generated.d.ts.map +1 -0
- package/lib/typescript/commonjs/glass.d.ts +64 -0
- package/lib/typescript/commonjs/glass.d.ts.map +1 -0
- package/lib/typescript/commonjs/index.d.ts +271 -0
- package/lib/typescript/commonjs/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/modifier.d.ts +28 -0
- package/lib/typescript/commonjs/modifier.d.ts.map +1 -0
- package/lib/typescript/commonjs/motion/keyframes.d.ts +56 -0
- package/lib/typescript/commonjs/motion/keyframes.d.ts.map +1 -0
- package/lib/typescript/commonjs/motion/motion-node.d.ts +155 -0
- package/lib/typescript/commonjs/motion/motion-node.d.ts.map +1 -0
- package/lib/typescript/commonjs/motion/namespace.d.ts +46 -0
- package/lib/typescript/commonjs/motion/namespace.d.ts.map +1 -0
- package/lib/typescript/commonjs/motion/phases.d.ts +19 -0
- package/lib/typescript/commonjs/motion/phases.d.ts.map +1 -0
- package/lib/typescript/commonjs/motion/text-roll.d.ts +40 -0
- package/lib/typescript/commonjs/motion/text-roll.d.ts.map +1 -0
- package/lib/typescript/commonjs/motion/tokens.d.ts +42 -0
- package/lib/typescript/commonjs/motion/tokens.d.ts.map +1 -0
- package/lib/typescript/commonjs/motion/tracks.d.ts +28 -0
- package/lib/typescript/commonjs/motion/tracks.d.ts.map +1 -0
- package/lib/typescript/commonjs/motion/transition.d.ts +24 -0
- package/lib/typescript/commonjs/motion/transition.d.ts.map +1 -0
- package/lib/typescript/commonjs/motion/values.d.ts +28 -0
- package/lib/typescript/commonjs/motion/values.d.ts.map +1 -0
- package/lib/typescript/commonjs/node.d.ts +3406 -0
- package/lib/typescript/commonjs/node.d.ts.map +1 -0
- package/lib/typescript/commonjs/package.json +1 -0
- package/lib/typescript/commonjs/paint.d.ts +85 -0
- package/lib/typescript/commonjs/paint.d.ts.map +1 -0
- package/lib/typescript/commonjs/painted-host.d.ts +14 -0
- package/lib/typescript/commonjs/painted-host.d.ts.map +1 -0
- package/lib/typescript/commonjs/platform/bottom-bar-host.d.ts +3 -0
- package/lib/typescript/commonjs/platform/bottom-bar-host.d.ts.map +1 -0
- package/lib/typescript/commonjs/platform/confirmation-host.android.d.ts +3 -0
- package/lib/typescript/commonjs/platform/confirmation-host.android.d.ts.map +1 -0
- package/lib/typescript/commonjs/platform/confirmation-host.ios.d.ts +3 -0
- package/lib/typescript/commonjs/platform/confirmation-host.ios.d.ts.map +1 -0
- package/lib/typescript/commonjs/platform/confirmation-host.web.d.ts +3 -0
- package/lib/typescript/commonjs/platform/confirmation-host.web.d.ts.map +1 -0
- package/lib/typescript/commonjs/platform/glass-group-host.android.d.ts +5 -0
- package/lib/typescript/commonjs/platform/glass-group-host.android.d.ts.map +1 -0
- package/lib/typescript/commonjs/platform/glass-group-host.ios.d.ts +4 -0
- package/lib/typescript/commonjs/platform/glass-group-host.ios.d.ts.map +1 -0
- package/lib/typescript/commonjs/platform/glass-group-host.types.d.ts +30 -0
- package/lib/typescript/commonjs/platform/glass-group-host.types.d.ts.map +1 -0
- package/lib/typescript/commonjs/platform/glass-group-host.web.d.ts +11 -0
- package/lib/typescript/commonjs/platform/glass-group-host.web.d.ts.map +1 -0
- package/lib/typescript/commonjs/platform/glass-host.android.d.ts +3 -0
- package/lib/typescript/commonjs/platform/glass-host.android.d.ts.map +1 -0
- package/lib/typescript/commonjs/platform/glass-host.ios.d.ts +3 -0
- package/lib/typescript/commonjs/platform/glass-host.ios.d.ts.map +1 -0
- package/lib/typescript/commonjs/platform/glass-host.types.d.ts +38 -0
- package/lib/typescript/commonjs/platform/glass-host.types.d.ts.map +1 -0
- package/lib/typescript/commonjs/platform/glass-host.web.d.ts +8 -0
- package/lib/typescript/commonjs/platform/glass-host.web.d.ts.map +1 -0
- package/lib/typescript/commonjs/platform/header-host.d.ts +2 -0
- package/lib/typescript/commonjs/platform/header-host.d.ts.map +1 -0
- package/lib/typescript/commonjs/platform/header-host.ios.d.ts +5 -0
- package/lib/typescript/commonjs/platform/header-host.ios.d.ts.map +1 -0
- package/lib/typescript/commonjs/platform/header-page.d.ts +27 -0
- package/lib/typescript/commonjs/platform/header-page.d.ts.map +1 -0
- package/lib/typescript/commonjs/platform/host.types.d.ts +23 -0
- package/lib/typescript/commonjs/platform/host.types.d.ts.map +1 -0
- package/lib/typescript/commonjs/platform/lens-glass.d.ts +13 -0
- package/lib/typescript/commonjs/platform/lens-glass.d.ts.map +1 -0
- package/lib/typescript/commonjs/platform/lens-group.d.ts +32 -0
- package/lib/typescript/commonjs/platform/lens-group.d.ts.map +1 -0
- package/lib/typescript/commonjs/platform/lens.d.ts +103 -0
- package/lib/typescript/commonjs/platform/lens.d.ts.map +1 -0
- package/lib/typescript/commonjs/platform/menu-actions.d.ts +32 -0
- package/lib/typescript/commonjs/platform/menu-actions.d.ts.map +1 -0
- package/lib/typescript/commonjs/platform/menu-dropdown.d.ts +43 -0
- package/lib/typescript/commonjs/platform/menu-dropdown.d.ts.map +1 -0
- package/lib/typescript/commonjs/platform/menu-host.android.d.ts +12 -0
- package/lib/typescript/commonjs/platform/menu-host.android.d.ts.map +1 -0
- package/lib/typescript/commonjs/platform/menu-host.ios.d.ts +3 -0
- package/lib/typescript/commonjs/platform/menu-host.ios.d.ts.map +1 -0
- package/lib/typescript/commonjs/platform/menu-host.web.d.ts +2 -0
- package/lib/typescript/commonjs/platform/menu-host.web.d.ts.map +1 -0
- package/lib/typescript/commonjs/platform/menu-rows.d.ts +72 -0
- package/lib/typescript/commonjs/platform/menu-rows.d.ts.map +1 -0
- package/lib/typescript/commonjs/platform/sf-symbol.ios.d.ts +3 -0
- package/lib/typescript/commonjs/platform/sf-symbol.ios.d.ts.map +1 -0
- package/lib/typescript/commonjs/platform/values.d.ts +6 -0
- package/lib/typescript/commonjs/platform/values.d.ts.map +1 -0
- package/lib/typescript/commonjs/primitives.d.ts +272 -0
- package/lib/typescript/commonjs/primitives.d.ts.map +1 -0
- package/lib/typescript/commonjs/render.d.ts +25 -0
- package/lib/typescript/commonjs/render.d.ts.map +1 -0
- package/lib/typescript/commonjs/router/app-layout.d.ts +9 -0
- package/lib/typescript/commonjs/router/app-layout.d.ts.map +1 -0
- package/lib/typescript/commonjs/router/bar.d.ts +12 -0
- package/lib/typescript/commonjs/router/bar.d.ts.map +1 -0
- package/lib/typescript/commonjs/router/bar.ios.d.ts +11 -0
- package/lib/typescript/commonjs/router/bar.ios.d.ts.map +1 -0
- package/lib/typescript/commonjs/router/components.d.ts +41 -0
- package/lib/typescript/commonjs/router/components.d.ts.map +1 -0
- package/lib/typescript/commonjs/router/index.d.ts +8 -0
- package/lib/typescript/commonjs/router/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/router/navigators.d.ts +5 -0
- package/lib/typescript/commonjs/router/navigators.d.ts.map +1 -0
- package/lib/typescript/commonjs/router/nodes.d.ts +75 -0
- package/lib/typescript/commonjs/router/nodes.d.ts.map +1 -0
- package/lib/typescript/commonjs/router/pager.d.ts +8 -0
- package/lib/typescript/commonjs/router/pager.d.ts.map +1 -0
- package/lib/typescript/commonjs/router/primary.d.ts +13 -0
- package/lib/typescript/commonjs/router/primary.d.ts.map +1 -0
- package/lib/typescript/commonjs/router/routes.d.ts +4 -0
- package/lib/typescript/commonjs/router/routes.d.ts.map +1 -0
- package/lib/typescript/commonjs/router/screen-header.d.ts +3 -0
- package/lib/typescript/commonjs/router/screen-header.d.ts.map +1 -0
- package/lib/typescript/commonjs/router/screen-header.ios.d.ts +9 -0
- package/lib/typescript/commonjs/router/screen-header.ios.d.ts.map +1 -0
- package/lib/typescript/commonjs/router/screen-host.d.ts +5 -0
- package/lib/typescript/commonjs/router/screen-host.d.ts.map +1 -0
- package/lib/typescript/commonjs/router/sheet-bloom.d.ts +12 -0
- package/lib/typescript/commonjs/router/sheet-bloom.d.ts.map +1 -0
- package/lib/typescript/commonjs/router/sheet-host.d.ts +2 -0
- package/lib/typescript/commonjs/router/sheet-host.d.ts.map +1 -0
- package/lib/typescript/commonjs/router/sheet-host.ios.d.ts +3 -0
- package/lib/typescript/commonjs/router/sheet-host.ios.d.ts.map +1 -0
- package/lib/typescript/commonjs/router/shell-panels.d.ts +9 -0
- package/lib/typescript/commonjs/router/shell-panels.d.ts.map +1 -0
- package/lib/typescript/commonjs/router/stack.d.ts +5 -0
- package/lib/typescript/commonjs/router/stack.d.ts.map +1 -0
- package/lib/typescript/commonjs/router/stack.ios.d.ts +5 -0
- package/lib/typescript/commonjs/router/stack.ios.d.ts.map +1 -0
- package/lib/typescript/commonjs/router/stack.web.d.ts +5 -0
- package/lib/typescript/commonjs/router/stack.web.d.ts.map +1 -0
- package/lib/typescript/commonjs/router/tabs.d.ts +2 -0
- package/lib/typescript/commonjs/router/tabs.d.ts.map +1 -0
- package/lib/typescript/commonjs/router/tabs.ios.d.ts +2 -0
- package/lib/typescript/commonjs/router/tabs.ios.d.ts.map +1 -0
- package/lib/typescript/commonjs/state-host.d.ts +44 -0
- package/lib/typescript/commonjs/state-host.d.ts.map +1 -0
- package/lib/typescript/commonjs/style.d.ts +268 -0
- package/lib/typescript/commonjs/style.d.ts.map +1 -0
- package/lib/typescript/commonjs/toast.d.ts +31 -0
- package/lib/typescript/commonjs/toast.d.ts.map +1 -0
- package/lib/typescript/commonjs/tokens.d.ts +446 -0
- package/lib/typescript/commonjs/tokens.d.ts.map +1 -0
- package/lib/typescript/commonjs/variants.d.ts +50 -0
- package/lib/typescript/commonjs/variants.d.ts.map +1 -0
- package/lib/typescript/commonjs/view.d.ts +29 -0
- package/lib/typescript/commonjs/view.d.ts.map +1 -0
- package/lib/typescript/commonjs/web-sheet.d.ts +78 -0
- package/lib/typescript/commonjs/web-sheet.d.ts.map +1 -0
- package/lib/typescript/module/binding.d.ts +31 -0
- package/lib/typescript/module/binding.d.ts.map +1 -0
- package/lib/typescript/module/chrome/command-host.d.ts +7 -0
- package/lib/typescript/module/chrome/command-host.d.ts.map +1 -0
- package/lib/typescript/module/chrome/defined.d.ts +7 -0
- package/lib/typescript/module/chrome/defined.d.ts.map +1 -0
- package/lib/typescript/module/chrome/layout-hosts.d.ts +26 -0
- package/lib/typescript/module/chrome/layout-hosts.d.ts.map +1 -0
- package/lib/typescript/module/chrome/page-footer-host.d.ts +10 -0
- package/lib/typescript/module/chrome/page-footer-host.d.ts.map +1 -0
- package/lib/typescript/module/chrome/rail-host.d.ts +3 -0
- package/lib/typescript/module/chrome/rail-host.d.ts.map +1 -0
- package/lib/typescript/module/chrome/safe-area-inset.d.ts +37 -0
- package/lib/typescript/module/chrome/safe-area-inset.d.ts.map +1 -0
- package/lib/typescript/module/chrome/scroll-view-host.d.ts +31 -0
- package/lib/typescript/module/chrome/scroll-view-host.d.ts.map +1 -0
- package/lib/typescript/module/chrome/settings-host.d.ts +12 -0
- package/lib/typescript/module/chrome/settings-host.d.ts.map +1 -0
- package/lib/typescript/module/chrome/sidebar-host.d.ts +18 -0
- package/lib/typescript/module/chrome/sidebar-host.d.ts.map +1 -0
- package/lib/typescript/module/controls/accordion.d.ts +38 -0
- package/lib/typescript/module/controls/accordion.d.ts.map +1 -0
- package/lib/typescript/module/controls/activity-feed.d.ts +21 -0
- package/lib/typescript/module/controls/activity-feed.d.ts.map +1 -0
- package/lib/typescript/module/controls/activity-heatmap.d.ts +40 -0
- package/lib/typescript/module/controls/activity-heatmap.d.ts.map +1 -0
- package/lib/typescript/module/controls/address.d.ts +41 -0
- package/lib/typescript/module/controls/address.d.ts.map +1 -0
- package/lib/typescript/module/controls/agent-avatar.d.ts +36 -0
- package/lib/typescript/module/controls/agent-avatar.d.ts.map +1 -0
- package/lib/typescript/module/controls/agent-chat.d.ts +43 -0
- package/lib/typescript/module/controls/agent-chat.d.ts.map +1 -0
- package/lib/typescript/module/controls/agent-creator.d.ts +35 -0
- package/lib/typescript/module/controls/agent-creator.d.ts.map +1 -0
- package/lib/typescript/module/controls/agent-reply.d.ts +26 -0
- package/lib/typescript/module/controls/agent-reply.d.ts.map +1 -0
- package/lib/typescript/module/controls/agents.d.ts +159 -0
- package/lib/typescript/module/controls/agents.d.ts.map +1 -0
- package/lib/typescript/module/controls/ai-chat.d.ts +103 -0
- package/lib/typescript/module/controls/ai-chat.d.ts.map +1 -0
- package/lib/typescript/module/controls/ai-profile-card.d.ts +26 -0
- package/lib/typescript/module/controls/ai-profile-card.d.ts.map +1 -0
- package/lib/typescript/module/controls/ambient-photo.d.ts +23 -0
- package/lib/typescript/module/controls/ambient-photo.d.ts.map +1 -0
- package/lib/typescript/module/controls/animated-check.d.ts +19 -0
- package/lib/typescript/module/controls/animated-check.d.ts.map +1 -0
- package/lib/typescript/module/controls/avatar-flight.d.ts +20 -0
- package/lib/typescript/module/controls/avatar-flight.d.ts.map +1 -0
- package/lib/typescript/module/controls/booking.d.ts +50 -0
- package/lib/typescript/module/controls/booking.d.ts.map +1 -0
- package/lib/typescript/module/controls/breadcrumb.d.ts +38 -0
- package/lib/typescript/module/controls/breadcrumb.d.ts.map +1 -0
- package/lib/typescript/module/controls/calendar.d.ts +46 -0
- package/lib/typescript/module/controls/calendar.d.ts.map +1 -0
- package/lib/typescript/module/controls/call-ui.d.ts +106 -0
- package/lib/typescript/module/controls/call-ui.d.ts.map +1 -0
- package/lib/typescript/module/controls/card-form.d.ts +44 -0
- package/lib/typescript/module/controls/card-form.d.ts.map +1 -0
- package/lib/typescript/module/controls/carousel.d.ts +64 -0
- package/lib/typescript/module/controls/carousel.d.ts.map +1 -0
- package/lib/typescript/module/controls/cart-panel.d.ts +59 -0
- package/lib/typescript/module/controls/cart-panel.d.ts.map +1 -0
- package/lib/typescript/module/controls/category-bar.d.ts +30 -0
- package/lib/typescript/module/controls/category-bar.d.ts.map +1 -0
- package/lib/typescript/module/controls/chart-cards.d.ts +139 -0
- package/lib/typescript/module/controls/chart-cards.d.ts.map +1 -0
- package/lib/typescript/module/controls/chat-composer.d.ts +117 -0
- package/lib/typescript/module/controls/chat-composer.d.ts.map +1 -0
- package/lib/typescript/module/controls/chat-people.d.ts +49 -0
- package/lib/typescript/module/controls/chat-people.d.ts.map +1 -0
- package/lib/typescript/module/controls/chat.d.ts +211 -0
- package/lib/typescript/module/controls/chat.d.ts.map +1 -0
- package/lib/typescript/module/controls/checkout-sheet.d.ts +26 -0
- package/lib/typescript/module/controls/checkout-sheet.d.ts.map +1 -0
- package/lib/typescript/module/controls/checkout-summary.d.ts +43 -0
- package/lib/typescript/module/controls/checkout-summary.d.ts.map +1 -0
- package/lib/typescript/module/controls/choice-list.d.ts +34 -0
- package/lib/typescript/module/controls/choice-list.d.ts.map +1 -0
- package/lib/typescript/module/controls/code.d.ts +53 -0
- package/lib/typescript/module/controls/code.d.ts.map +1 -0
- package/lib/typescript/module/controls/collapsible.d.ts +21 -0
- package/lib/typescript/module/controls/collapsible.d.ts.map +1 -0
- package/lib/typescript/module/controls/color-swatch-picker.d.ts +21 -0
- package/lib/typescript/module/controls/color-swatch-picker.d.ts.map +1 -0
- package/lib/typescript/module/controls/composer-panel.d.ts +48 -0
- package/lib/typescript/module/controls/composer-panel.d.ts.map +1 -0
- package/lib/typescript/module/controls/composition-bar.d.ts +27 -0
- package/lib/typescript/module/controls/composition-bar.d.ts.map +1 -0
- package/lib/typescript/module/controls/confirmation-dialog.d.ts +47 -0
- package/lib/typescript/module/controls/confirmation-dialog.d.ts.map +1 -0
- package/lib/typescript/module/controls/containers.d.ts +307 -0
- package/lib/typescript/module/controls/containers.d.ts.map +1 -0
- package/lib/typescript/module/controls/context-menu.d.ts +32 -0
- package/lib/typescript/module/controls/context-menu.d.ts.map +1 -0
- package/lib/typescript/module/controls/creator-studio.d.ts +111 -0
- package/lib/typescript/module/controls/creator-studio.d.ts.map +1 -0
- package/lib/typescript/module/controls/crm.d.ts +55 -0
- package/lib/typescript/module/controls/crm.d.ts.map +1 -0
- package/lib/typescript/module/controls/dashboard-cards.d.ts +33 -0
- package/lib/typescript/module/controls/dashboard-cards.d.ts.map +1 -0
- package/lib/typescript/module/controls/data-table.d.ts +103 -0
- package/lib/typescript/module/controls/data-table.d.ts.map +1 -0
- package/lib/typescript/module/controls/date-picker.d.ts +103 -0
- package/lib/typescript/module/controls/date-picker.d.ts.map +1 -0
- package/lib/typescript/module/controls/delivery-slot.d.ts +46 -0
- package/lib/typescript/module/controls/delivery-slot.d.ts.map +1 -0
- package/lib/typescript/module/controls/draw.d.ts +92 -0
- package/lib/typescript/module/controls/draw.d.ts.map +1 -0
- package/lib/typescript/module/controls/drop-zone.d.ts +28 -0
- package/lib/typescript/module/controls/drop-zone.d.ts.map +1 -0
- package/lib/typescript/module/controls/eviction.d.ts +29 -0
- package/lib/typescript/module/controls/eviction.d.ts.map +1 -0
- package/lib/typescript/module/controls/expandable-text.d.ts +29 -0
- package/lib/typescript/module/controls/expandable-text.d.ts.map +1 -0
- package/lib/typescript/module/controls/fact-strip.d.ts +31 -0
- package/lib/typescript/module/controls/fact-strip.d.ts.map +1 -0
- package/lib/typescript/module/controls/file-upload.d.ts +31 -0
- package/lib/typescript/module/controls/file-upload.d.ts.map +1 -0
- package/lib/typescript/module/controls/generic.d.ts +96 -0
- package/lib/typescript/module/controls/generic.d.ts.map +1 -0
- package/lib/typescript/module/controls/glass-group.d.ts +22 -0
- package/lib/typescript/module/controls/glass-group.d.ts.map +1 -0
- package/lib/typescript/module/controls/home-search.d.ts +43 -0
- package/lib/typescript/module/controls/home-search.d.ts.map +1 -0
- package/lib/typescript/module/controls/hover-card.d.ts +31 -0
- package/lib/typescript/module/controls/hover-card.d.ts.map +1 -0
- package/lib/typescript/module/controls/index.d.ts +9 -0
- package/lib/typescript/module/controls/index.d.ts.map +1 -0
- package/lib/typescript/module/controls/input-group.d.ts +30 -0
- package/lib/typescript/module/controls/input-group.d.ts.map +1 -0
- package/lib/typescript/module/controls/input-otp.d.ts +25 -0
- package/lib/typescript/module/controls/input-otp.d.ts.map +1 -0
- package/lib/typescript/module/controls/inputs.d.ts +206 -0
- package/lib/typescript/module/controls/inputs.d.ts.map +1 -0
- package/lib/typescript/module/controls/link-preview.d.ts +16 -0
- package/lib/typescript/module/controls/link-preview.d.ts.map +1 -0
- package/lib/typescript/module/controls/list.d.ts +192 -0
- package/lib/typescript/module/controls/list.d.ts.map +1 -0
- package/lib/typescript/module/controls/listing-actions.d.ts +58 -0
- package/lib/typescript/module/controls/listing-actions.d.ts.map +1 -0
- package/lib/typescript/module/controls/listing-card.d.ts +44 -0
- package/lib/typescript/module/controls/listing-card.d.ts.map +1 -0
- package/lib/typescript/module/controls/listing-editor.d.ts +35 -0
- package/lib/typescript/module/controls/listing-editor.d.ts.map +1 -0
- package/lib/typescript/module/controls/listings.d.ts +68 -0
- package/lib/typescript/module/controls/listings.d.ts.map +1 -0
- package/lib/typescript/module/controls/lockup.d.ts +42 -0
- package/lib/typescript/module/controls/lockup.d.ts.map +1 -0
- package/lib/typescript/module/controls/logistics.d.ts +133 -0
- package/lib/typescript/module/controls/logistics.d.ts.map +1 -0
- package/lib/typescript/module/controls/lyrics.d.ts +30 -0
- package/lib/typescript/module/controls/lyrics.d.ts.map +1 -0
- package/lib/typescript/module/controls/mail.d.ts +87 -0
- package/lib/typescript/module/controls/mail.d.ts.map +1 -0
- package/lib/typescript/module/controls/map-chrome.d.ts +56 -0
- package/lib/typescript/module/controls/map-chrome.d.ts.map +1 -0
- package/lib/typescript/module/controls/markdown.d.ts +43 -0
- package/lib/typescript/module/controls/markdown.d.ts.map +1 -0
- package/lib/typescript/module/controls/media-cards.d.ts +124 -0
- package/lib/typescript/module/controls/media-cards.d.ts.map +1 -0
- package/lib/typescript/module/controls/media-controls.d.ts +32 -0
- package/lib/typescript/module/controls/media-controls.d.ts.map +1 -0
- package/lib/typescript/module/controls/media-flight.d.ts +52 -0
- package/lib/typescript/module/controls/media-flight.d.ts.map +1 -0
- package/lib/typescript/module/controls/media-inset-border.d.ts +19 -0
- package/lib/typescript/module/controls/media-inset-border.d.ts.map +1 -0
- package/lib/typescript/module/controls/media-player.d.ts +109 -0
- package/lib/typescript/module/controls/media-player.d.ts.map +1 -0
- package/lib/typescript/module/controls/media.d.ts +68 -0
- package/lib/typescript/module/controls/media.d.ts.map +1 -0
- package/lib/typescript/module/controls/menu-item.d.ts +33 -0
- package/lib/typescript/module/controls/menu-item.d.ts.map +1 -0
- package/lib/typescript/module/controls/menubar.d.ts +28 -0
- package/lib/typescript/module/controls/menubar.d.ts.map +1 -0
- package/lib/typescript/module/controls/message-bubble.d.ts +53 -0
- package/lib/typescript/module/controls/message-bubble.d.ts.map +1 -0
- package/lib/typescript/module/controls/multi-agent-chat.d.ts +28 -0
- package/lib/typescript/module/controls/multi-agent-chat.d.ts.map +1 -0
- package/lib/typescript/module/controls/music-library.d.ts +65 -0
- package/lib/typescript/module/controls/music-library.d.ts.map +1 -0
- package/lib/typescript/module/controls/note-card.d.ts +32 -0
- package/lib/typescript/module/controls/note-card.d.ts.map +1 -0
- package/lib/typescript/module/controls/notification.d.ts +43 -0
- package/lib/typescript/module/controls/notification.d.ts.map +1 -0
- package/lib/typescript/module/controls/offering-badge.d.ts +19 -0
- package/lib/typescript/module/controls/offering-badge.d.ts.map +1 -0
- package/lib/typescript/module/controls/order-confirmation.d.ts +26 -0
- package/lib/typescript/module/controls/order-confirmation.d.ts.map +1 -0
- package/lib/typescript/module/controls/order-status.d.ts +35 -0
- package/lib/typescript/module/controls/order-status.d.ts.map +1 -0
- package/lib/typescript/module/controls/overlays.d.ts +175 -0
- package/lib/typescript/module/controls/overlays.d.ts.map +1 -0
- package/lib/typescript/module/controls/payment-method.d.ts +47 -0
- package/lib/typescript/module/controls/payment-method.d.ts.map +1 -0
- package/lib/typescript/module/controls/payment-status.d.ts +33 -0
- package/lib/typescript/module/controls/payment-status.d.ts.map +1 -0
- package/lib/typescript/module/controls/phone-input.d.ts +36 -0
- package/lib/typescript/module/controls/phone-input.d.ts.map +1 -0
- package/lib/typescript/module/controls/place-reviews.d.ts +21 -0
- package/lib/typescript/module/controls/place-reviews.d.ts.map +1 -0
- package/lib/typescript/module/controls/places.d.ts +92 -0
- package/lib/typescript/module/controls/places.d.ts.map +1 -0
- package/lib/typescript/module/controls/price-breakdown.d.ts +27 -0
- package/lib/typescript/module/controls/price-breakdown.d.ts.map +1 -0
- package/lib/typescript/module/controls/product.d.ts +71 -0
- package/lib/typescript/module/controls/product.d.ts.map +1 -0
- package/lib/typescript/module/controls/project-board.d.ts +63 -0
- package/lib/typescript/module/controls/project-board.d.ts.map +1 -0
- package/lib/typescript/module/controls/property-insights.d.ts +20 -0
- package/lib/typescript/module/controls/property-insights.d.ts.map +1 -0
- package/lib/typescript/module/controls/queue-panel.d.ts +35 -0
- package/lib/typescript/module/controls/queue-panel.d.ts.map +1 -0
- package/lib/typescript/module/controls/rating.d.ts +98 -0
- package/lib/typescript/module/controls/rating.d.ts.map +1 -0
- package/lib/typescript/module/controls/route-stops.d.ts +20 -0
- package/lib/typescript/module/controls/route-stops.d.ts.map +1 -0
- package/lib/typescript/module/controls/settings.d.ts +73 -0
- package/lib/typescript/module/controls/settings.d.ts.map +1 -0
- package/lib/typescript/module/controls/share-sheet.d.ts +29 -0
- package/lib/typescript/module/controls/share-sheet.d.ts.map +1 -0
- package/lib/typescript/module/controls/slider.d.ts +53 -0
- package/lib/typescript/module/controls/slider.d.ts.map +1 -0
- package/lib/typescript/module/controls/social-button.d.ts +32 -0
- package/lib/typescript/module/controls/social-button.d.ts.map +1 -0
- package/lib/typescript/module/controls/sortable-chip-row.d.ts +24 -0
- package/lib/typescript/module/controls/sortable-chip-row.d.ts.map +1 -0
- package/lib/typescript/module/controls/sortable-media.d.ts +29 -0
- package/lib/typescript/module/controls/sortable-media.d.ts.map +1 -0
- package/lib/typescript/module/controls/spinner-icon.d.ts +16 -0
- package/lib/typescript/module/controls/spinner-icon.d.ts.map +1 -0
- package/lib/typescript/module/controls/stat-bar.d.ts +108 -0
- package/lib/typescript/module/controls/stat-bar.d.ts.map +1 -0
- package/lib/typescript/module/controls/stat-cards.d.ts +25 -0
- package/lib/typescript/module/controls/stat-cards.d.ts.map +1 -0
- package/lib/typescript/module/controls/stay-filters.d.ts +111 -0
- package/lib/typescript/module/controls/stay-filters.d.ts.map +1 -0
- package/lib/typescript/module/controls/stay-search.d.ts +46 -0
- package/lib/typescript/module/controls/stay-search.d.ts.map +1 -0
- package/lib/typescript/module/controls/stepper.d.ts +43 -0
- package/lib/typescript/module/controls/stepper.d.ts.map +1 -0
- package/lib/typescript/module/controls/table.d.ts +64 -0
- package/lib/typescript/module/controls/table.d.ts.map +1 -0
- package/lib/typescript/module/controls/tag-field.d.ts +33 -0
- package/lib/typescript/module/controls/tag-field.d.ts.map +1 -0
- package/lib/typescript/module/controls/task-list.d.ts +17 -0
- package/lib/typescript/module/controls/task-list.d.ts.map +1 -0
- package/lib/typescript/module/controls/tenancy.d.ts +51 -0
- package/lib/typescript/module/controls/tenancy.d.ts.map +1 -0
- package/lib/typescript/module/controls/toolbar-group.d.ts +23 -0
- package/lib/typescript/module/controls/toolbar-group.d.ts.map +1 -0
- package/lib/typescript/module/controls/tooltip.d.ts +28 -0
- package/lib/typescript/module/controls/tooltip.d.ts.map +1 -0
- package/lib/typescript/module/controls/track-list.d.ts +91 -0
- package/lib/typescript/module/controls/track-list.d.ts.map +1 -0
- package/lib/typescript/module/controls/vendor-card.d.ts +23 -0
- package/lib/typescript/module/controls/vendor-card.d.ts.map +1 -0
- package/lib/typescript/module/controls/video-playback.d.ts +30 -0
- package/lib/typescript/module/controls/video-playback.d.ts.map +1 -0
- package/lib/typescript/module/controls/video-view.d.ts +18 -0
- package/lib/typescript/module/controls/video-view.d.ts.map +1 -0
- package/lib/typescript/module/controls/view-that-fits.d.ts +16 -0
- package/lib/typescript/module/controls/view-that-fits.d.ts.map +1 -0
- package/lib/typescript/module/controls/viewport.d.ts +17 -0
- package/lib/typescript/module/controls/viewport.d.ts.map +1 -0
- package/lib/typescript/module/controls/voice.d.ts +29 -0
- package/lib/typescript/module/controls/voice.d.ts.map +1 -0
- package/lib/typescript/module/controls/web-search.d.ts +17 -0
- package/lib/typescript/module/controls/web-search.d.ts.map +1 -0
- package/lib/typescript/module/controls/zoomable-media-gallery.d.ts +43 -0
- package/lib/typescript/module/controls/zoomable-media-gallery.d.ts.map +1 -0
- package/lib/typescript/module/depth-stack.d.ts +22 -0
- package/lib/typescript/module/depth-stack.d.ts.map +1 -0
- package/lib/typescript/module/env.d.ts +57 -0
- package/lib/typescript/module/env.d.ts.map +1 -0
- package/lib/typescript/module/environment.d.ts +49 -0
- package/lib/typescript/module/environment.d.ts.map +1 -0
- package/lib/typescript/module/generated/sf-symbols.generated.d.ts +8 -0
- package/lib/typescript/module/generated/sf-symbols.generated.d.ts.map +1 -0
- package/lib/typescript/module/generated/spec.generated.d.ts +2674 -0
- package/lib/typescript/module/generated/spec.generated.d.ts.map +1 -0
- package/lib/typescript/module/generated/web-sheet.generated.d.ts +15 -0
- package/lib/typescript/module/generated/web-sheet.generated.d.ts.map +1 -0
- package/lib/typescript/module/glass.d.ts +64 -0
- package/lib/typescript/module/glass.d.ts.map +1 -0
- package/lib/typescript/module/index.d.ts +271 -0
- package/lib/typescript/module/index.d.ts.map +1 -0
- package/lib/typescript/module/modifier.d.ts +28 -0
- package/lib/typescript/module/modifier.d.ts.map +1 -0
- package/lib/typescript/module/motion/keyframes.d.ts +56 -0
- package/lib/typescript/module/motion/keyframes.d.ts.map +1 -0
- package/lib/typescript/module/motion/motion-node.d.ts +155 -0
- package/lib/typescript/module/motion/motion-node.d.ts.map +1 -0
- package/lib/typescript/module/motion/namespace.d.ts +46 -0
- package/lib/typescript/module/motion/namespace.d.ts.map +1 -0
- package/lib/typescript/module/motion/phases.d.ts +19 -0
- package/lib/typescript/module/motion/phases.d.ts.map +1 -0
- package/lib/typescript/module/motion/text-roll.d.ts +40 -0
- package/lib/typescript/module/motion/text-roll.d.ts.map +1 -0
- package/lib/typescript/module/motion/tokens.d.ts +42 -0
- package/lib/typescript/module/motion/tokens.d.ts.map +1 -0
- package/lib/typescript/module/motion/tracks.d.ts +28 -0
- package/lib/typescript/module/motion/tracks.d.ts.map +1 -0
- package/lib/typescript/module/motion/transition.d.ts +24 -0
- package/lib/typescript/module/motion/transition.d.ts.map +1 -0
- package/lib/typescript/module/motion/values.d.ts +28 -0
- package/lib/typescript/module/motion/values.d.ts.map +1 -0
- package/lib/typescript/module/node.d.ts +3406 -0
- package/lib/typescript/module/node.d.ts.map +1 -0
- package/lib/typescript/module/package.json +1 -0
- package/lib/typescript/module/paint.d.ts +85 -0
- package/lib/typescript/module/paint.d.ts.map +1 -0
- package/lib/typescript/module/painted-host.d.ts +14 -0
- package/lib/typescript/module/painted-host.d.ts.map +1 -0
- package/lib/typescript/module/platform/bottom-bar-host.d.ts +3 -0
- package/lib/typescript/module/platform/bottom-bar-host.d.ts.map +1 -0
- package/lib/typescript/module/platform/confirmation-host.android.d.ts +3 -0
- package/lib/typescript/module/platform/confirmation-host.android.d.ts.map +1 -0
- package/lib/typescript/module/platform/confirmation-host.ios.d.ts +3 -0
- package/lib/typescript/module/platform/confirmation-host.ios.d.ts.map +1 -0
- package/lib/typescript/module/platform/confirmation-host.web.d.ts +3 -0
- package/lib/typescript/module/platform/confirmation-host.web.d.ts.map +1 -0
- package/lib/typescript/module/platform/glass-group-host.android.d.ts +5 -0
- package/lib/typescript/module/platform/glass-group-host.android.d.ts.map +1 -0
- package/lib/typescript/module/platform/glass-group-host.ios.d.ts +4 -0
- package/lib/typescript/module/platform/glass-group-host.ios.d.ts.map +1 -0
- package/lib/typescript/module/platform/glass-group-host.types.d.ts +30 -0
- package/lib/typescript/module/platform/glass-group-host.types.d.ts.map +1 -0
- package/lib/typescript/module/platform/glass-group-host.web.d.ts +11 -0
- package/lib/typescript/module/platform/glass-group-host.web.d.ts.map +1 -0
- package/lib/typescript/module/platform/glass-host.android.d.ts +3 -0
- package/lib/typescript/module/platform/glass-host.android.d.ts.map +1 -0
- package/lib/typescript/module/platform/glass-host.ios.d.ts +3 -0
- package/lib/typescript/module/platform/glass-host.ios.d.ts.map +1 -0
- package/lib/typescript/module/platform/glass-host.types.d.ts +38 -0
- package/lib/typescript/module/platform/glass-host.types.d.ts.map +1 -0
- package/lib/typescript/module/platform/glass-host.web.d.ts +8 -0
- package/lib/typescript/module/platform/glass-host.web.d.ts.map +1 -0
- package/lib/typescript/module/platform/header-host.d.ts +2 -0
- package/lib/typescript/module/platform/header-host.d.ts.map +1 -0
- package/lib/typescript/module/platform/header-host.ios.d.ts +5 -0
- package/lib/typescript/module/platform/header-host.ios.d.ts.map +1 -0
- package/lib/typescript/module/platform/header-page.d.ts +27 -0
- package/lib/typescript/module/platform/header-page.d.ts.map +1 -0
- package/lib/typescript/module/platform/host.types.d.ts +23 -0
- package/lib/typescript/module/platform/host.types.d.ts.map +1 -0
- package/lib/typescript/module/platform/lens-glass.d.ts +13 -0
- package/lib/typescript/module/platform/lens-glass.d.ts.map +1 -0
- package/lib/typescript/module/platform/lens-group.d.ts +32 -0
- package/lib/typescript/module/platform/lens-group.d.ts.map +1 -0
- package/lib/typescript/module/platform/lens.d.ts +103 -0
- package/lib/typescript/module/platform/lens.d.ts.map +1 -0
- package/lib/typescript/module/platform/menu-actions.d.ts +32 -0
- package/lib/typescript/module/platform/menu-actions.d.ts.map +1 -0
- package/lib/typescript/module/platform/menu-dropdown.d.ts +43 -0
- package/lib/typescript/module/platform/menu-dropdown.d.ts.map +1 -0
- package/lib/typescript/module/platform/menu-host.android.d.ts +12 -0
- package/lib/typescript/module/platform/menu-host.android.d.ts.map +1 -0
- package/lib/typescript/module/platform/menu-host.ios.d.ts +3 -0
- package/lib/typescript/module/platform/menu-host.ios.d.ts.map +1 -0
- package/lib/typescript/module/platform/menu-host.web.d.ts +2 -0
- package/lib/typescript/module/platform/menu-host.web.d.ts.map +1 -0
- package/lib/typescript/module/platform/menu-rows.d.ts +72 -0
- package/lib/typescript/module/platform/menu-rows.d.ts.map +1 -0
- package/lib/typescript/module/platform/sf-symbol.ios.d.ts +3 -0
- package/lib/typescript/module/platform/sf-symbol.ios.d.ts.map +1 -0
- package/lib/typescript/module/platform/values.d.ts +6 -0
- package/lib/typescript/module/platform/values.d.ts.map +1 -0
- package/lib/typescript/module/primitives.d.ts +272 -0
- package/lib/typescript/module/primitives.d.ts.map +1 -0
- package/lib/typescript/module/render.d.ts +25 -0
- package/lib/typescript/module/render.d.ts.map +1 -0
- package/lib/typescript/module/router/app-layout.d.ts +9 -0
- package/lib/typescript/module/router/app-layout.d.ts.map +1 -0
- package/lib/typescript/module/router/bar.d.ts +12 -0
- package/lib/typescript/module/router/bar.d.ts.map +1 -0
- package/lib/typescript/module/router/bar.ios.d.ts +11 -0
- package/lib/typescript/module/router/bar.ios.d.ts.map +1 -0
- package/lib/typescript/module/router/components.d.ts +41 -0
- package/lib/typescript/module/router/components.d.ts.map +1 -0
- package/lib/typescript/module/router/index.d.ts +8 -0
- package/lib/typescript/module/router/index.d.ts.map +1 -0
- package/lib/typescript/module/router/navigators.d.ts +5 -0
- package/lib/typescript/module/router/navigators.d.ts.map +1 -0
- package/lib/typescript/module/router/nodes.d.ts +75 -0
- package/lib/typescript/module/router/nodes.d.ts.map +1 -0
- package/lib/typescript/module/router/pager.d.ts +8 -0
- package/lib/typescript/module/router/pager.d.ts.map +1 -0
- package/lib/typescript/module/router/primary.d.ts +13 -0
- package/lib/typescript/module/router/primary.d.ts.map +1 -0
- package/lib/typescript/module/router/routes.d.ts +4 -0
- package/lib/typescript/module/router/routes.d.ts.map +1 -0
- package/lib/typescript/module/router/screen-header.d.ts +3 -0
- package/lib/typescript/module/router/screen-header.d.ts.map +1 -0
- package/lib/typescript/module/router/screen-header.ios.d.ts +9 -0
- package/lib/typescript/module/router/screen-header.ios.d.ts.map +1 -0
- package/lib/typescript/module/router/screen-host.d.ts +5 -0
- package/lib/typescript/module/router/screen-host.d.ts.map +1 -0
- package/lib/typescript/module/router/sheet-bloom.d.ts +12 -0
- package/lib/typescript/module/router/sheet-bloom.d.ts.map +1 -0
- package/lib/typescript/module/router/sheet-host.d.ts +2 -0
- package/lib/typescript/module/router/sheet-host.d.ts.map +1 -0
- package/lib/typescript/module/router/sheet-host.ios.d.ts +3 -0
- package/lib/typescript/module/router/sheet-host.ios.d.ts.map +1 -0
- package/lib/typescript/module/router/shell-panels.d.ts +9 -0
- package/lib/typescript/module/router/shell-panels.d.ts.map +1 -0
- package/lib/typescript/module/router/stack.d.ts +5 -0
- package/lib/typescript/module/router/stack.d.ts.map +1 -0
- package/lib/typescript/module/router/stack.ios.d.ts +5 -0
- package/lib/typescript/module/router/stack.ios.d.ts.map +1 -0
- package/lib/typescript/module/router/stack.web.d.ts +5 -0
- package/lib/typescript/module/router/stack.web.d.ts.map +1 -0
- package/lib/typescript/module/router/tabs.d.ts +2 -0
- package/lib/typescript/module/router/tabs.d.ts.map +1 -0
- package/lib/typescript/module/router/tabs.ios.d.ts +2 -0
- package/lib/typescript/module/router/tabs.ios.d.ts.map +1 -0
- package/lib/typescript/module/state-host.d.ts +44 -0
- package/lib/typescript/module/state-host.d.ts.map +1 -0
- package/lib/typescript/module/style.d.ts +268 -0
- package/lib/typescript/module/style.d.ts.map +1 -0
- package/lib/typescript/module/toast.d.ts +31 -0
- package/lib/typescript/module/toast.d.ts.map +1 -0
- package/lib/typescript/module/tokens.d.ts +446 -0
- package/lib/typescript/module/tokens.d.ts.map +1 -0
- package/lib/typescript/module/variants.d.ts +50 -0
- package/lib/typescript/module/variants.d.ts.map +1 -0
- package/lib/typescript/module/view.d.ts +29 -0
- package/lib/typescript/module/view.d.ts.map +1 -0
- package/lib/typescript/module/web-sheet.d.ts +78 -0
- package/lib/typescript/module/web-sheet.d.ts.map +1 -0
- package/package.json +120 -4
- package/spec/language.json +4863 -0
- package/src/__tests__/android-hosts.test.tsx +497 -0
- package/src/__tests__/chrome.test.tsx +594 -0
- package/src/__tests__/containers.test.tsx +177 -0
- package/src/__tests__/containers.types.test.ts +84 -0
- package/src/__tests__/controls.test.tsx +416 -0
- package/src/__tests__/inputs.test.tsx +243 -0
- package/src/__tests__/insets.test.tsx +55 -0
- package/src/__tests__/ios-hosts.test.tsx +285 -0
- package/src/__tests__/layers.test.ts +55 -0
- package/src/__tests__/layout.test.tsx +283 -0
- package/src/__tests__/list-paint.web.test.tsx +110 -0
- package/src/__tests__/menu-actions.test.tsx +90 -0
- package/src/__tests__/menu-actions.web.test.tsx +40 -0
- package/src/__tests__/menu-rows.test.ts +104 -0
- package/src/__tests__/motion.test.tsx +914 -0
- package/src/__tests__/motion.web.test.tsx +360 -0
- package/src/__tests__/node.test.ts +86 -0
- package/src/__tests__/overlays.test.tsx +200 -0
- package/src/__tests__/overlays.types.test.ts +25 -0
- package/src/__tests__/phases.test.ts +53 -0
- package/src/__tests__/render.test.tsx +587 -0
- package/src/__tests__/render.web.test.tsx +126 -0
- package/src/__tests__/router.android.test.tsx +501 -0
- package/src/__tests__/router.ios.test.tsx +174 -0
- package/src/__tests__/router.web.test.tsx +39 -0
- package/src/__tests__/screen-action.test.tsx +41 -0
- package/src/__tests__/sheet.ios.test.tsx +85 -0
- package/src/__tests__/spec.test.ts +1787 -0
- package/src/__tests__/ssr.web.test.tsx +80 -0
- package/src/__tests__/support/absent/@expo/ui/swift-ui/index.ts +3 -0
- package/src/__tests__/support/absent/@expo/ui/swift-ui/modifiers.ts +3 -0
- package/src/__tests__/support/absent/expo-blur.ts +3 -0
- package/src/__tests__/support/absent/expo-glass-effect.ts +3 -0
- package/src/__tests__/support/absent/expo-router-native-tabs.ts +3 -0
- package/src/__tests__/support/absent/expo-router-react-navigation.ts +3 -0
- package/src/__tests__/support/absent/expo-router.ts +3 -0
- package/src/__tests__/support/absent/expo.ts +3 -0
- package/src/__tests__/support/bloom-app-shell-hooks.ts +1 -0
- package/src/__tests__/support/bloom-avatar.ts +4 -0
- package/src/__tests__/support/bloom-components.ts +109 -0
- package/src/__tests__/support/bloom-containers.ts +30 -0
- package/src/__tests__/support/bloom-controls.ts +112 -0
- package/src/__tests__/support/bloom-design-tokens.ts +9 -0
- package/src/__tests__/support/bloom-hooks.ts +15 -0
- package/src/__tests__/support/bloom-icon-modules.ts +24 -0
- package/src/__tests__/support/bloom-icons.ts +13 -0
- package/src/__tests__/support/bloom-inputs.ts +27 -0
- package/src/__tests__/support/bloom-motion.ts +26 -0
- package/src/__tests__/support/bloom-motion.web.ts +26 -0
- package/src/__tests__/support/bloom-overlays.ts +26 -0
- package/src/__tests__/support/bloom-portal.ts +3 -0
- package/src/__tests__/support/bloom-products.ts +314 -0
- package/src/__tests__/support/bloom-router.ts +59 -0
- package/src/__tests__/support/bloom-runtime.ts +19 -0
- package/src/__tests__/support/bloom-shapes.ts +7 -0
- package/src/__tests__/support/bloom-styles.ts +20 -0
- package/src/__tests__/support/bloom-theme.ts +39 -0
- package/src/__tests__/support/bloom-typography.ts +26 -0
- package/src/__tests__/support/mount.ts +49 -0
- package/src/__tests__/support/react-native-gesture-handler.ts +23 -0
- package/src/__tests__/support/react-native-reanimated.ts +69 -0
- package/src/__tests__/support/react-native.ts +17 -0
- package/src/__tests__/tokens.test.ts +65 -0
- package/src/__tests__/variants.test.tsx +509 -0
- package/src/__tests__/variants.web.test.tsx +349 -0
- package/src/__tests__/web-hosts.test.tsx +125 -0
- package/src/__tests__/workspace-bloom.test.ts +21 -0
- package/src/binding.ts +35 -0
- package/src/chrome/command-host.tsx +62 -0
- package/src/chrome/defined.ts +13 -0
- package/src/chrome/layout-hosts.tsx +173 -0
- package/src/chrome/page-footer-host.tsx +30 -0
- package/src/chrome/rail-host.tsx +47 -0
- package/src/chrome/safe-area-inset.tsx +127 -0
- package/src/chrome/scroll-view-host.tsx +197 -0
- package/src/chrome/settings-host.tsx +82 -0
- package/src/chrome/sidebar-host.tsx +240 -0
- package/src/controls/accordion.tsx +91 -0
- package/src/controls/activity-feed.tsx +47 -0
- package/src/controls/activity-heatmap.tsx +74 -0
- package/src/controls/address.tsx +81 -0
- package/src/controls/agent-avatar.tsx +76 -0
- package/src/controls/agent-chat.tsx +98 -0
- package/src/controls/agent-creator.tsx +65 -0
- package/src/controls/agent-reply.tsx +72 -0
- package/src/controls/agents.tsx +415 -0
- package/src/controls/ai-chat.tsx +274 -0
- package/src/controls/ai-profile-card.tsx +56 -0
- package/src/controls/ambient-photo.tsx +39 -0
- package/src/controls/animated-check.tsx +61 -0
- package/src/controls/avatar-flight.tsx +47 -0
- package/src/controls/booking.tsx +113 -0
- package/src/controls/breadcrumb.tsx +79 -0
- package/src/controls/calendar.tsx +97 -0
- package/src/controls/call-ui.tsx +265 -0
- package/src/controls/card-form.tsx +130 -0
- package/src/controls/carousel.tsx +139 -0
- package/src/controls/cart-panel.tsx +146 -0
- package/src/controls/category-bar.tsx +63 -0
- package/src/controls/chart-cards.tsx +365 -0
- package/src/controls/chat-composer.tsx +342 -0
- package/src/controls/chat-people.tsx +101 -0
- package/src/controls/chat.tsx +659 -0
- package/src/controls/checkout-sheet.tsx +47 -0
- package/src/controls/checkout-summary.tsx +81 -0
- package/src/controls/choice-list.tsx +121 -0
- package/src/controls/code.tsx +121 -0
- package/src/controls/collapsible.tsx +39 -0
- package/src/controls/color-swatch-picker.tsx +52 -0
- package/src/controls/composer-panel.tsx +141 -0
- package/src/controls/composition-bar.tsx +85 -0
- package/src/controls/confirmation-dialog.tsx +66 -0
- package/src/controls/containers.tsx +924 -0
- package/src/controls/context-menu.tsx +136 -0
- package/src/controls/creator-studio.tsx +313 -0
- package/src/controls/crm.tsx +135 -0
- package/src/controls/dashboard-cards.tsx +81 -0
- package/src/controls/data-table.tsx +287 -0
- package/src/controls/date-picker.tsx +251 -0
- package/src/controls/delivery-slot.tsx +122 -0
- package/src/controls/draw.ts +145 -0
- package/src/controls/drop-zone.tsx +65 -0
- package/src/controls/eviction.tsx +56 -0
- package/src/controls/expandable-text.tsx +63 -0
- package/src/controls/fact-strip.tsx +71 -0
- package/src/controls/file-upload.tsx +62 -0
- package/src/controls/generic.tsx +214 -0
- package/src/controls/glass-group.tsx +43 -0
- package/src/controls/home-search.tsx +117 -0
- package/src/controls/hover-card.tsx +70 -0
- package/src/controls/index.ts +252 -0
- package/src/controls/input-group.tsx +66 -0
- package/src/controls/input-otp.tsx +49 -0
- package/src/controls/inputs.tsx +840 -0
- package/src/controls/link-preview.tsx +37 -0
- package/src/controls/list.tsx +428 -0
- package/src/controls/listing-actions.tsx +135 -0
- package/src/controls/listing-card.tsx +99 -0
- package/src/controls/listing-editor.tsx +90 -0
- package/src/controls/listings.tsx +198 -0
- package/src/controls/lockup.tsx +69 -0
- package/src/controls/logistics.tsx +356 -0
- package/src/controls/lyrics.tsx +64 -0
- package/src/controls/mail.tsx +213 -0
- package/src/controls/map-chrome.tsx +108 -0
- package/src/controls/markdown.tsx +94 -0
- package/src/controls/media-cards.tsx +276 -0
- package/src/controls/media-controls.tsx +73 -0
- package/src/controls/media-flight.tsx +114 -0
- package/src/controls/media-inset-border.tsx +49 -0
- package/src/controls/media-player.tsx +287 -0
- package/src/controls/media.tsx +172 -0
- package/src/controls/menu-item.tsx +87 -0
- package/src/controls/menubar.tsx +134 -0
- package/src/controls/message-bubble.tsx +124 -0
- package/src/controls/multi-agent-chat.tsx +46 -0
- package/src/controls/music-library.tsx +195 -0
- package/src/controls/note-card.tsx +72 -0
- package/src/controls/notification.tsx +86 -0
- package/src/controls/offering-badge.tsx +41 -0
- package/src/controls/order-confirmation.tsx +41 -0
- package/src/controls/order-status.tsx +68 -0
- package/src/controls/overlays.tsx +373 -0
- package/src/controls/payment-method.tsx +91 -0
- package/src/controls/payment-status.tsx +63 -0
- package/src/controls/phone-input.tsx +68 -0
- package/src/controls/place-reviews.tsx +46 -0
- package/src/controls/places.tsx +209 -0
- package/src/controls/price-breakdown.tsx +63 -0
- package/src/controls/product.ts +142 -0
- package/src/controls/project-board.tsx +130 -0
- package/src/controls/property-insights.tsx +49 -0
- package/src/controls/queue-panel.tsx +73 -0
- package/src/controls/rating.tsx +201 -0
- package/src/controls/route-stops.tsx +40 -0
- package/src/controls/settings.tsx +206 -0
- package/src/controls/share-sheet.tsx +56 -0
- package/src/controls/slider.tsx +105 -0
- package/src/controls/social-button.tsx +68 -0
- package/src/controls/sortable-chip-row.tsx +58 -0
- package/src/controls/sortable-media.tsx +61 -0
- package/src/controls/spinner-icon.tsx +33 -0
- package/src/controls/stat-bar.tsx +243 -0
- package/src/controls/stat-cards.tsx +44 -0
- package/src/controls/stay-filters.tsx +273 -0
- package/src/controls/stay-search.tsx +114 -0
- package/src/controls/stepper.tsx +89 -0
- package/src/controls/table.tsx +164 -0
- package/src/controls/tag-field.tsx +71 -0
- package/src/controls/task-list.tsx +34 -0
- package/src/controls/tenancy.tsx +113 -0
- package/src/controls/toolbar-group.tsx +46 -0
- package/src/controls/tooltip.tsx +64 -0
- package/src/controls/track-list.tsx +238 -0
- package/src/controls/vendor-card.tsx +48 -0
- package/src/controls/video-playback.tsx +71 -0
- package/src/controls/video-view.tsx +35 -0
- package/src/controls/view-that-fits.tsx +118 -0
- package/src/controls/viewport.tsx +30 -0
- package/src/controls/voice.tsx +61 -0
- package/src/controls/web-search.tsx +34 -0
- package/src/controls/zoomable-media-gallery.tsx +137 -0
- package/src/depth-stack.tsx +102 -0
- package/src/env.ts +180 -0
- package/src/environment.ts +102 -0
- package/src/generated/sf-symbols.generated.ts +210 -0
- package/src/generated/spec.generated.ts +52742 -0
- package/src/generated/web-sheet.generated.ts +3383 -0
- package/src/glass.ts +88 -0
- package/src/index.ts +1921 -0
- package/src/modifier.ts +35 -0
- package/src/motion/keyframes.ts +90 -0
- package/src/motion/motion-node.tsx +631 -0
- package/src/motion/namespace.ts +52 -0
- package/src/motion/phases.ts +86 -0
- package/src/motion/text-roll.tsx +239 -0
- package/src/motion/tokens.ts +81 -0
- package/src/motion/tracks.ts +128 -0
- package/src/motion/transition.ts +48 -0
- package/src/motion/values.ts +88 -0
- package/src/node.ts +5648 -0
- package/src/paint.ts +331 -0
- package/src/painted-host.ts +47 -0
- package/src/platform/Glass.stories.tsx +109 -0
- package/src/platform/Platform.stories.tsx +128 -0
- package/src/platform/SwiftUI.stories.tsx +113 -0
- package/src/platform/bottom-bar-host.tsx +63 -0
- package/src/platform/confirmation-host.android.tsx +99 -0
- package/src/platform/confirmation-host.ios.tsx +114 -0
- package/src/platform/confirmation-host.web.tsx +54 -0
- package/src/platform/glass-group-host.android.tsx +46 -0
- package/src/platform/glass-group-host.ios.tsx +239 -0
- package/src/platform/glass-group-host.types.ts +34 -0
- package/src/platform/glass-group-host.web.ts +14 -0
- package/src/platform/glass-host.android.tsx +53 -0
- package/src/platform/glass-host.ios.tsx +118 -0
- package/src/platform/glass-host.types.ts +41 -0
- package/src/platform/glass-host.web.ts +10 -0
- package/src/platform/header-host.ios.tsx +252 -0
- package/src/platform/header-host.tsx +2 -0
- package/src/platform/header-page.tsx +101 -0
- package/src/platform/host.types.ts +25 -0
- package/src/platform/lens-glass.ts +35 -0
- package/src/platform/lens-group.tsx +103 -0
- package/src/platform/lens.ts +121 -0
- package/src/platform/menu-actions.tsx +87 -0
- package/src/platform/menu-dropdown.tsx +182 -0
- package/src/platform/menu-host.android.tsx +218 -0
- package/src/platform/menu-host.ios.tsx +151 -0
- package/src/platform/menu-host.web.tsx +2 -0
- package/src/platform/menu-rows.ts +219 -0
- package/src/platform/sf-symbol.ios.ts +10 -0
- package/src/platform/values.ts +19 -0
- package/src/primitives.ts +562 -0
- package/src/render.tsx +3377 -0
- package/src/router/app-layout.tsx +91 -0
- package/src/router/bar.ios.tsx +14 -0
- package/src/router/bar.tsx +44 -0
- package/src/router/components.tsx +88 -0
- package/src/router/index.ts +7 -0
- package/src/router/navigators.tsx +22 -0
- package/src/router/nodes.ts +111 -0
- package/src/router/pager.ts +10 -0
- package/src/router/primary.ts +17 -0
- package/src/router/routes.ts +10 -0
- package/src/router/screen-header.ios.tsx +8 -0
- package/src/router/screen-header.tsx +4 -0
- package/src/router/screen-host.tsx +169 -0
- package/src/router/sheet-bloom.tsx +114 -0
- package/src/router/sheet-host.ios.tsx +128 -0
- package/src/router/sheet-host.tsx +2 -0
- package/src/router/shell-panels.ts +93 -0
- package/src/router/stack.ios.tsx +30 -0
- package/src/router/stack.tsx +32 -0
- package/src/router/stack.web.tsx +14 -0
- package/src/router/tabs.ios.tsx +50 -0
- package/src/router/tabs.tsx +17 -0
- package/src/state-host.tsx +174 -0
- package/src/stories/Parity.stories.tsx +193 -0
- package/src/stories/ParityFrame.stories.tsx +30 -0
- package/src/stories/parity-families.ts +256 -0
- package/src/style.ts +1236 -0
- package/src/toast.ts +46 -0
- package/src/tokens.ts +642 -0
- package/src/variants.ts +120 -0
- package/src/view.ts +49 -0
- package/src/web-sheet.ts +247 -0
- package/README.md +0 -3
package/src/render.tsx
ADDED
|
@@ -0,0 +1,3377 @@
|
|
|
1
|
+
import {
|
|
2
|
+
cloneElement,
|
|
3
|
+
createContext,
|
|
4
|
+
createElement,
|
|
5
|
+
Fragment,
|
|
6
|
+
useContext,
|
|
7
|
+
type ReactElement,
|
|
8
|
+
type ReactNode,
|
|
9
|
+
} from 'react';
|
|
10
|
+
import {
|
|
11
|
+
Platform,
|
|
12
|
+
Pressable,
|
|
13
|
+
Text as RNText,
|
|
14
|
+
View,
|
|
15
|
+
type GestureResponderEvent,
|
|
16
|
+
} from 'react-native';
|
|
17
|
+
import { Avatar as BloomAvatar } from '@oxy.so/bloom/avatar';
|
|
18
|
+
import { AvatarGroup as BloomAvatarGroup } from '@oxy.so/bloom/avatar-group';
|
|
19
|
+
import { Badge as BloomBadge } from '@oxy.so/bloom/badge';
|
|
20
|
+
import { AvatarPresence } from '@oxy.so/bloom/chat-indicators';
|
|
21
|
+
import { IconCircle as BloomIconCircle } from '@oxy.so/bloom/icon-circle';
|
|
22
|
+
import { Loading as BloomLoading } from '@oxy.so/bloom/loading';
|
|
23
|
+
import * as BloomSkeleton from '@oxy.so/bloom/skeleton';
|
|
24
|
+
import { hoverGroupProps, SubtleHover } from '@oxy.so/bloom/subtle-hover';
|
|
25
|
+
import { Button as BloomButton } from '@oxy.so/bloom/button';
|
|
26
|
+
import { EngagementAction, EngagementBar, EngagementGroup } from '@oxy.so/bloom/engagement-bar';
|
|
27
|
+
import { BloomImage } from '@oxy.so/bloom/image';
|
|
28
|
+
import { Fab as BloomFab } from '@oxy.so/bloom/fab';
|
|
29
|
+
import { BlurIsland } from '@oxy.so/bloom/blur';
|
|
30
|
+
import { useScreenVisible } from '@oxy.so/bloom/screen';
|
|
31
|
+
import { Sticker } from '@oxy.so/bloom/sticker';
|
|
32
|
+
import { Surface } from '@oxy.so/bloom/surface';
|
|
33
|
+
import { AspectRatio as BloomAspectRatio } from '@oxy.so/bloom/aspect-ratio';
|
|
34
|
+
import { ConcentricView } from '@oxy.so/bloom/concentric';
|
|
35
|
+
import { Divider as BloomDivider } from '@oxy.so/bloom/divider';
|
|
36
|
+
import { Fill as BloomFill } from '@oxy.so/bloom/fill';
|
|
37
|
+
import {
|
|
38
|
+
Border as ShapeBorder,
|
|
39
|
+
Fill as ShapeFill,
|
|
40
|
+
Image as ShapeImage,
|
|
41
|
+
} from '@oxy.so/bloom/shapes';
|
|
42
|
+
import { ResponsiveGrid } from '@oxy.so/bloom/grid';
|
|
43
|
+
import { openExternal } from '@oxy.so/bloom/hooks';
|
|
44
|
+
import {
|
|
45
|
+
Blockquote,
|
|
46
|
+
H1,
|
|
47
|
+
H2,
|
|
48
|
+
H3,
|
|
49
|
+
H4,
|
|
50
|
+
H5,
|
|
51
|
+
H6,
|
|
52
|
+
Large,
|
|
53
|
+
Lead,
|
|
54
|
+
Muted,
|
|
55
|
+
P,
|
|
56
|
+
Small,
|
|
57
|
+
Subtitle,
|
|
58
|
+
Text as BloomText,
|
|
59
|
+
Title,
|
|
60
|
+
} from '@oxy.so/bloom/typography';
|
|
61
|
+
|
|
62
|
+
import {
|
|
63
|
+
isNode,
|
|
64
|
+
Navigation,
|
|
65
|
+
Node,
|
|
66
|
+
type NodeKind,
|
|
67
|
+
type ActionProps,
|
|
68
|
+
type AvatarGroupProps,
|
|
69
|
+
type AvatarProps,
|
|
70
|
+
type BadgeProps as BadgeNodeProps,
|
|
71
|
+
type FrameSpec,
|
|
72
|
+
type SkeletonProps,
|
|
73
|
+
type Child,
|
|
74
|
+
type EmbedProps,
|
|
75
|
+
type IconComponent,
|
|
76
|
+
type IconProps,
|
|
77
|
+
type ImageProps,
|
|
78
|
+
type MenuProps,
|
|
79
|
+
type LottieProps,
|
|
80
|
+
type Modifier,
|
|
81
|
+
type Press,
|
|
82
|
+
type PressHandler,
|
|
83
|
+
type ShapeProps,
|
|
84
|
+
type StackProps,
|
|
85
|
+
type TextProps,
|
|
86
|
+
type TextRun,
|
|
87
|
+
type ViewNodeProps,
|
|
88
|
+
} from './node';
|
|
89
|
+
import { ENVIRONMENT, ENVIRONMENT_TAKERS, LAYER_RANK, TONE_ROLE } from './generated/spec.generated';
|
|
90
|
+
import { regular, type GlassTransition, type GlassValue } from './glass';
|
|
91
|
+
import type { Namespace } from './motion/namespace';
|
|
92
|
+
import { opacity } from './motion/transition';
|
|
93
|
+
import { getPlatformGlass } from './platform/glass-host';
|
|
94
|
+
import type { GlassMember } from './platform/glass-host.types';
|
|
95
|
+
import { ConfirmationHost } from './platform/confirmation-host';
|
|
96
|
+
import { type InsetRoom, insetsOf, NO_INSETS, SafeAreaInsets } from './chrome/safe-area-inset';
|
|
97
|
+
import { MenuHost } from './platform/menu-host';
|
|
98
|
+
import { HeaderHost } from './platform/header-host';
|
|
99
|
+
import { BottomBarHost } from './platform/bottom-bar-host';
|
|
100
|
+
import { ScrollViewHost } from './chrome/scroll-view-host';
|
|
101
|
+
import { SidebarHost } from './chrome/sidebar-host';
|
|
102
|
+
import { RailHost } from './chrome/rail-host';
|
|
103
|
+
import { PageFooterHost } from './chrome/page-footer-host';
|
|
104
|
+
import { CommandHost } from './chrome/command-host';
|
|
105
|
+
import { SettingsHost } from './chrome/settings-host';
|
|
106
|
+
import {
|
|
107
|
+
AutoHideBarHost,
|
|
108
|
+
ResizeHandleHost,
|
|
109
|
+
ScrollAreaHost,
|
|
110
|
+
ScrollSurfaceHost,
|
|
111
|
+
StickySectionHost,
|
|
112
|
+
ToolbarHost,
|
|
113
|
+
} from './chrome/layout-hosts';
|
|
114
|
+
import {
|
|
115
|
+
GEOMETRY_KINDS,
|
|
116
|
+
PLACE_KINDS,
|
|
117
|
+
STACK_KINDS,
|
|
118
|
+
geometryOf,
|
|
119
|
+
type GeometryModifier,
|
|
120
|
+
addToLayers,
|
|
121
|
+
addVariantToLayers,
|
|
122
|
+
applyPlacement,
|
|
123
|
+
flexOnly,
|
|
124
|
+
cachedStyle,
|
|
125
|
+
emptyPlacement,
|
|
126
|
+
foregroundOf,
|
|
127
|
+
ink,
|
|
128
|
+
isAppColor,
|
|
129
|
+
isLayerModifier,
|
|
130
|
+
joinVariants,
|
|
131
|
+
layerStyle,
|
|
132
|
+
role,
|
|
133
|
+
layerVariants,
|
|
134
|
+
layoutOf,
|
|
135
|
+
layoutStyle,
|
|
136
|
+
overlayStyle,
|
|
137
|
+
placeStyle,
|
|
138
|
+
placeVariants,
|
|
139
|
+
rawBaseFont,
|
|
140
|
+
stackStyle,
|
|
141
|
+
textStyle,
|
|
142
|
+
textVariant,
|
|
143
|
+
textVariants,
|
|
144
|
+
type Layer,
|
|
145
|
+
type LayerModifier,
|
|
146
|
+
type PlaceModifier,
|
|
147
|
+
type Placement,
|
|
148
|
+
type Resolved,
|
|
149
|
+
type StyleValue,
|
|
150
|
+
SIDE_RADII,
|
|
151
|
+
type StackModifier,
|
|
152
|
+
type StyleOut,
|
|
153
|
+
type Target,
|
|
154
|
+
type VariantStyles,
|
|
155
|
+
} from './style';
|
|
156
|
+
import { Reporting, ReportedState, StateHost } from './state-host';
|
|
157
|
+
import { CONTROLS } from './controls';
|
|
158
|
+
import type { ControlDraw, ControlRenderer } from './controls/draw';
|
|
159
|
+
import { drawDialog, presentAround } from './controls/overlays';
|
|
160
|
+
import {
|
|
161
|
+
STATES,
|
|
162
|
+
both,
|
|
163
|
+
compareLive,
|
|
164
|
+
termsOf,
|
|
165
|
+
settle,
|
|
166
|
+
varies,
|
|
167
|
+
warnNotVaried,
|
|
168
|
+
type LiveCondition,
|
|
169
|
+
type Planned,
|
|
170
|
+
} from './variants';
|
|
171
|
+
import {
|
|
172
|
+
Conditioned,
|
|
173
|
+
GEOMETRY_KEYS,
|
|
174
|
+
type ListColor,
|
|
175
|
+
Painted,
|
|
176
|
+
composeGeometry,
|
|
177
|
+
type Geometry,
|
|
178
|
+
type GeometryKey,
|
|
179
|
+
type Paint,
|
|
180
|
+
type PaintVariant,
|
|
181
|
+
} from './paint';
|
|
182
|
+
import {
|
|
183
|
+
DURATION,
|
|
184
|
+
HIT_SLOP,
|
|
185
|
+
isFontFamily,
|
|
186
|
+
resolveAvatarSize,
|
|
187
|
+
resolveCorner,
|
|
188
|
+
resolveFont,
|
|
189
|
+
resolveBorderWidth,
|
|
190
|
+
resolveLength,
|
|
191
|
+
resolveSpace,
|
|
192
|
+
type ShapeName,
|
|
193
|
+
type AvatarSizeToken,
|
|
194
|
+
type LengthToken,
|
|
195
|
+
type CornerName,
|
|
196
|
+
type SpaceToken,
|
|
197
|
+
resolveIconSize,
|
|
198
|
+
tokenKey,
|
|
199
|
+
type AppToken,
|
|
200
|
+
type AvatarSizeName,
|
|
201
|
+
type ColorName,
|
|
202
|
+
type ColorToken,
|
|
203
|
+
type ListMarker,
|
|
204
|
+
type IconSizeToken,
|
|
205
|
+
type InkToken,
|
|
206
|
+
type Role,
|
|
207
|
+
type TextStyleName,
|
|
208
|
+
} from './tokens';
|
|
209
|
+
import { deriveEnv, EnvContext, materialEnv, ROOT_ENV, type Env } from './env';
|
|
210
|
+
import { inheritedModifiers } from './environment';
|
|
211
|
+
import type { TextTraits } from './style';
|
|
212
|
+
import { adoptLanguageSheet, languageSheets } from './web-sheet';
|
|
213
|
+
import {
|
|
214
|
+
MotionWrapper,
|
|
215
|
+
Presence,
|
|
216
|
+
animatedHost,
|
|
217
|
+
isMotionValue,
|
|
218
|
+
type MotionValue,
|
|
219
|
+
type Transform,
|
|
220
|
+
} from '@oxy.so/bloom/motion';
|
|
221
|
+
import {
|
|
222
|
+
AnimationContext,
|
|
223
|
+
GestureMotionNode,
|
|
224
|
+
MotionNode,
|
|
225
|
+
PressMotionNode,
|
|
226
|
+
ThemedMotion,
|
|
227
|
+
scopeOf,
|
|
228
|
+
type AnimationScope,
|
|
229
|
+
type MotionPlan,
|
|
230
|
+
type Outer,
|
|
231
|
+
} from './motion/motion-node';
|
|
232
|
+
import { NumericRoll, TextRoll } from './motion/text-roll';
|
|
233
|
+
import { DepthStack } from './depth-stack';
|
|
234
|
+
import { resolveAnchor, resolveDelay, resolveRotation, resolveScale } from './motion/tokens';
|
|
235
|
+
import { PRESS_HOST_STYLE, ServerStyleSheet } from '@oxy.so/bloom/styles';
|
|
236
|
+
|
|
237
|
+
const IS_WEB = Platform.OS === 'web';
|
|
238
|
+
|
|
239
|
+
/** A host or Bloom component, as `draw` takes it. */
|
|
240
|
+
type Host = unknown;
|
|
241
|
+
|
|
242
|
+
/** The language's own pressable hosts. */
|
|
243
|
+
const PRESSABLE_HOSTS: ReadonlySet<Host> = new Set([Pressable]);
|
|
244
|
+
const pressHostOuts = new WeakMap<StyleOut, StyleOut>();
|
|
245
|
+
|
|
246
|
+
/**
|
|
247
|
+
* A pressable host's style on the web, with Bloom's press host class: a
|
|
248
|
+
* state's selector reads it to leave a hover or a press inside a pressable to
|
|
249
|
+
* that pressable, as react-native-web's Pressable does (the spec's
|
|
250
|
+
* `variants.selectors`). Built once per style.
|
|
251
|
+
*/
|
|
252
|
+
function pressHostOut(host: Host, out: StyleOut): StyleOut {
|
|
253
|
+
if (PRESS_HOST_STYLE === undefined || !PRESSABLE_HOSTS.has(host)) return out;
|
|
254
|
+
let marked = pressHostOuts.get(out);
|
|
255
|
+
if (marked === undefined) {
|
|
256
|
+
marked = Object.freeze({
|
|
257
|
+
...out,
|
|
258
|
+
style: out.style === undefined ? PRESS_HOST_STYLE : [out.style, PRESS_HOST_STYLE].flat(),
|
|
259
|
+
});
|
|
260
|
+
pressHostOuts.set(out, marked);
|
|
261
|
+
pressHostOuts.set(marked, marked);
|
|
262
|
+
}
|
|
263
|
+
return marked;
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
/**
|
|
267
|
+
* `createElement` over the host and Bloom components with props assembled from
|
|
268
|
+
* the chain. Their prop contracts are what the render suite asserts.
|
|
269
|
+
*/
|
|
270
|
+
const draw = createElement as (
|
|
271
|
+
type: unknown,
|
|
272
|
+
props?: Record<string, unknown> | null,
|
|
273
|
+
...children: ReactNode[]
|
|
274
|
+
) => ReactElement;
|
|
275
|
+
|
|
276
|
+
const ROLE: Record<Role, string | undefined> = {
|
|
277
|
+
button: 'button',
|
|
278
|
+
link: 'link',
|
|
279
|
+
header: 'header',
|
|
280
|
+
image: 'image',
|
|
281
|
+
text: 'text',
|
|
282
|
+
none: 'none',
|
|
283
|
+
checkbox: 'checkbox',
|
|
284
|
+
radio: 'radio',
|
|
285
|
+
tab: 'tab',
|
|
286
|
+
radiogroup: 'radiogroup',
|
|
287
|
+
tablist: 'tablist',
|
|
288
|
+
list: 'list',
|
|
289
|
+
alert: 'alert',
|
|
290
|
+
progressbar: 'progressbar',
|
|
291
|
+
imagebutton: 'imagebutton',
|
|
292
|
+
summary: 'summary',
|
|
293
|
+
};
|
|
294
|
+
|
|
295
|
+
/** What sets the environment of what is inside: the text traits, and the environment values. */
|
|
296
|
+
const ENV_KINDS: ReadonlySet<string> = new Set([...ENVIRONMENT, 'environment']);
|
|
297
|
+
|
|
298
|
+
/** Marks the props of a box drawn by a `StateHost`: its value says whether the box is pressable. */
|
|
299
|
+
const STATEFUL = '$$stateful';
|
|
300
|
+
|
|
301
|
+
/** A style with nothing to draw: for a host that takes only props. */
|
|
302
|
+
const NO_OUT: StyleOut = Object.freeze({ style: undefined, paint: undefined });
|
|
303
|
+
|
|
304
|
+
/** The nodes the language draws with React Native's own hosts; every other kind is a Bloom component. */
|
|
305
|
+
const DRAWN_BY_HOSTS: ReadonlySet<string> = new Set([
|
|
306
|
+
'stack',
|
|
307
|
+
'zstack',
|
|
308
|
+
'spacer',
|
|
309
|
+
'text',
|
|
310
|
+
'icon',
|
|
311
|
+
'embed',
|
|
312
|
+
'view',
|
|
313
|
+
]);
|
|
314
|
+
|
|
315
|
+
/** One pass over a node's modifiers: what it draws with, sorted by what it affects. */
|
|
316
|
+
interface Plan {
|
|
317
|
+
layers: Layer[];
|
|
318
|
+
/** What places the view in its parent (its outermost box). */
|
|
319
|
+
place: Placement;
|
|
320
|
+
env: Modifier[];
|
|
321
|
+
/** The text traits variants change, for the environment of what is inside. */
|
|
322
|
+
envVariants: [Planned, Modifier][];
|
|
323
|
+
/** What variants change of a stack's own layout. */
|
|
324
|
+
hostVariants: [Planned, StackModifier][];
|
|
325
|
+
/** The states the view's variants answer: its outermost box tracks them (`StateHost`). */
|
|
326
|
+
states: LiveCondition[];
|
|
327
|
+
pressable: boolean;
|
|
328
|
+
onPress: PressHandler | undefined;
|
|
329
|
+
/** A press that goes somewhere (`navigate()`), resolved against the environment's navigator. */
|
|
330
|
+
navigation: Navigation | undefined;
|
|
331
|
+
onLongPress: (() => void) | undefined;
|
|
332
|
+
onHoverIn: (() => void) | undefined;
|
|
333
|
+
onHoverOut: (() => void) | undefined;
|
|
334
|
+
hoverGroup: boolean;
|
|
335
|
+
label: string | undefined;
|
|
336
|
+
hint: string | undefined;
|
|
337
|
+
role: Role | undefined;
|
|
338
|
+
hitSlop: number | undefined;
|
|
339
|
+
testID: string | undefined;
|
|
340
|
+
id: string | number | undefined;
|
|
341
|
+
own: Map<Modifier['kind'], Modifier>;
|
|
342
|
+
/**
|
|
343
|
+
* A Button or FAB on glass: the glass draws its fill, tinted `controlTint`
|
|
344
|
+
* when the glass has no tint. `reports`: the states the glass's variants
|
|
345
|
+
* answer, which the control reports to the box around the glass.
|
|
346
|
+
*/
|
|
347
|
+
control: { tint: ColorName | undefined; reports: readonly LiveCondition[] } | undefined;
|
|
348
|
+
/** Present when the node has a motion modifier: it is then drawn by `MotionNode`. */
|
|
349
|
+
motion: MotionPlan | undefined;
|
|
350
|
+
/** Its glass's identity in a glass group (`.glassID()`, `.glassUnion()`, `.glassTransition()`). */
|
|
351
|
+
glassMember: GlassMember | undefined;
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
/** A number per namespace, so an id is unique to its namespace as a string (a glass's key in its group). */
|
|
355
|
+
const namespaceNumbers = new WeakMap<Namespace, number>();
|
|
356
|
+
let namespaceCount = 0;
|
|
357
|
+
|
|
358
|
+
function namespaced(prefix: string, id: string, namespace: Namespace): string {
|
|
359
|
+
let number = namespaceNumbers.get(namespace);
|
|
360
|
+
if (number === undefined) {
|
|
361
|
+
namespaceCount += 1;
|
|
362
|
+
number = namespaceCount;
|
|
363
|
+
namespaceNumbers.set(namespace, number);
|
|
364
|
+
}
|
|
365
|
+
return `${prefix}:${number}:${id}`;
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
/** A glass's identity in its group, from its chain; `undefined` with none. */
|
|
369
|
+
function glassMemberOf(modifiers: readonly Modifier[]): GlassMember | undefined {
|
|
370
|
+
let member: GlassMember | undefined;
|
|
371
|
+
for (const modifier of modifiers) {
|
|
372
|
+
if (modifier.kind === 'glassID')
|
|
373
|
+
member = { ...member, id: namespaced('bloom-glass', modifier.id, modifier.namespace) };
|
|
374
|
+
else if (modifier.kind === 'glassUnion')
|
|
375
|
+
member = { ...member, union: namespaced('bloom-union', modifier.id, modifier.namespace) };
|
|
376
|
+
else if (modifier.kind === 'glassTransition')
|
|
377
|
+
member = { ...member, transition: modifier.value };
|
|
378
|
+
}
|
|
379
|
+
return member;
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
const MOTION_KINDS: ReadonlySet<string> = new Set([
|
|
383
|
+
'scale',
|
|
384
|
+
'offset',
|
|
385
|
+
'rotation',
|
|
386
|
+
'animation',
|
|
387
|
+
'animatesColors',
|
|
388
|
+
'transition',
|
|
389
|
+
'keyframes',
|
|
390
|
+
'repeatForever',
|
|
391
|
+
'delay',
|
|
392
|
+
'anchor',
|
|
393
|
+
'matchedGeometry',
|
|
394
|
+
'glassID',
|
|
395
|
+
'glassTransition',
|
|
396
|
+
'pressScale',
|
|
397
|
+
'drag',
|
|
398
|
+
'swipe',
|
|
399
|
+
'pinch',
|
|
400
|
+
'onDoubleTap',
|
|
401
|
+
]);
|
|
402
|
+
|
|
403
|
+
/** Resting transforms (and the same by component), interned by key so a moving host's style keeps its identity. */
|
|
404
|
+
const transforms = new Map<string, { geometry: Geometry; transform: Transform }>();
|
|
405
|
+
|
|
406
|
+
function motionPlan(node: Node, layers: readonly Layer[]): MotionPlan {
|
|
407
|
+
const motion: MotionPlan = {
|
|
408
|
+
transform: NO_TRANSFORM,
|
|
409
|
+
transformKey: '',
|
|
410
|
+
geometry: NO_GEOMETRY,
|
|
411
|
+
anchor: undefined,
|
|
412
|
+
animation: undefined,
|
|
413
|
+
colors: false,
|
|
414
|
+
transition: undefined,
|
|
415
|
+
keyframes: undefined,
|
|
416
|
+
loop: undefined,
|
|
417
|
+
delay: 0,
|
|
418
|
+
matched: undefined,
|
|
419
|
+
pressScale: false,
|
|
420
|
+
bound: undefined,
|
|
421
|
+
drag: undefined,
|
|
422
|
+
swipe: undefined,
|
|
423
|
+
pinch: undefined,
|
|
424
|
+
doubleTap: undefined,
|
|
425
|
+
glass: layers.some((layer) => layer.glass !== undefined),
|
|
426
|
+
stable: false,
|
|
427
|
+
};
|
|
428
|
+
const bound: {
|
|
429
|
+
translateX?: MotionValue;
|
|
430
|
+
translateY?: MotionValue;
|
|
431
|
+
rotate?: MotionValue;
|
|
432
|
+
scale?: MotionValue;
|
|
433
|
+
} = {};
|
|
434
|
+
let translateX = 0;
|
|
435
|
+
let translateY = 0;
|
|
436
|
+
let rotate = 0;
|
|
437
|
+
let scale = 1;
|
|
438
|
+
let glassID: { id: string; namespace: Namespace } | undefined;
|
|
439
|
+
let glassTransition: GlassTransition | undefined;
|
|
440
|
+
for (const modifier of node.modifiers) {
|
|
441
|
+
switch (modifier.kind) {
|
|
442
|
+
case 'opacity':
|
|
443
|
+
motion.stable = true;
|
|
444
|
+
break;
|
|
445
|
+
case 'scale':
|
|
446
|
+
motion.stable = true;
|
|
447
|
+
if (isMotionValue(modifier.value)) bound.scale = modifier.value;
|
|
448
|
+
else if (typeof modifier.value === 'string') scale = resolveScale(modifier.value);
|
|
449
|
+
break;
|
|
450
|
+
case 'offset': {
|
|
451
|
+
motion.stable = true;
|
|
452
|
+
const { x, y } = modifier.value;
|
|
453
|
+
if (isMotionValue(x)) bound.translateX = x;
|
|
454
|
+
else if (typeof x === 'string' || isAppToken(x)) translateX = resolveSpace(x);
|
|
455
|
+
if (isMotionValue(y)) bound.translateY = y;
|
|
456
|
+
else if (typeof y === 'string' || isAppToken(y)) translateY = resolveSpace(y);
|
|
457
|
+
break;
|
|
458
|
+
}
|
|
459
|
+
case 'rotation':
|
|
460
|
+
motion.stable = true;
|
|
461
|
+
if (isMotionValue(modifier.value)) bound.rotate = modifier.value;
|
|
462
|
+
else if (typeof modifier.value === 'string') rotate = resolveRotation(modifier.value);
|
|
463
|
+
break;
|
|
464
|
+
case 'drag':
|
|
465
|
+
motion.stable = true;
|
|
466
|
+
motion.drag = { value: modifier.value, options: modifier.options };
|
|
467
|
+
break;
|
|
468
|
+
case 'swipe':
|
|
469
|
+
motion.stable = true;
|
|
470
|
+
motion.swipe = { direction: modifier.direction, onSwipe: modifier.onSwipe };
|
|
471
|
+
break;
|
|
472
|
+
case 'pinch':
|
|
473
|
+
motion.stable = true;
|
|
474
|
+
motion.pinch = { value: modifier.value, options: modifier.options };
|
|
475
|
+
break;
|
|
476
|
+
case 'onDoubleTap':
|
|
477
|
+
motion.doubleTap = modifier.value;
|
|
478
|
+
break;
|
|
479
|
+
case 'animation':
|
|
480
|
+
// What its box draws changes with the motion: the box is animated from the first render.
|
|
481
|
+
if (changesBox(node.modifiers)) motion.stable = true;
|
|
482
|
+
motion.animation = scopeOf(modifier.motion, modifier.value, modifier.gated);
|
|
483
|
+
break;
|
|
484
|
+
case 'animatesColors':
|
|
485
|
+
// Its colours play with the animation in scope: the box is animated from the first render.
|
|
486
|
+
motion.stable = true;
|
|
487
|
+
motion.colors = true;
|
|
488
|
+
break;
|
|
489
|
+
case 'transition':
|
|
490
|
+
motion.stable = true;
|
|
491
|
+
motion.transition = modifier.value;
|
|
492
|
+
break;
|
|
493
|
+
case 'keyframes':
|
|
494
|
+
motion.keyframes = { value: modifier.value, trigger: modifier.trigger };
|
|
495
|
+
break;
|
|
496
|
+
case 'repeatForever':
|
|
497
|
+
motion.loop = modifier.value;
|
|
498
|
+
break;
|
|
499
|
+
case 'delay':
|
|
500
|
+
motion.delay = resolveDelay(modifier.value);
|
|
501
|
+
break;
|
|
502
|
+
case 'anchor':
|
|
503
|
+
motion.anchor = resolveAnchor(modifier.value);
|
|
504
|
+
break;
|
|
505
|
+
case 'matchedGeometry':
|
|
506
|
+
motion.stable = true;
|
|
507
|
+
motion.matched = { id: modifier.id, namespace: modifier.namespace };
|
|
508
|
+
break;
|
|
509
|
+
case 'glassID':
|
|
510
|
+
glassID = { id: modifier.id, namespace: modifier.namespace };
|
|
511
|
+
break;
|
|
512
|
+
case 'glassTransition':
|
|
513
|
+
glassTransition = modifier.value;
|
|
514
|
+
break;
|
|
515
|
+
case 'pressScale':
|
|
516
|
+
motion.stable = true;
|
|
517
|
+
motion.pressScale = true;
|
|
518
|
+
break;
|
|
519
|
+
}
|
|
520
|
+
}
|
|
521
|
+
// A glass's identity is the engine's own motion: `materialize` fades the glass
|
|
522
|
+
// in and out where it is, `matchedGeometry` (the default) grows it out of the
|
|
523
|
+
// glass with its id. A transition or matched geometry the chain names wins.
|
|
524
|
+
if (glassTransition === 'materialize') {
|
|
525
|
+
motion.stable = true;
|
|
526
|
+
motion.transition ??= opacity;
|
|
527
|
+
} else if (glassID !== undefined) {
|
|
528
|
+
motion.stable = true;
|
|
529
|
+
motion.matched ??= glassID;
|
|
530
|
+
}
|
|
531
|
+
if (Object.keys(bound).length > 0 || motion.swipe !== undefined) {
|
|
532
|
+
// Bound geometry: the one mapper writes the whole transform, the tokens as
|
|
533
|
+
// constants beside the values.
|
|
534
|
+
motion.bound = {
|
|
535
|
+
translateX: bound.translateX ? [translateX, bound.translateX] : [translateX],
|
|
536
|
+
translateY: bound.translateY ? [translateY, bound.translateY] : [translateY],
|
|
537
|
+
rotate: bound.rotate ? [rotate, bound.rotate] : [rotate],
|
|
538
|
+
scale: bound.scale ?? scale,
|
|
539
|
+
};
|
|
540
|
+
return motion;
|
|
541
|
+
}
|
|
542
|
+
const key = `${translateX}|${translateY}|${rotate}|${scale}`;
|
|
543
|
+
if (key !== '0|0|0|1') {
|
|
544
|
+
let resting = transforms.get(key);
|
|
545
|
+
if (resting === undefined) {
|
|
546
|
+
const geometry: { -readonly [K in GeometryKey]?: number } = {};
|
|
547
|
+
if (translateX !== 0) geometry.translateX = translateX;
|
|
548
|
+
if (translateY !== 0) geometry.translateY = translateY;
|
|
549
|
+
if (rotate !== 0) geometry.rotate = rotate;
|
|
550
|
+
if (scale !== 1) geometry.scale = scale;
|
|
551
|
+
resting = {
|
|
552
|
+
geometry: Object.freeze(geometry),
|
|
553
|
+
transform: Object.freeze((composeGeometry(geometry) as { transform: Transform }).transform),
|
|
554
|
+
};
|
|
555
|
+
transforms.set(key, resting);
|
|
556
|
+
}
|
|
557
|
+
motion.transform = resting.transform;
|
|
558
|
+
motion.geometry = resting.geometry;
|
|
559
|
+
motion.transformKey = key;
|
|
560
|
+
}
|
|
561
|
+
return motion;
|
|
562
|
+
}
|
|
563
|
+
|
|
564
|
+
const NO_TRANSFORM: Transform = Object.freeze([]);
|
|
565
|
+
const NO_GEOMETRY: Geometry = Object.freeze({});
|
|
566
|
+
|
|
567
|
+
/** What a change of plays on a view's box under `.animation()`: its opacity and geometry (colours only with `.animatesColors()`). */
|
|
568
|
+
const ANIMATED_KINDS: ReadonlySet<string> = new Set(['opacity', 'scale', 'offset', 'rotation']);
|
|
569
|
+
|
|
570
|
+
/** Whether a chain draws something its box animates, at rest or in a variant. */
|
|
571
|
+
function changesBox(modifiers: readonly Modifier[]): boolean {
|
|
572
|
+
return modifiers.some((modifier) =>
|
|
573
|
+
modifier.kind === 'when' ? changesBox(modifier.modifiers) : ANIMATED_KINDS.has(modifier.kind),
|
|
574
|
+
);
|
|
575
|
+
}
|
|
576
|
+
|
|
577
|
+
/** Whether a geometry modifier follows a `MotionValue` (on any axis). */
|
|
578
|
+
function followsValue(modifier: GeometryModifier): boolean {
|
|
579
|
+
if (modifier.kind !== 'offset') return isMotionValue(modifier.value);
|
|
580
|
+
return isMotionValue(modifier.value.x) || isMotionValue(modifier.value.y);
|
|
581
|
+
}
|
|
582
|
+
|
|
583
|
+
function isAppToken(value: unknown): value is AppToken<'space'> {
|
|
584
|
+
return typeof value === 'object' && value !== null && 'scale' in value;
|
|
585
|
+
}
|
|
586
|
+
|
|
587
|
+
/** A FAB is on glass: the platform's, unless its chain names another. */
|
|
588
|
+
const FAB_GLASS: Modifier = { kind: 'glass', key: regular.key, value: regular };
|
|
589
|
+
|
|
590
|
+
/**
|
|
591
|
+
* A Button's glass styles, as the chain they stand for: the button on glass
|
|
592
|
+
* (Bloom's `material="shared"`, the glass drawing its fill), `glass` in the
|
|
593
|
+
* neutral tone's `subtle` ink and `glassProminent` a `solid` one, whose fill
|
|
594
|
+
* tints the glass (the accent by default). The glass comes first, as a FAB's
|
|
595
|
+
* does, and a `.glass()` the chain names is the glass instead; a tint it names
|
|
596
|
+
* comes later and wins.
|
|
597
|
+
*/
|
|
598
|
+
const GLASS_STYLES: Readonly<Record<string, readonly Modifier[]>> = {
|
|
599
|
+
glass: [
|
|
600
|
+
{ kind: 'tint', key: 'tint:neutral', value: 'neutral' },
|
|
601
|
+
{ kind: 'style', key: 'style:subtle', value: 'subtle' },
|
|
602
|
+
],
|
|
603
|
+
glassProminent: [
|
|
604
|
+
{ kind: 'tint', key: 'tint:accent', value: 'accent' },
|
|
605
|
+
{ kind: 'style', key: 'style:solid', value: 'solid' },
|
|
606
|
+
],
|
|
607
|
+
};
|
|
608
|
+
|
|
609
|
+
/** A button's chain with a glass style written out (see `GLASS_STYLES`). */
|
|
610
|
+
function glassStyled(modifiers: readonly Modifier[], onGlass: boolean): readonly Modifier[] {
|
|
611
|
+
let style: string | undefined;
|
|
612
|
+
for (const modifier of modifiers) if (modifier.kind === 'style') style = modifier.value;
|
|
613
|
+
const styled = style === undefined ? undefined : GLASS_STYLES[style];
|
|
614
|
+
if (styled === undefined) return modifiers;
|
|
615
|
+
const [tint, appearance] = styled as [Modifier, Modifier];
|
|
616
|
+
const out: Modifier[] = onGlass ? [tint] : [FAB_GLASS, tint];
|
|
617
|
+
for (const modifier of modifiers)
|
|
618
|
+
out.push(modifier.kind === 'style' && GLASS_STYLES[modifier.value] ? appearance : modifier);
|
|
619
|
+
return out;
|
|
620
|
+
}
|
|
621
|
+
|
|
622
|
+
const DISABLED_TAKERS: ReadonlySet<string> = new Set(ENVIRONMENT_TAKERS.disabled.kinds);
|
|
623
|
+
|
|
624
|
+
/**
|
|
625
|
+
* Whether a view's `.disabled()` reaches everything inside it: a stack's and
|
|
626
|
+
* any view's that takes no `disabled` of its own do. A Bloom component that
|
|
627
|
+
* takes one keeps it, so Bloom decides what its content does, as it does for
|
|
628
|
+
* an app's JSX (a disabled `ChipRow` and its chips).
|
|
629
|
+
*/
|
|
630
|
+
function handsDownDisabled(kind: NodeKind): boolean {
|
|
631
|
+
return kind === 'stack' || !DISABLED_TAKERS.has(kind);
|
|
632
|
+
}
|
|
633
|
+
|
|
634
|
+
function plan(node: Node, env: Env): Plan {
|
|
635
|
+
const result: Plan = {
|
|
636
|
+
layers: [],
|
|
637
|
+
place: emptyPlacement(),
|
|
638
|
+
env: [],
|
|
639
|
+
envVariants: [],
|
|
640
|
+
hostVariants: [],
|
|
641
|
+
states: [],
|
|
642
|
+
pressable: false,
|
|
643
|
+
onPress: undefined,
|
|
644
|
+
navigation: undefined,
|
|
645
|
+
onLongPress: undefined,
|
|
646
|
+
onHoverIn: undefined,
|
|
647
|
+
onHoverOut: undefined,
|
|
648
|
+
hoverGroup: false,
|
|
649
|
+
label: undefined,
|
|
650
|
+
hint: undefined,
|
|
651
|
+
role: undefined,
|
|
652
|
+
hitSlop: undefined,
|
|
653
|
+
testID: undefined,
|
|
654
|
+
id: undefined,
|
|
655
|
+
own: new Map(),
|
|
656
|
+
control: undefined,
|
|
657
|
+
motion: undefined,
|
|
658
|
+
glassMember: undefined,
|
|
659
|
+
};
|
|
660
|
+
const onGlass = node.modifiers.some((modifier) => modifier.kind === 'glass');
|
|
661
|
+
// What the environment sets on this kind of node comes first: its own chain wins.
|
|
662
|
+
const inherited = inheritedModifiers(node.kind, env);
|
|
663
|
+
const chained = inherited.length > 0 ? [...inherited, ...node.modifiers] : node.modifiers;
|
|
664
|
+
const modifiers =
|
|
665
|
+
node.kind === 'fab' && !onGlass
|
|
666
|
+
? [FAB_GLASS, ...chained]
|
|
667
|
+
: node.kind === 'button'
|
|
668
|
+
? glassStyled(chained, onGlass)
|
|
669
|
+
: chained;
|
|
670
|
+
// A `disabled` variant answers the view's own `disabled()`, wherever it is chained.
|
|
671
|
+
let disabled = false;
|
|
672
|
+
for (const modifier of modifiers) if (modifier.kind === 'disabled') disabled = modifier.value;
|
|
673
|
+
let moving = false;
|
|
674
|
+
for (const modifier of modifiers) {
|
|
675
|
+
if (MOTION_KINDS.has(modifier.kind)) {
|
|
676
|
+
moving = true;
|
|
677
|
+
continue;
|
|
678
|
+
}
|
|
679
|
+
// `identity` draws no glass: the chain keeps its shape without a material.
|
|
680
|
+
if (modifier.kind === 'glass' && !modifier.value.drawn) continue;
|
|
681
|
+
// A button group's glass is its own material (Bloom's `material="lens"`), not a layer around it.
|
|
682
|
+
if (node.kind === 'buttonGroup' && modifier.kind === 'glass') {
|
|
683
|
+
result.own.set('glass', modifier);
|
|
684
|
+
continue;
|
|
685
|
+
}
|
|
686
|
+
// A card's corner curve is its own (Bloom's `cornerCurve`, beside its `radius`), not its box's.
|
|
687
|
+
if (node.kind === 'card' && modifier.kind === 'cornerCurve') {
|
|
688
|
+
result.own.set('cornerCurve', modifier);
|
|
689
|
+
continue;
|
|
690
|
+
}
|
|
691
|
+
// A card's clip is its own (Bloom's `clipContent`), not a box around it.
|
|
692
|
+
if (node.kind === 'card' && modifier.kind === 'clipped') {
|
|
693
|
+
result.own.set('clipped', modifier);
|
|
694
|
+
continue;
|
|
695
|
+
}
|
|
696
|
+
if (isLayerModifier(modifier)) {
|
|
697
|
+
addToLayers(result.layers, modifier);
|
|
698
|
+
continue;
|
|
699
|
+
}
|
|
700
|
+
if (modifier.kind === 'when') {
|
|
701
|
+
const condition = settle(modifier.condition, disabled);
|
|
702
|
+
if (condition !== false) planVariant(result, condition, modifier.modifiers, disabled);
|
|
703
|
+
continue;
|
|
704
|
+
}
|
|
705
|
+
if (ENV_KINDS.has(modifier.kind)) {
|
|
706
|
+
result.env.push(modifier);
|
|
707
|
+
continue;
|
|
708
|
+
}
|
|
709
|
+
// `disabled` is the view's own, and the environment of everything inside it,
|
|
710
|
+
// except inside a Bloom component that takes it itself (see `handsDownDisabled`).
|
|
711
|
+
if (modifier.kind === 'disabled' && handsDownDisabled(node.kind)) result.env.push(modifier);
|
|
712
|
+
switch (modifier.kind) {
|
|
713
|
+
case 'grow':
|
|
714
|
+
case 'shrink':
|
|
715
|
+
case 'alignSelf':
|
|
716
|
+
case 'position':
|
|
717
|
+
case 'zIndex':
|
|
718
|
+
case 'hidden':
|
|
719
|
+
case 'basis':
|
|
720
|
+
case 'flex':
|
|
721
|
+
case 'margin':
|
|
722
|
+
case 'allowsHitTesting':
|
|
723
|
+
case 'accessibilityOnly':
|
|
724
|
+
applyPlacement(result.place, modifier);
|
|
725
|
+
break;
|
|
726
|
+
case 'onPress':
|
|
727
|
+
result.pressable = true;
|
|
728
|
+
if (modifier.value instanceof Navigation) result.navigation = modifier.value;
|
|
729
|
+
else {
|
|
730
|
+
result.navigation = undefined;
|
|
731
|
+
result.onPress = modifier.value;
|
|
732
|
+
}
|
|
733
|
+
break;
|
|
734
|
+
case 'onLongPress':
|
|
735
|
+
result.pressable = true;
|
|
736
|
+
result.onLongPress = modifier.value;
|
|
737
|
+
break;
|
|
738
|
+
case 'hoverGroup':
|
|
739
|
+
result.hoverGroup = true;
|
|
740
|
+
break;
|
|
741
|
+
case 'onHover':
|
|
742
|
+
result.pressable = true;
|
|
743
|
+
result.onHoverIn = modifier.enter;
|
|
744
|
+
result.onHoverOut = modifier.leave;
|
|
745
|
+
break;
|
|
746
|
+
case 'label':
|
|
747
|
+
result.label = modifier.value;
|
|
748
|
+
break;
|
|
749
|
+
case 'hint':
|
|
750
|
+
result.hint = modifier.value;
|
|
751
|
+
break;
|
|
752
|
+
case 'role':
|
|
753
|
+
result.role = modifier.value;
|
|
754
|
+
break;
|
|
755
|
+
case 'hitSlop':
|
|
756
|
+
result.hitSlop = HIT_SLOP[modifier.value];
|
|
757
|
+
break;
|
|
758
|
+
case 'testID':
|
|
759
|
+
result.testID = modifier.value;
|
|
760
|
+
break;
|
|
761
|
+
case 'id':
|
|
762
|
+
result.id = modifier.value;
|
|
763
|
+
break;
|
|
764
|
+
default:
|
|
765
|
+
result.own.set(modifier.kind, modifier);
|
|
766
|
+
}
|
|
767
|
+
}
|
|
768
|
+
// A wash that answers the pointer needs the hover group it lights up in.
|
|
769
|
+
if (result.own.has('hoverHighlight') && ownValue(result, 'hoverHighlight')?.value === undefined)
|
|
770
|
+
result.hoverGroup = true;
|
|
771
|
+
if ((node.kind === 'button' || node.kind === 'fab') && result.layers.some((l) => l.glass)) {
|
|
772
|
+
result.control = {
|
|
773
|
+
tint: controlTint(node.kind, result),
|
|
774
|
+
reports: glassStates(result.layers),
|
|
775
|
+
};
|
|
776
|
+
}
|
|
777
|
+
if (result.layers.some((layer) => layer.glass !== undefined))
|
|
778
|
+
result.glassMember = glassMemberOf(modifiers);
|
|
779
|
+
// A view whose geometry varies is moving: its box draws the geometry (see `renderNode`).
|
|
780
|
+
if (moving || result.place.variants.some(([, modifier]) => GEOMETRY_KINDS.has(modifier.kind)))
|
|
781
|
+
result.motion = motionPlan(node, result.layers);
|
|
782
|
+
return result;
|
|
783
|
+
}
|
|
784
|
+
|
|
785
|
+
/**
|
|
786
|
+
* A variant's modifiers, each where it overrides what the chain set before
|
|
787
|
+
* it: a box modifier in the view that set the same thing last, a text trait
|
|
788
|
+
* in the environment, a stack's layout on its host, a placement on its
|
|
789
|
+
* outermost box.
|
|
790
|
+
*/
|
|
791
|
+
function planVariant(
|
|
792
|
+
result: Plan,
|
|
793
|
+
condition: Planned,
|
|
794
|
+
modifiers: readonly Modifier[],
|
|
795
|
+
disabled: boolean,
|
|
796
|
+
): void {
|
|
797
|
+
for (const term of condition === null ? [] : termsOf(condition)) {
|
|
798
|
+
if (STATES.has(term) && !result.states.includes(term)) result.states.push(term);
|
|
799
|
+
}
|
|
800
|
+
for (const modifier of modifiers) {
|
|
801
|
+
if (modifier.kind === 'when') {
|
|
802
|
+
// A variant inside a variant holds while both conditions do.
|
|
803
|
+
const inner = settle(modifier.condition, disabled);
|
|
804
|
+
if (inner !== false)
|
|
805
|
+
planVariant(result, both(condition, inner), modifier.modifiers, disabled);
|
|
806
|
+
continue;
|
|
807
|
+
}
|
|
808
|
+
if (!varies(modifier)) {
|
|
809
|
+
// A condition that holds as the view renders (web, native, a platform,
|
|
810
|
+
// disabled) is the chain's own: what no live variant changes applies as
|
|
811
|
+
// if chained there (`when('web', (v) => v.noWrap())`).
|
|
812
|
+
if (condition === null && heldAsOwn(result, modifier)) continue;
|
|
813
|
+
warnNotVaried(modifier);
|
|
814
|
+
continue;
|
|
815
|
+
}
|
|
816
|
+
if (GEOMETRY_KINDS.has(modifier.kind) && followsValue(modifier as GeometryModifier)) {
|
|
817
|
+
warnOnce(
|
|
818
|
+
'value-variant',
|
|
819
|
+
'[Bloom language] a variant varies geometry by token: a MotionValue inside when() is left out.',
|
|
820
|
+
);
|
|
821
|
+
continue;
|
|
822
|
+
}
|
|
823
|
+
const mark = `;?${condition ?? ''}${modifier.key}`;
|
|
824
|
+
if (isLayerModifier(modifier)) addVariantToLayers(result.layers, condition, modifier);
|
|
825
|
+
else if (ENV_KINDS.has(modifier.kind)) result.envVariants.push([condition, modifier]);
|
|
826
|
+
else if (PLACE_KINDS.has(modifier.kind)) {
|
|
827
|
+
result.place.variants.push([condition, modifier as PlaceModifier]);
|
|
828
|
+
result.place.key += mark;
|
|
829
|
+
} else if (STACK_KINDS.has(modifier.kind)) {
|
|
830
|
+
result.hostVariants.push([condition, modifier as StackModifier]);
|
|
831
|
+
}
|
|
832
|
+
}
|
|
833
|
+
}
|
|
834
|
+
|
|
835
|
+
/** Kinds the plan reads into fields of its own (presses, names): a held variant does not set them. */
|
|
836
|
+
const PLANNED_KINDS: ReadonlySet<string> = new Set([
|
|
837
|
+
'onPress',
|
|
838
|
+
'onLongPress',
|
|
839
|
+
'hoverGroup',
|
|
840
|
+
'onHover',
|
|
841
|
+
'label',
|
|
842
|
+
'hint',
|
|
843
|
+
'role',
|
|
844
|
+
'hitSlop',
|
|
845
|
+
'testID',
|
|
846
|
+
'id',
|
|
847
|
+
]);
|
|
848
|
+
|
|
849
|
+
/**
|
|
850
|
+
* A modifier no live variant can change, under a condition that holds: a text
|
|
851
|
+
* trait joins the environment, a stack's layout its own, any other the
|
|
852
|
+
* chain's own modifiers. A box layer or a placement is left out (it stacks).
|
|
853
|
+
*/
|
|
854
|
+
function heldAsOwn(result: Plan, modifier: Modifier): boolean {
|
|
855
|
+
if (isLayerModifier(modifier) || PLACE_KINDS.has(modifier.kind)) return false;
|
|
856
|
+
if (PLANNED_KINDS.has(modifier.kind) || MOTION_KINDS.has(modifier.kind)) return false;
|
|
857
|
+
if (ENV_KINDS.has(modifier.kind)) result.env.push(modifier);
|
|
858
|
+
else if (STACK_KINDS.has(modifier.kind))
|
|
859
|
+
result.hostVariants.push([null, modifier as StackModifier]);
|
|
860
|
+
else result.own.set(modifier.kind, modifier);
|
|
861
|
+
return true;
|
|
862
|
+
}
|
|
863
|
+
|
|
864
|
+
/** The style key of a stack's own variants, '' with none. */
|
|
865
|
+
function hostVariantKey(p: Plan): string {
|
|
866
|
+
return p.hostVariants
|
|
867
|
+
.map(([condition, modifier]) => `?${condition ?? ''}${modifier.key}`)
|
|
868
|
+
.join(';');
|
|
869
|
+
}
|
|
870
|
+
|
|
871
|
+
/** A stack's layout variants: the ones that hold go into its layout, the live ones are styles under their condition. */
|
|
872
|
+
function hostVariants(p: Plan): VariantStyles {
|
|
873
|
+
return joinVariants(
|
|
874
|
+
p.hostVariants
|
|
875
|
+
.filter(([condition]) => condition !== null)
|
|
876
|
+
.map(([condition, modifier]) => [
|
|
877
|
+
condition as LiveCondition,
|
|
878
|
+
layoutStyle(layoutOf([modifier])),
|
|
879
|
+
]),
|
|
880
|
+
);
|
|
881
|
+
}
|
|
882
|
+
|
|
883
|
+
/** A press modifier's value as a handler in an environment, for a host that wires presses itself. */
|
|
884
|
+
function pressOf(value: Press | undefined, env: Env): (() => void) | undefined {
|
|
885
|
+
if (value === undefined) return undefined;
|
|
886
|
+
if (value instanceof Navigation) return navigationPress(env, value);
|
|
887
|
+
// A system bar item has no gesture of its own to hand the handler.
|
|
888
|
+
return () => value(undefined as unknown as GestureResponderEvent);
|
|
889
|
+
}
|
|
890
|
+
|
|
891
|
+
/** A `navigate()` press: through the navigator the view is drawn under. */
|
|
892
|
+
function navigationPress(env: Env, to: Navigation): () => void {
|
|
893
|
+
return () => {
|
|
894
|
+
if (env.navigate) env.navigate(to.href, to.params);
|
|
895
|
+
else if (process.env.NODE_ENV !== 'production') {
|
|
896
|
+
console.warn(
|
|
897
|
+
`[Bloom language] navigate('${to.href}') was pressed outside a router layout() or screen(): it goes nowhere.`,
|
|
898
|
+
);
|
|
899
|
+
}
|
|
900
|
+
};
|
|
901
|
+
}
|
|
902
|
+
|
|
903
|
+
/** The colour role a solid control fills with: what an untinted glass under it is tinted with. */
|
|
904
|
+
function controlTint(kind: 'button' | 'fab', p: Plan): ColorName | undefined {
|
|
905
|
+
const appearance = (p.own.get('style') as { value?: string } | undefined)?.value ?? 'solid';
|
|
906
|
+
if (appearance !== 'solid') return undefined;
|
|
907
|
+
const tone = (p.own.get('tint') as { value?: string } | undefined)?.value;
|
|
908
|
+
const role =
|
|
909
|
+
TONE_ROLE[(tone ?? (kind === 'fab' ? 'action' : 'accent')) as keyof typeof TONE_ROLE];
|
|
910
|
+
return role ?? undefined;
|
|
911
|
+
}
|
|
912
|
+
|
|
913
|
+
function ownValue<K extends Modifier['kind']>(
|
|
914
|
+
p: Plan,
|
|
915
|
+
kind: K,
|
|
916
|
+
): Extract<Modifier, { kind: K }> | undefined {
|
|
917
|
+
return p.own.get(kind) as Extract<Modifier, { kind: K }> | undefined;
|
|
918
|
+
}
|
|
919
|
+
|
|
920
|
+
/**
|
|
921
|
+
* The accessibility and press props of a view, for whichever host ends up
|
|
922
|
+
* outermost; `undefined` when it has none, so a bare node never gets a host
|
|
923
|
+
* of its own.
|
|
924
|
+
*/
|
|
925
|
+
function behaviourProps(p: Plan): Record<string, unknown> | undefined {
|
|
926
|
+
const props: Record<string, unknown> = {};
|
|
927
|
+
if (p.label !== undefined) props.accessibilityLabel = p.label;
|
|
928
|
+
if (p.hint !== undefined) props.accessibilityHint = p.hint;
|
|
929
|
+
if (p.role !== undefined) props.accessibilityRole = ROLE[p.role];
|
|
930
|
+
// Press feedback is Bloom's PressableScale, which a button is.
|
|
931
|
+
else if (p.pressable && p.motion?.pressScale) props.accessibilityRole = 'button';
|
|
932
|
+
if (p.testID !== undefined) props.testID = p.testID;
|
|
933
|
+
if (p.hitSlop !== undefined) props.hitSlop = p.hitSlop;
|
|
934
|
+
if (p.pressable) {
|
|
935
|
+
// A view whose press handler is absent stays the same host, out of the tab order
|
|
936
|
+
// (a pressable is focusable by default).
|
|
937
|
+
if (p.onPress === undefined && p.onLongPress === undefined) props.focusable = false;
|
|
938
|
+
if (p.onPress) props.onPress = p.onPress;
|
|
939
|
+
if (p.onLongPress) props.onLongPress = p.onLongPress;
|
|
940
|
+
}
|
|
941
|
+
if (p.onHoverIn) props.onHoverIn = p.onHoverIn;
|
|
942
|
+
if (p.onHoverOut) props.onHoverOut = p.onHoverOut;
|
|
943
|
+
// A hover group's marker, so a descendant `SubtleHover` answers the pointer over it.
|
|
944
|
+
if (IS_WEB && p.hoverGroup) Object.assign(props, hoverGroupProps);
|
|
945
|
+
if (p.pressable && p.own.get('disabled')?.kind === 'disabled') {
|
|
946
|
+
const disabled = ownValue(p, 'disabled')?.value;
|
|
947
|
+
if (disabled) props.disabled = true;
|
|
948
|
+
}
|
|
949
|
+
// A box whose variants answer its state is drawn by a `StateHost` (drawHost).
|
|
950
|
+
if (p.states.length > 0) props[STATEFUL] = p.pressable ? p.states : [];
|
|
951
|
+
for (const _ in props) return props;
|
|
952
|
+
return undefined;
|
|
953
|
+
}
|
|
954
|
+
|
|
955
|
+
/** The style key of a node's placement in its parent, '' when it has none. */
|
|
956
|
+
function flexKey(p: Plan): string {
|
|
957
|
+
return p.place.key;
|
|
958
|
+
}
|
|
959
|
+
|
|
960
|
+
/**
|
|
961
|
+
* Where a node renders: its environment, and the environment `EnvContext`
|
|
962
|
+
* holds at this point of the React tree (they differ below an environment
|
|
963
|
+
* modifier, until a `view()` needs it provided).
|
|
964
|
+
*/
|
|
965
|
+
interface Context {
|
|
966
|
+
env: Env;
|
|
967
|
+
provided: Env;
|
|
968
|
+
/** Inside a text: a `Text` here is an inline span of it. */
|
|
969
|
+
inText?: boolean;
|
|
970
|
+
/** A child of an `HStack`: a `Divider` here runs top to bottom. */
|
|
971
|
+
inRow?: boolean;
|
|
972
|
+
/** The `.animation()` in scope, from this view or above it, across `view()` bodies. */
|
|
973
|
+
animation: AnimationScope | undefined;
|
|
974
|
+
/** The scope `AnimationContext` holds at this point of the React tree. */
|
|
975
|
+
scoped: AnimationScope | undefined;
|
|
976
|
+
}
|
|
977
|
+
|
|
978
|
+
/**
|
|
979
|
+
* Draws `host` with a resolved style: directly when the style is final, or
|
|
980
|
+
* through a `Painted` leaf when the style names theme colours (native).
|
|
981
|
+
*/
|
|
982
|
+
function drawHost(
|
|
983
|
+
host: Host,
|
|
984
|
+
style: StyleOut,
|
|
985
|
+
props: Record<string, unknown>,
|
|
986
|
+
...children: ReactNode[]
|
|
987
|
+
): ReactElement {
|
|
988
|
+
const out = pressHostOut(host, style);
|
|
989
|
+
if (STATEFUL in props) {
|
|
990
|
+
const { [STATEFUL]: states, ...rest } = props;
|
|
991
|
+
return draw(StateHost, { ...rest, host, out, states }, ...children);
|
|
992
|
+
}
|
|
993
|
+
// A moving box's motion style (`Outer`) comes after its own (a painted leaf
|
|
994
|
+
// merges both after what it paints).
|
|
995
|
+
if (out.style !== undefined)
|
|
996
|
+
props.style = props.style === undefined ? out.style : [out.style, ...(props.style as [])];
|
|
997
|
+
if (out.paint?.variants !== undefined)
|
|
998
|
+
return draw(Conditioned, { ...props, host, paint: out.paint }, ...children);
|
|
999
|
+
if (out.paint !== undefined)
|
|
1000
|
+
return draw(Painted, { ...props, host, paint: out.paint }, ...children);
|
|
1001
|
+
return draw(host, props, ...children);
|
|
1002
|
+
}
|
|
1003
|
+
|
|
1004
|
+
/**
|
|
1005
|
+
* The outermost box of a moving node (see `Outer`): drawn with `outer` on it,
|
|
1006
|
+
* as its host's animated twin on native. A Bloom component cannot take it, so
|
|
1007
|
+
* `drawNode` boxes one instead (`Outermost.used` stays false).
|
|
1008
|
+
*/
|
|
1009
|
+
interface Outermost {
|
|
1010
|
+
readonly outer: Outer;
|
|
1011
|
+
used: boolean;
|
|
1012
|
+
}
|
|
1013
|
+
|
|
1014
|
+
function drawOutermost(
|
|
1015
|
+
box: Outermost | undefined,
|
|
1016
|
+
host: Host,
|
|
1017
|
+
style: StyleOut,
|
|
1018
|
+
props: Record<string, unknown>,
|
|
1019
|
+
...children: ReactNode[]
|
|
1020
|
+
): ReactElement {
|
|
1021
|
+
const out = pressHostOut(host, style);
|
|
1022
|
+
const animated = animatedHost(host) as Host | undefined;
|
|
1023
|
+
// A host with no animated twin (a Bloom component) moves in the box `drawNode` adds.
|
|
1024
|
+
if (box === undefined || animated === undefined) return drawHost(host, out, props, ...children);
|
|
1025
|
+
box.used = true;
|
|
1026
|
+
const { outer } = box;
|
|
1027
|
+
if (!outer.active) return drawHost(host, out, { ...props, ...outer.props }, ...children);
|
|
1028
|
+
// The animated twin takes the motion's style after its own, through the
|
|
1029
|
+
// leaf that paints it and the `StateHost` whose state its variants answer,
|
|
1030
|
+
// so a variant's change (a press's scale, a hover's fill) plays on it.
|
|
1031
|
+
return drawHost(animated, out, { ...props, ...outer.props, style: outer.style }, ...children);
|
|
1032
|
+
}
|
|
1033
|
+
|
|
1034
|
+
/** `element` in a box of its own that carries `outer` (`style` first): how what cannot take it moves. */
|
|
1035
|
+
function moveIn(outer: Outer, element: ReactNode, style?: Resolved): ReactElement {
|
|
1036
|
+
return draw(
|
|
1037
|
+
(animatedHost(View) ?? MotionWrapper) as Host,
|
|
1038
|
+
{
|
|
1039
|
+
...outer.props,
|
|
1040
|
+
key: outer.playId,
|
|
1041
|
+
style: style === undefined ? outer.style : [style, ...outer.style],
|
|
1042
|
+
},
|
|
1043
|
+
element,
|
|
1044
|
+
);
|
|
1045
|
+
}
|
|
1046
|
+
|
|
1047
|
+
// ── Hosts ────────────────────────────────────────────────────────
|
|
1048
|
+
|
|
1049
|
+
/**
|
|
1050
|
+
* Draws one node, or hands back what it drew last time in the same place
|
|
1051
|
+
* (see `Rendered` in node.ts): a node that keeps its identity across renders
|
|
1052
|
+
* gives React the same element, and React skips the subtree.
|
|
1053
|
+
*/
|
|
1054
|
+
function renderNode(node: Node, ctx: Context, key: string | number | undefined): ReactNode {
|
|
1055
|
+
const last = node.rendered;
|
|
1056
|
+
if (
|
|
1057
|
+
last !== undefined &&
|
|
1058
|
+
last.env === ctx.env &&
|
|
1059
|
+
last.provided === ctx.provided &&
|
|
1060
|
+
last.animation === ctx.animation &&
|
|
1061
|
+
last.scoped === ctx.scoped &&
|
|
1062
|
+
last.key === key &&
|
|
1063
|
+
last.inText === ctx.inText &&
|
|
1064
|
+
last.inRow === ctx.inRow
|
|
1065
|
+
) {
|
|
1066
|
+
return last.element;
|
|
1067
|
+
}
|
|
1068
|
+
const p = plan(node, ctx.env);
|
|
1069
|
+
if (p.motion !== undefined) placeGeometry(p, p.motion, ctx.animation === undefined);
|
|
1070
|
+
const element =
|
|
1071
|
+
p.motion === undefined ? drawNode(node, p, ctx, key, undefined) : drawMoving(node, p, ctx, key);
|
|
1072
|
+
node.rendered = {
|
|
1073
|
+
env: ctx.env,
|
|
1074
|
+
provided: ctx.provided,
|
|
1075
|
+
animation: ctx.animation,
|
|
1076
|
+
scoped: ctx.scoped,
|
|
1077
|
+
key,
|
|
1078
|
+
inText: ctx.inText,
|
|
1079
|
+
inRow: ctx.inRow,
|
|
1080
|
+
element,
|
|
1081
|
+
};
|
|
1082
|
+
return element;
|
|
1083
|
+
}
|
|
1084
|
+
|
|
1085
|
+
/**
|
|
1086
|
+
* Where a node's token geometry is drawn: by its outermost box, as part of
|
|
1087
|
+
* its placement, when its geometry rests with nothing to play it and no
|
|
1088
|
+
* `.animation()` above (as a view moved by hand is drawn: the node then takes
|
|
1089
|
+
* no motion at all), or when a variant changes it, so the variant overrides
|
|
1090
|
+
* only the components it sets (each component is a style value, and on the
|
|
1091
|
+
* web a custom property: style.ts, `webStyle`); the motion layer then plays
|
|
1092
|
+
* only its changes. Otherwise the motion layer draws it (`MotionNode`).
|
|
1093
|
+
*
|
|
1094
|
+
* A transform the one mapper writes (a `MotionValue`, a gesture, native press
|
|
1095
|
+
* feedback) takes no variant: its variants are left out.
|
|
1096
|
+
*/
|
|
1097
|
+
function placeGeometry(p: Plan, motion: MotionPlan, unscoped: boolean): void {
|
|
1098
|
+
const varied = new Set<GeometryKey>();
|
|
1099
|
+
for (const [, modifier] of p.place.variants) {
|
|
1100
|
+
if (GEOMETRY_KINDS.has(modifier.kind))
|
|
1101
|
+
for (const key of Object.keys(geometryOf(modifier as GeometryModifier)))
|
|
1102
|
+
varied.add(key as GeometryKey);
|
|
1103
|
+
}
|
|
1104
|
+
const mapped = motion.bound !== undefined || motion.drag !== undefined || motion.pressScale;
|
|
1105
|
+
if (varied.size > 0 && mapped) {
|
|
1106
|
+
warnOnce(
|
|
1107
|
+
'mapped-variant',
|
|
1108
|
+
'[Bloom language] geometry a MotionValue, a gesture or press feedback moves does not vary: its variants are left out.',
|
|
1109
|
+
);
|
|
1110
|
+
p.place.variants = p.place.variants.filter(
|
|
1111
|
+
([, modifier]) => !GEOMETRY_KINDS.has(modifier.kind),
|
|
1112
|
+
);
|
|
1113
|
+
return;
|
|
1114
|
+
}
|
|
1115
|
+
const still = unscoped && restsStill(motion);
|
|
1116
|
+
if (!still && varied.size === 0) return;
|
|
1117
|
+
// A component a variant sets rests at its identity when the chain sets none.
|
|
1118
|
+
const geometry: { -readonly [K in GeometryKey]?: number } = {};
|
|
1119
|
+
for (const key of GEOMETRY_KEYS) if (varied.has(key)) geometry[key] = key === 'scale' ? 1 : 0;
|
|
1120
|
+
Object.assign(geometry, motion.geometry);
|
|
1121
|
+
p.place.geometry = geometry;
|
|
1122
|
+
p.place.anchor = motion.anchor;
|
|
1123
|
+
p.place.key += `;t:${motion.transformKey}|${[...varied].join(',')}|${motion.anchor ?? ''}`;
|
|
1124
|
+
// A varied geometry changes on the box, which is then animated from the first render.
|
|
1125
|
+
p.motion = still
|
|
1126
|
+
? undefined
|
|
1127
|
+
: {
|
|
1128
|
+
...motion,
|
|
1129
|
+
transform: NO_TRANSFORM,
|
|
1130
|
+
geometry: NO_GEOMETRY,
|
|
1131
|
+
anchor: undefined,
|
|
1132
|
+
stable: true,
|
|
1133
|
+
};
|
|
1134
|
+
}
|
|
1135
|
+
|
|
1136
|
+
/** A node whose motion is its resting geometry alone: tokens, no value, nothing that plays. */
|
|
1137
|
+
function restsStill(motion: MotionPlan): boolean {
|
|
1138
|
+
return (
|
|
1139
|
+
motion.animation === undefined &&
|
|
1140
|
+
motion.transition === undefined &&
|
|
1141
|
+
motion.keyframes === undefined &&
|
|
1142
|
+
motion.loop === undefined &&
|
|
1143
|
+
motion.matched === undefined &&
|
|
1144
|
+
!motion.pressScale &&
|
|
1145
|
+
motion.bound === undefined &&
|
|
1146
|
+
motion.drag === undefined &&
|
|
1147
|
+
motion.swipe === undefined &&
|
|
1148
|
+
motion.pinch === undefined &&
|
|
1149
|
+
motion.doubleTap === undefined
|
|
1150
|
+
);
|
|
1151
|
+
}
|
|
1152
|
+
|
|
1153
|
+
/** A node with motion modifiers: `MotionNode` holds its motion state and draws it with `Outer`. */
|
|
1154
|
+
function drawMoving(
|
|
1155
|
+
node: Node,
|
|
1156
|
+
p: Plan,
|
|
1157
|
+
ctx: Context,
|
|
1158
|
+
key: string | number | undefined,
|
|
1159
|
+
): ReactElement {
|
|
1160
|
+
const motion = p.motion as MotionPlan;
|
|
1161
|
+
const component =
|
|
1162
|
+
motion.bound !== undefined ||
|
|
1163
|
+
motion.drag !== undefined ||
|
|
1164
|
+
motion.pinch !== undefined ||
|
|
1165
|
+
motion.doubleTap !== undefined
|
|
1166
|
+
? GestureMotionNode
|
|
1167
|
+
: motion.pressScale
|
|
1168
|
+
? PressMotionNode
|
|
1169
|
+
: MotionNode;
|
|
1170
|
+
// Native: a node that animates its colours reads the palette (`ThemedMotion`).
|
|
1171
|
+
const themed = motion.colors && !IS_WEB;
|
|
1172
|
+
return draw(themed ? ThemedMotion : component, {
|
|
1173
|
+
...(themed ? { node: component } : null),
|
|
1174
|
+
key: p.id ?? key,
|
|
1175
|
+
motion,
|
|
1176
|
+
exit: p.id !== undefined && motion.transition !== undefined,
|
|
1177
|
+
scope: ctx.animation,
|
|
1178
|
+
content: (outer: Outer) => drawNode(node, p, ctx, undefined, outer),
|
|
1179
|
+
});
|
|
1180
|
+
}
|
|
1181
|
+
|
|
1182
|
+
/**
|
|
1183
|
+
* Draws one node: its host element with the innermost layer merged into the
|
|
1184
|
+
* host's own style, then each further layer as a view around it. The press,
|
|
1185
|
+
* hover and accessibility props go on the outermost box; `grow`/`shrink` too.
|
|
1186
|
+
*/
|
|
1187
|
+
function drawNode(
|
|
1188
|
+
node: Node,
|
|
1189
|
+
p: Plan,
|
|
1190
|
+
ctx: Context,
|
|
1191
|
+
key: string | number | undefined,
|
|
1192
|
+
outer: Outer | undefined,
|
|
1193
|
+
): ReactNode {
|
|
1194
|
+
const traits =
|
|
1195
|
+
p.env.length > 0 || p.envVariants.length > 0
|
|
1196
|
+
? deriveEnv(ctx.env, p.env, p.envVariants)
|
|
1197
|
+
: ctx.env;
|
|
1198
|
+
// Inside an island its controls share its material; a glass inside it ends that.
|
|
1199
|
+
const env = p.layers.some((layer) => layer.blur)
|
|
1200
|
+
? materialEnv(traits, true)
|
|
1201
|
+
: p.layers.some((layer) => layer.glass !== undefined)
|
|
1202
|
+
? materialEnv(traits, false)
|
|
1203
|
+
: traits;
|
|
1204
|
+
if (p.navigation !== undefined) p.onPress = navigationPress(env, p.navigation);
|
|
1205
|
+
const animation = p.motion?.animation ?? ctx.animation;
|
|
1206
|
+
// What the node's children render in: its environment, its animation scope, and no row (a stack sets its own).
|
|
1207
|
+
const inner: Context =
|
|
1208
|
+
env === ctx.env && animation === ctx.animation && !ctx.inRow
|
|
1209
|
+
? ctx
|
|
1210
|
+
: { env, provided: ctx.provided, animation, scoped: ctx.scoped, inText: ctx.inText };
|
|
1211
|
+
const reactKey = p.id ?? key;
|
|
1212
|
+
if (node.kind === 'skeleton') return drawSkeleton(node, p, inner, reactKey);
|
|
1213
|
+
if (node.kind === 'dialog') return drawPresentedDialog(node, p, inner, reactKey);
|
|
1214
|
+
// A group draws no view of its own: its children, where it is, as if they were there.
|
|
1215
|
+
if (node.kind === 'group')
|
|
1216
|
+
return draw(Fragment, { key: reactKey }, ...renderChildren(node.children, ctx));
|
|
1217
|
+
const layers = p.layers;
|
|
1218
|
+
// A Bloom component's hit testing on the web is a view of its own around it:
|
|
1219
|
+
// react-native-web drops an inline `pointerEvents`. (Its variants are its own
|
|
1220
|
+
// style: `serialize`.)
|
|
1221
|
+
const ownBox = IS_WEB && !DRAWN_BY_HOSTS.has(node.kind) && p.place.allowsHitTesting !== undefined;
|
|
1222
|
+
if (ownBox && layers.length === 0) addVariantToLayers(layers, null, EMPTY_PADDING);
|
|
1223
|
+
// A glass layer is a Surface and a blur layer an island, which the host cannot
|
|
1224
|
+
// be, and an overlay layer holds its views beside the host; so the host takes
|
|
1225
|
+
// the innermost layer only when that layer is plain.
|
|
1226
|
+
const hostTakesLayer =
|
|
1227
|
+
!ownBox &&
|
|
1228
|
+
layers.length > 0 &&
|
|
1229
|
+
(layers[0] as Layer).glass === undefined &&
|
|
1230
|
+
!(layers[0] as Layer).blur &&
|
|
1231
|
+
!(layers[0] as Layer).concentric &&
|
|
1232
|
+
(layers[0] as Layer).overlays.length === 0;
|
|
1233
|
+
const hostLayer = hostTakesLayer ? (layers[0] as Layer) : undefined;
|
|
1234
|
+
const wrappers = hostTakesLayer ? layers.slice(1) : layers;
|
|
1235
|
+
const outermostIsHost = wrappers.length === 0;
|
|
1236
|
+
const flex = flexKey(p);
|
|
1237
|
+
const behaviour = behaviourProps(p);
|
|
1238
|
+
// A control on glass keeps its own press, focus and name: the glass only draws its fill.
|
|
1239
|
+
const hostBehaves = outermostIsHost || p.control !== undefined;
|
|
1240
|
+
const box: Outermost | undefined = outer === undefined ? undefined : { outer, used: false };
|
|
1241
|
+
|
|
1242
|
+
let element = renderHost(
|
|
1243
|
+
node,
|
|
1244
|
+
p,
|
|
1245
|
+
inner,
|
|
1246
|
+
hostLayer,
|
|
1247
|
+
outermostIsHost ? flex : '',
|
|
1248
|
+
hostBehaves ? behaviour : undefined,
|
|
1249
|
+
outermostIsHost ? reactKey : undefined,
|
|
1250
|
+
ctx.inRow === true,
|
|
1251
|
+
outermostIsHost ? box : undefined,
|
|
1252
|
+
);
|
|
1253
|
+
|
|
1254
|
+
for (let i = 0; i < wrappers.length; i++) {
|
|
1255
|
+
let layer = wrappers[i] as Layer;
|
|
1256
|
+
const outermost = i === wrappers.length - 1;
|
|
1257
|
+
const flexOf = outermost ? flex : '';
|
|
1258
|
+
const material = materialPadding(layer);
|
|
1259
|
+
if (material !== undefined) {
|
|
1260
|
+
// The varied padding is a view of its own inside the material, which takes the variants.
|
|
1261
|
+
const { inner } = material;
|
|
1262
|
+
element = drawHost(
|
|
1263
|
+
View,
|
|
1264
|
+
cachedStyle(
|
|
1265
|
+
'host',
|
|
1266
|
+
`L|${inner.key}|`,
|
|
1267
|
+
() => layerStyle(inner),
|
|
1268
|
+
() => layerVariants(inner),
|
|
1269
|
+
),
|
|
1270
|
+
{},
|
|
1271
|
+
element,
|
|
1272
|
+
);
|
|
1273
|
+
layer = material.outer;
|
|
1274
|
+
}
|
|
1275
|
+
element = wrapLayer(
|
|
1276
|
+
layer,
|
|
1277
|
+
flexOf,
|
|
1278
|
+
p,
|
|
1279
|
+
withOverlays(layer, element, inner),
|
|
1280
|
+
outermost && !hostBehaves ? behaviour : undefined,
|
|
1281
|
+
outermost ? reactKey : undefined,
|
|
1282
|
+
outermost ? box : undefined,
|
|
1283
|
+
);
|
|
1284
|
+
}
|
|
1285
|
+
// A Bloom component (a Surface, an Avatar, a bare glyph) takes no motion of
|
|
1286
|
+
// its own: it moves in one box, there only while something plays on it.
|
|
1287
|
+
if (box !== undefined && !box.used && box.outer.active)
|
|
1288
|
+
element = moveIn(box.outer, element, flex ? flexOnly(p.place) : undefined);
|
|
1289
|
+
const badge = ownValue(p, 'badge')?.value;
|
|
1290
|
+
if (isNode(badge) && badge.kind === 'badge') {
|
|
1291
|
+
// An attached badge is Bloom's Badge around the view, at its placement.
|
|
1292
|
+
element = draw(
|
|
1293
|
+
BloomBadge,
|
|
1294
|
+
{ ...badgeProps(badge, plan(badge, ctx.env)), key: reactKey },
|
|
1295
|
+
element,
|
|
1296
|
+
);
|
|
1297
|
+
}
|
|
1298
|
+
// A confirmation dialog grows out of the view where the platform can: its host is around it.
|
|
1299
|
+
const confirmation = ownValue(p, 'confirmationDialog')?.value;
|
|
1300
|
+
if (confirmation !== undefined)
|
|
1301
|
+
element = draw(ConfirmationHost, {
|
|
1302
|
+
key: reactKey,
|
|
1303
|
+
presenting: element,
|
|
1304
|
+
isPresented: confirmation.isPresented,
|
|
1305
|
+
dialog: confirmation.content,
|
|
1306
|
+
render: (child: Child) => renderChild(child, inner, undefined),
|
|
1307
|
+
});
|
|
1308
|
+
const alert = ownValue(p, 'alert')?.value;
|
|
1309
|
+
const dialog = ownValue(p, 'dialog')?.value;
|
|
1310
|
+
const popover = ownValue(p, 'popover')?.value;
|
|
1311
|
+
const cover = ownValue(p, 'fullScreenCover')?.value;
|
|
1312
|
+
if (alert === undefined && dialog === undefined && popover === undefined && cover === undefined)
|
|
1313
|
+
return element;
|
|
1314
|
+
// What the view presents: an anchored popover around it; an alert, a dialog
|
|
1315
|
+
// or a full-screen cover beside it.
|
|
1316
|
+
return presentAround(
|
|
1317
|
+
element as ReactElement,
|
|
1318
|
+
{ alert, dialog, popover, cover },
|
|
1319
|
+
(children) => renderChildren(children, inner),
|
|
1320
|
+
reactKey,
|
|
1321
|
+
);
|
|
1322
|
+
}
|
|
1323
|
+
|
|
1324
|
+
function boxStyle(layer: Layer | undefined, flex: string, p: Plan): Resolved {
|
|
1325
|
+
const style = layerStyle(layer);
|
|
1326
|
+
return flex ? Object.assign(style, placeStyle(p.place)) : style;
|
|
1327
|
+
}
|
|
1328
|
+
|
|
1329
|
+
/** A box's live variants: its layer's, and its place's when it is the outermost box. */
|
|
1330
|
+
function boxVariants(layer: Layer | undefined, flex: string, p: Plan): VariantStyles {
|
|
1331
|
+
return joinVariants(layerVariants(layer), flex ? placeVariants(p.place) : undefined);
|
|
1332
|
+
}
|
|
1333
|
+
|
|
1334
|
+
/**
|
|
1335
|
+
* A material (a glass, an island, a concentric box) is a Bloom component, which
|
|
1336
|
+
* takes its style as an object, so nothing varies it on the web. Its padding
|
|
1337
|
+
* can vary all the same: a padding is the same room on a view just inside the
|
|
1338
|
+
* material, so a varied one moves there with its variants (`outer` is the
|
|
1339
|
+
* material without it). What else varies on a material is left out, said once
|
|
1340
|
+
* in development.
|
|
1341
|
+
*/
|
|
1342
|
+
function materialPadding(layer: Layer): { outer: Layer; inner: Layer } | undefined {
|
|
1343
|
+
if (layer.glass === undefined && !layer.blur && !layer.concentric) return undefined;
|
|
1344
|
+
const live = layer.variants.filter(([condition]) => condition !== null);
|
|
1345
|
+
if (live.length === 0) return undefined;
|
|
1346
|
+
const takes = (modifier: LayerModifier) =>
|
|
1347
|
+
modifier.kind === 'padding' || GLASS_VARIES.has(modifier.kind);
|
|
1348
|
+
if (live.some(([, modifier]) => !takes(modifier)))
|
|
1349
|
+
warnOnce(
|
|
1350
|
+
'material-variant',
|
|
1351
|
+
'[Bloom language] a material (a glass, an island, a concentric box) varies its padding, frame, border, corner and fill: its other variants are left out (a material is never faded).',
|
|
1352
|
+
);
|
|
1353
|
+
if (!live.some(([, modifier]) => modifier.kind === 'padding')) return undefined;
|
|
1354
|
+
const isPadding = (modifier: LayerModifier) => modifier.kind === 'padding';
|
|
1355
|
+
const inner: Layer = {
|
|
1356
|
+
modifiers: layer.modifiers.filter(isPadding),
|
|
1357
|
+
variants: layer.variants.filter(([, modifier]) => isPadding(modifier)),
|
|
1358
|
+
key: `${layer.key}|inside`,
|
|
1359
|
+
rank: LAYER_RANK.padding,
|
|
1360
|
+
edges: layer.edges,
|
|
1361
|
+
glass: undefined,
|
|
1362
|
+
concentric: false,
|
|
1363
|
+
curve: undefined,
|
|
1364
|
+
blur: false,
|
|
1365
|
+
overlays: [],
|
|
1366
|
+
corners: 0,
|
|
1367
|
+
follows: [],
|
|
1368
|
+
};
|
|
1369
|
+
const outer: Layer = {
|
|
1370
|
+
...layer,
|
|
1371
|
+
modifiers: layer.modifiers.filter((modifier) => !isPadding(modifier)),
|
|
1372
|
+
variants: layer.variants.filter(([, modifier]) => !isPadding(modifier)),
|
|
1373
|
+
key: `${layer.key}|around`,
|
|
1374
|
+
edges: 0,
|
|
1375
|
+
};
|
|
1376
|
+
return { outer, inner };
|
|
1377
|
+
}
|
|
1378
|
+
|
|
1379
|
+
/** What a material varies besides its padding (a view just inside it): its own frame, border, corner and fill. */
|
|
1380
|
+
const GLASS_VARIES: ReadonlySet<string> = new Set(['frame', 'border', 'corner', 'background']);
|
|
1381
|
+
|
|
1382
|
+
/** What a glass's live variants change, each where the material takes it. */
|
|
1383
|
+
interface GlassVariants {
|
|
1384
|
+
/** Its frame and border: the material's own style. */
|
|
1385
|
+
readonly style: VariantStyles;
|
|
1386
|
+
/** Its corner (the radius it clips to) and fill (its tint), as the material's props. */
|
|
1387
|
+
readonly props: readonly (readonly [LiveCondition, { radius?: number; fill?: ColorToken }])[];
|
|
1388
|
+
/** Whether one answers the view's state: the box around the glass then tracks it. */
|
|
1389
|
+
readonly stateful: boolean;
|
|
1390
|
+
}
|
|
1391
|
+
|
|
1392
|
+
const glassVariantsByKey = new Map<string, GlassVariants>();
|
|
1393
|
+
|
|
1394
|
+
/**
|
|
1395
|
+
* A glass's live variants (its padding is a view inside it, `materialPadding`).
|
|
1396
|
+
* A glass is the platform's material, which takes its corner and fill as props
|
|
1397
|
+
* and is never faded: a frame or a border varies its style, a corner its
|
|
1398
|
+
* radius (one radius: a corner of some sides, or concentric, is left out), a
|
|
1399
|
+
* fill its tint. Built once per layer.
|
|
1400
|
+
*/
|
|
1401
|
+
function glassVariants(layer: Layer): GlassVariants {
|
|
1402
|
+
let varied = glassVariantsByKey.get(layer.key);
|
|
1403
|
+
if (varied !== undefined) return varied;
|
|
1404
|
+
const live = layer.variants.filter(
|
|
1405
|
+
(entry): entry is [LiveCondition, LayerModifier] => entry[0] !== null,
|
|
1406
|
+
);
|
|
1407
|
+
const props = new Map<LiveCondition, { radius?: number; fill?: ColorToken }>();
|
|
1408
|
+
for (const [condition, modifier] of live) {
|
|
1409
|
+
if (modifier.kind === 'corner') {
|
|
1410
|
+
if (modifier.side !== 'all' || modifier.value === 'concentric' || layer.concentric) {
|
|
1411
|
+
warnOnce(
|
|
1412
|
+
'glass-corner-variant',
|
|
1413
|
+
'[Bloom language] a material’s corner varies as one radius: a corner of some sides, or concentric (a concentric box’s own radius), is left out of when().',
|
|
1414
|
+
);
|
|
1415
|
+
continue;
|
|
1416
|
+
}
|
|
1417
|
+
props.set(condition, { ...props.get(condition), radius: resolveCorner(modifier.value) });
|
|
1418
|
+
} else if (modifier.kind === 'background' && layer.glass !== undefined) {
|
|
1419
|
+
if (isAppColor(modifier.value)) {
|
|
1420
|
+
// A glass is tinted by a role, at rest and in a variant: the platforms' glasses take one.
|
|
1421
|
+
warnOnce(
|
|
1422
|
+
'glass-app-color-variant',
|
|
1423
|
+
'[Bloom language] a glass’s tint is a colour role: an app colour is left out of when().',
|
|
1424
|
+
);
|
|
1425
|
+
continue;
|
|
1426
|
+
}
|
|
1427
|
+
props.set(condition, { ...props.get(condition), fill: modifier.value });
|
|
1428
|
+
}
|
|
1429
|
+
}
|
|
1430
|
+
// A glass's fill is its tint (a prop); an island's and a concentric box's is their style's.
|
|
1431
|
+
const inStyle = (modifier: LayerModifier) =>
|
|
1432
|
+
modifier.kind === 'frame' ||
|
|
1433
|
+
modifier.kind === 'border' ||
|
|
1434
|
+
(modifier.kind === 'background' && layer.glass === undefined);
|
|
1435
|
+
varied = {
|
|
1436
|
+
style: layerVariants({ ...layer, variants: live.filter(([, modifier]) => inStyle(modifier)) }),
|
|
1437
|
+
props: [...props].sort(([a], [b]) => compareLive(a, b)),
|
|
1438
|
+
stateful: live.some(
|
|
1439
|
+
([condition, modifier]) =>
|
|
1440
|
+
GLASS_VARIES.has(modifier.kind) && termsOf(condition).some((term) => STATES.has(term)),
|
|
1441
|
+
),
|
|
1442
|
+
};
|
|
1443
|
+
glassVariantsByKey.set(layer.key, varied);
|
|
1444
|
+
return varied;
|
|
1445
|
+
}
|
|
1446
|
+
|
|
1447
|
+
/** A material's varied corner as its `radius` prop, under each condition that varies it. */
|
|
1448
|
+
function radiusVariants(varied: GlassVariants): (readonly [LiveCondition, VariedProps])[] {
|
|
1449
|
+
return varied.props.flatMap(([condition, { radius }]) =>
|
|
1450
|
+
radius === undefined ? [] : [[condition, { props: { radius } }] as const],
|
|
1451
|
+
);
|
|
1452
|
+
}
|
|
1453
|
+
|
|
1454
|
+
/** A padding of nothing: what opens the view of its own a Bloom component's hit testing takes on the web. */
|
|
1455
|
+
const EMPTY_PADDING = Object.freeze({
|
|
1456
|
+
kind: 'padding',
|
|
1457
|
+
key: 'p:all:none',
|
|
1458
|
+
edge: 'all',
|
|
1459
|
+
value: 'none',
|
|
1460
|
+
}) as Extract<Modifier, { kind: 'padding' }>;
|
|
1461
|
+
|
|
1462
|
+
/**
|
|
1463
|
+
* What an overlay layer's view holds: its view backgrounds, the content as
|
|
1464
|
+
* drawn so far, then its overlays, each a box over the whole of it (SwiftUI's
|
|
1465
|
+
* `background(alignment:)` and `overlay(alignment:)`). Each box lets touches
|
|
1466
|
+
* through to what is under it, outside its own content.
|
|
1467
|
+
*/
|
|
1468
|
+
function withOverlays(layer: Layer, child: ReactNode, ctx: Context): ReactNode | ReactNode[] {
|
|
1469
|
+
if (layer.overlays.length === 0) return child;
|
|
1470
|
+
const box = (overlay: Layer['overlays'][number]) =>
|
|
1471
|
+
drawHost(
|
|
1472
|
+
View,
|
|
1473
|
+
cachedStyle('host', `OV|${overlay.alignment}`, () => overlayStyle(overlay.alignment)),
|
|
1474
|
+
{ pointerEvents: 'box-none' },
|
|
1475
|
+
renderNode(overlay.content as Node, ctx, undefined),
|
|
1476
|
+
);
|
|
1477
|
+
return [
|
|
1478
|
+
...layer.overlays.filter((overlay) => overlay.behind).map(box),
|
|
1479
|
+
child,
|
|
1480
|
+
...layer.overlays.filter((overlay) => !overlay.behind).map(box),
|
|
1481
|
+
];
|
|
1482
|
+
}
|
|
1483
|
+
|
|
1484
|
+
function wrapLayer(
|
|
1485
|
+
layer: Layer,
|
|
1486
|
+
flex: string,
|
|
1487
|
+
p: Plan,
|
|
1488
|
+
content: ReactNode | ReactNode[],
|
|
1489
|
+
behaviour: Record<string, unknown> | undefined,
|
|
1490
|
+
key: string | number | undefined,
|
|
1491
|
+
box: Outermost | undefined,
|
|
1492
|
+
): ReactElement {
|
|
1493
|
+
const styleKey = `L|${layer.key}|${flex}`;
|
|
1494
|
+
const glass = layer.glass;
|
|
1495
|
+
const children = Array.isArray(content) ? (content as ReactNode[]) : [content as ReactNode];
|
|
1496
|
+
if (glass !== undefined) {
|
|
1497
|
+
// The glass's corner is its radius (it clips itself), not a style of its host.
|
|
1498
|
+
const { corner, resolved } = materialRadius(boxStyle(layer, flex, p));
|
|
1499
|
+
const radius = typeof corner === 'number' ? corner : undefined;
|
|
1500
|
+
const surfaceRadius = layer.concentric ? 'concentric' : radius;
|
|
1501
|
+
const varied = glassVariants(layer);
|
|
1502
|
+
const outer = behaviour && !p.pressable ? behaviour : null;
|
|
1503
|
+
const ownKey = behaviour && p.pressable ? undefined : key;
|
|
1504
|
+
// A variant of the material that answers the view's state reads it from the
|
|
1505
|
+
// box around the glass, which then tracks it in JS (on the web too).
|
|
1506
|
+
const around = varied.stateful ? AROUND : NO_OUT;
|
|
1507
|
+
const PlatformGlass = getPlatformGlass();
|
|
1508
|
+
if (PlatformGlass !== null) {
|
|
1509
|
+
// The platform draws the glass (the lens, Liquid Glass, the system blur).
|
|
1510
|
+
const out = cachedStyle(
|
|
1511
|
+
'host',
|
|
1512
|
+
`${styleKey}|${p.control ? 'c' : ''}`,
|
|
1513
|
+
() => (p.control ? Object.assign({ alignSelf: 'flex-start' }, resolved) : resolved),
|
|
1514
|
+
() => varied.style,
|
|
1515
|
+
);
|
|
1516
|
+
const props: Record<string, unknown> = {
|
|
1517
|
+
...outer,
|
|
1518
|
+
glass,
|
|
1519
|
+
radius,
|
|
1520
|
+
fallbackTint: p.control?.tint,
|
|
1521
|
+
interactive: glass.interactiveSaid ?? (p.pressable || p.control !== undefined),
|
|
1522
|
+
member: p.glassMember,
|
|
1523
|
+
key: ownKey,
|
|
1524
|
+
};
|
|
1525
|
+
// A fill that varies is the glass's tint, the token as the platform's glass takes it.
|
|
1526
|
+
const paint = variedPaint(`G|${styleKey}|${p.control ? 'c' : ''}|P`, out, NO_ROLES, () =>
|
|
1527
|
+
varied.props.map(([condition, { radius, fill }]) => [
|
|
1528
|
+
condition,
|
|
1529
|
+
{
|
|
1530
|
+
props: {
|
|
1531
|
+
...(radius === undefined ? null : { radius }),
|
|
1532
|
+
...(fill === undefined ? null : { fill: role(fill) }),
|
|
1533
|
+
},
|
|
1534
|
+
},
|
|
1535
|
+
]),
|
|
1536
|
+
);
|
|
1537
|
+
const drawn = drawHost(PlatformGlass, paint ? painted(out, paint) : out, props, ...children);
|
|
1538
|
+
if (p.control?.reports.length) return draw(ReportedState, { key }, drawn);
|
|
1539
|
+
return behaviour && p.pressable
|
|
1540
|
+
? drawOutermost(box, hostFor(p), around, { ...behaviour, key }, drawn)
|
|
1541
|
+
: drawn;
|
|
1542
|
+
}
|
|
1543
|
+
const out = cachedStyle(
|
|
1544
|
+
'component',
|
|
1545
|
+
styleKey,
|
|
1546
|
+
() => resolved,
|
|
1547
|
+
() => varied.style,
|
|
1548
|
+
);
|
|
1549
|
+
const props: Record<string, unknown> = {
|
|
1550
|
+
radius: surfaceRadius,
|
|
1551
|
+
...(layer.curve ? { cornerCurve: layer.curve } : null),
|
|
1552
|
+
...(glass.sheen ? null : { sheen: false }),
|
|
1553
|
+
...outer,
|
|
1554
|
+
key: ownKey,
|
|
1555
|
+
};
|
|
1556
|
+
// Surface's fill is a colour painted from a role: the glass's own (or the
|
|
1557
|
+
// control's), and the one a variant names while it holds.
|
|
1558
|
+
const fill = glass.fillRole ?? p.control?.tint;
|
|
1559
|
+
const opacity = glass.fillRole === undefined ? undefined : glass.fillOpacity;
|
|
1560
|
+
const paint = variedPaint(
|
|
1561
|
+
`G|${styleKey}|${fill ?? ''}|${opacity ?? ''}`,
|
|
1562
|
+
out,
|
|
1563
|
+
fill === undefined
|
|
1564
|
+
? NO_ROLES
|
|
1565
|
+
: [opacity === undefined ? ['fill', fill] : ['fill', fill, opacity]],
|
|
1566
|
+
() =>
|
|
1567
|
+
varied.props.map(([condition, { radius, fill: varying }]) => [
|
|
1568
|
+
condition,
|
|
1569
|
+
{
|
|
1570
|
+
props: radius === undefined ? undefined : { radius },
|
|
1571
|
+
propRoles: varying === undefined ? undefined : [propRole('fill', varying)],
|
|
1572
|
+
},
|
|
1573
|
+
]),
|
|
1574
|
+
);
|
|
1575
|
+
const surface = drawHost(Surface, paint ? painted(out, paint) : out, props, ...children);
|
|
1576
|
+
// A control's glass varies with the control's state, which it reports to a box around the glass.
|
|
1577
|
+
if (p.control?.reports.length) return draw(ReportedState, { key }, surface);
|
|
1578
|
+
return behaviour && p.pressable
|
|
1579
|
+
? drawOutermost(box, hostFor(p), around, { ...behaviour, key }, surface)
|
|
1580
|
+
: surface;
|
|
1581
|
+
}
|
|
1582
|
+
if (layer.blur) {
|
|
1583
|
+
// Bloom's floating island: its material, its shadow and its clip; a capsule
|
|
1584
|
+
// unless the layer's corner names the radius.
|
|
1585
|
+
const { corner, resolved } = materialRadius(boxStyle(layer, flex, p));
|
|
1586
|
+
const varied = glassVariants(layer);
|
|
1587
|
+
const out = cachedStyle(
|
|
1588
|
+
'material',
|
|
1589
|
+
styleKey,
|
|
1590
|
+
() => resolved,
|
|
1591
|
+
() => varied.style,
|
|
1592
|
+
);
|
|
1593
|
+
const outer = behaviour && !p.pressable ? behaviour : null;
|
|
1594
|
+
const paint = variedPaint(`I|${styleKey}`, out, NO_ROLES, () => radiusVariants(varied));
|
|
1595
|
+
const island = drawHost(
|
|
1596
|
+
BlurIsland,
|
|
1597
|
+
paint ? painted(out, paint) : out,
|
|
1598
|
+
{
|
|
1599
|
+
...(typeof corner === 'number' ? { radius: corner } : null),
|
|
1600
|
+
...(layer.curve ? { cornerCurve: layer.curve } : null),
|
|
1601
|
+
...outer,
|
|
1602
|
+
key: behaviour && p.pressable ? undefined : key,
|
|
1603
|
+
},
|
|
1604
|
+
...children,
|
|
1605
|
+
);
|
|
1606
|
+
return behaviour && p.pressable
|
|
1607
|
+
? drawOutermost(
|
|
1608
|
+
box,
|
|
1609
|
+
hostFor(p),
|
|
1610
|
+
varied.stateful ? AROUND : NO_OUT,
|
|
1611
|
+
{ ...behaviour, key },
|
|
1612
|
+
island,
|
|
1613
|
+
)
|
|
1614
|
+
: island;
|
|
1615
|
+
}
|
|
1616
|
+
if (layer.concentric) {
|
|
1617
|
+
// Bloom's concentric geometry: the radius of the shape it sits in, less the inset.
|
|
1618
|
+
const varied = glassVariants(layer);
|
|
1619
|
+
const out = cachedStyle(
|
|
1620
|
+
'component',
|
|
1621
|
+
styleKey,
|
|
1622
|
+
() => boxStyle(layer, flex, p),
|
|
1623
|
+
() => varied.style,
|
|
1624
|
+
);
|
|
1625
|
+
const outer = behaviour && !p.pressable ? behaviour : null;
|
|
1626
|
+
const view = drawHost(
|
|
1627
|
+
ConcentricView,
|
|
1628
|
+
out,
|
|
1629
|
+
{ ...outer, radius: 'concentric', key: behaviour && p.pressable ? undefined : key },
|
|
1630
|
+
...children,
|
|
1631
|
+
);
|
|
1632
|
+
return behaviour && p.pressable
|
|
1633
|
+
? drawOutermost(
|
|
1634
|
+
box,
|
|
1635
|
+
hostFor(p),
|
|
1636
|
+
varied.stateful ? AROUND : NO_OUT,
|
|
1637
|
+
{ ...behaviour, key },
|
|
1638
|
+
view,
|
|
1639
|
+
)
|
|
1640
|
+
: view;
|
|
1641
|
+
}
|
|
1642
|
+
const out = cachedStyle(
|
|
1643
|
+
'host',
|
|
1644
|
+
styleKey,
|
|
1645
|
+
() => boxStyle(layer, flex, p),
|
|
1646
|
+
() => boxVariants(layer, flex, p),
|
|
1647
|
+
);
|
|
1648
|
+
return drawOutermost(box, behaviour ? hostFor(p) : View, out, { ...behaviour, key }, ...children);
|
|
1649
|
+
}
|
|
1650
|
+
|
|
1651
|
+
/** A web list's row: a list item around the child, which draws the list's marker before it. */
|
|
1652
|
+
function listItem(child: ReactNode): ReactNode {
|
|
1653
|
+
if (child === null || child === undefined || typeof child === 'boolean') return child;
|
|
1654
|
+
const { key } = child as ReactElement;
|
|
1655
|
+
return drawHost(
|
|
1656
|
+
View,
|
|
1657
|
+
cachedStyle('host', 'LI', () => ({ display: 'list-item' })),
|
|
1658
|
+
{
|
|
1659
|
+
role: 'listitem',
|
|
1660
|
+
key: key ?? undefined,
|
|
1661
|
+
},
|
|
1662
|
+
child,
|
|
1663
|
+
);
|
|
1664
|
+
}
|
|
1665
|
+
|
|
1666
|
+
/**
|
|
1667
|
+
* A button group's glass is Bloom's lens group: the platform's lens where the
|
|
1668
|
+
* device has one, its shared Surface elsewhere. The group's material has no
|
|
1669
|
+
* tint and no clear variant, so those are left out, said once in development.
|
|
1670
|
+
*/
|
|
1671
|
+
function groupMaterial(glass: GlassValue | undefined): 'lens' | undefined {
|
|
1672
|
+
if (glass === undefined) return undefined;
|
|
1673
|
+
if (glass.key !== regular.key)
|
|
1674
|
+
warnOnce(
|
|
1675
|
+
'group-glass',
|
|
1676
|
+
'[Bloom language] a ButtonGroup’s glass is its lens material: .glass() alone; a clear or tinted glass is drawn as .glass().',
|
|
1677
|
+
);
|
|
1678
|
+
return 'lens';
|
|
1679
|
+
}
|
|
1680
|
+
|
|
1681
|
+
/**
|
|
1682
|
+
* A material's radius: a glass and an island clip themselves to one radius,
|
|
1683
|
+
* so the layer's corner is that radius, not a style of their host. A corner of
|
|
1684
|
+
* some sides only has no such radius: it is left out, said once in development.
|
|
1685
|
+
*/
|
|
1686
|
+
function materialRadius(style: Resolved): { corner: StyleValue | undefined; resolved: Resolved } {
|
|
1687
|
+
const { borderRadius: corner, overflow: _clip, ...resolved } = style;
|
|
1688
|
+
for (const key of SIDE_RADII) {
|
|
1689
|
+
if (!(key in resolved)) continue;
|
|
1690
|
+
delete resolved[key];
|
|
1691
|
+
warnOnce(
|
|
1692
|
+
'side-radius',
|
|
1693
|
+
'[Bloom language] a glass or an island takes one radius: a corner of some sides only (.corner(r, side)) is left out on it.',
|
|
1694
|
+
);
|
|
1695
|
+
}
|
|
1696
|
+
return { corner, resolved };
|
|
1697
|
+
}
|
|
1698
|
+
|
|
1699
|
+
const warned = new Set<string>();
|
|
1700
|
+
function warnOnce(id: string, message: string): void {
|
|
1701
|
+
if (process.env.NODE_ENV === 'production' || warned.has(id)) return;
|
|
1702
|
+
warned.add(id);
|
|
1703
|
+
console.warn(message);
|
|
1704
|
+
}
|
|
1705
|
+
|
|
1706
|
+
/** A shape's side with no `size()`: 40, Bloom's avatar default. */
|
|
1707
|
+
const SHAPE_SIDE: SpaceToken = '4xl';
|
|
1708
|
+
|
|
1709
|
+
/** A shape's paint: what the last of `fill`, `stroke` and `image` in its chain says (a fill in the foreground by default). */
|
|
1710
|
+
function shapeElement(
|
|
1711
|
+
node: Node,
|
|
1712
|
+
name: ShapeName,
|
|
1713
|
+
size: number,
|
|
1714
|
+
key: string | number | undefined,
|
|
1715
|
+
): ReactElement {
|
|
1716
|
+
let last: Extract<Modifier, { kind: 'fill' | 'stroke' | 'image' }> | undefined;
|
|
1717
|
+
for (const modifier of node.modifiers) {
|
|
1718
|
+
if (modifier.kind === 'fill' || modifier.kind === 'stroke' || modifier.kind === 'image')
|
|
1719
|
+
last = modifier;
|
|
1720
|
+
}
|
|
1721
|
+
if (last?.kind === 'image')
|
|
1722
|
+
return draw(ShapeImage, { key, shape: name, size, source: last.source, alt: last.alt });
|
|
1723
|
+
if (last?.kind === 'stroke') {
|
|
1724
|
+
return draw(Painted, {
|
|
1725
|
+
key,
|
|
1726
|
+
host: ShapeBorder,
|
|
1727
|
+
shape: name,
|
|
1728
|
+
size,
|
|
1729
|
+
width: resolveBorderWidth(last.width),
|
|
1730
|
+
paint: tokenPaint('colors', last.value),
|
|
1731
|
+
});
|
|
1732
|
+
}
|
|
1733
|
+
return draw(Painted, {
|
|
1734
|
+
key,
|
|
1735
|
+
host: ShapeFill,
|
|
1736
|
+
shape: name,
|
|
1737
|
+
size,
|
|
1738
|
+
paint: tokenPaint('color', last?.value ?? 'foreground'),
|
|
1739
|
+
});
|
|
1740
|
+
}
|
|
1741
|
+
|
|
1742
|
+
const tokenPaints = new Map<string, Paint>();
|
|
1743
|
+
|
|
1744
|
+
/** One prop painted from a colour token (a role at an opacity included), on a host with no style. */
|
|
1745
|
+
function tokenPaint(prop: string, token: ColorToken): Paint {
|
|
1746
|
+
const id = `${prop}|${token}`;
|
|
1747
|
+
let paint = tokenPaints.get(id);
|
|
1748
|
+
if (paint === undefined) {
|
|
1749
|
+
const ref = role(token);
|
|
1750
|
+
paint = {
|
|
1751
|
+
style: undefined,
|
|
1752
|
+
styleRoles: [],
|
|
1753
|
+
propRoles: [ref.opacity === undefined ? [prop, ref.role] : [prop, ref.role, ref.opacity]],
|
|
1754
|
+
};
|
|
1755
|
+
tokenPaints.set(id, paint);
|
|
1756
|
+
}
|
|
1757
|
+
return paint;
|
|
1758
|
+
}
|
|
1759
|
+
|
|
1760
|
+
/**
|
|
1761
|
+
* Bloom's Button with its `colors` pair as two props, so a `Painted` leaf can
|
|
1762
|
+
* paint each from its role. One pair object per colour pair, so the button's
|
|
1763
|
+
* props compare equal across renders.
|
|
1764
|
+
*/
|
|
1765
|
+
const pairs = new Map<string, { background: string; foreground: string }>();
|
|
1766
|
+
function PairedButton({
|
|
1767
|
+
background,
|
|
1768
|
+
foreground,
|
|
1769
|
+
...props
|
|
1770
|
+
}: Record<string, unknown> & { background: string; foreground: string }): ReactElement {
|
|
1771
|
+
const id = `${background}|${foreground}`;
|
|
1772
|
+
let colors = pairs.get(id);
|
|
1773
|
+
if (colors === undefined) {
|
|
1774
|
+
colors = Object.freeze({ background, foreground });
|
|
1775
|
+
pairs.set(id, colors);
|
|
1776
|
+
}
|
|
1777
|
+
return draw(BloomButton, { ...props, colors });
|
|
1778
|
+
}
|
|
1779
|
+
|
|
1780
|
+
/** A paired button's paint: its style, and its fill and label from their roles. */
|
|
1781
|
+
function pairPaint(
|
|
1782
|
+
styleKey: string,
|
|
1783
|
+
out: StyleOut,
|
|
1784
|
+
[background, foreground]: readonly [ColorToken, ColorToken],
|
|
1785
|
+
): Paint {
|
|
1786
|
+
return variedPaint(
|
|
1787
|
+
`${styleKey}|pair|${background}|${foreground}`,
|
|
1788
|
+
out,
|
|
1789
|
+
[propRole('background', background), propRole('foreground', foreground)],
|
|
1790
|
+
NO_VARIANTS,
|
|
1791
|
+
) as Paint;
|
|
1792
|
+
}
|
|
1793
|
+
|
|
1794
|
+
const NO_STYLE_OUT: StyleOut = Object.freeze({ style: undefined, paint: undefined });
|
|
1795
|
+
|
|
1796
|
+
/** A component's style out drawn with `paint` (its style and the props painted from roles). */
|
|
1797
|
+
function painted(out: StyleOut, paint: Paint): StyleOut {
|
|
1798
|
+
return { style: undefined, paint, ...(out.object ? { object: true } : null) };
|
|
1799
|
+
}
|
|
1800
|
+
|
|
1801
|
+
/** One prop painted from a colour token (a role at an opacity included). */
|
|
1802
|
+
function propRole(prop: string, token: ColorToken): readonly [string, ColorName, number?] {
|
|
1803
|
+
const { role: name, opacity } = role(token);
|
|
1804
|
+
return opacity === undefined ? [prop, name] : [prop, name, opacity];
|
|
1805
|
+
}
|
|
1806
|
+
|
|
1807
|
+
/** One colour of a painted list: a role (at an opacity), or an app's own colour. */
|
|
1808
|
+
function listColor(token: InkToken): ListColor {
|
|
1809
|
+
const ref = ink(token);
|
|
1810
|
+
if (typeof ref === 'string') return ref;
|
|
1811
|
+
return ref.opacity === undefined ? [ref.role] : [ref.role, ref.opacity];
|
|
1812
|
+
}
|
|
1813
|
+
|
|
1814
|
+
const NO_ROLES: Paint['propRoles'] = Object.freeze([]);
|
|
1815
|
+
|
|
1816
|
+
/** What a variant changes of a component's props: values as they are, and props painted from roles. */
|
|
1817
|
+
interface VariedProps {
|
|
1818
|
+
readonly props?: Readonly<Record<string, unknown>>;
|
|
1819
|
+
readonly propRoles?: Paint['propRoles'];
|
|
1820
|
+
}
|
|
1821
|
+
|
|
1822
|
+
const variedPaints = new Map<string, Paint | null>();
|
|
1823
|
+
|
|
1824
|
+
/**
|
|
1825
|
+
* A component's style (painted on native, and its live variants) plus props
|
|
1826
|
+
* painted from roles (a glass Surface's `fill`, an image's `tintColor`), and
|
|
1827
|
+
* what live variants change of its props, each under its condition beside the
|
|
1828
|
+
* style's (a glass's radius and fill). `undefined` when it adds nothing to the
|
|
1829
|
+
* style. Built once per `id`.
|
|
1830
|
+
*/
|
|
1831
|
+
function variedPaint(
|
|
1832
|
+
id: string,
|
|
1833
|
+
out: StyleOut,
|
|
1834
|
+
propRoles: Paint['propRoles'],
|
|
1835
|
+
variants: () => readonly (readonly [LiveCondition, VariedProps])[],
|
|
1836
|
+
propLists?: Paint['propLists'],
|
|
1837
|
+
): Paint | undefined {
|
|
1838
|
+
let paint = variedPaints.get(id);
|
|
1839
|
+
if (paint === undefined) {
|
|
1840
|
+
const varied = variants();
|
|
1841
|
+
if (propRoles.length === 0 && varied.length === 0 && propLists === undefined) paint = null;
|
|
1842
|
+
else {
|
|
1843
|
+
const base = out.paint ?? {
|
|
1844
|
+
style: out.style as object | undefined,
|
|
1845
|
+
styleRoles: [],
|
|
1846
|
+
propRoles: [],
|
|
1847
|
+
};
|
|
1848
|
+
const byCondition = new Map<LiveCondition, PaintVariant>();
|
|
1849
|
+
for (const variant of base.variants ?? []) byCondition.set(variant.condition, variant);
|
|
1850
|
+
for (const [condition, extra] of varied) {
|
|
1851
|
+
const current = byCondition.get(condition) ?? { condition, style: {}, styleRoles: [] };
|
|
1852
|
+
byCondition.set(condition, {
|
|
1853
|
+
...current,
|
|
1854
|
+
props: { ...current.props, ...extra.props },
|
|
1855
|
+
propRoles: [...(current.propRoles ?? []), ...(extra.propRoles ?? [])],
|
|
1856
|
+
});
|
|
1857
|
+
}
|
|
1858
|
+
const list = [...byCondition.values()].sort((a, b) => compareLive(a.condition, b.condition));
|
|
1859
|
+
paint = {
|
|
1860
|
+
style: base.style,
|
|
1861
|
+
styleRoles: base.styleRoles,
|
|
1862
|
+
propRoles,
|
|
1863
|
+
...(list.length > 0 ? { variants: list } : null),
|
|
1864
|
+
...(propLists === undefined ? null : { propLists }),
|
|
1865
|
+
};
|
|
1866
|
+
}
|
|
1867
|
+
variedPaints.set(id, paint);
|
|
1868
|
+
}
|
|
1869
|
+
return paint ?? undefined;
|
|
1870
|
+
}
|
|
1871
|
+
|
|
1872
|
+
const NO_VARIANTS = () => [];
|
|
1873
|
+
|
|
1874
|
+
/** A component's style plus one prop painted from a role. */
|
|
1875
|
+
function propPaint(
|
|
1876
|
+
styleKey: string,
|
|
1877
|
+
out: StyleOut,
|
|
1878
|
+
prop: string,
|
|
1879
|
+
role: ColorName,
|
|
1880
|
+
opacity?: number,
|
|
1881
|
+
): Paint {
|
|
1882
|
+
return variedPaint(
|
|
1883
|
+
`${styleKey}|${prop}|${role}|${opacity ?? ''}`,
|
|
1884
|
+
out,
|
|
1885
|
+
[opacity === undefined ? [prop, role] : [prop, role, opacity]],
|
|
1886
|
+
NO_VARIANTS,
|
|
1887
|
+
) as Paint;
|
|
1888
|
+
}
|
|
1889
|
+
|
|
1890
|
+
/** The outermost box's host: pressable when the view takes presses or hovers. */
|
|
1891
|
+
function hostFor(p: Plan): Host {
|
|
1892
|
+
return p.pressable ? Pressable : View;
|
|
1893
|
+
}
|
|
1894
|
+
|
|
1895
|
+
function hostProps(
|
|
1896
|
+
behaviour: Record<string, unknown> | undefined,
|
|
1897
|
+
key: string | number | undefined,
|
|
1898
|
+
): Record<string, unknown> {
|
|
1899
|
+
const props: Record<string, unknown> = behaviour ? { ...behaviour } : {};
|
|
1900
|
+
if (key !== undefined) props.key = key;
|
|
1901
|
+
return props;
|
|
1902
|
+
}
|
|
1903
|
+
|
|
1904
|
+
const iconPaints = new Map<ColorToken, Paint>();
|
|
1905
|
+
|
|
1906
|
+
/** An icon's fill, painted from its foreground role (at its opacity, if it names one). */
|
|
1907
|
+
function iconPaint(color: ColorToken): Paint {
|
|
1908
|
+
let paint = iconPaints.get(color);
|
|
1909
|
+
if (paint === undefined) {
|
|
1910
|
+
const { role: name, opacity } = role(color);
|
|
1911
|
+
const fill: readonly [string, ColorName, number?] =
|
|
1912
|
+
opacity === undefined ? ['fill', name] : ['fill', name, opacity];
|
|
1913
|
+
paint = { style: undefined, styleRoles: [], propRoles: [fill] };
|
|
1914
|
+
iconPaints.set(color, paint);
|
|
1915
|
+
}
|
|
1916
|
+
return paint;
|
|
1917
|
+
}
|
|
1918
|
+
|
|
1919
|
+
const iconVariantPaints = new Map<string, Paint>();
|
|
1920
|
+
|
|
1921
|
+
/**
|
|
1922
|
+
* An icon's glyph, filled with the foreground it is drawn in. A foreground a
|
|
1923
|
+
* live variant changes is answered where every other variant is: on the web by
|
|
1924
|
+
* CSS (the glyph paints `currentColor`, and its colour is a class under each
|
|
1925
|
+
* condition), on native by a `Conditioned` leaf that fills it from the
|
|
1926
|
+
* environment.
|
|
1927
|
+
*/
|
|
1928
|
+
function iconGlyph(
|
|
1929
|
+
icon: IconComponent,
|
|
1930
|
+
env: Env,
|
|
1931
|
+
size: number,
|
|
1932
|
+
key: string | number | undefined,
|
|
1933
|
+
): ReactElement {
|
|
1934
|
+
const color = foregroundOf(env.text);
|
|
1935
|
+
// In the order they apply, as every other host's variants are.
|
|
1936
|
+
const live = (env.text.variants ?? [])
|
|
1937
|
+
.flatMap(([condition, changed]) =>
|
|
1938
|
+
changed.foreground === undefined ? [] : [[condition, changed.foreground] as const],
|
|
1939
|
+
)
|
|
1940
|
+
.sort(([a], [b]) => compareLive(a, b));
|
|
1941
|
+
// An app's own colour is the glyph's fill as it is, on every platform.
|
|
1942
|
+
const own = isAppColor(color) ? color.value : undefined;
|
|
1943
|
+
if (live.length === 0)
|
|
1944
|
+
return own !== undefined
|
|
1945
|
+
? draw(icon, { fill: own, width: size, height: size, key })
|
|
1946
|
+
: draw(Painted, {
|
|
1947
|
+
host: icon,
|
|
1948
|
+
paint: iconPaint(color as ColorToken),
|
|
1949
|
+
width: size,
|
|
1950
|
+
height: size,
|
|
1951
|
+
key,
|
|
1952
|
+
});
|
|
1953
|
+
if (IS_WEB) {
|
|
1954
|
+
const out = cachedStyle(
|
|
1955
|
+
'host',
|
|
1956
|
+
`IC|${env.key}`,
|
|
1957
|
+
() => ({ color: ink(color) }),
|
|
1958
|
+
() => joinVariants(live.map(([condition, varied]) => [condition, { color: ink(varied) }])),
|
|
1959
|
+
);
|
|
1960
|
+
return drawHost(icon, out, { fill: 'currentColor', width: size, height: size, key });
|
|
1961
|
+
}
|
|
1962
|
+
let paint = iconVariantPaints.get(env.key);
|
|
1963
|
+
if (paint === undefined) {
|
|
1964
|
+
// A variant's ink is a role the leaf paints, or an app's own colour as it is.
|
|
1965
|
+
const fill = (varied: InkToken): Pick<PaintVariant, 'propRoles' | 'props'> => {
|
|
1966
|
+
if (isAppColor(varied)) return { props: { fill: varied.value } };
|
|
1967
|
+
const { role: name, opacity } = role(varied);
|
|
1968
|
+
return { propRoles: [opacity === undefined ? ['fill', name] : ['fill', name, opacity]] };
|
|
1969
|
+
};
|
|
1970
|
+
paint = {
|
|
1971
|
+
...(own === undefined
|
|
1972
|
+
? iconPaint(color as ColorToken)
|
|
1973
|
+
: { style: undefined, styleRoles: [], propRoles: [] }),
|
|
1974
|
+
variants: live.map(([condition, varied]) => ({
|
|
1975
|
+
condition,
|
|
1976
|
+
style: {},
|
|
1977
|
+
styleRoles: [],
|
|
1978
|
+
...fill(varied),
|
|
1979
|
+
})),
|
|
1980
|
+
};
|
|
1981
|
+
iconVariantPaints.set(env.key, paint);
|
|
1982
|
+
}
|
|
1983
|
+
// An app colour at rest is the glyph's own fill; a variant that holds paints over it.
|
|
1984
|
+
if (own !== undefined)
|
|
1985
|
+
return draw(Conditioned, { host: icon, paint, fill: own, width: size, height: size, key });
|
|
1986
|
+
return draw(Conditioned, { host: icon, paint, width: size, height: size, key });
|
|
1987
|
+
}
|
|
1988
|
+
|
|
1989
|
+
/** A stack's style: its layout, then its box (the innermost layer and its flex), with their variants. */
|
|
1990
|
+
function stackOut(
|
|
1991
|
+
p: Plan,
|
|
1992
|
+
axis: StackProps['axis'],
|
|
1993
|
+
layer: Layer | undefined,
|
|
1994
|
+
flex: string,
|
|
1995
|
+
marker: ListMarker | undefined,
|
|
1996
|
+
): StyleOut {
|
|
1997
|
+
const layout = {
|
|
1998
|
+
spacing: ownValue(p, 'spacing')?.value,
|
|
1999
|
+
childSpacing: ownValue(p, 'childSpacing')?.value,
|
|
2000
|
+
align: ownValue(p, 'align')?.value,
|
|
2001
|
+
justify: ownValue(p, 'justify')?.value,
|
|
2002
|
+
wrap: ownValue(p, 'wrap')?.value,
|
|
2003
|
+
axis: ownValue(p, 'axis')?.value,
|
|
2004
|
+
};
|
|
2005
|
+
const styleKey = `S|${axis}|${layout.spacing === undefined ? '' : tokenKey(layout.spacing)}|${ownValue(p, 'childSpacing')?.key ?? ''}|${layout.align ?? ''}|${layout.justify ?? ''}|${layout.wrap ?? ''}|${layout.axis ?? ''}|${marker ?? ''}|${hostVariantKey(p)}|${layer?.key ?? ''}|${flex}`;
|
|
2006
|
+
return cachedStyle(
|
|
2007
|
+
'host',
|
|
2008
|
+
styleKey,
|
|
2009
|
+
() => {
|
|
2010
|
+
// A layout variant that holds is the layout's own value.
|
|
2011
|
+
for (const [condition, modifier] of p.hostVariants) {
|
|
2012
|
+
if (condition === null)
|
|
2013
|
+
for (const [key, value] of Object.entries(layoutOf([modifier])))
|
|
2014
|
+
if (value !== undefined) (layout as Record<string, unknown>)[key] = value;
|
|
2015
|
+
}
|
|
2016
|
+
const style = Object.assign(stackStyle(axis, layout), boxStyle(layer, flex, p));
|
|
2017
|
+
if (marker !== undefined) style.listStyleType = marker;
|
|
2018
|
+
return style;
|
|
2019
|
+
},
|
|
2020
|
+
() => joinVariants(hostVariants(p), boxVariants(layer, flex, p)),
|
|
2021
|
+
);
|
|
2022
|
+
}
|
|
2023
|
+
|
|
2024
|
+
/**
|
|
2025
|
+
* A scroll view whose content is laid out in a view of its own
|
|
2026
|
+
* (`.contentView()`): Bloom's view inside the content container, styled as a
|
|
2027
|
+
* vertical stack of the content view's modifiers is (`stackOut`), which the
|
|
2028
|
+
* scroll view hands Bloom as that view's style.
|
|
2029
|
+
*/
|
|
2030
|
+
function drawScrollContent(
|
|
2031
|
+
modifiers: readonly Modifier[],
|
|
2032
|
+
props: Record<string, unknown>,
|
|
2033
|
+
children: readonly Child[],
|
|
2034
|
+
ctx: Context,
|
|
2035
|
+
): ReactElement {
|
|
2036
|
+
const content = plan(new Node('stack', CONTENT_VIEW, children, modifiers), ctx.env);
|
|
2037
|
+
if (content.layers.length > 1)
|
|
2038
|
+
throw new Error(
|
|
2039
|
+
'bloom-language: a scroll view’s content view is one view; give its modifiers in layer order (padding before frame)',
|
|
2040
|
+
);
|
|
2041
|
+
const out = stackOut(content, 'vertical', content.layers[0], flexKey(content), undefined);
|
|
2042
|
+
return drawHost(
|
|
2043
|
+
ScrollViewHost,
|
|
2044
|
+
out,
|
|
2045
|
+
{ ...props, contentView: true },
|
|
2046
|
+
...renderChildren(children, ctx),
|
|
2047
|
+
);
|
|
2048
|
+
}
|
|
2049
|
+
const CONTENT_VIEW: StackProps = { axis: 'vertical' };
|
|
2050
|
+
|
|
2051
|
+
/** The language's scrolls, each Bloom's own: the screen's, a scroll of its own, and one on a surface. */
|
|
2052
|
+
/** The lists whose content makes room for views pinned at their edges. */
|
|
2053
|
+
const INSET_LISTS: ReadonlySet<string> = new Set(['list', 'virtualList']);
|
|
2054
|
+
|
|
2055
|
+
const SCROLL_HOSTS = {
|
|
2056
|
+
scrollView: ScrollViewHost,
|
|
2057
|
+
scrollArea: ScrollAreaHost,
|
|
2058
|
+
scrollSurface: ScrollSurfaceHost,
|
|
2059
|
+
} as const;
|
|
2060
|
+
/** The states a control's glass varies with (`hovered`, `focused`, `pressed`), in no order. */
|
|
2061
|
+
function glassStates(layers: readonly Layer[]): LiveCondition[] {
|
|
2062
|
+
const states = new Set<LiveCondition>();
|
|
2063
|
+
for (const layer of layers) {
|
|
2064
|
+
if (layer.glass === undefined) continue;
|
|
2065
|
+
for (const [condition, modifier] of layer.variants) {
|
|
2066
|
+
if (condition === null || !GLASS_VARIES.has(modifier.kind)) continue;
|
|
2067
|
+
for (const term of termsOf(condition))
|
|
2068
|
+
if (STATES.has(term)) states.add(term as LiveCondition);
|
|
2069
|
+
}
|
|
2070
|
+
}
|
|
2071
|
+
return [...states];
|
|
2072
|
+
}
|
|
2073
|
+
|
|
2074
|
+
/** A Button and a FAB on a glass that varies with their state: each reports it to the box around the glass. */
|
|
2075
|
+
function ReportingButton(props: Record<string, unknown>): ReactElement {
|
|
2076
|
+
return draw(Reporting, { host: BloomButton, ...props });
|
|
2077
|
+
}
|
|
2078
|
+
function ReportingFab(props: Record<string, unknown>): ReactElement {
|
|
2079
|
+
return draw(Reporting, { host: BloomFab, ...props });
|
|
2080
|
+
}
|
|
2081
|
+
|
|
2082
|
+
function renderHost(
|
|
2083
|
+
node: Node,
|
|
2084
|
+
p: Plan,
|
|
2085
|
+
ctx: Context,
|
|
2086
|
+
layer: Layer | undefined,
|
|
2087
|
+
flex: string,
|
|
2088
|
+
behaviour: Record<string, unknown> | undefined,
|
|
2089
|
+
key: string | number | undefined,
|
|
2090
|
+
/** Placed in an `HStack` (the context the node is in, not the one its children are). */
|
|
2091
|
+
inRow: boolean,
|
|
2092
|
+
/** The node's outermost box when it moves and its host is it (see `Outermost`). */
|
|
2093
|
+
box: Outermost | undefined,
|
|
2094
|
+
): ReactElement {
|
|
2095
|
+
const layerKey = layer?.key ?? '';
|
|
2096
|
+
const boxOf = (target: Target, prefix: string): StyleOut =>
|
|
2097
|
+
cachedStyle(
|
|
2098
|
+
target,
|
|
2099
|
+
`${prefix}|${layerKey}|${flex}`,
|
|
2100
|
+
() => boxStyle(layer, flex, p),
|
|
2101
|
+
() => boxVariants(layer, flex, p),
|
|
2102
|
+
);
|
|
2103
|
+
// A box whose variants answer its state is drawn by a `StateHost` (drawHost).
|
|
2104
|
+
const boxed = layer !== undefined || flex !== '' || p.states.length > 0;
|
|
2105
|
+
|
|
2106
|
+
switch (node.kind) {
|
|
2107
|
+
case 'stack': {
|
|
2108
|
+
const { axis } = node.props as StackProps;
|
|
2109
|
+
// Web: an HTML list, each child a row behind the marker. Native has no markers.
|
|
2110
|
+
const marker = IS_WEB ? ownValue(p, 'listMarker')?.value : undefined;
|
|
2111
|
+
const out = stackOut(p, axis, layer, flex, marker);
|
|
2112
|
+
const row: Context = axis === 'horizontal' ? { ...ctx, inRow: true } : ctx;
|
|
2113
|
+
let children = renderChildren(node.children, row);
|
|
2114
|
+
if (marker !== undefined)
|
|
2115
|
+
children = children.map((child) =>
|
|
2116
|
+
Array.isArray(child) ? child.map(listItem) : listItem(child),
|
|
2117
|
+
);
|
|
2118
|
+
const wash = ownValue(p, 'hoverHighlight');
|
|
2119
|
+
if (wash !== undefined) {
|
|
2120
|
+
// A coordinated highlight (`active` given) shows on every platform; the pointer's only on the web.
|
|
2121
|
+
children.unshift(
|
|
2122
|
+
draw(SubtleHover, wash.value === undefined ? {} : { active: wash.value, native: true }),
|
|
2123
|
+
);
|
|
2124
|
+
}
|
|
2125
|
+
const host = behaviour ? hostFor(p) : View;
|
|
2126
|
+
const props = hostProps(behaviour, key);
|
|
2127
|
+
if (marker !== undefined) props.role = 'list';
|
|
2128
|
+
return drawOutermost(box, host, out, props, ...children);
|
|
2129
|
+
}
|
|
2130
|
+
case 'zstack': {
|
|
2131
|
+
const out = cachedStyle(
|
|
2132
|
+
'host',
|
|
2133
|
+
`Z|${layerKey}|${flex}`,
|
|
2134
|
+
() => Object.assign({ position: 'relative' }, boxStyle(layer, flex, p)),
|
|
2135
|
+
() => boxVariants(layer, flex, p),
|
|
2136
|
+
);
|
|
2137
|
+
const children: ReactNode[] = [
|
|
2138
|
+
draw(DepthStack, {
|
|
2139
|
+
alignment: ownValue(p, 'alignment')?.value ?? 'center',
|
|
2140
|
+
children: renderChildren(node.children, ctx),
|
|
2141
|
+
}),
|
|
2142
|
+
];
|
|
2143
|
+
const wash = ownValue(p, 'hoverHighlight');
|
|
2144
|
+
if (wash !== undefined) {
|
|
2145
|
+
children.unshift(
|
|
2146
|
+
draw(SubtleHover, wash.value === undefined ? {} : { active: wash.value, native: true }),
|
|
2147
|
+
);
|
|
2148
|
+
}
|
|
2149
|
+
return drawOutermost(
|
|
2150
|
+
box,
|
|
2151
|
+
behaviour ? hostFor(p) : View,
|
|
2152
|
+
out,
|
|
2153
|
+
hostProps(behaviour, key),
|
|
2154
|
+
...children,
|
|
2155
|
+
);
|
|
2156
|
+
}
|
|
2157
|
+
case 'spacer': {
|
|
2158
|
+
const out = cachedStyle(
|
|
2159
|
+
'host',
|
|
2160
|
+
`SP|${layerKey}|${flex}`,
|
|
2161
|
+
() => Object.assign({ flex: 1 }, boxStyle(layer, flex, p)),
|
|
2162
|
+
() => boxVariants(layer, flex, p),
|
|
2163
|
+
);
|
|
2164
|
+
return drawOutermost(box, behaviour ? hostFor(p) : View, out, hostProps(behaviour, key));
|
|
2165
|
+
}
|
|
2166
|
+
case 'text':
|
|
2167
|
+
return drawText(
|
|
2168
|
+
node,
|
|
2169
|
+
p,
|
|
2170
|
+
ctx,
|
|
2171
|
+
layerKey,
|
|
2172
|
+
flex,
|
|
2173
|
+
() => boxStyle(layer, flex, p),
|
|
2174
|
+
() => boxVariants(layer, flex, p),
|
|
2175
|
+
behaviour,
|
|
2176
|
+
key,
|
|
2177
|
+
box,
|
|
2178
|
+
);
|
|
2179
|
+
case 'icon': {
|
|
2180
|
+
const size = resolveIconSize(
|
|
2181
|
+
(ownValue(p, 'size')?.value as IconSizeToken | undefined) ?? 'md',
|
|
2182
|
+
);
|
|
2183
|
+
const bare = !boxed && !behaviour;
|
|
2184
|
+
const glyph = iconGlyph(
|
|
2185
|
+
(node.props as IconProps).icon,
|
|
2186
|
+
ctx.env,
|
|
2187
|
+
size,
|
|
2188
|
+
bare ? key : undefined,
|
|
2189
|
+
);
|
|
2190
|
+
if (bare) return glyph;
|
|
2191
|
+
const host = behaviour ? hostFor(p) : View;
|
|
2192
|
+
return drawOutermost(box, host, boxOf('host', 'I'), hostProps(behaviour, key), glyph);
|
|
2193
|
+
}
|
|
2194
|
+
case 'avatar': {
|
|
2195
|
+
const { source, options } = node.props as AvatarProps;
|
|
2196
|
+
const size = ownValue(p, 'size')?.value as AvatarSizeToken | undefined;
|
|
2197
|
+
const presence = ownValue(p, 'presence')?.value;
|
|
2198
|
+
const props = hostProps(behaviour, key);
|
|
2199
|
+
delete props.focusable;
|
|
2200
|
+
// An avatar's name is its `alt`, as Bloom's Avatar takes it.
|
|
2201
|
+
if (props.accessibilityLabel !== undefined) {
|
|
2202
|
+
props.alt = props.accessibilityLabel;
|
|
2203
|
+
delete props.accessibilityLabel;
|
|
2204
|
+
}
|
|
2205
|
+
Object.assign(props, {
|
|
2206
|
+
source,
|
|
2207
|
+
variant: options.variant,
|
|
2208
|
+
account: options.account,
|
|
2209
|
+
name: options.name,
|
|
2210
|
+
initials: options.initials,
|
|
2211
|
+
fallbackSource: options.fallbackSource,
|
|
2212
|
+
character: options.character,
|
|
2213
|
+
size: size === undefined ? undefined : resolveAvatarSize(size),
|
|
2214
|
+
color: ownValue(p, 'tint')?.value,
|
|
2215
|
+
shape: ownValue(p, 'shape')?.value,
|
|
2216
|
+
verified: ownValue(p, 'verified')?.value,
|
|
2217
|
+
live: ownValue(p, 'live')?.value,
|
|
2218
|
+
hideLiveBadge: ownValue(p, 'liveBadge')?.value === false ? true : undefined,
|
|
2219
|
+
status: presence,
|
|
2220
|
+
});
|
|
2221
|
+
const host = presence === undefined ? BloomAvatar : AvatarPresence;
|
|
2222
|
+
if (!boxed) return draw(host, props);
|
|
2223
|
+
return drawHost(host, boxOf('component', 'A'), props);
|
|
2224
|
+
}
|
|
2225
|
+
case 'avatarGroup': {
|
|
2226
|
+
const size = ownValue(p, 'size')?.value as AvatarSizeToken | undefined;
|
|
2227
|
+
const spacing = ownValue(p, 'spacing')?.value;
|
|
2228
|
+
return pressAround(p, behaviour, key, (props) => {
|
|
2229
|
+
Object.assign(props, {
|
|
2230
|
+
items: (node.props as AvatarGroupProps).items,
|
|
2231
|
+
layout: ownValue(p, 'layout')?.value,
|
|
2232
|
+
size: size === undefined ? undefined : resolveAvatarSize(size),
|
|
2233
|
+
shape: ownValue(p, 'shape')?.value,
|
|
2234
|
+
max: ownValue(p, 'max')?.value,
|
|
2235
|
+
total: ownValue(p, 'total')?.value,
|
|
2236
|
+
spacing: spacing === undefined ? undefined : resolveSpace(spacing),
|
|
2237
|
+
overflow: ownValue(p, 'overflow')?.value,
|
|
2238
|
+
showInitials: ownValue(p, 'initials') === undefined ? undefined : true,
|
|
2239
|
+
onPressItem: ownValue(p, 'onPressItem')?.value,
|
|
2240
|
+
hoverCard: ownValue(p, 'hoverCard')?.value,
|
|
2241
|
+
});
|
|
2242
|
+
if (!boxed) return draw(BloomAvatarGroup, props);
|
|
2243
|
+
return drawHost(BloomAvatarGroup, boxOf('component', 'AG'), props);
|
|
2244
|
+
});
|
|
2245
|
+
}
|
|
2246
|
+
case 'badge':
|
|
2247
|
+
return pressAround(p, behaviour, key, (own) => {
|
|
2248
|
+
const props = { ...own, ...badgeProps(node, p) };
|
|
2249
|
+
if (!boxed) return draw(BloomBadge, props);
|
|
2250
|
+
return drawHost(BloomBadge, boxOf('component', 'BD'), props);
|
|
2251
|
+
});
|
|
2252
|
+
case 'iconCircle':
|
|
2253
|
+
return pressAround(p, behaviour, key, (props) => {
|
|
2254
|
+
props.icon = (node.props as IconProps).icon;
|
|
2255
|
+
props.size = ownValue(p, 'size')?.value;
|
|
2256
|
+
if (!boxed) return draw(BloomIconCircle, props);
|
|
2257
|
+
return drawHost(BloomIconCircle, boxOf('component', 'IC'), props);
|
|
2258
|
+
});
|
|
2259
|
+
case 'loading': {
|
|
2260
|
+
const { label } = buttonContent(node.children);
|
|
2261
|
+
return pressAround(p, behaviour, key, (props) => {
|
|
2262
|
+
Object.assign(props, {
|
|
2263
|
+
variant: ownValue(p, 'style')?.value,
|
|
2264
|
+
size: ownValue(p, 'size')?.value,
|
|
2265
|
+
tone: ownValue(p, 'tint')?.value,
|
|
2266
|
+
text: label,
|
|
2267
|
+
});
|
|
2268
|
+
if (!boxed) return draw(BloomLoading, props);
|
|
2269
|
+
return drawHost(BloomLoading, boxOf('component', 'LD'), props);
|
|
2270
|
+
});
|
|
2271
|
+
}
|
|
2272
|
+
case 'skeleton':
|
|
2273
|
+
// Drawn in drawNode: a skeleton takes its frame and corner as its size.
|
|
2274
|
+
return null as unknown as ReactElement;
|
|
2275
|
+
case 'skeletonGroup':
|
|
2276
|
+
return drawContainer(
|
|
2277
|
+
BloomSkeleton.Region,
|
|
2278
|
+
{ label: p.label },
|
|
2279
|
+
node,
|
|
2280
|
+
p,
|
|
2281
|
+
ctx,
|
|
2282
|
+
boxOf('component', 'SR'),
|
|
2283
|
+
behaviour === undefined ? undefined : withoutLabel(behaviour),
|
|
2284
|
+
key,
|
|
2285
|
+
);
|
|
2286
|
+
case 'image': {
|
|
2287
|
+
// BloomImage takes the box itself, so the frame sizes the image and the
|
|
2288
|
+
// corner clips it. It cannot take presses: a pressable image (or a hover
|
|
2289
|
+
// group) is drawn inside its pressable host, which takes the flex placement.
|
|
2290
|
+
const interactive = p.pressable || p.hoverGroup;
|
|
2291
|
+
const imageFlex = interactive ? '' : flex;
|
|
2292
|
+
const aspectRatio = ownValue(p, 'aspectRatio')?.value;
|
|
2293
|
+
const styleKey = `IM|${aspectRatio ?? ''}|${layerKey}|${imageFlex}`;
|
|
2294
|
+
const out = cachedStyle(
|
|
2295
|
+
'component',
|
|
2296
|
+
styleKey,
|
|
2297
|
+
() => {
|
|
2298
|
+
const style = boxStyle(layer, imageFlex, p);
|
|
2299
|
+
if (aspectRatio !== undefined) style.aspectRatio = aspectRatio;
|
|
2300
|
+
return style;
|
|
2301
|
+
},
|
|
2302
|
+
() => boxVariants(layer, imageFlex, p),
|
|
2303
|
+
);
|
|
2304
|
+
const { source, alt } = node.props as ImageProps;
|
|
2305
|
+
const crossFade = ownValue(p, 'crossFade')?.value;
|
|
2306
|
+
const props: Record<string, unknown> = interactive ? {} : hostProps(behaviour, key);
|
|
2307
|
+
Object.assign(props, {
|
|
2308
|
+
source,
|
|
2309
|
+
alt,
|
|
2310
|
+
contentFit: ownValue(p, 'contentFit')?.value,
|
|
2311
|
+
transition: crossFade === undefined ? undefined : DURATION[crossFade],
|
|
2312
|
+
onLoad: ownValue(p, 'onLoad')?.value,
|
|
2313
|
+
onError: ownValue(p, 'onError')?.value,
|
|
2314
|
+
});
|
|
2315
|
+
const tint = ownValue(p, 'tint')?.value as ColorName | undefined;
|
|
2316
|
+
const image = drawHost(
|
|
2317
|
+
BloomImage,
|
|
2318
|
+
tint === undefined ? out : painted(out, propPaint(styleKey, out, 'tintColor', tint)),
|
|
2319
|
+
props,
|
|
2320
|
+
);
|
|
2321
|
+
if (!interactive) return image;
|
|
2322
|
+
const placement = cachedStyle('host', `IMP|${flex}`, () => boxStyle(undefined, flex, p));
|
|
2323
|
+
return drawOutermost(box, hostFor(p), placement, hostProps(behaviour, key), image);
|
|
2324
|
+
}
|
|
2325
|
+
case 'button': {
|
|
2326
|
+
const props = hostProps(behaviour, key);
|
|
2327
|
+
delete props.focusable;
|
|
2328
|
+
const { icon, glyph, label, trailing } = buttonContent(node.children);
|
|
2329
|
+
const shape = ownValue(p, 'shape')?.value;
|
|
2330
|
+
const iconOnly =
|
|
2331
|
+
icon !== undefined && label === undefined && shape !== undefined && shape !== 'fit';
|
|
2332
|
+
// A glyph in an ink of its own (`Icon(X).foreground(role)`) is drawn as
|
|
2333
|
+
// it is; otherwise the button tints its icon with its tone.
|
|
2334
|
+
const inked = glyph?.modifiers.some((modifier) => modifier.kind === 'foreground');
|
|
2335
|
+
Object.assign(props, {
|
|
2336
|
+
appearance: ownValue(p, 'style')?.value,
|
|
2337
|
+
tone: ownValue(p, 'tint')?.value,
|
|
2338
|
+
size: ownValue(p, 'size')?.value,
|
|
2339
|
+
leadingIcon: inked ? undefined : icon,
|
|
2340
|
+
icon: inked && glyph ? renderNode(glyph, ctx, undefined) : undefined,
|
|
2341
|
+
trailingIcon: trailing,
|
|
2342
|
+
// A circle is Bloom's square icon button; a pill, its wide one; fit
|
|
2343
|
+
// grows with its content, never narrower than it is tall.
|
|
2344
|
+
iconOnly: iconOnly ? true : undefined,
|
|
2345
|
+
wide: iconOnly && shape === 'pill' ? true : undefined,
|
|
2346
|
+
grow: shape === 'fit' ? true : undefined,
|
|
2347
|
+
linkTone: ownValue(p, 'linkTone')?.value,
|
|
2348
|
+
inverted: ownValue(p, 'inverted')?.value,
|
|
2349
|
+
density: ownValue(p, 'density')?.value,
|
|
2350
|
+
children: label,
|
|
2351
|
+
disabled: ownValue(p, 'disabled')?.value,
|
|
2352
|
+
loading: ownValue(p, 'loading')?.value,
|
|
2353
|
+
pressed: ownValue(p, 'pressed')?.value,
|
|
2354
|
+
href: ownValue(p, 'link')?.value,
|
|
2355
|
+
numberOfLines: ownValue(p, 'lines')?.value,
|
|
2356
|
+
underline: ownValue(p, 'underline') === undefined ? undefined : 'rest',
|
|
2357
|
+
material: p.control || ctx.env.island ? 'shared' : undefined,
|
|
2358
|
+
});
|
|
2359
|
+
const colors = ownValue(p, 'colors')?.value;
|
|
2360
|
+
if (colors !== undefined) {
|
|
2361
|
+
// A paired fill and label, painted from their roles: Bloom's `colors`.
|
|
2362
|
+
const out = boxOf('component', 'B');
|
|
2363
|
+
return drawHost(
|
|
2364
|
+
PairedButton,
|
|
2365
|
+
painted(out, pairPaint(`B|${layerKey}|${flex}`, out, colors)),
|
|
2366
|
+
props,
|
|
2367
|
+
);
|
|
2368
|
+
}
|
|
2369
|
+
const button = p.control?.reports.length ? ReportingButton : BloomButton;
|
|
2370
|
+
if (button === ReportingButton) props.reports = p.control?.reports;
|
|
2371
|
+
if (!boxed) return draw(button, props);
|
|
2372
|
+
return drawHost(button, boxOf('component', 'B'), props);
|
|
2373
|
+
}
|
|
2374
|
+
case 'shape': {
|
|
2375
|
+
// A silhouette at a fixed side takes no style: its box is a view around it.
|
|
2376
|
+
const { name } = node.props as ShapeProps;
|
|
2377
|
+
const size = resolveSpace(
|
|
2378
|
+
(ownValue(p, 'size')?.value as SpaceToken | undefined) ?? SHAPE_SIDE,
|
|
2379
|
+
);
|
|
2380
|
+
const drawn = shapeElement(node, name, size, behaviour || boxed ? undefined : key);
|
|
2381
|
+
if (!boxed && !behaviour) return drawn;
|
|
2382
|
+
const host = behaviour ? hostFor(p) : View;
|
|
2383
|
+
return drawHost(host, boxOf('host', 'SH'), hostProps(behaviour, key), drawn);
|
|
2384
|
+
}
|
|
2385
|
+
case 'buttonGroup': {
|
|
2386
|
+
const children = renderChildren(node.children, ctx);
|
|
2387
|
+
return pressAround(p, behaviour, key, (props) => {
|
|
2388
|
+
if (props.accessibilityLabel === undefined) delete props.accessibilityLabel;
|
|
2389
|
+
Object.assign(props, {
|
|
2390
|
+
orientation: ownValue(p, 'axis')?.value,
|
|
2391
|
+
size: ownValue(p, 'size')?.value,
|
|
2392
|
+
dividers: ownValue(p, 'dividers')?.value,
|
|
2393
|
+
separated: ownValue(p, 'separated')?.value,
|
|
2394
|
+
material: groupMaterial(ownValue(p, 'glass')?.value),
|
|
2395
|
+
});
|
|
2396
|
+
if (!boxed) return draw(BloomButton.Group, props, ...children);
|
|
2397
|
+
return drawHost(BloomButton.Group, boxOf('component', 'BG'), props, ...children);
|
|
2398
|
+
});
|
|
2399
|
+
}
|
|
2400
|
+
case 'fab': {
|
|
2401
|
+
const props = hostProps(behaviour, key);
|
|
2402
|
+
delete props.focusable;
|
|
2403
|
+
const { icon, label } = buttonContent(node.children);
|
|
2404
|
+
Object.assign(props, {
|
|
2405
|
+
appearance: ownValue(p, 'style')?.value,
|
|
2406
|
+
tone: ownValue(p, 'tint')?.value,
|
|
2407
|
+
size: ownValue(p, 'size')?.value,
|
|
2408
|
+
icon,
|
|
2409
|
+
label,
|
|
2410
|
+
disabled: ownValue(p, 'disabled')?.value,
|
|
2411
|
+
collapsed: ownValue(p, 'collapsed')?.value,
|
|
2412
|
+
material: p.control || ctx.env.island ? 'shared' : undefined,
|
|
2413
|
+
});
|
|
2414
|
+
const fab = p.control?.reports.length ? ReportingFab : BloomFab;
|
|
2415
|
+
if (fab === ReportingFab) props.reports = p.control?.reports;
|
|
2416
|
+
if (!boxed) return draw(fab, props);
|
|
2417
|
+
return drawHost(fab, boxOf('component', 'F'), props);
|
|
2418
|
+
}
|
|
2419
|
+
case 'menu': {
|
|
2420
|
+
const menu = draw(MenuHost, {
|
|
2421
|
+
key: boxed ? undefined : key,
|
|
2422
|
+
trigger: namedTrigger((node.props as MenuProps).trigger, p.label),
|
|
2423
|
+
rows: node.children,
|
|
2424
|
+
actions: ownValue(p, 'actions')?.value,
|
|
2425
|
+
label: p.label,
|
|
2426
|
+
testID: p.testID,
|
|
2427
|
+
render: (child: Child) => renderChild(child, ctx, undefined),
|
|
2428
|
+
});
|
|
2429
|
+
if (!boxed) return menu;
|
|
2430
|
+
return drawHost(View, boxOf('host', 'M'), hostProps(undefined, key), menu);
|
|
2431
|
+
}
|
|
2432
|
+
case 'header':
|
|
2433
|
+
return draw(HeaderHost, {
|
|
2434
|
+
key,
|
|
2435
|
+
node,
|
|
2436
|
+
render: (child: Child) => renderChild(child, ctx, undefined),
|
|
2437
|
+
press: (value: Press | undefined) => pressOf(value, ctx.env),
|
|
2438
|
+
});
|
|
2439
|
+
case 'bottomBar':
|
|
2440
|
+
return draw(BottomBarHost, {
|
|
2441
|
+
key,
|
|
2442
|
+
node,
|
|
2443
|
+
render: (child: Child) => renderChild(child, ctx, undefined),
|
|
2444
|
+
press: (value: Press | undefined) => pressOf(value, ctx.env),
|
|
2445
|
+
});
|
|
2446
|
+
case 'scrollView':
|
|
2447
|
+
case 'scrollArea':
|
|
2448
|
+
case 'scrollSurface': {
|
|
2449
|
+
const props = {
|
|
2450
|
+
key: boxed ? undefined : key,
|
|
2451
|
+
node,
|
|
2452
|
+
render: (child: Child) => renderChild(child, ctx, undefined),
|
|
2453
|
+
press: (value: Press | undefined) => pressOf(value, ctx.env),
|
|
2454
|
+
};
|
|
2455
|
+
const content = node.kind === 'scrollView' ? ownValue(p, 'contentView') : undefined;
|
|
2456
|
+
// The content's children keep their places as a stack's do.
|
|
2457
|
+
const host = SCROLL_HOSTS[node.kind];
|
|
2458
|
+
const scroll = (room?: InsetRoom) =>
|
|
2459
|
+
content === undefined
|
|
2460
|
+
? draw(host, { ...props, room }, ...renderChildren(node.children, ctx))
|
|
2461
|
+
: drawScrollContent(content.modifiers, { ...props, room }, node.children, ctx);
|
|
2462
|
+
// Views pinned at its edges: the content makes room for them (SwiftUI's safe area insets).
|
|
2463
|
+
const insets = insetsOf(node);
|
|
2464
|
+
const scroller =
|
|
2465
|
+
insets.length === 0
|
|
2466
|
+
? scroll()
|
|
2467
|
+
: draw(SafeAreaInsets, {
|
|
2468
|
+
key: boxed ? undefined : key,
|
|
2469
|
+
insets,
|
|
2470
|
+
render: props.render,
|
|
2471
|
+
scroller: scroll,
|
|
2472
|
+
});
|
|
2473
|
+
// Box modifiers are a view around the scroller, as SwiftUI's.
|
|
2474
|
+
if (!boxed) return scroller;
|
|
2475
|
+
return drawHost(View, boxOf('host', 'SV'), hostProps(undefined, key), scroller);
|
|
2476
|
+
}
|
|
2477
|
+
// Rows and tabs are read by the menu or the bar that holds them; on their own they draw nothing.
|
|
2478
|
+
case 'menuItem':
|
|
2479
|
+
case 'menuSubmenu':
|
|
2480
|
+
case 'menuSection':
|
|
2481
|
+
case 'menuContent':
|
|
2482
|
+
case 'menuActions':
|
|
2483
|
+
case 'tab':
|
|
2484
|
+
// A bottom sheet is a `.sheet()`'s content, drawn by the sheet that presents it.
|
|
2485
|
+
case 'bottomSheet':
|
|
2486
|
+
// A sidebar's and a rail's rows are read by the column that holds them.
|
|
2487
|
+
case 'navItem':
|
|
2488
|
+
case 'sidebarMode':
|
|
2489
|
+
case 'treeSection':
|
|
2490
|
+
case 'treeFolder':
|
|
2491
|
+
case 'treeItem':
|
|
2492
|
+
case 'railItem':
|
|
2493
|
+
case 'commandItem':
|
|
2494
|
+
case 'commandGroup':
|
|
2495
|
+
case 'settingsGroup':
|
|
2496
|
+
case 'settingsItem':
|
|
2497
|
+
// An app layout's panels and destinations are read by the layout.
|
|
2498
|
+
case 'panel':
|
|
2499
|
+
case 'destination':
|
|
2500
|
+
return null as unknown as ReactElement;
|
|
2501
|
+
case 'command':
|
|
2502
|
+
return draw(CommandHost, {
|
|
2503
|
+
key,
|
|
2504
|
+
node,
|
|
2505
|
+
render: (child: Child) => renderChild(child, ctx, undefined),
|
|
2506
|
+
press: (value: Press | undefined) => pressOf(value, ctx.env),
|
|
2507
|
+
});
|
|
2508
|
+
case 'toolbarView':
|
|
2509
|
+
return draw(
|
|
2510
|
+
ToolbarHost,
|
|
2511
|
+
{
|
|
2512
|
+
key,
|
|
2513
|
+
node,
|
|
2514
|
+
render: (child: Child) => renderChild(child, ctx, undefined),
|
|
2515
|
+
press: (value: Press | undefined) => pressOf(value, ctx.env),
|
|
2516
|
+
},
|
|
2517
|
+
...renderChildren(node.children, ctx),
|
|
2518
|
+
);
|
|
2519
|
+
case 'autoHideBar':
|
|
2520
|
+
return draw(
|
|
2521
|
+
AutoHideBarHost,
|
|
2522
|
+
{
|
|
2523
|
+
key,
|
|
2524
|
+
node,
|
|
2525
|
+
render: (child: Child) => renderChild(child, ctx, undefined),
|
|
2526
|
+
press: (value: Press | undefined) => pressOf(value, ctx.env),
|
|
2527
|
+
},
|
|
2528
|
+
...renderChildren(node.children, ctx),
|
|
2529
|
+
);
|
|
2530
|
+
case 'resizeHandle':
|
|
2531
|
+
return draw(ResizeHandleHost, {
|
|
2532
|
+
key,
|
|
2533
|
+
node,
|
|
2534
|
+
render: (child: Child) => renderChild(child, ctx, undefined),
|
|
2535
|
+
press: (value: Press | undefined) => pressOf(value, ctx.env),
|
|
2536
|
+
});
|
|
2537
|
+
case 'stickySection':
|
|
2538
|
+
return draw(
|
|
2539
|
+
StickySectionHost,
|
|
2540
|
+
{
|
|
2541
|
+
key,
|
|
2542
|
+
node,
|
|
2543
|
+
render: (child: Child) => renderChild(child, ctx, undefined),
|
|
2544
|
+
press: (value: Press | undefined) => pressOf(value, ctx.env),
|
|
2545
|
+
},
|
|
2546
|
+
...renderChildren(node.children, ctx),
|
|
2547
|
+
);
|
|
2548
|
+
case 'settings':
|
|
2549
|
+
return draw(SettingsHost, {
|
|
2550
|
+
key,
|
|
2551
|
+
node,
|
|
2552
|
+
render: (child: Child) => renderChild(child, ctx, undefined),
|
|
2553
|
+
press: (value: Press | undefined) => pressOf(value, ctx.env),
|
|
2554
|
+
});
|
|
2555
|
+
case 'sidebar':
|
|
2556
|
+
return draw(SidebarHost, {
|
|
2557
|
+
key,
|
|
2558
|
+
node,
|
|
2559
|
+
render: (child: Child) => renderChild(child, ctx, undefined),
|
|
2560
|
+
press: (value: Press | undefined) => pressOf(value, ctx.env),
|
|
2561
|
+
});
|
|
2562
|
+
case 'rail':
|
|
2563
|
+
return draw(RailHost, {
|
|
2564
|
+
key,
|
|
2565
|
+
node,
|
|
2566
|
+
render: (child: Child) => renderChild(child, ctx, undefined),
|
|
2567
|
+
press: (value: Press | undefined) => pressOf(value, ctx.env),
|
|
2568
|
+
});
|
|
2569
|
+
case 'pageFooter':
|
|
2570
|
+
return draw(
|
|
2571
|
+
PageFooterHost,
|
|
2572
|
+
{
|
|
2573
|
+
key,
|
|
2574
|
+
node,
|
|
2575
|
+
render: (child: Child) => renderChild(child, ctx, undefined),
|
|
2576
|
+
press: (value: Press | undefined) => pressOf(value, ctx.env),
|
|
2577
|
+
},
|
|
2578
|
+
...renderChildren(node.children, ctx),
|
|
2579
|
+
);
|
|
2580
|
+
// Navigators are drawn by the router's layout(); placed in a view, they draw nothing.
|
|
2581
|
+
case 'appLayout':
|
|
2582
|
+
case 'navStack':
|
|
2583
|
+
case 'route':
|
|
2584
|
+
case 'tabView':
|
|
2585
|
+
return null as unknown as ReactElement;
|
|
2586
|
+
case 'divider': {
|
|
2587
|
+
const tint = ownValue(p, 'tint')?.value as ColorName | undefined;
|
|
2588
|
+
const spacing = ownValue(p, 'spacing')?.value;
|
|
2589
|
+
const [label] = node.children;
|
|
2590
|
+
const content = dividerLabel(label, ctx);
|
|
2591
|
+
const out = boxOf('component', 'DV');
|
|
2592
|
+
return pressAround(p, behaviour, key, (props) => {
|
|
2593
|
+
Object.assign(props, {
|
|
2594
|
+
variant: ownValue(p, 'lineStyle')?.value,
|
|
2595
|
+
align: ownValue(p, 'align')?.value,
|
|
2596
|
+
vertical: inRow || undefined,
|
|
2597
|
+
spacing: spacing === undefined ? undefined : resolveSpace(spacing),
|
|
2598
|
+
});
|
|
2599
|
+
return drawHost(
|
|
2600
|
+
BloomDivider,
|
|
2601
|
+
tint === undefined
|
|
2602
|
+
? out
|
|
2603
|
+
: painted(out, propPaint(`DV|${layerKey}|${flex}`, out, 'color', tint)),
|
|
2604
|
+
props,
|
|
2605
|
+
content,
|
|
2606
|
+
);
|
|
2607
|
+
});
|
|
2608
|
+
}
|
|
2609
|
+
case 'fill':
|
|
2610
|
+
return drawContainer(BloomFill, {}, node, p, ctx, boxOf('component', 'FL'), behaviour, key);
|
|
2611
|
+
case 'ratio':
|
|
2612
|
+
return drawContainer(
|
|
2613
|
+
BloomAspectRatio,
|
|
2614
|
+
{ ratio: (node.props as { ratio: number }).ratio },
|
|
2615
|
+
node,
|
|
2616
|
+
p,
|
|
2617
|
+
ctx,
|
|
2618
|
+
boxOf('component', 'AR'),
|
|
2619
|
+
behaviour,
|
|
2620
|
+
key,
|
|
2621
|
+
);
|
|
2622
|
+
case 'grid': {
|
|
2623
|
+
const gap = ownValue(p, 'spacing')?.value;
|
|
2624
|
+
const minWidth = ownValue(p, 'minCellWidth')?.value;
|
|
2625
|
+
return drawContainer(
|
|
2626
|
+
ResponsiveGrid,
|
|
2627
|
+
{
|
|
2628
|
+
maxColumns: ownValue(p, 'columns')?.value,
|
|
2629
|
+
minItemWidth: minWidth === undefined ? undefined : resolveSpace(minWidth),
|
|
2630
|
+
gap: gap === undefined ? undefined : resolveSpace(gap),
|
|
2631
|
+
flow: ownValue(p, 'flow')?.value,
|
|
2632
|
+
stretchItems: ownValue(p, 'stretchItems')?.value,
|
|
2633
|
+
},
|
|
2634
|
+
node,
|
|
2635
|
+
p,
|
|
2636
|
+
ctx,
|
|
2637
|
+
boxOf('component', 'G'),
|
|
2638
|
+
behaviour,
|
|
2639
|
+
key,
|
|
2640
|
+
);
|
|
2641
|
+
}
|
|
2642
|
+
case 'action': {
|
|
2643
|
+
const { icon, label, options } = node.props as ActionProps;
|
|
2644
|
+
const props: Record<string, unknown> = {
|
|
2645
|
+
key,
|
|
2646
|
+
icon,
|
|
2647
|
+
activeIcon: options.activeIcon,
|
|
2648
|
+
accessibilityLabel: label,
|
|
2649
|
+
accessibilityHint: p.hint,
|
|
2650
|
+
count: ownValue(p, 'count')?.value,
|
|
2651
|
+
active: ownValue(p, 'active')?.value,
|
|
2652
|
+
tone: ownValue(p, 'tint')?.value,
|
|
2653
|
+
onPress: p.onPress,
|
|
2654
|
+
onLongPress: p.onLongPress,
|
|
2655
|
+
popOnActivate: options.pop,
|
|
2656
|
+
rollCount: options.rollCount,
|
|
2657
|
+
busy: options.busy,
|
|
2658
|
+
hitSlop: options.hitSlop,
|
|
2659
|
+
accessibilityActions: options.accessibilityActions,
|
|
2660
|
+
onAccessibilityAction: options.onAccessibilityAction,
|
|
2661
|
+
testID: p.testID,
|
|
2662
|
+
};
|
|
2663
|
+
// The action's own pressable takes its press, hover and focus, which its box tracks for its state variants.
|
|
2664
|
+
if (behaviour !== undefined && STATEFUL in behaviour) props[STATEFUL] = behaviour[STATEFUL];
|
|
2665
|
+
if (!boxed) return draw(EngagementAction, props);
|
|
2666
|
+
return drawHost(EngagementAction, boxOf('component', 'EA'), props);
|
|
2667
|
+
}
|
|
2668
|
+
case 'actionBar': {
|
|
2669
|
+
const trailing = ownValue(p, 'trailing')?.value;
|
|
2670
|
+
const props: Record<string, unknown> = {
|
|
2671
|
+
key,
|
|
2672
|
+
testID: p.testID,
|
|
2673
|
+
size: ownValue(p, 'size')?.value,
|
|
2674
|
+
orientation: ownValue(p, 'axis')?.value,
|
|
2675
|
+
tone: ownValue(p, 'tint')?.value,
|
|
2676
|
+
showZeroCounts: ownValue(p, 'showZeroCounts')?.value,
|
|
2677
|
+
formatCount: ownValue(p, 'countFormat')?.value,
|
|
2678
|
+
trailing: trailing ? renderChildren(trailing, ctx) : undefined,
|
|
2679
|
+
};
|
|
2680
|
+
const children = renderChildren(node.children, ctx);
|
|
2681
|
+
if (!boxed) return draw(EngagementBar, props, ...children);
|
|
2682
|
+
return drawHost(EngagementBar, boxOf('component', 'AB'), props, ...children);
|
|
2683
|
+
}
|
|
2684
|
+
case 'actionGroup': {
|
|
2685
|
+
const props: Record<string, unknown> = { key, testID: p.testID };
|
|
2686
|
+
const children = renderChildren(node.children, ctx);
|
|
2687
|
+
if (!boxed) return draw(EngagementGroup, props, ...children);
|
|
2688
|
+
return drawHost(EngagementGroup, boxOf('component', 'AG'), props, ...children);
|
|
2689
|
+
}
|
|
2690
|
+
case 'embed': {
|
|
2691
|
+
const { content } = node.props as EmbedProps;
|
|
2692
|
+
const element =
|
|
2693
|
+
typeof content === 'function'
|
|
2694
|
+
? content((child) => renderChild(child, ctx, undefined))
|
|
2695
|
+
: content;
|
|
2696
|
+
if (!boxed && !behaviour) {
|
|
2697
|
+
return key === undefined ? (element as ReactElement) : draw(Fragment, { key }, element);
|
|
2698
|
+
}
|
|
2699
|
+
const host = behaviour ? hostFor(p) : View;
|
|
2700
|
+
return drawOutermost(box, host, boxOf('host', 'E'), hostProps(behaviour, key), element);
|
|
2701
|
+
}
|
|
2702
|
+
case 'lottie': {
|
|
2703
|
+
const { source } = node.props as LottieProps;
|
|
2704
|
+
const fallback = ownValue(p, 'fallback')?.value;
|
|
2705
|
+
const still =
|
|
2706
|
+
isNode(fallback) && fallback.kind === 'image' ? (fallback.props as ImageProps) : undefined;
|
|
2707
|
+
const frame = layer?.modifiers.find((modifier) => modifier.kind === 'frame') as
|
|
2708
|
+
| Extract<Modifier, { kind: 'frame' }>
|
|
2709
|
+
| undefined;
|
|
2710
|
+
const width = frame?.value.width;
|
|
2711
|
+
const edge = width === undefined ? undefined : resolveLength(width);
|
|
2712
|
+
// A frame that only sets the square's edge is the sticker's size, not a box around it.
|
|
2713
|
+
const sized =
|
|
2714
|
+
layer !== undefined &&
|
|
2715
|
+
layer.variants.length === 0 &&
|
|
2716
|
+
flex === '' &&
|
|
2717
|
+
p.states.length === 0 &&
|
|
2718
|
+
layer.modifiers.every((modifier) => modifier === frame) &&
|
|
2719
|
+
Object.keys(frame?.value ?? {}).every((side) => side === 'width');
|
|
2720
|
+
const boxedSticker = boxed && !sized;
|
|
2721
|
+
const sticker = draw(LottieHost, {
|
|
2722
|
+
key: boxedSticker || behaviour ? undefined : key,
|
|
2723
|
+
animation: typeof source === 'string' ? source : undefined,
|
|
2724
|
+
fallback: still?.source,
|
|
2725
|
+
accessibilityLabel: still?.alt,
|
|
2726
|
+
size: typeof edge === 'number' ? edge : undefined,
|
|
2727
|
+
loop: ownValue(p, 'loop') !== undefined,
|
|
2728
|
+
paused: ownValue(p, 'paused')?.value ?? false,
|
|
2729
|
+
decorative: ownValue(p, 'decorative') === undefined ? undefined : true,
|
|
2730
|
+
});
|
|
2731
|
+
if (!boxedSticker && !behaviour) return sticker;
|
|
2732
|
+
const host = behaviour ? hostFor(p) : View;
|
|
2733
|
+
const out = sized ? NO_STYLE_OUT : boxOf('host', 'L');
|
|
2734
|
+
return drawOutermost(box, host, out, hostProps(behaviour, key), sticker);
|
|
2735
|
+
}
|
|
2736
|
+
case 'view': {
|
|
2737
|
+
if (!boxed && !behaviour) return viewElement(node, ctx, key);
|
|
2738
|
+
const host = behaviour ? hostFor(p) : View;
|
|
2739
|
+
return drawOutermost(
|
|
2740
|
+
box,
|
|
2741
|
+
host,
|
|
2742
|
+
boxOf('host', 'V'),
|
|
2743
|
+
hostProps(behaviour, key),
|
|
2744
|
+
viewElement(node, ctx, undefined),
|
|
2745
|
+
);
|
|
2746
|
+
}
|
|
2747
|
+
default: {
|
|
2748
|
+
const control: ControlRenderer | undefined = CONTROLS[node.kind as NodeKind];
|
|
2749
|
+
if (control === undefined) throw new Error(`bloom-language: no renderer for ${node.kind}`);
|
|
2750
|
+
const controlDraw: ControlDraw = {
|
|
2751
|
+
node,
|
|
2752
|
+
own: (kind) => ownValue(p, kind),
|
|
2753
|
+
label: p.label,
|
|
2754
|
+
hint: p.hint,
|
|
2755
|
+
testID: p.testID,
|
|
2756
|
+
text: ctx.env.text,
|
|
2757
|
+
key,
|
|
2758
|
+
props: () => {
|
|
2759
|
+
const props = hostProps(behaviour, key);
|
|
2760
|
+
delete props.focusable;
|
|
2761
|
+
return props;
|
|
2762
|
+
},
|
|
2763
|
+
component: (host, props, ...children) =>
|
|
2764
|
+
boxed
|
|
2765
|
+
? drawHost(host, boxOf('component', node.kind), props, ...children)
|
|
2766
|
+
: draw(host, props, ...children),
|
|
2767
|
+
painted: (host, props, colors, ...children) => {
|
|
2768
|
+
const roles: (readonly [string, ColorName, number?])[] = [];
|
|
2769
|
+
const lists: (readonly [string, readonly ListColor[]])[] = [];
|
|
2770
|
+
const listKeys: string[] = [];
|
|
2771
|
+
for (const [prop, token] of Object.entries(colors)) {
|
|
2772
|
+
if (token === undefined) continue;
|
|
2773
|
+
if (typeof token === 'string') roles.push(propRole(prop, token));
|
|
2774
|
+
else {
|
|
2775
|
+
lists.push([prop, token.map(listColor)]);
|
|
2776
|
+
listKeys.push(`${prop}:${token.map(tokenKey).join('+')}`);
|
|
2777
|
+
}
|
|
2778
|
+
}
|
|
2779
|
+
const out = boxed ? boxOf('component', node.kind) : NO_STYLE_OUT;
|
|
2780
|
+
const paint = variedPaint(
|
|
2781
|
+
`C|${node.kind}|${boxed ? `${layerKey}|${flex}` : ''}|${roles.map((r) => r.join(':')).join(',')}|${listKeys.join(',')}`,
|
|
2782
|
+
out,
|
|
2783
|
+
roles,
|
|
2784
|
+
NO_VARIANTS,
|
|
2785
|
+
lists.length === 0 ? undefined : lists,
|
|
2786
|
+
);
|
|
2787
|
+
return drawHost(
|
|
2788
|
+
host,
|
|
2789
|
+
paint === undefined ? out : painted(out, paint),
|
|
2790
|
+
props,
|
|
2791
|
+
...children,
|
|
2792
|
+
);
|
|
2793
|
+
},
|
|
2794
|
+
around: (element) =>
|
|
2795
|
+
boxed
|
|
2796
|
+
? drawHost(View, boxOf('host', node.kind), hostProps(undefined, key), element)
|
|
2797
|
+
: element,
|
|
2798
|
+
pressAround: (drawn) => pressAround(p, behaviour, key, drawn),
|
|
2799
|
+
render: (child) => renderChild(child, ctx, undefined),
|
|
2800
|
+
children: (children) => renderChildren(children, ctx),
|
|
2801
|
+
press: (value) => pressOf(value, ctx.env),
|
|
2802
|
+
role: p.role,
|
|
2803
|
+
};
|
|
2804
|
+
// Views pinned at a list's edges: the list makes room for them (SwiftUI's safe area insets).
|
|
2805
|
+
const insets = INSET_LISTS.has(node.kind) ? insetsOf(node) : NO_INSETS;
|
|
2806
|
+
if (insets.length === 0) return control(controlDraw);
|
|
2807
|
+
return draw(SafeAreaInsets, {
|
|
2808
|
+
key,
|
|
2809
|
+
insets,
|
|
2810
|
+
render: controlDraw.render,
|
|
2811
|
+
scroller: (room: InsetRoom) => control({ ...controlDraw, room }),
|
|
2812
|
+
});
|
|
2813
|
+
}
|
|
2814
|
+
}
|
|
2815
|
+
}
|
|
2816
|
+
|
|
2817
|
+
/**
|
|
2818
|
+
* `Dialog(...).presented(binding)`: Bloom's Dialog in place, drawn as
|
|
2819
|
+
* `.dialog(binding, Dialog(...))` draws it beside its view. Every modifier of
|
|
2820
|
+
* a dialog is its own (`drawDialog` reads them), so none is a box around it.
|
|
2821
|
+
*/
|
|
2822
|
+
function drawPresentedDialog(
|
|
2823
|
+
node: Node,
|
|
2824
|
+
p: Plan,
|
|
2825
|
+
inner: Context,
|
|
2826
|
+
key: string | number | undefined,
|
|
2827
|
+
): ReactElement {
|
|
2828
|
+
const presented = ownValue(p, 'presented');
|
|
2829
|
+
if (presented === undefined)
|
|
2830
|
+
throw new Error('bloom-language: a Dialog is a view only with .presented(isPresented)');
|
|
2831
|
+
return drawDialog(
|
|
2832
|
+
{ isPresented: presented.value, content: node },
|
|
2833
|
+
(children) => renderChildren(children, inner),
|
|
2834
|
+
key,
|
|
2835
|
+
);
|
|
2836
|
+
}
|
|
2837
|
+
|
|
2838
|
+
/**
|
|
2839
|
+
* A `view()` node: its component with the props it was called with, under
|
|
2840
|
+
* an `EnvContext` provider only when the environment here differs from the
|
|
2841
|
+
* one already provided, and an `AnimationContext` one only when the
|
|
2842
|
+
* animation scope does.
|
|
2843
|
+
*/
|
|
2844
|
+
function viewElement(node: Node, ctx: Context, key: string | number | undefined): ReactElement {
|
|
2845
|
+
const { component, props } = node.props as ViewNodeProps;
|
|
2846
|
+
let element: ReactElement = draw(component, props as Record<string, unknown>);
|
|
2847
|
+
if (ctx.env !== ctx.provided) element = draw(EnvContext.Provider, { value: ctx.env }, element);
|
|
2848
|
+
// The `.animation()` in scope reaches the body, as it reaches the nodes of this one.
|
|
2849
|
+
if (ctx.animation !== ctx.scoped)
|
|
2850
|
+
element = draw(AnimationContext.Provider, { value: ctx.animation }, element);
|
|
2851
|
+
return key === undefined ? element : cloneElement(element, { key });
|
|
2852
|
+
}
|
|
2853
|
+
|
|
2854
|
+
/**
|
|
2855
|
+
* A menu's name is its trigger's: what assistive technology says for the
|
|
2856
|
+
* button that opens it. A trigger with a name of its own keeps it.
|
|
2857
|
+
*/
|
|
2858
|
+
function namedTrigger(trigger: Child, label: string | undefined): Child {
|
|
2859
|
+
if (label === undefined || !isNode(trigger)) return trigger;
|
|
2860
|
+
return trigger.modifiers.some((modifier) => modifier.kind === 'label')
|
|
2861
|
+
? trigger
|
|
2862
|
+
: trigger.label(label);
|
|
2863
|
+
}
|
|
2864
|
+
|
|
2865
|
+
// ── Containers ───────────────────────────────────────────────────
|
|
2866
|
+
|
|
2867
|
+
/**
|
|
2868
|
+
* A Bloom container (Fill, AspectRatio, ResponsiveGrid): its own
|
|
2869
|
+
* props, the innermost layer as its style, its `testID`, and the children.
|
|
2870
|
+
* Presses and the rest of the view's behaviour go on a host around it, since
|
|
2871
|
+
* these components take none.
|
|
2872
|
+
*/
|
|
2873
|
+
/**
|
|
2874
|
+
* A Bloom component's press, hover and focus when it takes none of its own
|
|
2875
|
+
* (a Badge, an IconCircle, a Loading, a Divider, an AvatarGroup, a button
|
|
2876
|
+
* group): a language host around it takes them, and its box tracks the
|
|
2877
|
+
* states in JavaScript on every platform, so the variants in the component's
|
|
2878
|
+
* own style (a `Conditioned` leaf) answer them.
|
|
2879
|
+
*/
|
|
2880
|
+
const AROUND: StyleOut = Object.freeze({
|
|
2881
|
+
style: undefined,
|
|
2882
|
+
paint: undefined,
|
|
2883
|
+
object: true,
|
|
2884
|
+
anchor: true,
|
|
2885
|
+
});
|
|
2886
|
+
|
|
2887
|
+
/** `drawn` with its press on a host around it when the view is pressable; its props otherwise, as before. */
|
|
2888
|
+
function pressAround(
|
|
2889
|
+
p: Plan,
|
|
2890
|
+
behaviour: Record<string, unknown> | undefined,
|
|
2891
|
+
key: string | number | undefined,
|
|
2892
|
+
drawn: (props: Record<string, unknown>) => ReactElement,
|
|
2893
|
+
): ReactElement {
|
|
2894
|
+
if (!p.pressable || behaviour === undefined) {
|
|
2895
|
+
const props = hostProps(behaviour, key);
|
|
2896
|
+
delete props.focusable;
|
|
2897
|
+
return drawn(props);
|
|
2898
|
+
}
|
|
2899
|
+
const { testID, ...rest } = behaviour;
|
|
2900
|
+
const element = drawn(testID === undefined ? {} : { testID });
|
|
2901
|
+
return drawHost(hostFor(p), AROUND, { ...rest, key }, element);
|
|
2902
|
+
}
|
|
2903
|
+
|
|
2904
|
+
function drawContainer(
|
|
2905
|
+
component: Host,
|
|
2906
|
+
own: Record<string, unknown>,
|
|
2907
|
+
node: Node,
|
|
2908
|
+
p: Plan,
|
|
2909
|
+
ctx: Context,
|
|
2910
|
+
out: StyleOut,
|
|
2911
|
+
behaviour: Record<string, unknown> | undefined,
|
|
2912
|
+
key: string | number | undefined,
|
|
2913
|
+
): ReactElement {
|
|
2914
|
+
const { testID, ...rest } = behaviour ?? {};
|
|
2915
|
+
const outer = Object.keys(rest).length > 0;
|
|
2916
|
+
const props: Record<string, unknown> = { ...own, testID, key: outer ? undefined : key };
|
|
2917
|
+
const element = drawHost(component, out, props, ...renderChildren(node.children, ctx));
|
|
2918
|
+
return outer ? drawHost(hostFor(p), AROUND, { ...rest, key }, element) : element;
|
|
2919
|
+
}
|
|
2920
|
+
|
|
2921
|
+
/** A Badge node's props for Bloom's Badge, standalone or attached. */
|
|
2922
|
+
function badgeProps(node: Node, p: Plan): Record<string, unknown> {
|
|
2923
|
+
return {
|
|
2924
|
+
content: (node.props as BadgeNodeProps).content,
|
|
2925
|
+
variant: ownValue(p, 'style')?.value,
|
|
2926
|
+
tone: ownValue(p, 'tint')?.value,
|
|
2927
|
+
color: ownValue(p, 'color')?.value,
|
|
2928
|
+
size: ownValue(p, 'size')?.value,
|
|
2929
|
+
icon: ownValue(p, 'icon')?.value,
|
|
2930
|
+
dot: ownValue(p, 'dot') === undefined ? undefined : true,
|
|
2931
|
+
max: ownValue(p, 'max')?.value,
|
|
2932
|
+
placement: ownValue(p, 'placement')?.value,
|
|
2933
|
+
testID: p.testID,
|
|
2934
|
+
};
|
|
2935
|
+
}
|
|
2936
|
+
|
|
2937
|
+
const SKELETON_SHAPES = {
|
|
2938
|
+
text: BloomSkeleton.Text,
|
|
2939
|
+
circle: BloomSkeleton.Circle,
|
|
2940
|
+
pill: BloomSkeleton.Pill,
|
|
2941
|
+
box: BloomSkeleton.Box,
|
|
2942
|
+
} as const;
|
|
2943
|
+
|
|
2944
|
+
/**
|
|
2945
|
+
* A skeleton shape: its frame is its size (a circle's and a pill's height, a
|
|
2946
|
+
* box's width and height), a box's corner its radius, a text line's height
|
|
2947
|
+
* the one its font sets. It draws nothing else of a chain.
|
|
2948
|
+
*/
|
|
2949
|
+
function drawSkeleton(
|
|
2950
|
+
node: Node,
|
|
2951
|
+
p: Plan,
|
|
2952
|
+
ctx: Context,
|
|
2953
|
+
key: string | number | undefined,
|
|
2954
|
+
): ReactElement {
|
|
2955
|
+
const { shape } = node.props as SkeletonProps;
|
|
2956
|
+
let frame: FrameSpec = {};
|
|
2957
|
+
let corner: CornerName | undefined;
|
|
2958
|
+
for (const modifier of node.modifiers) {
|
|
2959
|
+
if (modifier.kind === 'frame') frame = { ...frame, ...modifier.value };
|
|
2960
|
+
if (modifier.kind === 'corner') corner = modifier.value;
|
|
2961
|
+
}
|
|
2962
|
+
const length = (token: LengthToken | undefined) =>
|
|
2963
|
+
token === undefined ? undefined : resolveLength(token);
|
|
2964
|
+
const props: Record<string, unknown> = { key };
|
|
2965
|
+
if (shape === 'text') {
|
|
2966
|
+
const { lineHeight } = resolveFont(
|
|
2967
|
+
ctx.env.text.font,
|
|
2968
|
+
ctx.env.text.weight,
|
|
2969
|
+
ctx.env.text.leading,
|
|
2970
|
+
);
|
|
2971
|
+
const width = length(frame.width);
|
|
2972
|
+
if (lineHeight !== undefined || width !== undefined) props.style = { lineHeight, width };
|
|
2973
|
+
} else if (shape === 'box') {
|
|
2974
|
+
props.width = length(frame.width);
|
|
2975
|
+
props.height = length(frame.height);
|
|
2976
|
+
if (corner !== undefined && corner !== 'concentric') props.borderRadius = resolveCorner(corner);
|
|
2977
|
+
} else {
|
|
2978
|
+
props.size = length(frame.height ?? frame.width);
|
|
2979
|
+
}
|
|
2980
|
+
if (p.testID !== undefined) props.testID = p.testID;
|
|
2981
|
+
return draw(SKELETON_SHAPES[shape], props);
|
|
2982
|
+
}
|
|
2983
|
+
|
|
2984
|
+
function withoutLabel(behaviour: Record<string, unknown>): Record<string, unknown> {
|
|
2985
|
+
const { accessibilityLabel: _label, ...rest } = behaviour;
|
|
2986
|
+
return rest;
|
|
2987
|
+
}
|
|
2988
|
+
|
|
2989
|
+
/**
|
|
2990
|
+
* A divider's label: a `Text` with nothing of its own is Bloom's divider
|
|
2991
|
+
* label (its type and ink), any other view is drawn as it is.
|
|
2992
|
+
*/
|
|
2993
|
+
function dividerLabel(label: Child, ctx: Context): ReactNode {
|
|
2994
|
+
if (!isNode(label)) return undefined;
|
|
2995
|
+
if (label.kind === 'text' && label.modifiers.length === 0) {
|
|
2996
|
+
const runs = (label.props as TextProps).runs;
|
|
2997
|
+
if (runs.every((run) => typeof run === 'string' || typeof run === 'number'))
|
|
2998
|
+
return runs.join('');
|
|
2999
|
+
}
|
|
3000
|
+
return renderNode(label, ctx, undefined);
|
|
3001
|
+
}
|
|
3002
|
+
|
|
3003
|
+
// ── Text ─────────────────────────────────────────────────────────
|
|
3004
|
+
|
|
3005
|
+
/** Bloom's typography components, by the text style that draws each; `Text` without one. */
|
|
3006
|
+
const TEXT_HOSTS: Record<TextStyleName, Host> = {
|
|
3007
|
+
title: Title,
|
|
3008
|
+
subtitle: Subtitle,
|
|
3009
|
+
h1: H1,
|
|
3010
|
+
h2: H2,
|
|
3011
|
+
h3: H3,
|
|
3012
|
+
h4: H4,
|
|
3013
|
+
h5: H5,
|
|
3014
|
+
h6: H6,
|
|
3015
|
+
paragraph: P,
|
|
3016
|
+
lead: Lead,
|
|
3017
|
+
large: Large,
|
|
3018
|
+
small: Small,
|
|
3019
|
+
muted: Muted,
|
|
3020
|
+
blockquote: Blockquote,
|
|
3021
|
+
};
|
|
3022
|
+
|
|
3023
|
+
const linkPresses = new Map<string, PressHandler>();
|
|
3024
|
+
|
|
3025
|
+
/**
|
|
3026
|
+
* A link's press, as Bloom's inline link takes it: it stays in its text (not
|
|
3027
|
+
* the row around it), the web's anchor follows itself, and native opens the
|
|
3028
|
+
* page outside the app. One handler per address, so a text keeps its props.
|
|
3029
|
+
*/
|
|
3030
|
+
function linkPress(href: string): PressHandler {
|
|
3031
|
+
let press = linkPresses.get(href);
|
|
3032
|
+
if (press === undefined) {
|
|
3033
|
+
press = (event) => {
|
|
3034
|
+
event.stopPropagation();
|
|
3035
|
+
if (!IS_WEB) openExternal(href);
|
|
3036
|
+
};
|
|
3037
|
+
linkPresses.set(href, press);
|
|
3038
|
+
}
|
|
3039
|
+
return press;
|
|
3040
|
+
}
|
|
3041
|
+
|
|
3042
|
+
/** The env traits a span's own chain sets: all a span writes (see `textStyle`). */
|
|
3043
|
+
function spanTraits(p: Plan): ReadonlySet<keyof TextTraits> {
|
|
3044
|
+
return new Set(
|
|
3045
|
+
p.env.map((modifier) =>
|
|
3046
|
+
modifier.kind === 'font' && isFontFamily(modifier.value)
|
|
3047
|
+
? 'family'
|
|
3048
|
+
: (modifier.kind as keyof TextTraits),
|
|
3049
|
+
),
|
|
3050
|
+
);
|
|
3051
|
+
}
|
|
3052
|
+
|
|
3053
|
+
/**
|
|
3054
|
+
* A text. The outermost is Bloom's `Text` (or the typography component its
|
|
3055
|
+
* `textStyle` names), its ramp font as Bloom's `variant`; a nested one is a
|
|
3056
|
+
* React Native span inside it, so it inherits the type it does not set.
|
|
3057
|
+
*/
|
|
3058
|
+
function drawText(
|
|
3059
|
+
node: Node,
|
|
3060
|
+
p: Plan,
|
|
3061
|
+
ctx: Context,
|
|
3062
|
+
layerKey: string,
|
|
3063
|
+
flex: string,
|
|
3064
|
+
box: () => Resolved,
|
|
3065
|
+
boxVaried: () => VariantStyles,
|
|
3066
|
+
behaviour: Record<string, unknown> | undefined,
|
|
3067
|
+
key: string | number | undefined,
|
|
3068
|
+
outermost: Outermost | undefined,
|
|
3069
|
+
): ReactElement {
|
|
3070
|
+
const raw = (node.props as TextProps).raw === true;
|
|
3071
|
+
// React Native's own Text (RawText) inherits nothing of the language's environment
|
|
3072
|
+
// (no family, size or ink); a span, and RawText, write only what their own chain
|
|
3073
|
+
// names, RawText over the base face an app's React Native Text draws (`rawBaseFont`).
|
|
3074
|
+
const traits = raw ? deriveEnv(ROOT_ENV, p.env).text : ctx.env.text;
|
|
3075
|
+
const span = ctx.inText || raw ? spanTraits(p) : undefined;
|
|
3076
|
+
const link = ownValue(p, 'link')?.value;
|
|
3077
|
+
const look = {
|
|
3078
|
+
noWrap: ownValue(p, 'noWrap') !== undefined,
|
|
3079
|
+
align: ownValue(p, 'textAlign')?.value,
|
|
3080
|
+
italic: ownValue(p, 'italic') !== undefined,
|
|
3081
|
+
underline: ownValue(p, 'underline') !== undefined,
|
|
3082
|
+
strikethrough: ownValue(p, 'strikethrough') !== undefined,
|
|
3083
|
+
textCase: ownValue(p, 'textCase')?.value,
|
|
3084
|
+
link: link !== undefined,
|
|
3085
|
+
tabular: ownValue(p, 'monospacedDigit') !== undefined,
|
|
3086
|
+
wordBreak: ownValue(p, 'wordBreak')?.value,
|
|
3087
|
+
ellipsis: ownValue(p, 'truncation')?.value === 'tail' && ownValue(p, 'lines') === undefined,
|
|
3088
|
+
};
|
|
3089
|
+
const textStyleName = span === undefined ? ownValue(p, 'textStyle')?.value : undefined;
|
|
3090
|
+
const lookKey = `${look.noWrap ? 'nw' : ''}|${look.align ?? ''}|${look.italic ? 'i' : ''}|${look.underline ? 'u' : ''}|${look.strikethrough ? 's' : ''}|${look.textCase ?? ''}|${look.link ? 'a' : ''}|${look.tabular ? 'tn' : ''}|${look.wordBreak ?? ''}|${look.ellipsis ? 'el' : ''}`;
|
|
3091
|
+
const spanKey = span === undefined ? '' : [...span].sort().join(',');
|
|
3092
|
+
const blockquote = textStyleName === 'blockquote';
|
|
3093
|
+
const props = hostProps(behaviour, key);
|
|
3094
|
+
delete props.focusable;
|
|
3095
|
+
const lines = ownValue(p, 'lines')?.value;
|
|
3096
|
+
const truncation = ownValue(p, 'truncation')?.value;
|
|
3097
|
+
if (lines !== undefined) props.numberOfLines = lines;
|
|
3098
|
+
if (lines !== undefined || truncation !== undefined) props.ellipsizeMode = truncation ?? 'tail';
|
|
3099
|
+
const selectable = ownValue(p, 'selectable')?.value;
|
|
3100
|
+
if (selectable !== undefined) props.selectable = selectable;
|
|
3101
|
+
if (link !== undefined) {
|
|
3102
|
+
props.role = 'link';
|
|
3103
|
+
props.onPress = p.onPress ?? linkPress(link);
|
|
3104
|
+
if (IS_WEB) {
|
|
3105
|
+
props.href = link;
|
|
3106
|
+
if (/^https?:/i.test(link)) props.hrefAttrs = LINK_TARGET;
|
|
3107
|
+
}
|
|
3108
|
+
}
|
|
3109
|
+
const variant = span === undefined && !blockquote ? textVariant(traits) : undefined;
|
|
3110
|
+
if (variant !== undefined) props.variant = variant;
|
|
3111
|
+
let runs = renderRuns((node.props as TextProps).runs, ctx);
|
|
3112
|
+
if (blockquote) {
|
|
3113
|
+
// Bloom's quotation is a box around its own text: the box takes the
|
|
3114
|
+
// layers, and what the chain sets for the text is a span inside it.
|
|
3115
|
+
const own = textStyle(traits, look, spanTraits(p));
|
|
3116
|
+
if (Object.keys(own).length > 0) {
|
|
3117
|
+
const inner = cachedStyle('host', `TQ|${ctx.env.key}|${spanKey}|${lookKey}`, () => own);
|
|
3118
|
+
runs = [drawHost(RNText, inner, {}, ...runs)];
|
|
3119
|
+
}
|
|
3120
|
+
return drawHost(
|
|
3121
|
+
Blockquote,
|
|
3122
|
+
cachedStyle('component', `Q|${layerKey}|${flex}`, box, boxVaried),
|
|
3123
|
+
props,
|
|
3124
|
+
...runs,
|
|
3125
|
+
);
|
|
3126
|
+
}
|
|
3127
|
+
const host = span !== undefined ? RNText : textStyleName ? TEXT_HOSTS[textStyleName] : BloomText;
|
|
3128
|
+
const out = cachedStyle(
|
|
3129
|
+
'host',
|
|
3130
|
+
`T|${ctx.env.key}|${span === undefined ? '' : `s:${spanKey}`}|${raw ? (ctx.inText ? 'r:in' : 'r') : ''}|${lookKey}|${layerKey}|${flex}`,
|
|
3131
|
+
() =>
|
|
3132
|
+
Object.assign(
|
|
3133
|
+
{},
|
|
3134
|
+
raw ? rawBaseFont(ctx.inText === true) : undefined,
|
|
3135
|
+
textStyle(traits, look, span),
|
|
3136
|
+
box(),
|
|
3137
|
+
),
|
|
3138
|
+
() => joinVariants(textVariants(traits), boxVaried()),
|
|
3139
|
+
);
|
|
3140
|
+
const roll = ownValue(p, 'contentTransition');
|
|
3141
|
+
const plain = (node.props as TextProps).runs;
|
|
3142
|
+
if (
|
|
3143
|
+
roll !== undefined &&
|
|
3144
|
+
plain.every((run) => typeof run === 'string' || typeof run === 'number')
|
|
3145
|
+
) {
|
|
3146
|
+
// The roll draws the text host itself, once at rest and twice while it
|
|
3147
|
+
// rolls, so it takes this node's outermost box (at rest).
|
|
3148
|
+
if (outermost !== undefined) outermost.used = true;
|
|
3149
|
+
// A fresh copy for each host: drawing one writes its style into its props.
|
|
3150
|
+
const hostOnly = (): Record<string, unknown> => {
|
|
3151
|
+
const { key: _key, ...rest } = props;
|
|
3152
|
+
return rest;
|
|
3153
|
+
};
|
|
3154
|
+
const rollProps = {
|
|
3155
|
+
key,
|
|
3156
|
+
text: plain.join(''),
|
|
3157
|
+
direction: roll.direction,
|
|
3158
|
+
scope: ctx.animation,
|
|
3159
|
+
draw: (text: string, rolling: Outer | undefined) => {
|
|
3160
|
+
if (rolling === undefined) return drawOutermost(outermost, host, out, hostOnly(), text);
|
|
3161
|
+
const at: Outermost = { outer: rolling, used: false };
|
|
3162
|
+
const drawn = drawOutermost(at, host, out, hostOnly(), text);
|
|
3163
|
+
return at.used ? drawn : moveIn(rolling, drawn);
|
|
3164
|
+
},
|
|
3165
|
+
};
|
|
3166
|
+
if (roll.value === 'roll') return draw(TextRoll, rollProps);
|
|
3167
|
+
// A numeric roll's row takes the text's box; each piece its type alone.
|
|
3168
|
+
const glyph = cachedStyle(
|
|
3169
|
+
'host',
|
|
3170
|
+
`TG|${ctx.env.key}|${lookKey}`,
|
|
3171
|
+
() => textStyle(traits, look, undefined),
|
|
3172
|
+
() => textVariants(traits),
|
|
3173
|
+
);
|
|
3174
|
+
const rowOut = cachedStyle(
|
|
3175
|
+
'host',
|
|
3176
|
+
`TR|${layerKey}|${flex}`,
|
|
3177
|
+
() => Object.assign({ flexDirection: 'row' }, box()),
|
|
3178
|
+
boxVaried,
|
|
3179
|
+
);
|
|
3180
|
+
const pieceProps: Record<string, unknown> = { ...HIDDEN_PIECE };
|
|
3181
|
+
if (variant !== undefined) pieceProps.variant = variant;
|
|
3182
|
+
return draw(NumericRoll, {
|
|
3183
|
+
...rollProps,
|
|
3184
|
+
row: (text: string, ...pieces: ReactNode[]) =>
|
|
3185
|
+
drawOutermost(
|
|
3186
|
+
outermost,
|
|
3187
|
+
View,
|
|
3188
|
+
rowOut,
|
|
3189
|
+
{ ...hostOnly(), accessible: true, role: 'text', accessibilityLabel: text },
|
|
3190
|
+
...pieces,
|
|
3191
|
+
),
|
|
3192
|
+
piece: (text: string, rolling: Outer | undefined) => {
|
|
3193
|
+
const drawn = drawHost(host, glyph, { ...pieceProps }, text);
|
|
3194
|
+
return rolling === undefined ? drawn : moveIn(rolling, drawn);
|
|
3195
|
+
},
|
|
3196
|
+
});
|
|
3197
|
+
}
|
|
3198
|
+
return drawOutermost(outermost, host, out, props, ...runs);
|
|
3199
|
+
}
|
|
3200
|
+
|
|
3201
|
+
/** A piece of a numeric roll: the row it is in names the whole text. */
|
|
3202
|
+
const HIDDEN_PIECE = Object.freeze({
|
|
3203
|
+
'aria-hidden': true,
|
|
3204
|
+
importantForAccessibility: 'no-hide-descendants',
|
|
3205
|
+
accessibilityElementsHidden: true,
|
|
3206
|
+
selectable: false,
|
|
3207
|
+
});
|
|
3208
|
+
|
|
3209
|
+
/** A web link to another site opens beside the app, as Bloom's inline link does. */
|
|
3210
|
+
const LINK_TARGET = Object.freeze({ target: '_blank', rel: 'noopener noreferrer' });
|
|
3211
|
+
|
|
3212
|
+
/**
|
|
3213
|
+
* A button's content: its first `Icon` before any `Text` is the leading glyph,
|
|
3214
|
+
* an `Icon` after a `Text` the trailing one, and the `Text` runs its label.
|
|
3215
|
+
*/
|
|
3216
|
+
function buttonContent(children: readonly Child[]): {
|
|
3217
|
+
icon: IconProps['icon'] | undefined;
|
|
3218
|
+
glyph: Node | undefined;
|
|
3219
|
+
label: string | undefined;
|
|
3220
|
+
trailing: IconProps['icon'] | undefined;
|
|
3221
|
+
} {
|
|
3222
|
+
let icon: IconProps['icon'] | undefined;
|
|
3223
|
+
let glyph: Node | undefined;
|
|
3224
|
+
let label: string | undefined;
|
|
3225
|
+
let trailing: IconProps['icon'] | undefined;
|
|
3226
|
+
for (const child of flatten(children)) {
|
|
3227
|
+
if (child.kind === 'icon') {
|
|
3228
|
+
if (label !== undefined) trailing ??= (child.props as IconProps).icon;
|
|
3229
|
+
else if (icon === undefined) {
|
|
3230
|
+
icon = (child.props as IconProps).icon;
|
|
3231
|
+
glyph = child;
|
|
3232
|
+
}
|
|
3233
|
+
}
|
|
3234
|
+
if (child.kind === 'text') {
|
|
3235
|
+
const text = (child.props as TextProps).runs
|
|
3236
|
+
.filter((run) => typeof run === 'string' || typeof run === 'number')
|
|
3237
|
+
.join('');
|
|
3238
|
+
label = label === undefined ? text : `${label} ${text}`;
|
|
3239
|
+
}
|
|
3240
|
+
}
|
|
3241
|
+
return { icon, glyph, label, trailing };
|
|
3242
|
+
}
|
|
3243
|
+
|
|
3244
|
+
function flatten(children: readonly Child[]): Node[] {
|
|
3245
|
+
const out: Node[] = [];
|
|
3246
|
+
for (const child of children) {
|
|
3247
|
+
if (Array.isArray(child)) out.push(...flatten(child));
|
|
3248
|
+
else if (isNode(child)) out.push(child);
|
|
3249
|
+
}
|
|
3250
|
+
return out;
|
|
3251
|
+
}
|
|
3252
|
+
|
|
3253
|
+
// ── Children ─────────────────────────────────────────────────────
|
|
3254
|
+
|
|
3255
|
+
/**
|
|
3256
|
+
* One slot per child, in order: a child that is `false` or `null` keeps its
|
|
3257
|
+
* slot as `null`, so its later siblings never shift onto each other's state
|
|
3258
|
+
* (React matches spread children by position). An array (`items.map(...)`) is
|
|
3259
|
+
* one slot whose elements are keyed by `.id()`, else by index.
|
|
3260
|
+
*/
|
|
3261
|
+
function renderChildren(children: readonly Child[], ctx: Context): ReactNode[] {
|
|
3262
|
+
const out: ReactNode[] = [];
|
|
3263
|
+
for (const child of children) {
|
|
3264
|
+
if (Array.isArray(child)) out.push(draw(Presence, { items: renderList(child, ctx) }));
|
|
3265
|
+
else out.push(isNode(child) ? renderNode(child, ctx, undefined) : null);
|
|
3266
|
+
}
|
|
3267
|
+
return out;
|
|
3268
|
+
}
|
|
3269
|
+
|
|
3270
|
+
function renderList(children: readonly Child[], ctx: Context): ReactNode[] {
|
|
3271
|
+
const out: ReactNode[] = [];
|
|
3272
|
+
for (let i = 0; i < children.length; i++) {
|
|
3273
|
+
const child = children[i];
|
|
3274
|
+
if (Array.isArray(child)) out.push(draw(Fragment, { key: `l${i}` }, ...renderList(child, ctx)));
|
|
3275
|
+
else if (isNode(child)) out.push(renderNode(child, ctx, i));
|
|
3276
|
+
}
|
|
3277
|
+
return out;
|
|
3278
|
+
}
|
|
3279
|
+
|
|
3280
|
+
function renderRuns(runs: readonly TextRun[], ctx: Context): ReactNode[] {
|
|
3281
|
+
const out: ReactNode[] = [];
|
|
3282
|
+
const inner: Context = ctx.inText ? ctx : { ...ctx, inText: true };
|
|
3283
|
+
for (const run of runs) {
|
|
3284
|
+
if (typeof run === 'string' || typeof run === 'number') out.push(String(run));
|
|
3285
|
+
else out.push(isNode(run) ? renderNode(run, inner, undefined) : null);
|
|
3286
|
+
}
|
|
3287
|
+
return out;
|
|
3288
|
+
}
|
|
3289
|
+
|
|
3290
|
+
/** Draws any child in a context: what `Embed`'s render function hands out. */
|
|
3291
|
+
function renderChild(child: Child, ctx: Context, key: string | number | undefined): ReactNode {
|
|
3292
|
+
if (Array.isArray(child)) return renderList(child, ctx);
|
|
3293
|
+
return isNode(child) ? renderNode(child, ctx, key) : null;
|
|
3294
|
+
}
|
|
3295
|
+
|
|
3296
|
+
// ── Entry points ─────────────────────────────────────────────────
|
|
3297
|
+
|
|
3298
|
+
interface RootProps {
|
|
3299
|
+
node: Child;
|
|
3300
|
+
}
|
|
3301
|
+
|
|
3302
|
+
/** The boundary from JSX into the language: it takes the environment provided where it is placed. */
|
|
3303
|
+
function LanguageRoot({ node }: RootProps): ReactNode {
|
|
3304
|
+
const env = useContext(EnvContext);
|
|
3305
|
+
const animation = useContext(AnimationContext);
|
|
3306
|
+
return renderChild(node, { env, provided: env, animation, scoped: animation }, undefined);
|
|
3307
|
+
}
|
|
3308
|
+
LanguageRoot.displayName = 'BloomLanguage';
|
|
3309
|
+
|
|
3310
|
+
/** Whether a `LanguageStyles` around this point writes the sheets into server-rendered HTML. */
|
|
3311
|
+
const SheetsWritten = createContext(false);
|
|
3312
|
+
|
|
3313
|
+
/**
|
|
3314
|
+
* The web: the language's sheets in server-rendered HTML, for an app that
|
|
3315
|
+
* renders on a server with Bloom's `ssrStyles` (which `ServerStyleSheet`
|
|
3316
|
+
* reads). It goes around the app once, as the router's `layout()` does
|
|
3317
|
+
* itself: it draws `children`, then the generated sheet and each variant
|
|
3318
|
+
* sheet the tree drew, so the page is styled before it hydrates. One inside
|
|
3319
|
+
* another writes nothing; without a server policy, and once hydrated,
|
|
3320
|
+
* `ServerStyleSheet` writes nothing and adopts the same sheets the renderer
|
|
3321
|
+
* does. Native draws `children`.
|
|
3322
|
+
*/
|
|
3323
|
+
export function LanguageStyles({ children }: { children?: ReactNode }): ReactNode {
|
|
3324
|
+
const written = useContext(SheetsWritten);
|
|
3325
|
+
if (!IS_WEB || written) return children;
|
|
3326
|
+
return draw(SheetsWritten.Provider, { value: true }, children, draw(LanguageSheets, null));
|
|
3327
|
+
}
|
|
3328
|
+
|
|
3329
|
+
function LanguageSheets(): ReactNode {
|
|
3330
|
+
return languageSheets().map(([id, css]) => draw(ServerStyleSheet, { key: id, id, css }));
|
|
3331
|
+
}
|
|
3332
|
+
|
|
3333
|
+
/**
|
|
3334
|
+
* A language tree as a React element, for JSX. A bare `view()` node mounts its
|
|
3335
|
+
* component directly; anything else goes under one boundary component.
|
|
3336
|
+
*/
|
|
3337
|
+
export function toElement(node: Child, key?: string | number): ReactElement {
|
|
3338
|
+
adoptLanguageSheet();
|
|
3339
|
+
if (isNode(node) && node.kind === 'view' && node.modifiers.length === 0) {
|
|
3340
|
+
const { component, props } = node.props as ViewNodeProps;
|
|
3341
|
+
return draw(
|
|
3342
|
+
component,
|
|
3343
|
+
key === undefined ? (props as Record<string, unknown>) : { ...props, key },
|
|
3344
|
+
);
|
|
3345
|
+
}
|
|
3346
|
+
return draw(LanguageRoot, { node, key });
|
|
3347
|
+
}
|
|
3348
|
+
|
|
3349
|
+
/** What a `view()` component renders: its body, under the environment and animation scope it is placed in. */
|
|
3350
|
+
export function renderBody(
|
|
3351
|
+
body: Child,
|
|
3352
|
+
env: Env,
|
|
3353
|
+
animation: AnimationScope | undefined,
|
|
3354
|
+
): ReactNode {
|
|
3355
|
+
return renderChild(body, { env, provided: env, animation, scoped: animation }, undefined);
|
|
3356
|
+
}
|
|
3357
|
+
|
|
3358
|
+
interface LottieHostProps {
|
|
3359
|
+
animation: string | undefined;
|
|
3360
|
+
fallback: string | undefined;
|
|
3361
|
+
accessibilityLabel: string | undefined;
|
|
3362
|
+
size: number | undefined;
|
|
3363
|
+
loop: boolean;
|
|
3364
|
+
paused: boolean;
|
|
3365
|
+
decorative: true | undefined;
|
|
3366
|
+
}
|
|
3367
|
+
|
|
3368
|
+
/**
|
|
3369
|
+
* `Lottie()`: Bloom's `Sticker`, the one Lottie path (lottie-react-native on
|
|
3370
|
+
* native, dotLottie on the web, both loaded lazily), paused while its screen
|
|
3371
|
+
* is not in front.
|
|
3372
|
+
*/
|
|
3373
|
+
function LottieHost({ paused, fallback, ...props }: LottieHostProps): ReactNode {
|
|
3374
|
+
const visible = useScreenVisible();
|
|
3375
|
+
return draw(Sticker, { ...props, fallback: fallback ?? '', paused: paused || !visible });
|
|
3376
|
+
}
|
|
3377
|
+
LottieHost.displayName = 'BloomLottie';
|