craft-native 0.0.246 → 0.0.248
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/dist/android/src/index.d.ts +11 -0
- package/dist/android/src/index.js +33 -21
- package/dist/android/templates/AndroidManifest.xml.template +1 -0
- package/dist/android/templates/CraftBridge.kt.template +136 -1
- package/dist/android/templates/CraftHeartRate.kt.template +938 -0
- package/dist/android/templates/CraftHeartRateCore.kt.template +485 -0
- package/dist/android/templates/CraftNative.kt.template +17 -0
- package/dist/android/templates/CraftNativeFlatList.kt.template +115 -40
- package/dist/android/templates/CraftNativeMapGoogle.kt.template +92 -5
- package/dist/android/templates/CraftNativeMapLibre.kt.template +90 -3
- package/dist/android/templates/CraftNativeMutation.kt.template +32 -0
- package/dist/android/templates/CraftNativeRefreshableFlatList.kt.template +7 -2
- package/dist/android/templates/CraftNativeServices.kt.template +59 -1
- package/dist/android/templates/CraftNativeShell.kt.template +54 -14
- package/dist/android/templates/MainActivityNative.kt.template +369 -69
- package/dist/android/templates/build.gradle.kts.project.template +1 -1
- package/dist/api/mobile.d.ts +39 -3
- package/dist/browser.js +9 -9
- package/dist/cli.js +90 -673
- package/dist/components/index.d.ts +50 -9
- package/dist/index.cjs +394 -438
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +446 -493
- package/dist/ios/src/index.d.ts +2 -0
- package/dist/ios/src/index.js +54 -53
- package/dist/ios/templates/CraftApp.swift +37 -2
- package/dist/ios/templates/CraftHealth.swift +217 -0
- package/dist/ios/templates/CraftHeartRate.swift +6 -3
- package/dist/ios/templates/CraftHybrid.swift +18 -19
- package/dist/ios/templates/CraftLiveActivities.swift +1 -1
- package/dist/ios/templates/CraftNativeActions.swift +87 -8
- package/dist/ios/templates/CraftNativeFiles.swift +15 -3
- package/dist/ios/templates/CraftNativeFlatList.swift +18 -1
- package/dist/ios/templates/CraftNativeMutation.swift +36 -0
- package/dist/ios/templates/CraftNativeScreen.swift +813 -65
- package/dist/ios/templates/CraftNativeServices.swift +4 -2
- package/dist/ios/templates/CraftNativeUI.swift +10 -2
- package/dist/ios/templates/testing/DriverTests.swift.template +1 -0
- package/dist/ios/templates/testing/HostApp.swift +9 -2
- package/dist/macos/templates/CraftNativeMutation.swift +36 -0
- package/dist/macos/templates/native_layout.zig +226 -2
- package/dist/mobile-testing.js +21 -3
- package/dist/mobile.js +101 -63
- package/dist/testing/media-cache/media-cache.kt +4 -2
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -39,236 +39,299 @@ var __export = (target, all) => {
|
|
|
39
39
|
// src/index.ts
|
|
40
40
|
var exports_src = {};
|
|
41
41
|
__export(exports_src, {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
windowManagement: () => windowManagement,
|
|
50
|
-
window: () => window2,
|
|
51
|
-
win: () => win,
|
|
52
|
-
watch: () => watch,
|
|
53
|
-
vueOptimizations: () => vueOptimizations,
|
|
54
|
-
verifyPassword: () => verifyPassword,
|
|
55
|
-
verifyBundleTrust: () => verifyBundleTrust,
|
|
56
|
-
variants: () => variants,
|
|
57
|
-
uuid: () => uuid,
|
|
58
|
-
updater: () => exports_updater,
|
|
59
|
-
updateTouchBarItem: () => updateTouchBarItem,
|
|
60
|
-
updateToolbarItem: () => updateToolbarItem,
|
|
61
|
-
unregisterShortcut: () => unregisterShortcut,
|
|
62
|
-
tw: () => tw,
|
|
63
|
-
trayManager: () => trayManager,
|
|
64
|
-
tray: () => tray,
|
|
65
|
-
touchBar: () => touchBar,
|
|
66
|
-
toastNotifications: () => toastNotifications,
|
|
67
|
-
tipKit: () => tipKit,
|
|
68
|
-
timingSafeEqual: () => timingSafeEqual,
|
|
69
|
-
tempDir: () => tempDir,
|
|
70
|
-
taskbarProgress: () => taskbarProgress,
|
|
71
|
-
tahoeStyles: () => tahoeStyles,
|
|
72
|
-
tahoeStyle: () => tahoeStyle,
|
|
73
|
-
tahoeDemoData: () => tahoeDemoData,
|
|
74
|
-
swapBundle: () => swapBundle,
|
|
75
|
-
svelteOptimizations: () => svelteOptimizations,
|
|
76
|
-
submenu: () => submenu,
|
|
77
|
-
styles: () => styles,
|
|
78
|
-
style: () => style,
|
|
79
|
-
storeKit: () => storeKit,
|
|
80
|
-
storage: () => storage2,
|
|
81
|
-
stat: () => stat,
|
|
82
|
-
startupTask: () => startupTask,
|
|
83
|
-
stageManager: () => stageManager,
|
|
84
|
-
spotlight: () => spotlight,
|
|
85
|
-
spawn: () => spawn2,
|
|
86
|
-
spaces: () => spaces,
|
|
87
|
-
sidecar: () => sidecar,
|
|
88
|
-
sidebarUtils: () => sidebarUtils,
|
|
89
|
-
sidebarSeparator: () => sidebarSeparator,
|
|
90
|
-
sidebarSection: () => sidebarSection,
|
|
91
|
-
sidebarItem: () => sidebarItem,
|
|
92
|
-
sidebarCSSVariables: () => sidebarCSSVariables,
|
|
93
|
-
sidebar: () => sidebar,
|
|
94
|
-
showQuickLook: () => showQuickLook,
|
|
95
|
-
showPrompt: () => showPrompt,
|
|
96
|
-
showFontPicker: () => showFontPicker,
|
|
97
|
-
showDockIcon: () => showDockIcon,
|
|
98
|
-
showDatePicker: () => showDatePicker,
|
|
99
|
-
showConfirm: () => showConfirm,
|
|
100
|
-
showColorPicker: () => showColorPicker,
|
|
101
|
-
showAlert: () => showAlert,
|
|
102
|
-
show: () => show2,
|
|
103
|
-
shareTarget: () => shareTarget,
|
|
104
|
-
sharePlay: () => sharePlay,
|
|
105
|
-
shareExtension: () => shareExtension,
|
|
106
|
-
share: () => share,
|
|
107
|
-
setTouchBar: () => setTouchBar,
|
|
108
|
-
setToolbarVisible: () => setToolbarVisible,
|
|
109
|
-
setToolbar: () => setToolbar,
|
|
110
|
-
setBadge: () => setBadge,
|
|
111
|
-
separator: () => separator,
|
|
112
|
-
secureStorage: () => secureStorage,
|
|
113
|
-
secondaryTiles: () => secondaryTiles,
|
|
114
|
-
saveFile: () => saveFile,
|
|
115
|
-
resolveCraftBinary: () => resolveCraftBinary,
|
|
116
|
-
requireCraftRuntime: () => requireCraftRuntime,
|
|
117
|
-
renderTahoeSidebar: () => renderTahoeSidebar,
|
|
118
|
-
renderOrbStackSidebar: () => renderOrbStackSidebar,
|
|
119
|
-
renderArcSidebar: () => renderArcSidebar,
|
|
120
|
-
registerShortcut: () => registerShortcut,
|
|
121
|
-
readText: () => readText,
|
|
122
|
-
readHTML: () => readHTML,
|
|
123
|
-
readBundleIdentity: () => readBundleIdentity,
|
|
124
|
-
readBinaryFile: () => readBinaryFile,
|
|
125
|
-
reactOptimizations: () => reactOptimizations,
|
|
126
|
-
randomString: () => randomString,
|
|
127
|
-
quit: () => quit,
|
|
128
|
-
quickActions: () => quickActions,
|
|
129
|
-
predictiveBack: () => predictiveBack,
|
|
130
|
-
playBilling: () => playBilling,
|
|
131
|
-
photoPicker: () => photoPicker,
|
|
132
|
-
permissions: () => permissions,
|
|
133
|
-
parseCraftVersionOutput: () => parseCraftVersionOutput,
|
|
134
|
-
packageApp: () => packageApp,
|
|
135
|
-
pack: () => pack,
|
|
136
|
-
orbstackStyles: () => orbstackStyles,
|
|
137
|
-
orbstackStyle: () => orbstackStyle,
|
|
138
|
-
orbstackDemoData: () => orbstackDemoData,
|
|
139
|
-
openFolder: () => openFolder,
|
|
140
|
-
openFile: () => openFile,
|
|
141
|
-
openDatabase: () => openDatabase,
|
|
142
|
-
open: () => open,
|
|
143
|
-
onSwipe: () => onSwipe,
|
|
144
|
-
notify: () => notify,
|
|
145
|
-
notifications: () => notifications,
|
|
146
|
-
notification: () => notifications,
|
|
147
|
-
msixUpdate: () => msixUpdate,
|
|
148
|
-
move: () => move,
|
|
149
|
-
menuItem: () => menuItem,
|
|
150
|
-
media: () => media,
|
|
151
|
-
materialYou: () => materialYou,
|
|
152
|
-
location: () => location,
|
|
153
|
-
loadURL: () => loadURL,
|
|
154
|
-
liveActivities: () => liveActivities,
|
|
155
|
-
lifecycle: () => lifecycle,
|
|
156
|
-
jumpList: () => jumpList,
|
|
157
|
-
isMobile: () => isMobile,
|
|
158
|
-
isDesktop: () => isDesktop,
|
|
159
|
-
isDarkMode: () => isDarkMode,
|
|
160
|
-
isCraftRuntime: () => isCraftRuntime,
|
|
161
|
-
isCraft: () => isCraft,
|
|
162
|
-
http: () => http,
|
|
163
|
-
homeDir: () => homeDir,
|
|
164
|
-
hmac: () => hmac,
|
|
165
|
-
hideQuickLook: () => hideQuickLook,
|
|
166
|
-
hideDockIcon: () => hideDockIcon,
|
|
167
|
-
hide: () => hide,
|
|
168
|
-
hashPassword: () => hashPassword,
|
|
169
|
-
hasNativeSpaces: () => hasNativeSpaces,
|
|
170
|
-
hasNativeGestures: () => hasNativeGestures,
|
|
171
|
-
haptics: () => haptics,
|
|
172
|
-
handoff: () => handoff,
|
|
173
|
-
getVersion: () => getVersion,
|
|
174
|
-
getSystemInfo: () => getSystemInfo,
|
|
175
|
-
getSidebarStyle: () => getSidebarStyle,
|
|
176
|
-
getPlatform: () => getPlatform,
|
|
177
|
-
getPath: () => getPath,
|
|
178
|
-
getNativeBridgeCall: () => getNativeBridgeCall,
|
|
179
|
-
getName: () => getName,
|
|
180
|
-
getLocale: () => getLocale,
|
|
181
|
-
getInfo: () => getInfo,
|
|
182
|
-
getFullPageHTML: () => getFullPageHTML,
|
|
183
|
-
getCraft: () => getCraft,
|
|
184
|
-
gestures: () => gestures,
|
|
185
|
-
generateUpdateManifest: () => generateUpdateManifest,
|
|
186
|
-
generateConfig: () => generateConfig,
|
|
187
|
-
fs: () => fs,
|
|
188
|
-
foregroundService: () => foregroundService,
|
|
189
|
-
focusFilters: () => focusFilters,
|
|
190
|
-
focus: () => focus,
|
|
191
|
-
extractBundleFromZip: () => extractBundleFromZip,
|
|
192
|
-
extractBundleFromDmg: () => extractBundleFromDmg,
|
|
193
|
-
extractBundle: () => extractBundle,
|
|
194
|
-
exit: () => exit,
|
|
195
|
-
exec: () => exec,
|
|
196
|
-
env: () => env,
|
|
197
|
-
dittoBundle: () => dittoBundle,
|
|
198
|
-
dialog: () => dialog,
|
|
199
|
-
device: () => device,
|
|
200
|
-
desktopWidgets: () => desktopWidgets,
|
|
201
|
-
db: () => db,
|
|
202
|
-
cx: () => cx,
|
|
203
|
-
cwd: () => cwd,
|
|
204
|
-
crypto: () => crypto,
|
|
205
|
-
createWindow: () => createWindow,
|
|
206
|
-
createTahoeSidebar: () => createTahoeSidebar,
|
|
207
|
-
createTableView: () => createTableView,
|
|
208
|
-
createSplitView: () => createSplitView,
|
|
209
|
-
createSpacesSidebar: () => createSpacesSidebar,
|
|
210
|
-
createSidebar: () => createSidebar,
|
|
211
|
-
createSettingsSidebar: () => createSettingsSidebar,
|
|
212
|
-
createProgress: () => createProgress,
|
|
213
|
-
createOutlineView: () => createOutlineView,
|
|
214
|
-
createOrbStackSidebar: () => createOrbStackSidebar,
|
|
215
|
-
createMenubarApp: () => createMenubarApp,
|
|
216
|
-
createFileSidebar: () => createFileSidebar,
|
|
217
|
-
createFileBrowser: () => createFileBrowser,
|
|
218
|
-
createClient: () => createClient,
|
|
219
|
-
createArcSidebar: () => createArcSidebar,
|
|
220
|
-
createApp: () => createApp,
|
|
221
|
-
craftUnavailableMessage: () => craftUnavailableMessage,
|
|
222
|
-
craftProcessFailedMessage: () => craftProcessFailedMessage,
|
|
223
|
-
craftBinaryNotFoundMessage: () => craftBinaryNotFoundMessage,
|
|
224
|
-
copy: () => copy,
|
|
225
|
-
components: () => exports_components,
|
|
226
|
-
commonOptimizations: () => commonOptimizations,
|
|
227
|
-
clsx: () => cx,
|
|
228
|
-
clipboard: () => clipboard,
|
|
229
|
-
clearQuarantine: () => clearQuarantine,
|
|
230
|
-
checkbox: () => checkbox,
|
|
231
|
-
carplay: () => carplay,
|
|
232
|
-
canReplaceBundle: () => canReplaceBundle,
|
|
233
|
-
canQuickLook: () => canQuickLook,
|
|
234
|
-
camera: () => camera,
|
|
235
|
-
buildMenu: () => buildMenu,
|
|
236
|
-
buildCSS: () => buildCSS,
|
|
237
|
-
biometrics: () => biometrics,
|
|
238
|
-
argv: () => argv,
|
|
239
|
-
arcStyles: () => arcStyles,
|
|
240
|
-
arcStyle: () => arcStyle,
|
|
241
|
-
arcDemoData: () => arcDemoData,
|
|
242
|
-
appManager: () => appManager,
|
|
243
|
-
appLanguage: () => appLanguage,
|
|
244
|
-
appIntents: () => appIntents,
|
|
245
|
-
appClips: () => appClips,
|
|
246
|
-
app: () => app,
|
|
247
|
-
androidWidgets: () => widgets,
|
|
248
|
-
Window: () => Window,
|
|
249
|
-
WebSocketClient: () => WebSocketClient,
|
|
250
|
-
Timer: () => Timer,
|
|
251
|
-
TableViewInstance: () => TableViewInstance,
|
|
252
|
-
SystemTray: () => SystemTray,
|
|
253
|
-
StyleSheet: () => StyleSheet,
|
|
254
|
-
Storage: () => Storage,
|
|
255
|
-
SplitViewInstance: () => SplitViewInstance,
|
|
256
|
-
Sidebar: () => Sidebar,
|
|
257
|
-
ProgressInstance: () => ProgressInstance,
|
|
258
|
-
OutlineViewInstance: () => OutlineViewInstance,
|
|
259
|
-
MenubarApp: () => MenubarApp,
|
|
260
|
-
KeyValueStore: () => KeyValueStore,
|
|
261
|
-
HttpError: () => HttpError,
|
|
42
|
+
Animated: () => Animated,
|
|
43
|
+
AudioManager: () => AudioManager,
|
|
44
|
+
AutoUpdater: () => AutoUpdater,
|
|
45
|
+
ChildProcess: () => ChildProcess,
|
|
46
|
+
CraftApp: () => CraftApp,
|
|
47
|
+
Database: () => Database,
|
|
48
|
+
FileBrowserInstance: () => FileBrowserInstance,
|
|
262
49
|
HttpClient: () => HttpClient,
|
|
50
|
+
HttpError: () => HttpError,
|
|
51
|
+
KeyValueStore: () => KeyValueStore,
|
|
52
|
+
MenubarApp: () => MenubarApp,
|
|
53
|
+
OutlineViewInstance: () => OutlineViewInstance,
|
|
54
|
+
ProgressInstance: () => ProgressInstance,
|
|
55
|
+
Sidebar: () => Sidebar,
|
|
56
|
+
SplitViewInstance: () => SplitViewInstance,
|
|
57
|
+
Storage: () => Storage,
|
|
58
|
+
StyleSheet: () => StyleSheet,
|
|
59
|
+
SystemTray: () => SystemTray,
|
|
60
|
+
TableViewInstance: () => TableViewInstance,
|
|
61
|
+
Timer: () => Timer,
|
|
62
|
+
WebSocketClient: () => WebSocketClient,
|
|
63
|
+
Window: () => Window,
|
|
64
|
+
androidWidgets: () => widgets,
|
|
65
|
+
app: () => app,
|
|
66
|
+
appClips: () => appClips,
|
|
67
|
+
appIntents: () => appIntents,
|
|
68
|
+
appLanguage: () => appLanguage,
|
|
69
|
+
appManager: () => appManager,
|
|
70
|
+
arcDemoData: () => arcDemoData,
|
|
71
|
+
arcStyle: () => arcStyle,
|
|
72
|
+
arcStyles: () => arcStyles,
|
|
73
|
+
argv: () => argv,
|
|
74
|
+
biometrics: () => biometrics,
|
|
75
|
+
buildCSS: () => buildCSS,
|
|
76
|
+
buildMenu: () => buildMenu,
|
|
77
|
+
camera: () => camera,
|
|
78
|
+
canQuickLook: () => canQuickLook,
|
|
79
|
+
canReplaceBundle: () => canReplaceBundle,
|
|
80
|
+
carplay: () => carplay,
|
|
81
|
+
checkbox: () => checkbox,
|
|
82
|
+
clearQuarantine: () => clearQuarantine,
|
|
83
|
+
clipboard: () => clipboard,
|
|
84
|
+
clsx: () => cx,
|
|
85
|
+
commonOptimizations: () => commonOptimizations,
|
|
86
|
+
components: () => exports_components,
|
|
87
|
+
copy: () => copy,
|
|
88
|
+
craftBinaryNotFoundMessage: () => craftBinaryNotFoundMessage,
|
|
89
|
+
craftProcessFailedMessage: () => craftProcessFailedMessage,
|
|
90
|
+
craftUnavailableMessage: () => craftUnavailableMessage,
|
|
91
|
+
createApp: () => createApp,
|
|
92
|
+
createArcSidebar: () => createArcSidebar,
|
|
93
|
+
createClient: () => createClient,
|
|
94
|
+
createFileBrowser: () => createFileBrowser,
|
|
95
|
+
createFileSidebar: () => createFileSidebar,
|
|
96
|
+
createMenubarApp: () => createMenubarApp,
|
|
97
|
+
createOrbStackSidebar: () => createOrbStackSidebar,
|
|
98
|
+
createOutlineView: () => createOutlineView,
|
|
99
|
+
createProgress: () => createProgress,
|
|
100
|
+
createSettingsSidebar: () => createSettingsSidebar,
|
|
101
|
+
createSidebar: () => createSidebar,
|
|
102
|
+
createSpacesSidebar: () => createSpacesSidebar,
|
|
103
|
+
createSplitView: () => createSplitView,
|
|
104
|
+
createTableView: () => createTableView,
|
|
105
|
+
createTahoeSidebar: () => createTahoeSidebar,
|
|
106
|
+
createWindow: () => createWindow,
|
|
107
|
+
crypto: () => crypto,
|
|
108
|
+
cwd: () => cwd,
|
|
109
|
+
cx: () => cx,
|
|
110
|
+
db: () => db,
|
|
111
|
+
desktopWidgets: () => desktopWidgets,
|
|
112
|
+
device: () => device,
|
|
113
|
+
dialog: () => dialog,
|
|
114
|
+
dittoBundle: () => dittoBundle,
|
|
115
|
+
env: () => env,
|
|
116
|
+
exec: () => exec,
|
|
117
|
+
exit: () => exit,
|
|
118
|
+
extractBundle: () => extractBundle,
|
|
119
|
+
extractBundleFromDmg: () => extractBundleFromDmg,
|
|
120
|
+
extractBundleFromZip: () => extractBundleFromZip,
|
|
121
|
+
focus: () => focus,
|
|
122
|
+
focusFilters: () => focusFilters,
|
|
123
|
+
foregroundService: () => foregroundService,
|
|
124
|
+
fs: () => fs,
|
|
125
|
+
generateConfig: () => generateConfig,
|
|
126
|
+
generateUpdateManifest: () => generateUpdateManifest,
|
|
127
|
+
gestures: () => gestures,
|
|
128
|
+
getCraft: () => getCraft,
|
|
129
|
+
getFullPageHTML: () => getFullPageHTML,
|
|
130
|
+
getInfo: () => getInfo,
|
|
131
|
+
getLocale: () => getLocale,
|
|
132
|
+
getName: () => getName,
|
|
133
|
+
getNativeBridgeCall: () => getNativeBridgeCall,
|
|
134
|
+
getPath: () => getPath,
|
|
135
|
+
getPlatform: () => getPlatform,
|
|
136
|
+
getSidebarStyle: () => getSidebarStyle,
|
|
137
|
+
getSystemInfo: () => getSystemInfo,
|
|
138
|
+
getVersion: () => getVersion,
|
|
139
|
+
handoff: () => handoff,
|
|
140
|
+
haptics: () => haptics,
|
|
141
|
+
hasNativeGestures: () => hasNativeGestures,
|
|
142
|
+
hasNativeSpaces: () => hasNativeSpaces,
|
|
143
|
+
hashPassword: () => hashPassword,
|
|
144
|
+
hide: () => hide,
|
|
145
|
+
hideDockIcon: () => hideDockIcon,
|
|
146
|
+
hideQuickLook: () => hideQuickLook,
|
|
147
|
+
hmac: () => hmac,
|
|
148
|
+
homeDir: () => homeDir,
|
|
149
|
+
http: () => http,
|
|
150
|
+
isCraft: () => isCraft,
|
|
151
|
+
isCraftRuntime: () => isCraftRuntime,
|
|
152
|
+
isDarkMode: () => isDarkMode,
|
|
153
|
+
isDesktop: () => isDesktop,
|
|
154
|
+
isMobile: () => isMobile,
|
|
155
|
+
jumpList: () => jumpList,
|
|
156
|
+
lifecycle: () => lifecycle,
|
|
157
|
+
liveActivities: () => liveActivities,
|
|
158
|
+
loadURL: () => loadURL,
|
|
159
|
+
location: () => location,
|
|
160
|
+
materialYou: () => materialYou,
|
|
161
|
+
media: () => media,
|
|
162
|
+
menuItem: () => menuItem,
|
|
163
|
+
move: () => move,
|
|
164
|
+
msixUpdate: () => msixUpdate,
|
|
165
|
+
notification: () => notifications,
|
|
166
|
+
notifications: () => notifications,
|
|
167
|
+
notify: () => notify,
|
|
168
|
+
onSwipe: () => onSwipe,
|
|
169
|
+
open: () => open,
|
|
170
|
+
openDatabase: () => openDatabase,
|
|
171
|
+
openFile: () => openFile,
|
|
172
|
+
openFolder: () => openFolder,
|
|
173
|
+
orbstackDemoData: () => orbstackDemoData,
|
|
174
|
+
orbstackStyle: () => orbstackStyle,
|
|
175
|
+
orbstackStyles: () => orbstackStyles,
|
|
176
|
+
pack: () => pack,
|
|
177
|
+
packageApp: () => packageApp,
|
|
178
|
+
parseCraftVersionOutput: () => parseCraftVersionOutput,
|
|
179
|
+
permissions: () => permissions,
|
|
180
|
+
photoPicker: () => photoPicker,
|
|
181
|
+
playBilling: () => playBilling,
|
|
182
|
+
predictiveBack: () => predictiveBack,
|
|
183
|
+
quickActions: () => quickActions,
|
|
184
|
+
quit: () => quit,
|
|
185
|
+
randomString: () => randomString,
|
|
186
|
+
reactOptimizations: () => reactOptimizations,
|
|
187
|
+
readBinaryFile: () => readBinaryFile,
|
|
188
|
+
readBundleIdentity: () => readBundleIdentity,
|
|
189
|
+
readHTML: () => readHTML,
|
|
190
|
+
readText: () => readText,
|
|
191
|
+
registerShortcut: () => registerShortcut,
|
|
192
|
+
renderArcSidebar: () => renderArcSidebar,
|
|
193
|
+
renderOrbStackSidebar: () => renderOrbStackSidebar,
|
|
194
|
+
renderTahoeSidebar: () => renderTahoeSidebar,
|
|
195
|
+
requireCraftRuntime: () => requireCraftRuntime,
|
|
196
|
+
resolveCraftBinary: () => resolveCraftBinary,
|
|
197
|
+
saveFile: () => saveFile,
|
|
198
|
+
secondaryTiles: () => secondaryTiles,
|
|
199
|
+
secureStorage: () => secureStorage,
|
|
200
|
+
separator: () => separator,
|
|
201
|
+
setBadge: () => setBadge,
|
|
202
|
+
setToolbar: () => setToolbar,
|
|
203
|
+
setToolbarVisible: () => setToolbarVisible,
|
|
204
|
+
setTouchBar: () => setTouchBar,
|
|
205
|
+
share: () => share,
|
|
206
|
+
shareExtension: () => shareExtension,
|
|
207
|
+
sharePlay: () => sharePlay,
|
|
208
|
+
shareTarget: () => shareTarget,
|
|
209
|
+
show: () => show2,
|
|
210
|
+
showAlert: () => showAlert,
|
|
211
|
+
showColorPicker: () => showColorPicker,
|
|
212
|
+
showConfirm: () => showConfirm,
|
|
213
|
+
showDatePicker: () => showDatePicker,
|
|
214
|
+
showDockIcon: () => showDockIcon,
|
|
215
|
+
showFontPicker: () => showFontPicker,
|
|
216
|
+
showPrompt: () => showPrompt,
|
|
217
|
+
showQuickLook: () => showQuickLook,
|
|
218
|
+
sidebar: () => sidebar,
|
|
219
|
+
sidebarCSSVariables: () => sidebarCSSVariables,
|
|
220
|
+
sidebarItem: () => sidebarItem,
|
|
221
|
+
sidebarSection: () => sidebarSection,
|
|
222
|
+
sidebarSeparator: () => sidebarSeparator,
|
|
223
|
+
sidebarUtils: () => sidebarUtils,
|
|
224
|
+
sidecar: () => sidecar,
|
|
225
|
+
spaces: () => spaces,
|
|
226
|
+
spawn: () => spawn2,
|
|
227
|
+
spotlight: () => spotlight,
|
|
228
|
+
stageManager: () => stageManager,
|
|
229
|
+
startupTask: () => startupTask,
|
|
230
|
+
stat: () => stat,
|
|
231
|
+
storage: () => storage2,
|
|
232
|
+
storeKit: () => storeKit,
|
|
233
|
+
style: () => style,
|
|
234
|
+
styles: () => styles,
|
|
235
|
+
submenu: () => submenu,
|
|
236
|
+
svelteOptimizations: () => svelteOptimizations,
|
|
237
|
+
swapBundle: () => swapBundle,
|
|
238
|
+
tahoeDemoData: () => tahoeDemoData,
|
|
239
|
+
tahoeStyle: () => tahoeStyle,
|
|
240
|
+
tahoeStyles: () => tahoeStyles,
|
|
241
|
+
taskbarProgress: () => taskbarProgress,
|
|
242
|
+
tempDir: () => tempDir,
|
|
243
|
+
timingSafeEqual: () => timingSafeEqual,
|
|
244
|
+
tipKit: () => tipKit,
|
|
245
|
+
toastNotifications: () => toastNotifications,
|
|
246
|
+
touchBar: () => touchBar,
|
|
247
|
+
tray: () => tray,
|
|
248
|
+
trayManager: () => trayManager,
|
|
249
|
+
tw: () => tw,
|
|
250
|
+
unregisterShortcut: () => unregisterShortcut,
|
|
251
|
+
updateToolbarItem: () => updateToolbarItem,
|
|
252
|
+
updateTouchBarItem: () => updateTouchBarItem,
|
|
253
|
+
updater: () => exports_updater,
|
|
254
|
+
uuid: () => uuid,
|
|
255
|
+
variants: () => variants,
|
|
256
|
+
verifyBundleTrust: () => verifyBundleTrust,
|
|
257
|
+
verifyPassword: () => verifyPassword,
|
|
258
|
+
vueOptimizations: () => vueOptimizations,
|
|
259
|
+
watch: () => watch,
|
|
260
|
+
win: () => win,
|
|
261
|
+
window: () => window2,
|
|
262
|
+
windowManagement: () => windowManagement,
|
|
263
|
+
windowManager: () => windowManager,
|
|
264
|
+
windowsHello: () => windowsHello,
|
|
265
|
+
windowsWidgets: () => windowsWidgets,
|
|
266
|
+
workManager: () => workManager,
|
|
267
|
+
writeBinaryFile: () => writeBinaryFile,
|
|
268
|
+
writeHTML: () => writeHTML,
|
|
269
|
+
writeText: () => writeText
|
|
270
|
+
});
|
|
271
|
+
module.exports = __toCommonJS(exports_src);
|
|
272
|
+
|
|
273
|
+
// src/components/index.ts
|
|
274
|
+
var exports_components = {};
|
|
275
|
+
__export(exports_components, {
|
|
276
|
+
Animated: () => Animated,
|
|
263
277
|
FileBrowserInstance: () => FileBrowserInstance,
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
278
|
+
OutlineViewInstance: () => OutlineViewInstance,
|
|
279
|
+
Platform: () => Platform,
|
|
280
|
+
ProgressInstance: () => ProgressInstance,
|
|
281
|
+
Sidebar: () => Sidebar2,
|
|
282
|
+
SplitViewInstance: () => SplitViewInstance,
|
|
283
|
+
StyleSheet: () => StyleSheet,
|
|
284
|
+
TableViewInstance: () => TableViewInstance,
|
|
285
|
+
arcStyle: () => arcStyle,
|
|
286
|
+
canQuickLook: () => canQuickLook,
|
|
287
|
+
createArcSidebar: () => createArcSidebar,
|
|
288
|
+
createFileBrowser: () => createFileBrowser,
|
|
289
|
+
createOrbStackSidebar: () => createOrbStackSidebar,
|
|
290
|
+
createOutlineView: () => createOutlineView,
|
|
291
|
+
createProgress: () => createProgress,
|
|
292
|
+
createSidebar: () => createSidebar2,
|
|
293
|
+
createSplitView: () => createSplitView,
|
|
294
|
+
createTableView: () => createTableView,
|
|
295
|
+
createTahoeSidebar: () => createTahoeSidebar,
|
|
296
|
+
default: () => components_default,
|
|
297
|
+
hideQuickLook: () => hideQuickLook,
|
|
298
|
+
orbstackStyle: () => orbstackStyle,
|
|
299
|
+
setToolbar: () => setToolbar,
|
|
300
|
+
setToolbarVisible: () => setToolbarVisible,
|
|
301
|
+
setTouchBar: () => setTouchBar,
|
|
302
|
+
showColorPicker: () => showColorPicker,
|
|
303
|
+
showDatePicker: () => showDatePicker,
|
|
304
|
+
showFontPicker: () => showFontPicker,
|
|
305
|
+
showQuickLook: () => showQuickLook,
|
|
306
|
+
sidebarItem: () => sidebarItem,
|
|
307
|
+
sidebarSection: () => sidebarSection,
|
|
308
|
+
sidebarSeparator: () => sidebarSeparator,
|
|
309
|
+
tahoeStyle: () => tahoeStyle,
|
|
310
|
+
updateToolbarItem: () => updateToolbarItem,
|
|
311
|
+
updateTouchBarItem: () => updateTouchBarItem
|
|
312
|
+
});
|
|
313
|
+
|
|
314
|
+
// src/updater/index.ts
|
|
315
|
+
var exports_updater = {};
|
|
316
|
+
__export(exports_updater, {
|
|
267
317
|
AutoUpdater: () => AutoUpdater,
|
|
268
|
-
|
|
269
|
-
|
|
318
|
+
DeltaGenerator: () => DeltaGenerator,
|
|
319
|
+
canReplaceBundle: () => canReplaceBundle,
|
|
320
|
+
clearQuarantine: () => clearQuarantine,
|
|
321
|
+
default: () => updater_default,
|
|
322
|
+
dittoBundle: () => dittoBundle,
|
|
323
|
+
extractBundle: () => extractBundle,
|
|
324
|
+
extractBundleFromDmg: () => extractBundleFromDmg,
|
|
325
|
+
extractBundleFromZip: () => extractBundleFromZip,
|
|
326
|
+
generateUpdateManifest: () => generateUpdateManifest,
|
|
327
|
+
isMacOS: () => isMacOS,
|
|
328
|
+
readBundleIdentity: () => readBundleIdentity,
|
|
329
|
+
swapBundle: () => swapBundle,
|
|
330
|
+
updaterCommand: () => updaterCommand,
|
|
331
|
+
verifyBundleTrust: () => verifyBundleTrust
|
|
270
332
|
});
|
|
271
|
-
|
|
333
|
+
|
|
334
|
+
// src/index.ts
|
|
272
335
|
var import_node_child_process = require("node:child_process");
|
|
273
336
|
var import_node_fs3 = require("node:fs");
|
|
274
337
|
var import_node_path2 = require("node:path");
|
|
@@ -310,7 +373,7 @@ function craftBinaryNotFoundMessage(triedPath) {
|
|
|
310
373
|
`);
|
|
311
374
|
}
|
|
312
375
|
// package.json
|
|
313
|
-
var version = "0.0.
|
|
376
|
+
var version = "0.0.248";
|
|
314
377
|
|
|
315
378
|
// src/sdk-version.ts
|
|
316
379
|
var SDK_VERSION = version;
|
|
@@ -544,13 +607,13 @@ async function packageApp(config) {
|
|
|
544
607
|
}
|
|
545
608
|
async function packageMacOS(config, outDir) {
|
|
546
609
|
const results = [];
|
|
547
|
-
const { name, version
|
|
610
|
+
const { name, version, bundleId = `com.myapp.${name.toLowerCase()}` } = config;
|
|
548
611
|
const opts = config.macos || {};
|
|
549
612
|
const hardenedRuntime = !opts.appStore;
|
|
550
613
|
const appBundlePath = import_path.join(outDir, `${name}.app`);
|
|
551
614
|
const appBundle = createMacOSAppBundle({
|
|
552
615
|
name,
|
|
553
|
-
version
|
|
616
|
+
version,
|
|
554
617
|
bundleId,
|
|
555
618
|
buildNumber: opts.buildNumber,
|
|
556
619
|
category: opts.category,
|
|
@@ -594,7 +657,7 @@ async function packageMacOS(config, outDir) {
|
|
|
594
657
|
}
|
|
595
658
|
results.push({ success: true, platform: "macos", format: "app", outputPath: appBundlePath });
|
|
596
659
|
if (opts.dmg !== false) {
|
|
597
|
-
const outputPath = import_path.join(outDir, `${name}-${
|
|
660
|
+
const outputPath = import_path.join(outDir, `${name}-${version}.dmg`);
|
|
598
661
|
const dmgResult = await createDMG({ appBundlePath, outputPath, volumeName: name });
|
|
599
662
|
results.push({
|
|
600
663
|
success: dmgResult.success,
|
|
@@ -607,12 +670,12 @@ async function packageMacOS(config, outDir) {
|
|
|
607
670
|
results.push(...await notarizeIfRequested(opts, outputPath, "dmg"));
|
|
608
671
|
}
|
|
609
672
|
if (opts.pkg || opts.appStore) {
|
|
610
|
-
const outputPath = import_path.join(outDir, `${name}-${
|
|
673
|
+
const outputPath = import_path.join(outDir, `${name}-${version}.pkg`);
|
|
611
674
|
const pkgResult = await createPKG({
|
|
612
675
|
appBundlePath,
|
|
613
676
|
outputPath,
|
|
614
677
|
identifier: bundleId,
|
|
615
|
-
version
|
|
678
|
+
version,
|
|
616
679
|
appStore: opts.appStore === true,
|
|
617
680
|
installerIdentity: opts.installerIdentity
|
|
618
681
|
});
|
|
@@ -658,14 +721,14 @@ async function notarizeIfRequested(opts, artifactPath, format) {
|
|
|
658
721
|
}
|
|
659
722
|
async function packageWindows(config, outDir) {
|
|
660
723
|
const results = [];
|
|
661
|
-
const { name, version
|
|
724
|
+
const { name, version } = config;
|
|
662
725
|
const opts = config.windows || {};
|
|
663
726
|
if (opts.msi !== false) {
|
|
664
727
|
const msiResult = await createMSI({
|
|
665
728
|
name,
|
|
666
|
-
version
|
|
729
|
+
version,
|
|
667
730
|
binaryPath: config.binaryPath,
|
|
668
|
-
outputPath: import_path.join(outDir, `${name}-${
|
|
731
|
+
outputPath: import_path.join(outDir, `${name}-${version}.msi`),
|
|
669
732
|
manufacturer: config.author || "Unknown",
|
|
670
733
|
architecture: opts.architecture || windowsArchitecture(process.arch),
|
|
671
734
|
additionalFiles: opts.additionalFiles,
|
|
@@ -685,11 +748,11 @@ async function packageWindows(config, outDir) {
|
|
|
685
748
|
if (opts.zip || opts.msi === false) {
|
|
686
749
|
const zipResult = await createZIP({
|
|
687
750
|
name,
|
|
688
|
-
version
|
|
751
|
+
version,
|
|
689
752
|
manufacturer: config.author || "Unknown",
|
|
690
753
|
binaryPath: config.binaryPath,
|
|
691
754
|
additionalFiles: opts.additionalFiles,
|
|
692
|
-
outputPath: import_path.join(outDir, `${name}-${
|
|
755
|
+
outputPath: import_path.join(outDir, `${name}-${version}-windows.zip`)
|
|
693
756
|
});
|
|
694
757
|
results.push({
|
|
695
758
|
success: zipResult.success,
|
|
@@ -703,14 +766,14 @@ async function packageWindows(config, outDir) {
|
|
|
703
766
|
}
|
|
704
767
|
async function packageLinux(config, outDir) {
|
|
705
768
|
const results = [];
|
|
706
|
-
const { name, version
|
|
769
|
+
const { name, version } = config;
|
|
707
770
|
const opts = config.linux || {};
|
|
708
771
|
if (opts.deb !== false) {
|
|
709
772
|
const debResult = await createDEB({
|
|
710
773
|
name,
|
|
711
|
-
version
|
|
774
|
+
version,
|
|
712
775
|
binaryPath: config.binaryPath,
|
|
713
|
-
outputPath: import_path.join(outDir, `${name}_${
|
|
776
|
+
outputPath: import_path.join(outDir, `${name}_${version}_amd64.deb`),
|
|
714
777
|
description: config.description || "",
|
|
715
778
|
maintainer: config.author || "Unknown",
|
|
716
779
|
dependencies: opts.debDependencies || [...DEFAULT_DEB_DEPENDENCIES],
|
|
@@ -728,9 +791,9 @@ async function packageLinux(config, outDir) {
|
|
|
728
791
|
if (opts.rpm) {
|
|
729
792
|
const rpmResult = await createRPM({
|
|
730
793
|
name,
|
|
731
|
-
version
|
|
794
|
+
version,
|
|
732
795
|
binaryPath: config.binaryPath,
|
|
733
|
-
outputPath: import_path.join(outDir, `${name}-${
|
|
796
|
+
outputPath: import_path.join(outDir, `${name}-${version}-1.x86_64.rpm`),
|
|
734
797
|
description: config.description || "",
|
|
735
798
|
requires: opts.rpmDependencies || ["gtk3", "webkit2gtk3"]
|
|
736
799
|
});
|
|
@@ -745,9 +808,9 @@ async function packageLinux(config, outDir) {
|
|
|
745
808
|
if (opts.appImage) {
|
|
746
809
|
const appImageResult = await createAppImage({
|
|
747
810
|
name,
|
|
748
|
-
version
|
|
811
|
+
version,
|
|
749
812
|
binaryPath: config.binaryPath,
|
|
750
|
-
outputPath: import_path.join(outDir, `${name}-${
|
|
813
|
+
outputPath: import_path.join(outDir, `${name}-${version}-x86_64.AppImage`),
|
|
751
814
|
iconPath: config.iconPath
|
|
752
815
|
});
|
|
753
816
|
results.push({
|
|
@@ -2098,17 +2161,17 @@ class NativeBridge extends import_events.EventEmitter {
|
|
|
2098
2161
|
});
|
|
2099
2162
|
}
|
|
2100
2163
|
return new Promise((resolve, reject) => {
|
|
2101
|
-
const
|
|
2164
|
+
const timer = setTimeout(() => {
|
|
2102
2165
|
this.pendingRequests.delete(message.id);
|
|
2103
2166
|
reject(new BridgeError("Request timeout", BridgeErrorCodes.TIMEOUT));
|
|
2104
2167
|
}, effectiveTimeout);
|
|
2105
2168
|
this.pendingRequests.set(message.id, {
|
|
2106
2169
|
resolve,
|
|
2107
2170
|
reject,
|
|
2108
|
-
timeout:
|
|
2171
|
+
timeout: timer
|
|
2109
2172
|
});
|
|
2110
2173
|
if (!this.send(message)) {
|
|
2111
|
-
clearTimeout(
|
|
2174
|
+
clearTimeout(timer);
|
|
2112
2175
|
this.pendingRequests.delete(message.id);
|
|
2113
2176
|
reject(new BridgeError("No bridge transport available — not running inside a Craft host", BridgeErrorCodes.UNKNOWN));
|
|
2114
2177
|
}
|
|
@@ -2396,54 +2459,6 @@ class BridgeError extends Error {
|
|
|
2396
2459
|
this.data = data;
|
|
2397
2460
|
}
|
|
2398
2461
|
}
|
|
2399
|
-
class NativeComponentBridge {
|
|
2400
|
-
bridge;
|
|
2401
|
-
components = new Map;
|
|
2402
|
-
constructor(bridge) {
|
|
2403
|
-
this.bridge = bridge;
|
|
2404
|
-
this.bridge.on("component.event", this.handleComponentEvent.bind(this));
|
|
2405
|
-
}
|
|
2406
|
-
handleComponentEvent(event) {
|
|
2407
|
-
const component = this.components.get(event.componentId);
|
|
2408
|
-
if (component) {
|
|
2409
|
-
this.bridge.emit(`component:${event.componentId}:${event.eventType}`, event.data);
|
|
2410
|
-
}
|
|
2411
|
-
}
|
|
2412
|
-
async createSidebar(config) {
|
|
2413
|
-
const id = await this.bridge.request("component.createSidebar", config);
|
|
2414
|
-
this.components.set(id, { id, type: "sidebar", props: config });
|
|
2415
|
-
return id;
|
|
2416
|
-
}
|
|
2417
|
-
async createFileBrowser(config) {
|
|
2418
|
-
const id = await this.bridge.request("component.createFileBrowser", config);
|
|
2419
|
-
this.components.set(id, { id, type: "fileBrowser", props: config });
|
|
2420
|
-
return id;
|
|
2421
|
-
}
|
|
2422
|
-
async createSplitView(config) {
|
|
2423
|
-
const id = await this.bridge.request("component.createSplitView", config);
|
|
2424
|
-
this.components.set(id, { id, type: "splitView", props: config });
|
|
2425
|
-
return id;
|
|
2426
|
-
}
|
|
2427
|
-
async updateComponent(componentId, props) {
|
|
2428
|
-
const component = this.components.get(componentId);
|
|
2429
|
-
if (component) {
|
|
2430
|
-
component.props = { ...component.props, ...props };
|
|
2431
|
-
}
|
|
2432
|
-
await this.bridge.request("component.update", { componentId, props });
|
|
2433
|
-
}
|
|
2434
|
-
async destroyComponent(componentId) {
|
|
2435
|
-
this.components.delete(componentId);
|
|
2436
|
-
await this.bridge.request("component.destroy", { componentId });
|
|
2437
|
-
}
|
|
2438
|
-
onComponentEvent(componentId, eventType, callback) {
|
|
2439
|
-
const eventName = `component:${componentId}:${eventType}`;
|
|
2440
|
-
this.bridge.on(eventName, callback);
|
|
2441
|
-
return () => this.bridge.off(eventName, callback);
|
|
2442
|
-
}
|
|
2443
|
-
async getFileBrowserSelection(componentId) {
|
|
2444
|
-
return this.bridge.request("component.getFileBrowserSelection", { componentId });
|
|
2445
|
-
}
|
|
2446
|
-
}
|
|
2447
2462
|
var globalBridge = null;
|
|
2448
2463
|
var globalBridgeConfig = null;
|
|
2449
2464
|
function getBridge(config) {
|
|
@@ -2512,8 +2527,8 @@ function isDesktopWebViewHost() {
|
|
|
2512
2527
|
return true;
|
|
2513
2528
|
if (typeof window === "undefined")
|
|
2514
2529
|
return false;
|
|
2515
|
-
const
|
|
2516
|
-
return typeof
|
|
2530
|
+
const host = window;
|
|
2531
|
+
return typeof host.chrome?.webview?.postMessage === "function";
|
|
2517
2532
|
}
|
|
2518
2533
|
function postWebKit(message) {
|
|
2519
2534
|
if (!isWebKitHost())
|
|
@@ -2531,13 +2546,13 @@ function webkitRequest(bucket, message, options = {}) {
|
|
|
2531
2546
|
return new Promise((resolve, reject) => {
|
|
2532
2547
|
let settled = false;
|
|
2533
2548
|
const list = w.__craftBridgePending[bucket] = w.__craftBridgePending[bucket] || [];
|
|
2534
|
-
let
|
|
2549
|
+
let timer;
|
|
2535
2550
|
const entry = {
|
|
2536
2551
|
resolve: (v) => {
|
|
2537
2552
|
if (settled)
|
|
2538
2553
|
return;
|
|
2539
2554
|
settled = true;
|
|
2540
|
-
clearTimeout(
|
|
2555
|
+
clearTimeout(timer);
|
|
2541
2556
|
const idx = list.indexOf(entry);
|
|
2542
2557
|
if (idx >= 0)
|
|
2543
2558
|
list.splice(idx, 1);
|
|
@@ -2547,7 +2562,7 @@ function webkitRequest(bucket, message, options = {}) {
|
|
|
2547
2562
|
if (settled)
|
|
2548
2563
|
return;
|
|
2549
2564
|
settled = true;
|
|
2550
|
-
clearTimeout(
|
|
2565
|
+
clearTimeout(timer);
|
|
2551
2566
|
const idx = list.indexOf(entry);
|
|
2552
2567
|
if (idx >= 0)
|
|
2553
2568
|
list.splice(idx, 1);
|
|
@@ -2555,7 +2570,7 @@ function webkitRequest(bucket, message, options = {}) {
|
|
|
2555
2570
|
}
|
|
2556
2571
|
};
|
|
2557
2572
|
list.push(entry);
|
|
2558
|
-
|
|
2573
|
+
timer = setTimeout(() => {
|
|
2559
2574
|
entry.reject(new Error(`[WKWebView] ${bucket} timed out after ${timeoutMs}ms`));
|
|
2560
2575
|
}, timeoutMs);
|
|
2561
2576
|
try {
|
|
@@ -2887,8 +2902,8 @@ class WindowManager {
|
|
|
2887
2902
|
if (!injected?._call) {
|
|
2888
2903
|
throw new Error("Craft window bridge is unavailable");
|
|
2889
2904
|
}
|
|
2890
|
-
const
|
|
2891
|
-
return
|
|
2905
|
+
const id = await injected._call("getFocused", undefined, "main");
|
|
2906
|
+
return id ? this._windows.get(id) || null : null;
|
|
2892
2907
|
}
|
|
2893
2908
|
const bridge = getBridge();
|
|
2894
2909
|
const id = await bridge.request("window.getFocused");
|
|
@@ -3625,9 +3640,9 @@ function base64ToUint8(base64) {
|
|
|
3625
3640
|
var fs = {
|
|
3626
3641
|
async readFile(path) {
|
|
3627
3642
|
validatePath(path);
|
|
3628
|
-
const
|
|
3629
|
-
if (
|
|
3630
|
-
return
|
|
3643
|
+
const native = getCraftFs();
|
|
3644
|
+
if (native)
|
|
3645
|
+
return native.readFile(path);
|
|
3631
3646
|
if (typeof window !== "undefined" && window.craft) {
|
|
3632
3647
|
return callBridge("fs.readFile", { path });
|
|
3633
3648
|
}
|
|
@@ -3636,9 +3651,9 @@ var fs = {
|
|
|
3636
3651
|
},
|
|
3637
3652
|
async writeFile(path, content) {
|
|
3638
3653
|
validatePath(path);
|
|
3639
|
-
const
|
|
3640
|
-
if (
|
|
3641
|
-
return
|
|
3654
|
+
const native = getCraftFs();
|
|
3655
|
+
if (native)
|
|
3656
|
+
return native.writeFile(path, content);
|
|
3642
3657
|
if (typeof window !== "undefined" && window.craft) {
|
|
3643
3658
|
await callBridge("fs.writeFile", { path, content });
|
|
3644
3659
|
return;
|
|
@@ -3649,9 +3664,9 @@ var fs = {
|
|
|
3649
3664
|
async readDir(path) {
|
|
3650
3665
|
validatePath(path);
|
|
3651
3666
|
const filter = (xs) => xs.filter((n) => n !== "." && n !== "..");
|
|
3652
|
-
const
|
|
3653
|
-
if (
|
|
3654
|
-
return filter(await
|
|
3667
|
+
const native = getCraftFs();
|
|
3668
|
+
if (native)
|
|
3669
|
+
return filter(await native.readDir(path));
|
|
3655
3670
|
if (typeof window !== "undefined" && window.craft) {
|
|
3656
3671
|
return filter(await callBridge("fs.readDir", { path }));
|
|
3657
3672
|
}
|
|
@@ -3660,9 +3675,9 @@ var fs = {
|
|
|
3660
3675
|
},
|
|
3661
3676
|
async mkdir(path) {
|
|
3662
3677
|
validatePath(path);
|
|
3663
|
-
const
|
|
3664
|
-
if (
|
|
3665
|
-
return
|
|
3678
|
+
const native = getCraftFs();
|
|
3679
|
+
if (native)
|
|
3680
|
+
return native.mkdir(path);
|
|
3666
3681
|
if (typeof window !== "undefined" && window.craft) {
|
|
3667
3682
|
await callBridge("fs.mkdir", { path });
|
|
3668
3683
|
return;
|
|
@@ -3672,9 +3687,9 @@ var fs = {
|
|
|
3672
3687
|
},
|
|
3673
3688
|
async remove(path) {
|
|
3674
3689
|
validatePath(path);
|
|
3675
|
-
const
|
|
3676
|
-
if (
|
|
3677
|
-
return
|
|
3690
|
+
const native = getCraftFs();
|
|
3691
|
+
if (native)
|
|
3692
|
+
return native.remove(path);
|
|
3678
3693
|
if (typeof window !== "undefined" && window.craft) {
|
|
3679
3694
|
await callBridge("fs.remove", { path });
|
|
3680
3695
|
return;
|
|
@@ -3684,9 +3699,9 @@ var fs = {
|
|
|
3684
3699
|
},
|
|
3685
3700
|
async exists(path) {
|
|
3686
3701
|
validatePath(path);
|
|
3687
|
-
const
|
|
3688
|
-
if (
|
|
3689
|
-
return
|
|
3702
|
+
const native = getCraftFs();
|
|
3703
|
+
if (native)
|
|
3704
|
+
return native.exists(path);
|
|
3690
3705
|
if (typeof window !== "undefined" && window.craft) {
|
|
3691
3706
|
return callBridge("fs.exists", { path });
|
|
3692
3707
|
}
|
|
@@ -3771,9 +3786,9 @@ var _watchRecursiveWarned = false;
|
|
|
3771
3786
|
async function watch(path, callback, options = {}) {
|
|
3772
3787
|
validatePath(path);
|
|
3773
3788
|
const recursive = options.recursive ?? true;
|
|
3774
|
-
const
|
|
3775
|
-
if (
|
|
3776
|
-
const handle = await
|
|
3789
|
+
const native = getCraftFs();
|
|
3790
|
+
if (native?.watch) {
|
|
3791
|
+
const handle = await native.watch(path, (event) => callback(event.type, event.path), { recursive });
|
|
3777
3792
|
return () => {
|
|
3778
3793
|
handle.unwatch();
|
|
3779
3794
|
};
|
|
@@ -4006,8 +4021,8 @@ class Database {
|
|
|
4006
4021
|
class KeyValueStore {
|
|
4007
4022
|
db;
|
|
4008
4023
|
tableName;
|
|
4009
|
-
constructor(
|
|
4010
|
-
this.db =
|
|
4024
|
+
constructor(db, tableName = "kv_store") {
|
|
4025
|
+
this.db = db;
|
|
4011
4026
|
this.tableName = tableName;
|
|
4012
4027
|
}
|
|
4013
4028
|
async init() {
|
|
@@ -4368,8 +4383,8 @@ var crypto = {
|
|
|
4368
4383
|
if (!hasNodeCrypto) {
|
|
4369
4384
|
throw new CraftCryptoError("MD5 is not available in this runtime — WebCrypto does not implement it. " + "Use sha256/sha512, or call this from Node.");
|
|
4370
4385
|
}
|
|
4371
|
-
const { createHash
|
|
4372
|
-
return
|
|
4386
|
+
const { createHash } = await import("node:crypto");
|
|
4387
|
+
return createHash("md5").update(data).digest("hex");
|
|
4373
4388
|
}
|
|
4374
4389
|
if (typeof globalThis.crypto !== "undefined" && globalThis.crypto.subtle) {
|
|
4375
4390
|
const encoder = new TextEncoder;
|
|
@@ -4377,8 +4392,8 @@ var crypto = {
|
|
|
4377
4392
|
const hashBuffer = await globalThis.crypto.subtle.digest(algorithm === "sha256" ? "SHA-256" : "SHA-512", dataBuffer);
|
|
4378
4393
|
return bufferToHex(hashBuffer);
|
|
4379
4394
|
}
|
|
4380
|
-
const { createHash
|
|
4381
|
-
return
|
|
4395
|
+
const { createHash } = await import("node:crypto");
|
|
4396
|
+
return createHash(algorithm).update(data).digest("hex");
|
|
4382
4397
|
},
|
|
4383
4398
|
async encrypt(data, key) {
|
|
4384
4399
|
if (typeof window !== "undefined" && window.craft?.crypto) {
|
|
@@ -4403,8 +4418,8 @@ var crypto = {
|
|
|
4403
4418
|
if (combined.length < 1 + SALT_LEN + IV_LEN + TAG_LEN) {
|
|
4404
4419
|
throw new CraftCryptoError("Ciphertext too short to be valid");
|
|
4405
4420
|
}
|
|
4406
|
-
const
|
|
4407
|
-
if (
|
|
4421
|
+
const version = combined[0];
|
|
4422
|
+
if (version !== FORMAT_VERSION) {
|
|
4408
4423
|
throw new LegacyCiphertextError;
|
|
4409
4424
|
}
|
|
4410
4425
|
const salt = combined.slice(1, 1 + SALT_LEN);
|
|
@@ -4443,11 +4458,11 @@ async function aesGcmEncrypt(key, iv, plaintext) {
|
|
|
4443
4458
|
const ct1 = cipher.update(plaintext);
|
|
4444
4459
|
const ct2 = cipher.final();
|
|
4445
4460
|
const tag = cipher.getAuthTag();
|
|
4446
|
-
const
|
|
4447
|
-
|
|
4448
|
-
|
|
4449
|
-
|
|
4450
|
-
return
|
|
4461
|
+
const out = new Uint8Array(ct1.length + ct2.length + tag.length);
|
|
4462
|
+
out.set(ct1, 0);
|
|
4463
|
+
out.set(ct2, ct1.length);
|
|
4464
|
+
out.set(tag, ct1.length + ct2.length);
|
|
4465
|
+
return out;
|
|
4451
4466
|
}
|
|
4452
4467
|
const out = await globalThis.crypto.subtle.encrypt({ name: "AES-GCM", iv: asBufferSource(iv) }, key, asBufferSource(plaintext));
|
|
4453
4468
|
return new Uint8Array(out);
|
|
@@ -4461,10 +4476,10 @@ async function aesGcmDecrypt(key, iv, ciphertextWithTag) {
|
|
|
4461
4476
|
decipher.setAuthTag(tag);
|
|
4462
4477
|
const pt1 = decipher.update(ct);
|
|
4463
4478
|
const pt2 = decipher.final();
|
|
4464
|
-
const
|
|
4465
|
-
|
|
4466
|
-
|
|
4467
|
-
return
|
|
4479
|
+
const out = new Uint8Array(pt1.length + pt2.length);
|
|
4480
|
+
out.set(pt1, 0);
|
|
4481
|
+
out.set(pt2, pt1.length);
|
|
4482
|
+
return out;
|
|
4468
4483
|
}
|
|
4469
4484
|
const out = await globalThis.crypto.subtle.decrypt({ name: "AES-GCM", iv: asBufferSource(iv) }, key, asBufferSource(ciphertextWithTag));
|
|
4470
4485
|
return new Uint8Array(out);
|
|
@@ -4849,9 +4864,9 @@ async function tempDir() {
|
|
|
4849
4864
|
}
|
|
4850
4865
|
function exit(code = 0) {
|
|
4851
4866
|
if (typeof window !== "undefined") {
|
|
4852
|
-
const
|
|
4853
|
-
if (
|
|
4854
|
-
|
|
4867
|
+
const app = window.craft?.app;
|
|
4868
|
+
if (app && typeof app.quit === "function") {
|
|
4869
|
+
app.quit(code);
|
|
4855
4870
|
return;
|
|
4856
4871
|
}
|
|
4857
4872
|
}
|
|
@@ -4873,18 +4888,18 @@ async function open(target) {
|
|
|
4873
4888
|
const platform = getPlatform();
|
|
4874
4889
|
const { execFile } = await import("node:child_process");
|
|
4875
4890
|
const { promisify } = await import("node:util");
|
|
4876
|
-
const
|
|
4891
|
+
const exec = promisify(execFile);
|
|
4877
4892
|
switch (platform) {
|
|
4878
4893
|
case "darwin":
|
|
4879
4894
|
case "macos":
|
|
4880
|
-
await
|
|
4895
|
+
await exec("open", [target]);
|
|
4881
4896
|
return;
|
|
4882
4897
|
case "win32":
|
|
4883
4898
|
case "windows":
|
|
4884
|
-
await
|
|
4899
|
+
await exec("cmd.exe", ["/c", "start", '""', target]);
|
|
4885
4900
|
return;
|
|
4886
4901
|
case "linux":
|
|
4887
|
-
await
|
|
4902
|
+
await exec("xdg-open", [target]);
|
|
4888
4903
|
return;
|
|
4889
4904
|
default:
|
|
4890
4905
|
throw new Error(`Unsupported platform: ${platform}`);
|
|
@@ -5224,10 +5239,10 @@ var secureStorage = {
|
|
|
5224
5239
|
}
|
|
5225
5240
|
};
|
|
5226
5241
|
function storageHost(method) {
|
|
5227
|
-
const
|
|
5228
|
-
if (typeof
|
|
5242
|
+
const host = getCraftRoot()?.storage;
|
|
5243
|
+
if (typeof host?.[method] !== "function")
|
|
5229
5244
|
throw Object.assign(new Error("This host does not provide native storage"), { code: "STORAGE_UNSUPPORTED" });
|
|
5230
|
-
return
|
|
5245
|
+
return host;
|
|
5231
5246
|
}
|
|
5232
5247
|
var storage2 = {
|
|
5233
5248
|
supportsSetIfAbsent() {
|
|
@@ -7268,13 +7283,13 @@ var media = {
|
|
|
7268
7283
|
return _hasMediaAccess("microphone", "audioinput");
|
|
7269
7284
|
},
|
|
7270
7285
|
async requestPermission(options = {}) {
|
|
7271
|
-
const { camera
|
|
7272
|
-
if (!
|
|
7286
|
+
const { camera = false, microphone = false } = options;
|
|
7287
|
+
if (!camera && !microphone) {
|
|
7273
7288
|
return true;
|
|
7274
7289
|
}
|
|
7275
7290
|
try {
|
|
7276
7291
|
const stream = await this.getMediaStream({
|
|
7277
|
-
video:
|
|
7292
|
+
video: camera,
|
|
7278
7293
|
audio: microphone
|
|
7279
7294
|
});
|
|
7280
7295
|
stream.getTracks().forEach((track) => track.stop());
|
|
@@ -7903,47 +7918,6 @@ function onSwipe(listener) {
|
|
|
7903
7918
|
return gestures.onSwipe(listener);
|
|
7904
7919
|
}
|
|
7905
7920
|
var gestures = { hasNativeGestures, onSwipe };
|
|
7906
|
-
// src/components/index.ts
|
|
7907
|
-
var exports_components = {};
|
|
7908
|
-
__export(exports_components, {
|
|
7909
|
-
updateTouchBarItem: () => updateTouchBarItem,
|
|
7910
|
-
updateToolbarItem: () => updateToolbarItem,
|
|
7911
|
-
tahoeStyle: () => tahoeStyle,
|
|
7912
|
-
sidebarSeparator: () => sidebarSeparator,
|
|
7913
|
-
sidebarSection: () => sidebarSection,
|
|
7914
|
-
sidebarItem: () => sidebarItem,
|
|
7915
|
-
showQuickLook: () => showQuickLook,
|
|
7916
|
-
showFontPicker: () => showFontPicker,
|
|
7917
|
-
showDatePicker: () => showDatePicker,
|
|
7918
|
-
showColorPicker: () => showColorPicker,
|
|
7919
|
-
setTouchBar: () => setTouchBar,
|
|
7920
|
-
setToolbarVisible: () => setToolbarVisible,
|
|
7921
|
-
setToolbar: () => setToolbar,
|
|
7922
|
-
orbstackStyle: () => orbstackStyle,
|
|
7923
|
-
hideQuickLook: () => hideQuickLook,
|
|
7924
|
-
default: () => components_default,
|
|
7925
|
-
createTahoeSidebar: () => createTahoeSidebar,
|
|
7926
|
-
createTableView: () => createTableView,
|
|
7927
|
-
createSplitView: () => createSplitView,
|
|
7928
|
-
createSidebar: () => createSidebar2,
|
|
7929
|
-
createProgress: () => createProgress,
|
|
7930
|
-
createOutlineView: () => createOutlineView,
|
|
7931
|
-
createOrbStackSidebar: () => createOrbStackSidebar,
|
|
7932
|
-
createFileBrowser: () => createFileBrowser,
|
|
7933
|
-
createArcSidebar: () => createArcSidebar,
|
|
7934
|
-
canQuickLook: () => canQuickLook,
|
|
7935
|
-
arcStyle: () => arcStyle,
|
|
7936
|
-
TableViewInstance: () => TableViewInstance,
|
|
7937
|
-
StyleSheet: () => StyleSheet,
|
|
7938
|
-
SplitViewInstance: () => SplitViewInstance,
|
|
7939
|
-
Sidebar: () => Sidebar2,
|
|
7940
|
-
ProgressInstance: () => ProgressInstance,
|
|
7941
|
-
Platform: () => Platform,
|
|
7942
|
-
OutlineViewInstance: () => OutlineViewInstance,
|
|
7943
|
-
FileBrowserInstance: () => FileBrowserInstance,
|
|
7944
|
-
Animated: () => Animated
|
|
7945
|
-
});
|
|
7946
|
-
|
|
7947
7921
|
// src/components/sidebar.ts
|
|
7948
7922
|
var tahoeStyle = {
|
|
7949
7923
|
style: "tahoe",
|
|
@@ -9151,9 +9125,9 @@ async function buildCSS(options) {
|
|
|
9151
9125
|
console.warn("buildCSS can only be run in Node.js environment");
|
|
9152
9126
|
return;
|
|
9153
9127
|
}
|
|
9154
|
-
const { exec
|
|
9128
|
+
const { exec } = await import("child_process");
|
|
9155
9129
|
const { promisify } = await import("util");
|
|
9156
|
-
const execAsync = promisify(
|
|
9130
|
+
const execAsync = promisify(exec);
|
|
9157
9131
|
const args = [
|
|
9158
9132
|
"build",
|
|
9159
9133
|
"--content",
|
|
@@ -9783,9 +9757,9 @@ function renderArcSidebar(data, collapsed = false) {
|
|
|
9783
9757
|
const renderItem = (item) => {
|
|
9784
9758
|
const isSelected = item.selected;
|
|
9785
9759
|
if (collapsed) {
|
|
9786
|
-
const
|
|
9760
|
+
const itemClass = isSelected ? s.itemCollapsedSelected : s.itemCollapsed;
|
|
9787
9761
|
return `
|
|
9788
|
-
<div class='${
|
|
9762
|
+
<div class='${itemClass}' data-id='${item.id}'>
|
|
9789
9763
|
<span class="${isSelected ? s.itemFaviconSelected : s.itemFavicon}">
|
|
9790
9764
|
${item.icon ? getIcon2(item.icon) : ""}
|
|
9791
9765
|
</span>
|
|
@@ -10032,15 +10006,15 @@ var orbstackDemoData = {
|
|
|
10032
10006
|
}
|
|
10033
10007
|
]
|
|
10034
10008
|
};
|
|
10035
|
-
function getFullPageHTML(sidebarHTML,
|
|
10036
|
-
const bgClass =
|
|
10009
|
+
function getFullPageHTML(sidebarHTML, style) {
|
|
10010
|
+
const bgClass = style === "orbstack" ? "bg-[#0f0f0f]" : "bg-neutral-50 dark:bg-neutral-900";
|
|
10037
10011
|
return `
|
|
10038
10012
|
<!DOCTYPE html>
|
|
10039
|
-
<html lang="en" class="${
|
|
10013
|
+
<html lang="en" class="${style === "orbstack" ? "dark" : ""}">
|
|
10040
10014
|
<head>
|
|
10041
10015
|
<meta charset='UTF-8'>
|
|
10042
10016
|
<meta name='viewport' content='width=device-width, initial-scale=1.0'>
|
|
10043
|
-
<title>Craft Sidebar - ${
|
|
10017
|
+
<title>Craft Sidebar - ${style}</title>
|
|
10044
10018
|
<script src='https://cdn.tailwindcss.com'></script>
|
|
10045
10019
|
<style>
|
|
10046
10020
|
/* Custom scrollbar */
|
|
@@ -10147,20 +10121,20 @@ var reactOptimizations = {
|
|
|
10147
10121
|
}
|
|
10148
10122
|
};
|
|
10149
10123
|
var vueOptimizations = {
|
|
10150
|
-
configureProduction(
|
|
10151
|
-
if (!
|
|
10124
|
+
configureProduction(app, config = {}) {
|
|
10125
|
+
if (!app?.config)
|
|
10152
10126
|
return;
|
|
10153
|
-
if (!config.enableDevTools &&
|
|
10154
|
-
|
|
10127
|
+
if (!config.enableDevTools && app.config.devtools !== undefined) {
|
|
10128
|
+
app.config.devtools = false;
|
|
10155
10129
|
}
|
|
10156
|
-
if (
|
|
10157
|
-
|
|
10130
|
+
if (app.config.performance !== undefined) {
|
|
10131
|
+
app.config.performance = config.performance || false;
|
|
10158
10132
|
}
|
|
10159
10133
|
if (config.errorHandler) {
|
|
10160
|
-
|
|
10134
|
+
app.config.errorHandler = config.errorHandler;
|
|
10161
10135
|
}
|
|
10162
10136
|
if (config.warnHandler) {
|
|
10163
|
-
|
|
10137
|
+
app.config.warnHandler = config.warnHandler;
|
|
10164
10138
|
}
|
|
10165
10139
|
},
|
|
10166
10140
|
createAsyncConfig(options = {}) {
|
|
@@ -10462,24 +10436,6 @@ var commonOptimizations = {
|
|
|
10462
10436
|
}
|
|
10463
10437
|
};
|
|
10464
10438
|
// src/updater/index.ts
|
|
10465
|
-
var exports_updater = {};
|
|
10466
|
-
__export(exports_updater, {
|
|
10467
|
-
verifyBundleTrust: () => verifyBundleTrust,
|
|
10468
|
-
updaterCommand: () => updaterCommand,
|
|
10469
|
-
swapBundle: () => swapBundle,
|
|
10470
|
-
readBundleIdentity: () => readBundleIdentity,
|
|
10471
|
-
isMacOS: () => isMacOS,
|
|
10472
|
-
generateUpdateManifest: () => generateUpdateManifest,
|
|
10473
|
-
extractBundleFromZip: () => extractBundleFromZip,
|
|
10474
|
-
extractBundleFromDmg: () => extractBundleFromDmg,
|
|
10475
|
-
extractBundle: () => extractBundle,
|
|
10476
|
-
dittoBundle: () => dittoBundle,
|
|
10477
|
-
default: () => updater_default,
|
|
10478
|
-
clearQuarantine: () => clearQuarantine,
|
|
10479
|
-
canReplaceBundle: () => canReplaceBundle,
|
|
10480
|
-
DeltaGenerator: () => DeltaGenerator,
|
|
10481
|
-
AutoUpdater: () => AutoUpdater
|
|
10482
|
-
});
|
|
10483
10439
|
var import_fs4 = require("fs");
|
|
10484
10440
|
var import_path3 = require("path");
|
|
10485
10441
|
var import_os2 = require("os");
|
|
@@ -10936,8 +10892,8 @@ class AutoUpdater extends import_events3.EventEmitter {
|
|
|
10936
10892
|
throw new Error("No update downloaded");
|
|
10937
10893
|
}
|
|
10938
10894
|
if (this.updateInfo) {
|
|
10939
|
-
const
|
|
10940
|
-
const platformUpdate = this.updateInfo.platforms[
|
|
10895
|
+
const platform = this.getPlatform();
|
|
10896
|
+
const platformUpdate = this.updateInfo.platforms[platform];
|
|
10941
10897
|
if (platformUpdate) {
|
|
10942
10898
|
const hash = await this.computeFileHash(this.downloadPath);
|
|
10943
10899
|
if (hash !== platformUpdate.sha256) {
|
|
@@ -11063,8 +11019,8 @@ class AutoUpdater extends import_events3.EventEmitter {
|
|
|
11063
11019
|
const downloadPath = this.downloadPath;
|
|
11064
11020
|
if (downloadPath.endsWith(".AppImage")) {
|
|
11065
11021
|
import_child_process3.execFileSync("chmod", ["+x", downloadPath]);
|
|
11066
|
-
const { renameSync
|
|
11067
|
-
|
|
11022
|
+
const { renameSync } = await import("fs");
|
|
11023
|
+
renameSync(downloadPath, this.config.appPath);
|
|
11068
11024
|
} else if (downloadPath.endsWith(".deb")) {
|
|
11069
11025
|
import_child_process3.execFileSync("sudo", ["dpkg", "-i", downloadPath]);
|
|
11070
11026
|
} else if (downloadPath.endsWith(".rpm")) {
|
|
@@ -11247,14 +11203,14 @@ async function updaterCommand(args) {
|
|
|
11247
11203
|
switch (subcommand) {
|
|
11248
11204
|
case "check": {
|
|
11249
11205
|
const url = rest[0];
|
|
11250
|
-
const
|
|
11206
|
+
const version = rest[1] || "0.0.0";
|
|
11251
11207
|
if (!url) {
|
|
11252
11208
|
console.error("Usage: craft updater check <update-url> [current-version]");
|
|
11253
11209
|
process.exit(1);
|
|
11254
11210
|
}
|
|
11255
11211
|
const updater = new AutoUpdater({
|
|
11256
11212
|
updateUrl: url,
|
|
11257
|
-
currentVersion:
|
|
11213
|
+
currentVersion: version,
|
|
11258
11214
|
appPath: process.cwd(),
|
|
11259
11215
|
autoDownload: false
|
|
11260
11216
|
});
|
|
@@ -11288,14 +11244,14 @@ ${update.releaseNotes}`);
|
|
|
11288
11244
|
break;
|
|
11289
11245
|
}
|
|
11290
11246
|
case "generate-manifest": {
|
|
11291
|
-
const
|
|
11247
|
+
const version = rest[0];
|
|
11292
11248
|
const outputPath = rest[1] || "update.json";
|
|
11293
|
-
if (!
|
|
11249
|
+
if (!version) {
|
|
11294
11250
|
console.error("Usage: craft updater generate-manifest <version> [output]");
|
|
11295
11251
|
process.exit(1);
|
|
11296
11252
|
}
|
|
11297
11253
|
const manifest = {
|
|
11298
|
-
version
|
|
11254
|
+
version,
|
|
11299
11255
|
releaseDate: new Date().toISOString(),
|
|
11300
11256
|
platforms: {}
|
|
11301
11257
|
};
|