@lemon-fe/mini-app 1.0.5 → 1.0.6-alpha.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.
@@ -12,3 +12,6 @@ export declare const CHECK_ACCESS_TOKEN = "CHECK_ACCESS_TOKEN";
12
12
  export declare const SET_CAPSULE = "SET_CAPSULE";
13
13
  export declare const SET_EXTRA_PAYLOAD = "SET_EXTRA_PAYLOAD";
14
14
  export declare const SYNC_ROUTES = "SYNC_ROUTES";
15
+ export declare const NEXT_ACTION = "NEXT_ACTION";
16
+ export declare const ACTION_CONTINUE = "ACTION_CONTINUE";
17
+ export declare const ACTION_CANCEL = "ACTION_CANCEL";
@@ -12,4 +12,8 @@ export var GET_ACCESS_TOKEN = 'GET_ACCESS_TOKEN';
12
12
  export var CHECK_ACCESS_TOKEN = 'CHECK_ACCESS_TOKEN';
13
13
  export var SET_CAPSULE = 'SET_CAPSULE';
14
14
  export var SET_EXTRA_PAYLOAD = 'SET_EXTRA_PAYLOAD';
15
- export var SYNC_ROUTES = 'SYNC_ROUTES';
15
+ export var SYNC_ROUTES = 'SYNC_ROUTES';
16
+ export var NEXT_ACTION = 'NEXT_ACTION'; // actions
17
+
18
+ export var ACTION_CONTINUE = 'ACTION_CONTINUE';
19
+ export var ACTION_CANCEL = 'ACTION_CANCEL';
package/es/global.d.ts CHANGED
@@ -67,6 +67,15 @@ declare const bridge: {
67
67
  path: string;
68
68
  }[];
69
69
  }): void;
70
+ /**
71
+ * @description 当外部应用作为功能嵌入点,执行流程的下个行为,一般有继续和取消
72
+ */
73
+ nextAction(opts: {
74
+ params: {
75
+ type: string;
76
+ payload: Record<string, any>;
77
+ };
78
+ }): void;
70
79
  };
71
80
  export declare const mini: {
72
81
  getSystemInfoSync: () => {
@@ -119,6 +128,12 @@ export declare const mini: {
119
128
  path: string;
120
129
  }[];
121
130
  }) => void;
131
+ nextAction: (opts: {
132
+ params: {
133
+ type: string;
134
+ payload: Record<string, any>;
135
+ };
136
+ }) => void;
122
137
  loaded: boolean;
123
138
  };
124
139
  /**
package/es/global.js CHANGED
@@ -4,7 +4,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
4
4
 
5
5
  function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
6
6
 
7
- import { CHECK_ACCESS_TOKEN, EXIT, GET_ACCESS_TOKEN, GET_USER_INFO, INIT_IFRAME, LEMON_APP_EXTRA_PAYLOAD, METHOD, METHOD_CALLBACK, SCAN_CODE, SET_CAPSULE, SET_EXTRA_PAYLOAD, SET_STATUS_BAR_STYLE, SYNC_ROUTES } from './constants';
7
+ import { CHECK_ACCESS_TOKEN, EXIT, GET_ACCESS_TOKEN, GET_USER_INFO, INIT_IFRAME, LEMON_APP_EXTRA_PAYLOAD, METHOD, METHOD_CALLBACK, NEXT_ACTION, SCAN_CODE, SET_CAPSULE, SET_EXTRA_PAYLOAD, SET_STATUS_BAR_STYLE, SYNC_ROUTES } from './constants';
8
8
  var whiteList = ['localhost', 'csp.nhsoft.cn', '127.0.0.1'];
9
9
  var methods = {};
10
10
  var listeners = [];
@@ -128,6 +128,15 @@ var bridge = {
128
128
  bridge.methodRegister(SYNC_ROUTES, {
129
129
  params: opts
130
130
  });
131
+ },
132
+
133
+ /**
134
+ * @description 当外部应用作为功能嵌入点,执行流程的下个行为,一般有继续和取消
135
+ */
136
+ nextAction: function nextAction(opts) {
137
+ bridge.methodRegister(NEXT_ACTION, {
138
+ params: opts
139
+ });
131
140
  }
132
141
  };
133
142
  export var mini = _objectSpread(_objectSpread({
package/es/index.d.ts CHANGED
@@ -2,3 +2,4 @@ export * from './global';
2
2
  export { AppContainer, Portal } from './components';
3
3
  export * from './hooks';
4
4
  export type { NavigationStackScreen, Path, UserInfo } from './typings';
5
+ export { ACTION_CONTINUE, ACTION_CANCEL } from './constants';
package/es/index.js CHANGED
@@ -1,3 +1,4 @@
1
1
  export * from './global';
2
2
  export { AppContainer, Portal } from './components';
3
- export * from './hooks';
3
+ export * from './hooks';
4
+ export { ACTION_CONTINUE, ACTION_CANCEL } from './constants';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lemon-fe/mini-app",
3
- "version": "1.0.5",
3
+ "version": "1.0.6-alpha.0",
4
4
  "description": "> TODO: description",
5
5
  "author": "鲁盛杰 <lusj@cnlemon.net>",
6
6
  "homepage": "",
@@ -31,5 +31,5 @@
31
31
  "react": "^17.0.2",
32
32
  "react-dom": "17.0.2"
33
33
  },
34
- "gitHead": "d9ddd36d56ec89285cde9f482a426118da7e11a5"
34
+ "gitHead": "bf835f371f1e84b5dc9807b5c2b31b4a0ad83d00"
35
35
  }