craft-native 0.0.107 → 0.0.109
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/cli.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/types.d.ts +43 -0
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -3303,7 +3303,7 @@ function pinCraftNativeDependency(packagePath, craftVersion) {
|
|
|
3303
3303
|
`);
|
|
3304
3304
|
}
|
|
3305
3305
|
// package.json
|
|
3306
|
-
var version = "0.0.
|
|
3306
|
+
var version = "0.0.109";
|
|
3307
3307
|
|
|
3308
3308
|
// bin/cli.ts
|
|
3309
3309
|
var spawnedFrom = process6.env[CRAFT_CLI_SPAWN_MARKER];
|
package/dist/index.cjs
CHANGED
package/dist/index.d.cts
CHANGED
|
@@ -81,4 +81,4 @@ export declare function show(html: string, options?: WindowOptions): Promise<voi
|
|
|
81
81
|
* Quick helper to load a URL
|
|
82
82
|
*/
|
|
83
83
|
export declare function loadURL(url: string, options?: WindowOptions): Promise<void>;
|
|
84
|
-
export type { WindowOptions, CraftSidebarAPI, AppConfig, CraftTrayAPI, CraftWindowAPI, CraftAppAPI, CraftBridgeAPI, Permission, HapticType, CameraOptions, PhotoPickerOptions, CraftMobileAPI, CraftFileSystemAPI, CraftDatabaseAPI, CraftHttpAPI, CraftCryptoAPI, CraftCapabilities, CapabilityNamespace, CapabilityNamespaceStatus, CapabilityAction, CraftPreferencesAPI, CraftPreferencesInfo, CraftSettingsAPI, PreferenceValue, CraftEventType, CraftEventMap, CraftEventHandler, CraftEventEmitter, IOSConfig, AndroidConfig, MacOSConfig, WindowsConfig, LinuxConfig, CraftAppConfig, } from './types.js';
|
|
84
|
+
export type { WindowOptions, CraftSidebarAPI, CraftNativeUIAPI, CraftContextMenuItem, CraftContextMenuResult, AppConfig, CraftTrayAPI, CraftWindowAPI, CraftAppAPI, CraftBridgeAPI, Permission, HapticType, CameraOptions, PhotoPickerOptions, CraftMobileAPI, CraftFileSystemAPI, CraftDatabaseAPI, CraftHttpAPI, CraftCryptoAPI, CraftCapabilities, CapabilityNamespace, CapabilityNamespaceStatus, CapabilityAction, CraftPreferencesAPI, CraftPreferencesInfo, CraftSettingsAPI, PreferenceValue, CraftEventType, CraftEventMap, CraftEventHandler, CraftEventEmitter, IOSConfig, AndroidConfig, MacOSConfig, WindowsConfig, LinuxConfig, CraftAppConfig, } from './types.js';
|
package/dist/index.d.ts
CHANGED
|
@@ -81,4 +81,4 @@ export declare function show(html: string, options?: WindowOptions): Promise<voi
|
|
|
81
81
|
* Quick helper to load a URL
|
|
82
82
|
*/
|
|
83
83
|
export declare function loadURL(url: string, options?: WindowOptions): Promise<void>;
|
|
84
|
-
export type { WindowOptions, CraftSidebarAPI, AppConfig, CraftTrayAPI, CraftWindowAPI, CraftAppAPI, CraftBridgeAPI, Permission, HapticType, CameraOptions, PhotoPickerOptions, CraftMobileAPI, CraftFileSystemAPI, CraftDatabaseAPI, CraftHttpAPI, CraftCryptoAPI, CraftCapabilities, CapabilityNamespace, CapabilityNamespaceStatus, CapabilityAction, CraftPreferencesAPI, CraftPreferencesInfo, CraftSettingsAPI, PreferenceValue, CraftEventType, CraftEventMap, CraftEventHandler, CraftEventEmitter, IOSConfig, AndroidConfig, MacOSConfig, WindowsConfig, LinuxConfig, CraftAppConfig, } from './types.js';
|
|
84
|
+
export type { WindowOptions, CraftSidebarAPI, CraftNativeUIAPI, CraftContextMenuItem, CraftContextMenuResult, AppConfig, CraftTrayAPI, CraftWindowAPI, CraftAppAPI, CraftBridgeAPI, Permission, HapticType, CameraOptions, PhotoPickerOptions, CraftMobileAPI, CraftFileSystemAPI, CraftDatabaseAPI, CraftHttpAPI, CraftCryptoAPI, CraftCapabilities, CapabilityNamespace, CapabilityNamespaceStatus, CapabilityAction, CraftPreferencesAPI, CraftPreferencesInfo, CraftSettingsAPI, PreferenceValue, CraftEventType, CraftEventMap, CraftEventHandler, CraftEventEmitter, IOSConfig, AndroidConfig, MacOSConfig, WindowsConfig, LinuxConfig, CraftAppConfig, } from './types.js';
|
package/dist/index.js
CHANGED
package/dist/types.d.ts
CHANGED
|
@@ -1062,6 +1062,44 @@ export interface CraftWindowControls {
|
|
|
1062
1062
|
*/
|
|
1063
1063
|
replicas: 'none' | null;
|
|
1064
1064
|
}
|
|
1065
|
+
/** One row of a native context menu. */
|
|
1066
|
+
export interface CraftContextMenuItem {
|
|
1067
|
+
id: string;
|
|
1068
|
+
title: string;
|
|
1069
|
+
/** `'separator'` draws a divider; `'submenu'` nests `submenu` one level. */
|
|
1070
|
+
type?: 'standard' | 'separator' | 'submenu';
|
|
1071
|
+
/** SF Symbol name, e.g. `'archivebox'`. */
|
|
1072
|
+
icon?: string;
|
|
1073
|
+
/**
|
|
1074
|
+
* `'cmd+e'`, `'cmd+delete'`, `'cmd+shift+up'`: modifiers, then a character
|
|
1075
|
+
* or a key name (delete, forwarddelete, return, escape, tab, space, up,
|
|
1076
|
+
* down, left, right, home, end, pageup, pagedown, f1-f12, plus, minus).
|
|
1077
|
+
*/
|
|
1078
|
+
shortcut?: string;
|
|
1079
|
+
enabled?: boolean;
|
|
1080
|
+
submenu?: CraftContextMenuItem[];
|
|
1081
|
+
}
|
|
1082
|
+
/** How a context menu closed. `id` is null when it was dismissed. */
|
|
1083
|
+
export interface CraftContextMenuResult {
|
|
1084
|
+
id: string | null;
|
|
1085
|
+
targetId: string;
|
|
1086
|
+
targetType: string;
|
|
1087
|
+
}
|
|
1088
|
+
export interface CraftNativeUIAPI {
|
|
1089
|
+
/**
|
|
1090
|
+
* Open a native context menu at the page point `x`/`y` (an event's
|
|
1091
|
+
* `clientX`/`clientY`). Resolves when the menu closes.
|
|
1092
|
+
*/
|
|
1093
|
+
showContextMenu: (options: {
|
|
1094
|
+
items: CraftContextMenuItem[];
|
|
1095
|
+
x: number;
|
|
1096
|
+
y: number;
|
|
1097
|
+
targetId?: string;
|
|
1098
|
+
targetType?: string;
|
|
1099
|
+
}) => Promise<CraftContextMenuResult>;
|
|
1100
|
+
/** Every context menu's outcome. Returns an unsubscribe function. */
|
|
1101
|
+
onContextMenuAction: (callback: (result: CraftContextMenuResult) => void) => () => void;
|
|
1102
|
+
}
|
|
1065
1103
|
export interface CraftBridgeAPI {
|
|
1066
1104
|
/**
|
|
1067
1105
|
* Where the platform drew this window's close/minimise/zoom buttons.
|
|
@@ -1111,6 +1149,11 @@ export interface CraftBridgeAPI {
|
|
|
1111
1149
|
* Native sidebar APIs (macOS)
|
|
1112
1150
|
*/
|
|
1113
1151
|
sidebar?: CraftSidebarAPI;
|
|
1152
|
+
/**
|
|
1153
|
+
* Native AppKit controls the page can open (macOS). Also reachable as
|
|
1154
|
+
* `craft.components`.
|
|
1155
|
+
*/
|
|
1156
|
+
nativeUI?: CraftNativeUIAPI;
|
|
1114
1157
|
/**
|
|
1115
1158
|
* Crypto APIs
|
|
1116
1159
|
*/
|