diff --git a/packages/uni-mp-weixin/dist/index.js b/packages/uni-mp-weixin/dist/index.js index acfc0194a517d2f7a002844f011637a920f75cd7..2e0e5d62e43d72b64ca9a19d0ddcda5bc4c66324 100644 --- a/packages/uni-mp-weixin/dist/index.js +++ b/packages/uni-mp-weixin/dist/index.js @@ -19,7 +19,7 @@ function hasOwn (obj, key) { return hasOwnProperty.call(obj, key) } -function noop () { } +function noop () {} /** * Create a cached version of a pure function. @@ -385,11 +385,28 @@ var previewImage = { } }; +function addSafeAreaInsets (result) { + if (result.safeArea) { + const safeArea = result.safeArea; + result.safeAreaInsets = { + top: safeArea.top, + left: safeArea.left, + right: result.windowWidth - safeArea.right, + bottom: result.windowHeight - safeArea.bottom + }; + } +} const protocols = { - previewImage + previewImage, + getSystemInfo: { + returnValue: addSafeAreaInsets + }, + getSystemInfoSync: { + returnValue: addSafeAreaInsets + } }; -const todos = [ - 'vibrate' +const todos = [ + 'vibrate' ]; const canIUses = [];