@dcloudio/uni-quickapp-webview 3.0.0-4010420240430002 → 3.0.0-4020320240708001

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.
@@ -1,6 +1,6 @@
1
1
  import { isArray, hasOwn, isString, isPlainObject, isObject, capitalize, toRawType, makeMap, isFunction, isPromise, extend, remove } from '@vue/shared';
2
2
  import { normalizeLocale, LOCALE_EN } from '@dcloudio/uni-i18n';
3
- import { LINEFEED, Emitter, onCreateVueApp, invokeCreateVueAppHook } from '@dcloudio/uni-shared';
3
+ import { Emitter, onCreateVueApp, invokeCreateVueAppHook } from '@dcloudio/uni-shared';
4
4
 
5
5
  function getBaseSystemInfo() {
6
6
  return qa.getSystemInfoSync();
@@ -191,7 +191,7 @@ function getApiCallbacks(args) {
191
191
  }
192
192
  return apiCallbacks;
193
193
  }
194
- function normalizeErrMsg$1(errMsg, name) {
194
+ function normalizeErrMsg(errMsg, name) {
195
195
  if (!errMsg || errMsg.indexOf(':fail') === -1) {
196
196
  return name + ':ok';
197
197
  }
@@ -208,7 +208,7 @@ function createAsyncApiCallback(name, args = {}, { beforeAll, beforeSuccess } =
208
208
  const callbackId = invokeCallbackId++;
209
209
  addInvokeCallback(callbackId, name, (res) => {
210
210
  res = res || {};
211
- res.errMsg = normalizeErrMsg$1(res.errMsg, name);
211
+ res.errMsg = normalizeErrMsg(res.errMsg, name);
212
212
  isFunction(beforeAll) && beforeAll(res);
213
213
  if (res.errMsg === name + ':ok') {
214
214
  isFunction(beforeSuccess) && beforeSuccess(res, args);
@@ -353,6 +353,7 @@ function promisify$1(name, fn) {
353
353
  function formatApiArgs(args, options) {
354
354
  const params = args[0];
355
355
  if (!options ||
356
+ !options.formatArgs ||
356
357
  (!isPlainObject(options.formatArgs) && isPlainObject(params))) {
357
358
  return;
358
359
  }
@@ -402,12 +403,12 @@ function beforeInvokeApi(name, args, protocol, options) {
402
403
  return errMsg;
403
404
  }
404
405
  }
405
- function normalizeErrMsg(errMsg) {
406
+ function parseErrMsg(errMsg) {
406
407
  if (!errMsg || isString(errMsg)) {
407
408
  return errMsg;
408
409
  }
409
410
  if (errMsg.stack) {
410
- console.error(errMsg.message + LINEFEED + errMsg.stack);
411
+ console.error(errMsg.message + '\n' + errMsg.stack);
411
412
  return errMsg.message;
412
413
  }
413
414
  return errMsg;
@@ -421,7 +422,7 @@ function wrapperTaskApi(name, fn, protocol, options) {
421
422
  }
422
423
  return fn(args, {
423
424
  resolve: (res) => invokeSuccess(id, name, res),
424
- reject: (errMsg, errRes) => invokeFail(id, name, normalizeErrMsg(errMsg), errRes),
425
+ reject: (errMsg, errRes) => invokeFail(id, name, parseErrMsg(errMsg), errRes),
425
426
  });
426
427
  };
427
428
  }
@@ -417,7 +417,7 @@ function initDefaultProps(options, isBehavior = false) {
417
417
  }
418
418
  if (options.behaviors) {
419
419
  // wx://form-field
420
- if (options.behaviors.includes('__GLOBAL__://form-field')) {
420
+ if (options.behaviors.includes('qa' + '://form-field')) {
421
421
  if (!options.properties || !options.properties.name) {
422
422
  properties.name = {
423
423
  type: null,
@@ -596,7 +596,8 @@ function initBehaviors(vueOptions) {
596
596
  const behaviors = [];
597
597
  if (isArray(vueBehaviors)) {
598
598
  vueBehaviors.forEach((behavior) => {
599
- behaviors.push(behavior.replace('uni://', '__GLOBAL__://'));
599
+ // 这里的 global 应该是个变量
600
+ behaviors.push(behavior.replace('uni://', 'qa' + '://'));
600
601
  if (behavior === 'uni://form-field') {
601
602
  if (isArray(vueProps)) {
602
603
  vueProps.push('name');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dcloudio/uni-quickapp-webview",
3
- "version": "3.0.0-4010420240430002",
3
+ "version": "3.0.0-4020320240708001",
4
4
  "description": "uni-app quickapp-webview",
5
5
  "main": "dist/index.js",
6
6
  "files": [
@@ -25,13 +25,13 @@
25
25
  },
26
26
  "gitHead": "33e807d66e1fe47e2ee08ad9c59247e37b8884da",
27
27
  "devDependencies": {
28
- "@dcloudio/uni-mp-compiler": "3.0.0-4010420240430002"
28
+ "@dcloudio/uni-mp-compiler": "3.0.0-4020320240708001"
29
29
  },
30
30
  "dependencies": {
31
- "@dcloudio/uni-cli-shared": "3.0.0-4010420240430002",
32
- "@dcloudio/uni-mp-vite": "3.0.0-4010420240430002",
33
- "@dcloudio/uni-mp-vue": "3.0.0-4010420240430002",
34
- "@dcloudio/uni-shared": "3.0.0-4010420240430002",
31
+ "@dcloudio/uni-cli-shared": "3.0.0-4020320240708001",
32
+ "@dcloudio/uni-mp-vite": "3.0.0-4020320240708001",
33
+ "@dcloudio/uni-mp-vue": "3.0.0-4020320240708001",
34
+ "@dcloudio/uni-shared": "3.0.0-4020320240708001",
35
35
  "@vue/shared": "3.4.21"
36
36
  }
37
37
  }