@use-voltra/android 2.0.0 → 2.1.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/build/commonjs/index.js +20 -0
- package/build/commonjs/index.js.map +1 -1
- package/build/module/index.js +6 -0
- package/build/module/index.js.map +1 -1
- package/build/typescript/commonjs/index.d.ts +3 -0
- package/build/typescript/commonjs/index.d.ts.map +1 -1
- package/build/typescript/module/index.d.ts +3 -0
- package/build/typescript/module/index.d.ts.map +1 -1
- package/package.json +3 -2
- package/src/dynamic-colors.ts +33 -0
- package/src/index.ts +99 -0
- package/src/internal.ts +2 -0
- package/src/jsx/AreaMark.tsx +16 -0
- package/src/jsx/BarMark.tsx +18 -0
- package/src/jsx/Box.tsx +5 -0
- package/src/jsx/Button.tsx +5 -0
- package/src/jsx/Chart.tsx +123 -0
- package/src/jsx/CheckBox.tsx +5 -0
- package/src/jsx/CircleIconButton.tsx +14 -0
- package/src/jsx/CircularProgressIndicator.tsx +7 -0
- package/src/jsx/Column.tsx +5 -0
- package/src/jsx/FilledButton.tsx +14 -0
- package/src/jsx/Image.tsx +21 -0
- package/src/jsx/LazyColumn.tsx +5 -0
- package/src/jsx/LazyVerticalGrid.tsx +45 -0
- package/src/jsx/LineMark.tsx +17 -0
- package/src/jsx/LinearProgressIndicator.tsx +7 -0
- package/src/jsx/OutlineButton.tsx +14 -0
- package/src/jsx/PointMark.tsx +16 -0
- package/src/jsx/RadioButton.tsx +5 -0
- package/src/jsx/Row.tsx +5 -0
- package/src/jsx/RuleMark.tsx +15 -0
- package/src/jsx/Scaffold.tsx +5 -0
- package/src/jsx/SectorMark.tsx +17 -0
- package/src/jsx/Spacer.tsx +5 -0
- package/src/jsx/SquareIconButton.tsx +14 -0
- package/src/jsx/Switch.tsx +5 -0
- package/src/jsx/Text.tsx +10 -0
- package/src/jsx/TitleBar.tsx +18 -0
- package/src/jsx/baseProps.tsx +13 -0
- package/src/jsx/chart-types.ts +2 -0
- package/src/jsx/createVoltraComponent.ts +2 -0
- package/src/jsx/index.ts +1 -0
- package/src/jsx/primitives.ts +28 -0
- package/src/jsx/props/.generated +15 -0
- package/src/jsx/props/AndroidBox.ts +19 -0
- package/src/jsx/props/AndroidButton.ts +10 -0
- package/src/jsx/props/AndroidChart.ts +20 -0
- package/src/jsx/props/AndroidCheckBox.ts +20 -0
- package/src/jsx/props/AndroidCircleIconButton.ts +18 -0
- package/src/jsx/props/AndroidCircularProgressIndicator.ts +10 -0
- package/src/jsx/props/AndroidColumn.ts +12 -0
- package/src/jsx/props/AndroidFilledButton.ts +20 -0
- package/src/jsx/props/AndroidImage.ts +26 -0
- package/src/jsx/props/AndroidLazyColumn.ts +10 -0
- package/src/jsx/props/AndroidLazyVerticalGrid.ts +12 -0
- package/src/jsx/props/AndroidLinearProgressIndicator.ts +14 -0
- package/src/jsx/props/AndroidOutlineButton.ts +18 -0
- package/src/jsx/props/AndroidRadioButton.ts +22 -0
- package/src/jsx/props/AndroidRow.ts +12 -0
- package/src/jsx/props/AndroidScaffold.ts +12 -0
- package/src/jsx/props/AndroidSpacer.ts +7 -0
- package/src/jsx/props/AndroidSquareIconButton.ts +18 -0
- package/src/jsx/props/AndroidSwitch.ts +24 -0
- package/src/jsx/props/AndroidText.ts +14 -0
- package/src/jsx/props/AndroidTitleBar.ts +18 -0
- package/src/live-update/renderer.ts +36 -0
- package/src/live-update/types.ts +44 -0
- package/src/ongoing-notification/components.tsx +49 -0
- package/src/ongoing-notification/renderer.ts +360 -0
- package/src/ongoing-notification/types.ts +199 -0
- package/src/payload/component-ids.ts +89 -0
- package/src/preload-utils.ts +78 -0
- package/src/renderer/index.ts +6 -0
- package/src/renderer/renderer.ts +25 -0
- package/src/server.ts +19 -0
- package/src/styles/types.ts +114 -0
- package/src/types.ts +38 -0
- package/src/utils/index.ts +0 -0
- package/src/widgets/renderer.ts +90 -0
- package/src/widgets/types.ts +62 -0
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { createElement } from 'react'
|
|
2
|
+
|
|
3
|
+
import type { AndroidColorValue } from '../dynamic-colors.js'
|
|
4
|
+
import { VOLTRA_MARK_TAG } from './BarMark.js'
|
|
5
|
+
import type { ChartDataPoint } from './chart-types.js'
|
|
6
|
+
|
|
7
|
+
export type PointMarkProps = {
|
|
8
|
+
data: ChartDataPoint[]
|
|
9
|
+
color?: AndroidColorValue
|
|
10
|
+
symbol?: string
|
|
11
|
+
symbolSize?: number
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export const PointMark = (props: PointMarkProps) => createElement('VoltraPointMark', props as any)
|
|
15
|
+
PointMark.displayName = 'PointMark'
|
|
16
|
+
PointMark[VOLTRA_MARK_TAG] = 'point' as const
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { createVoltraComponent } from './createVoltraComponent.js'
|
|
2
|
+
import type { AndroidRadioButtonProps as RadioButtonProps } from './props/AndroidRadioButton.js'
|
|
3
|
+
|
|
4
|
+
export type { RadioButtonProps }
|
|
5
|
+
export const RadioButton = createVoltraComponent<RadioButtonProps>('AndroidRadioButton')
|
package/src/jsx/Row.tsx
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { createElement } from 'react'
|
|
2
|
+
|
|
3
|
+
import type { AndroidColorValue } from '../dynamic-colors.js'
|
|
4
|
+
import { VOLTRA_MARK_TAG } from './BarMark.js'
|
|
5
|
+
|
|
6
|
+
export type RuleMarkProps = {
|
|
7
|
+
xValue?: string | number
|
|
8
|
+
yValue?: number
|
|
9
|
+
color?: AndroidColorValue
|
|
10
|
+
lineWidth?: number
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export const RuleMark = (props: RuleMarkProps) => createElement('VoltraRuleMark', props as any)
|
|
14
|
+
RuleMark.displayName = 'RuleMark'
|
|
15
|
+
RuleMark[VOLTRA_MARK_TAG] = 'rule' as const
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { createVoltraComponent } from './createVoltraComponent.js'
|
|
2
|
+
import type { AndroidScaffoldProps as ScaffoldProps } from './props/AndroidScaffold.js'
|
|
3
|
+
|
|
4
|
+
export type { ScaffoldProps }
|
|
5
|
+
export const Scaffold = createVoltraComponent<ScaffoldProps>('AndroidScaffold')
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { createElement } from 'react'
|
|
2
|
+
|
|
3
|
+
import type { AndroidColorValue } from '../dynamic-colors.js'
|
|
4
|
+
import { VOLTRA_MARK_TAG } from './BarMark.js'
|
|
5
|
+
import type { SectorDataPoint } from './chart-types.js'
|
|
6
|
+
|
|
7
|
+
export type SectorMarkProps = {
|
|
8
|
+
data: SectorDataPoint[]
|
|
9
|
+
color?: AndroidColorValue
|
|
10
|
+
innerRadius?: number
|
|
11
|
+
outerRadius?: number
|
|
12
|
+
angularInset?: number
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export const SectorMark = (props: SectorMarkProps) => createElement('VoltraSectorMark', props as any)
|
|
16
|
+
SectorMark.displayName = 'SectorMark'
|
|
17
|
+
SectorMark[VOLTRA_MARK_TAG] = 'sector' as const
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { createVoltraComponent } from './createVoltraComponent.js'
|
|
2
|
+
import type { AndroidSquareIconButtonProps as SquareIconButtonProps } from './props/AndroidSquareIconButton.js'
|
|
3
|
+
|
|
4
|
+
export type { SquareIconButtonProps }
|
|
5
|
+
export const SquareIconButton = createVoltraComponent<SquareIconButtonProps>('AndroidSquareIconButton', {
|
|
6
|
+
toJSON: (props) => {
|
|
7
|
+
const { icon, ...rest } = props
|
|
8
|
+
|
|
9
|
+
return {
|
|
10
|
+
...rest,
|
|
11
|
+
...(icon ? { icon: JSON.stringify(icon) } : {}),
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
})
|
package/src/jsx/Text.tsx
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { VoltraAndroidTextStyleProp } from '../styles/types.js'
|
|
2
|
+
import { createVoltraComponent } from './createVoltraComponent.js'
|
|
3
|
+
import type { AndroidTextProps } from './props/AndroidText.js'
|
|
4
|
+
|
|
5
|
+
// Update 'style' to use Android text style prop
|
|
6
|
+
export type TextProps = Omit<AndroidTextProps, 'style'> & {
|
|
7
|
+
style?: VoltraAndroidTextStyleProp
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export const Text = createVoltraComponent<TextProps>('AndroidText')
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { ImageSource } from './Image.js'
|
|
2
|
+
import { createVoltraComponent } from './createVoltraComponent.js'
|
|
3
|
+
import type { AndroidTitleBarProps } from './props/AndroidTitleBar.js'
|
|
4
|
+
|
|
5
|
+
export type TitleBarProps = Omit<AndroidTitleBarProps, 'startIcon'> & {
|
|
6
|
+
startIcon: ImageSource
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export const TitleBar = createVoltraComponent<TitleBarProps>('AndroidTitleBar', {
|
|
10
|
+
toJSON: (props) => {
|
|
11
|
+
const { startIcon, ...rest } = props
|
|
12
|
+
|
|
13
|
+
return {
|
|
14
|
+
...rest,
|
|
15
|
+
startIcon: JSON.stringify(startIcon),
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
})
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ReactNode } from 'react'
|
|
2
|
+
|
|
3
|
+
import type { VoltraAndroidStyleProp } from '../styles/types.js'
|
|
4
|
+
|
|
5
|
+
export type VoltraAndroidBaseProps = {
|
|
6
|
+
id?: string
|
|
7
|
+
deepLinkUrl?: string
|
|
8
|
+
style?: VoltraAndroidStyleProp
|
|
9
|
+
children?: ReactNode
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
/** Alias used by generated `props/*.ts` component types */
|
|
13
|
+
export type VoltraBaseProps = VoltraAndroidBaseProps
|
package/src/jsx/index.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './primitives.js'
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export * from './AreaMark.js'
|
|
2
|
+
export * from './BarMark.js'
|
|
3
|
+
export * from './Box.js'
|
|
4
|
+
export * from './Button.js'
|
|
5
|
+
export * from './Chart.js'
|
|
6
|
+
export * from './chart-types.js'
|
|
7
|
+
export * from './CheckBox.js'
|
|
8
|
+
export * from './CircleIconButton.js'
|
|
9
|
+
export * from './CircularProgressIndicator.js'
|
|
10
|
+
export * from './Column.js'
|
|
11
|
+
export * from './FilledButton.js'
|
|
12
|
+
export * from './Image.js'
|
|
13
|
+
export * from './LazyColumn.js'
|
|
14
|
+
export * from './LazyVerticalGrid.js'
|
|
15
|
+
export * from './LinearProgressIndicator.js'
|
|
16
|
+
export * from './LineMark.js'
|
|
17
|
+
export * from './OutlineButton.js'
|
|
18
|
+
export * from './PointMark.js'
|
|
19
|
+
export * from './RadioButton.js'
|
|
20
|
+
export * from './Row.js'
|
|
21
|
+
export * from './RuleMark.js'
|
|
22
|
+
export * from './Scaffold.js'
|
|
23
|
+
export * from './SectorMark.js'
|
|
24
|
+
export * from './Spacer.js'
|
|
25
|
+
export * from './SquareIconButton.js'
|
|
26
|
+
export * from './Switch.js'
|
|
27
|
+
export * from './Text.js'
|
|
28
|
+
export * from './TitleBar.js'
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
This directory contains auto-generated Android component props type files.
|
|
2
|
+
DO NOT EDIT MANUALLY.
|
|
3
|
+
|
|
4
|
+
Generated from: data/components.json
|
|
5
|
+
Schema version: 1.0.0
|
|
6
|
+
|
|
7
|
+
To regenerate these files, run:
|
|
8
|
+
pnpm run generate
|
|
9
|
+
|
|
10
|
+
Users should create component files manually using createVoltraComponent with these types.
|
|
11
|
+
Example:
|
|
12
|
+
import { createVoltraComponent } from '../createVoltraComponent'
|
|
13
|
+
import type { ButtonProps } from './props/Button'
|
|
14
|
+
|
|
15
|
+
export const Button = createVoltraComponent<ButtonProps>('Button')
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
// 🤖 AUTO-GENERATED from data/components.json
|
|
2
|
+
// DO NOT EDIT MANUALLY - Changes will be overwritten
|
|
3
|
+
// Schema version: 1.0.0
|
|
4
|
+
|
|
5
|
+
import type { VoltraBaseProps } from '../baseProps'
|
|
6
|
+
|
|
7
|
+
export type AndroidBoxProps = VoltraBaseProps & {
|
|
8
|
+
/** Content alignment within the box */
|
|
9
|
+
contentAlignment?:
|
|
10
|
+
| 'top-start'
|
|
11
|
+
| 'top-center'
|
|
12
|
+
| 'top-end'
|
|
13
|
+
| 'center-start'
|
|
14
|
+
| 'center'
|
|
15
|
+
| 'center-end'
|
|
16
|
+
| 'bottom-start'
|
|
17
|
+
| 'bottom-center'
|
|
18
|
+
| 'bottom-end'
|
|
19
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// 🤖 AUTO-GENERATED from data/components.json
|
|
2
|
+
// DO NOT EDIT MANUALLY - Changes will be overwritten
|
|
3
|
+
// Schema version: 1.0.0
|
|
4
|
+
|
|
5
|
+
import type { VoltraBaseProps } from '../baseProps'
|
|
6
|
+
|
|
7
|
+
export type AndroidButtonProps = VoltraBaseProps & {
|
|
8
|
+
/** Whether the button is enabled */
|
|
9
|
+
enabled?: boolean
|
|
10
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
// 🤖 AUTO-GENERATED from data/components.json
|
|
2
|
+
// DO NOT EDIT MANUALLY - Changes will be overwritten
|
|
3
|
+
// Schema version: 1.0.0
|
|
4
|
+
|
|
5
|
+
import type { VoltraBaseProps } from '../baseProps'
|
|
6
|
+
|
|
7
|
+
export type AndroidChartProps = VoltraBaseProps & {
|
|
8
|
+
/** Compact mark data encoded from children by toJSON */
|
|
9
|
+
marks?: string
|
|
10
|
+
/** Show or hide the x-axis */
|
|
11
|
+
xAxisVisibility?: 'automatic' | 'visible' | 'hidden'
|
|
12
|
+
/** Show or hide the y-axis */
|
|
13
|
+
yAxisVisibility?: 'automatic' | 'visible' | 'hidden'
|
|
14
|
+
/** Show or hide the chart legend */
|
|
15
|
+
legendVisibility?: 'automatic' | 'visible' | 'hidden'
|
|
16
|
+
/** Map of series name to color string */
|
|
17
|
+
foregroundStyleScale?: Record<string, any>
|
|
18
|
+
/** Enable scrolling on the given axis */
|
|
19
|
+
chartScrollableAxes?: 'horizontal' | 'vertical'
|
|
20
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
// 🤖 AUTO-GENERATED from data/components.json
|
|
2
|
+
// DO NOT EDIT MANUALLY - Changes will be overwritten
|
|
3
|
+
// Schema version: 1.0.0
|
|
4
|
+
|
|
5
|
+
import type { VoltraBaseProps } from '../baseProps'
|
|
6
|
+
|
|
7
|
+
export type AndroidCheckBoxProps = VoltraBaseProps & {
|
|
8
|
+
/** Unique identifier for interaction events */
|
|
9
|
+
id: string
|
|
10
|
+
/** Initial checked state */
|
|
11
|
+
checked?: boolean
|
|
12
|
+
/** Text label */
|
|
13
|
+
text?: string
|
|
14
|
+
/** Checked color */
|
|
15
|
+
checkedColor?: string
|
|
16
|
+
/** Unchecked color */
|
|
17
|
+
uncheckedColor?: string
|
|
18
|
+
/** Maximum lines for text */
|
|
19
|
+
maxLines?: number
|
|
20
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// 🤖 AUTO-GENERATED from data/components.json
|
|
2
|
+
// DO NOT EDIT MANUALLY - Changes will be overwritten
|
|
3
|
+
// Schema version: 1.0.0
|
|
4
|
+
|
|
5
|
+
import type { VoltraBaseProps } from '../baseProps'
|
|
6
|
+
|
|
7
|
+
export type AndroidCircleIconButtonProps = VoltraBaseProps & {
|
|
8
|
+
/** Icon source */
|
|
9
|
+
icon: Record<string, any>
|
|
10
|
+
/** Accessibility description */
|
|
11
|
+
contentDescription?: string
|
|
12
|
+
/** Whether the button is enabled */
|
|
13
|
+
enabled?: boolean
|
|
14
|
+
/** Background color */
|
|
15
|
+
backgroundColor?: string
|
|
16
|
+
/** Icon color */
|
|
17
|
+
contentColor?: string
|
|
18
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// 🤖 AUTO-GENERATED from data/components.json
|
|
2
|
+
// DO NOT EDIT MANUALLY - Changes will be overwritten
|
|
3
|
+
// Schema version: 1.0.0
|
|
4
|
+
|
|
5
|
+
import type { VoltraBaseProps } from '../baseProps'
|
|
6
|
+
|
|
7
|
+
export type AndroidCircularProgressIndicatorProps = VoltraBaseProps & {
|
|
8
|
+
/** Progress color */
|
|
9
|
+
color?: string
|
|
10
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// 🤖 AUTO-GENERATED from data/components.json
|
|
2
|
+
// DO NOT EDIT MANUALLY - Changes will be overwritten
|
|
3
|
+
// Schema version: 1.0.0
|
|
4
|
+
|
|
5
|
+
import type { VoltraBaseProps } from '../baseProps'
|
|
6
|
+
|
|
7
|
+
export type AndroidColumnProps = VoltraBaseProps & {
|
|
8
|
+
/** Horizontal alignment of children */
|
|
9
|
+
horizontalAlignment?: 'start' | 'center-horizontally' | 'end'
|
|
10
|
+
/** Vertical alignment of children */
|
|
11
|
+
verticalAlignment?: 'top' | 'center-vertically' | 'bottom'
|
|
12
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
// 🤖 AUTO-GENERATED from data/components.json
|
|
2
|
+
// DO NOT EDIT MANUALLY - Changes will be overwritten
|
|
3
|
+
// Schema version: 1.0.0
|
|
4
|
+
|
|
5
|
+
import type { VoltraBaseProps } from '../baseProps'
|
|
6
|
+
|
|
7
|
+
export type AndroidFilledButtonProps = VoltraBaseProps & {
|
|
8
|
+
/** Text to display */
|
|
9
|
+
text: string
|
|
10
|
+
/** Whether the button is enabled */
|
|
11
|
+
enabled?: boolean
|
|
12
|
+
/** Optional icon */
|
|
13
|
+
icon?: Record<string, any>
|
|
14
|
+
/** Background color */
|
|
15
|
+
backgroundColor?: string
|
|
16
|
+
/** Text/icon color */
|
|
17
|
+
contentColor?: string
|
|
18
|
+
/** Maximum lines for text */
|
|
19
|
+
maxLines?: number
|
|
20
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
// 🤖 AUTO-GENERATED from data/components.json
|
|
2
|
+
// DO NOT EDIT MANUALLY - Changes will be overwritten
|
|
3
|
+
// Schema version: 1.0.0
|
|
4
|
+
|
|
5
|
+
import type { ReactNode } from 'react'
|
|
6
|
+
|
|
7
|
+
import type { VoltraBaseProps } from '../baseProps'
|
|
8
|
+
|
|
9
|
+
export type AndroidImageProps = VoltraBaseProps & {
|
|
10
|
+
/** Image source */
|
|
11
|
+
source: Record<string, any>
|
|
12
|
+
/** Resizing mode */
|
|
13
|
+
resizeMode?: 'cover' | 'contain' | 'stretch' | 'repeat' | 'center'
|
|
14
|
+
/** Accessibility description */
|
|
15
|
+
contentDescription?: string
|
|
16
|
+
/** How the image should scale within its bounds */
|
|
17
|
+
contentScale?: 'crop' | 'cover' | 'fit' | 'contain' | 'fill-bounds' | 'stretch'
|
|
18
|
+
/** Image opacity from 0 to 1 */
|
|
19
|
+
alpha?: number
|
|
20
|
+
/** Tint color filter */
|
|
21
|
+
colorFilter?: string
|
|
22
|
+
/** Legacy tint color alias for colorFilter */
|
|
23
|
+
tintColor?: string
|
|
24
|
+
/** Custom fallback content rendered when the image is missing */
|
|
25
|
+
fallback?: ReactNode
|
|
26
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// 🤖 AUTO-GENERATED from data/components.json
|
|
2
|
+
// DO NOT EDIT MANUALLY - Changes will be overwritten
|
|
3
|
+
// Schema version: 1.0.0
|
|
4
|
+
|
|
5
|
+
import type { VoltraBaseProps } from '../baseProps'
|
|
6
|
+
|
|
7
|
+
export type AndroidLazyColumnProps = VoltraBaseProps & {
|
|
8
|
+
/** Horizontal alignment of children */
|
|
9
|
+
horizontalAlignment?: 'start' | 'center-horizontally' | 'end'
|
|
10
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// 🤖 AUTO-GENERATED from data/components.json
|
|
2
|
+
// DO NOT EDIT MANUALLY - Changes will be overwritten
|
|
3
|
+
// Schema version: 1.0.0
|
|
4
|
+
|
|
5
|
+
import type { VoltraBaseProps } from '../baseProps'
|
|
6
|
+
|
|
7
|
+
export type AndroidLazyVerticalGridProps = VoltraBaseProps & {
|
|
8
|
+
/** Number of fixed grid columns */
|
|
9
|
+
columns?: number
|
|
10
|
+
/** Horizontal alignment of children */
|
|
11
|
+
horizontalAlignment?: 'start' | 'center-horizontally' | 'end'
|
|
12
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// 🤖 AUTO-GENERATED from data/components.json
|
|
2
|
+
// DO NOT EDIT MANUALLY - Changes will be overwritten
|
|
3
|
+
// Schema version: 1.0.0
|
|
4
|
+
|
|
5
|
+
import type { VoltraBaseProps } from '../baseProps'
|
|
6
|
+
|
|
7
|
+
export type AndroidLinearProgressIndicatorProps = VoltraBaseProps & {
|
|
8
|
+
/** Progress value from 0 to 1 */
|
|
9
|
+
progress?: number
|
|
10
|
+
/** Progress color */
|
|
11
|
+
color?: string
|
|
12
|
+
/** Track background color */
|
|
13
|
+
backgroundColor?: string
|
|
14
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// 🤖 AUTO-GENERATED from data/components.json
|
|
2
|
+
// DO NOT EDIT MANUALLY - Changes will be overwritten
|
|
3
|
+
// Schema version: 1.0.0
|
|
4
|
+
|
|
5
|
+
import type { VoltraBaseProps } from '../baseProps'
|
|
6
|
+
|
|
7
|
+
export type AndroidOutlineButtonProps = VoltraBaseProps & {
|
|
8
|
+
/** Text to display */
|
|
9
|
+
text: string
|
|
10
|
+
/** Whether the button is enabled */
|
|
11
|
+
enabled?: boolean
|
|
12
|
+
/** Optional icon */
|
|
13
|
+
icon?: Record<string, any>
|
|
14
|
+
/** Text/icon color */
|
|
15
|
+
contentColor?: string
|
|
16
|
+
/** Maximum lines for text */
|
|
17
|
+
maxLines?: number
|
|
18
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
// 🤖 AUTO-GENERATED from data/components.json
|
|
2
|
+
// DO NOT EDIT MANUALLY - Changes will be overwritten
|
|
3
|
+
// Schema version: 1.0.0
|
|
4
|
+
|
|
5
|
+
import type { VoltraBaseProps } from '../baseProps'
|
|
6
|
+
|
|
7
|
+
export type AndroidRadioButtonProps = VoltraBaseProps & {
|
|
8
|
+
/** Unique identifier for interaction events */
|
|
9
|
+
id: string
|
|
10
|
+
/** Initial checked state */
|
|
11
|
+
checked?: boolean
|
|
12
|
+
/** Whether the radio button is enabled */
|
|
13
|
+
enabled?: boolean
|
|
14
|
+
/** Text label */
|
|
15
|
+
text?: string
|
|
16
|
+
/** Checked color */
|
|
17
|
+
checkedColor?: string
|
|
18
|
+
/** Unchecked color */
|
|
19
|
+
uncheckedColor?: string
|
|
20
|
+
/** Maximum lines for text */
|
|
21
|
+
maxLines?: number
|
|
22
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// 🤖 AUTO-GENERATED from data/components.json
|
|
2
|
+
// DO NOT EDIT MANUALLY - Changes will be overwritten
|
|
3
|
+
// Schema version: 1.0.0
|
|
4
|
+
|
|
5
|
+
import type { VoltraBaseProps } from '../baseProps'
|
|
6
|
+
|
|
7
|
+
export type AndroidRowProps = VoltraBaseProps & {
|
|
8
|
+
/** Horizontal alignment of children */
|
|
9
|
+
horizontalAlignment?: 'start' | 'center-horizontally' | 'end'
|
|
10
|
+
/** Vertical alignment of children */
|
|
11
|
+
verticalAlignment?: 'top' | 'center-vertically' | 'bottom'
|
|
12
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// 🤖 AUTO-GENERATED from data/components.json
|
|
2
|
+
// DO NOT EDIT MANUALLY - Changes will be overwritten
|
|
3
|
+
// Schema version: 1.0.0
|
|
4
|
+
|
|
5
|
+
import type { VoltraBaseProps } from '../baseProps'
|
|
6
|
+
|
|
7
|
+
export type AndroidScaffoldProps = VoltraBaseProps & {
|
|
8
|
+
/** Background color */
|
|
9
|
+
backgroundColor?: string
|
|
10
|
+
/** Horizontal padding */
|
|
11
|
+
horizontalPadding?: number
|
|
12
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// 🤖 AUTO-GENERATED from data/components.json
|
|
2
|
+
// DO NOT EDIT MANUALLY - Changes will be overwritten
|
|
3
|
+
// Schema version: 1.0.0
|
|
4
|
+
|
|
5
|
+
import type { VoltraBaseProps } from '../baseProps'
|
|
6
|
+
|
|
7
|
+
export type AndroidSquareIconButtonProps = VoltraBaseProps & {
|
|
8
|
+
/** Icon source */
|
|
9
|
+
icon: Record<string, any>
|
|
10
|
+
/** Accessibility description */
|
|
11
|
+
contentDescription?: string
|
|
12
|
+
/** Whether the button is enabled */
|
|
13
|
+
enabled?: boolean
|
|
14
|
+
/** Background color */
|
|
15
|
+
backgroundColor?: string
|
|
16
|
+
/** Icon color */
|
|
17
|
+
contentColor?: string
|
|
18
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
// 🤖 AUTO-GENERATED from data/components.json
|
|
2
|
+
// DO NOT EDIT MANUALLY - Changes will be overwritten
|
|
3
|
+
// Schema version: 1.0.0
|
|
4
|
+
|
|
5
|
+
import type { VoltraBaseProps } from '../baseProps'
|
|
6
|
+
|
|
7
|
+
export type AndroidSwitchProps = VoltraBaseProps & {
|
|
8
|
+
/** Unique identifier for interaction events */
|
|
9
|
+
id: string
|
|
10
|
+
/** Initial checked state */
|
|
11
|
+
checked?: boolean
|
|
12
|
+
/** Text label */
|
|
13
|
+
text?: string
|
|
14
|
+
/** Checked thumb color */
|
|
15
|
+
thumbCheckedColor?: string
|
|
16
|
+
/** Unchecked thumb color */
|
|
17
|
+
thumbUncheckedColor?: string
|
|
18
|
+
/** Checked track color */
|
|
19
|
+
trackCheckedColor?: string
|
|
20
|
+
/** Unchecked track color */
|
|
21
|
+
trackUncheckedColor?: string
|
|
22
|
+
/** Maximum lines for text */
|
|
23
|
+
maxLines?: number
|
|
24
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// 🤖 AUTO-GENERATED from data/components.json
|
|
2
|
+
// DO NOT EDIT MANUALLY - Changes will be overwritten
|
|
3
|
+
// Schema version: 1.0.0
|
|
4
|
+
|
|
5
|
+
import type { VoltraBaseProps } from '../baseProps'
|
|
6
|
+
|
|
7
|
+
export type AndroidTextProps = VoltraBaseProps & {
|
|
8
|
+
/** Text color */
|
|
9
|
+
color?: string
|
|
10
|
+
/** Font size */
|
|
11
|
+
fontSize?: number
|
|
12
|
+
/** Maximum lines */
|
|
13
|
+
maxLines?: number
|
|
14
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// 🤖 AUTO-GENERATED from data/components.json
|
|
2
|
+
// DO NOT EDIT MANUALLY - Changes will be overwritten
|
|
3
|
+
// Schema version: 1.0.0
|
|
4
|
+
|
|
5
|
+
import type { VoltraBaseProps } from '../baseProps'
|
|
6
|
+
|
|
7
|
+
export type AndroidTitleBarProps = VoltraBaseProps & {
|
|
8
|
+
/** Title text */
|
|
9
|
+
title: string
|
|
10
|
+
/** Leading icon */
|
|
11
|
+
startIcon: Record<string, any>
|
|
12
|
+
/** Leading icon tint color */
|
|
13
|
+
iconColor?: string
|
|
14
|
+
/** Title text color */
|
|
15
|
+
textColor?: string
|
|
16
|
+
/** Title font family */
|
|
17
|
+
fontFamily?: 'monospace' | 'serif' | 'sans-serif' | 'cursive'
|
|
18
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { getAndroidComponentId } from '../payload/component-ids.js'
|
|
2
|
+
import type { ComponentRegistry } from '../renderer/index.js'
|
|
3
|
+
import { createVoltraRenderer } from '../renderer/index.js'
|
|
4
|
+
import type { AndroidLiveUpdateJson, AndroidLiveUpdateVariants } from './types.js'
|
|
5
|
+
|
|
6
|
+
const androidComponentRegistry: ComponentRegistry = {
|
|
7
|
+
getComponentId: (name: string) => getAndroidComponentId(name),
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export const renderAndroidLiveUpdateToJson = (variants: AndroidLiveUpdateVariants): AndroidLiveUpdateJson => {
|
|
11
|
+
const renderer = createVoltraRenderer(androidComponentRegistry)
|
|
12
|
+
|
|
13
|
+
if (variants.collapsed) {
|
|
14
|
+
renderer.addRootNode('collapsed', variants.collapsed)
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
if (variants.expanded) {
|
|
18
|
+
renderer.addRootNode('expanded', variants.expanded)
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
const result = renderer.render() as AndroidLiveUpdateJson
|
|
22
|
+
|
|
23
|
+
if (variants.smallIcon) {
|
|
24
|
+
result.smallIcon = variants.smallIcon
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
if (variants.channelId) {
|
|
28
|
+
result.channelId = variants.channelId
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
return result
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export const renderAndroidLiveUpdateToString = (variants: AndroidLiveUpdateVariants): string => {
|
|
35
|
+
return JSON.stringify(renderAndroidLiveUpdateToJson(variants))
|
|
36
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { ReactNode } from 'react'
|
|
2
|
+
|
|
3
|
+
import type { VoltraNodeJson } from '../types.js'
|
|
4
|
+
|
|
5
|
+
export type AndroidLiveUpdateVariants = {
|
|
6
|
+
collapsed?: ReactNode
|
|
7
|
+
expanded?: ReactNode
|
|
8
|
+
smallIcon?: string
|
|
9
|
+
channelId?: string
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export type AndroidLiveUpdateVariantsJson = {
|
|
13
|
+
v: number
|
|
14
|
+
s?: Record<string, unknown>[]
|
|
15
|
+
e?: VoltraNodeJson[]
|
|
16
|
+
collapsed?: VoltraNodeJson
|
|
17
|
+
expanded?: VoltraNodeJson
|
|
18
|
+
smallIcon?: string
|
|
19
|
+
channelId?: string
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export type AndroidLiveUpdateJson = AndroidLiveUpdateVariantsJson
|
|
23
|
+
|
|
24
|
+
export type StartAndroidLiveUpdateOptions = {
|
|
25
|
+
updateName?: string
|
|
26
|
+
channelId?: string
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export type UpdateAndroidLiveUpdateOptions = {
|
|
30
|
+
// Currently no additional options, but keeping for future extensibility
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export type UseAndroidLiveUpdateOptions = {
|
|
34
|
+
updateName?: string
|
|
35
|
+
autoStart?: boolean
|
|
36
|
+
autoUpdate?: boolean
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export type UseAndroidLiveUpdateResult = {
|
|
40
|
+
start: (options?: StartAndroidLiveUpdateOptions) => Promise<void>
|
|
41
|
+
update: (options?: UpdateAndroidLiveUpdateOptions) => Promise<void>
|
|
42
|
+
end: () => Promise<void>
|
|
43
|
+
isActive: boolean
|
|
44
|
+
}
|