@tarojs/runtime 3.7.0-alpha.8 → 3.7.0-beta.3
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 +1 -19
- package/dist/runtime.cjs.js +8 -18
- package/dist/runtime.esm.d.ts +1 -19
- package/dist/runtime.esm.js +7 -8
- package/dist/runtime.esm.js.map +1 -1
- package/dist/runtime.h5.d.ts +1 -19
- package/dist/runtime.h5.js +6 -17
- package/package.json +2 -2
package/dist/runtime.cjs.d.ts
CHANGED
|
@@ -776,23 +776,5 @@ declare function hydrate(node: TaroElement | TaroText): MiniData;
|
|
|
776
776
|
declare const nextTick: (cb: Func, ctx?: Record<string, any>) => void;
|
|
777
777
|
declare const options: Options;
|
|
778
778
|
declare const incrementId: () => () => string;
|
|
779
|
-
declare function isElement(node: TaroNode): node is TaroElement;
|
|
780
|
-
declare function isText(node: TaroNode): node is TaroText;
|
|
781
|
-
declare function isComment(node: TaroNode): boolean;
|
|
782
|
-
declare function isHasExtractProp(el: TaroElement): boolean;
|
|
783
|
-
/**
|
|
784
|
-
* 往上寻找组件树直到 root,寻找是否有祖先组件绑定了同类型的事件
|
|
785
|
-
* @param node 当前组件
|
|
786
|
-
* @param type 事件类型
|
|
787
|
-
*/
|
|
788
|
-
declare function isParentBinded(node: TaroElement | null, type: string): boolean;
|
|
789
|
-
declare function shortcutAttr(key: string): string;
|
|
790
|
-
declare const customWrapperCache: Map<string, Record<string, any>>;
|
|
791
|
-
interface Ctor {
|
|
792
|
-
new (...args: any[]): any;
|
|
793
|
-
}
|
|
794
|
-
declare function extend(ctor: Ctor, methodName: string, options: Func | Record<string, any>): void;
|
|
795
|
-
declare function getComponentsAlias(): any;
|
|
796
|
-
declare function convertNumber2PX(value: number): string;
|
|
797
779
|
export { hooks } from '@tarojs/shared';
|
|
798
|
-
export { document, getComputedStyle, History, Location, nav as navigator, _caf as cancelAnimationFrame, now, _raf as requestAnimationFrame, parseUrl, URL, URLSearchParams, history, location, window, TaroElement, createEvent, eventHandler, TaroEvent, FormElement, TaroNode, TaroRootElement, Style, SVGElement, TaroText, MutationObserver, env, PROPERTY_THRESHOLD, TARO_RUNTIME, HOOKS_APP_ID, SET_DATA, PAGE_INIT, ROOT_STR, HTML, HEAD, BODY, APP, CONTAINER, DOCUMENT_ELEMENT_NAME, DOCUMENT_FRAGMENT, ID, UID, CLASS, STYLE, FOCUS, VIEW, STATIC_VIEW, PURE_VIEW, PROPS, DATASET, OBJECT, VALUE, INPUT, CHANGE, CUSTOM_WRAPPER, TARGET, CURRENT_TARGET, TYPE, CONFIRM, TIME_STAMP, KEY_CODE, TOUCHMOVE, DATE, SET_TIMEOUT, CATCHMOVE, CATCH_VIEW, COMMENT, ON_LOAD, ON_READY, ON_SHOW, ON_HIDE, OPTIONS, EXTERNAL_CLASSES, EVENT_CALLBACK_RESULT, BEHAVIORS, A, CONTEXT_ACTIONS, Current, getCurrentInstance, eventSource, addLeadingSlash, createComponentConfig, createPageConfig, createRecursiveComponentConfig, getOnHideEventKey, getOnReadyEventKey, getOnShowEventKey, getPageInstance, getPath, injectPageInstance, removePageInstance, safeExecute, stringify, EventsType, eventCenter, Events, hydrate, nextTick, options, incrementId,
|
|
780
|
+
export { document, getComputedStyle, History, Location, nav as navigator, _caf as cancelAnimationFrame, now, _raf as requestAnimationFrame, parseUrl, URL, URLSearchParams, history, location, window, TaroElement, createEvent, eventHandler, TaroEvent, FormElement, TaroNode, TaroRootElement, Style, SVGElement, TaroText, MutationObserver, env, PROPERTY_THRESHOLD, TARO_RUNTIME, HOOKS_APP_ID, SET_DATA, PAGE_INIT, ROOT_STR, HTML, HEAD, BODY, APP, CONTAINER, DOCUMENT_ELEMENT_NAME, DOCUMENT_FRAGMENT, ID, UID, CLASS, STYLE, FOCUS, VIEW, STATIC_VIEW, PURE_VIEW, PROPS, DATASET, OBJECT, VALUE, INPUT, CHANGE, CUSTOM_WRAPPER, TARGET, CURRENT_TARGET, TYPE, CONFIRM, TIME_STAMP, KEY_CODE, TOUCHMOVE, DATE, SET_TIMEOUT, CATCHMOVE, CATCH_VIEW, COMMENT, ON_LOAD, ON_READY, ON_SHOW, ON_HIDE, OPTIONS, EXTERNAL_CLASSES, EVENT_CALLBACK_RESULT, BEHAVIORS, A, CONTEXT_ACTIONS, Current, getCurrentInstance, eventSource, addLeadingSlash, createComponentConfig, createPageConfig, createRecursiveComponentConfig, getOnHideEventKey, getOnReadyEventKey, getOnShowEventKey, getPageInstance, getPath, injectPageInstance, removePageInstance, safeExecute, stringify, EventsType, eventCenter, Events, hydrate, nextTick, options, incrementId, Instance, VueAppInstance, VueInstance, PageProps, ReactPageComponent, ReactPageInstance, ReactAppInstance, PageLifeCycle, PageInstance, AppInstance, Attributes, EventOptions, MpEvent, EventListenerOptions, AddEventListenerOptions, EventHandler, MpInstance, MiniElementData, MiniData, HydratedData, UpdatePayloadValue, DataTree, UpdatePayload, Options$0 as Options, Func, Ctx };
|
package/dist/runtime.cjs.js
CHANGED
|
@@ -291,9 +291,6 @@ function getComponentsAlias() {
|
|
|
291
291
|
}
|
|
292
292
|
return componentsAlias$1;
|
|
293
293
|
}
|
|
294
|
-
function convertNumber2PX(value) {
|
|
295
|
-
return value + 'px';
|
|
296
|
-
}
|
|
297
294
|
|
|
298
295
|
var ClassList = function ClassList(className, el) {
|
|
299
296
|
var this$1$1 = this;
|
|
@@ -445,7 +442,9 @@ function hydrate(node) {
|
|
|
445
442
|
}
|
|
446
443
|
var nodeName = node.nodeName;
|
|
447
444
|
if (isText(node)) {
|
|
448
|
-
return ( obj = {
|
|
445
|
+
return ( obj = {
|
|
446
|
+
sid: node.sid
|
|
447
|
+
}, obj["v" /* Shortcuts.Text */] = node.nodeValue, obj["nn" /* Shortcuts.NodeName */] = ((_a = componentsAlias[nodeName]) === null || _a === void 0 ? void 0 : _a._num) || '8', obj );
|
|
449
448
|
}
|
|
450
449
|
var data = {};
|
|
451
450
|
data["nn" /* Shortcuts.NodeName */] = nodeName;
|
|
@@ -1053,7 +1052,7 @@ function setStyle(newVal, styleKey) {
|
|
|
1053
1052
|
if (old === newVal)
|
|
1054
1053
|
{ return; }
|
|
1055
1054
|
!this._pending && recordCss(this);
|
|
1056
|
-
if (shared.isNull(newVal) || shared.isUndefined(newVal)) {
|
|
1055
|
+
if (shared.isNull(newVal) || shared.isUndefined(newVal) || newVal === '') {
|
|
1057
1056
|
this._usedStyleProp.delete(styleKey);
|
|
1058
1057
|
delete this._value[styleKey];
|
|
1059
1058
|
}
|
|
@@ -2545,13 +2544,14 @@ TaroEvent.prototype.preventDefault = function preventDefault () {
|
|
|
2545
2544
|
this.defaultPrevented = true;
|
|
2546
2545
|
};
|
|
2547
2546
|
prototypeAccessors$1.target.get = function () {
|
|
2548
|
-
var _a, _b, _c;
|
|
2547
|
+
var _a, _b, _c, _d;
|
|
2549
2548
|
var cacheTarget = this.cacheTarget;
|
|
2550
2549
|
if (!cacheTarget) {
|
|
2551
2550
|
var target = Object.create(((_a = this.mpEvent) === null || _a === void 0 ? void 0 : _a.target) || null);
|
|
2552
|
-
|
|
2551
|
+
// Note:优先判断冒泡场景alipay的targetDataset的sid, 不然冒泡场景target属性吐出不对,其余拿取当前绑定id
|
|
2552
|
+
var 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);
|
|
2553
2553
|
target.dataset = element !== null ? element.dataset : shared.EMPTY_OBJ;
|
|
2554
|
-
for (var key in (
|
|
2554
|
+
for (var key in (_d = this.mpEvent) === null || _d === void 0 ? void 0 : _d.detail) {
|
|
2555
2555
|
target[key] = this.mpEvent.detail[key];
|
|
2556
2556
|
}
|
|
2557
2557
|
this.cacheTarget = target;
|
|
@@ -4555,18 +4555,14 @@ exports.VALUE = VALUE;
|
|
|
4555
4555
|
exports.VIEW = VIEW;
|
|
4556
4556
|
exports.addLeadingSlash = addLeadingSlash;
|
|
4557
4557
|
exports.cancelAnimationFrame = _caf;
|
|
4558
|
-
exports.convertNumber2PX = convertNumber2PX;
|
|
4559
4558
|
exports.createComponentConfig = createComponentConfig;
|
|
4560
4559
|
exports.createEvent = createEvent;
|
|
4561
4560
|
exports.createPageConfig = createPageConfig;
|
|
4562
4561
|
exports.createRecursiveComponentConfig = createRecursiveComponentConfig;
|
|
4563
|
-
exports.customWrapperCache = customWrapperCache;
|
|
4564
4562
|
exports.env = env;
|
|
4565
4563
|
exports.eventCenter = eventCenter;
|
|
4566
4564
|
exports.eventHandler = eventHandler;
|
|
4567
4565
|
exports.eventSource = eventSource;
|
|
4568
|
-
exports.extend = extend;
|
|
4569
|
-
exports.getComponentsAlias = getComponentsAlias;
|
|
4570
4566
|
exports.getComputedStyle = getComputedStyle;
|
|
4571
4567
|
exports.getCurrentInstance = getCurrentInstance;
|
|
4572
4568
|
exports.getOnHideEventKey = getOnHideEventKey;
|
|
@@ -4578,11 +4574,6 @@ exports.history = history;
|
|
|
4578
4574
|
exports.hydrate = hydrate;
|
|
4579
4575
|
exports.incrementId = incrementId;
|
|
4580
4576
|
exports.injectPageInstance = injectPageInstance;
|
|
4581
|
-
exports.isComment = isComment;
|
|
4582
|
-
exports.isElement = isElement;
|
|
4583
|
-
exports.isHasExtractProp = isHasExtractProp;
|
|
4584
|
-
exports.isParentBinded = isParentBinded;
|
|
4585
|
-
exports.isText = isText;
|
|
4586
4577
|
exports.location = location;
|
|
4587
4578
|
exports.navigator = nav;
|
|
4588
4579
|
exports.nextTick = nextTick;
|
|
@@ -4591,5 +4582,4 @@ exports.parseUrl = parseUrl;
|
|
|
4591
4582
|
exports.removePageInstance = removePageInstance;
|
|
4592
4583
|
exports.requestAnimationFrame = _raf;
|
|
4593
4584
|
exports.safeExecute = safeExecute;
|
|
4594
|
-
exports.shortcutAttr = shortcutAttr;
|
|
4595
4585
|
exports.stringify = stringify;
|
package/dist/runtime.esm.d.ts
CHANGED
|
@@ -776,23 +776,5 @@ declare function hydrate(node: TaroElement | TaroText): MiniData;
|
|
|
776
776
|
declare const nextTick: (cb: Func, ctx?: Record<string, any>) => void;
|
|
777
777
|
declare const options: Options;
|
|
778
778
|
declare const incrementId: () => () => string;
|
|
779
|
-
declare function isElement(node: TaroNode): node is TaroElement;
|
|
780
|
-
declare function isText(node: TaroNode): node is TaroText;
|
|
781
|
-
declare function isComment(node: TaroNode): boolean;
|
|
782
|
-
declare function isHasExtractProp(el: TaroElement): boolean;
|
|
783
|
-
/**
|
|
784
|
-
* 往上寻找组件树直到 root,寻找是否有祖先组件绑定了同类型的事件
|
|
785
|
-
* @param node 当前组件
|
|
786
|
-
* @param type 事件类型
|
|
787
|
-
*/
|
|
788
|
-
declare function isParentBinded(node: TaroElement | null, type: string): boolean;
|
|
789
|
-
declare function shortcutAttr(key: string): string;
|
|
790
|
-
declare const customWrapperCache: Map<string, Record<string, any>>;
|
|
791
|
-
interface Ctor {
|
|
792
|
-
new (...args: any[]): any;
|
|
793
|
-
}
|
|
794
|
-
declare function extend(ctor: Ctor, methodName: string, options: Func | Record<string, any>): void;
|
|
795
|
-
declare function getComponentsAlias(): any;
|
|
796
|
-
declare function convertNumber2PX(value: number): string;
|
|
797
779
|
export { hooks } from '@tarojs/shared';
|
|
798
|
-
export { document, getComputedStyle, History, Location, nav as navigator, _caf as cancelAnimationFrame, now, _raf as requestAnimationFrame, parseUrl, URL, URLSearchParams, history, location, window, TaroElement, createEvent, eventHandler, TaroEvent, FormElement, TaroNode, TaroRootElement, Style, SVGElement, TaroText, MutationObserver, env, PROPERTY_THRESHOLD, TARO_RUNTIME, HOOKS_APP_ID, SET_DATA, PAGE_INIT, ROOT_STR, HTML, HEAD, BODY, APP, CONTAINER, DOCUMENT_ELEMENT_NAME, DOCUMENT_FRAGMENT, ID, UID, CLASS, STYLE, FOCUS, VIEW, STATIC_VIEW, PURE_VIEW, PROPS, DATASET, OBJECT, VALUE, INPUT, CHANGE, CUSTOM_WRAPPER, TARGET, CURRENT_TARGET, TYPE, CONFIRM, TIME_STAMP, KEY_CODE, TOUCHMOVE, DATE, SET_TIMEOUT, CATCHMOVE, CATCH_VIEW, COMMENT, ON_LOAD, ON_READY, ON_SHOW, ON_HIDE, OPTIONS, EXTERNAL_CLASSES, EVENT_CALLBACK_RESULT, BEHAVIORS, A, CONTEXT_ACTIONS, Current, getCurrentInstance, eventSource, addLeadingSlash, createComponentConfig, createPageConfig, createRecursiveComponentConfig, getOnHideEventKey, getOnReadyEventKey, getOnShowEventKey, getPageInstance, getPath, injectPageInstance, removePageInstance, safeExecute, stringify, EventsType, eventCenter, Events, hydrate, nextTick, options, incrementId,
|
|
780
|
+
export { document, getComputedStyle, History, Location, nav as navigator, _caf as cancelAnimationFrame, now, _raf as requestAnimationFrame, parseUrl, URL, URLSearchParams, history, location, window, TaroElement, createEvent, eventHandler, TaroEvent, FormElement, TaroNode, TaroRootElement, Style, SVGElement, TaroText, MutationObserver, env, PROPERTY_THRESHOLD, TARO_RUNTIME, HOOKS_APP_ID, SET_DATA, PAGE_INIT, ROOT_STR, HTML, HEAD, BODY, APP, CONTAINER, DOCUMENT_ELEMENT_NAME, DOCUMENT_FRAGMENT, ID, UID, CLASS, STYLE, FOCUS, VIEW, STATIC_VIEW, PURE_VIEW, PROPS, DATASET, OBJECT, VALUE, INPUT, CHANGE, CUSTOM_WRAPPER, TARGET, CURRENT_TARGET, TYPE, CONFIRM, TIME_STAMP, KEY_CODE, TOUCHMOVE, DATE, SET_TIMEOUT, CATCHMOVE, CATCH_VIEW, COMMENT, ON_LOAD, ON_READY, ON_SHOW, ON_HIDE, OPTIONS, EXTERNAL_CLASSES, EVENT_CALLBACK_RESULT, BEHAVIORS, A, CONTEXT_ACTIONS, Current, getCurrentInstance, eventSource, addLeadingSlash, createComponentConfig, createPageConfig, createRecursiveComponentConfig, getOnHideEventKey, getOnReadyEventKey, getOnShowEventKey, getPageInstance, getPath, injectPageInstance, removePageInstance, safeExecute, stringify, EventsType, eventCenter, Events, hydrate, nextTick, options, incrementId, Instance, VueAppInstance, VueInstance, PageProps, ReactPageComponent, ReactPageInstance, ReactAppInstance, PageLifeCycle, PageInstance, AppInstance, Attributes, EventOptions, MpEvent, EventListenerOptions, AddEventListenerOptions, EventHandler, MpInstance, MiniElementData, MiniData, HydratedData, UpdatePayloadValue, DataTree, UpdatePayload, Options$0 as Options, Func, Ctx };
|
package/dist/runtime.esm.js
CHANGED
|
@@ -286,9 +286,6 @@ function getComponentsAlias() {
|
|
|
286
286
|
}
|
|
287
287
|
return componentsAlias$1;
|
|
288
288
|
}
|
|
289
|
-
function convertNumber2PX(value) {
|
|
290
|
-
return value + 'px';
|
|
291
|
-
}
|
|
292
289
|
|
|
293
290
|
class ClassList {
|
|
294
291
|
constructor(className, el) {
|
|
@@ -422,6 +419,7 @@ function hydrate(node) {
|
|
|
422
419
|
const nodeName = node.nodeName;
|
|
423
420
|
if (isText(node)) {
|
|
424
421
|
return {
|
|
422
|
+
sid: node.sid,
|
|
425
423
|
["v" /* Shortcuts.Text */]: node.nodeValue,
|
|
426
424
|
["nn" /* Shortcuts.NodeName */]: ((_a = componentsAlias[nodeName]) === null || _a === void 0 ? void 0 : _a._num) || '8'
|
|
427
425
|
};
|
|
@@ -1046,7 +1044,7 @@ function setStyle(newVal, styleKey) {
|
|
|
1046
1044
|
if (old === newVal)
|
|
1047
1045
|
return;
|
|
1048
1046
|
!this._pending && recordCss(this);
|
|
1049
|
-
if (isNull(newVal) || isUndefined(newVal)) {
|
|
1047
|
+
if (isNull(newVal) || isUndefined(newVal) || newVal === '') {
|
|
1050
1048
|
this._usedStyleProp.delete(styleKey);
|
|
1051
1049
|
delete this._value[styleKey];
|
|
1052
1050
|
}
|
|
@@ -2470,13 +2468,14 @@ class TaroEvent {
|
|
|
2470
2468
|
this.defaultPrevented = true;
|
|
2471
2469
|
}
|
|
2472
2470
|
get target() {
|
|
2473
|
-
var _a, _b, _c;
|
|
2471
|
+
var _a, _b, _c, _d;
|
|
2474
2472
|
const cacheTarget = this.cacheTarget;
|
|
2475
2473
|
if (!cacheTarget) {
|
|
2476
2474
|
const target = Object.create(((_a = this.mpEvent) === null || _a === void 0 ? void 0 : _a.target) || null);
|
|
2477
|
-
|
|
2475
|
+
// Note:优先判断冒泡场景alipay的targetDataset的sid, 不然冒泡场景target属性吐出不对,其余拿取当前绑定id
|
|
2476
|
+
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);
|
|
2478
2477
|
target.dataset = element !== null ? element.dataset : EMPTY_OBJ;
|
|
2479
|
-
for (const key in (
|
|
2478
|
+
for (const key in (_d = this.mpEvent) === null || _d === void 0 ? void 0 : _d.detail) {
|
|
2480
2479
|
target[key] = this.mpEvent.detail[key];
|
|
2481
2480
|
}
|
|
2482
2481
|
this.cacheTarget = target;
|
|
@@ -4234,5 +4233,5 @@ const nextTick = (cb, ctx) => {
|
|
|
4234
4233
|
next();
|
|
4235
4234
|
};
|
|
4236
4235
|
|
|
4237
|
-
export { A, APP, BEHAVIORS, BODY, CATCHMOVE, CATCH_VIEW, CHANGE, CLASS, COMMENT, CONFIRM, CONTAINER, CONTEXT_ACTIONS, CURRENT_TARGET, CUSTOM_WRAPPER, Current, DATASET, DATE, DOCUMENT_ELEMENT_NAME, DOCUMENT_FRAGMENT, EVENT_CALLBACK_RESULT, EXTERNAL_CLASSES, FOCUS, FormElement, HEAD, HOOKS_APP_ID, HTML, History, ID, INPUT, KEY_CODE, Location, MutationObserver, OBJECT, ON_HIDE, ON_LOAD, ON_READY, ON_SHOW, OPTIONS, PAGE_INIT, PROPERTY_THRESHOLD, PROPS, PURE_VIEW, ROOT_STR, SET_DATA, SET_TIMEOUT, STATIC_VIEW, STYLE, SVGElement, Style, TARGET, TARO_RUNTIME, TIME_STAMP, TOUCHMOVE, TYPE, TaroElement, TaroEvent, TaroNode, TaroRootElement, TaroText, UID, URL, URLSearchParams, VALUE, VIEW, addLeadingSlash, _caf as cancelAnimationFrame,
|
|
4236
|
+
export { A, APP, BEHAVIORS, BODY, CATCHMOVE, CATCH_VIEW, CHANGE, CLASS, COMMENT, CONFIRM, CONTAINER, CONTEXT_ACTIONS, CURRENT_TARGET, CUSTOM_WRAPPER, Current, DATASET, DATE, DOCUMENT_ELEMENT_NAME, DOCUMENT_FRAGMENT, EVENT_CALLBACK_RESULT, EXTERNAL_CLASSES, FOCUS, FormElement, HEAD, HOOKS_APP_ID, HTML, History, ID, INPUT, KEY_CODE, Location, MutationObserver, OBJECT, ON_HIDE, ON_LOAD, ON_READY, ON_SHOW, OPTIONS, PAGE_INIT, PROPERTY_THRESHOLD, PROPS, PURE_VIEW, ROOT_STR, SET_DATA, SET_TIMEOUT, STATIC_VIEW, STYLE, SVGElement, Style, TARGET, TARO_RUNTIME, TIME_STAMP, TOUCHMOVE, TYPE, TaroElement, TaroEvent, TaroNode, TaroRootElement, TaroText, UID, URL, URLSearchParams, VALUE, VIEW, addLeadingSlash, _caf as cancelAnimationFrame, createComponentConfig, createEvent, createPageConfig, createRecursiveComponentConfig, document$1 as document, env, eventCenter, eventHandler, eventSource, getComputedStyle, getCurrentInstance, getOnHideEventKey, getOnReadyEventKey, getOnShowEventKey, getPageInstance, getPath, history, hydrate, incrementId, injectPageInstance, location, nav as navigator, nextTick, now, options, parseUrl, removePageInstance, _raf as requestAnimationFrame, safeExecute, stringify, window$1 as window };
|
|
4238
4237
|
//# sourceMappingURL=runtime.esm.js.map
|