@use-voltra/ios 1.3.1 → 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/index.js +9 -1
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/payload/component-ids.js +1 -0
- package/build/cjs/payload/component-ids.js.map +1 -1
- package/build/cjs/widgets/renderer.js +1 -1
- package/build/cjs/widgets/renderer.js.map +1 -1
- package/build/esm/index.js +3 -0
- package/build/esm/index.js.map +1 -1
- package/build/esm/payload/component-ids.js +1 -0
- package/build/esm/payload/component-ids.js.map +1 -1
- package/build/esm/widgets/renderer.js +1 -1
- package/build/esm/widgets/renderer.js.map +1 -1
- package/build/types/index.d.ts +7 -2
- package/build/types/index.d.ts.map +1 -1
- package/build/types/payload/component-ids.d.ts.map +1 -1
- package/build/types/styles/index.d.ts +1 -1
- package/build/types/styles/index.d.ts.map +1 -1
- package/build/types/styles/types.d.ts +89 -1
- package/build/types/styles/types.d.ts.map +1 -1
- package/build/types/types.d.ts +25 -1
- package/build/types/types.d.ts.map +1 -1
- package/package.json +3 -11
- package/build/cjs/VoltraModule.js +0 -6
- package/build/cjs/VoltraModule.js.map +0 -1
- package/build/cjs/client.js +0 -49
- package/build/cjs/client.js.map +0 -1
- package/build/cjs/components/VoltraLiveActivityPreview.js +0 -42
- package/build/cjs/components/VoltraLiveActivityPreview.js.map +0 -1
- package/build/cjs/components/VoltraView.js +0 -54
- package/build/cjs/components/VoltraView.js.map +0 -1
- package/build/cjs/components/VoltraWidgetPreview.js +0 -47
- 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/helpers.js +0 -39
- package/build/cjs/helpers.js.map +0 -1
- package/build/cjs/live-activity/api.js +0 -277
- package/build/cjs/live-activity/api.js.map +0 -1
- package/build/cjs/logger.js +0 -36
- package/build/cjs/logger.js.map +0 -1
- package/build/cjs/preload.js +0 -115
- package/build/cjs/preload.js.map +0 -1
- package/build/cjs/utils/assertRunningOnApple.js +0 -13
- package/build/cjs/utils/assertRunningOnApple.js.map +0 -1
- package/build/cjs/utils/helpers.js +0 -39
- package/build/cjs/utils/helpers.js.map +0 -1
- package/build/cjs/utils/index.js +0 -19
- package/build/cjs/utils/index.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/server-credentials.js +0 -62
- package/build/cjs/widgets/server-credentials.js.map +0 -1
- package/build/cjs/widgets/widget-api.js +0 -196
- package/build/cjs/widgets/widget-api.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 -10
- package/build/esm/client.js.map +0 -1
- package/build/esm/components/VoltraLiveActivityPreview.js +0 -39
- package/build/esm/components/VoltraLiveActivityPreview.js.map +0 -1
- package/build/esm/components/VoltraView.js +0 -51
- package/build/esm/components/VoltraView.js.map +0 -1
- package/build/esm/components/VoltraWidgetPreview.js +0 -44
- 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/helpers.js +0 -32
- package/build/esm/helpers.js.map +0 -1
- package/build/esm/live-activity/api.js +0 -265
- package/build/esm/live-activity/api.js.map +0 -1
- package/build/esm/logger.js +0 -33
- package/build/esm/logger.js.map +0 -1
- package/build/esm/preload.js +0 -107
- package/build/esm/preload.js.map +0 -1
- package/build/esm/utils/assertRunningOnApple.js +0 -9
- package/build/esm/utils/assertRunningOnApple.js.map +0 -1
- package/build/esm/utils/helpers.js +0 -32
- package/build/esm/utils/helpers.js.map +0 -1
- package/build/esm/utils/index.js +0 -3
- package/build/esm/utils/index.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/server-credentials.js +0 -55
- package/build/esm/widgets/server-credentials.js.map +0 -1
- package/build/esm/widgets/widget-api.js +0 -184
- package/build/esm/widgets/widget-api.js.map +0 -1
- package/build/types/VoltraModule.d.ts +0 -143
- package/build/types/VoltraModule.d.ts.map +0 -1
- package/build/types/client.d.ts +0 -13
- package/build/types/client.d.ts.map +0 -1
- package/build/types/components/VoltraLiveActivityPreview.d.ts +0 -28
- package/build/types/components/VoltraLiveActivityPreview.d.ts.map +0 -1
- package/build/types/components/VoltraView.d.ts +0 -43
- package/build/types/components/VoltraView.d.ts.map +0 -1
- package/build/types/components/VoltraWidgetPreview.d.ts +0 -32
- 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/helpers.d.ts +0 -12
- package/build/types/helpers.d.ts.map +0 -1
- package/build/types/live-activity/api.d.ts +0 -189
- package/build/types/live-activity/api.d.ts.map +0 -1
- package/build/types/logger.d.ts +0 -16
- package/build/types/logger.d.ts.map +0 -1
- package/build/types/preload.d.ts +0 -67
- package/build/types/preload.d.ts.map +0 -1
- package/build/types/utils/assertRunningOnApple.d.ts +0 -2
- package/build/types/utils/assertRunningOnApple.d.ts.map +0 -1
- package/build/types/utils/helpers.d.ts +0 -12
- package/build/types/utils/helpers.d.ts.map +0 -1
- package/build/types/utils/index.d.ts +0 -3
- package/build/types/utils/index.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/server-credentials.d.ts +0 -49
- package/build/types/widgets/server-credentials.d.ts.map +0 -1
- package/build/types/widgets/widget-api.d.ts +0 -146
- package/build/types/widgets/widget-api.d.ts.map +0 -1
|
@@ -1,184 +0,0 @@
|
|
|
1
|
-
import { assertRunningOnApple } from '../utils/assertRunningOnApple.js';
|
|
2
|
-
import VoltraModule from '../VoltraModule.js';
|
|
3
|
-
import { renderWidgetToString } from './renderer.js';
|
|
4
|
-
/**
|
|
5
|
-
* Update a home screen widget with new content.
|
|
6
|
-
*
|
|
7
|
-
* The content will be stored in App Group storage and the widget timeline
|
|
8
|
-
* will be reloaded to display the new content.
|
|
9
|
-
*
|
|
10
|
-
* @param widgetId - The widget identifier (as defined in your config plugin)
|
|
11
|
-
* @param variants - An object mapping widget families to specific content.
|
|
12
|
-
* Each key corresponds to a widget size family.
|
|
13
|
-
* @param options - Optional settings like deep link URL
|
|
14
|
-
*
|
|
15
|
-
* @example Different content per size
|
|
16
|
-
* ```tsx
|
|
17
|
-
* import { updateWidget, Voltra } from 'voltra'
|
|
18
|
-
*
|
|
19
|
-
* await updateWidget('weather', {
|
|
20
|
-
* systemSmall: <Voltra.Text fontSize={32}>72°F</Voltra.Text>,
|
|
21
|
-
* systemMedium: (
|
|
22
|
-
* <Voltra.HStack>
|
|
23
|
-
* <Voltra.Text fontSize={32}>72°F</Voltra.Text>
|
|
24
|
-
* <Voltra.VStack>
|
|
25
|
-
* <Voltra.Text>Sunny</Voltra.Text>
|
|
26
|
-
* <Voltra.Text>High: 78° Low: 65°</Voltra.Text>
|
|
27
|
-
* </Voltra.VStack>
|
|
28
|
-
* </Voltra.HStack>
|
|
29
|
-
* ),
|
|
30
|
-
* }, { deepLinkUrl: '/weather' })
|
|
31
|
-
* ```
|
|
32
|
-
*/
|
|
33
|
-
export const updateWidget = async (widgetId, variants, options) => {
|
|
34
|
-
if (!assertRunningOnApple())
|
|
35
|
-
return Promise.resolve();
|
|
36
|
-
const payload = renderWidgetToString(variants);
|
|
37
|
-
return VoltraModule.updateWidget(widgetId, payload, {
|
|
38
|
-
deepLinkUrl: options?.deepLinkUrl,
|
|
39
|
-
});
|
|
40
|
-
};
|
|
41
|
-
/**
|
|
42
|
-
* Reload widget timelines to refresh their content.
|
|
43
|
-
*
|
|
44
|
-
* Use this after updating data that widgets depend on (e.g., after preloading
|
|
45
|
-
* new images) to force them to re-render.
|
|
46
|
-
*
|
|
47
|
-
* @param widgetIds - Optional array of widget IDs to reload. If omitted, reloads all widgets.
|
|
48
|
-
*
|
|
49
|
-
* @example
|
|
50
|
-
* ```typescript
|
|
51
|
-
* // Reload specific widgets
|
|
52
|
-
* await reloadWidgets(['weather', 'calendar'])
|
|
53
|
-
*
|
|
54
|
-
* // Reload all widgets
|
|
55
|
-
* await reloadWidgets()
|
|
56
|
-
* ```
|
|
57
|
-
*/
|
|
58
|
-
export const reloadWidgets = async (widgetIds) => {
|
|
59
|
-
if (!assertRunningOnApple())
|
|
60
|
-
return Promise.resolve();
|
|
61
|
-
return VoltraModule.reloadWidgets(widgetIds ?? null);
|
|
62
|
-
};
|
|
63
|
-
/**
|
|
64
|
-
* Clear a widget's stored data.
|
|
65
|
-
*
|
|
66
|
-
* This removes the JSON content and deep link URL for the specified widget,
|
|
67
|
-
* causing it to show its placeholder state.
|
|
68
|
-
*
|
|
69
|
-
* @param widgetId - The widget identifier to clear
|
|
70
|
-
*
|
|
71
|
-
* @example
|
|
72
|
-
* ```typescript
|
|
73
|
-
* await clearWidget('weather')
|
|
74
|
-
* ```
|
|
75
|
-
*/
|
|
76
|
-
export const clearWidget = async (widgetId) => {
|
|
77
|
-
if (!assertRunningOnApple())
|
|
78
|
-
return Promise.resolve();
|
|
79
|
-
return VoltraModule.clearWidget(widgetId);
|
|
80
|
-
};
|
|
81
|
-
/**
|
|
82
|
-
* Clear all widgets' stored data.
|
|
83
|
-
*
|
|
84
|
-
* This removes the JSON content and deep link URLs for all configured widgets,
|
|
85
|
-
* causing them to show their placeholder states.
|
|
86
|
-
*
|
|
87
|
-
* @example
|
|
88
|
-
* ```typescript
|
|
89
|
-
* await clearAllWidgets()
|
|
90
|
-
* ```
|
|
91
|
-
*/
|
|
92
|
-
export const clearAllWidgets = async () => {
|
|
93
|
-
if (!assertRunningOnApple())
|
|
94
|
-
return Promise.resolve();
|
|
95
|
-
return VoltraModule.clearAllWidgets();
|
|
96
|
-
};
|
|
97
|
-
/**
|
|
98
|
-
* Schedule a widget timeline with multiple entries to be displayed at future times.
|
|
99
|
-
*
|
|
100
|
-
* iOS will automatically display each entry at its scheduled time, even when your
|
|
101
|
-
* app is not running. This allows you to batch widget updates in advance.
|
|
102
|
-
*
|
|
103
|
-
* @param widgetId - The widget identifier (as defined in your config plugin)
|
|
104
|
-
* @param entries - Array of scheduled entries, each with a date and content variants
|
|
105
|
-
* @param options - Optional settings like reload policy
|
|
106
|
-
*
|
|
107
|
-
* @example Schedule weather updates throughout the day
|
|
108
|
-
* ```tsx
|
|
109
|
-
* import { scheduleWidget, Voltra } from 'voltra'
|
|
110
|
-
*
|
|
111
|
-
* await scheduleWidget('weather', [
|
|
112
|
-
* {
|
|
113
|
-
* date: new Date('2026-01-16T09:00:00'),
|
|
114
|
-
* variants: {
|
|
115
|
-
* systemSmall: <Voltra.Text>Morning: 65°F</Voltra.Text>
|
|
116
|
-
* }
|
|
117
|
-
* },
|
|
118
|
-
* {
|
|
119
|
-
* date: new Date('2026-01-16T15:00:00'),
|
|
120
|
-
* variants: {
|
|
121
|
-
* systemSmall: <Voltra.Text>Afternoon: 72°F</Voltra.Text>
|
|
122
|
-
* }
|
|
123
|
-
* },
|
|
124
|
-
* {
|
|
125
|
-
* date: new Date('2026-01-16T21:00:00'),
|
|
126
|
-
* variants: {
|
|
127
|
-
* systemSmall: <Voltra.Text>Evening: 68°F</Voltra.Text>
|
|
128
|
-
* }
|
|
129
|
-
* }
|
|
130
|
-
* ], {
|
|
131
|
-
* policy: { type: 'atEnd' } // Request new timeline when last entry expires
|
|
132
|
-
* })
|
|
133
|
-
* ```
|
|
134
|
-
*
|
|
135
|
-
* @example With deep links per entry
|
|
136
|
-
* ```tsx
|
|
137
|
-
* await scheduleWidget('news', [
|
|
138
|
-
* {
|
|
139
|
-
* date: new Date('2026-01-16T08:00:00'),
|
|
140
|
-
* variants: { systemSmall: <Voltra.Text>Morning News</Voltra.Text> },
|
|
141
|
-
* deepLinkUrl: '/news/morning'
|
|
142
|
-
* },
|
|
143
|
-
* {
|
|
144
|
-
* date: new Date('2026-01-16T20:00:00'),
|
|
145
|
-
* variants: { systemSmall: <Voltra.Text>Evening News</Voltra.Text> },
|
|
146
|
-
* deepLinkUrl: '/news/evening'
|
|
147
|
-
* }
|
|
148
|
-
* ])
|
|
149
|
-
* ```
|
|
150
|
-
*/
|
|
151
|
-
export const scheduleWidget = async (widgetId, entries) => {
|
|
152
|
-
if (!assertRunningOnApple())
|
|
153
|
-
return Promise.resolve();
|
|
154
|
-
// Render each entry's variants to JSON
|
|
155
|
-
const renderedEntries = entries.map((entry) => ({
|
|
156
|
-
date: entry.date.getTime(), // Convert to milliseconds timestamp
|
|
157
|
-
json: renderWidgetToString(entry.variants),
|
|
158
|
-
deepLinkUrl: entry.deepLinkUrl,
|
|
159
|
-
}));
|
|
160
|
-
// Prepare timeline data (always use 'never' policy since widget extension can't regenerate content)
|
|
161
|
-
const timelineData = {
|
|
162
|
-
entries: renderedEntries,
|
|
163
|
-
policy: { type: 'never' },
|
|
164
|
-
};
|
|
165
|
-
const timelineJson = JSON.stringify(timelineData);
|
|
166
|
-
return VoltraModule.scheduleWidget(widgetId, timelineJson);
|
|
167
|
-
};
|
|
168
|
-
/**
|
|
169
|
-
* Fetches all active widget configurations for the containing app on iOS.
|
|
170
|
-
*
|
|
171
|
-
* @returns A promise that resolves to an array of active widget configurations.
|
|
172
|
-
*
|
|
173
|
-
* @example
|
|
174
|
-
* ```typescript
|
|
175
|
-
* const widgets = await getActiveWidgets()
|
|
176
|
-
* console.log('Active widgets:', widgets)
|
|
177
|
-
* ```
|
|
178
|
-
*/
|
|
179
|
-
export const getActiveWidgets = async () => {
|
|
180
|
-
if (!assertRunningOnApple())
|
|
181
|
-
return [];
|
|
182
|
-
return VoltraModule.getActiveWidgets();
|
|
183
|
-
};
|
|
184
|
-
//# sourceMappingURL=widget-api.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"widget-api.js","sourceRoot":"","sources":["../../../src/widgets/widget-api.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AAC,eAAe,EAAE,CAAA;AACvC,CAAC,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqDG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,KAAK,EAAE,QAAgB,EAAE,OAA+B,EAAiB,EAAE;IACvG,IAAI,CAAC,oBAAoB,EAAE;QAAE,OAAO,OAAO,CAAC,OAAO,EAAE,CAAA;IAErD,uCAAuC;IACvC,MAAM,eAAe,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;QAC9C,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,oCAAoC;QAChE,IAAI,EAAE,oBAAoB,CAAC,KAAK,CAAC,QAAQ,CAAC;QAC1C,WAAW,EAAE,KAAK,CAAC,WAAW;KAC/B,CAAC,CAAC,CAAA;IAEH,oGAAoG;IACpG,MAAM,YAAY,GAAG;QACnB,OAAO,EAAE,eAAe;QACxB,MAAM,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE;KAC1B,CAAA;IAED,MAAM,YAAY,GAAG,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,CAAA;IAEjD,OAAO,YAAY,CAAC,cAAc,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAA;AAC5D,CAAC,CAAA;AAED;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,KAAK,IAA2B,EAAE;IAChE,IAAI,CAAC,oBAAoB,EAAE;QAAE,OAAO,EAAE,CAAA;IAEtC,OAAO,YAAY,CAAC,gBAAgB,EAAE,CAAA;AACxC,CAAC,CAAA"}
|
|
@@ -1,143 +0,0 @@
|
|
|
1
|
-
import type { EventSubscription, PreloadImageOptions, PreloadImagesResult, UpdateWidgetOptions, WidgetServerCredentials } from './types.js';
|
|
2
|
-
/**
|
|
3
|
-
* Options for starting a Live Activity
|
|
4
|
-
*/
|
|
5
|
-
export type StartVoltraOptions = {
|
|
6
|
-
/**
|
|
7
|
-
* Target type for the activity (used internally)
|
|
8
|
-
*/
|
|
9
|
-
target?: string;
|
|
10
|
-
/**
|
|
11
|
-
* URL to open when the Live Activity is tapped.
|
|
12
|
-
*/
|
|
13
|
-
deepLinkUrl?: string;
|
|
14
|
-
/**
|
|
15
|
-
* The ID/name of the Live Activity.
|
|
16
|
-
* Allows you to rebind to the same activity on app restart.
|
|
17
|
-
*/
|
|
18
|
-
activityId?: string;
|
|
19
|
-
/**
|
|
20
|
-
* Unix timestamp in milliseconds
|
|
21
|
-
*/
|
|
22
|
-
staleDate?: number;
|
|
23
|
-
/**
|
|
24
|
-
* Double value between 0.0 and 1.0, defaults to 0.0
|
|
25
|
-
*/
|
|
26
|
-
relevanceScore?: number;
|
|
27
|
-
/**
|
|
28
|
-
* Channel ID for broadcast push notifications (iOS 18+).
|
|
29
|
-
* When provided, the Live Activity subscribes to broadcast updates on this channel.
|
|
30
|
-
*/
|
|
31
|
-
channelId?: string;
|
|
32
|
-
};
|
|
33
|
-
/**
|
|
34
|
-
* Options for updating a Live Activity
|
|
35
|
-
*/
|
|
36
|
-
export type UpdateVoltraOptions = {
|
|
37
|
-
/**
|
|
38
|
-
* Unix timestamp in milliseconds
|
|
39
|
-
*/
|
|
40
|
-
staleDate?: number;
|
|
41
|
-
/**
|
|
42
|
-
* Double value between 0.0 and 1.0, defaults to 0.0
|
|
43
|
-
*/
|
|
44
|
-
relevanceScore?: number;
|
|
45
|
-
};
|
|
46
|
-
/**
|
|
47
|
-
* Options for ending a Live Activity
|
|
48
|
-
*/
|
|
49
|
-
export type EndVoltraOptions = {
|
|
50
|
-
dismissalPolicy?: {
|
|
51
|
-
type: 'immediate' | 'after';
|
|
52
|
-
date?: number;
|
|
53
|
-
};
|
|
54
|
-
};
|
|
55
|
-
/**
|
|
56
|
-
* Voltra iOS native module interface
|
|
57
|
-
*/
|
|
58
|
-
export interface VoltraIOSModuleSpec {
|
|
59
|
-
/**
|
|
60
|
-
* Start a new Live Activity
|
|
61
|
-
*/
|
|
62
|
-
startLiveActivity(jsonString: string, options?: StartVoltraOptions): Promise<string>;
|
|
63
|
-
/**
|
|
64
|
-
* Update an existing Live Activity
|
|
65
|
-
*/
|
|
66
|
-
updateLiveActivity(activityId: string, jsonString: string, options?: UpdateVoltraOptions): Promise<void>;
|
|
67
|
-
/**
|
|
68
|
-
* End a Live Activity
|
|
69
|
-
*/
|
|
70
|
-
endLiveActivity(activityId: string, options?: EndVoltraOptions): Promise<void>;
|
|
71
|
-
/**
|
|
72
|
-
* End all active Live Activities
|
|
73
|
-
*/
|
|
74
|
-
endAllLiveActivities(): Promise<void>;
|
|
75
|
-
/**
|
|
76
|
-
* Get the latest (most recently created) Voltra Live Activity ID, if any
|
|
77
|
-
*/
|
|
78
|
-
getLatestVoltraActivityId(): Promise<string | null>;
|
|
79
|
-
/**
|
|
80
|
-
* List all running Voltra Live Activity IDs
|
|
81
|
-
*/
|
|
82
|
-
listVoltraActivityIds(): Promise<string[]>;
|
|
83
|
-
/**
|
|
84
|
-
* Check if a Live Activity with the given name is currently active
|
|
85
|
-
*/
|
|
86
|
-
isLiveActivityActive(activityName: string): boolean;
|
|
87
|
-
/**
|
|
88
|
-
* Check if the app was launched in the background (headless)
|
|
89
|
-
*/
|
|
90
|
-
isHeadless(): boolean;
|
|
91
|
-
/**
|
|
92
|
-
* Preload images to App Group storage for use in Live Activities
|
|
93
|
-
*/
|
|
94
|
-
preloadImages(images: PreloadImageOptions[]): Promise<PreloadImagesResult>;
|
|
95
|
-
/**
|
|
96
|
-
* Reload Live Activities to pick up preloaded images
|
|
97
|
-
*/
|
|
98
|
-
reloadLiveActivities(activityNames?: string[] | null): Promise<void>;
|
|
99
|
-
/**
|
|
100
|
-
* Clear preloaded images from App Group storage
|
|
101
|
-
*/
|
|
102
|
-
clearPreloadedImages(keys?: string[] | null): Promise<void>;
|
|
103
|
-
/**
|
|
104
|
-
* Update a home screen widget with new content
|
|
105
|
-
*/
|
|
106
|
-
updateWidget(widgetId: string, jsonString: string, options?: UpdateWidgetOptions): Promise<void>;
|
|
107
|
-
/**
|
|
108
|
-
* Schedule a widget timeline with multiple entries to be displayed at future times
|
|
109
|
-
*/
|
|
110
|
-
scheduleWidget(widgetId: string, timelineJson: string): Promise<void>;
|
|
111
|
-
/**
|
|
112
|
-
* Reload widget timelines to refresh their content
|
|
113
|
-
*/
|
|
114
|
-
reloadWidgets(widgetIds?: string[] | null): Promise<void>;
|
|
115
|
-
/**
|
|
116
|
-
* Clear a widget's stored data
|
|
117
|
-
*/
|
|
118
|
-
clearWidget(widgetId: string): Promise<void>;
|
|
119
|
-
/**
|
|
120
|
-
* Clear all widgets' stored data
|
|
121
|
-
*/
|
|
122
|
-
clearAllWidgets(): Promise<void>;
|
|
123
|
-
/**
|
|
124
|
-
* Fetches all active widget configurations/instances
|
|
125
|
-
*/
|
|
126
|
-
getActiveWidgets<T = any>(): Promise<T[]>;
|
|
127
|
-
/**
|
|
128
|
-
* Set server credentials for widget server-driven updates.
|
|
129
|
-
* Stored securely in Keychain.
|
|
130
|
-
*/
|
|
131
|
-
setWidgetServerCredentials(credentials: WidgetServerCredentials): Promise<void>;
|
|
132
|
-
/**
|
|
133
|
-
* Clear server credentials for widget server-driven updates.
|
|
134
|
-
*/
|
|
135
|
-
clearWidgetServerCredentials(): Promise<void>;
|
|
136
|
-
/**
|
|
137
|
-
* Add an event listener
|
|
138
|
-
*/
|
|
139
|
-
addListener(event: string, listener: (event: any) => void): EventSubscription;
|
|
140
|
-
}
|
|
141
|
-
declare const VoltraModule: VoltraIOSModuleSpec;
|
|
142
|
-
export default VoltraModule;
|
|
143
|
-
//# sourceMappingURL=VoltraModule.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"VoltraModule.d.ts","sourceRoot":"","sources":["../../src/VoltraModule.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,iBAAiB,EACjB,mBAAmB,EACnB,mBAAmB,EACnB,mBAA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;IAE/E;;OAEG;IACH,4BAA4B,IAAI,OAAO,CAAC,IAAI,CAAC,CAAA;IAE7C;;OAEG;IACH,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,IAAI,GAAG,iBAAiB,CAAA;CAC9E;AAED,QAAA,MAAM,YAAY,qBAA2D,CAAA;AAE7E,eAAe,YAAY,CAAA"}
|
package/build/types/client.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export { VoltraLiveActivityPreview, type VoltraLiveActivityPreviewProps, } from './components/VoltraLiveActivityPreview.js';
|
|
2
|
-
export { VoltraView, type VoltraViewProps } from './components/VoltraView.js';
|
|
3
|
-
export { VoltraWidgetPreview, type VoltraWidgetPreviewProps } from './components/VoltraWidgetPreview.js';
|
|
4
|
-
export * from './events.js';
|
|
5
|
-
export { isGlassSupported, isHeadless } from './helpers.js';
|
|
6
|
-
export { endAllLiveActivities, type EndLiveActivityOptions, isLiveActivityActive, type SharedLiveActivityOptions, startLiveActivity, type StartLiveActivityOptions, stopLiveActivity, updateLiveActivity, type UpdateLiveActivityOptions, useLiveActivity, type UseLiveActivityOptions, type UseLiveActivityResult, } from './live-activity/api.js';
|
|
7
|
-
export type { DismissalPolicy, LiveActivityVariants } from './live-activity/types.js';
|
|
8
|
-
export { clearPreloadedImages, type PreloadImageOptions, preloadImages, type PreloadImagesResult, reloadLiveActivities, } from './preload.js';
|
|
9
|
-
export type { VoltraElementJson, VoltraNodeJson } from './types.js';
|
|
10
|
-
export { clearWidgetServerCredentials, setWidgetServerCredentials, type WidgetServerCredentials, } from './widgets/server-credentials.js';
|
|
11
|
-
export type { WidgetFamily, WidgetInfo, WidgetVariants } from './widgets/types.js';
|
|
12
|
-
export { clearAllWidgets, clearWidget, getActiveWidgets, reloadWidgets, type ScheduledWidgetEntry, scheduleWidget, updateWidget, type UpdateWidgetOptions, } from './widgets/widget-api.js';
|
|
13
|
-
//# sourceMappingURL=client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,28 +0,0 @@
|
|
|
1
|
-
import { StyleProp, ViewStyle } from 'react-native';
|
|
2
|
-
import { VoltraViewProps } from './VoltraView.js';
|
|
3
|
-
export type VoltraLiveActivityPreviewProps = Omit<VoltraViewProps, 'style'> & {
|
|
4
|
-
/**
|
|
5
|
-
* Additional styles to apply on top of the lock screen dimensions
|
|
6
|
-
*/
|
|
7
|
-
style?: StyleProp<ViewStyle>;
|
|
8
|
-
};
|
|
9
|
-
/**
|
|
10
|
-
* A preview component that renders Voltra JSX lock screen Live Activity content
|
|
11
|
-
* at the exact dimensions of a lock screen Live Activity. Useful for testing
|
|
12
|
-
* Live Activity layouts.
|
|
13
|
-
*
|
|
14
|
-
* This component extends VoltraView but automatically sets the width and height
|
|
15
|
-
* to match the lock screen Live Activity dimensions. Live Activities cannot be
|
|
16
|
-
* fully emulated, so this provides a close approximation for development.
|
|
17
|
-
*
|
|
18
|
-
* @example
|
|
19
|
-
* ```tsx
|
|
20
|
-
* <VoltraLiveActivityPreview
|
|
21
|
-
* style={{ backgroundColor: 'lightgray' }}
|
|
22
|
-
* >
|
|
23
|
-
* <Voltra.Text>Hello Live Activity!</Voltra.Text>
|
|
24
|
-
* </VoltraLiveActivityPreview>
|
|
25
|
-
* ```
|
|
26
|
-
*/
|
|
27
|
-
export declare function VoltraLiveActivityPreview({ style, children, ...voltraViewProps }: VoltraLiveActivityPreviewProps): import("react/jsx-runtime").JSX.Element;
|
|
28
|
-
//# sourceMappingURL=VoltraLiveActivityPreview.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"VoltraLiveActivityPreview.d.ts","sourceRoot":"","sources":["../../../src/components/VoltraLiveActivityPreview.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAEnD,OAAO,EAAc,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAW7D,MAAM,MAAM,8BAA8B,GAAG,IAAI,CAAC,eAAe,EAAE,OAAO,CAAC,GAAG;IAC5E;;OAEG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAA;CAC7B,CAAA;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,yBAAyB,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,eAAe,EAAE,EAAE,8BAA8B,2CAchH"}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
import { StyleProp, ViewStyle } from 'react-native';
|
|
3
|
-
import { VoltraInteractionEvent } from '../events.js';
|
|
4
|
-
export type VoltraViewProps = {
|
|
5
|
-
/**
|
|
6
|
-
* Unique identifier for this view instance.
|
|
7
|
-
* Used as 'source' in interaction events to identify which view triggered the event.
|
|
8
|
-
* If not provided, a unique ID will be generated automatically.
|
|
9
|
-
*/
|
|
10
|
-
id?: string;
|
|
11
|
-
/**
|
|
12
|
-
* Voltra JSX components to render
|
|
13
|
-
*/
|
|
14
|
-
children: ReactNode;
|
|
15
|
-
/**
|
|
16
|
-
* Style for the view container
|
|
17
|
-
*/
|
|
18
|
-
style?: StyleProp<ViewStyle>;
|
|
19
|
-
/**
|
|
20
|
-
* Callback when user interacts with components in the view.
|
|
21
|
-
* Events are filtered by this view's id (source).
|
|
22
|
-
*/
|
|
23
|
-
onInteraction?: (event: VoltraInteractionEvent) => void;
|
|
24
|
-
/**
|
|
25
|
-
* Test ID for the view
|
|
26
|
-
*/
|
|
27
|
-
testID?: string;
|
|
28
|
-
};
|
|
29
|
-
/**
|
|
30
|
-
* A React Native component that renders Voltra UI using SwiftUI in the native layer.
|
|
31
|
-
* This component accepts Voltra JSX components as children and renders them as SwiftUI components.
|
|
32
|
-
*
|
|
33
|
-
* @example
|
|
34
|
-
* ```tsx
|
|
35
|
-
* <VoltraView id="my-view" style={{ width: 200, height: 100 }}>
|
|
36
|
-
* <Voltra.VStack>
|
|
37
|
-
* <Voltra.Text>Hello World</Voltra.Text>
|
|
38
|
-
* </Voltra.VStack>
|
|
39
|
-
* </VoltraView>
|
|
40
|
-
* ```
|
|
41
|
-
*/
|
|
42
|
-
export declare function VoltraView({ id, children, style, onInteraction, testID }: VoltraViewProps): import("react/jsx-runtime").JSX.Element;
|
|
43
|
-
//# sourceMappingURL=VoltraView.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"VoltraView.d.ts","sourceRoot":"","sources":["../../../src/components/VoltraView.tsx"],"names":[],"mappings":"AACA,OAAc,EAAE,SAAS,EAAsB,MAAM,OAAO,CAAA;AAC5D,OAAO,EAAE,SAAS,EAAQ,SAAS,EAAE,MAAM,cAAc,CAAA;AAEzD,OAAO,EAAqB,sBAAsB,EAAE,MAAM,cAAc,CAAA;AAYxE,MAAM,MAAM,eAAe,GAAG;IAC5B;;;;OAIG;IACH,EAAE,CAAC,EAAE,MAAM,CAAA;IACX;;OAEG;IACH,QAAQ,EAAE,SAAS,CAAA;IACnB;;OAEG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAA;IAC5B;;;OAGG;IACH,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,sBAAsB,KAAK,IAAI,CAAA;IACvD;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB,CAAA;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,UAAU,CAAC,EAAE,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,aAAa,EAAE,MAAM,EAAE,EAAE,eAAe,2CAgCzF"}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { StyleProp, ViewStyle } from 'react-native';
|
|
2
|
-
import { WidgetFamily } from '../widgets/types.js';
|
|
3
|
-
import { VoltraViewProps } from './VoltraView.js';
|
|
4
|
-
export type VoltraWidgetPreviewProps = Omit<VoltraViewProps, 'style'> & {
|
|
5
|
-
/**
|
|
6
|
-
* Widget family size to preview
|
|
7
|
-
*/
|
|
8
|
-
family: WidgetFamily;
|
|
9
|
-
/**
|
|
10
|
-
* Additional styles to apply on top of the widget dimensions
|
|
11
|
-
*/
|
|
12
|
-
style?: StyleProp<ViewStyle>;
|
|
13
|
-
};
|
|
14
|
-
/**
|
|
15
|
-
* A preview component that renders Voltra JSX content at the exact dimensions
|
|
16
|
-
* of a specific iOS widget family. Useful for testing widget layouts.
|
|
17
|
-
*
|
|
18
|
-
* This component extends VoltraView but automatically sets the width and height
|
|
19
|
-
* to match the specified widget family's dimensions.
|
|
20
|
-
*
|
|
21
|
-
* @example
|
|
22
|
-
* ```tsx
|
|
23
|
-
* <VoltraWidgetPreview
|
|
24
|
-
* family="systemSmall"
|
|
25
|
-
* style={{ backgroundColor: 'lightgray' }}
|
|
26
|
-
* >
|
|
27
|
-
* <Voltra.Text>Hello Widget!</Voltra.Text>
|
|
28
|
-
* </VoltraWidgetPreview>
|
|
29
|
-
* ```
|
|
30
|
-
*/
|
|
31
|
-
export declare function VoltraWidgetPreview({ family, style, children, ...voltraViewProps }: VoltraWidgetPreviewProps): import("react/jsx-runtime").JSX.Element;
|
|
32
|
-
//# sourceMappingURL=VoltraWidgetPreview.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"VoltraWidgetPreview.d.ts","sourceRoot":"","sources":["../../../src/components/VoltraWidgetPreview.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAEnD,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAClD,OAAO,EAAc,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAgB7D,MAAM,MAAM,wBAAwB,GAAG,IAAI,CAAC,eAAe,EAAE,OAAO,CAAC,GAAG;IACtE;;OAEG;IACH,MAAM,EAAE,YAAY,CAAA;IACpB;;OAEG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAA;CAC7B,CAAA;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,mBAAmB,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,eAAe,EAAE,EAAE,wBAAwB,2CAe5G"}
|
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"}
|
package/build/types/helpers.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Return whether Liquid Glass APIs are supported on this device (iOS 26+).
|
|
3
|
-
* This is a convenience gate for authoring fallbacks in JS.
|
|
4
|
-
*/
|
|
5
|
-
export declare function isGlassSupported(): boolean;
|
|
6
|
-
/**
|
|
7
|
-
* Return whether the app was launched in the background (headless).
|
|
8
|
-
* Returns true if the app was launched in background, false if launched in foreground.
|
|
9
|
-
* Always returns false on non-iOS platforms.
|
|
10
|
-
*/
|
|
11
|
-
export declare function isHeadless(): boolean;
|
|
12
|
-
//# sourceMappingURL=helpers.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../src/helpers.ts"],"names":[],"mappings":"AAIA;;;GAGG;AACH,wBAAgB,gBAAgB,IAAI,OAAO,CAW1C;AAED;;;;GAIG;AACH,wBAAgB,UAAU,IAAI,OAAO,CAGpC"}
|