@tarojs/runtime 3.3.8 → 3.3.12

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/bom/raf.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /// <reference types="node" />
2
2
  export declare let now: any;
3
- declare let raf: typeof requestAnimationFrame | ((callback: any) => NodeJS.Timeout);
4
- declare let caf: typeof cancelAnimationFrame;
3
+ declare const raf: typeof requestAnimationFrame | ((callback: any) => NodeJS.Timeout);
4
+ declare const caf: typeof cancelAnimationFrame;
5
5
  export { raf, caf };
@@ -1688,7 +1688,8 @@ const styleProperties = [
1688
1688
  'whiteSpace',
1689
1689
  'widows',
1690
1690
  'width',
1691
- 'zIndex'
1691
+ 'zIndex',
1692
+ 'pointerEvents'
1692
1693
  /** 非常用 style */
1693
1694
  // 'azimuth',
1694
1695
  // 'backfaceVisibility',
@@ -4969,16 +4970,17 @@ let now;
4969
4970
  let lastTime = 0;
4970
4971
  // https://gist.github.com/paulirish/1579671
4971
4972
  // https://gist.github.com/jalbam/5fe05443270fa6d8136238ec72accbc0
4972
- let raf = typeof requestAnimationFrame !== 'undefined' && requestAnimationFrame !== null ? requestAnimationFrame : function (callback) {
4973
+ const raf = typeof requestAnimationFrame !== 'undefined' && requestAnimationFrame !== null ? requestAnimationFrame : function (callback) {
4973
4974
  const _now = now();
4974
4975
  const nextTime = Math.max(lastTime + 16, _now); // First time will execute it immediately but barely noticeable and performance is gained.
4975
4976
  return setTimeout(function () { callback(lastTime = nextTime); }, nextTime - _now);
4976
4977
  };
4977
- let caf = typeof cancelAnimationFrame !== 'undefined' && cancelAnimationFrame !== null ? cancelAnimationFrame : clearTimeout;
4978
- if (typeof global !== 'undefined') {
4979
- raf = raf.bind(global);
4980
- caf = caf.bind(global);
4981
- }
4978
+ const caf = typeof cancelAnimationFrame !== 'undefined' && cancelAnimationFrame !== null
4979
+ ? cancelAnimationFrame
4980
+ : function (seed) {
4981
+ // fix https://github.com/NervJS/taro/issues/7749
4982
+ clearTimeout(seed);
4983
+ };
4982
4984
 
4983
4985
  function getComputedStyle(element) {
4984
4986
  return element.style;
@@ -6069,6 +6071,27 @@ function createVue3App(app, h, config) {
6069
6071
  if (isBrowser) {
6070
6072
  appInstance = app.mount('#app');
6071
6073
  }
6074
+ // 把 App Class 上挂载的额外属性同步到全局 app 对象中
6075
+ // eslint-disable-next-line dot-notation
6076
+ if (app['taroGlobalData']) {
6077
+ // eslint-disable-next-line dot-notation
6078
+ const globalData = app['taroGlobalData'];
6079
+ const keys = Object.keys(globalData);
6080
+ const descriptors = Object.getOwnPropertyDescriptors(globalData);
6081
+ keys.forEach(key => {
6082
+ Object.defineProperty(this, key, {
6083
+ configurable: true,
6084
+ enumerable: true,
6085
+ get() {
6086
+ return globalData[key];
6087
+ },
6088
+ set(value) {
6089
+ globalData[key] = value;
6090
+ }
6091
+ });
6092
+ });
6093
+ Object.defineProperties(this, descriptors);
6094
+ }
6072
6095
  const onLaunch = (_a = appInstance === null || appInstance === void 0 ? void 0 : appInstance.$options) === null || _a === void 0 ? void 0 : _a.onLaunch;
6073
6096
  isFunction$1(onLaunch) && onLaunch.call(appInstance, options);
6074
6097
  }