Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
yangkaifeng
uni-app
提交
1ebfad2e
U
uni-app
项目概览
yangkaifeng
/
uni-app
与 Fork 源项目一致
Fork自
DCloud / uni-app
通知
3
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
U
uni-app
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
1ebfad2e
编写于
2月 09, 2022
作者:
fxy060608
浏览文件
操作
浏览文件
下载
差异文件
chore: merge
上级
744f104c
2a0a278d
变更
20
展开全部
隐藏空白更改
内联
并排
Showing
20 changed file
with
548 addition
and
569 deletion
+548
-569
packages/uni-api/src/service/base/eventBus.ts
packages/uni-api/src/service/base/eventBus.ts
+1
-1
packages/uni-app-plus/dist/uni-app-view.umd.js
packages/uni-app-plus/dist/uni-app-view.umd.js
+3
-3
packages/uni-app-plus/dist/uni.runtime.esm.js
packages/uni-app-plus/dist/uni.runtime.esm.js
+1
-52
packages/uni-core/src/helpers/bridge.ts
packages/uni-core/src/helpers/bridge.ts
+2
-2
packages/uni-core/src/helpers/index.ts
packages/uni-core/src/helpers/index.ts
+0
-1
packages/uni-h5/dist/uni-h5.cjs.js
packages/uni-h5/dist/uni-h5.cjs.js
+2
-45
packages/uni-h5/dist/uni-h5.es.js
packages/uni-h5/dist/uni-h5.es.js
+3
-47
packages/uni-mp-alipay/dist/uni.api.esm.js
packages/uni-mp-alipay/dist/uni.api.esm.js
+52
-52
packages/uni-mp-baidu/dist/uni.api.esm.js
packages/uni-mp-baidu/dist/uni.api.esm.js
+52
-52
packages/uni-mp-kuaishou/dist/uni.api.esm.js
packages/uni-mp-kuaishou/dist/uni.api.esm.js
+52
-52
packages/uni-mp-lark/dist/uni.api.esm.js
packages/uni-mp-lark/dist/uni.api.esm.js
+52
-52
packages/uni-mp-qq/dist/uni.api.esm.js
packages/uni-mp-qq/dist/uni.api.esm.js
+52
-52
packages/uni-mp-toutiao/dist/uni.api.esm.js
packages/uni-mp-toutiao/dist/uni.api.esm.js
+52
-52
packages/uni-mp-weixin/dist/uni.api.esm.js
packages/uni-mp-weixin/dist/uni.api.esm.js
+52
-52
packages/uni-quickapp-webview/dist/uni.api.esm.js
packages/uni-quickapp-webview/dist/uni.api.esm.js
+52
-52
packages/uni-shared/dist/uni-shared.cjs.js
packages/uni-shared/dist/uni-shared.cjs.js
+52
-0
packages/uni-shared/dist/uni-shared.d.ts
packages/uni-shared/dist/uni-shared.d.ts
+14
-0
packages/uni-shared/dist/uni-shared.es.js
packages/uni-shared/dist/uni-shared.es.js
+52
-1
packages/uni-shared/src/TinyEmitter.ts
packages/uni-shared/src/TinyEmitter.ts
+1
-1
packages/uni-shared/src/index.ts
packages/uni-shared/src/index.ts
+1
-0
未找到文件。
packages/uni-api/src/service/base/eventBus.ts
浏览文件 @
1ebfad2e
import
{
Emitter
}
from
'
@dcloudio/uni-shared
'
import
{
defineSyncApi
}
from
'
../../helpers/api
'
import
{
defineSyncApi
}
from
'
../../helpers/api
'
import
{
import
{
API_ON
,
API_ON
,
...
@@ -13,7 +14,6 @@ import {
...
@@ -13,7 +14,6 @@ import {
EmitProtocol
,
EmitProtocol
,
OnceProtocol
,
OnceProtocol
,
}
from
'
../../protocols/base/eventBus
'
}
from
'
../../protocols/base/eventBus
'
import
{
Emitter
}
from
'
@dcloudio/uni-core
'
type
EventStopHandler
=
()
=>
void
type
EventStopHandler
=
()
=>
void
...
...
packages/uni-app-plus/dist/uni-app-view.umd.js
浏览文件 @
1ebfad2e
此差异已折叠。
点击以展开。
packages/uni-app-plus/dist/uni.runtime.esm.js
浏览文件 @
1ebfad2e
import { isArray as isArray$1, hasOwn as hasOwn$1, isString, isPlainObject, isObject as isObject$1, toRawType, capitalize, makeMap, isFunction, isPromise, extend, toTypeString } from '@vue/shared';
import { isArray as isArray$1, hasOwn as hasOwn$1, isString, isPlainObject, isObject as isObject$1, toRawType, capitalize, makeMap, isFunction, isPromise, extend, toTypeString } from '@vue/shared';
import { LINEFEED, once, I18N_JSON_DELIMITERS, addLeadingSlash, resolveComponentInstance, invokeArrayFns, ON_RESIZE, ON_APP_ENTER_FOREGROUND, ON_APP_ENTER_BACKGROUND, ON_SHOW, ON_HIDE, ON_PAGE_SCROLL, ON_REACH_BOTTOM, SCHEME_RE, DATA_RE, cacheStringFunction, parseQuery, ON_ERROR, callOptions, ON_LAUNCH, PRIMARY_COLOR, removeLeadingSlash, getLen, formatLog, TABBAR_HEIGHT, NAVBAR_HEIGHT, ON_THEME_CHANGE, ON_KEYBOARD_HEIGHT_CHANGE, ON_LOAD, RENDERJS_MODULES, WXS_PROTOCOL, WXS_MODULES, UniLifecycleHooks, ON_TAB_ITEM_TAP, ACTION_TYPE_EVENT, BACKGROUND_COLOR, ON_NAVIGATION_BAR_BUTTON_TAP, stringifyQuery as stringifyQuery$1, debounce, ON_PULL_DOWN_REFRESH, ON_NAVIGATION_BAR_SEARCH_INPUT_CHANGED, ON_NAVIGATION_BAR_SEARCH_INPUT_CONFIRMED, ON_NAVIGATION_BAR_SEARCH_INPUT_CLICKED, ON_NAVIGATION_BAR_SEARCH_INPUT_FOCUS_CHANGED, UniNode, NODE_TYPE_PAGE, ACTION_TYPE_PAGE_CREATE, ACTION_TYPE_PAGE_CREATED, ACTION_TYPE_PAGE_SCROLL, ACTION_TYPE_INSERT, ACTION_TYPE_CREATE, ACTION_TYPE_REMOVE, ACTION_TYPE_ADD_EVENT, ACTION_TYPE_ADD_WXS_EVENT, ACTION_TYPE_REMOVE_EVENT, ACTION_TYPE_SET_ATTRIBUTE, ACTION_TYPE_REMOVE_ATTRIBUTE, ACTION_TYPE_SET_TEXT, ON_READY, ON_UNLOAD, EventChannel, ON_REACH_BOTTOM_DISTANCE, parseUrl, createUniEvent, ON_WXS_INVOKE_CALL_METHOD, WEB_INVOKE_APPSERVICE, ON_BACK_PRESS } from '@dcloudio/uni-shared';
import { LINEFEED, once, I18N_JSON_DELIMITERS,
Emitter,
addLeadingSlash, resolveComponentInstance, invokeArrayFns, ON_RESIZE, ON_APP_ENTER_FOREGROUND, ON_APP_ENTER_BACKGROUND, ON_SHOW, ON_HIDE, ON_PAGE_SCROLL, ON_REACH_BOTTOM, SCHEME_RE, DATA_RE, cacheStringFunction, parseQuery, ON_ERROR, callOptions, ON_LAUNCH, PRIMARY_COLOR, removeLeadingSlash, getLen, formatLog, TABBAR_HEIGHT, NAVBAR_HEIGHT, ON_THEME_CHANGE, ON_KEYBOARD_HEIGHT_CHANGE, ON_LOAD, RENDERJS_MODULES, WXS_PROTOCOL, WXS_MODULES, UniLifecycleHooks, ON_TAB_ITEM_TAP, ACTION_TYPE_EVENT, BACKGROUND_COLOR, ON_NAVIGATION_BAR_BUTTON_TAP, stringifyQuery as stringifyQuery$1, debounce, ON_PULL_DOWN_REFRESH, ON_NAVIGATION_BAR_SEARCH_INPUT_CHANGED, ON_NAVIGATION_BAR_SEARCH_INPUT_CONFIRMED, ON_NAVIGATION_BAR_SEARCH_INPUT_CLICKED, ON_NAVIGATION_BAR_SEARCH_INPUT_FOCUS_CHANGED, UniNode, NODE_TYPE_PAGE, ACTION_TYPE_PAGE_CREATE, ACTION_TYPE_PAGE_CREATED, ACTION_TYPE_PAGE_SCROLL, ACTION_TYPE_INSERT, ACTION_TYPE_CREATE, ACTION_TYPE_REMOVE, ACTION_TYPE_ADD_EVENT, ACTION_TYPE_ADD_WXS_EVENT, ACTION_TYPE_REMOVE_EVENT, ACTION_TYPE_SET_ATTRIBUTE, ACTION_TYPE_REMOVE_ATTRIBUTE, ACTION_TYPE_SET_TEXT, ON_READY, ON_UNLOAD, EventChannel, ON_REACH_BOTTOM_DISTANCE, parseUrl, createUniEvent, ON_WXS_INVOKE_CALL_METHOD, WEB_INVOKE_APPSERVICE, ON_BACK_PRESS } from '@dcloudio/uni-shared';
import { ref, injectHook, nextTick, createVNode, render, queuePostFlushCb, getCurrentInstance, onMounted, onBeforeUnmount } from 'vue';
import { ref, injectHook, nextTick, createVNode, render, queuePostFlushCb, getCurrentInstance, onMounted, onBeforeUnmount } from 'vue';
/*
/*
...
@@ -1346,57 +1346,6 @@ function initPullToRefreshI18n(pullToRefresh) {
...
@@ -1346,57 +1346,6 @@ function initPullToRefreshI18n(pullToRefresh) {
}
}
}
}
const E = function () {
// Keep this empty so it's easier to inherit from
// (via https://github.com/lipsmack from https://github.com/scottcorgan/tiny-emitter/issues/3)
};
E.prototype = {
on: function (name, callback, ctx) {
var e = this.e || (this.e = {});
(e[name] || (e[name] = [])).push({
fn: callback,
ctx: ctx,
});
return this;
},
once: function (name, callback, ctx) {
var self = this;
function listener() {
self.off(name, listener);
callback.apply(ctx, arguments);
}
listener._ = callback;
return this.on(name, listener, ctx);
},
emit: function (name) {
var data = [].slice.call(arguments, 1);
var evtArr = ((this.e || (this.e = {}))[name] || []).slice();
var i = 0;
var len = evtArr.length;
for (i; i < len; i++) {
evtArr[i].fn.apply(evtArr[i].ctx, data);
}
return this;
},
off: function (name, callback) {
var e = this.e || (this.e = {});
var evts = e[name];
var liveEvents = [];
if (evts && callback) {
for (var i = 0, len = evts.length; i < len; i++) {
if (evts[i].fn !== callback && evts[i].fn._ !== callback)
liveEvents.push(evts[i]);
}
}
// Remove event from queue to prevent memory leak
// Suggested by https://github.com/lazd
// Ref: https://github.com/scottcorgan/tiny-emitter/commit/c6ebfaa9bc973b33d110a84a307742b7cf94c953#commitcomment-5024910
liveEvents.length ? (e[name] = liveEvents) : delete e[name];
return this;
},
};
var Emitter = E;
function initBridge(subscribeNamespace) {
function initBridge(subscribeNamespace) {
const emitter = new Emitter();
const emitter = new Emitter();
return {
return {
...
...
packages/uni-core/src/helpers/bridge.ts
浏览文件 @
1ebfad2e
import
E
from
'
./TinyEmitter
'
import
{
Emitter
}
from
'
@dcloudio/uni-shared
'
export
function
initBridge
(
export
function
initBridge
(
subscribeNamespace
:
'
service
'
|
'
view
'
|
'
nvue
'
subscribeNamespace
:
'
service
'
|
'
view
'
|
'
nvue
'
...
@@ -9,7 +9,7 @@ export function initBridge(
...
@@ -9,7 +9,7 @@ export function initBridge(
|
'
invokeViewMethodKeepAlive
'
|
'
invokeViewMethodKeepAlive
'
|
'
publishHandler
'
|
'
publishHandler
'
>
{
>
{
const
emitter
=
new
E
()
const
emitter
=
new
E
mitter
()
return
{
return
{
on
(
event
:
string
,
callback
:
UniApp
.
CallbackFunction
)
{
on
(
event
:
string
,
callback
:
UniApp
.
CallbackFunction
)
{
return
emitter
.
on
(
event
,
callback
)
return
emitter
.
on
(
event
,
callback
)
...
...
packages/uni-core/src/helpers/index.ts
浏览文件 @
1ebfad2e
...
@@ -6,4 +6,3 @@ export * from './hook'
...
@@ -6,4 +6,3 @@ export * from './hook'
export
*
from
'
./scroll
'
export
*
from
'
./scroll
'
export
*
from
'
./route
'
export
*
from
'
./route
'
export
*
from
'
./callbacks
'
export
*
from
'
./callbacks
'
export
{
default
as
Emitter
}
from
'
./TinyEmitter
'
packages/uni-h5/dist/uni-h5.cjs.js
浏览文件 @
1ebfad2e
...
@@ -156,52 +156,8 @@ function initTabBarI18n(tabBar2) {
...
@@ -156,52 +156,8 @@ function initTabBarI18n(tabBar2) {
}
}
return
tabBar2
;
return
tabBar2
;
}
}
const
E
=
function
()
{
};
E
.
prototype
=
{
on
:
function
(
name
,
callback
,
ctx
)
{
var
e2
=
this
.
e
||
(
this
.
e
=
{});
(
e2
[
name
]
||
(
e2
[
name
]
=
[])).
push
({
fn
:
callback
,
ctx
});
return
this
;
},
once
:
function
(
name
,
callback
,
ctx
)
{
var
self
=
this
;
function
listener
()
{
self
.
off
(
name
,
listener
);
callback
.
apply
(
ctx
,
arguments
);
}
listener
.
_
=
callback
;
return
this
.
on
(
name
,
listener
,
ctx
);
},
emit
:
function
(
name
)
{
var
data
=
[].
slice
.
call
(
arguments
,
1
);
var
evtArr
=
((
this
.
e
||
(
this
.
e
=
{}))[
name
]
||
[]).
slice
();
var
i
=
0
;
var
len
=
evtArr
.
length
;
for
(
i
;
i
<
len
;
i
++
)
{
evtArr
[
i
].
fn
.
apply
(
evtArr
[
i
].
ctx
,
data
);
}
return
this
;
},
off
:
function
(
name
,
callback
)
{
var
e2
=
this
.
e
||
(
this
.
e
=
{});
var
evts
=
e2
[
name
];
var
liveEvents
=
[];
if
(
evts
&&
callback
)
{
for
(
var
i
=
0
,
len
=
evts
.
length
;
i
<
len
;
i
++
)
{
if
(
evts
[
i
].
fn
!==
callback
&&
evts
[
i
].
fn
.
_
!==
callback
)
liveEvents
.
push
(
evts
[
i
]);
}
}
liveEvents
.
length
?
e2
[
name
]
=
liveEvents
:
delete
e2
[
name
];
return
this
;
}
};
function
initBridge
(
subscribeNamespace
)
{
function
initBridge
(
subscribeNamespace
)
{
const
emitter
=
new
E
();
const
emitter
=
new
uniShared
.
Emitter
();
return
{
return
{
on
(
event
,
callback
)
{
on
(
event
,
callback
)
{
return
emitter
.
on
(
event
,
callback
);
return
emitter
.
on
(
event
,
callback
);
...
@@ -1360,6 +1316,7 @@ function defineSyncApi(name, fn, protocol, options) {
...
@@ -1360,6 +1316,7 @@ function defineSyncApi(name, fn, protocol, options) {
function
defineAsyncApi
(
name
,
fn
,
protocol
,
options
)
{
function
defineAsyncApi
(
name
,
fn
,
protocol
,
options
)
{
return
promisify
(
name
,
wrapperAsyncApi
(
name
,
fn
,
process
.
env
.
NODE_ENV
!==
"
production
"
?
protocol
:
void
0
,
options
));
return
promisify
(
name
,
wrapperAsyncApi
(
name
,
fn
,
process
.
env
.
NODE_ENV
!==
"
production
"
?
protocol
:
void
0
,
options
));
}
}
new
uniShared
.
Emitter
();
const
validator
=
[
const
validator
=
[
{
{
name
:
"
id
"
,
name
:
"
id
"
,
...
...
packages/uni-h5/dist/uni-h5.es.js
浏览文件 @
1ebfad2e
import { withModifiers, createVNode, getCurrentInstance, ref, defineComponent, openBlock, createElementBlock, provide, computed, watch, onUnmounted, inject, onBeforeUnmount, mergeProps, injectHook, reactive, onActivated, onMounted, nextTick, onBeforeMount, withDirectives, vShow, shallowRef, watchEffect, isVNode, Fragment, markRaw, Comment, createTextVNode, onBeforeActivate, onBeforeDeactivate, createBlock, renderList, onDeactivated, createApp, Transition, effectScope, withCtx, KeepAlive, resolveDynamicComponent, createElementVNode, normalizeStyle, renderSlot } from "vue";
import { withModifiers, createVNode, getCurrentInstance, ref, defineComponent, openBlock, createElementBlock, provide, computed, watch, onUnmounted, inject, onBeforeUnmount, mergeProps, injectHook, reactive, onActivated, onMounted, nextTick, onBeforeMount, withDirectives, vShow, shallowRef, watchEffect, isVNode, Fragment, markRaw, Comment, createTextVNode, onBeforeActivate, onBeforeDeactivate, createBlock, renderList, onDeactivated, createApp, Transition, effectScope, withCtx, KeepAlive, resolveDynamicComponent, createElementVNode, normalizeStyle, renderSlot } from "vue";
import { isString, extend, stringifyStyle, parseStringStyle, isPlainObject, isFunction, capitalize, camelize, isArray, hasOwn, isObject, toRawType, makeMap as makeMap$1, isPromise, hyphenate, invokeArrayFns as invokeArrayFns$1 } from "@vue/shared";
import { isString, extend, stringifyStyle, parseStringStyle, isPlainObject, isFunction, capitalize, camelize, isArray, hasOwn, isObject, toRawType, makeMap as makeMap$1, isPromise, hyphenate, invokeArrayFns as invokeArrayFns$1 } from "@vue/shared";
import { once, UNI_STORAGE_LOCALE, I18N_JSON_DELIMITERS, passive, initCustomDataset, resolveComponentInstance, addLeadingSlash, invokeArrayFns, resolveOwnerVm, resolveOwnerEl, ON_WXS_INVOKE_CALL_METHOD, normalizeTarget, ON_RESIZE, ON_APP_ENTER_FOREGROUND, ON_APP_ENTER_BACKGROUND, ON_SHOW, ON_HIDE, ON_PAGE_SCROLL, ON_REACH_BOTTOM, EventChannel, SCHEME_RE, DATA_RE, getCustomDataset, LINEFEED, ON_ERROR, callOptions, ON_LAUNCH, PRIMARY_COLOR, removeLeadingSlash, getLen, debounce, ON_LOAD, UniLifecycleHooks, NAVBAR_HEIGHT, parseQuery, ON_UNLOAD, ON_REACH_BOTTOM_DISTANCE, decodedQuery, WEB_INVOKE_APPSERVICE, ON_WEB_INVOKE_APP_SERVICE, updateElementStyle, ON_BACK_PRESS, parseUrl, addFont, scrollTo, RESPONSIVE_MIN_WIDTH, formatDateTime, ON_NAVIGATION_BAR_BUTTON_TAP, ON_NAVIGATION_BAR_SEARCH_INPUT_CLICKED, ON_NAVIGATION_BAR_SEARCH_INPUT_FOCUS_CHANGED, ON_NAVIGATION_BAR_SEARCH_INPUT_CHANGED, ON_NAVIGATION_BAR_SEARCH_INPUT_CONFIRMED, ON_PULL_DOWN_REFRESH } from "@dcloudio/uni-shared";
import { once, UNI_STORAGE_LOCALE, I18N_JSON_DELIMITERS,
Emitter,
passive, initCustomDataset, resolveComponentInstance, addLeadingSlash, invokeArrayFns, resolveOwnerVm, resolveOwnerEl, ON_WXS_INVOKE_CALL_METHOD, normalizeTarget, ON_RESIZE, ON_APP_ENTER_FOREGROUND, ON_APP_ENTER_BACKGROUND, ON_SHOW, ON_HIDE, ON_PAGE_SCROLL, ON_REACH_BOTTOM, EventChannel, SCHEME_RE, DATA_RE, getCustomDataset, LINEFEED, ON_ERROR, callOptions, ON_LAUNCH, PRIMARY_COLOR, removeLeadingSlash, getLen, debounce, ON_LOAD, UniLifecycleHooks, NAVBAR_HEIGHT, parseQuery, ON_UNLOAD, ON_REACH_BOTTOM_DISTANCE, decodedQuery, WEB_INVOKE_APPSERVICE, ON_WEB_INVOKE_APP_SERVICE, updateElementStyle, ON_BACK_PRESS, parseUrl, addFont, scrollTo, RESPONSIVE_MIN_WIDTH, formatDateTime, ON_NAVIGATION_BAR_BUTTON_TAP, ON_NAVIGATION_BAR_SEARCH_INPUT_CLICKED, ON_NAVIGATION_BAR_SEARCH_INPUT_FOCUS_CHANGED, ON_NAVIGATION_BAR_SEARCH_INPUT_CHANGED, ON_NAVIGATION_BAR_SEARCH_INPUT_CONFIRMED, ON_PULL_DOWN_REFRESH } from "@dcloudio/uni-shared";
import { initVueI18n, isI18nStr, LOCALE_EN, LOCALE_ES, LOCALE_FR, LOCALE_ZH_HANS, LOCALE_ZH_HANT } from "@dcloudio/uni-i18n";
import { initVueI18n, isI18nStr, LOCALE_EN, LOCALE_ES, LOCALE_FR, LOCALE_ZH_HANS, LOCALE_ZH_HANT } from "@dcloudio/uni-i18n";
import { useRoute, createRouter, createWebHistory, createWebHashHistory, useRouter, isNavigationFailure, RouterView } from "vue-router";
import { useRoute, createRouter, createWebHistory, createWebHashHistory, useRouter, isNavigationFailure, RouterView } from "vue-router";
const isEnableLocale = once(() => typeof __uniConfig !== "undefined" && __uniConfig.locales && !!Object.keys(__uniConfig.locales).length);
const isEnableLocale = once(() => typeof __uniConfig !== "undefined" && __uniConfig.locales && !!Object.keys(__uniConfig.locales).length);
...
@@ -342,52 +342,8 @@ function initTabBarI18n(tabBar2) {
...
@@ -342,52 +342,8 @@ function initTabBarI18n(tabBar2) {
}
}
return tabBar2;
return tabBar2;
}
}
const E = function() {
};
E.prototype = {
on: function(name, callback, ctx) {
var e2 = this.e || (this.e = {});
(e2[name] || (e2[name] = [])).push({
fn: callback,
ctx
});
return this;
},
once: function(name, callback, ctx) {
var self = this;
function listener2() {
self.off(name, listener2);
callback.apply(ctx, arguments);
}
listener2._ = callback;
return this.on(name, listener2, ctx);
},
emit: function(name) {
var data = [].slice.call(arguments, 1);
var evtArr = ((this.e || (this.e = {}))[name] || []).slice();
var i = 0;
var len = evtArr.length;
for (i; i < len; i++) {
evtArr[i].fn.apply(evtArr[i].ctx, data);
}
return this;
},
off: function(name, callback) {
var e2 = this.e || (this.e = {});
var evts = e2[name];
var liveEvents = [];
if (evts && callback) {
for (var i = 0, len = evts.length; i < len; i++) {
if (evts[i].fn !== callback && evts[i].fn._ !== callback)
liveEvents.push(evts[i]);
}
}
liveEvents.length ? e2[name] = liveEvents : delete e2[name];
return this;
}
};
function initBridge(subscribeNamespace) {
function initBridge(subscribeNamespace) {
const emitter2 = new E();
const emitter2 = new E
mitter
();
return {
return {
on(event, callback) {
on(event, callback) {
return emitter2.on(event, callback);
return emitter2.on(event, callback);
...
@@ -2967,7 +2923,7 @@ const EmitProtocol = [
...
@@ -2967,7 +2923,7 @@ const EmitProtocol = [
required: true
required: true
}
}
];
];
const emitter = new E();
const emitter = new E
mitter
();
const $on = /* @__PURE__ */ defineSyncApi(API_ON, (name, callback) => {
const $on = /* @__PURE__ */ defineSyncApi(API_ON, (name, callback) => {
emitter.on(name, callback);
emitter.on(name, callback);
return () => emitter.off(name, callback);
return () => emitter.off(name, callback);
...
...
packages/uni-mp-alipay/dist/uni.api.esm.js
浏览文件 @
1ebfad2e
...
@@ -53,6 +53,57 @@ function getBaseSystemInfo() {
...
@@ -53,6 +53,57 @@ function getBaseSystemInfo() {
return
my
.
getSystemInfoSync
()
return
my
.
getSystemInfoSync
()
}
}
const
E
=
function
()
{
// Keep this empty so it's easier to inherit from
// (via https://github.com/lipsmack from https://github.com/scottcorgan/tiny-emitter/issues/3)
};
E
.
prototype
=
{
on
:
function
(
name
,
callback
,
ctx
)
{
var
e
=
this
.
e
||
(
this
.
e
=
{});
(
e
[
name
]
||
(
e
[
name
]
=
[])).
push
({
fn
:
callback
,
ctx
:
ctx
,
});
return
this
;
},
once
:
function
(
name
,
callback
,
ctx
)
{
var
self
=
this
;
function
listener
()
{
self
.
off
(
name
,
listener
);
callback
.
apply
(
ctx
,
arguments
);
}
listener
.
_
=
callback
;
return
this
.
on
(
name
,
listener
,
ctx
);
},
emit
:
function
(
name
)
{
var
data
=
[].
slice
.
call
(
arguments
,
1
);
var
evtArr
=
((
this
.
e
||
(
this
.
e
=
{}))[
name
]
||
[]).
slice
();
var
i
=
0
;
var
len
=
evtArr
.
length
;
for
(
i
;
i
<
len
;
i
++
)
{
evtArr
[
i
].
fn
.
apply
(
evtArr
[
i
].
ctx
,
data
);
}
return
this
;
},
off
:
function
(
name
,
callback
)
{
var
e
=
this
.
e
||
(
this
.
e
=
{});
var
evts
=
e
[
name
];
var
liveEvents
=
[];
if
(
evts
&&
callback
)
{
for
(
var
i
=
0
,
len
=
evts
.
length
;
i
<
len
;
i
++
)
{
if
(
evts
[
i
].
fn
!==
callback
&&
evts
[
i
].
fn
.
_
!==
callback
)
liveEvents
.
push
(
evts
[
i
]);
}
}
// Remove event from queue to prevent memory leak
// Suggested by https://github.com/lazd
// Ref: https://github.com/scottcorgan/tiny-emitter/commit/c6ebfaa9bc973b33d110a84a307742b7cf94c953#commitcomment-5024910
liveEvents
.
length
?
(
e
[
name
]
=
liveEvents
)
:
delete
e
[
name
];
return
this
;
},
};
var
E$1
=
E
;
function
validateProtocolFail
(
name
,
msg
)
{
function
validateProtocolFail
(
name
,
msg
)
{
console
.
warn
(
`
${
name
}
:
${
msg
}
`
);
console
.
warn
(
`
${
name
}
:
${
msg
}
`
);
}
}
...
@@ -535,58 +586,7 @@ const EmitProtocol = [
...
@@ -535,58 +586,7 @@ const EmitProtocol = [
},
},
];
];
const
E
=
function
()
{
const
emitter
=
new
E$1
();
// Keep this empty so it's easier to inherit from
// (via https://github.com/lipsmack from https://github.com/scottcorgan/tiny-emitter/issues/3)
};
E
.
prototype
=
{
on
:
function
(
name
,
callback
,
ctx
)
{
var
e
=
this
.
e
||
(
this
.
e
=
{});
(
e
[
name
]
||
(
e
[
name
]
=
[])).
push
({
fn
:
callback
,
ctx
:
ctx
,
});
return
this
;
},
once
:
function
(
name
,
callback
,
ctx
)
{
var
self
=
this
;
function
listener
()
{
self
.
off
(
name
,
listener
);
callback
.
apply
(
ctx
,
arguments
);
}
listener
.
_
=
callback
;
return
this
.
on
(
name
,
listener
,
ctx
);
},
emit
:
function
(
name
)
{
var
data
=
[].
slice
.
call
(
arguments
,
1
);
var
evtArr
=
((
this
.
e
||
(
this
.
e
=
{}))[
name
]
||
[]).
slice
();
var
i
=
0
;
var
len
=
evtArr
.
length
;
for
(
i
;
i
<
len
;
i
++
)
{
evtArr
[
i
].
fn
.
apply
(
evtArr
[
i
].
ctx
,
data
);
}
return
this
;
},
off
:
function
(
name
,
callback
)
{
var
e
=
this
.
e
||
(
this
.
e
=
{});
var
evts
=
e
[
name
];
var
liveEvents
=
[];
if
(
evts
&&
callback
)
{
for
(
var
i
=
0
,
len
=
evts
.
length
;
i
<
len
;
i
++
)
{
if
(
evts
[
i
].
fn
!==
callback
&&
evts
[
i
].
fn
.
_
!==
callback
)
liveEvents
.
push
(
evts
[
i
]);
}
}
// Remove event from queue to prevent memory leak
// Suggested by https://github.com/lazd
// Ref: https://github.com/scottcorgan/tiny-emitter/commit/c6ebfaa9bc973b33d110a84a307742b7cf94c953#commitcomment-5024910
liveEvents
.
length
?
(
e
[
name
]
=
liveEvents
)
:
delete
e
[
name
];
return
this
;
},
};
var
Emitter
=
E
;
const
emitter
=
new
Emitter
();
const
$on
=
defineSyncApi
(
API_ON
,
(
name
,
callback
)
=>
{
const
$on
=
defineSyncApi
(
API_ON
,
(
name
,
callback
)
=>
{
emitter
.
on
(
name
,
callback
);
emitter
.
on
(
name
,
callback
);
return
()
=>
emitter
.
off
(
name
,
callback
);
return
()
=>
emitter
.
off
(
name
,
callback
);
...
...
packages/uni-mp-baidu/dist/uni.api.esm.js
浏览文件 @
1ebfad2e
...
@@ -53,6 +53,57 @@ function getBaseSystemInfo() {
...
@@ -53,6 +53,57 @@ function getBaseSystemInfo() {
return
swan
.
getSystemInfoSync
()
return
swan
.
getSystemInfoSync
()
}
}
const
E
=
function
()
{
// Keep this empty so it's easier to inherit from
// (via https://github.com/lipsmack from https://github.com/scottcorgan/tiny-emitter/issues/3)
};
E
.
prototype
=
{
on
:
function
(
name
,
callback
,
ctx
)
{
var
e
=
this
.
e
||
(
this
.
e
=
{});
(
e
[
name
]
||
(
e
[
name
]
=
[])).
push
({
fn
:
callback
,
ctx
:
ctx
,
});
return
this
;
},
once
:
function
(
name
,
callback
,
ctx
)
{
var
self
=
this
;
function
listener
()
{
self
.
off
(
name
,
listener
);
callback
.
apply
(
ctx
,
arguments
);
}
listener
.
_
=
callback
;
return
this
.
on
(
name
,
listener
,
ctx
);
},
emit
:
function
(
name
)
{
var
data
=
[].
slice
.
call
(
arguments
,
1
);
var
evtArr
=
((
this
.
e
||
(
this
.
e
=
{}))[
name
]
||
[]).
slice
();
var
i
=
0
;
var
len
=
evtArr
.
length
;
for
(
i
;
i
<
len
;
i
++
)
{
evtArr
[
i
].
fn
.
apply
(
evtArr
[
i
].
ctx
,
data
);
}
return
this
;
},
off
:
function
(
name
,
callback
)
{
var
e
=
this
.
e
||
(
this
.
e
=
{});
var
evts
=
e
[
name
];
var
liveEvents
=
[];
if
(
evts
&&
callback
)
{
for
(
var
i
=
0
,
len
=
evts
.
length
;
i
<
len
;
i
++
)
{
if
(
evts
[
i
].
fn
!==
callback
&&
evts
[
i
].
fn
.
_
!==
callback
)
liveEvents
.
push
(
evts
[
i
]);
}
}
// Remove event from queue to prevent memory leak
// Suggested by https://github.com/lazd
// Ref: https://github.com/scottcorgan/tiny-emitter/commit/c6ebfaa9bc973b33d110a84a307742b7cf94c953#commitcomment-5024910
liveEvents
.
length
?
(
e
[
name
]
=
liveEvents
)
:
delete
e
[
name
];
return
this
;
},
};
var
E$1
=
E
;
function
validateProtocolFail
(
name
,
msg
)
{
function
validateProtocolFail
(
name
,
msg
)
{
console
.
warn
(
`
${
name
}
:
${
msg
}
`
);
console
.
warn
(
`
${
name
}
:
${
msg
}
`
);
}
}
...
@@ -535,58 +586,7 @@ const EmitProtocol = [
...
@@ -535,58 +586,7 @@ const EmitProtocol = [
},
},
];
];
const
E
=
function
()
{
const
emitter
=
new
E$1
();
// Keep this empty so it's easier to inherit from
// (via https://github.com/lipsmack from https://github.com/scottcorgan/tiny-emitter/issues/3)
};
E
.
prototype
=
{
on
:
function
(
name
,
callback
,
ctx
)
{
var
e
=
this
.
e
||
(
this
.
e
=
{});
(
e
[
name
]
||
(
e
[
name
]
=
[])).
push
({
fn
:
callback
,
ctx
:
ctx
,
});
return
this
;
},
once
:
function
(
name
,
callback
,
ctx
)
{
var
self
=
this
;
function
listener
()
{
self
.
off
(
name
,
listener
);
callback
.
apply
(
ctx
,
arguments
);
}
listener
.
_
=
callback
;
return
this
.
on
(
name
,
listener
,
ctx
);
},
emit
:
function
(
name
)
{
var
data
=
[].
slice
.
call
(
arguments
,
1
);
var
evtArr
=
((
this
.
e
||
(
this
.
e
=
{}))[
name
]
||
[]).
slice
();
var
i
=
0
;
var
len
=
evtArr
.
length
;
for
(
i
;
i
<
len
;
i
++
)
{
evtArr
[
i
].
fn
.
apply
(
evtArr
[
i
].
ctx
,
data
);
}
return
this
;
},
off
:
function
(
name
,
callback
)
{
var
e
=
this
.
e
||
(
this
.
e
=
{});
var
evts
=
e
[
name
];
var
liveEvents
=
[];
if
(
evts
&&
callback
)
{
for
(
var
i
=
0
,
len
=
evts
.
length
;
i
<
len
;
i
++
)
{
if
(
evts
[
i
].
fn
!==
callback
&&
evts
[
i
].
fn
.
_
!==
callback
)
liveEvents
.
push
(
evts
[
i
]);
}
}
// Remove event from queue to prevent memory leak
// Suggested by https://github.com/lazd
// Ref: https://github.com/scottcorgan/tiny-emitter/commit/c6ebfaa9bc973b33d110a84a307742b7cf94c953#commitcomment-5024910
liveEvents
.
length
?
(
e
[
name
]
=
liveEvents
)
:
delete
e
[
name
];
return
this
;
},
};
var
Emitter
=
E
;
const
emitter
=
new
Emitter
();
const
$on
=
defineSyncApi
(
API_ON
,
(
name
,
callback
)
=>
{
const
$on
=
defineSyncApi
(
API_ON
,
(
name
,
callback
)
=>
{
emitter
.
on
(
name
,
callback
);
emitter
.
on
(
name
,
callback
);
return
()
=>
emitter
.
off
(
name
,
callback
);
return
()
=>
emitter
.
off
(
name
,
callback
);
...
...
packages/uni-mp-kuaishou/dist/uni.api.esm.js
浏览文件 @
1ebfad2e
...
@@ -53,6 +53,57 @@ function getBaseSystemInfo() {
...
@@ -53,6 +53,57 @@ function getBaseSystemInfo() {
return
ks
.
getSystemInfoSync
()
return
ks
.
getSystemInfoSync
()
}
}
const
E
=
function
()
{
// Keep this empty so it's easier to inherit from
// (via https://github.com/lipsmack from https://github.com/scottcorgan/tiny-emitter/issues/3)
};
E
.
prototype
=
{
on
:
function
(
name
,
callback
,
ctx
)
{
var
e
=
this
.
e
||
(
this
.
e
=
{});
(
e
[
name
]
||
(
e
[
name
]
=
[])).
push
({
fn
:
callback
,
ctx
:
ctx
,
});
return
this
;
},
once
:
function
(
name
,
callback
,
ctx
)
{
var
self
=
this
;
function
listener
()
{
self
.
off
(
name
,
listener
);
callback
.
apply
(
ctx
,
arguments
);
}
listener
.
_
=
callback
;
return
this
.
on
(
name
,
listener
,
ctx
);
},
emit
:
function
(
name
)
{
var
data
=
[].
slice
.
call
(
arguments
,
1
);
var
evtArr
=
((
this
.
e
||
(
this
.
e
=
{}))[
name
]
||
[]).
slice
();
var
i
=
0
;
var
len
=
evtArr
.
length
;
for
(
i
;
i
<
len
;
i
++
)
{
evtArr
[
i
].
fn
.
apply
(
evtArr
[
i
].
ctx
,
data
);
}
return
this
;
},
off
:
function
(
name
,
callback
)
{
var
e
=
this
.
e
||
(
this
.
e
=
{});
var
evts
=
e
[
name
];
var
liveEvents
=
[];
if
(
evts
&&
callback
)
{
for
(
var
i
=
0
,
len
=
evts
.
length
;
i
<
len
;
i
++
)
{
if
(
evts
[
i
].
fn
!==
callback
&&
evts
[
i
].
fn
.
_
!==
callback
)
liveEvents
.
push
(
evts
[
i
]);
}
}
// Remove event from queue to prevent memory leak
// Suggested by https://github.com/lazd
// Ref: https://github.com/scottcorgan/tiny-emitter/commit/c6ebfaa9bc973b33d110a84a307742b7cf94c953#commitcomment-5024910
liveEvents
.
length
?
(
e
[
name
]
=
liveEvents
)
:
delete
e
[
name
];
return
this
;
},
};
var
E$1
=
E
;
function
validateProtocolFail
(
name
,
msg
)
{
function
validateProtocolFail
(
name
,
msg
)
{
console
.
warn
(
`
${
name
}
:
${
msg
}
`
);
console
.
warn
(
`
${
name
}
:
${
msg
}
`
);
}
}
...
@@ -535,58 +586,7 @@ const EmitProtocol = [
...
@@ -535,58 +586,7 @@ const EmitProtocol = [
},
},
];
];
const
E
=
function
()
{
const
emitter
=
new
E$1
();
// Keep this empty so it's easier to inherit from
// (via https://github.com/lipsmack from https://github.com/scottcorgan/tiny-emitter/issues/3)
};
E
.
prototype
=
{
on
:
function
(
name
,
callback
,
ctx
)
{
var
e
=
this
.
e
||
(
this
.
e
=
{});
(
e
[
name
]
||
(
e
[
name
]
=
[])).
push
({
fn
:
callback
,
ctx
:
ctx
,
});
return
this
;
},
once
:
function
(
name
,
callback
,
ctx
)
{
var
self
=
this
;
function
listener
()
{
self
.
off
(
name
,
listener
);
callback
.
apply
(
ctx
,
arguments
);
}
listener
.
_
=
callback
;
return
this
.
on
(
name
,
listener
,
ctx
);
},
emit
:
function
(
name
)
{
var
data
=
[].
slice
.
call
(
arguments
,
1
);
var
evtArr
=
((
this
.
e
||
(
this
.
e
=
{}))[
name
]
||
[]).
slice
();
var
i
=
0
;
var
len
=
evtArr
.
length
;
for
(
i
;
i
<
len
;
i
++
)
{
evtArr
[
i
].
fn
.
apply
(
evtArr
[
i
].
ctx
,
data
);
}
return
this
;
},
off
:
function
(
name
,
callback
)
{
var
e
=
this
.
e
||
(
this
.
e
=
{});
var
evts
=
e
[
name
];
var
liveEvents
=
[];
if
(
evts
&&
callback
)
{
for
(
var
i
=
0
,
len
=
evts
.
length
;
i
<
len
;
i
++
)
{
if
(
evts
[
i
].
fn
!==
callback
&&
evts
[
i
].
fn
.
_
!==
callback
)
liveEvents
.
push
(
evts
[
i
]);
}
}
// Remove event from queue to prevent memory leak
// Suggested by https://github.com/lazd
// Ref: https://github.com/scottcorgan/tiny-emitter/commit/c6ebfaa9bc973b33d110a84a307742b7cf94c953#commitcomment-5024910
liveEvents
.
length
?
(
e
[
name
]
=
liveEvents
)
:
delete
e
[
name
];
return
this
;
},
};
var
Emitter
=
E
;
const
emitter
=
new
Emitter
();
const
$on
=
defineSyncApi
(
API_ON
,
(
name
,
callback
)
=>
{
const
$on
=
defineSyncApi
(
API_ON
,
(
name
,
callback
)
=>
{
emitter
.
on
(
name
,
callback
);
emitter
.
on
(
name
,
callback
);
return
()
=>
emitter
.
off
(
name
,
callback
);
return
()
=>
emitter
.
off
(
name
,
callback
);
...
...
packages/uni-mp-lark/dist/uni.api.esm.js
浏览文件 @
1ebfad2e
...
@@ -53,6 +53,57 @@ function getBaseSystemInfo() {
...
@@ -53,6 +53,57 @@ function getBaseSystemInfo() {
return
tt
.
getSystemInfoSync
()
return
tt
.
getSystemInfoSync
()
}
}
const
E
=
function
()
{
// Keep this empty so it's easier to inherit from
// (via https://github.com/lipsmack from https://github.com/scottcorgan/tiny-emitter/issues/3)
};
E
.
prototype
=
{
on
:
function
(
name
,
callback
,
ctx
)
{
var
e
=
this
.
e
||
(
this
.
e
=
{});
(
e
[
name
]
||
(
e
[
name
]
=
[])).
push
({
fn
:
callback
,
ctx
:
ctx
,
});
return
this
;
},
once
:
function
(
name
,
callback
,
ctx
)
{
var
self
=
this
;
function
listener
()
{
self
.
off
(
name
,
listener
);
callback
.
apply
(
ctx
,
arguments
);
}
listener
.
_
=
callback
;
return
this
.
on
(
name
,
listener
,
ctx
);
},
emit
:
function
(
name
)
{
var
data
=
[].
slice
.
call
(
arguments
,
1
);
var
evtArr
=
((
this
.
e
||
(
this
.
e
=
{}))[
name
]
||
[]).
slice
();
var
i
=
0
;
var
len
=
evtArr
.
length
;
for
(
i
;
i
<
len
;
i
++
)
{
evtArr
[
i
].
fn
.
apply
(
evtArr
[
i
].
ctx
,
data
);
}
return
this
;
},
off
:
function
(
name
,
callback
)
{
var
e
=
this
.
e
||
(
this
.
e
=
{});
var
evts
=
e
[
name
];
var
liveEvents
=
[];
if
(
evts
&&
callback
)
{
for
(
var
i
=
0
,
len
=
evts
.
length
;
i
<
len
;
i
++
)
{
if
(
evts
[
i
].
fn
!==
callback
&&
evts
[
i
].
fn
.
_
!==
callback
)
liveEvents
.
push
(
evts
[
i
]);
}
}
// Remove event from queue to prevent memory leak
// Suggested by https://github.com/lazd
// Ref: https://github.com/scottcorgan/tiny-emitter/commit/c6ebfaa9bc973b33d110a84a307742b7cf94c953#commitcomment-5024910
liveEvents
.
length
?
(
e
[
name
]
=
liveEvents
)
:
delete
e
[
name
];
return
this
;
},
};
var
E$1
=
E
;
function
validateProtocolFail
(
name
,
msg
)
{
function
validateProtocolFail
(
name
,
msg
)
{
console
.
warn
(
`
${
name
}
:
${
msg
}
`
);
console
.
warn
(
`
${
name
}
:
${
msg
}
`
);
}
}
...
@@ -535,58 +586,7 @@ const EmitProtocol = [
...
@@ -535,58 +586,7 @@ const EmitProtocol = [
},
},
];
];
const
E
=
function
()
{
const
emitter
=
new
E$1
();
// Keep this empty so it's easier to inherit from
// (via https://github.com/lipsmack from https://github.com/scottcorgan/tiny-emitter/issues/3)
};
E
.
prototype
=
{
on
:
function
(
name
,
callback
,
ctx
)
{
var
e
=
this
.
e
||
(
this
.
e
=
{});
(
e
[
name
]
||
(
e
[
name
]
=
[])).
push
({
fn
:
callback
,
ctx
:
ctx
,
});
return
this
;
},
once
:
function
(
name
,
callback
,
ctx
)
{
var
self
=
this
;
function
listener
()
{
self
.
off
(
name
,
listener
);
callback
.
apply
(
ctx
,
arguments
);
}
listener
.
_
=
callback
;
return
this
.
on
(
name
,
listener
,
ctx
);
},
emit
:
function
(
name
)
{
var
data
=
[].
slice
.
call
(
arguments
,
1
);
var
evtArr
=
((
this
.
e
||
(
this
.
e
=
{}))[
name
]
||
[]).
slice
();
var
i
=
0
;
var
len
=
evtArr
.
length
;
for
(
i
;
i
<
len
;
i
++
)
{
evtArr
[
i
].
fn
.
apply
(
evtArr
[
i
].
ctx
,
data
);
}
return
this
;
},
off
:
function
(
name
,
callback
)
{
var
e
=
this
.
e
||
(
this
.
e
=
{});
var
evts
=
e
[
name
];
var
liveEvents
=
[];
if
(
evts
&&
callback
)
{
for
(
var
i
=
0
,
len
=
evts
.
length
;
i
<
len
;
i
++
)
{
if
(
evts
[
i
].
fn
!==
callback
&&
evts
[
i
].
fn
.
_
!==
callback
)
liveEvents
.
push
(
evts
[
i
]);
}
}
// Remove event from queue to prevent memory leak
// Suggested by https://github.com/lazd
// Ref: https://github.com/scottcorgan/tiny-emitter/commit/c6ebfaa9bc973b33d110a84a307742b7cf94c953#commitcomment-5024910
liveEvents
.
length
?
(
e
[
name
]
=
liveEvents
)
:
delete
e
[
name
];
return
this
;
},
};
var
Emitter
=
E
;
const
emitter
=
new
Emitter
();
const
$on
=
defineSyncApi
(
API_ON
,
(
name
,
callback
)
=>
{
const
$on
=
defineSyncApi
(
API_ON
,
(
name
,
callback
)
=>
{
emitter
.
on
(
name
,
callback
);
emitter
.
on
(
name
,
callback
);
return
()
=>
emitter
.
off
(
name
,
callback
);
return
()
=>
emitter
.
off
(
name
,
callback
);
...
...
packages/uni-mp-qq/dist/uni.api.esm.js
浏览文件 @
1ebfad2e
...
@@ -53,6 +53,57 @@ function getBaseSystemInfo() {
...
@@ -53,6 +53,57 @@ function getBaseSystemInfo() {
return
qq
.
getSystemInfoSync
()
return
qq
.
getSystemInfoSync
()
}
}
const
E
=
function
()
{
// Keep this empty so it's easier to inherit from
// (via https://github.com/lipsmack from https://github.com/scottcorgan/tiny-emitter/issues/3)
};
E
.
prototype
=
{
on
:
function
(
name
,
callback
,
ctx
)
{
var
e
=
this
.
e
||
(
this
.
e
=
{});
(
e
[
name
]
||
(
e
[
name
]
=
[])).
push
({
fn
:
callback
,
ctx
:
ctx
,
});
return
this
;
},
once
:
function
(
name
,
callback
,
ctx
)
{
var
self
=
this
;
function
listener
()
{
self
.
off
(
name
,
listener
);
callback
.
apply
(
ctx
,
arguments
);
}
listener
.
_
=
callback
;
return
this
.
on
(
name
,
listener
,
ctx
);
},
emit
:
function
(
name
)
{
var
data
=
[].
slice
.
call
(
arguments
,
1
);
var
evtArr
=
((
this
.
e
||
(
this
.
e
=
{}))[
name
]
||
[]).
slice
();
var
i
=
0
;
var
len
=
evtArr
.
length
;
for
(
i
;
i
<
len
;
i
++
)
{
evtArr
[
i
].
fn
.
apply
(
evtArr
[
i
].
ctx
,
data
);
}
return
this
;
},
off
:
function
(
name
,
callback
)
{
var
e
=
this
.
e
||
(
this
.
e
=
{});
var
evts
=
e
[
name
];
var
liveEvents
=
[];
if
(
evts
&&
callback
)
{
for
(
var
i
=
0
,
len
=
evts
.
length
;
i
<
len
;
i
++
)
{
if
(
evts
[
i
].
fn
!==
callback
&&
evts
[
i
].
fn
.
_
!==
callback
)
liveEvents
.
push
(
evts
[
i
]);
}
}
// Remove event from queue to prevent memory leak
// Suggested by https://github.com/lazd
// Ref: https://github.com/scottcorgan/tiny-emitter/commit/c6ebfaa9bc973b33d110a84a307742b7cf94c953#commitcomment-5024910
liveEvents
.
length
?
(
e
[
name
]
=
liveEvents
)
:
delete
e
[
name
];
return
this
;
},
};
var
E$1
=
E
;
function
validateProtocolFail
(
name
,
msg
)
{
function
validateProtocolFail
(
name
,
msg
)
{
console
.
warn
(
`
${
name
}
:
${
msg
}
`
);
console
.
warn
(
`
${
name
}
:
${
msg
}
`
);
}
}
...
@@ -535,58 +586,7 @@ const EmitProtocol = [
...
@@ -535,58 +586,7 @@ const EmitProtocol = [
},
},
];
];
const
E
=
function
()
{
const
emitter
=
new
E$1
();
// Keep this empty so it's easier to inherit from
// (via https://github.com/lipsmack from https://github.com/scottcorgan/tiny-emitter/issues/3)
};
E
.
prototype
=
{
on
:
function
(
name
,
callback
,
ctx
)
{
var
e
=
this
.
e
||
(
this
.
e
=
{});
(
e
[
name
]
||
(
e
[
name
]
=
[])).
push
({
fn
:
callback
,
ctx
:
ctx
,
});
return
this
;
},
once
:
function
(
name
,
callback
,
ctx
)
{
var
self
=
this
;
function
listener
()
{
self
.
off
(
name
,
listener
);
callback
.
apply
(
ctx
,
arguments
);
}
listener
.
_
=
callback
;
return
this
.
on
(
name
,
listener
,
ctx
);
},
emit
:
function
(
name
)
{
var
data
=
[].
slice
.
call
(
arguments
,
1
);
var
evtArr
=
((
this
.
e
||
(
this
.
e
=
{}))[
name
]
||
[]).
slice
();
var
i
=
0
;
var
len
=
evtArr
.
length
;
for
(
i
;
i
<
len
;
i
++
)
{
evtArr
[
i
].
fn
.
apply
(
evtArr
[
i
].
ctx
,
data
);
}
return
this
;
},
off
:
function
(
name
,
callback
)
{
var
e
=
this
.
e
||
(
this
.
e
=
{});
var
evts
=
e
[
name
];
var
liveEvents
=
[];
if
(
evts
&&
callback
)
{
for
(
var
i
=
0
,
len
=
evts
.
length
;
i
<
len
;
i
++
)
{
if
(
evts
[
i
].
fn
!==
callback
&&
evts
[
i
].
fn
.
_
!==
callback
)
liveEvents
.
push
(
evts
[
i
]);
}
}
// Remove event from queue to prevent memory leak
// Suggested by https://github.com/lazd
// Ref: https://github.com/scottcorgan/tiny-emitter/commit/c6ebfaa9bc973b33d110a84a307742b7cf94c953#commitcomment-5024910
liveEvents
.
length
?
(
e
[
name
]
=
liveEvents
)
:
delete
e
[
name
];
return
this
;
},
};
var
Emitter
=
E
;
const
emitter
=
new
Emitter
();
const
$on
=
defineSyncApi
(
API_ON
,
(
name
,
callback
)
=>
{
const
$on
=
defineSyncApi
(
API_ON
,
(
name
,
callback
)
=>
{
emitter
.
on
(
name
,
callback
);
emitter
.
on
(
name
,
callback
);
return
()
=>
emitter
.
off
(
name
,
callback
);
return
()
=>
emitter
.
off
(
name
,
callback
);
...
...
packages/uni-mp-toutiao/dist/uni.api.esm.js
浏览文件 @
1ebfad2e
...
@@ -53,6 +53,57 @@ function getBaseSystemInfo() {
...
@@ -53,6 +53,57 @@ function getBaseSystemInfo() {
return
tt
.
getSystemInfoSync
()
return
tt
.
getSystemInfoSync
()
}
}
const
E
=
function
()
{
// Keep this empty so it's easier to inherit from
// (via https://github.com/lipsmack from https://github.com/scottcorgan/tiny-emitter/issues/3)
};
E
.
prototype
=
{
on
:
function
(
name
,
callback
,
ctx
)
{
var
e
=
this
.
e
||
(
this
.
e
=
{});
(
e
[
name
]
||
(
e
[
name
]
=
[])).
push
({
fn
:
callback
,
ctx
:
ctx
,
});
return
this
;
},
once
:
function
(
name
,
callback
,
ctx
)
{
var
self
=
this
;
function
listener
()
{
self
.
off
(
name
,
listener
);
callback
.
apply
(
ctx
,
arguments
);
}
listener
.
_
=
callback
;
return
this
.
on
(
name
,
listener
,
ctx
);
},
emit
:
function
(
name
)
{
var
data
=
[].
slice
.
call
(
arguments
,
1
);
var
evtArr
=
((
this
.
e
||
(
this
.
e
=
{}))[
name
]
||
[]).
slice
();
var
i
=
0
;
var
len
=
evtArr
.
length
;
for
(
i
;
i
<
len
;
i
++
)
{
evtArr
[
i
].
fn
.
apply
(
evtArr
[
i
].
ctx
,
data
);
}
return
this
;
},
off
:
function
(
name
,
callback
)
{
var
e
=
this
.
e
||
(
this
.
e
=
{});
var
evts
=
e
[
name
];
var
liveEvents
=
[];
if
(
evts
&&
callback
)
{
for
(
var
i
=
0
,
len
=
evts
.
length
;
i
<
len
;
i
++
)
{
if
(
evts
[
i
].
fn
!==
callback
&&
evts
[
i
].
fn
.
_
!==
callback
)
liveEvents
.
push
(
evts
[
i
]);
}
}
// Remove event from queue to prevent memory leak
// Suggested by https://github.com/lazd
// Ref: https://github.com/scottcorgan/tiny-emitter/commit/c6ebfaa9bc973b33d110a84a307742b7cf94c953#commitcomment-5024910
liveEvents
.
length
?
(
e
[
name
]
=
liveEvents
)
:
delete
e
[
name
];
return
this
;
},
};
var
E$1
=
E
;
function
validateProtocolFail
(
name
,
msg
)
{
function
validateProtocolFail
(
name
,
msg
)
{
console
.
warn
(
`
${
name
}
:
${
msg
}
`
);
console
.
warn
(
`
${
name
}
:
${
msg
}
`
);
}
}
...
@@ -535,58 +586,7 @@ const EmitProtocol = [
...
@@ -535,58 +586,7 @@ const EmitProtocol = [
},
},
];
];
const
E
=
function
()
{
const
emitter
=
new
E$1
();
// Keep this empty so it's easier to inherit from
// (via https://github.com/lipsmack from https://github.com/scottcorgan/tiny-emitter/issues/3)
};
E
.
prototype
=
{
on
:
function
(
name
,
callback
,
ctx
)
{
var
e
=
this
.
e
||
(
this
.
e
=
{});
(
e
[
name
]
||
(
e
[
name
]
=
[])).
push
({
fn
:
callback
,
ctx
:
ctx
,
});
return
this
;
},
once
:
function
(
name
,
callback
,
ctx
)
{
var
self
=
this
;
function
listener
()
{
self
.
off
(
name
,
listener
);
callback
.
apply
(
ctx
,
arguments
);
}
listener
.
_
=
callback
;
return
this
.
on
(
name
,
listener
,
ctx
);
},
emit
:
function
(
name
)
{
var
data
=
[].
slice
.
call
(
arguments
,
1
);
var
evtArr
=
((
this
.
e
||
(
this
.
e
=
{}))[
name
]
||
[]).
slice
();
var
i
=
0
;
var
len
=
evtArr
.
length
;
for
(
i
;
i
<
len
;
i
++
)
{
evtArr
[
i
].
fn
.
apply
(
evtArr
[
i
].
ctx
,
data
);
}
return
this
;
},
off
:
function
(
name
,
callback
)
{
var
e
=
this
.
e
||
(
this
.
e
=
{});
var
evts
=
e
[
name
];
var
liveEvents
=
[];
if
(
evts
&&
callback
)
{
for
(
var
i
=
0
,
len
=
evts
.
length
;
i
<
len
;
i
++
)
{
if
(
evts
[
i
].
fn
!==
callback
&&
evts
[
i
].
fn
.
_
!==
callback
)
liveEvents
.
push
(
evts
[
i
]);
}
}
// Remove event from queue to prevent memory leak
// Suggested by https://github.com/lazd
// Ref: https://github.com/scottcorgan/tiny-emitter/commit/c6ebfaa9bc973b33d110a84a307742b7cf94c953#commitcomment-5024910
liveEvents
.
length
?
(
e
[
name
]
=
liveEvents
)
:
delete
e
[
name
];
return
this
;
},
};
var
Emitter
=
E
;
const
emitter
=
new
Emitter
();
const
$on
=
defineSyncApi
(
API_ON
,
(
name
,
callback
)
=>
{
const
$on
=
defineSyncApi
(
API_ON
,
(
name
,
callback
)
=>
{
emitter
.
on
(
name
,
callback
);
emitter
.
on
(
name
,
callback
);
return
()
=>
emitter
.
off
(
name
,
callback
);
return
()
=>
emitter
.
off
(
name
,
callback
);
...
...
packages/uni-mp-weixin/dist/uni.api.esm.js
浏览文件 @
1ebfad2e
...
@@ -17,6 +17,57 @@ function getBaseSystemInfo() {
...
@@ -17,6 +17,57 @@ function getBaseSystemInfo() {
return
wx
.
getSystemInfoSync
()
return
wx
.
getSystemInfoSync
()
}
}
const
E
=
function
()
{
// Keep this empty so it's easier to inherit from
// (via https://github.com/lipsmack from https://github.com/scottcorgan/tiny-emitter/issues/3)
};
E
.
prototype
=
{
on
:
function
(
name
,
callback
,
ctx
)
{
var
e
=
this
.
e
||
(
this
.
e
=
{});
(
e
[
name
]
||
(
e
[
name
]
=
[])).
push
({
fn
:
callback
,
ctx
:
ctx
,
});
return
this
;
},
once
:
function
(
name
,
callback
,
ctx
)
{
var
self
=
this
;
function
listener
()
{
self
.
off
(
name
,
listener
);
callback
.
apply
(
ctx
,
arguments
);
}
listener
.
_
=
callback
;
return
this
.
on
(
name
,
listener
,
ctx
);
},
emit
:
function
(
name
)
{
var
data
=
[].
slice
.
call
(
arguments
,
1
);
var
evtArr
=
((
this
.
e
||
(
this
.
e
=
{}))[
name
]
||
[]).
slice
();
var
i
=
0
;
var
len
=
evtArr
.
length
;
for
(
i
;
i
<
len
;
i
++
)
{
evtArr
[
i
].
fn
.
apply
(
evtArr
[
i
].
ctx
,
data
);
}
return
this
;
},
off
:
function
(
name
,
callback
)
{
var
e
=
this
.
e
||
(
this
.
e
=
{});
var
evts
=
e
[
name
];
var
liveEvents
=
[];
if
(
evts
&&
callback
)
{
for
(
var
i
=
0
,
len
=
evts
.
length
;
i
<
len
;
i
++
)
{
if
(
evts
[
i
].
fn
!==
callback
&&
evts
[
i
].
fn
.
_
!==
callback
)
liveEvents
.
push
(
evts
[
i
]);
}
}
// Remove event from queue to prevent memory leak
// Suggested by https://github.com/lazd
// Ref: https://github.com/scottcorgan/tiny-emitter/commit/c6ebfaa9bc973b33d110a84a307742b7cf94c953#commitcomment-5024910
liveEvents
.
length
?
(
e
[
name
]
=
liveEvents
)
:
delete
e
[
name
];
return
this
;
},
};
var
E$1
=
E
;
function
validateProtocolFail
(
name
,
msg
)
{
function
validateProtocolFail
(
name
,
msg
)
{
console
.
warn
(
`
${
name
}
:
${
msg
}
`
);
console
.
warn
(
`
${
name
}
:
${
msg
}
`
);
}
}
...
@@ -499,58 +550,7 @@ const EmitProtocol = [
...
@@ -499,58 +550,7 @@ const EmitProtocol = [
},
},
];
];
const
E
=
function
()
{
const
emitter
=
new
E$1
();
// Keep this empty so it's easier to inherit from
// (via https://github.com/lipsmack from https://github.com/scottcorgan/tiny-emitter/issues/3)
};
E
.
prototype
=
{
on
:
function
(
name
,
callback
,
ctx
)
{
var
e
=
this
.
e
||
(
this
.
e
=
{});
(
e
[
name
]
||
(
e
[
name
]
=
[])).
push
({
fn
:
callback
,
ctx
:
ctx
,
});
return
this
;
},
once
:
function
(
name
,
callback
,
ctx
)
{
var
self
=
this
;
function
listener
()
{
self
.
off
(
name
,
listener
);
callback
.
apply
(
ctx
,
arguments
);
}
listener
.
_
=
callback
;
return
this
.
on
(
name
,
listener
,
ctx
);
},
emit
:
function
(
name
)
{
var
data
=
[].
slice
.
call
(
arguments
,
1
);
var
evtArr
=
((
this
.
e
||
(
this
.
e
=
{}))[
name
]
||
[]).
slice
();
var
i
=
0
;
var
len
=
evtArr
.
length
;
for
(
i
;
i
<
len
;
i
++
)
{
evtArr
[
i
].
fn
.
apply
(
evtArr
[
i
].
ctx
,
data
);
}
return
this
;
},
off
:
function
(
name
,
callback
)
{
var
e
=
this
.
e
||
(
this
.
e
=
{});
var
evts
=
e
[
name
];
var
liveEvents
=
[];
if
(
evts
&&
callback
)
{
for
(
var
i
=
0
,
len
=
evts
.
length
;
i
<
len
;
i
++
)
{
if
(
evts
[
i
].
fn
!==
callback
&&
evts
[
i
].
fn
.
_
!==
callback
)
liveEvents
.
push
(
evts
[
i
]);
}
}
// Remove event from queue to prevent memory leak
// Suggested by https://github.com/lazd
// Ref: https://github.com/scottcorgan/tiny-emitter/commit/c6ebfaa9bc973b33d110a84a307742b7cf94c953#commitcomment-5024910
liveEvents
.
length
?
(
e
[
name
]
=
liveEvents
)
:
delete
e
[
name
];
return
this
;
},
};
var
Emitter
=
E
;
const
emitter
=
new
Emitter
();
const
$on
=
defineSyncApi
(
API_ON
,
(
name
,
callback
)
=>
{
const
$on
=
defineSyncApi
(
API_ON
,
(
name
,
callback
)
=>
{
emitter
.
on
(
name
,
callback
);
emitter
.
on
(
name
,
callback
);
return
()
=>
emitter
.
off
(
name
,
callback
);
return
()
=>
emitter
.
off
(
name
,
callback
);
...
...
packages/uni-quickapp-webview/dist/uni.api.esm.js
浏览文件 @
1ebfad2e
...
@@ -53,6 +53,57 @@ function getBaseSystemInfo() {
...
@@ -53,6 +53,57 @@ function getBaseSystemInfo() {
return
qa
.
getSystemInfoSync
()
return
qa
.
getSystemInfoSync
()
}
}
const
E
=
function
()
{
// Keep this empty so it's easier to inherit from
// (via https://github.com/lipsmack from https://github.com/scottcorgan/tiny-emitter/issues/3)
};
E
.
prototype
=
{
on
:
function
(
name
,
callback
,
ctx
)
{
var
e
=
this
.
e
||
(
this
.
e
=
{});
(
e
[
name
]
||
(
e
[
name
]
=
[])).
push
({
fn
:
callback
,
ctx
:
ctx
,
});
return
this
;
},
once
:
function
(
name
,
callback
,
ctx
)
{
var
self
=
this
;
function
listener
()
{
self
.
off
(
name
,
listener
);
callback
.
apply
(
ctx
,
arguments
);
}
listener
.
_
=
callback
;
return
this
.
on
(
name
,
listener
,
ctx
);
},
emit
:
function
(
name
)
{
var
data
=
[].
slice
.
call
(
arguments
,
1
);
var
evtArr
=
((
this
.
e
||
(
this
.
e
=
{}))[
name
]
||
[]).
slice
();
var
i
=
0
;
var
len
=
evtArr
.
length
;
for
(
i
;
i
<
len
;
i
++
)
{
evtArr
[
i
].
fn
.
apply
(
evtArr
[
i
].
ctx
,
data
);
}
return
this
;
},
off
:
function
(
name
,
callback
)
{
var
e
=
this
.
e
||
(
this
.
e
=
{});
var
evts
=
e
[
name
];
var
liveEvents
=
[];
if
(
evts
&&
callback
)
{
for
(
var
i
=
0
,
len
=
evts
.
length
;
i
<
len
;
i
++
)
{
if
(
evts
[
i
].
fn
!==
callback
&&
evts
[
i
].
fn
.
_
!==
callback
)
liveEvents
.
push
(
evts
[
i
]);
}
}
// Remove event from queue to prevent memory leak
// Suggested by https://github.com/lazd
// Ref: https://github.com/scottcorgan/tiny-emitter/commit/c6ebfaa9bc973b33d110a84a307742b7cf94c953#commitcomment-5024910
liveEvents
.
length
?
(
e
[
name
]
=
liveEvents
)
:
delete
e
[
name
];
return
this
;
},
};
var
E$1
=
E
;
function
validateProtocolFail
(
name
,
msg
)
{
function
validateProtocolFail
(
name
,
msg
)
{
console
.
warn
(
`
${
name
}
:
${
msg
}
`
);
console
.
warn
(
`
${
name
}
:
${
msg
}
`
);
}
}
...
@@ -535,58 +586,7 @@ const EmitProtocol = [
...
@@ -535,58 +586,7 @@ const EmitProtocol = [
},
},
];
];
const
E
=
function
()
{
const
emitter
=
new
E$1
();
// Keep this empty so it's easier to inherit from
// (via https://github.com/lipsmack from https://github.com/scottcorgan/tiny-emitter/issues/3)
};
E
.
prototype
=
{
on
:
function
(
name
,
callback
,
ctx
)
{
var
e
=
this
.
e
||
(
this
.
e
=
{});
(
e
[
name
]
||
(
e
[
name
]
=
[])).
push
({
fn
:
callback
,
ctx
:
ctx
,
});
return
this
;
},
once
:
function
(
name
,
callback
,
ctx
)
{
var
self
=
this
;
function
listener
()
{
self
.
off
(
name
,
listener
);
callback
.
apply
(
ctx
,
arguments
);
}
listener
.
_
=
callback
;
return
this
.
on
(
name
,
listener
,
ctx
);
},
emit
:
function
(
name
)
{
var
data
=
[].
slice
.
call
(
arguments
,
1
);
var
evtArr
=
((
this
.
e
||
(
this
.
e
=
{}))[
name
]
||
[]).
slice
();
var
i
=
0
;
var
len
=
evtArr
.
length
;
for
(
i
;
i
<
len
;
i
++
)
{
evtArr
[
i
].
fn
.
apply
(
evtArr
[
i
].
ctx
,
data
);
}
return
this
;
},
off
:
function
(
name
,
callback
)
{
var
e
=
this
.
e
||
(
this
.
e
=
{});
var
evts
=
e
[
name
];
var
liveEvents
=
[];
if
(
evts
&&
callback
)
{
for
(
var
i
=
0
,
len
=
evts
.
length
;
i
<
len
;
i
++
)
{
if
(
evts
[
i
].
fn
!==
callback
&&
evts
[
i
].
fn
.
_
!==
callback
)
liveEvents
.
push
(
evts
[
i
]);
}
}
// Remove event from queue to prevent memory leak
// Suggested by https://github.com/lazd
// Ref: https://github.com/scottcorgan/tiny-emitter/commit/c6ebfaa9bc973b33d110a84a307742b7cf94c953#commitcomment-5024910
liveEvents
.
length
?
(
e
[
name
]
=
liveEvents
)
:
delete
e
[
name
];
return
this
;
},
};
var
Emitter
=
E
;
const
emitter
=
new
Emitter
();
const
$on
=
defineSyncApi
(
API_ON
,
(
name
,
callback
)
=>
{
const
$on
=
defineSyncApi
(
API_ON
,
(
name
,
callback
)
=>
{
emitter
.
on
(
name
,
callback
);
emitter
.
on
(
name
,
callback
);
return
()
=>
emitter
.
off
(
name
,
callback
);
return
()
=>
emitter
.
off
(
name
,
callback
);
...
...
packages/uni-shared/dist/uni-shared.cjs.js
浏览文件 @
1ebfad2e
...
@@ -1286,6 +1286,57 @@ const MINI_PROGRAM_PAGE_RUNTIME_HOOKS = {
...
@@ -1286,6 +1286,57 @@ const MINI_PROGRAM_PAGE_RUNTIME_HOOKS = {
onShareTimeline
:
1
<<
2
,
onShareTimeline
:
1
<<
2
,
};
};
const
E
=
function
()
{
// Keep this empty so it's easier to inherit from
// (via https://github.com/lipsmack from https://github.com/scottcorgan/tiny-emitter/issues/3)
};
E
.
prototype
=
{
on
:
function
(
name
,
callback
,
ctx
)
{
var
e
=
this
.
e
||
(
this
.
e
=
{});
(
e
[
name
]
||
(
e
[
name
]
=
[])).
push
({
fn
:
callback
,
ctx
:
ctx
,
});
return
this
;
},
once
:
function
(
name
,
callback
,
ctx
)
{
var
self
=
this
;
function
listener
()
{
self
.
off
(
name
,
listener
);
callback
.
apply
(
ctx
,
arguments
);
}
listener
.
_
=
callback
;
return
this
.
on
(
name
,
listener
,
ctx
);
},
emit
:
function
(
name
)
{
var
data
=
[].
slice
.
call
(
arguments
,
1
);
var
evtArr
=
((
this
.
e
||
(
this
.
e
=
{}))[
name
]
||
[]).
slice
();
var
i
=
0
;
var
len
=
evtArr
.
length
;
for
(
i
;
i
<
len
;
i
++
)
{
evtArr
[
i
].
fn
.
apply
(
evtArr
[
i
].
ctx
,
data
);
}
return
this
;
},
off
:
function
(
name
,
callback
)
{
var
e
=
this
.
e
||
(
this
.
e
=
{});
var
evts
=
e
[
name
];
var
liveEvents
=
[];
if
(
evts
&&
callback
)
{
for
(
var
i
=
0
,
len
=
evts
.
length
;
i
<
len
;
i
++
)
{
if
(
evts
[
i
].
fn
!==
callback
&&
evts
[
i
].
fn
.
_
!==
callback
)
liveEvents
.
push
(
evts
[
i
]);
}
}
// Remove event from queue to prevent memory leak
// Suggested by https://github.com/lazd
// Ref: https://github.com/scottcorgan/tiny-emitter/commit/c6ebfaa9bc973b33d110a84a307742b7cf94c953#commitcomment-5024910
liveEvents
.
length
?
(
e
[
name
]
=
liveEvents
)
:
delete
e
[
name
];
return
this
;
},
};
var
E$1
=
E
;
function
getEnvLocale
()
{
function
getEnvLocale
()
{
const
{
env
}
=
process
;
const
{
env
}
=
process
;
const
lang
=
env
.
LC_ALL
||
env
.
LC_MESSAGES
||
env
.
LANG
||
env
.
LANGUAGE
;
const
lang
=
env
.
LC_ALL
||
env
.
LC_MESSAGES
||
env
.
LANG
||
env
.
LANGUAGE
;
...
@@ -1320,6 +1371,7 @@ exports.COMPONENT_NAME_PREFIX = COMPONENT_NAME_PREFIX;
...
@@ -1320,6 +1371,7 @@ exports.COMPONENT_NAME_PREFIX = COMPONENT_NAME_PREFIX;
exports
.
COMPONENT_PREFIX
=
COMPONENT_PREFIX
;
exports
.
COMPONENT_PREFIX
=
COMPONENT_PREFIX
;
exports
.
COMPONENT_SELECTOR_PREFIX
=
COMPONENT_SELECTOR_PREFIX
;
exports
.
COMPONENT_SELECTOR_PREFIX
=
COMPONENT_SELECTOR_PREFIX
;
exports
.
DATA_RE
=
DATA_RE
;
exports
.
DATA_RE
=
DATA_RE
;
exports
.
Emitter
=
E$1
;
exports
.
EventChannel
=
EventChannel
;
exports
.
EventChannel
=
EventChannel
;
exports
.
EventModifierFlags
=
EventModifierFlags
;
exports
.
EventModifierFlags
=
EventModifierFlags
;
exports
.
I18N_JSON_DELIMITERS
=
I18N_JSON_DELIMITERS
;
exports
.
I18N_JSON_DELIMITERS
=
I18N_JSON_DELIMITERS
;
...
...
packages/uni-shared/dist/uni-shared.d.ts
浏览文件 @
1ebfad2e
...
@@ -164,6 +164,18 @@ declare type DictArray = [number, number][];
...
@@ -164,6 +164,18 @@ declare type DictArray = [number, number][];
export
declare
function
dynamicSlotName
(
name
:
string
):
string
;
export
declare
function
dynamicSlotName
(
name
:
string
):
string
;
export
declare
interface
Emitter
{
e
:
Record
<
string
,
unknown
>
;
on
:
(
name
:
EventName
,
callback
:
EventCallback
,
ctx
?:
any
)
=>
this
;
once
:
(
name
:
EventName
,
callback
:
EventCallback
,
ctx
?:
any
)
=>
this
;
emit
:
(
name
:
EventName
,
...
args
:
any
[])
=>
this
;
off
:
(
name
:
EventName
,
callback
?:
EventCallback
)
=>
this
;
}
export
declare
const
Emitter
:
new
()
=>
Emitter
;
declare
type
EventCallback
=
Function
;
export
declare
class
EventChannel
{
export
declare
class
EventChannel
{
id
?:
number
;
id
?:
number
;
private
listener
;
private
listener
;
...
@@ -188,6 +200,8 @@ export declare const EventModifierFlags: {
...
@@ -188,6 +200,8 @@ export declare const EventModifierFlags: {
self
:
number
;
self
:
number
;
};
};
declare
type
EventName
=
string
;
export
declare
const
forcePatchProp
:
(
el
:
{
export
declare
const
forcePatchProp
:
(
el
:
{
nodeName
:
string
;
nodeName
:
string
;
},
key
:
string
)
=>
boolean
;
},
key
:
string
)
=>
boolean
;
...
...
packages/uni-shared/dist/uni-shared.es.js
浏览文件 @
1ebfad2e
...
@@ -1282,10 +1282,61 @@ const MINI_PROGRAM_PAGE_RUNTIME_HOOKS = {
...
@@ -1282,10 +1282,61 @@ const MINI_PROGRAM_PAGE_RUNTIME_HOOKS = {
onShareTimeline
:
1
<<
2
,
onShareTimeline
:
1
<<
2
,
};
};
const
E
=
function
()
{
// Keep this empty so it's easier to inherit from
// (via https://github.com/lipsmack from https://github.com/scottcorgan/tiny-emitter/issues/3)
};
E
.
prototype
=
{
on
:
function
(
name
,
callback
,
ctx
)
{
var
e
=
this
.
e
||
(
this
.
e
=
{});
(
e
[
name
]
||
(
e
[
name
]
=
[])).
push
({
fn
:
callback
,
ctx
:
ctx
,
});
return
this
;
},
once
:
function
(
name
,
callback
,
ctx
)
{
var
self
=
this
;
function
listener
()
{
self
.
off
(
name
,
listener
);
callback
.
apply
(
ctx
,
arguments
);
}
listener
.
_
=
callback
;
return
this
.
on
(
name
,
listener
,
ctx
);
},
emit
:
function
(
name
)
{
var
data
=
[].
slice
.
call
(
arguments
,
1
);
var
evtArr
=
((
this
.
e
||
(
this
.
e
=
{}))[
name
]
||
[]).
slice
();
var
i
=
0
;
var
len
=
evtArr
.
length
;
for
(
i
;
i
<
len
;
i
++
)
{
evtArr
[
i
].
fn
.
apply
(
evtArr
[
i
].
ctx
,
data
);
}
return
this
;
},
off
:
function
(
name
,
callback
)
{
var
e
=
this
.
e
||
(
this
.
e
=
{});
var
evts
=
e
[
name
];
var
liveEvents
=
[];
if
(
evts
&&
callback
)
{
for
(
var
i
=
0
,
len
=
evts
.
length
;
i
<
len
;
i
++
)
{
if
(
evts
[
i
].
fn
!==
callback
&&
evts
[
i
].
fn
.
_
!==
callback
)
liveEvents
.
push
(
evts
[
i
]);
}
}
// Remove event from queue to prevent memory leak
// Suggested by https://github.com/lazd
// Ref: https://github.com/scottcorgan/tiny-emitter/commit/c6ebfaa9bc973b33d110a84a307742b7cf94c953#commitcomment-5024910
liveEvents
.
length
?
(
e
[
name
]
=
liveEvents
)
:
delete
e
[
name
];
return
this
;
},
};
var
E$1
=
E
;
function
getEnvLocale
()
{
function
getEnvLocale
()
{
const
{
env
}
=
process
;
const
{
env
}
=
process
;
const
lang
=
env
.
LC_ALL
||
env
.
LC_MESSAGES
||
env
.
LANG
||
env
.
LANGUAGE
;
const
lang
=
env
.
LC_ALL
||
env
.
LC_MESSAGES
||
env
.
LANG
||
env
.
LANGUAGE
;
return
(
lang
&&
lang
.
replace
(
/
[
.:
]
.*/
,
''
))
||
'
en
'
;
return
(
lang
&&
lang
.
replace
(
/
[
.:
]
.*/
,
''
))
||
'
en
'
;
}
}
export
{
ACTION_TYPE_ADD_EVENT
,
ACTION_TYPE_ADD_WXS_EVENT
,
ACTION_TYPE_CREATE
,
ACTION_TYPE_EVENT
,
ACTION_TYPE_INSERT
,
ACTION_TYPE_PAGE_CREATE
,
ACTION_TYPE_PAGE_CREATED
,
ACTION_TYPE_PAGE_SCROLL
,
ACTION_TYPE_REMOVE
,
ACTION_TYPE_REMOVE_ATTRIBUTE
,
ACTION_TYPE_REMOVE_EVENT
,
ACTION_TYPE_SET_ATTRIBUTE
,
ACTION_TYPE_SET_TEXT
,
ATTR_CHANGE_PREFIX
,
ATTR_CLASS
,
ATTR_INNER_HTML
,
ATTR_STYLE
,
ATTR_TEXT_CONTENT
,
ATTR_V_OWNER_ID
,
ATTR_V_RENDERJS
,
ATTR_V_SHOW
,
BACKGROUND_COLOR
,
BUILT_IN_TAGS
,
BUILT_IN_TAG_NAMES
,
COMPONENT_NAME_PREFIX
,
COMPONENT_PREFIX
,
COMPONENT_SELECTOR_PREFIX
,
DATA_RE
,
EventChannel
,
EventModifierFlags
,
I18N_JSON_DELIMITERS
,
JSON_PROTOCOL
,
LINEFEED
,
MINI_PROGRAM_PAGE_RUNTIME_HOOKS
,
NAVBAR_HEIGHT
,
NODE_TYPE_COMMENT
,
NODE_TYPE_ELEMENT
,
NODE_TYPE_PAGE
,
NODE_TYPE_TEXT
,
NVUE_BUILT_IN_TAGS
,
NVUE_U_BUILT_IN_TAGS
,
ON_ADD_TO_FAVORITES
,
ON_APP_ENTER_BACKGROUND
,
ON_APP_ENTER_FOREGROUND
,
ON_BACK_PRESS
,
ON_ERROR
,
ON_HIDE
,
ON_KEYBOARD_HEIGHT_CHANGE
,
ON_LAUNCH
,
ON_LOAD
,
ON_NAVIGATION_BAR_BUTTON_TAP
,
ON_NAVIGATION_BAR_SEARCH_INPUT_CHANGED
,
ON_NAVIGATION_BAR_SEARCH_INPUT_CLICKED
,
ON_NAVIGATION_BAR_SEARCH_INPUT_CONFIRMED
,
ON_NAVIGATION_BAR_SEARCH_INPUT_FOCUS_CHANGED
,
ON_PAGE_NOT_FOUND
,
ON_PAGE_SCROLL
,
ON_PULL_DOWN_REFRESH
,
ON_REACH_BOTTOM
,
ON_REACH_BOTTOM_DISTANCE
,
ON_READY
,
ON_RESIZE
,
ON_SHARE_APP_MESSAGE
,
ON_SHARE_TIMELINE
,
ON_SHOW
,
ON_TAB_ITEM_TAP
,
ON_THEME_CHANGE
,
ON_UNHANDLE_REJECTION
,
ON_UNLOAD
,
ON_WEB_INVOKE_APP_SERVICE
,
ON_WXS_INVOKE_CALL_METHOD
,
PLUS_RE
,
PRIMARY_COLOR
,
RENDERJS_MODULES
,
RESPONSIVE_MIN_WIDTH
,
SCHEME_RE
,
SELECTED_COLOR
,
SLOT_DEFAULT_NAME
,
TABBAR_HEIGHT
,
TAGS
,
UNI_SSR
,
UNI_SSR_DATA
,
UNI_SSR_GLOBAL_DATA
,
UNI_SSR_STORE
,
UNI_SSR_TITLE
,
UNI_STORAGE_LOCALE
,
UniBaseNode
,
UniCommentNode
,
UniElement
,
UniEvent
,
UniInputElement
,
UniLifecycleHooks
,
UniNode
,
UniTextAreaElement
,
UniTextNode
,
WEB_INVOKE_APPSERVICE
,
WXS_MODULES
,
WXS_PROTOCOL
,
addFont
,
addLeadingSlash
,
cache
,
cacheStringFunction
,
callOptions
,
createIsCustomElement
,
createRpx2Unit
,
createUniEvent
,
customizeEvent
,
debounce
,
decode
,
decodedQuery
,
defaultMiniProgramRpx2Unit
,
defaultNVueRpx2Unit
,
defaultRpx2Unit
,
dynamicSlotName
,
forcePatchProp
,
formatAppLog
,
formatDateTime
,
formatH5Log
,
formatLog
,
getCustomDataset
,
getEnvLocale
,
getLen
,
getValueByDataPath
,
initCustomDataset
,
invokeArrayFns
,
isAppNVueNativeTag
,
isAppNativeTag
,
isBuiltInComponent
,
isComponentInternalInstance
,
isComponentTag
,
isH5CustomElement
,
isH5NativeTag
,
isMiniProgramNativeTag
,
isRootHook
,
normalizeDataset
,
normalizeEventType
,
normalizeTarget
,
once
,
parseEventName
,
parseQuery
,
parseUrl
,
passive
,
plusReady
,
removeLeadingSlash
,
resolveComponentInstance
,
resolveOwnerEl
,
resolveOwnerVm
,
sanitise
,
scrollTo
,
stringifyQuery
,
updateElementStyle
};
export
{
ACTION_TYPE_ADD_EVENT
,
ACTION_TYPE_ADD_WXS_EVENT
,
ACTION_TYPE_CREATE
,
ACTION_TYPE_EVENT
,
ACTION_TYPE_INSERT
,
ACTION_TYPE_PAGE_CREATE
,
ACTION_TYPE_PAGE_CREATED
,
ACTION_TYPE_PAGE_SCROLL
,
ACTION_TYPE_REMOVE
,
ACTION_TYPE_REMOVE_ATTRIBUTE
,
ACTION_TYPE_REMOVE_EVENT
,
ACTION_TYPE_SET_ATTRIBUTE
,
ACTION_TYPE_SET_TEXT
,
ATTR_CHANGE_PREFIX
,
ATTR_CLASS
,
ATTR_INNER_HTML
,
ATTR_STYLE
,
ATTR_TEXT_CONTENT
,
ATTR_V_OWNER_ID
,
ATTR_V_RENDERJS
,
ATTR_V_SHOW
,
BACKGROUND_COLOR
,
BUILT_IN_TAGS
,
BUILT_IN_TAG_NAMES
,
COMPONENT_NAME_PREFIX
,
COMPONENT_PREFIX
,
COMPONENT_SELECTOR_PREFIX
,
DATA_RE
,
E
$1
as
Emitter
,
E
ventChannel
,
EventModifierFlags
,
I18N_JSON_DELIMITERS
,
JSON_PROTOCOL
,
LINEFEED
,
MINI_PROGRAM_PAGE_RUNTIME_HOOKS
,
NAVBAR_HEIGHT
,
NODE_TYPE_COMMENT
,
NODE_TYPE_ELEMENT
,
NODE_TYPE_PAGE
,
NODE_TYPE_TEXT
,
NVUE_BUILT_IN_TAGS
,
NVUE_U_BUILT_IN_TAGS
,
ON_ADD_TO_FAVORITES
,
ON_APP_ENTER_BACKGROUND
,
ON_APP_ENTER_FOREGROUND
,
ON_BACK_PRESS
,
ON_ERROR
,
ON_HIDE
,
ON_KEYBOARD_HEIGHT_CHANGE
,
ON_LAUNCH
,
ON_LOAD
,
ON_NAVIGATION_BAR_BUTTON_TAP
,
ON_NAVIGATION_BAR_SEARCH_INPUT_CHANGED
,
ON_NAVIGATION_BAR_SEARCH_INPUT_CLICKED
,
ON_NAVIGATION_BAR_SEARCH_INPUT_CONFIRMED
,
ON_NAVIGATION_BAR_SEARCH_INPUT_FOCUS_CHANGED
,
ON_PAGE_NOT_FOUND
,
ON_PAGE_SCROLL
,
ON_PULL_DOWN_REFRESH
,
ON_REACH_BOTTOM
,
ON_REACH_BOTTOM_DISTANCE
,
ON_READY
,
ON_RESIZE
,
ON_SHARE_APP_MESSAGE
,
ON_SHARE_TIMELINE
,
ON_SHOW
,
ON_TAB_ITEM_TAP
,
ON_THEME_CHANGE
,
ON_UNHANDLE_REJECTION
,
ON_UNLOAD
,
ON_WEB_INVOKE_APP_SERVICE
,
ON_WXS_INVOKE_CALL_METHOD
,
PLUS_RE
,
PRIMARY_COLOR
,
RENDERJS_MODULES
,
RESPONSIVE_MIN_WIDTH
,
SCHEME_RE
,
SELECTED_COLOR
,
SLOT_DEFAULT_NAME
,
TABBAR_HEIGHT
,
TAGS
,
UNI_SSR
,
UNI_SSR_DATA
,
UNI_SSR_GLOBAL_DATA
,
UNI_SSR_STORE
,
UNI_SSR_TITLE
,
UNI_STORAGE_LOCALE
,
UniBaseNode
,
UniCommentNode
,
UniElement
,
UniEvent
,
UniInputElement
,
UniLifecycleHooks
,
UniNode
,
UniTextAreaElement
,
UniTextNode
,
WEB_INVOKE_APPSERVICE
,
WXS_MODULES
,
WXS_PROTOCOL
,
addFont
,
addLeadingSlash
,
cache
,
cacheStringFunction
,
callOptions
,
createIsCustomElement
,
createRpx2Unit
,
createUniEvent
,
customizeEvent
,
debounce
,
decode
,
decodedQuery
,
defaultMiniProgramRpx2Unit
,
defaultNVueRpx2Unit
,
defaultRpx2Unit
,
dynamicSlotName
,
forcePatchProp
,
formatAppLog
,
formatDateTime
,
formatH5Log
,
formatLog
,
getCustomDataset
,
getEnvLocale
,
getLen
,
getValueByDataPath
,
initCustomDataset
,
invokeArrayFns
,
isAppNVueNativeTag
,
isAppNativeTag
,
isBuiltInComponent
,
isComponentInternalInstance
,
isComponentTag
,
isH5CustomElement
,
isH5NativeTag
,
isMiniProgramNativeTag
,
isRootHook
,
normalizeDataset
,
normalizeEventType
,
normalizeTarget
,
once
,
parseEventName
,
parseQuery
,
parseUrl
,
passive
,
plusReady
,
removeLeadingSlash
,
resolveComponentInstance
,
resolveOwnerEl
,
resolveOwnerVm
,
sanitise
,
scrollTo
,
stringifyQuery
,
updateElementStyle
};
packages/uni-
core/src/helpers
/TinyEmitter.ts
→
packages/uni-
shared/src
/TinyEmitter.ts
浏览文件 @
1ebfad2e
interface
E
{
interface
E
{
e
:
Data
e
:
Record
<
string
,
unknown
>
on
:
(
name
:
EventName
,
callback
:
EventCallback
,
ctx
?:
any
)
=>
this
on
:
(
name
:
EventName
,
callback
:
EventCallback
,
ctx
?:
any
)
=>
this
once
:
(
name
:
EventName
,
callback
:
EventCallback
,
ctx
?:
any
)
=>
this
once
:
(
name
:
EventName
,
callback
:
EventCallback
,
ctx
?:
any
)
=>
this
emit
:
(
name
:
EventName
,
...
args
:
any
[])
=>
this
emit
:
(
name
:
EventName
,
...
args
:
any
[])
=>
this
...
...
packages/uni-shared/src/index.ts
浏览文件 @
1ebfad2e
...
@@ -13,5 +13,6 @@ export * from './debounce'
...
@@ -13,5 +13,6 @@ export * from './debounce'
export
*
from
'
./constants
'
export
*
from
'
./constants
'
export
*
from
'
./EventChannel
'
export
*
from
'
./EventChannel
'
export
*
from
'
./lifecycle
'
export
*
from
'
./lifecycle
'
export
{
default
as
Emitter
}
from
'
./TinyEmitter
'
export
*
from
'
./node/locale
'
export
*
from
'
./node/locale
'
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录