@tarojs/runtime 3.7.0-canary.1 → 3.7.0-canary.2
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/runtime.cjs.d.ts +136 -66
- package/dist/runtime.cjs.js +148 -59
- package/dist/runtime.esm.d.ts +136 -66
- package/dist/runtime.esm.js +59 -28
- package/dist/runtime.esm.js.map +1 -1
- package/dist/runtime.h5.d.ts +136 -66
- package/dist/runtime.h5.js +136 -48
- package/package.json +4 -4
package/dist/runtime.h5.js
CHANGED
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
var shared = require('@tarojs/shared');
|
|
4
4
|
|
|
5
5
|
const PROPERTY_THRESHOLD = 2046;
|
|
6
|
+
const TARO_RUNTIME = 'Taro runtime';
|
|
7
|
+
const HOOKS_APP_ID = 'taro-app';
|
|
6
8
|
const SET_DATA = '小程序 setData';
|
|
7
9
|
const PAGE_INIT = '页面初始化';
|
|
8
10
|
const ROOT_STR = 'root';
|
|
@@ -21,6 +23,9 @@ const FOCUS = 'focus';
|
|
|
21
23
|
const VIEW = 'view';
|
|
22
24
|
const STATIC_VIEW = 'static-view';
|
|
23
25
|
const PURE_VIEW = 'pure-view';
|
|
26
|
+
const PROPS = 'props';
|
|
27
|
+
const DATASET = 'dataset';
|
|
28
|
+
const OBJECT = 'object';
|
|
24
29
|
const VALUE = 'value';
|
|
25
30
|
const INPUT = 'input';
|
|
26
31
|
const CHANGE = 'change';
|
|
@@ -32,6 +37,8 @@ const CONFIRM = 'confirm';
|
|
|
32
37
|
const TIME_STAMP = 'timeStamp';
|
|
33
38
|
const KEY_CODE = 'keyCode';
|
|
34
39
|
const TOUCHMOVE = 'touchmove';
|
|
40
|
+
const DATE = 'Date';
|
|
41
|
+
const SET_TIMEOUT = 'setTimeout';
|
|
35
42
|
const CATCHMOVE = 'catchMove';
|
|
36
43
|
const CATCH_VIEW = 'catch-view';
|
|
37
44
|
const COMMENT = 'comment';
|
|
@@ -47,13 +54,13 @@ const A = 'a';
|
|
|
47
54
|
/**
|
|
48
55
|
* 页面上下文切换时的行为
|
|
49
56
|
*/
|
|
50
|
-
|
|
57
|
+
exports.CONTEXT_ACTIONS = void 0;
|
|
51
58
|
(function (CONTEXT_ACTIONS) {
|
|
52
59
|
CONTEXT_ACTIONS["INIT"] = "0";
|
|
53
60
|
CONTEXT_ACTIONS["RESTORE"] = "1";
|
|
54
61
|
CONTEXT_ACTIONS["RECOVER"] = "2";
|
|
55
62
|
CONTEXT_ACTIONS["DESTORY"] = "3";
|
|
56
|
-
})(CONTEXT_ACTIONS || (CONTEXT_ACTIONS = {}));
|
|
63
|
+
})(exports.CONTEXT_ACTIONS || (exports.CONTEXT_ACTIONS = {}));
|
|
57
64
|
|
|
58
65
|
const observers = [];
|
|
59
66
|
/** Match two TaroNodes by sid. */
|
|
@@ -117,7 +124,7 @@ class MutationObserver {
|
|
|
117
124
|
constructor(callback) {
|
|
118
125
|
{
|
|
119
126
|
if (process.env.NODE_ENV !== 'production') {
|
|
120
|
-
console.warn('[Taro Warning] 若要使用 MutationObserver,请在 Taro 编译配置中设置 \'mini.enableMutationObserver: true\'');
|
|
127
|
+
console.warn('[Taro Warning] 若要使用 MutationObserver,请在 Taro 编译配置中设置 \'mini.runtime.enableMutationObserver: true\'');
|
|
121
128
|
}
|
|
122
129
|
this.core = {
|
|
123
130
|
observe: shared.noop,
|
|
@@ -191,15 +198,15 @@ function isHasExtractProp(el) {
|
|
|
191
198
|
*/
|
|
192
199
|
function isParentBinded(node, type) {
|
|
193
200
|
var _a;
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
201
|
+
while ((node = (node === null || node === void 0 ? void 0 : node.parentElement) || null)) {
|
|
202
|
+
if (!node || node.nodeName === ROOT_STR || node.nodeName === 'root-portal') {
|
|
203
|
+
return false;
|
|
204
|
+
}
|
|
205
|
+
else if ((_a = node.__handlers[type]) === null || _a === void 0 ? void 0 : _a.length) {
|
|
206
|
+
return true;
|
|
199
207
|
}
|
|
200
|
-
node = node.parentElement;
|
|
201
208
|
}
|
|
202
|
-
return
|
|
209
|
+
return false;
|
|
203
210
|
}
|
|
204
211
|
function shortcutAttr(key) {
|
|
205
212
|
switch (key) {
|
|
@@ -349,6 +356,7 @@ let componentsAlias;
|
|
|
349
356
|
* it's a vnode traverser and modifier: that's exactly what Taro's doing in here.
|
|
350
357
|
*/
|
|
351
358
|
function hydrate(node) {
|
|
359
|
+
var _a;
|
|
352
360
|
if (!componentsAlias) {
|
|
353
361
|
// 初始化 componentsAlias
|
|
354
362
|
componentsAlias = getComponentsAlias();
|
|
@@ -360,8 +368,9 @@ function hydrate(node) {
|
|
|
360
368
|
const nodeName = node.nodeName;
|
|
361
369
|
if (isText(node)) {
|
|
362
370
|
return {
|
|
371
|
+
sid: node.sid,
|
|
363
372
|
["v" /* Shortcuts.Text */]: node.nodeValue,
|
|
364
|
-
["nn" /* Shortcuts.NodeName */]: componentsAlias[nodeName]._num
|
|
373
|
+
["nn" /* Shortcuts.NodeName */]: ((_a = componentsAlias[nodeName]) === null || _a === void 0 ? void 0 : _a._num) || '8'
|
|
365
374
|
};
|
|
366
375
|
}
|
|
367
376
|
const data = {
|
|
@@ -407,7 +416,7 @@ function hydrate(node) {
|
|
|
407
416
|
if (cssText !== '' && nodeName !== 'swiper-item') {
|
|
408
417
|
data["st" /* Shortcuts.Style */] = cssText;
|
|
409
418
|
}
|
|
410
|
-
shared.hooks.call('modifyHydrateData', data);
|
|
419
|
+
shared.hooks.call('modifyHydrateData', data, node);
|
|
411
420
|
const nn = data["nn" /* Shortcuts.NodeName */];
|
|
412
421
|
const componentAlias = componentsAlias[nn];
|
|
413
422
|
if (componentAlias) {
|
|
@@ -419,7 +428,8 @@ function hydrate(node) {
|
|
|
419
428
|
}
|
|
420
429
|
}
|
|
421
430
|
}
|
|
422
|
-
|
|
431
|
+
const resData = shared.hooks.call('transferHydrateData', data, node, componentAlias);
|
|
432
|
+
return resData || data;
|
|
423
433
|
}
|
|
424
434
|
|
|
425
435
|
class TaroEventTarget {
|
|
@@ -984,7 +994,7 @@ function setStyle(newVal, styleKey) {
|
|
|
984
994
|
if (old === newVal)
|
|
985
995
|
return;
|
|
986
996
|
!this._pending && recordCss(this);
|
|
987
|
-
if (shared.isNull(newVal) || shared.isUndefined(newVal)) {
|
|
997
|
+
if (shared.isNull(newVal) || shared.isUndefined(newVal) || newVal === '') {
|
|
988
998
|
this._usedStyleProp.delete(styleKey);
|
|
989
999
|
delete this._value[styleKey];
|
|
990
1000
|
}
|
|
@@ -1430,6 +1440,7 @@ class TaroElement extends TaroNode {
|
|
|
1430
1440
|
sideEffect = false;
|
|
1431
1441
|
delete options.sideEffect;
|
|
1432
1442
|
}
|
|
1443
|
+
shared.hooks.call('modifyAddEventListener', this, sideEffect, getComponentsAlias);
|
|
1433
1444
|
if (sideEffect !== false && !this.isAnyEventBinded() && SPECIAL_NODES.indexOf(name) > -1) {
|
|
1434
1445
|
const componentsAlias = getComponentsAlias();
|
|
1435
1446
|
const alias = componentsAlias[name]._num;
|
|
@@ -1444,6 +1455,7 @@ class TaroElement extends TaroNode {
|
|
|
1444
1455
|
super.removeEventListener(type, handler);
|
|
1445
1456
|
const name = this.nodeName;
|
|
1446
1457
|
const SPECIAL_NODES = shared.hooks.call('getSpecialNodes');
|
|
1458
|
+
shared.hooks.call('modifyRemoveEventListener', this, sideEffect, getComponentsAlias);
|
|
1447
1459
|
if (sideEffect !== false && !this.isAnyEventBinded() && SPECIAL_NODES.indexOf(name) > -1) {
|
|
1448
1460
|
const componentsAlias = getComponentsAlias();
|
|
1449
1461
|
const value = isHasExtractProp(this) ? `static-${name}` : `pure-${name}`;
|
|
@@ -1522,13 +1534,14 @@ class TaroEvent {
|
|
|
1522
1534
|
this.defaultPrevented = true;
|
|
1523
1535
|
}
|
|
1524
1536
|
get target() {
|
|
1525
|
-
var _a, _b;
|
|
1537
|
+
var _a, _b, _c, _d;
|
|
1526
1538
|
const cacheTarget = this.cacheTarget;
|
|
1527
1539
|
if (!cacheTarget) {
|
|
1528
1540
|
const target = Object.create(((_a = this.mpEvent) === null || _a === void 0 ? void 0 : _a.target) || null);
|
|
1529
|
-
|
|
1541
|
+
// Note:优先判断冒泡场景alipay的targetDataset的sid, 不然冒泡场景target属性吐出不对,其余拿取当前绑定id
|
|
1542
|
+
const element = env.document.getElementById(((_b = target.targetDataset) === null || _b === void 0 ? void 0 : _b.sid) || ((_c = target.dataset) === null || _c === void 0 ? void 0 : _c.sid) || target.id || null);
|
|
1530
1543
|
target.dataset = element !== null ? element.dataset : shared.EMPTY_OBJ;
|
|
1531
|
-
for (const key in (
|
|
1544
|
+
for (const key in (_d = this.mpEvent) === null || _d === void 0 ? void 0 : _d.detail) {
|
|
1532
1545
|
target[key] = this.mpEvent.detail[key];
|
|
1533
1546
|
}
|
|
1534
1547
|
this.cacheTarget = target;
|
|
@@ -1539,19 +1552,19 @@ class TaroEvent {
|
|
|
1539
1552
|
}
|
|
1540
1553
|
}
|
|
1541
1554
|
get currentTarget() {
|
|
1542
|
-
var _a, _b, _c, _d;
|
|
1555
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
1543
1556
|
const cacheCurrentTarget = this.cacheCurrentTarget;
|
|
1544
1557
|
if (!cacheCurrentTarget) {
|
|
1545
1558
|
const doc = env.document;
|
|
1546
1559
|
const currentTarget = Object.create(((_a = this.mpEvent) === null || _a === void 0 ? void 0 : _a.currentTarget) || null);
|
|
1547
|
-
const element = doc.getElementById(currentTarget.id);
|
|
1548
|
-
const targetElement = doc.getElementById(((_c = (
|
|
1560
|
+
const element = doc.getElementById(((_b = currentTarget.dataset) === null || _b === void 0 ? void 0 : _b.sid) || currentTarget.id || null);
|
|
1561
|
+
const targetElement = doc.getElementById(((_e = (_d = (_c = this.mpEvent) === null || _c === void 0 ? void 0 : _c.target) === null || _d === void 0 ? void 0 : _d.dataset) === null || _e === void 0 ? void 0 : _e.sid) || ((_g = (_f = this.mpEvent) === null || _f === void 0 ? void 0 : _f.target) === null || _g === void 0 ? void 0 : _g.id) || null);
|
|
1549
1562
|
if (element === null || (element && element === targetElement)) {
|
|
1550
1563
|
this.cacheCurrentTarget = this.target;
|
|
1551
1564
|
return this.target;
|
|
1552
1565
|
}
|
|
1553
1566
|
currentTarget.dataset = element.dataset;
|
|
1554
|
-
for (const key in (
|
|
1567
|
+
for (const key in (_h = this.mpEvent) === null || _h === void 0 ? void 0 : _h.detail) {
|
|
1555
1568
|
currentTarget[key] = this.mpEvent.detail[key];
|
|
1556
1569
|
}
|
|
1557
1570
|
this.cacheCurrentTarget = currentTarget;
|
|
@@ -2300,7 +2313,15 @@ class AnchorElement extends TaroElement {
|
|
|
2300
2313
|
}
|
|
2301
2314
|
}
|
|
2302
2315
|
|
|
2303
|
-
class
|
|
2316
|
+
class TransferElement extends TaroElement {
|
|
2317
|
+
constructor(dataName) {
|
|
2318
|
+
super();
|
|
2319
|
+
this.dataName = dataName;
|
|
2320
|
+
this.isTransferElement = true;
|
|
2321
|
+
}
|
|
2322
|
+
get _path() {
|
|
2323
|
+
return this.dataName;
|
|
2324
|
+
}
|
|
2304
2325
|
}
|
|
2305
2326
|
|
|
2306
2327
|
class TaroDocument extends TaroElement {
|
|
@@ -2323,8 +2344,9 @@ class TaroDocument extends TaroElement {
|
|
|
2323
2344
|
case nodeName === A:
|
|
2324
2345
|
element = new AnchorElement();
|
|
2325
2346
|
break;
|
|
2326
|
-
case nodeName ===
|
|
2327
|
-
|
|
2347
|
+
case nodeName === 'page-meta':
|
|
2348
|
+
case nodeName === 'navigation-bar':
|
|
2349
|
+
element = new TransferElement(shared.toCamelCase(nodeName));
|
|
2328
2350
|
break;
|
|
2329
2351
|
default:
|
|
2330
2352
|
element = new TaroElement();
|
|
@@ -2466,17 +2488,17 @@ class History extends shared.Events {
|
|
|
2466
2488
|
__classPrivateFieldGet(this, _History_instances, "m", _History_reset).call(this, href);
|
|
2467
2489
|
}, null);
|
|
2468
2490
|
// 切换上下文行为
|
|
2469
|
-
this.on(CONTEXT_ACTIONS.INIT, () => {
|
|
2491
|
+
this.on(exports.CONTEXT_ACTIONS.INIT, () => {
|
|
2470
2492
|
__classPrivateFieldGet(this, _History_instances, "m", _History_reset).call(this);
|
|
2471
2493
|
}, null);
|
|
2472
|
-
this.on(CONTEXT_ACTIONS.RESTORE, (pageId) => {
|
|
2494
|
+
this.on(exports.CONTEXT_ACTIONS.RESTORE, (pageId) => {
|
|
2473
2495
|
cache$1.set(pageId, {
|
|
2474
2496
|
location: __classPrivateFieldGet(this, _History_location, "f"),
|
|
2475
2497
|
stack: __classPrivateFieldGet(this, _History_stack, "f").slice(),
|
|
2476
2498
|
cur: __classPrivateFieldGet(this, _History_cur, "f")
|
|
2477
2499
|
});
|
|
2478
2500
|
}, null);
|
|
2479
|
-
this.on(CONTEXT_ACTIONS.RECOVER, (pageId) => {
|
|
2501
|
+
this.on(exports.CONTEXT_ACTIONS.RECOVER, (pageId) => {
|
|
2480
2502
|
if (cache$1.has(pageId)) {
|
|
2481
2503
|
const ctx = cache$1.get(pageId);
|
|
2482
2504
|
__classPrivateFieldSet(this, _History_location, ctx.location, "f");
|
|
@@ -2484,7 +2506,7 @@ class History extends shared.Events {
|
|
|
2484
2506
|
__classPrivateFieldSet(this, _History_cur, ctx.cur, "f");
|
|
2485
2507
|
}
|
|
2486
2508
|
}, null);
|
|
2487
|
-
this.on(CONTEXT_ACTIONS.DESTORY, (pageId) => {
|
|
2509
|
+
this.on(exports.CONTEXT_ACTIONS.DESTORY, (pageId) => {
|
|
2488
2510
|
cache$1.delete(pageId);
|
|
2489
2511
|
}, null);
|
|
2490
2512
|
__classPrivateFieldGet(this, _History_instances, "m", _History_reset).call(this);
|
|
@@ -2580,15 +2602,15 @@ class Location extends shared.Events {
|
|
|
2580
2602
|
__classPrivateFieldSet(this, _Location_noCheckUrl, false, "f");
|
|
2581
2603
|
}, null);
|
|
2582
2604
|
// 切换上下文行为
|
|
2583
|
-
this.on(CONTEXT_ACTIONS.INIT, () => {
|
|
2605
|
+
this.on(exports.CONTEXT_ACTIONS.INIT, () => {
|
|
2584
2606
|
__classPrivateFieldGet(this, _Location_instances, "m", _Location_reset).call(this);
|
|
2585
2607
|
}, null);
|
|
2586
|
-
this.on(CONTEXT_ACTIONS.RESTORE, (pageId) => {
|
|
2608
|
+
this.on(exports.CONTEXT_ACTIONS.RESTORE, (pageId) => {
|
|
2587
2609
|
cache.set(pageId, {
|
|
2588
2610
|
lastHref: this.href,
|
|
2589
2611
|
});
|
|
2590
2612
|
}, null);
|
|
2591
|
-
this.on(CONTEXT_ACTIONS.RECOVER, (pageId) => {
|
|
2613
|
+
this.on(exports.CONTEXT_ACTIONS.RECOVER, (pageId) => {
|
|
2592
2614
|
// 数据恢复时,不需要执行跳转
|
|
2593
2615
|
if (cache.has(pageId)) {
|
|
2594
2616
|
const ctx = cache.get(pageId);
|
|
@@ -2597,7 +2619,7 @@ class Location extends shared.Events {
|
|
|
2597
2619
|
__classPrivateFieldSet(this, _Location_noCheckUrl, false, "f");
|
|
2598
2620
|
}
|
|
2599
2621
|
}, null);
|
|
2600
|
-
this.on(CONTEXT_ACTIONS.DESTORY, (pageId) => {
|
|
2622
|
+
this.on(exports.CONTEXT_ACTIONS.DESTORY, (pageId) => {
|
|
2601
2623
|
cache.delete(pageId);
|
|
2602
2624
|
}, null);
|
|
2603
2625
|
}
|
|
@@ -2855,24 +2877,24 @@ if (process.env.TARO_ENV && !true) {
|
|
|
2855
2877
|
initEvent() {
|
|
2856
2878
|
const _location = this.location;
|
|
2857
2879
|
const _history = this.history;
|
|
2858
|
-
this.on(CONTEXT_ACTIONS.INIT, (pageId) => {
|
|
2880
|
+
this.on(exports.CONTEXT_ACTIONS.INIT, (pageId) => {
|
|
2859
2881
|
// 页面onload,为该页面建立新的上下文信息
|
|
2860
|
-
_location.trigger(CONTEXT_ACTIONS.INIT, pageId);
|
|
2882
|
+
_location.trigger(exports.CONTEXT_ACTIONS.INIT, pageId);
|
|
2861
2883
|
}, null);
|
|
2862
|
-
this.on(CONTEXT_ACTIONS.RECOVER, (pageId) => {
|
|
2884
|
+
this.on(exports.CONTEXT_ACTIONS.RECOVER, (pageId) => {
|
|
2863
2885
|
// 页面onshow,恢复当前页面的上下文信息
|
|
2864
|
-
_location.trigger(CONTEXT_ACTIONS.RECOVER, pageId);
|
|
2865
|
-
_history.trigger(CONTEXT_ACTIONS.RECOVER, pageId);
|
|
2886
|
+
_location.trigger(exports.CONTEXT_ACTIONS.RECOVER, pageId);
|
|
2887
|
+
_history.trigger(exports.CONTEXT_ACTIONS.RECOVER, pageId);
|
|
2866
2888
|
}, null);
|
|
2867
|
-
this.on(CONTEXT_ACTIONS.RESTORE, (pageId) => {
|
|
2889
|
+
this.on(exports.CONTEXT_ACTIONS.RESTORE, (pageId) => {
|
|
2868
2890
|
// 页面onhide,缓存当前页面的上下文信息
|
|
2869
|
-
_location.trigger(CONTEXT_ACTIONS.RESTORE, pageId);
|
|
2870
|
-
_history.trigger(CONTEXT_ACTIONS.RESTORE, pageId);
|
|
2891
|
+
_location.trigger(exports.CONTEXT_ACTIONS.RESTORE, pageId);
|
|
2892
|
+
_history.trigger(exports.CONTEXT_ACTIONS.RESTORE, pageId);
|
|
2871
2893
|
}, null);
|
|
2872
|
-
this.on(CONTEXT_ACTIONS.DESTORY, (pageId) => {
|
|
2894
|
+
this.on(exports.CONTEXT_ACTIONS.DESTORY, (pageId) => {
|
|
2873
2895
|
// 页面onunload,清除当前页面的上下文信息
|
|
2874
|
-
_location.trigger(CONTEXT_ACTIONS.DESTORY, pageId);
|
|
2875
|
-
_history.trigger(CONTEXT_ACTIONS.DESTORY, pageId);
|
|
2896
|
+
_location.trigger(exports.CONTEXT_ACTIONS.DESTORY, pageId);
|
|
2897
|
+
_history.trigger(exports.CONTEXT_ACTIONS.DESTORY, pageId);
|
|
2876
2898
|
}, null);
|
|
2877
2899
|
}
|
|
2878
2900
|
get document() {
|
|
@@ -3074,8 +3096,19 @@ function createPageConfig(component, pageName, data, pageConfig) {
|
|
|
3074
3096
|
}
|
|
3075
3097
|
};
|
|
3076
3098
|
LIFECYCLES.forEach((lifecycle) => {
|
|
3099
|
+
let isDefer = false;
|
|
3100
|
+
lifecycle = lifecycle.replace(/^defer:/, () => {
|
|
3101
|
+
isDefer = true;
|
|
3102
|
+
return '';
|
|
3103
|
+
});
|
|
3077
3104
|
config[lifecycle] = function () {
|
|
3078
|
-
|
|
3105
|
+
const exec = () => safeExecute(this.$taroPath, lifecycle, ...arguments);
|
|
3106
|
+
if (isDefer) {
|
|
3107
|
+
hasLoaded.then(exec);
|
|
3108
|
+
}
|
|
3109
|
+
else {
|
|
3110
|
+
return exec();
|
|
3111
|
+
}
|
|
3079
3112
|
};
|
|
3080
3113
|
});
|
|
3081
3114
|
// onShareAppMessage 和 onShareTimeline 一样,会影响小程序右上方按钮的选项,因此不能默认注册。
|
|
@@ -3114,7 +3147,8 @@ function createComponentConfig(component, componentName, data) {
|
|
|
3114
3147
|
[ATTACHED]() {
|
|
3115
3148
|
var _a;
|
|
3116
3149
|
perf.start(PAGE_INIT);
|
|
3117
|
-
|
|
3150
|
+
this.pageIdCache = ((_a = this.getPageId) === null || _a === void 0 ? void 0 : _a.call(this)) || pageId();
|
|
3151
|
+
const path = getPath(id, { id: this.pageIdCache });
|
|
3118
3152
|
Current.app.mount(component, path, () => {
|
|
3119
3153
|
componentElement = env.document.getElementById(path);
|
|
3120
3154
|
shared.ensure(componentElement !== null, '没有找到组件实例。');
|
|
@@ -3123,7 +3157,7 @@ function createComponentConfig(component, componentName, data) {
|
|
|
3123
3157
|
});
|
|
3124
3158
|
},
|
|
3125
3159
|
[DETACHED]() {
|
|
3126
|
-
const path = getPath(id, { id: this.
|
|
3160
|
+
const path = getPath(id, { id: this.pageIdCache });
|
|
3127
3161
|
Current.app.unmount(path, () => {
|
|
3128
3162
|
instances.delete(path);
|
|
3129
3163
|
if (componentElement) {
|
|
@@ -3173,7 +3207,7 @@ function createRecursiveComponentConfig(componentName) {
|
|
|
3173
3207
|
}
|
|
3174
3208
|
}
|
|
3175
3209
|
: shared.EMPTY_OBJ;
|
|
3176
|
-
return Object.assign({ properties: {
|
|
3210
|
+
return shared.hooks.call('modifyRecursiveComponentConfig', Object.assign({ properties: {
|
|
3177
3211
|
i: {
|
|
3178
3212
|
type: Object,
|
|
3179
3213
|
value: {
|
|
@@ -3189,7 +3223,7 @@ function createRecursiveComponentConfig(componentName) {
|
|
|
3189
3223
|
virtualHost: !isCustomWrapper
|
|
3190
3224
|
}, methods: {
|
|
3191
3225
|
eh: eventHandler
|
|
3192
|
-
} }, lifeCycles);
|
|
3226
|
+
} }, lifeCycles), { isCustomWrapper });
|
|
3193
3227
|
}
|
|
3194
3228
|
|
|
3195
3229
|
const TIMEOUT = 100;
|
|
@@ -3239,37 +3273,91 @@ Object.defineProperty(exports, 'hooks', {
|
|
|
3239
3273
|
enumerable: true,
|
|
3240
3274
|
get: function () { return shared.hooks; }
|
|
3241
3275
|
});
|
|
3276
|
+
exports.A = A;
|
|
3277
|
+
exports.APP = APP;
|
|
3278
|
+
exports.BEHAVIORS = BEHAVIORS;
|
|
3279
|
+
exports.BODY = BODY;
|
|
3280
|
+
exports.CATCHMOVE = CATCHMOVE;
|
|
3281
|
+
exports.CATCH_VIEW = CATCH_VIEW;
|
|
3282
|
+
exports.CHANGE = CHANGE;
|
|
3283
|
+
exports.CLASS = CLASS;
|
|
3284
|
+
exports.COMMENT = COMMENT;
|
|
3285
|
+
exports.CONFIRM = CONFIRM;
|
|
3286
|
+
exports.CONTAINER = CONTAINER;
|
|
3287
|
+
exports.CURRENT_TARGET = CURRENT_TARGET;
|
|
3288
|
+
exports.CUSTOM_WRAPPER = CUSTOM_WRAPPER;
|
|
3242
3289
|
exports.Current = Current;
|
|
3290
|
+
exports.DATASET = DATASET;
|
|
3291
|
+
exports.DATE = DATE;
|
|
3292
|
+
exports.DOCUMENT_ELEMENT_NAME = DOCUMENT_ELEMENT_NAME;
|
|
3293
|
+
exports.DOCUMENT_FRAGMENT = DOCUMENT_FRAGMENT;
|
|
3294
|
+
exports.EVENT_CALLBACK_RESULT = EVENT_CALLBACK_RESULT;
|
|
3295
|
+
exports.EXTERNAL_CLASSES = EXTERNAL_CLASSES;
|
|
3296
|
+
exports.FOCUS = FOCUS;
|
|
3243
3297
|
exports.FormElement = FormElement;
|
|
3298
|
+
exports.HEAD = HEAD;
|
|
3299
|
+
exports.HOOKS_APP_ID = HOOKS_APP_ID;
|
|
3300
|
+
exports.HTML = HTML;
|
|
3244
3301
|
exports.History = History;
|
|
3302
|
+
exports.ID = ID;
|
|
3303
|
+
exports.INPUT = INPUT;
|
|
3304
|
+
exports.KEY_CODE = KEY_CODE;
|
|
3245
3305
|
exports.Location = Location;
|
|
3246
3306
|
exports.MutationObserver = MutationObserver;
|
|
3307
|
+
exports.OBJECT = OBJECT;
|
|
3308
|
+
exports.ON_HIDE = ON_HIDE;
|
|
3309
|
+
exports.ON_LOAD = ON_LOAD;
|
|
3310
|
+
exports.ON_READY = ON_READY;
|
|
3311
|
+
exports.ON_SHOW = ON_SHOW;
|
|
3312
|
+
exports.OPTIONS = OPTIONS;
|
|
3313
|
+
exports.PAGE_INIT = PAGE_INIT;
|
|
3314
|
+
exports.PROPERTY_THRESHOLD = PROPERTY_THRESHOLD;
|
|
3315
|
+
exports.PROPS = PROPS;
|
|
3316
|
+
exports.PURE_VIEW = PURE_VIEW;
|
|
3317
|
+
exports.ROOT_STR = ROOT_STR;
|
|
3318
|
+
exports.SET_DATA = SET_DATA;
|
|
3319
|
+
exports.SET_TIMEOUT = SET_TIMEOUT;
|
|
3320
|
+
exports.STATIC_VIEW = STATIC_VIEW;
|
|
3321
|
+
exports.STYLE = STYLE;
|
|
3247
3322
|
exports.SVGElement = SVGElement;
|
|
3248
3323
|
exports.Style = Style;
|
|
3324
|
+
exports.TARGET = TARGET;
|
|
3325
|
+
exports.TARO_RUNTIME = TARO_RUNTIME;
|
|
3326
|
+
exports.TIME_STAMP = TIME_STAMP;
|
|
3327
|
+
exports.TOUCHMOVE = TOUCHMOVE;
|
|
3328
|
+
exports.TYPE = TYPE;
|
|
3249
3329
|
exports.TaroElement = TaroElement;
|
|
3250
3330
|
exports.TaroEvent = TaroEvent;
|
|
3251
3331
|
exports.TaroNode = TaroNode;
|
|
3252
3332
|
exports.TaroRootElement = TaroRootElement;
|
|
3253
3333
|
exports.TaroText = TaroText;
|
|
3334
|
+
exports.UID = UID;
|
|
3254
3335
|
exports.URL = URL;
|
|
3255
3336
|
exports.URLSearchParams = URLSearchParams;
|
|
3337
|
+
exports.VALUE = VALUE;
|
|
3338
|
+
exports.VIEW = VIEW;
|
|
3256
3339
|
exports.addLeadingSlash = addLeadingSlash;
|
|
3257
3340
|
exports.cancelAnimationFrame = _caf;
|
|
3258
3341
|
exports.createComponentConfig = createComponentConfig;
|
|
3259
3342
|
exports.createEvent = createEvent;
|
|
3260
3343
|
exports.createPageConfig = createPageConfig;
|
|
3261
3344
|
exports.createRecursiveComponentConfig = createRecursiveComponentConfig;
|
|
3345
|
+
exports.env = env;
|
|
3262
3346
|
exports.eventCenter = eventCenter;
|
|
3263
3347
|
exports.eventHandler = eventHandler;
|
|
3264
3348
|
exports.eventSource = eventSource;
|
|
3265
3349
|
exports.getComputedStyle = getComputedStyle;
|
|
3266
3350
|
exports.getCurrentInstance = getCurrentInstance;
|
|
3351
|
+
exports.getOnHideEventKey = getOnHideEventKey;
|
|
3352
|
+
exports.getOnReadyEventKey = getOnReadyEventKey;
|
|
3353
|
+
exports.getOnShowEventKey = getOnShowEventKey;
|
|
3267
3354
|
exports.getPageInstance = getPageInstance;
|
|
3268
3355
|
exports.getPath = getPath;
|
|
3269
3356
|
exports.history = history;
|
|
3270
3357
|
exports.hydrate = hydrate;
|
|
3271
3358
|
exports.incrementId = incrementId;
|
|
3272
3359
|
exports.injectPageInstance = injectPageInstance;
|
|
3360
|
+
exports.isHasExtractProp = isHasExtractProp;
|
|
3273
3361
|
exports.location = location;
|
|
3274
3362
|
exports.navigator = nav;
|
|
3275
3363
|
exports.nextTick = nextTick;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tarojs/runtime",
|
|
3
|
-
"version": "3.7.0-canary.
|
|
3
|
+
"version": "3.7.0-canary.2",
|
|
4
4
|
"description": "taro runtime for mini apps.",
|
|
5
5
|
"main:h5": "dist/runtime.h5.js",
|
|
6
6
|
"main": "dist/runtime.esm.js",
|
|
@@ -20,10 +20,10 @@
|
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"lodash-es": "4.17.21",
|
|
23
|
-
"@tarojs/shared": "3.7.0-canary.
|
|
23
|
+
"@tarojs/shared": "3.7.0-canary.2"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
|
-
"@rollup/plugin-buble": "^0.
|
|
26
|
+
"@rollup/plugin-buble": "^1.0.3",
|
|
27
27
|
"@rollup/plugin-replace": "^5.0.2",
|
|
28
28
|
"@rollup/plugin-typescript": "^11.1.0",
|
|
29
29
|
"@vue/runtime-core": "3.2.41",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"typescript": "^4.7.4"
|
|
38
38
|
},
|
|
39
39
|
"scripts": {
|
|
40
|
-
"prebuild": "rimraf ./dist",
|
|
40
|
+
"prebuild": "rimraf --impl=move-remove ./dist",
|
|
41
41
|
"build": "pnpm run rollup",
|
|
42
42
|
"dev": "pnpm run rollup --environment TARGET:esm -w",
|
|
43
43
|
"rollup": "rollup --config rollup.config.ts --configPlugin @rollup/plugin-typescript --bundleConfigAsCjs",
|