@momo-kits/foundation 0.81.43-tracking.4 → 0.81.43-tracking.5
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/Application/Components.tsx +22 -10
- package/Application/Navigator.ts +0 -12
- package/package.json +1 -1
|
@@ -308,15 +308,19 @@ const HeaderToolkitAction: React.FC<any> = ({
|
|
|
308
308
|
}, []);
|
|
309
309
|
|
|
310
310
|
const getToolkitConfig = () => {
|
|
311
|
-
navigator?.
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
311
|
+
navigator?.maxApi?.dispatchFunction?.(
|
|
312
|
+
'getToolsConfig',
|
|
313
|
+
[undefined],
|
|
314
|
+
(config: any) => {
|
|
315
|
+
navigator.toolkitConfig = config;
|
|
316
|
+
setToolConfig(navigator?.toolkitConfig);
|
|
317
|
+
},
|
|
318
|
+
);
|
|
315
319
|
};
|
|
316
320
|
|
|
317
321
|
const onMore = () => {
|
|
318
322
|
onAction?.('onMore');
|
|
319
|
-
navigator?.
|
|
323
|
+
navigator?.maxApi?.dispatchFunction?.(
|
|
320
324
|
'showTools',
|
|
321
325
|
[undefined],
|
|
322
326
|
(res: {item: {action?: string; key: string}}) => {
|
|
@@ -337,14 +341,18 @@ const HeaderToolkitAction: React.FC<any> = ({
|
|
|
337
341
|
title: preventBack.primary.title,
|
|
338
342
|
onPress: () => {
|
|
339
343
|
preventBack?.primary.onPress();
|
|
340
|
-
navigator?.
|
|
344
|
+
navigator?.maxApi?.dispatchFunction?.(
|
|
345
|
+
'dismiss',
|
|
346
|
+
undefined,
|
|
347
|
+
undefined,
|
|
348
|
+
);
|
|
341
349
|
},
|
|
342
350
|
}}
|
|
343
351
|
/>
|
|
344
352
|
),
|
|
345
353
|
});
|
|
346
354
|
} else {
|
|
347
|
-
navigator?.
|
|
355
|
+
navigator?.maxApi?.dispatchFunction?.('dismiss', undefined, undefined);
|
|
348
356
|
}
|
|
349
357
|
};
|
|
350
358
|
|
|
@@ -362,9 +370,13 @@ const HeaderToolkitAction: React.FC<any> = ({
|
|
|
362
370
|
badgeValue={badgeValue}
|
|
363
371
|
badgeType={badgeType}
|
|
364
372
|
onPress={() => {
|
|
365
|
-
navigator?.
|
|
366
|
-
|
|
367
|
-
|
|
373
|
+
navigator?.maxApi?.dispatchFunction?.(
|
|
374
|
+
'onToolAction',
|
|
375
|
+
[pinTool?.key],
|
|
376
|
+
() => {
|
|
377
|
+
getToolkitConfig();
|
|
378
|
+
},
|
|
379
|
+
);
|
|
368
380
|
navigator?.toolkitCallback?.(pinTool.key);
|
|
369
381
|
}}
|
|
370
382
|
/>
|
package/Application/Navigator.ts
CHANGED
|
@@ -109,18 +109,6 @@ class Navigator {
|
|
|
109
109
|
);
|
|
110
110
|
};
|
|
111
111
|
|
|
112
|
-
/**
|
|
113
|
-
* request max api for mini app
|
|
114
|
-
* @param func
|
|
115
|
-
* @param args
|
|
116
|
-
* @param callback
|
|
117
|
-
*/
|
|
118
|
-
requestApi = (func: any, args: any = [], callback: any) => {
|
|
119
|
-
if (this.maxApi) {
|
|
120
|
-
this.maxApi[func]?.(...args, callback);
|
|
121
|
-
}
|
|
122
|
-
};
|
|
123
|
-
|
|
124
112
|
setToolkitCallback = (
|
|
125
113
|
callback: (item: {key: string; action: string}) => void,
|
|
126
114
|
) => {
|