@dcloudio/uni-quickapp-webview 3.0.0-alpha-3030820220114007 → 3.0.0-alpha-3030820220114011

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.
@@ -53,6 +53,57 @@ function getBaseSystemInfo() {
53
53
  return qa.getSystemInfoSync()
54
54
  }
55
55
 
56
+ const E = function () {
57
+ // Keep this empty so it's easier to inherit from
58
+ // (via https://github.com/lipsmack from https://github.com/scottcorgan/tiny-emitter/issues/3)
59
+ };
60
+ E.prototype = {
61
+ on: function (name, callback, ctx) {
62
+ var e = this.e || (this.e = {});
63
+ (e[name] || (e[name] = [])).push({
64
+ fn: callback,
65
+ ctx: ctx,
66
+ });
67
+ return this;
68
+ },
69
+ once: function (name, callback, ctx) {
70
+ var self = this;
71
+ function listener() {
72
+ self.off(name, listener);
73
+ callback.apply(ctx, arguments);
74
+ }
75
+ listener._ = callback;
76
+ return this.on(name, listener, ctx);
77
+ },
78
+ emit: function (name) {
79
+ var data = [].slice.call(arguments, 1);
80
+ var evtArr = ((this.e || (this.e = {}))[name] || []).slice();
81
+ var i = 0;
82
+ var len = evtArr.length;
83
+ for (i; i < len; i++) {
84
+ evtArr[i].fn.apply(evtArr[i].ctx, data);
85
+ }
86
+ return this;
87
+ },
88
+ off: function (name, callback) {
89
+ var e = this.e || (this.e = {});
90
+ var evts = e[name];
91
+ var liveEvents = [];
92
+ if (evts && callback) {
93
+ for (var i = 0, len = evts.length; i < len; i++) {
94
+ if (evts[i].fn !== callback && evts[i].fn._ !== callback)
95
+ liveEvents.push(evts[i]);
96
+ }
97
+ }
98
+ // Remove event from queue to prevent memory leak
99
+ // Suggested by https://github.com/lazd
100
+ // Ref: https://github.com/scottcorgan/tiny-emitter/commit/c6ebfaa9bc973b33d110a84a307742b7cf94c953#commitcomment-5024910
101
+ liveEvents.length ? (e[name] = liveEvents) : delete e[name];
102
+ return this;
103
+ },
104
+ };
105
+ var E$1 = E;
106
+
56
107
  function validateProtocolFail(name, msg) {
57
108
  console.warn(`${name}: ${msg}`);
58
109
  }
@@ -535,58 +586,7 @@ const EmitProtocol = [
535
586
  },
536
587
  ];
537
588
 
538
- const E = function () {
539
- // Keep this empty so it's easier to inherit from
540
- // (via https://github.com/lipsmack from https://github.com/scottcorgan/tiny-emitter/issues/3)
541
- };
542
- E.prototype = {
543
- on: function (name, callback, ctx) {
544
- var e = this.e || (this.e = {});
545
- (e[name] || (e[name] = [])).push({
546
- fn: callback,
547
- ctx: ctx,
548
- });
549
- return this;
550
- },
551
- once: function (name, callback, ctx) {
552
- var self = this;
553
- function listener() {
554
- self.off(name, listener);
555
- callback.apply(ctx, arguments);
556
- }
557
- listener._ = callback;
558
- return this.on(name, listener, ctx);
559
- },
560
- emit: function (name) {
561
- var data = [].slice.call(arguments, 1);
562
- var evtArr = ((this.e || (this.e = {}))[name] || []).slice();
563
- var i = 0;
564
- var len = evtArr.length;
565
- for (i; i < len; i++) {
566
- evtArr[i].fn.apply(evtArr[i].ctx, data);
567
- }
568
- return this;
569
- },
570
- off: function (name, callback) {
571
- var e = this.e || (this.e = {});
572
- var evts = e[name];
573
- var liveEvents = [];
574
- if (evts && callback) {
575
- for (var i = 0, len = evts.length; i < len; i++) {
576
- if (evts[i].fn !== callback && evts[i].fn._ !== callback)
577
- liveEvents.push(evts[i]);
578
- }
579
- }
580
- // Remove event from queue to prevent memory leak
581
- // Suggested by https://github.com/lazd
582
- // Ref: https://github.com/scottcorgan/tiny-emitter/commit/c6ebfaa9bc973b33d110a84a307742b7cf94c953#commitcomment-5024910
583
- liveEvents.length ? (e[name] = liveEvents) : delete e[name];
584
- return this;
585
- },
586
- };
587
- var Emitter = E;
588
-
589
- const emitter = new Emitter();
589
+ const emitter = new E$1();
590
590
  const $on = defineSyncApi(API_ON, (name, callback) => {
591
591
  emitter.on(name, callback);
592
592
  return () => emitter.off(name, callback);
@@ -93,6 +93,20 @@ function customizeEvent(str) {
93
93
  return camelize(str.replace(customizeRE, '-'));
94
94
  }
95
95
 
96
+ function hasLeadingSlash(str) {
97
+ return str.indexOf('/') === 0;
98
+ }
99
+ function addLeadingSlash(str) {
100
+ return hasLeadingSlash(str) ? str : '/' + str;
101
+ }
102
+ const invokeArrayFns = (fns, arg) => {
103
+ let ret;
104
+ for (let i = 0; i < fns.length; i++) {
105
+ ret = fns[i](arg);
106
+ }
107
+ return ret;
108
+ };
109
+
96
110
  const encode = encodeURIComponent;
97
111
  function stringifyQuery(obj, encodeStr = encode) {
98
112
  const res = obj
@@ -113,20 +127,6 @@ function stringifyQuery(obj, encodeStr = encode) {
113
127
  return res ? `?${res}` : '';
114
128
  }
115
129
 
116
- function hasLeadingSlash(str) {
117
- return str.indexOf('/') === 0;
118
- }
119
- function addLeadingSlash(str) {
120
- return hasLeadingSlash(str) ? str : '/' + str;
121
- }
122
- const invokeArrayFns = (fns, arg) => {
123
- let ret;
124
- for (let i = 0; i < fns.length; i++) {
125
- ret = fns[i](arg);
126
- }
127
- return ret;
128
- };
129
-
130
130
  class EventChannel {
131
131
  constructor(id, events) {
132
132
  this.id = id;
@@ -190,11 +190,13 @@ class EventChannel {
190
190
  }
191
191
  }
192
192
 
193
- const MINI_PROGRAM_PAGE_RUNTIME_HOOKS = {
194
- onPageScroll: 1,
195
- onShareAppMessage: 1 << 1,
196
- onShareTimeline: 1 << 2,
197
- };
193
+ const MINI_PROGRAM_PAGE_RUNTIME_HOOKS = /*#__PURE__*/ (() => {
194
+ return {
195
+ onPageScroll: 1,
196
+ onShareAppMessage: 1 << 1,
197
+ onShareTimeline: 1 << 2,
198
+ };
199
+ })();
198
200
 
199
201
  const eventChannels = {};
200
202
  const eventChannelStack = [];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dcloudio/uni-quickapp-webview",
3
- "version": "3.0.0-alpha-3030820220114007",
3
+ "version": "3.0.0-alpha-3030820220114011",
4
4
  "description": "uni-app quickapp-webview",
5
5
  "main": "dist/index.js",
6
6
  "repository": {
@@ -25,10 +25,10 @@
25
25
  "@vue/compiler-core": "3.2.30"
26
26
  },
27
27
  "dependencies": {
28
- "@dcloudio/uni-cli-shared": "3.0.0-alpha-3030820220114007",
29
- "@dcloudio/uni-mp-vite": "3.0.0-alpha-3030820220114007",
30
- "@dcloudio/uni-mp-vue": "3.0.0-alpha-3030820220114007",
31
- "@dcloudio/uni-shared": "3.0.0-alpha-3030820220114007",
28
+ "@dcloudio/uni-cli-shared": "3.0.0-alpha-3030820220114011",
29
+ "@dcloudio/uni-mp-vite": "3.0.0-alpha-3030820220114011",
30
+ "@dcloudio/uni-mp-vue": "3.0.0-alpha-3030820220114011",
31
+ "@dcloudio/uni-shared": "3.0.0-alpha-3030820220114011",
32
32
  "@vue/shared": "3.2.30"
33
33
  }
34
34
  }