expo-invoke 1.0.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/MIGRATION.md +125 -0
- package/README.md +942 -0
- package/SECURITY.md +35 -0
- package/android/build.gradle +42 -0
- package/android/src/main/java/expo/modules/invoke/AppActionsHandler.kt +74 -0
- package/android/src/main/java/expo/modules/invoke/ExpoInvokeModule.kt +135 -0
- package/android/src/main/java/expo/modules/invoke/QuickTileService.kt +63 -0
- package/android/src/main/java/expo/modules/invoke/ShortcutsHelper.kt +72 -0
- package/build/cli/commands/generate.d.ts +1 -0
- package/build/cli/commands/generate.js +119 -0
- package/build/cli/commands/generate.js.map +1 -0
- package/build/cli/commands/test.d.ts +1 -0
- package/build/cli/commands/test.js +53 -0
- package/build/cli/commands/test.js.map +1 -0
- package/build/cli/commands/validate.d.ts +1 -0
- package/build/cli/commands/validate.js +116 -0
- package/build/cli/commands/validate.js.map +1 -0
- package/build/cli/index.d.ts +2 -0
- package/build/cli/index.js +37 -0
- package/build/cli/index.js.map +1 -0
- package/build/plugin/android/withAndroidInvoke.d.ts +8 -0
- package/build/plugin/android/withAndroidInvoke.js +106 -0
- package/build/plugin/android/withAndroidInvoke.js.map +1 -0
- package/build/plugin/codegen/generateActionsXml.d.ts +2 -0
- package/build/plugin/codegen/generateActionsXml.js +69 -0
- package/build/plugin/codegen/generateActionsXml.js.map +1 -0
- package/build/plugin/codegen/generateShortcutsXml.d.ts +2 -0
- package/build/plugin/codegen/generateShortcutsXml.js +45 -0
- package/build/plugin/codegen/generateShortcutsXml.js.map +1 -0
- package/build/plugin/codegen/generateSwiftIntents.d.ts +2 -0
- package/build/plugin/codegen/generateSwiftIntents.js +129 -0
- package/build/plugin/codegen/generateSwiftIntents.js.map +1 -0
- package/build/plugin/ios/withIOSInvoke.d.ts +9 -0
- package/build/plugin/ios/withIOSInvoke.js +83 -0
- package/build/plugin/ios/withIOSInvoke.js.map +1 -0
- package/build/plugin/src/withInvoke.d.ts +16 -0
- package/build/plugin/src/withInvoke.js +13 -0
- package/build/plugin/src/withInvoke.js.map +1 -0
- package/build/src/components/AddToSiriButton.d.ts +18 -0
- package/build/src/components/AddToSiriButton.d.ts.map +1 -0
- package/build/src/components/AddToSiriButton.js +35 -0
- package/build/src/components/AddToSiriButton.js.map +1 -0
- package/build/src/components/InvokeDebugger.d.ts +12 -0
- package/build/src/components/InvokeDebugger.d.ts.map +1 -0
- package/build/src/components/InvokeDebugger.js +122 -0
- package/build/src/components/InvokeDebugger.js.map +1 -0
- package/build/src/components/ShortcutChip.d.ts +20 -0
- package/build/src/components/ShortcutChip.d.ts.map +1 -0
- package/build/src/components/ShortcutChip.js +44 -0
- package/build/src/components/ShortcutChip.js.map +1 -0
- package/build/src/hooks/useAddToSiri.d.ts +9 -0
- package/build/src/hooks/useAddToSiri.d.ts.map +1 -0
- package/build/src/hooks/useAddToSiri.js +15 -0
- package/build/src/hooks/useAddToSiri.js.map +1 -0
- package/build/src/hooks/useDonation.d.ts +26 -0
- package/build/src/hooks/useDonation.d.ts.map +1 -0
- package/build/src/hooks/useDonation.js +21 -0
- package/build/src/hooks/useDonation.js.map +1 -0
- package/build/src/hooks/useFocusFilter.d.ts +11 -0
- package/build/src/hooks/useFocusFilter.d.ts.map +1 -0
- package/build/src/hooks/useFocusFilter.js +24 -0
- package/build/src/hooks/useFocusFilter.js.map +1 -0
- package/build/src/hooks/useHandoff.d.ts +29 -0
- package/build/src/hooks/useHandoff.d.ts.map +1 -0
- package/build/src/hooks/useHandoff.js +27 -0
- package/build/src/hooks/useHandoff.js.map +1 -0
- package/build/src/hooks/useInvoke.d.ts +43 -0
- package/build/src/hooks/useInvoke.d.ts.map +1 -0
- package/build/src/hooks/useInvoke.js +70 -0
- package/build/src/hooks/useInvoke.js.map +1 -0
- package/build/src/hooks/useInvokeAnalytics.d.ts +23 -0
- package/build/src/hooks/useInvokeAnalytics.d.ts.map +1 -0
- package/build/src/hooks/useInvokeAnalytics.js +27 -0
- package/build/src/hooks/useInvokeAnalytics.js.map +1 -0
- package/build/src/hooks/useInvokeHistory.d.ts +11 -0
- package/build/src/hooks/useInvokeHistory.d.ts.map +1 -0
- package/build/src/hooks/useInvokeHistory.js +26 -0
- package/build/src/hooks/useInvokeHistory.js.map +1 -0
- package/build/src/hooks/useInvokeInit.d.ts +16 -0
- package/build/src/hooks/useInvokeInit.d.ts.map +1 -0
- package/build/src/hooks/useInvokeInit.js +32 -0
- package/build/src/hooks/useInvokeInit.js.map +1 -0
- package/build/src/hooks/useLiveActivityIntent.d.ts +21 -0
- package/build/src/hooks/useLiveActivityIntent.d.ts.map +1 -0
- package/build/src/hooks/useLiveActivityIntent.js +9 -0
- package/build/src/hooks/useLiveActivityIntent.js.map +1 -0
- package/build/src/hooks/useQuickTile.d.ts +23 -0
- package/build/src/hooks/useQuickTile.d.ts.map +1 -0
- package/build/src/hooks/useQuickTile.js +15 -0
- package/build/src/hooks/useQuickTile.js.map +1 -0
- package/build/src/hooks/useShortcuts.d.ts +25 -0
- package/build/src/hooks/useShortcuts.d.ts.map +1 -0
- package/build/src/hooks/useShortcuts.js +23 -0
- package/build/src/hooks/useShortcuts.js.map +1 -0
- package/build/src/hooks/useSpotlight.d.ts +23 -0
- package/build/src/hooks/useSpotlight.d.ts.map +1 -0
- package/build/src/hooks/useSpotlight.js +13 -0
- package/build/src/hooks/useSpotlight.js.map +1 -0
- package/build/src/hooks/useWidgetData.d.ts +20 -0
- package/build/src/hooks/useWidgetData.d.ts.map +1 -0
- package/build/src/hooks/useWidgetData.js +12 -0
- package/build/src/hooks/useWidgetData.js.map +1 -0
- package/build/src/index.d.ts +32 -0
- package/build/src/index.d.ts.map +1 -0
- package/build/src/index.js +27 -0
- package/build/src/index.js.map +1 -0
- package/build/src/module.d.ts +25 -0
- package/build/src/module.d.ts.map +1 -0
- package/build/src/module.js +102 -0
- package/build/src/module.js.map +1 -0
- package/build/src/types/index.d.ts +156 -0
- package/build/src/types/index.d.ts.map +1 -0
- package/build/src/types/index.js +4 -0
- package/build/src/types/index.js.map +1 -0
- package/build/src/utils/actionStore.d.ts +6 -0
- package/build/src/utils/actionStore.d.ts.map +1 -0
- package/build/src/utils/actionStore.js +32 -0
- package/build/src/utils/actionStore.js.map +1 -0
- package/build/src/utils/analytics.d.ts +12 -0
- package/build/src/utils/analytics.d.ts.map +1 -0
- package/build/src/utils/analytics.js +29 -0
- package/build/src/utils/analytics.js.map +1 -0
- package/build/src/utils/testing.d.ts +39 -0
- package/build/src/utils/testing.d.ts.map +1 -0
- package/build/src/utils/testing.js +58 -0
- package/build/src/utils/testing.js.map +1 -0
- package/build/src/utils/validation.d.ts +11 -0
- package/build/src/utils/validation.d.ts.map +1 -0
- package/build/src/utils/validation.js +128 -0
- package/build/src/utils/validation.js.map +1 -0
- package/expo-module.config.json +9 -0
- package/ios/Focus/FocusFilterManager.swift +19 -0
- package/ios/Intents/BaseInvokeIntent.swift +42 -0
- package/ios/Intents/HandoffManager.swift +49 -0
- package/ios/Intents/InvokeActionStore.swift +21 -0
- package/ios/Intents/InvokeParameterTypes.swift +142 -0
- package/ios/LiveActivity/LiveActivityIntentBridge.swift +44 -0
- package/ios/Module/ExpoInvokeModule.swift +170 -0
- package/ios/Notifications/NotificationActionHandler.swift +80 -0
- package/ios/Shortcuts/DonationManager.swift +44 -0
- package/ios/Shortcuts/ShortcutsManager.swift +32 -0
- package/ios/Shortcuts/SpotlightManager.swift +48 -0
- package/ios/Widget/WidgetManager.swift +19 -0
- package/package.json +111 -0
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.withIOSInvoke = void 0;
|
|
37
|
+
const config_plugins_1 = require("@expo/config-plugins");
|
|
38
|
+
const fs = __importStar(require("fs"));
|
|
39
|
+
const path = __importStar(require("path"));
|
|
40
|
+
const generateSwiftIntents_1 = require("../codegen/generateSwiftIntents");
|
|
41
|
+
const withIOSInvoke = (config, options) => {
|
|
42
|
+
const { intents, voiceUsageDescription, appGroupId } = options;
|
|
43
|
+
// 1. Info.plist usage description
|
|
44
|
+
config = (0, config_plugins_1.withInfoPlist)(config, (cfg) => {
|
|
45
|
+
cfg.modResults.NSSiriUsageDescription =
|
|
46
|
+
voiceUsageDescription !== null && voiceUsageDescription !== void 0 ? voiceUsageDescription : 'This app uses Siri to perform quick actions.';
|
|
47
|
+
cfg.modResults.NSVoiceUsageDescription =
|
|
48
|
+
voiceUsageDescription !== null && voiceUsageDescription !== void 0 ? voiceUsageDescription : 'This app uses voice commands to perform quick actions.';
|
|
49
|
+
return cfg;
|
|
50
|
+
});
|
|
51
|
+
// 2. App Groups entitlement (needed for widget data sharing)
|
|
52
|
+
// plist values are typed as a union — cast the existing array explicitly
|
|
53
|
+
if (appGroupId) {
|
|
54
|
+
config = (0, config_plugins_1.withEntitlementsPlist)(config, (cfg) => {
|
|
55
|
+
var _a;
|
|
56
|
+
const existing = (_a = cfg.modResults['com.apple.security.application-groups']) !== null && _a !== void 0 ? _a : [];
|
|
57
|
+
if (!existing.includes(appGroupId)) {
|
|
58
|
+
cfg.modResults['com.apple.security.application-groups'] = [...existing, appGroupId];
|
|
59
|
+
}
|
|
60
|
+
return cfg;
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
// 3. Generate InvokeIntents.swift via withDangerousMod
|
|
64
|
+
config = (0, config_plugins_1.withDangerousMod)(config, [
|
|
65
|
+
'ios',
|
|
66
|
+
async (cfg) => {
|
|
67
|
+
var _a;
|
|
68
|
+
const appName = (_a = cfg.modRequest.projectName) !== null && _a !== void 0 ? _a : 'app';
|
|
69
|
+
const iosDir = path.join(cfg.modRequest.platformProjectRoot, appName);
|
|
70
|
+
// Ensure directory exists
|
|
71
|
+
if (!fs.existsSync(iosDir)) {
|
|
72
|
+
fs.mkdirSync(iosDir, { recursive: true });
|
|
73
|
+
}
|
|
74
|
+
const swiftCode = (0, generateSwiftIntents_1.generateSwiftIntents)(intents);
|
|
75
|
+
const outputPath = path.join(iosDir, 'InvokeIntents.swift');
|
|
76
|
+
fs.writeFileSync(outputPath, swiftCode, 'utf8');
|
|
77
|
+
return cfg;
|
|
78
|
+
},
|
|
79
|
+
]);
|
|
80
|
+
return config;
|
|
81
|
+
};
|
|
82
|
+
exports.withIOSInvoke = withIOSInvoke;
|
|
83
|
+
//# sourceMappingURL=withIOSInvoke.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"withIOSInvoke.js","sourceRoot":"","sources":["../../../plugin/ios/withIOSInvoke.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yDAK8B;AAC9B,uCAAyB;AACzB,2CAA6B;AAC7B,0EAAuE;AAShE,MAAM,aAAa,GAAmC,CAAC,MAAM,EAAE,OAAO,EAAE,EAAE;IAC/E,MAAM,EAAE,OAAO,EAAE,qBAAqB,EAAE,UAAU,EAAE,GAAG,OAAO,CAAC;IAE/D,kCAAkC;IAClC,MAAM,GAAG,IAAA,8BAAa,EAAC,MAAM,EAAE,CAAC,GAAG,EAAE,EAAE;QACrC,GAAG,CAAC,UAAU,CAAC,sBAAsB;YACnC,qBAAqB,aAArB,qBAAqB,cAArB,qBAAqB,GAAI,8CAA8C,CAAC;QAC1E,GAAG,CAAC,UAAU,CAAC,uBAAuB;YACpC,qBAAqB,aAArB,qBAAqB,cAArB,qBAAqB,GAAI,wDAAwD,CAAC;QACpF,OAAO,GAAG,CAAC;IACb,CAAC,CAAC,CAAC;IAEH,6DAA6D;IAC7D,yEAAyE;IACzE,IAAI,UAAU,EAAE,CAAC;QACf,MAAM,GAAG,IAAA,sCAAqB,EAAC,MAAM,EAAE,CAAC,GAAG,EAAE,EAAE;;YAC7C,MAAM,QAAQ,GAAG,MAAC,GAAG,CAAC,UAAU,CAAC,uCAAuC,CAA0B,mCAAI,EAAE,CAAC;YACzG,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,UAAU,CAAC,EAAE,CAAC;gBACnC,GAAG,CAAC,UAAU,CAAC,uCAAuC,CAAC,GAAG,CAAC,GAAG,QAAQ,EAAE,UAAU,CAAC,CAAC;YACtF,CAAC;YACD,OAAO,GAAG,CAAC;QACb,CAAC,CAAC,CAAC;IACL,CAAC;IAED,uDAAuD;IACvD,MAAM,GAAG,IAAA,iCAAgB,EAAC,MAAM,EAAE;QAChC,KAAK;QACL,KAAK,EAAE,GAAG,EAAE,EAAE;;YACZ,MAAM,OAAO,GAAG,MAAA,GAAG,CAAC,UAAU,CAAC,WAAW,mCAAI,KAAK,CAAC;YACpD,MAAM,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,mBAAmB,EAAE,OAAO,CAAC,CAAC;YAEtE,0BAA0B;YAC1B,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE,CAAC;gBAC3B,EAAE,CAAC,SAAS,CAAC,MAAM,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;YAC5C,CAAC;YAED,MAAM,SAAS,GAAG,IAAA,2CAAoB,EAAC,OAAO,CAAC,CAAC;YAChD,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,qBAAqB,CAAC,CAAC;YAC5D,EAAE,CAAC,aAAa,CAAC,UAAU,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC;YAEhD,OAAO,GAAG,CAAC;QACb,CAAC;KACF,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC;AA7CW,QAAA,aAAa,iBA6CxB"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type ConfigPlugin } from '@expo/config-plugins';
|
|
2
|
+
import type { IntentDefinition, WidgetDefinition, NotificationCategoryDefinition } from '../../src/types';
|
|
3
|
+
export interface InvokePluginOptions {
|
|
4
|
+
/** Intent definitions. Each intent maps to Siri voice phrases, shortcuts, widget buttons, etc. */
|
|
5
|
+
intents: IntentDefinition[];
|
|
6
|
+
/** Home screen widget definitions */
|
|
7
|
+
widgets?: WidgetDefinition[];
|
|
8
|
+
/** Notification action category definitions */
|
|
9
|
+
notificationActions?: NotificationCategoryDefinition[];
|
|
10
|
+
/** iOS Siri / voice usage description for Info.plist */
|
|
11
|
+
voiceUsageDescription?: string;
|
|
12
|
+
/** iOS App Group identifier for widget data sharing (e.g. "group.com.myapp.invoke") */
|
|
13
|
+
appGroupId?: string;
|
|
14
|
+
}
|
|
15
|
+
declare const _default: ConfigPlugin<InvokePluginOptions>;
|
|
16
|
+
export default _default;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const config_plugins_1 = require("@expo/config-plugins");
|
|
4
|
+
const withIOSInvoke_1 = require("../ios/withIOSInvoke");
|
|
5
|
+
const withAndroidInvoke_1 = require("../android/withAndroidInvoke");
|
|
6
|
+
const withInvoke = (config, options) => {
|
|
7
|
+
const { intents = [], widgets, notificationActions, voiceUsageDescription, appGroupId } = options;
|
|
8
|
+
config = (0, withIOSInvoke_1.withIOSInvoke)(config, { intents, voiceUsageDescription, appGroupId });
|
|
9
|
+
config = (0, withAndroidInvoke_1.withAndroidInvoke)(config, { intents, notificationActions });
|
|
10
|
+
return config;
|
|
11
|
+
};
|
|
12
|
+
exports.default = (0, config_plugins_1.createRunOncePlugin)(withInvoke, 'expo-invoke', '1.0.0');
|
|
13
|
+
//# sourceMappingURL=withInvoke.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"withInvoke.js","sourceRoot":"","sources":["../../../plugin/src/withInvoke.ts"],"names":[],"mappings":";;AAAA,yDAA8E;AAC9E,wDAAqD;AACrD,oEAAiE;AAoBjE,MAAM,UAAU,GAAsC,CAAC,MAAM,EAAE,OAAO,EAAE,EAAE;IACxE,MAAM,EAAE,OAAO,GAAG,EAAE,EAAE,OAAO,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,UAAU,EAAE,GAAG,OAAO,CAAC;IAElG,MAAM,GAAG,IAAA,6BAAa,EAAC,MAAM,EAAE,EAAE,OAAO,EAAE,qBAAqB,EAAE,UAAU,EAAE,CAAC,CAAC;IAC/E,MAAM,GAAG,IAAA,qCAAiB,EAAC,MAAM,EAAE,EAAE,OAAO,EAAE,mBAAmB,EAAE,CAAC,CAAC;IAErE,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC;AAEF,kBAAe,IAAA,oCAAmB,EAAC,UAAU,EAAE,aAAa,EAAE,OAAO,CAAC,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { type ViewStyle, type TextStyle } from 'react-native';
|
|
2
|
+
interface AddToSiriButtonProps {
|
|
3
|
+
intentId: string;
|
|
4
|
+
style?: ViewStyle;
|
|
5
|
+
labelStyle?: TextStyle;
|
|
6
|
+
/** Called after the "Add to Siri" sheet is presented */
|
|
7
|
+
onPress?: () => void;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Renders the native "Add to Siri" button on iOS, triggering the system
|
|
11
|
+
* INUIAddVoiceShortcutButton sheet. On Android it renders a no-op fallback.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* <AddToSiriButton intentId="create_errand" />
|
|
15
|
+
*/
|
|
16
|
+
export declare function AddToSiriButton({ intentId, style, labelStyle, onPress }: AddToSiriButtonProps): any;
|
|
17
|
+
export {};
|
|
18
|
+
//# sourceMappingURL=AddToSiriButton.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AddToSiriButton.d.ts","sourceRoot":"","sources":["../../../src/components/AddToSiriButton.tsx"],"names":[],"mappings":"AACA,OAAO,EAAoC,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAGhG,UAAU,oBAAoB;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,UAAU,CAAC,EAAE,SAAS,CAAC;IACvB,wDAAwD;IACxD,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,EAAE,oBAAoB,OAkB7F"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Platform, TouchableOpacity, Text } from 'react-native';
|
|
3
|
+
import { useAddToSiri } from '../hooks/useAddToSiri';
|
|
4
|
+
/**
|
|
5
|
+
* Renders the native "Add to Siri" button on iOS, triggering the system
|
|
6
|
+
* INUIAddVoiceShortcutButton sheet. On Android it renders a no-op fallback.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* <AddToSiriButton intentId="create_errand" />
|
|
10
|
+
*/
|
|
11
|
+
export function AddToSiriButton({ intentId, style, labelStyle, onPress }) {
|
|
12
|
+
const trigger = useAddToSiri(intentId);
|
|
13
|
+
if (Platform.OS !== 'ios')
|
|
14
|
+
return null;
|
|
15
|
+
return (<TouchableOpacity style={[defaultStyle, style]} onPress={() => {
|
|
16
|
+
trigger();
|
|
17
|
+
onPress === null || onPress === void 0 ? void 0 : onPress();
|
|
18
|
+
}} accessibilityLabel="Add to Siri" accessibilityRole="button">
|
|
19
|
+
<Text style={[labelText, labelStyle]}>Add to Siri</Text>
|
|
20
|
+
</TouchableOpacity>);
|
|
21
|
+
}
|
|
22
|
+
const defaultStyle = {
|
|
23
|
+
backgroundColor: '#000000',
|
|
24
|
+
borderRadius: 8,
|
|
25
|
+
paddingVertical: 12,
|
|
26
|
+
paddingHorizontal: 20,
|
|
27
|
+
alignItems: 'center',
|
|
28
|
+
justifyContent: 'center',
|
|
29
|
+
};
|
|
30
|
+
const labelText = {
|
|
31
|
+
color: '#FFFFFF',
|
|
32
|
+
fontSize: 15,
|
|
33
|
+
fontWeight: '600',
|
|
34
|
+
};
|
|
35
|
+
//# sourceMappingURL=AddToSiriButton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AddToSiriButton.js","sourceRoot":"","sources":["../../../src/components/AddToSiriButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,M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
+
*
|
|
5
|
+
* Place anywhere in your component tree — it renders as a floating panel.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* // app/_layout.tsx (dev only)
|
|
9
|
+
* { __DEV__ && <InvokeDebugger /> }
|
|
10
|
+
*/
|
|
11
|
+
export declare function InvokeDebugger(): any;
|
|
12
|
+
//# sourceMappingURL=InvokeDebugger.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InvokeDebugger.d.ts","sourceRoot":"","sources":["../../../src/components/InvokeDebugger.tsx"],"names":[],"mappings":"AAKA;;;;;;;;;GASG;AACH,wBAAgB,cAAc,QAI7B"}
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { View, Text, ScrollView } from 'react-native';
|
|
3
|
+
import { useInvoke } from '../hooks/useInvoke';
|
|
4
|
+
import { useInvokeHistory } from '../hooks/useInvokeHistory';
|
|
5
|
+
/**
|
|
6
|
+
* Dev-only overlay that shows the most recent fired intents and their sources.
|
|
7
|
+
* Renders nothing in production builds.
|
|
8
|
+
*
|
|
9
|
+
* Place anywhere in your component tree — it renders as a floating panel.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* // app/_layout.tsx (dev only)
|
|
13
|
+
* { __DEV__ && <InvokeDebugger /> }
|
|
14
|
+
*/
|
|
15
|
+
export function InvokeDebugger() {
|
|
16
|
+
if (!__DEV__)
|
|
17
|
+
return null;
|
|
18
|
+
return <InvokeDebuggerInner />;
|
|
19
|
+
}
|
|
20
|
+
function InvokeDebuggerInner() {
|
|
21
|
+
const { intent } = useInvoke();
|
|
22
|
+
const history = useInvokeHistory(5);
|
|
23
|
+
return (<View style={panel} pointerEvents="none">
|
|
24
|
+
<Text style={title}>invoke debugger</Text>
|
|
25
|
+
|
|
26
|
+
{intent ? (<View style={currentBadge}>
|
|
27
|
+
<Text style={badgeLabel}>PENDING</Text>
|
|
28
|
+
<Text style={intentId}>{intent.intentId}</Text>
|
|
29
|
+
<Text style={meta}>source: {intent.source}</Text>
|
|
30
|
+
{Object.keys(intent.parameters).length > 0 && (<Text style={meta}>params: {JSON.stringify(intent.parameters)}</Text>)}
|
|
31
|
+
</View>) : (<Text style={emptyText}>No pending intent</Text>)}
|
|
32
|
+
|
|
33
|
+
{history.length > 0 && (<>
|
|
34
|
+
<Text style={sectionLabel}>Recent ({history.length})</Text>
|
|
35
|
+
<ScrollView style={historyList}>
|
|
36
|
+
{history.map((h, i) => (<View key={i} style={historyRow}>
|
|
37
|
+
<Text style={historyIntent}>{h.intentId}</Text>
|
|
38
|
+
<Text style={historySource}>{h.source}</Text>
|
|
39
|
+
</View>))}
|
|
40
|
+
</ScrollView>
|
|
41
|
+
</>)}
|
|
42
|
+
</View>);
|
|
43
|
+
}
|
|
44
|
+
const panel = {
|
|
45
|
+
position: 'absolute',
|
|
46
|
+
bottom: 80,
|
|
47
|
+
left: 12,
|
|
48
|
+
right: 12,
|
|
49
|
+
backgroundColor: 'rgba(0,0,0,0.85)',
|
|
50
|
+
borderRadius: 12,
|
|
51
|
+
padding: 12,
|
|
52
|
+
zIndex: 9999,
|
|
53
|
+
maxHeight: 240,
|
|
54
|
+
};
|
|
55
|
+
const title = {
|
|
56
|
+
color: '#FFFF00',
|
|
57
|
+
fontSize: 11,
|
|
58
|
+
fontWeight: '700',
|
|
59
|
+
fontFamily: 'monospace',
|
|
60
|
+
marginBottom: 6,
|
|
61
|
+
textTransform: 'uppercase',
|
|
62
|
+
letterSpacing: 1,
|
|
63
|
+
};
|
|
64
|
+
const currentBadge = {
|
|
65
|
+
backgroundColor: 'rgba(0,200,100,0.2)',
|
|
66
|
+
borderRadius: 6,
|
|
67
|
+
padding: 8,
|
|
68
|
+
marginBottom: 6,
|
|
69
|
+
};
|
|
70
|
+
const badgeLabel = {
|
|
71
|
+
color: '#00C864',
|
|
72
|
+
fontSize: 9,
|
|
73
|
+
fontWeight: '700',
|
|
74
|
+
fontFamily: 'monospace',
|
|
75
|
+
letterSpacing: 1,
|
|
76
|
+
};
|
|
77
|
+
const intentId = {
|
|
78
|
+
color: '#FFFFFF',
|
|
79
|
+
fontSize: 13,
|
|
80
|
+
fontWeight: '600',
|
|
81
|
+
fontFamily: 'monospace',
|
|
82
|
+
};
|
|
83
|
+
const meta = {
|
|
84
|
+
color: '#AAAAAA',
|
|
85
|
+
fontSize: 11,
|
|
86
|
+
fontFamily: 'monospace',
|
|
87
|
+
};
|
|
88
|
+
const emptyText = {
|
|
89
|
+
color: '#666666',
|
|
90
|
+
fontSize: 11,
|
|
91
|
+
fontFamily: 'monospace',
|
|
92
|
+
marginBottom: 6,
|
|
93
|
+
};
|
|
94
|
+
const sectionLabel = {
|
|
95
|
+
color: '#888888',
|
|
96
|
+
fontSize: 9,
|
|
97
|
+
fontWeight: '700',
|
|
98
|
+
fontFamily: 'monospace',
|
|
99
|
+
letterSpacing: 1,
|
|
100
|
+
marginBottom: 4,
|
|
101
|
+
textTransform: 'uppercase',
|
|
102
|
+
};
|
|
103
|
+
const historyList = {
|
|
104
|
+
maxHeight: 100,
|
|
105
|
+
};
|
|
106
|
+
const historyRow = {
|
|
107
|
+
flexDirection: 'row',
|
|
108
|
+
justifyContent: 'space-between',
|
|
109
|
+
paddingVertical: 2,
|
|
110
|
+
};
|
|
111
|
+
const historyIntent = {
|
|
112
|
+
color: '#CCCCCC',
|
|
113
|
+
fontSize: 11,
|
|
114
|
+
fontFamily: 'monospace',
|
|
115
|
+
flex: 1,
|
|
116
|
+
};
|
|
117
|
+
const historySource = {
|
|
118
|
+
color: '#888888',
|
|
119
|
+
fontSize: 11,
|
|
120
|
+
fontFamily: 'monospace',
|
|
121
|
+
};
|
|
122
|
+
//# sourceMappingURL=InvokeDebugger.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InvokeDebugger.js","sourceRoot":"","sources":["../../../src/components/InvokeDebugger.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AA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eAAe,EAAE,CAAC;CACnB,CAAC;AAEF,MAAM,aAAa,GAAc;IAC/B,KAAK,EAAE,SAAS;IAChB,QAAQ,EAAE,EAAE;IACZ,UAAU,EAAE,WAAW;IACvB,IAAI,EAAE,CAAC;CACR,CAAC;AAEF,MAAM,aAAa,GAAc;IAC/B,KAAK,EAAE,SAAS;IAChB,QAAQ,EAAE,EAAE;IACZ,UAAU,EAAE,WAAW;CACxB,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type ViewStyle, type TextStyle } from 'react-native';
|
|
2
|
+
interface ShortcutChipProps {
|
|
3
|
+
/** ID matching a ShortcutDefinition */
|
|
4
|
+
shortcutId: string;
|
|
5
|
+
label: string;
|
|
6
|
+
icon?: string;
|
|
7
|
+
style?: ViewStyle;
|
|
8
|
+
labelStyle?: TextStyle;
|
|
9
|
+
onPress?: () => void;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* A tappable chip representing a dynamic launcher shortcut. Pressing it
|
|
13
|
+
* fires the shortcut's mapped intent via the native module.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* <ShortcutChip shortcutId="quick_errand" label="Quick Errand" icon="📦" />
|
|
17
|
+
*/
|
|
18
|
+
export declare function ShortcutChip({ shortcutId, label, icon, style, labelStyle, onPress }: ShortcutChipProps): any;
|
|
19
|
+
export {};
|
|
20
|
+
//# sourceMappingURL=ShortcutChip.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ShortcutChip.d.ts","sourceRoot":"","sources":["../../../src/components/ShortcutChip.tsx"],"names":[],"mappings":"AACA,OAAO,EAA0B,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAGtF,UAAU,iBAAiB;IACzB,uCAAuC;IACvC,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,UAAU,CAAC,EAAE,SAAS,CAAC;IACvB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB;AAED;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,EAAE,UAAU,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,EAAE,iBAAiB,OAuBtG"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { TouchableOpacity, Text } from 'react-native';
|
|
3
|
+
import { setDynamicShortcuts, getDynamicShortcuts } from '../module';
|
|
4
|
+
/**
|
|
5
|
+
* A tappable chip representing a dynamic launcher shortcut. Pressing it
|
|
6
|
+
* fires the shortcut's mapped intent via the native module.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* <ShortcutChip shortcutId="quick_errand" label="Quick Errand" icon="📦" />
|
|
10
|
+
*/
|
|
11
|
+
export function ShortcutChip({ shortcutId, label, icon, style, labelStyle, onPress }) {
|
|
12
|
+
const handlePress = () => {
|
|
13
|
+
// Surface the shortcut by ensuring it stays pinned to the top of the list
|
|
14
|
+
const existing = getDynamicShortcuts();
|
|
15
|
+
const matched = existing.find((s) => s.id === shortcutId);
|
|
16
|
+
if (matched) {
|
|
17
|
+
const reordered = [matched, ...existing.filter((s) => s.id !== shortcutId)];
|
|
18
|
+
setDynamicShortcuts(reordered);
|
|
19
|
+
}
|
|
20
|
+
onPress === null || onPress === void 0 ? void 0 : onPress();
|
|
21
|
+
};
|
|
22
|
+
return (<TouchableOpacity style={[chipStyle, style]} onPress={handlePress} accessibilityLabel={label} accessibilityRole="button">
|
|
23
|
+
{icon ? <Text style={iconText}>{icon}</Text> : null}
|
|
24
|
+
<Text style={[chipLabel, labelStyle]}>{label}</Text>
|
|
25
|
+
</TouchableOpacity>);
|
|
26
|
+
}
|
|
27
|
+
const chipStyle = {
|
|
28
|
+
flexDirection: 'row',
|
|
29
|
+
alignItems: 'center',
|
|
30
|
+
backgroundColor: '#F2F2F7',
|
|
31
|
+
borderRadius: 20,
|
|
32
|
+
paddingVertical: 8,
|
|
33
|
+
paddingHorizontal: 14,
|
|
34
|
+
gap: 6,
|
|
35
|
+
};
|
|
36
|
+
const iconText = {
|
|
37
|
+
fontSize: 16,
|
|
38
|
+
};
|
|
39
|
+
const chipLabel = {
|
|
40
|
+
fontSize: 14,
|
|
41
|
+
fontWeight: '500',
|
|
42
|
+
color: '#1C1C1E',
|
|
43
|
+
};
|
|
44
|
+
//# sourceMappingURL=ShortcutChip.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ShortcutChip.js","sourceRoot":"","sources":["../../../src/components/ShortcutChip.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,gBAAgB,EAAE,IAAI,EAAkC,MAAM,cAAc,CAAC;AACtF,OAAO,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAYrE;;;;;;GAMG;AACH,MAAM,UAAU,YAAY,CAAC,EAAE,UAAU,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,UAAU,EAAE,OAAO,EAAqB;IACrG,MAAM,WAAW,GAAG,GAAG,EAAE;QACvB,0EAA0E;QAC1E,MAAM,QAAQ,GAAG,mBAAmB,EAAE,CAAC;QACvC,MAAM,OAAO,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,UAAU,CAAC,CAAC;QAC1D,IAAI,OAAO,EAAE,CAAC;YACZ,MAAM,SAAS,GAAG,CAAC,OAAO,EAAE,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,UAAU,CAAC,CAAC,CAAC;YAC5E,mBAAmB,CAAC,SAAS,CAAC,CAAC;QACjC,CAAC;QACD,OAAO,aAAP,OAAO,uBAAP,OAAO,EAAI,CAAC;IACd,CAAC,CAAC;IAEF,OAAO,CACL,CAAC,gBAAgB,CACf,KAAK,CAAC,CAAC,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC,CAC1B,OAAO,CAAC,CAAC,WAAW,CAAC,CACrB,kBAAkB,CAAC,CAAC,KAAK,CAAC,CAC1B,iBAAiB,CAAC,QAAQ,CAE1B;MAAA,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CACnD;MAAA,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE,IAAI,CACrD;IAAA,EAAE,gBAAgB,CAAC,CACpB,CAAC;AACJ,CAAC;AAED,MAAM,SAAS,GAAc;IAC3B,aAAa,EAAE,KAAK;IACpB,UAAU,EAAE,QAAQ;IACpB,eAAe,EAAE,SAAS;IAC1B,YAAY,EAAE,EAAE;IAChB,eAAe,EAAE,CAAC;IAClB,iBAAiB,EAAE,EAAE;IACrB,GAAG,EAAE,CAAC;CACP,CAAC;AAEF,MAAM,QAAQ,GAAc;IAC1B,QAAQ,EAAE,EAAE;CACb,CAAC;AAEF,MAAM,SAAS,GAAc;IAC3B,QAAQ,EAAE,EAAE;IACZ,UAAU,EAAE,KAAK;IACjB,KAAK,EAAE,SAAS;CACjB,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns a function that opens the native "Add to Siri" sheet for a given intent.
|
|
3
|
+
*
|
|
4
|
+
* @example
|
|
5
|
+
* const addToSiri = useAddToSiri('create_errand');
|
|
6
|
+
* <Button onPress={addToSiri} title="Add to Siri" />
|
|
7
|
+
*/
|
|
8
|
+
export declare function useAddToSiri(intentId: string): () => void;
|
|
9
|
+
//# sourceMappingURL=useAddToSiri.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useAddToSiri.d.ts","sourceRoot":"","sources":["../../../src/hooks/useAddToSiri.ts"],"names":[],"mappings":"AAGA;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,IAAI,CAIzD"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { useCallback } from 'react';
|
|
2
|
+
import { addIntentToSiri } from '../module';
|
|
3
|
+
/**
|
|
4
|
+
* Returns a function that opens the native "Add to Siri" sheet for a given intent.
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* const addToSiri = useAddToSiri('create_errand');
|
|
8
|
+
* <Button onPress={addToSiri} title="Add to Siri" />
|
|
9
|
+
*/
|
|
10
|
+
export function useAddToSiri(intentId) {
|
|
11
|
+
return useCallback(() => {
|
|
12
|
+
addIntentToSiri(intentId);
|
|
13
|
+
}, [intentId]);
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=useAddToSiri.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useAddToSiri.js","sourceRoot":"","sources":["../../../src/hooks/useAddToSiri.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AACpC,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAE5C;;;;;;GAMG;AACH,MAAM,UAAU,YAAY,CAAC,QAAgB;IAC3C,OAAO,WAAW,CAAC,GAAG,EAAE;QACtB,eAAe,CAAC,QAAQ,CAAC,CAAC;IAC5B,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC;AACjB,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { DonationInput } from '../types';
|
|
2
|
+
export interface UseDonationResult {
|
|
3
|
+
/**
|
|
4
|
+
* Donate an action to improve Siri Suggestions.
|
|
5
|
+
* Call this after a user completes a meaningful action so Siri learns to suggest it.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* // After user creates a delivery from home:
|
|
9
|
+
* donate({
|
|
10
|
+
* intentId: 'create_errand',
|
|
11
|
+
* title: 'Send from Home',
|
|
12
|
+
* parameters: { pickup: { latitude: 5.6, longitude: -0.17, name: 'My Home' } },
|
|
13
|
+
* });
|
|
14
|
+
*/
|
|
15
|
+
donate: (input: DonationInput) => void;
|
|
16
|
+
/** Remove Siri Suggestions for a specific intent */
|
|
17
|
+
remove: (intentId: string) => void;
|
|
18
|
+
/** Remove all Siri Suggestions for this app */
|
|
19
|
+
removeAll: () => void;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Donate actions to Siri Suggestions.
|
|
23
|
+
* The more relevant donations you make, the better Siri contextual suggestions become.
|
|
24
|
+
*/
|
|
25
|
+
export declare function useDonation(): UseDonationResult;
|
|
26
|
+
//# sourceMappingURL=useDonation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useDonation.d.ts","sourceRoot":"","sources":["../../../src/hooks/useDonation.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAkB,MAAM,UAAU,CAAC;AAE9D,MAAM,WAAW,iBAAiB;IAChC;;;;;;;;;;;OAWG;IACH,MAAM,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,IAAI,CAAC;IACvC,oDAAoD;IACpD,MAAM,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,+CAA+C;IAC/C,SAAS,EAAE,MAAM,IAAI,CAAC;CACvB;AAED;;;GAGG;AACH,wBAAgB,WAAW,IAAI,iBAAiB,CAe/C"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { useCallback } from 'react';
|
|
2
|
+
import { donateAction, deleteAction, deleteAllActions } from '../module';
|
|
3
|
+
import { trackDonated } from '../utils/analytics';
|
|
4
|
+
/**
|
|
5
|
+
* Donate actions to Siri Suggestions.
|
|
6
|
+
* The more relevant donations you make, the better Siri contextual suggestions become.
|
|
7
|
+
*/
|
|
8
|
+
export function useDonation() {
|
|
9
|
+
const donate = useCallback((input) => {
|
|
10
|
+
donateAction(input);
|
|
11
|
+
trackDonated(input.intentId);
|
|
12
|
+
}, []);
|
|
13
|
+
const remove = useCallback((intentId) => {
|
|
14
|
+
deleteAction(intentId);
|
|
15
|
+
}, []);
|
|
16
|
+
const removeAll = useCallback(() => {
|
|
17
|
+
deleteAllActions();
|
|
18
|
+
}, []);
|
|
19
|
+
return { donate, remove, removeAll };
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=useDonation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useDonation.js","sourceRoot":"","sources":["../../../src/hooks/useDonation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AACpC,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AACzE,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAuBlD;;;GAGG;AACH,MAAM,UAAU,WAAW;IACzB,MAAM,MAAM,GAAG,WAAW,CAAC,CAAC,KAAoB,EAAE,EAAE;QAClD,YAAY,CAAC,KAAK,CAAC,CAAC;QACpB,YAAY,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;IAC/B,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,MAAM,MAAM,GAAG,WAAW,CAAC,CAAC,QAAgB,EAAE,EAAE;QAC9C,YAAY,CAAC,QAAQ,CAAC,CAAC;IACzB,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,MAAM,SAAS,GAAG,WAAW,CAAC,GAAG,EAAE;QACjC,gBAAgB,EAAE,CAAC;IACrB,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC;AACvC,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type FocusMode } from '../module';
|
|
2
|
+
/**
|
|
3
|
+
* Returns the current iOS Focus mode. Re-reads when the app becomes active.
|
|
4
|
+
* Returns null on Android or when no Focus is active.
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* const focus = useFocusFilter();
|
|
8
|
+
* if (focus === 'work') { ... }
|
|
9
|
+
*/
|
|
10
|
+
export declare function useFocusFilter(): FocusMode;
|
|
11
|
+
//# sourceMappingURL=useFocusFilter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useFocusFilter.d.ts","sourceRoot":"","sources":["../../../src/hooks/useFocusFilter.ts"],"names":[],"mappings":"AAEA,OAAO,EAAgB,KAAK,SAAS,EAAE,MAAM,WAAW,CAAC;AAEzD;;;;;;;GAOG;AACH,wBAAgB,cAAc,IAAI,SAAS,CAa1C"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { useState, useEffect } from 'react';
|
|
2
|
+
import { AppState } from 'react-native';
|
|
3
|
+
import { getFocusMode } from '../module';
|
|
4
|
+
/**
|
|
5
|
+
* Returns the current iOS Focus mode. Re-reads when the app becomes active.
|
|
6
|
+
* Returns null on Android or when no Focus is active.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* const focus = useFocusFilter();
|
|
10
|
+
* if (focus === 'work') { ... }
|
|
11
|
+
*/
|
|
12
|
+
export function useFocusFilter() {
|
|
13
|
+
const [mode, setMode] = useState(() => getFocusMode());
|
|
14
|
+
useEffect(() => {
|
|
15
|
+
const sub = AppState.addEventListener('change', (state) => {
|
|
16
|
+
if (state === 'active') {
|
|
17
|
+
setMode(getFocusMode());
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
return () => sub.remove();
|
|
21
|
+
}, []);
|
|
22
|
+
return mode;
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=useFocusFilter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useFocusFilter.js","sourceRoot":"","sources":["../../../src/hooks/useFocusFilter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAuB,MAAM,cAAc,CAAC;AAC7D,OAAO,EAAE,YAAY,EAAkB,MAAM,WAAW,CAAC;AAEzD;;;;;;;GAOG;AACH,MAAM,UAAU,cAAc;IAC5B,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,QAAQ,CAAY,GAAG,EAAE,CAAC,YAAY,EAAE,CAAC,CAAC;IAElE,SAAS,CAAC,GAAG,EAAE;QACb,MAAM,GAAG,GAAG,QAAQ,CAAC,gBAAgB,CAAC,QAAQ,EAAE,CAAC,KAAqB,EAAE,EAAE;YACxE,IAAI,KAAK,KAAK,QAAQ,EAAE,CAAC;gBACvB,OAAO,CAAC,YAAY,EAAE,CAAC,CAAC;YAC1B,CAAC;QACH,CAAC,CAAC,CAAC;QACH,OAAO,GAAG,EAAE,CAAC,GAAG,CAAC,MAAM,EAAE,CAAC;IAC5B,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export interface UseHandoffResult {
|
|
2
|
+
/**
|
|
3
|
+
* Advertise the current app state for Handoff — lets users continue on
|
|
4
|
+
* another Apple device (iPad, Mac, etc.).
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* advertise('create_errand', { step: 'locations', pickup: pickupCoords });
|
|
8
|
+
*/
|
|
9
|
+
advertise: (intentId: string, params?: Record<string, unknown>) => void;
|
|
10
|
+
/** Stop advertising (e.g., when user leaves the screen) */
|
|
11
|
+
stop: () => void;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* iOS + macOS Handoff — continue an in-progress action on another device.
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* const { advertise, stop } = useHandoff();
|
|
18
|
+
*
|
|
19
|
+
* // When user is filling errand form, advertise so they can continue on iPad:
|
|
20
|
+
* useEffect(() => {
|
|
21
|
+
* advertise('create_errand', { pickup: pickupCoords });
|
|
22
|
+
* return () => stop();
|
|
23
|
+
* }, [pickupCoords]);
|
|
24
|
+
*
|
|
25
|
+
* // In the screen that handles the continued action:
|
|
26
|
+
* const { intent, parameters } = useInvoke({ intentId: 'create_errand', source: 'handoff' });
|
|
27
|
+
*/
|
|
28
|
+
export declare function useHandoff(): UseHandoffResult;
|
|
29
|
+
//# sourceMappingURL=useHandoff.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useHandoff.d.ts","sourceRoot":"","sources":["../../../src/hooks/useHandoff.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,gBAAgB;IAC/B;;;;;;OAMG;IACH,SAAS,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,CAAC;IACxE,2DAA2D;IAC3D,IAAI,EAAE,MAAM,IAAI,CAAC;CAClB;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,UAAU,IAAI,gBAAgB,CAU7C"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { useCallback } from 'react';
|
|
2
|
+
import { advertiseHandoff, stopHandoff } from '../module';
|
|
3
|
+
/**
|
|
4
|
+
* iOS + macOS Handoff — continue an in-progress action on another device.
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* const { advertise, stop } = useHandoff();
|
|
8
|
+
*
|
|
9
|
+
* // When user is filling errand form, advertise so they can continue on iPad:
|
|
10
|
+
* useEffect(() => {
|
|
11
|
+
* advertise('create_errand', { pickup: pickupCoords });
|
|
12
|
+
* return () => stop();
|
|
13
|
+
* }, [pickupCoords]);
|
|
14
|
+
*
|
|
15
|
+
* // In the screen that handles the continued action:
|
|
16
|
+
* const { intent, parameters } = useInvoke({ intentId: 'create_errand', source: 'handoff' });
|
|
17
|
+
*/
|
|
18
|
+
export function useHandoff() {
|
|
19
|
+
const advertise = useCallback((intentId, params = {}) => {
|
|
20
|
+
advertiseHandoff(intentId, params);
|
|
21
|
+
}, []);
|
|
22
|
+
const stop = useCallback(() => {
|
|
23
|
+
stopHandoff();
|
|
24
|
+
}, []);
|
|
25
|
+
return { advertise, stop };
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=useHandoff.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useHandoff.js","sourceRoot":"","sources":["../../../src/hooks/useHandoff.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAa,MAAM,OAAO,CAAC;AAC/C,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAqB,MAAM,WAAW,CAAC;AAgB7E;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,UAAU;IACxB,MAAM,SAAS,GAAG,WAAW,CAAC,CAAC,QAAgB,EAAE,SAAkC,EAAE,EAAE,EAAE;QACvF,gBAAgB,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;IACrC,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,MAAM,IAAI,GAAG,WAAW,CAAC,GAAG,EAAE;QAC5B,WAAW,EAAE,CAAC;IAChB,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;AAC7B,CAAC"}
|