@appilots/sdk 0.3.0 → 0.4.1
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/{chunk-QMSMXTED.mjs → chunk-4GUPZDWT.mjs} +1439 -51
- package/dist/{chunk-MCY5YFYD.js → chunk-J75B2HWG.js} +1447 -57
- package/dist/{chunk-BKFO4DHW.mjs → chunk-L2A4EZ6V.mjs} +325 -1480
- package/dist/{chunk-DUSYQXAQ.mjs → chunk-P2BR4DFF.mjs} +1 -1
- package/dist/{chunk-XNKPS7W3.js → chunk-YSLDAQV7.js} +398 -1553
- package/dist/{chunk-N2I3CA7Q.js → chunk-ZWPABTLA.js} +5 -5
- package/dist/hooks/index.d.mts +1 -2
- package/dist/hooks/index.d.ts +1 -2
- package/dist/hooks/index.js +11 -11
- package/dist/hooks/index.mjs +2 -2
- package/dist/index-Cb0D6uKH.d.mts +1543 -0
- package/dist/index-Cb0D6uKH.d.ts +1543 -0
- package/dist/index.d.mts +5 -282
- package/dist/index.d.ts +5 -282
- package/dist/index.js +65 -65
- package/dist/index.mjs +5 -5
- package/dist/navigation/index.js +13 -13
- package/dist/navigation/index.mjs +2 -2
- package/hooks/package.json +9 -0
- package/metro.d.ts +49 -0
- package/metro.js +0 -37
- package/navigation/package.json +9 -0
- package/package.json +31 -12
- package/dist/index-BYVRBzjJ.d.mts +0 -619
- package/dist/index-BYVRBzjJ.d.ts +0 -619
package/dist/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
3
|
+
var chunkZWPABTLA_js = require('./chunk-ZWPABTLA.js');
|
|
4
|
+
var chunkYSLDAQV7_js = require('./chunk-YSLDAQV7.js');
|
|
5
|
+
var chunkJ75B2HWG_js = require('./chunk-J75B2HWG.js');
|
|
6
6
|
var React7 = require('react');
|
|
7
7
|
var reactNative = require('react-native');
|
|
8
8
|
var reactNativeSafeAreaContext = require('react-native-safe-area-context');
|
|
@@ -33,14 +33,14 @@ var Svg__default = /*#__PURE__*/_interopDefault(Svg);
|
|
|
33
33
|
|
|
34
34
|
// src/components/breadcrumbPresentation.ts
|
|
35
35
|
var DEFAULT_BREADCRUMB_PALETTE = {
|
|
36
|
-
primary:
|
|
37
|
-
text:
|
|
38
|
-
textSecondary:
|
|
39
|
-
surface:
|
|
40
|
-
border:
|
|
41
|
-
success:
|
|
42
|
-
warning:
|
|
43
|
-
error:
|
|
36
|
+
primary: chunkJ75B2HWG_js.defaultLightTheme.colors.primary,
|
|
37
|
+
text: chunkJ75B2HWG_js.defaultLightTheme.colors.text,
|
|
38
|
+
textSecondary: chunkJ75B2HWG_js.defaultLightTheme.colors.textSecondary,
|
|
39
|
+
surface: chunkJ75B2HWG_js.defaultLightTheme.colors.surface,
|
|
40
|
+
border: chunkJ75B2HWG_js.defaultLightTheme.colors.border,
|
|
41
|
+
success: chunkJ75B2HWG_js.defaultLightTheme.colors.success,
|
|
42
|
+
warning: chunkJ75B2HWG_js.defaultLightTheme.colors.warning,
|
|
43
|
+
error: chunkJ75B2HWG_js.defaultLightTheme.colors.error
|
|
44
44
|
};
|
|
45
45
|
var KNOWN_TINTS = {
|
|
46
46
|
[DEFAULT_BREADCRUMB_PALETTE.primary.toUpperCase()]: "#EEF2FF",
|
|
@@ -162,7 +162,7 @@ function RegularBreadcrumbRow({
|
|
|
162
162
|
onApprove,
|
|
163
163
|
onReject
|
|
164
164
|
}) {
|
|
165
|
-
const { label, state } =
|
|
165
|
+
const { label, state } = chunkJ75B2HWG_js.describeAction(action);
|
|
166
166
|
const tone = deriveStateTone(palette)[state];
|
|
167
167
|
const fade = React7.useRef(new reactNative.Animated.Value(0)).current;
|
|
168
168
|
const pulse = React7.useRef(new reactNative.Animated.Value(1)).current;
|
|
@@ -862,7 +862,7 @@ var styles2 = reactNative.StyleSheet.create({
|
|
|
862
862
|
textDecorationLine: "underline"
|
|
863
863
|
}
|
|
864
864
|
});
|
|
865
|
-
var ThemeContext = React7.createContext(
|
|
865
|
+
var ThemeContext = React7.createContext(chunkJ75B2HWG_js.defaultLightTheme);
|
|
866
866
|
function AppilotsThemeProvider({
|
|
867
867
|
theme,
|
|
868
868
|
mode = "auto",
|
|
@@ -870,7 +870,7 @@ function AppilotsThemeProvider({
|
|
|
870
870
|
}) {
|
|
871
871
|
const systemScheme = reactNative.useColorScheme();
|
|
872
872
|
const tokens = React7.useMemo(
|
|
873
|
-
() =>
|
|
873
|
+
() => chunkJ75B2HWG_js.mergeThemeTokens(chunkJ75B2HWG_js.resolveBaseTheme(mode, systemScheme), theme ?? void 0),
|
|
874
874
|
[mode, systemScheme, theme]
|
|
875
875
|
);
|
|
876
876
|
return /* @__PURE__ */ React7__namespace.default.createElement(ThemeContext.Provider, { value: tokens }, children);
|
|
@@ -1151,7 +1151,7 @@ var APPILOTS_SKIP_PROPS = {
|
|
|
1151
1151
|
__appilotsInternal: true
|
|
1152
1152
|
};
|
|
1153
1153
|
function AppilotsChat(props) {
|
|
1154
|
-
const { remotePersonalization } =
|
|
1154
|
+
const { remotePersonalization } = chunkJ75B2HWG_js.useAppilotsContext();
|
|
1155
1155
|
const themeProp = React7.useMemo(() => {
|
|
1156
1156
|
if (!props.theme) return void 0;
|
|
1157
1157
|
return isLegacyTheme(props.theme) ? translateLegacyTheme(props.theme) : props.theme;
|
|
@@ -1194,7 +1194,7 @@ function AppilotsChatInner({
|
|
|
1194
1194
|
clearMessages,
|
|
1195
1195
|
escalation,
|
|
1196
1196
|
requestHuman
|
|
1197
|
-
} =
|
|
1197
|
+
} = chunkYSLDAQV7_js.useAppilotsChat({
|
|
1198
1198
|
errorPrefix: t("somethingWentWrong"),
|
|
1199
1199
|
escalationStrings: {
|
|
1200
1200
|
requested: t("escalationRequested"),
|
|
@@ -1209,8 +1209,8 @@ function AppilotsChatInner({
|
|
|
1209
1209
|
completedActions,
|
|
1210
1210
|
approveAction,
|
|
1211
1211
|
rejectAction
|
|
1212
|
-
} =
|
|
1213
|
-
const { emit, remotePersonalization } =
|
|
1212
|
+
} = chunkYSLDAQV7_js.useAppilotsActions({ autoExecute });
|
|
1213
|
+
const { emit, remotePersonalization } = chunkJ75B2HWG_js.useAppilotsContext();
|
|
1214
1214
|
const {
|
|
1215
1215
|
headerTitle: resolvedTitle,
|
|
1216
1216
|
assistantAvatar,
|
|
@@ -1246,12 +1246,12 @@ function AppilotsChatInner({
|
|
|
1246
1246
|
const flatListRef = React7.useRef(null);
|
|
1247
1247
|
const slideAnim = React7.useRef(new reactNative.Animated.Value(SCREEN_HEIGHT)).current;
|
|
1248
1248
|
const isVisible = mode === "inline" ? true : controlledVisible !== void 0 ? controlledVisible : internalVisible;
|
|
1249
|
-
const showSuggestedPrompts =
|
|
1249
|
+
const showSuggestedPrompts = chunkYSLDAQV7_js.shouldShowSuggestedPrompts({
|
|
1250
1250
|
isVisible,
|
|
1251
1251
|
messageCount: messages.length,
|
|
1252
1252
|
inputText
|
|
1253
1253
|
});
|
|
1254
|
-
const { prompts: suggestedPrompts } =
|
|
1254
|
+
const { prompts: suggestedPrompts } = chunkYSLDAQV7_js.useSuggestedPrompts({
|
|
1255
1255
|
enabled: showSuggestedPrompts,
|
|
1256
1256
|
limit: 3
|
|
1257
1257
|
});
|
|
@@ -2167,9 +2167,9 @@ function createAppilotsInput(WrappedComponent) {
|
|
|
2167
2167
|
label: label ?? fieldId,
|
|
2168
2168
|
screen: appilotsScreen
|
|
2169
2169
|
};
|
|
2170
|
-
|
|
2170
|
+
chunkJ75B2HWG_js.componentRegistry.register(fieldId, entry);
|
|
2171
2171
|
return () => {
|
|
2172
|
-
|
|
2172
|
+
chunkJ75B2HWG_js.componentRegistry.unregister(fieldId);
|
|
2173
2173
|
};
|
|
2174
2174
|
}, [fieldId, appilotsEnabled, getValue, setValue, focus, appilotsFieldType, label, appilotsScreen]);
|
|
2175
2175
|
const mergedRef = React7.useCallback(
|
|
@@ -2218,9 +2218,9 @@ function createAppilotsButton(WrappedComponent) {
|
|
|
2218
2218
|
label: title ?? targetId,
|
|
2219
2219
|
screen: appilotsScreen
|
|
2220
2220
|
};
|
|
2221
|
-
|
|
2221
|
+
chunkJ75B2HWG_js.componentRegistry.register(targetId, entry);
|
|
2222
2222
|
return () => {
|
|
2223
|
-
|
|
2223
|
+
chunkJ75B2HWG_js.componentRegistry.unregister(targetId);
|
|
2224
2224
|
};
|
|
2225
2225
|
}, [targetId, appilotsEnabled, press, title, appilotsScreen]);
|
|
2226
2226
|
return /* @__PURE__ */ React7__namespace.default.createElement(
|
|
@@ -2266,9 +2266,9 @@ function createAppilotsSwitch(WrappedComponent) {
|
|
|
2266
2266
|
label: label ?? toggleId,
|
|
2267
2267
|
screen: appilotsScreen
|
|
2268
2268
|
};
|
|
2269
|
-
|
|
2269
|
+
chunkJ75B2HWG_js.componentRegistry.register(toggleId, entry);
|
|
2270
2270
|
return () => {
|
|
2271
|
-
|
|
2271
|
+
chunkJ75B2HWG_js.componentRegistry.unregister(toggleId);
|
|
2272
2272
|
};
|
|
2273
2273
|
}, [toggleId, appilotsEnabled, getValue, setValue, label, appilotsScreen]);
|
|
2274
2274
|
return /* @__PURE__ */ React7__namespace.default.createElement(
|
|
@@ -2286,159 +2286,159 @@ function createAppilotsSwitch(WrappedComponent) {
|
|
|
2286
2286
|
|
|
2287
2287
|
Object.defineProperty(exports, "AppilotsNavigationContainer", {
|
|
2288
2288
|
enumerable: true,
|
|
2289
|
-
get: function () { return
|
|
2289
|
+
get: function () { return chunkZWPABTLA_js.AppilotsNavigationContainer; }
|
|
2290
2290
|
});
|
|
2291
2291
|
Object.defineProperty(exports, "captureSnapshot", {
|
|
2292
2292
|
enumerable: true,
|
|
2293
|
-
get: function () { return
|
|
2293
|
+
get: function () { return chunkYSLDAQV7_js.captureSnapshot; }
|
|
2294
2294
|
});
|
|
2295
2295
|
Object.defineProperty(exports, "executeAction", {
|
|
2296
2296
|
enumerable: true,
|
|
2297
|
-
get: function () { return
|
|
2297
|
+
get: function () { return chunkYSLDAQV7_js.executeAction; }
|
|
2298
2298
|
});
|
|
2299
2299
|
Object.defineProperty(exports, "useAppilots", {
|
|
2300
2300
|
enumerable: true,
|
|
2301
|
-
get: function () { return
|
|
2301
|
+
get: function () { return chunkYSLDAQV7_js.useAppilots; }
|
|
2302
2302
|
});
|
|
2303
2303
|
Object.defineProperty(exports, "useAppilotsActions", {
|
|
2304
2304
|
enumerable: true,
|
|
2305
|
-
get: function () { return
|
|
2305
|
+
get: function () { return chunkYSLDAQV7_js.useAppilotsActions; }
|
|
2306
2306
|
});
|
|
2307
2307
|
Object.defineProperty(exports, "useAppilotsChat", {
|
|
2308
2308
|
enumerable: true,
|
|
2309
|
-
get: function () { return
|
|
2309
|
+
get: function () { return chunkYSLDAQV7_js.useAppilotsChat; }
|
|
2310
2310
|
});
|
|
2311
2311
|
Object.defineProperty(exports, "useAppilotsField", {
|
|
2312
2312
|
enumerable: true,
|
|
2313
|
-
get: function () { return
|
|
2313
|
+
get: function () { return chunkYSLDAQV7_js.useAppilotsField; }
|
|
2314
2314
|
});
|
|
2315
2315
|
Object.defineProperty(exports, "useAppilotsNavigation", {
|
|
2316
2316
|
enumerable: true,
|
|
2317
|
-
get: function () { return
|
|
2317
|
+
get: function () { return chunkYSLDAQV7_js.useAppilotsNavigation; }
|
|
2318
2318
|
});
|
|
2319
2319
|
Object.defineProperty(exports, "useAppilotsSlider", {
|
|
2320
2320
|
enumerable: true,
|
|
2321
|
-
get: function () { return
|
|
2321
|
+
get: function () { return chunkYSLDAQV7_js.useAppilotsSlider; }
|
|
2322
2322
|
});
|
|
2323
2323
|
Object.defineProperty(exports, "useAppilotsTarget", {
|
|
2324
2324
|
enumerable: true,
|
|
2325
|
-
get: function () { return
|
|
2325
|
+
get: function () { return chunkYSLDAQV7_js.useAppilotsTarget; }
|
|
2326
2326
|
});
|
|
2327
2327
|
Object.defineProperty(exports, "useAppilotsToggle", {
|
|
2328
2328
|
enumerable: true,
|
|
2329
|
-
get: function () { return
|
|
2329
|
+
get: function () { return chunkYSLDAQV7_js.useAppilotsToggle; }
|
|
2330
2330
|
});
|
|
2331
2331
|
Object.defineProperty(exports, "useSuggestedPrompts", {
|
|
2332
2332
|
enumerable: true,
|
|
2333
|
-
get: function () { return
|
|
2333
|
+
get: function () { return chunkYSLDAQV7_js.useSuggestedPrompts; }
|
|
2334
2334
|
});
|
|
2335
2335
|
Object.defineProperty(exports, "AppilotsClient", {
|
|
2336
2336
|
enumerable: true,
|
|
2337
|
-
get: function () { return
|
|
2337
|
+
get: function () { return chunkJ75B2HWG_js.AppilotsClient; }
|
|
2338
2338
|
});
|
|
2339
2339
|
Object.defineProperty(exports, "AppilotsProvider", {
|
|
2340
2340
|
enumerable: true,
|
|
2341
|
-
get: function () { return
|
|
2341
|
+
get: function () { return chunkJ75B2HWG_js.AppilotsProvider; }
|
|
2342
2342
|
});
|
|
2343
2343
|
Object.defineProperty(exports, "AppilotsRegistryProvider", {
|
|
2344
2344
|
enumerable: true,
|
|
2345
|
-
get: function () { return
|
|
2345
|
+
get: function () { return chunkJ75B2HWG_js.AppilotsRegistryProvider; }
|
|
2346
2346
|
});
|
|
2347
2347
|
Object.defineProperty(exports, "SDK_VERSION", {
|
|
2348
2348
|
enumerable: true,
|
|
2349
|
-
get: function () { return
|
|
2349
|
+
get: function () { return chunkJ75B2HWG_js.SDK_VERSION; }
|
|
2350
2350
|
});
|
|
2351
2351
|
Object.defineProperty(exports, "_patchJsxRuntimes", {
|
|
2352
2352
|
enumerable: true,
|
|
2353
|
-
get: function () { return
|
|
2353
|
+
get: function () { return chunkJ75B2HWG_js._patchJsxRuntimes; }
|
|
2354
2354
|
});
|
|
2355
2355
|
Object.defineProperty(exports, "clearAppilotsDebugTraces", {
|
|
2356
2356
|
enumerable: true,
|
|
2357
|
-
get: function () { return
|
|
2357
|
+
get: function () { return chunkJ75B2HWG_js.clearAppilotsDebugTraces; }
|
|
2358
2358
|
});
|
|
2359
2359
|
Object.defineProperty(exports, "componentRegistry", {
|
|
2360
2360
|
enumerable: true,
|
|
2361
|
-
get: function () { return
|
|
2361
|
+
get: function () { return chunkJ75B2HWG_js.componentRegistry; }
|
|
2362
2362
|
});
|
|
2363
2363
|
Object.defineProperty(exports, "createComponentRegistry", {
|
|
2364
2364
|
enumerable: true,
|
|
2365
|
-
get: function () { return
|
|
2365
|
+
get: function () { return chunkJ75B2HWG_js.createComponentRegistry; }
|
|
2366
2366
|
});
|
|
2367
2367
|
Object.defineProperty(exports, "createElementRegistry", {
|
|
2368
2368
|
enumerable: true,
|
|
2369
|
-
get: function () { return
|
|
2369
|
+
get: function () { return chunkJ75B2HWG_js.createElementRegistry; }
|
|
2370
2370
|
});
|
|
2371
2371
|
Object.defineProperty(exports, "createListRegistry", {
|
|
2372
2372
|
enumerable: true,
|
|
2373
|
-
get: function () { return
|
|
2373
|
+
get: function () { return chunkJ75B2HWG_js.createListRegistry; }
|
|
2374
2374
|
});
|
|
2375
2375
|
Object.defineProperty(exports, "defaultDarkTheme", {
|
|
2376
2376
|
enumerable: true,
|
|
2377
|
-
get: function () { return
|
|
2377
|
+
get: function () { return chunkJ75B2HWG_js.defaultDarkTheme; }
|
|
2378
2378
|
});
|
|
2379
2379
|
Object.defineProperty(exports, "defaultLightTheme", {
|
|
2380
2380
|
enumerable: true,
|
|
2381
|
-
get: function () { return
|
|
2381
|
+
get: function () { return chunkJ75B2HWG_js.defaultLightTheme; }
|
|
2382
2382
|
});
|
|
2383
2383
|
Object.defineProperty(exports, "describeAction", {
|
|
2384
2384
|
enumerable: true,
|
|
2385
|
-
get: function () { return
|
|
2385
|
+
get: function () { return chunkJ75B2HWG_js.describeAction; }
|
|
2386
2386
|
});
|
|
2387
2387
|
Object.defineProperty(exports, "elementRegistry", {
|
|
2388
2388
|
enumerable: true,
|
|
2389
|
-
get: function () { return
|
|
2389
|
+
get: function () { return chunkJ75B2HWG_js.elementRegistry; }
|
|
2390
2390
|
});
|
|
2391
2391
|
Object.defineProperty(exports, "enableAppilotsAutoTracking", {
|
|
2392
2392
|
enumerable: true,
|
|
2393
|
-
get: function () { return
|
|
2393
|
+
get: function () { return chunkJ75B2HWG_js.enableAppilotsAutoTracking; }
|
|
2394
2394
|
});
|
|
2395
2395
|
Object.defineProperty(exports, "getAppilotsDebugTraces", {
|
|
2396
2396
|
enumerable: true,
|
|
2397
|
-
get: function () { return
|
|
2397
|
+
get: function () { return chunkJ75B2HWG_js.getAppilotsDebugTraces; }
|
|
2398
2398
|
});
|
|
2399
2399
|
Object.defineProperty(exports, "getGlobalConfig", {
|
|
2400
2400
|
enumerable: true,
|
|
2401
|
-
get: function () { return
|
|
2401
|
+
get: function () { return chunkJ75B2HWG_js.getGlobalConfig; }
|
|
2402
2402
|
});
|
|
2403
2403
|
Object.defineProperty(exports, "humanizeError", {
|
|
2404
2404
|
enumerable: true,
|
|
2405
|
-
get: function () { return
|
|
2405
|
+
get: function () { return chunkJ75B2HWG_js.humanizeError; }
|
|
2406
2406
|
});
|
|
2407
2407
|
Object.defineProperty(exports, "initAppilots", {
|
|
2408
2408
|
enumerable: true,
|
|
2409
|
-
get: function () { return
|
|
2409
|
+
get: function () { return chunkJ75B2HWG_js.initAppilots; }
|
|
2410
2410
|
});
|
|
2411
2411
|
Object.defineProperty(exports, "isAutoTrackingEnabled", {
|
|
2412
2412
|
enumerable: true,
|
|
2413
|
-
get: function () { return
|
|
2413
|
+
get: function () { return chunkJ75B2HWG_js.isAutoTrackingEnabled; }
|
|
2414
2414
|
});
|
|
2415
2415
|
Object.defineProperty(exports, "listRegistry", {
|
|
2416
2416
|
enumerable: true,
|
|
2417
|
-
get: function () { return
|
|
2417
|
+
get: function () { return chunkJ75B2HWG_js.listRegistry; }
|
|
2418
2418
|
});
|
|
2419
2419
|
Object.defineProperty(exports, "mergeThemeTokens", {
|
|
2420
2420
|
enumerable: true,
|
|
2421
|
-
get: function () { return
|
|
2421
|
+
get: function () { return chunkJ75B2HWG_js.mergeThemeTokens; }
|
|
2422
2422
|
});
|
|
2423
2423
|
Object.defineProperty(exports, "recordAppilotsDebugTrace", {
|
|
2424
2424
|
enumerable: true,
|
|
2425
|
-
get: function () { return
|
|
2425
|
+
get: function () { return chunkJ75B2HWG_js.recordAppilotsDebugTrace; }
|
|
2426
2426
|
});
|
|
2427
2427
|
Object.defineProperty(exports, "registerScreen", {
|
|
2428
2428
|
enumerable: true,
|
|
2429
|
-
get: function () { return
|
|
2429
|
+
get: function () { return chunkJ75B2HWG_js.registerScreen; }
|
|
2430
2430
|
});
|
|
2431
2431
|
Object.defineProperty(exports, "subscribeAppilotsDebugTraces", {
|
|
2432
2432
|
enumerable: true,
|
|
2433
|
-
get: function () { return
|
|
2433
|
+
get: function () { return chunkJ75B2HWG_js.subscribeAppilotsDebugTraces; }
|
|
2434
2434
|
});
|
|
2435
2435
|
Object.defineProperty(exports, "useAppilotsContext", {
|
|
2436
2436
|
enumerable: true,
|
|
2437
|
-
get: function () { return
|
|
2437
|
+
get: function () { return chunkJ75B2HWG_js.useAppilotsContext; }
|
|
2438
2438
|
});
|
|
2439
2439
|
Object.defineProperty(exports, "useResolvedRegistry", {
|
|
2440
2440
|
enumerable: true,
|
|
2441
|
-
get: function () { return
|
|
2441
|
+
get: function () { return chunkJ75B2HWG_js.useResolvedRegistry; }
|
|
2442
2442
|
});
|
|
2443
2443
|
exports.ActionBreadcrumb = ActionBreadcrumb;
|
|
2444
2444
|
exports.AppilotsChat = AppilotsChat;
|
package/dist/index.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export { AppilotsNavigationContainer } from './chunk-
|
|
2
|
-
import { useAppilotsChat, useAppilotsActions, shouldShowSuggestedPrompts, useSuggestedPrompts } from './chunk-
|
|
3
|
-
export { captureSnapshot, executeAction, useAppilots, useAppilotsActions, useAppilotsChat, useAppilotsField, useAppilotsNavigation, useAppilotsSlider, useAppilotsTarget, useAppilotsToggle, useSuggestedPrompts } from './chunk-
|
|
4
|
-
import { defaultLightTheme, describeAction, mergeThemeTokens, resolveBaseTheme, useAppilotsContext, componentRegistry } from './chunk-
|
|
5
|
-
export { AppilotsClient, AppilotsProvider, AppilotsRegistryProvider, SDK_VERSION, _patchJsxRuntimes, clearAppilotsDebugTraces, componentRegistry, createComponentRegistry, createElementRegistry, createListRegistry, defaultDarkTheme, defaultLightTheme, describeAction, elementRegistry, enableAppilotsAutoTracking, getAppilotsDebugTraces, getGlobalConfig, humanizeError, initAppilots, isAutoTrackingEnabled, listRegistry, mergeThemeTokens, recordAppilotsDebugTrace, registerScreen, subscribeAppilotsDebugTraces, useAppilotsContext, useResolvedRegistry } from './chunk-
|
|
1
|
+
export { AppilotsNavigationContainer } from './chunk-P2BR4DFF.mjs';
|
|
2
|
+
import { useAppilotsChat, useAppilotsActions, shouldShowSuggestedPrompts, useSuggestedPrompts } from './chunk-L2A4EZ6V.mjs';
|
|
3
|
+
export { captureSnapshot, executeAction, useAppilots, useAppilotsActions, useAppilotsChat, useAppilotsField, useAppilotsNavigation, useAppilotsSlider, useAppilotsTarget, useAppilotsToggle, useSuggestedPrompts } from './chunk-L2A4EZ6V.mjs';
|
|
4
|
+
import { defaultLightTheme, describeAction, mergeThemeTokens, resolveBaseTheme, useAppilotsContext, componentRegistry } from './chunk-4GUPZDWT.mjs';
|
|
5
|
+
export { AppilotsClient, AppilotsProvider, AppilotsRegistryProvider, SDK_VERSION, _patchJsxRuntimes, clearAppilotsDebugTraces, componentRegistry, createComponentRegistry, createElementRegistry, createListRegistry, defaultDarkTheme, defaultLightTheme, describeAction, elementRegistry, enableAppilotsAutoTracking, getAppilotsDebugTraces, getGlobalConfig, humanizeError, initAppilots, isAutoTrackingEnabled, listRegistry, mergeThemeTokens, recordAppilotsDebugTrace, registerScreen, subscribeAppilotsDebugTraces, useAppilotsContext, useResolvedRegistry } from './chunk-4GUPZDWT.mjs';
|
|
6
6
|
import * as React7 from 'react';
|
|
7
7
|
import React7__default, { createContext, useRef, useEffect, useMemo, useContext, useState, useCallback } from 'react';
|
|
8
8
|
import { StyleSheet, Dimensions, Platform, View, Animated, Text, TouchableOpacity, ActivityIndicator, useColorScheme, NativeModules, FlatList, Image, TextInput, Modal, KeyboardAvoidingView, Linking } from 'react-native';
|
package/dist/navigation/index.js
CHANGED
|
@@ -1,51 +1,51 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
3
|
+
var chunkZWPABTLA_js = require('../chunk-ZWPABTLA.js');
|
|
4
|
+
var chunkJ75B2HWG_js = require('../chunk-J75B2HWG.js');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
Object.defineProperty(exports, "AppilotsNavigationContainer", {
|
|
9
9
|
enumerable: true,
|
|
10
|
-
get: function () { return
|
|
10
|
+
get: function () { return chunkZWPABTLA_js.AppilotsNavigationContainer; }
|
|
11
11
|
});
|
|
12
12
|
Object.defineProperty(exports, "clearScreenRegistry", {
|
|
13
13
|
enumerable: true,
|
|
14
|
-
get: function () { return
|
|
14
|
+
get: function () { return chunkJ75B2HWG_js.clearScreenRegistry; }
|
|
15
15
|
});
|
|
16
16
|
Object.defineProperty(exports, "getActiveRouteNames", {
|
|
17
17
|
enumerable: true,
|
|
18
|
-
get: function () { return
|
|
18
|
+
get: function () { return chunkJ75B2HWG_js.getActiveRouteNames; }
|
|
19
19
|
});
|
|
20
20
|
Object.defineProperty(exports, "getAllScreens", {
|
|
21
21
|
enumerable: true,
|
|
22
|
-
get: function () { return
|
|
22
|
+
get: function () { return chunkJ75B2HWG_js.getAllScreens; }
|
|
23
23
|
});
|
|
24
24
|
Object.defineProperty(exports, "getCurrentScreen", {
|
|
25
25
|
enumerable: true,
|
|
26
|
-
get: function () { return
|
|
26
|
+
get: function () { return chunkJ75B2HWG_js.getCurrentScreen; }
|
|
27
27
|
});
|
|
28
28
|
Object.defineProperty(exports, "getNavigationRef", {
|
|
29
29
|
enumerable: true,
|
|
30
|
-
get: function () { return
|
|
30
|
+
get: function () { return chunkJ75B2HWG_js.getNavigationRef; }
|
|
31
31
|
});
|
|
32
32
|
Object.defineProperty(exports, "getNavigationStateSnapshot", {
|
|
33
33
|
enumerable: true,
|
|
34
|
-
get: function () { return
|
|
34
|
+
get: function () { return chunkJ75B2HWG_js.getNavigationStateSnapshot; }
|
|
35
35
|
});
|
|
36
36
|
Object.defineProperty(exports, "getScreenMetadata", {
|
|
37
37
|
enumerable: true,
|
|
38
|
-
get: function () { return
|
|
38
|
+
get: function () { return chunkJ75B2HWG_js.getScreenMetadata; }
|
|
39
39
|
});
|
|
40
40
|
Object.defineProperty(exports, "registerScreen", {
|
|
41
41
|
enumerable: true,
|
|
42
|
-
get: function () { return
|
|
42
|
+
get: function () { return chunkJ75B2HWG_js.registerScreen; }
|
|
43
43
|
});
|
|
44
44
|
Object.defineProperty(exports, "setCurrentScreen", {
|
|
45
45
|
enumerable: true,
|
|
46
|
-
get: function () { return
|
|
46
|
+
get: function () { return chunkJ75B2HWG_js.setCurrentScreen; }
|
|
47
47
|
});
|
|
48
48
|
Object.defineProperty(exports, "setNavigationRef", {
|
|
49
49
|
enumerable: true,
|
|
50
|
-
get: function () { return
|
|
50
|
+
get: function () { return chunkJ75B2HWG_js.setNavigationRef; }
|
|
51
51
|
});
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { AppilotsNavigationContainer } from '../chunk-
|
|
2
|
-
export { clearScreenRegistry, getActiveRouteNames, getAllScreens, getCurrentScreen, getNavigationRef, getNavigationStateSnapshot, getScreenMetadata, registerScreen, setCurrentScreen, setNavigationRef } from '../chunk-
|
|
1
|
+
export { AppilotsNavigationContainer } from '../chunk-P2BR4DFF.mjs';
|
|
2
|
+
export { clearScreenRegistry, getActiveRouteNames, getAllScreens, getCurrentScreen, getNavigationRef, getNavigationStateSnapshot, getScreenMetadata, registerScreen, setCurrentScreen, setNavigationRef } from '../chunk-4GUPZDWT.mjs';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
{
|
|
2
|
+
"//": "Legacy-resolution redirect for `@appilots/sdk/hooks`. Modern resolvers use the `exports` map in the package root and never read this file; Metro with `unstable_enablePackageExports` off (the default below Metro 0.82 / RN 0.79, and the SDK supports react-native >=0.72) and TypeScript's `moduleResolution: node10` both ignore `exports` and resolve this directory instead. Without it those consumers fail with `Unable to resolve module @appilots/sdk/hooks`. Keep the targets in sync with the `./hooks` entry in ../package.json.",
|
|
3
|
+
"name": "@appilots/sdk-hooks",
|
|
4
|
+
"private": true,
|
|
5
|
+
"main": "../dist/hooks/index.js",
|
|
6
|
+
"module": "../dist/hooks/index.mjs",
|
|
7
|
+
"types": "../dist/hooks/index.d.ts",
|
|
8
|
+
"sideEffects": false
|
|
9
|
+
}
|
package/metro.d.ts
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Type declarations for `@appilots/sdk/metro`.
|
|
3
|
+
*
|
|
4
|
+
* Hand-written: metro.js is plain CommonJS (Metro loads it via `require`, so it
|
|
5
|
+
* cannot be part of the tsup build). Keep in sync with metro.js.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Structural subset of a Metro config — just the fields `withAppilots` reads or
|
|
10
|
+
* rewrites. Declared locally rather than imported from `metro-config` so the
|
|
11
|
+
* SDK does not take a dependency on Metro's types just to type this helper.
|
|
12
|
+
*/
|
|
13
|
+
export interface MetroConfigLike {
|
|
14
|
+
projectRoot?: string;
|
|
15
|
+
resolver?: {
|
|
16
|
+
resolveRequest?: (
|
|
17
|
+
context: unknown,
|
|
18
|
+
moduleName: string,
|
|
19
|
+
platform: string | null,
|
|
20
|
+
) => unknown;
|
|
21
|
+
[option: string]: unknown;
|
|
22
|
+
};
|
|
23
|
+
[option: string]: unknown;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export interface WithAppilotsOptions {
|
|
27
|
+
/**
|
|
28
|
+
* Path to the `.appilotsrc` file.
|
|
29
|
+
*
|
|
30
|
+
* @default `<projectRoot>/.appilotsrc`
|
|
31
|
+
*/
|
|
32
|
+
configPath?: string;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Wraps a Metro config so `AppilotsProvider` auto-loads `.appilotsrc`.
|
|
37
|
+
*
|
|
38
|
+
* Returns the config unchanged (with a warning) when no `.appilotsrc` is found.
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* ```js
|
|
42
|
+
* const { withAppilots } = require('@appilots/sdk/metro');
|
|
43
|
+
* module.exports = withAppilots(mergeConfig(defaultConfig, config));
|
|
44
|
+
* ```
|
|
45
|
+
*/
|
|
46
|
+
export declare function withAppilots<T extends MetroConfigLike>(
|
|
47
|
+
metroConfig: T,
|
|
48
|
+
options?: WithAppilotsOptions,
|
|
49
|
+
): T;
|
package/metro.js
CHANGED
|
@@ -100,41 +100,6 @@ function withAppilots(metroConfig, options = {}) {
|
|
|
100
100
|
// Resolve `@appilots/auto-init` to the shim
|
|
101
101
|
const existingResolveRequest = metroConfig.resolver?.resolveRequest;
|
|
102
102
|
|
|
103
|
-
// Metro < 0.79 does not read package.json "exports" by default
|
|
104
|
-
// (`unstable_enablePackageExports` is off), so deep imports like
|
|
105
|
-
// `@appilots/shared/match` — which the SDK dist emits since the shared
|
|
106
|
-
// element matcher landed — fail to resolve in consumer apps. Map
|
|
107
|
-
// `@appilots/shared/<subpath>` onto the package's built dist layout
|
|
108
|
-
// explicitly. Kept narrow on purpose: flipping
|
|
109
|
-
// unstable_enablePackageExports globally would change resolution for
|
|
110
|
-
// every dependency in the host app.
|
|
111
|
-
const SHARED_SUBPATH_RE = /^@appilots\/shared\/([A-Za-z0-9_-]+)$/;
|
|
112
|
-
function resolveSharedSubpath(moduleName) {
|
|
113
|
-
const match = SHARED_SUBPATH_RE.exec(moduleName);
|
|
114
|
-
if (!match) return null;
|
|
115
|
-
try {
|
|
116
|
-
// require.resolve('@appilots/shared') → <pkg>/dist/index.js; the
|
|
117
|
-
// package root is two levels up. (package.json itself is not in
|
|
118
|
-
// the exports map, so it can't be resolved directly.) __dirname
|
|
119
|
-
// as a fallback path: the SDK always sees shared as a sibling —
|
|
120
|
-
// node_modules/@appilots/{sdk,shared} in apps, workspace packages
|
|
121
|
-
// in the monorepo — even when projectRoot has no resolution
|
|
122
|
-
// chain to it.
|
|
123
|
-
const mainEntry = require.resolve('@appilots/shared', {
|
|
124
|
-
paths: [projectRoot, __dirname],
|
|
125
|
-
});
|
|
126
|
-
const packageRoot = path.dirname(path.dirname(mainEntry));
|
|
127
|
-
const candidate = path.join(packageRoot, 'dist', match[1], 'index.js');
|
|
128
|
-
if (fs.existsSync(candidate)) {
|
|
129
|
-
return { type: 'sourceFile', filePath: candidate };
|
|
130
|
-
}
|
|
131
|
-
} catch (error) {
|
|
132
|
-
// fall through to the default resolver (its error message names
|
|
133
|
-
// the module, which is more actionable than ours would be)
|
|
134
|
-
}
|
|
135
|
-
return null;
|
|
136
|
-
}
|
|
137
|
-
|
|
138
103
|
return {
|
|
139
104
|
...metroConfig,
|
|
140
105
|
resolver: {
|
|
@@ -144,8 +109,6 @@ function withAppilots(metroConfig, options = {}) {
|
|
|
144
109
|
ensureShimFresh();
|
|
145
110
|
return { type: 'sourceFile', filePath: shimPath };
|
|
146
111
|
}
|
|
147
|
-
const shared = resolveSharedSubpath(moduleName);
|
|
148
|
-
if (shared) return shared;
|
|
149
112
|
if (existingResolveRequest) {
|
|
150
113
|
return existingResolveRequest(context, moduleName, platform);
|
|
151
114
|
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
{
|
|
2
|
+
"//": "Legacy-resolution redirect for `@appilots/sdk/navigation`. Modern resolvers use the `exports` map in the package root and never read this file; Metro with `unstable_enablePackageExports` off (the default below Metro 0.82 / RN 0.79, and the SDK supports react-native >=0.72) and TypeScript's `moduleResolution: node10` both ignore `exports` and resolve this directory instead. Without it those consumers fail with `Unable to resolve module @appilots/sdk/navigation`. Keep the targets in sync with the `./navigation` entry in ../package.json.",
|
|
3
|
+
"name": "@appilots/sdk-navigation",
|
|
4
|
+
"private": true,
|
|
5
|
+
"main": "../dist/navigation/index.js",
|
|
6
|
+
"module": "../dist/navigation/index.mjs",
|
|
7
|
+
"types": "../dist/navigation/index.d.ts",
|
|
8
|
+
"sideEffects": false
|
|
9
|
+
}
|
package/package.json
CHANGED
|
@@ -1,33 +1,52 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@appilots/sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.1",
|
|
4
4
|
"description": "AI-powered chat component and navigation SDK for React Native apps",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
8
8
|
"exports": {
|
|
9
9
|
".": {
|
|
10
|
-
"import":
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
"import": {
|
|
11
|
+
"types": "./dist/index.d.mts",
|
|
12
|
+
"default": "./dist/index.mjs"
|
|
13
|
+
},
|
|
14
|
+
"require": {
|
|
15
|
+
"types": "./dist/index.d.ts",
|
|
16
|
+
"default": "./dist/index.js"
|
|
17
|
+
}
|
|
13
18
|
},
|
|
14
19
|
"./navigation": {
|
|
15
|
-
"import":
|
|
16
|
-
|
|
17
|
-
|
|
20
|
+
"import": {
|
|
21
|
+
"types": "./dist/navigation/index.d.mts",
|
|
22
|
+
"default": "./dist/navigation/index.mjs"
|
|
23
|
+
},
|
|
24
|
+
"require": {
|
|
25
|
+
"types": "./dist/navigation/index.d.ts",
|
|
26
|
+
"default": "./dist/navigation/index.js"
|
|
27
|
+
}
|
|
18
28
|
},
|
|
19
29
|
"./hooks": {
|
|
20
|
-
"import":
|
|
21
|
-
|
|
22
|
-
|
|
30
|
+
"import": {
|
|
31
|
+
"types": "./dist/hooks/index.d.mts",
|
|
32
|
+
"default": "./dist/hooks/index.mjs"
|
|
33
|
+
},
|
|
34
|
+
"require": {
|
|
35
|
+
"types": "./dist/hooks/index.d.ts",
|
|
36
|
+
"default": "./dist/hooks/index.js"
|
|
37
|
+
}
|
|
23
38
|
},
|
|
24
39
|
"./metro": {
|
|
25
|
-
"
|
|
40
|
+
"types": "./metro.d.ts",
|
|
41
|
+
"default": "./metro.js"
|
|
26
42
|
}
|
|
27
43
|
},
|
|
28
44
|
"files": [
|
|
29
45
|
"dist",
|
|
30
46
|
"metro.js",
|
|
47
|
+
"metro.d.ts",
|
|
48
|
+
"navigation",
|
|
49
|
+
"hooks",
|
|
31
50
|
"README.md",
|
|
32
51
|
"LICENSE"
|
|
33
52
|
],
|
|
@@ -59,7 +78,7 @@
|
|
|
59
78
|
"sdk"
|
|
60
79
|
],
|
|
61
80
|
"scripts": {
|
|
62
|
-
"build": "tsup",
|
|
81
|
+
"build": "tsup && node scripts/check-private-specifiers.mjs && node scripts/check-entrypoints.mjs",
|
|
63
82
|
"dev": "tsup --watch",
|
|
64
83
|
"lint": "eslint src --ext .ts,.tsx,.js,.jsx",
|
|
65
84
|
"lint:fix": "eslint src --ext .ts,.tsx,.js,.jsx --fix",
|