@use-voltra/android 1.3.0 → 1.4.0-rc.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/build/cjs/dynamic-colors.js +33 -0
- package/build/cjs/dynamic-colors.js.map +1 -0
- package/build/cjs/index.js +14 -1
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/internal.js +8 -0
- package/build/cjs/internal.js.map +1 -0
- package/build/cjs/jsx/AreaMark.js.map +1 -1
- package/build/cjs/jsx/BarMark.js.map +1 -1
- package/build/cjs/jsx/LineMark.js.map +1 -1
- package/build/cjs/jsx/PointMark.js.map +1 -1
- package/build/cjs/jsx/RuleMark.js.map +1 -1
- package/build/cjs/jsx/SectorMark.js.map +1 -1
- package/build/cjs/live-update/renderer.js +0 -15
- package/build/cjs/live-update/renderer.js.map +1 -1
- package/build/cjs/ongoing-notification/components.js +19 -0
- package/build/cjs/ongoing-notification/components.js.map +1 -0
- package/build/cjs/ongoing-notification/renderer.js +262 -0
- package/build/cjs/ongoing-notification/renderer.js.map +1 -0
- package/build/cjs/ongoing-notification/types.js +3 -0
- package/build/cjs/ongoing-notification/types.js.map +1 -0
- package/build/cjs/payload/component-ids.js +1 -0
- package/build/cjs/payload/component-ids.js.map +1 -1
- package/build/cjs/server.js +6 -3
- package/build/cjs/server.js.map +1 -1
- package/build/cjs/utils/index.js +0 -16
- package/build/cjs/utils/index.js.map +1 -1
- package/build/cjs/widgets/renderer.js +19 -5
- package/build/cjs/widgets/renderer.js.map +1 -1
- package/build/esm/dynamic-colors.js +30 -0
- package/build/esm/dynamic-colors.js.map +1 -0
- package/build/esm/index.js +5 -0
- package/build/esm/index.js.map +1 -1
- package/build/esm/internal.js +2 -0
- package/build/esm/internal.js.map +1 -0
- package/build/esm/jsx/AreaMark.js.map +1 -1
- package/build/esm/jsx/BarMark.js.map +1 -1
- package/build/esm/jsx/LineMark.js.map +1 -1
- package/build/esm/jsx/PointMark.js.map +1 -1
- package/build/esm/jsx/RuleMark.js.map +1 -1
- package/build/esm/jsx/SectorMark.js.map +1 -1
- package/build/esm/live-update/renderer.js +0 -15
- package/build/esm/live-update/renderer.js.map +1 -1
- package/build/esm/ongoing-notification/components.js +16 -0
- package/build/esm/ongoing-notification/components.js.map +1 -0
- package/build/esm/ongoing-notification/renderer.js +256 -0
- package/build/esm/ongoing-notification/renderer.js.map +1 -0
- package/build/esm/ongoing-notification/types.js +2 -0
- package/build/esm/ongoing-notification/types.js.map +1 -0
- package/build/esm/payload/component-ids.js +1 -0
- package/build/esm/payload/component-ids.js.map +1 -1
- package/build/esm/server.js +2 -1
- package/build/esm/server.js.map +1 -1
- package/build/esm/utils/index.js +1 -1
- package/build/esm/utils/index.js.map +1 -1
- package/build/esm/widgets/renderer.js +17 -4
- package/build/esm/widgets/renderer.js.map +1 -1
- package/build/types/dynamic-colors.d.ts +33 -0
- package/build/types/dynamic-colors.d.ts.map +1 -0
- package/build/types/index.d.ts +10 -0
- package/build/types/index.d.ts.map +1 -1
- package/build/types/internal.d.ts +3 -0
- package/build/types/internal.d.ts.map +1 -0
- package/build/types/jsx/AreaMark.d.ts +2 -1
- package/build/types/jsx/AreaMark.d.ts.map +1 -1
- package/build/types/jsx/BarMark.d.ts +2 -1
- package/build/types/jsx/BarMark.d.ts.map +1 -1
- package/build/types/jsx/LineMark.d.ts +2 -1
- package/build/types/jsx/LineMark.d.ts.map +1 -1
- package/build/types/jsx/PointMark.d.ts +2 -1
- package/build/types/jsx/PointMark.d.ts.map +1 -1
- package/build/types/jsx/RuleMark.d.ts +2 -1
- package/build/types/jsx/RuleMark.d.ts.map +1 -1
- package/build/types/jsx/SectorMark.d.ts +2 -1
- package/build/types/jsx/SectorMark.d.ts.map +1 -1
- package/build/types/jsx/props/CheckBox.d.ts +3 -2
- package/build/types/jsx/props/CheckBox.d.ts.map +1 -1
- package/build/types/jsx/props/CircleIconButton.d.ts +3 -2
- package/build/types/jsx/props/CircleIconButton.d.ts.map +1 -1
- package/build/types/jsx/props/CircularProgressIndicator.d.ts +2 -1
- package/build/types/jsx/props/CircularProgressIndicator.d.ts.map +1 -1
- package/build/types/jsx/props/FilledButton.d.ts +3 -2
- package/build/types/jsx/props/FilledButton.d.ts.map +1 -1
- package/build/types/jsx/props/Image.d.ts +3 -2
- package/build/types/jsx/props/Image.d.ts.map +1 -1
- package/build/types/jsx/props/LinearProgressIndicator.d.ts +3 -2
- package/build/types/jsx/props/LinearProgressIndicator.d.ts.map +1 -1
- package/build/types/jsx/props/OutlineButton.d.ts +2 -1
- package/build/types/jsx/props/OutlineButton.d.ts.map +1 -1
- package/build/types/jsx/props/RadioButton.d.ts +3 -2
- package/build/types/jsx/props/RadioButton.d.ts.map +1 -1
- package/build/types/jsx/props/Scaffold.d.ts +2 -1
- package/build/types/jsx/props/Scaffold.d.ts.map +1 -1
- package/build/types/jsx/props/SquareIconButton.d.ts +3 -2
- package/build/types/jsx/props/SquareIconButton.d.ts.map +1 -1
- package/build/types/jsx/props/Switch.d.ts +5 -4
- package/build/types/jsx/props/Switch.d.ts.map +1 -1
- package/build/types/jsx/props/TitleBar.d.ts +3 -2
- package/build/types/jsx/props/TitleBar.d.ts.map +1 -1
- package/build/types/live-update/renderer.d.ts +0 -7
- package/build/types/live-update/renderer.d.ts.map +1 -1
- package/build/types/live-update/types.d.ts +0 -65
- package/build/types/live-update/types.d.ts.map +1 -1
- package/build/types/ongoing-notification/components.d.ts +18 -0
- package/build/types/ongoing-notification/components.d.ts.map +1 -0
- package/build/types/ongoing-notification/renderer.d.ts +6 -0
- package/build/types/ongoing-notification/renderer.d.ts.map +1 -0
- package/build/types/ongoing-notification/types.d.ts +160 -0
- package/build/types/ongoing-notification/types.d.ts.map +1 -0
- package/build/types/payload/component-ids.d.ts.map +1 -1
- package/build/types/server.d.ts +4 -1
- package/build/types/server.d.ts.map +1 -1
- package/build/types/styles/types.d.ts +5 -4
- package/build/types/styles/types.d.ts.map +1 -1
- package/build/types/types.d.ts +22 -1
- package/build/types/types.d.ts.map +1 -1
- package/build/types/utils/index.d.ts +0 -1
- package/build/types/utils/index.d.ts.map +1 -1
- package/build/types/widgets/renderer.d.ts +8 -2
- package/build/types/widgets/renderer.d.ts.map +1 -1
- package/package.json +9 -11
- package/build/cjs/VoltraModule.js +0 -6
- package/build/cjs/VoltraModule.js.map +0 -1
- package/build/cjs/client.js +0 -34
- package/build/cjs/client.js.map +0 -1
- package/build/cjs/components/VoltraView.js +0 -48
- package/build/cjs/components/VoltraView.js.map +0 -1
- package/build/cjs/components/VoltraWidgetPreview.js +0 -28
- package/build/cjs/components/VoltraWidgetPreview.js.map +0 -1
- package/build/cjs/events.js +0 -35
- package/build/cjs/events.js.map +0 -1
- package/build/cjs/live-update/api.js +0 -215
- package/build/cjs/live-update/api.js.map +0 -1
- package/build/cjs/preload.js +0 -80
- package/build/cjs/preload.js.map +0 -1
- package/build/cjs/utils/useUpdateOnHMR.js +0 -27
- package/build/cjs/utils/useUpdateOnHMR.js.map +0 -1
- package/build/cjs/widgets/api.js +0 -155
- package/build/cjs/widgets/api.js.map +0 -1
- package/build/cjs/widgets/index.js +0 -12
- package/build/cjs/widgets/index.js.map +0 -1
- package/build/cjs/widgets/server-credentials.js +0 -31
- package/build/cjs/widgets/server-credentials.js.map +0 -1
- package/build/esm/VoltraModule.js +0 -4
- package/build/esm/VoltraModule.js.map +0 -1
- package/build/esm/client.js +0 -12
- package/build/esm/client.js.map +0 -1
- package/build/esm/components/VoltraView.js +0 -45
- package/build/esm/components/VoltraView.js.map +0 -1
- package/build/esm/components/VoltraWidgetPreview.js +0 -25
- package/build/esm/components/VoltraWidgetPreview.js.map +0 -1
- package/build/esm/events.js +0 -29
- package/build/esm/events.js.map +0 -1
- package/build/esm/live-update/api.js +0 -203
- package/build/esm/live-update/api.js.map +0 -1
- package/build/esm/preload.js +0 -72
- package/build/esm/preload.js.map +0 -1
- package/build/esm/utils/useUpdateOnHMR.js +0 -23
- package/build/esm/utils/useUpdateOnHMR.js.map +0 -1
- package/build/esm/widgets/api.js +0 -143
- package/build/esm/widgets/api.js.map +0 -1
- package/build/esm/widgets/index.js +0 -3
- package/build/esm/widgets/index.js.map +0 -1
- package/build/esm/widgets/server-credentials.js +0 -24
- package/build/esm/widgets/server-credentials.js.map +0 -1
- package/build/types/VoltraModule.d.ts +0 -30
- package/build/types/VoltraModule.d.ts.map +0 -1
- package/build/types/client.d.ts +0 -9
- package/build/types/client.d.ts.map +0 -1
- package/build/types/components/VoltraView.d.ts +0 -29
- package/build/types/components/VoltraView.d.ts.map +0 -1
- package/build/types/components/VoltraWidgetPreview.d.ts +0 -21
- package/build/types/components/VoltraWidgetPreview.d.ts.map +0 -1
- package/build/types/events.d.ts +0 -49
- package/build/types/events.d.ts.map +0 -1
- package/build/types/live-update/api.d.ts +0 -126
- package/build/types/live-update/api.d.ts.map +0 -1
- package/build/types/preload.d.ts +0 -45
- package/build/types/preload.d.ts.map +0 -1
- package/build/types/utils/useUpdateOnHMR.d.ts +0 -9
- package/build/types/utils/useUpdateOnHMR.d.ts.map +0 -1
- package/build/types/widgets/api.d.ts +0 -131
- package/build/types/widgets/api.d.ts.map +0 -1
- package/build/types/widgets/index.d.ts +0 -3
- package/build/types/widgets/index.d.ts.map +0 -1
- package/build/types/widgets/server-credentials.d.ts +0 -18
- package/build/types/widgets/server-credentials.d.ts.map +0 -1
package/build/types/events.d.ts
DELETED
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import type { EventSubscription } from './types.js';
|
|
2
|
-
export type BasicVoltraEvent = {
|
|
3
|
-
source: string;
|
|
4
|
-
timestamp: number;
|
|
5
|
-
};
|
|
6
|
-
export type VoltraActivityState = 'active' | 'dismissed' | 'pending' | 'stale' | 'ended' | string;
|
|
7
|
-
export type VoltraActivityTokenReceivedEvent = BasicVoltraEvent & {
|
|
8
|
-
type: 'activityTokenReceived';
|
|
9
|
-
activityName: string;
|
|
10
|
-
pushToken: string;
|
|
11
|
-
};
|
|
12
|
-
export type VoltraActivityPushToStartTokenReceivedEvent = BasicVoltraEvent & {
|
|
13
|
-
type: 'activityPushToStartTokenReceived';
|
|
14
|
-
pushToStartToken: string;
|
|
15
|
-
};
|
|
16
|
-
export type VoltraActivityUpdateEvent = BasicVoltraEvent & {
|
|
17
|
-
type: 'stateChange';
|
|
18
|
-
activityName: string;
|
|
19
|
-
activityState: VoltraActivityState;
|
|
20
|
-
};
|
|
21
|
-
export type VoltraInteractionEvent = BasicVoltraEvent & {
|
|
22
|
-
type: 'interaction';
|
|
23
|
-
identifier: string;
|
|
24
|
-
payload: string;
|
|
25
|
-
};
|
|
26
|
-
export type VoltraEventMap = {
|
|
27
|
-
activityTokenReceived: VoltraActivityTokenReceivedEvent;
|
|
28
|
-
activityPushToStartTokenReceived: VoltraActivityPushToStartTokenReceivedEvent;
|
|
29
|
-
stateChange: VoltraActivityUpdateEvent;
|
|
30
|
-
interaction: VoltraInteractionEvent;
|
|
31
|
-
};
|
|
32
|
-
/**
|
|
33
|
-
* Add a listener for Voltra events.
|
|
34
|
-
*
|
|
35
|
-
* Supported events:
|
|
36
|
-
* - `interaction`: User interactions with widgets (buttons, switches, checkboxes) (iOS only)
|
|
37
|
-
* - `stateChange`: Live Activity state changes (iOS only)
|
|
38
|
-
* - `activityTokenReceived`: Push token for Live Activity (iOS only)
|
|
39
|
-
* - `activityPushToStartTokenReceived`: Push-to-start token (iOS only)
|
|
40
|
-
*
|
|
41
|
-
* Note: On Android, interactions open the app directly (optionally via deep links)
|
|
42
|
-
* instead of emitting background events.
|
|
43
|
-
*
|
|
44
|
-
* @param event The event type to listen for
|
|
45
|
-
* @param listener Callback function to handle the event
|
|
46
|
-
* @returns EventSubscription with a remove() method to unsubscribe
|
|
47
|
-
*/
|
|
48
|
-
export declare function addVoltraListener<K extends keyof VoltraEventMap>(event: K, listener: (event: VoltraEventMap[K]) => void): EventSubscription;
|
|
49
|
-
//# sourceMappingURL=events.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../src/events.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAA;AAGnD,MAAM,MAAM,gBAAgB,GAAG;IAC7B,MAAM,EAAE,MAAM,CAAA;IACd,SAAS,EAAE,MAAM,CAAA;CAClB,CAAA;AAED,MAAM,MAAM,mBAAmB,GAAG,QAAQ,GAAG,WAAW,GAAG,SAAS,GAAG,OAAO,GAAG,OAAO,GAAG,MAAM,CAAA;AACjG,MAAM,MAAM,gCAAgC,GAAG,gBAAgB,GAAG;IAChE,IAAI,EAAE,uBAAuB,CAAA;IAC7B,YAAY,EAAE,MAAM,CAAA;IACpB,SAAS,EAAE,MAAM,CAAA;CAClB,CAAA;AACD,MAAM,MAAM,2CAA2C,GAAG,gBAAgB,GAAG;IAC3E,IAAI,EAAE,kCAAkC,CAAA;IACxC,gBAAgB,EAAE,MAAM,CAAA;CACzB,CAAA;AACD,MAAM,MAAM,yBAAyB,GAAG,gBAAgB,GAAG;IACzD,IAAI,EAAE,aAAa,CAAA;IACnB,YAAY,EAAE,MAAM,CAAA;IACpB,aAAa,EAAE,mBAAmB,CAAA;CACnC,CAAA;AAED,MAAM,MAAM,sBAAsB,GAAG,gBAAgB,GAAG;IACtD,IAAI,EAAE,aAAa,CAAA;IACnB,UAAU,EAAE,MAAM,CAAA;IAClB,OAAO,EAAE,MAAM,CAAA;CAChB,CAAA;AAMD,MAAM,MAAM,cAAc,GAAG;IAC3B,qBAAqB,EAAE,gCAAgC,CAAA;IACvD,gCAAgC,EAAE,2CAA2C,CAAA;IAC7E,WAAW,EAAE,yBAAyB,CAAA;IACtC,WAAW,EAAE,sBAAsB,CAAA;CACpC,CAAA;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,iBAAiB,CAAC,CAAC,SAAS,MAAM,cAAc,EAC9D,KAAK,EAAE,CAAC,EACR,QAAQ,EAAE,CAAC,KAAK,EAAE,cAAc,CAAC,CAAC,CAAC,KAAK,IAAI,GAC3C,iBAAiB,CAOnB"}
|
|
@@ -1,126 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|
package/build/types/preload.d.ts
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|
|
@@ -1,9 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|
|
@@ -1,131 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|
|
@@ -1,3 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/widgets/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,sBAAsB,EACtB,kBAAkB,EAClB,gBAAgB,EAChB,oBAAoB,EACpB,uBAAuB,EACvB,mBAAmB,GACpB,MAAM,UAAU,CAAA;AAGjB,YAAY,EACV,iBAAiB,EACjB,wBAAwB,EACxB,qBAAqB,EACrB,0BAA0B,EAC1B,UAAU,GACX,MAAM,YAAY,CAAA"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import type { WidgetServerCredentials } from '../types.js';
|
|
2
|
-
export type { WidgetServerCredentials } from '../types.js';
|
|
3
|
-
/**
|
|
4
|
-
* Store server credentials for Android widget server-driven updates.
|
|
5
|
-
*
|
|
6
|
-
* Credentials are stored in DataStore, which is
|
|
7
|
-
* automatically accessible by the widget's WorkManager background worker.
|
|
8
|
-
*
|
|
9
|
-
* @param credentials - The server credentials to store
|
|
10
|
-
*/
|
|
11
|
-
export declare function setWidgetServerCredentials(credentials: WidgetServerCredentials): Promise<void>;
|
|
12
|
-
/**
|
|
13
|
-
* Clear stored server credentials for Android widget updates.
|
|
14
|
-
* All widgets are automatically reloaded after clearing credentials so they
|
|
15
|
-
* revert to their default/unauthenticated state.
|
|
16
|
-
*/
|
|
17
|
-
export declare function clearWidgetServerCredentials(): Promise<void>;
|
|
18
|
-
//# sourceMappingURL=server-credentials.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"server-credentials.d.ts","sourceRoot":"","sources":["../../../src/widgets/server-credentials.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAA;AAI1D,YAAY,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAA;AAE1D;;;;;;;GAOG;AACH,wBAAsB,0BAA0B,CAAC,WAAW,EAAE,uBAAuB,GAAG,OAAO,CAAC,IAAI,CAAC,CAKpG;AAED;;;;GAIG;AACH,wBAAsB,4BAA4B,IAAI,OAAO,CAAC,IAAI,CAAC,CAElE"}
|