@use-voltra/android 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +30 -0
- package/build/cjs/VoltraModule.js +6 -0
- package/build/cjs/VoltraModule.js.map +1 -0
- package/build/cjs/client.js +34 -0
- package/build/cjs/client.js.map +1 -0
- package/build/cjs/components/VoltraView.js +48 -0
- package/build/cjs/components/VoltraView.js.map +1 -0
- package/build/cjs/components/VoltraWidgetPreview.js +28 -0
- package/build/cjs/components/VoltraWidgetPreview.js.map +1 -0
- package/build/cjs/events.js +35 -0
- package/build/cjs/events.js.map +1 -0
- package/build/cjs/index.js +39 -0
- package/build/cjs/index.js.map +1 -0
- package/build/cjs/jsx/AreaMark.js +10 -0
- package/build/cjs/jsx/AreaMark.js.map +1 -0
- package/build/cjs/jsx/BarMark.js +10 -0
- package/build/cjs/jsx/BarMark.js.map +1 -0
- package/build/cjs/jsx/Box.js +6 -0
- package/build/cjs/jsx/Box.js.map +1 -0
- package/build/cjs/jsx/Button.js +6 -0
- package/build/cjs/jsx/Button.js.map +1 -0
- package/build/cjs/jsx/Chart.js +116 -0
- package/build/cjs/jsx/Chart.js.map +1 -0
- package/build/cjs/jsx/CheckBox.js +6 -0
- package/build/cjs/jsx/CheckBox.js.map +1 -0
- package/build/cjs/jsx/CircleIconButton.js +14 -0
- package/build/cjs/jsx/CircleIconButton.js.map +1 -0
- package/build/cjs/jsx/CircularProgressIndicator.js +6 -0
- package/build/cjs/jsx/CircularProgressIndicator.js.map +1 -0
- package/build/cjs/jsx/Column.js +6 -0
- package/build/cjs/jsx/Column.js.map +1 -0
- package/build/cjs/jsx/FilledButton.js +14 -0
- package/build/cjs/jsx/FilledButton.js.map +1 -0
- package/build/cjs/jsx/Image.js +14 -0
- package/build/cjs/jsx/Image.js.map +1 -0
- package/build/cjs/jsx/LazyColumn.js +6 -0
- package/build/cjs/jsx/LazyColumn.js.map +1 -0
- package/build/cjs/jsx/LazyVerticalGrid.js +6 -0
- package/build/cjs/jsx/LazyVerticalGrid.js.map +1 -0
- package/build/cjs/jsx/LineMark.js +10 -0
- package/build/cjs/jsx/LineMark.js.map +1 -0
- package/build/cjs/jsx/LinearProgressIndicator.js +6 -0
- package/build/cjs/jsx/LinearProgressIndicator.js.map +1 -0
- package/build/cjs/jsx/OutlineButton.js +14 -0
- package/build/cjs/jsx/OutlineButton.js.map +1 -0
- package/build/cjs/jsx/PointMark.js +10 -0
- package/build/cjs/jsx/PointMark.js.map +1 -0
- package/build/cjs/jsx/RadioButton.js +6 -0
- package/build/cjs/jsx/RadioButton.js.map +1 -0
- package/build/cjs/jsx/Row.js +6 -0
- package/build/cjs/jsx/Row.js.map +1 -0
- package/build/cjs/jsx/RuleMark.js +10 -0
- package/build/cjs/jsx/RuleMark.js.map +1 -0
- package/build/cjs/jsx/Scaffold.js +6 -0
- package/build/cjs/jsx/Scaffold.js.map +1 -0
- package/build/cjs/jsx/SectorMark.js +10 -0
- package/build/cjs/jsx/SectorMark.js.map +1 -0
- package/build/cjs/jsx/Spacer.js +6 -0
- package/build/cjs/jsx/Spacer.js.map +1 -0
- package/build/cjs/jsx/SquareIconButton.js +14 -0
- package/build/cjs/jsx/SquareIconButton.js.map +1 -0
- package/build/cjs/jsx/Switch.js +6 -0
- package/build/cjs/jsx/Switch.js.map +1 -0
- package/build/cjs/jsx/Text.js +6 -0
- package/build/cjs/jsx/Text.js.map +1 -0
- package/build/cjs/jsx/TitleBar.js +14 -0
- package/build/cjs/jsx/TitleBar.js.map +1 -0
- package/build/cjs/jsx/baseProps.js +3 -0
- package/build/cjs/jsx/baseProps.js.map +1 -0
- package/build/cjs/jsx/chart-types.js +3 -0
- package/build/cjs/jsx/chart-types.js.map +1 -0
- package/build/cjs/jsx/createVoltraComponent.js +21 -0
- package/build/cjs/jsx/createVoltraComponent.js.map +1 -0
- package/build/cjs/jsx/index.js +18 -0
- package/build/cjs/jsx/index.js.map +1 -0
- package/build/cjs/jsx/primitives.js +45 -0
- package/build/cjs/jsx/primitives.js.map +1 -0
- package/build/cjs/jsx/props/Box.js +3 -0
- package/build/cjs/jsx/props/Box.js.map +1 -0
- package/build/cjs/jsx/props/Button.js +3 -0
- package/build/cjs/jsx/props/Button.js.map +1 -0
- package/build/cjs/jsx/props/CheckBox.js +3 -0
- package/build/cjs/jsx/props/CheckBox.js.map +1 -0
- package/build/cjs/jsx/props/CircleIconButton.js +3 -0
- package/build/cjs/jsx/props/CircleIconButton.js.map +1 -0
- package/build/cjs/jsx/props/CircularProgressIndicator.js +3 -0
- package/build/cjs/jsx/props/CircularProgressIndicator.js.map +1 -0
- package/build/cjs/jsx/props/Column.js +3 -0
- package/build/cjs/jsx/props/Column.js.map +1 -0
- package/build/cjs/jsx/props/FilledButton.js +3 -0
- package/build/cjs/jsx/props/FilledButton.js.map +1 -0
- package/build/cjs/jsx/props/Image.js +6 -0
- package/build/cjs/jsx/props/Image.js.map +1 -0
- package/build/cjs/jsx/props/LazyColumn.js +3 -0
- package/build/cjs/jsx/props/LazyColumn.js.map +1 -0
- package/build/cjs/jsx/props/LazyVerticalGrid.js +3 -0
- package/build/cjs/jsx/props/LazyVerticalGrid.js.map +1 -0
- package/build/cjs/jsx/props/LinearProgressIndicator.js +3 -0
- package/build/cjs/jsx/props/LinearProgressIndicator.js.map +1 -0
- package/build/cjs/jsx/props/OutlineButton.js +3 -0
- package/build/cjs/jsx/props/OutlineButton.js.map +1 -0
- package/build/cjs/jsx/props/RadioButton.js +3 -0
- package/build/cjs/jsx/props/RadioButton.js.map +1 -0
- package/build/cjs/jsx/props/Row.js +3 -0
- package/build/cjs/jsx/props/Row.js.map +1 -0
- package/build/cjs/jsx/props/Scaffold.js +3 -0
- package/build/cjs/jsx/props/Scaffold.js.map +1 -0
- package/build/cjs/jsx/props/Spacer.js +3 -0
- package/build/cjs/jsx/props/Spacer.js.map +1 -0
- package/build/cjs/jsx/props/SquareIconButton.js +3 -0
- package/build/cjs/jsx/props/SquareIconButton.js.map +1 -0
- package/build/cjs/jsx/props/Switch.js +3 -0
- package/build/cjs/jsx/props/Switch.js.map +1 -0
- package/build/cjs/jsx/props/Text.js +3 -0
- package/build/cjs/jsx/props/Text.js.map +1 -0
- package/build/cjs/jsx/props/TitleBar.js +3 -0
- package/build/cjs/jsx/props/TitleBar.js.map +1 -0
- package/build/cjs/live-update/api.js +215 -0
- package/build/cjs/live-update/api.js.map +1 -0
- package/build/cjs/live-update/renderer.js +46 -0
- package/build/cjs/live-update/renderer.js.map +1 -0
- package/build/cjs/live-update/types.js +3 -0
- package/build/cjs/live-update/types.js.map +1 -0
- package/build/cjs/package.json +3 -0
- package/build/cjs/payload/component-ids.js +84 -0
- package/build/cjs/payload/component-ids.js.map +1 -0
- package/build/cjs/preload.js +80 -0
- package/build/cjs/preload.js.map +1 -0
- package/build/cjs/renderer/index.js +8 -0
- package/build/cjs/renderer/index.js.map +1 -0
- package/build/cjs/renderer/renderer.js +18 -0
- package/build/cjs/renderer/renderer.js.map +1 -0
- package/build/cjs/server.js +8 -0
- package/build/cjs/server.js.map +1 -0
- package/build/cjs/styles/types.js +7 -0
- package/build/cjs/styles/types.js.map +1 -0
- package/build/cjs/types.js +3 -0
- package/build/cjs/types.js.map +1 -0
- package/build/cjs/utils/index.js +18 -0
- package/build/cjs/utils/index.js.map +1 -0
- package/build/cjs/utils/useUpdateOnHMR.js +27 -0
- package/build/cjs/utils/useUpdateOnHMR.js.map +1 -0
- package/build/cjs/widgets/api.js +155 -0
- package/build/cjs/widgets/api.js.map +1 -0
- package/build/cjs/widgets/index.js +12 -0
- package/build/cjs/widgets/index.js.map +1 -0
- package/build/cjs/widgets/renderer.js +56 -0
- package/build/cjs/widgets/renderer.js.map +1 -0
- package/build/cjs/widgets/server-credentials.js +31 -0
- package/build/cjs/widgets/server-credentials.js.map +1 -0
- package/build/cjs/widgets/types.js +3 -0
- package/build/cjs/widgets/types.js.map +1 -0
- package/build/esm/VoltraModule.js +4 -0
- package/build/esm/VoltraModule.js.map +1 -0
- package/build/esm/client.js +12 -0
- package/build/esm/client.js.map +1 -0
- package/build/esm/components/VoltraView.js +45 -0
- package/build/esm/components/VoltraView.js.map +1 -0
- package/build/esm/components/VoltraWidgetPreview.js +25 -0
- package/build/esm/components/VoltraWidgetPreview.js.map +1 -0
- package/build/esm/events.js +29 -0
- package/build/esm/events.js.map +1 -0
- package/build/esm/index.js +3 -0
- package/build/esm/index.js.map +1 -0
- package/build/esm/jsx/AreaMark.js +6 -0
- package/build/esm/jsx/AreaMark.js.map +1 -0
- package/build/esm/jsx/BarMark.js +6 -0
- package/build/esm/jsx/BarMark.js.map +1 -0
- package/build/esm/jsx/Box.js +3 -0
- package/build/esm/jsx/Box.js.map +1 -0
- package/build/esm/jsx/Button.js +3 -0
- package/build/esm/jsx/Button.js.map +1 -0
- package/build/esm/jsx/Chart.js +110 -0
- package/build/esm/jsx/Chart.js.map +1 -0
- package/build/esm/jsx/CheckBox.js +3 -0
- package/build/esm/jsx/CheckBox.js.map +1 -0
- package/build/esm/jsx/CircleIconButton.js +11 -0
- package/build/esm/jsx/CircleIconButton.js.map +1 -0
- package/build/esm/jsx/CircularProgressIndicator.js +3 -0
- package/build/esm/jsx/CircularProgressIndicator.js.map +1 -0
- package/build/esm/jsx/Column.js +3 -0
- package/build/esm/jsx/Column.js.map +1 -0
- package/build/esm/jsx/FilledButton.js +11 -0
- package/build/esm/jsx/FilledButton.js.map +1 -0
- package/build/esm/jsx/Image.js +11 -0
- package/build/esm/jsx/Image.js.map +1 -0
- package/build/esm/jsx/LazyColumn.js +3 -0
- package/build/esm/jsx/LazyColumn.js.map +1 -0
- package/build/esm/jsx/LazyVerticalGrid.js +3 -0
- package/build/esm/jsx/LazyVerticalGrid.js.map +1 -0
- package/build/esm/jsx/LineMark.js +6 -0
- package/build/esm/jsx/LineMark.js.map +1 -0
- package/build/esm/jsx/LinearProgressIndicator.js +3 -0
- package/build/esm/jsx/LinearProgressIndicator.js.map +1 -0
- package/build/esm/jsx/OutlineButton.js +11 -0
- package/build/esm/jsx/OutlineButton.js.map +1 -0
- package/build/esm/jsx/PointMark.js +6 -0
- package/build/esm/jsx/PointMark.js.map +1 -0
- package/build/esm/jsx/RadioButton.js +3 -0
- package/build/esm/jsx/RadioButton.js.map +1 -0
- package/build/esm/jsx/Row.js +3 -0
- package/build/esm/jsx/Row.js.map +1 -0
- package/build/esm/jsx/RuleMark.js +6 -0
- package/build/esm/jsx/RuleMark.js.map +1 -0
- package/build/esm/jsx/Scaffold.js +3 -0
- package/build/esm/jsx/Scaffold.js.map +1 -0
- package/build/esm/jsx/SectorMark.js +6 -0
- package/build/esm/jsx/SectorMark.js.map +1 -0
- package/build/esm/jsx/Spacer.js +3 -0
- package/build/esm/jsx/Spacer.js.map +1 -0
- package/build/esm/jsx/SquareIconButton.js +11 -0
- package/build/esm/jsx/SquareIconButton.js.map +1 -0
- package/build/esm/jsx/Switch.js +3 -0
- package/build/esm/jsx/Switch.js.map +1 -0
- package/build/esm/jsx/Text.js +3 -0
- package/build/esm/jsx/Text.js.map +1 -0
- package/build/esm/jsx/TitleBar.js +11 -0
- package/build/esm/jsx/TitleBar.js.map +1 -0
- package/build/esm/jsx/baseProps.js +2 -0
- package/build/esm/jsx/baseProps.js.map +1 -0
- package/build/esm/jsx/chart-types.js +2 -0
- package/build/esm/jsx/chart-types.js.map +1 -0
- package/build/esm/jsx/createVoltraComponent.js +16 -0
- package/build/esm/jsx/createVoltraComponent.js.map +1 -0
- package/build/esm/jsx/index.js +2 -0
- package/build/esm/jsx/index.js.map +1 -0
- package/build/esm/jsx/primitives.js +29 -0
- package/build/esm/jsx/primitives.js.map +1 -0
- package/build/esm/jsx/props/Box.js +2 -0
- package/build/esm/jsx/props/Box.js.map +1 -0
- package/build/esm/jsx/props/Button.js +2 -0
- package/build/esm/jsx/props/Button.js.map +1 -0
- package/build/esm/jsx/props/CheckBox.js +2 -0
- package/build/esm/jsx/props/CheckBox.js.map +1 -0
- package/build/esm/jsx/props/CircleIconButton.js +2 -0
- package/build/esm/jsx/props/CircleIconButton.js.map +1 -0
- package/build/esm/jsx/props/CircularProgressIndicator.js +2 -0
- package/build/esm/jsx/props/CircularProgressIndicator.js.map +1 -0
- package/build/esm/jsx/props/Column.js +2 -0
- package/build/esm/jsx/props/Column.js.map +1 -0
- package/build/esm/jsx/props/FilledButton.js +2 -0
- package/build/esm/jsx/props/FilledButton.js.map +1 -0
- package/build/esm/jsx/props/Image.js +5 -0
- package/build/esm/jsx/props/Image.js.map +1 -0
- package/build/esm/jsx/props/LazyColumn.js +2 -0
- package/build/esm/jsx/props/LazyColumn.js.map +1 -0
- package/build/esm/jsx/props/LazyVerticalGrid.js +2 -0
- package/build/esm/jsx/props/LazyVerticalGrid.js.map +1 -0
- package/build/esm/jsx/props/LinearProgressIndicator.js +2 -0
- package/build/esm/jsx/props/LinearProgressIndicator.js.map +1 -0
- package/build/esm/jsx/props/OutlineButton.js +2 -0
- package/build/esm/jsx/props/OutlineButton.js.map +1 -0
- package/build/esm/jsx/props/RadioButton.js +2 -0
- package/build/esm/jsx/props/RadioButton.js.map +1 -0
- package/build/esm/jsx/props/Row.js +2 -0
- package/build/esm/jsx/props/Row.js.map +1 -0
- package/build/esm/jsx/props/Scaffold.js +2 -0
- package/build/esm/jsx/props/Scaffold.js.map +1 -0
- package/build/esm/jsx/props/Spacer.js +2 -0
- package/build/esm/jsx/props/Spacer.js.map +1 -0
- package/build/esm/jsx/props/SquareIconButton.js +2 -0
- package/build/esm/jsx/props/SquareIconButton.js.map +1 -0
- package/build/esm/jsx/props/Switch.js +2 -0
- package/build/esm/jsx/props/Switch.js.map +1 -0
- package/build/esm/jsx/props/Text.js +2 -0
- package/build/esm/jsx/props/Text.js.map +1 -0
- package/build/esm/jsx/props/TitleBar.js +2 -0
- package/build/esm/jsx/props/TitleBar.js.map +1 -0
- package/build/esm/live-update/api.js +203 -0
- package/build/esm/live-update/api.js.map +1 -0
- package/build/esm/live-update/renderer.js +41 -0
- package/build/esm/live-update/renderer.js.map +1 -0
- package/build/esm/live-update/types.js +2 -0
- package/build/esm/live-update/types.js.map +1 -0
- package/build/esm/package.json +3 -0
- package/build/esm/payload/component-ids.js +79 -0
- package/build/esm/payload/component-ids.js.map +1 -0
- package/build/esm/preload.js +72 -0
- package/build/esm/preload.js.map +1 -0
- package/build/esm/renderer/index.js +2 -0
- package/build/esm/renderer/index.js.map +1 -0
- package/build/esm/renderer/renderer.js +13 -0
- package/build/esm/renderer/renderer.js.map +1 -0
- package/build/esm/server.js +3 -0
- package/build/esm/server.js.map +1 -0
- package/build/esm/styles/types.js +6 -0
- package/build/esm/styles/types.js.map +1 -0
- package/build/esm/types.js +2 -0
- package/build/esm/types.js.map +1 -0
- package/build/esm/utils/index.js +2 -0
- package/build/esm/utils/index.js.map +1 -0
- package/build/esm/utils/useUpdateOnHMR.js +23 -0
- package/build/esm/utils/useUpdateOnHMR.js.map +1 -0
- package/build/esm/widgets/api.js +143 -0
- package/build/esm/widgets/api.js.map +1 -0
- package/build/esm/widgets/index.js +3 -0
- package/build/esm/widgets/index.js.map +1 -0
- package/build/esm/widgets/renderer.js +51 -0
- package/build/esm/widgets/renderer.js.map +1 -0
- package/build/esm/widgets/server-credentials.js +24 -0
- package/build/esm/widgets/server-credentials.js.map +1 -0
- package/build/esm/widgets/types.js +2 -0
- package/build/esm/widgets/types.js.map +1 -0
- package/build/types/VoltraModule.d.ts +30 -0
- package/build/types/VoltraModule.d.ts.map +1 -0
- package/build/types/client.d.ts +9 -0
- package/build/types/client.d.ts.map +1 -0
- package/build/types/components/VoltraView.d.ts +29 -0
- package/build/types/components/VoltraView.d.ts.map +1 -0
- package/build/types/components/VoltraWidgetPreview.d.ts +21 -0
- package/build/types/components/VoltraWidgetPreview.d.ts.map +1 -0
- package/build/types/events.d.ts +49 -0
- package/build/types/events.d.ts.map +1 -0
- package/build/types/index.d.ts +15 -0
- package/build/types/index.d.ts.map +1 -0
- package/build/types/jsx/AreaMark.d.ts +14 -0
- package/build/types/jsx/AreaMark.d.ts.map +1 -0
- package/build/types/jsx/BarMark.d.ts +15 -0
- package/build/types/jsx/BarMark.d.ts.map +1 -0
- package/build/types/jsx/Box.d.ts +4 -0
- package/build/types/jsx/Box.d.ts.map +1 -0
- package/build/types/jsx/Button.d.ts +4 -0
- package/build/types/jsx/Button.d.ts.map +1 -0
- package/build/types/jsx/Chart.d.ts +16 -0
- package/build/types/jsx/Chart.d.ts.map +1 -0
- package/build/types/jsx/CheckBox.d.ts +4 -0
- package/build/types/jsx/CheckBox.d.ts.map +1 -0
- package/build/types/jsx/CircleIconButton.d.ts +4 -0
- package/build/types/jsx/CircleIconButton.d.ts.map +1 -0
- package/build/types/jsx/CircularProgressIndicator.d.ts +4 -0
- package/build/types/jsx/CircularProgressIndicator.d.ts.map +1 -0
- package/build/types/jsx/Column.d.ts +4 -0
- package/build/types/jsx/Column.d.ts.map +1 -0
- package/build/types/jsx/FilledButton.d.ts +4 -0
- package/build/types/jsx/FilledButton.d.ts.map +1 -0
- package/build/types/jsx/Image.d.ts +13 -0
- package/build/types/jsx/Image.d.ts.map +1 -0
- package/build/types/jsx/LazyColumn.d.ts +4 -0
- package/build/types/jsx/LazyColumn.d.ts.map +1 -0
- package/build/types/jsx/LazyVerticalGrid.d.ts +4 -0
- package/build/types/jsx/LazyVerticalGrid.d.ts.map +1 -0
- package/build/types/jsx/LineMark.d.ts +15 -0
- package/build/types/jsx/LineMark.d.ts.map +1 -0
- package/build/types/jsx/LinearProgressIndicator.d.ts +4 -0
- package/build/types/jsx/LinearProgressIndicator.d.ts.map +1 -0
- package/build/types/jsx/OutlineButton.d.ts +4 -0
- package/build/types/jsx/OutlineButton.d.ts.map +1 -0
- package/build/types/jsx/PointMark.d.ts +14 -0
- package/build/types/jsx/PointMark.d.ts.map +1 -0
- package/build/types/jsx/RadioButton.d.ts +4 -0
- package/build/types/jsx/RadioButton.d.ts.map +1 -0
- package/build/types/jsx/Row.d.ts +4 -0
- package/build/types/jsx/Row.d.ts.map +1 -0
- package/build/types/jsx/RuleMark.d.ts +13 -0
- package/build/types/jsx/RuleMark.d.ts.map +1 -0
- package/build/types/jsx/Scaffold.d.ts +4 -0
- package/build/types/jsx/Scaffold.d.ts.map +1 -0
- package/build/types/jsx/SectorMark.d.ts +15 -0
- package/build/types/jsx/SectorMark.d.ts.map +1 -0
- package/build/types/jsx/Spacer.d.ts +4 -0
- package/build/types/jsx/Spacer.d.ts.map +1 -0
- package/build/types/jsx/SquareIconButton.d.ts +4 -0
- package/build/types/jsx/SquareIconButton.d.ts.map +1 -0
- package/build/types/jsx/Switch.d.ts +4 -0
- package/build/types/jsx/Switch.d.ts.map +1 -0
- package/build/types/jsx/Text.d.ts +7 -0
- package/build/types/jsx/Text.d.ts.map +1 -0
- package/build/types/jsx/TitleBar.d.ts +4 -0
- package/build/types/jsx/TitleBar.d.ts.map +1 -0
- package/build/types/jsx/baseProps.d.ts +9 -0
- package/build/types/jsx/baseProps.d.ts.map +1 -0
- package/build/types/jsx/chart-types.d.ts +10 -0
- package/build/types/jsx/chart-types.d.ts.map +1 -0
- package/build/types/jsx/createVoltraComponent.d.ts +12 -0
- package/build/types/jsx/createVoltraComponent.d.ts.map +1 -0
- package/build/types/jsx/index.d.ts +2 -0
- package/build/types/jsx/index.d.ts.map +1 -0
- package/build/types/jsx/primitives.d.ts +29 -0
- package/build/types/jsx/primitives.d.ts.map +1 -0
- package/build/types/jsx/props/Box.d.ts +6 -0
- package/build/types/jsx/props/Box.d.ts.map +1 -0
- package/build/types/jsx/props/Button.d.ts +6 -0
- package/build/types/jsx/props/Button.d.ts.map +1 -0
- package/build/types/jsx/props/CheckBox.d.ts +17 -0
- package/build/types/jsx/props/CheckBox.d.ts.map +1 -0
- package/build/types/jsx/props/CircleIconButton.d.ts +15 -0
- package/build/types/jsx/props/CircleIconButton.d.ts.map +1 -0
- package/build/types/jsx/props/CircularProgressIndicator.d.ts +12 -0
- package/build/types/jsx/props/CircularProgressIndicator.d.ts.map +1 -0
- package/build/types/jsx/props/Column.d.ts +8 -0
- package/build/types/jsx/props/Column.d.ts.map +1 -0
- package/build/types/jsx/props/FilledButton.d.ts +17 -0
- package/build/types/jsx/props/FilledButton.d.ts.map +1 -0
- package/build/types/jsx/props/Image.d.ts +21 -0
- package/build/types/jsx/props/Image.d.ts.map +1 -0
- package/build/types/jsx/props/LazyColumn.d.ts +6 -0
- package/build/types/jsx/props/LazyColumn.d.ts.map +1 -0
- package/build/types/jsx/props/LazyVerticalGrid.d.ts +12 -0
- package/build/types/jsx/props/LazyVerticalGrid.d.ts.map +1 -0
- package/build/types/jsx/props/LinearProgressIndicator.d.ts +10 -0
- package/build/types/jsx/props/LinearProgressIndicator.d.ts.map +1 -0
- package/build/types/jsx/props/OutlineButton.d.ts +15 -0
- package/build/types/jsx/props/OutlineButton.d.ts.map +1 -0
- package/build/types/jsx/props/RadioButton.d.ts +19 -0
- package/build/types/jsx/props/RadioButton.d.ts.map +1 -0
- package/build/types/jsx/props/Row.d.ts +8 -0
- package/build/types/jsx/props/Row.d.ts.map +1 -0
- package/build/types/jsx/props/Scaffold.d.ts +8 -0
- package/build/types/jsx/props/Scaffold.d.ts.map +1 -0
- package/build/types/jsx/props/Spacer.d.ts +6 -0
- package/build/types/jsx/props/Spacer.d.ts.map +1 -0
- package/build/types/jsx/props/SquareIconButton.d.ts +15 -0
- package/build/types/jsx/props/SquareIconButton.d.ts.map +1 -0
- package/build/types/jsx/props/Switch.d.ts +21 -0
- package/build/types/jsx/props/Switch.d.ts.map +1 -0
- package/build/types/jsx/props/Text.d.ts +12 -0
- package/build/types/jsx/props/Text.d.ts.map +1 -0
- package/build/types/jsx/props/TitleBar.d.ts +15 -0
- package/build/types/jsx/props/TitleBar.d.ts.map +1 -0
- package/build/types/live-update/api.d.ts +126 -0
- package/build/types/live-update/api.d.ts.map +1 -0
- package/build/types/live-update/renderer.d.ts +11 -0
- package/build/types/live-update/renderer.d.ts.map +1 -0
- package/build/types/live-update/types.d.ts +100 -0
- package/build/types/live-update/types.d.ts.map +1 -0
- package/build/types/payload/component-ids.d.ts +20 -0
- package/build/types/payload/component-ids.d.ts.map +1 -0
- package/build/types/preload.d.ts +45 -0
- package/build/types/preload.d.ts.map +1 -0
- package/build/types/renderer/index.d.ts +2 -0
- package/build/types/renderer/index.d.ts.map +1 -0
- package/build/types/renderer/renderer.d.ts +12 -0
- package/build/types/renderer/renderer.d.ts.map +1 -0
- package/build/types/server.d.ts +3 -0
- package/build/types/server.d.ts.map +1 -0
- package/build/types/styles/types.d.ts +116 -0
- package/build/types/styles/types.d.ts.map +1 -0
- package/build/types/types.d.ts +2 -0
- package/build/types/types.d.ts.map +1 -0
- package/build/types/utils/index.d.ts +2 -0
- package/build/types/utils/index.d.ts.map +1 -0
- package/build/types/utils/useUpdateOnHMR.d.ts +9 -0
- package/build/types/utils/useUpdateOnHMR.d.ts.map +1 -0
- package/build/types/widgets/api.d.ts +131 -0
- package/build/types/widgets/api.d.ts.map +1 -0
- package/build/types/widgets/index.d.ts +3 -0
- package/build/types/widgets/index.d.ts.map +1 -0
- package/build/types/widgets/renderer.d.ts +22 -0
- package/build/types/widgets/renderer.d.ts.map +1 -0
- package/build/types/widgets/server-credentials.d.ts +18 -0
- package/build/types/widgets/server-credentials.d.ts.map +1 -0
- package/build/types/widgets/types.d.ts +58 -0
- package/build/types/widgets/types.d.ts.map +1 -0
- package/package.json +65 -0
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import type { AndroidLiveUpdateVariants, StartAndroidLiveUpdateOptions, UpdateAndroidLiveUpdateOptions, UseAndroidLiveUpdateOptions, UseAndroidLiveUpdateResult } from './types.js';
|
|
2
|
+
/**
|
|
3
|
+
* @unstable This API is experimental and may change in future versions.
|
|
4
|
+
*
|
|
5
|
+
* React hook for managing Android Live Updates with automatic lifecycle handling.
|
|
6
|
+
*
|
|
7
|
+
* @param variants - The Android Live Update content variants to display
|
|
8
|
+
* @param options - Configuration options for the hook
|
|
9
|
+
* @returns Object with start, update, end methods and isActive state
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```tsx
|
|
13
|
+
* import { VoltraAndroid, useAndroidLiveUpdate } from 'voltra'
|
|
14
|
+
*
|
|
15
|
+
* const MyLiveUpdate = () => {
|
|
16
|
+
* const { start, update, end, isActive } = useAndroidLiveUpdate({
|
|
17
|
+
* collapsed: <VoltraAndroid.Text>Delivery arriving</VoltraAndroid.Text>,
|
|
18
|
+
* expanded: <VoltraAndroid.Column>...</VoltraAndroid.Column>,
|
|
19
|
+
* channelId: 'delivery_updates',
|
|
20
|
+
* }, {
|
|
21
|
+
* updateName: 'my-live-update',
|
|
22
|
+
* autoStart: true,
|
|
23
|
+
* autoUpdate: true
|
|
24
|
+
* })
|
|
25
|
+
*
|
|
26
|
+
* return (
|
|
27
|
+
* <View>
|
|
28
|
+
* <Button title={isActive ? "Stop" : "Start"} onPress={isActive ? end : start} />
|
|
29
|
+
* </View>
|
|
30
|
+
* )
|
|
31
|
+
* }
|
|
32
|
+
* ```
|
|
33
|
+
*/
|
|
34
|
+
export declare const useAndroidLiveUpdate: (variants: AndroidLiveUpdateVariants, options?: UseAndroidLiveUpdateOptions) => UseAndroidLiveUpdateResult;
|
|
35
|
+
/**
|
|
36
|
+
* @unstable This API is experimental and may change in future versions.
|
|
37
|
+
*
|
|
38
|
+
* Start a new Android Live Update with the provided content variants.
|
|
39
|
+
*
|
|
40
|
+
* @param variants - The Android Live Update content variants to display
|
|
41
|
+
* @param options - Configuration options for the Live Update
|
|
42
|
+
* @returns Promise resolving to the notification ID
|
|
43
|
+
*
|
|
44
|
+
* @example
|
|
45
|
+
* ```tsx
|
|
46
|
+
* import { VoltraAndroid, startAndroidLiveUpdate } from 'voltra'
|
|
47
|
+
*
|
|
48
|
+
* const notificationId = await startAndroidLiveUpdate({
|
|
49
|
+
* collapsed: <VoltraAndroid.Text>Delivery arriving</VoltraAndroid.Text>,
|
|
50
|
+
* expanded: <VoltraAndroid.Column>...</VoltraAndroid.Column>,
|
|
51
|
+
* channelId: 'delivery_updates',
|
|
52
|
+
* }, {
|
|
53
|
+
* updateName: 'my-live-update',
|
|
54
|
+
* })
|
|
55
|
+
* ```
|
|
56
|
+
*/
|
|
57
|
+
export declare const startAndroidLiveUpdate: (variants: AndroidLiveUpdateVariants, options?: StartAndroidLiveUpdateOptions) => Promise<string>;
|
|
58
|
+
/**
|
|
59
|
+
* @unstable This API is experimental and may change in future versions.
|
|
60
|
+
*
|
|
61
|
+
* Update an existing Android Live Update with new content.
|
|
62
|
+
*
|
|
63
|
+
* @param notificationId - The ID of the notification to update
|
|
64
|
+
* @param variants - The new Android Live Update content variants
|
|
65
|
+
* @param options - Update options
|
|
66
|
+
*
|
|
67
|
+
* @example
|
|
68
|
+
* ```tsx
|
|
69
|
+
* import { VoltraAndroid, updateAndroidLiveUpdate } from 'voltra'
|
|
70
|
+
*
|
|
71
|
+
* await updateAndroidLiveUpdate('notification-123', {
|
|
72
|
+
* collapsed: <VoltraAndroid.Text>Updated: Delivery arriving</VoltraAndroid.Text>,
|
|
73
|
+
* expanded: <VoltraAndroid.Column>...</VoltraAndroid.Column>,
|
|
74
|
+
* })
|
|
75
|
+
* ```
|
|
76
|
+
*/
|
|
77
|
+
export declare const updateAndroidLiveUpdate: (notificationId: string, variants: AndroidLiveUpdateVariants, options?: UpdateAndroidLiveUpdateOptions) => Promise<void>;
|
|
78
|
+
/**
|
|
79
|
+
* @unstable This API is experimental and may change in future versions.
|
|
80
|
+
*
|
|
81
|
+
* Stop an Android Live Update and dismiss the notification.
|
|
82
|
+
*
|
|
83
|
+
* @param notificationId - The ID of the notification to stop
|
|
84
|
+
*
|
|
85
|
+
* @example
|
|
86
|
+
* ```tsx
|
|
87
|
+
* import { stopAndroidLiveUpdate } from 'voltra'
|
|
88
|
+
*
|
|
89
|
+
* await stopAndroidLiveUpdate('notification-123')
|
|
90
|
+
* ```
|
|
91
|
+
*/
|
|
92
|
+
export declare const stopAndroidLiveUpdate: (notificationId: string) => Promise<void>;
|
|
93
|
+
/**
|
|
94
|
+
* @unstable This API is experimental and may change in future versions.
|
|
95
|
+
*
|
|
96
|
+
* Check if an Android Live Update with the given name is currently active.
|
|
97
|
+
*
|
|
98
|
+
* @param updateName - The name of the Live Update to check
|
|
99
|
+
* @returns true if the update is active, false otherwise
|
|
100
|
+
*
|
|
101
|
+
* @example
|
|
102
|
+
* ```tsx
|
|
103
|
+
* import { isAndroidLiveUpdateActive } from 'voltra'
|
|
104
|
+
*
|
|
105
|
+
* if (isAndroidLiveUpdateActive('my-live-update')) {
|
|
106
|
+
* console.log('Update is running')
|
|
107
|
+
* }
|
|
108
|
+
* ```
|
|
109
|
+
*/
|
|
110
|
+
export declare const isAndroidLiveUpdateActive: (updateName: string) => boolean;
|
|
111
|
+
/**
|
|
112
|
+
* @unstable This API is experimental and may change in future versions.
|
|
113
|
+
*
|
|
114
|
+
* End all active Android Live Updates.
|
|
115
|
+
*
|
|
116
|
+
* This function stops and dismisses all currently running Live Updates in the app.
|
|
117
|
+
*
|
|
118
|
+
* @example
|
|
119
|
+
* ```tsx
|
|
120
|
+
* import { endAllAndroidLiveUpdates } from 'voltra'
|
|
121
|
+
*
|
|
122
|
+
* await endAllAndroidLiveUpdates()
|
|
123
|
+
* ```
|
|
124
|
+
*/
|
|
125
|
+
export declare function endAllAndroidLiveUpdates(): Promise<void>;
|
|
126
|
+
//# sourceMappingURL=api.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../../src/live-update/api.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EACV,yBAAyB,EACzB,6BAA6B,EAC7B,8BAA8B,EAC9B,2BAA2B,EAC3B,0BAA0B,EAC3B,MAAM,YAAY,CAAA;AAEnB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,eAAO,MAAM,oBAAoB,GAC/B,UAAU,yBAAyB,EACnC,UAAU,2BAA2B,KACpC,0BAyEF,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAAO,MAAM,sBAAsB,GACjC,UAAU,yBAAyB,EACnC,UAAU,6BAA6B,KACtC,OAAO,CAAC,MAAM,CAShB,CAAA;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,uBAAuB,GAClC,gBAAgB,MAAM,EACtB,UAAU,yBAAyB,EACnC,UAAU,8BAA8B,KACvC,OAAO,CAAC,IAAI,CAId,CAAA;AAED;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,qBAAqB,GAAU,gBAAgB,MAAM,KAAG,OAAO,CAAC,IAAI,CAEhF,CAAA;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,yBAAyB,GAAI,YAAY,MAAM,KAAG,OAE9D,CAAA;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAsB,wBAAwB,IAAI,OAAO,CAAC,IAAI,CAAC,CAE9D"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { AndroidLiveUpdateJson, AndroidLiveUpdateVariants } from './types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Renders Android Live Update variants to JSON.
|
|
4
|
+
* Uses the Android component registry for component ID lookups.
|
|
5
|
+
*/
|
|
6
|
+
export declare const renderAndroidLiveUpdateToJson: (variants: AndroidLiveUpdateVariants) => AndroidLiveUpdateJson;
|
|
7
|
+
/**
|
|
8
|
+
* Renders Android Live Update variants to a JSON string.
|
|
9
|
+
*/
|
|
10
|
+
export declare const renderAndroidLiveUpdateToString: (variants: AndroidLiveUpdateVariants) => string;
|
|
11
|
+
//# sourceMappingURL=renderer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"renderer.d.ts","sourceRoot":"","sources":["../../../src/live-update/renderer.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,qBAAqB,EAAE,yBAAyB,EAAE,MAAM,YAAY,CAAA;AASlF;;;GAGG;AACH,eAAO,MAAM,6BAA6B,GAAI,UAAU,yBAAyB,KAAG,qBA2BnF,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,+BAA+B,GAAI,UAAU,yBAAyB,KAAG,MAErF,CAAA"}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { VoltraNodeJson } from '../types.js';
|
|
3
|
+
/**
|
|
4
|
+
* Android Live Update variants for Ongoing Notifications.
|
|
5
|
+
*
|
|
6
|
+
* Android ongoing notifications have a simpler structure than iOS Live Activities.
|
|
7
|
+
* There's no Dynamic Island equivalent.
|
|
8
|
+
*/
|
|
9
|
+
export type AndroidLiveUpdateVariants = {
|
|
10
|
+
/**
|
|
11
|
+
* The collapsed notification content (always visible in the notification shade).
|
|
12
|
+
* Height constraint: ~64dp
|
|
13
|
+
*/
|
|
14
|
+
collapsed?: ReactNode;
|
|
15
|
+
/**
|
|
16
|
+
* The expanded notification content (visible when user expands the notification).
|
|
17
|
+
* Height constraint: up to 256dp
|
|
18
|
+
*/
|
|
19
|
+
expanded?: ReactNode;
|
|
20
|
+
/**
|
|
21
|
+
* Small icon resource name for the notification.
|
|
22
|
+
* Should reference a drawable resource (e.g., 'ic_notification')
|
|
23
|
+
*/
|
|
24
|
+
smallIcon?: string;
|
|
25
|
+
/**
|
|
26
|
+
* Notification channel ID (required on Android 8+).
|
|
27
|
+
* The channel must be created before starting the live update.
|
|
28
|
+
*/
|
|
29
|
+
channelId?: string;
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* Rendered Android Live Update variants to JSON.
|
|
33
|
+
*/
|
|
34
|
+
export type AndroidLiveUpdateVariantsJson = {
|
|
35
|
+
/** Payload version - required for remote updates */
|
|
36
|
+
v: number;
|
|
37
|
+
/** Shared stylesheet for all variants */
|
|
38
|
+
s?: Record<string, unknown>[];
|
|
39
|
+
/** Shared elements for deduplication */
|
|
40
|
+
e?: VoltraNodeJson[];
|
|
41
|
+
/** Collapsed notification content */
|
|
42
|
+
collapsed?: VoltraNodeJson;
|
|
43
|
+
/** Expanded notification content */
|
|
44
|
+
expanded?: VoltraNodeJson;
|
|
45
|
+
/** Small icon resource name */
|
|
46
|
+
smallIcon?: string;
|
|
47
|
+
/** Notification channel ID */
|
|
48
|
+
channelId?: string;
|
|
49
|
+
};
|
|
50
|
+
/**
|
|
51
|
+
* JSON representation of Android live update variants for rendering
|
|
52
|
+
*/
|
|
53
|
+
export type AndroidLiveUpdateJson = AndroidLiveUpdateVariantsJson;
|
|
54
|
+
/**
|
|
55
|
+
* Options for starting an Android Live Update
|
|
56
|
+
*/
|
|
57
|
+
export type StartAndroidLiveUpdateOptions = {
|
|
58
|
+
/**
|
|
59
|
+
* A unique name for this live update.
|
|
60
|
+
* Allows you to rebind to the same notification on app restart.
|
|
61
|
+
*/
|
|
62
|
+
updateName?: string;
|
|
63
|
+
/**
|
|
64
|
+
* The notification channel ID to use.
|
|
65
|
+
* Overrides the channelId from variants if provided.
|
|
66
|
+
*/
|
|
67
|
+
channelId?: string;
|
|
68
|
+
};
|
|
69
|
+
/**
|
|
70
|
+
* Options for updating an Android Live Update
|
|
71
|
+
*/
|
|
72
|
+
export type UpdateAndroidLiveUpdateOptions = {};
|
|
73
|
+
/**
|
|
74
|
+
* Options for the useAndroidLiveUpdate hook
|
|
75
|
+
*/
|
|
76
|
+
export type UseAndroidLiveUpdateOptions = {
|
|
77
|
+
/**
|
|
78
|
+
* A unique name for this live update.
|
|
79
|
+
* Allows you to rebind to the same notification on app restart.
|
|
80
|
+
*/
|
|
81
|
+
updateName?: string;
|
|
82
|
+
/**
|
|
83
|
+
* Automatically start the live update when the component mounts.
|
|
84
|
+
*/
|
|
85
|
+
autoStart?: boolean;
|
|
86
|
+
/**
|
|
87
|
+
* Automatically update the live update when the component updates.
|
|
88
|
+
*/
|
|
89
|
+
autoUpdate?: boolean;
|
|
90
|
+
};
|
|
91
|
+
/**
|
|
92
|
+
* Result from the useAndroidLiveUpdate hook
|
|
93
|
+
*/
|
|
94
|
+
export type UseAndroidLiveUpdateResult = {
|
|
95
|
+
start: (options?: StartAndroidLiveUpdateOptions) => Promise<void>;
|
|
96
|
+
update: (options?: UpdateAndroidLiveUpdateOptions) => Promise<void>;
|
|
97
|
+
end: () => Promise<void>;
|
|
98
|
+
isActive: boolean;
|
|
99
|
+
};
|
|
100
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/live-update/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAEtC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAEjD;;;;;GAKG;AACH,MAAM,MAAM,yBAAyB,GAAG;IACtC;;;OAGG;IACH,SAAS,CAAC,EAAE,SAAS,CAAA;IAErB;;;OAGG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAA;IAEpB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;IAElB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,CAAA;AAED;;GAEG;AACH,MAAM,MAAM,6BAA6B,GAAG;IAC1C,oDAAoD;IACpD,CAAC,EAAE,MAAM,CAAA;IACT,yCAAyC;IACzC,CAAC,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAA;IAC7B,wCAAwC;IACxC,CAAC,CAAC,EAAE,cAAc,EAAE,CAAA;IACpB,qCAAqC;IACrC,SAAS,CAAC,EAAE,cAAc,CAAA;IAC1B,oCAAoC;IACpC,QAAQ,CAAC,EAAE,cAAc,CAAA;IACzB,+BAA+B;IAC/B,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,8BAA8B;IAC9B,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,CAAA;AAED;;GAEG;AACH,MAAM,MAAM,qBAAqB,GAAG,6BAA6B,CAAA;AAEjE;;GAEG;AACH,MAAM,MAAM,6BAA6B,GAAG;IAC1C;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAA;IAEnB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,CAAA;AAED;;GAEG;AACH,MAAM,MAAM,8BAA8B,GAAG,EAE5C,CAAA;AAED;;GAEG;AACH,MAAM,MAAM,2BAA2B,GAAG;IACxC;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAA;IAEnB;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAA;IAEnB;;OAEG;IACH,UAAU,CAAC,EAAE,OAAO,CAAA;CACrB,CAAA;AAED;;GAEG;AACH,MAAM,MAAM,0BAA0B,GAAG;IACvC,KAAK,EAAE,CAAC,OAAO,CAAC,EAAE,6BAA6B,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;IACjE,MAAM,EAAE,CAAC,OAAO,CAAC,EAAE,8BAA8B,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;IACnE,GAAG,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAA;IACxB,QAAQ,EAAE,OAAO,CAAA;CAClB,CAAA"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Mapping from Android component name to numeric ID
|
|
3
|
+
* Component IDs are assigned sequentially based on order in components.json (0-indexed)
|
|
4
|
+
*/
|
|
5
|
+
export declare const ANDROID_COMPONENT_NAME_TO_ID: Record<string, number>;
|
|
6
|
+
/**
|
|
7
|
+
* Mapping from numeric ID to Android component name
|
|
8
|
+
*/
|
|
9
|
+
export declare const ANDROID_COMPONENT_ID_TO_NAME: Record<number, string>;
|
|
10
|
+
/**
|
|
11
|
+
* Get Android component ID from name
|
|
12
|
+
* @throws Error if component name is not found
|
|
13
|
+
*/
|
|
14
|
+
export declare function getAndroidComponentId(name: string): number;
|
|
15
|
+
/**
|
|
16
|
+
* Get Android component name from ID
|
|
17
|
+
* @throws Error if component ID is not found
|
|
18
|
+
*/
|
|
19
|
+
export declare function getAndroidComponentName(id: number): string;
|
|
20
|
+
//# sourceMappingURL=component-ids.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"component-ids.d.ts","sourceRoot":"","sources":["../../../src/payload/component-ids.ts"],"names":[],"mappings":"AAIA;;;GAGG;AACH,eAAO,MAAM,4BAA4B,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAsB/D,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,4BAA4B,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAsB/D,CAAA;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAU1D;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,CAQ1D"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { PreloadImageOptions, PreloadImagesResult } from './types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Preload images to Android cache for use in Widgets.
|
|
4
|
+
*
|
|
5
|
+
* Downloaded images are stored in the app's cache directory and exposed via FileProvider.
|
|
6
|
+
* Images can then be referenced using the `assetName` property in the Image component.
|
|
7
|
+
*
|
|
8
|
+
* @param images - Array of images to preload
|
|
9
|
+
* @returns Result indicating which images succeeded or failed
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```typescript
|
|
13
|
+
* const result = await preloadImages([
|
|
14
|
+
* {
|
|
15
|
+
* url: 'https://example.com/album-art.jpg',
|
|
16
|
+
* key: 'current-album',
|
|
17
|
+
* headers: { 'Authorization': 'Bearer token' }
|
|
18
|
+
* }
|
|
19
|
+
* ])
|
|
20
|
+
*
|
|
21
|
+
* // Use in Android Widget
|
|
22
|
+
* <VoltraAndroid.Image source={{ assetName: 'current-album' }} />
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
export declare function preloadImages(images: PreloadImageOptions[]): Promise<PreloadImagesResult>;
|
|
26
|
+
/**
|
|
27
|
+
* Clear preloaded images from Android cache.
|
|
28
|
+
*
|
|
29
|
+
* @param keys - Optional array of image keys to clear. If omitted, clears all preloaded images.
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* ```typescript
|
|
33
|
+
* // Clear specific images
|
|
34
|
+
* await clearPreloadedImages(['album-art', 'profile-pic'])
|
|
35
|
+
*
|
|
36
|
+
* // Clear all preloaded images
|
|
37
|
+
* await clearPreloadedImages()
|
|
38
|
+
* ```
|
|
39
|
+
*/
|
|
40
|
+
export declare function clearPreloadedImages(keys?: string[]): Promise<void>;
|
|
41
|
+
/**
|
|
42
|
+
* Reload Android Widgets. (Alias for reloadAndroidWidgets)
|
|
43
|
+
*/
|
|
44
|
+
export declare function reloadWidgets(widgetIds?: string[]): Promise<void>;
|
|
45
|
+
//# sourceMappingURL=preload.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"preload.d.ts","sourceRoot":"","sources":["../../src/preload.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAA;AAG1E;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAsB,aAAa,CAAC,MAAM,EAAE,mBAAmB,EAAE,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAY/F;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAsB,oBAAoB,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAMzE;AAED;;GAEG;AACH,wBAAsB,aAAa,CAAC,SAAS,CAAC,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAMvE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/renderer/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,iBAAiB,EACtB,oBAAoB,EACpB,0BAA0B,EAC1B,sBAAsB,GACvB,MAAM,eAAe,CAAA"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type ComponentRegistry, VOLTRA_PAYLOAD_VERSION } from '@use-voltra/core';
|
|
2
|
+
import type { ReactNode } from 'react';
|
|
3
|
+
import type { VoltraNodeJson } from '../types.js';
|
|
4
|
+
export declare const androidComponentRegistry: ComponentRegistry;
|
|
5
|
+
export { VOLTRA_PAYLOAD_VERSION };
|
|
6
|
+
export type { ComponentRegistry };
|
|
7
|
+
export declare const renderAndroidVariantToJson: (element: ReactNode) => VoltraNodeJson;
|
|
8
|
+
export declare const createVoltraRenderer: (componentRegistry?: ComponentRegistry) => {
|
|
9
|
+
addRootNode: (name: string, node: ReactNode) => void;
|
|
10
|
+
render: () => Record<string, any>;
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=renderer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"renderer.d.ts","sourceRoot":"","sources":["../../../src/renderer/renderer.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,iBAAiB,EAGtB,sBAAsB,EACvB,MAAM,kBAAkB,CAAA;AACzB,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAGtC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAEjD,eAAO,MAAM,wBAAwB,EAAE,iBAEtC,CAAA;AAED,OAAO,EAAE,sBAAsB,EAAE,CAAA;AACjC,YAAY,EAAE,iBAAiB,EAAE,CAAA;AAEjC,eAAO,MAAM,0BAA0B,GAAI,SAAS,SAAS,KAAG,cAE/D,CAAA;AAED,eAAO,MAAM,oBAAoB,GAAI,oBAAmB,iBAA4C;;;CAEnG,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,+BAA+B,EAAE,MAAM,2BAA2B,CAAA;AAC3E,OAAO,EAAE,2BAA2B,EAAE,MAAM,uBAAuB,CAAA"}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Android-specific style types for Voltra components.
|
|
3
|
+
* These types mirror the supported properties in the Android implementation (Glance).
|
|
4
|
+
*/
|
|
5
|
+
export type StyleProp<T> = T | T[] | null | undefined | false;
|
|
6
|
+
export type VoltraAndroidViewStyle = {
|
|
7
|
+
/** Width of the component. Supports fixed numbers (dp) or "100%" to fill. */
|
|
8
|
+
width?: number | string;
|
|
9
|
+
/** Height of the component. Supports fixed numbers (dp) or "100%" to fill. */
|
|
10
|
+
height?: number | string;
|
|
11
|
+
/** Minimum width (Note: Limited support in Glance) */
|
|
12
|
+
minWidth?: number;
|
|
13
|
+
/** Maximum width (Note: Limited support in Glance) */
|
|
14
|
+
maxWidth?: number;
|
|
15
|
+
/** Minimum height (Note: Limited support in Glance) */
|
|
16
|
+
minHeight?: number;
|
|
17
|
+
/** Maximum height (Note: Limited support in Glance) */
|
|
18
|
+
maxHeight?: number;
|
|
19
|
+
/** Flex weight for the component (maps to .defaultWeight() in Glance) */
|
|
20
|
+
flex?: number;
|
|
21
|
+
/** Flex grow weight for the component (maps to .defaultWeight() in Glance) */
|
|
22
|
+
flexGrow?: number;
|
|
23
|
+
/** Aspect ratio of the component (Note: Not supported in Glance) */
|
|
24
|
+
aspectRatio?: number;
|
|
25
|
+
/** Inner padding for the component */
|
|
26
|
+
padding?: number;
|
|
27
|
+
paddingTop?: number;
|
|
28
|
+
paddingBottom?: number;
|
|
29
|
+
paddingLeft?: number;
|
|
30
|
+
paddingRight?: number;
|
|
31
|
+
paddingVertical?: number;
|
|
32
|
+
paddingHorizontal?: number;
|
|
33
|
+
/** Outer margin for the component (Note: Often implemented as padding in Glance) */
|
|
34
|
+
margin?: number;
|
|
35
|
+
marginTop?: number;
|
|
36
|
+
marginBottom?: number;
|
|
37
|
+
marginLeft?: number;
|
|
38
|
+
marginRight?: number;
|
|
39
|
+
marginVertical?: number;
|
|
40
|
+
marginHorizontal?: number;
|
|
41
|
+
/** Gap between children (Note: Supported by specific layouts like LazyColumn/Row) */
|
|
42
|
+
gap?: number;
|
|
43
|
+
/** Alignment of children along the cross axis */
|
|
44
|
+
alignItems?: 'flex-start' | 'flex-end' | 'center' | 'stretch' | 'baseline';
|
|
45
|
+
/** Alignment of children along the main axis */
|
|
46
|
+
justifyContent?: 'flex-start' | 'flex-end' | 'center' | 'space-between' | 'space-around' | 'space-evenly';
|
|
47
|
+
/** Absolute positioning from the left (maps to Offset in Glance) */
|
|
48
|
+
left?: number;
|
|
49
|
+
/** Absolute positioning from the top (maps to Offset in Glance) */
|
|
50
|
+
top?: number;
|
|
51
|
+
/** Z-index for layering (Note: Limited support in Glance) */
|
|
52
|
+
zIndex?: number;
|
|
53
|
+
/** Background color of the component */
|
|
54
|
+
backgroundColor?: string;
|
|
55
|
+
/** Corner radius for the component (requires Android 12+) */
|
|
56
|
+
borderRadius?: number;
|
|
57
|
+
/** Border width (Note: Not yet implemented in Glance) */
|
|
58
|
+
borderWidth?: number;
|
|
59
|
+
/** Border color (Note: Not yet implemented in Glance) */
|
|
60
|
+
borderColor?: string;
|
|
61
|
+
/** Opacity of the component (Note: Not supported in Glance - apply alpha to colors instead) */
|
|
62
|
+
opacity?: number;
|
|
63
|
+
/** Controls if content is clipped to the border (maps to clipToOutline) */
|
|
64
|
+
overflow?: 'visible' | 'hidden';
|
|
65
|
+
/** Controls layout display mode */
|
|
66
|
+
display?: 'none' | 'flex';
|
|
67
|
+
/** Controls component visibility */
|
|
68
|
+
visibility?: 'visible' | 'hidden' | 'invisible';
|
|
69
|
+
/** Transform effects (Note: Not supported in Glance) */
|
|
70
|
+
transform?: ({
|
|
71
|
+
rotate: string;
|
|
72
|
+
} | {
|
|
73
|
+
rotateZ: string;
|
|
74
|
+
} | {
|
|
75
|
+
scale: number;
|
|
76
|
+
} | {
|
|
77
|
+
scaleX: number;
|
|
78
|
+
} | {
|
|
79
|
+
scaleY: number;
|
|
80
|
+
})[];
|
|
81
|
+
/** Shadow properties (Note: Not supported in Glance) */
|
|
82
|
+
shadowColor?: string;
|
|
83
|
+
shadowOffset?: {
|
|
84
|
+
width: number;
|
|
85
|
+
height: number;
|
|
86
|
+
};
|
|
87
|
+
shadowOpacity?: number;
|
|
88
|
+
shadowRadius?: number;
|
|
89
|
+
/** Glass effect (iOS-specific, included for API compatibility) */
|
|
90
|
+
glassEffect?: 'clear' | 'identity' | 'regular' | 'none';
|
|
91
|
+
};
|
|
92
|
+
export type VoltraAndroidTextStyle = VoltraAndroidViewStyle & {
|
|
93
|
+
/** Text color */
|
|
94
|
+
color?: string;
|
|
95
|
+
/** Font size in sp */
|
|
96
|
+
fontSize?: number;
|
|
97
|
+
/** Font weight */
|
|
98
|
+
fontWeight?: 'normal' | 'bold' | '100' | '200' | '300' | '400' | '500' | '600' | '700' | '800' | '900' | number;
|
|
99
|
+
/** Font family name. When used with `renderAsBitmap`, loads custom .ttf/.otf from `assets/fonts/` */
|
|
100
|
+
fontFamily?: string;
|
|
101
|
+
/** Text alignment */
|
|
102
|
+
textAlign?: 'auto' | 'left' | 'right' | 'center' | 'justify' | 'start' | 'end';
|
|
103
|
+
/** Text decoration line */
|
|
104
|
+
textDecorationLine?: 'none' | 'underline' | 'line-through' | 'underline line-through';
|
|
105
|
+
/** Line height (maps to line spacing in Glance) */
|
|
106
|
+
lineHeight?: number;
|
|
107
|
+
/** Letter spacing (Note: Not supported in Glance) */
|
|
108
|
+
letterSpacing?: number;
|
|
109
|
+
/** Font variants (Note: Not supported in Glance) */
|
|
110
|
+
fontVariant?: ('small-caps' | 'tabular-nums')[];
|
|
111
|
+
/** Maximum number of lines to display (maps to lineLimit) */
|
|
112
|
+
numberOfLines?: number;
|
|
113
|
+
};
|
|
114
|
+
export type VoltraAndroidStyleProp = StyleProp<VoltraAndroidViewStyle>;
|
|
115
|
+
export type VoltraAndroidTextStyleProp = StyleProp<VoltraAndroidTextStyle>;
|
|
116
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/styles/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,MAAM,SAAS,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,GAAG,IAAI,GAAG,SAAS,GAAG,KAAK,CAAA;AAE7D,MAAM,MAAM,sBAAsB,GAAG;IACnC,6EAA6E;IAC7E,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IACvB,8EAA8E;IAC9E,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IACxB,sDAAsD;IACtD,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,sDAAsD;IACtD,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,uDAAuD;IACvD,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,uDAAuD;IACvD,SAAS,CAAC,EAAE,MAAM,CAAA;IAElB,yEAAyE;IACzE,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,8EAA8E;IAC9E,QAAQ,CAAC,EAAE,MAAM,CAAA;IAEjB,oEAAoE;IACpE,WAAW,CAAC,EAAE,MAAM,CAAA;IAEpB,sCAAsC;IACtC,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAE1B,oFAAoF;IACpF,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,gBAAgB,CAAC,EAAE,MAAM,CAAA;IAEzB,qFAAqF;IACrF,GAAG,CAAC,EAAE,MAAM,CAAA;IAEZ,iDAAiD;IACjD,UAAU,CAAC,EAAE,YAAY,GAAG,UAAU,GAAG,QAAQ,GAAG,SAAS,GAAG,UAAU,CAAA;IAC1E,gDAAgD;IAChD,cAAc,CAAC,EAAE,YAAY,GAAG,UAAU,GAAG,QAAQ,GAAG,eAAe,GAAG,cAAc,GAAG,cAAc,CAAA;IAEzG,oEAAoE;IACpE,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,mEAAmE;IACnE,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,6DAA6D;IAC7D,MAAM,CAAC,EAAE,MAAM,CAAA;IAEf,wCAAwC;IACxC,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,6DAA6D;IAC7D,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,yDAAyD;IACzD,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,yDAAyD;IACzD,WAAW,CAAC,EAAE,MAAM,CAAA;IAEpB,+FAA+F;IAC/F,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,2EAA2E;IAC3E,QAAQ,CAAC,EAAE,SAAS,GAAG,QAAQ,CAAA;IAE/B,mCAAmC;IACnC,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IACzB,oCAAoC;IACpC,UAAU,CAAC,EAAE,SAAS,GAAG,QAAQ,GAAG,WAAW,CAAA;IAE/C,wDAAwD;IACxD,SAAS,CAAC,EAAE,CAAC;QAAE,MAAM,EAAE,MAAM,CAAA;KAAE,GAAG;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE,GAAG;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,GAAG;QAAE,MAAM,EAAE,MAAM,CAAA;KAAE,GAAG;QAAE,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC,EAAE,CAAA;IAEtH,wDAAwD;IACxD,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,YAAY,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAA;IAChD,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,YAAY,CAAC,EAAE,MAAM,CAAA;IAErB,kEAAkE;IAClE,WAAW,CAAC,EAAE,OAAO,GAAG,UAAU,GAAG,SAAS,GAAG,MAAM,CAAA;CACxD,CAAA;AAED,MAAM,MAAM,sBAAsB,GAAG,sBAAsB,GAAG;IAC5D,iBAAiB;IACjB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,sBAAsB;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,kBAAkB;IAClB,UAAU,CAAC,EAAE,QAAQ,GAAG,MAAM,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,GAAG,MAAM,CAAA;IAC/G,qGAAqG;IACrG,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,qBAAqB;IACrB,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ,GAAG,SAAS,GAAG,OAAO,GAAG,KAAK,CAAA;IAC9E,2BAA2B;IAC3B,kBAAkB,CAAC,EAAE,MAAM,GAAG,WAAW,GAAG,cAAc,GAAG,wBAAwB,CAAA;IACrF,mDAAmD;IACnD,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,qDAAqD;IACrD,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,oDAAoD;IACpD,WAAW,CAAC,EAAE,CAAC,YAAY,GAAG,cAAc,CAAC,EAAE,CAAA;IAC/C,6DAA6D;IAC7D,aAAa,CAAC,EAAE,MAAM,CAAA;CACvB,CAAA;AAED,MAAM,MAAM,sBAAsB,GAAG,SAAS,CAAC,sBAAsB,CAAC,CAAA;AACtE,MAAM,MAAM,0BAA0B,GAAG,SAAS,CAAC,sBAAsB,CAAC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,iBAAiB,EACjB,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,iBAAiB,EACjB,gBAAgB,EAChB,cAAc,EACd,eAAe,EACf,uBAAuB,GACxB,MAAM,kBAAkB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAA"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
declare global {
|
|
2
|
+
var __accept: (...args: unknown[]) => void;
|
|
3
|
+
}
|
|
4
|
+
/**
|
|
5
|
+
* Taps into the HMR accept function to forcefully re-render the component when any module is updated.
|
|
6
|
+
* Is only available in development mode.
|
|
7
|
+
*/
|
|
8
|
+
export declare const useUpdateOnHMR: () => void;
|
|
9
|
+
//# sourceMappingURL=useUpdateOnHMR.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useUpdateOnHMR.d.ts","sourceRoot":"","sources":["../../../src/utils/useUpdateOnHMR.ts"],"names":[],"mappings":"AAEA,OAAO,CAAC,MAAM,CAAC;IAEb,IAAI,QAAQ,EAAE,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,IAAI,CAAA;CAC3C;AAED;;;GAGG;AACH,eAAO,MAAM,cAAc,YAmB1B,CAAA"}
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import type { AndroidWidgetVariants, UpdateAndroidWidgetOptions, WidgetInfo } from './types.js';
|
|
2
|
+
export type { AndroidWidgetSize, AndroidWidgetSizeVariant, AndroidWidgetVariants, UpdateAndroidWidgetOptions, WidgetInfo, } from './types.js';
|
|
3
|
+
/**
|
|
4
|
+
* Update an Android home screen widget with new content.
|
|
5
|
+
*
|
|
6
|
+
* The content will be stored in SharedPreferences and the widget
|
|
7
|
+
* will be updated to display the new content.
|
|
8
|
+
*
|
|
9
|
+
* @param widgetId - The widget identifier
|
|
10
|
+
* @param variants - An array of size variants with their breakpoints and content.
|
|
11
|
+
* Android will automatically select the best matching variant based on the
|
|
12
|
+
* actual widget dimensions.
|
|
13
|
+
* @param options - Optional settings like deep link URL
|
|
14
|
+
*
|
|
15
|
+
* @example Different content per size
|
|
16
|
+
* ```tsx
|
|
17
|
+
* import { VoltraAndroid, updateAndroidWidget } from 'voltra'
|
|
18
|
+
*
|
|
19
|
+
* await updateAndroidWidget('weather', [
|
|
20
|
+
* {
|
|
21
|
+
* size: { width: 150, height: 100 },
|
|
22
|
+
* content: <VoltraAndroid.Text fontSize={32}>72°F</VoltraAndroid.Text>
|
|
23
|
+
* },
|
|
24
|
+
* {
|
|
25
|
+
* size: { width: 250, height: 150 },
|
|
26
|
+
* content: (
|
|
27
|
+
* <VoltraAndroid.Row>
|
|
28
|
+
* <VoltraAndroid.Text fontSize={32}>72°F</VoltraAndroid.Text>
|
|
29
|
+
* <VoltraAndroid.Column>
|
|
30
|
+
* <VoltraAndroid.Text>Sunny</VoltraAndroid.Text>
|
|
31
|
+
* <VoltraAndroid.Text>High: 78° Low: 65°</VoltraAndroid.Text>
|
|
32
|
+
* </VoltraAndroid.Column>
|
|
33
|
+
* </VoltraAndroid.Row>
|
|
34
|
+
* )
|
|
35
|
+
* }
|
|
36
|
+
* ], { deepLinkUrl: '/weather' })
|
|
37
|
+
* ```
|
|
38
|
+
*/
|
|
39
|
+
export declare const updateAndroidWidget: (widgetId: string, variants: AndroidWidgetVariants, options?: UpdateAndroidWidgetOptions) => Promise<void>;
|
|
40
|
+
/**
|
|
41
|
+
* Reload widget timelines to refresh their content.
|
|
42
|
+
*
|
|
43
|
+
* Use this after updating data that widgets depend on (e.g., after preloading
|
|
44
|
+
* new images) to force them to re-render.
|
|
45
|
+
*
|
|
46
|
+
* @param widgetIds - Optional array of widget IDs to reload. If omitted, reloads all widgets.
|
|
47
|
+
*
|
|
48
|
+
* @example
|
|
49
|
+
* ```typescript
|
|
50
|
+
* // Reload specific widgets
|
|
51
|
+
* await reloadAndroidWidgets(['weather', 'calendar'])
|
|
52
|
+
*
|
|
53
|
+
* // Reload all widgets
|
|
54
|
+
* await reloadAndroidWidgets()
|
|
55
|
+
* ```
|
|
56
|
+
*/
|
|
57
|
+
export declare const reloadAndroidWidgets: (widgetIds?: string[]) => Promise<void>;
|
|
58
|
+
/**
|
|
59
|
+
* Clear a widget's stored data.
|
|
60
|
+
*
|
|
61
|
+
* This removes the JSON content and deep link URL for the specified widget,
|
|
62
|
+
* causing it to show its placeholder state.
|
|
63
|
+
*
|
|
64
|
+
* @param widgetId - The widget identifier to clear
|
|
65
|
+
*
|
|
66
|
+
* @example
|
|
67
|
+
* ```typescript
|
|
68
|
+
* await clearAndroidWidget('weather')
|
|
69
|
+
* ```
|
|
70
|
+
*/
|
|
71
|
+
export declare const clearAndroidWidget: (widgetId: string) => Promise<void>;
|
|
72
|
+
/**
|
|
73
|
+
* Clear all widgets' stored data.
|
|
74
|
+
*
|
|
75
|
+
* This removes the JSON content and deep link URLs for all configured widgets,
|
|
76
|
+
* causing them to show their placeholder states.
|
|
77
|
+
*
|
|
78
|
+
* @example
|
|
79
|
+
* ```typescript
|
|
80
|
+
* await clearAllAndroidWidgets()
|
|
81
|
+
* ```
|
|
82
|
+
*/
|
|
83
|
+
export declare const clearAllAndroidWidgets: () => Promise<void>;
|
|
84
|
+
/**
|
|
85
|
+
* Request to pin a widget to the home screen.
|
|
86
|
+
*
|
|
87
|
+
* This will show the Android system pin widget dialog, allowing the user
|
|
88
|
+
* to add the widget to their home screen. Optionally, you can provide
|
|
89
|
+
* preview dimensions to show a preview of the widget in the pin dialog.
|
|
90
|
+
*
|
|
91
|
+
* See: https://developer.android.com/develop/ui/compose/glance/pin-in-app
|
|
92
|
+
*
|
|
93
|
+
* @param widgetId - The widget identifier to pin
|
|
94
|
+
* @param options - Optional settings for the pin request
|
|
95
|
+
* @param options.previewWidth - Optional preview width in dp (default: 245)
|
|
96
|
+
* @param options.previewHeight - Optional preview height in dp (default: 115)
|
|
97
|
+
* @returns Promise that resolves to true if the pin request was successful
|
|
98
|
+
*
|
|
99
|
+
* @example Basic usage
|
|
100
|
+
* ```typescript
|
|
101
|
+
* const success = await requestPinAndroidWidget('weather')
|
|
102
|
+
* if (success) {
|
|
103
|
+
* console.log('Widget pin request sent')
|
|
104
|
+
* }
|
|
105
|
+
* ```
|
|
106
|
+
*
|
|
107
|
+
* @example With preview dimensions
|
|
108
|
+
* ```typescript
|
|
109
|
+
* const success = await requestPinAndroidWidget('weather', {
|
|
110
|
+
* previewWidth: 245,
|
|
111
|
+
* previewHeight: 115
|
|
112
|
+
* })
|
|
113
|
+
* ```
|
|
114
|
+
*/
|
|
115
|
+
export declare const requestPinAndroidWidget: (widgetId: string, options?: {
|
|
116
|
+
previewWidth?: number;
|
|
117
|
+
previewHeight?: number;
|
|
118
|
+
}) => Promise<boolean>;
|
|
119
|
+
/**
|
|
120
|
+
* Fetches all active widget instances for the containing app on Android.
|
|
121
|
+
*
|
|
122
|
+
* @returns A promise that resolves to an array of active widget instances.
|
|
123
|
+
*
|
|
124
|
+
* @example
|
|
125
|
+
* ```typescript
|
|
126
|
+
* const widgets = await getActiveWidgets()
|
|
127
|
+
* console.log('Active widgets:', widgets)
|
|
128
|
+
* ```
|
|
129
|
+
*/
|
|
130
|
+
export declare const getActiveWidgets: () => Promise<WidgetInfo[]>;
|
|
131
|
+
//# sourceMappingURL=api.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../../src/widgets/api.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,qBAAqB,EAAE,0BAA0B,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAG/F,YAAY,EACV,iBAAiB,EACjB,wBAAwB,EACxB,qBAAqB,EACrB,0BAA0B,EAC1B,UAAU,GACX,MAAM,YAAY,CAAA;AAEnB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,eAAO,MAAM,mBAAmB,GAC9B,UAAU,MAAM,EAChB,UAAU,qBAAqB,EAC/B,UAAU,0BAA0B,KACnC,OAAO,CAAC,IAAI,CAMd,CAAA;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,oBAAoB,GAAU,YAAY,MAAM,EAAE,KAAG,OAAO,CAAC,IAAI,CAE7E,CAAA;AAED;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,kBAAkB,GAAU,UAAU,MAAM,KAAG,OAAO,CAAC,IAAI,CAEvE,CAAA;AAED;;;;;;;;;;GAUG;AACH,eAAO,MAAM,sBAAsB,QAAa,OAAO,CAAC,IAAI,CAE3D,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,eAAO,MAAM,uBAAuB,GAClC,UAAU,MAAM,EAChB,UAAU;IAAE,YAAY,CAAC,EAAE,MAAM,CAAC;IAAC,aAAa,CAAC,EAAE,MAAM,CAAA;CAAE,KAC1D,OAAO,CAAC,OAAO,CAEjB,CAAA;AAED;;;;;;;;;;GAUG;AACH,eAAO,MAAM,gBAAgB,QAAa,OAAO,CAAC,UAAU,EAAE,CAE7D,CAAA"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { clearAllAndroidWidgets, clearAndroidWidget, getActiveWidgets, reloadAndroidWidgets, requestPinAndroidWidget, updateAndroidWidget, } from './api.js';
|
|
2
|
+
export type { AndroidWidgetSize, AndroidWidgetSizeVariant, AndroidWidgetVariants, UpdateAndroidWidgetOptions, WidgetInfo, } from './types.js';
|
|
3
|
+
//# sourceMappingURL=index.d.ts.map
|