voltra 0.0.1 → 1.0.0-rc.1
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.txt +21 -0
- package/README.md +100 -2
- package/app.plugin.js +2 -0
- package/build/VoltraModule.d.ts +3 -0
- package/build/VoltraModule.d.ts.map +1 -0
- package/build/VoltraModule.js +3 -0
- package/build/VoltraModule.js.map +1 -0
- package/build/client.d.ts +12 -0
- package/build/client.d.ts.map +1 -0
- package/build/client.js +14 -0
- package/build/client.js.map +1 -0
- package/build/components/VoltraLiveActivityPreview.d.ts +29 -0
- package/build/components/VoltraLiveActivityPreview.d.ts.map +1 -0
- package/build/components/VoltraLiveActivityPreview.js +41 -0
- package/build/components/VoltraLiveActivityPreview.js.map +1 -0
- package/build/components/VoltraView.d.ts +39 -0
- package/build/components/VoltraView.d.ts.map +1 -0
- package/build/components/VoltraView.js +46 -0
- package/build/components/VoltraView.js.map +1 -0
- package/build/components/VoltraWidgetPreview.d.ts +33 -0
- package/build/components/VoltraWidgetPreview.d.ts.map +1 -0
- package/build/components/VoltraWidgetPreview.js +46 -0
- package/build/components/VoltraWidgetPreview.js.map +1 -0
- package/build/events.d.ts +35 -0
- package/build/events.d.ts.map +1 -0
- package/build/events.js +12 -0
- package/build/events.js.map +1 -0
- package/build/helpers.d.ts +12 -0
- package/build/helpers.d.ts.map +1 -0
- package/build/helpers.js +32 -0
- package/build/helpers.js.map +1 -0
- package/build/index.d.ts +4 -0
- package/build/index.d.ts.map +1 -0
- package/build/index.js +2 -0
- package/build/index.js.map +1 -0
- package/build/jsx/Button.d.ts +4 -0
- package/build/jsx/Button.d.ts.map +1 -0
- package/build/jsx/Button.js +3 -0
- package/build/jsx/Button.js.map +1 -0
- package/build/jsx/CircularProgressView.d.ts +4 -0
- package/build/jsx/CircularProgressView.d.ts.map +1 -0
- package/build/jsx/CircularProgressView.js +3 -0
- package/build/jsx/CircularProgressView.js.map +1 -0
- package/build/jsx/Divider.d.ts +4 -0
- package/build/jsx/Divider.d.ts.map +1 -0
- package/build/jsx/Divider.js +3 -0
- package/build/jsx/Divider.js.map +1 -0
- package/build/jsx/Gauge.d.ts +4 -0
- package/build/jsx/Gauge.d.ts.map +1 -0
- package/build/jsx/Gauge.js +3 -0
- package/build/jsx/Gauge.js.map +1 -0
- package/build/jsx/GlassContainer.d.ts +4 -0
- package/build/jsx/GlassContainer.d.ts.map +1 -0
- package/build/jsx/GlassContainer.js +3 -0
- package/build/jsx/GlassContainer.js.map +1 -0
- package/build/jsx/GroupBox.d.ts +4 -0
- package/build/jsx/GroupBox.d.ts.map +1 -0
- package/build/jsx/GroupBox.js +3 -0
- package/build/jsx/GroupBox.js.map +1 -0
- package/build/jsx/HStack.d.ts +4 -0
- package/build/jsx/HStack.d.ts.map +1 -0
- package/build/jsx/HStack.js +3 -0
- package/build/jsx/HStack.js.map +1 -0
- package/build/jsx/Image.d.ts +14 -0
- package/build/jsx/Image.d.ts.map +1 -0
- package/build/jsx/Image.js +11 -0
- package/build/jsx/Image.js.map +1 -0
- package/build/jsx/Label.d.ts +7 -0
- package/build/jsx/Label.d.ts.map +1 -0
- package/build/jsx/Label.js +3 -0
- package/build/jsx/Label.js.map +1 -0
- package/build/jsx/LinearGradient.d.ts +15 -0
- package/build/jsx/LinearGradient.d.ts.map +1 -0
- package/build/jsx/LinearGradient.js +88 -0
- package/build/jsx/LinearGradient.js.map +1 -0
- package/build/jsx/LinearProgressView.d.ts +4 -0
- package/build/jsx/LinearProgressView.d.ts.map +1 -0
- package/build/jsx/LinearProgressView.js +3 -0
- package/build/jsx/LinearProgressView.js.map +1 -0
- package/build/jsx/Mask.d.ts +4 -0
- package/build/jsx/Mask.d.ts.map +1 -0
- package/build/jsx/Mask.js +3 -0
- package/build/jsx/Mask.js.map +1 -0
- package/build/jsx/Spacer.d.ts +4 -0
- package/build/jsx/Spacer.d.ts.map +1 -0
- package/build/jsx/Spacer.js +3 -0
- package/build/jsx/Spacer.js.map +1 -0
- package/build/jsx/Symbol.d.ts +4 -0
- package/build/jsx/Symbol.d.ts.map +1 -0
- package/build/jsx/Symbol.js +3 -0
- package/build/jsx/Symbol.js.map +1 -0
- package/build/jsx/Text.d.ts +7 -0
- package/build/jsx/Text.d.ts.map +1 -0
- package/build/jsx/Text.js +3 -0
- package/build/jsx/Text.js.map +1 -0
- package/build/jsx/Timer.d.ts +7 -0
- package/build/jsx/Timer.d.ts.map +1 -0
- package/build/jsx/Timer.js +3 -0
- package/build/jsx/Timer.js.map +1 -0
- package/build/jsx/Toggle.d.ts +4 -0
- package/build/jsx/Toggle.d.ts.map +1 -0
- package/build/jsx/Toggle.js +3 -0
- package/build/jsx/Toggle.js.map +1 -0
- package/build/jsx/VStack.d.ts +4 -0
- package/build/jsx/VStack.d.ts.map +1 -0
- package/build/jsx/VStack.js +3 -0
- package/build/jsx/VStack.js.map +1 -0
- package/build/jsx/ZStack.d.ts +4 -0
- package/build/jsx/ZStack.d.ts.map +1 -0
- package/build/jsx/ZStack.js +3 -0
- package/build/jsx/ZStack.js.map +1 -0
- package/build/jsx/baseProps.d.ts +8 -0
- package/build/jsx/baseProps.d.ts.map +1 -0
- package/build/jsx/baseProps.js +2 -0
- package/build/jsx/baseProps.js.map +1 -0
- package/build/jsx/createVoltraComponent.d.ts +12 -0
- package/build/jsx/createVoltraComponent.d.ts.map +1 -0
- package/build/jsx/createVoltraComponent.js +16 -0
- package/build/jsx/createVoltraComponent.js.map +1 -0
- package/build/jsx/font.d.ts +21 -0
- package/build/jsx/font.d.ts.map +1 -0
- package/build/jsx/font.js +22 -0
- package/build/jsx/font.js.map +1 -0
- package/build/jsx/index.d.ts +3 -0
- package/build/jsx/index.d.ts.map +1 -0
- package/build/jsx/index.js +2 -0
- package/build/jsx/index.js.map +1 -0
- package/build/jsx/primitives.d.ts +20 -0
- package/build/jsx/primitives.d.ts.map +1 -0
- package/build/jsx/primitives.js +20 -0
- package/build/jsx/primitives.js.map +1 -0
- package/build/jsx/props/Button.d.ts +6 -0
- package/build/jsx/props/Button.d.ts.map +1 -0
- package/build/jsx/props/Button.js +5 -0
- package/build/jsx/props/Button.js.map +1 -0
- package/build/jsx/props/CircularProgressView.d.ts +20 -0
- package/build/jsx/props/CircularProgressView.d.ts.map +1 -0
- package/build/jsx/props/CircularProgressView.js +5 -0
- package/build/jsx/props/CircularProgressView.js.map +1 -0
- package/build/jsx/props/Divider.d.ts +3 -0
- package/build/jsx/props/Divider.d.ts.map +1 -0
- package/build/jsx/props/Divider.js +5 -0
- package/build/jsx/props/Divider.js.map +1 -0
- package/build/jsx/props/Gauge.d.ts +25 -0
- package/build/jsx/props/Gauge.d.ts.map +1 -0
- package/build/jsx/props/Gauge.js +5 -0
- package/build/jsx/props/Gauge.js.map +1 -0
- package/build/jsx/props/GlassContainer.d.ts +6 -0
- package/build/jsx/props/GlassContainer.d.ts.map +1 -0
- package/build/jsx/props/GlassContainer.js +5 -0
- package/build/jsx/props/GlassContainer.js.map +1 -0
- package/build/jsx/props/GroupBox.d.ts +7 -0
- package/build/jsx/props/GroupBox.d.ts.map +1 -0
- package/build/jsx/props/GroupBox.js +5 -0
- package/build/jsx/props/GroupBox.js.map +1 -0
- package/build/jsx/props/HStack.d.ts +8 -0
- package/build/jsx/props/HStack.d.ts.map +1 -0
- package/build/jsx/props/HStack.js +5 -0
- package/build/jsx/props/HStack.js.map +1 -0
- package/build/jsx/props/Image.d.ts +8 -0
- package/build/jsx/props/Image.d.ts.map +1 -0
- package/build/jsx/props/Image.js +5 -0
- package/build/jsx/props/Image.js.map +1 -0
- package/build/jsx/props/Label.d.ts +8 -0
- package/build/jsx/props/Label.d.ts.map +1 -0
- package/build/jsx/props/Label.js +5 -0
- package/build/jsx/props/Label.js.map +1 -0
- package/build/jsx/props/LinearGradient.d.ts +14 -0
- package/build/jsx/props/LinearGradient.d.ts.map +1 -0
- package/build/jsx/props/LinearGradient.js +5 -0
- package/build/jsx/props/LinearGradient.js.map +1 -0
- package/build/jsx/props/LinearProgressView.d.ts +25 -0
- package/build/jsx/props/LinearProgressView.d.ts.map +1 -0
- package/build/jsx/props/LinearProgressView.js +5 -0
- package/build/jsx/props/LinearProgressView.js.map +1 -0
- package/build/jsx/props/Mask.d.ts +7 -0
- package/build/jsx/props/Mask.d.ts.map +1 -0
- package/build/jsx/props/Mask.js +5 -0
- package/build/jsx/props/Mask.js.map +1 -0
- package/build/jsx/props/Spacer.d.ts +6 -0
- package/build/jsx/props/Spacer.d.ts.map +1 -0
- package/build/jsx/props/Spacer.js +5 -0
- package/build/jsx/props/Spacer.js.map +1 -0
- package/build/jsx/props/Symbol.d.ts +20 -0
- package/build/jsx/props/Symbol.d.ts.map +1 -0
- package/build/jsx/props/Symbol.js +5 -0
- package/build/jsx/props/Symbol.js.map +1 -0
- package/build/jsx/props/Text.d.ts +8 -0
- package/build/jsx/props/Text.d.ts.map +1 -0
- package/build/jsx/props/Text.js +5 -0
- package/build/jsx/props/Text.js.map +1 -0
- package/build/jsx/props/Timer.d.ts +18 -0
- package/build/jsx/props/Timer.d.ts.map +1 -0
- package/build/jsx/props/Timer.js +5 -0
- package/build/jsx/props/Timer.js.map +1 -0
- package/build/jsx/props/Toggle.d.ts +6 -0
- package/build/jsx/props/Toggle.d.ts.map +1 -0
- package/build/jsx/props/Toggle.js +5 -0
- package/build/jsx/props/Toggle.js.map +1 -0
- package/build/jsx/props/VStack.d.ts +8 -0
- package/build/jsx/props/VStack.d.ts.map +1 -0
- package/build/jsx/props/VStack.js +5 -0
- package/build/jsx/props/VStack.js.map +1 -0
- package/build/jsx/props/ZStack.d.ts +6 -0
- package/build/jsx/props/ZStack.d.ts.map +1 -0
- package/build/jsx/props/ZStack.js +5 -0
- package/build/jsx/props/ZStack.js.map +1 -0
- package/build/live-activity/api.d.ts +179 -0
- package/build/live-activity/api.d.ts.map +1 -0
- package/build/live-activity/api.js +249 -0
- package/build/live-activity/api.js.map +1 -0
- package/build/live-activity/renderer.d.ts +11 -0
- package/build/live-activity/renderer.d.ts.map +1 -0
- package/build/live-activity/renderer.js +69 -0
- package/build/live-activity/renderer.js.map +1 -0
- package/build/live-activity/types.d.ts +54 -0
- package/build/live-activity/types.d.ts.map +1 -0
- package/build/live-activity/types.js +2 -0
- package/build/live-activity/types.js.map +1 -0
- package/build/logger.d.ts +16 -0
- package/build/logger.d.ts.map +1 -0
- package/build/logger.js +33 -0
- package/build/logger.js.map +1 -0
- package/build/payload/component-ids.d.ts +20 -0
- package/build/payload/component-ids.d.ts.map +1 -0
- package/build/payload/component-ids.js +76 -0
- package/build/payload/component-ids.js.map +1 -0
- package/build/payload/short-names.d.ts +20 -0
- package/build/payload/short-names.d.ts.map +1 -0
- package/build/payload/short-names.js +272 -0
- package/build/payload/short-names.js.map +1 -0
- package/build/payload.d.ts +2 -0
- package/build/payload.d.ts.map +1 -0
- package/build/payload.js +24 -0
- package/build/payload.js.map +1 -0
- package/build/preload.d.ts +102 -0
- package/build/preload.d.ts.map +1 -0
- package/build/preload.js +107 -0
- package/build/preload.js.map +1 -0
- package/build/renderer/context-registry.d.ts +13 -0
- package/build/renderer/context-registry.d.ts.map +1 -0
- package/build/renderer/context-registry.js +26 -0
- package/build/renderer/context-registry.js.map +1 -0
- package/build/renderer/dispatcher.d.ts +28 -0
- package/build/renderer/dispatcher.d.ts.map +1 -0
- package/build/renderer/dispatcher.js +32 -0
- package/build/renderer/dispatcher.js.map +1 -0
- package/build/renderer/element-registry.d.ts +24 -0
- package/build/renderer/element-registry.d.ts.map +1 -0
- package/build/renderer/element-registry.js +63 -0
- package/build/renderer/element-registry.js.map +1 -0
- package/build/renderer/flatten-styles.d.ts +5 -0
- package/build/renderer/flatten-styles.d.ts.map +1 -0
- package/build/renderer/flatten-styles.js +20 -0
- package/build/renderer/flatten-styles.js.map +1 -0
- package/build/renderer/index.d.ts +2 -0
- package/build/renderer/index.d.ts.map +1 -0
- package/build/renderer/index.js +2 -0
- package/build/renderer/index.js.map +1 -0
- package/build/renderer/render-cache.d.ts +6 -0
- package/build/renderer/render-cache.d.ts.map +1 -0
- package/build/renderer/render-cache.js +15 -0
- package/build/renderer/render-cache.js.map +1 -0
- package/build/renderer/renderer.d.ts +27 -0
- package/build/renderer/renderer.d.ts.map +1 -0
- package/build/renderer/renderer.js +425 -0
- package/build/renderer/renderer.js.map +1 -0
- package/build/renderer/stylesheet-registry.d.ts +6 -0
- package/build/renderer/stylesheet-registry.d.ts.map +1 -0
- package/build/renderer/stylesheet-registry.js +45 -0
- package/build/renderer/stylesheet-registry.js.map +1 -0
- package/build/renderer/types.d.ts +4 -0
- package/build/renderer/types.d.ts.map +1 -0
- package/build/renderer/types.js +2 -0
- package/build/renderer/types.js.map +1 -0
- package/build/server.d.ts +6 -0
- package/build/server.d.ts.map +1 -0
- package/build/server.js +29 -0
- package/build/server.js.map +1 -0
- package/build/styles/index.d.ts +2 -0
- package/build/styles/index.d.ts.map +1 -0
- package/build/styles/index.js +2 -0
- package/build/styles/index.js.map +1 -0
- package/build/styles/types.d.ts +8 -0
- package/build/styles/types.d.ts.map +1 -0
- package/build/styles/types.js +2 -0
- package/build/styles/types.js.map +1 -0
- package/build/types.d.ts +17 -0
- package/build/types.d.ts.map +1 -0
- package/build/types.js +2 -0
- package/build/types.js.map +1 -0
- package/build/utils/assertRunningOnApple.d.ts +2 -0
- package/build/utils/assertRunningOnApple.d.ts.map +1 -0
- package/build/utils/assertRunningOnApple.js +9 -0
- package/build/utils/assertRunningOnApple.js.map +1 -0
- package/build/utils/helpers.d.ts +12 -0
- package/build/utils/helpers.d.ts.map +1 -0
- package/build/utils/helpers.js +32 -0
- package/build/utils/helpers.js.map +1 -0
- package/build/utils/index.d.ts +3 -0
- package/build/utils/index.d.ts.map +1 -0
- package/build/utils/index.js +3 -0
- package/build/utils/index.js.map +1 -0
- package/build/utils/useUpdateOnHMR.d.ts +9 -0
- package/build/utils/useUpdateOnHMR.d.ts.map +1 -0
- package/build/utils/useUpdateOnHMR.js +23 -0
- package/build/utils/useUpdateOnHMR.js.map +1 -0
- package/build/widgets/renderer.d.ts +10 -0
- package/build/widgets/renderer.d.ts.map +1 -0
- package/build/widgets/renderer.js +22 -0
- package/build/widgets/renderer.js.map +1 -0
- package/build/widgets/types.d.ts +11 -0
- package/build/widgets/types.d.ts.map +1 -0
- package/build/widgets/types.js +2 -0
- package/build/widgets/types.js.map +1 -0
- package/build/widgets/widget-api.d.ts +87 -0
- package/build/widgets/widget-api.d.ts.map +1 -0
- package/build/widgets/widget-api.js +97 -0
- package/build/widgets/widget-api.js.map +1 -0
- package/expo-module.config.json +6 -0
- package/ios/Voltra.podspec +47 -0
- package/ios/app/VoltraLiveActivityService.swift +265 -0
- package/ios/app/VoltraModule.swift +563 -0
- package/ios/app/VoltraOptions.swift +121 -0
- package/ios/app/VoltraRN.swift +65 -0
- package/ios/shared/BrotliCompression.swift +81 -0
- package/ios/shared/ComponentTypeID.swift +105 -0
- package/ios/shared/Data+hexString.swift +10 -0
- package/ios/shared/Date+toTimerInterval.swift +25 -0
- package/ios/shared/JSONValue.swift +128 -0
- package/ios/shared/ShortNames.swift +144 -0
- package/ios/shared/VoltraAttributes.swift +58 -0
- package/ios/shared/VoltraConfig.swift +12 -0
- package/ios/shared/VoltraElement.swift +149 -0
- package/ios/shared/VoltraEvent.swift +72 -0
- package/ios/shared/VoltraEventBus.swift +79 -0
- package/ios/shared/VoltraImageStore.swift +119 -0
- package/ios/shared/VoltraInteractionIntent.swift +39 -0
- package/ios/shared/VoltraLiveActivityPayload.swift +113 -0
- package/ios/shared/VoltraNode.swift +183 -0
- package/ios/shared/VoltraPayloadMigrator.swift +63 -0
- package/ios/shared/VoltraPersistentEventQueue.swift +66 -0
- package/ios/shared/VoltraRegion.swift +34 -0
- package/ios/target/VoltraHomeWidget.swift +248 -0
- package/ios/target/VoltraWidget.swift +63 -0
- package/ios/ui/Extensions/View.modifiers.swift +28 -0
- package/ios/ui/Extensions/VoltraNode+Parameters.swift +18 -0
- package/ios/ui/Generated/Parameters/.generated +8 -0
- package/ios/ui/Generated/Parameters/ButtonParameters.swift +15 -0
- package/ios/ui/Generated/Parameters/CircularProgressViewParameters.swift +59 -0
- package/ios/ui/Generated/Parameters/ComponentParameters.swift +12 -0
- package/ios/ui/Generated/Parameters/DisclosureGroupParameters.swift +15 -0
- package/ios/ui/Generated/Parameters/DividerParameters.swift +12 -0
- package/ios/ui/Generated/Parameters/FormParameters.swift +12 -0
- package/ios/ui/Generated/Parameters/GaugeParameters.swift +69 -0
- package/ios/ui/Generated/Parameters/GlassContainerParameters.swift +15 -0
- package/ios/ui/Generated/Parameters/GroupBoxParameters.swift +15 -0
- package/ios/ui/Generated/Parameters/HSplitViewParameters.swift +12 -0
- package/ios/ui/Generated/Parameters/HStackParameters.swift +29 -0
- package/ios/ui/Generated/Parameters/ImageParameters.swift +29 -0
- package/ios/ui/Generated/Parameters/LabelParameters.swift +18 -0
- package/ios/ui/Generated/Parameters/LinearGradientParameters.swift +27 -0
- package/ios/ui/Generated/Parameters/LinearProgressViewParameters.swift +69 -0
- package/ios/ui/Generated/Parameters/ListParameters.swift +12 -0
- package/ios/ui/Generated/Parameters/MaskParameters.swift +15 -0
- package/ios/ui/Generated/Parameters/NavigationViewParameters.swift +12 -0
- package/ios/ui/Generated/Parameters/PickerParameters.swift +12 -0
- package/ios/ui/Generated/Parameters/ScrollViewParameters.swift +18 -0
- package/ios/ui/Generated/Parameters/SliderParameters.swift +27 -0
- package/ios/ui/Generated/Parameters/SpacerParameters.swift +15 -0
- package/ios/ui/Generated/Parameters/SymbolParameters.swift +59 -0
- package/ios/ui/Generated/Parameters/TextParameters.swift +18 -0
- package/ios/ui/Generated/Parameters/TimerParameters.swift +54 -0
- package/ios/ui/Generated/Parameters/ToggleParameters.swift +24 -0
- package/ios/ui/Generated/Parameters/VSplitViewParameters.swift +12 -0
- package/ios/ui/Generated/Parameters/VStackParameters.swift +29 -0
- package/ios/ui/Generated/Parameters/ZStackParameters.swift +15 -0
- package/ios/ui/Helpers/VoltraDeepLinkResolver.swift +29 -0
- package/ios/ui/Helpers/VoltraProgressDriver.swift +52 -0
- package/ios/ui/Protocols/VoltraView.swift +27 -0
- package/ios/ui/Style/CompositeStyle.swift +28 -0
- package/ios/ui/Style/DecorationStyle.swift +67 -0
- package/ios/ui/Style/FontVariant.swift +4 -0
- package/ios/ui/Style/GlassEffect.swift +6 -0
- package/ios/ui/Style/JSColorParser.swift +228 -0
- package/ios/ui/Style/JSStyleParser.swift +196 -0
- package/ios/ui/Style/LayoutStyle.swift +73 -0
- package/ios/ui/Style/Overflow.swift +4 -0
- package/ios/ui/Style/RenderingStyle.swift +33 -0
- package/ios/ui/Style/StyleConverter.swift +147 -0
- package/ios/ui/Style/TextDecoration.swift +6 -0
- package/ios/ui/Style/TextStyle.swift +31 -0
- package/ios/ui/Style/View+applyStyle.swift +20 -0
- package/ios/ui/Views/VoltraButton.swift +57 -0
- package/ios/ui/Views/VoltraCircularProgressView.swift +95 -0
- package/ios/ui/Views/VoltraDivider.swift +16 -0
- package/ios/ui/Views/VoltraGauge.swift +66 -0
- package/ios/ui/Views/VoltraGlassContainer.swift +28 -0
- package/ios/ui/Views/VoltraGroupBox.swift +27 -0
- package/ios/ui/Views/VoltraHStack.swift +30 -0
- package/ios/ui/Views/VoltraImage.swift +102 -0
- package/ios/ui/Views/VoltraLabel.swift +24 -0
- package/ios/ui/Views/VoltraLinearGradient.swift +86 -0
- package/ios/ui/Views/VoltraLinearProgressView.swift +135 -0
- package/ios/ui/Views/VoltraMask.swift +23 -0
- package/ios/ui/Views/VoltraSpacer.swift +16 -0
- package/ios/ui/Views/VoltraSymbol.swift +160 -0
- package/ios/ui/Views/VoltraText.swift +51 -0
- package/ios/ui/Views/VoltraTimer.swift +178 -0
- package/ios/ui/Views/VoltraToggle.swift +39 -0
- package/ios/ui/Views/VoltraVStack.swift +27 -0
- package/ios/ui/Views/VoltraZStack.swift +33 -0
- package/ios/ui/Voltra.swift +45 -0
- package/package.json +86 -7
- package/plugin/build/constants/index.d.ts +6 -0
- package/plugin/build/constants/index.js +16 -0
- package/plugin/build/constants/ios.d.ts +13 -0
- package/plugin/build/constants/ios.js +16 -0
- package/plugin/build/constants/paths.d.ts +5 -0
- package/plugin/build/constants/paths.js +8 -0
- package/plugin/build/constants/widgets.d.ts +14 -0
- package/plugin/build/constants/widgets.js +24 -0
- package/plugin/build/features/ios/eas/index.d.ts +14 -0
- package/plugin/build/features/ios/eas/index.js +62 -0
- package/plugin/build/features/ios/files/assets/catalog.d.ts +22 -0
- package/plugin/build/features/ios/files/assets/catalog.js +107 -0
- package/plugin/build/features/ios/files/assets/images.d.ts +23 -0
- package/plugin/build/features/ios/files/assets/images.js +108 -0
- package/plugin/build/features/ios/files/assets/index.d.ts +12 -0
- package/plugin/build/features/ios/files/assets/index.js +57 -0
- package/plugin/build/features/ios/files/entitlements.d.ts +19 -0
- package/plugin/build/features/ios/files/entitlements.js +74 -0
- package/plugin/build/features/ios/files/index.d.ts +20 -0
- package/plugin/build/features/ios/files/index.js +87 -0
- package/plugin/build/features/ios/files/plist.d.ts +6 -0
- package/plugin/build/features/ios/files/plist.js +69 -0
- package/plugin/build/features/ios/files/swift/index.d.ts +14 -0
- package/plugin/build/features/ios/files/swift/index.js +64 -0
- package/plugin/build/features/ios/files/swift/initialStates.d.ts +4 -0
- package/plugin/build/features/ios/files/swift/initialStates.js +88 -0
- package/plugin/build/features/ios/files/swift/prerender.d.ts +13 -0
- package/plugin/build/features/ios/files/swift/prerender.js +176 -0
- package/plugin/build/features/ios/files/swift/widgetBundle.d.ts +10 -0
- package/plugin/build/features/ios/files/swift/widgetBundle.js +103 -0
- package/plugin/build/features/ios/index.d.ts +20 -0
- package/plugin/build/features/ios/index.js +35 -0
- package/plugin/build/features/ios/plist/index.d.ts +14 -0
- package/plugin/build/features/ios/plist/index.js +42 -0
- package/plugin/build/features/ios/podfile/index.d.ts +8 -0
- package/plugin/build/features/ios/podfile/index.js +47 -0
- package/plugin/build/features/ios/xcode/build/configurationList.d.ts +15 -0
- package/plugin/build/features/ios/xcode/build/configurationList.js +54 -0
- package/plugin/build/features/ios/xcode/build/index.d.ts +29 -0
- package/plugin/build/features/ios/xcode/build/index.js +32 -0
- package/plugin/build/features/ios/xcode/build/phases.d.ts +17 -0
- package/plugin/build/features/ios/xcode/build/phases.js +59 -0
- package/plugin/build/features/ios/xcode/groups.d.ts +10 -0
- package/plugin/build/features/ios/xcode/groups.js +21 -0
- package/plugin/build/features/ios/xcode/index.d.ts +19 -0
- package/plugin/build/features/ios/xcode/index.js +125 -0
- package/plugin/build/features/ios/xcode/productFile.d.ts +9 -0
- package/plugin/build/features/ios/xcode/productFile.js +22 -0
- package/plugin/build/features/ios/xcode/target/dependency.d.ts +7 -0
- package/plugin/build/features/ios/xcode/target/dependency.js +15 -0
- package/plugin/build/features/ios/xcode/target/index.d.ts +33 -0
- package/plugin/build/features/ios/xcode/target/index.js +20 -0
- package/plugin/build/features/ios/xcode/target/nativeTarget.d.ts +28 -0
- package/plugin/build/features/ios/xcode/target/nativeTarget.js +25 -0
- package/plugin/build/features/ios/xcode/target/projectSection.d.ts +7 -0
- package/plugin/build/features/ios/xcode/target/projectSection.js +19 -0
- package/plugin/build/features/ios/xcode/utils/getMainAppTargetSettings.d.ts +14 -0
- package/plugin/build/features/ios/xcode/utils/getMainAppTargetSettings.js +70 -0
- package/plugin/build/features/pushNotifications/index.d.ts +9 -0
- package/plugin/build/features/pushNotifications/index.js +21 -0
- package/plugin/build/index.d.ts +12 -0
- package/plugin/build/index.js +56 -0
- package/plugin/build/types/index.d.ts +5 -0
- package/plugin/build/types/index.js +5 -0
- package/plugin/build/types/plugin.d.ts +41 -0
- package/plugin/build/types/plugin.js +2 -0
- package/plugin/build/types/widget.d.ts +46 -0
- package/plugin/build/types/widget.js +5 -0
- package/plugin/build/utils/fileDiscovery.d.ts +12 -0
- package/plugin/build/utils/fileDiscovery.js +106 -0
- package/plugin/build/utils/index.d.ts +6 -0
- package/plugin/build/utils/index.js +12 -0
- package/plugin/build/utils/logger.d.ts +29 -0
- package/plugin/build/utils/logger.js +50 -0
- package/plugin/build/utils/urlScheme.d.ts +9 -0
- package/plugin/build/utils/urlScheme.js +39 -0
- package/plugin/build/validation/index.d.ts +5 -0
- package/plugin/build/validation/index.js +10 -0
- package/plugin/build/validation/validateProps.d.ts +6 -0
- package/plugin/build/validation/validateProps.js +39 -0
- package/plugin/build/validation/validateWidget.d.ts +6 -0
- package/plugin/build/validation/validateWidget.js +46 -0
- package/index.js +0 -2
package/LICENSE.txt
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Saúl Sharma, Szymon Chmal
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,101 @@
|
|
|
1
|
-
|
|
1
|
+

|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
### Build Live Activities with JSX in React Native
|
|
4
|
+
|
|
5
|
+
[![mit licence][license-badge]][license] [![npm downloads][npm-downloads-badge]][npm-downloads] [![PRs Welcome][prs-welcome-badge]][prs-welcome]
|
|
6
|
+
|
|
7
|
+
Voltra turns React Native JSX into SwiftUI so you can ship custom Live Activities, Dynamic Island layouts without touching Xcode. Author everything in React, keep hot reload, and let the config plugin handle the extension targets.
|
|
8
|
+
|
|
9
|
+
## Features
|
|
10
|
+
|
|
11
|
+
- **Ship Native iOS Surfaces**: Create Live Activities, Dynamic Island variants, and static widgets directly from React components - no Swift or Xcode required.
|
|
12
|
+
|
|
13
|
+
- **Fast Development Workflow**: Hooks respect Fast Refresh and both JS and native layers enforce ActivityKit payload budgets.
|
|
14
|
+
|
|
15
|
+
- **Production-Ready Push Notifications**: Collect ActivityKit push tokens and push-to-start tokens, stream lifecycle updates, and build server-driven refreshes.
|
|
16
|
+
|
|
17
|
+
- **Familiar Styling**: Use React Native style props and ordered SwiftUI modifiers in one place.
|
|
18
|
+
|
|
19
|
+
- **Type-Safe & Developer-Friendly**: The Voltra schema, hooks, and examples ship with TypeScript definitions, tests, and docs so AI coding agents stay productive.
|
|
20
|
+
|
|
21
|
+
- **Works With Your Setup**: Compatible with Expo Dev Client and bare React Native projects. The config plugin automatically wires iOS extension targets for you.
|
|
22
|
+
|
|
23
|
+
## Documentation
|
|
24
|
+
|
|
25
|
+
The documentation is available at [use-voltra.dev](https://use-voltra.dev). You can also use the following links to jump to specific topics:
|
|
26
|
+
|
|
27
|
+
- [Quick Start](https://use-voltra.dev/docs/getting-started/quick-start)
|
|
28
|
+
- [API Reference](https://use-voltra.dev/docs/api/overview)
|
|
29
|
+
- [Examples](https://use-voltra.dev/docs/examples)
|
|
30
|
+
|
|
31
|
+
## Getting started
|
|
32
|
+
|
|
33
|
+
> [!NOTE]
|
|
34
|
+
> The library isn't supported in Expo Go. To set it up correctly, you need to use [Expo Dev Client](https://docs.expo.dev/versions/latest/sdk/dev-client/).
|
|
35
|
+
|
|
36
|
+
Install the package:
|
|
37
|
+
|
|
38
|
+
```sh
|
|
39
|
+
npm install voltra
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
Add the config plugin to your `app.json`:
|
|
43
|
+
|
|
44
|
+
```json
|
|
45
|
+
{
|
|
46
|
+
"expo": {
|
|
47
|
+
"plugins": ["voltra"]
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Then run `npx expo prebuild --clean` to generate the iOS extension target.
|
|
53
|
+
|
|
54
|
+
See the [documentation](https://use-voltra.dev/docs/getting-started/quick-start) for detailed setup instructions.
|
|
55
|
+
|
|
56
|
+
## Quick example
|
|
57
|
+
|
|
58
|
+
```tsx
|
|
59
|
+
import { useLiveActivity } from 'voltra/client'
|
|
60
|
+
import { Voltra } from 'voltra'
|
|
61
|
+
|
|
62
|
+
export function OrderTracker({ orderId }: { orderId: string }) {
|
|
63
|
+
const ui = (
|
|
64
|
+
<Voltra.VStack style={{ padding: 16, borderRadius: 14, backgroundColor: '#111827' }}>
|
|
65
|
+
<Voltra.Text style={{ color: 'white', fontSize: 18, fontWeight: '700' }}>Order #{orderId}</Voltra.Text>
|
|
66
|
+
<Voltra.Text style={{ color: '#9CA3AF', marginTop: 6 }}>Driver en route · ETA 12 min</Voltra.Text>
|
|
67
|
+
</Voltra.VStack>
|
|
68
|
+
)
|
|
69
|
+
|
|
70
|
+
const { start, update, end } = useLiveActivity(
|
|
71
|
+
{ lockScreen: ui },
|
|
72
|
+
{
|
|
73
|
+
activityName: `order-${orderId}`,
|
|
74
|
+
autoStart: true,
|
|
75
|
+
deepLinkUrl: `/orders/${orderId}`,
|
|
76
|
+
}
|
|
77
|
+
)
|
|
78
|
+
|
|
79
|
+
return null
|
|
80
|
+
}
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
## Platform compatibility
|
|
84
|
+
|
|
85
|
+
**Note:** This module is intended for use on **iOS devices only**.
|
|
86
|
+
|
|
87
|
+
## Made with ❤️ at Callstack
|
|
88
|
+
|
|
89
|
+
`voltra` is an open source project and will always remain free to use. If you think it's cool, please star it 🌟.
|
|
90
|
+
|
|
91
|
+
[Callstack][callstack-readme-with-love] is a group of React and React Native geeks, contact us at [hello@callstack.com](mailto:hello@callstack.com) if you need any help with these or just want to say hi!
|
|
92
|
+
|
|
93
|
+
Like the project? ⚛️ [Join the team](https://callstack.com/careers/?utm_campaign=Senior_RN&utm_source=github&utm_medium=readme) who does amazing stuff for clients and drives React Native Open Source! 🔥
|
|
94
|
+
|
|
95
|
+
[callstack-readme-with-love]: https://callstack.com/?utm_source=github.com&utm_medium=referral&utm_campaign=voltra&utm_term=readme-with-love
|
|
96
|
+
[license-badge]: https://img.shields.io/npm/l/voltra?style=for-the-badge
|
|
97
|
+
[license]: https://github.com/callstackincubator/voltra/blob/main/LICENSE.txt
|
|
98
|
+
[npm-downloads-badge]: https://img.shields.io/npm/dm/voltra?style=for-the-badge
|
|
99
|
+
[npm-downloads]: https://www.npmjs.com/package/voltra
|
|
100
|
+
[prs-welcome-badge]: https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=for-the-badge
|
|
101
|
+
[prs-welcome]: ./CONTRIBUTING.md
|
package/app.plugin.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VoltraModule.d.ts","sourceRoot":"","sources":["../src/VoltraModule.ts"],"names":[],"mappings":";AAEA,wBAAkD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VoltraModule.js","sourceRoot":"","sources":["../src/VoltraModule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,MAAM,CAAA;AAE1C,eAAe,mBAAmB,CAAC,cAAc,CAAC,CAAA","sourcesContent":["import { requireNativeModule } from 'expo'\n\nexport default requireNativeModule('VoltraModule')\n"]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export { isGlassSupported, isHeadless } from './helpers.js';
|
|
2
|
+
export * from './events.js';
|
|
3
|
+
export { VoltraLiveActivityPreview, type VoltraLiveActivityPreviewProps, } from './components/VoltraLiveActivityPreview.js';
|
|
4
|
+
export { VoltraView, type VoltraViewProps } from './components/VoltraView.js';
|
|
5
|
+
export { VoltraWidgetPreview, type VoltraWidgetPreviewProps } from './components/VoltraWidgetPreview.js';
|
|
6
|
+
export type { VoltraElementJson, VoltraNodeJson } from './types.js';
|
|
7
|
+
export { clearPreloadedImages, type PreloadImageOptions, preloadImages, type PreloadImagesResult, reloadLiveActivities, } from './preload.js';
|
|
8
|
+
export { endAllLiveActivities, type EndLiveActivityOptions, isLiveActivityActive, type SharedLiveActivityOptions, startLiveActivity, type StartLiveActivityOptions, stopLiveActivity, updateLiveActivity, type UpdateLiveActivityOptions, useLiveActivity, type UseLiveActivityOptions, type UseLiveActivityResult, } from './live-activity/api.js';
|
|
9
|
+
export type { DismissalPolicy, LiveActivityVariants } from './live-activity/types.js';
|
|
10
|
+
export type { WidgetFamily, WidgetVariants } from './widgets/types.js';
|
|
11
|
+
export { clearAllWidgets, clearWidget, reloadWidgets, updateWidget, type UpdateWidgetOptions, } from './widgets/widget-api.js';
|
|
12
|
+
//# sourceMappingURL=client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAG3D,cAAc,aAAa,CAAA;AAG3B,OAAO,EACL,yBAAyB,EACzB,KAAK,8BAA8B,GACpC,MAAM,2CAA2C,CAAA;AAClD,OAAO,EAAE,UAAU,EAAE,KAAK,eAAe,EAAE,MAAM,4BAA4B,CAAA;AAC7E,OAAO,EAAE,mBAAmB,EAAE,KAAK,wBAAwB,EAAE,MAAM,qCAAqC,CAAA;AAGxG,YAAY,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAGnE,OAAO,EACL,oBAAoB,EACpB,KAAK,mBAAmB,EACxB,aAAa,EACb,KAAK,mBAAmB,EACxB,oBAAoB,GACrB,MAAM,cAAc,CAAA;AAGrB,OAAO,EACL,oBAAoB,EACpB,KAAK,sBAAsB,EAC3B,oBAAoB,EACpB,KAAK,yBAAyB,EAC9B,iBAAiB,EACjB,KAAK,wBAAwB,EAC7B,gBAAgB,EAChB,kBAAkB,EAClB,KAAK,yBAAyB,EAC9B,eAAe,EACf,KAAK,sBAAsB,EAC3B,KAAK,qBAAqB,GAC3B,MAAM,wBAAwB,CAAA;AAC/B,YAAY,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAA;AAGrF,YAAY,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAA;AACtE,OAAO,EACL,eAAe,EACf,WAAW,EACX,aAAa,EACb,YAAY,EACZ,KAAK,mBAAmB,GACzB,MAAM,yBAAyB,CAAA"}
|
package/build/client.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// Helpers API
|
|
2
|
+
export { isGlassSupported, isHeadless } from './helpers.js';
|
|
3
|
+
// Events API
|
|
4
|
+
export * from './events.js';
|
|
5
|
+
// Preview API
|
|
6
|
+
export { VoltraLiveActivityPreview, } from './components/VoltraLiveActivityPreview.js';
|
|
7
|
+
export { VoltraView } from './components/VoltraView.js';
|
|
8
|
+
export { VoltraWidgetPreview } from './components/VoltraWidgetPreview.js';
|
|
9
|
+
// Preload API
|
|
10
|
+
export { clearPreloadedImages, preloadImages, reloadLiveActivities, } from './preload.js';
|
|
11
|
+
// Live Activity API
|
|
12
|
+
export { endAllLiveActivities, isLiveActivityActive, startLiveActivity, stopLiveActivity, updateLiveActivity, useLiveActivity, } from './live-activity/api.js';
|
|
13
|
+
export { clearAllWidgets, clearWidget, reloadWidgets, updateWidget, } from './widgets/widget-api.js';
|
|
14
|
+
//# sourceMappingURL=client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,cAAc;AACd,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAE3D,aAAa;AACb,cAAc,aAAa,CAAA;AAE3B,cAAc;AACd,OAAO,EACL,yBAAyB,GAE1B,MAAM,2CAA2C,CAAA;AAClD,OAAO,EAAE,UAAU,EAAwB,MAAM,4BAA4B,CAAA;AAC7E,OAAO,EAAE,mBAAmB,EAAiC,MAAM,qCAAqC,CAAA;AAKxG,cAAc;AACd,OAAO,EACL,oBAAoB,EAEpB,aAAa,EAEb,oBAAoB,GACrB,MAAM,cAAc,CAAA;AAErB,oBAAoB;AACpB,OAAO,EACL,oBAAoB,EAEpB,oBAAoB,EAEpB,iBAAiB,EAEjB,gBAAgB,EAChB,kBAAkB,EAElB,eAAe,GAGhB,MAAM,wBAAwB,CAAA;AAK/B,OAAO,EACL,eAAe,EACf,WAAW,EACX,aAAa,EACb,YAAY,GAEb,MAAM,yBAAyB,CAAA","sourcesContent":["// Helpers API\nexport { isGlassSupported, isHeadless } from './helpers.js'\n\n// Events API\nexport * from './events.js'\n\n// Preview API\nexport {\n VoltraLiveActivityPreview,\n type VoltraLiveActivityPreviewProps,\n} from './components/VoltraLiveActivityPreview.js'\nexport { VoltraView, type VoltraViewProps } from './components/VoltraView.js'\nexport { VoltraWidgetPreview, type VoltraWidgetPreviewProps } from './components/VoltraWidgetPreview.js'\n\n// Renderer API\nexport type { VoltraElementJson, VoltraNodeJson } from './types.js'\n\n// Preload API\nexport {\n clearPreloadedImages,\n type PreloadImageOptions,\n preloadImages,\n type PreloadImagesResult,\n reloadLiveActivities,\n} from './preload.js'\n\n// Live Activity API\nexport {\n endAllLiveActivities,\n type EndLiveActivityOptions,\n isLiveActivityActive,\n type SharedLiveActivityOptions,\n startLiveActivity,\n type StartLiveActivityOptions,\n stopLiveActivity,\n updateLiveActivity,\n type UpdateLiveActivityOptions,\n useLiveActivity,\n type UseLiveActivityOptions,\n type UseLiveActivityResult,\n} from './live-activity/api.js'\nexport type { DismissalPolicy, LiveActivityVariants } from './live-activity/types.js'\n\n// Widget API\nexport type { WidgetFamily, WidgetVariants } from './widgets/types.js'\nexport {\n clearAllWidgets,\n clearWidget,\n reloadWidgets,\n updateWidget,\n type UpdateWidgetOptions,\n} from './widgets/widget-api.js'\n"]}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { StyleProp, ViewStyle } from 'react-native';
|
|
3
|
+
import { VoltraViewProps } from './VoltraView.js';
|
|
4
|
+
export type VoltraLiveActivityPreviewProps = Omit<VoltraViewProps, 'style'> & {
|
|
5
|
+
/**
|
|
6
|
+
* Additional styles to apply on top of the lock screen dimensions
|
|
7
|
+
*/
|
|
8
|
+
style?: StyleProp<ViewStyle>;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* A preview component that renders Voltra JSX lock screen Live Activity content
|
|
12
|
+
* at the exact dimensions of a lock screen Live Activity. Useful for testing
|
|
13
|
+
* Live Activity layouts.
|
|
14
|
+
*
|
|
15
|
+
* This component extends VoltraView but automatically sets the width and height
|
|
16
|
+
* to match the lock screen Live Activity dimensions. Live Activities cannot be
|
|
17
|
+
* fully emulated, so this provides a close approximation for development.
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```tsx
|
|
21
|
+
* <VoltraLiveActivityPreview
|
|
22
|
+
* style={{ backgroundColor: 'lightgray' }}
|
|
23
|
+
* >
|
|
24
|
+
* <Voltra.Text>Hello Live Activity!</Voltra.Text>
|
|
25
|
+
* </VoltraLiveActivityPreview>
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
28
|
+
export declare function VoltraLiveActivityPreview({ style, children, ...voltraViewProps }: VoltraLiveActivityPreviewProps): React.JSX.Element;
|
|
29
|
+
//# sourceMappingURL=VoltraLiveActivityPreview.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VoltraLiveActivityPreview.d.ts","sourceRoot":"","sources":["../../src/components/VoltraLiveActivityPreview.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAEnD,OAAO,EAAc,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAW7D,MAAM,MAAM,8BAA8B,GAAG,IAAI,CAAC,eAAe,EAAE,OAAO,CAAC,GAAG;IAC5E;;OAEG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAA;CAC7B,CAAA;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,yBAAyB,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,eAAe,EAAE,EAAE,8BAA8B,qBAchH"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { VoltraView } from './VoltraView.js';
|
|
3
|
+
/**
|
|
4
|
+
* Dimensions for iOS lock screen Live Activity in points (approximate)
|
|
5
|
+
* Based on iPhone 14 Pro/15 Pro dimensions
|
|
6
|
+
*/
|
|
7
|
+
const LOCK_SCREEN_DIMENSIONS = {
|
|
8
|
+
width: 364,
|
|
9
|
+
height: 160,
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* A preview component that renders Voltra JSX lock screen Live Activity content
|
|
13
|
+
* at the exact dimensions of a lock screen Live Activity. Useful for testing
|
|
14
|
+
* Live Activity layouts.
|
|
15
|
+
*
|
|
16
|
+
* This component extends VoltraView but automatically sets the width and height
|
|
17
|
+
* to match the lock screen Live Activity dimensions. Live Activities cannot be
|
|
18
|
+
* fully emulated, so this provides a close approximation for development.
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```tsx
|
|
22
|
+
* <VoltraLiveActivityPreview
|
|
23
|
+
* style={{ backgroundColor: 'lightgray' }}
|
|
24
|
+
* >
|
|
25
|
+
* <Voltra.Text>Hello Live Activity!</Voltra.Text>
|
|
26
|
+
* </VoltraLiveActivityPreview>
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
29
|
+
export function VoltraLiveActivityPreview({ style, children, ...voltraViewProps }) {
|
|
30
|
+
const previewStyle = [
|
|
31
|
+
{
|
|
32
|
+
width: LOCK_SCREEN_DIMENSIONS.width,
|
|
33
|
+
height: LOCK_SCREEN_DIMENSIONS.height,
|
|
34
|
+
},
|
|
35
|
+
style,
|
|
36
|
+
];
|
|
37
|
+
return (<VoltraView {...voltraViewProps} style={previewStyle}>
|
|
38
|
+
{children}
|
|
39
|
+
</VoltraView>);
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=VoltraLiveActivityPreview.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VoltraLiveActivityPreview.js","sourceRoot":"","sources":["../../src/components/VoltraLiveActivityPreview.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB,OAAO,EAAE,UAAU,EAAmB,MAAM,iBAAiB,CAAA;AAE7D;;;GAGG;AACH,MAAM,sBAAsB,GAAG;IAC7B,KAAK,EAAE,GAAG;IACV,MAAM,EAAE,GAAG;CACZ,CAAA;AASD;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,UAAU,yBAAyB,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,eAAe,EAAkC;IAC/G,MAAM,YAAY,GAAyB;QACzC;YACE,KAAK,EAAE,sBAAsB,CAAC,KAAK;YACnC,MAAM,EAAE,sBAAsB,CAAC,MAAM;SACtC;QACD,KAAK;KACN,CAAA;IAED,OAAO,CACL,CAAC,UAAU,CAAC,IAAI,eAAe,CAAC,CAAC,KAAK,CAAC,CAAC,YAAY,CAAC,CACnD;MAAA,CAAC,QAAQ,CACX;IAAA,EAAE,UAAU,CAAC,CACd,CAAA;AACH,CAAC","sourcesContent":["import React from 'react'\nimport { StyleProp, ViewStyle } from 'react-native'\n\nimport { VoltraView, VoltraViewProps } from './VoltraView.js'\n\n/**\n * Dimensions for iOS lock screen Live Activity in points (approximate)\n * Based on iPhone 14 Pro/15 Pro dimensions\n */\nconst LOCK_SCREEN_DIMENSIONS = {\n width: 364,\n height: 160,\n}\n\nexport type VoltraLiveActivityPreviewProps = Omit<VoltraViewProps, 'style'> & {\n /**\n * Additional styles to apply on top of the lock screen dimensions\n */\n style?: StyleProp<ViewStyle>\n}\n\n/**\n * A preview component that renders Voltra JSX lock screen Live Activity content\n * at the exact dimensions of a lock screen Live Activity. Useful for testing\n * Live Activity layouts.\n *\n * This component extends VoltraView but automatically sets the width and height\n * to match the lock screen Live Activity dimensions. Live Activities cannot be\n * fully emulated, so this provides a close approximation for development.\n *\n * @example\n * ```tsx\n * <VoltraLiveActivityPreview\n * style={{ backgroundColor: 'lightgray' }}\n * >\n * <Voltra.Text>Hello Live Activity!</Voltra.Text>\n * </VoltraLiveActivityPreview>\n * ```\n */\nexport function VoltraLiveActivityPreview({ style, children, ...voltraViewProps }: VoltraLiveActivityPreviewProps) {\n const previewStyle: StyleProp<ViewStyle> = [\n {\n width: LOCK_SCREEN_DIMENSIONS.width,\n height: LOCK_SCREEN_DIMENSIONS.height,\n },\n style,\n ]\n\n return (\n <VoltraView {...voltraViewProps} style={previewStyle}>\n {children}\n </VoltraView>\n )\n}\n"]}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
|
+
import { StyleProp, ViewStyle } from 'react-native';
|
|
3
|
+
import { VoltraInteractionEvent } from '../events.js';
|
|
4
|
+
export type VoltraViewProps = {
|
|
5
|
+
/**
|
|
6
|
+
* Unique identifier for this view instance.
|
|
7
|
+
* Used as 'source' in interaction events to identify which view triggered the event.
|
|
8
|
+
* If not provided, a unique ID will be generated automatically.
|
|
9
|
+
*/
|
|
10
|
+
id?: string;
|
|
11
|
+
/**
|
|
12
|
+
* Voltra JSX components to render
|
|
13
|
+
*/
|
|
14
|
+
children: ReactNode;
|
|
15
|
+
/**
|
|
16
|
+
* Style for the view container
|
|
17
|
+
*/
|
|
18
|
+
style?: StyleProp<ViewStyle>;
|
|
19
|
+
/**
|
|
20
|
+
* Callback when user interacts with components in the view.
|
|
21
|
+
* Events are filtered by this view's id (source).
|
|
22
|
+
*/
|
|
23
|
+
onInteraction?: (event: VoltraInteractionEvent) => void;
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* A React Native component that renders Voltra UI using SwiftUI in the native layer.
|
|
27
|
+
* This component accepts Voltra JSX components as children and renders them as SwiftUI components.
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* ```tsx
|
|
31
|
+
* <VoltraView id="my-view" style={{ width: 200, height: 100 }}>
|
|
32
|
+
* <Voltra.VStack>
|
|
33
|
+
* <Voltra.Text>Hello World</Voltra.Text>
|
|
34
|
+
* </Voltra.VStack>
|
|
35
|
+
* </VoltraView>
|
|
36
|
+
* ```
|
|
37
|
+
*/
|
|
38
|
+
export declare function VoltraView({ id, children, style, onInteraction }: VoltraViewProps): React.JSX.Element;
|
|
39
|
+
//# sourceMappingURL=VoltraView.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VoltraView.d.ts","sourceRoot":"","sources":["../../src/components/VoltraView.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAsB,MAAM,OAAO,CAAA;AAC5D,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAEnD,OAAO,EAAqB,sBAAsB,EAAE,MAAM,cAAc,CAAA;AAQxE,MAAM,MAAM,eAAe,GAAG;IAC5B;;;;OAIG;IACH,EAAE,CAAC,EAAE,MAAM,CAAA;IACX;;OAEG;IACH,QAAQ,EAAE,SAAS,CAAA;IACnB;;OAEG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAA;IAC5B;;;OAGG;IACH,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,sBAAsB,KAAK,IAAI,CAAA;CACxD,CAAA;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,UAAU,CAAC,EAAE,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,aAAa,EAAE,EAAE,eAAe,qBA4BjF"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { requireNativeView } from 'expo';
|
|
2
|
+
import React, { useEffect, useMemo } from 'react';
|
|
3
|
+
import { addVoltraListener } from '../events.js';
|
|
4
|
+
import { renderVoltraVariantToJson } from '../renderer/index.js';
|
|
5
|
+
const NativeVoltraView = requireNativeView('VoltraModule');
|
|
6
|
+
// Generate a unique ID for views that don't have one
|
|
7
|
+
const generateViewId = () => `voltra-view-${Date.now()}-${Math.random().toString(36).substring(2, 9)}`;
|
|
8
|
+
/**
|
|
9
|
+
* A React Native component that renders Voltra UI using SwiftUI in the native layer.
|
|
10
|
+
* This component accepts Voltra JSX components as children and renders them as SwiftUI components.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```tsx
|
|
14
|
+
* <VoltraView id="my-view" style={{ width: 200, height: 100 }}>
|
|
15
|
+
* <Voltra.VStack>
|
|
16
|
+
* <Voltra.Text>Hello World</Voltra.Text>
|
|
17
|
+
* </Voltra.VStack>
|
|
18
|
+
* </VoltraView>
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
export function VoltraView({ id, children, style, onInteraction }) {
|
|
22
|
+
// Generate a stable ID if not provided
|
|
23
|
+
const viewId = useMemo(() => id || generateViewId(), [id]);
|
|
24
|
+
const json = renderVoltraVariantToJson(children);
|
|
25
|
+
const payload = JSON.stringify(json);
|
|
26
|
+
// Subscribe to interaction events and filter by this view's ID
|
|
27
|
+
useEffect(() => {
|
|
28
|
+
if (!onInteraction)
|
|
29
|
+
return;
|
|
30
|
+
const subscription = addVoltraListener('interaction', (event) => {
|
|
31
|
+
// Only forward events from this view
|
|
32
|
+
if (event.source === viewId) {
|
|
33
|
+
onInteraction({
|
|
34
|
+
type: 'interaction',
|
|
35
|
+
source: event.source,
|
|
36
|
+
timestamp: event.timestamp,
|
|
37
|
+
identifier: event.identifier,
|
|
38
|
+
payload: event.payload,
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
return () => subscription.remove();
|
|
43
|
+
}, [viewId, onInteraction]);
|
|
44
|
+
return <NativeVoltraView payload={payload} viewId={viewId} style={style}/>;
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=VoltraView.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VoltraView.js","sourceRoot":"","sources":["../../src/components/VoltraView.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,MAAM,CAAA;AACxC,OAAO,KAAK,EAAE,EAAa,SAAS,EAAE,OAAO,EAAE,MAAM,OAAO,CAAA;AAG5D,OAAO,EAAE,iBAAiB,EAA0B,MAAM,cAAc,CAAA;AACxE,OAAO,EAAE,yBAAyB,EAAE,MAAM,sBAAsB,CAAA;AAEhE,MAAM,gBAAgB,GAAG,iBAAiB,CAAC,cAAc,CAAC,CAAA;AAE1D,qDAAqD;AACrD,MAAM,cAAc,GAAG,GAAG,EAAE,CAAC,eAAe,IAAI,CAAC,GAAG,EAAE,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAA;AAwBtG;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,UAAU,CAAC,EAAE,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,aAAa,EAAmB;IAChF,uCAAuC;IACvC,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,EAAE,IAAI,cAAc,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC,CAAA;IAE1D,MAAM,IAAI,GAAG,yBAAyB,CAAC,QAAQ,CAAC,CAAA;IAChD,MAAM,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAA;IAEpC,+DAA+D;IAC/D,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,CAAC,aAAa;YAAE,OAAM;QAE1B,MAAM,YAAY,GAAG,iBAAiB,CAAC,aAAa,EAAE,CAAC,KAAK,EAAE,EAAE;YAC9D,qCAAqC;YACrC,IAAI,KAAK,CAAC,MAAM,KAAK,MAAM,EAAE,CAAC;gBAC5B,aAAa,CAAC;oBACZ,IAAI,EAAE,aAAa;oBACnB,MAAM,EAAE,KAAK,CAAC,MAAM;oBACpB,SAAS,EAAE,KAAK,CAAC,SAAS;oBAC1B,UAAU,EAAE,KAAK,CAAC,UAAU;oBAC5B,OAAO,EAAE,KAAK,CAAC,OAAO;iBACvB,CAAC,CAAA;YACJ,CAAC;QACH,CAAC,CAAC,CAAA;QAEF,OAAO,GAAG,EAAE,CAAC,YAAY,CAAC,MAAM,EAAE,CAAA;IACpC,CAAC,EAAE,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC,CAAA;IAE3B,OAAO,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,EAAG,CAAA;AAC7E,CAAC","sourcesContent":["import { requireNativeView } from 'expo'\nimport React, { ReactNode, useEffect, useMemo } from 'react'\nimport { StyleProp, ViewStyle } from 'react-native'\n\nimport { addVoltraListener, VoltraInteractionEvent } from '../events.js'\nimport { renderVoltraVariantToJson } from '../renderer/index.js'\n\nconst NativeVoltraView = requireNativeView('VoltraModule')\n\n// Generate a unique ID for views that don't have one\nconst generateViewId = () => `voltra-view-${Date.now()}-${Math.random().toString(36).substring(2, 9)}`\n\nexport type VoltraViewProps = {\n /**\n * Unique identifier for this view instance.\n * Used as 'source' in interaction events to identify which view triggered the event.\n * If not provided, a unique ID will be generated automatically.\n */\n id?: string\n /**\n * Voltra JSX components to render\n */\n children: ReactNode\n /**\n * Style for the view container\n */\n style?: StyleProp<ViewStyle>\n /**\n * Callback when user interacts with components in the view.\n * Events are filtered by this view's id (source).\n */\n onInteraction?: (event: VoltraInteractionEvent) => void\n}\n\n/**\n * A React Native component that renders Voltra UI using SwiftUI in the native layer.\n * This component accepts Voltra JSX components as children and renders them as SwiftUI components.\n *\n * @example\n * ```tsx\n * <VoltraView id=\"my-view\" style={{ width: 200, height: 100 }}>\n * <Voltra.VStack>\n * <Voltra.Text>Hello World</Voltra.Text>\n * </Voltra.VStack>\n * </VoltraView>\n * ```\n */\nexport function VoltraView({ id, children, style, onInteraction }: VoltraViewProps) {\n // Generate a stable ID if not provided\n const viewId = useMemo(() => id || generateViewId(), [id])\n\n const json = renderVoltraVariantToJson(children)\n const payload = JSON.stringify(json)\n\n // Subscribe to interaction events and filter by this view's ID\n useEffect(() => {\n if (!onInteraction) return\n\n const subscription = addVoltraListener('interaction', (event) => {\n // Only forward events from this view\n if (event.source === viewId) {\n onInteraction({\n type: 'interaction',\n source: event.source,\n timestamp: event.timestamp,\n identifier: event.identifier,\n payload: event.payload,\n })\n }\n })\n\n return () => subscription.remove()\n }, [viewId, onInteraction])\n\n return <NativeVoltraView payload={payload} viewId={viewId} style={style} />\n}\n"]}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { StyleProp, ViewStyle } from 'react-native';
|
|
3
|
+
import { WidgetFamily } from '../widgets/types.js';
|
|
4
|
+
import { VoltraViewProps } from './VoltraView.js';
|
|
5
|
+
export type VoltraWidgetPreviewProps = Omit<VoltraViewProps, 'style'> & {
|
|
6
|
+
/**
|
|
7
|
+
* Widget family size to preview
|
|
8
|
+
*/
|
|
9
|
+
family: WidgetFamily;
|
|
10
|
+
/**
|
|
11
|
+
* Additional styles to apply on top of the widget dimensions
|
|
12
|
+
*/
|
|
13
|
+
style?: StyleProp<ViewStyle>;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* A preview component that renders Voltra JSX content at the exact dimensions
|
|
17
|
+
* of a specific iOS widget family. Useful for testing widget layouts.
|
|
18
|
+
*
|
|
19
|
+
* This component extends VoltraView but automatically sets the width and height
|
|
20
|
+
* to match the specified widget family's dimensions.
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* ```tsx
|
|
24
|
+
* <VoltraWidgetPreview
|
|
25
|
+
* family="systemSmall"
|
|
26
|
+
* style={{ backgroundColor: 'lightgray' }}
|
|
27
|
+
* >
|
|
28
|
+
* <Voltra.Text>Hello Widget!</Voltra.Text>
|
|
29
|
+
* </VoltraWidgetPreview>
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
export declare function VoltraWidgetPreview({ family, style, children, ...voltraViewProps }: VoltraWidgetPreviewProps): React.JSX.Element;
|
|
33
|
+
//# sourceMappingURL=VoltraWidgetPreview.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VoltraWidgetPreview.d.ts","sourceRoot":"","sources":["../../src/components/VoltraWidgetPreview.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAEnD,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAClD,OAAO,EAAc,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAgB7D,MAAM,MAAM,wBAAwB,GAAG,IAAI,CAAC,eAAe,EAAE,OAAO,CAAC,GAAG;IACtE;;OAEG;IACH,MAAM,EAAE,YAAY,CAAA;IACpB;;OAEG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAA;CAC7B,CAAA;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,mBAAmB,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,eAAe,EAAE,EAAE,wBAAwB,qBAe5G"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { VoltraView } from './VoltraView.js';
|
|
3
|
+
/**
|
|
4
|
+
* Dimensions for iOS widget families in points (approximate)
|
|
5
|
+
* Based on iPhone 14 Pro/15 Pro dimensions
|
|
6
|
+
*/
|
|
7
|
+
const WIDGET_DIMENSIONS = {
|
|
8
|
+
systemSmall: { width: 170, height: 170 },
|
|
9
|
+
systemMedium: { width: 364, height: 170 },
|
|
10
|
+
systemLarge: { width: 364, height: 382 },
|
|
11
|
+
systemExtraLarge: { width: 364, height: 768 }, // Approximate for iPad
|
|
12
|
+
accessoryCircular: { width: 76, height: 76 },
|
|
13
|
+
accessoryRectangular: { width: 172, height: 76 },
|
|
14
|
+
accessoryInline: { width: 172, height: 40 }, // Approximate
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* A preview component that renders Voltra JSX content at the exact dimensions
|
|
18
|
+
* of a specific iOS widget family. Useful for testing widget layouts.
|
|
19
|
+
*
|
|
20
|
+
* This component extends VoltraView but automatically sets the width and height
|
|
21
|
+
* to match the specified widget family's dimensions.
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* ```tsx
|
|
25
|
+
* <VoltraWidgetPreview
|
|
26
|
+
* family="systemSmall"
|
|
27
|
+
* style={{ backgroundColor: 'lightgray' }}
|
|
28
|
+
* >
|
|
29
|
+
* <Voltra.Text>Hello Widget!</Voltra.Text>
|
|
30
|
+
* </VoltraWidgetPreview>
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
33
|
+
export function VoltraWidgetPreview({ family, style, children, ...voltraViewProps }) {
|
|
34
|
+
const dimensions = WIDGET_DIMENSIONS[family];
|
|
35
|
+
const previewStyle = [
|
|
36
|
+
{
|
|
37
|
+
width: dimensions.width,
|
|
38
|
+
height: dimensions.height,
|
|
39
|
+
},
|
|
40
|
+
style,
|
|
41
|
+
];
|
|
42
|
+
return (<VoltraView {...voltraViewProps} style={previewStyle}>
|
|
43
|
+
{children}
|
|
44
|
+
</VoltraView>);
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=VoltraWidgetPreview.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VoltraWidgetPreview.js","sourceRoot":"","sources":["../../src/components/VoltraWidgetPreview.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAIzB,OAAO,EAAE,UAAU,EAAmB,MAAM,iBAAiB,CAAA;AAE7D;;;GAGG;AACH,MAAM,iBAAiB,GAA4D;IACjF,WAAW,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE;IACxC,YAAY,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE;IACzC,WAAW,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE;IACxC,gBAAgB,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,EAAE,uBAAuB;IACtE,iBAAiB,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE;IAC5C,oBAAoB,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,EAAE,EAAE;IAChD,eAAe,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,cAAc;CAC5D,CAAA;AAaD;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,mBAAmB,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,eAAe,EAA4B;IAC3G,MAAM,UAAU,GAAG,iBAAiB,CAAC,MAAM,CAAC,CAAA;IAC5C,MAAM,YAAY,GAAyB;QACzC;YACE,KAAK,EAAE,UAAU,CAAC,KAAK;YACvB,MAAM,EAAE,UAAU,CAAC,MAAM;SAC1B;QACD,KAAK;KACN,CAAA;IAED,OAAO,CACL,CAAC,UAAU,CAAC,IAAI,eAAe,CAAC,CAAC,KAAK,CAAC,CAAC,YAAY,CAAC,CACnD;MAAA,CAAC,QAAQ,CACX;IAAA,EAAE,UAAU,CAAC,CACd,CAAA;AACH,CAAC","sourcesContent":["import React from 'react'\nimport { StyleProp, ViewStyle } from 'react-native'\n\nimport { WidgetFamily } from '../widgets/types.js'\nimport { VoltraView, VoltraViewProps } from './VoltraView.js'\n\n/**\n * Dimensions for iOS widget families in points (approximate)\n * Based on iPhone 14 Pro/15 Pro dimensions\n */\nconst WIDGET_DIMENSIONS: Record<WidgetFamily, { width: number; height: number }> = {\n systemSmall: { width: 170, height: 170 },\n systemMedium: { width: 364, height: 170 },\n systemLarge: { width: 364, height: 382 },\n systemExtraLarge: { width: 364, height: 768 }, // Approximate for iPad\n accessoryCircular: { width: 76, height: 76 },\n accessoryRectangular: { width: 172, height: 76 },\n accessoryInline: { width: 172, height: 40 }, // Approximate\n}\n\nexport type VoltraWidgetPreviewProps = Omit<VoltraViewProps, 'style'> & {\n /**\n * Widget family size to preview\n */\n family: WidgetFamily\n /**\n * Additional styles to apply on top of the widget dimensions\n */\n style?: StyleProp<ViewStyle>\n}\n\n/**\n * A preview component that renders Voltra JSX content at the exact dimensions\n * of a specific iOS widget family. Useful for testing widget layouts.\n *\n * This component extends VoltraView but automatically sets the width and height\n * to match the specified widget family's dimensions.\n *\n * @example\n * ```tsx\n * <VoltraWidgetPreview\n * family=\"systemSmall\"\n * style={{ backgroundColor: 'lightgray' }}\n * >\n * <Voltra.Text>Hello Widget!</Voltra.Text>\n * </VoltraWidgetPreview>\n * ```\n */\nexport function VoltraWidgetPreview({ family, style, children, ...voltraViewProps }: VoltraWidgetPreviewProps) {\n const dimensions = WIDGET_DIMENSIONS[family]\n const previewStyle: StyleProp<ViewStyle> = [\n {\n width: dimensions.width,\n height: dimensions.height,\n },\n style,\n ]\n\n return (\n <VoltraView {...voltraViewProps} style={previewStyle}>\n {children}\n </VoltraView>\n )\n}\n"]}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export type EventSubscription = {
|
|
2
|
+
remove: () => void;
|
|
3
|
+
};
|
|
4
|
+
export type BasicVoltraEvent = {
|
|
5
|
+
source: string;
|
|
6
|
+
timestamp: number;
|
|
7
|
+
};
|
|
8
|
+
export type VoltraActivityState = 'active' | 'dismissed' | 'pending' | 'stale' | 'ended' | string;
|
|
9
|
+
export type VoltraActivityTokenReceivedEvent = BasicVoltraEvent & {
|
|
10
|
+
type: 'activityTokenReceived';
|
|
11
|
+
activityName: string;
|
|
12
|
+
pushToken: string;
|
|
13
|
+
};
|
|
14
|
+
export type VoltraActivityPushToStartTokenReceivedEvent = BasicVoltraEvent & {
|
|
15
|
+
type: 'activityPushToStartTokenReceived';
|
|
16
|
+
pushToStartToken: string;
|
|
17
|
+
};
|
|
18
|
+
export type VoltraActivityUpdateEvent = BasicVoltraEvent & {
|
|
19
|
+
type: 'stateChange';
|
|
20
|
+
activityName: string;
|
|
21
|
+
activityState: VoltraActivityState;
|
|
22
|
+
};
|
|
23
|
+
export type VoltraInteractionEvent = BasicVoltraEvent & {
|
|
24
|
+
type: 'interaction';
|
|
25
|
+
identifier: string;
|
|
26
|
+
payload: string;
|
|
27
|
+
};
|
|
28
|
+
export type VoltraEventMap = {
|
|
29
|
+
activityTokenReceived: VoltraActivityTokenReceivedEvent;
|
|
30
|
+
activityPushToStartTokenReceived: VoltraActivityPushToStartTokenReceivedEvent;
|
|
31
|
+
stateChange: VoltraActivityUpdateEvent;
|
|
32
|
+
interaction: VoltraInteractionEvent;
|
|
33
|
+
};
|
|
34
|
+
export declare function addVoltraListener<K extends keyof VoltraEventMap>(event: K, listener: (event: VoltraEventMap[K]) => void): EventSubscription;
|
|
35
|
+
//# sourceMappingURL=events.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../src/events.ts"],"names":[],"mappings":"AAGA,MAAM,MAAM,iBAAiB,GAAG;IAC9B,MAAM,EAAE,MAAM,IAAI,CAAA;CACnB,CAAA;AAED,MAAM,MAAM,gBAAgB,GAAG;IAC7B,MAAM,EAAE,MAAM,CAAA;IACd,SAAS,EAAE,MAAM,CAAA;CAClB,CAAA;AAED,MAAM,MAAM,mBAAmB,GAAG,QAAQ,GAAG,WAAW,GAAG,SAAS,GAAG,OAAO,GAAG,OAAO,GAAG,MAAM,CAAA;AACjG,MAAM,MAAM,gCAAgC,GAAG,gBAAgB,GAAG;IAChE,IAAI,EAAE,uBAAuB,CAAA;IAC7B,YAAY,EAAE,MAAM,CAAA;IACpB,SAAS,EAAE,MAAM,CAAA;CAClB,CAAA;AACD,MAAM,MAAM,2CAA2C,GAAG,gBAAgB,GAAG;IAC3E,IAAI,EAAE,kCAAkC,CAAA;IACxC,gBAAgB,EAAE,MAAM,CAAA;CACzB,CAAA;AACD,MAAM,MAAM,yBAAyB,GAAG,gBAAgB,GAAG;IACzD,IAAI,EAAE,aAAa,CAAA;IACnB,YAAY,EAAE,MAAM,CAAA;IACpB,aAAa,EAAE,mBAAmB,CAAA;CACnC,CAAA;AAED,MAAM,MAAM,sBAAsB,GAAG,gBAAgB,GAAG;IACtD,IAAI,EAAE,aAAa,CAAA;IACnB,UAAU,EAAE,MAAM,CAAA;IAClB,OAAO,EAAE,MAAM,CAAA;CAChB,CAAA;AAMD,MAAM,MAAM,cAAc,GAAG;IAC3B,qBAAqB,EAAE,gCAAgC,CAAA;IACvD,gCAAgC,EAAE,2CAA2C,CAAA;IAC7E,WAAW,EAAE,yBAAyB,CAAA;IACtC,WAAW,EAAE,sBAAsB,CAAA;CACpC,CAAA;AAED,wBAAgB,iBAAiB,CAAC,CAAC,SAAS,MAAM,cAAc,EAC9D,KAAK,EAAE,CAAC,EACR,QAAQ,EAAE,CAAC,KAAK,EAAE,cAAc,CAAC,CAAC,CAAC,KAAK,IAAI,GAC3C,iBAAiB,CAMnB"}
|
package/build/events.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { assertRunningOnApple } from './utils/index.js';
|
|
2
|
+
import VoltraModule from './VoltraModule.js';
|
|
3
|
+
const noopSubscription = {
|
|
4
|
+
remove: () => { },
|
|
5
|
+
};
|
|
6
|
+
export function addVoltraListener(event, listener) {
|
|
7
|
+
if (!assertRunningOnApple()) {
|
|
8
|
+
return noopSubscription;
|
|
9
|
+
}
|
|
10
|
+
return VoltraModule.addListener(event, listener);
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=events.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"events.js","sourceRoot":"","sources":["../src/events.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAA;AACvD,OAAO,YAAY,MAAM,mBAAmB,CAAA;AAiC5C,MAAM,gBAAgB,GAAsB;IAC1C,MAAM,EAAE,GAAG,EAAE,GAAE,CAAC;CACjB,CAAA;AASD,MAAM,UAAU,iBAAiB,CAC/B,KAAQ,EACR,QAA4C;IAE5C,IAAI,CAAC,oBAAoB,EAAE,EAAE,CAAC;QAC5B,OAAO,gBAAgB,CAAA;IACzB,CAAC;IAED,OAAO,YAAY,CAAC,WAAW,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAA;AAClD,CAAC","sourcesContent":["import { assertRunningOnApple } from './utils/index.js'\nimport VoltraModule from './VoltraModule.js'\n\nexport type EventSubscription = {\n remove: () => void\n}\n\nexport type BasicVoltraEvent = {\n source: string\n timestamp: number\n}\n\nexport type VoltraActivityState = 'active' | 'dismissed' | 'pending' | 'stale' | 'ended' | string\nexport type VoltraActivityTokenReceivedEvent = BasicVoltraEvent & {\n type: 'activityTokenReceived'\n activityName: string\n pushToken: string\n}\nexport type VoltraActivityPushToStartTokenReceivedEvent = BasicVoltraEvent & {\n type: 'activityPushToStartTokenReceived'\n pushToStartToken: string\n}\nexport type VoltraActivityUpdateEvent = BasicVoltraEvent & {\n type: 'stateChange'\n activityName: string\n activityState: VoltraActivityState\n}\n\nexport type VoltraInteractionEvent = BasicVoltraEvent & {\n type: 'interaction'\n identifier: string\n payload: string\n}\n\nconst noopSubscription: EventSubscription = {\n remove: () => {},\n}\n\nexport type VoltraEventMap = {\n activityTokenReceived: VoltraActivityTokenReceivedEvent\n activityPushToStartTokenReceived: VoltraActivityPushToStartTokenReceivedEvent\n stateChange: VoltraActivityUpdateEvent\n interaction: VoltraInteractionEvent\n}\n\nexport function addVoltraListener<K extends keyof VoltraEventMap>(\n event: K,\n listener: (event: VoltraEventMap[K]) => void\n): EventSubscription {\n if (!assertRunningOnApple()) {\n return noopSubscription\n }\n\n return VoltraModule.addListener(event, listener)\n}\n"]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Return whether Liquid Glass APIs are supported on this device (iOS 26+).
|
|
3
|
+
* This is a convenience gate for authoring fallbacks in JS.
|
|
4
|
+
*/
|
|
5
|
+
export declare function isGlassSupported(): boolean;
|
|
6
|
+
/**
|
|
7
|
+
* Return whether the app was launched in the background (headless).
|
|
8
|
+
* Returns true if the app was launched in background, false if launched in foreground.
|
|
9
|
+
* Always returns false on non-iOS platforms.
|
|
10
|
+
*/
|
|
11
|
+
export declare function isHeadless(): boolean;
|
|
12
|
+
//# sourceMappingURL=helpers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../src/helpers.ts"],"names":[],"mappings":"AAIA;;;GAGG;AACH,wBAAgB,gBAAgB,IAAI,OAAO,CAW1C;AAED;;;;GAIG;AACH,wBAAgB,UAAU,IAAI,OAAO,CAGpC"}
|
package/build/helpers.js
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { Platform } from 'react-native';
|
|
2
|
+
import VoltraModule from './VoltraModule.js';
|
|
3
|
+
/**
|
|
4
|
+
* Return whether Liquid Glass APIs are supported on this device (iOS 26+).
|
|
5
|
+
* This is a convenience gate for authoring fallbacks in JS.
|
|
6
|
+
*/
|
|
7
|
+
export function isGlassSupported() {
|
|
8
|
+
if (Platform.OS !== 'ios')
|
|
9
|
+
return false;
|
|
10
|
+
const v = Platform.Version;
|
|
11
|
+
let major = 0;
|
|
12
|
+
if (typeof v === 'string') {
|
|
13
|
+
const m = parseInt(v.split('.')[0] || '0', 10);
|
|
14
|
+
if (!Number.isNaN(m))
|
|
15
|
+
major = m;
|
|
16
|
+
}
|
|
17
|
+
else if (typeof v === 'number') {
|
|
18
|
+
major = Math.floor(v);
|
|
19
|
+
}
|
|
20
|
+
return major >= 26;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Return whether the app was launched in the background (headless).
|
|
24
|
+
* Returns true if the app was launched in background, false if launched in foreground.
|
|
25
|
+
* Always returns false on non-iOS platforms.
|
|
26
|
+
*/
|
|
27
|
+
export function isHeadless() {
|
|
28
|
+
if (Platform.OS !== 'ios')
|
|
29
|
+
return false;
|
|
30
|
+
return VoltraModule.isHeadless?.() ?? false;
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=helpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../src/helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAA;AAEvC,OAAO,YAAY,MAAM,mBAAmB,CAAA;AAE5C;;;GAGG;AACH,MAAM,UAAU,gBAAgB;IAC9B,IAAI,QAAQ,CAAC,EAAE,KAAK,KAAK;QAAE,OAAO,KAAK,CAAA;IACvC,MAAM,CAAC,GAAQ,QAAQ,CAAC,OAAO,CAAA;IAC/B,IAAI,KAAK,GAAG,CAAC,CAAA;IACb,IAAI,OAAO,CAAC,KAAK,QAAQ,EAAE,CAAC;QAC1B,MAAM,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,GAAG,EAAE,EAAE,CAAC,CAAA;QAC9C,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;YAAE,KAAK,GAAG,CAAC,CAAA;IACjC,CAAC;SAAM,IAAI,OAAO,CAAC,KAAK,QAAQ,EAAE,CAAC;QACjC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;IACvB,CAAC;IACD,OAAO,KAAK,IAAI,EAAE,CAAA;AACpB,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,UAAU;IACxB,IAAI,QAAQ,CAAC,EAAE,KAAK,KAAK;QAAE,OAAO,KAAK,CAAA;IACvC,OAAO,YAAY,CAAC,UAAU,EAAE,EAAE,IAAI,KAAK,CAAA;AAC7C,CAAC","sourcesContent":["import { Platform } from 'react-native'\n\nimport VoltraModule from './VoltraModule.js'\n\n/**\n * Return whether Liquid Glass APIs are supported on this device (iOS 26+).\n * This is a convenience gate for authoring fallbacks in JS.\n */\nexport function isGlassSupported(): boolean {\n if (Platform.OS !== 'ios') return false\n const v: any = Platform.Version\n let major = 0\n if (typeof v === 'string') {\n const m = parseInt(v.split('.')[0] || '0', 10)\n if (!Number.isNaN(m)) major = m\n } else if (typeof v === 'number') {\n major = Math.floor(v)\n }\n return major >= 26\n}\n\n/**\n * Return whether the app was launched in the background (headless).\n * Returns true if the app was launched in background, false if launched in foreground.\n * Always returns false on non-iOS platforms.\n */\nexport function isHeadless(): boolean {\n if (Platform.OS !== 'ios') return false\n return VoltraModule.isHeadless?.() ?? false\n}\n"]}
|
package/build/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,qBAAqB,CAAA;AAC7C,YAAY,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAA;AACpE,YAAY,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAA"}
|
package/build/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,qBAAqB,CAAA","sourcesContent":["export * as Voltra from './jsx/primitives.js'\nexport type { LiveActivityVariants } from './live-activity/types.js'\nexport type { WidgetVariants } from './widgets/types.js'\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../src/jsx/Button.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAEpD,YAAY,EAAE,WAAW,EAAE,CAAA;AAC3B,eAAO,MAAM,MAAM,mEAA+C,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Button.js","sourceRoot":"","sources":["../../src/jsx/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAA;AAIlE,MAAM,CAAC,MAAM,MAAM,GAAG,qBAAqB,CAAc,QAAQ,CAAC,CAAA","sourcesContent":["import { createVoltraComponent } from './createVoltraComponent.js'\nimport type { ButtonProps } from './props/Button.js'\n\nexport type { ButtonProps }\nexport const Button = createVoltraComponent<ButtonProps>('Button')\n"]}
|