@tarojs/runtime 4.1.12-beta.9 → 4.2.0-beta.0
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/document.js +135 -2
- package/dist/bom/document.js.map +1 -1
- package/dist/dom/event.d.ts +2 -1
- package/dist/dom/event.js +9 -1
- package/dist/dom/event.js.map +1 -1
- package/dist/dom-external/inner-html/html.d.ts +5 -0
- package/dist/dom-external/inner-html/html.js +8 -1
- package/dist/dom-external/inner-html/html.js.map +1 -1
- package/dist/dsl/common.js +22 -4
- package/dist/dsl/common.js.map +1 -1
- package/dist/index.cjs.d.ts +5 -1
- package/dist/index.cjs.js +171 -5
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/interface/hydrate.d.ts +1 -0
- package/dist/runtime.esm.d.ts +5 -1
- package/dist/runtime.esm.js +171 -7
- package/dist/runtime.esm.js.map +1 -1
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -10,13 +10,14 @@ export { TaroURLProvider as URL, parseUrl } from './bom/URL.js';
|
|
|
10
10
|
export { URLSearchParams } from './bom/URLSearchParams.js';
|
|
11
11
|
export { taroHistoryProvider as history, taroLocationProvider as location, taroWindowProvider as window } from './bom/window.js';
|
|
12
12
|
export { TaroElement } from './dom/element.js';
|
|
13
|
-
export { TaroEvent, createEvent, eventHandler } from './dom/event.js';
|
|
13
|
+
export { TaroEvent, createEvent, eventHandler, eventHandlerTTDom } from './dom/event.js';
|
|
14
14
|
export { FormElement } from './dom/form.js';
|
|
15
15
|
export { TaroNode } from './dom/node.js';
|
|
16
16
|
export { TaroRootElement } from './dom/root.js';
|
|
17
17
|
export { Style } from './dom/style.js';
|
|
18
18
|
export { SVGElement } from './dom/svg.js';
|
|
19
19
|
export { TaroText } from './dom/text.js';
|
|
20
|
+
export { setInnerHTML } from './dom-external/inner-html/html.js';
|
|
20
21
|
export { MutationObserver } from './dom-external/mutation-observer/index.js';
|
|
21
22
|
export { A, APP, BEHAVIORS, BODY, CATCHMOVE, CATCH_VIEW, CHANGE, CLASS, CLICK_VIEW, COMMENT, COMPILE_MODE, CONFIRM, CONTAINER, CONTEXT_ACTIONS, CURRENT_TARGET, CUSTOM_WRAPPER, DATASET, DATE, DOCUMENT_ELEMENT_NAME, DOCUMENT_FRAGMENT, EVENT_CALLBACK_RESULT, EXTERNAL_CLASSES, FOCUS, HEAD, HOOKS_APP_ID, HTML, ID, INPUT, KEY_CODE, 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, TARGET, TARO_RUNTIME, TIME_STAMP, TOUCHMOVE, TYPE, UID, VALUE, VIEW } from './constants/index.js';
|
|
22
23
|
export { Current, getCurrentInstance } from './current.js';
|
package/dist/index.js
CHANGED
|
@@ -11,13 +11,14 @@ export { TaroURLProvider as URL, parseUrl } from './bom/URL.js';
|
|
|
11
11
|
export { URLSearchParams } from './bom/URLSearchParams.js';
|
|
12
12
|
export { taroHistoryProvider as history, taroLocationProvider as location, taroWindowProvider as window } from './bom/window.js';
|
|
13
13
|
export { TaroElement } from './dom/element.js';
|
|
14
|
-
export { TaroEvent, createEvent, eventHandler } from './dom/event.js';
|
|
14
|
+
export { TaroEvent, createEvent, eventHandler, eventHandlerTTDom } from './dom/event.js';
|
|
15
15
|
export { FormElement } from './dom/form.js';
|
|
16
16
|
export { TaroNode } from './dom/node.js';
|
|
17
17
|
export { TaroRootElement } from './dom/root.js';
|
|
18
18
|
export { Style } from './dom/style.js';
|
|
19
19
|
export { SVGElement } from './dom/svg.js';
|
|
20
20
|
export { TaroText } from './dom/text.js';
|
|
21
|
+
export { setInnerHTML } from './dom-external/inner-html/html.js';
|
|
21
22
|
export { MutationObserver } from './dom-external/mutation-observer/index.js';
|
|
22
23
|
export { A, APP, BEHAVIORS, BODY, CATCHMOVE, CATCH_VIEW, CHANGE, CLASS, CLICK_VIEW, COMMENT, COMPILE_MODE, CONFIRM, CONTAINER, CONTEXT_ACTIONS, CURRENT_TARGET, CUSTOM_WRAPPER, DATASET, DATE, DOCUMENT_ELEMENT_NAME, DOCUMENT_FRAGMENT, EVENT_CALLBACK_RESULT, EXTERNAL_CLASSES, FOCUS, HEAD, HOOKS_APP_ID, HTML, ID, INPUT, KEY_CODE, 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, TARGET, TARO_RUNTIME, TIME_STAMP, TOUCHMOVE, TYPE, UID, VALUE, VIEW } from './constants/index.js';
|
|
23
24
|
export { Current, getCurrentInstance } from './current.js';
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/runtime.esm.d.ts
CHANGED
|
@@ -147,6 +147,7 @@ interface MpInstance {
|
|
|
147
147
|
data: any;
|
|
148
148
|
exitState?: any;
|
|
149
149
|
selectComponent: (selector: string) => any;
|
|
150
|
+
__webviewId__?: number;
|
|
150
151
|
}
|
|
151
152
|
interface MiniElementData {
|
|
152
153
|
[Shortcuts.Childnodes]?: MiniData[];
|
|
@@ -356,6 +357,7 @@ declare class TaroEvent {
|
|
|
356
357
|
}
|
|
357
358
|
declare function createEvent(event: MpEvent | string, node?: TaroElement): TaroEvent;
|
|
358
359
|
declare function eventHandler(event: MpEvent): any;
|
|
360
|
+
declare function eventHandlerTTDom(ele: any, listener: (event: MpEvent, element: any) => void, event: MpEvent): void;
|
|
359
361
|
|
|
360
362
|
declare class TaroElement extends TaroNode {
|
|
361
363
|
ctx?: any;
|
|
@@ -592,6 +594,8 @@ declare const taroHistoryProvider: TaroHistory;
|
|
|
592
594
|
declare class SVGElement extends TaroElement {
|
|
593
595
|
}
|
|
594
596
|
|
|
597
|
+
declare function setInnerHTML(element: TaroNode, html: string): void;
|
|
598
|
+
|
|
595
599
|
/**
|
|
596
600
|
* A MutationRecord represents an individual DOM mutation.
|
|
597
601
|
* It is the object that is passed to MutationObserver's callback.
|
|
@@ -913,5 +917,5 @@ declare function convertNumber2PX(value: number): string;
|
|
|
913
917
|
|
|
914
918
|
declare function handlePolyfill(): void;
|
|
915
919
|
|
|
916
|
-
export { A, APP, BEHAVIORS, BODY, CATCHMOVE, CATCH_VIEW, CHANGE, CLASS, CLICK_VIEW, COMMENT, COMPILE_MODE, 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, TaroURLProvider as URL, URLSearchParams$1 as URLSearchParams, VALUE, VIEW, addLeadingSlash, _caf as cancelAnimationFrame, convertNumber2PX, createComponentConfig, createEvent, createPageConfig, createRecursiveComponentConfig, customWrapperCache, debounce, taroDocumentProvider as document, env, eventCenter, eventHandler, eventSource, extend, getComponentsAlias, taroGetComputedStyleProvider as getComputedStyle, getCurrentInstance, getCurrentPage, getHomePage, getOnHideEventKey, getOnReadyEventKey, getOnShowEventKey, getPageInstance, getPath, handlePolyfill, hasBasename, taroHistoryProvider as history, hydrate, incrementId, injectPageInstance, isComment, isElement, isHasExtractProp, isParentBound, isText, taroLocationProvider as location, nav as navigator, nextTick, now, options, parseUrl, perf, removePageInstance, _raf as requestAnimationFrame, safeExecute, shortcutAttr, stringify, stripBasename, stripSuffix, stripTrailing, throttle, taroWindowProvider as window };
|
|
920
|
+
export { A, APP, BEHAVIORS, BODY, CATCHMOVE, CATCH_VIEW, CHANGE, CLASS, CLICK_VIEW, COMMENT, COMPILE_MODE, 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, TaroURLProvider as URL, URLSearchParams$1 as URLSearchParams, VALUE, VIEW, addLeadingSlash, _caf as cancelAnimationFrame, convertNumber2PX, createComponentConfig, createEvent, createPageConfig, createRecursiveComponentConfig, customWrapperCache, debounce, taroDocumentProvider as document, env, eventCenter, eventHandler, eventHandlerTTDom, eventSource, extend, getComponentsAlias, taroGetComputedStyleProvider as getComputedStyle, getCurrentInstance, getCurrentPage, getHomePage, getOnHideEventKey, getOnReadyEventKey, getOnShowEventKey, getPageInstance, getPath, handlePolyfill, hasBasename, taroHistoryProvider as history, hydrate, incrementId, injectPageInstance, isComment, isElement, isHasExtractProp, isParentBound, isText, taroLocationProvider as location, nav as navigator, nextTick, now, options, parseUrl, perf, removePageInstance, _raf as requestAnimationFrame, safeExecute, setInnerHTML, shortcutAttr, stringify, stripBasename, stripSuffix, stripTrailing, throttle, taroWindowProvider as window };
|
|
917
921
|
export type { AddEventListenerOptions, AppInstance, Attributes, DataTree, EventHandler, EventListenerOptions, EventOptions, EventsType, HydratedData, Instance, KeyFrame, MiniData, MiniElementData, MiniTextData, MpEvent, MpInstance, Options$2 as Options, PageConfig, PageInstance, PageLifeCycle, PageProps, ReactAppInstance, ReactPageComponent, ReactPageInstance, ScrollTimelineOption, TFunc, UpdatePayload, UpdatePayloadValue };
|
package/dist/runtime.esm.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { noop, hooks, Events, EMPTY_OBJ, isNumber, isString, isArray, isUndefined, warn, isFunction, getComponentsAlias as getComponentsAlias$1, internalComponents, toCamelCase, isObject, ensure, isNull, toDashed, PLATFORM_TYPE, controlledComponent, EventChannel } from '@tarojs/shared';
|
|
1
|
+
import { noop, hooks, Events, EMPTY_OBJ, isNumber, isString, isArray, isUndefined, warn, isFunction, getComponentsAlias as getComponentsAlias$1, internalComponents, toCamelCase, isObject, ensure, isNull, toDashed, isEnableTTDom, PLATFORM_TYPE, controlledComponent, DEFAULT_COMPONENTS, TT_SPECIFIC_COMPONENTS, EventChannel } from '@tarojs/shared';
|
|
2
2
|
export { Events, hooks } from '@tarojs/shared';
|
|
3
3
|
import { __classPrivateFieldSet, __classPrivateFieldGet } from 'tslib';
|
|
4
4
|
|
|
@@ -3232,7 +3232,13 @@ function setInnerHTML(element, html) {
|
|
|
3232
3232
|
while (element.firstChild) {
|
|
3233
3233
|
element.removeChild(element.firstChild);
|
|
3234
3234
|
}
|
|
3235
|
-
|
|
3235
|
+
let { ownerDocument } = element;
|
|
3236
|
+
if (process.env.TARO_ENV === 'tt' && isEnableTTDom()) {
|
|
3237
|
+
if ('appDocument' in tt) {
|
|
3238
|
+
ownerDocument = tt.appDocument;
|
|
3239
|
+
}
|
|
3240
|
+
}
|
|
3241
|
+
const children = parser(html, ownerDocument);
|
|
3236
3242
|
for (let i = 0; i < children.length; i++) {
|
|
3237
3243
|
element.appendChild(children[i]);
|
|
3238
3244
|
}
|
|
@@ -3515,6 +3521,14 @@ function eventHandler(event) {
|
|
|
3515
3521
|
}
|
|
3516
3522
|
}
|
|
3517
3523
|
}
|
|
3524
|
+
function eventHandlerTTDom(ele, listener, event) {
|
|
3525
|
+
Object.assign(event, {
|
|
3526
|
+
mpEvent: event,
|
|
3527
|
+
bubbles: true,
|
|
3528
|
+
cancelable: true,
|
|
3529
|
+
});
|
|
3530
|
+
listener(event, ele);
|
|
3531
|
+
}
|
|
3518
3532
|
|
|
3519
3533
|
class FormElement extends TaroElement {
|
|
3520
3534
|
get type() {
|
|
@@ -3946,8 +3960,140 @@ function createDocument() {
|
|
|
3946
3960
|
doc.body = body;
|
|
3947
3961
|
return doc;
|
|
3948
3962
|
}
|
|
3963
|
+
function createTTDomDocument() {
|
|
3964
|
+
var _a;
|
|
3965
|
+
const document = tt === null || tt === void 0 ? void 0 : tt.appDocument;
|
|
3966
|
+
if (!document) {
|
|
3967
|
+
throw new Error('tt.appDocument is not found');
|
|
3968
|
+
}
|
|
3969
|
+
const html = document.createElement(HTML);
|
|
3970
|
+
const head = document.createElement(HEAD);
|
|
3971
|
+
const body = document.createElement(BODY);
|
|
3972
|
+
const app = document.createElement(APP);
|
|
3973
|
+
app.id = APP;
|
|
3974
|
+
const container = document.createElement(CONTAINER);
|
|
3975
|
+
const emptyFunction = () => { };
|
|
3976
|
+
document.childNodes.push(html);
|
|
3977
|
+
html.childNodes.push(head, body);
|
|
3978
|
+
body.childNodes.push(container);
|
|
3979
|
+
container.childNodes.push(app);
|
|
3980
|
+
document.documentElement = html;
|
|
3981
|
+
document.head = head;
|
|
3982
|
+
document.body = body;
|
|
3983
|
+
document.appElement = app;
|
|
3984
|
+
let builtInComponents = (_a = tt === null || tt === void 0 ? void 0 : tt.getBuiltInComponents) === null || _a === void 0 ? void 0 : _a.call(tt);
|
|
3985
|
+
if (Array.isArray(builtInComponents)) {
|
|
3986
|
+
builtInComponents = new Set(builtInComponents);
|
|
3987
|
+
}
|
|
3988
|
+
else if (!(builtInComponents instanceof Set)) {
|
|
3989
|
+
builtInComponents = new Set([...DEFAULT_COMPONENTS, ...TT_SPECIFIC_COMPONENTS]);
|
|
3990
|
+
}
|
|
3991
|
+
document.getElementById = function getElementById(id) {
|
|
3992
|
+
if (id === 'app') {
|
|
3993
|
+
return app;
|
|
3994
|
+
}
|
|
3995
|
+
else {
|
|
3996
|
+
return Object.getPrototypeOf(this).getElementById.call(this, id);
|
|
3997
|
+
}
|
|
3998
|
+
};
|
|
3999
|
+
document.getLastPage = function getLastPage() {
|
|
4000
|
+
let last;
|
|
4001
|
+
for (const v of this._pageDocumentMap.values())
|
|
4002
|
+
last = v;
|
|
4003
|
+
return last;
|
|
4004
|
+
};
|
|
4005
|
+
document.createElement = function (type, ...args) {
|
|
4006
|
+
if (type === 'root') {
|
|
4007
|
+
return this.getLastPage();
|
|
4008
|
+
}
|
|
4009
|
+
else {
|
|
4010
|
+
const el = builtInComponents.has(type)
|
|
4011
|
+
? Object.getPrototypeOf(this).createElement.call(this, type, ...args)
|
|
4012
|
+
: Object.getPrototypeOf(this).createNativeComponent.call(this, type, {
|
|
4013
|
+
__tt__inner__options__: {
|
|
4014
|
+
name: type,
|
|
4015
|
+
},
|
|
4016
|
+
});
|
|
4017
|
+
// 给元素加上 scopeId
|
|
4018
|
+
el.setAttribute('class', '');
|
|
4019
|
+
// 保存原始的 setAttribute 和 removeAttribute
|
|
4020
|
+
const originalSetAttribute = el.setAttribute.bind(el);
|
|
4021
|
+
const originalRemoveAttribute = el.removeAttribute.bind(el);
|
|
4022
|
+
// 拦截 setAttribute 来处理 catchMove
|
|
4023
|
+
el.setAttribute = function (name, value) {
|
|
4024
|
+
const result = originalSetAttribute(name, value);
|
|
4025
|
+
// 处理 catchMove 属性
|
|
4026
|
+
if (name === 'catchMove' && value) {
|
|
4027
|
+
el.addEventListener('catchtouchmove', emptyFunction);
|
|
4028
|
+
}
|
|
4029
|
+
return result;
|
|
4030
|
+
};
|
|
4031
|
+
// 拦截 removeAttribute 来处理 catchMove
|
|
4032
|
+
el.removeAttribute = function (name) {
|
|
4033
|
+
const oldValue = el.getAttribute(name);
|
|
4034
|
+
// 处理 catchMove 属性
|
|
4035
|
+
if (name === 'catchMove' && oldValue) {
|
|
4036
|
+
el.removeEventListener('catchtouchmove', emptyFunction);
|
|
4037
|
+
}
|
|
4038
|
+
return originalRemoveAttribute(name);
|
|
4039
|
+
};
|
|
4040
|
+
if (process.env.FRAMEWORK === 'preact') {
|
|
4041
|
+
const ttEventListener = el.addEventListener.bind(el);
|
|
4042
|
+
const ttRemoveEventListener = el.removeEventListener.bind(el);
|
|
4043
|
+
el.addEventListener = function (type, listener) {
|
|
4044
|
+
if (type === 'click') {
|
|
4045
|
+
type = 'tap';
|
|
4046
|
+
}
|
|
4047
|
+
const bindEventName = type.startsWith('bind') || type.startsWith('catch') ? type : `bind${type}`;
|
|
4048
|
+
// 创建包装函数
|
|
4049
|
+
const wrapper = (event) => {
|
|
4050
|
+
const type = event.type;
|
|
4051
|
+
// 对齐 modifyMpEvent 处理逻辑
|
|
4052
|
+
if (type === 'tap') {
|
|
4053
|
+
event.type = 'click';
|
|
4054
|
+
}
|
|
4055
|
+
else if (type === 'focus') {
|
|
4056
|
+
event.type = 'focusin';
|
|
4057
|
+
}
|
|
4058
|
+
else if (type === 'blur') {
|
|
4059
|
+
event.type = 'focusout';
|
|
4060
|
+
}
|
|
4061
|
+
Object.assign(event, {
|
|
4062
|
+
mpEvent: event,
|
|
4063
|
+
bubbles: true,
|
|
4064
|
+
cancelable: true,
|
|
4065
|
+
});
|
|
4066
|
+
listener.call(el, event);
|
|
4067
|
+
};
|
|
4068
|
+
// 保存包装函数的引用,用于后续移除
|
|
4069
|
+
if (!el.__eventWrappers) {
|
|
4070
|
+
el.__eventWrappers = new WeakMap();
|
|
4071
|
+
}
|
|
4072
|
+
el.__eventWrappers.set(listener, wrapper);
|
|
4073
|
+
ttEventListener(bindEventName, wrapper);
|
|
4074
|
+
};
|
|
4075
|
+
el.removeEventListener = function (type, listener) {
|
|
4076
|
+
var _a;
|
|
4077
|
+
if (type === 'click') {
|
|
4078
|
+
type = 'tap';
|
|
4079
|
+
}
|
|
4080
|
+
const bindEventName = type.startsWith('bind') || type.startsWith('catch') ? type : `bind${type}`;
|
|
4081
|
+
// 获取之前保存的包装函数
|
|
4082
|
+
const wrapper = (_a = el.__eventWrappers) === null || _a === void 0 ? void 0 : _a.get(listener);
|
|
4083
|
+
if (wrapper) {
|
|
4084
|
+
ttRemoveEventListener(bindEventName, wrapper);
|
|
4085
|
+
delete el.__eventWrappers[listener];
|
|
4086
|
+
}
|
|
4087
|
+
};
|
|
4088
|
+
}
|
|
4089
|
+
return el;
|
|
4090
|
+
}
|
|
4091
|
+
};
|
|
4092
|
+
return document;
|
|
4093
|
+
}
|
|
3949
4094
|
// Note: 小程序端 vite 打包成 commonjs,const document = xxx 会报错,所以把 document 改为 taroDocumentProvider
|
|
3950
|
-
const taroDocumentProvider = process.env.TARO_PLATFORM === 'web' ? env.document : (env.document =
|
|
4095
|
+
const taroDocumentProvider = process.env.TARO_PLATFORM === 'web' ? env.document : (env.document =
|
|
4096
|
+
isEnableTTDom() ? createTTDomDocument() : createDocument());
|
|
3951
4097
|
|
|
3952
4098
|
// for Vue3
|
|
3953
4099
|
class SVGElement extends TaroElement {
|
|
@@ -4054,13 +4200,23 @@ function createPageConfig(component, pageName, data, pageConfig) {
|
|
|
4054
4200
|
}
|
|
4055
4201
|
const mount = () => {
|
|
4056
4202
|
Current.app.mount(component, $taroPath, () => {
|
|
4057
|
-
|
|
4203
|
+
if (process.env.TARO_ENV === 'tt' && isEnableTTDom()) {
|
|
4204
|
+
pageElement = env.document.getPageDocumentById(this.__webviewId__);
|
|
4205
|
+
}
|
|
4206
|
+
else {
|
|
4207
|
+
pageElement = env.document.getElementById($taroPath);
|
|
4208
|
+
}
|
|
4058
4209
|
ensure(pageElement !== null, '没有找到页面实例。');
|
|
4059
4210
|
safeExecute($taroPath, ON_LOAD, this.$taroParams);
|
|
4060
4211
|
loadResolver();
|
|
4061
4212
|
if (process.env.TARO_PLATFORM !== 'web') {
|
|
4062
4213
|
pageElement.ctx = this;
|
|
4063
|
-
|
|
4214
|
+
if (process.env.TARO_ENV === 'tt' && isEnableTTDom()) {
|
|
4215
|
+
pageElement.sync();
|
|
4216
|
+
}
|
|
4217
|
+
else {
|
|
4218
|
+
pageElement.performUpdate(true, cb);
|
|
4219
|
+
}
|
|
4064
4220
|
}
|
|
4065
4221
|
else {
|
|
4066
4222
|
isFunction(cb) && cb();
|
|
@@ -4221,7 +4377,9 @@ function createComponentConfig(component, componentName, data) {
|
|
|
4221
4377
|
safeExecute(path, ON_LOAD);
|
|
4222
4378
|
if (process.env.TARO_PLATFORM !== 'web') {
|
|
4223
4379
|
componentElement.ctx = this;
|
|
4224
|
-
|
|
4380
|
+
if (process.env.TARO_ENV !== 'tt' || !isEnableTTDom()) {
|
|
4381
|
+
componentElement.performUpdate(true);
|
|
4382
|
+
}
|
|
4225
4383
|
}
|
|
4226
4384
|
});
|
|
4227
4385
|
},
|
|
@@ -4254,6 +4412,9 @@ function createRecursiveComponentConfig(componentName) {
|
|
|
4254
4412
|
? {
|
|
4255
4413
|
[ATTACHED]() {
|
|
4256
4414
|
var _a, _b;
|
|
4415
|
+
if (process.env.TARO_ENV === 'tt' && isEnableTTDom()) {
|
|
4416
|
+
return;
|
|
4417
|
+
}
|
|
4257
4418
|
const componentId = ((_a = this.data.i) === null || _a === void 0 ? void 0 : _a.sid) || ((_b = this.props.i) === null || _b === void 0 ? void 0 : _b.sid);
|
|
4258
4419
|
if (isString(componentId)) {
|
|
4259
4420
|
customWrapperCache.set(componentId, this);
|
|
@@ -4265,6 +4426,9 @@ function createRecursiveComponentConfig(componentName) {
|
|
|
4265
4426
|
},
|
|
4266
4427
|
[DETACHED]() {
|
|
4267
4428
|
var _a, _b;
|
|
4429
|
+
if (process.env.TARO_ENV === 'tt' && isEnableTTDom()) {
|
|
4430
|
+
return;
|
|
4431
|
+
}
|
|
4268
4432
|
const componentId = ((_a = this.data.i) === null || _a === void 0 ? void 0 : _a.sid) || ((_b = this.props.i) === null || _b === void 0 ? void 0 : _b.sid);
|
|
4269
4433
|
if (isString(componentId)) {
|
|
4270
4434
|
customWrapperCache.delete(componentId);
|
|
@@ -5106,5 +5270,5 @@ if (process.env.SUPPORT_TARO_POLYFILL !== 'disabled' && process.env.TARO_PLATFOR
|
|
|
5106
5270
|
handlePolyfill();
|
|
5107
5271
|
}
|
|
5108
5272
|
|
|
5109
|
-
export { A, APP, BEHAVIORS, BODY, CATCHMOVE, CATCH_VIEW, CHANGE, CLASS, CLICK_VIEW, COMMENT, COMPILE_MODE, 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$1 as 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, TaroURLProvider as URL, URLSearchParams, VALUE, VIEW, addLeadingSlash, _caf as cancelAnimationFrame, convertNumber2PX, createComponentConfig, createEvent, createPageConfig, createRecursiveComponentConfig, customWrapperCache, debounce, taroDocumentProvider as document, env, eventCenter, eventHandler, eventSource, extend, getComponentsAlias, taroGetComputedStyleProvider as getComputedStyle, getCurrentInstance, getCurrentPage, getHomePage, getOnHideEventKey, getOnReadyEventKey, getOnShowEventKey, getPageInstance, getPath, handlePolyfill, hasBasename, taroHistoryProvider as history, hydrate, incrementId, injectPageInstance, isComment, isElement, isHasExtractProp, isParentBound, isText, taroLocationProvider as location, nav as navigator, nextTick, now, options, parseUrl, perf, removePageInstance, _raf as requestAnimationFrame, safeExecute, shortcutAttr, stringify, stripBasename, stripSuffix, stripTrailing, throttle, taroWindowProvider as window };
|
|
5273
|
+
export { A, APP, BEHAVIORS, BODY, CATCHMOVE, CATCH_VIEW, CHANGE, CLASS, CLICK_VIEW, COMMENT, COMPILE_MODE, 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$1 as 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, TaroURLProvider as URL, URLSearchParams, VALUE, VIEW, addLeadingSlash, _caf as cancelAnimationFrame, convertNumber2PX, createComponentConfig, createEvent, createPageConfig, createRecursiveComponentConfig, customWrapperCache, debounce, taroDocumentProvider as document, env, eventCenter, eventHandler, eventHandlerTTDom, eventSource, extend, getComponentsAlias, taroGetComputedStyleProvider as getComputedStyle, getCurrentInstance, getCurrentPage, getHomePage, getOnHideEventKey, getOnReadyEventKey, getOnShowEventKey, getPageInstance, getPath, handlePolyfill, hasBasename, taroHistoryProvider as history, hydrate, incrementId, injectPageInstance, isComment, isElement, isHasExtractProp, isParentBound, isText, taroLocationProvider as location, nav as navigator, nextTick, now, options, parseUrl, perf, removePageInstance, _raf as requestAnimationFrame, safeExecute, setInnerHTML, shortcutAttr, stringify, stripBasename, stripSuffix, stripTrailing, throttle, taroWindowProvider as window };
|
|
5110
5274
|
//# sourceMappingURL=runtime.esm.js.map
|