@use-voltra/android 2.1.1 → 2.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.
Files changed (87) hide show
  1. package/build/commonjs/index.js +6 -0
  2. package/build/commonjs/index.js.map +1 -1
  3. package/build/commonjs/jsx/ArcProgressIndicator.js +30 -0
  4. package/build/commonjs/jsx/ArcProgressIndicator.js.map +1 -0
  5. package/build/commonjs/jsx/Chart.js +11 -0
  6. package/build/commonjs/jsx/Chart.js.map +1 -1
  7. package/build/commonjs/jsx/Column.js +9 -1
  8. package/build/commonjs/jsx/Column.js.map +1 -1
  9. package/build/commonjs/jsx/Row.js +9 -1
  10. package/build/commonjs/jsx/Row.js.map +1 -1
  11. package/build/commonjs/jsx/primitives.js +11 -0
  12. package/build/commonjs/jsx/primitives.js.map +1 -1
  13. package/build/commonjs/jsx/props/AndroidArcProgressIndicator.js +6 -0
  14. package/build/commonjs/jsx/props/AndroidArcProgressIndicator.js.map +1 -0
  15. package/build/commonjs/payload/component-ids.js +4 -2
  16. package/build/commonjs/payload/component-ids.js.map +1 -1
  17. package/build/module/index.js +1 -1
  18. package/build/module/index.js.map +1 -1
  19. package/build/module/jsx/ArcProgressIndicator.js +26 -0
  20. package/build/module/jsx/ArcProgressIndicator.js.map +1 -0
  21. package/build/module/jsx/Chart.js +11 -0
  22. package/build/module/jsx/Chart.js.map +1 -1
  23. package/build/module/jsx/Column.js +9 -1
  24. package/build/module/jsx/Column.js.map +1 -1
  25. package/build/module/jsx/Row.js +9 -1
  26. package/build/module/jsx/Row.js.map +1 -1
  27. package/build/module/jsx/primitives.js +1 -0
  28. package/build/module/jsx/primitives.js.map +1 -1
  29. package/build/module/jsx/props/AndroidArcProgressIndicator.js +4 -0
  30. package/build/module/jsx/props/AndroidArcProgressIndicator.js.map +1 -0
  31. package/build/module/payload/component-ids.js +4 -2
  32. package/build/module/payload/component-ids.js.map +1 -1
  33. package/build/typescript/commonjs/index.d.ts +3 -3
  34. package/build/typescript/commonjs/index.d.ts.map +1 -1
  35. package/build/typescript/commonjs/jsx/ArcProgressIndicator.d.ts +7 -0
  36. package/build/typescript/commonjs/jsx/ArcProgressIndicator.d.ts.map +1 -0
  37. package/build/typescript/commonjs/jsx/Chart.d.ts +2 -0
  38. package/build/typescript/commonjs/jsx/Chart.d.ts.map +1 -1
  39. package/build/typescript/commonjs/jsx/Column.d.ts.map +1 -1
  40. package/build/typescript/commonjs/jsx/Row.d.ts.map +1 -1
  41. package/build/typescript/commonjs/jsx/chart-types.d.ts +4 -0
  42. package/build/typescript/commonjs/jsx/chart-types.d.ts.map +1 -1
  43. package/build/typescript/commonjs/jsx/primitives.d.ts +1 -0
  44. package/build/typescript/commonjs/jsx/primitives.d.ts.map +1 -1
  45. package/build/typescript/commonjs/jsx/props/AndroidArcProgressIndicator.d.ts +20 -0
  46. package/build/typescript/commonjs/jsx/props/AndroidArcProgressIndicator.d.ts.map +1 -0
  47. package/build/typescript/commonjs/jsx/props/AndroidChart.d.ts +2 -0
  48. package/build/typescript/commonjs/jsx/props/AndroidChart.d.ts.map +1 -1
  49. package/build/typescript/commonjs/payload/component-ids.d.ts.map +1 -1
  50. package/build/typescript/commonjs/types.d.ts +51 -0
  51. package/build/typescript/commonjs/types.d.ts.map +1 -1
  52. package/build/typescript/commonjs/widgets/types.d.ts +16 -2
  53. package/build/typescript/commonjs/widgets/types.d.ts.map +1 -1
  54. package/build/typescript/module/index.d.ts +3 -3
  55. package/build/typescript/module/index.d.ts.map +1 -1
  56. package/build/typescript/module/jsx/ArcProgressIndicator.d.ts +7 -0
  57. package/build/typescript/module/jsx/ArcProgressIndicator.d.ts.map +1 -0
  58. package/build/typescript/module/jsx/Chart.d.ts +2 -0
  59. package/build/typescript/module/jsx/Chart.d.ts.map +1 -1
  60. package/build/typescript/module/jsx/Column.d.ts.map +1 -1
  61. package/build/typescript/module/jsx/Row.d.ts.map +1 -1
  62. package/build/typescript/module/jsx/chart-types.d.ts +4 -0
  63. package/build/typescript/module/jsx/chart-types.d.ts.map +1 -1
  64. package/build/typescript/module/jsx/primitives.d.ts +1 -0
  65. package/build/typescript/module/jsx/primitives.d.ts.map +1 -1
  66. package/build/typescript/module/jsx/props/AndroidArcProgressIndicator.d.ts +20 -0
  67. package/build/typescript/module/jsx/props/AndroidArcProgressIndicator.d.ts.map +1 -0
  68. package/build/typescript/module/jsx/props/AndroidChart.d.ts +2 -0
  69. package/build/typescript/module/jsx/props/AndroidChart.d.ts.map +1 -1
  70. package/build/typescript/module/payload/component-ids.d.ts.map +1 -1
  71. package/build/typescript/module/types.d.ts +51 -0
  72. package/build/typescript/module/types.d.ts.map +1 -1
  73. package/build/typescript/module/widgets/types.d.ts +16 -2
  74. package/build/typescript/module/widgets/types.d.ts.map +1 -1
  75. package/package.json +2 -2
  76. package/src/index.ts +6 -2
  77. package/src/jsx/ArcProgressIndicator.tsx +25 -0
  78. package/src/jsx/Chart.tsx +14 -2
  79. package/src/jsx/Column.tsx +9 -1
  80. package/src/jsx/Row.tsx +9 -1
  81. package/src/jsx/chart-types.ts +1 -0
  82. package/src/jsx/primitives.ts +1 -0
  83. package/src/jsx/props/AndroidArcProgressIndicator.ts +24 -0
  84. package/src/jsx/props/AndroidChart.ts +2 -0
  85. package/src/payload/component-ids.ts +2 -0
  86. package/src/types.ts +59 -0
  87. package/src/widgets/types.ts +16 -2
@@ -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 AndroidArcProgressIndicatorProps = VoltraBaseProps & {
8
+ /** Fill fraction from 0 to 1, clamped */
9
+ progress?: number
10
+ /** Stroke color of the filled arc */
11
+ color?: string
12
+ /** Stroke color of the unfilled arc; transparent hides the track */
13
+ trackColor?: string
14
+ /** Stroke width in dp of both arcs */
15
+ strokeWidth?: number
16
+ /** Angle in degrees where the arc begins; 0 is 3 o'clock, positive is clockwise */
17
+ startAngle?: number
18
+ /** Total angular length of the track in degrees; 360 makes a closed ring */
19
+ sweepAngle?: number
20
+ /** End shape of both arcs */
21
+ lineCap?: 'round' | 'butt'
22
+ /** Sweep gradient colors along the filled arc, from startAngle; overrides color */
23
+ gradientColors?: string
24
+ }
@@ -11,6 +11,8 @@ export type AndroidChartProps = VoltraBaseProps & {
11
11
  xAxisVisibility?: 'automatic' | 'visible' | 'hidden'
12
12
  /** Show or hide the y-axis */
13
13
  yAxisVisibility?: 'automatic' | 'visible' | 'hidden'
14
+ /** Pin the y-axis lower and/or upper bound */
15
+ yScale?: Record<string, any>
14
16
  /** Show or hide the chart legend */
15
17
  legendVisibility?: 'automatic' | 'visible' | 'hidden'
16
18
  /** Map of series name to color string */
@@ -29,6 +29,7 @@ export const ANDROID_COMPONENT_NAME_TO_ID: Record<string, number> = {
29
29
  AndroidText: 18,
30
30
  AndroidTitleBar: 19,
31
31
  AndroidChart: 20,
32
+ AndroidArcProgressIndicator: 21,
32
33
  }
33
34
 
34
35
  /**
@@ -56,6 +57,7 @@ export const ANDROID_COMPONENT_ID_TO_NAME: Record<number, string> = {
56
57
  18: 'AndroidText',
57
58
  19: 'AndroidTitleBar',
58
59
  20: 'AndroidChart',
60
+ 21: 'AndroidArcProgressIndicator',
59
61
  }
60
62
 
61
63
  /**
package/src/types.ts CHANGED
@@ -32,7 +32,66 @@ export type PreloadImagesResult = {
32
32
  failed: PreloadImageFailure[]
33
33
  }
34
34
 
35
+ /**
36
+ * @deprecated Use `setWidgetServerUpdate` with an `Authorization` header instead. These are
37
+ * stored in the same place and keep the same replace-the-whole-set semantics.
38
+ */
35
39
  export type WidgetServerCredentials = {
36
40
  token: string
37
41
  headers?: Record<string, string>
38
42
  }
43
+
44
+ /**
45
+ * Runtime overrides for a widget's `serverUpdate` settings — the twin of the `serverUpdate` key
46
+ * in app.json, which supplies the defaults.
47
+ *
48
+ * Every field is optional and replaces the app.json value when set. `headers` and `query` merge
49
+ * per key across layers; everything else takes the value from the most specific layer that sets
50
+ * it. Passing settings without a `widgetId` sets them for every server-driven widget.
51
+ */
52
+ export type WidgetServerUpdateSettings = {
53
+ /** Endpoint to fetch from. Must be https, or http to a local dev host in a debug build. */
54
+ url?: string
55
+ /** How often to fetch, in minutes. Clamped to at least 15 and at most 24 hours. */
56
+ intervalMinutes?: number
57
+ /** Set false to stop fetching and drive the widget from the app instead. Defaults to true. */
58
+ enabled?: boolean
59
+ /** HTTP method. Defaults to GET. A body is dropped on GET and HEAD, with a warning. */
60
+ method?: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE'
61
+ /** Extra query parameters. Voltra's own keys are reserved and rejected. */
62
+ query?: Record<string, string>
63
+ /** Extra request headers, for example `Authorization`. */
64
+ headers?: Record<string, string>
65
+ /** Request body, sent as `application/json`. */
66
+ body?: WidgetServerUpdateBody
67
+ }
68
+
69
+ /** A JSON value, as accepted for a server-update request body. */
70
+ export type WidgetServerUpdateBody =
71
+ | string
72
+ | number
73
+ | boolean
74
+ | null
75
+ | WidgetServerUpdateBody[]
76
+ | { [key: string]: WidgetServerUpdateBody }
77
+
78
+ /** Options selecting which widget a settings call applies to. */
79
+ export type WidgetServerUpdateOptions = {
80
+ /** Widget id to scope the settings to. Omit to set them for every server-driven widget. */
81
+ widgetId?: string
82
+ }
83
+
84
+ /**
85
+ * Fully resolved settings for one widget: every layer flattened and app.json's defaults applied,
86
+ * exactly what it would fetch with right now.
87
+ */
88
+ export type WidgetServerUpdateSnapshot = {
89
+ /** Absent when the widget is server-driven but has no URL yet. */
90
+ url?: string
91
+ intervalMinutes: number
92
+ enabled: boolean
93
+ method: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE'
94
+ query: Record<string, string>
95
+ headers: Record<string, string>
96
+ body?: WidgetServerUpdateBody
97
+ }
@@ -21,9 +21,23 @@ export type AndroidWidgetSizeVariant = {
21
21
  * Information about an active widget instance on Android
22
22
  */
23
23
  export type WidgetInfo = {
24
- /** The name (ID) of the widget as defined in the config plugin */
24
+ /** The Voltra widget id, as defined in the config plugin (e.g. `"weather"`) */
25
+ widgetType: string
26
+ /**
27
+ * The Android instance id of this placement. Every placed widget has its own, so the same
28
+ * widget placed twice appears twice with different `appWidgetId`s. Pass it to the per-instance
29
+ * configuration APIs to give one placement its own values.
30
+ */
31
+ appWidgetId: number
32
+ /**
33
+ * @deprecated Renamed to `widgetType`, which says what this field holds. Same value.
34
+ */
25
35
  name: string
26
- /** The unique ID for this widget instance (required for updates) */
36
+ /**
37
+ * @deprecated Renamed to `appWidgetId`, which says what this field holds — it is the Android
38
+ * instance id, not the Voltra widget id that `widgetId` names everywhere else in this package.
39
+ * Same value.
40
+ */
27
41
  widgetId: number
28
42
  /** The class name of the provider (e.g., ".WeatherWidget") */
29
43
  providerClassName: string