@tarojs/runtime 4.1.12-alpha.4 → 4.1.12-alpha.6
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 +140 -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 +176 -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 +176 -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,145 @@ 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') {
|
|
4027
|
+
if (value) {
|
|
4028
|
+
el.addEventListener('catchtouchmove', emptyFunction);
|
|
4029
|
+
}
|
|
4030
|
+
else {
|
|
4031
|
+
el.removeEventListener('catchtouchmove', emptyFunction);
|
|
4032
|
+
}
|
|
4033
|
+
}
|
|
4034
|
+
return result;
|
|
4035
|
+
};
|
|
4036
|
+
// 拦截 removeAttribute 来处理 catchMove
|
|
4037
|
+
el.removeAttribute = function (name) {
|
|
4038
|
+
const oldValue = el.getAttribute(name);
|
|
4039
|
+
// 处理 catchMove 属性
|
|
4040
|
+
if (name === 'catchMove' && oldValue) {
|
|
4041
|
+
el.removeEventListener('catchtouchmove', emptyFunction);
|
|
4042
|
+
}
|
|
4043
|
+
return originalRemoveAttribute(name);
|
|
4044
|
+
};
|
|
4045
|
+
if (process.env.FRAMEWORK === 'preact') {
|
|
4046
|
+
const ttEventListener = el.addEventListener.bind(el);
|
|
4047
|
+
const ttRemoveEventListener = el.removeEventListener.bind(el);
|
|
4048
|
+
el.addEventListener = function (type, listener) {
|
|
4049
|
+
if (type === 'click') {
|
|
4050
|
+
type = 'tap';
|
|
4051
|
+
}
|
|
4052
|
+
const bindEventName = type.startsWith('bind') || type.startsWith('catch') ? type : `bind${type}`;
|
|
4053
|
+
// 创建包装函数
|
|
4054
|
+
const wrapper = (event) => {
|
|
4055
|
+
const type = event.type;
|
|
4056
|
+
// 对齐 modifyMpEvent 处理逻辑
|
|
4057
|
+
if (type === 'tap') {
|
|
4058
|
+
event.type = 'click';
|
|
4059
|
+
}
|
|
4060
|
+
else if (type === 'focus') {
|
|
4061
|
+
event.type = 'focusin';
|
|
4062
|
+
}
|
|
4063
|
+
else if (type === 'blur') {
|
|
4064
|
+
event.type = 'focusout';
|
|
4065
|
+
}
|
|
4066
|
+
Object.assign(event, {
|
|
4067
|
+
mpEvent: event,
|
|
4068
|
+
bubbles: true,
|
|
4069
|
+
cancelable: true,
|
|
4070
|
+
});
|
|
4071
|
+
listener.call(el, event);
|
|
4072
|
+
};
|
|
4073
|
+
// 保存包装函数的引用,用于后续移除
|
|
4074
|
+
if (!el.__eventWrappers) {
|
|
4075
|
+
el.__eventWrappers = new WeakMap();
|
|
4076
|
+
}
|
|
4077
|
+
el.__eventWrappers.set(listener, wrapper);
|
|
4078
|
+
ttEventListener(bindEventName, wrapper);
|
|
4079
|
+
};
|
|
4080
|
+
el.removeEventListener = function (type, listener) {
|
|
4081
|
+
var _a;
|
|
4082
|
+
if (type === 'click') {
|
|
4083
|
+
type = 'tap';
|
|
4084
|
+
}
|
|
4085
|
+
const bindEventName = type.startsWith('bind') || type.startsWith('catch') ? type : `bind${type}`;
|
|
4086
|
+
// 获取之前保存的包装函数
|
|
4087
|
+
const wrapper = (_a = el.__eventWrappers) === null || _a === void 0 ? void 0 : _a.get(listener);
|
|
4088
|
+
if (wrapper) {
|
|
4089
|
+
ttRemoveEventListener(bindEventName, wrapper);
|
|
4090
|
+
delete el.__eventWrappers[listener];
|
|
4091
|
+
}
|
|
4092
|
+
};
|
|
4093
|
+
}
|
|
4094
|
+
return el;
|
|
4095
|
+
}
|
|
4096
|
+
};
|
|
4097
|
+
return document;
|
|
4098
|
+
}
|
|
3949
4099
|
// Note: 小程序端 vite 打包成 commonjs,const document = xxx 会报错,所以把 document 改为 taroDocumentProvider
|
|
3950
|
-
const taroDocumentProvider = process.env.TARO_PLATFORM === 'web' ? env.document : (env.document =
|
|
4100
|
+
const taroDocumentProvider = process.env.TARO_PLATFORM === 'web' ? env.document : (env.document =
|
|
4101
|
+
isEnableTTDom() ? createTTDomDocument() : createDocument());
|
|
3951
4102
|
|
|
3952
4103
|
// for Vue3
|
|
3953
4104
|
class SVGElement extends TaroElement {
|
|
@@ -4054,13 +4205,23 @@ function createPageConfig(component, pageName, data, pageConfig) {
|
|
|
4054
4205
|
}
|
|
4055
4206
|
const mount = () => {
|
|
4056
4207
|
Current.app.mount(component, $taroPath, () => {
|
|
4057
|
-
|
|
4208
|
+
if (process.env.TARO_ENV === 'tt' && isEnableTTDom()) {
|
|
4209
|
+
pageElement = env.document.getPageDocumentById(this.__webviewId__);
|
|
4210
|
+
}
|
|
4211
|
+
else {
|
|
4212
|
+
pageElement = env.document.getElementById($taroPath);
|
|
4213
|
+
}
|
|
4058
4214
|
ensure(pageElement !== null, '没有找到页面实例。');
|
|
4059
4215
|
safeExecute($taroPath, ON_LOAD, this.$taroParams);
|
|
4060
4216
|
loadResolver();
|
|
4061
4217
|
if (process.env.TARO_PLATFORM !== 'web') {
|
|
4062
4218
|
pageElement.ctx = this;
|
|
4063
|
-
|
|
4219
|
+
if (process.env.TARO_ENV === 'tt' && isEnableTTDom()) {
|
|
4220
|
+
pageElement.sync();
|
|
4221
|
+
}
|
|
4222
|
+
else {
|
|
4223
|
+
pageElement.performUpdate(true, cb);
|
|
4224
|
+
}
|
|
4064
4225
|
}
|
|
4065
4226
|
else {
|
|
4066
4227
|
isFunction(cb) && cb();
|
|
@@ -4221,7 +4382,9 @@ function createComponentConfig(component, componentName, data) {
|
|
|
4221
4382
|
safeExecute(path, ON_LOAD);
|
|
4222
4383
|
if (process.env.TARO_PLATFORM !== 'web') {
|
|
4223
4384
|
componentElement.ctx = this;
|
|
4224
|
-
|
|
4385
|
+
if (process.env.TARO_ENV !== 'tt' || !isEnableTTDom()) {
|
|
4386
|
+
componentElement.performUpdate(true);
|
|
4387
|
+
}
|
|
4225
4388
|
}
|
|
4226
4389
|
});
|
|
4227
4390
|
},
|
|
@@ -4254,6 +4417,9 @@ function createRecursiveComponentConfig(componentName) {
|
|
|
4254
4417
|
? {
|
|
4255
4418
|
[ATTACHED]() {
|
|
4256
4419
|
var _a, _b;
|
|
4420
|
+
if (process.env.TARO_ENV === 'tt' && isEnableTTDom()) {
|
|
4421
|
+
return;
|
|
4422
|
+
}
|
|
4257
4423
|
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
4424
|
if (isString(componentId)) {
|
|
4259
4425
|
customWrapperCache.set(componentId, this);
|
|
@@ -4265,6 +4431,9 @@ function createRecursiveComponentConfig(componentName) {
|
|
|
4265
4431
|
},
|
|
4266
4432
|
[DETACHED]() {
|
|
4267
4433
|
var _a, _b;
|
|
4434
|
+
if (process.env.TARO_ENV === 'tt' && isEnableTTDom()) {
|
|
4435
|
+
return;
|
|
4436
|
+
}
|
|
4268
4437
|
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
4438
|
if (isString(componentId)) {
|
|
4270
4439
|
customWrapperCache.delete(componentId);
|
|
@@ -5106,5 +5275,5 @@ if (process.env.SUPPORT_TARO_POLYFILL !== 'disabled' && process.env.TARO_PLATFOR
|
|
|
5106
5275
|
handlePolyfill();
|
|
5107
5276
|
}
|
|
5108
5277
|
|
|
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 };
|
|
5278
|
+
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
5279
|
//# sourceMappingURL=runtime.esm.js.map
|